typedef unsigned char   undefined;

typedef unsigned char    bool;
typedef unsigned char    byte;
typedef unsigned int    dword;
typedef unsigned long long    GUID;
typedef pointer32 ImageBaseOffset32;

typedef long long    longlong;
typedef unsigned long long    qword;
typedef unsigned char    uchar;
typedef unsigned int    uint;
typedef unsigned long    ulong;
typedef unsigned long long    ulonglong;
typedef unsigned char    undefined1;
typedef unsigned short    undefined2;
typedef unsigned int    undefined4;
typedef unsigned long long    undefined8;
typedef unsigned short    ushort;
typedef unsigned short    wchar16;
typedef short    wchar_t;
typedef unsigned short    word;
typedef struct _s__RTTIBaseClassDescriptor _s__RTTIBaseClassDescriptor, *P_s__RTTIBaseClassDescriptor;

typedef struct _s__RTTIBaseClassDescriptor RTTIBaseClassDescriptor;

typedef RTTIBaseClassDescriptor *RTTIBaseClassDescriptor *32 __((image-base-relative));

typedef RTTIBaseClassDescriptor *32 __((image-base-relative)) *RTTIBaseClassDescriptor *32 __((image-base-relative)) *32 __((image-base-relative));

typedef struct PMD PMD, *PPMD;

struct PMD {
    int mdisp;
    int pdisp;
    int vdisp;
};

struct _s__RTTIBaseClassDescriptor {
    ImageBaseOffset32 pTypeDescriptor; // ref to TypeDescriptor (RTTI 0) for class
    dword numContainedBases; // count of extended classes in BaseClassArray (RTTI 2)
    struct PMD where; // member displacement structure
    dword attributes; // bit flags
    ImageBaseOffset32 pClassHierarchyDescriptor; // ref to ClassHierarchyDescriptor (RTTI 3) for class
};

typedef struct _com_error _com_error, *P_com_error;

struct _com_error { // PlaceHolder Class Structure
};

typedef struct _s_UnwindMapEntry _s_UnwindMapEntry, *P_s_UnwindMapEntry;

typedef struct _s_UnwindMapEntry UnwindMapEntry;

typedef int __ehstate_t;

struct _s_UnwindMapEntry {
    __ehstate_t toState;
    ImageBaseOffset32 action;
};

typedef struct _s_IPToStateMapEntry _s_IPToStateMapEntry, *P_s_IPToStateMapEntry;

typedef struct _s_IPToStateMapEntry IPToStateMapEntry;

struct _s_IPToStateMapEntry {
    ImageBaseOffset32 Ip;
    __ehstate_t state;
};

typedef union IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryUnion IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryUnion, *PIMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryUnion;

typedef struct IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryStruct IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryStruct, *PIMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryStruct;

struct IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryStruct {
    dword OffsetToDirectory:31;
    dword DataIsDirectory:1;
};

union IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryUnion {
    dword OffsetToData;
    struct IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryStruct IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryStruct;
};

typedef struct type_info type_info, *Ptype_info;

struct type_info { // PlaceHolder Class Structure
};

typedef struct _s_HandlerType _s_HandlerType, *P_s_HandlerType;

typedef struct _s_HandlerType HandlerType;

struct _s_HandlerType {
    uint adjectives;
    ImageBaseOffset32 dispType;
    int dispCatchObj;
    ImageBaseOffset32 dispOfHandler;
    dword dispFrame;
};

typedef struct CLIENT_ID CLIENT_ID, *PCLIENT_ID;

struct CLIENT_ID {
    void *UniqueProcess;
    void *UniqueThread;
};

typedef struct _s__RTTIClassHierarchyDescriptor _s__RTTIClassHierarchyDescriptor, *P_s__RTTIClassHierarchyDescriptor;

typedef struct _s__RTTIClassHierarchyDescriptor RTTIClassHierarchyDescriptor;

struct _s__RTTIClassHierarchyDescriptor {
    dword signature;
    dword attributes; // bit flags
    dword numBaseClasses; // number of base classes (i.e. rtti1Count)
    RTTIBaseClassDescriptor *32 __((image-base-relative)) *32 __((image-base-relative)) pBaseClassArray; // ref to BaseClassArray (RTTI 2)
};

typedef struct _s_TryBlockMapEntry _s_TryBlockMapEntry, *P_s_TryBlockMapEntry;

typedef struct _s_TryBlockMapEntry TryBlockMapEntry;

struct _s_TryBlockMapEntry {
    __ehstate_t tryLow;
    __ehstate_t tryHigh;
    __ehstate_t catchHigh;
    int nCatches;
    ImageBaseOffset32 dispHandlerArray;
};

typedef struct _s__RTTICompleteObjectLocator _s__RTTICompleteObjectLocator, *P_s__RTTICompleteObjectLocator;

typedef struct _s__RTTICompleteObjectLocator RTTICompleteObjectLocator;

struct _s__RTTICompleteObjectLocator {
    dword signature;
    dword offset; // offset of vbtable within class
    dword cdOffset; // constructor displacement offset
    ImageBaseOffset32 pTypeDescriptor; // ref to TypeDescriptor (RTTI 0) for class
    ImageBaseOffset32 pClassDescriptor; // ref to ClassHierarchyDescriptor (RTTI 3)
};

typedef struct _s_FuncInfo _s_FuncInfo, *P_s_FuncInfo;

struct _s_FuncInfo {
    uint magicNumber_and_bbtFlags;
    __ehstate_t maxState;
    ImageBaseOffset32 dispUnwindMap;
    uint nTryBlocks;
    ImageBaseOffset32 dispTryBlockMap;
    uint nIPMapEntries;
    ImageBaseOffset32 dispIPToStateMap;
    int dispUnwindHelp;
    ImageBaseOffset32 dispESTypeList;
    int EHFlags;
};

typedef struct _IMAGE_RUNTIME_FUNCTION_ENTRY _IMAGE_RUNTIME_FUNCTION_ENTRY, *P_IMAGE_RUNTIME_FUNCTION_ENTRY;

struct _IMAGE_RUNTIME_FUNCTION_ENTRY {
    ImageBaseOffset32 BeginAddress;
    dword EndAddress; // Apply ImageBaseOffset32 to see reference
    ImageBaseOffset32 UnwindInfoAddressOrData;
};

typedef ulonglong __uint64;

typedef struct _s_FuncInfo FuncInfo;

typedef ulong DWORD;

typedef DWORD LCTYPE;

typedef struct _SYSTEM_INFO _SYSTEM_INFO, *P_SYSTEM_INFO;

typedef struct _SYSTEM_INFO *LPSYSTEM_INFO;

typedef union _union_552 _union_552, *P_union_552;

typedef void *LPVOID;

typedef ulonglong ULONG_PTR;

typedef ULONG_PTR DWORD_PTR;

typedef ushort WORD;

typedef struct _struct_553 _struct_553, *P_struct_553;

struct _struct_553 {
    WORD wProcessorArchitecture;
    WORD wReserved;
};

union _union_552 {
    DWORD dwOemId;
    struct _struct_553 s;
};

struct _SYSTEM_INFO {
    union _union_552 u;
    DWORD dwPageSize;
    LPVOID lpMinimumApplicationAddress;
    LPVOID lpMaximumApplicationAddress;
    DWORD_PTR dwActiveProcessorMask;
    DWORD dwNumberOfProcessors;
    DWORD dwProcessorType;
    DWORD dwAllocationGranularity;
    WORD wProcessorLevel;
    WORD wProcessorRevision;
};

typedef struct _SECURITY_ATTRIBUTES _SECURITY_ATTRIBUTES, *P_SECURITY_ATTRIBUTES;

typedef int BOOL;

struct _SECURITY_ATTRIBUTES {
    DWORD nLength;
    LPVOID lpSecurityDescriptor;
    BOOL bInheritHandle;
};

typedef struct _OVERLAPPED _OVERLAPPED, *P_OVERLAPPED;

typedef union _union_540 _union_540, *P_union_540;

typedef void *HANDLE;

typedef struct _struct_541 _struct_541, *P_struct_541;

typedef void *PVOID;

struct _struct_541 {
    DWORD Offset;
    DWORD OffsetHigh;
};

union _union_540 {
    struct _struct_541 s;
    PVOID Pointer;
};

struct _OVERLAPPED {
    ULONG_PTR Internal;
    ULONG_PTR InternalHigh;
    union _union_540 u;
    HANDLE hEvent;
};

typedef struct _SYSTEMTIME _SYSTEMTIME, *P_SYSTEMTIME;

typedef struct _SYSTEMTIME SYSTEMTIME;

struct _SYSTEMTIME {
    WORD wYear;
    WORD wMonth;
    WORD wDayOfWeek;
    WORD wDay;
    WORD wHour;
    WORD wMinute;
    WORD wSecond;
    WORD wMilliseconds;
};

typedef struct _RTL_CRITICAL_SECTION _RTL_CRITICAL_SECTION, *P_RTL_CRITICAL_SECTION;

typedef struct _RTL_CRITICAL_SECTION *PRTL_CRITICAL_SECTION;

typedef PRTL_CRITICAL_SECTION LPCRITICAL_SECTION;

typedef struct _RTL_CRITICAL_SECTION_DEBUG _RTL_CRITICAL_SECTION_DEBUG, *P_RTL_CRITICAL_SECTION_DEBUG;

typedef struct _RTL_CRITICAL_SECTION_DEBUG *PRTL_CRITICAL_SECTION_DEBUG;

typedef long LONG;

typedef struct _LIST_ENTRY _LIST_ENTRY, *P_LIST_ENTRY;

typedef struct _LIST_ENTRY LIST_ENTRY;

struct _RTL_CRITICAL_SECTION {
    PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
    LONG LockCount;
    LONG RecursionCount;
    HANDLE OwningThread;
    HANDLE LockSemaphore;
    ULONG_PTR SpinCount;
};

struct _LIST_ENTRY {
    struct _LIST_ENTRY *Flink;
    struct _LIST_ENTRY *Blink;
};

struct _RTL_CRITICAL_SECTION_DEBUG {
    WORD Type;
    WORD CreatorBackTraceIndex;
    struct _RTL_CRITICAL_SECTION *CriticalSection;
    LIST_ENTRY ProcessLocksList;
    DWORD EntryCount;
    DWORD ContentionCount;
    DWORD Flags;
    WORD CreatorBackTraceIndexHigh;
    WORD SpareWORD;
};

typedef struct _OVERLAPPED *LPOVERLAPPED;

typedef DWORD (*PTHREAD_START_ROUTINE)(LPVOID);

typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;

typedef struct _EXCEPTION_POINTERS _EXCEPTION_POINTERS, *P_EXCEPTION_POINTERS;

typedef LONG (*PTOP_LEVEL_EXCEPTION_FILTER)(struct _EXCEPTION_POINTERS *);

typedef struct _EXCEPTION_RECORD _EXCEPTION_RECORD, *P_EXCEPTION_RECORD;

typedef struct _EXCEPTION_RECORD EXCEPTION_RECORD;

typedef EXCEPTION_RECORD *PEXCEPTION_RECORD;

typedef struct _CONTEXT _CONTEXT, *P_CONTEXT;

typedef struct _CONTEXT *PCONTEXT;

typedef ulonglong DWORD64;

typedef union _union_54 _union_54, *P_union_54;

typedef struct _M128A _M128A, *P_M128A;

typedef struct _M128A M128A;

typedef struct _XSAVE_FORMAT _XSAVE_FORMAT, *P_XSAVE_FORMAT;

typedef struct _XSAVE_FORMAT XSAVE_FORMAT;

typedef XSAVE_FORMAT XMM_SAVE_AREA32;

typedef struct _struct_55 _struct_55, *P_struct_55;

typedef ulonglong ULONGLONG;

typedef longlong LONGLONG;

typedef uchar BYTE;

struct _M128A {
    ULONGLONG Low;
    LONGLONG High;
};

struct _XSAVE_FORMAT {
    WORD ControlWord;
    WORD StatusWord;
    BYTE TagWord;
    BYTE Reserved1;
    WORD ErrorOpcode;
    DWORD ErrorOffset;
    WORD ErrorSelector;
    WORD Reserved2;
    DWORD DataOffset;
    WORD DataSelector;
    WORD Reserved3;
    DWORD MxCsr;
    DWORD MxCsr_Mask;
    M128A FloatRegisters[8];
    M128A XmmRegisters[16];
    BYTE Reserved4[96];
};

struct _struct_55 {
    M128A Header[2];
    M128A Legacy[8];
    M128A Xmm0;
    M128A Xmm1;
    M128A Xmm2;
    M128A Xmm3;
    M128A Xmm4;
    M128A Xmm5;
    M128A Xmm6;
    M128A Xmm7;
    M128A Xmm8;
    M128A Xmm9;
    M128A Xmm10;
    M128A Xmm11;
    M128A Xmm12;
    M128A Xmm13;
    M128A Xmm14;
    M128A Xmm15;
};

union _union_54 {
    XMM_SAVE_AREA32 FltSave;
    struct _struct_55 s;
};

struct _CONTEXT {
    DWORD64 P1Home;
    DWORD64 P2Home;
    DWORD64 P3Home;
    DWORD64 P4Home;
    DWORD64 P5Home;
    DWORD64 P6Home;
    DWORD ContextFlags;
    DWORD MxCsr;
    WORD SegCs;
    WORD SegDs;
    WORD SegEs;
    WORD SegFs;
    WORD SegGs;
    WORD SegSs;
    DWORD EFlags;
    DWORD64 Dr0;
    DWORD64 Dr1;
    DWORD64 Dr2;
    DWORD64 Dr3;
    DWORD64 Dr6;
    DWORD64 Dr7;
    DWORD64 Rax;
    DWORD64 Rcx;
    DWORD64 Rdx;
    DWORD64 Rbx;
    DWORD64 Rsp;
    DWORD64 Rbp;
    DWORD64 Rsi;
    DWORD64 Rdi;
    DWORD64 R8;
    DWORD64 R9;
    DWORD64 R10;
    DWORD64 R11;
    DWORD64 R12;
    DWORD64 R13;
    DWORD64 R14;
    DWORD64 R15;
    DWORD64 Rip;
    union _union_54 u;
    M128A VectorRegister[26];
    DWORD64 VectorControl;
    DWORD64 DebugControl;
    DWORD64 LastBranchToRip;
    DWORD64 LastBranchFromRip;
    DWORD64 LastExceptionToRip;
    DWORD64 LastExceptionFromRip;
};

struct _EXCEPTION_RECORD {
    DWORD ExceptionCode;
    DWORD ExceptionFlags;
    struct _EXCEPTION_RECORD *ExceptionRecord;
    PVOID ExceptionAddress;
    DWORD NumberParameters;
    ULONG_PTR ExceptionInformation[15];
};

struct _EXCEPTION_POINTERS {
    PEXCEPTION_RECORD ExceptionRecord;
    PCONTEXT ContextRecord;
};

typedef struct _SECURITY_ATTRIBUTES *LPSECURITY_ATTRIBUTES;

typedef struct _SYSTEMTIME *LPSYSTEMTIME;

typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;

typedef enum _EXCEPTION_DISPOSITION {
    ExceptionContinueExecution=0,
    ExceptionContinueSearch=1,
    ExceptionNestedException=2,
    ExceptionCollidedUnwind=3
} _EXCEPTION_DISPOSITION;

typedef enum _EXCEPTION_DISPOSITION EXCEPTION_DISPOSITION;

typedef struct DotNetPdbInfo DotNetPdbInfo, *PDotNetPdbInfo;

struct DotNetPdbInfo {
    char signature[4];
    GUID guid;
    dword age;
    char pdbpath[60];
};

typedef struct _iobuf _iobuf, *P_iobuf;

struct _iobuf {
    char *_ptr;
    int _cnt;
    char *_base;
    int _flag;
    int _file;
    int _charbuf;
    int _bufsiz;
    char *_tmpfname;
};

typedef struct _iobuf FILE;

typedef struct _COORD _COORD, *P_COORD;

typedef struct _COORD COORD;

typedef short SHORT;

struct _COORD {
    SHORT X;
    SHORT Y;
};

typedef struct _SMALL_RECT _SMALL_RECT, *P_SMALL_RECT;

typedef struct _SMALL_RECT SMALL_RECT;

struct _SMALL_RECT {
    SHORT Left;
    SHORT Top;
    SHORT Right;
    SHORT Bottom;
};

typedef struct _CONSOLE_SCREEN_BUFFER_INFO _CONSOLE_SCREEN_BUFFER_INFO, *P_CONSOLE_SCREEN_BUFFER_INFO;

typedef struct _CONSOLE_SCREEN_BUFFER_INFO *PCONSOLE_SCREEN_BUFFER_INFO;

struct _CONSOLE_SCREEN_BUFFER_INFO {
    COORD dwSize;
    COORD dwCursorPosition;
    WORD wAttributes;
    SMALL_RECT srWindow;
    COORD dwMaximumWindowSize;
};

typedef int PMFN;

typedef struct _s_ThrowInfo _s_ThrowInfo, *P_s_ThrowInfo;

struct _s_ThrowInfo {
    uint attributes;
    PMFN pmfnUnwind;
    int pForwardCompat;
    int pCatchableTypeArray;
};

typedef struct TypeDescriptor TypeDescriptor, *PTypeDescriptor;

struct TypeDescriptor {
    void *pVFTable;
    void *spare;
    char name[0];
};

typedef struct _s_ThrowInfo ThrowInfo;

typedef char *va_list;

typedef ulonglong uintptr_t;

typedef ushort wint_t;

typedef longlong __time64_t;

typedef ulonglong size_t;

typedef int errno_t;

typedef size_t rsize_t;

typedef struct bad_alloc bad_alloc, *Pbad_alloc;

struct bad_alloc { // PlaceHolder Class Structure
};

typedef struct _GUID _GUID, *P_GUID;

struct _GUID {
    ulong Data1;
    ushort Data2;
    ushort Data3;
    uchar Data4[8];
};


// WARNING! conflicting data type names: /guiddef.h/GUID - /GUID

typedef uchar *RPC_CSTR;

typedef ushort *RPC_WSTR;

typedef GUID UUID;

typedef long RPC_STATUS;

typedef char CHAR;

typedef union _LARGE_INTEGER _LARGE_INTEGER, *P_LARGE_INTEGER;

typedef struct _struct_19 _struct_19, *P_struct_19;

typedef struct _struct_20 _struct_20, *P_struct_20;

struct _struct_20 {
    DWORD LowPart;
    LONG HighPart;
};

struct _struct_19 {
    DWORD LowPart;
    LONG HighPart;
};

union _LARGE_INTEGER {
    struct _struct_19 s;
    struct _struct_20 u;
    LONGLONG QuadPart;
};

typedef union _LARGE_INTEGER LARGE_INTEGER;

typedef wchar_t WCHAR;

typedef WCHAR *LPWSTR;

typedef struct _RUNTIME_FUNCTION _RUNTIME_FUNCTION, *P_RUNTIME_FUNCTION;

struct _RUNTIME_FUNCTION {
    DWORD BeginAddress;
    DWORD EndAddress;
    DWORD UnwindData;
};

typedef struct _IMAGE_SECTION_HEADER _IMAGE_SECTION_HEADER, *P_IMAGE_SECTION_HEADER;

typedef union _union_238 _union_238, *P_union_238;

union _union_238 {
    DWORD PhysicalAddress;
    DWORD VirtualSize;
};

struct _IMAGE_SECTION_HEADER {
    BYTE Name[8];
    union _union_238 Misc;
    DWORD VirtualAddress;
    DWORD SizeOfRawData;
    DWORD PointerToRawData;
    DWORD PointerToRelocations;
    DWORD PointerToLinenumbers;
    WORD NumberOfRelocations;
    WORD NumberOfLinenumbers;
    DWORD Characteristics;
};

typedef enum _HEAP_INFORMATION_CLASS {
    HeapCompatibilityInformation=0,
    HeapEnableTerminationOnCorruption=1
} _HEAP_INFORMATION_CLASS;

typedef enum _HEAP_INFORMATION_CLASS HEAP_INFORMATION_CLASS;

typedef struct _RUNTIME_FUNCTION *PRUNTIME_FUNCTION;

typedef EXCEPTION_DISPOSITION (EXCEPTION_ROUTINE)(struct _EXCEPTION_RECORD *, PVOID, struct _CONTEXT *, PVOID);

typedef struct _IMAGE_SECTION_HEADER *PIMAGE_SECTION_HEADER;

typedef WCHAR *LPCWSTR;

typedef struct _M128A *PM128A;

typedef struct _UNWIND_HISTORY_TABLE_ENTRY _UNWIND_HISTORY_TABLE_ENTRY, *P_UNWIND_HISTORY_TABLE_ENTRY;

typedef struct _UNWIND_HISTORY_TABLE_ENTRY UNWIND_HISTORY_TABLE_ENTRY;

struct _UNWIND_HISTORY_TABLE_ENTRY {
    DWORD64 ImageBase;
    PRUNTIME_FUNCTION FunctionEntry;
};

typedef union _union_61 _union_61, *P_union_61;

typedef struct _struct_62 _struct_62, *P_struct_62;

struct _struct_62 {
    PM128A Xmm0;
    PM128A Xmm1;
    PM128A Xmm2;
    PM128A Xmm3;
    PM128A Xmm4;
    PM128A Xmm5;
    PM128A Xmm6;
    PM128A Xmm7;
    PM128A Xmm8;
    PM128A Xmm9;
    PM128A Xmm10;
    PM128A Xmm11;
    PM128A Xmm12;
    PM128A Xmm13;
    PM128A Xmm14;
    PM128A Xmm15;
};

union _union_61 {
    PM128A FloatingContext[16];
    struct _struct_62 s;
};

typedef union _union_63 _union_63, *P_union_63;

typedef ulonglong *PDWORD64;

typedef struct _struct_64 _struct_64, *P_struct_64;

struct _struct_64 {
    PDWORD64 Rax;
    PDWORD64 Rcx;
    PDWORD64 Rdx;
    PDWORD64 Rbx;
    PDWORD64 Rsp;
    PDWORD64 Rbp;
    PDWORD64 Rsi;
    PDWORD64 Rdi;
    PDWORD64 R8;
    PDWORD64 R9;
    PDWORD64 R10;
    PDWORD64 R11;
    PDWORD64 R12;
    PDWORD64 R13;
    PDWORD64 R14;
    PDWORD64 R15;
};

union _union_63 {
    PDWORD64 IntegerContext[16];
    struct _struct_64 s;
};

typedef struct _UNWIND_HISTORY_TABLE _UNWIND_HISTORY_TABLE, *P_UNWIND_HISTORY_TABLE;

typedef struct _UNWIND_HISTORY_TABLE *PUNWIND_HISTORY_TABLE;

struct _UNWIND_HISTORY_TABLE {
    DWORD Count;
    BYTE LocalHint;
    BYTE GlobalHint;
    BYTE Search;
    BYTE Once;
    DWORD64 LowAddress;
    DWORD64 HighAddress;
    UNWIND_HISTORY_TABLE_ENTRY Entry[12];
};

typedef CHAR *LPSTR;

typedef long HRESULT;

typedef CHAR *LPCSTR;

typedef LONG *PLONG;

typedef struct _OSVERSIONINFOA _OSVERSIONINFOA, *P_OSVERSIONINFOA;

struct _OSVERSIONINFOA {
    DWORD dwOSVersionInfoSize;
    DWORD dwMajorVersion;
    DWORD dwMinorVersion;
    DWORD dwBuildNumber;
    DWORD dwPlatformId;
    CHAR szCSDVersion[128];
};

typedef struct _OSVERSIONINFOA *LPOSVERSIONINFOA;

typedef struct _KNONVOLATILE_CONTEXT_POINTERS _KNONVOLATILE_CONTEXT_POINTERS, *P_KNONVOLATILE_CONTEXT_POINTERS;

typedef struct _KNONVOLATILE_CONTEXT_POINTERS *PKNONVOLATILE_CONTEXT_POINTERS;

struct _KNONVOLATILE_CONTEXT_POINTERS {
    union _union_61 u;
    union _union_63 u2;
};

typedef EXCEPTION_ROUTINE *PEXCEPTION_ROUTINE;

typedef DWORD ACCESS_MASK;

typedef DWORD LCID;

typedef HANDLE *PHANDLE;

typedef struct IMAGE_DOS_HEADER IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER;

struct IMAGE_DOS_HEADER {
    char e_magic[2]; // Magic number
    word e_cblp; // Bytes of last page
    word e_cp; // Pages in file
    word e_crlc; // Relocations
    word e_cparhdr; // Size of header in paragraphs
    word e_minalloc; // Minimum extra paragraphs needed
    word e_maxalloc; // Maximum extra paragraphs needed
    word e_ss; // Initial (relative) SS value
    word e_sp; // Initial SP value
    word e_csum; // Checksum
    word e_ip; // Initial IP value
    word e_cs; // Initial (relative) CS value
    word e_lfarlc; // File address of relocation table
    word e_ovno; // Overlay number
    word e_res[4][4]; // Reserved words
    word e_oemid; // OEM identifier (for e_oeminfo)
    word e_oeminfo; // OEM information; e_oemid specific
    word e_res2[10][10]; // Reserved words
    dword e_lfanew; // File address of new exe header
    byte e_program[64]; // Actual DOS program
};

typedef struct _CRYPT_ENCRYPT_MESSAGE_PARA _CRYPT_ENCRYPT_MESSAGE_PARA, *P_CRYPT_ENCRYPT_MESSAGE_PARA;

typedef ULONG_PTR HCRYPTPROV_LEGACY;

typedef struct _CRYPT_ALGORITHM_IDENTIFIER _CRYPT_ALGORITHM_IDENTIFIER, *P_CRYPT_ALGORITHM_IDENTIFIER;

typedef struct _CRYPT_ALGORITHM_IDENTIFIER CRYPT_ALGORITHM_IDENTIFIER;

typedef struct _CRYPTOAPI_BLOB _CRYPTOAPI_BLOB, *P_CRYPTOAPI_BLOB;

typedef struct _CRYPTOAPI_BLOB CRYPT_OBJID_BLOB;

struct _CRYPTOAPI_BLOB {
    DWORD cbData;
    BYTE *pbData;
};

struct _CRYPT_ALGORITHM_IDENTIFIER {
    LPSTR pszObjId;
    CRYPT_OBJID_BLOB Parameters;
};

struct _CRYPT_ENCRYPT_MESSAGE_PARA {
    DWORD cbSize;
    DWORD dwMsgEncodingType;
    HCRYPTPROV_LEGACY hCryptProv;
    CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm;
    void *pvEncryptionAuxInfo;
    DWORD dwFlags;
    DWORD dwInnerContentType;
};

typedef struct _CRYPTOAPI_BLOB CRYPT_INTEGER_BLOB;

typedef void *HCRYPTMSG;

typedef void *HCERTSTORE;

typedef BOOL (*PFN_CMSG_STREAM_OUTPUT)(void *, BYTE *, DWORD, BOOL);

typedef ULONG_PTR HCRYPTKEY;

typedef ULONG_PTR HCRYPTPROV;

typedef struct _CRYPT_BIT_BLOB _CRYPT_BIT_BLOB, *P_CRYPT_BIT_BLOB;

struct _CRYPT_BIT_BLOB {
    DWORD cbData;
    BYTE *pbData;
    DWORD cUnusedBits;
};

typedef struct _CERT_PUBLIC_KEY_INFO _CERT_PUBLIC_KEY_INFO, *P_CERT_PUBLIC_KEY_INFO;

typedef struct _CERT_PUBLIC_KEY_INFO CERT_PUBLIC_KEY_INFO;

typedef struct _CRYPT_BIT_BLOB CRYPT_BIT_BLOB;

struct _CERT_PUBLIC_KEY_INFO {
    CRYPT_ALGORITHM_IDENTIFIER Algorithm;
    CRYPT_BIT_BLOB PublicKey;
};

typedef struct _CERT_CONTEXT _CERT_CONTEXT, *P_CERT_CONTEXT;

typedef struct _CERT_CONTEXT CERT_CONTEXT;

typedef CERT_CONTEXT *PCCERT_CONTEXT;

typedef struct _CERT_INFO _CERT_INFO, *P_CERT_INFO;

typedef struct _CERT_INFO *PCERT_INFO;

typedef struct _CRYPTOAPI_BLOB CERT_NAME_BLOB;

typedef struct _FILETIME _FILETIME, *P_FILETIME;

typedef struct _FILETIME FILETIME;

typedef struct _CERT_EXTENSION _CERT_EXTENSION, *P_CERT_EXTENSION;

typedef struct _CERT_EXTENSION *PCERT_EXTENSION;

struct _CERT_EXTENSION {
    LPSTR pszObjId;
    BOOL fCritical;
    CRYPT_OBJID_BLOB Value;
};

struct _FILETIME {
    DWORD dwLowDateTime;
    DWORD dwHighDateTime;
};

struct _CERT_INFO {
    DWORD dwVersion;
    CRYPT_INTEGER_BLOB SerialNumber;
    CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm;
    CERT_NAME_BLOB Issuer;
    FILETIME NotBefore;
    FILETIME NotAfter;
    CERT_NAME_BLOB Subject;
    CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo;
    CRYPT_BIT_BLOB IssuerUniqueId;
    CRYPT_BIT_BLOB SubjectUniqueId;
    DWORD cExtension;
    PCERT_EXTENSION rgExtension;
};

struct _CERT_CONTEXT {
    DWORD dwCertEncodingType;
    BYTE *pbCertEncoded;
    DWORD cbCertEncoded;
    PCERT_INFO pCertInfo;
    HCERTSTORE hCertStore;
};

typedef struct _CMSG_STREAM_INFO _CMSG_STREAM_INFO, *P_CMSG_STREAM_INFO;

struct _CMSG_STREAM_INFO {
    DWORD cbContent;
    PFN_CMSG_STREAM_OUTPUT pfnStreamOutput;
    void *pvArg;
};

typedef struct _CMSG_STREAM_INFO *PCMSG_STREAM_INFO;

typedef struct _CRYPT_DECRYPT_MESSAGE_PARA _CRYPT_DECRYPT_MESSAGE_PARA, *P_CRYPT_DECRYPT_MESSAGE_PARA;

typedef struct _CRYPT_DECRYPT_MESSAGE_PARA *PCRYPT_DECRYPT_MESSAGE_PARA;

struct _CRYPT_DECRYPT_MESSAGE_PARA {
    DWORD cbSize;
    DWORD dwMsgAndCertEncodingType;
    DWORD cCertStore;
    HCERTSTORE *rghCertStore;
};

typedef struct _CRYPT_ENCRYPT_MESSAGE_PARA *PCRYPT_ENCRYPT_MESSAGE_PARA;

typedef struct _CRYPTOAPI_BLOB *PCERT_NAME_BLOB;

typedef struct tm tm, *Ptm;

struct tm {
    int tm_sec;
    int tm_min;
    int tm_hour;
    int tm_mday;
    int tm_mon;
    int tm_year;
    int tm_wday;
    int tm_yday;
    int tm_isdst;
};

typedef long clock_t;

typedef longlong INT_PTR;

typedef ULONG_PTR SIZE_T;

typedef struct _FILETIME *LPFILETIME;

typedef INT_PTR (*FARPROC)(void);

typedef struct HKEY__ HKEY__, *PHKEY__;

struct HKEY__ {
    int unused;
};

typedef DWORD *LPDWORD;

typedef struct HKEY__ *HKEY;

typedef HKEY *PHKEY;

typedef struct HINSTANCE__ HINSTANCE__, *PHINSTANCE__;

struct HINSTANCE__ {
    int unused;
};

typedef HANDLE HGLOBAL;

typedef BOOL *LPBOOL;

typedef BYTE *PBYTE;

typedef int *LPINT;

typedef struct HINSTANCE__ *HINSTANCE;

typedef void *LPCVOID;

typedef struct HRSRC__ HRSRC__, *PHRSRC__;

typedef struct HRSRC__ *HRSRC;

struct HRSRC__ {
    int unused;
};

typedef struct HWND__ HWND__, *PHWND__;

typedef struct HWND__ *HWND;

struct HWND__ {
    int unused;
};

typedef HINSTANCE HMODULE;

typedef HANDLE HLOCAL;

typedef BYTE *LPBYTE;

typedef long *LPLONG;

typedef uint UINT;

typedef struct IMAGE_RESOURCE_DIRECTORY_ENTRY_NameStruct IMAGE_RESOURCE_DIRECTORY_ENTRY_NameStruct, *PIMAGE_RESOURCE_DIRECTORY_ENTRY_NameStruct;

struct IMAGE_RESOURCE_DIRECTORY_ENTRY_NameStruct {
    dword NameOffset:31;
    dword NameIsString:1;
};

typedef struct IMAGE_DEBUG_DIRECTORY IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY;

struct IMAGE_DEBUG_DIRECTORY {
    dword Characteristics;
    dword TimeDateStamp;
    word MajorVersion;
    word MinorVersion;
    dword Type;
    dword SizeOfData;
    dword AddressOfRawData;
    dword PointerToRawData;
};

typedef struct IMAGE_FILE_HEADER IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;

struct IMAGE_FILE_HEADER {
    word Machine; // 34404
    word NumberOfSections;
    dword TimeDateStamp;
    dword PointerToSymbolTable;
    dword NumberOfSymbols;
    word SizeOfOptionalHeader;
    word Characteristics;
};

typedef struct IMAGE_RESOURCE_DIRECTORY_ENTRY IMAGE_RESOURCE_DIRECTORY_ENTRY, *PIMAGE_RESOURCE_DIRECTORY_ENTRY;

typedef union IMAGE_RESOURCE_DIRECTORY_ENTRY_NameUnion IMAGE_RESOURCE_DIRECTORY_ENTRY_NameUnion, *PIMAGE_RESOURCE_DIRECTORY_ENTRY_NameUnion;

union IMAGE_RESOURCE_DIRECTORY_ENTRY_NameUnion {
    struct IMAGE_RESOURCE_DIRECTORY_ENTRY_NameStruct IMAGE_RESOURCE_DIRECTORY_ENTRY_NameStruct;
    dword Name;
    word Id;
};

struct IMAGE_RESOURCE_DIRECTORY_ENTRY {
    union IMAGE_RESOURCE_DIRECTORY_ENTRY_NameUnion NameUnion;
    union IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryUnion DirectoryUnion;
};

typedef struct IMAGE_OPTIONAL_HEADER64 IMAGE_OPTIONAL_HEADER64, *PIMAGE_OPTIONAL_HEADER64;

typedef struct IMAGE_DATA_DIRECTORY IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY;

struct IMAGE_DATA_DIRECTORY {
    ImageBaseOffset32 VirtualAddress;
    dword Size;
};

struct IMAGE_OPTIONAL_HEADER64 {
    word Magic;
    byte MajorLinkerVersion;
    byte MinorLinkerVersion;
    dword SizeOfCode;
    dword SizeOfInitializedData;
    dword SizeOfUninitializedData;
    ImageBaseOffset32 AddressOfEntryPoint;
    ImageBaseOffset32 BaseOfCode;
    pointer64 ImageBase;
    dword SectionAlignment;
    dword FileAlignment;
    word MajorOperatingSystemVersion;
    word MinorOperatingSystemVersion;
    word MajorImageVersion;
    word MinorImageVersion;
    word MajorSubsystemVersion;
    word MinorSubsystemVersion;
    dword Win32VersionValue;
    dword SizeOfImage;
    dword SizeOfHeaders;
    dword CheckSum;
    word Subsystem;
    word DllCharacteristics;
    qword SizeOfStackReserve;
    qword SizeOfStackCommit;
    qword SizeOfHeapReserve;
    qword SizeOfHeapCommit;
    dword LoaderFlags;
    dword NumberOfRvaAndSizes;
    struct IMAGE_DATA_DIRECTORY DataDirectory[16];
};

typedef struct IMAGE_SECTION_HEADER IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;

typedef union Misc Misc, *PMisc;

typedef enum SectionFlags {
    IMAGE_SCN_TYPE_NO_PAD=8,
    IMAGE_SCN_RESERVED_0001=16,
    IMAGE_SCN_CNT_CODE=32,
    IMAGE_SCN_CNT_INITIALIZED_DATA=64,
    IMAGE_SCN_CNT_UNINITIALIZED_DATA=128,
    IMAGE_SCN_LNK_OTHER=256,
    IMAGE_SCN_LNK_INFO=512,
    IMAGE_SCN_RESERVED_0040=1024,
    IMAGE_SCN_LNK_REMOVE=2048,
    IMAGE_SCN_LNK_COMDAT=4096,
    IMAGE_SCN_GPREL=32768,
    IMAGE_SCN_MEM_16BIT=131072,
    IMAGE_SCN_MEM_PURGEABLE=131072,
    IMAGE_SCN_MEM_LOCKED=262144,
    IMAGE_SCN_MEM_PRELOAD=524288,
    IMAGE_SCN_ALIGN_1BYTES=1048576,
    IMAGE_SCN_ALIGN_2BYTES=2097152,
    IMAGE_SCN_ALIGN_4BYTES=3145728,
    IMAGE_SCN_ALIGN_8BYTES=4194304,
    IMAGE_SCN_ALIGN_16BYTES=5242880,
    IMAGE_SCN_ALIGN_32BYTES=6291456,
    IMAGE_SCN_ALIGN_64BYTES=7340032,
    IMAGE_SCN_ALIGN_128BYTES=8388608,
    IMAGE_SCN_ALIGN_256BYTES=9437184,
    IMAGE_SCN_ALIGN_512BYTES=10485760,
    IMAGE_SCN_ALIGN_1024BYTES=11534336,
    IMAGE_SCN_ALIGN_2048BYTES=12582912,
    IMAGE_SCN_ALIGN_4096BYTES=13631488,
    IMAGE_SCN_ALIGN_8192BYTES=14680064,
    IMAGE_SCN_LNK_NRELOC_OVFL=16777216,
    IMAGE_SCN_MEM_DISCARDABLE=33554432,
    IMAGE_SCN_MEM_NOT_CACHED=67108864,
    IMAGE_SCN_MEM_NOT_PAGED=134217728,
    IMAGE_SCN_MEM_SHARED=268435456,
    IMAGE_SCN_MEM_EXECUTE=536870912,
    IMAGE_SCN_MEM_READ=1073741824,
    IMAGE_SCN_MEM_WRITE=2147483648
} SectionFlags;

union Misc {
    dword PhysicalAddress;
    dword VirtualSize;
};

struct IMAGE_SECTION_HEADER {
    char Name[8];
    union Misc Misc;
    ImageBaseOffset32 VirtualAddress;
    dword SizeOfRawData;
    dword PointerToRawData;
    dword PointerToRelocations;
    dword PointerToLinenumbers;
    word NumberOfRelocations;
    word NumberOfLinenumbers;
    enum SectionFlags Characteristics;
};

typedef struct IMAGE_NT_HEADERS64 IMAGE_NT_HEADERS64, *PIMAGE_NT_HEADERS64;

struct IMAGE_NT_HEADERS64 {
    char Signature[4];
    struct IMAGE_FILE_HEADER FileHeader;
    struct IMAGE_OPTIONAL_HEADER64 OptionalHeader;
};

typedef struct IMAGE_THUNK_DATA64 IMAGE_THUNK_DATA64, *PIMAGE_THUNK_DATA64;

struct IMAGE_THUNK_DATA64 {
    qword StartAddressOfRawData;
    qword EndAddressOfRawData;
    qword AddressOfIndex;
    qword AddressOfCallBacks;
    dword SizeOfZeroFill;
    dword Characteristics;
};

typedef struct IMAGE_RESOURCE_DATA_ENTRY IMAGE_RESOURCE_DATA_ENTRY, *PIMAGE_RESOURCE_DATA_ENTRY;

struct IMAGE_RESOURCE_DATA_ENTRY {
    dword OffsetToData;
    dword Size;
    dword CodePage;
    dword Reserved;
};

typedef struct IMAGE_RESOURCE_DIRECTORY IMAGE_RESOURCE_DIRECTORY, *PIMAGE_RESOURCE_DIRECTORY;

struct IMAGE_RESOURCE_DIRECTORY {
    dword Characteristics;
    dword TimeDateStamp;
    word MajorVersion;
    word MinorVersion;
    word NumberOfNamedEntries;
    word NumberOfIdEntries;
};

typedef struct IMAGE_DIRECTORY_ENTRY_EXPORT IMAGE_DIRECTORY_ENTRY_EXPORT, *PIMAGE_DIRECTORY_ENTRY_EXPORT;

struct IMAGE_DIRECTORY_ENTRY_EXPORT {
    dword Characteristics;
    dword TimeDateStamp;
    word MajorVersion;
    word MinorVersion;
    ImageBaseOffset32 Name;
    dword Base;
    dword NumberOfFunctions;
    dword NumberOfNames;
    ImageBaseOffset32 AddressOfFunctions;
    ImageBaseOffset32 AddressOfNames;
    ImageBaseOffset32 AddressOfNameOrdinals;
};

typedef LONG LSTATUS;

typedef ACCESS_MASK REGSAM;

typedef void (TIMECALLBACK)(UINT, UINT, DWORD_PTR, DWORD_PTR, DWORD_PTR);

typedef TIMECALLBACK *LPTIMECALLBACK;

typedef UINT MMRESULT;

typedef ushort u_short;

typedef struct sockaddr sockaddr, *Psockaddr;

struct sockaddr {
    u_short sa_family;
    char sa_data[14];
};

typedef struct CWin32Heap CWin32Heap, *PCWin32Heap;

struct CWin32Heap { // PlaceHolder Structure
};

typedef struct CStringData CStringData, *PCStringData;

struct CStringData { // PlaceHolder Structure
};

typedef struct CAtlStringMgr CAtlStringMgr, *PCAtlStringMgr;

struct CAtlStringMgr { // PlaceHolder Structure
};

typedef struct CAtlBaseModule CAtlBaseModule, *PCAtlBaseModule;

struct CAtlBaseModule { // PlaceHolder Structure
};

typedef struct exception exception, *Pexception;

struct exception { // PlaceHolder Structure
};

typedef struct _Container_base12 _Container_base12, *P_Container_base12;

struct _Container_base12 { // PlaceHolder Structure
};

typedef struct basic_streambuf<char,struct_std::char_traits<char>_> basic_streambuf<char,struct_std::char_traits<char>_>, *Pbasic_streambuf<char,struct_std::char_traits<char>_>;

struct basic_streambuf<char,struct_std::char_traits<char>_> { // PlaceHolder Structure
};

typedef struct basic_ostream<char,struct_std::char_traits<char>_> basic_ostream<char,struct_std::char_traits<char>_>, *Pbasic_ostream<char,struct_std::char_traits<char>_>;

struct basic_ostream<char,struct_std::char_traits<char>_> { // PlaceHolder Structure
};

typedef struct locale locale, *Plocale;

struct locale { // PlaceHolder Structure
};

typedef enum _Uninitialized {
} _Uninitialized;

typedef struct _Mutex _Mutex, *P_Mutex;

struct _Mutex { // PlaceHolder Structure
};

typedef struct basic_ios<char,struct_std::char_traits<char>_> basic_ios<char,struct_std::char_traits<char>_>, *Pbasic_ios<char,struct_std::char_traits<char>_>;

struct basic_ios<char,struct_std::char_traits<char>_> { // PlaceHolder Structure
};

typedef struct _Container_base0 _Container_base0, *P_Container_base0;

struct _Container_base0 { // PlaceHolder Structure
};

typedef int (*_onexit_t)(void);



ulonglong DAT_1402f85a0;
undefined DAT_140271f08;
undefined8 DAT_140320108;
pointer[1] vftable;
DWORD DAT_14031fe84;
undefined8 *DAT_140320108;
undefined8 *DAT_140320100;
ulonglong DAT_140312da8;
undefined8 DAT_140312d90;
undefined8 *DAT_140320140;
undefined8 *DAT_140320128;
undefined8 *DAT_140320130;
LPCRITICAL_SECTION DAT_140320120;
pointer[2] vftable;
undefined DAT_1402f47a8;
undefined *PTR_DAT_1402f8010;
uint DAT_140320f5c;
int DAT_140320610;
undefined LAB_140202480;
pointer[14] vftable;
undefined4 DAT_140320030;
undefined4 DAT_140320034;
undefined4 DAT_140320038;
undefined4 DAT_14032003c;
undefined DAT_140272600;
undefined DAT_140272608;
undefined DAT_140272630;
undefined8 DAT_140320100;
undefined8 DAT_14031fee8;
pointer[17] vftable;
undefined DAT_1402728c8;
undefined8 DAT_140320130;
pointer[27] vftable;
undefined8 DAT_140320128;
undefined8 DAT_140320140;
longlong DAT_140320138;
longlong DAT_140320130;
undefined DAT_14030ab90;
int DAT_1403127f8;
uint DAT_140320f64;
int DAT_1403206fc;
undefined LAB_140202650;
int DAT_140320704;
undefined4 DAT_14031fe98;
pointer PTR_s_Server_Shutdown._140312b88;
char DAT_14031fea4;
char DAT_14031fe97;
uint DAT_14031fea8;
longlong DAT_140320118;
uint DAT_14031fed8;
int DAT_140312f18;
uint DAT_14031fe9c;
undefined4 DAT_14031fea0;
int DAT_140320550;
ulonglong DAT_140320540;
undefined8 DAT_140320528;
undefined DAT_140272810;
int DAT_14031fed8;
int DAT_14031fe84;
int DAT_14031fe98;
int DAT_14031feac;
int DAT_14031fea8;
int DAT_14031feb0;
int DAT_14031fea0;
undefined *PTR_DAT_1402f8008;
uint DAT_140320f60;
undefined DAT_1402026e0;
void *DAT_14031fed0;
pointer[4] vftable;
undefined DAT_1402f4800;
undefined DAT_140320148;
undefined4 DAT_14024ea30;
ulonglong DAT_140320428;
undefined8 DAT_140320410;
HMODULE DAT_14031feb8;
FARPROC DAT_14031d5d0;
FARPROC DAT_14031d5c8;
FARPROC DAT_14031d5c0;
undefined DAT_1402749b8;
undefined DAT_1402749d4;
undefined DAT_1402749d8;
undefined DAT_1402749dc;
undefined1 DAT_1402749e0;
undefined DAT_1402749e8;
longlong DAT_14031fec0;
undefined DAT_140274b14;
char DAT_14031fea5;
undefined *PTR_u_PIDL_compiler_is_incompatible_to_14030bd40;
pointer[63] vftable;
pointer[19] vftable;
pointer[18] vftable;
pointer[16] vftable;
pointer[46] vftable;
pointer[83] vftable;
void *DAT_14031fec8;
char DAT_1403205d5;
int DAT_14031feb4;
longlong DAT_14031fec8;
longlong DAT_14031fed0;
char DAT_1403206c1;
int DAT_1403206dc;
uint *DAT_14031fec8;
uint *DAT_14031fed0;
undefined DAT_14030cbc4;
longlong DAT_140320470;
ulonglong DAT_140320478;
undefined8 DAT_140320460;
undefined *DAT_14031d5d0;
undefined DAT_14027936c;
undefined1 DAT_14027a10a;
undefined DAT_140279374;
undefined DAT_1402793fc;
undefined DAT_140279400;
undefined DAT_140279404;
undefined DAT_140279408;
undefined DAT_14027940c;
undefined DAT_140279410;
undefined DAT_140279414;
undefined DAT_140279418;
undefined DAT_14027941c;
undefined DAT_140279420;
undefined DAT_140279424;
undefined DAT_140279428;
undefined DAT_14027942c;
undefined DAT_14030ad10;
undefined *PTR_s_CURLE_OK_140312850;
ulonglong DAT_1403204c8;
undefined8 DAT_1403204b0;
undefined FUN_1400108e0;
ulonglong DAT_140320570;
undefined8 DAT_140320558;
char DAT_1403205d6;
undefined *DAT_14031d5c0;
undefined *DAT_14031d5c8;
char DAT_1403205d8;
char DAT_1403206bb;
int DAT_1403206f8;
int DAT_140320700;
undefined8 DAT_14027a110;
pointer vftable_meta_ptr;
pointer[20] vftable;
pointer[31] vftable;
pointer[7] vftable;
pointer[8] vftable;
longlong DAT_14031fee0;
undefined DAT_1402f4860;
pointer[85] vftable;
pointer[529] vftable;
undefined DAT_14027b43c;
undefined DAT_140320008;
pointer[3] vftable;
uint DAT_140312808;
undefined *PTR_s_&amp;_140312800;
undefined4 DAT_140312818;
undefined *PTR_DAT_140312810;
undefined4 DAT_140312828;
undefined *PTR_DAT_140312820;
undefined4 DAT_140312838;
undefined *PTR_s_&quot;_140312830;
undefined4 DAT_140312848;
undefined *PTR_s_&apos;_140312840;
undefined *PTR_s_Error_when_TiXmlDocument_added_t_1403127f0;
undefined *PTR_s_Memory_allocation_failed._140312788;
undefined *PTR_s_Failed_to_open_file_140312780;
undefined *PTR_s_Error_document_empty._1403127d8;
ulonglong DAT_14031fef0;
undefined DAT_14027b5c0;
undefined DAT_14027b5c4;
undefined DAT_14027b5d0;
undefined DAT_14027b5d4;
undefined DAT_14027b61c;
undefined DAT_14027b668;
undefined DAT_140278c20;
pointer PTR_s_&amp;_140312800;
undefined4 DAT_140312808;
undefined1 DAT_14031280c;
char DAT_1403100dc;
pointer PTR_s_No_error_140312770;
undefined1 DAT_14027ba88;
undefined *PTR_s_Error_parsing_Element._140312790;
undefined DAT_14027b5a4;
undefined1 DAT_14027b678;
undefined *PTR_s_Error_reading_Element_value._1403127a0;
undefined *PTR_s_Error_parsing_Unknown._1403127c0;
undefined DAT_14027b674;
undefined1 DAT_14027b68c;
undefined *PTR_s_Error_parsing_Declaration._1403127d0;
undefined DAT_14027c73c;
undefined2 DAT_14027d1a0;
int DAT_1402f8140;
undefined *PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50;
uint DAT_140320f58;
int DAT_1403203b0;
undefined LAB_140202490;
undefined8 DAT_140320138;
ulonglong DAT_140312e20;
undefined8 DAT_140312e08;
undefined1 DAT_1403100dc;
undefined1 DAT_1402836dc;
undefined1 DAT_14031fe90;
undefined1 DAT_14031fe91;
undefined1 DAT_14031fe92;
undefined1 DAT_14031fe93;
undefined1 DAT_14031fe94;
undefined1 DAT_14031fe95;
undefined1 DAT_14031fe96;
undefined *PTR_`vftable'_140203508;
pointer[15] vftable;
undefined DAT_1402839f0;
undefined DAT_140283c98;
ulonglong DAT_140312e48;
undefined8 DAT_140312e30;
undefined DAT_140283e20;
undefined *PTR__BADOFF_140203520;
undefined8 DAT_140320118;
pointer[29] vftable;
pointer[21] vftable;
undefined4 DAT_14031feb0;
undefined8 DAT_140320158;
undefined8 *DAT_140320150;
undefined8 *DAT_140320138;
undefined8 *DAT_140320118;
undefined8 *DAT_140320158;
undefined8 *DAT_140320160;
undefined8 DAT_140320150;
undefined8 DAT_140320160;
undefined FUN_14008e690;
int DAT_14031ff1c;
int DAT_14031ff24;
int DAT_14031ff18;
int DAT_14031ff20;
undefined8 DAT_140320050;
void *DAT_140320048;
undefined DAT_140320040;
longlong *DAT_140320048;
undefined8 *DAT_140320048;
longlong DAT_140320050;
longlong DAT_140320048;
longlong DAT_140320688;
undefined DAT_140320690;
uint DAT_140320f6c;
undefined DAT_140320698;
undefined DAT_1403206a0;
undefined LAB_1402025f0;
undefined8 DAT_140320688;
longlong DAT_140320660;
undefined4 *DAT_140320670;
undefined8 DAT_140320668;
undefined4 *DAT_140320678;
uint DAT_140320f68;
undefined8 DAT_140320670;
undefined8 DAT_140320678;
undefined LAB_140202600;
undefined8 DAT_140320660;
undefined DAT_1403206b0;
undefined DAT_1403206b4;
undefined DAT_1403206bc;
undefined DAT_1403206c0;
undefined FUN_140090c00;
undefined1 DAT_1403206cc;
undefined FUN_140090c40;
undefined DAT_1403206d0;
undefined DAT_1403206d8;
undefined1 DAT_1403206da;
undefined4 DAT_1403206dc;
undefined DAT_1403206e0;
undefined DAT_1403206e4;
undefined DAT_1403206e8;
undefined DAT_1403206f0;
undefined4 DAT_1403206f8;
undefined4 DAT_1403206fc;
undefined4 DAT_140320700;
undefined4 DAT_140320704;
undefined DAT_140320708;
undefined DAT_14032070c;
undefined DAT_140320714;
undefined DAT_14032071c;
undefined8 DAT_140320720;
undefined DAT_140320728;
undefined DAT_140320730;
undefined DAT_140320740;
undefined DAT_140320748;
undefined DAT_140320ea0;
undefined DAT_140320ea8;
undefined DAT_140320eb0;
undefined DAT_140320ed0;
undefined DAT_140320ed4;
undefined DAT_140320ed8;
undefined DAT_140320ee0;
undefined DAT_140320eb4;
undefined DAT_140320eb8;
undefined DAT_140320ebc;
undefined DAT_140320ec0;
undefined DAT_140320ec8;
undefined DAT_140320ee8;
undefined DAT_140320eec;
undefined DAT_140320ef0;
undefined DAT_140320ef4;
undefined DAT_140320f48;
undefined DAT_140320f4c;
undefined DAT_140320f50;
undefined DAT_140320f38;
undefined DAT_140320f40;
undefined LAB_140095c20;
undefined LAB_140095c40;
undefined DAT_140320750;
undefined4 DAT_140320830;
undefined4 DAT_140320868;
undefined DAT_1403209f0;
undefined DAT_140320ef8;
undefined DAT_140320f18;
undefined8 *DAT_140320f20;
undefined8 *DAT_140320f00;
void *DAT_140320720;
ulonglong DAT_140312e98;
undefined8 DAT_140312e80;
undefined DAT_140285e54;
undefined DAT_140285e58;
undefined4 DAT_140320180;
undefined DAT_140320188;
undefined DAT_140320190;
undefined DAT_140320198;
undefined DAT_1403201a0;
undefined DAT_1403201a8;
undefined DAT_1403201b0;
undefined DAT_1403201b8;
undefined DAT_1403201c0;
ulonglong DAT_140312ee8;
undefined8 DAT_140312ed0;
pointer PTR_u_LOG_CONNECTION_140310a50;
LPCRITICAL_SECTION DAT_140320178;
int DAT_140320168;
int DAT_14032016c;
char DAT_14031fea6;
longlong *DAT_14031fbf8;
longlong *DAT_14031fbf0;
int DAT_140320170;
undefined UNK_14027a248;
char DAT_14031fea7;
HWND DAT_14031fe88;
pointer PTR_1402884a8;
undefined DAT_140274db0;
undefined DAT_140276fb0;
undefined DAT_1402773b0;
undefined DAT_1402777b0;
undefined DAT_140277bb0;
undefined1 DAT_140277fb0;
undefined DAT_140274eb0;
undefined DAT_140275fb0;
undefined DAT_1402763b0;
undefined DAT_1402767b0;
undefined DAT_140276bb0;
undefined DAT_140277fdc;
undefined DAT_140277fe4;
undefined DAT_140277fec;
undefined DAT_1403157e0;
uint DAT_140313ee8;
undefined DAT_140313e80;
int DAT_140313fc8;
int DAT_140313f00;
undefined *DAT_140313e88;
longlong DAT_140313ea0;
char DAT_1402f8000;
uint DAT_140313f08;
undefined DAT_140313f04;
undefined DAT_140313f48;
undefined *PTR_PTR_1402f8508;
uint DAT_140313fb8;
undefined1 DAT_140313fb0;
undefined LAB_140202850;
undefined DAT_140313f80;
pointer[5] vftable;
int DAT_1402f8098;
double DAT_1402f8090;
undefined DAT_140313fd0;
char DAT_1402f8280;
uint DAT_140314028;
undefined FUN_140202870;
undefined8 DAT_140314020;
undefined DAT_140314030;
undefined4 DAT_1402f83d0;
undefined2 DAT_1402f83d4;
char DAT_1403142d0;
undefined *PTR_u_www.nettention.co.kr_1402f8288;
undefined4 DAT_1402f8290;
undefined *PTR_s_GET_/PNReport/ReportError.php?Te_1402f8298;
undefined *PTR_s_HTTP/1.1_User-Agent:_Mozilla/5.0_1402f82a0;
undefined FUN_1400a61b0;
char DAT_1402f8340;
uint DAT_140314140;
undefined LAB_1402028c0;
undefined DAT_140314080;
undefined DAT_140314148;
char DAT_1402f8380;
uint DAT_140314184;
undefined LAB_1402028d0;
undefined DAT_140314180;
undefined DAT_140314218;
undefined DAT_140205900;
undefined DAT_140283d4c;
char DAT_1402f83c0;
uint DAT_1403141d8;
undefined LAB_140202900;
undefined DAT_140314190;
undefined DAT_1403141e0;
undefined DAT_1402059a0;
undefined8 DAT_140314280;
undefined *PTR_u_CListNode_reports_a_consistency_p_1402f84a0;
undefined DAT_140205aa8;
undefined DAT_140205c08;
undefined *DAT_140314280;
undefined FUN_1400aa9e0;
undefined DAT_1403142d8;
undefined DAT_140314310;
undefined DAT_1402063e8;
DWORD DAT_140314d30;
int DAT_140314d28;
uint DAT_140314d28;
uint DAT_140314d70;
undefined DAT_140314d30;
undefined LAB_140202940;
undefined DAT_140314d38;
char DAT_140313fcd;
undefined DAT_140206b70;
undefined DAT_140206b90;
char DAT_1402f8500;
uint DAT_140315798;
undefined DAT_140314d80;
undefined DAT_140315758;
undefined LAB_140202960;
undefined DAT_140315760;
undefined DAT_1403157a0;
undefined DAT_140206c70;
undefined1 DAT_140320110;
IMAGE_DOS_HEADER IMAGE_DOS_HEADER_140000000;
undefined DAT_140206cf0;
undefined *PTR_LAB_140206d00;
undefined *PTR_Allocate_140206d28;
undefined DAT_1402f8538;
pointer PTR_FUN_140206d80;
undefined DAT_1402f46b8;
uintptr_t DAT_1402f85a0;
undefined _type_info_dtor_internal_method;
PVOID DAT_140321228;
PVOID DAT_140321220;
undefined4 DAT_140315e04;
undefined4 DAT_140315e00;
undefined DAT_140315874;
undefined DAT_140315870;
undefined4 DAT_140315858;
undefined8 DAT_140315860;
undefined8 DAT_140315868;
undefined FUN_1400ae67c;
void *DAT_140321210;
int DAT_140321208;
undefined8 DAT_140321218;
undefined *PTR___winitenv_140203628;
uint DAT_140315878;
int DAT_14031585c;
int DAT_14031587c;
undefined DAT_140203c00;
undefined DAT_140203fe8;
undefined DAT_140203ff0;
undefined DAT_140204008;
void *StackBase;
undefined4 DAT_14031585c;
undefined *PTR__fmode_140203600;
undefined4 DAT_140315e0c;
undefined FUN_1400ae790;
undefined *PTR__commode_140203608;
undefined4 DAT_140315e08;
int DAT_1402f85cc;
int DAT_1402f85c8;
void *StackLimit;
undefined DAT_140315930;
DWORD64 DAT_140315a28;
undefined DAT_1403158a0;
undefined DAT_1403159b0;
undefined DAT_140315890;
undefined DAT_140315894;
undefined8 DAT_1402f85a0;
undefined8 DAT_1402f85a8;
int DAT_140315928;
undefined DAT_1403159c8;
undefined *PTR_DAT_140206d98;
undefined FUN_1400ae5e0;
undefined8 DAT_14029fc58;
undefined8 DAT_14029fc68;
ulonglong DAT_1402f85a8;
undefined FUN_1400af0d0;
undefined FUN_1400af160;
undefined1 DAT_140316130;
undefined1 DAT_1403163b0;
undefined1 DAT_140315e10;
undefined1 DAT_140316220;
undefined1 DAT_140315e60;
undefined1 DAT_140315f50;
undefined1 DAT_1403160e0;
undefined1 DAT_1403162c0;
undefined1 DAT_140316400;
undefined1 DAT_140316360;
undefined1 DAT_140316090;
undefined1 DAT_140316270;
undefined1 DAT_140316180;
undefined1 DAT_140315eb0;
undefined1 DAT_140316040;
undefined1 DAT_140315fa0;
undefined1 DAT_1403161d0;
undefined1 DAT_140315f00;
undefined1 DAT_140315ff0;
undefined DAT_140207088;
char DAT_140316450;
undefined DAT_140316310;
undefined1 DAT_14031617f;
undefined1 DAT_1403163ff;
undefined1 DAT_140315e5f;
undefined1 DAT_14031626f;
undefined1 DAT_140315f4f;
undefined1 DAT_140315eaf;
undefined1 DAT_140315f9f;
undefined1 DAT_14031612f;
undefined1 DAT_14031630f;
undefined1 DAT_14031644f;
undefined1 DAT_1403163af;
undefined1 DAT_1403160df;
undefined1 DAT_1403162bf;
undefined1 DAT_1403161cf;
undefined1 DAT_140315eff;
undefined1 DAT_14031635f;
undefined1 DAT_14031608f;
undefined1 DAT_140315fef;
undefined1 DAT_14031621f;
undefined1 DAT_14031603f;
int DAT_140316454;
undefined DAT_140207430;
undefined DAT_1402074c0;
char DAT_140316458;
undefined1 DAT_1402f86a0;
undefined DAT_14020768c;
undefined DAT_140207694;
undefined DAT_1402076c4;
undefined1 DAT_140207978;
undefined *PTR_s_VHJpYWwgUGVyaW9kIEV4cGlyZWQ=_1402f86a8;
char DAT_1402f86a0;
undefined *PTR_s_MzAtRGF5IFRyaWFsIEV4cGlyZWQ=_1402f86b0;
undefined DAT_140207a6c;
undefined DAT_140207a98;
undefined DAT_140207ba0;
undefined DAT_140207d60;
undefined DAT_140316f18;
undefined DAT_140207a68;
undefined DAT_140207e30;
undefined1 DAT_00000000;
undefined DAT_1402085ac;
undefined DAT_140206fd0;
undefined DAT_1402085e0;
undefined1 DAT_1402083e0;
undefined DAT_14020868c;
undefined DAT_1402086d4;
undefined DAT_140208714;
undefined DAT_140208718;
undefined DAT_140208724;
undefined DAT_1402087a0;
undefined DAT_1402087a4;
undefined DAT_1402087a8;
undefined DAT_1402087ac;
undefined DAT_1402087b0;
undefined DAT_140316459;
undefined DAT_140208d30;
undefined DAT_14027ba60;
undefined DAT_14027ba68;
pointer[12] vftable;
undefined DAT_140208fcc;
undefined DAT_140208fc8;
undefined DAT_140209018;
undefined DAT_14020901c;
undefined1 DAT_1402749ec;
undefined4 DAT_140316460;
undefined4 DAT_1402f8e40;
undefined DAT_140316470;
undefined4 DAT_14031647c;
undefined4 DAT_140316854;
char DAT_140316465;
longlong DAT_140316858;
uint DAT_140316460;
uint DAT_1402f8e40;
undefined DAT_1402f8e50;
char DAT_140316464;
undefined8 DAT_140316858;
undefined DAT_140316471;
undefined DAT_140316472;
undefined DAT_140316473;
undefined DAT_1402092d8;
undefined DAT_1402092f8;
undefined DAT_1402092fc;
undefined DAT_140209300;
longlong DAT_140316ef0;
undefined *PTR_DAT_1402f9300;
longlong DAT_140316860;
longlong DAT_140316870;
longlong DAT_140316880;
longlong DAT_140316890;
longlong DAT_1403168a0;
longlong DAT_1403168b0;
longlong DAT_1403168c0;
longlong DAT_1403168d0;
longlong DAT_1403168e0;
longlong DAT_1403168f0;
longlong DAT_140316900;
longlong DAT_140316910;
longlong DAT_140316920;
longlong DAT_140316930;
longlong DAT_140316940;
longlong DAT_140316950;
longlong DAT_140316960;
longlong DAT_140316970;
longlong DAT_140316980;
longlong DAT_140316990;
longlong DAT_1403169a0;
longlong DAT_1403169b0;
longlong DAT_140316e60;
longlong DAT_140316eb0;
longlong DAT_140316e80;
longlong DAT_140316ea0;
longlong DAT_140316ec0;
longlong DAT_140316ed0;
longlong DAT_140316ee0;
longlong DAT_140316e90;
longlong DAT_140316e70;
longlong DAT_1403169c0;
longlong DAT_1403169d0;
longlong DAT_1403169e0;
longlong DAT_1403169f0;
longlong DAT_140316a00;
longlong DAT_140316a10;
longlong DAT_140316a20;
longlong DAT_140316a30;
longlong DAT_140316a40;
longlong DAT_140316a50;
longlong DAT_140316a60;
longlong DAT_140316a70;
longlong DAT_140316a80;
longlong DAT_140316a90;
longlong DAT_140316aa0;
longlong DAT_140316ab0;
longlong DAT_140316ac0;
longlong DAT_140316ad0;
longlong DAT_140316ae0;
longlong DAT_140316af0;
longlong DAT_140316b00;
longlong DAT_140316b10;
longlong DAT_140316b20;
longlong DAT_140316b30;
longlong DAT_140316b40;
longlong DAT_140316b50;
longlong DAT_140316b60;
longlong DAT_140316b70;
longlong DAT_140316b80;
longlong DAT_140316b90;
longlong DAT_140316ba0;
longlong DAT_140316bb0;
longlong DAT_140316bc0;
longlong DAT_140316bd0;
longlong DAT_140316be0;
longlong DAT_140316bf0;
longlong DAT_140316c00;
longlong DAT_140316c10;
longlong DAT_140316c20;
longlong DAT_140316c30;
longlong DAT_140316c40;
longlong DAT_140316c50;
longlong DAT_140316c60;
longlong DAT_140316c70;
longlong DAT_140316c80;
longlong DAT_140316c90;
longlong DAT_140316ca0;
longlong DAT_140316cb0;
longlong DAT_140316cc0;
longlong DAT_140316cd0;
longlong DAT_140316ce0;
longlong DAT_140316cf0;
longlong DAT_140316d00;
longlong DAT_140316d10;
longlong DAT_140316d20;
longlong DAT_140316d30;
longlong DAT_140316d40;
longlong DAT_140316d50;
longlong DAT_140316d60;
longlong DAT_140316d70;
longlong DAT_140316d80;
longlong DAT_140316d90;
longlong DAT_140316da0;
longlong DAT_140316db0;
longlong DAT_140316dc0;
longlong DAT_140316dd0;
longlong DAT_140316de0;
longlong DAT_140316df0;
longlong DAT_140316e00;
longlong DAT_140316e10;
longlong DAT_140316e20;
longlong DAT_140316e30;
longlong DAT_140316e40;
longlong DAT_140316e50;
undefined8 DAT_140316860;
undefined8 DAT_140316870;
undefined8 DAT_140316880;
undefined8 DAT_140316890;
undefined8 DAT_1403168a0;
undefined8 DAT_1403168b0;
undefined8 DAT_1403168c0;
undefined8 DAT_1403168d0;
undefined8 DAT_1403168e0;
undefined8 DAT_140316910;
undefined8 DAT_140316920;
undefined8 DAT_140316930;
undefined8 DAT_140316940;
undefined8 DAT_140316950;
undefined8 DAT_140316960;
undefined8 DAT_140316970;
undefined8 DAT_140316980;
undefined8 DAT_140316990;
undefined8 DAT_1403169a0;
undefined8 DAT_1403169b0;
undefined8 DAT_140316e60;
undefined8 DAT_140316eb0;
undefined8 DAT_140316e80;
undefined8 DAT_140316ea0;
undefined8 DAT_140316ec0;
undefined8 DAT_140316ed0;
undefined8 DAT_140316ee0;
undefined8 DAT_140316e90;
undefined8 DAT_140316e70;
undefined8 DAT_1403169c0;
undefined8 DAT_1403169d0;
undefined8 DAT_1403169e0;
undefined8 DAT_1403169f0;
undefined8 DAT_140316a00;
undefined8 DAT_140316a10;
undefined8 DAT_140316a20;
undefined8 DAT_140316a30;
undefined8 DAT_140316a40;
undefined8 DAT_140316a50;
undefined8 DAT_140316a60;
undefined8 DAT_140316a70;
undefined8 DAT_140316a80;
undefined8 DAT_140316a90;
undefined8 DAT_140316aa0;
undefined8 DAT_140316ab0;
undefined8 DAT_140316ac0;
undefined8 DAT_140316ad0;
undefined8 DAT_140316ae0;
undefined8 DAT_140316af0;
undefined8 DAT_140316b00;
undefined8 DAT_140316b10;
undefined8 DAT_140316b20;
undefined8 DAT_140316b30;
undefined8 DAT_140316b40;
undefined8 DAT_140316b50;
undefined8 DAT_140316b60;
undefined8 DAT_140316b70;
undefined8 DAT_140316b80;
undefined8 DAT_140316b90;
undefined8 DAT_140316ba0;
undefined8 DAT_140316bb0;
undefined8 DAT_140316bc0;
undefined8 DAT_140316bd0;
undefined8 DAT_140316be0;
undefined8 DAT_140316bf0;
undefined8 DAT_140316c00;
undefined8 DAT_140316c10;
undefined8 DAT_140316c20;
undefined8 DAT_140316c30;
undefined8 DAT_140316c40;
undefined8 DAT_140316c50;
undefined8 DAT_140316c60;
undefined8 DAT_140316c70;
undefined8 DAT_140316c80;
undefined8 DAT_140316c90;
undefined8 DAT_140316ca0;
undefined8 DAT_140316cb0;
undefined8 DAT_140316cc0;
undefined8 DAT_140316cd0;
undefined8 DAT_140316ce0;
undefined8 DAT_140316cf0;
undefined8 DAT_140316d00;
undefined8 DAT_140316d10;
undefined8 DAT_140316d20;
undefined8 DAT_140316d30;
undefined8 DAT_140316d40;
undefined8 DAT_140316d50;
undefined8 DAT_140316d60;
undefined8 DAT_140316d70;
undefined8 DAT_140316d80;
undefined8 DAT_140316d90;
undefined8 DAT_140316da0;
undefined8 DAT_140316db0;
undefined8 DAT_140316dc0;
undefined8 DAT_140316dd0;
undefined8 DAT_140316de0;
undefined8 DAT_140316df0;
undefined8 DAT_140316e00;
undefined8 DAT_140316e10;
undefined8 DAT_140316e20;
undefined8 DAT_140316e30;
undefined8 DAT_140316e40;
undefined8 DAT_140316e50;
undefined8 DAT_140316868;
undefined8 DAT_140316878;
undefined8 DAT_140316888;
undefined8 DAT_140316898;
undefined8 DAT_1403168a8;
undefined8 DAT_1403168b8;
undefined8 DAT_1403168c8;
undefined8 DAT_1403168d8;
undefined8 DAT_1403168e8;
undefined8 DAT_140316918;
undefined8 DAT_140316928;
undefined8 DAT_140316938;
undefined8 DAT_140316948;
undefined8 DAT_140316958;
undefined8 DAT_140316968;
undefined8 DAT_140316978;
undefined8 DAT_140316988;
undefined8 DAT_140316998;
undefined8 DAT_1403169a8;
undefined8 DAT_1403169b8;
undefined8 DAT_140316e68;
undefined8 DAT_140316eb8;
undefined8 DAT_140316ea8;
undefined8 DAT_140316e88;
undefined8 DAT_140316ec8;
undefined8 DAT_140316ed8;
undefined8 DAT_140316ee8;
undefined8 DAT_140316e98;
undefined8 DAT_140316e78;
undefined8 DAT_1403169c8;
undefined8 DAT_1403169d8;
undefined8 DAT_1403169e8;
undefined8 DAT_1403169f8;
undefined8 DAT_140316a08;
undefined8 DAT_140316a18;
undefined8 DAT_140316a28;
undefined8 DAT_140316a38;
undefined8 DAT_140316a48;
undefined8 DAT_140316a58;
undefined8 DAT_140316a68;
undefined8 DAT_140316a78;
undefined8 DAT_140316a88;
undefined8 DAT_140316a98;
undefined8 DAT_140316aa8;
undefined8 DAT_140316ab8;
undefined8 DAT_140316ac8;
undefined8 DAT_140316ad8;
undefined8 DAT_140316ae8;
undefined8 DAT_140316af8;
undefined8 DAT_140316b08;
undefined8 DAT_140316b18;
undefined8 DAT_140316b28;
undefined8 DAT_140316b38;
undefined8 DAT_140316b48;
undefined8 DAT_140316b58;
undefined8 DAT_140316b68;
undefined8 DAT_140316b78;
undefined8 DAT_140316b88;
undefined8 DAT_140316b98;
undefined8 DAT_140316ba8;
undefined8 DAT_140316bb8;
undefined8 DAT_140316bc8;
undefined8 DAT_140316bd8;
undefined8 DAT_140316be8;
undefined8 DAT_140316bf8;
undefined8 DAT_140316c08;
undefined8 DAT_140316c18;
undefined8 DAT_140316c28;
undefined8 DAT_140316c38;
undefined8 DAT_140316c48;
undefined8 DAT_140316c58;
undefined8 DAT_140316c68;
undefined8 DAT_140316c78;
undefined8 DAT_140316c88;
undefined8 DAT_140316c98;
undefined8 DAT_140316ca8;
undefined8 DAT_140316cb8;
undefined8 DAT_140316cc8;
undefined8 DAT_140316cd8;
undefined8 DAT_140316ce8;
undefined8 DAT_140316cf8;
undefined8 DAT_140316d08;
undefined8 DAT_140316d18;
undefined8 DAT_140316d28;
undefined8 DAT_140316d38;
undefined8 DAT_140316d48;
undefined8 DAT_140316d58;
undefined8 DAT_140316d68;
undefined8 DAT_140316d78;
undefined8 DAT_140316d88;
undefined8 DAT_140316d98;
undefined8 DAT_140316da8;
undefined8 DAT_140316db8;
undefined8 DAT_140316dc8;
undefined8 DAT_140316dd8;
undefined8 DAT_140316de8;
undefined8 DAT_140316df8;
undefined8 DAT_140316e08;
undefined8 DAT_140316e18;
undefined8 DAT_140316e28;
undefined8 DAT_140316e38;
undefined8 DAT_140316e48;
undefined8 DAT_140316e58;
undefined DAT_1402f8f00;
undefined2 DAT_140209100;
undefined DAT_14027b59c;
undefined DAT_14023ea84;
undefined DAT_14023e7f8;
undefined DAT_14023e8c0;
undefined DAT_14023eab0;
undefined DAT_14023ea3c;
undefined DAT_14027b594;
undefined *PTR_s_Sunday_1402f9388;
undefined *PTR_s_January_1402f93c0;
undefined DAT_14023ea70;
char DAT_140316ef8;
longlong DAT_1402f9470;
undefined DAT_14023f4a0;
undefined DAT_14023f4a4;
undefined DAT_14023f4ec;
undefined DAT_14023f500;
undefined DAT_1402403e0;
undefined DAT_1402403e8;
undefined DAT_14024049c;
undefined *PTR_s_WebSpirit_1402f9518;
undefined *PTR_DAT_1402f9c78;
undefined *PTR_DAT_1402f9c70;
undefined *PTR_DAT_1402f9c80;
undefined DAT_1402408a8;
undefined *PTR_s_Aptare_1402f9510;
undefined DAT_140240998;
undefined DAT_14024099c;
undefined DAT_140240b50;
undefined DAT_140241590;
undefined DAT_1402415d0;
undefined DAT_140240d90;
undefined DAT_140240e90;
undefined DAT_140240f90;
undefined DAT_140241090;
undefined DAT_140241190;
undefined DAT_140241290;
undefined DAT_140241390;
undefined DAT_140241490;
undefined4 DAT_1402f9d50;
undefined4 DAT_1402f9d54;
undefined4 DAT_1402f9d58;
undefined4 DAT_1402f9d5c;
undefined4 DAT_1402f9d60;
undefined4 DAT_1402f9d64;
undefined4 DAT_1402f9da0;
undefined4 DAT_1402f9da4;
undefined4 DAT_1402f9da8;
undefined4 DAT_1402f9dac;
undefined4 DAT_1402fada0;
undefined4 DAT_1402fada4;
undefined4 DAT_1402fada8;
undefined4 DAT_1402fadac;
undefined4 DAT_1402fadb0;
undefined4 DAT_1402fadb4;
undefined4 DAT_1402fadf0;
undefined4 DAT_1402fadf4;
undefined4 DAT_1402fadf8;
undefined4 DAT_1402fadfc;
undefined DAT_1402fbdf0;
undefined1 DAT_1402feff0;
undefined DAT_1402fdff0;
undefined DAT_1402fe3f0;
undefined DAT_1402fe7f0;
undefined DAT_1402febf0;
undefined DAT_1402fbef0;
undefined DAT_1402fbef1;
undefined DAT_1402fc2f0;
undefined DAT_1402fc6f0;
undefined DAT_1402fcaf0;
undefined DAT_1402fcef0;
undefined DAT_1402fd2f0;
undefined DAT_1402fd6f0;
undefined DAT_1402fdaf0;
undefined DAT_1402fdef0;
undefined DAT_140241f18;
undefined1 DAT_1402420a0;
undefined DAT_1402420c0;
undefined DAT_1402422b4;
undefined DAT_140242528;
undefined DAT_140242694;
undefined DAT_1402426e8;
undefined DAT_140242790;
undefined DAT_140242794;
undefined1 DAT_140244420;
undefined DAT_14024442c;
undefined DAT_1402448c4;
undefined DAT_140244cb4;
undefined DAT_140244ed0;
undefined DAT_140244ea0;
undefined DAT_140244fb0;
pointer[10] vftable;
undefined DAT_140209104;
undefined DAT_140244e70;
undefined DAT_1402452f0;
undefined DAT_140245350;
undefined DAT_1402453d0;
undefined DAT_1402ff380;
undefined DAT_1402ff330;
string s_0123456789ABCDEF_1402ff400;
undefined DAT_1402455a4;
undefined DAT_1402455ac;
undefined DAT_1402455b0;
undefined DAT_1402455a8;
undefined DAT_1402456e8;
undefined DAT_140245728;
undefined DAT_14024573c;
undefined DAT_140245744;
undefined DAT_1402ff550;
undefined1 DAT_1402457d0;
undefined DAT_140316f54;
undefined DAT_140316f4c;
undefined DAT_140246168;
undefined DAT_140283d70;
undefined DAT_1402ff680;
undefined DAT_1402ff684;
undefined DAT_1402464e8;
undefined DAT_140208d34;
undefined1 DAT_140246ca8;
undefined1 DAT_140246cb8;
undefined1 DAT_1402455f8;
undefined1 DAT_140246cc8;
undefined1 DAT_140246cd8;
undefined1 DAT_140245618;
undefined1 DAT_140246ce8;
undefined1 DAT_140246cf8;
undefined1 DAT_140245640;
undefined1 DAT_140246d08;
undefined1 DAT_140245650;
undefined1 DAT_140245658;
undefined1 DAT_140245664;
undefined1 DAT_140245670;
undefined1 DAT_14024567c;
undefined1 DAT_140245684;
undefined1 DAT_140245690;
undefined1 DAT_140246778;
undefined1 DAT_140246794;
undefined1 DAT_14024679c;
undefined1 DAT_1402467a8;
undefined1 DAT_1402467b8;
undefined1 DAT_1402467c8;
undefined1 DAT_1402467d4;
undefined1 DAT_1402467dc;
undefined1 DAT_1402467e4;
undefined1 DAT_1402467ec;
undefined1 DAT_1402467f8;
undefined1 DAT_140246820;
undefined1 DAT_140246828;
undefined1 DAT_140246830;
undefined1 DAT_140246838;
undefined1 DAT_140246840;
undefined1 DAT_140246848;
undefined1 DAT_140246850;
undefined1 DAT_140246858;
undefined1 DAT_140246860;
undefined1 DAT_140246868;
undefined1 DAT_140246870;
undefined1 DAT_140246878;
undefined1 DAT_140246888;
undefined1 DAT_1402468c8;
undefined1 DAT_1402468d0;
undefined1 DAT_1402468e0;
undefined1 DAT_1402468f0;
undefined1 DAT_140246910;
undefined1 DAT_140246930;
undefined1 DAT_140246938;
undefined1 DAT_140246948;
undefined1 DAT_140246958;
undefined1 DAT_140246968;
undefined1 DAT_140246978;
undefined1 DAT_140246988;
undefined1 DAT_140246998;
undefined1 DAT_1402469a8;
undefined1 DAT_1402469b8;
undefined1 DAT_1402469c8;
undefined1 DAT_1402469d8;
undefined1 DAT_1402469e8;
undefined1 DAT_1402469f0;
undefined1 DAT_1402469f8;
undefined1 DAT_140246a00;
undefined1 DAT_140246a08;
undefined1 DAT_140246a10;
undefined1 DAT_140246a18;
undefined1 DAT_140246a20;
undefined1 DAT_140246a28;
undefined1 DAT_140246a30;
undefined1 DAT_140246a38;
undefined1 DAT_140246a40;
undefined1 DAT_140246a4c;
undefined1 DAT_140246a54;
undefined1 DAT_140246a5c;
undefined1 DAT_140246a64;
undefined1 DAT_140246a6c;
undefined1 DAT_140246a74;
undefined1 DAT_140246a80;
undefined1 DAT_140246a88;
undefined1 DAT_140246a94;
undefined1 DAT_140246a9c;
undefined1 DAT_140246aa4;
undefined1 DAT_140246bc0;
undefined1 DAT_140246bc8;
undefined1 DAT_140246bd8;
undefined1 DAT_140246bf8;
undefined1 DAT_140246c04;
undefined1 DAT_140246c0c;
undefined1 DAT_140246c88;
undefined1 DAT_140246c98;
undefined DAT_140247c40;
undefined DAT_140247d40;
undefined DAT_140247d58;
undefined s_.?AVUnicodeLookup@@_140309390;
undefined2 DAT_1403170f0;
undefined DAT_1403171f0;
undefined DAT_1403172f0;
undefined DAT_140308ec8;
undefined DAT_140308ecc;
char DAT_1403173a0;
HMODULE DAT_140317398;
FARPROC DAT_140317390;
undefined *DAT_140317390;
undefined DAT_1402487f4;
undefined DAT_1402487f8;
undefined4 DAT_140309850;
undefined1 DAT_140309650;
undefined1 DAT_140309651;
undefined1 DAT_140309652;
undefined1 DAT_140309653;
undefined1 DAT_140309750;
undefined1 DAT_140309751;
undefined1 DAT_140309752;
undefined1 DAT_140309753;
undefined4 DAT_1403173b0;
undefined4 DAT_1403173b4;
undefined4 DAT_1403173b8;
undefined4 DAT_1403177b0;
undefined4 DAT_1403177b4;
undefined4 DAT_1403177b8;
undefined4 DAT_140317bb0;
undefined4 DAT_140317bb4;
undefined4 DAT_140317bb8;
undefined4 DAT_140317fb0;
undefined4 DAT_140317fb4;
undefined4 DAT_140317fb8;
int DAT_140309850;
undefined DAT_140248a30;
undefined *PTR_s_0123456789_140309878;
undefined DAT_140249194;
undefined DAT_1402491a4;
undefined DAT_1402491a8;
undefined DAT_1402491ac;
undefined DAT_1402491b0;
undefined DAT_1402491b8;
undefined DAT_1402491c0;
undefined DAT_14020910c;
undefined DAT_140249424;
undefined DAT_140249428;
undefined DAT_14024942c;
undefined DAT_140283d80;
undefined DAT_140249708;
undefined DAT_140274aa0;
undefined DAT_14027b5a0;
undefined DAT_140249e2c;
undefined DAT_14024a2e0;
undefined DAT_14024a2e4;
undefined DAT_14024a2e8;
undefined DAT_14024a2ec;
int DAT_140309908;
int DAT_140309900;
int DAT_14030990c;
int DAT_140309904;
undefined FUN_14012b930;
undefined FUN_14012bd90;
undefined FUN_14011d870;
undefined FUN_14011d980;
undefined FUN_140122980;
undefined FUN_14012a0c0;
undefined FUN_14012b5e0;
undefined FUN_14011ff30;
undefined DAT_14024af08;
undefined DAT_14024b2d0;
undefined DAT_14024b548;
undefined DAT_14024b550;
undefined DAT_14024b558;
longlong DAT_1403183b8;
char DAT_1403183b0;
void *DAT_1403183b8;
undefined4 DAT_1403099c0;
undefined DAT_14030a1c0;
longlong DAT_1403183c0;
undefined DAT_1403183c8;
undefined4 DAT_1403183d0;
undefined4 DAT_1403183d4;
undefined DAT_14024bef0;
undefined DAT_14024bf30;
undefined DAT_14024bf70;
undefined DAT_14024bfb0;
char DAT_1403183e8;
int DAT_1403183d0;
int DAT_1403183d4;
undefined DAT_14024bea0;
undefined DAT_14024bff0;
undefined DAT_14024c120;
undefined DAT_14024c124;
undefined DAT_14024c150;
undefined1 DAT_14027b680;
undefined s_.?AVKeyContainer@@_14030a648;
undefined1 DAT_140279390;
undefined DAT_140316f08;
undefined DAT_1402456f0;
undefined DAT_140247fe0;
undefined DAT_14024c620;
undefined DAT_14024c664;
undefined DAT_14027a10c;
undefined1 DAT_14027b698;
undefined DAT_14024c718;
undefined DAT_140283d6c;
undefined1 DAT_14024649c;
undefined1 DAT_1402479d4;
undefined DAT_14024c8cc;
undefined1 DAT_1403183e8;
char DAT_140318ce9;
char DAT_140318cea;
undefined8 DAT_1402f8138;
undefined4 DAT_1402f8148;
undefined1 DAT_1402f8145;
char DAT_14030ae80;
uint DAT_140318e78;
undefined8 DAT_140318e70;
undefined DAT_140318e80;
undefined FUN_1402029e0;
undefined *PTR_u_Already_async_callback_may_occur_14030bd58;
int DAT_1402f8190;
short DAT_1402f83d4;
int DAT_1402f83d0;
char DAT_140313fcf;
undefined UNK_14014593e;
undefined UNK_140145944;
undefined UNK_14014599b;
int DAT_14030ae60;
undefined DAT_140318cf0;
undefined UNK_14014728f;
pointer PTR_vftable_14030c240;
double DAT_1402f8198;
undefined *PTR_DAT_14030af18;
undefined *PTR_DAT_14030af10;
undefined *PTR_DAT_14030af08;
undefined *PTR_DAT_14030af00;
undefined *PTR_DAT_14030aef8;
undefined *PTR_DAT_14030aef0;
undefined *PTR_DAT_14030aee8;
undefined *PTR_DAT_14030aee0;
undefined *PTR_DAT_14030aed8;
undefined *PTR_DAT_14030aed0;
undefined *PTR_DAT_14030aec8;
undefined *PTR_DAT_14030aec0;
undefined *PTR_DAT_14030aeb8;
undefined *PTR_DAT_14030aeb0;
undefined *PTR_DAT_14030aea8;
undefined *PTR_DAT_14030aea0;
undefined *PTR_DAT_14030ae98;
undefined *PTR_DAT_14030ae90;
undefined *PTR_DAT_14030ae88;
undefined *PTR_DAT_14030af30;
undefined *PTR_DAT_14030af38;
undefined *PTR_DAT_14030af40;
undefined *PTR_DAT_14030af48;
undefined *PTR_DAT_14030af50;
undefined *PTR_DAT_14030af58;
undefined *PTR_DAT_14030af60;
undefined *PTR_DAT_14030af68;
undefined *PTR_DAT_14030af70;
undefined *PTR_DAT_14030af78;
undefined *PTR_DAT_14030af80;
undefined *PTR_DAT_14030af88;
undefined *PTR_DAT_14030af90;
undefined *PTR_DAT_14030af98;
undefined *PTR_DAT_14030afa0;
undefined *PTR_DAT_14030afa8;
undefined *PTR_DAT_14030afb0;
double DAT_140314008;
undefined UNK_14015074d;
undefined UNK_14015077a;
undefined UNK_14015078c;
undefined UNK_1401507b9;
undefined DAT_140251360;
undefined2 DAT_140314258;
undefined DAT_140314250;
double DAT_1402f80f8;
undefined1 DAT_1402f81cc;
undefined UNK_1401518c2;
undefined UNK_1401518c8;
undefined UNK_1401518ce;
undefined UNK_1401518d4;
undefined UNK_1401518da;
undefined UNK_1401518e0;
undefined UNK_1401518e6;
undefined UNK_1401518ec;
undefined UNK_1401518f2;
undefined UNK_14015199d;
TypeDescriptor RTTI_Type_Descriptor;
undefined DAT_1402f8158;
undefined *PTR_u_Collection_object_can_use_fast_h_1402f81d0;
undefined *PTR_DAT_14030af20;
undefined *PTR_DAT_14030af28;
undefined DAT_140251b10;
undefined DAT_140251c20;
int DAT_140318ec0;
undefined8 DAT_140318ec8;
undefined DAT_140251ed0;
undefined DAT_140252050;
undefined DAT_140252150;
int DAT_1402f8194;
undefined DAT_1402f81b0;
undefined DAT_1402f80d0;
undefined DAT_140252950;
undefined DAT_1402f4710;
double DAT_1402f81a0;
undefined8 DAT_1402f81a8;
undefined DAT_140253400;
undefined UNK_14015fc0b;
undefined UNK_14015fc19;
undefined UNK_14015fe1a;
undefined UNK_14015fe20;
undefined UNK_14015fe2c;
undefined UNK_1401602a5;
undefined UNK_1401602d2;
undefined UNK_1401602ff;
undefined UNK_14016030b;
pointer[69] vftable;
pointer[43] vftable;
undefined4 DAT_1402f8110;
pointer[26] vftable;
pointer[28] vftable;
pointer[6] vftable;
pointer PTR_vftable_1402f83c8;
double DAT_1402f80a8;
double DAT_1402f80e0;
undefined DAT_140253f28;
undefined DAT_140253f60;
undefined DAT_140318db0;
undefined DAT_1402542a8;
undefined DAT_1402545f0;
undefined DAT_1402546f0;
undefined *PTR_u_Duplicated_RMI_ID_is_found._Revi_14030bd48;
undefined *PTR_u_Wrong_RMI_ID_is_found._RMI_ID_sh_14030bd50;
undefined4 DAT_1402f80e8;
double DAT_1402f8078;
undefined8 UNK_00000100;
undefined4 UNK_00000284;
undefined8 UNK_000002b8;
undefined8 DAT_1402f8130;
int UNK_00000140;
short UNK_00000144;
undefined UNK_14016b8be;
undefined UNK_14016b8c4;
undefined UNK_14016b91d;
double DAT_1402f8058;
undefined DAT_1402f8168;
double DAT_1402f8100;
undefined *PTR_DAT_14030b6a8;
undefined *PTR_DAT_14030b6a0;
undefined *PTR_DAT_14030b698;
undefined *PTR_DAT_14030b690;
undefined *PTR_DAT_14030b688;
undefined *PTR_DAT_14030b680;
undefined *PTR_DAT_14030b678;
undefined *PTR_DAT_14030b670;
undefined *PTR_DAT_14030b668;
undefined *PTR_DAT_14030b660;
undefined *PTR_DAT_14030b658;
undefined *PTR_DAT_14030b650;
undefined *PTR_DAT_14030b648;
undefined *PTR_DAT_14030b640;
undefined *PTR_DAT_14030b638;
undefined *PTR_DAT_14030b630;
undefined *PTR_DAT_14030b628;
undefined *PTR_DAT_14030b620;
undefined *PTR_DAT_14030b618;
undefined *PTR_DAT_14030b6c8;
undefined *PTR_DAT_14030b6c0;
undefined *PTR_DAT_14030b6b8;
undefined *PTR_DAT_14030b6b0;
undefined *PTR_DAT_14030b6d0;
undefined *PTR_DAT_14030b6d8;
undefined *PTR_DAT_14030b6e0;
undefined *PTR_DAT_14030b6e8;
undefined *PTR_DAT_14030b6f0;
undefined *PTR_DAT_14030b700;
undefined *PTR_DAT_14030b708;
undefined *PTR_DAT_14030b710;
undefined *PTR_DAT_14030b718;
undefined *PTR_DAT_14030b720;
undefined *PTR_DAT_14030b728;
undefined *PTR_DAT_14030b730;
undefined *PTR_DAT_14030b738;
undefined *PTR_DAT_14030b740;
undefined *PTR_DAT_14030b748;
undefined *PTR_DAT_14030b750;
undefined *PTR_DAT_14030b758;
undefined *PTR_DAT_14030b760;
undefined *PTR_DAT_14030b768;
undefined *PTR_DAT_14030b770;
undefined *PTR_DAT_14030b778;
undefined *PTR_DAT_14030b780;
undefined8 DAT_1402f80f0;
undefined DAT_1402f8108;
undefined DAT_140256390;
int DAT_140318f00;
undefined DAT_140318f08;
undefined *PTR_DAT_14030b6f8;
pointer PTR_vftable_14030c770;
undefined DAT_140256b10;
undefined DAT_140256b88;
undefined8 DAT_1402f8080;
undefined DAT_140256e88;
undefined DAT_1402f81b8;
undefined DAT_00000000;
undefined DAT_140257150;
undefined *PTR_u_Cannot_send_messages_unless_conn_14030b788;
longlong DAT_1402f8090;
pointer[57] vftable;
pointer[9] vftable;
undefined8 DAT_1402f8090;
undefined8 DAT_1402f8100;
undefined8 DAT_1402f8180;
undefined8 DAT_1402f81a0;
undefined DAT_140257bb0;
pointer[11] vftable;
pointer[13] vftable;
undefined DAT_140257f00;
int DAT_1402f8088;
undefined8 DAT_140314010;
undefined8 DAT_1402f8078;
undefined *PTR_u_Cannot_use_internal_buffer_becau_14030c160;
undefined *PTR_u_Cannot_use_external_buffer_becau_14030c158;
undefined DAT_1402582f0;
undefined DAT_140258500;
undefined DAT_140258d60;
undefined8 *DAT_140319120;
undefined DAT_140319128;
undefined DAT_140259740;
undefined DAT_140259890;
undefined DAT_1402599f0;
undefined UNK_14018d183;
undefined UNK_14018d584;
undefined UNK_14018d5b1;
undefined UNK_14018d5de;
undefined UNK_14018d5ea;
undefined UNK_14018d617;
undefined UNK_14018d65a;
undefined1 DAT_140318d80;
undefined1 DAT_140318da0;
undefined UNK_14018da97;
undefined UNK_14018ddca;
undefined UNK_14018de01;
undefined8 DAT_1402f80f8;
undefined4 DAT_1402f806c;
undefined8 DAT_1402f80a8;
undefined8 DAT_1402f80b0;
undefined8 DAT_1402f8150;
undefined8 DAT_1402f80d8;
undefined DAT_14025a780;
undefined DAT_14025a7c0;
undefined4 DAT_1402f8068;
undefined DAT_14025aae8;
undefined *PTR_u_exception_due_to_not_using_Inter_14030c140;
undefined DAT_14025aff0;
undefined FUN_140191900;
undefined FUN_140191930;
undefined FUN_14018ce80;
undefined FUN_140193780;
undefined DAT_14025b330;
undefined LAB_1401956f0;
undefined LAB_140195f50;
undefined DAT_14025be10;
undefined DAT_14025e010;
undefined DAT_14025e410;
undefined DAT_14025e810;
undefined DAT_14025ec10;
undefined1 DAT_14025f010;
undefined DAT_14025c010;
undefined DAT_14025c410;
undefined DAT_14025c810;
undefined DAT_14025cc10;
undefined DAT_14025bf10;
undefined DAT_14025d010;
undefined DAT_14025d410;
undefined DAT_14025d810;
undefined DAT_14025dc10;
undefined DAT_14025f038;
undefined DAT_14025f040;
undefined DAT_14025f048;
undefined DAT_14025f03c;
undefined DAT_14025f044;
undefined DAT_14025f04c;
undefined DAT_14025f188;
undefined DAT_14025f1c0;
undefined DAT_14025f1f0;
undefined DAT_140314018;
char DAT_14030c100;
uint DAT_140319000;
undefined LAB_140202ab0;
undefined DAT_140318f40;
undefined DAT_140319008;
undefined4 DAT_14030c048;
undefined4 DAT_14030c04c;
undefined4 DAT_14030c050;
undefined4 DAT_14030c054;
undefined *PTR_u_RequestLogin_14030bf98;
undefined *PTR_u_NotifyCommon_ReceiveRmi_14030bfa8;
undefined *PTR_u_NotifyCli_ConnectionState_14030bfb0;
undefined *PTR_u_NotifyCli_Peers_Clear_14030bfb8;
undefined *PTR_u_NotifyCli_Peers_AddOrEdit_14030bfc0;
undefined *PTR_u_NotifySrv_ClientEmpty_14030bfc8;
undefined *PTR_u_NotifySrv_Clients_AddOrEdit_14030bfd0;
undefined *PTR_u_NotifySrv_Clients_Remove_14030bfd8;
undefined *PTR_u_NotifyLoginFailed_14030c040;
undefined *PTR_u_NotifyLoginOk_14030c038;
pointer[23] vftable;
undefined *PTR_u_NotifyCommon_SendRmi_14030bfa0;
short *DAT_140319108;
undefined DAT_1403190d0;
undefined2 *DAT_140319108;
undefined *PTR_u_error:_ArrayPtr_is_null!_14030c130;
undefined DAT_1402602e0;
int DAT_1402f8148;
undefined8 DAT_140319120;
int DAT_1402f8118;
undefined FUN_14019ce70;
undefined LAB_14019cdc0;
undefined DAT_1402f8120;
char DAT_1402f8144;
undefined DAT_1402f8128;
undefined4 DAT_1402f8048;
int DAT_1402f80ec;
undefined4 DAT_1402f804c;
undefined DAT_1402613f0;
undefined DAT_140261498;
undefined DAT_1402615c0;
undefined DAT_140261630;
undefined LAB_1401a35e0;
undefined DAT_1402616f0;
undefined4 DAT_1402f8050;
undefined4 DAT_1402f8054;
undefined DAT_140261a78;
undefined DAT_140261ac0;
undefined DAT_140261af8;
pointer PTR_s_LibTomMath_140267a00;
pointer PTR_DAT_140267b90;
pointer PTR_s_fortuna_140267c10;
undefined DAT_140320fc0;
undefined DAT_140321000;
undefined DAT_140321040;
undefined8 DAT_140321080;
char DAT_14030c400;
uint DAT_14031a200;
undefined DAT_1403191a0;
undefined DAT_14031a208;
undefined FUN_140202bf0;
undefined *DAT_140321110;
undefined4 DAT_1402f8070;
undefined4 DAT_140313fc4;
undefined4 DAT_1402f8190;
undefined *PTR_u_exception_due_to_using_external_b_14030c148;
char DAT_14030c4c0;
uint DAT_14031a2d0;
undefined LAB_140202c40;
undefined DAT_14031a240;
undefined DAT_14031a2d8;
double DAT_1402f8060;
undefined DAT_140262390;
undefined DAT_1402624b0;
undefined DAT_140262ad8;
undefined DAT_1402f81c0;
undefined DAT_140262bc0;
undefined DAT_140262ca8;
undefined DAT_140262d78;
char DAT_1402f8147;
undefined4 DAT_1402f8074;
uint DAT_1402f8074;
undefined LAB_1401a8980;
undefined LAB_1401b1660;
longlong DAT_1402f8078;
pointer PTR_DAT_140205360;
undefined DAT_140205368;
undefined DAT_14020536c;
undefined DAT_14027b66c;
undefined4 DAT_14031a320;
undefined2 DAT_14031a324;
undefined *DAT_14031a310;
undefined DAT_1402636e0;
undefined DAT_140263960;
undefined DAT_140263ac0;
int DAT_1402f808c;
undefined DAT_140313fc0;
undefined DAT_140263b90;
undefined DAT_140263bd8;
undefined DAT_140318d00;
undefined DAT_140318d10;
undefined DAT_140318d20;
undefined DAT_140318d30;
undefined DAT_140318d40;
undefined DAT_140318d38;
undefined DAT_140318d44;
undefined DAT_140318d08;
undefined DAT_140318d18;
undefined DAT_140318d28;
undefined8 UNK_140318cf8;
undefined4 UNK_140318d34;
undefined4 UNK_140318d3c;
undefined4 UNK_140318d48;
undefined4 UNK_140318d4c;
undefined1 DAT_14030afb8;
double DAT_1402f80f0;
double DAT_140314010;
undefined DAT_1402f8170;
undefined DAT_140264130;
undefined4 DAT_140318d78;
char DAT_14030c821;
undefined8 DAT_140318d70;
char DAT_14030c822;
undefined DAT_14030c868;
int DAT_14030c888;
undefined DAT_14030c880;
int DAT_14030c88c;
double DAT_14030c840;
double DAT_14030c830;
double DAT_14030c838;
longlong DAT_14030c828;
double DAT_14030c878;
uint DAT_14031d598;
undefined4 DAT_14030c854;
undefined4 DAT_14031d5a0;
undefined DAT_14030c870;
int DAT_14031d5a0;
undefined LAB_1401bf0d0;
undefined LAB_1401bf0e0;
undefined FUN_1401c97e0;
undefined FUN_1401c97f0;
undefined DAT_140264cd0;
undefined DAT_1402650d0;
undefined DAT_1402654d0;
undefined DAT_1402658d0;
undefined DAT_140264420;
undefined DAT_140264c20;
undefined DAT_140264ca0;
undefined DAT_140267370;
undefined LAB_1401c18b0;
char DAT_140313fcc;
int DAT_1402f814c;
double DAT_1402f8180;
undefined8 DAT_14031ad30;
undefined8 DAT_14031a330;
undefined4 DAT_1402679e0;
undefined DAT_1402679e4;
longlong DAT_140321080;
undefined *DAT_1403210e0;
undefined *DAT_140321090;
undefined *DAT_1403210a0;
undefined *DAT_1403210b8;
undefined *DAT_140321140;
undefined *DAT_140321178;
undefined *DAT_140321180;
undefined *DAT_140321198;
undefined *DAT_140321148;
undefined *DAT_140321160;
undefined *DAT_1403210b0;
undefined *DAT_1403210e8;
undefined *DAT_140321200;
undefined4 DAT_14031d590;
undefined2 DAT_14031d594;
undefined DAT_14031d330;
undefined DAT_1402f8160;
undefined FUN_1401c5650;
int DAT_14031d59c;
undefined1 DAT_140268fa0;
undefined DAT_1402690a0;
undefined DAT_1402691a0;
undefined DAT_140267f00;
undefined DAT_140267f02;
undefined DAT_140267f04;
undefined DAT_140267f06;
pointer PTR_FUN_140267f08;
undefined1 DAT_140268a80;
undefined DAT_140268930;
undefined DAT_1402689b0;
undefined DAT_1402692a0;
undefined DAT_140269320;
undefined DAT_1402691c6;
undefined DAT_140269206;
undefined DAT_140269450;
undefined DAT_140269490;
pointer PTR_DAT_14030c890;
pointer PTR_DAT_14030c8b0;
undefined DAT_14030c8d0;
undefined DAT_140268aa0;
undefined DAT_140268f20;
undefined *DAT_140321120;
undefined *DAT_1403210d8;
undefined *DAT_1403211c0;
undefined *DAT_140321138;
undefined *DAT_140321188;
undefined *DAT_140321128;
undefined *DAT_140321118;
undefined DAT_140269530;
undefined *PTR_s_0123456789ABCDEFGHIJKLMNOPQRSTUV_14030c8f0;
int DAT_14030c900;
int DAT_14030c8f8;
int DAT_14030c904;
int DAT_14030c8fc;
undefined4 DAT_14026df80;
undefined DAT_14026b2d0;
undefined DAT_14026b6d0;
undefined DAT_14026bad0;
undefined DAT_14026bed0;
undefined DAT_14026ced0;
undefined DAT_14026d2d0;
undefined DAT_14026d6d0;
undefined DAT_14026dad0;
undefined4 DAT_14026ded4;
undefined DAT_14026deec;
undefined DAT_14026def0;
undefined DAT_14026def8;
undefined DAT_1402696d0;
undefined DAT_14026a6d0;
undefined DAT_14026aad0;
undefined DAT_14026aed0;
undefined DAT_140269ed0;
undefined DAT_14026a2d0;
undefined DAT_14026c2d0;
undefined DAT_14026c6d0;
undefined DAT_14026cad0;
undefined *DAT_1403211c8;
undefined DAT_14031a358;
undefined DAT_14031ad3c;
undefined FUN_1401cda40;
undefined FUN_1401d8400;
undefined FUN_1401d8590;
undefined FUN_1401d5010;
undefined FUN_1401d86b0;
undefined FUN_1401d8810;
undefined4 DAT_14026e380;
undefined4 DAT_14026e384;
undefined4 DAT_14026e5d0;
undefined4 DAT_14026e5d4;
undefined *DAT_1403210f0;
undefined *DAT_1403210f8;
undefined FUN_1401d8a00;
undefined FUN_1401d8d40;
undefined *PTR_s_0123456789_14030c908;
undefined FUN_1401de3f8;
undefined FUN_1401de3d8;
undefined DAT_14026e970;
undefined DAT_14026f170;
undefined DAT_14026f1f0;
pointer PTR_FUN_14026f268;
undefined DAT_14026f260;
undefined DAT_14026f262;
undefined DAT_14026f264;
undefined DAT_14026f266;
undefined DAT_140271b00;
undefined1 DAT_140271c00;
undefined DAT_140271d00;
undefined UNK_14026f18e;
undefined DAT_14026f1ce;
undefined DAT_14026f410;
undefined DAT_14026f450;
undefined DAT_14026f490;
undefined DAT_14026f890;
undefined DAT_14026fc90;
undefined DAT_140270090;
undefined DAT_140270490;
undefined DAT_140270890;
undefined DAT_140270c90;
undefined DAT_140271090;
undefined1 DAT_1402715e0;
undefined DAT_140271490;
undefined DAT_140271510;
undefined DAT_140271e00;
undefined DAT_140271e80;
pointer PTR_DAT_14030c910;
pointer PTR_DAT_14030c930;
undefined DAT_14030c950;
undefined DAT_140271600;
undefined DAT_140271a80;
ulonglong DAT_1403203a0;
undefined DAT_140320388;
ulonglong DAT_140320378;
undefined DAT_140320398;
undefined DAT_140320360;
ulonglong DAT_140320350;
undefined DAT_140320370;
undefined DAT_140320338;
ulonglong DAT_140320328;
undefined DAT_140320348;
undefined DAT_140320310;
ulonglong DAT_140320300;
undefined DAT_140320320;
undefined DAT_1403202e8;
ulonglong DAT_1403202d8;
undefined DAT_1403202f8;
undefined DAT_1403202c0;
ulonglong DAT_1403202b0;
undefined DAT_1403202d0;
undefined DAT_140320298;
ulonglong DAT_140320288;
undefined DAT_1403202a8;
undefined DAT_140320270;
ulonglong DAT_140320260;
undefined DAT_140320280;
undefined DAT_140320248;
ulonglong DAT_140320238;
undefined DAT_140320258;
undefined DAT_140320220;
ulonglong DAT_140320210;
undefined DAT_140320230;
undefined DAT_1403201f8;
ulonglong DAT_1403201e8;
undefined DAT_140320208;
undefined DAT_1403201d0;
undefined DAT_1403201e0;
ulonglong DAT_140320650;
undefined DAT_140320638;
void *DAT_140320618;
undefined DAT_140320648;
void *DAT_140320620;
undefined DAT_140320628;
ulonglong DAT_1403203d8;
undefined DAT_1403203c0;
undefined DAT_1403203d0;
undefined DAT_1403203e8;
undefined8 DAT_1403203c0;
undefined8 DAT_1403201e8;
undefined8 DAT_1403201d0;
undefined8 DAT_140320210;
undefined8 DAT_140320238;
undefined8 DAT_140320260;
undefined8 DAT_140320288;
undefined8 DAT_1403202b0;
undefined8 DAT_1403202d8;
undefined8 DAT_140320300;
undefined8 DAT_140320328;
undefined8 DAT_140320350;
undefined8 DAT_140320378;
undefined8 DAT_1403203a0;
undefined8 DAT_140320388;
undefined4 DAT_1403203b0;
undefined8 DAT_140320618;
undefined8 DAT_140320638;
undefined8 DAT_1403203d8;
undefined8 DAT_140320620;
undefined8 DAT_140320650;
undefined DAT_1400a4b47;
undefined DAT_1400b8ed5;
undefined DAT_1400b9147;
undefined DAT_1400b936b;
undefined DAT_1400bbb65;
undefined DAT_1400bbeae;
undefined DAT_1400bbfd8;
undefined DAT_1400bc58f;
undefined DAT_1400bc6d9;
undefined DAT_1400bc91d;
undefined DAT_1400bca42;
undefined DAT_1400bcb00;
undefined DAT_1400bcb1c;
undefined DAT_1400bcb72;
undefined DAT_1400bcc0b;
undefined DAT_1400bd065;
undefined DAT_1400bd192;
undefined DAT_1400bd8bd;
undefined DAT_1400be221;
undefined DAT_1400be763;
undefined DAT_1400be7c9;
undefined DAT_1400d09a6;
undefined DAT_1400d0b71;
undefined DAT_1400d0dfb;
undefined DAT_1400d11fc;
undefined DAT_14010484f;
undefined DAT_140134855;
undefined DAT_1401399d1;
undefined DAT_140151a13;
undefined DAT_140151957;
undefined DAT_140151ee2;
undefined DAT_140162d3e;
undefined DAT_140253ed0;
undefined DAT_14017aef9;
undefined DAT_14017adf5;
undefined DAT_14017adfa;
undefined DAT_14017adff;
undefined DAT_14017d2ff;
undefined DAT_14018b47c;
undefined DAT_140190a53;
undefined DAT_140190fb7;
undefined DAT_1401929f3;
undefined DAT_140197c22;
undefined DAT_140197ed6;
undefined DAT_1401981cd;
undefined DAT_1401983f2;
undefined DAT_1401a5b20;
undefined DAT_1401a5da8;
undefined DAT_1401ac7bc;
undefined DAT_1401ac77c;
undefined DAT_1401b0f22;
undefined DAT_1401b107f;
undefined DAT_1401b29ad;
undefined DAT_14000d3b4;
undefined DAT_14000433c;
undefined DAT_14009aba2;
undefined DAT_140095932;
undefined DAT_14001db12;
undefined DAT_14000d592;

// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140001000(longlong param_1)

{
  PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo;
  DWORD DVar1;
  BOOL BVar2;
  wchar_t *pwVar3;
  wchar_t *pwVar4;
  ulonglong uVar5;
  HANDLE pvVar6;
  undefined1 auStack_268 [32];
  undefined8 local_248;
  undefined8 local_240;
  WCHAR local_228;
  undefined1 local_226 [526];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_268;
  DVar1 = GetCurrentProcessId();
  *(DWORD *)(param_1 + 0x450) = DVar1;
  local_228 = L'\0';
  memset(local_226,0,0x206);
  DVar1 = GetModuleFileNameW((HMODULE)0x0,&local_228,0x104);
  if (0 < (int)DVar1) {
    pwVar3 = wcsrchr(&local_228,L'\\');
    pwVar4 = wcsrchr(&local_228,L'.');
    uVar5 = (longlong)pwVar4 + (-2 - (longlong)pwVar3) >> 1;
    if (0x104 < uVar5) {
      uVar5 = 0x104;
    }
    memcpy((void *)(param_1 + 0x3c),pwVar3 + 1,uVar5 * 2);
    FUN_140001200(param_1,param_1 + 0x3c);
    pvVar6 = GetStdHandle(0xfffffff5);
    *(HANDLE *)(param_1 + 8) = pvVar6;
    if (pvVar6 != (HANDLE)0xffffffffffffffff) {
      FUN_140001170(param_1);
      pvVar6 = *(HANDLE *)(param_1 + 8);
      if (pvVar6 != (HANDLE)0xffffffffffffffff) {
        lpConsoleScreenBufferInfo = (PCONSOLE_SCREEN_BUFFER_INFO)(param_1 + 0x10);
        local_248 = 0;
        local_240 = 0;
        (lpConsoleScreenBufferInfo->dwSize).X = 0;
        (lpConsoleScreenBufferInfo->dwSize).Y = 0;
        (lpConsoleScreenBufferInfo->dwCursorPosition).X = 0;
        (lpConsoleScreenBufferInfo->dwCursorPosition).Y = 0;
        *(undefined8 *)(param_1 + 0x18) = 0;
        *(undefined4 *)(param_1 + 0x20) = 0;
        *(undefined2 *)(param_1 + 0x24) = 0;
        BVar2 = GetConsoleScreenBufferInfo(pvVar6,lpConsoleScreenBufferInfo);
        if (BVar2 != 0) {
          *(undefined2 *)(param_1 + 0x454) = *(undefined2 *)(param_1 + 0x18);
        }
      }
      return 1;
    }
  }
  return 0;
}



BOOL FUN_140001170(longlong param_1)

{
  BOOL BVar1;
  DWORD local_res10 [2];
  
  if (*(HANDLE *)(param_1 + 8) == (HANDLE)0xffffffffffffffff) {
    return 0;
  }
  BVar1 = GetConsoleScreenBufferInfo
                    (*(HANDLE *)(param_1 + 8),(PCONSOLE_SCREEN_BUFFER_INFO)(param_1 + 0x26));
  if (BVar1 == 0) {
    return 0;
  }
  FillConsoleOutputAttribute
            (*(HANDLE *)(param_1 + 8),*(ushort *)(param_1 + 0x2e) & 0xf | 0x10,
             (int)*(short *)(param_1 + 0x28) * (int)*(short *)(param_1 + 0x26),(COORD)0x0,
             local_res10);
  BVar1 = SetConsoleTextAttribute(*(HANDLE *)(param_1 + 8),0x17);
  return BVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140001200(longlong param_1,longlong param_2)

{
  longlong lVar1;
  undefined1 auStack_248 [32];
  WCHAR local_228;
  undefined1 local_226 [526];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_248;
  lVar1 = param_1 + 0x3c;
  if (param_2 != 0) {
    lVar1 = param_2;
  }
  FUN_140001630(param_1 + 0x246,L"%s [%u]",lVar1,*(undefined4 *)(param_1 + 0x450));
  local_228 = L'\0';
  memset(local_226,0,0x206);
  FUN_140001600(&local_228,&DAT_140271f08,param_1 + 0x246);
  SetConsoleTitleW(&local_228);
  return;
}



undefined8 * FUN_1400012a0(undefined8 *param_1,byte param_2)

{
  DAT_140320108 = 0;
  *param_1 = MBISingleton<>::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe

undefined8 FUN_1400012e0(int param_1,longlong param_2)

{
  short sVar1;
  FILE *_File;
  DWORD DVar2;
  void *pvVar3;
  undefined8 *puVar4;
  ulonglong uVar5;
  longlong lVar6;
  short *psVar7;
  HANDLE *ppvVar8;
  undefined4 local_res8 [2];
  undefined1 local_21b8 [280];
  undefined8 *local_20a0;
  undefined8 *local_2068;
  HANDLE local_2028;
  undefined1 local_2020 [8192];
  undefined8 uStack_20;
  
  uStack_20 = 0x1400012ee;
  DAT_14031fe84 = timeGetTime();
  FUN_1400251e0();
  FUN_140001550();
  FUN_140001000();
  if (1 < param_1) {
    uVar5 = 0xffffffffffffffff;
    psVar7 = *(short **)(param_2 + 8);
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      sVar1 = *psVar7;
      psVar7 = psVar7 + 1;
    } while (sVar1 != 0);
    FUN_140001b00(&DAT_140312d90,*(short **)(param_2 + 8),~uVar5 - 1);
  }
  local_2028 = (HANDLE)0x0;
  memset(local_2020,0,0x2000);
  DVar2 = GetProcessHeaps(0x400,&local_2028);
  lVar6 = 4;
  if (DVar2 != 0) {
    ppvVar8 = &local_2028;
    uVar5 = (ulonglong)DVar2;
    do {
      local_res8[0] = 2;
      HeapSetInformation(*ppvVar8,HeapCompatibilityInformation,local_res8,4);
      ppvVar8 = ppvVar8 + 1;
      uVar5 = uVar5 - 1;
    } while (uVar5 != 0);
  }
  pvVar3 = operator_new(0xe8);
  puVar4 = (undefined8 *)0x0;
  if (pvVar3 != (void *)0x0) {
    puVar4 = (undefined8 *)FUN_1401e4870(pvVar3);
  }
  DAT_140320100 = puVar4;
  FUN_1401e4af0(puVar4);
  FUN_140004780(local_21b8);
  puVar4 = &DAT_140312d90;
  if (7 < DAT_140312da8) {
    puVar4 = DAT_140312d90;
  }
  FUN_140004ab0(local_21b8,puVar4);
  FUN_140006d80(local_21b8);
  if (local_2068 != (undefined8 *)0x0) {
    (**(code **)*local_2068)(local_2068,1);
  }
  local_2068 = (undefined8 *)0x0;
  if (local_20a0 != (undefined8 *)0x0) {
    (**(code **)*local_20a0)(local_20a0,1);
  }
  local_20a0 = (undefined8 *)0x0;
  if (DAT_140320140 != (undefined8 *)0x0) {
    (**(code **)*DAT_140320140)(DAT_140320140,1);
  }
  if (DAT_140320128 != (undefined8 *)0x0) {
    (**(code **)*DAT_140320128)(DAT_140320128,1);
  }
  if (DAT_140320130 != (undefined8 *)0x0) {
    (**(code **)*DAT_140320130)(DAT_140320130,1);
  }
  puVar4 = DAT_140320100;
  EnterCriticalSection(DAT_140320120);
  _File = (FILE *)puVar4[0x17];
  if (_File != (FILE *)0x0) {
    fclose(_File);
  }
  puVar4 = puVar4 + 0x19;
  do {
    if ((FILE *)*puVar4 != (FILE *)0x0) {
      fclose((FILE *)*puVar4);
    }
    puVar4 = puVar4 + 1;
    lVar6 = lVar6 + -1;
  } while (lVar6 != 0);
  LeaveCriticalSection(DAT_140320120);
  if (DAT_140320100 != (undefined8 *)0x0) {
    (**(code **)*DAT_140320100)(DAT_140320100,1);
  }
  if (DAT_140320108 != (undefined8 *)0x0) {
    (**(code **)*DAT_140320108)(DAT_140320108,1);
  }
  FUN_140004970(local_21b8);
  return 0;
}



void FUN_140001550(void)

{
  undefined8 *puVar1;
  
  puVar1 = operator_new(0x458);
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[2] = 0;
    *(undefined8 *)((longlong)puVar1 + 0x26) = 0;
    puVar1[3] = 0;
    *(undefined8 *)((longlong)puVar1 + 0x2e) = 0;
    *(undefined4 *)(puVar1 + 4) = 0;
    *(undefined4 *)((longlong)puVar1 + 0x36) = 0;
    *(undefined2 *)((longlong)puVar1 + 0x24) = 0;
    *(undefined2 *)((longlong)puVar1 + 0x3a) = 0;
    *puVar1 = CConsoleControl::vftable;
    puVar1[1] = 0xffffffffffffffff;
    *(undefined4 *)(puVar1 + 0x8a) = 0;
    memset((void *)((longlong)puVar1 + 0x3c),0,0x20a);
    memset((void *)((longlong)puVar1 + 0x246),0,0x20a);
    DAT_140320108 = puVar1;
    *(undefined2 *)((longlong)puVar1 + 0x454) = 0x17;
    return;
  }
  DAT_140320108 = (undefined8 *)0x0;
  return;
}



void FUN_140001600(wchar_t *param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 local_res18;
  undefined8 local_res20;
  
  local_res18 = param_3;
  local_res20 = param_4;
  vswprintf_s(param_1,0x104,param_2,(va_list)&local_res18);
  return;
}



void FUN_140001630(wchar_t *param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 local_res18;
  undefined8 local_res20;
  
  local_res18 = param_3;
  local_res20 = param_4;
  vswprintf_s(param_1,0x105,param_2,(va_list)&local_res18);
  return;
}



undefined8 * FUN_140001660(undefined8 *param_1,ulonglong param_2,ulonglong param_3)

{
  longlong lVar1;
  code *pcVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  ulonglong uVar5;
  
  if ((ulonglong)param_1[2] < param_2) {
    std::_Xout_of_range("invalid string position");
    pcVar2 = (code *)swi(3);
    puVar3 = (undefined8 *)(*pcVar2)();
    return puVar3;
  }
  uVar5 = param_1[2] - param_2;
  if (uVar5 < param_3) {
    param_3 = uVar5;
  }
  if (param_3 != 0) {
    puVar4 = param_1;
    puVar3 = param_1;
    if (7 < (ulonglong)param_1[3]) {
      puVar4 = (undefined8 *)*param_1;
      puVar3 = (undefined8 *)*param_1;
    }
    memmove((void *)((longlong)puVar4 + param_2 * 2),
            (void *)((longlong)puVar3 + (param_2 + param_3) * 2),(uVar5 - param_3) * 2);
    lVar1 = param_1[2];
    param_1[2] = lVar1 - param_3;
    puVar3 = param_1;
    if (7 < (ulonglong)param_1[3]) {
      puVar3 = (undefined8 *)*param_1;
    }
    *(undefined2 *)((longlong)puVar3 + (lVar1 - param_3) * 2) = 0;
  }
  return param_1;
}



undefined8 *
FUN_140001700(undefined8 *param_1,undefined8 *param_2,ulonglong param_3,ulonglong param_4)

{
  code *pcVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  
  if ((ulonglong)param_2[2] < param_3) {
    std::_Xout_of_range("invalid string position");
    pcVar1 = (code *)swi(3);
    puVar2 = (undefined8 *)(*pcVar1)();
    return puVar2;
  }
  uVar3 = param_2[2] - param_3;
  if (param_4 < uVar3) {
    uVar3 = param_4;
  }
  if (param_1 == param_2) {
    FUN_140001660(param_1,uVar3 + param_3,0xffffffffffffffff);
    FUN_140001660(param_1,0,param_3);
  }
  else {
    if (0x7ffffffffffffffe < uVar3) {
      std::_Xlength_error("string too long");
      pcVar1 = (code *)swi(3);
      puVar2 = (undefined8 *)(*pcVar1)();
      return puVar2;
    }
    if ((ulonglong)param_1[3] < uVar3) {
      FUN_140001930(param_1,uVar3,param_1[2]);
      if (uVar3 == 0) {
        return param_1;
      }
    }
    else if (uVar3 == 0) {
      param_1[2] = 0;
      if (7 < (ulonglong)param_1[3]) {
        *(undefined2 *)*param_1 = 0;
        return param_1;
      }
      *(undefined2 *)param_1 = 0;
      return param_1;
    }
    if (7 < (ulonglong)param_2[3]) {
      param_2 = (undefined8 *)*param_2;
    }
    puVar2 = param_1;
    if (7 < (ulonglong)param_1[3]) {
      puVar2 = (undefined8 *)*param_1;
    }
    memcpy(puVar2,(void *)((longlong)param_2 + param_3 * 2),uVar3 * 2);
    param_1[2] = uVar3;
    puVar2 = param_1;
    if (7 < (ulonglong)param_1[3]) {
      puVar2 = (undefined8 *)*param_1;
    }
    *(undefined2 *)((longlong)puVar2 + uVar3 * 2) = 0;
  }
  return param_1;
}



exception * FUN_140001850(exception *param_1,uint param_2)

{
  *(undefined ***)param_1 = std::bad_alloc::vftable;
  std::exception::~exception(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



exception * FUN_140001890(exception *param_1,exception *param_2)

{
  std::exception::exception(param_1,param_2);
  *(undefined ***)param_1 = std::bad_alloc::vftable;
  return param_1;
}



void * FUN_1400018c0(ulonglong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  if (param_1 == 0) {
    return (void *)0x0;
  }
  if ((param_1 < 0x8000000000000000) && (pvVar1 = operator_new(param_1 * 2), pvVar1 != (void *)0x0))
  {
    return pvVar1;
  }
  local_res8[0] = (char *)0x0;
  std::exception::exception((exception *)local_28,local_res8);
  local_28[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_28,(ThrowInfo *)&DAT_1402f47a8);
}



void FUN_140001930(undefined8 *param_1,ulonglong param_2,longlong param_3)

{
  ulonglong uVar1;
  undefined8 *_Dst;
  ulonglong uVar2;
  undefined8 *_Src;
  ulonglong uVar3;
  
  uVar3 = param_2 | 7;
  if (uVar3 < 0x7fffffffffffffff) {
    uVar1 = param_1[3];
    uVar2 = uVar1 >> 1;
    param_2 = uVar3;
    if ((uVar3 / 3 < uVar2) && (param_2 = uVar2 + uVar1, 0x7ffffffffffffffe - uVar2 < uVar1)) {
      param_2 = 0x7ffffffffffffffe;
    }
  }
  _Dst = (undefined8 *)FUN_1400018c0(param_2 + 1);
  if (param_3 != 0) {
    _Src = param_1;
    if (7 < (ulonglong)param_1[3]) {
      _Src = (undefined8 *)*param_1;
    }
    memcpy(_Dst,_Src,param_3 * 2);
  }
  if (7 < (ulonglong)param_1[3]) {
    operator_delete((void *)*param_1);
  }
  *param_1 = _Dst;
  param_1[3] = param_2;
  param_1[2] = param_3;
  if (7 < param_2) {
    param_1 = _Dst;
  }
  *(undefined2 *)((longlong)param_1 + param_3 * 2) = 0;
  return;
}



undefined1 FUN_140001a20(undefined8 *param_1,ulonglong param_2,char param_3)

{
  ulonglong uVar1;
  void *_Src;
  code *pcVar2;
  undefined1 uVar3;
  ulonglong uVar4;
  
  if (0x7ffffffffffffffe < param_2) {
    std::_Xlength_error("string too long");
    pcVar2 = (code *)swi(3);
    uVar3 = (*pcVar2)();
    return uVar3;
  }
  uVar1 = param_1[3];
  if (uVar1 < param_2) {
    FUN_140001930(param_1,param_2,param_1[2]);
  }
  else if ((param_3 == '\0') || (7 < param_2)) {
    if (param_2 == 0) {
      param_1[2] = 0;
      if (7 < uVar1) {
        param_1 = (undefined8 *)*param_1;
      }
      *(undefined2 *)param_1 = 0;
    }
  }
  else {
    uVar4 = param_1[2];
    if (param_2 < (ulonglong)param_1[2]) {
      uVar4 = param_2;
    }
    if (7 < uVar1) {
      _Src = (void *)*param_1;
      if (uVar4 != 0) {
        memcpy(param_1,_Src,uVar4 * 2);
      }
      operator_delete(_Src);
    }
    param_1[2] = uVar4;
    param_1[3] = 7;
    *(undefined2 *)((longlong)param_1 + uVar4 * 2) = 0;
  }
  return param_2 != 0;
}



undefined8 * FUN_140001b00(undefined8 *param_1,undefined8 *param_2,ulonglong param_3)

{
  ulonglong uVar1;
  code *pcVar2;
  undefined8 *puVar3;
  
  if (param_2 != (undefined8 *)0x0) {
    uVar1 = param_1[3];
    puVar3 = param_1;
    if (7 < uVar1) {
      puVar3 = (undefined8 *)*param_1;
    }
    if (puVar3 <= param_2) {
      puVar3 = param_1;
      if (7 < uVar1) {
        puVar3 = (undefined8 *)*param_1;
      }
      if (param_2 < (undefined8 *)((longlong)puVar3 + param_1[2] * 2)) {
        puVar3 = param_1;
        if (7 < uVar1) {
          puVar3 = (undefined8 *)*param_1;
        }
        puVar3 = (undefined8 *)
                 FUN_140001700(param_1,param_1,(longlong)param_2 - (longlong)puVar3 >> 1,param_3);
        return puVar3;
      }
    }
  }
  if (0x7ffffffffffffffe < param_3) {
    std::_Xlength_error("string too long");
    pcVar2 = (code *)swi(3);
    puVar3 = (undefined8 *)(*pcVar2)();
    return puVar3;
  }
  if ((ulonglong)param_1[3] < param_3) {
    FUN_140001930(param_1,param_3,param_1[2]);
    if (param_3 == 0) {
      return param_1;
    }
  }
  else if (param_3 == 0) {
    param_1[2] = 0;
    if (7 < (ulonglong)param_1[3]) {
      *(undefined2 *)*param_1 = 0;
      return param_1;
    }
    *(undefined2 *)param_1 = 0;
    return param_1;
  }
  puVar3 = param_1;
  if (7 < (ulonglong)param_1[3]) {
    puVar3 = (undefined8 *)*param_1;
  }
  memcpy(puVar3,param_2,param_3 * 2);
  param_1[2] = param_3;
  puVar3 = param_1;
  if (7 < (ulonglong)param_1[3]) {
    puVar3 = (undefined8 *)*param_1;
  }
  *(undefined2 *)((longlong)puVar3 + param_3 * 2) = 0;
  return param_1;
}



undefined8 * FUN_140001c60(undefined8 *param_1,uint param_2)

{
  *param_1 = MagiServerBase::vftable;
  if ((void *)param_1[2] != (void *)0x0) {
    operator_delete((void *)param_1[2]);
  }
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140001cc0(undefined8 *param_1)

{
  *param_1 = MagiServerBase::vftable;
  if ((void *)param_1[2] != (void *)0x0) {
    operator_delete((void *)param_1[2]);
  }
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  return;
}



void FUN_140001d00(longlong param_1,undefined8 param_2)

{
  ulonglong *puVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined8 local_res10 [3];
  
  puVar2 = *(undefined8 **)(param_1 + 0x18);
  puVar1 = (ulonglong *)(param_1 + 0x10);
  local_res10[0] = param_2;
  if (local_res10 < puVar2) {
    puVar3 = (undefined8 *)*puVar1;
    if (puVar3 <= local_res10) {
      if (puVar2 == *(undefined8 **)(param_1 + 0x20)) {
        FUN_14000b000(puVar1);
      }
      if (*(undefined8 **)(param_1 + 0x18) != (undefined8 *)0x0) {
        **(undefined8 **)(param_1 + 0x18) =
             *(undefined8 *)(*puVar1 + ((longlong)local_res10 - (longlong)puVar3 >> 3) * 8);
        *(longlong *)(param_1 + 0x18) = *(longlong *)(param_1 + 0x18) + 8;
        return;
      }
      goto LAB_140001d88;
    }
  }
  if (puVar2 == *(undefined8 **)(param_1 + 0x20)) {
    FUN_14000b000(puVar1);
  }
  if (*(undefined8 **)(param_1 + 0x18) != (undefined8 *)0x0) {
    **(undefined8 **)(param_1 + 0x18) = param_2;
  }
LAB_140001d88:
  *(longlong *)(param_1 + 0x18) = *(longlong *)(param_1 + 0x18) + 8;
  return;
}



void FUN_140001da0(undefined8 param_1)

{
  FUN_140001e90(param_1,0x15);
  FUN_140001e90(param_1,0xd);
  FUN_140001e90(param_1,0xc);
  FUN_140001e90(param_1,0x11);
  FUN_140001e90(param_1,0x12);
  FUN_140001e90(param_1,0x13);
  FUN_140001e90(param_1,10);
  FUN_140001e90(param_1,6);
  FUN_140001e90(param_1,0xb);
  FUN_140001e90(param_1,9);
  FUN_140001e90(param_1,7);
  FUN_140001e90(param_1,8);
  FUN_140001e90(param_1,5);
  FUN_140001e90(param_1,1);
  FUN_140001e90(param_1,2);
  FUN_140001e90(param_1,3);
                    // WARNING: Could not recover jumptable at 0x000140001e82. Too many branches
                    // WARNING: Treating indirect jump as call
  wprintf(L"\n------------------------------------------------------------------------------\n");
  return;
}



void FUN_140001e90(longlong param_1,uint param_2)

{
  int iVar1;
  longlong *plVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  longlong lVar6;
  ulonglong uVar7;
  
  uVar3 = 0;
  iVar1 = (int)(*(longlong *)(param_1 + 0x18) - *(longlong *)(param_1 + 0x10) >> 3);
  if (0 < iVar1) {
    plVar2 = *(longlong **)(param_1 + 0x10);
    uVar4 = uVar3;
    uVar5 = uVar3;
    lVar6 = (longlong)iVar1;
    uVar7 = uVar3;
    do {
      if ((*plVar2 != 0) && (*(byte *)(*plVar2 + 0x40) == param_2)) {
        uVar5 = (ulonglong)((int)uVar5 + 1);
        uVar7 = uVar4;
      }
      uVar4 = (ulonglong)((int)uVar4 + 1);
      plVar2 = plVar2 + 1;
      lVar6 = lVar6 + -1;
    } while (lVar6 != 0);
    if ((int)uVar5 != 0) {
      uVar4 = uVar3;
      if ((int)uVar5 < 2) {
        FUN_1400026c0((*(longlong **)(param_1 + 0x10))[(int)uVar7],0xffffffff);
      }
      else {
        do {
          if ((*(longlong *)(*(longlong *)(param_1 + 0x10) + uVar3 * 8) != 0) &&
             (lVar6 = *(longlong *)(*(longlong *)(param_1 + 0x10) + uVar3 * 8),
             *(byte *)(lVar6 + 0x40) == param_2)) {
            FUN_1400026c0(lVar6,uVar4);
            uVar4 = (ulonglong)((int)uVar4 + 1);
          }
          uVar3 = uVar3 + 1;
        } while ((longlong)uVar3 < (longlong)iVar1);
      }
    }
  }
  return;
}



undefined8 * FUN_140001f70(undefined8 *param_1)

{
  *(undefined2 *)(param_1 + 1) = 0;
  *param_1 = MagiCommonSession::vftable;
  param_1[2] = 0;
  *(undefined4 *)(param_1 + 3) = 0x1000001;
  *(undefined1 *)((longlong)param_1 + 0x1c) = 1;
  param_1[4] = 0;
  param_1[5] = 0x4008000000000000;
  FUN_1400a3440();
  param_1[6] = PTR_DAT_1402f8010;
  *(undefined8 *)((longlong)param_1 + 0x3c) = 0;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320610 == 1000) {
    *(undefined1 *)((longlong)param_1 + 0x1c) = 0;
    param_1[5] = 0x4024000000000000;
  }
  return param_1;
}



undefined8 * FUN_140002030(undefined8 *param_1,uint param_2)

{
  *param_1 = MagiCommonSession::vftable;
  FUN_1400031d0(param_1 + 6);
  *param_1 = Proud::INetClientEvent::vftable;
  FUN_140140b40(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140002090(undefined8 *param_1)

{
  *param_1 = MagiCommonSession::vftable;
  FUN_1400031d0(param_1 + 6);
  *param_1 = Proud::INetClientEvent::vftable;
  FUN_140140b40(param_1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400020e0(longlong param_1)

{
  int *piVar1;
  char cVar2;
  undefined *puVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined *puVar6;
  undefined1 auStack_b8 [32];
  undefined8 local_98;
  undefined1 local_90;
  undefined8 local_88;
  undefined1 local_80;
  undefined8 local_78;
  undefined *local_68;
  undefined2 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined1 local_48 [48];
  ulonglong local_18;
  
  local_78 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_b8;
  puVar3 = *(undefined **)(param_1 + 0x30);
  if ((((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1402f8010)) &&
      (0 < *(int *)(puVar3 + -8))) &&
     (((*(char *)(param_1 + 0x18) != '\0' && (*(char *)(param_1 + 0x19) == '\0')) &&
      ((*(char *)(param_1 + 0x1a) == '\0' && (*(longlong *)(param_1 + 0x10) != 0)))))) {
    *(undefined2 *)(param_1 + 0x19) = 1;
    FUN_140140b80(&local_68);
    local_5c = DAT_140320030;
    local_58 = DAT_140320034;
    local_54 = DAT_140320038;
    local_50 = DAT_14032003c;
    if (local_68 == (undefined *)0x0) {
      local_68 = PTR_DAT_1402f8010;
    }
    if (*(undefined **)(param_1 + 0x30) != local_68) {
      uVar4 = FUN_1400a3440();
      local_88 = uVar4;
      FUN_1400a1c30(uVar4);
      puVar3 = local_68;
      local_80 = 1;
      if (((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1402f8010)) &&
         (puVar6 = local_68 + -8, puVar6 != (undefined *)0x0)) {
        uVar5 = FUN_1400a3440();
        local_98 = uVar5;
        FUN_1400a1c30(uVar5);
        local_90 = 1;
        piVar1 = (int *)(puVar3 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar6);
        }
        FUN_1400d1290(uVar5);
      }
      local_68 = *(undefined **)(param_1 + 0x30);
      if (((local_68 != PTR_DAT_1402f8010) && (local_68 != (undefined *)0x0)) &&
         (local_68 != (undefined *)0x8)) {
        *(int *)(local_68 + -4) = *(int *)(local_68 + -4) + 1;
      }
      FUN_1400d1290(uVar4);
    }
    local_60 = *(undefined2 *)(param_1 + 0x38);
    (**(code **)(**(longlong **)(param_1 + 0x10) + 0x88))();
    (**(code **)(**(longlong **)(param_1 + 0x10) + 0x78))(*(longlong **)(param_1 + 0x10),&local_68);
    cVar2 = *(char *)(param_1 + 0x19);
    while (cVar2 != '\0') {
      Sleep(10);
      (**(code **)(**(longlong **)(param_1 + 0x10) + 0x98))(*(longlong **)(param_1 + 0x10),0);
      cVar2 = *(char *)(param_1 + 0x19);
    }
    FUN_140140df0(local_48);
    puVar3 = local_68;
    if (((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1402f8010)) &&
       (puVar6 = local_68 + -8, puVar6 != (undefined *)0x0)) {
      uVar4 = FUN_1400a3440();
      local_98 = uVar4;
      FUN_1400a1c30(uVar4);
      local_90 = 1;
      piVar1 = (int *)(puVar3 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar6);
      }
      FUN_1400d1290(uVar4);
    }
  }
  return;
}



void FUN_140002310(longlong param_1)

{
  FUN_140140df0(param_1 + 0x20);
  FUN_1400031d0(param_1);
  return;
}



undefined8 FUN_140002340(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  double dVar2;
  __time64_t local_res8;
  __time64_t local_res18 [2];
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  _time64(&local_res8);
  do {
    (**(code **)(**(longlong **)(param_1 + 0x10) + 0x88))();
    *(undefined2 *)(param_1 + 0x1a) = 0x100;
    *(undefined1 *)(param_1 + 0x19) = 1;
    cVar1 = (**(code **)(**(longlong **)(param_1 + 0x10) + 0x78))
                      (*(longlong **)(param_1 + 0x10),param_2,param_3,param_4,uVar3);
    if (cVar1 == '\x01') {
      cVar1 = *(char *)(param_1 + 0x19);
      while (cVar1 != '\0') {
        Sleep(10);
        (**(code **)(**(longlong **)(param_1 + 0x10) + 0x98))(*(longlong **)(param_1 + 0x10),0);
        cVar1 = *(char *)(param_1 + 0x19);
      }
      if (*(char *)(param_1 + 0x1a) == '\x01') {
        return 1;
      }
    }
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if (DAT_140320610 == 1000) {
      return 0;
    }
    _time64(local_res18);
    dVar2 = _difftime64(local_res18[0],local_res8);
    if ((299 < (int)dVar2) || (Sleep(1), *(char *)(param_1 + 0x1a) != '\0')) {
      FUN_140025dc0(4,L"ERROR >> MagiCommonSession::ProcConnect | Time over!");
      return 0;
    }
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140002460(longlong param_1)

{
  undefined *puVar1;
  undefined1 auStack_68 [32];
  undefined8 local_48;
  undefined2 local_40;
  undefined6 uStack_3e;
  undefined8 local_30;
  ulonglong local_28;
  ulonglong local_18;
  
  local_48 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_68;
  puVar1 = *(undefined **)(param_1 + 0x30);
  if ((((puVar1 != (undefined *)0x0) && (puVar1 != PTR_DAT_1402f8010)) &&
      (0 < *(int *)(puVar1 + -8))) && (*(char *)(param_1 + 0x18) != '\0')) {
    if (*(char *)(param_1 + 0x1b) == '\0') {
      if ((*(char *)(param_1 + 0x1a) != '\0') && (*(longlong *)(param_1 + 0x10) != 0)) {
        (**(code **)(**(longlong **)(param_1 + 0x10) + 0x98))(*(longlong **)(param_1 + 0x10),0);
      }
    }
    else if (*(char *)(param_1 + 0x1c) != '\0') {
      Sleep((DWORD)(longlong)*(double *)(param_1 + 0x28));
      local_28 = 7;
      local_30 = 0;
      local_40 = 0;
      FUN_140002890(param_1,&local_40);
      wprintf(L"%s : RETRY CONNECT : IP[ %s ] PORT[ %d ]\n");
      FUN_1400020e0(param_1);
      if (7 < local_28) {
        operator_delete((void *)CONCAT62(uStack_3e,local_40));
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140002570(longlong param_1,double param_2)

{
  undefined *puVar1;
  longlong *plVar2;
  double dVar3;
  undefined1 auStack_68 [32];
  undefined8 local_48;
  undefined2 local_40;
  undefined6 uStack_3e;
  undefined8 local_30;
  ulonglong local_28;
  ulonglong local_18;
  
  local_48 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_68;
  puVar1 = *(undefined **)(param_1 + 0x30);
  if (((puVar1 != (undefined *)0x0) && (puVar1 != PTR_DAT_1402f8010)) && (0 < *(int *)(puVar1 + -8))
     ) {
    if (*(char *)(param_1 + 0x18) == '\0') {
      if (*(char *)(param_1 + 0x1a) != '\0') {
        plVar2 = *(longlong **)(param_1 + 0x10);
        if (plVar2 != (longlong *)0x0) {
          (**(code **)(*plVar2 + 0x98))(plVar2,0);
        }
        Sleep(100);
      }
    }
    else if (*(char *)(param_1 + 0x1b) == '\0') {
      if ((*(char *)(param_1 + 0x1a) != '\0') &&
         (plVar2 = *(longlong **)(param_1 + 0x10), plVar2 != (longlong *)0x0)) {
        (**(code **)(*plVar2 + 0x98))(plVar2,0);
      }
    }
    else {
      dVar3 = param_2 - *(double *)(param_1 + 0x20);
      if ((*(double *)(param_1 + 0x28) <= dVar3 && dVar3 != *(double *)(param_1 + 0x28)) &&
         (*(double *)(param_1 + 0x20) = param_2, *(char *)(param_1 + 0x1c) != '\0')) {
        local_28 = 7;
        local_30 = 0;
        local_40 = 0;
        FUN_140002890(dVar3,&local_40);
        wprintf(L"%s : RETRY CONNECT : ADDRESS[ %s ] PORT[ %d ]\n");
        FUN_1400020e0(param_1);
        if (7 < local_28) {
          operator_delete((void *)CONCAT62(uStack_3e,local_40));
        }
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400026c0(longlong param_1,int param_2)

{
  wchar_t *pwVar1;
  undefined8 uVar2;
  undefined1 auStack_d8 [32];
  uint local_b8;
  uint local_b0;
  undefined8 local_a8;
  undefined2 local_a0;
  undefined6 uStack_9e;
  undefined8 local_90;
  ulonglong local_88;
  undefined2 local_78;
  undefined6 uStack_76;
  undefined8 local_68;
  ulonglong local_60;
  undefined2 local_50;
  undefined6 uStack_4e;
  undefined8 local_40;
  ulonglong local_38;
  ulonglong local_28;
  
  local_a8 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_d8;
  local_38 = 7;
  local_40 = 0;
  local_50 = 0;
  local_88 = 7;
  local_90 = 0;
  local_a0 = 0;
  local_60 = 7;
  local_68 = 0;
  local_78 = 0;
  FUN_140002890(param_1,&local_50);
  FUN_140002c20(&local_78,&local_50,0,0xffffffffffffffff);
  FUN_140002ac0(&local_78,L" Sessoion",9);
  if (*(char *)(param_1 + 0x18) == '\0') {
    uVar2 = 10;
    pwVar1 = L"[ DisUse ]";
  }
  else {
    uVar2 = 7;
    pwVar1 = L"[ Use ]";
  }
  FUN_140001b00(&local_a0,pwVar1,uVar2);
  if (param_2 < 1) {
    wprintf(L"\n-%s %s---------------------------------------------------------\n");
  }
  local_b8 = *(uint *)(param_1 + 0x3c);
  if (param_2 == -1) {
    wprintf(L"Session S[ %d ] : ADDRESS[ %s ] PORT[ %d ] CODE[ %d ]\n");
  }
  else {
    local_b0 = local_b8;
    local_b8 = (uint)*(ushort *)(param_1 + 0x38);
    wprintf(L"Session [%d] S[ %d ] : ADDRESS[ %s ] PORT[ %d ] CODE[ %d ]\n");
  }
  if (7 < local_60) {
    operator_delete((void *)CONCAT62(uStack_76,local_78));
  }
  local_60 = 7;
  local_68 = 0;
  local_78 = 0;
  if (7 < local_88) {
    operator_delete((void *)CONCAT62(uStack_9e,local_a0));
  }
  local_88 = 7;
  local_90 = 0;
  local_a0 = 0;
  if (7 < local_38) {
    operator_delete((void *)CONCAT62(uStack_4e,local_50));
  }
  return;
}



void FUN_140002890(longlong param_1,undefined8 param_2)

{
  wchar_t *pwVar1;
  
  switch(*(undefined1 *)(param_1 + 0x40)) {
  case 1:
    FUN_140001b00(param_2,L"Lobby",5);
    return;
  case 2:
    FUN_140001b00(param_2,L"Dungeon",7);
    return;
  case 3:
    FUN_140001b00(param_2,&DAT_140272600,3);
    return;
  case 4:
    FUN_140001b00(param_2,&DAT_140272608,3);
    return;
  case 5:
    FUN_140001b00(param_2,L"Guild",5);
    return;
  case 6:
    FUN_140001b00(param_2,L"Message",7);
    return;
  case 7:
    FUN_140001b00(param_2,&DAT_140272630,2);
    return;
  case 8:
    FUN_140001b00(param_2,L"Gate",4);
    return;
  case 9:
    FUN_140001b00(param_2,L"Manager",7);
    return;
  case 10:
    FUN_140001b00(param_2,L"Auction",7);
    return;
  case 0xb:
    FUN_140001b00(param_2,L"Match",5);
    return;
  case 0xc:
    pwVar1 = L"DBC_GAME";
    break;
  case 0xd:
    FUN_140001b00(param_2,L"Agent",5);
    return;
  default:
    goto switchD_1400028b9_caseD_d;
  case 0x11:
    FUN_140001b00(param_2,L"DBC_LOG",7);
    return;
  case 0x12:
    pwVar1 = L"DBC_CHAT";
    break;
  case 0x13:
    FUN_140001b00(param_2,L"DBC_EMERGENCY",0xd);
    return;
  case 0x15:
    FUN_140001b00(param_2,L"Agentmanager",0xc);
    return;
  case 0x16:
    pwVar1 = L"MiniGame";
  }
  FUN_140001b00(param_2,pwVar1,8);
switchD_1400028b9_caseD_d:
  return;
}



undefined8 * FUN_140002ac0(undefined8 *param_1,undefined8 *param_2,ulonglong param_3)

{
  ulonglong uVar1;
  code *pcVar2;
  undefined8 *puVar3;
  
  if (param_2 != (undefined8 *)0x0) {
    uVar1 = param_1[3];
    puVar3 = param_1;
    if (7 < uVar1) {
      puVar3 = (undefined8 *)*param_1;
    }
    if (puVar3 <= param_2) {
      puVar3 = param_1;
      if (7 < uVar1) {
        puVar3 = (undefined8 *)*param_1;
      }
      if (param_2 < (undefined8 *)((longlong)puVar3 + param_1[2] * 2)) {
        puVar3 = param_1;
        if (7 < uVar1) {
          puVar3 = (undefined8 *)*param_1;
        }
        puVar3 = (undefined8 *)
                 FUN_140002c20(param_1,param_1,(longlong)param_2 - (longlong)puVar3 >> 1,param_3);
        return puVar3;
      }
    }
  }
  if (-param_1[2] - 1 <= param_3) {
    std::_Xlength_error("string too long");
    pcVar2 = (code *)swi(3);
    puVar3 = (undefined8 *)(*pcVar2)();
    return puVar3;
  }
  if (param_3 != 0) {
    uVar1 = param_1[2] + param_3;
    if (0x7ffffffffffffffe < uVar1) {
      std::_Xlength_error("string too long");
      pcVar2 = (code *)swi(3);
      puVar3 = (undefined8 *)(*pcVar2)();
      return puVar3;
    }
    if ((ulonglong)param_1[3] < uVar1) {
      FUN_140001930(param_1,uVar1);
      if (uVar1 == 0) {
        return param_1;
      }
    }
    else if (uVar1 == 0) {
      param_1[2] = 0;
      if (7 < (ulonglong)param_1[3]) {
        *(undefined2 *)*param_1 = 0;
        return param_1;
      }
      *(undefined2 *)param_1 = 0;
      return param_1;
    }
    puVar3 = param_1;
    if (7 < (ulonglong)param_1[3]) {
      puVar3 = (undefined8 *)*param_1;
    }
    memcpy((void *)((longlong)puVar3 + param_1[2] * 2),param_2,param_3 * 2);
    param_1[2] = uVar1;
    puVar3 = param_1;
    if (7 < (ulonglong)param_1[3]) {
      puVar3 = (undefined8 *)*param_1;
    }
    *(undefined2 *)((longlong)puVar3 + uVar1 * 2) = 0;
  }
  return param_1;
}



undefined8 *
FUN_140002c20(undefined8 *param_1,undefined8 *param_2,ulonglong param_3,ulonglong param_4)

{
  code *pcVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  
  if ((ulonglong)param_2[2] < param_3) {
    std::_Xout_of_range("invalid string position");
    pcVar1 = (code *)swi(3);
    puVar2 = (undefined8 *)(*pcVar1)();
    return puVar2;
  }
  uVar3 = param_2[2] - param_3;
  if (uVar3 < param_4) {
    param_4 = uVar3;
  }
  if (param_4 < -param_1[2] - 1) {
    if (param_4 != 0) {
      uVar3 = param_1[2] + param_4;
      if (0x7ffffffffffffffe < uVar3) {
        std::_Xlength_error("string too long");
        pcVar1 = (code *)swi(3);
        puVar2 = (undefined8 *)(*pcVar1)();
        return puVar2;
      }
      if ((ulonglong)param_1[3] < uVar3) {
        FUN_140001930(param_1,uVar3);
        if (uVar3 == 0) {
          return param_1;
        }
      }
      else if (uVar3 == 0) {
        param_1[2] = 0;
        if (7 < (ulonglong)param_1[3]) {
          *(undefined2 *)*param_1 = 0;
          return param_1;
        }
        *(undefined2 *)param_1 = 0;
        return param_1;
      }
      if (7 < (ulonglong)param_2[3]) {
        param_2 = (undefined8 *)*param_2;
      }
      puVar2 = param_1;
      if (7 < (ulonglong)param_1[3]) {
        puVar2 = (undefined8 *)*param_1;
      }
      memcpy((void *)((longlong)puVar2 + param_1[2] * 2),(void *)((longlong)param_2 + param_3 * 2),
             param_4 * 2);
      param_1[2] = uVar3;
      puVar2 = param_1;
      if (7 < (ulonglong)param_1[3]) {
        puVar2 = (undefined8 *)*param_1;
      }
      *(undefined2 *)((longlong)puVar2 + uVar3 * 2) = 0;
    }
    return param_1;
  }
  std::_Xlength_error("string too long");
  pcVar1 = (code *)swi(3);
  puVar2 = (undefined8 *)(*pcVar1)();
  return puVar2;
}



void FUN_140002d50(longlong *param_1,int param_2)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  undefined *puVar4;
  
  puVar4 = PTR_DAT_1402f8010;
  puVar1 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar1 = PTR_DAT_1402f8010;
  }
  *param_1 = (longlong)puVar1;
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2 == 0) {
    FUN_1400031d0(param_1);
    return;
  }
  iVar3 = 0;
  if (puVar1 != (undefined *)0x0) {
    if (puVar1 == puVar4) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(puVar1 + -8);
    }
  }
  if (param_2 != iVar3) {
    piVar2 = (int *)FUN_1400a34c0();
    if (piVar2 != (int *)0x0) {
      *piVar2 = 0;
      piVar2[1] = 1;
    }
    puVar1 = PTR_DAT_1402f8010;
    *piVar2 = param_2;
    puVar4 = (undefined *)*param_1;
    if (puVar4 == (undefined *)0x0) {
      iVar3 = 0;
    }
    else if (puVar4 == puVar1) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(puVar4 + -8);
    }
    if (iVar3 <= param_2) {
      if ((puVar4 == (undefined *)0x0) || (puVar4 == puVar1)) {
        param_2 = 0;
      }
      else {
        param_2 = *(int *)(puVar4 + -8);
      }
    }
    if (puVar4 == (undefined *)0x0) {
      puVar4 = puVar1;
    }
    FUN_1400a32f0(piVar2 + 2,puVar4,param_2);
    FUN_1400031d0(param_1);
    *param_1 = (longlong)(piVar2 + 2);
  }
  return;
}



void FUN_140002e30(longlong *param_1)

{
  undefined *puVar1;
  undefined8 *puVar2;
  undefined4 *puVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined *puVar6;
  
  puVar6 = (undefined *)*param_1;
  if (puVar6 == (undefined *)0x0) {
    *param_1 = (longlong)PTR_DAT_1402f8010;
  }
  else if ((puVar6 != PTR_DAT_1402f8010) && ((int *)(puVar6 + -8) != (int *)0x0)) {
    if (*(int *)(puVar6 + -4) < 2) {
      return;
    }
    if (*(int *)(puVar6 + -8) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    puVar3 = (undefined4 *)FUN_1400a34c0();
    uVar4 = 0;
    if (puVar3 != (undefined4 *)0x0) {
      *puVar3 = 0;
      puVar3[1] = 1;
    }
    puVar1 = PTR_DAT_1402f8010;
    puVar6 = (undefined *)*param_1;
    if (puVar6 == (undefined *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = uVar4;
      if (puVar6 != PTR_DAT_1402f8010) {
        uVar5 = *(undefined4 *)(puVar6 + -8);
      }
    }
    *puVar3 = uVar5;
    puVar6 = (undefined *)*param_1;
    if ((puVar6 != (undefined *)0x0) && (puVar6 != puVar1)) {
      uVar4 = *(undefined4 *)(puVar6 + -8);
    }
    if (puVar6 == (undefined *)0x0) {
      puVar6 = puVar1;
    }
    FUN_1400a32f0(puVar3 + 2,puVar6,uVar4);
    FUN_1400031d0(param_1);
    *param_1 = (longlong)(puVar3 + 2);
    return;
  }
  puVar2 = (undefined8 *)FUN_1400a34c0();
  *puVar2 = 0;
  *(undefined2 *)(puVar2 + 1) = 0;
  if (puVar2 != (undefined8 *)0x0) {
    *(undefined4 *)puVar2 = 0;
    *(undefined4 *)((longlong)puVar2 + 4) = 1;
  }
  *(undefined2 *)(puVar2 + 1) = 0;
  *param_1 = (longlong)(puVar2 + 1);
  return;
}



undefined * FUN_140002f20(longlong *param_1,int param_2)

{
  int iVar1;
  undefined *puVar2;
  int iVar3;
  
  puVar2 = (undefined *)*param_1;
  iVar3 = 0;
  if ((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8010)) {
    iVar3 = *(int *)(puVar2 + -8);
  }
  if (((param_2 <= iVar3) && (param_2 = 0, puVar2 != (undefined *)0x0)) &&
     (puVar2 != PTR_DAT_1402f8010)) {
    param_2 = *(int *)(puVar2 + -8);
  }
  iVar3 = 1;
  if (1 < param_2) {
    iVar3 = param_2;
  }
  iVar1 = 0;
  if ((puVar2 != (undefined *)0x0) && (iVar1 = 0, puVar2 != PTR_DAT_1402f8010)) {
    iVar1 = *(int *)(puVar2 + -8);
  }
  if (iVar1 < iVar3) {
    FUN_140002d50(param_1,iVar3);
  }
  FUN_140002e30(param_1);
  puVar2 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar2 = PTR_DAT_1402f8010;
  }
  return puVar2;
}



void FUN_140002fa0(longlong *param_1,int param_2)

{
  undefined *puVar1;
  int iVar2;
  int iVar3;
  
  puVar1 = (undefined *)*param_1;
  iVar3 = 0;
  if (0 < param_2) {
    iVar3 = param_2;
  }
  iVar2 = 0;
  if ((puVar1 != (undefined *)0x0) && (iVar2 = 0, puVar1 != PTR_DAT_1402f8010)) {
    iVar2 = *(int *)(puVar1 + -8);
  }
  if ((iVar2 <= iVar3) && (iVar3 = 0, puVar1 != (undefined *)0x0)) {
    if (puVar1 == PTR_DAT_1402f8010) {
      return;
    }
    iVar3 = *(int *)(puVar1 + -8);
  }
  if (((puVar1 != PTR_DAT_1402f8010) && (puVar1 != (undefined *)0x0)) &&
     ((int *)(puVar1 + -8) != (int *)0x0)) {
    *(int *)(puVar1 + -8) = iVar3;
    *(undefined2 *)(puVar1 + (longlong)iVar3 * 2) = 0;
  }
  return;
}



void FUN_140003000(longlong *param_1)

{
  int iVar1;
  int iVar2;
  undefined *puVar3;
  
  puVar3 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar3 = PTR_DAT_1402f8010;
  }
  iVar1 = FUN_1400a32c0(puVar3);
  iVar2 = 0;
  if (0 < iVar1) {
    iVar2 = iVar1;
  }
  puVar3 = (undefined *)*param_1;
  iVar1 = 0;
  if ((puVar3 != (undefined *)0x0) && (iVar1 = 0, puVar3 != PTR_DAT_1402f8010)) {
    iVar1 = *(int *)(puVar3 + -8);
  }
  if ((iVar1 <= iVar2) && (iVar2 = 0, puVar3 != (undefined *)0x0)) {
    if (puVar3 == PTR_DAT_1402f8010) {
      return;
    }
    iVar2 = *(int *)(puVar3 + -8);
  }
  if (((puVar3 != PTR_DAT_1402f8010) && (puVar3 != (undefined *)0x0)) &&
     ((int *)(puVar3 + -8) != (int *)0x0)) {
    *(int *)(puVar3 + -8) = iVar2;
    *(undefined2 *)(puVar3 + (longlong)iVar2 * 2) = 0;
  }
  return;
}



undefined8 * FUN_140003080(undefined8 *param_1,undefined8 param_2,int param_3)

{
  int iVar1;
  int iVar2;
  undefined8 uVar3;
  
  FUN_1400a3440();
  *param_1 = PTR_DAT_1402f8010;
  iVar2 = FUN_1400a32c0(param_2);
  iVar1 = iVar2;
  if ((0 < param_3) && (iVar1 = param_3, iVar2 < param_3)) {
    iVar1 = iVar2;
  }
  uVar3 = FUN_140002f20(param_1,iVar1);
  FUN_1400a32f0(uVar3,param_2,iVar1);
  FUN_140003000(param_1);
  return param_1;
}



void FUN_140003100(longlong *param_1,longlong *param_2)

{
  undefined *puVar1;
  undefined8 uVar2;
  
  puVar1 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar1 = PTR_DAT_1402f8010;
  }
  *param_1 = (longlong)puVar1;
  if ((undefined *)*param_2 != puVar1) {
    uVar2 = FUN_1400a3440();
    FUN_1400a1c30(uVar2);
    FUN_1400031d0(param_1);
    puVar1 = (undefined *)*param_2;
    *param_1 = (longlong)puVar1;
    if (((puVar1 != PTR_DAT_1402f8010) && (puVar1 != (undefined *)0x0)) &&
       (puVar1 != (undefined *)0x8)) {
      *(int *)(puVar1 + -4) = *(int *)(puVar1 + -4) + 1;
    }
    FUN_1400d1290(uVar2);
  }
  return;
}



void FUN_1400031a0(undefined8 *param_1)

{
  if (*(char *)(param_1 + 1) != '\0') {
    FUN_1400d1290(*param_1);
    *(undefined1 *)(param_1 + 1) = 0;
  }
  return;
}



void FUN_1400031d0(longlong *param_1)

{
  int *piVar1;
  undefined *puVar2;
  undefined8 uVar3;
  
  puVar2 = (undefined *)*param_1;
  if (((puVar2 == (undefined *)0x0) || (puVar2 == PTR_DAT_1402f8010)) ||
     (puVar2 + -8 == (undefined *)0x0)) {
    *param_1 = (longlong)PTR_DAT_1402f8010;
  }
  else {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2 + -8);
    }
    FUN_1400d1290(uVar3);
    *param_1 = (longlong)PTR_DAT_1402f8010;
  }
  return;
}



void thunk_FUN_1400031d0(longlong *param_1)

{
  int *piVar1;
  undefined *puVar2;
  undefined8 uVar3;
  
  puVar2 = (undefined *)*param_1;
  if (((puVar2 == (undefined *)0x0) || (puVar2 == PTR_DAT_1402f8010)) ||
     (puVar2 + -8 == (undefined *)0x0)) {
    *param_1 = (longlong)PTR_DAT_1402f8010;
  }
  else {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2 + -8);
    }
    FUN_1400d1290(uVar3);
    *param_1 = (longlong)PTR_DAT_1402f8010;
  }
  return;
}



void FUN_140003270(undefined8 *param_1)

{
  *param_1 = Proud::INetClientEvent::vftable;
  FUN_140140b40();
  return;
}



void * FUN_140003280(void *param_1,uint param_2)

{
  FUN_140140b40();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl std::bad_alloc::`scalar deleting destructor'(unsigned
// int) __ptr64
// 
// Libraries: Visual Studio 2012 Release, Visual Studio 2015 Release

void * __thiscall std::bad_alloc::_scalar_deleting_destructor_(bad_alloc *this,uint param_1)

{
  *(undefined ***)this = Proud::INetClientEvent::vftable;
  FUN_140140b40();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void * FUN_1400032f0(void *param_1,uint param_2)

{
  FUN_1401e4750();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140003320(undefined8 *param_1)

{
  DAT_140320100 = 0;
  *param_1 = MBISingleton<>::vftable;
  return;
}



void FUN_140003340(void)

{
                    // WARNING: Could not recover jumptable at 0x000140003347. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140320120);
  return;
}



undefined8 * FUN_140003350(undefined8 *param_1,byte param_2)

{
  DAT_140320100 = 0;
  *param_1 = MBISingleton<>::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_140003390(undefined8 *param_1,uint param_2)

{
  LPCRITICAL_SECTION lpCriticalSection;
  
  lpCriticalSection = DAT_140320120;
  *param_1 = MBMultiThreadSync<>::vftable;
  if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) {
    DeleteCriticalSection(lpCriticalSection);
    operator_delete(lpCriticalSection);
  }
  DAT_140320120 = (LPCRITICAL_SECTION)0x0;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140003400(wchar_t *param_1,size_t param_2,wchar_t *param_3,undefined8 param_4)

{
  undefined8 local_res20;
  
  local_res20 = param_4;
  _vsnwprintf_s(param_1,0x20,param_2,param_3,(va_list)&local_res20);
  return;
}



void FUN_140003430(wchar_t *param_1,size_t param_2,wchar_t *param_3,undefined8 param_4)

{
  undefined8 local_res20;
  
  local_res20 = param_4;
  _vsnwprintf_s(param_1,0x104,param_2,param_3,(va_list)&local_res20);
  return;
}



void FUN_140003460(char *param_1,size_t param_2,char *param_3,undefined8 param_4)

{
  undefined8 local_res20;
  
  local_res20 = param_4;
  _vsnprintf_s(param_1,0x104,param_2,param_3,(va_list)&local_res20);
  return;
}



void FUN_140003490(longlong param_1)

{
  FUN_1400032f0(param_1 + -8);
  return;
}



void FUN_1400034a0(undefined8 *param_1)

{
  if ((undefined8 *)*param_1 != &DAT_14031fee8) {
    operator_delete__((void *)param_1[1]);
  }
  return;
}



undefined8 FUN_1400034c0(void)

{
  return 0;
}



void FUN_1400034d0(undefined8 *param_1)

{
  *param_1 = TiXmlDocument::vftable;
  if ((undefined8 *)param_1[0xc] != &DAT_14031fee8) {
    operator_delete__((void *)param_1[0xd]);
  }
  FUN_140026b00(param_1);
  return;
}



undefined8 * FUN_140003510(undefined8 *param_1,uint param_2)

{
  *param_1 = TiXmlDocument::vftable;
  if ((undefined8 *)param_1[0xc] != &DAT_14031fee8) {
    operator_delete__((void *)param_1[0xd]);
  }
  FUN_140026b00(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined1 *
FUN_140003570(undefined1 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  *(undefined8 *)(param_1 + 0x18) = 0xf;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *param_1 = 0;
  *(undefined8 *)(param_1 + 0x40) = 0xf;
  *(undefined8 *)(param_1 + 0x38) = 0;
  param_1[0x28] = 0;
  *(undefined8 *)(param_1 + 0x68) = 0xf;
  *(undefined8 *)(param_1 + 0x60) = 0;
  param_1[0x50] = 0;
  *(undefined8 *)(param_1 + 0x90) = 0xf;
  *(undefined8 *)(param_1 + 0x88) = 0;
  param_1[0x78] = 0;
  *(undefined8 *)(param_1 + 0xb8) = 0xf;
  *(undefined8 *)(param_1 + 0xb0) = 0;
  param_1[0xa0] = 0;
  *(undefined8 *)(param_1 + 0xe0) = 0xf;
  *(undefined8 *)(param_1 + 0xd8) = 0;
  param_1[200] = 0;
  *(undefined8 *)(param_1 + 0x108) = 0xf;
  *(undefined8 *)(param_1 + 0x100) = 0;
  param_1[0xf0] = 0;
  *(undefined8 *)(param_1 + 0x130) = 0xf;
  *(undefined8 *)(param_1 + 0x128) = 0;
  param_1[0x118] = 0;
  *(undefined8 *)(param_1 + 0x158) = 0xf;
  *(undefined8 *)(param_1 + 0x150) = 0;
  param_1[0x140] = 0;
  *(undefined4 *)(param_1 + 0x168) = 0;
  *(undefined8 *)(param_1 + 0x188) = 0xf;
  *(undefined8 *)(param_1 + 0x180) = 0;
  param_1[0x170] = 0;
  *(undefined8 *)(param_1 + 0x1b0) = 0xf;
  *(undefined8 *)(param_1 + 0x1a8) = 0;
  param_1[0x198] = 0;
  *(undefined8 *)(param_1 + 0x1d8) = 0xf;
  *(undefined8 *)(param_1 + 0x1d0) = 0;
  param_1[0x1c0] = 0;
  *(undefined8 *)(param_1 + 0x1e8) = 0;
  *(undefined4 *)(param_1 + 0x1f0) = 0;
  *(undefined8 *)(param_1 + 500) = 100;
  *(undefined8 *)(param_1 + 0x218) = 0xf;
  *(undefined8 *)(param_1 + 0x210) = 0;
  param_1[0x200] = 0;
  FUN_140003e60(param_1 + 0x200,&DAT_1402728c8,3,param_4,0xfffffffffffffffe);
  *(undefined4 *)(param_1 + 0x228) = 1000;
  return param_1;
}



void FUN_1400036e0(undefined8 *param_1)

{
  if (0xf < (ulonglong)param_1[0x43]) {
    operator_delete((void *)param_1[0x40]);
  }
  param_1[0x43] = 0xf;
  param_1[0x42] = 0;
  *(undefined1 *)(param_1 + 0x40) = 0;
  if (0xf < (ulonglong)param_1[0x3b]) {
    operator_delete((void *)param_1[0x38]);
  }
  param_1[0x3b] = 0xf;
  param_1[0x3a] = 0;
  *(undefined1 *)(param_1 + 0x38) = 0;
  if (0xf < (ulonglong)param_1[0x36]) {
    operator_delete((void *)param_1[0x33]);
  }
  param_1[0x36] = 0xf;
  param_1[0x35] = 0;
  *(undefined1 *)(param_1 + 0x33) = 0;
  if (0xf < (ulonglong)param_1[0x31]) {
    operator_delete((void *)param_1[0x2e]);
  }
  param_1[0x31] = 0xf;
  param_1[0x30] = 0;
  *(undefined1 *)(param_1 + 0x2e) = 0;
  if (0xf < (ulonglong)param_1[0x2b]) {
    operator_delete((void *)param_1[0x28]);
  }
  param_1[0x2b] = 0xf;
  param_1[0x2a] = 0;
  *(undefined1 *)(param_1 + 0x28) = 0;
  if (0xf < (ulonglong)param_1[0x26]) {
    operator_delete((void *)param_1[0x23]);
  }
  param_1[0x26] = 0xf;
  param_1[0x25] = 0;
  *(undefined1 *)(param_1 + 0x23) = 0;
  if (0xf < (ulonglong)param_1[0x21]) {
    operator_delete((void *)param_1[0x1e]);
  }
  param_1[0x21] = 0xf;
  param_1[0x20] = 0;
  *(undefined1 *)(param_1 + 0x1e) = 0;
  if (0xf < (ulonglong)param_1[0x1c]) {
    operator_delete((void *)param_1[0x19]);
  }
  param_1[0x1c] = 0xf;
  param_1[0x1b] = 0;
  *(undefined1 *)(param_1 + 0x19) = 0;
  if (0xf < (ulonglong)param_1[0x17]) {
    operator_delete((void *)param_1[0x14]);
  }
  param_1[0x17] = 0xf;
  param_1[0x16] = 0;
  *(undefined1 *)(param_1 + 0x14) = 0;
  if (0xf < (ulonglong)param_1[0x12]) {
    operator_delete((void *)param_1[0xf]);
  }
  param_1[0x12] = 0xf;
  param_1[0x11] = 0;
  *(undefined1 *)(param_1 + 0xf) = 0;
  if (0xf < (ulonglong)param_1[0xd]) {
    operator_delete((void *)param_1[10]);
  }
  param_1[0xd] = 0xf;
  param_1[0xc] = 0;
  *(undefined1 *)(param_1 + 10) = 0;
  if (0xf < (ulonglong)param_1[8]) {
    operator_delete((void *)param_1[5]);
  }
  param_1[8] = 0xf;
  param_1[7] = 0;
  *(undefined1 *)(param_1 + 5) = 0;
  if (0xf < (ulonglong)param_1[3]) {
    operator_delete((void *)*param_1);
  }
  param_1[3] = 0xf;
  param_1[2] = 0;
  *(undefined1 *)param_1 = 0;
  return;
}



longlong FUN_140003940(longlong param_1,longlong param_2)

{
  FUN_140003d50(param_1,param_2,0,0xffffffffffffffff);
  FUN_140003d50(param_1 + 0x28,param_2 + 0x28,0,0xffffffffffffffff);
  FUN_140003d50(param_1 + 0x50,param_2 + 0x50,0,0xffffffffffffffff);
  FUN_140003d50(param_1 + 0x78,param_2 + 0x78,0,0xffffffffffffffff);
  FUN_140003d50(param_1 + 0xa0,param_2 + 0xa0,0,0xffffffffffffffff);
  FUN_140003d50(param_1 + 200,param_2 + 200,0,0xffffffffffffffff);
  FUN_140003d50(param_1 + 0xf0,param_2 + 0xf0,0,0xffffffffffffffff);
  FUN_140003d50(param_1 + 0x118,param_2 + 0x118,0,0xffffffffffffffff);
  FUN_140003d50(param_1 + 0x140,param_2 + 0x140,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x168) = *(undefined4 *)(param_2 + 0x168);
  FUN_140003d50(param_1 + 0x170,param_2 + 0x170,0,0xffffffffffffffff);
  FUN_140003d50(param_1 + 0x198,param_2 + 0x198,0,0xffffffffffffffff);
  FUN_140003d50(param_1 + 0x1c0,param_2 + 0x1c0,0,0xffffffffffffffff);
  *(undefined1 *)(param_1 + 0x1e8) = *(undefined1 *)(param_2 + 0x1e8);
  *(undefined1 *)(param_1 + 0x1e9) = *(undefined1 *)(param_2 + 0x1e9);
  *(undefined1 *)(param_1 + 0x1ea) = *(undefined1 *)(param_2 + 0x1ea);
  *(undefined1 *)(param_1 + 0x1eb) = *(undefined1 *)(param_2 + 0x1eb);
  *(undefined1 *)(param_1 + 0x1ec) = *(undefined1 *)(param_2 + 0x1ec);
  *(undefined1 *)(param_1 + 0x1ed) = *(undefined1 *)(param_2 + 0x1ed);
  *(undefined1 *)(param_1 + 0x1ee) = *(undefined1 *)(param_2 + 0x1ee);
  *(undefined1 *)(param_1 + 0x1ef) = *(undefined1 *)(param_2 + 0x1ef);
  *(undefined1 *)(param_1 + 0x1f0) = *(undefined1 *)(param_2 + 0x1f0);
  *(undefined1 *)(param_1 + 0x1f1) = *(undefined1 *)(param_2 + 0x1f1);
  *(undefined1 *)(param_1 + 0x1f2) = *(undefined1 *)(param_2 + 0x1f2);
  *(undefined1 *)(param_1 + 499) = *(undefined1 *)(param_2 + 499);
  *(undefined4 *)(param_1 + 500) = *(undefined4 *)(param_2 + 500);
  *(undefined4 *)(param_1 + 0x1f8) = *(undefined4 *)(param_2 + 0x1f8);
  FUN_140003d50(param_1 + 0x200,param_2 + 0x200,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x228) = *(undefined4 *)(param_2 + 0x228);
  return param_1;
}



void FUN_140003b70(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar2 = *param_1;
  if (lVar2 != 0) {
    lVar1 = param_1[1];
    for (; lVar2 != lVar1; lVar2 = lVar2 + 0x230) {
      FUN_1400036e0(lVar2);
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_140003bd0(ulonglong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  uVar1 = param_1[1];
  if ((param_2 < uVar1) && (uVar2 = *param_1, uVar2 <= param_2)) {
    if (uVar1 == param_1[2]) {
      FUN_140003c90(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140004410(param_1[1],((longlong)(param_2 - uVar2) / 0x230) * 0x230 + *param_1,param_3,
                    param_4,uVar3);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_140003c90(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140004410(param_1[1],param_2,param_3,param_4,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0x230;
  return;
}



void FUN_140003c90(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x230;
  if (0x75075075075074 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = (param_1[2] - *param_1) / 0x230;
  if (uVar2 < uVar3) {
    if (0x75075075075075 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_140003f90(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140003f90(param_1,uVar2);
  }
  return;
}



undefined8 *
FUN_140003d50(undefined8 *param_1,undefined8 *param_2,ulonglong param_3,ulonglong param_4)

{
  code *pcVar1;
  undefined8 *puVar2;
  ulonglong _Size;
  
  if ((ulonglong)param_2[2] < param_3) {
    std::_Xout_of_range("invalid string position");
    pcVar1 = (code *)swi(3);
    puVar2 = (undefined8 *)(*pcVar1)();
    return puVar2;
  }
  _Size = param_2[2] - param_3;
  if (param_4 < _Size) {
    _Size = param_4;
  }
  if (param_1 == param_2) {
    FUN_140004100(param_1,_Size + param_3,0xffffffffffffffff);
    FUN_140004100(param_1,0,param_3);
  }
  else {
    if (_Size == 0xffffffffffffffff) {
      std::_Xlength_error("string too long");
      pcVar1 = (code *)swi(3);
      puVar2 = (undefined8 *)(*pcVar1)();
      return puVar2;
    }
    if ((ulonglong)param_1[3] < _Size) {
      FUN_140004270(param_1,_Size,param_1[2]);
      if (_Size == 0) {
        return param_1;
      }
    }
    else if (_Size == 0) {
      param_1[2] = 0;
      if (0xf < (ulonglong)param_1[3]) {
        *(undefined1 *)*param_1 = 0;
        return param_1;
      }
      *(undefined1 *)param_1 = 0;
      return param_1;
    }
    if (0xf < (ulonglong)param_2[3]) {
      param_2 = (undefined8 *)*param_2;
    }
    puVar2 = param_1;
    if (0xf < (ulonglong)param_1[3]) {
      puVar2 = (undefined8 *)*param_1;
    }
    memcpy(puVar2,(undefined1 *)((longlong)param_2 + param_3),_Size);
    param_1[2] = _Size;
    puVar2 = param_1;
    if (0xf < (ulonglong)param_1[3]) {
      puVar2 = (undefined8 *)*param_1;
    }
    *(undefined1 *)((longlong)puVar2 + _Size) = 0;
  }
  return param_1;
}



undefined8 * FUN_140003e60(undefined8 *param_1,undefined8 *param_2,ulonglong param_3)

{
  ulonglong uVar1;
  code *pcVar2;
  undefined8 *puVar3;
  
  if (param_2 != (undefined8 *)0x0) {
    uVar1 = param_1[3];
    puVar3 = param_1;
    if (0xf < uVar1) {
      puVar3 = (undefined8 *)*param_1;
    }
    if (puVar3 <= param_2) {
      puVar3 = param_1;
      if (0xf < uVar1) {
        puVar3 = (undefined8 *)*param_1;
      }
      if (param_2 < (undefined8 *)((longlong)puVar3 + param_1[2])) {
        puVar3 = param_1;
        if (0xf < uVar1) {
          puVar3 = (undefined8 *)*param_1;
        }
        puVar3 = (undefined8 *)
                 FUN_140003d50(param_1,param_1,(longlong)param_2 - (longlong)puVar3,param_3);
        return puVar3;
      }
    }
  }
  if (param_3 == 0xffffffffffffffff) {
    std::_Xlength_error("string too long");
    pcVar2 = (code *)swi(3);
    puVar3 = (undefined8 *)(*pcVar2)();
    return puVar3;
  }
  if ((ulonglong)param_1[3] < param_3) {
    FUN_140004270(param_1,param_3,param_1[2]);
    if (param_3 == 0) {
      return param_1;
    }
  }
  else if (param_3 == 0) {
    param_1[2] = 0;
    if (0xf < (ulonglong)param_1[3]) {
      *(undefined1 *)*param_1 = 0;
      return param_1;
    }
    *(undefined1 *)param_1 = 0;
    return param_1;
  }
  puVar3 = param_1;
  if (0xf < (ulonglong)param_1[3]) {
    puVar3 = (undefined8 *)*param_1;
  }
  memcpy(puVar3,param_2,param_3);
  param_1[2] = param_3;
  puVar3 = param_1;
  if (0xf < (ulonglong)param_1[3]) {
    puVar3 = (undefined8 *)*param_1;
  }
  *(undefined1 *)((longlong)puVar3 + param_3) = 0;
  return param_1;
}



void FUN_140003f90(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  code *pcVar2;
  char *pcVar3;
  longlong lVar4;
  longlong lVar5;
  char *local_res10;
  undefined8 uVar6;
  undefined **local_30 [3];
  
  uVar6 = 0xfffffffffffffffe;
  if (0x75075075075075 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar2 = (code *)swi(3);
    (*pcVar2)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x230) < param_2) {
    local_res10 = (char *)0x0;
    if ((param_2 != 0) && (local_res10 = operator_new(param_2 * 0x230), local_res10 == (char *)0x0))
    {
      std::exception::exception((exception *)local_30,&local_res10);
      local_30[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_30,(ThrowInfo *)&DAT_1402f47a8);
    }
    pcVar3 = local_res10;
    FUN_140004720(*param_1,param_1[1],local_res10,param_4,uVar6);
    lVar1 = param_1[1];
    lVar5 = *param_1;
    lVar4 = lVar1 - lVar5;
    if (lVar5 != 0) {
      for (; lVar5 != lVar1; lVar5 = lVar5 + 0x230) {
        FUN_1400036e0(lVar5);
      }
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar3 + param_2 * 0x230);
    param_1[1] = (longlong)(pcVar3 + (lVar4 / 0x230) * 0x230);
    *param_1 = (longlong)pcVar3;
  }
  return;
}



longlong * FUN_140004100(longlong *param_1,ulonglong param_2,ulonglong param_3)

{
  code *pcVar1;
  longlong *plVar2;
  longlong *plVar3;
  ulonglong uVar4;
  longlong lVar5;
  
  if ((ulonglong)param_1[2] < param_2) {
    std::_Xout_of_range("invalid string position");
    pcVar1 = (code *)swi(3);
    plVar2 = (longlong *)(*pcVar1)();
    return plVar2;
  }
  uVar4 = param_1[2] - param_2;
  if (uVar4 < param_3) {
    param_3 = uVar4;
  }
  if (param_3 != 0) {
    plVar2 = param_1;
    plVar3 = param_1;
    if (0xf < (ulonglong)param_1[3]) {
      plVar2 = (longlong *)*param_1;
      plVar3 = (longlong *)*param_1;
    }
    memmove((void *)((longlong)plVar2 + param_2),(void *)((longlong)plVar3 + param_3 + param_2),
            uVar4 - param_3);
    lVar5 = param_1[2] - param_3;
    param_1[2] = lVar5;
    if (0xf < (ulonglong)param_1[3]) {
      *(undefined1 *)(*param_1 + lVar5) = 0;
      return param_1;
    }
    *(undefined1 *)((longlong)param_1 + lVar5) = 0;
  }
  return param_1;
}



undefined1 FUN_1400041a0(undefined8 *param_1,ulonglong param_2,char param_3)

{
  ulonglong uVar1;
  void *_Src;
  code *pcVar2;
  undefined1 uVar3;
  ulonglong _Size;
  
  if (param_2 == 0xffffffffffffffff) {
    std::_Xlength_error("string too long");
    pcVar2 = (code *)swi(3);
    uVar3 = (*pcVar2)();
    return uVar3;
  }
  uVar1 = param_1[3];
  if (uVar1 < param_2) {
    FUN_140004270(param_1,param_2,param_1[2]);
  }
  else if ((param_3 == '\0') || (0xf < param_2)) {
    if (param_2 == 0) {
      param_1[2] = 0;
      if (0xf < uVar1) {
        param_1 = (undefined8 *)*param_1;
      }
      *(undefined1 *)param_1 = 0;
    }
  }
  else {
    _Size = param_1[2];
    if (param_2 < (ulonglong)param_1[2]) {
      _Size = param_2;
    }
    if (0xf < uVar1) {
      _Src = (void *)*param_1;
      if (_Size != 0) {
        memcpy(param_1,_Src,_Size);
      }
      operator_delete(_Src);
    }
    param_1[2] = _Size;
    param_1[3] = 0xf;
    *(undefined1 *)((longlong)param_1 + _Size) = 0;
  }
  return param_2 != 0;
}



void FUN_140004270(undefined8 *param_1,ulonglong param_2,size_t param_3)

{
  ulonglong uVar1;
  undefined8 *_Dst;
  ulonglong uVar2;
  undefined8 *_Src;
  ulonglong uVar3;
  char *local_res20;
  undefined **local_40 [4];
  
  uVar3 = param_2 | 0xf;
  if (uVar3 != 0xffffffffffffffff) {
    uVar1 = param_1[3];
    uVar2 = uVar1 >> 1;
    param_2 = uVar3;
    if ((uVar3 / 3 < uVar2) && (param_2 = 0xfffffffffffffffe, uVar1 <= -uVar2 - 2)) {
      param_2 = uVar2 + uVar1;
    }
  }
  _Dst = (undefined8 *)0x0;
  if ((param_2 + 1 != 0) && (_Dst = operator_new(param_2 + 1), _Dst == (undefined8 *)0x0)) {
    local_res20 = (char *)0x0;
    std::exception::exception((exception *)local_40,&local_res20);
    local_40[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_40,(ThrowInfo *)&DAT_1402f47a8);
  }
  if (param_3 != 0) {
    _Src = param_1;
    if (0xf < (ulonglong)param_1[3]) {
      _Src = (undefined8 *)*param_1;
    }
    memcpy(_Dst,_Src,param_3);
  }
  if (0xf < (ulonglong)param_1[3]) {
    operator_delete((void *)*param_1);
  }
  *(undefined1 *)param_1 = 0;
  *param_1 = _Dst;
  param_1[3] = param_2;
  param_1[2] = param_3;
  if (0xf < param_2) {
    param_1 = _Dst;
  }
  *(undefined1 *)((longlong)param_1 + param_3) = 0;
  return;
}



void * FUN_1400043b0(__uint64 param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  pvVar1 = (void *)0x0;
  if ((param_1 != 0) && (pvVar1 = operator_new(param_1), pvVar1 == (void *)0x0)) {
    local_res8[0] = (char *)0x0;
    std::exception::exception((exception *)local_28,local_res8);
    local_28[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_28,(ThrowInfo *)&DAT_1402f47a8);
  }
  return pvVar1;
}



undefined1 * FUN_140004410(undefined1 *param_1,longlong param_2)

{
  *(undefined8 *)(param_1 + 0x18) = 0xf;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *param_1 = 0;
  FUN_140003d50(param_1,param_2,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined8 *)(param_1 + 0x40) = 0xf;
  *(undefined8 *)(param_1 + 0x38) = 0;
  param_1[0x28] = 0;
  FUN_140003d50(param_1 + 0x28,param_2 + 0x28,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x68) = 0xf;
  *(undefined8 *)(param_1 + 0x60) = 0;
  param_1[0x50] = 0;
  FUN_140003d50(param_1 + 0x50,param_2 + 0x50,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x90) = 0xf;
  *(undefined8 *)(param_1 + 0x88) = 0;
  param_1[0x78] = 0;
  FUN_140003d50(param_1 + 0x78,param_2 + 0x78,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0xb8) = 0xf;
  *(undefined8 *)(param_1 + 0xb0) = 0;
  param_1[0xa0] = 0;
  FUN_140003d50(param_1 + 0xa0,param_2 + 0xa0,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0xe0) = 0xf;
  *(undefined8 *)(param_1 + 0xd8) = 0;
  param_1[200] = 0;
  FUN_140003d50(param_1 + 200,param_2 + 200,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x108) = 0xf;
  *(undefined8 *)(param_1 + 0x100) = 0;
  param_1[0xf0] = 0;
  FUN_140003d50(param_1 + 0xf0,param_2 + 0xf0,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x130) = 0xf;
  *(undefined8 *)(param_1 + 0x128) = 0;
  param_1[0x118] = 0;
  FUN_140003d50(param_1 + 0x118,param_2 + 0x118,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x158) = 0xf;
  *(undefined8 *)(param_1 + 0x150) = 0;
  param_1[0x140] = 0;
  FUN_140003d50(param_1 + 0x140,param_2 + 0x140,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x168) = *(undefined4 *)(param_2 + 0x168);
  *(undefined8 *)(param_1 + 0x188) = 0xf;
  *(undefined8 *)(param_1 + 0x180) = 0;
  param_1[0x170] = 0;
  FUN_140003d50(param_1 + 0x170,param_2 + 0x170,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1b0) = 0xf;
  *(undefined8 *)(param_1 + 0x1a8) = 0;
  param_1[0x198] = 0;
  FUN_140003d50(param_1 + 0x198,param_2 + 0x198,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1d8) = 0xf;
  *(undefined8 *)(param_1 + 0x1d0) = 0;
  param_1[0x1c0] = 0;
  FUN_140003d50(param_1 + 0x1c0,param_2 + 0x1c0,0,0xffffffffffffffff);
  param_1[0x1e8] = *(undefined1 *)(param_2 + 0x1e8);
  param_1[0x1e9] = *(undefined1 *)(param_2 + 0x1e9);
  param_1[0x1ea] = *(undefined1 *)(param_2 + 0x1ea);
  param_1[0x1eb] = *(undefined1 *)(param_2 + 0x1eb);
  param_1[0x1ec] = *(undefined1 *)(param_2 + 0x1ec);
  param_1[0x1ed] = *(undefined1 *)(param_2 + 0x1ed);
  param_1[0x1ee] = *(undefined1 *)(param_2 + 0x1ee);
  param_1[0x1ef] = *(undefined1 *)(param_2 + 0x1ef);
  param_1[0x1f0] = *(undefined1 *)(param_2 + 0x1f0);
  param_1[0x1f1] = *(undefined1 *)(param_2 + 0x1f1);
  param_1[0x1f2] = *(undefined1 *)(param_2 + 0x1f2);
  param_1[499] = *(undefined1 *)(param_2 + 499);
  *(undefined4 *)(param_1 + 500) = *(undefined4 *)(param_2 + 500);
  *(undefined4 *)(param_1 + 0x1f8) = *(undefined4 *)(param_2 + 0x1f8);
  *(undefined8 *)(param_1 + 0x218) = 0xf;
  *(undefined8 *)(param_1 + 0x210) = 0;
  param_1[0x200] = 0;
  FUN_140003d50(param_1 + 0x200,param_2 + 0x200,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x228) = *(undefined4 *)(param_2 + 0x228);
  return param_1;
}



longlong FUN_140004720(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x230) {
    if (param_3 != 0) {
      FUN_140004410(param_3,param_1);
    }
    param_3 = param_3 + 0x230;
  }
  return param_3;
}



undefined8 *
FUN_140004780(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  void *pvVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  uVar3 = 0;
  *(undefined4 *)(param_1 + 2) = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[7] = 0;
  param_1[8] = 0;
  *param_1 = MagiGatewayServer::vftable;
  param_1[1] = MagiGatewayServer::vftable;
  *(undefined4 *)(param_1 + 9) = 1;
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 10,uVar1,1,param_4,uVar4);
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  param_1[0x15] = 0;
  param_1[0x16] = 0;
  param_1[0x17] = 0;
  FUN_14000b090(param_1 + 0x19);
  param_1[0x21] = 0;
  param_1[0x22] = 0;
  param_1[0x23] = 0;
  param_1[0x24] = 0;
  param_1[0x25] = 0;
  param_1[0x26] = 0;
  param_1[0x27] = 0;
  param_1[0x28] = 0;
  *(undefined4 *)(param_1 + 0x29) = 0;
  *(undefined1 *)((longlong)param_1 + 0x14c) = 0;
  pvVar2 = operator_new(0xb8);
  uVar4 = uVar3;
  if (pvVar2 != (void *)0x0) {
    uVar4 = FUN_14000c6e0(pvVar2);
  }
  param_1[0x2a] = uVar4;
  param_1[0x2b] = 0;
  param_1[0x2c] = 0;
  param_1[0x2d] = 0;
  param_1[0x2e] = 0;
  param_1[0x30] = 0;
  param_1[0x1d] = 0;
  param_1[0x1e] = 0;
  param_1[0x1f] = 0;
  param_1[0x20] = 0;
  pvVar2 = operator_new(0xe8);
  if (pvVar2 != (void *)0x0) {
    uVar3 = FUN_140097150(pvVar2);
  }
  DAT_140320130 = uVar3;
  return param_1;
}



void * FUN_140004900(void *param_1,uint param_2)

{
  FUN_140004970();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140004930(longlong param_1)

{
  undefined1 local_res10 [24];
  
  FUN_14000b320(param_1,local_res10,**(undefined8 **)(param_1 + 8),*(undefined8 **)(param_1 + 8),
                0xfffffffffffffffe);
                    // WARNING: Could not recover jumptable at 0x000140004964. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_1 + 8));
  return;
}



void FUN_140004970(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 local_res18 [16];
  
  *param_1 = MagiGatewayServer::vftable;
  param_1[1] = MagiGatewayServer::vftable;
  if (DAT_140320130 != (undefined8 *)0x0) {
    (**(code **)*DAT_140320130)(DAT_140320130,1,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1[0x2c] != 0) {
    FUN_14000bf70(param_1[0x2c],param_1[0x2d]);
    operator_delete((void *)param_1[0x2c]);
  }
  param_1[0x2c] = 0;
  param_1[0x2d] = 0;
  param_1[0x2e] = 0;
  FUN_14000b320(param_1 + 0x19,local_res18,*(undefined8 *)param_1[0x1a],(undefined8 *)param_1[0x1a])
  ;
  operator_delete((void *)param_1[0x1a]);
  if ((void *)param_1[0x15] != (void *)0x0) {
    operator_delete((void *)param_1[0x15]);
  }
  param_1[0x15] = 0;
  param_1[0x16] = 0;
  param_1[0x17] = 0;
  if ((void *)param_1[0x11] != (void *)0x0) {
    operator_delete((void *)param_1[0x11]);
  }
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  FUN_1400a1cd0(param_1 + 10);
  param_1[1] = MagiServerBase::vftable;
  if ((void *)param_1[3] != (void *)0x0) {
    operator_delete((void *)param_1[3]);
  }
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[5] = 0;
  return;
}



void FUN_140004ab0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  DWORD DVar2;
  undefined8 uVar3;
  void *local_res8;
  
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
  }
  if ((DAT_140320610 != 200) && (DAT_140320610 != 100)) {
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if (DAT_140320610 != 1000) goto LAB_140004b69;
  }
  setlocale(0,"kor");
LAB_140004b69:
  setlocale(0,(char *)0x0);
  printf("Locale is: %s\n");
  FUN_1400a6500(0);
  local_res8 = operator_new(0x98);
  uVar3 = 0;
  if (local_res8 != (void *)0x0) {
    uVar3 = FUN_1401e2530(local_res8);
  }
  DAT_140320128 = uVar3;
  local_res8 = operator_new(8);
  uVar3 = 0;
  if (local_res8 != (void *)0x0) {
    uVar3 = FUN_14008cb40(local_res8);
  }
  lVar1 = DAT_140320138;
  DAT_140320140 = uVar3;
  *(undefined1 *)(DAT_140320138 + 0x1e8) = 8;
  FUN_140083ee0(lVar1,param_2);
  DVar2 = timeGetTime();
  *(DWORD *)(param_1 + 0x140) = DVar2;
  *(undefined8 *)(param_1 + 0x144) = 0;
  local_res8 = (void *)CONCAT44(local_res8._4_4_,2);
  *(undefined4 *)(param_1 + 0x10) = 2;
  printf("STEP : TABLE_LOAD \n");
  lVar1 = *(longlong *)(param_1 + 0x38);
  if ((lVar1 != 0) && (*(char *)(lVar1 + 0x1a) != '\0')) {
    (**(code **)(*(longlong *)(lVar1 + 0x68) + 0xb0))
              ((longlong *)(lVar1 + 0x68),1,&DAT_14030ab90,&local_res8);
  }
  FUN_1400973c0(DAT_140320130);
  FUN_14008feb0();
  FUN_14008fa20();
  *(undefined1 *)(DAT_140320130 + 0xb8) = 1;
  return;
}



ulonglong FUN_140004c80(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  FUN_1400a1c30(param_1 + 0x50);
  lVar1 = *(longlong *)(param_1 + 0x90);
  lVar2 = *(longlong *)(param_1 + 0x88);
  FUN_1400d1290(param_1 + 0x50);
  return lVar1 - lVar2 >> 3 & 0xffffffff;
}



void FUN_140004cd0(longlong param_1,int param_2,int param_3,wchar_t *param_4,wchar_t *param_5,
                  int param_6,int param_7,int param_8,undefined1 param_9,int param_10,int param_11,
                  int param_12)

{
  int iVar1;
  int **ppiVar2;
  int **ppiVar3;
  undefined1 auVar4 [16];
  undefined1 auVar5 [16];
  undefined1 auVar6 [16];
  DWORD DVar7;
  int *_Dst;
  __uint64 _Var8;
  void *pvVar9;
  longlong *plVar10;
  longlong lVar11;
  wchar_t *_Dst_00;
  longlong lVar12;
  ulonglong uVar13;
  rsize_t _SizeInWords;
  ulonglong uVar14;
  ulonglong uVar15;
  int *local_res8;
  
  FUN_1400a1c30(param_1 + 0x50);
  DVar7 = GetTickCount();
  uVar13 = 0;
  uVar15 = (ulonglong)param_8;
  uVar14 = *(longlong *)(param_1 + 0x90) - *(longlong *)(param_1 + 0x88) >> 3;
  if (uVar14 != 0) {
    plVar10 = *(longlong **)(param_1 + 0x88);
    do {
      lVar12 = *plVar10;
      if (*(int *)(lVar12 + 100) == param_3) {
        iVar1 = *(int *)(lVar12 + 0x78);
        *(int *)(lVar12 + 0x70) = param_2;
        *(int *)(lVar12 + 0x74) = param_7;
        *(int *)(lVar12 + 0x78) = param_8;
        *(int *)(lVar12 + 0x80) = param_10;
        *(int *)(lVar12 + 0x84) = param_12;
        *(DWORD *)(lVar12 + 0x88) = DVar7 + 45000;
        *(undefined1 *)(lVar12 + 0x8c) = 0;
        if ((DAT_140320f64 & 1) == 0) {
          DAT_140320f64 = DAT_140320f64 | 1;
          FUN_1400908e0();
          atexit((_func_5014 *)&LAB_140202650);
        }
        if (DAT_1403206fc <= *(int *)(lVar12 + 0x74)) {
          if ((DAT_140320f64 & 1) == 0) {
            DAT_140320f64 = DAT_140320f64 | 1;
            FUN_1400908e0();
            atexit((_func_5014 *)&LAB_140202650);
          }
          printf("ServerLockDown ServerUser[%d] ControlLockCount[%d]\n");
          *(undefined1 *)(lVar12 + 0x8c) = 1;
        }
        if (*(void **)(lVar12 + 0x218) == (void *)0x0) {
          if (0 < param_8) {
            auVar4._8_8_ = 0;
            auVar4._0_8_ = uVar15;
            _Var8 = SUB168(ZEXT816(0x20) * auVar4,0);
            if (SUB168(ZEXT816(0x20) * auVar4,8) != 0) {
              _Var8 = 0xffffffffffffffff;
            }
            pvVar9 = operator_new(_Var8);
            *(void **)(lVar12 + 0x218) = pvVar9;
            if (0 < param_8) {
              lVar11 = 0;
              do {
                *(undefined4 *)(lVar11 + 4 + *(longlong *)(lVar12 + 0x218)) = 0;
                *(undefined4 *)(lVar11 + 0xc + *(longlong *)(lVar12 + 0x218)) = 0;
                *(undefined4 *)(lVar11 + 8 + *(longlong *)(lVar12 + 0x218)) = 0;
                *(undefined4 *)(lVar11 + *(longlong *)(lVar12 + 0x218)) = 1;
                *(undefined1 *)(lVar11 + 0x10 + *(longlong *)(lVar12 + 0x218)) = 0;
                *(longlong *)(lVar11 + 0x18 + *(longlong *)(lVar12 + 0x218)) = lVar12;
                lVar11 = lVar11 + 0x20;
                uVar15 = uVar15 - 1;
              } while (uVar15 != 0);
            }
          }
        }
        else if (param_8 != iVar1) {
          operator_delete__(*(void **)(lVar12 + 0x218));
          lVar11 = 0;
          *(undefined8 *)(lVar12 + 0x218) = 0;
          auVar5._8_8_ = 0;
          auVar5._0_8_ = uVar15;
          _Var8 = SUB168(ZEXT816(0x20) * auVar5,0);
          if (SUB168(ZEXT816(0x20) * auVar5,8) != 0) {
            _Var8 = 0xffffffffffffffff;
          }
          pvVar9 = operator_new(_Var8);
          *(void **)(lVar12 + 0x218) = pvVar9;
          if (0 < param_8) {
            do {
              *(undefined4 *)(lVar11 + 4 + *(longlong *)(lVar12 + 0x218)) = 0;
              *(undefined4 *)(lVar11 + 0xc + *(longlong *)(lVar12 + 0x218)) = 0;
              *(undefined4 *)(lVar11 + 8 + *(longlong *)(lVar12 + 0x218)) = 0;
              *(undefined4 *)(lVar11 + *(longlong *)(lVar12 + 0x218)) = 1;
              *(undefined1 *)(lVar11 + 0x10 + *(longlong *)(lVar12 + 0x218)) = 0;
              *(longlong *)(lVar11 + 0x18 + *(longlong *)(lVar12 + 0x218)) = lVar12;
              lVar11 = lVar11 + 0x20;
              uVar15 = uVar15 - 1;
            } while (uVar15 != 0);
          }
        }
        goto LAB_1400051db;
      }
      uVar13 = (ulonglong)((int)uVar13 + 1);
      plVar10 = plVar10 + 1;
    } while (uVar13 < uVar14);
  }
  _Dst = operator_new(0x220);
  local_res8 = _Dst;
  memset(_Dst,0,0x220);
  *_Dst = DAT_1403127f8;
  DAT_1403127f8 = DAT_1403127f8 + 1;
  _Dst[0x19] = param_3;
  if (*(char *)(DAT_140320138 + 0x151) == '\0') {
    _Dst_00 = (wchar_t *)(_Dst + 1);
    _SizeInWords = 0x10;
  }
  else {
    _Dst_00 = (wchar_t *)((longlong)_Dst + 0x8e);
    _SizeInWords = 0xc4;
  }
  wcscpy_s(_Dst_00,_SizeInWords,param_5);
  wcsncpy_s((wchar_t *)(_Dst + 9),0x20,param_4,0x1f);
  _Dst[0x1a] = param_11;
  _Dst[0x1c] = param_2;
  _Dst[0x1b] = param_6;
  _Dst[0x1d] = param_7;
  _Dst[0x1e] = param_8;
  *(undefined1 *)(_Dst + 0x1f) = param_9;
  _Dst[0x20] = param_10;
  _Dst[0x21] = param_12;
  _Dst[0x22] = DVar7 + 45000;
  lVar12 = 0;
  _Dst[0x86] = 0;
  _Dst[0x87] = 0;
  *(undefined1 *)(_Dst + 0x23) = 0;
  if ((DAT_140320f64 & 1) == 0) {
    DAT_140320f64 = DAT_140320f64 | 1;
    FUN_1400908e0();
    atexit((_func_5014 *)&LAB_140202650);
  }
  if (DAT_1403206fc <= _Dst[0x1d]) {
    if ((DAT_140320f64 & 1) == 0) {
      DAT_140320f64 = DAT_140320f64 | 1;
      FUN_1400908e0();
      atexit((_func_5014 *)&LAB_140202650);
    }
    printf("ServerLockDown ServerUser[%d] ControlLockCount[%d]\n");
    *(undefined1 *)(_Dst + 0x23) = 1;
  }
  if (0 < param_8) {
    auVar6._8_8_ = 0;
    auVar6._0_8_ = uVar15;
    _Var8 = SUB168(ZEXT816(0x20) * auVar6,0);
    if (SUB168(ZEXT816(0x20) * auVar6,8) != 0) {
      _Var8 = 0xffffffffffffffff;
    }
    pvVar9 = operator_new(_Var8);
    *(void **)(_Dst + 0x86) = pvVar9;
    if (0 < param_8) {
      do {
        *(undefined4 *)(*(longlong *)(_Dst + 0x86) + 4 + lVar12) = 0;
        *(undefined4 *)(*(longlong *)(_Dst + 0x86) + 0xc + lVar12) = 0;
        *(undefined4 *)(*(longlong *)(_Dst + 0x86) + 8 + lVar12) = 0;
        *(undefined4 *)(lVar12 + *(longlong *)(_Dst + 0x86)) = 1;
        *(undefined1 *)(*(longlong *)(_Dst + 0x86) + 0x10 + lVar12) = 0;
        *(int **)(*(longlong *)(_Dst + 0x86) + 0x18 + lVar12) = _Dst;
        lVar12 = lVar12 + 0x20;
        uVar15 = uVar15 - 1;
      } while (uVar15 != 0);
    }
  }
  ppiVar2 = *(int ***)(param_1 + 0x90);
  if ((&local_res8 < ppiVar2) && (ppiVar3 = *(int ***)(param_1 + 0x88), ppiVar3 <= &local_res8)) {
    if (ppiVar2 == *(int ***)(param_1 + 0x98)) {
      FUN_14000b000(param_1 + 0x88);
    }
    if (*(undefined8 **)(param_1 + 0x90) != (undefined8 *)0x0) {
      **(undefined8 **)(param_1 + 0x90) =
           *(undefined8 *)
            (*(longlong *)(param_1 + 0x88) + ((longlong)&local_res8 - (longlong)ppiVar3 >> 3) * 8);
    }
  }
  else {
    if (ppiVar2 == *(int ***)(param_1 + 0x98)) {
      FUN_14000b000(param_1 + 0x88);
    }
    if (*(undefined8 **)(param_1 + 0x90) != (undefined8 *)0x0) {
      **(undefined8 **)(param_1 + 0x90) = _Dst;
    }
  }
  *(longlong *)(param_1 + 0x90) = *(longlong *)(param_1 + 0x90) + 8;
LAB_1400051db:
  FUN_1400d1290(param_1 + 0x50);
  return;
}



void FUN_140005210(longlong param_1,longlong param_2)

{
  ulonglong *puVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong local_res10 [3];
  
  puVar1 = (ulonglong *)(param_1 + 0xa8);
  plVar3 = (longlong *)*puVar1;
  if (plVar3 != *(longlong **)(param_1 + 0xb0)) {
    do {
      if (*(int *)(*plVar3 + 100) == *(int *)(param_2 + 100)) {
        return;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != *(longlong **)(param_1 + 0xb0));
  }
  plVar3 = *(longlong **)(param_1 + 0xb0);
  local_res10[0] = param_2;
  if ((local_res10 < plVar3) && (plVar2 = (longlong *)*puVar1, plVar2 <= local_res10)) {
    if (plVar3 == *(longlong **)(param_1 + 0xb8)) {
      FUN_14000b000(puVar1);
    }
    if (*(undefined8 **)(param_1 + 0xb0) != (undefined8 *)0x0) {
      **(undefined8 **)(param_1 + 0xb0) =
           *(undefined8 *)(*puVar1 + ((longlong)local_res10 - (longlong)plVar2 >> 3) * 8);
      *(longlong *)(param_1 + 0xb0) = *(longlong *)(param_1 + 0xb0) + 8;
      return;
    }
  }
  else {
    if (plVar3 == *(longlong **)(param_1 + 0xb8)) {
      FUN_14000b000(puVar1);
    }
    if (*(longlong **)(param_1 + 0xb0) != (longlong *)0x0) {
      **(longlong **)(param_1 + 0xb0) = param_2;
    }
  }
  *(longlong *)(param_1 + 0xb0) = *(longlong *)(param_1 + 0xb0) + 8;
  return;
}



void FUN_1400052e0(longlong param_1,int param_2,int param_3,undefined4 param_4,undefined4 param_5,
                  undefined4 param_6)

{
  longlong lVar1;
  int iVar2;
  undefined4 *puVar3;
  uint uVar4;
  longlong lVar5;
  uint uVar6;
  
  FUN_1400a1c30(param_1 + 0x50);
  uVar6 = 0;
  if (*(longlong *)(param_1 + 0x90) - *(longlong *)(param_1 + 0x88) >> 3 != 0) {
    lVar5 = 0;
    uVar4 = DAT_140320f64;
    do {
      lVar1 = *(longlong *)(lVar5 + *(longlong *)(param_1 + 0x88));
      if (((lVar1 != 0) && (*(int *)(lVar1 + 100) == param_2)) &&
         (puVar3 = *(undefined4 **)(lVar1 + 0x218), puVar3 != (undefined4 *)0x0)) {
        iVar2 = 0;
        if (0 < *(int *)(lVar1 + 0x78)) {
          do {
            if (((puVar3 != (undefined4 *)0x0) && (puVar3[1] == 0)) || (puVar3[1] == param_3)) {
              if (puVar3 != (undefined4 *)0x0) {
                if (param_3 == 1) {
                  FUN_140005210(param_1,lVar1);
                  uVar4 = DAT_140320f64;
                }
                puVar3[1] = param_3;
                puVar3[2] = param_5;
                puVar3[3] = param_6;
                *puVar3 = param_4;
                *(undefined1 *)(puVar3 + 4) = 0;
                *(longlong *)(puVar3 + 6) = lVar1;
                if ((uVar4 & 1) == 0) {
                  DAT_140320f64 = uVar4 | 1;
                  FUN_1400908e0();
                  atexit((_func_5014 *)&LAB_140202650);
                  uVar4 = DAT_140320f64;
                }
                if (DAT_140320704 <= (int)puVar3[2]) {
                  if ((uVar4 & 1) == 0) {
                    DAT_140320f64 = uVar4 | 1;
                    FUN_1400908e0();
                    atexit((_func_5014 *)&LAB_140202650);
                  }
                  printf("ChannelLockDown ChannelID[%d] ChannelUser[%d] ControlLockCount[%d]\n");
                  *(undefined1 *)(puVar3 + 4) = 1;
                  uVar4 = DAT_140320f64;
                }
              }
              break;
            }
            iVar2 = iVar2 + 1;
            puVar3 = puVar3 + 8;
          } while (iVar2 < *(int *)(lVar1 + 0x78));
        }
      }
      uVar6 = uVar6 + 1;
      lVar5 = lVar5 + 8;
    } while ((ulonglong)uVar6 <
             (ulonglong)(*(longlong *)(param_1 + 0x90) - *(longlong *)(param_1 + 0x88) >> 3));
  }
  FUN_1400d1290(param_1 + 0x50);
  return;
}



void FUN_1400054e0(longlong param_1,int param_2)

{
  void *pvVar1;
  undefined8 *_Dst;
  longlong *_Dst_00;
  longlong *_Src;
  
  FUN_1400a1c30(param_1 + 0x50);
  _Dst = *(undefined8 **)(param_1 + 0x88);
  while( true ) {
    if (_Dst == *(undefined8 **)(param_1 + 0x90)) goto LAB_1400055d3;
    pvVar1 = (void *)*_Dst;
    if (*(int *)((longlong)pvVar1 + 100) == param_2) break;
    _Dst = _Dst + 1;
  }
  _Dst_00 = *(longlong **)(param_1 + 0xa8);
  if (_Dst_00 != *(longlong **)(param_1 + 0xb0)) {
    _Src = _Dst_00 + 1;
    do {
      if (*(int *)(*_Dst_00 + 100) == *(int *)((longlong)pvVar1 + 100)) {
        memmove(_Dst_00,_Src,*(longlong *)(param_1 + 0xb0) - (longlong)_Src & 0xfffffffffffffff8);
        *(longlong *)(param_1 + 0xb0) = *(longlong *)(param_1 + 0xb0) + -8;
      }
      else {
        _Dst_00 = _Dst_00 + 1;
        _Src = _Src + 1;
      }
    } while (_Dst_00 != *(longlong **)(param_1 + 0xb0));
  }
  operator_delete__(*(void **)((longlong)pvVar1 + 0x218));
  operator_delete(pvVar1);
  memmove(_Dst,_Dst + 1,*(longlong *)(param_1 + 0x90) - (longlong)(_Dst + 1) & 0xfffffffffffffff8);
  *(longlong *)(param_1 + 0x90) = *(longlong *)(param_1 + 0x90) + -8;
LAB_1400055d3:
  FUN_1400d1290(param_1 + 0x50);
  return;
}



int * FUN_1400055f0(longlong param_1,int param_2)

{
  longlong lVar1;
  int *piVar2;
  undefined8 *puVar3;
  
  lVar1 = param_1 + 0x50;
  FUN_1400a1c30(lVar1);
  puVar3 = *(undefined8 **)(param_1 + 0x88);
  while( true ) {
    if (puVar3 == *(undefined8 **)(param_1 + 0x90)) {
      FUN_1400d1290(lVar1);
      return (int *)0x0;
    }
    piVar2 = (int *)*puVar3;
    if (*piVar2 == param_2) break;
    puVar3 = puVar3 + 1;
  }
  FUN_1400d1290(lVar1);
  return piVar2;
}



void FUN_140005670(longlong param_1)

{
  FUN_1400a1c30(param_1 + 0x50);
  return;
}



void FUN_140005680(longlong param_1)

{
  FUN_1400d1290(param_1 + 0x50);
  return;
}



undefined8 FUN_140005690(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  
  lVar1 = param_1 + 0x50;
  FUN_1400a1c30(lVar1);
  if ((param_2 < 0) ||
     ((int)(*(longlong *)(param_1 + 0x90) - *(longlong *)(param_1 + 0x88) >> 3) <= param_2)) {
    FUN_1400d1290(lVar1);
    uVar2 = 0;
  }
  else {
    uVar2 = *(undefined8 *)(*(longlong *)(param_1 + 0x88) + (longlong)param_2 * 8);
    FUN_1400d1290(lVar1);
  }
  return uVar2;
}



longlong FUN_140005710(longlong param_1,int param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong *plVar3;
  
  lVar1 = param_1 + 0x50;
  FUN_1400a1c30(lVar1);
  plVar3 = *(longlong **)(param_1 + 0xa8);
  while( true ) {
    if (plVar3 == *(longlong **)(param_1 + 0xb0)) {
      FUN_1400d1290(lVar1);
      return 0;
    }
    lVar2 = *plVar3;
    if (*(int *)(lVar2 + 0x70) == param_2) break;
    plVar3 = plVar3 + 1;
  }
  FUN_1400d1290(lVar1);
  return lVar2;
}



void FUN_140005790(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  if (*(longlong *)(param_1 + 0x108) != 0) {
    FUN_140020560(*(longlong *)(param_1 + 0x108),param_3);
  }
  if (*(longlong *)(param_1 + 0x180) != 0) {
    FUN_140023090(*(longlong *)(param_1 + 0x180),param_3);
  }
  return;
}



void FUN_1400057e0(longlong param_1,undefined8 *param_2,undefined8 *param_3,undefined2 param_4,
                  undefined1 param_5,undefined1 param_6,undefined4 param_7)

{
  longlong lVar1;
  char cVar2;
  undefined8 uVar3;
  undefined1 local_c8;
  undefined1 uStack_c7;
  undefined2 uStack_c6;
  undefined4 uStack_c4;
  undefined8 uStack_c0;
  undefined8 local_b8;
  undefined4 uStack_b0;
  undefined4 uStack_ac;
  undefined4 local_a8;
  undefined4 uStack_a4;
  undefined4 uStack_a0;
  undefined4 uStack_9c;
  undefined4 local_98;
  undefined4 uStack_94;
  longlong local_90;
  undefined1 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 uStack_70;
  undefined8 local_68;
  undefined8 uStack_60;
  undefined8 local_58;
  undefined8 uStack_50;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined8 local_38;
  undefined1 local_28 [16];
  
  local_80 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x50;
  local_90 = lVar1;
  FUN_1400a1c30(lVar1);
  local_88 = 1;
  uStack_c0 = 0;
  local_b8 = 0;
  uStack_a0 = 0;
  uStack_9c = 0;
  local_98 = 0;
  uStack_94 = 0;
  param_1 = param_1 + 200;
  cVar2 = FUN_14000ad70(param_1,param_2,&local_c8);
  if (cVar2 != '\0') {
    FUN_14000b120(param_1,param_2);
  }
  uStack_b0 = *(undefined4 *)param_3;
  uStack_ac = *(undefined4 *)((longlong)param_3 + 4);
  uStack_50 = *param_3;
  local_a8 = *(undefined4 *)(param_3 + 1);
  uStack_a4 = *(undefined4 *)((longlong)param_3 + 0xc);
  local_c8 = param_5;
  uStack_c7 = param_6;
  uStack_c4 = param_7;
  local_78 = *param_2;
  uStack_70 = param_2[1];
  local_68 = CONCAT44(param_7,CONCAT22(param_4,CONCAT11(param_6,param_5)));
  uStack_60 = uStack_c0;
  local_58 = local_b8;
  uStack_40 = uStack_a0;
  uStack_3c = uStack_9c;
  local_38 = CONCAT44(uStack_94,local_98);
  uStack_c6 = param_4;
  local_48 = local_a8;
  uStack_44 = uStack_a4;
  uVar3 = FUN_14000bee0(param_1,&local_78);
  FUN_14000ba00(param_1,local_28,uVar3);
  FUN_1400d1290(lVar1);
  return;
}



void FUN_140005930(longlong param_1,undefined8 param_2,undefined4 *param_3,undefined2 *param_4,
                  undefined1 *param_5,undefined1 *param_6,undefined4 *param_7)

{
  char cVar1;
  undefined2 local_50;
  undefined2 local_4e;
  undefined4 local_4c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  
  FUN_1400a1c30(param_1 + 0x50);
  local_50 = 0;
  local_4e = 0xffff;
  local_4c = 0;
  local_38 = 0;
  local_34 = 0;
  local_30 = 0;
  local_2c = 0;
  cVar1 = FUN_14000ad70(param_1 + 200,param_2,&local_50);
  if (cVar1 != '\0') {
    *param_3 = local_38;
    param_3[1] = local_34;
    param_3[2] = local_30;
    param_3[3] = local_2c;
    *param_4 = local_4e;
    *param_5 = (undefined1)local_50;
    *param_6 = local_50._1_1_;
    *param_7 = local_4c;
  }
  FUN_1400d1290(param_1 + 0x50);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140005a40(longlong param_1,undefined8 *param_2,undefined4 param_3,undefined4 *param_4,
                  undefined4 *param_5,undefined4 param_6,undefined4 param_7)

{
  longlong lVar1;
  longlong *plVar2;
  bool bVar3;
  char cVar4;
  errno_t eVar5;
  int iVar6;
  undefined8 uVar7;
  undefined1 auStack_178 [40];
  undefined8 local_150;
  undefined4 local_148;
  undefined4 local_140;
  undefined8 local_138;
  undefined4 local_130;
  __time64_t local_128;
  longlong local_120;
  undefined1 local_118;
  undefined8 local_110;
  short local_108;
  short local_106;
  undefined2 local_104;
  undefined2 local_102;
  undefined2 local_100;
  undefined2 local_fe;
  undefined2 local_fc;
  undefined2 local_fa;
  undefined8 local_f8;
  undefined8 local_f0;
  undefined2 local_e8;
  undefined2 uStack_e6;
  int iStack_e4;
  undefined8 uStack_e0;
  undefined8 local_d8;
  undefined4 uStack_d0;
  undefined4 uStack_cc;
  undefined4 local_c8;
  undefined4 uStack_c4;
  undefined4 uStack_c0;
  undefined4 uStack_bc;
  undefined4 local_b8;
  undefined4 uStack_b4;
  undefined1 local_a8 [40];
  undefined8 uStack_80;
  undefined4 local_78;
  undefined4 uStack_74;
  undefined4 uStack_70;
  undefined4 uStack_6c;
  undefined8 local_68;
  ulonglong local_58;
  
  local_110 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_178;
  lVar1 = param_1 + 0x50;
  local_120 = lVar1;
  FUN_1400a1c30(lVar1);
  local_118 = 1;
  local_e8 = 0;
  uStack_e6 = 0xffff;
  iStack_e4 = 0;
  uStack_e0._0_4_ = 0;
  uStack_e0._4_4_ = 0;
  local_d8 = 0;
  uStack_d0 = 0;
  uStack_cc = 0;
  local_c8 = 0;
  uStack_c4 = 0;
  uStack_c0 = 0;
  uStack_bc = 0;
  local_b8 = 0;
  uStack_b4 = 0;
  cVar4 = FUN_14000ad70(param_1 + 200,param_2,&local_e8);
  if (cVar4 != '\0') {
    if ((CONCAT44(uStack_bc,uStack_c0) == 0) && (CONCAT44(uStack_b4,local_b8) == 0)) {
      bVar3 = false;
    }
    else {
      bVar3 = true;
    }
    if (bVar3) {
      local_128 = _time64((__time64_t *)0x0);
      local_138 = 0;
      local_130 = 0;
      eVar5 = _localtime64_s((tm *)local_a8,&local_128);
      if (eVar5 == 0) {
        local_108 = local_a8._20_2_ + 0x76c;
        local_106 = local_a8._16_2_ + 1;
        local_104 = local_a8._24_2_;
        local_102 = local_a8._12_2_;
        local_100 = local_a8._8_2_;
        local_fe = local_a8._4_2_;
        local_fc = local_a8._0_2_;
        local_fa = 0;
        iVar6 = Ordinal_184(&local_108,&local_138);
        local_f8 = 0;
        local_f0 = 0;
        if (iVar6 != 0) {
          Ordinal_185((int)local_138,&local_f8);
        }
      }
      local_d8 = local_138;
      if (*(longlong *)(param_1 + 0x110) != 0) {
        plVar2 = *(longlong **)(*(longlong *)(param_1 + 0x110) + 0x88);
        local_140 = param_7;
        local_148 = param_6;
        local_150 = local_138;
        auStack_178._32_4_ = (int)uStack_e0;
        auStack_178._36_4_ = uStack_e0._4_4_;
        (**(code **)(*plVar2 + 0x18))(plVar2,param_3,&uStack_d0,&uStack_c0);
      }
    }
    FUN_14000b120(param_1 + 200,param_2);
    uStack_d0 = *param_4;
    uStack_cc = param_4[1];
    local_c8 = param_4[2];
    uStack_c4 = param_4[3];
    uStack_c0 = *param_5;
    uStack_bc = param_5[1];
    local_b8 = param_5[2];
    uStack_b4 = param_5[3];
    local_128 = _time64((__time64_t *)0x0);
    local_138._0_4_ = 0;
    local_138._4_4_ = 0;
    local_130 = 0;
    eVar5 = _localtime64_s((tm *)local_a8,&local_128);
    if (eVar5 == 0) {
      local_108 = local_a8._20_2_ + 0x76c;
      local_106 = local_a8._16_2_ + 1;
      local_104 = local_a8._24_2_;
      local_102 = local_a8._12_2_;
      local_100 = local_a8._8_2_;
      local_fe = local_a8._4_2_;
      local_fc = local_a8._0_2_;
      local_fa = 0;
      iVar6 = Ordinal_184(&local_108,&local_138);
      local_f8 = 0;
      local_f0 = 0;
      if (iVar6 != 0) {
        Ordinal_185((int)local_138,&local_f8);
      }
    }
    uStack_e0._0_4_ = (int)local_138;
    uStack_e0._4_4_ = local_138._4_4_;
    local_128 = _time64((__time64_t *)0x0);
    local_138 = 0;
    local_130 = 0;
    eVar5 = _localtime64_s((tm *)local_a8,&local_128);
    if (eVar5 == 0) {
      local_108 = local_a8._20_2_ + 0x76c;
      local_106 = local_a8._16_2_ + 1;
      local_104 = local_a8._24_2_;
      local_102 = local_a8._12_2_;
      local_100 = local_a8._8_2_;
      local_fe = local_a8._4_2_;
      local_fc = local_a8._0_2_;
      local_fa = 0;
      iVar6 = Ordinal_184(&local_108,&local_138);
      local_f8 = 0;
      local_f0 = 0;
      if (iVar6 != 0) {
        Ordinal_185((int)local_138,&local_f8);
      }
    }
    local_d8 = local_138;
    local_a8._0_8_ = *param_2;
    local_a8._8_8_ = param_2[1];
    local_a8._18_2_ = uStack_e6;
    local_a8._16_2_ = local_e8;
    local_a8._20_4_ = iStack_e4;
    local_a8._24_4_ = (int)uStack_e0;
    local_a8._28_4_ = uStack_e0._4_4_;
    uStack_80 = CONCAT44(uStack_cc,uStack_d0);
    local_a8._32_8_ = local_138;
    local_78 = local_c8;
    uStack_74 = uStack_c4;
    uStack_70 = uStack_c0;
    uStack_6c = uStack_bc;
    local_68 = CONCAT44(uStack_b4,local_b8);
    uVar7 = FUN_14000bee0(param_1 + 200,local_a8);
    FUN_14000ba00(param_1 + 200,&local_f8,uVar7);
  }
  FUN_1400d1290(lVar1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140005e70(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                  undefined4 param_5,undefined8 param_6,undefined8 param_7,undefined4 param_8,
                  undefined4 param_9)

{
  longlong lVar1;
  longlong *plVar2;
  char cVar3;
  errno_t eVar4;
  int iVar5;
  undefined1 auStack_128 [32];
  undefined8 local_108;
  undefined8 local_100;
  undefined4 local_f8;
  undefined4 local_f0;
  undefined8 local_e8;
  undefined4 local_e0;
  __time64_t local_d8 [2];
  longlong local_c8;
  undefined1 local_c0;
  short local_b8;
  short local_b6;
  undefined2 local_b4;
  undefined2 local_b2;
  undefined2 local_b0;
  undefined2 local_ae;
  undefined2 local_ac;
  undefined2 local_aa;
  undefined2 local_a8;
  undefined2 local_a6;
  undefined4 local_a4;
  undefined8 local_a0;
  undefined8 local_98;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  tm local_70;
  undefined8 local_48;
  undefined8 local_40;
  ulonglong local_38;
  
  local_d8[1] = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_128;
  lVar1 = param_1 + 0x50;
  local_c8 = lVar1;
  FUN_1400a1c30(lVar1);
  local_c0 = 1;
  local_a8 = 0;
  local_a6 = 0xffff;
  local_a4 = 0;
  local_a0 = 0;
  local_98 = 0;
  local_90 = 0;
  local_8c = 0;
  local_88 = 0;
  local_84 = 0;
  local_80 = 0;
  local_7c = 0;
  local_78 = 0;
  local_74 = 0;
  cVar3 = FUN_14000ad70(param_1 + 200,param_4,&local_a8);
  if (cVar3 != '\0') {
    local_d8[0] = _time64((__time64_t *)0x0);
    local_e8 = 0;
    local_e0 = 0;
    eVar4 = _localtime64_s(&local_70,local_d8);
    if (eVar4 == 0) {
      local_b8 = (short)local_70.tm_year + 0x76c;
      local_b6 = (short)local_70.tm_mon + 1;
      local_b4 = (undefined2)local_70.tm_wday;
      local_b2 = (undefined2)local_70.tm_mday;
      local_b0 = (undefined2)local_70.tm_hour;
      local_ae = (undefined2)local_70.tm_min;
      local_ac = (undefined2)local_70.tm_sec;
      local_aa = 0;
      iVar5 = Ordinal_184(&local_b8,&local_e8);
      local_48 = 0;
      local_40 = 0;
      if (iVar5 != 0) {
        Ordinal_185(local_e8,&local_48);
      }
    }
    local_98 = local_e8;
    if (*(longlong *)(param_1 + 0x110) != 0) {
      plVar2 = *(longlong **)(*(longlong *)(param_1 + 0x110) + 0x88);
      local_f0 = param_9;
      local_f8 = param_8;
      local_100 = local_e8;
      local_108 = local_a0;
      (**(code **)(*plVar2 + 0x18))(plVar2,param_5,&local_90,&local_80);
    }
  }
  FUN_1400d1290(lVar1);
  return;
}



void FUN_140006060(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x110) != 0) {
    FUN_140019f80();
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140006080(longlong param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4,
                  undefined8 param_5,undefined4 param_6,undefined8 param_7,undefined8 param_8,
                  undefined4 param_9,undefined8 param_10,undefined4 param_11,undefined4 param_12,
                  undefined4 param_13,undefined8 param_14,undefined1 param_15)

{
  longlong lVar1;
  longlong *plVar2;
  char cVar3;
  undefined1 auStack_148 [32];
  undefined8 local_128;
  undefined8 *local_120;
  undefined8 local_118;
  undefined8 local_110;
  undefined4 local_108;
  undefined8 local_100;
  undefined4 local_f8;
  undefined4 local_f0;
  undefined4 local_e8;
  undefined8 local_e0;
  undefined1 local_d8;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  longlong local_b0;
  undefined1 local_a8;
  undefined1 local_a0 [24];
  undefined4 local_88;
  undefined4 uStack_84;
  undefined4 local_80;
  undefined4 uStack_7c;
  undefined8 local_68;
  undefined8 local_60;
  ulonglong local_58;
  
  local_b8 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_148;
  local_c0 = param_8;
  local_c8 = param_10;
  lVar1 = param_1 + 0x50;
  local_b0 = lVar1;
  FUN_1400a1c30(lVar1);
  local_a8 = 1;
  local_88 = 0;
  uStack_84 = 0;
  local_80 = 0;
  uStack_7c = 0;
  cVar3 = FUN_14000ad70(param_1 + 200,param_5,local_a0);
  if (cVar3 != '\0') {
    local_68 = CONCAT44(uStack_84,local_88);
    local_60 = CONCAT44(uStack_7c,local_80);
    if (*(longlong *)(param_1 + 0x110) != 0) {
      plVar2 = *(longlong **)(*(longlong *)(param_1 + 0x110) + 0x88);
      local_d8 = param_15;
      local_e0 = param_14;
      local_e8 = param_13;
      local_f0 = param_12;
      local_f8 = param_11;
      local_100 = local_c8;
      local_108 = param_9;
      local_110 = local_c0;
      local_118 = param_7;
      local_120 = &local_68;
      local_128 = param_4;
      (**(code **)(*plVar2 + 0x10))(plVar2,param_2,param_3,param_6);
    }
    FUN_14000b120(param_1 + 200,param_5);
  }
  FUN_1400d1290(lVar1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140006260(longlong *param_1)

{
  undefined1 uVar1;
  longlong lVar2;
  longlong lVar3;
  uint uVar4;
  ushort uVar5;
  int iVar6;
  int iVar7;
  DWORD DVar8;
  undefined8 uVar9;
  undefined8 *puVar10;
  undefined8 *puVar11;
  longlong *plVar12;
  ulonglong uVar13;
  ulonglong uVar14;
  ulonglong uVar15;
  longlong lVar16;
  undefined **ppuVar17;
  ulonglong uVar18;
  bool bVar19;
  undefined1 auStack_118 [32];
  int local_f8;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined4 local_98;
  undefined8 local_88;
  undefined1 local_80;
  undefined7 uStack_7f;
  undefined8 local_70;
  ulonglong local_68;
  undefined1 local_58;
  undefined7 uStack_57;
  undefined8 local_48;
  ulonglong local_40;
  ulonglong local_30;
  
  local_88 = 0xfffffffffffffffe;
  local_30 = DAT_1402f85a0 ^ (ulonglong)auStack_118;
  iVar6 = _kbhit();
  if (iVar6 != 0) {
    uVar18 = 0;
    do {
      iVar6 = _getch();
      iVar6 = (int)(char)iVar6;
      if ((int)param_1[9] == 0) {
        iVar7 = toupper(iVar6);
        switch(iVar7) {
        case 0x41:
          if (param_1[0x1d] != 0) {
            plVar12 = (longlong *)(**(longlong **)(param_1[0x1d] + 8) + 0x68);
            (**(code **)(*plVar12 + 0x800))(plVar12,1,&DAT_14030ab90);
          }
          printf("%s\n");
          break;
        case 0x42:
          if (param_1[0x1d] != 0) {
            plVar12 = (longlong *)(**(longlong **)(param_1[0x1d] + 8) + 0x68);
            (**(code **)(*plVar12 + 0x810))(plVar12,1,&DAT_14030ab90);
          }
          printf("%s\n");
          break;
        case 0x43:
          uVar9 = FUN_140094270();
          FUN_140090f40(uVar9);
          printf("%s\n");
          break;
        default:
          printf("........... Message : Unknown Control Command.\n");
          break;
        case 0x45:
          DAT_14031fe98 = 1;
          printf("%s\n");
          return 0;
        case 0x46:
          DAT_14031fea0 = 1;
          printf("%s %s\n");
          break;
        case 0x47:
          lVar16 = param_1[0x22];
          if (lVar16 != 0) {
            DAT_14031fe9c = (uint)(DAT_14031fe9c == 0);
            if (DAT_14031fe9c == 0) {
              if (*(longlong *)(lVar16 + 0x40) != 0) {
                (**(code **)(**(longlong **)(lVar16 + 0x40) + 400))();
                wprintf_s(L"Log Off\n");
              }
            }
            else {
              FUN_14000f0d0();
            }
          }
          printf("%s %s\n");
          break;
        case 0x48:
          (**(code **)(*param_1 + 0xd0))(param_1);
          break;
        case 0x4a:
          if (param_1[0x22] != 0) {
            puVar10 = (undefined8 *)FUN_1401e1780(&local_80,"rhpass%04d",DAT_140312f18);
            puVar11 = (undefined8 *)FUN_1401e1780(&local_58,"rhuser%04d",DAT_140312f18);
            if (0xf < (ulonglong)puVar10[3]) {
              puVar10 = (undefined8 *)*puVar10;
            }
            if (0xf < (ulonglong)puVar11[3]) {
              puVar11 = (undefined8 *)*puVar11;
            }
            FUN_140013790(param_1[0x22],puVar11,puVar10);
            if (0xf < local_40) {
              operator_delete((void *)CONCAT71(uStack_57,local_58));
            }
            local_40 = 0xf;
            local_48 = 0;
            local_58 = 0;
            if (0xf < local_68) {
              operator_delete((void *)CONCAT71(uStack_7f,local_80));
            }
            local_68 = 0xf;
            local_70 = 0;
            local_80 = 0;
            if (DAT_140312f18 == 200) {
              DAT_140312f18 = 1;
            }
            DAT_140312f18 = DAT_140312f18 + 1;
          }
          printf("%s\n");
          break;
        case 0x4c:
          *(undefined4 *)(param_1 + 9) = 1;
          printf("%s %s\n");
          break;
        case 0x4d:
          FUN_14008a920(DAT_140320118);
          lVar16 = DAT_140320118;
          if (param_1[7] != 0) {
            *(undefined1 *)(param_1[7] + 0x18) = *(undefined1 *)(DAT_140320118 + 0x16);
          }
          uVar4 = DAT_14031fed8;
          lVar2 = param_1[0x1d];
          uVar15 = (ulonglong)DAT_14031fed8;
          if ((lVar2 != 0) &&
             (uVar1 = *(undefined1 *)(lVar16 + 8), uVar13 = uVar18, uVar14 = uVar15,
             0 < (int)DAT_14031fed8)) {
            do {
              lVar3 = *(longlong *)(lVar2 + 8);
              if (*(longlong *)(uVar13 + lVar3) != 0) {
                *(undefined1 *)(*(longlong *)(uVar13 + lVar3) + 0x18) = uVar1;
              }
              uVar14 = uVar14 - 1;
              uVar13 = uVar13 + 8;
            } while (uVar14 != 0);
          }
          lVar2 = param_1[0x1e];
          if ((lVar2 != 0) && (uVar1 = *(undefined1 *)(lVar16 + 9), uVar13 = uVar18, 0 < (int)uVar4)
             ) {
            do {
              lVar3 = *(longlong *)(lVar2 + 8);
              if (*(longlong *)(uVar13 + lVar3) != 0) {
                *(undefined1 *)(*(longlong *)(uVar13 + lVar3) + 0x18) = uVar1;
              }
              uVar15 = uVar15 - 1;
              uVar13 = uVar13 + 8;
            } while (uVar15 != 0);
          }
          plVar12 = (longlong *)param_1[0x30];
          if (plVar12 != (longlong *)0x0) {
            uVar1 = *(undefined1 *)(lVar16 + 0xe);
            lVar16 = *plVar12;
            uVar15 = uVar18;
            uVar13 = uVar18;
            if (plVar12[1] - lVar16 >> 3 != 0) {
              do {
                if (*(longlong *)(lVar16 + uVar15) != 0) {
                  *(undefined1 *)(*(longlong *)(lVar16 + uVar15) + 0x18) = uVar1;
                }
                uVar13 = (ulonglong)((int)uVar13 + 1);
                lVar16 = *plVar12;
                uVar15 = uVar15 + 8;
              } while (uVar13 < (ulonglong)(plVar12[1] - lVar16 >> 3));
            }
          }
          printf("%s\n");
          break;
        case 0x4e:
          if (param_1[0x22] != 0) {
            FUN_14001bf80();
          }
          printf("%s\n");
          break;
        case 0x4f:
          bVar19 = *(char *)(param_1[0x22] + 0x1f8) == '\0';
          *(bool *)(param_1[0x22] + 0x1f8) = bVar19;
          if (bVar19) {
            printf("Server Open !! \n");
          }
          else {
            printf("Server Close !! \n");
          }
          break;
        case 0x50:
          lVar16 = param_1[0x21];
          if (lVar16 != 0) {
            local_a8 = 0;
            local_e0 = 0;
            local_e8 = 0;
            local_d0 = 0;
            local_d8 = 0;
            local_b0 = 0;
            local_b8 = 0;
            local_c0 = 0;
            local_c8 = 0;
            local_a0 = 0;
            local_98 = 0;
            if (*(longlong *)(lVar16 + 0x48) != 0) {
              (**(code **)(**(longlong **)(lVar16 + 0x48) + 0xb0))
                        (*(longlong **)(lVar16 + 0x48),&local_e8);
              printf("SERVER----------------------------------------------\n");
              printf("%I64d totalTcpReceiveCount\n");
              printf("%I64d totalTcpReceiveBytes\n");
              printf("%I64d totalTcpSendCount\n");
              printf("%I64d totalTcpSendBytes\n");
              printf("%d p2pConnectionPairCount\n");
              printf("%d p2pDirectConnectionPairCount\n");
              printf("%d clientCount\n");
            }
          }
          lVar16 = param_1[0x22];
          if (lVar16 != 0) {
            local_a8 = 0;
            local_e0 = 0;
            local_e8 = 0;
            local_d0 = 0;
            local_d8 = 0;
            local_b0 = 0;
            local_b8 = 0;
            local_c0 = 0;
            local_c8 = 0;
            local_a0 = 0;
            local_98 = 0;
            if (*(longlong *)(lVar16 + 0x40) != 0) {
              (**(code **)(**(longlong **)(lVar16 + 0x40) + 0xb0))
                        (*(longlong **)(lVar16 + 0x40),&local_e8);
              printf("USER----------------------------------------------\n");
              printf("%I64d totalTcpReceiveCount\n");
              printf("%I64d totalTcpReceiveBytes\n");
              printf("%I64d totalTcpSendCount\n");
              printf("%I64d totalTcpSendBytes\n");
              printf("%I64d totalUdpSendCount\n");
              printf("%I64d totalUdpSendBytes\n");
              printf("%I64d totalUdpReceiveCount\n");
              printf("%I64d totalUdpReceiveBytes\n");
              printf("%d p2pConnectionPairCount\n");
              printf("%d p2pDirectConnectionPairCount\n");
              printf("%d clientCount\n");
              printf("%d realUdpEnabledClientCount\n");
              printf("--------------------------------------------------\n");
            }
          }
          printf("%s\n");
          break;
        case 0x51:
          FUN_1400a1c30(param_1 + 10);
          puVar10 = (undefined8 *)param_1[0x11];
          if (puVar10 != (undefined8 *)param_1[0x12]) {
            do {
              FUN_14001afc0(*puVar10);
              puVar10 = puVar10 + 1;
            } while (puVar10 != (undefined8 *)param_1[0x12]);
          }
          FUN_1400d1290(param_1 + 10);
          printf("%s\n");
          break;
        case 0x52:
          DAT_14031fea8 = (uint)(DAT_14031fea8 == 0);
          printf("%s %s\n");
          break;
        case 0x53:
          FUN_1400a1c30(param_1 + 10);
          uVar15 = uVar18;
          uVar13 = uVar18;
          if (param_1[0x12] - param_1[0x11] >> 3 != 0) {
            do {
              lVar16 = *(longlong *)(uVar13 + param_1[0x11]);
              DVar8 = GetTickCount();
              local_f8 = *(int *)(lVar16 + 0x88) - DVar8;
              wprintf_s(
                       L"LOBBY : hostID [ %d ] PORT [ %u ] IP [ %s ] LastTick - CurrentTick[ %d ]\n"
                       );
              wprintf_s(L"LOBBY : DNS [ %s ] CODE [ %d ]\n");
              uVar15 = (ulonglong)((int)uVar15 + 1);
              uVar13 = uVar13 + 8;
            } while (uVar15 < (ulonglong)(param_1[0x12] - param_1[0x11] >> 3));
          }
          printf("%s\n");
          FUN_1400d1290(param_1 + 10);
          break;
        case 0x54:
          DAT_14031fe97 = DAT_14031fe97 == '\0';
          printf("%s %s\n");
          break;
        case 0x56:
          uVar9 = FUN_1401e4420();
          FUN_1401e2a50(uVar9);
          printf("%s\n");
          break;
        case 0x57:
          FUN_1400a1c30(param_1 + 10);
          puVar10 = (undefined8 *)param_1[0x15];
          if (puVar10 != (undefined8 *)param_1[0x16]) {
            do {
              FUN_14001afc0(*puVar10);
              puVar10 = puVar10 + 1;
            } while (puVar10 != (undefined8 *)param_1[0x16]);
          }
          FUN_1400d1290(param_1 + 10);
          printf("%s\n");
          break;
        case 0x5a:
          DAT_14031fea4 = DAT_14031fea4 == '\0';
          printf("%s %s\n");
        }
      }
      else {
        iVar7 = toupper(iVar6);
        if (iVar7 == 0x55) {
          *(undefined4 *)(param_1 + 9) = 0;
          printf("%s %s\n");
          ppuVar17 = &PTR_s_Server_Shutdown__140312b88;
          do {
            uVar5 = GetAsyncKeyState(0xa0);
            if (((uVar5 & 0x8001) != 0) || (*(char *)(ppuVar17 + 1) == '\0')) {
              printf(" \'%c\'\t: %s\n");
            }
            ppuVar17 = ppuVar17 + 3;
          } while ((longlong)ppuVar17 < 0x140312d98);
        }
      }
      iVar6 = toupper(iVar6);
      if (iVar6 == 0x49) {
        printf("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n");
        GetCurrentProcessId();
        printf("ProcessID : %d\n");
        printf("SVN : %d\n");
        printf("Resource : %d\n");
        printf("Build Date : %s\n");
        FUN_1401e1940(&local_80,&DAT_140320030);
        printf("PROTOCOL : %s\n");
        if (0xf < local_68) {
          operator_delete((void *)CONCAT71(uStack_7f,local_80));
        }
        local_68 = 0xf;
        local_70 = 0;
        local_80 = 0;
        printf("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n");
      }
      iVar6 = _kbhit();
    } while (iVar6 != 0);
  }
  return 2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140006d80(longlong *param_1)

{
  int *piVar1;
  double dVar2;
  short sVar3;
  undefined8 *puVar4;
  undefined1 auVar5 [16];
  undefined1 auVar6 [16];
  undefined1 auVar7 [16];
  undefined1 auVar8 [16];
  char cVar9;
  undefined4 uVar10;
  uint uVar11;
  int iVar12;
  DWORD DVar13;
  DWORD DVar14;
  longlong *plVar15;
  longlong *plVar16;
  longlong *plVar17;
  longlong *plVar18;
  void *pvVar19;
  longlong *plVar20;
  ulonglong uVar21;
  longlong lVar22;
  char *pcVar23;
  undefined8 **ppuVar24;
  short *psVar25;
  undefined *puVar26;
  undefined8 *puVar27;
  short *psVar28;
  longlong lVar29;
  longlong lVar30;
  undefined8 *puVar31;
  undefined8 *puVar32;
  undefined8 *puVar33;
  bool bVar34;
  undefined4 uVar35;
  undefined4 uVar36;
  undefined4 uVar37;
  undefined4 uVar38;
  undefined4 uVar39;
  undefined4 uVar40;
  undefined4 uVar41;
  undefined4 uVar42;
  undefined4 uVar43;
  undefined1 auStack_408 [32];
  longlong *local_3e8;
  undefined8 *local_3e0;
  undefined8 *local_3d8;
  longlong *local_3d0;
  undefined8 *local_3c8;
  uint local_3c0 [2];
  longlong *local_3b8;
  longlong *local_3b0;
  undefined8 *local_3a8;
  undefined8 *local_3a0;
  longlong *local_398;
  undefined8 *local_390;
  undefined8 *local_388;
  longlong *local_380;
  undefined8 *local_378;
  undefined8 *local_370;
  longlong *local_368;
  longlong *local_360;
  longlong *local_358;
  longlong *local_350;
  undefined4 local_348 [2];
  undefined4 local_340 [2];
  undefined4 local_338 [2];
  longlong *local_330;
  longlong *local_328;
  void *local_320;
  longlong local_318;
  undefined8 local_310;
  undefined8 *local_300;
  longlong *local_2f8;
  longlong *local_2f0;
  longlong *local_2e8;
  undefined8 local_2e0;
  undefined8 local_2d8;
  undefined8 *local_2d0;
  longlong *local_2c8;
  undefined8 *local_2c0;
  longlong *local_2b8;
  undefined8 *local_2b0;
  longlong *local_2a8;
  longlong *local_2a0;
  undefined1 local_298;
  char *local_290;
  DWORD local_288;
  undefined8 local_280;
  undefined2 local_278;
  undefined6 uStack_276;
  undefined8 local_268;
  ulonglong local_260;
  undefined8 local_248;
  undefined2 local_240;
  undefined6 uStack_23e;
  undefined8 local_230;
  ulonglong local_228;
  undefined2 local_218;
  undefined6 uStack_216;
  undefined8 local_208;
  ulonglong local_200;
  undefined8 local_1e8;
  undefined2 local_1e0;
  undefined6 uStack_1de;
  undefined8 local_1d0;
  ulonglong local_1c8;
  undefined2 local_1b8;
  undefined6 uStack_1b6;
  undefined8 local_1a8;
  ulonglong local_1a0;
  undefined8 local_188;
  undefined2 local_180;
  undefined6 uStack_17e;
  undefined8 local_170;
  ulonglong local_168;
  undefined2 local_158;
  undefined6 uStack_156;
  undefined8 local_148;
  ulonglong local_140;
  undefined8 local_128;
  undefined2 local_120;
  undefined6 uStack_11e;
  undefined8 local_110;
  ulonglong local_108;
  undefined2 local_f8;
  undefined6 uStack_f6;
  undefined8 local_e8;
  ulonglong local_e0;
  ulonglong local_c8;
  
  local_280 = 0xfffffffffffffffe;
  local_c8 = DAT_1402f85a0 ^ (ulonglong)auStack_408;
  local_3b8 = param_1;
  FUN_140025b40(L"# Gateway Server Startup #\n\n");
  FUN_140025c80();
  CoInitialize((LPVOID)0x0);
  local_398 = operator_new(0x160);
  plVar20 = (longlong *)0x0;
  plVar15 = plVar20;
  if (local_398 != (void *)0x0) {
    plVar15 = (longlong *)FUN_14001f8b0(local_398,param_1);
  }
  if (plVar15 == (longlong *)0x0) {
    local_3b0 = (longlong *)0x0;
  }
  else {
    local_3b0 = (longlong *)FUN_1400a34c0(0x10);
    local_3b0[1] = 1;
    *local_3b0 = (longlong)plVar15;
  }
  local_398 = operator_new(0x2b0);
  plVar15 = plVar20;
  if (local_398 != (void *)0x0) {
    plVar15 = (longlong *)FUN_14000e640(local_398,param_1);
  }
  if (plVar15 == (longlong *)0x0) {
    local_3e8 = (longlong *)0x0;
  }
  else {
    local_3e8 = (longlong *)FUN_1400a34c0(0x10);
    local_3e8[1] = 1;
    *local_3e8 = (longlong)plVar15;
  }
  plVar15 = local_3e8;
  local_368 = local_3e8;
  local_398 = operator_new(0xf0);
  plVar16 = plVar20;
  if (local_398 != (longlong *)0x0) {
    if ((plVar15 == (longlong *)0x0) || (plVar16 = (longlong *)(*plVar15 + 0x28), *plVar15 == 0)) {
      plVar16 = plVar20;
    }
    plVar16 = (longlong *)FUN_14008b450(local_398,plVar16);
  }
  if (plVar16 == (longlong *)0x0) {
    local_360 = (longlong *)0x0;
    plVar17 = plVar20;
  }
  else {
    plVar17 = (longlong *)FUN_1400a34c0(0x48);
    local_398 = plVar17;
    local_358 = plVar17;
    if (plVar17 != (longlong *)0x0) {
      uVar10 = FUN_1401692e0();
      FUN_1400a1b50(plVar17,uVar10,1);
    }
    local_360 = plVar17;
    FUN_1400a1c30(plVar17);
    plVar17[8] = 1;
    plVar17[7] = (longlong)plVar16;
    FUN_1400d1290(plVar17);
  }
  plVar18 = operator_new(0xa0);
  plVar16 = plVar20;
  local_398 = plVar18;
  if (plVar18 != (longlong *)0x0) {
    *plVar18 = (longlong)MagiApiServer::vftable;
    plVar18[1] = 0;
    plVar18[2] = 0;
    plVar18[4] = 0;
    plVar18[8] = 0xf;
    plVar18[7] = 0;
    *(undefined1 *)(plVar18 + 5) = 0;
    *(undefined4 *)(plVar18 + 10) = 0;
    plVar18[0xb] = 0;
    uVar10 = FUN_1401692e0();
    FUN_1400a1b50(plVar18 + 0xc,uVar10,1);
    *plVar18 = (longlong)MagiGatewayApiServer::vftable;
    plVar16 = plVar18;
  }
  if (plVar16 == (longlong *)0x0) {
    local_388 = (undefined8 *)0x0;
  }
  else {
    local_388 = (undefined8 *)FUN_1400a34c0(0x10);
    local_388[1] = 1;
    *local_388 = plVar16;
  }
  plVar16 = plVar20;
  if (plVar15 != (longlong *)0x0) {
    plVar16 = (longlong *)*plVar15;
  }
  param_1[0x22] = (longlong)plVar16;
  plVar16 = plVar20;
  if (local_3b0 != (longlong *)0x0) {
    plVar16 = (longlong *)*local_3b0;
  }
  param_1[0x21] = (longlong)plVar16;
  plVar16 = plVar20;
  if (plVar17 != (longlong *)0x0) {
    plVar16 = (longlong *)plVar17[7];
  }
  param_1[7] = (longlong)plVar16;
  plVar16 = plVar20;
  if (local_388 != (undefined8 *)0x0) {
    plVar16 = (longlong *)*local_388;
  }
  param_1[0x2b] = (longlong)plVar16;
  local_338[0] = 1;
  local_358 = param_1 + 1;
  *(undefined4 *)(param_1 + 2) = 1;
  printf("STEP : AGENT \n");
  lVar30 = param_1[7];
  if ((lVar30 != 0) && (*(char *)(lVar30 + 0x1a) != '\0')) {
    (**(code **)(*(longlong *)(lVar30 + 0x68) + 0xb0))
              ((longlong *)(lVar30 + 0x68),1,&DAT_14030ab90,local_338);
  }
  if ((param_1[7] != 0) && (cVar9 = FUN_14008b990(), cVar9 == '\0')) {
    if (local_388 != (undefined8 *)0x0) {
      plVar20 = local_388 + 1;
      *plVar20 = *plVar20 + -1;
      plVar15 = local_3e8;
      plVar17 = local_360;
      if (*plVar20 == 0) {
        FUN_14000b2a0(local_388);
        plVar15 = local_3e8;
        plVar17 = local_360;
      }
    }
    if (plVar17 != (longlong *)0x0) {
      local_2a0 = plVar17;
      FUN_1400a1c30(plVar17);
      bVar34 = true;
      local_298 = 1;
      plVar20 = plVar17 + 8;
      *plVar20 = *plVar20 + -1;
      if (*plVar20 == 0) {
        FUN_1400d1290(plVar17);
        bVar34 = false;
        local_298 = 0;
        puVar31 = (undefined8 *)plVar17[7];
        local_398 = plVar17;
        if (puVar31 != (undefined8 *)0x0) {
          (**(code **)*puVar31)(puVar31,1);
        }
        FUN_1400a1cd0(plVar17);
        FUN_1400a3530(plVar17);
      }
      if (bVar34) {
        FUN_1400d1290(plVar17);
        local_298 = 0;
      }
    }
    plVar20 = local_3e8;
    if (plVar15 != (longlong *)0x0) {
      plVar15 = plVar15 + 1;
      *plVar15 = *plVar15 + -1;
      if (*plVar15 == 0) {
        puVar31 = (undefined8 *)*local_3e8;
        if (puVar31 != (undefined8 *)0x0) {
          (**(code **)*puVar31)(puVar31,1);
        }
        FUN_1400a3530(plVar20);
      }
    }
    goto LAB_140008a6c;
  }
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320610 == 1000) {
LAB_140007215:
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    uVar11 = DAT_140320f5c;
    if (0 < DAT_140320550) {
      if (param_1[0x22] != 0) {
        *(longlong *)(param_1[0x2b] + 0x98) = param_1[0x22];
      }
      if ((uVar11 & 1) == 0) {
        DAT_140320f5c = uVar11 | 1;
        FUN_1401e4310();
        atexit((_func_5014 *)&LAB_140202480);
        uVar11 = DAT_140320f5c;
      }
      iVar12 = DAT_140320550;
      if ((uVar11 & 1) == 0) {
        DAT_140320f5c = uVar11 | 1;
        FUN_1401e4310();
        atexit((_func_5014 *)&LAB_140202480);
      }
      ppuVar24 = &DAT_140320528;
      if (0xf < DAT_140320540) {
        ppuVar24 = (undefined8 **)DAT_140320528;
      }
      FUN_14008de80(param_1[0x2b],ppuVar24,iVar12);
      FUN_140024730(param_1[0x2b]);
    }
  }
  else {
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if ((DAT_140320610 == 0xca) || (DAT_140320610 == 0x66)) goto LAB_140007215;
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if (DAT_140320610 == 0xca) goto LAB_140007215;
  }
  local_340[0] = 3;
  *(undefined4 *)(param_1 + 2) = 3;
  printf("STEP : DB_LOAD \n");
  lVar30 = param_1[7];
  if ((lVar30 != 0) && (*(char *)(lVar30 + 0x1a) != '\0')) {
    (**(code **)(*(longlong *)(lVar30 + 0x68) + 0xb0))
              ((longlong *)(lVar30 + 0x68),1,&DAT_14030ab90,local_340);
  }
  FUN_1400877e0(DAT_140320138,param_1 + 0x2c);
  plVar16 = operator_new(0x28);
  if (plVar16 == (longlong *)0x0) {
    local_3e0 = (undefined8 *)0x0;
  }
  else {
    *plVar16 = param_1[0x22];
    plVar16[1] = 0;
    plVar16[2] = 0;
    plVar16[3] = 0;
    local_3e0 = (undefined8 *)FUN_1400a34c0(0x10);
    local_3e0[1] = 1;
    *local_3e0 = plVar16;
  }
  puVar31 = local_3e0;
  local_390 = local_3e0;
  plVar16 = operator_new(0x28);
  if (plVar16 == (longlong *)0x0) {
    local_3d8 = (undefined8 *)0x0;
  }
  else {
    *plVar16 = param_1[0x22];
    plVar16[1] = 0;
    plVar16[2] = 0;
    plVar16[3] = 0;
    local_3d8 = (undefined8 *)FUN_1400a34c0(0x10);
    local_3d8[1] = 1;
    *local_3d8 = plVar16;
  }
  puVar32 = local_3d8;
  local_370 = local_3d8;
  plVar16 = operator_new(0x28);
  if (plVar16 == (longlong *)0x0) {
    local_3c8 = (undefined8 *)0x0;
  }
  else {
    *plVar16 = param_1[0x22];
    plVar16[1] = 0;
    plVar16[2] = 0;
    plVar16[3] = 0;
    local_3c8 = (undefined8 *)FUN_1400a34c0(0x10);
    local_3c8[1] = 1;
    *local_3c8 = plVar16;
  }
  puVar27 = local_3c8;
  local_3a8 = local_3c8;
  plVar16 = operator_new(0x28);
  if (plVar16 == (longlong *)0x0) {
    local_3a0 = (undefined8 *)0x0;
  }
  else {
    *plVar16 = param_1[0x22];
    plVar16[1] = 0;
    plVar16[2] = 0;
    plVar16[3] = 0;
    local_3a0 = (undefined8 *)FUN_1400a34c0(0x10);
    local_3a0[1] = 1;
    *local_3a0 = plVar16;
  }
  puVar33 = local_3a0;
  plVar16 = plVar20;
  if (puVar31 != (undefined8 *)0x0) {
    plVar16 = (longlong *)*puVar31;
  }
  local_378 = local_3a0;
  FUN_140023860(plVar16,*(undefined4 *)(DAT_140320138 + 0x144),0xc);
  plVar16 = plVar20;
  if (puVar32 != (undefined8 *)0x0) {
    plVar16 = (longlong *)*puVar32;
  }
  FUN_140023860(plVar16,*(undefined4 *)(DAT_140320138 + 0x144),0x11);
  plVar16 = plVar20;
  if (puVar27 != (undefined8 *)0x0) {
    plVar16 = (longlong *)*puVar27;
  }
  FUN_140023860(plVar16,*(undefined4 *)(DAT_140320138 + 0x144),0x12);
  plVar16 = plVar20;
  if (puVar33 != (undefined8 *)0x0) {
    plVar16 = (longlong *)*puVar33;
  }
  FUN_140023860(plVar16,*(undefined4 *)(DAT_140320138 + 0x144),0x13);
  plVar16 = local_3b8;
  plVar17 = plVar20;
  if (puVar31 != (undefined8 *)0x0) {
    plVar17 = (longlong *)*puVar31;
  }
  local_398 = local_3b8 + 0x1d;
  *local_398 = (longlong)plVar17;
  plVar17 = plVar20;
  if (puVar32 != (undefined8 *)0x0) {
    plVar17 = (longlong *)*puVar32;
  }
  local_3b8[0x1e] = (longlong)plVar17;
  plVar17 = plVar20;
  if (puVar27 != (undefined8 *)0x0) {
    plVar17 = (longlong *)*puVar27;
  }
  local_3b8[0x1f] = (longlong)plVar17;
  plVar17 = plVar20;
  if (puVar33 != (undefined8 *)0x0) {
    plVar17 = (longlong *)*puVar33;
  }
  local_3b8[0x20] = (longlong)plVar17;
  local_348[0] = 4;
  *(undefined4 *)(local_3b8 + 2) = 4;
  printf("STEP : SESSION_CONNECT \n");
  lVar30 = plVar16[7];
  if ((lVar30 != 0) && (*(char *)(lVar30 + 0x1a) != '\0')) {
    (**(code **)(*(longlong *)(lVar30 + 0x68) + 0xb0))
              ((longlong *)(lVar30 + 0x68),1,&DAT_14030ab90,local_348);
  }
  local_248 = 0;
  local_228 = 7;
  local_230 = 0;
  local_240 = 0;
  local_200 = 7;
  local_208 = 0;
  local_218 = 0;
  if (*(longlong *)(DAT_140320138 + 0x1c8) != 0) {
    auVar5._8_8_ = 0;
    auVar5._0_8_ = *(ulonglong *)(DAT_140320138 + 0x1b0);
    local_2b0 = (undefined8 *)
                (*(longlong *)(DAT_140320138 + 0x1a8) +
                SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xc)) % auVar5,0) * 8);
    for (local_2a8 = (longlong *)*local_2b0; local_2a8 != (longlong *)0x0;
        local_2a8 = (longlong *)*local_2a8) {
      if ((char)local_2a8[1] == '\f') {
        if (local_2a8 != (longlong *)0x0) goto LAB_140007657;
        break;
      }
    }
  }
  local_2b0 = (undefined8 *)0x0;
  local_2a8 = plVar20;
LAB_140007657:
  if ((local_2a8 != (longlong *)0x0) &&
     (puVar4 = (undefined8 *)local_2a8[2], puVar4 != (undefined8 *)local_2a8[3])) {
    local_248 = *puVar4;
    FUN_140001700(&local_240,puVar4 + 1,0,0xffffffffffffffff);
    FUN_140001700(&local_218,puVar4 + 6,0,0xffffffffffffffff);
    plVar16 = plVar20;
    if (puVar31 != (undefined8 *)0x0) {
      plVar16 = (longlong *)*puVar31;
    }
    FUN_140024100(plVar16);
    plVar16 = plVar20;
    if (puVar31 != (undefined8 *)0x0) {
      plVar16 = (longlong *)*puVar31;
    }
    FUN_140023e60(plVar16);
  }
  if (7 < local_200) {
    operator_delete((void *)CONCAT62(uStack_216,local_218));
  }
  local_200 = 7;
  local_208 = 0;
  local_218 = 0;
  if (7 < local_228) {
    operator_delete((void *)CONCAT62(uStack_23e,local_240));
  }
  local_228 = 7;
  local_230 = 0;
  local_240 = 0;
  local_188 = 0;
  local_168 = 7;
  local_170 = 0;
  local_180 = 0;
  local_140 = 7;
  local_148 = 0;
  local_158 = 0;
  if (*(longlong *)(DAT_140320138 + 0x1c8) != 0) {
    auVar6._8_8_ = 0;
    auVar6._0_8_ = *(ulonglong *)(DAT_140320138 + 0x1b0);
    local_2c0 = (undefined8 *)
                (*(longlong *)(DAT_140320138 + 0x1a8) +
                SUB168((ZEXT816(0) << 0x40 | ZEXT816(0x11)) % auVar6,0) * 8);
    for (local_2b8 = (longlong *)*local_2c0; local_2b8 != (longlong *)0x0;
        local_2b8 = (longlong *)*local_2b8) {
      if ((char)local_2b8[1] == '\x11') {
        if (local_2b8 != (longlong *)0x0) goto LAB_1400077ca;
        break;
      }
    }
  }
  local_2c0 = (undefined8 *)0x0;
  local_2b8 = plVar20;
LAB_1400077ca:
  if ((local_2b8 != (longlong *)0x0) &&
     (puVar31 = (undefined8 *)local_2b8[2], puVar31 != (undefined8 *)local_2b8[3])) {
    local_188 = *puVar31;
    FUN_140001700(&local_180,puVar31 + 1,0,0xffffffffffffffff);
    FUN_140001700(&local_158,puVar31 + 6,0,0xffffffffffffffff);
    plVar16 = plVar20;
    if (puVar32 != (undefined8 *)0x0) {
      plVar16 = (longlong *)*puVar32;
    }
    FUN_140024100(plVar16);
    plVar16 = plVar20;
    if (puVar32 != (undefined8 *)0x0) {
      plVar16 = (longlong *)*puVar32;
    }
    FUN_140023e60(plVar16);
  }
  if (7 < local_140) {
    operator_delete((void *)CONCAT62(uStack_156,local_158));
  }
  local_140 = 7;
  local_148 = 0;
  local_158 = 0;
  if (7 < local_168) {
    operator_delete((void *)CONCAT62(uStack_17e,local_180));
  }
  local_168 = 7;
  local_170 = 0;
  local_180 = 0;
  local_1e8 = 0;
  local_1c8 = 7;
  local_1d0 = 0;
  local_1e0 = 0;
  local_1a0 = 7;
  local_1a8 = 0;
  local_1b8 = 0;
  if (*(longlong *)(DAT_140320138 + 0x1c8) != 0) {
    auVar7._8_8_ = 0;
    auVar7._0_8_ = *(ulonglong *)(DAT_140320138 + 0x1b0);
    local_2d0 = (undefined8 *)
                (*(longlong *)(DAT_140320138 + 0x1a8) +
                SUB168((ZEXT816(0) << 0x40 | ZEXT816(0x12)) % auVar7,0) * 8);
    for (local_2c8 = (longlong *)*local_2d0; local_2c8 != (longlong *)0x0;
        local_2c8 = (longlong *)*local_2c8) {
      if ((char)local_2c8[1] == '\x12') {
        if (local_2c8 != (longlong *)0x0) goto LAB_140007942;
        break;
      }
    }
  }
  local_2d0 = (undefined8 *)0x0;
  local_2c8 = plVar20;
LAB_140007942:
  if ((local_2c8 != (longlong *)0x0) &&
     (puVar31 = (undefined8 *)local_2c8[2], puVar31 != (undefined8 *)local_2c8[3])) {
    local_1e8 = *puVar31;
    FUN_140001700(&local_1e0,puVar31 + 1,0,0xffffffffffffffff);
    FUN_140001700(&local_1b8,puVar31 + 6,0,0xffffffffffffffff);
    plVar16 = plVar20;
    if (puVar27 != (undefined8 *)0x0) {
      plVar16 = (longlong *)*puVar27;
    }
    FUN_140024100(plVar16);
    plVar16 = plVar20;
    if (puVar27 != (undefined8 *)0x0) {
      plVar16 = (longlong *)*puVar27;
    }
    FUN_140023be0(plVar16);
  }
  if (7 < local_1a0) {
    operator_delete((void *)CONCAT62(uStack_1b6,local_1b8));
  }
  local_1a0 = 7;
  local_1a8 = 0;
  local_1b8 = 0;
  if (7 < local_1c8) {
    operator_delete((void *)CONCAT62(uStack_1de,local_1e0));
  }
  local_1c8 = 7;
  local_1d0 = 0;
  local_1e0 = 0;
  local_128 = 0;
  local_108 = 7;
  local_110 = 0;
  local_120 = 0;
  local_e0 = 7;
  local_e8 = 0;
  local_f8 = 0;
  if (*(longlong *)(DAT_140320138 + 0x1c8) != 0) {
    auVar8._8_8_ = 0;
    auVar8._0_8_ = *(ulonglong *)(DAT_140320138 + 0x1b0);
    local_300 = (undefined8 *)
                (*(longlong *)(DAT_140320138 + 0x1a8) +
                SUB168((ZEXT816(0) << 0x40 | ZEXT816(0x13)) % auVar8,0) * 8);
    for (local_2f8 = (longlong *)*local_300; local_2f8 != (longlong *)0x0;
        local_2f8 = (longlong *)*local_2f8) {
      if ((char)local_2f8[1] == '\x13') {
        if (local_2f8 != (longlong *)0x0) goto LAB_140007ab7;
        break;
      }
    }
  }
  local_300 = (undefined8 *)0x0;
  local_2f8 = plVar20;
LAB_140007ab7:
  if ((local_2f8 != (longlong *)0x0) &&
     (puVar31 = (undefined8 *)local_2f8[2], puVar31 != (undefined8 *)local_2f8[3])) {
    local_128 = *puVar31;
    FUN_140001700(&local_120,puVar31 + 1,0,0xffffffffffffffff);
    FUN_140001700(&local_f8,puVar31 + 6,0,0xffffffffffffffff);
    plVar16 = plVar20;
    if (puVar33 != (undefined8 *)0x0) {
      plVar16 = (longlong *)*puVar33;
    }
    FUN_140024100(plVar16,&local_128);
    plVar16 = plVar20;
    if (puVar33 != (undefined8 *)0x0) {
      plVar16 = (longlong *)*puVar33;
    }
    FUN_140023be0(plVar16);
  }
  if (7 < local_e0) {
    operator_delete((void *)CONCAT62(uStack_f6,local_f8));
  }
  local_e0 = 7;
  local_e8 = 0;
  local_f8 = 0;
  if (7 < local_108) {
    operator_delete((void *)CONCAT62(uStack_11e,local_120));
  }
  local_108 = 7;
  local_110 = 0;
  local_120 = 0;
  local_330 = (longlong *)0x0;
  local_328 = (longlong *)0x0;
  plVar17 = operator_new(0x20);
  plVar16 = plVar20;
  if (plVar17 != (longlong *)0x0) {
    *plVar17 = 0;
    plVar17[1] = 0;
    plVar17[2] = 0;
    plVar16 = plVar17;
  }
  local_2f0 = plVar16;
  FUN_14000be70(&local_2e8,plVar16);
  FUN_14000c190(&local_2f0,plVar16,plVar16);
  if (local_2e8 != (longlong *)0x0) {
    LOCK();
    *(int *)(local_2e8 + 1) = (int)local_2e8[1] + 1;
    UNLOCK();
    local_368 = local_3e8;
    local_390 = local_3e0;
    local_370 = local_3d8;
    local_3a8 = local_3c8;
    local_378 = local_3a0;
    plVar15 = local_3e8;
    puVar33 = local_3a0;
  }
  local_380 = local_2f0;
  local_2e0 = 0;
  local_330 = local_2f0;
  local_328 = local_2e8;
  local_2d8 = 0;
  if (local_2e8 != (longlong *)0x0) {
    LOCK();
    plVar15 = local_2e8 + 1;
    *(int *)plVar15 = (int)*plVar15 + -1;
    UNLOCK();
    if ((int)*plVar15 == 0) {
      (**(code **)(*local_2e8 + 8))(local_2e8);
      LOCK();
      piVar1 = (int *)((longlong)local_2e8 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_2e8 + 0x10))(local_2e8);
      }
    }
    local_378 = local_3a0;
    local_3a8 = local_3c8;
    local_370 = local_3d8;
    local_390 = local_3e0;
    local_368 = local_3e8;
    plVar15 = local_3e8;
    puVar33 = local_3a0;
  }
  plVar17 = local_380;
  plVar16 = local_3b8;
  local_3b8[0x30] = (longlong)local_380;
  local_3c0[0] = 0;
  local_350 = local_328;
  if ((local_3b8[0x2d] - local_3b8[0x2c]) / 0x58 != 0) {
    local_3d0 = (longlong *)0x0;
    plVar18 = plVar20;
    do {
      local_260 = 7;
      local_268 = 0;
      local_278 = 0;
      psVar25 = (short *)(DAT_140320138 + 0x30);
      if (7 < *(ulonglong *)(DAT_140320138 + 0x48)) {
        psVar25 = *(short **)psVar25;
      }
      uVar21 = 0xffffffffffffffff;
      psVar28 = psVar25;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar3 = *psVar28;
        psVar28 = psVar28 + 1;
      } while (sVar3 != 0);
      FUN_140001b00(&local_278,psVar25,~uVar21 - 1);
      iVar12 = FUN_14000c630(&local_278,(longlong)plVar18 * 0x58 + 0x30 + plVar16[0x2c]);
      plVar15 = local_3d0;
      if ((iVar12 != 0) ||
         (*(int *)(DAT_140320138 + 0x80) != *(int *)((longlong)local_3d0 + plVar16[0x2c] + 4))) {
        FUN_140022a70(plVar17,(longlong)plVar18 * 0x58 + plVar16[0x2c]);
      }
      if (7 < local_260) {
        operator_delete((void *)CONCAT62(uStack_276,local_278));
      }
      local_278 = 0;
      local_268 = 0;
      local_260 = 7;
      local_3c0[0] = local_3c0[0] + 1;
      local_3d0 = plVar15 + 0xb;
      plVar18 = (longlong *)(ulonglong)local_3c0[0];
      plVar15 = local_368;
      puVar33 = local_378;
    } while (plVar18 < (longlong *)((plVar16[0x2d] - plVar16[0x2c]) / 0x58));
  }
  plVar16 = local_3b8;
  FUN_140022c30(local_380);
  *(longlong *)(plVar16[0x21] + 0x140) = plVar16[0x1d];
  *(longlong *)(plVar16[0x21] + 0x148) = plVar16[0x1e];
  *(longlong *)(plVar16[0x21] + 0x150) = plVar16[0x1f];
  *(longlong *)(plVar16[0x21] + 0x158) = plVar16[0x20];
  *(longlong *)(plVar16[0x22] + 0x200) = plVar16[0x1d];
  *(longlong *)(plVar16[0x22] + 0x208) = plVar16[0x1e];
  *(longlong *)(plVar16[0x22] + 0x210) = plVar16[0x1f];
  *(longlong *)(plVar16[0x22] + 0x218) = plVar16[0x20];
  plVar17 = plVar20;
  if (local_3b0 != (longlong *)0x0) {
    plVar17 = (longlong *)*local_3b0;
  }
  FUN_14001fd70(plVar17);
  plVar17 = plVar20;
  if (plVar15 != (longlong *)0x0) {
    plVar17 = (longlong *)*plVar15;
  }
  FUN_14000ecc0(plVar17);
  plVar17 = plVar20;
  if (plVar15 != (longlong *)0x0) {
    plVar17 = (longlong *)*plVar15;
  }
  plVar17[0x44] = plVar16[0x2a];
  plVar17 = plVar20;
  if (plVar15 != (longlong *)0x0) {
    plVar17 = (longlong *)*plVar15;
  }
  plVar17[0x45] = plVar16[0x2b];
  FUN_140025b40(&DAT_140272810);
  FUN_140025b40(L"# Gateway Server Running... #\n");
  pvVar19 = operator_new(0x18);
  plVar17 = plVar20;
  if (pvVar19 != (void *)0x0) {
    plVar17 = (longlong *)FUN_1401e1f60(pvVar19);
  }
  FUN_1401e1fc0(DAT_140320128,plVar17,0x3ff0000000000000);
  local_3d0 = operator_new(0x28);
  if (local_3d0 != (void *)0x0) {
    plVar20 = (longlong *)FUN_1401e1ed0(local_3d0,DAT_140320128);
  }
  plVar17 = local_358;
  plVar16[0x23] = (longlong)plVar20;
  uVar10 = 0;
  uVar35 = 0;
  plVar16 = plVar16 + 0x1d;
  lVar30 = 4;
  do {
    lVar29 = 0;
    lVar22 = (longlong)DAT_14031fed8;
    local_3d0 = plVar16;
    if (0 < lVar22) {
      do {
        FUN_140001d00(plVar17,*(undefined8 *)(*(longlong *)(*plVar16 + 8) + lVar29 * 8));
        lVar29 = lVar29 + 1;
      } while (lVar29 < lVar22);
    }
    plVar18 = local_358;
    puVar31 = local_370;
    plVar20 = local_3b8;
    lVar22 = 0;
    plVar16 = local_3d0 + 1;
    lVar30 = lVar30 + -1;
  } while (lVar30 != 0);
  iVar12 = 0;
  local_3d0 = plVar16;
  if (0 < (int)(((longlong *)local_3b8[0x30])[1] - *(longlong *)local_3b8[0x30] >> 3)) {
    local_3d0 = (longlong *)0x0;
    do {
      plVar16 = (longlong *)plVar20[0x30];
      lVar30 = *plVar16;
      lVar29 = lVar22;
      if (iVar12 < (int)(plVar16[1] - lVar30 >> 3)) {
        lVar29 = *(longlong *)(lVar30 + (longlong)local_3d0);
      }
      FUN_140001d00(plVar18,lVar29);
      iVar12 = iVar12 + 1;
      local_3d0 = local_3d0 + 1;
      plVar16 = (longlong *)plVar20[0x30];
    } while (iVar12 < (int)(plVar16[1] - *plVar16 >> 3));
  }
  puVar27 = local_390;
  puVar32 = local_3a8;
  plVar20 = local_3b8;
  FUN_140001d00(local_3b8 + 1,local_3b8[7]);
  local_3c0[0] = 5;
  *(undefined4 *)(plVar20 + 2) = 5;
  if (DAT_14031fe84 != 0) {
    printf("********************************\n");
    DVar13 = timeGetTime();
    printf("** Server Load Time : %u sec\n",(ulonglong)(DVar13 - DAT_14031fe84) / 1000);
    printf("********************************\n");
  }
  printf("STEP : SERVER_RUN \n");
  lVar30 = plVar20[7];
  uVar36 = uVar10;
  uVar38 = uVar10;
  uVar41 = uVar10;
  uVar37 = uVar35;
  uVar39 = uVar35;
  uVar43 = uVar35;
  plVar20 = local_3b8;
  plVar16 = local_398;
  if ((lVar30 != 0) && (*(char *)(lVar30 + 0x1a) != '\0')) {
    (**(code **)(*(longlong *)(lVar30 + 0x68) + 0xb0))
              ((longlong *)(lVar30 + 0x68),1,&DAT_14030ab90,local_3c0);
    plVar20 = local_3b8;
    plVar16 = local_398;
  }
  while ((plVar17 = local_398, local_398 = plVar16, DAT_14031fe98 == 0 &&
         (puVar27 = local_390, puVar31 = local_370, puVar32 = local_3a8, puVar33 = local_378,
         *(char *)(plVar20[0x22] + 0x30) == '\0'))) {
    if (*(char *)(plVar20[0x22] + 0x34) != '\0') {
      printf("Lock(Main) - Succeed\n");
      lVar30 = plVar20[7];
      if (lVar30 != 0) {
        printf("Server Lock Check Succeed !!!\n");
        plVar16 = (longlong *)(lVar30 + 0x68);
        (**(code **)(*plVar16 + 0x70))(plVar16,1,&DAT_14030ab90);
      }
      *(undefined1 *)(plVar20[0x22] + 0x34) = 0;
    }
    lVar30 = plVar20[0x22];
    if (*(char *)(lVar30 + 0x31) != '\0') {
      printf("User Kick !!\n");
      if (*(longlong **)(lVar30 + 0x40) != (longlong *)0x0) {
        (**(code **)(**(longlong **)(lVar30 + 0x40) + 0x80))();
      }
      bVar34 = *(char *)(lVar30 + 0x1f8) == '\0';
      *(bool *)(lVar30 + 0x1f8) = bVar34;
      pcVar23 = "Server Open !! \n";
      if (!bVar34) {
        pcVar23 = "Server Close !! \n";
      }
      printf(pcVar23);
      *(undefined1 *)(plVar20[0x22] + 0x31) = 0;
    }
    lVar30 = plVar20[0x22];
    if (*(char *)(lVar30 + 0x33) != '\0') {
      bVar34 = *(char *)(lVar30 + 0x1f8) == '\0';
      *(bool *)(lVar30 + 0x1f8) = bVar34;
      pcVar23 = "Server Open !! \n";
      if (!bVar34) {
        pcVar23 = "Server Close !! \n";
      }
      printf(pcVar23);
      *(undefined1 *)(plVar20[0x22] + 0x33) = 0;
    }
    FUN_1401e2320(DAT_140320128);
    dVar2 = *(double *)(plVar20[0x23] + 0x10);
    uVar40 = SUB84(dVar2,0);
    uVar42 = (undefined4)((ulonglong)dVar2 >> 0x20);
    if ((*(char *)(plVar20[0x22] + 0x80) != '\0') &&
       (30.0 <= dVar2 - (double)CONCAT44(uVar43,uVar41))) {
      (**(code **)(*plVar20 + 0xd0))(plVar20);
      uVar41 = uVar40;
      uVar43 = uVar42;
    }
    local_290 = "AgentSession->Process";
    DVar13 = timeGetTime();
    local_288 = DVar13;
    if ((plVar20[7] != 0) && (*(char *)(DAT_140320138 + 0x150) != '\0')) {
      FUN_140002570(plVar20[7],dVar2);
      if ((plVar20[7] != 0) &&
         ((*(char *)(plVar20[7] + 0x1a) != '\0' && ((double)plVar20[8] + 1.0 <= dVar2)))) {
        plVar20[8] = (longlong)dVar2;
        FUN_14008bd50(plVar20[7],*(undefined4 *)(plVar20[0x22] + 0x168),
                      *(undefined4 *)(plVar20[0x21] + 0x108),*(undefined1 *)(plVar20[0x22] + 0x1f8))
        ;
      }
      local_320 = (void *)0x0;
      local_318 = 0;
      local_310 = 0;
      FUN_14008bca0(plVar20[7],&local_320);
      uVar21 = 0;
      lVar30 = lVar22;
      if (local_318 - (longlong)local_320 >> 2 != 0) {
        do {
          iVar12 = (int)(local_358[3] - local_358[2] >> 3);
          if (0 < iVar12) {
            plVar20 = (longlong *)local_358[2];
            lVar29 = lVar22;
            do {
              if ((*plVar20 != 0) &&
                 (*(int *)(*plVar20 + 0x3c) == *(int *)(lVar30 + (longlong)local_320))) {
                *(undefined1 *)(((longlong *)local_358[2])[lVar29] + 0x1c) = 1;
                break;
              }
              lVar29 = lVar29 + 1;
              plVar20 = plVar20 + 1;
            } while (lVar29 < iVar12);
          }
          uVar21 = (ulonglong)((int)uVar21 + 1);
          lVar30 = lVar30 + 4;
          plVar20 = local_3b8;
          DVar13 = local_288;
        } while (uVar21 < (ulonglong)(local_318 - (longlong)local_320 >> 2));
      }
      if (local_320 != (void *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_320);
        operator_delete(local_320);
      }
      local_320 = (void *)0x0;
      local_318 = 0;
      local_310 = 0;
    }
    DVar14 = timeGetTime();
    if (0x32 < DVar14 - DVar13) {
      FUN_1401e4580(DAT_140320100,"% 9d [ ms ] %s\n",DVar14 - DVar13,"AgentSession->Process");
    }
    if ((*(char *)(**(longlong **)(*plVar17 + 8) + 0x1a) != '\0') &&
       (*(char *)((longlong)plVar20 + 0x14c) == '\0')) {
      *(longlong *)(**(longlong **)(*plVar17 + 8) + 0x90) = plVar20[0x2a];
      plVar16 = (longlong *)(**(longlong **)(*plVar17 + 8) + 0x68);
      (**(code **)(*plVar16 + 0x800))(plVar16,1,&DAT_14030ab90);
      plVar16 = (longlong *)(**(longlong **)(*plVar17 + 8) + 0x68);
      (**(code **)(*plVar16 + 0x810))(plVar16,1,&DAT_14030ab90);
      *(undefined1 *)((longlong)plVar20 + 0x14c) = 1;
    }
    FUN_140023a30(*plVar17,dVar2);
    FUN_140023a30(plVar20[0x1e],dVar2);
    if ((plVar20[0x2b] != 0) && (FUN_14008e100(), 60.0 <= dVar2 - (double)CONCAT44(uVar35,uVar10)))
    {
      if ((DAT_140320f5c & 1) == 0) {
        DAT_140320f5c = DAT_140320f5c | 1;
        FUN_1401e4310();
        atexit((_func_5014 *)&LAB_140202480);
      }
      uVar10 = uVar40;
      uVar35 = uVar42;
      if ((DAT_140320610 != 0xca) && (DAT_140320610 != 0x66)) {
        if ((DAT_140320f5c & 1) == 0) {
          DAT_140320f5c = DAT_140320f5c | 1;
          FUN_1401e4310();
          atexit((_func_5014 *)&LAB_140202480);
        }
        if (DAT_140320610 != 0xca) goto LAB_1400085d3;
      }
      FUN_140024730(plVar20[0x2b]);
    }
LAB_1400085d3:
    if (plVar20[0x30] != 0) {
      FUN_140022ec0(plVar20[0x30],dVar2);
    }
    if (DAT_14031fe97 != '\0') {
      printf("RetryConnectSession\n");
      iVar12 = (int)(plVar20[4] - plVar20[3] >> 3);
      lVar30 = lVar22;
      if (0 < iVar12) {
        do {
          if (*(longlong *)(plVar20[3] + lVar30 * 8) != 0) {
            *(undefined1 *)(*(longlong *)(plVar20[3] + lVar30 * 8) + 0x1c) = 1;
          }
          lVar30 = lVar30 + 1;
        } while (lVar30 < iVar12);
      }
      DAT_14031fe97 = DAT_14031fe97 == '\0';
    }
    if (DAT_14031fea4 != '\0') {
      printf("RetryConnectSession\n");
      iVar12 = (int)(plVar20[4] - plVar20[3] >> 3);
      lVar30 = lVar22;
      if (0 < iVar12) {
        do {
          if (*(longlong *)(plVar20[3] + lVar30 * 8) != 0) {
            *(undefined1 *)(*(longlong *)(plVar20[3] + lVar30 * 8) + 0x1c) = 0;
          }
          lVar30 = lVar30 + 1;
        } while (lVar30 < iVar12);
      }
      DAT_14031fea4 = DAT_14031fea4 == '\0';
    }
    if (0.03333333507180214 <= dVar2 - (double)CONCAT44(uVar37,uVar36)) {
      DAT_14031feac = DAT_14031feac + 1;
      FUN_140006260(plVar20);
      uVar36 = uVar40;
      uVar37 = uVar42;
    }
    (**(code **)(*(longlong *)plVar20[0x22] + 0x90))((longlong *)plVar20[0x22],dVar2,plVar20[0x26]);
    if (1.0 <= dVar2 - (double)CONCAT44(uVar39,uVar38)) {
      if (DAT_14031fea8 != 0) {
        if (plVar15 == (longlong *)0x0) {
          lVar30 = 0;
        }
        else {
          lVar30 = *plVar15;
        }
        printf("MaxFPS[%d], Connect[%d]\n",(ulonglong)(uint)DAT_14031feac,
               (ulonglong)*(uint *)(lVar30 + 0x168));
      }
      DAT_14031feb0 = DAT_14031feac;
      DAT_14031feac = 0;
      uVar38 = uVar40;
      uVar39 = uVar42;
    }
    if (DAT_14031fea0 != 0) {
      DAT_14031fea0 = 0;
      wprintf(L"-GATE SERVER [CODE:%d]---------------------------------\n",
              (ulonglong)*(uint *)(DAT_140320138 + 0x154));
      lVar30 = plVar20[0x21];
      puVar26 = *(undefined **)(lVar30 + 0x50);
      if (*(undefined **)(lVar30 + 0x50) == (undefined *)0x0) {
        puVar26 = PTR_DAT_1402f8010;
      }
      wprintf(L"PRIVATE NETWORK : ADDRESS[ %s ] PORT[ %d ]\n",puVar26,
              (ulonglong)*(uint *)(lVar30 + 0x58));
      if ((0 < *(int *)(lVar30 + 0x5c)) && (*(int *)(lVar30 + 0x60) != 0)) {
        wprintf(L"UDP : PORT [ %d ] COUNT [ %d ]\n");
      }
      lVar30 = plVar20[0x22];
      puVar26 = *(undefined **)(lVar30 + 0x48);
      if (*(undefined **)(lVar30 + 0x48) == (undefined *)0x0) {
        puVar26 = PTR_DAT_1402f8010;
      }
      wprintf(L"PUBLIC  NETWORK : ADDRESS[ %s ] PORT[ %d ]\n",puVar26,
              (ulonglong)*(uint *)(lVar30 + 0x50));
      if ((0 < *(int *)(lVar30 + 0x54)) && (*(int *)(lVar30 + 0x58) != 0)) {
        wprintf(L"UDP : PORT [ %d ] COUNT [ %d ]\n");
      }
      lVar30 = plVar20[0x2b];
      if (lVar30 != 0) {
        plVar16 = (longlong *)(lVar30 + 0x28);
        if (0xf < *(ulonglong *)(lVar30 + 0x40)) {
          plVar16 = (longlong *)*plVar16;
        }
        printf("API     NETWORK : ADDRESS[ %s ] PORT[ %d ] \n",plVar16,
               (ulonglong)*(uint *)(lVar30 + 0x50));
      }
      FUN_140001da0(plVar20 + 1);
    }
    plVar20[0x27] = (longlong)dVar2;
    Sleep(1);
    puVar33 = local_378;
    puVar32 = local_3a8;
    plVar16 = local_398;
    puVar27 = local_390;
    puVar31 = local_370;
    local_398 = plVar17;
  }
  FUN_140025c80(L"+ Prepare Stop\n");
  if (plVar15 == (longlong *)0x0) {
    lVar30 = 0;
  }
  else {
    lVar30 = *plVar15;
  }
  FUN_14000ef50(lVar30);
  FUN_140025c80(L"\t- UserIocp End\t\t\t\t: [ ok ]\n");
  if (local_3b0 == (longlong *)0x0) {
    lVar30 = 0;
  }
  else {
    lVar30 = *local_3b0;
  }
  puVar4 = *(undefined8 **)(lVar30 + 0x48);
  if (puVar4 != (undefined8 *)0x0) {
    (**(code **)*puVar4)(puVar4,1);
  }
  *(undefined8 *)(lVar30 + 0x48) = 0;
  FUN_140025c80(L"\t- GatewayIocp End\t\t\t: [ ok ]\n");
  Ordinal_116();
  FUN_140025c80(L"\t- Winsock2 DLL unloading\t: [ ok ]\n");
  CoUninitialize();
  FUN_140025b40(L"# Gateway Server Stoped... #\n");
  if (plVar15 != (longlong *)0x0) {
    lVar22 = *plVar15;
  }
  if (*(char *)(lVar22 + 0x30) == '\0') {
    FUN_140025c80(L"Press any key... \n");
    getchar();
  }
  plVar20 = local_328;
  if (local_350 != (longlong *)0x0) {
    LOCK();
    plVar16 = local_350 + 1;
    *(int *)plVar16 = (int)*plVar16 + -1;
    UNLOCK();
    plVar15 = local_3e8;
    puVar27 = local_3e0;
    puVar31 = local_3d8;
    puVar32 = local_3c8;
    puVar33 = local_3a0;
    if ((int)*plVar16 == 0) {
      (**(code **)(*local_328 + 8))(local_328);
      LOCK();
      piVar1 = (int *)((longlong)plVar20 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      plVar15 = local_3e8;
      puVar27 = local_3e0;
      puVar31 = local_3d8;
      puVar32 = local_3c8;
      puVar33 = local_3a0;
      if (*piVar1 == 0) {
        (**(code **)(*local_328 + 0x10))();
        plVar15 = local_3e8;
        puVar27 = local_3e0;
        puVar31 = local_3d8;
        puVar32 = local_3c8;
        puVar33 = local_3a0;
      }
    }
  }
  puVar4 = local_3a0;
  if (puVar33 != (undefined8 *)0x0) {
    plVar20 = puVar33 + 1;
    *plVar20 = *plVar20 + -1;
    plVar15 = local_3e8;
    puVar27 = local_3e0;
    puVar31 = local_3d8;
    puVar32 = local_3c8;
    if (*plVar20 == 0) {
      FUN_14000bb50(local_3a0);
      FUN_1400a3530(puVar4);
      plVar15 = local_3e8;
      puVar27 = local_3e0;
      puVar31 = local_3d8;
      puVar32 = local_3c8;
    }
  }
  puVar33 = local_3c8;
  if (puVar32 != (undefined8 *)0x0) {
    plVar20 = puVar32 + 1;
    *plVar20 = *plVar20 + -1;
    plVar15 = local_3e8;
    puVar27 = local_3e0;
    puVar31 = local_3d8;
    if (*plVar20 == 0) {
      FUN_14000bb50(local_3c8);
      FUN_1400a3530(puVar33);
      plVar15 = local_3e8;
      puVar27 = local_3e0;
      puVar31 = local_3d8;
    }
  }
  puVar32 = local_3d8;
  if (puVar31 != (undefined8 *)0x0) {
    plVar20 = puVar31 + 1;
    *plVar20 = *plVar20 + -1;
    plVar15 = local_3e8;
    puVar27 = local_3e0;
    if (*plVar20 == 0) {
      FUN_14000bb50(local_3d8);
      FUN_1400a3530(puVar32);
      plVar15 = local_3e8;
      puVar27 = local_3e0;
    }
  }
  puVar31 = local_3e0;
  if (puVar27 != (undefined8 *)0x0) {
    plVar20 = puVar27 + 1;
    *plVar20 = *plVar20 + -1;
    plVar15 = local_3e8;
    if (*plVar20 == 0) {
      FUN_14000bb50(local_3e0);
      FUN_1400a3530(puVar31);
      plVar15 = local_3e8;
    }
  }
  if (local_388 != (undefined8 *)0x0) {
    plVar20 = local_388 + 1;
    *plVar20 = *plVar20 + -1;
    plVar15 = local_3e8;
    if (*plVar20 == 0) {
      FUN_14000b2a0(local_388);
      plVar15 = local_3e8;
    }
  }
  FUN_14000aec0(&local_360);
  plVar20 = local_3e8;
  if (plVar15 != (longlong *)0x0) {
    plVar15 = plVar15 + 1;
    *plVar15 = *plVar15 + -1;
    if (*plVar15 == 0) {
      puVar31 = (undefined8 *)*local_3e8;
      if (puVar31 != (undefined8 *)0x0) {
        (**(code **)*puVar31)(puVar31,1);
      }
      FUN_1400a3530(plVar20);
    }
  }
LAB_140008a6c:
  plVar15 = local_3b0;
  if (local_3b0 != (longlong *)0x0) {
    plVar20 = local_3b0 + 1;
    *plVar20 = *plVar20 + -1;
    if (*plVar20 == 0) {
      puVar31 = (undefined8 *)*local_3b0;
      if (puVar31 != (undefined8 *)0x0) {
        (**(code **)*puVar31)(puVar31,1);
      }
      FUN_1400a3530(plVar15);
    }
  }
  return 0;
}



void FUN_140008b10(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  plVar3 = *(longlong **)(param_1 + 8);
  if (plVar3 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar3 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*plVar3 + 8))(plVar3);
      LOCK();
      piVar2 = (int *)((longlong)plVar3 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar3 + 0x10))(plVar3);
      }
    }
  }
  return;
}



void FUN_140008b50(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4,
                  undefined8 param_5,undefined2 param_6)

{
  int *piVar1;
  undefined *puVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  undefined8 uVar6;
  undefined *puVar7;
  longlong *plVar8;
  undefined2 local_res8 [4];
  undefined4 local_res20 [2];
  undefined *local_28;
  undefined8 local_20;
  undefined8 local_18;
  undefined1 local_10;
  
  local_20 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0xe8) != 0) {
    local_res8[0] = param_6;
    local_res20[0] = param_4;
    FUN_1400a3440();
    local_28 = PTR_DAT_1402f8008;
    iVar3 = FUN_1400a3360(param_5);
    if (local_28 == (undefined *)0x0) {
      iVar5 = 0;
    }
    else if (local_28 == PTR_DAT_1402f8008) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(local_28 + -8);
    }
    iVar4 = iVar3;
    if (iVar3 <= iVar5) {
      if (local_28 == (undefined *)0x0) {
        iVar4 = 0;
      }
      else if (local_28 == PTR_DAT_1402f8008) {
        iVar4 = 0;
      }
      else {
        iVar4 = *(int *)(local_28 + -8);
      }
    }
    iVar5 = 1;
    if (1 < iVar4) {
      iVar5 = iVar4;
    }
    if (local_28 == (undefined *)0x0) {
      iVar4 = 0;
    }
    else if (local_28 == PTR_DAT_1402f8008) {
      iVar4 = 0;
    }
    else {
      iVar4 = *(int *)(local_28 + -8);
    }
    if (iVar4 < iVar5) {
      FUN_14000c1c0(&local_28);
    }
    FUN_14000c330(&local_28);
    puVar7 = local_28;
    if (local_28 == (undefined *)0x0) {
      puVar7 = PTR_DAT_1402f8008;
    }
    FUN_1400a3390(puVar7,param_5,iVar3);
    iVar5 = FUN_1400a3360();
    iVar3 = 0;
    if (0 < iVar5) {
      iVar3 = iVar5;
    }
    if (local_28 == (undefined *)0x0) {
      iVar5 = 0;
    }
    else if (local_28 == PTR_DAT_1402f8008) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(local_28 + -8);
    }
    if (iVar5 <= iVar3) {
      if (local_28 == (undefined *)0x0) {
        iVar3 = 0;
      }
      else if (local_28 == PTR_DAT_1402f8008) {
        iVar3 = 0;
      }
      else {
        iVar3 = *(int *)(local_28 + -8);
      }
    }
    if (((local_28 != PTR_DAT_1402f8008) && (local_28 != (undefined *)0x0)) &&
       (piVar1 = (int *)(local_28 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar3;
      *(undefined1 *)((longlong)iVar3 + 8 + (longlong)piVar1) = 0;
    }
    plVar8 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0xe8) + 8) + 0x68);
    (**(code **)(*plVar8 + 0x1030))(plVar8,1,&DAT_14030ab90,local_res20,&local_28,local_res8);
    puVar7 = local_28;
    if (((local_28 != (undefined *)0x0) && (local_28 != PTR_DAT_1402f8008)) &&
       (puVar2 = local_28 + -8, puVar2 != (undefined *)0x0)) {
      uVar6 = FUN_1400a3440();
      local_18 = uVar6;
      FUN_1400a1c30(uVar6);
      local_10 = 1;
      piVar1 = (int *)(puVar7 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar2);
      }
      FUN_1400d1290(uVar6);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140008d50(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4,
                  undefined8 param_5,undefined2 param_6,undefined8 param_7,undefined8 param_8,
                  char *param_9,char *param_10,char *param_11)

{
  int *piVar1;
  undefined *puVar2;
  char cVar3;
  char *pcVar4;
  char *pcVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  int iVar10;
  undefined8 uVar11;
  longlong lVar12;
  longlong *plVar13;
  undefined *puVar14;
  undefined1 *puVar15;
  char *pcVar16;
  char *pcVar17;
  undefined1 auStack_178 [32];
  undefined **local_158;
  undefined2 *local_150;
  undefined **local_148;
  undefined1 *local_140;
  undefined **local_138;
  undefined **local_130;
  undefined **local_128;
  undefined *local_118;
  undefined *local_110;
  undefined *local_108;
  undefined *local_100;
  undefined *local_f8;
  undefined2 local_f0 [4];
  undefined8 local_e8;
  undefined1 local_e0;
  undefined2 local_d8 [2];
  undefined4 local_d4;
  undefined4 local_d0;
  undefined8 local_c8;
  undefined1 local_c0;
  undefined7 uStack_bf;
  undefined8 local_b0;
  ulonglong local_a8;
  undefined1 local_98;
  undefined7 uStack_97;
  undefined8 local_88;
  ulonglong local_80;
  undefined1 local_70;
  undefined7 uStack_6f;
  undefined8 local_60;
  ulonglong local_58;
  ulonglong local_48;
  
  pcVar5 = param_11;
  pcVar4 = param_10;
  pcVar17 = param_9;
  local_c8 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_178;
  local_58 = 0xf;
  local_60 = 0;
  local_70 = 0;
  local_d4 = param_4;
  local_d0 = param_3;
  FUN_140003e60(&local_70,"00-00-00-00-00-00",0x11);
  local_80 = 0xf;
  local_88 = 0;
  local_98 = 0;
  FUN_140003e60(&local_98,"00-00-00-00-00-00",0x11);
  local_a8 = 0xf;
  local_b0 = 0;
  local_c0 = 0;
  FUN_140003e60(&local_c0,"00-00-00-00-00-00");
  if (pcVar17 != (char *)0x0) {
    lVar12 = -1;
    pcVar16 = pcVar17;
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      cVar3 = *pcVar16;
      pcVar16 = pcVar16 + 1;
    } while (cVar3 != '\0');
    FUN_140003e60(&local_70,pcVar17);
  }
  if (pcVar4 != (char *)0x0) {
    lVar12 = -1;
    pcVar17 = pcVar4;
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      cVar3 = *pcVar17;
      pcVar17 = pcVar17 + 1;
    } while (cVar3 != '\0');
    FUN_140003e60(&local_98,pcVar4);
  }
  if (pcVar5 != (char *)0x0) {
    lVar12 = -1;
    pcVar17 = pcVar5;
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      cVar3 = *pcVar17;
      pcVar17 = pcVar17 + 1;
    } while (cVar3 != '\0');
    FUN_140003e60(&local_c0,pcVar5);
  }
  if (*(longlong *)(param_1 + 0xe8) != 0) {
    puVar15 = &local_c0;
    if (0xf < local_a8) {
      puVar15 = (undefined1 *)CONCAT71(uStack_bf,local_c0);
    }
    FUN_1400a3440();
    local_f8 = PTR_DAT_1402f8008;
    iVar6 = FUN_1400a3360(puVar15);
    if (local_f8 == (undefined *)0x0) {
      iVar8 = 0;
    }
    else if (local_f8 == PTR_DAT_1402f8008) {
      iVar8 = 0;
    }
    else {
      iVar8 = *(int *)(local_f8 + -8);
    }
    iVar7 = iVar6;
    if (iVar6 <= iVar8) {
      if (local_f8 == (undefined *)0x0) {
        iVar7 = 0;
      }
      else if (local_f8 == PTR_DAT_1402f8008) {
        iVar7 = 0;
      }
      else {
        iVar7 = *(int *)(local_f8 + -8);
      }
    }
    iVar8 = 1;
    if (1 < iVar7) {
      iVar8 = iVar7;
    }
    if (local_f8 == (undefined *)0x0) {
      iVar7 = 0;
    }
    else if (local_f8 == PTR_DAT_1402f8008) {
      iVar7 = 0;
    }
    else {
      iVar7 = *(int *)(local_f8 + -8);
    }
    if (iVar7 < iVar8) {
      FUN_14000c1c0(&local_f8);
    }
    FUN_14000c330(&local_f8);
    puVar14 = local_f8;
    if (local_f8 == (undefined *)0x0) {
      puVar14 = PTR_DAT_1402f8008;
    }
    FUN_1400a3390(puVar14,puVar15,iVar6);
    iVar8 = FUN_1400a3360();
    iVar6 = 0;
    if (0 < iVar8) {
      iVar6 = iVar8;
    }
    if (local_f8 == (undefined *)0x0) {
      iVar8 = 0;
    }
    else if (local_f8 == PTR_DAT_1402f8008) {
      iVar8 = 0;
    }
    else {
      iVar8 = *(int *)(local_f8 + -8);
    }
    if (iVar8 <= iVar6) {
      if (local_f8 == (undefined *)0x0) {
        iVar6 = 0;
      }
      else if (local_f8 == PTR_DAT_1402f8008) {
        iVar6 = 0;
      }
      else {
        iVar6 = *(int *)(local_f8 + -8);
      }
    }
    if (((local_f8 != PTR_DAT_1402f8008) && (local_f8 != (undefined *)0x0)) &&
       (piVar1 = (int *)(local_f8 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar6;
      *(undefined1 *)((longlong)iVar6 + 8 + (longlong)piVar1) = 0;
    }
    puVar15 = &local_98;
    if (0xf < local_80) {
      puVar15 = (undefined1 *)CONCAT71(uStack_97,local_98);
    }
    FUN_1400a3440();
    local_110 = PTR_DAT_1402f8008;
    iVar6 = FUN_1400a3360(puVar15);
    if (local_110 == (undefined *)0x0) {
      iVar8 = 0;
    }
    else if (local_110 == PTR_DAT_1402f8008) {
      iVar8 = 0;
    }
    else {
      iVar8 = *(int *)(local_110 + -8);
    }
    iVar7 = iVar6;
    if (iVar6 <= iVar8) {
      if (local_110 == (undefined *)0x0) {
        iVar7 = 0;
      }
      else if (local_110 == PTR_DAT_1402f8008) {
        iVar7 = 0;
      }
      else {
        iVar7 = *(int *)(local_110 + -8);
      }
    }
    iVar8 = 1;
    if (1 < iVar7) {
      iVar8 = iVar7;
    }
    if (local_110 == (undefined *)0x0) {
      iVar7 = 0;
    }
    else if (local_110 == PTR_DAT_1402f8008) {
      iVar7 = 0;
    }
    else {
      iVar7 = *(int *)(local_110 + -8);
    }
    if (iVar7 < iVar8) {
      FUN_14000c1c0(&local_110);
    }
    FUN_14000c330(&local_110);
    puVar14 = local_110;
    if (local_110 == (undefined *)0x0) {
      puVar14 = PTR_DAT_1402f8008;
    }
    FUN_1400a3390(puVar14,puVar15,iVar6);
    iVar8 = FUN_1400a3360();
    iVar6 = 0;
    if (0 < iVar8) {
      iVar6 = iVar8;
    }
    if (local_110 == (undefined *)0x0) {
      iVar8 = 0;
    }
    else if (local_110 == PTR_DAT_1402f8008) {
      iVar8 = 0;
    }
    else {
      iVar8 = *(int *)(local_110 + -8);
    }
    if (iVar8 <= iVar6) {
      if (local_110 == (undefined *)0x0) {
        iVar6 = 0;
      }
      else if (local_110 == PTR_DAT_1402f8008) {
        iVar6 = 0;
      }
      else {
        iVar6 = *(int *)(local_110 + -8);
      }
    }
    if (((local_110 != PTR_DAT_1402f8008) && (local_110 != (undefined *)0x0)) &&
       (piVar1 = (int *)(local_110 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar6;
      *(undefined1 *)((longlong)iVar6 + 8 + (longlong)piVar1) = 0;
    }
    puVar15 = &local_70;
    if (0xf < local_58) {
      puVar15 = (undefined1 *)CONCAT71(uStack_6f,local_70);
    }
    FUN_1400a3440();
    local_118 = PTR_DAT_1402f8008;
    iVar6 = FUN_1400a3360(puVar15);
    if (local_118 == (undefined *)0x0) {
      iVar8 = 0;
    }
    else if (local_118 == PTR_DAT_1402f8008) {
      iVar8 = 0;
    }
    else {
      iVar8 = *(int *)(local_118 + -8);
    }
    iVar7 = iVar6;
    if (iVar6 <= iVar8) {
      if (local_118 == (undefined *)0x0) {
        iVar7 = 0;
      }
      else if (local_118 == PTR_DAT_1402f8008) {
        iVar7 = 0;
      }
      else {
        iVar7 = *(int *)(local_118 + -8);
      }
    }
    iVar8 = 1;
    if (1 < iVar7) {
      iVar8 = iVar7;
    }
    if (local_118 == (undefined *)0x0) {
      iVar7 = 0;
    }
    else if (local_118 == PTR_DAT_1402f8008) {
      iVar7 = 0;
    }
    else {
      iVar7 = *(int *)(local_118 + -8);
    }
    if (iVar7 < iVar8) {
      FUN_14000c1c0(&local_118);
    }
    FUN_14000c330(&local_118);
    puVar14 = local_118;
    if (local_118 == (undefined *)0x0) {
      puVar14 = PTR_DAT_1402f8008;
    }
    FUN_1400a3390(puVar14,puVar15,iVar6);
    puVar14 = local_118;
    if (local_118 == (undefined *)0x0) {
      puVar14 = PTR_DAT_1402f8008;
    }
    iVar7 = FUN_1400a3360(puVar14);
    iVar8 = 0;
    iVar6 = 0;
    if (0 < iVar7) {
      iVar6 = iVar7;
    }
    iVar7 = 0;
    if ((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1402f8008)) {
      iVar7 = *(int *)(local_118 + -8);
    }
    if ((iVar6 < iVar7) || (iVar6 = 0, local_118 == (undefined *)0x0)) {
LAB_1400091ed:
      if (((local_118 != PTR_DAT_1402f8008) && (local_118 != (undefined *)0x0)) &&
         (piVar1 = (int *)(local_118 + -8), piVar1 != (int *)0x0)) {
        *piVar1 = iVar6;
        *(undefined1 *)((longlong)iVar6 + 8 + (longlong)piVar1) = 0;
      }
    }
    else if (local_118 != PTR_DAT_1402f8008) {
      iVar6 = *(int *)(local_118 + -8);
      goto LAB_1400091ed;
    }
    FUN_1400a3440();
    local_108 = PTR_DAT_1402f8010;
    iVar7 = FUN_1400a32c0(param_7);
    iVar6 = iVar8;
    if ((local_108 != (undefined *)0x0) && (iVar6 = 0, local_108 != PTR_DAT_1402f8010)) {
      iVar6 = *(int *)(local_108 + -8);
    }
    iVar9 = iVar7;
    if (((iVar7 <= iVar6) && (iVar9 = 0, local_108 != (undefined *)0x0)) &&
       (local_108 != PTR_DAT_1402f8010)) {
      iVar9 = *(int *)(local_108 + -8);
    }
    iVar6 = 1;
    if (1 < iVar9) {
      iVar6 = iVar9;
    }
    iVar9 = iVar8;
    if ((local_108 != (undefined *)0x0) && (iVar9 = 0, local_108 != PTR_DAT_1402f8010)) {
      iVar9 = *(int *)(local_108 + -8);
    }
    if (iVar9 < iVar6) {
      FUN_140002d50(&local_108);
    }
    FUN_140002e30(&local_108);
    puVar14 = local_108;
    if (local_108 == (undefined *)0x0) {
      puVar14 = PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar14,param_7,iVar7);
    puVar14 = local_108;
    if (local_108 == (undefined *)0x0) {
      puVar14 = PTR_DAT_1402f8010;
    }
    iVar7 = FUN_1400a32c0(puVar14);
    iVar6 = 0;
    if (0 < iVar7) {
      iVar6 = iVar7;
    }
    iVar7 = 0;
    if ((local_108 != (undefined *)0x0) && (local_108 != PTR_DAT_1402f8010)) {
      iVar7 = *(int *)(local_108 + -8);
    }
    if ((iVar6 < iVar7) || (iVar6 = 0, local_108 == (undefined *)0x0)) {
LAB_1400092e9:
      if (((local_108 != PTR_DAT_1402f8010) && (local_108 != (undefined *)0x0)) &&
         ((int *)(local_108 + -8) != (int *)0x0)) {
        *(int *)(local_108 + -8) = iVar6;
        *(undefined2 *)(local_108 + (longlong)iVar6 * 2) = 0;
      }
    }
    else if (local_108 != PTR_DAT_1402f8010) {
      iVar6 = *(int *)(local_108 + -8);
      goto LAB_1400092e9;
    }
    local_f0[0] = param_6;
    FUN_1400a3440();
    local_100 = PTR_DAT_1402f8008;
    iVar7 = FUN_1400a3360(param_5);
    iVar6 = iVar8;
    if ((local_100 != (undefined *)0x0) && (iVar6 = 0, local_100 != PTR_DAT_1402f8008)) {
      iVar6 = *(int *)(local_100 + -8);
    }
    iVar9 = iVar7;
    if (((iVar7 <= iVar6) && (iVar9 = 0, local_100 != (undefined *)0x0)) &&
       (local_100 != PTR_DAT_1402f8008)) {
      iVar9 = *(int *)(local_100 + -8);
    }
    iVar6 = 1;
    if (1 < iVar9) {
      iVar6 = iVar9;
    }
    iVar9 = iVar8;
    if ((local_100 != (undefined *)0x0) && (iVar9 = 0, local_100 != PTR_DAT_1402f8008)) {
      iVar9 = *(int *)(local_100 + -8);
    }
    if (iVar9 < iVar6) {
      FUN_14000c1c0(&local_100);
    }
    FUN_14000c330(&local_100);
    puVar14 = local_100;
    if (local_100 == (undefined *)0x0) {
      puVar14 = PTR_DAT_1402f8008;
    }
    FUN_1400a3390(puVar14,param_5,iVar7);
    puVar14 = local_100;
    if (local_100 == (undefined *)0x0) {
      puVar14 = PTR_DAT_1402f8008;
    }
    iVar7 = FUN_1400a3360(puVar14);
    iVar6 = iVar8;
    if (0 < iVar7) {
      iVar6 = iVar7;
    }
    if ((local_100 != (undefined *)0x0) && (iVar8 = 0, local_100 != PTR_DAT_1402f8008)) {
      iVar8 = *(int *)(local_100 + -8);
    }
    if ((iVar6 < iVar8) || (iVar6 = 0, local_100 == (undefined *)0x0)) {
LAB_1400093ea:
      if (((local_100 != PTR_DAT_1402f8008) && (local_100 != (undefined *)0x0)) &&
         (piVar1 = (int *)(local_100 + -8), piVar1 != (int *)0x0)) {
        *piVar1 = iVar6;
        *(undefined1 *)((longlong)iVar6 + 8 + (longlong)piVar1) = 0;
      }
    }
    else if (local_100 != PTR_DAT_1402f8008) {
      iVar6 = *(int *)(local_100 + -8);
      goto LAB_1400093ea;
    }
    plVar13 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0xe8) + 8) + 0x68);
    local_128 = &local_f8;
    local_130 = &local_110;
    local_138 = &local_118;
    local_140 = (undefined1 *)&param_8;
    local_148 = &local_108;
    local_150 = local_f0;
    local_158 = &local_100;
    (**(code **)(*plVar13 + 0x30))(plVar13,1,&DAT_14030ab90,&local_d4);
    puVar14 = local_100;
    if (((local_100 != (undefined *)0x0) && (local_100 != PTR_DAT_1402f8008)) &&
       (puVar2 = local_100 + -8, puVar2 != (undefined *)0x0)) {
      uVar11 = FUN_1400a3440();
      local_e8 = uVar11;
      FUN_1400a1c30(uVar11);
      local_e0 = 1;
      piVar1 = (int *)(puVar14 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar2);
      }
      FUN_1400d1290(uVar11);
    }
    puVar14 = local_108;
    local_100 = PTR_DAT_1402f8008;
    if (((local_108 != (undefined *)0x0) && (local_108 != PTR_DAT_1402f8010)) &&
       (puVar2 = local_108 + -8, puVar2 != (undefined *)0x0)) {
      uVar11 = FUN_1400a3440();
      local_e8 = uVar11;
      FUN_1400a1c30(uVar11);
      local_e0 = 1;
      piVar1 = (int *)(puVar14 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar2);
      }
      FUN_1400d1290(uVar11);
    }
    puVar14 = local_118;
    local_108 = PTR_DAT_1402f8010;
    if (((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1402f8008)) &&
       (puVar2 = local_118 + -8, puVar2 != (undefined *)0x0)) {
      uVar11 = FUN_1400a3440();
      local_e8 = uVar11;
      FUN_1400a1c30(uVar11);
      local_e0 = 1;
      piVar1 = (int *)(puVar14 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar2);
      }
      FUN_1400d1290(uVar11);
    }
    puVar14 = local_110;
    local_118 = PTR_DAT_1402f8008;
    if (((local_110 != (undefined *)0x0) && (local_110 != PTR_DAT_1402f8008)) &&
       (puVar2 = local_110 + -8, puVar2 != (undefined *)0x0)) {
      uVar11 = FUN_1400a3440();
      local_e8 = uVar11;
      FUN_1400a1c30(uVar11);
      local_e0 = 1;
      piVar1 = (int *)(puVar14 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar2);
      }
      FUN_1400d1290(uVar11);
    }
    puVar14 = local_f8;
    local_110 = PTR_DAT_1402f8008;
    if (((local_f8 != (undefined *)0x0) && (local_f8 != PTR_DAT_1402f8008)) &&
       (puVar2 = local_f8 + -8, puVar2 != (undefined *)0x0)) {
      uVar11 = FUN_1400a3440();
      local_e8 = uVar11;
      FUN_1400a1c30(uVar11);
      local_e0 = 1;
      piVar1 = (int *)(puVar14 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar2);
      }
      FUN_1400d1290(uVar11);
    }
  }
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320610 != 1000) {
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if ((DAT_140320610 != 0xcb) && (DAT_140320610 != 0x67)) goto LAB_140009de3;
  }
  if (*(longlong *)(param_1 + 0xf0) == 0) goto LAB_140009de3;
  puVar15 = &local_c0;
  if (0xf < local_a8) {
    puVar15 = (undefined1 *)CONCAT71(uStack_bf,local_c0);
  }
  FUN_1400a3440();
  local_f8 = PTR_DAT_1402f8008;
  iVar8 = FUN_1400a3360(puVar15);
  iVar7 = 0;
  iVar6 = iVar7;
  if ((local_f8 != (undefined *)0x0) && (local_f8 != PTR_DAT_1402f8008)) {
    iVar6 = *(int *)(local_f8 + -8);
  }
  iVar9 = 0;
  if (((iVar8 <= iVar6) && (iVar8 = iVar7, local_f8 != (undefined *)0x0)) &&
     (iVar8 = iVar9, local_f8 != PTR_DAT_1402f8008)) {
    iVar8 = *(int *)(local_f8 + -8);
  }
  iVar6 = 1;
  if (1 < iVar8) {
    iVar6 = iVar8;
  }
  if ((local_f8 != (undefined *)0x0) && (local_f8 != PTR_DAT_1402f8008)) {
    iVar9 = *(int *)(local_f8 + -8);
  }
  if (iVar9 < iVar6) {
    FUN_14000c1c0(&local_f8);
  }
  FUN_14000c330(&local_f8);
  puVar14 = local_f8;
  if (local_f8 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar14,puVar15);
  puVar14 = local_f8;
  if (local_f8 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8008;
  }
  iVar8 = FUN_1400a3360(puVar14);
  iVar7 = 0;
  iVar6 = iVar7;
  if (0 < iVar8) {
    iVar6 = iVar8;
  }
  iVar8 = iVar7;
  if ((local_f8 != (undefined *)0x0) && (iVar8 = 0, local_f8 != PTR_DAT_1402f8008)) {
    iVar8 = *(int *)(local_f8 + -8);
  }
  if ((iVar6 < iVar8) || (iVar6 = iVar7, local_f8 == (undefined *)0x0)) {
LAB_140009788:
    if (((local_f8 != PTR_DAT_1402f8008) && (local_f8 != (undefined *)0x0)) &&
       (piVar1 = (int *)(local_f8 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar6;
      *(undefined1 *)((longlong)iVar6 + 8 + (longlong)piVar1) = 0;
    }
  }
  else if (local_f8 != PTR_DAT_1402f8008) {
    iVar6 = *(int *)(local_f8 + -8);
    goto LAB_140009788;
  }
  puVar15 = &local_98;
  if (0xf < local_80) {
    puVar15 = (undefined1 *)CONCAT71(uStack_97,local_98);
  }
  FUN_1400a3440();
  local_100 = PTR_DAT_1402f8008;
  iVar8 = FUN_1400a3360(puVar15);
  iVar7 = 0;
  iVar6 = iVar7;
  if ((local_100 != (undefined *)0x0) && (local_100 != PTR_DAT_1402f8008)) {
    iVar6 = *(int *)(local_100 + -8);
  }
  iVar9 = 0;
  if (((iVar8 <= iVar6) && (iVar8 = iVar7, local_100 != (undefined *)0x0)) &&
     (iVar8 = iVar9, local_100 != PTR_DAT_1402f8008)) {
    iVar8 = *(int *)(local_100 + -8);
  }
  iVar6 = 1;
  if (1 < iVar8) {
    iVar6 = iVar8;
  }
  if ((local_100 != (undefined *)0x0) && (local_100 != PTR_DAT_1402f8008)) {
    iVar9 = *(int *)(local_100 + -8);
  }
  if (iVar9 < iVar6) {
    FUN_14000c1c0(&local_100);
  }
  FUN_14000c330(&local_100);
  puVar14 = local_100;
  if (local_100 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar14,puVar15);
  puVar14 = local_100;
  if (local_100 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8008;
  }
  iVar8 = FUN_1400a3360(puVar14);
  iVar7 = 0;
  iVar6 = iVar7;
  if (0 < iVar8) {
    iVar6 = iVar8;
  }
  iVar8 = iVar7;
  if ((local_100 != (undefined *)0x0) && (iVar8 = 0, local_100 != PTR_DAT_1402f8008)) {
    iVar8 = *(int *)(local_100 + -8);
  }
  if ((iVar6 < iVar8) || (iVar6 = iVar7, local_100 == (undefined *)0x0)) {
LAB_14000989e:
    if (((local_100 != PTR_DAT_1402f8008) && (local_100 != (undefined *)0x0)) &&
       (piVar1 = (int *)(local_100 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar6;
      *(undefined1 *)((longlong)iVar6 + 8 + (longlong)piVar1) = 0;
    }
  }
  else if (local_100 != PTR_DAT_1402f8008) {
    iVar6 = *(int *)(local_100 + -8);
    goto LAB_14000989e;
  }
  puVar15 = &local_70;
  if (0xf < local_58) {
    puVar15 = (undefined1 *)CONCAT71(uStack_6f,local_70);
  }
  FUN_1400a3440();
  local_108 = PTR_DAT_1402f8008;
  iVar8 = FUN_1400a3360(puVar15);
  iVar7 = 0;
  iVar6 = iVar7;
  if ((local_108 != (undefined *)0x0) && (local_108 != PTR_DAT_1402f8008)) {
    iVar6 = *(int *)(local_108 + -8);
  }
  iVar10 = 0;
  iVar9 = iVar8;
  if (((iVar8 <= iVar6) && (iVar9 = iVar7, local_108 != (undefined *)0x0)) &&
     (iVar9 = iVar10, local_108 != PTR_DAT_1402f8008)) {
    iVar9 = *(int *)(local_108 + -8);
  }
  iVar6 = 1;
  if (1 < iVar9) {
    iVar6 = iVar9;
  }
  if ((local_108 != (undefined *)0x0) && (local_108 != PTR_DAT_1402f8008)) {
    iVar10 = *(int *)(local_108 + -8);
  }
  if (iVar10 < iVar6) {
    FUN_14000c1c0(&local_108);
  }
  FUN_14000c330(&local_108);
  puVar14 = local_108;
  if (local_108 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar14,puVar15,iVar8);
  puVar14 = local_108;
  if (local_108 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8008;
  }
  iVar7 = FUN_1400a3360(puVar14);
  iVar8 = 0;
  iVar6 = 0;
  if (0 < iVar7) {
    iVar6 = iVar7;
  }
  iVar7 = 0;
  if ((local_108 != (undefined *)0x0) && (local_108 != PTR_DAT_1402f8008)) {
    iVar7 = *(int *)(local_108 + -8);
  }
  if ((iVar6 < iVar7) || (iVar6 = 0, local_108 == (undefined *)0x0)) {
LAB_1400099b0:
    if (((local_108 != PTR_DAT_1402f8008) && (local_108 != (undefined *)0x0)) &&
       (piVar1 = (int *)(local_108 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar6;
      *(undefined1 *)((longlong)iVar6 + 8 + (longlong)piVar1) = 0;
    }
  }
  else if (local_108 != PTR_DAT_1402f8008) {
    iVar6 = *(int *)(local_108 + -8);
    goto LAB_1400099b0;
  }
  FUN_1400a3440();
  local_118 = PTR_DAT_1402f8010;
  iVar7 = FUN_1400a32c0(param_7);
  iVar6 = iVar8;
  if ((local_118 != (undefined *)0x0) && (iVar6 = 0, local_118 != PTR_DAT_1402f8010)) {
    iVar6 = *(int *)(local_118 + -8);
  }
  iVar9 = iVar7;
  if (((iVar7 <= iVar6) && (iVar9 = 0, local_118 != (undefined *)0x0)) &&
     (local_118 != PTR_DAT_1402f8010)) {
    iVar9 = *(int *)(local_118 + -8);
  }
  iVar6 = 1;
  if (1 < iVar9) {
    iVar6 = iVar9;
  }
  iVar9 = iVar8;
  if ((local_118 != (undefined *)0x0) && (iVar9 = 0, local_118 != PTR_DAT_1402f8010)) {
    iVar9 = *(int *)(local_118 + -8);
  }
  if (iVar9 < iVar6) {
    FUN_140002d50(&local_118);
  }
  FUN_140002e30(&local_118);
  puVar14 = local_118;
  if (local_118 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar14,param_7,iVar7);
  puVar14 = local_118;
  if (local_118 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8010;
  }
  iVar7 = FUN_1400a32c0(puVar14);
  iVar6 = 0;
  if (0 < iVar7) {
    iVar6 = iVar7;
  }
  iVar7 = 0;
  if ((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1402f8010)) {
    iVar7 = *(int *)(local_118 + -8);
  }
  if ((iVar6 < iVar7) || (iVar6 = 0, local_118 == (undefined *)0x0)) {
LAB_140009aac:
    if (((local_118 != PTR_DAT_1402f8010) && (local_118 != (undefined *)0x0)) &&
       ((int *)(local_118 + -8) != (int *)0x0)) {
      *(int *)(local_118 + -8) = iVar6;
      *(undefined2 *)(local_118 + (longlong)iVar6 * 2) = 0;
    }
  }
  else if (local_118 != PTR_DAT_1402f8010) {
    iVar6 = *(int *)(local_118 + -8);
    goto LAB_140009aac;
  }
  local_f0[0] = param_6;
  FUN_1400a3440();
  local_110 = PTR_DAT_1402f8008;
  iVar7 = FUN_1400a3360(param_5);
  iVar6 = iVar8;
  if ((local_110 != (undefined *)0x0) && (iVar6 = 0, local_110 != PTR_DAT_1402f8008)) {
    iVar6 = *(int *)(local_110 + -8);
  }
  iVar9 = iVar7;
  if (((iVar7 <= iVar6) && (iVar9 = 0, local_110 != (undefined *)0x0)) &&
     (local_110 != PTR_DAT_1402f8008)) {
    iVar9 = *(int *)(local_110 + -8);
  }
  iVar6 = 1;
  if (1 < iVar9) {
    iVar6 = iVar9;
  }
  iVar9 = iVar8;
  if ((local_110 != (undefined *)0x0) && (iVar9 = 0, local_110 != PTR_DAT_1402f8008)) {
    iVar9 = *(int *)(local_110 + -8);
  }
  if (iVar9 < iVar6) {
    FUN_14000c1c0(&local_110);
  }
  FUN_14000c330(&local_110);
  puVar14 = local_110;
  if (local_110 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar14,param_5,iVar7);
  puVar14 = local_110;
  if (local_110 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8008;
  }
  iVar7 = FUN_1400a3360(puVar14);
  iVar6 = iVar8;
  if (0 < iVar7) {
    iVar6 = iVar7;
  }
  if ((local_110 != (undefined *)0x0) && (iVar8 = 0, local_110 != PTR_DAT_1402f8008)) {
    iVar8 = *(int *)(local_110 + -8);
  }
  if ((iVar6 < iVar8) || (iVar6 = 0, local_110 == (undefined *)0x0)) {
LAB_140009bad:
    if (((local_110 != PTR_DAT_1402f8008) && (local_110 != (undefined *)0x0)) &&
       (piVar1 = (int *)(local_110 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar6;
      *(undefined1 *)((longlong)iVar6 + 8 + (longlong)piVar1) = 0;
    }
  }
  else if (local_110 != PTR_DAT_1402f8008) {
    iVar6 = *(int *)(local_110 + -8);
    goto LAB_140009bad;
  }
  local_d8[0] = (undefined2)local_d0;
  plVar13 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0xf0) + 8) + 0x68);
  local_128 = &local_f8;
  local_130 = &local_100;
  local_138 = &local_108;
  local_140 = (undefined1 *)&param_8;
  local_148 = &local_118;
  local_150 = local_f0;
  local_158 = &local_110;
  (**(code **)(*plVar13 + 0x1060))(plVar13,1,&DAT_14030ab90,local_d8);
  puVar14 = local_110;
  if (((local_110 != (undefined *)0x0) && (local_110 != PTR_DAT_1402f8008)) &&
     (puVar2 = local_110 + -8, puVar2 != (undefined *)0x0)) {
    uVar11 = FUN_1400a3440();
    local_e8 = uVar11;
    FUN_1400a1c30(uVar11);
    local_e0 = 1;
    piVar1 = (int *)(puVar14 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2);
    }
    FUN_1400d1290(uVar11);
  }
  puVar14 = local_118;
  local_110 = PTR_DAT_1402f8008;
  if (((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1402f8010)) &&
     (puVar2 = local_118 + -8, puVar2 != (undefined *)0x0)) {
    uVar11 = FUN_1400a3440();
    local_e8 = uVar11;
    FUN_1400a1c30(uVar11);
    local_e0 = 1;
    piVar1 = (int *)(puVar14 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2);
    }
    FUN_1400d1290(uVar11);
  }
  puVar14 = local_108;
  local_118 = PTR_DAT_1402f8010;
  if (((local_108 != (undefined *)0x0) && (local_108 != PTR_DAT_1402f8008)) &&
     (puVar2 = local_108 + -8, puVar2 != (undefined *)0x0)) {
    uVar11 = FUN_1400a3440();
    local_e8 = uVar11;
    FUN_1400a1c30(uVar11);
    local_e0 = 1;
    piVar1 = (int *)(puVar14 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2);
    }
    FUN_1400d1290(uVar11);
  }
  puVar14 = local_100;
  local_108 = PTR_DAT_1402f8008;
  if (((local_100 != (undefined *)0x0) && (local_100 != PTR_DAT_1402f8008)) &&
     (puVar2 = local_100 + -8, puVar2 != (undefined *)0x0)) {
    uVar11 = FUN_1400a3440();
    local_e8 = uVar11;
    FUN_1400a1c30(uVar11);
    local_e0 = 1;
    piVar1 = (int *)(puVar14 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2);
    }
    FUN_1400d1290(uVar11);
  }
  puVar14 = local_f8;
  local_100 = PTR_DAT_1402f8008;
  if (((local_f8 != (undefined *)0x0) && (local_f8 != PTR_DAT_1402f8008)) &&
     (puVar2 = local_f8 + -8, puVar2 != (undefined *)0x0)) {
    uVar11 = FUN_1400a3440();
    local_e8 = uVar11;
    FUN_1400a1c30(uVar11);
    local_e0 = 1;
    piVar1 = (int *)(puVar14 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2);
    }
    FUN_1400d1290(uVar11);
  }
LAB_140009de3:
  if (0xf < local_a8) {
    operator_delete((void *)CONCAT71(uStack_bf,local_c0));
  }
  local_a8 = 0xf;
  local_b0 = 0;
  local_c0 = 0;
  if (0xf < local_80) {
    operator_delete((void *)CONCAT71(uStack_97,local_98));
  }
  local_80 = 0xf;
  local_88 = 0;
  local_98 = 0;
  if (0xf < local_58) {
    operator_delete((void *)CONCAT71(uStack_6f,local_70));
  }
  return;
}



void FUN_140009e60(longlong param_1,undefined8 param_2,undefined2 param_3,undefined2 param_4,
                  undefined8 param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
                  undefined8 param_9,undefined8 param_10,undefined8 param_11,undefined8 param_12,
                  undefined4 param_13,undefined8 param_14,byte param_15)

{
  int *piVar1;
  undefined *puVar2;
  longlong lVar3;
  byte bVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  undefined8 uVar10;
  undefined8 uVar11;
  longlong *plVar12;
  undefined *puVar13;
  undefined2 uVar14;
  longlong local_res8;
  undefined *local_78;
  undefined *local_70;
  undefined *local_68;
  undefined2 local_60;
  undefined2 local_5e;
  undefined2 local_5c;
  ushort local_5a;
  undefined8 local_58;
  undefined1 local_50;
  undefined8 local_48;
  
  bVar4 = param_15;
  uVar11 = param_10;
  local_48 = 0xfffffffffffffffe;
  uVar14 = (undefined2)param_13;
  local_res8 = param_1;
  if (*(longlong *)(param_1 + 0xf0) != 0) {
    local_5a = (ushort)param_15;
    local_5e = uVar14;
    FUN_1400a3440();
    local_68 = PTR_DAT_1402f8010;
    iVar5 = FUN_1400a32c0(uVar11);
    if (local_68 == (undefined *)0x0) {
      iVar7 = 0;
    }
    else if (local_68 == PTR_DAT_1402f8010) {
      iVar7 = 0;
    }
    else {
      iVar7 = *(int *)(local_68 + -8);
    }
    iVar6 = iVar5;
    if (iVar5 <= iVar7) {
      if (local_68 == (undefined *)0x0) {
        iVar6 = 0;
      }
      else if (local_68 == PTR_DAT_1402f8010) {
        iVar6 = 0;
      }
      else {
        iVar6 = *(int *)(local_68 + -8);
      }
    }
    iVar7 = 1;
    if (1 < iVar6) {
      iVar7 = iVar6;
    }
    if (local_68 == (undefined *)0x0) {
      iVar6 = 0;
    }
    else if (local_68 == PTR_DAT_1402f8010) {
      iVar6 = 0;
    }
    else {
      iVar6 = *(int *)(local_68 + -8);
    }
    if (iVar6 < iVar7) {
      FUN_140002d50(&local_68);
    }
    FUN_140002e30(&local_68);
    puVar13 = local_68;
    if (local_68 == (undefined *)0x0) {
      puVar13 = PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar13,uVar11,iVar5);
    puVar13 = local_68;
    if (local_68 == (undefined *)0x0) {
      puVar13 = PTR_DAT_1402f8010;
    }
    iVar7 = FUN_1400a32c0(puVar13);
    iVar6 = 0;
    iVar5 = iVar6;
    if (0 < iVar7) {
      iVar5 = iVar7;
    }
    iVar7 = iVar6;
    if ((local_68 != (undefined *)0x0) && (iVar7 = 0, local_68 != PTR_DAT_1402f8010)) {
      iVar7 = *(int *)(local_68 + -8);
    }
    if ((iVar5 < iVar7) || (iVar5 = iVar6, local_68 == (undefined *)0x0)) {
LAB_140009fbc:
      if (((local_68 != PTR_DAT_1402f8010) && (local_68 != (undefined *)0x0)) &&
         ((int *)(local_68 + -8) != (int *)0x0)) {
        *(int *)(local_68 + -8) = iVar5;
        *(undefined2 *)(local_68 + (longlong)iVar5 * 2) = 0;
      }
    }
    else if (local_68 != PTR_DAT_1402f8010) {
      iVar5 = *(int *)(local_68 + -8);
      goto LAB_140009fbc;
    }
    FUN_1400a3440();
    local_70 = PTR_DAT_1402f8010;
    iVar7 = FUN_1400a32c0(param_8);
    iVar6 = 0;
    iVar5 = iVar6;
    if ((local_70 != (undefined *)0x0) && (local_70 != PTR_DAT_1402f8010)) {
      iVar5 = *(int *)(local_70 + -8);
    }
    iVar9 = 0;
    iVar8 = iVar7;
    if (((iVar7 <= iVar5) && (iVar8 = iVar6, local_70 != (undefined *)0x0)) &&
       (iVar8 = iVar9, local_70 != PTR_DAT_1402f8010)) {
      iVar8 = *(int *)(local_70 + -8);
    }
    iVar5 = 1;
    if (1 < iVar8) {
      iVar5 = iVar8;
    }
    if ((local_70 != (undefined *)0x0) && (local_70 != PTR_DAT_1402f8010)) {
      iVar9 = *(int *)(local_70 + -8);
    }
    if (iVar9 < iVar5) {
      FUN_140002d50(&local_70);
    }
    FUN_140002e30(&local_70);
    puVar13 = local_70;
    if (local_70 == (undefined *)0x0) {
      puVar13 = PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar13,param_8,iVar7);
    puVar13 = local_70;
    if (local_70 == (undefined *)0x0) {
      puVar13 = PTR_DAT_1402f8010;
    }
    iVar7 = FUN_1400a32c0(puVar13);
    iVar6 = 0;
    iVar5 = iVar6;
    if (0 < iVar7) {
      iVar5 = iVar7;
    }
    iVar7 = iVar6;
    if ((local_70 != (undefined *)0x0) && (iVar7 = 0, local_70 != PTR_DAT_1402f8010)) {
      iVar7 = *(int *)(local_70 + -8);
    }
    if ((iVar5 < iVar7) || (iVar5 = iVar6, local_70 == (undefined *)0x0)) {
LAB_14000a0be:
      if (((local_70 != PTR_DAT_1402f8010) && (local_70 != (undefined *)0x0)) &&
         ((int *)(local_70 + -8) != (int *)0x0)) {
        *(int *)(local_70 + -8) = iVar5;
        *(undefined2 *)(local_70 + (longlong)iVar5 * 2) = 0;
      }
    }
    else if (local_70 != PTR_DAT_1402f8010) {
      iVar5 = *(int *)(local_70 + -8);
      goto LAB_14000a0be;
    }
    FUN_1400a3440();
    local_78 = PTR_DAT_1402f8008;
    iVar7 = FUN_1400a3360(param_5);
    iVar6 = 0;
    iVar5 = iVar6;
    if ((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1402f8008)) {
      iVar5 = *(int *)(local_78 + -8);
    }
    iVar9 = 0;
    iVar8 = iVar7;
    if (((iVar7 <= iVar5) && (iVar8 = iVar6, local_78 != (undefined *)0x0)) &&
       (iVar8 = iVar9, local_78 != PTR_DAT_1402f8008)) {
      iVar8 = *(int *)(local_78 + -8);
    }
    iVar5 = 1;
    if (1 < iVar8) {
      iVar5 = iVar8;
    }
    if ((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1402f8008)) {
      iVar9 = *(int *)(local_78 + -8);
    }
    if (iVar9 < iVar5) {
      FUN_14000c1c0(&local_78);
    }
    FUN_14000c330(&local_78);
    puVar13 = local_78;
    if (local_78 == (undefined *)0x0) {
      puVar13 = PTR_DAT_1402f8008;
    }
    FUN_1400a3390(puVar13,param_5,iVar7);
    puVar13 = local_78;
    if (local_78 == (undefined *)0x0) {
      puVar13 = PTR_DAT_1402f8008;
    }
    iVar7 = FUN_1400a3360(puVar13);
    iVar5 = 0;
    if (0 < iVar7) {
      iVar5 = iVar7;
    }
    iVar7 = 0;
    if ((local_78 != (undefined *)0x0) && (iVar7 = 0, local_78 != PTR_DAT_1402f8008)) {
      iVar7 = *(int *)(local_78 + -8);
    }
    if ((iVar5 < iVar7) || (iVar5 = 0, local_78 == (undefined *)0x0)) {
LAB_14000a1c0:
      if (((local_78 != PTR_DAT_1402f8008) && (local_78 != (undefined *)0x0)) &&
         (piVar1 = (int *)(local_78 + -8), piVar1 != (int *)0x0)) {
        *piVar1 = iVar5;
        *(undefined1 *)((longlong)iVar5 + 8 + (longlong)piVar1) = 0;
      }
    }
    else if (local_78 != PTR_DAT_1402f8008) {
      iVar5 = *(int *)(local_78 + -8);
      goto LAB_14000a1c0;
    }
    plVar12 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0xf0) + 8) + 0x68);
    local_60 = param_3;
    local_5c = param_4;
    (**(code **)(*plVar12 + 0x40))
              (plVar12,1,&DAT_14030ab90,&local_60,&local_5c,&local_78,param_6,param_7,&local_70,
               &param_9,&local_68,&param_11,&param_12,&local_5e,&param_14,&local_5a);
    puVar13 = local_78;
    if (((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1402f8008)) &&
       (puVar2 = local_78 + -8, puVar2 != (undefined *)0x0)) {
      uVar10 = FUN_1400a3440();
      local_58 = uVar10;
      FUN_1400a1c30(uVar10);
      local_50 = 1;
      piVar1 = (int *)(puVar13 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar2);
      }
      FUN_1400d1290(uVar10);
    }
    puVar13 = local_70;
    local_78 = PTR_DAT_1402f8008;
    if (((local_70 != (undefined *)0x0) && (local_70 != PTR_DAT_1402f8010)) &&
       (puVar2 = local_70 + -8, puVar2 != (undefined *)0x0)) {
      uVar10 = FUN_1400a3440();
      local_58 = uVar10;
      FUN_1400a1c30(uVar10);
      local_50 = 1;
      piVar1 = (int *)(puVar13 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar2);
      }
      FUN_1400d1290(uVar10);
    }
    puVar13 = local_68;
    local_70 = PTR_DAT_1402f8010;
    if (((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1402f8010)) &&
       (puVar2 = local_68 + -8, puVar2 != (undefined *)0x0)) {
      uVar10 = FUN_1400a3440();
      local_58 = uVar10;
      FUN_1400a1c30(uVar10);
      local_50 = 1;
      piVar1 = (int *)(puVar13 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar2);
      }
      FUN_1400d1290(uVar10);
    }
  }
  lVar3 = local_res8;
  if (*(longlong *)(local_res8 + 0xf0) == 0) {
    return;
  }
  local_res8 = CONCAT62(local_res8._2_6_,(ushort)bVar4);
  local_60 = uVar14;
  FUN_1400a3440();
  local_68 = PTR_DAT_1402f8010;
  iVar7 = FUN_1400a32c0(uVar11);
  iVar5 = 0;
  if ((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1402f8010)) {
    iVar5 = *(int *)(local_68 + -8);
  }
  iVar6 = iVar7;
  if (((iVar7 <= iVar5) && (iVar6 = 0, local_68 != (undefined *)0x0)) &&
     (local_68 != PTR_DAT_1402f8010)) {
    iVar6 = *(int *)(local_68 + -8);
  }
  iVar5 = 1;
  if (1 < iVar6) {
    iVar5 = iVar6;
  }
  iVar6 = 0;
  if ((local_68 != (undefined *)0x0) && (iVar6 = 0, local_68 != PTR_DAT_1402f8010)) {
    iVar6 = *(int *)(local_68 + -8);
  }
  if (iVar6 < iVar5) {
    FUN_140002d50(&local_68);
  }
  FUN_140002e30(&local_68);
  puVar13 = local_68;
  if (local_68 == (undefined *)0x0) {
    puVar13 = PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar13,uVar11,iVar7);
  puVar13 = local_68;
  if (local_68 == (undefined *)0x0) {
    puVar13 = PTR_DAT_1402f8010;
  }
  iVar7 = FUN_1400a32c0(puVar13);
  iVar5 = 0;
  if (0 < iVar7) {
    iVar5 = iVar7;
  }
  iVar7 = 0;
  if ((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1402f8010)) {
    iVar7 = *(int *)(local_68 + -8);
  }
  if ((iVar5 < iVar7) || (iVar5 = 0, local_68 == (undefined *)0x0)) {
LAB_14000a475:
    if (((local_68 != PTR_DAT_1402f8010) && (local_68 != (undefined *)0x0)) &&
       ((int *)(local_68 + -8) != (int *)0x0)) {
      *(int *)(local_68 + -8) = iVar5;
      *(undefined2 *)(local_68 + (longlong)iVar5 * 2) = 0;
    }
  }
  else if (local_68 != PTR_DAT_1402f8010) {
    iVar5 = *(int *)(local_68 + -8);
    goto LAB_14000a475;
  }
  FUN_1400a3440();
  local_78 = PTR_DAT_1402f8010;
  iVar7 = FUN_1400a32c0(param_8);
  iVar5 = 0;
  if ((local_78 != (undefined *)0x0) && (iVar5 = 0, local_78 != PTR_DAT_1402f8010)) {
    iVar5 = *(int *)(local_78 + -8);
  }
  iVar6 = iVar7;
  if (iVar7 <= iVar5) {
    iVar6 = 0;
    if ((local_78 != (undefined *)0x0) && (iVar6 = 0, local_78 != PTR_DAT_1402f8010)) {
      iVar6 = *(int *)(local_78 + -8);
    }
  }
  iVar5 = 1;
  if (1 < iVar6) {
    iVar5 = iVar6;
  }
  iVar6 = 0;
  if ((local_78 != (undefined *)0x0) && (iVar6 = 0, local_78 != PTR_DAT_1402f8010)) {
    iVar6 = *(int *)(local_78 + -8);
  }
  if (iVar6 < iVar5) {
    FUN_140002d50(&local_78);
  }
  FUN_140002e30(&local_78);
  puVar13 = local_78;
  if (local_78 == (undefined *)0x0) {
    puVar13 = PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar13,param_8,iVar7);
  puVar13 = local_78;
  if (local_78 == (undefined *)0x0) {
    puVar13 = PTR_DAT_1402f8010;
  }
  iVar7 = FUN_1400a32c0(puVar13);
  iVar5 = 0;
  if (0 < iVar7) {
    iVar5 = iVar7;
  }
  iVar7 = 0;
  if ((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1402f8010)) {
    iVar7 = *(int *)(local_78 + -8);
  }
  if ((iVar5 < iVar7) || (iVar5 = 0, local_78 == (undefined *)0x0)) {
LAB_14000a56a:
    if (((local_78 != PTR_DAT_1402f8010) && (local_78 != (undefined *)0x0)) &&
       ((int *)(local_78 + -8) != (int *)0x0)) {
      *(int *)(local_78 + -8) = iVar5;
      *(undefined2 *)(local_78 + (longlong)iVar5 * 2) = 0;
    }
  }
  else if (local_78 != PTR_DAT_1402f8010) {
    iVar5 = *(int *)(local_78 + -8);
    goto LAB_14000a56a;
  }
  FUN_1400a3440();
  local_70 = PTR_DAT_1402f8008;
  iVar7 = FUN_1400a3360(param_5);
  iVar5 = 0;
  if ((local_70 != (undefined *)0x0) && (iVar5 = 0, local_70 != PTR_DAT_1402f8008)) {
    iVar5 = *(int *)(local_70 + -8);
  }
  iVar6 = iVar7;
  if (iVar7 <= iVar5) {
    iVar6 = 0;
    if ((local_70 != (undefined *)0x0) && (iVar6 = 0, local_70 != PTR_DAT_1402f8008)) {
      iVar6 = *(int *)(local_70 + -8);
    }
  }
  iVar5 = 1;
  if (1 < iVar6) {
    iVar5 = iVar6;
  }
  iVar6 = 0;
  if ((local_70 != (undefined *)0x0) && (iVar6 = 0, local_70 != PTR_DAT_1402f8008)) {
    iVar6 = *(int *)(local_70 + -8);
  }
  if (iVar6 < iVar5) {
    FUN_14000c1c0(&local_70);
  }
  FUN_14000c330(&local_70);
  puVar13 = local_70;
  if (local_70 == (undefined *)0x0) {
    puVar13 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar13,param_5,iVar7);
  puVar13 = local_70;
  if (local_70 == (undefined *)0x0) {
    puVar13 = PTR_DAT_1402f8008;
  }
  iVar7 = FUN_1400a3360(puVar13);
  iVar5 = 0;
  if (0 < iVar7) {
    iVar5 = iVar7;
  }
  iVar7 = 0;
  if ((local_70 != (undefined *)0x0) && (iVar7 = 0, local_70 != PTR_DAT_1402f8008)) {
    iVar7 = *(int *)(local_70 + -8);
  }
  if ((iVar7 <= iVar5) && (iVar5 = 0, local_70 != (undefined *)0x0)) {
    if (local_70 == PTR_DAT_1402f8008) goto LAB_14000a67c;
    iVar5 = *(int *)(local_70 + -8);
  }
  if (((local_70 != PTR_DAT_1402f8008) && (local_70 != (undefined *)0x0)) &&
     (piVar1 = (int *)(local_70 + -8), piVar1 != (int *)0x0)) {
    *piVar1 = iVar5;
    *(undefined1 *)((longlong)iVar5 + 8 + (longlong)piVar1) = 0;
  }
LAB_14000a67c:
  plVar12 = (longlong *)(**(longlong **)(*(longlong *)(lVar3 + 0xf0) + 8) + 0x68);
  local_5e = param_3;
  local_5c = param_4;
  (**(code **)(*plVar12 + 0xd60))
            (plVar12,1,&DAT_14030ab90,&local_5e,&local_5c,&local_70,param_6,param_7,&local_78,
             &param_9,&local_68,&param_11,&param_12,&local_60,&param_14,&local_res8);
  puVar13 = local_70;
  if (((local_70 != (undefined *)0x0) && (local_70 != PTR_DAT_1402f8008)) &&
     (puVar2 = local_70 + -8, puVar2 != (undefined *)0x0)) {
    uVar11 = FUN_1400a3440();
    local_58 = uVar11;
    FUN_1400a1c30(uVar11);
    local_50 = 1;
    piVar1 = (int *)(puVar13 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2);
    }
    FUN_1400d1290(uVar11);
  }
  puVar13 = local_78;
  local_70 = PTR_DAT_1402f8008;
  if (((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1402f8010)) &&
     (puVar2 = local_78 + -8, puVar2 != (undefined *)0x0)) {
    uVar11 = FUN_1400a3440();
    local_58 = uVar11;
    FUN_1400a1c30(uVar11);
    local_50 = 1;
    piVar1 = (int *)(puVar13 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2);
    }
    FUN_1400d1290(uVar11);
  }
  puVar13 = local_68;
  if (((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1402f8010)) &&
     (puVar2 = local_68 + -8, puVar2 != (undefined *)0x0)) {
    local_78 = PTR_DAT_1402f8010;
    uVar11 = FUN_1400a3440();
    local_58 = uVar11;
    FUN_1400a1c30(uVar11);
    local_50 = 1;
    piVar1 = (int *)(puVar13 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2);
    }
    FUN_1400d1290(uVar11);
  }
  return;
}



void FUN_14000a840(longlong param_1)

{
  longlong lVar1;
  
  if (*(longlong *)(param_1 + 0xe8) != 0) {
    lVar1 = **(longlong **)(*(longlong *)(param_1 + 0xe8) + 8);
    (**(code **)(*(longlong *)(lVar1 + 0x68) + 0x50))(lVar1 + 0x68,1,&DAT_14030ab90);
  }
  return;
}



void FUN_14000a880(longlong param_1,undefined8 param_2,undefined2 param_3,undefined8 param_4,
                  undefined8 param_5,undefined8 param_6)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  undefined8 uVar5;
  undefined *puVar6;
  longlong *plVar7;
  int iVar8;
  undefined2 local_res8 [4];
  undefined *local_48;
  undefined *local_40;
  undefined8 local_38;
  undefined8 local_30;
  undefined1 local_28;
  
  local_38 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0xe8) == 0) {
    return;
  }
  local_res8[0] = param_3;
  FUN_1400a3440();
  local_40 = PTR_DAT_1402f8010;
  iVar3 = FUN_1400a32c0(param_6);
  iVar8 = 0;
  if ((local_40 != (undefined *)0x0) && (local_40 != PTR_DAT_1402f8010)) {
    iVar8 = *(int *)(local_40 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar8) && (iVar4 = 0, local_40 != (undefined *)0x0)) &&
     (local_40 != PTR_DAT_1402f8010)) {
    iVar4 = *(int *)(local_40 + -8);
  }
  iVar8 = 1;
  if (1 < iVar4) {
    iVar8 = iVar4;
  }
  iVar4 = 0;
  if ((local_40 != (undefined *)0x0) && (iVar4 = 0, local_40 != PTR_DAT_1402f8010)) {
    iVar4 = *(int *)(local_40 + -8);
  }
  if (iVar4 < iVar8) {
    FUN_140002d50(&local_40);
  }
  FUN_140002e30(&local_40);
  puVar6 = local_40;
  if (local_40 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar6,param_6,iVar3);
  puVar6 = local_40;
  if (local_40 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8010;
  }
  iVar3 = FUN_1400a32c0(puVar6);
  iVar8 = 0;
  if (0 < iVar3) {
    iVar8 = iVar3;
  }
  iVar3 = 0;
  if ((local_40 != (undefined *)0x0) && (local_40 != PTR_DAT_1402f8010)) {
    iVar3 = *(int *)(local_40 + -8);
  }
  if ((iVar8 < iVar3) || (iVar8 = 0, local_40 == (undefined *)0x0)) {
LAB_14000a9a1:
    if (((local_40 != PTR_DAT_1402f8010) && (local_40 != (undefined *)0x0)) &&
       ((int *)(local_40 + -8) != (int *)0x0)) {
      *(int *)(local_40 + -8) = iVar8;
      *(undefined2 *)(local_40 + (longlong)iVar8 * 2) = 0;
    }
  }
  else if (local_40 != PTR_DAT_1402f8010) {
    iVar8 = *(int *)(local_40 + -8);
    goto LAB_14000a9a1;
  }
  FUN_1400a3440();
  local_48 = PTR_DAT_1402f8010;
  iVar3 = FUN_1400a32c0(param_5);
  iVar8 = 0;
  if ((local_48 != (undefined *)0x0) && (iVar8 = 0, local_48 != PTR_DAT_1402f8010)) {
    iVar8 = *(int *)(local_48 + -8);
  }
  iVar4 = iVar3;
  if (iVar3 <= iVar8) {
    iVar4 = 0;
    if ((local_48 != (undefined *)0x0) && (iVar4 = 0, local_48 != PTR_DAT_1402f8010)) {
      iVar4 = *(int *)(local_48 + -8);
    }
  }
  iVar8 = 1;
  if (1 < iVar4) {
    iVar8 = iVar4;
  }
  iVar4 = 0;
  if ((local_48 != (undefined *)0x0) && (iVar4 = 0, local_48 != PTR_DAT_1402f8010)) {
    iVar4 = *(int *)(local_48 + -8);
  }
  if (iVar4 < iVar8) {
    FUN_140002d50(&local_48);
  }
  FUN_140002e30(&local_48);
  puVar6 = local_48;
  if (local_48 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar6,param_5,iVar3);
  puVar6 = local_48;
  if (local_48 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8010;
  }
  iVar3 = FUN_1400a32c0(puVar6);
  iVar8 = 0;
  if (0 < iVar3) {
    iVar8 = iVar3;
  }
  iVar3 = 0;
  if ((local_48 != (undefined *)0x0) && (iVar3 = 0, local_48 != PTR_DAT_1402f8010)) {
    iVar3 = *(int *)(local_48 + -8);
  }
  if ((iVar3 <= iVar8) && (iVar8 = 0, local_48 != (undefined *)0x0)) {
    if (local_48 == PTR_DAT_1402f8010) goto LAB_14000aabf;
    iVar8 = *(int *)(local_48 + -8);
  }
  if (((local_48 != PTR_DAT_1402f8010) && (local_48 != (undefined *)0x0)) &&
     ((int *)(local_48 + -8) != (int *)0x0)) {
    *(int *)(local_48 + -8) = iVar8;
    *(undefined2 *)(local_48 + (longlong)iVar8 * 2) = 0;
  }
LAB_14000aabf:
  plVar7 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0xe8) + 8) + 0x68);
  (**(code **)(*plVar7 + 0x60))(plVar7,1,&DAT_14030ab90,param_4,&local_48,&local_40,local_res8);
  puVar6 = local_48;
  if (((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1402f8010)) &&
     (puVar1 = local_48 + -8, puVar1 != (undefined *)0x0)) {
    uVar5 = FUN_1400a3440();
    local_30 = uVar5;
    FUN_1400a1c30(uVar5);
    local_28 = 1;
    piVar2 = (int *)(puVar6 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar5);
  }
  puVar6 = local_40;
  if (((local_40 != (undefined *)0x0) && (local_40 != PTR_DAT_1402f8010)) &&
     (puVar1 = local_40 + -8, puVar1 != (undefined *)0x0)) {
    local_48 = PTR_DAT_1402f8010;
    uVar5 = FUN_1400a3440();
    local_30 = uVar5;
    FUN_1400a1c30(uVar5);
    local_28 = 1;
    piVar2 = (int *)(puVar6 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar5);
  }
  return;
}



void FUN_14000abc0(void)

{
  if ((DAT_140320f60 & 1) == 0) {
    DAT_140320f60 = DAT_140320f60 | 1;
    FUN_140095c60();
    atexit((_func_5014 *)&DAT_1402026e0);
  }
  return;
}



void FUN_14000ac00(longlong param_1)

{
  longlong lVar1;
  
  if (*(longlong *)(param_1 + 0xe8) != 0) {
    lVar1 = **(longlong **)(*(longlong *)(param_1 + 0xe8) + 8);
    (**(code **)(*(longlong *)(lVar1 + 0x68) + 0x800))(lVar1 + 0x68,1,&DAT_14030ab90);
  }
  return;
}



void FUN_14000ac40(longlong param_1)

{
  longlong lVar1;
  
  if (*(longlong *)(param_1 + 0xe8) != 0) {
    lVar1 = **(longlong **)(*(longlong *)(param_1 + 0xe8) + 8);
    (**(code **)(*(longlong *)(lVar1 + 0x68) + 0x810))(lVar1 + 0x68,1,&DAT_14030ab90);
  }
  return;
}



void FUN_14000ac80(longlong param_1)

{
  longlong lVar1;
  
  if (*(longlong *)(param_1 + 0xe8) != 0) {
    lVar1 = **(longlong **)(*(longlong *)(param_1 + 0xe8) + 8);
    (**(code **)(*(longlong *)(lVar1 + 0x68) + 0xe50))(lVar1 + 0x68,1,&DAT_14030ab90);
  }
                    // WARNING: Could not recover jumptable at 0x00014000acbc. Too many branches
                    // WARNING: Treating indirect jump as call
  printf("REQ_READ_WORLD_SERVER\n");
  return;
}



ulonglong FUN_14000acd0(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong *plVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  
  uVar2 = 0;
  uVar5 = *(longlong *)(param_1 + 0x90) - *(longlong *)(param_1 + 0x88) >> 3;
  if (uVar5 != 0) {
    plVar3 = *(longlong **)(param_1 + 0x88);
    uVar4 = uVar2;
    do {
      lVar1 = *plVar3;
      if ((lVar1 != 0) && (*(int *)(lVar1 + 0x70) == param_2)) {
        uVar2 = (ulonglong)(uint)((int)uVar2 + *(int *)(lVar1 + 0x74));
      }
      uVar4 = (ulonglong)((int)uVar4 + 1);
      plVar3 = plVar3 + 1;
    } while (uVar4 < uVar5);
  }
  return uVar2;
}



void FUN_14000ad20(longlong param_1,undefined8 param_2,undefined2 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined2 local_res8 [16];
  
  if (*(longlong *)(param_1 + 0xf0) != 0) {
    lVar1 = **(longlong **)(*(longlong *)(param_1 + 0xf0) + 8);
    local_res8[0] = param_3;
    (**(code **)(*(longlong *)(lVar1 + 0x68) + 0xd10))
              (lVar1 + 0x68,1,&DAT_14030ab90,local_res8,param_4);
  }
  return;
}



longlong FUN_14000ad70(longlong param_1,void *param_2,undefined8 *param_3)

{
  char cVar1;
  undefined8 *puVar2;
  int iVar3;
  undefined8 **ppuVar4;
  uint7 uVar6;
  longlong lVar5;
  undefined8 *puVar7;
  undefined8 *puVar8;
  undefined8 *local_res8;
  undefined8 *local_res20;
  
  puVar8 = (undefined8 *)(*(undefined8 **)(param_1 + 8))[1];
  cVar1 = *(char *)((longlong)puVar8 + 0x61);
  puVar2 = *(undefined8 **)(param_1 + 8);
  while (cVar1 == '\0') {
    iVar3 = memcmp(puVar8 + 3,param_2,0x10);
    if (iVar3 < 0) {
      puVar7 = (undefined8 *)puVar8[2];
      puVar8 = puVar2;
    }
    else {
      puVar7 = (undefined8 *)*puVar8;
    }
    puVar2 = puVar8;
    puVar8 = puVar7;
    cVar1 = *(char *)((longlong)puVar7 + 0x61);
  }
  puVar8 = *(undefined8 **)(param_1 + 8);
  local_res8 = puVar2;
  if ((puVar2 == puVar8) || (iVar3 = memcmp(param_2,puVar2 + 3,0x10), iVar3 < 0)) {
    local_res20 = puVar8;
    ppuVar4 = &local_res20;
  }
  else {
    ppuVar4 = &local_res8;
  }
  puVar2 = *ppuVar4;
  uVar6 = (uint7)((ulonglong)puVar2 >> 8);
  if (puVar2 == puVar8) {
    lVar5 = (ulonglong)uVar6 << 8;
  }
  else {
    *param_3 = puVar2[5];
    param_3[1] = puVar2[6];
    param_3[2] = puVar2[7];
    param_3[3] = puVar2[8];
    param_3[4] = puVar2[9];
    param_3[5] = puVar2[10];
    lVar5 = CONCAT71(uVar6,1);
    param_3[6] = puVar2[0xb];
  }
  return lVar5;
}



void FUN_14000ae60(longlong *param_1)

{
  undefined8 *puVar1;
  
  if ((*param_1 != 0) &&
     (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
     *(longlong *)(*param_1 + 8) == 0)) {
    param_1 = (longlong *)*param_1;
    puVar1 = (undefined8 *)*param_1;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    FUN_1400a3530(param_1);
  }
  return;
}



void FUN_14000aec0(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 *puVar3;
  bool bVar4;
  undefined8 uVar5;
  longlong lVar6;
  
  uVar5 = 0xfffffffffffffffe;
  lVar1 = *param_1;
  if (lVar1 != 0) {
    lVar6 = lVar1;
    FUN_1400a1c30(lVar1);
    bVar4 = true;
    *(longlong *)(*param_1 + 0x40) = *(longlong *)(*param_1 + 0x40) + -1;
    if (*(longlong *)(*param_1 + 0x40) == 0) {
      FUN_1400d1290(lVar1);
      bVar4 = false;
      lVar2 = *param_1;
      puVar3 = *(undefined8 **)(lVar2 + 0x38);
      if (puVar3 != (undefined8 *)0x0) {
        (**(code **)*puVar3)(puVar3,1,param_3,param_4,uVar5,lVar6,0);
      }
      FUN_1400a1cd0(lVar2);
      FUN_1400a3530(lVar2);
    }
    if (bVar4) {
      FUN_1400d1290(lVar1);
    }
  }
  return;
}



void FUN_14000af70(longlong *param_1)

{
  if (*param_1 != 0) {
    *(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1;
    if (*(longlong *)(*param_1 + 8) == 0) {
      FUN_14000b2a0(*param_1);
    }
  }
  return;
}



void FUN_14000afb0(longlong *param_1)

{
  longlong lVar1;
  
  if (*param_1 != 0) {
    *(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1;
    if (*(longlong *)(*param_1 + 8) == 0) {
      lVar1 = *param_1;
      FUN_14000bb50(lVar1);
      FUN_1400a3530(lVar1);
    }
  }
  return;
}



void FUN_14000b000(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = param_1[1] - *param_1 >> 3;
  if (0x1ffffffffffffffe < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = param_1[2] - *param_1 >> 3;
  if (uVar2 < uVar3) {
    if (0x1fffffffffffffff - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_14001ca90(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_14001ca90(param_1,uVar2);
  }
  return;
}



longlong FUN_14000b090(longlong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [4];
  
  *(undefined8 *)(param_1 + 0x10) = 0;
  pvVar1 = operator_new(0x68);
  if (pvVar1 != (void *)0x0) {
    *(void **)(param_1 + 8) = pvVar1;
    *(void **)pvVar1 = pvVar1;
    *(longlong *)(*(longlong *)(param_1 + 8) + 8) = *(longlong *)(param_1 + 8);
    *(longlong *)(*(longlong *)(param_1 + 8) + 0x10) = *(longlong *)(param_1 + 8);
    *(undefined1 *)(*(longlong *)(param_1 + 8) + 0x60) = 1;
    *(undefined1 *)(*(longlong *)(param_1 + 8) + 0x61) = 1;
    return param_1;
  }
  local_res8[0] = (char *)0x0;
  std::exception::exception((exception *)local_28,local_res8);
  local_28[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_28,(ThrowInfo *)&DAT_1402f47a8);
}



longlong FUN_14000b120(longlong param_1,undefined8 param_2)

{
  char cVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong *plVar4;
  longlong lVar5;
  undefined1 local_res8 [8];
  longlong *local_18;
  longlong *local_10;
  
  FUN_14000b7e0(param_1,&local_18,param_2);
  lVar5 = 0;
  plVar4 = local_18;
  while (plVar4 != local_10) {
    lVar5 = lVar5 + 1;
    if (*(char *)((longlong)plVar4 + 0x61) == '\0') {
      plVar2 = (longlong *)plVar4[2];
      if (*(char *)((longlong)plVar2 + 0x61) == '\0') {
        cVar1 = *(char *)(*plVar2 + 0x61);
        plVar4 = plVar2;
        plVar2 = (longlong *)*plVar2;
        while (cVar1 == '\0') {
          cVar1 = *(char *)(*plVar2 + 0x61);
          plVar4 = plVar2;
          plVar2 = (longlong *)*plVar2;
        }
      }
      else {
        cVar1 = *(char *)(plVar4[1] + 0x61);
        plVar3 = (longlong *)plVar4[1];
        plVar2 = plVar4;
        while ((plVar4 = plVar3, cVar1 == '\0' && (plVar2 == (longlong *)plVar4[2]))) {
          cVar1 = *(char *)(plVar4[1] + 0x61);
          plVar3 = (longlong *)plVar4[1];
          plVar2 = plVar4;
        }
      }
    }
  }
  if ((local_18 == (longlong *)**(longlong **)(param_1 + 8)) &&
     (local_10 == *(longlong **)(param_1 + 8))) {
    FUN_14000b760(param_1);
  }
  else {
    while (local_18 != local_10) {
      plVar4 = local_18;
      if (*(char *)((longlong)local_18 + 0x61) == '\0') {
        plVar4 = (longlong *)local_18[2];
        if (*(char *)((longlong)plVar4 + 0x61) == '\0') {
          cVar1 = *(char *)(*plVar4 + 0x61);
          plVar2 = (longlong *)*plVar4;
          while (cVar1 == '\0') {
            cVar1 = *(char *)(*plVar2 + 0x61);
            plVar4 = plVar2;
            plVar2 = (longlong *)*plVar2;
          }
        }
        else {
          cVar1 = *(char *)(local_18[1] + 0x61);
          plVar3 = (longlong *)local_18[1];
          plVar2 = local_18;
          while ((plVar4 = plVar3, cVar1 == '\0' && (plVar2 == (longlong *)plVar4[2]))) {
            cVar1 = *(char *)(plVar4[1] + 0x61);
            plVar3 = (longlong *)plVar4[1];
            plVar2 = plVar4;
          }
        }
      }
      FUN_14000b400(param_1,local_res8,local_18);
      local_18 = plVar4;
    }
  }
  return lVar5;
}



void FUN_14000b250(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014000b254. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_1 + 8));
  return;
}



void FUN_14000b260(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_14000bf70(*param_1,param_1[1]);
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_14000b2a0(undefined8 *param_1)

{
  undefined8 *puVar1;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    *puVar1 = MagiApiServer::vftable;
    FUN_1400a1cd0(puVar1 + 0xc);
    if (0xf < (ulonglong)puVar1[8]) {
      operator_delete((void *)puVar1[5]);
    }
    puVar1[8] = 0xf;
    puVar1[7] = 0;
    *(undefined1 *)(puVar1 + 5) = 0;
    operator_delete(puVar1);
  }
  FUN_1400a3530(param_1);
  return;
}



undefined8 * FUN_14000b320(longlong param_1,undefined8 *param_2,longlong *param_3,longlong *param_4)

{
  char cVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined1 local_res8 [8];
  longlong *local_res18;
  
  if ((param_3 == (longlong *)**(longlong **)(param_1 + 8)) &&
     (param_4 == *(longlong **)(param_1 + 8))) {
    FUN_14000b760();
    *param_2 = **(undefined8 **)(param_1 + 8);
    return param_2;
  }
  while (param_3 != param_4) {
    local_res18 = param_3;
    if (*(char *)((longlong)param_3 + 0x61) == '\0') {
      local_res18 = (longlong *)param_3[2];
      if (*(char *)((longlong)local_res18 + 0x61) == '\0') {
        cVar1 = *(char *)(*local_res18 + 0x61);
        plVar2 = (longlong *)*local_res18;
        while (cVar1 == '\0') {
          cVar1 = *(char *)(*plVar2 + 0x61);
          local_res18 = plVar2;
          plVar2 = (longlong *)*plVar2;
        }
      }
      else {
        cVar1 = *(char *)(param_3[1] + 0x61);
        plVar3 = (longlong *)param_3[1];
        plVar2 = param_3;
        while ((local_res18 = plVar3, cVar1 == '\0' && (plVar2 == (longlong *)local_res18[2]))) {
          cVar1 = *(char *)(local_res18[1] + 0x61);
          plVar3 = (longlong *)local_res18[1];
          plVar2 = local_res18;
        }
      }
    }
    FUN_14000b400(param_1,local_res8,param_3);
    param_3 = local_res18;
  }
  *param_2 = param_3;
  return param_2;
}



undefined8 * FUN_14000b400(longlong param_1,undefined8 *param_2,longlong *param_3)

{
  char cVar1;
  longlong *plVar2;
  longlong lVar3;
  code *pcVar4;
  longlong *plVar5;
  undefined8 *puVar6;
  longlong *plVar7;
  longlong *plVar8;
  longlong *plVar9;
  longlong *plVar10;
  
  if (*(char *)((longlong)param_3 + 0x61) != '\0') {
    std::_Xout_of_range("invalid map/set<T> iterator");
    pcVar4 = (code *)swi(3);
    puVar6 = (undefined8 *)(*pcVar4)();
    return puVar6;
  }
  plVar9 = (longlong *)param_3[2];
  plVar7 = param_3 + 2;
  if (*(char *)((longlong)plVar9 + 0x61) == '\0') {
    cVar1 = *(char *)(*plVar9 + 0x61);
    plVar8 = (longlong *)*plVar9;
    while (cVar1 == '\0') {
      cVar1 = *(char *)(*plVar8 + 0x61);
      plVar9 = plVar8;
      plVar8 = (longlong *)*plVar8;
    }
  }
  else {
    cVar1 = *(char *)(param_3[1] + 0x61);
    plVar10 = (longlong *)param_3[1];
    plVar8 = param_3;
    while ((plVar9 = plVar10, cVar1 == '\0' && (plVar8 == (longlong *)plVar9[2]))) {
      cVar1 = *(char *)(plVar9[1] + 0x61);
      plVar10 = (longlong *)plVar9[1];
      plVar8 = plVar9;
    }
  }
  plVar8 = (longlong *)*param_3;
  if (*(char *)((longlong)plVar8 + 0x61) == '\0') {
    plVar10 = plVar8;
    if ((*(char *)(*plVar7 + 0x61) == '\0') && (plVar10 = (longlong *)plVar9[2], plVar9 != param_3))
    {
      plVar8[1] = (longlong)plVar9;
      *plVar9 = *param_3;
      plVar8 = plVar9;
      if (plVar9 != (longlong *)*plVar7) {
        plVar8 = (longlong *)plVar9[1];
        if (*(char *)((longlong)plVar10 + 0x61) == '\0') {
          plVar10[1] = (longlong)plVar8;
        }
        *plVar8 = (longlong)plVar10;
        plVar9[2] = *plVar7;
        *(longlong **)(*plVar7 + 8) = plVar9;
      }
      if (*(longlong **)(*(longlong *)(param_1 + 8) + 8) == param_3) {
        *(longlong **)(*(longlong *)(param_1 + 8) + 8) = plVar9;
      }
      else {
        puVar6 = (undefined8 *)param_3[1];
        if ((longlong *)*puVar6 == param_3) {
          *puVar6 = plVar9;
        }
        else {
          puVar6[2] = plVar9;
        }
      }
      plVar9[1] = param_3[1];
      lVar3 = plVar9[0xc];
      *(char *)(plVar9 + 0xc) = (char)param_3[0xc];
      *(char *)(param_3 + 0xc) = (char)lVar3;
      goto LAB_14000b5cf;
    }
  }
  else {
    plVar10 = (longlong *)*plVar7;
  }
  plVar8 = (longlong *)param_3[1];
  if (*(char *)((longlong)plVar10 + 0x61) == '\0') {
    plVar10[1] = (longlong)plVar8;
  }
  if (*(longlong **)(*(longlong *)(param_1 + 8) + 8) == param_3) {
    *(longlong **)(*(longlong *)(param_1 + 8) + 8) = plVar10;
  }
  else if ((longlong *)*plVar8 == param_3) {
    *plVar8 = (longlong)plVar10;
  }
  else {
    plVar8[2] = (longlong)plVar10;
  }
  if ((longlong *)**(undefined8 **)(param_1 + 8) == param_3) {
    plVar7 = plVar8;
    if (*(char *)((longlong)plVar10 + 0x61) == '\0') {
      cVar1 = *(char *)(*plVar10 + 0x61);
      plVar2 = (longlong *)*plVar10;
      plVar7 = plVar10;
      while (plVar5 = plVar2, cVar1 == '\0') {
        plVar2 = (longlong *)*plVar5;
        cVar1 = *(char *)((longlong)plVar2 + 0x61);
        plVar7 = plVar5;
      }
    }
    **(undefined8 **)(param_1 + 8) = plVar7;
  }
  lVar3 = *(longlong *)(param_1 + 8);
  if (*(longlong **)(lVar3 + 0x10) == param_3) {
    if (*(char *)((longlong)plVar10 + 0x61) == '\0') {
      cVar1 = *(char *)(plVar10[2] + 0x61);
      plVar7 = (longlong *)plVar10[2];
      plVar2 = plVar10;
      while (plVar5 = plVar7, cVar1 == '\0') {
        plVar7 = (longlong *)plVar5[2];
        cVar1 = *(char *)((longlong)plVar7 + 0x61);
        plVar2 = plVar5;
      }
      *(longlong **)(lVar3 + 0x10) = plVar2;
    }
    else {
      *(longlong **)(lVar3 + 0x10) = plVar8;
    }
  }
LAB_14000b5cf:
  if ((char)param_3[0xc] == '\x01') {
    if (plVar10 != *(longlong **)(*(longlong *)(param_1 + 8) + 8)) {
      do {
        plVar7 = plVar8;
        if ((char)plVar10[0xc] != '\x01') break;
        plVar8 = (longlong *)*plVar7;
        if (plVar10 == plVar8) {
          plVar8 = (longlong *)plVar7[2];
          if ((char)plVar8[0xc] == '\0') {
            *(undefined1 *)(plVar8 + 0xc) = 1;
            *(undefined1 *)(plVar7 + 0xc) = 0;
            FUN_14000b940(param_1,plVar7);
            plVar8 = (longlong *)plVar7[2];
          }
          if (*(char *)((longlong)plVar8 + 0x61) == '\0') {
            if ((*(char *)(*plVar8 + 0x60) != '\x01') || (*(char *)(plVar8[2] + 0x60) != '\x01')) {
              if (*(char *)(plVar8[2] + 0x60) == '\x01') {
                *(undefined1 *)(*plVar8 + 0x60) = 1;
                *(undefined1 *)(plVar8 + 0xc) = 0;
                FUN_14000b9a0(param_1,plVar8);
                plVar8 = (longlong *)plVar7[2];
              }
              *(char *)(plVar8 + 0xc) = (char)plVar7[0xc];
              *(undefined1 *)(plVar7 + 0xc) = 1;
              *(undefined1 *)(plVar8[2] + 0x60) = 1;
              FUN_14000b940(param_1,plVar7);
              break;
            }
LAB_14000b6c0:
            *(undefined1 *)(plVar8 + 0xc) = 0;
          }
        }
        else {
          if ((char)plVar8[0xc] == '\0') {
            *(undefined1 *)(plVar8 + 0xc) = 1;
            *(undefined1 *)(plVar7 + 0xc) = 0;
            FUN_14000b9a0(param_1,plVar7);
            plVar8 = (longlong *)*plVar7;
          }
          if (*(char *)((longlong)plVar8 + 0x61) == '\0') {
            if ((*(char *)(plVar8[2] + 0x60) == '\x01') && (*(char *)(*plVar8 + 0x60) == '\x01'))
            goto LAB_14000b6c0;
            if (*(char *)(*plVar8 + 0x60) == '\x01') {
              *(undefined1 *)(plVar8[2] + 0x60) = 1;
              *(undefined1 *)(plVar8 + 0xc) = 0;
              FUN_14000b940(param_1,plVar8);
              plVar8 = (longlong *)*plVar7;
            }
            *(char *)(plVar8 + 0xc) = (char)plVar7[0xc];
            *(undefined1 *)(plVar7 + 0xc) = 1;
            *(undefined1 *)(*plVar8 + 0x60) = 1;
            FUN_14000b9a0(param_1,plVar7);
            break;
          }
        }
        plVar8 = (longlong *)plVar7[1];
        plVar10 = plVar7;
      } while (plVar7 != *(longlong **)(*(longlong *)(param_1 + 8) + 8));
    }
    *(undefined1 *)(plVar10 + 0xc) = 1;
  }
  operator_delete(param_3);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -1;
  }
  *param_2 = plVar9;
  return param_2;
}



void FUN_14000b760(longlong param_1)

{
  char cVar1;
  longlong *plVar2;
  longlong *plVar3;
  
  plVar2 = *(longlong **)(*(longlong *)(param_1 + 8) + 8);
  cVar1 = *(char *)((longlong)plVar2 + 0x61);
  while (cVar1 == '\0') {
    FUN_14000b8e0(param_1,plVar2[2]);
    plVar3 = (longlong *)*plVar2;
    operator_delete(plVar2);
    plVar2 = plVar3;
    cVar1 = *(char *)((longlong)plVar3 + 0x61);
  }
  *(longlong *)(*(longlong *)(param_1 + 8) + 8) = *(longlong *)(param_1 + 8);
  *(undefined8 *)*(undefined8 *)(param_1 + 8) = *(undefined8 *)(param_1 + 8);
  *(longlong *)(*(longlong *)(param_1 + 8) + 0x10) = *(longlong *)(param_1 + 8);
  *(undefined8 *)(param_1 + 0x10) = 0;
  return;
}



longlong * FUN_14000b7e0(longlong param_1,longlong *param_2,void *param_3)

{
  char cVar1;
  undefined8 *puVar2;
  int iVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  
  puVar6 = *(undefined8 **)(param_1 + 8);
  cVar1 = *(char *)((longlong)puVar6[1] + 0x61);
  puVar2 = puVar6;
  puVar4 = (undefined8 *)puVar6[1];
  while (cVar1 == '\0') {
    iVar3 = memcmp(puVar4 + 3,param_3,0x10);
    if (iVar3 < 0) {
      puVar5 = (undefined8 *)puVar4[2];
      puVar4 = puVar2;
    }
    else {
      if ((*(char *)((longlong)puVar6 + 0x61) != '\0') &&
         (iVar3 = memcmp(param_3,puVar4 + 3,0x10), iVar3 < 0)) {
        puVar6 = puVar4;
      }
      puVar5 = (undefined8 *)*puVar4;
    }
    puVar2 = puVar4;
    puVar4 = puVar5;
    cVar1 = *(char *)((longlong)puVar5 + 0x61);
  }
  if (*(char *)((longlong)puVar6 + 0x61) == '\0') {
    puVar4 = (undefined8 *)*puVar6;
  }
  else {
    puVar4 = *(undefined8 **)(*(longlong *)(param_1 + 8) + 8);
  }
  cVar1 = *(char *)((longlong)puVar4 + 0x61);
  while (cVar1 == '\0') {
    iVar3 = memcmp(param_3,puVar4 + 3,0x10);
    if (iVar3 < 0) {
      puVar5 = (undefined8 *)*puVar4;
      puVar6 = puVar4;
    }
    else {
      puVar5 = (undefined8 *)puVar4[2];
    }
    puVar4 = puVar5;
    cVar1 = *(char *)((longlong)puVar5 + 0x61);
  }
  *param_2 = (longlong)puVar2;
  param_2[1] = (longlong)puVar6;
  return param_2;
}



void FUN_14000b8e0(undefined8 param_1,longlong *param_2)

{
  char cVar1;
  longlong *plVar2;
  
  cVar1 = *(char *)((longlong)param_2 + 0x61);
  while (cVar1 == '\0') {
    FUN_14000b8e0(param_1,param_2[2]);
    plVar2 = (longlong *)*param_2;
    operator_delete(param_2);
    param_2 = plVar2;
    cVar1 = *(char *)((longlong)plVar2 + 0x61);
  }
  return;
}



void FUN_14000b940(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  
  plVar1 = *(longlong **)(param_2 + 0x10);
  *(longlong *)(param_2 + 0x10) = *plVar1;
  if (*(char *)(*plVar1 + 0x61) == '\0') {
    *(longlong *)(*plVar1 + 8) = param_2;
  }
  plVar1[1] = *(longlong *)(param_2 + 8);
  if (param_2 == *(longlong *)(*(longlong *)(param_1 + 8) + 8)) {
    *(longlong **)(*(longlong *)(param_1 + 8) + 8) = plVar1;
    *plVar1 = param_2;
    *(longlong **)(param_2 + 8) = plVar1;
    return;
  }
  plVar2 = *(longlong **)(param_2 + 8);
  if (param_2 == *plVar2) {
    *plVar2 = (longlong)plVar1;
    *plVar1 = param_2;
    *(longlong **)(param_2 + 8) = plVar1;
    return;
  }
  plVar2[2] = (longlong)plVar1;
  *plVar1 = param_2;
  *(longlong **)(param_2 + 8) = plVar1;
  return;
}



void FUN_14000b9a0(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *param_2;
  *param_2 = *(longlong *)(lVar1 + 0x10);
  if (*(char *)(*(longlong *)(lVar1 + 0x10) + 0x61) == '\0') {
    *(longlong **)(*(longlong *)(lVar1 + 0x10) + 8) = param_2;
  }
  *(longlong *)(lVar1 + 8) = param_2[1];
  if (param_2 == *(longlong **)(*(longlong *)(param_1 + 8) + 8)) {
    *(longlong *)(*(longlong *)(param_1 + 8) + 8) = lVar1;
    *(longlong **)(lVar1 + 0x10) = param_2;
    param_2[1] = lVar1;
    return;
  }
  plVar2 = (longlong *)param_2[1];
  if (param_2 == (longlong *)plVar2[2]) {
    plVar2[2] = lVar1;
    *(longlong **)(lVar1 + 0x10) = param_2;
    param_2[1] = lVar1;
    return;
  }
  *plVar2 = lVar1;
  *(longlong **)(lVar1 + 0x10) = param_2;
  param_2[1] = lVar1;
  return;
}



undefined8 * FUN_14000ba00(longlong param_1,undefined8 *param_2,void *param_3)

{
  char cVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  bool bVar7;
  undefined1 local_res8 [8];
  
  puVar5 = (undefined8 *)(*(undefined8 **)(param_1 + 8))[1];
  bVar7 = true;
  cVar1 = *(char *)((longlong)puVar5 + 0x61);
  puVar2 = *(undefined8 **)(param_1 + 8);
  while (cVar1 == '\0') {
    iVar4 = memcmp((void *)((longlong)param_3 + 0x18),puVar5 + 3,0x10);
    bVar7 = iVar4 < 0;
    if (bVar7) {
      puVar6 = (undefined8 *)*puVar5;
    }
    else {
      puVar6 = (undefined8 *)puVar5[2];
    }
    puVar2 = puVar5;
    puVar5 = puVar6;
    cVar1 = *(char *)((longlong)puVar6 + 0x61);
  }
  puVar5 = puVar2;
  if (bVar7 != false) {
    if (puVar2 == (undefined8 *)**(undefined8 **)(param_1 + 8)) {
      bVar7 = true;
      goto LAB_14000ba79;
    }
    if (*(char *)((longlong)puVar2 + 0x61) == '\0') {
      puVar5 = (undefined8 *)*puVar2;
      if (*(char *)((longlong)puVar5 + 0x61) == '\0') {
        cVar1 = *(char *)((longlong)puVar5[2] + 0x61);
        puVar6 = (undefined8 *)puVar5[2];
        while (cVar1 == '\0') {
          cVar1 = *(char *)((longlong)puVar6[2] + 0x61);
          puVar5 = puVar6;
          puVar6 = (undefined8 *)puVar6[2];
        }
      }
      else {
        cVar1 = *(char *)((longlong)puVar2[1] + 0x61);
        puVar6 = (undefined8 *)puVar2[1];
        puVar5 = puVar2;
        while ((puVar3 = puVar6, cVar1 == '\0' && (puVar5 == (undefined8 *)*puVar3))) {
          cVar1 = *(char *)((longlong)puVar3[1] + 0x61);
          puVar6 = (undefined8 *)puVar3[1];
          puVar5 = puVar3;
        }
        if (*(char *)((longlong)puVar5 + 0x61) == '\0') {
          puVar5 = puVar3;
        }
      }
    }
    else {
      puVar5 = (undefined8 *)puVar2[2];
    }
  }
  iVar4 = memcmp(puVar5 + 3,(void *)((longlong)param_3 + 0x18),0x10);
  if (-1 < iVar4) {
    operator_delete(param_3);
    *param_2 = puVar5;
    *(undefined1 *)(param_2 + 1) = 0;
    return param_2;
  }
LAB_14000ba79:
  puVar5 = (undefined8 *)FUN_14000bbd0(param_1,local_res8,bVar7,puVar2,param_3);
  *(undefined1 *)(param_2 + 1) = 1;
  *param_2 = *puVar5;
  return param_2;
}



void FUN_14000bb50(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_1400239a0(pvVar1);
    if (DAT_14031fed0 != (void *)0x0) {
      operator_delete__(DAT_14031fed0);
      DAT_14031fed0 = (void *)0x0;
    }
    if (*(void **)((longlong)pvVar1 + 8) != (void *)0x0) {
      operator_delete(*(void **)((longlong)pvVar1 + 8));
    }
    *(undefined8 *)((longlong)pvVar1 + 8) = 0;
    *(undefined8 *)((longlong)pvVar1 + 0x10) = 0;
    *(undefined8 *)((longlong)pvVar1 + 0x18) = 0;
    operator_delete(pvVar1);
  }
  return;
}



undefined8 *
FUN_14000bbd0(longlong param_1,undefined8 *param_2,char param_3,undefined8 *param_4,
             longlong *param_5)

{
  char cVar1;
  longlong *plVar2;
  code *pcVar3;
  undefined8 *puVar4;
  longlong lVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong *plVar8;
  
  if (0x38e38e38e38e38c < *(ulonglong *)(param_1 + 0x10)) {
    operator_delete(param_5);
    std::_Xlength_error("map/set<T> too long");
    pcVar3 = (code *)swi(3);
    puVar4 = (undefined8 *)(*pcVar3)();
    return puVar4;
  }
  *(ulonglong *)(param_1 + 0x10) = *(ulonglong *)(param_1 + 0x10) + 1;
  param_5[1] = (longlong)param_4;
  if (param_4 == *(undefined8 **)(param_1 + 8)) {
    (*(undefined8 **)(param_1 + 8))[1] = param_5;
    **(undefined8 **)(param_1 + 8) = param_5;
    lVar5 = *(longlong *)(param_1 + 8);
  }
  else {
    if (param_3 != '\0') {
      *param_4 = param_5;
      if (param_4 == (undefined8 *)**(longlong **)(param_1 + 8)) {
        **(longlong **)(param_1 + 8) = (longlong)param_5;
      }
      goto LAB_14000bc5a;
    }
    param_4[2] = param_5;
    lVar5 = *(longlong *)(param_1 + 8);
    if (param_4 != *(undefined8 **)(lVar5 + 0x10)) goto LAB_14000bc5a;
  }
  *(longlong **)(lVar5 + 0x10) = param_5;
LAB_14000bc5a:
  cVar1 = *(char *)(param_5[1] + 0x60);
  plVar7 = param_5;
  do {
    if (cVar1 != '\0') {
      lVar5 = *(longlong *)(param_1 + 8);
      *param_2 = param_5;
      *(undefined1 *)(*(longlong *)(lVar5 + 8) + 0x60) = 1;
      return param_2;
    }
    plVar6 = (longlong *)plVar7[1];
    plVar8 = (longlong *)plVar6[1];
    if (plVar6 == (longlong *)*plVar8) {
      lVar5 = plVar8[2];
      if (*(char *)(lVar5 + 0x60) != '\0') {
        if (plVar7 == (longlong *)plVar6[2]) {
          plVar7 = (longlong *)plVar6[2];
          plVar6[2] = *plVar7;
          if (*(char *)(*plVar7 + 0x61) == '\0') {
            *(longlong **)(*plVar7 + 8) = plVar6;
          }
          plVar7[1] = plVar6[1];
          if (plVar6 == *(longlong **)(*(longlong *)(param_1 + 8) + 8)) {
            *(longlong **)(*(longlong *)(param_1 + 8) + 8) = plVar7;
          }
          else {
            plVar8 = (longlong *)plVar6[1];
            if (plVar6 == (longlong *)*plVar8) {
              *plVar8 = (longlong)plVar7;
            }
            else {
              plVar8[2] = (longlong)plVar7;
            }
          }
          *plVar7 = (longlong)plVar6;
          plVar6[1] = (longlong)plVar7;
          plVar7 = plVar6;
        }
        *(undefined1 *)(plVar7[1] + 0x60) = 1;
        *(undefined1 *)(*(longlong *)(plVar7[1] + 8) + 0x60) = 0;
        plVar6 = *(longlong **)(plVar7[1] + 8);
        plVar8 = (longlong *)*plVar6;
        *plVar6 = plVar8[2];
        if (*(char *)(plVar8[2] + 0x61) == '\0') {
          *(longlong **)(plVar8[2] + 8) = plVar6;
        }
        plVar8[1] = plVar6[1];
        if (plVar6 == *(longlong **)(*(longlong *)(param_1 + 8) + 8)) {
          *(longlong **)(*(longlong *)(param_1 + 8) + 8) = plVar8;
          plVar8[2] = (longlong)plVar6;
        }
        else {
          plVar2 = (longlong *)plVar6[1];
          if (plVar6 == (longlong *)plVar2[2]) {
            plVar2[2] = (longlong)plVar8;
            plVar8[2] = (longlong)plVar6;
          }
          else {
            *plVar2 = (longlong)plVar8;
            plVar8[2] = (longlong)plVar6;
          }
        }
        goto LAB_14000be38;
      }
LAB_14000bd62:
      *(undefined1 *)(plVar6 + 0xc) = 1;
      *(undefined1 *)(lVar5 + 0x60) = 1;
      *(undefined1 *)(*(longlong *)(plVar7[1] + 8) + 0x60) = 0;
      plVar7 = *(longlong **)(plVar7[1] + 8);
    }
    else {
      lVar5 = *plVar8;
      if (*(char *)(lVar5 + 0x60) == '\0') goto LAB_14000bd62;
      if (plVar7 == (longlong *)*plVar6) {
        lVar5 = *plVar6;
        *plVar6 = *(longlong *)(lVar5 + 0x10);
        if (*(char *)(*(longlong *)(lVar5 + 0x10) + 0x61) == '\0') {
          *(longlong **)(*(longlong *)(lVar5 + 0x10) + 8) = plVar6;
        }
        *(longlong *)(lVar5 + 8) = plVar6[1];
        if (plVar6 == *(longlong **)(*(longlong *)(param_1 + 8) + 8)) {
          *(longlong *)(*(longlong *)(param_1 + 8) + 8) = lVar5;
        }
        else {
          plVar7 = (longlong *)plVar6[1];
          if (plVar6 == (longlong *)plVar7[2]) {
            plVar7[2] = lVar5;
          }
          else {
            *plVar7 = lVar5;
          }
        }
        *(longlong **)(lVar5 + 0x10) = plVar6;
        plVar6[1] = lVar5;
        plVar7 = plVar6;
      }
      *(undefined1 *)(plVar7[1] + 0x60) = 1;
      *(undefined1 *)(*(longlong *)(plVar7[1] + 8) + 0x60) = 0;
      plVar6 = *(longlong **)(plVar7[1] + 8);
      plVar8 = (longlong *)plVar6[2];
      plVar6[2] = *plVar8;
      if (*(char *)(*plVar8 + 0x61) == '\0') {
        *(longlong **)(*plVar8 + 8) = plVar6;
      }
      plVar8[1] = plVar6[1];
      if (plVar6 == *(longlong **)(*(longlong *)(param_1 + 8) + 8)) {
        *(longlong **)(*(longlong *)(param_1 + 8) + 8) = plVar8;
      }
      else {
        puVar4 = (undefined8 *)plVar6[1];
        if (plVar6 == (longlong *)*puVar4) {
          *puVar4 = plVar8;
        }
        else {
          puVar4[2] = plVar8;
        }
      }
      *plVar8 = (longlong)plVar6;
LAB_14000be38:
      plVar6[1] = (longlong)plVar8;
    }
    cVar1 = *(char *)(plVar7[1] + 0x60);
  } while( true );
}



undefined8 * FUN_14000be70(undefined8 *param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  
  *param_1 = 0;
  puVar1 = operator_new(0x18);
  if (puVar1 != (undefined8 *)0x0) {
    *(undefined4 *)(puVar1 + 1) = 1;
    *(undefined4 *)((longlong)puVar1 + 0xc) = 1;
    *puVar1 = boost::detail::sp_counted_impl_p<>::vftable;
    puVar1[2] = param_2;
  }
  *param_1 = puVar1;
  return param_1;
}



longlong FUN_14000bee0(undefined8 param_1,undefined4 *param_2)

{
  longlong lVar1;
  
  lVar1 = FUN_14000bff0();
  if ((undefined4 *)(lVar1 + 0x18) != (undefined4 *)0x0) {
    *(undefined4 *)(lVar1 + 0x18) = *param_2;
    *(undefined4 *)(lVar1 + 0x1c) = param_2[1];
    *(undefined4 *)(lVar1 + 0x20) = param_2[2];
    *(undefined4 *)(lVar1 + 0x24) = param_2[3];
    *(undefined8 *)(lVar1 + 0x28) = *(undefined8 *)(param_2 + 4);
    *(undefined8 *)(lVar1 + 0x30) = *(undefined8 *)(param_2 + 6);
    *(undefined8 *)(lVar1 + 0x38) = *(undefined8 *)(param_2 + 8);
    *(undefined8 *)(lVar1 + 0x40) = *(undefined8 *)(param_2 + 10);
    *(undefined8 *)(lVar1 + 0x48) = *(undefined8 *)(param_2 + 0xc);
    *(undefined8 *)(lVar1 + 0x50) = *(undefined8 *)(param_2 + 0xe);
    *(undefined8 *)(lVar1 + 0x58) = *(undefined8 *)(param_2 + 0x10);
  }
  return lVar1;
}



void FUN_14000bf70(ulonglong *param_1,ulonglong *param_2)

{
  ulonglong *puVar1;
  ulonglong *puVar2;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 9;
    do {
      if (7 < *puVar2) {
        operator_delete((void *)puVar2[-3]);
      }
      *puVar2 = 7;
      puVar2[-1] = 0;
      *(undefined2 *)(puVar2 + -3) = 0;
      if (7 < puVar2[-5]) {
        operator_delete((void *)puVar2[-8]);
      }
      puVar2[-5] = 7;
      puVar2[-6] = 0;
      *(undefined2 *)(puVar2 + -8) = 0;
      puVar1 = puVar2 + 2;
      puVar2 = puVar2 + 0xb;
    } while (puVar1 != param_2);
  }
  return;
}



void FUN_14000bff0(longlong param_1)

{
  undefined8 uVar1;
  undefined8 *puVar2;
  char *local_res10 [3];
  undefined **local_28 [4];
  
  puVar2 = operator_new(0x68);
  if (puVar2 != (undefined8 *)0x0) {
    *puVar2 = *(undefined8 *)(param_1 + 8);
    puVar2[1] = *(undefined8 *)(param_1 + 8);
    uVar1 = *(undefined8 *)(param_1 + 8);
    *(undefined2 *)(puVar2 + 0xc) = 0;
    puVar2[2] = uVar1;
    return;
  }
  local_res10[0] = (char *)0x0;
  std::exception::exception((exception *)local_28,local_res10);
  local_28[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_28,(ThrowInfo *)&DAT_1402f47a8);
}



void FUN_14000c070(longlong param_1)

{
  undefined8 *puVar1;
  
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  if (puVar1 != (undefined8 *)0x0) {
    if ((void *)*puVar1 != (void *)0x0) {
      operator_delete((void *)*puVar1);
    }
    *puVar1 = 0;
    puVar1[1] = 0;
    puVar1[2] = 0;
    operator_delete(puVar1);
  }
  return;
}



undefined8 * FUN_14000c0b0(undefined8 *param_1,byte param_2)

{
  *param_1 = boost::detail::sp_counted_base::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14000c0e0(undefined8 *param_1)

{
  if (param_1 != (undefined8 *)0x0) {
    if ((void *)*param_1 != (void *)0x0) {
      operator_delete((void *)*param_1);
    }
    *param_1 = 0;
    param_1[1] = 0;
    param_1[2] = 0;
    operator_delete(param_1);
  }
  return;
}



void FUN_14000c120(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x48)) {
    operator_delete(*(void **)(param_1 + 0x30));
  }
  *(undefined8 *)(param_1 + 0x48) = 7;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined2 *)(param_1 + 0x30) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x20)) {
    operator_delete(*(void **)(param_1 + 8));
  }
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined2 *)(param_1 + 8) = 0;
  return;
}



void FUN_14000c180(longlong param_1)

{
  FUN_140004900(param_1 + -8);
  return;
}



void FUN_14000c190(void)

{
  return;
}



void thunk_FUN_14000c2a0(longlong *param_1)

{
  int *piVar1;
  undefined *puVar2;
  undefined8 uVar3;
  
  puVar2 = (undefined *)*param_1;
  if (((puVar2 == (undefined *)0x0) || (puVar2 == PTR_DAT_1402f8008)) ||
     (puVar2 + -8 == (undefined *)0x0)) {
    *param_1 = (longlong)PTR_DAT_1402f8008;
  }
  else {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2 + -8);
    }
    FUN_1400d1290(uVar3);
    *param_1 = (longlong)PTR_DAT_1402f8008;
  }
  return;
}



void FUN_14000c1c0(longlong *param_1,int param_2)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  undefined *puVar4;
  
  puVar4 = PTR_DAT_1402f8008;
  puVar1 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar1 = PTR_DAT_1402f8008;
  }
  *param_1 = (longlong)puVar1;
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2 == 0) {
    FUN_14000c2a0(param_1);
    return;
  }
  iVar3 = 0;
  if (puVar1 != (undefined *)0x0) {
    if (puVar1 == puVar4) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(puVar1 + -8);
    }
  }
  if (param_2 != iVar3) {
    piVar2 = (int *)FUN_1400a34c0();
    if (piVar2 != (int *)0x0) {
      *piVar2 = 0;
      piVar2[1] = 1;
    }
    puVar1 = PTR_DAT_1402f8008;
    *piVar2 = param_2;
    puVar4 = (undefined *)*param_1;
    if (puVar4 == (undefined *)0x0) {
      iVar3 = 0;
    }
    else if (puVar4 == puVar1) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(puVar4 + -8);
    }
    if (iVar3 <= param_2) {
      if ((puVar4 == (undefined *)0x0) || (puVar4 == puVar1)) {
        param_2 = 0;
      }
      else {
        param_2 = *(int *)(puVar4 + -8);
      }
    }
    if (puVar4 == (undefined *)0x0) {
      puVar4 = puVar1;
    }
    FUN_1400a3390(piVar2 + 2,puVar4,param_2);
    FUN_14000c2a0(param_1);
    *param_1 = (longlong)(piVar2 + 2);
  }
  return;
}



void FUN_14000c2a0(longlong *param_1)

{
  int *piVar1;
  undefined *puVar2;
  undefined8 uVar3;
  
  puVar2 = (undefined *)*param_1;
  if (((puVar2 == (undefined *)0x0) || (puVar2 == PTR_DAT_1402f8008)) ||
     (puVar2 + -8 == (undefined *)0x0)) {
    *param_1 = (longlong)PTR_DAT_1402f8008;
  }
  else {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2 + -8);
    }
    FUN_1400d1290(uVar3);
    *param_1 = (longlong)PTR_DAT_1402f8008;
  }
  return;
}



void FUN_14000c330(longlong *param_1)

{
  undefined *puVar1;
  undefined8 *puVar2;
  undefined4 *puVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined *puVar6;
  
  puVar6 = (undefined *)*param_1;
  if (puVar6 == (undefined *)0x0) {
    *param_1 = (longlong)PTR_DAT_1402f8008;
  }
  else if ((puVar6 != PTR_DAT_1402f8008) && ((int *)(puVar6 + -8) != (int *)0x0)) {
    if (*(int *)(puVar6 + -4) < 2) {
      return;
    }
    if (*(int *)(puVar6 + -8) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    puVar3 = (undefined4 *)FUN_1400a34c0();
    uVar4 = 0;
    if (puVar3 != (undefined4 *)0x0) {
      *puVar3 = 0;
      puVar3[1] = 1;
    }
    puVar1 = PTR_DAT_1402f8008;
    puVar6 = (undefined *)*param_1;
    if (puVar6 == (undefined *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = uVar4;
      if (puVar6 != PTR_DAT_1402f8008) {
        uVar5 = *(undefined4 *)(puVar6 + -8);
      }
    }
    *puVar3 = uVar5;
    puVar6 = (undefined *)*param_1;
    if ((puVar6 != (undefined *)0x0) && (puVar6 != puVar1)) {
      uVar4 = *(undefined4 *)(puVar6 + -8);
    }
    if (puVar6 == (undefined *)0x0) {
      puVar6 = puVar1;
    }
    FUN_1400a3390(puVar3 + 2,puVar6,uVar4);
    FUN_14000c2a0(param_1);
    *param_1 = (longlong)(puVar3 + 2);
    return;
  }
  puVar2 = (undefined8 *)FUN_1400a34c0();
  *puVar2 = 0;
  *(undefined1 *)(puVar2 + 1) = 0;
  if (puVar2 != (undefined8 *)0x0) {
    *(undefined4 *)puVar2 = 0;
    *(undefined4 *)((longlong)puVar2 + 4) = 1;
  }
  *(undefined1 *)(puVar2 + 1) = 0;
  *param_1 = (longlong)(puVar2 + 1);
  return;
}



undefined * FUN_14000c420(longlong *param_1,int param_2)

{
  int iVar1;
  undefined *puVar2;
  int iVar3;
  
  puVar2 = (undefined *)*param_1;
  iVar3 = 0;
  if ((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8008)) {
    iVar3 = *(int *)(puVar2 + -8);
  }
  if (((param_2 <= iVar3) && (param_2 = 0, puVar2 != (undefined *)0x0)) &&
     (puVar2 != PTR_DAT_1402f8008)) {
    param_2 = *(int *)(puVar2 + -8);
  }
  iVar3 = 1;
  if (1 < param_2) {
    iVar3 = param_2;
  }
  iVar1 = 0;
  if ((puVar2 != (undefined *)0x0) && (iVar1 = 0, puVar2 != PTR_DAT_1402f8008)) {
    iVar1 = *(int *)(puVar2 + -8);
  }
  if (iVar1 < iVar3) {
    FUN_14000c1c0(param_1,iVar3);
  }
  FUN_14000c330(param_1);
  puVar2 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar2 = PTR_DAT_1402f8008;
  }
  return puVar2;
}



void FUN_14000c4a0(longlong *param_1,int param_2)

{
  int *piVar1;
  undefined *puVar2;
  int iVar3;
  int iVar4;
  
  puVar2 = (undefined *)*param_1;
  iVar4 = 0;
  if (0 < param_2) {
    iVar4 = param_2;
  }
  if (puVar2 == (undefined *)0x0) {
    iVar3 = 0;
  }
  else if (puVar2 == PTR_DAT_1402f8008) {
    iVar3 = 0;
  }
  else {
    iVar3 = *(int *)(puVar2 + -8);
  }
  if (iVar3 <= iVar4) {
    if (puVar2 == (undefined *)0x0) {
      iVar4 = 0;
    }
    else if (puVar2 == PTR_DAT_1402f8008) {
      iVar4 = 0;
    }
    else {
      iVar4 = *(int *)(puVar2 + -8);
    }
  }
  if (((puVar2 != PTR_DAT_1402f8008) && (puVar2 != (undefined *)0x0)) &&
     (piVar1 = (int *)(puVar2 + -8), piVar1 != (int *)0x0)) {
    *piVar1 = iVar4;
    *(undefined1 *)((longlong)iVar4 + 8 + (longlong)piVar1) = 0;
  }
  return;
}



void FUN_14000c510(longlong *param_1)

{
  int *piVar1;
  undefined *puVar2;
  int iVar3;
  int iVar4;
  
  iVar3 = FUN_1400a3360();
  iVar4 = 0;
  if (0 < iVar3) {
    iVar4 = iVar3;
  }
  puVar2 = (undefined *)*param_1;
  if (puVar2 == (undefined *)0x0) {
    iVar3 = 0;
  }
  else if (puVar2 == PTR_DAT_1402f8008) {
    iVar3 = 0;
  }
  else {
    iVar3 = *(int *)(puVar2 + -8);
  }
  if (iVar3 <= iVar4) {
    if (puVar2 == (undefined *)0x0) {
      iVar4 = 0;
    }
    else if (puVar2 == PTR_DAT_1402f8008) {
      iVar4 = 0;
    }
    else {
      iVar4 = *(int *)(puVar2 + -8);
    }
  }
  if (((puVar2 != PTR_DAT_1402f8008) && (puVar2 != (undefined *)0x0)) &&
     (piVar1 = (int *)(puVar2 + -8), piVar1 != (int *)0x0)) {
    *piVar1 = iVar4;
    *(undefined1 *)((longlong)iVar4 + 8 + (longlong)piVar1) = 0;
  }
  return;
}



undefined8 * FUN_14000c590(undefined8 *param_1,undefined8 param_2,int param_3)

{
  int iVar1;
  int iVar2;
  undefined8 uVar3;
  
  FUN_1400a3440();
  *param_1 = PTR_DAT_1402f8008;
  iVar2 = FUN_1400a3360(param_2);
  iVar1 = iVar2;
  if ((0 < param_3) && (iVar1 = param_3, iVar2 < param_3)) {
    iVar1 = iVar2;
  }
  uVar3 = FUN_14000c420(param_1,iVar1);
  FUN_1400a3390(uVar3,param_2,iVar1);
  FUN_14000c510(param_1);
  return param_1;
}



void FUN_14000c610(undefined8 *param_1)

{
  if (param_1 != (undefined8 *)0x0) {
    (**(code **)*param_1)(param_1,1);
  }
  return;
}



ulonglong FUN_14000c630(ushort *param_1,ushort *param_2)

{
  ulonglong uVar1;
  ulonglong uVar2;
  int iVar3;
  ulonglong uVar4;
  
  uVar1 = *(ulonglong *)(param_2 + 8);
  if (7 < *(ulonglong *)(param_2 + 0xc)) {
    param_2 = *(ushort **)param_2;
  }
  uVar2 = *(ulonglong *)(param_1 + 8);
  if (7 < *(ulonglong *)(param_1 + 0xc)) {
    param_1 = *(ushort **)param_1;
  }
  uVar4 = uVar1;
  if (uVar2 < uVar1) {
    uVar4 = uVar2;
  }
  do {
    if (uVar4 == 0) {
      iVar3 = 0;
LAB_14000c688:
      uVar4 = (ulonglong)iVar3;
      if (iVar3 == 0) {
        if (uVar2 < uVar1) {
          return 0xffffffff;
        }
        uVar4 = (ulonglong)(uVar2 != uVar1);
      }
      return uVar4;
    }
    if (*param_1 != *param_2) {
      iVar3 = 1;
      if (*param_1 < *param_2) {
        iVar3 = -1;
      }
      goto LAB_14000c688;
    }
    param_1 = param_1 + 1;
    param_2 = param_2 + 1;
    uVar4 = uVar4 - 1;
  } while( true );
}



void FUN_14000c6c0(undefined4 param_1)

{
  undefined4 local_res8 [8];
  
  local_res8[0] = param_1;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_res8,(ThrowInfo *)&DAT_1402f4800);
}



// WARNING: Removing unreachable block (ram,0x00014000c748)
// WARNING: Removing unreachable block (ram,0x00014000c751)
// WARNING: Removing unreachable block (ram,0x00014000c76f)
// WARNING: Removing unreachable block (ram,0x00014000c778)

undefined8 * FUN_14000c6e0(undefined8 *param_1)

{
  *param_1 = CMagiAuthIP::vftable;
  param_1[1] = 0;
  param_1[2] = 0;
  *(undefined4 *)(param_1 + 3) = 0x11;
  *(undefined4 *)(param_1 + 7) = 0;
  *(undefined4 *)((longlong)param_1 + 0x3c) = 10;
  param_1[8] = 0;
  param_1[9] = 0;
  *(undefined4 *)((longlong)param_1 + 0x1c) = 0x3f400000;
  *(undefined4 *)(param_1 + 4) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x24) = 0x40100000;
  param_1[5] = 0x26;
  param_1[6] = 0;
  param_1[10] = 0;
  param_1[0xb] = 0;
  *(undefined4 *)(param_1 + 0xc) = 0x11;
  *(undefined4 *)(param_1 + 0x10) = 0;
  *(undefined4 *)((longlong)param_1 + 0x84) = 10;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  *(undefined4 *)((longlong)param_1 + 100) = 0x3f400000;
  *(undefined4 *)(param_1 + 0xd) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x6c) = 0x40100000;
  param_1[0xe] = 0x26;
  param_1[0xf] = 0;
  param_1[0x13] = 0;
  param_1[0x14] = 0;
  param_1[0x15] = 0;
  return param_1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_14000c800(undefined8 *param_1,uint param_2)

{
  *param_1 = CMagiAuthIP::vftable;
  if ((void *)param_1[0x13] != (void *)0x0) {
    operator_delete((void *)param_1[0x13]);
  }
  param_1[0x13] = 0;
  param_1[0x14] = 0;
  param_1[0x15] = 0;
  FUN_14001ceb0(param_1 + 10);
  FUN_14000d1f0(param_1 + 1);
  _DAT_140320148 = 0;
  *param_1 = MBISingleton<>::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14000c890(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  int iVar2;
  int iVar3;
  longlong lVar4;
  undefined *puVar5;
  int iVar6;
  ulonglong uVar7;
  longlong lVar8;
  longlong lVar9;
  uint uVar10;
  undefined1 auStack_148 [32];
  undefined *local_128;
  undefined1 local_120 [24];
  undefined8 local_108;
  undefined8 uStack_100;
  undefined8 local_f8;
  undefined8 uStack_f0;
  undefined4 local_e8;
  undefined4 uStack_e4;
  undefined4 uStack_e0;
  undefined4 uStack_dc;
  undefined4 local_d8;
  undefined4 uStack_d4;
  undefined4 uStack_d0;
  undefined4 uStack_cc;
  undefined2 local_c8;
  undefined **local_c0;
  undefined4 local_b8;
  undefined2 local_b4;
  undefined4 local_a8;
  undefined8 local_a0;
  undefined8 uStack_98;
  undefined8 local_90;
  undefined8 uStack_88;
  undefined4 local_80;
  undefined4 uStack_7c;
  undefined4 uStack_78;
  undefined4 uStack_74;
  undefined4 local_70;
  undefined4 uStack_6c;
  undefined4 uStack_68;
  undefined4 uStack_64;
  undefined2 local_60;
  undefined **local_58;
  undefined4 local_50;
  undefined2 local_4c;
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_148;
  FUN_14000d000(param_1 + 8);
  uVar10 = 0;
  lVar1 = param_2[1] - *param_2 >> 0x3f;
  lVar9 = (param_2[1] - *param_2) / 0x62 + lVar1;
  if (lVar9 != lVar1) {
    lVar8 = 0;
    uVar7 = 0;
    do {
      local_c0 = Proud::AddrPort::vftable;
      local_b8 = 0;
      local_b4 = 0;
      wcscpy_s((wchar_t *)&local_108,0x20,(wchar_t *)(uVar7 * 0x62 + *param_2));
      local_c8 = *(undefined2 *)(lVar8 + 0x40 + *param_2);
      lVar4 = uVar7 * 0x62 + 0x42 + *param_2;
      FUN_1400a3440();
      local_128 = PTR_DAT_1402f8010;
      iVar2 = FUN_1400a32c0(lVar4);
      if (local_128 == (undefined *)0x0) {
        iVar6 = 0;
      }
      else if (local_128 == PTR_DAT_1402f8010) {
        iVar6 = 0;
      }
      else {
        iVar6 = *(int *)(local_128 + -8);
      }
      iVar3 = iVar2;
      if (iVar2 <= iVar6) {
        if (local_128 == (undefined *)0x0) {
          iVar3 = 0;
        }
        else if (local_128 == PTR_DAT_1402f8010) {
          iVar3 = 0;
        }
        else {
          iVar3 = *(int *)(local_128 + -8);
        }
      }
      iVar6 = 1;
      if (1 < iVar3) {
        iVar6 = iVar3;
      }
      if (local_128 == (undefined *)0x0) {
        iVar3 = 0;
      }
      else if (local_128 == PTR_DAT_1402f8010) {
        iVar3 = 0;
      }
      else {
        iVar3 = *(int *)(local_128 + -8);
      }
      if (iVar3 < iVar6) {
        FUN_140002d50(&local_128);
      }
      FUN_140002e30(&local_128);
      puVar5 = local_128;
      if (local_128 == (undefined *)0x0) {
        puVar5 = PTR_DAT_1402f8010;
      }
      FUN_1400a32f0(puVar5,lVar4,iVar2);
      puVar5 = local_128;
      if (local_128 == (undefined *)0x0) {
        puVar5 = PTR_DAT_1402f8010;
      }
      iVar3 = FUN_1400a32c0(puVar5);
      iVar2 = 0;
      iVar6 = 0;
      if (0 < iVar3) {
        iVar6 = iVar3;
      }
      if ((local_128 != (undefined *)0x0) && (local_128 != PTR_DAT_1402f8010)) {
        iVar2 = *(int *)(local_128 + -8);
      }
      if ((iVar6 < iVar2) || (iVar6 = 0, local_128 == (undefined *)0x0)) {
LAB_14000ca40:
        if (((local_128 != PTR_DAT_1402f8010) && (local_128 != (undefined *)0x0)) &&
           ((int *)(local_128 + -8) != (int *)0x0)) {
          *(int *)(local_128 + -8) = iVar6;
          *(undefined2 *)(local_128 + (longlong)iVar6 * 2) = 0;
        }
      }
      else if (local_128 != PTR_DAT_1402f8010) {
        iVar6 = *(int *)(local_128 + -8);
        goto LAB_14000ca40;
      }
      lVar4 = FUN_1400a6870(local_120,&local_128,0);
      local_b8 = *(undefined4 *)(lVar4 + 8);
      local_b4 = *(undefined2 *)(lVar4 + 0xc);
      local_a0 = local_108;
      uStack_98 = uStack_100;
      local_90 = local_f8;
      uStack_88 = uStack_f0;
      local_80 = local_e8;
      uStack_7c = uStack_e4;
      uStack_78 = uStack_e0;
      uStack_74 = uStack_dc;
      local_70 = local_d8;
      uStack_6c = uStack_d4;
      uStack_68 = uStack_d0;
      uStack_64 = uStack_cc;
      local_60 = local_c8;
      local_58 = Proud::AddrPort::vftable;
      local_a8 = local_b8;
      local_50 = local_b8;
      local_4c = local_b4;
      FUN_14000cee0(param_1 + 8,local_b8,&local_a0);
      uVar10 = uVar10 + 1;
      lVar8 = lVar8 + 0x62;
      uVar7 = (ulonglong)uVar10;
    } while (uVar7 < (ulonglong)(lVar9 - lVar1));
  }
  return;
}



void FUN_14000cb20(longlong param_1,longlong *param_2,longlong *param_3)

{
  ulonglong *puVar1;
  undefined1 *puVar2;
  undefined1 *puVar3;
  undefined2 uVar4;
  longlong lVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  undefined *local_res8;
  undefined *local_res10;
  undefined1 local_78 [8];
  undefined4 local_70;
  undefined2 local_6c;
  undefined1 local_68 [8];
  undefined4 local_60;
  undefined2 local_5c;
  undefined4 local_58;
  undefined **local_50;
  undefined4 local_48;
  undefined2 local_44;
  
  FUN_14001d150(param_1 + 0x50);
  uVar7 = *(ulonglong *)(param_1 + 0xa0);
  puVar1 = (ulonglong *)(param_1 + 0x98);
  uVar8 = *puVar1;
  if (uVar8 != uVar7) {
    uVar9 = *(ulonglong *)(param_1 + 0xa0);
    if (uVar7 != uVar9) {
      lVar5 = uVar7 - uVar8;
      uVar7 = uVar8;
      do {
        uVar8 = uVar7 + 0x10;
        *(undefined4 *)(uVar7 + 8) = *(undefined4 *)(lVar5 + 8 + uVar7);
        *(undefined2 *)(uVar7 + 0xc) = *(undefined2 *)(lVar5 + -4 + uVar8);
        uVar7 = uVar8;
      } while (lVar5 + uVar8 != uVar9);
    }
    *(ulonglong *)(param_1 + 0xa0) = uVar8;
  }
  uVar8 = 0;
  uVar9 = param_2[1] - *param_2 >> 3;
  uVar7 = uVar8;
  if (uVar9 != 0) {
    do {
      if (*(int *)(*param_3 + uVar8) == 0) {
        lVar5 = *param_2;
        FUN_1400a3440();
        local_res8 = PTR_DAT_1402f8010;
        FUN_140003100(&local_res8,lVar5 + uVar7 * 8);
        FUN_1400a6870(local_68,&local_res8,0);
        local_50 = Proud::AddrPort::vftable;
        local_58 = local_60;
        local_48 = local_60;
        local_44 = local_5c;
        FUN_14000d210(param_1 + 0x50);
      }
      else if (*(int *)(*param_3 + uVar8) == 1) {
        lVar5 = *param_2;
        FUN_1400a3440();
        local_res10 = PTR_DAT_1402f8010;
        FUN_140003100(&local_res10,lVar5 + uVar7 * 8);
        FUN_1400a6870(local_78,&local_res10,0);
        puVar2 = *(undefined1 **)(param_1 + 0xa0);
        if ((local_78 < puVar2) && (puVar3 = (undefined1 *)*puVar1, puVar3 <= local_78)) {
          if (puVar2 == *(undefined1 **)(param_1 + 0xa8)) {
            FUN_14000cd40(puVar1);
          }
          puVar6 = *(undefined8 **)(param_1 + 0xa0);
          lVar5 = ((ulonglong)(local_78 + -(longlong)puVar3) & 0xfffffffffffffff0) + *puVar1;
          if (puVar6 != (undefined8 *)0x0) {
            *puVar6 = Proud::AddrPort::vftable;
            *(undefined4 *)(puVar6 + 1) = *(undefined4 *)(lVar5 + 8);
            uVar4 = *(undefined2 *)(lVar5 + 0xc);
LAB_14000cd0d:
            *(undefined2 *)((longlong)puVar6 + 0xc) = uVar4;
          }
        }
        else {
          if (puVar2 == *(undefined1 **)(param_1 + 0xa8)) {
            FUN_14000cd40(puVar1);
          }
          puVar6 = *(undefined8 **)(param_1 + 0xa0);
          if (puVar6 != (undefined8 *)0x0) {
            *puVar6 = Proud::AddrPort::vftable;
            *(undefined4 *)(puVar6 + 1) = local_70;
            uVar4 = local_6c;
            goto LAB_14000cd0d;
          }
        }
        *(longlong *)(param_1 + 0xa0) = *(longlong *)(param_1 + 0xa0) + 0x10;
      }
      uVar7 = (ulonglong)((int)uVar7 + 1);
      uVar8 = uVar8 + 4;
    } while (uVar7 < uVar9);
  }
  return;
}



void FUN_14000cd40(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = param_1[1] - *param_1 >> 4;
  if (0xffffffffffffffe < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = param_1[2] - *param_1 >> 4;
  if (uVar2 < uVar3) {
    if (0xfffffffffffffff - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_14000cdd0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_14000cdd0(param_1,uVar2);
  }
  return;
}



void FUN_14000cdd0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0xfffffffffffffff < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)(param_1[2] - *param_1 >> 4) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 << 4);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14000d9a0(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x10);
    param_1[1] = (longlong)(pcVar4 + (lVar2 - (longlong)pvVar1 & 0xfffffffffffffff0));
    *param_1 = (longlong)pcVar4;
  }
  return;
}



uint * FUN_14000cee0(longlong *param_1,uint param_2,longlong param_3)

{
  char cVar1;
  uint *puVar2;
  ulonglong uVar3;
  undefined2 *puVar4;
  longlong lVar5;
  
  uVar3 = (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar1 = FUN_14000d350(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x18)) {
      if ((puVar2[0x1a] == param_2) && (*puVar2 == param_2)) {
        puVar4 = (undefined2 *)((longlong)puVar2 + 10);
        lVar5 = 0x10;
        do {
          puVar4[-1] = *(undefined2 *)((param_3 - (longlong)(puVar2 + 2)) + -2 + (longlong)puVar4);
          *puVar4 = *(undefined2 *)((param_3 - (longlong)(puVar2 + 2)) + (longlong)puVar4);
          puVar4 = puVar4 + 2;
          lVar5 = lVar5 + -1;
        } while (lVar5 != 0);
        *(undefined2 *)(puVar2 + 0x12) = *(undefined2 *)(param_3 + 0x40);
        puVar2[0x16] = *(uint *)(param_3 + 0x50);
        *(undefined2 *)(puVar2 + 0x17) = *(undefined2 *)(param_3 + 0x54);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_14000d6c0(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  for (uVar3 = 0; (uint)uVar3 < 0x20; uVar3 = (ulonglong)((uint)uVar3 + 1)) {
    *(undefined2 *)((longlong)puVar2 + uVar3 * 2 + 8) = *(undefined2 *)(param_3 + uVar3 * 2);
  }
  *(undefined2 *)(puVar2 + 0x12) = *(undefined2 *)(param_3 + 0x40);
  puVar2[0x16] = *(uint *)(param_3 + 0x50);
  *(undefined2 *)(puVar2 + 0x17) = *(undefined2 *)(param_3 + 0x54);
  return puVar2;
}



void FUN_14000d000(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  uint uVar3;
  undefined4 uVar4;
  longlong lVar5;
  ulonglong uVar6;
  uint uVar7;
  longlong *plVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  float fVar11;
  uint local_res8;
  
  *(int *)(param_1 + 6) = (int)param_1[6] + 1;
  uVar10 = 0;
  if ((*param_1 != 0) && (local_res8 = 0, uVar6 = uVar10, uVar9 = uVar10, (int)param_1[2] != 0)) {
    do {
      lVar5 = *(longlong *)(uVar9 + *param_1);
      uVar7 = (uint)uVar6;
      while (lVar5 != 0) {
        lVar1 = *(longlong *)(lVar5 + 0x60);
        *(longlong *)(lVar5 + 0x60) = param_1[8];
        param_1[1] = param_1[1] + -1;
        uVar6 = param_1[1];
        param_1[8] = lVar5;
        if ((uVar6 < (ulonglong)param_1[5]) && ((int)param_1[6] == 0)) {
          fVar11 = (float)(longlong)uVar6;
          if ((longlong)uVar6 < 0) {
            fVar11 = fVar11 + 1.8446744e+19;
          }
          fVar11 = fVar11 / *(float *)((longlong)param_1 + 0x14);
          lVar5 = 0;
          if ((9.223372e+18 < fVar11) && (fVar11 = fVar11 - 9.223372e+18, fVar11 < 9.223372e+18)) {
            lVar5 = -0x8000000000000000;
          }
          uVar7 = (uint)((longlong)fVar11 + lVar5);
          if (0xffffffff < (ulonglong)((longlong)fVar11 + lVar5)) {
            uVar7 = 0xffffffff;
          }
          uVar6 = uVar10;
          if (0x11 < uVar7) {
            do {
              uVar6 = uVar6 + 1;
            } while ((uint)(&DAT_14024ea30)[uVar6] < uVar7);
          }
          uVar3 = (&DAT_14024ea30)[uVar6];
          if ((&DAT_14024ea30)[uVar6] == 0xffffffff) {
            uVar3 = uVar7;
          }
          FUN_14000d510(param_1,uVar3);
        }
        lVar5 = lVar1;
        uVar7 = local_res8;
        if (param_1[1] == 0) {
          param_1[8] = 0;
          plVar8 = (longlong *)param_1[7];
          if ((longlong *)param_1[7] != (longlong *)0x0) {
            do {
              plVar2 = (longlong *)*plVar8;
              free(plVar8);
              plVar8 = plVar2;
            } while (plVar2 != (longlong *)0x0);
            param_1[7] = 0;
          }
        }
      }
      local_res8 = uVar7 + 1;
      uVar6 = (ulonglong)local_res8;
      uVar9 = uVar9 + 8;
    } while (local_res8 < *(uint *)(param_1 + 2));
  }
  operator_delete__((void *)*param_1);
  *param_1 = 0;
  param_1[1] = 0;
  if ((int)param_1[6] == 0) {
    uVar4 = FUN_14001de50(param_1,0);
    FUN_14000d350(param_1,uVar4,0);
  }
  param_1[8] = 0;
  plVar8 = (longlong *)param_1[7];
  if ((longlong *)param_1[7] != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*plVar8;
      free(plVar8);
      plVar8 = plVar2;
    } while (plVar2 != (longlong *)0x0);
    param_1[7] = 0;
  }
  *(int *)(param_1 + 6) = (int)param_1[6] + -1;
  return;
}



void FUN_14000d1f0(void)

{
  FUN_14000d000();
  return;
}



uint * FUN_14000d210(longlong *param_1,uint param_2,longlong param_3)

{
  char cVar1;
  uint *puVar2;
  ulonglong uVar3;
  
  uVar3 = (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar1 = FUN_14000d350(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 6)) {
      if ((puVar2[8] == param_2) && (*puVar2 == param_2)) {
        puVar2[4] = *(uint *)(param_3 + 8);
        *(undefined2 *)(puVar2 + 5) = *(undefined2 *)(param_3 + 0xc);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_14000d830(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  puVar2[4] = *(uint *)(param_3 + 8);
  *(undefined2 *)(puVar2 + 5) = *(undefined2 *)(param_3 + 0xc);
  return puVar2;
}



void FUN_14000d2d0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x68) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x60); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0x60))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x60) = *(undefined8 *)(param_2 + 0x60);
      FUN_14000d480(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x60);
  FUN_14000d480(param_1,param_2);
  return;
}



ulonglong FUN_14000d350(undefined8 *param_1,uint param_2,char param_3)

{
  __uint64 _Var1;
  void *pvVar2;
  ulonglong uVar3;
  longlong lVar4;
  float fVar5;
  
  if ((void *)*param_1 != (void *)0x0) {
    operator_delete__((void *)*param_1);
    *param_1 = 0;
  }
  if (param_3 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_2),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_2),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    pvVar2 = operator_new(_Var1);
    *param_1 = pvVar2;
    if ((void *)*param_1 == (void *)0x0) {
      return (ulonglong)pvVar2 & 0xffffffffffffff00;
    }
    if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    memset((void *)*param_1,0,(ulonglong)param_2 << 3);
  }
  *(uint *)(param_1 + 2) = param_2;
  fVar5 = (float)param_2 * *(float *)((longlong)param_1 + 0x1c);
  lVar4 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar4 = -0x8000000000000000;
  }
  param_1[4] = (longlong)fVar5 + lVar4;
  fVar5 = (float)param_2 * *(float *)(param_1 + 3);
  lVar4 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar4 = -0x8000000000000000;
  }
  uVar3 = (longlong)fVar5 + lVar4;
  if ((ulonglong)((longlong)fVar5 + lVar4) < 0x11) {
    uVar3 = 0;
  }
  param_1[5] = uVar3;
  return CONCAT71((int7)(uVar3 >> 8),1);
}



void FUN_14000d480(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 != 0) {
    *(undefined8 *)(param_2 + 0x60) = *(undefined8 *)(param_1 + 0x40);
    *(longlong *)(param_1 + 8) = *(longlong *)(param_1 + 8) + -1;
    *(longlong *)(param_1 + 0x40) = param_2;
    if ((*(ulonglong *)(param_1 + 8) < *(ulonglong *)(param_1 + 0x28)) &&
       (*(int *)(param_1 + 0x30) == 0)) {
      uVar2 = FUN_14001de50();
      FUN_14000d510(param_1,uVar2);
    }
    if (*(longlong *)(param_1 + 8) == 0) {
      _Memory = *(longlong **)(param_1 + 0x38);
      *(undefined8 *)(param_1 + 0x40) = 0;
      if (_Memory != (longlong *)0x0) {
        do {
          plVar1 = (longlong *)*_Memory;
          free(_Memory);
          _Memory = plVar1;
        } while (plVar1 != (longlong *)0x0);
        *(undefined8 *)(param_1 + 0x38) = 0;
      }
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



void FUN_14000d510(longlong *param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  __uint64 _Var4;
  void *_Dst;
  longlong lVar5;
  uint uVar6;
  float fVar7;
  
  if (param_2 == 0) {
    param_2 = FUN_14001de50(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_14000d350(param_1,param_2,0);
    }
    else {
      _Var4 = SUB168(ZEXT816(8) * ZEXT416(param_2),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_2),8) != 0) {
        _Var4 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var4);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_2 << 3);
      uVar6 = 0;
      if ((int)param_1[2] != 0) {
        lVar5 = 0;
        do {
          lVar3 = *(longlong *)(lVar5 + *param_1);
          while (lVar3 != 0) {
            lVar1 = *(longlong *)(lVar3 + 0x60);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x68) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x60) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar3;
            lVar3 = lVar1;
          }
          uVar6 = uVar6 + 1;
          lVar5 = lVar5 + 8;
        } while (uVar6 < *(uint *)(param_1 + 2));
      }
      operator_delete__((void *)*param_1);
      *param_1 = (longlong)_Dst;
      *(uint *)(param_1 + 2) = param_2;
      fVar7 = (float)param_2 * *(float *)((longlong)param_1 + 0x1c);
      lVar5 = 0;
      if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      param_1[4] = (longlong)fVar7 + lVar5;
      fVar7 = (float)param_2 * *(float *)(param_1 + 3);
      lVar5 = 0;
      if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      param_1[5] = (longlong)fVar7 + lVar5;
      if ((ulonglong)((longlong)fVar7 + lVar5) < 0x11) {
        param_1[5] = 0;
      }
    }
  }
  return;
}



undefined4 *
FUN_14000d6c0(longlong *param_1,undefined4 param_2,ulonglong param_3,undefined4 param_4)

{
  int iVar1;
  undefined4 *puVar2;
  undefined1 auVar3 [16];
  undefined4 uVar4;
  longlong *plVar5;
  ulonglong uVar6;
  longlong lVar7;
  
  if (param_1[8] == 0) {
    uVar6 = CONCAT44(0,*(uint *)((longlong)param_1 + 0x34));
    if (uVar6 == 0) {
      lVar7 = 0;
    }
    else {
      auVar3._8_8_ = 0;
      auVar3._0_8_ = uVar6;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar3,0) < 0x70)
      goto LAB_14000d787;
      lVar7 = uVar6 * 0x70;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_14000d787:
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0xe + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0xc] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0xe;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x18);
  *puVar2 = param_2;
  *(undefined ***)(puVar2 + 0x14) = Proud::AddrPort::vftable;
  puVar2[0x16] = 0;
  *(undefined2 *)(puVar2 + 0x17) = 0;
  puVar2[0x1a] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x18) = *(undefined8 *)(*param_1 + (param_3 & 0xffffffff) * 8);
  *(undefined4 **)(*param_1 + (param_3 & 0xffffffff) * 8) = puVar2;
  if (((ulonglong)param_1[4] < (ulonglong)param_1[1]) && ((int)param_1[6] == 0)) {
    uVar4 = FUN_14001de50(param_1);
    FUN_14000d510(param_1,uVar4);
  }
  return puVar2;
}



undefined4 *
FUN_14000d830(longlong *param_1,undefined4 param_2,ulonglong param_3,undefined4 param_4)

{
  int iVar1;
  undefined4 *puVar2;
  undefined1 auVar3 [16];
  undefined4 uVar4;
  longlong *plVar5;
  ulonglong uVar6;
  longlong lVar7;
  
  if (param_1[8] == 0) {
    uVar6 = CONCAT44(0,*(uint *)((longlong)param_1 + 0x34));
    if (uVar6 == 0) {
      lVar7 = 0;
    }
    else {
      auVar3._8_8_ = 0;
      auVar3._0_8_ = uVar6;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar3,0) < 0x28)
      goto LAB_14000d8f7;
      lVar7 = uVar6 * 0x28;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_14000d8f7:
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 5 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[3] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -5;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 6);
  *puVar2 = param_2;
  *(undefined ***)(puVar2 + 2) = Proud::AddrPort::vftable;
  puVar2[4] = 0;
  *(undefined2 *)(puVar2 + 5) = 0;
  puVar2[8] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 6) = *(undefined8 *)(*param_1 + (param_3 & 0xffffffff) * 8);
  *(undefined4 **)(*param_1 + (param_3 & 0xffffffff) * 8) = puVar2;
  if (((ulonglong)param_1[4] < (ulonglong)param_1[1]) && ((int)param_1[6] == 0)) {
    uVar4 = FUN_14001de50(param_1);
    FUN_14009ab20(param_1,uVar4);
  }
  return puVar2;
}



undefined8 * FUN_14000d9a0(longlong param_1,longlong param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x10) {
    if (param_3 != (undefined8 *)0x0) {
      *param_3 = Proud::AddrPort::vftable;
      *(undefined4 *)(param_3 + 1) = *(undefined4 *)(param_1 + 8);
      *(undefined2 *)((longlong)param_3 + 0xc) = *(undefined2 *)(param_1 + 0xc);
    }
    param_3 = param_3 + 2;
  }
  return param_3;
}



undefined8 * FUN_14000d9f0(undefined8 *param_1,undefined8 param_2)

{
  FUN_1400a3440();
  *param_1 = PTR_DAT_1402f8010;
  FUN_140003100(param_1,param_2);
  return param_1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_14000da30(undefined8 *param_1,byte param_2)

{
  _DAT_140320148 = 0;
  *param_1 = MBISingleton<>::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14000da70(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  LPCSTR lpLibFileName;
  wchar_t *pwVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  lpLibFileName = (LPCSTR)&DAT_140320410;
  if (0xf < DAT_140320428) {
    lpLibFileName = DAT_140320410;
  }
  DAT_14031feb8 = LoadLibraryA(lpLibFileName);
  if (DAT_14031feb8 == (HMODULE)0x0) {
    pwVar1 = L"InitWindyAuth Dll Load Failed";
  }
  else {
    DAT_14031d5d0 = GetProcAddress(DAT_14031feb8,"GetBcustnoAndTypeAndState");
    if (DAT_14031d5d0 != (FARPROC)0x0) {
      return;
    }
    pwVar1 = L"InitWindyAuth ProcAddress Load Failed";
    DAT_14031d5d0 = (FARPROC)0x0;
  }
  FUN_1401e4980(DAT_140320100,pwVar1,param_3,param_4,uVar2);
  return;
}



void FUN_14000db10(void)

{
  DAT_14031feb8 = LoadLibraryA("XLSLogin.dll");
  if (DAT_14031feb8 == (HMODULE)0x0) {
    FUN_1401e4980(DAT_140320100,L"InitCHNAuth Dll Load Failed");
    return;
  }
  DAT_14031d5c8 = GetProcAddress(DAT_14031feb8,"SetSLoginTimeout");
  DAT_14031d5c0 = GetProcAddress(DAT_14031feb8,"SLoginRequest");
  if ((DAT_14031d5c8 == (FARPROC)0x0) || (DAT_14031d5c0 == (FARPROC)0x0)) {
    FUN_1401e4980(DAT_140320100,L"InitCHNAuth ProcAddress Load Failed");
  }
  return;
}



void FUN_14000dba0(longlong param_1)

{
  char cVar1;
  void *pvVar2;
  longlong lVar3;
  undefined1 local_30 [40];
  
  if (*(longlong *)(param_1 + 0x1f0) == 0) {
    pvVar2 = operator_new(0x160);
    lVar3 = 0;
    if (pvVar2 != (void *)0x0) {
      lVar3 = FUN_1400ae860(pvVar2);
    }
    *(longlong *)(param_1 + 0x1f0) = lVar3;
    if (lVar3 != 0) {
      cVar1 = FUN_1400aedb0(lVar3,"STAIRWCrypt_T7C0Xp28OBNH");
      if (cVar1 == '\x01') {
        FUN_1400aead0(*(undefined8 *)(param_1 + 0x1f0),&DAT_1402749b8);
        FUN_1400aed70(*(undefined8 *)(param_1 + 0x1f0),0x80);
        FUN_1400aef60(local_30);
        FUN_1400aec60(*(undefined8 *)(param_1 + 0x1f0),"WaYi1@3!%F_PassW",local_30);
        FUN_1400aed80(*(undefined8 *)(param_1 + 0x1f0),local_30);
        FUN_1400aea60(*(undefined8 *)(param_1 + 0x1f0),&DAT_1402749d4);
        FUN_1400aefd0(local_30);
      }
      else {
        printf("Crypt component unlock failed\n");
      }
    }
  }
  return;
}



void FUN_14000dc90(longlong param_1)

{
  char cVar1;
  void *pvVar2;
  longlong lVar3;
  undefined8 *puVar4;
  
  if (*(longlong *)(param_1 + 0x1f0) == 0) {
    pvVar2 = operator_new(0x160);
    lVar3 = 0;
    if (pvVar2 != (void *)0x0) {
      lVar3 = FUN_1400ae860(pvVar2);
    }
    *(longlong *)(param_1 + 0x1f0) = lVar3;
    if (lVar3 != 0) {
      cVar1 = FUN_1400aedb0(lVar3,"STAIRWCrypt_T7C0Xp28OBNH");
      if (cVar1 == '\x01') {
        FUN_1400aead0(*(undefined8 *)(param_1 + 0x1f0),&DAT_1402749b8);
        FUN_1400aecf0(*(undefined8 *)(param_1 + 0x1f0),&DAT_1402749d8);
        FUN_1400aed70(*(undefined8 *)(param_1 + 0x1f0),0x80);
        FUN_1400aed60(*(undefined8 *)(param_1 + 0x1f0),3);
        FUN_1400aea60(*(undefined8 *)(param_1 + 0x1f0),&DAT_1402749dc);
        lVar3 = FUN_1401e4420();
        puVar4 = (undefined8 *)(lVar3 + 0x1e8);
        if (0xf < *(ulonglong *)(lVar3 + 0x200)) {
          puVar4 = (undefined8 *)*puVar4;
        }
        FUN_1400aeae0(*(undefined8 *)(param_1 + 0x1f0),puVar4,&DAT_1402749e0);
      }
      else {
        printf("Crypt component unlock failed\n");
      }
    }
  }
  return;
}



undefined8 FUN_14000dd90(char *param_1,undefined8 *param_2)

{
  undefined8 *puVar1;
  char cVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  int iVar5;
  ulonglong uVar6;
  char *pcVar7;
  undefined8 *local_30;
  undefined8 *local_28;
  undefined8 local_20;
  
  local_30 = (undefined8 *)0x0;
  local_28 = (undefined8 *)0x0;
  local_20 = 0;
  puVar1 = param_2 + 2;
  if (0xf < (ulonglong)param_2[3]) {
    param_2 = (undefined8 *)*param_2;
  }
  FUN_1401e1a80(&local_30,param_2,(int)*puVar1 + 1,&DAT_1402749e8,0xfffffffffffffffe);
  puVar4 = local_28;
  puVar1 = local_30;
  if (1 < (ulonglong)(((longlong)local_28 - (longlong)local_30) / 0x28)) {
    uVar6 = 0xffffffffffffffff;
    pcVar7 = param_1;
    do {
      if (uVar6 == 0) break;
      uVar6 = uVar6 - 1;
      cVar2 = *pcVar7;
      pcVar7 = pcVar7 + 1;
    } while (cVar2 != '\0');
    iVar5 = FUN_14001f540(local_30,local_30[2],param_1,~uVar6 - 1);
    puVar3 = puVar1;
    if (iVar5 == 0) {
      for (; puVar3 != puVar4; puVar3 = puVar3 + 5) {
        if (0xf < (ulonglong)puVar3[3]) {
          operator_delete((void *)*puVar3);
        }
        puVar3[3] = 0xf;
        puVar3[2] = 0;
        *(undefined1 *)puVar3 = 0;
      }
      operator_delete(puVar1);
      return 1;
    }
  }
  puVar3 = puVar1;
  if (puVar1 != (undefined8 *)0x0) {
    for (; puVar3 != puVar4; puVar3 = puVar3 + 5) {
      if (0xf < (ulonglong)puVar3[3]) {
        operator_delete((void *)*puVar3);
      }
      puVar3[3] = 0xf;
      puVar3[2] = 0;
      *(undefined1 *)puVar3 = 0;
    }
    operator_delete(puVar1);
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_14000dee0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5)

{
  char cVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  int iVar5;
  char *pcVar6;
  char *pcVar7;
  char *pcVar8;
  ulonglong uVar9;
  undefined1 *puVar10;
  int iVar11;
  undefined1 auStack_108 [32];
  undefined8 *local_e8;
  undefined8 *local_e0;
  undefined8 local_d8;
  undefined8 local_c8;
  char local_c0;
  undefined7 uStack_bf;
  char *local_b0;
  ulonglong local_a8;
  undefined1 local_98;
  undefined7 uStack_97;
  undefined8 local_88;
  ulonglong local_80;
  char local_70;
  undefined7 uStack_6f;
  undefined8 local_60;
  ulonglong local_58;
  ulonglong local_48;
  
  local_c8 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  FUN_1400aeba0(*(undefined8 *)(param_1 + 0x1f0),param_2,&DAT_1402749dc);
  pcVar6 = (char *)FUN_1400aee30(*(undefined8 *)(param_1 + 0x1f0),param_3);
  if (pcVar6 != (char *)0x0) {
    local_a8 = 0xf;
    local_b0 = (char *)0x0;
    local_c0 = '\0';
    uVar9 = 0xffffffffffffffff;
    pcVar8 = pcVar6;
    do {
      if (uVar9 == 0) break;
      uVar9 = uVar9 - 1;
      cVar1 = *pcVar8;
      pcVar8 = pcVar8 + 1;
    } while (cVar1 != '\0');
    FUN_140003e60(&local_c0,pcVar6,~uVar9 - 1);
    pcVar6 = local_b0;
    if ((local_b0 != (char *)0x0) && (local_b0 != (char *)0x0)) {
      pcVar8 = &local_c0;
      if (0xf < local_a8) {
        pcVar8 = (char *)CONCAT71(uStack_bf,local_c0);
      }
      pcVar7 = memchr(pcVar8,0x3a,(size_t)local_b0);
      if (pcVar7 != (char *)0x0) {
LAB_14000dfc0:
        if (*pcVar7 != ':') goto code_r0x00014000dfcb;
        pcVar6 = (char *)CONCAT71(uStack_bf,local_c0);
        pcVar8 = &local_c0;
        if (0xf < local_a8) {
          pcVar8 = pcVar6;
        }
        iVar11 = (int)pcVar7 - (int)pcVar8;
        if (iVar11 != -1) {
          pcVar8 = &local_c0;
          if (0xf < local_a8) {
            pcVar8 = pcVar6;
          }
          local_58 = 0xf;
          local_60 = 0;
          local_70 = '\0';
          FUN_14001cff0(&local_70,pcVar8,pcVar8 + iVar11);
          pcVar6 = &local_70;
          if (0xf < local_58) {
            pcVar6 = (char *)CONCAT71(uStack_6f,local_70);
          }
          pcVar8 = &local_c0;
          if (0xf < local_a8) {
            pcVar8 = (char *)CONCAT71(uStack_bf,local_c0);
          }
          iVar5 = atoi(pcVar6);
          local_80 = 0xf;
          local_88 = 0;
          local_98 = 0;
          FUN_140003e60(&local_98,pcVar8 + (iVar11 + 1),(longlong)iVar5);
          local_e8 = (undefined8 *)0x0;
          local_e0 = (undefined8 *)0x0;
          local_d8 = 0;
          puVar10 = &local_98;
          if (0xf < local_80) {
            puVar10 = (undefined1 *)CONCAT71(uStack_97,local_98);
          }
          FUN_1401e1a80(&local_e8,puVar10,(int)local_88 + 1,&DAT_1402749e8);
          puVar4 = local_e0;
          puVar3 = local_e8;
          if (1 < (ulonglong)(((longlong)local_e0 - (longlong)local_e8) / 0x28)) {
            FUN_140003d50(param_4,local_e8,0,0xffffffffffffffff);
            FUN_140003d50(param_5,puVar3 + 5,0,0xffffffffffffffff);
            puVar2 = puVar3;
            if (puVar3 != (undefined8 *)0x0) {
              for (; puVar2 != puVar4; puVar2 = puVar2 + 5) {
                if (0xf < (ulonglong)puVar2[3]) {
                  operator_delete((void *)*puVar2);
                }
                puVar2[3] = 0xf;
                puVar2[2] = 0;
                *(undefined1 *)puVar2 = 0;
              }
              operator_delete(puVar3);
            }
            if (0xf < local_80) {
              operator_delete((void *)CONCAT71(uStack_97,local_98));
            }
            local_80 = 0xf;
            local_88 = 0;
            local_98 = 0;
            if (0xf < local_58) {
              operator_delete((void *)CONCAT71(uStack_6f,local_70));
            }
            local_58 = 0xf;
            local_60 = 0;
            local_70 = '\0';
            if (0xf < local_a8) {
              operator_delete((void *)CONCAT71(uStack_bf,local_c0));
            }
            return 1;
          }
          puVar2 = local_e8;
          if (local_e8 != (undefined8 *)0x0) {
            for (; puVar2 != puVar4; puVar2 = puVar2 + 5) {
              if (0xf < (ulonglong)puVar2[3]) {
                operator_delete((void *)*puVar2);
              }
              puVar2[3] = 0xf;
              puVar2[2] = 0;
              *(undefined1 *)puVar2 = 0;
            }
            operator_delete(puVar3);
          }
          if (0xf < local_80) {
            operator_delete((void *)CONCAT71(uStack_97,local_98));
          }
          local_80 = 0xf;
          local_88 = 0;
          local_98 = 0;
          if (0xf < local_58) {
            operator_delete((void *)CONCAT71(uStack_6f,local_70));
          }
          goto LAB_14000e234;
        }
        goto LAB_14000e23c;
      }
    }
LAB_14000e234:
    pcVar6 = (char *)CONCAT71(uStack_bf,local_c0);
LAB_14000e23c:
    if (0xf < local_a8) {
      operator_delete(pcVar6);
    }
  }
  return 0;
code_r0x00014000dfcb:
  pcVar6 = pcVar8 + (longlong)(pcVar6 + (-1 - (longlong)pcVar7));
  pcVar8 = pcVar7 + 1;
  pcVar7 = memchr(pcVar8,0x3a,(size_t)pcVar6);
  if (pcVar7 == (char *)0x0) goto LAB_14000e234;
  goto LAB_14000dfc0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14000e270(void)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  char *_Format;
  longlong *plVar4;
  undefined1 auStack_148 [32];
  undefined8 local_128;
  undefined1 local_118;
  undefined1 local_117 [255];
  ulonglong local_18;
  
  local_128 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_148;
  curl_global_init(3);
  lVar3 = curl_easy_init();
  DAT_14031fec0 = lVar3;
  if (lVar3 == 0) {
    FUN_1401e4980(DAT_140320100,L"curl_easy_init Failed");
    return;
  }
  local_118 = 0;
  memset(local_117,0,0xff);
  curl_easy_setopt(lVar3,0x271a,&local_118);
  lVar3 = curl_version_info(3);
  if (lVar3 != 0) {
    printf("=====================================\n");
    printf("LIBCURL =============================\n");
    printf("LIBCURL Version : %s\n");
    lVar1 = *(longlong *)(lVar3 + 0x40);
    if (lVar1 != 0) {
      printf("LIBCURL Protocols : ");
      printf("%s");
      plVar4 = (longlong *)(lVar1 + 8);
      lVar1 = *plVar4;
      while (lVar1 != 0) {
        printf(", ");
        printf("%s");
        plVar4 = plVar4 + 1;
        lVar1 = *plVar4;
      }
      printf("\n");
    }
    if ((*(byte *)(lVar3 + 0x20) & 4) != 0) {
      printf("LIBCURL: SSL Support Enabled\n");
      printf("LIBCURL: SSL version : %s\n");
    }
    printf("=====================================\n");
  }
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 == 0xc9) || (DAT_140320610 == 0x65)) {
    iVar2 = curl_easy_setopt(DAT_14031fec0,0x2729,"pwe\\web23-c.crt");
    if (iVar2 != 0) {
      printf("CURLOPT_SSLCERT Error : %s\n");
    }
    iVar2 = curl_easy_setopt(DAT_14031fec0,0x2766,&DAT_140274b14);
    if (iVar2 != 0) {
      printf("CURLOPT_SSLCERTTYPE Error : %s\n");
    }
    iVar2 = curl_easy_setopt(DAT_14031fec0,0x2767,"pwe\\web23-c.key");
    if (iVar2 != 0) {
      printf("CURLOPT_SSLKEY Error : %s\n");
    }
    iVar2 = curl_easy_setopt(DAT_14031fec0,0x2768,&DAT_140274b14);
    if (iVar2 != 0) {
      printf("CURLOPT_SSLKEYTYPE Error : %s\n");
    }
    iVar2 = curl_easy_setopt(DAT_14031fec0,0x272a,"windysoft1");
    if (iVar2 != 0) {
      printf("CURLOPT_KEYPASSWD Error : %s\n");
    }
    iVar2 = curl_easy_setopt(DAT_14031fec0,0x40);
    if (iVar2 != 0) {
      printf("CURLOPT_SSL_VERIFYPEER Error : %s\n");
    }
    iVar2 = curl_easy_setopt(DAT_14031fec0,0x51,2);
    if (iVar2 == 0) {
      return;
    }
    _Format = "CURLOPT_SSL_VERIFYHOST Error : %s\n";
  }
  else {
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if (((DAT_140320610 != 0xcb) && (DAT_140320610 != 0x67)) && (DAT_14031fea5 == '\0')) {
      return;
    }
    iVar2 = curl_easy_setopt(DAT_14031fec0,0x40);
    if (iVar2 != 0) {
      printf("CURLOPT_SSL_VERIFYPEER Error : %s\n");
    }
    iVar2 = curl_easy_setopt(DAT_14031fec0,0x51,2);
    if (iVar2 != 0) {
      printf("CURLOPT_SSL_VERIFYHOST Error : %s\n");
    }
    iVar2 = curl_easy_setopt(DAT_14031fec0,0x20,3);
    if (iVar2 == 0) {
      return;
    }
    _Format = "CURLOPT_SSLVERSION Error : %s\n";
  }
  printf(_Format);
  return;
}



// WARNING: Removing unreachable block (ram,0x00014000e7c7)
// WARNING: Removing unreachable block (ram,0x00014000e7d0)
// WARNING: Removing unreachable block (ram,0x00014000e7f1)
// WARNING: Removing unreachable block (ram,0x00014000e7fa)

undefined8 *
FUN_14000e640(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined4 uVar2;
  
  *param_1 = Proud::INetServerEvent::vftable;
  param_1[8] = 0;
  FUN_1400a3440(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  param_1[9] = PTR_DAT_1402f8010;
  param_1[10] = 0;
  *(undefined4 *)(param_1 + 0xb) = 0;
  FUN_14018a120(param_1 + 1);
  *(undefined4 *)(param_1 + 6) = 0;
  *(undefined2 *)((longlong)param_1 + 0x34) = 0;
  *(undefined1 *)((longlong)param_1 + 0x36) = 0;
  *(undefined4 *)(param_1 + 7) = 0;
  *param_1 = MGGatewayUserProud::vftable;
  param_1[1] = MGGatewayUserProud::vftable;
  param_1[5] = MGGatewayUserProud::vftable;
  puVar1 = param_1 + 0xc;
  FUN_140186ea0(puVar1);
  *puVar1 = PG_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x74) != 1) {
    FUN_1400a2b50(PTR_u_PIDL_compiler_is_incompatible_to_14030bd40);
  }
  *puVar1 = RNP::PCGateProxy::vftable;
  *(undefined1 *)(param_1 + 0xf) = 0;
  *(undefined1 *)(param_1 + 0x10) = 1;
  param_1[0x11] = param_2;
  param_1[0x15] = 7;
  param_1[0x14] = 0;
  *(undefined2 *)(param_1 + 0x12) = 0;
  param_1[0x1a] = 7;
  param_1[0x19] = 0;
  *(undefined2 *)(param_1 + 0x17) = 0;
  uVar2 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0x1d,uVar2,1);
  param_1[0x24] = 0;
  param_1[0x25] = 0;
  *(undefined4 *)(param_1 + 0x26) = 0x11;
  *(undefined4 *)(param_1 + 0x2a) = 0;
  *(undefined4 *)((longlong)param_1 + 0x154) = 10;
  param_1[0x2b] = 0;
  param_1[0x2c] = 0;
  *(undefined4 *)((longlong)param_1 + 0x134) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x27) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x13c) = 0x40100000;
  param_1[0x28] = 0x26;
  param_1[0x29] = 4;
  param_1[0x29] = 0;
  *(undefined4 *)(param_1 + 0x2d) = 0;
  param_1[0x2e] = 0;
  param_1[0x2f] = 0;
  *(undefined4 *)(param_1 + 0x30) = 0x11;
  *(undefined4 *)(param_1 + 0x34) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1a4) = 10;
  param_1[0x35] = 0;
  param_1[0x36] = 0;
  *(undefined4 *)((longlong)param_1 + 0x184) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x31) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x18c) = 0x40100000;
  param_1[0x32] = 0x26;
  param_1[0x33] = 0;
  param_1[0x37] = 0;
  param_1[0x38] = 0;
  param_1[0x39] = 0;
  param_1[0x3a] = 0;
  param_1[0x3b] = 0;
  param_1[0x3d] = 0;
  param_1[0x3e] = 0;
  *(undefined1 *)(param_1 + 0x3f) = 0;
  FUN_140099f20(param_1 + 0x46);
  param_1[0x4e] = 0;
  param_1[0x4f] = 0;
  param_1[0x50] = 0;
  param_1[0x52] = 0;
  param_1[0x53] = 0;
  param_1[0x54] = 0;
  param_1[0x40] = 0;
  param_1[0x41] = 0;
  param_1[0x42] = 0;
  param_1[0x43] = 0;
  return param_1;
}



void * FUN_14000e930(void *param_1,uint param_2)

{
  FUN_14000e960();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14000e960(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  
  *param_1 = MGGatewayUserProud::vftable;
  param_1[1] = MGGatewayUserProud::vftable;
  param_1[5] = MGGatewayUserProud::vftable;
  puVar1 = (undefined8 *)param_1[0x3e];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,0xfffffffffffffffe);
  }
  if (DAT_14031fec8 != (void *)0x0) {
    operator_delete__(DAT_14031fec8);
    DAT_14031fec8 = (void *)0x0;
  }
  if ((void *)param_1[0x52] != (void *)0x0) {
    operator_delete((void *)param_1[0x52]);
  }
  param_1[0x52] = 0;
  param_1[0x53] = 0;
  param_1[0x54] = 0;
  if ((void *)param_1[0x4e] != (void *)0x0) {
    operator_delete((void *)param_1[0x4e]);
  }
  param_1[0x4e] = 0;
  param_1[0x4f] = 0;
  param_1[0x50] = 0;
  if (param_1[0x46] != 0) {
    FUN_14001d750();
  }
  if ((void *)param_1[0x39] != (void *)0x0) {
    operator_delete((void *)param_1[0x39]);
  }
  param_1[0x39] = 0;
  param_1[0x3a] = 0;
  param_1[0x3b] = 0;
  FUN_14001ceb0(param_1 + 0x2e);
  FUN_14001ccf0(param_1 + 0x24);
  FUN_1400a1cd0(param_1 + 0x1d);
  if (7 < (ulonglong)param_1[0x1a]) {
    operator_delete((void *)param_1[0x17]);
  }
  param_1[0x1a] = 7;
  param_1[0x19] = 0;
  *(undefined2 *)(param_1 + 0x17) = 0;
  if (7 < (ulonglong)param_1[0x15]) {
    operator_delete((void *)param_1[0x12]);
  }
  param_1[0x15] = 7;
  param_1[0x14] = 0;
  *(undefined2 *)(param_1 + 0x12) = 0;
  param_1[0xc] = RNP::PCGateProxy::vftable;
  FUN_140186ed0();
  param_1[5] = MagiAgentReceive::vftable;
  param_1[1] = RNP::PCGateStub::vftable;
  FUN_14018a150(param_1 + 1);
  puVar1 = (undefined8 *)param_1[8];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  param_1[8] = 0;
  FUN_1400031d0(param_1 + 9);
  *param_1 = Proud::INetServerEvent::vftable;
  FUN_140140b40(param_1);
  return;
}



void FUN_14000eb60(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined *puVar4;
  undefined *local_res18 [2];
  
  plVar2 = (longlong *)FUN_1401417c0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1402f8010;
  }
  FUN_140026050(L"OnError MGGatewayUserProud : %s",puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1402f8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res18[0] + -8);
    }
    FUN_1400d1290(uVar3);
  }
  return;
}



void FUN_14000ec00(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined *puVar4;
  undefined *local_res18 [2];
  
  plVar2 = (longlong *)FUN_1401417c0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1402f8010;
  }
  FUN_140026050(L"OnWarning MGGatewayUserProud : %s",puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1402f8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res18[0] + -8);
    }
    FUN_1400d1290(uVar3);
  }
  return;
}



void FUN_14000eca0(undefined8 param_1,longlong *param_2)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(*param_2 + 8))(param_2);
  FUN_140025f00("OnException MGGatewayUserProud : %s",uVar1);
  return;
}



undefined8 FUN_14000ecc0(longlong param_1)

{
  longlong *plVar1;
  undefined8 *puVar2;
  
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 == 0xcc) || (DAT_140320610 == 0x68)) {
    FUN_14000db10();
  }
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 == 200) || (DAT_140320610 == 100)) {
    FUN_14000da70();
  }
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 != 0xc9) && (DAT_140320610 != 0x65)) {
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if (((DAT_140320610 != 0xcb) && (DAT_140320610 != 0x67)) && (DAT_14031fea5 == '\0'))
    goto LAB_14000edf9;
  }
  FUN_14000e270();
LAB_14000edf9:
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (((DAT_140320610 == 0xcb) || (DAT_140320610 == 0x67)) || (DAT_14031fea5 != '\0')) {
    FUN_14000dc90(param_1);
  }
  else {
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if ((DAT_140320610 == 0xca) || (DAT_140320610 == 0x66)) {
      FUN_14000dba0(param_1);
    }
  }
  plVar1 = (longlong *)FUN_1401615e0();
  *(longlong **)(param_1 + 0x40) = plVar1;
  (**(code **)(*plVar1 + 0x130))(plVar1,param_1);
  (**(code **)(**(longlong **)(param_1 + 0x40) + 0x10))(*(longlong **)(param_1 + 0x40),param_1 + 8);
  (**(code **)(**(longlong **)(param_1 + 0x40) + 8))(*(longlong **)(param_1 + 0x40),param_1 + 0x60);
  puVar2 = (undefined8 *)(DAT_140320138 + 0x58);
  if (7 < *(ulonglong *)(DAT_140320138 + 0x70)) {
    puVar2 = (undefined8 *)*puVar2;
  }
  FUN_14001f680(param_1 + 0x48,puVar2);
  *(undefined4 *)(param_1 + 0x50) = *(undefined4 *)(DAT_140320138 + 0x84);
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  FUN_14008c0f0(param_1 + 0x40,DAT_1403205d5 != '\0',DAT_1403205d5 != '\0');
  FUN_14001ced0(param_1 + 0x230);
  return 1;
}



void FUN_14000ef50(longlong param_1)

{
  undefined8 *puVar1;
  
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 == 200) || (DAT_140320610 == 100)) {
    FreeLibrary(DAT_14031feb8);
  }
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 == 0xcc) || (DAT_140320610 == 0x68)) {
    FreeLibrary(DAT_14031feb8);
  }
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 != 0xc9) && (DAT_140320610 != 0x65)) {
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if (((DAT_140320610 != 0xcb) && (DAT_140320610 != 0x67)) && (DAT_14031fea5 == '\0'))
    goto LAB_14000f0a0;
  }
  if (DAT_14031fec0 != 0) {
    curl_easy_cleanup();
    DAT_14031fec0 = 0;
  }
  curl_global_cleanup();
LAB_14000f0a0:
  puVar1 = *(undefined8 **)(param_1 + 0x40);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  *(undefined8 *)(param_1 + 0x40) = 0;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14000f0d0(longlong param_1)

{
  undefined1 auStack_278 [32];
  uint local_258;
  uint local_250;
  uint local_248;
  _SYSTEMTIME local_238;
  undefined2 local_228;
  undefined1 local_226 [526];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_278;
  if (*(longlong *)(param_1 + 0x40) != 0) {
    local_228 = 0;
    memset(local_226,0,0x206);
    GetLocalTime(&local_238);
    local_248 = (uint)local_238.wHour;
    local_250 = (uint)local_238.wDay;
    local_258 = (uint)local_238.wMonth;
    FUN_140003430(&local_228,0x104,L"ProudNet_Gate_%04d-%02d-%02d_%02d.log",local_238.wYear);
    (**(code **)(**(longlong **)(param_1 + 0x40) + 0x188))
              (*(longlong **)(param_1 + 0x40),&local_228);
    wprintf_s(L"Log On : %s\n");
  }
  return;
}



undefined8 * FUN_14000f1a0(longlong param_1,undefined8 *param_2,uint param_3)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x120) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x120) +
                            ((ulonglong)param_3 % (ulonglong)*(uint *)(param_1 + 0x130)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 4)) {
      if ((puVar1[6] == param_3) && (*puVar1 == param_3)) {
        if (puVar1 != (uint *)0x0) {
          FUN_14001c360(param_2,puVar1 + 2);
          return param_2;
        }
        break;
      }
    }
  }
  *param_2 = 0;
  return param_2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14000f210(longlong param_1,double param_2)

{
  ulonglong *puVar1;
  int iVar2;
  void *pvVar3;
  undefined8 *puVar4;
  ulonglong *puVar5;
  errno_t eVar6;
  int iVar7;
  uint uVar8;
  DWORD DVar9;
  longlong *plVar10;
  longlong lVar12;
  ulonglong uVar13;
  undefined4 *puVar14;
  ulonglong uVar15;
  undefined1 auStack_158 [32];
  uint *local_138;
  uint local_128;
  uint local_124;
  undefined8 local_120;
  int local_118;
  undefined8 *local_110;
  ulonglong *local_108;
  __time64_t local_100;
  longlong local_f8;
  undefined1 local_f0;
  char *local_e8;
  DWORD local_e0;
  undefined8 local_d8;
  short local_d0;
  short local_ce;
  undefined2 local_cc;
  short local_ca;
  short local_c8;
  short local_c6;
  short local_c4;
  undefined2 local_c2;
  undefined8 local_c0;
  undefined8 local_b8;
  tm local_b0 [2];
  int local_68;
  ushort local_56;
  ushort local_48;
  ulonglong local_40;
  ulonglong uVar11;
  
  local_d8 = 0xfffffffffffffffe;
  local_40 = DAT_1402f85a0 ^ (ulonglong)auStack_158;
  local_e8 = "MGGatewayUserProud::Process";
  local_e0 = timeGetTime();
  *(double *)(param_1 + 0x1b8) = param_2;
  if (param_2 - *(double *)(param_1 + 0x1c0) <= 1.0) goto LAB_14000f824;
  lVar12 = param_1 + 0xe8;
  local_f8 = lVar12;
  FUN_1400a1c30(lVar12);
  local_f0 = 1;
  *(double *)(param_1 + 0x1c0) = param_2;
  puVar14 = *(undefined4 **)(param_1 + 0x1c8);
  uVar15 = 0;
  if (puVar14 != *(undefined4 **)(param_1 + 0x1d0)) {
    do {
      plVar10 = (longlong *)FUN_14000f1a0(param_1,&local_110,*puVar14);
      puVar4 = local_110;
      uVar13 = uVar15;
      if ((ulonglong *)*plVar10 != (ulonglong *)0x0) {
        uVar13 = *(ulonglong *)*plVar10;
      }
      if ((local_110 != (undefined8 *)0x0) && (local_110[1] = local_110[1] + -1, local_110[1] == 0))
      {
        pvVar3 = (void *)*local_110;
        if (pvVar3 != (void *)0x0) {
          if (7 < *(ulonglong *)((longlong)pvVar3 + 0x28)) {
            operator_delete(*(void **)((longlong)pvVar3 + 0x10));
          }
          *(undefined8 *)((longlong)pvVar3 + 0x28) = 7;
          *(undefined8 *)((longlong)pvVar3 + 0x20) = 0;
          *(undefined2 *)((longlong)pvVar3 + 0x10) = 0;
          operator_delete(pvVar3);
        }
        FUN_1400a3530(puVar4);
      }
      if (uVar13 != 0) {
        iVar7 = *(int *)(uVar13 + 0x1ec);
        if (((-1 < iVar7) && (iVar7 < DAT_14031feb4)) &&
           (iVar2 = *(int *)(DAT_14031fec8 + (longlong)iVar7 * 4), 0 < iVar2)) {
          *(int *)(DAT_14031fec8 + (longlong)iVar7 * 4) = iVar2 + -1;
        }
        iVar7 = *(int *)(uVar13 + 0x1f0);
        if (((-1 < iVar7) && (iVar7 < DAT_14031fed8)) &&
           (iVar2 = *(int *)(DAT_14031fed0 + (longlong)iVar7 * 4), 0 < iVar2)) {
          *(int *)(DAT_14031fed0 + (longlong)iVar7 * 4) = iVar2 + -1;
        }
        if ((DAT_140320f5c & 1) == 0) {
          DAT_140320f5c = DAT_140320f5c | 1;
          FUN_1401e4310();
          atexit((_func_5014 *)&LAB_140202480);
        }
        if ((DAT_140320610 == 0xca) || (DAT_140320610 == 0x66)) {
LAB_14000f413:
          FUN_14001b490(param_1,uVar13 + 0x200);
        }
        else {
          if ((DAT_140320f5c & 1) == 0) {
            DAT_140320f5c = DAT_140320f5c | 1;
            FUN_1401e4310();
            atexit((_func_5014 *)&LAB_140202480);
          }
          if (DAT_140320610 == 0xca) goto LAB_14000f413;
        }
        FUN_14001cc40(param_1 + 0x120,puVar14);
      }
      puVar14 = puVar14 + 1;
      lVar12 = local_f8;
    } while (puVar14 != *(undefined4 **)(param_1 + 0x1d0));
  }
  pvVar3 = *(void **)(param_1 + 0x1c8);
  if (pvVar3 != *(void **)(param_1 + 0x1d0)) {
    memmove(pvVar3,*(void **)(param_1 + 0x1d0),0);
    *(void **)(param_1 + 0x1d0) = pvVar3;
  }
  if ((DAT_140320f64 & 1) == 0) {
    DAT_140320f64 = DAT_140320f64 | 1;
    FUN_1400908e0();
    atexit((_func_5014 *)&LAB_140202650);
  }
  if ((DAT_1403206c1 != '\0') &&
     (60.0 <= *(double *)(param_1 + 0x1b8) - *(double *)(param_1 + 0x1e8))) {
    *(double *)(param_1 + 0x1e8) = param_2;
    local_100 = _time64((__time64_t *)0x0);
    local_120 = 0;
    local_118 = 0;
    eVar6 = _localtime64_s(local_b0,&local_100);
    if (eVar6 == 0) {
      local_b0[1].tm_yday = local_b0[0].tm_wday;
      local_b0[1].tm_isdst = local_b0[0].tm_yday;
      local_68 = local_b0[0].tm_isdst;
      local_d0 = (short)local_b0[0].tm_year + 0x76c;
      local_ce = (short)local_b0[0].tm_mon + 1;
      local_cc = (undefined2)local_b0[0]._24_8_;
      local_ca = (short)local_b0[0].tm_mday;
      local_c8 = (short)local_b0[0].tm_hour;
      local_c6 = (short)local_b0[0].tm_min;
      local_c4 = (short)local_b0[0].tm_sec;
      local_c2 = 0;
      iVar7 = Ordinal_184();
      local_c0 = 0;
      local_b8 = 0;
      if (((((iVar7 == 0) || (iVar7 = Ordinal_185(local_120), iVar7 == 0)) ||
           (local_d0 != (short)local_c0)) ||
          ((local_ce != local_c0._2_2_ || (local_ca != local_c0._6_2_)))) ||
         ((local_c8 != (short)local_b8 ||
          ((local_c6 != local_b8._2_2_ || (local_c4 != local_b8._4_2_)))))) goto LAB_14000f603;
      local_118 = 0;
      iVar7 = Ordinal_185(local_120);
      if (iVar7 == 0) goto LAB_14000f60b;
      local_128 = (uint)local_48;
    }
    else {
LAB_14000f603:
      local_118 = 1;
LAB_14000f60b:
      local_128 = 0xffffffff;
    }
    if ((local_118 == 0) && (iVar7 = Ordinal_185(local_120), iVar7 != 0)) {
      local_124 = (uint)local_56;
    }
    else {
      local_124 = 0xffffffff;
    }
    if ((DAT_140320f64 & 1) == 0) {
      DAT_140320f64 = DAT_140320f64 | 1;
      FUN_1400908e0();
      atexit((_func_5014 *)&LAB_140202650);
    }
    if ((DAT_1403206dc <= (int)local_128) || (local_128 < 6)) {
      uVar13 = uVar15;
      if ((*(longlong *)(param_1 + 0x128) != 0) && (*(uint *)(param_1 + 0x130) != 0)) {
        uVar11 = uVar15;
        plVar10 = *(longlong **)(param_1 + 0x120);
        do {
          if (*plVar10 != 0) {
            uVar13 = (*(longlong **)(param_1 + 0x120))[uVar11];
            break;
          }
          uVar8 = (int)uVar11 + 1;
          uVar11 = (ulonglong)uVar8;
          plVar10 = plVar10 + 1;
        } while (uVar8 < *(uint *)(param_1 + 0x130));
      }
      while (uVar13 != 0) {
        if (uVar13 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14000c6c0(0x80004005);
        }
        uVar11 = uVar15;
        if ((uVar13 != 0) &&
           (uVar11 = *(ulonglong *)(uVar13 + 0x10), *(ulonglong *)(uVar13 + 0x10) == 0)) {
          uVar8 = *(uint *)(uVar13 + 0x18) % *(uint *)(param_1 + 0x130) + 1;
          lVar12 = (longlong)(int)uVar8 << 3;
          uVar11 = uVar15;
          do {
            if (*(uint *)(param_1 + 0x130) <= uVar8) break;
            if (*(longlong *)(lVar12 + *(longlong *)(param_1 + 0x120)) != 0) {
              uVar11 = *(ulonglong *)(lVar12 + *(longlong *)(param_1 + 0x120));
            }
            uVar8 = uVar8 + 1;
            lVar12 = lVar12 + 8;
          } while (uVar11 == 0);
        }
        local_108 = (ulonglong *)0x0;
        if (*(longlong *)(uVar13 + 8) != 0) {
          *(longlong *)(*(longlong *)(uVar13 + 8) + 8) =
               *(longlong *)(*(longlong *)(uVar13 + 8) + 8) + 1;
          local_108 = *(ulonglong **)(uVar13 + 8);
        }
        puVar1 = local_108;
        uVar13 = uVar15;
        if (local_108 != (ulonglong *)0x0) {
          uVar13 = *local_108;
        }
        if (*(int *)(uVar13 + 0x1fc) == 2) {
          uVar13 = uVar15;
          if (local_108 != (ulonglong *)0x0) {
            uVar13 = *local_108;
          }
          local_138 = &local_124;
          (**(code **)(*(longlong *)(param_1 + 0x60) + 0x210))
                    ((longlong *)(param_1 + 0x60),*(undefined4 *)(uVar13 + 8),&DAT_14030ab90,
                     &local_128);
        }
        puVar5 = local_108;
        lVar12 = local_f8;
        uVar13 = uVar11;
        if (puVar1 != (ulonglong *)0x0) {
          puVar1 = puVar1 + 1;
          *puVar1 = *puVar1 - 1;
          if (*puVar1 == 0) {
            pvVar3 = (void *)*local_108;
            if (pvVar3 != (void *)0x0) {
              if (7 < *(ulonglong *)((longlong)pvVar3 + 0x28)) {
                operator_delete(*(void **)((longlong)pvVar3 + 0x10));
              }
              *(undefined8 *)((longlong)pvVar3 + 0x28) = 7;
              *(undefined8 *)((longlong)pvVar3 + 0x20) = 0;
              *(undefined2 *)((longlong)pvVar3 + 0x10) = 0;
              operator_delete(pvVar3);
            }
            FUN_1400a3530(puVar5);
            lVar12 = local_f8;
          }
        }
      }
    }
  }
  *(int *)(param_1 + 0x168) = (int)*(undefined8 *)(param_1 + 0x128);
  FUN_1400d1290(lVar12);
LAB_14000f824:
  DVar9 = timeGetTime();
  if (0x32 < DVar9 - local_e0) {
    FUN_1401e4580(DAT_140320100,"% 9d [ ms ] %s\n",DVar9 - local_e0,"MGGatewayUserProud::Process");
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

LPCSTR FUN_14000f880(longlong param_1,longlong param_2)

{
  int *piVar1;
  WCHAR WVar2;
  uint uVar3;
  void *pvVar4;
  longlong lVar5;
  undefined8 uVar6;
  uint *puVar7;
  longlong *plVar8;
  uint *puVar9;
  uint *puVar10;
  LPCSTR pCVar11;
  longlong lVar12;
  ulonglong uVar13;
  uint *puVar14;
  uint uVar15;
  uint *puVar16;
  uint *puVar17;
  LPWSTR pWVar18;
  undefined1 auStackY_188 [32];
  longlong *local_158;
  LPCSTR local_150;
  longlong local_148;
  undefined1 local_140;
  undefined8 local_138;
  undefined1 local_130;
  undefined8 local_128;
  undefined1 local_120;
  undefined8 local_118;
  undefined1 local_110;
  undefined8 local_108;
  undefined1 local_f8 [64];
  ushort local_b8;
  WCHAR local_88 [32];
  ulonglong local_48;
  
  local_108 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStackY_188;
  if (*(char *)(param_1 + 0x1f8) == '\0') {
    uVar3 = printf("!!! Server Close !!!\n");
    pCVar11 = (LPCSTR)(ulonglong)uVar3;
  }
  else {
    lVar12 = *(longlong *)(param_1 + 0x298) - *(longlong *)(param_1 + 0x290);
    lVar5 = lVar12 >> 0x3f;
    if (lVar12 / 0x84 + lVar5 == lVar5) {
      uVar3 = printf("!!! Not Find World !!! \n");
      pCVar11 = (LPCSTR)(ulonglong)uVar3;
    }
    else {
      pvVar4 = operator_new(0x358);
      puVar17 = (uint *)0x0;
      puVar10 = (uint *)0x1;
      if ((pvVar4 == (void *)0x0) || (lVar5 = FUN_140024b70(pvVar4,param_1), lVar5 == 0)) {
        local_158 = (longlong *)0x0;
      }
      else {
        local_158 = (longlong *)FUN_1400a34c0(0x10);
        local_158[1] = 1;
        *local_158 = lVar5;
      }
      puVar7 = puVar17;
      if (local_158 != (longlong *)0x0) {
        puVar7 = (uint *)*local_158;
      }
      puVar7[2] = *(uint *)(param_2 + 0x30);
      local_88[0] = L'\0';
      local_88[1] = L'\0';
      local_88[2] = L'\0';
      local_88[3] = L'\0';
      local_88[4] = L'\0';
      local_88[5] = L'\0';
      local_88[6] = L'\0';
      local_88[7] = L'\0';
      local_88[8] = L'\0';
      local_88[9] = L'\0';
      local_88[10] = L'\0';
      local_88[0xb] = L'\0';
      local_88[0xc] = L'\0';
      local_88[0xd] = L'\0';
      local_88[0xe] = L'\0';
      local_88[0xf] = L'\0';
      local_88[0x10] = L'\0';
      local_88[0x11] = L'\0';
      local_88[0x12] = L'\0';
      local_88[0x13] = L'\0';
      local_88[0x14] = L'\0';
      local_88[0x15] = L'\0';
      local_88[0x16] = L'\0';
      local_88[0x17] = L'\0';
      local_88[0x18] = L'\0';
      local_88[0x19] = L'\0';
      local_88[0x1a] = L'\0';
      local_88[0x1b] = L'\0';
      local_88[0x1c] = L'\0';
      local_88[0x1d] = L'\0';
      local_88[0x1e] = L'\0';
      local_88[0x1f] = 0;
      FUN_1400a7220(param_2,&local_150);
      uVar3 = 0;
      pCVar11 = PTR_DAT_1402f8008;
      puVar7 = puVar17;
      if ((local_150 != (LPCSTR)0x0) &&
         (pCVar11 = local_150, puVar7 = (uint *)0x0, local_150 != PTR_DAT_1402f8008)) {
        puVar7 = (uint *)(ulonglong)*(uint *)(local_150 + -8);
      }
      MultiByteToWideChar(0,1,pCVar11,(int)puVar7,local_88,0x20);
      puVar7 = puVar17;
      if (local_158 != (longlong *)0x0) {
        puVar7 = (uint *)*local_158;
      }
      uVar13 = 0xffffffffffffffff;
      pWVar18 = local_88;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        WVar2 = *pWVar18;
        pWVar18 = pWVar18 + 1;
      } while (WVar2 != L'\0');
      FUN_140001b00(puVar7 + 4,local_88,~uVar13 - 1);
      uVar15 = *(uint *)(param_2 + 8);
      lVar5 = *(longlong *)(param_1 + 0x220);
      for (lVar12 = *(longlong *)(lVar5 + 0x98); lVar12 != *(longlong *)(lVar5 + 0xa0);
          lVar12 = lVar12 + 0x10) {
        if ((*(uint *)(lVar12 + 8) & uVar15) == *(uint *)(lVar12 + 8)) {
          lVar5 = FUN_1401e4420();
          if (*(int *)(lVar5 + 0x250) == 1000) {
            FUN_1401e4980(DAT_140320100,L"GROUP BLOCKING [%s]",local_88);
          }
          puVar10 = puVar17;
          if (local_158 != (longlong *)0x0) {
            puVar10 = (uint *)*local_158;
          }
          (**(code **)(*(longlong *)(param_1 + 0x60) + 0x150))
                    ((longlong *)(param_1 + 0x60),puVar10[2],&DAT_14030ab90);
          if (local_158 != (longlong *)0x0) {
            puVar17 = (uint *)*local_158;
          }
          FUN_14000fea0(param_1,puVar17[2]);
          if (((local_150 != (LPCSTR)0x0) && (local_150 != PTR_DAT_1402f8008)) &&
             (local_150 + -8 != (LPCSTR)0x0)) {
            uVar6 = FUN_1400a3440();
            local_138 = uVar6;
            FUN_1400a1c30(uVar6);
            local_130 = 1;
            piVar1 = (int *)(local_150 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(local_150 + -8);
            }
            FUN_1400d1290(uVar6);
            local_130 = 0;
          }
          local_150 = PTR_DAT_1402f8008;
          goto LAB_14000fe55;
        }
      }
      puVar7 = puVar17;
      if (*(longlong *)(lVar5 + 0x50) != 0) {
        for (puVar9 = *(uint **)(*(longlong *)(lVar5 + 0x50) +
                                ((ulonglong)uVar15 % (ulonglong)*(uint *)(lVar5 + 0x60)) * 8);
            (puVar7 = puVar17, puVar9 != (uint *)0x0 &&
            ((puVar9[8] != uVar15 || (puVar7 = puVar9, *puVar9 != uVar15))));
            puVar9 = *(uint **)(puVar9 + 6)) {
        }
      }
      if (puVar7 == (uint *)0x0) {
        memset(local_f8,0,0x62);
        puVar7 = puVar17;
        if (*(longlong *)(lVar5 + 8) != 0) {
          for (puVar9 = *(uint **)(*(longlong *)(lVar5 + 8) +
                                  ((ulonglong)uVar15 % (ulonglong)*(uint *)(lVar5 + 0x18)) * 8);
              (puVar7 = puVar17, puVar9 != (uint *)0x0 &&
              ((puVar9[0x1a] != uVar15 || (puVar7 = puVar9, *puVar9 != uVar15))));
              puVar9 = *(uint **)(puVar9 + 0x18)) {
          }
        }
        if ((puVar7 != (uint *)0x0) && (lVar5 = FUN_1401e4420(), *(int *)(lVar5 + 0x250) == 1000)) {
          FUN_1401e4980(DAT_140320100,L"Pc Room [%s]",local_88);
        }
        local_148 = param_1 + 0xe8;
        FUN_1400a1c30();
        local_140 = 1;
        puVar7 = puVar17;
        if (local_158 != (longlong *)0x0) {
          puVar7 = (uint *)*local_158;
        }
        plVar8 = (longlong *)FUN_14001cba0(param_1 + 0x120,puVar7 + 2);
        if (local_158 != (longlong *)*plVar8) {
          if (local_158 != (longlong *)0x0) {
            local_158[1] = local_158[1] + 1;
          }
          puVar7 = puVar17;
          if ((*plVar8 != 0) &&
             (*(longlong *)(*plVar8 + 8) = *(longlong *)(*plVar8 + 8) + -1,
             *(longlong *)(*plVar8 + 8) == 0)) {
            puVar7 = (uint *)*plVar8;
          }
          *plVar8 = (longlong)local_158;
          if (puVar7 != (uint *)0x0) {
            FUN_1400219e0(puVar7);
          }
        }
        puVar7 = puVar17;
        if (DAT_14031fec8 != (uint *)0x0) {
          puVar9 = puVar17;
          puVar14 = DAT_14031fec8;
          puVar16 = puVar17;
          if (0 < DAT_14031feb4) {
            do {
              if ((int)puVar9 == 0) {
                puVar9 = (uint *)(ulonglong)*puVar14;
              }
              else if ((int)*puVar14 < (int)puVar9) {
                puVar9 = (uint *)(ulonglong)*puVar14;
                puVar7 = puVar16;
              }
              uVar15 = (int)puVar16 + 1;
              puVar14 = puVar14 + 1;
              puVar16 = (uint *)(ulonglong)uVar15;
            } while ((int)uVar15 < DAT_14031feb4);
          }
          DAT_14031fec8[(int)puVar7] = DAT_14031fec8[(int)puVar7] + 1;
        }
        puVar9 = puVar17;
        if (local_158 != (longlong *)0x0) {
          puVar9 = (uint *)*local_158;
        }
        puVar9[0x7b] = (uint)puVar7;
        if (DAT_14031fed0 != (uint *)0x0) {
          puVar9 = puVar17;
          puVar14 = puVar17;
          puVar7 = DAT_14031fed0;
          uVar3 = 0;
          if (1 < DAT_14031fed8) {
            do {
              puVar7 = puVar7 + 1;
              if ((int)puVar9 == 0) {
                puVar9 = (uint *)(ulonglong)*puVar7;
              }
              else if ((int)*puVar7 < (int)puVar9) {
                puVar9 = (uint *)(ulonglong)*puVar7;
                puVar14 = puVar10;
              }
              uVar3 = (uint)puVar14;
              uVar15 = (int)puVar10 + 1;
              puVar10 = (uint *)(ulonglong)uVar15;
            } while ((int)uVar15 < DAT_14031fed8);
          }
          DAT_14031fed0[(int)uVar3] = DAT_14031fed0[(int)uVar3] + 1;
        }
        puVar10 = puVar17;
        if (local_158 != (longlong *)0x0) {
          puVar10 = (uint *)*local_158;
        }
        puVar10[0x7c] = uVar3;
        if (local_158 != (longlong *)0x0) {
          puVar17 = (uint *)*local_158;
        }
        puVar17[0x7e] = (uint)local_b8;
        *(int *)(param_1 + 0x168) = (int)*(undefined8 *)(param_1 + 0x128);
        FUN_1400d1290(local_148);
        local_140 = 0;
        if (((local_150 != (LPCSTR)0x0) && (local_150 != PTR_DAT_1402f8008)) &&
           (local_150 + -8 != (LPCSTR)0x0)) {
          uVar6 = FUN_1400a3440();
          local_128 = uVar6;
          FUN_1400a1c30(uVar6);
          local_120 = 1;
          piVar1 = (int *)(local_150 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_150 + -8);
          }
          FUN_1400d1290(uVar6);
          local_120 = 0;
        }
        local_150 = PTR_DAT_1402f8008;
      }
      else {
        lVar5 = FUN_1401e4420();
        if (*(int *)(lVar5 + 0x250) == 1000) {
          FUN_1401e4980(DAT_140320100,L"IP BLOCKING [%s]",local_88);
        }
        puVar10 = puVar17;
        if (local_158 != (longlong *)0x0) {
          puVar10 = (uint *)*local_158;
        }
        (**(code **)(*(longlong *)(param_1 + 0x60) + 0x150))
                  ((longlong *)(param_1 + 0x60),puVar10[2],&DAT_14030ab90);
        if (local_158 != (longlong *)0x0) {
          puVar17 = (uint *)*local_158;
        }
        FUN_14000fea0(param_1,puVar17[2]);
        if (((local_150 != (LPCSTR)0x0) && (local_150 != PTR_DAT_1402f8008)) &&
           (local_150 + -8 != (LPCSTR)0x0)) {
          uVar6 = FUN_1400a3440();
          local_118 = uVar6;
          FUN_1400a1c30(uVar6);
          local_110 = 1;
          piVar1 = (int *)(local_150 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_150 + -8);
          }
          FUN_1400d1290(uVar6);
          local_110 = 0;
        }
        local_150 = PTR_DAT_1402f8008;
      }
LAB_14000fe55:
      pCVar11 = local_150;
      PTR_DAT_1402f8008 = local_150;
      if (local_158 != (longlong *)0x0) {
        plVar8 = local_158 + 1;
        *plVar8 = *plVar8 + -1;
        pCVar11 = (LPCSTR)local_158[1];
        if (*plVar8 == 0) {
          pCVar11 = (LPCSTR)FUN_1400219e0(local_158);
        }
      }
    }
  }
  return pCVar11;
}



void FUN_14000fea0(longlong param_1,undefined4 param_2)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  undefined4 local_res10 [2];
  
  local_res10[0] = param_2;
  FUN_1400a1c30(param_1 + 0xe8);
  puVar1 = *(undefined4 **)(param_1 + 0x1d0);
  if (local_res10 < puVar1) {
    puVar2 = *(undefined4 **)(param_1 + 0x1c8);
    if (puVar2 <= local_res10) {
      if (puVar1 == *(undefined4 **)(param_1 + 0x1d8)) {
        FUN_14001c570(param_1 + 0x1c8);
      }
      if (*(undefined4 **)(param_1 + 0x1d0) != (undefined4 *)0x0) {
        **(undefined4 **)(param_1 + 0x1d0) =
             *(undefined4 *)
              (*(longlong *)(param_1 + 0x1c8) + ((longlong)local_res10 - (longlong)puVar2 >> 2) * 4)
        ;
      }
      goto LAB_14000ff5a;
    }
  }
  if (puVar1 == *(undefined4 **)(param_1 + 0x1d8)) {
    FUN_14001c570(param_1 + 0x1c8);
  }
  if (*(undefined4 **)(param_1 + 0x1d0) != (undefined4 *)0x0) {
    **(undefined4 **)(param_1 + 0x1d0) = param_2;
  }
LAB_14000ff5a:
  *(longlong *)(param_1 + 0x1d0) = *(longlong *)(param_1 + 0x1d0) + 4;
  FUN_1400d1290(param_1 + 0xe8);
  return;
}



void FUN_14000ff80(undefined8 param_1,longlong param_2)

{
  FUN_14000fea0(param_1,*(undefined4 *)(param_2 + 0x30));
  return;
}



void FUN_14000ff90(longlong param_1,wchar_t *param_2)

{
  longlong lVar1;
  char *_Format;
  wchar_t *pwVar2;
  bool bVar3;
  
  bVar3 = &stack0x00000000 == (undefined1 *)0x28;
  lVar1 = 7;
  pwVar2 = L"gateon";
  do {
    if (lVar1 == 0) break;
    lVar1 = lVar1 + -1;
    bVar3 = *param_2 == *pwVar2;
    param_2 = param_2 + 1;
    pwVar2 = pwVar2 + 1;
  } while (bVar3);
  if (bVar3) {
    bVar3 = *(char *)(param_1 + 0x1d0) == '\0';
    _Format = "Server Open !! \n";
    *(bool *)(param_1 + 0x1d0) = bVar3;
    if (!bVar3) {
      _Format = "Server Close !! \n";
    }
    printf(_Format);
  }
  return;
}



undefined8 FUN_14000fff0(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4)

{
  longlong *plVar1;
  longlong lVar2;
  longlong lVar3;
  longlong local_48 [3];
  undefined1 local_30;
  char *local_28;
  DWORD local_20;
  longlong local_18;
  
  local_48[1] = 0xfffffffffffffffe;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 == 200) || (DAT_140320610 == 100)) {
    local_28 = "PG_KEY_AUTH_ID_01";
    local_18 = **(longlong **)(*(longlong *)(param_1 + 0x200) + 8) + 0x68;
    local_20 = timeGetTime();
    lVar2 = param_1 + 0xe0;
    local_48[2] = lVar2;
    FUN_1400a1c30(lVar2);
    local_30 = 1;
    plVar1 = (longlong *)FUN_14000f1a0(param_1 + -8,local_48,param_2);
    lVar3 = 0;
    if ((longlong *)*plVar1 != (longlong *)0x0) {
      lVar3 = *(longlong *)*plVar1;
    }
    if ((local_48[0] != 0) &&
       (*(longlong *)(local_48[0] + 8) = *(longlong *)(local_48[0] + 8) + -1, lVar2 = local_48[2],
       *(longlong *)(local_48[0] + 8) == 0)) {
      FUN_1400219e0(local_48[0]);
      lVar2 = local_48[2];
    }
    if (lVar3 == 0) {
      FUN_1400d1290(lVar2);
    }
    else {
      memcpy((void *)(lVar3 + 0x58),(void *)*param_4,0x80);
      FUN_1400d1290(lVar2);
    }
    FUN_140070e40(&local_28);
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140010140(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4)

{
  undefined *puVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  longlong lVar6;
  errno_t eVar7;
  int iVar8;
  int iVar9;
  int iVar10;
  longlong *plVar11;
  undefined8 uVar12;
  undefined8 *puVar13;
  longlong lVar14;
  undefined *puVar15;
  int *piVar16;
  int iVar17;
  longlong lVar18;
  char *pcVar19;
  bool bVar20;
  undefined1 auStack_4d8 [32];
  int *local_4b8;
  uint *local_4b0;
  uint *local_4a8;
  char *local_4a0;
  undefined8 local_498;
  undefined8 local_490;
  undefined8 local_488;
  int local_478;
  char local_474 [4];
  undefined *local_470;
  uint local_468;
  uint local_464;
  int local_460 [2];
  undefined8 local_458;
  int local_450;
  undefined4 local_448;
  undefined4 local_444;
  longlong local_440;
  longlong local_438;
  longlong local_430;
  undefined1 local_428;
  __time64_t local_420;
  char *local_418;
  DWORD local_410;
  longlong local_408;
  undefined8 local_400;
  undefined8 local_3f8;
  undefined1 local_3f0;
  short local_3e8;
  short local_3e6;
  undefined2 local_3e4;
  short local_3e2;
  short local_3e0;
  short local_3de;
  short local_3dc;
  undefined2 local_3da;
  undefined8 local_3d8;
  undefined8 local_3d0;
  tm local_3c8;
  undefined1 local_3a0 [8];
  ushort local_398;
  undefined1 local_390 [10];
  ushort local_386;
  undefined8 local_380;
  undefined8 uStack_378;
  undefined4 local_370;
  undefined4 uStack_36c;
  undefined4 uStack_368;
  undefined4 uStack_364;
  undefined4 local_360;
  undefined4 uStack_35c;
  undefined4 uStack_358;
  undefined4 uStack_354;
  undefined2 local_350;
  undefined8 local_348;
  undefined8 uStack_340;
  undefined4 local_338;
  undefined4 uStack_334;
  undefined4 uStack_330;
  undefined4 uStack_32c;
  undefined4 local_328;
  undefined4 uStack_324;
  undefined4 uStack_320;
  undefined4 uStack_31c;
  undefined2 local_318;
  undefined4 local_248;
  char local_148;
  undefined1 local_147 [255];
  ulonglong local_48;
  
  local_400 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_4d8;
  local_444 = param_2;
  local_438 = param_1;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 != 200) && (DAT_140320610 != 100)) {
    return 1;
  }
  local_418 = "PG_KEY_AUTH_ID_02";
  local_408 = **(longlong **)(*(longlong *)(param_1 + 0x200) + 8) + 0x68;
  local_410 = timeGetTime();
  lVar14 = param_1 + 0xe0;
  local_430 = lVar14;
  FUN_1400a1c30(lVar14);
  local_428 = 1;
  plVar11 = (longlong *)FUN_14000f1a0(param_1 + -8,&local_440,param_2);
  lVar18 = 0;
  if ((longlong *)*plVar11 != (longlong *)0x0) {
    lVar18 = *(longlong *)*plVar11;
  }
  if ((local_440 != 0) &&
     (*(longlong *)(local_440 + 8) = *(longlong *)(local_440 + 8) + -1, lVar14 = local_430,
     *(longlong *)(local_440 + 8) == 0)) {
    FUN_1400219e0(local_440);
    lVar14 = local_430;
  }
  if (lVar18 == 0) {
    FUN_1400d1290(lVar14);
    goto LAB_1400108a1;
  }
  memcpy((void *)(lVar18 + 0xd8),(void *)*param_4,0xac);
  local_478._0_2_ = 0;
  local_348._0_1_ = '\0';
  memset((void *)((longlong)&local_348 + 1),0,0xfe);
  local_248._0_1_ = '\0';
  memset((void *)((longlong)&local_248 + 1),0,0xfe);
  local_148 = '\0';
  memset(local_147,0,0xfe);
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320470 == 0) {
    puVar13 = (undefined8 *)&DAT_14030cbc4;
  }
  else {
    puVar13 = &DAT_140320460;
    if (0xf < DAT_140320478) {
      puVar13 = DAT_140320460;
    }
  }
  local_4a0 = &local_148;
  local_4a8 = &local_248;
  local_4b0 = (uint *)&local_348;
  local_4b8 = &local_478;
  (*DAT_14031d5d0)(puVar13,lVar18 + 0x58,&DAT_14027936c,&DAT_14027a10a);
  local_468 = 0;
  local_464 = 0;
  if ((DAT_140320f64 & 1) == 0) {
    DAT_140320f64 = DAT_140320f64 | 1;
    FUN_1400908e0();
    atexit((_func_5014 *)&LAB_140202650);
  }
  bVar20 = DAT_1403206c1 == '\0';
  if (!bVar20) {
    local_420 = _time64((__time64_t *)0x0);
    local_458 = 0;
    local_450 = 0;
    eVar7 = _localtime64_s(&local_3c8,&local_420);
    if (eVar7 == 0) {
      local_3e8 = (short)local_3c8.tm_year + 0x76c;
      local_3e6 = (short)local_3c8.tm_mon + 1;
      local_3e4 = (undefined2)local_3c8.tm_wday;
      local_3e2 = (short)local_3c8.tm_mday;
      local_3e0 = (short)local_3c8.tm_hour;
      local_3de = (short)local_3c8.tm_min;
      local_3dc = (short)local_3c8.tm_sec;
      local_3da = 0;
      iVar8 = Ordinal_184(&local_3e8,&local_458);
      local_3d8 = 0;
      local_3d0 = 0;
      if ((((iVar8 == 0) || (iVar8 = Ordinal_185((int)local_458,&local_3d8), iVar8 == 0)) ||
          (local_3e8 != (short)local_3d8)) ||
         (((local_3e6 != local_3d8._2_2_ || (local_3e2 != local_3d8._6_2_)) ||
          ((local_3e0 != (short)local_3d0 ||
           ((local_3de != local_3d0._2_2_ || (local_3dc != local_3d0._4_2_))))))))
      goto LAB_1400104ad;
      local_450 = 0;
      iVar8 = Ordinal_185((int)local_458,local_3a0);
      if (iVar8 == 0) goto LAB_1400104b1;
      local_468 = (uint)local_398;
    }
    else {
LAB_1400104ad:
      local_450 = 1;
LAB_1400104b1:
      local_468 = 0xffffffff;
    }
    bVar20 = false;
    if (local_450 == 0) {
      iVar8 = Ordinal_185((int)local_458,local_390);
      bVar20 = iVar8 == 0;
      if (!bVar20) {
        local_464 = (uint)local_386;
        goto LAB_1400104e4;
      }
    }
    local_464 = 0xffffffff;
  }
LAB_1400104e4:
  lVar14 = 2;
  piVar16 = &local_478;
  pcVar19 = "S";
  do {
    if (lVar14 == 0) break;
    lVar14 = lVar14 + -1;
    bVar20 = (char)*piVar16 == *pcVar19;
    piVar16 = (int *)((longlong)piVar16 + 1);
    pcVar19 = pcVar19 + 1;
  } while (bVar20);
  if (bVar20) {
    local_380 = CONCAT71(local_348._1_7_,(char)local_348);
    uStack_378 = uStack_340;
    local_370 = local_338;
    uStack_36c = uStack_334;
    uStack_368 = uStack_330;
    uStack_364 = uStack_32c;
    local_360 = local_328;
    uStack_35c = uStack_324;
    uStack_358 = uStack_320;
    uStack_354 = uStack_31c;
    local_350 = local_318;
    plVar11 = (longlong *)(lVar18 + 0x10);
    if (7 < *(ulonglong *)(lVar18 + 0x28)) {
      plVar11 = (longlong *)*plVar11;
    }
    uVar2 = *(undefined4 *)(DAT_140320138 + 0x140);
    uVar3 = *(undefined4 *)(lVar18 + 0x1ec);
    uVar4 = *(undefined4 *)(lVar18 + 0x1f0);
    lVar14 = **(longlong **)(local_438 + 0x80);
    iVar8 = atoi((char *)&local_248);
    lVar6 = local_438;
    uVar5 = local_444;
    local_488 = 0;
    local_490 = 0;
    local_498 = 0;
    local_4a0 = (char *)CONCAT44(local_4a0._4_4_,iVar8);
    local_4b0 = (uint *)CONCAT44(local_4b0._4_4_,uVar2);
    local_4b8 = (int *)&local_380;
    local_4a8 = (uint *)plVar11;
    (**(code **)(lVar14 + 8))(*(undefined8 *)(local_438 + 0x80),uVar4,uVar3,local_444);
    local_460[0] = atoi(&local_148);
    *(int *)(lVar18 + 0x1fc) = local_460[0];
    strncpy_s((char *)(lVar18 + 0x200),0x32,(char *)&local_380,0x31);
    *(undefined1 *)(lVar18 + 0x231) = 0;
    lVar14 = FUN_1401e4420();
    if (*(int *)(lVar14 + 0x250) == 200) {
      printf("ShutDown Info : %d\n");
    }
    lVar14 = FUN_140094270();
    local_474[0] = *(char *)(lVar14 + 0x11);
    FUN_1400a3440();
    local_470 = PTR_DAT_1402f8008;
    iVar9 = FUN_1400a3360(&local_380);
    iVar17 = 0;
    iVar8 = iVar17;
    if ((local_470 != (undefined *)0x0) && (local_470 != PTR_DAT_1402f8008)) {
      iVar8 = *(int *)(local_470 + -8);
    }
    iVar10 = iVar9;
    if (((iVar9 <= iVar8) && (iVar10 = iVar17, local_470 != (undefined *)0x0)) &&
       (iVar10 = 0, local_470 != PTR_DAT_1402f8008)) {
      iVar10 = *(int *)(local_470 + -8);
    }
    iVar8 = 1;
    if (1 < iVar10) {
      iVar8 = iVar10;
    }
    iVar10 = iVar17;
    if ((local_470 != (undefined *)0x0) && (local_470 != PTR_DAT_1402f8008)) {
      iVar10 = *(int *)(local_470 + -8);
    }
    if (iVar10 < iVar8) {
      FUN_14000c1c0(&local_470,iVar8);
    }
    FUN_14000c330(&local_470);
    puVar15 = local_470;
    if (local_470 == (undefined *)0x0) {
      puVar15 = PTR_DAT_1402f8008;
    }
    FUN_1400a3390(puVar15,&local_380,iVar9);
    puVar15 = local_470;
    if (local_470 == (undefined *)0x0) {
      puVar15 = PTR_DAT_1402f8008;
    }
    iVar9 = FUN_1400a3360(puVar15);
    iVar8 = iVar17;
    if (0 < iVar9) {
      iVar8 = iVar9;
    }
    iVar9 = iVar17;
    if ((local_470 != (undefined *)0x0) && (local_470 != PTR_DAT_1402f8008)) {
      iVar9 = *(int *)(local_470 + -8);
    }
    if ((iVar8 < iVar9) || (iVar8 = iVar17, local_470 == (undefined *)0x0)) {
LAB_140010707:
      if (((local_470 != PTR_DAT_1402f8008) && (local_470 != (undefined *)0x0)) &&
         (piVar16 = (int *)(local_470 + -8), piVar16 != (int *)0x0)) {
        *piVar16 = iVar8;
        *(undefined1 *)((longlong)iVar8 + 8 + (longlong)piVar16) = 0;
      }
    }
    else if (local_470 != PTR_DAT_1402f8008) {
      iVar8 = *(int *)(local_470 + -8);
      goto LAB_140010707;
    }
    local_4a0 = local_474;
    local_4a8 = &local_464;
    local_4b0 = &local_468;
    local_4b8 = local_460;
    (**(code **)(*(longlong *)(lVar6 + 0x58) + 0x200))
              ((longlong *)(lVar6 + 0x58),uVar5,&DAT_14030ab90,&local_470);
    puVar15 = local_470;
    if (((local_470 != (undefined *)0x0) && (local_470 != PTR_DAT_1402f8008)) &&
       (puVar1 = local_470 + -8, puVar1 != (undefined *)0x0)) {
      uVar12 = FUN_1400a3440();
      local_3f8 = uVar12;
      FUN_1400a1c30(uVar12);
      local_3f0 = 1;
      piVar16 = (int *)(puVar15 + -4);
      *piVar16 = *piVar16 + -1;
      if (*piVar16 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar12);
    }
  }
  else {
    lVar14 = 2;
    piVar16 = &local_478;
    pcVar19 = "F";
    do {
      if (lVar14 == 0) break;
      lVar14 = lVar14 + -1;
      bVar20 = (char)*piVar16 == *pcVar19;
      piVar16 = (int *)((longlong)piVar16 + 1);
      pcVar19 = pcVar19 + 1;
    } while (bVar20);
    if (bVar20) {
      local_448 = 5;
      (**(code **)(*(longlong *)(param_1 + 0x58) + 0x70))
                ((longlong *)(param_1 + 0x58),param_2,&DAT_14030ab90,&local_448);
    }
    else {
      lVar14 = 2;
      piVar16 = &local_478;
      pcVar19 = "A";
      do {
        if (lVar14 == 0) break;
        lVar14 = lVar14 + -1;
        bVar20 = (char)*piVar16 == *pcVar19;
        piVar16 = (int *)((longlong)piVar16 + 1);
        pcVar19 = pcVar19 + 1;
      } while (bVar20);
      if (bVar20) {
        pcVar19 = (char *)(lVar18 + 0x184);
        strcpy_s(pcVar19,100,(char *)&local_348);
        iVar8 = strncmp(pcVar19,"WP",2);
        if (iVar8 == 0) {
          (**(code **)(*(longlong *)(param_1 + 0x58) + 0x1a0))
                    ((longlong *)(param_1 + 0x58),param_2,&DAT_14030ab90);
        }
        else {
          iVar8 = strncmp(pcVar19,"WO",2);
          if (iVar8 == 0) {
            (**(code **)(*(longlong *)(param_1 + 0x58) + 0x1b0))
                      ((longlong *)(param_1 + 0x58),param_2,&DAT_14030ab90);
          }
        }
      }
    }
  }
  FUN_1400d1290(local_430);
LAB_1400108a1:
  FUN_140070e40(&local_418);
  return 1;
}



longlong FUN_1400108e0(char *param_1,longlong param_2,longlong param_3,longlong param_4)

{
  char cVar1;
  ulonglong uVar2;
  char *pcVar3;
  
  uVar2 = 0xffffffffffffffff;
  pcVar3 = param_1;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    cVar1 = *pcVar3;
    pcVar3 = pcVar3 + 1;
  } while (cVar1 != '\0');
  FUN_14001c3d0(param_4,*(undefined8 *)(param_4 + 0x10),param_1,~uVar2 - 1);
  return param_2 * param_3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140010930(char *param_1)

{
  char cVar1;
  ulonglong uVar2;
  int iVar3;
  uint uVar4;
  longlong *plVar5;
  ulonglong *puVar6;
  ulonglong *puVar7;
  undefined1 *puVar8;
  ulonglong uVar9;
  int iVar10;
  char *pcVar11;
  undefined1 *puVar12;
  longlong lVar13;
  size_t sVar14;
  undefined1 *puVar15;
  undefined1 *puVar16;
  bool bVar17;
  undefined1 auStack_d8 [32];
  undefined8 local_b8;
  undefined1 local_b0;
  undefined7 uStack_af;
  ulonglong local_a0;
  ulonglong local_98;
  undefined1 local_88;
  undefined7 uStack_87;
  ulonglong local_78;
  ulonglong local_70;
  undefined1 local_60;
  undefined7 uStack_5f;
  undefined8 local_50;
  ulonglong local_48;
  ulonglong local_38;
  
  local_b8 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_d8;
  local_98 = 0xf;
  local_a0 = 0;
  local_b0 = 0;
  uVar9 = 0xffffffffffffffff;
  pcVar11 = param_1;
  do {
    if (uVar9 == 0) break;
    uVar9 = uVar9 - 1;
    cVar1 = *pcVar11;
    pcVar11 = pcVar11 + 1;
  } while (cVar1 != '\0');
  FUN_140003e60(&local_b0,param_1,~uVar9 - 1);
  if (local_a0 == 0) {
    if (0xf < local_98) {
      operator_delete((void *)CONCAT71(uStack_af,local_b0));
    }
    return 0xfffffffe;
  }
  if (7 < local_a0) {
    puVar15 = (undefined1 *)(local_a0 - 7);
    puVar12 = &local_b0;
    if (0xf < local_98) {
      puVar12 = (undefined1 *)CONCAT71(uStack_af,local_b0);
    }
    plVar5 = memchr(puVar12,0x3c,(size_t)puVar15);
    while (plVar5 != (longlong *)0x0) {
      if (*plVar5 == 0x3e7375746174733c) {
        puVar12 = (undefined1 *)CONCAT71(uStack_af,local_b0);
        puVar15 = &local_b0;
        if (0xf < local_98) {
          puVar15 = puVar12;
        }
        if ((longlong)plVar5 - (longlong)puVar15 == -1) goto LAB_14001151c;
        iVar10 = 0;
        if ((local_a0 == 0) || (local_a0 < 9)) goto LAB_140010b0e;
        puVar16 = (undefined1 *)(local_a0 - 8);
        puVar8 = &local_b0;
        if (0xf < local_98) {
          puVar8 = puVar12;
        }
        puVar6 = memchr(puVar8,0x3c,(size_t)puVar16);
        goto joined_r0x000140010a9c;
      }
      puVar15 = puVar12 + (longlong)(puVar15 + (-1 - (longlong)plVar5));
      puVar12 = (undefined1 *)((longlong)plVar5 + 1);
      plVar5 = memchr(puVar12,0x3c,(size_t)puVar15);
    }
  }
  puVar12 = (undefined1 *)CONCAT71(uStack_af,local_b0);
LAB_14001151c:
  if (0xf < local_98) {
    operator_delete(puVar12);
  }
  return 0xfffffffd;
joined_r0x000140010a9c:
  if (puVar6 == (ulonglong *)0x0) goto LAB_140010b06;
  bVar17 = *puVar6 < (ulonglong)0x7375746174732f3c;
  if ((*puVar6 != 0x7375746174732f3c) ||
     (bVar17 = (byte)puVar6[1] < (byte)'>', iVar3 = iVar10, (byte)puVar6[1] != '>')) {
    iVar3 = (1 - (uint)bVar17) - (uint)(bVar17 != 0);
  }
  if (iVar3 == 0) {
    puVar12 = (undefined1 *)CONCAT71(uStack_af,local_b0);
    puVar8 = &local_b0;
    if (0xf < local_98) {
      puVar8 = puVar12;
    }
    lVar13 = (longlong)puVar6 - (longlong)puVar8;
    goto LAB_140010b12;
  }
  puVar16 = puVar8 + (longlong)(puVar16 + (-1 - (longlong)puVar6));
  puVar8 = (undefined1 *)((longlong)puVar6 + 1);
  puVar6 = memchr(puVar8,0x3c,(size_t)puVar16);
  goto joined_r0x000140010a9c;
LAB_140010b06:
  puVar12 = (undefined1 *)CONCAT71(uStack_af,local_b0);
LAB_140010b0e:
  lVar13 = -1;
LAB_140010b12:
  puVar8 = &local_b0;
  if (0xf < local_98) {
    puVar8 = puVar12;
  }
  local_70 = 0xf;
  local_78 = 0;
  local_88 = 0;
  FUN_14001cff0(&local_88,puVar8 + ((longlong)plVar5 - (longlong)puVar15) + 8,puVar8 + lVar13);
  uVar2 = local_70;
  uVar9 = local_78;
  puVar12 = (undefined1 *)CONCAT71(uStack_87,local_88);
  puVar15 = &local_88;
  if (0xf < local_70) {
    puVar15 = puVar12;
  }
  uVar4 = memcmp(puVar15,&DAT_140279374,(ulonglong)(local_78 != 0));
  if (uVar4 == 0) {
    if (uVar9 == 0) {
      uVar4 = 0xffffffff;
    }
    else {
      uVar4 = (uint)(uVar9 != 1);
    }
  }
  if (uVar4 != 0) {
    puVar15 = &local_88;
    if (0xf < uVar2) {
      puVar15 = puVar12;
    }
    uVar4 = memcmp(puVar15,&DAT_1402793fc,(ulonglong)(uVar9 != 0));
    if (uVar4 == 0) {
      if (uVar9 == 0) {
        uVar4 = 0xffffffff;
      }
      else {
        uVar4 = (uint)(uVar9 != 1);
      }
    }
    if (uVar4 == 0) {
      if (0xf < uVar2) {
        operator_delete(puVar12);
      }
      if (0xf < local_98) {
        operator_delete((void *)CONCAT71(uStack_af,local_b0));
      }
      return 1;
    }
    puVar15 = &local_88;
    if (0xf < uVar2) {
      puVar15 = puVar12;
    }
    uVar4 = memcmp(puVar15,&DAT_140279400,(ulonglong)(uVar9 != 0));
    if (uVar4 == 0) {
      if (uVar9 == 0) {
        uVar4 = 0xffffffff;
      }
      else {
        uVar4 = (uint)(uVar9 != 1);
      }
    }
    if (uVar4 == 0) {
      if (0xf < uVar2) {
        operator_delete(puVar12);
      }
      if (0xf < local_98) {
        operator_delete((void *)CONCAT71(uStack_af,local_b0));
      }
      return 2;
    }
    puVar15 = &local_88;
    if (0xf < uVar2) {
      puVar15 = puVar12;
    }
    uVar4 = memcmp(puVar15,&DAT_140279404,(ulonglong)(uVar9 != 0));
    if (uVar4 == 0) {
      if (uVar9 == 0) {
        uVar4 = 0xffffffff;
      }
      else {
        uVar4 = (uint)(uVar9 != 1);
      }
    }
    if (uVar4 == 0) {
      if (0xf < uVar2) {
        operator_delete(puVar12);
      }
      if (0xf < local_98) {
        operator_delete((void *)CONCAT71(uStack_af,local_b0));
      }
      return 3;
    }
    puVar15 = &local_88;
    if (0xf < uVar2) {
      puVar15 = puVar12;
    }
    uVar4 = memcmp(puVar15,&DAT_140279408,(ulonglong)(uVar9 != 0));
    if (uVar4 == 0) {
      if (uVar9 == 0) {
        uVar4 = 0xffffffff;
      }
      else {
        uVar4 = (uint)(uVar9 != 1);
      }
    }
    if (uVar4 == 0) {
      if (0xf < uVar2) {
        operator_delete(puVar12);
      }
      if (0xf < local_98) {
        operator_delete((void *)CONCAT71(uStack_af,local_b0));
      }
      return 4;
    }
    puVar15 = &local_88;
    if (0xf < uVar2) {
      puVar15 = puVar12;
    }
    uVar4 = memcmp(puVar15,&DAT_14027940c,(ulonglong)(uVar9 != 0));
    if (uVar4 == 0) {
      if (uVar9 == 0) {
        uVar4 = 0xffffffff;
      }
      else {
        uVar4 = (uint)(uVar9 != 1);
      }
    }
    if (uVar4 == 0) {
      if (0xf < uVar2) {
        operator_delete(puVar12);
      }
      if (0xf < local_98) {
        operator_delete((void *)CONCAT71(uStack_af,local_b0));
      }
      return 5;
    }
    puVar15 = &local_88;
    if (0xf < uVar2) {
      puVar15 = puVar12;
    }
    uVar4 = memcmp(puVar15,&DAT_140279410,(ulonglong)(uVar9 != 0));
    if (uVar4 == 0) {
      if (uVar9 == 0) {
        uVar4 = 0xffffffff;
      }
      else {
        uVar4 = (uint)(uVar9 != 1);
      }
    }
    if (uVar4 == 0) {
      if (0xf < uVar2) {
        operator_delete(puVar12);
      }
      if (0xf < local_98) {
        operator_delete((void *)CONCAT71(uStack_af,local_b0));
      }
      return 6;
    }
    puVar15 = &local_88;
    if (0xf < uVar2) {
      puVar15 = puVar12;
    }
    uVar4 = memcmp(puVar15,&DAT_140279414,(ulonglong)(uVar9 != 0));
    if (uVar4 == 0) {
      if (uVar9 == 0) {
        uVar4 = 0xffffffff;
      }
      else {
        uVar4 = (uint)(uVar9 != 1);
      }
    }
    if (uVar4 == 0) {
      if (0xf < uVar2) {
        operator_delete(puVar12);
      }
      if (0xf < local_98) {
        operator_delete((void *)CONCAT71(uStack_af,local_b0));
      }
      return 7;
    }
    puVar15 = &local_88;
    if (0xf < uVar2) {
      puVar15 = puVar12;
    }
    uVar4 = memcmp(puVar15,&DAT_140279418,(ulonglong)(uVar9 != 0));
    if (uVar4 == 0) {
      if (uVar9 == 0) {
        uVar4 = 0xffffffff;
      }
      else {
        uVar4 = (uint)(uVar9 != 1);
      }
    }
    if (uVar4 == 0) {
      if (0xf < uVar2) {
        operator_delete(puVar12);
      }
      if (0xf < local_98) {
        operator_delete((void *)CONCAT71(uStack_af,local_b0));
      }
      return 8;
    }
    puVar15 = &local_88;
    if (0xf < uVar2) {
      puVar15 = puVar12;
    }
    uVar4 = memcmp(puVar15,&DAT_14027941c,(ulonglong)(uVar9 != 0));
    if (uVar4 == 0) {
      if (uVar9 == 0) {
        uVar4 = 0xffffffff;
      }
      else {
        uVar4 = (uint)(uVar9 != 1);
      }
    }
    if (uVar4 == 0) {
      if (0xf < uVar2) {
        operator_delete(puVar12);
      }
      if (0xf < local_98) {
        operator_delete((void *)CONCAT71(uStack_af,local_b0));
      }
      return 9;
    }
    puVar15 = &local_88;
    if (0xf < uVar2) {
      puVar15 = puVar12;
    }
    sVar14 = 2;
    if (uVar9 < 2) {
      sVar14 = uVar9;
    }
    uVar4 = memcmp(puVar15,&DAT_140279420,sVar14);
    if (uVar4 == 0) {
      if (uVar9 < 2) {
        uVar4 = 0xffffffff;
      }
      else {
        uVar4 = (uint)(uVar9 != 2);
      }
    }
    if (uVar4 == 0) {
      if (0xf < uVar2) {
        operator_delete(puVar12);
      }
      if (0xf < local_98) {
        operator_delete((void *)CONCAT71(uStack_af,local_b0));
      }
      return 10;
    }
    puVar15 = &local_88;
    if (0xf < uVar2) {
      puVar15 = puVar12;
    }
    sVar14 = 2;
    if (uVar9 < 2) {
      sVar14 = uVar9;
    }
    uVar4 = memcmp(puVar15,&DAT_140279424,sVar14);
    if (uVar4 == 0) {
      if (uVar9 < 2) {
        uVar4 = 0xffffffff;
      }
      else {
        uVar4 = (uint)(uVar9 != 2);
      }
    }
    if (uVar4 == 0) {
      if (0xf < uVar2) {
        operator_delete(puVar12);
      }
      if (0xf < local_98) {
        operator_delete((void *)CONCAT71(uStack_af,local_b0));
      }
      return 0x10;
    }
    puVar15 = &local_88;
    if (0xf < uVar2) {
      puVar15 = puVar12;
    }
    sVar14 = 2;
    if (uVar9 < 2) {
      sVar14 = uVar9;
    }
    uVar4 = memcmp(puVar15,&DAT_140279428,sVar14);
    if (uVar4 == 0) {
      if (uVar9 < 2) {
        uVar4 = 0xffffffff;
      }
      else {
        uVar4 = (uint)(uVar9 != 2);
      }
    }
    if (uVar4 == 0) {
      if (0xf < uVar2) {
        operator_delete(puVar12);
      }
      if (0xf < local_98) {
        operator_delete((void *)CONCAT71(uStack_af,local_b0));
      }
      return 0x11;
    }
    puVar15 = &local_88;
    if (0xf < uVar2) {
      puVar15 = puVar12;
    }
    sVar14 = 2;
    if (uVar9 < 2) {
      sVar14 = uVar9;
    }
    uVar4 = memcmp(puVar15,&DAT_14027942c,sVar14);
    if (uVar4 == 0) {
      if (uVar9 < 2) {
        uVar4 = 0xffffffff;
      }
      else {
        uVar4 = (uint)(uVar9 != 2);
      }
    }
    if (uVar4 == 0) {
      if (0xf < uVar2) {
        operator_delete(puVar12);
      }
      if (0xf < local_98) {
        operator_delete((void *)CONCAT71(uStack_af,local_b0));
      }
      return 0x12;
    }
    if (0xf < uVar2) {
      operator_delete(puVar12);
    }
    if (0xf < local_98) {
      operator_delete((void *)CONCAT71(uStack_af,local_b0));
    }
    return 0xffffffff;
  }
  if (local_a0 == 0) goto LAB_140010f0a;
  if (0xb < local_a0) {
    puVar15 = (undefined1 *)(local_a0 - 0xb);
    puVar8 = &local_b0;
    if (0xf < local_98) {
      puVar8 = (undefined1 *)CONCAT71(uStack_af,local_b0);
    }
    puVar6 = memchr(puVar8,0x3c,(size_t)puVar15);
    while (puVar6 != (ulonglong *)0x0) {
      bVar17 = *puVar6 < (ulonglong)0x645f74696d696c3c;
      if ((*puVar6 != 0x645f74696d696c3c) ||
         (bVar17 = (uint)puVar6[1] < (uint)0x3e657461, iVar3 = iVar10, (uint)puVar6[1] != 0x3e657461
         )) {
        iVar3 = (1 - (uint)bVar17) - (uint)(bVar17 != 0);
      }
      if (iVar3 == 0) {
        puVar15 = &local_b0;
        if (0xf < local_98) {
          puVar15 = (undefined1 *)CONCAT71(uStack_af,local_b0);
        }
        if ((longlong)puVar6 - (longlong)puVar15 != -1) {
          if ((local_a0 == 0) || (local_a0 < 0xd)) goto LAB_140010d10;
          puVar16 = (undefined1 *)(local_a0 - 0xc);
          puVar8 = &local_b0;
          if (0xf < local_98) {
            puVar8 = (undefined1 *)CONCAT71(uStack_af,local_b0);
          }
          puVar7 = memchr(puVar8,0x3c,(size_t)puVar16);
          goto joined_r0x000140010ca0;
        }
        break;
      }
      puVar15 = puVar8 + (longlong)(puVar15 + (-1 - (longlong)puVar6));
      puVar8 = (undefined1 *)((longlong)puVar6 + 1);
      puVar6 = memchr(puVar8,0x3c,(size_t)puVar15);
    }
  }
  goto LAB_140010d67;
joined_r0x000140010ca0:
  if (puVar7 == (ulonglong *)0x0) goto LAB_140010d10;
  bVar17 = *puVar7 < (ulonglong)0x5f74696d696c2f3c;
  if (((*puVar7 != 0x5f74696d696c2f3c) ||
      (bVar17 = (uint)puVar7[1] < (uint)0x65746164, (uint)puVar7[1] != 0x65746164)) ||
     (bVar17 = *(byte *)((longlong)puVar7 + 0xc) < (byte)'>', iVar3 = iVar10,
     *(byte *)((longlong)puVar7 + 0xc) != '>')) {
    iVar3 = (1 - (uint)bVar17) - (uint)(bVar17 != 0);
  }
  if (iVar3 == 0) {
    puVar8 = &local_b0;
    if (0xf < local_98) {
      puVar8 = (undefined1 *)CONCAT71(uStack_af,local_b0);
    }
    lVar13 = (longlong)puVar7 - (longlong)puVar8;
    goto LAB_140010d14;
  }
  puVar16 = puVar8 + (longlong)(puVar16 + (-1 - (longlong)puVar7));
  puVar8 = (undefined1 *)((longlong)puVar7 + 1);
  puVar7 = memchr(puVar8,0x3c,(size_t)puVar16);
  goto joined_r0x000140010ca0;
joined_r0x000140010e46:
  if (puVar6 == (ulonglong *)0x0) goto LAB_140010eb6;
  bVar17 = *puVar6 < 0x676c665f64692f3c;
  if ((*puVar6 != 0x676c665f64692f3c) ||
     (bVar17 = (byte)puVar6[1] < 0x3e, iVar3 = iVar10, (byte)puVar6[1] != 0x3e)) {
    iVar3 = (1 - (uint)bVar17) - (uint)(bVar17 != 0);
  }
  if (iVar3 == 0) {
    puVar8 = &local_b0;
    if (0xf < local_98) {
      puVar8 = (undefined1 *)CONCAT71(uStack_af,local_b0);
    }
    lVar13 = (longlong)puVar6 - (longlong)puVar8;
    goto LAB_140010eba;
  }
  puVar16 = puVar8 + (longlong)(puVar16 + (-1 - (longlong)puVar6));
  puVar8 = (undefined1 *)((longlong)puVar6 + 1);
  puVar6 = memchr(puVar8,0x3c,(size_t)puVar16);
  goto joined_r0x000140010e46;
LAB_140010eb6:
  lVar13 = -1;
LAB_140010eba:
  puVar8 = &local_b0;
  if (0xf < local_98) {
    puVar8 = (undefined1 *)CONCAT71(uStack_af,local_b0);
  }
  local_48 = 0xf;
  local_50 = 0;
  local_60 = 0;
  FUN_14001cff0(&local_60,puVar8 + ((longlong)plVar5 - (longlong)puVar15) + 8,puVar8 + lVar13);
  if (0xf < local_48) {
    operator_delete((void *)CONCAT71(uStack_5f,local_60));
  }
  goto LAB_140010f0a;
LAB_140010d10:
  lVar13 = -1;
LAB_140010d14:
  puVar8 = &local_b0;
  if (0xf < local_98) {
    puVar8 = (undefined1 *)CONCAT71(uStack_af,local_b0);
  }
  local_48 = 0xf;
  local_50 = 0;
  local_60 = 0;
  FUN_14001cff0(&local_60,puVar8 + ((longlong)puVar6 - (longlong)puVar15) + 0xc,puVar8 + lVar13);
  if (0xf < local_48) {
    operator_delete((void *)CONCAT71(uStack_5f,local_60));
  }
LAB_140010d67:
  if ((local_a0 != 0) && (7 < local_a0)) {
    puVar15 = (undefined1 *)(local_a0 - 7);
    puVar8 = &local_b0;
    if (0xf < local_98) {
      puVar8 = (undefined1 *)CONCAT71(uStack_af,local_b0);
    }
    plVar5 = memchr(puVar8,0x3c,(size_t)puVar15);
    while (plVar5 != (longlong *)0x0) {
      if (*plVar5 == 0x3e676c665f64693c) {
        puVar15 = &local_b0;
        if (0xf < local_98) {
          puVar15 = (undefined1 *)CONCAT71(uStack_af,local_b0);
        }
        if ((longlong)plVar5 - (longlong)puVar15 != -1) {
          if ((local_a0 == 0) || (local_a0 < 9)) goto LAB_140010eb6;
          puVar16 = (undefined1 *)(local_a0 - 8);
          puVar8 = &local_b0;
          if (0xf < local_98) {
            puVar8 = (undefined1 *)CONCAT71(uStack_af,local_b0);
          }
          puVar6 = memchr(puVar8,0x3c,(size_t)puVar16);
          goto joined_r0x000140010e46;
        }
        break;
      }
      puVar15 = puVar8 + (longlong)(puVar15 + (-1 - (longlong)plVar5));
      puVar8 = (undefined1 *)((longlong)plVar5 + 1);
      plVar5 = memchr(puVar8,0x3c,(size_t)puVar15);
    }
  }
LAB_140010f0a:
  if (0xf < uVar2) {
    operator_delete(puVar12);
  }
  if (0xf < local_98) {
    operator_delete((void *)CONCAT71(uStack_af,local_b0));
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

long FUN_140011560(char *param_1)

{
  char cVar1;
  int iVar2;
  long lVar3;
  ulonglong *puVar4;
  ulonglong *puVar5;
  undefined1 *puVar6;
  ulonglong uVar7;
  char *pcVar8;
  undefined1 *puVar9;
  undefined1 *puVar10;
  longlong lVar11;
  undefined1 *_MaxCount;
  bool bVar12;
  undefined1 auStack_98 [32];
  undefined8 local_78;
  undefined1 local_70;
  undefined7 uStack_6f;
  ulonglong local_60;
  ulonglong local_58;
  char local_48;
  undefined7 uStack_47;
  undefined8 local_38;
  ulonglong local_30;
  ulonglong local_20;
  
  local_78 = 0xfffffffffffffffe;
  local_20 = DAT_1402f85a0 ^ (ulonglong)auStack_98;
  local_58 = 0xf;
  local_60 = 0;
  local_70 = 0;
  uVar7 = 0xffffffffffffffff;
  pcVar8 = param_1;
  do {
    if (uVar7 == 0) break;
    uVar7 = uVar7 - 1;
    cVar1 = *pcVar8;
    pcVar8 = pcVar8 + 1;
  } while (cVar1 != '\0');
  FUN_140003e60(&local_70,param_1,~uVar7 - 1);
  if (local_60 == 0) {
    if (local_58 < 0x10) {
      return 0;
    }
    puVar9 = (undefined1 *)CONCAT71(uStack_6f,local_70);
  }
  else {
    if (10 < local_60) {
      puVar10 = (undefined1 *)(local_60 - 10);
      puVar9 = &local_70;
      if (0xf < local_58) {
        puVar9 = (undefined1 *)CONCAT71(uStack_6f,local_70);
      }
      puVar4 = memchr(puVar9,0x3c,(size_t)puVar10);
      while (puVar4 != (ulonglong *)0x0) {
        bVar12 = *puVar4 < (ulonglong)0x79742d726573753c;
        if (((*puVar4 == 0x79742d726573753c) &&
            (bVar12 = (ushort)puVar4[1] < (ushort)0x6570, (ushort)puVar4[1] == 0x6570)) &&
           (bVar12 = *(byte *)((longlong)puVar4 + 10) < (byte)'>',
           *(byte *)((longlong)puVar4 + 10) == '>')) {
          iVar2 = 0;
        }
        else {
          iVar2 = (1 - (uint)bVar12) - (uint)(bVar12 != 0);
        }
        if (iVar2 == 0) {
          puVar9 = (undefined1 *)CONCAT71(uStack_6f,local_70);
          puVar10 = &local_70;
          if (0xf < local_58) {
            puVar10 = puVar9;
          }
          if ((longlong)puVar4 - (longlong)puVar10 == -1) goto LAB_14001183e;
          if ((local_60 == 0) || (local_60 < 0xc)) goto LAB_140011750;
          _MaxCount = (undefined1 *)(local_60 - 0xb);
          puVar6 = &local_70;
          if (0xf < local_58) {
            puVar6 = puVar9;
          }
          puVar5 = memchr(puVar6,0x3c,(size_t)_MaxCount);
          goto joined_r0x0001400116e1;
        }
        puVar10 = puVar9 + (longlong)(puVar10 + (-1 - (longlong)puVar4));
        puVar9 = (undefined1 *)((longlong)puVar4 + 1);
        puVar4 = memchr(puVar9,0x3c,(size_t)puVar10);
      }
    }
    puVar9 = (undefined1 *)CONCAT71(uStack_6f,local_70);
LAB_14001183e:
    if (local_58 < 0x10) {
      return 0;
    }
  }
  operator_delete(puVar9);
  return 0;
joined_r0x0001400116e1:
  if (puVar5 == (ulonglong *)0x0) {
    puVar9 = (undefined1 *)CONCAT71(uStack_6f,local_70);
LAB_140011750:
    lVar11 = -1;
LAB_140011754:
    puVar6 = &local_70;
    if (0xf < local_58) {
      puVar6 = puVar9;
    }
    local_30 = 0xf;
    local_38 = 0;
    local_48 = '\0';
    FUN_14001cff0(&local_48,puVar6 + ((longlong)puVar4 - (longlong)puVar10) + 0xb,puVar6 + lVar11);
    pcVar8 = &local_48;
    if (0xf < local_30) {
      pcVar8 = (char *)CONCAT71(uStack_47,local_48);
    }
    lVar3 = strtol(pcVar8,(char **)0x0,0x10);
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if (DAT_140320610 == 0xc9) {
      printf("GetFlagForPWE : %s %d\n");
    }
    if (0xf < local_30) {
      operator_delete((void *)CONCAT71(uStack_47,local_48));
    }
    local_30 = 0xf;
    local_38 = 0;
    local_48 = '\0';
    if (0xf < local_58) {
      operator_delete((void *)CONCAT71(uStack_6f,local_70));
      return lVar3;
    }
    return lVar3;
  }
  bVar12 = *puVar5 < (ulonglong)0x742d726573752f3c;
  if ((*puVar5 == 0x742d726573752f3c) &&
     (bVar12 = (uint)puVar5[1] < (uint)0x3e657079, (uint)puVar5[1] == 0x3e657079)) {
    iVar2 = 0;
  }
  else {
    iVar2 = (1 - (uint)bVar12) - (uint)(bVar12 != 0);
  }
  if (iVar2 == 0) {
    puVar9 = (undefined1 *)CONCAT71(uStack_6f,local_70);
    puVar6 = &local_70;
    if (0xf < local_58) {
      puVar6 = puVar9;
    }
    lVar11 = (longlong)puVar5 - (longlong)puVar6;
    goto LAB_140011754;
  }
  _MaxCount = puVar6 + (longlong)(_MaxCount + (-1 - (longlong)puVar5));
  puVar6 = (undefined1 *)((longlong)puVar5 + 1);
  puVar5 = memchr(puVar6,0x3c,(size_t)_MaxCount);
  goto joined_r0x0001400116e1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_140011880(char *param_1)

{
  char cVar1;
  int iVar2;
  longlong *plVar3;
  ulonglong *puVar4;
  undefined1 *puVar5;
  ulonglong uVar6;
  char *pcVar7;
  undefined1 *puVar8;
  longlong lVar9;
  longlong lVar10;
  bool bVar11;
  undefined1 auStack_88 [32];
  undefined8 local_68;
  undefined1 local_60;
  undefined7 uStack_5f;
  ulonglong local_50;
  ulonglong local_48;
  char local_38;
  undefined7 uStack_37;
  undefined8 local_28;
  ulonglong local_20;
  ulonglong local_10;
  
  local_68 = 0xfffffffffffffffe;
  local_10 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320610 == 0xc9) {
    printf("GetUserIDForPWE : %s\n");
  }
  local_48 = 0xf;
  local_50 = 0;
  local_60 = 0;
  uVar6 = 0xffffffffffffffff;
  pcVar7 = param_1;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    cVar1 = *pcVar7;
    pcVar7 = pcVar7 + 1;
  } while (cVar1 != '\0');
  FUN_140003e60(&local_60,param_1,~uVar6 - 1);
  if ((local_50 != 0) && (7 < local_50)) {
    puVar8 = (undefined1 *)(local_50 - 7);
    puVar5 = &local_60;
    if (0xf < local_48) {
      puVar5 = (undefined1 *)CONCAT71(uStack_5f,local_60);
    }
    plVar3 = memchr(puVar5,0x3c,(size_t)puVar8);
    while (plVar3 != (longlong *)0x0) {
      if (*plVar3 == 0x3e6469726573753c) {
        puVar5 = &local_60;
        if (0xf < local_48) {
          puVar5 = (undefined1 *)CONCAT71(uStack_5f,local_60);
        }
        if ((longlong)plVar3 - (longlong)puVar5 != -1) {
          if ((local_50 == 0) || (local_50 < 8)) goto LAB_140011a51;
          puVar5 = (undefined1 *)(local_50 - 7);
          puVar8 = &local_60;
          if (0xf < local_48) {
            puVar8 = (undefined1 *)CONCAT71(uStack_5f,local_60);
          }
          plVar3 = memchr(puVar8,0x3c,(size_t)puVar5);
          goto joined_r0x000140011a01;
        }
        break;
      }
      puVar8 = puVar5 + (longlong)(puVar8 + (-1 - (longlong)plVar3));
      puVar5 = (undefined1 *)((longlong)plVar3 + 1);
      plVar3 = memchr(puVar5,0x3c,(size_t)puVar8);
    }
  }
  if (0xf < local_48) {
    operator_delete((void *)CONCAT71(uStack_5f,local_60));
  }
  return 0;
joined_r0x000140011a01:
  if (plVar3 == (longlong *)0x0) goto LAB_140011a51;
  if (*plVar3 == 0x3e6469726573753c) {
    puVar5 = &local_60;
    if (0xf < local_48) {
      puVar5 = (undefined1 *)CONCAT71(uStack_5f,local_60);
    }
    lVar9 = (longlong)plVar3 - (longlong)puVar5;
    goto LAB_140011a55;
  }
  puVar5 = puVar8 + (longlong)(puVar5 + (-1 - (longlong)plVar3));
  puVar8 = (undefined1 *)((longlong)plVar3 + 1);
  plVar3 = memchr(puVar8,0x3c,(size_t)puVar5);
  goto joined_r0x000140011a01;
LAB_140011a51:
  lVar9 = -1;
LAB_140011a55:
  if ((local_50 != 0) && (8 < local_50)) {
    puVar5 = (undefined1 *)(local_50 - 8);
    puVar8 = &local_60;
    if (0xf < local_48) {
      puVar8 = (undefined1 *)CONCAT71(uStack_5f,local_60);
    }
    puVar4 = memchr(puVar8,0x3c,(size_t)puVar5);
    while (puVar4 != (ulonglong *)0x0) {
      bVar11 = *puVar4 < (ulonglong)0x6469726573752f3c;
      if ((*puVar4 == 0x6469726573752f3c) &&
         (bVar11 = (byte)puVar4[1] < (byte)'>', (byte)puVar4[1] == '>')) {
        iVar2 = 0;
      }
      else {
        iVar2 = (1 - (uint)bVar11) - (uint)(bVar11 != 0);
      }
      if (iVar2 == 0) {
        puVar5 = &local_60;
        if (0xf < local_48) {
          puVar5 = (undefined1 *)CONCAT71(uStack_5f,local_60);
        }
        lVar10 = (longlong)puVar4 - (longlong)puVar5;
        goto LAB_140011b04;
      }
      puVar5 = puVar8 + (longlong)(puVar5 + (-1 - (longlong)puVar4));
      puVar8 = (undefined1 *)((longlong)puVar4 + 1);
      puVar4 = memchr(puVar8,0x3c,(size_t)puVar5);
    }
  }
  lVar10 = -1;
LAB_140011b04:
  puVar5 = &local_60;
  if (0xf < local_48) {
    puVar5 = (undefined1 *)CONCAT71(uStack_5f,local_60);
  }
  local_20 = 0xf;
  local_28 = 0;
  local_38 = '\0';
  FUN_14001cff0(&local_38,puVar5 + lVar9 + 8,puVar5 + lVar10);
  pcVar7 = &local_38;
  if (0xf < local_20) {
    pcVar7 = (char *)CONCAT71(uStack_37,local_38);
  }
  iVar2 = atoi(pcVar7);
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320610 == 0xc9) {
    printf("GetUserIDForPWE : %s %d\n");
  }
  if (0xf < local_20) {
    operator_delete((void *)CONCAT71(uStack_37,local_38));
  }
  local_20 = 0xf;
  local_28 = 0;
  local_38 = '\0';
  if (0xf < local_48) {
    operator_delete((void *)CONCAT71(uStack_5f,local_60));
  }
  return iVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_140011c20(longlong param_1,undefined4 param_2,undefined8 param_3,longlong *param_4,
             longlong *param_5,longlong *param_6)

{
  int *piVar1;
  char cVar2;
  int iVar3;
  errno_t eVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  longlong *plVar8;
  longlong lVar9;
  char *pcVar10;
  longlong lVar11;
  longlong lVar12;
  ulonglong *puVar13;
  undefined1 *puVar14;
  undefined8 uVar15;
  ulonglong uVar16;
  undefined8 *puVar17;
  undefined *puVar18;
  undefined *puVar19;
  undefined1 *_MaxCount;
  undefined4 uVar20;
  longlong lVar21;
  bool bVar22;
  undefined1 auStack_d38 [32];
  undefined **local_d18;
  uint *local_d10;
  uint *local_d08;
  undefined1 *local_d00;
  undefined8 local_cf8;
  undefined8 local_cf0;
  undefined8 local_ce8;
  int local_cd8;
  undefined4 local_cd4;
  undefined1 local_cd0 [8];
  undefined *local_cc8;
  undefined *local_cc0;
  uint local_cb8;
  uint local_cb4;
  uint local_cb0;
  uint local_cac;
  undefined8 local_ca8;
  int local_ca0;
  longlong local_c98;
  int local_c90;
  undefined4 local_c8c;
  longlong *local_c88;
  longlong local_c80;
  undefined1 local_c78;
  __time64_t local_c70;
  char *local_c68;
  DWORD local_c60;
  longlong local_c58;
  undefined8 local_c50;
  undefined1 local_c48;
  undefined8 local_c40;
  undefined1 local_c38;
  undefined8 local_c30;
  short local_c28;
  short local_c26;
  undefined2 local_c24;
  short local_c22;
  short local_c20;
  short local_c1e;
  short local_c1c;
  undefined2 local_c1a;
  undefined1 local_c18;
  undefined7 uStack_c17;
  ulonglong local_c08;
  ulonglong local_c00;
  undefined8 local_bf0;
  undefined8 local_be8;
  tm local_be0;
  undefined1 local_bb8 [10];
  ushort local_bae;
  undefined1 local_ba8 [8];
  ushort local_ba0;
  void *local_b98 [3];
  ulonglong local_b80;
  undefined2 local_b70;
  undefined6 uStack_b6e;
  undefined2 uStack_b68;
  undefined6 uStack_b66;
  undefined2 uStack_b60;
  undefined6 local_b5e;
  undefined2 uStack_b58;
  undefined6 local_b56;
  undefined2 uStack_b50;
  undefined6 local_b4e;
  undefined2 uStack_b48;
  undefined6 local_b46;
  undefined2 uStack_b40;
  char local_b38;
  undefined8 local_b37;
  undefined8 local_b2f;
  undefined8 local_b27;
  undefined8 local_b1f;
  undefined8 local_b17;
  undefined8 local_b0f;
  undefined8 local_b07;
  undefined4 local_aff;
  undefined2 local_afb;
  undefined1 local_af9;
  char local_af8;
  undefined1 local_af7 [127];
  char local_a78 [528];
  char local_868;
  undefined1 local_867 [255];
  char local_768;
  undefined1 local_767 [255];
  char local_668;
  undefined1 local_667 [271];
  char local_558;
  undefined1 local_557 [271];
  undefined1 local_448;
  undefined1 local_447 [1023];
  ulonglong local_48;
  
  local_c30 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_d38;
  local_cd4 = param_2;
  local_c88 = param_4;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 != 0xc9) && (DAT_140320610 != 0x65)) {
    return 1;
  }
  local_c68 = "PG_AUTH_PWE_TYPE_CORECLIENT";
  local_c58 = **(longlong **)(*(longlong *)(param_1 + 0x200) + 8) + 0x68;
  local_c60 = timeGetTime();
  lVar21 = param_1 + 0xe0;
  local_c80 = lVar21;
  FUN_1400a1c30(lVar21);
  local_c78 = 1;
  plVar8 = (longlong *)FUN_14000f1a0(param_1 + -8,&local_c98,param_2);
  lVar9 = 0;
  if ((longlong *)*plVar8 != (longlong *)0x0) {
    lVar9 = *(longlong *)*plVar8;
  }
  if ((local_c98 != 0) &&
     (*(longlong *)(local_c98 + 8) = *(longlong *)(local_c98 + 8) + -1, lVar21 = local_c80,
     *(longlong *)(local_c98 + 8) == 0)) {
    FUN_1400219e0(local_c98);
    lVar21 = local_c80;
  }
  if (lVar9 == 0) {
    FUN_1400d1290(lVar21);
    goto LAB_1400129f9;
  }
  local_668 = '\0';
  memset(local_667,0,0x103);
  local_558 = '\0';
  memset(local_557,0,0x103);
  local_a78[0] = '\0';
  memset(local_a78 + 1,0,0x207);
  local_af8 = '\0';
  memset(local_af7,0,0x7f);
  local_868 = '\0';
  memset(local_867,0,0xff);
  local_768 = '\0';
  memset(local_767,0,0xff);
  local_b38 = '\0';
  local_b37 = 0;
  local_b2f = 0;
  local_b27 = 0;
  local_b1f = 0;
  local_b17 = 0;
  local_b0f = 0;
  local_b07 = 0;
  local_aff = 0;
  local_afb = 0;
  local_af9 = 0;
  pcVar10 = (char *)*param_4;
  if ((char *)*param_4 == (char *)0x0) {
    pcVar10 = PTR_DAT_1402f8008;
  }
  strcpy_s(&local_af8,0x80,pcVar10);
  pcVar10 = (char *)*param_5;
  if ((char *)*param_5 == (char *)0x0) {
    pcVar10 = PTR_DAT_1402f8008;
  }
  strcpy_s(&local_868,0x100,pcVar10);
  pcVar10 = (char *)*param_6;
  if ((char *)*param_6 == (char *)0x0) {
    pcVar10 = PTR_DAT_1402f8008;
  }
  strcpy_s(&local_768,0x100,pcVar10);
  pcVar10 = (char *)FUN_1401e1690(local_b98,lVar9 + 0x10);
  if (0xf < *(ulonglong *)(pcVar10 + 0x18)) {
    pcVar10 = *(char **)pcVar10;
  }
  strcpy_s(&local_b38,0x40,pcVar10);
  if (0xf < local_b80) {
    operator_delete(local_b98[0]);
  }
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320610 == 0xc9) {
    printf("PWE Auth CoreClient Try : Account[ %s ] T[ %s ] R[ %s ]\n");
  }
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  pcVar10 = (char *)&DAT_1403204b0;
  if (0xf < DAT_1403204c8) {
    pcVar10 = DAT_1403204b0;
  }
  strcpy_s(&local_668,0x104,pcVar10);
  strcpy_s(local_a78,0x208,"<?xml version=\"1.0\" encoding=\"UTF-8\"?><token-login><account>");
  strcat_s(local_a78,0x208,&local_af8);
  strcat_s(local_a78,0x208,"</account><token>");
  strcat_s(local_a78,0x208,&local_868);
  strcat_s(local_a78,0x208,"</token><game>1000</game><ip>");
  strcat_s(local_a78,0x208,&local_b38);
  strcat_s(local_a78,0x208,"</ip></token-login>");
  strcpy_s(&local_558,0x104,"Content-Type: text/xml; charset=utf-8");
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320610 == 0xc9) {
    printf("PWE CoreClient : %s");
  }
  local_c00 = 0xf;
  local_c08 = 0;
  local_c18 = 0;
  iVar3 = 0x54;
  local_cd8 = 0x54;
  local_448 = 0;
  memset(local_447,0,0x3ff);
  if (DAT_14031fec0 != 0) {
    curl_easy_setopt(DAT_14031fec0,0x2712,&local_668);
    curl_easy_setopt(DAT_14031fec0,0x271a,&local_448);
    curl_easy_setopt(DAT_14031fec0,0x2f,1);
    curl_easy_setopt(DAT_14031fec0,0x2d,0);
    curl_easy_setopt(DAT_14031fec0,0xd,0x1e);
    uVar16 = 0xffffffffffffffff;
    pcVar10 = local_a78;
    do {
      if (uVar16 == 0) break;
      uVar16 = uVar16 - 1;
      cVar2 = *pcVar10;
      pcVar10 = pcVar10 + 1;
    } while (cVar2 != '\0');
    curl_easy_setopt(DAT_14031fec0,0x3c,~uVar16 - 1);
    lVar11 = curl_slist_append(0,&local_558);
    if (lVar11 != 0) {
      curl_easy_setopt(DAT_14031fec0,0x2727,lVar11);
      curl_easy_setopt(DAT_14031fec0,0x271f,local_a78);
      curl_easy_setopt(DAT_14031fec0,0x4e2b,FUN_1400108e0);
      curl_easy_setopt(DAT_14031fec0,0x2711,&local_c18);
      iVar3 = curl_easy_perform(DAT_14031fec0);
      local_cd8 = iVar3;
      lVar12 = FUN_1401e4420();
      if (*(int *)(lVar12 + 0x250) == 0xc9) {
        printf("curl_easy_perform Result : %d\n");
      }
      curl_slist_free_all(lVar11);
    }
  }
  local_cb0 = 0;
  local_cac = 0;
  if (iVar3 == 0) {
    puVar14 = &local_c18;
    if (0xf < local_c00) {
      puVar14 = (undefined1 *)CONCAT71(uStack_c17,local_c18);
    }
    local_cb0 = FUN_140011560(puVar14);
    local_cb8 = 0;
    local_cb4 = 0;
    lVar11 = FUN_140094270();
    if (*(char *)(lVar11 + 0x11) != '\0') {
      local_c70 = _time64((__time64_t *)0x0);
      local_ca8 = 0;
      local_ca0 = 0;
      eVar4 = _localtime64_s(&local_be0,&local_c70);
      if (eVar4 == 0) {
        local_c28 = (short)local_be0.tm_year + 0x76c;
        local_c26 = (short)local_be0.tm_mon + 1;
        local_c24 = (undefined2)local_be0.tm_wday;
        local_c22 = (short)local_be0.tm_mday;
        local_c20 = (short)local_be0.tm_hour;
        local_c1e = (short)local_be0.tm_min;
        local_c1c = (short)local_be0.tm_sec;
        local_c1a = 0;
        iVar3 = Ordinal_184(&local_c28,&local_ca8);
        local_bf0 = 0;
        local_be8 = 0;
        if ((((iVar3 == 0) || (iVar3 = Ordinal_185(local_ca8,&local_bf0), iVar3 == 0)) ||
            (local_c28 != (short)local_bf0)) ||
           (((local_c26 != local_bf0._2_2_ || (local_c22 != local_bf0._6_2_)) ||
            ((local_c20 != (short)local_be8 ||
             ((local_c1e != local_be8._2_2_ || (local_c1c != local_be8._4_2_))))))))
        goto LAB_140012362;
        local_ca0 = 0;
        iVar3 = Ordinal_185(local_ca8,local_ba8);
        if (iVar3 == 0) goto LAB_140012366;
        local_cb8 = (uint)local_ba0;
      }
      else {
LAB_140012362:
        local_ca0 = 1;
LAB_140012366:
        local_cb8 = 0xffffffff;
      }
      if ((local_ca0 == 0) && (iVar3 = Ordinal_185(local_ca8,local_bb8), iVar3 != 0)) {
        local_cb4 = (uint)local_bae;
      }
      else {
        local_cb4 = 0xffffffff;
      }
    }
    if ((local_c08 != 0) && (0x17 < local_c08)) {
      _MaxCount = (undefined1 *)(local_c08 - 0x17);
      puVar14 = &local_c18;
      if (0xf < local_c00) {
        puVar14 = (undefined1 *)CONCAT71(uStack_c17,local_c18);
      }
      puVar13 = memchr(puVar14,0x3c,(size_t)_MaxCount);
      while (puVar13 != (ulonglong *)0x0) {
        bVar22 = *puVar13 < (ulonglong)0x3e7375746174733c;
        if (((*puVar13 == 0x3e7375746174733c) &&
            (bVar22 = puVar13[1] < (ulonglong)0x3c73736563637573, puVar13[1] == 0x3c73736563637573))
           && (bVar22 = puVar13[2] < (ulonglong)0x3e7375746174732f, puVar13[2] == 0x3e7375746174732f
              )) {
          iVar3 = 0;
        }
        else {
          iVar3 = (1 - (uint)bVar22) - (uint)(bVar22 != 0);
        }
        if (iVar3 == 0) {
          puVar14 = &local_c18;
          if (0xf < local_c00) {
            puVar14 = (undefined1 *)CONCAT71(uStack_c17,local_c18);
          }
          if ((longlong)puVar13 - (longlong)puVar14 != -1) {
            iVar3 = 0;
            *(undefined4 *)(lVar9 + 0x1e8) = 0;
            puVar14 = &local_c18;
            if (0xf < local_c00) {
              puVar14 = (undefined1 *)CONCAT71(uStack_c17,local_c18);
            }
            local_cac = FUN_140011880(puVar14);
            puVar17 = (undefined8 *)*local_c88;
            if ((undefined8 *)*local_c88 == (undefined8 *)0x0) {
              puVar17 = (undefined8 *)PTR_DAT_1402f8008;
            }
            local_b70 = (undefined2)*puVar17;
            uStack_b6e = (undefined6)((ulonglong)*puVar17 >> 0x10);
            uStack_b68 = (undefined2)puVar17[1];
            uStack_b66 = (undefined6)((ulonglong)puVar17[1] >> 0x10);
            uStack_b60 = (undefined2)puVar17[2];
            local_b5e = (undefined6)((ulonglong)puVar17[2] >> 0x10);
            uStack_b58 = (undefined2)puVar17[3];
            local_b56 = (undefined6)((ulonglong)puVar17[3] >> 0x10);
            uStack_b50 = (undefined2)puVar17[4];
            local_b4e = (undefined6)((ulonglong)puVar17[4] >> 0x10);
            uStack_b48 = (undefined2)puVar17[5];
            local_b46 = (undefined6)((ulonglong)puVar17[5] >> 0x10);
            uStack_b40 = *(undefined2 *)(puVar17 + 6);
            local_d08 = (uint *)(lVar9 + 0x10);
            if (7 < *(ulonglong *)(lVar9 + 0x28)) {
              local_d08 = *(uint **)local_d08;
            }
            local_ce8 = 0;
            local_cf0 = 0;
            local_cf8 = 0;
            local_d00 = (undefined1 *)CONCAT44(local_d00._4_4_,1);
            local_d10 = (uint *)CONCAT44(local_d10._4_4_,*(undefined4 *)(DAT_140320138 + 0x140));
            local_d18 = (undefined **)&local_b70;
            (**(code **)(**(longlong **)(param_1 + 0x80) + 8))
                      (*(longlong **)(param_1 + 0x80),*(undefined4 *)(lVar9 + 0x1f0),
                       *(undefined4 *)(lVar9 + 0x1ec),local_cd4);
            local_c8c = 1;
            *(undefined4 *)(lVar9 + 0x1fc) = 1;
            strncpy_s((char *)(lVar9 + 0x200),0x32,(char *)&local_b70,0x31);
            *(undefined1 *)(lVar9 + 0x231) = 0;
            lVar11 = FUN_140094270();
            local_cd0[0] = *(undefined1 *)(lVar11 + 0x11);
            FUN_1400a3440();
            local_cc0 = PTR_DAT_1402f8008;
            iVar6 = FUN_1400a3360(&local_b70);
            if ((local_cc0 != (undefined *)0x0) && (local_cc0 != PTR_DAT_1402f8008)) {
              iVar3 = *(int *)(local_cc0 + -8);
            }
            iVar7 = 0;
            iVar5 = iVar6;
            if (((iVar6 <= iVar3) && (iVar5 = iVar7, local_cc0 != (undefined *)0x0)) &&
               (local_cc0 != PTR_DAT_1402f8008)) {
              iVar5 = *(int *)(local_cc0 + -8);
            }
            iVar3 = 1;
            if (1 < iVar5) {
              iVar3 = iVar5;
            }
            iVar5 = iVar7;
            if ((local_cc0 != (undefined *)0x0) && (local_cc0 != PTR_DAT_1402f8008)) {
              iVar5 = *(int *)(local_cc0 + -8);
            }
            if (iVar5 < iVar3) {
              FUN_14000c1c0(&local_cc0);
            }
            FUN_14000c330(&local_cc0);
            puVar18 = local_cc0;
            if (local_cc0 == (undefined *)0x0) {
              puVar18 = PTR_DAT_1402f8008;
            }
            FUN_1400a3390(puVar18,&local_b70,iVar6);
            puVar18 = local_cc0;
            if (local_cc0 == (undefined *)0x0) {
              puVar18 = PTR_DAT_1402f8008;
            }
            iVar6 = FUN_1400a3360(puVar18);
            uVar20 = local_cd4;
            iVar3 = 0;
            if (0 < iVar6) {
              iVar3 = iVar6;
            }
            iVar6 = iVar7;
            if ((local_cc0 != (undefined *)0x0) && (local_cc0 != PTR_DAT_1402f8008)) {
              iVar6 = *(int *)(local_cc0 + -8);
            }
            if ((iVar3 < iVar6) || (iVar3 = iVar7, local_cc0 == (undefined *)0x0)) {
LAB_1400126a0:
              if (((local_cc0 != PTR_DAT_1402f8008) && (local_cc0 != (undefined *)0x0)) &&
                 (piVar1 = (int *)(local_cc0 + -8), piVar1 != (int *)0x0)) {
                *piVar1 = iVar3;
                *(undefined1 *)((longlong)iVar3 + 8 + (longlong)piVar1) = 0;
              }
            }
            else if (local_cc0 != PTR_DAT_1402f8008) {
              iVar3 = *(int *)(local_cc0 + -8);
              goto LAB_1400126a0;
            }
            local_d00 = local_cd0;
            local_d08 = &local_cb4;
            local_d10 = &local_cb8;
            local_d18 = (undefined **)&local_c8c;
            (**(code **)(*(longlong *)(param_1 + 0x58) + 0x200))
                      ((longlong *)(param_1 + 0x58),local_cd4,&DAT_14030ab90,&local_cc0);
            puVar18 = local_cc0;
            iVar3 = local_cd8;
            if (((local_cc0 != (undefined *)0x0) && (local_cc0 != PTR_DAT_1402f8008)) &&
               (puVar19 = local_cc0 + -8, uVar20 = local_cd4, puVar19 != (undefined *)0x0)) {
              uVar15 = FUN_1400a3440();
              local_c40 = uVar15;
              FUN_1400a1c30(uVar15);
              local_c38 = 1;
              piVar1 = (int *)(puVar18 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(puVar19);
              }
              FUN_1400d1290(uVar15);
              uVar20 = local_cd4;
              iVar3 = local_cd8;
            }
            goto LAB_1400127cd;
          }
          break;
        }
        _MaxCount = puVar14 + (longlong)(_MaxCount + (-1 - (longlong)puVar13));
        puVar14 = (undefined1 *)((longlong)puVar13 + 1);
        puVar13 = memchr(puVar14,0x3c,(size_t)_MaxCount);
      }
    }
    lVar11 = FUN_1401e4420();
    if (*(int *)(lVar11 + 0x250) == 0xc9) {
      printf("Auth Failed : %s");
    }
    *(int *)(lVar9 + 0x1e8) = *(int *)(lVar9 + 0x1e8) + 1;
    uVar20 = local_cd4;
    iVar3 = local_cd8;
  }
  else {
    lVar11 = FUN_1401e4420();
    if (*(int *)(lVar11 + 0x250) == 0xc9) {
      printf("curl_easy_perform Error : %s\n");
    }
    *(int *)(lVar9 + 0x1e8) = *(int *)(lVar9 + 0x1e8) + 1;
    uVar20 = local_cd4;
  }
LAB_1400127cd:
  if (2 < *(int *)(lVar9 + 0x1e8)) {
    local_cd8 = 0xe;
    (**(code **)(*(longlong *)(param_1 + 0x58) + 0x70))
              ((longlong *)(param_1 + 0x58),uVar20,&DAT_14030ab90,&local_cd8);
    if (0xf < local_c00) {
      operator_delete((void *)CONCAT71(uStack_c17,local_c18));
    }
    local_c00 = 0xf;
    local_c08 = 0;
    local_c18 = 0;
    FUN_1400d1290(lVar21);
    goto LAB_1400129f9;
  }
  puVar18 = (&PTR_s_CURLE_OK_140312850)[iVar3];
  FUN_1400a3440();
  local_cc8 = PTR_DAT_1402f8008;
  iVar6 = FUN_1400a3360(puVar18);
  iVar5 = 0;
  iVar3 = iVar5;
  if ((local_cc8 != (undefined *)0x0) && (local_cc8 != PTR_DAT_1402f8008)) {
    iVar3 = *(int *)(local_cc8 + -8);
  }
  iVar7 = iVar6;
  if (((iVar6 <= iVar3) && (iVar7 = iVar5, local_cc8 != (undefined *)0x0)) &&
     (local_cc8 != PTR_DAT_1402f8008)) {
    iVar7 = *(int *)(local_cc8 + -8);
  }
  iVar3 = 1;
  if (1 < iVar7) {
    iVar3 = iVar7;
  }
  iVar7 = 0;
  iVar5 = iVar7;
  if ((local_cc8 != (undefined *)0x0) && (local_cc8 != PTR_DAT_1402f8008)) {
    iVar5 = *(int *)(local_cc8 + -8);
  }
  if (iVar5 < iVar3) {
    FUN_14000c1c0(&local_cc8,iVar3);
  }
  FUN_14000c330(&local_cc8);
  puVar19 = local_cc8;
  if (local_cc8 == (undefined *)0x0) {
    puVar19 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar19,puVar18,iVar6);
  puVar18 = local_cc8;
  if (local_cc8 == (undefined *)0x0) {
    puVar18 = PTR_DAT_1402f8008;
  }
  iVar6 = FUN_1400a3360(puVar18);
  iVar3 = 0;
  if (0 < iVar6) {
    iVar3 = iVar6;
  }
  iVar6 = iVar7;
  if ((local_cc8 != (undefined *)0x0) && (local_cc8 != PTR_DAT_1402f8008)) {
    iVar6 = *(int *)(local_cc8 + -8);
  }
  if ((iVar3 < iVar6) || (iVar3 = iVar7, local_cc8 == (undefined *)0x0)) {
LAB_140012927:
    if (((local_cc8 != PTR_DAT_1402f8008) && (local_cc8 != (undefined *)0x0)) &&
       (piVar1 = (int *)(local_cc8 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar3;
      *(undefined1 *)((longlong)iVar3 + 8 + (longlong)piVar1) = 0;
    }
  }
  else if (local_cc8 != PTR_DAT_1402f8008) {
    iVar3 = *(int *)(local_cc8 + -8);
    goto LAB_140012927;
  }
  local_c90 = local_cd8;
  local_d08 = &local_cac;
  local_d10 = &local_cb0;
  local_d18 = &local_cc8;
  (**(code **)(*(longlong *)(param_1 + 0x58) + 0x1f0))
            ((longlong *)(param_1 + 0x58),local_cd4,&DAT_14030ad10,&local_c90);
  puVar18 = local_cc8;
  if (((local_cc8 != (undefined *)0x0) && (local_cc8 != PTR_DAT_1402f8008)) &&
     (puVar19 = local_cc8 + -8, puVar19 != (undefined *)0x0)) {
    uVar15 = FUN_1400a3440();
    local_c50 = uVar15;
    FUN_1400a1c30(uVar15);
    local_c48 = 1;
    piVar1 = (int *)(puVar18 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar19);
    }
    FUN_1400d1290(uVar15);
  }
  if (0xf < local_c00) {
    operator_delete((void *)CONCAT71(uStack_c17,local_c18));
  }
  local_c00 = 0xf;
  local_c08 = 0;
  local_c18 = 0;
  FUN_1400d1290(lVar21);
LAB_1400129f9:
  FUN_140070e40(&local_c68);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_140012a30(longlong param_1,undefined4 param_2,undefined8 param_3,longlong *param_4,
             longlong *param_5)

{
  int *piVar1;
  char cVar2;
  int iVar3;
  errno_t eVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  longlong *plVar9;
  longlong lVar10;
  char *pcVar11;
  longlong lVar12;
  ulonglong *puVar13;
  undefined1 *puVar14;
  undefined8 uVar15;
  longlong lVar16;
  undefined8 *puVar17;
  undefined *puVar18;
  undefined *puVar19;
  undefined1 *_MaxCount;
  longlong lVar20;
  undefined4 uVar21;
  bool bVar22;
  undefined1 auStack_c48 [32];
  undefined **local_c28;
  uint *local_c20;
  uint *local_c18;
  undefined1 *local_c10;
  undefined8 local_c08;
  undefined8 local_c00;
  undefined8 local_bf8;
  undefined1 local_be8 [4];
  int local_be4;
  undefined *local_be0;
  undefined *local_bd8;
  uint local_bd0;
  undefined4 local_bcc;
  uint local_bc8;
  uint local_bc4;
  uint local_bc0 [2];
  undefined8 local_bb8;
  int local_bb0;
  longlong local_ba8;
  longlong local_ba0;
  int local_b98;
  undefined4 local_b94;
  longlong *local_b90;
  __time64_t local_b88;
  char *local_b80;
  DWORD local_b78;
  longlong local_b70;
  longlong local_b68;
  undefined1 local_b60;
  undefined8 local_b58;
  undefined8 local_b50;
  undefined1 local_b48;
  undefined8 local_b40;
  undefined1 local_b38;
  short local_b30;
  short local_b2e;
  undefined2 local_b2c;
  short local_b2a;
  short local_b28;
  short local_b26;
  short local_b24;
  undefined2 local_b22;
  undefined1 local_b20;
  undefined7 uStack_b1f;
  ulonglong local_b10;
  ulonglong local_b08;
  undefined8 local_af8;
  undefined8 local_af0;
  tm local_ae8;
  undefined1 local_ac0 [10];
  ushort local_ab6;
  undefined1 local_ab0 [8];
  ushort local_aa8;
  void *local_aa0 [3];
  ulonglong local_a88;
  undefined2 local_a78;
  undefined6 uStack_a76;
  undefined2 uStack_a70;
  undefined6 uStack_a6e;
  undefined2 uStack_a68;
  undefined6 local_a66;
  undefined2 uStack_a60;
  undefined6 local_a5e;
  undefined2 uStack_a58;
  undefined6 local_a56;
  undefined2 uStack_a50;
  undefined6 local_a4e;
  undefined2 uStack_a48;
  char local_a38;
  undefined8 local_a37;
  undefined8 local_a2f;
  undefined8 local_a27;
  undefined8 local_a1f;
  undefined8 local_a17;
  undefined8 local_a0f;
  undefined8 local_a07;
  undefined4 local_9ff;
  undefined2 local_9fb;
  undefined1 local_9f9;
  char local_9f8;
  undefined1 local_9f7 [127];
  char local_978 [528];
  char local_768;
  undefined1 local_767 [255];
  char local_668;
  undefined1 local_667 [271];
  char local_558;
  undefined1 local_557 [271];
  undefined1 local_448;
  undefined1 local_447 [1023];
  ulonglong local_48;
  
  local_b58 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_c48;
  local_bcc = param_2;
  local_ba0 = param_1;
  local_b90 = param_4;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 != 0xc9) && (DAT_140320610 != 0x65)) {
    return 1;
  }
  local_b80 = "PG_AUTH_PWE_TYPE";
  local_b70 = **(longlong **)(*(longlong *)(param_1 + 0x200) + 8) + 0x68;
  local_b78 = timeGetTime();
  lVar20 = param_1 + 0xe0;
  local_b68 = lVar20;
  FUN_1400a1c30(lVar20);
  local_b60 = 1;
  plVar9 = (longlong *)FUN_14000f1a0(param_1 + -8,&local_ba8,param_2);
  lVar10 = 0;
  if ((longlong *)*plVar9 != (longlong *)0x0) {
    lVar10 = *(longlong *)*plVar9;
  }
  if ((local_ba8 != 0) &&
     (*(longlong *)(local_ba8 + 8) = *(longlong *)(local_ba8 + 8) + -1, lVar20 = local_b68,
     *(longlong *)(local_ba8 + 8) == 0)) {
    FUN_1400219e0(local_ba8);
    lVar20 = local_b68;
  }
  if (lVar10 == 0) {
    FUN_1400d1290(lVar20);
    goto LAB_140013757;
  }
  local_668 = '\0';
  memset(local_667,0,0x103);
  local_558 = '\0';
  memset(local_557,0,0x103);
  local_978[0] = '\0';
  memset(local_978 + 1,0,0x207);
  local_9f8 = '\0';
  memset(local_9f7,0,0x7f);
  local_768 = '\0';
  memset(local_767,0,0xff);
  local_a38 = '\0';
  local_a37 = 0;
  local_a2f = 0;
  local_a27 = 0;
  local_a1f = 0;
  local_a17 = 0;
  local_a0f = 0;
  local_a07 = 0;
  local_9ff = 0;
  local_9fb = 0;
  local_9f9 = 0;
  pcVar11 = (char *)*param_4;
  if ((char *)*param_4 == (char *)0x0) {
    pcVar11 = PTR_DAT_1402f8008;
  }
  strcpy_s(&local_9f8,0x80,pcVar11);
  pcVar11 = (char *)*param_5;
  if ((char *)*param_5 == (char *)0x0) {
    pcVar11 = PTR_DAT_1402f8008;
  }
  strcpy_s(&local_768,0x100,pcVar11);
  plVar9 = (longlong *)(lVar10 + 0x10);
  pcVar11 = (char *)FUN_1401e1690(local_aa0,plVar9);
  if (0xf < *(ulonglong *)(pcVar11 + 0x18)) {
    pcVar11 = *(char **)pcVar11;
  }
  strcpy_s(&local_a38,0x40,pcVar11);
  if (0xf < local_a88) {
    operator_delete(local_aa0[0]);
  }
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320610 == 0xc9) {
    printf("PWE Auth Try : Account[ %s ] P[ %s ] IP[ %s ]\n");
  }
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  pcVar11 = (char *)&DAT_1403204b0;
  if (0xf < DAT_1403204c8) {
    pcVar11 = DAT_1403204b0;
  }
  strcpy_s(&local_668,0x104,pcVar11);
  strcpy_s(local_978,0x208,"<?xml version=\"1.0\" encoding=\"UTF-8\"?><login-request><account>");
  strcat_s(local_978,0x208,&local_9f8);
  strcat_s(local_978,0x208,"</account><password>");
  strcat_s(local_978,0x208,&local_768);
  strcat_s(local_978,0x208,"</password><game>16</game><ip>");
  strcat_s(local_978,0x208,&local_a38);
  strcat_s(local_978,0x208,"</ip></login-request>");
  strcpy_s(&local_558,0x104,"Content-Type: text/xml; charset=utf-8");
  local_b08 = 0xf;
  local_b10 = 0;
  local_b20 = 0;
  local_be4 = 0x54;
  local_448 = 0;
  memset(local_447,0,0x3ff);
  iVar3 = 0x54;
  if (DAT_14031fec0 != 0) {
    curl_easy_setopt(DAT_14031fec0,0x2712,&local_668);
    curl_easy_setopt(DAT_14031fec0,0x271a,&local_448);
    curl_easy_setopt(DAT_14031fec0,0x2f,1);
    curl_easy_setopt(DAT_14031fec0,0x2d,0);
    curl_easy_setopt(DAT_14031fec0,0xd,0x1e);
    lVar16 = -1;
    pcVar11 = local_978;
    do {
      if (lVar16 == 0) break;
      lVar16 = lVar16 + -1;
      cVar2 = *pcVar11;
      pcVar11 = pcVar11 + 1;
    } while (cVar2 != '\0');
    curl_easy_setopt(DAT_14031fec0,0x3c);
    lVar16 = curl_slist_append(0,&local_558);
    iVar3 = 0x54;
    if (lVar16 != 0) {
      curl_easy_setopt(DAT_14031fec0,0x2727,lVar16);
      curl_easy_setopt(DAT_14031fec0,0x271f,local_978);
      curl_easy_setopt(DAT_14031fec0,0x4e2b,FUN_1400108e0);
      curl_easy_setopt(DAT_14031fec0,0x2711);
      iVar3 = curl_easy_perform(DAT_14031fec0);
      local_be4 = iVar3;
      lVar12 = FUN_1401e4420();
      if (*(int *)(lVar12 + 0x250) == 0xc9) {
        printf("curl_easy_perform Result : %d\n");
      }
      curl_slist_free_all(lVar16);
    }
  }
  local_bc0[0] = 0;
  local_bc4 = 0;
  if (iVar3 == 0) {
    puVar14 = &local_b20;
    if (0xf < local_b08) {
      puVar14 = (undefined1 *)CONCAT71(uStack_b1f,local_b20);
    }
    local_bc0[0] = FUN_140011560(puVar14);
    local_bd0 = 0;
    local_bc8 = 0;
    lVar16 = FUN_140094270();
    if (*(char *)(lVar16 + 0x11) != '\0') {
      local_b88 = _time64((__time64_t *)0x0);
      local_bb8 = 0;
      local_bb0 = 0;
      eVar4 = _localtime64_s(&local_ae8,&local_b88);
      if (eVar4 == 0) {
        local_b30 = (short)local_ae8.tm_year + 0x76c;
        local_b2e = (short)local_ae8.tm_mon + 1;
        local_b2c = (undefined2)local_ae8.tm_wday;
        local_b2a = (short)local_ae8.tm_mday;
        local_b28 = (short)local_ae8.tm_hour;
        local_b26 = (short)local_ae8.tm_min;
        local_b24 = (short)local_ae8.tm_sec;
        local_b22 = 0;
        iVar3 = Ordinal_184(&local_b30,&local_bb8);
        local_af8 = 0;
        local_af0 = 0;
        if ((((iVar3 == 0) || (iVar3 = Ordinal_185(local_bb8,&local_af8), iVar3 == 0)) ||
            (local_b30 != (short)local_af8)) ||
           (((local_b2e != local_af8._2_2_ || (local_b2a != local_af8._6_2_)) ||
            ((local_b28 != (short)local_af0 ||
             ((local_b26 != local_af0._2_2_ || (local_b24 != local_af0._4_2_))))))))
        goto LAB_1400130f6;
        local_bb0 = 0;
        iVar3 = Ordinal_185(local_bb8,local_ab0);
        if (iVar3 == 0) goto LAB_1400130fa;
        local_bd0 = (uint)local_aa8;
      }
      else {
LAB_1400130f6:
        local_bb0 = 1;
LAB_1400130fa:
        local_bd0 = 0xffffffff;
      }
      if ((local_bb0 == 0) && (iVar3 = Ordinal_185(local_bb8,local_ac0), iVar3 != 0)) {
        local_bc8 = (uint)local_ab6;
      }
      else {
        local_bc8 = 0xffffffff;
      }
    }
    param_1 = local_ba0;
    if ((local_b10 != 0) && (0x17 < local_b10)) {
      _MaxCount = (undefined1 *)(local_b10 - 0x17);
      puVar14 = &local_b20;
      if (0xf < local_b08) {
        puVar14 = (undefined1 *)CONCAT71(uStack_b1f,local_b20);
      }
      puVar13 = memchr(puVar14,0x3c,(size_t)_MaxCount);
      param_1 = local_ba0;
      while (local_ba0 = param_1, puVar13 != (ulonglong *)0x0) {
        bVar22 = *puVar13 < (ulonglong)0x3e7375746174733c;
        if (((*puVar13 == 0x3e7375746174733c) &&
            (bVar22 = puVar13[1] < (ulonglong)0x3c73736563637573, puVar13[1] == 0x3c73736563637573))
           && (bVar22 = puVar13[2] < (ulonglong)0x3e7375746174732f, puVar13[2] == 0x3e7375746174732f
              )) {
          iVar3 = 0;
        }
        else {
          iVar3 = (1 - (uint)bVar22) - (uint)(bVar22 != 0);
        }
        if (iVar3 == 0) {
          puVar14 = &local_b20;
          if (0xf < local_b08) {
            puVar14 = (undefined1 *)CONCAT71(uStack_b1f,local_b20);
          }
          if ((longlong)puVar13 - (longlong)puVar14 != -1) {
            *(undefined4 *)(lVar10 + 0x1e8) = 0;
            puVar14 = &local_b20;
            if (0xf < local_b08) {
              puVar14 = (undefined1 *)CONCAT71(uStack_b1f,local_b20);
            }
            local_bc4 = FUN_140011880(puVar14);
            param_1 = local_ba0;
            uVar21 = local_bcc;
            puVar17 = (undefined8 *)*local_b90;
            if ((undefined8 *)*local_b90 == (undefined8 *)0x0) {
              puVar17 = (undefined8 *)PTR_DAT_1402f8008;
            }
            local_a78 = (undefined2)*puVar17;
            uStack_a76 = (undefined6)((ulonglong)*puVar17 >> 0x10);
            uStack_a70 = (undefined2)puVar17[1];
            uStack_a6e = (undefined6)((ulonglong)puVar17[1] >> 0x10);
            uStack_a68 = (undefined2)puVar17[2];
            local_a66 = (undefined6)((ulonglong)puVar17[2] >> 0x10);
            uStack_a60 = (undefined2)puVar17[3];
            local_a5e = (undefined6)((ulonglong)puVar17[3] >> 0x10);
            uStack_a58 = (undefined2)puVar17[4];
            local_a56 = (undefined6)((ulonglong)puVar17[4] >> 0x10);
            uStack_a50 = (undefined2)puVar17[5];
            local_a4e = (undefined6)((ulonglong)puVar17[5] >> 0x10);
            uStack_a48 = *(undefined2 *)(puVar17 + 6);
            if (7 < *(ulonglong *)(lVar10 + 0x28)) {
              plVar9 = (longlong *)*plVar9;
            }
            local_bf8 = 0;
            local_c00 = 0;
            local_c08 = 0;
            local_c10 = (undefined1 *)CONCAT44(local_c10._4_4_,1);
            local_c20 = (uint *)CONCAT44(local_c20._4_4_,*(undefined4 *)(DAT_140320138 + 0x140));
            local_c28 = (undefined **)&local_a78;
            local_c18 = (uint *)plVar9;
            (**(code **)(**(longlong **)(local_ba0 + 0x80) + 8))
                      (*(longlong **)(local_ba0 + 0x80),*(undefined4 *)(lVar10 + 0x1f0),
                       *(undefined4 *)(lVar10 + 0x1ec),local_bcc);
            local_b94 = 1;
            *(undefined4 *)(lVar10 + 0x1fc) = 1;
            strncpy_s((char *)(lVar10 + 0x200),0x32,(char *)&local_a78,0x31);
            *(undefined1 *)(lVar10 + 0x231) = 0;
            lVar16 = FUN_140094270();
            local_be8[0] = *(undefined1 *)(lVar16 + 0x11);
            FUN_1400a3440();
            local_bd8 = PTR_DAT_1402f8008;
            iVar5 = FUN_1400a3360(&local_a78);
            iVar8 = 0;
            iVar3 = iVar8;
            if ((local_bd8 != (undefined *)0x0) && (local_bd8 != PTR_DAT_1402f8008)) {
              iVar3 = *(int *)(local_bd8 + -8);
            }
            iVar7 = 0;
            iVar6 = iVar5;
            if (((iVar5 <= iVar3) && (iVar6 = iVar8, local_bd8 != (undefined *)0x0)) &&
               (iVar6 = iVar7, local_bd8 != PTR_DAT_1402f8008)) {
              iVar6 = *(int *)(local_bd8 + -8);
            }
            iVar3 = 1;
            if (1 < iVar6) {
              iVar3 = iVar6;
            }
            if ((local_bd8 != (undefined *)0x0) && (local_bd8 != PTR_DAT_1402f8008)) {
              iVar7 = *(int *)(local_bd8 + -8);
            }
            if (iVar7 < iVar3) {
              FUN_14000c1c0(&local_bd8);
            }
            FUN_14000c330(&local_bd8);
            puVar18 = local_bd8;
            if (local_bd8 == (undefined *)0x0) {
              puVar18 = PTR_DAT_1402f8008;
            }
            FUN_1400a3390(puVar18,&local_a78,iVar5);
            puVar18 = local_bd8;
            if (local_bd8 == (undefined *)0x0) {
              puVar18 = PTR_DAT_1402f8008;
            }
            iVar5 = FUN_1400a3360(puVar18);
            iVar3 = 0;
            if (0 < iVar5) {
              iVar3 = iVar5;
            }
            iVar5 = 0;
            if ((local_bd8 != (undefined *)0x0) && (iVar5 = 0, local_bd8 != PTR_DAT_1402f8008)) {
              iVar5 = *(int *)(local_bd8 + -8);
            }
            if ((iVar3 < iVar5) || (iVar3 = 0, local_bd8 == (undefined *)0x0)) {
LAB_140013448:
              if (((local_bd8 != PTR_DAT_1402f8008) && (local_bd8 != (undefined *)0x0)) &&
                 (piVar1 = (int *)(local_bd8 + -8), piVar1 != (int *)0x0)) {
                *piVar1 = iVar3;
                *(undefined1 *)((longlong)iVar3 + 8 + (longlong)piVar1) = 0;
              }
            }
            else if (local_bd8 != PTR_DAT_1402f8008) {
              iVar3 = *(int *)(local_bd8 + -8);
              goto LAB_140013448;
            }
            local_c10 = local_be8;
            local_c18 = &local_bc8;
            local_c20 = &local_bd0;
            local_c28 = (undefined **)&local_b94;
            (**(code **)(*(longlong *)(param_1 + 0x58) + 0x200))
                      ((longlong *)(param_1 + 0x58),uVar21,&DAT_14030ab90,&local_bd8);
            puVar18 = local_bd8;
            if (((local_bd8 != (undefined *)0x0) && (local_bd8 != PTR_DAT_1402f8008)) &&
               (puVar19 = local_bd8 + -8, puVar19 != (undefined *)0x0)) {
              uVar15 = FUN_1400a3440();
              local_b50 = uVar15;
              FUN_1400a1c30(uVar15);
              local_b48 = 1;
              piVar1 = (int *)(puVar18 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(puVar19);
              }
              FUN_1400d1290(uVar15);
            }
            goto LAB_14001352d;
          }
          break;
        }
        _MaxCount = puVar14 + (longlong)(_MaxCount + (-1 - (longlong)puVar13));
        puVar14 = (undefined1 *)((longlong)puVar13 + 1);
        puVar13 = memchr(puVar14,0x3c,(size_t)_MaxCount);
        param_1 = local_ba0;
      }
    }
  }
  else {
    lVar16 = FUN_1401e4420();
    if (*(int *)(lVar16 + 0x250) == 0xc9) {
      printf("curl_easy_perform Error : %s\n");
    }
  }
  *(int *)(lVar10 + 0x1e8) = *(int *)(lVar10 + 0x1e8) + 1;
  uVar21 = local_bcc;
LAB_14001352d:
  iVar3 = local_be4;
  if (2 < *(int *)(lVar10 + 0x1e8)) {
    local_be4 = 0xe;
    (**(code **)(*(longlong *)(param_1 + 0x58) + 0x70))
              ((longlong *)(param_1 + 0x58),uVar21,&DAT_14030ab90,&local_be4);
    if (0xf < local_b08) {
      operator_delete((void *)CONCAT71(uStack_b1f,local_b20));
    }
    local_b08 = 0xf;
    local_b10 = 0;
    local_b20 = 0;
    FUN_1400d1290(lVar20);
    goto LAB_140013757;
  }
  puVar18 = (&PTR_s_CURLE_OK_140312850)[local_be4];
  FUN_1400a3440();
  local_be0 = PTR_DAT_1402f8008;
  iVar8 = FUN_1400a3360(puVar18);
  iVar6 = 0;
  iVar5 = iVar6;
  if ((local_be0 != (undefined *)0x0) && (local_be0 != PTR_DAT_1402f8008)) {
    iVar5 = *(int *)(local_be0 + -8);
  }
  iVar7 = iVar8;
  if (((iVar8 <= iVar5) && (iVar7 = iVar6, local_be0 != (undefined *)0x0)) &&
     (local_be0 != PTR_DAT_1402f8008)) {
    iVar7 = *(int *)(local_be0 + -8);
  }
  iVar5 = 1;
  if (1 < iVar7) {
    iVar5 = iVar7;
  }
  iVar6 = 0;
  if ((local_be0 != (undefined *)0x0) && (local_be0 != PTR_DAT_1402f8008)) {
    iVar6 = *(int *)(local_be0 + -8);
  }
  if (iVar6 < iVar5) {
    FUN_14000c1c0(&local_be0,iVar5);
  }
  FUN_14000c330(&local_be0);
  puVar19 = local_be0;
  if (local_be0 == (undefined *)0x0) {
    puVar19 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar19,puVar18,iVar8);
  puVar18 = local_be0;
  if (local_be0 == (undefined *)0x0) {
    puVar18 = PTR_DAT_1402f8008;
  }
  iVar8 = FUN_1400a3360(puVar18);
  iVar5 = 0;
  if (0 < iVar8) {
    iVar5 = iVar8;
  }
  iVar8 = 0;
  if ((local_be0 != (undefined *)0x0) && (iVar8 = 0, local_be0 != PTR_DAT_1402f8008)) {
    iVar8 = *(int *)(local_be0 + -8);
  }
  if ((iVar5 < iVar8) || (iVar5 = 0, local_be0 == (undefined *)0x0)) {
LAB_140013685:
    if (((local_be0 != PTR_DAT_1402f8008) && (local_be0 != (undefined *)0x0)) &&
       (piVar1 = (int *)(local_be0 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar5;
      *(undefined1 *)((longlong)iVar5 + 8 + (longlong)piVar1) = 0;
    }
  }
  else if (local_be0 != PTR_DAT_1402f8008) {
    iVar5 = *(int *)(local_be0 + -8);
    goto LAB_140013685;
  }
  local_b98 = iVar3;
  local_c18 = &local_bc4;
  local_c20 = local_bc0;
  local_c28 = &local_be0;
  (**(code **)(*(longlong *)(local_ba0 + 0x58) + 0x1f0))
            ((longlong *)(local_ba0 + 0x58),uVar21,&DAT_14030ad10,&local_b98);
  puVar18 = local_be0;
  if (((local_be0 != (undefined *)0x0) && (local_be0 != PTR_DAT_1402f8008)) &&
     (puVar19 = local_be0 + -8, puVar19 != (undefined *)0x0)) {
    uVar15 = FUN_1400a3440();
    local_b40 = uVar15;
    FUN_1400a1c30(uVar15);
    local_b38 = 1;
    piVar1 = (int *)(puVar18 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar19);
    }
    FUN_1400d1290(uVar15);
  }
  if (0xf < local_b08) {
    operator_delete((void *)CONCAT71(uStack_b1f,local_b20));
  }
  local_b08 = 0xf;
  local_b10 = 0;
  local_b20 = 0;
  FUN_1400d1290(lVar20);
LAB_140013757:
  FUN_140070e40(&local_b80);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140013790(longlong param_1,char *param_2,char *param_3)

{
  char cVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  ulonglong uVar5;
  undefined1 *puVar6;
  uint uVar7;
  char *pcVar8;
  undefined1 auStack_bb8 [32];
  char *local_b98;
  DWORD local_b90;
  longlong local_b88;
  undefined8 local_b80;
  longlong local_b78;
  undefined1 local_b70;
  undefined1 local_b68;
  undefined7 uStack_b67;
  undefined8 local_b58;
  ulonglong local_b50;
  char local_b38 [192];
  char local_a78 [272];
  char local_968 [528];
  char local_758;
  undefined1 local_757 [255];
  char local_658;
  undefined1 local_657 [271];
  char local_548;
  undefined1 local_547 [271];
  undefined1 local_438;
  undefined1 local_437 [1023];
  ulonglong local_38;
  
  local_b80 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_bb8;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 != 0xcb) && (DAT_140320610 != 0x67)) {
    return;
  }
  local_b98 = "Test_SEGA_Auth";
  local_b88 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x68;
  local_b90 = timeGetTime();
  param_1 = param_1 + 0xe8;
  local_b78 = param_1;
  FUN_1400a1c30(param_1);
  local_b70 = 1;
  local_548 = '\0';
  memset(local_547,0,0x103);
  local_a78[0] = '\0';
  memset(local_a78 + 1,0,0x103);
  local_968[0] = '\0';
  memset(local_968 + 1,0,0x207);
  local_658 = '\0';
  memset(local_657,0,0x103);
  local_b38[0x40] = 0;
  memset(local_b38 + 0x41,0,0x7f);
  local_758 = '\0';
  memset(local_757,0,0xff);
  local_b38[0] = '\0';
  local_b38[1] = '\0';
  local_b38[2] = '\0';
  local_b38[3] = '\0';
  local_b38[4] = '\0';
  local_b38[5] = '\0';
  local_b38[6] = '\0';
  local_b38[7] = '\0';
  local_b38[8] = '\0';
  local_b38[9] = '\0';
  local_b38[10] = '\0';
  local_b38[0xb] = '\0';
  local_b38[0xc] = '\0';
  local_b38[0xd] = '\0';
  local_b38[0xe] = '\0';
  local_b38[0xf] = '\0';
  local_b38[0x10] = '\0';
  local_b38[0x11] = '\0';
  local_b38[0x12] = '\0';
  local_b38[0x13] = '\0';
  local_b38[0x14] = '\0';
  local_b38[0x15] = '\0';
  local_b38[0x16] = '\0';
  local_b38[0x17] = '\0';
  local_b38[0x18] = '\0';
  local_b38[0x19] = '\0';
  local_b38[0x1a] = '\0';
  local_b38[0x1b] = '\0';
  local_b38[0x1c] = '\0';
  local_b38[0x1d] = '\0';
  local_b38[0x1e] = '\0';
  local_b38[0x1f] = '\0';
  local_b38[0x20] = '\0';
  local_b38[0x21] = '\0';
  local_b38[0x22] = '\0';
  local_b38[0x23] = '\0';
  local_b38[0x24] = '\0';
  local_b38[0x25] = '\0';
  local_b38[0x26] = '\0';
  local_b38[0x27] = '\0';
  local_b38[0x28] = '\0';
  local_b38[0x29] = '\0';
  local_b38[0x2a] = '\0';
  local_b38[0x2b] = '\0';
  local_b38[0x2c] = '\0';
  local_b38[0x2d] = '\0';
  local_b38[0x2e] = '\0';
  local_b38[0x2f] = '\0';
  local_b38[0x30] = '\0';
  local_b38[0x31] = '\0';
  local_b38[0x32] = '\0';
  local_b38[0x33] = '\0';
  local_b38[0x34] = '\0';
  local_b38[0x35] = '\0';
  local_b38[0x36] = '\0';
  local_b38[0x37] = '\0';
  local_b38[0x38] = '\0';
  local_b38[0x39] = '\0';
  local_b38[0x3a] = '\0';
  local_b38[0x3b] = '\0';
  local_b38[0x3c] = '\0';
  local_b38[0x3d] = '\0';
  local_b38[0x3e] = '\0';
  local_b38[0x3f] = 0;
  strcpy_s(local_b38 + 0x40,0x80,param_2);
  strcpy_s(&local_758,0x100,param_3);
  strcpy_s(local_b38,0x40,"127.0.0.1");
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320610 == 1000) {
LAB_1400139b3:
    printf("SEGA Auth Try : Account[ %s ] P[ %s ] IP[ %s ]\n");
  }
  else {
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if (DAT_140320610 == 0xcb) goto LAB_1400139b3;
  }
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  pcVar8 = (char *)&DAT_1403204b0;
  if (0xf < DAT_1403204c8) {
    pcVar8 = DAT_1403204b0;
  }
  strcpy_s(&local_548,0x104,pcVar8);
  strcpy_s(local_968,0x208,"service_id=FFFFFFFFFFFFFFFFFF");
  strcat_s(local_968,0x208,"&product_name=");
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  pcVar8 = (char *)&DAT_140320558;
  if (0xf < DAT_140320570) {
    pcVar8 = DAT_140320558;
  }
  strcat_s(local_968,0x208,pcVar8);
  strcat_s(local_968,0x208,"&original_id=");
  strcat_s(local_968,0x208,local_b38 + 0x40);
  strcat_s(local_968,0x208,"&original_password=");
  strcat_s(local_968,0x208,&local_758);
  strcpy_s(local_a78,0x104,"POST /cgi-bin/auth_rest_oem.cgi HTTP/1.1");
  strcat_s(local_a78,0x104,"Content-Type: application/x-www-form-urlencoded");
  strcat_s(local_a78,0x104,"User-Agent: Mozilla/4.0 (ISAO/1.00;Auth)");
  lVar4 = -1;
  pcVar8 = local_968;
  do {
    if (lVar4 == 0) break;
    lVar4 = lVar4 + -1;
    cVar1 = *pcVar8;
    pcVar8 = pcVar8 + 1;
  } while (cVar1 != '\0');
  sprintf(&local_658,"Content-Length: %d");
  strcat_s(local_a78,0x104,&local_658);
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320610 == 1000) {
LAB_140013bee:
    lVar4 = -1;
    pcVar8 = local_968;
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      cVar1 = *pcVar8;
      pcVar8 = pcVar8 + 1;
    } while (cVar1 != '\0');
    printf("SendXml : %s - Length [ %d ]\n");
    lVar4 = -1;
    pcVar8 = local_a78;
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      cVar1 = *pcVar8;
      pcVar8 = pcVar8 + 1;
    } while (cVar1 != '\0');
    printf("Header : %s - Length [ %d ]\n");
  }
  else {
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if (DAT_140320610 == 0xcb) goto LAB_140013bee;
  }
  uVar7 = DAT_140320f5c;
  local_b50 = 0xf;
  local_b58 = 0;
  local_b68 = 0;
  local_438 = 0;
  memset(local_437,0,0x3ff);
  iVar2 = 0x54;
  if (DAT_14031fec0 != 0) {
    curl_easy_setopt(DAT_14031fec0,0x2712,&local_548);
    curl_easy_setopt(DAT_14031fec0,0x271a,&local_438);
    curl_easy_setopt(DAT_14031fec0,0x2f,1);
    curl_easy_setopt(DAT_14031fec0,0x2d,0);
    curl_easy_setopt(DAT_14031fec0,0xd,0x1e);
    uVar5 = 0xffffffffffffffff;
    pcVar8 = local_968;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      cVar1 = *pcVar8;
      pcVar8 = pcVar8 + 1;
    } while (cVar1 != '\0');
    curl_easy_setopt(DAT_14031fec0,0x3c,~uVar5 - 1);
    lVar4 = curl_slist_append(0,local_a78);
    uVar7 = DAT_140320f5c;
    iVar2 = 0x54;
    if (lVar4 != 0) {
      curl_easy_setopt(DAT_14031fec0,0x2727,lVar4);
      curl_easy_setopt(DAT_14031fec0,0x271f,local_968);
      curl_easy_setopt(DAT_14031fec0,0x4e2b,FUN_1400108e0);
      curl_easy_setopt(DAT_14031fec0,0x2711,&local_b68);
      iVar2 = curl_easy_perform(DAT_14031fec0);
      lVar3 = FUN_1401e4420();
      if ((*(int *)(lVar3 + 0x250) == 1000) ||
         (lVar3 = FUN_1401e4420(), *(int *)(lVar3 + 0x250) == 0xcb)) {
        printf("curl_easy_perform Result : %d\n");
      }
      curl_slist_free_all(lVar4);
      uVar7 = DAT_140320f5c;
    }
  }
  if (iVar2 == 0) {
    puVar6 = &local_b68;
    if (0xf < local_b50) {
      puVar6 = (undefined1 *)CONCAT71(uStack_b67,local_b68);
    }
    FUN_140010930(puVar6);
    uVar7 = DAT_140320f5c;
  }
  if ((uVar7 & 1) == 0) {
    DAT_140320f5c = uVar7 | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
    uVar7 = DAT_140320f5c;
  }
  if (DAT_140320610 != 1000) {
    if ((uVar7 & 1) == 0) {
      DAT_140320f5c = uVar7 | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if (DAT_140320610 != 0xcb) goto LAB_140013e7f;
  }
  printf("Flag %d\n - Result : %s\n");
LAB_140013e7f:
  if (0xf < local_b50) {
    operator_delete((void *)CONCAT71(uStack_b67,local_b68));
  }
  local_b50 = 0xf;
  local_b58 = 0;
  local_b68 = 0;
  FUN_1400d1290(param_1);
  FUN_140070e40(&local_b98);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

undefined8
FUN_140013ee0(longlong param_1,undefined4 param_2,undefined8 param_3,longlong *param_4,
             longlong *param_5,longlong *param_6,longlong *param_7,longlong *param_8,char *param_9)

{
  int *piVar1;
  char cVar2;
  errno_t eVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  longlong *plVar10;
  char *pcVar11;
  longlong lVar12;
  longlong lVar13;
  undefined8 uVar14;
  longlong lVar15;
  ulonglong uVar16;
  undefined1 *puVar17;
  undefined *puVar18;
  undefined *puVar19;
  char *pcVar20;
  undefined **_Src;
  undefined1 auStack_e38 [32];
  undefined **local_e18;
  uint *local_e10;
  uint *local_e08;
  undefined1 *local_e00;
  undefined *local_df8;
  undefined *local_df0;
  undefined *local_de8;
  undefined1 local_dd8;
  undefined1 local_dd7 [7];
  undefined *local_dd0;
  undefined *local_dc8;
  undefined *local_dc0;
  undefined *local_db8;
  uint local_db0;
  uint local_dac;
  uint local_da8;
  uint local_da4;
  uint local_da0 [2];
  undefined8 local_d98;
  int local_d90;
  undefined8 local_d88;
  int local_d80;
  longlong local_d78;
  undefined4 local_d70;
  int local_d6c [3];
  undefined1 local_d60 [8];
  undefined4 local_d58 [2];
  longlong *local_d50;
  longlong *local_d48;
  longlong *local_d40;
  longlong local_d38;
  undefined1 local_d30;
  char *local_d28;
  DWORD local_d20;
  longlong local_d18;
  __time64_t local_d10;
  __time64_t local_d08 [3];
  undefined1 local_cf0;
  undefined8 local_ce8;
  undefined1 local_ce0;
  undefined8 local_cd8;
  undefined1 local_cd0;
  undefined8 local_cc8;
  undefined1 local_cc0;
  short local_cb8;
  short local_cb6;
  undefined2 local_cb4;
  short local_cb2;
  short local_cb0;
  short local_cae;
  short local_cac;
  undefined2 local_caa;
  short local_ca8;
  short local_ca6;
  undefined2 local_ca4;
  short local_ca2;
  short local_ca0;
  short local_c9e;
  short local_c9c;
  undefined2 local_c9a;
  char local_c98;
  undefined7 uStack_c97;
  undefined8 local_c88;
  ulonglong local_c80;
  undefined1 local_c70;
  undefined7 uStack_c6f;
  undefined8 local_c60;
  ulonglong local_c58;
  undefined8 local_c48;
  undefined8 local_c40;
  undefined8 local_c38;
  undefined8 local_c30;
  undefined1 local_c28;
  undefined7 uStack_c27;
  undefined8 local_c18;
  ulonglong local_c10;
  tm local_c00;
  tm local_bd8;
  undefined1 local_bb0 [8];
  ushort local_ba8;
  undefined1 local_ba0 [10];
  ushort local_b96;
  undefined1 local_b90 [10];
  ushort local_b86;
  undefined1 local_b80 [8];
  ushort local_b78;
  void *local_b70 [3];
  ulonglong local_b58;
  char local_b48 [64];
  undefined8 local_b08;
  char local_a88 [272];
  char local_978;
  undefined1 local_977 [255];
  char local_878 [528];
  char local_668;
  undefined1 local_667 [271];
  char local_558;
  undefined1 local_557 [271];
  undefined1 local_448;
  undefined1 local_447 [1023];
  ulonglong local_48;
  
  local_d08[1] = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_e38;
  local_d50 = param_6;
  local_d40 = param_7;
  local_d48 = param_8;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 != 0xcb) && (DAT_140320610 != 0x67)) {
    return 1;
  }
  local_d28 = "PG_AUTH_SEGA_TYPE";
  local_d18 = **(longlong **)(*(longlong *)(param_1 + 0x200) + 8) + 0x68;
  local_d20 = timeGetTime();
  lVar15 = param_1 + 0xe0;
  local_d38 = lVar15;
  FUN_1400a1c30(lVar15);
  local_d30 = 1;
  plVar10 = (longlong *)FUN_14000f1a0(param_1 + -8,&local_d78,param_2);
  lVar13 = 0;
  if ((longlong *)*plVar10 != (longlong *)0x0) {
    lVar13 = *(longlong *)*plVar10;
  }
  if ((local_d78 != 0) &&
     (*(longlong *)(local_d78 + 8) = *(longlong *)(local_d78 + 8) + -1, lVar15 = local_d38,
     *(longlong *)(local_d78 + 8) == 0)) {
    FUN_1400219e0();
    lVar15 = local_d38;
  }
  if (lVar13 == 0) {
    FUN_1400d1290(lVar15);
    goto LAB_1400155c1;
  }
  local_c80 = 0xf;
  local_c88 = 0;
  local_c98 = '\0';
  local_c58 = 0xf;
  local_c60 = 0;
  local_c70 = 0;
  if (*param_9 != '\0') {
    puVar18 = (undefined *)*param_4;
    if ((undefined *)*param_4 == (undefined *)0x0) {
      puVar18 = PTR_DAT_1402f8008;
    }
    puVar19 = (undefined *)*param_5;
    if ((undefined *)*param_5 == (undefined *)0x0) {
      puVar19 = PTR_DAT_1402f8008;
    }
    if (*(longlong *)(param_1 + 0x1e8) != 0) {
      local_e18 = (undefined **)&local_c70;
      cVar2 = FUN_14000dee0(param_1 + -8,puVar19,puVar18,&local_c98);
      if (cVar2 != '\0') goto LAB_1400141b0;
    }
    printf("Dec Failed : IV [ %s ] ENC [ %s ]\n");
    local_d6c[1] = 0x14;
    (**(code **)(*(longlong *)(param_1 + 0x58) + 0x70))
              ((longlong *)(param_1 + 0x58),param_2,&DAT_14030ab90,local_d6c + 1);
    if (0xf < local_c58) {
      operator_delete((void *)CONCAT71(uStack_c6f,local_c70));
    }
    local_c58 = 0xf;
    local_c60 = 0;
    local_c70 = 0;
    if (0xf < local_c80) {
      operator_delete((void *)CONCAT71(uStack_c97,local_c98));
    }
    local_c80 = 0xf;
    local_c88 = 0;
    local_c98 = '\0';
    FUN_1400d1290(lVar15);
    goto LAB_1400155c1;
  }
  pcVar11 = (char *)*param_4;
  if ((char *)*param_4 == (char *)0x0) {
    pcVar11 = PTR_DAT_1402f8008;
  }
  uVar16 = 0xffffffffffffffff;
  pcVar20 = pcVar11;
  do {
    if (uVar16 == 0) break;
    uVar16 = uVar16 - 1;
    cVar2 = *pcVar20;
    pcVar20 = pcVar20 + 1;
  } while (cVar2 != '\0');
  FUN_140003e60(&local_c98,pcVar11,~uVar16 - 1);
  pcVar11 = (char *)*param_5;
  if ((char *)*param_5 == (char *)0x0) {
    pcVar11 = PTR_DAT_1402f8008;
  }
  uVar16 = 0xffffffffffffffff;
  pcVar20 = pcVar11;
  do {
    if (uVar16 == 0) break;
    uVar16 = uVar16 - 1;
    cVar2 = *pcVar20;
    pcVar20 = pcVar20 + 1;
  } while (cVar2 != '\0');
  FUN_140003e60(&local_c70,pcVar11,~uVar16 - 1);
LAB_1400141b0:
  local_668 = '\0';
  memset(local_667,0,0x103);
  local_a88[0] = '\0';
  memset(local_a88 + 1,0,0x103);
  local_878[0] = '\0';
  memset(local_878 + 1,0,0x207);
  local_558 = '\0';
  memset(local_557,0,0x103);
  local_b08._0_1_ = '\0';
  memset((void *)((longlong)&local_b08 + 1),0,0x7f);
  local_978 = '\0';
  memset(local_977,0,0xff);
  local_b48[0] = '\0';
  local_b48[1] = '\0';
  local_b48[2] = '\0';
  local_b48[3] = '\0';
  local_b48[4] = '\0';
  local_b48[5] = '\0';
  local_b48[6] = '\0';
  local_b48[7] = '\0';
  local_b48[8] = '\0';
  local_b48[9] = '\0';
  local_b48[10] = '\0';
  local_b48[0xb] = '\0';
  local_b48[0xc] = '\0';
  local_b48[0xd] = '\0';
  local_b48[0xe] = '\0';
  local_b48[0xf] = '\0';
  local_b48[0x10] = '\0';
  local_b48[0x11] = '\0';
  local_b48[0x12] = '\0';
  local_b48[0x13] = '\0';
  local_b48[0x14] = '\0';
  local_b48[0x15] = '\0';
  local_b48[0x16] = '\0';
  local_b48[0x17] = '\0';
  local_b48[0x18] = '\0';
  local_b48[0x19] = '\0';
  local_b48[0x1a] = '\0';
  local_b48[0x1b] = '\0';
  local_b48[0x1c] = '\0';
  local_b48[0x1d] = '\0';
  local_b48[0x1e] = '\0';
  local_b48[0x1f] = '\0';
  local_b48[0x20] = '\0';
  local_b48[0x21] = '\0';
  local_b48[0x22] = '\0';
  local_b48[0x23] = '\0';
  local_b48[0x24] = '\0';
  local_b48[0x25] = '\0';
  local_b48[0x26] = '\0';
  local_b48[0x27] = '\0';
  local_b48[0x28] = '\0';
  local_b48[0x29] = '\0';
  local_b48[0x2a] = '\0';
  local_b48[0x2b] = '\0';
  local_b48[0x2c] = '\0';
  local_b48[0x2d] = '\0';
  local_b48[0x2e] = '\0';
  local_b48[0x2f] = '\0';
  local_b48[0x30] = '\0';
  local_b48[0x31] = '\0';
  local_b48[0x32] = '\0';
  local_b48[0x33] = '\0';
  local_b48[0x34] = '\0';
  local_b48[0x35] = '\0';
  local_b48[0x36] = '\0';
  local_b48[0x37] = '\0';
  local_b48[0x38] = '\0';
  local_b48[0x39] = '\0';
  local_b48[0x3a] = '\0';
  local_b48[0x3b] = '\0';
  local_b48[0x3c] = '\0';
  local_b48[0x3d] = '\0';
  local_b48[0x3e] = '\0';
  local_b48[0x3f] = 0;
  pcVar11 = &local_c98;
  if (0xf < local_c80) {
    pcVar11 = (char *)CONCAT71(uStack_c97,local_c98);
  }
  strncpy_s((char *)&local_b08,0x80,pcVar11,0x7f);
  _Src = (undefined **)&local_c70;
  if (0xf < local_c58) {
    _Src = (undefined **)CONCAT71(uStack_c6f,local_c70);
  }
  strncpy_s(&local_978,0x100,(char *)_Src,0xff);
  plVar10 = (longlong *)(lVar13 + 0x10);
  pcVar11 = (char *)FUN_1401e1690(local_b70,plVar10);
  if (0xf < *(ulonglong *)(pcVar11 + 0x18)) {
    pcVar11 = *(char **)pcVar11;
  }
  strcpy_s(local_b48,0x40,pcVar11);
  if (0xf < local_b58) {
    operator_delete(local_b70[0]);
  }
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320610 == 0xcb) {
    printf("SEGA Auth Try : Account[ %s ] P[ %s ] IP[ %s ]\n");
  }
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_1403205d6 == '\0') {
    lVar15 = FUN_1401e4420();
    pcVar11 = (char *)(lVar15 + 0xf0);
    if (0xf < *(ulonglong *)(lVar15 + 0x108)) {
      pcVar11 = *(char **)pcVar11;
    }
    strcpy_s(&local_668,0x104,pcVar11);
    strcpy_s(local_878,0x208,"service_id=FFFFFFFFFFFFFFFFFF");
    strcat_s(local_878,0x208,"&product_name=");
    lVar15 = FUN_1401e4420();
    pcVar11 = (char *)(lVar15 + 0x198);
    if (0xf < *(ulonglong *)(lVar15 + 0x1b0)) {
      pcVar11 = *(char **)pcVar11;
    }
    strcat_s(local_878,0x208,pcVar11);
    strcat_s(local_878,0x208,"&original_id=");
    strcat_s(local_878,0x208,(char *)&local_b08);
    strcat_s(local_878,0x208,"&original_password=");
    strcat_s(local_878,0x208,&local_978);
    strcpy_s(local_a88,0x104,"POST /cgi-bin/auth_rest_oem.cgi HTTP/1.1");
    strcat_s(local_a88,0x104,"Content-Type: application/x-www-form-urlencoded");
    strcat_s(local_a88,0x104,"User-Agent: Mozilla/4.0 (ISAO/1.00;Auth)");
    lVar15 = -1;
    pcVar11 = local_878;
    do {
      if (lVar15 == 0) break;
      lVar15 = lVar15 + -1;
      cVar2 = *pcVar11;
      pcVar11 = pcVar11 + 1;
    } while (cVar2 != '\0');
    sprintf(&local_558,"Content-Length: %d");
    strcat_s(local_a88,0x104,&local_558);
    lVar15 = FUN_1401e4420();
    if ((*(int *)(lVar15 + 0x250) == 1000) ||
       (lVar15 = FUN_1401e4420(), *(int *)(lVar15 + 0x250) == 0xcb)) {
      lVar15 = -1;
      pcVar11 = local_878;
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        cVar2 = *pcVar11;
        pcVar11 = pcVar11 + 1;
      } while (cVar2 != '\0');
      printf("SendXml : %s - Length [ %d ]\n");
      lVar15 = -1;
      pcVar11 = local_a88;
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        cVar2 = *pcVar11;
        pcVar11 = pcVar11 + 1;
      } while (cVar2 != '\0');
      printf("Header : %s - Length [ %d ]\n");
    }
    local_c10 = 0xf;
    local_c18 = 0;
    local_c28 = 0;
    iVar4 = 0x54;
    local_448 = 0;
    memset(local_447,0,0x3ff);
    if (DAT_14031fec0 != 0) {
      curl_easy_setopt(DAT_14031fec0,0x2712,&local_668);
      curl_easy_setopt(DAT_14031fec0,0x271a,&local_448);
      curl_easy_setopt(DAT_14031fec0,0x2f,1);
      curl_easy_setopt(DAT_14031fec0,0x2d,0);
      curl_easy_setopt(DAT_14031fec0,0xd,0x1e);
      lVar15 = -1;
      pcVar11 = local_878;
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        cVar2 = *pcVar11;
        pcVar11 = pcVar11 + 1;
      } while (cVar2 != '\0');
      curl_easy_setopt(DAT_14031fec0,0x3c);
      lVar15 = curl_slist_append(0,local_a88);
      if (lVar15 != 0) {
        curl_easy_setopt(DAT_14031fec0,0x2727,lVar15);
        curl_easy_setopt(DAT_14031fec0,0x271f,local_878);
        curl_easy_setopt(DAT_14031fec0,0x4e2b,FUN_1400108e0);
        curl_easy_setopt(DAT_14031fec0,0x2711);
        iVar4 = curl_easy_perform(DAT_14031fec0);
        lVar12 = FUN_1401e4420();
        if (*(int *)(lVar12 + 0x250) == 0xcb) {
          printf("curl_easy_perform Result : %d\n");
        }
        curl_slist_free_all(lVar15);
      }
    }
    local_db0 = 0xffffffff;
    if (iVar4 == 0) {
      puVar17 = &local_c28;
      if (0xf < local_c10) {
        puVar17 = (undefined1 *)CONCAT71(uStack_c27,local_c28);
      }
      local_db0 = FUN_140010930(puVar17);
      local_da8 = 0;
      local_dac = 0;
      lVar15 = FUN_140094270();
      if (*(char *)(lVar15 + 0x11) != '\0') {
        local_d10 = _time64((__time64_t *)0x0);
        local_d98 = 0;
        local_d90 = 0;
        eVar3 = _localtime64_s(&local_bd8,&local_d10);
        if (eVar3 == 0) {
          local_ca8 = (short)local_bd8.tm_year + 0x76c;
          local_ca6 = (short)local_bd8.tm_mon + 1;
          local_ca4 = (undefined2)local_bd8.tm_wday;
          local_ca2 = (short)local_bd8.tm_mday;
          local_ca0 = (short)local_bd8.tm_hour;
          local_c9e = (short)local_bd8.tm_min;
          local_c9c = (short)local_bd8.tm_sec;
          local_c9a = 0;
          iVar6 = Ordinal_184(&local_ca8,&local_d98);
          local_c38 = 0;
          local_c30 = 0;
          if ((((iVar6 == 0) || (iVar6 = Ordinal_185(local_d98,&local_c38), iVar6 == 0)) ||
              (local_ca8 != (short)local_c38)) ||
             (((local_ca6 != local_c38._2_2_ || (local_ca2 != local_c38._6_2_)) ||
              ((local_ca0 != (short)local_c30 ||
               ((local_c9e != local_c30._2_2_ || (local_c9c != local_c30._4_2_))))))))
          goto LAB_140014f87;
          local_d90 = 0;
          iVar6 = Ordinal_185(local_d98,local_bb0);
          if (iVar6 == 0) goto LAB_140014f8a;
          local_da8 = (uint)local_ba8;
        }
        else {
LAB_140014f87:
          local_d90 = 1;
LAB_140014f8a:
          local_da8 = 0xffffffff;
        }
        if ((local_d90 == 0) && (iVar6 = Ordinal_185(local_d98,local_ba0), iVar6 != 0)) {
          local_dac = (uint)local_b96;
        }
        else {
          local_dac = 0xffffffff;
        }
      }
      if (local_db0 != 0) goto LAB_1400152cd;
      local_d60._0_4_ = 1;
      *(undefined4 *)(lVar13 + 0x1fc) = 1;
      strncpy_s((char *)(lVar13 + 0x200),0x32,(char *)&local_b08,0x31);
      *(undefined1 *)(lVar13 + 0x231) = 0;
      strncpy_s((char *)(lVar13 + 0x232),0x100,&local_978,0x1f);
      *(undefined1 *)(lVar13 + 0x331) = 0;
      lVar15 = FUN_1401e4420();
      if (*(char *)(lVar15 + 0x218) == '\0') {
        *(undefined4 *)(lVar13 + 0x1e8) = 0;
        local_de8 = (undefined *)*local_d48;
        if ((undefined *)*local_d48 == (undefined *)0x0) {
          local_de8 = PTR_DAT_1402f8008;
        }
        local_df0 = (undefined *)*local_d40;
        if ((undefined *)*local_d40 == (undefined *)0x0) {
          local_df0 = PTR_DAT_1402f8008;
        }
        local_df8 = (undefined *)*local_d50;
        if ((undefined *)*local_d50 == (undefined *)0x0) {
          local_df8 = PTR_DAT_1402f8008;
        }
        if (7 < *(ulonglong *)(lVar13 + 0x28)) {
          plVar10 = (longlong *)*plVar10;
        }
        local_e00 = (undefined1 *)CONCAT44(local_e00._4_4_,1);
        local_e10 = (uint *)CONCAT44(local_e10._4_4_,*(undefined4 *)(DAT_140320138 + 0x140));
        local_e18 = (undefined **)&local_b08;
        local_e08 = (uint *)plVar10;
        (**(code **)(**(longlong **)(param_1 + 0x80) + 8))
                  (*(longlong **)(param_1 + 0x80),*(undefined4 *)(lVar13 + 0x1f0),
                   *(undefined4 *)(lVar13 + 0x1ec),param_2);
        lVar15 = FUN_140094270();
        local_dd7[0] = *(undefined1 *)(lVar15 + 0x11);
        FUN_1400a3440();
        local_dc8 = PTR_DAT_1402f8008;
        iVar9 = FUN_1400a3360(&local_b08);
        iVar5 = 0;
        iVar6 = iVar5;
        if ((local_dc8 != (undefined *)0x0) && (local_dc8 != PTR_DAT_1402f8008)) {
          iVar6 = *(int *)(local_dc8 + -8);
        }
        iVar8 = 0;
        iVar7 = iVar9;
        if (((iVar9 <= iVar6) && (iVar7 = iVar5, local_dc8 != (undefined *)0x0)) &&
           (iVar7 = iVar8, local_dc8 != PTR_DAT_1402f8008)) {
          iVar7 = *(int *)(local_dc8 + -8);
        }
        iVar6 = 1;
        if (1 < iVar7) {
          iVar6 = iVar7;
        }
        if ((local_dc8 != (undefined *)0x0) && (local_dc8 != PTR_DAT_1402f8008)) {
          iVar8 = *(int *)(local_dc8 + -8);
        }
        if (iVar8 < iVar6) {
          FUN_14000c1c0(&local_dc8);
        }
        FUN_14000c330(&local_dc8);
        puVar18 = local_dc8;
        if (local_dc8 == (undefined *)0x0) {
          puVar18 = PTR_DAT_1402f8008;
        }
        FUN_1400a3390(puVar18,&local_b08,iVar9);
        puVar18 = local_dc8;
        if (local_dc8 == (undefined *)0x0) {
          puVar18 = PTR_DAT_1402f8008;
        }
        iVar9 = FUN_1400a3360(puVar18);
        iVar6 = 0;
        if (0 < iVar9) {
          iVar6 = iVar9;
        }
        iVar9 = 0;
        if ((local_dc8 != (undefined *)0x0) && (iVar9 = 0, local_dc8 != PTR_DAT_1402f8008)) {
          iVar9 = *(int *)(local_dc8 + -8);
        }
        if ((iVar6 < iVar9) || (iVar6 = 0, local_dc8 == (undefined *)0x0)) {
LAB_1400151fd:
          if (((local_dc8 != PTR_DAT_1402f8008) && (local_dc8 != (undefined *)0x0)) &&
             (piVar1 = (int *)(local_dc8 + -8), piVar1 != (int *)0x0)) {
            *piVar1 = iVar6;
            *(undefined1 *)((longlong)iVar6 + 8 + (longlong)piVar1) = 0;
          }
        }
        else if (local_dc8 != PTR_DAT_1402f8008) {
          iVar6 = *(int *)(local_dc8 + -8);
          goto LAB_1400151fd;
        }
        local_e00 = local_dd7;
        local_e08 = &local_dac;
        local_e10 = &local_da8;
        local_e18 = (undefined **)local_d60;
        (**(code **)(*(longlong *)(param_1 + 0x58) + 0x200))
                  ((longlong *)(param_1 + 0x58),param_2,&DAT_14030ab90,&local_dc8);
        puVar18 = local_dc8;
        if (((local_dc8 != (undefined *)0x0) && (local_dc8 != PTR_DAT_1402f8008)) &&
           (puVar19 = local_dc8 + -8, puVar19 != (undefined *)0x0)) {
          uVar14 = FUN_1400a3440();
          local_ce8 = uVar14;
          FUN_1400a1c30(uVar14);
          local_ce0 = 1;
          piVar1 = (int *)(puVar18 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(puVar19);
          }
          FUN_1400d1290(uVar14);
        }
      }
      else {
        local_e10 = (uint *)CONCAT44(local_e10._4_4_,*(undefined4 *)(DAT_140320138 + 0x140));
        local_e18 = (undefined **)&local_b08;
        (**(code **)**(undefined8 **)(param_1 + 0x80))
                  (*(undefined8 **)(param_1 + 0x80),*(undefined4 *)(lVar13 + 0x1f0),
                   *(undefined4 *)(lVar13 + 0x1ec),param_2);
      }
    }
    else {
      lVar15 = FUN_1401e4420();
      if (*(int *)(lVar15 + 0x250) == 0xcb) {
        printf("curl_easy_perform Error : %s\n");
      }
LAB_1400152cd:
      *(int *)(lVar13 + 0x1e8) = *(int *)(lVar13 + 0x1e8) + 1;
    }
    if (2 < *(int *)(lVar13 + 0x1e8)) {
      local_d58[0] = 0x13;
      (**(code **)(*(longlong *)(param_1 + 0x58) + 0x70))
                ((longlong *)(param_1 + 0x58),param_2,&DAT_14030ab90,local_d58);
      if (0xf < local_c10) {
        operator_delete((void *)CONCAT71(uStack_c27,local_c28));
      }
      local_c10 = 0xf;
      local_c18 = 0;
      local_c28 = 0;
      if (0xf < local_c58) {
        operator_delete((void *)CONCAT71(uStack_c6f,local_c70));
      }
      local_c58 = 0xf;
      local_c60 = 0;
      local_c70 = 0;
      if (0xf < local_c80) {
        operator_delete((void *)CONCAT71(uStack_c97,local_c98));
      }
      local_c80 = 0xf;
      local_c88 = 0;
      local_c98 = '\0';
      FUN_1400d1290(local_d38);
      goto LAB_1400155c1;
    }
    puVar18 = (&PTR_s_CURLE_OK_140312850)[iVar4];
    FUN_1400a3440();
    local_db8 = PTR_DAT_1402f8008;
    iVar9 = FUN_1400a3360(puVar18);
    iVar5 = 0;
    iVar6 = iVar5;
    if ((local_db8 != (undefined *)0x0) && (local_db8 != PTR_DAT_1402f8008)) {
      iVar6 = *(int *)(local_db8 + -8);
    }
    iVar7 = iVar9;
    if (((iVar9 <= iVar6) && (iVar7 = iVar5, local_db8 != (undefined *)0x0)) &&
       (local_db8 != PTR_DAT_1402f8008)) {
      iVar7 = *(int *)(local_db8 + -8);
    }
    iVar6 = 1;
    if (1 < iVar7) {
      iVar6 = iVar7;
    }
    iVar5 = 0;
    if ((local_db8 != (undefined *)0x0) && (local_db8 != PTR_DAT_1402f8008)) {
      iVar5 = *(int *)(local_db8 + -8);
    }
    if (iVar5 < iVar6) {
      FUN_14000c1c0(&local_db8,iVar6);
    }
    FUN_14000c330(&local_db8);
    puVar19 = local_db8;
    if (local_db8 == (undefined *)0x0) {
      puVar19 = PTR_DAT_1402f8008;
    }
    FUN_1400a3390(puVar19,puVar18,iVar9);
    puVar18 = local_db8;
    if (local_db8 == (undefined *)0x0) {
      puVar18 = PTR_DAT_1402f8008;
    }
    iVar9 = FUN_1400a3360(puVar18);
    iVar6 = 0;
    if (0 < iVar9) {
      iVar6 = iVar9;
    }
    iVar9 = 0;
    if ((local_db8 != (undefined *)0x0) && (iVar9 = 0, local_db8 != PTR_DAT_1402f8008)) {
      iVar9 = *(int *)(local_db8 + -8);
    }
    if ((iVar6 < iVar9) || (iVar6 = 0, local_db8 == (undefined *)0x0)) {
LAB_14001548e:
      if (((local_db8 != PTR_DAT_1402f8008) && (local_db8 != (undefined *)0x0)) &&
         (piVar1 = (int *)(local_db8 + -8), piVar1 != (int *)0x0)) {
        *piVar1 = iVar6;
        *(undefined1 *)((longlong)iVar6 + 8 + (longlong)piVar1) = 0;
      }
    }
    else if (local_db8 != PTR_DAT_1402f8008) {
      iVar6 = *(int *)(local_db8 + -8);
      goto LAB_14001548e;
    }
    local_e10 = &local_db0;
    local_e18 = &local_db8;
    local_d6c[0] = iVar4;
    (**(code **)(*(longlong *)(param_1 + 0x58) + 0x240))
              ((longlong *)(param_1 + 0x58),param_2,&DAT_14030ad10,local_d6c);
    puVar18 = local_db8;
    if (((local_db8 != (undefined *)0x0) && (local_db8 != PTR_DAT_1402f8008)) &&
       (puVar19 = local_db8 + -8, puVar19 != (undefined *)0x0)) {
      uVar14 = FUN_1400a3440();
      local_cc8 = uVar14;
      FUN_1400a1c30(uVar14);
      local_cc0 = 1;
      piVar1 = (int *)(puVar18 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar19);
      }
      FUN_1400d1290(uVar14);
    }
    if (0xf < local_c10) {
      operator_delete((void *)CONCAT71(uStack_c27,local_c28));
    }
    local_c10 = 0xf;
    local_c18 = 0;
    local_c28 = 0;
    if (0xf < local_c58) {
      operator_delete((void *)CONCAT71(uStack_c6f,local_c70));
    }
    local_c58 = 0xf;
    local_c60 = 0;
    local_c70 = 0;
    if (0xf < local_c80) {
      operator_delete((void *)CONCAT71(uStack_c97,local_c98));
    }
    local_c80 = 0xf;
    local_c88 = 0;
    local_c98 = '\0';
    FUN_1400d1290(local_d38);
    goto LAB_1400155c1;
  }
  local_da4 = 0;
  local_da0[0] = 0;
  lVar12 = FUN_140094270();
  if (*(char *)(lVar12 + 0x11) != '\0') {
    local_d08[0] = _time64((__time64_t *)0x0);
    local_d88 = 0;
    local_d80 = 0;
    eVar3 = _localtime64_s(&local_c00,local_d08);
    if (eVar3 == 0) {
      local_cb8 = (short)local_c00.tm_year + 0x76c;
      local_cb6 = (short)local_c00.tm_mon + 1;
      local_cb4 = (undefined2)local_c00.tm_wday;
      local_cb2 = (short)local_c00.tm_mday;
      local_cb0 = (short)local_c00.tm_hour;
      local_cae = (short)local_c00.tm_min;
      local_cac = (short)local_c00.tm_sec;
      local_caa = 0;
      iVar4 = Ordinal_184(&local_cb8,&local_d88);
      local_c48 = 0;
      local_c40 = 0;
      if (((iVar4 == 0) || (iVar4 = Ordinal_185(local_d88,&local_c48), iVar4 == 0)) ||
         ((local_cb8 != (short)local_c48 ||
          ((((local_cb6 != local_c48._2_2_ || (local_cb2 != local_c48._6_2_)) ||
            (local_cb0 != (short)local_c40)) ||
           ((local_cae != local_c40._2_2_ || (local_cac != local_c40._4_2_))))))))
      goto LAB_140014552;
      local_d80 = 0;
      iVar4 = Ordinal_185(local_d88,local_b80);
      if (iVar4 == 0) goto LAB_140014555;
      local_da4 = (uint)local_b78;
    }
    else {
LAB_140014552:
      local_d80 = 1;
LAB_140014555:
      local_da4 = 0xffffffff;
    }
    if ((local_d80 == 0) && (iVar4 = Ordinal_185(local_d88,local_b90), iVar4 != 0)) {
      local_da0[0] = (uint)local_b86;
    }
    else {
      local_da0[0] = 0xffffffff;
    }
  }
  local_d60._4_4_ = 1;
  *(undefined4 *)(lVar13 + 0x1fc) = 1;
  strncpy_s((char *)(lVar13 + 0x200),0x32,(char *)&local_b08,0x31);
  *(undefined1 *)(lVar13 + 0x231) = 0;
  strncpy_s((char *)(lVar13 + 0x232),0x100,&local_978,0x1f);
  *(undefined1 *)(lVar13 + 0x331) = 0;
  lVar12 = FUN_1401e4420();
  if (*(char *)(lVar12 + 0x218) == '\0') {
    *(undefined4 *)(lVar13 + 0x1e8) = 0;
    local_de8 = (undefined *)*local_d48;
    if ((undefined *)*local_d48 == (undefined *)0x0) {
      local_de8 = PTR_DAT_1402f8008;
    }
    local_df0 = (undefined *)*local_d40;
    if ((undefined *)*local_d40 == (undefined *)0x0) {
      local_df0 = PTR_DAT_1402f8008;
    }
    local_df8 = (undefined *)*local_d50;
    if ((undefined *)*local_d50 == (undefined *)0x0) {
      local_df8 = PTR_DAT_1402f8008;
    }
    if (7 < *(ulonglong *)(lVar13 + 0x28)) {
      plVar10 = (longlong *)*plVar10;
    }
    local_e00 = (undefined1 *)CONCAT44(local_e00._4_4_,1);
    local_e10 = (uint *)CONCAT44(local_e10._4_4_,*(undefined4 *)(DAT_140320138 + 0x140));
    local_e18 = (undefined **)&local_b08;
    local_e08 = (uint *)plVar10;
    (**(code **)(**(longlong **)(param_1 + 0x80) + 8))
              (*(longlong **)(param_1 + 0x80),*(undefined4 *)(lVar13 + 0x1f0),
               *(undefined4 *)(lVar13 + 0x1ec),param_2);
    lVar13 = FUN_140094270();
    local_dd8 = *(undefined1 *)(lVar13 + 0x11);
    FUN_1400a3440();
    local_dd0 = PTR_DAT_1402f8008;
    iVar6 = FUN_1400a3360(&local_b08);
    iVar9 = 0;
    iVar4 = iVar9;
    if ((local_dd0 != (undefined *)0x0) && (local_dd0 != PTR_DAT_1402f8008)) {
      iVar4 = *(int *)(local_dd0 + -8);
    }
    iVar7 = 0;
    iVar5 = iVar6;
    if (((iVar6 <= iVar4) && (iVar5 = iVar9, local_dd0 != (undefined *)0x0)) &&
       (iVar5 = iVar7, local_dd0 != PTR_DAT_1402f8008)) {
      iVar5 = *(int *)(local_dd0 + -8);
    }
    iVar4 = 1;
    if (1 < iVar5) {
      iVar4 = iVar5;
    }
    iVar9 = iVar7;
    if ((local_dd0 != (undefined *)0x0) && (local_dd0 != PTR_DAT_1402f8008)) {
      iVar9 = *(int *)(local_dd0 + -8);
    }
    if (iVar9 < iVar4) {
      FUN_14000c1c0(&local_dd0);
    }
    FUN_14000c330(&local_dd0);
    puVar18 = local_dd0;
    if (local_dd0 == (undefined *)0x0) {
      puVar18 = PTR_DAT_1402f8008;
    }
    FUN_1400a3390(puVar18,&local_b08,iVar6);
    puVar18 = local_dd0;
    if (local_dd0 == (undefined *)0x0) {
      puVar18 = PTR_DAT_1402f8008;
    }
    iVar6 = FUN_1400a3360(puVar18);
    iVar4 = 0;
    if (0 < iVar6) {
      iVar4 = iVar6;
    }
    iVar6 = iVar7;
    if ((local_dd0 != (undefined *)0x0) && (local_dd0 != PTR_DAT_1402f8008)) {
      iVar6 = *(int *)(local_dd0 + -8);
    }
    if ((iVar4 < iVar6) || (iVar4 = iVar7, local_dd0 == (undefined *)0x0)) {
LAB_1400147bc:
      if (((local_dd0 != PTR_DAT_1402f8008) && (local_dd0 != (undefined *)0x0)) &&
         (piVar1 = (int *)(local_dd0 + -8), piVar1 != (int *)0x0)) {
        *piVar1 = iVar4;
        *(undefined1 *)((longlong)iVar4 + 8 + (longlong)piVar1) = 0;
      }
    }
    else if (local_dd0 != PTR_DAT_1402f8008) {
      iVar4 = *(int *)(local_dd0 + -8);
      goto LAB_1400147bc;
    }
    local_e00 = &local_dd8;
    local_e08 = local_da0;
    local_e10 = &local_da4;
    local_e18 = (undefined **)(local_d60 + 4);
    (**(code **)(*(longlong *)(param_1 + 0x58) + 0x200))
              ((longlong *)(param_1 + 0x58),param_2,&DAT_14030ab90,&local_dd0);
    puVar18 = local_dd0;
    if (((local_dd0 != (undefined *)0x0) && (local_dd0 != PTR_DAT_1402f8008)) &&
       (puVar19 = local_dd0 + -8, puVar19 != (undefined *)0x0)) {
      uVar14 = FUN_1400a3440();
      local_cd8 = uVar14;
      FUN_1400a1c30(uVar14);
      local_cd0 = 1;
      piVar1 = (int *)(puVar18 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar19);
      }
      FUN_1400d1290(uVar14);
    }
  }
  else {
    local_e10 = (uint *)CONCAT44(local_e10._4_4_,*(undefined4 *)(DAT_140320138 + 0x140));
    local_e18 = (undefined **)&local_b08;
    (**(code **)**(undefined8 **)(param_1 + 0x80))
              (*(undefined8 **)(param_1 + 0x80),*(undefined4 *)(lVar13 + 0x1f0),
               *(undefined4 *)(lVar13 + 0x1ec),param_2);
  }
  iVar9 = 0;
  local_d6c[2] = 0;
  FUN_1400a3440();
  local_dc0 = PTR_DAT_1402f8008;
  iVar6 = FUN_1400a3360("AUTH_SKIP");
  iVar4 = iVar9;
  if ((local_dc0 != (undefined *)0x0) && (local_dc0 != PTR_DAT_1402f8008)) {
    iVar4 = *(int *)(local_dc0 + -8);
  }
  iVar5 = iVar6;
  if (((iVar6 <= iVar4) && (iVar5 = iVar9, local_dc0 != (undefined *)0x0)) &&
     (local_dc0 != PTR_DAT_1402f8008)) {
    iVar5 = *(int *)(local_dc0 + -8);
  }
  iVar4 = 1;
  if (1 < iVar5) {
    iVar4 = iVar5;
  }
  iVar5 = iVar9;
  if ((local_dc0 != (undefined *)0x0) && (local_dc0 != PTR_DAT_1402f8008)) {
    iVar5 = *(int *)(local_dc0 + -8);
  }
  if (iVar5 < iVar4) {
    FUN_14000c1c0(&local_dc0,iVar4);
  }
  FUN_14000c330(&local_dc0);
  puVar18 = local_dc0;
  if (local_dc0 == (undefined *)0x0) {
    puVar18 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar18,"AUTH_SKIP",iVar6);
  puVar18 = local_dc0;
  if (local_dc0 == (undefined *)0x0) {
    puVar18 = PTR_DAT_1402f8008;
  }
  iVar6 = FUN_1400a3360(puVar18);
  iVar4 = 0;
  if (0 < iVar6) {
    iVar4 = iVar6;
  }
  iVar6 = iVar9;
  if ((local_dc0 != (undefined *)0x0) && (local_dc0 != PTR_DAT_1402f8008)) {
    iVar6 = *(int *)(local_dc0 + -8);
  }
  if ((iVar4 < iVar6) || (iVar4 = iVar9, local_dc0 == (undefined *)0x0)) {
LAB_140014954:
    if (((local_dc0 != PTR_DAT_1402f8008) && (local_dc0 != (undefined *)0x0)) &&
       (piVar1 = (int *)(local_dc0 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar4;
      *(undefined1 *)((longlong)iVar4 + 8 + (longlong)piVar1) = 0;
    }
  }
  else if (local_dc0 != PTR_DAT_1402f8008) {
    iVar4 = *(int *)(local_dc0 + -8);
    goto LAB_140014954;
  }
  local_d70 = 0;
  local_e10 = (uint *)(local_d6c + 2);
  local_e18 = &local_dc0;
  (**(code **)(*(longlong *)(param_1 + 0x58) + 0x240))
            ((longlong *)(param_1 + 0x58),param_2,&DAT_14030ad10,&local_d70);
  puVar18 = local_dc0;
  if (((local_dc0 != (undefined *)0x0) && (local_dc0 != PTR_DAT_1402f8008)) &&
     (puVar19 = local_dc0 + -8, puVar19 != (undefined *)0x0)) {
    uVar14 = FUN_1400a3440();
    local_d08[2] = uVar14;
    FUN_1400a1c30(uVar14);
    local_cf0 = 1;
    piVar1 = (int *)(puVar18 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar19);
    }
    FUN_1400d1290(uVar14);
  }
  if (0xf < local_c58) {
    operator_delete((void *)CONCAT71(uStack_c6f,local_c70));
  }
  local_c58 = 0xf;
  local_c60 = 0;
  local_c70 = 0;
  if (0xf < local_c80) {
    operator_delete((void *)CONCAT71(uStack_c97,local_c98));
  }
  local_c80 = 0xf;
  local_c88 = 0;
  local_c98 = '\0';
  FUN_1400d1290(lVar15);
LAB_1400155c1:
  FUN_140070e40(&local_d28);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_140015600(longlong param_1,undefined4 param_2,undefined8 param_3,longlong *param_4,
             longlong *param_5,undefined8 *param_6)

{
  undefined4 uVar1;
  char cVar2;
  longlong *plVar3;
  char *pcVar4;
  char *pcVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  undefined *puVar8;
  longlong lVar9;
  longlong lVar10;
  undefined1 *puVar11;
  undefined *puVar12;
  undefined1 auStack_208 [32];
  char *local_1e8;
  undefined4 local_1d8;
  undefined4 local_1d4;
  longlong local_1d0;
  char *local_1c8;
  DWORD local_1c0;
  longlong local_1b8;
  longlong local_1b0;
  undefined1 local_1a8;
  undefined8 *local_1a0;
  undefined8 local_198;
  undefined1 local_190 [32];
  undefined1 local_170;
  undefined7 uStack_16f;
  longlong local_160;
  ulonglong local_158;
  undefined1 local_148;
  undefined7 uStack_147;
  undefined8 local_138;
  ulonglong local_130;
  undefined1 local_120;
  undefined7 uStack_11f;
  undefined8 local_110;
  ulonglong local_108;
  undefined2 local_f8;
  undefined6 uStack_f6;
  undefined2 uStack_f0;
  undefined6 uStack_ee;
  undefined2 uStack_e8;
  undefined6 local_e6;
  undefined2 uStack_e0;
  undefined6 local_de;
  undefined2 uStack_d8;
  undefined6 local_d6;
  undefined2 uStack_d0;
  undefined6 local_ce;
  undefined1 uStack_c8;
  undefined1 uStack_c7;
  undefined2 local_c0;
  undefined6 uStack_be;
  undefined2 uStack_b8;
  undefined6 uStack_b6;
  undefined2 uStack_b0;
  undefined6 local_ae;
  undefined2 uStack_a8;
  undefined6 local_a6;
  undefined2 uStack_a0;
  undefined6 local_9e;
  undefined2 uStack_98;
  undefined6 local_96;
  undefined1 uStack_90;
  undefined1 uStack_8f;
  char local_88 [64];
  ulonglong local_48;
  
  local_198 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_208;
  local_1a0 = param_6;
  local_1d4 = param_2;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 != 0xca) && (DAT_140320610 != 0x66)) {
    return 1;
  }
  local_1c8 = "PG_AUTH_WAYI_TYPE";
  local_1b8 = **(longlong **)(*(longlong *)(param_1 + 0x200) + 8) + 0x68;
  local_1c0 = timeGetTime();
  lVar9 = param_1 + 0xe0;
  local_1b0 = lVar9;
  FUN_1400a1c30(lVar9);
  local_1a8 = 1;
  plVar3 = (longlong *)FUN_14000f1a0(param_1 + -8,&local_1d0,param_2);
  lVar10 = 0;
  if ((longlong *)*plVar3 != (longlong *)0x0) {
    lVar10 = *(longlong *)*plVar3;
  }
  if ((local_1d0 != 0) &&
     (*(longlong *)(local_1d0 + 8) = *(longlong *)(local_1d0 + 8) + -1, lVar9 = local_1b0,
     *(longlong *)(local_1d0 + 8) == 0)) {
    FUN_1400219e0(local_1d0);
    lVar9 = local_1b0;
  }
  if (lVar10 == 0) {
    FUN_1400d1290(lVar9);
    goto LAB_140015b7c;
  }
  local_88[0] = '\0';
  local_88[1] = '\0';
  local_88[2] = '\0';
  local_88[3] = '\0';
  local_88[4] = '\0';
  local_88[5] = '\0';
  local_88[6] = '\0';
  local_88[7] = '\0';
  local_88[8] = '\0';
  local_88[9] = '\0';
  local_88[10] = '\0';
  local_88[0xb] = '\0';
  local_88[0xc] = '\0';
  local_88[0xd] = '\0';
  local_88[0xe] = '\0';
  local_88[0xf] = '\0';
  local_88[0x10] = '\0';
  local_88[0x11] = '\0';
  local_88[0x12] = '\0';
  local_88[0x13] = '\0';
  local_88[0x14] = '\0';
  local_88[0x15] = '\0';
  local_88[0x16] = '\0';
  local_88[0x17] = '\0';
  local_88[0x18] = '\0';
  local_88[0x19] = '\0';
  local_88[0x1a] = '\0';
  local_88[0x1b] = '\0';
  local_88[0x1c] = '\0';
  local_88[0x1d] = '\0';
  local_88[0x1e] = '\0';
  local_88[0x1f] = '\0';
  local_88[0x20] = '\0';
  local_88[0x21] = '\0';
  local_88[0x22] = '\0';
  local_88[0x23] = '\0';
  local_88[0x24] = '\0';
  local_88[0x25] = '\0';
  local_88[0x26] = '\0';
  local_88[0x27] = '\0';
  local_88[0x28] = '\0';
  local_88[0x29] = '\0';
  local_88[0x2a] = '\0';
  local_88[0x2b] = '\0';
  local_88[0x2c] = '\0';
  local_88[0x2d] = '\0';
  local_88[0x2e] = '\0';
  local_88[0x2f] = '\0';
  local_88[0x30] = '\0';
  local_88[0x31] = '\0';
  local_88[0x32] = '\0';
  local_88[0x33] = '\0';
  local_88[0x34] = '\0';
  local_88[0x35] = '\0';
  local_88[0x36] = '\0';
  local_88[0x37] = '\0';
  local_88[0x38] = '\0';
  local_88[0x39] = '\0';
  local_88[0x3a] = '\0';
  local_88[0x3b] = '\0';
  local_88[0x3c] = '\0';
  local_88[0x3d] = '\0';
  local_88[0x3e] = '\0';
  local_88[0x3f] = 0;
  pcVar4 = (char *)FUN_1401e1690(&local_120,lVar10 + 0x10);
  if (0xf < *(ulonglong *)(pcVar4 + 0x18)) {
    pcVar4 = *(char **)pcVar4;
  }
  strcpy_s(local_88,0x40,pcVar4);
  if (0xf < local_108) {
    operator_delete((void *)CONCAT71(uStack_11f,local_120));
  }
  local_108 = 0xf;
  local_110 = 0;
  local_120 = 0;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320610 == 0xca) {
    printf("WAYI Auth Try : Account[ %s ] P[ %s ] IP[ %s ]\n");
  }
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_1403205d6 != '\0') {
    puVar6 = (undefined8 *)*param_4;
    if ((undefined8 *)*param_4 == (undefined8 *)0x0) {
      puVar6 = (undefined8 *)PTR_DAT_1402f8008;
    }
    local_c0 = (undefined2)*puVar6;
    uStack_be = (undefined6)((ulonglong)*puVar6 >> 0x10);
    uStack_b8 = (undefined2)puVar6[1];
    uStack_b6 = (undefined6)((ulonglong)puVar6[1] >> 0x10);
    uStack_b0 = (undefined2)puVar6[2];
    local_ae = (undefined6)((ulonglong)puVar6[2] >> 0x10);
    uStack_a8 = (undefined2)puVar6[3];
    local_a6 = (undefined6)((ulonglong)puVar6[3] >> 0x10);
    uStack_a0 = (undefined2)puVar6[4];
    local_9e = (undefined6)((ulonglong)puVar6[4] >> 0x10);
    uStack_98 = (undefined2)puVar6[5];
    local_96 = (undefined6)((ulonglong)puVar6[5] >> 0x10);
    uStack_90 = (undefined1)*(undefined2 *)(puVar6 + 6);
    uStack_8f = 0;
    strncpy_s((char *)(lVar10 + 0x200),0x32,(char *)&local_c0,0x31);
    *(undefined1 *)(lVar10 + 0x231) = 0;
    FUN_14001b800(param_1 + -8,lVar10);
    FUN_1400d1290(lVar9);
    goto LAB_140015b7c;
  }
  puVar6 = (undefined8 *)*param_4;
  if ((undefined8 *)*param_4 == (undefined8 *)0x0) {
    puVar6 = (undefined8 *)PTR_DAT_1402f8008;
  }
  local_f8 = (undefined2)*puVar6;
  uStack_f6 = (undefined6)((ulonglong)*puVar6 >> 0x10);
  uStack_f0 = (undefined2)puVar6[1];
  uStack_ee = (undefined6)((ulonglong)puVar6[1] >> 0x10);
  uStack_e8 = (undefined2)puVar6[2];
  local_e6 = (undefined6)((ulonglong)puVar6[2] >> 0x10);
  uStack_e0 = (undefined2)puVar6[3];
  local_de = (undefined6)((ulonglong)puVar6[3] >> 0x10);
  uStack_d8 = (undefined2)puVar6[4];
  local_d6 = (undefined6)((ulonglong)puVar6[4] >> 0x10);
  uStack_d0 = (undefined2)puVar6[5];
  local_ce = (undefined6)((ulonglong)puVar6[5] >> 0x10);
  uStack_c8 = (undefined1)*(undefined2 *)(puVar6 + 6);
  uStack_c7 = 0;
  strncpy_s((char *)(lVar10 + 0x200),0x32,(char *)&local_f8,0x31);
  *(undefined1 *)(lVar10 + 0x231) = 0;
  pcVar4 = (char *)*local_1a0;
  if ((char *)*local_1a0 == (char *)0x0) {
    pcVar4 = PTR_DAT_1402f8008;
  }
  local_158 = 0xf;
  local_160 = 0;
  local_170 = 0;
  uVar7 = 0xffffffffffffffff;
  pcVar5 = pcVar4;
  do {
    if (uVar7 == 0) break;
    uVar7 = uVar7 - 1;
    cVar2 = *pcVar5;
    pcVar5 = pcVar5 + 1;
  } while (cVar2 != '\0');
  FUN_140003e60(&local_170,pcVar4,~uVar7 - 1);
  if (local_160 == 0) {
LAB_140015aad:
    uVar1 = local_1d4;
    puVar12 = (undefined *)*param_5;
    if ((undefined *)*param_5 == (undefined *)0x0) {
      puVar12 = PTR_DAT_1402f8008;
    }
    puVar8 = (undefined *)*param_4;
    if ((undefined *)*param_4 == (undefined *)0x0) {
      puVar8 = PTR_DAT_1402f8008;
    }
    local_1e8 = local_88;
    cVar2 = FUN_140024570(*(undefined8 *)(param_1 + 0x220),puVar8,local_1d4,puVar12);
    if (cVar2 == '\0') {
      printf("WAYI Auth SendError : Account[ %s ] P[ %s ] IP[ %s ]\n");
      local_1d8 = 0;
      (**(code **)(*(longlong *)(param_1 + 0x58) + 0x70))
                ((longlong *)(param_1 + 0x58),uVar1,&DAT_14030ab90,&local_1d8);
      if (0xf < local_158) {
        operator_delete((void *)CONCAT71(uStack_16f,local_170));
      }
      local_158 = 0xf;
      local_160 = 0;
      local_170 = 0;
      FUN_1400d1290(lVar9);
      goto LAB_140015b7c;
    }
  }
  else {
    local_130 = 0xf;
    local_138 = 0;
    local_148 = 0;
    puVar11 = &local_170;
    if (0xf < local_158) {
      puVar11 = (undefined1 *)CONCAT71(uStack_16f,local_170);
    }
    if (*(longlong *)(param_1 + 0x1e8) != 0) {
      FUN_1400af0d0(local_190);
      FUN_1400ae8f0(*(undefined8 *)(param_1 + 0x1e8),puVar11,local_190);
      pcVar5 = (char *)FUN_1400af210();
      uVar7 = 0xffffffffffffffff;
      pcVar4 = pcVar5;
      do {
        if (uVar7 == 0) break;
        uVar7 = uVar7 - 1;
        cVar2 = *pcVar4;
        pcVar4 = pcVar4 + 1;
      } while (cVar2 != '\0');
      FUN_140003e60(&local_148,pcVar5,~uVar7 - 1);
      FUN_1400af160(local_190);
    }
    cVar2 = FUN_14000dd90(&local_f8,&local_148);
    if (cVar2 == '\0') {
      if (0xf < local_130) {
        operator_delete((void *)CONCAT71(uStack_147,local_148));
      }
      local_130 = 0xf;
      local_138 = 0;
      local_148 = 0;
      goto LAB_140015aad;
    }
    FUN_14001b800(param_1 + -8,lVar10);
    if (0xf < local_130) {
      operator_delete((void *)CONCAT71(uStack_147,local_148));
    }
  }
  if (0xf < local_158) {
    operator_delete((void *)CONCAT71(uStack_16f,local_170));
  }
  local_158 = 0xf;
  local_160 = 0;
  local_170 = 0;
  FUN_1400d1290(lVar9);
LAB_140015b7c:
  FUN_140070e40(&local_1c8);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

undefined8
FUN_140015bc0(longlong param_1,undefined4 param_2,undefined8 param_3,longlong *param_4,
             undefined8 param_5,char *param_6,undefined8 *param_7)

{
  int *piVar1;
  undefined *puVar2;
  char cVar3;
  short sVar4;
  uint uVar5;
  errno_t eVar6;
  int iVar7;
  uint uVar8;
  uint uVar9;
  int iVar10;
  int iVar11;
  longlong *plVar12;
  char *pcVar13;
  longlong lVar14;
  longlong lVar15;
  undefined8 uVar16;
  undefined8 *puVar17;
  ulonglong uVar18;
  undefined2 *puVar19;
  undefined *puVar20;
  int iVar21;
  longlong *plVar22;
  char *pcVar23;
  short *psVar24;
  longlong lVar25;
  undefined1 auStack_408 [32];
  uint *local_3e8;
  uint *local_3e0;
  uint *local_3d8;
  undefined1 *local_3d0;
  undefined8 local_3c8;
  undefined8 local_3c0;
  undefined8 local_3b8;
  undefined1 local_3a8;
  undefined1 local_3a7 [7];
  undefined *local_3a0;
  undefined *local_398;
  uint local_390;
  uint local_38c;
  uint local_388;
  uint local_384;
  int local_380 [2];
  undefined8 local_378;
  int local_370;
  undefined8 local_368;
  int local_360;
  uint local_358 [2];
  longlong local_350;
  uint local_348 [2];
  longlong local_340;
  undefined4 local_338 [2];
  __time64_t local_330;
  char *local_328;
  DWORD local_320;
  longlong local_318;
  __time64_t local_310;
  longlong local_308;
  undefined1 local_300;
  undefined8 local_2f8;
  undefined8 local_2f0;
  undefined1 local_2e8;
  undefined8 local_2e0;
  undefined1 local_2d8;
  short local_2d0;
  short local_2ce;
  undefined2 local_2cc;
  short local_2ca;
  short local_2c8;
  short local_2c6;
  short local_2c4;
  undefined2 local_2c2;
  short local_2c0;
  short local_2be;
  undefined2 local_2bc;
  short local_2ba;
  short local_2b8;
  short local_2b6;
  short local_2b4;
  undefined2 local_2b2;
  undefined8 local_2b0;
  undefined8 local_2a8;
  undefined8 local_2a0;
  undefined8 local_298;
  undefined1 local_290;
  undefined7 uStack_28f;
  undefined8 local_280;
  ulonglong local_278;
  undefined2 local_268;
  undefined6 uStack_266;
  undefined8 local_258;
  ulonglong local_250;
  tm local_240;
  tm local_218;
  undefined2 local_1f0;
  undefined6 uStack_1ee;
  undefined8 local_1e0;
  ulonglong local_1d8;
  undefined1 local_1c8;
  undefined7 uStack_1c7;
  undefined8 local_1b8;
  ulonglong local_1b0;
  undefined1 local_1a0 [10];
  ushort local_196;
  undefined1 local_190 [8];
  ushort local_188;
  ushort local_178;
  ushort local_166;
  int local_160 [3];
  short local_154 [22];
  void *local_128 [3];
  ulonglong local_110;
  undefined2 local_100;
  undefined6 uStack_fe;
  undefined2 uStack_f8;
  undefined6 uStack_f6;
  undefined2 uStack_f0;
  undefined6 local_ee;
  undefined2 uStack_e8;
  undefined6 local_e6;
  undefined2 uStack_e0;
  undefined6 local_de;
  undefined2 uStack_d8;
  undefined6 local_d6;
  undefined1 uStack_d0;
  undefined1 uStack_cf;
  char local_c8 [42];
  ulonglong local_9e;
  char local_88 [64];
  ulonglong local_48;
  
  local_2f8 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_408;
  local_350 = param_1;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 != 0xcc) && (DAT_140320610 != 0x68)) {
    return 1;
  }
  local_328 = "PG_AUTH_XUNLEI_TYPE";
  local_318 = **(longlong **)(*(longlong *)(param_1 + 0x200) + 8) + 0x68;
  local_320 = timeGetTime();
  lVar25 = param_1 + 0xe0;
  local_308 = lVar25;
  FUN_1400a1c30(lVar25);
  local_300 = 1;
  plVar12 = (longlong *)FUN_14000f1a0(param_1 + -8,&local_340,param_2);
  lVar15 = 0;
  if ((longlong *)*plVar12 != (longlong *)0x0) {
    lVar15 = *(longlong *)*plVar12;
  }
  if ((local_340 != 0) &&
     (*(longlong *)(local_340 + 8) = *(longlong *)(local_340 + 8) + -1, lVar25 = local_308,
     *(longlong *)(local_340 + 8) == 0)) {
    FUN_1400219e0(local_340);
    lVar25 = local_308;
  }
  if (lVar15 == 0) {
    FUN_1400d1290(lVar25);
    goto LAB_1400168fb;
  }
  local_88[0] = '\0';
  local_88[1] = '\0';
  local_88[2] = '\0';
  local_88[3] = '\0';
  local_88[4] = '\0';
  local_88[5] = '\0';
  local_88[6] = '\0';
  local_88[7] = '\0';
  local_88[8] = '\0';
  local_88[9] = '\0';
  local_88[10] = '\0';
  local_88[0xb] = '\0';
  local_88[0xc] = '\0';
  local_88[0xd] = '\0';
  local_88[0xe] = '\0';
  local_88[0xf] = '\0';
  local_88[0x10] = '\0';
  local_88[0x11] = '\0';
  local_88[0x12] = '\0';
  local_88[0x13] = '\0';
  local_88[0x14] = '\0';
  local_88[0x15] = '\0';
  local_88[0x16] = '\0';
  local_88[0x17] = '\0';
  local_88[0x18] = '\0';
  local_88[0x19] = '\0';
  local_88[0x1a] = '\0';
  local_88[0x1b] = '\0';
  local_88[0x1c] = '\0';
  local_88[0x1d] = '\0';
  local_88[0x1e] = '\0';
  local_88[0x1f] = '\0';
  local_88[0x20] = '\0';
  local_88[0x21] = '\0';
  local_88[0x22] = '\0';
  local_88[0x23] = '\0';
  local_88[0x24] = '\0';
  local_88[0x25] = '\0';
  local_88[0x26] = '\0';
  local_88[0x27] = '\0';
  local_88[0x28] = '\0';
  local_88[0x29] = '\0';
  local_88[0x2a] = '\0';
  local_88[0x2b] = '\0';
  local_88[0x2c] = '\0';
  local_88[0x2d] = '\0';
  local_88[0x2e] = '\0';
  local_88[0x2f] = '\0';
  local_88[0x30] = '\0';
  local_88[0x31] = '\0';
  local_88[0x32] = '\0';
  local_88[0x33] = '\0';
  local_88[0x34] = '\0';
  local_88[0x35] = '\0';
  local_88[0x36] = '\0';
  local_88[0x37] = '\0';
  local_88[0x38] = '\0';
  local_88[0x39] = '\0';
  local_88[0x3a] = '\0';
  local_88[0x3b] = '\0';
  local_88[0x3c] = '\0';
  local_88[0x3d] = '\0';
  local_88[0x3e] = '\0';
  local_88[0x3f] = 0;
  plVar12 = (longlong *)(lVar15 + 0x10);
  pcVar13 = (char *)FUN_1401e1690(&local_1c8,plVar12);
  if (0xf < *(ulonglong *)(pcVar13 + 0x18)) {
    pcVar13 = *(char **)pcVar13;
  }
  strcpy_s(local_88,0x40,pcVar13);
  if (0xf < local_1b0) {
    operator_delete((void *)CONCAT71(uStack_1c7,local_1c8));
  }
  local_1b0 = 0xf;
  local_1b8 = 0;
  local_1c8 = 0;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_1403205d6 == '\0') {
    (*DAT_14031d5c8)();
    pcVar13 = (char *)*param_7;
    if ((char *)*param_7 == (char *)0x0) {
      pcVar13 = PTR_DAT_1402f8008;
    }
    local_278 = 0xf;
    local_280 = 0;
    local_290 = 0;
    uVar18 = 0xffffffffffffffff;
    pcVar23 = pcVar13;
    do {
      if (uVar18 == 0) break;
      uVar18 = uVar18 - 1;
      cVar3 = *pcVar23;
      pcVar23 = pcVar23 + 1;
    } while (cVar3 != '\0');
    FUN_140003e60(&local_290,pcVar13,~uVar18 - 1);
    FUN_1401e1d60(&local_268);
    memset(local_160,0,0x34);
    puVar19 = &local_268;
    if (7 < local_250) {
      puVar19 = (undefined2 *)CONCAT62(uStack_266,local_268);
    }
    plVar22 = plVar12;
    if (7 < *(ulonglong *)(lVar15 + 0x28)) {
      plVar22 = (longlong *)*plVar12;
    }
    local_380[0] = (*DAT_14031d5c0)(puVar19,plVar22,local_160);
    lVar14 = FUN_1401e4420();
    if (*(int *)(lVar14 + 0x250) == 0xcc) {
      printf("XUNLEI Auth Try : IP[ %s ] ");
    }
    if (local_380[0] == 0) {
      local_1d8 = 7;
      local_1e0 = 0;
      local_1f0 = 0;
      uVar18 = 0xffffffffffffffff;
      psVar24 = local_154;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar4 = *psVar24;
        psVar24 = psVar24 + 1;
      } while (sVar4 != 0);
      FUN_140001b00(&local_1f0,local_154,~uVar18 - 1);
      local_c8[0] = '0';
      local_c8[1] = '\0';
      local_c8[2] = '\0';
      local_c8[3] = '\0';
      local_c8[4] = '\0';
      local_c8[5] = '\0';
      local_c8[6] = '\0';
      local_c8[7] = '\0';
      local_c8[8] = '\0';
      local_c8[9] = '\0';
      local_c8[10] = '\0';
      local_c8[0xb] = '\0';
      local_c8[0xc] = '\0';
      local_c8[0xd] = '\0';
      local_c8[0xe] = '\0';
      local_c8[0xf] = '\0';
      local_c8[0x10] = '\0';
      local_c8[0x11] = '\0';
      local_c8[0x12] = '\0';
      local_c8[0x13] = '\0';
      local_c8[0x14] = '\0';
      local_c8[0x15] = '\0';
      local_c8[0x16] = '\0';
      local_c8[0x17] = '\0';
      local_c8[0x18] = '\0';
      local_c8[0x19] = '\0';
      local_c8[0x1a] = '\0';
      local_c8[0x1b] = '\0';
      local_c8[0x1c] = '\0';
      local_c8[0x1d] = '\0';
      local_c8[0x1e] = '\0';
      local_c8[0x1f] = '\0';
      local_c8[0x20] = '\0';
      local_c8[0x21] = '\0';
      local_c8[0x22] = '\0';
      local_c8[0x23] = '\0';
      local_c8[0x24] = '\0';
      local_c8[0x25] = '\0';
      local_c8[0x26] = '\0';
      local_c8[0x27] = '\0';
      local_c8[0x28] = '\0';
      local_c8[0x29] = '\0';
      local_9e = 0;
      pcVar13 = (char *)FUN_1401e1690(local_128,&local_1f0);
      if (0xf < *(ulonglong *)(pcVar13 + 0x18)) {
        pcVar13 = *(char **)pcVar13;
      }
      strcpy_s(local_c8,0x32,pcVar13);
      if (0xf < local_110) {
        operator_delete(local_128[0]);
      }
      local_9e = local_9e & 0xffffffffffffff;
      local_358[0] = 1;
      if (local_160[0] != 0) {
        local_358[0] = 2;
      }
      *(uint *)(lVar15 + 0x1fc) = local_358[0];
      strncpy_s((char *)(lVar15 + 0x200),0x32,local_c8,0x31);
      *(undefined1 *)(lVar15 + 0x231) = 0;
      lVar14 = FUN_1401e4420();
      if (*(int *)(lVar14 + 0x250) == 0xcc) {
        printf("Account [ %s ]\n");
      }
      local_38c = 0;
      local_390 = 0;
      lVar14 = FUN_140094270();
      if (*(char *)(lVar14 + 0x11) != '\0') {
        local_330 = _time64((__time64_t *)0x0);
        local_368 = 0;
        local_360 = 0;
        eVar6 = _localtime64_s(&local_240,&local_330);
        if (eVar6 == 0) {
          local_2c0 = (short)local_240.tm_year + 0x76c;
          local_2be = (short)local_240.tm_mon + 1;
          local_2bc = (undefined2)local_240.tm_wday;
          local_2ba = (short)local_240.tm_mday;
          local_2b8 = (short)local_240.tm_hour;
          local_2b6 = (short)local_240.tm_min;
          local_2b4 = (short)local_240.tm_sec;
          local_2b2 = 0;
          iVar7 = Ordinal_184();
          local_2b0 = 0;
          local_2a8 = 0;
          if ((((iVar7 == 0) || (iVar7 = Ordinal_185(local_368), iVar7 == 0)) ||
              (local_2c0 != (short)local_2b0)) ||
             (((local_2be != local_2b0._2_2_ || (local_2ba != local_2b0._6_2_)) ||
              ((local_2b8 != (short)local_2a8 ||
               ((local_2b6 != local_2a8._2_2_ || (local_2b4 != local_2a8._4_2_))))))))
          goto LAB_1400165d2;
          local_360 = 0;
          iVar7 = Ordinal_185(local_368);
          if (iVar7 == 0) goto LAB_1400165d5;
          local_38c = (uint)local_178;
        }
        else {
LAB_1400165d2:
          local_360 = 1;
LAB_1400165d5:
          local_38c = 0xffffffff;
        }
        if ((local_360 == 0) && (iVar7 = Ordinal_185(local_368), iVar7 != 0)) {
          local_390 = (uint)local_166;
        }
        else {
          local_390 = 0xffffffff;
        }
      }
      lVar14 = local_350;
      if (7 < *(ulonglong *)(lVar15 + 0x28)) {
        plVar12 = (longlong *)*plVar12;
      }
      local_3b8 = 0;
      local_3c0 = 0;
      local_3c8 = 0;
      local_3d0 = (undefined1 *)CONCAT44(local_3d0._4_4_,1);
      local_3e0 = (uint *)CONCAT44(local_3e0._4_4_,*(undefined4 *)(DAT_140320138 + 0x140));
      local_3e8 = (uint *)local_c8;
      local_3d8 = (uint *)plVar12;
      (**(code **)(**(longlong **)(local_350 + 0x80) + 8))
                (*(longlong **)(local_350 + 0x80),*(undefined4 *)(lVar15 + 0x1f0),
                 *(undefined4 *)(lVar15 + 0x1ec),param_2);
      lVar15 = FUN_140094270();
      local_3a8 = *(undefined1 *)(lVar15 + 0x11);
      FUN_1400a3440();
      local_3a0 = PTR_DAT_1402f8008;
      iVar10 = FUN_1400a3360(local_c8);
      iVar21 = 0;
      iVar7 = iVar21;
      if ((local_3a0 != (undefined *)0x0) && (local_3a0 != PTR_DAT_1402f8008)) {
        iVar7 = *(int *)(local_3a0 + -8);
      }
      iVar11 = iVar10;
      if (((iVar10 <= iVar7) && (iVar11 = iVar21, local_3a0 != (undefined *)0x0)) &&
         (local_3a0 != PTR_DAT_1402f8008)) {
        iVar11 = *(int *)(local_3a0 + -8);
      }
      iVar7 = 1;
      if (1 < iVar11) {
        iVar7 = iVar11;
      }
      iVar11 = 0;
      iVar21 = iVar11;
      if ((local_3a0 != (undefined *)0x0) && (local_3a0 != PTR_DAT_1402f8008)) {
        iVar21 = *(int *)(local_3a0 + -8);
      }
      if (iVar21 < iVar7) {
        FUN_14000c1c0(&local_3a0,iVar7);
      }
      FUN_14000c330(&local_3a0);
      puVar20 = local_3a0;
      if (local_3a0 == (undefined *)0x0) {
        puVar20 = PTR_DAT_1402f8008;
      }
      FUN_1400a3390(puVar20,local_c8,iVar10);
      puVar20 = local_3a0;
      if (local_3a0 == (undefined *)0x0) {
        puVar20 = PTR_DAT_1402f8008;
      }
      iVar10 = FUN_1400a3360(puVar20);
      iVar7 = 0;
      if (0 < iVar10) {
        iVar7 = iVar10;
      }
      iVar10 = iVar11;
      if ((local_3a0 != (undefined *)0x0) && (local_3a0 != PTR_DAT_1402f8008)) {
        iVar10 = *(int *)(local_3a0 + -8);
      }
      if ((iVar7 < iVar10) || (iVar7 = iVar11, local_3a0 == (undefined *)0x0)) {
LAB_14001676d:
        if (((local_3a0 != PTR_DAT_1402f8008) && (local_3a0 != (undefined *)0x0)) &&
           (piVar1 = (int *)(local_3a0 + -8), piVar1 != (int *)0x0)) {
          *piVar1 = iVar7;
          *(undefined1 *)((longlong)iVar7 + 8 + (longlong)piVar1) = 0;
        }
      }
      else if (local_3a0 != PTR_DAT_1402f8008) {
        iVar7 = *(int *)(local_3a0 + -8);
        goto LAB_14001676d;
      }
      plVar12 = (longlong *)(lVar14 + 0x58);
      local_3d0 = &local_3a8;
      local_3d8 = &local_390;
      local_3e0 = &local_38c;
      local_3e8 = local_358;
      (**(code **)(*plVar12 + 0x200))(plVar12,param_2,&DAT_14030ab90,&local_3a0);
      puVar20 = local_3a0;
      if (((local_3a0 != (undefined *)0x0) && (local_3a0 != PTR_DAT_1402f8008)) &&
         (puVar2 = local_3a0 + -8, puVar2 != (undefined *)0x0)) {
        uVar16 = FUN_1400a3440();
        local_2f0 = uVar16;
        FUN_1400a1c30(uVar16);
        local_2e8 = 1;
        piVar1 = (int *)(puVar20 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar2);
        }
        FUN_1400d1290(uVar16);
      }
      if (7 < local_1d8) {
        operator_delete((void *)CONCAT62(uStack_1ee,local_1f0));
      }
    }
    else {
      lVar15 = FUN_1401e4420();
      if (*(int *)(lVar15 + 0x250) == 0xcc) {
        printf("Failed\n");
      }
      local_348[1] = 0x15;
      plVar12 = (longlong *)(local_350 + 0x58);
      (**(code **)(*plVar12 + 0x70))(plVar12,param_2,&DAT_14030ab90,local_348 + 1);
    }
    (**(code **)(*plVar12 + 0x280))(plVar12,param_2,&DAT_14030ad10,local_380);
    if (7 < local_250) {
      operator_delete((void *)CONCAT62(uStack_266,local_268));
    }
    local_250 = 7;
    local_258 = 0;
    local_268 = 0;
    if (0xf < local_278) {
      operator_delete((void *)CONCAT71(uStack_28f,local_290));
    }
    local_278 = 0xf;
    local_280 = 0;
    local_290 = 0;
    FUN_1400d1290(lVar25);
    goto LAB_1400168fb;
  }
  lVar14 = FUN_1401e4420();
  if (*(int *)(lVar14 + 0x250) == 0xcc) {
    printf("XUNLEI Auth Try : Account[ %s ] P[ %s ] IP[ %s ]\n");
  }
  local_384 = 0;
  local_388 = 0;
  lVar14 = FUN_140094270();
  if (*(char *)(lVar14 + 0x11) != '\0') {
    local_310 = _time64((__time64_t *)0x0);
    local_378 = 0;
    local_370 = 0;
    eVar6 = _localtime64_s(&local_218,&local_310);
    if (eVar6 == 0) {
      local_2d0 = (short)local_218.tm_year + 0x76c;
      local_2ce = (short)local_218.tm_mon + 1;
      local_2cc = (undefined2)local_218.tm_wday;
      local_2ca = (short)local_218.tm_mday;
      local_2c8 = (short)local_218.tm_hour;
      local_2c6 = (short)local_218.tm_min;
      local_2c4 = (short)local_218.tm_sec;
      local_2c2 = 0;
      iVar7 = Ordinal_184(&local_2d0,&local_378);
      local_2a0 = 0;
      local_298 = 0;
      if (((iVar7 == 0) || (iVar7 = Ordinal_185(local_378,&local_2a0), iVar7 == 0)) ||
         ((local_2d0 != (short)local_2a0 ||
          ((((local_2ce != local_2a0._2_2_ || (local_2ca != local_2a0._6_2_)) ||
            (local_2c8 != (short)local_298)) ||
           ((local_2c6 != local_298._2_2_ || (local_2c4 != local_298._4_2_))))))))
      goto LAB_140015f36;
      local_370 = 0;
      iVar7 = Ordinal_185(local_378,local_190);
      if (iVar7 == 0) goto LAB_140015f39;
      local_384 = (uint)local_188;
    }
    else {
LAB_140015f36:
      local_370 = 1;
LAB_140015f39:
      local_384 = 0xffffffff;
    }
    if ((local_370 == 0) && (iVar7 = Ordinal_185(local_378,local_1a0), iVar7 != 0)) {
      local_388 = (uint)local_196;
    }
    else {
      local_388 = 0xffffffff;
    }
  }
  lVar14 = local_350;
  *(undefined4 *)(lVar15 + 0x1e8) = 0;
  puVar17 = (undefined8 *)*param_4;
  if ((undefined8 *)*param_4 == (undefined8 *)0x0) {
    puVar17 = (undefined8 *)PTR_DAT_1402f8008;
  }
  local_100 = (undefined2)*puVar17;
  uStack_fe = (undefined6)((ulonglong)*puVar17 >> 0x10);
  uStack_f8 = (undefined2)puVar17[1];
  uStack_f6 = (undefined6)((ulonglong)puVar17[1] >> 0x10);
  uStack_f0 = (undefined2)puVar17[2];
  local_ee = (undefined6)((ulonglong)puVar17[2] >> 0x10);
  uStack_e8 = (undefined2)puVar17[3];
  local_e6 = (undefined6)((ulonglong)puVar17[3] >> 0x10);
  uStack_e0 = (undefined2)puVar17[4];
  local_de = (undefined6)((ulonglong)puVar17[4] >> 0x10);
  uStack_d8 = (undefined2)puVar17[5];
  local_d6 = (undefined6)((ulonglong)puVar17[5] >> 0x10);
  uStack_d0 = (undefined1)*(undefined2 *)(puVar17 + 6);
  uStack_cf = 0;
  if (7 < *(ulonglong *)(lVar15 + 0x28)) {
    plVar12 = (longlong *)*plVar12;
  }
  local_3b8 = 0;
  local_3c0 = 0;
  local_3c8 = 0;
  local_3d0 = (undefined1 *)CONCAT44(local_3d0._4_4_,1);
  local_3e0 = (uint *)CONCAT44(local_3e0._4_4_,*(undefined4 *)(DAT_140320138 + 0x140));
  local_3e8 = (uint *)&local_100;
  local_3d8 = (uint *)plVar12;
  (**(code **)(**(longlong **)(local_350 + 0x80) + 8))
            (*(longlong **)(local_350 + 0x80),*(undefined4 *)(lVar15 + 0x1f0),
             *(undefined4 *)(lVar15 + 0x1ec),param_2);
  local_348[0] = 1;
  if (*param_6 == '\0') {
    local_348[0] = 2;
  }
  *(uint *)(lVar15 + 0x1fc) = local_348[0];
  strncpy_s((char *)(lVar15 + 0x200),0x32,(char *)&local_100,0x31);
  *(undefined1 *)(lVar15 + 0x231) = 0;
  lVar15 = FUN_140094270();
  local_3a7[0] = *(undefined1 *)(lVar15 + 0x11);
  FUN_1400a3440();
  local_398 = PTR_DAT_1402f8008;
  uVar8 = FUN_1400a3360(&local_100);
  iVar7 = 0;
  if ((local_398 != (undefined *)0x0) && (local_398 != PTR_DAT_1402f8008)) {
    iVar7 = *(int *)(local_398 + -8);
  }
  uVar9 = uVar8;
  if ((((int)uVar8 <= iVar7) && (uVar9 = 0, local_398 != (undefined *)0x0)) &&
     (local_398 != PTR_DAT_1402f8008)) {
    uVar9 = *(uint *)(local_398 + -8);
  }
  uVar5 = 1;
  if (1 < (int)uVar9) {
    uVar5 = uVar9;
  }
  iVar7 = 0;
  if ((local_398 != (undefined *)0x0) && (iVar7 = 0, local_398 != PTR_DAT_1402f8008)) {
    iVar7 = *(int *)(local_398 + -8);
  }
  if (iVar7 < (int)uVar5) {
    FUN_14000c1c0(&local_398,uVar5);
  }
  FUN_14000c330(&local_398);
  puVar20 = local_398;
  if (local_398 == (undefined *)0x0) {
    puVar20 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar20,&local_100,uVar8);
  puVar20 = local_398;
  if (local_398 == (undefined *)0x0) {
    puVar20 = PTR_DAT_1402f8008;
  }
  iVar10 = FUN_1400a3360(puVar20);
  iVar7 = 0;
  if (0 < iVar10) {
    iVar7 = iVar10;
  }
  iVar10 = 0;
  if ((local_398 != (undefined *)0x0) && (iVar10 = 0, local_398 != PTR_DAT_1402f8008)) {
    iVar10 = *(int *)(local_398 + -8);
  }
  if ((iVar7 < iVar10) || (iVar7 = 0, local_398 == (undefined *)0x0)) {
LAB_1400161b1:
    if (((local_398 != PTR_DAT_1402f8008) && (local_398 != (undefined *)0x0)) &&
       (piVar1 = (int *)(local_398 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar7;
      *(undefined1 *)((longlong)iVar7 + 8 + (longlong)piVar1) = 0;
    }
  }
  else if (local_398 != PTR_DAT_1402f8008) {
    iVar7 = *(int *)(local_398 + -8);
    goto LAB_1400161b1;
  }
  local_3d0 = local_3a7;
  local_3d8 = &local_388;
  local_3e0 = &local_384;
  local_3e8 = local_348;
  (**(code **)(*(longlong *)(lVar14 + 0x58) + 0x200))
            (lVar14 + 0x58,param_2,&DAT_14030ab90,&local_398);
  puVar20 = local_398;
  if (((local_398 != (undefined *)0x0) && (local_398 != PTR_DAT_1402f8008)) &&
     (puVar2 = local_398 + -8, puVar2 != (undefined *)0x0)) {
    uVar16 = FUN_1400a3440();
    local_2e0 = uVar16;
    FUN_1400a1c30(uVar16);
    local_2d8 = 1;
    piVar1 = (int *)(puVar20 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2);
    }
    FUN_1400d1290(uVar16);
  }
  local_338[0] = 0;
  (**(code **)(*(longlong *)(lVar14 + 0x58) + 0x280))
            (lVar14 + 0x58,param_2,&DAT_14030ad10,local_338);
  FUN_1400d1290(lVar25);
LAB_1400168fb:
  FUN_140070e40(&local_328);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140016930(longlong param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  int *piVar1;
  undefined *puVar2;
  char cVar3;
  char cVar4;
  errno_t eVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  longlong *plVar9;
  char *pcVar10;
  undefined8 uVar11;
  undefined *puVar12;
  longlong lVar13;
  longlong lVar14;
  longlong lVar15;
  int iVar16;
  undefined1 auStack_198 [32];
  undefined4 *local_178;
  uint *local_170;
  uint *local_168;
  char *local_160;
  undefined8 local_158;
  undefined8 local_150;
  undefined8 local_148;
  char local_138 [8];
  undefined *local_130;
  uint local_128;
  uint local_124;
  undefined8 local_120;
  int local_118;
  undefined4 local_110 [2];
  longlong local_108;
  undefined4 local_100;
  undefined4 local_fc;
  char *local_f8;
  DWORD local_f0;
  longlong local_e8;
  __time64_t local_e0;
  longlong local_d8;
  undefined1 local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined1 local_b8;
  short local_b0;
  short local_ae;
  undefined2 local_ac;
  short local_aa;
  short local_a8;
  short local_a6;
  short local_a4;
  undefined2 local_a2;
  undefined8 local_a0;
  undefined8 local_98;
  tm local_90;
  undefined1 local_68 [10];
  ushort local_5e;
  undefined1 local_58 [8];
  ushort local_50;
  ulonglong local_48;
  
  local_c8 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_198;
  local_f8 = "PG_KEY_ADD_AUTH_WPIN_OTHER";
  local_e8 = **(longlong **)(*(longlong *)(param_1 + 0x200) + 8) + 0x68;
  local_f0 = timeGetTime();
  lVar14 = param_1 + 0xe0;
  local_d8 = lVar14;
  FUN_1400a1c30(lVar14);
  local_d0 = 1;
  plVar9 = (longlong *)FUN_14000f1a0(param_1 + -8,&local_108,param_2);
  lVar13 = 0;
  if ((longlong *)*plVar9 != (longlong *)0x0) {
    lVar13 = *(longlong *)*plVar9;
  }
  if ((local_108 != 0) &&
     (*(longlong *)(local_108 + 8) = *(longlong *)(local_108 + 8) + -1, lVar14 = local_d8,
     *(longlong *)(local_108 + 8) == 0)) {
    FUN_1400219e0(local_108);
    lVar14 = local_d8;
  }
  if (lVar13 == 0) {
    FUN_1400d1290(lVar14);
    goto LAB_140016e59;
  }
  puVar12 = (undefined *)*param_4;
  if ((undefined *)*param_4 == (undefined *)0x0) {
    puVar12 = PTR_DAT_1402f8008;
  }
  pcVar10 = (char *)(lVar13 + 0x332);
  lVar15 = (longlong)puVar12 - (longlong)pcVar10;
  do {
    cVar3 = *pcVar10;
    cVar4 = pcVar10[lVar15];
    if (cVar3 != cVar4) break;
    pcVar10 = pcVar10 + 1;
  } while (cVar4 != '\0');
  if (cVar3 != cVar4) {
    *(int *)(lVar13 + 0x1e8) = *(int *)(lVar13 + 0x1e8) + 1;
    plVar9 = (longlong *)(param_1 + 0x58);
    if (*(int *)(lVar13 + 0x1e8) < 3) {
      local_110[0] = 0x11;
      (**(code **)(*plVar9 + 0x70))(plVar9,param_2,&DAT_14030ab90,local_110);
      FUN_1400d1290(lVar14);
    }
    else {
      local_fc = 0xc;
      (**(code **)(*plVar9 + 0x70))(plVar9,param_2,&DAT_14030ab90,&local_fc);
      FUN_1400d1290(lVar14);
    }
    goto LAB_140016e59;
  }
  iVar16 = 0;
  local_128 = 0;
  local_124 = 0;
  if ((DAT_140320f64 & 1) == 0) {
    DAT_140320f64 = DAT_140320f64 | 1;
    FUN_1400908e0();
    atexit((_func_5014 *)&LAB_140202650);
  }
  if (DAT_1403206c1 != '\0') {
    local_e0 = _time64((__time64_t *)0x0);
    local_120 = 0;
    local_118 = 0;
    eVar5 = _localtime64_s(&local_90,&local_e0);
    if (eVar5 == 0) {
      local_b0 = (short)local_90.tm_year + 0x76c;
      local_ae = (short)local_90.tm_mon + 1;
      local_ac = (undefined2)local_90.tm_wday;
      local_aa = (short)local_90.tm_mday;
      local_a8 = (short)local_90.tm_hour;
      local_a6 = (short)local_90.tm_min;
      local_a4 = (short)local_90.tm_sec;
      local_a2 = 0;
      iVar6 = Ordinal_184(&local_b0,&local_120);
      local_a0 = 0;
      local_98 = 0;
      if ((((iVar6 == 0) || (iVar6 = Ordinal_185(local_120,&local_a0), iVar6 == 0)) ||
          (local_b0 != (short)local_a0)) ||
         (((local_ae != local_a0._2_2_ || (local_aa != local_a0._6_2_)) ||
          ((local_a8 != (short)local_98 ||
           ((local_a6 != local_98._2_2_ || (local_a4 != local_98._4_2_)))))))) goto LAB_140016b93;
      local_118 = 0;
      iVar6 = Ordinal_185(local_120,local_58);
      if (iVar6 == 0) goto LAB_140016b96;
      local_128 = (uint)local_50;
    }
    else {
LAB_140016b93:
      local_118 = 1;
LAB_140016b96:
      local_128 = 0xffffffff;
    }
    if ((local_118 == 0) && (iVar6 = Ordinal_185(local_120,local_68), iVar6 != 0)) {
      local_124 = (uint)local_5e;
    }
    else {
      local_124 = 0xffffffff;
    }
  }
  *(undefined4 *)(lVar13 + 0x1e8) = 0;
  local_168 = (uint *)(lVar13 + 0x10);
  if (7 < *(ulonglong *)(lVar13 + 0x28)) {
    local_168 = *(uint **)local_168;
  }
  lVar15 = lVar13 + 0x200;
  local_148 = 0;
  local_150 = 0;
  local_158 = 0;
  local_160 = (char *)CONCAT44(local_160._4_4_,1);
  local_170 = (uint *)CONCAT44(local_170._4_4_,*(undefined4 *)(DAT_140320138 + 0x140));
  local_178 = (undefined4 *)lVar15;
  (**(code **)(**(longlong **)(param_1 + 0x80) + 8))
            (*(longlong **)(param_1 + 0x80),*(undefined4 *)(lVar13 + 0x1f0),
             *(undefined4 *)(lVar13 + 0x1ec),param_2);
  if ((DAT_140320f64 & 1) == 0) {
    DAT_140320f64 = DAT_140320f64 | 1;
    FUN_1400908e0();
    atexit((_func_5014 *)&LAB_140202650);
  }
  local_138[0] = DAT_1403206c1;
  local_100 = *(undefined4 *)(lVar13 + 0x1fc);
  FUN_1400a3440();
  local_130 = PTR_DAT_1402f8008;
  iVar6 = FUN_1400a3360(lVar15);
  if ((local_130 != (undefined *)0x0) && (local_130 != PTR_DAT_1402f8008)) {
    iVar16 = *(int *)(local_130 + -8);
  }
  iVar7 = 0;
  iVar8 = iVar6;
  if (((iVar6 <= iVar16) && (iVar8 = iVar7, local_130 != (undefined *)0x0)) &&
     (local_130 != PTR_DAT_1402f8008)) {
    iVar8 = *(int *)(local_130 + -8);
  }
  iVar16 = 1;
  if (1 < iVar8) {
    iVar16 = iVar8;
  }
  iVar8 = iVar7;
  if ((local_130 != (undefined *)0x0) && (local_130 != PTR_DAT_1402f8008)) {
    iVar8 = *(int *)(local_130 + -8);
  }
  if (iVar8 < iVar16) {
    FUN_14000c1c0(&local_130,iVar16);
  }
  FUN_14000c330(&local_130);
  puVar12 = local_130;
  if (local_130 == (undefined *)0x0) {
    puVar12 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar12,lVar15,iVar6);
  puVar12 = local_130;
  if (local_130 == (undefined *)0x0) {
    puVar12 = PTR_DAT_1402f8008;
  }
  iVar6 = FUN_1400a3360(puVar12);
  iVar16 = 0;
  if (0 < iVar6) {
    iVar16 = iVar6;
  }
  iVar6 = iVar7;
  if ((local_130 != (undefined *)0x0) && (local_130 != PTR_DAT_1402f8008)) {
    iVar6 = *(int *)(local_130 + -8);
  }
  if ((iVar16 < iVar6) || (iVar16 = iVar7, local_130 == (undefined *)0x0)) {
LAB_140016d50:
    if (((local_130 != PTR_DAT_1402f8008) && (local_130 != (undefined *)0x0)) &&
       (piVar1 = (int *)(local_130 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar16;
      *(undefined1 *)((longlong)iVar16 + 8 + (longlong)piVar1) = 0;
    }
  }
  else if (local_130 != PTR_DAT_1402f8008) {
    iVar16 = *(int *)(local_130 + -8);
    goto LAB_140016d50;
  }
  local_160 = local_138;
  local_168 = &local_124;
  local_170 = &local_128;
  local_178 = &local_100;
  (**(code **)(*(longlong *)(param_1 + 0x58) + 0x200))
            ((longlong *)(param_1 + 0x58),param_2,&DAT_14030ab90,&local_130);
  puVar12 = local_130;
  if (((local_130 != (undefined *)0x0) && (local_130 != PTR_DAT_1402f8008)) &&
     (puVar2 = local_130 + -8, puVar2 != (undefined *)0x0)) {
    uVar11 = FUN_1400a3440();
    local_c0 = uVar11;
    FUN_1400a1c30(uVar11);
    local_b8 = 1;
    piVar1 = (int *)(puVar12 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2);
    }
    FUN_1400d1290(uVar11);
  }
  FUN_1400d1290(lVar14);
LAB_140016e59:
  FUN_140070e40(&local_f8);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140016e90(longlong param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined *puVar1;
  bool bVar2;
  undefined4 uVar3;
  errno_t eVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  longlong *plVar9;
  longlong lVar10;
  undefined8 uVar11;
  undefined8 *puVar12;
  longlong lVar13;
  undefined *puVar14;
  int *piVar15;
  char *pcVar16;
  longlong lVar17;
  undefined1 uVar18;
  undefined1 auStack_548 [32];
  int *local_528;
  uint *local_520;
  uint *local_518;
  char *local_510;
  undefined8 local_508;
  undefined8 local_500;
  undefined8 local_4f8;
  int local_4e8;
  char local_4e4 [4];
  undefined4 local_4e0;
  undefined *local_4d8;
  uint local_4d0;
  uint local_4cc;
  int local_4c8 [2];
  undefined8 local_4c0;
  int local_4b8;
  undefined4 local_4b0;
  undefined4 local_4ac;
  longlong local_4a8;
  char *local_4a0;
  DWORD local_498;
  longlong local_490;
  longlong local_488;
  undefined1 local_480;
  __time64_t local_478 [3];
  undefined1 local_460;
  short local_458;
  short local_456;
  undefined2 local_454;
  short local_452;
  short local_450;
  short local_44e;
  short local_44c;
  undefined2 local_44a;
  undefined8 local_448;
  undefined8 local_440;
  tm local_438;
  undefined1 local_410 [8];
  ushort local_408;
  undefined1 local_400 [10];
  ushort local_3f6;
  undefined8 local_3f0;
  undefined8 uStack_3e8;
  undefined4 local_3e0;
  undefined4 uStack_3dc;
  undefined4 uStack_3d8;
  undefined4 uStack_3d4;
  undefined4 local_3d0;
  undefined4 uStack_3cc;
  undefined4 uStack_3c8;
  undefined4 uStack_3c4;
  undefined2 local_3c0;
  char local_3b8;
  undefined1 local_3b7 [111];
  undefined8 local_348;
  undefined8 uStack_340;
  undefined4 local_338;
  undefined4 uStack_334;
  undefined4 uStack_330;
  undefined4 uStack_32c;
  undefined4 local_328;
  undefined4 uStack_324;
  undefined4 uStack_320;
  undefined4 uStack_31c;
  undefined2 local_318;
  char local_248;
  undefined1 local_247 [255];
  undefined1 local_148;
  undefined1 local_147 [255];
  ulonglong local_48;
  
  local_478[1] = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_548;
  local_4e0 = param_2;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 != 200) && (DAT_140320610 != 100)) {
    return 1;
  }
  local_4a0 = "PG_KEY_ADD_AUTH_WPIN";
  local_490 = **(longlong **)(*(longlong *)(param_1 + 0x200) + 8) + 0x68;
  local_498 = timeGetTime();
  lVar17 = param_1 + 0xe0;
  local_488 = lVar17;
  FUN_1400a1c30(lVar17);
  local_480 = 1;
  plVar9 = (longlong *)FUN_14000f1a0(param_1 + -8,&local_4a8,param_2);
  lVar10 = 0;
  bVar2 = false;
  if ((longlong *)*plVar9 != (longlong *)0x0) {
    lVar10 = *(longlong *)*plVar9;
  }
  if ((local_4a8 != 0) &&
     (*(longlong *)(local_4a8 + 8) = *(longlong *)(local_4a8 + 8) + -1, lVar17 = local_488,
     *(longlong *)(local_4a8 + 8) == 0)) {
    FUN_1400219e0(local_4a8);
    lVar17 = local_488;
  }
  if (lVar10 == 0) {
    FUN_1400d1290(lVar17);
    goto LAB_14001762e;
  }
  local_4e8._0_2_ = 0;
  local_348._0_1_ = '\0';
  memset((void *)((longlong)&local_348 + 1),0,0xfe);
  local_3b8 = '\0';
  memset(local_3b7,0,99);
  local_148 = 0;
  memset(local_147,0,0xfe);
  local_248 = '\0';
  memset(local_247,0,0xfe);
  pcVar16 = (char *)*param_4;
  if ((char *)*param_4 == (char *)0x0) {
    pcVar16 = PTR_DAT_1402f8008;
  }
  strcpy_s(&local_3b8,10,pcVar16);
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320470 == 0) {
    uVar18 = true;
    puVar12 = (undefined8 *)&DAT_14030cbc4;
  }
  else {
    uVar18 = DAT_140320478 == 0x10;
    puVar12 = &DAT_140320460;
    if (0xf < DAT_140320478) {
      puVar12 = DAT_140320460;
    }
  }
  local_510 = &local_248;
  local_518 = (uint *)&local_148;
  local_520 = (uint *)&local_348;
  local_528 = &local_4e8;
  (*DAT_14031d5d0)(puVar12,lVar10 + 0x58,lVar10 + 0x184,&local_3b8);
  uVar3 = local_4e0;
  lVar13 = 2;
  piVar15 = &local_4e8;
  pcVar16 = "S";
  do {
    if (lVar13 == 0) break;
    lVar13 = lVar13 + -1;
    uVar18 = (char)*piVar15 == *pcVar16;
    piVar15 = (int *)((longlong)piVar15 + 1);
    pcVar16 = pcVar16 + 1;
  } while ((bool)uVar18);
  iVar8 = 0;
  if (!(bool)uVar18) {
    lVar13 = 2;
    piVar15 = &local_4e8;
    pcVar16 = "F";
    do {
      if (lVar13 == 0) break;
      lVar13 = lVar13 + -1;
      uVar18 = (char)*piVar15 == *pcVar16;
      piVar15 = (int *)((longlong)piVar15 + 1);
      pcVar16 = pcVar16 + 1;
    } while ((bool)uVar18);
    if ((bool)uVar18) {
      strcpy_s((char *)&local_4e8,2,"A");
      *(int *)(lVar10 + 0x1e8) = *(int *)(lVar10 + 0x1e8) + 1;
      bVar2 = true;
    }
    else {
      lVar13 = 2;
      piVar15 = &local_4e8;
      pcVar16 = "A";
      do {
        if (lVar13 == 0) break;
        lVar13 = lVar13 + -1;
        uVar18 = (char)*piVar15 == *pcVar16;
        piVar15 = (int *)((longlong)piVar15 + 1);
        pcVar16 = pcVar16 + 1;
      } while ((bool)uVar18);
      if ((bool)uVar18) {
        strcpy_s((char *)(lVar10 + 0x184),100,(char *)&local_348);
        *(undefined4 *)(lVar10 + 0x1e8) = 0;
      }
    }
    if (*(int *)(lVar10 + 0x1e8) < 3) {
      if (bVar2) {
        local_4b0 = 0x11;
        (**(code **)(*(longlong *)(param_1 + 0x58) + 0x70))
                  ((longlong *)(param_1 + 0x58),local_4e0,&DAT_14030ab90,&local_4b0);
        FUN_1400d1290(lVar17);
      }
      else {
        iVar8 = strncmp((char *)(lVar10 + 0x184),"WP",2);
        if (iVar8 == 0) {
          (**(code **)(*(longlong *)(param_1 + 0x58) + 0x1a0))
                    ((longlong *)(param_1 + 0x58),local_4e0,&DAT_14030ab90);
        }
        else {
          iVar8 = strncmp((char *)(lVar10 + 0x184),"WO",2);
          if (iVar8 == 0) {
            (**(code **)(*(longlong *)(param_1 + 0x58) + 0x1b0))
                      ((longlong *)(param_1 + 0x58),local_4e0,&DAT_14030ab90);
          }
        }
        FUN_1400d1290(lVar17);
      }
    }
    else {
      local_4ac = 0xc;
      (**(code **)(*(longlong *)(param_1 + 0x58) + 0x70))
                ((longlong *)(param_1 + 0x58),local_4e0,&DAT_14030ab90,&local_4ac);
      FUN_1400d1290(lVar17);
    }
    goto LAB_14001762e;
  }
  local_3f0 = CONCAT71(local_348._1_7_,(char)local_348);
  uStack_3e8 = uStack_340;
  local_3e0 = local_338;
  uStack_3dc = uStack_334;
  uStack_3d8 = uStack_330;
  uStack_3d4 = uStack_32c;
  local_3d0 = local_328;
  uStack_3cc = uStack_324;
  uStack_3c8 = uStack_320;
  uStack_3c4 = uStack_31c;
  local_3c0 = local_318;
  local_518 = (uint *)(lVar10 + 0x10);
  if (7 < *(ulonglong *)(lVar10 + 0x28)) {
    local_518 = *(uint **)local_518;
  }
  local_4f8 = 0;
  local_500 = 0;
  local_508 = 0;
  local_510 = (char *)CONCAT44(local_510._4_4_,1);
  local_520 = (uint *)CONCAT44(local_520._4_4_,*(undefined4 *)(DAT_140320138 + 0x140));
  local_528 = (int *)&local_3f0;
  (**(code **)(**(longlong **)(param_1 + 0x80) + 8))
            (*(longlong **)(param_1 + 0x80),*(undefined4 *)(lVar10 + 0x1f0),
             *(undefined4 *)(lVar10 + 0x1ec),local_4e0);
  local_4cc = 0;
  local_4d0 = 0;
  lVar13 = FUN_140094270();
  if (*(char *)(lVar13 + 0x11) != '\0') {
    local_478[0] = _time64((__time64_t *)0x0);
    local_4c0 = 0;
    local_4b8 = 0;
    eVar4 = _localtime64_s(&local_438,local_478);
    if (eVar4 == 0) {
      local_458 = (short)local_438.tm_year + 0x76c;
      local_456 = (short)local_438.tm_mon + 1;
      local_454 = (undefined2)local_438.tm_wday;
      local_452 = (short)local_438.tm_mday;
      local_450 = (short)local_438.tm_hour;
      local_44e = (short)local_438.tm_min;
      local_44c = (short)local_438.tm_sec;
      local_44a = 0;
      iVar5 = Ordinal_184(&local_458,&local_4c0);
      local_448 = 0;
      local_440 = 0;
      if ((((iVar5 == 0) || (iVar5 = Ordinal_185((int)local_4c0,&local_448), iVar5 == 0)) ||
          (local_458 != (short)local_448)) ||
         (((local_456 != local_448._2_2_ || (local_452 != local_448._6_2_)) ||
          ((local_450 != (short)local_440 ||
           ((local_44e != local_440._2_2_ || (local_44c != local_440._4_2_))))))))
      goto LAB_14001729e;
      local_4b8 = 0;
      iVar5 = Ordinal_185((int)local_4c0,local_410);
      if (iVar5 == 0) goto LAB_1400172a1;
      local_4cc = (uint)local_408;
    }
    else {
LAB_14001729e:
      local_4b8 = 1;
LAB_1400172a1:
      local_4cc = 0xffffffff;
    }
    if ((local_4b8 == 0) && (iVar5 = Ordinal_185((int)local_4c0,local_400), iVar5 != 0)) {
      local_4d0 = (uint)local_3f6;
    }
    else {
      local_4d0 = 0xffffffff;
    }
  }
  local_4c8[0] = atoi(&local_248);
  *(int *)(lVar10 + 0x1fc) = local_4c8[0];
  strncpy_s((char *)(lVar10 + 0x200),0x32,(char *)&local_3f0,0x31);
  *(undefined1 *)(lVar10 + 0x231) = 0;
  lVar10 = FUN_1401e4420();
  if (*(int *)(lVar10 + 0x250) == 200) {
    printf("ShutDown Info : %d\n");
  }
  lVar10 = FUN_140094270();
  local_4e4[0] = *(char *)(lVar10 + 0x11);
  FUN_1400a3440();
  local_4d8 = PTR_DAT_1402f8008;
  iVar6 = FUN_1400a3360(&local_3f0);
  iVar5 = iVar8;
  if ((local_4d8 != (undefined *)0x0) && (local_4d8 != PTR_DAT_1402f8008)) {
    iVar5 = *(int *)(local_4d8 + -8);
  }
  iVar7 = iVar6;
  if (((iVar6 <= iVar5) && (iVar7 = iVar8, local_4d8 != (undefined *)0x0)) &&
     (local_4d8 != PTR_DAT_1402f8008)) {
    iVar7 = *(int *)(local_4d8 + -8);
  }
  iVar5 = 1;
  if (1 < iVar7) {
    iVar5 = iVar7;
  }
  iVar7 = iVar8;
  if ((local_4d8 != (undefined *)0x0) && (local_4d8 != PTR_DAT_1402f8008)) {
    iVar7 = *(int *)(local_4d8 + -8);
  }
  if (iVar7 < iVar5) {
    FUN_14000c1c0(&local_4d8,iVar5);
  }
  FUN_14000c330(&local_4d8);
  puVar14 = local_4d8;
  if (local_4d8 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar14,&local_3f0,iVar6);
  puVar14 = local_4d8;
  if (local_4d8 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8008;
  }
  iVar6 = FUN_1400a3360(puVar14);
  iVar5 = 0;
  if (0 < iVar6) {
    iVar5 = iVar6;
  }
  iVar6 = iVar8;
  if ((local_4d8 != (undefined *)0x0) && (local_4d8 != PTR_DAT_1402f8008)) {
    iVar6 = *(int *)(local_4d8 + -8);
  }
  if ((iVar5 < iVar6) || (iVar5 = iVar8, local_4d8 == (undefined *)0x0)) {
LAB_14001741e:
    if (((local_4d8 != PTR_DAT_1402f8008) && (local_4d8 != (undefined *)0x0)) &&
       (piVar15 = (int *)(local_4d8 + -8), piVar15 != (int *)0x0)) {
      *piVar15 = iVar5;
      *(undefined1 *)((longlong)iVar5 + 8 + (longlong)piVar15) = 0;
    }
  }
  else if (local_4d8 != PTR_DAT_1402f8008) {
    iVar5 = *(int *)(local_4d8 + -8);
    goto LAB_14001741e;
  }
  local_510 = local_4e4;
  local_518 = &local_4d0;
  local_520 = &local_4cc;
  local_528 = local_4c8;
  (**(code **)(*(longlong *)(param_1 + 0x58) + 0x200))
            ((longlong *)(param_1 + 0x58),uVar3,&DAT_14030ab90,&local_4d8);
  puVar14 = local_4d8;
  if (((local_4d8 != (undefined *)0x0) && (local_4d8 != PTR_DAT_1402f8008)) &&
     (puVar1 = local_4d8 + -8, puVar1 != (undefined *)0x0)) {
    uVar11 = FUN_1400a3440();
    local_478[2] = uVar11;
    FUN_1400a1c30(uVar11);
    local_460 = 1;
    piVar15 = (int *)(puVar14 + -4);
    *piVar15 = *piVar15 + -1;
    if (*piVar15 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar11);
  }
  FUN_1400d1290(lVar17);
LAB_14001762e:
  FUN_140070e40(&local_4a0);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140017670(longlong param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined *puVar1;
  bool bVar2;
  undefined4 uVar3;
  errno_t eVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  longlong *plVar9;
  longlong lVar10;
  undefined8 uVar11;
  undefined8 *puVar12;
  longlong lVar13;
  undefined *puVar14;
  int *piVar15;
  char *pcVar16;
  longlong lVar17;
  undefined1 uVar18;
  undefined1 auStack_548 [32];
  int *local_528;
  uint *local_520;
  uint *local_518;
  char *local_510;
  undefined8 local_508;
  undefined8 local_500;
  undefined8 local_4f8;
  int local_4e8;
  char local_4e4 [4];
  undefined4 local_4e0;
  undefined *local_4d8;
  uint local_4d0;
  uint local_4cc;
  int local_4c8 [2];
  undefined8 local_4c0;
  int local_4b8;
  undefined4 local_4b0;
  undefined4 local_4ac;
  longlong local_4a8;
  char *local_4a0;
  DWORD local_498;
  longlong local_490;
  longlong local_488;
  undefined1 local_480;
  __time64_t local_478 [3];
  undefined1 local_460;
  short local_458;
  short local_456;
  undefined2 local_454;
  short local_452;
  short local_450;
  short local_44e;
  short local_44c;
  undefined2 local_44a;
  undefined8 local_448;
  undefined8 local_440;
  tm local_438;
  undefined1 local_410 [8];
  ushort local_408;
  undefined1 local_400 [10];
  ushort local_3f6;
  undefined8 local_3f0;
  undefined8 uStack_3e8;
  undefined4 local_3e0;
  undefined4 uStack_3dc;
  undefined4 uStack_3d8;
  undefined4 uStack_3d4;
  undefined4 local_3d0;
  undefined4 uStack_3cc;
  undefined4 uStack_3c8;
  undefined4 uStack_3c4;
  undefined2 local_3c0;
  char local_3b8;
  undefined1 local_3b7 [111];
  undefined8 local_348;
  undefined8 uStack_340;
  undefined4 local_338;
  undefined4 uStack_334;
  undefined4 uStack_330;
  undefined4 uStack_32c;
  undefined4 local_328;
  undefined4 uStack_324;
  undefined4 uStack_320;
  undefined4 uStack_31c;
  undefined2 local_318;
  char local_248;
  undefined1 local_247 [255];
  undefined1 local_148;
  undefined1 local_147 [255];
  ulonglong local_48;
  
  local_478[1] = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_548;
  local_4e0 = param_2;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if ((DAT_140320610 != 200) && (DAT_140320610 != 100)) {
    return 1;
  }
  local_4a0 = "PG_KEY_ADD_AUTH_WPOTP";
  local_490 = **(longlong **)(*(longlong *)(param_1 + 0x200) + 8) + 0x68;
  local_498 = timeGetTime();
  lVar17 = param_1 + 0xe0;
  local_488 = lVar17;
  FUN_1400a1c30(lVar17);
  local_480 = 1;
  plVar9 = (longlong *)FUN_14000f1a0(param_1 + -8,&local_4a8,param_2);
  lVar10 = 0;
  bVar2 = false;
  if ((longlong *)*plVar9 != (longlong *)0x0) {
    lVar10 = *(longlong *)*plVar9;
  }
  if ((local_4a8 != 0) &&
     (*(longlong *)(local_4a8 + 8) = *(longlong *)(local_4a8 + 8) + -1, lVar17 = local_488,
     *(longlong *)(local_4a8 + 8) == 0)) {
    FUN_1400219e0(local_4a8);
    lVar17 = local_488;
  }
  if (lVar10 == 0) {
    FUN_1400d1290(lVar17);
    goto LAB_140017e0e;
  }
  local_4e8._0_2_ = 0;
  local_348._0_1_ = '\0';
  memset((void *)((longlong)&local_348 + 1),0,0xfe);
  local_3b8 = '\0';
  memset(local_3b7,0,99);
  local_148 = 0;
  memset(local_147,0,0xfe);
  local_248 = '\0';
  memset(local_247,0,0xfe);
  pcVar16 = (char *)*param_4;
  if ((char *)*param_4 == (char *)0x0) {
    pcVar16 = PTR_DAT_1402f8008;
  }
  strcpy_s(&local_3b8,10,pcVar16);
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320470 == 0) {
    uVar18 = true;
    puVar12 = (undefined8 *)&DAT_14030cbc4;
  }
  else {
    uVar18 = DAT_140320478 == 0x10;
    puVar12 = &DAT_140320460;
    if (0xf < DAT_140320478) {
      puVar12 = DAT_140320460;
    }
  }
  local_510 = &local_248;
  local_518 = (uint *)&local_148;
  local_520 = (uint *)&local_348;
  local_528 = &local_4e8;
  (*DAT_14031d5d0)(puVar12,lVar10 + 0x58,lVar10 + 0x184,&local_3b8);
  uVar3 = local_4e0;
  lVar13 = 2;
  piVar15 = &local_4e8;
  pcVar16 = "S";
  do {
    if (lVar13 == 0) break;
    lVar13 = lVar13 + -1;
    uVar18 = (char)*piVar15 == *pcVar16;
    piVar15 = (int *)((longlong)piVar15 + 1);
    pcVar16 = pcVar16 + 1;
  } while ((bool)uVar18);
  iVar8 = 0;
  if (!(bool)uVar18) {
    lVar13 = 2;
    piVar15 = &local_4e8;
    pcVar16 = "F";
    do {
      if (lVar13 == 0) break;
      lVar13 = lVar13 + -1;
      uVar18 = (char)*piVar15 == *pcVar16;
      piVar15 = (int *)((longlong)piVar15 + 1);
      pcVar16 = pcVar16 + 1;
    } while ((bool)uVar18);
    if ((bool)uVar18) {
      strcpy_s((char *)&local_4e8,2,"A");
      *(int *)(lVar10 + 0x1e8) = *(int *)(lVar10 + 0x1e8) + 1;
      bVar2 = true;
    }
    else {
      lVar13 = 2;
      piVar15 = &local_4e8;
      pcVar16 = "A";
      do {
        if (lVar13 == 0) break;
        lVar13 = lVar13 + -1;
        uVar18 = (char)*piVar15 == *pcVar16;
        piVar15 = (int *)((longlong)piVar15 + 1);
        pcVar16 = pcVar16 + 1;
      } while ((bool)uVar18);
      if ((bool)uVar18) {
        strcpy_s((char *)(lVar10 + 0x184),100,(char *)&local_348);
        *(undefined4 *)(lVar10 + 0x1e8) = 0;
      }
    }
    if (*(int *)(lVar10 + 0x1e8) < 3) {
      if (bVar2) {
        local_4b0 = 0x12;
        (**(code **)(*(longlong *)(param_1 + 0x58) + 0x70))
                  ((longlong *)(param_1 + 0x58),local_4e0,&DAT_14030ab90,&local_4b0);
        FUN_1400d1290(lVar17);
      }
      else {
        iVar8 = strncmp((char *)(lVar10 + 0x184),"WP",2);
        if (iVar8 == 0) {
          (**(code **)(*(longlong *)(param_1 + 0x58) + 0x1a0))
                    ((longlong *)(param_1 + 0x58),local_4e0,&DAT_14030ab90);
        }
        else {
          iVar8 = strncmp((char *)(lVar10 + 0x184),"WO",2);
          if (iVar8 == 0) {
            (**(code **)(*(longlong *)(param_1 + 0x58) + 0x1b0))
                      ((longlong *)(param_1 + 0x58),local_4e0,&DAT_14030ab90);
          }
        }
        FUN_1400d1290(lVar17);
      }
    }
    else {
      local_4ac = 0xd;
      (**(code **)(*(longlong *)(param_1 + 0x58) + 0x70))
                ((longlong *)(param_1 + 0x58),local_4e0,&DAT_14030ab90,&local_4ac);
      FUN_1400d1290(lVar17);
    }
    goto LAB_140017e0e;
  }
  local_3f0 = CONCAT71(local_348._1_7_,(char)local_348);
  uStack_3e8 = uStack_340;
  local_3e0 = local_338;
  uStack_3dc = uStack_334;
  uStack_3d8 = uStack_330;
  uStack_3d4 = uStack_32c;
  local_3d0 = local_328;
  uStack_3cc = uStack_324;
  uStack_3c8 = uStack_320;
  uStack_3c4 = uStack_31c;
  local_3c0 = local_318;
  local_518 = (uint *)(lVar10 + 0x10);
  if (7 < *(ulonglong *)(lVar10 + 0x28)) {
    local_518 = *(uint **)local_518;
  }
  local_4f8 = 0;
  local_500 = 0;
  local_508 = 0;
  local_510 = (char *)CONCAT44(local_510._4_4_,1);
  local_520 = (uint *)CONCAT44(local_520._4_4_,*(undefined4 *)(DAT_140320138 + 0x140));
  local_528 = (int *)&local_3f0;
  (**(code **)(**(longlong **)(param_1 + 0x80) + 8))
            (*(longlong **)(param_1 + 0x80),*(undefined4 *)(lVar10 + 0x1f0),
             *(undefined4 *)(lVar10 + 0x1ec),local_4e0);
  local_4cc = 0;
  local_4d0 = 0;
  lVar13 = FUN_140094270();
  if (*(char *)(lVar13 + 0x11) != '\0') {
    local_478[0] = _time64((__time64_t *)0x0);
    local_4c0 = 0;
    local_4b8 = 0;
    eVar4 = _localtime64_s(&local_438,local_478);
    if (eVar4 == 0) {
      local_458 = (short)local_438.tm_year + 0x76c;
      local_456 = (short)local_438.tm_mon + 1;
      local_454 = (undefined2)local_438.tm_wday;
      local_452 = (short)local_438.tm_mday;
      local_450 = (short)local_438.tm_hour;
      local_44e = (short)local_438.tm_min;
      local_44c = (short)local_438.tm_sec;
      local_44a = 0;
      iVar5 = Ordinal_184(&local_458,&local_4c0);
      local_448 = 0;
      local_440 = 0;
      if ((((iVar5 == 0) || (iVar5 = Ordinal_185((int)local_4c0,&local_448), iVar5 == 0)) ||
          (local_458 != (short)local_448)) ||
         (((local_456 != local_448._2_2_ || (local_452 != local_448._6_2_)) ||
          ((local_450 != (short)local_440 ||
           ((local_44e != local_440._2_2_ || (local_44c != local_440._4_2_))))))))
      goto LAB_140017a7e;
      local_4b8 = 0;
      iVar5 = Ordinal_185((int)local_4c0,local_410);
      if (iVar5 == 0) goto LAB_140017a81;
      local_4cc = (uint)local_408;
    }
    else {
LAB_140017a7e:
      local_4b8 = 1;
LAB_140017a81:
      local_4cc = 0xffffffff;
    }
    if ((local_4b8 == 0) && (iVar5 = Ordinal_185((int)local_4c0,local_400), iVar5 != 0)) {
      local_4d0 = (uint)local_3f6;
    }
    else {
      local_4d0 = 0xffffffff;
    }
  }
  local_4c8[0] = atoi(&local_248);
  *(int *)(lVar10 + 0x1fc) = local_4c8[0];
  strncpy_s((char *)(lVar10 + 0x200),0x32,(char *)&local_3f0,0x31);
  *(undefined1 *)(lVar10 + 0x231) = 0;
  lVar10 = FUN_1401e4420();
  if (*(int *)(lVar10 + 0x250) == 200) {
    printf("ShutDown Info : %d\n");
  }
  lVar10 = FUN_140094270();
  local_4e4[0] = *(char *)(lVar10 + 0x11);
  FUN_1400a3440();
  local_4d8 = PTR_DAT_1402f8008;
  iVar6 = FUN_1400a3360(&local_3f0);
  iVar5 = iVar8;
  if ((local_4d8 != (undefined *)0x0) && (local_4d8 != PTR_DAT_1402f8008)) {
    iVar5 = *(int *)(local_4d8 + -8);
  }
  iVar7 = iVar6;
  if (((iVar6 <= iVar5) && (iVar7 = iVar8, local_4d8 != (undefined *)0x0)) &&
     (local_4d8 != PTR_DAT_1402f8008)) {
    iVar7 = *(int *)(local_4d8 + -8);
  }
  iVar5 = 1;
  if (1 < iVar7) {
    iVar5 = iVar7;
  }
  iVar7 = iVar8;
  if ((local_4d8 != (undefined *)0x0) && (local_4d8 != PTR_DAT_1402f8008)) {
    iVar7 = *(int *)(local_4d8 + -8);
  }
  if (iVar7 < iVar5) {
    FUN_14000c1c0(&local_4d8,iVar5);
  }
  FUN_14000c330(&local_4d8);
  puVar14 = local_4d8;
  if (local_4d8 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar14,&local_3f0,iVar6);
  puVar14 = local_4d8;
  if (local_4d8 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8008;
  }
  iVar6 = FUN_1400a3360(puVar14);
  iVar5 = 0;
  if (0 < iVar6) {
    iVar5 = iVar6;
  }
  iVar6 = iVar8;
  if ((local_4d8 != (undefined *)0x0) && (local_4d8 != PTR_DAT_1402f8008)) {
    iVar6 = *(int *)(local_4d8 + -8);
  }
  if ((iVar5 < iVar6) || (iVar5 = iVar8, local_4d8 == (undefined *)0x0)) {
LAB_140017bfe:
    if (((local_4d8 != PTR_DAT_1402f8008) && (local_4d8 != (undefined *)0x0)) &&
       (piVar15 = (int *)(local_4d8 + -8), piVar15 != (int *)0x0)) {
      *piVar15 = iVar5;
      *(undefined1 *)((longlong)iVar5 + 8 + (longlong)piVar15) = 0;
    }
  }
  else if (local_4d8 != PTR_DAT_1402f8008) {
    iVar5 = *(int *)(local_4d8 + -8);
    goto LAB_140017bfe;
  }
  local_510 = local_4e4;
  local_518 = &local_4d0;
  local_520 = &local_4cc;
  local_528 = local_4c8;
  (**(code **)(*(longlong *)(param_1 + 0x58) + 0x200))
            ((longlong *)(param_1 + 0x58),uVar3,&DAT_14030ab90,&local_4d8);
  puVar14 = local_4d8;
  if (((local_4d8 != (undefined *)0x0) && (local_4d8 != PTR_DAT_1402f8008)) &&
     (puVar1 = local_4d8 + -8, puVar1 != (undefined *)0x0)) {
    uVar11 = FUN_1400a3440();
    local_478[2] = uVar11;
    FUN_1400a1c30(uVar11);
    local_460 = 1;
    piVar15 = (int *)(puVar14 + -4);
    *piVar15 = *piVar15 + -1;
    if (*piVar15 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar11);
  }
  FUN_1400d1290(lVar17);
LAB_140017e0e:
  FUN_140070e40(&local_4a0);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140017e50(longlong param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  int *piVar1;
  errno_t eVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  longlong *plVar7;
  longlong lVar8;
  undefined8 uVar9;
  undefined *puVar10;
  undefined *puVar11;
  longlong lVar12;
  char *_Src;
  int iVar13;
  undefined1 auStack_188 [32];
  undefined4 *local_168;
  uint *local_160;
  uint *local_158;
  undefined1 *local_150;
  undefined8 local_148;
  undefined8 local_140;
  undefined8 local_138;
  undefined1 local_128 [8];
  undefined *local_120;
  uint local_118;
  uint local_114;
  undefined8 local_110;
  int local_108;
  longlong local_100;
  undefined4 local_f8 [2];
  longlong local_f0;
  undefined1 local_e8;
  __time64_t local_e0;
  char *local_d8;
  DWORD local_d0;
  longlong local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined1 local_b0;
  short local_a8;
  short local_a6;
  undefined2 local_a4;
  short local_a2;
  short local_a0;
  short local_9e;
  short local_9c;
  undefined2 local_9a;
  undefined8 local_98;
  undefined8 local_90;
  tm local_88;
  undefined1 local_60 [8];
  ushort local_58;
  undefined1 local_50 [10];
  ushort local_46;
  ulonglong local_40;
  
  local_c0 = 0xfffffffffffffffe;
  local_40 = DAT_1402f85a0 ^ (ulonglong)auStack_188;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320610 != 1000) {
    return 1;
  }
  local_d8 = "PG_GET_AUTH_ID";
  local_c8 = **(longlong **)(*(longlong *)(param_1 + 0x200) + 8) + 0x68;
  local_d0 = timeGetTime();
  lVar12 = param_1 + 0xe0;
  local_f0 = lVar12;
  FUN_1400a1c30(lVar12);
  local_e8 = 1;
  plVar7 = (longlong *)FUN_14000f1a0(param_1 + -8,&local_100,param_2);
  lVar8 = 0;
  if ((longlong *)*plVar7 != (longlong *)0x0) {
    lVar8 = *(longlong *)*plVar7;
  }
  if ((local_100 != 0) &&
     (*(longlong *)(local_100 + 8) = *(longlong *)(local_100 + 8) + -1, lVar12 = local_f0,
     *(longlong *)(local_100 + 8) == 0)) {
    FUN_1400219e0(local_100);
    lVar12 = local_f0;
  }
  if (lVar8 == 0) {
    FUN_1400d1290(lVar12);
    goto LAB_140018381;
  }
  local_f8[0] = 1;
  *(undefined4 *)(lVar8 + 0x1fc) = 1;
  _Src = (char *)*param_4;
  if ((char *)*param_4 == (char *)0x0) {
    _Src = PTR_DAT_1402f8008;
  }
  strncpy_s((char *)(lVar8 + 0x200),0x32,_Src,0x31);
  *(undefined1 *)(lVar8 + 0x231) = 0;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_1403205d8 == '\0') {
    local_158 = (uint *)(lVar8 + 0x10);
    if (7 < *(ulonglong *)(lVar8 + 0x28)) {
      local_158 = *(uint **)local_158;
    }
    local_168 = (undefined4 *)*param_4;
    if ((undefined *)*param_4 == (undefined *)0x0) {
      local_168 = (undefined4 *)PTR_DAT_1402f8008;
    }
    local_138 = 0;
    local_140 = 0;
    local_148 = 0;
    local_150 = (undefined1 *)CONCAT44(local_150._4_4_,1);
    local_160 = (uint *)CONCAT44(local_160._4_4_,*(undefined4 *)(DAT_140320138 + 0x140));
    (**(code **)(**(longlong **)(param_1 + 0x80) + 8))
              (*(longlong **)(param_1 + 0x80),*(undefined4 *)(lVar8 + 0x1f0),
               *(undefined4 *)(lVar8 + 0x1ec),param_2);
    iVar13 = 0;
    local_118 = 0;
    local_114 = 0;
    lVar8 = FUN_140094270();
    if (*(char *)(lVar8 + 0x11) != '\0') {
      local_e0 = _time64((__time64_t *)0x0);
      local_110 = 0;
      local_108 = 0;
      eVar2 = _localtime64_s(&local_88,&local_e0);
      if (eVar2 == 0) {
        local_a8 = (short)local_88.tm_year + 0x76c;
        local_a6 = (short)local_88.tm_mon + 1;
        local_a4 = (undefined2)local_88.tm_wday;
        local_a2 = (short)local_88.tm_mday;
        local_a0 = (short)local_88.tm_hour;
        local_9e = (short)local_88.tm_min;
        local_9c = (short)local_88.tm_sec;
        local_9a = 0;
        iVar3 = Ordinal_184(&local_a8,&local_110);
        local_98 = 0;
        local_90 = 0;
        if ((((iVar3 == 0) || (iVar3 = Ordinal_185(local_110,&local_98), iVar3 == 0)) ||
            (local_a8 != (short)local_98)) ||
           (((local_a6 != local_98._2_2_ || (local_a2 != local_98._6_2_)) ||
            ((local_a0 != (short)local_90 ||
             ((local_9e != local_90._2_2_ || (local_9c != local_90._4_2_)))))))) goto LAB_140018196;
        local_108 = 0;
        iVar3 = Ordinal_185(local_110,local_60);
        if (iVar3 == 0) goto LAB_140018199;
        local_118 = (uint)local_58;
      }
      else {
LAB_140018196:
        local_108 = 1;
LAB_140018199:
        local_118 = 0xffffffff;
      }
      if ((local_108 == 0) && (iVar3 = Ordinal_185(local_110,local_50), iVar3 != 0)) {
        local_114 = (uint)local_46;
      }
      else {
        local_114 = 0xffffffff;
      }
    }
    lVar8 = FUN_140094270();
    local_128[0] = *(undefined1 *)(lVar8 + 0x11);
    puVar11 = (undefined *)*param_4;
    if ((undefined *)*param_4 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8008;
    }
    FUN_1400a3440();
    local_120 = PTR_DAT_1402f8008;
    iVar4 = FUN_1400a3360(puVar11);
    iVar3 = iVar13;
    if ((local_120 != (undefined *)0x0) && (local_120 != PTR_DAT_1402f8008)) {
      iVar3 = *(int *)(local_120 + -8);
    }
    iVar6 = 0;
    iVar5 = iVar4;
    if (((iVar4 <= iVar3) && (iVar5 = iVar6, local_120 != (undefined *)0x0)) &&
       (local_120 != PTR_DAT_1402f8008)) {
      iVar5 = *(int *)(local_120 + -8);
    }
    iVar3 = 1;
    if (1 < iVar5) {
      iVar3 = iVar5;
    }
    if ((local_120 != (undefined *)0x0) && (local_120 != PTR_DAT_1402f8008)) {
      iVar6 = *(int *)(local_120 + -8);
    }
    if (iVar6 < iVar3) {
      FUN_14000c1c0(&local_120,iVar3);
    }
    FUN_14000c330(&local_120);
    puVar10 = local_120;
    if (local_120 == (undefined *)0x0) {
      puVar10 = PTR_DAT_1402f8008;
    }
    FUN_1400a3390(puVar10,puVar11,iVar4);
    puVar11 = local_120;
    if (local_120 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8008;
    }
    iVar4 = FUN_1400a3360(puVar11);
    iVar3 = 0;
    if (0 < iVar4) {
      iVar3 = iVar4;
    }
    iVar4 = iVar13;
    if ((local_120 != (undefined *)0x0) && (local_120 != PTR_DAT_1402f8008)) {
      iVar4 = *(int *)(local_120 + -8);
    }
    if ((iVar3 < iVar4) || (iVar3 = iVar13, local_120 == (undefined *)0x0)) {
LAB_1400182cc:
      if (((local_120 != PTR_DAT_1402f8008) && (local_120 != (undefined *)0x0)) &&
         (piVar1 = (int *)(local_120 + -8), piVar1 != (int *)0x0)) {
        *piVar1 = iVar3;
        *(undefined1 *)((longlong)iVar3 + 8 + (longlong)piVar1) = 0;
      }
    }
    else if (local_120 != PTR_DAT_1402f8008) {
      iVar3 = *(int *)(local_120 + -8);
      goto LAB_1400182cc;
    }
    local_150 = local_128;
    local_158 = &local_114;
    local_160 = &local_118;
    local_168 = local_f8;
    (**(code **)(*(longlong *)(param_1 + 0x58) + 0x200))
              ((longlong *)(param_1 + 0x58),param_2,&DAT_14030ab90,&local_120);
    puVar11 = local_120;
    if (((local_120 != (undefined *)0x0) && (local_120 != PTR_DAT_1402f8008)) &&
       (puVar10 = local_120 + -8, puVar10 != (undefined *)0x0)) {
      uVar9 = FUN_1400a3440();
      local_b8 = uVar9;
      FUN_1400a1c30(uVar9);
      local_b0 = 1;
      piVar1 = (int *)(puVar11 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar10);
      }
      FUN_1400d1290(uVar9);
    }
  }
  else {
    local_168 = (undefined4 *)*param_4;
    if ((undefined4 *)*param_4 == (undefined4 *)0x0) {
      local_168 = (undefined4 *)PTR_DAT_1402f8008;
    }
    local_160 = (uint *)CONCAT44(local_160._4_4_,*(undefined4 *)(DAT_140320138 + 0x140));
    (**(code **)**(undefined8 **)(param_1 + 0x80))
              (*(undefined8 **)(param_1 + 0x80),*(undefined4 *)(lVar8 + 0x1f0),
               *(undefined4 *)(lVar8 + 0x1ec),param_2);
  }
  FUN_1400d1290(lVar12);
LAB_140018381:
  FUN_140070e40(&local_d8);
  return 1;
}



undefined1 FUN_1400183c0(void)

{
  return 1;
}



undefined8 FUN_1400183d0(longlong param_1,undefined4 param_2,undefined8 param_3,int *param_4)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  longlong *plVar6;
  longlong lVar7;
  undefined8 uVar8;
  undefined *puVar9;
  int iVar10;
  longlong lVar11;
  int local_res8 [2];
  undefined4 local_res10;
  undefined *local_88;
  longlong local_80 [3];
  undefined1 local_68;
  undefined8 local_60;
  undefined1 local_58;
  char *local_50;
  DWORD local_48;
  longlong local_40;
  
  local_80[1] = 0xfffffffffffffffe;
  local_50 = "PG_GAME_CHANNEL_INFO";
  local_40 = **(longlong **)(*(longlong *)(param_1 + 0x200) + 8) + 0x68;
  local_res10 = param_2;
  local_48 = timeGetTime();
  lVar11 = param_1 + 0xe0;
  local_80[2] = lVar11;
  FUN_1400a1c30(lVar11);
  local_68 = 1;
  plVar6 = (longlong *)FUN_14000f1a0(param_1 + -8,local_80,param_2);
  lVar7 = 0;
  if ((longlong *)*plVar6 != (longlong *)0x0) {
    lVar7 = *(longlong *)*plVar6;
  }
  if ((local_80[0] != 0) &&
     (*(longlong *)(local_80[0] + 8) = *(longlong *)(local_80[0] + 8) + -1, lVar11 = local_80[2],
     *(longlong *)(local_80[0] + 8) == 0)) {
    FUN_1400219e0(local_80[0]);
    lVar11 = local_80[2];
  }
  if (lVar7 == 0) {
    FUN_1400d1290(lVar11);
  }
  else {
    local_res8[0] = 0;
    iVar10 = 0;
    lVar7 = FUN_14008feb0();
    if (0 < (int)((*(longlong *)(lVar7 + 0x10) - *(longlong *)(lVar7 + 8)) / 0x48)) {
      do {
        lVar7 = FUN_14008feb0();
        param_2 = local_res10;
        if ((((*(longlong *)(lVar7 + 8) != *(longlong *)(lVar7 + 0x10)) && (-1 < iVar10)) &&
            (iVar10 < (int)((*(longlong *)(lVar7 + 0x10) - *(longlong *)(lVar7 + 8)) / 0x48))) &&
           ((lVar7 = *(longlong *)(lVar7 + 8) + (longlong)iVar10 * 0x48, lVar7 != 0 &&
            (*(int *)(lVar7 + 4) == *param_4)))) {
          local_res8[0] = local_res8[0] + 1;
          plVar6 = (longlong *)(lVar7 + 0x18);
          if (7 < *(ulonglong *)(lVar7 + 0x30)) {
            plVar6 = (longlong *)*plVar6;
          }
          FUN_1400a3440();
          local_88 = PTR_DAT_1402f8010;
          iVar3 = FUN_1400a32c0(plVar6);
          if (local_88 == (undefined *)0x0) {
            iVar5 = 0;
          }
          else if (local_88 == PTR_DAT_1402f8010) {
            iVar5 = 0;
          }
          else {
            iVar5 = *(int *)(local_88 + -8);
          }
          iVar4 = iVar3;
          if (iVar3 <= iVar5) {
            if (local_88 == (undefined *)0x0) {
              iVar4 = 0;
            }
            else if (local_88 == PTR_DAT_1402f8010) {
              iVar4 = 0;
            }
            else {
              iVar4 = *(int *)(local_88 + -8);
            }
          }
          iVar5 = 1;
          if (1 < iVar4) {
            iVar5 = iVar4;
          }
          if (local_88 == (undefined *)0x0) {
            iVar4 = 0;
          }
          else if (local_88 == PTR_DAT_1402f8010) {
            iVar4 = 0;
          }
          else {
            iVar4 = *(int *)(local_88 + -8);
          }
          if (iVar4 < iVar5) {
            FUN_140002d50(&local_88);
          }
          FUN_140002e30(&local_88);
          puVar9 = local_88;
          if (local_88 == (undefined *)0x0) {
            puVar9 = PTR_DAT_1402f8010;
          }
          FUN_1400a32f0(puVar9,plVar6,iVar3);
          puVar9 = local_88;
          if (local_88 == (undefined *)0x0) {
            puVar9 = PTR_DAT_1402f8010;
          }
          iVar5 = FUN_1400a32c0(puVar9);
          param_2 = local_res10;
          iVar3 = 0;
          if (0 < iVar5) {
            iVar3 = iVar5;
          }
          iVar5 = 0;
          if ((local_88 != (undefined *)0x0) && (iVar5 = 0, local_88 != PTR_DAT_1402f8010)) {
            iVar5 = *(int *)(local_88 + -8);
          }
          if ((iVar3 < iVar5) || (iVar3 = 0, local_88 == (undefined *)0x0)) {
LAB_140018639:
            if (((local_88 != PTR_DAT_1402f8010) && (local_88 != (undefined *)0x0)) &&
               ((int *)(local_88 + -8) != (int *)0x0)) {
              *(int *)(local_88 + -8) = iVar3;
              *(undefined2 *)(local_88 + (longlong)iVar3 * 2) = 0;
            }
          }
          else if (local_88 != PTR_DAT_1402f8010) {
            iVar3 = *(int *)(local_88 + -8);
            goto LAB_140018639;
          }
          (**(code **)(*(longlong *)(param_1 + 0x58) + 0xc0))
                    ((longlong *)(param_1 + 0x58),local_res10,&DAT_14030ab90,lVar7 + 4,lVar7 + 8,
                     &local_88);
          puVar9 = local_88;
          if (((local_88 != (undefined *)0x0) &&
              (param_2 = local_res10, local_88 != PTR_DAT_1402f8010)) &&
             (puVar1 = local_88 + -8, puVar1 != (undefined *)0x0)) {
            uVar8 = FUN_1400a3440();
            local_60 = uVar8;
            FUN_1400a1c30(uVar8);
            local_58 = 1;
            piVar2 = (int *)(puVar9 + -4);
            *piVar2 = *piVar2 + -1;
            if (*piVar2 == 0) {
              FUN_1400a3530(puVar1);
            }
            FUN_1400d1290(uVar8);
            local_58 = 0;
            param_2 = local_res10;
          }
          local_88 = PTR_DAT_1402f8010;
        }
        iVar10 = iVar10 + 1;
        lVar7 = FUN_14008feb0();
      } while (iVar10 < (int)((*(longlong *)(lVar7 + 0x10) - *(longlong *)(lVar7 + 8)) / 0x48));
    }
    (**(code **)(*(longlong *)(param_1 + 0x58) + 0xf0))
              ((longlong *)(param_1 + 0x58),param_2,&DAT_14030ab90,local_res8);
    FUN_1400d1290(lVar11);
  }
  FUN_140070e40(&local_50);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140018770(longlong param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined *puVar1;
  int *piVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  longlong *plVar7;
  longlong lVar8;
  undefined8 uVar9;
  ulonglong uVar10;
  undefined *puVar11;
  int iVar12;
  int iVar13;
  char *pcVar14;
  wchar_t ****_Src;
  wchar_t *_Src_00;
  longlong lVar15;
  undefined1 auStack_278 [32];
  longlong local_258;
  undefined **local_250;
  longlong local_248;
  undefined **local_240;
  int *local_238;
  longlong local_230;
  longlong local_228;
  undefined *local_218;
  undefined *local_210;
  int local_208 [2];
  undefined *local_200;
  undefined *local_1f8;
  undefined4 local_1f0;
  undefined4 local_1ec;
  longlong local_1e8;
  longlong local_1e0;
  undefined1 local_1d8;
  undefined8 local_1d0;
  undefined8 local_1c8;
  undefined1 local_1c0;
  undefined8 local_1b8;
  undefined1 local_1b0;
  undefined8 local_1a8;
  undefined1 local_1a0;
  undefined8 local_198;
  undefined1 local_190;
  undefined1 local_188;
  undefined7 uStack_187;
  undefined8 local_178;
  ulonglong local_170;
  wchar_t ***local_160 [3];
  ulonglong local_148;
  undefined4 local_138;
  undefined4 local_134;
  undefined4 local_130;
  undefined4 local_12c;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined8 local_10c;
  undefined8 local_104;
  undefined4 local_fc;
  wchar_t local_f8 [12];
  ulonglong local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  wchar_t local_b8 [49];
  undefined2 local_56;
  ulonglong local_48;
  
  local_1d0 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_278;
  lVar15 = param_1 + 0xe0;
  local_1f0 = param_2;
  local_1e0 = lVar15;
  FUN_1400a1c30(lVar15);
  local_1d8 = 1;
  plVar7 = (longlong *)FUN_14000f1a0(param_1 + -8,&local_1e8,param_2);
  lVar8 = 0;
  if ((longlong *)*plVar7 != (longlong *)0x0) {
    lVar8 = *(longlong *)*plVar7;
  }
  if ((local_1e8 != 0) &&
     (*(longlong *)(local_1e8 + 8) = *(longlong *)(local_1e8 + 8) + -1, lVar15 = local_1e0,
     *(longlong *)(local_1e8 + 8) == 0)) {
    FUN_1400219e0(local_1e8);
    lVar15 = local_1e0;
  }
  if (lVar8 == 0) goto LAB_14001905c;
  local_120 = 0;
  local_11c = 0;
  local_118 = 0;
  local_114 = 0;
  local_110 = 0;
  local_10c = 0;
  local_104 = 0;
  local_fc = 0;
  local_f8[0] = L'\0';
  local_f8[1] = L'\0';
  local_f8[2] = L'\0';
  local_f8[3] = L'\0';
  local_f8[4] = L'\0';
  local_f8[5] = L'\0';
  local_f8[6] = L'\0';
  local_f8[7] = L'\0';
  local_f8[8] = L'\0';
  local_f8[9] = L'\0';
  local_f8[10] = L'\0';
  local_f8[0xb] = L'\0';
  local_e0 = 0;
  local_d8 = 0;
  local_d0 = 0;
  local_c8 = 0;
  local_c0 = 0;
  memset(local_b8,0,100);
  local_138 = 1;
  local_134 = *param_4;
  local_130 = *(undefined4 *)(lVar8 + 0x48);
  local_12c = *(undefined4 *)(lVar8 + 0x4c);
  local_128 = *(undefined4 *)(lVar8 + 0x50);
  local_124 = *(undefined4 *)(lVar8 + 0x54);
  local_170 = 0xf;
  local_178 = 0;
  local_188 = 0;
  uVar10 = 0xffffffffffffffff;
  pcVar14 = (char *)(lVar8 + 0x200);
  do {
    if (uVar10 == 0) break;
    uVar10 = uVar10 - 1;
    cVar3 = *pcVar14;
    pcVar14 = pcVar14 + 1;
  } while (cVar3 != '\0');
  FUN_140003e60(&local_188,(char *)(lVar8 + 0x200),~uVar10 - 1);
  FUN_1401e1d60(local_160,&local_188);
  if (0xf < local_170) {
    operator_delete((void *)CONCAT71(uStack_187,local_188));
  }
  local_170 = 0xf;
  local_178 = 0;
  local_188 = 0;
  _Src = local_160;
  if (7 < local_148) {
    _Src = (wchar_t ****)local_160[0];
  }
  wcscpy_s(local_b8,0x32,(wchar_t *)_Src);
  _Src_00 = (wchar_t *)(lVar8 + 0x10);
  if (7 < *(ulonglong *)(lVar8 + 0x28)) {
    _Src_00 = *(wchar_t **)_Src_00;
  }
  wcscpy_s(local_f8,0x10,_Src_00);
  local_56 = 0;
  local_e0 = local_e0 & 0xffffffffffff;
  (**(code **)(**(longlong **)(param_1 + 0x80) + 0x30))
            (*(longlong **)(param_1 + 0x80),*(undefined4 *)(lVar8 + 0x1f0),
             *(undefined4 *)(lVar8 + 0x1ec),&local_138);
  if (7 < local_148) {
    operator_delete(local_160[0]);
  }
  (**(code **)(**(longlong **)(param_1 + 0x80) + 0x70))();
  local_208[0] = 0;
  lVar8 = FUN_14001aa60(param_1 + -8,*param_4);
  if ((lVar8 == 0) || (local_208[0] < 1)) {
    (**(code **)(**(longlong **)(param_1 + 0x80) + 0x78))();
    local_1ec = 0x10;
    (**(code **)(*(longlong *)(param_1 + 0x58) + 0xe0))
              ((longlong *)(param_1 + 0x58),local_1f0,&DAT_14030ab90,&local_1ec);
    goto LAB_14001905c;
  }
  iVar13 = 1;
  if (*(char *)(DAT_140320138 + 0x151) == '\0') {
    FUN_1400a3440();
    local_200 = PTR_DAT_1402f8010;
    iVar4 = FUN_1400a32c0(lVar8 + 0x24);
    iVar12 = 0;
    iVar6 = iVar12;
    if ((local_200 != (undefined *)0x0) && (local_200 != PTR_DAT_1402f8010)) {
      iVar6 = *(int *)(local_200 + -8);
    }
    iVar5 = 0;
    if (((iVar4 <= iVar6) && (iVar4 = iVar12, local_200 != (undefined *)0x0)) &&
       (iVar4 = iVar5, local_200 != PTR_DAT_1402f8010)) {
      iVar4 = *(int *)(local_200 + -8);
    }
    iVar6 = 1;
    if (1 < iVar4) {
      iVar6 = iVar4;
    }
    if ((local_200 != (undefined *)0x0) && (local_200 != PTR_DAT_1402f8010)) {
      iVar5 = *(int *)(local_200 + -8);
    }
    if (iVar5 < iVar6) {
      FUN_140002d50(&local_200);
    }
    FUN_140002e30(&local_200);
    puVar11 = local_200;
    if (local_200 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar11,lVar8 + 0x24);
    puVar11 = local_200;
    if (local_200 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8010;
    }
    iVar4 = FUN_1400a32c0(puVar11);
    iVar12 = 0;
    iVar6 = iVar12;
    if (0 < iVar4) {
      iVar6 = iVar4;
    }
    iVar4 = iVar12;
    if ((local_200 != (undefined *)0x0) && (iVar4 = 0, local_200 != PTR_DAT_1402f8010)) {
      iVar4 = *(int *)(local_200 + -8);
    }
    if ((iVar6 < iVar4) || (iVar6 = iVar12, local_200 == (undefined *)0x0)) {
LAB_140018df6:
      if (((local_200 != PTR_DAT_1402f8010) && (local_200 != (undefined *)0x0)) &&
         ((int *)(local_200 + -8) != (int *)0x0)) {
        *(int *)(local_200 + -8) = iVar6;
        *(undefined2 *)(local_200 + (longlong)iVar6 * 2) = 0;
      }
    }
    else if (local_200 != PTR_DAT_1402f8010) {
      iVar6 = *(int *)(local_200 + -8);
      goto LAB_140018df6;
    }
    FUN_1400a3440();
    local_218 = PTR_DAT_1402f8010;
    iVar4 = FUN_1400a32c0(lVar8 + 4);
    iVar12 = 0;
    iVar6 = iVar12;
    if ((local_218 != (undefined *)0x0) && (local_218 != PTR_DAT_1402f8010)) {
      iVar6 = *(int *)(local_218 + -8);
    }
    if (((iVar4 <= iVar6) && (iVar4 = iVar12, local_218 != (undefined *)0x0)) &&
       (local_218 != PTR_DAT_1402f8010)) {
      iVar4 = *(int *)(local_218 + -8);
    }
    if (1 < iVar4) {
      iVar13 = iVar4;
    }
    iVar6 = 0;
    if ((local_218 != (undefined *)0x0) && (local_218 != PTR_DAT_1402f8010)) {
      iVar6 = *(int *)(local_218 + -8);
    }
    if (iVar6 < iVar13) {
      FUN_140002d50(&local_218,iVar13);
    }
    FUN_140002e30(&local_218);
    puVar11 = local_218;
    if (local_218 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar11,lVar8 + 4);
    puVar11 = local_218;
    if (local_218 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8010;
    }
    iVar6 = FUN_1400a32c0(puVar11);
    iVar13 = 0;
    if (0 < iVar6) {
      iVar13 = iVar6;
    }
    iVar6 = 0;
    if ((local_218 != (undefined *)0x0) && (iVar6 = 0, local_218 != PTR_DAT_1402f8010)) {
      iVar6 = *(int *)(local_218 + -8);
    }
    if ((iVar13 < iVar6) || (iVar13 = 0, local_218 == (undefined *)0x0)) {
LAB_140018f00:
      if (((local_218 != PTR_DAT_1402f8010) && (local_218 != (undefined *)0x0)) &&
         ((int *)(local_218 + -8) != (int *)0x0)) {
        *(int *)(local_218 + -8) = iVar13;
        *(undefined2 *)(local_218 + (longlong)iVar13 * 2) = 0;
      }
    }
    else if (local_218 != PTR_DAT_1402f8010) {
      iVar13 = *(int *)(local_218 + -8);
      goto LAB_140018f00;
    }
    local_228 = lVar8 + 0x68;
    local_230 = lVar8 + 0x7c;
    local_248 = lVar8 + 0x6c;
    local_258 = lVar8 + 0x70;
    local_238 = local_208;
    local_240 = &local_200;
    local_250 = &local_218;
    (**(code **)(*(longlong *)(param_1 + 0x58) + 0xb0))
              (param_1 + 0x58,local_1f0,&DAT_14030ab90,lVar8);
    puVar11 = local_218;
    if (((local_218 != (undefined *)0x0) && (local_218 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_218 + -8, puVar1 != (undefined *)0x0)) {
      uVar9 = FUN_1400a3440();
      local_1a8 = uVar9;
      FUN_1400a1c30(uVar9);
      local_1a0 = 1;
      piVar2 = (int *)(puVar11 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar9);
    }
    puVar11 = local_200;
    local_218 = PTR_DAT_1402f8010;
    if (((local_200 != (undefined *)0x0) && (local_200 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_200 + -8, puVar1 != (undefined *)0x0)) {
      uVar9 = FUN_1400a3440();
      local_1c8 = uVar9;
      FUN_1400a1c30(uVar9);
      local_1c0 = 1;
      piVar2 = (int *)(puVar11 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      goto LAB_140019014;
    }
  }
  else {
    FUN_1400a3440();
    local_1f8 = PTR_DAT_1402f8010;
    iVar4 = FUN_1400a32c0(lVar8 + 0x24);
    iVar12 = 0;
    iVar6 = iVar12;
    if ((local_1f8 != (undefined *)0x0) && (local_1f8 != PTR_DAT_1402f8010)) {
      iVar6 = *(int *)(local_1f8 + -8);
    }
    iVar5 = 0;
    if (((iVar4 <= iVar6) && (iVar4 = iVar12, local_1f8 != (undefined *)0x0)) &&
       (iVar4 = iVar5, local_1f8 != PTR_DAT_1402f8010)) {
      iVar4 = *(int *)(local_1f8 + -8);
    }
    iVar6 = iVar13;
    if (1 < iVar4) {
      iVar6 = iVar4;
    }
    if ((local_1f8 != (undefined *)0x0) && (local_1f8 != PTR_DAT_1402f8010)) {
      iVar5 = *(int *)(local_1f8 + -8);
    }
    if (iVar5 < iVar6) {
      FUN_140002d50(&local_1f8);
    }
    FUN_140002e30(&local_1f8);
    puVar11 = local_1f8;
    if (local_1f8 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar11,lVar8 + 0x24);
    puVar11 = local_1f8;
    if (local_1f8 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8010;
    }
    iVar4 = FUN_1400a32c0(puVar11);
    iVar12 = 0;
    iVar6 = iVar12;
    if (0 < iVar4) {
      iVar6 = iVar4;
    }
    iVar4 = iVar12;
    if ((local_1f8 != (undefined *)0x0) && (iVar4 = 0, local_1f8 != PTR_DAT_1402f8010)) {
      iVar4 = *(int *)(local_1f8 + -8);
    }
    if ((iVar6 < iVar4) || (iVar6 = iVar12, local_1f8 == (undefined *)0x0)) {
LAB_140018ad8:
      if (((local_1f8 != PTR_DAT_1402f8010) && (local_1f8 != (undefined *)0x0)) &&
         ((int *)(local_1f8 + -8) != (int *)0x0)) {
        *(int *)(local_1f8 + -8) = iVar6;
        *(undefined2 *)(local_1f8 + (longlong)iVar6 * 2) = 0;
      }
    }
    else if (local_1f8 != PTR_DAT_1402f8010) {
      iVar6 = *(int *)(local_1f8 + -8);
      goto LAB_140018ad8;
    }
    FUN_1400a3440();
    local_210 = PTR_DAT_1402f8010;
    iVar4 = FUN_1400a32c0(lVar8 + 0x8e);
    iVar12 = 0;
    iVar6 = iVar12;
    if ((local_210 != (undefined *)0x0) && (local_210 != PTR_DAT_1402f8010)) {
      iVar6 = *(int *)(local_210 + -8);
    }
    if (((iVar4 <= iVar6) && (iVar4 = iVar12, local_210 != (undefined *)0x0)) &&
       (local_210 != PTR_DAT_1402f8010)) {
      iVar4 = *(int *)(local_210 + -8);
    }
    if (1 < iVar4) {
      iVar13 = iVar4;
    }
    iVar6 = 0;
    if ((local_210 != (undefined *)0x0) && (local_210 != PTR_DAT_1402f8010)) {
      iVar6 = *(int *)(local_210 + -8);
    }
    if (iVar6 < iVar13) {
      FUN_140002d50(&local_210,iVar13);
    }
    FUN_140002e30(&local_210);
    puVar11 = local_210;
    if (local_210 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar11,lVar8 + 0x8e);
    puVar11 = local_210;
    if (local_210 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8010;
    }
    iVar6 = FUN_1400a32c0(puVar11);
    iVar13 = 0;
    if (0 < iVar6) {
      iVar13 = iVar6;
    }
    iVar6 = 0;
    if ((local_210 != (undefined *)0x0) && (iVar6 = 0, local_210 != PTR_DAT_1402f8010)) {
      iVar6 = *(int *)(local_210 + -8);
    }
    if ((iVar13 < iVar6) || (iVar13 = 0, local_210 == (undefined *)0x0)) {
LAB_140018be8:
      if (((local_210 != PTR_DAT_1402f8010) && (local_210 != (undefined *)0x0)) &&
         ((int *)(local_210 + -8) != (int *)0x0)) {
        *(int *)(local_210 + -8) = iVar13;
        *(undefined2 *)(local_210 + (longlong)iVar13 * 2) = 0;
      }
    }
    else if (local_210 != PTR_DAT_1402f8010) {
      iVar13 = *(int *)(local_210 + -8);
      goto LAB_140018be8;
    }
    local_228 = lVar8 + 0x68;
    local_230 = lVar8 + 0x7c;
    local_248 = lVar8 + 0x6c;
    local_258 = lVar8 + 0x70;
    local_238 = local_208;
    local_240 = &local_1f8;
    local_250 = &local_210;
    (**(code **)(*(longlong *)(param_1 + 0x58) + 0xb0))
              (param_1 + 0x58,local_1f0,&DAT_14030ab90,lVar8);
    puVar11 = local_210;
    if (((local_210 != (undefined *)0x0) && (local_210 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_210 + -8, puVar1 != (undefined *)0x0)) {
      uVar9 = FUN_1400a3440();
      local_1b8 = uVar9;
      FUN_1400a1c30(uVar9);
      local_1b0 = 1;
      piVar2 = (int *)(puVar11 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar9);
    }
    puVar11 = local_1f8;
    local_210 = PTR_DAT_1402f8010;
    if (((local_1f8 != (undefined *)0x0) && (local_1f8 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_1f8 + -8, puVar1 != (undefined *)0x0)) {
      uVar9 = FUN_1400a3440();
      local_198 = uVar9;
      FUN_1400a1c30(uVar9);
      local_190 = 1;
      piVar2 = (int *)(puVar11 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
LAB_140019014:
      FUN_1400d1290(uVar9);
    }
  }
  (**(code **)(**(longlong **)(param_1 + 0x80) + 0x78))();
LAB_14001905c:
  FUN_1400d1290(lVar15);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140019090(longlong param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined *puVar1;
  int *piVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  longlong *plVar8;
  longlong lVar9;
  undefined8 uVar10;
  undefined *puVar11;
  ulonglong uVar12;
  int iVar13;
  char *pcVar14;
  wchar_t ****_Src;
  wchar_t *_Src_00;
  longlong lVar15;
  longlong lVar16;
  undefined1 auStack_288 [32];
  longlong local_268;
  undefined **local_260;
  longlong local_258;
  undefined **local_250;
  int *local_248;
  longlong local_240;
  longlong local_238;
  int local_228 [2];
  undefined *local_220;
  undefined *local_218;
  undefined *local_210;
  undefined *local_208;
  undefined4 local_200;
  undefined4 local_1fc;
  longlong local_1f8;
  undefined4 *local_1f0;
  longlong local_1e8;
  undefined1 local_1e0;
  undefined8 local_1d8;
  undefined1 local_1d0;
  undefined8 local_1c8;
  undefined1 local_1c0;
  undefined8 local_1b8;
  undefined1 local_1b0;
  undefined8 local_1a8;
  undefined8 local_1a0;
  undefined1 local_198;
  undefined1 local_190;
  undefined7 uStack_18f;
  undefined8 local_180;
  ulonglong local_178;
  wchar_t ***local_168 [3];
  ulonglong local_150;
  undefined4 local_138;
  undefined4 local_134;
  undefined4 local_130;
  undefined4 local_12c;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined8 local_10c;
  int local_104;
  undefined8 local_100;
  wchar_t local_f8 [12];
  ulonglong local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  wchar_t local_b8 [49];
  undefined2 local_56;
  ulonglong local_48;
  
  local_1a8 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_288;
  lVar15 = param_1 + 0xe0;
  local_200 = param_2;
  local_1f0 = param_4;
  local_1e8 = lVar15;
  FUN_1400a1c30(lVar15);
  local_1e0 = 1;
  plVar8 = (longlong *)FUN_14000f1a0(param_1 + -8,&local_1f8,param_2);
  if ((longlong *)*plVar8 == (longlong *)0x0) {
    lVar16 = 0;
  }
  else {
    lVar16 = *(longlong *)*plVar8;
  }
  if ((local_1f8 != 0) &&
     (*(longlong *)(local_1f8 + 8) = *(longlong *)(local_1f8 + 8) + -1, lVar15 = local_1e8,
     *(longlong *)(local_1f8 + 8) == 0)) {
    FUN_1400219e0(local_1f8);
    lVar15 = local_1e8;
  }
  if (lVar16 == 0) goto LAB_1400199ab;
  (**(code **)(**(longlong **)(param_1 + 0x80) + 0x70))();
  local_228[0] = 0;
  lVar9 = FUN_14001aa60(param_1 + -8,*param_4);
  if ((lVar9 == 0) || (local_228[0] < 1)) {
    (**(code **)(**(longlong **)(param_1 + 0x80) + 0x78))();
    local_1fc = 0x10;
    (**(code **)(*(longlong *)(param_1 + 0x58) + 0xe0))
              ((longlong *)(param_1 + 0x58),param_2,&DAT_14030ab90,&local_1fc);
    goto LAB_1400199ab;
  }
  if (*(char *)(DAT_140320138 + 0x151) == '\0') {
    FUN_1400a3440();
    local_208 = PTR_DAT_1402f8010;
    iVar5 = FUN_1400a32c0(lVar9 + 0x24);
    iVar13 = 0;
    iVar4 = iVar13;
    if ((local_208 != (undefined *)0x0) && (local_208 != PTR_DAT_1402f8010)) {
      iVar4 = *(int *)(local_208 + -8);
    }
    iVar6 = 0;
    if (((iVar5 <= iVar4) && (iVar5 = iVar13, local_208 != (undefined *)0x0)) &&
       (iVar5 = iVar6, local_208 != PTR_DAT_1402f8010)) {
      iVar5 = *(int *)(local_208 + -8);
    }
    iVar4 = 1;
    if (1 < iVar5) {
      iVar4 = iVar5;
    }
    if ((local_208 != (undefined *)0x0) && (local_208 != PTR_DAT_1402f8010)) {
      iVar6 = *(int *)(local_208 + -8);
    }
    if (iVar6 < iVar4) {
      FUN_140002d50(&local_208);
    }
    FUN_140002e30(&local_208);
    puVar11 = local_208;
    if (local_208 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar11,lVar9 + 0x24);
    puVar11 = local_208;
    if (local_208 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8010;
    }
    iVar5 = FUN_1400a32c0(puVar11);
    iVar13 = 0;
    iVar4 = iVar13;
    if (0 < iVar5) {
      iVar4 = iVar5;
    }
    iVar5 = iVar13;
    if ((local_208 != (undefined *)0x0) && (iVar5 = 0, local_208 != PTR_DAT_1402f8010)) {
      iVar5 = *(int *)(local_208 + -8);
    }
    if ((iVar4 < iVar5) || (iVar4 = iVar13, local_208 == (undefined *)0x0)) {
LAB_1400195ad:
      if (((local_208 != PTR_DAT_1402f8010) && (local_208 != (undefined *)0x0)) &&
         ((int *)(local_208 + -8) != (int *)0x0)) {
        *(int *)(local_208 + -8) = iVar4;
        *(undefined2 *)(local_208 + (longlong)iVar4 * 2) = 0;
      }
    }
    else if (local_208 != PTR_DAT_1402f8010) {
      iVar4 = *(int *)(local_208 + -8);
      goto LAB_1400195ad;
    }
    FUN_1400a3440();
    local_218 = PTR_DAT_1402f8010;
    iVar5 = FUN_1400a32c0(lVar9 + 4);
    iVar13 = 0;
    iVar4 = iVar13;
    if ((local_218 != (undefined *)0x0) && (local_218 != PTR_DAT_1402f8010)) {
      iVar4 = *(int *)(local_218 + -8);
    }
    iVar7 = 0;
    iVar6 = iVar5;
    if (((iVar5 <= iVar4) && (iVar6 = iVar13, local_218 != (undefined *)0x0)) &&
       (iVar6 = iVar7, local_218 != PTR_DAT_1402f8010)) {
      iVar6 = *(int *)(local_218 + -8);
    }
    iVar4 = 1;
    if (1 < iVar6) {
      iVar4 = iVar6;
    }
    if ((local_218 != (undefined *)0x0) && (local_218 != PTR_DAT_1402f8010)) {
      iVar7 = *(int *)(local_218 + -8);
    }
    if (iVar7 < iVar4) {
      FUN_140002d50(&local_218);
    }
    FUN_140002e30(&local_218);
    puVar11 = local_218;
    if (local_218 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar11,lVar9 + 4,iVar5);
    puVar11 = local_218;
    if (local_218 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8010;
    }
    iVar5 = FUN_1400a32c0(puVar11);
    iVar13 = 0;
    iVar4 = 0;
    if (0 < iVar5) {
      iVar4 = iVar5;
    }
    iVar5 = iVar13;
    if ((local_218 != (undefined *)0x0) && (local_218 != PTR_DAT_1402f8010)) {
      iVar5 = *(int *)(local_218 + -8);
    }
    if ((iVar4 < iVar5) || (iVar4 = iVar13, local_218 == (undefined *)0x0)) {
LAB_1400196b6:
      if (((local_218 != PTR_DAT_1402f8010) && (local_218 != (undefined *)0x0)) &&
         ((int *)(local_218 + -8) != (int *)0x0)) {
        *(int *)(local_218 + -8) = iVar4;
        *(undefined2 *)(local_218 + (longlong)iVar4 * 2) = 0;
      }
    }
    else if (local_218 != PTR_DAT_1402f8010) {
      iVar4 = *(int *)(local_218 + -8);
      goto LAB_1400196b6;
    }
    local_238 = lVar9 + 0x68;
    local_240 = lVar9 + 0x7c;
    local_258 = lVar9 + 0x6c;
    local_268 = lVar9 + 0x70;
    local_248 = local_228;
    local_250 = &local_208;
    local_260 = &local_218;
    (**(code **)(*(longlong *)(param_1 + 0x58) + 0xb0))
              (param_1 + 0x58,local_200,&DAT_14030ab90,lVar9);
    puVar11 = local_218;
    if (((local_218 != (undefined *)0x0) && (local_218 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_218 + -8, puVar1 != (undefined *)0x0)) {
      uVar10 = FUN_1400a3440();
      local_1d8 = uVar10;
      FUN_1400a1c30(uVar10);
      local_1d0 = 1;
      piVar2 = (int *)(puVar11 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar10);
    }
    puVar11 = local_208;
    local_218 = PTR_DAT_1402f8010;
    if (((local_208 != (undefined *)0x0) && (local_208 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_208 + -8, puVar1 != (undefined *)0x0)) {
      uVar10 = FUN_1400a3440();
      local_1c8 = uVar10;
      FUN_1400a1c30(uVar10);
      local_1c0 = 1;
      piVar2 = (int *)(puVar11 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      goto LAB_1400197cb;
    }
  }
  else {
    FUN_1400a3440();
    local_210 = PTR_DAT_1402f8010;
    iVar4 = FUN_1400a32c0(lVar9 + 0x24);
    if (local_210 == (undefined *)0x0) {
      iVar5 = 0;
    }
    else if (local_210 == PTR_DAT_1402f8010) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(local_210 + -8);
    }
    if (iVar4 <= iVar5) {
      if (local_210 == (undefined *)0x0) {
        iVar4 = 0;
      }
      else if (local_210 == PTR_DAT_1402f8010) {
        iVar4 = 0;
      }
      else {
        iVar4 = *(int *)(local_210 + -8);
      }
    }
    iVar5 = 1;
    if (1 < iVar4) {
      iVar5 = iVar4;
    }
    if (local_210 == (undefined *)0x0) {
      iVar4 = 0;
    }
    else if (local_210 == PTR_DAT_1402f8010) {
      iVar4 = 0;
    }
    else {
      iVar4 = *(int *)(local_210 + -8);
    }
    if (iVar4 < iVar5) {
      FUN_140002d50(&local_210);
    }
    FUN_140002e30(&local_210);
    puVar11 = local_210;
    if (local_210 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar11,lVar9 + 0x24);
    puVar11 = local_210;
    if (local_210 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8010;
    }
    iVar5 = FUN_1400a32c0(puVar11);
    iVar13 = 0;
    iVar4 = iVar13;
    if (0 < iVar5) {
      iVar4 = iVar5;
    }
    iVar5 = iVar13;
    if ((local_210 != (undefined *)0x0) && (iVar5 = 0, local_210 != PTR_DAT_1402f8010)) {
      iVar5 = *(int *)(local_210 + -8);
    }
    if ((iVar4 < iVar5) || (iVar4 = iVar13, local_210 == (undefined *)0x0)) {
LAB_14001928e:
      if (((local_210 != PTR_DAT_1402f8010) && (local_210 != (undefined *)0x0)) &&
         ((int *)(local_210 + -8) != (int *)0x0)) {
        *(int *)(local_210 + -8) = iVar4;
        *(undefined2 *)(local_210 + (longlong)iVar4 * 2) = 0;
      }
    }
    else if (local_210 != PTR_DAT_1402f8010) {
      iVar4 = *(int *)(local_210 + -8);
      goto LAB_14001928e;
    }
    FUN_1400a3440();
    local_220 = PTR_DAT_1402f8010;
    iVar5 = FUN_1400a32c0(lVar9 + 0x8e);
    iVar13 = 0;
    iVar4 = iVar13;
    if ((local_220 != (undefined *)0x0) && (local_220 != PTR_DAT_1402f8010)) {
      iVar4 = *(int *)(local_220 + -8);
    }
    iVar7 = 0;
    iVar6 = iVar5;
    if (((iVar5 <= iVar4) && (iVar6 = iVar13, local_220 != (undefined *)0x0)) &&
       (iVar6 = iVar7, local_220 != PTR_DAT_1402f8010)) {
      iVar6 = *(int *)(local_220 + -8);
    }
    iVar4 = 1;
    if (1 < iVar6) {
      iVar4 = iVar6;
    }
    if ((local_220 != (undefined *)0x0) && (local_220 != PTR_DAT_1402f8010)) {
      iVar7 = *(int *)(local_220 + -8);
    }
    if (iVar7 < iVar4) {
      FUN_140002d50(&local_220);
    }
    FUN_140002e30(&local_220);
    puVar11 = local_220;
    if (local_220 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar11,lVar9 + 0x8e,iVar5);
    puVar11 = local_220;
    if (local_220 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1402f8010;
    }
    iVar5 = FUN_1400a32c0(puVar11);
    iVar13 = 0;
    iVar4 = 0;
    if (0 < iVar5) {
      iVar4 = iVar5;
    }
    iVar5 = iVar13;
    if ((local_220 != (undefined *)0x0) && (local_220 != PTR_DAT_1402f8010)) {
      iVar5 = *(int *)(local_220 + -8);
    }
    if ((iVar4 < iVar5) || (iVar4 = iVar13, local_220 == (undefined *)0x0)) {
LAB_14001939d:
      if (((local_220 != PTR_DAT_1402f8010) && (local_220 != (undefined *)0x0)) &&
         ((int *)(local_220 + -8) != (int *)0x0)) {
        *(int *)(local_220 + -8) = iVar4;
        *(undefined2 *)(local_220 + (longlong)iVar4 * 2) = 0;
      }
    }
    else if (local_220 != PTR_DAT_1402f8010) {
      iVar4 = *(int *)(local_220 + -8);
      goto LAB_14001939d;
    }
    local_238 = lVar9 + 0x68;
    local_240 = lVar9 + 0x7c;
    local_258 = lVar9 + 0x6c;
    local_268 = lVar9 + 0x70;
    local_248 = local_228;
    local_250 = &local_210;
    local_260 = &local_220;
    (**(code **)(*(longlong *)(param_1 + 0x58) + 0xb0))
              (param_1 + 0x58,local_200,&DAT_14030ab90,lVar9);
    puVar11 = local_220;
    if (((local_220 != (undefined *)0x0) && (local_220 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_220 + -8, puVar1 != (undefined *)0x0)) {
      uVar10 = FUN_1400a3440();
      local_1b8 = uVar10;
      FUN_1400a1c30(uVar10);
      local_1b0 = 1;
      piVar2 = (int *)(puVar11 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar10);
    }
    puVar11 = local_210;
    local_220 = PTR_DAT_1402f8010;
    if (((local_210 != (undefined *)0x0) && (local_210 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_210 + -8, puVar1 != (undefined *)0x0)) {
      uVar10 = FUN_1400a3440();
      local_1a0 = uVar10;
      FUN_1400a1c30(uVar10);
      local_198 = 1;
      piVar2 = (int *)(puVar11 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
LAB_1400197cb:
      FUN_1400d1290(uVar10);
    }
  }
  local_120 = 0;
  local_11c = 0;
  local_118 = 0;
  local_114 = 0;
  local_110 = 0;
  local_10c = 0;
  local_100 = 0;
  local_f8[0] = L'\0';
  local_f8[1] = L'\0';
  local_f8[2] = L'\0';
  local_f8[3] = L'\0';
  local_f8[4] = L'\0';
  local_f8[5] = L'\0';
  local_f8[6] = L'\0';
  local_f8[7] = L'\0';
  local_f8[8] = L'\0';
  local_f8[9] = L'\0';
  local_f8[10] = L'\0';
  local_f8[0xb] = L'\0';
  local_e0 = 0;
  local_d8 = 0;
  local_d0 = 0;
  local_c8 = 0;
  local_c0 = 0;
  memset(local_b8,0,100);
  local_138 = 1;
  local_134 = *local_1f0;
  local_130 = *(undefined4 *)(lVar16 + 0x48);
  local_12c = *(undefined4 *)(lVar16 + 0x4c);
  local_128 = *(undefined4 *)(lVar16 + 0x50);
  local_124 = *(undefined4 *)(lVar16 + 0x54);
  local_104 = local_228[0];
  local_178 = 0xf;
  local_180 = 0;
  local_190 = 0;
  uVar12 = 0xffffffffffffffff;
  pcVar14 = (char *)(lVar16 + 0x200);
  do {
    if (uVar12 == 0) break;
    uVar12 = uVar12 - 1;
    cVar3 = *pcVar14;
    pcVar14 = pcVar14 + 1;
  } while (cVar3 != '\0');
  FUN_140003e60(&local_190,(char *)(lVar16 + 0x200),~uVar12 - 1);
  FUN_1401e1d60(local_168,&local_190);
  if (0xf < local_178) {
    operator_delete((void *)CONCAT71(uStack_18f,local_190));
  }
  local_178 = 0xf;
  local_180 = 0;
  local_190 = 0;
  _Src = local_168;
  if (7 < local_150) {
    _Src = (wchar_t ****)local_168[0];
  }
  wcscpy_s(local_b8,0x32,(wchar_t *)_Src);
  _Src_00 = (wchar_t *)(lVar16 + 0x10);
  if (7 < *(ulonglong *)(lVar16 + 0x28)) {
    _Src_00 = *(wchar_t **)_Src_00;
  }
  wcscpy_s(local_f8,0x10,_Src_00);
  local_56 = 0;
  local_e0 = local_e0 & 0xffffffffffff;
  (**(code **)(**(longlong **)(param_1 + 0x80) + 0x30))
            (*(longlong **)(param_1 + 0x80),*(undefined4 *)(lVar16 + 0x1f0),
             *(undefined4 *)(lVar16 + 0x1ec),&local_138);
  if (7 < local_150) {
    operator_delete(local_168[0]);
  }
  (**(code **)(**(longlong **)(param_1 + 0x80) + 0x78))();
LAB_1400199ab:
  FUN_1400d1290(lVar15);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400199e0(longlong param_1,undefined4 param_2)

{
  uint *puVar1;
  void *pvVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  longlong *plVar6;
  undefined8 uVar7;
  uint *puVar8;
  undefined8 *puVar9;
  longlong lVar10;
  uint *puVar11;
  longlong lVar12;
  void *_Src;
  undefined1 auStack_188 [32];
  uint **local_168;
  uint *local_158;
  undefined4 local_150;
  undefined4 local_14c;
  longlong local_148;
  longlong local_140;
  undefined1 local_138;
  char *local_130;
  DWORD local_128;
  longlong local_120;
  undefined8 local_118;
  undefined1 local_110;
  undefined8 local_108;
  undefined1 local_100;
  undefined8 local_f8;
  undefined1 local_f0;
  undefined8 local_e8;
  undefined1 local_d8 [4];
  undefined1 local_d4 [140];
  ulonglong local_48;
  
  local_e8 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_188;
  local_130 = "PG_GAME_WORLD_INFO";
  local_120 = **(longlong **)(*(longlong *)(param_1 + 0x200) + 8) + 0x68;
  local_14c = param_2;
  local_128 = timeGetTime();
  lVar10 = param_1 + 0xe0;
  local_140 = lVar10;
  FUN_1400a1c30(lVar10);
  local_138 = 1;
  plVar6 = (longlong *)FUN_14000f1a0(param_1 + -8,&local_148,param_2);
  lVar12 = 0;
  if ((longlong *)*plVar6 != (longlong *)0x0) {
    lVar12 = *(longlong *)*plVar6;
  }
  if ((local_148 != 0) &&
     (*(longlong *)(local_148 + 8) = *(longlong *)(local_148 + 8) + -1, lVar10 = local_140,
     *(longlong *)(local_148 + 8) == 0)) {
    FUN_1400219e0(local_148);
    lVar10 = local_140;
  }
  if (lVar12 == 0) {
    FUN_1400d1290(lVar10);
  }
  else {
    pvVar2 = *(void **)(param_1 + 0x290);
    for (_Src = *(void **)(param_1 + 0x288); _Src != pvVar2; _Src = (void *)((longlong)_Src + 0x84))
    {
      memcpy(local_d8,_Src,0x84);
      FUN_1400a3440();
      local_158 = (uint *)PTR_DAT_1402f8010;
      uVar3 = FUN_1400a32c0(local_d4);
      uVar5 = 0;
      if ((local_158 != (uint *)0x0) && (uVar5 = 0, local_158 != (uint *)PTR_DAT_1402f8010)) {
        uVar5 = local_158[-2];
      }
      uVar4 = uVar3;
      if ((((int)uVar3 <= (int)uVar5) && (uVar4 = 0, local_158 != (uint *)0x0)) &&
         (local_158 != (uint *)PTR_DAT_1402f8010)) {
        uVar4 = local_158[-2];
      }
      uVar5 = 1;
      if (1 < (int)uVar4) {
        uVar5 = uVar4;
      }
      if (local_158 == (uint *)0x0) {
        uVar4 = 0;
      }
      else if (local_158 == (uint *)PTR_DAT_1402f8010) {
        uVar4 = 0;
      }
      else {
        uVar4 = local_158[-2];
      }
      if ((int)uVar4 < (int)uVar5) {
        puVar8 = local_158;
        if (local_158 == (uint *)0x0) {
          puVar8 = (uint *)PTR_DAT_1402f8010;
        }
        local_158 = puVar8;
        if ((int)uVar5 < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        if (uVar5 == 0) {
          local_158 = (uint *)PTR_DAT_1402f8010;
          if (((puVar8 != (uint *)0x0) && (puVar8 != (uint *)PTR_DAT_1402f8010)) &&
             (puVar8 + -2 != (uint *)0x0)) {
            local_158 = puVar8;
            uVar7 = FUN_1400a3440();
            local_f8 = uVar7;
            FUN_1400a1c30(uVar7);
            local_f0 = 1;
            puVar11 = puVar8 + -1;
            *puVar11 = *puVar11 - 1;
            if (*puVar11 == 0) {
              FUN_1400a3530(puVar8 + -2);
            }
            FUN_1400d1290(uVar7);
            local_f0 = 0;
            local_158 = (uint *)PTR_DAT_1402f8010;
          }
        }
        else {
          if (puVar8 == (uint *)0x0) {
            uVar4 = 0;
          }
          else if (puVar8 == (uint *)PTR_DAT_1402f8010) {
            uVar4 = 0;
          }
          else {
            uVar4 = puVar8[-2];
          }
          if (uVar5 != uVar4) {
            puVar8 = (uint *)FUN_1400a34c0((longlong)(int)uVar5 * 2 + 10);
            if (puVar8 != (uint *)0x0) {
              *puVar8 = 0;
              puVar8[1] = 1;
            }
            *puVar8 = uVar5;
            if (local_158 == (uint *)0x0) {
              uVar4 = 0;
            }
            else if (local_158 == (uint *)PTR_DAT_1402f8010) {
              uVar4 = 0;
            }
            else {
              uVar4 = local_158[-2];
            }
            puVar11 = (uint *)PTR_DAT_1402f8010;
            if ((int)uVar5 < (int)uVar4) {
LAB_140019c54:
              if (local_158 != (uint *)0x0) {
                puVar11 = local_158;
              }
            }
            else {
              if (local_158 != (uint *)0x0) {
                if (local_158 == (uint *)PTR_DAT_1402f8010) {
                  uVar5 = 0;
                }
                else {
                  uVar5 = local_158[-2];
                }
                goto LAB_140019c54;
              }
              uVar5 = 0;
            }
            FUN_1400a32f0(puVar8 + 2,puVar11,uVar5);
            FUN_1400031d0(&local_158);
            local_158 = puVar8 + 2;
          }
        }
      }
      puVar8 = (uint *)PTR_DAT_1402f8010;
      if (((local_158 == (uint *)0x0) ||
          (puVar8 = local_158, local_158 == (uint *)PTR_DAT_1402f8010)) ||
         (local_158 + -2 == (uint *)0x0)) {
        local_158 = puVar8;
        puVar9 = (undefined8 *)FUN_1400a34c0();
        *puVar9 = 0;
        *(undefined2 *)(puVar9 + 1) = 0;
        if (puVar9 != (undefined8 *)0x0) {
          *(undefined4 *)puVar9 = 0;
          *(undefined4 *)((longlong)puVar9 + 4) = 1;
        }
        *(undefined2 *)(puVar9 + 1) = 0;
        puVar8 = (uint *)(puVar9 + 1);
      }
      else if (1 < (int)local_158[-1]) {
        uVar5 = local_158[-2];
        if ((int)uVar5 < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        puVar8 = (uint *)FUN_1400a34c0((longlong)(int)uVar5 * 2 + 10);
        if (puVar8 != (uint *)0x0) {
          *puVar8 = 0;
          puVar8[1] = 1;
        }
        puVar11 = (uint *)PTR_DAT_1402f8010;
        if (local_158 == (uint *)0x0) {
          uVar5 = 0;
        }
        else if (local_158 == (uint *)PTR_DAT_1402f8010) {
          uVar5 = 0;
        }
        else {
          uVar5 = local_158[-2];
        }
        *puVar8 = uVar5;
        if (local_158 == (uint *)0x0) {
          uVar5 = 0;
        }
        else if (local_158 == puVar11) {
          uVar5 = 0;
          puVar11 = local_158;
        }
        else {
          uVar5 = local_158[-2];
          puVar11 = local_158;
        }
        puVar8 = puVar8 + 2;
        FUN_1400a32f0(puVar8,puVar11,uVar5);
        puVar11 = local_158;
        if (((local_158 != (uint *)0x0) && (local_158 != (uint *)PTR_DAT_1402f8010)) &&
           (puVar1 = local_158 + -2, puVar1 != (uint *)0x0)) {
          uVar7 = FUN_1400a3440();
          local_118 = uVar7;
          FUN_1400a1c30(uVar7);
          local_110 = 1;
          puVar11 = puVar11 + -1;
          *puVar11 = *puVar11 - 1;
          if (*puVar11 == 0) {
            FUN_1400a3530(puVar1);
          }
          FUN_1400d1290(uVar7);
          local_110 = 0;
          param_2 = local_14c;
        }
      }
      local_158 = puVar8;
      puVar8 = local_158;
      if (local_158 == (uint *)0x0) {
        puVar8 = (uint *)PTR_DAT_1402f8010;
      }
      FUN_1400a32f0(puVar8,local_d4,uVar3);
      puVar8 = local_158;
      if (local_158 == (uint *)0x0) {
        puVar8 = (uint *)PTR_DAT_1402f8010;
      }
      uVar3 = FUN_1400a32c0(puVar8);
      uVar4 = 0;
      uVar5 = 0;
      if (0 < (int)uVar3) {
        uVar5 = uVar3;
      }
      uVar3 = uVar4;
      if ((local_158 != (uint *)0x0) && (local_158 != (uint *)PTR_DAT_1402f8010)) {
        uVar3 = local_158[-2];
      }
      if (((int)uVar5 < (int)uVar3) || (uVar5 = uVar4, local_158 == (uint *)0x0)) {
LAB_140019e36:
        if (((local_158 != (uint *)PTR_DAT_1402f8010) && (local_158 != (uint *)0x0)) &&
           (local_158 + -2 != (uint *)0x0)) {
          local_158[-2] = uVar5;
          *(undefined2 *)((longlong)local_158 + (longlong)(int)uVar5 * 2) = 0;
        }
      }
      else if (local_158 != (uint *)PTR_DAT_1402f8010) {
        uVar5 = local_158[-2];
        goto LAB_140019e36;
      }
      local_168 = &local_158;
      (**(code **)(*(longlong *)(param_1 + 0x58) + 0x180))
                ((longlong *)(param_1 + 0x58),param_2,&DAT_14030ab90,local_d8);
      puVar8 = local_158;
      if (((local_158 != (uint *)0x0) && (local_158 != (uint *)PTR_DAT_1402f8010)) &&
         (puVar11 = local_158 + -2, puVar11 != (uint *)0x0)) {
        uVar7 = FUN_1400a3440();
        local_108 = uVar7;
        FUN_1400a1c30(uVar7);
        local_100 = 1;
        puVar8 = puVar8 + -1;
        *puVar8 = *puVar8 - 1;
        if (*puVar8 == 0) {
          FUN_1400a3530(puVar11);
        }
        FUN_1400d1290(uVar7);
        local_100 = 0;
      }
      local_158 = (uint *)PTR_DAT_1402f8010;
    }
    lVar10 = FUN_14008fa20();
    local_150 = (undefined4)((*(longlong *)(lVar10 + 0x10) - *(longlong *)(lVar10 + 8)) / 0x38);
    (**(code **)(*(longlong *)(param_1 + 0x58) + 400))
              ((longlong *)(param_1 + 0x58),param_2,&DAT_14030ab90,&local_150);
    FUN_1400d1290(local_140);
  }
  FUN_140070e40(&local_130);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140019f80(longlong param_1,ulonglong *param_2)

{
  longlong lVar1;
  ulonglong uVar2;
  int iVar3;
  ulonglong *puVar4;
  uint uVar5;
  bool bVar6;
  undefined1 auStack_58 [32];
  longlong local_38;
  undefined1 local_30;
  undefined8 local_28;
  uint local_20;
  uint uStack_1c;
  uint local_18;
  uint uStack_14;
  ulonglong local_10;
  
  local_28 = 0xfffffffffffffffe;
  local_10 = DAT_1402f85a0 ^ (ulonglong)auStack_58;
  lVar1 = param_1 + 0xe8;
  local_38 = lVar1;
  FUN_1400a1c30(lVar1);
  local_30 = 1;
  local_20 = (uint)*param_2;
  uStack_1c = *(uint *)((longlong)param_2 + 4);
  local_18 = (uint)param_2[1];
  uStack_14 = *(uint *)((longlong)param_2 + 0xc);
  uVar2 = param_2[1];
  uVar5 = local_20 ^ uStack_1c ^ local_18 ^ uStack_14;
  if (*(longlong *)(param_1 + 0x170) != 0) {
    for (puVar4 = *(ulonglong **)
                   (*(longlong *)(param_1 + 0x170) +
                   ((ulonglong)uVar5 % (ulonglong)*(uint *)(param_1 + 0x180)) * 8);
        puVar4 != (ulonglong *)0x0; puVar4 = (ulonglong *)puVar4[3]) {
      if ((uint)puVar4[4] == uVar5) {
        bVar6 = *puVar4 < *param_2;
        if ((*puVar4 == *param_2) && (bVar6 = puVar4[1] < uVar2, puVar4[1] == uVar2)) {
          iVar3 = 0;
        }
        else {
          iVar3 = (1 - (uint)bVar6) - (uint)(bVar6 != 0);
        }
        if (iVar3 == 0) {
          if (puVar4 != (ulonglong *)0x0) {
            FUN_14001cdf0(param_1 + 0x170,&local_20);
            (**(code **)(*(longlong *)(param_1 + 0x60) + 0x120))
                      ((longlong *)(param_1 + 0x60),(int)puVar4[2],&DAT_14030ab90);
          }
          break;
        }
      }
    }
  }
  FUN_1400d1290(lVar1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14001a090(longlong param_1,undefined4 param_2,char *param_3)

{
  int *piVar1;
  undefined *puVar2;
  char cVar3;
  errno_t eVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  longlong *plVar8;
  undefined8 uVar9;
  longlong lVar10;
  undefined *puVar11;
  longlong lVar12;
  char *pcVar13;
  longlong lVar14;
  undefined1 auStack_178 [32];
  undefined4 *local_158;
  uint *local_150;
  uint *local_148;
  char *local_140;
  undefined8 local_138;
  undefined8 local_130;
  undefined8 local_128;
  char local_118 [8];
  undefined *local_110;
  uint local_108;
  uint local_104;
  undefined8 local_100;
  int local_f8;
  longlong local_f0;
  undefined4 local_e8 [2];
  longlong local_e0;
  undefined1 local_d8;
  __time64_t local_d0 [3];
  undefined1 local_b8;
  short local_b0;
  short local_ae;
  undefined2 local_ac;
  short local_aa;
  short local_a8;
  short local_a6;
  short local_a4;
  undefined2 local_a2;
  undefined8 local_a0;
  undefined8 local_98;
  tm local_90;
  undefined1 local_68 [8];
  ushort local_60;
  undefined1 local_58 [10];
  ushort local_4e;
  ulonglong local_48;
  
  local_d0[1] = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_178;
  lVar14 = param_1 + 0xe8;
  local_e0 = lVar14;
  FUN_1400a1c30(lVar14);
  local_d8 = 1;
  plVar8 = (longlong *)FUN_14000f1a0(param_1,&local_f0);
  lVar12 = 0;
  if ((longlong *)*plVar8 != (longlong *)0x0) {
    lVar12 = *(longlong *)*plVar8;
  }
  if ((local_f0 != 0) &&
     (*(longlong *)(local_f0 + 8) = *(longlong *)(local_f0 + 8) + -1, lVar14 = local_e0,
     *(longlong *)(local_f0 + 8) == 0)) {
    FUN_1400219e0();
    lVar14 = local_e0;
  }
  if (lVar12 == 0) goto LAB_14001a551;
  lVar10 = -1;
  pcVar13 = param_3;
  do {
    if (lVar10 == 0) break;
    lVar10 = lVar10 + -1;
    cVar3 = *pcVar13;
    pcVar13 = pcVar13 + 1;
  } while (cVar3 != '\0');
  if (0 < (int)(~(uint)lVar10 - 1)) {
    strncpy_s((char *)(lVar12 + 0x332),0x20,param_3,0x1f);
    *(undefined1 *)(lVar12 + 0x351) = 0;
    (**(code **)(*(longlong *)(param_1 + 0x60) + 0x1a0))
              ((longlong *)(param_1 + 0x60),param_2,&DAT_14030ab90);
    goto LAB_14001a551;
  }
  local_108 = 0;
  local_104 = 0;
  if ((DAT_140320f64 & 1) == 0) {
    DAT_140320f64 = DAT_140320f64 | 1;
    FUN_1400908e0();
    atexit((_func_5014 *)&LAB_140202650);
  }
  if (DAT_1403206c1 != '\0') {
    local_d0[0] = _time64((__time64_t *)0x0);
    local_100 = 0;
    local_f8 = 0;
    eVar4 = _localtime64_s(&local_90,local_d0);
    if (eVar4 == 0) {
      local_b0 = (short)local_90.tm_year + 0x76c;
      local_ae = (short)local_90.tm_mon + 1;
      local_ac = (undefined2)local_90.tm_wday;
      local_aa = (short)local_90.tm_mday;
      local_a8 = (short)local_90.tm_hour;
      local_a6 = (short)local_90.tm_min;
      local_a4 = (short)local_90.tm_sec;
      local_a2 = 0;
      iVar5 = Ordinal_184(&local_b0,&local_100);
      local_a0 = 0;
      local_98 = 0;
      if ((((iVar5 == 0) || (iVar5 = Ordinal_185(local_100,&local_a0), iVar5 == 0)) ||
          (local_b0 != (short)local_a0)) ||
         (((local_ae != local_a0._2_2_ || (local_aa != local_a0._6_2_)) ||
          ((local_a8 != (short)local_98 ||
           ((local_a6 != local_98._2_2_ || (local_a4 != local_98._4_2_)))))))) goto LAB_14001a2d0;
      local_f8 = 0;
      iVar5 = Ordinal_185(local_100,local_68);
      if (iVar5 == 0) goto LAB_14001a2d3;
      local_108 = (uint)local_60;
    }
    else {
LAB_14001a2d0:
      local_f8 = 1;
LAB_14001a2d3:
      local_108 = 0xffffffff;
    }
    if ((local_f8 == 0) && (iVar5 = Ordinal_185(local_100,local_58), iVar5 != 0)) {
      local_104 = (uint)local_4e;
    }
    else {
      local_104 = 0xffffffff;
    }
  }
  *(undefined4 *)(lVar12 + 0x1e8) = 0;
  local_148 = (uint *)(lVar12 + 0x10);
  if (7 < *(ulonglong *)(lVar12 + 0x28)) {
    local_148 = *(uint **)local_148;
  }
  lVar10 = lVar12 + 0x200;
  local_128 = 0;
  local_130 = 0;
  local_138 = 0;
  local_140 = (char *)CONCAT44(local_140._4_4_,1);
  local_150 = (uint *)CONCAT44(local_150._4_4_,*(undefined4 *)(DAT_140320138 + 0x140));
  local_158 = (undefined4 *)lVar10;
  (**(code **)(**(longlong **)(param_1 + 0x88) + 8))
            (*(longlong **)(param_1 + 0x88),*(undefined4 *)(lVar12 + 0x1f0),
             *(undefined4 *)(lVar12 + 0x1ec),param_2);
  if ((DAT_140320f64 & 1) == 0) {
    DAT_140320f64 = DAT_140320f64 | 1;
    FUN_1400908e0();
    atexit((_func_5014 *)&LAB_140202650);
  }
  local_118[0] = DAT_1403206c1;
  local_e8[0] = *(undefined4 *)(lVar12 + 0x1fc);
  FUN_1400a3440();
  local_110 = PTR_DAT_1402f8008;
  iVar5 = FUN_1400a3360(lVar10);
  if (local_110 == (undefined *)0x0) {
    iVar7 = 0;
  }
  else if (local_110 == PTR_DAT_1402f8008) {
    iVar7 = 0;
  }
  else {
    iVar7 = *(int *)(local_110 + -8);
  }
  iVar6 = iVar5;
  if (iVar5 <= iVar7) {
    if (local_110 == (undefined *)0x0) {
      iVar6 = 0;
    }
    else if (local_110 == PTR_DAT_1402f8008) {
      iVar6 = 0;
    }
    else {
      iVar6 = *(int *)(local_110 + -8);
    }
  }
  iVar7 = 1;
  if (1 < iVar6) {
    iVar7 = iVar6;
  }
  if (local_110 == (undefined *)0x0) {
    iVar6 = 0;
  }
  else if (local_110 == PTR_DAT_1402f8008) {
    iVar6 = 0;
  }
  else {
    iVar6 = *(int *)(local_110 + -8);
  }
  if (iVar6 < iVar7) {
    FUN_14000c1c0(&local_110,iVar7);
  }
  FUN_14000c330(&local_110);
  puVar11 = local_110;
  if (local_110 == (undefined *)0x0) {
    puVar11 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar11,lVar10,iVar5);
  iVar7 = FUN_1400a3360();
  iVar5 = 0;
  if (0 < iVar7) {
    iVar5 = iVar7;
  }
  if (local_110 == (undefined *)0x0) {
    iVar7 = 0;
  }
  else if (local_110 == PTR_DAT_1402f8008) {
    iVar7 = 0;
  }
  else {
    iVar7 = *(int *)(local_110 + -8);
  }
  if (iVar7 <= iVar5) {
    if (local_110 == (undefined *)0x0) {
      iVar5 = 0;
    }
    else if (local_110 == PTR_DAT_1402f8008) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(local_110 + -8);
    }
  }
  if (((local_110 != PTR_DAT_1402f8008) && (local_110 != (undefined *)0x0)) &&
     (piVar1 = (int *)(local_110 + -8), piVar1 != (int *)0x0)) {
    *piVar1 = iVar5;
    *(undefined1 *)((longlong)iVar5 + 8 + (longlong)piVar1) = 0;
  }
  local_140 = local_118;
  local_148 = &local_104;
  local_150 = &local_108;
  local_158 = local_e8;
  (**(code **)(*(longlong *)(param_1 + 0x60) + 0x200))
            ((longlong *)(param_1 + 0x60),param_2,&DAT_14030ab90,&local_110);
  puVar11 = local_110;
  if (((local_110 != (undefined *)0x0) && (local_110 != PTR_DAT_1402f8008)) &&
     (puVar2 = local_110 + -8, puVar2 != (undefined *)0x0)) {
    uVar9 = FUN_1400a3440();
    local_d0[2] = uVar9;
    FUN_1400a1c30(uVar9);
    local_b8 = 1;
    piVar1 = (int *)(puVar11 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2);
    }
    FUN_1400d1290(uVar9);
  }
LAB_14001a551:
  FUN_1400d1290(lVar14);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14001a580(longlong param_1,undefined4 param_2,ulonglong *param_3,undefined1 param_4,
                  short param_5,byte param_6,undefined4 param_7,int param_8,undefined4 param_9)

{
  char cVar1;
  uint uVar2;
  int iVar3;
  longlong *plVar4;
  ulonglong uVar5;
  longlong lVar6;
  wchar_t *_Src;
  ulonglong *puVar7;
  char *pcVar8;
  uint uVar9;
  wchar_t ****_Src_00;
  longlong lVar10;
  bool bVar11;
  undefined1 auStack_248 [32];
  wchar_t *local_228;
  undefined8 *local_220;
  undefined4 local_218;
  undefined1 local_208 [4];
  undefined4 local_204;
  longlong local_200;
  int local_1f8 [2];
  longlong local_1f0;
  undefined1 local_1e8;
  undefined8 local_1e0;
  uint local_1d8;
  uint uStack_1d4;
  uint local_1d0;
  uint uStack_1cc;
  undefined4 local_1c8;
  undefined4 local_1c4;
  undefined4 local_1c0;
  undefined4 local_1bc;
  undefined4 local_1b8;
  undefined4 local_1b4;
  undefined4 local_1b0;
  undefined4 local_1ac;
  undefined1 local_1a8;
  undefined7 uStack_1a7;
  undefined8 local_198;
  ulonglong local_190;
  undefined1 local_180 [16];
  wchar_t ***local_170 [3];
  ulonglong local_158;
  undefined4 local_148;
  undefined4 local_144;
  undefined4 local_140;
  undefined4 local_13c;
  undefined4 local_138;
  undefined4 local_134;
  undefined4 local_130;
  undefined4 local_12c;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  undefined8 local_11c;
  undefined8 local_114;
  undefined4 local_10c;
  wchar_t local_108 [12];
  ulonglong local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  wchar_t local_c8 [49];
  undefined2 local_66;
  ulonglong local_58;
  
  local_1e0 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_248;
  lVar10 = param_1 + 0xe8;
  local_208[0] = param_4;
  local_204 = param_2;
  local_1f0 = lVar10;
  FUN_1400a1c30(lVar10);
  local_1e8 = 1;
  plVar4 = (longlong *)FUN_14000f1a0(param_1,&local_200,param_2);
  lVar6 = 0;
  if ((longlong *)*plVar4 != (longlong *)0x0) {
    lVar6 = *(longlong *)*plVar4;
  }
  if ((local_200 != 0) &&
     (*(longlong *)(local_200 + 8) = *(longlong *)(local_200 + 8) + -1, lVar10 = local_1f0,
     param_2 = local_204, *(longlong *)(local_200 + 8) == 0)) {
    FUN_1400219e0(local_200);
    lVar10 = local_1f0;
    param_2 = local_204;
  }
  if (lVar6 != 0) {
    local_1d8 = (uint)*param_3;
    uStack_1d4 = *(uint *)((longlong)param_3 + 4);
    local_1d0 = (uint)param_3[1];
    uStack_1cc = *(uint *)((longlong)param_3 + 0xc);
    uVar5 = param_3[1];
    uVar9 = local_1d8 ^ uStack_1d4 ^ local_1d0 ^ uStack_1cc;
    if (*(longlong *)(param_1 + 0x170) != 0) {
      for (puVar7 = *(ulonglong **)
                     (*(longlong *)(param_1 + 0x170) +
                     ((ulonglong)uVar9 % (ulonglong)*(uint *)(param_1 + 0x180)) * 8);
          puVar7 != (ulonglong *)0x0; puVar7 = (ulonglong *)puVar7[3]) {
        if ((uint)puVar7[4] == uVar9) {
          bVar11 = *puVar7 < *param_3;
          if ((*puVar7 == *param_3) && (bVar11 = puVar7[1] < uVar5, puVar7[1] == uVar5)) {
            iVar3 = 0;
          }
          else {
            iVar3 = (1 - (uint)bVar11) - (uint)(bVar11 != 0);
          }
          if (iVar3 == 0) {
            if (puVar7 != (ulonglong *)0x0) {
              FUN_14001cdf0(param_1 + 0x170,&local_1d8);
              (**(code **)(*(longlong *)(param_1 + 0x60) + 0x120))
                        ((longlong *)(param_1 + 0x60),(int)puVar7[2],&DAT_14030ab90);
            }
            break;
          }
        }
      }
    }
    uVar9 = *(uint *)((longlong)param_3 + 4);
    uVar5 = param_3[1];
    uVar2 = *(uint *)((longlong)param_3 + 0xc);
    *(uint *)(lVar6 + 0x48) = (uint)*param_3;
    *(uint *)(lVar6 + 0x4c) = uVar9;
    *(uint *)(lVar6 + 0x50) = (uint)uVar5;
    *(uint *)(lVar6 + 0x54) = uVar2;
    *(uint *)(lVar6 + 500) = (uint)param_6;
    *(undefined4 *)(lVar6 + 0x1f8) = 0;
    if ((DAT_140320f64 & 1) == 0) {
      DAT_140320f64 = DAT_140320f64 | 1;
      FUN_1400908e0();
      atexit((_func_5014 *)&LAB_140202650);
    }
    if (DAT_1403206bb != '\0') {
      *(undefined4 *)(lVar6 + 0x1f8) = param_7;
    }
    FUN_14001cd10(param_1 + 0x170,&local_1d8,&local_204);
    if (param_8 == 0x6f) {
      FUN_1400aab20(local_180);
      local_220 = (undefined8 *)&param_6;
      local_228 = (wchar_t *)local_208;
      (**(code **)(*(longlong *)(param_1 + 0x60) + 0x60))
                ((longlong *)(param_1 + 0x60),param_2,&DAT_14030ad10,local_180);
      if (param_5 != -1) {
        *(int *)(lVar6 + 0x1ec) = (int)param_5;
      }
      local_1c8 = *(undefined4 *)(lVar6 + 0x48);
      local_1c4 = *(undefined4 *)(lVar6 + 0x4c);
      local_1c0 = *(undefined4 *)(lVar6 + 0x50);
      local_1bc = *(undefined4 *)(lVar6 + 0x54);
      local_218 = param_9;
      local_220 = (undefined8 *)CONCAT71(local_220._1_7_,(char)*(undefined4 *)(lVar6 + 500));
      local_228 = (wchar_t *)CONCAT71(local_228._1_7_,(char)*(undefined4 *)(lVar6 + 0x1f8));
      (**(code **)(**(longlong **)(param_1 + 0x88) + 0x88))
                (*(longlong **)(param_1 + 0x88),local_180,&local_1c8,*(undefined2 *)(lVar6 + 0x1ec))
      ;
      local_220 = (undefined8 *)(DAT_140320138 + 0x58);
      if (7 < *(ulonglong *)(DAT_140320138 + 0x70)) {
        local_220 = (undefined8 *)*local_220;
      }
      _Src = (wchar_t *)(lVar6 + 0x10);
      local_228 = _Src;
      if (7 < *(ulonglong *)(lVar6 + 0x28)) {
        local_228 = *(wchar_t **)_Src;
      }
      (**(code **)(**(longlong **)(param_1 + 0x88) + 0x28))
                (*(longlong **)(param_1 + 0x88),*(undefined4 *)(lVar6 + 0x1f0),
                 *(undefined4 *)(lVar6 + 0x1ec),param_3);
      local_1b8 = *(undefined4 *)(lVar6 + 0x48);
      local_1b4 = *(undefined4 *)(lVar6 + 0x4c);
      local_1b0 = *(undefined4 *)(lVar6 + 0x50);
      local_1ac = *(undefined4 *)(lVar6 + 0x54);
      (**(code **)(**(longlong **)(param_1 + 0x88) + 0x80))
                (*(longlong **)(param_1 + 0x88),param_2,&local_1b8);
      local_130 = 0;
      local_12c = 0;
      local_128 = 0;
      local_124 = 0;
      local_120 = 0;
      local_11c = 0;
      local_114 = 0;
      local_10c = 0;
      local_108[0] = L'\0';
      local_108[1] = L'\0';
      local_108[2] = L'\0';
      local_108[3] = L'\0';
      local_108[4] = L'\0';
      local_108[5] = L'\0';
      local_108[6] = L'\0';
      local_108[7] = L'\0';
      local_108[8] = L'\0';
      local_108[9] = L'\0';
      local_108[10] = L'\0';
      local_108[0xb] = L'\0';
      local_f0 = 0;
      local_e8 = 0;
      local_e0 = 0;
      local_d8 = 0;
      local_d0 = 0;
      memset(local_c8,0,100);
      local_148 = 4;
      local_144 = *(undefined4 *)(DAT_140320138 + 0x140);
      local_140 = *(undefined4 *)(lVar6 + 0x48);
      local_13c = *(undefined4 *)(lVar6 + 0x4c);
      local_138 = *(undefined4 *)(lVar6 + 0x50);
      local_134 = *(undefined4 *)(lVar6 + 0x54);
      local_190 = 0xf;
      local_198 = 0;
      local_1a8 = 0;
      uVar5 = 0xffffffffffffffff;
      pcVar8 = (char *)(lVar6 + 0x200);
      do {
        if (uVar5 == 0) break;
        uVar5 = uVar5 - 1;
        cVar1 = *pcVar8;
        pcVar8 = pcVar8 + 1;
      } while (cVar1 != '\0');
      FUN_140003e60(&local_1a8,(char *)(lVar6 + 0x200),~uVar5 - 1);
      FUN_1401e1d60(local_170,&local_1a8);
      if (0xf < local_190) {
        operator_delete((void *)CONCAT71(uStack_1a7,local_1a8));
      }
      local_190 = 0xf;
      local_198 = 0;
      local_1a8 = 0;
      _Src_00 = local_170;
      if (7 < local_158) {
        _Src_00 = (wchar_t ****)local_170[0];
      }
      wcscpy_s(local_c8,0x32,(wchar_t *)_Src_00);
      if (7 < *(ulonglong *)(lVar6 + 0x28)) {
        _Src = *(wchar_t **)_Src;
      }
      wcscpy_s(local_108,0x10,_Src);
      local_66 = 0;
      local_f0 = local_f0 & 0xffffffffffff;
      (**(code **)(**(longlong **)(param_1 + 0x88) + 0x30))
                (*(longlong **)(param_1 + 0x88),*(undefined4 *)(lVar6 + 0x1f0),
                 *(undefined4 *)(lVar6 + 0x1ec),&local_148);
      if (7 < local_158) {
        operator_delete(local_170[0]);
      }
    }
    else if ((0x6f < param_8) && (param_8 < 0x73)) {
      local_1f8[0] = param_8;
      (**(code **)(*(longlong *)(param_1 + 0x60) + 0x70))
                ((longlong *)(param_1 + 0x60),param_2,&DAT_14030ab90,local_1f8);
    }
  }
  FUN_1400d1290(lVar10);
  return;
}



undefined8 FUN_14001aa60(longlong param_1,int param_2,undefined4 *param_3)

{
  code *pcVar1;
  int iVar2;
  int iVar3;
  DWORD DVar4;
  longlong lVar5;
  undefined8 uVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  longlong *plVar9;
  longlong *plVar10;
  longlong lVar11;
  ulonglong uVar12;
  longlong *plVar13;
  longlong *plVar14;
  longlong *plVar15;
  uint uVar16;
  longlong local_a8;
  int local_a0;
  uint local_9c;
  int local_98;
  longlong *local_90;
  longlong *local_88;
  longlong *local_80;
  longlong *local_70;
  longlong *local_68;
  longlong *local_60;
  undefined8 local_50;
  
  local_50 = 0xfffffffffffffffe;
  iVar2 = (**(code **)(**(longlong **)(param_1 + 0x88) + 200))();
  local_98 = iVar2;
  iVar3 = (**(code **)(**(longlong **)(param_1 + 0x88) + 0x38))();
  local_a0 = iVar3;
  if ((DAT_140320f64 & 1) == 0) {
    DAT_140320f64 = DAT_140320f64 | 1;
    FUN_1400908e0();
    atexit((_func_5014 *)&LAB_140202650);
  }
  plVar9 = (longlong *)0x0;
  local_9c = (uint)(DAT_1403206f8 <= iVar2);
  DVar4 = GetTickCount();
  local_70 = (longlong *)0x0;
  local_68 = (longlong *)0x0;
  local_60 = (longlong *)0x0;
  plVar10 = plVar9;
  plVar14 = plVar9;
  plVar13 = plVar9;
  if (0 < iVar3) {
    do {
      lVar5 = (**(code **)(**(longlong **)(param_1 + 0x88) + 0x58))
                        (*(longlong **)(param_1 + 0x88),plVar13);
      if ((((lVar5 != 0) && (DVar4 <= *(uint *)(lVar5 + 0x88))) &&
          (*(char *)(lVar5 + 0x8c) != '\x01')) &&
         ((*(int *)(lVar5 + 0x70) == param_2 && (0 < *(int *)(lVar5 + 0x78))))) {
        iVar2 = 0;
        do {
          uVar12 = 0;
          lVar11 = (longlong)iVar2 * 0x20 + *(longlong *)(lVar5 + 0x218);
          local_a8 = lVar11;
          if ((lVar11 != 0) && (*(char *)(lVar11 + 0x10) == '\0')) {
            if ((&local_a8 < plVar9) && (plVar14 <= &local_a8)) {
              lVar11 = (longlong)&local_a8 - (longlong)plVar14;
              if (plVar9 == plVar10) {
                uVar7 = (longlong)plVar9 - (longlong)plVar14 >> 3;
                if (0x1ffffffffffffffe < uVar7) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar1 = (code *)swi(3);
                  uVar6 = (*pcVar1)();
                  return uVar6;
                }
                uVar7 = uVar7 + 1;
                uVar8 = (longlong)plVar10 - (longlong)plVar14 >> 3;
                if (uVar8 < uVar7) {
                  if (uVar8 <= 0x1fffffffffffffff - (uVar8 >> 1)) {
                    uVar12 = uVar8 + (uVar8 >> 1);
                  }
                  if (uVar12 < uVar7) {
                    uVar12 = uVar7;
                  }
                  FUN_14001ca90(&local_70,uVar12);
                  plVar9 = local_68;
                  plVar10 = local_60;
                  plVar14 = local_70;
                }
              }
              if (plVar9 != (longlong *)0x0) {
                *plVar9 = plVar14[lVar11 >> 3];
              }
            }
            else {
              if (plVar9 == plVar10) {
                uVar7 = (longlong)plVar9 - (longlong)plVar14 >> 3;
                if (0x1ffffffffffffffe < uVar7) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar1 = (code *)swi(3);
                  uVar6 = (*pcVar1)();
                  return uVar6;
                }
                uVar7 = uVar7 + 1;
                uVar8 = (longlong)plVar10 - (longlong)plVar14 >> 3;
                if (uVar8 < uVar7) {
                  if (uVar8 <= 0x1fffffffffffffff - (uVar8 >> 1)) {
                    uVar12 = uVar8 + (uVar8 >> 1);
                  }
                  if (uVar12 < uVar7) {
                    uVar12 = uVar7;
                  }
                  FUN_14001ca90(&local_70,uVar12);
                  plVar9 = local_68;
                  plVar10 = local_60;
                  plVar14 = local_70;
                }
              }
              if (plVar9 != (longlong *)0x0) {
                *plVar9 = lVar11;
              }
            }
            plVar9 = plVar9 + 1;
            local_68 = plVar9;
          }
          iVar2 = iVar2 + 1;
          iVar3 = local_a0;
        } while (iVar2 < *(int *)(lVar5 + 0x78));
      }
      uVar16 = (int)plVar13 + 1;
      plVar13 = (longlong *)(ulonglong)uVar16;
    } while ((int)uVar16 < iVar3);
  }
  uVar12 = (longlong)plVar9 - (longlong)plVar14 >> 3;
  if (uVar12 == 0) {
    wprintf(L"Lobby Not Find World ID[ %d ]\n");
    if (plVar14 != (longlong *)0x0) {
      operator_delete(plVar14);
    }
    uVar6 = 0;
  }
  else {
    FUN_14001d3c0(plVar14,plVar9,uVar12,0);
    if ((char)local_9c != '\0') {
      if ((DAT_140320f64 & 1) == 0) {
        DAT_140320f64 = DAT_140320f64 | 1;
        FUN_1400908e0();
        atexit((_func_5014 *)&LAB_140202650);
      }
      if (local_98 / DAT_140320700 < 1) {
        iVar3 = 1;
      }
      else {
        iVar3 = local_98 / DAT_140320700 + 1;
      }
      if (uVar12 < (ulonglong)(longlong)iVar3) {
        iVar3 = (int)uVar12;
      }
      plVar9 = (longlong *)0x0;
      local_90 = (longlong *)0x0;
      local_88 = (longlong *)0x0;
      local_80 = (longlong *)0x0;
      plVar10 = plVar14;
      plVar13 = plVar9;
      plVar15 = plVar9;
      if (0 < iVar3) {
        do {
          uVar12 = 0;
          if ((plVar10 < local_88) && (plVar9 <= plVar10)) {
            lVar5 = (longlong)plVar10 - (longlong)plVar9;
            if (local_88 == plVar13) {
              uVar7 = (longlong)local_88 - (longlong)plVar9 >> 3;
              if (0x1ffffffffffffffe < uVar7) {
                std::_Xlength_error("vector<T> too long");
                pcVar1 = (code *)swi(3);
                uVar6 = (*pcVar1)();
                return uVar6;
              }
              uVar7 = uVar7 + 1;
              uVar8 = (longlong)plVar13 - (longlong)plVar9 >> 3;
              if (uVar8 < uVar7) {
                if (uVar8 <= 0x1fffffffffffffff - (uVar8 >> 1)) {
                  uVar12 = uVar8 + (uVar8 >> 1);
                }
                if (uVar12 < uVar7) {
                  uVar12 = uVar7;
                }
                FUN_14001ca90(&local_90,uVar12);
                plVar9 = local_90;
                plVar13 = local_80;
              }
            }
            if (local_88 != (longlong *)0x0) {
              lVar5 = plVar9[lVar5 >> 3];
LAB_14001aed3:
              *local_88 = lVar5;
            }
          }
          else {
            if (local_88 == plVar13) {
              uVar7 = (longlong)local_88 - (longlong)plVar9 >> 3;
              if (0x1ffffffffffffffe < uVar7) {
                std::_Xlength_error("vector<T> too long");
                pcVar1 = (code *)swi(3);
                uVar6 = (*pcVar1)();
                return uVar6;
              }
              uVar7 = uVar7 + 1;
              uVar8 = (longlong)plVar13 - (longlong)plVar9 >> 3;
              if (uVar8 < uVar7) {
                if (uVar8 <= 0x1fffffffffffffff - (uVar8 >> 1)) {
                  uVar12 = uVar8 + (uVar8 >> 1);
                }
                if (uVar12 < uVar7) {
                  uVar12 = uVar7;
                }
                FUN_14001ca90(&local_90,uVar12);
                plVar9 = local_90;
                plVar13 = local_80;
              }
            }
            if (local_88 != (longlong *)0x0) {
              lVar5 = *plVar10;
              goto LAB_14001aed3;
            }
          }
          local_88 = local_88 + 1;
          plVar15 = (longlong *)((longlong)plVar15 + 1);
          plVar10 = plVar10 + 1;
        } while ((longlong)plVar15 < (longlong)iVar3);
      }
      lVar5 = (longlong)local_88 - (longlong)plVar9 >> 3;
      if (lVar5 != 0) {
        FUN_14001d520(plVar9,local_88,lVar5,0);
        *param_3 = *(undefined4 *)(*plVar9 + 4);
        uVar6 = *(undefined8 *)(*plVar9 + 0x18);
        operator_delete(plVar9);
        if (plVar14 == (longlong *)0x0) {
          return uVar6;
        }
        operator_delete(plVar14);
        return uVar6;
      }
      if (plVar9 != (longlong *)0x0) {
        operator_delete(plVar9);
      }
    }
    *param_3 = *(undefined4 *)(*plVar14 + 4);
    uVar6 = *(undefined8 *)(*plVar14 + 0x18);
    operator_delete(plVar14);
  }
  return uVar6;
}



void FUN_14001afc0(void)

{
  wchar_t *_Format;
  
  wprintf(L"ID [ %d ] ");
  if (*(char *)(DAT_140320138 + 0x151) == '\0') {
    _Format = L"IP [ %s ] ";
  }
  else {
    _Format = L"DNS [ %s ] ";
  }
  wprintf(_Format);
  wprintf(L"Name [ %s ] ");
  wprintf(L"HOSTID [ %d ] ");
  wprintf(L"SERVER_KEY [ %d ] ");
  wprintf(L"PORT [ %d ] ");
  wprintf(L"WORLD_ID [ %d ] ");
  wprintf(L"CONNECTION_COUNT [ %d ] ");
  wprintf(L"CHANNEL_COUNT [ %d ] ");
  wprintf(L"DEVEL [ %s ] ");
  wprintf(L"UV [ %d ] ");
  wprintf(L"LIMIT_CONNECT [ %d ] ");
  wprintf(L"LAST_KEEP_ALIVE [ %d ] ");
                    // WARNING: Could not recover jumptable at 0x00014001b107. Too many branches
                    // WARNING: Treating indirect jump as call
  wprintf(L"LOCK_DOWN [ %s ]\n");
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14001b110(longlong param_1,undefined8 *param_2)

{
  void *pvVar1;
  void *_Src;
  undefined1 auStack_e8 [32];
  undefined8 *local_c8;
  undefined8 local_c0;
  undefined1 local_b8 [144];
  ulonglong local_28;
  
  local_c0 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_e8;
  local_c8 = param_2;
  FUN_14001c1b0(param_1 + 0x290);
  pvVar1 = *(void **)(param_1 + 0x298);
  for (_Src = *(void **)(param_1 + 0x290); _Src != pvVar1; _Src = (void *)((longlong)_Src + 0x84)) {
    memcpy(local_b8,_Src,0x84);
    wprintf(L"[World : %d\tName : %s ]\n");
  }
  *(undefined1 *)(param_1 + 0x80) = 0;
  if ((void *)*param_2 != (void *)0x0) {
    operator_delete((void *)*param_2);
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14001b1f0(longlong param_1,char *param_2,undefined4 param_3)

{
  char cVar1;
  char *pcVar2;
  ulonglong uVar3;
  char *pcVar4;
  ulonglong uVar5;
  undefined1 auStack_108 [32];
  undefined8 local_e8;
  longlong local_e0;
  undefined1 local_d8;
  undefined1 local_d0 [24];
  void *local_b8 [2];
  longlong local_a8;
  ulonglong local_a0;
  undefined4 local_90;
  void *local_88 [2];
  longlong local_78;
  ulonglong local_70;
  undefined4 local_60;
  char local_58;
  undefined7 uStack_57;
  longlong local_48;
  ulonglong local_40;
  ulonglong local_30;
  
  local_e8 = 0xfffffffffffffffe;
  local_30 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  local_e0 = param_1 + 0xe8;
  FUN_1400a1c30();
  local_d8 = 1;
  local_40 = 0xf;
  uVar5 = 0;
  local_48 = 0;
  local_58 = '\0';
  uVar3 = 0xffffffffffffffff;
  pcVar4 = param_2;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + 1;
  } while (cVar1 != '\0');
  FUN_140003e60(&local_58,param_2,~uVar3 - 1);
  if (*(longlong *)(param_1 + 0x250) != 0) {
    pcVar4 = &local_58;
    if (0xf < local_40) {
      pcVar4 = (char *)CONCAT71(uStack_57,local_58);
    }
    pcVar2 = &local_58;
    if (0xf < local_40) {
      pcVar2 = (char *)CONCAT71(uStack_57,local_58);
    }
    for (; pcVar2 != pcVar4 + local_48; pcVar2 = pcVar2 + 1) {
      uVar5 = uVar5 ^ (uVar5 >> 2) + uVar5 * 0x40 + 0x9e3779b9 + (longlong)*pcVar2;
    }
    uVar5 = FUN_14001d680(*(longlong *)(param_1 + 0x230) +
                          (uVar5 % *(ulonglong *)(param_1 + 0x238)) * 8,&local_58);
  }
  if (0xf < local_40) {
    operator_delete((void *)CONCAT71(uStack_57,local_58));
  }
  if (uVar5 == 0) {
    local_a0 = 0xf;
    local_a8 = 0;
    local_b8[0] = (void *)((ulonglong)local_b8[0] & 0xffffffffffffff00);
    uVar5 = 0xffffffffffffffff;
    pcVar4 = param_2;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      cVar1 = *pcVar4;
      pcVar4 = pcVar4 + 1;
    } while (cVar1 != '\0');
    FUN_140003e60(local_b8,param_2,~uVar5 - 1);
    local_70 = 0xf;
    local_78 = 0;
    local_88[0] = (void *)((ulonglong)local_88[0] & 0xffffffffffffff00);
    local_90 = param_3;
    if (local_a0 < 0x10) {
      memmove(local_88,local_b8,local_a8 + 1);
      local_70 = local_a0;
    }
    else {
      local_88[0] = local_b8[0];
      local_b8[0] = (void *)0x0;
      local_70 = local_a0;
    }
    local_78 = local_a8;
    local_a8 = 0;
    local_a0 = 0;
    local_60 = local_90;
    if (*(longlong *)(param_1 + 0x250) == 0) {
      FUN_14001d990(param_1 + 0x230,&local_58,local_88);
    }
    else {
      FUN_14001d800(param_1 + 0x230,local_d0,local_88,local_88);
    }
    if (0xf < local_70) {
      operator_delete(local_88[0]);
    }
    local_70 = 0xf;
    local_78 = 0;
    local_88[0] = (void *)((ulonglong)local_88[0] & 0xffffffffffffff00);
    if (0xf < local_a0) {
      operator_delete(local_b8[0]);
    }
  }
  FUN_1400d1290(param_1 + 0xe8);
  return;
}



void FUN_14001b450(undefined8 *param_1)

{
  if (0xf < (ulonglong)param_1[3]) {
    operator_delete((void *)*param_1);
  }
  param_1[3] = 0xf;
  param_1[2] = 0;
  *(undefined1 *)param_1 = 0;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14001b490(longlong param_1,char *param_2)

{
  char cVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong *plVar4;
  longlong *plVar5;
  ulonglong uVar6;
  char *pcVar7;
  char *pcVar8;
  longlong *plVar9;
  longlong *plVar10;
  undefined1 auStack_98 [32];
  longlong *local_78;
  longlong *plStack_70;
  undefined8 local_68;
  char local_60;
  undefined7 uStack_5f;
  longlong local_50;
  ulonglong local_48;
  ulonglong local_38;
  
  local_68 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_98;
  local_78 = (longlong *)(param_1 + 0xe8);
  FUN_1400a1c30();
  plStack_70 = (longlong *)CONCAT71(plStack_70._1_7_,1);
  local_48 = 0xf;
  local_50 = 0;
  local_60 = '\0';
  uVar6 = 0xffffffffffffffff;
  pcVar8 = param_2;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    cVar1 = *pcVar8;
    pcVar8 = pcVar8 + 1;
  } while (cVar1 != '\0');
  FUN_140003e60(&local_60,param_2,~uVar6 - 1);
  if (*(longlong *)(param_1 + 0x250) != 0) {
    pcVar8 = &local_60;
    if (0xf < local_48) {
      pcVar8 = (char *)CONCAT71(uStack_5f,local_60);
    }
    pcVar7 = &local_60;
    if (0xf < local_48) {
      pcVar7 = (char *)CONCAT71(uStack_5f,local_60);
    }
    uVar6 = 0;
    for (; pcVar7 != pcVar8 + local_50; pcVar7 = pcVar7 + 1) {
      uVar6 = uVar6 ^ (uVar6 >> 2) + uVar6 * 0x40 + 0x9e3779b9 + (longlong)*pcVar7;
    }
    plVar10 = (longlong *)
              (*(longlong *)(param_1 + 0x230) + (uVar6 % *(ulonglong *)(param_1 + 0x238)) * 8);
    plStack_70 = (longlong *)FUN_14001d680(plVar10,&local_60);
    if (plStack_70 != (longlong *)0x0) goto LAB_14001b5b1;
  }
  plVar10 = (longlong *)0x0;
  plStack_70 = (longlong *)0x0;
LAB_14001b5b1:
  plVar5 = plStack_70;
  local_78 = plVar10;
  if (0xf < local_48) {
    operator_delete((void *)CONCAT71(uStack_5f,local_60));
  }
  if (plVar5 != (longlong *)0x0) {
    lVar2 = *plVar5;
    plVar9 = local_78;
    while (lVar2 == 0) {
      plVar9 = plVar9 + 1;
      lVar2 = *plVar9;
    }
    *(longlong *)(param_1 + 0x250) = *(longlong *)(param_1 + 0x250) + -1;
    plVar3 = (longlong *)*plVar10;
    plVar4 = plVar10;
    while (plVar3 != plVar5) {
      plVar4 = (longlong *)*plVar4;
      plVar3 = (longlong *)*plVar4;
    }
    *plVar4 = *plVar5;
    if (0xf < (ulonglong)plVar5[4]) {
      operator_delete((void *)plVar5[1]);
    }
    plVar5[4] = 0xf;
    plVar5[3] = 0;
    *(undefined1 *)(plVar5 + 1) = 0;
    operator_delete(plVar5);
    if ((plVar10 == *(longlong **)(param_1 + 0x260)) && (*plVar10 == 0)) {
      *(longlong **)(param_1 + 0x260) = plVar9;
    }
  }
  FUN_1400d1290(param_1 + 0xe8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined4 FUN_14001b680(longlong param_1,char *param_2)

{
  longlong lVar1;
  char cVar2;
  undefined4 uVar3;
  char *pcVar4;
  longlong lVar5;
  ulonglong uVar6;
  char *pcVar7;
  undefined1 auStack_88 [32];
  longlong local_68;
  undefined1 local_60;
  undefined8 local_58;
  char local_50;
  undefined7 uStack_4f;
  longlong local_40;
  ulonglong local_38;
  ulonglong local_28;
  
  local_58 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  lVar1 = param_1 + 0xe8;
  local_68 = lVar1;
  FUN_1400a1c30();
  local_60 = 1;
  local_38 = 0xf;
  local_40 = 0;
  local_50 = '\0';
  uVar6 = 0xffffffffffffffff;
  pcVar7 = param_2;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    cVar2 = *pcVar7;
    pcVar7 = pcVar7 + 1;
  } while (cVar2 != '\0');
  FUN_140003e60(&local_50,param_2,~uVar6 - 1);
  if (*(longlong *)(param_1 + 0x250) == 0) {
    lVar5 = 0;
  }
  else {
    pcVar7 = &local_50;
    if (0xf < local_38) {
      pcVar7 = (char *)CONCAT71(uStack_4f,local_50);
    }
    pcVar4 = &local_50;
    if (0xf < local_38) {
      pcVar4 = (char *)CONCAT71(uStack_4f,local_50);
    }
    uVar6 = 0;
    for (; pcVar4 != pcVar7 + local_40; pcVar4 = pcVar4 + 1) {
      uVar6 = uVar6 ^ (uVar6 >> 2) + uVar6 * 0x40 + 0x9e3779b9 + (longlong)*pcVar4;
    }
    lVar5 = FUN_14001d680(*(longlong *)(param_1 + 0x230) +
                          (uVar6 % *(ulonglong *)(param_1 + 0x238)) * 8,&local_50);
  }
  if (0xf < local_38) {
    operator_delete((void *)CONCAT71(uStack_4f,local_50));
  }
  local_38 = 0xf;
  local_40 = 0;
  local_50 = '\0';
  if (lVar5 == 0) {
    FUN_1400d1290(lVar1);
    uVar3 = 0;
  }
  else {
    uVar3 = *(undefined4 *)(lVar5 + 0x30);
    FUN_1400d1290(lVar1);
  }
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14001b800(longlong param_1,longlong param_2)

{
  int *piVar1;
  undefined *puVar2;
  longlong lVar3;
  char cVar4;
  errno_t eVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  undefined8 uVar10;
  undefined8 *puVar11;
  char *pcVar12;
  ulonglong uVar13;
  undefined *puVar14;
  undefined1 *puVar15;
  char *pcVar16;
  undefined1 auStack_1a8 [32];
  undefined4 *local_188;
  uint *local_180;
  uint *local_178;
  char *local_170;
  undefined8 local_168;
  undefined8 local_160;
  undefined8 local_158;
  undefined *local_148;
  char local_140 [4];
  uint local_13c;
  uint local_138 [2];
  undefined8 local_130;
  int local_128;
  undefined4 local_120 [2];
  undefined8 local_118;
  short local_110;
  short local_10e;
  undefined2 local_10c;
  short local_10a;
  short local_108;
  short local_106;
  short local_104;
  undefined2 local_102;
  undefined8 local_100;
  undefined8 local_f8;
  undefined8 local_f0;
  undefined1 local_e8;
  ushort local_e6;
  undefined1 local_d0;
  undefined7 uStack_cf;
  undefined8 local_c0;
  ulonglong local_b8;
  tm local_a8;
  undefined1 local_80;
  undefined7 uStack_7f;
  undefined8 local_70;
  ulonglong local_68;
  undefined1 local_58 [8];
  ushort local_50;
  ulonglong local_48;
  
  local_118 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_1a8;
  iVar9 = 0;
  local_13c = 0;
  local_138[0] = 0;
  if ((DAT_140320f64 & 1) == 0) {
    DAT_140320f64 = DAT_140320f64 | 1;
    FUN_1400908e0();
    atexit((_func_5014 *)&LAB_140202650);
  }
  if (DAT_1403206c1 != '\0') {
    local_148 = (undefined *)_time64((__time64_t *)0x0);
    local_130 = 0;
    local_128 = 0;
    eVar5 = _localtime64_s(&local_a8,(__time64_t *)&local_148);
    if (eVar5 == 0) {
      local_110 = (short)local_a8.tm_year + 0x76c;
      local_10e = (short)local_a8.tm_mon + 1;
      local_10c = (undefined2)local_a8.tm_wday;
      local_10a = (short)local_a8.tm_mday;
      local_108 = (short)local_a8.tm_hour;
      local_106 = (short)local_a8.tm_min;
      local_104 = (short)local_a8.tm_sec;
      local_102 = 0;
      iVar6 = Ordinal_184(&local_110,&local_130);
      local_100 = 0;
      local_f8 = 0;
      if ((((iVar6 == 0) || (iVar6 = Ordinal_185(local_130,&local_100), iVar6 == 0)) ||
          (local_110 != (short)local_100)) ||
         (((local_10e != local_100._2_2_ || (local_10a != local_100._6_2_)) ||
          ((local_108 != (short)local_f8 ||
           ((local_106 != local_f8._2_2_ || (local_104 != local_f8._4_2_)))))))) goto LAB_14001b989;
      local_128 = 0;
      iVar6 = Ordinal_185(local_130,local_58);
      if (iVar6 == 0) goto LAB_14001b98c;
      local_13c = (uint)local_50;
    }
    else {
LAB_14001b989:
      local_128 = 1;
LAB_14001b98c:
      local_13c = 0xffffffff;
    }
    if ((local_128 == 0) && (iVar6 = Ordinal_185(local_130,&local_f0), iVar6 != 0)) {
      local_138[0] = (uint)local_e6;
    }
    else {
      local_138[0] = 0xffffffff;
    }
  }
  *(undefined4 *)(param_2 + 0x1e8) = 0;
  local_178 = (uint *)(param_2 + 0x10);
  if (7 < *(ulonglong *)(param_2 + 0x28)) {
    local_178 = *(uint **)local_178;
  }
  lVar3 = param_2 + 0x200;
  local_158 = 0;
  local_160 = 0;
  local_168 = 0;
  local_170 = (char *)CONCAT44(local_170._4_4_,1);
  local_180 = (uint *)CONCAT44(local_180._4_4_,*(undefined4 *)(DAT_140320138 + 0x140));
  local_188 = (undefined4 *)lVar3;
  (**(code **)(**(longlong **)(param_1 + 0x88) + 8))
            (*(longlong **)(param_1 + 0x88),*(undefined4 *)(param_2 + 0x1f0),
             *(undefined4 *)(param_2 + 0x1ec),*(undefined4 *)(param_2 + 8));
  local_120[0] = 1;
  *(undefined4 *)(param_2 + 0x1fc) = 1;
  if ((DAT_140320f64 & 1) == 0) {
    DAT_140320f64 = DAT_140320f64 | 1;
    FUN_1400908e0();
    atexit((_func_5014 *)&LAB_140202650);
  }
  local_140[0] = DAT_1403206c1;
  FUN_1400a3440();
  local_148 = PTR_DAT_1402f8008;
  iVar6 = FUN_1400a3360(lVar3);
  if ((local_148 != (undefined *)0x0) && (local_148 != PTR_DAT_1402f8008)) {
    iVar9 = *(int *)(local_148 + -8);
  }
  iVar7 = 0;
  iVar8 = iVar6;
  if (((iVar6 <= iVar9) && (iVar8 = iVar7, local_148 != (undefined *)0x0)) &&
     (local_148 != PTR_DAT_1402f8008)) {
    iVar8 = *(int *)(local_148 + -8);
  }
  iVar9 = 1;
  if (1 < iVar8) {
    iVar9 = iVar8;
  }
  iVar8 = iVar7;
  if ((local_148 != (undefined *)0x0) && (local_148 != PTR_DAT_1402f8008)) {
    iVar8 = *(int *)(local_148 + -8);
  }
  if (iVar8 < iVar9) {
    FUN_14000c1c0(&local_148);
  }
  FUN_14000c330(&local_148);
  puVar14 = local_148;
  if (local_148 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar14,lVar3,iVar6);
  puVar14 = local_148;
  if (local_148 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8008;
  }
  iVar6 = FUN_1400a3360(puVar14);
  iVar9 = 0;
  if (0 < iVar6) {
    iVar9 = iVar6;
  }
  iVar6 = iVar7;
  if ((local_148 != (undefined *)0x0) && (local_148 != PTR_DAT_1402f8008)) {
    iVar6 = *(int *)(local_148 + -8);
  }
  if ((iVar6 <= iVar9) && (iVar9 = iVar7, local_148 != (undefined *)0x0)) {
    if (local_148 == PTR_DAT_1402f8008) goto LAB_14001bb62;
    iVar9 = *(int *)(local_148 + -8);
  }
  if (((local_148 != PTR_DAT_1402f8008) && (local_148 != (undefined *)0x0)) &&
     (piVar1 = (int *)(local_148 + -8), piVar1 != (int *)0x0)) {
    *piVar1 = iVar9;
    *(undefined1 *)((longlong)iVar9 + 8 + (longlong)piVar1) = 0;
  }
LAB_14001bb62:
  local_170 = local_140;
  local_178 = local_138;
  local_180 = &local_13c;
  local_188 = local_120;
  (**(code **)(*(longlong *)(param_1 + 0x60) + 0x200))
            (param_1 + 0x60,*(undefined4 *)(param_2 + 8),&DAT_14030ab90,&local_148);
  puVar14 = local_148;
  if (((local_148 != (undefined *)0x0) && (local_148 != PTR_DAT_1402f8008)) &&
     (puVar2 = local_148 + -8, puVar2 != (undefined *)0x0)) {
    uVar10 = FUN_1400a3440();
    local_f0 = uVar10;
    FUN_1400a1c30(uVar10);
    local_e8 = 1;
    piVar1 = (int *)(puVar14 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2);
    }
    FUN_1400d1290(uVar10);
  }
  local_68 = 0xf;
  local_70 = 0;
  local_80 = 0;
  local_b8 = 0xf;
  local_c0 = 0;
  local_d0 = 0;
  uVar10 = FUN_1400aab20(&local_f0);
  puVar11 = (undefined8 *)FUN_1401e1940(&local_a8,uVar10);
  if (0xf < (ulonglong)puVar11[3]) {
    puVar11 = (undefined8 *)*puVar11;
  }
  FUN_1401e1870(&local_80,"%s,%s",lVar3,puVar11);
  if (0xf < CONCAT62(local_a8._26_6_,(undefined2)local_a8.tm_wday)) {
    operator_delete((void *)CONCAT26(local_a8.tm_min._2_2_,
                                     CONCAT24((short)local_a8.tm_min,
                                              CONCAT22(local_a8.tm_sec._2_2_,(short)local_a8.tm_sec)
                                             )));
  }
  puVar15 = &local_80;
  if (0xf < local_68) {
    puVar15 = (undefined1 *)CONCAT71(uStack_7f,local_80);
  }
  if (*(longlong *)(param_1 + 0x1f0) != 0) {
    FUN_1400af0d0(&local_f0);
    FUN_1400ae9a0(*(undefined8 *)(param_1 + 0x1f0),puVar15,&local_f0);
    pcVar12 = (char *)FUN_1400af210();
    uVar13 = 0xffffffffffffffff;
    pcVar16 = pcVar12;
    do {
      if (uVar13 == 0) break;
      uVar13 = uVar13 - 1;
      cVar4 = *pcVar16;
      pcVar16 = pcVar16 + 1;
    } while (cVar4 != '\0');
    FUN_140003e60(&local_d0,pcVar12,~uVar13 - 1);
    FUN_1400af160(&local_f0);
  }
  puVar15 = &local_d0;
  if (0xf < local_b8) {
    puVar15 = (undefined1 *)CONCAT71(uStack_cf,local_d0);
  }
  FUN_1400a3440();
  local_148 = PTR_DAT_1402f8008;
  iVar9 = FUN_1400a3360(puVar15);
  if (local_148 == (undefined *)0x0) {
    iVar6 = 0;
  }
  else if (local_148 == PTR_DAT_1402f8008) {
    iVar6 = 0;
  }
  else {
    iVar6 = *(int *)(local_148 + -8);
  }
  iVar8 = iVar9;
  if (iVar9 <= iVar6) {
    if (local_148 == (undefined *)0x0) {
      iVar8 = 0;
    }
    else if (local_148 == PTR_DAT_1402f8008) {
      iVar8 = 0;
    }
    else {
      iVar8 = *(int *)(local_148 + -8);
    }
  }
  iVar6 = 1;
  if (1 < iVar8) {
    iVar6 = iVar8;
  }
  if (local_148 == (undefined *)0x0) {
    iVar8 = 0;
  }
  else if (local_148 == PTR_DAT_1402f8008) {
    iVar8 = 0;
  }
  else {
    iVar8 = *(int *)(local_148 + -8);
  }
  if (iVar8 < iVar6) {
    FUN_14000c1c0(&local_148,iVar6);
  }
  FUN_14000c330(&local_148);
  puVar14 = local_148;
  if (local_148 == (undefined *)0x0) {
    puVar14 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar14,puVar15,iVar9);
  iVar6 = FUN_1400a3360();
  iVar9 = 0;
  if (0 < iVar6) {
    iVar9 = iVar6;
  }
  if (local_148 == (undefined *)0x0) {
    iVar6 = 0;
  }
  else if (local_148 == PTR_DAT_1402f8008) {
    iVar6 = 0;
  }
  else {
    iVar6 = *(int *)(local_148 + -8);
  }
  if (iVar6 <= iVar9) {
    if (local_148 == (undefined *)0x0) {
      iVar9 = 0;
    }
    else if (local_148 == PTR_DAT_1402f8008) {
      iVar9 = 0;
    }
    else {
      iVar9 = *(int *)(local_148 + -8);
    }
  }
  if (((local_148 != PTR_DAT_1402f8008) && (local_148 != (undefined *)0x0)) &&
     (piVar1 = (int *)(local_148 + -8), piVar1 != (int *)0x0)) {
    *piVar1 = iVar9;
    *(undefined1 *)((longlong)iVar9 + 8 + (longlong)piVar1) = 0;
  }
  (**(code **)(*(longlong *)(param_1 + 0x60) + 0x260))
            (param_1 + 0x60,*(undefined4 *)(param_2 + 8),&DAT_14030ad10,&local_148);
  puVar14 = local_148;
  if (((local_148 != (undefined *)0x0) && (local_148 != PTR_DAT_1402f8008)) &&
     (puVar2 = local_148 + -8, puVar2 != (undefined *)0x0)) {
    uVar10 = FUN_1400a3440();
    local_f0 = uVar10;
    FUN_1400a1c30(uVar10);
    local_e8 = 1;
    piVar1 = (int *)(puVar14 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2);
    }
    FUN_1400d1290(uVar10);
  }
  if (0xf < local_b8) {
    operator_delete((void *)CONCAT71(uStack_cf,local_d0));
  }
  local_b8 = 0xf;
  local_c0 = 0;
  local_d0 = 0;
  if (0xf < local_68) {
    operator_delete((void *)CONCAT71(uStack_7f,local_80));
  }
  return;
}



void FUN_14001beb0(longlong param_1,undefined8 param_2,char param_3,undefined4 param_4)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined4 local_18 [2];
  longlong local_10;
  
  iVar1 = FUN_14001b680();
  if (iVar1 != 0) {
    plVar2 = (longlong *)FUN_14000f1a0(param_1,&local_10,iVar1);
    lVar3 = 0;
    if ((longlong *)*plVar2 != (longlong *)0x0) {
      lVar3 = *(longlong *)*plVar2;
    }
    if ((local_10 != 0) &&
       (*(longlong *)(local_10 + 8) = *(longlong *)(local_10 + 8) + -1,
       *(longlong *)(local_10 + 8) == 0)) {
      FUN_1400219e0(local_10);
    }
    if (lVar3 != 0) {
      if (param_3 == '\x01') {
        FUN_14001b800(param_1,lVar3);
      }
      else {
        local_18[0] = param_4;
        (**(code **)(*(longlong *)(param_1 + 0x60) + 0x70))
                  (param_1 + 0x60,iVar1,&DAT_14030ab90,local_18);
      }
    }
  }
  return;
}



void FUN_14001bf80(longlong param_1)

{
  void *pvVar1;
  undefined8 *puVar2;
  uint uVar3;
  longlong lVar5;
  longlong *plVar6;
  undefined8 *puVar7;
  undefined8 *puVar8;
  undefined8 *puVar4;
  
  FUN_1400a1c30(param_1 + 0xe8);
  wprintf(L"%s\n");
  puVar8 = (undefined8 *)0x0;
  puVar2 = puVar8;
  if ((*(longlong *)(param_1 + 0x128) != 0) && (*(uint *)(param_1 + 0x130) != 0)) {
    puVar4 = puVar8;
    plVar6 = *(longlong **)(param_1 + 0x120);
    do {
      if (*plVar6 != 0) {
        puVar2 = (undefined8 *)(*(longlong **)(param_1 + 0x120))[(longlong)puVar4];
        break;
      }
      uVar3 = (int)puVar4 + 1;
      puVar4 = (undefined8 *)(ulonglong)uVar3;
      plVar6 = plVar6 + 1;
    } while (uVar3 < *(uint *)(param_1 + 0x130));
  }
  do {
    if (puVar2 == (undefined8 *)0x0) {
      FUN_1400d1290(param_1 + 0xe8);
      return;
    }
    if (puVar2 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    puVar4 = puVar8;
    if ((puVar2 != (undefined8 *)0x0) &&
       (puVar4 = (undefined8 *)puVar2[2], (undefined8 *)puVar2[2] == (undefined8 *)0x0)) {
      uVar3 = *(uint *)(puVar2 + 3) % *(uint *)(param_1 + 0x130) + 1;
      lVar5 = (longlong)(int)uVar3 << 3;
      puVar4 = puVar8;
      do {
        if (*(uint *)(param_1 + 0x130) <= uVar3) break;
        if (*(longlong *)(lVar5 + *(longlong *)(param_1 + 0x120)) != 0) {
          puVar4 = *(undefined8 **)(lVar5 + *(longlong *)(param_1 + 0x120));
        }
        uVar3 = uVar3 + 1;
        lVar5 = lVar5 + 8;
      } while (puVar4 == (undefined8 *)0x0);
    }
    puVar7 = puVar8;
    if (puVar2[1] != 0) {
      *(longlong *)(puVar2[1] + 8) = *(longlong *)(puVar2[1] + 8) + 1;
      puVar7 = (undefined8 *)puVar2[1];
    }
    printf("ID [ %s ] : ");
    wprintf(L"UserSession %s \n");
    puVar2 = puVar4;
    if (puVar7 != (undefined8 *)0x0) {
      plVar6 = puVar7 + 1;
      *plVar6 = *plVar6 + -1;
      if (*plVar6 == 0) {
        pvVar1 = (void *)*puVar7;
        if (pvVar1 != (void *)0x0) {
          if (7 < *(ulonglong *)((longlong)pvVar1 + 0x28)) {
            operator_delete(*(void **)((longlong)pvVar1 + 0x10));
          }
          *(undefined8 *)((longlong)pvVar1 + 0x28) = 7;
          *(undefined8 *)((longlong)pvVar1 + 0x20) = 0;
          *(undefined2 *)((longlong)pvVar1 + 0x10) = 0;
          operator_delete(pvVar1);
        }
        FUN_1400a3530(puVar7);
      }
    }
  } while( true );
}



void thunk_FUN_14001c600(void)

{
  FUN_14001c600();
  return;
}



void FUN_14001c190(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_14001d750();
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014001c21b)
// WARNING: Removing unreachable block (ram,0x00014001c220)

longlong * FUN_14001c1b0(longlong *param_1,longlong *param_2)

{
  void *pvVar1;
  ulonglong uVar2;
  char cVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  ulonglong uVar7;
  
  if (param_1 == param_2) {
    return param_1;
  }
  lVar4 = *param_2;
  lVar6 = param_2[1] - lVar4;
  lVar5 = lVar6 >> 0x3f;
  lVar6 = lVar6 / 0x84 + lVar5;
  uVar7 = lVar6 - lVar5;
  if (lVar6 == lVar5) {
    if (*param_1 != param_1[1]) {
      param_1[1] = *param_1;
    }
  }
  else {
    pvVar1 = (void *)*param_1;
    uVar2 = (param_1[1] - (longlong)pvVar1) / 0x84;
    if (uVar2 < uVar7) {
      if ((ulonglong)((param_1[2] - (longlong)pvVar1) / 0x84) < uVar7) {
        if (pvVar1 != (void *)0x0) {
          operator_delete(pvVar1);
        }
        cVar3 = FUN_14001c690(param_1,(param_2[1] - *param_2) / 0x84);
        if (cVar3 == '\0') {
          return param_1;
        }
        lVar4 = *param_1;
        lVar5 = param_2[1];
        lVar6 = *param_2;
      }
      else {
        lVar6 = uVar2 * 0x84 + lVar4;
        FUN_14001cf90(lVar4,lVar6,pvVar1);
        lVar4 = param_1[1];
        lVar5 = param_2[1];
      }
      lVar4 = FUN_14007c0b0(lVar6,lVar5,lVar4);
      param_1[1] = lVar4;
    }
    else {
      FUN_14001cf90(lVar4,param_2[1],pvVar1);
      param_1[1] = ((param_2[1] - *param_2) / 0x84) * 0x84 + *param_1;
    }
  }
  return param_1;
}



longlong * FUN_14001c360(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  
  lVar1 = 0;
  *param_1 = 0;
  if (*param_2 != 0) {
    *(longlong *)(*param_2 + 8) = *(longlong *)(*param_2 + 8) + 1;
    if ((*param_1 != 0) &&
       (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
       *(longlong *)(*param_1 + 8) == 0)) {
      lVar1 = *param_1;
    }
    *param_1 = *param_2;
    if (lVar1 != 0) {
      FUN_1400219e0(lVar1);
    }
  }
  return param_1;
}



undefined8 *
FUN_14001c3d0(undefined8 *param_1,ulonglong param_2,undefined8 *param_3,ulonglong param_4)

{
  ulonglong uVar1;
  code *pcVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  
  if (param_3 != (undefined8 *)0x0) {
    uVar1 = param_1[3];
    puVar3 = param_1;
    if (0xf < uVar1) {
      puVar3 = (undefined8 *)*param_1;
    }
    if (puVar3 <= param_3) {
      puVar3 = param_1;
      if (0xf < uVar1) {
        puVar3 = (undefined8 *)*param_1;
      }
      if (param_3 < (undefined8 *)((longlong)puVar3 + param_1[2])) {
        puVar3 = param_1;
        if (0xf < uVar1) {
          puVar3 = (undefined8 *)*param_1;
        }
        puVar3 = (undefined8 *)
                 FUN_14001c700(param_1,param_2,param_1,(longlong)param_3 - (longlong)puVar3,param_4)
        ;
        return puVar3;
      }
    }
  }
  uVar1 = param_1[2];
  if (uVar1 < param_2) {
    std::_Xout_of_range("invalid string position");
    pcVar2 = (code *)swi(3);
    puVar3 = (undefined8 *)(*pcVar2)();
    return puVar3;
  }
  if (param_4 < -uVar1 - 1) {
    if (param_4 != 0) {
      uVar1 = uVar1 + param_4;
      if (uVar1 == 0xffffffffffffffff) {
        std::_Xlength_error("string too long");
        pcVar2 = (code *)swi(3);
        puVar3 = (undefined8 *)(*pcVar2)();
        return puVar3;
      }
      if ((ulonglong)param_1[3] < uVar1) {
        FUN_140004270(param_1,uVar1);
        if (uVar1 == 0) {
          return param_1;
        }
      }
      else if (uVar1 == 0) {
        param_1[2] = 0;
        if (0xf < (ulonglong)param_1[3]) {
          *(undefined1 *)*param_1 = 0;
          return param_1;
        }
        *(undefined1 *)param_1 = 0;
        return param_1;
      }
      puVar4 = param_1;
      puVar3 = param_1;
      if (0xf < (ulonglong)param_1[3]) {
        puVar4 = (undefined8 *)*param_1;
        puVar3 = (undefined8 *)*param_1;
      }
      memmove((void *)((longlong)puVar4 + param_4 + param_2),(void *)((longlong)puVar3 + param_2),
              param_1[2] - param_2);
      puVar3 = param_1;
      if (0xf < (ulonglong)param_1[3]) {
        puVar3 = (undefined8 *)*param_1;
      }
      memcpy((void *)((longlong)puVar3 + param_2),param_3,param_4);
      param_1[2] = uVar1;
      puVar3 = param_1;
      if (0xf < (ulonglong)param_1[3]) {
        puVar3 = (undefined8 *)*param_1;
      }
      *(undefined1 *)((longlong)puVar3 + uVar1) = 0;
    }
    return param_1;
  }
  std::_Xlength_error("string too long");
  pcVar2 = (code *)swi(3);
  puVar3 = (undefined8 *)(*pcVar2)();
  return puVar3;
}



void FUN_14001c570(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = param_1[1] - *param_1 >> 2;
  if (0x3ffffffffffffffe < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = param_1[2] - *param_1 >> 2;
  if (uVar2 < uVar3) {
    if (0x3fffffffffffffff - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_14001c8b0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_14001c8b0(param_1,uVar2);
  }
  return;
}



void FUN_14001c600(undefined8 *param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  puVar2 = (undefined8 *)*param_1;
  if (puVar2 != (undefined8 *)0x0) {
    puVar1 = (undefined8 *)param_1[1];
    for (; puVar2 != puVar1; puVar2 = puVar2 + 5) {
      if (0xf < (ulonglong)puVar2[3]) {
        operator_delete((void *)*puVar2);
      }
      puVar2[3] = 0xf;
      puVar2[2] = 0;
      *(undefined1 *)puVar2 = 0;
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



undefined8 FUN_14001c690(longlong *param_1,ulonglong param_2)

{
  code *pcVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  uVar2 = 0;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  if (param_2 != 0) {
    if (0x1f07c1f07c1f07c < param_2) {
      std::_Xlength_error("vector<T> too long");
      pcVar1 = (code *)swi(3);
      uVar2 = (*pcVar1)();
      return uVar2;
    }
    lVar3 = FUN_14001ca20(param_2);
    *param_1 = lVar3;
    param_1[1] = lVar3;
    uVar2 = 1;
    param_1[2] = param_2 * 0x84 + lVar3;
  }
  return uVar2;
}



undefined8 *
FUN_14001c700(undefined8 *param_1,ulonglong param_2,undefined8 *param_3,ulonglong param_4,
             ulonglong param_5)

{
  ulonglong uVar1;
  code *pcVar2;
  ulonglong uVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  
  uVar1 = param_1[2];
  if ((uVar1 < param_2) || ((ulonglong)param_3[2] < param_4)) {
    std::_Xout_of_range("invalid string position");
    pcVar2 = (code *)swi(3);
    puVar4 = (undefined8 *)(*pcVar2)();
    return puVar4;
  }
  uVar3 = param_3[2] - param_4;
  if (uVar3 < param_5) {
    param_5 = uVar3;
  }
  if (param_5 < -uVar1 - 1) {
    if (param_5 != 0) {
      uVar1 = uVar1 + param_5;
      if (uVar1 == 0xffffffffffffffff) {
        std::_Xlength_error("string too long");
        pcVar2 = (code *)swi(3);
        puVar4 = (undefined8 *)(*pcVar2)();
        return puVar4;
      }
      if ((ulonglong)param_1[3] < uVar1) {
        FUN_140004270(param_1,uVar1);
        if (uVar1 == 0) {
          return param_1;
        }
      }
      else if (uVar1 == 0) {
        param_1[2] = 0;
        if (0xf < (ulonglong)param_1[3]) {
          *(undefined1 *)*param_1 = 0;
          return param_1;
        }
        *(undefined1 *)param_1 = 0;
        return param_1;
      }
      puVar5 = param_1;
      puVar4 = param_1;
      if (0xf < (ulonglong)param_1[3]) {
        puVar5 = (undefined8 *)*param_1;
        puVar4 = (undefined8 *)*param_1;
      }
      memmove((void *)((longlong)puVar5 + param_5 + param_2),
              (undefined1 *)((longlong)puVar4 + param_2),param_1[2] - param_2);
      if (param_1 == param_3) {
        if (param_2 < param_4) {
          param_4 = param_4 + param_5;
        }
        puVar5 = param_1;
        puVar4 = param_1;
        if (0xf < (ulonglong)param_1[3]) {
          puVar5 = (undefined8 *)*param_1;
          puVar4 = (undefined8 *)*param_1;
        }
        memmove((void *)((longlong)puVar5 + param_2),(void *)((longlong)puVar4 + param_4),param_5);
      }
      else {
        if (0xf < (ulonglong)param_3[3]) {
          param_3 = (undefined8 *)*param_3;
        }
        puVar4 = param_1;
        if (0xf < (ulonglong)param_1[3]) {
          puVar4 = (undefined8 *)*param_1;
        }
        memcpy((void *)((longlong)puVar4 + param_2),(undefined1 *)((longlong)param_3 + param_4),
               param_5);
      }
      param_1[2] = uVar1;
      puVar4 = param_1;
      if (0xf < (ulonglong)param_1[3]) {
        puVar4 = (undefined8 *)*param_1;
      }
      *(undefined1 *)((longlong)puVar4 + uVar1) = 0;
    }
    return param_1;
  }
  std::_Xlength_error("string too long");
  pcVar2 = (code *)swi(3);
  puVar4 = (undefined8 *)(*pcVar2)();
  return puVar4;
}



void FUN_14001c8b0(longlong *param_1,ulonglong param_2)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined **local_20 [3];
  
  if (0x3fffffffffffffff < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)(param_1[2] - *param_1 >> 2) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 4);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    memmove(local_res10,(void *)*param_1,param_1[1] - *param_1 & 0xfffffffffffffffc);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 4);
    param_1[1] = (longlong)(pcVar4 + (lVar2 - (longlong)pvVar1 >> 2) * 4);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



void FUN_14001c9c0(undefined8 *param_1,undefined8 *param_2)

{
  for (; param_1 != param_2; param_1 = param_1 + 5) {
    if (0xf < (ulonglong)param_1[3]) {
      operator_delete((void *)*param_1);
    }
    param_1[3] = 0xf;
    param_1[2] = 0;
    *(undefined1 *)param_1 = 0;
  }
  return;
}



void * FUN_14001ca20(ulonglong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  if (param_1 == 0) {
    return (void *)0x0;
  }
  if ((param_1 < 0x1f07c1f07c1f07d) &&
     (pvVar1 = operator_new(param_1 * 0x84), pvVar1 != (void *)0x0)) {
    return pvVar1;
  }
  local_res8[0] = (char *)0x0;
  std::exception::exception((exception *)local_28,local_res8);
  local_28[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_28,(ThrowInfo *)&DAT_1402f47a8);
}



void FUN_14001ca90(longlong *param_1,ulonglong param_2)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined **local_20 [3];
  
  if (0x1fffffffffffffff < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)(param_1[2] - *param_1 >> 3) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 8);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    memmove(local_res10,(void *)*param_1,param_1[1] - *param_1 & 0xfffffffffffffff8);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 8);
    param_1[1] = (longlong)(pcVar4 + (lVar2 - (longlong)pvVar1 >> 3) * 8);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



uint * FUN_14001cba0(longlong *param_1,uint *param_2)

{
  uint uVar1;
  ulonglong uVar2;
  char cVar3;
  uint *puVar4;
  
  uVar1 = *param_2;
  uVar2 = (ulonglong)uVar1 % (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar3 = FUN_14000d350(param_1,(ulonglong)*(uint *)(param_1 + 2),1);
    if (cVar3 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  else {
    for (puVar4 = *(uint **)(*param_1 + uVar2 * 8); puVar4 != (uint *)0x0;
        puVar4 = *(uint **)(puVar4 + 4)) {
      if ((puVar4[6] == uVar1) && (*puVar4 == uVar1)) goto LAB_14001cc03;
    }
  }
  puVar4 = (uint *)FUN_14001dc40(param_1,param_2,uVar2,uVar1);
LAB_14001cc03:
  return puVar4 + 2;
}



undefined8 FUN_14001cc40(longlong *param_1,uint *param_2)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  uint *puVar4;
  uint *puVar5;
  
  lVar2 = *param_1;
  uVar1 = *param_2;
  if (lVar2 != 0) {
    puVar5 = *(uint **)(lVar2 + ((ulonglong)uVar1 % (ulonglong)*(uint *)(param_1 + 2)) * 8);
    puVar4 = (uint *)0x0;
    while (puVar3 = puVar5, puVar3 != (uint *)0x0) {
      if ((puVar3[6] == uVar1) && (*puVar3 == uVar1)) {
        if (puVar4 != (uint *)0x0) {
          *(undefined8 *)(puVar4 + 4) = *(undefined8 *)(puVar3 + 4);
          FUN_14001dd90(param_1,puVar3);
          return 1;
        }
        *(undefined8 *)(lVar2 + ((ulonglong)puVar3[6] % (ulonglong)*(uint *)(param_1 + 2)) * 8) =
             *(undefined8 *)(puVar3 + 4);
        FUN_14001dd90(param_1,puVar3);
        return 1;
      }
      puVar4 = puVar3;
      puVar5 = *(uint **)(puVar3 + 4);
    }
  }
  return 0;
}



void FUN_14001ccf0(void)

{
  FUN_14001d080();
  return;
}



ulonglong * FUN_14001cd10(longlong *param_1,ulonglong *param_2,undefined4 *param_3)

{
  char cVar1;
  int iVar2;
  ulonglong *puVar3;
  uint uVar4;
  ulonglong uVar5;
  bool bVar6;
  
  uVar4 = *(uint *)((longlong)param_2 + 0xc) ^ (uint)param_2[1] ^ *(uint *)((longlong)param_2 + 4) ^
          (uint)*param_2;
  uVar5 = (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar1 = FUN_14000d350(param_1,uVar5,1,uVar5,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(ulonglong **)(*param_1 + ((ulonglong)uVar4 % uVar5) * 8);
        puVar3 != (ulonglong *)0x0; puVar3 = (ulonglong *)puVar3[3]) {
      if ((uint)puVar3[4] == uVar4) {
        bVar6 = *puVar3 < *param_2;
        if ((*puVar3 == *param_2) && (bVar6 = puVar3[1] < param_2[1], puVar3[1] == param_2[1])) {
          iVar2 = 0;
        }
        else {
          iVar2 = (1 - (uint)bVar6) - (uint)(bVar6 != 0);
        }
        if (iVar2 == 0) {
          *(undefined4 *)(puVar3 + 2) = *param_3;
          return puVar3;
        }
      }
    }
  }
  puVar3 = (ulonglong *)FUN_14001ded0(param_1,param_2,(ulonglong)uVar4 % uVar5,uVar4);
  *(undefined4 *)(puVar3 + 2) = *param_3;
  return puVar3;
}



undefined8 FUN_14001cdf0(longlong *param_1,ulonglong *param_2)

{
  longlong lVar1;
  ulonglong *puVar2;
  ulonglong *puVar3;
  ulonglong *puVar4;
  int iVar5;
  uint uVar6;
  bool bVar7;
  
  lVar1 = *param_1;
  uVar6 = *(uint *)((longlong)param_2 + 0xc) ^ (uint)param_2[1] ^ *(uint *)((longlong)param_2 + 4) ^
          (uint)*param_2;
  if (lVar1 != 0) {
    puVar4 = *(ulonglong **)(lVar1 + ((ulonglong)uVar6 % (ulonglong)*(uint *)(param_1 + 2)) * 8);
    puVar3 = (ulonglong *)0x0;
    while (puVar2 = puVar4, puVar2 != (ulonglong *)0x0) {
      if ((uint)puVar2[4] == uVar6) {
        bVar7 = *puVar2 < *param_2;
        if ((*puVar2 == *param_2) && (bVar7 = puVar2[1] < param_2[1], puVar2[1] == param_2[1])) {
          iVar5 = 0;
        }
        else {
          iVar5 = (1 - (uint)bVar7) - (uint)(bVar7 != 0);
        }
        if (iVar5 == 0) {
          if (puVar3 != (ulonglong *)0x0) {
            puVar3[3] = puVar2[3];
            FUN_14001e050(param_1,puVar2);
            return 1;
          }
          *(ulonglong *)
           (lVar1 + ((ulonglong)(uint)puVar2[4] % (ulonglong)*(uint *)(param_1 + 2)) * 8) =
               puVar2[3];
          FUN_14001e050(param_1,puVar2);
          return 1;
        }
      }
      puVar3 = puVar2;
      puVar4 = (ulonglong *)puVar2[3];
    }
  }
  return 0;
}



void FUN_14001ceb0(void)

{
  FUN_14001d150();
  return;
}



void FUN_14001ced0(undefined8 *param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  
  if (param_1[4] != 0) {
    puVar4 = (undefined8 *)*param_1;
    puVar1 = puVar4 + param_1[1];
    for (; puVar4 != puVar1; puVar4 = puVar4 + 1) {
      puVar2 = (undefined8 *)*puVar4;
      *puVar4 = 0;
      while (puVar2 != (undefined8 *)0x0) {
        puVar3 = (undefined8 *)*puVar2;
        if (0xf < (ulonglong)puVar2[4]) {
          operator_delete((void *)puVar2[1]);
        }
        puVar2[4] = 0xf;
        puVar2[3] = 0;
        *(undefined1 *)(puVar2 + 1) = 0;
        operator_delete(puVar2);
        puVar2 = puVar3;
      }
    }
    param_1[4] = 0;
    param_1[6] = puVar1;
  }
  return;
}



void * FUN_14001cf90(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x84)) {
    memcpy(param_3,param_1,0x84);
    param_3 = (void *)((longlong)param_3 + 0x84);
  }
  return param_3;
}



void FUN_14001cff0(undefined8 *param_1,undefined1 *param_2,undefined1 *param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  
  uVar4 = (longlong)param_3 - (longlong)param_2;
  uVar1 = param_1[2];
  if (((uVar1 <= uVar4) && (param_1[3] != uVar4)) &&
     (cVar2 = FUN_1400041a0(param_1,uVar4,1,param_4,0xfffffffffffffffe), cVar2 != '\0')) {
    param_1[2] = uVar1;
    puVar3 = param_1;
    if (0xf < (ulonglong)param_1[3]) {
      puVar3 = (undefined8 *)*param_1;
    }
    *(undefined1 *)((longlong)puVar3 + uVar1) = 0;
  }
  for (; param_2 != param_3; param_2 = param_2 + 1) {
    FUN_14001f450(param_1,*param_2);
  }
  return;
}



void FUN_14001d080(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined4 uVar4;
  longlong *_Memory;
  ulonglong uVar5;
  uint uVar6;
  ulonglong uVar7;
  
  *(int *)(param_1 + 6) = (int)param_1[6] + 1;
  uVar5 = 0;
  if ((*param_1 != 0) && (uVar7 = uVar5, (int)param_1[2] != 0)) {
    do {
      lVar3 = *(longlong *)(*param_1 + uVar5);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x10);
        FUN_14001dd90(param_1,lVar3);
        lVar3 = lVar1;
      }
      uVar6 = (int)uVar7 + 1;
      uVar5 = uVar5 + 8;
      uVar7 = (ulonglong)uVar6;
    } while (uVar6 < *(uint *)(param_1 + 2));
  }
  operator_delete__((void *)*param_1);
  *param_1 = 0;
  param_1[1] = 0;
  if ((int)param_1[6] == 0) {
    uVar4 = FUN_14001de50(param_1,0);
    FUN_14000d350(param_1,uVar4,0);
  }
  param_1[8] = 0;
  _Memory = (longlong *)param_1[7];
  if ((longlong *)param_1[7] != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    param_1[7] = 0;
  }
  *(int *)(param_1 + 6) = (int)param_1[6] + -1;
  return;
}



void FUN_14001d150(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  uint uVar3;
  undefined4 uVar4;
  longlong lVar5;
  ulonglong uVar6;
  uint uVar7;
  longlong *plVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  float fVar11;
  uint local_res8;
  
  *(int *)(param_1 + 6) = (int)param_1[6] + 1;
  uVar10 = 0;
  if ((*param_1 != 0) && (local_res8 = 0, uVar6 = uVar10, uVar9 = uVar10, (int)param_1[2] != 0)) {
    do {
      lVar5 = *(longlong *)(uVar9 + *param_1);
      uVar7 = (uint)uVar6;
      while (lVar5 != 0) {
        lVar1 = *(longlong *)(lVar5 + 0x18);
        *(longlong *)(lVar5 + 0x18) = param_1[8];
        param_1[1] = param_1[1] + -1;
        uVar6 = param_1[1];
        param_1[8] = lVar5;
        if ((uVar6 < (ulonglong)param_1[5]) && ((int)param_1[6] == 0)) {
          fVar11 = (float)(longlong)uVar6;
          if ((longlong)uVar6 < 0) {
            fVar11 = fVar11 + 1.8446744e+19;
          }
          fVar11 = fVar11 / *(float *)((longlong)param_1 + 0x14);
          lVar5 = 0;
          if ((9.223372e+18 < fVar11) && (fVar11 = fVar11 - 9.223372e+18, fVar11 < 9.223372e+18)) {
            lVar5 = -0x8000000000000000;
          }
          uVar7 = (uint)((longlong)fVar11 + lVar5);
          if (0xffffffff < (ulonglong)((longlong)fVar11 + lVar5)) {
            uVar7 = 0xffffffff;
          }
          uVar6 = uVar10;
          if (0x11 < uVar7) {
            do {
              uVar6 = uVar6 + 1;
            } while ((uint)(&DAT_14024ea30)[uVar6] < uVar7);
          }
          uVar3 = (&DAT_14024ea30)[uVar6];
          if ((&DAT_14024ea30)[uVar6] == 0xffffffff) {
            uVar3 = uVar7;
          }
          FUN_14009ab20(param_1,uVar3);
        }
        lVar5 = lVar1;
        uVar7 = local_res8;
        if (param_1[1] == 0) {
          param_1[8] = 0;
          plVar8 = (longlong *)param_1[7];
          if ((longlong *)param_1[7] != (longlong *)0x0) {
            do {
              plVar2 = (longlong *)*plVar8;
              free(plVar8);
              plVar8 = plVar2;
            } while (plVar2 != (longlong *)0x0);
            param_1[7] = 0;
          }
        }
      }
      local_res8 = uVar7 + 1;
      uVar6 = (ulonglong)local_res8;
      uVar9 = uVar9 + 8;
    } while (local_res8 < *(uint *)(param_1 + 2));
  }
  operator_delete__((void *)*param_1);
  *param_1 = 0;
  param_1[1] = 0;
  if ((int)param_1[6] == 0) {
    uVar4 = FUN_14001de50(param_1,0);
    FUN_14000d350(param_1,uVar4,0);
  }
  param_1[8] = 0;
  plVar8 = (longlong *)param_1[7];
  if ((longlong *)param_1[7] != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*plVar8;
      free(plVar8);
      plVar8 = plVar2;
    } while (plVar2 != (longlong *)0x0);
    param_1[7] = 0;
  }
  *(int *)(param_1 + 6) = (int)param_1[6] + -1;
  return;
}



void FUN_14001d340(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x20) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x18); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0x18))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x18) = *(undefined8 *)(param_2 + 0x18);
      FUN_14001e050(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x18);
  FUN_14001e050(param_1,param_2);
  return;
}



void FUN_14001d3c0(longlong param_1,longlong param_2,longlong param_3,undefined1 param_4)

{
  longlong lVar1;
  longlong local_18;
  longlong local_10;
  
  lVar1 = param_2 - param_1;
  do {
    lVar1 = lVar1 >> 3;
    if (lVar1 < 0x21) {
LAB_14001d48b:
      if (1 < lVar1) {
        FUN_14001e900(param_1,param_2,param_4);
      }
      return;
    }
    if (param_3 < 1) {
      if (0x20 < lVar1) {
        lVar1 = param_2 - param_1 >> 3;
        if (lVar1 < 2) {
          return;
        }
        FUN_14001e810(param_1,param_2,param_4);
        if (lVar1 < 2) {
          return;
        }
        do {
          FUN_14001f240(param_1,param_2,param_4);
          param_2 = param_2 + -8;
        } while (8 < (longlong)(param_2 - param_1 & 0xfffffffffffffff8U));
        return;
      }
      goto LAB_14001d48b;
    }
    FUN_14001e0e0(&local_18,param_1,param_2);
    lVar1 = local_10;
    param_3 = param_3 / 2 + (param_3 / 2) / 2;
    if ((longlong)(local_18 - param_1 & 0xfffffffffffffff8U) <
        (longlong)(param_2 - local_10 & 0xfffffffffffffff8U)) {
      FUN_14001d3c0(param_1,local_18,param_3,param_4);
      param_1 = lVar1;
    }
    else {
      FUN_14001d3c0(local_10,param_2,param_3,param_4);
      param_2 = local_18;
    }
    lVar1 = param_2 - param_1;
  } while( true );
}



void FUN_14001d520(longlong param_1,longlong param_2,longlong param_3,undefined1 param_4)

{
  longlong lVar1;
  longlong local_18;
  longlong local_10;
  
  lVar1 = param_2 - param_1;
  do {
    lVar1 = lVar1 >> 3;
    if (lVar1 < 0x21) {
LAB_14001d5eb:
      if (1 < lVar1) {
        FUN_14001ec80(param_1,param_2,param_4);
      }
      return;
    }
    if (param_3 < 1) {
      if (0x20 < lVar1) {
        lVar1 = param_2 - param_1 >> 3;
        if (lVar1 < 2) {
          return;
        }
        FUN_14001eb90(param_1,param_2,param_4);
        if (lVar1 < 2) {
          return;
        }
        do {
          FUN_14001f2f0(param_1,param_2,param_4);
          param_2 = param_2 + -8;
        } while (8 < (longlong)(param_2 - param_1 & 0xfffffffffffffff8U));
        return;
      }
      goto LAB_14001d5eb;
    }
    FUN_14001e2a0(&local_18,param_1,param_2);
    lVar1 = local_10;
    param_3 = param_3 / 2 + (param_3 / 2) / 2;
    if ((longlong)(local_18 - param_1 & 0xfffffffffffffff8U) <
        (longlong)(param_2 - local_10 & 0xfffffffffffffff8U)) {
      FUN_14001d520(param_1,local_18,param_3,param_4);
      param_1 = lVar1;
    }
    else {
      FUN_14001d520(local_10,param_2,param_3,param_4);
      param_2 = local_18;
    }
    lVar1 = param_2 - param_1;
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x00014001d6d8)

longlong * FUN_14001d680(longlong *param_1,undefined8 *param_2)

{
  ulonglong uVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  uint uVar4;
  undefined8 *_Buf1;
  longlong *_Buf2;
  ulonglong _Size;
  
  param_1 = (longlong *)*param_1;
  if (param_1 == (longlong *)0x0) {
    return (longlong *)0x0;
  }
  uVar1 = param_2[2];
  uVar2 = param_2[3];
  do {
    uVar3 = param_1[3];
    _Buf2 = param_1 + 1;
    if (0xf < (ulonglong)param_1[4]) {
      _Buf2 = (longlong *)*_Buf2;
    }
    _Buf1 = param_2;
    if (0xf < uVar2) {
      _Buf1 = (undefined8 *)*param_2;
    }
    _Size = uVar3;
    if (uVar1 < uVar3) {
      _Size = uVar1;
    }
    uVar4 = memcmp(_Buf1,_Buf2,_Size);
    if (uVar4 == 0) {
      if (uVar3 <= uVar1) {
        uVar4 = (uint)(uVar1 != uVar3);
        goto LAB_14001d70e;
      }
    }
    else {
LAB_14001d70e:
      if (uVar4 == 0) {
        return param_1;
      }
    }
    param_1 = (longlong *)*param_1;
    if (param_1 == (longlong *)0x0) {
      return (longlong *)0x0;
    }
  } while( true );
}



void FUN_14001d750(undefined8 *param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  
  puVar4 = (undefined8 *)*param_1;
  puVar1 = puVar4 + param_1[1];
  for (; puVar4 != puVar1; puVar4 = puVar4 + 1) {
    puVar2 = (undefined8 *)*puVar4;
    *puVar4 = 0;
    while (puVar2 != (undefined8 *)0x0) {
      puVar3 = (undefined8 *)*puVar2;
      if (0xf < (ulonglong)puVar2[4]) {
        operator_delete((void *)puVar2[1]);
      }
      puVar2[4] = 0xf;
      puVar2[3] = 0;
      *(undefined1 *)(puVar2 + 1) = 0;
      operator_delete(puVar2);
      puVar2 = puVar3;
    }
  }
  operator_delete((void *)*param_1);
  *param_1 = 0;
  return;
}



longlong * FUN_14001d800(longlong *param_1,longlong *param_2,char *param_3,longlong param_4)

{
  undefined8 *puVar1;
  char cVar2;
  char *pcVar3;
  undefined8 *puVar4;
  char *pcVar5;
  ulonglong uVar6;
  char *pcVar7;
  longlong lVar8;
  undefined8 *puVar9;
  longlong *local_40;
  undefined8 *local_38;
  undefined2 local_30;
  
  pcVar5 = param_3;
  if (0xf < *(ulonglong *)(param_3 + 0x18)) {
    pcVar5 = *(char **)param_3;
  }
  pcVar3 = param_3;
  if (0xf < *(ulonglong *)(param_3 + 0x18)) {
    pcVar3 = *(char **)param_3;
  }
  uVar6 = 0;
  lVar8 = param_4;
  pcVar7 = param_3;
  for (; pcVar3 != pcVar5 + *(longlong *)(param_3 + 0x10); pcVar3 = pcVar3 + 1) {
    lVar8 = uVar6 * 0x40;
    pcVar7 = (char *)((longlong)*pcVar3 + (uVar6 >> 2) + lVar8 + 0x9e3779b9);
    uVar6 = uVar6 ^ (ulonglong)pcVar7;
  }
  puVar9 = (undefined8 *)(*param_1 + (uVar6 % (ulonglong)param_1[1]) * 8);
  lVar8 = FUN_14001d680(puVar9,param_3,pcVar7,lVar8,0xfffffffffffffffe);
  if (lVar8 == 0) {
    local_38 = (undefined8 *)0x0;
    local_30 = 0;
    local_40 = param_1;
    FUN_14001f120(&local_40);
    puVar1 = local_38;
    puVar4 = local_38 + 1;
    if (puVar4 != (undefined8 *)0x0) {
      local_38[4] = 0xf;
      local_38[3] = 0;
      *(undefined1 *)puVar4 = 0;
      FUN_140003d50(puVar4,param_4,0,0xffffffffffffffff);
      *(undefined4 *)(puVar1 + 6) = *(undefined4 *)(param_4 + 0x28);
    }
    local_30 = CONCAT11(1,(undefined1)local_30);
    cVar2 = FUN_14001e460(param_1);
    if (cVar2 != '\0') {
      puVar9 = (undefined8 *)(*param_1 + (uVar6 % (ulonglong)param_1[1]) * 8);
    }
    *puVar1 = *puVar9;
    *puVar9 = puVar1;
    param_1[4] = param_1[4] + 1;
    puVar4 = (undefined8 *)param_1[6];
    if (puVar9 < (undefined8 *)param_1[6]) {
      puVar4 = puVar9;
    }
    param_1[6] = (longlong)puVar4;
    *param_2 = (longlong)puVar9;
    param_2[1] = (longlong)puVar1;
    *(undefined1 *)(param_2 + 2) = 1;
  }
  else {
    *param_2 = (longlong)puVar9;
    param_2[1] = lVar8;
    *(undefined1 *)(param_2 + 2) = 0;
  }
  return param_2;
}



undefined8 * FUN_14001d990(undefined8 param_1,undefined8 *param_2,longlong param_3)

{
  void *pvVar1;
  undefined8 *puVar2;
  undefined1 *puVar3;
  undefined8 uVar4;
  undefined1 local_40 [16];
  undefined8 local_30;
  void *local_28;
  undefined2 local_20;
  
  uVar4 = 0xfffffffffffffffe;
  local_28 = (void *)0x0;
  local_20 = 0;
  local_30 = param_1;
  FUN_14001f120(&local_30);
  pvVar1 = local_28;
  puVar3 = (undefined1 *)((longlong)local_28 + 8);
  if (puVar3 != (undefined1 *)0x0) {
    *(undefined8 *)((longlong)local_28 + 0x20) = 0xf;
    *(undefined8 *)((longlong)local_28 + 0x18) = 0;
    *puVar3 = 0;
    FUN_140003d50(puVar3,param_3,0,0xffffffffffffffff,uVar4);
    *(undefined4 *)((longlong)pvVar1 + 0x30) = *(undefined4 *)(param_3 + 0x28);
  }
  local_20._1_1_ = '\x01';
  puVar2 = (undefined8 *)FUN_14001e4d0(param_1,local_40,&local_30);
  pvVar1 = local_28;
  *param_2 = *puVar2;
  param_2[1] = puVar2[1];
  *(undefined1 *)(param_2 + 2) = 1;
  if (local_28 != (void *)0x0) {
    if (local_20._1_1_ != '\0') {
      if (0xf < *(ulonglong *)((longlong)local_28 + 0x20)) {
        operator_delete(*(void **)((longlong)local_28 + 8));
      }
      *(undefined8 *)((longlong)pvVar1 + 0x20) = 0xf;
      *(undefined8 *)((longlong)pvVar1 + 0x18) = 0;
      *(undefined1 *)((longlong)pvVar1 + 8) = 0;
    }
    operator_delete(pvVar1);
  }
  return param_2;
}



void FUN_14001da90(longlong *param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  __uint64 _Var4;
  void *_Dst;
  longlong lVar5;
  uint uVar6;
  float fVar7;
  
  if (param_2 == 0) {
    param_2 = FUN_14001de50(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_14000d350(param_1,param_2,0);
    }
    else {
      _Var4 = SUB168(ZEXT816(8) * ZEXT416(param_2),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_2),8) != 0) {
        _Var4 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var4);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_2 << 3);
      uVar6 = 0;
      if ((int)param_1[2] != 0) {
        lVar5 = 0;
        do {
          lVar3 = *(longlong *)(lVar5 + *param_1);
          while (lVar3 != 0) {
            lVar1 = *(longlong *)(lVar3 + 0x10);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x18) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x10) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar3;
            lVar3 = lVar1;
          }
          uVar6 = uVar6 + 1;
          lVar5 = lVar5 + 8;
        } while (uVar6 < *(uint *)(param_1 + 2));
      }
      operator_delete__((void *)*param_1);
      *param_1 = (longlong)_Dst;
      *(uint *)(param_1 + 2) = param_2;
      fVar7 = (float)param_2 * *(float *)((longlong)param_1 + 0x1c);
      lVar5 = 0;
      if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      param_1[4] = (longlong)fVar7 + lVar5;
      fVar7 = (float)param_2 * *(float *)(param_1 + 3);
      lVar5 = 0;
      if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      param_1[5] = (longlong)fVar7 + lVar5;
      if ((ulonglong)((longlong)fVar7 + lVar5) < 0x11) {
        param_1[5] = 0;
      }
    }
  }
  return;
}



undefined4 *
FUN_14001dc40(longlong *param_1,undefined4 *param_2,ulonglong param_3,undefined4 param_4)

{
  int iVar1;
  undefined4 *puVar2;
  undefined1 auVar3 [16];
  undefined4 uVar4;
  longlong *plVar5;
  ulonglong uVar6;
  longlong lVar7;
  
  if (param_1[8] == 0) {
    uVar6 = CONCAT44(0,*(uint *)((longlong)param_1 + 0x34));
    if (uVar6 == 0) {
      lVar7 = 0;
    }
    else {
      auVar3._8_8_ = 0;
      auVar3._0_8_ = uVar6;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar3,0) < 0x20)
      goto LAB_14001dcf7;
      lVar7 = uVar6 << 5;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_14001dcf7:
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 4 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[2] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -4;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 4);
  *puVar2 = *param_2;
  *(undefined8 *)(puVar2 + 2) = 0;
  puVar2[6] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 4) = *(undefined8 *)(*param_1 + (param_3 & 0xffffffff) * 8);
  *(undefined4 **)(*param_1 + (param_3 & 0xffffffff) * 8) = puVar2;
  if (((ulonglong)param_1[4] < (ulonglong)param_1[1]) && ((int)param_1[6] == 0)) {
    uVar4 = FUN_14001de50(param_1);
    FUN_14001da90(param_1,uVar4);
  }
  return puVar2;
}



void FUN_14001dd90(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 != 0) {
    if ((*(longlong *)(param_2 + 8) != 0) &&
       (*(longlong *)(*(longlong *)(param_2 + 8) + 8) =
             *(longlong *)(*(longlong *)(param_2 + 8) + 8) + -1,
       *(longlong *)(*(longlong *)(param_2 + 8) + 8) == 0)) {
      FUN_1400219e0(*(undefined8 *)(param_2 + 8));
    }
    *(undefined8 *)(param_2 + 0x10) = *(undefined8 *)(param_1 + 0x40);
    *(longlong *)(param_1 + 8) = *(longlong *)(param_1 + 8) + -1;
    *(longlong *)(param_1 + 0x40) = param_2;
    if ((*(ulonglong *)(param_1 + 8) < *(ulonglong *)(param_1 + 0x28)) &&
       (*(int *)(param_1 + 0x30) == 0)) {
      uVar2 = FUN_14001de50(param_1);
      FUN_14001da90(param_1,uVar2);
    }
    if (*(longlong *)(param_1 + 8) == 0) {
      _Memory = *(longlong **)(param_1 + 0x38);
      *(undefined8 *)(param_1 + 0x40) = 0;
      if (_Memory != (longlong *)0x0) {
        do {
          plVar1 = (longlong *)*_Memory;
          free(_Memory);
          _Memory = plVar1;
        } while (plVar1 != (longlong *)0x0);
        *(undefined8 *)(param_1 + 0x38) = 0;
      }
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



uint FUN_14001de50(longlong param_1,longlong param_2)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_2;
  if (param_2 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / *(float *)(param_1 + 0x14);
  lVar2 = 0;
  if ((9.223372e+18 < fVar6) && (fVar6 = fVar6 - 9.223372e+18, fVar6 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  uVar5 = (uint)((longlong)fVar6 + lVar2);
  if (0xffffffff < (ulonglong)((longlong)fVar6 + lVar2)) {
    uVar5 = 0xffffffff;
  }
  iVar4 = 0;
  if (0x11 < uVar5) {
    puVar3 = &DAT_14024ea30;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_14024ea30)[iVar4];
  if ((&DAT_14024ea30)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined4 *
FUN_14001ded0(longlong *param_1,undefined4 *param_2,ulonglong param_3,undefined4 param_4)

{
  int iVar1;
  undefined4 *puVar2;
  undefined1 auVar3 [16];
  undefined4 uVar4;
  longlong *plVar5;
  ulonglong uVar6;
  longlong lVar7;
  
  if (param_1[8] == 0) {
    uVar6 = CONCAT44(0,*(uint *)((longlong)param_1 + 0x34));
    if (uVar6 == 0) {
      lVar7 = 0;
    }
    else {
      auVar3._8_8_ = 0;
      auVar3._0_8_ = uVar6;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar3,0) < 0x28)
      goto LAB_14001df97;
      lVar7 = uVar6 * 0x28;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_14001df97:
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 5 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[3] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -5;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 6);
  *puVar2 = *param_2;
  puVar2[1] = param_2[1];
  puVar2[2] = param_2[2];
  puVar2[3] = param_2[3];
  puVar2[8] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 6) = *(undefined8 *)(*param_1 + (param_3 & 0xffffffff) * 8);
  *(undefined4 **)(*param_1 + (param_3 & 0xffffffff) * 8) = puVar2;
  if (((ulonglong)param_1[4] < (ulonglong)param_1[1]) && ((int)param_1[6] == 0)) {
    uVar4 = FUN_14001de50(param_1);
    FUN_14009ab20(param_1,uVar4);
  }
  return puVar2;
}



void FUN_14001e050(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 != 0) {
    *(undefined8 *)(param_2 + 0x18) = *(undefined8 *)(param_1 + 0x40);
    *(longlong *)(param_1 + 8) = *(longlong *)(param_1 + 8) + -1;
    *(longlong *)(param_1 + 0x40) = param_2;
    if ((*(ulonglong *)(param_1 + 8) < *(ulonglong *)(param_1 + 0x28)) &&
       (*(int *)(param_1 + 0x30) == 0)) {
      uVar2 = FUN_14001de50();
      FUN_14009ab20(param_1,uVar2);
    }
    if (*(longlong *)(param_1 + 8) == 0) {
      _Memory = *(longlong **)(param_1 + 0x38);
      *(undefined8 *)(param_1 + 0x40) = 0;
      if (_Memory != (longlong *)0x0) {
        do {
          plVar1 = (longlong *)*_Memory;
          free(_Memory);
          _Memory = plVar1;
        } while (plVar1 != (longlong *)0x0);
        *(undefined8 *)(param_1 + 0x38) = 0;
      }
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



undefined8 * FUN_14001e0e0(undefined8 *param_1,longlong *param_2,longlong *param_3)

{
  longlong *plVar1;
  longlong *plVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong *plVar8;
  
  plVar2 = param_2 + (((longlong)param_3 - (longlong)param_2 >> 3) -
                      ((longlong)param_3 - (longlong)param_2 >> 0x3f) >> 1);
  FUN_14001e650(param_2,plVar2,param_3 + -1);
  plVar6 = plVar2 + 1;
  while (plVar8 = plVar2, param_2 < plVar8) {
    if ((*(int *)(plVar8[-1] + 4) < *(int *)(*plVar8 + 4)) ||
       (plVar2 = plVar8 + -1, *(int *)(*plVar8 + 4) < *(int *)(plVar8[-1] + 4))) break;
  }
  plVar2 = plVar6;
  plVar5 = plVar8;
  if (plVar6 < param_3) {
    do {
      plVar2 = plVar6;
      if ((*(int *)(*plVar6 + 4) < *(int *)(*plVar8 + 4)) ||
         (*(int *)(*plVar8 + 4) < *(int *)(*plVar6 + 4))) break;
      plVar6 = plVar6 + 1;
      plVar2 = plVar6;
    } while (plVar6 < param_3);
  }
joined_r0x00014001e183:
  do {
    plVar1 = plVar8;
    if (param_3 <= plVar6) {
joined_r0x00014001e1be:
      while (plVar8 = plVar1, param_2 < plVar8) {
        plVar1 = plVar8 + -1;
        if (*(int *)(*plVar5 + 4) <= *(int *)(plVar8[-1] + 4)) {
          if (*(int *)(*plVar5 + 4) < *(int *)(plVar8[-1] + 4)) break;
          lVar4 = plVar5[-1];
          plVar5 = plVar5 + -1;
          *plVar5 = *plVar1;
          *plVar1 = lVar4;
        }
      }
      if (plVar8 == param_2) {
        if (plVar6 == param_3) {
          *param_1 = plVar5;
          param_1[1] = plVar2;
          return param_1;
        }
        if (plVar2 != plVar6) {
          lVar4 = *plVar5;
          *plVar5 = *plVar2;
          *plVar2 = lVar4;
        }
        lVar4 = *plVar5;
        *plVar5 = *plVar6;
        *plVar6 = lVar4;
        plVar6 = plVar6 + 1;
        plVar2 = plVar2 + 1;
        plVar5 = plVar5 + 1;
      }
      else {
        plVar8 = plVar8 + -1;
        if (plVar6 == param_3) {
          plVar5 = plVar5 + -1;
          if (plVar8 != plVar5) {
            lVar4 = *plVar8;
            *plVar8 = *plVar5;
            *plVar5 = lVar4;
          }
          lVar4 = *plVar5;
          *plVar5 = plVar2[-1];
          plVar2[-1] = lVar4;
          plVar2 = plVar2 + -1;
        }
        else {
          lVar4 = *plVar6;
          *plVar6 = *plVar8;
          *plVar8 = lVar4;
          plVar6 = plVar6 + 1;
        }
      }
      goto joined_r0x00014001e183;
    }
    iVar3 = *(int *)(*plVar6 + 4);
    plVar7 = plVar2;
    if (iVar3 <= *(int *)(*plVar5 + 4)) {
      if (iVar3 < *(int *)(*plVar5 + 4)) goto joined_r0x00014001e1be;
      plVar7 = plVar2 + 1;
      lVar4 = *plVar2;
      *plVar2 = *plVar6;
      *plVar6 = lVar4;
    }
    plVar6 = plVar6 + 1;
    plVar2 = plVar7;
  } while( true );
}



undefined8 * FUN_14001e2a0(undefined8 *param_1,longlong *param_2,longlong *param_3)

{
  longlong *plVar1;
  longlong *plVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong *plVar8;
  
  plVar2 = param_2 + (((longlong)param_3 - (longlong)param_2 >> 3) -
                      ((longlong)param_3 - (longlong)param_2 >> 0x3f) >> 1);
  FUN_14001e9d0(param_2,plVar2,param_3 + -1);
  plVar6 = plVar2 + 1;
  while (plVar8 = plVar2, param_2 < plVar8) {
    if ((*(int *)(plVar8[-1] + 8) < *(int *)(*plVar8 + 8)) ||
       (plVar2 = plVar8 + -1, *(int *)(*plVar8 + 8) < *(int *)(plVar8[-1] + 8))) break;
  }
  plVar2 = plVar6;
  plVar5 = plVar8;
  if (plVar6 < param_3) {
    do {
      plVar2 = plVar6;
      if ((*(int *)(*plVar6 + 8) < *(int *)(*plVar8 + 8)) ||
         (*(int *)(*plVar8 + 8) < *(int *)(*plVar6 + 8))) break;
      plVar6 = plVar6 + 1;
      plVar2 = plVar6;
    } while (plVar6 < param_3);
  }
joined_r0x00014001e343:
  do {
    plVar1 = plVar8;
    if (param_3 <= plVar6) {
joined_r0x00014001e37e:
      while (plVar8 = plVar1, param_2 < plVar8) {
        plVar1 = plVar8 + -1;
        if (*(int *)(*plVar5 + 8) <= *(int *)(plVar8[-1] + 8)) {
          if (*(int *)(*plVar5 + 8) < *(int *)(plVar8[-1] + 8)) break;
          lVar4 = plVar5[-1];
          plVar5 = plVar5 + -1;
          *plVar5 = *plVar1;
          *plVar1 = lVar4;
        }
      }
      if (plVar8 == param_2) {
        if (plVar6 == param_3) {
          *param_1 = plVar5;
          param_1[1] = plVar2;
          return param_1;
        }
        if (plVar2 != plVar6) {
          lVar4 = *plVar5;
          *plVar5 = *plVar2;
          *plVar2 = lVar4;
        }
        lVar4 = *plVar5;
        *plVar5 = *plVar6;
        *plVar6 = lVar4;
        plVar6 = plVar6 + 1;
        plVar2 = plVar2 + 1;
        plVar5 = plVar5 + 1;
      }
      else {
        plVar8 = plVar8 + -1;
        if (plVar6 == param_3) {
          plVar5 = plVar5 + -1;
          if (plVar8 != plVar5) {
            lVar4 = *plVar8;
            *plVar8 = *plVar5;
            *plVar5 = lVar4;
          }
          lVar4 = *plVar5;
          *plVar5 = plVar2[-1];
          plVar2[-1] = lVar4;
          plVar2 = plVar2 + -1;
        }
        else {
          lVar4 = *plVar6;
          *plVar6 = *plVar8;
          *plVar8 = lVar4;
          plVar6 = plVar6 + 1;
        }
      }
      goto joined_r0x00014001e343;
    }
    iVar3 = *(int *)(*plVar6 + 8);
    plVar7 = plVar2;
    if (iVar3 <= *(int *)(*plVar5 + 8)) {
      if (iVar3 < *(int *)(*plVar5 + 8)) goto joined_r0x00014001e37e;
      plVar7 = plVar2 + 1;
      lVar4 = *plVar2;
      *plVar2 = *plVar6;
      *plVar6 = lVar4;
    }
    plVar6 = plVar6 + 1;
    plVar2 = plVar7;
  } while( true );
}



undefined8 FUN_14001e460(longlong param_1,ulonglong param_2)

{
  longlong lVar1;
  ulonglong *puVar2;
  ulonglong local_res8;
  ulonglong local_res10 [3];
  
  local_res10[0] = param_2;
  if (*(ulonglong *)(param_1 + 0x38) <= param_2) {
    local_res8 = (*(ulonglong *)(param_1 + 0x20) >> 1) + *(ulonglong *)(param_1 + 0x20);
    puVar2 = &local_res8;
    if (local_res8 <= param_2) {
      puVar2 = local_res10;
    }
    lVar1 = FUN_14001ed50(param_1,*puVar2);
    if (lVar1 != *(longlong *)(param_1 + 8)) {
      FUN_14001ee30(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



longlong * FUN_14001e4d0(longlong *param_1,longlong *param_2,longlong param_3)

{
  ulonglong *puVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined8 *puVar4;
  undefined8 uVar5;
  char *pcVar6;
  ulonglong *puVar7;
  ulonglong uVar8;
  char *pcVar9;
  ulonglong local_res8;
  
  lVar3 = *(longlong *)(param_3 + 8);
  pcVar6 = (char *)(lVar3 + 8);
  pcVar9 = pcVar6;
  if (0xf < *(ulonglong *)(lVar3 + 0x20)) {
    pcVar9 = *(char **)pcVar6;
  }
  if (0xf < *(ulonglong *)(lVar3 + 0x20)) {
    pcVar6 = *(char **)pcVar6;
  }
  uVar8 = 0;
  for (; pcVar6 != pcVar9 + *(longlong *)(lVar3 + 0x18); pcVar6 = pcVar6 + 1) {
    uVar8 = uVar8 ^ (longlong)*pcVar6 + (uVar8 >> 2) + uVar8 * 0x40 + 0x9e3779b9;
  }
  if (*param_1 == 0) {
    local_res8 = FUN_14001ed50(param_1);
    puVar1 = (ulonglong *)(param_1 + 1);
    puVar7 = &local_res8;
    if (local_res8 <= *puVar1) {
      puVar7 = puVar1;
    }
    *puVar1 = *puVar7;
    FUN_140097060(param_1);
    FUN_14009b090(param_1);
  }
  else {
    FUN_14001e460();
  }
  plVar2 = (longlong *)(*param_1 + (uVar8 % (ulonglong)param_1[1]) * 8);
  puVar4 = *(undefined8 **)(param_3 + 8);
  *(undefined8 *)(param_3 + 8) = 0;
  uVar5 = *plVar2;
  *param_2 = (longlong)plVar2;
  *puVar4 = uVar5;
  *plVar2 = (longlong)puVar4;
  param_1[4] = param_1[4] + 1;
  param_2[1] = (longlong)puVar4;
  param_1[6] = (longlong)plVar2;
  return param_2;
}



void FUN_14001e5f0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 8);
  if (lVar1 != 0) {
    if (*(char *)(param_1 + 0x11) != '\0') {
      if (0xf < *(ulonglong *)(lVar1 + 0x20)) {
        operator_delete(*(void **)(lVar1 + 8));
      }
      *(undefined8 *)(lVar1 + 0x20) = 0xf;
      *(undefined8 *)(lVar1 + 0x18) = 0;
      *(undefined1 *)(lVar1 + 8) = 0;
    }
    operator_delete(*(void **)(param_1 + 8));
  }
  return;
}



void FUN_14001e650(longlong *param_1,longlong *param_2,longlong *param_3)

{
  longlong lVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong *plVar4;
  
  lVar1 = (longlong)param_3 - (longlong)param_1 >> 3;
  if (lVar1 < 0x29) {
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 4) < *(int *)(*param_1 + 4)) {
      *param_2 = *param_1;
      *param_1 = lVar1;
    }
    lVar1 = *param_3;
    if (*(int *)(lVar1 + 4) < *(int *)(*param_2 + 4)) {
      *param_3 = *param_2;
      *param_2 = lVar1;
    }
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 4) < *(int *)(*param_1 + 4)) {
      *param_2 = *param_1;
      *param_1 = lVar1;
    }
  }
  else {
    lVar1 = lVar1 + 1;
    lVar2 = (longlong)(lVar1 + (ulonglong)((uint)(lVar1 >> 0x3f) & 7)) >> 3;
    lVar1 = param_1[lVar2];
    if (*(int *)(lVar1 + 4) < *(int *)(*param_1 + 4)) {
      param_1[lVar2] = *param_1;
      *param_1 = lVar1;
    }
    lVar1 = param_1[lVar2 * 2];
    if (*(int *)(lVar1 + 4) < *(int *)(param_1[lVar2] + 4)) {
      param_1[lVar2 * 2] = param_1[lVar2];
      param_1[lVar2] = lVar1;
    }
    lVar1 = param_1[lVar2];
    if (*(int *)(lVar1 + 4) < *(int *)(*param_1 + 4)) {
      param_1[lVar2] = *param_1;
      *param_1 = lVar1;
    }
    lVar1 = *param_2;
    plVar3 = param_2 + -lVar2;
    if (*(int *)(lVar1 + 4) < *(int *)(*plVar3 + 4)) {
      *param_2 = *plVar3;
      *plVar3 = lVar1;
    }
    lVar1 = param_2[lVar2];
    if (*(int *)(lVar1 + 4) < *(int *)(*param_2 + 4)) {
      param_2[lVar2] = *param_2;
      *param_2 = lVar1;
    }
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 4) < *(int *)(*plVar3 + 4)) {
      *param_2 = *plVar3;
      *plVar3 = lVar1;
    }
    plVar4 = param_3 + lVar2 * -2;
    plVar3 = param_3 + -lVar2;
    lVar1 = *plVar3;
    if (*(int *)(lVar1 + 4) < *(int *)(*plVar4 + 4)) {
      *plVar3 = *plVar4;
      *plVar4 = lVar1;
    }
    lVar1 = *param_3;
    if (*(int *)(lVar1 + 4) < *(int *)(*plVar3 + 4)) {
      *param_3 = *plVar3;
      *plVar3 = lVar1;
    }
    lVar1 = *plVar3;
    if (*(int *)(lVar1 + 4) < *(int *)(*plVar4 + 4)) {
      *plVar3 = *plVar4;
      *plVar4 = lVar1;
    }
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 4) < *(int *)(param_1[lVar2] + 4)) {
      *param_2 = param_1[lVar2];
      param_1[lVar2] = lVar1;
    }
    lVar1 = *plVar3;
    if (*(int *)(lVar1 + 4) < *(int *)(*param_2 + 4)) {
      *plVar3 = *param_2;
      *param_2 = lVar1;
    }
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 4) < *(int *)(param_1[lVar2] + 4)) {
      *param_2 = param_1[lVar2];
      param_1[lVar2] = lVar1;
      return;
    }
  }
  return;
}



void FUN_14001e810(longlong param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  
  lVar7 = param_2 - param_1 >> 3;
  lVar3 = lVar7 - (param_2 - param_1 >> 0x3f) >> 1;
  if (0 < lVar3) {
    lVar6 = lVar3 * 2 + 2;
    do {
      lVar2 = *(longlong *)(param_1 + -8 + lVar3 * 8);
      lVar3 = lVar3 + -1;
      lVar6 = lVar6 + -2;
      lVar1 = lVar3;
      for (lVar5 = lVar6; lVar5 < lVar7; lVar5 = lVar5 * 2 + 2) {
        if (*(int *)(*(longlong *)(param_1 + lVar5 * 8) + 4) <
            *(int *)(*(longlong *)(param_1 + -8 + lVar5 * 8) + 4)) {
          lVar5 = lVar5 + -1;
        }
        *(undefined8 *)(param_1 + lVar1 * 8) = *(undefined8 *)(param_1 + lVar5 * 8);
        lVar1 = lVar5;
      }
      if (lVar5 == lVar7) {
        *(undefined8 *)(param_1 + lVar1 * 8) = *(undefined8 *)(param_1 + -8 + lVar7 * 8);
        lVar1 = lVar7 + -1;
      }
      while (lVar3 < lVar1) {
        lVar4 = (lVar1 + -1) / 2;
        lVar5 = *(longlong *)(param_1 + lVar4 * 8);
        if (*(int *)(lVar2 + 4) <= *(int *)(lVar5 + 4)) break;
        *(longlong *)(param_1 + lVar1 * 8) = lVar5;
        lVar1 = lVar4;
      }
      *(longlong *)(param_1 + lVar1 * 8) = lVar2;
    } while (0 < lVar3);
  }
  return;
}



void FUN_14001e900(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong *plVar4;
  longlong *plVar5;
  
  if ((param_1 != param_2) && (plVar3 = param_1 + 1, plVar3 != param_2)) {
    do {
      lVar1 = *plVar3;
      if (*(int *)(lVar1 + 4) < *(int *)(*param_1 + 4)) {
        lVar2 = (longlong)plVar3 - (longlong)param_1 >> 3;
        memmove(plVar3 + (1 - lVar2),param_1,lVar2 * 8);
        *param_1 = lVar1;
      }
      else {
        lVar2 = plVar3[-1];
        plVar5 = plVar3;
        plVar4 = plVar3;
        if (*(int *)(lVar1 + 4) < *(int *)(lVar2 + 4)) {
          do {
            plVar5 = plVar4 + -1;
            *plVar4 = lVar2;
            lVar2 = plVar4[-2];
            plVar4 = plVar5;
          } while (*(int *)(lVar1 + 4) < *(int *)(lVar2 + 4));
        }
        *plVar5 = lVar1;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != param_2);
  }
  return;
}



void FUN_14001e9d0(longlong *param_1,longlong *param_2,longlong *param_3)

{
  longlong lVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong *plVar4;
  
  lVar1 = (longlong)param_3 - (longlong)param_1 >> 3;
  if (lVar1 < 0x29) {
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 8) < *(int *)(*param_1 + 8)) {
      *param_2 = *param_1;
      *param_1 = lVar1;
    }
    lVar1 = *param_3;
    if (*(int *)(lVar1 + 8) < *(int *)(*param_2 + 8)) {
      *param_3 = *param_2;
      *param_2 = lVar1;
    }
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 8) < *(int *)(*param_1 + 8)) {
      *param_2 = *param_1;
      *param_1 = lVar1;
    }
  }
  else {
    lVar1 = lVar1 + 1;
    lVar2 = (longlong)(lVar1 + (ulonglong)((uint)(lVar1 >> 0x3f) & 7)) >> 3;
    lVar1 = param_1[lVar2];
    if (*(int *)(lVar1 + 8) < *(int *)(*param_1 + 8)) {
      param_1[lVar2] = *param_1;
      *param_1 = lVar1;
    }
    lVar1 = param_1[lVar2 * 2];
    if (*(int *)(lVar1 + 8) < *(int *)(param_1[lVar2] + 8)) {
      param_1[lVar2 * 2] = param_1[lVar2];
      param_1[lVar2] = lVar1;
    }
    lVar1 = param_1[lVar2];
    if (*(int *)(lVar1 + 8) < *(int *)(*param_1 + 8)) {
      param_1[lVar2] = *param_1;
      *param_1 = lVar1;
    }
    lVar1 = *param_2;
    plVar3 = param_2 + -lVar2;
    if (*(int *)(lVar1 + 8) < *(int *)(*plVar3 + 8)) {
      *param_2 = *plVar3;
      *plVar3 = lVar1;
    }
    lVar1 = param_2[lVar2];
    if (*(int *)(lVar1 + 8) < *(int *)(*param_2 + 8)) {
      param_2[lVar2] = *param_2;
      *param_2 = lVar1;
    }
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 8) < *(int *)(*plVar3 + 8)) {
      *param_2 = *plVar3;
      *plVar3 = lVar1;
    }
    plVar4 = param_3 + lVar2 * -2;
    plVar3 = param_3 + -lVar2;
    lVar1 = *plVar3;
    if (*(int *)(lVar1 + 8) < *(int *)(*plVar4 + 8)) {
      *plVar3 = *plVar4;
      *plVar4 = lVar1;
    }
    lVar1 = *param_3;
    if (*(int *)(lVar1 + 8) < *(int *)(*plVar3 + 8)) {
      *param_3 = *plVar3;
      *plVar3 = lVar1;
    }
    lVar1 = *plVar3;
    if (*(int *)(lVar1 + 8) < *(int *)(*plVar4 + 8)) {
      *plVar3 = *plVar4;
      *plVar4 = lVar1;
    }
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 8) < *(int *)(param_1[lVar2] + 8)) {
      *param_2 = param_1[lVar2];
      param_1[lVar2] = lVar1;
    }
    lVar1 = *plVar3;
    if (*(int *)(lVar1 + 8) < *(int *)(*param_2 + 8)) {
      *plVar3 = *param_2;
      *param_2 = lVar1;
    }
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 8) < *(int *)(param_1[lVar2] + 8)) {
      *param_2 = param_1[lVar2];
      param_1[lVar2] = lVar1;
      return;
    }
  }
  return;
}



void FUN_14001eb90(longlong param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  
  lVar7 = param_2 - param_1 >> 3;
  lVar3 = lVar7 - (param_2 - param_1 >> 0x3f) >> 1;
  if (0 < lVar3) {
    lVar6 = lVar3 * 2 + 2;
    do {
      lVar2 = *(longlong *)(param_1 + -8 + lVar3 * 8);
      lVar3 = lVar3 + -1;
      lVar6 = lVar6 + -2;
      lVar1 = lVar3;
      for (lVar5 = lVar6; lVar5 < lVar7; lVar5 = lVar5 * 2 + 2) {
        if (*(int *)(*(longlong *)(param_1 + lVar5 * 8) + 8) <
            *(int *)(*(longlong *)(param_1 + -8 + lVar5 * 8) + 8)) {
          lVar5 = lVar5 + -1;
        }
        *(undefined8 *)(param_1 + lVar1 * 8) = *(undefined8 *)(param_1 + lVar5 * 8);
        lVar1 = lVar5;
      }
      if (lVar5 == lVar7) {
        *(undefined8 *)(param_1 + lVar1 * 8) = *(undefined8 *)(param_1 + -8 + lVar7 * 8);
        lVar1 = lVar7 + -1;
      }
      while (lVar3 < lVar1) {
        lVar4 = (lVar1 + -1) / 2;
        lVar5 = *(longlong *)(param_1 + lVar4 * 8);
        if (*(int *)(lVar2 + 8) <= *(int *)(lVar5 + 8)) break;
        *(longlong *)(param_1 + lVar1 * 8) = lVar5;
        lVar1 = lVar4;
      }
      *(longlong *)(param_1 + lVar1 * 8) = lVar2;
    } while (0 < lVar3);
  }
  return;
}



void FUN_14001ec80(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong *plVar4;
  longlong *plVar5;
  
  if ((param_1 != param_2) && (plVar3 = param_1 + 1, plVar3 != param_2)) {
    do {
      lVar1 = *plVar3;
      if (*(int *)(lVar1 + 8) < *(int *)(*param_1 + 8)) {
        lVar2 = (longlong)plVar3 - (longlong)param_1 >> 3;
        memmove(plVar3 + (1 - lVar2),param_1,lVar2 * 8);
        *param_1 = lVar1;
      }
      else {
        lVar2 = plVar3[-1];
        plVar5 = plVar3;
        plVar4 = plVar3;
        if (*(int *)(lVar1 + 8) < *(int *)(lVar2 + 8)) {
          do {
            plVar5 = plVar4 + -1;
            *plVar4 = lVar2;
            lVar2 = plVar4[-2];
            plVar4 = plVar5;
          } while (*(int *)(lVar1 + 8) < *(int *)(lVar2 + 8));
        }
        *plVar5 = lVar1;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != param_2);
  }
  return;
}



undefined * FUN_14001ed50(longlong param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  undefined **ppuVar4;
  double dVar5;
  
  dVar5 = (double)param_2;
  if (param_2 < 0) {
    dVar5 = dVar5 + 1.8446744073709552e+19;
  }
  dVar5 = floor(dVar5 / (double)*(float *)(param_1 + 0x28));
  if (dVar5 < 1.8446744073709552e+19) {
    lVar1 = 0;
    if ((9.223372036854776e+18 < dVar5) &&
       (dVar5 = dVar5 - 9.223372036854776e+18, dVar5 < 9.223372036854776e+18)) {
      lVar1 = -0x8000000000000000;
    }
    lVar1 = (longlong)dVar5 + lVar1;
  }
  else {
    lVar1 = -1;
  }
  ppuVar4 = (undefined **)&DAT_14027a110;
  lVar3 = 0x28;
  do {
    lVar2 = lVar3 / 2;
    if (ppuVar4[lVar2] < (undefined *)(lVar1 + 1U)) {
      ppuVar4 = ppuVar4 + lVar2 + 1;
      lVar2 = lVar3 + (-1 - lVar2);
    }
    lVar3 = lVar2;
  } while (0 < lVar2);
  if (ppuVar4 == &Proud::INetServerEvent::vftable_meta_ptr) {
    return (undefined *)0xfffffffb;
  }
  return *ppuVar4;
}



void FUN_14001ee30(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  longlong lVar7;
  longlong *plVar8;
  longlong *plVar9;
  longlong lVar10;
  longlong *plVar11;
  ulonglong uVar12;
  undefined8 *puVar13;
  longlong *plVar14;
  double dVar15;
  longlong *local_40;
  ulonglong local_38;
  
  lVar10 = param_1[4];
  lVar1 = param_1[1];
  lVar2 = *param_1;
  local_40 = (longlong *)0x0;
  local_38 = param_2;
  FUN_140097060(&local_40,param_2,lVar1,param_4,0xfffffffffffffffe);
  lVar3 = param_1[1];
  puVar4 = (undefined8 *)*param_1;
  *param_1 = 0;
  param_1[1] = lVar3;
  param_1[4] = 0;
  for (plVar14 = (longlong *)param_1[6]; plVar14 != (longlong *)(lVar2 + lVar1 * 8);
      plVar14 = plVar14 + 1) {
    plVar9 = (longlong *)*plVar14;
    while (plVar9 != (longlong *)0x0) {
      plVar8 = plVar9 + 1;
      plVar11 = plVar8;
      if (0xf < (ulonglong)plVar9[4]) {
        plVar11 = (longlong *)*plVar8;
      }
      uVar12 = 0;
      if (0xf < (ulonglong)plVar9[4]) {
        plVar8 = (longlong *)*plVar8;
      }
      for (; plVar8 != (longlong *)((longlong)plVar11 + plVar9[3]);
          plVar8 = (longlong *)((longlong)plVar8 + 1)) {
        lVar7 = *plVar8;
        uVar12 = uVar12 ^ (longlong)(char)lVar7 + (uVar12 >> 2) + uVar12 * 0x40 + 0x9e3779b9;
      }
      *plVar14 = *plVar9;
      *plVar9 = local_40[uVar12 % local_38];
      local_40[uVar12 % local_38] = (longlong)plVar9;
      plVar9 = (longlong *)*plVar14;
    }
  }
  param_1[4] = lVar10;
  plVar14 = (longlong *)*param_1;
  *param_1 = (longlong)local_40;
  uVar12 = param_1[1];
  param_1[1] = local_38;
  if (param_1[4] == 0) {
    param_1[6] = *param_1 + local_38 * 8;
  }
  else {
    plVar9 = (longlong *)*param_1;
    param_1[6] = (longlong)plVar9;
    lVar10 = *plVar9;
    while (lVar10 == 0) {
      plVar9 = plVar9 + 1;
      param_1[6] = (longlong)plVar9;
      lVar10 = *plVar9;
    }
  }
  dVar15 = (double)param_1[1];
  if (param_1[1] < 0) {
    dVar15 = dVar15 + 1.8446744073709552e+19;
  }
  local_40 = plVar14;
  local_38 = uVar12;
  dVar15 = ceil((double)*(float *)(param_1 + 5) * dVar15);
  lVar10 = -1;
  if (dVar15 < 1.8446744073709552e+19) {
    lVar10 = 0;
    if ((9.223372036854776e+18 < dVar15) &&
       (dVar15 = dVar15 - 9.223372036854776e+18, dVar15 < 9.223372036854776e+18)) {
      lVar10 = -0x8000000000000000;
    }
    lVar10 = (longlong)dVar15 + lVar10;
  }
  param_1[7] = lVar10;
  if (puVar4 != (undefined8 *)0x0) {
    for (puVar13 = puVar4; puVar13 != puVar4 + lVar3; puVar13 = puVar13 + 1) {
      puVar5 = (undefined8 *)*puVar13;
      *puVar13 = 0;
      while (puVar5 != (undefined8 *)0x0) {
        puVar6 = (undefined8 *)*puVar5;
        if (0xf < (ulonglong)puVar5[4]) {
          operator_delete((void *)puVar5[1]);
        }
        puVar5[4] = 0xf;
        puVar5[3] = 0;
        *(undefined1 *)(puVar5 + 1) = 0;
        operator_delete(puVar5);
        puVar5 = puVar6;
      }
    }
    operator_delete(puVar4);
    uVar12 = local_38;
    plVar14 = local_40;
  }
  if (plVar14 != (longlong *)0x0) {
    plVar9 = plVar14 + uVar12;
    plVar8 = plVar14;
    for (; plVar14 != plVar9; plVar14 = plVar14 + 1) {
      puVar4 = (undefined8 *)*plVar14;
      *plVar14 = 0;
      while (puVar4 != (undefined8 *)0x0) {
        puVar13 = (undefined8 *)*puVar4;
        if (0xf < (ulonglong)puVar4[4]) {
          operator_delete((void *)puVar4[1]);
        }
        puVar4[4] = 0xf;
        puVar4[3] = 0;
        *(undefined1 *)(puVar4 + 1) = 0;
        operator_delete(puVar4);
        puVar4 = puVar13;
      }
      plVar8 = local_40;
    }
    operator_delete(plVar8);
  }
  return;
}



void FUN_14001f120(longlong param_1)

{
  longlong lVar1;
  undefined8 *puVar2;
  char *local_res8;
  undefined **local_58 [4];
  undefined8 local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined8 local_20;
  undefined8 local_18;
  undefined8 local_10;
  
  lVar1 = *(longlong *)(param_1 + 8);
  if (lVar1 != 0) {
    if (0xf < *(ulonglong *)(lVar1 + 0x20)) {
      operator_delete(*(void **)(lVar1 + 8));
    }
    *(undefined8 *)(lVar1 + 0x20) = 0xf;
    *(undefined8 *)(lVar1 + 0x18) = 0;
    *(undefined1 *)(lVar1 + 8) = 0;
    *(undefined1 *)(param_1 + 0x11) = 0;
    return;
  }
  *(undefined2 *)(param_1 + 0x10) = 0;
  puVar2 = operator_new(0x38);
  if (puVar2 != (undefined8 *)0x0) {
    *(undefined8 **)(param_1 + 8) = puVar2;
    *puVar2 = 0;
    puVar2[1] = local_38;
    puVar2[2] = local_30;
    puVar2[3] = local_28;
    puVar2[4] = local_20;
    puVar2[5] = local_18;
    puVar2[6] = local_10;
    *(undefined1 *)(param_1 + 0x10) = 1;
    return;
  }
  local_res8 = (char *)0x0;
  std::exception::exception((exception *)local_58,&local_res8);
  local_58[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f47a8);
}



void FUN_14001f220(longlong param_1)

{
  if (*(void **)(param_1 + 8) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 8));
  }
  return;
}



void FUN_14001f240(undefined8 *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  
  lVar1 = *(longlong *)(param_2 + -8);
  *(undefined8 *)(param_2 + -8) = *param_1;
  lVar2 = 2;
  lVar3 = 0;
  lVar5 = (param_2 - (longlong)param_1) + -8 >> 3;
  bVar6 = lVar5 == 2;
  lVar4 = lVar3;
  if (2 < lVar5) {
    do {
      lVar3 = lVar2;
      if (*(int *)(param_1[lVar2] + 4) < *(int *)(param_1[lVar2 + -1] + 4)) {
        lVar3 = lVar2 + -1;
      }
      param_1[lVar4] = param_1[lVar3];
      lVar2 = lVar3 * 2 + 2;
      bVar6 = lVar2 == lVar5;
      lVar4 = lVar3;
    } while (lVar2 < lVar5);
  }
  if (bVar6) {
    param_1[lVar3] = param_1[lVar5 + -1];
    lVar3 = lVar5 + -1;
  }
  while (0 < lVar3) {
    lVar2 = (lVar3 + -1) / 2;
    if (*(int *)(lVar1 + 4) <= *(int *)(param_1[lVar2] + 4)) break;
    param_1[lVar3] = param_1[lVar2];
    lVar3 = lVar2;
  }
  param_1[lVar3] = lVar1;
  return;
}



void FUN_14001f2f0(undefined8 *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  
  lVar1 = *(longlong *)(param_2 + -8);
  *(undefined8 *)(param_2 + -8) = *param_1;
  lVar2 = 2;
  lVar3 = 0;
  lVar5 = (param_2 - (longlong)param_1) + -8 >> 3;
  bVar6 = lVar5 == 2;
  lVar4 = lVar3;
  if (2 < lVar5) {
    do {
      lVar3 = lVar2;
      if (*(int *)(param_1[lVar2] + 8) < *(int *)(param_1[lVar2 + -1] + 8)) {
        lVar3 = lVar2 + -1;
      }
      param_1[lVar4] = param_1[lVar3];
      lVar2 = lVar3 * 2 + 2;
      bVar6 = lVar2 == lVar5;
      lVar4 = lVar3;
    } while (lVar2 < lVar5);
  }
  if (bVar6) {
    param_1[lVar3] = param_1[lVar5 + -1];
    lVar3 = lVar5 + -1;
  }
  while (0 < lVar3) {
    lVar2 = (lVar3 + -1) / 2;
    if (*(int *)(lVar1 + 8) <= *(int *)(param_1[lVar2] + 8)) break;
    param_1[lVar3] = param_1[lVar2];
    lVar3 = lVar2;
  }
  param_1[lVar3] = lVar1;
  return;
}



void FUN_14001f3a0(longlong param_1)

{
  FUN_14000e930(param_1 + -8);
  return;
}



undefined1 FUN_14001f3b0(void)

{
  return 0;
}



undefined8 * FUN_14001f3c0(undefined8 *param_1,undefined8 *param_2)

{
  if (param_1 != param_2) {
    if (0xf < (ulonglong)param_1[3]) {
      operator_delete((void *)*param_1);
    }
    param_1[3] = 0xf;
    param_1[2] = 0;
    *(undefined1 *)param_1 = 0;
    if ((ulonglong)param_2[3] < 0x10) {
      memmove(param_1,param_2,param_2[2] + 1);
    }
    else {
      *param_1 = *param_2;
      *param_2 = 0;
    }
    param_1[2] = param_2[2];
    param_1[3] = param_2[3];
    param_2[2] = 0;
    param_2[3] = 0;
  }
  return param_1;
}



undefined8 * FUN_14001f450(undefined8 *param_1,undefined1 param_2)

{
  ulonglong uVar1;
  code *pcVar2;
  undefined8 *puVar3;
  
  if (-param_1[2] - 1 < 2) {
    std::_Xlength_error("string too long");
    pcVar2 = (code *)swi(3);
    puVar3 = (undefined8 *)(*pcVar2)();
    return puVar3;
  }
  uVar1 = param_1[2] + 1;
  if (uVar1 != 0xffffffffffffffff) {
    if ((ulonglong)param_1[3] < uVar1) {
      FUN_140004270(param_1,uVar1);
      if (uVar1 == 0) {
        return param_1;
      }
    }
    else if (uVar1 == 0) {
      param_1[2] = 0;
      if (0xf < (ulonglong)param_1[3]) {
        *(undefined1 *)*param_1 = 0;
        return param_1;
      }
      *(undefined1 *)param_1 = 0;
      return param_1;
    }
    puVar3 = param_1;
    if (0xf < (ulonglong)param_1[3]) {
      puVar3 = (undefined8 *)*param_1;
    }
    *(undefined1 *)((longlong)puVar3 + param_1[2]) = param_2;
    param_1[2] = uVar1;
    puVar3 = param_1;
    if (0xf < (ulonglong)param_1[3]) {
      puVar3 = (undefined8 *)*param_1;
    }
    *(undefined1 *)((longlong)puVar3 + uVar1) = 0;
    return param_1;
  }
  std::_Xlength_error("string too long");
  pcVar2 = (code *)swi(3);
  puVar3 = (undefined8 *)(*pcVar2)();
  return puVar3;
}



uint FUN_14001f540(undefined8 *param_1,ulonglong param_2,void *param_3,ulonglong param_4)

{
  uint uVar1;
  ulonglong _Size;
  
  if ((ulonglong)param_1[2] < param_2) {
    param_2 = param_1[2];
  }
  if (0xf < (ulonglong)param_1[3]) {
    param_1 = (undefined8 *)*param_1;
  }
  _Size = param_4;
  if (param_2 < param_4) {
    _Size = param_2;
  }
  uVar1 = memcmp(param_1,param_3,_Size);
  if (uVar1 != 0) {
    return uVar1;
  }
  if (param_2 < param_4) {
    return 0xffffffff;
  }
  return (uint)(param_2 != param_4);
}



void FUN_14001f5c0(char param_1)

{
  DWORD DVar1;
  HANDLE hObject;
  HANDLE pvVar2;
  undefined4 uVar3;
  
  hObject = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,(HANDLE)0x0);
  if (hObject != (HANDLE)0x0) {
    uVar3 = 0x2000;
    if (param_1 != '\0') {
      uVar3 = 2;
    }
    DVar1 = GetCurrentProcessId();
    pvVar2 = GetCurrentProcess();
    MiniDumpWriteDump(pvVar2,DVar1,hObject,uVar3,0,0,0);
    CloseHandle(hObject);
  }
  return;
}



longlong * FUN_14001f680(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined *puVar2;
  int iVar3;
  int iVar4;
  undefined *puVar5;
  int iVar6;
  undefined *puVar7;
  undefined *local_res8;
  undefined8 uVar8;
  
  uVar8 = 0xfffffffffffffffe;
  FUN_1400a3440();
  puVar2 = PTR_DAT_1402f8010;
  local_res8 = PTR_DAT_1402f8010;
  iVar3 = FUN_1400a32c0(param_2);
  iVar6 = 0;
  if ((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8010)) {
    iVar6 = *(int *)(puVar2 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar6) && (iVar4 = 0, puVar2 != (undefined *)0x0)) && (puVar2 != PTR_DAT_1402f8010)
     ) {
    iVar4 = *(int *)(puVar2 + -8);
  }
  iVar6 = 1;
  if (1 < iVar4) {
    iVar6 = iVar4;
  }
  iVar4 = 0;
  if ((puVar2 != (undefined *)0x0) && (iVar4 = 0, puVar2 != PTR_DAT_1402f8010)) {
    iVar4 = *(int *)(puVar2 + -8);
  }
  if (iVar4 < iVar6) {
    FUN_140002d50(&local_res8);
  }
  FUN_140002e30(&local_res8);
  puVar2 = local_res8;
  puVar7 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar7,param_2,iVar3,param_4,uVar8);
  puVar7 = puVar2;
  if (puVar2 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1402f8010;
  }
  iVar3 = FUN_1400a32c0(puVar7);
  puVar7 = PTR_DAT_1402f8010;
  iVar6 = 0;
  if (0 < iVar3) {
    iVar6 = iVar3;
  }
  iVar3 = 0;
  if ((puVar2 != (undefined *)0x0) && (iVar3 = 0, puVar2 != PTR_DAT_1402f8010)) {
    iVar3 = *(int *)(puVar2 + -8);
  }
  if ((iVar3 <= iVar6) && (iVar6 = 0, puVar2 != (undefined *)0x0)) {
    if (puVar2 == PTR_DAT_1402f8010) goto LAB_14001f7a0;
    iVar6 = *(int *)(puVar2 + -8);
  }
  if (((puVar2 != PTR_DAT_1402f8010) && (puVar2 != (undefined *)0x0)) &&
     ((int *)(puVar2 + -8) != (int *)0x0)) {
    *(int *)(puVar2 + -8) = iVar6;
    *(undefined2 *)(puVar2 + (longlong)iVar6 * 2) = 0;
  }
LAB_14001f7a0:
  puVar5 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar5 = puVar7;
  }
  *param_1 = (longlong)puVar5;
  if (puVar2 != puVar5) {
    uVar8 = FUN_1400a3440();
    FUN_1400a1c30(uVar8);
    FUN_1400031d0(param_1);
    *param_1 = (longlong)puVar2;
    if (((puVar2 != PTR_DAT_1402f8010) && (puVar2 != (undefined *)0x0)) &&
       (puVar2 != (undefined *)0x8)) {
      *(int *)(puVar2 + -4) = *(int *)(puVar2 + -4) + 1;
    }
    FUN_1400d1290(uVar8);
    puVar7 = PTR_DAT_1402f8010;
  }
  if (((puVar2 != (undefined *)0x0) && (puVar2 != puVar7)) && (puVar2 + -8 != (undefined *)0x0)) {
    uVar8 = FUN_1400a3440();
    FUN_1400a1c30(uVar8);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2 + -8);
    }
    FUN_1400d1290(uVar8);
  }
  return param_1;
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl std::bad_alloc::`scalar deleting destructor'(unsigned
// int) __ptr64
// 
// Libraries: Visual Studio 2012 Release, Visual Studio 2015 Release

void * __thiscall std::bad_alloc::_scalar_deleting_destructor_(bad_alloc *this,uint param_1)

{
  *(undefined ***)this = Proud::INetServerEvent::vftable;
  FUN_140140b40();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_14001f8a0(undefined8 *param_1)

{
  *param_1 = Proud::INetServerEvent::vftable;
  FUN_140140b40();
  return;
}



// WARNING: Removing unreachable block (ram,0x00014001fa50)
// WARNING: Removing unreachable block (ram,0x00014001fa59)
// WARNING: Removing unreachable block (ram,0x00014001fa7a)
// WARNING: Removing unreachable block (ram,0x00014001fa83)

undefined8 *
FUN_14001f8b0(undefined8 *param_1,undefined8 param_2,undefined1 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined4 uVar2;
  
  *param_1 = Proud::INetServerEvent::vftable;
  param_1[9] = 0;
  FUN_1400a3440(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  param_1[10] = PTR_DAT_1402f8010;
  param_1[0xb] = 0;
  *(undefined4 *)(param_1 + 0xc) = 0;
  FUN_14018a120(param_1 + 1);
  param_1[1] = RNP::GateLobbyStub::vftable;
  FUN_14018a120(param_1 + 5);
  *param_1 = MGGatewayProud::vftable;
  param_1[1] = MGGatewayProud::vftable;
  param_1[5] = MGGatewayProud::vftable;
  param_1[0xd] = param_2;
  puVar1 = param_1 + 0xe;
  FUN_140186ea0(puVar1);
  *puVar1 = GG_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x84) != 1) {
    FUN_1400a2b50(PTR_u_PIDL_compiler_is_incompatible_to_14030bd40);
  }
  *puVar1 = RNP::GateLobbyProxy::vftable;
  *(undefined1 *)(param_1 + 0x11) = 0;
  puVar1 = param_1 + 0x12;
  FUN_140186ea0(puVar1);
  *puVar1 = G2G_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0xa4) != 1) {
    FUN_1400a2b50(PTR_u_PIDL_compiler_is_incompatible_to_14030bd40);
  }
  *puVar1 = RNP::Gate2GateProxy::vftable;
  *(undefined1 *)(param_1 + 0x15) = 0;
  uVar2 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0x16,uVar2,1);
  *(undefined1 *)(param_1 + 0x1d) = 0;
  param_1[0x27] = 0;
  param_1[0x1e] = 0;
  param_1[0x1f] = 0;
  param_1[0x20] = 0;
  *(undefined4 *)(param_1 + 0x22) = 0x11;
  param_1[0x21] = 0;
  *(undefined4 *)(param_1 + 0x26) = 0;
  *(undefined4 *)((longlong)param_1 + 0x114) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x23) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x11c) = 0x40100000;
  param_1[0x24] = 0x26;
  param_1[0x25] = 4;
  param_1[0x25] = 0;
  param_1[0x28] = 0;
  param_1[0x29] = 0;
  param_1[0x2a] = 0;
  param_1[0x2b] = 0;
  return param_1;
}



void * FUN_14001fae0(void *param_1,uint param_2)

{
  FUN_14001fb10();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14001fb10(undefined8 *param_1)

{
  undefined8 *puVar1;
  
  *param_1 = MGGatewayProud::vftable;
  param_1[1] = MGGatewayProud::vftable;
  param_1[5] = MGGatewayProud::vftable;
  FUN_140021620(param_1 + 0x1d);
  FUN_1400a1cd0(param_1 + 0x16);
  param_1[0x12] = RNP::Gate2GateProxy::vftable;
  FUN_140186ed0();
  param_1[0xe] = RNP::GateLobbyProxy::vftable;
  FUN_140186ed0();
  param_1[5] = RNP::Gate2GateStub::vftable;
  FUN_14018a150(param_1 + 5);
  param_1[1] = RNP::GateLobbyStub::vftable;
  FUN_14018a150(param_1 + 1);
  puVar1 = (undefined8 *)param_1[9];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  param_1[9] = 0;
  FUN_1400031d0(param_1 + 10);
  *param_1 = Proud::INetServerEvent::vftable;
  FUN_140140b40(param_1);
  return;
}



void FUN_14001fc10(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined *puVar4;
  undefined *local_res18 [2];
  
  plVar2 = (longlong *)FUN_1401417c0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1402f8010;
  }
  FUN_140026050(L"OnError MGGatewayProud : %s",puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1402f8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res18[0] + -8);
    }
    FUN_1400d1290(uVar3);
  }
  return;
}



void FUN_14001fcb0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined *puVar4;
  undefined *local_res18 [2];
  
  plVar2 = (longlong *)FUN_1401417c0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1402f8010;
  }
  FUN_140026050(L"OnWarning MGGatewayProud : %s",puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1402f8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res18[0] + -8);
    }
    FUN_1400d1290(uVar3);
  }
  return;
}



void FUN_14001fd50(undefined8 param_1,longlong *param_2)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(*param_2 + 8))(param_2);
  FUN_140025f00("OnException MGGatewayProud : %s",uVar1);
  return;
}



void FUN_14001fd70(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  longlong lVar4;
  ulonglong uVar5;
  undefined8 uVar6;
  undefined **local_30;
  longlong *local_28;
  longlong local_20;
  ulonglong local_18;
  undefined8 local_10;
  
  uVar6 = 0xfffffffffffffffe;
  plVar2 = (longlong *)FUN_1401615e0();
  puVar1 = (undefined8 *)(param_1 + 0x48);
  *puVar1 = plVar2;
  (**(code **)(*plVar2 + 0x130))(plVar2,param_1,*plVar2,param_4,uVar6);
  (**(code **)(*(longlong *)*puVar1 + 0x10))((longlong *)*puVar1,param_1 + 8);
  (**(code **)(*(longlong *)*puVar1 + 0x10))((longlong *)*puVar1,param_1 + 0x28);
  (**(code **)(*(longlong *)*puVar1 + 8))((longlong *)*puVar1,param_1 + 0x70);
  (**(code **)(*(longlong *)*puVar1 + 8))((longlong *)*puVar1,param_1 + 0x90);
  puVar3 = (undefined8 *)(DAT_140320138 + 0x30);
  if (7 < *(ulonglong *)(DAT_140320138 + 0x48)) {
    puVar3 = (undefined8 *)*puVar3;
  }
  FUN_14001f680(param_1 + 0x50,puVar3);
  *(undefined4 *)(param_1 + 0x58) = *(undefined4 *)(DAT_140320138 + 0x80);
  local_30 = Proud::CFastArray<>::vftable;
  local_28 = (longlong *)0x0;
  local_20 = 0;
  local_18 = 0;
  local_10 = 0;
  FUN_1400a7b00(&local_30);
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  FUN_14008c0f0(puVar1,DAT_1403205d5 != '\0',DAT_1403205d5 != '\0');
  local_30 = Proud::CFastArray<>::vftable;
  if (0 < (int)local_18) {
    uVar5 = local_18 & 0xffffffff;
    lVar4 = local_20;
    do {
      FUN_14000c2a0(lVar4);
      lVar4 = lVar4 + 8;
      uVar5 = uVar5 - 1;
    } while (uVar5 != 0);
  }
  if (local_20 != 0) {
    if (local_28 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*local_28 + 0x18))(local_28,local_20);
    }
  }
  return;
}



longlong * FUN_14001fee0(longlong param_1,longlong *param_2,uint param_3)

{
  longlong *plVar1;
  uint *puVar2;
  ulonglong uVar3;
  longlong lVar4;
  longlong local_res8;
  
  lVar4 = 0;
  local_res8 = 0;
  uVar3 = (ulonglong)param_3 % (ulonglong)*(uint *)(param_1 + 0x110);
  if (*(longlong *)(param_1 + 0xf0) != 0) {
    for (puVar2 = *(uint **)(*(longlong *)(param_1 + 0xf0) + uVar3 * 8);
        (puVar2 != (uint *)0x0 && ((uint)uVar3 == puVar2[8] % *(uint *)(param_1 + 0x110)));
        puVar2 = *(uint **)(puVar2 + 4)) {
      if (*puVar2 == param_3) {
        if (*(longlong *)(puVar2 + 2) != 0) {
          *(longlong *)(*(longlong *)(puVar2 + 2) + 8) =
               *(longlong *)(*(longlong *)(puVar2 + 2) + 8) + 1;
          local_res8 = *(longlong *)(puVar2 + 2);
        }
        *param_2 = 0;
        if (local_res8 != 0) {
          *(longlong *)(local_res8 + 8) = *(longlong *)(local_res8 + 8) + 1;
          if ((*param_2 != 0) &&
             (*(longlong *)(*param_2 + 8) = *(longlong *)(*param_2 + 8) + -1,
             *(longlong *)(*param_2 + 8) == 0)) {
            lVar4 = *param_2;
          }
          *param_2 = local_res8;
          if (lVar4 != 0) {
            FUN_1400219e0(lVar4);
          }
        }
        if (local_res8 != 0) {
          plVar1 = (longlong *)(local_res8 + 8);
          *plVar1 = *plVar1 + -1;
          if (*plVar1 == 0) {
            FUN_1400219e0(local_res8);
            return param_2;
          }
          return param_2;
        }
        return param_2;
      }
    }
  }
  *param_2 = 0;
  return param_2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140020000(longlong param_1,undefined8 *param_2)

{
  int *piVar1;
  WCHAR WVar2;
  longlong *plVar3;
  undefined8 *puVar4;
  undefined8 uVar5;
  ulonglong *puVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  WCHAR *pWVar10;
  LPCSTR lpMultiByteStr;
  undefined1 auStackY_f8 [32];
  ulonglong *local_c8;
  LPCSTR local_c0;
  undefined *local_b8;
  undefined8 local_b0;
  undefined1 local_a8;
  longlong local_a0;
  undefined1 local_98;
  undefined8 local_90;
  undefined1 local_88;
  undefined8 local_80;
  WCHAR local_78 [32];
  ulonglong local_38;
  
  local_80 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStackY_f8;
  local_a0 = param_1 + 0xb0;
  FUN_1400a1c30();
  local_98 = 1;
  plVar3 = operator_new(0x40);
  uVar9 = 0;
  if (plVar3 == (longlong *)0x0) {
    local_c8 = (ulonglong *)0x0;
  }
  else {
    *plVar3 = param_1;
    *(undefined4 *)(plVar3 + 1) = 0;
    plVar3[5] = 7;
    plVar3[4] = 0;
    *(undefined2 *)(plVar3 + 2) = 0;
    *(undefined4 *)(plVar3 + 7) = 0;
    local_c8 = (ulonglong *)FUN_1400a34c0(0x10);
    local_c8[1] = 1;
    *local_c8 = (ulonglong)plVar3;
  }
  uVar7 = uVar9;
  if (local_c8 != (ulonglong *)0x0) {
    uVar7 = *local_c8;
  }
  *(undefined4 *)(uVar7 + 8) = *(undefined4 *)(param_2 + 6);
  local_78[0] = L'\0';
  local_78[1] = L'\0';
  local_78[2] = L'\0';
  local_78[3] = L'\0';
  local_78[4] = L'\0';
  local_78[5] = L'\0';
  local_78[6] = L'\0';
  local_78[7] = L'\0';
  local_78[8] = L'\0';
  local_78[9] = L'\0';
  local_78[10] = L'\0';
  local_78[0xb] = L'\0';
  local_78[0xc] = L'\0';
  local_78[0xd] = L'\0';
  local_78[0xe] = L'\0';
  local_78[0xf] = L'\0';
  local_78[0x10] = L'\0';
  local_78[0x11] = L'\0';
  local_78[0x12] = L'\0';
  local_78[0x13] = L'\0';
  local_78[0x14] = L'\0';
  local_78[0x15] = L'\0';
  local_78[0x16] = L'\0';
  local_78[0x17] = L'\0';
  local_78[0x18] = L'\0';
  local_78[0x19] = L'\0';
  local_78[0x1a] = L'\0';
  local_78[0x1b] = L'\0';
  local_78[0x1c] = L'\0';
  local_78[0x1d] = L'\0';
  local_78[0x1e] = L'\0';
  local_78[0x1f] = 0;
  FUN_1400a7220(param_2,&local_c0);
  lpMultiByteStr = PTR_DAT_1402f8008;
  uVar7 = uVar9;
  if ((local_c0 != (LPCSTR)0x0) &&
     (lpMultiByteStr = local_c0, uVar7 = 0, local_c0 != PTR_DAT_1402f8008)) {
    uVar7 = (ulonglong)*(uint *)(local_c0 + -8);
  }
  MultiByteToWideChar(0,1,lpMultiByteStr,(int)uVar7,local_78,0x20);
  uVar7 = uVar9;
  if (local_c8 != (ulonglong *)0x0) {
    uVar7 = *local_c8;
  }
  uVar8 = 0xffffffffffffffff;
  pWVar10 = local_78;
  do {
    if (uVar8 == 0) break;
    uVar8 = uVar8 - 1;
    WVar2 = *pWVar10;
    pWVar10 = pWVar10 + 1;
  } while (WVar2 != L'\0');
  FUN_140001b00(uVar7 + 0x10,local_78,~uVar8 - 1);
  puVar4 = (undefined8 *)(**(code **)*param_2)(param_2,&local_b8);
  FUN_1401e4980(DAT_140320100,L"Server Join[%d][%s]",*(undefined4 *)(param_2 + 6),*puVar4);
  if (((local_b8 != (undefined *)0x0) && (local_b8 != PTR_DAT_1402f8010)) &&
     (local_b8 + -8 != (undefined *)0x0)) {
    uVar5 = FUN_1400a3440();
    local_b0 = uVar5;
    FUN_1400a1c30(uVar5);
    local_a8 = 1;
    piVar1 = (int *)(local_b8 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_b8 + -8);
    }
    FUN_1400d1290(uVar5);
    local_a8 = 0;
  }
  local_b8 = PTR_DAT_1402f8010;
  uVar7 = uVar9;
  if (local_c8 != (ulonglong *)0x0) {
    uVar7 = *local_c8;
  }
  puVar6 = (ulonglong *)FUN_140021560(param_1 + 0xe8,uVar7 + 8);
  if (local_c8 != (ulonglong *)*puVar6) {
    if (local_c8 != (ulonglong *)0x0) {
      local_c8[1] = local_c8[1] + 1;
    }
    if ((*puVar6 != 0) &&
       (*(longlong *)(*puVar6 + 8) = *(longlong *)(*puVar6 + 8) + -1,
       *(longlong *)(*puVar6 + 8) == 0)) {
      uVar9 = *puVar6;
    }
    *puVar6 = (ulonglong)local_c8;
    if (uVar9 != 0) {
      FUN_1400219e0(uVar9);
    }
  }
  if (((local_c0 != (LPCSTR)0x0) && (local_c0 != PTR_DAT_1402f8008)) &&
     (local_c0 + -8 != (LPCSTR)0x0)) {
    uVar5 = FUN_1400a3440();
    local_90 = uVar5;
    FUN_1400a1c30(uVar5);
    local_88 = 1;
    piVar1 = (int *)(local_c0 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_c0 + -8);
    }
    FUN_1400d1290(uVar5);
    local_88 = 0;
  }
  local_c0 = PTR_DAT_1402f8008;
  if (local_c8 != (ulonglong *)0x0) {
    puVar6 = local_c8 + 1;
    *puVar6 = *puVar6 - 1;
    if (*puVar6 == 0) {
      FUN_1400219e0(local_c8);
    }
  }
  FUN_1400d1290(local_a0);
  return;
}



void FUN_1400202f0(longlong param_1,undefined8 *param_2,undefined8 param_3)

{
  int *piVar1;
  int iVar2;
  uint *puVar3;
  ulonglong uVar4;
  longlong *plVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  undefined8 uVar8;
  longlong lVar9;
  longlong lVar10;
  wchar_t *pwVar11;
  longlong local_res8;
  undefined *local_res10;
  undefined *local_58;
  undefined8 local_50;
  longlong local_48;
  undefined1 local_40;
  undefined8 local_38;
  undefined1 local_30;
  undefined8 local_28;
  undefined1 local_20;
  
  local_50 = 0xfffffffffffffffe;
  lVar10 = param_1 + 0xb0;
  local_48 = lVar10;
  FUN_1400a1c30(lVar10);
  local_40 = 1;
  plVar5 = (longlong *)FUN_14001fee0(param_1,&local_res8,*(undefined4 *)(param_2 + 6));
  lVar9 = 0;
  if ((longlong *)*plVar5 != (longlong *)0x0) {
    lVar9 = *(longlong *)*plVar5;
  }
  if ((local_res8 != 0) &&
     (*(longlong *)(local_res8 + 8) = *(longlong *)(local_res8 + 8) + -1, lVar10 = local_48,
     *(longlong *)(local_res8 + 8) == 0)) {
    FUN_1400219e0(local_res8);
    lVar10 = local_48;
  }
  if (lVar9 != 0) {
    puVar6 = (undefined8 *)FUN_1401417c0(param_3,&local_58);
    puVar7 = (undefined8 *)(**(code **)*param_2)(param_2,&local_res10);
    iVar2 = *(int *)(lVar9 + 0x38);
    if (iVar2 == 1) {
      pwVar11 = L"LOBBY";
    }
    else if (iVar2 == 2) {
      pwVar11 = L"DUNGEON";
    }
    else if (iVar2 == 3) {
      pwVar11 = L"PVP";
    }
    else if (iVar2 == 4) {
      pwVar11 = L"WAR";
    }
    else if (iVar2 == 5) {
      pwVar11 = L"GUILD_LOBBY";
    }
    else {
      pwVar11 = L"NONE";
    }
    FUN_1401e4980(DAT_140320100,L"%s Server Leave[%d][%s] [%s]",pwVar11,*(undefined4 *)(param_2 + 6)
                  ,*puVar7,*puVar6);
    if (((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1402f8010)) &&
       (local_res10 + -8 != (undefined *)0x0)) {
      uVar8 = FUN_1400a3440();
      local_38 = uVar8;
      FUN_1400a1c30(uVar8);
      local_30 = 1;
      piVar1 = (int *)(local_res10 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(local_res10 + -8);
      }
      FUN_1400d1290(uVar8);
    }
    local_res10 = PTR_DAT_1402f8010;
    if (((local_58 != (undefined *)0x0) && (local_58 != PTR_DAT_1402f8010)) &&
       (local_58 + -8 != (undefined *)0x0)) {
      uVar8 = FUN_1400a3440();
      local_28 = uVar8;
      FUN_1400a1c30(uVar8);
      local_20 = 1;
      piVar1 = (int *)(local_58 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(local_58 + -8);
      }
      FUN_1400d1290(uVar8);
    }
    if (*(longlong *)(param_1 + 0x68) != 0) {
      (**(code **)(**(longlong **)(param_1 + 0x68) + 0x50))();
    }
  }
  uVar4 = (ulonglong)*(uint *)(param_2 + 6) % (ulonglong)*(uint *)(param_1 + 0x110);
  if (*(longlong *)(param_1 + 0xf0) != 0) {
    puVar3 = *(uint **)(*(longlong *)(param_1 + 0xf0) + uVar4 * 8);
    while( true ) {
      if ((puVar3 == (uint *)0x0) || ((uint)uVar4 != puVar3[8] % *(uint *)(param_1 + 0x110)))
      goto LAB_14002053d;
      if (*puVar3 == *(uint *)(param_2 + 6)) break;
      puVar3 = *(uint **)(puVar3 + 4);
    }
    FUN_1400218e0(param_1 + 0xe8,puVar3);
  }
LAB_14002053d:
  FUN_1400d1290(lVar10);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140020660)
// WARNING: Removing unreachable block (ram,0x000140020667)
// WARNING: Removing unreachable block (ram,0x000140020673)
// WARNING: Removing unreachable block (ram,0x00014002067f)
// WARNING: Removing unreachable block (ram,0x000140020677)
// WARNING: Removing unreachable block (ram,0x000140020685)
// WARNING: Removing unreachable block (ram,0x000140020695)

void FUN_140020560(longlong param_1,undefined8 param_2)

{
  void *pvVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong *plVar4;
  longlong *plVar5;
  int iVar6;
  uint uVar7;
  longlong *plVar8;
  undefined8 *local_res8;
  undefined **local_50;
  longlong *local_48;
  longlong *local_40;
  undefined8 local_38;
  undefined8 local_30;
  
  local_50 = Proud::CFastArray<>::vftable;
  plVar8 = (longlong *)0x0;
  uVar7 = 0;
  local_48 = (longlong *)0x0;
  local_40 = (longlong *)0x0;
  local_38 = 0;
  local_30 = 0;
  FUN_1400a1c30(param_1 + 0xb0);
  plVar4 = plVar8;
  plVar3 = plVar8;
  plVar5 = plVar8;
  plVar2 = plVar8;
  if (*(longlong *)(param_1 + 0x108) != 0) {
    plVar4 = *(longlong **)(param_1 + 0xf8);
  }
  while( true ) {
    if (plVar4 == (longlong *)0x0) {
      FUN_1400d1290(param_1 + 0xb0);
      plVar4 = plVar2;
      if (uVar7 == 0) {
        plVar4 = plVar8;
      }
      (**(code **)(*(longlong *)(param_1 + 0x70) + 0xb8))
                ((longlong *)(param_1 + 0x70),plVar4,uVar7,&DAT_14030ab90,param_2);
      if (plVar2 != (longlong *)0x0) {
        if (plVar5 == (longlong *)0x0) {
          FUN_1400a3530(plVar2);
        }
        else {
          (**(code **)(*plVar5 + 0x18))(plVar5,plVar2);
        }
      }
      return;
    }
    plVar5 = plVar8;
    if (plVar4 != (longlong *)0x0) {
      plVar5 = (longlong *)plVar4[2];
    }
    local_res8 = (undefined8 *)0x0;
    iVar6 = (int)plVar3;
    if (plVar4[1] != 0) {
      *(longlong *)(plVar4[1] + 8) = *(longlong *)(plVar4[1] + 8) + 1;
      local_res8 = (undefined8 *)plVar4[1];
      iVar6 = (uint)local_38;
    }
    plVar4 = plVar8;
    if (local_res8 != (undefined8 *)0x0) {
      plVar4 = (longlong *)*local_res8;
    }
    if (iVar6 < 0) break;
    FUN_140021fb0(&local_50,iVar6 + 1);
    plVar3 = local_40;
    if ((uint)local_38 == 0) {
      plVar3 = plVar8;
    }
    *(int *)((longlong)plVar3 + (longlong)iVar6 * 4) = (int)plVar4[1];
    if (local_res8 != (undefined8 *)0x0) {
      plVar4 = local_res8 + 1;
      *plVar4 = *plVar4 + -1;
      if (*plVar4 == 0) {
        pvVar1 = (void *)*local_res8;
        if (pvVar1 != (void *)0x0) {
          if (7 < *(ulonglong *)((longlong)pvVar1 + 0x28)) {
            operator_delete(*(void **)((longlong)pvVar1 + 0x10));
          }
          *(undefined8 *)((longlong)pvVar1 + 0x28) = 7;
          *(undefined8 *)((longlong)pvVar1 + 0x20) = 0;
          *(undefined2 *)((longlong)pvVar1 + 0x10) = 0;
          operator_delete(pvVar1);
        }
        FUN_1400a3530(local_res8);
      }
    }
    uVar7 = (uint)local_38;
    plVar4 = plVar5;
    plVar3 = (longlong *)(ulonglong)(uint)local_38;
    plVar5 = local_48;
    plVar2 = local_40;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400207a0(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  bool bVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong lVar4;
  undefined1 auStack_f8 [32];
  undefined4 *local_d8;
  undefined2 *local_d0;
  undefined4 *local_c8;
  undefined1 *local_c0;
  undefined4 *local_b8;
  undefined1 local_a8;
  undefined1 local_a7;
  undefined1 local_a6;
  undefined1 local_a5;
  undefined2 local_a4 [2];
  undefined4 local_a0 [2];
  longlong local_98;
  undefined4 local_90 [2];
  longlong local_88;
  undefined1 local_80;
  char *local_78;
  DWORD local_70;
  longlong local_68;
  undefined8 local_60;
  undefined4 local_58;
  undefined4 uStack_54;
  undefined4 local_50;
  undefined4 uStack_4c;
  ulonglong local_48;
  
  local_60 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_f8;
  local_78 = "GG_CLIENT_AUTH_INFO";
  local_68 = **(longlong **)(*(longlong *)(param_1 + 0x140) + 8) + 0x68;
  local_70 = timeGetTime();
  lVar3 = param_1 + 0xa8;
  local_88 = lVar3;
  FUN_1400a1c30(lVar3);
  local_80 = 1;
  plVar2 = (longlong *)FUN_14001fee0(param_1 + -8,&local_98);
  lVar4 = 0;
  bVar1 = false;
  if ((longlong *)*plVar2 != (longlong *)0x0) {
    lVar4 = *(longlong *)*plVar2;
  }
  if ((local_98 != 0) &&
     (*(longlong *)(local_98 + 8) = *(longlong *)(local_98 + 8) + -1, lVar3 = local_88,
     *(longlong *)(local_98 + 8) == 0)) {
    FUN_1400219e0(local_98);
    lVar3 = local_88;
  }
  if (lVar4 == 0) {
    FUN_1400d1290(lVar3);
  }
  else {
    local_58 = 0;
    uStack_54 = 0;
    local_50 = 0;
    uStack_4c = 0;
    local_a4[0] = 0xffff;
    local_a8 = 0;
    local_a7 = 0;
    local_a0[0] = 0;
    if (*(longlong *)(param_1 + 0x60) != 0) {
      local_c8 = local_a0;
      local_d0 = (undefined2 *)&local_a7;
      local_d8 = (undefined4 *)&local_a8;
      (**(code **)(**(longlong **)(param_1 + 0x60) + 0x90))
                (*(longlong **)(param_1 + 0x60),param_4,&local_58,local_a4);
    }
    if ((CONCAT44(uStack_54,local_58) != 0) || (CONCAT44(uStack_4c,local_50) != 0)) {
      bVar1 = true;
    }
    plVar2 = (longlong *)(param_1 + 0x68);
    if (bVar1) {
      local_b8 = local_a0;
      local_c0 = &local_a6;
      local_c8 = (undefined4 *)&local_a5;
      local_d0 = local_a4;
      local_d8 = &local_58;
      local_a6 = local_a7;
      local_a5 = local_a8;
      (**(code **)(*plVar2 + 0x60))(plVar2,param_2,&DAT_14030ab90,param_4);
    }
    else {
      local_90[0] = 7;
      local_d8 = local_90;
      (**(code **)(*plVar2 + 0x70))(plVar2,param_2,&DAT_14030ab90,param_4);
    }
    FUN_1400d1290(lVar3);
  }
  FUN_140070e40(&local_78);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_1400209c0(longlong param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined1 *param_9,longlong *param_10,longlong *param_11,undefined4 *param_12,
             undefined4 *param_13)

{
  short sVar1;
  errno_t eVar2;
  int iVar3;
  longlong *plVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong lVar7;
  short *psVar8;
  undefined *puVar9;
  undefined1 auStack_1b8 [32];
  undefined *local_198;
  undefined4 local_190;
  undefined4 local_188;
  undefined4 local_180;
  undefined1 local_178;
  undefined4 local_170;
  undefined4 local_168;
  undefined4 local_160;
  longlong local_158;
  undefined8 local_150;
  undefined4 local_148;
  __time64_t local_140;
  undefined4 *local_138;
  undefined1 *local_130;
  longlong local_128;
  undefined1 local_120;
  longlong *local_118;
  undefined4 *local_110;
  undefined4 *local_108;
  undefined4 *local_100;
  longlong *local_f8;
  char *local_f0;
  DWORD local_e8;
  longlong local_e0;
  undefined8 local_d8;
  short local_d0;
  short local_ce;
  undefined2 local_cc;
  undefined2 local_ca;
  undefined2 local_c8;
  undefined2 local_c6;
  undefined2 local_c4;
  undefined2 local_c2;
  tm local_c0;
  undefined8 local_98;
  undefined2 local_90;
  undefined6 uStack_8e;
  undefined8 local_80;
  ulonglong local_78;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined8 local_58;
  undefined8 local_50;
  ulonglong local_48;
  
  local_d8 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_1b8;
  local_100 = param_7;
  local_110 = param_8;
  local_130 = param_9;
  local_f8 = param_10;
  local_118 = param_11;
  local_108 = param_12;
  local_f0 = "GG_GAME_SERVER_INFO_SUCC_U";
  local_e0 = **(longlong **)(*(longlong *)(param_1 + 0x140) + 8) + 0x68;
  local_138 = param_4;
  local_e8 = timeGetTime();
  lVar6 = param_1 + 0xa8;
  local_128 = lVar6;
  FUN_1400a1c30(lVar6);
  local_120 = 1;
  plVar4 = (longlong *)FUN_14001fee0(param_1 + -8,&local_158,param_2);
  lVar7 = 0;
  if ((longlong *)*plVar4 != (longlong *)0x0) {
    lVar7 = *(longlong *)*plVar4;
  }
  if ((local_158 != 0) &&
     (*(longlong *)(local_158 + 8) = *(longlong *)(local_158 + 8) + -1, lVar6 = local_128,
     *(longlong *)(local_158 + 8) == 0)) {
    FUN_1400219e0(local_158);
    lVar6 = local_128;
  }
  if (lVar7 == 0) {
    FUN_1400d1290(lVar6);
  }
  else {
    if (*(longlong *)(param_1 + 0x60) != 0) {
      local_198 = (undefined *)*local_118;
      if ((undefined *)*local_118 == (undefined *)0x0) {
        local_198 = PTR_DAT_1402f8010;
      }
      puVar9 = (undefined *)*local_f8;
      if ((undefined *)*local_f8 == (undefined *)0x0) {
        puVar9 = PTR_DAT_1402f8010;
      }
      local_160 = *param_13;
      local_168 = *local_108;
      local_170 = *param_6;
      local_178 = *local_130;
      local_180 = *local_100;
      local_188 = *param_5;
      local_190 = *local_110;
      (**(code **)(**(longlong **)(param_1 + 0x60) + 0x40))
                (*(longlong **)(param_1 + 0x60),*local_138,*(undefined4 *)(lVar7 + 8),puVar9);
    }
    local_78 = 7;
    local_80 = 0;
    local_90 = 0;
    local_140 = _time64((__time64_t *)0x0);
    local_150 = 0;
    local_148 = 0;
    eVar2 = _localtime64_s(&local_c0,&local_140);
    if (eVar2 == 0) {
      local_d0 = (short)local_c0.tm_year + 0x76c;
      local_ce = (short)local_c0.tm_mon + 1;
      local_cc = (undefined2)local_c0.tm_wday;
      local_ca = (undefined2)local_c0.tm_mday;
      local_c8 = (undefined2)local_c0.tm_hour;
      local_c6 = (undefined2)local_c0.tm_min;
      local_c4 = (undefined2)local_c0.tm_sec;
      local_c2 = 0;
      iVar3 = Ordinal_184(&local_d0,&local_150);
      local_58 = 0;
      local_50 = 0;
      if (iVar3 != 0) {
        Ordinal_185(local_150,&local_58);
      }
    }
    local_98 = local_150;
    plVar4 = (longlong *)(lVar7 + 0x10);
    if (7 < *(ulonglong *)(lVar7 + 0x28)) {
      plVar4 = (longlong *)*plVar4;
    }
    uVar5 = 0xffffffffffffffff;
    psVar8 = (short *)plVar4;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001b00(&local_90,plVar4,~uVar5 - 1);
    local_68 = *param_5;
    local_64 = *param_6;
    local_60 = *param_13;
    if (DAT_14031fee0 != 0) {
      FUN_140024e40(&local_98);
    }
    if (7 < local_78) {
      operator_delete((void *)CONCAT62(uStack_8e,local_90));
    }
    local_78 = 7;
    local_80 = 0;
    local_90 = 0;
    FUN_1400d1290(lVar6);
  }
  FUN_140070e40(&local_f0);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_140020cf0(longlong param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7)

{
  short sVar1;
  errno_t eVar2;
  int iVar3;
  longlong *plVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong lVar7;
  short *psVar8;
  undefined1 auStack_158 [32];
  undefined4 local_138;
  undefined4 local_130;
  longlong local_128;
  undefined8 local_120;
  undefined4 local_118;
  longlong local_110;
  undefined1 local_108;
  __time64_t local_100;
  undefined4 *local_f8;
  char *local_f0;
  DWORD local_e8;
  longlong local_e0;
  undefined8 local_d8;
  short local_d0;
  short local_ce;
  undefined2 local_cc;
  undefined2 local_ca;
  undefined2 local_c8;
  undefined2 local_c6;
  undefined2 local_c4;
  undefined2 local_c2;
  tm local_c0;
  undefined8 local_98;
  undefined2 local_90;
  undefined6 uStack_8e;
  undefined8 local_80;
  ulonglong local_78;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined8 local_58;
  undefined8 local_50;
  ulonglong local_48;
  
  local_d8 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_158;
  local_f8 = param_5;
  local_f0 = "GG_GAME_SERVER_CHANNEL_INFO";
  local_e0 = **(longlong **)(*(longlong *)(param_1 + 0x140) + 8) + 0x68;
  local_e8 = timeGetTime();
  lVar7 = param_1 + 0xa8;
  local_110 = lVar7;
  FUN_1400a1c30(lVar7);
  local_108 = 1;
  plVar4 = (longlong *)FUN_14001fee0(param_1 + -8,&local_128,param_2);
  lVar6 = 0;
  if ((longlong *)*plVar4 != (longlong *)0x0) {
    lVar6 = *(longlong *)*plVar4;
  }
  if ((local_128 != 0) &&
     (*(longlong *)(local_128 + 8) = *(longlong *)(local_128 + 8) + -1, lVar7 = local_110,
     *(longlong *)(local_128 + 8) == 0)) {
    FUN_1400219e0(local_128);
    lVar7 = local_110;
  }
  if (lVar6 == 0) {
    FUN_1400d1290(lVar7);
  }
  else {
    if (*(longlong *)(param_1 + 0x60) != 0) {
      local_130 = *param_7;
      local_138 = *param_6;
      (**(code **)(**(longlong **)(param_1 + 0x60) + 0x48))
                (*(longlong **)(param_1 + 0x60),*(undefined4 *)(lVar6 + 8),*param_4,*local_f8);
    }
    local_78 = 7;
    local_80 = 0;
    local_90 = 0;
    local_100 = _time64((__time64_t *)0x0);
    local_120 = 0;
    local_118 = 0;
    eVar2 = _localtime64_s(&local_c0,&local_100);
    if (eVar2 == 0) {
      local_d0 = (short)local_c0.tm_year + 0x76c;
      local_ce = (short)local_c0.tm_mon + 1;
      local_cc = (undefined2)local_c0.tm_wday;
      local_ca = (undefined2)local_c0.tm_mday;
      local_c8 = (undefined2)local_c0.tm_hour;
      local_c6 = (undefined2)local_c0.tm_min;
      local_c4 = (undefined2)local_c0.tm_sec;
      local_c2 = 0;
      iVar3 = Ordinal_184(&local_d0,&local_120);
      local_58 = 0;
      local_50 = 0;
      if (iVar3 != 0) {
        Ordinal_185(local_120,&local_58);
      }
    }
    local_98 = local_120;
    plVar4 = (longlong *)(lVar6 + 0x10);
    if (7 < *(ulonglong *)(lVar6 + 0x28)) {
      plVar4 = (longlong *)*plVar4;
    }
    uVar5 = 0xffffffffffffffff;
    psVar8 = (short *)plVar4;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001b00(&local_90,plVar4,~uVar5 - 1);
    local_64 = *param_6;
    local_68 = *param_4;
    local_60 = *param_7;
    if (DAT_14031fee0 != 0) {
      FUN_140025010(&local_98);
    }
    if (7 < local_78) {
      operator_delete((void *)CONCAT62(uStack_8e,local_90));
    }
    local_78 = 7;
    local_80 = 0;
    local_90 = 0;
    FUN_1400d1290(lVar7);
  }
  FUN_140070e40(&local_f0);
  return 1;
}



undefined8 FUN_140020f90(longlong param_1)

{
  char *local_28;
  DWORD local_20;
  longlong local_18;
  
  local_28 = "GG_GAME_SERVER_INFO_FAIL_U";
  local_18 = **(longlong **)(*(longlong *)(param_1 + 0x140) + 8) + 0x68;
  local_20 = timeGetTime();
  FUN_140070e40(&local_28);
  return 1;
}



undefined8
FUN_140020fe0(longlong param_1,undefined8 param_2,undefined8 param_3,longlong *param_4,
             undefined8 param_5,undefined2 *param_6,undefined8 param_7,longlong *param_8,
             undefined4 *param_9,longlong *param_10,undefined4 *param_11,undefined4 *param_12,
             short *param_13,undefined8 *param_14,undefined1 *param_15)

{
  undefined *puVar1;
  undefined *puVar2;
  undefined *puVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "GG_REQ_LOGOUT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x140) + 8) + 0x68;
  local_18 = timeGetTime();
  if ((((((*(longlong *)(param_1 + 0x60) != 0) &&
         (puVar1 = (undefined *)*param_4, puVar1 != (undefined *)0x0)) &&
        (puVar1 != PTR_DAT_1402f8008)) &&
       ((0 < *(int *)(puVar1 + -8) && (puVar2 = (undefined *)*param_8, puVar2 != (undefined *)0x0)))
       ) && ((puVar2 != PTR_DAT_1402f8010 &&
             ((0 < *(int *)(puVar2 + -8) &&
              (puVar3 = (undefined *)*param_10, puVar3 != (undefined *)0x0)))))) &&
     ((puVar3 != PTR_DAT_1402f8010 && (0 < *(int *)(puVar3 + -8))))) {
    (**(code **)(**(longlong **)(param_1 + 0x60) + 0x98))
              (*(longlong **)(param_1 + 0x60),0,0,puVar1,param_5,*param_6,param_7,puVar2,*param_9,
               puVar3,*param_11,*param_12,(int)*param_13,*param_14,*param_15);
  }
  FUN_140070e40(&local_20);
  return 1;
}



undefined8 FUN_140021180(longlong param_1,undefined4 param_2,undefined8 param_3,int *param_4)

{
  longlong lVar1;
  int iVar2;
  longlong *plVar3;
  wchar_t *pwVar4;
  longlong lVar5;
  longlong local_res8;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "GG_SERVER_TYPE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x140) + 8) + 0x68;
  local_18 = timeGetTime();
  lVar1 = param_1 + 0xa8;
  FUN_1400a1c30(lVar1);
  plVar3 = (longlong *)FUN_14001fee0(param_1 + -8,&local_res8,param_2);
  lVar5 = 0;
  if ((longlong *)*plVar3 != (longlong *)0x0) {
    lVar5 = *(longlong *)*plVar3;
  }
  if ((local_res8 != 0) &&
     (*(longlong *)(local_res8 + 8) = *(longlong *)(local_res8 + 8) + -1,
     *(longlong *)(local_res8 + 8) == 0)) {
    FUN_1400219e0(local_res8);
  }
  if (lVar5 == 0) {
    FUN_1400d1290(lVar1);
    goto LAB_1400212a4;
  }
  *(int *)(lVar5 + 0x38) = *param_4;
  iVar2 = *param_4;
  if (iVar2 == 1) {
    pwVar4 = L"Server Join [%d] LOBBY";
LAB_14002128b:
    FUN_1401e4980(DAT_140320100,pwVar4,param_2);
  }
  else {
    if (iVar2 == 2) {
      pwVar4 = L"Server Join [%d] DUNGEON";
      goto LAB_14002128b;
    }
    if (iVar2 == 3) {
      pwVar4 = L"Server Join [%d] PVP";
      goto LAB_14002128b;
    }
    if (iVar2 == 4) {
      pwVar4 = L"Server Join [%d] WAR";
      goto LAB_14002128b;
    }
    if (iVar2 == 5) {
      pwVar4 = L"Server Join [%d] GUILD_LOBBY";
      goto LAB_14002128b;
    }
  }
  FUN_1400d1290(lVar1);
LAB_1400212a4:
  FUN_140070e40(&local_20);
  return 1;
}



undefined8
FUN_1400212d0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined4 *param_9)

{
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "GG_REQ_PLAY_TIME_START";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x140) + 8) + 0x68;
  local_18 = timeGetTime();
  if (*(longlong *)(param_1 + 0x60) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x60) + 0xa0))
              (*(longlong **)(param_1 + 0x60),param_4,*param_5,param_6,param_7,*param_8,*param_9);
  }
  FUN_140070e40(&local_20);
  return 1;
}



undefined8
FUN_140021390(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined4 *param_9)

{
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "GG_REQ_PLAY_TIME_END";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x140) + 8) + 0x68;
  local_18 = timeGetTime();
  if (*(longlong *)(param_1 + 0x60) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x60) + 0xa8))
              (*(longlong **)(param_1 + 0x60),0,0,param_4,*param_5,param_6,param_7,*param_8,*param_9
              );
  }
  FUN_140070e40(&local_20);
  return 1;
}



undefined8 FUN_140021460(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "G2G_ALREADY_LOGIN";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x140) + 8) + 0x68;
  local_18 = timeGetTime();
  if (*(longlong *)(param_1 + 0x60) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x60) + 0xb0))(*(longlong **)(param_1 + 0x60),param_4);
  }
  FUN_140070e40(&local_20);
  return 1;
}



undefined8 FUN_1400214e0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "G2G_ALREADY_LOGIN";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x120) + 8) + 0x68;
  local_18 = timeGetTime();
  if (*(longlong *)(param_1 + 0x40) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x40) + 0xb0))(*(longlong **)(param_1 + 0x40),param_4);
  }
  FUN_140070e40(&local_20);
  return 1;
}



uint * FUN_140021560(longlong param_1,uint *param_2)

{
  uint uVar1;
  uint uVar2;
  longlong lVar3;
  ulonglong uVar4;
  char cVar5;
  uint *puVar6;
  
  uVar1 = *param_2;
  uVar2 = *(uint *)(param_1 + 0x28);
  lVar3 = *(longlong *)(param_1 + 8);
  uVar4 = (ulonglong)uVar1 % (ulonglong)uVar2;
  if (lVar3 != 0) {
    for (puVar6 = *(uint **)(lVar3 + uVar4 * 8);
        (puVar6 != (uint *)0x0 && ((uint)uVar4 == puVar6[8] % uVar2));
        puVar6 = *(uint **)(puVar6 + 4)) {
      if (*puVar6 == uVar1) goto LAB_1400215fd;
    }
    if (lVar3 != 0) goto LAB_1400215d9;
  }
  cVar5 = FUN_140021b30(param_1,(ulonglong)uVar2,CONCAT71((int7)((ulonglong)lVar3 >> 8),1));
  if (cVar5 == '\0') {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x8007000e);
  }
LAB_1400215d9:
  FUN_140021c20(param_1);
  puVar6 = (uint *)FUN_140021dd0(param_1,param_2,uVar4,uVar1);
  FUN_140021c20(param_1);
LAB_1400215fd:
  return puVar6 + 2;
}



void FUN_140021620(void)

{
  FUN_140021730();
  return;
}



void FUN_140021640(undefined8 *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  ulonglong uVar3;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < (int)*(uint *)(param_1 + 3)) {
    lVar2 = param_1[2];
    uVar3 = (ulonglong)*(uint *)(param_1 + 3);
    do {
      FUN_14000c2a0(lVar2);
      lVar2 = lVar2 + 8;
      uVar3 = uVar3 - 1;
    } while (uVar3 != 0);
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x0001400216ab. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
      return;
    }
    FUN_1400a3530();
  }
  return;
}



void FUN_1400216c0(longlong *param_1)

{
  if (*param_1 != 0) {
    *(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1;
    if (*(longlong *)(*param_1 + 8) == 0) {
      FUN_1400219e0(*param_1);
    }
  }
  return;
}



void * FUN_140021700(void *param_1,uint param_2)

{
  FUN_140021640();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140021730(longlong param_1)

{
  undefined8 *puVar1;
  void *pvVar2;
  longlong *plVar3;
  uint uVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong lVar7;
  float fVar8;
  float fVar9;
  
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
  FUN_140021c20();
  lVar6 = *(longlong *)(param_1 + 0x10);
  while (lVar6 != 0) {
    lVar7 = *(longlong *)(lVar6 + 0x10);
    if ((*(longlong *)(lVar6 + 8) != 0) &&
       (*(longlong *)(*(longlong *)(lVar6 + 8) + 8) =
             *(longlong *)(*(longlong *)(lVar6 + 8) + 8) + -1,
       *(longlong *)(*(longlong *)(lVar6 + 8) + 8) == 0)) {
      puVar1 = *(undefined8 **)(lVar6 + 8);
      pvVar2 = (void *)*puVar1;
      if (pvVar2 != (void *)0x0) {
        if (7 < *(ulonglong *)((longlong)pvVar2 + 0x28)) {
          operator_delete(*(void **)((longlong)pvVar2 + 0x10));
        }
        *(undefined8 *)((longlong)pvVar2 + 0x28) = 7;
        *(undefined8 *)((longlong)pvVar2 + 0x20) = 0;
        *(undefined2 *)((longlong)pvVar2 + 0x10) = 0;
        operator_delete(pvVar2);
      }
      FUN_1400a3530(puVar1);
    }
    plVar3 = *(longlong **)(param_1 + 0x50);
    if (plVar3 == (longlong *)0x0) {
      FUN_1400a3530(lVar6);
    }
    else {
      (**(code **)(*plVar3 + 0x18))(plVar3,lVar6);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar6 = lVar7;
  }
  FUN_1400a3530(*(undefined8 *)(param_1 + 8));
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  FUN_140021c20(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar4 = FUN_140021d50(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_1400a3530();
      *(undefined8 *)(param_1 + 8) = 0;
    }
    lVar6 = 0;
    *(uint *)(param_1 + 0x28) = uVar4;
    fVar9 = (float)uVar4 * *(float *)(param_1 + 0x34);
    if ((9.223372e+18 < fVar9) && (fVar9 = fVar9 - 9.223372e+18, fVar9 < 9.223372e+18)) {
      lVar6 = -0x8000000000000000;
    }
    fVar8 = (float)uVar4 * *(float *)(param_1 + 0x30);
    lVar7 = 0;
    *(longlong *)(param_1 + 0x38) = (longlong)fVar9 + lVar6;
    if ((9.223372e+18 < fVar8) && (fVar8 = fVar8 - 9.223372e+18, fVar8 < 9.223372e+18)) {
      lVar7 = -0x8000000000000000;
    }
    uVar5 = (longlong)fVar8 + lVar7;
    if ((ulonglong)((longlong)fVar8 + lVar7) < 0x11) {
      uVar5 = 0;
    }
    *(ulonglong *)(param_1 + 0x40) = uVar5;
  }
  FUN_140021c20(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



void FUN_1400218e0(longlong param_1,longlong param_2)

{
  uint uVar1;
  ulonglong uVar2;
  uint uVar3;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  uVar1 = *(uint *)(param_1 + 0x28);
  uVar2 = (ulonglong)*(uint *)(param_2 + 0x20) % (ulonglong)uVar1;
  if (*(longlong *)(param_1 + 0x20) == 1) {
    *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    *(undefined8 *)(param_1 + 0x10) = 0;
    *(undefined8 *)(param_1 + 0x18) = 0;
  }
  else {
    uVar3 = (uint)uVar2;
    if (((*(longlong *)(param_2 + 0x18) == 0) ||
        (*(uint *)(*(longlong *)(param_2 + 0x18) + 0x20) % uVar1 != uVar3)) &&
       ((*(longlong *)(param_2 + 0x10) == 0 ||
        (*(uint *)(*(longlong *)(param_2 + 0x10) + 0x20) % uVar1 != uVar3)))) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    }
    else if (param_2 == *(longlong *)(*(longlong *)(param_1 + 8) + (longlong)(int)uVar3 * 8)) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = *(undefined8 *)(param_2 + 0x10);
    }
    if (param_2 == *(longlong *)(param_1 + 0x10)) {
      *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(param_2 + 0x10);
      *(undefined8 *)(param_2 + 0x18) = 0;
    }
    if (param_2 == *(longlong *)(param_1 + 0x18)) {
      *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
      *(undefined8 *)(param_2 + 0x10) = 0;
    }
    if (*(longlong *)(param_2 + 0x18) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x18) + 0x10) = *(undefined8 *)(param_2 + 0x10);
    }
    if (*(longlong *)(param_2 + 0x10) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x10) + 0x18) = *(undefined8 *)(param_2 + 0x18);
    }
  }
  FUN_140021f20(param_1,param_2);
  FUN_140021c20(param_1);
  return;
}



void FUN_1400219e0(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    if (7 < *(ulonglong *)((longlong)pvVar1 + 0x28)) {
      operator_delete(*(void **)((longlong)pvVar1 + 0x10));
    }
    *(undefined8 *)((longlong)pvVar1 + 0x28) = 7;
    *(undefined8 *)((longlong)pvVar1 + 0x20) = 0;
    *(undefined2 *)((longlong)pvVar1 + 0x10) = 0;
    operator_delete(pvVar1);
  }
  FUN_1400a3530(param_1);
  return;
}



void FUN_140021a40(longlong param_1,int param_2,longlong param_3,int param_4)

{
  undefined4 *puVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  
  lVar8 = (longlong)param_4;
  lVar6 = (longlong)param_2;
  if (((-1 < param_4) && (-1 < param_2)) && (param_2 <= *(int *)(param_1 + 0x18))) {
    iVar4 = *(int *)(param_1 + 0x18);
    FUN_140021fb0(param_1,iVar4 + param_4);
    iVar4 = iVar4 - param_2;
    if ((0 < iVar4) && (iVar4 = iVar4 + -1, lVar5 = (longlong)iVar4, -1 < iVar4)) {
      lVar7 = (lVar8 + lVar6 + lVar5) * 4;
      do {
        lVar2 = FUN_14008c850(param_1);
        lVar3 = FUN_14008c850(param_1);
        *(undefined4 *)(lVar3 + lVar7) = *(undefined4 *)(lVar2 + lVar8 * -4 + lVar7);
        lVar7 = lVar7 + -4;
        lVar5 = lVar5 + -1;
      } while (-1 < lVar5);
    }
    if (0 < param_4) {
      lVar5 = lVar6 * 4;
      do {
        lVar7 = FUN_14008c850(param_1);
        puVar1 = (undefined4 *)(lVar5 + param_3 + lVar6 * -4);
        lVar5 = lVar5 + 4;
        lVar8 = lVar8 + -1;
        *(undefined4 *)(lVar7 + -4 + lVar5) = *puVar1;
      } while (lVar8 != 0);
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



undefined8 FUN_140021b30(longlong param_1,uint param_2,char param_3)

{
  void *_Dst;
  ulonglong uVar1;
  longlong lVar2;
  longlong lVar3;
  size_t _Size;
  float fVar4;
  float fVar5;
  
  if (*(longlong *)(param_1 + 8) != 0) {
    FUN_1400a3530();
    *(undefined8 *)(param_1 + 8) = 0;
  }
  if (param_3 != '\0') {
    _Size = (ulonglong)param_2 << 3;
    _Dst = (void *)FUN_1400a34c0(_Size);
    *(void **)(param_1 + 8) = _Dst;
    if (_Dst == (void *)0x0) {
      return 0;
    }
    memset(_Dst,0,_Size);
  }
  lVar2 = 0;
  *(uint *)(param_1 + 0x28) = param_2;
  fVar4 = (float)param_2;
  fVar5 = fVar4 * *(float *)(param_1 + 0x34);
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar4 = fVar4 * *(float *)(param_1 + 0x30);
  lVar3 = 0;
  *(longlong *)(param_1 + 0x38) = (longlong)fVar5 + lVar2;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  uVar1 = (longlong)fVar4 + lVar3;
  if ((ulonglong)((longlong)fVar4 + lVar3) < 0x11) {
    uVar1 = 0;
  }
  *(ulonglong *)(param_1 + 0x40) = uVar1;
  return CONCAT71((int7)(uVar1 >> 8),1);
}



void FUN_140021c20(char *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  undefined1 local_58 [88];
  
  if (*param_1 != '\0') {
    iVar4 = 0;
    if ((*(longlong *)(param_1 + 0x20) != 0) && (*(longlong *)(param_1 + 8) == 0)) {
      FUN_1400a2320(local_58,L"CFastMap consistency error #0!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    lVar1 = *(longlong *)(param_1 + 0x10);
    lVar3 = lVar1;
    while (lVar3 != 0) {
      lVar2 = *(longlong *)(lVar3 + 0x10);
      if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x18) != lVar3)) {
        FUN_1400a2320(local_58,L"CFastMap consistency error #1!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      if ((lVar3 == lVar1) && (*(longlong *)(lVar3 + 0x18) != 0)) {
        FUN_1400a2320(local_58,L"CFastMap consistency error #2!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      if ((lVar3 == *(longlong *)(param_1 + 0x18)) && (lVar2 != 0)) {
        FUN_1400a2320(local_58,L"CFastMap consistency error #3!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      iVar4 = iVar4 + 1;
      lVar3 = lVar2;
    }
    if (iVar4 != *(int *)(param_1 + 0x20)) {
      for (; lVar1 != 0; lVar1 = *(longlong *)(lVar1 + 0x10)) {
      }
      FUN_1400a2320(local_58,L"CFastMap consistency error #4!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
  }
  return;
}



uint FUN_140021d50(longlong param_1,longlong param_2)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_2;
  if (param_2 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / *(float *)(param_1 + 0x2c);
  lVar2 = 0;
  if ((9.223372e+18 < fVar6) && (fVar6 = fVar6 - 9.223372e+18, fVar6 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  uVar5 = (uint)((longlong)fVar6 + lVar2);
  if (0xffffffff < (ulonglong)((longlong)fVar6 + lVar2)) {
    uVar5 = 0xffffffff;
  }
  iVar4 = 0;
  if (0x11 < uVar5) {
    puVar3 = &DAT_14024ea30;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_14024ea30)[iVar4];
  if ((&DAT_14024ea30)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined4 * FUN_140021dd0(longlong param_1,undefined4 *param_2,uint param_3,undefined4 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined4 uVar3;
  undefined4 *puVar4;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    puVar4 = (undefined4 *)FUN_1400a34c0(0x28);
  }
  else {
    puVar4 = (undefined4 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x28,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar4 != (undefined4 *)0x0) {
    *puVar4 = *param_2;
    *(undefined8 *)(puVar4 + 2) = 0;
    puVar4[8] = param_4;
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8);
  FUN_140021c20(param_1);
  if (*(longlong *)(param_1 + 0x20) == 0) {
    *(undefined4 **)(param_1 + 0x10) = puVar4;
    *(undefined4 **)(param_1 + 0x18) = puVar4;
    *(undefined8 *)(puVar4 + 6) = 0;
    *(undefined8 *)(puVar4 + 4) = 0;
  }
  else {
    FUN_140021c20(param_1);
    FUN_140021c20(param_1);
    if (lVar2 == 0) {
      lVar2 = *(longlong *)(param_1 + 0x10);
      *(undefined8 *)(puVar4 + 6) = 0;
      *(longlong *)(puVar4 + 4) = lVar2;
      if (lVar2 != 0) {
        *(undefined4 **)(lVar2 + 0x18) = puVar4;
      }
      *(undefined4 **)(param_1 + 0x10) = puVar4;
    }
    else {
      if (*(longlong *)(lVar2 + 0x18) == 0) {
        *(undefined4 **)(param_1 + 0x10) = puVar4;
      }
      else {
        *(undefined4 **)(*(longlong *)(lVar2 + 0x18) + 0x10) = puVar4;
      }
      *(undefined8 *)(puVar4 + 6) = *(undefined8 *)(lVar2 + 0x18);
      *(longlong *)(puVar4 + 4) = lVar2;
      *(undefined4 **)(lVar2 + 0x18) = puVar4;
    }
  }
  *(undefined4 **)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8) = puVar4;
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  FUN_140021c20(param_1);
  FUN_140021c20(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_140021d50(param_1);
    FUN_140022100(param_1,uVar3);
  }
  FUN_140021c20(param_1);
  return puVar4;
}



void FUN_140021f20(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if ((*(longlong *)(param_2 + 8) != 0) &&
     (*(longlong *)(*(longlong *)(param_2 + 8) + 8) =
           *(longlong *)(*(longlong *)(param_2 + 8) + 8) + -1,
     *(longlong *)(*(longlong *)(param_2 + 8) + 8) == 0)) {
    FUN_1400219e0(*(undefined8 *)(param_2 + 8));
  }
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x18))(plVar1,param_2);
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    return;
  }
  FUN_1400a3530(param_2);
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
  return;
}



void FUN_140021fb0(longlong param_1,int param_2)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  int iVar4;
  undefined8 uVar5;
  undefined4 *puVar6;
  undefined4 *puVar7;
  int iVar8;
  longlong lVar9;
  undefined1 local_58 [80];
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar4 = FUN_14008c860();
      plVar2 = *(longlong **)(param_1 + 8);
      lVar9 = (longlong)iVar4;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar2 == (longlong *)0x0) {
          uVar5 = FUN_1400a34c0(lVar9 << 2);
          *(undefined8 *)(param_1 + 0x10) = uVar5;
        }
        else {
          uVar5 = (**(code **)(*plVar2 + 8))(plVar2,lVar9 << 2);
          *(undefined8 *)(param_1 + 0x10) = uVar5;
        }
      }
      else {
        lVar3 = *(longlong *)(param_1 + 0x10);
        if (plVar2 == (longlong *)0x0) {
          puVar6 = (undefined4 *)FUN_1400a34c0(lVar9 << 2);
        }
        else {
          puVar6 = (undefined4 *)(**(code **)(*plVar2 + 8))();
        }
        iVar1 = *(int *)(param_1 + 0x18);
        iVar8 = 0;
        if (0 < iVar1) {
          puVar7 = puVar6;
          do {
            if (puVar7 != (undefined4 *)0x0) {
              *puVar7 = *(undefined4 *)((lVar3 - (longlong)puVar6) + (longlong)puVar7);
            }
            iVar8 = iVar8 + 1;
            puVar7 = puVar7 + 1;
          } while (iVar8 < iVar1);
        }
        if (puVar6 == (undefined4 *)0x0) {
          FUN_1400a2320(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
        }
        plVar2 = *(longlong **)(param_1 + 8);
        if (plVar2 == (longlong *)0x0) {
          FUN_1400a3530(lVar3);
        }
        else {
          (**(code **)(*plVar2 + 0x18))(plVar2,lVar3);
        }
        *(undefined4 **)(param_1 + 0x10) = puVar6;
      }
      *(int *)(param_1 + 0x1c) = iVar4;
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_140022100(longlong param_1,uint param_2)

{
  ulonglong uVar1;
  undefined8 uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  void *_Dst;
  longlong lVar5;
  longlong lVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  int iVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  float fVar12;
  float fVar13;
  
  if (param_2 == 0) {
    param_2 = FUN_140021d50();
  }
  if (param_2 != *(uint *)(param_1 + 0x28)) {
    if (*(longlong *)(param_1 + 8) == 0) {
      lVar5 = 0;
      *(uint *)(param_1 + 0x28) = param_2;
      fVar13 = (float)param_2 * *(float *)(param_1 + 0x34);
      if ((9.223372e+18 < fVar13) && (fVar13 = fVar13 - 9.223372e+18, fVar13 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      fVar12 = (float)param_2 * *(float *)(param_1 + 0x30);
      lVar6 = 0;
      *(longlong *)(param_1 + 0x38) = (longlong)fVar13 + lVar5;
      if ((9.223372e+18 < fVar12) && (fVar12 = fVar12 - 9.223372e+18, fVar12 < 9.223372e+18)) {
        lVar6 = -0x8000000000000000;
      }
      *(longlong *)(param_1 + 0x40) = (longlong)fVar12 + lVar6;
      if ((ulonglong)((longlong)fVar12 + lVar6) < 0x11) {
        *(undefined8 *)(param_1 + 0x40) = 0;
        return;
      }
    }
    else {
      _Dst = (void *)FUN_1400a34c0((ulonglong)param_2 << 3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x8007000e);
      }
      memset(_Dst,0,(ulonglong)param_2 << 3);
      uVar7 = 0;
      uVar4 = *(ulonglong *)(param_1 + 0x10);
      uVar10 = uVar7;
      uVar11 = uVar7;
      while (uVar4 != 0) {
        uVar1 = *(ulonglong *)(uVar4 + 0x10);
        uVar3 = (ulonglong)*(uint *)(uVar4 + 0x20) % (ulonglong)param_2;
        lVar5 = *(longlong *)((longlong)_Dst + uVar3 * 8);
        iVar9 = (int)uVar10;
        if (iVar9 == 0) {
          *(undefined8 *)(uVar4 + 0x18) = 0;
          *(undefined8 *)(uVar4 + 0x10) = 0;
          uVar10 = 1;
          uVar7 = uVar4;
          uVar11 = uVar4;
        }
        else if (lVar5 == 0) {
          *(undefined8 *)(uVar4 + 0x18) = 0;
          *(ulonglong *)(uVar4 + 0x10) = uVar7;
          if (uVar7 != 0) {
            *(ulonglong *)(uVar7 + 0x18) = uVar4;
          }
          uVar10 = (ulonglong)(iVar9 + 1);
          uVar7 = uVar4;
        }
        else {
          uVar8 = uVar4;
          if (*(longlong *)(lVar5 + 0x18) != 0) {
            *(ulonglong *)(*(longlong *)(lVar5 + 0x18) + 0x10) = uVar4;
            uVar8 = uVar7;
          }
          uVar2 = *(undefined8 *)(lVar5 + 0x18);
          *(longlong *)(uVar4 + 0x10) = lVar5;
          uVar10 = (ulonglong)(iVar9 + 1);
          *(undefined8 *)(uVar4 + 0x18) = uVar2;
          *(ulonglong *)(lVar5 + 0x18) = uVar4;
          uVar7 = uVar8;
        }
        *(ulonglong *)((longlong)_Dst + uVar3 * 8) = uVar4;
        uVar4 = uVar1;
      }
      FUN_1400a3530(*(undefined8 *)(param_1 + 8));
      *(void **)(param_1 + 8) = _Dst;
      *(uint *)(param_1 + 0x28) = param_2;
      *(ulonglong *)(param_1 + 0x10) = uVar7;
      *(ulonglong *)(param_1 + 0x18) = uVar11;
      FUN_140021c20(param_1);
      lVar5 = 0;
      fVar13 = (float)*(uint *)(param_1 + 0x28) * *(float *)(param_1 + 0x34);
      if ((9.223372e+18 < fVar13) && (fVar13 = fVar13 - 9.223372e+18, fVar13 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      fVar12 = (float)*(uint *)(param_1 + 0x28) * *(float *)(param_1 + 0x30);
      lVar6 = 0;
      *(longlong *)(param_1 + 0x38) = (longlong)fVar13 + lVar5;
      if ((9.223372e+18 < fVar12) && (fVar12 = fVar12 - 9.223372e+18, fVar12 < 9.223372e+18)) {
        lVar6 = -0x8000000000000000;
      }
      *(longlong *)(param_1 + 0x40) = (longlong)fVar12 + lVar6;
      if ((ulonglong)((longlong)fVar12 + lVar6) < 0x11) {
        *(undefined8 *)(param_1 + 0x40) = 0;
      }
    }
  }
  return;
}



void FUN_140022350(longlong param_1)

{
  FUN_14001fae0(param_1 + -8);
  return;
}



void FUN_140022360(longlong param_1)

{
  FUN_14001fae0(param_1 + -0x28);
  return;
}



void * FUN_140022370(void *param_1,uint param_2)

{
  FUN_1400a1f90();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1400223a0(longlong *param_1,longlong *param_2)

{
  undefined *puVar1;
  undefined8 uVar2;
  
  puVar1 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar1 = PTR_DAT_1402f8008;
  }
  *param_1 = (longlong)puVar1;
  if ((undefined *)*param_2 != puVar1) {
    uVar2 = FUN_1400a3440();
    FUN_1400a1c30(uVar2);
    FUN_14000c2a0(param_1);
    puVar1 = (undefined *)*param_2;
    *param_1 = (longlong)puVar1;
    if (((puVar1 != PTR_DAT_1402f8008) && (puVar1 != (undefined *)0x0)) &&
       (puVar1 != (undefined *)0x8)) {
      *(int *)(puVar1 + -4) = *(int *)(puVar1 + -4) + 1;
    }
    FUN_1400d1290(uVar2);
  }
  return;
}



exception *
FUN_140022440(exception *param_1,exception *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  std::exception::exception(param_1,param_2);
  *(undefined ***)param_1 = Proud::Exception::vftable;
  *(undefined4 *)(param_1 + 0x18) = *(undefined4 *)(param_2 + 0x18);
  *(undefined8 *)(param_1 + 0x20) = *(undefined8 *)(param_2 + 0x20);
  *(undefined8 *)(param_1 + 0x28) = *(undefined8 *)(param_2 + 0x28);
  *(undefined8 *)(param_1 + 0x30) = *(undefined8 *)(param_2 + 0x30);
  *(undefined4 *)(param_1 + 0x38) = *(undefined4 *)(param_2 + 0x38);
  FUN_1400a3440();
  *(undefined **)(param_1 + 0x40) = PTR_DAT_1402f8008;
  FUN_1400223a0(param_1 + 0x40,param_2 + 0x40,param_3,param_4,uVar1);
  return param_1;
}



void FUN_1400224d0(undefined8 *param_1,undefined8 *param_2,size_t param_3)

{
  undefined1 uVar1;
  undefined8 uVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  
  if (param_3 < 0x21) {
    uVar5 = (ulonglong)((uint)param_3 & 7);
    for (uVar4 = param_3 >> 3; uVar4 != 0; uVar4 = uVar4 - 1) {
      uVar2 = *param_2;
      param_2 = param_2 + 1;
      *param_1 = uVar2;
      param_1 = param_1 + 1;
    }
    if (uVar5 != 0) {
      puVar3 = param_2;
      do {
        uVar1 = *(undefined1 *)puVar3;
        puVar3 = (undefined8 *)((longlong)puVar3 + 1);
        uVar5 = uVar5 - 1;
        *(undefined1 *)((longlong)param_1 + (-1 - (longlong)param_2) + (longlong)puVar3) = uVar1;
      } while (uVar5 != 0);
      return;
    }
  }
  else {
    memcpy(param_1,param_2,param_3);
  }
  return;
}



undefined8 * FUN_140022530(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140022590(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x0001400225b7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



undefined8 * FUN_1400225d0(undefined8 *param_1)

{
  undefined8 *puVar1;
  
  FUN_140001f70();
  FUN_14018a120(param_1 + 9);
  param_1[9] = RNP::Gate2GateStub::vftable;
  FUN_14018a120(param_1 + 0xd);
  *param_1 = MGGate2GateSession::vftable;
  param_1[9] = MGGate2GateSession::vftable;
  param_1[0xd] = MGGate2GateSession::vftable;
  puVar1 = param_1 + 0x11;
  FUN_140186ea0(puVar1);
  *puVar1 = G2G_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x9c) != 1) {
    FUN_1400a2b50(PTR_u_PIDL_compiler_is_incompatible_to_14030bd40);
  }
  *puVar1 = RNP::Gate2GateProxy::vftable;
  *(undefined1 *)(param_1 + 0x14) = 0;
  return param_1;
}



void * FUN_140022690(void *param_1,uint param_2)

{
  FUN_1400226c0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1400226c0(undefined8 *param_1)

{
  *param_1 = MGGate2GateSession::vftable;
  param_1[9] = MGGate2GateSession::vftable;
  param_1[0xd] = MGGate2GateSession::vftable;
  param_1[0x11] = RNP::Gate2GateProxy::vftable;
  FUN_140186ed0();
  param_1[0xd] = RNP::GateLobbyStub::vftable;
  FUN_14018a150(param_1 + 0xd);
  param_1[9] = RNP::Gate2GateStub::vftable;
  FUN_14018a150(param_1 + 9);
  *param_1 = MagiCommonSession::vftable;
  FUN_1400031d0(param_1 + 6);
  *param_1 = Proud::INetClientEvent::vftable;
  FUN_140140b40(param_1);
  return;
}



void FUN_140022780(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined *puVar4;
  undefined *local_res18 [2];
  
  plVar2 = (longlong *)FUN_1401417c0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1402f8010;
  }
  FUN_140026050(L"OnError MGGate2GateSession : %s",puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1402f8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res18[0] + -8);
    }
    FUN_1400d1290(uVar3);
  }
  return;
}



void FUN_140022820(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined *puVar4;
  undefined *local_res18 [2];
  
  plVar2 = (longlong *)FUN_1401417c0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1402f8010;
  }
  FUN_140026050(L"OnWarning MGGate2GateSession : %s",puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1402f8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res18[0] + -8);
    }
    FUN_1400d1290(uVar3);
  }
  return;
}



void FUN_1400228c0(undefined8 param_1,longlong *param_2)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(*param_2 + 8))(param_2);
  FUN_140025f00("OnException MGGate2GateSession : %s",uVar1);
  return;
}



void FUN_1400228e0(longlong param_1,int *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined4 uVar2;
  undefined8 *puVar3;
  undefined8 uVar4;
  undefined *local_res8;
  
  *(undefined1 *)(param_1 + 0x19) = 0;
  uVar4 = DAT_140320100;
  if (*param_2 == 0) {
    if (*(longlong **)(param_1 + 0x10) != (longlong *)0x0) {
      uVar2 = (**(code **)(**(longlong **)(param_1 + 0x10) + 0x30))();
      FUN_1401e4980(uVar4,L"Gate2Gate Server Connected : HostID[%d]",uVar2);
    }
    *(undefined2 *)(param_1 + 0x1a) = 1;
    *(undefined1 *)(param_1 + 0x1c) = 0;
  }
  else {
    *(undefined1 *)(param_1 + 0x1b) = 1;
    puVar3 = (undefined8 *)FUN_1401417c0(param_2,&local_res8,param_3,param_4,0xfffffffffffffffe);
    FUN_1401e4980(DAT_140320100,L"Gate2Gate Server Connect Failed [%s]",*puVar3);
    if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1402f8010)) &&
       (local_res8 + -8 != (undefined *)0x0)) {
      uVar4 = FUN_1400a3440();
      FUN_1400a1c30(uVar4);
      piVar1 = (int *)(local_res8 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(local_res8 + -8);
      }
      FUN_1400d1290(uVar4);
    }
  }
  return;
}



void FUN_1400229c0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  undefined *local_res8;
  
  puVar2 = (undefined8 *)FUN_1401417c0(param_2,&local_res8,param_3,param_4,0xfffffffffffffffe);
  FUN_1401e4980(DAT_140320100,L"Gate2Gate LeaveServer %s",*puVar2);
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1402f8010)) &&
     (local_res8 + -8 != (undefined *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(local_res8 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res8 + -8);
    }
    FUN_1400d1290(uVar3);
  }
  *(undefined2 *)(param_1 + 0x1a) = 0x100;
  *(undefined1 *)(param_1 + 0x19) = 0;
  return;
}



void FUN_140022a70(ulonglong *param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined *local_res18;
  longlong local_res20;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  local_res18 = operator_new(0xa8);
  if (local_res18 == (undefined *)0x0) {
    lVar3 = 0;
  }
  else {
    lVar3 = FUN_1400225d0(local_res18);
  }
  if (lVar3 != 0) {
    *(undefined4 *)(lVar3 + 0x40) = 8;
    *(undefined1 *)(lVar3 + 0x18) = *(undefined1 *)(DAT_140320118 + 0x11);
    local_res20 = lVar3;
    plVar4 = (longlong *)FUN_140184d20();
    *(longlong **)(lVar3 + 0x10) = plVar4;
    if (plVar4 != (longlong *)0x0) {
      (**(code **)(*plVar4 + 0x118))(plVar4,lVar3,*plVar4,param_4,uVar5);
      (**(code **)(**(longlong **)(lVar3 + 0x10) + 0x10))(*(longlong **)(lVar3 + 0x10),lVar3 + 0x48)
      ;
      (**(code **)(**(longlong **)(lVar3 + 0x10) + 0x10))(*(longlong **)(lVar3 + 0x10),lVar3 + 0x68)
      ;
      (**(code **)(**(longlong **)(lVar3 + 0x10) + 8))(*(longlong **)(lVar3 + 0x10),lVar3 + 0x88);
    }
    plVar4 = (longlong *)(param_2 + 0xc);
    if (7 < *(ulonglong *)(param_2 + 0x12)) {
      plVar4 = (longlong *)*plVar4;
    }
    FUN_1400a3440();
    local_res18 = PTR_DAT_1402f8010;
    uVar2 = FUN_1400a32c0(plVar4);
    uVar5 = FUN_140002f20(&local_res18,uVar2);
    FUN_1400a32f0(uVar5,plVar4,uVar2);
    FUN_140003000(&local_res18);
    FUN_140003100(lVar3 + 0x30,&local_res18);
    FUN_1400031d0(&local_res18);
    *(undefined2 *)(lVar3 + 0x38) = *(undefined2 *)(param_2 + 1);
    *(undefined4 *)(lVar3 + 0x3c) = *param_2;
    plVar4 = (longlong *)param_1[1];
    if ((&local_res20 < plVar4) && (plVar1 = (longlong *)*param_1, plVar1 <= &local_res20)) {
      if (plVar4 == (longlong *)param_1[2]) {
        FUN_14000b000(param_1);
      }
      if ((undefined8 *)param_1[1] != (undefined8 *)0x0) {
        *(undefined8 *)param_1[1] =
             *(undefined8 *)(*param_1 + ((longlong)&local_res20 - (longlong)plVar1 >> 3) * 8);
      }
    }
    else {
      if (plVar4 == (longlong *)param_1[2]) {
        FUN_14000b000(param_1);
      }
      if ((longlong *)param_1[1] != (longlong *)0x0) {
        *(longlong *)param_1[1] = lVar3;
      }
    }
    param_1[1] = param_1[1] + 8;
    return;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140022c30(longlong *param_1)

{
  int *piVar1;
  char cVar2;
  undefined *puVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  longlong lVar6;
  undefined *puVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  undefined1 auStack_e8 [32];
  undefined8 local_c8;
  undefined1 local_c0;
  undefined8 local_b8;
  undefined1 local_b0;
  undefined8 local_a8;
  undefined1 local_a0;
  undefined8 local_98;
  undefined *local_88;
  undefined2 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined1 local_68 [48];
  ulonglong local_38;
  
  local_98 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_e8;
  uVar8 = 0;
  lVar6 = *param_1;
  uVar9 = uVar8;
  if (param_1[1] - lVar6 >> 3 != 0) {
    do {
      lVar6 = *(longlong *)(uVar8 + lVar6);
      if (((((lVar6 != 0) && (puVar3 = *(undefined **)(lVar6 + 0x30), puVar3 != (undefined *)0x0))
           && (puVar3 != PTR_DAT_1402f8010)) &&
          ((0 < *(int *)(puVar3 + -8) && (*(char *)(lVar6 + 0x18) != '\0')))) &&
         ((*(char *)(lVar6 + 0x19) == '\0' &&
          ((*(char *)(lVar6 + 0x1a) == '\0' && (*(longlong *)(lVar6 + 0x10) != 0)))))) {
        *(undefined2 *)(lVar6 + 0x19) = 1;
        FUN_140140b80(&local_88);
        local_7c = DAT_140320030;
        local_78 = DAT_140320034;
        local_74 = DAT_140320038;
        local_70 = DAT_14032003c;
        if (local_88 == (undefined *)0x0) {
          local_88 = PTR_DAT_1402f8010;
        }
        if (*(undefined **)(lVar6 + 0x30) != local_88) {
          uVar4 = FUN_1400a3440();
          local_c8 = uVar4;
          FUN_1400a1c30(uVar4);
          puVar3 = local_88;
          local_c0 = 1;
          if (((local_88 != (undefined *)0x0) && (local_88 != PTR_DAT_1402f8010)) &&
             (puVar7 = local_88 + -8, puVar7 != (undefined *)0x0)) {
            uVar5 = FUN_1400a3440();
            local_a8 = uVar5;
            FUN_1400a1c30(uVar5);
            local_a0 = 1;
            piVar1 = (int *)(puVar3 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(puVar7);
            }
            FUN_1400d1290(uVar5);
            local_a0 = 0;
          }
          local_88 = *(undefined **)(lVar6 + 0x30);
          if (((local_88 != PTR_DAT_1402f8010) && (local_88 != (undefined *)0x0)) &&
             (local_88 != (undefined *)0x8)) {
            *(int *)(local_88 + -4) = *(int *)(local_88 + -4) + 1;
          }
          FUN_1400d1290(uVar4);
          local_c0 = 0;
        }
        local_80 = *(undefined2 *)(lVar6 + 0x38);
        (**(code **)(**(longlong **)(lVar6 + 0x10) + 0x88))();
        (**(code **)(**(longlong **)(lVar6 + 0x10) + 0x78))(*(longlong **)(lVar6 + 0x10),&local_88);
        cVar2 = *(char *)(lVar6 + 0x19);
        while (cVar2 != '\0') {
          Sleep(10);
          (**(code **)(**(longlong **)(lVar6 + 0x10) + 0x98))(*(longlong **)(lVar6 + 0x10),0);
          cVar2 = *(char *)(lVar6 + 0x19);
        }
        FUN_140140df0(local_68);
        puVar3 = local_88;
        if (((local_88 != (undefined *)0x0) && (local_88 != PTR_DAT_1402f8010)) &&
           (puVar7 = local_88 + -8, puVar7 != (undefined *)0x0)) {
          uVar4 = FUN_1400a3440();
          local_b8 = uVar4;
          FUN_1400a1c30(uVar4);
          local_b0 = 1;
          piVar1 = (int *)(puVar3 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(puVar7);
          }
          FUN_1400d1290(uVar4);
          local_b0 = 0;
        }
      }
      uVar9 = (ulonglong)((int)uVar9 + 1);
      uVar8 = uVar8 + 8;
      lVar6 = *param_1;
    } while (uVar9 < (ulonglong)(param_1[1] - lVar6 >> 3));
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140022ec0(longlong *param_1,double param_2)

{
  undefined *puVar1;
  longlong *plVar2;
  longlong lVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  double dVar6;
  undefined1 auStack_88 [32];
  undefined8 local_68;
  undefined2 local_60;
  undefined6 uStack_5e;
  undefined8 local_50;
  ulonglong local_48;
  ulonglong local_38;
  
  local_68 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  uVar4 = 0;
  lVar3 = *param_1;
  uVar5 = uVar4;
  if (param_1[1] - lVar3 >> 3 != 0) {
    do {
      lVar3 = *(longlong *)(uVar5 + lVar3);
      if ((((lVar3 != 0) && (puVar1 = *(undefined **)(lVar3 + 0x30), puVar1 != (undefined *)0x0)) &&
          (puVar1 != PTR_DAT_1402f8010)) && (0 < *(int *)(puVar1 + -8))) {
        if (*(char *)(lVar3 + 0x18) == '\0') {
          if (*(char *)(lVar3 + 0x1a) != '\0') {
            plVar2 = *(longlong **)(lVar3 + 0x10);
            if (plVar2 != (longlong *)0x0) {
              (**(code **)(*plVar2 + 0x98))(plVar2,0);
            }
            Sleep(100);
          }
        }
        else if (*(char *)(lVar3 + 0x1b) == '\0') {
          if ((*(char *)(lVar3 + 0x1a) != '\0') &&
             (plVar2 = *(longlong **)(lVar3 + 0x10), plVar2 != (longlong *)0x0)) {
            (**(code **)(*plVar2 + 0x98))(plVar2,0);
          }
        }
        else {
          dVar6 = param_2 - *(double *)(lVar3 + 0x20);
          if ((*(double *)(lVar3 + 0x28) <= dVar6 && dVar6 != *(double *)(lVar3 + 0x28)) &&
             (*(double *)(lVar3 + 0x20) = param_2, *(char *)(lVar3 + 0x1c) != '\0')) {
            local_48 = 7;
            local_50 = 0;
            local_60 = 0;
            FUN_140002890(lVar3,&local_60);
            wprintf(L"%s : RETRY CONNECT : ADDRESS[ %s ] PORT[ %d ]\n");
            FUN_1400020e0(lVar3);
            if (7 < local_48) {
              operator_delete((void *)CONCAT62(uStack_5e,local_60));
            }
          }
        }
      }
      uVar4 = (ulonglong)((int)uVar4 + 1);
      lVar3 = *param_1;
      uVar5 = uVar5 + 8;
    } while (uVar4 < (ulonglong)(param_1[1] - lVar3 >> 3));
  }
  return;
}



void FUN_140023090(longlong *param_1,undefined8 param_2)

{
  ulonglong uVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  lVar3 = *param_1;
  uVar1 = 0;
  uVar2 = uVar1;
  if (param_1[1] - lVar3 >> 3 != 0) {
    do {
      lVar3 = *(longlong *)(uVar1 + lVar3);
      if ((lVar3 != 0) && (*(char *)(lVar3 + 0x1a) != '\0')) {
        (**(code **)(*(longlong *)(lVar3 + 0x88) + 0x30))
                  ((longlong *)(lVar3 + 0x88),1,&DAT_14030ab90,param_2);
      }
      lVar3 = *param_1;
      uVar2 = (ulonglong)((int)uVar2 + 1);
      uVar1 = uVar1 + 8;
    } while (uVar2 < (ulonglong)(param_1[1] - lVar3 >> 3));
  }
  return;
}



void FUN_140023120(longlong param_1)

{
  FUN_140022690(param_1 + -0x48);
  return;
}



void FUN_140023130(longlong param_1)

{
  FUN_140022690(param_1 + -0x68);
  return;
}



undefined8 * FUN_140023140(undefined8 *param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  
  FUN_140001f70();
  FUN_14018a120(param_1 + 9);
  *param_1 = MGDBCGateSession::vftable;
  param_1[9] = MGDBCGateSession::vftable;
  puVar1 = param_1 + 0xd;
  FUN_140186ea0(puVar1);
  *puVar1 = SERVERS2DBC_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x7c) != 1) {
    FUN_1400a2b50(PTR_u_PIDL_compiler_is_incompatible_to_14030bd40);
  }
  *puVar1 = RNP::Servers2DbcProxy::vftable;
  *(undefined1 *)(param_1 + 0x10) = 0;
  param_1[0x11] = param_2;
  param_1[0x12] = 0;
  return param_1;
}



void * FUN_1400231f0(void *param_1,uint param_2)

{
  FUN_140023220();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140023220(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  *param_1 = MGDBCGateSession::vftable;
  param_1[9] = MGDBCGateSession::vftable;
  if ((longlong *)param_1[2] != (longlong *)0x0) {
    (**(code **)(*(longlong *)param_1[2] + 0x88))();
  }
  puVar1 = (undefined8 *)param_1[2];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,uVar2);
  }
  param_1[2] = 0;
  *(undefined2 *)((longlong)param_1 + 0x19) = 0;
  *(undefined1 *)((longlong)param_1 + 0x1b) = 1;
  param_1[0x12] = 0;
  param_1[0xd] = RNP::Servers2DbcProxy::vftable;
  FUN_140186ed0();
  param_1[9] = RNP::Dbc2ServersStub::vftable;
  FUN_14018a150(param_1 + 9);
  *param_1 = MagiCommonSession::vftable;
  FUN_1400031d0(param_1 + 6);
  *param_1 = Proud::INetClientEvent::vftable;
  FUN_140140b40(param_1);
  return;
}



void FUN_1400232f0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined *puVar4;
  undefined *local_res18 [2];
  
  plVar2 = (longlong *)FUN_1401417c0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1402f8010;
  }
  FUN_140026050(L"OnError MGDBCGateSession : %s",puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1402f8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res18[0] + -8);
    }
    FUN_1400d1290(uVar3);
  }
  return;
}



void FUN_140023390(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined *puVar4;
  undefined *local_res18 [2];
  
  plVar2 = (longlong *)FUN_1401417c0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1402f8010;
  }
  FUN_140026050(L"OnWarning MGDBCGateSession : %s",puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1402f8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res18[0] + -8);
    }
    FUN_1400d1290(uVar3);
  }
  return;
}



void FUN_140023430(undefined8 param_1,longlong *param_2)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(*param_2 + 8))(param_2);
  FUN_140025f00("OnException MGDBCGateSession : %s",uVar1);
  return;
}



void FUN_140023450(longlong param_1,uint param_2)

{
  longlong *plVar1;
  undefined1 uVar2;
  
  param_2 = param_2 & 0xff;
  *(undefined1 *)(param_1 + 0x1c) = 1;
  *(uint *)(param_1 + 0x40) = param_2;
  if (param_2 == 0xc) {
    uVar2 = *(undefined1 *)(DAT_140320118 + 8);
  }
  else if (param_2 == 0x11) {
    uVar2 = *(undefined1 *)(DAT_140320118 + 9);
  }
  else if (param_2 == 0x12) {
    uVar2 = *(undefined1 *)(DAT_140320118 + 10);
  }
  else {
    if (param_2 != 0x13) goto LAB_1400234b0;
    uVar2 = *(undefined1 *)(DAT_140320118 + 0xb);
  }
  *(undefined1 *)(param_1 + 0x18) = uVar2;
LAB_1400234b0:
  plVar1 = (longlong *)FUN_140184d20();
  *(longlong **)(param_1 + 0x10) = plVar1;
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x118))(plVar1,param_1);
    (**(code **)(**(longlong **)(param_1 + 0x10) + 0x10))
              (*(longlong **)(param_1 + 0x10),param_1 + 0x48);
    (**(code **)(**(longlong **)(param_1 + 0x10) + 8))
              (*(longlong **)(param_1 + 0x10),param_1 + 0x68);
  }
  return;
}



void FUN_1400234f0(longlong param_1,int *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined4 uVar2;
  undefined8 *puVar3;
  undefined8 uVar4;
  undefined *local_res8;
  
  *(undefined1 *)(param_1 + 0x19) = 0;
  if (*param_2 == 0) {
    *(undefined2 *)(param_1 + 0x1a) = 1;
    uVar4 = DAT_140320100;
    if (*(longlong **)(param_1 + 0x10) != (longlong *)0x0) {
      uVar2 = (**(code **)(**(longlong **)(param_1 + 0x10) + 0x30))();
      FUN_1401e4980(uVar4,L"DBC Server Connected : HostID[%d]",uVar2);
    }
  }
  else {
    *(undefined1 *)(param_1 + 0x1b) = 1;
    puVar3 = (undefined8 *)FUN_1401417c0(param_2,&local_res8,param_3,param_4,0xfffffffffffffffe);
    FUN_1401e4980(DAT_140320100,L"DBC Server Connect Failed %s",*puVar3);
    if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1402f8010)) &&
       (local_res8 + -8 != (undefined *)0x0)) {
      uVar4 = FUN_1400a3440();
      FUN_1400a1c30(uVar4);
      piVar1 = (int *)(local_res8 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(local_res8 + -8);
      }
      FUN_1400d1290(uVar4);
    }
  }
  return;
}



void FUN_1400235d0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  undefined *local_res8;
  
  puVar2 = (undefined8 *)FUN_1401417c0(param_2,&local_res8,param_3,param_4,0xfffffffffffffffe);
  FUN_1401e4980(DAT_140320100,L"DBC Server Disconnected %s",*puVar2);
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1402f8010)) &&
     (local_res8 + -8 != (undefined *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(local_res8 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res8 + -8);
    }
    FUN_1400d1290(uVar3);
  }
  *(undefined2 *)(param_1 + 0x19) = 0;
  *(undefined1 *)(param_1 + 0x1b) = 1;
  return;
}



undefined8
FUN_140023680(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5)

{
  longlong lVar1;
  undefined4 local_res8 [8];
  
  lVar1 = *(longlong *)(param_1 + 0x40);
  if (lVar1 != 0) {
    local_res8[0] = *param_5;
    (**(code **)(*(longlong *)(lVar1 + 0x60) + 0x100))
              (lVar1 + 0x60,*param_4,&DAT_14030ab90,local_res8);
  }
  return 1;
}



undefined8
FUN_1400236c0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
             longlong *param_5)

{
  undefined *puVar1;
  
  if (*(longlong *)(param_1 + 0x40) != 0) {
    puVar1 = (undefined *)*param_5;
    if ((undefined *)*param_5 == (undefined *)0x0) {
      puVar1 = PTR_DAT_1402f8008;
    }
    FUN_14001a090(*(longlong *)(param_1 + 0x40),*param_4,puVar1);
  }
  return 1;
}



undefined8
FUN_1400236f0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined1 *param_6,undefined2 *param_7,undefined1 *param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11)

{
  if (*(longlong *)(param_1 + 0x40) != 0) {
    FUN_14001a580(*(longlong *)(param_1 + 0x40),*param_4,param_5,*param_6,*param_7,*param_8,*param_9
                  ,*param_10,*param_11);
  }
  return 1;
}



undefined8 FUN_140023770(longlong param_1,undefined8 param_2,undefined8 param_3,short *param_4)

{
  undefined1 auVar1 [16];
  ulonglong uVar2;
  __uint64 _Var3;
  
  if (*(longlong *)(param_1 + 0x40) != 0) {
    uVar2 = (ulonglong)*param_4;
    if (DAT_14031fec8 == (void *)0x0) {
      DAT_14031feb4 = (int)*param_4;
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar2;
      _Var3 = SUB168(ZEXT816(4) * auVar1,0);
      if (SUB168(ZEXT816(4) * auVar1,8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      DAT_14031fec8 = operator_new(_Var3);
      if (0 < (longlong)uVar2) {
        memset(DAT_14031fec8,0,uVar2 << 2);
      }
      return 1;
    }
  }
  return 1;
}



undefined8 FUN_1400237f0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  undefined8 uVar2;
  undefined4 extraout_var;
  undefined1 local_28 [32];
  
  if (*(longlong *)(param_1 + 0x40) != 0) {
    uVar2 = FUN_140024400(local_28,param_4);
    FUN_14001b110(*(undefined8 *)(param_1 + 0x40),uVar2);
  }
  iVar1 = printf("WORLD_SERVER_LIST Count : %d\n");
  return CONCAT71((int7)(CONCAT44(extraout_var,iVar1) >> 8),1);
}



void FUN_140023860(undefined8 *param_1,uint param_2,undefined1 param_3)

{
  void **ppvVar1;
  void **ppvVar2;
  undefined1 auVar3 [16];
  __uint64 _Var4;
  void *pvVar5;
  ulonglong uVar6;
  void *local_res20;
  
  auVar3._8_8_ = 0;
  auVar3._0_8_ = (longlong)(int)param_2;
  _Var4 = SUB168(ZEXT816(4) * auVar3,0);
  if (SUB168(ZEXT816(4) * auVar3,8) != 0) {
    _Var4 = 0xffffffffffffffff;
  }
  DAT_14031fed8 = param_2;
  DAT_14031fed0 = operator_new(_Var4);
  if (0 < (int)param_2) {
    memset(DAT_14031fed0,0,(longlong)(int)param_2 << 2);
    if (0 < (int)param_2) {
      uVar6 = (ulonglong)param_2;
      do {
        local_res20 = operator_new(0x98);
        if (local_res20 == (void *)0x0) {
          pvVar5 = (void *)0x0;
        }
        else {
          pvVar5 = (void *)FUN_140023140(local_res20,*param_1);
        }
        local_res20 = pvVar5;
        if (pvVar5 != (void *)0x0) {
          FUN_140023450(pvVar5,param_3);
          ppvVar1 = (void **)param_1[2];
          if (&local_res20 < ppvVar1) {
            ppvVar2 = (void **)param_1[1];
            if (&local_res20 < ppvVar2) goto LAB_14002395d;
            if (ppvVar1 == (void **)param_1[3]) {
              FUN_14000b000(param_1 + 1);
            }
            if ((undefined8 *)param_1[2] != (undefined8 *)0x0) {
              *(undefined8 *)param_1[2] =
                   *(undefined8 *)
                    (param_1[1] + ((longlong)&local_res20 - (longlong)ppvVar2 >> 3) * 8);
            }
          }
          else {
LAB_14002395d:
            if (ppvVar1 == (void **)param_1[3]) {
              FUN_14000b000(param_1 + 1);
            }
            if ((longlong *)param_1[2] != (longlong *)0x0) {
              *(longlong *)param_1[2] = (longlong)pvVar5;
            }
          }
          param_1[2] = param_1[2] + 8;
        }
        uVar6 = uVar6 - 1;
      } while (uVar6 != 0);
    }
  }
  return;
}



void FUN_1400239a0(longlong param_1)

{
  undefined8 *puVar1;
  void *_Dst;
  int iVar2;
  int iVar3;
  longlong lVar4;
  
  iVar3 = 0;
  if (0 < DAT_14031fed8) {
    lVar4 = 0;
    iVar2 = DAT_14031fed8;
    do {
      puVar1 = *(undefined8 **)(lVar4 + *(longlong *)(param_1 + 8));
      if (puVar1 != (undefined8 *)0x0) {
        (**(code **)*puVar1)(puVar1,1);
        iVar2 = DAT_14031fed8;
      }
      iVar3 = iVar3 + 1;
      lVar4 = lVar4 + 8;
    } while (iVar3 < iVar2);
  }
  _Dst = *(void **)(param_1 + 8);
  if (_Dst != *(void **)(param_1 + 0x10)) {
    memmove(_Dst,*(void **)(param_1 + 0x10),0);
    *(void **)(param_1 + 0x10) = _Dst;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140023a30(longlong param_1,double param_2)

{
  longlong lVar1;
  undefined *puVar2;
  longlong *plVar3;
  uint uVar4;
  ulonglong uVar6;
  double dVar7;
  undefined1 auStack_88 [32];
  undefined8 local_68;
  undefined2 local_60;
  undefined6 uStack_5e;
  undefined8 local_50;
  ulonglong local_48;
  ulonglong local_38;
  ulonglong uVar5;
  
  local_68 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  uVar5 = 0;
  uVar6 = uVar5;
  if (0 < DAT_14031fed8) {
    do {
      if (*(longlong *)(*(longlong *)(param_1 + 8) + uVar6) != 0) {
        lVar1 = *(longlong *)(*(longlong *)(param_1 + 8) + uVar6);
        puVar2 = *(undefined **)(lVar1 + 0x30);
        if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8010)) &&
           (0 < *(int *)(puVar2 + -8))) {
          if (*(char *)(lVar1 + 0x18) == '\0') {
            if (*(char *)(lVar1 + 0x1a) != '\0') {
              if (*(longlong **)(lVar1 + 0x10) != (longlong *)0x0) {
                (**(code **)(**(longlong **)(lVar1 + 0x10) + 0x98))();
              }
              Sleep(100);
            }
          }
          else if (*(char *)(lVar1 + 0x1b) == '\0') {
            if ((*(char *)(lVar1 + 0x1a) != '\0') &&
               (plVar3 = *(longlong **)(lVar1 + 0x10), plVar3 != (longlong *)0x0)) {
              (**(code **)(*plVar3 + 0x98))(plVar3,0);
            }
          }
          else {
            dVar7 = param_2 - *(double *)(lVar1 + 0x20);
            if ((*(double *)(lVar1 + 0x28) <= dVar7 && dVar7 != *(double *)(lVar1 + 0x28)) &&
               (*(double *)(lVar1 + 0x20) = param_2, *(char *)(lVar1 + 0x1c) != '\0')) {
              local_48 = 7;
              local_50 = 0;
              local_60 = 0;
              FUN_140002890(lVar1,&local_60);
              wprintf(L"%s : RETRY CONNECT : ADDRESS[ %s ] PORT[ %d ]\n");
              FUN_1400020e0(lVar1);
              if (7 < local_48) {
                operator_delete((void *)CONCAT62(uStack_5e,local_60));
              }
            }
          }
        }
      }
      uVar4 = (int)uVar5 + 1;
      uVar5 = (ulonglong)uVar4;
      uVar6 = uVar6 + 8;
    } while ((int)uVar4 < DAT_14031fed8);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140023be0(longlong param_1)

{
  int *piVar1;
  char cVar2;
  longlong lVar3;
  undefined *puVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined *puVar7;
  longlong lVar8;
  int iVar9;
  undefined1 auStack_e8 [32];
  undefined8 local_c8;
  undefined1 local_c0;
  undefined8 local_b8;
  undefined1 local_b0;
  undefined8 local_a8;
  undefined1 local_a0;
  undefined8 local_98;
  undefined *local_88;
  undefined2 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined1 local_68 [48];
  ulonglong local_38;
  
  local_98 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_e8;
  iVar9 = 0;
  if (0 < DAT_14031fed8) {
    lVar8 = 0;
    do {
      if (*(longlong *)(*(longlong *)(param_1 + 8) + lVar8) != 0) {
        lVar3 = *(longlong *)(*(longlong *)(param_1 + 8) + lVar8);
        puVar4 = *(undefined **)(lVar3 + 0x30);
        if ((((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1402f8010)) &&
            (0 < *(int *)(puVar4 + -8))) &&
           (((*(char *)(lVar3 + 0x18) != '\0' && (*(char *)(lVar3 + 0x19) == '\0')) &&
            ((*(char *)(lVar3 + 0x1a) == '\0' && (*(longlong *)(lVar3 + 0x10) != 0)))))) {
          *(undefined2 *)(lVar3 + 0x19) = 1;
          FUN_140140b80(&local_88);
          local_7c = DAT_140320030;
          local_78 = DAT_140320034;
          local_74 = DAT_140320038;
          local_70 = DAT_14032003c;
          if (local_88 == (undefined *)0x0) {
            local_88 = PTR_DAT_1402f8010;
          }
          if (*(undefined **)(lVar3 + 0x30) != local_88) {
            uVar5 = FUN_1400a3440();
            local_c8 = uVar5;
            FUN_1400a1c30(uVar5);
            puVar4 = local_88;
            local_c0 = 1;
            if (((local_88 != (undefined *)0x0) && (local_88 != PTR_DAT_1402f8010)) &&
               (puVar7 = local_88 + -8, puVar7 != (undefined *)0x0)) {
              uVar6 = FUN_1400a3440();
              local_a8 = uVar6;
              FUN_1400a1c30(uVar6);
              local_a0 = 1;
              piVar1 = (int *)(puVar4 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(puVar7);
              }
              FUN_1400d1290(uVar6);
              local_a0 = 0;
            }
            local_88 = *(undefined **)(lVar3 + 0x30);
            if (((local_88 != PTR_DAT_1402f8010) && (local_88 != (undefined *)0x0)) &&
               (local_88 != (undefined *)0x8)) {
              *(int *)(local_88 + -4) = *(int *)(local_88 + -4) + 1;
            }
            FUN_1400d1290(uVar5);
            local_c0 = 0;
          }
          local_80 = *(undefined2 *)(lVar3 + 0x38);
          (**(code **)(**(longlong **)(lVar3 + 0x10) + 0x88))();
          (**(code **)(**(longlong **)(lVar3 + 0x10) + 0x78))
                    (*(longlong **)(lVar3 + 0x10),&local_88);
          cVar2 = *(char *)(lVar3 + 0x19);
          while (cVar2 != '\0') {
            Sleep(10);
            (**(code **)(**(longlong **)(lVar3 + 0x10) + 0x98))(*(longlong **)(lVar3 + 0x10),0);
            cVar2 = *(char *)(lVar3 + 0x19);
          }
          FUN_140140df0(local_68);
          puVar4 = local_88;
          if (((local_88 != (undefined *)0x0) && (local_88 != PTR_DAT_1402f8010)) &&
             (puVar7 = local_88 + -8, puVar7 != (undefined *)0x0)) {
            uVar5 = FUN_1400a3440();
            local_b8 = uVar5;
            FUN_1400a1c30(uVar5);
            local_b0 = 1;
            piVar1 = (int *)(puVar4 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(puVar7);
            }
            FUN_1400d1290(uVar5);
            local_b0 = 0;
          }
        }
      }
      iVar9 = iVar9 + 1;
      lVar8 = lVar8 + 8;
    } while (iVar9 < DAT_14031fed8);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140023e60(longlong param_1)

{
  int *piVar1;
  longlong lVar2;
  undefined *puVar3;
  char cVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  wchar_t *pwVar7;
  undefined *puVar8;
  int iVar9;
  longlong lVar10;
  undefined1 auStack_e8 [32];
  undefined8 local_c8;
  undefined1 local_c0;
  undefined8 local_b8;
  undefined1 local_b0;
  undefined8 local_a8;
  undefined1 local_a0;
  undefined8 local_98;
  undefined *local_88;
  undefined2 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined1 local_68 [48];
  ulonglong local_38;
  
  local_98 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_e8;
  iVar9 = 0;
  if (0 < DAT_14031fed8) {
    lVar10 = 0;
    do {
      if (*(longlong *)(*(longlong *)(param_1 + 8) + lVar10) != 0) {
        lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + lVar10);
        if (*(longlong *)(lVar2 + 0x10) == 0) {
          pwVar7 = L"ERROR >> MagiCommonSession::Connect2 | m_NetClient is null!";
LAB_14002409b:
          FUN_140025dc0(4,pwVar7);
        }
        else {
          puVar3 = *(undefined **)(lVar2 + 0x30);
          if (((puVar3 == (undefined *)0x0) || (puVar3 == PTR_DAT_1402f8010)) ||
             (*(int *)(puVar3 + -8) < 1)) {
            pwVar7 = L"ERROR >> MagiCommonSession::Connect2 | m_Address is empty!";
            goto LAB_14002409b;
          }
          if (*(char *)(lVar2 + 0x18) == '\0') {
            pwVar7 = L"ERROR >> MagiCommonSession::Connect2 | IsUse is false!";
            goto LAB_14002409b;
          }
          if (*(char *)(lVar2 + 0x19) == '\x01') {
            do {
              Sleep(10);
              (**(code **)(**(longlong **)(lVar2 + 0x10) + 0x98))(*(longlong **)(lVar2 + 0x10),0);
            } while (*(char *)(lVar2 + 0x19) != '\0');
            if (*(char *)(lVar2 + 0x1a) == '\x01') goto LAB_1400240b9;
          }
          FUN_140140b80(&local_88);
          local_7c = DAT_140320030;
          local_78 = DAT_140320034;
          local_74 = DAT_140320038;
          local_70 = DAT_14032003c;
          if (local_88 == (undefined *)0x0) {
            local_88 = PTR_DAT_1402f8010;
          }
          if (*(undefined **)(lVar2 + 0x30) != local_88) {
            uVar5 = FUN_1400a3440();
            local_c8 = uVar5;
            FUN_1400a1c30(uVar5);
            puVar3 = local_88;
            local_c0 = 1;
            if (((local_88 != (undefined *)0x0) && (local_88 != PTR_DAT_1402f8010)) &&
               (puVar8 = local_88 + -8, puVar8 != (undefined *)0x0)) {
              uVar6 = FUN_1400a3440();
              local_a8 = uVar6;
              FUN_1400a1c30(uVar6);
              local_a0 = 1;
              piVar1 = (int *)(puVar3 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(puVar8);
              }
              FUN_1400d1290(uVar6);
              local_a0 = 0;
            }
            local_88 = *(undefined **)(lVar2 + 0x30);
            if (((local_88 != PTR_DAT_1402f8010) && (local_88 != (undefined *)0x0)) &&
               (local_88 != (undefined *)0x8)) {
              *(int *)(local_88 + -4) = *(int *)(local_88 + -4) + 1;
            }
            FUN_1400d1290(uVar5);
            local_c0 = 0;
          }
          local_80 = *(undefined2 *)(lVar2 + 0x38);
          cVar4 = FUN_140002340(lVar2);
          FUN_140140df0(local_68);
          puVar3 = local_88;
          if (((local_88 != (undefined *)0x0) && (local_88 != PTR_DAT_1402f8010)) &&
             (puVar8 = local_88 + -8, puVar8 != (undefined *)0x0)) {
            uVar5 = FUN_1400a3440();
            local_b8 = uVar5;
            FUN_1400a1c30(uVar5);
            local_b0 = 1;
            piVar1 = (int *)(puVar3 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(puVar8);
            }
            FUN_1400d1290(uVar5);
            local_b0 = 0;
          }
          if (cVar4 != '\0') goto LAB_1400240b9;
        }
        FUN_140025dc0(0xc,L"ERROR >> DBC CONNECTION FAILED - [%d]",iVar9);
      }
LAB_1400240b9:
      iVar9 = iVar9 + 1;
      lVar10 = lVar10 + 8;
    } while (iVar9 < DAT_14031fed8);
  }
  return 1;
}



void FUN_140024100(longlong param_1,undefined4 *param_2)

{
  int iVar1;
  int iVar2;
  undefined *puVar3;
  int iVar4;
  longlong *plVar5;
  int iVar6;
  longlong lVar7;
  undefined *local_res18;
  undefined **local_res20;
  
  iVar6 = 0;
  if (0 < DAT_14031fed8) {
    lVar7 = 0;
    iVar4 = DAT_14031fed8;
    do {
      if (*(longlong *)(lVar7 + *(longlong *)(param_1 + 8)) != 0) {
        plVar5 = (longlong *)(param_2 + 0xc);
        if (7 < *(ulonglong *)(param_2 + 0x12)) {
          plVar5 = (longlong *)*plVar5;
        }
        FUN_1400a3440();
        local_res18 = PTR_DAT_1402f8010;
        iVar1 = FUN_1400a32c0(plVar5);
        iVar4 = 0;
        if ((local_res18 != (undefined *)0x0) && (iVar4 = 0, local_res18 != PTR_DAT_1402f8010)) {
          iVar4 = *(int *)(local_res18 + -8);
        }
        iVar2 = iVar1;
        if (iVar1 <= iVar4) {
          iVar2 = 0;
          if ((local_res18 != (undefined *)0x0) && (iVar2 = 0, local_res18 != PTR_DAT_1402f8010)) {
            iVar2 = *(int *)(local_res18 + -8);
          }
        }
        iVar4 = 1;
        if (1 < iVar2) {
          iVar4 = iVar2;
        }
        iVar2 = 0;
        if ((local_res18 != (undefined *)0x0) && (iVar2 = 0, local_res18 != PTR_DAT_1402f8010)) {
          iVar2 = *(int *)(local_res18 + -8);
        }
        if (iVar2 < iVar4) {
          FUN_140002d50(&local_res18);
        }
        FUN_140002e30(&local_res18);
        puVar3 = local_res18;
        if (local_res18 == (undefined *)0x0) {
          puVar3 = PTR_DAT_1402f8010;
        }
        FUN_1400a32f0(puVar3,plVar5,iVar1);
        puVar3 = local_res18;
        if (local_res18 == (undefined *)0x0) {
          puVar3 = PTR_DAT_1402f8010;
        }
        iVar1 = FUN_1400a32c0(puVar3);
        iVar4 = 0;
        if (0 < iVar1) {
          iVar4 = iVar1;
        }
        iVar1 = 0;
        if ((local_res18 != (undefined *)0x0) && (iVar1 = 0, local_res18 != PTR_DAT_1402f8010)) {
          iVar1 = *(int *)(local_res18 + -8);
        }
        if ((iVar4 < iVar1) || (iVar4 = 0, local_res18 == (undefined *)0x0)) {
LAB_140024243:
          if (((local_res18 != PTR_DAT_1402f8010) && (local_res18 != (undefined *)0x0)) &&
             ((int *)(local_res18 + -8) != (int *)0x0)) {
            *(int *)(local_res18 + -8) = iVar4;
            *(undefined2 *)(local_res18 + (longlong)iVar4 * 2) = 0;
          }
        }
        else if (local_res18 != PTR_DAT_1402f8010) {
          iVar4 = *(int *)(local_res18 + -8);
          goto LAB_140024243;
        }
        local_res20 = &local_res18;
        FUN_140003100(*(longlong *)(lVar7 + *(longlong *)(param_1 + 8)) + 0x30,&local_res18);
        FUN_1400031d0(&local_res18);
        *(undefined2 *)(*(longlong *)(*(longlong *)(param_1 + 8) + lVar7) + 0x38) =
             *(undefined2 *)(param_2 + 1);
        *(undefined4 *)(*(longlong *)(*(longlong *)(param_1 + 8) + lVar7) + 0x3c) = *param_2;
        iVar4 = DAT_14031fed8;
      }
      iVar6 = iVar6 + 1;
      lVar7 = lVar7 + 8;
    } while (iVar6 < iVar4);
  }
  return;
}



undefined8
FUN_1400242e0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "RESP_READ_AUTH_BLACKLISTIP";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if (*(longlong *)(param_1 + 0x48) != 0) {
    FUN_14000cb20(*(longlong *)(param_1 + 0x48),param_4,param_5);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1401e4580(DAT_140320100,"% 9d [ ms ] %s\n",DVar2 - DVar1,"RESP_READ_AUTH_BLACKLISTIP",uVar3,
                  pcVar4,DVar5);
  }
  return 1;
}



undefined8 FUN_140024370(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "RESP_READ_AUTH_PCROOMIP";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if (*(longlong *)(param_1 + 0x48) != 0) {
    FUN_14000c890(*(longlong *)(param_1 + 0x48),param_4);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1401e4580(DAT_140320100,"% 9d [ ms ] %s\n",DVar2 - DVar1,"RESP_READ_AUTH_PCROOMIP",uVar3,
                  pcVar4,DVar5);
  }
  return 1;
}



longlong * FUN_140024400(longlong *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  code *pcVar1;
  ulonglong uVar2;
  longlong *plVar3;
  longlong lVar4;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  uVar2 = (param_2[1] - *param_2) / 0x84;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  if (uVar2 != 0) {
    if (0x1f07c1f07c1f07c < uVar2) {
      std::_Xlength_error("vector<T> too long");
      pcVar1 = (code *)swi(3);
      plVar3 = (longlong *)(*pcVar1)();
      return plVar3;
    }
    lVar4 = FUN_14001ca20(uVar2);
    *param_1 = lVar4;
    param_1[1] = lVar4;
    param_1[2] = uVar2 * 0x84 + lVar4;
    lVar4 = FUN_1400244d0(*param_2,param_2[1],lVar4,param_4,uVar5);
    param_1[1] = lVar4;
  }
  return param_1;
}



void * FUN_1400244d0(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x84)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x84);
    }
    param_3 = (void *)((longlong)param_3 + 0x84);
  }
  return param_3;
}



void FUN_140024540(longlong param_1)

{
  FUN_1400231f0(param_1 + -0x48);
  return;
}



undefined8 FUN_140024550(void)

{
  return 0x2b47;
}



undefined8 FUN_140024560(void)

{
  return 11000;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_140024570(longlong param_1,char *param_2,undefined4 param_3,char *param_4,char *param_5)

{
  char cVar1;
  int iVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  undefined1 *puVar5;
  char *pcVar6;
  undefined1 auStack_488 [32];
  undefined8 local_468;
  undefined1 local_460;
  undefined7 uStack_45f;
  ulonglong local_450;
  ulonglong local_448;
  char local_438 [1008];
  ulonglong local_48;
  
  local_468 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_488;
  local_438[0] = '\0';
  memset(local_438 + 1,0,1000);
  strcpy_s(local_438,0x3e9,"&;6;D;");
  strcat_s(local_438,0x3e9,param_2);
  strcat_s(local_438,0x3e9,";");
  strcat_s(local_438,0x3e9,param_4);
  strcat_s(local_438,0x3e9,";");
  strcat_s(local_438,0x3e9,param_5);
  strcat_s(local_438,0x3e9,";RH;");
  local_448 = 0xf;
  local_450 = 0;
  local_460 = 0;
  uVar4 = 0xffffffffffffffff;
  pcVar6 = local_438;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    cVar1 = *pcVar6;
    pcVar6 = pcVar6 + 1;
  } while (cVar1 != '\0');
  FUN_140003e60(&local_460,local_438,~uVar4 - 1);
  puVar5 = &local_460;
  if (0xf < local_448) {
    puVar5 = (undefined1 *)CONCAT71(uStack_45f,local_460);
  }
  iVar2 = Ordinal_19(*(undefined8 *)(param_1 + 0x20),puVar5,local_450 & 0xffffffff,0);
  if (iVar2 == -1) {
    FUN_14008e050(param_1);
    if (0xf < local_448) {
      operator_delete((void *)CONCAT71(uStack_45f,local_460));
    }
    uVar3 = 0;
  }
  else {
    FUN_14001b1f0(*(undefined8 *)(param_1 + 0x98),param_2,param_3);
    if (0xf < local_448) {
      operator_delete((void *)CONCAT71(uStack_45f,local_460));
    }
    uVar3 = 1;
  }
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140024730(longlong param_1)

{
  int iVar1;
  undefined1 *puVar2;
  undefined1 auStack_68 [32];
  undefined8 local_48;
  undefined1 local_40;
  undefined7 uStack_3f;
  ulonglong local_30;
  ulonglong local_28;
  ulonglong local_18;
  
  local_48 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_68;
  local_28 = 0xf;
  local_30 = 0;
  local_40 = 0;
  FUN_140003e60(&local_40,"&;6;D;RHGameAuth;0123456789ABC;0.0.0.0;RH;",0x2a);
  puVar2 = &local_40;
  if (0xf < local_28) {
    puVar2 = (undefined1 *)CONCAT71(uStack_3f,local_40);
  }
  iVar1 = Ordinal_19(*(undefined8 *)(param_1 + 0x20),puVar2,local_30 & 0xffffffff,0);
  if (iVar1 == -1) {
    printf("TW SEND ERROR :%d\n");
  }
  else {
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if (DAT_140320610 != 1000) {
      if ((DAT_140320f5c & 1) == 0) {
        DAT_140320f5c = DAT_140320f5c | 1;
        FUN_1401e4310();
        atexit((_func_5014 *)&LAB_140202480);
      }
      if (DAT_140320610 != 0xca) goto LAB_14002482e;
    }
    printf("TW KEEP Send\n");
  }
LAB_14002482e:
  if (0xf < local_28) {
    operator_delete((void *)CONCAT71(uStack_3f,local_40));
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140024860(longlong param_1,longlong param_2)

{
  int iVar1;
  char *pcVar2;
  longlong lVar3;
  byte bVar4;
  char *pcVar5;
  bool bVar6;
  bool bVar7;
  undefined1 auStack_d8 [32];
  uint local_b8;
  int local_b0;
  undefined8 local_a8;
  char local_a0 [56];
  char local_68 [56];
  ulonglong local_30;
  
  local_a8 = 0xfffffffffffffffe;
  local_30 = DAT_1402f85a0 ^ (ulonglong)auStack_d8;
  bVar7 = false;
  local_a0[0] = '\0';
  local_a0[1] = '\0';
  local_a0[2] = '\0';
  local_a0[3] = '\0';
  local_a0[4] = '\0';
  local_a0[5] = '\0';
  local_a0[6] = '\0';
  local_a0[7] = '\0';
  local_a0[8] = '\0';
  local_a0[9] = '\0';
  local_a0[10] = '\0';
  local_a0[0xb] = '\0';
  local_a0[0xc] = '\0';
  local_a0[0xd] = '\0';
  local_a0[0xe] = '\0';
  local_a0[0xf] = '\0';
  local_a0[0x10] = '\0';
  local_a0[0x11] = '\0';
  local_a0[0x12] = '\0';
  local_a0[0x13] = '\0';
  local_a0[0x14] = '\0';
  local_a0[0x15] = '\0';
  local_a0[0x16] = '\0';
  local_a0[0x17] = '\0';
  local_a0[0x18] = '\0';
  local_a0[0x19] = '\0';
  local_a0[0x1a] = '\0';
  local_a0[0x1b] = '\0';
  local_a0[0x1c] = '\0';
  local_a0[0x1d] = '\0';
  local_a0[0x1e] = '\0';
  local_a0[0x1f] = '\0';
  local_a0[0x20] = '\0';
  local_a0[0x21] = '\0';
  local_a0[0x22] = '\0';
  local_a0[0x23] = '\0';
  local_a0[0x24] = '\0';
  local_a0[0x25] = '\0';
  local_a0[0x26] = '\0';
  local_a0[0x27] = '\0';
  local_a0[0x28] = '\0';
  local_a0[0x29] = '\0';
  local_a0[0x2a] = '\0';
  local_a0[0x2b] = '\0';
  local_a0[0x2c] = '\0';
  local_a0[0x2d] = '\0';
  local_a0[0x2e] = '\0';
  local_a0[0x2f] = '\0';
  local_a0[0x30] = '\0';
  local_a0[0x31] = 0;
  local_68[0] = '\0';
  local_68[1] = '\0';
  local_68[2] = '\0';
  local_68[3] = '\0';
  local_68[4] = '\0';
  local_68[5] = '\0';
  local_68[6] = '\0';
  local_68[7] = '\0';
  local_68[8] = '\0';
  local_68[9] = '\0';
  local_68[10] = '\0';
  local_68[0xb] = '\0';
  local_68[0xc] = '\0';
  local_68[0xd] = '\0';
  local_68[0xe] = '\0';
  local_68[0xf] = '\0';
  local_68[0x10] = '\0';
  local_68[0x11] = '\0';
  local_68[0x12] = '\0';
  local_68[0x13] = '\0';
  local_68[0x14] = '\0';
  local_68[0x15] = '\0';
  local_68[0x16] = '\0';
  local_68[0x17] = '\0';
  local_68[0x18] = '\0';
  local_68[0x19] = '\0';
  local_68[0x1a] = '\0';
  local_68[0x1b] = '\0';
  local_68[0x1c] = '\0';
  local_68[0x1d] = '\0';
  local_68[0x1e] = '\0';
  local_68[0x1f] = '\0';
  local_68[0x20] = '\0';
  local_68[0x21] = '\0';
  local_68[0x22] = '\0';
  local_68[0x23] = '\0';
  local_68[0x24] = '\0';
  local_68[0x25] = '\0';
  local_68[0x26] = '\0';
  local_68[0x27] = '\0';
  local_68[0x28] = '\0';
  local_68[0x29] = '\0';
  local_68[0x2a] = '\0';
  local_68[0x2b] = '\0';
  local_68[0x2c] = '\0';
  local_68[0x2d] = '\0';
  local_68[0x2e] = '\0';
  local_68[0x2f] = '\0';
  local_68[0x30] = '\0';
  local_68[0x31] = 0;
  iVar1 = 0;
  bVar4 = 0;
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320610 == 1000) {
LAB_140024949:
    printf("ExecutorQueue Recv [ %s ]\n");
  }
  else {
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if (DAT_140320610 == 0xca) goto LAB_140024949;
  }
  pcVar2 = strtok((char *)(param_2 + 6),";");
  bVar6 = pcVar2 == (char *)0x0;
  if (!bVar6) {
    while (pcVar2 = strtok((char *)0x0,";"), pcVar2 != (char *)0x0) {
      bVar4 = bVar4 + 1;
      if (bVar4 == 2) {
        bVar7 = *pcVar2 == 'K';
      }
      else if (bVar4 == 4) {
        strncpy_s(local_a0,0x32,pcVar2,0x31);
      }
      else if (bVar4 == 5) {
        if (bVar7 == false) {
          iVar1 = atoi(pcVar2);
        }
        else {
          strncpy_s(local_68,0x32,pcVar2,0x31);
        }
      }
    }
    bVar6 = bVar4 == 5;
    if (bVar4 < 5) {
      printf("ExecutorQueue Recv Error Step[ %d ] \n");
      return;
    }
  }
  lVar3 = 0xb;
  pcVar2 = local_a0;
  pcVar5 = "RHGameAuth";
  do {
    if (lVar3 == 0) break;
    lVar3 = lVar3 + -1;
    bVar6 = *pcVar2 == *pcVar5;
    pcVar2 = pcVar2 + 1;
    pcVar5 = pcVar5 + 1;
  } while (bVar6);
  if (bVar6) {
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if (DAT_140320610 != 1000) {
      if ((DAT_140320f5c & 1) == 0) {
        DAT_140320f5c = DAT_140320f5c | 1;
        FUN_1401e4310();
        atexit((_func_5014 *)&LAB_140202480);
      }
      if (DAT_140320610 != 0xca) {
        return;
      }
    }
    printf("TW KEEP Recv\n");
    return;
  }
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  if (DAT_140320610 != 1000) {
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if (DAT_140320610 != 0xca) goto LAB_140024b28;
  }
  local_b8 = (uint)bVar7;
  local_b0 = iVar1;
  printf("ExecutorQueue Recv Result [ %s ] A [ %s ] O [ %s ] S [ %d ] Err [ %d ] \n");
LAB_140024b28:
  FUN_14001beb0(*(undefined8 *)(param_1 + 0x98),local_a0,bVar7,iVar1);
  return;
}



undefined8 * FUN_140024b70(undefined8 *param_1,undefined8 param_2)

{
  char *_Dst;
  
  *param_1 = param_2;
  *(undefined4 *)(param_1 + 1) = 0;
  param_1[4] = 0;
  param_1[5] = 7;
  *(undefined2 *)(param_1 + 2) = 0;
  *(undefined4 *)(param_1 + 7) = 0;
  *(undefined4 *)((longlong)param_1 + 0x3c) = 0;
  *(undefined4 *)(param_1 + 8) = 0;
  *(undefined4 *)((longlong)param_1 + 0x44) = 0;
  *(undefined4 *)(param_1 + 9) = 0;
  *(undefined4 *)((longlong)param_1 + 0x4c) = 0;
  *(undefined4 *)(param_1 + 10) = 0;
  *(undefined4 *)(param_1 + 0x3d) = 0;
  *(undefined8 *)((longlong)param_1 + 500) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1fc) = 0;
  *(undefined4 *)((longlong)param_1 + 0x54) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1ec) = 0xffffffffffffffff;
  memset(param_1 + 0xb,0,300);
  memset((void *)((longlong)param_1 + 0x184),0,100);
  _Dst = (char *)(param_1 + 0x40);
  _Dst[0] = '\0';
  _Dst[1] = '\0';
  _Dst[2] = '\0';
  _Dst[3] = '\0';
  _Dst[4] = '\0';
  _Dst[5] = '\0';
  _Dst[6] = '\0';
  _Dst[7] = '\0';
  param_1[0x41] = 0;
  param_1[0x42] = 0;
  param_1[0x43] = 0;
  param_1[0x44] = 0;
  param_1[0x45] = 0;
  *(undefined2 *)(param_1 + 0x46) = 0;
  strcpy_s(_Dst,0x32,"empty");
  memset((void *)((longlong)param_1 + 0x232),0,0x100);
  strcpy_s((char *)((longlong)param_1 + 0x232),0x100,"empty");
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140024c90(FILE **param_1)

{
  DWORD DVar1;
  longlong lVar2;
  wchar_t **ppwVar3;
  undefined1 auStack_298 [32];
  uint local_278;
  uint local_270;
  uint local_268;
  wchar_t *local_260;
  wchar_t *local_258 [3];
  _SYSTEMTIME local_240;
  wchar_t local_228;
  undefined1 local_226 [526];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_298;
  local_228 = L'\0';
  memset(local_226,0,0x206);
  GetLocalTime(&local_240);
  local_258[1] = L"[LOG_CHANNEL]";
  local_258[0] = L"[LOG_CONNECT]";
  local_258[2] = L"[LOG_UV]";
  DVar1 = timeGetTime();
  *(DWORD *)param_1 = DVar1;
  ppwVar3 = local_258;
  lVar2 = 3;
  do {
    param_1 = param_1 + 1;
    local_260 = *ppwVar3;
    local_268 = (uint)local_240.wHour;
    local_270 = (uint)local_240.wDay;
    local_278 = (uint)local_240.wMonth;
    FUN_140003430(&local_228,0x104,L"%04d-%02d-%02d_%02d_%s.GLO",local_240.wYear);
    _wfopen_s(param_1,&local_228,L"wt+");
    ppwVar3 = ppwVar3 + 1;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  return;
}



ulonglong FUN_140024db0(DWORD *param_1)

{
  DWORD DVar1;
  ulonglong uVar2;
  DWORD *pDVar3;
  longlong lVar4;
  
  DVar1 = timeGetTime();
  uVar2 = (ulonglong)(DVar1 - *param_1) * 0x10624dd3 & 0xffffffff;
  if (0xe0f < (DVar1 - *param_1) / 1000) {
    lVar4 = 3;
    *param_1 = DVar1;
    pDVar3 = param_1;
    do {
      pDVar3 = pDVar3 + 2;
      if (*(FILE **)pDVar3 != (FILE *)0x0) {
        fflush(*(FILE **)pDVar3);
        fclose(*(FILE **)pDVar3);
        pDVar3[0] = 0;
        pDVar3[1] = 0;
      }
      lVar4 = lVar4 + -1;
    } while (lVar4 != 0);
    uVar2 = FUN_140024c90(param_1);
  }
  return uVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140024e40(undefined8 *param_1)

{
  LPCRITICAL_SECTION lpCriticalSection;
  undefined8 uVar1;
  longlong lVar2;
  int iVar3;
  longlong *plVar4;
  uint uVar5;
  uint uVar6;
  undefined1 auStack_118 [32];
  uint local_f8;
  uint local_f0;
  uint local_e8;
  uint local_e0;
  longlong local_d8;
  undefined4 local_d0;
  undefined4 local_c8;
  uint local_b8;
  longlong local_b0;
  undefined1 local_a8 [10];
  ushort local_9e;
  undefined1 local_98 [6];
  ushort local_92;
  undefined1 local_88 [12];
  ushort local_7c;
  undefined1 local_78 [16];
  undefined1 local_68 [8];
  ushort local_60;
  undefined1 local_58 [16];
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_118;
  lpCriticalSection = (LPCRITICAL_SECTION)(DAT_14031fee0 + 0x20);
  local_b0 = DAT_14031fee0;
  EnterCriticalSection(lpCriticalSection);
  plVar4 = param_1 + 1;
  uVar1 = *param_1;
  if (7 < (ulonglong)param_1[4]) {
    plVar4 = (longlong *)*plVar4;
  }
  iVar3 = Ordinal_185(uVar1,local_88);
  if (iVar3 == 0) {
    local_b8 = 0xffffffff;
  }
  else {
    local_b8 = (uint)local_7c;
  }
  iVar3 = Ordinal_185(uVar1,local_a8);
  uVar6 = (uint)local_9e;
  if (iVar3 == 0) {
    uVar6 = 0xffffffff;
  }
  iVar3 = Ordinal_185(uVar1,local_68);
  uVar5 = (uint)local_60;
  if (iVar3 == 0) {
    uVar5 = 0xffffffff;
  }
  iVar3 = Ordinal_185(uVar1,local_98);
  local_f8 = (uint)local_92;
  if (iVar3 == 0) {
    local_f8 = 0xffffffff;
  }
  Ordinal_185(uVar1,local_78);
  Ordinal_185(uVar1,local_58);
  lVar2 = local_b0;
  local_c8 = *(undefined4 *)(param_1 + 6);
  local_d0 = *(undefined4 *)((longlong)param_1 + 0x34);
  local_e0 = local_b8;
  local_f0 = uVar5;
  local_e8 = uVar6;
  local_d8 = (longlong)plVar4;
  fwprintf(*(FILE **)(local_b0 + 8),L"%04d-%02d-%02d-%02d-%02d-%02d|%s|%d|%d\n");
  fflush(*(FILE **)(lVar2 + 8));
  FUN_140024db0(lVar2);
  LeaveCriticalSection(lpCriticalSection);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140025010(undefined8 *param_1)

{
  LPCRITICAL_SECTION lpCriticalSection;
  undefined8 uVar1;
  longlong lVar2;
  int iVar3;
  longlong *plVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  undefined1 auStack_118 [32];
  uint local_f8;
  uint local_f0;
  uint local_e8;
  uint local_e0;
  longlong local_d8;
  undefined4 local_d0;
  undefined4 local_c8;
  undefined4 local_c0;
  uint local_b8;
  longlong local_b0;
  undefined1 local_a8 [10];
  ushort local_9e;
  undefined1 local_98 [6];
  ushort local_92;
  undefined1 local_88 [12];
  ushort local_7c;
  undefined1 local_78 [16];
  undefined1 local_68 [8];
  ushort local_60;
  undefined1 local_58 [16];
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_118;
  lpCriticalSection = (LPCRITICAL_SECTION)(DAT_14031fee0 + 0x48);
  local_b0 = DAT_14031fee0;
  EnterCriticalSection(lpCriticalSection);
  plVar4 = param_1 + 1;
  uVar1 = *param_1;
  if (7 < (ulonglong)param_1[4]) {
    plVar4 = (longlong *)*plVar4;
  }
  iVar3 = Ordinal_185(uVar1,local_88);
  if (iVar3 == 0) {
    local_b8 = 0xffffffff;
  }
  else {
    local_b8 = (uint)local_7c;
  }
  iVar3 = Ordinal_185(uVar1,local_a8);
  uVar6 = 0xffffffff;
  uVar7 = (uint)local_9e;
  if (iVar3 == 0) {
    uVar7 = uVar6;
  }
  iVar3 = Ordinal_185(uVar1,local_68);
  uVar5 = (uint)local_60;
  if (iVar3 == 0) {
    uVar5 = uVar6;
  }
  iVar3 = Ordinal_185(uVar1,local_98);
  local_f8 = (uint)local_92;
  if (iVar3 == 0) {
    local_f8 = uVar6;
  }
  Ordinal_185(uVar1,local_78);
  Ordinal_185(uVar1,local_58);
  lVar2 = local_b0;
  local_c0 = *(undefined4 *)((longlong)param_1 + 0x34);
  local_c8 = *(undefined4 *)(param_1 + 7);
  local_d0 = *(undefined4 *)(param_1 + 6);
  local_e0 = local_b8;
  local_f0 = uVar5;
  local_e8 = uVar7;
  local_d8 = (longlong)plVar4;
  fwprintf(*(FILE **)(local_b0 + 0x10),L"%04d-%02d-%02d-%02d-%02d-%02d|%s|%d|%d|%d\n");
  fflush(*(FILE **)(lVar2 + 0x10));
  FUN_140024db0(lVar2);
  LeaveCriticalSection(lpCriticalSection);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400251e0(void)

{
  undefined1 auStack_278 [32];
  uint local_258;
  uint local_250;
  uint local_248;
  _SYSTEMTIME local_238;
  WCHAR local_228 [264];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_278;
  memset(local_228,0,0x208);
  local_238.wYear = 0;
  local_238.wMonth = 0;
  local_238.wDayOfWeek = 0;
  local_238.wDay = 0;
  local_238.wHour = 0;
  local_238.wMinute = 0;
  local_238.wSecond = 0;
  local_238.wMilliseconds = 0;
  GetCurrentDirectoryW(0x104,local_228);
  GetLocalTime(&local_238);
  local_248 = (uint)local_238.wDay;
  local_250 = (uint)local_238.wMonth;
  local_258 = (uint)local_238.wYear;
  FUN_140003430(local_228,0x104,L"%s\\Dump_%d-%d-%d",local_228);
  BT_InstallSehFilter();
  BT_SetAppVersion(&DAT_14027b43c);
  BT_SetAppName(L"GATE_SERVER");
  BT_SetSupportEMail(L"bug@stairway.co.kr");
  BT_SetFlags(3);
  BT_SetSupportServer(L"203.239.161.83",9999);
  BT_SetSupportURL(L"http://www.stairway.co.kr");
  BT_SetDumpType(0x1826);
  BT_SetActivityType(2);
  BT_SetReportFilePath(local_228);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140025300(wchar_t *param_1,wchar_t *param_2,longlong param_3,int param_4)

{
  undefined8 uVar1;
  undefined1 auStack_2e8 [32];
  undefined2 *local_2c8;
  longlong local_2c0;
  uint local_2b8;
  uint local_2b0;
  uint local_2a8;
  _SYSTEMTIME local_298;
  undefined2 local_288;
  undefined8 local_286;
  undefined8 local_27e;
  undefined8 local_276;
  undefined8 local_26e;
  undefined8 local_266;
  undefined8 local_25e;
  undefined8 local_256;
  undefined4 local_24e;
  undefined2 local_24a;
  undefined2 local_248;
  undefined1 local_246 [526];
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_2e8;
  if (((param_1 == (wchar_t *)0x0) || (param_3 == 0)) || (param_2 == (wchar_t *)0x0)) {
    uVar1 = 0;
  }
  else {
    local_248 = 0;
    memset(local_246,0,0x206);
    GetLocalTime(&local_298);
    local_2b8 = (uint)local_298.wHour;
    local_2c0._0_4_ = (uint)local_298.wDay;
    local_2c8 = (undefined2 *)CONCAT44(local_2c8._4_4_,(uint)local_298.wMonth);
    FUN_140003430(&local_248,0x104,L"%04d-%02d-%02d_%02d.log",local_298.wYear);
    local_2c8 = &local_248;
    _snwprintf_s(param_2,0x104,0x104,L"%s");
    if (param_4 == 1) {
      local_286 = 0;
      local_27e = 0;
      local_276 = 0;
      local_26e = 0;
      local_266 = 0;
      local_25e = 0;
      local_256 = 0;
      local_24e = 0;
      local_24a = 0;
      local_288 = 0;
      local_2a8 = (uint)local_298.wSecond;
      local_2b0 = (uint)local_298.wMinute;
      local_2b8 = (uint)local_298.wHour;
      local_2c0 = CONCAT44(local_2c0._4_4_,(uint)local_298.wDay);
      local_2c8 = (undefined2 *)CONCAT44(local_2c8._4_4_,(uint)local_298.wMonth);
      FUN_140003400(&local_288,0x20,L"%04d-%02d-%02d %02d:%02d:%02d",local_298.wYear);
      local_2c8 = &local_288;
      local_2c0 = param_3;
      _snwprintf_s(param_1,0x100,0x100,L"[%s] %s\n");
    }
    else {
      local_2c8 = (undefined2 *)param_3;
      _snwprintf_s(param_1,0x100,0x100,L"%s\n");
    }
    uVar1 = 1;
  }
  return uVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400254d0(char *param_1,char *param_2,longlong param_3)

{
  undefined8 uVar1;
  undefined1 auStack_1b8 [32];
  undefined1 *local_198;
  longlong local_190;
  uint local_188;
  uint local_180;
  uint local_178;
  _SYSTEMTIME local_168;
  undefined1 local_158;
  undefined8 local_157;
  undefined8 local_14f;
  undefined8 local_147;
  undefined4 local_13f;
  undefined2 local_13b;
  undefined1 local_139;
  undefined1 local_138;
  undefined1 local_137 [271];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_1b8;
  if (((param_1 == (char *)0x0) || (param_3 == 0)) || (param_2 == (char *)0x0)) {
    uVar1 = 0;
  }
  else {
    local_138 = 0;
    memset(local_137,0,0x103);
    GetLocalTime(&local_168);
    local_188 = (uint)local_168.wHour;
    local_190._0_4_ = (uint)local_168.wDay;
    local_198 = (undefined1 *)CONCAT44(local_198._4_4_,(uint)local_168.wMonth);
    FUN_140003460(&local_138,0x104,"%04d-%02d-%02d_%02d.log",local_168.wYear);
    local_198 = &local_138;
    _snprintf_s(param_2,0x104,0x104,"%s");
    local_158 = 0;
    local_157 = 0;
    local_14f = 0;
    local_147 = 0;
    local_13f = 0;
    local_13b = 0;
    local_139 = 0;
    local_178 = (uint)local_168.wSecond;
    local_180 = (uint)local_168.wMinute;
    local_188 = (uint)local_168.wHour;
    local_190 = CONCAT44(local_190._4_4_,(uint)local_168.wDay);
    local_198 = (undefined1 *)CONCAT44(local_198._4_4_,(uint)local_168.wMonth);
    FUN_140026190(&local_158,0x20,"%04d-%02d-%02d %02d:%02d:%02d",local_168.wYear);
    local_198 = &local_158;
    local_190 = param_3;
    _snprintf_s(param_1,0x100,0x100,"[%s] %s\n");
    uVar1 = 1;
  }
  return uVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140025650(wchar_t *param_1,wchar_t *param_2,longlong param_3)

{
  undefined8 uVar1;
  undefined1 auStack_2e8 [32];
  undefined2 *local_2c8;
  longlong local_2c0;
  uint local_2b8;
  uint local_2b0;
  uint local_2a8;
  _SYSTEMTIME local_298;
  undefined2 local_288;
  undefined8 local_286;
  undefined8 local_27e;
  undefined8 local_276;
  undefined8 local_26e;
  undefined8 local_266;
  undefined8 local_25e;
  undefined8 local_256;
  undefined4 local_24e;
  undefined2 local_24a;
  undefined2 local_248;
  undefined1 local_246 [526];
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_2e8;
  if (((param_1 == (wchar_t *)0x0) || (param_3 == 0)) || (param_2 == (wchar_t *)0x0)) {
    uVar1 = 0;
  }
  else {
    local_248 = 0;
    memset(local_246,0,0x206);
    GetLocalTime(&local_298);
    local_2b8 = (uint)local_298.wHour;
    local_2c0._0_4_ = (uint)local_298.wDay;
    local_2c8 = (undefined2 *)CONCAT44(local_2c8._4_4_,(uint)local_298.wMonth);
    FUN_140003430(&local_248,0x104,L"%04d-%02d-%02d_%02d.log",local_298.wYear);
    local_2c8 = &local_248;
    _snwprintf_s(param_2,0x104,0x104,L"%s");
    local_288 = 0;
    local_286 = 0;
    local_27e = 0;
    local_276 = 0;
    local_26e = 0;
    local_266 = 0;
    local_25e = 0;
    local_256 = 0;
    local_24e = 0;
    local_24a = 0;
    local_2a8 = (uint)local_298.wSecond;
    local_2b0 = (uint)local_298.wMinute;
    local_2b8 = (uint)local_298.wHour;
    local_2c0 = CONCAT44(local_2c0._4_4_,(uint)local_298.wDay);
    local_2c8 = (undefined2 *)CONCAT44(local_2c8._4_4_,(uint)local_298.wMonth);
    FUN_140003400(&local_288,0x20,L"%04d-%02d-%02d %02d:%02d:%02d",local_298.wYear);
    local_2c8 = &local_288;
    local_2c0 = param_3;
    _snwprintf_s(param_1,0x100,0x100,L"[%s] %s\n");
    uVar1 = 1;
  }
  return uVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x000140025870)

undefined8 FUN_1400257f0(longlong param_1,longlong param_2)

{
  errno_t eVar1;
  undefined1 auStack_268 [32];
  longlong local_248;
  FILE *local_238 [2];
  wchar_t local_228;
  undefined1 local_226 [526];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_268;
  if ((param_1 != 0) && (param_2 != 0)) {
    local_228 = L'\0';
    memset(local_226,0,0x206);
    local_248 = param_1;
    FUN_140003430(&local_228,0x104,L"%s_%s");
    local_238[0] = (FILE *)0x0;
    eVar1 = _wfopen_s(local_238,&local_228,L"a");
    if ((eVar1 == 0) && (local_238[0] != (FILE *)0x0)) {
      fwprintf(local_238[0],L"%s");
      fflush(local_238[0]);
      fclose(local_238[0]);
      return 1;
    }
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x000140025986)

undefined8 FUN_140025910(longlong param_1,longlong param_2)

{
  errno_t eVar1;
  undefined1 auStack_168 [32];
  longlong local_148;
  FILE *local_138 [2];
  char local_128;
  undefined1 local_127 [271];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_168;
  if ((param_1 != 0) && (param_2 != 0)) {
    local_128 = '\0';
    memset(local_127,0,0x103);
    local_148 = param_1;
    FUN_140003460(&local_128,0x104,"%s_%s");
    local_138[0] = (FILE *)0x0;
    eVar1 = fopen_s(local_138,&local_128,"a");
    if ((eVar1 == 0) && (local_138[0] != (FILE *)0x0)) {
      fprintf(local_138[0],"%s");
      fflush(local_138[0]);
      fclose(local_138[0]);
      return 1;
    }
  }
  return 0;
}



BOOL FUN_140025a20(undefined8 *param_1,PCONSOLE_SCREEN_BUFFER_INFO param_2)

{
  BOOL BVar1;
  HANDLE hConsoleOutput;
  
  hConsoleOutput = GetStdHandle(0xfffffff5);
  *param_1 = hConsoleOutput;
  if (hConsoleOutput == (HANDLE)0xffffffffffffffff) {
    return 0;
  }
  (param_2->dwSize).X = 0;
  (param_2->dwSize).Y = 0;
  (param_2->dwCursorPosition).X = 0;
  (param_2->dwCursorPosition).Y = 0;
  param_2->wAttributes = 0;
  (param_2->srWindow).Left = 0;
  (param_2->srWindow).Top = 0;
  (param_2->srWindow).Right = 0;
  *(undefined4 *)&(param_2->srWindow).Bottom = 0;
  (param_2->dwMaximumWindowSize).Y = 0;
                    // WARNING: Could not recover jumptable at 0x000140025a71. Too many branches
                    // WARNING: Treating indirect jump as call
  BVar1 = GetConsoleScreenBufferInfo(hConsoleOutput,param_2);
  return BVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140025a80(byte param_1,longlong param_2)

{
  HANDLE hConsoleOutput;
  int iVar1;
  undefined8 uVar2;
  undefined1 auStack_58 [32];
  HANDLE local_38;
  undefined1 local_30 [8];
  ushort local_28;
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_58;
  if (param_2 == 0) {
    uVar2 = 0;
  }
  else {
    local_38 = (HANDLE)0xffffffffffffffff;
    iVar1 = FUN_140025a20(&local_38,local_30);
    hConsoleOutput = local_38;
    if (iVar1 == 0) {
      wprintf(L"%s");
    }
    else {
      SetConsoleTextAttribute(local_38,(ushort)(param_1 & 0xf) | local_28 & 0xf0);
      wprintf(L"%s");
      SetConsoleTextAttribute(hConsoleOutput,local_28);
    }
    uVar2 = 1;
  }
  return uVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

bool FUN_140025b40(wchar_t *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  undefined8 local_res10;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined1 auStack_648 [32];
  WCHAR local_628;
  undefined1 local_626 [510];
  wchar_t local_428;
  undefined1 local_426 [510];
  undefined2 local_228;
  undefined1 local_226 [526];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_648;
  local_res10 = param_2;
  local_res18 = param_3;
  local_res20 = param_4;
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_140320008);
  local_428 = L'\0';
  memset(local_426,0,0x1fe);
  vswprintf_s(&local_428,0x100,param_1,(va_list)&local_res10);
  local_228 = 0;
  memset(local_226,0,0x206);
  local_628 = L'\0';
  memset(local_626,0,0x1fe);
  iVar1 = FUN_140025300(&local_628,&local_228,&local_428,1);
  if (iVar1 != 0) {
    FUN_1400257f0(&local_228,&local_628);
    OutputDebugStringW(&local_628);
    wprintf(L"%s");
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140320008);
  }
  else {
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140320008);
  }
  return iVar1 != 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

bool FUN_140025c80(wchar_t *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  undefined8 local_res10;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined1 auStack_648 [32];
  WCHAR local_628;
  undefined1 local_626 [510];
  wchar_t local_428;
  undefined1 local_426 [510];
  undefined2 local_228;
  undefined1 local_226 [526];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_648;
  local_res10 = param_2;
  local_res18 = param_3;
  local_res20 = param_4;
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_140320008);
  local_428 = L'\0';
  memset(local_426,0,0x1fe);
  vswprintf_s(&local_428,0x100,param_1,(va_list)&local_res10);
  local_228 = 0;
  memset(local_226,0,0x206);
  local_628 = L'\0';
  memset(local_626,0,0x1fe);
  iVar1 = FUN_140025300(&local_628,&local_228,&local_428,0);
  if (iVar1 != 0) {
    FUN_1400257f0(&local_228,&local_628);
    OutputDebugStringW(&local_628);
    wprintf(L"%s");
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140320008);
  }
  else {
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140320008);
  }
  return iVar1 != 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

bool FUN_140025dc0(undefined1 param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined1 auStack_658 [32];
  WCHAR local_638;
  undefined1 local_636 [510];
  wchar_t local_438;
  undefined1 local_436 [510];
  undefined2 local_238;
  undefined1 local_236 [526];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_658;
  local_res18 = param_3;
  local_res20 = param_4;
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_140320008);
  local_438 = L'\0';
  memset(local_436,0,0x1fe);
  vswprintf_s(&local_438,0x100,param_2,(va_list)&local_res18);
  local_238 = 0;
  memset(local_236,0,0x206);
  local_638 = L'\0';
  memset(local_636,0,0x1fe);
  iVar1 = FUN_140025300(&local_638,&local_238,&local_438,1);
  if (iVar1 != 0) {
    FUN_1400257f0(&local_238,&local_638);
    OutputDebugStringW(&local_638);
    FUN_140025a80(param_1,&local_638);
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140320008);
  }
  else {
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140320008);
  }
  return iVar1 != 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140025f00(char *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  undefined8 local_res10;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined1 auStack_348 [32];
  CHAR local_328;
  undefined1 local_327 [255];
  char local_228;
  undefined1 local_227 [255];
  undefined1 local_128;
  undefined1 local_127 [271];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_348;
  local_res10 = param_2;
  local_res18 = param_3;
  local_res20 = param_4;
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_140320008);
  local_228 = '\0';
  memset(local_227,0,0xff);
  vsprintf_s(&local_228,0x100,param_1,(va_list)&local_res10);
  local_128 = 0;
  memset(local_127,0,0x103);
  local_328 = '\0';
  memset(local_327,0,0xff);
  iVar1 = FUN_1400254d0(&local_328,&local_128,&local_228);
  if (iVar1 == 0) {
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140320008);
    return 0;
  }
  FUN_140025910(&local_128,&local_328);
  OutputDebugStringA(&local_328);
  printf("%s");
  LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140320008);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

bool FUN_140026050(wchar_t *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  undefined8 local_res10;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined1 auStack_648 [32];
  WCHAR local_628;
  undefined1 local_626 [510];
  wchar_t local_428;
  undefined1 local_426 [510];
  undefined2 local_228;
  undefined1 local_226 [526];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_648;
  local_res10 = param_2;
  local_res18 = param_3;
  local_res20 = param_4;
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_140320008);
  local_428 = L'\0';
  memset(local_426,0,0x1fe);
  vswprintf_s(&local_428,0x100,param_1,(va_list)&local_res10);
  local_228 = 0;
  memset(local_226,0,0x206);
  local_628 = L'\0';
  memset(local_626,0,0x1fe);
  iVar1 = FUN_140025650(&local_628,&local_228,&local_428);
  if (iVar1 != 0) {
    FUN_1400257f0(&local_228,&local_628);
    OutputDebugStringW(&local_628);
    wprintf(L"%s");
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140320008);
  }
  else {
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140320008);
  }
  return iVar1 != 0;
}



void FUN_140026190(char *param_1,size_t param_2,char *param_3,undefined8 param_4)

{
  undefined8 local_res20;
  
  local_res20 = param_4;
  _vsnprintf_s(param_1,0x20,param_2,param_3,(va_list)&local_res20);
  return;
}



void FUN_1400261c0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  void *pvVar2;
  undefined8 *puVar3;
  undefined1 auVar4 [16];
  __uint64 _Var5;
  longlong *plVar6;
  longlong *local_28;
  
  lVar1 = *(longlong *)*param_1;
  if (param_2 == 0) {
    plVar6 = &DAT_14031fee8;
  }
  else {
    auVar4._8_8_ = 0;
    auVar4._0_8_ = param_2 + 0x1bU >> 2;
    _Var5 = SUB168(ZEXT816(4) * auVar4,0);
    if (SUB168(ZEXT816(4) * auVar4,8) != 0) {
      _Var5 = 0xffffffffffffffff;
    }
    plVar6 = operator_new(_Var5);
    *plVar6 = lVar1;
    *(undefined1 *)((longlong)plVar6 + lVar1 + 0x10) = 0;
    plVar6[1] = param_2;
    local_28 = plVar6;
  }
  memcpy(plVar6 + 2,(size_t *)*param_1 + 2,*(size_t *)*param_1);
  pvVar2 = (void *)param_1[1];
  puVar3 = (undefined8 *)*param_1;
  *param_1 = (longlong)plVar6;
  param_1[1] = (longlong)local_28;
  if (puVar3 != &DAT_14031fee8) {
    operator_delete__(pvVar2);
  }
  return;
}



longlong * FUN_140026290(longlong *param_1,void *param_2,size_t param_3)

{
  ulonglong uVar1;
  void *pvVar2;
  undefined8 *puVar3;
  undefined1 auVar4 [16];
  __uint64 _Var5;
  size_t *psVar6;
  size_t *local_28;
  
  uVar1 = *(ulonglong *)(*param_1 + 8);
  if ((uVar1 < param_3) || (param_3 * 3 + 0x18 < uVar1)) {
    if (param_3 == 0) {
      psVar6 = &DAT_14031fee8;
    }
    else {
      auVar4._8_8_ = 0;
      auVar4._0_8_ = param_3 + 0x1b >> 2;
      _Var5 = SUB168(ZEXT816(4) * auVar4,0);
      if (SUB168(ZEXT816(4) * auVar4,8) != 0) {
        _Var5 = 0xffffffffffffffff;
      }
      psVar6 = operator_new(_Var5);
      *psVar6 = param_3;
      *(undefined1 *)((longlong)psVar6 + param_3 + 0x10) = 0;
      psVar6[1] = param_3;
      local_28 = psVar6;
    }
    memcpy(psVar6 + 2,param_2,param_3);
    pvVar2 = (void *)param_1[1];
    puVar3 = (undefined8 *)*param_1;
    *param_1 = (longlong)psVar6;
    param_1[1] = (longlong)local_28;
    if (puVar3 != &DAT_14031fee8) {
      operator_delete__(pvVar2);
    }
  }
  else {
    memmove((void *)(*param_1 + 0x10),param_2,param_3);
    *(size_t *)*param_1 = param_3;
    *(undefined1 *)(*param_1 + 0x10 + param_3) = 0;
  }
  return param_1;
}



longlong * FUN_140026390(longlong *param_1,void *param_2,size_t param_3)

{
  ulonglong uVar1;
  longlong *plVar2;
  
  plVar2 = (longlong *)*param_1;
  uVar1 = param_3 + *plVar2;
  if (((ulonglong)plVar2[1] < uVar1) && ((ulonglong)plVar2[1] < plVar2[1] + uVar1)) {
    FUN_1400261c0(param_1);
  }
  memmove((void *)(*(longlong *)*param_1 + 0x10 + *param_1),param_2,param_3);
  *(ulonglong *)*param_1 = uVar1;
  *(undefined1 *)(*param_1 + 0x10 + uVar1) = 0;
  return param_1;
}



longlong * FUN_140026410(longlong *param_1,undefined1 param_2)

{
  longlong *plVar1;
  ulonglong uVar2;
  undefined1 local_res10 [24];
  
  plVar1 = (longlong *)*param_1;
  uVar2 = *plVar1 + 1;
  local_res10[0] = param_2;
  if (((ulonglong)plVar1[1] < uVar2) && ((ulonglong)plVar1[1] < plVar1[1] + uVar2)) {
    FUN_1400261c0();
  }
  memmove((void *)(*(longlong *)*param_1 + 0x10 + *param_1),local_res10,1);
  *(ulonglong *)*param_1 = uVar2;
  *(undefined1 *)(*param_1 + 0x10 + uVar2) = 0;
  return param_1;
}



void FUN_140026480(undefined8 *param_1)

{
  *param_1 = TiXmlBase::vftable;
  return;
}



undefined8 * FUN_140026490(undefined8 *param_1,byte param_2)

{
  *param_1 = TiXmlBase::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_1400264c0(longlong *param_1)

{
  longlong lVar1;
  undefined8 uVar2;
  
  while( true ) {
    if (param_1 == (longlong *)0x0) {
      return 0;
    }
    lVar1 = (**(code **)(*param_1 + 0x20))(param_1);
    if (lVar1 != 0) break;
    param_1 = (longlong *)param_1[3];
  }
                    // WARNING: Could not recover jumptable at 0x0001400264fa. Too many branches
                    // WARNING: Treating indirect jump as call
  uVar2 = (**(code **)(*param_1 + 0x20))(param_1);
  return uVar2;
}



undefined8 * FUN_140026500(undefined8 *param_1,char *param_2,char *param_3,undefined8 param_4)

{
  char cVar1;
  ulonglong uVar2;
  char *pcVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  param_1[1] = 0xffffffffffffffff;
  param_1[2] = 0;
  *param_1 = TiXmlAttribute::vftable;
  param_1[4] = &DAT_14031fee8;
  param_1[6] = &DAT_14031fee8;
  uVar2 = 0xffffffffffffffff;
  pcVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    cVar1 = *pcVar3;
    pcVar3 = pcVar3 + 1;
  } while (cVar1 != '\0');
  FUN_140026290(param_1 + 4,param_2,~uVar2 - 1,param_4,0xfffffffffffffffe);
  uVar2 = 0xffffffffffffffff;
  pcVar3 = param_3;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    cVar1 = *pcVar3;
    pcVar3 = pcVar3 + 1;
  } while (cVar1 != '\0');
  FUN_140026290(param_1 + 6,param_3,~uVar2 - 1,param_4,uVar4);
  param_1[3] = 0;
  param_1[9] = 0;
  param_1[8] = 0;
  return param_1;
}



void FUN_1400265b0(undefined8 param_1,undefined8 param_2)

{
  FUN_140027f10(param_1,param_2,0);
  return;
}



undefined8 * FUN_1400265c0(undefined8 *param_1,uint param_2)

{
  if ((undefined8 *)param_1[6] != &DAT_14031fee8) {
    operator_delete__((void *)param_1[7]);
  }
  if ((undefined8 *)param_1[4] != &DAT_14031fee8) {
    operator_delete__((void *)param_1[5]);
  }
  *param_1 = TiXmlBase::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_140026630(undefined8 param_1)

{
  return param_1;
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl std::bad_alloc::`scalar deleting destructor'(unsigned
// int) __ptr64
// 
// Libraries: Visual Studio 2012 Release, Visual Studio 2015 Release

void * __thiscall std::bad_alloc::_scalar_deleting_destructor_(bad_alloc *this,uint param_1)

{
  *(undefined ***)this = TiXmlComment::vftable;
  FUN_140026b00();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



undefined8 *
FUN_140026680(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  param_1[1] = 0xffffffffffffffff;
  param_1[2] = 0;
  param_1[7] = &DAT_14031fee8;
  param_1[3] = 0;
  *(undefined4 *)(param_1 + 4) = 4;
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[9] = 0;
  param_1[10] = 0;
  *param_1 = TiXmlText::vftable;
  FUN_140026290(param_1 + 7,&DAT_14027a10a,0,param_4,0xfffffffffffffffe);
  *(undefined1 *)(param_1 + 0xb) = 0;
  return param_1;
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl std::bad_alloc::`scalar deleting destructor'(unsigned
// int) __ptr64
// 
// Libraries: Visual Studio 2012 Release, Visual Studio 2015 Release

void * __thiscall std::bad_alloc::_scalar_deleting_destructor_(bad_alloc *this,uint param_1)

{
  *(undefined ***)this = TiXmlText::vftable;
  FUN_140026b00();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_140026740(undefined8 *param_1)

{
  *param_1 = TiXmlDeclaration::vftable;
  if ((undefined8 *)param_1[0xf] != &DAT_14031fee8) {
    operator_delete__((void *)param_1[0x10]);
  }
  if ((undefined8 *)param_1[0xd] != &DAT_14031fee8) {
    operator_delete__((void *)param_1[0xe]);
  }
  if ((undefined8 *)param_1[0xb] != &DAT_14031fee8) {
    operator_delete__((void *)param_1[0xc]);
  }
  FUN_140026b00(param_1);
  return;
}



void FUN_1400267b0(longlong *param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001400267b6. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0x88))();
  return;
}



void * FUN_1400267c0(void *param_1,uint param_2)

{
  FUN_140026740();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl std::bad_alloc::`scalar deleting destructor'(unsigned
// int) __ptr64
// 
// Libraries: Visual Studio 2012 Release, Visual Studio 2015 Release

void * __thiscall std::bad_alloc::_scalar_deleting_destructor_(bad_alloc *this,uint param_1)

{
  *(undefined ***)this = TiXmlUnknown::vftable;
  FUN_140026b00();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140026830(undefined8 *param_1,longlong *param_2)

{
  char cVar1;
  byte bVar2;
  longlong *plVar3;
  undefined *_Src;
  int *piVar4;
  int iVar5;
  longlong lVar6;
  size_t _Size;
  undefined8 uVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  char *pcVar10;
  undefined1 auStack_78 [32];
  char local_58 [32];
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_78;
  piVar4 = (int *)*param_1;
  iVar5 = 0;
  uVar7 = *(undefined8 *)piVar4;
  if (0 < (int)uVar7) {
    do {
      _Src = PTR_s__amp__140312800;
      lVar6 = (longlong)iVar5;
      bVar2 = *(byte *)((longlong)piVar4 + lVar6 + 0x10);
      if (bVar2 == 0x26) {
        if ((((int)uVar7 + -2 <= iVar5) ||
            (*(char *)((longlong)(iVar5 + 1) + 0x10 + (longlong)piVar4) != '#')) ||
           (*(char *)((longlong)(iVar5 + 2) + 0x10 + (longlong)piVar4) != 'x')) {
          plVar3 = (longlong *)*param_2;
          uVar8 = (ulonglong)DAT_140312808;
          uVar9 = *plVar3 + uVar8;
          if (((ulonglong)plVar3[1] < uVar9) && ((ulonglong)plVar3[1] < plVar3[1] + uVar9)) {
            FUN_1400261c0(param_2);
          }
          memmove((void *)(*(longlong *)*param_2 + 0x10 + *param_2),_Src,uVar8);
          *(ulonglong *)*param_2 = uVar9;
          *(undefined1 *)(*param_2 + 0x10 + uVar9) = 0;
          goto LAB_140026a98;
        }
        if (iVar5 < (int)uVar7 + -1) {
          do {
            plVar3 = (longlong *)*param_2;
            uVar8 = *plVar3 + 1;
            if (((ulonglong)plVar3[1] < uVar8) && ((ulonglong)plVar3[1] < plVar3[1] + uVar8)) {
              FUN_1400261c0(param_2);
            }
            memmove((void *)(*(longlong *)*param_2 + 0x10 + *param_2),
                    (void *)((longlong)iVar5 + 0x10 + (longlong)piVar4),1);
            *(ulonglong *)*param_2 = uVar8;
            iVar5 = iVar5 + 1;
            *(undefined1 *)(*param_2 + 0x10 + uVar8) = 0;
            piVar4 = (int *)*param_1;
          } while ((*(char *)((longlong)piVar4 + lVar6 + 0x11) != ';') &&
                  (lVar6 = lVar6 + 1, iVar5 < *piVar4 + -1));
        }
      }
      else {
        if (bVar2 == 0x3c) {
          FUN_140026390(param_2,PTR_DAT_140312810,DAT_140312818);
        }
        else if (bVar2 == 0x3e) {
          FUN_140026390(param_2,PTR_DAT_140312820,DAT_140312828);
        }
        else if (bVar2 == 0x22) {
          FUN_140026390(param_2,PTR_s__quot__140312830,DAT_140312838);
        }
        else if (bVar2 == 0x27) {
          FUN_140026390(param_2,PTR_s__apos__140312840,DAT_140312848);
        }
        else if (bVar2 < 0x20) {
          FUN_140026190(local_58,0x20,"&#x%02X;",bVar2);
          lVar6 = -1;
          pcVar10 = local_58;
          do {
            if (lVar6 == 0) break;
            lVar6 = lVar6 + -1;
            cVar1 = *pcVar10;
            pcVar10 = pcVar10 + 1;
          } while (cVar1 != '\0');
          _Size = (size_t)(int)(~(uint)lVar6 - 1);
          plVar3 = (longlong *)*param_2;
          uVar8 = *plVar3 + _Size;
          if (((ulonglong)plVar3[1] < uVar8) && ((ulonglong)plVar3[1] < plVar3[1] + uVar8)) {
            FUN_1400261c0(param_2);
          }
          memmove((void *)(*(longlong *)*param_2 + 0x10 + *param_2),local_58,_Size);
          *(ulonglong *)*param_2 = uVar8;
          *(undefined1 *)(*param_2 + 0x10 + uVar8) = 0;
        }
        else {
          FUN_140026410(param_2,bVar2);
        }
LAB_140026a98:
        iVar5 = iVar5 + 1;
      }
      piVar4 = (int *)*param_1;
      uVar7 = *(undefined8 *)piVar4;
    } while (iVar5 < (int)uVar7);
  }
  return;
}



void * FUN_140026ad0(void *param_1,uint param_2)

{
  FUN_140026b00();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140026b00(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  *param_1 = TiXmlNode::vftable;
  puVar2 = (undefined8 *)param_1[5];
  while (puVar2 != (undefined8 *)0x0) {
    puVar1 = (undefined8 *)puVar2[10];
    (**(code **)*puVar2)(puVar2,1,param_3,param_4,uVar3);
    puVar2 = puVar1;
  }
  if ((undefined8 *)param_1[7] != &DAT_14031fee8) {
    operator_delete__((void *)param_1[8]);
  }
  *param_1 = TiXmlBase::vftable;
  return;
}



void FUN_140026b80(longlong param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  puVar2 = *(undefined8 **)(param_1 + 0x28);
  if (puVar2 == (undefined8 *)0x0) {
    *(undefined8 *)(param_1 + 0x28) = 0;
    *(undefined8 *)(param_1 + 0x30) = 0;
    return;
  }
  do {
    puVar1 = (undefined8 *)puVar2[10];
    (**(code **)*puVar2)(puVar2,1);
    puVar2 = puVar1;
  } while (puVar1 != (undefined8 *)0x0);
  *(undefined8 *)(param_1 + 0x28) = 0;
  *(undefined8 *)(param_1 + 0x30) = 0;
  return;
}



undefined8 * FUN_140026be0(longlong *param_1,undefined8 *param_2)

{
  char cVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong *plVar4;
  char *pcVar5;
  
  if (*(int *)(param_2 + 4) != 0) {
    param_2[3] = param_1;
    param_2[9] = param_1[6];
    param_2[10] = 0;
    if (param_1[6] != 0) {
      *(undefined8 **)(param_1[6] + 0x50) = param_2;
      param_1[6] = (longlong)param_2;
      return param_2;
    }
    param_1[5] = (longlong)param_2;
    param_1[6] = (longlong)param_2;
    return param_2;
  }
  (**(code **)*param_2)(param_2,1);
  plVar4 = param_1;
  if (param_1 != (longlong *)0x0) {
    while( true ) {
      lVar2 = (**(code **)(*plVar4 + 0x20))(plVar4);
      if (lVar2 != 0) break;
      plVar4 = (longlong *)plVar4[3];
      if (plVar4 == (longlong *)0x0) {
        return (undefined8 *)0x0;
      }
    }
    lVar2 = (**(code **)(*plVar4 + 0x20))(plVar4);
    if (lVar2 != 0) {
      do {
        lVar2 = (**(code **)(*param_1 + 0x20))();
        if (lVar2 != 0) {
          lVar2 = (**(code **)(*param_1 + 0x20))();
          goto LAB_140026c6a;
        }
        param_1 = (longlong *)param_1[3];
      } while (param_1 != (longlong *)0x0);
      lVar2 = 0;
LAB_140026c6a:
      if (*(char *)(lVar2 + 0x58) == '\0') {
        uVar3 = 0xffffffffffffffff;
        *(undefined1 *)(lVar2 + 0x58) = 1;
        *(undefined4 *)(lVar2 + 0x5c) = 0x10;
        pcVar5 = PTR_s_Error_when_TiXmlDocument_added_t_1403127f0;
        do {
          if (uVar3 == 0) break;
          uVar3 = uVar3 - 1;
          cVar1 = *pcVar5;
          pcVar5 = pcVar5 + 1;
        } while (cVar1 != '\0');
        FUN_140026290(lVar2 + 0x60,PTR_s_Error_when_TiXmlDocument_added_t_1403127f0,~uVar3 - 1);
        *(undefined8 *)(lVar2 + 0x74) = 0xffffffffffffffff;
      }
    }
  }
  return (undefined8 *)0x0;
}



undefined8 FUN_140026d00(longlong param_1,longlong param_2)

{
  char cVar1;
  char cVar2;
  char *pcVar3;
  undefined8 uVar4;
  longlong *plVar5;
  longlong lVar6;
  
  plVar5 = *(longlong **)(param_1 + 0x28);
  do {
    if (plVar5 == (longlong *)0x0) {
      return 0;
    }
    pcVar3 = (char *)(plVar5[7] + 0x10);
    lVar6 = param_2 - (longlong)pcVar3;
    do {
      cVar1 = *pcVar3;
      cVar2 = pcVar3[lVar6];
      if (cVar1 != cVar2) break;
      pcVar3 = pcVar3 + 1;
    } while (cVar2 != '\0');
    if (cVar1 == cVar2) {
LAB_140026d60:
      lVar6 = (**(code **)(*plVar5 + 0x30))(plVar5);
      if (lVar6 != 0) {
                    // WARNING: Could not recover jumptable at 0x000140026dcd. Too many branches
                    // WARNING: Treating indirect jump as call
        uVar4 = (**(code **)(*plVar5 + 0x30))(plVar5);
        return uVar4;
      }
      plVar5 = (longlong *)plVar5[10];
      if (plVar5 == (longlong *)0x0) {
        return 0;
      }
      do {
        pcVar3 = (char *)(plVar5[7] + 0x10);
        lVar6 = param_2 - (longlong)pcVar3;
        do {
          cVar1 = *pcVar3;
          cVar2 = pcVar3[lVar6];
          if (cVar1 != cVar2) break;
          pcVar3 = pcVar3 + 1;
        } while (cVar2 != '\0');
        if (cVar1 == cVar2) goto LAB_140026d60;
        plVar5 = (longlong *)plVar5[10];
        if (plVar5 == (longlong *)0x0) {
          return 0;
        }
      } while( true );
    }
    plVar5 = (longlong *)plVar5[10];
  } while( true );
}



undefined8 * FUN_140026de0(undefined8 *param_1,char *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  char cVar2;
  ulonglong uVar3;
  char *pcVar4;
  
  param_1[1] = 0xffffffffffffffff;
  param_1[2] = 0;
  param_1[7] = &DAT_14031fee8;
  param_1[3] = 0;
  *(undefined4 *)(param_1 + 4) = 1;
  param_1[9] = 0;
  param_1[10] = 0;
  *param_1 = TiXmlElement::vftable;
  puVar1 = param_1 + 0xb;
  param_1[0xc] = 0xffffffffffffffff;
  param_1[0xd] = 0;
  *puVar1 = TiXmlAttribute::vftable;
  param_1[0xf] = &DAT_14031fee8;
  param_1[0x11] = &DAT_14031fee8;
  param_1[0xe] = 0;
  param_1[0x14] = puVar1;
  param_1[0x13] = puVar1;
  param_1[6] = 0;
  param_1[5] = 0;
  uVar3 = 0xffffffffffffffff;
  pcVar4 = param_2;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    cVar2 = *pcVar4;
    pcVar4 = pcVar4 + 1;
  } while (cVar2 != '\0');
  FUN_140026290(param_1 + 7,param_2,~uVar3 - 1,param_4,0xfffffffffffffffe);
  return param_1;
}



void * FUN_140026ea0(void *param_1,uint param_2)

{
  FUN_140026ed0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140026ed0(undefined8 *param_1)

{
  *param_1 = TiXmlElement::vftable;
  FUN_140026f50();
  if ((undefined8 *)param_1[0x11] != &DAT_14031fee8) {
    operator_delete__((void *)param_1[0x12]);
  }
  if ((undefined8 *)param_1[0xf] != &DAT_14031fee8) {
    operator_delete__((void *)param_1[0x10]);
  }
  param_1[0xb] = TiXmlBase::vftable;
  FUN_140026b00(param_1);
  return;
}



void FUN_140026f50(longlong param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  FUN_140026b80();
  do {
    puVar1 = *(undefined8 **)(param_1 + 0xa0);
    if ((puVar1 == (undefined8 *)(param_1 + 0x58)) || (puVar2 = puVar1, puVar1 == (undefined8 *)0x0)
       ) {
      return;
    }
    for (; puVar2 != (undefined8 *)(param_1 + 0x58); puVar2 = (undefined8 *)puVar2[9]) {
      if (puVar2 == puVar1) {
        *(undefined8 *)(puVar2[8] + 0x48) = puVar2[9];
        *(undefined8 *)(puVar2[9] + 0x40) = puVar2[8];
        puVar2[9] = 0;
        puVar2[8] = 0;
        break;
      }
    }
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
  } while( true );
}



longlong FUN_140026fe0(longlong param_1,longlong param_2)

{
  char cVar1;
  char cVar2;
  longlong lVar3;
  char *pcVar4;
  longlong lVar5;
  
  lVar3 = *(longlong *)(param_1 + 0xa0);
  do {
    if (lVar3 == param_1 + 0x58) {
      return 0;
    }
    pcVar4 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
    lVar5 = param_2 - (longlong)pcVar4;
    do {
      cVar1 = *pcVar4;
      cVar2 = pcVar4[lVar5];
      if (cVar1 != cVar2) break;
      pcVar4 = pcVar4 + 1;
    } while (cVar2 != '\0');
    if (cVar1 == cVar2) {
      return *(longlong *)(lVar3 + 0x30) + 0x10;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
}



void FUN_140027030(longlong *param_1,longlong param_2,char *param_3)

{
  char cVar1;
  char cVar2;
  longlong *plVar3;
  char *pcVar4;
  void *pvVar5;
  ulonglong uVar6;
  longlong lVar7;
  
  for (plVar3 = (longlong *)param_1[0x14]; plVar3 != param_1 + 0xb; plVar3 = (longlong *)plVar3[9])
  {
    pcVar4 = (char *)(plVar3[4] + 0x10);
    lVar7 = param_2 - (longlong)pcVar4;
    do {
      cVar1 = *pcVar4;
      cVar2 = pcVar4[lVar7];
      if (cVar1 != cVar2) break;
      pcVar4 = pcVar4 + 1;
    } while (cVar2 != '\0');
    if (cVar1 == cVar2) {
      if (plVar3 != (longlong *)0x0) {
        uVar6 = 0xffffffffffffffff;
        pcVar4 = param_3;
        goto code_r0x0001400270b0;
      }
      break;
    }
  }
  pvVar5 = operator_new(0x50);
  if (pvVar5 == (void *)0x0) {
    lVar7 = 0;
  }
  else {
    lVar7 = FUN_140026500(pvVar5,param_2,param_3);
  }
  if (lVar7 != 0) {
    *(longlong **)(lVar7 + 0x48) = param_1 + 0xb;
    *(longlong *)(lVar7 + 0x40) = param_1[0x13];
    *(longlong *)(param_1[0x13] + 0x48) = lVar7;
    param_1[0x13] = lVar7;
    return;
  }
  while( true ) {
    if (param_1 == (longlong *)0x0) {
      return;
    }
    lVar7 = (**(code **)(*param_1 + 0x20))(param_1);
    if (lVar7 != 0) break;
    param_1 = (longlong *)param_1[3];
  }
  lVar7 = (**(code **)(*param_1 + 0x20))();
  if (lVar7 == 0) {
    return;
  }
  if (*(char *)(lVar7 + 0x58) != '\0') {
    return;
  }
  *(undefined1 *)(lVar7 + 0x58) = 1;
  *(undefined4 *)(lVar7 + 0x5c) = 3;
  uVar6 = 0xffffffffffffffff;
  pcVar4 = PTR_s_Memory_allocation_failed__140312788;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + 1;
  } while (cVar1 != '\0');
  FUN_140026290(lVar7 + 0x60,PTR_s_Memory_allocation_failed__140312788,~uVar6 - 1);
  *(undefined8 *)(lVar7 + 0x74) = 0xffffffffffffffff;
  return;
  while( true ) {
    uVar6 = uVar6 - 1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + 1;
    if (cVar1 == '\0') break;
code_r0x0001400270b0:
    if (uVar6 == 0) break;
  }
  FUN_140026290(plVar3 + 6,param_3,~uVar6 - 1,plVar3,0xfffffffffffffffe);
  return;
}



void FUN_1400271a0(longlong param_1,FILE *param_2,uint param_3)

{
  longlong *plVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  uVar4 = (ulonglong)param_3;
  uVar3 = uVar4;
  if (0 < (int)param_3) {
    do {
      fprintf(param_2,"    ");
      uVar3 = uVar3 - 1;
    } while (uVar3 != 0);
  }
  fprintf(param_2,"<%s");
  plVar1 = *(longlong **)(param_1 + 0xa0);
  if (plVar1 != (longlong *)(param_1 + 0x58)) {
    do {
      if (plVar1 == (longlong *)0x0) break;
      fprintf(param_2," ");
      (**(code **)(*plVar1 + 8))(plVar1,param_2,uVar4);
      plVar1 = (longlong *)plVar1[9];
    } while ((*(longlong *)plVar1[6] != 0) || (*(longlong *)plVar1[4] != 0));
  }
  plVar1 = *(longlong **)(param_1 + 0x28);
  if (plVar1 == (longlong *)0x0) {
    fprintf(param_2," />");
  }
  else {
    if ((plVar1 == *(longlong **)(param_1 + 0x30)) &&
       (lVar2 = (**(code **)(*plVar1 + 0x58))(plVar1), lVar2 != 0)) {
      fprintf(param_2,">");
      (**(code **)(**(longlong **)(param_1 + 0x28) + 8))
                (*(longlong **)(param_1 + 0x28),param_2,param_3 + 1);
    }
    else {
      fprintf(param_2,">");
      for (plVar1 = *(longlong **)(param_1 + 0x28); plVar1 != (longlong *)0x0;
          plVar1 = (longlong *)plVar1[10]) {
        lVar2 = (**(code **)(*plVar1 + 0x58))(plVar1);
        if (lVar2 == 0) {
          fprintf(param_2,"\n");
        }
        (**(code **)(*plVar1 + 8))(plVar1,param_2,param_3 + 1);
      }
      fprintf(param_2,"\n");
      if (0 < (int)param_3) {
        do {
          fprintf(param_2,"    ");
          uVar4 = uVar4 - 1;
        } while (uVar4 != 0);
      }
    }
    fprintf(param_2,"</%s>");
  }
  return;
}



void FUN_140027370(longlong param_1,longlong param_2)

{
  char cVar1;
  longlong lVar2;
  longlong *plVar3;
  undefined8 uVar4;
  ulonglong uVar5;
  char *pcVar6;
  char *pcVar7;
  
  uVar5 = 0xffffffffffffffff;
  pcVar6 = (char *)(*(longlong *)(param_1 + 0x38) + 0x10);
  pcVar7 = pcVar6;
  do {
    if (uVar5 == 0) break;
    uVar5 = uVar5 - 1;
    cVar1 = *pcVar7;
    pcVar7 = pcVar7 + 1;
  } while (cVar1 != '\0');
  FUN_140026290(param_2 + 0x38,pcVar6,~uVar5 - 1);
  *(undefined8 *)(param_2 + 0x10) = *(undefined8 *)(param_1 + 0x10);
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 != param_1 + 0x58) {
    do {
      if (lVar2 == 0) break;
      FUN_140027030(param_2,*(longlong *)(lVar2 + 0x20) + 0x10,*(longlong *)(lVar2 + 0x30) + 0x10);
      lVar2 = *(longlong *)(lVar2 + 0x48);
    } while ((**(longlong **)(lVar2 + 0x30) != 0) || (**(longlong **)(lVar2 + 0x20) != 0));
  }
  for (plVar3 = *(longlong **)(param_1 + 0x28); plVar3 != (longlong *)0x0;
      plVar3 = (longlong *)plVar3[10]) {
    uVar4 = (**(code **)(*plVar3 + 0x78))(plVar3);
    FUN_140026be0(param_2,uVar4);
  }
  return;
}



void FUN_140027440(longlong param_1,longlong *param_2)

{
  longlong *plVar1;
  char cVar2;
  longlong lVar3;
  
  lVar3 = *(longlong *)(param_1 + 0xa0);
  if (*(longlong *)(param_1 + 0xa0) == param_1 + 0x58) {
    lVar3 = 0;
  }
  cVar2 = (**(code **)(*param_2 + 8))(param_2,param_1,lVar3);
  if (cVar2 != '\0') {
    plVar1 = *(longlong **)(param_1 + 0x28);
    while ((plVar1 != (longlong *)0x0 &&
           (cVar2 = (**(code **)(*plVar1 + 0x80))(plVar1,param_2), cVar2 != '\0'))) {
      plVar1 = (longlong *)plVar1[10];
    }
  }
                    // WARNING: Could not recover jumptable at 0x0001400274b4. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_2 + 0x18))(param_2,param_1);
  return;
}



longlong FUN_1400274c0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  pvVar1 = operator_new(0xa8);
  if (pvVar1 == (void *)0x0) {
    lVar2 = 0;
  }
  else {
    lVar2 = FUN_140026de0(pvVar1,*(longlong *)(param_1 + 0x38) + 0x10,param_3,param_4,uVar3);
  }
  if (lVar2 == 0) {
    lVar2 = 0;
  }
  else {
    FUN_140027370(param_1,lVar2);
  }
  return lVar2;
}



undefined8 *
FUN_140027530(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  param_1[1] = 0xffffffffffffffff;
  param_1[2] = 0;
  param_1[7] = &DAT_14031fee8;
  param_1[3] = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[9] = 0;
  param_1[10] = 0;
  *param_1 = TiXmlDocument::vftable;
  param_1[0xc] = &DAT_14031fee8;
  *(undefined8 *)((longlong)param_1 + 0x74) = 0xffffffffffffffff;
  *(undefined4 *)(param_1 + 0xe) = 4;
  *(undefined1 *)((longlong)param_1 + 0x7c) = 0;
  *(undefined1 *)(param_1 + 0xb) = 0;
  *(undefined4 *)((longlong)param_1 + 0x5c) = 0;
  FUN_140026290(param_1 + 0xc,&DAT_14027a10a,0,param_4,0xfffffffffffffffe);
  *(undefined8 *)((longlong)param_1 + 0x74) = 0;
  return param_1;
}



undefined8 * FUN_1400275d0(undefined8 *param_1,char *param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  ulonglong uVar2;
  char *pcVar3;
  
  param_1[1] = 0xffffffffffffffff;
  param_1[2] = 0;
  param_1[7] = &DAT_14031fee8;
  param_1[3] = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[9] = 0;
  param_1[10] = 0;
  *param_1 = TiXmlDocument::vftable;
  param_1[0xc] = &DAT_14031fee8;
  *(undefined8 *)((longlong)param_1 + 0x74) = 0xffffffffffffffff;
  *(undefined4 *)(param_1 + 0xe) = 4;
  *(undefined1 *)((longlong)param_1 + 0x7c) = 0;
  uVar2 = 0xffffffffffffffff;
  pcVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    cVar1 = *pcVar3;
    pcVar3 = pcVar3 + 1;
  } while (cVar1 != '\0');
  FUN_140026290(param_1 + 7,param_2,~uVar2 - 1,param_4,0xfffffffffffffffe);
  *(undefined1 *)(param_1 + 0xb) = 0;
  *(undefined4 *)((longlong)param_1 + 0x5c) = 0;
  FUN_140026290(param_1 + 0xc,&DAT_14027a10a,0);
  *(undefined8 *)((longlong)param_1 + 0x74) = 0;
  return param_1;
}



ulonglong FUN_1400276a0(longlong param_1,char *param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined1 auVar2 [16];
  FILE *_File;
  byte bVar3;
  errno_t eVar4;
  __uint64 _Var5;
  undefined4 extraout_var;
  ulonglong extraout_RAX;
  ulonglong uVar6;
  size_t sVar7;
  char *pcVar8;
  FILE *local_res8;
  undefined8 uVar9;
  size_t *psVar10;
  size_t *psVar11;
  size_t *local_38;
  
  uVar9 = 0xfffffffffffffffe;
  uVar6 = 0xffffffffffffffff;
  pcVar8 = param_2;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    cVar1 = *pcVar8;
    pcVar8 = pcVar8 + 1;
  } while (cVar1 != '\0');
  uVar6 = ~uVar6;
  sVar7 = uVar6 - 1;
  if (sVar7 == 0) {
    psVar10 = &DAT_14031fee8;
  }
  else {
    auVar2._8_8_ = 0;
    auVar2._0_8_ = uVar6 + 0x1a >> 2;
    _Var5 = SUB168(ZEXT816(4) * auVar2,0);
    if (SUB168(ZEXT816(4) * auVar2,8) != 0) {
      _Var5 = 0xffffffffffffffff;
    }
    local_38 = operator_new(_Var5);
    *local_38 = sVar7;
    *(undefined1 *)((longlong)local_38 + uVar6 + 0xf) = 0;
    local_38[1] = sVar7;
    psVar10 = local_38;
  }
  psVar11 = psVar10;
  memcpy(psVar10 + 2,param_2,*psVar10);
  FUN_140026290(param_1 + 0x38,psVar10 + 2,*psVar10,param_4,uVar9,psVar11);
  local_res8 = (FILE *)0x0;
  eVar4 = fopen_s(&local_res8,(char *)(*(longlong *)(param_1 + 0x38) + 0x10),"rb");
  _File = local_res8;
  uVar6 = CONCAT44(extraout_var,eVar4);
  if ((eVar4 == 0) && (local_res8 != (FILE *)0x0)) {
    bVar3 = FUN_140027820(param_1,local_res8);
    fclose(_File);
    if (psVar10 != &DAT_14031fee8) {
      operator_delete__(local_38);
    }
    uVar6 = (ulonglong)bVar3;
  }
  else {
    if (*(char *)(param_1 + 0x58) == '\0') {
      *(undefined1 *)(param_1 + 0x58) = 1;
      *(undefined4 *)(param_1 + 0x5c) = 2;
      uVar6 = 0xffffffffffffffff;
      pcVar8 = PTR_s_Failed_to_open_file_140312780;
      do {
        if (uVar6 == 0) break;
        uVar6 = uVar6 - 1;
        cVar1 = *pcVar8;
        pcVar8 = pcVar8 + 1;
      } while (cVar1 != '\0');
      uVar6 = FUN_140026290(param_1 + 0x60,PTR_s_Failed_to_open_file_140312780,~uVar6 - 1,param_4,
                            uVar9,psVar11);
      *(undefined4 *)(param_1 + 0x78) = 0xffffffff;
      *(undefined4 *)(param_1 + 0x74) = 0xffffffff;
    }
    if (psVar10 != &DAT_14031fee8) {
      operator_delete__(local_38);
      uVar6 = extraout_RAX;
    }
    uVar6 = uVar6 & 0xffffffffffffff00;
  }
  return uVar6;
}



// WARNING: Type propagation algorithm not settling

undefined8 FUN_140027820(longlong *param_1,FILE *param_2)

{
  char cVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  undefined1 auVar4 [16];
  undefined1 auVar5 [16];
  undefined1 auVar6 [16];
  ulonglong *puVar7;
  long lVar8;
  char *pcVar9;
  size_t sVar10;
  __uint64 _Var11;
  ulonglong *puVar12;
  ulonglong *puVar13;
  ulonglong uVar14;
  ulonglong uVar15;
  char *pcVar16;
  char *_Src;
  char *pcVar17;
  ulonglong *local_res10;
  ulonglong *local_res18;
  ulonglong *local_res20;
  ulonglong *local_a8;
  ulonglong *local_88;
  ulonglong *local_80;
  ulonglong *local_78;
  ulonglong *local_70;
  ulonglong *local_68;
  ulonglong *local_60;
  ulonglong *local_58;
  ulonglong *local_50;
  
  if (param_2 == (FILE *)0x0) {
    if ((char)param_1[0xb] != '\0') {
      return 0;
    }
    *(undefined1 *)(param_1 + 0xb) = 1;
    *(undefined4 *)((longlong)param_1 + 0x5c) = 2;
    pcVar9 = PTR_s_Failed_to_open_file_140312780;
  }
  else {
    FUN_140026b80();
    param_1[1] = -1;
    fseek(param_2,0,2);
    lVar8 = ftell(param_2);
    uVar14 = (ulonglong)lVar8;
    fseek(param_2,0,0);
    if (0 < lVar8) {
      local_88 = &DAT_14031fee8;
      if (DAT_14031fef0 < uVar14) {
        FUN_1400261c0(&local_88,uVar14);
      }
      puVar13 = local_88;
      pcVar9 = operator_new((longlong)(lVar8 + 1));
      *pcVar9 = '\0';
      sVar10 = fread(pcVar9,uVar14,1,param_2);
      if (sVar10 == 1) {
        pcVar9[uVar14] = '\0';
        pcVar17 = pcVar9;
        _Src = pcVar9;
        if (*pcVar9 != '\0') {
          local_res18 = local_70;
          local_res20 = local_60;
          local_a8 = local_50;
          pcVar16 = pcVar9;
          do {
            puVar12 = &DAT_14031fee8;
            if (*pcVar16 == '\n') {
              pcVar17 = pcVar16 + (1 - (longlong)_Src) + *puVar13;
              puVar7 = puVar13;
              if (((char *)puVar13[1] < pcVar17) &&
                 (uVar14 = puVar13[1] + (longlong)pcVar17, puVar13[1] < uVar14)) {
                local_78 = &DAT_14031fee8;
                local_res10 = (ulonglong *)*puVar13;
                if (uVar14 != 0) {
                  auVar4._8_8_ = 0;
                  auVar4._0_8_ = uVar14 + 0x1b >> 2;
                  _Var11 = SUB168(ZEXT816(4) * auVar4,0);
                  if (SUB168(ZEXT816(4) * auVar4,8) != 0) {
                    _Var11 = 0xffffffffffffffff;
                  }
                  puVar12 = operator_new(_Var11);
                  *puVar12 = (ulonglong)local_res10;
                  *(undefined1 *)((longlong)(puVar12 + 2) + (longlong)local_res10) = 0;
                  puVar12[1] = uVar14;
                  local_res18 = puVar12;
                }
                memcpy(puVar12 + 2,puVar13 + 2,*puVar13);
                local_70 = local_80;
                local_80 = local_res18;
                local_res18 = local_70;
                puVar7 = puVar12;
                local_88 = puVar12;
                local_78 = puVar13;
                if (puVar13 != &DAT_14031fee8) {
                  operator_delete__(local_70);
                }
              }
              puVar13 = puVar7;
              memmove((void *)(*puVar13 + 0x10 + (longlong)puVar13),_Src,
                      (size_t)(pcVar16 + (1 - (longlong)_Src)));
              *puVar13 = (ulonglong)pcVar17;
              *(char *)((longlong)puVar13 + (longlong)(pcVar17 + 0x10)) = '\0';
              pcVar17 = pcVar16 + 1;
              _Src = pcVar17;
            }
            else if (*pcVar16 == '\r') {
              sVar10 = (longlong)pcVar16 - (longlong)_Src;
              puVar12 = puVar13;
              if (0 < (longlong)sVar10) {
                uVar14 = sVar10 + *puVar13;
                if ((puVar13[1] < uVar14) && (uVar15 = puVar13[1] + uVar14, puVar13[1] < uVar15)) {
                  local_68 = &DAT_14031fee8;
                  uVar2 = *puVar13;
                  if (uVar15 == 0) {
                    local_res10 = &DAT_14031fee8;
                  }
                  else {
                    auVar5._8_8_ = 0;
                    auVar5._0_8_ = uVar15 + 0x1b >> 2;
                    _Var11 = SUB168(ZEXT816(4) * auVar5,0);
                    if (SUB168(ZEXT816(4) * auVar5,8) != 0) {
                      _Var11 = 0xffffffffffffffff;
                    }
                    local_res10 = operator_new(_Var11);
                    *local_res10 = uVar2;
                    *(undefined1 *)((longlong)local_res10 + uVar2 + 0x10) = 0;
                    local_res10[1] = uVar15;
                    local_res20 = local_res10;
                  }
                  memcpy(local_res10 + 2,puVar13 + 2,*puVar13);
                  local_60 = local_80;
                  puVar12 = local_res10;
                  local_88 = local_res10;
                  local_80 = local_res20;
                  local_res20 = local_60;
                  local_68 = puVar13;
                  if (puVar13 != &DAT_14031fee8) {
                    operator_delete__(local_60);
                  }
                }
                memmove((void *)(*puVar12 + 0x10 + (longlong)puVar12),_Src,sVar10);
                *puVar12 = uVar14;
                *(undefined1 *)(uVar14 + 0x10 + (longlong)puVar12) = 0;
              }
              local_res10 = (ulonglong *)CONCAT71(local_res10._1_7_,10);
              uVar14 = *puVar12;
              uVar15 = uVar14 + 1;
              puVar13 = puVar12;
              if ((puVar12[1] < uVar15) && (uVar2 = puVar12[1] + uVar15, puVar12[1] < uVar2)) {
                local_58 = &DAT_14031fee8;
                uVar3 = *puVar12;
                if (uVar2 == 0) {
                  puVar13 = &DAT_14031fee8;
                }
                else {
                  auVar6._8_8_ = 0;
                  auVar6._0_8_ = uVar2 + 0x1b >> 2;
                  _Var11 = SUB168(ZEXT816(4) * auVar6,0);
                  if (SUB168(ZEXT816(4) * auVar6,8) != 0) {
                    _Var11 = 0xffffffffffffffff;
                  }
                  puVar13 = operator_new(_Var11);
                  *puVar13 = uVar3;
                  *(undefined1 *)((longlong)puVar13 + uVar3 + 0x10) = 0;
                  puVar13[1] = uVar2;
                  local_a8 = puVar13;
                }
                memcpy(puVar13 + 2,puVar12 + 2,*puVar12);
                local_50 = local_80;
                local_80 = local_a8;
                local_a8 = local_50;
                local_88 = puVar13;
                local_58 = puVar12;
                if (puVar12 != &DAT_14031fee8) {
                  operator_delete__(local_50);
                }
              }
              memmove((void *)(*puVar13 + 0x10 + (longlong)puVar13),&local_res10,1);
              *puVar13 = uVar15;
              *(undefined1 *)(uVar14 + 0x11 + (longlong)puVar13) = 0;
              pcVar17 = pcVar16 + 1;
              _Src = pcVar17;
              if (*pcVar17 == '\n') {
                pcVar17 = pcVar16 + 2;
                _Src = pcVar17;
              }
            }
            else {
              pcVar17 = pcVar16 + 1;
            }
            pcVar16 = pcVar17;
          } while (*pcVar17 != '\0');
        }
        if ((longlong)pcVar17 - (longlong)_Src != 0) {
          FUN_140026390(&local_88,_Src,(longlong)pcVar17 - (longlong)_Src);
          puVar13 = local_88;
        }
        operator_delete(pcVar9);
        (**(code **)(*param_1 + 0x10))(param_1,puVar13 + 2,0,0);
        if ((char)param_1[0xb] == '\0') {
          if (puVar13 != &DAT_14031fee8) {
            operator_delete__(local_80);
          }
          return 1;
        }
      }
      else {
        operator_delete(pcVar9);
        if ((char)param_1[0xb] == '\0') {
          *(undefined1 *)(param_1 + 0xb) = 1;
          *(undefined4 *)((longlong)param_1 + 0x5c) = 2;
          uVar14 = 0xffffffffffffffff;
          pcVar9 = PTR_s_Failed_to_open_file_140312780;
          do {
            if (uVar14 == 0) break;
            uVar14 = uVar14 - 1;
            cVar1 = *pcVar9;
            pcVar9 = pcVar9 + 1;
          } while (cVar1 != '\0');
          FUN_140026290(param_1 + 0xc,PTR_s_Failed_to_open_file_140312780,~uVar14 - 1);
          *(undefined8 *)((longlong)param_1 + 0x74) = 0xffffffffffffffff;
        }
      }
      if (puVar13 == &DAT_14031fee8) {
        return 0;
      }
      operator_delete__(local_80);
      return 0;
    }
    if ((char)param_1[0xb] != '\0') {
      return 0;
    }
    *(undefined1 *)(param_1 + 0xb) = 1;
    *(undefined4 *)((longlong)param_1 + 0x5c) = 0xd;
    pcVar9 = PTR_s_Error_document_empty__1403127d8;
  }
  uVar14 = 0xffffffffffffffff;
  pcVar17 = pcVar9;
  do {
    if (uVar14 == 0) break;
    uVar14 = uVar14 - 1;
    cVar1 = *pcVar17;
    pcVar17 = pcVar17 + 1;
  } while (cVar1 != '\0');
  FUN_140026290(param_1 + 0xc,pcVar9,~uVar14 - 1);
  *(undefined8 *)((longlong)param_1 + 0x74) = 0xffffffffffffffff;
  return 0;
}



void FUN_140027d30(longlong param_1,longlong param_2)

{
  char cVar1;
  longlong *plVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  char *pcVar5;
  char *pcVar6;
  
  uVar4 = 0xffffffffffffffff;
  pcVar5 = (char *)(*(longlong *)(param_1 + 0x38) + 0x10);
  pcVar6 = pcVar5;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    cVar1 = *pcVar6;
    pcVar6 = pcVar6 + 1;
  } while (cVar1 != '\0');
  FUN_140026290(param_2 + 0x38,pcVar5,~uVar4 - 1);
  *(undefined8 *)(param_2 + 0x10) = *(undefined8 *)(param_1 + 0x10);
  *(undefined1 *)(param_2 + 0x58) = *(undefined1 *)(param_1 + 0x58);
  *(undefined4 *)(param_2 + 0x5c) = *(undefined4 *)(param_1 + 0x5c);
  FUN_140026290(param_2 + 0x60,*(undefined8 **)(param_1 + 0x60) + 2,
                **(undefined8 **)(param_1 + 0x60));
  *(undefined4 *)(param_2 + 0x70) = *(undefined4 *)(param_1 + 0x70);
  *(undefined8 *)(param_2 + 0x74) = *(undefined8 *)(param_1 + 0x74);
  *(undefined1 *)(param_2 + 0x7c) = *(undefined1 *)(param_1 + 0x7c);
  for (plVar2 = *(longlong **)(param_1 + 0x28); plVar2 != (longlong *)0x0;
      plVar2 = (longlong *)plVar2[10]) {
    uVar3 = (**(code **)(*plVar2 + 0x78))(plVar2);
    FUN_140026be0(param_2,uVar3);
  }
  return;
}



longlong FUN_140027de0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  pvVar1 = operator_new(0x80);
  if (pvVar1 == (void *)0x0) {
    lVar2 = 0;
  }
  else {
    lVar2 = FUN_140027530(pvVar1);
  }
  if (lVar2 == 0) {
    lVar2 = 0;
  }
  else {
    FUN_140027d30(param_1,lVar2,param_3,param_4,uVar3);
  }
  return lVar2;
}



void FUN_140027e40(longlong param_1,FILE *param_2,undefined4 param_3)

{
  longlong *plVar1;
  
  for (plVar1 = *(longlong **)(param_1 + 0x28); plVar1 != (longlong *)0x0;
      plVar1 = (longlong *)plVar1[10]) {
    (**(code **)(*plVar1 + 8))(plVar1,param_2,param_3);
    fprintf(param_2,"\n");
  }
  return;
}



void FUN_140027ea0(longlong param_1,longlong *param_2)

{
  longlong *plVar1;
  char cVar2;
  
  cVar2 = (**(code **)(*param_2 + 0x10))(param_2,param_1);
  if (cVar2 != '\0') {
    plVar1 = *(longlong **)(param_1 + 0x28);
    while ((plVar1 != (longlong *)0x0 &&
           (cVar2 = (**(code **)(*plVar1 + 0x80))(plVar1,param_2), cVar2 != '\0'))) {
      plVar1 = (longlong *)plVar1[10];
    }
  }
                    // WARNING: Could not recover jumptable at 0x000140027f04. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_2 + 0x20))(param_2,param_1);
  return;
}



void FUN_140027f10(longlong param_1,FILE *param_2,longlong *param_3,undefined8 param_4)

{
  char cVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  longlong *plVar5;
  undefined *_Src;
  ulonglong uVar6;
  undefined8 *local_30;
  void *local_28;
  undefined8 *local_20;
  void *local_18;
  
  local_20 = &DAT_14031fee8;
  local_30 = &DAT_14031fee8;
  FUN_140026830(param_1 + 0x20,&local_20,param_3,param_4,0xfffffffffffffffe);
  FUN_140026830(param_1 + 0x30,&local_30);
  puVar4 = local_20;
  puVar3 = local_30;
  plVar2 = *(longlong **)(param_1 + 0x30);
  if (*plVar2 != 0) {
    plVar5 = plVar2 + 2;
    cVar1 = (char)*plVar5;
    while (cVar1 != '\0') {
      if (cVar1 == '\"') {
        if ((longlong)plVar5 - (longlong)plVar2 != 0xf) {
          if (param_2 != (FILE *)0x0) {
            fprintf(param_2,"%s=\'%s\'");
          }
          if (param_3 == (longlong *)0x0) goto LAB_140028165;
          FUN_140026390(param_3,puVar4 + 2,*puVar4);
          plVar2 = (longlong *)*param_3;
          uVar6 = *plVar2 + 2;
          if (((ulonglong)plVar2[1] < uVar6) && ((ulonglong)plVar2[1] < plVar2[1] + uVar6)) {
            FUN_1400261c0(param_3);
          }
          memmove((void *)(*param_3 + *(longlong *)*param_3 + 0x10),&DAT_14027b5d0,2);
          *(ulonglong *)*param_3 = uVar6;
          *(undefined1 *)(*param_3 + 0x10 + uVar6) = 0;
          FUN_140026390(param_3,puVar3 + 2,*puVar3);
          plVar2 = (longlong *)*param_3;
          uVar6 = *plVar2 + 1;
          if (((ulonglong)plVar2[1] < uVar6) && ((ulonglong)plVar2[1] < plVar2[1] + uVar6)) {
            FUN_1400261c0(param_3);
          }
          _Src = &DAT_14027b5d4;
          goto LAB_140028140;
        }
        break;
      }
      plVar5 = (longlong *)((longlong)plVar5 + 1);
      cVar1 = *(char *)plVar5;
    }
  }
  if (param_2 != (FILE *)0x0) {
    fprintf(param_2,"%s=\"%s\"");
  }
  if (param_3 != (longlong *)0x0) {
    FUN_140026390(param_3,puVar4 + 2,*puVar4);
    plVar2 = (longlong *)*param_3;
    uVar6 = *plVar2 + 2;
    if (((ulonglong)plVar2[1] < uVar6) && ((ulonglong)plVar2[1] < plVar2[1] + uVar6)) {
      FUN_1400261c0(param_3);
    }
    memmove((void *)(*param_3 + *(longlong *)*param_3 + 0x10),&DAT_14027b5c0,2);
    *(ulonglong *)*param_3 = uVar6;
    *(undefined1 *)(*param_3 + 0x10 + uVar6) = 0;
    FUN_140026390(param_3,puVar3 + 2,*puVar3);
    plVar2 = (longlong *)*param_3;
    uVar6 = *plVar2 + 1;
    if (((ulonglong)plVar2[1] < uVar6) && ((ulonglong)plVar2[1] < plVar2[1] + uVar6)) {
      FUN_1400261c0(param_3);
    }
    _Src = &DAT_14027b5c4;
LAB_140028140:
    memmove((void *)(*param_3 + *(longlong *)*param_3 + 0x10),_Src,1);
    *(ulonglong *)*param_3 = uVar6;
    *(undefined1 *)(*param_3 + 0x10 + uVar6) = 0;
  }
LAB_140028165:
  if (puVar3 != &DAT_14031fee8) {
    operator_delete__(local_28);
  }
  if (puVar4 != &DAT_14031fee8) {
    operator_delete__(local_18);
  }
  return;
}



void FUN_1400281b0(undefined8 param_1,FILE *param_2,uint param_3)

{
  ulonglong uVar1;
  
  if (0 < (int)param_3) {
    uVar1 = (ulonglong)param_3;
    do {
      fprintf(param_2,"    ");
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0);
  }
                    // WARNING: Could not recover jumptable at 0x000140028206. Too many branches
                    // WARNING: Treating indirect jump as call
  fprintf(param_2,"<!--%s-->");
  return;
}



void FUN_140028210(undefined8 param_1,longlong *param_2)

{
                    // WARNING: Could not recover jumptable at 0x00014002821c. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_2 + 0x30))(param_2,param_1);
  return;
}



undefined8 * FUN_140028220(longlong param_1)

{
  char cVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  char *pcVar4;
  char *pcVar5;
  
  puVar2 = operator_new(0x58);
  if (puVar2 == (undefined8 *)0x0) {
    return (undefined8 *)0x0;
  }
  puVar2[1] = 0xffffffffffffffff;
  uVar3 = 0xffffffffffffffff;
  puVar2[2] = 0;
  puVar2[7] = &DAT_14031fee8;
  puVar2[3] = 0;
  puVar2[5] = 0;
  puVar2[6] = 0;
  puVar2[9] = 0;
  puVar2[10] = 0;
  *(undefined4 *)(puVar2 + 4) = 2;
  *puVar2 = TiXmlComment::vftable;
  pcVar4 = (char *)(*(longlong *)(param_1 + 0x38) + 0x10);
  pcVar5 = pcVar4;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    cVar1 = *pcVar5;
    pcVar5 = pcVar5 + 1;
  } while (cVar1 != '\0');
  FUN_140026290(puVar2 + 7,pcVar4,~uVar3 - 1);
  puVar2[2] = *(undefined8 *)(param_1 + 0x10);
  return puVar2;
}



void FUN_1400282d0(longlong param_1,FILE *param_2,ulonglong param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  ulonglong uVar2;
  undefined8 *local_20;
  void *local_18;
  
  uVar2 = param_3 & 0xffffffff;
  if (*(char *)(param_1 + 0x58) == '\0') {
    local_20 = &DAT_14031fee8;
    FUN_140026830(param_1 + 0x38,&local_20,param_3,param_4,0xfffffffffffffffe);
    puVar1 = local_20;
    fprintf(param_2,"%s");
    if (puVar1 != &DAT_14031fee8) {
      operator_delete__(local_18);
    }
  }
  else {
    fprintf(param_2,"\n");
    if (0 < (int)param_3) {
      do {
        fprintf(param_2,"    ");
        uVar2 = uVar2 - 1;
      } while (uVar2 != 0);
    }
    fprintf(param_2,"<![CDATA[%s]]>\n");
  }
  return;
}



void FUN_1400283b0(undefined8 param_1,longlong *param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001400283bc. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_2 + 0x38))(param_2,param_1);
  return;
}



longlong FUN_1400283c0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  void *pvVar2;
  longlong lVar3;
  longlong lVar4;
  ulonglong uVar5;
  char *pcVar6;
  char *pcVar7;
  undefined8 uVar8;
  
  uVar8 = 0xfffffffffffffffe;
  pvVar2 = operator_new(0x60);
  if (pvVar2 == (void *)0x0) {
    lVar3 = 0;
  }
  else {
    lVar3 = FUN_140026680();
  }
  lVar4 = 0;
  if (lVar3 != 0) {
    pcVar6 = (char *)(*(longlong *)(param_1 + 0x38) + 0x10);
    uVar5 = 0xffffffffffffffff;
    pcVar7 = pcVar6;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      cVar1 = *pcVar7;
      pcVar7 = pcVar7 + 1;
    } while (cVar1 != '\0');
    FUN_140026290(lVar3 + 0x38,pcVar6,~uVar5 - 1,param_4,uVar8);
    *(undefined8 *)(lVar3 + 0x10) = *(undefined8 *)(param_1 + 0x10);
    *(undefined1 *)(lVar3 + 0x58) = *(undefined1 *)(param_1 + 0x58);
    lVar4 = lVar3;
  }
  return lVar4;
}



void FUN_140028450(longlong param_1,FILE *param_2,undefined8 param_3,longlong *param_4)

{
  longlong *plVar1;
  longlong lVar2;
  ulonglong uVar3;
  
  if (param_2 != (FILE *)0x0) {
    fprintf(param_2,"<?xml ");
  }
  if (param_4 != (longlong *)0x0) {
    plVar1 = (longlong *)*param_4;
    uVar3 = *plVar1 + 6;
    if (((ulonglong)plVar1[1] < uVar3) && ((ulonglong)plVar1[1] < plVar1[1] + uVar3)) {
      FUN_1400261c0(param_4);
    }
    memmove((void *)(*param_4 + *(longlong *)*param_4 + 0x10),"<?xml ",6);
    *(ulonglong *)*param_4 = uVar3;
    *(undefined1 *)(*param_4 + 0x10 + uVar3) = 0;
  }
  if (**(longlong **)(param_1 + 0x58) != 0) {
    if (param_2 != (FILE *)0x0) {
      fprintf(param_2,"version=\"%s\" ");
    }
    if (param_4 != (longlong *)0x0) {
      plVar1 = (longlong *)*param_4;
      uVar3 = *plVar1 + 9;
      if (((ulonglong)plVar1[1] < uVar3) && ((ulonglong)plVar1[1] < plVar1[1] + uVar3)) {
        FUN_1400261c0(param_4);
      }
      memmove((void *)(*param_4 + *(longlong *)*param_4 + 0x10),"version=\"",9);
      *(ulonglong *)*param_4 = uVar3;
      *(undefined1 *)(*param_4 + 0x10 + uVar3) = 0;
      FUN_140026390(param_4,*(undefined8 **)(param_1 + 0x58) + 2,**(undefined8 **)(param_1 + 0x58));
      plVar1 = (longlong *)*param_4;
      uVar3 = *plVar1 + 2;
      if (((ulonglong)plVar1[1] < uVar3) && ((ulonglong)plVar1[1] < plVar1[1] + uVar3)) {
        FUN_1400261c0(param_4);
      }
      memmove((void *)(*param_4 + *(longlong *)*param_4 + 0x10),&DAT_14027b61c,2);
      *(ulonglong *)*param_4 = uVar3;
      *(undefined1 *)(*param_4 + 0x10 + uVar3) = 0;
    }
  }
  if (**(longlong **)(param_1 + 0x68) != 0) {
    if (param_2 != (FILE *)0x0) {
      fprintf(param_2,"encoding=\"%s\" ");
    }
    if (param_4 != (longlong *)0x0) {
      plVar1 = (longlong *)*param_4;
      uVar3 = *plVar1 + 10;
      if (((ulonglong)plVar1[1] < uVar3) && ((ulonglong)plVar1[1] < plVar1[1] + uVar3)) {
        FUN_1400261c0(param_4);
      }
      memmove((void *)(*param_4 + *(longlong *)*param_4 + 0x10),"encoding=\"",10);
      *(ulonglong *)*param_4 = uVar3;
      *(undefined1 *)(*param_4 + 0x10 + uVar3) = 0;
      FUN_140026390(param_4,*(undefined8 **)(param_1 + 0x68) + 2,**(undefined8 **)(param_1 + 0x68));
      plVar1 = (longlong *)*param_4;
      uVar3 = *plVar1 + 2;
      if (((ulonglong)plVar1[1] < uVar3) && ((ulonglong)plVar1[1] < plVar1[1] + uVar3)) {
        FUN_1400261c0(param_4);
      }
      memmove((void *)(*param_4 + *(longlong *)*param_4 + 0x10),&DAT_14027b61c,2);
      *(ulonglong *)*param_4 = uVar3;
      *(undefined1 *)(*param_4 + 0x10 + uVar3) = 0;
    }
  }
  if (**(longlong **)(param_1 + 0x78) != 0) {
    if (param_2 != (FILE *)0x0) {
      fprintf(param_2,"standalone=\"%s\" ");
    }
    if (param_4 != (longlong *)0x0) {
      plVar1 = (longlong *)*param_4;
      uVar3 = *plVar1 + 0xc;
      if (((ulonglong)plVar1[1] < uVar3) && ((ulonglong)plVar1[1] < plVar1[1] + uVar3)) {
        FUN_1400261c0(param_4);
      }
      memmove((void *)(*param_4 + *(longlong *)*param_4 + 0x10),"standalone=\"",0xc);
      *(ulonglong *)*param_4 = uVar3;
      *(undefined1 *)(*param_4 + 0x10 + uVar3) = 0;
      FUN_140026390(param_4,*(undefined8 **)(param_1 + 0x78) + 2,**(undefined8 **)(param_1 + 0x78));
      plVar1 = (longlong *)*param_4;
      lVar2 = *plVar1;
      uVar3 = lVar2 + 2;
      if (((ulonglong)plVar1[1] < uVar3) && ((ulonglong)plVar1[1] < plVar1[1] + uVar3)) {
        FUN_1400261c0(param_4);
      }
      memmove((void *)(*param_4 + *(longlong *)*param_4 + 0x10),&DAT_14027b61c,2);
      *(ulonglong *)*param_4 = uVar3;
      *(undefined1 *)(lVar2 + 0x12 + *param_4) = 0;
    }
  }
  if (param_2 != (FILE *)0x0) {
    fprintf(param_2,"?>");
  }
  if (param_4 != (longlong *)0x0) {
    plVar1 = (longlong *)*param_4;
    lVar2 = *plVar1;
    uVar3 = lVar2 + 2;
    if (((ulonglong)plVar1[1] < uVar3) && ((ulonglong)plVar1[1] < plVar1[1] + uVar3)) {
      FUN_1400261c0(param_4);
    }
    memmove((void *)(*param_4 + *(longlong *)*param_4 + 0x10),&DAT_14027b668,2);
    *(ulonglong *)*param_4 = uVar3;
    *(undefined1 *)(lVar2 + 0x12 + *param_4) = 0;
  }
  return;
}



void FUN_140028810(longlong param_1,longlong param_2)

{
  char cVar1;
  ulonglong uVar2;
  char *pcVar3;
  char *pcVar4;
  
  uVar2 = 0xffffffffffffffff;
  pcVar3 = (char *)(*(longlong *)(param_1 + 0x38) + 0x10);
  pcVar4 = pcVar3;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + 1;
  } while (cVar1 != '\0');
  FUN_140026290(param_2 + 0x38,pcVar3,~uVar2 - 1);
  *(undefined8 *)(param_2 + 0x10) = *(undefined8 *)(param_1 + 0x10);
  FUN_140026290(param_2 + 0x58,*(undefined8 **)(param_1 + 0x58) + 2,
                **(undefined8 **)(param_1 + 0x58));
  FUN_140026290(param_2 + 0x68,*(undefined8 **)(param_1 + 0x68) + 2,
                **(undefined8 **)(param_1 + 0x68));
  FUN_140026290(param_2 + 0x78,*(undefined8 **)(param_1 + 0x78) + 2,
                **(undefined8 **)(param_1 + 0x78));
  return;
}



void FUN_1400288a0(undefined8 param_1,longlong *param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001400288ac. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_2 + 0x40))(param_2,param_1);
  return;
}



undefined8 * FUN_1400288b0(undefined8 param_1)

{
  undefined8 *puVar1;
  
  puVar1 = operator_new(0x88);
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = 0xffffffffffffffff;
    puVar1[2] = 0;
    puVar1[7] = &DAT_14031fee8;
    puVar1[3] = 0;
    puVar1[5] = 0;
    puVar1[6] = 0;
    puVar1[9] = 0;
    puVar1[10] = 0;
    *(undefined4 *)(puVar1 + 4) = 5;
    *puVar1 = TiXmlDeclaration::vftable;
    puVar1[0xb] = &DAT_14031fee8;
    puVar1[0xd] = &DAT_14031fee8;
    puVar1[0xf] = &DAT_14031fee8;
    FUN_140028810(param_1,puVar1);
    return puVar1;
  }
  return (undefined8 *)0x0;
}



void FUN_140028940(undefined8 param_1,FILE *param_2,uint param_3)

{
  ulonglong uVar1;
  
  if (0 < (int)param_3) {
    uVar1 = (ulonglong)param_3;
    do {
      fprintf(param_2,"    ");
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0);
  }
                    // WARNING: Could not recover jumptable at 0x000140028996. Too many branches
                    // WARNING: Treating indirect jump as call
  fprintf(param_2,"<%s>");
  return;
}



void FUN_1400289a0(undefined8 param_1,longlong *param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001400289ac. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_2 + 0x28))(param_2,param_1);
  return;
}



undefined8 * FUN_1400289b0(longlong param_1)

{
  char cVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  char *pcVar4;
  char *pcVar5;
  
  puVar2 = operator_new(0x58);
  if (puVar2 == (undefined8 *)0x0) {
    return (undefined8 *)0x0;
  }
  puVar2[1] = 0xffffffffffffffff;
  uVar3 = 0xffffffffffffffff;
  puVar2[2] = 0;
  puVar2[7] = &DAT_14031fee8;
  puVar2[3] = 0;
  puVar2[5] = 0;
  puVar2[6] = 0;
  puVar2[9] = 0;
  puVar2[10] = 0;
  *(undefined4 *)(puVar2 + 4) = 3;
  *puVar2 = TiXmlUnknown::vftable;
  pcVar4 = (char *)(*(longlong *)(param_1 + 0x38) + 0x10);
  pcVar5 = pcVar4;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    cVar1 = *pcVar5;
    pcVar5 = pcVar5 + 1;
  } while (cVar1 != '\0');
  FUN_140026290(puVar2 + 7,pcVar4,~uVar3 - 1);
  puVar2[2] = *(undefined8 *)(param_1 + 0x10);
  return puVar2;
}



void FUN_140028a60(undefined8 *param_1)

{
  if ((undefined8 *)param_1[6] != &DAT_14031fee8) {
    operator_delete__((void *)param_1[7]);
  }
  if ((undefined8 *)param_1[4] != &DAT_14031fee8) {
    operator_delete__((void *)param_1[5]);
  }
  *param_1 = TiXmlBase::vftable;
  return;
}



undefined4 FUN_140028ab0(byte param_1)

{
  int iVar1;
  
  iVar1 = isspace((uint)param_1);
  if (((iVar1 == 0) && (param_1 != 10)) && (param_1 != 0xd)) {
    return 0;
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140028ae0(uint param_1,longlong param_2,int *param_3)

{
  int iVar1;
  byte *pbVar2;
  byte bVar3;
  byte local_38 [32];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)local_38;
  local_38[8] = 0xc0;
  local_38[9] = 0;
  local_38[10] = 0;
  local_38[0xb] = 0;
  local_38[0xc] = 0xe0;
  local_38[0xd] = 0;
  local_38[0xe] = 0;
  local_38[0xf] = 0;
  local_38[0x10] = 0xf0;
  local_38[0x11] = 0;
  local_38[0x12] = 0;
  local_38[0x13] = 0;
  local_38[0x14] = 0xf8;
  local_38[0x15] = 0;
  local_38[0x16] = 0;
  local_38[0x17] = 0;
  local_38[0] = 0;
  local_38[1] = 0;
  local_38[2] = 0;
  local_38[3] = 0;
  local_38[4] = 0;
  local_38[5] = 0;
  local_38[6] = 0;
  local_38[7] = 0;
  local_38[0x18] = 0xfc;
  local_38[0x19] = 0;
  local_38[0x1a] = 0;
  local_38[0x1b] = 0;
  if (param_1 < 0x80) {
    *param_3 = 1;
  }
  else if (param_1 < 0x800) {
    *param_3 = 2;
  }
  else if (param_1 < 0x10000) {
    *param_3 = 3;
  }
  else {
    if (0x1fffff < param_1) {
      *param_3 = 0;
      return;
    }
    *param_3 = 4;
  }
  iVar1 = *param_3;
  pbVar2 = (byte *)(param_2 + iVar1);
  if (iVar1 != 1) {
    if (iVar1 != 2) {
      if (iVar1 != 3) {
        if (iVar1 != 4) {
          return;
        }
        bVar3 = (byte)param_1;
        pbVar2 = pbVar2 + -1;
        param_1 = param_1 >> 6;
        *pbVar2 = bVar3 & 0x3f | 0x80;
      }
      bVar3 = (byte)param_1;
      pbVar2 = pbVar2 + -1;
      param_1 = param_1 >> 6;
      *pbVar2 = bVar3 & 0x3f | 0x80;
    }
    bVar3 = (byte)param_1;
    pbVar2 = pbVar2 + -1;
    param_1 = param_1 >> 6;
    *pbVar2 = bVar3 & 0x3f | 0x80;
  }
  pbVar2[-1] = local_38[(longlong)*param_3 * 4] | (byte)param_1;
  return;
}



void FUN_140028bf0(int *param_1,byte *param_2,int param_3)

{
  byte bVar1;
  byte bVar2;
  int iVar3;
  byte *pbVar4;
  byte *pbVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  
  iVar3 = param_1[4];
  if (0 < iVar3) {
    iVar8 = *param_1;
    iVar7 = param_1[1];
    pbVar5 = *(byte **)(param_1 + 2);
joined_r0x000140028c28:
    pbVar4 = pbVar5;
    if (pbVar4 < param_2) {
      bVar1 = *pbVar4;
      if (bVar1 == 0) {
        return;
      }
      if (bVar1 == 9) {
        iVar7 = (iVar7 / iVar3 + 1) * iVar3;
        pbVar5 = pbVar4 + 1;
      }
      else {
        if (bVar1 != 10) {
          if (bVar1 == 0xd) {
            iVar8 = iVar8 + 1;
            iVar7 = 0;
            pbVar5 = pbVar4 + 1;
            if (pbVar4[1] == 10) {
              pbVar5 = pbVar4 + 2;
            }
            goto joined_r0x000140028c28;
          }
          if (bVar1 == 0xef) {
            if (param_3 == 1) {
              bVar1 = pbVar4[1];
              pbVar5 = pbVar4;
              if ((bVar1 != 0) && (bVar2 = pbVar4[2], bVar2 != 0)) {
                if ((bVar1 != 0xbb) || (bVar2 != 0xbf)) {
                  if (bVar1 == 0xbf) {
                    if (bVar2 == 0xbe) {
                      pbVar5 = pbVar4 + 3;
                      goto joined_r0x000140028c28;
                    }
                    if (bVar2 == 0xbf) {
                      pbVar5 = pbVar4 + 3;
                      goto joined_r0x000140028c28;
                    }
                  }
                  iVar7 = iVar7 + 1;
                  pbVar5 = pbVar4 + 3;
                  goto joined_r0x000140028c28;
                }
                pbVar5 = pbVar4 + 3;
              }
              goto joined_r0x000140028c28;
            }
          }
          else if (param_3 == 1) {
            iVar6 = *(int *)(&DAT_140278c20 + (ulonglong)bVar1 * 4);
            if (iVar6 == 0) {
              iVar6 = 1;
            }
            iVar7 = iVar7 + 1;
            pbVar5 = pbVar4 + iVar6;
            goto joined_r0x000140028c28;
          }
          iVar7 = iVar7 + 1;
          pbVar5 = pbVar4 + 1;
          goto joined_r0x000140028c28;
        }
        iVar8 = iVar8 + 1;
        iVar7 = 0;
        pbVar5 = pbVar4 + 1;
        if (pbVar4[1] == 0xd) {
          pbVar5 = pbVar4 + 2;
        }
      }
      goto joined_r0x000140028c28;
    }
    *param_1 = iVar8;
    param_1[1] = iVar7;
    *(byte **)(param_1 + 2) = pbVar4;
  }
  return;
}



byte * FUN_140028d40(byte *param_1,int param_2)

{
  int iVar1;
  byte bVar2;
  
  if ((param_1 == (byte *)0x0) || (bVar2 = *param_1, bVar2 == 0)) {
    return (byte *)0x0;
  }
  if (param_2 == 1) {
    do {
      if (bVar2 == 0xef) {
        if ((param_1[1] == 0xbb) && (param_1[2] == 0xbf)) {
          param_1 = param_1 + 3;
        }
        else {
          if (param_1[1] != 0xbf) goto LAB_140028da0;
          if (param_1[2] == 0xbe) {
            param_1 = param_1 + 3;
          }
          else {
            if (param_1[2] != 0xbf) goto LAB_140028da0;
            param_1 = param_1 + 3;
          }
        }
      }
      else {
LAB_140028da0:
        iVar1 = isspace((uint)bVar2);
        if ((((iVar1 == 0) && (bVar2 != 10)) && (bVar2 != 0xd)) &&
           ((*param_1 != 10 && (*param_1 != 0xd)))) {
          return param_1;
        }
        param_1 = param_1 + 1;
      }
      bVar2 = *param_1;
    } while (bVar2 != 0);
  }
  else {
    for (; ((bVar2 = *param_1, bVar2 != 0 &&
            (((iVar1 = isspace((uint)bVar2), iVar1 != 0 || (bVar2 == 10)) || (bVar2 == 0xd)))) ||
           ((*param_1 == 10 || (*param_1 == 0xd)))); param_1 = param_1 + 1) {
    }
  }
  return param_1;
}



byte * FUN_140028e20(byte *param_1,undefined8 param_2)

{
  byte bVar1;
  int iVar2;
  byte *pbVar3;
  
  FUN_140026290(param_2,&DAT_14027a10a,0);
  if (((param_1 == (byte *)0x0) || (bVar1 = *param_1, bVar1 == 0)) ||
     ((pbVar3 = param_1, bVar1 < 0x7f &&
      ((iVar2 = isalpha((uint)bVar1), iVar2 == 0 && (*param_1 != 0x5f)))))) {
    return (byte *)0x0;
  }
  do {
    bVar1 = *pbVar3;
    if ((bVar1 == 0) ||
       (((((bVar1 < 0x7f && (iVar2 = isalnum((uint)bVar1), iVar2 == 0)) &&
          (bVar1 = *pbVar3, bVar1 != 0x5f)) && ((bVar1 != 0x2d && (bVar1 != 0x2e)))) &&
        (bVar1 != 0x3a)))) break;
    pbVar3 = pbVar3 + 1;
  } while (pbVar3 != (byte *)0x0);
  if (0 < (longlong)pbVar3 - (longlong)param_1) {
    FUN_140026290(param_2,param_1);
  }
  return pbVar3;
}



char * FUN_140028ee0(char *param_1,char *param_2,undefined4 *param_3,int param_4)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  int iVar4;
  int iVar5;
  undefined **ppuVar6;
  longlong lVar7;
  char *pcVar8;
  
  cVar1 = param_1[1];
  iVar4 = 0;
  *param_3 = 0;
  if ((cVar1 != '\0') && (cVar1 == '#')) {
    if (param_1[2] != '\0') {
      iVar5 = 1;
      if (param_1[2] == 'x') {
        if (((param_1[3] != '\0') && (pcVar3 = strchr(param_1 + 3,0x3b), pcVar3 != (char *)0x0)) &&
           (*pcVar3 != '\0')) {
          pcVar8 = pcVar3 + -1;
          lVar7 = (longlong)pcVar3 - (longlong)param_1;
          cVar1 = *pcVar8;
          while (cVar1 != 'x') {
            if ((cVar1 < '0') || ('9' < cVar1)) {
              if ((cVar1 < 'a') || ('f' < cVar1)) {
                if (cVar1 < 'A') {
                  return (char *)0x0;
                }
                if ('F' < cVar1) {
                  return (char *)0x0;
                }
                iVar2 = cVar1 + -0x37;
              }
              else {
                iVar2 = cVar1 + -0x57;
              }
            }
            else {
              iVar2 = cVar1 + -0x30;
            }
            iVar2 = iVar2 * iVar5;
            pcVar8 = pcVar8 + -1;
            iVar5 = iVar5 << 4;
            iVar4 = iVar4 + iVar2;
            cVar1 = *pcVar8;
          }
LAB_140029010:
          if (param_4 != 1) {
            *param_2 = (char)iVar4;
            *param_3 = 1;
            return param_1 + lVar7 + 1;
          }
          FUN_140028ae0(iVar4,param_2,param_3);
          return param_1 + lVar7 + 1;
        }
      }
      else {
        pcVar3 = strchr(param_1 + 2,0x3b);
        if ((pcVar3 != (char *)0x0) && (*pcVar3 != '\0')) {
          pcVar8 = pcVar3 + -1;
          lVar7 = (longlong)pcVar3 - (longlong)param_1;
          cVar1 = *pcVar8;
          while (cVar1 != '#') {
            if (cVar1 < '0') {
              return (char *)0x0;
            }
            if ('9' < cVar1) {
              return (char *)0x0;
            }
            pcVar8 = pcVar8 + -1;
            iVar4 = iVar4 + (cVar1 + -0x30) * iVar5;
            iVar5 = iVar5 * 10;
            cVar1 = *pcVar8;
          }
          goto LAB_140029010;
        }
      }
      return (char *)0x0;
    }
  }
  ppuVar6 = &PTR_s__amp__140312800;
  do {
    iVar5 = strncmp(*ppuVar6,param_1,(ulonglong)*(uint *)(ppuVar6 + 1));
    if (iVar5 == 0) {
      *param_3 = 1;
      *param_2 = (&DAT_14031280c)[(longlong)iVar4 * 0x10];
      return param_1 + (uint)(&DAT_140312808)[(longlong)iVar4 * 4];
    }
    ppuVar6 = ppuVar6 + 2;
    iVar4 = iVar4 + 1;
  } while ((longlong)ppuVar6 < 0x140312850);
  *param_2 = *param_1;
  return param_1 + 1;
}



undefined8 FUN_1400290d0(char *param_1,char *param_2,char param_3,int param_4)

{
  char cVar1;
  int _C;
  undefined8 uVar2;
  int _C_00;
  longlong lVar3;
  
  if ((param_1 == (char *)0x0) || (*param_1 == '\0')) {
    return 0;
  }
  if (param_3 == '\0') {
    do {
      if (*param_2 == '\0') goto LAB_140029150;
      if (*param_1 != *param_2) break;
      param_1 = param_1 + 1;
      param_2 = param_2 + 1;
    } while (*param_1 != '\0');
    cVar1 = *param_2;
  }
  else {
    lVar3 = (longlong)param_1 - (longlong)param_2;
    do {
      if (*param_2 == '\0') goto LAB_140029150;
      _C_00 = (int)param_2[lVar3];
      if ((param_4 != 1) || (_C_00 < 0x80)) {
        _C_00 = tolower(_C_00);
      }
      _C = (int)*param_2;
      if ((param_4 != 1) || (_C < 0x80)) {
        _C = tolower(_C);
      }
    } while ((_C_00 == _C) && (param_2 = param_2 + 1, param_2[lVar3] != '\0'));
    cVar1 = *param_2;
  }
  if (cVar1 == '\0') {
LAB_140029150:
    uVar2 = 1;
  }
  else {
    uVar2 = 0;
  }
  return uVar2;
}



byte * FUN_1400291a0(byte *param_1,longlong *param_2,char param_3,char *param_4,int param_5)

{
  byte bVar1;
  longlong *plVar2;
  bool bVar3;
  char cVar4;
  int iVar5;
  byte *pbVar6;
  ulonglong uVar7;
  size_t sVar8;
  int local_res8 [2];
  uint local_res18 [2];
  char *local_res20;
  
  local_res20 = param_4;
  FUN_140026290(param_2,&DAT_14027a10a,0);
  if ((param_3 == '\0') || (DAT_1403100dc == '\0')) {
    while (param_1 != (byte *)0x0) {
      if ((*param_1 == 0) || (cVar4 = FUN_1400290d0(param_1,param_4,0,param_5), cVar4 != '\0'))
      goto LAB_1400294a2;
      local_res18[0] = 0;
      if (param_5 == 1) {
        local_res8[0] = *(int *)(&DAT_140278c20 + (ulonglong)*param_1 * 4);
        if (local_res8[0] == 1) goto LAB_14002941a;
        if (local_res8[0] == 0) {
          param_1 = (byte *)0x0;
        }
        else {
          iVar5 = 0;
          if (*param_1 != 0) {
            pbVar6 = param_1;
            do {
              if (local_res8[0] <= iVar5) break;
              bVar1 = *pbVar6;
              pbVar6 = pbVar6 + 1;
              iVar5 = iVar5 + 1;
              pbVar6[(longlong)(&stack0x00000017 + -(longlong)param_1)] = bVar1;
            } while (*pbVar6 != 0);
          }
          param_1 = param_1 + local_res8[0];
        }
      }
      else {
        local_res8[0] = 1;
LAB_14002941a:
        if (*param_1 == 0x26) {
          param_1 = (byte *)FUN_140028ee0(param_1,local_res18,local_res8,param_5);
        }
        else {
          local_res18[0] = (uint)*param_1;
          param_1 = param_1 + 1;
        }
      }
      plVar2 = (longlong *)*param_2;
      sVar8 = (size_t)local_res8[0];
      uVar7 = sVar8 + *plVar2;
      if (((ulonglong)plVar2[1] < uVar7) && ((ulonglong)plVar2[1] < plVar2[1] + uVar7)) {
        FUN_1400261c0(param_2);
      }
      memmove((void *)(*(longlong *)*param_2 + 0x10 + *param_2),local_res18,sVar8);
      *(ulonglong *)*param_2 = uVar7;
      *(undefined1 *)(*param_2 + 0x10 + uVar7) = 0;
      param_4 = local_res20;
    }
  }
  else {
    bVar3 = false;
    param_1 = (byte *)FUN_140028d40(param_1,param_5);
    if (param_1 == (byte *)0x0) {
      return (byte *)0x0;
    }
    do {
      if ((*param_1 == 0) || (cVar4 = FUN_1400290d0(param_1,param_4,0,param_5), cVar4 != '\0'))
      goto LAB_1400294a2;
      bVar1 = *param_1;
      if ((((bVar1 == 0xd) || (bVar1 == 10)) || (iVar5 = isspace((uint)bVar1), iVar5 != 0)) ||
         ((bVar1 == 10 || (bVar1 == 0xd)))) {
        param_1 = param_1 + 1;
        bVar3 = true;
      }
      else {
        if (bVar3) {
          FUN_140026410(param_2);
          bVar3 = false;
        }
        local_res18[0] = 0;
        if (param_5 == 1) {
          local_res8[0] = *(int *)(&DAT_140278c20 + (ulonglong)*param_1 * 4);
          if (local_res8[0] == 1) goto LAB_1400292dd;
          if (local_res8[0] != 0) {
            iVar5 = 0;
            if (*param_1 != 0) {
              pbVar6 = param_1;
              do {
                if (local_res8[0] <= iVar5) break;
                bVar1 = *pbVar6;
                pbVar6 = pbVar6 + 1;
                iVar5 = iVar5 + 1;
                pbVar6[(longlong)(&stack0x00000017 + -(longlong)param_1)] = bVar1;
              } while (*pbVar6 != 0);
            }
            param_1 = param_1 + local_res8[0];
            goto LAB_1400292fd;
          }
          param_1 = (byte *)0x0;
LAB_140029302:
          plVar2 = (longlong *)*param_2;
          sVar8 = (size_t)local_res8[0];
          uVar7 = sVar8 + *plVar2;
          if (((ulonglong)plVar2[1] < uVar7) && ((ulonglong)plVar2[1] < plVar2[1] + uVar7)) {
            FUN_1400261c0(param_2);
          }
          memmove((void *)(*(longlong *)*param_2 + 0x10 + *param_2),local_res18,sVar8);
          *(ulonglong *)*param_2 = uVar7;
          *(undefined1 *)(*param_2 + 0x10 + uVar7) = 0;
          param_4 = local_res20;
        }
        else {
          local_res8[0] = 1;
LAB_1400292dd:
          if (*param_1 == 0x26) {
            param_1 = (byte *)FUN_140028ee0(param_1,local_res18,local_res8,param_5);
LAB_1400292fd:
            if (local_res8[0] != 1) goto LAB_140029302;
          }
          else {
            local_res18[0] = (uint)*param_1;
            param_1 = param_1 + 1;
          }
          FUN_140026410(param_2,(undefined1)local_res18[0]);
        }
      }
    } while (param_1 != (byte *)0x0);
  }
  return (byte *)0x0;
LAB_1400294a2:
  uVar7 = 0xffffffffffffffff;
  do {
    if (uVar7 == 0) break;
    uVar7 = uVar7 - 1;
    cVar4 = *param_4;
    param_4 = param_4 + 1;
  } while (cVar4 != '\0');
  return param_1 + (~uVar7 - 1);
}



char * FUN_1400294c0(longlong param_1,char *param_2,undefined4 *param_3,int param_4)

{
  char cVar1;
  int iVar2;
  int iVar3;
  char *pcVar4;
  longlong *plVar5;
  undefined8 uVar6;
  longlong lVar7;
  ulonglong uVar8;
  undefined4 local_48;
  undefined4 uStack_44;
  char *local_40;
  undefined4 local_38;
  
  *(undefined1 *)(param_1 + 0x58) = 0;
  *(undefined4 *)(param_1 + 0x5c) = 0;
  FUN_140026290(param_1 + 0x60,&DAT_14027a10a,0);
  *(undefined8 *)(param_1 + 0x74) = 0;
  if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
    *(undefined8 *)(param_1 + 8) = 0xffffffffffffffff;
    if (param_3 == (undefined4 *)0x0) {
      *(undefined8 *)(param_1 + 8) = 0;
    }
    else {
      *(undefined4 *)(param_1 + 8) = *param_3;
      *(undefined4 *)(param_1 + 0xc) = param_3[1];
    }
    local_38 = *(undefined4 *)(param_1 + 0x70);
    local_48 = *(undefined4 *)(param_1 + 8);
    uStack_44 = *(undefined4 *)(param_1 + 0xc);
    *(undefined8 *)(param_1 + 8) = *(undefined8 *)(param_1 + 8);
    if (((((param_4 == 0) && (*param_2 != '\0')) && (*param_2 == -0x11)) &&
        ((param_2[1] != '\0' && (param_2[1] == -0x45)))) &&
       ((param_2[2] != '\0' && (param_2[2] == -0x41)))) {
      param_4 = 1;
      *(undefined1 *)(param_1 + 0x7c) = 1;
    }
    local_40 = param_2;
    pcVar4 = (char *)FUN_140028d40(param_2,param_4);
    if (pcVar4 != (char *)0x0) {
      do {
        if ((*pcVar4 == '\0') ||
           (plVar5 = (longlong *)FUN_1400297e0(param_1,pcVar4,param_4), plVar5 == (longlong *)0x0))
        break;
        uVar6 = (**(code **)(*plVar5 + 0x10))(plVar5,pcVar4,&local_48,param_4);
        FUN_140026be0(param_1,plVar5);
        if ((param_4 == 0) && (lVar7 = (**(code **)(*plVar5 + 0x68))(plVar5), lVar7 != 0)) {
          lVar7 = (**(code **)(*plVar5 + 0x68))(plVar5);
          lVar7 = *(longlong *)(lVar7 + 0x68);
          if (*(char *)(lVar7 + 0x10) != '\0') {
            pcVar4 = "UTF-8";
            do {
              if (*pcVar4 == '\0') goto LAB_1400296aa;
              iVar2 = tolower((int)pcVar4[lVar7 + -0x14027ba68]);
              iVar3 = tolower((int)*pcVar4);
            } while ((iVar2 == iVar3) && (pcVar4 = pcVar4 + 1, pcVar4[lVar7 + -0x14027ba68] != '\0')
                    );
            if (*pcVar4 != '\0') {
              pcVar4 = "UTF8";
              if (*(char *)(lVar7 + 0x10) != '\0') {
                do {
                  if (*pcVar4 == '\0') goto LAB_1400296aa;
                  iVar2 = tolower((int)pcVar4[lVar7 + -0x14027ba70]);
                  iVar3 = tolower((int)*pcVar4);
                } while ((iVar2 == iVar3) &&
                        (pcVar4 = pcVar4 + 1, pcVar4[lVar7 + -0x14027ba70] != '\0'));
                if (*pcVar4 == '\0') goto LAB_1400296aa;
              }
              param_4 = 2;
              goto LAB_1400296af;
            }
          }
LAB_1400296aa:
          param_4 = 1;
        }
LAB_1400296af:
        pcVar4 = (char *)FUN_140028d40(uVar6,param_4);
      } while (pcVar4 != (char *)0x0);
      if (*(longlong *)(param_1 + 0x28) != 0) {
        return pcVar4;
      }
      cVar1 = *(char *)(param_1 + 0x58);
      goto LAB_1400296e9;
    }
  }
  cVar1 = *(char *)(param_1 + 0x58);
LAB_1400296e9:
  if (cVar1 == '\0') {
    uVar8 = 0xffffffffffffffff;
    *(undefined1 *)(param_1 + 0x58) = 1;
    *(undefined4 *)(param_1 + 0x5c) = 0xd;
    pcVar4 = PTR_s_Error_document_empty__1403127d8;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar1 = *pcVar4;
      pcVar4 = pcVar4 + 1;
    } while (cVar1 != '\0');
    FUN_140026290(param_1 + 0x60,PTR_s_Error_document_empty__1403127d8,~uVar8 - 1);
    *(undefined8 *)(param_1 + 0x74) = 0xffffffffffffffff;
  }
  return (char *)0x0;
}



void FUN_140029740(longlong param_1,int param_2,longlong param_3,undefined8 *param_4,
                  undefined4 param_5)

{
  char cVar1;
  ulonglong uVar2;
  char *pcVar3;
  
  if (*(char *)(param_1 + 0x58) == '\0') {
    *(int *)(param_1 + 0x5c) = param_2;
    *(undefined1 *)(param_1 + 0x58) = 1;
    uVar2 = 0xffffffffffffffff;
    pcVar3 = (&PTR_s_No_error_140312770)[param_2];
    do {
      if (uVar2 == 0) break;
      uVar2 = uVar2 - 1;
      cVar1 = *pcVar3;
      pcVar3 = pcVar3 + 1;
    } while (cVar1 != '\0');
    FUN_140026290(param_1 + 0x60,(&PTR_s_No_error_140312770)[param_2],~uVar2 - 1);
    *(undefined8 *)(param_1 + 0x74) = 0xffffffffffffffff;
    if ((param_3 != 0) && (param_4 != (undefined8 *)0x0)) {
      FUN_140028bf0(param_4,param_3,param_5);
      *(undefined8 *)(param_1 + 0x74) = *param_4;
    }
  }
  return;
}



undefined8 *
FUN_1400297e0(undefined8 param_1,undefined8 param_2,ulonglong param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  longlong lVar4;
  undefined8 *puVar5;
  char *pcVar6;
  void *pvVar7;
  ulonglong uVar8;
  
  pcVar3 = (char *)FUN_140028d40(param_2,param_3 & 0xffffffff,param_3,param_4,0xfffffffffffffffe);
  if (((pcVar3 == (char *)0x0) || (*pcVar3 == '\0')) || (*pcVar3 != '<')) {
    return (undefined8 *)0x0;
  }
  lVar4 = FUN_1400264c0(param_1);
  pcVar3 = (char *)FUN_140028d40(pcVar3,param_3 & 0xffffffff);
  if (pcVar3 == (char *)0x0) {
    return (undefined8 *)0x0;
  }
  if (*pcVar3 == '\0') {
    return (undefined8 *)0x0;
  }
  cVar1 = FUN_1400290d0(pcVar3,&DAT_14027ba88,1,param_3 & 0xffffffff);
  if (cVar1 == '\0') {
    pcVar6 = "<!--";
    cVar1 = *pcVar3;
    if (cVar1 != '\0') {
      do {
        if (*pcVar6 == '\0') goto LAB_14002990b;
      } while (((pcVar3 + -0x14027b690)[(longlong)pcVar6] == *pcVar6) &&
              (pcVar6 = pcVar6 + 1, (pcVar3 + -0x14027b690)[(longlong)pcVar6] != '\0'));
      if (*pcVar6 == '\0') {
LAB_14002990b:
        puVar5 = operator_new(0x58);
        if (puVar5 != (undefined8 *)0x0) {
          puVar5[1] = 0xffffffffffffffff;
          puVar5[2] = 0;
          puVar5[7] = &DAT_14031fee8;
          puVar5[3] = 0;
          *(undefined4 *)(puVar5 + 4) = 2;
          puVar5[5] = 0;
          puVar5[6] = 0;
          puVar5[9] = 0;
          puVar5[10] = 0;
          *puVar5 = TiXmlComment::vftable;
          goto LAB_140029a85;
        }
        goto LAB_140029a3d;
      }
    }
    pcVar6 = "<![CDATA[";
    if (cVar1 != '\0') {
      do {
        if (*pcVar6 == '\0') goto LAB_140029991;
      } while (((pcVar3 + -0x14027b680)[(longlong)pcVar6] == *pcVar6) &&
              (pcVar6 = pcVar6 + 1, (pcVar3 + -0x14027b680)[(longlong)pcVar6] != '\0'));
      if (*pcVar6 == '\0') {
LAB_140029991:
        pvVar7 = operator_new(0x60);
        puVar5 = (undefined8 *)0x0;
        if (pvVar7 != (void *)0x0) {
          puVar5 = (undefined8 *)FUN_140026680();
        }
        *(undefined1 *)(puVar5 + 0xb) = 1;
        goto LAB_140029a85;
      }
    }
    pcVar6 = "<!";
    if (cVar1 == '\0') {
LAB_140029a43:
      if (((0x7e < (byte)pcVar3[1]) || (iVar2 = isalpha((uint)(byte)pcVar3[1]), iVar2 != 0)) ||
         (pcVar3[1] == '_')) {
        pvVar7 = operator_new(0xa8);
        puVar5 = (undefined8 *)0x0;
        if (pvVar7 != (void *)0x0) {
          puVar5 = (undefined8 *)FUN_140026de0(pvVar7,&DAT_14027a10a);
        }
        goto LAB_140029a85;
      }
    }
    else {
      do {
        if (*pcVar6 == '\0') goto LAB_1400299ea;
      } while ((pcVar6[(longlong)(pcVar3 + -0x14027ba90)] == *pcVar6) &&
              (pcVar6 = pcVar6 + 1, pcVar6[(longlong)(pcVar3 + -0x14027ba90)] != '\0'));
      if (*pcVar6 != '\0') goto LAB_140029a43;
    }
LAB_1400299ea:
    puVar5 = operator_new(0x58);
    if (puVar5 != (undefined8 *)0x0) {
      puVar5[1] = 0xffffffffffffffff;
      puVar5[2] = 0;
      puVar5[7] = &DAT_14031fee8;
      puVar5[3] = 0;
      *(undefined4 *)(puVar5 + 4) = 3;
      puVar5[5] = 0;
      puVar5[6] = 0;
      puVar5[9] = 0;
      puVar5[10] = 0;
      *puVar5 = TiXmlUnknown::vftable;
      goto LAB_140029a85;
    }
  }
  else {
    puVar5 = operator_new(0x88);
    if (puVar5 != (undefined8 *)0x0) {
      puVar5[1] = 0xffffffffffffffff;
      puVar5[2] = 0;
      puVar5[7] = &DAT_14031fee8;
      puVar5[3] = 0;
      *(undefined4 *)(puVar5 + 4) = 5;
      puVar5[5] = 0;
      puVar5[6] = 0;
      puVar5[9] = 0;
      puVar5[10] = 0;
      *puVar5 = TiXmlDeclaration::vftable;
      puVar5[0xb] = &DAT_14031fee8;
      puVar5[0xd] = &DAT_14031fee8;
      puVar5[0xf] = &DAT_14031fee8;
      goto LAB_140029a85;
    }
  }
LAB_140029a3d:
  puVar5 = (undefined8 *)0x0;
LAB_140029a85:
  if (puVar5 != (undefined8 *)0x0) {
    puVar5[3] = param_1;
    return puVar5;
  }
  if (lVar4 == 0) {
    return (undefined8 *)0x0;
  }
  if (*(char *)(lVar4 + 0x58) != '\0') {
    return (undefined8 *)0x0;
  }
  *(undefined1 *)(lVar4 + 0x58) = 1;
  *(undefined4 *)(lVar4 + 0x5c) = 3;
  uVar8 = 0xffffffffffffffff;
  pcVar3 = PTR_s_Memory_allocation_failed__140312788;
  do {
    if (uVar8 == 0) break;
    uVar8 = uVar8 - 1;
    cVar1 = *pcVar3;
    pcVar3 = pcVar3 + 1;
  } while (cVar1 != '\0');
  FUN_140026290(lVar4 + 0x60,PTR_s_Memory_allocation_failed__140312788,~uVar8 - 1);
  *(undefined8 *)(lVar4 + 0x74) = 0xffffffffffffffff;
  return (undefined8 *)0x0;
}



char * FUN_140029af0(longlong *param_1,undefined8 param_2,longlong *param_3,undefined4 param_4)

{
  ulonglong uVar1;
  char cVar2;
  char cVar3;
  size_t sVar4;
  size_t sVar5;
  longlong *plVar6;
  undefined1 auVar7 [16];
  undefined1 auVar8 [16];
  char *pcVar9;
  longlong lVar10;
  undefined8 uVar11;
  __uint64 _Var12;
  size_t *psVar13;
  char *pcVar14;
  longlong *plVar15;
  size_t *psVar16;
  ulonglong uVar17;
  longlong lVar18;
  size_t *psVar19;
  size_t *local_res10;
  size_t *local_60;
  size_t *local_50;
  
  pcVar9 = (char *)FUN_140028d40(param_2,param_4);
  for (plVar15 = param_1; plVar15 != (longlong *)0x0; plVar15 = (longlong *)plVar15[3]) {
    lVar10 = (**(code **)(*plVar15 + 0x20))(plVar15);
    if (lVar10 != 0) {
      lVar10 = (**(code **)(*plVar15 + 0x20))(plVar15);
      goto LAB_140029b6a;
    }
  }
  lVar10 = 0;
LAB_140029b6a:
  if ((pcVar9 == (char *)0x0) || (*pcVar9 == '\0')) {
    if (lVar10 == 0) {
      return (char *)0x0;
    }
    if (*(char *)(lVar10 + 0x58) != '\0') {
      return (char *)0x0;
    }
    *(undefined1 *)(lVar10 + 0x58) = 1;
    *(undefined4 *)(lVar10 + 0x5c) = 4;
    uVar17 = 0xffffffffffffffff;
    pcVar9 = PTR_s_Error_parsing_Element__140312790;
    do {
      if (uVar17 == 0) break;
      uVar17 = uVar17 - 1;
      cVar2 = *pcVar9;
      pcVar9 = pcVar9 + 1;
    } while (cVar2 != '\0');
    FUN_140026290(lVar10 + 0x60,PTR_s_Error_parsing_Element__140312790,~uVar17 - 1);
    *(undefined4 *)(lVar10 + 0x78) = 0xffffffff;
    *(undefined4 *)(lVar10 + 0x74) = 0xffffffff;
    return (char *)0x0;
  }
  if (param_3 != (longlong *)0x0) {
    FUN_140028bf0(param_3,pcVar9,param_4);
    param_1[1] = *param_3;
  }
  if (*pcVar9 != '<') {
    if (lVar10 == 0) {
      return (char *)0x0;
    }
    FUN_140029740(lVar10,4,pcVar9,param_3,param_4);
    return (char *)0x0;
  }
  uVar11 = FUN_140028d40(pcVar9 + 1,param_4);
  pcVar9 = (char *)FUN_140028e20(uVar11,param_1 + 7);
  if ((pcVar9 == (char *)0x0) || (*pcVar9 == '\0')) {
    if (lVar10 == 0) {
      return (char *)0x0;
    }
    FUN_140029740(lVar10,5,uVar11,param_3,param_4);
    return (char *)0x0;
  }
  _Var12 = SUB168(ZEXT816(4) * ZEXT816(7),0);
  if (SUB168(ZEXT816(4) * ZEXT816(7),8) != 0) {
    _Var12 = 0xffffffffffffffff;
  }
  psVar13 = operator_new(_Var12);
  *psVar13 = 2;
  *(undefined1 *)((longlong)psVar13 + 0x12) = 0;
  psVar13[1] = 2;
  memcpy(psVar13 + 2,&DAT_14027b678,*psVar13);
  psVar19 = (size_t *)param_1[7];
  sVar4 = *psVar19;
  uVar17 = *psVar13 + sVar4;
  local_res10 = psVar13;
  local_60 = psVar13;
  if ((psVar13[1] < uVar17) && (uVar1 = psVar13[1] + uVar17, psVar13[1] < uVar1)) {
    sVar5 = *psVar13;
    if (uVar1 == 0) {
      local_res10 = &DAT_14031fee8;
      local_60 = local_50;
    }
    else {
      auVar7._8_8_ = 0;
      auVar7._0_8_ = uVar1 + 0x1b >> 2;
      _Var12 = SUB168(ZEXT816(4) * auVar7,0);
      if (SUB168(ZEXT816(4) * auVar7,8) != 0) {
        _Var12 = 0xffffffffffffffff;
      }
      local_res10 = operator_new(_Var12);
      *local_res10 = sVar5;
      *(undefined1 *)((longlong)local_res10 + sVar5 + 0x10) = 0;
      local_res10[1] = uVar1;
      local_60 = local_res10;
    }
    memcpy(local_res10 + 2,psVar13 + 2,*psVar13);
    if (psVar13 != &DAT_14031fee8) {
      operator_delete__(psVar13);
    }
  }
  memmove((void *)(*local_res10 + 0x10 + (longlong)local_res10),psVar19 + 2,sVar4);
  *local_res10 = uVar17;
  *(undefined1 *)((longlong)local_res10 + uVar17 + 0x10) = 0;
  sVar4 = *local_res10;
  uVar17 = sVar4 + 1;
  psVar19 = local_60;
  psVar13 = local_res10;
  if ((local_res10[1] < uVar17) && (uVar1 = local_res10[1] + uVar17, local_res10[1] < uVar1)) {
    sVar5 = *local_res10;
    if (uVar1 == 0) {
      psVar13 = &DAT_14031fee8;
    }
    else {
      auVar8._8_8_ = 0;
      auVar8._0_8_ = uVar1 + 0x1b >> 2;
      _Var12 = SUB168(ZEXT816(4) * auVar8,0);
      if (SUB168(ZEXT816(4) * auVar8,8) != 0) {
        _Var12 = 0xffffffffffffffff;
      }
      psVar13 = operator_new(_Var12);
      *psVar13 = sVar5;
      *(undefined1 *)((longlong)psVar13 + sVar5 + 0x10) = 0;
      psVar13[1] = uVar1;
      local_50 = psVar13;
    }
    memcpy(psVar13 + 2,local_res10 + 2,*local_res10);
    psVar19 = local_50;
    if (local_res10 != &DAT_14031fee8) {
      operator_delete__(local_60);
    }
  }
  memmove((void *)(*psVar13 + 0x10 + (longlong)psVar13),&DAT_14027b5a4,1);
  *psVar13 = uVar17;
  *(undefined1 *)(sVar4 + 0x11 + (longlong)psVar13) = 0;
  while( true ) {
    if (*pcVar9 == '\0') {
      if (psVar13 != &DAT_14031fee8) {
        operator_delete__(psVar19);
        return pcVar9;
      }
      return pcVar9;
    }
    pcVar14 = (char *)FUN_140028d40(pcVar9,param_4);
    if ((pcVar14 == (char *)0x0) || (cVar2 = *pcVar14, cVar2 == '\0')) {
      if (lVar10 != 0) {
        FUN_140029740(lVar10,7,pcVar9,param_3,param_4);
      }
      goto LAB_140029f94;
    }
    if (cVar2 == '/') {
      if (pcVar14[1] == '>') {
        if (psVar13 != &DAT_14031fee8) {
          operator_delete__(psVar19);
        }
        return pcVar14 + 2;
      }
      if (lVar10 != 0) {
        FUN_140029740(lVar10,8,pcVar14 + 1,param_3,param_4);
      }
      goto LAB_140029f94;
    }
    if (cVar2 == '>') break;
    plVar15 = operator_new(0x50);
    if (plVar15 == (longlong *)0x0) {
      if (lVar10 != 0) {
        FUN_140029740(lVar10,3,pcVar9,param_3,param_4);
      }
      goto LAB_140029f94;
    }
    *(undefined4 *)((longlong)plVar15 + 0xc) = 0xffffffff;
    *(undefined4 *)(plVar15 + 1) = 0xffffffff;
    plVar15[2] = 0;
    *plVar15 = (longlong)TiXmlAttribute::vftable;
    plVar15[4] = (longlong)&DAT_14031fee8;
    plVar15[6] = (longlong)&DAT_14031fee8;
    plVar15[9] = 0;
    plVar15[8] = 0;
    plVar15[3] = lVar10;
    pcVar9 = (char *)(**(code **)(*plVar15 + 0x10))(plVar15,pcVar14,param_3,param_4);
    if ((pcVar9 == (char *)0x0) || (*pcVar9 == '\0')) {
      if (lVar10 != 0) {
        FUN_140029740(lVar10,4,pcVar14,param_3,param_4);
      }
      (**(code **)*plVar15)(plVar15,1);
      goto LAB_140029f94;
    }
    for (plVar6 = (longlong *)param_1[0x14]; plVar6 != param_1 + 0xb; plVar6 = (longlong *)plVar6[9]
        ) {
      pcVar14 = (char *)(plVar6[4] + 0x10);
      lVar18 = (plVar15[4] + 0x10) - (longlong)pcVar14;
      do {
        cVar2 = *pcVar14;
        cVar3 = pcVar14[lVar18];
        if (cVar2 != cVar3) break;
        pcVar14 = pcVar14 + 1;
      } while (cVar3 != '\0');
      if (cVar2 == cVar3) {
        if (plVar6 != (longlong *)0x0) {
          uVar17 = 0xffffffffffffffff;
          pcVar9 = (char *)(plVar15[6] + 0x10);
          goto code_r0x000140029f74;
        }
        break;
      }
    }
    plVar15[9] = (longlong)(param_1 + 0xb);
    plVar15[8] = param_1[0x13];
    *(longlong **)(param_1[0x13] + 0x48) = plVar15;
    param_1[0x13] = (longlong)plVar15;
  }
  pcVar9 = (char *)FUN_14002a1b0(param_1,pcVar14 + 1,param_3,param_4);
  if ((pcVar9 == (char *)0x0) || (*pcVar9 == '\0')) {
    if (lVar10 != 0) {
      FUN_140029740(lVar10,9,pcVar9,param_3,param_4);
    }
  }
  else {
    psVar16 = psVar13 + 2;
    lVar18 = (longlong)pcVar9 - (longlong)psVar16;
    do {
      if ((char)*psVar16 == '\0') goto LAB_14002a069;
    } while ((*(char *)(lVar18 + (longlong)psVar16) == (char)*psVar16) &&
            (psVar16 = (size_t *)((longlong)psVar16 + 1),
            *(char *)(lVar18 + (longlong)psVar16) != '\0'));
    if ((char)*psVar16 == '\0') {
LAB_14002a069:
      sVar4 = *psVar13;
      if (psVar13 != &DAT_14031fee8) {
        operator_delete__(psVar19);
        return pcVar9 + sVar4;
      }
      return pcVar9 + sVar4;
    }
    if (lVar10 != 0) {
      FUN_140029740(lVar10,9,pcVar9,param_3,param_4);
    }
  }
  goto LAB_140029f94;
  while( true ) {
    uVar17 = uVar17 - 1;
    cVar2 = *pcVar9;
    pcVar9 = pcVar9 + 1;
    if (cVar2 == '\0') break;
code_r0x000140029f74:
    if (uVar17 == 0) break;
  }
  FUN_140026290(plVar6 + 6,(char *)(plVar15[6] + 0x10),~uVar17 - 1);
  (**(code **)*plVar15)(plVar15,1);
LAB_140029f94:
  if (psVar13 != &DAT_14031fee8) {
    operator_delete__(psVar19);
  }
  return (char *)0x0;
}



char * FUN_14002a1b0(longlong *param_1,char *param_2,undefined8 param_3,undefined4 param_4)

{
  char cVar1;
  byte bVar2;
  int iVar3;
  longlong lVar4;
  char *pcVar5;
  longlong *plVar6;
  char *pcVar7;
  longlong *plVar8;
  ulonglong uVar9;
  longlong *plVar10;
  
  for (plVar10 = param_1; plVar10 != (longlong *)0x0; plVar10 = (longlong *)plVar10[3]) {
    lVar4 = (**(code **)(*plVar10 + 0x20))(plVar10);
    if (lVar4 != 0) {
      lVar4 = (**(code **)(*plVar10 + 0x20))(plVar10);
      goto LAB_14002a21d;
    }
  }
  lVar4 = 0;
LAB_14002a21d:
  pcVar5 = (char *)FUN_140028d40(param_2,param_4);
  while (pcVar5 != (char *)0x0) {
    plVar10 = (longlong *)0x0;
    if (*pcVar5 == '\0') {
      return pcVar5;
    }
    if (*pcVar5 == '<') {
      pcVar7 = "</";
      do {
        if (*pcVar7 == '\0') {
          return pcVar5;
        }
      } while (((pcVar5 + -0x14027b678)[(longlong)pcVar7] == *pcVar7) &&
              (pcVar7 = pcVar7 + 1, (pcVar5 + -0x14027b678)[(longlong)pcVar7] != '\0'));
      if (*pcVar7 == '\0') {
        return pcVar5;
      }
      plVar8 = (longlong *)FUN_1400297e0(param_1,pcVar5,param_4);
      if (plVar8 == (longlong *)0x0) {
        return (char *)0x0;
      }
      param_2 = (char *)(**(code **)(*plVar8 + 0x10))(plVar8,pcVar5,param_3,param_4);
LAB_14002a3a0:
      FUN_140026be0(param_1,plVar8);
    }
    else {
      plVar6 = operator_new(0x60);
      plVar8 = plVar10;
      if (plVar6 != (longlong *)0x0) {
        plVar6[1] = -1;
        plVar6[2] = 0;
        plVar6[7] = (longlong)&DAT_14031fee8;
        plVar6[3] = 0;
        *(undefined4 *)(plVar6 + 4) = 4;
        plVar6[5] = 0;
        plVar6[6] = 0;
        plVar6[9] = 0;
        plVar6[10] = 0;
        *plVar6 = (longlong)TiXmlText::vftable;
        FUN_140026290(plVar6 + 7,&DAT_14027a10a,0);
        *(undefined1 *)(plVar6 + 0xb) = 0;
        plVar8 = plVar6;
      }
      if (plVar8 == (longlong *)0x0) {
        if (lVar4 == 0) {
          return (char *)0x0;
        }
        if (*(char *)(lVar4 + 0x58) != '\0') {
          return (char *)0x0;
        }
        *(undefined1 *)(lVar4 + 0x58) = 1;
        *(undefined4 *)(lVar4 + 0x5c) = 3;
        uVar9 = 0xffffffffffffffff;
        pcVar5 = PTR_s_Memory_allocation_failed__140312788;
        goto code_r0x00014002a3e8;
      }
      if (DAT_1403100dc == '\0') {
        pcVar5 = param_2;
      }
      param_2 = (char *)(**(code **)(*plVar8 + 0x10))(plVar8,pcVar5,param_3,param_4);
      plVar6 = (longlong *)plVar8[7];
      if (*plVar6 != 0) {
        do {
          bVar2 = *(byte *)((longlong)(plVar6 + 2) + (longlong)plVar10);
          iVar3 = isspace((uint)bVar2);
          if (((iVar3 == 0) && (bVar2 != 10)) && (bVar2 != 0xd)) goto LAB_14002a3a0;
          plVar10 = (longlong *)(ulonglong)((int)plVar10 + 1);
          plVar6 = (longlong *)plVar8[7];
        } while (plVar10 < (longlong *)*plVar6);
      }
      (**(code **)*plVar8)(plVar8,1);
    }
    pcVar5 = (char *)FUN_140028d40(param_2,param_4);
  }
  if ((lVar4 != 0) && (*(char *)(lVar4 + 0x58) == '\0')) {
    *(undefined1 *)(lVar4 + 0x58) = 1;
    *(undefined4 *)(lVar4 + 0x5c) = 6;
    uVar9 = 0xffffffffffffffff;
    pcVar5 = PTR_s_Error_reading_Element_value__1403127a0;
    do {
      if (uVar9 == 0) break;
      uVar9 = uVar9 - 1;
      cVar1 = *pcVar5;
      pcVar5 = pcVar5 + 1;
    } while (cVar1 != '\0');
    FUN_140026290(lVar4 + 0x60,PTR_s_Error_reading_Element_value__1403127a0,~uVar9 - 1);
    *(undefined8 *)(lVar4 + 0x74) = 0xffffffffffffffff;
  }
  return (char *)0x0;
  while( true ) {
    uVar9 = uVar9 - 1;
    cVar1 = *pcVar5;
    pcVar5 = pcVar5 + 1;
    if (cVar1 == '\0') break;
code_r0x00014002a3e8:
    if (uVar9 == 0) break;
  }
  FUN_140026290(lVar4 + 0x60,PTR_s_Memory_allocation_failed__140312788,~uVar9 - 1);
  *(undefined8 *)(lVar4 + 0x74) = 0xffffffffffffffff;
  return (char *)0x0;
}



char * FUN_14002a470(longlong *param_1,undefined8 param_2,longlong *param_3,undefined4 param_4)

{
  char cVar1;
  longlong *plVar2;
  longlong lVar3;
  char *pcVar4;
  ulonglong uVar5;
  char *pcVar6;
  char local_res8 [8];
  
  for (plVar2 = param_1; plVar2 != (longlong *)0x0; plVar2 = (longlong *)plVar2[3]) {
    lVar3 = (**(code **)(*plVar2 + 0x20))(plVar2);
    if (lVar3 != 0) {
      lVar3 = (**(code **)(*plVar2 + 0x20))(plVar2);
      goto LAB_14002a4bd;
    }
  }
  lVar3 = 0;
LAB_14002a4bd:
  pcVar4 = (char *)FUN_140028d40(param_2,param_4);
  if (param_3 != (longlong *)0x0) {
    FUN_140028bf0(param_3,pcVar4,param_4);
    param_1[1] = *param_3;
  }
  if (((pcVar4 == (char *)0x0) || (*pcVar4 == '\0')) || (*pcVar4 != '<')) {
    if ((lVar3 != 0) && (*(char *)(lVar3 + 0x58) == '\0')) {
      uVar5 = 0xffffffffffffffff;
      *(undefined1 *)(lVar3 + 0x58) = 1;
      *(undefined4 *)(lVar3 + 0x5c) = 10;
      pcVar6 = PTR_s_Error_parsing_Unknown__1403127c0;
      do {
        if (uVar5 == 0) break;
        uVar5 = uVar5 - 1;
        cVar1 = *pcVar6;
        pcVar6 = pcVar6 + 1;
      } while (cVar1 != '\0');
      FUN_140026290(lVar3 + 0x60,PTR_s_Error_parsing_Unknown__1403127c0,~uVar5 - 1);
      *(undefined8 *)(lVar3 + 0x74) = 0xffffffffffffffff;
      if ((pcVar4 != (char *)0x0) && (param_3 != (longlong *)0x0)) {
        FUN_140028bf0(param_3,pcVar4,param_4);
        *(longlong *)(lVar3 + 0x74) = *param_3;
      }
    }
    pcVar4 = (char *)0x0;
  }
  else {
    FUN_140026290(param_1 + 7,&DAT_14027a10a,0);
    while (pcVar4 = pcVar4 + 1, pcVar4 != (char *)0x0) {
      local_res8[0] = *pcVar4;
      if (local_res8[0] == '\0') goto LAB_14002a5d4;
      if (local_res8[0] == '>') goto LAB_14002a5d9;
      plVar2 = (longlong *)param_1[7];
      uVar5 = *plVar2 + 1;
      if (((ulonglong)plVar2[1] < uVar5) && ((ulonglong)plVar2[1] < plVar2[1] + uVar5)) {
        FUN_1400261c0(param_1 + 7);
      }
      memmove((void *)(param_1[7] + *(longlong *)param_1[7] + 0x10),local_res8,1);
      *(ulonglong *)param_1[7] = uVar5;
      *(undefined1 *)(param_1[7] + 0x10 + uVar5) = 0;
    }
    if ((lVar3 != 0) && (*(char *)(lVar3 + 0x58) == '\0')) {
      uVar5 = 0xffffffffffffffff;
      *(undefined1 *)(lVar3 + 0x58) = 1;
      *(undefined4 *)(lVar3 + 0x5c) = 10;
      pcVar6 = PTR_s_Error_parsing_Unknown__1403127c0;
      do {
        if (uVar5 == 0) break;
        uVar5 = uVar5 - 1;
        cVar1 = *pcVar6;
        pcVar6 = pcVar6 + 1;
      } while (cVar1 != '\0');
      FUN_140026290(lVar3 + 0x60,PTR_s_Error_parsing_Unknown__1403127c0,~uVar5 - 1);
      *(undefined8 *)(lVar3 + 0x74) = 0xffffffffffffffff;
    }
LAB_14002a5d4:
    if (*pcVar4 == '>') {
LAB_14002a5d9:
      pcVar4 = pcVar4 + 1;
    }
  }
  return pcVar4;
}



char * FUN_14002a670(longlong *param_1,undefined8 param_2,longlong *param_3,undefined4 param_4)

{
  longlong *plVar1;
  longlong *plVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  undefined8 uVar6;
  char *pcVar7;
  ulonglong uVar8;
  
  for (plVar1 = param_1; plVar1 != (longlong *)0x0; plVar1 = (longlong *)plVar1[3]) {
    lVar3 = (**(code **)(*plVar1 + 0x20))(plVar1);
    if (lVar3 != 0) {
      uVar6 = (**(code **)(*plVar1 + 0x20))(plVar1);
      goto LAB_14002a6bd;
    }
  }
  uVar6 = 0;
LAB_14002a6bd:
  plVar1 = param_1 + 7;
  FUN_140026290(plVar1,&DAT_14027a10a,0);
  pcVar4 = (char *)FUN_140028d40(param_2,param_4);
  if (param_3 != (longlong *)0x0) {
    FUN_140028bf0(param_3,pcVar4,param_4);
    param_1[1] = *param_3;
  }
  pcVar7 = "<!--";
  if ((pcVar4 != (char *)0x0) && (*pcVar4 != '\0')) {
    do {
      if (*pcVar7 == '\0') goto LAB_14002a740;
    } while (((pcVar4 + -0x14027b690)[(longlong)pcVar7] == *pcVar7) &&
            (pcVar7 = pcVar7 + 1, (pcVar4 + -0x14027b690)[(longlong)pcVar7] != '\0'));
    if (*pcVar7 == '\0') {
LAB_14002a740:
      FUN_140026290(plVar1,&DAT_14027a10a,0);
      pcVar7 = pcVar4 + 4;
      if (pcVar7 == (char *)0x0) {
        return (char *)0x0;
      }
      pcVar4 = pcVar4 + -0x14027b694;
      while (*pcVar7 != '\0') {
        pcVar5 = "-->";
        do {
          if (*pcVar5 == '\0') goto LAB_14002a810;
        } while ((pcVar4[(longlong)pcVar5] == *pcVar5) &&
                (pcVar5 = pcVar5 + 1, pcVar4[(longlong)pcVar5] != '\0'));
        if (*pcVar5 == '\0') break;
        plVar2 = (longlong *)*plVar1;
        lVar3 = *plVar2;
        uVar8 = lVar3 + 1;
        if (((ulonglong)plVar2[1] < uVar8) && ((ulonglong)plVar2[1] < plVar2[1] + uVar8)) {
          FUN_1400261c0(plVar1);
        }
        memmove((void *)(*(longlong *)*plVar1 + 0x10 + *plVar1),pcVar7,1);
        pcVar4 = pcVar4 + 1;
        pcVar7 = pcVar7 + 1;
        *(ulonglong *)*plVar1 = uVar8;
        *(undefined1 *)(lVar3 + 0x11 + *plVar1) = 0;
        if (pcVar7 == (char *)0x0) {
          return (char *)0x0;
        }
      }
LAB_14002a810:
      return pcVar7 + 3;
    }
  }
  FUN_140029740(uVar6,0xb,pcVar4,param_3,param_4);
  return (char *)0x0;
}



char * FUN_14002a850(longlong param_1,undefined8 param_2,undefined8 *param_3,undefined4 param_4)

{
  char cVar1;
  char *pcVar2;
  char *pcVar3;
  undefined *puVar4;
  
  pcVar2 = (char *)FUN_140028d40(param_2,param_4);
  if ((pcVar2 != (char *)0x0) && (*pcVar2 != '\0')) {
    if (param_3 != (undefined8 *)0x0) {
      FUN_140028bf0(param_3,pcVar2,param_4);
      *(undefined8 *)(param_1 + 8) = *param_3;
    }
    pcVar3 = (char *)FUN_140028e20(pcVar2,param_1 + 0x20);
    if ((pcVar3 != (char *)0x0) && (*pcVar3 != '\0')) {
      pcVar2 = (char *)FUN_140028d40(pcVar3,param_4);
      if ((pcVar2 == (char *)0x0) || ((*pcVar2 == '\0' || (*pcVar2 != '=')))) {
        if (*(longlong *)(param_1 + 0x18) != 0) {
          FUN_140029740(*(longlong *)(param_1 + 0x18),7,pcVar2,param_3,param_4);
        }
        return (char *)0x0;
      }
      pcVar2 = (char *)FUN_140028d40(pcVar2 + 1,param_4);
      if ((pcVar2 != (char *)0x0) && (cVar1 = *pcVar2, cVar1 != '\0')) {
        if (cVar1 == '\'') {
          puVar4 = &DAT_14027b5d4;
        }
        else {
          if (cVar1 != '\"') {
            FUN_140026290(param_1 + 0x30,&DAT_14027a10a,0);
            while( true ) {
              if (*pcVar2 == '\0') {
                return pcVar2;
              }
              cVar1 = FUN_140028ab0();
              if (cVar1 != '\0') {
                return pcVar2;
              }
              cVar1 = *pcVar2;
              if (cVar1 == '\n') {
                return pcVar2;
              }
              if (cVar1 == '\r') break;
              if (cVar1 == '/') {
                return pcVar2;
              }
              if (cVar1 == '>') {
                return pcVar2;
              }
              if ((cVar1 == '\'') || (cVar1 == '\"')) {
                if (*(longlong *)(param_1 + 0x18) != 0) {
                  FUN_140029740(*(longlong *)(param_1 + 0x18),7,pcVar2,param_3,param_4);
                }
                return (char *)0x0;
              }
              FUN_140026410(param_1 + 0x30);
              pcVar2 = pcVar2 + 1;
              if (pcVar2 == (char *)0x0) {
                return (char *)0x0;
              }
            }
            return pcVar2;
          }
          puVar4 = &DAT_14027b5c4;
        }
        pcVar2 = (char *)FUN_1400291a0(pcVar2 + 1,param_1 + 0x30,0,puVar4,param_4);
        return pcVar2;
      }
    }
    if (*(longlong *)(param_1 + 0x18) != 0) {
      FUN_140029740(*(longlong *)(param_1 + 0x18),7,pcVar2,param_3,param_4);
    }
  }
  return (char *)0x0;
}



longlong FUN_14002aa40(longlong *param_1,char *param_2,longlong *param_3,undefined4 param_4)

{
  longlong *plVar1;
  char cVar2;
  longlong *plVar3;
  longlong lVar4;
  undefined8 uVar5;
  char *pcVar6;
  char *pcVar7;
  ulonglong uVar8;
  char local_res8 [8];
  undefined8 *local_30;
  void *local_28;
  
  plVar1 = param_1 + 7;
  FUN_140026290(plVar1,&DAT_14027a10a,0);
  for (plVar3 = param_1; plVar3 != (longlong *)0x0; plVar3 = (longlong *)plVar3[3]) {
    lVar4 = (**(code **)(*plVar3 + 0x20))(plVar3);
    if (lVar4 != 0) {
      uVar5 = (**(code **)(*plVar3 + 0x20))(plVar3);
      goto LAB_14002aab9;
    }
  }
  uVar5 = 0;
LAB_14002aab9:
  if (param_3 != (longlong *)0x0) {
    FUN_140028bf0(param_3,param_2,param_4);
    param_1[1] = *param_3;
  }
  pcVar6 = "<![CDATA[";
  if ((char)param_1[0xb] == '\0') {
    pcVar7 = "<![CDATA[";
    if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
      do {
        if (*pcVar7 == '\0') goto LAB_14002ab3b;
      } while (((param_2 + -0x14027b680)[(longlong)pcVar7] == *pcVar7) &&
              (pcVar7 = pcVar7 + 1, (param_2 + -0x14027b680)[(longlong)pcVar7] != '\0'));
      if (*pcVar7 == '\0') goto LAB_14002ab3b;
    }
    lVar4 = FUN_1400291a0(param_2,plVar1,1,&DAT_14027b674,param_4);
    if (lVar4 != 0) {
      return lVar4 + -1;
    }
  }
  else {
LAB_14002ab3b:
    *(undefined1 *)(param_1 + 0xb) = 1;
    if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
      do {
        if (*pcVar6 == '\0') goto LAB_14002ab75;
      } while (((param_2 + -0x14027b680)[(longlong)pcVar6] == *pcVar6) &&
              (pcVar6 = pcVar6 + 1, (param_2 + -0x14027b680)[(longlong)pcVar6] != '\0'));
      if (*pcVar6 == '\0') {
LAB_14002ab75:
        pcVar6 = param_2 + 9;
        if (pcVar6 != (char *)0x0) {
          param_2 = param_2 + -0x14027b683;
          while (cVar2 = *pcVar6, cVar2 != '\0') {
            pcVar7 = "]]>";
            do {
              if (*pcVar7 == '\0') goto LAB_14002ac1c;
            } while ((param_2[(longlong)pcVar7] == *pcVar7) &&
                    (pcVar7 = pcVar7 + 1, param_2[(longlong)pcVar7] != '\0'));
            if (*pcVar7 == '\0') break;
            plVar3 = (longlong *)*plVar1;
            uVar8 = *plVar3 + 1;
            local_res8[0] = cVar2;
            if (((ulonglong)plVar3[1] < uVar8) && ((ulonglong)plVar3[1] < plVar3[1] + uVar8)) {
              FUN_1400261c0(plVar1);
            }
            memmove((void *)(*plVar1 + *(longlong *)*plVar1 + 0x10),local_res8,1);
            *(ulonglong *)*plVar1 = uVar8;
            *(undefined1 *)(*plVar1 + 0x10 + uVar8) = 0;
            param_2 = param_2 + 1;
            pcVar6 = pcVar6 + 1;
            if (pcVar6 == (char *)0x0) break;
          }
        }
LAB_14002ac1c:
        local_30 = &DAT_14031fee8;
        lVar4 = FUN_1400291a0(pcVar6,&local_30,0,&DAT_14027b68c,param_4);
        if (local_30 == &DAT_14031fee8) {
          return lVar4;
        }
        operator_delete__(local_28);
        return lVar4;
      }
    }
    FUN_140029740(uVar5,0xf,param_2,param_3,param_4);
  }
  return 0;
}



byte * FUN_14002ac90(longlong *param_1,undefined8 param_2,longlong *param_3,int param_4)

{
  char cVar1;
  byte bVar2;
  longlong *plVar3;
  int iVar4;
  char *pcVar5;
  longlong lVar6;
  ulonglong uVar7;
  int iVar8;
  undefined8 *puVar9;
  char *pcVar10;
  byte *pbVar11;
  undefined **local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 local_70;
  undefined8 *local_68;
  void *local_60;
  undefined8 *local_58;
  void *local_50;
  undefined8 local_48;
  undefined8 local_40;
  
  pcVar5 = (char *)FUN_140028d40(param_2,param_4);
  for (plVar3 = param_1; plVar3 != (longlong *)0x0; plVar3 = (longlong *)plVar3[3]) {
    lVar6 = (**(code **)(*plVar3 + 0x20))();
    if (lVar6 != 0) {
      lVar6 = (**(code **)(*plVar3 + 0x20))();
      goto LAB_14002ad0a;
    }
  }
  lVar6 = 0;
LAB_14002ad0a:
  if ((pcVar5 != (char *)0x0) && (*pcVar5 != '\0')) {
    pcVar10 = "<?xml";
    do {
      if (*pcVar10 == '\0') goto LAB_14002ad7f;
      iVar8 = (int)(pcVar5 + -0x14027ba88)[(longlong)pcVar10];
      if ((param_4 != 1) || (iVar8 < 0x80)) {
        iVar8 = tolower(iVar8);
      }
      iVar4 = (int)*pcVar10;
      if ((param_4 != 1) || (iVar4 < 0x80)) {
        iVar4 = tolower(iVar4);
      }
    } while ((iVar8 == iVar4) &&
            (pcVar10 = pcVar10 + 1, (pcVar5 + -0x14027ba88)[(longlong)pcVar10] != '\0'));
    if (*pcVar10 == '\0') {
LAB_14002ad7f:
      if (param_3 != (longlong *)0x0) {
        FUN_140028bf0(param_3,pcVar5,param_4);
        param_1[1] = *param_3;
      }
      FUN_140026290(param_1 + 0xb,&DAT_14027a10a,0);
      FUN_140026290(param_1 + 0xd,&DAT_14027a10a,0);
      FUN_140026290(param_1 + 0xf,&DAT_14027a10a,0);
      pbVar11 = (byte *)(pcVar5 + 5);
      do {
        while( true ) {
          if (pbVar11 == (byte *)0x0) {
            return (byte *)0x0;
          }
          pcVar5 = "version";
          if (*pbVar11 == 0) {
            return (byte *)0x0;
          }
          if (*pbVar11 == 0x3e) {
            return pbVar11 + 1;
          }
          pbVar11 = (byte *)FUN_140028d40(pbVar11,param_4);
          if ((pbVar11 == (byte *)0x0) || (*pbVar11 == 0)) break;
          do {
            if (*pcVar5 == '\0') goto LAB_14002ae9c;
            iVar8 = (int)(char)(pbVar11 + -0x14027ba98)[(longlong)pcVar5];
            if ((param_4 != 1) || (iVar8 < 0x80)) {
              iVar8 = tolower(iVar8);
            }
            iVar4 = (int)*pcVar5;
            if ((param_4 != 1) || (iVar4 < 0x80)) {
              iVar4 = tolower(iVar4);
            }
          } while ((iVar8 == iVar4) &&
                  (pcVar5 = pcVar5 + 1, (pbVar11 + -0x14027ba98)[(longlong)pcVar5] != 0));
          if (*pcVar5 != '\0') break;
LAB_14002ae9c:
          local_80 = 0xffffffffffffffff;
          local_78 = 0;
          local_88 = TiXmlAttribute::vftable;
          local_68 = &DAT_14031fee8;
          local_58 = &DAT_14031fee8;
          local_70 = 0;
          local_40 = 0;
          local_48 = 0;
          pbVar11 = (byte *)FUN_14002a850(&local_88,pbVar11,param_3,param_4);
          puVar9 = local_58;
          uVar7 = 0xffffffffffffffff;
          pcVar5 = (char *)(local_58 + 2);
          do {
            if (uVar7 == 0) break;
            uVar7 = uVar7 - 1;
            cVar1 = *pcVar5;
            pcVar5 = pcVar5 + 1;
          } while (cVar1 != '\0');
          FUN_140026290(param_1 + 0xb,local_58 + 2,~uVar7 - 1);
LAB_14002b104:
          if (puVar9 != &DAT_14031fee8) {
            operator_delete__(local_50);
          }
          if (local_68 != &DAT_14031fee8) {
            operator_delete__(local_60);
          }
        }
        pcVar5 = "encoding";
        if ((pbVar11 != (byte *)0x0) && (*pbVar11 != 0)) {
          do {
            if (*pcVar5 == '\0') goto LAB_14002af7b;
            iVar8 = (int)pcVar5[(longlong)(pbVar11 + -0x14027baa0)];
            if ((param_4 != 1) || (iVar8 < 0x80)) {
              iVar8 = tolower(iVar8);
            }
            iVar4 = (int)*pcVar5;
            if ((param_4 != 1) || (iVar4 < 0x80)) {
              iVar4 = tolower(iVar4);
            }
          } while ((iVar8 == iVar4) &&
                  (pcVar5 = pcVar5 + 1, pcVar5[(longlong)(pbVar11 + -0x14027baa0)] != '\0'));
          if (*pcVar5 == '\0') {
LAB_14002af7b:
            local_80 = 0xffffffffffffffff;
            local_78 = 0;
            local_88 = TiXmlAttribute::vftable;
            local_68 = &DAT_14031fee8;
            local_58 = &DAT_14031fee8;
            local_70 = 0;
            local_40 = 0;
            local_48 = 0;
            pbVar11 = (byte *)FUN_14002a850(&local_88,pbVar11,param_3,param_4);
            puVar9 = local_58;
            uVar7 = 0xffffffffffffffff;
            pcVar5 = (char *)(local_58 + 2);
            do {
              if (uVar7 == 0) break;
              uVar7 = uVar7 - 1;
              cVar1 = *pcVar5;
              pcVar5 = pcVar5 + 1;
            } while (cVar1 != '\0');
            FUN_140026290(param_1 + 0xd,local_58 + 2,~uVar7 - 1);
            goto LAB_14002b104;
          }
        }
        pcVar5 = "standalone";
        if (pbVar11 == (byte *)0x0) {
          return (byte *)0x0;
        }
        if (*pbVar11 != 0) {
          do {
            if (*pcVar5 == '\0') goto LAB_14002b05b;
            iVar8 = (int)pcVar5[(longlong)(pbVar11 + -0x14027bab0)];
            if ((param_4 != 1) || (iVar8 < 0x80)) {
              iVar8 = tolower(iVar8);
            }
            iVar4 = (int)*pcVar5;
            if ((param_4 != 1) || (iVar4 < 0x80)) {
              iVar4 = tolower(iVar4);
            }
          } while ((iVar8 == iVar4) &&
                  (pcVar5 = pcVar5 + 1, pcVar5[(longlong)(pbVar11 + -0x14027bab0)] != '\0'));
          if (*pcVar5 == '\0') {
LAB_14002b05b:
            local_80 = 0xffffffffffffffff;
            local_78 = 0;
            local_88 = TiXmlAttribute::vftable;
            local_68 = &DAT_14031fee8;
            local_58 = &DAT_14031fee8;
            local_70 = 0;
            local_40 = 0;
            local_48 = 0;
            pbVar11 = (byte *)FUN_14002a850(&local_88,pbVar11,param_3,param_4);
            puVar9 = local_58;
            uVar7 = 0xffffffffffffffff;
            pcVar5 = (char *)(local_58 + 2);
            do {
              if (uVar7 == 0) break;
              uVar7 = uVar7 - 1;
              cVar1 = *pcVar5;
              pcVar5 = pcVar5 + 1;
            } while (cVar1 != '\0');
            FUN_140026290(param_1 + 0xf,local_58 + 2,~uVar7 - 1);
            goto LAB_14002b104;
          }
        }
        while ((((bVar2 = *pbVar11, bVar2 != 0 && (bVar2 != 0x3e)) &&
                (iVar8 = isspace((uint)bVar2), iVar8 == 0)) && ((bVar2 != 10 && (bVar2 != 0xd))))) {
          pbVar11 = pbVar11 + 1;
          if (pbVar11 == (byte *)0x0) {
            return (byte *)0x0;
          }
        }
      } while( true );
    }
  }
  if ((lVar6 != 0) && (*(char *)(lVar6 + 0x58) == '\0')) {
    *(undefined1 *)(lVar6 + 0x58) = 1;
    *(undefined4 *)(lVar6 + 0x5c) = 0xc;
    uVar7 = 0xffffffffffffffff;
    pcVar5 = PTR_s_Error_parsing_Declaration__1403127d0;
    do {
      if (uVar7 == 0) break;
      uVar7 = uVar7 - 1;
      cVar1 = *pcVar5;
      pcVar5 = pcVar5 + 1;
    } while (cVar1 != '\0');
    FUN_140026290(lVar6 + 0x60,PTR_s_Error_parsing_Declaration__1403127d0,~uVar7 - 1);
    *(undefined8 *)(lVar6 + 0x74) = 0xffffffffffffffff;
  }
  return (byte *)0x0;
}



void FUN_14002b1b0(undefined8 *param_1)

{
  *param_1 = ISubject::vftable;
  return;
}



undefined8 * FUN_14002b1c0(undefined8 *param_1,byte param_2)

{
  *param_1 = ISubject::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_14002b1f0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x20);
}



void * FUN_14002b200(void *param_1,uint param_2)

{
  FUN_1401e2400();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14002b230(undefined8 *param_1)

{
  DAT_140320128 = 0;
  *param_1 = MBISingleton<>::vftable;
  return;
}



void FUN_14002b250(ulonglong *param_1,undefined8 *param_2)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  puVar1 = (undefined8 *)param_1[1];
  if ((param_2 < puVar1) && (puVar2 = (undefined8 *)*param_1, puVar2 <= param_2)) {
    if (puVar1 == (undefined8 *)param_1[2]) {
      FUN_14000b000(param_1);
    }
    if ((undefined8 *)param_1[1] != (undefined8 *)0x0) {
      *(undefined8 *)param_1[1] =
           *(undefined8 *)(*param_1 + ((longlong)param_2 - (longlong)puVar2 >> 3) * 8);
      param_1[1] = param_1[1] + 8;
      return;
    }
  }
  else {
    if (puVar1 == (undefined8 *)param_1[2]) {
      FUN_14000b000(param_1);
    }
    if ((undefined8 *)param_1[1] != (undefined8 *)0x0) {
      *(undefined8 *)param_1[1] = *param_2;
    }
  }
  param_1[1] = param_1[1] + 8;
  return;
}



undefined8 * FUN_14002b2e0(undefined8 *param_1,byte param_2)

{
  DAT_140320128 = 0;
  *param_1 = MBISingleton<>::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14002b320(longlong param_1)

{
  FUN_14002b200(param_1 + -8);
  return;
}



undefined8 * FUN_14002b330(undefined8 *param_1,byte param_2)

{
  *param_1 = TimeSource::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14002b360(undefined8 *param_1)

{
  *param_1 = IObserver::vftable;
  return;
}



undefined8 * FUN_14002b370(undefined8 *param_1,byte param_2)

{
  *param_1 = IObserver::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_14002b3a0(undefined8 *param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  *param_1 = Magi::Timer::vftable;
  (**(code **)(*(longlong *)param_1[1] + 0x18))
            ((longlong *)param_1[1],param_1,param_3,param_4,0xfffffffffffffffe);
  *param_1 = IObserver::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_14002b400(void)

{
  return 0xa8c;
}



undefined8 FUN_14002b410(void)

{
  return 0xa8e;
}



undefined8 FUN_14002b420(void)

{
  return 0x9c4;
}



undefined8 FUN_14002b430(void)

{
  return 0x9d2;
}



undefined8 FUN_14002b440(void)

{
  return 0x5dc;
}



undefined8 FUN_14002b450(void)

{
  return 0x604;
}



undefined1 FUN_14002b460(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xa8d);
  FUN_1401a2620(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"G2G_ALREADY_LOGIN",0xa8d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002b540(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xa8d);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"G2G_ALREADY_LOGIN",0xa8d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14002b620(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x9c5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"GG_GAME_SERVER_INFO",0x9c5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14002b6e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x9c5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"GG_GAME_SERVER_INFO",0x9c5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14002b7b0(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x9c6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"GG_GAME_SERVER_ONE_DAY_RESET",0x9c6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14002b870(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x9c6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"GG_GAME_SERVER_ONE_DAY_RESET",0x9c6)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002b940(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  undefined4 local_res10 [2];
  undefined1 local_48 [4];
  undefined4 local_44;
  longlong local_40;
  longlong local_38;
  int local_30;
  int local_2c;
  
  local_res10[0] = param_2;
  FUN_140185560(local_48);
  FUN_140185030(local_48);
  FUN_14003d020(local_48,0x9c7);
  uVar3 = *param_4;
  uVar4 = param_4[1];
  uVar2 = param_4[1];
  lVar6 = 0;
  local_44 = 0;
  if (local_40 == 0) {
    if (local_38 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_38 == 0) {
    if (local_40 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_40 + 0x18);
    FUN_14003cda0(local_40,iVar1 + 0x10);
    if (*(int *)(local_40 + 0x18) != 0) {
      lVar6 = *(longlong *)(local_40 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar6) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar6) = uVar4;
    goto LAB_14002ba26;
  }
  lVar6 = (longlong)local_30;
  local_30 = local_30 + 0x10;
  if ((local_30 < 0) || (local_2c < local_30)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_38 + lVar6) = *param_4;
  ((undefined8 *)(local_38 + lVar6))[1] = uVar2;
LAB_14002ba26:
  FUN_14003ced0(local_48);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_48,L"GG_CLIENT_AUTH_INFO",0x9c7);
  FUN_14019a730(&local_40);
  if ((local_38 != 0) && (local_2c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1
FUN_14002bac0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *param_5)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  undefined1 local_48 [4];
  undefined4 local_44;
  longlong local_40;
  longlong local_38;
  int local_30;
  int local_2c;
  
  FUN_140185560(local_48);
  FUN_140185030(local_48);
  FUN_14003d020(local_48,0x9c7);
  uVar3 = *param_5;
  uVar4 = param_5[1];
  uVar2 = param_5[1];
  lVar6 = 0;
  local_44 = 0;
  if (local_40 == 0) {
    if (local_38 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_38 == 0) {
    if (local_40 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_40 + 0x18);
    FUN_14003cda0(local_40,iVar1 + 0x10);
    if (*(int *)(local_40 + 0x18) != 0) {
      lVar6 = *(longlong *)(local_40 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar6) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar6) = uVar4;
    goto LAB_14002bbb8;
  }
  lVar6 = (longlong)local_30;
  local_30 = local_30 + 0x10;
  if ((local_30 < 0) || (local_2c < local_30)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_38 + lVar6) = *param_5;
  ((undefined8 *)(local_38 + lVar6))[1] = uVar2;
LAB_14002bbb8:
  FUN_14003ced0(local_48);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_48,L"GG_CLIENT_AUTH_INFO",0x9c7);
  FUN_14019a730(&local_40);
  if ((local_38 != 0) && (local_2c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1
FUN_14002bc60(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4,
             undefined8 param_5,undefined2 *param_6,undefined1 *param_7,undefined1 *param_8,
             undefined4 *param_9)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  undefined4 local_res10 [4];
  longlong *local_res20;
  undefined1 local_58 [4];
  undefined4 local_54;
  longlong local_50;
  longlong local_48;
  int local_40;
  int local_3c;
  
  local_res10[0] = param_2;
  FUN_140185560(local_58);
  FUN_140185030(local_58);
  FUN_14003d020(local_58,0x9c8);
  uVar3 = *param_4;
  uVar4 = param_4[1];
  uVar2 = param_4[1];
  lVar6 = 0;
  local_54 = 0;
  if (local_50 == 0) {
    if (local_48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_50 + 0x18);
    FUN_14003cda0(local_50,iVar1 + 0x10);
    if (*(int *)(local_50 + 0x18) != 0) {
      lVar6 = *(longlong *)(local_50 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar6) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar6) = uVar4;
    goto LAB_14002bd40;
  }
  lVar6 = (longlong)local_40;
  local_40 = local_40 + 0x10;
  if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_48 + lVar6) = *param_4;
  ((undefined8 *)(local_48 + lVar6))[1] = uVar2;
LAB_14002bd40:
  FUN_14003ced0(local_58);
  FUN_1401a2620(local_58,param_5);
  FUN_14003d020(local_58,*param_6);
  FUN_14003c9e0(local_58,*param_7);
  FUN_14003c9e0(local_58,*param_8);
  FUN_14007c6e0(local_58,*param_9);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_58,L"GG_CLIENT_AUTH_INFO_SUCC_U",0x9c8);
  local_res20 = &local_50;
  FUN_14019a730(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1
FUN_14002be20(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *param_5,undefined8 param_6,undefined2 *param_7,undefined1 *param_8,
             undefined1 *param_9,undefined4 *param_10)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  undefined1 local_58 [4];
  undefined4 local_54;
  longlong local_50;
  longlong local_48;
  int local_40;
  int local_3c;
  
  FUN_140185560(local_58);
  FUN_140185030(local_58);
  FUN_14003d020(local_58,0x9c8);
  uVar3 = *param_5;
  uVar4 = param_5[1];
  uVar2 = param_5[1];
  lVar6 = 0;
  local_54 = 0;
  if (local_50 == 0) {
    if (local_48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_50 + 0x18);
    FUN_14003cda0(local_50,iVar1 + 0x10);
    if (*(int *)(local_50 + 0x18) != 0) {
      lVar6 = *(longlong *)(local_50 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar6) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar6) = uVar4;
    goto LAB_14002bf0b;
  }
  lVar6 = (longlong)local_40;
  local_40 = local_40 + 0x10;
  if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_48 + lVar6) = *param_5;
  ((undefined8 *)(local_48 + lVar6))[1] = uVar2;
LAB_14002bf0b:
  FUN_14003ced0(local_58);
  FUN_1401a2620(local_58,param_6);
  FUN_14003d020(local_58,*param_7);
  FUN_14003c9e0(local_58,*param_8);
  FUN_14003c9e0(local_58,*param_9);
  FUN_14007c6e0(local_58,*param_10);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_58,L"GG_CLIENT_AUTH_INFO_SUCC_U",0x9c8);
  FUN_14019a730(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1
FUN_14002bff0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4,
             undefined4 *param_5)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  undefined4 local_res10 [4];
  longlong *local_res20;
  undefined1 local_58 [4];
  undefined4 local_54;
  longlong local_50;
  longlong local_48;
  int local_40;
  int local_3c;
  
  local_res10[0] = param_2;
  FUN_140185560(local_58);
  FUN_140185030(local_58);
  FUN_14003d020(local_58,0x9c9);
  uVar3 = *param_4;
  uVar4 = param_4[1];
  uVar2 = param_4[1];
  lVar6 = 0;
  local_54 = 0;
  if (local_50 == 0) {
    if (local_48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_50 + 0x18);
    FUN_14003cda0(local_50,iVar1 + 0x10);
    if (*(int *)(local_50 + 0x18) != 0) {
      lVar6 = *(longlong *)(local_50 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar6) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar6) = uVar4;
    goto LAB_14002c0d0;
  }
  lVar6 = (longlong)local_40;
  local_40 = local_40 + 0x10;
  if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_48 + lVar6) = *param_4;
  ((undefined8 *)(local_48 + lVar6))[1] = uVar2;
LAB_14002c0d0:
  FUN_14003ced0(local_58);
  FUN_14007c6e0(local_58,*param_5);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_58,L"GG_CLIENT_AUTH_INFO_FAIL_U",0x9c9);
  local_res20 = &local_50;
  FUN_14019a730(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1
FUN_14002c170(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *param_5,undefined4 *param_6)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  undefined1 local_48 [4];
  undefined4 local_44;
  longlong local_40;
  longlong local_38;
  int local_30;
  int local_2c;
  
  FUN_140185560(local_48);
  FUN_140185030(local_48);
  FUN_14003d020(local_48,0x9c9);
  uVar3 = *param_5;
  uVar4 = param_5[1];
  uVar2 = param_5[1];
  lVar6 = 0;
  local_44 = 0;
  if (local_40 == 0) {
    if (local_38 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_38 == 0) {
    if (local_40 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_40 + 0x18);
    FUN_14003cda0(local_40,iVar1 + 0x10);
    if (*(int *)(local_40 + 0x18) != 0) {
      lVar6 = *(longlong *)(local_40 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar6) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar6) = uVar4;
    goto LAB_14002c268;
  }
  lVar6 = (longlong)local_30;
  local_30 = local_30 + 0x10;
  if ((local_30 < 0) || (local_2c < local_30)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_38 + lVar6) = *param_5;
  ((undefined8 *)(local_38 + lVar6))[1] = uVar2;
LAB_14002c268:
  FUN_14003ced0(local_48);
  FUN_14007c6e0(local_48,*param_6);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_48,L"GG_CLIENT_AUTH_INFO_FAIL_U",0x9c9);
  FUN_14019a730(&local_40);
  if ((local_38 != 0) && (local_2c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1
FUN_14002c320(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined1 *param_9,undefined8 param_10,undefined8 param_11,undefined4 *param_12,
             undefined4 *param_13)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x9ca);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14003c9e0(local_30,*param_9);
  FUN_140186d90(local_30,param_10);
  FUN_140186d90(local_30,param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_14007c6e0(local_30,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"GG_GAME_SERVER_INFO_SUCC_U",0x9ca);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002c4b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9,undefined1 *param_10,undefined8 param_11,undefined8 param_12,
             undefined4 *param_13,undefined4 *param_14)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x9ca);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14003c9e0(local_30,*param_10);
  FUN_140186d90(local_30,param_11);
  FUN_140186d90(local_30,param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14007c6e0(local_30,*param_14);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"GG_GAME_SERVER_INFO_SUCC_U",0x9ca);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002c650(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x9cb);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"GG_GAME_SERVER_CHANNEL_INFO",0x9cb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002c770(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x9cb);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"GG_GAME_SERVER_CHANNEL_INFO",0x9cb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002c890(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x9cc);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"GG_GAME_SERVER_INFO_FAIL_U",0x9cc);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002c970(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x9cc);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"GG_GAME_SERVER_INFO_FAIL_U",0x9cc);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002ca50(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 *param_5,undefined2 *param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined8 param_10,undefined4 *param_11,undefined4 *param_12,
             undefined2 *param_13,undefined8 *param_14,undefined2 *param_15)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  undefined4 local_res10 [2];
  undefined1 local_48 [4];
  undefined4 local_44;
  longlong local_40;
  longlong local_38;
  int local_30;
  int local_2c;
  
  local_res10[0] = param_2;
  FUN_140185560(local_48);
  FUN_140185030(local_48);
  FUN_14003d020(local_48,0x9cd);
  FUN_140186cf0(local_48,param_4);
  uVar3 = *param_5;
  uVar4 = param_5[1];
  uVar2 = param_5[1];
  lVar6 = 0;
  local_44 = 0;
  if (local_40 == 0) {
    if (local_38 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_38 == 0) {
    if (local_40 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_40 + 0x18);
    FUN_14003cda0(local_40,iVar1 + 0x10);
    if (*(int *)(local_40 + 0x18) != 0) {
      lVar6 = *(longlong *)(local_40 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar6) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar6) = uVar4;
    goto LAB_14002cb43;
  }
  lVar6 = (longlong)local_30;
  local_30 = local_30 + 0x10;
  if ((local_30 < 0) || (local_2c < local_30)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_38 + lVar6) = *param_5;
  ((undefined8 *)(local_38 + lVar6))[1] = uVar2;
LAB_14002cb43:
  FUN_14003ced0(local_48);
  FUN_14003d020(local_48,*param_6);
  FUN_1401a2620(local_48,param_7);
  FUN_140186d90(local_48,param_8);
  FUN_14007c6e0(local_48,*param_9);
  FUN_140186d90(local_48,param_10);
  FUN_14007c6e0(local_48,*param_11);
  FUN_14007c6e0(local_48,*param_12);
  FUN_14003d020(local_48,*param_13);
  FUN_14003cac0(local_48,*param_14);
  FUN_14003d020(local_48,*param_15);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_48,L"GG_REQ_LOGOUT",0x9cd);
  FUN_14019a730(&local_40);
  if ((local_38 != 0) && (local_2c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1
FUN_14002cc80(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 *param_6,undefined2 *param_7,undefined8 param_8,
             undefined8 param_9,undefined4 *param_10,undefined8 param_11,undefined4 *param_12,
             undefined4 *param_13,undefined2 *param_14,undefined8 *param_15,undefined2 *param_16)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  undefined1 local_58 [4];
  undefined4 local_54;
  longlong local_50;
  longlong local_48;
  int local_40;
  int local_3c;
  
  FUN_140185560(local_58);
  FUN_140185030(local_58);
  FUN_14003d020(local_58,0x9cd);
  FUN_140186cf0(local_58,param_5);
  uVar3 = *param_6;
  uVar4 = param_6[1];
  uVar2 = param_6[1];
  lVar6 = 0;
  local_54 = 0;
  if (local_50 == 0) {
    if (local_48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_50 + 0x18);
    FUN_14003cda0(local_50,iVar1 + 0x10);
    if (*(int *)(local_50 + 0x18) != 0) {
      lVar6 = *(longlong *)(local_50 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar6) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar6) = uVar4;
    goto LAB_14002cd78;
  }
  lVar6 = (longlong)local_40;
  local_40 = local_40 + 0x10;
  if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_48 + lVar6) = *param_6;
  ((undefined8 *)(local_48 + lVar6))[1] = uVar2;
LAB_14002cd78:
  FUN_14003ced0(local_58);
  FUN_14003d020(local_58,*param_7);
  FUN_1401a2620(local_58,param_8);
  FUN_140186d90(local_58,param_9);
  FUN_14007c6e0(local_58,*param_10);
  FUN_140186d90(local_58,param_11);
  FUN_14007c6e0(local_58,*param_12);
  FUN_14007c6e0(local_58,*param_13);
  FUN_14003d020(local_58,*param_14);
  FUN_14003cac0(local_58,*param_15);
  FUN_14003d020(local_58,*param_16);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_58,L"GG_REQ_LOGOUT",0x9cd);
  FUN_14019a730(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1 FUN_14002cec0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x9ce);
  FUN_1401a2620(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"GG_ALREADY_LOGIN",0x9ce);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002cfa0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x9ce);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"GG_ALREADY_LOGIN",0x9ce);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002d080(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x9cf);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"GG_SERVER_TYPE",0x9cf);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002d160(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x9cf);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"GG_SERVER_TYPE",0x9cf);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002d240(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined4 *param_9)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  undefined4 local_res10 [4];
  longlong *local_res20;
  undefined1 local_58 [4];
  undefined4 local_54;
  longlong local_50;
  longlong local_48;
  int local_40;
  int local_3c;
  
  local_res10[0] = param_2;
  FUN_140185560(local_58);
  FUN_140185030(local_58);
  FUN_14003d020(local_58,0x9d0);
  uVar3 = *param_4;
  uVar4 = param_4[1];
  uVar2 = param_4[1];
  lVar6 = 0;
  local_54 = 0;
  if (local_50 == 0) {
    if (local_48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_50 + 0x18);
    FUN_14003cda0(local_50,iVar1 + 0x10);
    if (*(int *)(local_50 + 0x18) != 0) {
      lVar6 = *(longlong *)(local_50 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar6) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar6) = uVar4;
    goto LAB_14002d320;
  }
  lVar6 = (longlong)local_40;
  local_40 = local_40 + 0x10;
  if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_48 + lVar6) = *param_4;
  ((undefined8 *)(local_48 + lVar6))[1] = uVar2;
LAB_14002d320:
  FUN_14003ced0(local_58);
  FUN_14007c6e0(local_58,*param_5);
  FUN_1401a2620(local_58,param_6);
  FUN_1401a2620(local_58,param_7);
  FUN_14007c6e0(local_58,*param_8);
  FUN_14007c6e0(local_58,*param_9);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_58,L"GG_REQ_PLAY_TIME_START",0x9d0);
  local_res20 = &local_50;
  FUN_14019a730(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1
FUN_14002d400(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  undefined1 local_58 [4];
  undefined4 local_54;
  longlong local_50;
  longlong local_48;
  int local_40;
  int local_3c;
  
  FUN_140185560(local_58);
  FUN_140185030(local_58);
  FUN_14003d020(local_58,0x9d0);
  uVar3 = *param_5;
  uVar4 = param_5[1];
  uVar2 = param_5[1];
  lVar6 = 0;
  local_54 = 0;
  if (local_50 == 0) {
    if (local_48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_50 + 0x18);
    FUN_14003cda0(local_50,iVar1 + 0x10);
    if (*(int *)(local_50 + 0x18) != 0) {
      lVar6 = *(longlong *)(local_50 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar6) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar6) = uVar4;
    goto LAB_14002d4eb;
  }
  lVar6 = (longlong)local_40;
  local_40 = local_40 + 0x10;
  if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_48 + lVar6) = *param_5;
  ((undefined8 *)(local_48 + lVar6))[1] = uVar2;
LAB_14002d4eb:
  FUN_14003ced0(local_58);
  FUN_14007c6e0(local_58,*param_6);
  FUN_1401a2620(local_58,param_7);
  FUN_1401a2620(local_58,param_8);
  FUN_14007c6e0(local_58,*param_9);
  FUN_14007c6e0(local_58,*param_10);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_58,L"GG_REQ_PLAY_TIME_START",0x9d0);
  FUN_14019a730(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1
FUN_14002d5d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined4 *param_9)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  undefined4 local_res10 [4];
  longlong *local_res20;
  undefined1 local_58 [4];
  undefined4 local_54;
  longlong local_50;
  longlong local_48;
  int local_40;
  int local_3c;
  
  local_res10[0] = param_2;
  FUN_140185560(local_58);
  FUN_140185030(local_58);
  FUN_14003d020(local_58,0x9d1);
  uVar3 = *param_4;
  uVar4 = param_4[1];
  uVar2 = param_4[1];
  lVar6 = 0;
  local_54 = 0;
  if (local_50 == 0) {
    if (local_48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_50 + 0x18);
    FUN_14003cda0(local_50,iVar1 + 0x10);
    if (*(int *)(local_50 + 0x18) != 0) {
      lVar6 = *(longlong *)(local_50 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar6) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar6) = uVar4;
    goto LAB_14002d6b0;
  }
  lVar6 = (longlong)local_40;
  local_40 = local_40 + 0x10;
  if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_48 + lVar6) = *param_4;
  ((undefined8 *)(local_48 + lVar6))[1] = uVar2;
LAB_14002d6b0:
  FUN_14003ced0(local_58);
  FUN_14007c6e0(local_58,*param_5);
  FUN_1401a2620(local_58,param_6);
  FUN_1401a2620(local_58,param_7);
  FUN_14007c6e0(local_58,*param_8);
  FUN_14007c6e0(local_58,*param_9);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_58,L"GG_REQ_PLAY_TIME_END",0x9d1);
  local_res20 = &local_50;
  FUN_14019a730(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1
FUN_14002d790(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  undefined1 local_58 [4];
  undefined4 local_54;
  longlong local_50;
  longlong local_48;
  int local_40;
  int local_3c;
  
  FUN_140185560(local_58);
  FUN_140185030(local_58);
  FUN_14003d020(local_58,0x9d1);
  uVar3 = *param_5;
  uVar4 = param_5[1];
  uVar2 = param_5[1];
  lVar6 = 0;
  local_54 = 0;
  if (local_50 == 0) {
    if (local_48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_50 + 0x18);
    FUN_14003cda0(local_50,iVar1 + 0x10);
    if (*(int *)(local_50 + 0x18) != 0) {
      lVar6 = *(longlong *)(local_50 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar6) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar6) = uVar4;
    goto LAB_14002d87b;
  }
  lVar6 = (longlong)local_40;
  local_40 = local_40 + 0x10;
  if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_48 + lVar6) = *param_5;
  ((undefined8 *)(local_48 + lVar6))[1] = uVar2;
LAB_14002d87b:
  FUN_14003ced0(local_58);
  FUN_14007c6e0(local_58,*param_6);
  FUN_1401a2620(local_58,param_7);
  FUN_1401a2620(local_58,param_8);
  FUN_14007c6e0(local_58,*param_9);
  FUN_14007c6e0(local_58,*param_10);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_58,L"GG_REQ_PLAY_TIME_END",0x9d1);
  FUN_14019a730(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1 FUN_14002d960(longlong *param_1,undefined4 param_2,undefined8 param_3,int *param_4)

{
  undefined1 uVar1;
  undefined1 *puVar2;
  undefined4 local_res10 [2];
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  local_res10[0] = param_2;
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x5dd);
  FUN_14007c6e0(local_40,param_4[2] - *param_4);
  puVar2 = *(undefined1 **)param_4;
  if (puVar2 != *(undefined1 **)(param_4 + 2)) {
    do {
      FUN_14003c9e0(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != *(undefined1 **)(param_4 + 2));
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PG_KEY_AUTH_ID_01",0x5dd);
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002da60(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             int *param_5)

{
  undefined1 uVar1;
  undefined1 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x5dd);
  FUN_14007c6e0(local_40,param_5[2] - *param_5);
  puVar2 = *(undefined1 **)param_5;
  if (puVar2 != *(undefined1 **)(param_5 + 2)) {
    do {
      FUN_14003c9e0(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != *(undefined1 **)(param_5 + 2));
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PG_KEY_AUTH_ID_01",0x5dd);
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14002db70(longlong *param_1,undefined4 param_2,undefined8 param_3,int *param_4)

{
  undefined1 uVar1;
  undefined1 *puVar2;
  undefined4 local_res10 [2];
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  local_res10[0] = param_2;
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x5de);
  FUN_14007c6e0(local_40,param_4[2] - *param_4);
  puVar2 = *(undefined1 **)param_4;
  if (puVar2 != *(undefined1 **)(param_4 + 2)) {
    do {
      FUN_14003c9e0(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != *(undefined1 **)(param_4 + 2));
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PG_KEY_AUTH_ID_02",0x5de);
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002dc70(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             int *param_5)

{
  undefined1 uVar1;
  undefined1 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x5de);
  FUN_14007c6e0(local_40,param_5[2] - *param_5);
  puVar2 = *(undefined1 **)param_5;
  if (puVar2 != *(undefined1 **)(param_5 + 2)) {
    do {
      FUN_14003c9e0(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != *(undefined1 **)(param_5 + 2));
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PG_KEY_AUTH_ID_02",0x5de);
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14002dd80(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5df);
  FUN_140186cf0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GET_AUTH_ID",0x5df);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002de60(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5df);
  FUN_140186cf0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GET_AUTH_ID",0x5df);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002df40(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4,
             undefined1 *param_5,undefined1 *param_6)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  undefined4 local_res10 [4];
  longlong *local_res20;
  undefined1 local_58 [4];
  undefined4 local_54;
  longlong local_50;
  longlong local_48;
  int local_40;
  int local_3c;
  
  local_res10[0] = param_2;
  FUN_140185560(local_58);
  FUN_140185030(local_58);
  FUN_14003d020(local_58,0x5e0);
  uVar3 = *param_4;
  uVar4 = param_4[1];
  uVar2 = param_4[1];
  lVar6 = 0;
  local_54 = 0;
  if (local_50 == 0) {
    if (local_48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_50 + 0x18);
    FUN_14003cda0(local_50,iVar1 + 0x10);
    if (*(int *)(local_50 + 0x18) != 0) {
      lVar6 = *(longlong *)(local_50 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar6) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar6) = uVar4;
    goto LAB_14002e020;
  }
  lVar6 = (longlong)local_40;
  local_40 = local_40 + 0x10;
  if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_48 + lVar6) = *param_4;
  ((undefined8 *)(local_48 + lVar6))[1] = uVar2;
LAB_14002e020:
  FUN_14003ced0(local_58);
  FUN_14003c9e0(local_58,*param_5);
  FUN_14003c9e0(local_58,*param_6);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_58,L"PG_GET_AUTH_ID_SUCC_U",0x5e0);
  local_res20 = &local_50;
  FUN_14019a730(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1
FUN_14002e0d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *param_5,undefined1 *param_6,undefined1 *param_7)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  undefined1 local_48 [4];
  undefined4 local_44;
  longlong local_40;
  longlong local_38;
  int local_30;
  int local_2c;
  
  FUN_140185560(local_48);
  FUN_140185030(local_48);
  FUN_14003d020(local_48,0x5e0);
  uVar3 = *param_5;
  uVar4 = param_5[1];
  uVar2 = param_5[1];
  lVar6 = 0;
  local_44 = 0;
  if (local_40 == 0) {
    if (local_38 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_38 == 0) {
    if (local_40 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_40 + 0x18);
    FUN_14003cda0(local_40,iVar1 + 0x10);
    if (*(int *)(local_40 + 0x18) != 0) {
      lVar6 = *(longlong *)(local_40 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar6) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar6) = uVar4;
    goto LAB_14002e1c8;
  }
  lVar6 = (longlong)local_30;
  local_30 = local_30 + 0x10;
  if ((local_30 < 0) || (local_2c < local_30)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_38 + lVar6) = *param_5;
  ((undefined8 *)(local_38 + lVar6))[1] = uVar2;
LAB_14002e1c8:
  FUN_14003ced0(local_48);
  FUN_14003c9e0(local_48,*param_6);
  FUN_14003c9e0(local_48,*param_7);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_48,L"PG_GET_AUTH_ID_SUCC_U",0x5e0);
  FUN_14019a730(&local_40);
  if ((local_38 != 0) && (local_2c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1
FUN_14002e290(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e1);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GET_AUTH_ID_FAIL_U",0x5e1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002e370(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e1);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GET_AUTH_ID_FAIL_U",0x5e1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14002e450(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GAME_SERVER_INFO",0x5e2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14002e510(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GAME_SERVER_INFO",0x5e2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002e5e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e3);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GAME_CHANNEL_INFO",0x5e3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002e6c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e3);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GAME_CHANNEL_INFO",0x5e3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002e7a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e4);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GAME_SERVER_INFO_SUCC_U",0x5e4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002e890(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GAME_SERVER_INFO_SUCC_U",0x5e4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002e990(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *param_7,undefined8 param_8,
             undefined4 *param_9,undefined1 *param_10,undefined4 *param_11)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e5);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_140186d90(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_140186d90(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14003c9e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GAME_SERVER_DATA",0x5e5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002eaf0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined8 param_7,undefined4 *param_8,
             undefined8 param_9,undefined4 *param_10,undefined1 *param_11,undefined4 *param_12)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e5);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_140186d90(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_140186d90(local_30,param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14003c9e0(local_30,*param_11);
  FUN_14007c6e0(local_30,*param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GAME_SERVER_DATA",0x5e5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002ec60(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e6);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_140186d90(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GAME_CHANNEL_DATA",0x5e6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002ed60(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e6);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_140186d90(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GAME_CHANNEL_DATA",0x5e6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002ee70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e7);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GAME_SERVER_INFO_FAIL_U",0x5e7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002ef50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e7);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GAME_SERVER_INFO_FAIL_U",0x5e7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002f030(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e8);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GAME_CHANNEL_DATA_FAIL_U",0x5e8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002f110(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e8);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GAME_CHANNEL_DATA_FAIL_U",0x5e8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002f1f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e9);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GAME_CHANNEL_DATA_END",0x5e9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002f2d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5e9);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GAME_CHANNEL_DATA_END",0x5e9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002f3b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5ea);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_DB_ERROR",0x5ea);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002f490(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5ea);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_DB_ERROR",0x5ea);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002f570(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5eb);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GAME_SERVER_DATA_END",0x5eb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002f650(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5eb);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GAME_SERVER_DATA_END",0x5eb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14002f730(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5ec);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_ALREADY_LOGIN",0x5ec);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14002f7f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5ec);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_ALREADY_LOGIN",0x5ec);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002f8c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5ed);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_SERVER_SELECT",0x5ed);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002f9a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5ed);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_SERVER_SELECT",0x5ed);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002fa80(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5ee);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_CHANNEL_SELECT",0x5ee);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002fb80(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5ee);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_CHANNEL_SELECT",0x5ee);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14002fc90(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5ef);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_IP_IN_BLACKLIST",0x5ef);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14002fd50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5ef);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_IP_IN_BLACKLIST",0x5ef);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14002fe20(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f0);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GAME_WORLD_INFO",0x5f0);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14002fee0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f0);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GAME_WORLD_INFO",0x5f0);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14002ffb0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f1);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GAME_WORLD_INFO_SUCC_U",0x5f1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400300a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f1);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GAME_WORLD_INFO_SUCC_U",0x5f1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400301a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f2);
  FUN_14007c6e0(local_30,*param_4);
  FUN_140186d90(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GAME_WORLD_DATA",0x5f2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140030290(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f2);
  FUN_14007c6e0(local_30,*param_5);
  FUN_140186d90(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GAME_WORLD_DATA",0x5f2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140030380(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f3);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GAME_WORLD_DATA_END",0x5f3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140030460(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f3);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GAME_WORLD_DATA_END",0x5f3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140030540(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GET_ADD_AUTH_WPIN",0x5f4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140030600(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GET_ADD_AUTH_WPIN",0x5f4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_1400306d0(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_GET_ADD_AUTH_WPOTP",0x5f5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140030790(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_GET_ADD_AUTH_WPOTP",0x5f5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140030860(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f6);
  FUN_140186cf0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_KEY_ADD_AUTH_WPIN",0x5f6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140030940(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f6);
  FUN_140186cf0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_KEY_ADD_AUTH_WPIN",0x5f6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140030a20(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f7);
  FUN_140186cf0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_KEY_ADD_AUTH_WPOTP",0x5f7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140030b00(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f7);
  FUN_140186cf0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_KEY_ADD_AUTH_WPOTP",0x5f7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140030be0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f8);
  FUN_140186cf0(local_30,param_4);
  FUN_140186cf0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_AUTH_PWE_TYPE",0x5f8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140030cd0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f8);
  FUN_140186cf0(local_30,param_5);
  FUN_140186cf0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_AUTH_PWE_TYPE",0x5f8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140030dc0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f9);
  FUN_14007c6e0(local_30,*param_4);
  FUN_140186cf0(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_AUTH_PWE_TYPE_RESULT",0x5f9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140030ed0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5f9);
  FUN_14007c6e0(local_30,*param_5);
  FUN_140186cf0(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_AUTH_PWE_TYPE_RESULT",0x5f9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140030ff0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined1 *param_8)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5fa);
  FUN_140186cf0(local_30,param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14003c9e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_RESP_BCUST",0x5fa);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140031120(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined1 *param_9)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5fa);
  FUN_140186cf0(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14003c9e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_RESP_BCUST",0x5fa);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140031250(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5fb);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_TIME_SHUT_DOWN",0x5fb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140031340(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5fb);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_TIME_SHUT_DOWN",0x5fb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140031440(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5fc);
  FUN_140186cf0(local_30,param_4);
  FUN_140186cf0(local_30,param_5);
  FUN_140186cf0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_AUTH_PWE_TYPE_CORECLIENT",0x5fc);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140031540(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5fc);
  FUN_140186cf0(local_30,param_5);
  FUN_140186cf0(local_30,param_6);
  FUN_140186cf0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_AUTH_PWE_TYPE_CORECLIENT",0x5fc);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140031640(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined1 *param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5fd);
  FUN_140186cf0(local_30,param_4);
  FUN_140186cf0(local_30,param_5);
  FUN_140186cf0(local_30,param_6);
  FUN_140186cf0(local_30,param_7);
  FUN_140186cf0(local_30,param_8);
  FUN_14003c9e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_AUTH_SEGA_TYPE",0x5fd);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140031780(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined1 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5fd);
  FUN_140186cf0(local_30,param_5);
  FUN_140186cf0(local_30,param_6);
  FUN_140186cf0(local_30,param_7);
  FUN_140186cf0(local_30,param_8);
  FUN_140186cf0(local_30,param_9);
  FUN_14003c9e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_AUTH_SEGA_TYPE",0x5fd);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400318c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5fe);
  FUN_14007c6e0(local_30,*param_4);
  FUN_140186cf0(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_AUTH_SEGA_TYPE_RESULT",0x5fe);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400319c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5fe);
  FUN_14007c6e0(local_30,*param_5);
  FUN_140186cf0(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_AUTH_SEGA_TYPE_RESULT",0x5fe);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140031ad0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5ff);
  FUN_140186cf0(local_30,param_4);
  FUN_140186cf0(local_30,param_5);
  FUN_140186cf0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_AUTH_WAYI_TYPE",0x5ff);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140031bd0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x5ff);
  FUN_140186cf0(local_30,param_5);
  FUN_140186cf0(local_30,param_6);
  FUN_140186cf0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_AUTH_WAYI_TYPE",0x5ff);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140031cd0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x600);
  FUN_140186cf0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_AUTH_WAYI_TYPE_RESULT",0x600);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140031db0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x600);
  FUN_140186cf0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_AUTH_WAYI_TYPE_RESULT",0x600);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140031e90(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined1 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x601);
  FUN_140186cf0(local_30,param_4);
  FUN_140186cf0(local_30,param_5);
  FUN_14003c9e0(local_30,*param_6);
  FUN_140186cf0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_AUTH_XUNLEI_TYPE",0x601);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140031fa0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined1 *param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x601);
  FUN_140186cf0(local_30,param_5);
  FUN_140186cf0(local_30,param_6);
  FUN_14003c9e0(local_30,*param_7);
  FUN_140186cf0(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_AUTH_XUNLEI_TYPE",0x601);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400320c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x602);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_AUTH_XUNLEI_TYPE_RESULT",0x602);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400321a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x602);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_AUTH_XUNLEI_TYPE_RESULT",0x602);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140032280(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x603);
  FUN_140186cf0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PG_KEY_ADD_AUTH_WPIN_OTHER",0x603);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140032360(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x603);
  FUN_140186cf0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PG_KEY_ADD_AUTH_WPIN_OTHER",0x603);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140032440(longlong *param_1,int *param_2,undefined2 **param_3)

{
  undefined2 *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  undefined2 *puVar5;
  char cVar6;
  undefined4 uVar7;
  DWORD DVar8;
  DWORD DVar9;
  undefined8 *puVar10;
  undefined8 uVar11;
  undefined8 uVar12;
  undefined1 auStack_158 [32];
  undefined2 *local_138;
  undefined2 *local_128;
  undefined2 *local_120;
  undefined *local_118;
  int local_110 [2];
  undefined8 local_108;
  wchar_t *local_100;
  int local_f8;
  undefined2 **local_f0;
  int local_e8;
  undefined2 **local_e0;
  undefined *local_d8;
  undefined8 local_d0;
  undefined1 local_c8;
  undefined8 local_c0;
  undefined1 local_b8 [4];
  int local_b4;
  undefined2 **local_80;
  undefined1 local_58 [16];
  ulonglong local_48;
  
  local_c0 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_158;
  iVar3 = param_2[10];
  local_e0 = param_3;
  if (iVar3 == 0) {
    FUN_140169430(param_1,0);
  }
  iVar4 = *param_2;
  cVar6 = FUN_140185e40(param_2,local_110);
  if ((cVar6 == '\0') || (local_110[0] != 0xa8d)) {
    FUN_140185160(param_2,(int)((iVar4 >> 0x1f & 7U) + iVar4) >> 3);
    uVar11 = 0;
  }
  else {
    FUN_140140af0(local_b8);
    local_b4 = param_2[10];
    local_b8[0] = (undefined1)param_2[0x10];
    local_80 = param_3;
    FUN_1401a2570(param_2,local_58);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"G2G_ALREADY_LOGIN");
    DVar8 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_138 = &DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar3,0xa8d,L"G2G_ALREADY_LOGIN");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_128 = (undefined2 *)PTR_DAT_1402f8010;
      FUN_1401a2bd0(&local_128,local_58);
      FUN_14003c890(&local_128,&DAT_14027c73c);
      DVar9 = DVar8;
      if ((local_128 != (undefined2 *)0x0) && (local_128 != (undefined2 *)PTR_DAT_1402f8010)) {
        DVar9 = *(DWORD *)(local_128 + -4);
      }
      puVar10 = (undefined8 *)FUN_14003c0c0(&local_128,&local_d8,DVar9 - 2);
      if (local_128 == (undefined2 *)0x0) {
        local_128 = (undefined2 *)PTR_DAT_1402f8010;
      }
      if ((undefined2 *)*puVar10 != local_128) {
        uVar11 = FUN_1400a3440();
        local_d0 = uVar11;
        FUN_1400a1c30(uVar11);
        puVar5 = local_128;
        local_c8 = 1;
        if (((local_128 != (undefined2 *)0x0) && (local_128 != (undefined2 *)PTR_DAT_1402f8010)) &&
           (puVar1 = local_128 + -4, puVar1 != (undefined2 *)0x0)) {
          uVar12 = FUN_1400a3440();
          local_108 = uVar12;
          FUN_1400a1c30(uVar12);
          local_100 = (wchar_t *)CONCAT71(local_100._1_7_,1);
          piVar2 = (int *)(puVar5 + -2);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_1400a3530(puVar1);
          }
          FUN_1400d1290(uVar12);
        }
        local_128 = (undefined2 *)*puVar10;
        if (((local_128 != (undefined2 *)PTR_DAT_1402f8010) && (local_128 != (undefined2 *)0x0)) &&
           (local_128 != (undefined2 *)0x8)) {
          *(int *)(local_128 + -2) = *(int *)(local_128 + -2) + 1;
        }
        FUN_1400d1290(uVar11);
        param_3 = local_e0;
      }
      if (((local_d8 != (undefined *)0x0) && (local_d8 != PTR_DAT_1402f8010)) &&
         (local_d8 + -8 != (undefined *)0x0)) {
        uVar11 = FUN_1400a3440();
        local_108 = uVar11;
        FUN_1400a1c30(uVar11);
        local_100 = (wchar_t *)CONCAT71(local_100._1_7_,1);
        piVar2 = (int *)(local_d8 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(local_d8 + -8);
        }
        FUN_1400d1290(uVar11);
      }
      local_e0 = &local_120;
      local_d8 = PTR_DAT_1402f8010;
      FUN_1400a3440();
      local_120 = (undefined2 *)PTR_DAT_1402f8010;
      if (PTR_DAT_1402f8010 == (undefined *)0x0) {
        local_120 = (undefined2 *)0x0;
      }
      if (local_128 != (undefined2 *)PTR_DAT_1402f8010) {
        uVar11 = FUN_1400a3440();
        local_108 = uVar11;
        FUN_1400a1c30(uVar11);
        local_100 = (wchar_t *)CONCAT71(local_100._1_7_,1);
        FUN_1400031d0(&local_120);
        local_120 = local_128;
        if (((local_128 != (undefined2 *)PTR_DAT_1402f8010) && (local_128 != (undefined2 *)0x0)) &&
           (local_128 != (undefined2 *)0x8)) {
          *(int *)(local_128 + -2) = *(int *)(local_128 + -2) + 1;
        }
        FUN_1400d1290(uVar11);
      }
      FUN_1400a3440();
      local_118 = PTR_DAT_1402f8010;
      uVar7 = FUN_1400a32c0(L"G2G_ALREADY_LOGIN");
      uVar11 = FUN_140002f20(&local_118,uVar7);
      FUN_1400a32f0(uVar11,L"G2G_ALREADY_LOGIN",uVar7);
      FUN_140003000(&local_118);
      (**(code **)(*param_1 + 0x28))(param_1,0xa8d,&local_118,&local_120);
      local_138 = local_128;
      if (local_128 == (undefined2 *)0x0) {
        local_138 = (undefined2 *)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar3,0xa8d,L"G2G_ALREADY_LOGIN");
      puVar5 = local_128;
      if (((local_128 != (undefined2 *)0x0) && (local_128 != (undefined2 *)PTR_DAT_1402f8010)) &&
         (puVar1 = local_128 + -4, puVar1 != (undefined2 *)0x0)) {
        uVar11 = FUN_1400a3440();
        local_108 = uVar11;
        FUN_1400a1c30(uVar11);
        local_100 = (wchar_t *)CONCAT71(local_100._1_7_,1);
        piVar2 = (int *)(puVar5 + -2);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(puVar1);
        }
        FUN_1400d1290(uVar11);
      }
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_108 = CONCAT44(local_108._4_4_,0xa8d);
      local_100 = L"G2G_ALREADY_LOGIN";
      local_f8 = iVar3;
      local_f0 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_108);
      DVar8 = GetTickCount();
    }
    cVar6 = (**(code **)(*param_1 + 0x38))(param_1,iVar3,local_b8,local_58);
    if (cVar6 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"G2G_ALREADY_LOGIN");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_108 = CONCAT44(local_108._4_4_,0xa8d);
      local_100 = L"G2G_ALREADY_LOGIN";
      local_f8 = iVar3;
      local_f0 = param_3;
      DVar9 = GetTickCount();
      local_e8 = DVar9 - DVar8;
      (**(code **)(*param_1 + 0x18))(param_1,&local_108);
    }
    uVar11 = 1;
  }
  return uVar11;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

undefined8 FUN_1400328f0(longlong *param_1,int *param_2,undefined8 param_3)

{
  int *piVar1;
  int iVar2;
  char cVar3;
  undefined4 uVar4;
  DWORD DVar5;
  DWORD DVar6;
  undefined8 *******pppppppuVar7;
  undefined8 ******ppppppuVar8;
  undefined8 *******pppppppuVar9;
  undefined8 uVar10;
  undefined2 uVar11;
  undefined1 uVar12;
  undefined8 *******pppppppuVar13;
  wchar_t *pwVar14;
  int iVar15;
  undefined1 auStack_368 [32];
  undefined8 *******local_348;
  longlong **local_340;
  undefined8 ******local_338;
  undefined **local_330;
  undefined4 *local_328;
  undefined **local_320;
  undefined **local_318;
  undefined4 *local_310;
  undefined4 *local_308;
  longlong **local_300;
  undefined4 *local_2f8;
  undefined8 *******local_2e8;
  undefined8 local_2e0;
  undefined1 local_2d8 [8];
  undefined1 local_2d0 [8];
  undefined8 local_2c8;
  undefined2 local_2c0 [4];
  undefined *local_2b8;
  undefined *local_2b0;
  undefined1 local_2a8 [4];
  int local_2a4;
  undefined8 local_270;
  undefined8 *******local_248;
  undefined8 *******local_240;
  undefined *local_238;
  undefined8 *******local_230;
  undefined *local_228;
  undefined8 *******local_220;
  undefined8 *******local_218;
  undefined8 ******local_210;
  undefined *local_208;
  undefined8 ******local_200;
  undefined *local_1f8;
  undefined8 ******local_1f0;
  undefined *local_1e8;
  undefined8 ******local_1e0;
  undefined8 ******local_1d8;
  undefined8 ******local_1d0;
  undefined4 local_1c8 [2];
  undefined8 ******local_1c0;
  undefined8 ******local_1b8;
  undefined *local_1b0;
  undefined *local_1a8;
  undefined *local_1a0;
  undefined *local_198;
  undefined *local_190;
  undefined *local_188;
  undefined *local_180;
  undefined1 local_178 [8];
  undefined1 local_170 [8];
  undefined1 local_168 [8];
  undefined1 local_160 [8];
  undefined1 local_158 [8];
  undefined1 local_150 [8];
  undefined1 local_148 [8];
  undefined1 local_140 [8];
  undefined8 local_138;
  undefined1 local_130 [8];
  undefined1 local_128 [8];
  undefined1 local_120 [8];
  undefined1 local_118 [8];
  undefined1 local_110 [8];
  undefined1 local_108 [8];
  undefined1 local_100 [8];
  undefined1 local_f8 [8];
  undefined8 ******local_f0;
  wchar_t *local_e8;
  int local_e0;
  undefined8 local_d8;
  int local_d0;
  undefined8 *******local_c8;
  wchar_t *pwStack_c0;
  int local_b8;
  undefined8 local_b0;
  int local_a8;
  longlong *local_98 [2];
  undefined8 *******local_88;
  wchar_t *pwStack_80;
  int local_78;
  undefined8 local_70;
  int local_68;
  undefined8 *******local_58 [2];
  ulonglong local_48;
  
  local_138 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_368;
  iVar2 = param_2[10];
  if (iVar2 == 0) {
    FUN_140169430(param_1,0);
  }
  iVar15 = *param_2;
  cVar3 = FUN_140185e40(param_2,local_1c8);
  if (cVar3 == '\0') {
switchD_140032994_default:
    FUN_140185160(param_2,(int)((iVar15 >> 0x1f & 7U) + iVar15) >> 3);
    uVar10 = 0;
  }
  else {
    local_270 = param_3;
    switch(local_1c8[0]) {
    case 0x9c5:
      FUN_140140af0(local_2a8);
      local_2a4 = param_2[10];
      local_2a8[0] = (undefined1)param_2[0x10];
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"GG_GAME_SERVER_INFO");
      DVar5 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_348 = (undefined8 *******)&DAT_14027d1a0;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0x9c5,L"GG_GAME_SERVER_INFO");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        pppppppuVar13 = (undefined8 *******)PTR_DAT_1402f8010;
        local_58[0] = (undefined8 *******)PTR_DAT_1402f8010;
        local_98[0] = (longlong *)FUN_14003c0c0(local_58,&local_1a0,0xfffffffe);
        if (pppppppuVar13 == (undefined8 *******)0x0) {
          pppppppuVar13 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        local_58[0] = pppppppuVar13;
        if ((undefined8 *******)*local_98[0] != pppppppuVar13) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          if (((pppppppuVar13 != (undefined8 *******)0x0) &&
              (pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010)) &&
             (pppppppuVar13 + -1 != (undefined8 *******)0x0)) {
            pppppppuVar7 = (undefined8 *******)FUN_1400a3440();
            local_88 = pppppppuVar7;
            FUN_1400a1c30(pppppppuVar7);
            pwStack_80 = (wchar_t *)CONCAT71(pwStack_80._1_7_,1);
            piVar1 = (int *)((longlong)pppppppuVar13 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(pppppppuVar13 + -1);
            }
            FUN_1400d1290(pppppppuVar7);
          }
          pppppppuVar13 = (undefined8 *******)*local_98[0];
          if (((pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010) &&
              (pppppppuVar13 != (undefined8 *******)0x0)) &&
             (pppppppuVar13 != (undefined8 *******)0x8)) {
            *(int *)((longlong)pppppppuVar13 + -4) = *(int *)((longlong)pppppppuVar13 + -4) + 1;
          }
          local_58[0] = pppppppuVar13;
          FUN_1400d1290(ppppppuVar8);
        }
        if (((local_1a0 != (undefined *)0x0) && (local_1a0 != PTR_DAT_1402f8010)) &&
           (local_1a0 + -8 != (undefined *)0x0)) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          piVar1 = (int *)(local_1a0 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_1a0 + -8);
          }
          FUN_1400d1290(ppppppuVar8);
        }
        local_c8 = &local_230;
        local_1a0 = PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_230 = (undefined8 *******)PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_230 = (undefined8 *******)0x0;
        }
        if (pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          FUN_1400031d0(&local_230);
          if (((pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010) &&
              (pppppppuVar13 != (undefined8 *******)0x0)) &&
             (pppppppuVar13 != (undefined8 *******)0x8)) {
            *(int *)((longlong)pppppppuVar13 + -4) = *(int *)((longlong)pppppppuVar13 + -4) + 1;
          }
          local_230 = pppppppuVar13;
          FUN_1400d1290(ppppppuVar8);
        }
        FUN_1400a3440();
        local_208 = PTR_DAT_1402f8010;
        uVar4 = FUN_1400a32c0(L"GG_GAME_SERVER_INFO");
        uVar10 = FUN_140002f20(&local_208,uVar4);
        FUN_1400a32f0(uVar10,L"GG_GAME_SERVER_INFO",uVar4);
        FUN_140003000(&local_208);
        (**(code **)(*param_1 + 0x28))(param_1,0x9c5,&local_208,&local_230);
        local_348 = pppppppuVar13;
        if (pppppppuVar13 == (undefined8 *******)0x0) {
          local_348 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x9c5,L"GG_GAME_SERVER_INFO");
        if (((pppppppuVar13 != (undefined8 *******)0x0) &&
            (pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010)) &&
           (pppppppuVar13 + -1 != (undefined8 *******)0x0)) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          piVar1 = (int *)((longlong)pppppppuVar13 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(pppppppuVar13 + -1);
          }
          FUN_1400d1290(ppppppuVar8);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9c5);
        local_e8 = L"GG_GAME_SERVER_INFO";
        local_e0 = iVar2;
        local_d8 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_f0);
        DVar5 = GetTickCount();
      }
      cVar3 = (**(code **)(*param_1 + 0x38))(param_1,iVar2,local_2a8);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"GG_GAME_SERVER_INFO")
        ;
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9c5);
        local_e8 = L"GG_GAME_SERVER_INFO";
LAB_140032d26:
        local_e0 = iVar2;
        local_d8 = param_3;
        DVar6 = GetTickCount();
        local_d0 = DVar6 - DVar5;
        pppppppuVar13 = &local_f0;
LAB_140035ab7:
        (**(code **)(*param_1 + 0x18))(param_1,pppppppuVar13);
      }
      break;
    case 0x9c6:
      FUN_140140af0(local_2a8);
      local_2a4 = param_2[10];
      local_2a8[0] = (undefined1)param_2[0x10];
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"GG_GAME_SERVER_ONE_DAY_RESET");
      DVar5 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_348 = (undefined8 *******)&DAT_14027d1a0;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0x9c6,L"GG_GAME_SERVER_ONE_DAY_RESET");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        pppppppuVar13 = (undefined8 *******)PTR_DAT_1402f8010;
        local_58[0] = (undefined8 *******)PTR_DAT_1402f8010;
        local_98[0] = (longlong *)FUN_14003c0c0(local_58,&local_188,0xfffffffe);
        if (pppppppuVar13 == (undefined8 *******)0x0) {
          pppppppuVar13 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        local_58[0] = pppppppuVar13;
        if ((undefined8 *******)*local_98[0] != pppppppuVar13) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          if (((pppppppuVar13 != (undefined8 *******)0x0) &&
              (pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010)) &&
             (pppppppuVar13 + -1 != (undefined8 *******)0x0)) {
            pppppppuVar7 = (undefined8 *******)FUN_1400a3440();
            local_88 = pppppppuVar7;
            FUN_1400a1c30(pppppppuVar7);
            pwStack_80 = (wchar_t *)CONCAT71(pwStack_80._1_7_,1);
            piVar1 = (int *)((longlong)pppppppuVar13 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(pppppppuVar13 + -1);
            }
            FUN_1400d1290(pppppppuVar7);
          }
          pppppppuVar13 = (undefined8 *******)*local_98[0];
          if (((pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010) &&
              (pppppppuVar13 != (undefined8 *******)0x0)) &&
             (pppppppuVar13 != (undefined8 *******)0x8)) {
            *(int *)((longlong)pppppppuVar13 + -4) = *(int *)((longlong)pppppppuVar13 + -4) + 1;
          }
          local_58[0] = pppppppuVar13;
          FUN_1400d1290(ppppppuVar8);
        }
        if (((local_188 != (undefined *)0x0) && (local_188 != PTR_DAT_1402f8010)) &&
           (local_188 + -8 != (undefined *)0x0)) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          piVar1 = (int *)(local_188 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_188 + -8);
          }
          FUN_1400d1290(ppppppuVar8);
        }
        local_c8 = &local_218;
        local_188 = PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_218 = (undefined8 *******)PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_218 = (undefined8 *******)0x0;
        }
        if (pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          FUN_1400031d0(&local_218);
          if (((pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010) &&
              (pppppppuVar13 != (undefined8 *******)0x0)) &&
             (pppppppuVar13 != (undefined8 *******)0x8)) {
            *(int *)((longlong)pppppppuVar13 + -4) = *(int *)((longlong)pppppppuVar13 + -4) + 1;
          }
          local_218 = pppppppuVar13;
          FUN_1400d1290(ppppppuVar8);
        }
        FUN_1400a3440();
        local_1a8 = PTR_DAT_1402f8010;
        uVar4 = FUN_1400a32c0(L"GG_GAME_SERVER_ONE_DAY_RESET");
        uVar10 = FUN_140002f20(&local_1a8,uVar4);
        FUN_1400a32f0(uVar10,L"GG_GAME_SERVER_ONE_DAY_RESET",uVar4);
        FUN_140003000(&local_1a8);
        (**(code **)(*param_1 + 0x28))(param_1,0x9c6,&local_1a8,&local_218);
        local_348 = pppppppuVar13;
        if (pppppppuVar13 == (undefined8 *******)0x0) {
          local_348 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x9c6,L"GG_GAME_SERVER_ONE_DAY_RESET");
        if (((pppppppuVar13 != (undefined8 *******)0x0) &&
            (pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010)) &&
           (pppppppuVar13 + -1 != (undefined8 *******)0x0)) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          piVar1 = (int *)((longlong)pppppppuVar13 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(pppppppuVar13 + -1);
          }
          FUN_1400d1290(ppppppuVar8);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9c6);
        local_e8 = L"GG_GAME_SERVER_ONE_DAY_RESET";
        local_e0 = iVar2;
        local_d8 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_f0);
        DVar5 = GetTickCount();
      }
      cVar3 = (**(code **)(*param_1 + 0x40))(param_1,iVar2,local_2a8);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"GG_GAME_SERVER_ONE_DAY_RESET");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9c6);
        local_e8 = L"GG_GAME_SERVER_ONE_DAY_RESET";
        goto LAB_140032d26;
      }
      break;
    case 0x9c7:
      FUN_140140af0(local_2a8);
      local_2a4 = param_2[10];
      local_2a8[0] = (undefined1)param_2[0x10];
      local_88 = (undefined8 *******)0x0;
      pwStack_80 = (wchar_t *)0x0;
      local_c8 = (undefined8 *******)0x0;
      pwStack_c0 = (wchar_t *)0x0;
      cVar3 = FUN_140185490(param_2,&local_c8,0x10);
      if (cVar3 != '\0') {
        local_88 = local_c8;
        pwStack_80 = pwStack_c0;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"GG_CLIENT_AUTH_INFO");
      DVar5 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_348 = (undefined8 *******)&DAT_14027d1a0;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0x9c7,L"GG_CLIENT_AUTH_INFO");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_2e8 = (undefined8 *******)PTR_DAT_1402f8010;
        FUN_1401a2bd0(&local_2e8,&local_88);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        iVar15 = 0;
        if ((local_2e8 != (undefined8 *******)0x0) &&
           (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) {
          iVar15 = *(int *)(local_2e8 + -1);
        }
        local_98[0] = (longlong *)FUN_14003c0c0(&local_2e8,&local_198,iVar15 + -2);
        if (local_2e8 == (undefined8 *******)0x0) {
          local_2e8 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        if ((undefined8 *******)*local_98[0] != local_2e8) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          pppppppuVar13 = local_2e8;
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          if (((local_2e8 != (undefined8 *******)0x0) &&
              (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) &&
             (pppppppuVar7 = local_2e8 + -1, pppppppuVar7 != (undefined8 *******)0x0)) {
            pppppppuVar9 = (undefined8 *******)FUN_1400a3440();
            local_c8 = pppppppuVar9;
            FUN_1400a1c30(pppppppuVar9);
            pwStack_c0 = (wchar_t *)CONCAT71(pwStack_c0._1_7_,1);
            piVar1 = (int *)((longlong)pppppppuVar13 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(pppppppuVar7);
            }
            FUN_1400d1290(pppppppuVar9);
          }
          local_2e8 = (undefined8 *******)*local_98[0];
          if (((local_2e8 != (undefined8 *******)PTR_DAT_1402f8010) &&
              (local_2e8 != (undefined8 *******)0x0)) && (local_2e8 != (undefined8 *******)0x8)) {
            *(int *)((longlong)local_2e8 + -4) = *(int *)((longlong)local_2e8 + -4) + 1;
          }
          FUN_1400d1290(ppppppuVar8);
        }
        if (((local_198 != (undefined *)0x0) && (local_198 != PTR_DAT_1402f8010)) &&
           (local_198 + -8 != (undefined *)0x0)) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          piVar1 = (int *)(local_198 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_198 + -8);
          }
          FUN_1400d1290(ppppppuVar8);
        }
        local_c8 = &local_220;
        local_198 = PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_220 = (undefined8 *******)PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_220 = (undefined8 *******)0x0;
        }
        if (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          FUN_1400031d0(&local_220);
          local_220 = local_2e8;
          if (((local_2e8 != (undefined8 *******)PTR_DAT_1402f8010) &&
              (local_2e8 != (undefined8 *******)0x0)) && (local_2e8 != (undefined8 *******)0x8)) {
            *(int *)((longlong)local_2e8 + -4) = *(int *)((longlong)local_2e8 + -4) + 1;
          }
          FUN_1400d1290(ppppppuVar8);
        }
        FUN_1400a3440();
        local_1f8 = PTR_DAT_1402f8010;
        uVar4 = FUN_1400a32c0(L"GG_CLIENT_AUTH_INFO");
        uVar10 = FUN_140002f20(&local_1f8,uVar4);
        FUN_1400a32f0(uVar10,L"GG_CLIENT_AUTH_INFO",uVar4);
        FUN_140003000(&local_1f8);
        (**(code **)(*param_1 + 0x28))(param_1,0x9c7,&local_1f8,&local_220);
        local_348 = local_2e8;
        if (local_2e8 == (undefined8 *******)0x0) {
          local_348 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x9c7,L"GG_CLIENT_AUTH_INFO");
        pppppppuVar13 = local_2e8;
        if (((local_2e8 != (undefined8 *******)0x0) &&
            (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) &&
           (pppppppuVar7 = local_2e8 + -1, pppppppuVar7 != (undefined8 *******)0x0)) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          piVar1 = (int *)((longlong)pppppppuVar13 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(pppppppuVar7);
          }
          FUN_1400d1290(ppppppuVar8);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9c7);
        local_e8 = L"GG_CLIENT_AUTH_INFO";
        local_e0 = iVar2;
        local_d8 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_f0);
        DVar5 = GetTickCount();
      }
      cVar3 = (**(code **)(*param_1 + 0x48))(param_1,iVar2,local_2a8,&local_88);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"GG_CLIENT_AUTH_INFO")
        ;
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9c7);
        local_e8 = L"GG_CLIENT_AUTH_INFO";
        goto LAB_140032d26;
      }
      break;
    case 0x9c8:
      FUN_140140af0(local_2a8);
      local_2a4 = param_2[10];
      local_2a8[0] = (undefined1)param_2[0x10];
      local_88 = (undefined8 *******)0x0;
      pwStack_80 = (wchar_t *)0x0;
      local_c8 = (undefined8 *******)0x0;
      pwStack_c0 = (wchar_t *)0x0;
      cVar3 = FUN_140185490(param_2,&local_c8,0x10);
      if (cVar3 != '\0') {
        local_88 = local_c8;
        pwStack_80 = pwStack_c0;
      }
      FUN_1401a2570(param_2,local_58);
      cVar3 = FUN_140185490(param_2,(undefined4 *)((longlong)&local_2e0 + 4),2);
      uVar11 = (undefined2)local_2c8;
      if (cVar3 != '\0') {
        uVar11 = local_2e0._4_2_;
      }
      local_2c8._0_4_ = CONCAT22(local_2c8._2_2_,uVar11);
      cVar3 = FUN_140185490(param_2,(undefined4 *)((longlong)&local_2e0 + 4),1);
      uVar12 = local_2d0[4];
      if (cVar3 != '\0') {
        uVar12 = local_2e0._4_1_;
      }
      local_2d0[4] = uVar12;
      cVar3 = FUN_140185490(param_2,(undefined4 *)((longlong)&local_2e0 + 4),1);
      uVar12 = local_2c8._4_1_;
      if (cVar3 != '\0') {
        uVar12 = local_2e0._4_1_;
      }
      local_2c8._4_4_ = CONCAT31(local_2c8._5_3_,uVar12);
      FUN_140185490(param_2,&local_2e0,4);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"GG_CLIENT_AUTH_INFO_SUCC_U");
      DVar5 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_348 = (undefined8 *******)&DAT_14027d1a0;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0x9c8,L"GG_CLIENT_AUTH_INFO_SUCC_U");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_2e8 = (undefined8 *******)PTR_DAT_1402f8010;
        FUN_1401a2bd0(&local_2e8,&local_88);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2bd0(&local_2e8,local_58);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2800(&local_2e8,&local_2c8);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a27a0(&local_2e8,local_2d0 + 4);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a27a0(&local_2e8,(undefined4 *)((longlong)&local_2c8 + 4));
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,local_2d0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        iVar15 = 0;
        if ((local_2e8 != (undefined8 *******)0x0) &&
           (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) {
          iVar15 = *(int *)(local_2e8 + -1);
        }
        local_98[0] = (longlong *)FUN_14003c0c0(&local_2e8,&local_190,iVar15 + -2);
        if (local_2e8 == (undefined8 *******)0x0) {
          local_2e8 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        if ((undefined8 *******)*local_98[0] != local_2e8) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          pppppppuVar13 = local_2e8;
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          if (((local_2e8 != (undefined8 *******)0x0) &&
              (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) &&
             (pppppppuVar7 = local_2e8 + -1, pppppppuVar7 != (undefined8 *******)0x0)) {
            pppppppuVar9 = (undefined8 *******)FUN_1400a3440();
            local_c8 = pppppppuVar9;
            FUN_1400a1c30(pppppppuVar9);
            pwStack_c0 = (wchar_t *)CONCAT71(pwStack_c0._1_7_,1);
            piVar1 = (int *)((longlong)pppppppuVar13 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(pppppppuVar7);
            }
            FUN_1400d1290(pppppppuVar9);
          }
          local_2e8 = (undefined8 *******)*local_98[0];
          if (((local_2e8 != (undefined8 *******)PTR_DAT_1402f8010) &&
              (local_2e8 != (undefined8 *******)0x0)) && (local_2e8 != (undefined8 *******)0x8)) {
            *(int *)((longlong)local_2e8 + -4) = *(int *)((longlong)local_2e8 + -4) + 1;
          }
          FUN_1400d1290(ppppppuVar8);
        }
        if (((local_190 != (undefined *)0x0) && (local_190 != PTR_DAT_1402f8010)) &&
           (local_190 + -8 != (undefined *)0x0)) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          piVar1 = (int *)(local_190 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_190 + -8);
          }
          FUN_1400d1290(ppppppuVar8);
        }
        local_c8 = &local_248;
        local_190 = PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_248 = (undefined8 *******)PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_248 = (undefined8 *******)0x0;
        }
        if (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          FUN_1400031d0(&local_248);
          local_248 = local_2e8;
          if (((local_2e8 != (undefined8 *******)PTR_DAT_1402f8010) &&
              (local_2e8 != (undefined8 *******)0x0)) && (local_2e8 != (undefined8 *******)0x8)) {
            *(int *)((longlong)local_2e8 + -4) = *(int *)((longlong)local_2e8 + -4) + 1;
          }
          FUN_1400d1290(ppppppuVar8);
        }
        FUN_1400a3440();
        local_1b0 = PTR_DAT_1402f8010;
        uVar4 = FUN_1400a32c0(L"GG_CLIENT_AUTH_INFO_SUCC_U");
        uVar10 = FUN_140002f20(&local_1b0,uVar4);
        FUN_1400a32f0(uVar10,L"GG_CLIENT_AUTH_INFO_SUCC_U",uVar4);
        FUN_140003000(&local_1b0);
        (**(code **)(*param_1 + 0x28))(param_1,0x9c8,&local_1b0,&local_248);
        local_348 = local_2e8;
        if (local_2e8 == (undefined8 *******)0x0) {
          local_348 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x9c8,L"GG_CLIENT_AUTH_INFO_SUCC_U");
        pppppppuVar13 = local_2e8;
        if (((local_2e8 != (undefined8 *******)0x0) &&
            (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) &&
           (pppppppuVar7 = local_2e8 + -1, pppppppuVar7 != (undefined8 *******)0x0)) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          piVar1 = (int *)((longlong)pppppppuVar13 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(pppppppuVar7);
          }
          FUN_1400d1290(ppppppuVar8);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9c8);
        local_e8 = L"GG_CLIENT_AUTH_INFO_SUCC_U";
        local_e0 = iVar2;
        local_d8 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_f0);
        DVar5 = GetTickCount();
      }
      local_328 = (undefined4 *)local_2d0;
      local_330 = (undefined **)((longlong)&local_2c8 + 4);
      local_338 = (undefined8 ******)(local_2d0 + 4);
      local_340 = (longlong **)&local_2c8;
      local_348 = local_58;
      cVar3 = (**(code **)(*param_1 + 0x50))(param_1,iVar2,local_2a8,&local_88);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"GG_CLIENT_AUTH_INFO_SUCC_U");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9c8);
        local_e8 = L"GG_CLIENT_AUTH_INFO_SUCC_U";
        goto LAB_140032d26;
      }
      break;
    case 0x9c9:
      FUN_140140af0(local_2a8);
      local_2a4 = param_2[10];
      local_2a8[0] = (undefined1)param_2[0x10];
      local_88 = (undefined8 *******)0x0;
      pwStack_80 = (wchar_t *)0x0;
      local_c8 = (undefined8 *******)0x0;
      pwStack_c0 = (wchar_t *)0x0;
      cVar3 = FUN_140185490(param_2,&local_c8,0x10);
      if (cVar3 != '\0') {
        local_88 = local_c8;
        pwStack_80 = pwStack_c0;
      }
      FUN_140185490(param_2,&local_2e0,4);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"GG_CLIENT_AUTH_INFO_FAIL_U");
      DVar5 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_348 = (undefined8 *******)&DAT_14027d1a0;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0x9c9,L"GG_CLIENT_AUTH_INFO_FAIL_U");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_2e8 = (undefined8 *******)PTR_DAT_1402f8010;
        FUN_1401a2bd0(&local_2e8,&local_88);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2920(&local_2e8,local_2d0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        iVar15 = 0;
        if ((local_2e8 != (undefined8 *******)0x0) &&
           (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) {
          iVar15 = *(int *)(local_2e8 + -1);
        }
        local_98[0] = (longlong *)FUN_14003c0c0(&local_2e8,&local_180,iVar15 + -2);
        if (local_2e8 == (undefined8 *******)0x0) {
          local_2e8 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        if ((undefined8 *******)*local_98[0] != local_2e8) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          pppppppuVar13 = local_2e8;
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          if (((local_2e8 != (undefined8 *******)0x0) &&
              (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) &&
             (pppppppuVar7 = local_2e8 + -1, pppppppuVar7 != (undefined8 *******)0x0)) {
            pppppppuVar9 = (undefined8 *******)FUN_1400a3440();
            local_c8 = pppppppuVar9;
            FUN_1400a1c30(pppppppuVar9);
            pwStack_c0 = (wchar_t *)CONCAT71(pwStack_c0._1_7_,1);
            piVar1 = (int *)((longlong)pppppppuVar13 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(pppppppuVar7);
            }
            FUN_1400d1290(pppppppuVar9);
          }
          local_2e8 = (undefined8 *******)*local_98[0];
          if (((local_2e8 != (undefined8 *******)PTR_DAT_1402f8010) &&
              (local_2e8 != (undefined8 *******)0x0)) && (local_2e8 != (undefined8 *******)0x8)) {
            *(int *)((longlong)local_2e8 + -4) = *(int *)((longlong)local_2e8 + -4) + 1;
          }
          FUN_1400d1290(ppppppuVar8);
        }
        if (((local_180 != (undefined *)0x0) && (local_180 != PTR_DAT_1402f8010)) &&
           (local_180 + -8 != (undefined *)0x0)) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          piVar1 = (int *)(local_180 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_180 + -8);
          }
          FUN_1400d1290(ppppppuVar8);
        }
        local_c8 = &local_240;
        local_180 = PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_240 = (undefined8 *******)PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_240 = (undefined8 *******)0x0;
        }
        if (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          FUN_1400031d0(&local_240);
          local_240 = local_2e8;
          if (((local_2e8 != (undefined8 *******)PTR_DAT_1402f8010) &&
              (local_2e8 != (undefined8 *******)0x0)) && (local_2e8 != (undefined8 *******)0x8)) {
            *(int *)((longlong)local_2e8 + -4) = *(int *)((longlong)local_2e8 + -4) + 1;
          }
          FUN_1400d1290(ppppppuVar8);
        }
        FUN_1400a3440();
        local_1e8 = PTR_DAT_1402f8010;
        uVar4 = FUN_1400a32c0(L"GG_CLIENT_AUTH_INFO_FAIL_U");
        uVar10 = FUN_140002f20(&local_1e8,uVar4);
        FUN_1400a32f0(uVar10,L"GG_CLIENT_AUTH_INFO_FAIL_U",uVar4);
        FUN_140003000(&local_1e8);
        (**(code **)(*param_1 + 0x28))(param_1,0x9c9,&local_1e8,&local_240);
        local_348 = local_2e8;
        if (local_2e8 == (undefined8 *******)0x0) {
          local_348 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x9c9,L"GG_CLIENT_AUTH_INFO_FAIL_U");
        pppppppuVar13 = local_2e8;
        if (((local_2e8 != (undefined8 *******)0x0) &&
            (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) &&
           (pppppppuVar7 = local_2e8 + -1, pppppppuVar7 != (undefined8 *******)0x0)) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          piVar1 = (int *)((longlong)pppppppuVar13 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(pppppppuVar7);
          }
          FUN_1400d1290(ppppppuVar8);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9c9);
        local_e8 = L"GG_CLIENT_AUTH_INFO_FAIL_U";
        local_e0 = iVar2;
        local_d8 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_f0);
        DVar5 = GetTickCount();
      }
      local_348 = (undefined8 *******)local_2d0;
      cVar3 = (**(code **)(*param_1 + 0x58))(param_1,iVar2,local_2a8,&local_88);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"GG_CLIENT_AUTH_INFO_FAIL_U");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9c9);
        local_e8 = L"GG_CLIENT_AUTH_INFO_FAIL_U";
        goto LAB_140032d26;
      }
      break;
    case 0x9ca:
      FUN_140140af0(local_2a8);
      local_2a4 = param_2[10];
      local_2a8[0] = (undefined1)param_2[0x10];
      FUN_140185490(param_2,(undefined4 *)((longlong)&local_2e0 + 4),4);
      FUN_140185490(param_2,(undefined4 *)((longlong)&local_2e0 + 4),4);
      FUN_140185490(param_2,(undefined4 *)((longlong)&local_2e0 + 4),4);
      FUN_140185490(param_2,(undefined4 *)((longlong)&local_2e0 + 4),4);
      FUN_140185490(param_2,(undefined4 *)((longlong)&local_2e0 + 4),4);
      cVar3 = FUN_140185490(param_2,(undefined4 *)((longlong)&local_2e0 + 4),1);
      uVar12 = local_2d0[4];
      if (cVar3 != '\0') {
        uVar12 = local_2e0._4_1_;
      }
      local_2d0[4] = uVar12;
      FUN_1400a3440();
      local_2b8 = PTR_DAT_1402f8010;
      thunk_FUN_1401865d0(param_2,&local_2b8);
      FUN_1400a3440();
      local_2b0 = PTR_DAT_1402f8010;
      thunk_FUN_1401865d0(param_2,&local_2b0);
      FUN_140185490(param_2,(undefined4 *)((longlong)&local_2e0 + 4),4);
      FUN_140185490(param_2,(undefined4 *)((longlong)&local_2e0 + 4),4);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"GG_GAME_SERVER_INFO_SUCC_U");
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_348 = (undefined8 *******)&DAT_14027d1a0;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0x9ca,L"GG_GAME_SERVER_INFO_SUCC_U");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_2e8 = (undefined8 *******)PTR_DAT_1402f8010;
        FUN_1401a28c0(&local_2e8,&local_2e0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,local_2d8);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,local_2d8 + 4);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,(undefined4 *)((longlong)&local_2c8 + 4));
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,&local_2c8);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2720(&local_2e8,local_2d0 + 4);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2b80(&local_2e8,&local_2b8);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2b80(&local_2e8,&local_2b0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2920(&local_2e8,local_2c0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,local_2d0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        iVar15 = 0;
        if ((local_2e8 != (undefined8 *******)0x0) &&
           (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) {
          iVar15 = *(int *)(local_2e8 + -1);
        }
        local_98[0] = (longlong *)FUN_14003c0c0(&local_2e8,local_178,iVar15 + -2);
        if (local_2e8 == (undefined8 *******)0x0) {
          local_2e8 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        if ((undefined8 *******)*local_98[0] != local_2e8) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_f0 = ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          pppppppuVar13 = local_2e8;
          local_e8 = (wchar_t *)CONCAT71(local_e8._1_7_,1);
          if (((local_2e8 != (undefined8 *******)0x0) &&
              (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) &&
             (pppppppuVar7 = local_2e8 + -1, pppppppuVar7 != (undefined8 *******)0x0)) {
            pppppppuVar9 = (undefined8 *******)FUN_1400a3440();
            local_88 = pppppppuVar9;
            FUN_1400a1c30(pppppppuVar9);
            pwStack_80 = (wchar_t *)CONCAT71(pwStack_80._1_7_,1);
            piVar1 = (int *)((longlong)pppppppuVar13 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(pppppppuVar7);
            }
            FUN_1400d1290(pppppppuVar9);
          }
          local_2e8 = (undefined8 *******)*local_98[0];
          if (((local_2e8 != (undefined8 *******)PTR_DAT_1402f8010) &&
              (local_2e8 != (undefined8 *******)0x0)) && (local_2e8 != (undefined8 *******)0x8)) {
            *(int *)((longlong)local_2e8 + -4) = *(int *)((longlong)local_2e8 + -4) + 1;
          }
          FUN_1400d1290(ppppppuVar8);
        }
        FUN_1400031d0(local_178);
        local_c8 = &local_1c0;
        FUN_1400a3440();
        local_1c0 = (undefined8 ******)PTR_DAT_1402f8010;
        FUN_140003100(&local_1c0,&local_2e8);
        uVar10 = FUN_140003080(local_120,L"GG_GAME_SERVER_INFO_SUCC_U",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x9ca,uVar10,&local_1c0);
        local_348 = local_2e8;
        if (local_2e8 == (undefined8 *******)0x0) {
          local_348 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x9ca,L"GG_GAME_SERVER_INFO_SUCC_U");
        FUN_1400031d0(&local_2e8);
      }
      DVar5 = 0;
      if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9ca);
        local_e8 = L"GG_GAME_SERVER_INFO_SUCC_U";
        local_e0 = iVar2;
        local_d8 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_f0);
        DVar5 = GetTickCount();
      }
      local_308 = (undefined4 *)local_2d0;
      local_310 = (undefined4 *)local_2c0;
      local_318 = &local_2b0;
      local_320 = &local_2b8;
      local_328 = (undefined4 *)(local_2d0 + 4);
      local_330 = (undefined **)&local_2c8;
      local_338 = (undefined8 ******)((longlong)&local_2c8 + 4);
      local_340 = (longlong **)(local_2d8 + 4);
      local_348 = (undefined8 *******)local_2d8;
      cVar3 = (**(code **)(*param_1 + 0x60))(param_1,iVar2,local_2a8,&local_2e0);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"GG_GAME_SERVER_INFO_SUCC_U");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9ca);
        local_e8 = L"GG_GAME_SERVER_INFO_SUCC_U";
        local_e0 = iVar2;
        local_d8 = param_3;
        DVar6 = GetTickCount();
        local_d0 = DVar6 - DVar5;
        (**(code **)(*param_1 + 0x18))(param_1,&local_f0);
      }
      FUN_1400031d0(&local_2b0);
      FUN_1400031d0(&local_2b8);
      break;
    case 0x9cb:
      FUN_140140af0(local_2a8);
      local_2a4 = param_2[10];
      local_2a8[0] = (undefined1)param_2[0x10];
      FUN_140185490(param_2,local_2c0,4);
      cVar3 = FUN_140185490(param_2,&local_2c8,4);
      if (cVar3 != '\0') {
        local_2d8._4_4_ = (undefined4)local_2c8;
      }
      FUN_140185490(param_2,(undefined4 *)((longlong)&local_2e0 + 4),4);
      cVar3 = FUN_140185490(param_2,local_2d0 + 4,4);
      if (cVar3 != '\0') {
        local_2e0._0_4_ = local_2d0._4_4_;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"GG_GAME_SERVER_CHANNEL_INFO");
      DVar5 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_348 = (undefined8 *******)&DAT_14027d1a0;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0x9cb,L"GG_GAME_SERVER_CHANNEL_INFO");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_2e8 = (undefined8 *******)PTR_DAT_1402f8010;
        FUN_1401a28c0(&local_2e8,local_2d0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,local_2d8 + 4);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,local_2d8);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,&local_2e0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        DVar6 = DVar5;
        if ((local_2e8 != (undefined8 *******)0x0) &&
           (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) {
          DVar6 = *(DWORD *)(local_2e8 + -1);
        }
        uVar10 = FUN_14003c0c0(&local_2e8,local_168,DVar6 - 2);
        FUN_140003100(&local_2e8,uVar10);
        FUN_1400031d0(local_168);
        local_c8 = &local_1d8;
        FUN_1400a3440();
        local_1d8 = (undefined8 ******)PTR_DAT_1402f8010;
        FUN_140003100(&local_1d8,&local_2e8);
        uVar10 = FUN_140003080(local_100,L"GG_GAME_SERVER_CHANNEL_INFO",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x9cb,uVar10,&local_1d8);
        local_348 = local_2e8;
        if (local_2e8 == (undefined8 *******)0x0) {
          local_348 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x9cb,L"GG_GAME_SERVER_CHANNEL_INFO");
        FUN_1400031d0(&local_2e8);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9cb);
        local_e8 = L"GG_GAME_SERVER_CHANNEL_INFO";
        local_e0 = iVar2;
        local_d8 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_f0);
        DVar5 = GetTickCount();
      }
      local_338 = (undefined8 ******)&local_2e0;
      local_340 = (longlong **)local_2d8;
      local_348 = (undefined8 *******)(local_2d8 + 4);
      cVar3 = (**(code **)(*param_1 + 0x68))(param_1,iVar2,local_2a8,local_2d0);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"GG_GAME_SERVER_CHANNEL_INFO");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9cb);
        local_e8 = L"GG_GAME_SERVER_CHANNEL_INFO";
        goto LAB_140032d26;
      }
      break;
    case 0x9cc:
      FUN_140140af0(local_2a8);
      local_2a4 = param_2[10];
      local_2a8[0] = (undefined1)param_2[0x10];
      cVar3 = FUN_140185490(param_2,local_2d8,4);
      if (cVar3 != '\0') {
        local_2e0._0_4_ = local_2d8._0_4_;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"GG_GAME_SERVER_INFO_FAIL_U");
      DVar5 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_348 = (undefined8 *******)&DAT_14027d1a0;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0x9cc,L"GG_GAME_SERVER_INFO_FAIL_U");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_2e8 = (undefined8 *******)PTR_DAT_1402f8010;
        FUN_1401a2920(&local_2e8,&local_2e0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        DVar6 = DVar5;
        if ((local_2e8 != (undefined8 *******)0x0) &&
           (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) {
          DVar6 = *(DWORD *)(local_2e8 + -1);
        }
        uVar10 = FUN_14003c0c0(&local_2e8,local_148,DVar6 - 2);
        FUN_140003100(&local_2e8,uVar10);
        FUN_1400031d0(local_148);
        local_c8 = &local_1b8;
        FUN_1400a3440();
        local_1b8 = (undefined8 ******)PTR_DAT_1402f8010;
        FUN_140003100(&local_1b8,&local_2e8);
        uVar10 = FUN_140003080(local_110,L"GG_GAME_SERVER_INFO_FAIL_U",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x9cc,uVar10,&local_1b8);
        local_348 = local_2e8;
        if (local_2e8 == (undefined8 *******)0x0) {
          local_348 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x9cc,L"GG_GAME_SERVER_INFO_FAIL_U");
        FUN_1400031d0(&local_2e8);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9cc);
        local_e8 = L"GG_GAME_SERVER_INFO_FAIL_U";
        local_e0 = iVar2;
        local_d8 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_f0);
        DVar5 = GetTickCount();
      }
      cVar3 = (**(code **)(*param_1 + 0x70))(param_1,iVar2,local_2a8,&local_2e0);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"GG_GAME_SERVER_INFO_FAIL_U");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9cc);
        local_e8 = L"GG_GAME_SERVER_INFO_FAIL_U";
        goto LAB_140032d26;
      }
      break;
    case 0x9cd:
      FUN_140140af0(local_2a8);
      local_2a4 = param_2[10];
      local_2a8[0] = (undefined1)param_2[0x10];
      FUN_1400a3440();
      local_58[0] = (undefined8 *******)PTR_DAT_1402f8008;
      thunk_FUN_140186270(param_2,local_58);
      local_88 = (undefined8 *******)0x0;
      pwStack_80 = (wchar_t *)0x0;
      FUN_14003c7f0(param_2,&local_88);
      cVar3 = FUN_140185490(param_2,(undefined4 *)((longlong)&local_2c8 + 4),2);
      uVar11 = local_2d0._4_2_;
      if (cVar3 != '\0') {
        uVar11 = local_2c8._4_2_;
      }
      local_2d0._4_2_ = uVar11;
      FUN_1401a2570(param_2,&local_f0);
      FUN_1400a3440();
      local_228 = PTR_DAT_1402f8010;
      thunk_FUN_1401865d0(param_2,&local_228);
      FUN_140185490(param_2,&local_2b8,4);
      FUN_1400a3440();
      local_238 = PTR_DAT_1402f8010;
      thunk_FUN_1401865d0(param_2,&local_238);
      FUN_140185490(param_2,&local_2b0,4);
      cVar3 = FUN_140185490(param_2,&local_2e8,4);
      if (cVar3 != '\0') {
        local_2e0._0_4_ = local_2e8._0_4_;
      }
      cVar3 = FUN_140185490(param_2,local_2c0,2);
      uVar11 = local_2e0._4_2_;
      if (cVar3 != '\0') {
        uVar11 = local_2c0[0];
      }
      local_2e0._4_4_ = CONCAT22(local_2e0._6_2_,uVar11);
      FUN_140185490(param_2,&local_c8,8);
      cVar3 = FUN_140185490(param_2,local_2d0,2);
      uVar11 = (undefined2)local_2c8;
      if (cVar3 != '\0') {
        uVar11 = local_2d0._0_2_;
      }
      local_2c8._0_4_ = CONCAT22(local_2c8._2_2_,uVar11);
      (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,L"GG_REQ_LOGOUT")
      ;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_348 = (undefined8 *******)&DAT_14027d1a0;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0x9cd,L"GG_REQ_LOGOUT");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_2e8 = (undefined8 *******)PTR_DAT_1402f8010;
        FUN_1401a2ac0(&local_2e8,local_58);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2bd0(&local_2e8,&local_88);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2860(&local_2e8,local_2d0 + 4);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2bd0(&local_2e8,&local_f0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2b80(&local_2e8,&local_228);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,local_2d8 + 4);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2b80(&local_2e8,&local_238);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,local_2d8);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,&local_2e0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2800(&local_2e8,(undefined4 *)((longlong)&local_2e0 + 4));
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2980(&local_2e8,local_98);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2800(&local_2e8,&local_2c8);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        iVar15 = 0;
        if ((local_2e8 != (undefined8 *******)0x0) &&
           (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) {
          iVar15 = *(int *)(local_2e8 + -1);
        }
        uVar10 = FUN_14003c0c0(&local_2e8,local_158,iVar15 + -2);
        FUN_140003100(&local_2e8,uVar10);
        FUN_1400031d0(local_158);
        local_c8 = &local_210;
        FUN_1400a3440();
        local_210 = (undefined8 ******)PTR_DAT_1402f8010;
        FUN_140003100(&local_210,&local_2e8);
        uVar10 = FUN_140003080(local_130,L"GG_REQ_LOGOUT",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x9cd,uVar10,&local_210);
        local_348 = local_2e8;
        if (local_2e8 == (undefined8 *******)0x0) {
          local_348 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x9cd,L"GG_REQ_LOGOUT");
        FUN_1400031d0(&local_2e8);
      }
      DVar5 = 0;
      if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_c8 = (undefined8 *******)CONCAT44(local_c8._4_4_,0x9cd);
        pwStack_c0 = L"GG_REQ_LOGOUT";
        local_b8 = iVar2;
        local_b0 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_c8);
        DVar5 = GetTickCount();
      }
      local_2f8 = (undefined4 *)&local_2c8;
      local_300 = local_98;
      local_308 = (undefined4 *)((longlong)&local_2e0 + 4);
      local_310 = (undefined4 *)&local_2e0;
      local_318 = (undefined **)local_2d8;
      local_320 = &local_238;
      local_328 = (undefined4 *)(local_2d8 + 4);
      local_330 = &local_228;
      local_338 = &local_f0;
      local_340 = (longlong **)(local_2d0 + 4);
      local_348 = &local_88;
      cVar3 = (**(code **)(*param_1 + 0x78))(param_1,iVar2,local_2a8,local_58);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"GG_REQ_LOGOUT");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_c8 = (undefined8 *******)CONCAT44(local_c8._4_4_,0x9cd);
        pwStack_c0 = L"GG_REQ_LOGOUT";
        local_b8 = iVar2;
        local_b0 = param_3;
        DVar6 = GetTickCount();
        local_a8 = DVar6 - DVar5;
        (**(code **)(*param_1 + 0x18))(param_1,&local_c8);
      }
      FUN_1400031d0(&local_238);
      FUN_1400031d0(&local_228);
      FUN_14000c2a0(local_58);
      break;
    case 0x9ce:
      FUN_140140af0(local_2a8);
      local_2a4 = param_2[10];
      local_2a8[0] = (undefined1)param_2[0x10];
      FUN_1401a2570(param_2,&local_f0);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"GG_ALREADY_LOGIN");
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_348 = (undefined8 *******)&DAT_14027d1a0;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0x9ce,L"GG_ALREADY_LOGIN");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_2e8 = (undefined8 *******)PTR_DAT_1402f8010;
        FUN_1401a2bd0(&local_2e8,&local_f0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        iVar15 = 0;
        if ((local_2e8 != (undefined8 *******)0x0) &&
           (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) {
          iVar15 = *(int *)(local_2e8 + -1);
        }
        uVar10 = FUN_14003c0c0(&local_2e8,local_170,iVar15 + -2);
        FUN_140003100(&local_2e8,uVar10);
        FUN_1400031d0(local_170);
        local_c8 = &local_200;
        FUN_1400a3440();
        local_200 = (undefined8 ******)PTR_DAT_1402f8010;
        FUN_140003100(&local_200,&local_2e8);
        uVar10 = FUN_140003080(local_128,L"GG_ALREADY_LOGIN",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x9ce,uVar10,&local_200);
        local_348 = local_2e8;
        if (local_2e8 == (undefined8 *******)0x0) {
          local_348 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x9ce,L"GG_ALREADY_LOGIN");
        FUN_1400031d0(&local_2e8);
      }
      DVar5 = 0;
      if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_88 = (undefined8 *******)CONCAT44(local_88._4_4_,0x9ce);
        pwStack_80 = L"GG_ALREADY_LOGIN";
        local_78 = iVar2;
        local_70 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_88);
        DVar5 = GetTickCount();
      }
      cVar3 = (**(code **)(*param_1 + 0x80))(param_1,iVar2,local_2a8,&local_f0);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"GG_ALREADY_LOGIN");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_88 = (undefined8 *******)CONCAT44(local_88._4_4_,0x9ce);
        pwStack_80 = L"GG_ALREADY_LOGIN";
        local_78 = iVar2;
        local_70 = param_3;
        DVar6 = GetTickCount();
        local_68 = DVar6 - DVar5;
        pppppppuVar13 = &local_88;
        goto LAB_140035ab7;
      }
      break;
    case 0x9cf:
      FUN_140140af0(local_2a8);
      local_2a4 = param_2[10];
      local_2a8[0] = (undefined1)param_2[0x10];
      cVar3 = FUN_140185490(param_2,&local_2e8,4);
      if (cVar3 != '\0') {
        local_2e0._0_4_ = local_2e8._0_4_;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"GG_SERVER_TYPE");
      DVar5 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_348 = (undefined8 *******)&DAT_14027d1a0;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0x9cf,L"GG_SERVER_TYPE");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_2e8 = (undefined8 *******)PTR_DAT_1402f8010;
        FUN_1401a28c0(&local_2e8,&local_2e0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        DVar6 = DVar5;
        if ((local_2e8 != (undefined8 *******)0x0) &&
           (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) {
          DVar6 = *(DWORD *)(local_2e8 + -1);
        }
        uVar10 = FUN_14003c0c0(&local_2e8,local_160,DVar6 - 2);
        FUN_140003100(&local_2e8,uVar10);
        FUN_1400031d0(local_160);
        local_c8 = &local_1f0;
        FUN_1400a3440();
        local_1f0 = (undefined8 ******)PTR_DAT_1402f8010;
        FUN_140003100(&local_1f0,&local_2e8);
        uVar10 = FUN_140003080(local_118,L"GG_SERVER_TYPE",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x9cf,uVar10,&local_1f0);
        local_348 = local_2e8;
        if (local_2e8 == (undefined8 *******)0x0) {
          local_348 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x9cf,L"GG_SERVER_TYPE");
        FUN_1400031d0(&local_2e8);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9cf);
        local_e8 = L"GG_SERVER_TYPE";
        local_e0 = iVar2;
        local_d8 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_f0);
        DVar5 = GetTickCount();
      }
      cVar3 = (**(code **)(*param_1 + 0x88))(param_1,iVar2,local_2a8,&local_2e0);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"GG_SERVER_TYPE");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_f0 = (undefined8 ******)CONCAT44(local_f0._4_4_,0x9cf);
        local_e8 = L"GG_SERVER_TYPE";
        goto LAB_140032d26;
      }
      break;
    case 0x9d0:
      FUN_140140af0(local_2a8);
      local_2a4 = param_2[10];
      local_2a8[0] = (undefined1)param_2[0x10];
      local_88 = (undefined8 *******)0x0;
      pwStack_80 = (wchar_t *)0x0;
      FUN_14003c7f0(param_2,&local_88);
      cVar3 = FUN_140185490(param_2,&local_2e8,4);
      if (cVar3 != '\0') {
        local_2d8._4_4_ = local_2e8._0_4_;
      }
      FUN_1401a2570(param_2,local_98);
      FUN_1401a2570(param_2,&local_f0);
      FUN_140185490(param_2,&local_2b0,4);
      cVar3 = FUN_140185490(param_2,&local_2b8,4);
      if (cVar3 != '\0') {
        local_2e0._0_4_ = local_2b8._0_4_;
      }
      pwVar14 = L"GG_REQ_PLAY_TIME_START";
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"GG_REQ_PLAY_TIME_START");
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_348 = (undefined8 *******)&DAT_14027d1a0;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0x9d0,L"GG_REQ_PLAY_TIME_START");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_2e8 = (undefined8 *******)PTR_DAT_1402f8010;
        FUN_1401a2bd0(&local_2e8,&local_88);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,local_2d8 + 4);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2bd0(&local_2e8,local_98);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2bd0(&local_2e8,&local_f0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,local_2d8);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,&local_2e0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        iVar15 = 0;
        if ((local_2e8 != (undefined8 *******)0x0) &&
           (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) {
          iVar15 = *(int *)(local_2e8 + -1);
        }
        uVar10 = FUN_14003c0c0(&local_2e8,local_150,iVar15 + -2);
        FUN_140003100(&local_2e8,uVar10);
        FUN_1400031d0(local_150);
        local_c8 = &local_1e0;
        FUN_1400a3440();
        local_1e0 = (undefined8 ******)PTR_DAT_1402f8010;
        FUN_140003100(&local_1e0,&local_2e8);
        uVar10 = FUN_140003080(local_108,L"GG_REQ_PLAY_TIME_START",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x9d0,uVar10,&local_1e0);
        local_348 = local_2e8;
        if (local_2e8 == (undefined8 *******)0x0) {
          local_348 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x9d0,L"GG_REQ_PLAY_TIME_START");
        FUN_1400031d0(&local_2e8);
      }
      DVar5 = 0;
      if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_c8 = (undefined8 *******)CONCAT44(local_c8._4_4_,0x9d0);
        pwStack_c0 = L"GG_REQ_PLAY_TIME_START";
        local_b8 = iVar2;
        local_b0 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_c8);
        DVar5 = GetTickCount();
      }
      local_328 = (undefined4 *)&local_2e0;
      local_330 = (undefined **)local_2d8;
      local_338 = &local_f0;
      local_340 = local_98;
      local_348 = (undefined8 *******)(local_2d8 + 4);
      cVar3 = (**(code **)(*param_1 + 0x90))(param_1,iVar2,local_2a8,&local_88);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"GG_REQ_PLAY_TIME_START");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_c8 = (undefined8 *******)CONCAT44(local_c8._4_4_,0x9d0);
LAB_140035a8c:
        pwStack_c0 = pwVar14;
        local_b8 = iVar2;
        local_b0 = param_3;
        DVar6 = GetTickCount();
        local_a8 = DVar6 - DVar5;
        pppppppuVar13 = &local_c8;
        goto LAB_140035ab7;
      }
      break;
    case 0x9d1:
      FUN_140140af0(local_2a8);
      local_2a4 = param_2[10];
      local_2a8[0] = (undefined1)param_2[0x10];
      local_88 = (undefined8 *******)0x0;
      pwStack_80 = (wchar_t *)0x0;
      FUN_14003c7f0(param_2,&local_88);
      cVar3 = FUN_140185490(param_2,&local_2e8,4);
      if (cVar3 != '\0') {
        local_2d8._4_4_ = local_2e8._0_4_;
      }
      FUN_1401a2570(param_2,local_98);
      FUN_1401a2570(param_2,&local_f0);
      FUN_140185490(param_2,&local_2b0,4);
      cVar3 = FUN_140185490(param_2,&local_2b8,4);
      if (cVar3 != '\0') {
        local_2e0._0_4_ = local_2b8._0_4_;
      }
      pwVar14 = L"GG_REQ_PLAY_TIME_END";
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"GG_REQ_PLAY_TIME_END");
      DVar5 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_348 = (undefined8 *******)&DAT_14027d1a0;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0x9d1,L"GG_REQ_PLAY_TIME_END");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_2e8 = (undefined8 *******)PTR_DAT_1402f8010;
        FUN_1401a2bd0(&local_2e8,&local_88);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,local_2d8 + 4);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2bd0(&local_2e8,local_98);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2bd0(&local_2e8,&local_f0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,local_2d8);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a28c0(&local_2e8,&local_2e0);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        iVar15 = 0;
        if ((local_2e8 != (undefined8 *******)0x0) &&
           (local_2e8 != (undefined8 *******)PTR_DAT_1402f8010)) {
          iVar15 = *(int *)(local_2e8 + -1);
        }
        uVar10 = FUN_14003c0c0(&local_2e8,local_140,iVar15 + -2);
        FUN_140003100(&local_2e8,uVar10);
        FUN_1400031d0(local_140);
        local_c8 = &local_1d0;
        FUN_1400a3440();
        local_1d0 = (undefined8 ******)PTR_DAT_1402f8010;
        FUN_140003100(&local_1d0,&local_2e8);
        uVar10 = FUN_140003080(local_f8,L"GG_REQ_PLAY_TIME_END",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x9d1,uVar10,&local_1d0);
        local_348 = local_2e8;
        if (local_2e8 == (undefined8 *******)0x0) {
          local_348 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x9d1,L"GG_REQ_PLAY_TIME_END");
        FUN_1400031d0(&local_2e8);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_c8 = (undefined8 *******)CONCAT44(local_c8._4_4_,0x9d1);
        pwStack_c0 = L"GG_REQ_PLAY_TIME_END";
        local_b8 = iVar2;
        local_b0 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_c8);
        DVar5 = GetTickCount();
      }
      local_328 = (undefined4 *)&local_2e0;
      local_330 = (undefined **)local_2d8;
      local_338 = &local_f0;
      local_340 = local_98;
      local_348 = (undefined8 *******)(local_2d8 + 4);
      cVar3 = (**(code **)(*param_1 + 0x98))(param_1,iVar2,local_2a8,&local_88);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"GG_REQ_PLAY_TIME_END");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_c8 = (undefined8 *******)CONCAT44(local_c8._4_4_,0x9d1);
        goto LAB_140035a8c;
      }
      break;
    default:
      goto switchD_140032994_default;
    }
    uVar10 = 1;
  }
  return uVar10;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

undefined8 FUN_140035b30(longlong *param_1,int *param_2,undefined8 param_3)

{
  int *piVar1;
  int iVar2;
  char cVar3;
  undefined4 uVar4;
  DWORD DVar5;
  DWORD DVar6;
  longlong *******ppppppplVar7;
  undefined8 ******ppppppuVar8;
  undefined8 ******ppppppuVar9;
  undefined8 uVar10;
  wchar_t *pwVar11;
  int iVar12;
  undefined8 *******pppppppuVar13;
  undefined1 auStack_578 [32];
  undefined8 *******local_558;
  undefined8 *******local_550;
  undefined8 *******local_548;
  undefined8 *******local_540;
  undefined1 *local_538;
  undefined1 *local_530;
  undefined4 *local_528;
  undefined8 *******local_518;
  undefined1 local_510 [8];
  undefined1 local_508 [8];
  void *local_500;
  wchar_t *local_4f8;
  undefined8 local_4f0;
  undefined8 local_4e8;
  int local_4e0;
  undefined1 local_4d8 [8];
  undefined1 local_4d0 [8];
  longlong *******local_4c8;
  wchar_t *local_4c0;
  int local_4b8;
  undefined8 local_4b0;
  int local_4a8;
  undefined8 ******local_4a0;
  undefined1 local_498;
  undefined1 local_488 [4];
  int local_484;
  undefined8 local_450;
  undefined8 ******local_428;
  undefined4 local_420 [2];
  undefined8 ******local_418;
  undefined8 *******local_410;
  longlong ******local_408;
  undefined8 *****local_400;
  longlong ******local_3f8;
  longlong ******local_3f0;
  longlong ******local_3e8;
  longlong ******local_3e0;
  longlong ******local_3d8;
  longlong ******local_3d0;
  longlong ******local_3c8;
  undefined8 *****local_3c0;
  undefined8 *****local_3b8;
  undefined8 *****local_3b0;
  longlong ******local_3a8;
  undefined8 *****local_3a0;
  longlong ******local_398;
  undefined8 *****local_390;
  longlong ******local_388;
  undefined8 *****local_380;
  longlong ******local_378;
  longlong ******local_370;
  longlong ******local_368;
  undefined8 *****local_360;
  longlong ******local_358;
  undefined *local_350;
  longlong ******local_348;
  undefined8 *****local_340;
  longlong ******local_338;
  undefined8 *****local_330;
  longlong ******local_328;
  undefined8 *****local_320;
  longlong ******local_318;
  undefined8 *****local_310;
  longlong ******local_308;
  longlong ******local_300;
  undefined4 local_2f8 [2];
  undefined8 *****local_2f0;
  longlong ******local_2e8;
  undefined8 *****local_2e0;
  undefined *local_2d8;
  longlong ******local_2d0;
  undefined *local_2c8;
  undefined **local_2c0;
  undefined1 local_2b8 [8];
  undefined1 local_2b0 [8];
  undefined1 local_2a8 [8];
  undefined1 local_2a0 [8];
  undefined1 local_298 [8];
  undefined1 local_290 [8];
  undefined1 local_288 [8];
  undefined1 local_280 [8];
  undefined1 local_278 [8];
  undefined1 local_270 [8];
  undefined1 local_268 [8];
  undefined1 local_260 [8];
  undefined1 local_258 [8];
  undefined1 local_250 [8];
  undefined1 local_248 [8];
  undefined1 local_240 [8];
  undefined1 local_238 [8];
  undefined1 local_230 [8];
  undefined1 local_228 [8];
  undefined1 local_220 [8];
  undefined1 local_218 [8];
  undefined1 local_210 [8];
  undefined1 local_208 [8];
  undefined1 local_200 [8];
  undefined1 local_1f8 [8];
  undefined1 local_1f0 [8];
  undefined1 local_1e8 [8];
  undefined1 local_1e0 [8];
  undefined1 local_1d8 [8];
  undefined1 local_1d0 [8];
  undefined1 local_1c8 [8];
  undefined1 local_1c0 [8];
  undefined1 local_1b8 [8];
  undefined1 local_1b0 [8];
  undefined1 local_1a8 [8];
  undefined1 local_1a0 [8];
  undefined1 local_198 [8];
  undefined1 local_190 [8];
  undefined1 local_188 [8];
  undefined1 local_180 [8];
  undefined1 local_178 [8];
  undefined1 local_170 [8];
  undefined1 local_168 [8];
  undefined1 local_160 [8];
  undefined1 local_158 [8];
  undefined1 local_150 [8];
  undefined1 local_148 [8];
  undefined1 local_140 [8];
  undefined1 local_138 [8];
  undefined1 local_130 [8];
  undefined1 local_128 [8];
  undefined1 local_120 [8];
  undefined1 local_118 [8];
  undefined1 local_110 [8];
  undefined1 local_108 [8];
  undefined1 local_100 [8];
  undefined1 local_f8 [8];
  undefined1 local_f0 [8];
  undefined1 local_e8 [8];
  undefined1 local_e0 [8];
  undefined1 local_d8 [8];
  undefined1 local_d0 [8];
  undefined1 local_c8 [8];
  undefined1 local_c0 [8];
  undefined1 local_b8 [8];
  undefined1 local_b0 [8];
  undefined1 local_a8 [8];
  undefined1 local_a0 [8];
  undefined1 local_98 [8];
  undefined1 local_90 [8];
  undefined1 local_88 [8];
  undefined1 local_80 [8];
  undefined1 local_78 [8];
  undefined1 local_70 [8];
  undefined1 local_68 [8];
  undefined1 local_60 [8];
  undefined8 local_58;
  undefined8 ******local_50;
  undefined4 local_48;
  undefined4 local_44;
  ulonglong local_40;
  undefined8 *******pppppppuVar14;
  
  local_58 = 0xfffffffffffffffe;
  local_40 = DAT_1402f85a0 ^ (ulonglong)auStack_578;
  iVar2 = param_2[10];
  if (iVar2 == 0) {
    FUN_140169430(param_1,0);
  }
  iVar12 = *param_2;
  cVar3 = FUN_140185e40(param_2,local_2f8);
  if (cVar3 == '\0') {
switchD_140035bd4_default:
    FUN_140185160(param_2,(int)((iVar12 >> 0x1f & 7U) + iVar12) >> 3);
    return 0;
  }
  local_450 = param_3;
  switch(local_2f8[0]) {
  case 0x5dd:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    pppppppuVar14 = (undefined8 *******)0x0;
    pppppppuVar13 = (undefined8 *******)0x0;
    local_500 = (void *)0x0;
    local_4f8 = (wchar_t *)0x0;
    local_4f0 = 0;
    FUN_14003c140(param_2,&local_500);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_KEY_AUTH_ID_01");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5dd,L"PG_KEY_AUTH_ID_01");
        goto LAB_140035f88;
      }
    }
    else {
      pppppppuVar13 = pppppppuVar14;
      if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_518 = (undefined8 *******)PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_4c8 = (longlong *******)PTR_DAT_1402f8010;
        FUN_14003c600(&local_4c8,L"<Array %d>",(longlong)local_4f8 - (longlong)local_500);
        FUN_14003c400(&local_518,&local_4c8);
        ppppppplVar7 = local_4c8;
        if (((local_4c8 != (longlong *******)0x0) &&
            (local_4c8 != (longlong *******)PTR_DAT_1402f8010)) &&
           (ppppppuVar9 = local_4c8 + -1, ppppppuVar9 != (undefined8 ******)0x0)) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_4c8 = (longlong *******)ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_4c0 = (wchar_t *)CONCAT71(local_4c0._1_7_,1);
          piVar1 = (int *)((longlong)ppppppplVar7 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(ppppppuVar9);
          }
          FUN_1400d1290(ppppppuVar8);
        }
        FUN_14003c890(&local_518,&DAT_14027c73c);
        pppppppuVar13 = local_518;
        iVar12 = 0;
        if ((local_518 != (undefined8 *******)0x0) &&
           (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
          iVar12 = *(int *)(local_518 + -1);
        }
        local_4c8 = (longlong *******)FUN_14003c0c0(&local_518,&local_2c8,iVar12 + -2);
        if (pppppppuVar13 == (undefined8 *******)0x0) {
          pppppppuVar13 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        local_518 = pppppppuVar13;
        if ((undefined8 *******)*local_4c8 != pppppppuVar13) {
          ppppppuVar9 = (undefined8 ******)FUN_1400a3440();
          local_50 = ppppppuVar9;
          FUN_1400a1c30(ppppppuVar9);
          local_48 = CONCAT31(local_48._1_3_,1);
          if (((pppppppuVar13 != (undefined8 *******)0x0) &&
              (pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010)) &&
             (pppppppuVar13 + -1 != (undefined8 *******)0x0)) {
            ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
            local_4a0 = ppppppuVar8;
            FUN_1400a1c30(ppppppuVar8);
            local_498 = 1;
            piVar1 = (int *)((longlong)pppppppuVar13 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(pppppppuVar13 + -1);
            }
            FUN_1400d1290(ppppppuVar8);
          }
          pppppppuVar13 = (undefined8 *******)*local_4c8;
          if (((pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010) &&
              (pppppppuVar13 != (undefined8 *******)0x0)) &&
             (pppppppuVar13 != (undefined8 *******)0x8)) {
            *(int *)((longlong)pppppppuVar13 + -4) = *(int *)((longlong)pppppppuVar13 + -4) + 1;
          }
          local_518 = pppppppuVar13;
          FUN_1400d1290(ppppppuVar9);
        }
        if (((local_2c8 != (undefined *)0x0) && (local_2c8 != PTR_DAT_1402f8010)) &&
           (local_2c8 + -8 != (undefined *)0x0)) {
          ppppppuVar9 = (undefined8 ******)FUN_1400a3440();
          local_4c8 = (longlong *******)ppppppuVar9;
          FUN_1400a1c30(ppppppuVar9);
          local_4c0 = (wchar_t *)CONCAT71(local_4c0._1_7_,1);
          piVar1 = (int *)(local_2c8 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_2c8 + -8);
          }
          FUN_1400d1290(ppppppuVar9);
        }
        local_4c8 = (longlong *******)&local_410;
        local_2c8 = PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_410 = (undefined8 *******)PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_410 = pppppppuVar14;
        }
        if (pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010) {
          ppppppuVar9 = (undefined8 ******)FUN_1400a3440();
          local_50 = ppppppuVar9;
          FUN_1400a1c30(ppppppuVar9);
          local_48 = CONCAT31(local_48._1_3_,1);
          FUN_1400031d0(&local_410);
          if (((pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010) &&
              (pppppppuVar13 != (undefined8 *******)0x0)) &&
             (pppppppuVar13 != (undefined8 *******)0x8)) {
            *(int *)((longlong)pppppppuVar13 + -4) = *(int *)((longlong)pppppppuVar13 + -4) + 1;
          }
          local_410 = pppppppuVar13;
          FUN_1400d1290(ppppppuVar9);
        }
        FUN_1400a3440();
        local_2d8 = PTR_DAT_1402f8010;
        uVar4 = FUN_1400a32c0(L"PG_KEY_AUTH_ID_01");
        uVar10 = FUN_140002f20(&local_2d8,uVar4);
        FUN_1400a32f0(uVar10,L"PG_KEY_AUTH_ID_01",uVar4);
        FUN_140003000(&local_2d8);
        (**(code **)(*param_1 + 0x28))(param_1,0x5dd,&local_2d8,&local_410);
        local_558 = pppppppuVar13;
        if (pppppppuVar13 == (undefined8 *******)0x0) {
          local_558 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5dd,L"PG_KEY_AUTH_ID_01");
        if (((pppppppuVar13 != (undefined8 *******)0x0) &&
            (pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010)) &&
           (pppppppuVar13 + -1 != (undefined8 *******)0x0)) {
          ppppppplVar7 = (longlong *******)FUN_1400a3440();
          local_4c8 = ppppppplVar7;
          FUN_1400a1c30(ppppppplVar7);
          local_4c0 = (wchar_t *)CONCAT71(local_4c0._1_7_,1);
          piVar1 = (int *)((longlong)pppppppuVar13 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(pppppppuVar13 + -1);
          }
          FUN_1400d1290(ppppppplVar7);
        }
LAB_140035f88:
        pppppppuVar13 = pppppppuVar14;
        if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
          local_4c8 = (longlong *******)CONCAT44(local_4c8._4_4_,0x5dd);
          local_4c0 = L"PG_KEY_AUTH_ID_01";
          local_4b8 = iVar2;
          local_4b0 = param_3;
          (**(code **)(*param_1 + 0x20))(param_1,&local_4c8);
          DVar5 = GetTickCount();
          pppppppuVar13 = (undefined8 *******)(ulonglong)DVar5;
        }
      }
    }
    cVar3 = (**(code **)(*param_1 + 0x38))(param_1,iVar2,local_488,&local_500);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_KEY_AUTH_ID_01");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_4c8 = (longlong *******)CONCAT44(local_4c8._4_4_,0x5dd);
      local_4c0 = L"PG_KEY_AUTH_ID_01";
      local_4b8 = iVar2;
      local_4b0 = param_3;
      DVar5 = GetTickCount();
      local_4a8 = DVar5 - (int)pppppppuVar13;
      (**(code **)(*param_1 + 0x18))(param_1,&local_4c8);
    }
LAB_14003601e:
    if (local_500 == (void *)0x0) {
      return 1;
    }
    operator_delete(local_500);
    return 1;
  case 0x5de:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    DVar6 = 0;
    DVar5 = 0;
    local_500 = (void *)0x0;
    local_4f8 = (wchar_t *)0x0;
    local_4f0 = 0;
    FUN_14003c140(param_2,&local_500);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_KEY_AUTH_ID_02");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5de,L"PG_KEY_AUTH_ID_02");
        goto LAB_1400362e8;
      }
    }
    else {
      DVar5 = DVar6;
      if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_518 = (undefined8 *******)PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_4c8 = (longlong *******)PTR_DAT_1402f8010;
        FUN_14003c600(&local_4c8,L"<Array %d>",(longlong)local_4f8 - (longlong)local_500);
        FUN_14003c400(&local_518,&local_4c8);
        ppppppplVar7 = local_4c8;
        if (((local_4c8 != (longlong *******)0x0) &&
            (local_4c8 != (longlong *******)PTR_DAT_1402f8010)) &&
           (ppppppuVar9 = local_4c8 + -1, ppppppuVar9 != (undefined8 ******)0x0)) {
          ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
          local_4c8 = (longlong *******)ppppppuVar8;
          FUN_1400a1c30(ppppppuVar8);
          local_4c0 = (wchar_t *)CONCAT71(local_4c0._1_7_,1);
          piVar1 = (int *)((longlong)ppppppplVar7 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(ppppppuVar9);
          }
          FUN_1400d1290(ppppppuVar8);
        }
        FUN_14003c890(&local_518,&DAT_14027c73c);
        pppppppuVar13 = local_518;
        iVar12 = 0;
        if ((local_518 != (undefined8 *******)0x0) &&
           (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
          iVar12 = *(int *)(local_518 + -1);
        }
        local_4c8 = (longlong *******)FUN_14003c0c0(&local_518,local_190,iVar12 + -2);
        if (pppppppuVar13 == (undefined8 *******)0x0) {
          pppppppuVar13 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        local_518 = pppppppuVar13;
        if ((undefined8 *******)*local_4c8 != pppppppuVar13) {
          ppppppuVar9 = (undefined8 ******)FUN_1400a3440();
          local_50 = ppppppuVar9;
          FUN_1400a1c30(ppppppuVar9);
          local_48 = CONCAT31(local_48._1_3_,1);
          if (((pppppppuVar13 != (undefined8 *******)0x0) &&
              (pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010)) &&
             (pppppppuVar13 + -1 != (undefined8 *******)0x0)) {
            ppppppuVar8 = (undefined8 ******)FUN_1400a3440();
            local_4a0 = ppppppuVar8;
            FUN_1400a1c30(ppppppuVar8);
            local_498 = 1;
            piVar1 = (int *)((longlong)pppppppuVar13 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(pppppppuVar13 + -1);
            }
            FUN_1400d1290(ppppppuVar8);
          }
          pppppppuVar13 = (undefined8 *******)*local_4c8;
          if (((pppppppuVar13 != (undefined8 *******)PTR_DAT_1402f8010) &&
              (pppppppuVar13 != (undefined8 *******)0x0)) &&
             (pppppppuVar13 != (undefined8 *******)0x8)) {
            *(int *)((longlong)pppppppuVar13 + -4) = *(int *)((longlong)pppppppuVar13 + -4) + 1;
          }
          local_518 = pppppppuVar13;
          FUN_1400d1290(ppppppuVar9);
        }
        FUN_1400031d0(local_190);
        local_4c8 = &local_3f8;
        FUN_1400a3440();
        local_3f8 = (longlong ******)PTR_DAT_1402f8010;
        FUN_140003100(&local_3f8,&local_518);
        uVar10 = FUN_140003080(local_170,L"PG_KEY_AUTH_ID_02",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x5de,uVar10,&local_3f8);
        local_558 = pppppppuVar13;
        if (pppppppuVar13 == (undefined8 *******)0x0) {
          local_558 = (undefined8 *******)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5de,L"PG_KEY_AUTH_ID_02");
        FUN_1400031d0(&local_518);
LAB_1400362e8:
        DVar5 = DVar6;
        if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
          local_4c8 = (longlong *******)CONCAT44(local_4c8._4_4_,0x5de);
          local_4c0 = L"PG_KEY_AUTH_ID_02";
          local_4b8 = iVar2;
          local_4b0 = param_3;
          (**(code **)(*param_1 + 0x20))(param_1,&local_4c8);
          DVar5 = GetTickCount();
        }
      }
    }
    cVar3 = (**(code **)(*param_1 + 0x40))(param_1,iVar2,local_488,&local_500);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_KEY_AUTH_ID_02");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_4c8 = (longlong *******)CONCAT44(local_4c8._4_4_,0x5de);
      local_4c0 = L"PG_KEY_AUTH_ID_02";
      local_4b8 = iVar2;
      local_4b0 = param_3;
      DVar6 = GetTickCount();
      local_4a8 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_4c8);
    }
    goto LAB_14003601e;
  case 0x5df:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    FUN_1400a3440();
    local_4a0 = (undefined8 ******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4a0);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,L"PG_GET_AUTH_ID");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5df,L"PG_GET_AUTH_ID");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2ac0(&local_518,&local_4a0);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_2a8,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_2a8);
      local_4c8 = &local_358;
      FUN_1400a3440();
      local_358 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_358,&local_518);
      uVar10 = FUN_140003080(local_188,L"PG_GET_AUTH_ID",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5df,uVar10,&local_358);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5df,L"PG_GET_AUTH_ID");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5df);
      local_4f8 = L"PG_GET_AUTH_ID";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0x48))(param_1,iVar2,local_488,&local_4a0);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_GET_AUTH_ID");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5df);
      local_4f8 = L"PG_GET_AUTH_ID";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      DVar6 = GetTickCount();
      local_4e0 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_500);
    }
    pppppppuVar13 = &local_4a0;
    goto LAB_14003bdea;
  case 0x5e0:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    local_50 = (undefined8 ******)0x0;
    local_48 = 0;
    local_44 = 0;
    FUN_14003c7f0(param_2,&local_50);
    FUN_140185490(param_2,local_508,1);
    FUN_140185490(param_2,local_508,1);
    pwVar11 = L"PG_GET_AUTH_ID_SUCC_U";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GET_AUTH_ID_SUCC_U");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5e0,L"PG_GET_AUTH_ID_SUCC_U");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2bd0(&local_518,&local_50);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2740(&local_518,local_510);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a27a0(&local_518,local_4d0 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_1a0,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_1a0);
      local_4c8 = &local_3e8;
      FUN_1400a3440();
      local_3e8 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_3e8,&local_518);
      uVar10 = FUN_140003080(local_178,L"PG_GET_AUTH_ID_SUCC_U",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5e0,uVar10,&local_3e8);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5e0,L"PG_GET_AUTH_ID_SUCC_U");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5e0);
      local_4f8 = L"PG_GET_AUTH_ID_SUCC_U";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    local_550 = (undefined8 *******)(local_4d0 + 4);
    local_558 = (undefined8 *******)local_510;
    cVar3 = (**(code **)(*param_1 + 0x50))(param_1,iVar2,local_488,&local_50);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_GET_AUTH_ID_SUCC_U")
      ;
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5e0);
    break;
  case 0x5e1:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    FUN_140185490(param_2,local_510 + 4,4);
    pwVar11 = L"PG_GET_AUTH_ID_FAIL_U";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GET_AUTH_ID_FAIL_U");
    DVar5 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5e1,L"PG_GET_AUTH_ID_FAIL_U");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2920(&local_518,local_4d8 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_218,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_218);
      local_4c8 = &local_308;
      FUN_1400a3440();
      local_308 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_308,&local_518);
      uVar10 = FUN_140003080(local_e0,L"PG_GET_AUTH_ID_FAIL_U",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5e1,uVar10,&local_308);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5e1,L"PG_GET_AUTH_ID_FAIL_U");
      FUN_1400031d0(&local_518);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5e1);
      local_4f8 = L"PG_GET_AUTH_ID_FAIL_U";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0x58))(param_1,iVar2,local_488,local_4d8 + 4);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_GET_AUTH_ID_FAIL_U")
      ;
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5e1);
    break;
  case 0x5e2:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    pwVar11 = L"PG_GAME_SERVER_INFO";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GAME_SERVER_INFO");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5e2,L"PG_GAME_SERVER_INFO");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      uVar10 = FUN_14003c0c0(&local_518,local_298,0xfffffffe);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_298);
      local_4c8 = &local_3d8;
      FUN_1400a3440();
      local_3d8 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_3d8,&local_518);
      uVar10 = FUN_140003080(local_160,L"PG_GAME_SERVER_INFO",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5e2,uVar10,&local_3d8);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5e2,L"PG_GAME_SERVER_INFO");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5e2);
      local_4f8 = L"PG_GAME_SERVER_INFO";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0x60))(param_1,iVar2,local_488);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_GAME_SERVER_INFO");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5e2);
    break;
  case 0x5e3:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    FUN_140185490(param_2,local_510 + 4,4);
    pwVar11 = L"PG_GAME_CHANNEL_INFO";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GAME_CHANNEL_INFO");
    DVar5 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5e3,L"PG_GAME_CHANNEL_INFO");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_518,local_4d8 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_198,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_198);
      local_4c8 = &local_348;
      FUN_1400a3440();
      local_348 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_348,&local_518);
      uVar10 = FUN_140003080(local_60,L"PG_GAME_CHANNEL_INFO",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5e3,uVar10,&local_348);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5e3,L"PG_GAME_CHANNEL_INFO");
      FUN_1400031d0(&local_518);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5e3);
      local_4f8 = L"PG_GAME_CHANNEL_INFO";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0x68))(param_1,iVar2,local_488,local_4d8 + 4);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_GAME_CHANNEL_INFO");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5e3);
    break;
  case 0x5e4:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    FUN_140185490(param_2,local_510 + 4,4);
    FUN_140185490(param_2,local_4d8,4);
    pwVar11 = L"PG_GAME_SERVER_INFO_SUCC_U";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GAME_SERVER_INFO_SUCC_U");
    DVar5 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5e4,L"PG_GAME_SERVER_INFO_SUCC_U");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_518,local_420);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a28c0(&local_518,local_4d8 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_288,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_288);
      local_4c8 = &local_3c8;
      FUN_1400a3440();
      local_3c8 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_3c8,&local_518);
      uVar10 = FUN_140003080(local_150,L"PG_GAME_SERVER_INFO_SUCC_U",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5e4,uVar10,&local_3c8);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5e4,L"PG_GAME_SERVER_INFO_SUCC_U");
      FUN_1400031d0(&local_518);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5e4);
      local_4f8 = L"PG_GAME_SERVER_INFO_SUCC_U";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    local_558 = (undefined8 *******)(local_4d8 + 4);
    cVar3 = (**(code **)(*param_1 + 0x70))(param_1,iVar2,local_488,local_420);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PG_GAME_SERVER_INFO_SUCC_U");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5e4);
    break;
  case 0x5e5:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    cVar3 = FUN_140185490(param_2,&local_2c0,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_2c0._0_4_;
    }
    cVar3 = FUN_140185490(param_2,&local_418,4);
    if (cVar3 != '\0') {
      local_4d8._0_4_ = local_418._0_4_;
    }
    FUN_1400a3440();
    local_4c8 = (longlong *******)PTR_DAT_1402f8010;
    thunk_FUN_1401865d0(param_2,&local_4c8);
    cVar3 = FUN_140185490(param_2,&local_428,4);
    if (cVar3 != '\0') {
      local_4d0._0_4_ = local_428._0_4_;
    }
    FUN_1400a3440();
    local_50 = (undefined8 ******)PTR_DAT_1402f8010;
    thunk_FUN_1401865d0(param_2,&local_50);
    cVar3 = FUN_140185490(param_2,&local_4a0,4);
    if (cVar3 != '\0') {
      local_4d8._4_4_ = local_4a0._0_4_;
    }
    FUN_140185490(param_2,local_508,1);
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_420[0] = local_518._0_4_;
    }
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GAME_SERVER_DATA");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5e5,L"PG_GAME_SERVER_DATA");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a28c0(&local_518,local_4d8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2b80(&local_518,&local_4c8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a28c0(&local_518,local_4d0);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2b80(&local_518,&local_50);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a28c0(&local_518,local_4d8 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2720(&local_518,local_510);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2920(&local_518,local_420);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_208,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_208);
      local_4a0 = &local_2e0;
      FUN_1400a3440();
      local_2e0 = (undefined8 *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_2e0,&local_518);
      uVar10 = FUN_140003080(local_d0,L"PG_GAME_SERVER_DATA",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5e5,uVar10,&local_2e0);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5e5,L"PG_GAME_SERVER_DATA");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5e5);
      local_4f8 = L"PG_GAME_SERVER_DATA";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    local_528 = local_420;
    local_530 = local_510;
    local_538 = local_4d8 + 4;
    local_540 = &local_50;
    local_548 = (undefined8 *******)local_4d0;
    local_550 = &local_4c8;
    local_558 = (undefined8 *******)local_4d8;
    cVar3 = (**(code **)(*param_1 + 0x78))(param_1,iVar2,local_488,local_510 + 4);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_GAME_SERVER_DATA");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5e5);
      local_4f8 = L"PG_GAME_SERVER_DATA";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      DVar6 = GetTickCount();
      local_4e0 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_500);
    }
    FUN_1400031d0(&local_50);
    FUN_1400031d0(&local_4c8);
    return 1;
  case 0x5e6:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_4d8._0_4_ = local_518._0_4_;
    }
    cVar3 = FUN_140185490(param_2,&local_4a0,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_4a0._0_4_;
    }
    FUN_1400a3440();
    local_4c8 = (longlong *******)PTR_DAT_1402f8010;
    thunk_FUN_1401865d0(param_2,&local_4c8);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GAME_CHANNEL_DATA");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5e6,L"PG_GAME_CHANNEL_DATA");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_518,local_4d8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a28c0(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2b80(&local_518,&local_4c8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_278,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_278);
      local_50 = &local_3b8;
      FUN_1400a3440();
      local_3b8 = (undefined8 *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_3b8,&local_518);
      uVar10 = FUN_140003080(local_140,L"PG_GAME_CHANNEL_DATA",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5e6,uVar10,&local_3b8);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5e6,L"PG_GAME_CHANNEL_DATA");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5e6);
      local_4f8 = L"PG_GAME_CHANNEL_DATA";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    local_550 = &local_4c8;
    local_558 = (undefined8 *******)(local_510 + 4);
    cVar3 = (**(code **)(*param_1 + 0x80))(param_1,iVar2,local_488,local_4d8);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_GAME_CHANNEL_DATA");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5e6);
      local_4f8 = L"PG_GAME_CHANNEL_DATA";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      DVar6 = GetTickCount();
      local_4e0 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_500);
    }
    FUN_1400031d0(&local_4c8);
    return 1;
  case 0x5e7:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_518._0_4_;
    }
    pwVar11 = L"PG_GAME_SERVER_INFO_FAIL_U";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GAME_SERVER_INFO_FAIL_U");
    DVar5 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5e7,L"PG_GAME_SERVER_INFO_FAIL_U");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2920(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_1c8,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_1c8);
      local_4c8 = &local_338;
      FUN_1400a3440();
      local_338 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_338,&local_518);
      uVar10 = FUN_140003080(local_90,L"PG_GAME_SERVER_INFO_FAIL_U",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5e7,uVar10,&local_338);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5e7,L"PG_GAME_SERVER_INFO_FAIL_U");
      FUN_1400031d0(&local_518);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5e7);
      local_4f8 = L"PG_GAME_SERVER_INFO_FAIL_U";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0x88))(param_1,iVar2,local_488,local_510 + 4);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PG_GAME_SERVER_INFO_FAIL_U");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5e7);
    break;
  case 0x5e8:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_518._0_4_;
    }
    pwVar11 = L"PG_GAME_CHANNEL_DATA_FAIL_U";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GAME_CHANNEL_DATA_FAIL_U");
    DVar5 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5e8,L"PG_GAME_CHANNEL_DATA_FAIL_U");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2920(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_2b8,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_2b8);
      local_4c8 = &local_3a8;
      FUN_1400a3440();
      local_3a8 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_3a8,&local_518);
      uVar10 = FUN_140003080(local_130,L"PG_GAME_CHANNEL_DATA_FAIL_U",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5e8,uVar10,&local_3a8);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5e8,L"PG_GAME_CHANNEL_DATA_FAIL_U");
      FUN_1400031d0(&local_518);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5e8);
      local_4f8 = L"PG_GAME_CHANNEL_DATA_FAIL_U";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0x90))(param_1,iVar2,local_488,local_510 + 4);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PG_GAME_CHANNEL_DATA_FAIL_U");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5e8);
    break;
  case 0x5e9:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_518._0_4_;
    }
    pwVar11 = L"PG_GAME_CHANNEL_DATA_END";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GAME_CHANNEL_DATA_END");
    DVar5 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5e9,L"PG_GAME_CHANNEL_DATA_END");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_268,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_268);
      local_4c8 = &local_408;
      FUN_1400a3440();
      local_408 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_408,&local_518);
      uVar10 = FUN_140003080(local_c0,L"PG_GAME_CHANNEL_DATA_END",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5e9,uVar10,&local_408);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5e9,L"PG_GAME_CHANNEL_DATA_END");
      FUN_1400031d0(&local_518);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5e9);
      local_4f8 = L"PG_GAME_CHANNEL_DATA_END";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0x98))(param_1,iVar2,local_488,local_510 + 4);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PG_GAME_CHANNEL_DATA_END");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5e9);
    break;
  case 0x5ea:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_518._0_4_;
    }
    pwVar11 = L"PG_DB_ERROR";
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,L"PG_DB_ERROR");
    DVar5 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5ea,L"PG_DB_ERROR");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2920(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_1f8,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_1f8);
      local_4c8 = &local_398;
      FUN_1400a3440();
      local_398 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_398,&local_518);
      uVar10 = FUN_140003080(local_120,L"PG_DB_ERROR",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5ea,uVar10,&local_398);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5ea,L"PG_DB_ERROR");
      FUN_1400031d0(&local_518);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5ea);
      local_4f8 = L"PG_DB_ERROR";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0xa0))(param_1,iVar2,local_488,local_510 + 4);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_DB_ERROR");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5ea);
    break;
  case 0x5eb:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_518._0_4_;
    }
    pwVar11 = L"PG_GAME_SERVER_DATA_END";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GAME_SERVER_DATA_END");
    DVar5 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5eb,L"PG_GAME_SERVER_DATA_END");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_258,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_258);
      local_4c8 = &local_328;
      FUN_1400a3440();
      local_328 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_328,&local_518);
      uVar10 = FUN_140003080(local_70,L"PG_GAME_SERVER_DATA_END",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5eb,uVar10,&local_328);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5eb,L"PG_GAME_SERVER_DATA_END");
      FUN_1400031d0(&local_518);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5eb);
      local_4f8 = L"PG_GAME_SERVER_DATA_END";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0xa8))(param_1,iVar2,local_488,local_510 + 4);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PG_GAME_SERVER_DATA_END");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5eb);
    break;
  case 0x5ec:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    pwVar11 = L"PG_ALREADY_LOGIN";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_ALREADY_LOGIN");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5ec,L"PG_ALREADY_LOGIN");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      uVar10 = FUN_14003c0c0(&local_518,local_1a8,0xfffffffe);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_1a8);
      local_4c8 = &local_388;
      FUN_1400a3440();
      local_388 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_388,&local_518);
      uVar10 = FUN_140003080(local_110,L"PG_ALREADY_LOGIN",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5ec,uVar10,&local_388);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5ec,L"PG_ALREADY_LOGIN");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5ec);
      local_4f8 = L"PG_ALREADY_LOGIN";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0xb0))(param_1,iVar2,local_488);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_ALREADY_LOGIN");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5ec);
    break;
  case 0x5ed:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_518._0_4_;
    }
    pwVar11 = L"PG_SERVER_SELECT";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_SERVER_SELECT");
    DVar5 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5ed,L"PG_SERVER_SELECT");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_248,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_248);
      local_4c8 = &local_2d0;
      FUN_1400a3440();
      local_2d0 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_2d0,&local_518);
      uVar10 = FUN_140003080(local_b0,L"PG_SERVER_SELECT",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5ed,uVar10,&local_2d0);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5ed,L"PG_SERVER_SELECT");
      FUN_1400031d0(&local_518);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5ed);
      local_4f8 = L"PG_SERVER_SELECT";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0xb8))(param_1,iVar2,local_488,local_510 + 4);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_SERVER_SELECT");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5ed);
    break;
  case 0x5ee:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_4d0._0_4_ = local_518._0_4_;
    }
    cVar3 = FUN_140185490(param_2,&local_4a0,4);
    if (cVar3 != '\0') {
      local_4d8._0_4_ = local_4a0._0_4_;
    }
    cVar3 = FUN_140185490(param_2,&local_428,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_428._0_4_;
    }
    pwVar11 = L"PG_CHANNEL_SELECT";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_CHANNEL_SELECT");
    DVar5 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5ee,L"PG_CHANNEL_SELECT");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_518,local_4d0);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a28c0(&local_518,local_4d8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a28c0(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_1e8,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_1e8);
      local_4c8 = &local_378;
      FUN_1400a3440();
      local_378 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_378,&local_518);
      uVar10 = FUN_140003080(local_100,L"PG_CHANNEL_SELECT",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5ee,uVar10,&local_378);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5ee,L"PG_CHANNEL_SELECT");
      FUN_1400031d0(&local_518);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5ee);
      local_4f8 = L"PG_CHANNEL_SELECT";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    local_550 = (undefined8 *******)(local_510 + 4);
    local_558 = (undefined8 *******)local_4d8;
    cVar3 = (**(code **)(*param_1 + 0xc0))(param_1,iVar2,local_488,local_4d0);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_CHANNEL_SELECT");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5ee);
    break;
  case 0x5ef:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    pwVar11 = L"PG_IP_IN_BLACKLIST";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_IP_IN_BLACKLIST");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5ef,L"PG_IP_IN_BLACKLIST");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      uVar10 = FUN_14003c0c0(&local_518,local_238,0xfffffffe);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_238);
      local_4c8 = &local_318;
      FUN_1400a3440();
      local_318 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_318,&local_518);
      uVar10 = FUN_140003080(local_80,L"PG_IP_IN_BLACKLIST",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5ef,uVar10,&local_318);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5ef,L"PG_IP_IN_BLACKLIST");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5ef);
      local_4f8 = L"PG_IP_IN_BLACKLIST";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 200))(param_1,iVar2,local_488);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_IP_IN_BLACKLIST");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5ef);
    break;
  case 0x5f0:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    pwVar11 = L"PG_GAME_WORLD_INFO";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GAME_WORLD_INFO");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5f0,L"PG_GAME_WORLD_INFO");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      uVar10 = FUN_14003c0c0(&local_518,local_1b8,0xfffffffe);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_1b8);
      local_4c8 = &local_368;
      FUN_1400a3440();
      local_368 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_368,&local_518);
      uVar10 = FUN_140003080(local_f0,L"PG_GAME_WORLD_INFO",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5f0,uVar10,&local_368);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5f0,L"PG_GAME_WORLD_INFO");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5f0);
      local_4f8 = L"PG_GAME_WORLD_INFO";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0xd0))(param_1,iVar2,local_488);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_GAME_WORLD_INFO");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5f0);
    break;
  case 0x5f1:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_4d8._0_4_ = local_518._0_4_;
    }
    cVar3 = FUN_140185490(param_2,&local_4a0,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_4a0._0_4_;
    }
    pwVar11 = L"PG_GAME_WORLD_INFO_SUCC_U";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GAME_WORLD_INFO_SUCC_U");
    DVar5 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5f1,L"PG_GAME_WORLD_INFO_SUCC_U");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_518,local_4d8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a28c0(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_228,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_228);
      local_4c8 = &local_2e8;
      FUN_1400a3440();
      local_2e8 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_2e8,&local_518);
      uVar10 = FUN_140003080(local_a0,L"PG_GAME_WORLD_INFO_SUCC_U",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5f1,uVar10,&local_2e8);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5f1,L"PG_GAME_WORLD_INFO_SUCC_U");
      FUN_1400031d0(&local_518);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5f1);
      local_4f8 = L"PG_GAME_WORLD_INFO_SUCC_U";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    local_558 = (undefined8 *******)(local_510 + 4);
    cVar3 = (**(code **)(*param_1 + 0xd8))(param_1,iVar2,local_488,local_4d8);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PG_GAME_WORLD_INFO_SUCC_U");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5f1);
    break;
  case 0x5f2:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_518._0_4_;
    }
    FUN_1400a3440();
    local_4c8 = (longlong *******)PTR_DAT_1402f8010;
    thunk_FUN_1401865d0(param_2,&local_4c8);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GAME_WORLD_DATA");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5f2,L"PG_GAME_WORLD_DATA");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2b80(&local_518,&local_4c8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_1d8,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_1d8);
      local_50 = &local_400;
      FUN_1400a3440();
      local_400 = (undefined8 *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_400,&local_518);
      uVar10 = FUN_140003080(local_180,L"PG_GAME_WORLD_DATA",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5f2,uVar10,&local_400);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5f2,L"PG_GAME_WORLD_DATA");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5f2);
      local_4f8 = L"PG_GAME_WORLD_DATA";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    local_558 = &local_4c8;
    cVar3 = (**(code **)(*param_1 + 0xe0))(param_1,iVar2,local_488,local_510 + 4);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_GAME_WORLD_DATA");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5f2);
      local_4f8 = L"PG_GAME_WORLD_DATA";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      DVar6 = GetTickCount();
      local_4e0 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_500);
    }
    FUN_1400031d0(&local_4c8);
    return 1;
  case 0x5f3:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_518._0_4_;
    }
    pwVar11 = L"PG_GAME_WORLD_DATA_END";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GAME_WORLD_DATA_END");
    DVar5 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5f3,L"PG_GAME_WORLD_DATA_END");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_2b0,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_2b0);
      local_4c8 = &local_3f0;
      FUN_1400a3440();
      local_3f0 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_3f0,&local_518);
      uVar10 = FUN_140003080(local_168,L"PG_GAME_WORLD_DATA_END",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5f3,uVar10,&local_3f0);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5f3,L"PG_GAME_WORLD_DATA_END");
      FUN_1400031d0(&local_518);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5f3);
      local_4f8 = L"PG_GAME_WORLD_DATA_END";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0xe8))(param_1,iVar2,local_488,local_510 + 4);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PG_GAME_WORLD_DATA_END");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5f3);
    break;
  case 0x5f4:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    pwVar11 = L"PG_GET_ADD_AUTH_WPIN";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GET_ADD_AUTH_WPIN");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5f4,L"PG_GET_ADD_AUTH_WPIN");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      uVar10 = FUN_14003c0c0(&local_518,local_2a0,0xfffffffe);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_2a0);
      local_4c8 = &local_3e0;
      FUN_1400a3440();
      local_3e0 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_3e0,&local_518);
      uVar10 = FUN_140003080(local_158,L"PG_GET_ADD_AUTH_WPIN",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5f4,uVar10,&local_3e0);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5f4,L"PG_GET_ADD_AUTH_WPIN");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5f4);
      local_4f8 = L"PG_GET_ADD_AUTH_WPIN";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0xf0))(param_1,iVar2,local_488);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_GET_ADD_AUTH_WPIN");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5f4);
    break;
  case 0x5f5:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    pwVar11 = L"PG_GET_ADD_AUTH_WPOTP";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_GET_ADD_AUTH_WPOTP");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5f5,L"PG_GET_ADD_AUTH_WPOTP");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      uVar10 = FUN_14003c0c0(&local_518,local_290,0xfffffffe);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_290);
      local_4c8 = &local_3d0;
      FUN_1400a3440();
      local_3d0 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_3d0,&local_518);
      uVar10 = FUN_140003080(local_148,L"PG_GET_ADD_AUTH_WPOTP",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5f5,uVar10,&local_3d0);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5f5,L"PG_GET_ADD_AUTH_WPOTP");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5f5);
      local_4f8 = L"PG_GET_ADD_AUTH_WPOTP";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0xf8))(param_1,iVar2,local_488);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_GET_ADD_AUTH_WPOTP")
      ;
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5f5);
    break;
  case 0x5f6:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    FUN_1400a3440();
    local_4c8 = (longlong *******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4c8);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_KEY_ADD_AUTH_WPIN");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5f6,L"PG_KEY_ADD_AUTH_WPIN");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2ac0(&local_518,&local_4c8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_280,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_280);
      local_50 = &local_3c0;
      FUN_1400a3440();
      local_3c0 = (undefined8 *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_3c0,&local_518);
      uVar10 = FUN_140003080(local_138,L"PG_KEY_ADD_AUTH_WPIN",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5f6,uVar10,&local_3c0);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5f6,L"PG_KEY_ADD_AUTH_WPIN");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5f6);
      local_4f8 = L"PG_KEY_ADD_AUTH_WPIN";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0x100))(param_1,iVar2,local_488,&local_4c8);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_KEY_ADD_AUTH_WPIN");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5f6);
      local_4f8 = L"PG_KEY_ADD_AUTH_WPIN";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      DVar6 = GetTickCount();
      local_4e0 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_500);
    }
    goto LAB_14003bde6;
  case 0x5f7:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    FUN_1400a3440();
    local_4c8 = (longlong *******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4c8);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_KEY_ADD_AUTH_WPOTP");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5f7,L"PG_KEY_ADD_AUTH_WPOTP");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2ac0(&local_518,&local_4c8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_270,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_270);
      local_50 = &local_3b0;
      FUN_1400a3440();
      local_3b0 = (undefined8 *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_3b0,&local_518);
      uVar10 = FUN_140003080(local_128,L"PG_KEY_ADD_AUTH_WPOTP",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5f7,uVar10,&local_3b0);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5f7,L"PG_KEY_ADD_AUTH_WPOTP");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5f7);
      local_4f8 = L"PG_KEY_ADD_AUTH_WPOTP";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0x108))(param_1,iVar2,local_488,&local_4c8);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_KEY_ADD_AUTH_WPOTP")
      ;
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5f7);
      local_4f8 = L"PG_KEY_ADD_AUTH_WPOTP";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      DVar6 = GetTickCount();
      local_4e0 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_500);
    }
    goto LAB_14003bde6;
  case 0x5f8:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    FUN_1400a3440();
    local_50 = (undefined8 ******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_50);
    FUN_1400a3440();
    local_4c8 = (longlong *******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4c8);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_AUTH_PWE_TYPE");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5f8,L"PG_AUTH_PWE_TYPE");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2ac0(&local_518,&local_50);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2ac0(&local_518,&local_4c8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_260,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_260);
      local_4a0 = &local_3a0;
      FUN_1400a3440();
      local_3a0 = (undefined8 *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_3a0,&local_518);
      uVar10 = FUN_140003080(local_118,L"PG_AUTH_PWE_TYPE",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5f8,uVar10,&local_3a0);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5f8,L"PG_AUTH_PWE_TYPE");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5f8);
      local_4f8 = L"PG_AUTH_PWE_TYPE";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    local_558 = &local_4c8;
    cVar3 = (**(code **)(*param_1 + 0x110))(param_1,iVar2,local_488,&local_50);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_AUTH_PWE_TYPE");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5f8);
      local_4f8 = L"PG_AUTH_PWE_TYPE";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      DVar6 = GetTickCount();
      local_4e0 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_500);
    }
    FUN_14000c2a0(&local_4c8);
    pppppppuVar13 = &local_50;
    goto LAB_14003bdea;
  case 0x5f9:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_4d0._0_4_ = local_518._0_4_;
    }
    FUN_1400a3440();
    local_4c8 = (longlong *******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4c8);
    cVar3 = FUN_140185490(param_2,&local_4a0,4);
    if (cVar3 != '\0') {
      local_4d8._0_4_ = local_4a0._0_4_;
    }
    cVar3 = FUN_140185490(param_2,&local_428,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_428._0_4_;
    }
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_AUTH_PWE_TYPE_RESULT");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5f9,L"PG_AUTH_PWE_TYPE_RESULT");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_518,local_4d0);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2ac0(&local_518,&local_4c8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a28c0(&local_518,local_4d8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a28c0(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_250,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_250);
      local_50 = &local_390;
      FUN_1400a3440();
      local_390 = (undefined8 *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_390,&local_518);
      uVar10 = FUN_140003080(local_108,L"PG_AUTH_PWE_TYPE_RESULT",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5f9,uVar10,&local_390);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5f9,L"PG_AUTH_PWE_TYPE_RESULT");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5f9);
      local_4f8 = L"PG_AUTH_PWE_TYPE_RESULT";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    local_548 = (undefined8 *******)(local_510 + 4);
    local_550 = (undefined8 *******)local_4d8;
    local_558 = &local_4c8;
    cVar3 = (**(code **)(*param_1 + 0x118))(param_1,iVar2,local_488,local_4d0);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PG_AUTH_PWE_TYPE_RESULT");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5f9);
      local_4f8 = L"PG_AUTH_PWE_TYPE_RESULT";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      DVar6 = GetTickCount();
      local_4e0 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_500);
    }
    goto LAB_14003bde6;
  case 0x5fa:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    FUN_1400a3440();
    local_4c8 = (longlong *******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4c8);
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_4d0._0_4_ = local_518._0_4_;
    }
    cVar3 = FUN_140185490(param_2,&local_4a0,4);
    if (cVar3 != '\0') {
      local_4d8._0_4_ = local_4a0._0_4_;
    }
    cVar3 = FUN_140185490(param_2,&local_428,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_428._0_4_;
    }
    FUN_140185490(param_2,local_508,1);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,L"PG_RESP_BCUST");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5fa,L"PG_RESP_BCUST");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2ac0(&local_518,&local_4c8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a28c0(&local_518,local_4d0);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a28c0(&local_518,local_4d8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a28c0(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2720(&local_518,local_510);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_240,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_240);
      local_50 = &local_380;
      FUN_1400a3440();
      local_380 = (undefined8 *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_380,&local_518);
      uVar10 = FUN_140003080(local_f8,L"PG_RESP_BCUST",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5fa,uVar10,&local_380);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5fa,L"PG_RESP_BCUST");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5fa);
      local_4f8 = L"PG_RESP_BCUST";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    local_540 = (undefined8 *******)local_510;
    local_548 = (undefined8 *******)(local_510 + 4);
    local_550 = (undefined8 *******)local_4d8;
    local_558 = (undefined8 *******)local_4d0;
    cVar3 = (**(code **)(*param_1 + 0x120))(param_1,iVar2,local_488,&local_4c8);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_RESP_BCUST");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5fa);
      local_4f8 = L"PG_RESP_BCUST";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      DVar6 = GetTickCount();
      local_4e0 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_500);
    }
    goto LAB_14003bde6;
  case 0x5fb:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_4d8._0_4_ = local_518._0_4_;
    }
    cVar3 = FUN_140185490(param_2,&local_4a0,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_4a0._0_4_;
    }
    pwVar11 = L"PG_TIME_SHUT_DOWN";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_TIME_SHUT_DOWN");
    DVar5 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5fb,L"PG_TIME_SHUT_DOWN");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_518,local_4d8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a28c0(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_230,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_230);
      local_4c8 = &local_370;
      FUN_1400a3440();
      local_370 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_370,&local_518);
      uVar10 = FUN_140003080(local_e8,L"PG_TIME_SHUT_DOWN",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5fb,uVar10,&local_370);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5fb,L"PG_TIME_SHUT_DOWN");
      FUN_1400031d0(&local_518);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5fb);
      local_4f8 = L"PG_TIME_SHUT_DOWN";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    local_558 = (undefined8 *******)(local_510 + 4);
    cVar3 = (**(code **)(*param_1 + 0x128))(param_1,iVar2,local_488,local_4d8);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_TIME_SHUT_DOWN");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x5fb);
    break;
  case 0x5fc:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    FUN_1400a3440();
    local_4a0 = (undefined8 ******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4a0);
    FUN_1400a3440();
    local_50 = (undefined8 ******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_50);
    FUN_1400a3440();
    local_4c8 = (longlong *******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4c8);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_AUTH_PWE_TYPE_CORECLIENT");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5fc,L"PG_AUTH_PWE_TYPE_CORECLIENT");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2ac0(&local_518,&local_4a0);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2ac0(&local_518,&local_50);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2ac0(&local_518,&local_4c8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_220,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_220);
      local_428 = &local_360;
      FUN_1400a3440();
      local_360 = (undefined8 *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_360,&local_518);
      uVar10 = FUN_140003080(local_d8,L"PG_AUTH_PWE_TYPE_CORECLIENT",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5fc,uVar10,&local_360);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5fc,L"PG_AUTH_PWE_TYPE_CORECLIENT");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5fc);
      local_4f8 = L"PG_AUTH_PWE_TYPE_CORECLIENT";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    local_550 = &local_4c8;
    local_558 = &local_50;
    cVar3 = (**(code **)(*param_1 + 0x130))(param_1,iVar2,local_488,&local_4a0);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PG_AUTH_PWE_TYPE_CORECLIENT");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5fc);
      local_4f8 = L"PG_AUTH_PWE_TYPE_CORECLIENT";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      DVar6 = GetTickCount();
      local_4e0 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_500);
    }
    FUN_14000c2a0(&local_4c8);
    FUN_14000c2a0(&local_50);
    pppppppuVar13 = &local_4a0;
    goto LAB_14003bdea;
  case 0x5fd:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    FUN_1400a3440();
    local_418 = (undefined8 ******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_418);
    FUN_1400a3440();
    local_428 = (undefined8 ******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_428);
    FUN_1400a3440();
    local_4a0 = (undefined8 ******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4a0);
    FUN_1400a3440();
    local_50 = (undefined8 ******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_50);
    FUN_1400a3440();
    local_4c8 = (longlong *******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4c8);
    FUN_140185490(param_2,local_508,1);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_AUTH_SEGA_TYPE");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5fd,L"PG_AUTH_SEGA_TYPE");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2ac0(&local_518,&local_418);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2ac0(&local_518,&local_428);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2ac0(&local_518,&local_4a0);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2ac0(&local_518,&local_50);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2ac0(&local_518,&local_4c8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2720(&local_518,local_510);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_210,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_210);
      local_2c0 = &local_350;
      FUN_1400a3440();
      local_350 = PTR_DAT_1402f8010;
      FUN_140003100(&local_350,&local_518);
      uVar10 = FUN_140003080(local_c8,L"PG_AUTH_SEGA_TYPE",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5fd,uVar10,&local_350);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5fd,L"PG_AUTH_SEGA_TYPE");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5fd);
      local_4f8 = L"PG_AUTH_SEGA_TYPE";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    local_538 = local_510;
    local_540 = &local_4c8;
    local_548 = &local_50;
    local_550 = &local_4a0;
    local_558 = &local_428;
    cVar3 = (**(code **)(*param_1 + 0x138))(param_1,iVar2,local_488,&local_418);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_AUTH_SEGA_TYPE");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5fd);
      local_4f8 = L"PG_AUTH_SEGA_TYPE";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      DVar6 = GetTickCount();
      local_4e0 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_500);
    }
    FUN_14000c2a0(&local_4c8);
    FUN_14000c2a0(&local_50);
    FUN_14000c2a0(&local_4a0);
    FUN_14000c2a0(&local_428);
    pppppppuVar13 = &local_418;
    goto LAB_14003bdea;
  case 0x5fe:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_4d8._0_4_ = local_518._0_4_;
    }
    FUN_1400a3440();
    local_4c8 = (longlong *******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4c8);
    cVar3 = FUN_140185490(param_2,&local_4a0,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_4a0._0_4_;
    }
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_AUTH_SEGA_TYPE_RESULT");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5fe,L"PG_AUTH_SEGA_TYPE_RESULT");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_518,local_4d8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2ac0(&local_518,&local_4c8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a28c0(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_200,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_200);
      local_50 = &local_340;
      FUN_1400a3440();
      local_340 = (undefined8 *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_340,&local_518);
      uVar10 = FUN_140003080(local_b8,L"PG_AUTH_SEGA_TYPE_RESULT",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5fe,uVar10,&local_340);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5fe,L"PG_AUTH_SEGA_TYPE_RESULT");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5fe);
      local_4f8 = L"PG_AUTH_SEGA_TYPE_RESULT";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    local_550 = (undefined8 *******)(local_510 + 4);
    local_558 = &local_4c8;
    cVar3 = (**(code **)(*param_1 + 0x140))(param_1,iVar2,local_488,local_4d8);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PG_AUTH_SEGA_TYPE_RESULT");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5fe);
      local_4f8 = L"PG_AUTH_SEGA_TYPE_RESULT";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      DVar6 = GetTickCount();
      local_4e0 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_500);
    }
    goto LAB_14003bde6;
  case 0x5ff:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    FUN_1400a3440();
    local_4a0 = (undefined8 ******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4a0);
    FUN_1400a3440();
    local_50 = (undefined8 ******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_50);
    FUN_1400a3440();
    local_4c8 = (longlong *******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4c8);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_AUTH_WAYI_TYPE");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x5ff,L"PG_AUTH_WAYI_TYPE");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2ac0(&local_518,&local_4a0);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2ac0(&local_518,&local_50);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2ac0(&local_518,&local_4c8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_1f0,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_1f0);
      local_428 = &local_330;
      FUN_1400a3440();
      local_330 = (undefined8 *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_330,&local_518);
      uVar10 = FUN_140003080(local_a8,L"PG_AUTH_WAYI_TYPE",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x5ff,uVar10,&local_330);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x5ff,L"PG_AUTH_WAYI_TYPE");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5ff);
      local_4f8 = L"PG_AUTH_WAYI_TYPE";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    local_550 = &local_4c8;
    local_558 = &local_50;
    cVar3 = (**(code **)(*param_1 + 0x148))(param_1,iVar2,local_488,&local_4a0);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_AUTH_WAYI_TYPE");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x5ff);
      local_4f8 = L"PG_AUTH_WAYI_TYPE";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      DVar6 = GetTickCount();
      local_4e0 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_500);
    }
    FUN_14000c2a0(&local_4c8);
    FUN_14000c2a0(&local_50);
    pppppppuVar13 = &local_4a0;
    goto LAB_14003bdea;
  case 0x600:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    FUN_1400a3440();
    local_4c8 = (longlong *******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4c8);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_AUTH_WAYI_TYPE_RESULT");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x600,L"PG_AUTH_WAYI_TYPE_RESULT");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2ac0(&local_518,&local_4c8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_1e0,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_1e0);
      local_50 = &local_320;
      FUN_1400a3440();
      local_320 = (undefined8 *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_320,&local_518);
      uVar10 = FUN_140003080(local_98,L"PG_AUTH_WAYI_TYPE_RESULT",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x600,uVar10,&local_320);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x600,L"PG_AUTH_WAYI_TYPE_RESULT");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x600);
      local_4f8 = L"PG_AUTH_WAYI_TYPE_RESULT";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0x150))(param_1,iVar2,local_488,&local_4c8);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PG_AUTH_WAYI_TYPE_RESULT");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x600);
      local_4f8 = L"PG_AUTH_WAYI_TYPE_RESULT";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      DVar6 = GetTickCount();
      local_4e0 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_500);
    }
    goto LAB_14003bde6;
  case 0x601:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    FUN_1400a3440();
    local_4a0 = (undefined8 ******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4a0);
    FUN_1400a3440();
    local_50 = (undefined8 ******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_50);
    FUN_140185490(param_2,local_508,1);
    FUN_1400a3440();
    local_4c8 = (longlong *******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4c8);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_AUTH_XUNLEI_TYPE");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x601,L"PG_AUTH_XUNLEI_TYPE");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2ac0(&local_518,&local_4a0);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2ac0(&local_518,&local_50);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2720(&local_518,local_510);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      FUN_1401a2ac0(&local_518,&local_4c8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_1d0,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_1d0);
      local_428 = &local_310;
      FUN_1400a3440();
      local_310 = (undefined8 *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_310,&local_518);
      uVar10 = FUN_140003080(local_88,L"PG_AUTH_XUNLEI_TYPE",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x601,uVar10,&local_310);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x601,L"PG_AUTH_XUNLEI_TYPE");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x601);
      local_4f8 = L"PG_AUTH_XUNLEI_TYPE";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    local_548 = &local_4c8;
    local_550 = (undefined8 *******)local_510;
    local_558 = &local_50;
    cVar3 = (**(code **)(*param_1 + 0x158))(param_1,iVar2,local_488,&local_4a0);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PG_AUTH_XUNLEI_TYPE");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x601);
      local_4f8 = L"PG_AUTH_XUNLEI_TYPE";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      DVar6 = GetTickCount();
      local_4e0 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_500);
    }
    FUN_14000c2a0(&local_4c8);
    FUN_14000c2a0(&local_50);
    pppppppuVar13 = &local_4a0;
    goto LAB_14003bdea;
  case 0x602:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    cVar3 = FUN_140185490(param_2,&local_518,4);
    if (cVar3 != '\0') {
      local_510._4_4_ = local_518._0_4_;
    }
    pwVar11 = L"PG_AUTH_XUNLEI_TYPE_RESULT";
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_AUTH_XUNLEI_TYPE_RESULT");
    DVar5 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x602,L"PG_AUTH_XUNLEI_TYPE_RESULT");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_518,local_510 + 4);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_1c0,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_1c0);
      local_4c8 = &local_300;
      FUN_1400a3440();
      local_300 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_300,&local_518);
      uVar10 = FUN_140003080(local_78,L"PG_AUTH_XUNLEI_TYPE_RESULT",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x602,uVar10,&local_300);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x602,L"PG_AUTH_XUNLEI_TYPE_RESULT");
      FUN_1400031d0(&local_518);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x602);
      local_4f8 = L"PG_AUTH_XUNLEI_TYPE_RESULT";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0x160))(param_1,iVar2,local_488,local_510 + 4);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PG_AUTH_XUNLEI_TYPE_RESULT");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_500 = (void *)CONCAT44(local_500._4_4_,0x602);
    break;
  case 0x603:
    FUN_140140af0(local_488);
    local_484 = param_2[10];
    local_488[0] = (undefined1)param_2[0x10];
    FUN_1400a3440();
    local_4c8 = (longlong *******)PTR_DAT_1402f8008;
    thunk_FUN_140186270(param_2,&local_4c8);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PG_KEY_ADD_AUTH_WPIN_OTHER");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_558 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x603,L"PG_KEY_ADD_AUTH_WPIN_OTHER");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_518 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2ac0(&local_518,&local_4c8);
      FUN_14003c890(&local_518,&DAT_14027c73c);
      iVar12 = 0;
      if ((local_518 != (undefined8 *******)0x0) &&
         (local_518 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar12 = *(int *)(local_518 + -1);
      }
      uVar10 = FUN_14003c0c0(&local_518,local_1b0,iVar12 + -2);
      FUN_140003100(&local_518,uVar10);
      FUN_1400031d0(local_1b0);
      local_50 = &local_2f0;
      FUN_1400a3440();
      local_2f0 = (undefined8 *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_2f0,&local_518);
      uVar10 = FUN_140003080(local_68,L"PG_KEY_ADD_AUTH_WPIN_OTHER",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x603,uVar10,&local_2f0);
      local_558 = local_518;
      if (local_518 == (undefined8 *******)0x0) {
        local_558 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x603,L"PG_KEY_ADD_AUTH_WPIN_OTHER");
      FUN_1400031d0(&local_518);
    }
    DVar5 = 0;
    if (((char)param_1[3] == '\0') && (DVar5 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x603);
      local_4f8 = L"PG_KEY_ADD_AUTH_WPIN_OTHER";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_500);
      DVar5 = GetTickCount();
    }
    cVar3 = (**(code **)(*param_1 + 0x168))(param_1,iVar2,local_488,&local_4c8);
    if (cVar3 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PG_KEY_ADD_AUTH_WPIN_OTHER");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_500 = (void *)CONCAT44(local_500._4_4_,0x603);
      local_4f8 = L"PG_KEY_ADD_AUTH_WPIN_OTHER";
      local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
      local_4e8 = param_3;
      DVar6 = GetTickCount();
      local_4e0 = DVar6 - DVar5;
      (**(code **)(*param_1 + 0x18))(param_1,&local_500);
    }
LAB_14003bde6:
    pppppppuVar13 = &local_4c8;
LAB_14003bdea:
    FUN_14000c2a0(pppppppuVar13);
    return 1;
  default:
    goto switchD_140035bd4_default;
  }
  local_4f0 = CONCAT44(local_4f0._4_4_,iVar2);
  local_4f8 = pwVar11;
  local_4e8 = param_3;
  DVar6 = GetTickCount();
  local_4e0 = DVar6 - DVar5;
  (**(code **)(*param_1 + 0x18))(param_1,&local_500);
  return 1;
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl std::bad_alloc::`scalar deleting destructor'(unsigned
// int) __ptr64
// 
// Libraries: Visual Studio 2012 Release, Visual Studio 2015 Release

void * __thiscall std::bad_alloc::_scalar_deleting_destructor_(bad_alloc *this,uint param_1)

{
  *(undefined ***)this = RNP::Gate2GateStub::vftable;
  FUN_14018a150();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_14003bf10(undefined8 *param_1)

{
  *param_1 = RNP::Gate2GateStub::vftable;
  FUN_14018a150();
  return;
}



void FUN_14003bf20(void)

{
  return;
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl std::bad_alloc::`scalar deleting destructor'(unsigned
// int) __ptr64
// 
// Libraries: Visual Studio 2012 Release, Visual Studio 2015 Release

void * __thiscall std::bad_alloc::_scalar_deleting_destructor_(bad_alloc *this,uint param_1)

{
  *(undefined ***)this = RNP::Gate2GateProxy::vftable;
  FUN_140186ed0();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_14003bf70(undefined8 *param_1)

{
  *param_1 = RNP::Gate2GateProxy::vftable;
  FUN_140186ed0();
  return;
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl std::bad_alloc::`scalar deleting destructor'(unsigned
// int) __ptr64
// 
// Libraries: Visual Studio 2012 Release, Visual Studio 2015 Release

void * __thiscall std::bad_alloc::_scalar_deleting_destructor_(bad_alloc *this,uint param_1)

{
  *(undefined ***)this = RNP::GateLobbyStub::vftable;
  FUN_14018a150();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_14003bfc0(undefined8 *param_1)

{
  *param_1 = RNP::GateLobbyStub::vftable;
  FUN_14018a150();
  return;
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl std::bad_alloc::`scalar deleting destructor'(unsigned
// int) __ptr64
// 
// Libraries: Visual Studio 2012 Release, Visual Studio 2015 Release

void * __thiscall std::bad_alloc::_scalar_deleting_destructor_(bad_alloc *this,uint param_1)

{
  *(undefined ***)this = RNP::GateLobbyProxy::vftable;
  FUN_140186ed0();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_14003c010(undefined8 *param_1)

{
  *param_1 = RNP::GateLobbyProxy::vftable;
  FUN_140186ed0();
  return;
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl std::bad_alloc::`scalar deleting destructor'(unsigned
// int) __ptr64
// 
// Libraries: Visual Studio 2012 Release, Visual Studio 2015 Release

void * __thiscall std::bad_alloc::_scalar_deleting_destructor_(bad_alloc *this,uint param_1)

{
  *(undefined ***)this = RNP::PCGateStub::vftable;
  FUN_14018a150();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_14003c060(undefined8 *param_1)

{
  *param_1 = RNP::PCGateStub::vftable;
  FUN_14018a150();
  return;
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl std::bad_alloc::`scalar deleting destructor'(unsigned
// int) __ptr64
// 
// Libraries: Visual Studio 2012 Release, Visual Studio 2015 Release

void * __thiscall std::bad_alloc::_scalar_deleting_destructor_(bad_alloc *this,uint param_1)

{
  *(undefined ***)this = RNP::PCGateProxy::vftable;
  FUN_140186ed0();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_14003c0b0(undefined8 *param_1)

{
  *param_1 = RNP::PCGateProxy::vftable;
  FUN_140186ed0();
  return;
}



undefined8 * FUN_14003c0c0(longlong *param_1,undefined8 *param_2,int param_3)

{
  int iVar1;
  undefined *puVar2;
  
  puVar2 = (undefined *)*param_1;
  if (param_3 < 0) {
    param_3 = 0;
  }
  iVar1 = 0;
  if ((puVar2 != (undefined *)0x0) && (iVar1 = 0, puVar2 != PTR_DAT_1402f8010)) {
    iVar1 = *(int *)(puVar2 + -8);
  }
  if (iVar1 <= param_3) {
    FUN_1400a3440();
    *param_2 = PTR_DAT_1402f8010;
    FUN_140003100(param_2,param_1);
    return param_2;
  }
  if (puVar2 == (undefined *)0x0) {
    puVar2 = PTR_DAT_1402f8010;
  }
  FUN_140003080(param_2,puVar2);
  return param_2;
}



undefined8 FUN_14003c140(undefined8 param_1,ulonglong *param_2)

{
  void *_Dst;
  int *piVar1;
  int *piVar2;
  code *pcVar3;
  int iVar4;
  char cVar5;
  undefined8 uVar6;
  ulonglong uVar7;
  longlong lVar8;
  ulonglong uVar9;
  int iVar10;
  undefined1 uVar11;
  int local_res10 [2];
  undefined1 local_res18 [16];
  
  FUN_140185490(param_1,local_res10,4);
  iVar4 = local_res10[0];
  if ((local_res10[0] < 0) || (DAT_1402f8140 <= local_res10[0])) {
    FUN_1401a2590(local_res10[0]);
  }
  FUN_14003c310(param_2,(longlong)iVar4);
  _Dst = (void *)*param_2;
  if (_Dst != (void *)param_2[1]) {
    memmove(_Dst,(void *)param_2[1],0);
    param_2[1] = (ulonglong)_Dst;
  }
  iVar10 = 0;
  if (0 < iVar4) {
    uVar11 = (undefined1)local_res10[0];
    do {
      cVar5 = FUN_140185490(param_1,local_res18,1);
      if (cVar5 != '\0') {
        uVar11 = local_res18[0];
      }
      piVar1 = (int *)param_2[1];
      local_res10[0] = CONCAT31(local_res10[0]._1_3_,uVar11);
      if ((local_res10 < piVar1) && (piVar2 = (int *)*param_2, piVar2 <= local_res10)) {
        if (piVar1 == (int *)param_2[2]) {
          if ((longlong)piVar1 - (longlong)piVar2 == -1) {
            std::_Xlength_error("vector<T> too long");
            pcVar3 = (code *)swi(3);
            uVar6 = (*pcVar3)();
            return uVar6;
          }
          uVar7 = ((longlong)piVar1 - (longlong)piVar2) + 1;
          uVar9 = (longlong)param_2[2] - (longlong)piVar2;
          if (uVar9 < uVar7) {
            if (-(uVar9 >> 1) - 1 < uVar9) {
              uVar9 = 0;
            }
            else {
              uVar9 = uVar9 + (uVar9 >> 1);
            }
            if (uVar9 < uVar7) {
              uVar9 = uVar7;
            }
            FUN_14003c310(param_2,uVar9);
          }
        }
        if ((undefined1 *)param_2[1] != (undefined1 *)0x0) {
          *(undefined1 *)param_2[1] =
               *(undefined1 *)((longlong)local_res10 + (*param_2 - (longlong)piVar2));
        }
      }
      else {
        if (piVar1 == (int *)param_2[2]) {
          lVar8 = (longlong)piVar1 - *param_2;
          if (lVar8 == -1) {
            std::_Xlength_error("vector<T> too long");
            pcVar3 = (code *)swi(3);
            uVar6 = (*pcVar3)();
            return uVar6;
          }
          uVar7 = lVar8 + 1;
          uVar9 = (longlong)param_2[2] - *param_2;
          if (uVar9 < uVar7) {
            if (-(uVar9 >> 1) - 1 < uVar9) {
              uVar9 = 0;
            }
            else {
              uVar9 = uVar9 + (uVar9 >> 1);
            }
            if (uVar9 < uVar7) {
              uVar9 = uVar7;
            }
            FUN_14003c310(param_2,uVar9);
          }
        }
        if ((undefined1 *)param_2[1] != (undefined1 *)0x0) {
          *(undefined1 *)param_2[1] = uVar11;
        }
      }
      param_2[1] = param_2[1] + 1;
      iVar10 = iVar10 + 1;
    } while (iVar10 < iVar4);
  }
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x00014003c33a)

void FUN_14003c310(longlong *param_1,ulonglong param_2)

{
  void *pvVar1;
  longlong lVar2;
  char *pcVar3;
  char *local_res10;
  undefined **local_20 [3];
  
  if ((ulonglong)(param_1[2] - *param_1) < param_2) {
    local_res10 = (char *)0x0;
    if ((param_2 != 0) && (local_res10 = operator_new(param_2), local_res10 == (char *)0x0)) {
      std::exception::exception((exception *)local_20,&local_res10);
      local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
    }
    pcVar3 = local_res10;
    memmove(local_res10,(void *)*param_1,param_1[1] - *param_1);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar3 + param_2);
    param_1[1] = (longlong)(pcVar3 + (lVar2 - (longlong)pvVar1));
    *param_1 = (longlong)pcVar3;
  }
  return;
}



void FUN_14003c400(longlong *param_1,longlong *param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  undefined *puVar4;
  int iVar5;
  undefined4 uVar6;
  undefined *puVar7;
  
  puVar4 = (undefined *)*param_2;
  if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1402f8010)) && (0 < *(int *)(puVar4 + -8))
     ) {
    puVar7 = (undefined *)*param_1;
    iVar5 = 0;
    if ((puVar7 != (undefined *)0x0) && (puVar7 != PTR_DAT_1402f8010)) {
      iVar5 = *(int *)(puVar7 + -8);
    }
    iVar3 = *(int *)(puVar4 + -8) + iVar5;
    iVar1 = 0;
    if ((puVar7 != (undefined *)0x0) && (iVar1 = 0, puVar7 != PTR_DAT_1402f8010)) {
      iVar1 = *(int *)(puVar7 + -8);
    }
    if (((iVar3 <= iVar1) && (iVar3 = 0, puVar7 != (undefined *)0x0)) &&
       (puVar7 != PTR_DAT_1402f8010)) {
      iVar3 = *(int *)(puVar7 + -8);
    }
    iVar1 = 0;
    iVar2 = 1;
    if (1 < iVar3) {
      iVar2 = iVar3;
    }
    if ((puVar7 != (undefined *)0x0) && (puVar7 != PTR_DAT_1402f8010)) {
      iVar1 = *(int *)(puVar7 + -8);
    }
    if (iVar1 < iVar2) {
      FUN_140002d50(param_1,iVar2);
    }
    FUN_140002e30(param_1);
    puVar4 = (undefined *)*param_2;
    uVar6 = 0;
    puVar7 = (undefined *)*param_1;
    if ((undefined *)*param_1 == (undefined *)0x0) {
      puVar7 = PTR_DAT_1402f8010;
    }
    if ((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1402f8010)) {
      uVar6 = *(undefined4 *)(puVar4 + -8);
    }
    if (puVar4 == (undefined *)0x0) {
      puVar4 = PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar7 + (longlong)iVar5 * 2,puVar4,uVar6);
    puVar4 = (undefined *)*param_2;
    iVar1 = 0;
    if ((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1402f8010)) {
      iVar1 = *(int *)(puVar4 + -8);
    }
    iVar3 = 0;
    iVar2 = 0;
    if (0 < iVar1 + iVar5) {
      iVar2 = iVar1 + iVar5;
    }
    puVar4 = (undefined *)*param_1;
    if ((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1402f8010)) {
      iVar3 = *(int *)(puVar4 + -8);
    }
    if ((iVar3 <= iVar2) && (iVar2 = 0, puVar4 != (undefined *)0x0)) {
      if (puVar4 == PTR_DAT_1402f8010) {
        return;
      }
      iVar2 = *(int *)(puVar4 + -8);
    }
    if (((puVar4 != PTR_DAT_1402f8010) && (puVar4 != (undefined *)0x0)) &&
       ((int *)(puVar4 + -8) != (int *)0x0)) {
      *(int *)(puVar4 + -8) = iVar2;
      *(undefined2 *)(puVar4 + (longlong)iVar2 * 2) = 0;
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14003c570(undefined8 param_1,wchar_t *param_2,va_list param_3)

{
  int iVar1;
  undefined8 uVar2;
  undefined1 auStack_858 [32];
  wchar_t local_838 [1040];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_858;
  if (param_2 == (wchar_t *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80070057);
  }
  iVar1 = vswprintf_s(local_838,0x400,param_2,param_3);
  uVar2 = FUN_140002f20(param_1,iVar1);
  FUN_1400a32f0(uVar2,local_838,iVar1);
  FUN_140003000(param_1);
  return;
}



void FUN_14003c600(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 local_res18;
  undefined8 local_res20;
  
  local_res18 = param_3;
  local_res20 = param_4;
  FUN_14003c570(param_1,param_2,&local_res18);
  return;
}



undefined8 FUN_14003c630(undefined8 param_1,undefined8 *param_2)

{
  char cVar1;
  undefined8 local_res8;
  
  cVar1 = FUN_140185490(param_1,&local_res8,8);
  if (cVar1 != '\0') {
    *param_2 = local_res8;
  }
  return param_1;
}



undefined8 FUN_14003c670(undefined8 param_1,undefined2 *param_2)

{
  undefined8 uVar1;
  undefined2 local_res18 [8];
  
  uVar1 = FUN_140185490(param_1,local_res18,2);
  if ((char)uVar1 == '\0') {
    return uVar1;
  }
  *param_2 = local_res18[0];
  return CONCAT71((uint7)(byte)((ushort)local_res18[0] >> 8),1);
}



undefined8 FUN_14003c6b0(undefined8 param_1,undefined1 *param_2)

{
  undefined8 uVar1;
  undefined1 local_res18 [16];
  
  uVar1 = FUN_140185490(param_1,local_res18,1);
  if ((char)uVar1 == '\0') {
    return uVar1;
  }
  *param_2 = local_res18[0];
  return 1;
}



undefined8 FUN_14003c6f0(undefined8 param_1,undefined4 *param_2)

{
  undefined8 uVar1;
  undefined4 local_res18 [4];
  
  uVar1 = FUN_140185490(param_1,local_res18,4);
  if ((char)uVar1 == '\0') {
    return uVar1;
  }
  *param_2 = local_res18[0];
  return CONCAT71((uint7)(uint3)((uint)local_res18[0] >> 8),1);
}



undefined8 FUN_14003c730(undefined8 param_1,undefined4 *param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *param_2 = local_res8[0];
  }
  return param_1;
}



undefined8 FUN_14003c770(undefined8 param_1,undefined1 *param_2)

{
  char cVar1;
  undefined1 local_res8 [8];
  
  cVar1 = FUN_140185490(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *param_2 = local_res8[0];
  }
  return param_1;
}



undefined8 FUN_14003c7b0(undefined8 param_1,undefined2 *param_2)

{
  char cVar1;
  undefined2 local_res8 [4];
  
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *param_2 = local_res8[0];
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14003c7f0(undefined8 param_1,undefined4 *param_2)

{
  undefined8 uVar1;
  undefined1 auStack_48 [32];
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_48;
  local_28 = 0;
  local_24 = 0;
  local_20 = 0;
  local_1c = 0;
  uVar1 = FUN_140185490(param_1,&local_28,0x10);
  if ((char)uVar1 == '\0') {
    return uVar1;
  }
  *param_2 = local_28;
  param_2[1] = local_24;
  param_2[2] = local_20;
  param_2[3] = local_1c;
  return CONCAT71((uint7)(uint3)((uint)local_1c >> 8),1);
}



void FUN_14003c890(longlong *param_1,longlong param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  undefined *puVar6;
  
  if (param_2 != 0) {
    iVar1 = FUN_1400a32c0(param_2);
    puVar6 = (undefined *)*param_1;
    iVar4 = 0;
    if ((puVar6 != (undefined *)0x0) && (iVar4 = 0, puVar6 != PTR_DAT_1402f8010)) {
      iVar4 = *(int *)(puVar6 + -8);
    }
    iVar5 = iVar4 + iVar1;
    iVar2 = 0;
    if ((puVar6 != (undefined *)0x0) && (iVar2 = 0, puVar6 != PTR_DAT_1402f8010)) {
      iVar2 = *(int *)(puVar6 + -8);
    }
    iVar3 = iVar5;
    if (((iVar5 <= iVar2) && (iVar3 = 0, puVar6 != (undefined *)0x0)) &&
       (puVar6 != PTR_DAT_1402f8010)) {
      iVar3 = *(int *)(puVar6 + -8);
    }
    iVar2 = 1;
    if (1 < iVar3) {
      iVar2 = iVar3;
    }
    iVar3 = 0;
    if ((puVar6 != (undefined *)0x0) && (puVar6 != PTR_DAT_1402f8010)) {
      iVar3 = *(int *)(puVar6 + -8);
    }
    if (iVar3 < iVar2) {
      FUN_140002d50(param_1);
    }
    FUN_140002e30(param_1);
    puVar6 = (undefined *)*param_1;
    if ((undefined *)*param_1 == (undefined *)0x0) {
      puVar6 = PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar6 + (longlong)iVar4 * 2,param_2,iVar1);
    puVar6 = (undefined *)*param_1;
    iVar4 = 0;
    iVar1 = 0;
    if (0 < iVar5) {
      iVar1 = iVar5;
    }
    if ((puVar6 != (undefined *)0x0) && (puVar6 != PTR_DAT_1402f8010)) {
      iVar4 = *(int *)(puVar6 + -8);
    }
    if ((iVar4 <= iVar1) && (iVar1 = 0, puVar6 != (undefined *)0x0)) {
      if (puVar6 == PTR_DAT_1402f8010) {
        return;
      }
      iVar1 = *(int *)(puVar6 + -8);
    }
    if (((puVar6 != PTR_DAT_1402f8010) && (puVar6 != (undefined *)0x0)) &&
       ((int *)(puVar6 + -8) != (int *)0x0)) {
      *(int *)(puVar6 + -8) = iVar1;
      *(undefined2 *)(puVar6 + (longlong)iVar1 * 2) = 0;
    }
  }
  return;
}



void FUN_14003c9e0(longlong param_1,undefined1 param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  undefined1 local_58 [80];
  
  lVar4 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(lVar2 + 0x18);
    FUN_14003cda0(lVar2,iVar1 + 1);
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar2 + 0x10);
    }
    *(undefined1 *)(iVar1 + lVar4) = param_2;
    goto LAB_14003ca99;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  iVar3 = iVar1 + 1;
  if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(int *)(param_1 + 0x18) = iVar3;
  *(undefined1 *)((longlong)iVar1 + *(longlong *)(param_1 + 0x10)) = param_2;
LAB_14003ca99:
  FUN_14003ced0(param_1);
  return;
}



void FUN_14003cac0(longlong param_1,undefined8 param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  undefined1 local_58 [80];
  
  lVar4 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(lVar2 + 0x18);
    FUN_14003cda0(lVar2,iVar1 + 8);
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar2 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar4) = param_2;
    goto LAB_14003cb78;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  iVar3 = iVar1 + 8;
  if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(int *)(param_1 + 0x18) = iVar3;
  *(undefined8 *)((longlong)iVar1 + *(longlong *)(param_1 + 0x10)) = param_2;
LAB_14003cb78:
  FUN_14003ced0(param_1);
  return;
}



void FUN_14003cba0(longlong param_1,undefined8 param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  undefined1 local_68 [80];
  
  lVar4 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(lVar2 + 0x18);
    FUN_14003cda0(lVar2,iVar1 + 0x10);
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar2 + 0x10);
    }
    FUN_1400224d0(lVar4 + iVar1,param_2,0x10);
    goto LAB_14003cc6a;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_1400a2320(local_68,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_68,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  iVar3 = iVar1 + 0x10;
  if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(int *)(param_1 + 0x18) = iVar3;
  FUN_1400224d0((longlong)iVar1 + *(longlong *)(param_1 + 0x10),param_2,0x10);
LAB_14003cc6a:
  FUN_14003ced0(param_1);
  return;
}



void FUN_14003cc90(longlong *param_1,undefined8 param_2,int param_3)

{
  longlong lVar1;
  int iVar2;
  undefined1 local_58 [88];
  
  if (param_3 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_3 != 0) {
    if (*param_1 == 0) {
      FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    lVar1 = param_1[1];
    iVar2 = (int)lVar1 + param_3;
    if ((iVar2 < 0) || (*(int *)((longlong)param_1 + 0xc) < iVar2)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(int *)(param_1 + 1) = iVar2;
    FUN_1400224d0(*param_1 + (longlong)(int)lVar1,param_2,(longlong)param_3);
  }
  return;
}



int FUN_14003cd00(longlong param_1,int param_2)

{
  uint uVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  
  iVar4 = *(int *)(param_1 + 0x24);
  if (iVar4 == 0) {
    iVar2 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
    iVar4 = 0x400;
    if (iVar2 < 0x400) {
      iVar4 = iVar2;
    }
    iVar2 = 4;
    if (4 < iVar4) {
      iVar2 = iVar4;
    }
    iVar4 = iVar2 + param_2;
    if (iVar2 + param_2 < *(int *)(param_1 + 0x20)) {
      iVar4 = *(int *)(param_1 + 0x20);
    }
    return iVar4;
  }
  if (iVar4 != 1) {
    if (iVar4 != 2) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (param_2 < *(int *)(param_1 + 0x20)) {
      param_2 = *(int *)(param_1 + 0x20);
    }
    return param_2;
  }
  uVar1 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
  uVar3 = 0x10;
  if (0x10 < (int)uVar1) {
    uVar3 = uVar1;
  }
  if (uVar3 < 0x41) {
    uVar3 = 0x40;
  }
  iVar4 = uVar3 + param_2;
  if ((int)(uVar3 + param_2) < *(int *)(param_1 + 0x20)) {
    iVar4 = *(int *)(param_1 + 0x20);
  }
  return iVar4;
}



void FUN_14003cda0(longlong param_1,int param_2)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  undefined1 local_58 [80];
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar2 = FUN_14003cd00();
      plVar1 = *(longlong **)(param_1 + 8);
      lVar3 = (longlong)iVar2;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_1400a34c0(lVar3);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 8))(plVar1,lVar3);
        }
      }
      else {
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_1400a34f0(*(undefined8 *)(param_1 + 0x10),lVar3);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 0x10))(plVar1,*(undefined8 *)(param_1 + 0x10),lVar3);
        }
        if (lVar3 == 0) {
          FUN_1400a2320(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
        }
      }
      *(longlong *)(param_1 + 0x10) = lVar3;
      *(int *)(param_1 + 0x1c) = iVar2;
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_14003ce60(longlong param_1,undefined8 param_2,int param_3)

{
  int iVar1;
  longlong lVar2;
  
  if (param_3 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_3 != 0) {
    iVar1 = *(int *)(param_1 + 0x18);
    FUN_14003cda0(param_1,iVar1 + param_3);
    if (*(int *)(param_1 + 0x18) == 0) {
      lVar2 = 0;
    }
    else {
      lVar2 = *(longlong *)(param_1 + 0x10);
    }
    FUN_1400224d0(lVar2 + iVar1,param_2,(longlong)param_3);
  }
  return;
}



void FUN_14003ced0(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  undefined1 local_58 [80];
  
  if (*(char *)(param_1 + 0x20) != '\0') {
    lVar2 = *(longlong *)(param_1 + 8);
    if (lVar2 == 0) {
      if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
    }
    else if (*(longlong *)(param_1 + 0x10) == 0) {
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      iVar1 = *(int *)(lVar2 + 0x18);
      FUN_14003cda0(lVar2,iVar1 + 1);
      if (*(int *)(lVar2 + 0x18) == 0) {
        *(undefined1 *)(longlong)iVar1 = 0xfe;
        return;
      }
      ((undefined1 *)(longlong)iVar1)[*(longlong *)(lVar2 + 0x10)] = 0xfe;
      return;
    }
    if (*(longlong *)(param_1 + 0x10) == 0) {
      FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    iVar1 = *(int *)(param_1 + 0x18);
    iVar3 = iVar1 + 1;
    if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(int *)(param_1 + 0x18) = iVar3;
    *(undefined1 *)((longlong)iVar1 + *(longlong *)(param_1 + 0x10)) = 0xfe;
  }
  return;
}



void FUN_14003cfb0(longlong param_1,undefined8 param_2,int param_3)

{
  if (param_3 == 0) {
    return;
  }
  *(undefined4 *)(param_1 + 4) = 0;
  if (*(longlong *)(param_1 + 8) == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_14003ce60();
      FUN_14003ced0(param_1);
      return;
    }
                    // WARNING: Subroutine does not return
    FUN_14019a830();
  }
  FUN_14003cc90(param_1 + 0x10);
  FUN_14003ced0(param_1);
  return;
}



void FUN_14003d020(longlong param_1,undefined2 param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  undefined1 local_58 [80];
  
  lVar4 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(lVar2 + 0x18);
    FUN_14003cda0(lVar2,iVar1 + 2);
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar2 + 0x10);
    }
    *(undefined2 *)(iVar1 + lVar4) = param_2;
    goto LAB_14003d0db;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  iVar3 = iVar1 + 2;
  if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(int *)(param_1 + 0x18) = iVar3;
  *(undefined2 *)((longlong)iVar1 + *(longlong *)(param_1 + 0x10)) = param_2;
LAB_14003d0db:
  FUN_14003ced0(param_1);
  return;
}



void FUN_14003d100(longlong *param_1)

{
  if (*param_1 != 0) {
    if (*(int *)((longlong)param_1 + 0xc) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(param_1 + 1) = 0;
  }
  return;
}



void FUN_14003d130(longlong param_1)

{
  FUN_14019a730();
  if (*(longlong *)(param_1 + 8) != 0) {
    if (*(int *)(param_1 + 0x14) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(param_1 + 0x10) = 0;
  }
  return;
}



void FUN_14003d170(longlong param_1)

{
  FUN_14019a730(param_1 + 8);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    if (*(int *)(param_1 + 0x1c) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(param_1 + 0x18) = 0;
  }
  return;
}



undefined8 FUN_14003d1c0(void)

{
  return 12000;
}



undefined8 FUN_14003d1d0(void)

{
  return 0x2fe7;
}



undefined1
FUN_14003d1e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined2 *param_6,undefined8 param_7,undefined4 *param_8,
             undefined8 param_9,undefined8 param_10,undefined8 param_11)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee1);
  FUN_14007c6e0(local_30,*param_4);
  FUN_140186cf0(local_30,param_5);
  FUN_14003d020(local_30,*param_6);
  FUN_140186d90(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_140186cf0(local_30,param_9);
  FUN_140186cf0(local_30,param_10);
  FUN_140186cf0(local_30,param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))(param_1,local_res10,1,param_3,local_30,L"REQ_AUTH",0x2ee1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003d340(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined2 *param_7,undefined8 param_8,
             undefined4 *param_9,undefined8 param_10,undefined8 param_11,undefined8 param_12)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee1);
  FUN_14007c6e0(local_30,*param_5);
  FUN_140186cf0(local_30,param_6);
  FUN_14003d020(local_30,*param_7);
  FUN_140186d90(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_140186cf0(local_30,param_10);
  FUN_140186cf0(local_30,param_11);
  FUN_140186cf0(local_30,param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_AUTH",0x2ee1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003d4b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined4 *param_10,undefined8 param_11,undefined4 *param_12,
             undefined4 *param_13,undefined2 *param_14,undefined8 *param_15,undefined2 *param_16)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee2);
  FUN_14003d020(local_30,*param_4);
  FUN_14003d020(local_30,*param_5);
  FUN_140186cf0(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_140186d90(local_30,param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_140186d90(local_30,param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14003d020(local_30,*param_14);
  FUN_14003cac0(local_30,*param_15);
  FUN_14003d020(local_30,*param_16);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOGOUT",0x2ee2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003d640(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined8 param_10,undefined4 *param_11,undefined8 param_12,
             undefined4 *param_13,undefined4 *param_14,undefined2 *param_15,undefined8 *param_16,
             undefined2 *param_17)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee2);
  FUN_14003d020(local_30,*param_5);
  FUN_14003d020(local_30,*param_6);
  FUN_140186cf0(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_1401a2620(local_30,param_9);
  FUN_140186d90(local_30,param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_140186d90(local_30,param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14007c6e0(local_30,*param_14);
  FUN_14003d020(local_30,*param_15);
  FUN_14003cac0(local_30,*param_16);
  FUN_14003d020(local_30,*param_17);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOGOUT",0x2ee2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14003d7e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee3);
  FUN_1401a2620(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SAVE_FIRST_CHARACTER",0x2ee3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003d8c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee3);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_SAVE_FIRST_CHARACTER",0x2ee3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003d9a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined2 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee4);
  FUN_1401a2620(local_30,param_4);
  FUN_140186d90(local_30,param_5);
  FUN_140186d90(local_30,param_6);
  FUN_14003d020(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SAVE_IP",0x2ee4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003dab0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7,undefined2 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee4);
  FUN_1401a2620(local_30,param_5);
  FUN_140186d90(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  FUN_14003d020(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_SAVE_IP",0x2ee4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003dbd0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee5);
  FUN_14003d020(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_ALL_ITEM_DROPGROUP",0x2ee5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003dcb0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee5);
  FUN_14003d020(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_ALL_ITEM_DROPGROUP",0x2ee5)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003dd90(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee6);
  FUN_14003d020(local_30,*param_4);
  FUN_14003d020(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_ALL_GUILD",0x2ee6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003de80(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee6);
  FUN_14003d020(local_30,*param_5);
  FUN_14003d020(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_ALL_GUILD",0x2ee6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003df80(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined1 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee7);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,param_5[1]);
  FUN_1401a2620(local_30,param_5 + 2);
  FUN_14003c9e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_GUILD_MEMBER",0x2ee7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003e0b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined1 *param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee7);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,param_6[1]);
  FUN_1401a2620(local_30,param_6 + 2);
  FUN_14003c9e0(local_30,*param_7);
  FUN_1401a2620(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_GUILD_MEMBER",0x2ee7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003e1f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *param_7,undefined2 *param_8)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee8);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,param_5[1]);
  FUN_1401a2620(local_30,param_5 + 2);
  FUN_140186d90(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,param_7[1]);
  FUN_1401a2620(local_30,param_7 + 2);
  FUN_14003d020(local_30,*param_8);
  FUN_14003d020(local_30,param_8[1]);
  FUN_14003d020(local_30,param_8[2]);
  FUN_1401a2620(local_30,param_8 + 7);
  FUN_1401a2620(local_30,param_8 + 0xf);
  FUN_14007c8a0(local_30,*(undefined8 *)(param_8 + 3));
  FUN_140186dd0(local_30,param_8 + 0x17);
  FUN_140186dd0(local_30,param_8 + 0x27);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INSERT_GUILD_MEMBER",0x2ee8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003e390(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined4 *param_8,
             undefined2 *param_9)

{
  undefined1 uVar1;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x2ee8);
  FUN_14003d020(local_40,*param_5);
  FUN_14007c6e0(local_40,*param_6);
  FUN_14007c6e0(local_40,param_6[1]);
  FUN_1401a2620(local_40,param_6 + 2);
  FUN_140186d90(local_40,param_7);
  FUN_14007c6e0(local_40,*param_8);
  FUN_14007c6e0(local_40,param_8[1]);
  FUN_1401a2620(local_40,param_8 + 2);
  FUN_14003d020(local_40,*param_9);
  FUN_14003d020(local_40,param_9[1]);
  FUN_14003d020(local_40,param_9[2]);
  FUN_1401a2620(local_40,param_9 + 7);
  FUN_1401a2620(local_40,param_9 + 0xf);
  FUN_14007c8a0(local_40,*(undefined8 *)(param_9 + 3));
  FUN_140186dd0(local_40,param_9 + 0x17);
  FUN_140186dd0(local_40,param_9 + 0x27);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"REQ_INSERT_GUILD_MEMBER",0x2ee8);
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003e530(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined8 param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee9);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_140080030(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INSERT_ITEM",0x2ee9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003e670(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined8 param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ee9);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_140080030(local_30,param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_INSERT_ITEM",0x2ee9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003e7b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8,
             undefined8 param_9,undefined4 *param_10,undefined4 *param_11)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2eea);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_1401a2620(local_30,param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INSERT_SKILL",0x2eea);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003e910(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined4 *param_8,
             undefined4 *param_9,undefined8 param_10,undefined4 *param_11,undefined4 *param_12)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2eea);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_1401a2620(local_30,param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_14007c6e0(local_30,*param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_INSERT_SKILL",0x2eea);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003ea80(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2eeb);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_SKILL_LEVEL",0x2eeb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003eb90(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2eeb);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_SKILL_LEVEL",0x2eeb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003ecb0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2eec);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SAVE_SKILL_RESET",0x2eec);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003edb0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2eec);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_SAVE_SKILL_RESET",0x2eec);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003eec0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2eed);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MOVE_INVENTORY_TO_EQUIP",0x2eed);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003f010(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined4 *param_10,undefined4 *param_11)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2eed);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_1401a2620(local_30,param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_MOVE_INVENTORY_TO_EQUIP",0x2eed)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003f170(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2eee);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MOVE_CASH_TO_EQUIP",0x2eee);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003f2c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined4 *param_10,undefined4 *param_11)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2eee);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_1401a2620(local_30,param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_MOVE_CASH_TO_EQUIP",0x2eee);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003f420(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2eef);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MOVE_EQUIP_TO_INVENTORY",0x2eef);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003f570(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined4 *param_10,undefined4 *param_11)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2eef);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_1401a2620(local_30,param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_MOVE_EQUIP_TO_INVENTORY",0x2eef)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003f6d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef0);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MOVE_EQUIP_TO_CASH",0x2ef0);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003f820(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined4 *param_10,undefined4 *param_11)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef0);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_1401a2620(local_30,param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_MOVE_EQUIP_TO_CASH",0x2ef0);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003f980(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined4 *param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef1);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_ITEM_PAGE_SLOT_UPDATE",0x2ef1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003fac0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef1);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_ITEM_PAGE_SLOT_UPDATE",0x2ef1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003fc00(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef2);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140080030(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_ITEM_UPDATE",0x2ef2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003fd10(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef2);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140080030(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_ITEM_UPDATE",0x2ef2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003fe30(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef3);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_ITEM_OWNER_UPDATE",0x2ef3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14003ff40(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef3);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_ITEM_OWNER_UPDATE",0x2ef3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140040060(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined4 *param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef4);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_ITEM_PAGE_OWNER_UPDATE",0x2ef4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400401a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef4);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_ITEM_PAGE_OWNER_UPDATE",0x2ef4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400402e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef5);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_ITEM_DURABILITY_UPDATE",0x2ef5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400403e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef5);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_ITEM_DURABILITY_UPDATE",0x2ef5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400404f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef6);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_REMAINTIME_ITEM",0x2ef6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400405e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef6);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_REMAINTIME_ITEM",0x2ef6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400406d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef7);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_ITEM_BINDS",0x2ef7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400407e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef7);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_ITEM_BINDS",0x2ef7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140040900(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef8);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INSERT_QUEST",0x2ef8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140040a40(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef8);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_INSERT_QUEST",0x2ef8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140040b80(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined8 *param_13)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef9);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_14007c8a0(local_30,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_QUEST",0x2ef9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140040d10(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined4 *param_13,undefined8 *param_14)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2ef9);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14007c8a0(local_30,*param_14);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_QUEST",0x2ef9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140040eb0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2efa);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DELETE_QUEST",0x2efa);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140040fb0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2efa);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_DELETE_QUEST",0x2efa);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400410c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2efb);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_QUEST_SHOW",0x2efb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400411c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2efb);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_QUEST_SHOW",0x2efb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400412d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2efc);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHARACTER_READ_ALL_DATA",0x2efc);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400413e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2efc);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CHARACTER_READ_ALL_DATA",0x2efc)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140041500(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2efd);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_GIVE_UP",0x2efd);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140041600(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2efd);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_GIVE_UP",0x2efd
                    );
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140041710(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2efe);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_HEARTS",0x2efe);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140041810(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2efe);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_HEARTS",0x2efe)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140041920(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined1 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2eff);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14003c9e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_FATIGUE",0x2eff);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140041a30(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7,undefined1 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2eff);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14003c9e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_FATIGUE",0x2eff
                    );
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140041b50(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined8 *param_7,undefined4 *param_8,
             undefined4 *param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f00);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14003cac0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_LEVEL_AND_SP",
                     0x2f00);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140041c90(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7,undefined8 *param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f00);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14003cac0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_LEVEL_AND_SP",
                     0x2f00);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140041de0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f01);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14003cac0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_EXP",0x2f01);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140041ee0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f01);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003cac0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_EXP",0x2f01);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140041ff0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f02);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_SP",0x2f02);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140042100(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f02);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_SP",0x2f02);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140042220(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f03);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_JOB",0x2f03);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140042320(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f03);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_JOB",0x2f03);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140042430(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f04);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SAVE_MONEY",0x2f04);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140042530(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f04);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_SAVE_MONEY",0x2f04);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140042640(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f05);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_FIRST_LOGIN",
                     0x2f05);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140042750(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f05);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_FIRST_LOGIN",
                     0x2f05);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140042870(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6,longlong *param_7)

{
  undefined1 uVar1;
  longlong lVar2;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f06);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,param_7[1] - *param_7 >> 4);
  lVar2 = *param_7;
  if (lVar2 != param_7[1]) {
    do {
      FUN_1401a2620(local_30,lVar2);
      lVar2 = lVar2 + 0x10;
    } while (lVar2 != param_7[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SAVE_ITEM_INVEN",0x2f06);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400429c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7,longlong *param_8)

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x2f06);
  FUN_14003d020(local_40,*param_5);
  FUN_1401a2620(local_40,param_6);
  FUN_14007c6e0(local_40,*param_7);
  FUN_14007c6e0(local_40,param_8[1] - *param_8 >> 4);
  lVar2 = *param_8;
  if (lVar2 != param_8[1]) {
    do {
      FUN_1401a2620(local_40,lVar2);
      lVar2 = lVar2 + 0x10;
    } while (lVar2 != param_8[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"REQ_SAVE_ITEM_INVEN",0x2f06);
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140042b10(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,longlong *param_6,longlong *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  longlong lVar3;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f07);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_14007c6e0(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_14007c6e0(local_30,param_7[1] - *param_7 >> 4);
  lVar3 = *param_7;
  if (lVar3 != param_7[1]) {
    do {
      FUN_1401a2620(local_30,lVar3);
      lVar3 = lVar3 + 0x10;
    } while (lVar3 != param_7[1]);
  }
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SAVE_ITEM_QUICKSLOT",0x2f07);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140042c90(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,longlong *param_7,longlong *param_8,
             undefined4 *param_9)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  longlong lVar3;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x2f07);
  FUN_14003d020(local_40,*param_5);
  FUN_1401a2620(local_40,param_6);
  FUN_14007c6e0(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_14007c6e0(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  FUN_14007c6e0(local_40,param_8[1] - *param_8 >> 4);
  lVar3 = *param_8;
  if (lVar3 != param_8[1]) {
    do {
      FUN_1401a2620(local_40,lVar3);
      lVar3 = lVar3 + 0x10;
    } while (lVar3 != param_8[1]);
  }
  FUN_14007c6e0(local_40,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"REQ_SAVE_ITEM_QUICKSLOT",0x2f07);
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140042e20(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,longlong *param_6)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f08);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_14007c6e0(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SAVE_ITEM_BOOTH",0x2f08);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140042f50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,longlong *param_7)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x2f08);
  FUN_14003d020(local_40,*param_5);
  FUN_1401a2620(local_40,param_6);
  FUN_14007c6e0(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_14007c6e0(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"REQ_SAVE_ITEM_BOOTH",0x2f08);
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140043090(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f09);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SAVE_ITEM_STORAGE",0x2f09);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140043190(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f09);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_SAVE_ITEM_STORAGE",0x2f09);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400432a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f0a);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_STORAGE_USEABLE_COUNT",
                     0x2f0a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400433a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f0a);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_STORAGE_USEABLE_COUNT",
                     0x2f0a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400434b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined2 *param_8,
             undefined2 *param_9,undefined8 param_10,undefined4 *param_11,undefined8 param_12)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f0b);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  FUN_14003d020(local_30,*param_8);
  FUN_14003d020(local_30,*param_9);
  FUN_1401a2620(local_30,param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_140186cf0(local_30,param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHARACTER_CREATE",0x2f0b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140043630(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined2 *param_9,undefined2 *param_10,undefined8 param_11,undefined4 *param_12,
             undefined8 param_13)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f0b);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  FUN_14003d020(local_30,*param_9);
  FUN_14003d020(local_30,*param_10);
  FUN_1401a2620(local_30,param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_140186cf0(local_30,param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CHARACTER_CREATE",0x2f0b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400437b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f0c);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHARACTER_DELETE",0x2f0c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400438c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f0c);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CHARACTER_DELETE",0x2f0c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400439e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined2 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f0d);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003d020(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHARACTER_LIST",0x2f0d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140043af0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined2 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f0d);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14003d020(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CHARACTER_LIST",0x2f0d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140043c10(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined2 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f0e);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003d020(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHARACTER_GET",0x2f0e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140043d20(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined2 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f0e);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14003d020(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CHARACTER_GET",0x2f0e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140043e40(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined2 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f0f);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_140186d90(local_30,param_6);
  FUN_14003d020(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHARACTER_GET_BY_NAME",0x2f0f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140043f50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined2 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f0f);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_140186d90(local_30,param_7);
  FUN_14003d020(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CHARACTER_GET_BY_NAME",0x2f0f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140044070(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined2 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f10);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_140186d90(local_30,param_6);
  FUN_14003d020(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHARACTER_GET_SIMPLE",0x2f10);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140044180(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined2 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f10);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_140186d90(local_30,param_7);
  FUN_14003d020(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CHARACTER_GET_SIMPLE",0x2f10);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400442a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined8 param_10,undefined4 *param_11,undefined4 *param_12,
             undefined4 *param_13,undefined4 *param_14,longlong *param_15)

{
  undefined1 uVar1;
  longlong lVar2;
  undefined4 local_res10 [2];
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  local_res10[0] = param_2;
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x2f11);
  FUN_14003d020(local_40,*param_4);
  FUN_14007c6e0(local_40,*param_5);
  FUN_1401a2620(local_40,param_6);
  FUN_1401a2620(local_40,param_7);
  FUN_140186d90(local_40,param_8);
  FUN_140186d90(local_40,param_9);
  FUN_140186d90(local_40,param_10);
  FUN_14007c6e0(local_40,*param_11);
  FUN_14007c6e0(local_40,*param_12);
  FUN_14007c6e0(local_40,*param_13);
  FUN_14007c6e0(local_40,*param_14);
  FUN_14007c6e0(local_40,(param_15[1] - *param_15) / 0x12);
  lVar2 = *param_15;
  if (lVar2 != param_15[1]) {
    do {
      FUN_1401a2620(local_40,lVar2);
      FUN_14003d020(local_40,*(undefined2 *)(lVar2 + 0x10));
      lVar2 = lVar2 + 0x12;
    } while (lVar2 != param_15[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"REQ_MAIL_SEND",0x2f11);
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140044470(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined8 param_10,undefined8 param_11,undefined4 *param_12,
             undefined4 *param_13,undefined4 *param_14,undefined4 *param_15,longlong *param_16)

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x2f11);
  FUN_14003d020(local_40,*param_5);
  FUN_14007c6e0(local_40,*param_6);
  FUN_1401a2620(local_40,param_7);
  FUN_1401a2620(local_40,param_8);
  FUN_140186d90(local_40,param_9);
  FUN_140186d90(local_40,param_10);
  FUN_140186d90(local_40,param_11);
  FUN_14007c6e0(local_40,*param_12);
  FUN_14007c6e0(local_40,*param_13);
  FUN_14007c6e0(local_40,*param_14);
  FUN_14007c6e0(local_40,*param_15);
  FUN_14007c6e0(local_40,(param_16[1] - *param_16) / 0x12);
  lVar2 = *param_16;
  if (lVar2 != param_16[1]) {
    do {
      FUN_1401a2620(local_40,lVar2);
      FUN_14003d020(local_40,*(undefined2 *)(lVar2 + 0x10));
      lVar2 = lVar2 + 0x12;
    } while (lVar2 != param_16[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"REQ_MAIL_SEND",0x2f11);
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140044650(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f12);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_DEL",0x2f12);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140044750(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f12);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_MAIL_DEL",0x2f12);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140044860(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f13);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_UPDATE",0x2f13);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140044950(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f13);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_MAIL_UPDATE",0x2f13);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140044a50(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f14);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_LIST",0x2f14);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140044b50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f14);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_MAIL_LIST",0x2f14);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140044c60(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f15);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_OPEN",0x2f15);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140044d70(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f15);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_MAIL_OPEN",0x2f15);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140044e90(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f16);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_NEW_LIST",0x2f16);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140044f90(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f16);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_MAIL_NEW_LIST",0x2f16);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400450a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,longlong *param_7,longlong *param_8,
             longlong *param_9,longlong *param_10)

{
  undefined1 uVar1;
  longlong lVar2;
  undefined4 *puVar3;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f17);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,param_7[1] - *param_7 >> 4);
  lVar2 = *param_7;
  if (lVar2 != param_7[1]) {
    do {
      FUN_1401a2620(local_30,lVar2);
      lVar2 = lVar2 + 0x10;
    } while (lVar2 != param_7[1]);
  }
  FUN_14007c6e0(local_30,param_8[1] - *param_8 >> 2);
  puVar3 = (undefined4 *)*param_8;
  if (puVar3 != (undefined4 *)param_8[1]) {
    do {
      FUN_14007c6e0(local_30,*puVar3);
      puVar3 = puVar3 + 1;
    } while (puVar3 != (undefined4 *)param_8[1]);
  }
  FUN_14007c6e0(local_30,param_9[1] - *param_9 >> 2);
  puVar3 = (undefined4 *)*param_9;
  if (puVar3 != (undefined4 *)param_9[1]) {
    do {
      FUN_14007c6e0(local_30,*puVar3);
      puVar3 = puVar3 + 1;
    } while (puVar3 != (undefined4 *)param_9[1]);
  }
  FUN_14007c6e0(local_30,param_10[1] - *param_10 >> 4);
  lVar2 = *param_10;
  if (lVar2 != param_10[1]) {
    do {
      FUN_1401a2620(local_30,lVar2);
      lVar2 = lVar2 + 0x10;
    } while (lVar2 != param_10[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_ITEM_MOVE",0x2f17);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400452b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,longlong *param_8,
             longlong *param_9,longlong *param_10,longlong *param_11)

{
  undefined1 uVar1;
  longlong lVar2;
  undefined4 *puVar3;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x2f17);
  FUN_14003d020(local_40,*param_5);
  FUN_14007c6e0(local_40,*param_6);
  FUN_1401a2620(local_40,param_7);
  FUN_14007c6e0(local_40,param_8[1] - *param_8 >> 4);
  lVar2 = *param_8;
  if (lVar2 != param_8[1]) {
    do {
      FUN_1401a2620(local_40,lVar2);
      lVar2 = lVar2 + 0x10;
    } while (lVar2 != param_8[1]);
  }
  FUN_14007c6e0(local_40,param_9[1] - *param_9 >> 2);
  puVar3 = (undefined4 *)*param_9;
  if (puVar3 != (undefined4 *)param_9[1]) {
    do {
      FUN_14007c6e0(local_40,*puVar3);
      puVar3 = puVar3 + 1;
    } while (puVar3 != (undefined4 *)param_9[1]);
  }
  FUN_14007c6e0(local_40,param_10[1] - *param_10 >> 2);
  puVar3 = (undefined4 *)*param_10;
  if (puVar3 != (undefined4 *)param_10[1]) {
    do {
      FUN_14007c6e0(local_40,*puVar3);
      puVar3 = puVar3 + 1;
    } while (puVar3 != (undefined4 *)param_10[1]);
  }
  FUN_14007c6e0(local_40,param_11[1] - *param_11 >> 4);
  lVar2 = *param_11;
  if (lVar2 != param_11[1]) {
    do {
      FUN_1401a2620(local_40,lVar2);
      lVar2 = lVar2 + 0x10;
    } while (lVar2 != param_11[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"REQ_MAIL_ITEM_MOVE",0x2f17);
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400454c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f18);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_GOLD_PAYMAENT",0x2f18);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400455c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f18);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_MAIL_GOLD_PAYMAENT",0x2f18);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400456d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f19);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_RETURN",0x2f19);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400457d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f19);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_MAIL_RETURN",0x2f19);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400458e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *param_7,undefined8 *param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11,undefined1 *param_12)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f1a);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14003cac0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_14003c9e0(local_30,*param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_DUEL_INFO",0x2f1a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140045a60(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined4 *param_8,
             undefined8 *param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined1 *param_13)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f1a);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14003cac0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_14003c9e0(local_30,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_DUEL_INFO",0x2f1a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140045bf0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f1b);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SELECT_BATTLE_RANK_LIST",0x2f1b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140045cf0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f1b);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_SELECT_BATTLE_RANK_LIST",0x2f1b)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140045e00(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f1c);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_FRIEND_LIST",0x2f1c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140045f00(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f1c);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_FRIEND_LIST",0x2f1c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140046010(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f1d);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_ADD_FRIEND",0x2f1d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140046120(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f1d);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_ADD_FRIEND",0x2f1d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140046240(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f1e);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DEL_FRIEND",0x2f1e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140046350(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f1e);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_DEL_FRIEND",0x2f1e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140046470(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f1f);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_ADD_BAN",0x2f1f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140046590(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f1f);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  FUN_140186d90(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_ADD_BAN",0x2f1f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400466c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f20);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DEL_BAN",0x2f20);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400467d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f20);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_DEL_BAN",0x2f20);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400468f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f21);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_MEMO_BAN",0x2f21);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140046a10(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f21);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_140186d90(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_MEMO_BAN",0x2f21);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140046b40(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *param_7,undefined2 *param_8,
             undefined2 *param_9,undefined2 *param_10,undefined2 *param_11)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f22);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14003d020(local_30,*param_8);
  FUN_14003d020(local_30,*param_9);
  FUN_14003d020(local_30,*param_10);
  FUN_14003d020(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_DUNGEON_RANK",0x2f22);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140046cb0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined4 *param_8,
             undefined2 *param_9,undefined2 *param_10,undefined2 *param_11,undefined2 *param_12)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f22);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14003d020(local_30,*param_9);
  FUN_14003d020(local_30,*param_10);
  FUN_14003d020(local_30,*param_11);
  FUN_14003d020(local_30,*param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_DUNGEON_RANK",0x2f22);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140046e30(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f23);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_ADD_CHARACTER_TITLE",0x2f23);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140046f80(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f23);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_ADD_CHARACTER_TITLE",0x2f23);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400470e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f24);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_EQUIP_CHARACTER_TITLE",0x2f24);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400471f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f24);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_EQUIP_CHARACTER_TITLE",0x2f24);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140047310(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f25);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UNEQUIP_CHARACTER_TITLE",0x2f25);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140047410(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f25);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UNEQUIP_CHARACTER_TITLE",0x2f25)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140047520(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f26);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_IS_PUSH_QUEUE",0x2f26);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140047620(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f26);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_IS_PUSH_QUEUE",0x2f26);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140047730(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f27);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHARACTER_EQUIP_ITEM",0x2f27);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140047830(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f27);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CHARACTER_EQUIP_ITEM",0x2f27);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140047940(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f28);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SAVE_INVENTORY_STORAGE_MONEY",
                     0x2f28);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140047a50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f28);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_SAVE_INVENTORY_STORAGE_MONEY",
                     0x2f28);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140047b70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *param_5,undefined4 *param_6,undefined4 *param_7,undefined2 *param_8,
             undefined2 *param_9,undefined8 param_10,undefined8 param_11,undefined8 param_12,
             undefined4 *param_13,undefined4 *param_14)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f29);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14003d020(local_30,*param_8);
  FUN_14003d020(local_30,*param_9);
  FUN_140186d90(local_30,param_10);
  FUN_1401a2620(local_30,param_11);
  FUN_140186d90(local_30,param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14007c6e0(local_30,*param_14);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CREATE_GUILD",0x2f29);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140047d10(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined2 *param_9,undefined2 *param_10,undefined8 param_11,undefined8 param_12,
             undefined8 param_13,undefined4 *param_14,undefined4 *param_15)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f29);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14003d020(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14003d020(local_30,*param_9);
  FUN_14003d020(local_30,*param_10);
  FUN_140186d90(local_30,param_11);
  FUN_1401a2620(local_30,param_12);
  FUN_140186d90(local_30,param_13);
  FUN_14007c6e0(local_30,*param_14);
  FUN_14007c6e0(local_30,*param_15);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CREATE_GUILD",0x2f29);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140047ec0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f2a);
  FUN_1401a2620(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_GUILD",0x2f2a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140047fa0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f2a);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_GUILD",0x2f2a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140048080(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f2b);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_GUILD_SERVER",0x2f2b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140048180(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f2b);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_GUILD_SERVER",0x2f2b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140048290(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,longlong *param_7)

{
  undefined1 uVar1;
  undefined2 *puVar2;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f2c);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,param_7[1] - *param_7 >> 1);
  puVar2 = (undefined2 *)*param_7;
  if (puVar2 != (undefined2 *)param_7[1]) {
    do {
      FUN_14003d020(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_7[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_GUILD_PERMISSION",0x2f2c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400483e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,longlong *param_8)

{
  undefined1 uVar1;
  undefined2 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x2f2c);
  FUN_14003d020(local_40,*param_5);
  FUN_14007c6e0(local_40,*param_6);
  FUN_1401a2620(local_40,param_7);
  FUN_14007c6e0(local_40,param_8[1] - *param_8 >> 1);
  puVar2 = (undefined2 *)*param_8;
  if (puVar2 != (undefined2 *)param_8[1]) {
    do {
      FUN_14003d020(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_8[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"REQ_UPDATE_GUILD_PERMISSION",0x2f2c)
  ;
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140048530(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f2d);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_GUILD_LEADER",0x2f2d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140048640(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f2d);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_GUILD_LEADER",0x2f2d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140048760(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f2e);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_GUILD_NOTICE",0x2f2e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140048870(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f2e);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_GUILD_NOTICE",0x2f2e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140048990(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f2f);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_GUILD_ICON",0x2f2f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140048aa0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f2f);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_GUILD_ICON",0x2f2f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140048bc0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f30);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,param_5[1]);
  FUN_1401a2620(local_30,param_5 + 2);
  FUN_14003c9e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_6 + 1));
  FUN_1401a2620(local_30,param_6 + 5);
  FUN_1401a2620(local_30,param_6 + 0x15);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_MEMBER_REMOVE",0x2f30);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140048d00(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined1 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f30);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,param_6[1]);
  FUN_1401a2620(local_30,param_6 + 2);
  FUN_14003c9e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_7 + 1));
  FUN_1401a2620(local_30,param_7 + 5);
  FUN_1401a2620(local_30,param_7 + 0x15);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_MEMBER_REMOVE",0x2f30);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140048e60(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f31);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_GUILD_MEMBER_ALIASE",0x2f31
                    );
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140048f80(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f31);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_140186d90(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_GUILD_MEMBER_ALIASE",
                     0x2f31);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400490b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f32);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_GUILD_MEMBER_GRADE",0x2f32)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400491e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f32);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_GUILD_MEMBER_GRADE",
                     0x2f32);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140049310(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f33);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_LOBBY",0x2f33);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140049410(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f33);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_LOBBY",0x2f33);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140049520(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f34);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,param_5[1]);
  FUN_1401a2620(local_30,param_5 + 2);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DISBAND_GUILD",0x2f34);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140049640(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f34);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,param_6[1]);
  FUN_1401a2620(local_30,param_6 + 2);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_DISBAND_GUILD",0x2f34);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140049770(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f35);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_MEMBER_LOGOUT_TIME",0x2f35);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140049880(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f35);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_MEMBER_LOGOUT_TIME",0x2f35
                    );
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400499a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined2 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f36);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003d020(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_OTHER_CHARACTER_INFO",0x2f36);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140049ab0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined2 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f36);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14003d020(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_OTHER_CHARACTER_INFO",0x2f36);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140049bd0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined2 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f37);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003d020(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHARACTER_CREATE_STEP01",0x2f37);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140049ce0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined2 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f37);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14003d020(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CHARACTER_CREATE_STEP01",0x2f37)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140049e00(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f38);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_TUTORIAL",0x2f38)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140049ef0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f38);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_TUTORIAL",
                     0x2f38);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140049fe0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f39);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_ALL_DELETE_QUEST",0x2f39);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004a0d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f39);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_ALL_DELETE_QUEST",0x2f39);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004a1c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f3a);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MOVE_CASH_TO_EQUIP_COSTUMEPACK",
                     0x2f3a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004a320(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f3a);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_1401a2620(local_30,param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_14007c6e0(local_30,*param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_MOVE_CASH_TO_EQUIP_COSTUMEPACK",
                     0x2f3a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004a490(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f3b);
  FUN_14003d020(local_30,*param_4);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  FUN_140186cf0(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SAVE_SERVER_INFO",0x2f3b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004a5d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined8 param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f3b);
  FUN_14003d020(local_30,*param_5);
  FUN_14003d020(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  FUN_140186d90(local_30,param_9);
  FUN_140186cf0(local_30,param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_SAVE_SERVER_INFO",0x2f3b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004a710(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f3c);
  FUN_14003d020(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SERVER_GROUP_ID",0x2f3c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004a7f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f3c);
  FUN_14003d020(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_SERVER_GROUP_ID",0x2f3c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004a8d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f3d);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,param_5[1]);
  FUN_14007c6e0(local_30,param_5[2]);
  FUN_1401a2620(local_30,param_5 + 3);
  FUN_1401a2620(local_30,param_5 + 7);
  FUN_14007c6e0(local_30,param_5[0xb]);
  FUN_14007c6e0(local_30,param_5[0xc]);
  FUN_14007c8a0(local_30,*(undefined8 *)(param_5 + 0xd));
  FUN_14007c8a0(local_30,*(undefined8 *)(param_5 + 0xf));
  FUN_140186dd0(local_30,param_5 + 0x19);
  FUN_140186dd0(local_30,param_5 + 0x11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_PLAY_TIME",0x2f3d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004aa50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f3d);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,param_6[1]);
  FUN_14007c6e0(local_30,param_6[2]);
  FUN_1401a2620(local_30,param_6 + 3);
  FUN_1401a2620(local_30,param_6 + 7);
  FUN_14007c6e0(local_30,param_6[0xb]);
  FUN_14007c6e0(local_30,param_6[0xc]);
  FUN_14007c8a0(local_30,*(undefined8 *)(param_6 + 0xd));
  FUN_14007c8a0(local_30,*(undefined8 *)(param_6 + 0xf));
  FUN_140186dd0(local_30,param_6 + 0x19);
  FUN_140186dd0(local_30,param_6 + 0x11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_PLAY_TIME",0x2f3d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004abe0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f3e);
  FUN_14003d020(local_30,*param_4);
  FUN_140081fa0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_DUNGEON_CLEAR",0x2f3e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004acd0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f3e);
  FUN_14003d020(local_30,*param_5);
  FUN_140081fa0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_DUNGEON_CLEAR",0x2f3e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004adc0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f3f);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_5 + 1);
  FUN_1401a2620(local_30,param_5 + 5);
  FUN_14007c8a0(local_30,*(undefined8 *)(param_5 + 9));
  FUN_14007c6e0(local_30,param_5[0xb]);
  FUN_14007c6e0(local_30,param_5[0xc]);
  FUN_140186dd0(local_30,param_5 + 0x15);
  FUN_140186dd0(local_30,param_5 + 0xd);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_LEVEL_UP",0x2f3f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004af10(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f3f);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_6 + 1);
  FUN_1401a2620(local_30,param_6 + 5);
  FUN_14007c8a0(local_30,*(undefined8 *)(param_6 + 9));
  FUN_14007c6e0(local_30,param_6[0xb]);
  FUN_14007c6e0(local_30,param_6[0xc]);
  FUN_140186dd0(local_30,param_6 + 0x15);
  FUN_140186dd0(local_30,param_6 + 0xd);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_LEVEL_UP",0x2f3f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004b070(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined1 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f40);
  FUN_14003d020(local_30,*param_4);
  FUN_14003d020(local_30,*(undefined2 *)(param_5 + 1));
  FUN_1401a2620(local_30,param_5 + 0x13);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_5 + 0xb));
  FUN_14007c6e0(local_30,*(undefined4 *)(param_5 + 0xf));
  FUN_14003d020(local_30,*(undefined2 *)(param_5 + 3));
  FUN_14003c9e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_5 + 7));
  FUN_14003d020(local_30,*(undefined2 *)(param_5 + 5));
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_DUNGEON",0x2f40);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004b1c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f40);
  FUN_14003d020(local_30,*param_5);
  FUN_14003d020(local_30,*(undefined2 *)(param_6 + 1));
  FUN_1401a2620(local_30,param_6 + 0x13);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_6 + 0xb));
  FUN_14007c6e0(local_30,*(undefined4 *)(param_6 + 0xf));
  FUN_14003d020(local_30,*(undefined2 *)(param_6 + 3));
  FUN_14003c9e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_6 + 7));
  FUN_14003d020(local_30,*(undefined2 *)(param_6 + 5));
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_DUNGEON",0x2f40);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004b320(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f41);
  FUN_14003d020(local_30,*param_4);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_14007c6e0(local_30,*param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_SKILL_LEARN",0x2f41);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004b4a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined4 *param_13)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f41);
  FUN_14003d020(local_30,*param_5);
  FUN_14003d020(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_140186d90(local_30,param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_14007c6e0(local_30,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_SKILL_LEARN",0x2f41);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004b620(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f42);
  FUN_14003d020(local_30,*param_4);
  FUN_14003d020(local_30,*param_5);
  FUN_140081ed0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_GOLD",0x2f42);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004b720(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f42);
  FUN_14003d020(local_30,*param_5);
  FUN_14003d020(local_30,*param_6);
  FUN_140081ed0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_GOLD",0x2f42);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004b830(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f43);
  FUN_14003d020(local_30,*param_4);
  FUN_14003d020(local_30,*param_5);
  FUN_140081d60(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_ITEM",0x2f43);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004b930(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f43);
  FUN_14003d020(local_30,*param_5);
  FUN_14003d020(local_30,*param_6);
  FUN_140081d60(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_ITEM",0x2f43);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14004ba40(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f44);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_ALL_AUCTIONLIST",0x2f44);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14004bb00(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f44);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_ALL_AUCTIONLIST",0x2f44);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14004bbd0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f45);
  FUN_1400819f0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_REGISTER_AUCTIONITEM",0x2f45);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004bcb0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f45);
  FUN_1400819f0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_REGISTER_AUCTIONITEM",0x2f45);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14004bd90(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f46);
  FUN_1401a2620(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DELETE_AUCTIONITEM",0x2f46);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004be70(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f46);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_DELETE_AUCTIONITEM",0x2f46);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004bf50(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f47);
  FUN_1401a2620(local_30,param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_AUCTIONITEM",0x2f47);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004c070(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f47);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  FUN_1401a2620(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_AUCTIONITEM",0x2f47);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004c1a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f48);
  FUN_140080030(local_30,param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SENDMAIL_AUCTIONMNG",0x2f48);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004c2e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f48);
  FUN_140080030(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  FUN_140186d90(local_30,param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_SENDMAIL_AUCTIONMNG",0x2f48);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004c420(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,longlong *param_6)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f49);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_14007c6e0(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SAVE_KEY_MAP",0x2f49);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004c550(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,longlong *param_7)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x2f49);
  FUN_14003d020(local_40,*param_5);
  FUN_1401a2620(local_40,param_6);
  FUN_14007c6e0(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_14007c6e0(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"REQ_SAVE_KEY_MAP",0x2f49);
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004c690(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f4a);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14003c9e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_EVENT_FATIGUE",0x2f4a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004c790(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined1 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f4a);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003c9e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_EVENT_FATIGUE",0x2f4a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004c8a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f4b);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14003c9e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_EVENT_HEARTS",0x2f4b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004c9a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined1 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f4b);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003c9e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_EVENT_HEARTS",0x2f4b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004cab0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f4c);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14003c9e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_EVENT_FORTUNE",0x2f4c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004cbb0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined1 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f4c);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003c9e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_EVENT_FORTUNE",0x2f4c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004ccc0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f4d);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14003c9e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_EVENT_DAY_PARTY_MISSION",
                     0x2f4d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004cdc0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined1 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f4d);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003c9e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_EVENT_DAY_PARTY_MISSION",
                     0x2f4d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004ced0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f4e);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PET_DELETE",0x2f4e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004cfc0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f4e);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_PET_DELETE",0x2f4e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004d0b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7,undefined2 *param_8,
             undefined8 param_9,undefined2 *param_10,undefined2 *param_11,undefined4 *param_12,
             undefined4 *param_13,undefined4 *param_14,undefined4 *param_15,undefined4 *param_16,
             undefined4 *param_17,undefined4 *param_18,undefined4 *param_19,undefined4 *param_20,
             undefined4 *param_21,undefined4 *param_22,undefined4 *param_23,undefined4 *param_24,
             undefined4 *param_25,undefined4 *param_26,undefined4 *param_27,undefined4 *param_28,
             undefined4 *param_29,undefined8 *param_30)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f4f);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14003d020(local_30,*param_8);
  FUN_140186d90(local_30,param_9);
  FUN_14003d020(local_30,*param_10);
  FUN_14003d020(local_30,*param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14007c6e0(local_30,*param_14);
  FUN_14007c6e0(local_30,*param_15);
  FUN_14007c6e0(local_30,*param_16);
  FUN_14007c6e0(local_30,*param_17);
  FUN_14007c6e0(local_30,*param_18);
  FUN_14007c6e0(local_30,*param_19);
  FUN_14007c7c0(local_30,*param_20);
  FUN_14007c7c0(local_30,*param_21);
  FUN_14007c6e0(local_30,*param_22);
  FUN_14007c6e0(local_30,*param_23);
  FUN_14007c7c0(local_30,*param_24);
  FUN_14007c7c0(local_30,*param_25);
  FUN_14007c7c0(local_30,*param_26);
  FUN_14007c7c0(local_30,*param_27);
  FUN_14007c7c0(local_30,*param_28);
  FUN_14007c6e0(local_30,*param_29);
  FUN_14003cac0(local_30,*param_30);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PET_CREATE",0x2f4f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004d360(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined2 *param_9,undefined8 param_10,undefined2 *param_11,undefined2 *param_12,
             undefined4 *param_13,undefined4 *param_14,undefined4 *param_15,undefined4 *param_16,
             undefined4 *param_17,undefined4 *param_18,undefined4 *param_19,undefined4 *param_20,
             undefined4 *param_21,undefined4 *param_22,undefined4 *param_23,undefined4 *param_24,
             undefined4 *param_25,undefined4 *param_26,undefined4 *param_27,undefined4 *param_28,
             undefined4 *param_29,undefined4 *param_30,undefined8 *param_31)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f4f);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14003d020(local_30,*param_9);
  FUN_140186d90(local_30,param_10);
  FUN_14003d020(local_30,*param_11);
  FUN_14003d020(local_30,*param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14007c6e0(local_30,*param_14);
  FUN_14007c6e0(local_30,*param_15);
  FUN_14007c6e0(local_30,*param_16);
  FUN_14007c6e0(local_30,*param_17);
  FUN_14007c6e0(local_30,*param_18);
  FUN_14007c6e0(local_30,*param_19);
  FUN_14007c6e0(local_30,*param_20);
  FUN_14007c7c0(local_30,*param_21);
  FUN_14007c7c0(local_30,*param_22);
  FUN_14007c6e0(local_30,*param_23);
  FUN_14007c6e0(local_30,*param_24);
  FUN_14007c7c0(local_30,*param_25);
  FUN_14007c7c0(local_30,*param_26);
  FUN_14007c7c0(local_30,*param_27);
  FUN_14007c7c0(local_30,*param_28);
  FUN_14007c7c0(local_30,*param_29);
  FUN_14007c6e0(local_30,*param_30);
  FUN_14003cac0(local_30,*param_31);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_PET_CREATE",0x2f4f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004d610(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7,undefined8 *param_8,
             undefined2 *param_9,undefined8 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined4 *param_13,undefined4 *param_14,undefined4 *param_15,undefined4 *param_16,
             undefined4 *param_17,undefined4 *param_18,undefined4 *param_19,undefined4 *param_20,
             undefined4 *param_21,undefined4 *param_22,undefined4 *param_23,undefined4 *param_24,
             undefined4 *param_25,undefined4 *param_26,undefined4 *param_27,undefined4 *param_28)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f50);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14003cac0(local_30,*param_8);
  FUN_14003d020(local_30,*param_9);
  FUN_14007c8a0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14007c6e0(local_30,*param_14);
  FUN_14007c6e0(local_30,*param_15);
  FUN_14007c6e0(local_30,*param_16);
  FUN_14007c6e0(local_30,*param_17);
  FUN_14007c6e0(local_30,*param_18);
  FUN_14007c6e0(local_30,*param_19);
  FUN_14007c7c0(local_30,*param_20);
  FUN_14007c7c0(local_30,*param_21);
  FUN_14007c6e0(local_30,*param_22);
  FUN_14007c6e0(local_30,*param_23);
  FUN_14007c7c0(local_30,*param_24);
  FUN_14007c7c0(local_30,*param_25);
  FUN_14007c7c0(local_30,*param_26);
  FUN_14007c7c0(local_30,*param_27);
  FUN_14007c7c0(local_30,*param_28);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PET_UPDATE",0x2f50);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004d8a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined8 *param_9,undefined2 *param_10,undefined8 *param_11,undefined4 *param_12,
             undefined4 *param_13,undefined4 *param_14,undefined4 *param_15,undefined4 *param_16,
             undefined4 *param_17,undefined4 *param_18,undefined4 *param_19,undefined4 *param_20,
             undefined4 *param_21,undefined4 *param_22,undefined4 *param_23,undefined4 *param_24,
             undefined4 *param_25,undefined4 *param_26,undefined4 *param_27,undefined4 *param_28,
             undefined4 *param_29)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f50);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14003cac0(local_30,*param_9);
  FUN_14003d020(local_30,*param_10);
  FUN_14007c8a0(local_30,*param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14007c6e0(local_30,*param_14);
  FUN_14007c6e0(local_30,*param_15);
  FUN_14007c6e0(local_30,*param_16);
  FUN_14007c6e0(local_30,*param_17);
  FUN_14007c6e0(local_30,*param_18);
  FUN_14007c6e0(local_30,*param_19);
  FUN_14007c6e0(local_30,*param_20);
  FUN_14007c7c0(local_30,*param_21);
  FUN_14007c7c0(local_30,*param_22);
  FUN_14007c6e0(local_30,*param_23);
  FUN_14007c6e0(local_30,*param_24);
  FUN_14007c7c0(local_30,*param_25);
  FUN_14007c7c0(local_30,*param_26);
  FUN_14007c7c0(local_30,*param_27);
  FUN_14007c7c0(local_30,*param_28);
  FUN_14007c7c0(local_30,*param_29);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_PET_UPDATE",0x2f50);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004db30(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f51);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PET_READLIST",0x2f51);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004dc30(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f51);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_PET_READLIST",0x2f51);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004dd40(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7,undefined8 *param_8,
             undefined4 *param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f52);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14003cac0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PET_LEVEL_UPDATE",0x2f52);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004de80(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined8 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f52);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14003cac0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_PET_LEVEL_UPDATE",0x2f52);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004dfc0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined8 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f53);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003cac0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PET_EXP_UPDATE",0x2f53);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004e0d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f53);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14003cac0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_PET_EXP_UPDATE",0x2f53);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004e1f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f54);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PET_NAME_UPDATE",0x2f54);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004e300(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f54);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_PET_NAME_UPDATE",0x2f54);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004e420(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7,undefined8 *param_8)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f55);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14003cac0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PET_INTIMACY_LEVEL_UPDATE",0x2f55)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004e550(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined8 *param_9)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f55);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14003cac0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_PET_INTIMACY_LEVEL_UPDATE",
                     0x2f55);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004e680(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined8 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f56);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003cac0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PET_INTIMACY_EXP_UPDATE",0x2f56);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004e790(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f56);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14003cac0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_PET_INTIMACY_EXP_UPDATE",0x2f56)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004e8b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f57);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_BATTLE_POINT",
                     0x2f57);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004e9b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f57);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_BATTLE_POINT",
                     0x2f57);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004eac0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f58);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14003cac0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_BATTLE_EXP",
                     0x2f58);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004ebc0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f58);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003cac0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_BATTLE_EXP",
                     0x2f58);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004ecd0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f59);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_BATTLE_LADDER",
                     0x2f59);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004ede0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f59);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_BATTLE_LADDER",
                     0x2f59);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004ef00(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f5a);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_CASH_EFFECTINFO",0x2f5a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004f000(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f5a);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_CASH_EFFECTINFO",0x2f5a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004f110(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,longlong param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f5b);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_7 + 0x10));
  FUN_14007c6e0(local_30,*(undefined4 *)(param_7 + 0x14));
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INSERT_CASH_EFFECTINFO",0x2f5b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004f240(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,longlong param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f5b);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_8 + 0x10));
  FUN_14007c6e0(local_30,*(undefined4 *)(param_8 + 0x14));
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_INSERT_CASH_EFFECTINFO",0x2f5b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004f380(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f5c);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CASH_EFFECTINFO",0x2f5c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004f4b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f5c);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CASH_EFFECTINFO",0x2f5c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004f5e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f5d);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DELETE_CASH_EFFECTINFO",0x2f5d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004f6f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f5d);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_DELETE_CASH_EFFECTINFO",0x2f5d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14004f810(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f5e);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_AUTH_BLACKLISTIP",0x2f5e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14004f8d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f5e);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_AUTH_BLACKLISTIP",0x2f5e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14004f9a0(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f5f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_AUTH_PCROOMIP",0x2f5f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14004fa60(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f5f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_AUTH_PCROOMIP",0x2f5f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004fb30(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined8 param_10)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f60);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_140186d90(local_30,param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_INCREASE_EXP",0x2f60);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004fc80(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined4 *param_10,undefined8 param_11)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f60);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_140186d90(local_30,param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_140186d90(local_30,param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_INCREASE_EXP",0x2f60);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004fdd0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f61);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_INCREASE_EXP_LOG",0x2f61);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004fec0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f61);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_INCREASE_EXP_LOG",0x2f61);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14004ffb0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 *param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f62);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14003cac0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_LEVEL_UP",0x2f62);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140050100(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 *param_9,undefined4 *param_10,undefined4 *param_11)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f62);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14003cac0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_LEVEL_UP",0x2f62);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140050260(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f63);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_STORAGE_INFO",0x2f63);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140050350(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f63);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_STORAGE_INFO",0x2f63);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140050440(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined8 *param_7,undefined4 *param_8,
             undefined1 *param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f64);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14003cac0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14003c9e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_STORAGE_INFO_CHANGE",0x2f64)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140050580(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7,undefined8 *param_8,
             undefined4 *param_9,undefined1 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f64);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14003cac0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14003c9e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_STORAGE_INFO_CHANGE",
                     0x2f64);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400506d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f65);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_USE_LOG",0x2f65);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400507c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f65);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_USE_LOG",0x2f65);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400508b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f66);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_STORAGE_ITEM_LIST",0x2f66);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400509a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f66);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_STORAGE_ITEM_LIST",0x2f66)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140050a90(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f67);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_DEPOSIT",0x2f67);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140050ba0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f67);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_DEPOSIT",0x2f67);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140050cc0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f68);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_PAYMENT",0x2f68);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140050dd0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f68);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_PAYMENT",0x2f68);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140050ef0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined8 param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f69);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_140080030(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_STORAGE_PUSH_ITEM",0x2f69);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140051020(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined8 param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f69);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_140080030(local_30,param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_STORAGE_PUSH_ITEM",0x2f69)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140051160(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f6a);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_STORAGE_POP_ITEM",0x2f6a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140051260(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f6a);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_STORAGE_POP_ITEM",0x2f6a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140051370(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f6b);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_STORAGE_ITEM_CHANGE_COUNT",
                     0x2f6b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140051490(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f6b);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_STORAGE_ITEM_CHANGE_COUNT"
                     ,0x2f6b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400515c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined1 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f6c);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14003c9e0(local_30,*param_6);
  FUN_140186d90(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  FUN_140186d90(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_STORAGE_USE_LOG",0x2f6c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140051700(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined1 *param_7,undefined8 param_8,
             undefined8 param_9,undefined8 param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f6c);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003c9e0(local_30,*param_7);
  FUN_140186d90(local_30,param_8);
  FUN_140186d90(local_30,param_9);
  FUN_140186d90(local_30,param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_STORAGE_USE_LOG",0x2f6c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140051840(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f6d);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_DICE_POINT",
                     0x2f6d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140051940(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f6d);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_DICE_POINT",
                     0x2f6d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140051a50(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined2 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f6e);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003d020(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_STATUS_ADDITION_HP",0x2f6e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140051b60(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined2 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f6e);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14003d020(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_STATUS_ADDITION_HP",0x2f6e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140051c80(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined2 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f6f);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003d020(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_STATUS_ADDITION_MP",0x2f6f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140051d90(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined2 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f6f);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14003d020(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_STATUS_ADDITION_MP",0x2f6f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140051eb0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined2 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f70);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003d020(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_STATUS_ADDITION_PHYSICATTACK",
                     0x2f70);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140051fc0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined2 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f70);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14003d020(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_STATUS_ADDITION_PHYSICATTACK",
                     0x2f70);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400520e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined2 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f71);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003d020(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_STATUS_ADDITION_PHYSICDEFENSE",
                     0x2f71);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400521f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined2 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f71);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14003d020(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_STATUS_ADDITION_PHYSICDEFENSE",
                     0x2f71);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140052310(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined2 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f72);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003d020(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_STATUS_ADDITION_MAGICATTACK",
                     0x2f72);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140052420(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined2 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f72);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14003d020(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_STATUS_ADDITION_MAGICATTACK",
                     0x2f72);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140052540(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined2 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f73);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003d020(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_STATUS_ADDITION_MAGICDEFENSE",
                     0x2f73);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140052650(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined2 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f73);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14003d020(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_STATUS_ADDITION_MAGICDEFENSE",
                     0x2f73);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140052770(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f74);
  FUN_140186cf0(local_30,param_4);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REG_PACKET_OVERLOAD_LOG",0x2f74);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140052860(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f74);
  FUN_140186cf0(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REG_PACKET_OVERLOAD_LOG",0x2f74);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140052950(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f75);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_FATIGUE_STORAGE",
                     0x2f75);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140052a50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f75);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     L"REQ_UPDATE_CHARACTER_FATIGUE_STORAGE",0x2f75);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140052b60(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined4 *param_13,undefined4 *param_14,undefined8 param_15)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f76);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  FUN_140186d90(local_30,param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14007c6e0(local_30,*param_14);
  FUN_140080030(local_30,param_15);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_SEND_CREATE_ITEM",0x2f76);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140052ce0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined8 param_10,undefined4 *param_11,undefined4 *param_12,
             undefined4 *param_13,undefined4 *param_14,undefined4 *param_15,undefined8 param_16)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f76);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  FUN_140186d90(local_30,param_9);
  FUN_140186d90(local_30,param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14007c6e0(local_30,*param_14);
  FUN_14007c6e0(local_30,*param_15);
  FUN_140080030(local_30,param_16);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_MAIL_SEND_CREATE_ITEM",0x2f76);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140052ea0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f77);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_NEW_EXIST",0x2f77);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140052fa0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f77);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_MAIL_NEW_EXIST",0x2f77);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400530b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f78);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_140186d90(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_ITEM_LOCK",0x2f78);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400531b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f78);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_ITEM_LOCK",0x2f78);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400532c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f79);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_GUILD_POINT",
                     0x2f79);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400533c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f79);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_GUILD_POINT",
                     0x2f79);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400534d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f7a);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SERVER_MCU",0x2f7a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400535c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f7a);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_SERVER_MCU",0x2f7a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400536c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f7b);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_REARING_LISTINFO",0x2f7b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400537c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f7b);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_REARING_LISTINFO",0x2f7b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400538d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f7c);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007ee50(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INSERT_REARING_INFO",0x2f7c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400539d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f7c);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007ee50(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_INSERT_REARING_INFO",0x2f7c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140053ae0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f7d);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007ee50(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_REARING_INFO",0x2f7d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140053be0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f7d);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007ee50(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_REARING_INFO",0x2f7d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140053cf0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f7e);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DELETE_REARING_INFO",0x2f7e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140053df0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f7e);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_DELETE_REARING_INFO",0x2f7e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140053f00(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f7f);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_REARING_TURN",0x2f7f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140054000(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f7f);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_REARING_TURN",0x2f7f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140054110(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined1 *param_7,undefined4 *param_8,
             undefined4 *param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f80);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003c9e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CREATE_GUILD_STORAGE",0x2f80);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140054250(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined1 *param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f80);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14003c9e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CREATE_GUILD_STORAGE",0x2f80);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400543a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined1 *param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f81);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003c9e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_STORAGE_EXTENSION",0x2f81);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400544f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined1 *param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f81);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14003c9e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_STORAGE_EXTENSION",0x2f81)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140054650(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f82);
  FUN_14003d020(local_30,*param_4);
  FUN_14003d020(local_30,*param_5);
  FUN_140081ca0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_ITEM_ENCHANT",0x2f82);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140054750(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f82);
  FUN_14003d020(local_30,*param_5);
  FUN_14003d020(local_30,*param_6);
  FUN_140081ca0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_ITEM_ENCHANT",0x2f82);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140054860(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f83);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_CASH_PRODUCT_LIST",0x2f83);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140054960(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f83);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_CASH_PRODUCT_LIST",0x2f83);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140054a70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f84);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  FUN_140071120(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INSERT_CASH_PRODUCT",0x2f84);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140054bb0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f84);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  FUN_140071120(local_30,param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_INSERT_CASH_PRODUCT",0x2f84);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140054cf0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f85);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CASH_PRODUCT",0x2f85);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140054e00(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f85);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CASH_PRODUCT",0x2f85);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140054f20(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f86);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_140186d90(local_30,param_6);
  FUN_140186cf0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHARACTER_ROB",0x2f86);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140055030(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f86);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  FUN_140186cf0(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CHARACTER_ROB",0x2f86);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140055150(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f87);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_5 + 1);
  FUN_1401a2620(local_30,param_5 + 5);
  FUN_14003c9e0(local_30,*(undefined1 *)(param_5 + 0x11));
  FUN_1401a2620(local_30,(longlong)param_5 + 0x45);
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_5 + 0x5d));
  FUN_14003cac0(local_30,*(undefined8 *)((longlong)param_5 + 0x55));
  FUN_140186dd0(local_30,param_5 + 9);
  FUN_140186dd0(local_30,(longlong)param_5 + 0x61);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_PVP_ROOM",0x2f87);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400552b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f87);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_6 + 1);
  FUN_1401a2620(local_30,param_6 + 5);
  FUN_14003c9e0(local_30,*(undefined1 *)(param_6 + 0x11));
  FUN_1401a2620(local_30,(longlong)param_6 + 0x45);
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_6 + 0x5d));
  FUN_14003cac0(local_30,*(undefined8 *)((longlong)param_6 + 0x55));
  FUN_140186dd0(local_30,param_6 + 9);
  FUN_140186dd0(local_30,(longlong)param_6 + 0x61);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_PVP_ROOM",0x2f87);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140055420(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f88);
  FUN_14003d020(local_30,*param_4);
  FUN_140082260(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_PVP_BATTLE",0x2f88);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140055510(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f88);
  FUN_14003d020(local_30,*param_5);
  FUN_140082260(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_PVP_BATTLE",0x2f88);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140055600(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f89);
  FUN_14003d020(local_30,*param_4);
  FUN_140082100(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_PVP_RESULT",0x2f89);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400556f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f89);
  FUN_14003d020(local_30,*param_5);
  FUN_140082100(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_PVP_RESULT",0x2f89);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400557e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f8a);
  FUN_14003d020(local_30,*param_4);
  FUN_140082410(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_PVP_DEATH",0x2f8a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400558d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f8a);
  FUN_14003d020(local_30,*param_5);
  FUN_140082410(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_PVP_DEATH",0x2f8a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400559c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6,longlong *param_7,undefined1 *param_8)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f8b);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_14007c6e0(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  FUN_14003c9e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_FORTUNE",0x2f8b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140055b20(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7,longlong *param_8,
             undefined1 *param_9)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x2f8b);
  FUN_14003d020(local_40,*param_5);
  FUN_1401a2620(local_40,param_6);
  FUN_14007c6e0(local_40,*param_7);
  FUN_14007c6e0(local_40,param_8[1] - *param_8 >> 2);
  puVar2 = (undefined4 *)*param_8;
  if (puVar2 != (undefined4 *)param_8[1]) {
    do {
      FUN_14007c6e0(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_8[1]);
  }
  FUN_14003c9e0(local_40,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"REQ_UPDATE_FORTUNE",0x2f8b);
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140055c80(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f8c);
  FUN_14003d020(local_30,*param_4);
  FUN_140080030(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_ITEM_UPDATE_CODE_OPTION",0x2f8c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140055d70(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f8c);
  FUN_14003d020(local_30,*param_5);
  FUN_140080030(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_ITEM_UPDATE_CODE_OPTION",0x2f8c)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140055e60(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f8d);
  FUN_1401a2620(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_ADD_INQUIRY_COUNT",0x2f8d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140055f40(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f8d);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_ADD_INQUIRY_COUNT",0x2f8d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140056020(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f8e);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_5 + 1);
  FUN_1401a2620(local_30,param_5 + 5);
  FUN_14003c9e0(local_30,*(undefined1 *)(param_5 + 9));
  FUN_14003c9e0(local_30,*(undefined1 *)((longlong)param_5 + 0x25));
  FUN_14003c9e0(local_30,*(undefined1 *)((longlong)param_5 + 0x26));
  FUN_14007c8a0(local_30,*(undefined8 *)((longlong)param_5 + 0x2a9));
  FUN_140186dd0(local_30,(longlong)param_5 + 0x27);
  FUN_140186dd0(local_30,(longlong)param_5 + 0x47);
  FUN_140186dd0(local_30,(longlong)param_5 + 0xab);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INSERT_INQUIRY",0x2f8e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140056190(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f8e);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_6 + 1);
  FUN_1401a2620(local_30,param_6 + 5);
  FUN_14003c9e0(local_30,*(undefined1 *)(param_6 + 9));
  FUN_14003c9e0(local_30,*(undefined1 *)((longlong)param_6 + 0x25));
  FUN_14003c9e0(local_30,*(undefined1 *)((longlong)param_6 + 0x26));
  FUN_14007c8a0(local_30,*(undefined8 *)((longlong)param_6 + 0x2a9));
  FUN_140186dd0(local_30,(longlong)param_6 + 0x27);
  FUN_140186dd0(local_30,(longlong)param_6 + 0x47);
  FUN_140186dd0(local_30,(longlong)param_6 + 0xab);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_INSERT_INQUIRY",0x2f8e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140056310(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f8f);
  FUN_140186d90(local_30,param_4);
  FUN_14003c9e0(local_30,*param_5);
  FUN_140186d90(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_140186cf0(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INSERT_INQUIRY_BY_GM",0x2f8f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140056450(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined1 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined8 param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f8f);
  FUN_140186d90(local_30,param_5);
  FUN_14003c9e0(local_30,*param_6);
  FUN_140186d90(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_1401a2620(local_30,param_9);
  FUN_140186cf0(local_30,param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_INSERT_INQUIRY_BY_GM",0x2f8f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140056590(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined1 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f90);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14003c9e0(local_30,*param_6);
  FUN_140186d90(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_INQUIRY",0x2f90);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400566a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined1 *param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f90);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003c9e0(local_30,*param_7);
  FUN_140186d90(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_INQUIRY",0x2f90);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400567c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f91);
  FUN_1401a2620(local_30,param_4);
  FUN_14003c9e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_INQUIRY_TYPE",0x2f91);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400568b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f91);
  FUN_1401a2620(local_30,param_5);
  FUN_14003c9e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_INQUIRY_TYPE",0x2f91);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_1400569a0(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f92);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_INQUIRY",0x2f92);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140056a60(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f92);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_INQUIRY",0x2f92);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140056b30(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f93);
  FUN_1401a2620(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DELETE_INQUIRY",0x2f93);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140056c10(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f93);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_DELETE_INQUIRY",0x2f93);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140056cf0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f94);
  FUN_14007c6e0(local_30,*param_4);
  FUN_140186d90(local_30,param_5);
  FUN_140186d90(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GM_AUTH",0x2f94);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140056df0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f94);
  FUN_14007c6e0(local_30,*param_5);
  FUN_140186d90(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GM_AUTH",0x2f94);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140056ef0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f95);
  FUN_140186d90(local_30,param_4);
  FUN_14003c9e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INSERT_BLACKIP",0x2f95);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140056fe0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f95);
  FUN_140186d90(local_30,param_5);
  FUN_14003c9e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_INSERT_BLACKIP",0x2f95);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400570d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined8 param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f96);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_140080030(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_ADD_PET_INVENTORY_ITEM",0x2f96);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140057210(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined8 param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f96);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_140080030(local_30,param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_ADD_PET_INVENTORY_ITEM",0x2f96);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140057350(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f97);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_PET_INVENTORY_ITEM",0x2f97);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140057450(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f97);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_PET_INVENTORY_ITEM",0x2f97)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140057560(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f98);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MOVE_PET_INVEN_TO_INVEN",0x2f98);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400576b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined4 *param_10,undefined4 *param_11)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f98);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_1401a2620(local_30,param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_MOVE_PET_INVEN_TO_INVEN",0x2f98)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140057810(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f99);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DELETE_PET_INVENTORY_ITEM",0x2f99)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140057920(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f99);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_DELETE_PET_INVENTORY_ITEM",
                     0x2f99);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140057a40(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f9a);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_PET_TYPE",0x2f9a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140057b50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f9a);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_PET_TYPE",0x2f9a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140057c70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined4 *param_13,undefined4 *param_14,undefined4 *param_15)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f9b);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14007c7c0(local_30,*param_14);
  FUN_14007c7c0(local_30,*param_15);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_PET_STET",0x2f9b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140057e00(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined4 *param_13,undefined4 *param_14,undefined4 *param_15,undefined4 *param_16)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f9b);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14007c6e0(local_30,*param_14);
  FUN_14007c7c0(local_30,*param_15);
  FUN_14007c7c0(local_30,*param_16);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_PET_STET",0x2f9b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140057fd0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f9c);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_DAY_ATTACH",0x2f9c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400580e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f9c);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_DAY_ATTACH",0x2f9c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140058200(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f9d);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_RESET_BATTLE_INFO",0x2f9d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400582f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f9d);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_RESET_BATTLE_INFO",0x2f9d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400583e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f9e);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140080030(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PET_ITEM_UPDATE",0x2f9e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400584f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f9e);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140080030(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_PET_ITEM_UPDATE",0x2f9e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140058610(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f9f);
  FUN_14003d020(local_30,*param_4);
  FUN_1400824c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_LOG",0x2f9f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140058700(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2f9f);
  FUN_14003d020(local_30,*param_5);
  FUN_1400824c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_LOG",0x2f9f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400587f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined4 *param_13)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa0);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c7c0(local_30,*param_9);
  FUN_14007c7c0(local_30,*param_10);
  FUN_14007c7c0(local_30,*param_11);
  FUN_14007c7c0(local_30,*param_12);
  FUN_14007c7c0(local_30,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PET_EAT_STATUS",0x2fa0);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140058990(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined4 *param_13,undefined4 *param_14)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa0);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c7c0(local_30,*param_10);
  FUN_14007c7c0(local_30,*param_11);
  FUN_14007c7c0(local_30,*param_12);
  FUN_14007c7c0(local_30,*param_13);
  FUN_14007c7c0(local_30,*param_14);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_PET_EAT_STATUS",0x2fa0);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140058b30(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa1);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_STORAGE_ITEM_UPDATE",0x2fa1)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140058c70(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa1);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_STORAGE_ITEM_UPDATE",
                     0x2fa1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140058db0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa2);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14003c9e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_EVENT_INQUIRY",0x2fa2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140058eb0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined1 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa2);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003c9e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_EVENT_INQUIRY",0x2fa2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140058fc0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa3);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14003c9e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_INQUIRY_COUNT",0x2fa3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400590c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined1 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa3);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003c9e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_INQUIRY_COUNT",0x2fa3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400591d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa4);
  FUN_14003d020(local_30,*param_4);
  FUN_140082570(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_QUEST_LOG",0x2fa4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400592c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa4);
  FUN_14003d020(local_30,*param_5);
  FUN_140082570(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_QUEST_LOG",0x2fa4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400593b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa5);
  FUN_14003d020(local_30,*param_4);
  FUN_1400827e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_CHARACTER",0x2fa5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400594a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa5);
  FUN_14003d020(local_30,*param_5);
  FUN_1400827e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_CHARACTER",0x2fa5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140059590(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa6);
  FUN_14003d020(local_30,*param_4);
  FUN_140082620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_ITEMTRADE",0x2fa6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140059680(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa6);
  FUN_14003d020(local_30,*param_5);
  FUN_140082620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_ITEMTRADE",0x2fa6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140059770(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa7);
  FUN_1400828d0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_INQUIRY_COMPLETE",0x2fa7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140059850(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa7);
  FUN_1400828d0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_INQUIRY_COMPLETE",0x2fa7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140059930(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa8);
  FUN_14003d020(local_30,*param_4);
  FUN_14003cac0(local_30,*(undefined8 *)(param_4 + 1));
  FUN_14007c6e0(local_30,*(undefined4 *)(param_4 + 5));
  FUN_140186dd0(local_30,param_4 + 7);
  FUN_140186dd0(local_30,param_4 + 0x17);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_INQUIRY_CHATTING",0x2fa8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140059a40(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa8);
  FUN_14003d020(local_30,*param_5);
  FUN_14003cac0(local_30,*(undefined8 *)(param_5 + 1));
  FUN_14007c6e0(local_30,*(undefined4 *)(param_5 + 5));
  FUN_140186dd0(local_30,param_5 + 7);
  FUN_140186dd0(local_30,param_5 + 0x17);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_INQUIRY_CHATTING",0x2fa8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140059b60(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa9);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14003d020(local_30,*(undefined2 *)(param_4 + 1));
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_4 + 6));
  FUN_14003c9e0(local_30,*(undefined1 *)((longlong)param_4 + 10));
  FUN_14003c9e0(local_30,*(undefined1 *)((longlong)param_4 + 0x229));
  FUN_140186dd0(local_30,(longlong)param_4 + 0xb);
  FUN_140186dd0(local_30,(longlong)param_4 + 0x209);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_MONITOR_NOTICE",0x2fa9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140059c90(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fa9);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14003d020(local_30,*(undefined2 *)(param_5 + 1));
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_5 + 6));
  FUN_14003c9e0(local_30,*(undefined1 *)((longlong)param_5 + 10));
  FUN_14003c9e0(local_30,*(undefined1 *)((longlong)param_5 + 0x229));
  FUN_140186dd0(local_30,(longlong)param_5 + 0xb);
  FUN_140186dd0(local_30,(longlong)param_5 + 0x209);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_MONITOR_NOTICE",0x2fa9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140059dd0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2faa);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14003c9e0(local_30,*(undefined1 *)(param_4 + 1));
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_4 + 5));
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_4 + 9));
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_4 + 0xd));
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_4 + 0x11));
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_4 + 0x15));
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_MONITOR_USER",0x2faa);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140059f00(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2faa);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14003c9e0(local_30,*(undefined1 *)(param_5 + 1));
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_5 + 5));
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_5 + 9));
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_5 + 0xd));
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_5 + 0x11));
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_5 + 0x15));
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_MONITOR_USER",0x2faa);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005a040(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fab);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14003c9e0(local_30,*(undefined1 *)(param_4 + 1));
  FUN_14003c9e0(local_30,*(undefined1 *)((longlong)param_4 + 5));
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_4 + 0x26));
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_4 + 0x2a));
  FUN_140186dd0(local_30,(longlong)param_4 + 6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_MONITOR_COMMAND",0x2fab);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005a160(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fab);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14003c9e0(local_30,*(undefined1 *)(param_5 + 1));
  FUN_14003c9e0(local_30,*(undefined1 *)((longlong)param_5 + 5));
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_5 + 0x26));
  FUN_14007c6e0(local_30,*(undefined4 *)((longlong)param_5 + 0x2a));
  FUN_140186dd0(local_30,(longlong)param_5 + 6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_MONITOR_COMMAND",0x2fab);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005a290(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fac);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14003c9e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_EVENT_MAILATTACH",0x2fac);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005a390(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined1 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fac);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003c9e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_EVENT_MAILATTACH",0x2fac)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005a4a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fad);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_5 + 1);
  FUN_1401a2620(local_30,param_5 + 5);
  FUN_14007c6e0(local_30,param_5[9]);
  FUN_14007c6e0(local_30,param_5[10]);
  FUN_14007c6e0(local_30,param_5[0xb]);
  FUN_14007c6e0(local_30,param_5[0xc]);
  FUN_14007c6e0(local_30,param_5[0xd]);
  FUN_140186d30(local_30,param_5 + 0xe);
  FUN_140186dd0(local_30,(longlong)param_5 + 0x6a);
  FUN_140186dd0(local_30,(longlong)param_5 + 0x8a);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CASHBUY_LOG",0x2fad);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005a620(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fad);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_6 + 1);
  FUN_1401a2620(local_30,param_6 + 5);
  FUN_14007c6e0(local_30,param_6[9]);
  FUN_14007c6e0(local_30,param_6[10]);
  FUN_14007c6e0(local_30,param_6[0xb]);
  FUN_14007c6e0(local_30,param_6[0xc]);
  FUN_14007c6e0(local_30,param_6[0xd]);
  FUN_140186d30(local_30,param_6 + 0xe);
  FUN_140186dd0(local_30,(longlong)param_6 + 0x6a);
  FUN_140186dd0(local_30,(longlong)param_6 + 0x8a);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CASHBUY_LOG",0x2fad);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005a7b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fae);
  FUN_14003d020(local_30,*param_4);
  FUN_1400829b0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOGINOUT_LOG",0x2fae);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005a8a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fae);
  FUN_14003d020(local_30,*param_5);
  FUN_1400829b0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOGINOUT_LOG",0x2fae);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005a990(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2faf);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,param_5[1]);
  FUN_1401a2620(local_30,param_5 + 2);
  FUN_1401a2620(local_30,param_5 + 6);
  FUN_14007c6e0(local_30,param_5[10]);
  FUN_14003cac0(local_30,*(undefined8 *)(param_5 + 0xb));
  FUN_14007c6e0(local_30,param_5[0xd]);
  FUN_14007c6e0(local_30,param_5[0xe]);
  FUN_14007c6e0(local_30,param_5[0xf]);
  FUN_140186dd0(local_30,param_5 + 0x20);
  FUN_140186dd0(local_30,param_5 + 0x18);
  FUN_140186dd0(local_30,param_5 + 0x10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CONNECTION_LOG",0x2faf);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005ab00(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2faf);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,param_6[1]);
  FUN_1401a2620(local_30,param_6 + 2);
  FUN_1401a2620(local_30,param_6 + 6);
  FUN_14007c6e0(local_30,param_6[10]);
  FUN_14003cac0(local_30,*(undefined8 *)(param_6 + 0xb));
  FUN_14007c6e0(local_30,param_6[0xd]);
  FUN_14007c6e0(local_30,param_6[0xe]);
  FUN_14007c6e0(local_30,param_6[0xf]);
  FUN_140186dd0(local_30,param_6 + 0x20);
  FUN_140186dd0(local_30,param_6 + 0x18);
  FUN_140186dd0(local_30,param_6 + 0x10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CONNECTION_LOG",0x2faf);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005aca0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb0);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_5 + 1);
  FUN_14007c6e0(local_30,param_5[5]);
  FUN_14007c6e0(local_30,param_5[6]);
  FUN_14003c9e0(local_30,*(undefined1 *)(param_5 + 7));
  FUN_14003c9e0(local_30,*(undefined1 *)((longlong)param_5 + 0x1d));
  FUN_14003c9e0(local_30,*(undefined1 *)((longlong)param_5 + 0x1e));
  FUN_140186d30(local_30,(longlong)param_5 + 0x1f);
  FUN_140186dd0(local_30,(longlong)param_5 + 0x51);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LEARNSKILL_LOG",0x2fb0);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005ae00(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb0);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_6 + 1);
  FUN_14007c6e0(local_30,param_6[5]);
  FUN_14007c6e0(local_30,param_6[6]);
  FUN_14003c9e0(local_30,*(undefined1 *)(param_6 + 7));
  FUN_14003c9e0(local_30,*(undefined1 *)((longlong)param_6 + 0x1d));
  FUN_14003c9e0(local_30,*(undefined1 *)((longlong)param_6 + 0x1e));
  FUN_140186d30(local_30,(longlong)param_6 + 0x1f);
  FUN_140186dd0(local_30,(longlong)param_6 + 0x51);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LEARNSKILL_LOG",0x2fb0);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005af70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb1);
  FUN_14003d020(local_30,*param_4);
  FUN_140082a90(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_LOG",0x2fb1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005b060(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb1);
  FUN_14003d020(local_30,*param_5);
  FUN_140082a90(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_MAIL_LOG",0x2fb1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005b150(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb2);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,param_5[1]);
  FUN_1401a2620(local_30,param_5 + 2);
  FUN_14007c6e0(local_30,param_5[6]);
  FUN_14007c6e0(local_30,param_5[7]);
  FUN_1401a2620(local_30,param_5 + 8);
  FUN_140186d30(local_30,param_5 + 0xc);
  FUN_140186dd0(local_30,(longlong)param_5 + 0x62);
  FUN_140186dd0(local_30,(longlong)param_5 + 0x82);
  FUN_140186dd0(local_30,(longlong)param_5 + 0xa2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHAT_LOG",0x2fb2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005b2c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb2);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,param_6[1]);
  FUN_1401a2620(local_30,param_6 + 2);
  FUN_14007c6e0(local_30,param_6[6]);
  FUN_14007c6e0(local_30,param_6[7]);
  FUN_1401a2620(local_30,param_6 + 8);
  FUN_140186d30(local_30,param_6 + 0xc);
  FUN_140186dd0(local_30,(longlong)param_6 + 0x62);
  FUN_140186dd0(local_30,(longlong)param_6 + 0x82);
  FUN_140186dd0(local_30,(longlong)param_6 + 0xa2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CHAT_LOG",0x2fb2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14005b440(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CONNECTION_TEST",0x2fb3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14005b500(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CONNECTION_TEST",0x2fb3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005b5d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined4 *param_10,undefined8 param_11,undefined4 *param_12,
             undefined4 *param_13,undefined2 *param_14,undefined8 *param_15,undefined2 *param_16)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb4);
  FUN_14003d020(local_30,*param_4);
  FUN_14003d020(local_30,*param_5);
  FUN_140186cf0(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_140186d90(local_30,param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_140186d90(local_30,param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14003d020(local_30,*param_14);
  FUN_14003cac0(local_30,*param_15);
  FUN_14003d020(local_30,*param_16);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOGOUT_LOG",0x2fb4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005b760(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined8 param_10,undefined4 *param_11,undefined8 param_12,
             undefined4 *param_13,undefined4 *param_14,undefined2 *param_15,undefined8 *param_16,
             undefined2 *param_17)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb4);
  FUN_14003d020(local_30,*param_5);
  FUN_14003d020(local_30,*param_6);
  FUN_140186cf0(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_1401a2620(local_30,param_9);
  FUN_140186d90(local_30,param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_140186d90(local_30,param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14007c6e0(local_30,*param_14);
  FUN_14003d020(local_30,*param_15);
  FUN_14003cac0(local_30,*param_16);
  FUN_14003d020(local_30,*param_17);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOGOUT_LOG",0x2fb4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005b900(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb5);
  FUN_14003d020(local_30,*param_4);
  FUN_140082b50(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_AUCTION",0x2fb5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005b9f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb5);
  FUN_14003d020(local_30,*param_5);
  FUN_140082b50(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_AUCTION",0x2fb5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005bae0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb6);
  FUN_14003d020(local_30,*param_4);
  FUN_140082d10(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_ITEMMAIL",0x2fb6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005bbd0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb6);
  FUN_14003d020(local_30,*param_5);
  FUN_140082d10(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_ITEMMAIL",0x2fb6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005bcc0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb7);
  FUN_14003d020(local_30,*param_4);
  FUN_140082e80(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_ITEMS",0x2fb7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005bdb0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb7);
  FUN_14003d020(local_30,*param_5);
  FUN_140082e80(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_ITEMS",0x2fb7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005bea0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb8);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_BLOCK",0x2fb8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005bf90(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb8);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_BLOCK",0x2fb8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14005c080(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_REAL_TIME_EVENT",0x2fb9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14005c140(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fb9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_REAL_TIME_EVENT",0x2fb9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005c210(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fba);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DEL_CHARACTER_TITLE",0x2fba);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005c320(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fba);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_DEL_CHARACTER_TITLE",0x2fba);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005c440(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fbb);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,param_6[1]);
  FUN_14007c7c0(local_30,param_6[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INSERT_BUFF",0x2fbb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005c560(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fbb);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,param_7[1]);
  FUN_14007c7c0(local_30,param_7[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_INSERT_BUFF",0x2fbb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005c690(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fbc);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,param_6[1]);
  FUN_14007c7c0(local_30,param_6[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_BUFF",0x2fbc);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005c7b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fbc);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,param_7[1]);
  FUN_14007c7c0(local_30,param_7[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_BUFF",0x2fbc);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005c8e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fbd);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,param_6[1]);
  FUN_14007c7c0(local_30,param_6[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DELETE_BUFF",0x2fbd);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005ca00(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fbd);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,param_7[1]);
  FUN_14007c7c0(local_30,param_7[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_DELETE_BUFF",0x2fbd);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005cb30(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fbe);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_BUFF",0x2fbe);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005cc30(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fbe);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_BUFF",0x2fbe);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14005cd40(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fbf);
  FUN_140186d90(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_BLOCK_BY_NAME",
                     0x2fbf);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005ce20(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fbf);
  FUN_140186d90(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_BLOCK_BY_NAME",
                     0x2fbf);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005cf00(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc0);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CASH_MILEAGE",0x2fc0);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005d000(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc0);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CASH_MILEAGE",0x2fc0);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005d110(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10,undefined8 param_11,undefined4 *param_12)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc1);
  FUN_14003d020(local_30,*param_4);
  FUN_140186d90(local_30,param_5);
  FUN_140186d90(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_140080030(local_30,param_11);
  FUN_14007c6e0(local_30,*param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SEND_MAIL_REWARD_ITEM",0x2fc1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005d280(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11,undefined8 param_12,
             undefined4 *param_13)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc1);
  FUN_14003d020(local_30,*param_5);
  FUN_140186d90(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_140080030(local_30,param_12);
  FUN_14007c6e0(local_30,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_SEND_MAIL_REWARD_ITEM",0x2fc1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005d400(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc2);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140186d90(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_NAME",0x2fc2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005d510(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc2);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_NAME",0x2fc2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14005d630(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_WORLD_SERVER",0x2fc3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14005d6f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_WORLD_SERVER",0x2fc3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005d7c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined8 param_10,undefined4 *param_11,undefined8 param_12,
             undefined8 *param_13)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc4);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186cf0(local_30,param_8);
  FUN_140186d90(local_30,param_9);
  FUN_140186d90(local_30,param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_140186d90(local_30,param_12);
  FUN_14007c8a0(local_30,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_REWARD_COUPON",0x2fc4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005d940(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined8 param_10,undefined8 param_11,undefined4 *param_12,
             undefined8 param_13,undefined8 *param_14)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc4);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_140186cf0(local_30,param_9);
  FUN_140186d90(local_30,param_10);
  FUN_140186d90(local_30,param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_140186d90(local_30,param_13);
  FUN_14007c8a0(local_30,*param_14);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_REWARD_COUPON",0x2fc4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005dad0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc5);
  FUN_1401a2620(local_30,param_4);
  FUN_140186d90(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PC_ROOM_POINT",0x2fc5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005dbc0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc5);
  FUN_1401a2620(local_30,param_5);
  FUN_140186d90(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_PC_ROOM_POINT",0x2fc5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005dcb0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc6);
  FUN_1401a2620(local_30,param_4);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SAVE_PC_ROOM_POINT",0x2fc6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005dda0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc6);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_SAVE_PC_ROOM_POINT",0x2fc6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005de90(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc7);
  FUN_14003d020(local_30,*param_4);
  FUN_1400830d0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_PET",0x2fc7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005df80(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc7);
  FUN_14003d020(local_30,*param_5);
  FUN_1400830d0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_PET",0x2fc7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005e070(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc8);
  FUN_14003d020(local_30,*param_4);
  FUN_140083000(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_ACCOUNT",0x2fc8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005e160(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc8);
  FUN_14003d020(local_30,*param_5);
  FUN_140083000(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_ACCOUNT",0x2fc8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005e250(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc9);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14003c9e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_PVP_LADDER",0x2fc9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005e350(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined1 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fc9);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14003c9e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_PVP_LADDER",0x2fc9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005e460(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fca);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_REWARD",0x2fca);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005e560(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fca);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_REWARD",0x2fca);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005e670(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined4 *param_10,undefined8 param_11,undefined4 *param_12,
             undefined4 *param_13,undefined4 *param_14,undefined4 *param_15)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fcb);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_140186d90(local_30,param_7);
  FUN_140186d90(local_30,param_8);
  FUN_140186d90(local_30,param_9);
  FUN_14007c6e0(local_30,*param_10);
  FUN_140080030(local_30,param_11);
  FUN_14007c6e0(local_30,*param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14007c6e0(local_30,*param_14);
  FUN_14007c6e0(local_30,*param_15);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_REWARD_ITEM",0x2fcb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005e7f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined4 *param_7,undefined8 param_8,
             undefined8 param_9,undefined8 param_10,undefined4 *param_11,undefined8 param_12,
             undefined4 *param_13,undefined4 *param_14,undefined4 *param_15,undefined4 *param_16)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fcb);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_140186d90(local_30,param_8);
  FUN_140186d90(local_30,param_9);
  FUN_140186d90(local_30,param_10);
  FUN_14007c6e0(local_30,*param_11);
  FUN_140080030(local_30,param_12);
  FUN_14007c6e0(local_30,*param_13);
  FUN_14007c6e0(local_30,*param_14);
  FUN_14007c6e0(local_30,*param_15);
  FUN_14007c6e0(local_30,*param_16);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_REWARD_ITEM",0x2fcb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005e9b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fcc);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHARACTER_EQUIP_ITEM_END",0x2fcc);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005eaa0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fcc);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CHARACTER_EQUIP_ITEM_END",0x2fcc
                    );
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005eba0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fcd);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,param_5[1]);
  FUN_14007c6e0(local_30,param_5[2]);
  FUN_14007c6e0(local_30,param_5[3]);
  FUN_14007c6e0(local_30,param_5[4]);
  FUN_14007c6e0(local_30,param_5[5]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_PVP_LADDER",0x2fcd);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005ecd0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fcd);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,param_6[1]);
  FUN_14007c6e0(local_30,param_6[2]);
  FUN_14007c6e0(local_30,param_6[3]);
  FUN_14007c6e0(local_30,param_6[4]);
  FUN_14007c6e0(local_30,param_6[5]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_PVP_LADDER",0x2fcd);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005ee10(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fce);
  FUN_1401a2620(local_30,param_4);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_PCROOM_REMAINTIME",0x2fce);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005ef00(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fce);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_PCROOM_REMAINTIME",0x2fce
                    );
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005eff0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fcf);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_CHARACTER_TUTORIAL_STEP",
                     0x2fcf);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005f0f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fcf);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_CHARACTER_TUTORIAL_STEP",
                     0x2fcf);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005f200(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd0);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,param_5[1]);
  FUN_1401a2620(local_30,param_5 + 2);
  FUN_1401a2620(local_30,param_5 + 6);
  FUN_14007c6e0(local_30,param_5[10]);
  FUN_14007c6e0(local_30,param_5[0xb]);
  FUN_14007c6e0(local_30,param_5[0xc]);
  FUN_140186dd0(local_30,param_5 + 0xd);
  FUN_140186dd0(local_30,param_5 + 0x15);
  FUN_140186dd0(local_30,param_5 + 0x2e);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_INQUIRY",0x2fd0);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005f370(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd0);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,param_6[1]);
  FUN_1401a2620(local_30,param_6 + 2);
  FUN_1401a2620(local_30,param_6 + 6);
  FUN_14007c6e0(local_30,param_6[10]);
  FUN_14007c6e0(local_30,param_6[0xb]);
  FUN_14007c6e0(local_30,param_6[0xc]);
  FUN_140186dd0(local_30,param_6 + 0xd);
  FUN_140186dd0(local_30,param_6 + 0x15);
  FUN_140186dd0(local_30,param_6 + 0x2e);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_INQUIRY",0x2fd0);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005f4f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd1);
  FUN_14003d020(local_30,*param_4);
  FUN_14003d020(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_TOTAL_CNT",0x2fd1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005f5e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd1);
  FUN_14003d020(local_30,*param_5);
  FUN_14003d020(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_TOTAL_CNT",0x2fd1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005f6e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd2);
  FUN_14003d020(local_30,*param_4);
  FUN_14003d020(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_LOAD_INFO",0x2fd2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005f7d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd2);
  FUN_14003d020(local_30,*param_5);
  FUN_14003d020(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_LOAD_INFO",0x2fd2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005f8d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8,
             undefined2 *param_9,undefined2 *param_10)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd3);
  FUN_14003d020(local_30,*param_4);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_14003d020(local_30,*param_9);
  FUN_14003d020(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INVEN_SLOT",0x2fd3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005fa20(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *param_6,undefined4 *param_7,undefined8 param_8,
             undefined8 param_9,undefined2 *param_10,undefined2 *param_11)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd3);
  FUN_14003d020(local_30,*param_5);
  FUN_14003d020(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_1401a2620(local_30,param_8);
  FUN_1401a2620(local_30,param_9);
  FUN_14003d020(local_30,*param_10);
  FUN_14003d020(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_INVEN_SLOT",0x2fd3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005fb80(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd4);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,param_5[1]);
  FUN_14007c6e0(local_30,param_5[2]);
  FUN_1401a2620(local_30,param_5 + 3);
  FUN_1401a2620(local_30,param_5 + 7);
  FUN_1401a2620(local_30,param_5 + 0xb);
  FUN_140080030(local_30,param_5 + 0x17);
  FUN_140186dd0(local_30,param_5 + 0xf);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_GUILD_STORAGE_ITEM",0x2fd4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005fcd0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd4);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,param_6[1]);
  FUN_14007c6e0(local_30,param_6[2]);
  FUN_1401a2620(local_30,param_6 + 3);
  FUN_1401a2620(local_30,param_6 + 7);
  FUN_1401a2620(local_30,param_6 + 0xb);
  FUN_140080030(local_30,param_6 + 0x17);
  FUN_140186dd0(local_30,param_6 + 0xf);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_GUILD_STORAGE_ITEM",0x2fd4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005fe30(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd5);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_EXTERN_CASH_BALANCE",0x2fd5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14005ff30(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd5);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_EXTERN_CASH_BALANCE",0x2fd5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140060040(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd6);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_DAY_PARTY_MISSION",0x2fd6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140060140(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd6);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_DAY_PARTY_MISSION",0x2fd6
                    );
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140060250(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd7);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_ACCOUNT_STORAGE_ITEM",0x2fd7)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140060350(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd7);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_ACCOUNT_STORAGE_ITEM",
                     0x2fd7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140060460(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd8);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_140080030(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_ACCOUNT_STORAGE_ITEM",
                     0x2fd8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140060560(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd8);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140080030(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_ACCOUNT_STORAGE_ITEM",
                     0x2fd8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140060670(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd9);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_140080030(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CREATE_ACCOUNT_STORAGE_ITEM",
                     0x2fd9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140060780(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fd9);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_140080030(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CREATE_ACCOUNT_STORAGE_ITEM",
                     0x2fd9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400608a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fda);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DELETE_ACCOUNT_STORAGE_ITEM",
                     0x2fda);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400609a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fda);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_DELETE_ACCOUNT_STORAGE_ITEM",
                     0x2fda);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140060ab0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fdb);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_SKILL",0x2fdb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140060bb0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fdb);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_SKILL",0x2fdb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140060cc0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fdc);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_UNI_ACCOUNT_INFO",0x2fdc);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140060e00(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fdc);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_14007c6e0(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_UNI_ACCOUNT_INFO",0x2fdc)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140060f50(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fdd);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_UNI_ACCOUNT_PLAYTIME",
                     0x2fdd);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140061050(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fdd);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_UPDATE_UNI_ACCOUNT_PLAYTIME",
                     0x2fdd);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140061160(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined1 *param_6,undefined4 *param_7,undefined1 *param_8)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fde);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,param_5[1]);
  FUN_1401a2620(local_30,param_5 + 2);
  FUN_14003c9e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_6 + 1));
  FUN_14007c6e0(local_30,*(undefined4 *)(param_6 + 5));
  FUN_1401a2620(local_30,param_6 + 9);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14003c9e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_SKILL_LEARN",0x2fde);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400612d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined1 *param_7,undefined4 *param_8,
             undefined1 *param_9)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fde);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,param_6[1]);
  FUN_1401a2620(local_30,param_6 + 2);
  FUN_14003c9e0(local_30,*param_7);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_7 + 1));
  FUN_14007c6e0(local_30,*(undefined4 *)(param_7 + 5));
  FUN_1401a2620(local_30,param_7 + 9);
  FUN_14007c6e0(local_30,*param_8);
  FUN_14003c9e0(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_SKILL_LEARN",0x2fde);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140061450(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fdf);
  FUN_14003d020(local_30,*param_4);
  FUN_1401a2620(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_SKILL_LIST",0x2fdf);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140061540(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fdf);
  FUN_14003d020(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_SKILL_LIST",0x2fdf);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140061630(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined1 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fe0);
  FUN_14003d020(local_30,*param_4);
  FUN_14003c9e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_5 + 1));
  FUN_14007c6e0(local_30,*(undefined4 *)(param_5 + 5));
  FUN_14007c6e0(local_30,*(undefined4 *)(param_5 + 9));
  FUN_14007c6e0(local_30,*(undefined4 *)(param_5 + 0xd));
  FUN_14007c6e0(local_30,*(undefined4 *)(param_5 + 0x11));
  FUN_1401a2620(local_30,param_5 + 0x15);
  FUN_1401a2620(local_30,param_5 + 0x25);
  FUN_140186dd0(local_30,param_5 + 0x35);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_SKILL_LOG",0x2fe0);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140061790(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fe0);
  FUN_14003d020(local_30,*param_5);
  FUN_14003c9e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_6 + 1));
  FUN_14007c6e0(local_30,*(undefined4 *)(param_6 + 5));
  FUN_14007c6e0(local_30,*(undefined4 *)(param_6 + 9));
  FUN_14007c6e0(local_30,*(undefined4 *)(param_6 + 0xd));
  FUN_14007c6e0(local_30,*(undefined4 *)(param_6 + 0x11));
  FUN_1401a2620(local_30,param_6 + 0x15);
  FUN_1401a2620(local_30,param_6 + 0x25);
  FUN_140186dd0(local_30,param_6 + 0x35);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_GUILD_SKILL_LOG",0x2fe0);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140061900(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined2 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fe1);
  FUN_14007c6e0(local_30,*param_4);
  FUN_140186cf0(local_30,param_5);
  FUN_14003d020(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SECOND_PASS",0x2fe1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140061a00(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined2 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fe1);
  FUN_14007c6e0(local_30,*param_5);
  FUN_140186cf0(local_30,param_6);
  FUN_14003d020(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_SECOND_PASS",0x2fe1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140061b10(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fe2);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_140186cf0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SET_SECOND_PASS",0x2fe2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140061c20(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fe2);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_140186cf0(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_SET_SECOND_PASS",0x2fe2);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140061d40(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6,undefined2 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fe3);
  FUN_1401a2620(local_30,param_4);
  FUN_140186d90(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14003d020(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_CASH",0x2fe3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140061e50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7,undefined2 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fe3);
  FUN_1401a2620(local_30,param_5);
  FUN_140186d90(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14003d020(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_CASH",0x2fe3);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140061f70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined2 *param_6,undefined8 param_7,undefined4 *param_8,
             undefined8 param_9,undefined8 param_10,undefined8 param_11)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fe4);
  FUN_14003d020(local_30,*param_4);
  FUN_140186cf0(local_30,param_5);
  FUN_14003d020(local_30,*param_6);
  FUN_140186d90(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  FUN_140186cf0(local_30,param_9);
  FUN_140186cf0(local_30,param_10);
  FUN_140186cf0(local_30,param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_AUTH_LOGIN",0x2fe4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1400620d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined2 *param_7,undefined8 param_8,
             undefined4 *param_9,undefined8 param_10,undefined8 param_11,undefined8 param_12)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fe4);
  FUN_14003d020(local_30,*param_5);
  FUN_140186cf0(local_30,param_6);
  FUN_14003d020(local_30,*param_7);
  FUN_140186d90(local_30,param_8);
  FUN_14007c6e0(local_30,*param_9);
  FUN_140186cf0(local_30,param_10);
  FUN_140186cf0(local_30,param_11);
  FUN_140186cf0(local_30,param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOG_AUTH_LOGIN",0x2fe4);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140062240(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fe5);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SET_TIME_SKILLRESET",0x2fe5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140062350(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fe5);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_SET_TIME_SKILLRESET",0x2fe5);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140062470(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fe6);
  FUN_14003d020(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_1401a2620(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DELETE_SKILL_ALL",0x2fe6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140062570(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x2fe6);
  FUN_14003d020(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_1401a2620(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_DELETE_SKILL_ALL",0x2fe6);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}


/*
Unable to decompile 'FUN_140062680'
Cause: Exception while decompiling 140062680: process: timeout

*/


// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl std::bad_alloc::`scalar deleting destructor'(unsigned
// int) __ptr64
// 
// Libraries: Visual Studio 2012 Release, Visual Studio 2015 Release

void * __thiscall std::bad_alloc::_scalar_deleting_destructor_(bad_alloc *this,uint param_1)

{
  *(undefined ***)this = RNP::Dbc2ServersStub::vftable;
  FUN_14018a150();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_140070db0(undefined8 *param_1)

{
  *param_1 = RNP::Dbc2ServersStub::vftable;
  FUN_14018a150();
  return;
}



void FUN_140070dc0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  FUN_1400031d0(param_3);
  FUN_1400031d0(param_4);
  return;
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl std::bad_alloc::`scalar deleting destructor'(unsigned
// int) __ptr64
// 
// Libraries: Visual Studio 2012 Release, Visual Studio 2015 Release

void * __thiscall std::bad_alloc::_scalar_deleting_destructor_(bad_alloc *this,uint param_1)

{
  *(undefined ***)this = RNP::Servers2DbcProxy::vftable;
  FUN_140186ed0();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_140070e30(undefined8 *param_1)

{
  *param_1 = RNP::Servers2DbcProxy::vftable;
  FUN_140186ed0();
  return;
}



void FUN_140070e40(undefined8 *param_1)

{
  int *piVar1;
  undefined *puVar2;
  DWORD DVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined8 uVar7;
  undefined *puVar8;
  uint local_res10 [2];
  undefined *local_res18;
  
  if ((DAT_140320f58 & 1) == 0) {
    DAT_140320f58 = DAT_140320f58 | 1;
    FUN_1401e3190();
    atexit((_func_5014 *)&LAB_140202490);
  }
  if (DAT_1403203b0 != 1000) {
    if ((DAT_140320f5c & 1) == 0) {
      DAT_140320f5c = DAT_140320f5c | 1;
      FUN_1401e4310();
      atexit((_func_5014 *)&LAB_140202480);
    }
    if (DAT_140320610 != 1000) {
      return;
    }
  }
  if (param_1[2] != 0) {
    DVar3 = timeGetTime();
    local_res10[0] = DVar3 - *(int *)(param_1 + 1);
    if (200 < local_res10[0]) {
      uVar7 = *param_1;
      FUN_1400a3440();
      local_res18 = PTR_DAT_1402f8008;
      iVar4 = FUN_1400a3360(uVar7);
      if (local_res18 == (undefined *)0x0) {
        iVar6 = 0;
      }
      else if (local_res18 == PTR_DAT_1402f8008) {
        iVar6 = 0;
      }
      else {
        iVar6 = *(int *)(local_res18 + -8);
      }
      iVar5 = iVar4;
      if (iVar4 <= iVar6) {
        if (local_res18 == (undefined *)0x0) {
          iVar5 = 0;
        }
        else if (local_res18 == PTR_DAT_1402f8008) {
          iVar5 = 0;
        }
        else {
          iVar5 = *(int *)(local_res18 + -8);
        }
      }
      iVar6 = 1;
      if (1 < iVar5) {
        iVar6 = iVar5;
      }
      if (local_res18 == (undefined *)0x0) {
        iVar5 = 0;
      }
      else if (local_res18 == PTR_DAT_1402f8008) {
        iVar5 = 0;
      }
      else {
        iVar5 = *(int *)(local_res18 + -8);
      }
      if (iVar5 < iVar6) {
        FUN_14000c1c0(&local_res18);
      }
      FUN_14000c330(&local_res18);
      puVar8 = local_res18;
      if (local_res18 == (undefined *)0x0) {
        puVar8 = PTR_DAT_1402f8008;
      }
      FUN_1400a3390(puVar8,uVar7,iVar4);
      iVar6 = FUN_1400a3360();
      iVar4 = 0;
      if (0 < iVar6) {
        iVar4 = iVar6;
      }
      if (local_res18 == (undefined *)0x0) {
        iVar6 = 0;
      }
      else if (local_res18 == PTR_DAT_1402f8008) {
        iVar6 = 0;
      }
      else {
        iVar6 = *(int *)(local_res18 + -8);
      }
      if (iVar6 <= iVar4) {
        if (local_res18 == (undefined *)0x0) {
          iVar4 = 0;
        }
        else if (local_res18 == PTR_DAT_1402f8008) {
          iVar4 = 0;
        }
        else {
          iVar4 = *(int *)(local_res18 + -8);
        }
      }
      if (((local_res18 != PTR_DAT_1402f8008) && (local_res18 != (undefined *)0x0)) &&
         (piVar1 = (int *)(local_res18 + -8), piVar1 != (int *)0x0)) {
        *piVar1 = iVar4;
        *(undefined1 *)((longlong)iVar4 + 8 + (longlong)piVar1) = 0;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x960))
                ((longlong *)param_1[2],1,&DAT_14030ab90,&local_res18,local_res10);
      puVar8 = local_res18;
      if (((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1402f8008)) &&
         (puVar2 = local_res18 + -8, puVar2 != (undefined *)0x0)) {
        uVar7 = FUN_1400a3440();
        FUN_1400a1c30(uVar7);
        piVar1 = (int *)(puVar8 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar2);
        }
        FUN_1400d1290(uVar7);
      }
    }
  }
  return;
}



void FUN_140071090(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar2 = *param_1;
  if (lVar2 != 0) {
    lVar1 = param_1[1];
    for (; lVar2 != lVar1; lVar2 = lVar2 + 8) {
      FUN_1400031d0(lVar2);
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_1400710f0(undefined8 *param_1)

{
  if ((void *)*param_1 != (void *)0x0) {
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



undefined8 FUN_140071120(undefined8 param_1,longlong *param_2)

{
  longlong lVar1;
  
  FUN_14007c6e0(param_1,(param_2[1] - *param_2) / 0x44);
  lVar1 = *param_2;
  if (lVar1 != param_2[1]) {
    do {
      FUN_1401a2620(param_1,lVar1);
      FUN_14007c6e0(param_1,*(undefined4 *)(lVar1 + 0x10));
      FUN_14007c6e0(param_1,*(undefined4 *)(lVar1 + 0x14));
      FUN_14007c6e0(param_1,*(undefined4 *)(lVar1 + 0x18));
      FUN_14007c6e0(param_1,*(undefined4 *)(lVar1 + 0x1c));
      FUN_14007c6e0(param_1,*(undefined4 *)(lVar1 + 0x20));
      FUN_140186dd0(param_1,lVar1 + 0x24);
      lVar1 = lVar1 + 0x44;
    } while (lVar1 != param_2[1]);
  }
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x000140071252)
// WARNING: Removing unreachable block (ram,0x000140071260)

undefined8 FUN_1400711d0(undefined8 param_1,ulonglong *param_2)

{
  ulonglong uVar1;
  uint *puVar2;
  undefined8 *puVar3;
  uint uVar4;
  char cVar5;
  longlong lVar6;
  longlong lVar7;
  undefined4 uVar8;
  ulonglong uVar9;
  uint local_res8 [2];
  undefined4 local_res10 [2];
  undefined4 local_res18 [4];
  uint local_38;
  undefined4 uStack_34;
  undefined4 local_30;
  
  FUN_140185490(param_1,local_res8,4);
  uVar4 = local_res8[0];
  uVar9 = (ulonglong)local_res8[0];
  if (((int)local_res8[0] < 0) || (DAT_1402f8140 <= (int)local_res8[0])) {
    FUN_1401a2590(local_res8[0]);
  }
  FUN_140077b00(param_2,(longlong)(int)uVar4);
  uVar1 = *param_2;
  lVar6 = param_2[1] - uVar1;
  lVar7 = lVar6 >> 0x3f;
  if ((lVar6 / 0xc + lVar7 != lVar7) && (uVar1 != param_2[1])) {
    param_2[1] = uVar1;
  }
  if (0 < (int)uVar4) {
    do {
      cVar5 = FUN_140185490(param_1,local_res8,4);
      local_38 = 0;
      if (cVar5 != '\0') {
        local_38 = local_res8[0];
      }
      cVar5 = FUN_140185490(param_1,local_res10,4);
      uStack_34 = 0;
      if (cVar5 != '\0') {
        uStack_34 = local_res10[0];
      }
      cVar5 = FUN_140185490(param_1,local_res18,4);
      puVar2 = (uint *)param_2[1];
      uVar8 = 0;
      if (cVar5 != '\0') {
        uVar8 = local_res18[0];
      }
      local_30 = uVar8;
      if ((&local_38 < puVar2) && ((uint *)*param_2 <= &local_38)) {
        lVar7 = (longlong)&local_38 - (longlong)*param_2;
        lVar7 = lVar7 / 6 + (lVar7 >> 0x3f);
        lVar7 = (lVar7 >> 1) - (lVar7 >> 0x3f);
        if (puVar2 == (uint *)param_2[2]) {
          FUN_14007a6e0(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        uVar1 = *param_2;
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = *(undefined8 *)(uVar1 + lVar7 * 0xc);
          *(undefined4 *)(puVar3 + 1) = *(undefined4 *)(uVar1 + 8 + lVar7 * 0xc);
        }
      }
      else {
        if (puVar2 == (uint *)param_2[2]) {
          FUN_14007a6e0(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = CONCAT44(uStack_34,local_38);
          *(undefined4 *)(puVar3 + 1) = uVar8;
        }
      }
      param_2[1] = param_2[1] + 0xc;
      uVar9 = uVar9 - 1;
    } while (uVar9 != 0);
  }
  return param_1;
}



void FUN_1400713b0(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0xc,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x000140071512)
// WARNING: Removing unreachable block (ram,0x000140071520)

undefined8 FUN_140071480(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  longlong lVar4;
  uint uVar5;
  char cVar6;
  longlong lVar7;
  ulonglong uVar8;
  undefined1 auStack_78 [32];
  uint local_58 [2];
  undefined4 local_50;
  undefined4 uStack_4c;
  undefined4 local_48;
  undefined4 uStack_44;
  uint local_40;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_78;
  FUN_140185490(param_1,local_58,4);
  uVar5 = local_58[0];
  if (((int)local_58[0] < 0) || (DAT_1402f8140 <= (int)local_58[0])) {
    FUN_1401a2590(local_58[0]);
  }
  FUN_140076930(param_2,(longlong)(int)uVar5);
  uVar8 = *param_2;
  lVar7 = param_2[1] - uVar8;
  lVar4 = lVar7 >> 0x3f;
  if ((lVar7 / 0x14 + lVar4 != lVar4) && (uVar8 != param_2[1])) {
    param_2[1] = uVar8;
  }
  if (0 < (int)uVar5) {
    uVar8 = (ulonglong)uVar5;
    do {
      local_50 = 0;
      local_40 = 0;
      uStack_4c = 0;
      local_48 = 0;
      uStack_44 = 0;
      FUN_1401a2570(param_1,&local_50);
      cVar6 = FUN_140185490(param_1,local_58,4);
      puVar1 = (undefined4 *)param_2[1];
      if (cVar6 != '\0') {
        local_40 = local_58[0];
      }
      if ((&local_50 < puVar1) && ((undefined4 *)*param_2 <= &local_50)) {
        lVar4 = ((longlong)&local_50 - (longlong)*param_2) / 0x14;
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_140079fd0(param_2,1);
        }
        puVar2 = (undefined8 *)param_2[1];
        uVar3 = *param_2;
        if (puVar2 != (undefined8 *)0x0) {
          *puVar2 = *(undefined8 *)(uVar3 + lVar4 * 0x14);
          puVar2[1] = *(undefined8 *)(uVar3 + 8 + lVar4 * 0x14);
          *(undefined4 *)(puVar2 + 2) = *(undefined4 *)(uVar3 + 0x10 + lVar4 * 0x14);
        }
      }
      else {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_140079fd0(param_2,1);
        }
        puVar2 = (undefined8 *)param_2[1];
        if (puVar2 != (undefined8 *)0x0) {
          *puVar2 = CONCAT44(uStack_4c,local_50);
          puVar2[1] = CONCAT44(uStack_44,local_48);
          *(uint *)(puVar2 + 2) = local_40;
        }
      }
      param_2[1] = param_2[1] + 0x14;
      uVar8 = uVar8 - 1;
    } while (uVar8 != 0);
  }
  return param_1;
}



void FUN_1400716a0(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x14,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140071770(undefined8 param_1,ulonglong *param_2)

{
  undefined8 *puVar1;
  void *_Dst;
  ulonglong uVar2;
  undefined8 *puVar3;
  undefined1 auStack_108 [32];
  uint local_e8 [4];
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined2 local_c0;
  undefined8 local_be;
  undefined2 local_b6;
  undefined8 local_b4;
  undefined8 local_ac;
  undefined8 local_a4;
  undefined4 local_9c;
  undefined2 local_98;
  undefined8 local_96;
  undefined8 local_8e;
  undefined8 local_86;
  undefined2 local_7e;
  undefined1 local_7c;
  undefined8 local_7b;
  undefined8 local_73;
  undefined2 local_6b;
  undefined8 local_69;
  undefined8 local_61;
  undefined8 local_59;
  undefined8 local_51;
  undefined8 local_49;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  FUN_140185490(param_1,local_e8,4);
  if (((int)local_e8[0] < 0) || (DAT_1402f8140 <= (int)local_e8[0])) {
    FUN_1401a2590(local_e8[0]);
  }
  FUN_140076a70(param_2,(longlong)(int)local_e8[0]);
  FUN_140076bb0(param_2);
  if (0 < (int)local_e8[0]) {
    uVar2 = (ulonglong)local_e8[0];
    do {
      local_69 = 0;
      local_d8 = 0;
      local_d0 = 0;
      local_61 = 0;
      local_c8 = 0;
      local_c0 = 0;
      local_be = 0;
      local_73 = 0;
      local_b6 = 0;
      local_b4 = 0;
      local_ac = 0;
      local_a4 = 0;
      local_9c = 0;
      local_98 = 0;
      local_96 = 0;
      local_8e = 0;
      local_86 = 0;
      local_7e = 0;
      local_7c = 0;
      local_7b = 0;
      local_6b = 0;
      local_59 = 0;
      local_51 = 0;
      local_49 = 0;
      FUN_140080220(param_1,&local_d8);
      puVar3 = (undefined8 *)param_2[1];
      if ((&local_d8 < puVar3) && (puVar1 = (undefined8 *)*param_2, puVar1 <= &local_d8)) {
        if (puVar3 == (undefined8 *)param_2[2]) {
          FUN_14007a080(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined8 *)((((longlong)&local_d8 - (longlong)puVar1) / 0x97) * 0x97 + *param_2)
        ;
        if (_Dst != (void *)0x0) {
LAB_140071925:
          memcpy(_Dst,puVar3,0x97);
        }
      }
      else {
        if (puVar3 == (undefined8 *)param_2[2]) {
          FUN_14007a080(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_d8;
          goto LAB_140071925;
        }
      }
      param_2[1] = param_2[1] + 0x97;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_140071980(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x97,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140071a50(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  undefined8 *puVar3;
  char cVar4;
  undefined8 uVar5;
  undefined2 uVar6;
  uint uVar7;
  undefined8 *puVar8;
  ulonglong uVar9;
  undefined1 auStack_88 [32];
  undefined1 local_68 [4];
  undefined2 local_64 [2];
  uint local_60;
  undefined2 local_5c [2];
  uint local_58 [2];
  undefined4 local_50;
  undefined4 uStack_4c;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined8 local_40;
  undefined2 local_38;
  undefined1 local_36;
  ulonglong local_30;
  
  local_30 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  cVar4 = FUN_140185490(param_1,&local_60,4);
  uVar7 = local_58[0];
  if (cVar4 != '\0') {
    uVar7 = local_60;
  }
  if (((int)uVar7 < 0) || (DAT_1402f8140 <= (int)uVar7)) {
    FUN_1401a2590(uVar7);
  }
  FUN_140076c40(param_2,(longlong)(int)uVar7);
  FUN_140076d70(param_2);
  if (0 < (int)uVar7) {
    uVar9 = (ulonglong)uVar7;
    do {
      local_50 = 0;
      local_40 = 0;
      uStack_4c = 0;
      local_38 = 0;
      local_48 = 0;
      local_36 = 1;
      uStack_44 = 0;
      uVar5 = FUN_1401a2570(param_1,&local_50);
      cVar4 = FUN_140185490(uVar5,local_5c,2);
      uVar6 = (undefined2)local_40;
      if (cVar4 != '\0') {
        uVar6 = local_5c[0];
      }
      local_40 = CONCAT62(local_40._2_6_,uVar6);
      cVar4 = FUN_140185490(uVar5,local_64,2);
      uVar6 = local_40._2_2_;
      if (cVar4 != '\0') {
        uVar6 = local_64[0];
      }
      local_40._0_4_ = CONCAT22(uVar6,(undefined2)local_40);
      cVar4 = FUN_140185490(uVar5,local_58,4);
      if (cVar4 != '\0') {
        local_40._4_4_ = local_58[0];
      }
      cVar4 = FUN_140185490(uVar5,&local_60,2);
      if (cVar4 != '\0') {
        local_38 = (undefined2)local_60;
      }
      cVar4 = FUN_140185490(uVar5,local_68,1);
      puVar1 = (undefined4 *)param_2[1];
      if (cVar4 != '\0') {
        local_36 = local_68[0];
      }
      if ((&local_50 < puVar1) && (puVar2 = (undefined4 *)*param_2, puVar2 <= &local_50)) {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007a130(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        puVar8 = (undefined8 *)((((longlong)&local_50 - (longlong)puVar2) / 0x1b) * 0x1b + *param_2)
        ;
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = *puVar8;
          puVar3[1] = puVar8[1];
          puVar3[2] = puVar8[2];
          *(undefined2 *)(puVar3 + 3) = *(undefined2 *)(puVar8 + 3);
          *(undefined1 *)((longlong)puVar3 + 0x1a) = *(undefined1 *)((longlong)puVar8 + 0x1a);
        }
      }
      else {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007a130(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = CONCAT44(uStack_4c,local_50);
          puVar3[1] = CONCAT44(uStack_44,local_48);
          puVar3[2] = local_40;
          *(undefined2 *)(puVar3 + 3) = local_38;
          *(undefined1 *)((longlong)puVar3 + 0x1a) = local_36;
        }
      }
      param_2[1] = param_2[1] + 0x1b;
      uVar9 = uVar9 - 1;
    } while (uVar9 != 0);
  }
  return param_1;
}



void FUN_140071cc0(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x1b,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



undefined8 FUN_140071d80(undefined8 param_1,ulonglong *param_2)

{
  void *_Src;
  void *_Dst;
  uint *puVar1;
  uint *puVar2;
  char cVar3;
  uint uVar4;
  ulonglong uVar5;
  uint local_res10 [2];
  uint local_res18 [2];
  
  FUN_140185490(param_1,local_res10,4);
  uVar4 = local_res10[0];
  if (((int)local_res10[0] < 0) || (DAT_1402f8140 <= (int)local_res10[0])) {
    FUN_1401a2590(local_res10[0]);
  }
  FUN_140076df0(param_2,(longlong)(int)uVar4);
  _Src = (void *)param_2[1];
  _Dst = (void *)*param_2;
  if (((longlong)_Src - (longlong)_Dst >> 2 != 0) && (_Dst != _Src)) {
    memmove(_Dst,_Src,0);
    param_2[1] = (ulonglong)_Dst;
  }
  if (0 < (int)uVar4) {
    uVar5 = (ulonglong)uVar4;
    uVar4 = local_res10[0];
    do {
      cVar3 = FUN_140185490(param_1,local_res18,4);
      puVar1 = (uint *)param_2[1];
      if (cVar3 != '\0') {
        uVar4 = local_res18[0];
      }
      if ((local_res10 < puVar1) && (puVar2 = (uint *)*param_2, puVar2 <= local_res10)) {
        if (puVar1 == (uint *)param_2[2]) {
          FUN_14007a1d0(param_2,1);
        }
        if ((undefined4 *)param_2[1] != (undefined4 *)0x0) {
          *(undefined4 *)param_2[1] =
               *(undefined4 *)(*param_2 + ((longlong)local_res10 - (longlong)puVar2 >> 2) * 4);
        }
      }
      else {
        if (puVar1 == (uint *)param_2[2]) {
          FUN_14007a1d0(param_2,1);
        }
        if ((uint *)param_2[1] != (uint *)0x0) {
          *(uint *)param_2[1] = uVar4;
        }
      }
      param_2[1] = param_2[1] + 4;
      uVar5 = uVar5 - 1;
    } while (uVar5 != 0);
  }
  return param_1;
}



void FUN_140071ed0(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",param_2[1] - *param_2 >> 2,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140071f80(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  undefined8 *puVar5;
  undefined1 auStack_a8 [32];
  uint local_88 [2];
  undefined4 local_80;
  undefined4 uStack_7c;
  undefined4 local_78;
  undefined4 uStack_74;
  undefined8 local_70;
  undefined2 local_68;
  undefined6 uStack_66;
  undefined2 uStack_60;
  undefined6 uStack_5e;
  undefined2 uStack_58;
  undefined4 local_56;
  undefined2 local_52;
  undefined6 uStack_50;
  undefined2 local_4a;
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_a8;
  FUN_140185490(param_1,local_88,4);
  if (((int)local_88[0] < 0) || (DAT_1402f8140 <= (int)local_88[0])) {
    FUN_1401a2590(local_88[0]);
  }
  FUN_140076f40(param_2,(longlong)(int)local_88[0]);
  FUN_140077080(param_2);
  if (0 < (int)local_88[0]) {
    uVar4 = (ulonglong)local_88[0];
    do {
      local_52 = 0;
      uStack_50 = 0;
      local_80 = 0;
      local_70 = 0;
      uStack_7c = 0;
      local_68 = 0;
      local_78 = 0;
      uStack_66 = 0;
      uStack_60 = 0;
      uStack_5e = 0;
      uStack_58 = 0;
      local_56 = 0;
      local_4a = 0;
      uStack_74 = 0;
      FUN_1400833a0(param_1,&local_80);
      puVar1 = (undefined4 *)param_2[1];
      if ((&local_80 < puVar1) && (puVar2 = (undefined4 *)*param_2, puVar2 <= &local_80)) {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007a2c0(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        puVar5 = (undefined8 *)((((longlong)&local_80 - (longlong)puVar2) / 0x38) * 0x38 + *param_2)
        ;
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = *puVar5;
          puVar3[1] = puVar5[1];
          puVar3[2] = puVar5[2];
          puVar3[3] = puVar5[3];
          puVar3[4] = puVar5[4];
          puVar3[5] = puVar5[5];
          puVar3[6] = puVar5[6];
        }
      }
      else {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007a2c0(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = CONCAT44(uStack_7c,local_80);
          puVar3[1] = CONCAT44(uStack_74,local_78);
          puVar3[2] = local_70;
          puVar3[3] = CONCAT62(uStack_66,local_68);
          puVar3[4] = CONCAT62(uStack_5e,uStack_60);
          puVar3[5] = CONCAT26(local_52,CONCAT42(local_56,uStack_58));
          puVar3[6] = CONCAT26(local_4a,uStack_50);
        }
      }
      param_2[1] = param_2[1] + 0x38;
      uVar4 = uVar4 - 1;
    } while (uVar4 != 0);
  }
  return param_1;
}



void FUN_1400721b0(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x38,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140072280(undefined8 param_1,ulonglong *param_2)

{
  undefined1 *puVar1;
  void *_Dst;
  ulonglong uVar2;
  undefined1 *puVar3;
  undefined1 auStack_188 [32];
  uint local_168 [4];
  undefined1 local_158 [304];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_188;
  FUN_140185490(param_1,local_168,4);
  if (((int)local_168[0] < 0) || (DAT_1402f8140 <= (int)local_168[0])) {
    FUN_1401a2590(local_168[0]);
  }
  FUN_140077110(param_2,(longlong)(int)local_168[0]);
  FUN_140077250(param_2);
  if (0 < (int)local_168[0]) {
    uVar2 = (ulonglong)local_168[0];
    do {
      FUN_14007c590(local_158);
      FUN_14007c990(param_1,local_158);
      puVar3 = (undefined1 *)param_2[1];
      if ((local_158 < puVar3) && (puVar1 = (undefined1 *)*param_2, puVar1 <= local_158)) {
        if (puVar3 == (undefined1 *)param_2[2]) {
          FUN_14007a370(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined1 *)
                 (((longlong)(local_158 + -(longlong)puVar1) / 0x122) * 0x122 + *param_2);
        if (_Dst != (void *)0x0) {
LAB_1400723ad:
          memcpy(_Dst,puVar3,0x122);
        }
      }
      else {
        if (puVar3 == (undefined1 *)param_2[2]) {
          FUN_14007a370(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = local_158;
          goto LAB_1400723ad;
        }
      }
      param_2[1] = param_2[1] + 0x122;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_140072400(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x122,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400724d0(undefined8 param_1,ulonglong *param_2)

{
  undefined2 *puVar1;
  undefined2 *puVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  undefined8 *puVar5;
  undefined1 auStack_98 [32];
  uint local_78 [2];
  undefined2 local_70;
  undefined6 uStack_6e;
  undefined2 uStack_68;
  undefined6 uStack_66;
  undefined2 uStack_60;
  undefined6 local_5e;
  undefined2 uStack_58;
  undefined6 local_56;
  undefined2 uStack_50;
  undefined2 local_4e;
  undefined4 local_4c;
  undefined4 uStack_48;
  undefined4 local_44;
  undefined4 uStack_40;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_98;
  FUN_140185490(param_1,local_78,4);
  if (((int)local_78[0] < 0) || (DAT_1402f8140 <= (int)local_78[0])) {
    FUN_1401a2590(local_78[0]);
  }
  FUN_1400772e0(param_2,(longlong)(int)local_78[0]);
  FUN_140077420(param_2);
  if (0 < (int)local_78[0]) {
    uVar4 = (ulonglong)local_78[0];
    do {
      local_70 = 0;
      local_4e = 0;
      local_4c = 0;
      uStack_48 = 0;
      local_44 = 0;
      uStack_40 = 0;
      uStack_6e = 0;
      uStack_68 = 0;
      uStack_66 = 0;
      uStack_60 = 0;
      local_5e = 0;
      uStack_58 = 0;
      local_56 = 0;
      uStack_50 = 0;
      FUN_14007d740(param_1,&local_70);
      puVar1 = (undefined2 *)param_2[1];
      if ((&local_70 < puVar1) && (puVar2 = (undefined2 *)*param_2, puVar2 <= &local_70)) {
        if (puVar1 == (undefined2 *)param_2[2]) {
          FUN_14007a420(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        puVar5 = (undefined8 *)((((longlong)&local_70 - (longlong)puVar2) / 0x34) * 0x34 + *param_2)
        ;
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = *puVar5;
          puVar3[1] = puVar5[1];
          puVar3[2] = puVar5[2];
          puVar3[3] = puVar5[3];
          puVar3[4] = puVar5[4];
          puVar3[5] = puVar5[5];
          *(undefined4 *)(puVar3 + 6) = *(undefined4 *)(puVar5 + 6);
        }
      }
      else {
        if (puVar1 == (undefined2 *)param_2[2]) {
          FUN_14007a420(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = CONCAT62(uStack_6e,local_70);
          puVar3[1] = CONCAT62(uStack_66,uStack_68);
          puVar3[2] = CONCAT62(local_5e,uStack_60);
          puVar3[3] = CONCAT62(local_56,uStack_58);
          puVar3[4] = CONCAT44(local_4c,CONCAT22(local_4e,uStack_50));
          puVar3[5] = CONCAT44(local_44,uStack_48);
          *(undefined4 *)(puVar3 + 6) = uStack_40;
        }
      }
      param_2[1] = param_2[1] + 0x34;
      uVar4 = uVar4 - 1;
    } while (uVar4 != 0);
  }
  return param_1;
}



void FUN_1400726c0(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x34,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140072790(undefined8 param_1,ulonglong *param_2)

{
  undefined8 *puVar1;
  void *_Dst;
  ulonglong uVar2;
  undefined8 *puVar3;
  undefined1 auStack_f8 [32];
  uint local_d8 [4];
  undefined8 local_c8;
  undefined8 uStack_c0;
  undefined8 local_b8;
  undefined8 uStack_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined4 local_88;
  undefined1 local_84 [64];
  undefined4 local_44;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_f8;
  FUN_140185490(param_1,local_d8,4);
  if (((int)local_d8[0] < 0) || (DAT_1402f8140 <= (int)local_d8[0])) {
    FUN_1401a2590(local_d8[0]);
  }
  FUN_1400774b0(param_2);
  FUN_1400775f0(param_2);
  if (0 < (int)local_d8[0]) {
    uVar2 = (ulonglong)local_d8[0];
    do {
      local_44 = 0;
      local_c8 = 0;
      uStack_c0 = 0;
      local_b8 = 0;
      uStack_b0 = 0;
      local_a8 = 0;
      local_a0 = 0;
      local_98 = 0;
      local_90 = 0;
      local_88 = 0;
      memset(local_84,0,0x40);
      FUN_14007d890(param_1);
      puVar3 = (undefined8 *)param_2[1];
      if ((&local_c8 < puVar3) && (puVar1 = (undefined8 *)*param_2, puVar1 <= &local_c8)) {
        if (puVar3 == (undefined8 *)param_2[2]) {
          FUN_14007a4d0(param_2);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined8 *)((((longlong)&local_c8 - (longlong)puVar1) / 0x88) * 0x88 + *param_2)
        ;
        if (_Dst != (void *)0x0) {
LAB_1400728e8:
          memcpy(_Dst,puVar3,0x88);
        }
      }
      else {
        if (puVar3 == (undefined8 *)param_2[2]) {
          FUN_14007a4d0(param_2);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_c8;
          goto LAB_1400728e8;
        }
      }
      param_2[1] = param_2[1] + 0x88;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_140072940(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x88,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140072a10(undefined8 param_1,undefined8 param_2)

{
  ulonglong uVar1;
  undefined1 auStack_3a8 [32];
  uint local_388 [4];
  undefined8 local_378;
  undefined8 uStack_370;
  undefined8 local_368;
  undefined8 uStack_360;
  undefined8 local_358;
  undefined8 local_350;
  undefined8 local_348;
  undefined8 local_340;
  undefined8 local_338;
  undefined8 local_330;
  undefined8 local_328;
  undefined8 local_320;
  undefined1 local_318 [700];
  undefined4 local_5c;
  undefined2 local_58;
  undefined4 local_56;
  undefined2 local_52;
  undefined8 local_50;
  undefined2 local_48;
  undefined4 local_46;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_3a8;
  FUN_140185490(param_1,local_388,4);
  uVar1 = (ulonglong)local_388[0];
  if (((int)local_388[0] < 0) || (DAT_1402f8140 <= (int)local_388[0])) {
    FUN_1401a2590(local_388[0]);
  }
  FUN_140077680(param_2);
  FUN_1400777c0(param_2);
  if (0 < (int)local_388[0]) {
    do {
      local_5c = 0;
      local_50 = 0;
      local_378 = 0;
      uStack_370 = 0;
      local_368 = 0;
      uStack_360 = 0;
      local_58 = 0;
      local_56 = 0;
      local_52 = 0;
      local_48 = 0;
      local_46 = 0;
      local_358 = 0;
      local_350 = 0;
      local_348 = 0;
      local_340 = 0;
      local_338 = 0;
      local_330 = 0;
      local_328 = 0;
      local_320 = 0;
      memset(local_318,0,700);
      FUN_140080b00(param_1,&local_378);
      FUN_140077850(param_2);
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0);
  }
  return param_1;
}



void FUN_140072b80(undefined8 param_1,longlong *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  longlong lVar4;
  longlong lVar5;
  undefined *local_res10 [3];
  undefined8 uVar6;
  
  uVar6 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  lVar5 = param_2[1] - *param_2;
  lVar4 = SUB168(SEXT816(-0x608b85ead287c92f) * SEXT816(lVar5),8) + lVar5;
  FUN_14003c600(local_res10,L"<Array %d>",(lVar4 >> 9) - (lVar4 >> 0x3f),lVar5,uVar6);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar6 = FUN_1400a3440();
    FUN_1400a1c30(uVar6);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar6);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140072c50(undefined8 param_1,ulonglong *param_2)

{
  undefined8 *puVar1;
  void *_Dst;
  ulonglong uVar2;
  undefined8 *puVar3;
  undefined1 auStack_108 [32];
  uint local_e8 [4];
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined2 local_b0;
  undefined8 local_ae;
  undefined2 local_a6;
  undefined8 local_a4;
  undefined8 local_9c;
  undefined8 local_94;
  undefined4 local_8c;
  undefined2 local_88;
  undefined8 local_86;
  undefined8 local_7e;
  undefined8 local_76;
  undefined2 local_6e;
  undefined1 local_6c;
  undefined4 local_6b;
  undefined2 local_67;
  undefined8 local_61;
  undefined8 local_59;
  undefined8 local_51;
  undefined8 local_49;
  undefined8 local_41;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  FUN_140185490(param_1,local_e8,4);
  if (((int)local_e8[0] < 0) || (DAT_1402f8140 <= (int)local_e8[0])) {
    FUN_1401a2590(local_e8[0]);
  }
  FUN_140077930(param_2,(longlong)(int)local_e8[0]);
  FUN_140077a70(param_2);
  if (0 < (int)local_e8[0]) {
    uVar2 = (ulonglong)local_e8[0];
    do {
      local_49 = 0;
      local_d8 = 0;
      local_d0 = 0;
      local_c8 = 0;
      local_b8 = 0;
      local_b0 = 0;
      local_c0 = 0;
      local_41 = 0;
      local_ae = 0;
      local_a6 = 0;
      local_a4 = 0;
      local_9c = 0;
      local_94 = 0;
      local_8c = 0;
      local_88 = 0;
      local_86 = 0;
      local_7e = 0;
      local_76 = 0;
      local_6e = 0;
      local_6c = 0;
      local_6b = 0;
      local_67 = 0;
      local_61 = 0;
      local_59 = 0;
      local_51 = 0;
      FUN_140080dc0(param_1,&local_d8);
      puVar3 = (undefined8 *)param_2[1];
      if ((&local_d8 < puVar3) && (puVar1 = (undefined8 *)*param_2, puVar1 <= &local_d8)) {
        if (puVar3 == (undefined8 *)param_2[2]) {
          FUN_14007a630(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined8 *)((((longlong)&local_d8 - (longlong)puVar1) / 0x9f) * 0x9f + *param_2)
        ;
        if (_Dst != (void *)0x0) {
LAB_140072e09:
          memcpy(_Dst,puVar3,0x9f);
        }
      }
      else {
        if (puVar3 == (undefined8 *)param_2[2]) {
          FUN_14007a630(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_d8;
          goto LAB_140072e09;
        }
      }
      param_2[1] = param_2[1] + 0x9f;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_140072e60(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x9f,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140072fbb)
// WARNING: Removing unreachable block (ram,0x000140072fc0)

undefined8 FUN_140072f30(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  ulonglong uVar2;
  uint uVar3;
  char cVar4;
  undefined4 uVar5;
  undefined2 uVar6;
  longlong lVar7;
  undefined8 *puVar8;
  longlong lVar9;
  ulonglong uVar10;
  uint local_res8 [2];
  undefined2 local_res10 [4];
  undefined2 local_res18 [4];
  undefined2 local_res20 [4];
  undefined4 local_58 [2];
  undefined4 local_50;
  undefined2 uStack_4c;
  undefined2 uStack_4a;
  undefined4 local_48;
  
  FUN_140185490(param_1,local_res8,4);
  uVar3 = local_res8[0];
  if (((int)local_res8[0] < 0) || (DAT_1402f8140 <= (int)local_res8[0])) {
    FUN_1401a2590(local_res8[0]);
  }
  FUN_140077b00(param_2,(longlong)(int)uVar3);
  uVar10 = *param_2;
  lVar7 = param_2[1] - uVar10;
  lVar9 = lVar7 >> 0x3f;
  if ((lVar7 / 0xc + lVar9 != lVar9) && (uVar10 != param_2[1])) {
    param_2[1] = uVar10;
  }
  if (0 < (int)uVar3) {
    uVar10 = (ulonglong)uVar3;
    do {
      cVar4 = FUN_140185490(param_1,local_58,4);
      local_50 = 0;
      if (cVar4 != '\0') {
        local_50 = local_58[0];
      }
      cVar4 = FUN_140185490(param_1,local_res8,2);
      uStack_4c = 0;
      if (cVar4 != '\0') {
        uStack_4c = (undefined2)local_res8[0];
      }
      cVar4 = FUN_140185490(param_1,local_res10,2);
      uStack_4a = 0;
      if (cVar4 != '\0') {
        uStack_4a = local_res10[0];
      }
      cVar4 = FUN_140185490(param_1,local_res18,2);
      uVar6 = 0;
      if (cVar4 != '\0') {
        uVar6 = local_res18[0];
      }
      local_48 = CONCAT22(local_48._2_2_,uVar6);
      cVar4 = FUN_140185490(param_1,local_res20,2);
      puVar1 = (undefined4 *)param_2[1];
      uVar6 = 0;
      if (cVar4 != '\0') {
        uVar6 = local_res20[0];
      }
      local_48 = CONCAT22(uVar6,(undefined2)local_48);
      if ((&local_50 < puVar1) && ((undefined4 *)*param_2 <= &local_50)) {
        lVar9 = (longlong)&local_50 - (longlong)*param_2;
        lVar9 = lVar9 / 6 + (lVar9 >> 0x3f);
        lVar9 = (lVar9 >> 1) - (lVar9 >> 0x3f);
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007a6e0(param_2,1);
        }
        puVar8 = (undefined8 *)param_2[1];
        uVar2 = *param_2;
        if (puVar8 != (undefined8 *)0x0) {
          *puVar8 = *(undefined8 *)(uVar2 + lVar9 * 0xc);
          uVar5 = *(undefined4 *)(uVar2 + 8 + lVar9 * 0xc);
LAB_14007315b:
          *(undefined4 *)(puVar8 + 1) = uVar5;
        }
      }
      else {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007a6e0(param_2,1);
        }
        puVar8 = (undefined8 *)param_2[1];
        if (puVar8 != (undefined8 *)0x0) {
          *puVar8 = CONCAT26(uStack_4a,CONCAT24(uStack_4c,local_50));
          uVar5 = local_48;
          goto LAB_14007315b;
        }
      }
      param_2[1] = param_2[1] + 0xc;
      uVar10 = uVar10 - 1;
    } while (uVar10 != 0);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140073190(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  undefined8 *puVar3;
  char cVar4;
  ulonglong uVar5;
  uint uVar6;
  undefined8 *puVar7;
  undefined1 auStack_88 [32];
  uint local_68;
  uint local_64;
  undefined4 local_60 [2];
  undefined4 local_58;
  undefined4 uStack_54;
  undefined4 local_50;
  undefined4 uStack_4c;
  undefined8 local_48;
  uint local_40;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  cVar4 = FUN_140185490(param_1,&local_68,4);
  uVar6 = local_64;
  if (cVar4 != '\0') {
    uVar6 = local_68;
  }
  if (((int)uVar6 < 0) || (DAT_1402f8140 <= (int)uVar6)) {
    FUN_1401a2590(uVar6);
  }
  FUN_140077c40(param_2,(longlong)(int)uVar6);
  FUN_140077d80(param_2);
  if (0 < (int)uVar6) {
    uVar5 = (ulonglong)uVar6;
    do {
      local_58 = 0;
      local_48 = 0;
      uStack_54 = 0;
      local_40 = 0;
      local_50 = 0;
      uStack_4c = 0;
      FUN_1401a2570(param_1,&local_58);
      cVar4 = FUN_140185490(param_1,&local_68,4);
      uVar6 = (uint)local_48;
      if (cVar4 != '\0') {
        uVar6 = local_68;
      }
      local_48._0_4_ = uVar6;
      cVar4 = FUN_140185490(param_1,local_60,4);
      if (cVar4 != '\0') {
        local_48._4_4_ = local_60[0];
      }
      cVar4 = FUN_140185490(param_1,&local_64,4);
      puVar1 = (undefined4 *)param_2[1];
      if (cVar4 != '\0') {
        local_40 = local_64;
      }
      if ((&local_58 < puVar1) && (puVar2 = (undefined4 *)*param_2, puVar2 <= &local_58)) {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007a790(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        puVar7 = (undefined8 *)((((longlong)&local_58 - (longlong)puVar2) / 0x1c) * 0x1c + *param_2)
        ;
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = *puVar7;
          puVar3[1] = puVar7[1];
          puVar3[2] = puVar7[2];
          *(undefined4 *)(puVar3 + 3) = *(undefined4 *)(puVar7 + 3);
        }
      }
      else {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007a790(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = CONCAT44(uStack_54,local_58);
          puVar3[1] = CONCAT44(uStack_4c,local_50);
          puVar3[2] = local_48;
          *(uint *)(puVar3 + 3) = local_40;
        }
      }
      param_2[1] = param_2[1] + 0x1c;
      uVar5 = uVar5 - 1;
    } while (uVar5 != 0);
  }
  return param_1;
}



void FUN_1400733a0(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x1c,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001400734da)
// WARNING: Removing unreachable block (ram,0x0001400734e0)

undefined8 FUN_140073470(undefined8 param_1,ulonglong *param_2)

{
  undefined2 *puVar1;
  undefined2 *puVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  undefined8 *puVar5;
  uint local_res10 [2];
  undefined2 local_38;
  undefined4 uStack_36;
  undefined2 uStack_32;
  undefined8 local_30;
  undefined8 local_28;
  undefined8 local_20;
  
  FUN_140185490(param_1,local_res10,4);
  if (((int)local_res10[0] < 0) || (DAT_1402f8140 <= (int)local_res10[0])) {
    FUN_1401a2590(local_res10[0]);
  }
  FUN_1400781a0(param_2,(longlong)(int)local_res10[0]);
  uVar4 = *param_2;
  if (((longlong)(param_2[1] - uVar4) >> 5 != 0) && (uVar4 != param_2[1])) {
    param_2[1] = uVar4;
  }
  if (0 < (int)local_res10[0]) {
    uVar4 = (ulonglong)local_res10[0];
    do {
      local_38 = 0;
      uStack_36 = 0;
      uStack_32 = 0;
      local_30 = 0;
      local_28 = 0;
      local_20 = 0;
      FUN_1400811d0(param_1,&local_38);
      puVar1 = (undefined2 *)param_2[1];
      if ((&local_38 < puVar1) && (puVar2 = (undefined2 *)*param_2, puVar2 <= &local_38)) {
        if (puVar1 == (undefined2 *)param_2[2]) {
          FUN_14007a9a0(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        puVar5 = (undefined8 *)
                 (((longlong)&local_38 - (longlong)puVar2 & 0xffffffffffffffe0U) + *param_2);
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = *puVar5;
          puVar3[1] = puVar5[1];
          puVar3[2] = puVar5[2];
          local_20 = puVar5[3];
LAB_1400735fa:
          puVar3[3] = local_20;
        }
      }
      else {
        if (puVar1 == (undefined2 *)param_2[2]) {
          FUN_14007a9a0(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = CONCAT26(uStack_32,CONCAT42(uStack_36,local_38));
          puVar3[1] = local_30;
          puVar3[2] = local_28;
          goto LAB_1400735fa;
        }
      }
      param_2[1] = param_2[1] + 0x20;
      uVar4 = uVar4 - 1;
    } while (uVar4 != 0);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140073630(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  undefined1 auStack_d8 [32];
  uint local_b8 [4];
  undefined4 local_a8;
  undefined4 uStack_a4;
  undefined4 uStack_a0;
  undefined4 uStack_9c;
  undefined8 local_98;
  undefined8 uStack_90;
  undefined8 local_88;
  undefined8 uStack_80;
  undefined8 local_78;
  undefined8 uStack_70;
  undefined8 local_68;
  undefined8 uStack_60;
  undefined4 local_58;
  undefined2 uStack_54;
  undefined2 uStack_52;
  undefined4 uStack_50;
  undefined2 uStack_4c;
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_d8;
  FUN_140185490(param_1,local_b8,4);
  if (((int)local_b8[0] < 0) || (DAT_1402f8140 <= (int)local_b8[0])) {
    FUN_1401a2590(local_b8[0]);
  }
  FUN_140077e00(param_2,(longlong)(int)local_b8[0]);
  FUN_140077f40(param_2);
  if (0 < (int)local_b8[0]) {
    uVar4 = (ulonglong)local_b8[0];
    do {
      local_58 = 0;
      uStack_54 = 0;
      uStack_52 = 0;
      uStack_50 = 0;
      uStack_4c = 0;
      local_98 = 0;
      uStack_90 = 0;
      local_88 = 0;
      local_a8 = 0;
      uStack_a4 = 0;
      uStack_a0 = 0;
      uStack_9c = 0;
      uStack_80 = 0;
      local_78 = 0;
      uStack_70 = 0;
      local_68 = 0;
      uStack_60 = 0;
      FUN_14007de10(param_1,&local_a8);
      puVar1 = (undefined4 *)param_2[1];
      if ((&local_a8 < puVar1) && (puVar2 = (undefined4 *)*param_2, puVar2 <= &local_a8)) {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007a840(param_2,1);
        }
        if ((void *)param_2[1] != (void *)0x0) {
          memcpy((void *)param_2[1],
                 (void *)((((longlong)&local_a8 - (longlong)puVar2) / 0x5e) * 0x5e + *param_2),0x5e)
          ;
        }
      }
      else {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007a840(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = CONCAT44(uStack_a4,local_a8);
          puVar3[1] = CONCAT44(uStack_9c,uStack_a0);
          puVar3[2] = local_98;
          puVar3[3] = uStack_90;
          puVar3[4] = local_88;
          puVar3[5] = uStack_80;
          puVar3[6] = local_78;
          puVar3[7] = uStack_70;
          puVar3[8] = local_68;
          puVar3[9] = uStack_60;
          puVar3[10] = CONCAT26(uStack_52,CONCAT24(uStack_54,local_58));
          *(undefined4 *)(puVar3 + 0xb) = uStack_50;
          *(undefined2 *)((longlong)puVar3 + 0x5c) = uStack_4c;
        }
      }
      param_2[1] = param_2[1] + 0x5e;
      uVar4 = uVar4 - 1;
    } while (uVar4 != 0);
  }
  return param_1;
}



void FUN_140073830(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x5e,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140073900(undefined8 param_1,ulonglong *param_2)

{
  undefined2 *puVar1;
  undefined8 *puVar2;
  longlong lVar3;
  ulonglong uVar4;
  undefined1 auStack_d8 [32];
  uint local_b8 [4];
  undefined2 local_a8;
  undefined4 uStack_a6;
  undefined2 uStack_a2;
  undefined8 uStack_a0;
  undefined8 local_98;
  undefined8 uStack_90;
  undefined4 local_88;
  undefined2 uStack_84;
  undefined2 uStack_82;
  undefined6 uStack_80;
  undefined2 uStack_7a;
  undefined6 uStack_78;
  undefined2 uStack_72;
  undefined6 uStack_70;
  undefined2 uStack_6a;
  undefined1 local_68;
  undefined4 uStack_67;
  undefined2 uStack_63;
  undefined1 uStack_61;
  undefined7 uStack_60;
  undefined1 uStack_59;
  undefined7 uStack_58;
  undefined1 uStack_51;
  undefined7 uStack_50;
  undefined1 uStack_49;
  undefined7 uStack_48;
  undefined1 local_41;
  undefined4 uStack_40;
  undefined2 uStack_3c;
  undefined1 uStack_3a;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_d8;
  FUN_140185490(param_1,local_b8,4);
  if (((int)local_b8[0] < 0) || (DAT_1402f8140 <= (int)local_b8[0])) {
    FUN_1401a2590(local_b8[0]);
  }
  FUN_140077fd0(param_2,(longlong)(int)local_b8[0]);
  FUN_140078110(param_2);
  if (0 < (int)local_b8[0]) {
    uVar4 = (ulonglong)local_b8[0];
    do {
      uStack_61 = 0;
      uStack_60 = 0;
      local_a8 = 0;
      uStack_a6 = 0;
      uStack_a2 = 0;
      uStack_a0 = 0;
      uStack_59 = 0;
      uStack_58 = 0;
      local_98 = 0;
      uStack_90 = 0;
      local_88 = 0;
      uStack_84 = 0;
      uStack_82 = 0;
      uStack_80 = 0;
      uStack_7a = 0;
      uStack_78 = 0;
      uStack_72 = 0;
      uStack_70 = 0;
      uStack_6a = 0;
      local_68 = 0;
      uStack_67 = 0;
      uStack_63 = 0;
      uStack_51 = 0;
      uStack_50 = 0;
      uStack_49 = 0;
      uStack_48 = 0;
      local_41 = 0;
      uStack_40 = 0;
      uStack_3c = 0;
      uStack_3a = 0;
      FUN_1400807c0(param_1,&local_a8);
      puVar1 = (undefined2 *)param_2[1];
      if ((&local_a8 < puVar1) && ((undefined2 *)*param_2 <= &local_a8)) {
        lVar3 = (longlong)&local_a8 - (longlong)*param_2;
        lVar3 = lVar3 + SUB168(SEXT816(-0x6c657a3bf6c657a3) * SEXT816(lVar3),8);
        if (puVar1 == (undefined2 *)param_2[2]) {
          FUN_14007a8f0(param_2,1);
        }
        if ((void *)param_2[1] != (void *)0x0) {
          memcpy((void *)param_2[1],(void *)(((lVar3 >> 6) - (lVar3 >> 0x3f)) * 0x6f + *param_2),
                 0x6f);
        }
      }
      else {
        if (puVar1 == (undefined2 *)param_2[2]) {
          FUN_14007a8f0(param_2,1);
        }
        puVar2 = (undefined8 *)param_2[1];
        if (puVar2 != (undefined8 *)0x0) {
          *puVar2 = CONCAT26(uStack_a2,CONCAT42(uStack_a6,local_a8));
          puVar2[1] = uStack_a0;
          puVar2[2] = local_98;
          puVar2[3] = uStack_90;
          puVar2[4] = CONCAT26(uStack_82,CONCAT24(uStack_84,local_88));
          puVar2[5] = CONCAT26(uStack_7a,uStack_80);
          puVar2[6] = CONCAT26(uStack_72,uStack_78);
          puVar2[7] = CONCAT26(uStack_6a,uStack_70);
          puVar2[8] = CONCAT17(uStack_61,CONCAT25(uStack_63,CONCAT41(uStack_67,local_68)));
          puVar2[9] = CONCAT17(uStack_59,uStack_60);
          puVar2[10] = CONCAT17(uStack_51,uStack_58);
          puVar2[0xb] = CONCAT17(uStack_49,uStack_50);
          puVar2[0xc] = CONCAT17(local_41,uStack_48);
          *(undefined4 *)(puVar2 + 0xd) = uStack_40;
          *(undefined2 *)((longlong)puVar2 + 0x6c) = uStack_3c;
          *(undefined1 *)((longlong)puVar2 + 0x6e) = uStack_3a;
        }
      }
      param_2[1] = param_2[1] + 0x6f;
      uVar4 = uVar4 - 1;
    } while (uVar4 != 0);
  }
  return param_1;
}



void FUN_140073b30(undefined8 param_1,longlong *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  longlong lVar4;
  longlong lVar5;
  undefined *local_res10 [3];
  undefined8 uVar6;
  
  uVar6 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  lVar5 = param_2[1] - *param_2;
  lVar4 = SUB168(SEXT816(-0x6c657a3bf6c657a3) * SEXT816(lVar5),8) + lVar5;
  FUN_14003c600(local_res10,L"<Array %d>",(lVar4 >> 6) - (lVar4 >> 0x3f),lVar5,uVar6);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar6 = FUN_1400a3440();
    FUN_1400a1c30(uVar6);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar6);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x000140073c80)

undefined8 FUN_140073c00(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  undefined8 *puVar5;
  undefined1 auStack_68 [32];
  uint local_48 [2];
  undefined4 local_40;
  undefined4 uStack_3c;
  undefined4 local_38;
  undefined4 uStack_34;
  undefined8 local_30;
  undefined2 local_28;
  undefined4 uStack_26;
  undefined2 uStack_22;
  ulonglong local_20;
  
  local_20 = DAT_1402f85a0 ^ (ulonglong)auStack_68;
  FUN_140185490(param_1,local_48,4);
  if (((int)local_48[0] < 0) || (DAT_1402f8140 <= (int)local_48[0])) {
    FUN_1401a2590(local_48[0]);
  }
  FUN_1400781a0(param_2,(longlong)(int)local_48[0]);
  uVar4 = *param_2;
  if (((longlong)(param_2[1] - uVar4) >> 5 != 0) && (uVar4 != param_2[1])) {
    param_2[1] = uVar4;
  }
  if (0 < (int)local_48[0]) {
    uVar4 = (ulonglong)local_48[0];
    do {
      local_40 = 0;
      local_30 = 0;
      uStack_3c = 0;
      local_28 = 0;
      local_38 = 0;
      uStack_26 = 0;
      uStack_34 = 0;
      uStack_22 = 0;
      FUN_1400806e0(param_1,&local_40);
      puVar1 = (undefined4 *)param_2[1];
      if ((&local_40 < puVar1) && (puVar2 = (undefined4 *)*param_2, puVar2 <= &local_40)) {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007a9a0(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        puVar5 = (undefined8 *)
                 (((longlong)&local_40 - (longlong)puVar2 & 0xffffffffffffffe0U) + *param_2);
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = *puVar5;
          puVar3[1] = puVar5[1];
          puVar3[2] = puVar5[2];
          puVar3[3] = puVar5[3];
        }
      }
      else {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007a9a0(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = CONCAT44(uStack_3c,local_40);
          puVar3[1] = CONCAT44(uStack_34,local_38);
          puVar3[2] = local_30;
          puVar3[3] = CONCAT26(uStack_22,CONCAT42(uStack_26,local_28));
        }
      }
      param_2[1] = param_2[1] + 0x20;
      uVar4 = uVar4 - 1;
    } while (uVar4 != 0);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x000140073e7a)
// WARNING: Removing unreachable block (ram,0x000140073e80)

undefined8 FUN_140073e00(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  undefined8 *puVar3;
  char cVar4;
  ulonglong uVar5;
  uint uVar6;
  undefined8 *puVar7;
  undefined1 auStack_98 [32];
  uint local_78;
  uint local_74;
  undefined8 local_70;
  undefined4 local_68;
  undefined4 uStack_64;
  undefined4 local_60;
  undefined4 uStack_5c;
  undefined8 local_58;
  undefined8 local_50;
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_98;
  cVar4 = FUN_140185490(param_1,&local_78,4);
  uVar6 = local_74;
  if (cVar4 != '\0') {
    uVar6 = local_78;
  }
  if (((int)uVar6 < 0) || (DAT_1402f8140 <= (int)uVar6)) {
    FUN_1401a2590(uVar6);
  }
  FUN_1400781a0(param_2,(longlong)(int)uVar6);
  uVar5 = *param_2;
  if (((longlong)(param_2[1] - uVar5) >> 5 != 0) && (uVar5 != param_2[1])) {
    param_2[1] = uVar5;
  }
  if (0 < (int)uVar6) {
    uVar5 = (ulonglong)uVar6;
    do {
      local_50 = 0;
      local_68 = 0;
      local_58 = 0;
      uStack_64 = 0;
      local_60 = 0;
      uStack_5c = 0;
      FUN_1401a2570(param_1,&local_68);
      cVar4 = FUN_140185490(param_1,&local_78,4);
      uVar6 = (uint)local_58;
      if (cVar4 != '\0') {
        uVar6 = local_78;
      }
      local_58._0_4_ = uVar6;
      cVar4 = FUN_140185490(param_1,&local_74,4);
      if (cVar4 != '\0') {
        local_58._4_4_ = local_74;
      }
      cVar4 = FUN_140185490(param_1,&local_70,8);
      if (cVar4 != '\0') {
        local_50 = local_70;
      }
      puVar1 = (undefined4 *)param_2[1];
      if ((&local_68 < puVar1) && (puVar2 = (undefined4 *)*param_2, puVar2 <= &local_68)) {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007a9a0(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        puVar7 = (undefined8 *)
                 (((longlong)&local_68 - (longlong)puVar2 & 0xffffffffffffffe0U) + *param_2);
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = *puVar7;
          puVar3[1] = puVar7[1];
          puVar3[2] = puVar7[2];
          puVar3[3] = puVar7[3];
        }
      }
      else {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007a9a0(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = CONCAT44(uStack_64,local_68);
          puVar3[1] = CONCAT44(uStack_5c,local_60);
          puVar3[2] = local_58;
          puVar3[3] = local_50;
        }
      }
      param_2[1] = param_2[1] + 0x20;
      uVar5 = uVar5 - 1;
    } while (uVar5 != 0);
  }
  return param_1;
}



void FUN_140074040(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",param_2[1] - *param_2 >> 5,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400740f0(undefined8 param_1,ulonglong *param_2)

{
  undefined1 *puVar1;
  void *_Dst;
  ulonglong uVar2;
  undefined1 *puVar3;
  undefined1 auStack_1b8 [32];
  uint local_198 [4];
  undefined1 local_188 [352];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_1b8;
  FUN_140185490(param_1,local_198,4);
  if (((int)local_198[0] < 0) || (DAT_1402f8140 <= (int)local_198[0])) {
    FUN_1401a2590(local_198[0]);
  }
  FUN_1400782b0(param_2,(longlong)(int)local_198[0]);
  FUN_1400783f0(param_2);
  if (0 < (int)local_198[0]) {
    uVar2 = (ulonglong)local_198[0];
    do {
      FUN_14007c230(local_188);
      FUN_140081300(param_1,local_188);
      puVar3 = (undefined1 *)param_2[1];
      if ((local_188 < puVar3) && (puVar1 = (undefined1 *)*param_2, puVar1 <= local_188)) {
        if (puVar3 == (undefined1 *)param_2[2]) {
          FUN_14007aa20(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined1 *)
                 (((longlong)(local_188 + -(longlong)puVar1) / 0x159) * 0x159 + *param_2);
        if (_Dst != (void *)0x0) {
LAB_14007421d:
          memcpy(_Dst,puVar3,0x159);
        }
      }
      else {
        if (puVar3 == (undefined1 *)param_2[2]) {
          FUN_14007aa20(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = local_188;
          goto LAB_14007421d;
        }
      }
      param_2[1] = param_2[1] + 0x159;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_140074270(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x159,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140074340(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  void *_Dst;
  ulonglong uVar2;
  undefined4 *puVar3;
  undefined1 auStack_138 [32];
  uint local_118 [4];
  undefined4 local_108;
  undefined4 uStack_104;
  undefined4 uStack_100;
  undefined4 uStack_fc;
  undefined4 local_f8;
  undefined4 uStack_f4;
  undefined4 uStack_f0;
  undefined4 uStack_ec;
  undefined4 local_e8;
  undefined4 uStack_e4;
  undefined4 uStack_e0;
  undefined4 uStack_dc;
  undefined2 local_d8;
  undefined8 local_d6;
  undefined8 local_ce;
  undefined8 local_c6;
  undefined8 local_be;
  undefined2 local_b6;
  undefined4 local_b4;
  undefined8 local_b0;
  undefined2 local_a8;
  undefined8 local_a6;
  undefined8 local_9e;
  undefined8 local_96;
  undefined8 local_8e;
  undefined8 local_86;
  undefined4 local_7e;
  undefined4 local_7a;
  undefined1 local_76;
  undefined8 local_75;
  undefined4 local_6d;
  undefined4 local_69;
  undefined4 local_65;
  undefined4 local_61;
  undefined4 local_5d;
  ulonglong local_58;
  
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_138;
  FUN_140185490(param_1,local_118,4);
  if (((int)local_118[0] < 0) || (DAT_1402f8140 <= (int)local_118[0])) {
    FUN_1401a2590(local_118[0]);
  }
  FUN_140078480(param_2,(longlong)(int)local_118[0]);
  FUN_1400785c0(param_2);
  if (0 < (int)local_118[0]) {
    uVar2 = (ulonglong)local_118[0];
    do {
      local_d8 = 0;
      local_b6 = 0;
      local_a6 = 0;
      local_7e = 0;
      local_7a = 0;
      local_b4 = 0;
      local_b0 = 0;
      local_a8 = 0;
      local_6d = 0;
      local_69 = 0;
      local_65 = 0;
      local_9e = 0;
      local_96 = 0;
      local_8e = 0;
      local_61 = 0;
      local_5d = 0;
      local_108 = 0;
      uStack_104 = 0;
      uStack_100 = 0;
      uStack_fc = 0;
      local_86 = 0;
      local_76 = 0;
      local_75 = 0;
      local_f8 = 0;
      uStack_f4 = 0;
      uStack_f0 = 0;
      uStack_ec = 0;
      local_e8 = 0;
      uStack_e4 = 0;
      uStack_e0 = 0;
      uStack_dc = 0;
      local_d6 = 0;
      local_ce = 0;
      local_c6 = 0;
      local_be = 0;
      FUN_140083500(param_1,&local_108);
      puVar3 = (undefined4 *)param_2[1];
      if ((&local_108 < puVar3) && (puVar1 = (undefined4 *)*param_2, puVar1 <= &local_108)) {
        if (puVar3 == (undefined4 *)param_2[2]) {
          FUN_14007aad0(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined4 *)
                 ((((longlong)&local_108 - (longlong)puVar1) / 0xaf) * 0xaf + *param_2);
        if (_Dst != (void *)0x0) {
LAB_140074507:
          memcpy(_Dst,puVar3,0xaf);
        }
      }
      else {
        if (puVar3 == (undefined4 *)param_2[2]) {
          FUN_14007aad0(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_108;
          goto LAB_140074507;
        }
      }
      param_2[1] = param_2[1] + 0xaf;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_140074570(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0xaf,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140074640(undefined8 param_1,ulonglong *param_2)

{
  undefined8 *puVar1;
  longlong lVar2;
  ulonglong uVar3;
  undefined1 auStack_c8 [32];
  uint local_a8 [4];
  undefined8 local_98;
  undefined8 uStack_90;
  undefined4 local_88;
  undefined4 uStack_84;
  undefined8 uStack_80;
  undefined8 local_78;
  undefined8 uStack_70;
  undefined8 local_68;
  undefined4 uStack_60;
  undefined4 uStack_5c;
  undefined4 uStack_58;
  undefined4 uStack_54;
  undefined4 uStack_50;
  undefined4 uStack_4c;
  undefined4 uStack_48;
  undefined4 local_44;
  undefined4 uStack_40;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_c8;
  FUN_140185490(param_1,local_a8,4);
  if (((int)local_a8[0] < 0) || (DAT_1402f8140 <= (int)local_a8[0])) {
    FUN_1401a2590(local_a8[0]);
  }
  FUN_140078650(param_2);
  FUN_140078790(param_2);
  if (0 < (int)local_a8[0]) {
    uVar3 = (ulonglong)local_a8[0];
    do {
      local_88 = 0;
      local_98 = 0;
      uStack_90 = 0;
      memset(&uStack_84,0,0x28);
      uStack_5c = 0;
      uStack_58 = 0;
      uStack_54 = 0;
      uStack_50 = 0;
      uStack_4c = 0;
      uStack_48 = 0;
      local_44 = 0;
      uStack_40 = 0;
      FUN_14007dfe0(param_1,&local_98);
      puVar1 = (undefined8 *)param_2[1];
      if ((&local_98 < puVar1) && ((undefined8 *)*param_2 <= &local_98)) {
        lVar2 = (longlong)&local_98 - (longlong)*param_2;
        lVar2 = lVar2 + SUB168(SEXT816(-0x4de9bd37a6f4de9b) * SEXT816(lVar2),8);
        if (puVar1 == (undefined8 *)param_2[2]) {
          FUN_14007ab80(param_2);
        }
        if ((void *)param_2[1] != (void *)0x0) {
          memcpy((void *)param_2[1],(void *)(((lVar2 >> 6) - (lVar2 >> 0x3f)) * 0x5c + *param_2),
                 0x5c);
        }
      }
      else {
        if (puVar1 == (undefined8 *)param_2[2]) {
          FUN_14007ab80(param_2,1);
        }
        puVar1 = (undefined8 *)param_2[1];
        if (puVar1 != (undefined8 *)0x0) {
          *puVar1 = local_98;
          puVar1[1] = uStack_90;
          puVar1[2] = CONCAT44(uStack_84,local_88);
          puVar1[3] = uStack_80;
          puVar1[4] = local_78;
          puVar1[5] = uStack_70;
          puVar1[6] = local_68;
          puVar1[7] = CONCAT44(uStack_5c,uStack_60);
          puVar1[8] = CONCAT44(uStack_54,uStack_58);
          puVar1[9] = CONCAT44(uStack_4c,uStack_50);
          puVar1[10] = CONCAT44(local_44,uStack_48);
          *(undefined4 *)(puVar1 + 0xb) = uStack_40;
        }
      }
      param_2[1] = param_2[1] + 0x5c;
      uVar3 = uVar3 - 1;
    } while (uVar3 != 0);
  }
  return param_1;
}



void FUN_140074810(undefined8 param_1,longlong *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  longlong lVar4;
  longlong lVar5;
  undefined *local_res10 [3];
  undefined8 uVar6;
  
  uVar6 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  lVar5 = param_2[1] - *param_2;
  lVar4 = SUB168(SEXT816(-0x4de9bd37a6f4de9b) * SEXT816(lVar5),8) + lVar5;
  FUN_14003c600(local_res10,L"<Array %d>",(lVar4 >> 6) - (lVar4 >> 0x3f),lVar5,uVar6);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar6 = FUN_1400a3440();
    FUN_1400a1c30(uVar6);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar6);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400748e0(undefined8 param_1,ulonglong *param_2)

{
  undefined1 *puVar1;
  void *_Dst;
  ulonglong uVar2;
  undefined1 *puVar3;
  undefined1 auStack_f8 [32];
  uint local_d8 [4];
  undefined1 local_c8;
  undefined8 local_c7;
  undefined8 local_bf;
  undefined8 local_b7;
  undefined8 local_af;
  undefined8 local_a7;
  undefined8 local_9f;
  undefined8 local_97;
  undefined8 local_8f;
  undefined8 local_87;
  undefined8 local_7f;
  undefined8 local_77;
  undefined8 local_6f;
  undefined8 local_67;
  undefined8 local_5f;
  undefined8 local_57;
  undefined8 local_4f;
  undefined4 local_47;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_f8;
  FUN_140185490(param_1,local_d8,4);
  if (((int)local_d8[0] < 0) || (DAT_1402f8140 <= (int)local_d8[0])) {
    FUN_1401a2590(local_d8[0]);
  }
  FUN_140078820(param_2,(longlong)(int)local_d8[0]);
  FUN_140078960(param_2);
  if (0 < (int)local_d8[0]) {
    uVar2 = (ulonglong)local_d8[0];
    do {
      local_c8 = 0;
      local_c7 = 0;
      local_bf = 0;
      local_b7 = 0;
      local_af = 0;
      local_a7 = 0;
      local_9f = 0;
      local_97 = 0;
      local_8f = 0;
      local_87 = 0;
      local_7f = 0;
      local_77 = 0;
      local_6f = 0;
      local_67 = 0;
      local_5f = 0;
      local_57 = 0;
      local_4f = 0;
      local_47 = 0;
      FUN_14007e730(param_1,&local_c8);
      puVar3 = (undefined1 *)param_2[1];
      if ((&local_c8 < puVar3) && (puVar1 = (undefined1 *)*param_2, puVar1 <= &local_c8)) {
        if (puVar3 == (undefined1 *)param_2[2]) {
          FUN_14007ac30(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined1 *)
                 (((longlong)(&local_c8 + -(longlong)puVar1) / 0x85) * 0x85 + *param_2);
        if (_Dst != (void *)0x0) {
LAB_140074a47:
          memcpy(_Dst,puVar3,0x85);
        }
      }
      else {
        if (puVar3 == (undefined1 *)param_2[2]) {
          FUN_14007ac30(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_c8;
          goto LAB_140074a47;
        }
      }
      param_2[1] = param_2[1] + 0x85;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_140074a90(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x85,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x000140074bf3)
// WARNING: Removing unreachable block (ram,0x000140074c00)

undefined8 FUN_140074b60(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  char cVar4;
  longlong lVar5;
  longlong lVar6;
  ulonglong uVar7;
  uint uVar8;
  undefined1 auStack_78 [32];
  uint local_58;
  uint local_54;
  undefined4 local_50;
  undefined4 uStack_4c;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined8 local_40;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_78;
  cVar4 = FUN_140185490(param_1,&local_58,4);
  uVar8 = local_54;
  if (cVar4 != '\0') {
    uVar8 = local_58;
  }
  if (((int)uVar8 < 0) || (DAT_1402f8140 <= (int)uVar8)) {
    FUN_1401a2590(uVar8);
  }
  FUN_1400789f0(param_2,(longlong)(int)uVar8);
  uVar7 = *param_2;
  lVar5 = param_2[1] - uVar7;
  lVar6 = lVar5 >> 0x3f;
  if ((lVar5 / 0x18 + lVar6 != lVar6) && (uVar7 != param_2[1])) {
    param_2[1] = uVar7;
  }
  if (0 < (int)uVar8) {
    uVar7 = (ulonglong)uVar8;
    do {
      local_50 = 0;
      local_40 = 0;
      uStack_4c = 0;
      local_48 = 0;
      uStack_44 = 0;
      FUN_1401a2570(param_1,&local_50);
      cVar4 = FUN_140185490(param_1,&local_58,4);
      uVar8 = (uint)local_40;
      if (cVar4 != '\0') {
        uVar8 = local_58;
      }
      local_40._0_4_ = uVar8;
      cVar4 = FUN_140185490(param_1,&local_54,4);
      puVar1 = (undefined4 *)param_2[1];
      if (cVar4 != '\0') {
        local_40._4_4_ = local_54;
      }
      if ((&local_50 < puVar1) && ((undefined4 *)*param_2 <= &local_50)) {
        lVar6 = (longlong)&local_50 - (longlong)*param_2;
        lVar6 = lVar6 / 6 + (lVar6 >> 0x3f);
        lVar6 = (lVar6 >> 2) - (lVar6 >> 0x3f);
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007ace0(param_2,1);
        }
        puVar2 = (undefined8 *)param_2[1];
        uVar3 = *param_2;
        if (puVar2 != (undefined8 *)0x0) {
          *puVar2 = *(undefined8 *)(uVar3 + lVar6 * 0x18);
          puVar2[1] = *(undefined8 *)(uVar3 + 8 + lVar6 * 0x18);
          puVar2[2] = *(undefined8 *)(uVar3 + 0x10 + lVar6 * 0x18);
        }
      }
      else {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007ace0(param_2,1);
        }
        puVar2 = (undefined8 *)param_2[1];
        if (puVar2 != (undefined8 *)0x0) {
          *puVar2 = CONCAT44(uStack_4c,local_50);
          puVar2[1] = CONCAT44(uStack_44,local_48);
          puVar2[2] = local_40;
        }
      }
      param_2[1] = param_2[1] + 0x18;
      uVar7 = uVar7 - 1;
    } while (uVar7 != 0);
  }
  return param_1;
}



void FUN_140074db0(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x18,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



undefined8
FUN_140074e80(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  undefined *puVar4;
  undefined8 uVar5;
  ulonglong uVar6;
  undefined *local_res8;
  
  FUN_140185490(param_1,&local_res8,4,param_4,0xfffffffffffffffe);
  puVar4 = local_res8;
  iVar3 = (int)local_res8;
  if (((int)local_res8 < 0) || (DAT_1402f8140 <= (int)local_res8)) {
    FUN_1401a2590((ulonglong)local_res8 & 0xffffffff);
  }
  FUN_140078b30(param_2,(longlong)iVar3);
  FUN_140078c60(param_2);
  if (0 < iVar3) {
    uVar6 = (ulonglong)puVar4 & 0xffffffff;
    do {
      FUN_1400a3440();
      local_res8 = PTR_DAT_1402f8010;
      thunk_FUN_1401865d0(param_1,&local_res8);
      FUN_140078cf0(param_2,&local_res8);
      puVar4 = local_res8;
      if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1402f8010)) &&
         (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
        uVar5 = FUN_1400a3440();
        FUN_1400a1c30(uVar5);
        piVar2 = (int *)(puVar4 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(puVar1);
        }
        FUN_1400d1290(uVar5);
      }
      local_res8 = PTR_DAT_1402f8010;
      uVar6 = uVar6 - 1;
    } while (uVar6 != 0);
  }
  return param_1;
}



void FUN_140074fa0(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",param_2[1] - *param_2 >> 3,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140075050(undefined8 param_1,ulonglong *param_2)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  undefined1 auStack_d8 [32];
  uint local_b8 [4];
  undefined8 local_a8;
  undefined8 uStack_a0;
  undefined8 local_98;
  undefined8 uStack_90;
  undefined8 local_88;
  undefined8 uStack_80;
  undefined8 local_78;
  undefined8 uStack_70;
  undefined2 local_68;
  undefined6 uStack_66;
  undefined2 uStack_60;
  undefined6 uStack_5e;
  undefined2 uStack_58;
  undefined6 uStack_56;
  undefined2 uStack_50;
  undefined6 uStack_4e;
  undefined2 uStack_48;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_d8;
  FUN_140185490(param_1,local_b8,4);
  if (((int)local_b8[0] < 0) || (DAT_1402f8140 <= (int)local_b8[0])) {
    FUN_1401a2590(local_b8[0]);
  }
  FUN_140078dd0(param_2,(longlong)(int)local_b8[0]);
  FUN_140078f10(param_2);
  if (0 < (int)local_b8[0]) {
    uVar3 = (ulonglong)local_b8[0];
    do {
      local_68 = 0;
      local_a8 = 0;
      uStack_a0 = 0;
      local_98 = 0;
      uStack_90 = 0;
      local_88 = 0;
      uStack_80 = 0;
      local_78 = 0;
      uStack_70 = 0;
      uStack_66 = 0;
      uStack_60 = 0;
      uStack_5e = 0;
      uStack_58 = 0;
      uStack_56 = 0;
      uStack_50 = 0;
      uStack_4e = 0;
      uStack_48 = 0;
      FUN_14007e920(param_1,&local_a8);
      puVar1 = (undefined8 *)param_2[1];
      if ((&local_a8 < puVar1) && (puVar2 = (undefined8 *)*param_2, puVar2 <= &local_a8)) {
        if (puVar1 == (undefined8 *)param_2[2]) {
          FUN_14007ae10(param_2,1);
        }
        if ((void *)param_2[1] != (void *)0x0) {
          memcpy((void *)param_2[1],
                 (void *)((((longlong)&local_a8 - (longlong)puVar2) / 0x62) * 0x62 + *param_2),0x62)
          ;
        }
      }
      else {
        if (puVar1 == (undefined8 *)param_2[2]) {
          FUN_14007ae10(param_2,1);
        }
        puVar1 = (undefined8 *)param_2[1];
        if (puVar1 != (undefined8 *)0x0) {
          *puVar1 = local_a8;
          puVar1[1] = uStack_a0;
          puVar1[2] = local_98;
          puVar1[3] = uStack_90;
          puVar1[4] = local_88;
          puVar1[5] = uStack_80;
          puVar1[6] = local_78;
          puVar1[7] = uStack_70;
          puVar1[8] = CONCAT62(uStack_66,local_68);
          puVar1[9] = CONCAT62(uStack_5e,uStack_60);
          puVar1[10] = CONCAT62(uStack_56,uStack_58);
          puVar1[0xb] = CONCAT62(uStack_4e,uStack_50);
          *(undefined2 *)(puVar1 + 0xc) = uStack_48;
        }
      }
      param_2[1] = param_2[1] + 0x62;
      uVar3 = uVar3 - 1;
    } while (uVar3 != 0);
  }
  return param_1;
}



void FUN_140075240(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x62,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140075310(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  void *_Dst;
  undefined4 *puVar5;
  undefined1 auStack_138 [32];
  uint local_118 [4];
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  undefined4 local_f0;
  undefined4 local_ec;
  undefined4 local_e8;
  undefined4 local_e4;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined2 local_c0;
  undefined8 local_be;
  undefined8 local_b6;
  undefined8 local_ae;
  undefined4 local_a6;
  undefined2 local_a2;
  undefined8 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  ulonglong local_58;
  
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_138;
  FUN_140185490(param_1,local_118,4);
  if (((int)local_118[0] < 0) || (DAT_1402f8140 <= (int)local_118[0])) {
    FUN_1401a2590(local_118[0]);
  }
  FUN_140078fa0(param_2,(longlong)(int)local_118[0]);
  uVar3 = param_2[1];
  lVar4 = uVar3 - *param_2;
  lVar2 = lVar4 >> 0x3f;
  if ((lVar4 / 0xa4 + lVar2 != lVar2) && (*param_2 != uVar3)) {
    uVar3 = FUN_14007b560(uVar3,uVar3);
    param_2[1] = uVar3;
  }
  if (0 < (int)local_118[0]) {
    uVar3 = (ulonglong)local_118[0];
    do {
      local_b6 = 0;
      local_6c = 0;
      local_68 = 0;
      local_100 = 0;
      local_f0 = 0;
      local_f8 = 0;
      local_e8 = 0;
      local_fc = 0;
      local_ec = 0;
      local_108 = 0;
      local_104 = 0;
      local_f4 = 0;
      local_e4 = 0;
      local_c0 = 0;
      local_be = 0;
      local_ae = 0;
      local_a6 = 0;
      local_a2 = 0;
      local_a0 = 0;
      local_98 = 0;
      local_90 = 0;
      local_88 = 0;
      local_80 = 0;
      local_78 = 0;
      local_70 = 0;
      local_e0 = 0;
      local_d8 = 0;
      local_d0 = 0;
      local_c8 = 0;
      FUN_14007ea80(param_1,&local_108);
      puVar5 = (undefined4 *)param_2[1];
      if ((&local_108 < puVar5) && (puVar1 = (undefined4 *)*param_2, puVar1 <= &local_108)) {
        if (puVar5 == (undefined4 *)param_2[2]) {
          FUN_14007aec0(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar5 = (undefined4 *)
                 ((((longlong)&local_108 - (longlong)puVar1) / 0xa4) * 0xa4 + *param_2);
        if (_Dst != (void *)0x0) {
LAB_140075521:
          memcpy(_Dst,puVar5,0xa4);
        }
      }
      else {
        if (puVar5 == (undefined4 *)param_2[2]) {
          FUN_14007aec0(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar5 = &local_108;
          goto LAB_140075521;
        }
      }
      param_2[1] = param_2[1] + 0xa4;
      uVar3 = uVar3 - 1;
    } while (uVar3 != 0);
  }
  return param_1;
}



void FUN_140075580(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0xa4,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140075650(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  undefined1 auStack_b8 [32];
  uint local_98 [4];
  undefined4 local_88;
  undefined4 uStack_84;
  undefined4 uStack_80;
  undefined4 uStack_7c;
  undefined4 local_78;
  undefined4 uStack_74;
  undefined4 uStack_70;
  undefined4 uStack_6c;
  undefined8 local_68;
  undefined8 uStack_60;
  undefined8 local_58;
  undefined8 uStack_50;
  undefined8 local_48;
  undefined8 uStack_40;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_b8;
  FUN_140185490(param_1,local_98,4);
  if (((int)local_98[0] < 0) || (DAT_1402f8140 <= (int)local_98[0])) {
    FUN_1401a2590(local_98[0]);
  }
  FUN_1400790e0(param_2,(longlong)(int)local_98[0]);
  FUN_140079220(param_2);
  if (0 < (int)local_98[0]) {
    uVar4 = (ulonglong)local_98[0];
    do {
      local_68 = 0;
      uStack_60 = 0;
      local_88 = 0;
      uStack_84 = 0;
      uStack_80 = 0;
      uStack_7c = 0;
      local_78 = 0;
      uStack_74 = 0;
      uStack_70 = 0;
      uStack_6c = 0;
      local_58 = 0;
      uStack_50 = 0;
      local_48 = 0;
      uStack_40 = 0;
      FUN_14007efe0(param_1,&local_88);
      puVar1 = (undefined4 *)param_2[1];
      if ((&local_88 < puVar1) && (puVar2 = (undefined4 *)*param_2, puVar2 <= &local_88)) {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007af70(param_2,1);
        }
        if ((void *)param_2[1] != (void *)0x0) {
          memcpy((void *)param_2[1],
                 (void *)((((longlong)&local_88 - (longlong)puVar2) / 0x50) * 0x50 + *param_2),0x50)
          ;
        }
      }
      else {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_14007af70(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = CONCAT44(uStack_84,local_88);
          puVar3[1] = CONCAT44(uStack_7c,uStack_80);
          puVar3[2] = CONCAT44(uStack_74,local_78);
          puVar3[3] = CONCAT44(uStack_6c,uStack_70);
          puVar3[4] = local_68;
          puVar3[5] = uStack_60;
          puVar3[6] = local_58;
          puVar3[7] = uStack_50;
          puVar3[8] = local_48;
          puVar3[9] = uStack_40;
        }
      }
      param_2[1] = param_2[1] + 0x50;
      uVar4 = uVar4 - 1;
    } while (uVar4 != 0);
  }
  return param_1;
}



void FUN_140075820(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x50,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400758f0(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  void *_Dst;
  ulonglong uVar2;
  undefined4 *puVar3;
  undefined1 auStack_338 [32];
  uint local_318 [4];
  undefined4 local_308;
  undefined4 local_304;
  undefined4 local_300;
  undefined4 local_2fc;
  undefined4 local_2f8;
  undefined4 local_2f4;
  undefined4 local_2f0;
  undefined4 local_2ec;
  undefined4 local_2e8;
  undefined2 local_2e4;
  undefined1 local_2e2;
  undefined8 local_2e1;
  undefined8 local_2d9;
  undefined8 local_2d1;
  undefined8 local_2c9;
  undefined1 local_2c1 [100];
  undefined1 local_25d [510];
  undefined8 local_5f;
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_338;
  FUN_140185490(param_1,local_318,4);
  if (((int)local_318[0] < 0) || (DAT_1402f8140 <= (int)local_318[0])) {
    FUN_1401a2590(local_318[0]);
  }
  FUN_1400792b0(param_2,(longlong)(int)local_318[0]);
  FUN_1400793f0(param_2);
  if (0 < (int)local_318[0]) {
    uVar2 = (ulonglong)local_318[0];
    do {
      local_5f = 0;
      local_2f8 = 0;
      local_2e8 = 0;
      local_304 = 0;
      local_2f4 = 0;
      local_2fc = 0;
      local_2ec = 0;
      local_300 = 0;
      local_2f0 = 0;
      local_308 = 0;
      local_2e4 = 0;
      local_2e2 = 0;
      local_2e1 = 0;
      local_2d9 = 0;
      local_2d1 = 0;
      local_2c9 = 0;
      memset(local_2c1,0,100);
      memset(local_25d,0,0x1fe);
      FUN_14007f250(param_1,&local_308);
      puVar3 = (undefined4 *)param_2[1];
      if ((&local_308 < puVar3) && (puVar1 = (undefined4 *)*param_2, puVar1 <= &local_308)) {
        if (puVar3 == (undefined4 *)param_2[2]) {
          FUN_14007b020(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined4 *)
                 ((((longlong)&local_308 - (longlong)puVar1) / 0x2b1) * 0x2b1 + *param_2);
        if (_Dst != (void *)0x0) {
LAB_140075abd:
          memcpy(_Dst,puVar3,0x2b1);
        }
      }
      else {
        if (puVar3 == (undefined4 *)param_2[2]) {
          FUN_14007b020(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_308;
          goto LAB_140075abd;
        }
      }
      param_2[1] = param_2[1] + 0x2b1;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_140075b20(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x2b1,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140075bf0(undefined8 param_1,ulonglong *param_2)

{
  undefined8 *puVar1;
  void *_Dst;
  ulonglong uVar2;
  undefined8 *puVar3;
  undefined1 auStack_178 [32];
  uint local_158 [4];
  undefined8 local_148;
  undefined1 local_140 [264];
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_178;
  FUN_140185490(param_1,local_158,4);
  if (((int)local_158[0] < 0) || (DAT_1402f8140 <= (int)local_158[0])) {
    FUN_1401a2590(local_158[0]);
  }
  FUN_140079480(param_2);
  FUN_1400795c0(param_2);
  if (0 < (int)local_158[0]) {
    uVar2 = (ulonglong)local_158[0];
    do {
      local_148 = 0;
      memset(local_140,0,0x100);
      FUN_14007f570(param_1);
      puVar3 = (undefined8 *)param_2[1];
      if ((&local_148 < puVar3) && (puVar1 = (undefined8 *)*param_2, puVar1 <= &local_148)) {
        if (puVar3 == (undefined8 *)param_2[2]) {
          FUN_14007b0d0(param_2);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined8 *)
                 (((longlong)(local_140 + (-8 - (longlong)puVar1)) / 0x108) * 0x108 + *param_2);
        if (_Dst != (void *)0x0) {
LAB_140075d2d:
          memcpy(_Dst,puVar3,0x108);
        }
      }
      else {
        if (puVar3 == (undefined8 *)param_2[2]) {
          FUN_14007b0d0(param_2);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_148;
          goto LAB_140075d2d;
        }
      }
      param_2[1] = param_2[1] + 0x108;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_140075d80(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x108,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140075ed0)
// WARNING: Removing unreachable block (ram,0x000140075ee0)

undefined8 FUN_140075e50(undefined8 param_1,ulonglong *param_2)

{
  ulonglong uVar1;
  char cVar2;
  longlong lVar3;
  uint *puVar4;
  longlong lVar5;
  uint uVar6;
  uint uVar7;
  ulonglong uVar8;
  uint local_res8 [2];
  uint local_res10 [2];
  uint local_res18 [2];
  uint local_48;
  uint local_44;
  uint local_40;
  
  FUN_140185490(param_1,local_res8,4);
  uVar7 = local_res8[0];
  uVar8 = (ulonglong)local_res8[0];
  if (((int)local_res8[0] < 0) || (DAT_1402f8140 <= (int)local_res8[0])) {
    FUN_1401a2590(local_res8[0]);
  }
  FUN_140079650(param_2,(longlong)(int)uVar7);
  uVar1 = *param_2;
  lVar3 = param_2[1] - uVar1;
  lVar5 = lVar3 >> 0x3f;
  if ((lVar3 / 0xc + lVar5 != lVar5) && (uVar1 != param_2[1])) {
    param_2[1] = uVar1;
  }
  if (0 < (int)uVar7) {
    do {
      local_40 = 0;
      cVar2 = FUN_140185490(param_1,local_res8,4);
      uVar7 = 0;
      if (cVar2 != '\0') {
        uVar7 = local_res8[0];
      }
      local_48 = uVar7;
      cVar2 = FUN_140185490(param_1,local_res10,4);
      uVar6 = 0;
      if (cVar2 != '\0') {
        uVar6 = local_res10[0];
      }
      local_44 = uVar6;
      cVar2 = FUN_140185490(param_1,local_res18,4);
      if (cVar2 != '\0') {
        local_40 = local_res18[0];
      }
      puVar4 = (uint *)param_2[1];
      if ((&local_48 < puVar4) && ((uint *)*param_2 <= &local_48)) {
        lVar5 = (longlong)&local_48 - (longlong)*param_2;
        lVar5 = lVar5 / 6 + (lVar5 >> 0x3f);
        lVar5 = (lVar5 >> 1) - (lVar5 >> 0x3f);
        if (puVar4 == (uint *)param_2[2]) {
          FUN_14007b180(param_2,1);
        }
        puVar4 = (uint *)param_2[1];
        uVar1 = *param_2;
        if (puVar4 != (uint *)0x0) {
          *puVar4 = *(uint *)(uVar1 + lVar5 * 0xc);
          puVar4[1] = *(uint *)(uVar1 + 4 + lVar5 * 0xc);
          local_40 = *(uint *)(uVar1 + 8 + lVar5 * 0xc);
LAB_140076035:
          puVar4[2] = local_40;
        }
      }
      else {
        if (puVar4 == (uint *)param_2[2]) {
          FUN_14007b180(param_2,1);
        }
        puVar4 = (uint *)param_2[1];
        if (puVar4 != (uint *)0x0) {
          *puVar4 = uVar7;
          puVar4[1] = uVar6;
          goto LAB_140076035;
        }
      }
      param_2[1] = param_2[1] + 0xc;
      uVar8 = uVar8 - 1;
    } while (uVar8 != 0);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140076070(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  void *_Dst;
  ulonglong uVar2;
  undefined4 *puVar3;
  undefined1 auStack_f8 [32];
  uint local_d8 [4];
  undefined4 local_c8;
  undefined1 local_c4 [140];
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_f8;
  FUN_140185490(param_1,local_d8,4);
  if (((int)local_d8[0] < 0) || (DAT_1402f8140 <= (int)local_d8[0])) {
    FUN_1401a2590(local_d8[0]);
  }
  FUN_140079790(param_2);
  FUN_140079880(param_2);
  if (0 < (int)local_d8[0]) {
    uVar2 = (ulonglong)local_d8[0];
    do {
      local_c8 = 0;
      memset(local_c4,0,0x80);
      FUN_14007f670(param_1);
      puVar3 = (undefined4 *)param_2[1];
      if ((&local_c8 < puVar3) && (puVar1 = (undefined4 *)*param_2, puVar1 <= &local_c8)) {
        if (puVar3 == (undefined4 *)param_2[2]) {
          FUN_14007b230(param_2);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined4 *)
                 (((longlong)(local_c4 + (-4 - (longlong)puVar1)) / 0x84) * 0x84 + *param_2);
        if (_Dst != (void *)0x0) {
LAB_1400761ad:
          memcpy(_Dst,puVar3,0x84);
        }
      }
      else {
        if (puVar3 == (undefined4 *)param_2[2]) {
          FUN_14007b230(param_2);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_c8;
          goto LAB_1400761ad;
        }
      }
      param_2[1] = param_2[1] + 0x84;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_140076200(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x84,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400762d0(undefined8 param_1,undefined8 param_2)

{
  ulonglong uVar1;
  undefined1 auStack_a8 [32];
  uint local_88 [4];
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined8 local_64;
  undefined8 local_5c;
  undefined8 local_54;
  undefined8 local_4c;
  undefined8 local_44;
  undefined1 local_3c;
  undefined4 local_3b;
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_a8;
  FUN_140185490(param_1,local_88,4);
  uVar1 = (ulonglong)local_88[0];
  if (((int)local_88[0] < 0) || (DAT_1402f8140 <= (int)local_88[0])) {
    FUN_1401a2590(local_88[0]);
  }
  FUN_140079910(param_2,(longlong)(int)local_88[0]);
  FUN_140079a50(param_2);
  if (0 < (int)local_88[0]) {
    do {
      local_74 = 0;
      local_78 = 0;
      local_70 = 0;
      local_44 = 0;
      local_6c = 0;
      local_3c = 0;
      local_68 = 0;
      local_3b = 0;
      local_64 = 0;
      local_5c = 0;
      local_54 = 0;
      local_4c = 0;
      FUN_14007f750(param_1,&local_78);
      FUN_140079af0(param_2,&local_78);
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0);
  }
  return param_1;
}



void FUN_1400763f0(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x41,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400764c0(undefined8 param_1,longlong *param_2)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  undefined1 auStack_68 [32];
  uint local_48 [2];
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined8 local_30;
  undefined4 local_28;
  undefined2 local_24;
  undefined1 local_22;
  ulonglong local_20;
  
  local_20 = DAT_1402f85a0 ^ (ulonglong)auStack_68;
  FUN_140185490(param_1,local_48,4);
  uVar2 = (ulonglong)local_48[0];
  if (((int)local_48[0] < 0) || (DAT_1402f8140 <= (int)local_48[0])) {
    FUN_1401a2590(local_48[0]);
  }
  FUN_140079bc0(param_2,(longlong)(int)local_48[0]);
  lVar1 = param_2[1];
  lVar3 = lVar1 - *param_2;
  lVar3 = SUB168(SEXT816(-0x7bdef7bdef7bdef7) * SEXT816(lVar3),8) + lVar3;
  if ((lVar3 >> 4 != lVar3 >> 0x3f) && (*param_2 != lVar1)) {
    lVar1 = FUN_14007b4e0(lVar1,lVar1);
    param_2[1] = lVar1;
  }
  if (0 < (int)local_48[0]) {
    do {
      local_40 = 0;
      local_30 = 0;
      local_3c = 0;
      local_28 = 0;
      local_38 = 0;
      local_24 = 0;
      local_34 = 0;
      local_22 = 0;
      FUN_1400838c0(param_1,&local_40);
      FUN_140079d00(param_2,&local_40);
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_1400765e0(undefined8 param_1,longlong *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  longlong lVar4;
  longlong lVar5;
  undefined *local_res10 [3];
  undefined8 uVar6;
  
  uVar6 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  lVar5 = param_2[1] - *param_2;
  lVar4 = SUB168(SEXT816(-0x7bdef7bdef7bdef7) * SEXT816(lVar5),8) + lVar5;
  FUN_14003c600(local_res10,L"<Array %d>",(lVar4 >> 4) - (lVar4 >> 0x3f),lVar5,uVar6);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar6 = FUN_1400a3440();
    FUN_1400a1c30(uVar6);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar6);
  }
  return;
}



undefined8 FUN_1400766b0(undefined8 param_1,ulonglong *param_2)

{
  undefined1 *puVar1;
  uint uVar2;
  char cVar3;
  undefined1 *puVar4;
  undefined4 uVar5;
  undefined1 uVar6;
  ulonglong uVar7;
  undefined4 uVar8;
  uint local_res8 [4];
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined1 local_48;
  undefined4 local_47;
  undefined4 local_43;
  
  FUN_140185490(param_1,local_res8,4);
  uVar2 = local_res8[0];
  uVar7 = (ulonglong)local_res8[0];
  if (((int)local_res8[0] < 0) || (DAT_1402f8140 <= (int)local_res8[0])) {
    FUN_1401a2590(local_res8[0]);
  }
  FUN_140079e10(param_2,(longlong)(int)uVar2);
  FUN_140079f40(param_2);
  if (0 < (int)uVar2) {
    do {
      cVar3 = FUN_140185490(param_1,local_res8,1);
      uVar6 = 0;
      if (cVar3 != '\0') {
        uVar6 = (undefined1)local_res8[0];
      }
      local_48 = uVar6;
      cVar3 = FUN_140185490(param_1,local_res18,4);
      uVar5 = 0;
      if (cVar3 != '\0') {
        uVar5 = local_res18[0];
      }
      local_47 = uVar5;
      cVar3 = FUN_140185490(param_1,local_res20,4);
      puVar1 = (undefined1 *)param_2[1];
      uVar8 = 0;
      if (cVar3 != '\0') {
        uVar8 = local_res20[0];
      }
      local_43 = uVar8;
      if ((&local_48 < puVar1) && (puVar4 = (undefined1 *)*param_2, puVar4 <= &local_48)) {
        if (puVar1 == (undefined1 *)param_2[2]) {
          FUN_14007b440(param_2,1);
        }
        puVar1 = (undefined1 *)param_2[1];
        puVar4 = (undefined1 *)(((longlong)(&local_48 + -(longlong)puVar4) / 9) * 9 + *param_2);
        if (puVar1 != (undefined1 *)0x0) {
          *puVar1 = *puVar4;
          *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(puVar4 + 1);
          *(undefined4 *)(puVar1 + 5) = *(undefined4 *)(puVar4 + 5);
        }
      }
      else {
        if (puVar1 == (undefined1 *)param_2[2]) {
          FUN_14007b440(param_2,1);
        }
        puVar1 = (undefined1 *)param_2[1];
        if (puVar1 != (undefined1 *)0x0) {
          *puVar1 = uVar6;
          *(undefined4 *)(puVar1 + 1) = uVar5;
          *(undefined4 *)(puVar1 + 5) = uVar8;
        }
      }
      param_2[1] = param_2[1] + 9;
      uVar7 = uVar7 - 1;
    } while (uVar7 != 0);
  }
  return param_1;
}



void FUN_140076870(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 9,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



void FUN_140076930(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0xccccccccccccccc < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x14) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x14);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007b780(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x14);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x14) * 0x14);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



void FUN_140076a70(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x1b2036406c80d90 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x97) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x97);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007b7d0(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x97);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x97) * 0x97);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140076c00)

void FUN_140076bb0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x97 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140076c40(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x97b425ed097b425 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x1b) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x1b);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007b830(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x1b);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x1b) * 0x1b);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140076da6)
// WARNING: Removing unreachable block (ram,0x000140076db0)

void FUN_140076d70(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x1b + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140076df0(longlong *param_1,ulonglong param_2)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  void *_Dst;
  
  if (0x3fffffffffffffff < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)(param_1[2] - *param_1 >> 2) < param_2) {
    _Dst = (void *)FUN_14007a250(param_1 + 3);
    memmove(_Dst,(void *)*param_1,param_1[1] - *param_1 & 0xfffffffffffffffc);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)((longlong)_Dst + param_2 * 4);
    param_1[1] = (longlong)((longlong)_Dst + (lVar2 - (longlong)pvVar1 >> 2) * 4);
    *param_1 = (longlong)_Dst;
  }
  return;
}



void FUN_140076eb0(longlong *param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  
  puVar1 = (undefined4 *)param_1[1];
  if ((param_2 < puVar1) && (puVar2 = (undefined4 *)*param_1, puVar2 <= param_2)) {
    if (puVar1 == (undefined4 *)param_1[2]) {
      FUN_14007a1d0(param_1,1);
    }
    if ((undefined4 *)param_1[1] != (undefined4 *)0x0) {
      *(undefined4 *)param_1[1] =
           *(undefined4 *)(*param_1 + ((longlong)param_2 - (longlong)puVar2 >> 2) * 4);
      param_1[1] = param_1[1] + 4;
      return;
    }
  }
  else {
    if (puVar1 == (undefined4 *)param_1[2]) {
      FUN_14007a1d0(param_1,1);
    }
    if ((undefined4 *)param_1[1] != (undefined4 *)0x0) {
      *(undefined4 *)param_1[1] = *param_2;
    }
  }
  param_1[1] = param_1[1] + 4;
  return;
}



void FUN_140076f40(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x492492492492492 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x38) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x38);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007b890(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x38);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x38) * 0x38);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001400770ba)
// WARNING: Removing unreachable block (ram,0x0001400770c0)

void FUN_140077080(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x38 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140077110(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0xe1fc780e1fc780 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x122) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x122);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007b900(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x122);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x122) * 0x122);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001400772a0)

void FUN_140077250(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x122 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_1400772e0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x4ec4ec4ec4ec4ec < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x34) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x34);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007b960(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x34);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x34) * 0x34);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014007745a)
// WARNING: Removing unreachable block (ram,0x000140077460)

void FUN_140077420(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x34 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_1400774b0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x1e1e1e1e1e1e1e1 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x88) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x88);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007b9d0(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x88);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x88) * 0x88);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140077640)

void FUN_1400775f0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x88 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140077680(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  code *pcVar2;
  char *pcVar3;
  longlong lVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x4fba3d0a96bc1b < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar2 = (code *)swi(3);
    (*pcVar2)();
    return;
  }
  lVar4 = SUB168(SEXT816(-0x608b85ead287c92f) * SEXT816(param_1[2] - *param_1),8) +
          (param_1[2] - *param_1);
  if ((ulonglong)((lVar4 >> 9) - (lVar4 >> 0x3f)) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x336);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar3 = local_res10;
    FUN_14007ba30(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar4 = (param_1[1] - (longlong)pvVar1) +
            SUB168(SEXT816(-0x608b85ead287c92f) * SEXT816(param_1[1] - (longlong)pvVar1),8);
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar3 + param_2 * 0x336);
    param_1[1] = (longlong)(pcVar3 + ((lVar4 >> 9) - (lVar4 >> 0x3f)) * 0x336);
    *param_1 = (longlong)pcVar3;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140077811)

void FUN_1400777c0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *param_1;
  lVar2 = param_1[1] - lVar1;
  lVar2 = SUB168(SEXT816(-0x608b85ead287c92f) * SEXT816(lVar2),8) + lVar2;
  if ((lVar2 >> 9 != lVar2 >> 0x3f) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140077850(ulonglong *param_1,void *param_2)

{
  void *pvVar1;
  longlong lVar2;
  
  pvVar1 = (void *)param_1[1];
  if ((param_2 < pvVar1) && ((void *)*param_1 <= param_2)) {
    lVar2 = (longlong)param_2 - (longlong)*param_1;
    lVar2 = lVar2 + SUB168(SEXT816(-0x608b85ead287c92f) * SEXT816(lVar2),8);
    if (pvVar1 == (void *)param_1[2]) {
      FUN_14007a580(param_1,1);
    }
    if ((void *)param_1[1] != (void *)0x0) {
      memcpy((void *)param_1[1],(void *)(((lVar2 >> 9) - (lVar2 >> 0x3f)) * 0x336 + *param_1),0x336)
      ;
    }
    param_1[1] = param_1[1] + 0x336;
    return;
  }
  if (pvVar1 == (void *)param_1[2]) {
    FUN_14007a580(param_1,1);
  }
  if ((void *)param_1[1] != (void *)0x0) {
    memcpy((void *)param_1[1],param_2,0x336);
  }
  param_1[1] = param_1[1] + 0x336;
  return;
}



void FUN_140077930(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x19c2d14ee4a1019 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x9f) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x9f);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007ba90(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x9f);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x9f) * 0x9f);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140077ac0)

void FUN_140077a70(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x9f + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140077b00(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  code *pcVar2;
  char *pcVar3;
  longlong lVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x1555555555555555 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar2 = (code *)swi(3);
    (*pcVar2)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0xc) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0xc);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar3 = local_res10;
    FUN_14007b740(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar4 = (param_1[1] - (longlong)pvVar1) / 6 + (param_1[1] - (longlong)pvVar1 >> 0x3f);
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar3 + param_2 * 0xc);
    param_1[1] = (longlong)(pcVar3 + ((lVar4 >> 1) - (lVar4 >> 0x3f)) * 0xc);
    *param_1 = (longlong)pcVar3;
  }
  return;
}



void FUN_140077c40(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x924924924924924 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x1c) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x1c);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007baf0(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x1c);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x1c) * 0x1c);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140077dba)
// WARNING: Removing unreachable block (ram,0x000140077dc0)

void FUN_140077d80(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x1c + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140077e00(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x2b9310572620ae4 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x5e) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x5e);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007bb40(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x5e);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x5e) * 0x5e);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140077f90)

void FUN_140077f40(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x5e + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140077fd0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  code *pcVar2;
  char *pcVar3;
  longlong lVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x24e6a171024e6a1 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar2 = (code *)swi(3);
    (*pcVar2)();
    return;
  }
  lVar4 = SUB168(SEXT816(-0x6c657a3bf6c657a3) * SEXT816(param_1[2] - *param_1),8) +
          (param_1[2] - *param_1);
  if ((ulonglong)((lVar4 >> 6) - (lVar4 >> 0x3f)) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x6f);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar3 = local_res10;
    FUN_14007bba0(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar4 = (param_1[1] - (longlong)pvVar1) +
            SUB168(SEXT816(-0x6c657a3bf6c657a3) * SEXT816(param_1[1] - (longlong)pvVar1),8);
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar3 + param_2 * 0x6f);
    param_1[1] = (longlong)(pcVar3 + ((lVar4 >> 6) - (lVar4 >> 0x3f)) * 0x6f);
    *param_1 = (longlong)pcVar3;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140078161)

void FUN_140078110(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *param_1;
  lVar2 = param_1[1] - lVar1;
  lVar2 = SUB168(SEXT816(-0x6c657a3bf6c657a3) * SEXT816(lVar2),8) + lVar2;
  if ((lVar2 >> 6 != lVar2 >> 0x3f) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_1400781a0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x7ffffffffffffff < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)(param_1[2] - *param_1 >> 5) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 << 5);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007bc00(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x20);
    param_1[1] = (longlong)(pcVar4 + (lVar2 - (longlong)pvVar1 & 0xffffffffffffffe0));
    *param_1 = (longlong)pcVar4;
  }
  return;
}



void FUN_1400782b0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0xbdf59c91700bdf < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x159) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x159);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007bc50(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x159);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x159) * 0x159);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140078440)

void FUN_1400783f0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x159 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140078480(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x1767dce434a9b10 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0xaf) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0xaf);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007bcb0(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0xaf);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0xaf) * 0xaf);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140078610)

void FUN_1400785c0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0xaf + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140078650(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  code *pcVar2;
  char *pcVar3;
  longlong lVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x2c8590b21642c85 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar2 = (code *)swi(3);
    (*pcVar2)();
    return;
  }
  lVar4 = SUB168(SEXT816(-0x4de9bd37a6f4de9b) * SEXT816(param_1[2] - *param_1),8) +
          (param_1[2] - *param_1);
  if ((ulonglong)((lVar4 >> 6) - (lVar4 >> 0x3f)) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x5c);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar3 = local_res10;
    FUN_14007bd10(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar4 = (param_1[1] - (longlong)pvVar1) +
            SUB168(SEXT816(-0x4de9bd37a6f4de9b) * SEXT816(param_1[1] - (longlong)pvVar1),8);
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar3 + param_2 * 0x5c);
    param_1[1] = (longlong)(pcVar3 + ((lVar4 >> 6) - (lVar4 >> 0x3f)) * 0x5c);
    *param_1 = (longlong)pcVar3;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001400787e1)

void FUN_140078790(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *param_1;
  lVar2 = param_1[1] - lVar1;
  lVar2 = SUB168(SEXT816(-0x4de9bd37a6f4de9b) * SEXT816(lVar2),8) + lVar2;
  if ((lVar2 >> 6 != lVar2 >> 0x3f) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140078820(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x1ecc07b301ecc07 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x85) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x85);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007bd70(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x85);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x85) * 0x85);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001400789b0)

void FUN_140078960(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x85 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_1400789f0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  code *pcVar2;
  char *pcVar3;
  longlong lVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0xaaaaaaaaaaaaaaa < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar2 = (code *)swi(3);
    (*pcVar2)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x18) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x18);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar3 = local_res10;
    FUN_14007bdd0(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar4 = (param_1[1] - (longlong)pvVar1) / 6 + (param_1[1] - (longlong)pvVar1 >> 0x3f);
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar3 + param_2 * 0x18);
    param_1[1] = (longlong)(pcVar3 + ((lVar4 >> 2) - (lVar4 >> 0x3f)) * 0x18);
    *param_1 = (longlong)pcVar3;
  }
  return;
}



void FUN_140078b30(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  code *pcVar2;
  char *pcVar3;
  longlong lVar4;
  longlong lVar5;
  char *local_res10;
  undefined8 uVar6;
  undefined **local_30 [3];
  
  uVar6 = 0xfffffffffffffffe;
  if (0x1fffffffffffffff < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar2 = (code *)swi(3);
    (*pcVar2)();
    return;
  }
  if ((ulonglong)(param_1[2] - *param_1 >> 3) < param_2) {
    local_res10 = (char *)0x0;
    if ((param_2 != 0) && (local_res10 = operator_new(param_2 * 8), local_res10 == (char *)0x0)) {
      std::exception::exception((exception *)local_30,&local_res10);
      local_30[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_30,(ThrowInfo *)&DAT_1402f47a8);
    }
    pcVar3 = local_res10;
    FUN_14007be20(*param_1,param_1[1],local_res10,param_4,uVar6);
    lVar1 = param_1[1];
    lVar4 = *param_1;
    lVar5 = lVar1 - lVar4;
    if (lVar4 != 0) {
      for (; lVar4 != lVar1; lVar4 = lVar4 + 8) {
        FUN_1400031d0(lVar4);
      }
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar3 + param_2 * 8);
    param_1[1] = (longlong)(pcVar3 + (lVar5 >> 3) * 8);
    *param_1 = (longlong)pcVar3;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140078c9a)
// WARNING: Removing unreachable block (ram,0x000140078ca0)

void FUN_140078c60(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  if ((param_1[1] - lVar1 >> 3 != 0) && (lVar1 != param_1[1])) {
    lVar2 = param_1[1];
    for (lVar3 = lVar1; lVar3 != lVar2; lVar3 = lVar3 + 8) {
      FUN_1400031d0(lVar3);
    }
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140078cf0(ulonglong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  ulonglong uVar2;
  undefined8 *puVar3;
  
  uVar1 = param_1[1];
  if ((param_2 < uVar1) && (uVar2 = *param_1, uVar2 <= param_2)) {
    if (uVar1 == param_1[2]) {
      FUN_14007ad90(param_1,1,param_3,param_4,0xfffffffffffffffe);
    }
    uVar1 = *param_1;
    puVar3 = (undefined8 *)param_1[1];
    if (puVar3 != (undefined8 *)0x0) {
      FUN_1400a3440();
      *puVar3 = PTR_DAT_1402f8010;
      FUN_140003100(puVar3,uVar1 + ((longlong)(param_2 - uVar2) >> 3) * 8);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_14007ad90(param_1,1,param_3,param_4,0xfffffffffffffffe);
    }
    puVar3 = (undefined8 *)param_1[1];
    if (puVar3 != (undefined8 *)0x0) {
      FUN_1400a3440();
      *puVar3 = PTR_DAT_1402f8010;
      FUN_140003100(puVar3,param_2);
    }
  }
  param_1[1] = param_1[1] + 8;
  return;
}



void FUN_140078dd0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x29cbc14e5e0a72f < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x62) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x62);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007be90(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x62);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x62) * 0x62);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140078f60)

void FUN_140078f10(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x62 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140078fa0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x18f9c18f9c18f9c < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0xa4) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0xa4);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007bef0(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0xa4);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0xa4) * 0xa4);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



void FUN_1400790e0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x333333333333333 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x50) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x50);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007bf50(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x50);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x50) * 0x50);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140079270)

void FUN_140079220(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x50 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_1400792b0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x5f1e1885c2527c < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x2b1) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x2b1);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007bfb0(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x2b1);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x2b1) * 0x2b1);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140079440)

void FUN_1400793f0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x2b1 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140079480(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0xf83e0f83e0f83e < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x108) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x108);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007c010(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x108);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x108) * 0x108);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140079610)

void FUN_1400795c0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x108 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140079650(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  code *pcVar2;
  char *pcVar3;
  longlong lVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x1555555555555555 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar2 = (code *)swi(3);
    (*pcVar2)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0xc) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0xc);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar3 = local_res10;
    FUN_14007c070(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar4 = (param_1[1] - (longlong)pvVar1) / 6 + (param_1[1] - (longlong)pvVar1 >> 0x3f);
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar3 + param_2 * 0xc);
    param_1[1] = (longlong)(pcVar3 + ((lVar4 >> 1) - (lVar4 >> 0x3f)) * 0xc);
    *param_1 = (longlong)pcVar3;
  }
  return;
}



void FUN_140079790(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  longlong lVar4;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  if (0x1f07c1f07c1f07c < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x84) < param_2) {
    lVar4 = FUN_14001ca20(param_2);
    FUN_14007c0b0(*param_1,param_1[1],lVar4,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = param_2 * 0x84 + lVar4;
    param_1[1] = ((lVar2 - (longlong)pvVar1) / 0x84) * 0x84 + lVar4;
    *param_1 = lVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001400798d0)

void FUN_140079880(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x84 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140079910(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x3f03f03f03f03f0 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x41) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x41);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007c110(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x41);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x41) * 0x41);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140079a8a)
// WARNING: Removing unreachable block (ram,0x000140079a90)

void FUN_140079a50(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x41 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140079af0(ulonglong *param_1,undefined8 *param_2)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  puVar1 = (undefined8 *)param_1[1];
  if ((param_2 < puVar1) && (puVar2 = (undefined8 *)*param_1, puVar2 <= param_2)) {
    if (puVar1 == (undefined8 *)param_1[2]) {
      FUN_14007b2e0(param_1,1);
    }
    param_2 = (undefined8 *)((((longlong)param_2 - (longlong)puVar2) / 0x41) * 0x41 + *param_1);
  }
  else if (puVar1 == (undefined8 *)param_1[2]) {
    FUN_14007b2e0(param_1,1);
  }
  puVar1 = (undefined8 *)param_1[1];
  if (puVar1 != (undefined8 *)0x0) {
    *puVar1 = *param_2;
    puVar1[1] = param_2[1];
    puVar1[2] = param_2[2];
    puVar1[3] = param_2[3];
    puVar1[4] = param_2[4];
    puVar1[5] = param_2[5];
    puVar1[6] = param_2[6];
    puVar1[7] = param_2[7];
    *(undefined1 *)(puVar1 + 8) = *(undefined1 *)(param_2 + 8);
  }
  param_1[1] = param_1[1] + 0x41;
  return;
}



void FUN_140079bc0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  code *pcVar2;
  char *pcVar3;
  longlong lVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x842108421084210 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar2 = (code *)swi(3);
    (*pcVar2)();
    return;
  }
  lVar4 = SUB168(SEXT816(-0x7bdef7bdef7bdef7) * SEXT816(param_1[2] - *param_1),8) +
          (param_1[2] - *param_1);
  if ((ulonglong)((lVar4 >> 4) - (lVar4 >> 0x3f)) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x1f);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar3 = local_res10;
    FUN_14007c190(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar4 = (param_1[1] - (longlong)pvVar1) +
            SUB168(SEXT816(-0x7bdef7bdef7bdef7) * SEXT816(param_1[1] - (longlong)pvVar1),8);
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar3 + param_2 * 0x1f);
    param_1[1] = (longlong)(pcVar3 + ((lVar4 >> 4) - (lVar4 >> 0x3f)) * 0x1f);
    *param_1 = (longlong)pcVar3;
  }
  return;
}



void FUN_140079d00(ulonglong *param_1,undefined8 *param_2)

{
  undefined8 *puVar1;
  longlong lVar2;
  undefined8 *puVar3;
  
  puVar1 = (undefined8 *)param_1[1];
  if ((param_2 < puVar1) && ((undefined8 *)*param_1 <= param_2)) {
    lVar2 = (longlong)param_2 - (longlong)*param_1;
    lVar2 = lVar2 + SUB168(SEXT816(-0x7bdef7bdef7bdef7) * SEXT816(lVar2),8);
    if (puVar1 == (undefined8 *)param_1[2]) {
      FUN_14007b390(param_1,1);
    }
    puVar1 = (undefined8 *)param_1[1];
    puVar3 = (undefined8 *)(((lVar2 >> 4) - (lVar2 >> 0x3f)) * 0x1f + *param_1);
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = *puVar3;
      puVar1[1] = puVar3[1];
      puVar1[2] = puVar3[2];
      *(undefined4 *)(puVar1 + 3) = *(undefined4 *)(puVar3 + 3);
      *(undefined2 *)((longlong)puVar1 + 0x1c) = *(undefined2 *)((longlong)puVar3 + 0x1c);
      *(undefined1 *)((longlong)puVar1 + 0x1e) = *(undefined1 *)((longlong)puVar3 + 0x1e);
    }
    param_1[1] = param_1[1] + 0x1f;
    return;
  }
  if (puVar1 == (undefined8 *)param_1[2]) {
    FUN_14007b390(param_1,1);
  }
  puVar1 = (undefined8 *)param_1[1];
  if (puVar1 != (undefined8 *)0x0) {
    *puVar1 = *param_2;
    puVar1[1] = param_2[1];
    puVar1[2] = param_2[2];
    *(undefined4 *)(puVar1 + 3) = *(undefined4 *)(param_2 + 3);
    *(undefined2 *)((longlong)puVar1 + 0x1c) = *(undefined2 *)((longlong)param_2 + 0x1c);
    *(undefined1 *)((longlong)puVar1 + 0x1e) = *(undefined1 *)((longlong)param_2 + 0x1e);
  }
  param_1[1] = param_1[1] + 0x1f;
  return;
}



void FUN_140079e10(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x1c71c71c71c71c71 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 9) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 9);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14007c1f0(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 9);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 9) * 9);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140079f78)
// WARNING: Removing unreachable block (ram,0x000140079f90)

void FUN_140079f40(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 9 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140079fd0(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x14;
  if (0xcccccccccccccccU - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x14;
  if (uVar2 < uVar3) {
    if (0xccccccccccccccc - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140076930(param_1,uVar2);
  }
  return;
}



void FUN_14007a080(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x97;
  if (0x1b2036406c80d90U - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x97;
  if (uVar2 < uVar3) {
    if (0x1b2036406c80d90 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140076a70(param_1,uVar2);
  }
  return;
}



void FUN_14007a130(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x1b;
  if (0x97b425ed097b425U - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x1b;
  if (uVar2 < uVar3) {
    if (0x97b425ed097b425 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140076c40(param_1,uVar2);
  }
  return;
}



void FUN_14007a1d0(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = param_1[1] - *param_1 >> 2;
  if (0x3fffffffffffffffU - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = param_1[2] - *param_1 >> 2;
  if (uVar2 < uVar3) {
    if (0x3fffffffffffffff - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_140076df0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140076df0(param_1,uVar2);
  }
  return;
}



void * FUN_14007a250(undefined8 param_1,ulonglong param_2)

{
  void *pvVar1;
  char *local_res10 [3];
  undefined **local_28 [5];
  
  if (param_2 == 0) {
    return (void *)0x0;
  }
  if ((param_2 < 0x4000000000000000) && (pvVar1 = operator_new(param_2 * 4), pvVar1 != (void *)0x0))
  {
    return pvVar1;
  }
  local_res10[0] = (char *)0x0;
  std::exception::exception((exception *)local_28,local_res10);
  local_28[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_28,(ThrowInfo *)&DAT_1402f47a8);
}



void FUN_14007a2c0(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x38;
  if (0x492492492492492U - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x38;
  if (uVar2 < uVar3) {
    if (0x492492492492492 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140076f40(param_1,uVar2);
  }
  return;
}



void FUN_14007a370(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x122;
  if (0xe1fc780e1fc780U - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x122;
  if (uVar2 < uVar3) {
    if (0xe1fc780e1fc780 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140077110(param_1,uVar2);
  }
  return;
}



void FUN_14007a420(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x34;
  if (0x4ec4ec4ec4ec4ecU - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x34;
  if (uVar2 < uVar3) {
    if (0x4ec4ec4ec4ec4ec - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1400772e0(param_1,uVar2);
  }
  return;
}



void FUN_14007a4d0(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x88;
  if (0x1e1e1e1e1e1e1e1U - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x88;
  if (uVar2 < uVar3) {
    if (0x1e1e1e1e1e1e1e1 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1400774b0(param_1,uVar2);
  }
  return;
}



void FUN_14007a580(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = (param_1[1] - *param_1) +
          SUB168(SEXT816(-0x608b85ead287c92f) * SEXT816(param_1[1] - *param_1),8);
  uVar4 = (lVar2 >> 9) - (lVar2 >> 0x3f);
  if (0x4fba3d0a96bc1bU - param_2 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + param_2;
  lVar2 = SUB168(SEXT816(-0x608b85ead287c92f) * SEXT816(param_1[2] - *param_1),8) +
          (param_1[2] - *param_1);
  uVar3 = (lVar2 >> 9) - (lVar2 >> 0x3f);
  if (uVar3 < uVar4) {
    if (0x4fba3d0a96bc1b - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
    }
    else {
      uVar3 = uVar3 + (uVar3 >> 1);
    }
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_140077680(param_1,uVar3);
  }
  return;
}



void FUN_14007a630(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x9f;
  if (0x19c2d14ee4a1019U - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x9f;
  if (uVar2 < uVar3) {
    if (0x19c2d14ee4a1019 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140077930(param_1,uVar2);
  }
  return;
}



void FUN_14007a6e0(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = (param_1[1] - *param_1) / 6 + (param_1[1] - *param_1 >> 0x3f);
  uVar4 = (lVar2 >> 1) - (lVar2 >> 0x3f);
  if (0x1555555555555555U - param_2 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + param_2;
  uVar3 = (param_1[2] - *param_1) / 0xc;
  if (uVar3 < uVar4) {
    if (0x1555555555555555 - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
    }
    else {
      uVar3 = uVar3 + (uVar3 >> 1);
    }
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_140077b00(param_1,uVar3);
  }
  return;
}



void FUN_14007a790(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x1c;
  if (0x924924924924924U - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x1c;
  if (uVar2 < uVar3) {
    if (0x924924924924924 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140077c40(param_1,uVar2);
  }
  return;
}



void FUN_14007a840(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x5e;
  if (0x2b9310572620ae4U - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x5e;
  if (uVar2 < uVar3) {
    if (0x2b9310572620ae4 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140077e00(param_1,uVar2);
  }
  return;
}



void FUN_14007a8f0(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = (param_1[1] - *param_1) +
          SUB168(SEXT816(-0x6c657a3bf6c657a3) * SEXT816(param_1[1] - *param_1),8);
  uVar4 = (lVar2 >> 6) - (lVar2 >> 0x3f);
  if (0x24e6a171024e6a1U - param_2 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + param_2;
  lVar2 = SUB168(SEXT816(-0x6c657a3bf6c657a3) * SEXT816(param_1[2] - *param_1),8) +
          (param_1[2] - *param_1);
  uVar3 = (lVar2 >> 6) - (lVar2 >> 0x3f);
  if (uVar3 < uVar4) {
    if (0x24e6a171024e6a1 - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
    }
    else {
      uVar3 = uVar3 + (uVar3 >> 1);
    }
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_140077fd0(param_1,uVar3);
  }
  return;
}



void FUN_14007a9a0(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = param_1[1] - *param_1 >> 5;
  if (0x7ffffffffffffffU - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = param_1[2] - *param_1 >> 5;
  if (uVar2 < uVar3) {
    if (0x7ffffffffffffff - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_1400781a0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1400781a0(param_1,uVar2);
  }
  return;
}



void FUN_14007aa20(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x159;
  if (0xbdf59c91700bdfU - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x159;
  if (uVar2 < uVar3) {
    if (0xbdf59c91700bdf - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1400782b0(param_1,uVar2);
  }
  return;
}



void FUN_14007aad0(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0xaf;
  if (0x1767dce434a9b10U - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0xaf;
  if (uVar2 < uVar3) {
    if (0x1767dce434a9b10 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140078480(param_1,uVar2);
  }
  return;
}



void FUN_14007ab80(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = (param_1[1] - *param_1) +
          SUB168(SEXT816(-0x4de9bd37a6f4de9b) * SEXT816(param_1[1] - *param_1),8);
  uVar4 = (lVar2 >> 6) - (lVar2 >> 0x3f);
  if (0x2c8590b21642c85U - param_2 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + param_2;
  lVar2 = SUB168(SEXT816(-0x4de9bd37a6f4de9b) * SEXT816(param_1[2] - *param_1),8) +
          (param_1[2] - *param_1);
  uVar3 = (lVar2 >> 6) - (lVar2 >> 0x3f);
  if (uVar3 < uVar4) {
    if (0x2c8590b21642c85 - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
    }
    else {
      uVar3 = uVar3 + (uVar3 >> 1);
    }
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_140078650(param_1,uVar3);
  }
  return;
}



void FUN_14007ac30(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x85;
  if (0x1ecc07b301ecc07U - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x85;
  if (uVar2 < uVar3) {
    if (0x1ecc07b301ecc07 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140078820(param_1,uVar2);
  }
  return;
}



void FUN_14007ace0(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = (param_1[1] - *param_1) / 6 + (param_1[1] - *param_1 >> 0x3f);
  uVar4 = (lVar2 >> 2) - (lVar2 >> 0x3f);
  if (0xaaaaaaaaaaaaaaaU - param_2 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + param_2;
  uVar3 = (param_1[2] - *param_1) / 0x18;
  if (uVar3 < uVar4) {
    if (0xaaaaaaaaaaaaaaa - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
    }
    else {
      uVar3 = uVar3 + (uVar3 >> 1);
    }
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_1400789f0(param_1,uVar3);
  }
  return;
}



void FUN_14007ad90(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = param_1[1] - *param_1 >> 3;
  if (0x1fffffffffffffffU - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = param_1[2] - *param_1 >> 3;
  if (uVar2 < uVar3) {
    if (0x1fffffffffffffff - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_140078b30(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140078b30(param_1,uVar2);
  }
  return;
}



void FUN_14007ae10(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x62;
  if (0x29cbc14e5e0a72fU - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x62;
  if (uVar2 < uVar3) {
    if (0x29cbc14e5e0a72f - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140078dd0(param_1,uVar2);
  }
  return;
}



void FUN_14007aec0(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0xa4;
  if (0x18f9c18f9c18f9cU - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0xa4;
  if (uVar2 < uVar3) {
    if (0x18f9c18f9c18f9c - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140078fa0(param_1,uVar2);
  }
  return;
}



void FUN_14007af70(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x50;
  if (0x333333333333333U - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x50;
  if (uVar2 < uVar3) {
    if (0x333333333333333 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1400790e0(param_1,uVar2);
  }
  return;
}



void FUN_14007b020(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x2b1;
  if (0x5f1e1885c2527cU - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x2b1;
  if (uVar2 < uVar3) {
    if (0x5f1e1885c2527c - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1400792b0(param_1,uVar2);
  }
  return;
}



void FUN_14007b0d0(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x108;
  if (0xf83e0f83e0f83eU - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x108;
  if (uVar2 < uVar3) {
    if (0xf83e0f83e0f83e - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140079480(param_1,uVar2);
  }
  return;
}



void FUN_14007b180(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = (param_1[1] - *param_1) / 6 + (param_1[1] - *param_1 >> 0x3f);
  uVar4 = (lVar2 >> 1) - (lVar2 >> 0x3f);
  if (0x1555555555555555U - param_2 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + param_2;
  uVar3 = (param_1[2] - *param_1) / 0xc;
  if (uVar3 < uVar4) {
    if (0x1555555555555555 - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
    }
    else {
      uVar3 = uVar3 + (uVar3 >> 1);
    }
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_140079650(param_1,uVar3);
  }
  return;
}



void FUN_14007b230(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x84;
  if (0x1f07c1f07c1f07cU - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x84;
  if (uVar2 < uVar3) {
    if (0x1f07c1f07c1f07c - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140079790(param_1,uVar2);
  }
  return;
}



void FUN_14007b2e0(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x41;
  if (0x3f03f03f03f03f0U - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0x41;
  if (uVar2 < uVar3) {
    if (0x3f03f03f03f03f0 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140079910(param_1,uVar2);
  }
  return;
}



void FUN_14007b390(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = (param_1[1] - *param_1) +
          SUB168(SEXT816(-0x7bdef7bdef7bdef7) * SEXT816(param_1[1] - *param_1),8);
  uVar4 = (lVar2 >> 4) - (lVar2 >> 0x3f);
  if (0x842108421084210U - param_2 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + param_2;
  lVar2 = SUB168(SEXT816(-0x7bdef7bdef7bdef7) * SEXT816(param_1[2] - *param_1),8) +
          (param_1[2] - *param_1);
  uVar3 = (lVar2 >> 4) - (lVar2 >> 0x3f);
  if (uVar3 < uVar4) {
    if (0x842108421084210 - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
    }
    else {
      uVar3 = uVar3 + (uVar3 >> 1);
    }
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_140079bc0(param_1,uVar3);
  }
  return;
}



void FUN_14007b440(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 9;
  if (0x1c71c71c71c71c71U - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 9;
  if (uVar2 < uVar3) {
    if (0x1c71c71c71c71c71 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140079e10(param_1,uVar2);
  }
  return;
}



undefined8 * FUN_14007b4e0(longlong param_1,longlong param_2,undefined8 *param_3)

{
  undefined8 *puVar1;
  
  if (param_1 != param_2) {
    param_1 = param_1 - (longlong)param_3;
    puVar1 = param_3;
    do {
      param_3 = (undefined8 *)((longlong)puVar1 + 0x1f);
      *puVar1 = *(undefined8 *)(param_1 + (longlong)puVar1);
      puVar1[1] = *(undefined8 *)(param_1 + -0x17 + (longlong)param_3);
      *(undefined4 *)(puVar1 + 2) = *(undefined4 *)(param_1 + -0xf + (longlong)param_3);
      *(undefined4 *)((longlong)puVar1 + 0x14) = *(undefined4 *)(param_1 + -0xb + (longlong)param_3)
      ;
      *(undefined2 *)(puVar1 + 3) = *(undefined2 *)(param_1 + -7 + (longlong)param_3);
      *(undefined2 *)((longlong)puVar1 + 0x1a) = *(undefined2 *)(param_1 + -5 + (longlong)param_3);
      *(undefined1 *)((longlong)puVar1 + 0x1c) = *(undefined1 *)(param_1 + -3 + (longlong)param_3);
      *(undefined1 *)((longlong)puVar1 + 0x1d) = *(undefined1 *)(param_1 + -2 + (longlong)param_3);
      *(undefined1 *)((longlong)puVar1 + 0x1e) = *(undefined1 *)(param_1 + -1 + (longlong)param_3);
      puVar1 = param_3;
    } while (param_1 + (longlong)param_3 != param_2);
  }
  return param_3;
}



undefined2 * FUN_14007b560(undefined4 *param_1,undefined4 *param_2,undefined2 *param_3)

{
  undefined4 *puVar1;
  longlong lVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  
  if (param_1 != param_2) {
    puVar3 = param_1 + 0x1d;
    puVar4 = (undefined4 *)(param_3 + 0x3a);
    do {
      *param_3 = *(undefined2 *)(puVar3 + -0x1d);
      *(undefined2 *)((longlong)puVar4 + -0x72) = *(undefined2 *)((longlong)puVar3 + -0x72);
      lVar2 = 0x10;
      *(undefined8 *)(puVar4 + -0x1c) = *(undefined8 *)(puVar3 + -0x1c);
      *(undefined8 *)(puVar4 + -0x1a) = *(undefined8 *)(puVar3 + -0x1a);
      *(undefined8 *)(puVar4 + -0x18) = *(undefined8 *)(puVar3 + -0x18);
      *(undefined8 *)(puVar4 + -0x16) = *(undefined8 *)(puVar3 + -0x16);
      puVar4[-0x14] = puVar3[-0x14];
      puVar1 = puVar4 + -0x13;
      do {
        lVar2 = lVar2 + -1;
        *(undefined2 *)puVar1 =
             *(undefined2 *)((longlong)puVar3 + (-0x74 - (longlong)param_3) + (longlong)puVar1);
        puVar1 = (undefined4 *)((longlong)puVar1 + 2);
      } while (lVar2 != 0);
      param_3 = param_3 + 0x52;
      *(undefined2 *)(puVar4 + -0xb) = *(undefined2 *)(puVar3 + -0xb);
      *(undefined4 *)((longlong)puVar4 + -0x2a) = *(undefined4 *)((longlong)puVar3 + -0x2a);
      *(undefined4 *)((longlong)puVar4 + -0x26) = *(undefined4 *)((longlong)puVar3 + -0x26);
      *(undefined8 *)((longlong)puVar4 + -0x22) = *(undefined8 *)((longlong)puVar3 + -0x22);
      *(undefined4 *)((longlong)puVar4 + -0x1a) = *(undefined4 *)((longlong)puVar3 + -0x1a);
      *(undefined4 *)((longlong)puVar4 + -0x16) = *(undefined4 *)((longlong)puVar3 + -0x16);
      *(undefined4 *)((longlong)puVar4 + -0x12) = *(undefined4 *)((longlong)puVar3 + -0x12);
      *(undefined2 *)((longlong)puVar4 + -0xe) = *(undefined2 *)((longlong)puVar3 + -0xe);
      puVar4[-3] = puVar3[-3];
      puVar4[-2] = puVar3[-2];
      puVar4[-1] = puVar3[-1];
      *puVar4 = *puVar3;
      puVar4[1] = puVar3[1];
      puVar4[2] = puVar3[2];
      puVar4[3] = puVar3[3];
      puVar4[4] = puVar3[4];
      puVar4[5] = puVar3[5];
      puVar4[6] = puVar3[6];
      puVar4[7] = puVar3[7];
      puVar4[8] = puVar3[8];
      puVar4[9] = puVar3[9];
      puVar4[10] = puVar3[10];
      puVar4[0xb] = puVar3[0xb];
      puVar1 = puVar3 + 0xc;
      puVar3 = puVar3 + 0x29;
      puVar4 = puVar4 + 0x29;
    } while (puVar1 != param_2);
  }
  return param_3;
}



undefined8 * FUN_14007b740(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = (undefined8 *)((longlong)param_1 + 0xc)) {
    if (param_3 != (undefined8 *)0x0) {
      *param_3 = *param_1;
      *(undefined4 *)(param_3 + 1) = *(undefined4 *)(param_1 + 1);
    }
    param_3 = (undefined8 *)((longlong)param_3 + 0xc);
  }
  return param_3;
}



undefined8 * FUN_14007b780(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = (undefined8 *)((longlong)param_1 + 0x14)) {
    if (param_3 != (undefined8 *)0x0) {
      *param_3 = *param_1;
      param_3[1] = param_1[1];
      *(undefined4 *)(param_3 + 2) = *(undefined4 *)(param_1 + 2);
    }
    param_3 = (undefined8 *)((longlong)param_3 + 0x14);
  }
  return param_3;
}



void * FUN_14007b7d0(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x97)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x97);
    }
    param_3 = (void *)((longlong)param_3 + 0x97);
  }
  return param_3;
}



undefined8 * FUN_14007b830(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = (undefined8 *)((longlong)param_1 + 0x1b)) {
    if (param_3 != (undefined8 *)0x0) {
      *param_3 = *param_1;
      param_3[1] = param_1[1];
      param_3[2] = param_1[2];
      *(undefined2 *)(param_3 + 3) = *(undefined2 *)(param_1 + 3);
      *(undefined1 *)((longlong)param_3 + 0x1a) = *(undefined1 *)((longlong)param_1 + 0x1a);
    }
    param_3 = (undefined8 *)((longlong)param_3 + 0x1b);
  }
  return param_3;
}



undefined8 * FUN_14007b890(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 7) {
    if (param_3 != (undefined8 *)0x0) {
      *param_3 = *param_1;
      param_3[1] = param_1[1];
      param_3[2] = param_1[2];
      param_3[3] = param_1[3];
      param_3[4] = param_1[4];
      param_3[5] = param_1[5];
      param_3[6] = param_1[6];
    }
    param_3 = param_3 + 7;
  }
  return param_3;
}



void * FUN_14007b900(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x122)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x122);
    }
    param_3 = (void *)((longlong)param_3 + 0x122);
  }
  return param_3;
}



undefined8 * FUN_14007b960(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = (undefined8 *)((longlong)param_1 + 0x34)) {
    if (param_3 != (undefined8 *)0x0) {
      *param_3 = *param_1;
      param_3[1] = param_1[1];
      param_3[2] = param_1[2];
      param_3[3] = param_1[3];
      param_3[4] = param_1[4];
      param_3[5] = param_1[5];
      *(undefined4 *)(param_3 + 6) = *(undefined4 *)(param_1 + 6);
    }
    param_3 = (undefined8 *)((longlong)param_3 + 0x34);
  }
  return param_3;
}



void * FUN_14007b9d0(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x88)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x88);
    }
    param_3 = (void *)((longlong)param_3 + 0x88);
  }
  return param_3;
}



void * FUN_14007ba30(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x336)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x336);
    }
    param_3 = (void *)((longlong)param_3 + 0x336);
  }
  return param_3;
}



void * FUN_14007ba90(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x9f)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x9f);
    }
    param_3 = (void *)((longlong)param_3 + 0x9f);
  }
  return param_3;
}



undefined8 * FUN_14007baf0(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = (undefined8 *)((longlong)param_1 + 0x1c)) {
    if (param_3 != (undefined8 *)0x0) {
      *param_3 = *param_1;
      param_3[1] = param_1[1];
      param_3[2] = param_1[2];
      *(undefined4 *)(param_3 + 3) = *(undefined4 *)(param_1 + 3);
    }
    param_3 = (undefined8 *)((longlong)param_3 + 0x1c);
  }
  return param_3;
}



void * FUN_14007bb40(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x5e)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x5e);
    }
    param_3 = (void *)((longlong)param_3 + 0x5e);
  }
  return param_3;
}



void * FUN_14007bba0(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x6f)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x6f);
    }
    param_3 = (void *)((longlong)param_3 + 0x6f);
  }
  return param_3;
}



undefined8 * FUN_14007bc00(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 4) {
    if (param_3 != (undefined8 *)0x0) {
      *param_3 = *param_1;
      param_3[1] = param_1[1];
      param_3[2] = param_1[2];
      param_3[3] = param_1[3];
    }
    param_3 = param_3 + 4;
  }
  return param_3;
}



void * FUN_14007bc50(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x159)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x159);
    }
    param_3 = (void *)((longlong)param_3 + 0x159);
  }
  return param_3;
}



void * FUN_14007bcb0(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0xaf)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0xaf);
    }
    param_3 = (void *)((longlong)param_3 + 0xaf);
  }
  return param_3;
}



void * FUN_14007bd10(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x5c)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x5c);
    }
    param_3 = (void *)((longlong)param_3 + 0x5c);
  }
  return param_3;
}



void * FUN_14007bd70(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x85)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x85);
    }
    param_3 = (void *)((longlong)param_3 + 0x85);
  }
  return param_3;
}



undefined8 * FUN_14007bdd0(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 3) {
    if (param_3 != (undefined8 *)0x0) {
      *param_3 = *param_1;
      param_3[1] = param_1[1];
      param_3[2] = param_1[2];
    }
    param_3 = param_3 + 3;
  }
  return param_3;
}



undefined8 * FUN_14007be20(longlong param_1,longlong param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 8) {
    if (param_3 != (undefined8 *)0x0) {
      FUN_1400a3440();
      *param_3 = PTR_DAT_1402f8010;
      FUN_140003100(param_3,param_1);
    }
    param_3 = param_3 + 1;
  }
  return param_3;
}



void * FUN_14007be90(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x62)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x62);
    }
    param_3 = (void *)((longlong)param_3 + 0x62);
  }
  return param_3;
}



void * FUN_14007bef0(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0xa4)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0xa4);
    }
    param_3 = (void *)((longlong)param_3 + 0xa4);
  }
  return param_3;
}



void * FUN_14007bf50(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x50)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x50);
    }
    param_3 = (void *)((longlong)param_3 + 0x50);
  }
  return param_3;
}



void * FUN_14007bfb0(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x2b1)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x2b1);
    }
    param_3 = (void *)((longlong)param_3 + 0x2b1);
  }
  return param_3;
}



void * FUN_14007c010(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x108)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x108);
    }
    param_3 = (void *)((longlong)param_3 + 0x108);
  }
  return param_3;
}



undefined4 * FUN_14007c070(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 3) {
    if (param_3 != (undefined4 *)0x0) {
      *param_3 = *param_1;
      param_3[1] = param_1[1];
      param_3[2] = param_1[2];
    }
    param_3 = param_3 + 3;
  }
  return param_3;
}



void * FUN_14007c0b0(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x84)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x84);
    }
    param_3 = (void *)((longlong)param_3 + 0x84);
  }
  return param_3;
}



undefined8 * FUN_14007c110(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = (undefined8 *)((longlong)param_1 + 0x41)) {
    if (param_3 != (undefined8 *)0x0) {
      *param_3 = *param_1;
      param_3[1] = param_1[1];
      param_3[2] = param_1[2];
      param_3[3] = param_1[3];
      param_3[4] = param_1[4];
      param_3[5] = param_1[5];
      param_3[6] = param_1[6];
      param_3[7] = param_1[7];
      *(undefined1 *)(param_3 + 8) = *(undefined1 *)(param_1 + 8);
    }
    param_3 = (undefined8 *)((longlong)param_3 + 0x41);
  }
  return param_3;
}



undefined8 * FUN_14007c190(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = (undefined8 *)((longlong)param_1 + 0x1f)) {
    if (param_3 != (undefined8 *)0x0) {
      *param_3 = *param_1;
      param_3[1] = param_1[1];
      param_3[2] = param_1[2];
      *(undefined4 *)(param_3 + 3) = *(undefined4 *)(param_1 + 3);
      *(undefined2 *)((longlong)param_3 + 0x1c) = *(undefined2 *)((longlong)param_1 + 0x1c);
      *(undefined1 *)((longlong)param_3 + 0x1e) = *(undefined1 *)((longlong)param_1 + 0x1e);
    }
    param_3 = (undefined8 *)((longlong)param_3 + 0x1f);
  }
  return param_3;
}



undefined1 * FUN_14007c1f0(undefined1 *param_1,undefined1 *param_2,undefined1 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 9) {
    if (param_3 != (undefined1 *)0x0) {
      *param_3 = *param_1;
      *(undefined4 *)(param_3 + 1) = *(undefined4 *)(param_1 + 1);
      *(undefined4 *)(param_3 + 5) = *(undefined4 *)(param_1 + 5);
    }
    param_3 = param_3 + 9;
  }
  return param_3;
}



undefined8 * FUN_14007c230(undefined8 *param_1)

{
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  param_1[8] = 0;
  param_1[10] = 0;
  param_1[9] = 0;
  *(undefined2 *)(param_1 + 0xb) = 0;
  *(undefined8 *)((longlong)param_1 + 0x5a) = 0;
  *(undefined2 *)((longlong)param_1 + 0x62) = 0;
  *(undefined8 *)((longlong)param_1 + 100) = 0;
  *(undefined8 *)((longlong)param_1 + 0x6c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  *(undefined2 *)(param_1 + 0x10) = 0;
  *(undefined8 *)((longlong)param_1 + 0x82) = 0;
  *(undefined8 *)((longlong)param_1 + 0x8a) = 0;
  *(undefined8 *)((longlong)param_1 + 0x92) = 0;
  *(undefined2 *)((longlong)param_1 + 0x9a) = 0;
  *(undefined1 *)((longlong)param_1 + 0x9c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x9d) = 0;
  *(undefined8 *)((longlong)param_1 + 0xa5) = 0;
  *(undefined8 *)((longlong)param_1 + 0xad) = 0;
  *(undefined8 *)((longlong)param_1 + 0xb5) = 0;
  *(undefined8 *)((longlong)param_1 + 0xdd) = 0;
  *(undefined8 *)((longlong)param_1 + 0xe5) = 0;
  *(undefined8 *)((longlong)param_1 + 0xed) = 0;
  *(undefined8 *)((longlong)param_1 + 0xfd) = 0;
  *(undefined8 *)((longlong)param_1 + 0xf5) = 0;
  *(undefined8 *)((longlong)param_1 + 0x105) = 0;
  *(undefined2 *)((longlong)param_1 + 0x10d) = 0;
  *(undefined8 *)((longlong)param_1 + 0x10f) = 0;
  *(undefined2 *)((longlong)param_1 + 0x153) = 0;
  *(undefined4 *)((longlong)param_1 + 0x155) = 0;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0xbd) = 0;
  *(undefined8 *)((longlong)param_1 + 0xc5) = 0;
  *(undefined8 *)((longlong)param_1 + 0xcd) = 0;
  *(undefined8 *)((longlong)param_1 + 0xd5) = 0;
  *(undefined8 *)((longlong)param_1 + 0x117) = 0;
  *(undefined8 *)((longlong)param_1 + 0x11f) = 0;
  *(undefined8 *)((longlong)param_1 + 0x127) = 0;
  *(undefined8 *)((longlong)param_1 + 0x12f) = 0;
  *(undefined8 *)((longlong)param_1 + 0x137) = 0;
  *(undefined8 *)((longlong)param_1 + 0x13f) = 0;
  *(undefined8 *)((longlong)param_1 + 0x147) = 0;
  *(undefined4 *)((longlong)param_1 + 0x14f) = 0;
  return param_1;
}



undefined1 FUN_14007c3b0(undefined8 param_1,undefined8 *param_2)

{
  char cVar1;
  undefined8 local_res18 [2];
  
  cVar1 = FUN_140185490(param_1,local_res18,8);
  if (cVar1 == '\0') {
    return 0;
  }
  *param_2 = local_res18[0];
  return 1;
}



undefined4 * FUN_14007c3f0(undefined4 *param_1)

{
  *param_1 = 0;
  *(undefined2 *)(param_1 + 1) = 0;
  *(undefined8 *)((longlong)param_1 + 6) = 0;
  *(undefined8 *)((longlong)param_1 + 0xe) = 0;
  *(undefined8 *)((longlong)param_1 + 0x16) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1e) = 0;
  *(undefined8 *)((longlong)param_1 + 0x26) = 0;
  *(undefined8 *)((longlong)param_1 + 0x2e) = 0;
  *(undefined8 *)((longlong)param_1 + 0x36) = 0;
  *(undefined8 *)((longlong)param_1 + 0x3e) = 0;
  *(undefined8 *)((longlong)param_1 + 0x46) = 0;
  *(undefined8 *)((longlong)param_1 + 0x4e) = 0;
  *(undefined8 *)((longlong)param_1 + 0x56) = 0;
  *(undefined8 *)((longlong)param_1 + 0x5e) = 0;
  *(undefined8 *)((longlong)param_1 + 0x66) = 0;
  return param_1;
}



undefined4 * FUN_14007c450(undefined4 *param_1)

{
  *param_1 = 0;
  *(undefined8 *)(param_1 + 1) = 0;
  *(undefined8 *)(param_1 + 3) = 0;
  *(undefined8 *)(param_1 + 5) = 0;
  *(undefined2 *)(param_1 + 9) = 0;
  *(undefined8 *)(param_1 + 7) = 0;
  *(undefined1 *)((longlong)param_1 + 0x26) = 0;
  *(undefined8 *)((longlong)param_1 + 0x2a9) = 0;
  *(undefined8 *)((longlong)param_1 + 0x27) = 0;
  *(undefined8 *)((longlong)param_1 + 0x2f) = 0;
  *(undefined8 *)((longlong)param_1 + 0x37) = 0;
  *(undefined8 *)((longlong)param_1 + 0x3f) = 0;
  memset((void *)((longlong)param_1 + 0x47),0,100);
  memset((void *)((longlong)param_1 + 0xab),0,0x1fe);
  return param_1;
}



undefined4 * FUN_14007c4e0(undefined4 *param_1)

{
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)(param_1 + 0xe) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x12) = 0;
  *(undefined8 *)(param_1 + 0x14) = 0;
  *(undefined2 *)(param_1 + 0x16) = 0;
  *(undefined4 *)((longlong)param_1 + 0x2c2) = 0;
  *(undefined2 *)((longlong)param_1 + 0x2c6) = 0;
  *(undefined1 *)(param_1 + 0xb2) = 0;
  memset(param_1 + 4,0,0x28);
  memset((void *)((longlong)param_1 + 0x5a),0,200);
  memset((void *)((longlong)param_1 + 0x122),0,400);
  *(undefined8 *)((longlong)param_1 + 0x2b2) = 0;
  *(undefined8 *)((longlong)param_1 + 0x2ba) = 0;
  return param_1;
}



undefined4 * FUN_14007c590(undefined4 *param_1)

{
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)(param_1 + 4) = 0;
  *(undefined2 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined4 *)((longlong)param_1 + 0x42) = 0;
  *(undefined2 *)((longlong)param_1 + 0x46) = 0;
  *(undefined8 *)(param_1 + 0x12) = 0;
  *(undefined8 *)(param_1 + 0x14) = 0;
  param_1[0x16] = 0;
  *(undefined2 *)(param_1 + 0x17) = 0;
  *(undefined4 *)((longlong)param_1 + 0x5e) = 0;
  *(undefined2 *)((longlong)param_1 + 0x62) = 0;
  *(undefined8 *)(param_1 + 0x19) = 0;
  *(undefined8 *)(param_1 + 0x1b) = 0;
  *(undefined8 *)(param_1 + 0x1f) = 0;
  *(undefined8 *)(param_1 + 0x1d) = 0;
  param_1[0x21] = 0;
  *(undefined2 *)(param_1 + 0x22) = 0;
  *(undefined8 *)((longlong)param_1 + 0x8a) = 0;
  *(undefined1 *)((longlong)param_1 + 0x92) = 0;
  *(undefined8 *)((longlong)param_1 + 0x93) = 0;
  *(undefined8 *)((longlong)param_1 + 0x9b) = 0;
  *(undefined2 *)((longlong)param_1 + 0xa3) = 0;
  *(undefined1 *)((longlong)param_1 + 0xa5) = 0;
  *(undefined8 *)((longlong)param_1 + 0xa6) = 0;
  *(undefined8 *)((longlong)param_1 + 0xae) = 0;
  *(undefined8 *)((longlong)param_1 + 0xb6) = 0;
  *(undefined2 *)((longlong)param_1 + 0xbe) = 0;
  param_1[0x30] = 0;
  *(undefined2 *)(param_1 + 0x31) = 0;
  *(undefined4 *)((longlong)param_1 + 0xc6) = 7;
  *(undefined8 *)((longlong)param_1 + 0xca) = 0;
  *(undefined8 *)((longlong)param_1 + 0xd2) = 0;
  *(undefined8 *)((longlong)param_1 + 0x22) = 0;
  *(undefined8 *)((longlong)param_1 + 0x2a) = 0;
  *(undefined8 *)((longlong)param_1 + 0x32) = 0;
  *(undefined8 *)((longlong)param_1 + 0x3a) = 0;
  *(undefined8 *)((longlong)param_1 + 0xda) = 0;
  *(undefined8 *)((longlong)param_1 + 0xe2) = 0;
  *(undefined8 *)((longlong)param_1 + 0xea) = 0;
  *(undefined8 *)((longlong)param_1 + 0xf2) = 0;
  *(undefined8 *)((longlong)param_1 + 0xfa) = 0;
  *(undefined8 *)((longlong)param_1 + 0x102) = 0;
  *(undefined8 *)((longlong)param_1 + 0x10a) = 0;
  *(undefined8 *)((longlong)param_1 + 0x112) = 0;
  *(undefined8 *)((longlong)param_1 + 0x11a) = 0;
  return param_1;
}



void FUN_14007c6e0(longlong param_1,undefined4 param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  undefined1 local_58 [80];
  
  lVar4 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(lVar2 + 0x18);
    FUN_14003cda0(lVar2,iVar1 + 4);
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar2 + 0x10);
    }
    *(undefined4 *)(iVar1 + lVar4) = param_2;
    goto LAB_14007c798;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  iVar3 = iVar1 + 4;
  if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(int *)(param_1 + 0x18) = iVar3;
  *(undefined4 *)((longlong)iVar1 + *(longlong *)(param_1 + 0x10)) = param_2;
LAB_14007c798:
  FUN_14003ced0(param_1);
  return;
}



void FUN_14007c7c0(longlong param_1,undefined4 param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  undefined1 local_58 [80];
  
  lVar4 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(lVar2 + 0x18);
    FUN_14003cda0(lVar2,iVar1 + 4);
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar2 + 0x10);
    }
    *(undefined4 *)(iVar1 + lVar4) = param_2;
    goto LAB_14007c881;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  iVar3 = iVar1 + 4;
  if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(int *)(param_1 + 0x18) = iVar3;
  *(undefined4 *)((longlong)iVar1 + *(longlong *)(param_1 + 0x10)) = param_2;
LAB_14007c881:
  FUN_14003ced0(param_1);
  return;
}



void FUN_14007c8a0(longlong param_1,undefined8 param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  undefined1 local_58 [80];
  
  lVar4 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(lVar2 + 0x18);
    FUN_14003cda0(lVar2,iVar1 + 8);
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar2 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar4) = param_2;
    goto LAB_14007c965;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  iVar3 = iVar1 + 8;
  if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(int *)(param_1 + 0x18) = iVar3;
  *(undefined8 *)((longlong)iVar1 + *(longlong *)(param_1 + 0x10)) = param_2;
LAB_14007c965:
  FUN_14003ced0(param_1);
  return;
}



undefined8 FUN_14007c990(undefined8 param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t *pwVar1;
  char cVar2;
  wchar_t *pwVar3;
  undefined1 local_res8;
  undefined1 uStackX_9;
  undefined2 uStackX_a;
  undefined4 uStackX_c;
  wchar_t *local_res10;
  wchar_t *local_res18;
  wchar_t *local_res20;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1401a2570();
  FUN_1401a2570(param_1,param_2 + 0x10);
  cVar2 = FUN_140185490(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x20) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x42) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x44) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x46) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 0x48) =
         CONCAT44(uStackX_c,CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8)));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x50) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x54) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x58) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x5c) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x5e) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x62) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 100) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x68) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  FUN_1401a2570(param_1,param_2 + 0x6c);
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x7c) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x7e) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x80) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x82) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x84) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x88) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x8a) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x8e) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 0x93) =
         CONCAT44(uStackX_c,CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8)));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x9b) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x90) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x91) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x92) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x9f) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0xa0) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0xa1) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0xa2) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0xa3) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0xa4) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0xa5) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xa6) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xa8) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xaa) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xac) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xae) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xb0) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xb2) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xb4) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xb6) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xba) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xbe) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xc0) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xc4) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xc6) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 0xca) =
         CONCAT44(uStackX_c,CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8)));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xd2) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xd6) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  FUN_1400a3440();
  local_res20 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res20);
  pwVar3 = local_res20;
  if (local_res20 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x22),0x10,pwVar3);
  FUN_1400a3440();
  local_res18 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res18);
  pwVar3 = local_res18;
  if (local_res18 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0xda),0x14,pwVar3);
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x102),0x10,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  pwVar3 = local_res18;
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  if (((local_res18 != (wchar_t *)0x0) && (local_res18 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res18 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  pwVar3 = local_res20;
  if (((local_res20 != (wchar_t *)0x0) && (local_res20 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res20 + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res18 = (wchar_t *)PTR_DAT_1402f8010;
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return param_1;
}



void FUN_14007d1a0(undefined8 param_1,longlong param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"{ %d %s }",(int)*(short *)(param_2 + 0x20),param_2 + 0x22,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



undefined8 FUN_14007d250(undefined8 param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t *pwVar1;
  char cVar2;
  wchar_t *pwVar3;
  wchar_t local_res8 [4];
  wchar_t *local_res18;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  cVar2 = FUN_140185490(param_1,local_res8,2,param_4,0xfffffffffffffffe);
  if (cVar2 != '\0') {
    param_2[0x10] = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    param_2[0x11] = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    param_2[0x12] = local_res8[0];
  }
  FUN_1400a3440();
  local_res18 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res18);
  pwVar3 = local_res18;
  if (local_res18 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s(param_2,0x10,pwVar3);
  pwVar3 = local_res18;
  if (((local_res18 != (wchar_t *)0x0) && (local_res18 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res18 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return param_1;
}



void FUN_14007d370(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res18 [2];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res18[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res18,L"{ %s }",param_2,param_4,uVar4);
  FUN_14003c400(param_1,local_res18);
  puVar3 = local_res18[0];
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res18[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



undefined8 FUN_14007d420(undefined8 param_1,undefined8 *param_2)

{
  char cVar1;
  undefined4 local_res8;
  undefined4 uStackX_c;
  
  cVar1 = FUN_140185490(param_1,&local_res8,8);
  if (cVar1 != '\0') {
    *param_2 = CONCAT44(uStackX_c,local_res8);
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 1) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x14) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,8);
  if (cVar1 != '\0') {
    param_2[3] = CONCAT44(uStackX_c,local_res8);
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 4) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x24) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 5) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x2c) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 6) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x34) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 7) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x3c) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 8) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x44) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 9) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x4c) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 10) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x54) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 2) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0xc) = local_res8;
  }
  return param_1;
}



void FUN_14007d680(undefined8 param_1,undefined8 *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"{ %I64d %d %d %d }",*param_2,*(undefined4 *)(param_2 + 1),
                *(undefined4 *)(param_2 + 4),*(undefined4 *)((longlong)param_2 + 0x24),uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



undefined8 FUN_14007d740(undefined8 param_1,undefined2 *param_2)

{
  wchar_t *pwVar1;
  char cVar2;
  undefined8 uVar3;
  wchar_t *pwVar4;
  undefined2 local_res8 [4];
  undefined2 local_res10 [4];
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  wchar_t *local_38;
  undefined8 local_30;
  undefined1 local_28;
  undefined8 local_20;
  
  local_20 = 0xfffffffffffffffe;
  cVar2 = FUN_140185490(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *param_2 = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res10,2);
  if (cVar2 != '\0') {
    param_2[0x11] = local_res10[0];
  }
  cVar2 = FUN_140185490(param_1,&local_30,8);
  if (cVar2 != '\0') {
    *(undefined8 *)(param_2 + 0x12) = local_30;
  }
  cVar2 = FUN_140185490(param_1,local_res18,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x16) = local_res18[0];
  }
  cVar2 = FUN_140185490(param_1,local_res20,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x18) = local_res20[0];
  }
  FUN_1400a3440();
  local_38 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_38);
  pwVar4 = local_38;
  if (local_38 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s(param_2 + 1,0x10,pwVar4);
  pwVar4 = local_38;
  if (((local_38 != (wchar_t *)0x0) && (local_38 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_38 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_1400a3440();
    local_30 = uVar3;
    FUN_1400a1c30(uVar3);
    local_28 = 1;
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar3);
  }
  return param_1;
}



undefined8 FUN_14007d890(undefined8 param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t *pwVar1;
  char cVar2;
  wchar_t *pwVar3;
  undefined4 local_res8 [2];
  wchar_t *local_res10;
  wchar_t *local_res18 [2];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1401a2570();
  FUN_1401a2570(param_1,param_2 + 0x10);
  cVar2 = FUN_140185490(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x20) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x22) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x84) = local_res8[0];
  }
  FUN_1400a3440();
  local_res18[0] = (wchar_t *)PTR_DAT_1402f8010;
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,local_res18);
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar3 = local_res18[0];
  if (local_res18[0] == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x24),0x10,pwVar3);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x44),0x20,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  pwVar3 = local_res18[0];
  if (((local_res18[0] != (wchar_t *)0x0) && (local_res18[0] != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res18[0] + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res10 = (wchar_t *)PTR_DAT_1402f8010;
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return param_1;
}



undefined8 FUN_14007da50(undefined8 param_1,longlong param_2)

{
  wchar_t *pwVar1;
  char cVar2;
  undefined8 uVar3;
  undefined2 *puVar4;
  wchar_t *pwVar5;
  longlong lVar6;
  undefined1 local_res8;
  undefined1 uStackX_9;
  undefined2 uStackX_a;
  undefined4 uStackX_c;
  wchar_t *local_res10;
  wchar_t *local_res18;
  wchar_t *local_res20;
  
  FUN_1401a2570();
  FUN_1401a2570(param_1,param_2 + 0x38);
  lVar6 = 8;
  cVar2 = FUN_140185490(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 0x48) =
         CONCAT44(uStackX_c,CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8)));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x50) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x54) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x58) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x2c2) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x2c6) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x2c4) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x2c8) = local_res8;
  }
  puVar4 = (undefined2 *)(param_2 + 0x2b2);
  do {
    cVar2 = FUN_140185490(param_1,&local_res8,2);
    if (cVar2 != '\0') {
      *puVar4 = CONCAT11(uStackX_9,local_res8);
    }
    puVar4 = puVar4 + 1;
    lVar6 = lVar6 + -1;
  } while (lVar6 != 0);
  FUN_1400a3440();
  local_res20 = (wchar_t *)PTR_DAT_1402f8010;
  FUN_1400a3440();
  local_res18 = (wchar_t *)PTR_DAT_1402f8010;
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res20);
  thunk_FUN_1401865d0(param_1,&local_res18);
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar5 = local_res20;
  if (local_res20 == (wchar_t *)0x0) {
    pwVar5 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcsncpy_s((wchar_t *)(param_2 + 0x10),0x14,pwVar5,0x13);
  pwVar5 = local_res18;
  if (local_res18 == (wchar_t *)0x0) {
    pwVar5 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcsncpy_s((wchar_t *)(param_2 + 0x5a),100,pwVar5,99);
  pwVar5 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar5 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcsncpy_s((wchar_t *)(param_2 + 0x122),200,pwVar5,199);
  pwVar5 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    pwVar5 = pwVar5 + -2;
    *(int *)pwVar5 = *(int *)pwVar5 + -1;
    if (*(int *)pwVar5 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar3);
  }
  pwVar5 = local_res18;
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  if (((local_res18 != (wchar_t *)0x0) && (local_res18 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res18 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    pwVar5 = pwVar5 + -2;
    *(int *)pwVar5 = *(int *)pwVar5 + -1;
    if (*(int *)pwVar5 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar3);
  }
  pwVar5 = local_res20;
  if (((local_res20 != (wchar_t *)0x0) && (local_res20 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res20 + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res18 = (wchar_t *)PTR_DAT_1402f8010;
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    pwVar5 = pwVar5 + -2;
    *(int *)pwVar5 = *(int *)pwVar5 + -1;
    if (*(int *)pwVar5 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar3);
  }
  return param_1;
}



void FUN_14007dd60(undefined8 param_1,longlong param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"{ %s %d }",param_2 + 0x10,(int)*(short *)(param_2 + 0x58),uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



undefined8 FUN_14007de10(undefined8 param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t *pwVar1;
  char cVar2;
  wchar_t *pwVar3;
  undefined2 local_res8;
  undefined6 uStackX_a;
  wchar_t *local_res10;
  wchar_t *local_res18 [2];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1401a2570();
  cVar2 = FUN_140185490(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x50) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x52) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x54) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,8,param_4,uVar4);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 0x56) = CONCAT62(uStackX_a,local_res8);
  }
  FUN_1400a3440();
  local_res18[0] = (wchar_t *)PTR_DAT_1402f8010;
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,local_res18);
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar3 = local_res18[0];
  if (local_res18[0] == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x10),0x10,pwVar3);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x30),0x10,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  pwVar3 = local_res18[0];
  if (((local_res18[0] != (wchar_t *)0x0) && (local_res18[0] != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res18[0] + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res10 = (wchar_t *)PTR_DAT_1402f8010;
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return param_1;
}



undefined8 FUN_14007dfe0(undefined8 param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t *pwVar1;
  char cVar2;
  wchar_t *pwVar3;
  undefined4 local_res8 [2];
  wchar_t *local_res10;
  wchar_t *local_res18 [2];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1401a2570();
  cVar2 = FUN_140185490(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x10) = local_res8[0];
  }
  FUN_1400a3440();
  local_res18[0] = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,local_res18);
  pwVar3 = local_res18[0];
  if (local_res18[0] == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x14),0x14,pwVar3);
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x3c),0x10,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  pwVar3 = local_res18[0];
  if (((local_res18[0] != (wchar_t *)0x0) && (local_res18[0] != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res18[0] + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res10 = (wchar_t *)PTR_DAT_1402f8010;
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return param_1;
}



void FUN_14007e150(undefined8 param_1,undefined4 *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"{ %d %d }",*param_2,param_2[1],uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



undefined8 FUN_14007e200(undefined8 param_1,longlong param_2)

{
  FUN_140185f20();
  FUN_140185f20(param_1,param_2 + 4);
  FUN_1401a2570(param_1,param_2 + 8);
  return param_1;
}



void FUN_14007e240(undefined8 param_1,short *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined8 uVar4;
  undefined *local_res10 [3];
  
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"{ %s %d %d }",param_2 + 0x17,(int)*param_2,(int)param_2[2]);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



undefined8
FUN_14007e300(undefined8 param_1,undefined2 *param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t *pwVar1;
  char cVar2;
  undefined8 uVar3;
  wchar_t *pwVar4;
  undefined2 local_res8;
  undefined6 uStackX_a;
  wchar_t *local_res10;
  wchar_t *local_res18 [2];
  
  cVar2 = FUN_140185490(param_1,&local_res8,2,param_4,0xfffffffffffffffe);
  if (cVar2 != '\0') {
    *param_2 = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[1] = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[2] = local_res8;
  }
  FUN_1401a2570(param_1,param_2 + 7);
  FUN_1401a2570(param_1,param_2 + 0xf);
  cVar2 = FUN_140185490(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 3) = CONCAT62(uStackX_a,local_res8);
  }
  FUN_1400a3440();
  local_res18[0] = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,local_res18);
  pwVar4 = local_res18[0];
  if (local_res18[0] == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcsncpy_s(param_2 + 0x17,0x10,pwVar4,0xf);
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar4 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcsncpy_s(param_2 + 0x27,0x10,pwVar4,0xf);
  pwVar4 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar3);
  }
  pwVar4 = local_res18[0];
  if (((local_res18[0] != (wchar_t *)0x0) && (local_res18[0] != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res18[0] + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res10 = (wchar_t *)PTR_DAT_1402f8010;
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar3);
  }
  return param_1;
}



void FUN_14007e4e0(undefined8 param_1,undefined1 *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"{ %d %d }",*(undefined4 *)(param_2 + 1),*param_2,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



undefined8 FUN_14007e590(undefined8 param_1,undefined1 *param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  cVar1 = FUN_140185490(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *param_2 = (undefined1)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 1) = local_res8[0];
  }
  FUN_1401a2570(param_1,param_2 + 5);
  FUN_1401a2570(param_1,param_2 + 0x15);
  return param_1;
}



undefined8 FUN_14007e600(undefined8 param_1,undefined1 *param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  cVar1 = FUN_140185490(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *param_2 = (undefined1)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 1) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 5) = local_res8[0];
  }
  return param_1;
}



void FUN_14007e680(undefined8 param_1,undefined1 *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"{ %d %d }",*(undefined4 *)(param_2 + 5),*param_2,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



undefined8
FUN_14007e730(undefined8 param_1,undefined1 *param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t *pwVar1;
  char cVar2;
  undefined8 uVar3;
  wchar_t *pwVar4;
  undefined1 local_res8 [8];
  wchar_t *local_res10;
  wchar_t *local_res18;
  wchar_t *local_res20;
  
  cVar2 = FUN_140185490(param_1,local_res8,1,param_4,0xfffffffffffffffe);
  if (cVar2 != '\0') {
    *param_2 = local_res8[0];
  }
  FUN_1400a3440();
  local_res20 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res20);
  pwVar4 = local_res20;
  if (local_res20 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 1),0x14,pwVar4);
  FUN_1400a3440();
  local_res18 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res18);
  pwVar4 = local_res18;
  if (local_res18 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x29),0x10,pwVar4);
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar4 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x49),0x1e,pwVar4);
  pwVar4 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar3);
  }
  pwVar4 = local_res18;
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  if (((local_res18 != (wchar_t *)0x0) && (local_res18 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res18 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar3);
  }
  pwVar4 = local_res20;
  if (((local_res20 != (wchar_t *)0x0) && (local_res20 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res20 + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res18 = (wchar_t *)PTR_DAT_1402f8010;
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar3);
  }
  return param_1;
}



undefined8 FUN_14007e920(undefined8 param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t *pwVar1;
  char cVar2;
  undefined8 uVar3;
  wchar_t *pwVar4;
  wchar_t local_res8 [4];
  wchar_t *local_res10;
  wchar_t *local_res18 [2];
  
  cVar2 = FUN_140185490(param_1,local_res8,2,param_4,0xfffffffffffffffe);
  if (cVar2 != '\0') {
    param_2[0x20] = local_res8[0];
  }
  FUN_1400a3440();
  local_res18[0] = (wchar_t *)PTR_DAT_1402f8010;
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,local_res18);
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar4 = local_res18[0];
  if (local_res18[0] == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s(param_2,0x20,pwVar4);
  pwVar4 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s(param_2 + 0x21,0x10,pwVar4);
  pwVar4 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar3);
  }
  pwVar4 = local_res18[0];
  if (((local_res18[0] != (wchar_t *)0x0) && (local_res18[0] != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res18[0] + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res10 = (wchar_t *)PTR_DAT_1402f8010;
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar3);
  }
  return param_1;
}



undefined8
FUN_14007ea80(undefined8 param_1,undefined2 *param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t *pwVar1;
  char cVar2;
  wchar_t *pwVar3;
  undefined2 local_res8;
  undefined2 uStackX_a;
  undefined4 uStackX_c;
  wchar_t *local_res10;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  cVar2 = FUN_140185490(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *param_2 = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    param_2[1] = local_res8;
  }
  FUN_1401a2570(param_1,param_2 + 2);
  FUN_1401a2570(param_1,param_2 + 10);
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x12) = CONCAT22(uStackX_a,local_res8);
  }
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s(param_2 + 0x14,0x10,pwVar3);
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[0x24] = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x25) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x27) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 0x29) = CONCAT44(uStackX_c,CONCAT22(uStackX_a,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x2d) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x2f) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x31) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[0x33] = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x34) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x36) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x38) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x3a) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x3c) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x3e) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x40) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x42) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x44) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x46) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x48) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x4a) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x4c) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x4e) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  pwVar3 = local_res10;
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x50) = CONCAT22(uStackX_a,local_res8);
  }
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return param_1;
}



undefined8 FUN_14007ee50(undefined8 param_1,undefined2 *param_2)

{
  FUN_14003d020(param_1,*param_2);
  FUN_14003d020(param_1,param_2[1]);
  FUN_1401a2620(param_1,param_2 + 2);
  FUN_1401a2620(param_1,param_2 + 10);
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x12));
  FUN_140186dd0(param_1,param_2 + 0x14);
  FUN_14003d020(param_1,param_2[0x24]);
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x25));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x27));
  FUN_14007c8a0(param_1,*(undefined8 *)(param_2 + 0x29));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x2d));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x2f));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x31));
  FUN_14003d020(param_1,param_2[0x33]);
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x34));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x36));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x38));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x3a));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x3c));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x3e));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x40));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x42));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x44));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x46));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x48));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x4a));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x4c));
  FUN_14007c7c0(param_1,*(undefined4 *)(param_2 + 0x4e));
  FUN_14007c7c0(param_1,*(undefined4 *)(param_2 + 0x50));
  return param_1;
}



undefined8 FUN_14007efe0(undefined8 param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t *pwVar1;
  char cVar2;
  wchar_t *pwVar3;
  undefined4 local_res8 [2];
  wchar_t *local_res10;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  FUN_1401a2570(param_1,param_2);
  FUN_1401a2570(param_1,param_2 + 0x10);
  cVar2 = FUN_140185490(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x20) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x24) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x28) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x2c) = local_res8[0];
  }
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x30),0x10,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return param_1;
}



void FUN_14007f130(undefined8 param_1,undefined4 *param_2)

{
  int *piVar1;
  undefined *puVar2;
  longlong *plVar3;
  undefined *puVar4;
  undefined *local_res10;
  undefined *local_res18;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10 = PTR_DAT_1402f8010;
  plVar3 = (longlong *)FUN_14007fc50(&local_res18,param_2 + 1);
  puVar4 = (undefined *)*plVar3;
  if ((undefined *)*plVar3 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1402f8010;
  }
  FUN_14003c600(&local_res10,L"{ %d %s }",*param_2,puVar4,uVar5);
  if (((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1402f8010)) &&
     (local_res18 + -8 != (undefined *)0x0)) {
    uVar5 = FUN_1400a3440();
    FUN_1400a1c30(uVar5);
    piVar1 = (int *)(local_res18 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res18 + -8);
    }
    FUN_1400d1290(uVar5);
  }
  FUN_14003c400(param_1,&local_res10);
  puVar4 = local_res10;
  if (((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1402f8010)) &&
     (puVar2 = local_res10 + -8, puVar2 != (undefined *)0x0)) {
    uVar5 = FUN_1400a3440();
    FUN_1400a1c30(uVar5);
    piVar1 = (int *)(puVar4 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2);
    }
    FUN_1400d1290(uVar5);
  }
  return;
}



undefined8
FUN_14007f250(undefined8 param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t *pwVar1;
  char cVar2;
  wchar_t *pwVar3;
  undefined4 local_res8;
  undefined4 uStackX_c;
  wchar_t *local_res10;
  wchar_t *local_res18;
  wchar_t *local_res20;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  cVar2 = FUN_140185490(param_1,&local_res8,4,param_4,0xfffffffffffffffe);
  if (cVar2 != '\0') {
    *param_2 = local_res8;
  }
  FUN_1401a2570(param_1,param_2 + 1);
  FUN_1401a2570(param_1,param_2 + 5);
  cVar2 = FUN_140185490(param_1,&local_res8,1,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 9) = (undefined1)local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined1 *)((longlong)param_2 + 0x25) = (undefined1)local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)((longlong)param_2 + 0x26) = (undefined1)local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)((longlong)param_2 + 0x2a9) = CONCAT44(uStackX_c,local_res8);
  }
  FUN_1400a3440();
  local_res20 = (wchar_t *)PTR_DAT_1402f8010;
  FUN_1400a3440();
  local_res18 = (wchar_t *)PTR_DAT_1402f8010;
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res20);
  thunk_FUN_1401865d0(param_1,&local_res18);
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar3 = local_res20;
  if (local_res20 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)((longlong)param_2 + 0x27),0x10,pwVar3);
  pwVar3 = local_res18;
  if (local_res18 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)((longlong)param_2 + 0x47),0x32,pwVar3);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)((longlong)param_2 + 0xab),0xff,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  pwVar3 = local_res18;
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  if (((local_res18 != (wchar_t *)0x0) && (local_res18 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res18 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  pwVar3 = local_res20;
  if (((local_res20 != (wchar_t *)0x0) && (local_res20 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res20 + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res18 = (wchar_t *)PTR_DAT_1402f8010;
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return param_1;
}



void FUN_14007f4c0(undefined8 param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,L"{ %s }",param_2 + 8,param_4,uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



undefined8
FUN_14007f570(undefined8 param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t *pwVar1;
  char cVar2;
  wchar_t *pwVar3;
  undefined4 local_res8 [2];
  wchar_t *local_res10;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  cVar2 = FUN_140185490(param_1,local_res8,4,param_4,0xfffffffffffffffe);
  if (cVar2 != '\0') {
    *param_2 = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    param_2[1] = local_res8[0];
  }
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 2),0x80,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return param_1;
}



undefined8
FUN_14007f670(undefined8 param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t *pwVar1;
  char cVar2;
  undefined8 uVar3;
  wchar_t *pwVar4;
  undefined4 local_res8 [2];
  wchar_t *local_res10;
  
  cVar2 = FUN_140185490(param_1,local_res8,4,param_4,0xfffffffffffffffe);
  if (cVar2 != '\0') {
    *param_2 = local_res8[0];
  }
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar4 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 1),0x40,pwVar4);
  pwVar4 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar3);
  }
  return param_1;
}



undefined8
FUN_14007f750(undefined8 param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  wchar_t *pwVar2;
  undefined *puVar3;
  undefined *puVar4;
  char cVar5;
  wchar_t *pwVar6;
  undefined *local_res8;
  wchar_t *local_res10;
  undefined *local_res18;
  undefined8 uVar7;
  
  uVar7 = 0xfffffffffffffffe;
  cVar5 = FUN_140185490(param_1,&local_res8,4,param_4,0xfffffffffffffffe);
  if (cVar5 != '\0') {
    *param_2 = local_res8._0_4_;
  }
  FUN_1401a2570(param_1,param_2 + 1);
  cVar5 = FUN_140185490(param_1,&local_res8,4,param_4,uVar7);
  if (cVar5 != '\0') {
    param_2[0xd] = local_res8._0_4_;
  }
  cVar5 = FUN_140185490(param_1,&local_res8,4,param_4,uVar7);
  if (cVar5 != '\0') {
    param_2[0xe] = local_res8._0_4_;
  }
  cVar5 = FUN_140185490(param_1,&local_res8,1,param_4,uVar7);
  if (cVar5 != '\0') {
    *(undefined1 *)(param_2 + 0xf) = local_res8._0_1_;
  }
  cVar5 = FUN_140185490(param_1,&local_res8,4);
  if (cVar5 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x3d) = local_res8._0_4_;
  }
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  FUN_1400a3440();
  puVar3 = PTR_DAT_1402f8010;
  local_res8 = PTR_DAT_1402f8010;
  FUN_1400a3440();
  puVar4 = PTR_DAT_1402f8010;
  local_res18 = PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar6 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar6 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 5),0x10,pwVar6);
  if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1402f8010)) &&
     (puVar4 + -8 != (undefined *)0x0)) {
    uVar7 = FUN_1400a3440();
    FUN_1400a1c30(uVar7);
    piVar1 = (int *)(puVar4 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar4 + -8);
    }
    FUN_1400d1290(uVar7);
  }
  if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1402f8010)) &&
     (puVar3 + -8 != (undefined *)0x0)) {
    uVar7 = FUN_1400a3440();
    FUN_1400a1c30(uVar7);
    piVar1 = (int *)(puVar3 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar3 + -8);
    }
    FUN_1400d1290(uVar7);
  }
  pwVar6 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar2 = local_res10 + -4, pwVar2 != (wchar_t *)0x0)) {
    uVar7 = FUN_1400a3440();
    FUN_1400a1c30(uVar7);
    pwVar6 = pwVar6 + -2;
    *(int *)pwVar6 = *(int *)pwVar6 + -1;
    if (*(int *)pwVar6 == 0) {
      FUN_1400a3530(pwVar2);
    }
    FUN_1400d1290(uVar7);
  }
  return param_1;
}



undefined8
FUN_14007f960(undefined8 param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  short sVar2;
  char cVar3;
  ulonglong uVar4;
  short *psVar5;
  short *psVar6;
  undefined4 local_res8 [2];
  short *local_res10;
  short *local_res18;
  short *local_res20;
  undefined8 uVar7;
  
  uVar7 = 0xfffffffffffffffe;
  cVar3 = FUN_140185490(param_1,local_res8,4,param_4,0xfffffffffffffffe);
  if (cVar3 != '\0') {
    *param_2 = local_res8[0];
  }
  cVar3 = FUN_140185490(param_1,local_res8,4,param_4,uVar7);
  if (cVar3 != '\0') {
    param_2[1] = local_res8[0];
  }
  cVar3 = FUN_140185490(param_1,local_res8,4,param_4,uVar7);
  if (cVar3 != '\0') {
    param_2[2] = local_res8[0];
  }
  cVar3 = FUN_140185490(param_1,local_res8,1,param_4,uVar7);
  if (cVar3 != '\0') {
    *(undefined1 *)(param_2 + 3) = (undefined1)local_res8[0];
  }
  cVar3 = FUN_140185490(param_1,local_res8,4,param_4,uVar7);
  if (cVar3 != '\0') {
    param_2[4] = local_res8[0];
  }
  cVar3 = FUN_140185490(param_1,local_res8,4);
  if (cVar3 != '\0') {
    param_2[5] = local_res8[0];
  }
  cVar3 = FUN_140185490(param_1,local_res8,4);
  if (cVar3 != '\0') {
    param_2[6] = local_res8[0];
  }
  cVar3 = FUN_140185490(param_1,local_res8,4);
  if (cVar3 != '\0') {
    param_2[7] = local_res8[0];
  }
  cVar3 = FUN_140185490(param_1,local_res8,1);
  if (cVar3 != '\0') {
    *(undefined1 *)(param_2 + 8) = (undefined1)local_res8[0];
  }
  FUN_1400a3440();
  local_res20 = (short *)PTR_DAT_1402f8010;
  FUN_1400a3440();
  local_res18 = (short *)PTR_DAT_1402f8010;
  FUN_1400a3440();
  local_res10 = (short *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res20);
  thunk_FUN_1401865d0(param_1,&local_res18);
  thunk_FUN_1401865d0(param_1,&local_res10);
  psVar5 = local_res20;
  if (local_res20 == (short *)0x0) {
    psVar5 = (short *)PTR_DAT_1402f8010;
  }
  uVar4 = 0xffffffffffffffff;
  psVar6 = psVar5;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar2 = *psVar6;
    psVar6 = psVar6 + 1;
  } while (sVar2 != 0);
  FUN_140001b00(param_2 + 10,psVar5,~uVar4 - 1);
  psVar5 = local_res18;
  if (local_res18 == (short *)0x0) {
    psVar5 = (short *)PTR_DAT_1402f8010;
  }
  uVar4 = 0xffffffffffffffff;
  psVar6 = psVar5;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar2 = *psVar6;
    psVar6 = psVar6 + 1;
  } while (sVar2 != 0);
  FUN_140001b00(param_2 + 0x14,psVar5,~uVar4 - 1);
  psVar5 = local_res10;
  if (local_res10 == (short *)0x0) {
    psVar5 = (short *)PTR_DAT_1402f8010;
  }
  uVar4 = 0xffffffffffffffff;
  psVar6 = psVar5;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar2 = *psVar6;
    psVar6 = psVar6 + 1;
  } while (sVar2 != 0);
  FUN_140001b00(param_2 + 0x1e,psVar5,~uVar4 - 1);
  psVar5 = local_res10;
  if (((local_res10 != (short *)0x0) && (local_res10 != (short *)PTR_DAT_1402f8010)) &&
     (psVar6 = local_res10 + -4, psVar6 != (short *)0x0)) {
    uVar7 = FUN_1400a3440();
    FUN_1400a1c30(uVar7);
    piVar1 = (int *)(psVar5 + -2);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(psVar6);
    }
    FUN_1400d1290(uVar7);
  }
  psVar5 = local_res18;
  local_res10 = (short *)PTR_DAT_1402f8010;
  if (((local_res18 != (short *)0x0) && (local_res18 != (short *)PTR_DAT_1402f8010)) &&
     (psVar6 = local_res18 + -4, psVar6 != (short *)0x0)) {
    uVar7 = FUN_1400a3440();
    FUN_1400a1c30(uVar7);
    piVar1 = (int *)(psVar5 + -2);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(psVar6);
    }
    FUN_1400d1290(uVar7);
  }
  psVar5 = local_res20;
  if (((local_res20 != (short *)0x0) && (local_res20 != (short *)PTR_DAT_1402f8010)) &&
     (psVar6 = local_res20 + -4, psVar6 != (short *)0x0)) {
    local_res18 = (short *)PTR_DAT_1402f8010;
    uVar7 = FUN_1400a3440();
    FUN_1400a1c30(uVar7);
    piVar1 = (int *)(psVar5 + -2);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(psVar6);
    }
    FUN_1400d1290(uVar7);
  }
  return param_1;
}



longlong * FUN_14007fc50(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined *puVar2;
  char cVar3;
  undefined *puVar4;
  undefined *local_res20;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res20 = PTR_DAT_1402f8010;
  cVar3 = FUN_1400aac50(param_2,&local_res20,param_3,param_4,uVar5);
  if (cVar3 == '\0') {
    FUN_1400a3440();
    puVar2 = local_res20;
    puVar4 = PTR_DAT_1402f8010;
    *param_1 = (longlong)PTR_DAT_1402f8010;
    if (local_res20 == (undefined *)0x0) {
      return param_1;
    }
    if (local_res20 == puVar4) {
      return param_1;
    }
    puVar4 = local_res20 + -8;
    if (puVar4 == (undefined *)0x0) {
      return param_1;
    }
    uVar5 = FUN_1400a3440();
    FUN_1400a1c30(uVar5);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar4);
    }
  }
  else {
    FUN_1400a3440();
    puVar4 = PTR_DAT_1402f8010;
    *param_1 = (longlong)PTR_DAT_1402f8010;
    if (puVar4 == (undefined *)0x0) {
      *param_1 = 0;
    }
    if (local_res20 != (undefined *)*param_1) {
      uVar5 = FUN_1400a3440();
      FUN_1400a1c30(uVar5);
      FUN_1400031d0(param_1);
      *param_1 = (longlong)local_res20;
      if (((local_res20 != PTR_DAT_1402f8010) && (local_res20 != (undefined *)0x0)) &&
         (local_res20 != (undefined *)0x8)) {
        *(int *)(local_res20 + -4) = *(int *)(local_res20 + -4) + 1;
      }
      FUN_1400d1290(uVar5);
      puVar4 = PTR_DAT_1402f8010;
    }
    puVar2 = local_res20;
    if (local_res20 == (undefined *)0x0) {
      return param_1;
    }
    if (local_res20 == puVar4) {
      return param_1;
    }
    puVar4 = local_res20 + -8;
    if (puVar4 == (undefined *)0x0) {
      return param_1;
    }
    uVar5 = FUN_1400a3440();
    FUN_1400a1c30(uVar5);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar4);
    }
  }
  FUN_1400d1290(uVar5);
  return param_1;
}



undefined8 FUN_14007fdd0(undefined8 param_1,undefined4 *param_2)

{
  char cVar1;
  longlong lVar2;
  undefined4 *puVar3;
  undefined4 local_res8 [2];
  
  puVar3 = param_2 + 0x20;
  lVar2 = 0x20;
  do {
    cVar1 = FUN_140185490(param_1,local_res8,4);
    if (cVar1 != '\0') {
      *param_2 = local_res8[0];
    }
    FUN_1401a2570(param_1,puVar3);
    puVar3 = puVar3 + 4;
    param_2 = param_2 + 1;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  return param_1;
}



void FUN_14007fe50(undefined8 param_1,undefined4 *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10[0] = PTR_DAT_1402f8010;
  FUN_14003c600(local_res10,
                L"{ type=%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d }"
                ,*param_2,param_2[1],param_2[2],param_2[3],param_2[4],param_2[5],param_2[6],
                param_2[7],param_2[8],param_2[9],param_2[10],param_2[0xb],param_2[0xc],param_2[0xd],
                param_2[0xe],param_2[0xf],param_2[0x10],param_2[0x11],param_2[0x12],param_2[0x13],
                param_2[0x14],param_2[0x15],param_2[0x16],param_2[0x17],param_2[0x18],param_2[0x19],
                param_2[0x1a],param_2[0x1b],param_2[0x1c],param_2[0x1d],param_2[0x1e],param_2[0x1f],
                uVar4);
  FUN_14003c400(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



undefined8 FUN_140080030(undefined8 param_1,longlong param_2)

{
  FUN_1401a2620();
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x10));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x14));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x16));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x18));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x1c));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x20));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x24));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x28));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x30));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x34));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x38));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x3c));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x40));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x44));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x2c));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x48));
  FUN_14003c9e0(param_1,*(undefined1 *)(param_2 + 100));
  FUN_14003c9e0(param_1,*(undefined1 *)(param_2 + 0x65));
  FUN_14003c9e0(param_1,*(undefined1 *)(param_2 + 0x66));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x4c));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x50));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x54));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x58));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x5c));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x60));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x6c));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x6e));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x70));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x7c));
  FUN_1401a2620(param_1,param_2 + 0x80);
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x90));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x94));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x96));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x98));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x9c));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0xa0));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x68));
  FUN_140186dd0(param_1,param_2 + 0x74);
  return param_1;
}



undefined8 FUN_140080220(undefined8 param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t *pwVar1;
  char cVar2;
  wchar_t *pwVar3;
  undefined4 local_res8 [2];
  wchar_t *local_res10;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1401a2570();
  cVar2 = FUN_140185490(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x10) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x12) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x14) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x18) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x1a) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x1e) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x22) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x24) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x28) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x2c) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x30) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x34) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x38) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x3c) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x40) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x42) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x46) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x4a) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x4e) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x52) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x56) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x5a) = (undefined1)local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x5b) = (undefined1)local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x5c) = (undefined1)local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x5d) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x5f) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x61) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x6d) = (undefined2)local_res8[0];
  }
  FUN_1401a2570(param_1,param_2 + 0x6f);
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x7f) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x83) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x85) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x87) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x8b) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x8f) = local_res8[0];
  }
  cVar2 = FUN_140185490(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x93) = local_res8[0];
  }
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x65),4,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return param_1;
}



undefined8 FUN_1400806e0(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  FUN_1401a2570();
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x10) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x12) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x14) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x18) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x1a) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x1e) = (undefined2)local_res8[0];
  }
  return param_1;
}



undefined8 FUN_1400807c0(undefined8 param_1,undefined2 *param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *param_2 = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 1) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    param_2[3] = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 4) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 6) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 8) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 10) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0xc) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0xe) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x10) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    param_2[0x12] = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x13) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x15) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x17) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x19) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x1b) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x1d) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)((longlong)param_2 + 0x41) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)((longlong)param_2 + 0x43) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)((longlong)param_2 + 0x45) = (undefined2)local_res8[0];
  }
  FUN_1401a2570(param_1,(longlong)param_2 + 0x47);
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x57) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x5b) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)((longlong)param_2 + 0x5f) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)((longlong)param_2 + 0x61) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 99) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x67) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x6b) = local_res8[0];
  }
  return param_1;
}



undefined8 FUN_140080b00(undefined8 param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t *pwVar1;
  char cVar2;
  wchar_t *pwVar3;
  undefined2 local_res8;
  undefined2 uStackX_a;
  undefined4 uStackX_c;
  wchar_t *local_res10;
  wchar_t *local_res18;
  wchar_t *local_res20;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1401a2570();
  FUN_1401a2570(param_1,param_2 + 0x10);
  cVar2 = FUN_140185490(param_1,&local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x31c) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 800) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x322) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x326) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 0x328) = CONCAT44(uStackX_c,CONCAT22(uStackX_a,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x330) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x332) = CONCAT22(uStackX_a,local_res8);
  }
  FUN_1400a3440();
  local_res20 = (wchar_t *)PTR_DAT_1402f8010;
  FUN_1400a3440();
  local_res18 = (wchar_t *)PTR_DAT_1402f8010;
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res20);
  thunk_FUN_1401865d0(param_1,&local_res18);
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar3 = local_res20;
  if (local_res20 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x20),0x10,pwVar3);
  pwVar3 = local_res18;
  if (local_res18 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x40),0x10,pwVar3);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x60),0x15e,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  pwVar3 = local_res18;
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  if (((local_res18 != (wchar_t *)0x0) && (local_res18 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res18 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  pwVar3 = local_res20;
  if (((local_res20 != (wchar_t *)0x0) && (local_res20 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res20 + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res18 = (wchar_t *)PTR_DAT_1402f8010;
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return param_1;
}



undefined8 FUN_140080dc0(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  FUN_1401a2570();
  FUN_1401a2570(param_1,param_2 + 0x10);
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x20) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x22) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x24) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x28) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x2a) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x2e) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x32) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x34) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x38) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x3c) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x40) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x44) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x48) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x4c) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x50) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x52) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x56) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x5a) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x5e) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x62) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x66) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x6a) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x6b) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x6c) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x6d) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x6f) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x71) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x7b) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x7d) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x7f) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x83) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x87) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x8b) = local_res8[0];
  }
  FUN_1401a2570(param_1,param_2 + 0x8f);
  return param_1;
}



undefined8 FUN_1400811d0(undefined8 param_1,undefined2 *param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *param_2 = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 1) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 4) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 6) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 8) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 10) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0xc) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0xe) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    param_2[3] = (undefined2)local_res8[0];
  }
  return param_1;
}



undefined8 FUN_140081300(undefined8 param_1,wchar_t *param_2)

{
  wchar_t *pwVar1;
  char cVar2;
  undefined8 uVar3;
  wchar_t *pwVar4;
  undefined1 local_res8;
  undefined1 uStackX_9;
  undefined2 uStackX_a;
  undefined4 uStackX_c;
  wchar_t *local_res10;
  wchar_t *local_res18;
  wchar_t *local_res20;
  
  FUN_1400a3440();
  local_res20 = (wchar_t *)PTR_DAT_1402f8010;
  FUN_1400a3440();
  local_res18 = (wchar_t *)PTR_DAT_1402f8010;
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res20);
  pwVar4 = local_res20;
  if (local_res20 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s(param_2,0x10,pwVar4);
  FUN_1401a2570(param_1,param_2 + 0x10);
  FUN_1401a2570(param_1,param_2 + 0x18);
  FUN_1401a2570(param_1,param_2 + 0x20);
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[0x28] = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[0x29] = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x2a) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[0x2c] = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x2d) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x2f) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[0x31] = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x32) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x34) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x36) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x38) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x3a) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x3c) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x3e) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[0x40] = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x41) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x43) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x45) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x47) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x49) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x4b) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x4d) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)((longlong)param_2 + 0x9b) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x4e) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)((longlong)param_2 + 0x9d) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)((longlong)param_2 + 0x9f) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0xa1) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0xa5) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0xa9) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0xad) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0x10f) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)((longlong)param_2 + 0xb1) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)((longlong)param_2 + 0xb3) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0xb5) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0xb9) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  thunk_FUN_1401865d0(param_1,&local_res18);
  pwVar4 = local_res18;
  if (local_res18 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)((longlong)param_2 + 0xbd),0x10,pwVar4);
  FUN_1401a2570(param_1,(longlong)param_2 + 0xdd);
  FUN_1401a2570(param_1,(longlong)param_2 + 0xed);
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0xfd) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0x101) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)((longlong)param_2 + 0x105) =
         CONCAT44(uStackX_c,CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8)));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)((longlong)param_2 + 0x10d) = CONCAT11(uStackX_9,local_res8);
  }
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar4 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)((longlong)param_2 + 0x117),0x1e,pwVar4);
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)((longlong)param_2 + 0x153) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  pwVar4 = local_res10;
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0x155) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar3);
  }
  pwVar4 = local_res18;
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  if (((local_res18 != (wchar_t *)0x0) && (local_res18 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res18 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar3);
  }
  pwVar4 = local_res20;
  if (((local_res20 != (wchar_t *)0x0) && (local_res20 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res20 + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res18 = (wchar_t *)PTR_DAT_1402f8010;
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar3);
  }
  return param_1;
}



undefined8 FUN_1400819f0(undefined8 param_1,longlong param_2)

{
  FUN_140186dd0();
  FUN_1401a2620(param_1,param_2 + 0x20);
  FUN_1401a2620(param_1,param_2 + 0x30);
  FUN_1401a2620(param_1,param_2 + 0x40);
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x50));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x52));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x54));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x58));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x5a));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x5e));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x62));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 100));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x68));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x6c));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x70));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x74));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x78));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x7c));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x80));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x82));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x86));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x8a));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x8e));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x92));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x96));
  FUN_14003c9e0(param_1,*(undefined1 *)(param_2 + 0x9a));
  FUN_14003c9e0(param_1,*(undefined1 *)(param_2 + 0x9b));
  FUN_14003c9e0(param_1,*(undefined1 *)(param_2 + 0x9c));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x9d));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x9f));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0xa1));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0xa5));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0xa9));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0xad));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x10f));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0xb1));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0xb3));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0xb5));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0xb9));
  FUN_140186dd0(param_1,param_2 + 0xbd);
  FUN_1401a2620(param_1,param_2 + 0xdd);
  FUN_1401a2620(param_1,param_2 + 0xed);
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0xfd));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x101));
  FUN_14003cac0(param_1,*(undefined8 *)(param_2 + 0x105));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x10d));
  FUN_140186dd0(param_1,param_2 + 0x117);
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x153));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x155));
  return param_1;
}



undefined8 FUN_140081ca0(undefined8 param_1,undefined8 *param_2)

{
  FUN_14007c8a0(param_1,*param_2);
  FUN_1401a2620(param_1,(longlong)param_2 + 0xc);
  FUN_1401a2620(param_1,(longlong)param_2 + 0x1c);
  FUN_1401a2620(param_1,param_2 + 0x16);
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 1));
  FUN_1401a2620(param_1,param_2 + 0x16);
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x18));
  FUN_14003c9e0(param_1,*(undefined1 *)((longlong)param_2 + 0xc2));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xc3));
  FUN_140186dd0(param_1,(longlong)param_2 + 0x2c);
  FUN_140186dd0(param_1,(longlong)param_2 + 0x4c);
  return param_1;
}



undefined8 FUN_140081d60(undefined8 param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  
  FUN_14007c6e0(param_1,*param_2);
  FUN_14007c6e0(param_1,param_2[1]);
  FUN_1401a2620(param_1,param_2 + 2);
  FUN_1401a2620(param_1,param_2 + 0x1f);
  FUN_1401a2620(param_1,param_2 + 0x2b);
  FUN_14007c6e0(param_1,param_2[0x2f]);
  FUN_14007c6e0(param_1,param_2[0x30]);
  FUN_14003c9e0(param_1,*(undefined1 *)(param_2 + 0x31));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xc5));
  FUN_14003c9e0(param_1,*(undefined1 *)((longlong)param_2 + 0xc9));
  FUN_14003c9e0(param_1,*(undefined1 *)((longlong)param_2 + 0xca));
  puVar1 = (undefined4 *)((longlong)param_2 + 0xd7);
  lVar2 = 3;
  do {
    FUN_14007c6e0(param_1,puVar1[-3]);
    FUN_14007c6e0(param_1,*puVar1);
    puVar1 = puVar1 + 1;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xe3));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xe7));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xeb));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xef));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xf3));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xf7));
  FUN_140186dd0(param_1,param_2 + 6);
  FUN_140186dd0(param_1,param_2 + 0x23);
  return param_1;
}



undefined8 FUN_140081ed0(undefined8 param_1,undefined8 *param_2)

{
  FUN_14007c8a0(param_1,*param_2);
  FUN_1401a2620(param_1,param_2 + 1);
  FUN_1401a2620(param_1,param_2 + 3);
  FUN_1401a2620(param_1,param_2 + 9);
  FUN_1401a2620(param_1,param_2 + 0xb);
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x11));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x8c));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x12));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x94));
  FUN_140186dd0(param_1,param_2 + 5);
  FUN_140186dd0(param_1,param_2 + 0xd);
  FUN_140186d30(param_1,param_2 + 0x13);
  FUN_140186d30(param_1,(longlong)param_2 + 0xca);
  return param_1;
}



undefined8 FUN_140081fa0(undefined8 param_1,undefined4 *param_2)

{
  FUN_14007c6e0(param_1,*param_2);
  FUN_1401a2620(param_1,param_2 + 1);
  FUN_1401a2620(param_1,(longlong)param_2 + 0x46);
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x76));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x7a));
  FUN_14003c9e0(param_1,*(undefined1 *)((longlong)param_2 + 0x7e));
  FUN_14003d020(param_1,*(undefined2 *)((longlong)param_2 + 0x87));
  FUN_14003d020(param_1,*(undefined2 *)((longlong)param_2 + 0x89));
  FUN_14003d020(param_1,*(undefined2 *)((longlong)param_2 + 0x8b));
  FUN_14003d020(param_1,*(undefined2 *)((longlong)param_2 + 0x8d));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x8f));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x93));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x97));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x9b));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x9f));
  FUN_14003c9e0(param_1,*(undefined1 *)((longlong)param_2 + 0xa3));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x29));
  FUN_14003c9e0(param_1,*(undefined1 *)((longlong)param_2 + 0xa6));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xa7));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xab));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xaf));
  FUN_140186d30(param_1,param_2 + 5);
  FUN_140186dd0(param_1,(longlong)param_2 + 0x56);
  FUN_140186dd0(param_1,(longlong)param_2 + 0x7f);
  return param_1;
}



undefined8 FUN_140082100(undefined8 param_1,undefined4 *param_2)

{
  FUN_14007c6e0(param_1,*param_2);
  FUN_1401a2620(param_1,param_2 + 1);
  FUN_1401a2620(param_1,param_2 + 0x1e);
  FUN_14003c9e0(param_1,*(undefined1 *)(param_2 + 0x2a));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xa9));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xad));
  FUN_1401a2620(param_1,(longlong)param_2 + 0xb1);
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xc1));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xc5));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xc9));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xcd));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xd1));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xd5));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xd9));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xdd));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xe1));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xe5));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xe9));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xed));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xf1));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xf5));
  FUN_140186dd0(param_1,param_2 + 0x22);
  FUN_140186dd0(param_1,param_2 + 5);
  return param_1;
}



undefined8 FUN_140082260(undefined8 param_1,undefined4 *param_2)

{
  longlong lVar1;
  
  FUN_14007c6e0(param_1,*param_2);
  FUN_1401a2620(param_1,param_2 + 1);
  FUN_1401a2620(param_1,param_2 + 0x1e);
  FUN_14007c6e0(param_1,param_2[0x2a]);
  FUN_14007c6e0(param_1,param_2[0x2b]);
  FUN_14007c6e0(param_1,param_2[0x2c]);
  FUN_1401a2620(param_1,param_2 + 0x2d);
  FUN_14007c6e0(param_1,param_2[0x31]);
  FUN_14007c6e0(param_1,param_2[0x32]);
  FUN_1401a2620(param_1,param_2 + 0x33);
  FUN_14007c6e0(param_1,param_2[0x8f]);
  FUN_14007c6e0(param_1,param_2[0x90]);
  FUN_1401a2620(param_1,param_2 + 0x91);
  FUN_14007c6e0(param_1,param_2[0xed]);
  FUN_14007c6e0(param_1,param_2[0xee]);
  FUN_14007c6e0(param_1,param_2[0xef]);
  FUN_14007c6e0(param_1,param_2[0xf0]);
  FUN_14007c6e0(param_1,param_2[0xf9]);
  FUN_14007c6e0(param_1,param_2[0xfa]);
  FUN_140186dd0(param_1,param_2 + 5);
  FUN_140186dd0(param_1,param_2 + 0x22);
  FUN_140186dd0(param_1,param_2 + 0x37);
  FUN_140186dd0(param_1,param_2 + 0x95);
  FUN_140186dd0(param_1,param_2 + 0xf1);
  param_2 = param_2 + 0x9d;
  lVar1 = 10;
  do {
    FUN_140186dd0(param_1,param_2 + -0x5e);
    FUN_140186dd0(param_1,param_2);
    param_2 = param_2 + 8;
    lVar1 = lVar1 + -1;
  } while (lVar1 != 0);
  return param_1;
}



undefined8 FUN_140082410(undefined8 param_1,undefined4 *param_2)

{
  FUN_14007c6e0(param_1,*param_2);
  FUN_1401a2620(param_1,param_2 + 1);
  FUN_1401a2620(param_1,param_2 + 5);
  FUN_14007c6e0(param_1,param_2[0x11]);
  FUN_14007c6e0(param_1,param_2[0x12]);
  FUN_14007c6e0(param_1,param_2[0x13]);
  FUN_1401a2620(param_1,param_2 + 0x14);
  FUN_14007c6e0(param_1,param_2[0x20]);
  FUN_14007c6e0(param_1,param_2[0x21]);
  FUN_14007c6e0(param_1,param_2[0x22]);
  FUN_140186dd0(param_1,param_2 + 9);
  FUN_140186dd0(param_1,param_2 + 0x18);
  return param_1;
}



undefined8 FUN_1400824c0(undefined8 param_1,undefined4 *param_2)

{
  FUN_14007c6e0(param_1,*param_2);
  FUN_14007c6e0(param_1,param_2[1]);
  FUN_1401a2620(param_1,param_2 + 2);
  FUN_14007c6e0(param_1,param_2[0x18]);
  FUN_14007c6e0(param_1,param_2[0x19]);
  FUN_14003cac0(param_1,*(undefined8 *)(param_2 + 0x1a));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x1c));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xce));
  FUN_140186dd0(param_1,param_2 + 6);
  FUN_140186dd0(param_1,(longlong)param_2 + 0x72);
  FUN_140186dd0(param_1,param_2 + 0x10);
  FUN_140186dd0(param_1,(longlong)param_2 + 0x92);
  return param_1;
}



undefined8 FUN_140082570(undefined8 param_1,undefined4 *param_2)

{
  FUN_14007c6e0(param_1,*param_2);
  FUN_14007c6e0(param_1,param_2[1]);
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 2));
  FUN_1401a2620(param_1,(longlong)param_2 + 10);
  FUN_1401a2620(param_1,(longlong)param_2 + 0x1a);
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x2a));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x2e));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x32));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x36));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x3a));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x3e));
  FUN_140186d30(param_1,(longlong)param_2 + 0x42);
  FUN_140186dd0(param_1,param_2 + 0x1d);
  return param_1;
}



undefined8 FUN_140082620(undefined8 param_1,undefined4 *param_2)

{
  longlong lVar1;
  undefined4 *puVar2;
  
  FUN_14007c6e0(param_1,*param_2);
  FUN_14007c6e0(param_1,param_2[1]);
  FUN_1401a2620(param_1,param_2 + 2);
  FUN_1401a2620(param_1,param_2 + 6);
  FUN_1401a2620(param_1,param_2 + 0x2b);
  FUN_1401a2620(param_1,param_2 + 0x2f);
  FUN_1401a2620(param_1,param_2 + 0x54);
  FUN_14007c6e0(param_1,param_2[0x58]);
  FUN_14007c6e0(param_1,param_2[0x59]);
  FUN_14007c6e0(param_1,param_2[0x5a]);
  FUN_14007c6e0(param_1,param_2[0x5b]);
  FUN_14007c6e0(param_1,param_2[0x5c]);
  FUN_14007c6e0(param_1,param_2[0x5d]);
  FUN_14007c6e0(param_1,param_2[0x5e]);
  lVar1 = 0;
  puVar2 = param_2 + 0x62;
  do {
    FUN_14007c6e0(param_1,puVar2[-3]);
    FUN_14007c6e0(param_1,*puVar2);
    FUN_14007c6e0(param_1,puVar2[3]);
    FUN_14007c6e0(param_1,puVar2[6]);
    FUN_14003c9e0(param_1,*(undefined1 *)(lVar1 + 0x1ac + (longlong)param_2));
    lVar1 = lVar1 + 1;
    puVar2 = puVar2 + 1;
  } while (lVar1 < 3);
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x1af));
  FUN_14003cac0(param_1,*(undefined8 *)((longlong)param_2 + 0x1b3));
  FUN_14003cac0(param_1,*(undefined8 *)((longlong)param_2 + 0x1bb));
  FUN_14003cac0(param_1,*(undefined8 *)((longlong)param_2 + 0x1c3));
  FUN_140186dd0(param_1,param_2 + 10);
  FUN_140186dd0(param_1,param_2 + 0x23);
  FUN_140186dd0(param_1,param_2 + 0x33);
  FUN_140186dd0(param_1,param_2 + 0x4c);
  return param_1;
}



undefined8 FUN_1400827e0(undefined8 param_1,undefined4 *param_2)

{
  FUN_14007c6e0(param_1,*param_2);
  FUN_14007c6e0(param_1,param_2[1]);
  FUN_1401a2620(param_1,param_2 + 2);
  FUN_1401a2620(param_1,param_2 + 6);
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xae));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xb2));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xb6));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xba));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xbe));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xe2));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xe6));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0x23));
  FUN_140186dd0(param_1,(longlong)param_2 + 0x8e);
  FUN_140186dd0(param_1,(longlong)param_2 + 0xc2);
  FUN_140186dd0(param_1,param_2 + 10);
  return param_1;
}



undefined8 FUN_1400828d0(undefined8 param_1,undefined8 *param_2)

{
  FUN_14003cac0(param_1,*param_2);
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 1));
  FUN_14003d020(param_1,*(undefined2 *)((longlong)param_2 + 0xc));
  FUN_14003c9e0(param_1,*(undefined1 *)((longlong)param_2 + 0xe));
  FUN_14003c9e0(param_1,*(undefined1 *)((longlong)param_2 + 0xf));
  FUN_14003c9e0(param_1,*(undefined1 *)((longlong)param_2 + 0xd4));
  FUN_14007c8a0(param_1,*(undefined8 *)((longlong)param_2 + 0xd9));
  FUN_14007c8a0(param_1,*(undefined8 *)((longlong)param_2 + 0xe1));
  FUN_140186dd0(param_1,param_2 + 2);
  FUN_140186dd0(param_1,(longlong)param_2 + 0x74);
  FUN_140186dd0(param_1,(longlong)param_2 + 0x94);
  FUN_140186dd0(param_1,(longlong)param_2 + 0xb4);
  FUN_140186dd0(param_1,(longlong)param_2 + 0xd5);
  FUN_140186dd0(param_1,(longlong)param_2 + 0xd7);
  return param_1;
}



undefined8 FUN_1400829b0(undefined8 param_1,undefined4 *param_2)

{
  FUN_14007c6e0(param_1,*param_2);
  FUN_14007c6e0(param_1,param_2[1]);
  FUN_1401a2620(param_1,param_2 + 2);
  FUN_14007c6e0(param_1,param_2[6]);
  FUN_14007c6e0(param_1,param_2[7]);
  FUN_1401a2620(param_1,param_2 + 8);
  FUN_14007c6e0(param_1,param_2[0xc]);
  FUN_14007c6e0(param_1,param_2[0xd]);
  FUN_14003c9e0(param_1,*(undefined1 *)(param_2 + 0xe));
  FUN_14003cac0(param_1,*(undefined8 *)((longlong)param_2 + 0x39));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x41));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x45));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x49));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x4d));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x51));
  FUN_140186d30(param_1,(longlong)param_2 + 0x55);
  FUN_140186dd0(param_1,(longlong)param_2 + 0x87);
  return param_1;
}



undefined8 FUN_140082a90(undefined8 param_1,undefined4 *param_2)

{
  FUN_14007c6e0(param_1,*param_2);
  FUN_14007c6e0(param_1,param_2[1]);
  FUN_1401a2620(param_1,param_2 + 2);
  FUN_14007c6e0(param_1,param_2[6]);
  FUN_14007c6e0(param_1,param_2[7]);
  FUN_1401a2620(param_1,param_2 + 8);
  FUN_1401a2620(param_1,param_2 + 0xc);
  FUN_14003c9e0(param_1,*(undefined1 *)(param_2 + 0x10));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x41));
  FUN_140186d30(param_1,(longlong)param_2 + 0x45);
  FUN_140186dd0(param_1,(longlong)param_2 + 0x77);
  FUN_140186dd0(param_1,(longlong)param_2 + 0x97);
  FUN_140186dd0(param_1,(longlong)param_2 + 0xb7);
  return param_1;
}



undefined8 FUN_140082b50(undefined8 param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  
  FUN_14007c6e0(param_1,*param_2);
  FUN_14007c6e0(param_1,param_2[1]);
  FUN_1401a2620(param_1,param_2 + 2);
  FUN_1401a2620(param_1,param_2 + 6);
  FUN_1401a2620(param_1,param_2 + 0x12);
  FUN_14007c6e0(param_1,param_2[0x16]);
  FUN_14007c6e0(param_1,param_2[0x17]);
  FUN_14007c6e0(param_1,param_2[0x18]);
  FUN_14007c6e0(param_1,param_2[0x19]);
  FUN_14003c9e0(param_1,*(undefined1 *)(param_2 + 0x1a));
  FUN_14003c9e0(param_1,*(undefined1 *)((longlong)param_2 + 0x69));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x6a));
  puVar1 = (undefined4 *)((longlong)param_2 + 0x7a);
  lVar2 = 3;
  do {
    FUN_14007c6e0(param_1,puVar1[-3]);
    FUN_14007c6e0(param_1,*puVar1);
    FUN_14007c6e0(param_1,puVar1[3]);
    FUN_14007c6e0(param_1,puVar1[6]);
    FUN_14007c6e0(param_1,puVar1[9]);
    puVar1 = puVar1 + 1;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xaa));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xae));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xb2));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xb6));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xba));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xbe));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xc2));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xc6));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xca));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xce));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xf2));
  FUN_140186dd0(param_1,param_2 + 10);
  FUN_140186dd0(param_1,(longlong)param_2 + 0xd2);
  return param_1;
}



undefined8 FUN_140082d10(undefined8 param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  
  FUN_14007c6e0(param_1,*param_2);
  FUN_14007c6e0(param_1,param_2[1]);
  FUN_1401a2620(param_1,param_2 + 2);
  FUN_1401a2620(param_1,param_2 + 6);
  FUN_1401a2620(param_1,param_2 + 0x12);
  FUN_14007c6e0(param_1,param_2[0x16]);
  FUN_14007c6e0(param_1,param_2[0x17]);
  FUN_14007c6e0(param_1,param_2[0x18]);
  FUN_14007c6e0(param_1,param_2[0x19]);
  FUN_14003c9e0(param_1,*(undefined1 *)(param_2 + 0x1a));
  FUN_14003c9e0(param_1,*(undefined1 *)((longlong)param_2 + 0x69));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x6a));
  puVar1 = (undefined4 *)((longlong)param_2 + 0x7a);
  lVar2 = 3;
  do {
    FUN_14007c6e0(param_1,puVar1[-3]);
    FUN_14007c6e0(param_1,*puVar1);
    FUN_14007c6e0(param_1,puVar1[3]);
    FUN_14007c6e0(param_1,puVar1[6]);
    FUN_14007c6e0(param_1,puVar1[9]);
    puVar1 = puVar1 + 1;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xaa));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xae));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xb2));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xb6));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xda));
  FUN_140186dd0(param_1,param_2 + 10);
  FUN_140186dd0(param_1,(longlong)param_2 + 0xba);
  return param_1;
}



undefined8 FUN_140082e80(undefined8 param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  
  FUN_14007c6e0(param_1,*param_2);
  FUN_14007c6e0(param_1,param_2[1]);
  FUN_1401a2620(param_1,param_2 + 2);
  FUN_1401a2620(param_1,param_2 + 6);
  FUN_1401a2620(param_1,param_2 + 0x12);
  FUN_14007c6e0(param_1,param_2[0x16]);
  FUN_14007c6e0(param_1,param_2[0x17]);
  FUN_14007c6e0(param_1,param_2[0x18]);
  FUN_14007c6e0(param_1,param_2[0x19]);
  FUN_14003c9e0(param_1,*(undefined1 *)(param_2 + 0x1a));
  FUN_14003c9e0(param_1,*(undefined1 *)((longlong)param_2 + 0x69));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x6a));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x6e));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xae));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xb2));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xb6));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xba));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xbe));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xc2));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0xc6));
  puVar1 = (undefined4 *)((longlong)param_2 + 0x7e);
  lVar2 = 3;
  do {
    FUN_14007c6e0(param_1,puVar1[-3]);
    FUN_14007c6e0(param_1,*puVar1);
    FUN_14007c6e0(param_1,puVar1[3]);
    FUN_14007c6e0(param_1,puVar1[6]);
    FUN_14007c6e0(param_1,puVar1[9]);
    puVar1 = puVar1 + 1;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  FUN_140186dd0(param_1,param_2 + 10);
  return param_1;
}



undefined8 FUN_140083000(undefined8 param_1,undefined4 *param_2)

{
  FUN_14007c6e0(param_1,*param_2);
  FUN_14007c6e0(param_1,param_2[1]);
  FUN_14007c6e0(param_1,param_2[2]);
  FUN_1401a2620(param_1,param_2 + 3);
  FUN_1401a2620(param_1,param_2 + 7);
  FUN_14007c6e0(param_1,param_2[0x2c]);
  FUN_14007c6e0(param_1,param_2[0x2d]);
  FUN_14007c6e0(param_1,param_2[0x2e]);
  FUN_14007c6e0(param_1,param_2[0x2f]);
  FUN_14007c6e0(param_1,param_2[0x30]);
  FUN_14007c6e0(param_1,param_2[0x31]);
  FUN_140186dd0(param_1,param_2 + 0x24);
  FUN_140186dd0(param_1,param_2 + 0xb);
  return param_1;
}



undefined8 FUN_1400830d0(undefined8 param_1,undefined4 *param_2)

{
  FUN_14007c6e0(param_1,*param_2);
  FUN_14007c6e0(param_1,param_2[1]);
  FUN_1401a2620(param_1,param_2 + 2);
  FUN_1401a2620(param_1,param_2 + 6);
  FUN_1401a2620(param_1,param_2 + 0x2b);
  FUN_14007c6e0(param_1,param_2[0x37]);
  FUN_14007c6e0(param_1,param_2[0x38]);
  FUN_14003cac0(param_1,*(undefined8 *)(param_2 + 0x39));
  FUN_14007c6e0(param_1,param_2[0x3b]);
  FUN_14007c6e0(param_1,param_2[0x3c]);
  FUN_14007c6e0(param_1,param_2[0x3d]);
  FUN_14007c6e0(param_1,param_2[0x3e]);
  FUN_14007c6e0(param_1,param_2[0x3f]);
  FUN_14007c6e0(param_1,param_2[0x40]);
  FUN_14007c6e0(param_1,param_2[0x41]);
  FUN_14007c6e0(param_1,param_2[0x42]);
  FUN_14007c7c0(param_1,param_2[0x43]);
  FUN_14007c7c0(param_1,param_2[0x44]);
  FUN_14007c6e0(param_1,param_2[0x45]);
  FUN_14007c6e0(param_1,param_2[0x46]);
  FUN_14007c6e0(param_1,param_2[0x47]);
  FUN_14007c6e0(param_1,param_2[0x48]);
  FUN_14007c6e0(param_1,param_2[0x49]);
  FUN_14007c6e0(param_1,param_2[0x4a]);
  FUN_14007c6e0(param_1,param_2[0x4b]);
  FUN_14007c6e0(param_1,param_2[0x4c]);
  FUN_14007c6e0(param_1,param_2[0x4d]);
  FUN_14007c6e0(param_1,param_2[0x4e]);
  FUN_14007c6e0(param_1,param_2[0x4f]);
  FUN_14007c6e0(param_1,param_2[0x50]);
  FUN_14007c6e0(param_1,param_2[0x51]);
  FUN_14007c6e0(param_1,param_2[0x52]);
  FUN_14007c6e0(param_1,param_2[0x53]);
  FUN_14007c7c0(param_1,param_2[0x54]);
  FUN_14007c7c0(param_1,param_2[0x55]);
  FUN_14007c6e0(param_1,param_2[0x56]);
  FUN_14007c6e0(param_1,param_2[0x57]);
  FUN_14007c6e0(param_1,param_2[0x58]);
  FUN_14007c6e0(param_1,param_2[0x59]);
  FUN_14007c6e0(param_1,param_2[0x5a]);
  FUN_14007c6e0(param_1,param_2[0x5b]);
  FUN_14007c6e0(param_1,param_2[0x5c]);
  FUN_14007c6e0(param_1,param_2[0x5d]);
  FUN_14007c6e0(param_1,param_2[0x5e]);
  FUN_14003c9e0(param_1,*(undefined1 *)(param_2 + 0x5f));
  FUN_14007c6e0(param_1,*(undefined4 *)((longlong)param_2 + 0x17d));
  FUN_140186dd0(param_1,param_2 + 0x23);
  FUN_140186dd0(param_1,param_2 + 10);
  FUN_140186dd0(param_1,param_2 + 0x2f);
  return param_1;
}



undefined8 FUN_1400833a0(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined2 local_res8;
  undefined2 uStackX_a;
  undefined4 uStackX_c;
  
  FUN_1401a2570();
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(uint *)(param_2 + 0x10) = CONCAT22(uStackX_a,local_res8);
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(uint *)(param_2 + 0x14) = CONCAT22(uStackX_a,local_res8);
  }
  cVar1 = FUN_140185490(param_1,&local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x18) = local_res8;
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(uint *)(param_2 + 0x1a) = CONCAT22(uStackX_a,local_res8);
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(uint *)(param_2 + 0x1e) = CONCAT22(uStackX_a,local_res8);
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(uint *)(param_2 + 0x22) = CONCAT22(uStackX_a,local_res8);
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(uint *)(param_2 + 0x26) = CONCAT22(uStackX_a,local_res8);
  }
  cVar1 = FUN_140185490(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(uint *)(param_2 + 0x2a) = CONCAT22(uStackX_a,local_res8);
  }
  cVar1 = FUN_140185490(param_1,&local_res8,8);
  if (cVar1 != '\0') {
    *(ulonglong *)(param_2 + 0x2e) = CONCAT44(uStackX_c,CONCAT22(uStackX_a,local_res8));
  }
  cVar1 = FUN_140185490(param_1,&local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x36) = local_res8;
  }
  return param_1;
}



undefined8 FUN_140083500(undefined8 param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t *pwVar1;
  char cVar2;
  wchar_t *pwVar3;
  undefined1 local_res8;
  undefined1 uStackX_9;
  undefined2 uStackX_a;
  undefined4 uStackX_c;
  wchar_t *local_res10;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1401a2570();
  FUN_1401a2570(param_1,param_2 + 0x10);
  FUN_1401a2570(param_1,param_2 + 0x20);
  cVar2 = FUN_140185490(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x30) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x52) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x54) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 0x58) =
         CONCAT44(uStackX_c,CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8)));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x60) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_140185490(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 0x62) =
         CONCAT44(uStackX_c,CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8)));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x6a) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x6e) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x72) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x76) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x7a) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x7e) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x82) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x86) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x8a) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x8e) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x92) = local_res8;
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x93) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x97) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x9b) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x9f) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xa3) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xa7) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_140185490(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xab) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  FUN_1400a3440();
  local_res10 = (wchar_t *)PTR_DAT_1402f8010;
  thunk_FUN_1401865d0(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1402f8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x32),0x10,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1402f8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_1400a3530(pwVar1);
    }
    FUN_1400d1290(uVar4);
  }
  return param_1;
}



undefined8 FUN_1400838c0(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  FUN_1401a2570();
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x10) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x14) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x18) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x1a) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x1e) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x1c) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x1d) = (undefined1)local_res8[0];
  }
  return param_1;
}



void FUN_1400839c0(longlong param_1)

{
  longlong *plVar1;
  char *_Str;
  uint uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  if (param_1 != 0) {
    plVar1 = *(longlong **)(param_1 + 0x18);
    uVar3 = 0;
    uVar4 = uVar3;
    if (*plVar1 != 0) {
      do {
        _Str = (char *)Ordinal_12(*(undefined4 *)*plVar1);
        puts(_Str);
        uVar4 = uVar4 + 1;
        plVar1 = (longlong *)(*(longlong *)(param_1 + 0x18) + uVar4 * 8);
        uVar2 = (int)uVar3 + 1;
        uVar3 = (ulonglong)uVar2;
      } while (*plVar1 != 0);
      if (1 < (int)uVar2) {
        puts("!!! DNS to Multi !!!");
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_140083a30(undefined8 *param_1)

{
  short sVar1;
  uint uVar2;
  ulonglong uVar3;
  undefined *puVar4;
  short *psVar5;
  longlong *plVar6;
  undefined1 auStack_1e8 [32];
  undefined **local_1c8;
  longlong *local_1c0;
  longlong *local_1b8;
  undefined8 local_1b0;
  undefined8 local_1a8;
  undefined8 *local_1a0;
  undefined8 local_198;
  undefined2 local_190;
  undefined6 uStack_18e;
  undefined8 local_180;
  ulonglong local_178;
  undefined1 local_168;
  undefined8 local_158;
  undefined8 local_150;
  short *local_138;
  short local_130 [132];
  ulonglong local_28;
  
  local_198 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_1e8;
  *param_1 = MagiServerOption::vftable;
  param_1[4] = 7;
  param_1[3] = 0;
  *(undefined2 *)(param_1 + 1) = 0;
  param_1[9] = 7;
  param_1[8] = 0;
  *(undefined2 *)(param_1 + 6) = 0;
  param_1[0xe] = 7;
  param_1[0xd] = 0;
  *(undefined2 *)(param_1 + 0xb) = 0;
  param_1[0x10] = 0;
  *(undefined4 *)(param_1 + 0x11) = 0;
  *(undefined4 *)((longlong)param_1 + 0x8c) = 0x32;
  param_1[0x15] = 0xf;
  param_1[0x14] = 0;
  *(undefined1 *)(param_1 + 0x12) = 0;
  param_1[0x1a] = 0xf;
  param_1[0x19] = 0;
  *(undefined1 *)(param_1 + 0x17) = 0;
  param_1[0x1f] = 0xf;
  param_1[0x1e] = 0;
  *(undefined1 *)(param_1 + 0x1c) = 0;
  param_1[0x24] = 0xf;
  param_1[0x23] = 0;
  *(undefined1 *)(param_1 + 0x21) = 0;
  param_1[0x26] = 0;
  param_1[0x27] = 0;
  *(undefined4 *)(param_1 + 0x28) = 1;
  *(undefined4 *)((longlong)param_1 + 0x144) = 1;
  param_1[0x29] = 1;
  *(undefined2 *)(param_1 + 0x2a) = 0;
  *(undefined1 *)((longlong)param_1 + 0x152) = 0;
  *(undefined8 *)((longlong)param_1 + 0x154) = 0;
  *(undefined8 *)((longlong)param_1 + 0x15c) = 1;
  *(undefined2 *)((longlong)param_1 + 0x164) = 1;
  *(undefined1 *)((longlong)param_1 + 0x166) = 1;
  param_1[0x2d] = 0;
  *(undefined2 *)(param_1 + 0x2e) = 0;
  param_1[0x2f] = 0;
  *(undefined1 *)(param_1 + 0x30) = 1;
  param_1[0x31] = 0;
  param_1[0x32] = 0;
  param_1[0x33] = 0;
  local_1a0 = param_1;
  FUN_140099f20(param_1 + 0x35);
  *(undefined1 *)(param_1 + 0x3d) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1ec) = 0;
  param_1[0x3e] = 0;
  local_1c8 = Proud::CFastArray<>::vftable;
  local_1c0 = (longlong *)0x0;
  local_1b8 = (longlong *)0x0;
  local_1b0 = 0;
  local_1a8 = 0;
  FUN_1400a7b00(&local_1c8);
  local_178 = 7;
  local_180 = 0;
  local_190 = 0;
  local_150 = 0xf;
  local_158 = 0;
  local_168 = 0;
  if (0 < (int)(uint)local_1b0) {
    puVar4 = (undefined *)*local_1b8;
    if ((undefined *)*local_1b8 == (undefined *)0x0) {
      puVar4 = PTR_DAT_1402f8008;
    }
    local_138 = local_130;
    FUN_14008a6c0(&local_138,puVar4,3);
    uVar3 = 0xffffffffffffffff;
    psVar5 = local_138;
    do {
      if (uVar3 == 0) break;
      uVar3 = uVar3 - 1;
      sVar1 = *psVar5;
      psVar5 = psVar5 + 1;
    } while (sVar1 != 0);
    FUN_140001b00(&local_190,local_138,~uVar3 - 1);
    if (local_138 != local_130) {
      free(local_138);
    }
  }
  uVar2 = (uint)local_1b0;
  if (7 < local_178) {
    operator_delete((void *)CONCAT62(uStack_18e,local_190));
    uVar2 = (uint)local_1b0;
  }
  local_178 = 7;
  local_180 = 0;
  local_190 = 0;
  local_1c8 = Proud::CFastArray<>::vftable;
  if (0 < (int)uVar2) {
    uVar3 = (ulonglong)uVar2;
    plVar6 = local_1b8;
    do {
      FUN_14000c2a0(plVar6);
      plVar6 = plVar6 + 1;
      uVar3 = uVar3 - 1;
    } while (uVar3 != 0);
  }
  if (local_1b8 != (longlong *)0x0) {
    if (local_1c0 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*local_1c0 + 0x18))(local_1c0,local_1b8);
    }
  }
  return param_1;
}



void * FUN_140083d30(void *param_1,uint param_2)

{
  FUN_140083d60();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140083d60(undefined8 *param_1)

{
  *param_1 = MagiServerOption::vftable;
  if (param_1[0x35] != 0) {
    FUN_140089760();
  }
  FUN_140088e70(param_1 + 0x31);
  if (0xf < (ulonglong)param_1[0x24]) {
    operator_delete((void *)param_1[0x21]);
  }
  param_1[0x24] = 0xf;
  param_1[0x23] = 0;
  *(undefined1 *)(param_1 + 0x21) = 0;
  if (0xf < (ulonglong)param_1[0x1f]) {
    operator_delete((void *)param_1[0x1c]);
  }
  param_1[0x1f] = 0xf;
  param_1[0x1e] = 0;
  *(undefined1 *)(param_1 + 0x1c) = 0;
  if (0xf < (ulonglong)param_1[0x1a]) {
    operator_delete((void *)param_1[0x17]);
  }
  param_1[0x1a] = 0xf;
  param_1[0x19] = 0;
  *(undefined1 *)(param_1 + 0x17) = 0;
  if (0xf < (ulonglong)param_1[0x15]) {
    operator_delete((void *)param_1[0x12]);
  }
  param_1[0x15] = 0xf;
  param_1[0x14] = 0;
  *(undefined1 *)(param_1 + 0x12) = 0;
  if (7 < (ulonglong)param_1[0xe]) {
    operator_delete((void *)param_1[0xb]);
  }
  param_1[0xe] = 7;
  param_1[0xd] = 0;
  *(undefined2 *)(param_1 + 0xb) = 0;
  if (7 < (ulonglong)param_1[9]) {
    operator_delete((void *)param_1[6]);
  }
  param_1[9] = 7;
  param_1[8] = 0;
  *(undefined2 *)(param_1 + 6) = 0;
  if (7 < (ulonglong)param_1[4]) {
    operator_delete((void *)param_1[1]);
  }
  param_1[4] = 7;
  param_1[3] = 0;
  *(undefined2 *)(param_1 + 1) = 0;
  DAT_140320138 = 0;
  *param_1 = MBISingleton<>::vftable;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_140083ee0(longlong param_1,ushort *param_2)

{
  char cVar1;
  ushort uVar2;
  byte bVar3;
  DWORD DVar4;
  errno_t eVar5;
  int iVar6;
  char *pcVar7;
  ulonglong uVar8;
  ushort *puVar9;
  char *pcVar10;
  undefined1 auStack_f8 [32];
  undefined8 local_d8;
  undefined4 local_d0;
  __time64_t local_c8 [2];
  short local_b8;
  short local_b6;
  undefined2 local_b4;
  undefined2 local_b2;
  undefined2 local_b0;
  undefined2 local_ae;
  undefined2 local_ac;
  undefined2 local_aa;
  tm local_a8;
  char local_80;
  undefined7 uStack_7f;
  undefined8 local_70;
  ulonglong local_68;
  undefined8 local_58;
  undefined8 local_50;
  undefined1 local_48;
  undefined7 uStack_47;
  undefined8 local_38;
  ulonglong local_30;
  ulonglong local_20;
  
  local_c8[1] = 0xfffffffffffffffe;
  local_20 = DAT_1402f85a0 ^ (ulonglong)auStack_f8;
  DVar4 = GetCurrentProcessId();
  *(DWORD *)(param_1 + 0x1ec) = DVar4;
  local_c8[0] = _time64((__time64_t *)0x0);
  local_d8 = 0;
  local_d0 = 0;
  eVar5 = _localtime64_s(&local_a8,local_c8);
  if (eVar5 == 0) {
    local_b8 = (short)local_a8.tm_year + 0x76c;
    local_b6 = (short)local_a8.tm_mon + 1;
    local_b4 = (undefined2)local_a8.tm_wday;
    local_b2 = (undefined2)local_a8.tm_mday;
    local_b0 = (undefined2)local_a8.tm_hour;
    local_ae = (undefined2)local_a8.tm_min;
    local_ac = (undefined2)local_a8.tm_sec;
    local_aa = 0;
    iVar6 = Ordinal_184(&local_b8,&local_d8);
    local_58 = 0;
    local_50 = 0;
    if (iVar6 != 0) {
      Ordinal_185(local_d8,&local_58);
    }
  }
  *(undefined8 *)(param_1 + 0x1f0) = local_d8;
  if ((*param_2 < 0x30) || (0x39 < *param_2)) {
    uVar8 = FUN_140085350(param_1,param_2);
  }
  else {
    wprintf(L"\t-AGNET MODE-\t \n");
    local_a8.tm_wday = 7;
    local_a8.tm_yday = 0;
    local_a8.tm_mon = 0;
    local_a8.tm_year = 0;
    local_a8.tm_sec._0_2_ = 0;
    uVar8 = 0xffffffffffffffff;
    puVar9 = param_2;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      uVar2 = *puVar9;
      puVar9 = puVar9 + 1;
    } while (uVar2 != 0);
    FUN_140001b00(&local_a8,param_2,~uVar8 - 1);
    pcVar7 = (char *)FUN_1401e1690(&local_48,&local_a8);
    if (0xf < *(ulonglong *)(pcVar7 + 0x18)) {
      pcVar7 = *(char **)pcVar7;
    }
    local_68 = 0xf;
    local_70 = 0;
    local_80 = '\0';
    uVar8 = 0xffffffffffffffff;
    pcVar10 = pcVar7;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar1 = *pcVar10;
      pcVar10 = pcVar10 + 1;
    } while (cVar1 != '\0');
    FUN_140003e60(&local_80,pcVar7,~uVar8 - 1);
    if (0xf < local_30) {
      operator_delete((void *)CONCAT71(uStack_47,local_48));
    }
    local_30 = 0xf;
    local_38 = 0;
    local_48 = 0;
    if (7 < (ulonglong)local_a8._24_8_) {
      operator_delete((void *)CONCAT26(local_a8.tm_min._2_2_,
                                       CONCAT24((undefined2)local_a8.tm_min,
                                                CONCAT22(local_a8.tm_sec._2_2_,
                                                         (undefined2)local_a8.tm_sec))));
    }
    local_a8.tm_wday = 7;
    local_a8.tm_yday = 0;
    local_a8.tm_mon = 0;
    local_a8.tm_year = 0;
    local_a8.tm_sec._0_2_ = 0;
    pcVar7 = &local_80;
    if (0xf < local_68) {
      pcVar7 = (char *)CONCAT71(uStack_7f,local_80);
    }
    iVar6 = atoi(pcVar7);
    bVar3 = FUN_1400845e0(param_1,iVar6);
    if (0xf < local_68) {
      operator_delete((void *)CONCAT71(uStack_7f,local_80));
    }
    uVar8 = (ulonglong)bVar3;
  }
  return uVar8;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

undefined8 FUN_140084120(longlong param_1,undefined4 *param_2)

{
  short sVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong lVar7;
  short *psVar8;
  undefined8 *******pppppppuVar9;
  char *pcVar10;
  longlong *plVar11;
  short *psVar12;
  char *pcVar13;
  bool bVar14;
  undefined1 auStack_128 [32];
  undefined **local_108 [5];
  longlong *local_e0;
  undefined8 *local_d0;
  void *local_c8;
  undefined4 local_ac;
  undefined8 *local_a8;
  void *local_a0;
  undefined8 local_88;
  undefined8 *******local_80 [3];
  ulonglong local_68;
  undefined2 local_58;
  undefined6 uStack_56;
  undefined8 local_48;
  ulonglong local_40;
  ulonglong local_30;
  
  local_88 = 0xfffffffffffffffe;
  local_30 = DAT_1402f85a0 ^ (ulonglong)auStack_128;
  *(undefined4 *)(param_1 + 0x140) = *param_2;
  *(undefined1 *)(param_1 + 0x1e8) = *(undefined1 *)(param_2 + 3);
  FUN_140001700(param_1 + 8,param_2 + 0x1e,0,0xffffffffffffffff);
  FUN_140001700(param_1 + 0x30,param_2 + 10,0,0xffffffffffffffff);
  FUN_140001700(param_1 + 0x58,param_2 + 0x14,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x80) = param_2[4];
  *(undefined4 *)(param_1 + 0x84) = param_2[5];
  *(undefined4 *)(param_1 + 0x88) = param_2[6];
  *(undefined4 *)(param_1 + 0x8c) = param_2[7];
  psVar8 = (short *)&DAT_140312e08;
  if (7 < DAT_140312e20) {
    psVar8 = DAT_140312e08;
  }
  local_40 = 7;
  lVar4 = 0;
  local_48 = 0;
  local_58 = 0;
  uVar5 = 0xffffffffffffffff;
  psVar12 = psVar8;
  do {
    if (uVar5 == 0) break;
    uVar5 = uVar5 - 1;
    sVar1 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar1 != 0);
  FUN_140001b00(&local_58,psVar8,~uVar5 - 1);
  FUN_1401e1690(local_80,&local_58);
  if (7 < local_40) {
    operator_delete((void *)CONCAT62(uStack_56,local_58));
  }
  local_40 = 7;
  local_48 = 0;
  local_58 = 0;
  pppppppuVar9 = local_80;
  if (0xf < local_68) {
    pppppppuVar9 = local_80[0];
  }
  FUN_1400275d0(local_108,pppppppuVar9);
  DAT_1403100dc = 0;
  cVar2 = FUN_1400276a0(local_108,local_d0 + 2);
  plVar11 = local_e0;
  if (cVar2 == '\0') {
    pppppppuVar9 = local_80;
    if (0xf < local_68) {
      pppppppuVar9 = local_80[0];
    }
    FUN_140025f00("Error File Name %s : %d - %s",pppppppuVar9,local_ac,local_a8 + 2);
    local_108[0] = TiXmlDocument::vftable;
    if (local_a8 != &DAT_14031fee8) {
      operator_delete__(local_a0);
    }
    local_108[0] = TiXmlNode::vftable;
    while (local_e0 != (longlong *)0x0) {
      plVar11 = (longlong *)local_e0[10];
      (**(code **)*local_e0)(local_e0,1);
      local_e0 = plVar11;
    }
    if (local_d0 != &DAT_14031fee8) {
      operator_delete__(local_c8);
    }
    local_108[0] = TiXmlBase::vftable;
    if (0xf < local_68) {
      operator_delete(local_80[0]);
    }
    return 0;
  }
  for (; plVar11 != (longlong *)0x0; plVar11 = (longlong *)plVar11[10]) {
    bVar14 = (char *)(plVar11[7] + 0x10) == (char *)0x0;
    lVar6 = 3;
    pcVar10 = (char *)(plVar11[7] + 0x10);
    pcVar13 = "db";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar14 = *pcVar10 == *pcVar13;
      pcVar10 = pcVar10 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar14);
    if (bVar14) goto LAB_140084363;
  }
LAB_1400843a0:
  cVar2 = *(char *)(param_1 + 0x1e8);
  if (cVar2 == '\x05') {
    *(undefined4 *)(param_1 + 0x158) = 1;
  }
  else {
    if (cVar2 == '\f') {
      if (lVar4 == 0) goto LAB_140084537;
      pcVar10 = "game";
    }
    else if (cVar2 == '\x11') {
      if (lVar4 == 0) goto LAB_140084537;
      pcVar10 = "log";
    }
    else if (cVar2 == '\x12') {
      if (lVar4 == 0) goto LAB_140084537;
      pcVar10 = "chat";
    }
    else {
      if ((cVar2 != '\x13') || (lVar4 == 0)) goto LAB_140084537;
      pcVar10 = "emergency";
    }
    lVar4 = FUN_140026d00(lVar4,pcVar10);
    if (lVar4 != 0) {
      lVar6 = FUN_140026d00(lVar4,"db_account");
      if (lVar6 != 0) {
        FUN_1400871b0(param_1 + 0x90,param_1 + 0x130,lVar6);
      }
      lVar6 = FUN_140026d00(lVar4,&DAT_1402836dc);
      if (lVar6 != 0) {
        FUN_1400871b0(param_1 + 0xb8,param_1 + 0x134,lVar6);
      }
      lVar6 = FUN_140026d00(lVar4,"db_game");
      if (lVar6 != 0) {
        FUN_1400871b0(param_1 + 0xe0,param_1 + 0x138,lVar6);
      }
      lVar6 = FUN_140026d00(lVar4,"db_log");
      if (lVar6 != 0) {
        FUN_1400871b0(param_1 + 0x108,param_1 + 0x13c,lVar6);
      }
      lVar4 = FUN_140026d00(lVar4,"write_thread");
      if (lVar4 != 0) {
        for (lVar6 = *(longlong *)(lVar4 + 0xa0); lVar6 != lVar4 + 0x58;
            lVar6 = *(longlong *)(lVar6 + 0x48)) {
          pcVar10 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
          bVar14 = pcVar10 == (char *)0x0;
          lVar7 = 6;
          pcVar13 = "count";
          do {
            if (lVar7 == 0) break;
            lVar7 = lVar7 + -1;
            bVar14 = *pcVar10 == *pcVar13;
            pcVar10 = pcVar10 + 1;
            pcVar13 = pcVar13 + 1;
          } while (bVar14);
          if (bVar14) {
            pcVar10 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
            if (pcVar10 != (char *)0x0) {
              iVar3 = atoi(pcVar10);
              *(int *)(param_1 + 0x14c) = iVar3;
            }
            break;
          }
        }
      }
    }
  }
LAB_140084537:
  local_108[0] = TiXmlDocument::vftable;
  if (local_a8 != &DAT_14031fee8) {
    operator_delete__(local_a0);
  }
  local_108[0] = TiXmlNode::vftable;
  while (local_e0 != (longlong *)0x0) {
    plVar11 = (longlong *)local_e0[10];
    (**(code **)*local_e0)(local_e0,1);
    local_e0 = plVar11;
  }
  if (local_d0 != &DAT_14031fee8) {
    operator_delete__(local_c8);
  }
  local_108[0] = TiXmlBase::vftable;
  if (0xf < local_68) {
    operator_delete(local_80[0]);
  }
  return 1;
LAB_140084363:
  while (lVar6 = (**(code **)(*plVar11 + 0x30))(plVar11), lVar6 == 0) {
    do {
      plVar11 = (longlong *)plVar11[10];
      if (plVar11 == (longlong *)0x0) goto LAB_1400843a0;
      bVar14 = (char *)(plVar11[7] + 0x10) == (char *)0x0;
      lVar6 = 3;
      pcVar10 = (char *)(plVar11[7] + 0x10);
      pcVar13 = "db";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar14 = *pcVar10 == *pcVar13;
        pcVar10 = pcVar10 + 1;
        pcVar13 = pcVar13 + 1;
      } while (bVar14);
    } while (!bVar14);
  }
  lVar4 = (**(code **)(*plVar11 + 0x30))(plVar11);
  goto LAB_1400843a0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

undefined8 FUN_1400845e0(longlong param_1,int param_2)

{
  short sVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  short **ppsVar8;
  undefined8 *******pppppppuVar9;
  longlong *plVar10;
  longlong *plVar11;
  char *pcVar12;
  char *pcVar13;
  char *pcVar14;
  char *pcVar15;
  char *pcVar16;
  char *pcVar17;
  char *pcVar18;
  char *_Str;
  bool bVar19;
  undefined1 auStack_268 [32];
  undefined **local_248 [5];
  longlong *local_220;
  undefined8 *local_210;
  void *local_208;
  undefined4 local_1ec;
  undefined8 *local_1e8;
  void *local_1e0;
  undefined ***local_1c8;
  undefined8 local_1c0;
  basic_ios<> *local_1b8;
  longlong local_1a8;
  undefined **local_1a0 [4];
  undefined8 *local_180;
  undefined8 *local_178;
  undefined8 *local_158;
  undefined4 *local_140;
  undefined8 local_130;
  uint local_128;
  basic_ios<> local_120 [104];
  undefined2 local_b8;
  undefined6 uStack_b6;
  undefined8 local_a8;
  ulonglong local_a0;
  char local_90;
  undefined7 uStack_8f;
  undefined8 local_80;
  ulonglong local_78;
  undefined8 *******local_68 [3];
  ulonglong local_50;
  ulonglong local_40;
  
  local_1c0 = 0xfffffffffffffffe;
  local_40 = DAT_1402f85a0 ^ (ulonglong)auStack_268;
  ppsVar8 = &DAT_140312e08;
  if (7 < DAT_140312e20) {
    ppsVar8 = (short **)DAT_140312e08;
  }
  local_a0 = 7;
  _Str = (char *)0x0;
  local_a8 = 0;
  local_b8 = 0;
  lVar5 = -1;
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    sVar1 = *(short *)ppsVar8;
    ppsVar8 = (short **)((longlong)ppsVar8 + 2);
  } while (sVar1 != 0);
  FUN_140001b00(&local_b8);
  FUN_1401e1690(local_68,&local_b8);
  if (7 < local_a0) {
    operator_delete((void *)CONCAT62(uStack_b6,local_b8));
  }
  local_a0 = 7;
  local_a8 = 0;
  local_b8 = 0;
  pppppppuVar9 = local_68;
  if (0xf < local_50) {
    pppppppuVar9 = local_68[0];
  }
  FUN_1400275d0(local_248,pppppppuVar9);
  DAT_1403100dc = 0;
  cVar2 = FUN_1400276a0(local_248,local_210 + 2);
  if (cVar2 == '\0') {
    FUN_140025f00("Error : %d - %s",local_1ec,local_1e8 + 2);
    local_248[0] = TiXmlDocument::vftable;
    if (local_1e8 != &DAT_14031fee8) {
      operator_delete__(local_1e0);
    }
    local_248[0] = TiXmlNode::vftable;
    while (local_220 != (longlong *)0x0) {
      plVar11 = (longlong *)local_220[10];
      (**(code **)*local_220)(local_220,1);
      local_220 = plVar11;
    }
    if (local_210 != &DAT_14031fee8) {
      operator_delete__(local_208);
    }
    local_248[0] = TiXmlBase::vftable;
    if (0xf < local_50) {
      operator_delete(local_68[0]);
    }
    return 0;
  }
  if ((*(byte *)(param_1 + 0x1e8) < 0xd) ||
     (plVar11 = local_220, (byte)(*(byte *)(param_1 + 0x1e8) - 0x11) < 3)) {
    FUN_140088160(param_1);
    plVar11 = local_220;
  }
  for (; plVar11 != (longlong *)0x0; plVar11 = (longlong *)plVar11[10]) {
    bVar19 = (char *)(plVar11[7] + 0x10) == (char *)0x0;
    lVar5 = 0xd;
    pcVar12 = (char *)(plVar11[7] + 0x10);
    pcVar13 = "agentmanager";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar19 = *pcVar12 == *pcVar13;
      pcVar12 = pcVar12 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar19);
    if (bVar19) goto LAB_1400847f3;
  }
LAB_140084854:
  *(int *)(param_1 + 0x154) = param_2;
  *(undefined1 *)(param_1 + 0x150) = 1;
  FUN_140088420(&local_1a8);
  std::basic_ostream<>::operator<<((basic_ostream<> *)&local_1a8,param_2);
  FUN_1400884c0(&local_1a8);
  for (plVar11 = local_220; plVar10 = local_220, plVar11 != (longlong *)0x0;
      plVar11 = (longlong *)plVar11[10]) {
    bVar19 = (char *)(plVar11[7] + 0x10) == (char *)0x0;
    lVar5 = 0xc;
    pcVar12 = (char *)(plVar11[7] + 0x10);
    pcVar13 = "each_option";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar19 = *pcVar12 == *pcVar13;
      pcVar12 = pcVar12 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar19);
    if (bVar19) goto LAB_1400848c6;
  }
joined_r0x000140084a4b:
  do {
    plVar11 = local_220;
    if (plVar10 == (longlong *)0x0) goto joined_r0x000140084b17;
    bVar19 = (char *)(plVar10[7] + 0x10) == (char *)0x0;
    lVar5 = 4;
    pcVar12 = (char *)(plVar10[7] + 0x10);
    pcVar13 = "dns";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar19 = *pcVar12 == *pcVar13;
      pcVar12 = pcVar12 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar19);
    if (bVar19) goto LAB_140084a77;
    plVar10 = (longlong *)plVar10[10];
  } while( true );
LAB_1400847f3:
  while (lVar5 = (**(code **)(*plVar11 + 0x30))(plVar11), lVar5 == 0) {
    do {
      plVar11 = (longlong *)plVar11[10];
      if (plVar11 == (longlong *)0x0) goto LAB_140084854;
      bVar19 = (char *)(plVar11[7] + 0x10) == (char *)0x0;
      lVar5 = 0xd;
      pcVar12 = (char *)(plVar11[7] + 0x10);
      pcVar13 = "agentmanager";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar19 = *pcVar12 == *pcVar13;
        pcVar12 = pcVar12 + 1;
        pcVar13 = pcVar13 + 1;
      } while (bVar19);
    } while (!bVar19);
  }
  lVar5 = (**(code **)(*plVar11 + 0x30))(plVar11);
  if ((lVar5 != 0) && (lVar5 = FUN_140026d00(lVar5,"server"), lVar5 != 0)) {
    FUN_140087290(param_1,lVar5);
  }
  goto LAB_140084854;
LAB_1400848c6:
  while (lVar5 = (**(code **)(*plVar11 + 0x30))(plVar11), lVar5 == 0) {
    do {
      plVar11 = (longlong *)plVar11[10];
      plVar10 = local_220;
      if (plVar11 == (longlong *)0x0) goto joined_r0x000140084a4b;
      bVar19 = (char *)(plVar11[7] + 0x10) == (char *)0x0;
      lVar5 = 0xc;
      pcVar12 = (char *)(plVar11[7] + 0x10);
      pcVar13 = "each_option";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar19 = *pcVar12 == *pcVar13;
        pcVar12 = pcVar12 + 1;
        pcVar13 = pcVar13 + 1;
      } while (bVar19);
    } while (!bVar19);
  }
  lVar5 = (**(code **)(*plVar11 + 0x30))(plVar11);
  plVar10 = local_220;
  if (lVar5 != 0) {
    for (plVar11 = *(longlong **)(lVar5 + 0x28); pcVar12 = _Str, plVar11 != (longlong *)0x0;
        plVar11 = (longlong *)plVar11[10]) {
      lVar5 = (**(code **)(*plVar11 + 0x30))(plVar11);
      if (lVar5 != 0) {
        pcVar12 = (char *)(**(code **)(*plVar11 + 0x30))(plVar11);
        break;
      }
    }
joined_r0x000140084943:
    plVar10 = local_220;
    if (pcVar12 != (char *)0x0) {
      pcVar13 = (char *)(*(longlong *)(pcVar12 + 0x38) + 0x10);
      if (pcVar13 != (char *)0x0) {
        for (pcVar14 = *(char **)(pcVar12 + 0xa0); pcVar14 != pcVar12 + 0x58;
            pcVar14 = *(char **)(pcVar14 + 0x48)) {
          bVar19 = (char *)(*(longlong *)(pcVar14 + 0x20) + 0x10) == (char *)0x0;
          lVar5 = 5;
          pcVar15 = (char *)(*(longlong *)(pcVar14 + 0x20) + 0x10);
          pcVar16 = "code";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar19 = *pcVar15 == *pcVar16;
            pcVar15 = pcVar15 + 1;
            pcVar16 = pcVar16 + 1;
          } while (bVar19);
          if (bVar19) {
            if ((char *)(*(longlong *)(pcVar14 + 0x30) + 0x10) != (char *)0x0) {
              pcVar15 = &local_90;
              if (0xf < local_78) {
                pcVar15 = (char *)CONCAT71(uStack_8f,local_90);
              }
              iVar3 = _stricmp(pcVar15,(char *)(*(longlong *)(pcVar14 + 0x30) + 0x10));
              if (iVar3 == 0) {
                iVar3 = _stricmp(pcVar13,"guild");
                if (iVar3 == 0) {
                  *(undefined4 *)(param_1 + 0x158) = 1;
                }
                else {
                  iVar3 = _stricmp(pcVar13,"api");
                  if (iVar3 == 0) {
                    FUN_140087290(param_1);
                  }
                }
              }
            }
            break;
          }
        }
      }
      for (plVar11 = *(longlong **)(pcVar12 + 0x50); pcVar12 = _Str, plVar11 != (longlong *)0x0;
          plVar11 = (longlong *)plVar11[10]) {
        lVar5 = (**(code **)(*plVar11 + 0x30))(plVar11);
        if (lVar5 != 0) {
          pcVar12 = (char *)(**(code **)(*plVar11 + 0x30))(plVar11);
          break;
        }
      }
      goto joined_r0x000140084943;
    }
  }
  goto joined_r0x000140084a4b;
LAB_140084a77:
  while (lVar5 = (**(code **)(*plVar10 + 0x30))(plVar10), lVar5 == 0) {
    do {
      plVar10 = (longlong *)plVar10[10];
      plVar11 = local_220;
      if (plVar10 == (longlong *)0x0) goto joined_r0x000140084b17;
      bVar19 = (char *)(plVar10[7] + 0x10) == (char *)0x0;
      lVar5 = 4;
      pcVar12 = (char *)(plVar10[7] + 0x10);
      pcVar13 = "dns";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar19 = *pcVar12 == *pcVar13;
        pcVar12 = pcVar12 + 1;
        pcVar13 = pcVar13 + 1;
      } while (bVar19);
    } while (!bVar19);
  }
  lVar5 = (**(code **)(*plVar10 + 0x30))(plVar10);
  plVar11 = local_220;
  if (lVar5 != 0) {
    for (lVar7 = *(longlong *)(lVar5 + 0xa0); lVar7 != lVar5 + 0x58;
        lVar7 = *(longlong *)(lVar7 + 0x48)) {
      pcVar12 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
      bVar19 = pcVar12 == (char *)0x0;
      lVar4 = 4;
      pcVar13 = "dns";
      do {
        if (lVar4 == 0) break;
        lVar4 = lVar4 + -1;
        bVar19 = *pcVar12 == *pcVar13;
        pcVar12 = pcVar12 + 1;
        pcVar13 = pcVar13 + 1;
      } while (bVar19);
      if (bVar19) {
        pcVar12 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
        if (pcVar12 != (char *)0x0) {
          iVar3 = atoi(pcVar12);
          *(bool *)(param_1 + 0x151) = 0 < iVar3;
          plVar11 = local_220;
        }
        break;
      }
    }
  }
joined_r0x000140084b17:
  do {
    plVar10 = local_220;
    if (plVar11 == (longlong *)0x0) goto joined_r0x000140084be7;
    bVar19 = (char *)(plVar11[7] + 0x10) == (char *)0x0;
    lVar5 = 0xb;
    pcVar12 = (char *)(plVar11[7] + 0x10);
    pcVar13 = "code_start";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar19 = *pcVar12 == *pcVar13;
      pcVar12 = pcVar12 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar19);
    if (bVar19) break;
    plVar11 = (longlong *)plVar11[10];
  } while( true );
  while (lVar5 = (**(code **)(*plVar11 + 0x30))(plVar11), lVar5 == 0) {
    do {
      plVar11 = (longlong *)plVar11[10];
      plVar10 = local_220;
      if (plVar11 == (longlong *)0x0) goto joined_r0x000140084be7;
      bVar19 = (char *)(plVar11[7] + 0x10) == (char *)0x0;
      lVar5 = 0xb;
      pcVar12 = (char *)(plVar11[7] + 0x10);
      pcVar13 = "code_start";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar19 = *pcVar12 == *pcVar13;
        pcVar12 = pcVar12 + 1;
        pcVar13 = pcVar13 + 1;
      } while (bVar19);
    } while (!bVar19);
  }
  lVar5 = (**(code **)(*plVar11 + 0x30))(plVar11);
  plVar10 = local_220;
  if (lVar5 != 0) {
    for (lVar7 = *(longlong *)(lVar5 + 0xa0); lVar7 != lVar5 + 0x58;
        lVar7 = *(longlong *)(lVar7 + 0x48)) {
      pcVar12 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
      bVar19 = pcVar12 == (char *)0x0;
      lVar4 = 0xb;
      pcVar13 = "code_start";
      do {
        if (lVar4 == 0) break;
        lVar4 = lVar4 + -1;
        bVar19 = *pcVar12 == *pcVar13;
        pcVar12 = pcVar12 + 1;
        pcVar13 = pcVar13 + 1;
      } while (bVar19);
      if (bVar19) {
        pcVar12 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
        if (pcVar12 != (char *)0x0) {
          iVar3 = atoi(pcVar12);
          *(bool *)(param_1 + 0x152) = 0 < iVar3;
          plVar10 = local_220;
        }
        break;
      }
    }
  }
joined_r0x000140084be7:
  do {
    if (plVar10 == (longlong *)0x0) goto LAB_140084e2c;
    bVar19 = (char *)(plVar10[7] + 0x10) == (char *)0x0;
    lVar5 = 8;
    pcVar12 = (char *)(plVar10[7] + 0x10);
    pcVar13 = "setting";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar19 = *pcVar12 == *pcVar13;
      pcVar12 = pcVar12 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar19);
    if (bVar19) break;
    plVar10 = (longlong *)plVar10[10];
  } while( true );
  while (lVar5 = (**(code **)(*plVar10 + 0x30))(plVar10), lVar5 == 0) {
    do {
      plVar10 = (longlong *)plVar10[10];
      if (plVar10 == (longlong *)0x0) goto LAB_140084e2c;
      bVar19 = (char *)(plVar10[7] + 0x10) == (char *)0x0;
      lVar5 = 8;
      pcVar12 = (char *)(plVar10[7] + 0x10);
      pcVar13 = "setting";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar19 = *pcVar12 == *pcVar13;
        pcVar12 = pcVar12 + 1;
        pcVar13 = pcVar13 + 1;
      } while (bVar19);
    } while (!bVar19);
  }
  lVar5 = (**(code **)(*plVar10 + 0x30))(plVar10);
  if (lVar5 != 0) {
    lVar4 = lVar5 + 0x58;
    for (lVar7 = *(longlong *)(lVar5 + 0xa0); pcVar12 = _Str, lVar7 != lVar4;
        lVar7 = *(longlong *)(lVar7 + 0x48)) {
      pcVar12 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
      bVar19 = pcVar12 == (char *)0x0;
      lVar6 = 6;
      pcVar13 = "multi";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar19 = *pcVar12 == *pcVar13;
        pcVar12 = pcVar12 + 1;
        pcVar13 = pcVar13 + 1;
      } while (bVar19);
      if (bVar19) {
        pcVar12 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar7 = *(longlong *)(lVar5 + 0xa0); pcVar13 = _Str, lVar7 != lVar4;
        lVar7 = *(longlong *)(lVar7 + 0x48)) {
      pcVar13 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
      bVar19 = pcVar13 == (char *)0x0;
      lVar6 = 5;
      pcVar14 = "lock";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar19 = *pcVar13 == *pcVar14;
        pcVar13 = pcVar13 + 1;
        pcVar14 = pcVar14 + 1;
      } while (bVar19);
      if (bVar19) {
        pcVar13 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar7 = *(longlong *)(lVar5 + 0xa0); pcVar14 = _Str, lVar7 != lVar4;
        lVar7 = *(longlong *)(lVar7 + 0x48)) {
      pcVar14 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
      bVar19 = pcVar14 == (char *)0x0;
      lVar6 = 0xd;
      pcVar15 = "start_server";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar19 = *pcVar14 == *pcVar15;
        pcVar14 = pcVar14 + 1;
        pcVar15 = pcVar15 + 1;
      } while (bVar19);
      if (bVar19) {
        pcVar14 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar7 = *(longlong *)(lVar5 + 0xa0); pcVar15 = _Str, lVar7 != lVar4;
        lVar7 = *(longlong *)(lVar7 + 0x48)) {
      pcVar15 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
      bVar19 = pcVar15 == (char *)0x0;
      lVar6 = 0xe;
      pcVar16 = "revive_server";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar19 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar19);
      if (bVar19) {
        pcVar15 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar5 = *(longlong *)(lVar5 + 0xa0); pcVar16 = _Str, lVar5 != lVar4;
        lVar5 = *(longlong *)(lVar5 + 0x48)) {
      pcVar16 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
      bVar19 = pcVar16 == (char *)0x0;
      lVar7 = 0xd;
      pcVar17 = "open_channel";
      do {
        if (lVar7 == 0) break;
        lVar7 = lVar7 + -1;
        bVar19 = *pcVar16 == *pcVar17;
        pcVar16 = pcVar16 + 1;
        pcVar17 = pcVar17 + 1;
      } while (bVar19);
      if (bVar19) {
        pcVar16 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
        break;
      }
    }
    if (pcVar12 != (char *)0x0) {
      iVar3 = atoi(pcVar12);
      *(bool *)(param_1 + 0x166) = 0 < iVar3;
    }
    if (pcVar15 != (char *)0x0) {
      iVar3 = atoi(pcVar15);
      *(bool *)(param_1 + 0x171) = 0 < iVar3;
    }
    if (pcVar16 != (char *)0x0) {
      iVar3 = atoi(pcVar16);
      *(bool *)(param_1 + 0x170) = 0 < iVar3;
    }
    if (pcVar13 != (char *)0x0) {
      iVar3 = atoi(pcVar13);
      *(double *)(param_1 + 0x168) = (double)iVar3;
    }
    if (pcVar14 != (char *)0x0) {
      iVar3 = atoi(pcVar14);
      *(double *)(param_1 + 0x178) = (double)iVar3;
    }
  }
LAB_140084e2c:
  DAT_14031fe90 = 0;
  DAT_14031fe91 = 0;
  DAT_14031fe92 = 0;
  DAT_14031fe93 = 0;
  DAT_14031fe94 = 0;
  DAT_14031fe95 = 1;
  DAT_14031fe96 = 1;
  for (plVar11 = local_220; plVar11 != (longlong *)0x0; plVar11 = (longlong *)plVar11[10]) {
    bVar19 = (char *)(plVar11[7] + 0x10) == (char *)0x0;
    lVar5 = 8;
    pcVar12 = (char *)(plVar11[7] + 0x10);
    pcVar13 = "develop";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar19 = *pcVar12 == *pcVar13;
      pcVar12 = pcVar12 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar19);
    if (bVar19) goto LAB_140084e96;
  }
  goto LAB_140085143;
LAB_140084e96:
  while (lVar5 = (**(code **)(*plVar11 + 0x30))(plVar11), lVar5 == 0) {
    do {
      plVar11 = (longlong *)plVar11[10];
      if (plVar11 == (longlong *)0x0) goto LAB_140085143;
      bVar19 = (char *)(plVar11[7] + 0x10) == (char *)0x0;
      lVar5 = 8;
      pcVar12 = (char *)(plVar11[7] + 0x10);
      pcVar13 = "develop";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar19 = *pcVar12 == *pcVar13;
        pcVar12 = pcVar12 + 1;
        pcVar13 = pcVar13 + 1;
      } while (bVar19);
    } while (!bVar19);
  }
  lVar5 = (**(code **)(*plVar11 + 0x30))(plVar11);
  if (lVar5 != 0) {
    lVar4 = lVar5 + 0x58;
    for (lVar7 = *(longlong *)(lVar5 + 0xa0); pcVar12 = _Str, lVar7 != lVar4;
        lVar7 = *(longlong *)(lVar7 + 0x48)) {
      pcVar12 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
      bVar19 = pcVar12 == (char *)0x0;
      lVar6 = 8;
      pcVar13 = "preload";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar19 = *pcVar12 == *pcVar13;
        pcVar12 = pcVar12 + 1;
        pcVar13 = pcVar13 + 1;
      } while (bVar19);
      if (bVar19) {
        pcVar12 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar7 = *(longlong *)(lVar5 + 0xa0); lVar7 != lVar4; lVar7 = *(longlong *)(lVar7 + 0x48)) {
      pcVar13 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
      bVar19 = pcVar13 == (char *)0x0;
      lVar6 = 0xd;
      pcVar14 = "preload_char";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar19 = *pcVar13 == *pcVar14;
        pcVar13 = pcVar13 + 1;
        pcVar14 = pcVar14 + 1;
      } while (bVar19);
      if (bVar19) {
        _Str = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar7 = *(longlong *)(lVar5 + 0xa0); lVar7 != lVar4; lVar7 = *(longlong *)(lVar7 + 0x48)) {
      pcVar13 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
      bVar19 = pcVar13 == (char *)0x0;
      lVar6 = 0xc;
      pcVar14 = "enemy_debug";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar19 = *pcVar13 == *pcVar14;
        pcVar13 = pcVar13 + 1;
        pcVar14 = pcVar14 + 1;
      } while (bVar19);
      if (bVar19) {
        pcVar13 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
        goto LAB_140084fa0;
      }
    }
    pcVar13 = (char *)0x0;
LAB_140084fa0:
    for (lVar7 = *(longlong *)(lVar5 + 0xa0); lVar7 != lVar4; lVar7 = *(longlong *)(lVar7 + 0x48)) {
      pcVar14 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
      bVar19 = pcVar14 == (char *)0x0;
      lVar6 = 10;
      pcVar15 = "enemy_one";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar19 = *pcVar14 == *pcVar15;
        pcVar14 = pcVar14 + 1;
        pcVar15 = pcVar15 + 1;
      } while (bVar19);
      if (bVar19) {
        pcVar14 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
        goto LAB_140084fe0;
      }
    }
    pcVar14 = (char *)0x0;
LAB_140084fe0:
    for (lVar7 = *(longlong *)(lVar5 + 0xa0); lVar7 != lVar4; lVar7 = *(longlong *)(lVar7 + 0x48)) {
      pcVar15 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
      bVar19 = pcVar15 == (char *)0x0;
      lVar6 = 0xd;
      pcVar16 = "player_debug";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar19 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar19);
      if (bVar19) {
        pcVar15 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
        goto LAB_140085020;
      }
    }
    pcVar15 = (char *)0x0;
LAB_140085020:
    for (lVar7 = *(longlong *)(lVar5 + 0xa0); lVar7 != lVar4; lVar7 = *(longlong *)(lVar7 + 0x48)) {
      pcVar16 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
      bVar19 = pcVar16 == (char *)0x0;
      lVar6 = 9;
      pcVar17 = "lua_text";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar19 = *pcVar16 == *pcVar17;
        pcVar16 = pcVar16 + 1;
        pcVar17 = pcVar17 + 1;
      } while (bVar19);
      if (bVar19) {
        pcVar16 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
        goto LAB_14008505f;
      }
    }
    pcVar16 = (char *)0x0;
LAB_14008505f:
    for (lVar5 = *(longlong *)(lVar5 + 0xa0); lVar5 != lVar4; lVar5 = *(longlong *)(lVar5 + 0x48)) {
      pcVar17 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
      bVar19 = pcVar17 == (char *)0x0;
      lVar7 = 9;
      pcVar18 = "lua_send";
      do {
        if (lVar7 == 0) break;
        lVar7 = lVar7 + -1;
        bVar19 = *pcVar17 == *pcVar18;
        pcVar17 = pcVar17 + 1;
        pcVar18 = pcVar18 + 1;
      } while (bVar19);
      if (bVar19) {
        pcVar17 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
        goto LAB_14008509f;
      }
    }
    pcVar17 = (char *)0x0;
LAB_14008509f:
    if (pcVar12 != (char *)0x0) {
      iVar3 = atoi(pcVar12);
      DAT_14031fe95 = 0 < iVar3;
    }
    if (_Str != (char *)0x0) {
      iVar3 = atoi(_Str);
      DAT_14031fe96 = 0 < iVar3;
    }
    if (pcVar14 != (char *)0x0) {
      iVar3 = atoi(pcVar14);
      DAT_14031fe91 = 0 < iVar3;
    }
    if (pcVar13 != (char *)0x0) {
      iVar3 = atoi(pcVar13);
      DAT_14031fe90 = 0 < iVar3;
    }
    if (pcVar15 != (char *)0x0) {
      iVar3 = atoi(pcVar15);
      DAT_14031fe92 = 0 < iVar3;
    }
    if (pcVar16 != (char *)0x0) {
      iVar3 = atoi(pcVar16);
      DAT_14031fe93 = 0 < iVar3;
    }
    if (pcVar17 != (char *)0x0) {
      iVar3 = atoi(pcVar17);
      DAT_14031fe94 = 0 < iVar3;
    }
  }
LAB_140085143:
  if (0xf < local_78) {
    operator_delete((void *)CONCAT71(uStack_8f,local_90));
  }
  local_78 = 0xf;
  local_80 = 0;
  local_90 = '\0';
  local_1b8 = local_120;
  *(undefined ***)((longlong)local_1a0 + (longlong)*(int *)(local_1a8 + 4) + -8) =
       std::basic_ostringstream<>::vftable;
  local_1c8 = local_1a0;
  local_1a0[0] = std::basic_stringbuf<>::vftable;
  if ((local_128 & 1) != 0) {
    operator_delete((void *)*local_180);
  }
  std::basic_streambuf<>::setg((basic_streambuf<> *)local_1a0,(char *)0x0,(char *)0x0,(char *)0x0);
  *local_178 = 0;
  *local_158 = 0;
  *local_140 = 0;
  local_130 = 0;
  local_128 = local_128 & 0xfffffffe;
  std::basic_streambuf<>::~basic_streambuf<>((basic_streambuf<> *)local_1a0);
  *(code **)((longlong)local_1a0 + (longlong)*(int *)(local_1a8 + 4) + -8) = _vftable__exref;
  std::basic_ios<>::~basic_ios<>(local_120);
  local_248[0] = TiXmlDocument::vftable;
  if (local_1e8 != &DAT_14031fee8) {
    operator_delete__(local_1e0);
  }
  local_248[0] = TiXmlNode::vftable;
  while (local_220 != (longlong *)0x0) {
    plVar11 = (longlong *)local_220[10];
    (**(code **)*local_220)(local_220,1);
    local_220 = plVar11;
  }
  if (local_210 != &DAT_14031fee8) {
    operator_delete__(local_208);
  }
  local_248[0] = TiXmlBase::vftable;
  if (0xf < local_50) {
    operator_delete(local_68[0]);
  }
  return 1;
}



void FUN_1400852d0(longlong *param_1)

{
  basic_ios<> *this;
  
  this = (basic_ios<> *)(param_1 + 0x11);
  *(undefined ***)(this + (longlong)*(int *)(*param_1 + 4) + -0x88) =
       std::basic_ostringstream<>::vftable;
  FUN_1400884f0(param_1 + 1);
  *(code **)(this + (longlong)*(int *)(*param_1 + 4) + -0x88) = _vftable__exref;
                    // WARNING: Could not recover jumptable at 0x00014008533b. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_ios<>::~basic_ios<>(this);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

undefined8 FUN_140085350(longlong param_1,LPCWSTR param_2)

{
  char **ppcVar1;
  WCHAR WVar2;
  char cVar3;
  int iVar4;
  char **ppcVar5;
  undefined8 uVar6;
  char *pcVar7;
  char *pcVar8;
  char *pcVar9;
  char *pcVar10;
  char *pcVar11;
  longlong lVar12;
  ulonglong uVar13;
  longlong lVar14;
  longlong lVar15;
  longlong lVar16;
  wchar_t *_Format;
  longlong *plVar17;
  longlong *plVar18;
  char *pcVar19;
  char *pcVar20;
  char *pcVar21;
  char *pcVar22;
  LPCWSTR pWVar23;
  char *pcVar24;
  LPCSTR pCVar25;
  WCHAR *pWVar26;
  LPCSTR pCVar27;
  bool bVar28;
  undefined1 auStackY_4e8 [32];
  char *local_4a8;
  longlong local_4a0;
  undefined **local_498;
  undefined8 local_490;
  undefined8 local_488;
  undefined8 local_480;
  undefined4 local_478;
  longlong *local_470;
  undefined8 local_468;
  undefined8 *local_460;
  void *local_458;
  undefined8 local_450;
  undefined8 local_448;
  undefined1 local_440;
  undefined4 local_43c;
  undefined8 *local_438;
  void *local_430;
  undefined4 local_428;
  undefined8 local_424;
  undefined1 local_41c;
  char *local_418;
  char *local_410;
  char *local_408;
  char *local_400;
  char *local_3f8;
  char *local_3f0;
  undefined8 local_3e8;
  undefined2 local_3d8;
  undefined6 uStack_3d6;
  undefined8 local_3c8;
  ulonglong local_3c0;
  undefined8 local_3b0;
  undefined8 local_3a8;
  undefined8 local_3a0;
  undefined1 local_398;
  undefined7 uStack_397;
  undefined8 local_388;
  ulonglong local_380;
  CHAR local_368 [272];
  WCHAR local_258 [264];
  ulonglong local_48;
  
  local_3e8 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStackY_4e8;
  local_368[0] = '\0';
  local_4a0 = param_1;
  memset(local_368 + 1,0,0x103);
  lVar12 = -1;
  pWVar23 = param_2;
  do {
    if (lVar12 == 0) break;
    lVar12 = lVar12 + -1;
    WVar2 = *pWVar23;
    pWVar23 = pWVar23 + 1;
  } while (WVar2 != L'\0');
  pcVar19 = (char *)0x0;
  WideCharToMultiByte(0,0,param_2,~(uint)lVar12,local_368,0x104,(LPCSTR)0x0,(LPBOOL)0x0);
  local_490 = 0xffffffffffffffff;
  local_488 = 0;
  local_460 = &DAT_14031fee8;
  local_480 = 0;
  local_478 = 0;
  local_470 = (longlong *)0x0;
  local_468 = 0;
  local_450 = 0;
  local_448 = 0;
  local_498 = TiXmlDocument::vftable;
  local_438 = &DAT_14031fee8;
  local_424 = 0xffffffffffffffff;
  local_428 = 4;
  local_41c = 0;
  uVar13 = 0xffffffffffffffff;
  pcVar7 = local_368;
  do {
    if (uVar13 == 0) break;
    uVar13 = uVar13 - 1;
    cVar3 = *pcVar7;
    pcVar7 = pcVar7 + 1;
  } while (cVar3 != '\0');
  FUN_140026290(&local_460,local_368,~uVar13 - 1);
  local_440 = 0;
  local_43c = 0;
  FUN_140026290(&local_438,&DAT_14027a10a,0);
  local_424 = 0;
  DAT_1403100dc = 0;
  cVar3 = FUN_1400276a0(&local_498);
  if (cVar3 == '\0') {
    FUN_140025f00("Error : %d - %s",local_43c,local_438 + 2);
    local_498 = TiXmlDocument::vftable;
    if (local_438 != &DAT_14031fee8) {
      operator_delete__(local_430);
    }
    local_498 = TiXmlNode::vftable;
    plVar18 = local_470;
    while (plVar18 != (longlong *)0x0) {
      plVar17 = (longlong *)plVar18[10];
      (**(code **)*plVar18)(plVar18,1);
      plVar18 = plVar17;
    }
    if (local_460 != &DAT_14031fee8) {
      operator_delete__(local_458);
    }
    return 0;
  }
  memset(local_258,0,0x208);
  for (plVar18 = local_470; plVar18 != (longlong *)0x0; plVar18 = (longlong *)plVar18[10]) {
    bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
    lVar12 = 7;
    pcVar7 = (char *)(plVar18[7] + 0x10);
    pcVar8 = "server";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar7 == *pcVar8;
      pcVar7 = pcVar7 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) goto LAB_140085566;
  }
  goto LAB_140085d36;
LAB_140085566:
  while (lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18), lVar12 == 0) {
    do {
      plVar18 = (longlong *)plVar18[10];
      if (plVar18 == (longlong *)0x0) goto LAB_140085d36;
      bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
      lVar12 = 7;
      pcVar7 = (char *)(plVar18[7] + 0x10);
      pcVar8 = "server";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar7 == *pcVar8;
        pcVar7 = pcVar7 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar18 + 0x30))();
  if (lVar12 != 0) {
    lVar16 = lVar12 + 0x58;
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); lVar14 != lVar16;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar7 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar7 == (char *)0x0;
      lVar15 = 5;
      pcVar8 = "name";
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        bVar28 = *pcVar7 == *pcVar8;
        pcVar7 = pcVar7 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        local_418 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        goto LAB_1400855f5;
      }
    }
    local_418 = (char *)0x0;
LAB_1400855f5:
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); lVar14 != lVar16;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar7 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar7 == (char *)0x0;
      lVar15 = 5;
      pcVar8 = "code";
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        bVar28 = *pcVar7 == *pcVar8;
        pcVar7 = pcVar7 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        local_400 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        goto LAB_140085635;
      }
    }
    local_400 = (char *)0x0;
LAB_140085635:
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); lVar14 != lVar16;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar7 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar7 == (char *)0x0;
      lVar15 = 0xb;
      pcVar8 = "private_ip";
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        bVar28 = *pcVar7 == *pcVar8;
        pcVar7 = pcVar7 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        local_4a8 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        goto LAB_140085677;
      }
    }
    local_4a8 = (char *)0x0;
LAB_140085677:
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); lVar14 != lVar16;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar7 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar7 == (char *)0x0;
      lVar15 = 0xd;
      pcVar8 = "private_port";
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        bVar28 = *pcVar7 == *pcVar8;
        pcVar7 = pcVar7 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        local_408 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        goto LAB_1400856b5;
      }
    }
    local_408 = (char *)0x0;
LAB_1400856b5:
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); lVar14 != lVar16;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar7 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar7 == (char *)0x0;
      lVar15 = 10;
      pcVar8 = "public_ip";
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        bVar28 = *pcVar7 == *pcVar8;
        pcVar7 = pcVar7 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        local_410 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        goto LAB_1400856f5;
      }
    }
    local_410 = (char *)0x0;
LAB_1400856f5:
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); lVar14 != lVar16;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar7 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar7 == (char *)0x0;
      lVar15 = 0xc;
      pcVar8 = "public_port";
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        bVar28 = *pcVar7 == *pcVar8;
        pcVar7 = pcVar7 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        local_3f0 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        goto LAB_140085735;
      }
    }
    local_3f0 = (char *)0x0;
LAB_140085735:
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); lVar14 != lVar16;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar7 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar7 == (char *)0x0;
      lVar15 = 0xf;
      pcVar8 = "public_udpport";
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        bVar28 = *pcVar7 == *pcVar8;
        pcVar7 = pcVar7 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        local_3f8 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        goto LAB_140085775;
      }
    }
    local_3f8 = (char *)0x0;
LAB_140085775:
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); pCVar27 = pcVar19, lVar14 != lVar16;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar7 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar7 == (char *)0x0;
      lVar15 = 0xb;
      pcVar8 = "thread_num";
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        bVar28 = *pcVar7 == *pcVar8;
        pcVar7 = pcVar7 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        pCVar27 = (LPCSTR)(*(longlong *)(lVar14 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); pcVar7 = pcVar19, lVar14 != lVar16;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar7 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar7 == (char *)0x0;
      lVar15 = 6;
      pcVar8 = "agent";
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        bVar28 = *pcVar7 == *pcVar8;
        pcVar7 = pcVar7 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar7 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); pcVar8 = pcVar19, lVar14 != lVar16;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar8 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar8 == (char *)0x0;
      lVar15 = 6;
      pcVar9 = "debug";
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        bVar28 = *pcVar8 == *pcVar9;
        pcVar8 = pcVar8 + 1;
        pcVar9 = pcVar9 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar8 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); lVar14 != lVar16;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar9 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar9 == (char *)0x0;
      lVar15 = 6;
      pcVar10 = "world";
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        bVar28 = *pcVar9 == *pcVar10;
        pcVar9 = pcVar9 + 1;
        pcVar10 = pcVar10 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar19 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); lVar14 != lVar16;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar9 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar9 == (char *)0x0;
      lVar15 = 10;
      pcVar10 = "udp_count";
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        bVar28 = *pcVar9 == *pcVar10;
        pcVar9 = pcVar9 + 1;
        pcVar10 = pcVar10 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar9 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        goto LAB_1400858b6;
      }
    }
    pcVar9 = (char *)0x0;
LAB_1400858b6:
    pcVar10 = (char *)0x0;
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); lVar14 != lVar16;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar11 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar11 == (char *)0x0;
      lVar15 = 0xc;
      pcVar21 = "private_dns";
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        bVar28 = *pcVar11 == *pcVar21;
        pcVar11 = pcVar11 + 1;
        pcVar21 = pcVar21 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar10 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar12 = *(longlong *)(lVar12 + 0xa0); lVar12 != lVar16;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar11 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar28 = pcVar11 == (char *)0x0;
      lVar14 = 0xb;
      pcVar21 = "public_dns";
      do {
        if (lVar14 == 0) break;
        lVar14 = lVar14 + -1;
        bVar28 = *pcVar11 == *pcVar21;
        pcVar11 = pcVar11 + 1;
        pcVar21 = pcVar21 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar11 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        goto LAB_140085933;
      }
    }
    pcVar11 = (char *)0x0;
LAB_140085933:
    if (pcVar10 != (char *)0x0) {
      local_380 = 0xf;
      local_388 = 0;
      local_398 = 0;
      lVar12 = -1;
      pcVar21 = pcVar10;
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        cVar3 = *pcVar21;
        pcVar21 = pcVar21 + 1;
      } while (cVar3 != '\0');
      FUN_140003e60(&local_398,pcVar10);
      uVar6 = FUN_1401e1d60(&local_3d8,&local_398);
      FUN_14008a320(local_4a0 + 0x30,uVar6);
      if (7 < local_3c0) {
        operator_delete((void *)CONCAT62(uStack_3d6,local_3d8));
      }
      local_3c0 = 7;
      local_3c8 = 0;
      local_3d8 = 0;
      if (0xf < local_380) {
        operator_delete((void *)CONCAT71(uStack_397,local_398));
      }
    }
    if (local_4a8 != (char *)0x0) {
      local_380 = 0xf;
      local_388 = 0;
      local_398 = 0;
      lVar12 = -1;
      pcVar10 = local_4a8;
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        cVar3 = *pcVar10;
        pcVar10 = pcVar10 + 1;
      } while (cVar3 != '\0');
      FUN_140003e60(&local_398);
      uVar6 = FUN_1401e1d60(&local_3d8,&local_398);
      FUN_14008a320(local_4a0 + 0x30,uVar6);
      if (7 < local_3c0) {
        operator_delete((void *)CONCAT62(uStack_3d6,local_3d8));
      }
      local_3c0 = 7;
      local_3c8 = 0;
      local_3d8 = 0;
      if (0xf < local_380) {
        operator_delete((void *)CONCAT71(uStack_397,local_398));
      }
    }
    lVar12 = local_4a0;
    if (pcVar11 != (char *)0x0) {
      local_380 = 0xf;
      local_388 = 0;
      local_398 = 0;
      lVar12 = -1;
      pcVar10 = pcVar11;
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        cVar3 = *pcVar10;
        pcVar10 = pcVar10 + 1;
      } while (cVar3 != '\0');
      FUN_140003e60(&local_398,pcVar11);
      uVar6 = FUN_1401e1d60(&local_3d8,&local_398);
      lVar12 = local_4a0;
      FUN_14008a320(local_4a0 + 0x58,uVar6);
      if (7 < local_3c0) {
        operator_delete((void *)CONCAT62(uStack_3d6,local_3d8));
      }
      local_3c0 = 7;
      local_3c8 = 0;
      local_3d8 = 0;
      if (0xf < local_380) {
        operator_delete((void *)CONCAT71(uStack_397,local_398));
      }
    }
    if (local_410 != (char *)0x0) {
      local_380 = 0xf;
      local_388 = 0;
      local_398 = 0;
      lVar14 = -1;
      pcVar10 = local_410;
      do {
        if (lVar14 == 0) break;
        lVar14 = lVar14 + -1;
        cVar3 = *pcVar10;
        pcVar10 = pcVar10 + 1;
      } while (cVar3 != '\0');
      FUN_140003e60(&local_398);
      uVar6 = FUN_1401e1d60(&local_3d8,&local_398);
      FUN_14008a320(lVar12 + 0x58,uVar6);
      if (7 < local_3c0) {
        operator_delete((void *)CONCAT62(uStack_3d6,local_3d8));
      }
      local_3c0 = 7;
      local_3c8 = 0;
      local_3d8 = 0;
      if (0xf < local_380) {
        operator_delete((void *)CONCAT71(uStack_397,local_398));
      }
    }
    if (local_408 != (char *)0x0) {
      iVar4 = atoi(local_408);
      *(int *)(lVar12 + 0x80) = iVar4;
    }
    if (local_3f0 != (char *)0x0) {
      iVar4 = atoi(local_3f0);
      *(int *)(lVar12 + 0x84) = iVar4;
    }
    if (local_3f8 != (char *)0x0) {
      iVar4 = atoi(local_3f8);
      *(int *)(lVar12 + 0x88) = iVar4;
    }
    if (local_418 != (char *)0x0) {
      local_380 = 0xf;
      local_388 = 0;
      local_398 = 0;
      lVar14 = -1;
      pcVar10 = local_418;
      do {
        if (lVar14 == 0) break;
        lVar14 = lVar14 + -1;
        cVar3 = *pcVar10;
        pcVar10 = pcVar10 + 1;
      } while (cVar3 != '\0');
      FUN_140003e60(&local_398);
      FUN_1401e1d60(&local_3d8,&local_398);
      FUN_14008a320(lVar12 + 8);
      if (7 < local_3c0) {
        operator_delete((void *)CONCAT62(uStack_3d6,local_3d8));
      }
      local_3c0 = 7;
      local_3c8 = 0;
      local_3d8 = 0;
      if (0xf < local_380) {
        operator_delete((void *)CONCAT71(uStack_397,local_398));
      }
    }
    if (pCVar27 == (LPCSTR)0x0) {
      *(undefined4 *)(local_4a0 + 0x15c) = 1;
      param_1 = local_4a0;
    }
    else {
      memset(local_258,0,0x208);
      MultiByteToWideChar(0,1,pCVar27,0x104,local_258,0x104);
      param_1 = local_4a0;
      ppcVar1 = (char **)(local_4a0 + 0x15c);
      iVar4 = _wtoi(local_258);
      *(int *)ppcVar1 = iVar4;
      local_4a8 = (char *)CONCAT44(local_4a8._4_4_,1);
      ppcVar5 = &local_4a8;
      if (1 < *(int *)ppcVar1) {
        ppcVar5 = ppcVar1;
      }
      *(int *)ppcVar1 = *(int *)ppcVar5;
    }
    if (local_400 != (char *)0x0) {
      iVar4 = atoi(local_400);
      *(int *)(param_1 + 0x154) = iVar4;
    }
    if (pcVar7 != (char *)0x0) {
      iVar4 = atoi(pcVar7);
      *(bool *)(param_1 + 0x150) = iVar4 == 1;
    }
    if (pcVar8 != (char *)0x0) {
      iVar4 = atoi(pcVar8);
      *(bool *)(param_1 + 0x165) = iVar4 == 1;
    }
    if (pcVar19 != (char *)0x0) {
      iVar4 = atoi(pcVar19);
      *(int *)(param_1 + 0x140) = iVar4;
    }
    if (pcVar9 != (char *)0x0) {
      iVar4 = atoi(pcVar9);
      *(int *)(param_1 + 0x8c) = iVar4;
    }
  }
LAB_140085d36:
  pcVar7 = (char *)0x0;
  for (plVar18 = local_470; plVar17 = local_470, plVar18 != (longlong *)0x0;
      plVar18 = (longlong *)plVar18[10]) {
    bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
    lVar12 = 0xb;
    pcVar19 = (char *)(plVar18[7] + 0x10);
    pcVar8 = "db_account";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) goto LAB_140085d73;
  }
joined_r0x000140085dd0:
  do {
    plVar18 = local_470;
    if (plVar17 == (longlong *)0x0) goto joined_r0x000140085e60;
    bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
    lVar12 = 7;
    pcVar19 = (char *)(plVar17[7] + 0x10);
    pcVar8 = "db_web";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) goto LAB_140085e03;
    plVar17 = (longlong *)plVar17[10];
  } while( true );
LAB_140085d73:
  while (lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18), lVar12 == 0) {
    do {
      plVar18 = (longlong *)plVar18[10];
      plVar17 = local_470;
      if (plVar18 == (longlong *)0x0) goto joined_r0x000140085dd0;
      bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
      lVar12 = 0xb;
      pcVar19 = (char *)(plVar18[7] + 0x10);
      pcVar8 = "db_account";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18);
  plVar17 = local_470;
  if (lVar12 != 0) {
    FUN_1400871b0(param_1 + 0x90,param_1 + 0x130);
    plVar17 = local_470;
  }
  goto joined_r0x000140085dd0;
LAB_140085e03:
  while (lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17), lVar12 == 0) {
    do {
      plVar17 = (longlong *)plVar17[10];
      plVar18 = local_470;
      if (plVar17 == (longlong *)0x0) goto joined_r0x000140085e60;
      bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
      lVar12 = 7;
      pcVar19 = (char *)(plVar17[7] + 0x10);
      pcVar8 = "db_web";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17);
  plVar18 = local_470;
  if (lVar12 != 0) {
    FUN_1400871b0(param_1 + 0xb8,param_1 + 0x134);
    plVar18 = local_470;
  }
joined_r0x000140085e60:
  do {
    plVar17 = local_470;
    if (plVar18 == (longlong *)0x0) goto joined_r0x000140085ef0;
    bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
    lVar12 = 8;
    pcVar19 = (char *)(plVar18[7] + 0x10);
    pcVar8 = "db_game";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar18 = (longlong *)plVar18[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18), lVar12 == 0) {
    do {
      plVar18 = (longlong *)plVar18[10];
      plVar17 = local_470;
      if (plVar18 == (longlong *)0x0) goto joined_r0x000140085ef0;
      bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
      lVar12 = 8;
      pcVar19 = (char *)(plVar18[7] + 0x10);
      pcVar8 = "db_game";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18);
  plVar17 = local_470;
  if (lVar12 != 0) {
    FUN_1400871b0(param_1 + 0xe0,param_1 + 0x138);
    plVar17 = local_470;
  }
joined_r0x000140085ef0:
  do {
    plVar18 = local_470;
    if (plVar17 == (longlong *)0x0) goto joined_r0x000140085f80;
    bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
    lVar12 = 0xc;
    pcVar19 = (char *)(plVar17[7] + 0x10);
    pcVar8 = "db_game_log";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar17 = (longlong *)plVar17[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17), lVar12 == 0) {
    do {
      plVar17 = (longlong *)plVar17[10];
      plVar18 = local_470;
      if (plVar17 == (longlong *)0x0) goto joined_r0x000140085f80;
      bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
      lVar12 = 0xc;
      pcVar19 = (char *)(plVar17[7] + 0x10);
      pcVar8 = "db_game_log";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17);
  plVar18 = local_470;
  if (lVar12 != 0) {
    FUN_1400871b0(param_1 + 0x108,param_1 + 0x13c);
    plVar18 = local_470;
  }
joined_r0x000140085f80:
  do {
    plVar17 = local_470;
    if (plVar18 == (longlong *)0x0) goto joined_r0x000140086052;
    bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
    lVar12 = 4;
    pcVar19 = (char *)(plVar18[7] + 0x10);
    pcVar8 = "dbc";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar18 = (longlong *)plVar18[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18), lVar12 == 0) {
    do {
      plVar18 = (longlong *)plVar18[10];
      plVar17 = local_470;
      if (plVar18 == (longlong *)0x0) goto joined_r0x000140086052;
      bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
      lVar12 = 4;
      pcVar19 = (char *)(plVar18[7] + 0x10);
      pcVar8 = "dbc";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18);
  plVar17 = local_470;
  if (lVar12 != 0) {
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); lVar14 != lVar12 + 0x58;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar19 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar19 == (char *)0x0;
      lVar16 = 0x13;
      pcVar8 = "write_thread_count";
      do {
        if (lVar16 == 0) break;
        lVar16 = lVar16 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar19 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        if (pcVar19 != (char *)0x0) {
          iVar4 = atoi(pcVar19);
          *(int *)(param_1 + 0x14c) = iVar4;
          plVar17 = local_470;
        }
        break;
      }
    }
  }
joined_r0x000140086052:
  do {
    plVar18 = local_470;
    if (plVar17 == (longlong *)0x0) goto joined_r0x000140086122;
    bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
    lVar12 = 9;
    pcVar19 = (char *)(plVar17[7] + 0x10);
    pcVar8 = "db_cache";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar17 = (longlong *)plVar17[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17), lVar12 == 0) {
    do {
      plVar17 = (longlong *)plVar17[10];
      plVar18 = local_470;
      if (plVar17 == (longlong *)0x0) goto joined_r0x000140086122;
      bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
      lVar12 = 9;
      pcVar19 = (char *)(plVar17[7] + 0x10);
      pcVar8 = "db_cache";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17);
  plVar18 = local_470;
  if (lVar12 != 0) {
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); lVar14 != lVar12 + 0x58;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar19 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar19 == (char *)0x0;
      lVar16 = 0xe;
      pcVar8 = "session_count";
      do {
        if (lVar16 == 0) break;
        lVar16 = lVar16 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar19 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        if (pcVar19 != (char *)0x0) {
          iVar4 = atoi(pcVar19);
          *(int *)(param_1 + 0x144) = iVar4;
          plVar18 = local_470;
        }
        break;
      }
    }
  }
joined_r0x000140086122:
  do {
    if (plVar18 == (longlong *)0x0) goto LAB_1400861e5;
    bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
    lVar12 = 0xd;
    pcVar19 = (char *)(plVar18[7] + 0x10);
    pcVar8 = "db_log_cache";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar18 = (longlong *)plVar18[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18), lVar12 == 0) {
    do {
      plVar18 = (longlong *)plVar18[10];
      if (plVar18 == (longlong *)0x0) goto LAB_1400861e5;
      bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
      lVar12 = 0xd;
      pcVar19 = (char *)(plVar18[7] + 0x10);
      pcVar8 = "db_log_cache";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18);
  if (lVar12 == 0) {
LAB_1400861e5:
    iVar4 = *(int *)(param_1 + 0x144);
LAB_1400861ec:
    *(int *)(param_1 + 0x148) = iVar4;
    plVar18 = local_470;
  }
  else {
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); plVar18 = local_470, lVar14 != lVar12 + 0x58;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar19 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar19 == (char *)0x0;
      lVar16 = 0xe;
      pcVar8 = "session_count";
      do {
        if (lVar16 == 0) break;
        lVar16 = lVar16 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar19 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        if (pcVar19 != (char *)0x0) {
          iVar4 = atoi(pcVar19);
          goto LAB_1400861ec;
        }
        break;
      }
    }
  }
  do {
    plVar17 = local_470;
    if (plVar18 == (longlong *)0x0) goto joined_r0x000140086278;
    bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
    lVar12 = 0xd;
    pcVar19 = (char *)(plVar18[7] + 0x10);
    pcVar8 = "agentmanager";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar18 = (longlong *)plVar18[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18), lVar12 == 0) {
    do {
      plVar18 = (longlong *)plVar18[10];
      plVar17 = local_470;
      if (plVar18 == (longlong *)0x0) goto joined_r0x000140086278;
      bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
      lVar12 = 0xd;
      pcVar19 = (char *)(plVar18[7] + 0x10);
      pcVar8 = "agentmanager";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18);
  plVar17 = local_470;
  if (lVar12 != 0) {
    FUN_140087290(param_1,lVar12);
    plVar17 = local_470;
  }
joined_r0x000140086278:
  do {
    plVar18 = local_470;
    if (plVar17 == (longlong *)0x0) goto joined_r0x0001400862f8;
    bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
    lVar12 = 9;
    pcVar19 = (char *)(plVar17[7] + 0x10);
    pcVar8 = "db_cache";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar17 = (longlong *)plVar17[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17), lVar12 == 0) {
    do {
      plVar17 = (longlong *)plVar17[10];
      plVar18 = local_470;
      if (plVar17 == (longlong *)0x0) goto joined_r0x0001400862f8;
      bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
      lVar12 = 9;
      pcVar19 = (char *)(plVar17[7] + 0x10);
      pcVar8 = "db_cache";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17);
  plVar18 = local_470;
  if (lVar12 != 0) {
    FUN_140087290(param_1,lVar12);
    plVar18 = local_470;
  }
joined_r0x0001400862f8:
  do {
    plVar17 = local_470;
    if (plVar18 == (longlong *)0x0) goto joined_r0x000140086378;
    bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
    lVar12 = 0xd;
    pcVar19 = (char *)(plVar18[7] + 0x10);
    pcVar8 = "db_log_cache";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar18 = (longlong *)plVar18[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18), lVar12 == 0) {
    do {
      plVar18 = (longlong *)plVar18[10];
      plVar17 = local_470;
      if (plVar18 == (longlong *)0x0) goto joined_r0x000140086378;
      bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
      lVar12 = 0xd;
      pcVar19 = (char *)(plVar18[7] + 0x10);
      pcVar8 = "db_log_cache";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18);
  plVar17 = local_470;
  if (lVar12 != 0) {
    FUN_140087290(param_1,lVar12);
    plVar17 = local_470;
  }
joined_r0x000140086378:
  do {
    plVar18 = local_470;
    if (plVar17 == (longlong *)0x0) goto joined_r0x0001400863f8;
    bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
    lVar12 = 0xb;
    pcVar19 = (char *)(plVar17[7] + 0x10);
    pcVar8 = "msg_server";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar17 = (longlong *)plVar17[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17), lVar12 == 0) {
    do {
      plVar17 = (longlong *)plVar17[10];
      plVar18 = local_470;
      if (plVar17 == (longlong *)0x0) goto joined_r0x0001400863f8;
      bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
      lVar12 = 0xb;
      pcVar19 = (char *)(plVar17[7] + 0x10);
      pcVar8 = "msg_server";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17);
  plVar18 = local_470;
  if (lVar12 != 0) {
    FUN_140087290(param_1,lVar12);
    plVar18 = local_470;
  }
joined_r0x0001400863f8:
  do {
    plVar17 = local_470;
    if (plVar18 == (longlong *)0x0) goto joined_r0x000140086478;
    bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
    lVar12 = 10;
    pcVar19 = (char *)(plVar18[7] + 0x10);
    pcVar8 = "gm_server";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar18 = (longlong *)plVar18[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18), lVar12 == 0) {
    do {
      plVar18 = (longlong *)plVar18[10];
      plVar17 = local_470;
      if (plVar18 == (longlong *)0x0) goto joined_r0x000140086478;
      bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
      lVar12 = 10;
      pcVar19 = (char *)(plVar18[7] + 0x10);
      pcVar8 = "gm_server";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18);
  plVar17 = local_470;
  if (lVar12 != 0) {
    FUN_140087290(param_1,lVar12);
    plVar17 = local_470;
  }
joined_r0x000140086478:
  do {
    plVar18 = local_470;
    if (plVar17 == (longlong *)0x0) goto joined_r0x0001400864f8;
    bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
    lVar12 = 0xf;
    pcVar19 = (char *)(plVar17[7] + 0x10);
    pcVar8 = "auction_server";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar17 = (longlong *)plVar17[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17), lVar12 == 0) {
    do {
      plVar17 = (longlong *)plVar17[10];
      plVar18 = local_470;
      if (plVar17 == (longlong *)0x0) goto joined_r0x0001400864f8;
      bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
      lVar12 = 0xf;
      pcVar19 = (char *)(plVar17[7] + 0x10);
      pcVar8 = "auction_server";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17);
  plVar18 = local_470;
  if (lVar12 != 0) {
    FUN_140087290(param_1,lVar12);
    plVar18 = local_470;
  }
joined_r0x0001400864f8:
  do {
    plVar17 = local_470;
    if (plVar18 == (longlong *)0x0) goto joined_r0x000140086578;
    bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
    lVar12 = 0xf;
    pcVar19 = (char *)(plVar18[7] + 0x10);
    pcVar8 = "manager_server";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar18 = (longlong *)plVar18[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18), lVar12 == 0) {
    do {
      plVar18 = (longlong *)plVar18[10];
      plVar17 = local_470;
      if (plVar18 == (longlong *)0x0) goto joined_r0x000140086578;
      bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
      lVar12 = 0xf;
      pcVar19 = (char *)(plVar18[7] + 0x10);
      pcVar8 = "manager_server";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18);
  plVar17 = local_470;
  if (lVar12 != 0) {
    FUN_140087290(param_1,lVar12);
    plVar17 = local_470;
  }
joined_r0x000140086578:
  do {
    plVar18 = local_470;
    if (plVar17 == (longlong *)0x0) goto joined_r0x0001400865f8;
    bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
    lVar12 = 0xd;
    pcVar19 = (char *)(plVar17[7] + 0x10);
    pcVar8 = "match_server";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar17 = (longlong *)plVar17[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17), lVar12 == 0) {
    do {
      plVar17 = (longlong *)plVar17[10];
      plVar18 = local_470;
      if (plVar17 == (longlong *)0x0) goto joined_r0x0001400865f8;
      bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
      lVar12 = 0xd;
      pcVar19 = (char *)(plVar17[7] + 0x10);
      pcVar8 = "match_server";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17);
  plVar18 = local_470;
  if (lVar12 != 0) {
    FUN_140087290(param_1,lVar12);
    plVar18 = local_470;
  }
joined_r0x0001400865f8:
  do {
    plVar17 = local_470;
    if (plVar18 == (longlong *)0x0) goto joined_r0x000140086678;
    bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
    lVar12 = 0xd;
    pcVar19 = (char *)(plVar18[7] + 0x10);
    pcVar8 = "agent_server";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar18 = (longlong *)plVar18[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18), lVar12 == 0) {
    do {
      plVar18 = (longlong *)plVar18[10];
      plVar17 = local_470;
      if (plVar18 == (longlong *)0x0) goto joined_r0x000140086678;
      bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
      lVar12 = 0xd;
      pcVar19 = (char *)(plVar18[7] + 0x10);
      pcVar8 = "agent_server";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18);
  plVar17 = local_470;
  if (lVar12 != 0) {
    FUN_140087290(param_1,lVar12);
    plVar17 = local_470;
  }
joined_r0x000140086678:
  do {
    plVar18 = local_470;
    if (plVar17 == (longlong *)0x0) goto joined_r0x0001400866f8;
    bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
    lVar12 = 4;
    pcVar19 = (char *)(plVar17[7] + 0x10);
    pcVar8 = "api";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar17 = (longlong *)plVar17[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17), lVar12 == 0) {
    do {
      plVar17 = (longlong *)plVar17[10];
      plVar18 = local_470;
      if (plVar17 == (longlong *)0x0) goto joined_r0x0001400866f8;
      bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
      lVar12 = 4;
      pcVar19 = (char *)(plVar17[7] + 0x10);
      pcVar8 = "api";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17);
  plVar18 = local_470;
  if (lVar12 != 0) {
    FUN_140087290(param_1,lVar12);
    plVar18 = local_470;
  }
joined_r0x0001400866f8:
  do {
    plVar17 = local_470;
    if (plVar18 == (longlong *)0x0) goto joined_r0x0001400867c7;
    bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
    lVar12 = 4;
    pcVar19 = (char *)(plVar18[7] + 0x10);
    pcVar8 = "dns";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar18 = (longlong *)plVar18[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18), lVar12 == 0) {
    do {
      plVar18 = (longlong *)plVar18[10];
      plVar17 = local_470;
      if (plVar18 == (longlong *)0x0) goto joined_r0x0001400867c7;
      bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
      lVar12 = 4;
      pcVar19 = (char *)(plVar18[7] + 0x10);
      pcVar8 = "dns";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18);
  plVar17 = local_470;
  if (lVar12 != 0) {
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); lVar14 != lVar12 + 0x58;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar19 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar19 == (char *)0x0;
      lVar16 = 4;
      pcVar8 = "dns";
      do {
        if (lVar16 == 0) break;
        lVar16 = lVar16 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar19 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        if (pcVar19 != (char *)0x0) {
          iVar4 = atoi(pcVar19);
          *(bool *)(param_1 + 0x151) = 0 < iVar4;
          plVar17 = local_470;
        }
        break;
      }
    }
  }
joined_r0x0001400867c7:
  do {
    plVar18 = local_470;
    if (plVar17 == (longlong *)0x0) goto joined_r0x000140086901;
    bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
    lVar12 = 8;
    pcVar19 = (char *)(plVar17[7] + 0x10);
    pcVar8 = "setting";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) break;
    plVar17 = (longlong *)plVar17[10];
  } while( true );
  while (lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17), lVar12 == 0) {
    do {
      plVar17 = (longlong *)plVar17[10];
      plVar18 = local_470;
      if (plVar17 == (longlong *)0x0) goto joined_r0x000140086901;
      bVar28 = (char *)(plVar17[7] + 0x10) == (char *)0x0;
      lVar12 = 8;
      pcVar19 = (char *)(plVar17[7] + 0x10);
      pcVar8 = "setting";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar17 + 0x30))(plVar17);
  plVar18 = local_470;
  if (lVar12 != 0) {
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); pcVar19 = pcVar7, lVar14 != lVar12 + 0x58;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar19 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar19 == (char *)0x0;
      lVar16 = 6;
      pcVar8 = "multi";
      do {
        if (lVar16 == 0) break;
        lVar16 = lVar16 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar19 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); pcVar8 = pcVar7, lVar14 != lVar12 + 0x58;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar8 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar8 == (char *)0x0;
      lVar16 = 5;
      pcVar9 = "lock";
      do {
        if (lVar16 == 0) break;
        lVar16 = lVar16 + -1;
        bVar28 = *pcVar8 == *pcVar9;
        pcVar8 = pcVar8 + 1;
        pcVar9 = pcVar9 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar8 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        break;
      }
    }
    if (pcVar19 != (char *)0x0) {
      iVar4 = atoi(pcVar19);
      *(bool *)(param_1 + 0x166) = 0 < iVar4;
    }
    plVar18 = local_470;
    if (pcVar8 != (char *)0x0) {
      iVar4 = atoi(pcVar8);
      *(double *)(param_1 + 0x168) = (double)iVar4;
      plVar18 = local_470;
    }
  }
joined_r0x000140086901:
  do {
    if (plVar18 == (longlong *)0x0) goto LAB_140086a93;
    bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
    lVar12 = 5;
    pcVar19 = (char *)(plVar18[7] + 0x10);
    pcVar8 = "auto";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar28 = *pcVar19 == *pcVar8;
      pcVar19 = pcVar19 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar28);
    if (bVar28) goto LAB_140086936;
    plVar18 = (longlong *)plVar18[10];
  } while( true );
joined_r0x000140086d54:
  if (pcVar7 == pcVar19) goto LAB_140086d99;
  bVar28 = (char *)(*(longlong *)(pcVar7 + 0x20) + 0x10) == (char *)0x0;
  lVar12 = 3;
  pcVar21 = (char *)(*(longlong *)(pcVar7 + 0x20) + 0x10);
  pcVar20 = "id";
  do {
    if (lVar12 == 0) break;
    lVar12 = lVar12 + -1;
    bVar28 = *pcVar21 == *pcVar20;
    pcVar21 = pcVar21 + 1;
    pcVar20 = pcVar20 + 1;
  } while (bVar28);
  if (bVar28) {
    pcVar22 = (char *)(*(longlong *)(pcVar7 + 0x30) + 0x10);
    goto LAB_140086d99;
  }
  pcVar7 = *(char **)(pcVar7 + 0x48);
  goto joined_r0x000140086d54;
LAB_140086936:
  while (lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18), lVar12 == 0) {
    do {
      plVar18 = (longlong *)plVar18[10];
      if (plVar18 == (longlong *)0x0) goto LAB_140086a93;
      bVar28 = (char *)(plVar18[7] + 0x10) == (char *)0x0;
      lVar12 = 5;
      pcVar19 = (char *)(plVar18[7] + 0x10);
      pcVar8 = "auto";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
    } while (!bVar28);
  }
  lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18);
  if (lVar12 != 0) {
    lVar14 = lVar12 + 0x58;
    for (lVar16 = *(longlong *)(lVar12 + 0xa0); pcVar19 = pcVar7, lVar16 != lVar14;
        lVar16 = *(longlong *)(lVar16 + 0x48)) {
      pcVar19 = (char *)(*(longlong *)(lVar16 + 0x20) + 0x10);
      bVar28 = pcVar19 == (char *)0x0;
      lVar15 = 0xd;
      pcVar8 = "start_server";
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar19 = (char *)(*(longlong *)(lVar16 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar16 = *(longlong *)(lVar12 + 0xa0); pcVar8 = pcVar7, lVar16 != lVar14;
        lVar16 = *(longlong *)(lVar16 + 0x48)) {
      pcVar8 = (char *)(*(longlong *)(lVar16 + 0x20) + 0x10);
      bVar28 = pcVar8 == (char *)0x0;
      lVar15 = 0xe;
      pcVar9 = "revive_server";
      do {
        if (lVar15 == 0) break;
        lVar15 = lVar15 + -1;
        bVar28 = *pcVar8 == *pcVar9;
        pcVar8 = pcVar8 + 1;
        pcVar9 = pcVar9 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar8 = (char *)(*(longlong *)(lVar16 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar12 = *(longlong *)(lVar12 + 0xa0); pcVar9 = pcVar7, lVar12 != lVar14;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar9 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar28 = pcVar9 == (char *)0x0;
      lVar16 = 0xd;
      pcVar10 = "open_channel";
      do {
        if (lVar16 == 0) break;
        lVar16 = lVar16 + -1;
        bVar28 = *pcVar9 == *pcVar10;
        pcVar9 = pcVar9 + 1;
        pcVar10 = pcVar10 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar9 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        break;
      }
    }
    if (pcVar19 != (char *)0x0) {
      iVar4 = atoi(pcVar19);
      *(double *)(param_1 + 0x178) = (double)iVar4;
    }
    if (pcVar8 != (char *)0x0) {
      iVar4 = atoi(pcVar8);
      *(bool *)(param_1 + 0x171) = 0 < iVar4;
    }
    if (pcVar9 != (char *)0x0) {
      iVar4 = atoi(pcVar9);
      *(bool *)(param_1 + 0x170) = 0 < iVar4;
    }
  }
LAB_140086a93:
  lVar12 = FUN_140026d00(&local_498,"guildlobby");
  if (lVar12 != 0) {
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); lVar14 != lVar12 + 0x58;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar19 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar19 == (char *)0x0;
      lVar16 = 6;
      pcVar8 = "value";
      do {
        if (lVar16 == 0) break;
        lVar16 = lVar16 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar19 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        if (pcVar19 != (char *)0x0) {
          iVar4 = atoi(pcVar19);
          *(uint *)(param_1 + 0x158) = (uint)(0 < iVar4);
        }
        break;
      }
    }
  }
  DAT_14031fe94 = 0;
  lVar12 = FUN_140026d00(&local_498,"lua_send");
  if (lVar12 != 0) {
    for (lVar14 = *(longlong *)(lVar12 + 0xa0); lVar14 != lVar12 + 0x58;
        lVar14 = *(longlong *)(lVar14 + 0x48)) {
      pcVar19 = (char *)(*(longlong *)(lVar14 + 0x20) + 0x10);
      bVar28 = pcVar19 == (char *)0x0;
      lVar16 = 5;
      pcVar8 = "send";
      do {
        if (lVar16 == 0) break;
        lVar16 = lVar16 + -1;
        bVar28 = *pcVar19 == *pcVar8;
        pcVar19 = pcVar19 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar28);
      if (bVar28) {
        pcVar7 = (char *)(*(longlong *)(lVar14 + 0x30) + 0x10);
        break;
      }
    }
    iVar4 = atoi(pcVar7);
    DAT_14031fe94 = 0 < iVar4;
  }
  if ((*(int *)(param_1 + 0x154) == 0) && (lVar12 = FUN_140026d00(&local_498,"Option"), lVar12 != 0)
     ) {
    uVar6 = FUN_140026d00(&local_498,"Option");
    pcVar7 = (char *)FUN_140026d00(uVar6,"channel");
    local_4a8 = pcVar7;
    while (pcVar7 != (char *)0x0) {
      pcVar9 = (char *)0x0;
      pcVar19 = pcVar7 + 0x58;
      for (pcVar8 = *(char **)(pcVar7 + 0xa0); pCVar27 = pcVar9, pcVar8 != pcVar19;
          pcVar8 = *(char **)(pcVar8 + 0x48)) {
        bVar28 = (char *)(*(longlong *)(pcVar8 + 0x20) + 0x10) == (char *)0x0;
        lVar12 = 5;
        pcVar10 = (char *)(*(longlong *)(pcVar8 + 0x20) + 0x10);
        pcVar11 = "name";
        do {
          if (lVar12 == 0) break;
          lVar12 = lVar12 + -1;
          bVar28 = *pcVar10 == *pcVar11;
          pcVar10 = pcVar10 + 1;
          pcVar11 = pcVar11 + 1;
        } while (bVar28);
        if (bVar28) {
          pCVar27 = (LPCSTR)(*(longlong *)(pcVar8 + 0x30) + 0x10);
          break;
        }
      }
      for (pcVar8 = *(char **)(pcVar7 + 0xa0); pcVar10 = pcVar9, pcVar8 != pcVar19;
          pcVar8 = *(char **)(pcVar8 + 0x48)) {
        bVar28 = (char *)(*(longlong *)(pcVar8 + 0x20) + 0x10) == (char *)0x0;
        lVar12 = 7;
        pcVar10 = (char *)(*(longlong *)(pcVar8 + 0x20) + 0x10);
        pcVar11 = "minlev";
        do {
          if (lVar12 == 0) break;
          lVar12 = lVar12 + -1;
          bVar28 = *pcVar10 == *pcVar11;
          pcVar10 = pcVar10 + 1;
          pcVar11 = pcVar11 + 1;
        } while (bVar28);
        if (bVar28) {
          pcVar10 = (char *)(*(longlong *)(pcVar8 + 0x30) + 0x10);
          break;
        }
      }
      for (pcVar8 = *(char **)(pcVar7 + 0xa0); pcVar11 = pcVar9, pcVar8 != pcVar19;
          pcVar8 = *(char **)(pcVar8 + 0x48)) {
        bVar28 = (char *)(*(longlong *)(pcVar8 + 0x20) + 0x10) == (char *)0x0;
        lVar12 = 7;
        pcVar11 = (char *)(*(longlong *)(pcVar8 + 0x20) + 0x10);
        pcVar21 = "maxlev";
        do {
          if (lVar12 == 0) break;
          lVar12 = lVar12 + -1;
          bVar28 = *pcVar11 == *pcVar21;
          pcVar11 = pcVar11 + 1;
          pcVar21 = pcVar21 + 1;
        } while (bVar28);
        if (bVar28) {
          pcVar11 = (char *)(*(longlong *)(pcVar8 + 0x30) + 0x10);
          break;
        }
      }
      for (pcVar8 = *(char **)(pcVar7 + 0xa0); pcVar8 != pcVar19; pcVar8 = *(char **)(pcVar8 + 0x48)
          ) {
        bVar28 = (char *)(*(longlong *)(pcVar8 + 0x20) + 0x10) == (char *)0x0;
        lVar12 = 6;
        pcVar21 = (char *)(*(longlong *)(pcVar8 + 0x20) + 0x10);
        pcVar22 = "group";
        do {
          if (lVar12 == 0) break;
          lVar12 = lVar12 + -1;
          bVar28 = *pcVar21 == *pcVar22;
          pcVar21 = pcVar21 + 1;
          pcVar22 = pcVar22 + 1;
        } while (bVar28);
        if (bVar28) {
          pcVar9 = (char *)(*(longlong *)(pcVar8 + 0x30) + 0x10);
          break;
        }
      }
      for (pcVar8 = *(char **)(pcVar7 + 0xa0); pcVar8 != pcVar19; pcVar8 = *(char **)(pcVar8 + 0x48)
          ) {
        bVar28 = (char *)(*(longlong *)(pcVar8 + 0x20) + 0x10) == (char *)0x0;
        lVar12 = 5;
        pcVar21 = (char *)(*(longlong *)(pcVar8 + 0x20) + 0x10);
        pcVar22 = "type";
        do {
          if (lVar12 == 0) break;
          lVar12 = lVar12 + -1;
          bVar28 = *pcVar21 == *pcVar22;
          pcVar21 = pcVar21 + 1;
          pcVar22 = pcVar22 + 1;
        } while (bVar28);
        if (bVar28) {
          pcVar8 = (char *)(*(longlong *)(pcVar8 + 0x30) + 0x10);
          goto LAB_140086d16;
        }
      }
      pcVar8 = (char *)0x0;
LAB_140086d16:
      pcVar22 = (char *)0x0;
      for (pcVar21 = *(char **)(pcVar7 + 0xa0); pcVar21 != pcVar19;
          pcVar21 = *(char **)(pcVar21 + 0x48)) {
        bVar28 = (char *)(*(longlong *)(pcVar21 + 0x20) + 0x10) == (char *)0x0;
        lVar12 = 3;
        pcVar20 = (char *)(*(longlong *)(pcVar21 + 0x20) + 0x10);
        pcVar24 = "id";
        do {
          if (lVar12 == 0) break;
          lVar12 = lVar12 + -1;
          bVar28 = *pcVar20 == *pcVar24;
          pcVar20 = pcVar20 + 1;
          pcVar24 = pcVar24 + 1;
        } while (bVar28);
        if (bVar28) {
          if (*(longlong *)(pcVar21 + 0x30) != -0x10) {
            pcVar7 = *(char **)(pcVar7 + 0xa0);
            goto joined_r0x000140086d54;
          }
          break;
        }
      }
      pcVar22 = "1";
LAB_140086d99:
      memset(local_258,0,0x208);
      lVar12 = -1;
      pCVar25 = pCVar27;
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        cVar3 = *pCVar25;
        pCVar25 = pCVar25 + 1;
      } while (cVar3 != '\0');
      MultiByteToWideChar(0,1,pCVar27,~(uint)lVar12,local_258,0x104);
      local_3c0 = 7;
      local_3c8 = 0;
      local_3d8 = 0;
      local_3b0 = 0;
      local_3a8 = 0;
      local_3a0 = 0;
      lVar12 = -1;
      pWVar26 = local_258;
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        WVar2 = *pWVar26;
        pWVar26 = pWVar26 + 1;
      } while (WVar2 != L'\0');
      FUN_140001b00(&local_3d8,local_258);
      if (pcVar10 != (char *)0x0) {
        iVar4 = atoi(pcVar10);
        local_3b0 = CONCAT44(local_3b0._4_4_,iVar4);
      }
      if (pcVar11 != (char *)0x0) {
        iVar4 = atoi(pcVar11);
        local_3b0 = CONCAT44(iVar4,(undefined4)local_3b0);
      }
      if (pcVar9 != (char *)0x0) {
        iVar4 = atoi(pcVar9);
        local_3a8 = CONCAT44(local_3a8._4_4_,iVar4);
      }
      if (pcVar8 != (char *)0x0) {
        iVar4 = atoi(pcVar8);
        local_3a0 = CONCAT44(local_3a0._4_4_,iVar4);
      }
      if (pcVar22 != (char *)0x0) {
        iVar4 = atoi(pcVar22);
        local_3a8 = CONCAT44(iVar4,(undefined4)local_3a8);
      }
      param_1 = local_4a0;
      FUN_1400883a0(local_4a0 + 0x188,&local_3d8);
      for (plVar18 = *(longlong **)(local_4a8 + 0x50); plVar18 != (longlong *)0x0;
          plVar18 = (longlong *)plVar18[10]) {
        lVar12 = (**(code **)(*plVar18 + 0x30))(plVar18);
        if (lVar12 != 0) {
          pcVar7 = (char *)(**(code **)(*plVar18 + 0x30))(plVar18);
          goto LAB_140086ed0;
        }
      }
      pcVar7 = (char *)0x0;
LAB_140086ed0:
      local_4a8 = pcVar7;
      if (7 < local_3c0) {
        operator_delete((void *)CONCAT62(uStack_3d6,local_3d8));
      }
    }
    if ((*(longlong *)(param_1 + 400) - *(longlong *)(param_1 + 0x188) & 0xffffffffffffffc0U) == 0)
    {
      local_3c0 = 7;
      local_3c8 = 0;
      local_3d8 = 0;
      local_3b0 = 0;
      local_3a8 = 0;
      local_3a0 = 0;
      FUN_140001b00(&local_3d8,&DAT_1402839f0,3);
      local_3b0 = 0x6400000001;
      local_3a8 = 0x100000001;
      local_3a0 = CONCAT44(local_3a0._4_4_,1);
      FUN_1400883a0(param_1 + 0x188,&local_3d8);
      if (7 < local_3c0) {
        operator_delete((void *)CONCAT62(uStack_3d6,local_3d8));
      }
    }
  }
  DAT_14031fe90 = 0;
  DAT_14031fe91 = 0;
  DAT_14031fe92 = 0;
  DAT_14031fe93 = 0;
  DAT_14031fe95 = 1;
  DAT_14031fe96 = 1;
  lVar12 = FUN_140026d00(&local_498,"develop");
  if (lVar12 != 0) {
    pcVar7 = (char *)FUN_140026fe0(lVar12,"preload");
    pcVar19 = (char *)FUN_140026fe0(lVar12,"preload_char");
    pcVar8 = (char *)FUN_140026fe0(lVar12,"enemy_debug");
    pcVar9 = (char *)FUN_140026fe0(lVar12,"enemy_one");
    pcVar10 = (char *)FUN_140026fe0(lVar12,"player_debug");
    pcVar11 = (char *)FUN_140026fe0(lVar12,"lua_text");
    if (pcVar7 != (char *)0x0) {
      iVar4 = atoi(pcVar7);
      DAT_14031fe95 = 0 < iVar4;
    }
    if (pcVar19 != (char *)0x0) {
      iVar4 = atoi(pcVar19);
      DAT_14031fe96 = 0 < iVar4;
    }
    if (pcVar9 != (char *)0x0) {
      iVar4 = atoi(pcVar9);
      DAT_14031fe91 = 0 < iVar4;
    }
    if (pcVar8 != (char *)0x0) {
      iVar4 = atoi(pcVar8);
      DAT_14031fe90 = 0 < iVar4;
    }
    if (pcVar10 != (char *)0x0) {
      iVar4 = atoi(pcVar10);
      DAT_14031fe92 = 0 < iVar4;
    }
    if (pcVar11 != (char *)0x0) {
      iVar4 = atoi(pcVar11);
      DAT_14031fe93 = 0 < iVar4;
    }
  }
  _Format = L"=================DNS. ServerParseOption============== \n";
  if (*(char *)(param_1 + 0x151) == '\0') {
    _Format = L"=================IP. ServerParseOption============== \n";
  }
  wprintf(_Format);
  wprintf(L"(PRIVATE)\t[ADDRESS:%s] [PORT:%d] \n");
  wprintf(L"(PUBLIC)\t[ADDRESS:%s] [PORT:%d] [UDP:%d] [UDPCOUNT:%d] \n");
  wprintf(L"==================================================== \n");
  local_498 = TiXmlDocument::vftable;
  if (local_438 != &DAT_14031fee8) {
    operator_delete__(local_430);
  }
  FUN_140026b00(&local_498);
  return 1;
}



void FUN_1400871b0(undefined8 param_1,int *param_2,longlong param_3)

{
  char cVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  ulonglong uVar6;
  char *_Str;
  char *pcVar7;
  char *pcVar8;
  char *pcVar9;
  bool bVar10;
  
  _Str = (char *)0x0;
  lVar2 = *(longlong *)(param_3 + 0xa0);
  for (lVar5 = lVar2; pcVar7 = _Str, lVar5 != param_3 + 0x58; lVar5 = *(longlong *)(lVar5 + 0x48)) {
    lVar4 = 7;
    pcVar7 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
    bVar10 = pcVar7 == (char *)0x0;
    pcVar8 = "string";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar10 = *pcVar7 == *pcVar8;
      pcVar7 = pcVar7 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar10);
    if (bVar10) {
      pcVar7 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
      break;
    }
  }
  do {
    if (lVar2 == param_3 + 0x58) break;
    lVar5 = 8;
    pcVar8 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
    bVar10 = pcVar8 == (char *)0x0;
    pcVar9 = "timeout";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar10 = *pcVar8 == *pcVar9;
      pcVar8 = pcVar8 + 1;
      pcVar9 = pcVar9 + 1;
    } while (bVar10);
    if (bVar10) {
      _Str = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
      break;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
  } while( true );
  if (pcVar7 != (char *)0x0) {
    uVar6 = 0xffffffffffffffff;
    pcVar8 = pcVar7;
    do {
      if (uVar6 == 0) break;
      uVar6 = uVar6 - 1;
      cVar1 = *pcVar8;
      pcVar8 = pcVar8 + 1;
    } while (cVar1 != '\0');
    FUN_140003e60(param_1,pcVar7,~uVar6 - 1);
  }
  if (_Str != (char *)0x0) {
    iVar3 = atoi(_Str);
    *param_2 = iVar3;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140087290(longlong param_1,longlong param_2,byte param_3)

{
  char cVar1;
  longlong lVar2;
  undefined8 *puVar3;
  void *pvVar4;
  undefined4 *puVar5;
  undefined8 uVar6;
  void **_Src;
  longlong lVar7;
  ulonglong uVar8;
  char *pcVar9;
  char *pcVar10;
  char *pcVar11;
  bool bVar12;
  undefined1 auStack_178 [32];
  void *local_158;
  undefined4 *local_150;
  undefined8 local_148;
  undefined4 *local_138;
  undefined4 *local_130;
  undefined8 local_128;
  undefined1 local_120 [24];
  undefined1 local_108 [24];
  byte local_f0;
  undefined7 uStack_ef;
  void *local_e8;
  undefined8 local_e0;
  ulonglong local_d8;
  undefined8 local_c8;
  undefined2 local_c0;
  undefined6 uStack_be;
  undefined8 local_b0;
  ulonglong local_a8;
  void *local_98 [2];
  void *local_88;
  void *local_80;
  byte local_68;
  undefined1 uStack_67;
  undefined6 uStack_66;
  void *local_60;
  undefined8 local_58;
  ulonglong local_50;
  ulonglong local_40;
  
  local_128 = 0xfffffffffffffffe;
  local_40 = DAT_1402f85a0 ^ (ulonglong)auStack_178;
  pcVar10 = (char *)0x0;
  local_c8 = 0;
  local_a8 = 7;
  local_b0 = 0;
  local_c0 = 0;
  local_80 = (void *)0x7;
  local_88 = (void *)0x0;
  local_98[0] = (void *)((ulonglong)local_98[0] & 0xffffffffffff0000);
  for (lVar2 = *(longlong *)(param_2 + 0xa0); lVar2 != param_2 + 0x58;
      lVar2 = *(longlong *)(lVar2 + 0x48)) {
    pcVar9 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
    bVar12 = pcVar9 == (char *)0x0;
    lVar7 = 3;
    pcVar11 = "ip";
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      bVar12 = *pcVar9 == *pcVar11;
      pcVar9 = pcVar9 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar12);
    if (bVar12) {
      pcVar10 = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
      break;
    }
  }
  local_d8 = 0xf;
  local_e0 = 0;
  local_f0 = 0;
  uVar8 = 0xffffffffffffffff;
  pcVar9 = pcVar10;
  do {
    if (uVar8 == 0) break;
    uVar8 = uVar8 - 1;
    cVar1 = *pcVar9;
    pcVar9 = pcVar9 + 1;
  } while (cVar1 != '\0');
  FUN_140003e60(&local_f0,pcVar10,~uVar8 - 1);
  _Src = (void **)FUN_1401e1d60(&local_68);
  if (local_98 != _Src) {
    if ((void *)0x7 < local_80) {
      operator_delete(local_98[0]);
    }
    local_80 = (void *)0x7;
    local_88 = (void *)0x0;
    local_98[0] = (void *)((ulonglong)local_98[0] & 0xffffffffffff0000);
    if (_Src[3] < (void *)0x8) {
      memmove(local_98,_Src,((longlong)_Src[2] + 1) * 2);
    }
    else {
      local_98[0] = *_Src;
      *_Src = (void *)0x0;
    }
    local_88 = _Src[2];
    local_80 = _Src[3];
    _Src[2] = (void *)0x0;
    _Src[3] = (void *)0x0;
  }
  if (7 < local_50) {
    operator_delete((void *)CONCAT62(uStack_66,CONCAT11(uStack_67,local_68)));
  }
  local_50 = 7;
  local_58 = 0;
  local_68 = 0;
  uStack_67 = 0;
  if (0xf < local_d8) {
    operator_delete((void *)CONCAT71(uStack_ef,local_f0));
  }
  for (lVar2 = *(longlong *)(param_2 + 0xa0); lVar2 != param_2 + 0x58;
      lVar2 = *(longlong *)(lVar2 + 0x48)) {
    pcVar10 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
    bVar12 = pcVar10 == (char *)0x0;
    lVar7 = 5;
    pcVar9 = "port";
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      bVar12 = *pcVar10 == *pcVar9;
      pcVar10 = pcVar10 + 1;
      pcVar9 = pcVar9 + 1;
    } while (bVar12);
    if (bVar12) {
      sscanf_s((char *)(*(longlong *)(lVar2 + 0x30) + 0x10),"%d");
      break;
    }
  }
  if (*(longlong *)(param_1 + 0x1c8) != 0) {
    for (puVar3 = *(undefined8 **)
                   (*(longlong *)(param_1 + 0x1a8) +
                   ((ulonglong)param_3 % *(ulonglong *)(param_1 + 0x1b0)) * 8);
        puVar3 != (undefined8 *)0x0; puVar3 = (undefined8 *)*puVar3) {
      if (param_3 == *(byte *)(puVar3 + 1)) {
        if (puVar3 != (undefined8 *)0x0) {
          FUN_140088cb0(puVar3 + 2,&local_c8);
          goto LAB_1400875e9;
        }
        break;
      }
    }
  }
  local_158 = (void *)0x0;
  local_150 = (undefined4 *)0x0;
  local_148 = 0;
  FUN_1400892a0(&local_158);
  puVar5 = local_150;
  local_138 = local_150;
  local_130 = local_150;
  if (local_150 != (undefined4 *)0x0) {
    *local_150 = (undefined4)local_c8;
    local_150[1] = local_c8._4_4_;
    *(undefined8 *)(local_150 + 8) = 7;
    *(undefined8 *)(local_150 + 6) = 0;
    *(undefined2 *)(local_150 + 2) = 0;
    FUN_140001700(local_150 + 2,&local_c0,0,0xffffffffffffffff);
    *(undefined8 *)(puVar5 + 0x12) = 7;
    *(undefined8 *)(puVar5 + 0x10) = 0;
    *(undefined2 *)(puVar5 + 0xc) = 0;
    FUN_140001700(puVar5 + 0xc,local_98,0,0xffffffffffffffff);
  }
  local_150 = puVar5 + 0x16;
  local_f0 = param_3;
  FUN_140089c30(&local_e8,&local_158);
  uVar6 = local_e0;
  pvVar4 = local_e8;
  local_68 = local_f0;
  local_60 = local_e8;
  local_58 = local_e0;
  local_50 = local_d8;
  local_e8 = (void *)0x0;
  local_e0 = 0;
  local_d8 = 0;
  if (*(longlong *)(param_1 + 0x1c8) == 0) {
    FUN_1400899d0(param_1 + 0x1a8,local_120,&local_68);
  }
  else {
    FUN_1400898b0(param_1 + 0x1a8,local_108,&local_68,&local_68);
  }
  if (pvVar4 != (void *)0x0) {
    FUN_14000bf70(pvVar4,uVar6);
    operator_delete(pvVar4);
  }
  pvVar4 = local_158;
  if (local_158 != (void *)0x0) {
    FUN_14000bf70(local_158,puVar5 + 0x16);
    operator_delete(pvVar4);
  }
LAB_1400875e9:
  if ((void *)0x7 < local_80) {
    operator_delete(local_98[0]);
  }
  local_80 = (void *)0x7;
  local_88 = (void *)0x0;
  local_98[0] = (void *)((ulonglong)local_98[0] & 0xffffffffffff0000);
  if (7 < local_a8) {
    operator_delete((void *)CONCAT62(uStack_be,local_c0));
  }
  return;
}



void FUN_140087640(longlong param_1)

{
  if (*(longlong *)(param_1 + 8) != 0) {
    FUN_14000bf70(*(longlong *)(param_1 + 8),*(undefined8 *)(param_1 + 0x10));
    operator_delete(*(void **)(param_1 + 8));
  }
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  return;
}



void FUN_140087680(longlong param_1,undefined8 param_2,byte param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  void *pvVar3;
  undefined8 uVar4;
  void *local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  void *local_90;
  undefined8 local_88;
  undefined8 local_80;
  byte local_70 [8];
  void *local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_48;
  undefined1 local_40 [24];
  undefined1 local_28 [32];
  
  local_48 = 0xfffffffffffffffe;
  plVar1 = (longlong *)(param_1 + 0x1a8);
  if (*(longlong *)(param_1 + 0x1c8) != 0) {
    for (puVar2 = *(undefined8 **)
                   (*plVar1 + ((ulonglong)param_3 % *(ulonglong *)(param_1 + 0x1b0)) * 8);
        puVar2 != (undefined8 *)0x0; puVar2 = (undefined8 *)*puVar2) {
      if (param_3 == *(byte *)(puVar2 + 1)) {
        if (puVar2 != (undefined8 *)0x0) {
          FUN_140088cb0(puVar2 + 2,param_2);
          return;
        }
        break;
      }
    }
  }
  local_90 = (void *)0x0;
  local_88 = 0;
  local_80 = 0;
  FUN_140088cb0(&local_90,param_2);
  FUN_140089c30(&local_b0,&local_90);
  uVar4 = local_a8;
  pvVar3 = local_b0;
  local_68 = local_b0;
  local_60 = local_a8;
  local_58 = local_a0;
  local_b0 = (void *)0x0;
  local_a8 = 0;
  local_a0 = 0;
  local_70[0] = param_3;
  if (*(longlong *)(param_1 + 0x1c8) == 0) {
    FUN_1400899d0(plVar1,local_40,local_70);
  }
  else {
    FUN_1400898b0(plVar1,local_28,local_70,local_70);
  }
  if (pvVar3 != (void *)0x0) {
    FUN_14000bf70(pvVar3,uVar4);
    operator_delete(pvVar3);
  }
  pvVar3 = local_90;
  if (local_90 != (void *)0x0) {
    FUN_14000bf70(local_90,local_88);
    operator_delete(pvVar3);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400877e0(longlong param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  undefined1 auVar2 [16];
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined1 auStack_68 [32];
  undefined8 local_48;
  undefined2 local_40;
  undefined6 uStack_3e;
  undefined8 local_30;
  ulonglong local_28;
  ulonglong local_18;
  
  local_48 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_68;
  if (*(char *)(param_1 + 0x150) == '\0') {
    uVar3 = FUN_1400878f0(param_2,L"option\\game_gateserver_list.txt",0);
  }
  else {
    local_28 = 7;
    local_30 = 0;
    local_40 = 0;
    FUN_140001b00(&local_40,L"GATE",4);
    puVar4 = (undefined8 *)0x0;
    if (*(longlong *)(param_1 + 0x1c8) != 0) {
      auVar2._8_8_ = 0;
      auVar2._0_8_ = *(ulonglong *)(param_1 + 0x1b0);
      for (puVar1 = *(undefined8 **)
                     (*(longlong *)(param_1 + 0x1a8) +
                     SUB168((ZEXT816(0) << 0x40 | ZEXT816(8)) % auVar2,0) * 8);
          puVar1 != (undefined8 *)0x0; puVar1 = (undefined8 *)*puVar1) {
        if (*(char *)(puVar1 + 1) == '\b') {
          puVar4 = (undefined8 *)0x0;
          if (puVar1 != (undefined8 *)0x0) {
            puVar4 = puVar1;
          }
          break;
        }
      }
    }
    if (puVar4 != (undefined8 *)0x0) {
      FUN_140088b10(param_2,puVar4 + 2);
    }
    if (7 < local_28) {
      operator_delete((void *)CONCAT62(uStack_3e,local_40));
    }
    uVar3 = 1;
  }
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400878f0(ulonglong *param_1,wchar_t *param_2,char param_3)

{
  char cVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined4 *puVar4;
  char cVar5;
  int iVar6;
  undefined8 uVar7;
  void *_DstBuf;
  void **ppvVar8;
  ulonglong uVar9;
  uint uVar10;
  __uint64 _ElementSize;
  char *pcVar11;
  char *pcVar12;
  char *pcVar13;
  longlong lVar14;
  longlong lVar15;
  longlong lVar16;
  ulonglong uVar17;
  undefined1 auStack_188 [32];
  char local_168;
  undefined **local_160;
  ulonglong local_158;
  undefined4 local_150;
  FILE *local_148;
  undefined4 *local_140;
  void *local_138;
  char *local_130;
  char *local_128;
  undefined8 local_120;
  undefined4 *local_110;
  wchar_t *local_108;
  undefined8 local_100;
  undefined8 local_f8;
  void *local_f0 [2];
  void *local_e0;
  void *local_d8;
  void *local_c8 [2];
  void *local_b8;
  void *local_b0;
  undefined1 local_98;
  undefined7 uStack_97;
  undefined8 local_88;
  ulonglong local_80;
  undefined2 local_70;
  undefined6 uStack_6e;
  undefined8 local_60;
  ulonglong local_58;
  ulonglong local_48;
  
  local_100 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_188;
  local_158 = 0;
  local_150 = 0;
  local_160 = MagiFileStream::vftable;
  local_148 = (FILE *)0x0;
  local_168 = param_3;
  local_108 = param_2;
  _wfopen_s(&local_148,param_2,L"rb");
  if (local_148 != (FILE *)0x0) {
    _fseeki64(local_148,0,2);
    local_158 = _ftelli64(local_148);
    _fseeki64(local_148,0,0);
  }
  (*(code *)local_160[7])(&local_160);
  if (local_148 == (FILE *)0x0) {
    local_160 = MagiFileStream::vftable;
    cVar5 = FUN_140096240(&local_160);
    if (cVar5 != '\0') {
      fclose(local_148);
    }
    uVar7 = 0;
  }
  else {
    if (local_158 == 0) {
      _fseeki64(local_148,0,2);
      local_158 = _ftelli64(local_148);
      _fseeki64(local_148,0,0);
    }
    uVar17 = local_158;
    _ElementSize = (__uint64)(int)local_158;
    _DstBuf = operator_new(_ElementSize);
    local_138 = _DstBuf;
    fread(_DstBuf,_ElementSize,1,local_148);
    local_130 = (char *)0x0;
    local_128 = (char *)0x0;
    local_120 = 0;
    FUN_1401e1a80(&local_130,_DstBuf,uVar17 & 0xffffffff,&DAT_140283c98);
    cVar5 = local_168;
    iVar6 = (int)(((longlong)local_128 - (longlong)local_130) / 0x28);
    if (param_3 == '\0') {
      uVar10 = iVar6 / 3 + (iVar6 >> 0x1f) +
               (int)(((longlong)iVar6 / 3 + ((longlong)iVar6 >> 0x3f) & 0xffffffffU) >> 0x1f);
    }
    else {
      uVar10 = (int)((iVar6 >> 0x1f & 3U) + iVar6) >> 2;
    }
    lVar16 = (longlong)iVar6;
    if (0 < (int)uVar10) {
      uVar17 = (ulonglong)uVar10;
      pcVar13 = local_130;
      lVar14 = 0;
      do {
        local_f8 = 0;
        local_d8 = (void *)0x7;
        local_e0 = (void *)0x0;
        local_f0[0] = (void *)((ulonglong)local_f0[0] & 0xffffffffffff0000);
        local_b0 = (void *)0x7;
        local_b8 = (void *)0x0;
        local_c8[0] = (void *)((ulonglong)local_c8[0] & 0xffffffffffff0000);
        pcVar11 = pcVar13;
        lVar15 = lVar14;
        if (lVar14 < lVar16) {
          if (0xf < *(ulonglong *)(pcVar13 + 0x18)) {
            pcVar11 = *(char **)pcVar13;
          }
          local_80 = 0xf;
          local_88 = 0;
          local_98 = 0;
          uVar9 = 0xffffffffffffffff;
          pcVar12 = pcVar11;
          do {
            if (uVar9 == 0) break;
            uVar9 = uVar9 - 1;
            cVar1 = *pcVar12;
            pcVar12 = pcVar12 + 1;
          } while (cVar1 != '\0');
          FUN_140003e60(&local_98,pcVar11,~uVar9 - 1);
          ppvVar8 = (void **)FUN_1401e1d60(&local_70,&local_98);
          if (local_f0 != ppvVar8) {
            if ((void *)0x7 < local_d8) {
              operator_delete(local_f0[0]);
            }
            local_d8 = (void *)0x7;
            local_e0 = (void *)0x0;
            local_f0[0] = (void *)((ulonglong)local_f0[0] & 0xffffffffffff0000);
            if (ppvVar8[3] < (void *)0x8) {
              memmove(local_f0,ppvVar8,((longlong)ppvVar8[2] + 1) * 2);
            }
            else {
              local_f0[0] = *ppvVar8;
              *ppvVar8 = (void *)0x0;
            }
            local_e0 = ppvVar8[2];
            local_d8 = ppvVar8[3];
            ppvVar8[2] = (void *)0x0;
            ppvVar8[3] = (void *)0x0;
          }
          if (7 < local_58) {
            operator_delete((void *)CONCAT62(uStack_6e,local_70));
          }
          local_58 = 7;
          local_60 = 0;
          local_70 = 0;
          if (0xf < local_80) {
            operator_delete((void *)CONCAT71(uStack_97,local_98));
          }
          lVar15 = lVar14 + 1;
          pcVar11 = pcVar13 + 0x28;
          if (lVar15 < lVar16) {
            if (0xf < *(ulonglong *)(pcVar13 + 0x40)) {
              pcVar11 = *(char **)pcVar11;
            }
            local_80 = 0xf;
            local_88 = 0;
            local_98 = 0;
            uVar9 = 0xffffffffffffffff;
            pcVar12 = pcVar11;
            do {
              if (uVar9 == 0) break;
              uVar9 = uVar9 - 1;
              cVar1 = *pcVar12;
              pcVar12 = pcVar12 + 1;
            } while (cVar1 != '\0');
            FUN_140003e60(&local_98,pcVar11,~uVar9 - 1);
            ppvVar8 = (void **)FUN_1401e1d60(&local_70,&local_98);
            if (local_c8 != ppvVar8) {
              if ((void *)0x7 < local_b0) {
                operator_delete(local_c8[0]);
              }
              local_b0 = (void *)0x7;
              local_b8 = (void *)0x0;
              local_c8[0] = (void *)((ulonglong)local_c8[0] & 0xffffffffffff0000);
              if (ppvVar8[3] < (void *)0x8) {
                memmove(local_c8,ppvVar8,((longlong)ppvVar8[2] + 1) * 2);
              }
              else {
                local_c8[0] = *ppvVar8;
                *ppvVar8 = (void *)0x0;
              }
              local_b8 = ppvVar8[2];
              local_b0 = ppvVar8[3];
              ppvVar8[2] = (void *)0x0;
              ppvVar8[3] = (void *)0x0;
            }
            if (7 < local_58) {
              operator_delete((void *)CONCAT62(uStack_6e,local_70));
            }
            local_58 = 7;
            local_60 = 0;
            local_70 = 0;
            if (0xf < local_80) {
              operator_delete((void *)CONCAT71(uStack_97,local_98));
            }
            lVar15 = lVar14 + 2;
            pcVar12 = pcVar13 + 0x50;
            pcVar11 = pcVar12;
            if (lVar15 < lVar16) {
              lVar15 = lVar14 + 3;
              pcVar11 = pcVar13 + 0x78;
              if (0xf < *(ulonglong *)(pcVar13 + 0x68)) {
                pcVar12 = *(char **)pcVar12;
              }
              iVar6 = atoi(pcVar12);
              local_f8 = CONCAT44(iVar6,(undefined4)local_f8);
            }
          }
        }
        pcVar13 = pcVar11;
        if ((cVar5 != '\0') && (lVar15 < lVar16)) {
          lVar15 = lVar15 + 1;
          pcVar13 = pcVar11 + 0x28;
          if (0xf < *(ulonglong *)(pcVar11 + 0x18)) {
            pcVar11 = *(char **)pcVar11;
          }
          iVar6 = atoi(pcVar11);
          local_f8 = CONCAT44(local_f8._4_4_,iVar6);
        }
        puVar2 = (undefined8 *)param_1[1];
        if ((&local_f8 < puVar2) && (puVar3 = (undefined8 *)*param_1, puVar3 <= &local_f8)) {
          if (puVar2 == (undefined8 *)param_1[2]) {
            FUN_1400892a0(param_1);
          }
          local_140 = (undefined4 *)param_1[1];
          local_110 = local_140;
          if (local_140 != (undefined4 *)0x0) {
            FUN_140089ba0(local_140,
                          (((longlong)local_f0 + (-8 - (longlong)puVar3)) / 0x58) * 0x58 + *param_1)
            ;
          }
        }
        else {
          if (puVar2 == (undefined8 *)param_1[2]) {
            FUN_1400892a0();
          }
          puVar4 = (undefined4 *)param_1[1];
          local_140 = puVar4;
          local_110 = puVar4;
          if (puVar4 != (undefined4 *)0x0) {
            *puVar4 = (undefined4)local_f8;
            puVar4[1] = local_f8._4_4_;
            *(undefined8 *)(puVar4 + 8) = 7;
            *(undefined8 *)(puVar4 + 6) = 0;
            *(undefined2 *)(puVar4 + 2) = 0;
            FUN_140001700(puVar4 + 2,local_f0,0,0xffffffffffffffff);
            *(undefined8 *)(puVar4 + 0x12) = 7;
            *(undefined8 *)(puVar4 + 0x10) = 0;
            *(undefined2 *)(puVar4 + 0xc) = 0;
            FUN_140001700(puVar4 + 0xc,local_c8,0);
          }
        }
        param_1[1] = param_1[1] + 0x58;
        if ((void *)0x7 < local_b0) {
          operator_delete(local_c8[0]);
        }
        local_b0 = (void *)0x7;
        local_b8 = (void *)0x0;
        local_c8[0] = (void *)((ulonglong)local_c8[0] & 0xffffffffffff0000);
        if ((void *)0x7 < local_d8) {
          operator_delete(local_f0[0]);
        }
        uVar17 = uVar17 - 1;
        lVar14 = lVar15;
      } while (uVar17 != 0);
    }
    pcVar12 = local_128;
    pcVar11 = local_130;
    FUN_140025c80(L"ServerInfo %s : %d \n",local_108,(longlong)(param_1[1] - *param_1) / 0x58);
    operator_delete__(local_138);
    pcVar13 = pcVar11;
    if (pcVar11 != (char *)0x0) {
      for (; pcVar13 != pcVar12; pcVar13 = pcVar13 + 0x28) {
        if (0xf < *(ulonglong *)(pcVar13 + 0x18)) {
          operator_delete(*(void **)pcVar13);
        }
        pcVar13[0x18] = '\x0f';
        pcVar13[0x19] = '\0';
        pcVar13[0x1a] = '\0';
        pcVar13[0x1b] = '\0';
        pcVar13[0x1c] = '\0';
        pcVar13[0x1d] = '\0';
        pcVar13[0x1e] = '\0';
        pcVar13[0x1f] = '\0';
        pcVar13[0x10] = '\0';
        pcVar13[0x11] = '\0';
        pcVar13[0x12] = '\0';
        pcVar13[0x13] = '\0';
        pcVar13[0x14] = '\0';
        pcVar13[0x15] = '\0';
        pcVar13[0x16] = '\0';
        pcVar13[0x17] = '\0';
        *pcVar13 = '\0';
      }
      operator_delete(pcVar11);
    }
    local_160 = MagiFileStream::vftable;
    cVar5 = FUN_140096240(&local_160);
    if (cVar5 != '\0') {
      fclose(local_148);
    }
    uVar7 = 1;
  }
  return uVar7;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined2 * FUN_140087f60(undefined2 *param_1,LPCWSTR param_2)

{
  char cVar1;
  WCHAR WVar2;
  short sVar3;
  char *pcVar4;
  short *psVar5;
  longlong lVar6;
  ulonglong uVar7;
  wchar_t *pwVar8;
  LPCWSTR pWVar9;
  char *pcVar10;
  short *psVar11;
  undefined4 uVar12;
  undefined1 auStackY_1d8 [32];
  undefined1 local_188;
  undefined7 uStack_187;
  undefined8 local_178;
  ulonglong local_170;
  undefined2 local_160;
  undefined6 uStack_15e;
  undefined8 local_150;
  ulonglong local_148;
  CHAR local_138;
  undefined1 local_137 [271];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStackY_1d8;
  if (param_2 == (LPCWSTR)0x0) {
    *(undefined8 *)(param_1 + 0xc) = 7;
    *(undefined8 *)(param_1 + 8) = 0;
    *param_1 = 0;
    uVar12 = 10;
    pwVar8 = L"Invalid-IP";
  }
  else {
    local_138 = '\0';
    memset(local_137,0,0x103);
    lVar6 = -1;
    pWVar9 = param_2;
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      WVar2 = *pWVar9;
      pWVar9 = pWVar9 + 1;
    } while (WVar2 != L'\0');
    WideCharToMultiByte(0,0,param_2,~(uint)lVar6,&local_138,0x104,(LPCSTR)0x0,(LPBOOL)0x0);
    lVar6 = Ordinal_52(&local_138);
    if (lVar6 != 0) {
      FUN_1400839c0(lVar6);
      pcVar4 = (char *)Ordinal_12();
      local_170 = 0xf;
      local_178 = 0;
      local_188 = 0;
      uVar7 = 0xffffffffffffffff;
      pcVar10 = pcVar4;
      do {
        if (uVar7 == 0) break;
        uVar7 = uVar7 - 1;
        cVar1 = *pcVar10;
        pcVar10 = pcVar10 + 1;
      } while (cVar1 != '\0');
      FUN_140003e60(&local_188,pcVar4,~uVar7 - 1);
      psVar5 = (short *)FUN_1401e1d60(&local_160,&local_188);
      if (7 < *(ulonglong *)(psVar5 + 0xc)) {
        psVar5 = *(short **)psVar5;
      }
      *(undefined8 *)(param_1 + 0xc) = 7;
      *(undefined8 *)(param_1 + 8) = 0;
      *param_1 = 0;
      uVar7 = 0xffffffffffffffff;
      psVar11 = psVar5;
      do {
        if (uVar7 == 0) break;
        uVar7 = uVar7 - 1;
        sVar3 = *psVar11;
        psVar11 = psVar11 + 1;
      } while (sVar3 != 0);
      FUN_140001b00(param_1,psVar5,~uVar7 - 1);
      if (7 < local_148) {
        operator_delete((void *)CONCAT62(uStack_15e,local_160));
      }
      local_148 = 7;
      local_150 = 0;
      local_160 = 0;
      if (local_170 < 0x10) {
        return param_1;
      }
      operator_delete((void *)CONCAT71(uStack_187,local_188));
      return param_1;
    }
    *(undefined8 *)(param_1 + 0xc) = 7;
    *(undefined8 *)(param_1 + 8) = 0;
    *param_1 = 0;
    uVar12 = 7;
    pwVar8 = L"None-IP";
  }
  FUN_140001b00(param_1,pwVar8,uVar12);
  return param_1;
}



undefined8 FUN_140088160(undefined8 param_1)

{
  char cVar1;
  longlong lVar2;
  undefined8 *puVar3;
  longlong *plVar4;
  char *pcVar5;
  char *pcVar6;
  bool bVar7;
  undefined **local_98 [5];
  longlong *local_70;
  undefined8 *local_60;
  void *local_58;
  undefined8 *local_38;
  void *local_30;
  undefined8 local_18;
  
  local_18 = 0xfffffffffffffffe;
  puVar3 = &DAT_140312e30;
  if (0xf < DAT_140312e48) {
    puVar3 = DAT_140312e30;
  }
  FUN_1400275d0(local_98,puVar3);
  DAT_1403100dc = 0;
  cVar1 = FUN_1400276a0(local_98,local_60 + 2);
  plVar4 = local_70;
  if (cVar1 == '\0') {
    printf("%s Error Agent Parse !!! \n");
    local_98[0] = TiXmlDocument::vftable;
    if (local_38 != &DAT_14031fee8) {
      operator_delete__(local_30);
    }
    local_98[0] = TiXmlNode::vftable;
    while (local_70 != (longlong *)0x0) {
      plVar4 = (longlong *)local_70[10];
      (**(code **)*local_70)(local_70,1);
      local_70 = plVar4;
    }
    if (local_60 != &DAT_14031fee8) {
      operator_delete__(local_58);
    }
    return 0;
  }
  for (; plVar4 != (longlong *)0x0; plVar4 = (longlong *)plVar4[10]) {
    bVar7 = (char *)(plVar4[7] + 0x10) == (char *)0x0;
    lVar2 = 7;
    pcVar5 = (char *)(plVar4[7] + 0x10);
    pcVar6 = "server";
    do {
      if (lVar2 == 0) break;
      lVar2 = lVar2 + -1;
      bVar7 = *pcVar5 == *pcVar6;
      pcVar5 = pcVar5 + 1;
      pcVar6 = pcVar6 + 1;
    } while (bVar7);
    if (bVar7) goto LAB_1400882a3;
  }
LAB_1400882f5:
  local_98[0] = TiXmlDocument::vftable;
  if (local_38 != &DAT_14031fee8) {
    operator_delete__(local_30);
  }
  local_98[0] = TiXmlNode::vftable;
  while (local_70 != (longlong *)0x0) {
    plVar4 = (longlong *)local_70[10];
    (**(code **)*local_70)(local_70,1);
    local_70 = plVar4;
  }
  if (local_60 != &DAT_14031fee8) {
    operator_delete__(local_58);
  }
  return 1;
LAB_1400882a3:
  while (lVar2 = (**(code **)(*plVar4 + 0x30))(plVar4), lVar2 == 0) {
    do {
      plVar4 = (longlong *)plVar4[10];
      if (plVar4 == (longlong *)0x0) goto LAB_1400882f5;
      bVar7 = (char *)(plVar4[7] + 0x10) == (char *)0x0;
      lVar2 = 7;
      pcVar5 = (char *)(plVar4[7] + 0x10);
      pcVar6 = "server";
      do {
        if (lVar2 == 0) break;
        lVar2 = lVar2 + -1;
        bVar7 = *pcVar5 == *pcVar6;
        pcVar5 = pcVar5 + 1;
        pcVar6 = pcVar6 + 1;
      } while (bVar7);
    } while (!bVar7);
  }
  lVar2 = (**(code **)(*plVar4 + 0x30))(plVar4);
  if (lVar2 != 0) {
    FUN_140087290(param_1,lVar2,0xd);
  }
  goto LAB_1400882f5;
}



void thunk_FUN_140088e70(void)

{
  FUN_140088e70();
  return;
}



void FUN_1400883a0(ulonglong *param_1,ulonglong param_2)

{
  ulonglong uVar1;
  ulonglong uVar2;
  
  uVar1 = param_1[1];
  if ((param_2 < uVar1) && (uVar2 = *param_1, uVar2 <= param_2)) {
    if (uVar1 == param_1[2]) {
      FUN_140088de0(param_1);
    }
    FUN_140089640(param_1[1],(param_2 - uVar2 & 0xffffffffffffffc0) + *param_1);
    param_1[1] = param_1[1] + 0x40;
    return;
  }
  if (uVar1 == param_1[2]) {
    FUN_140088de0(param_1);
  }
  FUN_140089b20(param_1[1],param_2);
  param_1[1] = param_1[1] + 0x40;
  return;
}



basic_ostream<> * FUN_140088420(basic_ostream<> *param_1)

{
  *(undefined **)param_1 = &DAT_140283e20;
  std::basic_ios<>::basic_ios<>((basic_ios<> *)(param_1 + 0x88));
  std::basic_ostream<>::basic_ostream<>(param_1,(basic_streambuf<> *)(param_1 + 8),false);
  *(undefined ***)(param_1 + *(int *)(*(longlong *)param_1 + 4)) =
       std::basic_ostringstream<>::vftable;
  std::basic_streambuf<>::basic_streambuf<>((basic_streambuf<> *)(param_1 + 8));
  *(undefined ***)(param_1 + 8) = std::basic_stringbuf<>::vftable;
  *(undefined8 *)(param_1 + 0x78) = 0;
  *(undefined4 *)(param_1 + 0x80) = 4;
  return param_1;
}



undefined8 FUN_1400884c0(longlong param_1,undefined8 param_2)

{
  FUN_140088f00(param_1 + 8);
  return param_2;
}



void FUN_1400884f0(basic_streambuf<> *param_1)

{
  *(undefined ***)param_1 = std::basic_stringbuf<>::vftable;
  if (((byte)param_1[0x78] & 1) != 0) {
    operator_delete((void *)**(undefined8 **)(param_1 + 0x20));
  }
  **(undefined8 **)(param_1 + 0x20) = 0;
  **(undefined8 **)(param_1 + 0x40) = 0;
  **(undefined4 **)(param_1 + 0x58) = 0;
  **(undefined8 **)(param_1 + 0x28) = 0;
  **(undefined8 **)(param_1 + 0x48) = 0;
  **(undefined4 **)(param_1 + 0x60) = 0;
  *(uint *)(param_1 + 0x78) = *(uint *)(param_1 + 0x78) & 0xfffffffe;
  *(undefined8 *)(param_1 + 0x70) = 0;
                    // WARNING: Could not recover jumptable at 0x000140088550. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_streambuf<>::~basic_streambuf<>(param_1);
  return;
}



int FUN_140088560(basic_streambuf<> *param_1,int param_2)

{
  basic_streambuf<> bVar1;
  void *_Src;
  undefined8 uVar2;
  char *pcVar3;
  void *_Dst;
  ulonglong uVar4;
  longlong lVar5;
  int iVar6;
  ulonglong uVar7;
  int iVar8;
  
  if (((byte)param_1[0x78] & 8) != 0) {
    uVar7 = **(ulonglong **)(param_1 + 0x48);
    if ((uVar7 != 0) && (uVar4 = *(ulonglong *)(param_1 + 0x70), uVar7 < uVar4)) {
      iVar6 = **(int **)(param_1 + 0x60);
      **(ulonglong **)(param_1 + 0x48) = uVar4;
      **(int **)(param_1 + 0x60) = (iVar6 + (int)uVar7) - (int)uVar4;
    }
  }
  if (param_2 == -1) {
    return 0;
  }
  uVar7 = **(ulonglong **)(param_1 + 0x48);
  if ((uVar7 != 0) && (uVar7 < (longlong)**(int **)(param_1 + 0x60) + uVar7)) {
    pcVar3 = std::basic_streambuf<>::_Pninc(param_1);
    *pcVar3 = (char)param_2;
    return param_2;
  }
  if (((byte)param_1[0x78] & 2) != 0) {
    return -1;
  }
  if (uVar7 == 0) {
    uVar7 = 0;
  }
  else {
    uVar7 = ((longlong)**(int **)(param_1 + 0x60) - **(longlong **)(param_1 + 0x20)) + uVar7;
  }
  uVar4 = uVar7 >> 1;
  if (uVar4 < 0x20) {
    uVar4 = 0x20;
  }
  else if (uVar4 == 0) {
    return -1;
  }
  do {
    if (uVar7 <= 0x7fffffff - uVar4) break;
    uVar4 = uVar4 >> 1;
  } while (uVar4 != 0);
  if (uVar4 != 0) {
    _Dst = (void *)FUN_1400043b0(uVar4 + uVar7);
    _Src = (void *)**(undefined8 **)(param_1 + 0x20);
    iVar8 = (int)(uVar4 + uVar7);
    iVar6 = (int)_Dst;
    if ((uVar7 == 0) || (memcpy(_Dst,_Src,uVar7), uVar7 == 0)) {
      *(void **)(param_1 + 0x70) = _Dst;
      **(undefined8 **)(param_1 + 0x28) = _Dst;
      **(undefined8 **)(param_1 + 0x48) = _Dst;
      **(int **)(param_1 + 0x60) = iVar8;
      bVar1 = param_1[0x78];
      **(undefined8 **)(param_1 + 0x20) = _Dst;
      if (((byte)bVar1 & 4) == 0) {
        **(undefined8 **)(param_1 + 0x40) = _Dst;
        **(undefined4 **)(param_1 + 0x58) = 1;
      }
      else {
        **(undefined8 **)(param_1 + 0x40) = 0;
        **(int **)(param_1 + 0x58) = iVar6;
      }
    }
    else {
      *(longlong *)(param_1 + 0x70) =
           (longlong)_Dst + (*(longlong *)(param_1 + 0x70) - (longlong)_Src);
      lVar5 = **(longlong **)(param_1 + 0x48);
      **(longlong **)(param_1 + 0x28) =
           (longlong)_Dst + (**(longlong **)(param_1 + 0x28) - (longlong)_Src);
      lVar5 = (lVar5 - (longlong)_Src) + (longlong)_Dst;
      **(longlong **)(param_1 + 0x48) = lVar5;
      **(int **)(param_1 + 0x60) = (iVar6 - (int)lVar5) + iVar8;
      if (((byte)param_1[0x78] & 4) == 0) {
        uVar2 = **(undefined8 **)(param_1 + 0x48);
        lVar5 = **(longlong **)(param_1 + 0x40);
        **(undefined8 **)(param_1 + 0x20) = _Dst;
        lVar5 = (lVar5 - (longlong)_Src) + (longlong)_Dst;
        **(longlong **)(param_1 + 0x40) = lVar5;
        **(int **)(param_1 + 0x58) = ((int)uVar2 - (int)lVar5) + 1;
      }
      else {
        **(undefined8 **)(param_1 + 0x20) = _Dst;
        **(undefined8 **)(param_1 + 0x40) = 0;
        **(int **)(param_1 + 0x58) = iVar6;
      }
    }
    if (((byte)param_1[0x78] & 1) != 0) {
      operator_delete(_Src);
    }
    *(uint *)(param_1 + 0x78) = *(uint *)(param_1 + 0x78) | 1;
    pcVar3 = std::basic_streambuf<>::_Pninc(param_1);
    *pcVar3 = (char)param_2;
    return param_2;
  }
  return -1;
}



int FUN_1400887a0(longlong param_1,int param_2)

{
  ulonglong uVar1;
  
  uVar1 = **(ulonglong **)(param_1 + 0x40);
  if (((uVar1 != 0) && (**(ulonglong **)(param_1 + 0x20) < uVar1)) &&
     ((param_2 == -1 ||
      (((char)param_2 == *(char *)(uVar1 - 1) || ((*(byte *)(param_1 + 0x78) & 2) == 0)))))) {
    **(int **)(param_1 + 0x58) = **(int **)(param_1 + 0x58) + 1;
    **(longlong **)(param_1 + 0x40) = **(longlong **)(param_1 + 0x40) + -1;
    if (param_2 != -1) {
      *(char *)**(undefined8 **)(param_1 + 0x40) = (char)param_2;
      return param_2;
    }
    return 0;
  }
  return -1;
}



ulonglong FUN_1400887f0(longlong param_1)

{
  byte *pbVar1;
  byte *pbVar2;
  
  pbVar1 = *(byte **)*(int **)(param_1 + 0x40);
  if (pbVar1 != (byte *)0x0) {
    if (pbVar1 < pbVar1 + **(int **)(param_1 + 0x58)) {
      return (ulonglong)*pbVar1;
    }
    if ((((*(byte *)(param_1 + 0x78) & 4) == 0) &&
        (pbVar2 = (byte *)**(undefined8 **)(param_1 + 0x48), pbVar2 != (byte *)0x0)) &&
       ((pbVar1 < pbVar2 || (pbVar1 < *(byte **)(param_1 + 0x70))))) {
      if (*(byte **)(param_1 + 0x70) < pbVar2) {
        *(byte **)(param_1 + 0x70) = pbVar2;
      }
      **(int **)(param_1 + 0x58) = (int)*(undefined8 *)(param_1 + 0x70) - **(int **)(param_1 + 0x40)
      ;
      return (ulonglong)*(byte *)**(undefined8 **)(param_1 + 0x40);
    }
  }
  return 0xffffffff;
}



longlong *
FUN_140088860(longlong param_1,longlong *param_2,longlong param_3,int param_4,uint param_5)

{
  ulonglong uVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  
  uVar1 = **(ulonglong **)(param_1 + 0x48);
  if ((uVar1 != 0) && (*(ulonglong *)(param_1 + 0x70) < uVar1)) {
    *(ulonglong *)(param_1 + 0x70) = uVar1;
  }
  if (((param_5 & 1) == 0) || (lVar2 = **(longlong **)(param_1 + 0x40), lVar2 == 0)) {
    if (((param_5 & 2) == 0) || (uVar1 = **(ulonglong **)(param_1 + 0x48), uVar1 == 0)) {
      if (param_3 != 0) {
        param_3 = *(longlong *)_BADOFF_exref;
      }
      goto LAB_1400889de;
    }
    if (param_4 == 2) {
      param_3 = param_3 + (*(longlong *)(param_1 + 0x70) - **(longlong **)(param_1 + 0x20));
    }
    else if (param_4 == 1) {
      param_3 = param_3 + (uVar1 - **(longlong **)(param_1 + 0x20));
    }
    else if (param_4 != 0) {
      param_3 = *(longlong *)_BADOFF_exref;
    }
    if ((-1 < param_3) &&
       (param_3 <= *(longlong *)(param_1 + 0x70) - **(longlong **)(param_1 + 0x20))) {
      iVar4 = ((int)**(longlong **)(param_1 + 0x20) - (int)uVar1) + (int)param_3;
      **(int **)(param_1 + 0x60) = **(int **)(param_1 + 0x60) - iVar4;
      **(longlong **)(param_1 + 0x48) = **(longlong **)(param_1 + 0x48) + (longlong)iVar4;
      goto LAB_1400889de;
    }
  }
  else {
    if (param_4 == 2) {
      param_3 = param_3 + (*(longlong *)(param_1 + 0x70) - **(longlong **)(param_1 + 0x20));
    }
    else if (param_4 == 1) {
      if ((param_5 & 2) == 0) {
        param_3 = param_3 + (lVar2 - **(longlong **)(param_1 + 0x20));
      }
      else {
LAB_1400888e0:
        param_3 = *(longlong *)_BADOFF_exref;
      }
    }
    else if (param_4 != 0) goto LAB_1400888e0;
    if ((-1 < param_3) &&
       (param_3 <= *(longlong *)(param_1 + 0x70) - **(longlong **)(param_1 + 0x20))) {
      iVar4 = ((int)**(longlong **)(param_1 + 0x20) - (int)lVar2) + (int)param_3;
      **(int **)(param_1 + 0x58) = **(int **)(param_1 + 0x58) - iVar4;
      **(longlong **)(param_1 + 0x40) = **(longlong **)(param_1 + 0x40) + (longlong)iVar4;
      if ((param_5 & 2) != 0) {
        lVar2 = **(longlong **)(param_1 + 0x48);
        if (lVar2 != 0) {
          iVar4 = **(int **)(param_1 + 0x60);
          lVar3 = **(longlong **)(param_1 + 0x40);
          **(longlong **)(param_1 + 0x48) = lVar3;
          **(int **)(param_1 + 0x60) = (iVar4 + (int)lVar2) - (int)lVar3;
        }
      }
      goto LAB_1400889de;
    }
  }
  param_3 = *(longlong *)_BADOFF_exref;
LAB_1400889de:
  *param_2 = param_3;
  param_2[1] = 0;
  *(undefined4 *)(param_2 + 2) = 0;
  return param_2;
}



longlong * FUN_140088a00(longlong param_1,longlong *param_2,longlong *param_3,uint param_4)

{
  ulonglong uVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  
  lVar4 = (longlong)(int)param_3[1] + *param_3;
  uVar1 = **(ulonglong **)(param_1 + 0x48);
  if ((uVar1 != 0) && (*(ulonglong *)(param_1 + 0x70) < uVar1)) {
    *(ulonglong *)(param_1 + 0x70) = uVar1;
  }
  lVar2 = *(longlong *)_BADOFF_exref;
  lVar5 = lVar4;
  if (lVar4 != lVar2) {
    lVar5 = lVar2;
    if (((param_4 & 1) == 0) || (**(longlong **)(param_1 + 0x40) == 0)) {
      if (((param_4 & 2) != 0) &&
         (((uVar1 = **(ulonglong **)(param_1 + 0x48), uVar1 != 0 && (-1 < lVar4)) &&
          (lVar4 <= *(longlong *)(param_1 + 0x70) - **(longlong **)(param_1 + 0x20))))) {
        iVar3 = ((int)**(longlong **)(param_1 + 0x20) - (int)uVar1) + (int)lVar4;
        **(int **)(param_1 + 0x60) = **(int **)(param_1 + 0x60) - iVar3;
        **(longlong **)(param_1 + 0x48) = **(longlong **)(param_1 + 0x48) + (longlong)iVar3;
        lVar5 = lVar4;
      }
    }
    else if ((-1 < lVar4) &&
            (lVar4 <= *(longlong *)(param_1 + 0x70) - **(longlong **)(param_1 + 0x20))) {
      iVar3 = ((int)**(longlong **)(param_1 + 0x20) - (int)**(longlong **)(param_1 + 0x40)) +
              (int)lVar4;
      **(int **)(param_1 + 0x58) = **(int **)(param_1 + 0x58) - iVar3;
      **(longlong **)(param_1 + 0x40) = **(longlong **)(param_1 + 0x40) + (longlong)iVar3;
      lVar5 = lVar4;
      if ((param_4 & 2) != 0) {
        lVar2 = **(longlong **)(param_1 + 0x48);
        if (lVar2 != 0) {
          iVar3 = **(int **)(param_1 + 0x60);
          lVar5 = **(longlong **)(param_1 + 0x40);
          **(longlong **)(param_1 + 0x48) = lVar5;
          **(int **)(param_1 + 0x60) = (iVar3 + (int)lVar2) - (int)lVar5;
          lVar5 = lVar4;
        }
      }
    }
  }
  *param_2 = lVar5;
  param_2[1] = 0;
  *(undefined4 *)(param_2 + 2) = 0;
  return param_2;
}



longlong * FUN_140088b10(longlong *param_1,longlong *param_2)

{
  ulonglong uVar1;
  ulonglong uVar2;
  char cVar3;
  undefined8 uVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  
  if (param_1 == param_2) {
    return param_1;
  }
  lVar5 = *param_2;
  uVar1 = (param_2[1] - lVar5) / 0x58;
  if (uVar1 != 0) {
    lVar6 = *param_1;
    uVar2 = (param_1[1] - lVar6) / 0x58;
    if (uVar2 < uVar1) {
      if ((ulonglong)((param_1[2] - lVar6) / 0x58) < uVar1) {
        if (lVar6 != 0) {
          FUN_14000bf70(lVar6,param_1[1]);
          operator_delete((void *)*param_1);
        }
        cVar3 = FUN_140089230(param_1,(param_2[1] - *param_2) / 0x58);
        if (cVar3 == '\0') {
          return param_1;
        }
        lVar5 = *param_1;
        lVar6 = param_2[1];
        lVar7 = *param_2;
      }
      else {
        lVar7 = uVar2 * 0x58 + lVar5;
        FUN_1400896c0(lVar5,lVar7,lVar6);
        lVar5 = param_1[1];
        lVar6 = param_2[1];
      }
      lVar5 = FUN_140089dc0(lVar7,lVar6,lVar5);
      param_1[1] = lVar5;
    }
    else {
      uVar4 = FUN_1400896c0(lVar5,param_2[1],lVar6);
      FUN_14000bf70(uVar4,param_1[1]);
      param_1[1] = ((param_2[1] - *param_2) / 0x58) * 0x58 + *param_1;
    }
    return param_1;
  }
  FUN_140089190(param_1);
  return param_1;
}



void FUN_140088cb0(ulonglong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  uVar1 = param_1[1];
  if ((param_2 < uVar1) && (uVar2 = *param_1, uVar2 <= param_2)) {
    if (uVar1 == param_1[2]) {
      FUN_1400892a0(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140089ba0(param_1[1],((longlong)(param_2 - uVar2) / 0x58) * 0x58 + *param_1,param_3,
                    param_4,uVar3);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_1400892a0(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140089ba0(param_1[1],param_2,param_3,param_4,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0x58;
  return;
}



void * FUN_140088d70(longlong param_1,uint param_2)

{
  void *pvVar1;
  
  pvVar1 = (void *)(param_1 + -0x88);
  FUN_1400852d0(pvVar1);
  if ((param_2 & 1) != 0) {
    operator_delete(pvVar1);
  }
  return pvVar1;
}



void * FUN_140088db0(void *param_1,uint param_2)

{
  FUN_1400884f0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140088de0(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = param_1[1] - *param_1 >> 6;
  if (0x3fffffffffffffe < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = param_1[2] - *param_1 >> 6;
  if (uVar2 < uVar3) {
    if (0x3ffffffffffffff - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_140089360(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140089360(param_1,uVar2);
  }
  return;
}



void FUN_140088e70(undefined8 *param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  puVar2 = (undefined8 *)*param_1;
  if (puVar2 != (undefined8 *)0x0) {
    puVar1 = (undefined8 *)param_1[1];
    for (; puVar2 != puVar1; puVar2 = puVar2 + 8) {
      if (7 < (ulonglong)puVar2[3]) {
        operator_delete((void *)*puVar2);
      }
      puVar2[3] = 7;
      puVar2[2] = 0;
      *(undefined2 *)puVar2 = 0;
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void ** FUN_140088f00(longlong param_1,void **param_2)

{
  ulonglong uVar1;
  ulonglong uVar2;
  undefined1 auStack_68 [32];
  undefined4 local_48;
  undefined8 local_40;
  void *local_38 [2];
  void *local_28;
  void *local_20;
  ulonglong local_10;
  
  local_40 = 0xfffffffffffffffe;
  local_10 = DAT_1402f85a0 ^ (ulonglong)auStack_68;
  local_48 = 0;
  if (((*(uint *)(param_1 + 0x78) & 2) == 0) && (**(ulonglong **)(param_1 + 0x48) != 0)) {
    uVar1 = **(ulonglong **)(param_1 + 0x48);
    uVar2 = *(ulonglong *)(param_1 + 0x70);
    if (*(ulonglong *)(param_1 + 0x70) < uVar1) {
      uVar2 = uVar1;
    }
    local_20 = (void *)0xf;
    local_28 = (void *)0x0;
    local_38[0] = (void *)((ulonglong)local_38[0]._1_7_ << 8);
    FUN_140003e60(local_38,**(longlong **)(param_1 + 0x28),uVar2 - **(longlong **)(param_1 + 0x28));
    param_2[3] = (void *)0xf;
    param_2[2] = (void *)0x0;
    *(undefined1 *)param_2 = 0;
    if (param_2 != local_38) {
      if ((void *)0xf < param_2[3]) {
        operator_delete(*param_2);
      }
      param_2[3] = (void *)0xf;
      param_2[2] = (void *)0x0;
      *(undefined1 *)param_2 = 0;
      if (local_20 < (void *)0x10) {
        memmove(param_2,local_38,(longlong)local_28 + 1);
      }
      else {
        *param_2 = local_38[0];
        local_38[0] = (void *)0x0;
      }
      param_2[2] = local_28;
      param_2[3] = local_20;
      local_28 = (void *)0x0;
      local_20 = (void *)0x0;
    }
  }
  else if (((*(uint *)(param_1 + 0x78) & 4) == 0) && (**(longlong **)(param_1 + 0x40) != 0)) {
    local_20 = (void *)0xf;
    local_28 = (void *)0x0;
    local_38[0] = (void *)((ulonglong)local_38[0]._1_7_ << 8);
    FUN_140003e60(local_38,**(longlong **)(param_1 + 0x20),
                  ((longlong)**(int **)(param_1 + 0x58) + **(longlong **)(param_1 + 0x40)) -
                  **(longlong **)(param_1 + 0x20));
    param_2[3] = (void *)0xf;
    param_2[2] = (void *)0x0;
    *(undefined1 *)param_2 = 0;
    if (param_2 != local_38) {
      if ((void *)0xf < param_2[3]) {
        operator_delete(*param_2);
      }
      param_2[3] = (void *)0xf;
      param_2[2] = (void *)0x0;
      *(undefined1 *)param_2 = 0;
      if (local_20 < (void *)0x10) {
        memmove(param_2,local_38,(longlong)local_28 + 1);
      }
      else {
        *param_2 = local_38[0];
        local_38[0] = (void *)0x0;
      }
      param_2[2] = local_28;
      param_2[3] = local_20;
      local_28 = (void *)0x0;
      local_20 = (void *)0x0;
    }
  }
  else {
    local_20 = (void *)0xf;
    local_28 = (void *)0x0;
    local_38[0] = (void *)((ulonglong)local_38[0]._1_7_ << 8);
    param_2[3] = (void *)0xf;
    param_2[2] = (void *)0x0;
    *(undefined1 *)param_2 = 0;
    if (param_2 != local_38) {
      if ((void *)0xf < param_2[3]) {
        operator_delete(*param_2);
      }
      param_2[3] = (void *)0xf;
      param_2[2] = (void *)0x0;
      *(undefined1 *)param_2 = 0;
      if (local_20 < (void *)0x10) {
        memmove(param_2,local_38,(longlong)local_28 + 1);
      }
      else {
        *param_2 = local_38[0];
        local_38[0] = (void *)0x0;
      }
      param_2[2] = local_28;
      param_2[3] = local_20;
      local_28 = (void *)0x0;
      local_20 = (void *)0x0;
    }
  }
  if ((void *)0xf < local_20) {
    operator_delete(local_38[0]);
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x0001400891b3)
// WARNING: Removing unreachable block (ram,0x0001400891c0)
// WARNING: Removing unreachable block (ram,0x000140089203)

void FUN_140089190(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  if (lVar1 != param_1[1]) {
    FUN_14000bf70(lVar1,param_1[1]);
    param_1[1] = lVar1;
  }
  return;
}



undefined8 FUN_140089230(longlong *param_1,ulonglong param_2)

{
  code *pcVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  uVar2 = 0;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  if (param_2 != 0) {
    if (0x2e8ba2e8ba2e8ba < param_2) {
      std::_Xlength_error("vector<T> too long");
      pcVar1 = (code *)swi(3);
      uVar2 = (*pcVar1)();
      return uVar2;
    }
    lVar3 = FUN_1400895d0(param_2);
    *param_1 = lVar3;
    param_1[1] = lVar3;
    uVar2 = 1;
    param_1[2] = param_2 * 0x58 + lVar3;
  }
  return uVar2;
}



void FUN_1400892a0(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x58;
  if (0x2e8ba2e8ba2e8b9 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = (param_1[2] - *param_1) / 0x58;
  if (uVar2 < uVar3) {
    if (0x2e8ba2e8ba2e8ba - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_1400894d0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1400894d0(param_1,uVar2);
  }
  return;
}



void FUN_140089360(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x3ffffffffffffff < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)(param_1[2] - *param_1 >> 6) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 << 6);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_140089e20(*param_1,param_1[1],local_res10,param_4,uVar5);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_140089470();
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x40);
    param_1[1] = (longlong)(pcVar4 + (lVar1 - lVar2 & 0xffffffffffffffc0));
    *param_1 = (longlong)pcVar4;
  }
  return;
}



void FUN_140089470(undefined8 *param_1,undefined8 *param_2)

{
  for (; param_1 != param_2; param_1 = param_1 + 8) {
    if (7 < (ulonglong)param_1[3]) {
      operator_delete((void *)*param_1);
    }
    param_1[3] = 7;
    param_1[2] = 0;
    *(undefined2 *)param_1 = 0;
  }
  return;
}



void FUN_1400894d0(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  longlong lVar2;
  code *pcVar3;
  longlong lVar4;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  if (0x2e8ba2e8ba2e8ba < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x58) < param_2) {
    lVar4 = FUN_1400895d0(param_2);
    FUN_140089dc0(*param_1,param_1[1],lVar4);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_14000bf70(lVar2,lVar1,lVar1 - lVar2,lVar1,uVar5);
      operator_delete((void *)*param_1);
    }
    param_1[2] = param_2 * 0x58 + lVar4;
    param_1[1] = ((lVar1 - lVar2) / 0x58) * 0x58 + lVar4;
    *param_1 = lVar4;
  }
  return;
}



void * FUN_1400895d0(ulonglong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  if (param_1 == 0) {
    return (void *)0x0;
  }
  if ((param_1 < 0x2e8ba2e8ba2e8bb) &&
     (pvVar1 = operator_new(param_1 * 0x58), pvVar1 != (void *)0x0)) {
    return pvVar1;
  }
  local_res8[0] = (char *)0x0;
  std::exception::exception((exception *)local_28,local_res8);
  local_28[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_28,(ThrowInfo *)&DAT_1402f47a8);
}



void FUN_140089640(undefined2 *param_1,longlong param_2)

{
  if (param_1 != (undefined2 *)0x0) {
    *(undefined8 *)(param_1 + 0xc) = 7;
    *(undefined8 *)(param_1 + 8) = 0;
    *param_1 = 0;
    FUN_140001700(param_1,param_2,0,0xffffffffffffffff,0xfffffffffffffffe);
    *(undefined4 *)(param_1 + 0x14) = *(undefined4 *)(param_2 + 0x28);
    *(undefined4 *)(param_1 + 0x16) = *(undefined4 *)(param_2 + 0x2c);
    *(undefined4 *)(param_1 + 0x18) = *(undefined4 *)(param_2 + 0x30);
    *(undefined4 *)(param_1 + 0x1a) = *(undefined4 *)(param_2 + 0x34);
    *(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)(param_2 + 0x38);
    *(undefined4 *)(param_1 + 0x1e) = *(undefined4 *)(param_2 + 0x3c);
  }
  return;
}



undefined4 * FUN_1400896c0(longlong param_1,longlong param_2,undefined4 *param_3)

{
  if (param_1 != param_2) {
    param_1 = param_1 - (longlong)param_3;
    do {
      *param_3 = *(undefined4 *)(param_1 + (longlong)param_3);
      param_3[1] = *(undefined4 *)(param_1 + 4 + (longlong)param_3);
      FUN_140001700(param_3 + 2,param_1 + 8 + (longlong)param_3,0,0xffffffffffffffff);
      FUN_140001700(param_3 + 0xc,param_1 + 0x30 + (longlong)param_3);
      param_3 = param_3 + 0x16;
    } while (param_1 + (longlong)param_3 != param_2);
  }
  return param_3;
}



void FUN_140089740(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_140089760();
  }
  return;
}



void FUN_140089760(undefined8 *param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  longlong lVar4;
  ulonglong *puVar5;
  longlong lVar6;
  undefined8 *puVar7;
  
  puVar7 = (undefined8 *)*param_1;
  puVar1 = puVar7 + param_1[1];
  for (; puVar7 != puVar1; puVar7 = puVar7 + 1) {
    puVar2 = (undefined8 *)*puVar7;
    *puVar7 = 0;
    while (puVar2 != (undefined8 *)0x0) {
      puVar3 = (undefined8 *)*puVar2;
      lVar6 = puVar2[2];
      if (lVar6 != 0) {
        lVar4 = puVar2[3];
        if (lVar6 != lVar4) {
          puVar5 = (ulonglong *)(lVar6 + 0x48);
          do {
            if (7 < *puVar5) {
              operator_delete((void *)puVar5[-3]);
            }
            *puVar5 = 7;
            puVar5[-1] = 0;
            *(undefined2 *)(puVar5 + -3) = 0;
            if (7 < puVar5[-5]) {
              operator_delete((void *)puVar5[-8]);
            }
            puVar5[-5] = 7;
            puVar5[-6] = 0;
            lVar6 = lVar6 + 0x58;
            *(undefined2 *)(puVar5 + -8) = 0;
            puVar5 = puVar5 + 0xb;
          } while (lVar6 != lVar4);
        }
        operator_delete((void *)puVar2[2]);
      }
      puVar2[2] = 0;
      puVar2[3] = 0;
      puVar2[4] = 0;
      operator_delete(puVar2);
      puVar2 = puVar3;
    }
  }
  operator_delete((void *)*param_1);
  *param_1 = 0;
  return;
}



longlong * FUN_1400898b0(longlong *param_1,longlong *param_2,byte *param_3,undefined1 *param_4)

{
  byte bVar1;
  undefined8 *puVar2;
  char cVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  longlong *local_40;
  undefined8 *local_38;
  undefined2 local_30;
  
  bVar1 = *param_3;
  puVar5 = (undefined8 *)(*param_1 + ((ulonglong)bVar1 % (ulonglong)param_1[1]) * 8);
  puVar2 = (undefined8 *)*puVar5;
  do {
    if (puVar2 == (undefined8 *)0x0) {
LAB_140089915:
      local_38 = (undefined8 *)0x0;
      local_30 = 0;
      local_40 = param_1;
      FUN_14008a090(&local_40);
      puVar2 = local_38;
      if (local_38 + 1 != (undefined8 *)0x0) {
        *(undefined1 *)(local_38 + 1) = *param_4;
        FUN_140089c30(local_38 + 2,param_4 + 8);
      }
      local_30 = CONCAT11(1,(undefined1)local_30);
      cVar3 = FUN_140089cf0(param_1);
      if (cVar3 != '\0') {
        puVar5 = (undefined8 *)(*param_1 + ((ulonglong)bVar1 % (ulonglong)param_1[1]) * 8);
      }
      *puVar2 = *puVar5;
      *puVar5 = puVar2;
      param_1[4] = param_1[4] + 1;
      puVar4 = (undefined8 *)param_1[6];
      if (puVar5 < (undefined8 *)param_1[6]) {
        puVar4 = puVar5;
      }
      param_1[6] = (longlong)puVar4;
      *param_2 = (longlong)puVar5;
      param_2[1] = (longlong)puVar2;
      *(undefined1 *)(param_2 + 2) = 1;
      return param_2;
    }
    if (bVar1 == *(byte *)(puVar2 + 1)) {
      if (puVar2 != (undefined8 *)0x0) {
        *param_2 = (longlong)puVar5;
        param_2[1] = (longlong)puVar2;
        *(undefined1 *)(param_2 + 2) = 0;
        return param_2;
      }
      goto LAB_140089915;
    }
    puVar2 = (undefined8 *)*puVar2;
  } while( true );
}



longlong * FUN_1400899d0(longlong *param_1,longlong *param_2,byte *param_3)

{
  byte *pbVar1;
  byte **ppbVar2;
  undefined8 *puVar3;
  byte bVar4;
  undefined8 *puVar5;
  longlong lVar6;
  byte **ppbVar7;
  byte *local_res8;
  byte *local_res10;
  longlong *local_30;
  undefined8 *local_28;
  undefined2 local_20;
  
  local_28 = (undefined8 *)0x0;
  local_20 = 0;
  local_30 = param_1;
  FUN_14008a090(&local_30);
  puVar5 = local_28;
  pbVar1 = (byte *)(local_28 + 1);
  local_res8 = pbVar1;
  local_res10 = pbVar1;
  if (pbVar1 != (byte *)0x0) {
    *pbVar1 = *param_3;
    FUN_140089c30(local_28 + 2);
  }
  local_20 = CONCAT11(1,(undefined1)local_20);
  bVar4 = *pbVar1;
  if (*param_1 == 0) {
    local_res8 = (byte *)FUN_14001ed50(param_1,1);
    ppbVar2 = (byte **)(param_1 + 1);
    ppbVar7 = &local_res8;
    if (local_res8 <= *ppbVar2) {
      ppbVar7 = ppbVar2;
    }
    *ppbVar2 = *ppbVar7;
    FUN_140097060(param_1);
    FUN_14009b090(param_1);
  }
  else {
    local_res10 = (byte *)0x1;
    if ((ulonglong)param_1[7] < 2) {
      local_res8 = (byte *)(((ulonglong)param_1[4] >> 1) + param_1[4]);
      lVar6 = FUN_14001ed50(param_1);
      if (lVar6 != param_1[1]) {
        FUN_140089ed0(param_1);
      }
    }
  }
  puVar3 = (undefined8 *)(*param_1 + ((ulonglong)bVar4 % (ulonglong)param_1[1]) * 8);
  *puVar5 = *puVar3;
  *puVar3 = puVar5;
  param_1[4] = param_1[4] + 1;
  param_1[6] = (longlong)puVar3;
  *param_2 = (longlong)puVar3;
  param_2[1] = (longlong)puVar5;
  *(undefined1 *)(param_2 + 2) = 1;
  return param_2;
}



void FUN_140089b20(undefined2 *param_1,longlong param_2)

{
  if (param_1 != (undefined2 *)0x0) {
    *(undefined8 *)(param_1 + 0xc) = 7;
    *(undefined8 *)(param_1 + 8) = 0;
    *param_1 = 0;
    FUN_140001700(param_1,param_2,0,0xffffffffffffffff,0xfffffffffffffffe);
    *(undefined4 *)(param_1 + 0x14) = *(undefined4 *)(param_2 + 0x28);
    *(undefined4 *)(param_1 + 0x16) = *(undefined4 *)(param_2 + 0x2c);
    *(undefined4 *)(param_1 + 0x18) = *(undefined4 *)(param_2 + 0x30);
    *(undefined4 *)(param_1 + 0x1a) = *(undefined4 *)(param_2 + 0x34);
    *(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)(param_2 + 0x38);
    *(undefined4 *)(param_1 + 0x1e) = *(undefined4 *)(param_2 + 0x3c);
  }
  return;
}



undefined4 * FUN_140089ba0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  *(undefined8 *)(param_1 + 8) = 7;
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  FUN_140001700(param_1 + 2,param_2 + 2,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined8 *)(param_1 + 0x12) = 7;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined2 *)(param_1 + 0xc) = 0;
  FUN_140001700(param_1 + 0xc,param_2 + 0xc,0,0xffffffffffffffff);
  return param_1;
}



longlong * FUN_140089c30(longlong *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  code *pcVar1;
  ulonglong uVar2;
  longlong *plVar3;
  longlong lVar4;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  uVar2 = (param_2[1] - *param_2) / 0x58;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  if (uVar2 != 0) {
    if (0x2e8ba2e8ba2e8ba < uVar2) {
      std::_Xlength_error("vector<T> too long");
      pcVar1 = (code *)swi(3);
      plVar3 = (longlong *)(*pcVar1)();
      return plVar3;
    }
    lVar4 = FUN_1400895d0(uVar2);
    *param_1 = lVar4;
    param_1[1] = lVar4;
    param_1[2] = uVar2 * 0x58 + lVar4;
    lVar4 = FUN_14008a170(*param_2,param_2[1],lVar4,param_4,uVar5);
    param_1[1] = lVar4;
  }
  return param_1;
}



undefined8 FUN_140089cf0(longlong param_1,ulonglong param_2)

{
  longlong lVar1;
  ulonglong *puVar2;
  ulonglong local_res8;
  ulonglong local_res10 [3];
  
  local_res10[0] = param_2;
  if (*(ulonglong *)(param_1 + 0x38) <= param_2) {
    local_res8 = (*(ulonglong *)(param_1 + 0x20) >> 1) + *(ulonglong *)(param_1 + 0x20);
    puVar2 = &local_res8;
    if (local_res8 <= param_2) {
      puVar2 = local_res10;
    }
    lVar1 = FUN_14001ed50(param_1,*puVar2);
    if (lVar1 != *(longlong *)(param_1 + 8)) {
      FUN_140089ed0(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



void FUN_140089d60(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 8);
  if (lVar1 != 0) {
    if (*(char *)(param_1 + 0x11) != '\0') {
      if (*(longlong *)(lVar1 + 0x10) != 0) {
        FUN_14000bf70(*(longlong *)(lVar1 + 0x10),*(undefined8 *)(lVar1 + 0x18));
        operator_delete(*(void **)(lVar1 + 0x10));
      }
      *(undefined8 *)(lVar1 + 0x10) = 0;
      *(undefined8 *)(lVar1 + 0x18) = 0;
      *(undefined8 *)(lVar1 + 0x20) = 0;
    }
    operator_delete(*(void **)(param_1 + 8));
  }
  return;
}



longlong FUN_140089dc0(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x58) {
    if (param_3 != 0) {
      FUN_140089ba0(param_3,param_1);
    }
    param_3 = param_3 + 0x58;
  }
  return param_3;
}



undefined2 * FUN_140089e20(longlong param_1,longlong param_2,undefined2 *param_3)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  for (; param_1 != param_2; param_1 = param_1 + 0x40) {
    if (param_3 != (undefined2 *)0x0) {
      *(undefined8 *)(param_3 + 0xc) = 7;
      *(undefined8 *)(param_3 + 8) = 0;
      *param_3 = 0;
      FUN_140001700(param_3,param_1,0,0xffffffffffffffff,uVar1);
      *(undefined4 *)(param_3 + 0x14) = *(undefined4 *)(param_1 + 0x28);
      *(undefined4 *)(param_3 + 0x16) = *(undefined4 *)(param_1 + 0x2c);
      *(undefined4 *)(param_3 + 0x18) = *(undefined4 *)(param_1 + 0x30);
      *(undefined4 *)(param_3 + 0x1a) = *(undefined4 *)(param_1 + 0x34);
      *(undefined4 *)(param_3 + 0x1c) = *(undefined4 *)(param_1 + 0x38);
      *(undefined4 *)(param_3 + 0x1e) = *(undefined4 *)(param_1 + 0x3c);
    }
    param_3 = param_3 + 0x20;
  }
  return param_3;
}



void FUN_140089ed0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  byte bVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 *puVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  undefined8 *puVar8;
  double dVar9;
  longlong local_40;
  ulonglong local_38;
  longlong local_28;
  longlong local_20;
  
  lVar7 = param_1[4];
  lVar6 = param_1[1];
  lVar2 = *param_1;
  local_40 = 0;
  local_38 = param_2;
  FUN_140097060(&local_40,param_2,lVar6,param_4,0xfffffffffffffffe);
  local_20 = param_1[1];
  lVar3 = *param_1;
  *param_1 = 0;
  param_1[1] = local_20;
  param_1[4] = 0;
  for (puVar8 = (undefined8 *)param_1[6]; puVar8 != (undefined8 *)(lVar2 + lVar6 * 8);
      puVar8 = puVar8 + 1) {
    puVar4 = (undefined8 *)*puVar8;
    while (puVar4 != (undefined8 *)0x0) {
      bVar1 = *(byte *)(puVar4 + 1);
      *puVar8 = *puVar4;
      *puVar4 = *(undefined8 *)(local_40 + ((ulonglong)bVar1 % local_38) * 8);
      *(undefined8 **)(local_40 + ((ulonglong)bVar1 % local_38) * 8) = puVar4;
      puVar4 = (undefined8 *)*puVar8;
    }
  }
  param_1[4] = lVar7;
  lVar7 = *param_1;
  *param_1 = local_40;
  lVar6 = param_1[1];
  param_1[1] = local_38;
  plVar5 = (longlong *)*param_1;
  if (param_1[4] == 0) {
    param_1[6] = (longlong)(plVar5 + local_38);
  }
  else {
    param_1[6] = (longlong)plVar5;
    lVar2 = *plVar5;
    while (lVar2 == 0) {
      plVar5 = plVar5 + 1;
      param_1[6] = (longlong)plVar5;
      lVar2 = *plVar5;
    }
  }
  dVar9 = (double)param_1[1];
  if (param_1[1] < 0) {
    dVar9 = dVar9 + 1.8446744073709552e+19;
  }
  local_40 = lVar7;
  local_38 = lVar6;
  local_28 = lVar3;
  dVar9 = ceil((double)*(float *)(param_1 + 5) * dVar9);
  lVar6 = -1;
  if (dVar9 < 1.8446744073709552e+19) {
    lVar6 = 0;
    if ((9.223372036854776e+18 < dVar9) &&
       (dVar9 = dVar9 - 9.223372036854776e+18, dVar9 < 9.223372036854776e+18)) {
      lVar6 = -0x8000000000000000;
    }
    lVar6 = (longlong)dVar9 + lVar6;
  }
  param_1[7] = lVar6;
  if (lVar3 != 0) {
    FUN_140089760(&local_28);
    lVar7 = local_40;
  }
  if (lVar7 != 0) {
    FUN_140089760(&local_40);
  }
  return;
}



void FUN_14008a090(longlong param_1)

{
  longlong lVar1;
  undefined8 *puVar2;
  char *local_res8;
  undefined **local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined8 local_20;
  undefined8 local_18;
  undefined8 local_10;
  
  lVar1 = *(longlong *)(param_1 + 8);
  if (lVar1 != 0) {
    if (*(longlong *)(lVar1 + 0x10) != 0) {
      FUN_14000bf70(*(longlong *)(lVar1 + 0x10),*(undefined8 *)(lVar1 + 0x18));
      operator_delete(*(void **)(lVar1 + 0x10));
    }
    *(undefined8 *)(lVar1 + 0x10) = 0;
    *(undefined8 *)(lVar1 + 0x18) = 0;
    *(undefined8 *)(lVar1 + 0x20) = 0;
    *(undefined1 *)(param_1 + 0x11) = 0;
    return;
  }
  *(undefined2 *)(param_1 + 0x10) = 0;
  puVar2 = operator_new(0x30);
  if (puVar2 != (undefined8 *)0x0) {
    *(undefined8 **)(param_1 + 8) = puVar2;
    *puVar2 = 0;
    puVar2[1] = local_30;
    puVar2[2] = local_28;
    puVar2[3] = local_20;
    puVar2[4] = local_18;
    puVar2[5] = local_10;
    *(undefined1 *)(param_1 + 0x10) = 1;
    return;
  }
  local_res8 = (char *)0x0;
  std::exception::exception((exception *)&local_38,&local_res8);
  local_38 = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(&local_38,(ThrowInfo *)&DAT_1402f47a8);
}



longlong FUN_14008a170(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x58) {
    if (param_3 != 0) {
      FUN_140089ba0(param_3,param_1);
    }
    param_3 = param_3 + 0x58;
  }
  return param_3;
}



undefined8 * FUN_14008a1e0(undefined8 *param_1,undefined8 *param_2,ulonglong param_3)

{
  ulonglong uVar1;
  code *pcVar2;
  undefined8 *puVar3;
  
  if (param_2 != (undefined8 *)0x0) {
    uVar1 = param_1[3];
    puVar3 = param_1;
    if (0xf < uVar1) {
      puVar3 = (undefined8 *)*param_1;
    }
    if (puVar3 <= param_2) {
      puVar3 = param_1;
      if (0xf < uVar1) {
        puVar3 = (undefined8 *)*param_1;
      }
      if (param_2 < (undefined8 *)((longlong)puVar3 + param_1[2])) {
        puVar3 = param_1;
        if (0xf < uVar1) {
          puVar3 = (undefined8 *)*param_1;
        }
        puVar3 = (undefined8 *)
                 FUN_14008a3b0(param_1,param_1,(longlong)param_2 - (longlong)puVar3,param_3);
        return puVar3;
      }
    }
  }
  if (-param_1[2] - 1 <= param_3) {
    std::_Xlength_error("string too long");
    pcVar2 = (code *)swi(3);
    puVar3 = (undefined8 *)(*pcVar2)();
    return puVar3;
  }
  if (param_3 != 0) {
    uVar1 = param_1[2] + param_3;
    if (uVar1 == 0xffffffffffffffff) {
      std::_Xlength_error("string too long");
      pcVar2 = (code *)swi(3);
      puVar3 = (undefined8 *)(*pcVar2)();
      return puVar3;
    }
    if ((ulonglong)param_1[3] < uVar1) {
      FUN_140004270(param_1,uVar1);
      if (uVar1 == 0) {
        return param_1;
      }
    }
    else if (uVar1 == 0) {
      param_1[2] = 0;
      if (0xf < (ulonglong)param_1[3]) {
        *(undefined1 *)*param_1 = 0;
        return param_1;
      }
      *(undefined1 *)param_1 = 0;
      return param_1;
    }
    puVar3 = param_1;
    if (0xf < (ulonglong)param_1[3]) {
      puVar3 = (undefined8 *)*param_1;
    }
    memcpy((void *)((longlong)puVar3 + param_1[2]),param_2,param_3);
    param_1[2] = uVar1;
    puVar3 = param_1;
    if (0xf < (ulonglong)param_1[3]) {
      puVar3 = (undefined8 *)*param_1;
    }
    *(undefined1 *)((longlong)puVar3 + uVar1) = 0;
  }
  return param_1;
}



undefined8 * FUN_14008a320(undefined8 *param_1,undefined8 *param_2)

{
  if (param_1 != param_2) {
    if (7 < (ulonglong)param_1[3]) {
      operator_delete((void *)*param_1);
    }
    param_1[3] = 7;
    param_1[2] = 0;
    *(undefined2 *)param_1 = 0;
    if ((ulonglong)param_2[3] < 8) {
      memmove(param_1,param_2,param_2[2] * 2 + 2);
    }
    else {
      *param_1 = *param_2;
      *param_2 = 0;
    }
    param_1[2] = param_2[2];
    param_1[3] = param_2[3];
    param_2[2] = 0;
    param_2[3] = 0;
  }
  return param_1;
}



undefined8 *
FUN_14008a3b0(undefined8 *param_1,undefined8 *param_2,ulonglong param_3,ulonglong param_4)

{
  code *pcVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  
  if ((ulonglong)param_2[2] < param_3) {
    std::_Xout_of_range("invalid string position");
    pcVar1 = (code *)swi(3);
    puVar2 = (undefined8 *)(*pcVar1)();
    return puVar2;
  }
  uVar3 = param_2[2] - param_3;
  if (uVar3 < param_4) {
    param_4 = uVar3;
  }
  if (param_4 < -param_1[2] - 1) {
    if (param_4 != 0) {
      uVar3 = param_1[2] + param_4;
      if (uVar3 == 0xffffffffffffffff) {
        std::_Xlength_error("string too long");
        pcVar1 = (code *)swi(3);
        puVar2 = (undefined8 *)(*pcVar1)();
        return puVar2;
      }
      if ((ulonglong)param_1[3] < uVar3) {
        FUN_140004270(param_1,uVar3);
        if (uVar3 == 0) {
          return param_1;
        }
      }
      else if (uVar3 == 0) {
        param_1[2] = 0;
        if (0xf < (ulonglong)param_1[3]) {
          *(undefined1 *)*param_1 = 0;
          return param_1;
        }
        *(undefined1 *)param_1 = 0;
        return param_1;
      }
      if (0xf < (ulonglong)param_2[3]) {
        param_2 = (undefined8 *)*param_2;
      }
      puVar2 = param_1;
      if (0xf < (ulonglong)param_1[3]) {
        puVar2 = (undefined8 *)*param_1;
      }
      memcpy((undefined1 *)((longlong)puVar2 + param_1[2]),(void *)((longlong)param_2 + param_3),
             param_4);
      param_1[2] = uVar3;
      puVar2 = param_1;
      if (0xf < (ulonglong)param_1[3]) {
        puVar2 = (undefined8 *)*param_1;
      }
      *(undefined1 *)((longlong)puVar2 + uVar3) = 0;
    }
    return param_1;
  }
  std::_Xlength_error("string too long");
  pcVar1 = (code *)swi(3);
  puVar2 = (undefined8 *)(*pcVar1)();
  return puVar2;
}



undefined8 * FUN_14008a4d0(undefined8 *param_1,undefined2 param_2)

{
  ulonglong uVar1;
  code *pcVar2;
  undefined8 *puVar3;
  
  if (-param_1[2] - 1 < 2) {
    std::_Xlength_error("string too long");
    pcVar2 = (code *)swi(3);
    puVar3 = (undefined8 *)(*pcVar2)();
    return puVar3;
  }
  uVar1 = param_1[2] + 1;
  if (uVar1 < 0x7fffffffffffffff) {
    if ((ulonglong)param_1[3] < uVar1) {
      FUN_140001930(param_1,uVar1);
      if (uVar1 == 0) {
        return param_1;
      }
    }
    else if (uVar1 == 0) {
      param_1[2] = 0;
      if (7 < (ulonglong)param_1[3]) {
        *(undefined2 *)*param_1 = 0;
        return param_1;
      }
      *(undefined2 *)param_1 = 0;
      return param_1;
    }
    puVar3 = param_1;
    if (7 < (ulonglong)param_1[3]) {
      puVar3 = (undefined8 *)*param_1;
    }
    *(undefined2 *)((longlong)puVar3 + param_1[2] * 2) = param_2;
    param_1[2] = uVar1;
    puVar3 = param_1;
    if (7 < (ulonglong)param_1[3]) {
      puVar3 = (undefined8 *)*param_1;
    }
    *(undefined2 *)((longlong)puVar3 + uVar1 * 2) = 0;
    return param_1;
  }
  std::_Xlength_error("string too long");
  pcVar2 = (code *)swi(3);
  puVar3 = (undefined8 *)(*pcVar2)();
  return puVar3;
}



void FUN_14008a5d0(undefined8 *param_1)

{
  if ((undefined8 *)*param_1 != param_1 + 1) {
    free((undefined8 *)*param_1);
  }
  return;
}



void FUN_14008a5f0(longlong *param_1,int param_2,void *param_3,int param_4)

{
  void *pvVar1;
  
  if (param_1 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80070057);
  }
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80070057);
  }
  if (param_3 == (void *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80070057);
  }
  pvVar1 = (void *)*param_1;
  if (pvVar1 == param_3) {
    if (param_2 <= param_4) {
      *param_1 = (longlong)param_3;
      goto LAB_14008a681;
    }
    pvVar1 = calloc((longlong)param_2,2);
  }
  else {
    if (param_2 <= param_4) {
      free(pvVar1);
      *param_1 = (longlong)param_3;
      goto LAB_14008a681;
    }
    pvVar1 = _recalloc(pvVar1,(longlong)param_2,2);
    if (pvVar1 == (void *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  *param_1 = (longlong)pvVar1;
LAB_14008a681:
  if (*param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x8007000e);
  }
  return;
}



void FUN_14008a6a0(void)

{
  DWORD DVar1;
  
  DVar1 = GetLastError();
  if (0 < (int)DVar1) {
    DVar1 = DVar1 & 0xffff | 0x80070000;
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(DVar1);
}



void FUN_14008a6c0(undefined8 *param_1,LPCSTR param_2,UINT param_3)

{
  code *pcVar1;
  int iVar2;
  int iVar3;
  DWORD DVar4;
  bool bVar5;
  
  if (param_2 == (LPCSTR)0x0) {
    *param_1 = 0;
    return;
  }
  iVar2 = lstrlenA(param_2);
  iVar2 = iVar2 + 1;
  FUN_14008a5f0(param_1,iVar2,param_1 + 1,0x80);
  iVar3 = MultiByteToWideChar(param_3,0,param_2,iVar2,(LPWSTR)*param_1,iVar2);
  if (iVar3 == 0) {
    DVar4 = GetLastError();
    bVar5 = true;
    if (DVar4 == 0x7a) {
      iVar3 = MultiByteToWideChar(param_3,0,param_2,iVar2,(LPWSTR)0x0,0);
      FUN_14008a5f0(param_1,iVar3,param_1 + 1,0x80);
      iVar2 = MultiByteToWideChar(param_3,0,param_2,iVar2,(LPWSTR)*param_1,iVar3);
      bVar5 = iVar2 == 0;
    }
    if (bVar5) {
      FUN_14008a6a0();
      pcVar1 = (code *)swi(3);
      (*pcVar1)();
      return;
    }
  }
  return;
}



undefined8 * FUN_14008a7d0(undefined8 *param_1,byte param_2)

{
  DAT_140320138 = 0;
  *param_1 = MBISingleton<>::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14008a810(undefined8 *param_1)

{
  DAT_140320138 = 0;
  *param_1 = MBISingleton<>::vftable;
  return;
}



undefined8 *
FUN_14008a830(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  *param_1 = MagiCustomOption::vftable;
  *(undefined4 *)(param_1 + 1) = 0x1010101;
  *(undefined4 *)((longlong)param_1 + 0xc) = 0x1010101;
  *(undefined4 *)(param_1 + 2) = 0x1010101;
  *(undefined4 *)((longlong)param_1 + 0x14) = 0x1010101;
  param_1[6] = 0xf;
  param_1[5] = 0;
  *(undefined1 *)(param_1 + 3) = 0;
  param_1[8] = 0;
  *(undefined1 *)(param_1 + 9) = 0;
  FUN_140003e60(param_1 + 3,"option\\customoption.xml",0x17,param_4,0xfffffffffffffffe);
  FUN_14008a920(param_1);
  return param_1;
}



undefined8 * FUN_14008a8b0(undefined8 *param_1,uint param_2)

{
  *param_1 = MagiCustomOption::vftable;
  if (0xf < (ulonglong)param_1[6]) {
    operator_delete((void *)param_1[3]);
  }
  param_1[6] = 0xf;
  param_1[5] = 0;
  *(undefined1 *)(param_1 + 3) = 0;
  *param_1 = MBISingleton<>::vftable;
  DAT_140320118 = 0;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14008a920(longlong param_1)

{
  char cVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  longlong *plVar6;
  longlong *plVar7;
  char *pcVar8;
  char *pcVar9;
  char *pcVar10;
  bool bVar11;
  undefined **local_98 [5];
  longlong *local_70;
  undefined8 *local_60;
  void *local_58;
  undefined8 *local_38;
  void *local_30;
  undefined8 local_18;
  
  local_18 = 0xfffffffffffffffe;
  plVar6 = (longlong *)(param_1 + 0x18);
  if (0xf < *(ulonglong *)(param_1 + 0x30)) {
    plVar6 = (longlong *)*plVar6;
  }
  FUN_1400275d0(local_98,plVar6);
  DAT_1403100dc = 0;
  cVar1 = FUN_1400276a0(local_98,local_60 + 2);
  if (cVar1 == '\0') {
    local_98[0] = TiXmlDocument::vftable;
    if (local_38 != &DAT_14031fee8) {
      operator_delete__(local_30);
    }
    local_98[0] = TiXmlNode::vftable;
    while (local_70 != (longlong *)0x0) {
      plVar6 = (longlong *)local_70[10];
      (**(code **)*local_70)(local_70,1);
      local_70 = plVar6;
    }
    if (local_60 != &DAT_14031fee8) {
      operator_delete__(local_58);
      return;
    }
    return;
  }
  plVar6 = local_70;
  if (local_70 != (longlong *)0x0) {
    do {
      bVar11 = (char *)(plVar6[7] + 0x10) == (char *)0x0;
      lVar3 = 4;
      pcVar8 = (char *)(plVar6[7] + 0x10);
      pcVar9 = "log";
      do {
        if (lVar3 == 0) break;
        lVar3 = lVar3 + -1;
        bVar11 = *pcVar8 == *pcVar9;
        pcVar8 = pcVar8 + 1;
        pcVar9 = pcVar9 + 1;
      } while (bVar11);
      if (bVar11) goto LAB_14008aa36;
      plVar6 = (longlong *)plVar6[10];
      plVar7 = local_70;
    } while (plVar6 != (longlong *)0x0);
    goto joined_r0x00014008acf3;
  }
  goto LAB_14008b0fb;
LAB_14008aa36:
  while (lVar3 = (**(code **)(*plVar6 + 0x30))(plVar6), lVar3 == 0) {
    do {
      plVar6 = (longlong *)plVar6[10];
      plVar7 = local_70;
      if (plVar6 == (longlong *)0x0) goto joined_r0x00014008acf3;
      bVar11 = (char *)(plVar6[7] + 0x10) == (char *)0x0;
      lVar3 = 4;
      pcVar8 = (char *)(plVar6[7] + 0x10);
      pcVar9 = "log";
      do {
        if (lVar3 == 0) break;
        lVar3 = lVar3 + -1;
        bVar11 = *pcVar8 == *pcVar9;
        pcVar8 = pcVar8 + 1;
        pcVar9 = pcVar9 + 1;
      } while (bVar11);
    } while (!bVar11);
  }
  lVar3 = (**(code **)(*plVar6 + 0x30))(plVar6);
  plVar7 = local_70;
  if (lVar3 != 0) {
    for (plVar6 = *(longlong **)(lVar3 + 0x28); plVar7 = local_70, plVar6 != (longlong *)0x0;
        plVar6 = (longlong *)plVar6[10]) {
      lVar3 = (**(code **)(*plVar6 + 0x30))(plVar6);
      if (lVar3 != 0) {
        lVar3 = (**(code **)(*plVar6 + 0x30))(plVar6);
        goto joined_r0x00014008aabb;
      }
    }
  }
joined_r0x00014008acf3:
  do {
    if (plVar7 == (longlong *)0x0) goto LAB_14008b0fb;
    bVar11 = (char *)(plVar7[7] + 0x10) == (char *)0x0;
    lVar3 = 8;
    pcVar8 = (char *)(plVar7[7] + 0x10);
    pcVar9 = "connect";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar11 = *pcVar8 == *pcVar9;
      pcVar8 = pcVar8 + 1;
      pcVar9 = pcVar9 + 1;
    } while (bVar11);
    if (bVar11) goto LAB_14008ad26;
    plVar7 = (longlong *)plVar7[10];
  } while( true );
joined_r0x00014008aabb:
  plVar7 = local_70;
  if (lVar3 != 0) {
    pcVar8 = (char *)(*(longlong *)(lVar3 + 0x38) + 0x10);
    if (pcVar8 != (char *)0x0) {
      for (lVar4 = *(longlong *)(lVar3 + 0xa0); lVar4 != lVar3 + 0x58;
          lVar4 = *(longlong *)(lVar4 + 0x48)) {
        pcVar9 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
        bVar11 = pcVar9 == (char *)0x0;
        lVar5 = 6;
        pcVar10 = "print";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar11 = *pcVar9 == *pcVar10;
          pcVar9 = pcVar9 + 1;
          pcVar10 = pcVar10 + 1;
        } while (bVar11);
        if (bVar11) {
          pcVar9 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
          if (pcVar9 != (char *)0x0) {
            lVar4 = -1;
            pcVar10 = pcVar8;
            goto code_r0x00014008ab1d;
          }
          break;
        }
      }
    }
    goto LAB_14008acb9;
  }
  goto joined_r0x00014008acf3;
  while( true ) {
    lVar4 = lVar4 + -1;
    cVar1 = *pcVar10;
    pcVar10 = pcVar10 + 1;
    if (cVar1 == '\0') break;
code_r0x00014008ab1d:
    if (lVar4 == 0) break;
  }
  if (lVar4 != -2) {
    iVar2 = _stricmp(pcVar8,"log_account");
    if (iVar2 == 0) {
      iVar2 = atoi(pcVar9);
      *(bool *)(param_1 + 0x41) = iVar2 == 1;
    }
    else {
      iVar2 = _stricmp(pcVar8,"log_item");
      if (iVar2 == 0) {
        iVar2 = atoi(pcVar9);
        *(bool *)(param_1 + 0x40) = iVar2 == 1;
      }
      else {
        iVar2 = _stricmp(pcVar8,"log_pet");
        if (iVar2 == 0) {
          iVar2 = atoi(pcVar9);
          *(bool *)(param_1 + 0x42) = iVar2 == 1;
        }
        else {
          iVar2 = _stricmp(pcVar8,"log_loginout");
          if (iVar2 == 0) {
            iVar2 = atoi(pcVar9);
            *(bool *)(param_1 + 0x43) = iVar2 == 1;
          }
          else {
            iVar2 = _stricmp(pcVar8,"agentmanagers");
            if (iVar2 == 0) {
              iVar2 = atoi(pcVar9);
              *(bool *)(param_1 + 0x44) = iVar2 == 1;
            }
            else {
              iVar2 = _stricmp(pcVar8,"agent");
              if (iVar2 == 0) {
                iVar2 = atoi(pcVar9);
                *(bool *)(param_1 + 0x45) = iVar2 == 1;
              }
              else {
                iVar2 = _stricmp(pcVar8,"api");
                if (iVar2 == 0) {
                  iVar2 = atoi(pcVar9);
                  *(bool *)(param_1 + 0x46) = iVar2 == 1;
                }
                else {
                  iVar2 = _stricmp(pcVar8,"pvp");
                  if (iVar2 == 0) {
                    iVar2 = atoi(pcVar9);
                    *(bool *)(param_1 + 0x47) = iVar2 == 1;
                  }
                  else {
                    iVar2 = _stricmp(pcVar8,"serveroption");
                    if (iVar2 == 0) {
                      iVar2 = atoi(pcVar9);
                      *(bool *)(param_1 + 0x48) = iVar2 == 1;
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
LAB_14008acb9:
  plVar6 = *(longlong **)(lVar3 + 0x50);
  while( true ) {
    plVar7 = local_70;
    if (plVar6 == (longlong *)0x0) goto joined_r0x00014008acf3;
    lVar3 = (**(code **)(*plVar6 + 0x30))(plVar6);
    if (lVar3 != 0) break;
    plVar6 = (longlong *)plVar6[10];
  }
  lVar3 = (**(code **)(*plVar6 + 0x30))(plVar6);
  goto joined_r0x00014008aabb;
LAB_14008ad26:
  while (lVar3 = (**(code **)(*plVar7 + 0x30))(plVar7), lVar3 == 0) {
    do {
      plVar7 = (longlong *)plVar7[10];
      if (plVar7 == (longlong *)0x0) goto LAB_14008b0fb;
      bVar11 = (char *)(plVar7[7] + 0x10) == (char *)0x0;
      lVar3 = 8;
      pcVar8 = (char *)(plVar7[7] + 0x10);
      pcVar9 = "connect";
      do {
        if (lVar3 == 0) break;
        lVar3 = lVar3 + -1;
        bVar11 = *pcVar8 == *pcVar9;
        pcVar8 = pcVar8 + 1;
        pcVar9 = pcVar9 + 1;
      } while (bVar11);
    } while (!bVar11);
  }
  lVar3 = (**(code **)(*plVar7 + 0x30))(plVar7);
  if (lVar3 != 0) {
    for (plVar6 = *(longlong **)(lVar3 + 0x28); plVar6 != (longlong *)0x0;
        plVar6 = (longlong *)plVar6[10]) {
      lVar3 = (**(code **)(*plVar6 + 0x30))(plVar6);
      if (lVar3 != 0) {
        lVar3 = (**(code **)(*plVar6 + 0x30))(plVar6);
        while (lVar3 != 0) {
          pcVar8 = (char *)(*(longlong *)(lVar3 + 0x38) + 0x10);
          if (pcVar8 != (char *)0x0) {
            for (lVar4 = *(longlong *)(lVar3 + 0xa0); lVar4 != lVar3 + 0x58;
                lVar4 = *(longlong *)(lVar4 + 0x48)) {
              pcVar9 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
              bVar11 = pcVar9 == (char *)0x0;
              lVar5 = 8;
              pcVar10 = "connect";
              do {
                if (lVar5 == 0) break;
                lVar5 = lVar5 + -1;
                bVar11 = *pcVar9 == *pcVar10;
                pcVar9 = pcVar9 + 1;
                pcVar10 = pcVar10 + 1;
              } while (bVar11);
              if (bVar11) {
                pcVar9 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
                if (pcVar9 != (char *)0x0) {
                  iVar2 = _stricmp(pcVar8,"dbc_game");
                  if (iVar2 == 0) {
                    iVar2 = atoi(pcVar9);
                    *(bool *)(param_1 + 8) = iVar2 == 1;
                  }
                  else {
                    iVar2 = _stricmp(pcVar8,"dbc_log");
                    if (iVar2 == 0) {
                      iVar2 = atoi(pcVar9);
                      *(bool *)(param_1 + 9) = iVar2 == 1;
                    }
                    else {
                      iVar2 = _stricmp(pcVar8,"dbc_chat");
                      if (iVar2 == 0) {
                        iVar2 = atoi(pcVar9);
                        *(bool *)(param_1 + 10) = iVar2 == 1;
                      }
                      else {
                        iVar2 = _stricmp(pcVar8,"dbc_emergency");
                        if (iVar2 == 0) {
                          iVar2 = atoi(pcVar9);
                          *(bool *)(param_1 + 0xb) = iVar2 == 1;
                        }
                        else {
                          iVar2 = _stricmp(pcVar8,"auction");
                          if (iVar2 == 0) {
                            iVar2 = atoi(pcVar9);
                            *(bool *)(param_1 + 0xc) = iVar2 == 1;
                          }
                          else {
                            iVar2 = _stricmp(pcVar8,"msg");
                            if (iVar2 == 0) {
                              iVar2 = atoi(pcVar9);
                              *(bool *)(param_1 + 0xd) = iVar2 == 1;
                            }
                            else {
                              iVar2 = _stricmp(pcVar8,"manager");
                              if (iVar2 == 0) {
                                iVar2 = atoi(pcVar9);
                                *(bool *)(param_1 + 0xe) = iVar2 == 1;
                              }
                              else {
                                iVar2 = _stricmp(pcVar8,"match");
                                if (iVar2 == 0) {
                                  iVar2 = atoi(pcVar9);
                                  *(bool *)(param_1 + 0xf) = iVar2 == 1;
                                }
                                else {
                                  iVar2 = _stricmp(pcVar8,"gm");
                                  if (iVar2 == 0) {
                                    iVar2 = atoi(pcVar9);
                                    *(bool *)(param_1 + 0x10) = iVar2 == 1;
                                  }
                                  else {
                                    iVar2 = _stricmp(pcVar8,"gate");
                                    if (iVar2 == 0) {
                                      iVar2 = atoi(pcVar9);
                                      *(bool *)(param_1 + 0x11) = iVar2 == 1;
                                    }
                                    else {
                                      iVar2 = _stricmp(pcVar8,"lobby");
                                      if (iVar2 == 0) {
                                        iVar2 = atoi(pcVar9);
                                        *(bool *)(param_1 + 0x12) = iVar2 == 1;
                                      }
                                      else {
                                        iVar2 = _stricmp(pcVar8,"dungeon");
                                        if (iVar2 == 0) {
                                          iVar2 = atoi(pcVar9);
                                          *(bool *)(param_1 + 0x13) = iVar2 == 1;
                                        }
                                        else {
                                          iVar2 = _stricmp(pcVar8,"pvp");
                                          if (iVar2 == 0) {
                                            iVar2 = atoi(pcVar9);
                                            *(bool *)(param_1 + 0x14) = iVar2 == 1;
                                          }
                                          else {
                                            iVar2 = _stricmp(pcVar8,"guild");
                                            if (iVar2 == 0) {
                                              iVar2 = atoi(pcVar9);
                                              *(bool *)(param_1 + 0x15) = iVar2 == 1;
                                            }
                                            else {
                                              iVar2 = _stricmp(pcVar8,"agent");
                                              if (iVar2 == 0) {
                                                iVar2 = atoi(pcVar9);
                                                *(bool *)(param_1 + 0x16) = iVar2 == 1;
                                              }
                                              else {
                                                iVar2 = _stricmp(pcVar8,"agentmanager");
                                                if (iVar2 == 0) {
                                                  iVar2 = atoi(pcVar9);
                                                  *(bool *)(param_1 + 0x17) = iVar2 == 1;
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
                break;
              }
            }
          }
          plVar6 = *(longlong **)(lVar3 + 0x50);
          while( true ) {
            if (plVar6 == (longlong *)0x0) goto LAB_14008b0fb;
            lVar3 = (**(code **)(*plVar6 + 0x30))(plVar6);
            if (lVar3 != 0) break;
            plVar6 = (longlong *)plVar6[10];
          }
          lVar3 = (**(code **)(*plVar6 + 0x30))(plVar6);
        }
        break;
      }
    }
  }
LAB_14008b0fb:
  printf("//////////////////////////////////////////////////////////////////////////\n");
  if (*(char *)(param_1 + 0x40) != '\0') {
    printf("LOGVIEWER Option [%d] - LogItem View.\n");
  }
  if (*(char *)(param_1 + 0x41) != '\0') {
    printf("LOGVIEWER Option [%d] - LogAccount View.\n");
  }
  if (*(char *)(param_1 + 0x44) != '\0') {
    printf("LOGVIEWER Option [%d] - LogAgentManagers View.\n");
  }
  if (*(char *)(param_1 + 0x45) != '\0') {
    printf("LOGVIEWER Option [%d] - LogAgent View.\n");
  }
  if (*(char *)(param_1 + 0x46) != '\0') {
    printf("LOGVIEWER Option [%d] - LogApi View.\n");
  }
  if (*(char *)(param_1 + 0x47) != '\0') {
    printf("LOGVIEWER Option [%d] - LogPvp View.\n");
  }
  if (*(char *)(param_1 + 0x48) != '\0') {
    printf("LOGVIEWER Option [%d] - LogServerOption View.\n");
  }
  if (*(char *)(param_1 + 0x42) != '\0') {
    printf("LOGVIEWER Option [%d] - LogPet View.\n");
  }
  if (*(char *)(param_1 + 8) != '\0') {
    printf("Connect Option [%d] - DBC_GAME. \n");
  }
  if (*(char *)(param_1 + 9) != '\0') {
    printf("Connect Option [%d] - DBC_LOG. \n");
  }
  if (*(char *)(param_1 + 0xc) != '\0') {
    printf("Connect Option [%d] - Auction. \n");
  }
  if (*(char *)(param_1 + 0xd) != '\0') {
    printf("Connect Option [%d] - Msg. \n");
  }
  if (*(char *)(param_1 + 0xe) != '\0') {
    printf("Connect Option [%d] - Manager. \n");
  }
  if (*(char *)(param_1 + 0xf) != '\0') {
    printf("Connect Option [%d] - Match. \n");
  }
  if (*(char *)(param_1 + 0x10) != '\0') {
    printf("Connect Option [%d] - Gm. \n");
  }
  if (*(char *)(param_1 + 0x11) != '\0') {
    printf("Connect Option [%d] - Gate. \n");
  }
  if (*(char *)(param_1 + 0x12) != '\0') {
    printf("Connect Option [%d] - Lobby. \n");
  }
  if (*(char *)(param_1 + 0x13) != '\0') {
    printf("Connect Option [%d] - Dungeon. \n");
  }
  if (*(char *)(param_1 + 0x14) != '\0') {
    printf("Connect Option [%d] - Pvp. \n");
  }
  if (*(char *)(param_1 + 0x15) != '\0') {
    printf("Connect Option [%d] - Guild. \n");
  }
  if (*(char *)(param_1 + 0x16) != '\0') {
    printf("Connect Option [%d] - Agent. \n");
  }
  if (*(char *)(param_1 + 0x17) != '\0') {
    printf("Connect Option [%d] - AgentManager. \n");
  }
  printf("//////////////////////////////////////////////////////////////////////////\n");
  local_98[0] = TiXmlDocument::vftable;
  if (local_38 != &DAT_14031fee8) {
    operator_delete__(local_30);
  }
  local_98[0] = TiXmlNode::vftable;
  while (local_70 != (longlong *)0x0) {
    plVar6 = (longlong *)local_70[10];
    (**(code **)*local_70)(local_70,1);
    local_70 = plVar6;
  }
  if (local_60 != &DAT_14031fee8) {
    operator_delete__(local_58);
  }
  return;
}



undefined8 * FUN_14008b3f0(undefined8 *param_1,byte param_2)

{
  DAT_140320118 = 0;
  *param_1 = MBISingleton<>::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14008b430(undefined8 *param_1)

{
  DAT_140320118 = 0;
  *param_1 = MBISingleton<>::vftable;
  return;
}



undefined8 * FUN_14008b450(undefined8 *param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  undefined4 uVar2;
  
  FUN_140001f70();
  FUN_14018a120(param_1 + 9);
  *param_1 = MGSAgentSession::vftable;
  param_1[9] = MGSAgentSession::vftable;
  puVar1 = param_1 + 0xd;
  FUN_140186ea0(puVar1);
  *puVar1 = SERVER2AGENT_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x7c) != 1) {
    FUN_1400a2b50(PTR_u_PIDL_compiler_is_incompatible_to_14030bd40);
  }
  *puVar1 = RNP::Server2AgentProxy::vftable;
  *(undefined1 *)(param_1 + 0x10) = 0;
  *(undefined1 *)(param_1 + 0x11) = 0;
  param_1[0x12] = param_2;
  param_1[0x13] = 0;
  param_1[0x14] = 0;
  param_1[0x15] = 0;
  uVar2 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0x17,uVar2,1);
  return param_1;
}



void * FUN_14008b530(void *param_1,uint param_2)

{
  FUN_14008b560();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14008b560(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  *param_1 = MGSAgentSession::vftable;
  param_1[9] = MGSAgentSession::vftable;
  if ((longlong *)param_1[2] != (longlong *)0x0) {
    (**(code **)(*(longlong *)param_1[2] + 0x88))();
  }
  puVar1 = (undefined8 *)param_1[2];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,uVar2);
  }
  param_1[2] = 0;
  *(undefined2 *)((longlong)param_1 + 0x19) = 0;
  *(undefined1 *)((longlong)param_1 + 0x1b) = 1;
  FUN_1400a1cd0(param_1 + 0x17);
  if ((void *)param_1[0x13] != (void *)0x0) {
    operator_delete((void *)param_1[0x13]);
  }
  param_1[0x13] = 0;
  param_1[0x14] = 0;
  param_1[0x15] = 0;
  param_1[0xd] = RNP::Server2AgentProxy::vftable;
  FUN_140186ed0();
  param_1[9] = RNP::Agent2ServerStub::vftable;
  FUN_14018a150(param_1 + 9);
  *param_1 = MagiCommonSession::vftable;
  FUN_1400031d0(param_1 + 6);
  *param_1 = Proud::INetClientEvent::vftable;
  FUN_140140b40(param_1);
  return;
}



void FUN_14008b660(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined *puVar4;
  undefined *local_res18 [2];
  
  plVar2 = (longlong *)FUN_1401417c0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1402f8010;
  }
  FUN_140026050(L"OnError MGSAgentSession : %s",puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1402f8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res18[0] + -8);
    }
    FUN_1400d1290(uVar3);
  }
  return;
}



void FUN_14008b700(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined *puVar4;
  undefined *local_res18 [2];
  
  plVar2 = (longlong *)FUN_1401417c0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1402f8010;
  }
  FUN_140026050(L"OnWarning MGSAgentSession : %s",puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1402f8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res18[0] + -8);
    }
    FUN_1400d1290(uVar3);
  }
  return;
}



void FUN_14008b7a0(undefined8 param_1,longlong *param_2)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(*param_2 + 8))(param_2);
  FUN_140025f00("OnException MGSAgentSession : %s",uVar1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14008b7c0(longlong param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined1 auVar3 [16];
  undefined4 uVar4;
  undefined8 uVar5;
  undefined2 *puVar6;
  undefined1 auStack_c8 [32];
  undefined *local_a8;
  undefined8 local_a0;
  undefined **local_98;
  undefined8 local_88;
  undefined2 local_80;
  undefined6 uStack_7e;
  undefined8 local_70;
  ulonglong local_68;
  undefined2 local_58;
  undefined6 uStack_56;
  undefined8 local_48;
  ulonglong local_40;
  ulonglong local_28;
  
  local_a0 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_c8;
  local_68 = 7;
  local_70 = 0;
  local_80 = 0;
  local_40 = 7;
  local_48 = 0;
  local_58 = 0;
  if (*(longlong *)(DAT_140320138 + 0x1c8) != 0) {
    auVar3._8_8_ = 0;
    auVar3._0_8_ = *(ulonglong *)(DAT_140320138 + 0x1b0);
    for (puVar1 = *(undefined8 **)
                   (*(longlong *)(DAT_140320138 + 0x1a8) +
                   SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xd)) % auVar3,0) * 8);
        puVar1 != (undefined8 *)0x0; puVar1 = (undefined8 *)*puVar1) {
      if (*(char *)(puVar1 + 1) == '\r') {
        if (puVar1 == (undefined8 *)0x0) {
          return;
        }
        puVar2 = (undefined8 *)puVar1[2];
        if (puVar2 == (undefined8 *)puVar1[3]) {
          return;
        }
        local_88 = *puVar2;
        FUN_140001700(&local_80,puVar2 + 1,0,0xffffffffffffffff);
        FUN_140001700(&local_58,puVar2 + 6,0,0xffffffffffffffff);
        puVar6 = &local_58;
        if (7 < local_40) {
          puVar6 = (undefined2 *)CONCAT62(uStack_56,local_58);
        }
        FUN_1400a3440();
        local_a8 = PTR_DAT_1402f8010;
        uVar4 = FUN_1400a32c0(puVar6);
        uVar5 = FUN_140002f20(&local_a8,uVar4);
        FUN_1400a32f0(uVar5,puVar6,uVar4);
        FUN_140003000(&local_a8);
        local_98 = &local_a8;
        FUN_140003100(param_1 + 0x30,&local_a8);
        FUN_1400031d0(&local_a8);
        *(undefined2 *)(param_1 + 0x38) = local_88._4_2_;
        *(undefined4 *)(param_1 + 0x3c) = (undefined4)local_88;
        FUN_1400020e0(param_1);
        if (7 < local_40) {
          operator_delete((void *)CONCAT62(uStack_56,local_58));
        }
        local_40 = 7;
        local_48 = 0;
        local_58 = 0;
        if (local_68 < 8) {
          return;
        }
        operator_delete((void *)CONCAT62(uStack_7e,local_80));
        return;
      }
    }
  }
  return;
}



undefined8 FUN_14008b990(longlong param_1)

{
  char cVar1;
  longlong lVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong *plVar5;
  
  DVar3 = GetTickCount();
  lVar2 = DAT_140320118;
  *(undefined4 *)(param_1 + 0x40) = 0xd;
  *(undefined1 *)(param_1 + 0x18) = *(undefined1 *)(lVar2 + 0x16);
  plVar5 = (longlong *)FUN_140184d20();
  *(longlong **)(param_1 + 0x10) = plVar5;
  if (plVar5 != (longlong *)0x0) {
    (**(code **)(*plVar5 + 0x118))(plVar5,param_1);
    (**(code **)(**(longlong **)(param_1 + 0x10) + 0x10))
              (*(longlong **)(param_1 + 0x10),param_1 + 0x48);
    (**(code **)(**(longlong **)(param_1 + 0x10) + 8))
              (*(longlong **)(param_1 + 0x10),param_1 + 0x68);
  }
  if (*(char *)(DAT_140320138 + 0x150) != '\0') {
    FUN_14008b7c0(param_1);
    cVar1 = *(char *)(param_1 + 0x88);
    while (cVar1 == '\0') {
      FUN_140002460(param_1);
      DVar4 = GetTickCount();
      if (30000 < DVar4 - DVar3) {
        printf("\n AGENT MODE ERROR - NOT RECEIVE DATA \n");
        Sleep(3000);
        return 0;
      }
      Sleep(10);
      cVar1 = *(char *)(param_1 + 0x88);
    }
  }
  return 1;
}



void FUN_14008ba90(longlong param_1,int *param_2)

{
  int *piVar1;
  undefined *puVar2;
  longlong lVar3;
  undefined4 local_res8;
  undefined4 uStackX_c;
  longlong local_20;
  undefined4 local_18;
  undefined8 local_10;
  
  *(undefined1 *)(param_1 + 0x19) = 0;
  if (*param_2 == 0) {
    *(undefined2 *)(param_1 + 0x1a) = 1;
    *(undefined1 *)(param_1 + 0x1c) = 0;
    local_18 = 0x80bf;
    local_20 = (ulonglong)*(uint *)(DAT_140320138 + 0x1ec) << 0x20;
    local_10 = *(undefined8 *)(DAT_140320138 + 0x1f0);
    local_res8 = *(undefined4 *)(DAT_140320138 + 0x154);
    (**(code **)(*(longlong *)(param_1 + 0x68) + 0x30))
              ((longlong *)(param_1 + 0x68),1,&DAT_14030ab90,&local_res8,&local_20);
    if (*(longlong **)(param_1 + 0x10) != (longlong *)0x0) {
      (**(code **)(**(longlong **)(param_1 + 0x10) + 0x30))();
      wprintf(L"Agent Connect Succeed: HostID[%d] \n");
    }
  }
  else {
    *(undefined1 *)(param_1 + 0x1b) = 1;
    FUN_1401417c0(param_2,&local_res8);
    wprintf(L"Agent Connect Failed [%s] \n");
    puVar2 = (undefined *)CONCAT44(uStackX_c,local_res8);
    if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8010)) &&
       (puVar2 + -8 != (undefined *)0x0)) {
      lVar3 = FUN_1400a3440();
      local_20 = lVar3;
      FUN_1400a1c30(lVar3);
      local_18 = CONCAT31(local_18._1_3_,1);
      piVar1 = (int *)(puVar2 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar2 + -8);
      }
      FUN_1400d1290(lVar3);
    }
  }
  return;
}



void FUN_14008bbd0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  undefined *local_res8;
  
  puVar2 = (undefined8 *)FUN_1401417c0(param_2,&local_res8,param_3,param_4,0xfffffffffffffffe);
  FUN_1401e4980(DAT_140320100,L"Agent Disconnected %s \n",*puVar2);
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1402f8010)) &&
     (local_res8 + -8 != (undefined *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(local_res8 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res8 + -8);
    }
    FUN_1400d1290(uVar3);
  }
  *(undefined2 *)(param_1 + 0x19) = 0;
  *(undefined1 *)(param_1 + 0x1b) = 1;
  *(undefined1 *)(param_1 + 0x88) = 0;
  return;
}



void FUN_14008bca0(longlong param_1,undefined8 param_2)

{
  void *_Dst;
  
  FUN_1400a1c30(param_1 + 0xb8);
  FUN_14008bf70(param_2,param_1 + 0x98);
  _Dst = *(void **)(param_1 + 0x98);
  if (_Dst != *(void **)(param_1 + 0xa0)) {
    memmove(_Dst,*(void **)(param_1 + 0xa0),0);
    *(void **)(param_1 + 0xa0) = _Dst;
  }
  FUN_1400d1290(param_1 + 0xb8);
  return;
}



void FUN_14008bd50(longlong param_1,undefined4 param_2,undefined4 param_3,undefined1 param_4)

{
  undefined4 local_res8 [8];
  undefined8 uVar1;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined8 local_40;
  undefined4 local_38;
  undefined1 local_34;
  undefined1 local_33;
  void *local_30;
  undefined8 local_28;
  undefined8 local_20;
  
  uVar1 = 0xfffffffffffffffe;
  if (*(char *)(param_1 + 0x88) != '\0') {
    local_44 = 0;
    local_40 = 0;
    local_48 = DAT_14031feb0;
    local_38 = 0;
    local_33 = *(undefined1 *)(DAT_140320138 + 0x171);
    local_30 = (void *)0x0;
    local_28 = 0;
    local_20 = 0;
    local_50 = param_2;
    local_4c = param_3;
    local_34 = param_4;
    FUN_14008d080(DAT_140320158,&local_30);
    local_res8[0] = *(undefined4 *)(DAT_140320138 + 0x154);
    (**(code **)(*(longlong *)(param_1 + 0x68) + 0x40))
              ((longlong *)(param_1 + 0x68),1,&DAT_14030ab90,local_res8,&local_50,&local_30,uVar1);
    if (local_30 != (void *)0x0) {
      operator_delete(local_30);
    }
  }
  return;
}



void FUN_14008be30(longlong param_1)

{
  FUN_14008b530(param_1 + -0x48);
  return;
}



undefined8 FUN_14008be40(void)

{
  return 0x84df;
}



undefined8 FUN_14008be50(void)

{
  return 34000;
}



void FUN_14008be60(undefined8 *param_1)

{
  void *_Dst;
  
  _Dst = (void *)*param_1;
  if (_Dst != (void *)param_1[1]) {
    memmove(_Dst,(void *)param_1[1],0);
    param_1[1] = _Dst;
  }
  return;
}



void * FUN_14008bec0(void *param_1,longlong param_2,void *param_3)

{
  size_t _Size;
  
  _Size = (param_2 - (longlong)param_1 >> 2) * 4;
  memmove(param_3,param_1,_Size);
  return (void *)(_Size + (longlong)param_3);
}



undefined8 FUN_14008bf00(longlong *param_1,ulonglong param_2)

{
  code *pcVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  uVar2 = 0;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  if (param_2 != 0) {
    if (0x3fffffffffffffff < param_2) {
      std::_Xlength_error("vector<T> too long");
      pcVar1 = (code *)swi(3);
      uVar2 = (*pcVar1)();
      return uVar2;
    }
    lVar3 = FUN_14007a250(param_1 + 3);
    *param_1 = lVar3;
    param_1[1] = lVar3;
    lVar3 = lVar3 + param_2 * 4;
    param_1[2] = lVar3;
    uVar2 = CONCAT71((int7)((ulonglong)lVar3 >> 8),1);
  }
  return uVar2;
}



longlong * FUN_14008bf70(longlong *param_1,longlong *param_2)

{
  void *_Src;
  void *_Dst;
  char cVar1;
  void *pvVar2;
  ulonglong uVar3;
  size_t _Size;
  ulonglong uVar4;
  
  if (param_1 != param_2) {
    pvVar2 = (void *)*param_2;
    uVar3 = param_2[1] - (longlong)pvVar2 >> 2;
    if (uVar3 == 0) {
      FUN_14008be60(param_1);
      return param_1;
    }
    _Dst = (void *)*param_1;
    uVar4 = param_1[1] - (longlong)_Dst >> 2;
    if (uVar3 <= uVar4) {
      memmove(_Dst,pvVar2,param_2[1] - (longlong)pvVar2 & 0xfffffffffffffffc);
      param_1[1] = *param_1 + (param_2[1] - *param_2 >> 2) * 4;
      return param_1;
    }
    if ((ulonglong)(param_1[2] - (longlong)_Dst >> 2) < uVar3) {
      if (_Dst != (void *)0x0) {
        operator_delete(_Dst);
      }
      cVar1 = FUN_14008bf00(param_1,param_2[1] - *param_2 >> 2);
      if (cVar1 == '\0') {
        return param_1;
      }
      _Size = (param_2[1] - *param_2 >> 2) * 4;
      pvVar2 = memmove((void *)*param_1,(void *)*param_2,_Size);
    }
    else {
      _Src = (void *)((longlong)pvVar2 + uVar4 * 4);
      FUN_14008bec0(pvVar2,_Src,_Dst);
      _Size = (param_2[1] - (longlong)_Src >> 2) * 4;
      pvVar2 = memmove((void *)param_1[1],_Src,_Size);
    }
    param_1[1] = (longlong)pvVar2 + _Size;
  }
  return param_1;
}



void FUN_14008c0b0(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,0xfffffffffffffffe);
  }
  *param_1 = 0;
  FUN_1400031d0(param_1 + 1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x00014008c477)
// WARNING: Removing unreachable block (ram,0x00014008c47e)
// WARNING: Removing unreachable block (ram,0x00014008c493)
// WARNING: Removing unreachable block (ram,0x00014008c49f)
// WARNING: Removing unreachable block (ram,0x00014008c497)
// WARNING: Removing unreachable block (ram,0x00014008c4a5)
// WARNING: Removing unreachable block (ram,0x00014008c4b7)

void FUN_14008c0f0(undefined8 *param_1,undefined4 param_2,undefined4 param_3)

{
  int *piVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined8 uVar4;
  undefined8 *puVar5;
  undefined *puVar6;
  undefined4 *puVar7;
  int iVar8;
  undefined4 *puVar9;
  undefined *puVar10;
  undefined4 *puVar11;
  longlong lVar12;
  undefined4 *puVar13;
  int iVar14;
  undefined1 auStack_178 [32];
  longlong local_158;
  undefined8 local_150;
  undefined1 local_148;
  longlong local_140;
  undefined1 local_138;
  undefined8 local_128;
  undefined **local_120;
  longlong *local_118;
  undefined4 *local_110;
  uint local_108;
  undefined4 uStack_104;
  undefined4 uStack_100;
  undefined4 local_fc;
  undefined *local_f8;
  undefined *local_f0;
  undefined4 local_e8;
  undefined **local_e0;
  longlong *local_d8;
  undefined4 *local_d0;
  int local_c8;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined1 local_91;
  undefined1 local_80;
  undefined **local_70;
  longlong *local_68;
  longlong local_60;
  ulonglong local_38;
  
  local_128 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_178;
  (**(code **)(*(longlong *)*param_1 + 0x178))((longlong *)*param_1,0x406e000000000000);
  FUN_140140bf0(&local_f8);
  if (*(char *)(DAT_140320138 + 0x151) == '\0') {
    if (local_f0 == (undefined *)0x0) {
      local_f0 = PTR_DAT_1402f8010;
    }
    if ((undefined *)param_1[1] == local_f0) goto LAB_14008c38d;
    uVar4 = FUN_1400a3440();
    local_150 = uVar4;
    FUN_1400a1c30(uVar4);
    puVar6 = local_f0;
    local_148 = 1;
    if (((local_f0 != (undefined *)0x0) && (local_f0 != PTR_DAT_1402f8010)) &&
       (puVar10 = local_f0 + -8, puVar10 != (undefined *)0x0)) {
      lVar3 = FUN_1400a3440();
      local_140 = lVar3;
      FUN_1400a1c30(lVar3);
      local_138 = 1;
      piVar1 = (int *)(puVar6 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar10);
      }
      FUN_1400d1290(lVar3);
    }
    local_f0 = (undefined *)param_1[1];
    if (((local_f0 != PTR_DAT_1402f8010) && (local_f0 != (undefined *)0x0)) &&
       (local_f0 != (undefined *)0x8)) {
      *(int *)(local_f0 + -4) = *(int *)(local_f0 + -4) + 1;
    }
  }
  else {
    if (local_f8 == (undefined *)0x0) {
      local_f8 = PTR_DAT_1402f8010;
    }
    if ((undefined *)param_1[1] != local_f8) {
      lVar3 = FUN_1400a3440();
      local_140 = lVar3;
      FUN_1400a1c30(lVar3);
      puVar6 = local_f8;
      local_138 = 1;
      if (((local_f8 != (undefined *)0x0) && (local_f8 != PTR_DAT_1402f8010)) &&
         (puVar10 = local_f8 + -8, puVar10 != (undefined *)0x0)) {
        uVar4 = FUN_1400a3440();
        local_150 = uVar4;
        FUN_1400a1c30(uVar4);
        local_148 = 1;
        piVar1 = (int *)(puVar6 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar10);
        }
        FUN_1400d1290(uVar4);
      }
      local_f8 = (undefined *)param_1[1];
      if (((local_f8 != PTR_DAT_1402f8010) && (local_f8 != (undefined *)0x0)) &&
         (local_f8 != (undefined *)0x8)) {
        *(int *)(local_f8 + -4) = *(int *)(local_f8 + -4) + 1;
      }
      FUN_1400d1290(lVar3);
    }
    puVar6 = (undefined *)param_1[1];
    if ((undefined *)param_1[1] == (undefined *)0x0) {
      puVar6 = PTR_DAT_1402f8010;
    }
    puVar5 = (undefined8 *)FUN_140087f60(&local_120,puVar6);
    if (7 < (ulonglong)puVar5[3]) {
      puVar5 = (undefined8 *)*puVar5;
    }
    FUN_14001f680(&local_f0,puVar5);
    if (7 < CONCAT44(uStack_104,local_108)) {
      operator_delete(local_120);
    }
    puVar6 = (undefined *)param_1[1];
    if ((undefined *)param_1[1] == (undefined *)0x0) {
      puVar6 = PTR_DAT_1402f8010;
    }
    param_1[1] = puVar6;
    if (local_f8 == puVar6) goto LAB_14008c38d;
    uVar4 = FUN_1400a3440();
    local_150 = uVar4;
    FUN_1400a1c30(uVar4);
    local_148 = 1;
    FUN_1400031d0(param_1 + 1);
    param_1[1] = local_f8;
    if (((local_f8 != PTR_DAT_1402f8010) && (local_f8 != (undefined *)0x0)) &&
       (local_f8 != (undefined *)0x8)) {
      *(int *)(local_f8 + -4) = *(int *)(local_f8 + -4) + 1;
    }
  }
  FUN_1400d1290(uVar4);
LAB_14008c38d:
  local_e8 = *(undefined4 *)(param_1 + 2);
  local_b4 = DAT_140320030;
  local_b0 = DAT_140320034;
  local_ac = DAT_140320038;
  local_a8 = DAT_14032003c;
  local_80 = 0;
  local_9c = 0x80;
  local_91 = 1;
  iVar14 = *(int *)((longlong)param_1 + 0x14);
  local_a4 = param_2;
  local_a0 = param_3;
  if ((iVar14 < 1) || (*(int *)(param_1 + 3) < 1)) {
    (**(code **)(*(longlong *)*param_1 + 0x180))((longlong *)*param_1,2);
  }
  else {
    local_120 = Proud::CFastArray<int,0>::vftable;
    puVar13 = (undefined4 *)0x0;
    local_118 = (longlong *)0x0;
    local_fc = 0;
    local_110 = (undefined4 *)0x0;
    local_108 = 0;
    uStack_104 = 0;
    uStack_100 = 0;
    local_b8 = 1;
    puVar9 = puVar13;
    if (iVar14 < *(int *)(param_1 + 3) + iVar14) {
      do {
        iVar8 = (int)puVar9;
        if (iVar8 < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        FUN_140021fb0(&local_120,iVar8 + 1);
        puVar9 = (undefined4 *)(ulonglong)local_108;
        puVar7 = local_110;
        if (local_108 == 0) {
          puVar7 = puVar13;
        }
        puVar7[iVar8] = iVar14;
        iVar14 = iVar14 + 1;
      } while (iVar14 < *(int *)(param_1 + 3) + *(int *)((longlong)param_1 + 0x14));
      if ((int)local_108 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
    }
    puVar7 = local_110;
    plVar2 = local_118;
    iVar14 = (int)puVar9;
    FUN_140021fb0(&local_e0,puVar9);
    puVar9 = local_d0;
    if (local_c8 == 0) {
      puVar9 = puVar13;
    }
    puVar11 = puVar7;
    if (iVar14 == 0) {
      puVar11 = puVar13;
    }
    lVar3 = (longlong)iVar14;
    if (0 < iVar14) {
      lVar12 = (longlong)puVar11 - (longlong)puVar9;
      do {
        *puVar9 = *(undefined4 *)(lVar12 + (longlong)puVar9);
        puVar9 = puVar9 + 1;
        lVar3 = lVar3 + -1;
      } while (lVar3 != 0);
    }
    if (puVar7 != (undefined4 *)0x0) {
      if (plVar2 == (longlong *)0x0) {
        FUN_1400a3530(puVar7);
      }
      else {
        (**(code **)(*plVar2 + 0x18))(plVar2,puVar7);
      }
    }
  }
  local_158 = 0;
  (**(code **)(*(longlong *)*param_1 + 0x138))((longlong *)*param_1,&local_f8,&local_158);
  puVar6 = local_f0;
  if (local_f0 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8010;
  }
  FUN_140025b40(L"Server Start : ADDRESS[%s] PORT[%d]",puVar6,local_e8);
  lVar3 = local_158;
  if (local_158 != 0) {
    local_140 = local_158;
    FUN_1400a1c30(local_158);
    local_138 = 1;
    *(longlong *)(local_158 + 0x40) = *(longlong *)(local_158 + 0x40) + -1;
    if (*(longlong *)(local_158 + 0x40) == 0) {
      FUN_1400d1290(lVar3);
      local_138 = 0;
      FUN_14008c910(local_158);
    }
    else {
      FUN_1400d1290(lVar3);
    }
  }
  local_70 = Proud::CFastArray<int,0>::vftable;
  if (local_60 != 0) {
    if (local_68 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*local_68 + 0x18))(local_68,local_60);
    }
  }
  local_e0 = Proud::CFastArray<int,0>::vftable;
  if (local_d0 != (undefined4 *)0x0) {
    if (local_d8 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*local_d8 + 0x18))(local_d8,local_d0);
    }
  }
  FUN_1400031d0(&local_f0);
  puVar6 = local_f8;
  if (((local_f8 != (undefined *)0x0) && (local_f8 != PTR_DAT_1402f8010)) &&
     (puVar10 = local_f8 + -8, puVar10 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    local_150 = uVar4;
    FUN_1400a1c30(uVar4);
    local_148 = 1;
    piVar1 = (int *)(puVar6 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar10);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



void FUN_14008c730(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  
  *(undefined ***)(param_1 + 0x88) = Proud::CFastArray<int,0>::vftable;
  if (*(longlong *)(param_1 + 0x98) != 0) {
    plVar1 = *(longlong **)(param_1 + 0x90);
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar1 + 0x18))
                (plVar1,*(longlong *)(param_1 + 0x98),plVar1,param_4,0xfffffffffffffffe);
    }
  }
  *(undefined ***)(param_1 + 0x18) = Proud::CFastArray<int,0>::vftable;
  if (*(longlong *)(param_1 + 0x28) != 0) {
    plVar1 = *(longlong **)(param_1 + 0x20);
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,*(longlong *)(param_1 + 0x28));
    }
  }
  FUN_1400031d0(param_1 + 8);
  FUN_1400031d0(param_1);
  return;
}



void FUN_14008c7d0(longlong param_1,longlong param_2)

{
  int iVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  longlong lVar4;
  undefined4 *puVar5;
  
  iVar1 = *(int *)(param_1 + 0x18);
  lVar4 = (longlong)iVar1;
  if (-1 < iVar1) {
    FUN_140021fb0(param_2,iVar1);
    puVar5 = (undefined4 *)0x0;
    puVar2 = puVar5;
    if (*(int *)(param_2 + 0x18) != 0) {
      puVar2 = *(undefined4 **)(param_2 + 0x10);
    }
    if (*(int *)(param_1 + 0x18) != 0) {
      puVar5 = *(undefined4 **)(param_1 + 0x10);
    }
    if (0 < iVar1) {
      puVar3 = puVar2;
      do {
        lVar4 = lVar4 + -1;
        *puVar3 = *(undefined4 *)(((longlong)puVar5 - (longlong)puVar2) + (longlong)puVar3);
        puVar3 = puVar3 + 1;
      } while (lVar4 != 0);
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



undefined8 FUN_14008c850(longlong param_1)

{
  if (*(int *)(param_1 + 0x18) == 0) {
    return 0;
  }
  return *(undefined8 *)(param_1 + 0x10);
}



int FUN_14008c860(longlong param_1,int param_2)

{
  uint uVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  
  iVar4 = *(int *)(param_1 + 0x24);
  if (iVar4 == 0) {
    iVar2 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
    iVar4 = 0x400;
    if (iVar2 < 0x400) {
      iVar4 = iVar2;
    }
    iVar2 = 4;
    if (4 < iVar4) {
      iVar2 = iVar4;
    }
    iVar4 = iVar2 + param_2;
    if (iVar2 + param_2 < *(int *)(param_1 + 0x20)) {
      iVar4 = *(int *)(param_1 + 0x20);
    }
    return iVar4;
  }
  if (iVar4 != 1) {
    if (iVar4 != 2) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (param_2 < *(int *)(param_1 + 0x20)) {
      param_2 = *(int *)(param_1 + 0x20);
    }
    return param_2;
  }
  uVar1 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
  uVar3 = 0x10;
  if (0x10 < (int)uVar1) {
    uVar3 = uVar1;
  }
  if (uVar3 < 0x11) {
    uVar3 = 0x10;
  }
  iVar4 = uVar3 + param_2;
  if ((int)(uVar3 + param_2) < *(int *)(param_1 + 0x20)) {
    iVar4 = *(int *)(param_1 + 0x20);
  }
  return iVar4;
}



void thunk_FUN_1400a3530(LPVOID param_1)

{
  HANDLE hHeap;
  
  hHeap = GetProcessHeap();
                    // WARNING: Could not recover jumptable at 0x0001400a354c. Too many branches
                    // WARNING: Treating indirect jump as call
  HeapFree(hHeap,0,param_1);
  return;
}



void FUN_14008c910(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x38);
  if (lVar1 != 0) {
    FUN_1400031d0(lVar1 + 0x58);
    FUN_140140df0(lVar1 + 0x28);
    FUN_1400031d0(lVar1 + 0x10);
    FUN_1400a3530(lVar1);
  }
  FUN_1400a1cd0(param_1);
  FUN_1400a3530(param_1);
  return;
}



void FUN_14008c980(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    FUN_1400a1c30(lVar1);
    *(longlong *)(*param_1 + 0x40) = *(longlong *)(*param_1 + 0x40) + -1;
    if (*(longlong *)(*param_1 + 0x40) == 0) {
      FUN_1400d1290(lVar1);
      FUN_14008c910(*param_1);
    }
    else {
      FUN_1400d1290(lVar1);
    }
  }
  return;
}



longlong * FUN_14008ca00(longlong *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  if (param_2 == 0) {
    *param_1 = 0;
  }
  else {
    lVar2 = FUN_1400a34c0(0x48);
    if (lVar2 != 0) {
      uVar1 = FUN_1401692e0();
      FUN_1400a1b50(lVar2,uVar1,1,param_4,uVar3);
    }
    *param_1 = lVar2;
    FUN_1400a1c30(lVar2);
    *(undefined8 *)(*param_1 + 0x40) = 1;
    *(longlong *)(*param_1 + 0x38) = param_2;
    FUN_1400d1290(lVar2);
  }
  return param_1;
}



undefined8 * FUN_14008caa0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<int,0>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14008cb00(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<int,0>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x00014008cb27. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



undefined8 * FUN_14008cb40(undefined8 *param_1)

{
  undefined4 uVar1;
  undefined8 *puVar2;
  void *pvVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  
  *param_1 = MagiAgentCommon::vftable;
  puVar2 = operator_new(0x28);
  puVar5 = (undefined8 *)0x0;
  DAT_140320150 = puVar5;
  if (puVar2 != (undefined8 *)0x0) {
    *puVar2 = MagiServerFile::vftable;
    puVar2[1] = 0;
    puVar2[2] = 0;
    puVar2[3] = 0;
    DAT_140320150 = puVar2;
  }
  pvVar3 = operator_new(0x1f8);
  puVar2 = puVar5;
  if (pvVar3 != (void *)0x0) {
    puVar2 = (undefined8 *)FUN_140083a30(pvVar3);
  }
  DAT_140320138 = puVar2;
  pvVar3 = operator_new(0x50);
  puVar2 = puVar5;
  if (pvVar3 != (void *)0x0) {
    puVar2 = (undefined8 *)FUN_14008a830(pvVar3);
  }
  DAT_140320118 = puVar2;
  puVar4 = operator_new(0x80);
  puVar2 = puVar5;
  if (puVar4 != (undefined8 *)0x0) {
    *puVar4 = MagiRealTimeEventData::vftable;
    FUN_140099f20(puVar4 + 1);
    uVar1 = FUN_1401692e0();
    FUN_1400a1b50(puVar4 + 9,uVar1,1);
    puVar2 = puVar4;
  }
  DAT_140320158 = puVar2;
  puVar2 = operator_new(0x78);
  if (puVar2 != (undefined8 *)0x0) {
    *puVar2 = MagiServerManager::vftable;
    puVar2[1] = 0;
    puVar2[2] = 0;
    puVar2[3] = 0;
    puVar2[4] = 0xf8;
    puVar2[5] = 0x20;
    puVar2[6] = 0x20;
    FUN_140099f20(puVar2 + 7);
    puVar5 = puVar2;
  }
  DAT_140320160 = puVar5;
  return param_1;
}



void * FUN_14008ccb0(void *param_1,uint param_2)

{
  FUN_14008cce0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14008cce0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  *param_1 = MagiAgentCommon::vftable;
  if (DAT_140320160 != (undefined8 *)0x0) {
    (**(code **)*DAT_140320160)(DAT_140320160,1,param_3,param_4,0xfffffffffffffffe);
  }
  if (DAT_140320138 != (undefined8 *)0x0) {
    (**(code **)*DAT_140320138)(DAT_140320138,1);
  }
  if (DAT_140320118 != (undefined8 *)0x0) {
    (**(code **)*DAT_140320118)(DAT_140320118,1);
  }
  if (DAT_140320158 != (undefined8 *)0x0) {
    (**(code **)*DAT_140320158)(DAT_140320158,1);
  }
  if (DAT_140320150 != (undefined8 *)0x0) {
    (**(code **)*DAT_140320150)(DAT_140320150,1);
  }
  *param_1 = MBISingleton<>::vftable;
  DAT_140320140 = 0;
  return;
}



undefined8 * FUN_14008cd90(undefined8 *param_1,byte param_2)

{
  DAT_140320140 = 0;
  *param_1 = MBISingleton<>::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14008cdd0(undefined8 *param_1)

{
  DAT_140320140 = 0;
  *param_1 = MBISingleton<>::vftable;
  return;
}



void FUN_14008cdf0(undefined8 *param_1)

{
  *param_1 = MagiAgentReceive::vftable;
  return;
}



void FUN_14008ce00(longlong param_1,undefined4 param_2)

{
  bool bVar1;
  
  switch(param_2) {
  case 1:
    *(undefined1 *)(param_1 + 8) = 1;
    return;
  case 2:
    *(undefined1 *)(param_1 + 9) = 1;
    return;
  default:
    return;
  case 5:
    *(undefined1 *)(param_1 + 10) = 1;
    return;
  case 6:
    *(undefined1 *)(param_1 + 0xb) = 1;
    return;
  case 7:
    break;
  case 8:
    *(undefined1 *)(param_1 + 0xc) = 1;
    return;
  case 0xd:
    if (*(char *)(param_1 + 0xd) == '\0') {
      *(undefined2 *)(param_1 + 0xd) = 1;
      return;
    }
    *(undefined2 *)(param_1 + 0xd) = 0x100;
    return;
  }
  bVar1 = *(char *)(DAT_140320138 + 0x171) == '\0';
  *(bool *)(DAT_140320138 + 0x171) = bVar1;
  if (!bVar1) {
                    // WARNING: Could not recover jumptable at 0x00014008ce62. Too many branches
                    // WARNING: Treating indirect jump as call
    printf("Auto Revive Off !!!\n");
    return;
  }
                    // WARNING: Could not recover jumptable at 0x00014008ce54. Too many branches
                    // WARNING: Treating indirect jump as call
  printf("Auto Revive On !!!\n");
  return;
}



undefined8 * FUN_14008cec0(undefined8 *param_1,uint param_2)

{
  *param_1 = MagiServerFile::vftable;
  FUN_14008cf20();
  DAT_140320150 = 0;
  *param_1 = MBISingleton<>::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14008cf20(longlong *param_1)

{
  longlong lVar1;
  ulonglong *puVar2;
  longlong lVar3;
  
  lVar3 = *param_1;
  if (lVar3 != 0) {
    lVar1 = param_1[1];
    if (lVar3 != lVar1) {
      puVar2 = (ulonglong *)(lVar3 + 0x20);
      do {
        if (7 < *puVar2) {
          operator_delete((void *)puVar2[-3]);
        }
        *puVar2 = 7;
        puVar2[-1] = 0;
        lVar3 = lVar3 + 0x30;
        *(undefined2 *)(puVar2 + -3) = 0;
        puVar2 = puVar2 + 6;
      } while (lVar3 != lVar1);
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



undefined8 * FUN_14008cfc0(undefined8 *param_1,byte param_2)

{
  DAT_140320150 = 0;
  *param_1 = MBISingleton<>::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_14008d000(undefined8 *param_1,uint param_2)

{
  *param_1 = MagiRealTimeEventData::vftable;
  FUN_1400a1cd0(param_1 + 9);
  if (param_1[1] != 0) {
    FUN_14008e450();
  }
  *param_1 = MBISingleton<>::vftable;
  DAT_140320158 = 0;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14008d080(longlong param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined4 *puVar6;
  undefined8 uVar7;
  undefined8 *puVar8;
  undefined8 *puVar9;
  undefined8 *puVar10;
  longlong lVar11;
  undefined1 uVar12;
  
  uVar7 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x48;
  lVar11 = lVar1;
  FUN_1400a1c30(lVar1);
  uVar12 = 1;
  if (*(longlong *)(param_1 + 0x28) == 0) {
    puVar8 = (undefined8 *)0x0;
  }
  else {
    puVar8 = *(undefined8 **)(param_1 + 0x38);
    if (puVar8 != (undefined8 *)0x0) {
      puVar10 = (undefined8 *)*puVar8;
      puVar9 = puVar8;
      puVar4 = puVar10;
      goto joined_r0x00014008d0f6;
    }
  }
  puVar10 = (undefined8 *)0x0;
  puVar9 = puVar8;
  puVar4 = puVar10;
joined_r0x00014008d0f6:
  do {
    if (puVar4 == (undefined8 *)0x0) {
      FUN_1400d1290(lVar1);
      return;
    }
    puVar2 = (undefined4 *)((longlong)puVar4 + 0xc);
    puVar6 = (undefined4 *)param_2[1];
    if ((puVar2 < puVar6) && (puVar3 = (undefined4 *)*param_2, puVar3 <= puVar2)) {
      if (puVar6 == (undefined4 *)param_2[2]) {
        FUN_14007a1d0(param_2,1,param_3,param_4,uVar7,puVar9,puVar10,lVar11,uVar12);
      }
      puVar6 = (undefined4 *)param_2[1];
      if (puVar6 != (undefined4 *)0x0) {
        uVar5 = *(undefined4 *)(*param_2 + ((longlong)puVar2 - (longlong)puVar3 >> 2) * 4);
LAB_14008d15f:
        *puVar6 = uVar5;
      }
    }
    else {
      if (puVar6 == (undefined4 *)param_2[2]) {
        FUN_14007a1d0(param_2,1,param_3,param_4,uVar7,puVar9,puVar10,lVar11,uVar12);
      }
      puVar6 = (undefined4 *)param_2[1];
      if (puVar6 != (undefined4 *)0x0) {
        uVar5 = *puVar2;
        goto LAB_14008d15f;
      }
    }
    param_2[1] = param_2[1] + 4;
    puVar4 = (undefined8 *)*puVar4;
    while (puVar4 == (undefined8 *)0x0) {
      puVar8 = puVar8 + 1;
      puVar4 = (undefined8 *)*puVar8;
    }
    if (puVar8 == puVar4) {
      puVar4 = (undefined8 *)0x0;
    }
  } while( true );
}



undefined8 * FUN_14008d1b0(undefined8 *param_1,byte param_2)

{
  DAT_140320158 = 0;
  *param_1 = MBISingleton<>::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14008d1f0(undefined8 *param_1)

{
  DAT_140320158 = 0;
  *param_1 = MBISingleton<>::vftable;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14008d210(longlong param_1,undefined8 param_2,undefined8 param_3,longlong *param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined1 auStack_158 [32];
  undefined8 local_138;
  int local_128;
  undefined4 local_124;
  undefined2 local_120;
  undefined6 uStack_11e;
  undefined8 local_110;
  ulonglong local_108;
  undefined2 local_f8;
  undefined6 uStack_f6;
  undefined8 local_e8;
  ulonglong local_e0;
  undefined1 local_c8 [4];
  int local_c4;
  undefined4 local_b8;
  undefined2 local_a0;
  undefined6 uStack_9e;
  undefined8 local_90;
  ulonglong local_88;
  undefined2 local_78;
  undefined6 uStack_76;
  undefined8 local_68;
  ulonglong local_60;
  undefined2 local_50;
  undefined6 uStack_4e;
  undefined8 local_40;
  ulonglong local_38;
  ulonglong local_28;
  
  local_138 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_158;
  lVar1 = param_4[1];
  lVar2 = *param_4;
  if (lVar2 == lVar1) {
    *(undefined1 *)(param_1 + 0x40) = 1;
  }
  else {
    do {
      FUN_14008d690(local_c8,lVar2);
      if (*(int *)(DAT_140320138 + 0x154) == local_c4) {
        FUN_140084120(DAT_140320138,local_c8);
      }
      else {
        local_108 = 7;
        local_110 = 0;
        local_120 = 0;
        local_e0 = 7;
        local_e8 = 0;
        local_f8 = 0;
        local_128 = local_c4;
        local_124 = local_b8;
        FUN_140001700(&local_f8,&local_a0,0,0xffffffffffffffff);
        FUN_140087680(DAT_140320138,&local_128);
        if (7 < local_e0) {
          operator_delete((void *)CONCAT62(uStack_f6,local_f8));
        }
        local_e0 = 7;
        local_e8 = 0;
        local_f8 = 0;
        if (7 < local_108) {
          operator_delete((void *)CONCAT62(uStack_11e,local_120));
        }
        local_108 = 7;
        local_110 = 0;
        local_120 = 0;
      }
      if (7 < local_38) {
        operator_delete((void *)CONCAT62(uStack_4e,local_50));
      }
      local_38 = 7;
      local_40 = 0;
      local_50 = 0;
      if (7 < local_60) {
        operator_delete((void *)CONCAT62(uStack_76,local_78));
      }
      local_60 = 7;
      local_68 = 0;
      local_78 = 0;
      if (7 < local_88) {
        operator_delete((void *)CONCAT62(uStack_9e,local_a0));
      }
      local_88 = 7;
      local_90 = 0;
      local_a0 = 0;
      lVar2 = lVar2 + 0xa0;
    } while (lVar2 != lVar1);
    *(undefined1 *)(param_1 + 0x40) = 1;
  }
  return 1;
}



undefined8 FUN_14008d3f0(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4)

{
  longlong *plVar1;
  
  if (*param_4 == 1) {
    *(undefined1 *)(param_1 + 0x40) = 1;
  }
  plVar1 = *(longlong **)(param_1 + 0x48);
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 8))(plVar1,*param_4);
  }
  return 1;
}



undefined8
FUN_14008d420(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
             longlong *param_5)

{
  undefined *puVar1;
  
  if (*(longlong *)(param_1 + 0x48) != 0) {
    puVar1 = (undefined *)*param_5;
    if ((undefined *)*param_5 == (undefined *)0x0) {
      puVar1 = PTR_DAT_1402f8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x10))
              (*(longlong **)(param_1 + 0x48),*param_4,puVar1);
  }
  return 1;
}



undefined8 FUN_14008d460(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined4 local_res8 [2];
  
  local_res8[0] = *param_4;
  FUN_1400a1c30(param_1 + 0x70);
  FUN_140076eb0(param_1 + 0x50,local_res8);
  FUN_1400d1290(param_1 + 0x70);
  return 1;
}



undefined8
FUN_14008d4c0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  if (*(longlong *)(param_1 + 0x48) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x38))
              (*(longlong **)(param_1 + 0x48),*param_4,*param_5,*param_6);
  }
  return 1;
}



undefined8 FUN_14008d500(longlong param_1,undefined8 param_2,undefined8 param_3,longlong *param_4)

{
  undefined *puVar1;
  
  if (*(longlong *)(param_1 + 0x48) != 0) {
    puVar1 = (undefined *)*param_4;
    if ((undefined *)*param_4 == (undefined *)0x0) {
      puVar1 = PTR_DAT_1402f8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x40))(*(longlong **)(param_1 + 0x48),puVar1);
  }
  return 1;
}



undefined8
FUN_14008d530(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5)

{
  if (*(longlong *)(param_1 + 0x48) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x48))
              (*(longlong **)(param_1 + 0x48),*param_4,*param_5);
  }
  return 1;
}



undefined8 FUN_14008d560(longlong param_1,undefined8 param_2,undefined8 param_3,longlong *param_4)

{
  undefined *puVar1;
  
  if (*(longlong *)(param_1 + 0x48) != 0) {
    puVar1 = (undefined *)*param_4;
    if ((undefined *)*param_4 == (undefined *)0x0) {
      puVar1 = PTR_DAT_1402f8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x50))(*(longlong **)(param_1 + 0x48),puVar1);
  }
  return 1;
}



undefined8
FUN_14008d590(longlong param_1,undefined8 param_2,undefined8 param_3,undefined1 *param_4,
             undefined4 *param_5,void *param_6)

{
  undefined1 local_118 [272];
  
  if (*(longlong *)(param_1 + 0x48) != 0) {
    memcpy(local_118,param_6,0x108);
    (**(code **)**(undefined8 **)(param_1 + 0x48))
              (*(undefined8 **)(param_1 + 0x48),*param_4,*param_5,local_118);
  }
  return 1;
}



void FUN_14008d600(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x90)) {
    operator_delete(*(void **)(param_1 + 0x78));
  }
  *(undefined8 *)(param_1 + 0x90) = 7;
  *(undefined8 *)(param_1 + 0x88) = 0;
  *(undefined2 *)(param_1 + 0x78) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x68)) {
    operator_delete(*(void **)(param_1 + 0x50));
  }
  *(undefined8 *)(param_1 + 0x68) = 7;
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined2 *)(param_1 + 0x50) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x40)) {
    operator_delete(*(void **)(param_1 + 0x28));
  }
  *(undefined8 *)(param_1 + 0x40) = 7;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined2 *)(param_1 + 0x28) = 0;
  return;
}



undefined4 * FUN_14008d690(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  *(undefined1 *)(param_1 + 3) = *(undefined1 *)(param_2 + 3);
  param_1[4] = param_2[4];
  param_1[5] = param_2[5];
  param_1[6] = param_2[6];
  param_1[7] = param_2[7];
  *(undefined1 *)(param_1 + 8) = *(undefined1 *)(param_2 + 8);
  *(undefined8 *)(param_1 + 0x10) = 7;
  *(undefined8 *)(param_1 + 0xe) = 0;
  *(undefined2 *)(param_1 + 10) = 0;
  FUN_140001700(param_1 + 10,param_2 + 10,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined8 *)(param_1 + 0x1a) = 7;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined2 *)(param_1 + 0x14) = 0;
  FUN_140001700(param_1 + 0x14,param_2 + 0x14,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x24) = 7;
  *(undefined8 *)(param_1 + 0x22) = 0;
  *(undefined2 *)(param_1 + 0x1e) = 0;
  FUN_140001700(param_1 + 0x1e,param_2 + 0x1e,0,0xffffffffffffffff);
  return param_1;
}



undefined8
FUN_14008d770(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
             longlong *param_5)

{
  undefined *puVar1;
  
  if (*(longlong *)(param_1 + 0x48) != 0) {
    puVar1 = (undefined *)*param_5;
    if ((undefined *)*param_5 == (undefined *)0x0) {
      puVar1 = PTR_DAT_1402f8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x58))
              (*(longlong **)(param_1 + 0x48),*param_4,puVar1);
  }
  return 1;
}



undefined8
FUN_14008d7b0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
             longlong *param_5)

{
  undefined *puVar1;
  
  if (*(longlong *)(param_1 + 0x48) != 0) {
    puVar1 = (undefined *)*param_5;
    if ((undefined *)*param_5 == (undefined *)0x0) {
      puVar1 = PTR_DAT_1402f8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x60))
              (*(longlong **)(param_1 + 0x48),*param_4,puVar1);
  }
  return 1;
}



undefined8
FUN_14008d7f0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
             longlong *param_5)

{
  undefined *puVar1;
  
  if (*(longlong *)(param_1 + 0x48) != 0) {
    puVar1 = (undefined *)*param_5;
    if ((undefined *)*param_5 == (undefined *)0x0) {
      puVar1 = PTR_DAT_1402f8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x68))
              (*(longlong **)(param_1 + 0x48),*param_4,puVar1);
  }
  return 1;
}



undefined8
FUN_14008d830(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
             longlong *param_5,undefined4 *param_6,undefined4 *param_7)

{
  undefined *puVar1;
  
  if (*(longlong *)(param_1 + 0x48) != 0) {
    puVar1 = (undefined *)*param_5;
    if ((undefined *)*param_5 == (undefined *)0x0) {
      puVar1 = PTR_DAT_1402f8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x70))
              (*(longlong **)(param_1 + 0x48),*param_4,puVar1,*param_6,*param_7);
  }
  return 1;
}



undefined8
FUN_14008d880(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,longlong *param_7)

{
  undefined *puVar1;
  
  if (*(longlong *)(param_1 + 0x48) != 0) {
    puVar1 = (undefined *)*param_7;
    if ((undefined *)*param_7 == (undefined *)0x0) {
      puVar1 = PTR_DAT_1402f8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x78))
              (*(longlong **)(param_1 + 0x48),*param_4,*param_5,*param_6,puVar1);
  }
  return 1;
}



undefined8 * FUN_14008d8d0(undefined8 *param_1,uint param_2)

{
  *param_1 = MagiServerManager::vftable;
  if (param_1[7] != 0) {
    FUN_14008e450();
  }
  FUN_14008dbc0(param_1 + 1);
  DAT_140320160 = 0;
  *param_1 = MBISingleton<>::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14008d940(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar2 = *param_1;
  if (lVar2 != 0) {
    lVar1 = param_1[1];
    for (; lVar2 != lVar1; lVar2 = lVar2 + 0xa0) {
      FUN_14008d600(lVar2);
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_14008d9a0(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0xa0;
  if (0x199999999999999U - param_2 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + param_2;
  uVar2 = (param_1[2] - *param_1) / 0xa0;
  if (uVar2 < uVar3) {
    if (0x199999999999999 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_14008da50(param_1,uVar2);
  }
  return;
}



void FUN_14008da50(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  code *pcVar2;
  char *pcVar3;
  longlong lVar4;
  longlong lVar5;
  char *local_res10;
  undefined8 uVar6;
  undefined **local_30 [3];
  
  uVar6 = 0xfffffffffffffffe;
  if (0x199999999999999 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar2 = (code *)swi(3);
    (*pcVar2)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0xa0) < param_2) {
    local_res10 = (char *)0x0;
    if ((param_2 != 0) && (local_res10 = operator_new(param_2 * 0xa0), local_res10 == (char *)0x0))
    {
      std::exception::exception((exception *)local_30,&local_res10);
      local_30[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_30,(ThrowInfo *)&DAT_1402f47a8);
    }
    pcVar3 = local_res10;
    FUN_14008dde0(*param_1,param_1[1],local_res10,param_4,uVar6);
    lVar1 = param_1[1];
    lVar5 = *param_1;
    lVar4 = lVar1 - lVar5;
    if (lVar5 != 0) {
      for (; lVar5 != lVar1; lVar5 = lVar5 + 0xa0) {
        FUN_14008d600(lVar5);
      }
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar3 + param_2 * 0xa0);
    param_1[1] = (longlong)(pcVar3 + (lVar4 / 0xa0) * 0xa0);
    *param_1 = (longlong)pcVar3;
  }
  return;
}



void FUN_14008dbc0(undefined8 *param_1)

{
  ulonglong *puVar1;
  ulonglong uVar2;
  ulonglong *puVar3;
  longlong lVar4;
  void *pvVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  ulonglong *puVar9;
  ulonglong *puVar10;
  void *local_68;
  longlong lStack_60;
  ulonglong *local_58;
  longlong lStack_50;
  
  if (param_1[1] != 0) {
    uVar2 = param_1[3];
    puVar10 = (ulonglong *)*param_1;
    uVar6 = uVar2;
    uVar8 = 8;
    do {
      uVar7 = uVar8;
      uVar8 = uVar6 % uVar7;
      uVar6 = uVar7;
    } while (uVar8 != 0);
    local_58 = (ulonglong *)param_1[1];
    lStack_50 = param_1[2];
    do {
      puVar3 = *(ulonglong **)(lStack_50 + -0x10 + (longlong)local_58);
      lVar4 = *(longlong *)(lStack_50 + -8 + (longlong)local_58);
      puVar1 = (ulonglong *)(lStack_50 + -0x10 + (longlong)local_58);
      if (local_58 != puVar1) {
        puVar9 = local_58 + 0x12;
        do {
          if (puVar9 + -0x12 == puVar10) {
            puVar10 = (ulonglong *)*puVar10;
          }
          else {
            if ((void *)puVar9[9] != (void *)0x0) {
              operator_delete((void *)puVar9[9]);
            }
            puVar9[9] = 0;
            puVar9[10] = 0;
            puVar9[0xb] = 0;
            if (7 < *puVar9) {
              operator_delete((void *)puVar9[-3]);
            }
            *puVar9 = 7;
            puVar9[-1] = 0;
            *(undefined2 *)(puVar9 + -3) = 0;
            if (7 < puVar9[-5]) {
              operator_delete((void *)puVar9[-8]);
            }
            puVar9[-5] = 7;
            puVar9[-6] = 0;
            *(undefined2 *)(puVar9 + -8) = 0;
            if (7 < puVar9[-10]) {
              operator_delete((void *)puVar9[-0xd]);
            }
            puVar9[-10] = 7;
            puVar9[-0xb] = 0;
            *(undefined2 *)(puVar9 + -0xd) = 0;
          }
          puVar9 = puVar9 + uVar2 / uVar7;
        } while (puVar9 + -0x12 != puVar1);
      }
      operator_delete__(local_58);
      local_58 = puVar3;
      lStack_50 = lVar4;
    } while (puVar3 != (ulonglong *)0x0);
    param_1[1] = 0;
  }
  lStack_60 = param_1[2];
  local_68 = (void *)param_1[1];
  if ((void *)param_1[1] != (void *)0x0) {
    do {
      pvVar5 = *(void **)(lStack_60 + -0x10 + (longlong)local_68);
      lStack_60 = *(longlong *)(lStack_60 + -8 + (longlong)local_68);
      operator_delete__(local_68);
      local_68 = pvVar5;
    } while (pvVar5 != (void *)0x0);
    param_1[1] = 0;
    *param_1 = 0;
    param_1[4] = param_1[5];
  }
  return;
}



longlong FUN_14008dde0(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0xa0) {
    if (param_3 != 0) {
      FUN_14008d690(param_3,param_1);
    }
    param_3 = param_3 + 0xa0;
  }
  return param_3;
}



undefined8 * FUN_14008de40(undefined8 *param_1,byte param_2)

{
  DAT_140320160 = 0;
  *param_1 = MBISingleton<>::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_14008de80(void *param_1,char *param_2,undefined4 param_3)

{
  char cVar1;
  undefined2 uVar2;
  undefined4 uVar3;
  int iVar4;
  void *pvVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  undefined4 extraout_var;
  longlong *plVar8;
  undefined8 *puVar9;
  char *pcVar10;
  undefined1 auStackY_228 [32];
  undefined8 local_1e8;
  undefined8 local_1e0;
  undefined1 local_1d8 [416];
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStackY_228;
  pvVar5 = operator_new(0xb0);
  puVar9 = (undefined8 *)0x0;
  puVar6 = puVar9;
  if (pvVar5 != (void *)0x0) {
    puVar6 = (undefined8 *)FUN_14008e250(pvVar5);
  }
  *(undefined8 **)((longlong)param_1 + 0x58) = puVar6;
  pvVar5 = operator_new(300000);
  *(void **)((longlong)param_1 + 0x10) = pvVar5;
  puVar6 = operator_new(0x58);
  if (puVar6 != (undefined8 *)0x0) {
    *puVar6 = 0;
    puVar6[1] = 0;
    puVar6[2] = 0;
    *(undefined4 *)(puVar6 + 3) = 0;
    InitializeCriticalSection((LPCRITICAL_SECTION)(puVar6 + 4));
    puVar9 = puVar6;
  }
  *(undefined8 **)((longlong)param_1 + 8) = puVar9;
  FUN_14008e4e0(puVar9);
  uVar7 = Ordinal_115(0x202,local_1d8);
  if ((int)uVar7 == 0) {
    plVar8 = (longlong *)((longlong)param_1 + 0x28);
    uVar7 = 0xffffffffffffffff;
    pcVar10 = param_2;
    do {
      if (uVar7 == 0) break;
      uVar7 = uVar7 - 1;
      cVar1 = *pcVar10;
      pcVar10 = pcVar10 + 1;
    } while (cVar1 != '\0');
    FUN_140003e60(plVar8,param_2,~uVar7 - 1);
    *(undefined4 *)((longlong)param_1 + 0x50) = param_3;
    uVar7 = Ordinal_23(2,1);
    *(ulonglong *)((longlong)param_1 + 0x20) = uVar7;
    if (uVar7 != 0xffffffffffffffff) {
      local_1e0 = 0;
      local_1e8 = 2;
      if (0xf < *(ulonglong *)((longlong)param_1 + 0x40)) {
        plVar8 = (longlong *)*plVar8;
      }
      uVar3 = Ordinal_11(plVar8);
      local_1e8 = CONCAT44(uVar3,(undefined4)local_1e8);
      uVar2 = Ordinal_15(*(undefined2 *)((longlong)param_1 + 0x50));
      local_1e8._0_4_ = CONCAT22(uVar2,(undefined2)local_1e8);
      uVar7 = Ordinal_4(*(undefined8 *)((longlong)param_1 + 0x20),&local_1e8,0x10);
      if ((int)uVar7 != -1) {
        _beginthreadex((void *)0x0,0,FUN_14008e690,param_1,0,(uint *)0x0);
        iVar4 = printf("API NETWORK INIT CLIENT : ADDRESS[%s] PORT[%u] \n");
        return CONCAT71((int7)(CONCAT44(extraout_var,iVar4) >> 8),1);
      }
    }
  }
  return uVar7 & 0xffffffffffffff00;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14008e050(longlong param_1)

{
  undefined2 uVar1;
  int iVar2;
  undefined4 uVar3;
  longlong *plVar4;
  undefined1 auStack_1e8 [32];
  undefined8 local_1c8;
  undefined8 local_1c0;
  undefined1 local_1b8 [416];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_1e8;
  iVar2 = Ordinal_115(0x202,local_1b8);
  if (iVar2 == 0) {
    plVar4 = (longlong *)(param_1 + 0x28);
    local_1c0 = 0;
    local_1c8 = 2;
    if (0xf < *(ulonglong *)(param_1 + 0x40)) {
      plVar4 = (longlong *)*plVar4;
    }
    uVar3 = Ordinal_11(plVar4);
    local_1c8 = CONCAT44(uVar3,(undefined4)local_1c8);
    uVar1 = Ordinal_15(*(undefined2 *)(param_1 + 0x50));
    local_1c8._0_4_ = CONCAT22(uVar1,(undefined2)local_1c8);
    Ordinal_4(*(undefined8 *)(param_1 + 0x20),&local_1c8,0x10);
  }
  else {
    printf("TW ReConnect Error\n");
  }
  return;
}



void FUN_14008e100(undefined8 *param_1)

{
  int iVar1;
  undefined8 *puVar2;
  void *_Dst;
  undefined1 *puVar3;
  int iVar4;
  uint uVar5;
  undefined2 local_res8;
  
  if ((param_1[1] != 0) && (0 < *(int *)(param_1[1] + 0x18))) {
    while( true ) {
      puVar2 = (undefined8 *)param_1[1];
      _Dst = (void *)param_1[2];
      EnterCriticalSection((LPCRITICAL_SECTION)(puVar2 + 4));
      if (*(int *)((longlong)puVar2 + 0x14) == 0) break;
      iVar4 = *(int *)(puVar2 + 1);
      iVar1 = *(int *)((longlong)puVar2 + 0xc);
      puVar3 = (undefined1 *)*puVar2;
      if (iVar1 == iVar4 + -1) {
        local_res8 = CONCAT11(*puVar3,puVar3[iVar1]);
      }
      else {
        local_res8 = *(ushort *)(puVar3 + iVar1);
      }
      iVar1 = *(int *)((longlong)puVar2 + 0xc);
      uVar5 = (uint)local_res8;
      if (iVar4 < (int)((uint)local_res8 + iVar1)) {
        iVar4 = iVar4 - iVar1;
        *(int *)((longlong)puVar2 + 0x4c) = iVar4;
        *(uint *)(puVar2 + 10) = uVar5 - iVar4;
        memcpy(_Dst,puVar3 + iVar1,(longlong)iVar4);
        memcpy((void *)((longlong)*(int *)((longlong)puVar2 + 0x4c) + (longlong)_Dst),
               (void *)*puVar2,(longlong)*(int *)(puVar2 + 10));
        *(undefined4 *)((longlong)puVar2 + 0xc) = *(undefined4 *)(puVar2 + 10);
      }
      else {
        memcpy(_Dst,puVar3 + iVar1,(ulonglong)local_res8);
        *(int *)((longlong)puVar2 + 0xc) = *(int *)((longlong)puVar2 + 0xc) + uVar5;
        iVar4 = *(int *)((longlong)puVar2 + 0xc);
        if (iVar4 == *(int *)(puVar2 + 1)) {
          iVar4 = 0;
        }
        *(int *)((longlong)puVar2 + 0xc) = iVar4;
      }
      *(int *)((longlong)puVar2 + 0x14) = *(int *)((longlong)puVar2 + 0x14) - uVar5;
      *(int *)(puVar2 + 3) = *(int *)(puVar2 + 3) + -1;
      LeaveCriticalSection((LPCRITICAL_SECTION)(puVar2 + 4));
      (**(code **)*param_1)(param_1,param_1[2]);
    }
    LeaveCriticalSection((LPCRITICAL_SECTION)(puVar2 + 4));
  }
  return;
}



undefined8 *
FUN_14008e250(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0x10;
  param_1[4] = 0x20;
  param_1[5] = 0x20;
  FUN_140099f20(param_1 + 6);
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0xe,uVar1,1,param_4,uVar2);
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14008e2d0(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_14008e450();
  }
  return;
}



void FUN_14008e2f0(undefined8 *param_1)

{
  ulonglong uVar1;
  undefined8 *puVar2;
  longlong lVar3;
  void *pvVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  undefined8 *puVar8;
  undefined8 *puVar9;
  void *local_48;
  longlong lStack_40;
  undefined8 *local_38;
  longlong lStack_30;
  
  if (param_1[1] != 0) {
    uVar1 = param_1[3];
    puVar9 = (undefined8 *)*param_1;
    uVar5 = uVar1;
    uVar7 = 8;
    do {
      uVar6 = uVar7;
      uVar7 = uVar5 % uVar6;
      uVar5 = uVar6;
    } while (uVar7 != 0);
    local_38 = (undefined8 *)param_1[1];
    lStack_30 = param_1[2];
    do {
      puVar2 = *(undefined8 **)(lStack_30 + -0x10 + (longlong)local_38);
      lVar3 = *(longlong *)(lStack_30 + -8 + (longlong)local_38);
      for (puVar8 = local_38; puVar8 != (undefined8 *)(lStack_30 + -0x10 + (longlong)local_38);
          puVar8 = puVar8 + uVar1 / uVar6) {
        if (puVar8 == puVar9) {
          puVar9 = (undefined8 *)*puVar9;
        }
      }
      operator_delete__(local_38);
      local_38 = puVar2;
      lStack_30 = lVar3;
    } while (puVar2 != (undefined8 *)0x0);
    param_1[1] = 0;
  }
  lStack_40 = param_1[2];
  local_48 = (void *)param_1[1];
  if ((void *)param_1[1] != (void *)0x0) {
    do {
      pvVar4 = *(void **)(lStack_40 + -0x10 + (longlong)local_48);
      lStack_40 = *(longlong *)(lStack_40 + -8 + (longlong)local_48);
      operator_delete__(local_48);
      local_48 = pvVar4;
    } while (pvVar4 != (void *)0x0);
    param_1[1] = 0;
    *param_1 = 0;
    param_1[4] = param_1[5];
  }
  return;
}



void FUN_14008e450(undefined8 *param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  
  puVar4 = (undefined8 *)*param_1;
  puVar1 = puVar4 + param_1[1];
  for (; puVar4 != puVar1; puVar4 = puVar4 + 1) {
    puVar2 = (undefined8 *)*puVar4;
    *puVar4 = 0;
    while (puVar2 != (undefined8 *)0x0) {
      puVar3 = (undefined8 *)*puVar2;
      operator_delete(puVar2);
      puVar2 = puVar3;
    }
  }
  operator_delete((void *)*param_1);
  *param_1 = 0;
  return;
}



void FUN_14008e4e0(undefined8 *param_1)

{
  void *pvVar1;
  
  EnterCriticalSection((LPCRITICAL_SECTION)(param_1 + 4));
  if ((void *)*param_1 != (void *)0x0) {
    operator_delete__((void *)*param_1);
    *param_1 = 0;
  }
  pvVar1 = operator_new(300000);
  param_1[1] = 300000;
  param_1[2] = 0;
  *(undefined4 *)(param_1 + 3) = 0;
  *param_1 = pvVar1;
                    // WARNING: Could not recover jumptable at 0x00014008e53e. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection((LPCRITICAL_SECTION)(param_1 + 4));
  return;
}



undefined8 FUN_14008e550(longlong *param_1,int *param_2)

{
  ushort uVar1;
  int iVar2;
  undefined8 uVar3;
  int iVar4;
  int iVar5;
  
  EnterCriticalSection((LPCRITICAL_SECTION)(param_1 + 4));
  iVar5 = *param_2;
  iVar4 = (int)param_1[1];
  uVar1 = *(ushort *)((longlong)param_2 + 2);
  *(int *)(param_1 + 9) = iVar5;
  if (iVar4 - *(int *)((longlong)param_1 + 0x14) < iVar5) {
    LeaveCriticalSection((LPCRITICAL_SECTION)(param_1 + 4));
    uVar3 = 0;
  }
  else {
    iVar2 = (int)param_1[2];
    if (iVar4 < iVar2 + iVar5) {
      iVar4 = iVar4 - iVar2;
      *(int *)((longlong)param_1 + 0x4c) = iVar4;
      *(int *)(param_1 + 10) = iVar5 - iVar4;
      memcpy((void *)((longlong)iVar2 + *param_1),param_2,(longlong)iVar4);
      memcpy((void *)*param_1,
             (void *)((longlong)*(int *)((longlong)param_1 + 0x4c) + (longlong)param_2),
             (longlong)(int)param_1[10]);
      *(int *)(param_1 + 2) = (int)param_1[10];
    }
    else {
      memcpy((void *)((longlong)iVar2 + *param_1),param_2,(longlong)iVar5);
      *(int *)(param_1 + 2) = (int)param_1[2] + (int)param_1[9];
      iVar5 = (int)param_1[2];
      if (iVar5 == (int)param_1[1]) {
        iVar5 = 0;
      }
      *(int *)(param_1 + 2) = iVar5;
    }
    *(int *)(param_1 + 3) = (int)param_1[3] + 1;
    iVar5 = (int)param_1[3];
    *(int *)((longlong)param_1 + 0x14) = *(int *)((longlong)param_1 + 0x14) + (int)param_1[9];
    if (uVar1 < 0x2329) {
      if (DAT_14031ff18 < iVar5) {
        DAT_14031ff18 = iVar5;
      }
      if (DAT_14031ff20 < *(int *)((longlong)param_1 + 0x14)) {
        DAT_14031ff20 = *(int *)((longlong)param_1 + 0x14);
      }
    }
    else {
      if (DAT_14031ff1c < iVar5) {
        DAT_14031ff1c = iVar5;
      }
      if (DAT_14031ff24 < *(int *)((longlong)param_1 + 0x14)) {
        DAT_14031ff24 = *(int *)((longlong)param_1 + 0x14);
      }
    }
    LeaveCriticalSection((LPCRITICAL_SECTION)(param_1 + 4));
    uVar3 = 1;
  }
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14008e690(longlong param_1)

{
  int iVar1;
  undefined1 auStack_428 [32];
  undefined4 local_408;
  undefined2 local_404;
  undefined1 local_402 [1002];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_428;
  local_408 = 0;
  local_404 = 0;
  memset(local_402,0,0x3e9);
  iVar1 = Ordinal_16(*(undefined8 *)(param_1 + 0x20),local_402,0x3e9,0);
  while (0 < iVar1) {
    local_404 = 1;
    local_408 = 0x80;
    FUN_14008e550(*(undefined8 *)(param_1 + 8));
    memset(&local_408,0,0x3f0);
    iVar1 = Ordinal_16(*(undefined8 *)(param_1 + 0x20),local_402,0x3e9,0);
  }
  printf("API SERVER - RECEIVE SOCKET ERROR [%d]\n");
  Ordinal_3(*(undefined8 *)(param_1 + 0x20));
  return 0;
}



void thunk_FUN_14008eb80(void)

{
  FUN_14008eb80();
  return;
}



void FUN_14008e7a0(ulonglong *param_1,ulonglong param_2)

{
  ulonglong uVar1;
  ulonglong uVar2;
  undefined2 *puVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  uVar1 = param_1[1];
  if ((param_2 < uVar1) && (uVar2 = *param_1, uVar2 <= param_2)) {
    if (uVar1 == param_1[2]) {
      FUN_14008eac0(param_1);
    }
    uVar1 = *param_1;
    puVar3 = (undefined2 *)param_1[1];
    if (puVar3 != (undefined2 *)0x0) {
      *(undefined8 *)(puVar3 + 0xc) = 7;
      *(undefined8 *)(puVar3 + 8) = 0;
      *puVar3 = 0;
      FUN_140001700(puVar3,uVar1 + ((longlong)(param_2 - uVar2) / 0x28) * 0x28,0,0xffffffffffffffff,
                    uVar4);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_14008eac0(param_1);
    }
    puVar3 = (undefined2 *)param_1[1];
    if (puVar3 != (undefined2 *)0x0) {
      *(undefined8 *)(puVar3 + 0xc) = 7;
      *(undefined8 *)(puVar3 + 8) = 0;
      *puVar3 = 0;
      FUN_140001700(puVar3,param_2,0,0xffffffffffffffff,uVar4);
    }
  }
  param_1[1] = param_1[1] + 0x28;
  return;
}



void FUN_14008e890(longlong *param_1)

{
  longlong lVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  
  lVar1 = param_1[1];
  if (*param_1 != lVar1) {
    puVar3 = (undefined8 *)FUN_14008f5d0(lVar1,lVar1);
    puVar2 = (undefined8 *)param_1[1];
    for (puVar4 = puVar3; puVar4 != puVar2; puVar4 = puVar4 + 5) {
      if (7 < (ulonglong)puVar4[3]) {
        operator_delete((void *)*puVar4);
      }
      puVar4[3] = 7;
      puVar4[2] = 0;
      *(undefined2 *)puVar4 = 0;
    }
    param_1[1] = (longlong)puVar3;
  }
  return;
}



void FUN_14008e920(ulonglong *param_1,ulonglong param_2)

{
  ulonglong uVar1;
  ulonglong uVar2;
  undefined1 *puVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  uVar1 = param_1[1];
  if ((param_2 < uVar1) && (uVar2 = *param_1, uVar2 <= param_2)) {
    if (uVar1 == param_1[2]) {
      FUN_14008ec10(param_1);
    }
    uVar1 = *param_1;
    puVar3 = (undefined1 *)param_1[1];
    if (puVar3 != (undefined1 *)0x0) {
      *(undefined8 *)(puVar3 + 0x18) = 0xf;
      *(undefined8 *)(puVar3 + 0x10) = 0;
      *puVar3 = 0;
      FUN_140003d50(puVar3,uVar1 + ((longlong)(param_2 - uVar2) / 0x28) * 0x28,0,0xffffffffffffffff,
                    uVar4);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_14008ec10(param_1);
    }
    puVar3 = (undefined1 *)param_1[1];
    if (puVar3 != (undefined1 *)0x0) {
      *(undefined8 *)(puVar3 + 0x18) = 0xf;
      *(undefined8 *)(puVar3 + 0x10) = 0;
      *puVar3 = 0;
      FUN_140003d50(puVar3,param_2,0,0xffffffffffffffff,uVar4);
    }
  }
  param_1[1] = param_1[1] + 0x28;
  return;
}



undefined * FUN_14008ea10(void)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  DAT_140320050 = 0;
  pvVar1 = operator_new(0x30);
  if (pvVar1 != (void *)0x0) {
    DAT_140320048 = pvVar1;
    *(void **)pvVar1 = pvVar1;
    *(void **)((longlong)DAT_140320048 + 8) = DAT_140320048;
    *(void **)((longlong)DAT_140320048 + 0x10) = DAT_140320048;
    *(undefined1 *)((longlong)DAT_140320048 + 0x28) = 1;
    *(undefined1 *)((longlong)DAT_140320048 + 0x29) = 1;
    return &DAT_140320040;
  }
  local_res8[0] = (char *)0x0;
  std::exception::exception((exception *)local_28,local_res8);
  local_28[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_28,(ThrowInfo *)&DAT_1402f47a8);
}



void FUN_14008eab0(void)

{
                    // WARNING: Could not recover jumptable at 0x00014008eab7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(DAT_140320048);
  return;
}



void FUN_14008eac0(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x28;
  if (0x666666666666665 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = (param_1[2] - *param_1) / 0x28;
  if (uVar2 < uVar3) {
    if (0x666666666666666 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_14008ed90(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_14008ed90(param_1,uVar2);
  }
  return;
}



void FUN_14008eb80(undefined8 *param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  puVar2 = (undefined8 *)*param_1;
  if (puVar2 != (undefined8 *)0x0) {
    puVar1 = (undefined8 *)param_1[1];
    for (; puVar2 != puVar1; puVar2 = puVar2 + 5) {
      if (7 < (ulonglong)puVar2[3]) {
        operator_delete((void *)*puVar2);
      }
      puVar2[3] = 7;
      puVar2[2] = 0;
      *(undefined2 *)puVar2 = 0;
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_14008ec10(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x28;
  if (0x666666666666665 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = (param_1[2] - *param_1) / 0x28;
  if (uVar2 < uVar3) {
    if (0x666666666666666 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_14008eef0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_14008eef0(param_1,uVar2);
  }
  return;
}



longlong * FUN_14008ecd0(longlong *param_1,longlong *param_2,longlong *param_3)

{
  char cVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong *local_res10;
  undefined1 local_res20 [8];
  
  if ((param_2 == (longlong *)*DAT_140320048) && (param_3 == DAT_140320048)) {
    FUN_14008f390();
    *param_1 = *DAT_140320048;
    return param_1;
  }
  while (param_2 != param_3) {
    local_res10 = param_2;
    if (*(char *)((longlong)param_2 + 0x29) == '\0') {
      local_res10 = (longlong *)param_2[2];
      if (*(char *)((longlong)local_res10 + 0x29) == '\0') {
        cVar1 = *(char *)(*local_res10 + 0x29);
        plVar2 = (longlong *)*local_res10;
        while (cVar1 == '\0') {
          cVar1 = *(char *)(*plVar2 + 0x29);
          local_res10 = plVar2;
          plVar2 = (longlong *)*plVar2;
        }
      }
      else {
        cVar1 = *(char *)(param_2[1] + 0x29);
        plVar3 = (longlong *)param_2[1];
        plVar2 = param_2;
        while ((local_res10 = plVar3, cVar1 == '\0' && (plVar2 == (longlong *)local_res10[2]))) {
          cVar1 = *(char *)(local_res10[1] + 0x29);
          plVar3 = (longlong *)local_res10[1];
          plVar2 = local_res10;
        }
      }
    }
    FUN_14008f040(local_res20,param_2);
    param_2 = local_res10;
  }
  *param_1 = (longlong)param_2;
  return param_1;
}



void FUN_14008ed90(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  longlong lVar2;
  code *pcVar3;
  longlong lVar4;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  if (0x666666666666666 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x28) < param_2) {
    lVar4 = FUN_14008f410(param_2);
    FUN_14008f6a0(*param_1,param_1[1],lVar4);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_14008ee90(lVar2,lVar1,lVar1 - lVar2,lVar1,uVar5);
      operator_delete((void *)*param_1);
    }
    param_1[2] = lVar4 + param_2 * 0x28;
    param_1[1] = lVar4 + ((lVar1 - lVar2) / 0x28) * 0x28;
    *param_1 = lVar4;
  }
  return;
}



void FUN_14008ee90(undefined8 *param_1,undefined8 *param_2)

{
  for (; param_1 != param_2; param_1 = param_1 + 5) {
    if (7 < (ulonglong)param_1[3]) {
      operator_delete((void *)*param_1);
    }
    param_1[3] = 7;
    param_1[2] = 0;
    *(undefined2 *)param_1 = 0;
  }
  return;
}



void FUN_14008eef0(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x666666666666666 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x28) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x28);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14008f720(*param_1,param_1[1],local_res10);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_14001c9c0(lVar2,lVar1,lVar1 - lVar2,lVar1,uVar5);
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x28);
    param_1[1] = (longlong)(pcVar4 + ((lVar1 - lVar2) / 0x28) * 0x28);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



undefined8 * FUN_14008f040(undefined8 *param_1,longlong *param_2)

{
  char cVar1;
  longlong *plVar2;
  code *pcVar3;
  longlong *plVar4;
  longlong lVar5;
  undefined8 *puVar6;
  longlong *plVar7;
  longlong *plVar8;
  longlong *plVar9;
  longlong *plVar10;
  
  if (*(char *)((longlong)param_2 + 0x29) != '\0') {
    std::_Xout_of_range("invalid map/set<T> iterator");
    pcVar3 = (code *)swi(3);
    puVar6 = (undefined8 *)(*pcVar3)();
    return puVar6;
  }
  plVar10 = (longlong *)param_2[2];
  plVar7 = param_2 + 2;
  if (*(char *)((longlong)plVar10 + 0x29) == '\0') {
    cVar1 = *(char *)(*plVar10 + 0x29);
    plVar8 = (longlong *)*plVar10;
    while (cVar1 == '\0') {
      cVar1 = *(char *)(*plVar8 + 0x29);
      plVar10 = plVar8;
      plVar8 = (longlong *)*plVar8;
    }
  }
  else {
    cVar1 = *(char *)(param_2[1] + 0x29);
    plVar9 = (longlong *)param_2[1];
    plVar8 = param_2;
    while ((plVar10 = plVar9, cVar1 == '\0' && (plVar8 == (longlong *)plVar10[2]))) {
      cVar1 = *(char *)(plVar10[1] + 0x29);
      plVar9 = (longlong *)plVar10[1];
      plVar8 = plVar10;
    }
  }
  plVar8 = (longlong *)*param_2;
  if (*(char *)((longlong)plVar8 + 0x29) == '\0') {
    plVar9 = plVar8;
    if ((*(char *)(*plVar7 + 0x29) == '\0') && (plVar9 = (longlong *)plVar10[2], plVar10 != param_2)
       ) {
      plVar8[1] = (longlong)plVar10;
      *plVar10 = *param_2;
      plVar8 = plVar10;
      if (plVar10 != (longlong *)*plVar7) {
        plVar8 = (longlong *)plVar10[1];
        if (*(char *)((longlong)plVar9 + 0x29) == '\0') {
          plVar9[1] = (longlong)plVar8;
        }
        *plVar8 = (longlong)plVar9;
        plVar10[2] = *plVar7;
        *(longlong **)(*plVar7 + 8) = plVar10;
      }
      if ((longlong *)DAT_140320048[1] == param_2) {
        DAT_140320048[1] = plVar10;
      }
      else {
        puVar6 = (undefined8 *)param_2[1];
        if ((longlong *)*puVar6 == param_2) {
          *puVar6 = plVar10;
        }
        else {
          puVar6[2] = plVar10;
        }
      }
      plVar10[1] = param_2[1];
      lVar5 = plVar10[5];
      *(char *)(plVar10 + 5) = (char)param_2[5];
      *(char *)(param_2 + 5) = (char)lVar5;
      goto LAB_14008f213;
    }
  }
  else {
    plVar9 = (longlong *)*plVar7;
  }
  plVar8 = (longlong *)param_2[1];
  if (*(char *)((longlong)plVar9 + 0x29) == '\0') {
    plVar9[1] = (longlong)plVar8;
  }
  if ((longlong *)DAT_140320048[1] == param_2) {
    DAT_140320048[1] = plVar9;
  }
  else if ((longlong *)*plVar8 == param_2) {
    *plVar8 = (longlong)plVar9;
  }
  else {
    plVar8[2] = (longlong)plVar9;
  }
  if ((longlong *)*DAT_140320048 == param_2) {
    plVar7 = plVar8;
    if (*(char *)((longlong)plVar9 + 0x29) == '\0') {
      cVar1 = *(char *)(*plVar9 + 0x29);
      plVar2 = (longlong *)*plVar9;
      plVar7 = plVar9;
      while (plVar4 = plVar2, cVar1 == '\0') {
        plVar2 = (longlong *)*plVar4;
        cVar1 = *(char *)((longlong)plVar2 + 0x29);
        plVar7 = plVar4;
      }
    }
    *DAT_140320048 = plVar7;
  }
  if ((longlong *)DAT_140320048[2] == param_2) {
    if (*(char *)((longlong)plVar9 + 0x29) == '\0') {
      cVar1 = *(char *)(plVar9[2] + 0x29);
      plVar7 = (longlong *)plVar9[2];
      plVar2 = plVar9;
      while (plVar4 = plVar7, cVar1 == '\0') {
        plVar7 = (longlong *)plVar4[2];
        cVar1 = *(char *)((longlong)plVar7 + 0x29);
        plVar2 = plVar4;
      }
      DAT_140320048[2] = plVar2;
    }
    else {
      DAT_140320048[2] = plVar8;
    }
  }
LAB_14008f213:
  if ((char)param_2[5] == '\x01') {
    if (plVar9 != (longlong *)DAT_140320048[1]) {
      do {
        plVar7 = plVar8;
        if ((char)plVar9[5] != '\x01') break;
        plVar8 = (longlong *)*plVar7;
        if (plVar9 == plVar8) {
          plVar8 = (longlong *)plVar7[2];
          if ((char)plVar8[5] == '\0') {
            *(undefined1 *)(plVar8 + 5) = 1;
            *(undefined1 *)(plVar7 + 5) = 0;
            FUN_14008f4e0(plVar7);
            plVar8 = (longlong *)plVar7[2];
          }
          if (*(char *)((longlong)plVar8 + 0x29) == '\0') {
            if ((*(char *)(*plVar8 + 0x28) != '\x01') || (*(char *)(plVar8[2] + 0x28) != '\x01')) {
              if (*(char *)(plVar8[2] + 0x28) == '\x01') {
                *(undefined1 *)(*plVar8 + 0x28) = 1;
                *(undefined1 *)(plVar8 + 5) = 0;
                FUN_14008f540();
                plVar8 = (longlong *)plVar7[2];
              }
              *(char *)(plVar8 + 5) = (char)plVar7[5];
              *(undefined1 *)(plVar7 + 5) = 1;
              *(undefined1 *)(plVar8[2] + 0x28) = 1;
              FUN_14008f4e0(plVar7);
              break;
            }
LAB_14008f2ed:
            *(undefined1 *)(plVar8 + 5) = 0;
          }
        }
        else {
          if ((char)plVar8[5] == '\0') {
            *(undefined1 *)(plVar8 + 5) = 1;
            *(undefined1 *)(plVar7 + 5) = 0;
            FUN_14008f540(plVar7);
            plVar8 = (longlong *)*plVar7;
          }
          if (*(char *)((longlong)plVar8 + 0x29) == '\0') {
            if ((*(char *)(plVar8[2] + 0x28) == '\x01') && (*(char *)(*plVar8 + 0x28) == '\x01'))
            goto LAB_14008f2ed;
            if (*(char *)(*plVar8 + 0x28) == '\x01') {
              *(undefined1 *)(plVar8[2] + 0x28) = 1;
              *(undefined1 *)(plVar8 + 5) = 0;
              FUN_14008f4e0();
              plVar8 = (longlong *)*plVar7;
            }
            *(char *)(plVar8 + 5) = (char)plVar7[5];
            *(undefined1 *)(plVar7 + 5) = 1;
            *(undefined1 *)(*plVar8 + 0x28) = 1;
            FUN_14008f540(plVar7);
            break;
          }
        }
        plVar8 = (longlong *)plVar7[1];
        plVar9 = plVar7;
      } while (plVar7 != (longlong *)DAT_140320048[1]);
    }
    *(undefined1 *)(plVar9 + 5) = 1;
  }
  operator_delete(param_2);
  if (DAT_140320050 != 0) {
    DAT_140320050 = DAT_140320050 + -1;
  }
  *param_1 = plVar10;
  return param_1;
}



void FUN_14008f390(void)

{
  char cVar1;
  longlong *plVar2;
  longlong *plVar3;
  
  cVar1 = *(char *)((longlong)*(longlong **)(DAT_140320048 + 8) + 0x29);
  plVar3 = *(longlong **)(DAT_140320048 + 8);
  while (cVar1 == '\0') {
    FUN_14008f480(&DAT_140320040,plVar3[2]);
    plVar2 = (longlong *)*plVar3;
    operator_delete(plVar3);
    plVar3 = plVar2;
    cVar1 = *(char *)((longlong)plVar2 + 0x29);
  }
  *(longlong *)(DAT_140320048 + 8) = DAT_140320048;
  *(longlong *)DAT_140320048 = DAT_140320048;
  *(longlong *)(DAT_140320048 + 0x10) = DAT_140320048;
  DAT_140320050 = 0;
  return;
}



void * FUN_14008f410(ulonglong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  if (param_1 == 0) {
    return (void *)0x0;
  }
  if ((param_1 < 0x666666666666667) &&
     (pvVar1 = operator_new(param_1 * 0x28), pvVar1 != (void *)0x0)) {
    return pvVar1;
  }
  local_res8[0] = (char *)0x0;
  std::exception::exception((exception *)local_28,local_res8);
  local_28[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_28,(ThrowInfo *)&DAT_1402f47a8);
}



void FUN_14008f480(undefined8 param_1,longlong *param_2)

{
  char cVar1;
  longlong *plVar2;
  
  cVar1 = *(char *)((longlong)param_2 + 0x29);
  while (cVar1 == '\0') {
    FUN_14008f480(param_1,param_2[2]);
    plVar2 = (longlong *)*param_2;
    operator_delete(param_2);
    param_2 = plVar2;
    cVar1 = *(char *)((longlong)plVar2 + 0x29);
  }
  return;
}



void FUN_14008f4e0(longlong param_1)

{
  longlong *plVar1;
  longlong *plVar2;
  
  plVar1 = *(longlong **)(param_1 + 0x10);
  *(longlong *)(param_1 + 0x10) = *plVar1;
  if (*(char *)(*plVar1 + 0x29) == '\0') {
    *(longlong *)(*plVar1 + 8) = param_1;
  }
  plVar1[1] = *(longlong *)(param_1 + 8);
  if (param_1 == *(longlong *)(DAT_140320048 + 8)) {
    *(longlong **)(DAT_140320048 + 8) = plVar1;
    *plVar1 = param_1;
    *(longlong **)(param_1 + 8) = plVar1;
    return;
  }
  plVar2 = *(longlong **)(param_1 + 8);
  if (param_1 == *plVar2) {
    *plVar2 = (longlong)plVar1;
    *plVar1 = param_1;
    *(longlong **)(param_1 + 8) = plVar1;
    return;
  }
  plVar2[2] = (longlong)plVar1;
  *plVar1 = param_1;
  *(longlong **)(param_1 + 8) = plVar1;
  return;
}



void FUN_14008f540(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *param_1;
  *param_1 = *(longlong *)(lVar1 + 0x10);
  if (*(char *)(*(longlong *)(lVar1 + 0x10) + 0x29) == '\0') {
    *(longlong **)(*(longlong *)(lVar1 + 0x10) + 8) = param_1;
  }
  *(longlong *)(lVar1 + 8) = param_1[1];
  if (param_1 == *(longlong **)(DAT_140320048 + 8)) {
    *(longlong *)(DAT_140320048 + 8) = lVar1;
    *(longlong **)(lVar1 + 0x10) = param_1;
    param_1[1] = lVar1;
    return;
  }
  plVar2 = (longlong *)param_1[1];
  if (param_1 == (longlong *)plVar2[2]) {
    plVar2[2] = lVar1;
    *(longlong **)(lVar1 + 0x10) = param_1;
    param_1[1] = lVar1;
    return;
  }
  *plVar2 = lVar1;
  *(longlong **)(lVar1 + 0x10) = param_1;
  param_1[1] = lVar1;
  return;
}



void FUN_14008f5a0(wchar_t *param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 local_res18;
  undefined8 local_res20;
  
  local_res18 = param_3;
  local_res20 = param_4;
  vswprintf_s(param_1,0x100,param_2,(va_list)&local_res18);
  return;
}



ulonglong * FUN_14008f5d0(ulonglong *param_1,ulonglong *param_2,ulonglong *param_3)

{
  ulonglong *puVar1;
  ulonglong *puVar2;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 3;
    do {
      puVar1 = puVar2 + -3;
      if (param_3 != puVar1) {
        if (7 < param_3[3]) {
          operator_delete((void *)*param_3);
        }
        param_3[3] = 7;
        param_3[2] = 0;
        *(undefined2 *)param_3 = 0;
        if (*puVar2 < 8) {
          memmove(param_3,puVar1,puVar2[-1] * 2 + 2);
        }
        else {
          *param_3 = *puVar1;
          *puVar1 = 0;
        }
        param_3[2] = puVar2[-1];
        param_3[3] = *puVar2;
        puVar2[-1] = 0;
        *puVar2 = 0;
      }
      param_3 = param_3 + 5;
      puVar1 = puVar2 + 2;
      puVar2 = puVar2 + 5;
    } while (puVar1 != param_2);
  }
  return param_3;
}



undefined2 * FUN_14008f6a0(longlong param_1,longlong param_2,undefined2 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x28) {
    if (param_3 != (undefined2 *)0x0) {
      *(undefined8 *)(param_3 + 0xc) = 7;
      *(undefined8 *)(param_3 + 8) = 0;
      *param_3 = 0;
      FUN_14008a320(param_3,param_1);
    }
    param_3 = param_3 + 0x14;
  }
  return param_3;
}



undefined1 * FUN_14008f720(longlong param_1,longlong param_2,undefined1 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x28) {
    if (param_3 != (undefined1 *)0x0) {
      *(undefined8 *)(param_3 + 0x18) = 0xf;
      *(undefined8 *)(param_3 + 0x10) = 0;
      *param_3 = 0;
      FUN_14001f3c0(param_3,param_1);
    }
    param_3 = param_3 + 0x28;
  }
  return param_3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14008f7a0(void)

{
  short sVar1;
  undefined4 uVar2;
  longlong *plVar3;
  longlong lVar4;
  uint uVar5;
  undefined4 uVar6;
  longlong lVar7;
  undefined4 *puVar9;
  short *psVar10;
  undefined4 *puVar11;
  undefined4 *puVar12;
  longlong lVar13;
  longlong *plVar14;
  ulonglong uVar15;
  short *psVar16;
  undefined1 auStack_98 [32];
  undefined8 local_78;
  undefined4 local_70;
  undefined4 local_6c;
  undefined2 local_68;
  undefined6 uStack_66;
  undefined8 local_58;
  ulonglong local_50;
  undefined4 local_40;
  undefined4 local_3c;
  ulonglong local_38;
  undefined4 *puVar8;
  
  local_78 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_98;
  lVar7 = FUN_1400989e0(DAT_140320130);
  DAT_140320688 = lVar7;
  if (lVar7 != 0) {
    puVar9 = (undefined4 *)0x0;
    if ((*(longlong *)(lVar7 + 0x70) != 0) && (*(uint *)(lVar7 + 0x78) != 0)) {
      plVar3 = *(longlong **)(lVar7 + 0x68);
      puVar8 = puVar9;
      plVar14 = plVar3;
      do {
        if (*plVar14 != 0) {
          puVar9 = (undefined4 *)plVar3[(longlong)puVar8];
          break;
        }
        uVar5 = (int)puVar8 + 1;
        puVar8 = (undefined4 *)(ulonglong)uVar5;
        plVar14 = plVar14 + 1;
      } while (uVar5 < *(uint *)(lVar7 + 0x78));
    }
LAB_14008f832:
    puVar8 = puVar9;
    lVar13 = DAT_140320688;
    if (puVar8 != (undefined4 *)0x0) {
      uVar2 = *puVar8;
      uVar6 = FUN_14009bbf0(DAT_140320688,L"nuseble");
      puVar9 = (undefined4 *)FUN_14009b510(lVar13,uVar2,uVar6,L"nuseble");
      lVar13 = DAT_140320688;
      uVar6 = FUN_14009bbf0(DAT_140320688,L"wszName");
      psVar10 = (short *)FUN_14009ba30(lVar13,uVar2,uVar6,L"wszName");
      lVar13 = DAT_140320688;
      uVar6 = FUN_14009bbf0(DAT_140320688,L"nPort");
      puVar11 = (undefined4 *)FUN_14009b510(lVar13,uVar2,uVar6,L"nPort");
      lVar13 = DAT_140320688;
      uVar6 = FUN_14009bbf0(DAT_140320688,L"nOrder");
      puVar12 = (undefined4 *)FUN_14009b510(lVar13,uVar2,uVar6,L"nOrder");
      local_50 = 7;
      local_58 = 0;
      local_68 = 0;
      uVar15 = 0xffffffffffffffff;
      psVar16 = psVar10;
      do {
        if (uVar15 == 0) break;
        uVar15 = uVar15 - 1;
        sVar1 = *psVar16;
        psVar16 = psVar16 + 1;
      } while (sVar1 != 0);
      local_70 = uVar2;
      FUN_140001b00(&local_68,psVar10,~uVar15 - 1);
      local_40 = *puVar11;
      local_6c = *puVar9;
      local_3c = *puVar12;
      FUN_14008ff70(&DAT_140320690);
      if (7 < local_50) {
        operator_delete((void *)CONCAT62(uStack_66,local_68));
      }
      puVar9 = *(undefined4 **)(puVar8 + 6);
      if (puVar9 == (undefined4 *)0x0) {
        uVar5 = (uint)puVar8[8] % *(uint *)(lVar7 + 0x78) + 1;
        lVar13 = (longlong)(int)uVar5 << 3;
        do {
          if (*(uint *)(lVar7 + 0x78) <= uVar5) break;
          lVar4 = *(longlong *)(lVar7 + 0x68);
          if (*(longlong *)(lVar13 + lVar4) != 0) {
            puVar9 = *(undefined4 **)(lVar13 + lVar4);
          }
          uVar5 = uVar5 + 1;
          lVar13 = lVar13 + 8;
        } while (puVar9 == (undefined4 *)0x0);
      }
      goto LAB_14008f832;
    }
  }
  return;
}



void FUN_14008f9e0(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x20)) {
    operator_delete(*(void **)(param_1 + 8));
  }
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined2 *)(param_1 + 8) = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_14008fa20(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetServerListDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_140320f6c & 1) == 0) {
    DAT_140320f6c = DAT_140320f6c | 1;
    _DAT_140320690 = 0;
    _DAT_140320698 = 0;
    _DAT_1403206a0 = 0;
    FUN_14008f7a0();
    atexit((_func_5014 *)&LAB_1402025f0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1401e4580(DAT_140320100,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetServerListDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_140320688;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14008fad0(void)

{
  short sVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  uint uVar7;
  undefined4 uVar8;
  undefined4 *puVar10;
  short *psVar11;
  longlong lVar12;
  longlong *plVar13;
  ulonglong uVar14;
  short *psVar15;
  undefined1 auStack_f8 [32];
  undefined4 *local_d8;
  longlong *local_d0;
  undefined4 *local_c8;
  undefined4 *local_c0;
  undefined8 local_b8;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined2 local_90;
  undefined6 uStack_8e;
  undefined8 local_80;
  ulonglong local_78;
  undefined4 local_68;
  ulonglong local_58;
  undefined4 *puVar9;
  
  local_b8 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_f8;
  DAT_140320660 = FUN_1400989e0(DAT_140320130);
  if (DAT_140320660 != 0) {
    local_d0 = (longlong *)(DAT_140320660 + 0x68);
    puVar10 = (undefined4 *)0x0;
    if ((*(longlong *)(DAT_140320660 + 0x70) != 0) && (*(uint *)(DAT_140320660 + 0x78) != 0)) {
      puVar9 = puVar10;
      plVar13 = (longlong *)*local_d0;
      do {
        if (*plVar13 != 0) {
          puVar10 = (undefined4 *)((longlong *)*local_d0)[(longlong)puVar9];
          break;
        }
        uVar7 = (int)puVar9 + 1;
        puVar9 = (undefined4 *)(ulonglong)uVar7;
        plVar13 = plVar13 + 1;
      } while (uVar7 < *(uint *)(DAT_140320660 + 0x78));
    }
LAB_14008fb76:
    lVar12 = DAT_140320660;
    if (puVar10 != (undefined4 *)0x0) {
      uVar2 = *puVar10;
      local_d8 = puVar10;
      uVar8 = FUN_14009bbf0(DAT_140320660,L"nChannelType");
      puVar10 = (undefined4 *)FUN_14009b510(lVar12,uVar2,uVar8,L"nChannelType");
      lVar12 = DAT_140320660;
      uVar3 = *puVar10;
      uVar8 = FUN_14009bbf0(DAT_140320660,L"nChannelGroup");
      puVar10 = (undefined4 *)FUN_14009b510(lVar12,uVar2,uVar8,L"nChannelGroup");
      lVar12 = DAT_140320660;
      uVar4 = *puVar10;
      uVar8 = FUN_14009bbf0(DAT_140320660,L"nLevelMin");
      puVar10 = (undefined4 *)FUN_14009b510(lVar12,uVar2,uVar8,L"nLevelMin");
      lVar12 = DAT_140320660;
      uVar5 = *puVar10;
      uVar8 = FUN_14009bbf0(DAT_140320660,L"nLevelMax");
      puVar10 = (undefined4 *)FUN_14009b510(lVar12,uVar2,uVar8,L"nLevelMax");
      lVar12 = DAT_140320660;
      uVar6 = *puVar10;
      uVar8 = FUN_14009bbf0(DAT_140320660,L"wszMainChannelName");
      psVar11 = (short *)FUN_14009ba30(lVar12,uVar2,uVar8,L"wszMainChannelName");
      lVar12 = DAT_140320660;
      uVar8 = FUN_14009bbf0(DAT_140320660,L"fBonusFactor");
      puVar10 = (undefined4 *)FUN_14009b6a0(lVar12,uVar2,uVar8);
      uVar8 = *puVar10;
      wprintf(L"Channel %d-%d : Name [ %s ]\n");
      local_78 = 7;
      local_80 = 0;
      local_90 = 0;
      local_68 = 0;
      uVar14 = 0xffffffffffffffff;
      psVar15 = psVar11;
      do {
        if (uVar14 == 0) break;
        uVar14 = uVar14 - 1;
        sVar1 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar1 != 0);
      local_a8 = uVar2;
      local_a4 = uVar3;
      local_a0 = uVar4;
      local_9c = uVar5;
      local_98 = uVar6;
      FUN_140001b00(&local_90,psVar11,~uVar14 - 1);
      local_68 = uVar8;
      if ((&local_a8 < DAT_140320670) && (DAT_140320668 <= &local_a8)) {
        if (DAT_140320670 == DAT_140320678) {
          FUN_140090220(&DAT_140320668);
        }
        local_c0 = DAT_140320670;
        local_c8 = DAT_140320670;
        if (DAT_140320670 != (undefined4 *)0x0) {
          FUN_1400906e0(DAT_140320670);
        }
      }
      else {
        if (DAT_140320670 == DAT_140320678) {
          FUN_140090220(&DAT_140320668);
        }
        puVar10 = DAT_140320670;
        local_c8 = DAT_140320670;
        local_c0 = DAT_140320670;
        if (DAT_140320670 != (undefined4 *)0x0) {
          *DAT_140320670 = local_a8;
          puVar10[1] = local_a4;
          puVar10[2] = local_a0;
          puVar10[3] = local_9c;
          puVar10[4] = local_98;
          *(undefined8 *)(puVar10 + 0xc) = 7;
          *(undefined8 *)(puVar10 + 10) = 0;
          *(undefined2 *)(puVar10 + 6) = 0;
          FUN_140001700(puVar10 + 6,&local_90,0,0xffffffffffffffff);
          puVar10[0x10] = local_68;
        }
      }
      DAT_140320670 = DAT_140320670 + 0x12;
      if (7 < local_78) {
        operator_delete((void *)CONCAT62(uStack_8e,local_90));
      }
      puVar10 = *(undefined4 **)(local_d8 + 6);
      if (puVar10 == (undefined4 *)0x0) {
        uVar7 = (uint)local_d8[8] % *(uint *)(local_d0 + 2) + 1;
        lVar12 = (longlong)(int)uVar7 << 3;
        do {
          if (*(uint *)(local_d0 + 2) <= uVar7) break;
          if (*(longlong *)(*local_d0 + lVar12) != 0) {
            puVar10 = *(undefined4 **)(*local_d0 + lVar12);
          }
          uVar7 = uVar7 + 1;
          lVar12 = lVar12 + 8;
        } while (puVar10 == (undefined4 *)0x0);
      }
      goto LAB_14008fb76;
    }
  }
  return;
}



undefined8 * FUN_14008feb0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetChannelListDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_140320f68 & 1) == 0) {
    DAT_140320f68 = DAT_140320f68 | 1;
    DAT_140320668 = 0;
    DAT_140320670 = 0;
    DAT_140320678 = 0;
    FUN_14008fad0();
    atexit((_func_5014 *)&LAB_140202600);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1401e4580(DAT_140320100,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetChannelListDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_140320660;
}



void thunk_FUN_140090180(longlong *param_1)

{
  longlong lVar1;
  ulonglong *puVar2;
  longlong lVar3;
  
  lVar3 = *param_1;
  if (lVar3 != 0) {
    lVar1 = param_1[1];
    if (lVar3 != lVar1) {
      puVar2 = (ulonglong *)(lVar3 + 0x20);
      do {
        if (7 < *puVar2) {
          operator_delete((void *)puVar2[-3]);
        }
        *puVar2 = 7;
        puVar2[-1] = 0;
        lVar3 = lVar3 + 0x38;
        *(undefined2 *)(puVar2 + -3) = 0;
        puVar2 = puVar2 + 7;
      } while (lVar3 != lVar1);
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_14008ff70(longlong *param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  puVar1 = (undefined4 *)param_1[1];
  if ((param_2 < puVar1) && (puVar2 = (undefined4 *)*param_1, puVar2 <= param_2)) {
    if (puVar1 == (undefined4 *)param_1[2]) {
      FUN_1400900c0(param_1);
    }
    puVar2 = (undefined4 *)((((longlong)param_2 - (longlong)puVar2) / 0x38) * 0x38 + *param_1);
    puVar1 = (undefined4 *)param_1[1];
    if (puVar1 != (undefined4 *)0x0) {
      *puVar1 = *puVar2;
      puVar1[1] = puVar2[1];
      *(undefined8 *)(puVar1 + 8) = 7;
      *(undefined8 *)(puVar1 + 6) = 0;
      *(undefined2 *)(puVar1 + 2) = 0;
      FUN_140001700(puVar1 + 2,puVar2 + 2,0,0xffffffffffffffff,uVar3);
      puVar1[0xc] = puVar2[0xc];
      puVar1[0xd] = puVar2[0xd];
    }
  }
  else {
    if (puVar1 == (undefined4 *)param_1[2]) {
      FUN_1400900c0(param_1);
    }
    puVar1 = (undefined4 *)param_1[1];
    if (puVar1 != (undefined4 *)0x0) {
      *puVar1 = *param_2;
      puVar1[1] = param_2[1];
      *(undefined8 *)(puVar1 + 8) = 7;
      *(undefined8 *)(puVar1 + 6) = 0;
      *(undefined2 *)(puVar1 + 2) = 0;
      FUN_140001700(puVar1 + 2,param_2 + 2,0,0xffffffffffffffff,uVar3);
      puVar1[0xc] = param_2[0xc];
      puVar1[0xd] = param_2[0xd];
    }
  }
  param_1[1] = param_1[1] + 0x38;
  return;
}



void thunk_FUN_1400902e0(longlong *param_1)

{
  longlong lVar1;
  ulonglong *puVar2;
  longlong lVar3;
  
  lVar3 = *param_1;
  if (lVar3 != 0) {
    lVar1 = param_1[1];
    if (lVar3 != lVar1) {
      puVar2 = (ulonglong *)(lVar3 + 0x30);
      do {
        if (7 < *puVar2) {
          operator_delete((void *)puVar2[-3]);
        }
        *puVar2 = 7;
        puVar2[-1] = 0;
        lVar3 = lVar3 + 0x48;
        *(undefined2 *)(puVar2 + -3) = 0;
        puVar2 = puVar2 + 9;
      } while (lVar3 != lVar1);
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_1400900c0(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x38;
  if (0x492492492492491 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = (param_1[2] - *param_1) / 0x38;
  if (uVar2 < uVar3) {
    if (0x492492492492492 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_140090380(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140090380(param_1,uVar2);
  }
  return;
}



void FUN_140090180(longlong *param_1)

{
  longlong lVar1;
  ulonglong *puVar2;
  longlong lVar3;
  
  lVar3 = *param_1;
  if (lVar3 != 0) {
    lVar1 = param_1[1];
    if (lVar3 != lVar1) {
      puVar2 = (ulonglong *)(lVar3 + 0x20);
      do {
        if (7 < *puVar2) {
          operator_delete((void *)puVar2[-3]);
        }
        *puVar2 = 7;
        puVar2[-1] = 0;
        lVar3 = lVar3 + 0x38;
        *(undefined2 *)(puVar2 + -3) = 0;
        puVar2 = puVar2 + 7;
      } while (lVar3 != lVar1);
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_140090220(longlong *param_1)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = param_1[1] - *param_1;
  lVar2 = lVar2 / 0x12 + (lVar2 >> 0x3f);
  uVar4 = (lVar2 >> 2) - (lVar2 >> 0x3f);
  if (0x38e38e38e38e38d < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + 1;
  uVar3 = (param_1[2] - *param_1) / 0x48;
  if (uVar3 < uVar4) {
    if (0x38e38e38e38e38e - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
      if (uVar4 != 0) {
        uVar3 = uVar4;
      }
      FUN_140090530(param_1,uVar3);
      return;
    }
    uVar3 = uVar3 + (uVar3 >> 1);
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_140090530(param_1,uVar3);
  }
  return;
}



void FUN_1400902e0(longlong *param_1)

{
  longlong lVar1;
  ulonglong *puVar2;
  longlong lVar3;
  
  lVar3 = *param_1;
  if (lVar3 != 0) {
    lVar1 = param_1[1];
    if (lVar3 != lVar1) {
      puVar2 = (ulonglong *)(lVar3 + 0x30);
      do {
        if (7 < *puVar2) {
          operator_delete((void *)puVar2[-3]);
        }
        *puVar2 = 7;
        puVar2[-1] = 0;
        lVar3 = lVar3 + 0x48;
        *(undefined2 *)(puVar2 + -3) = 0;
        puVar2 = puVar2 + 9;
      } while (lVar3 != lVar1);
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_140090380(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0x492492492492492 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x38) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x38);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_140090750(*param_1,param_1[1],local_res10);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_1400904d0(lVar2,lVar1,lVar1 - lVar2,lVar1,uVar5);
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x38);
    param_1[1] = (longlong)(pcVar4 + ((lVar1 - lVar2) / 0x38) * 0x38);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



void FUN_1400904d0(ulonglong *param_1,ulonglong *param_2)

{
  ulonglong *puVar1;
  ulonglong *puVar2;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 4;
    do {
      if (7 < *puVar2) {
        operator_delete((void *)puVar2[-3]);
      }
      *puVar2 = 7;
      puVar2[-1] = 0;
      *(undefined2 *)(puVar2 + -3) = 0;
      puVar1 = puVar2 + 3;
      puVar2 = puVar2 + 7;
    } while (puVar1 != param_2);
  }
  return;
}



void FUN_140090530(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  longlong lVar5;
  longlong lVar6;
  char *local_res10;
  undefined8 uVar7;
  undefined **local_20 [3];
  
  uVar7 = 0xfffffffffffffffe;
  if (0x38e38e38e38e38e < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x48) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x48);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_1400907f0(*param_1,param_1[1],local_res10);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    lVar6 = lVar1 - lVar2;
    lVar5 = lVar6 / 0x12 + (lVar6 >> 0x3f);
    if (lVar2 != 0) {
      FUN_140090680(lVar2,lVar1,lVar6,lVar1,uVar7);
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x48);
    param_1[1] = (longlong)(pcVar4 + ((lVar5 >> 2) - (lVar5 >> 0x3f)) * 0x48);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



void FUN_140090680(ulonglong *param_1,ulonglong *param_2)

{
  ulonglong *puVar1;
  ulonglong *puVar2;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 6;
    do {
      if (7 < *puVar2) {
        operator_delete((void *)puVar2[-3]);
      }
      *puVar2 = 7;
      puVar2[-1] = 0;
      *(undefined2 *)(puVar2 + -3) = 0;
      puVar1 = puVar2 + 3;
      puVar2 = puVar2 + 9;
    } while (puVar1 != param_2);
  }
  return;
}



undefined4 * FUN_1400906e0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  param_1[3] = param_2[3];
  param_1[4] = param_2[4];
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 10) = 0;
  *(undefined2 *)(param_1 + 6) = 0;
  FUN_140001700(param_1 + 6,param_2 + 6,0,0xffffffffffffffff);
  param_1[0x10] = param_2[0x10];
  return param_1;
}



undefined4 * FUN_140090750(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  for (; param_1 != param_2; param_1 = param_1 + 0xe) {
    if (param_3 != (undefined4 *)0x0) {
      *param_3 = *param_1;
      param_3[1] = param_1[1];
      *(undefined8 *)(param_3 + 8) = 7;
      *(undefined8 *)(param_3 + 6) = 0;
      *(undefined2 *)(param_3 + 2) = 0;
      FUN_140001700(param_3 + 2,param_1 + 2,0,0xffffffffffffffff,uVar1);
      param_3[0xc] = param_1[0xc];
      param_3[0xd] = param_1[0xd];
    }
    param_3 = param_3 + 0xe;
  }
  return param_3;
}



undefined4 * FUN_1400907f0(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  for (; param_1 != param_2; param_1 = param_1 + 0x12) {
    if (param_3 != (undefined4 *)0x0) {
      *param_3 = *param_1;
      param_3[1] = param_1[1];
      param_3[2] = param_1[2];
      param_3[3] = param_1[3];
      param_3[4] = param_1[4];
      *(undefined8 *)(param_3 + 0xc) = 7;
      *(undefined8 *)(param_3 + 10) = 0;
      *(undefined2 *)(param_3 + 6) = 0;
      FUN_140001700(param_3 + 6,param_1 + 6,0,0xffffffffffffffff,uVar1);
      param_3[0x10] = param_1[0x10];
    }
    param_3 = param_3 + 0x12;
  }
  return param_3;
}



void FUN_1400908a0(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x30)) {
    operator_delete(*(void **)(param_1 + 0x18));
  }
  *(undefined8 *)(param_1 + 0x30) = 7;
  *(undefined8 *)(param_1 + 0x28) = 0;
  *(undefined2 *)(param_1 + 0x18) = 0;
  return;
}



// WARNING: Removing unreachable block (ram,0x000140090ae2)
// WARNING: Removing unreachable block (ram,0x000140090aeb)
// WARNING: Removing unreachable block (ram,0x000140090b0c)
// WARNING: Removing unreachable block (ram,0x000140090b15)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * FUN_1400908e0(void)

{
  undefined4 *puVar1;
  
  _DAT_1403206b0 = 0;
  _DAT_1403206b4 = 0x100;
  _DAT_1403206bc = 0;
  _DAT_1403206c0 = 0x1000001;
  DAT_1403206cc = 0;
  _DAT_1403206d0 = 0;
  _DAT_1403206d8 = 0;
  DAT_1403206da = 0;
  DAT_1403206dc = 0x17;
  _DAT_1403206e0 = 3000;
  _DAT_1403206e4 = 65000;
  _DAT_1403206e8 = 0;
  _DAT_1403206f0 = 0;
  DAT_1403206f8 = 1000;
  DAT_1403206fc = 1000;
  DAT_140320700 = 200;
  DAT_140320704 = 300;
  _DAT_140320708 = 3;
  _DAT_14032070c = 1;
  _DAT_140320714 = 0;
  _DAT_14032071c = 0;
  DAT_140320720 = 0;
  _DAT_140320728 = 0;
  _DAT_140320730 = 0;
  _DAT_140320740 = 0;
  _DAT_140320748 = 0;
  _eh_vector_constructor_iterator_
            (&DAT_140320750,0x38,4,(_func_void_void_ptr *)&LAB_140095c40,FUN_140090c00);
  puVar1 = &DAT_140320830;
  _eh_vector_constructor_iterator_
            (&DAT_140320830,0x38,8,(_func_void_void_ptr *)&LAB_140095c40,FUN_140090c00);
  _eh_vector_constructor_iterator_
            (&DAT_1403209f0,0x30,0x19,(_func_void_void_ptr *)&LAB_140095c20,FUN_140090c40);
  _DAT_140320ea0 = 0;
  _DAT_140320ea8 = 0;
  _DAT_140320eb0 = 0x11;
  _DAT_140320ed0 = 0;
  _DAT_140320ed4 = 10;
  _DAT_140320ed8 = 0;
  _DAT_140320ee0 = 0;
  _DAT_140320eb4 = 0x3f400000;
  _DAT_140320eb8 = 0x3e800000;
  _DAT_140320ebc = 0x40100000;
  _DAT_140320ec0 = 0x26;
  _DAT_140320ec8 = 0;
  _DAT_140320ee8 = 0;
  _DAT_140320eec = 0;
  _DAT_140320ef0 = 0;
  _DAT_140320ef4 = 0;
  FUN_140094940(&DAT_140320ef8);
  FUN_140094940(&DAT_140320f18);
  _DAT_140320f48 = 0;
  _DAT_140320f4c = 10;
  _DAT_140320f50 = 50000;
  do {
    *puVar1 = 0;
    puVar1 = puVar1 + 0x1c;
  } while ((longlong)puVar1 < 0x1403209f0);
  puVar1 = &DAT_140320868;
  do {
    *puVar1 = 0;
    puVar1 = puVar1 + 0x1c;
  } while ((longlong)puVar1 < 0x140320a28);
  _DAT_140320f38 = 0x3f8000003f800000;
  _DAT_140320f40 = 0x3f8000003f800000;
  FUN_1400910f0(&DAT_1403206b0);
  return &DAT_1403206b0;
}



void FUN_140090c00(longlong param_1)

{
  if (0xf < *(ulonglong *)(param_1 + 0x28)) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x28) = 0xf;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined1 *)(param_1 + 0x10) = 0;
  return;
}



void FUN_140090c40(longlong param_1)

{
  if (0xf < *(ulonglong *)(param_1 + 0x20)) {
    operator_delete(*(void **)(param_1 + 8));
  }
  *(undefined8 *)(param_1 + 0x20) = 0xf;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined1 *)(param_1 + 8) = 0;
  return;
}



void thunk_FUN_1400950d0(void)

{
  FUN_1400950d0();
  return;
}



void FUN_140090c90(longlong param_1)

{
  undefined1 local_res10 [24];
  
  FUN_140094a30(param_1,local_res10,**(undefined8 **)(param_1 + 8),*(undefined8 **)(param_1 + 8),
                0xfffffffffffffffe);
                    // WARNING: Could not recover jumptable at 0x000140090cc4. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_1 + 8));
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140090cd0(void)

{
  undefined1 local_res18 [16];
  
  FUN_140094a30(&DAT_140320f18,local_res18,*DAT_140320f20,DAT_140320f20,0xfffffffffffffffe);
  operator_delete(DAT_140320f20);
  FUN_140094a30(&DAT_140320ef8,local_res18,*DAT_140320f00,DAT_140320f00);
  operator_delete(DAT_140320f00);
  FUN_1400950d0(&DAT_140320ea0);
  _eh_vector_destructor_iterator_(&DAT_1403209f0,0x30,0x19,FUN_140090c40);
  _eh_vector_destructor_iterator_(&DAT_140320830,0x38,8,FUN_140090c00);
  _eh_vector_destructor_iterator_(&DAT_140320750,0x38,4,FUN_140090c00);
  if (DAT_140320720 != (void *)0x0) {
    operator_delete(DAT_140320720);
  }
  DAT_140320720 = (void *)0x0;
  _DAT_140320728 = 0;
  _DAT_140320730 = 0;
  return;
}



void FUN_140090de0(longlong param_1)

{
  if (0xf < *(ulonglong *)(param_1 + 0x48)) {
    operator_delete(*(void **)(param_1 + 0x30));
  }
  *(undefined8 *)(param_1 + 0x48) = 0xf;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined1 *)(param_1 + 0x30) = 0;
  if (0xf < *(ulonglong *)(param_1 + 0x20)) {
    operator_delete(*(void **)(param_1 + 8));
  }
  *(undefined8 *)(param_1 + 0x20) = 0xf;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined1 *)(param_1 + 8) = 0;
  return;
}



void FUN_140090e40(longlong param_1)

{
  if (0xf < *(ulonglong *)(param_1 + 0x50)) {
    operator_delete(*(void **)(param_1 + 0x38));
  }
  *(undefined8 *)(param_1 + 0x50) = 0xf;
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined1 *)(param_1 + 0x38) = 0;
  if (0xf < *(ulonglong *)(param_1 + 0x28)) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x28) = 0xf;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined1 *)(param_1 + 0x10) = 0;
  return;
}



void FUN_140090ea0(longlong param_1,int param_2,undefined4 param_3)

{
  char cVar1;
  undefined8 *puVar2;
  undefined8 **ppuVar3;
  undefined8 uVar4;
  undefined8 *puVar5;
  undefined8 local_res8;
  undefined8 *local_res20;
  undefined1 local_18 [16];
  
  puVar5 = (undefined8 *)(*(undefined8 **)(param_1 + 0x850))[1];
  cVar1 = *(char *)((longlong)puVar5 + 0x21);
  local_res8 = *(undefined8 **)(param_1 + 0x850);
  while (cVar1 == '\0') {
    if (*(int *)(puVar5 + 3) < param_2) {
      puVar2 = (undefined8 *)puVar5[2];
      puVar5 = local_res8;
    }
    else {
      puVar2 = (undefined8 *)*puVar5;
    }
    local_res8 = puVar5;
    puVar5 = puVar2;
    cVar1 = *(char *)((longlong)puVar2 + 0x21);
  }
  if ((local_res8 == *(undefined8 **)(param_1 + 0x850)) || (param_2 < *(int *)(local_res8 + 3))) {
    local_res20 = *(undefined8 **)(param_1 + 0x850);
    ppuVar3 = &local_res20;
  }
  else {
    ppuVar3 = (undefined8 **)&local_res8;
  }
  if (*ppuVar3 != *(undefined8 **)(param_1 + 0x850)) {
    *(undefined4 *)((longlong)*ppuVar3 + 0x1c) = param_3;
    return;
  }
  local_res8 = (undefined8 *)CONCAT44(param_3,param_2);
  uVar4 = FUN_1400957b0(param_1 + 0x848,&local_res8);
  FUN_140095280(param_1 + 0x848,local_18,uVar4);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140090f40(undefined4 *param_1)

{
  char cVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined4 *puVar4;
  longlong lVar5;
  undefined1 auStack_88 [32];
  undefined8 local_68;
  undefined8 local_60;
  uint local_58;
  undefined4 uStack_54;
  undefined1 local_50;
  undefined7 uStack_4f;
  undefined8 local_48;
  ulonglong local_40;
  ulonglong local_38;
  ulonglong local_28;
  
  local_68 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  *param_1 = 0;
  puVar4 = param_1 + 0x2a;
  lVar5 = 4;
  do {
    local_60 = 1;
    local_58 = 0;
    local_38 = 0xf;
    local_40 = 0;
    local_50 = 0;
    *(undefined8 *)(puVar4 + -2) = 1;
    *puVar4 = 0;
    FUN_140003d50(puVar4 + 2,&local_50,0,0xffffffffffffffff);
    if (0xf < local_38) {
      operator_delete((void *)CONCAT71(uStack_4f,local_50));
    }
    puVar4 = puVar4 + 0xe;
    lVar5 = lVar5 + -1;
  } while (lVar5 != 0);
  puVar4 = param_1 + 0xd2;
  lVar5 = 0x19;
  do {
    local_60 = 1;
    local_40 = 0xf;
    local_48 = 0;
    local_58 = local_58 & 0xffffff00;
    *(undefined8 *)(puVar4 + -2) = 1;
    FUN_140003d50(puVar4,&local_58,0,0xffffffffffffffff);
    if (0xf < local_40) {
      operator_delete((void *)CONCAT44(uStack_54,local_58));
    }
    puVar4 = puVar4 + 0xc;
    lVar5 = lVar5 + -1;
  } while (lVar5 != 0);
  FUN_140095000(param_1 + 0x1fc);
  cVar1 = *(char *)((longlong)*(longlong **)(*(longlong *)(param_1 + 0x21c) + 8) + 0x21);
  plVar3 = *(longlong **)(*(longlong *)(param_1 + 0x21c) + 8);
  while (cVar1 == '\0') {
    FUN_1400949d0(param_1 + 0x21a,plVar3[2]);
    plVar2 = (longlong *)*plVar3;
    operator_delete(plVar3);
    plVar3 = plVar2;
    cVar1 = *(char *)((longlong)plVar2 + 0x21);
  }
  *(longlong *)(*(longlong *)(param_1 + 0x21c) + 8) = *(longlong *)(param_1 + 0x21c);
  *(undefined8 *)*(undefined8 *)(param_1 + 0x21c) = *(undefined8 *)(param_1 + 0x21c);
  *(longlong *)(*(longlong *)(param_1 + 0x21c) + 0x10) = *(longlong *)(param_1 + 0x21c);
  *(undefined8 *)(param_1 + 0x21e) = 0;
  FUN_1400910f0(param_1);
  return;
}



void FUN_1400910f0(int *param_1)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  undefined8 *puVar6;
  longlong *plVar7;
  char *pcVar8;
  char *pcVar9;
  bool bVar10;
  undefined **local_98 [5];
  longlong *local_70;
  undefined8 *local_60;
  void *local_58;
  undefined8 *local_38;
  void *local_30;
  int local_24;
  int local_20;
  undefined8 local_18;
  
  local_18 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x216) == 0) {
    FUN_140090ea0(param_1,2,1);
    FUN_140090ea0(param_1,1,1);
    FUN_140090ea0(param_1,3,4);
    FUN_140090ea0(param_1,4,4);
    FUN_140090ea0(param_1,5,8);
    FUN_140090ea0(param_1,6,8);
  }
  param_1[0x10] = 0x33333333;
  param_1[0x11] = 0x3fc33333;
  param_1[0xe] = 0x33333333;
  param_1[0xf] = 0x3fc33333;
  puVar6 = &DAT_140312e80;
  if (0xf < DAT_140312e98) {
    puVar6 = DAT_140312e80;
  }
  FUN_1400275d0(local_98,puVar6);
  DAT_1403100dc = 0;
  cVar2 = FUN_1400276a0(local_98,local_60 + 2);
  plVar7 = local_70;
  if (cVar2 == '\0') {
    FUN_1401e4580(DAT_140320100,"ContentControl Load Failed %s : Line [ %d ] Col [ %d ]\n",
                  local_38 + 2,local_24 + 1,local_20 + 1);
    local_98[0] = TiXmlDocument::vftable;
    if (local_38 != &DAT_14031fee8) {
      operator_delete__(local_30);
    }
    local_98[0] = TiXmlNode::vftable;
    while (local_70 != (longlong *)0x0) {
      plVar7 = (longlong *)local_70[10];
      (**(code **)*local_70)(local_70,1);
      local_70 = plVar7;
    }
    if (local_60 == &DAT_14031fee8) {
      return;
    }
    operator_delete__(local_58);
    return;
  }
  for (; plVar7 != (longlong *)0x0; plVar7 = (longlong *)plVar7[10]) {
    bVar10 = (char *)(plVar7[7] + 0x10) == (char *)0x0;
    lVar4 = 6;
    pcVar8 = (char *)(plVar7[7] + 0x10);
    pcVar9 = "limit";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar10 = *pcVar8 == *pcVar9;
      pcVar8 = pcVar8 + 1;
      pcVar9 = pcVar9 + 1;
    } while (bVar10);
    if (bVar10) goto LAB_1400912c6;
  }
  goto LAB_140091e9e;
LAB_1400912c6:
  while (lVar4 = (**(code **)(*plVar7 + 0x30))(plVar7), lVar4 == 0) {
    do {
      plVar7 = (longlong *)plVar7[10];
      if (plVar7 == (longlong *)0x0) goto LAB_140091e9e;
      bVar10 = (char *)(plVar7[7] + 0x10) == (char *)0x0;
      lVar4 = 6;
      pcVar8 = (char *)(plVar7[7] + 0x10);
      pcVar9 = "limit";
      do {
        if (lVar4 == 0) break;
        lVar4 = lVar4 + -1;
        bVar10 = *pcVar8 == *pcVar9;
        pcVar8 = pcVar8 + 1;
        pcVar9 = pcVar9 + 1;
      } while (bVar10);
    } while (!bVar10);
  }
  lVar4 = (**(code **)(*plVar7 + 0x30))(plVar7);
  if (lVar4 != 0) {
    FUN_14008be60(param_1 + 0x1c);
    plVar7 = *(longlong **)(lVar4 + 0x28);
    while( true ) {
      if (plVar7 == (longlong *)0x0) goto LAB_140091e91;
      lVar4 = (**(code **)(*plVar7 + 0x30))(plVar7);
      if (lVar4 != 0) break;
      plVar7 = (longlong *)plVar7[10];
    }
    lVar4 = (**(code **)(*plVar7 + 0x30))(plVar7);
    while (lVar4 != 0) {
      pcVar8 = (char *)(*(longlong *)(lVar4 + 0x38) + 0x10);
      iVar3 = _stricmp(pcVar8,"avatar");
      if (iVar3 == 0) {
        for (lVar1 = *(longlong *)(lVar4 + 0xa0); lVar1 != lVar4 + 0x58;
            lVar1 = *(longlong *)(lVar1 + 0x48)) {
          pcVar8 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
          bVar10 = pcVar8 == (char *)0x0;
          lVar5 = 0xc;
          pcVar9 = "only_create";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar10 = *pcVar8 == *pcVar9;
            pcVar8 = pcVar8 + 1;
            pcVar9 = pcVar9 + 1;
          } while (bVar10);
          if (bVar10) {
            pcVar8 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
            if (pcVar8 != (char *)0x0) {
              iVar3 = atoi(pcVar8);
              param_1[0x26] = iVar3;
            }
            break;
          }
        }
      }
      else {
        iVar3 = _stricmp(pcVar8,"class");
        if (iVar3 == 0) {
          FUN_140091f30(param_1,lVar4);
        }
        else {
          iVar3 = _stricmp(pcVar8,"level");
          if (iVar3 == 0) {
            for (lVar1 = *(longlong *)(lVar4 + 0xa0); lVar1 != lVar4 + 0x58;
                lVar1 = *(longlong *)(lVar1 + 0x48)) {
              pcVar8 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
              bVar10 = pcVar8 == (char *)0x0;
              lVar5 = 6;
              pcVar9 = "value";
              do {
                if (lVar5 == 0) break;
                lVar5 = lVar5 + -1;
                bVar10 = *pcVar8 == *pcVar9;
                pcVar8 = pcVar8 + 1;
                pcVar9 = pcVar9 + 1;
              } while (bVar10);
              if (bVar10) {
                pcVar8 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
                if (pcVar8 != (char *)0x0) {
                  iVar3 = atoi(pcVar8);
                  *param_1 = iVar3;
                }
                break;
              }
            }
          }
          else {
            iVar3 = _stricmp(pcVar8,"shop");
            if (iVar3 == 0) {
              FUN_1400927e0(param_1,lVar4);
            }
            else {
              iVar3 = _stricmp(pcVar8,"dungeon");
              if (iVar3 == 0) {
                FUN_1400929a0(param_1,lVar4);
              }
              else {
                iVar3 = _stricmp(pcVar8,"cash_shop");
                if (iVar3 == 0) {
                  FUN_1400922b0(param_1,lVar4);
                }
                else {
                  iVar3 = _stricmp(pcVar8,"pcroom");
                  if (iVar3 == 0) {
                    FUN_140092380(param_1,lVar4);
                  }
                  else {
                    iVar3 = _stricmp(pcVar8,"pvp_ladder");
                    if (iVar3 == 0) {
                      for (lVar1 = *(longlong *)(lVar4 + 0xa0); lVar1 != lVar4 + 0x58;
                          lVar1 = *(longlong *)(lVar1 + 0x48)) {
                        pcVar8 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
                        bVar10 = pcVar8 == (char *)0x0;
                        lVar5 = 4;
                        pcVar9 = "use";
                        do {
                          if (lVar5 == 0) break;
                          lVar5 = lVar5 + -1;
                          bVar10 = *pcVar8 == *pcVar9;
                          pcVar8 = pcVar8 + 1;
                          pcVar9 = pcVar9 + 1;
                        } while (bVar10);
                        if (bVar10) {
                          pcVar8 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
                          if (pcVar8 != (char *)0x0) {
                            iVar3 = atoi(pcVar8);
                            *(bool *)((longlong)param_1 + 6) = 0 < iVar3;
                          }
                          break;
                        }
                      }
                    }
                    else {
                      iVar3 = _stricmp(pcVar8,"pvp_massive");
                      if (iVar3 == 0) {
                        for (lVar1 = *(longlong *)(lVar4 + 0xa0); lVar1 != lVar4 + 0x58;
                            lVar1 = *(longlong *)(lVar1 + 0x48)) {
                          pcVar8 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
                          bVar10 = pcVar8 == (char *)0x0;
                          lVar5 = 4;
                          pcVar9 = "use";
                          do {
                            if (lVar5 == 0) break;
                            lVar5 = lVar5 + -1;
                            bVar10 = *pcVar8 == *pcVar9;
                            pcVar8 = pcVar8 + 1;
                            pcVar9 = pcVar9 + 1;
                          } while (bVar10);
                          if (bVar10) {
                            pcVar8 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
                            if (pcVar8 != (char *)0x0) {
                              iVar3 = atoi(pcVar8);
                              *(bool *)((longlong)param_1 + 7) = 0 < iVar3;
                            }
                            break;
                          }
                        }
                      }
                      else {
                        iVar3 = _stricmp(pcVar8,"pvp_raid");
                        if (iVar3 == 0) {
                          for (lVar1 = *(longlong *)(lVar4 + 0xa0); lVar1 != lVar4 + 0x58;
                              lVar1 = *(longlong *)(lVar1 + 0x48)) {
                            pcVar8 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
                            bVar10 = pcVar8 == (char *)0x0;
                            lVar5 = 4;
                            pcVar9 = "use";
                            do {
                              if (lVar5 == 0) break;
                              lVar5 = lVar5 + -1;
                              bVar10 = *pcVar8 == *pcVar9;
                              pcVar8 = pcVar8 + 1;
                              pcVar9 = pcVar9 + 1;
                            } while (bVar10);
                            if (bVar10) {
                              pcVar8 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
                              if (pcVar8 != (char *)0x0) {
                                iVar3 = atoi(pcVar8);
                                *(bool *)(param_1 + 2) = 0 < iVar3;
                              }
                              break;
                            }
                          }
                        }
                        else {
                          iVar3 = _stricmp(pcVar8,"pvp_ladder_pingcheck");
                          if (iVar3 == 0) {
                            FUN_140092450(param_1,lVar4);
                          }
                          else {
                            iVar3 = _stricmp(pcVar8,"inquiry");
                            if (iVar3 == 0) {
                              for (lVar1 = *(longlong *)(lVar4 + 0xa0); lVar1 != lVar4 + 0x58;
                                  lVar1 = *(longlong *)(lVar1 + 0x48)) {
                                pcVar8 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
                                bVar10 = pcVar8 == (char *)0x0;
                                lVar5 = 4;
                                pcVar9 = "use";
                                do {
                                  if (lVar5 == 0) break;
                                  lVar5 = lVar5 + -1;
                                  bVar10 = *pcVar8 == *pcVar9;
                                  pcVar8 = pcVar8 + 1;
                                  pcVar9 = pcVar9 + 1;
                                } while (bVar10);
                                if (bVar10) {
                                  pcVar8 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
                                  if (pcVar8 != (char *)0x0) {
                                    iVar3 = atoi(pcVar8);
                                    *(bool *)((longlong)param_1 + 10) = 0 < iVar3;
                                  }
                                  break;
                                }
                              }
                            }
                            else {
                              iVar3 = _stricmp(pcVar8,"fortune");
                              if (iVar3 == 0) {
                                for (lVar1 = *(longlong *)(lVar4 + 0xa0); lVar1 != lVar4 + 0x58;
                                    lVar1 = *(longlong *)(lVar1 + 0x48)) {
                                  pcVar8 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
                                  bVar10 = pcVar8 == (char *)0x0;
                                  lVar5 = 4;
                                  pcVar9 = "use";
                                  do {
                                    if (lVar5 == 0) break;
                                    lVar5 = lVar5 + -1;
                                    bVar10 = *pcVar8 == *pcVar9;
                                    pcVar8 = pcVar8 + 1;
                                    pcVar9 = pcVar9 + 1;
                                  } while (bVar10);
                                  if (bVar10) {
                                    pcVar8 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
                                    if (pcVar8 != (char *)0x0) {
                                      iVar3 = atoi(pcVar8);
                                      *(bool *)(param_1 + 3) = 0 < iVar3;
                                    }
                                    break;
                                  }
                                }
                              }
                              else {
                                iVar3 = _stricmp(pcVar8,"itemrune_mix");
                                if (iVar3 == 0) {
                                  for (lVar1 = *(longlong *)(lVar4 + 0xa0); lVar1 != lVar4 + 0x58;
                                      lVar1 = *(longlong *)(lVar1 + 0x48)) {
                                    pcVar8 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
                                    bVar10 = pcVar8 == (char *)0x0;
                                    lVar5 = 4;
                                    pcVar9 = "use";
                                    do {
                                      if (lVar5 == 0) break;
                                      lVar5 = lVar5 + -1;
                                      bVar10 = *pcVar8 == *pcVar9;
                                      pcVar8 = pcVar8 + 1;
                                      pcVar9 = pcVar9 + 1;
                                    } while (bVar10);
                                    if (bVar10) {
                                      pcVar8 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
                                      if (pcVar8 != (char *)0x0) {
                                        iVar3 = atoi(pcVar8);
                                        *(bool *)((longlong)param_1 + 0xd) = 0 < iVar3;
                                      }
                                      break;
                                    }
                                  }
                                }
                                else {
                                  iVar3 = _stricmp(pcVar8,"party_summon");
                                  if (iVar3 == 0) {
                                    for (lVar1 = *(longlong *)(lVar4 + 0xa0); lVar1 != lVar4 + 0x58;
                                        lVar1 = *(longlong *)(lVar1 + 0x48)) {
                                      pcVar8 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
                                      bVar10 = pcVar8 == (char *)0x0;
                                      lVar5 = 4;
                                      pcVar9 = "use";
                                      do {
                                        if (lVar5 == 0) break;
                                        lVar5 = lVar5 + -1;
                                        bVar10 = *pcVar8 == *pcVar9;
                                        pcVar8 = pcVar8 + 1;
                                        pcVar9 = pcVar9 + 1;
                                      } while (bVar10);
                                      if (bVar10) {
                                        pcVar8 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
                                        if (pcVar8 != (char *)0x0) {
                                          iVar3 = atoi(pcVar8);
                                          *(bool *)((longlong)param_1 + 0xe) = 0 < iVar3;
                                        }
                                        break;
                                      }
                                    }
                                  }
                                  else {
                                    iVar3 = _stricmp(pcVar8,"trade_costume");
                                    if (iVar3 == 0) {
                                      for (lVar1 = *(longlong *)(lVar4 + 0xa0);
                                          lVar1 != lVar4 + 0x58; lVar1 = *(longlong *)(lVar1 + 0x48)
                                          ) {
                                        pcVar8 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
                                        bVar10 = pcVar8 == (char *)0x0;
                                        lVar5 = 4;
                                        pcVar9 = "use";
                                        do {
                                          if (lVar5 == 0) break;
                                          lVar5 = lVar5 + -1;
                                          bVar10 = *pcVar8 == *pcVar9;
                                          pcVar8 = pcVar8 + 1;
                                          pcVar9 = pcVar9 + 1;
                                        } while (bVar10);
                                        if (bVar10) {
                                          pcVar8 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
                                          if (pcVar8 != (char *)0x0) {
                                            iVar3 = atoi(pcVar8);
                                            *(bool *)((longlong)param_1 + 0xf) = 0 < iVar3;
                                          }
                                          break;
                                        }
                                      }
                                    }
                                    else {
                                      iVar3 = _stricmp(pcVar8,"party_user");
                                      if (iVar3 == 0) {
                                        FUN_140093140(param_1,lVar4);
                                      }
                                      else {
                                        iVar3 = _stricmp(pcVar8,"play_point");
                                        if (iVar3 == 0) {
                                          for (lVar1 = *(longlong *)(lVar4 + 0xa0);
                                              lVar1 != lVar4 + 0x58;
                                              lVar1 = *(longlong *)(lVar1 + 0x48)) {
                                            pcVar8 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
                                            bVar10 = pcVar8 == (char *)0x0;
                                            lVar5 = 4;
                                            pcVar9 = "use";
                                            do {
                                              if (lVar5 == 0) break;
                                              lVar5 = lVar5 + -1;
                                              bVar10 = *pcVar8 == *pcVar9;
                                              pcVar8 = pcVar8 + 1;
                                              pcVar9 = pcVar9 + 1;
                                            } while (bVar10);
                                            if (bVar10) {
                                              pcVar8 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
                                              if (pcVar8 != (char *)0x0) {
                                                iVar3 = atoi(pcVar8);
                                                *(bool *)(param_1 + 4) = 0 < iVar3;
                                              }
                                              break;
                                            }
                                          }
                                        }
                                        else {
                                          iVar3 = _stricmp(pcVar8,"shut_down");
                                          if (iVar3 == 0) {
                                            FUN_140092520(param_1,lVar4);
                                          }
                                          else {
                                            iVar3 = _stricmp(pcVar8,"coupon");
                                            if (iVar3 == 0) {
                                              for (lVar1 = *(longlong *)(lVar4 + 0xa0);
                                                  lVar1 != lVar4 + 0x58;
                                                  lVar1 = *(longlong *)(lVar1 + 0x48)) {
                                                pcVar8 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10
                                                                 );
                                                bVar10 = pcVar8 == (char *)0x0;
                                                lVar5 = 4;
                                                pcVar9 = "use";
                                                do {
                                                  if (lVar5 == 0) break;
                                                  lVar5 = lVar5 + -1;
                                                  bVar10 = *pcVar8 == *pcVar9;
                                                  pcVar8 = pcVar8 + 1;
                                                  pcVar9 = pcVar9 + 1;
                                                } while (bVar10);
                                                if (bVar10) {
                                                  pcVar8 = (char *)(*(longlong *)(lVar1 + 0x30) +
                                                                   0x10);
                                                  if (pcVar8 != (char *)0x0) {
                                                    iVar3 = atoi(pcVar8);
                                                    *(bool *)((longlong)param_1 + 0x12) = 0 < iVar3;
                                                  }
                                                  break;
                                                }
                                              }
                                            }
                                            else {
                                              iVar3 = _stricmp(pcVar8,"pet_inven");
                                              if (iVar3 == 0) {
                                                for (lVar1 = *(longlong *)(lVar4 + 0xa0);
                                                    lVar1 != lVar4 + 0x58;
                                                    lVar1 = *(longlong *)(lVar1 + 0x48)) {
                                                  pcVar8 = (char *)(*(longlong *)(lVar1 + 0x20) +
                                                                   0x10);
                                                  bVar10 = pcVar8 == (char *)0x0;
                                                  lVar5 = 4;
                                                  pcVar9 = "use";
                                                  do {
                                                    if (lVar5 == 0) break;
                                                    lVar5 = lVar5 + -1;
                                                    bVar10 = *pcVar8 == *pcVar9;
                                                    pcVar8 = pcVar8 + 1;
                                                    pcVar9 = pcVar9 + 1;
                                                  } while (bVar10);
                                                  if (bVar10) {
                                                    pcVar8 = (char *)(*(longlong *)(lVar1 + 0x30) +
                                                                     0x10);
                                                    if (pcVar8 != (char *)0x0) {
                                                      iVar3 = atoi(pcVar8);
                                                      *(bool *)(param_1 + 7) = 0 < iVar3;
                                                    }
                                                    break;
                                                  }
                                                }
                                              }
                                              else {
                                                iVar3 = _stricmp(pcVar8,"expid");
                                                if (iVar3 == 0) {
                                                  FUN_1400925f0(param_1,lVar4);
                                                }
                                                else {
                                                  iVar3 = _stricmp(pcVar8,"point_ratio");
                                                  if (iVar3 == 0) {
                                                    FUN_1400933f0(param_1,lVar4);
                                                  }
                                                  else {
                                                    iVar3 = _stricmp(pcVar8,"auction");
                                                    if (iVar3 == 0) {
                                                      FUN_1400935a0(param_1,lVar4);
                                                    }
                                                    else {
                                                      iVar3 = _stricmp(pcVar8,"book_pictorial");
                                                      if (iVar3 == 0) {
                                                        for (lVar1 = *(longlong *)(lVar4 + 0xa0);
                                                            lVar1 != lVar4 + 0x58;
                                                            lVar1 = *(longlong *)(lVar1 + 0x48)) {
                                                          pcVar8 = (char *)(*(longlong *)
                                                                             (lVar1 + 0x20) + 0x10);
                                                          bVar10 = pcVar8 == (char *)0x0;
                                                          lVar5 = 4;
                                                          pcVar9 = "use";
                                                          do {
                                                            if (lVar5 == 0) break;
                                                            lVar5 = lVar5 + -1;
                                                            bVar10 = *pcVar8 == *pcVar9;
                                                            pcVar8 = pcVar8 + 1;
                                                            pcVar9 = pcVar9 + 1;
                                                          } while (bVar10);
                                                          if (bVar10) {
                                                            pcVar8 = (char *)(*(longlong *)
                                                                               (lVar1 + 0x30) + 0x10
                                                                             );
                                                            if (pcVar8 != (char *)0x0) {
                                                              iVar3 = atoi(pcVar8);
                                                              *(bool *)(param_1 + 10) = 0 < iVar3;
                                                            }
                                                            break;
                                                          }
                                                        }
                                                      }
                                                      else {
                                                        iVar3 = _stricmp(pcVar8,"party_mission");
                                                        if (iVar3 == 0) {
                                                          for (lVar1 = *(longlong *)(lVar4 + 0xa0);
                                                              lVar1 != lVar4 + 0x58;
                                                              lVar1 = *(longlong *)(lVar1 + 0x48)) {
                                                            pcVar8 = (char *)(*(longlong *)
                                                                               (lVar1 + 0x20) + 0x10
                                                                             );
                                                            bVar10 = pcVar8 == (char *)0x0;
                                                            lVar5 = 4;
                                                            pcVar9 = "use";
                                                            do {
                                                              if (lVar5 == 0) break;
                                                              lVar5 = lVar5 + -1;
                                                              bVar10 = *pcVar8 == *pcVar9;
                                                              pcVar8 = pcVar8 + 1;
                                                              pcVar9 = pcVar9 + 1;
                                                            } while (bVar10);
                                                            if (bVar10) {
                                                              pcVar8 = (char *)(*(longlong *)
                                                                                 (lVar1 + 0x30) +
                                                                               0x10);
                                                              if (pcVar8 != (char *)0x0) {
                                                                iVar3 = atoi(pcVar8);
                                                                *(bool *)((longlong)param_1 + 0x29)
                                                                     = 0 < iVar3;
                                                              }
                                                              break;
                                                            }
                                                          }
                                                        }
                                                        else {
                                                          iVar3 = _stricmp(pcVar8,"hidden_dungeon");
                                                          if (iVar3 == 0) {
                                                            for (lVar1 = *(longlong *)(lVar4 + 0xa0)
                                                                ; lVar1 != lVar4 + 0x58;
                                                                lVar1 = *(longlong *)(lVar1 + 0x48))
                                                            {
                                                              pcVar8 = (char *)(*(longlong *)
                                                                                 (lVar1 + 0x20) +
                                                                               0x10);
                                                              bVar10 = pcVar8 == (char *)0x0;
                                                              lVar5 = 4;
                                                              pcVar9 = "use";
                                                              do {
                                                                if (lVar5 == 0) break;
                                                                lVar5 = lVar5 + -1;
                                                                bVar10 = *pcVar8 == *pcVar9;
                                                                pcVar8 = pcVar8 + 1;
                                                                pcVar9 = pcVar9 + 1;
                                                              } while (bVar10);
                                                              if (bVar10) {
                                                                pcVar8 = (char *)(*(longlong *)
                                                                                   (lVar1 + 0x30) +
                                                                                 0x10);
                                                                if (pcVar8 != (char *)0x0) {
                                                                  iVar3 = atoi(pcVar8);
                                                                  *(bool *)((longlong)param_1 + 0x2a
                                                                           ) = 0 < iVar3;
                                                                }
                                                                break;
                                                              }
                                                            }
                                                          }
                                                          else {
                                                            iVar3 = _stricmp(pcVar8,"smart_server");
                                                            if (iVar3 == 0) {
                                                              FUN_1400942b0(param_1,lVar4);
                                                            }
                                                            else {
                                                              iVar3 = _stricmp(pcVar8,
                                                  "guild_content");
                                                  if (iVar3 == 0) {
                                                    FUN_140094570(param_1,lVar4);
                                                  }
                                                  else {
                                                    iVar3 = _stricmp(pcVar8,"event");
                                                    if (iVar3 == 0) {
                                                      for (lVar1 = *(longlong *)(lVar4 + 0xa0);
                                                          lVar1 != lVar4 + 0x58;
                                                          lVar1 = *(longlong *)(lVar1 + 0x48)) {
                                                        pcVar8 = (char *)(*(longlong *)
                                                                           (lVar1 + 0x20) + 0x10);
                                                        bVar10 = pcVar8 == (char *)0x0;
                                                        lVar5 = 10;
                                                        pcVar9 = "item_drop";
                                                        do {
                                                          if (lVar5 == 0) break;
                                                          lVar5 = lVar5 + -1;
                                                          bVar10 = *pcVar8 == *pcVar9;
                                                          pcVar8 = pcVar8 + 1;
                                                          pcVar9 = pcVar9 + 1;
                                                        } while (bVar10);
                                                        if (bVar10) {
                                                          pcVar8 = (char *)(*(longlong *)
                                                                             (lVar1 + 0x30) + 0x10);
                                                          if (pcVar8 != (char *)0x0) {
                                                            iVar3 = atoi(pcVar8);
                                                            param_1[0x17] = iVar3;
                                                          }
                                                          break;
                                                        }
                                                      }
                                                    }
                                                    else {
                                                      iVar3 = _stricmp(pcVar8,"guild_create");
                                                      if (iVar3 == 0) {
                                                        FUN_140094670(param_1,lVar4);
                                                      }
                                                      else {
                                                        iVar3 = _stricmp(pcVar8,"quest_btn");
                                                        if (iVar3 == 0) {
                                                          FUN_1400947a0(param_1,lVar4);
                                                        }
                                                        else {
                                                          iVar3 = _stricmp(pcVar8,"lobby_run");
                                                          if (iVar3 == 0) {
                                                            for (lVar1 = *(longlong *)(lVar4 + 0xa0)
                                                                ; lVar1 != lVar4 + 0x58;
                                                                lVar1 = *(longlong *)(lVar1 + 0x48))
                                                            {
                                                              pcVar8 = (char *)(*(longlong *)
                                                                                 (lVar1 + 0x20) +
                                                                               0x10);
                                                              bVar10 = pcVar8 == (char *)0x0;
                                                              lVar5 = 4;
                                                              pcVar9 = "use";
                                                              do {
                                                                if (lVar5 == 0) break;
                                                                lVar5 = lVar5 + -1;
                                                                bVar10 = *pcVar8 == *pcVar9;
                                                                pcVar8 = pcVar8 + 1;
                                                                pcVar9 = pcVar9 + 1;
                                                              } while (bVar10);
                                                              if (bVar10) {
                                                                pcVar8 = (char *)(*(longlong *)
                                                                                   (lVar1 + 0x30) +
                                                                                 0x10);
                                                                if (pcVar8 != (char *)0x0) {
                                                                  iVar3 = atoi(pcVar8);
                                                                  *(bool *)((longlong)param_1 + 0x6f
                                                                           ) = 0 < iVar3;
                                                                }
                                                                break;
                                                              }
                                                            }
                                                          }
                                                          else {
                                                            iVar3 = _stricmp(pcVar8,
                                                  "charaterslotblot");
                                                  if (iVar3 == 0) {
                                                    FUN_140094490(param_1,lVar4);
                                                  }
                                                  else {
                                                    iVar3 = _stricmp(pcVar8,"bloodmode");
                                                    if (iVar3 == 0) {
                                                      for (lVar1 = *(longlong *)(lVar4 + 0xa0);
                                                          lVar1 != lVar4 + 0x58;
                                                          lVar1 = *(longlong *)(lVar1 + 0x48)) {
                                                        pcVar8 = (char *)(*(longlong *)
                                                                           (lVar1 + 0x20) + 0x10);
                                                        bVar10 = pcVar8 == (char *)0x0;
                                                        lVar5 = 4;
                                                        pcVar9 = "use";
                                                        do {
                                                          if (lVar5 == 0) break;
                                                          lVar5 = lVar5 + -1;
                                                          bVar10 = *pcVar8 == *pcVar9;
                                                          pcVar8 = pcVar8 + 1;
                                                          pcVar9 = pcVar9 + 1;
                                                        } while (bVar10);
                                                        if (bVar10) {
                                                          pcVar8 = (char *)(*(longlong *)
                                                                             (lVar1 + 0x30) + 0x10);
                                                          if (pcVar8 != (char *)0x0) {
                                                            iVar3 = atoi(pcVar8);
                                                            *(bool *)((longlong)param_1 + 0x13) =
                                                                 0 < iVar3;
                                                          }
                                                          break;
                                                        }
                                                      }
                                                    }
                                                    else {
                                                      iVar3 = _stricmp(pcVar8,"questblock");
                                                      if (iVar3 == 0) {
                                                        FUN_140093690(param_1,lVar4);
                                                      }
                                                      else {
                                                        iVar3 = _stricmp(pcVar8,"log_display_level")
                                                        ;
                                                        if (iVar3 == 0) {
                                                          FUN_1400937a0(param_1,lVar4);
                                                        }
                                                      }
                                                    }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      plVar7 = *(longlong **)(lVar4 + 0x50);
      while( true ) {
        if (plVar7 == (longlong *)0x0) goto LAB_140091e91;
        lVar4 = (**(code **)(*plVar7 + 0x30))(plVar7);
        if (lVar4 != 0) break;
        plVar7 = (longlong *)plVar7[10];
      }
      lVar4 = (**(code **)(*plVar7 + 0x30))(plVar7);
    }
LAB_140091e91:
    FUN_140093890(param_1);
  }
LAB_140091e9e:
  local_98[0] = TiXmlDocument::vftable;
  if (local_38 != &DAT_14031fee8) {
    operator_delete__(local_30);
  }
  local_98[0] = TiXmlNode::vftable;
  while (local_70 != (longlong *)0x0) {
    plVar7 = (longlong *)local_70[10];
    (**(code **)*local_70)(local_70,1);
    local_70 = plVar7;
  }
  if (local_60 != &DAT_14031fee8) {
    operator_delete__(local_58);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140091f30(longlong param_1,longlong param_2)

{
  char cVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  ulonglong uVar6;
  uint uVar7;
  longlong lVar8;
  char *pcVar9;
  char *pcVar10;
  char *pcVar11;
  char *pcVar12;
  char *pcVar13;
  char *pcVar14;
  uint uVar15;
  bool bVar16;
  undefined1 auStack_98 [32];
  undefined8 local_78;
  int local_70;
  uint uStack_6c;
  uint local_68;
  undefined1 local_60;
  undefined7 uStack_5f;
  undefined8 local_50;
  ulonglong local_48;
  ulonglong local_38;
  
  local_78 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_98;
  lVar8 = param_2 + 0x58;
  pcVar9 = (char *)0x0;
  lVar2 = *(longlong *)(param_2 + 0xa0);
  for (lVar5 = lVar2; lVar4 = lVar2, pcVar10 = pcVar9, lVar5 != lVar8;
      lVar5 = *(longlong *)(lVar5 + 0x48)) {
    pcVar10 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
    bVar16 = pcVar10 == (char *)0x0;
    lVar3 = 4;
    pcVar11 = "use";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar16 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar16);
    if (bVar16) {
      pcVar10 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
      break;
    }
  }
  do {
    lVar5 = lVar2;
    pcVar11 = pcVar9;
    if (lVar4 == lVar8) break;
    pcVar11 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
    bVar16 = pcVar11 == (char *)0x0;
    lVar3 = 3;
    pcVar12 = "id";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar16 = *pcVar11 == *pcVar12;
      pcVar11 = pcVar11 + 1;
      pcVar12 = pcVar12 + 1;
    } while (bVar16);
    if (bVar16) {
      pcVar11 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
      break;
    }
    lVar4 = *(longlong *)(lVar4 + 0x48);
  } while( true );
joined_r0x000140091ff6:
  pcVar12 = pcVar9;
  if (lVar5 == lVar8) goto joined_r0x000140092033;
  pcVar12 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
  bVar16 = pcVar12 == (char *)0x0;
  lVar4 = 5;
  pcVar13 = "name";
  do {
    if (lVar4 == 0) break;
    lVar4 = lVar4 + -1;
    bVar16 = *pcVar12 == *pcVar13;
    pcVar12 = pcVar12 + 1;
    pcVar13 = pcVar13 + 1;
  } while (bVar16);
  if (bVar16) {
    pcVar12 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
    goto joined_r0x000140092033;
  }
  lVar5 = *(longlong *)(lVar5 + 0x48);
  goto joined_r0x000140091ff6;
joined_r0x000140092033:
  pcVar13 = pcVar9;
  if (lVar2 == lVar8) goto LAB_140092070;
  pcVar13 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
  bVar16 = pcVar13 == (char *)0x0;
  lVar5 = 8;
  pcVar14 = "freeuse";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar16 = *pcVar13 == *pcVar14;
    pcVar13 = pcVar13 + 1;
    pcVar14 = pcVar14 + 1;
  } while (bVar16);
  if (bVar16) {
    pcVar13 = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
    goto LAB_140092070;
  }
  lVar2 = *(longlong *)(lVar2 + 0x48);
  goto joined_r0x000140092033;
LAB_140092070:
  local_70 = 1;
  uStack_6c = 0;
  local_68 = 0;
  local_48 = 0xf;
  local_50 = 0;
  local_60 = 0;
  pcVar14 = pcVar9;
  if (pcVar10 != (char *)0x0) {
    local_70 = atoi(pcVar10);
    pcVar9 = (char *)(ulonglong)local_68;
    pcVar14 = (char *)(ulonglong)uStack_6c;
  }
  uVar15 = (uint)pcVar14;
  uVar7 = (uint)pcVar9;
  if (pcVar11 != (char *)0x0) {
    uStack_6c = atoi(pcVar11);
    uVar15 = uStack_6c;
    uVar7 = local_68;
  }
  if (pcVar12 != (char *)0x0) {
    uVar6 = 0xffffffffffffffff;
    pcVar9 = pcVar12;
    do {
      if (uVar6 == 0) break;
      uVar6 = uVar6 - 1;
      cVar1 = *pcVar9;
      pcVar9 = pcVar9 + 1;
    } while (cVar1 != '\0');
    FUN_140003e60(&local_60,pcVar12,~uVar6 - 1);
    uVar15 = uStack_6c;
    uVar7 = local_68;
  }
  if (pcVar13 != (char *)0x0) {
    local_68 = atoi(pcVar13);
    uVar15 = uStack_6c;
    uVar7 = local_68;
  }
  if (uVar15 - 1 < 4) {
    lVar5 = (longlong)(int)(uVar15 - 1) * 0x38;
    *(int *)(lVar5 + 0xa0 + param_1) = local_70;
    *(uint *)(lVar5 + 0xa4 + param_1) = uStack_6c;
    *(uint *)(lVar5 + 0xa8 + param_1) = local_68;
    param_1 = lVar5 + 0xb0 + param_1;
  }
  else if (uVar15 == 0x65) {
    *(int *)(param_1 + 0x180) = local_70;
    *(undefined4 *)(param_1 + 0x184) = 0x65;
    *(uint *)(param_1 + 0x188) = uVar7;
    param_1 = param_1 + 400;
  }
  else if (uVar15 == 0xc9) {
    *(int *)(param_1 + 0x1f0) = local_70;
    *(undefined4 *)(param_1 + 500) = 0xc9;
    *(uint *)(param_1 + 0x1f8) = uVar7;
    param_1 = param_1 + 0x200;
  }
  else if (uVar15 == 0x12d) {
    *(int *)(param_1 + 0x260) = local_70;
    *(undefined4 *)(param_1 + 0x264) = 0x12d;
    *(uint *)(param_1 + 0x268) = uVar7;
    param_1 = param_1 + 0x270;
  }
  else if (uVar15 == 0x191) {
    *(int *)(param_1 + 0x2d0) = local_70;
    *(undefined4 *)(param_1 + 0x2d4) = 0x191;
    *(uint *)(param_1 + 0x2d8) = uVar7;
    param_1 = param_1 + 0x2e0;
  }
  else if (uVar15 == 0x66) {
    *(int *)(param_1 + 0x1b8) = local_70;
    *(undefined4 *)(param_1 + 0x1bc) = 0x66;
    *(uint *)(param_1 + 0x1c0) = uVar7;
    param_1 = param_1 + 0x1c8;
  }
  else if (uVar15 == 0xca) {
    *(int *)(param_1 + 0x228) = local_70;
    *(undefined4 *)(param_1 + 0x22c) = 0xca;
    *(uint *)(param_1 + 0x230) = uVar7;
    param_1 = param_1 + 0x238;
  }
  else if (uVar15 == 0x12e) {
    *(int *)(param_1 + 0x298) = local_70;
    *(undefined4 *)(param_1 + 0x29c) = 0x12e;
    *(uint *)(param_1 + 0x2a0) = uVar7;
    param_1 = param_1 + 0x2a8;
  }
  else {
    if (uVar15 != 0x192) goto LAB_14009227c;
    *(int *)(param_1 + 0x308) = local_70;
    *(undefined4 *)(param_1 + 0x30c) = 0x192;
    *(uint *)(param_1 + 0x310) = uVar7;
    param_1 = param_1 + 0x318;
  }
  FUN_140003d50(param_1,&local_60,0,0xffffffffffffffff);
LAB_14009227c:
  if (0xf < local_48) {
    operator_delete((void *)CONCAT71(uStack_5f,local_60));
  }
  return;
}



void FUN_1400922b0(longlong param_1,longlong param_2)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar1 = *(longlong *)(param_2 + 0xa0);
  do {
    if (lVar1 == param_2 + 0x58) {
LAB_14009231b:
      lVar1 = *(longlong *)(param_2 + 0xa0);
      do {
        if (lVar1 == param_2 + 0x58) {
          return;
        }
        lVar3 = 9;
        pcVar4 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
        bVar6 = pcVar4 == (char *)0x0;
        pcVar5 = "all_view";
        do {
          if (lVar3 == 0) break;
          lVar3 = lVar3 + -1;
          bVar6 = *pcVar4 == *pcVar5;
          pcVar4 = pcVar4 + 1;
          pcVar5 = pcVar5 + 1;
        } while (bVar6);
        if (bVar6) {
          pcVar4 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
          if (pcVar4 == (char *)0x0) {
            return;
          }
          iVar2 = atoi(pcVar4);
          *(bool *)(param_1 + 4) = 0 < iVar2;
          return;
        }
        lVar1 = *(longlong *)(lVar1 + 0x48);
      } while( true );
    }
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
    bVar6 = pcVar4 == (char *)0x0;
    pcVar5 = "use";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar6 = *pcVar4 == *pcVar5;
      pcVar4 = pcVar4 + 1;
      pcVar5 = pcVar5 + 1;
    } while (bVar6);
    if (bVar6) {
      pcVar4 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
      if (pcVar4 != (char *)0x0) {
        iVar2 = atoi(pcVar4);
        *(bool *)(param_1 + 5) = 0 < iVar2;
      }
      goto LAB_14009231b;
    }
    lVar1 = *(longlong *)(lVar1 + 0x48);
  } while( true );
}



void FUN_140092380(longlong param_1,longlong param_2)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar1 = *(longlong *)(param_2 + 0xa0);
  do {
    if (lVar1 == param_2 + 0x58) {
LAB_1400923eb:
      lVar1 = *(longlong *)(param_2 + 0xa0);
      do {
        if (lVar1 == param_2 + 0x58) {
          return;
        }
        lVar3 = 6;
        pcVar4 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
        bVar6 = pcVar4 == (char *)0x0;
        pcVar5 = "value";
        do {
          if (lVar3 == 0) break;
          lVar3 = lVar3 + -1;
          bVar6 = *pcVar4 == *pcVar5;
          pcVar4 = pcVar4 + 1;
          pcVar5 = pcVar5 + 1;
        } while (bVar6);
        if (bVar6) {
          pcVar4 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
          if (pcVar4 == (char *)0x0) {
            return;
          }
          iVar2 = atoi(pcVar4);
          *(int *)(param_1 + 0x34) = iVar2;
          return;
        }
        lVar1 = *(longlong *)(lVar1 + 0x48);
      } while( true );
    }
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
    bVar6 = pcVar4 == (char *)0x0;
    pcVar5 = "use";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar6 = *pcVar4 == *pcVar5;
      pcVar4 = pcVar4 + 1;
      pcVar5 = pcVar5 + 1;
    } while (bVar6);
    if (bVar6) {
      pcVar4 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
      if (pcVar4 != (char *)0x0) {
        iVar2 = atoi(pcVar4);
        *(bool *)(param_1 + 0xb) = 0 < iVar2;
      }
      goto LAB_1400923eb;
    }
    lVar1 = *(longlong *)(lVar1 + 0x48);
  } while( true );
}



void FUN_140092450(longlong param_1,longlong param_2)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar1 = *(longlong *)(param_2 + 0xa0);
  do {
    if (lVar1 == param_2 + 0x58) {
LAB_1400924bb:
      lVar1 = *(longlong *)(param_2 + 0xa0);
      do {
        if (lVar1 == param_2 + 0x58) {
          return;
        }
        lVar3 = 5;
        pcVar4 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
        bVar6 = pcVar4 == (char *)0x0;
        pcVar5 = "time";
        do {
          if (lVar3 == 0) break;
          lVar3 = lVar3 + -1;
          bVar6 = *pcVar4 == *pcVar5;
          pcVar4 = pcVar4 + 1;
          pcVar5 = pcVar5 + 1;
        } while (bVar6);
        if (bVar6) {
          pcVar4 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
          if (pcVar4 == (char *)0x0) {
            return;
          }
          iVar2 = atoi(pcVar4);
          *(int *)(param_1 + 0x30) = iVar2;
          return;
        }
        lVar1 = *(longlong *)(lVar1 + 0x48);
      } while( true );
    }
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
    bVar6 = pcVar4 == (char *)0x0;
    pcVar5 = "use";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar6 = *pcVar4 == *pcVar5;
      pcVar4 = pcVar4 + 1;
      pcVar5 = pcVar5 + 1;
    } while (bVar6);
    if (bVar6) {
      pcVar4 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
      if (pcVar4 != (char *)0x0) {
        iVar2 = atoi(pcVar4);
        *(bool *)(param_1 + 9) = 0 < iVar2;
      }
      goto LAB_1400924bb;
    }
    lVar1 = *(longlong *)(lVar1 + 0x48);
  } while( true );
}



void FUN_140092520(longlong param_1,longlong param_2)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar1 = *(longlong *)(param_2 + 0xa0);
  do {
    if (lVar1 == param_2 + 0x58) {
LAB_14009258b:
      lVar1 = *(longlong *)(param_2 + 0xa0);
      do {
        if (lVar1 == param_2 + 0x58) {
          return;
        }
        lVar3 = 5;
        pcVar4 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
        bVar6 = pcVar4 == (char *)0x0;
        pcVar5 = "time";
        do {
          if (lVar3 == 0) break;
          lVar3 = lVar3 + -1;
          bVar6 = *pcVar4 == *pcVar5;
          pcVar4 = pcVar4 + 1;
          pcVar5 = pcVar5 + 1;
        } while (bVar6);
        if (bVar6) {
          pcVar4 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
          if (pcVar4 == (char *)0x0) {
            return;
          }
          iVar2 = atoi(pcVar4);
          *(int *)(param_1 + 0x2c) = iVar2;
          return;
        }
        lVar1 = *(longlong *)(lVar1 + 0x48);
      } while( true );
    }
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
    bVar6 = pcVar4 == (char *)0x0;
    pcVar5 = "use";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar6 = *pcVar4 == *pcVar5;
      pcVar4 = pcVar4 + 1;
      pcVar5 = pcVar5 + 1;
    } while (bVar6);
    if (bVar6) {
      pcVar4 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
      if (pcVar4 != (char *)0x0) {
        iVar2 = atoi(pcVar4);
        *(bool *)(param_1 + 0x11) = 0 < iVar2;
      }
      goto LAB_14009258b;
    }
    lVar1 = *(longlong *)(lVar1 + 0x48);
  } while( true );
}



void FUN_1400925f0(longlong param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  char *pcVar7;
  char *pcVar8;
  char *pcVar9;
  char *pcVar10;
  char *pcVar11;
  char *pcVar12;
  char *_Str;
  bool bVar13;
  
  lVar6 = param_2 + 0x58;
  _Str = (char *)0x0;
  lVar1 = *(longlong *)(param_2 + 0xa0);
  for (lVar5 = lVar1; lVar2 = lVar1, pcVar7 = _Str, lVar5 != lVar6;
      lVar5 = *(longlong *)(lVar5 + 0x48)) {
    lVar4 = 6;
    pcVar7 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
    bVar13 = pcVar7 == (char *)0x0;
    pcVar8 = "level";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar13 = *pcVar7 == *pcVar8;
      pcVar7 = pcVar7 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar13);
    if (bVar13) {
      pcVar7 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
      break;
    }
  }
  do {
    lVar5 = lVar1;
    pcVar8 = _Str;
    if (lVar2 == lVar6) break;
    lVar4 = 5;
    pcVar8 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
    bVar13 = pcVar8 == (char *)0x0;
    pcVar9 = "mail";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar13 = *pcVar8 == *pcVar9;
      pcVar8 = pcVar8 + 1;
      pcVar9 = pcVar9 + 1;
    } while (bVar13);
    if (bVar13) {
      pcVar8 = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
      break;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
  } while( true );
joined_r0x00014009268e:
  lVar2 = lVar1;
  pcVar9 = _Str;
  if (lVar5 == lVar6) goto joined_r0x0001400926be;
  lVar4 = 6;
  pcVar9 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
  bVar13 = pcVar9 == (char *)0x0;
  pcVar10 = "trade";
  do {
    if (lVar4 == 0) break;
    lVar4 = lVar4 + -1;
    bVar13 = *pcVar9 == *pcVar10;
    pcVar9 = pcVar9 + 1;
    pcVar10 = pcVar10 + 1;
  } while (bVar13);
  if (bVar13) {
    pcVar9 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
    goto joined_r0x0001400926be;
  }
  lVar5 = *(longlong *)(lVar5 + 0x48);
  goto joined_r0x00014009268e;
joined_r0x0001400926be:
  pcVar10 = _Str;
  if (lVar2 == lVar6) goto joined_r0x0001400926e7;
  lVar5 = 8;
  pcVar10 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
  bVar13 = pcVar10 == (char *)0x0;
  pcVar11 = "auction";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar13 = *pcVar10 == *pcVar11;
    pcVar10 = pcVar10 + 1;
    pcVar11 = pcVar11 + 1;
  } while (bVar13);
  if (bVar13) {
    pcVar10 = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
    goto joined_r0x0001400926e7;
  }
  lVar2 = *(longlong *)(lVar2 + 0x48);
  goto joined_r0x0001400926be;
joined_r0x0001400926e7:
  if (lVar1 == lVar6) {
LAB_140092749:
    if (pcVar7 != (char *)0x0) {
      iVar3 = atoi(pcVar7);
      *(int *)(param_1 + 0x20) = iVar3;
    }
    if (pcVar8 != (char *)0x0) {
      iVar3 = atoi(pcVar8);
      *(bool *)(param_1 + 0x24) = 0 < iVar3;
    }
    if (pcVar9 != (char *)0x0) {
      iVar3 = atoi(pcVar9);
      *(bool *)(param_1 + 0x25) = 0 < iVar3;
    }
    if (pcVar10 != (char *)0x0) {
      iVar3 = atoi(pcVar10);
      *(bool *)(param_1 + 0x26) = 0 < iVar3;
    }
    if (_Str != (char *)0x0) {
      iVar3 = atoi(_Str);
      *(bool *)(param_1 + 0x27) = 0 < iVar3;
    }
    return;
  }
  lVar5 = 5;
  pcVar11 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
  bVar13 = pcVar11 == (char *)0x0;
  pcVar12 = "shop";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar13 = *pcVar11 == *pcVar12;
    pcVar11 = pcVar11 + 1;
    pcVar12 = pcVar12 + 1;
  } while (bVar13);
  if (bVar13) {
    _Str = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
    goto LAB_140092749;
  }
  lVar1 = *(longlong *)(lVar1 + 0x48);
  goto joined_r0x0001400926e7;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400927e0(longlong param_1,longlong param_2)

{
  char cVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  ulonglong uVar8;
  char *pcVar9;
  char *pcVar10;
  char *pcVar11;
  char *pcVar12;
  char *pcVar13;
  bool bVar14;
  undefined1 auStack_78 [32];
  undefined8 local_58;
  undefined8 local_50;
  undefined1 local_48;
  undefined7 uStack_47;
  undefined8 local_38;
  ulonglong local_30;
  ulonglong local_20;
  
  local_58 = 0xfffffffffffffffe;
  local_20 = DAT_1402f85a0 ^ (ulonglong)auStack_78;
  lVar5 = param_2 + 0x58;
  pcVar12 = (char *)0x0;
  lVar2 = *(longlong *)(param_2 + 0xa0);
  for (lVar7 = lVar2; lVar3 = lVar2, pcVar9 = pcVar12, lVar7 != lVar5;
      lVar7 = *(longlong *)(lVar7 + 0x48)) {
    pcVar9 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar14 = pcVar9 == (char *)0x0;
    lVar6 = 4;
    pcVar10 = "use";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar14 = *pcVar9 == *pcVar10;
      pcVar9 = pcVar9 + 1;
      pcVar10 = pcVar10 + 1;
    } while (bVar14);
    if (bVar14) {
      pcVar9 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      break;
    }
  }
  do {
    pcVar10 = pcVar12;
    if (lVar3 == lVar5) break;
    pcVar10 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
    bVar14 = pcVar10 == (char *)0x0;
    lVar7 = 3;
    pcVar11 = "id";
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      bVar14 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar14);
    if (bVar14) {
      pcVar10 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
      break;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
joined_r0x000140092893:
  if (lVar2 == lVar5) goto LAB_1400928d0;
  pcVar11 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
  bVar14 = pcVar11 == (char *)0x0;
  lVar7 = 5;
  pcVar13 = "name";
  do {
    if (lVar7 == 0) break;
    lVar7 = lVar7 + -1;
    bVar14 = *pcVar11 == *pcVar13;
    pcVar11 = pcVar11 + 1;
    pcVar13 = pcVar13 + 1;
  } while (bVar14);
  if (bVar14) {
    pcVar12 = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
    goto LAB_1400928d0;
  }
  lVar2 = *(longlong *)(lVar2 + 0x48);
  goto joined_r0x000140092893;
LAB_1400928d0:
  local_50 = 1;
  local_30 = 0xf;
  local_38 = 0;
  local_48 = 0;
  if (pcVar9 != (char *)0x0) {
    iVar4 = atoi(pcVar9);
    local_50 = CONCAT44(local_50._4_4_,iVar4);
  }
  if (pcVar10 != (char *)0x0) {
    iVar4 = atoi(pcVar10);
    local_50 = CONCAT44(iVar4,(undefined4)local_50);
  }
  if (pcVar12 != (char *)0x0) {
    uVar8 = 0xffffffffffffffff;
    pcVar9 = pcVar12;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar1 = *pcVar9;
      pcVar9 = pcVar9 + 1;
    } while (cVar1 != '\0');
    FUN_140003e60(&local_48,pcVar12,~uVar8 - 1);
  }
  lVar5 = (longlong)local_50._4_4_;
  *(undefined4 *)(param_1 + 0x340 + lVar5 * 0x30) = (undefined4)local_50;
  *(int *)(param_1 + 0x344 + lVar5 * 0x30) = local_50._4_4_;
  FUN_140003d50(param_1 + 0x348 + lVar5 * 0x30,&local_48,0,0xffffffffffffffff);
  if (0xf < local_30) {
    operator_delete((void *)CONCAT71(uStack_47,local_48));
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400929a0(longlong param_1,longlong param_2)

{
  char cVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  ulonglong uVar8;
  longlong lVar9;
  char *pcVar10;
  char *pcVar11;
  char *pcVar12;
  char *pcVar13;
  char *pcVar14;
  char *pcVar15;
  char *pcVar16;
  bool bVar17;
  double dVar18;
  undefined1 auStack_278 [32];
  int *local_258;
  char *local_250;
  char *local_248;
  char *local_240;
  char *local_238;
  char *local_230;
  char *local_228;
  char *local_220;
  longlong local_218;
  undefined8 local_210;
  int local_208;
  undefined1 local_200;
  undefined7 uStack_1ff;
  undefined8 local_1f0;
  ulonglong local_1e8;
  undefined1 local_1d8;
  undefined7 uStack_1d7;
  undefined8 local_1c8;
  ulonglong local_1c0;
  float local_1b0 [34];
  int local_128;
  int local_120 [2];
  undefined1 local_118;
  undefined7 uStack_117;
  undefined8 local_108;
  ulonglong local_100;
  undefined1 local_f0;
  undefined7 uStack_ef;
  undefined8 local_e0;
  ulonglong local_d8;
  undefined8 local_c8;
  undefined8 uStack_c0;
  undefined8 local_b8;
  undefined8 uStack_b0;
  undefined8 local_a8;
  undefined8 uStack_a0;
  undefined8 local_98;
  undefined8 uStack_90;
  undefined8 local_88;
  undefined8 uStack_80;
  undefined8 local_78;
  undefined8 uStack_70;
  undefined4 local_68;
  undefined4 uStack_64;
  undefined4 uStack_60;
  undefined4 uStack_5c;
  undefined4 local_58;
  undefined4 uStack_54;
  undefined4 uStack_50;
  undefined4 uStack_4c;
  ulonglong local_48;
  
  local_210 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_278;
  lVar9 = param_2 + 0x58;
  pcVar10 = (char *)0x0;
  iVar5 = 0;
  lVar2 = *(longlong *)(param_2 + 0xa0);
  for (lVar7 = lVar2; lVar3 = lVar2, lVar7 != lVar9; lVar7 = *(longlong *)(lVar7 + 0x48)) {
    pcVar11 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar17 = pcVar11 == (char *)0x0;
    lVar6 = 4;
    pcVar12 = "use";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar17 = *pcVar11 == *pcVar12;
      pcVar11 = pcVar11 + 1;
      pcVar12 = pcVar12 + 1;
    } while (bVar17);
    if (bVar17) {
      local_240 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      goto joined_r0x000140092a43;
    }
  }
  local_240 = (char *)0x0;
joined_r0x000140092a43:
  do {
    lVar7 = lVar2;
    if (lVar3 == lVar9) break;
    pcVar11 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
    bVar17 = pcVar11 == (char *)0x0;
    lVar6 = 3;
    pcVar12 = "id";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar17 = *pcVar11 == *pcVar12;
      pcVar11 = pcVar11 + 1;
      pcVar12 = pcVar12 + 1;
    } while (bVar17);
    if (bVar17) {
      local_228 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
      goto joined_r0x000140092a8b;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
  local_228 = (char *)0x0;
joined_r0x000140092a8b:
  do {
    lVar3 = lVar2;
    if (lVar7 == lVar9) break;
    pcVar11 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar17 = pcVar11 == (char *)0x0;
    lVar6 = 5;
    pcVar12 = "name";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar17 = *pcVar11 == *pcVar12;
      pcVar11 = pcVar11 + 1;
      pcVar12 = pcVar12 + 1;
    } while (bVar17);
    if (bVar17) {
      local_230 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      goto joined_r0x000140092acd;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_230 = (char *)0x0;
joined_r0x000140092acd:
  do {
    lVar7 = lVar2;
    pcVar11 = pcVar10;
    if (lVar3 == lVar9) break;
    pcVar11 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
    bVar17 = pcVar11 == (char *)0x0;
    lVar6 = 5;
    pcVar12 = "diff";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar17 = *pcVar11 == *pcVar12;
      pcVar11 = pcVar11 + 1;
      pcVar12 = pcVar12 + 1;
    } while (bVar17);
    if (bVar17) {
      pcVar11 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
      break;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
joined_r0x000140092b06:
  lVar3 = lVar2;
  if (lVar7 == lVar9) goto LAB_140092b40;
  pcVar12 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
  bVar17 = pcVar12 == (char *)0x0;
  lVar6 = 3;
  pcVar13 = "hp";
  do {
    if (lVar6 == 0) break;
    lVar6 = lVar6 + -1;
    bVar17 = *pcVar12 == *pcVar13;
    pcVar12 = pcVar12 + 1;
    pcVar13 = pcVar13 + 1;
  } while (bVar17);
  if (bVar17) {
    local_238 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
    goto joined_r0x000140092b4b;
  }
  lVar7 = *(longlong *)(lVar7 + 0x48);
  goto joined_r0x000140092b06;
LAB_140092b40:
  local_238 = (char *)0x0;
joined_r0x000140092b4b:
  do {
    lVar7 = lVar2;
    if (lVar3 == lVar9) break;
    pcVar12 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
    bVar17 = pcVar12 == (char *)0x0;
    lVar6 = 6;
    pcVar13 = "delay";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar17 = *pcVar12 == *pcVar13;
      pcVar12 = pcVar12 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar17);
    if (bVar17) {
      local_220 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
      goto joined_r0x000140092b8d;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
  local_220 = (char *)0x0;
joined_r0x000140092b8d:
  do {
    lVar3 = lVar2;
    if (lVar7 == lVar9) break;
    pcVar12 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar17 = pcVar12 == (char *)0x0;
    lVar6 = 6;
    pcVar13 = "combo";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar17 = *pcVar12 == *pcVar13;
      pcVar12 = pcVar12 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar17);
    if (bVar17) {
      local_250 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      goto joined_r0x000140092bcd;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_250 = (char *)0x0;
joined_r0x000140092bcd:
  do {
    lVar7 = lVar2;
    if (lVar3 == lVar9) break;
    pcVar12 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
    bVar17 = pcVar12 == (char *)0x0;
    lVar6 = 7;
    pcVar13 = "attack";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar17 = *pcVar12 == *pcVar13;
      pcVar12 = pcVar12 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar17);
    if (bVar17) {
      local_248 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
      goto joined_r0x000140092c0d;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
  local_248 = (char *)0x0;
joined_r0x000140092c0d:
  do {
    lVar3 = lVar2;
    if (lVar7 == lVar9) break;
    pcVar12 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar17 = pcVar12 == (char *)0x0;
    lVar6 = 9;
    pcVar13 = "range_hp";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar17 = *pcVar12 == *pcVar13;
      pcVar12 = pcVar12 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar17);
    if (bVar17) {
      local_258 = (int *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      goto joined_r0x000140092c4d;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_258 = (int *)0x0;
joined_r0x000140092c4d:
  do {
    lVar7 = lVar2;
    pcVar12 = pcVar10;
    if (lVar3 == lVar9) break;
    pcVar12 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
    bVar17 = pcVar12 == (char *)0x0;
    lVar6 = 0xc;
    pcVar13 = "range_delay";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar17 = *pcVar12 == *pcVar13;
      pcVar12 = pcVar12 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar17);
    if (bVar17) {
      pcVar12 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
      break;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
joined_r0x000140092c86:
  lVar3 = lVar2;
  pcVar13 = pcVar10;
  if (lVar7 == lVar9) goto joined_r0x000140092cc6;
  pcVar13 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
  bVar17 = pcVar13 == (char *)0x0;
  lVar6 = 0xc;
  pcVar14 = "range_combo";
  do {
    if (lVar6 == 0) break;
    lVar6 = lVar6 + -1;
    bVar17 = *pcVar13 == *pcVar14;
    pcVar13 = pcVar13 + 1;
    pcVar14 = pcVar14 + 1;
  } while (bVar17);
  if (bVar17) {
    pcVar13 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
    goto joined_r0x000140092cc6;
  }
  lVar7 = *(longlong *)(lVar7 + 0x48);
  goto joined_r0x000140092c86;
joined_r0x000140092cc6:
  pcVar14 = pcVar10;
  if (lVar3 == lVar9) goto joined_r0x000140092d03;
  pcVar14 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
  bVar17 = pcVar14 == (char *)0x0;
  lVar7 = 0xd;
  pcVar15 = "range_attack";
  do {
    if (lVar7 == 0) break;
    lVar7 = lVar7 + -1;
    bVar17 = *pcVar14 == *pcVar15;
    pcVar14 = pcVar14 + 1;
    pcVar15 = pcVar15 + 1;
  } while (bVar17);
  if (bVar17) {
    pcVar14 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
    goto joined_r0x000140092d03;
  }
  lVar3 = *(longlong *)(lVar3 + 0x48);
  goto joined_r0x000140092cc6;
joined_r0x000140092d03:
  if (lVar2 == lVar9) goto LAB_140092d40;
  pcVar15 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
  bVar17 = pcVar15 == (char *)0x0;
  lVar7 = 10;
  pcVar16 = "diff_open";
  do {
    if (lVar7 == 0) break;
    lVar7 = lVar7 + -1;
    bVar17 = *pcVar15 == *pcVar16;
    pcVar15 = pcVar15 + 1;
    pcVar16 = pcVar16 + 1;
  } while (bVar17);
  if (bVar17) {
    pcVar10 = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
    goto LAB_140092d40;
  }
  lVar2 = *(longlong *)(lVar2 + 0x48);
  goto joined_r0x000140092d03;
LAB_140092d40:
  local_1e8 = 0xf;
  local_1f0 = 0;
  local_200 = 0;
  local_1c0 = 0xf;
  local_1c8 = 0;
  local_1d8 = 0;
  local_1b0[0] = 0.0;
  local_1b0[1] = 0.0;
  local_1b0[2] = 0.0;
  local_1b0[3] = 0.0;
  local_1b0[4] = 0.0;
  local_1b0[5] = 0.0;
  local_1b0[6] = 0.0;
  local_1b0[7] = 0.0;
  local_1b0[8] = 0.0;
  local_1b0[9] = 0.0;
  local_1b0[10] = 0.0;
  local_1b0[0xb] = 0.0;
  local_1b0[0xc] = 0.0;
  local_1b0[0xd] = 0.0;
  local_1b0[0xe] = 0.0;
  local_1b0[0xf] = 0.0;
  local_1b0[0x10] = 0.0;
  local_1b0[0x11] = 0.0;
  local_1b0[0x12] = 0.0;
  local_1b0[0x13] = 0.0;
  local_1b0[0x14] = 0.0;
  local_1b0[0x15] = 0.0;
  local_1b0[0x16] = 0.0;
  local_1b0[0x17] = 0.0;
  local_1b0[0x18] = 0.0;
  local_1b0[0x19] = 0.0;
  local_1b0[0x1a] = 0.0;
  local_1b0[0x1b] = 0.0;
  local_1b0[0x1c] = 0.0;
  local_1b0[0x1d] = 0.0;
  local_1b0[0x1e] = 0.0;
  local_1b0[0x1f] = 0.0;
  local_208 = 0xf0001;
  iVar4 = iVar5;
  local_218 = param_1;
  if ((pcVar11 != (char *)0x0) && (iVar4 = atoi(pcVar11), 2 < iVar4)) {
    iVar4 = 3;
  }
  if (local_228 != (char *)0x0) {
    iVar5 = atoi(local_228);
  }
  if (local_240 != (char *)0x0) {
    local_208 = atoi(local_240);
  }
  if (local_230 != (char *)0x0) {
    uVar8 = 0xffffffffffffffff;
    pcVar11 = local_230;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar1 = *pcVar11;
      pcVar11 = pcVar11 + 1;
    } while (cVar1 != '\0');
    FUN_140003e60(&local_200,local_230,~uVar8 - 1);
  }
  if (local_238 != (char *)0x0) {
    dVar18 = atof(local_238);
    local_1b0[(longlong)iVar4 * 8 + 2] = (float)dVar18;
  }
  if (local_220 != (char *)0x0) {
    dVar18 = atof(local_220);
    local_1b0[(longlong)iVar4 * 8] = (float)dVar18;
  }
  if (local_250 != (char *)0x0) {
    dVar18 = atof(local_250);
    local_1b0[(longlong)iVar4 * 8 + 1] = (float)dVar18;
  }
  if (local_248 != (char *)0x0) {
    dVar18 = atof(local_248);
    local_1b0[(longlong)iVar4 * 8 + 3] = (float)dVar18;
  }
  if (local_258 != (int *)0x0) {
    dVar18 = atof((char *)local_258);
    local_1b0[(longlong)iVar4 * 8 + 6] = (float)dVar18;
  }
  if (pcVar12 != (char *)0x0) {
    dVar18 = atof(pcVar12);
    local_1b0[(longlong)iVar4 * 8 + 4] = (float)dVar18;
  }
  if (pcVar13 != (char *)0x0) {
    dVar18 = atof(pcVar13);
    local_1b0[(longlong)iVar4 * 8 + 5] = (float)dVar18;
  }
  if (pcVar14 != (char *)0x0) {
    dVar18 = atof(pcVar14);
    local_1b0[(longlong)iVar4 * 8 + 7] = (float)dVar18;
  }
  if (pcVar10 != (char *)0x0) {
    uVar8 = 0xffffffffffffffff;
    pcVar11 = pcVar10;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar1 = *pcVar11;
      pcVar11 = pcVar11 + 1;
    } while (cVar1 != '\0');
    FUN_140003e60(&local_1d8,pcVar10,~uVar8 - 1);
  }
  if (0 < iVar5) {
    local_258 = local_120;
    local_120[0] = local_208;
    local_100 = 0xf;
    local_108 = 0;
    local_118 = 0;
    local_128 = iVar5;
    FUN_140003d50(&local_118,&local_200,0,0xffffffffffffffff);
    local_d8 = 0xf;
    local_e0 = 0;
    local_f0 = 0;
    FUN_140003d50(&local_f0,&local_1d8,0,0xffffffffffffffff);
    local_c8 = CONCAT44(local_1b0[1],local_1b0[0]);
    uStack_c0 = CONCAT44(local_1b0[3],local_1b0[2]);
    local_b8 = CONCAT44(local_1b0[5],local_1b0[4]);
    uStack_b0 = CONCAT44(local_1b0[7],local_1b0[6]);
    local_a8 = CONCAT44(local_1b0[9],local_1b0[8]);
    uStack_a0 = CONCAT44(local_1b0[0xb],local_1b0[10]);
    local_98 = CONCAT44(local_1b0[0xd],local_1b0[0xc]);
    uStack_90 = CONCAT44(local_1b0[0xf],local_1b0[0xe]);
    local_88 = CONCAT44(local_1b0[0x11],local_1b0[0x10]);
    uStack_80 = CONCAT44(local_1b0[0x13],local_1b0[0x12]);
    local_78 = CONCAT44(local_1b0[0x15],local_1b0[0x14]);
    uStack_70 = CONCAT44(local_1b0[0x17],local_1b0[0x16]);
    local_68 = local_1b0[0x18];
    uStack_64 = local_1b0[0x19];
    uStack_60 = local_1b0[0x1a];
    uStack_5c = local_1b0[0x1b];
    local_58 = local_1b0[0x1c];
    uStack_54 = local_1b0[0x1d];
    uStack_50 = local_1b0[0x1e];
    uStack_4c = local_1b0[0x1f];
    FUN_140094f30(local_218 + 0x7f0,local_128,local_120);
    if (0xf < local_d8) {
      operator_delete((void *)CONCAT71(uStack_ef,local_f0));
    }
    local_d8 = 0xf;
    local_e0 = 0;
    local_f0 = 0;
    if (0xf < local_100) {
      operator_delete((void *)CONCAT71(uStack_117,local_118));
    }
  }
  if (0xf < local_1c0) {
    operator_delete((void *)CONCAT71(uStack_1d7,local_1d8));
  }
  local_1c0 = 0xf;
  local_1c8 = 0;
  local_1d8 = 0;
  if (0xf < local_1e8) {
    operator_delete((void *)CONCAT71(uStack_1ff,local_200));
  }
  return;
}



void FUN_140093140(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  char *pcVar7;
  char *pcVar8;
  char *pcVar9;
  char *pcVar10;
  char *pcVar11;
  char *pcVar12;
  char *pcVar13;
  char *_Str;
  bool bVar14;
  
  lVar6 = param_2 + 0x58;
  _Str = (char *)0x0;
  lVar1 = *(longlong *)(param_2 + 0xa0);
  for (lVar5 = lVar1; lVar4 = lVar1, pcVar7 = _Str, lVar5 != lVar6;
      lVar5 = *(longlong *)(lVar5 + 0x48)) {
    lVar3 = 9;
    pcVar7 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
    bVar14 = pcVar7 == (char *)0x0;
    pcVar8 = "solo_max";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar14 = *pcVar7 == *pcVar8;
      pcVar7 = pcVar7 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar14);
    if (bVar14) {
      pcVar7 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
      break;
    }
  }
  do {
    lVar5 = lVar1;
    pcVar8 = _Str;
    if (lVar4 == lVar6) break;
    lVar3 = 0xd;
    pcVar8 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
    bVar14 = pcVar8 == (char *)0x0;
    pcVar9 = "tutorial_max";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar14 = *pcVar8 == *pcVar9;
      pcVar8 = pcVar8 + 1;
      pcVar9 = pcVar9 + 1;
    } while (bVar14);
    if (bVar14) {
      pcVar8 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
      break;
    }
    lVar4 = *(longlong *)(lVar4 + 0x48);
  } while( true );
joined_r0x0001400931de:
  lVar4 = lVar1;
  pcVar9 = _Str;
  if (lVar5 == lVar6) goto joined_r0x00014009320e;
  lVar3 = 0xb;
  pcVar9 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
  bVar14 = pcVar9 == (char *)0x0;
  pcVar10 = "normal_max";
  do {
    if (lVar3 == 0) break;
    lVar3 = lVar3 + -1;
    bVar14 = *pcVar9 == *pcVar10;
    pcVar9 = pcVar9 + 1;
    pcVar10 = pcVar10 + 1;
  } while (bVar14);
  if (bVar14) {
    pcVar9 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
    goto joined_r0x00014009320e;
  }
  lVar5 = *(longlong *)(lVar5 + 0x48);
  goto joined_r0x0001400931de;
joined_r0x00014009320e:
  lVar5 = lVar1;
  pcVar10 = _Str;
  if (lVar4 == lVar6) goto joined_r0x00014009323e;
  lVar3 = 0xd;
  pcVar10 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
  bVar14 = pcVar10 == (char *)0x0;
  pcVar11 = "matching_max";
  do {
    if (lVar3 == 0) break;
    lVar3 = lVar3 + -1;
    bVar14 = *pcVar10 == *pcVar11;
    pcVar10 = pcVar10 + 1;
    pcVar11 = pcVar11 + 1;
  } while (bVar14);
  if (bVar14) {
    pcVar10 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
    goto joined_r0x00014009323e;
  }
  lVar4 = *(longlong *)(lVar4 + 0x48);
  goto joined_r0x00014009320e;
joined_r0x00014009323e:
  pcVar11 = _Str;
  if (lVar5 == lVar6) goto joined_r0x000140093267;
  lVar4 = 9;
  pcVar11 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
  bVar14 = pcVar11 == (char *)0x0;
  pcVar12 = "raid_max";
  do {
    if (lVar4 == 0) break;
    lVar4 = lVar4 + -1;
    bVar14 = *pcVar11 == *pcVar12;
    pcVar11 = pcVar11 + 1;
    pcVar12 = pcVar12 + 1;
  } while (bVar14);
  if (bVar14) {
    pcVar11 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
    goto joined_r0x000140093267;
  }
  lVar5 = *(longlong *)(lVar5 + 0x48);
  goto joined_r0x00014009323e;
joined_r0x000140093267:
  if (lVar1 == lVar6) {
LAB_1400932d9:
    if (pcVar7 == (char *)0x0) {
      iVar2 = 1;
    }
    else {
      iVar2 = atoi(pcVar7);
    }
    FUN_140090ea0(param_1,2,iVar2);
    if (pcVar8 == (char *)0x0) {
      iVar2 = 1;
    }
    else {
      iVar2 = atoi(pcVar8);
    }
    FUN_140090ea0(param_1,1,iVar2);
    if (pcVar9 == (char *)0x0) {
      iVar2 = 4;
    }
    else {
      iVar2 = atoi(pcVar9);
    }
    FUN_140090ea0(param_1,3,iVar2);
    if (pcVar10 == (char *)0x0) {
      iVar2 = 4;
    }
    else {
      iVar2 = atoi(pcVar10);
    }
    FUN_140090ea0(param_1,4,iVar2);
    if (pcVar11 == (char *)0x0) {
      iVar2 = 8;
    }
    else {
      iVar2 = atoi(pcVar11);
    }
    FUN_140090ea0(param_1,5,iVar2);
    if (_Str == (char *)0x0) {
      iVar2 = 8;
    }
    else {
      iVar2 = atoi(_Str);
    }
    FUN_140090ea0(param_1,6,iVar2);
    return;
  }
  lVar5 = 0xc;
  pcVar12 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
  bVar14 = pcVar12 == (char *)0x0;
  pcVar13 = "default_max";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar14 = *pcVar12 == *pcVar13;
    pcVar12 = pcVar12 + 1;
    pcVar13 = pcVar13 + 1;
  } while (bVar14);
  if (bVar14) {
    _Str = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
    goto LAB_1400932d9;
  }
  lVar1 = *(longlong *)(lVar1 + 0x48);
  goto joined_r0x000140093267;
}



void FUN_1400933f0(longlong param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  char *pcVar6;
  char *pcVar7;
  char *pcVar8;
  char *pcVar9;
  char *pcVar10;
  char *_String;
  bool bVar11;
  double dVar12;
  
  lVar5 = param_2 + 0x58;
  _String = (char *)0x0;
  lVar1 = *(longlong *)(param_2 + 0xa0);
  for (lVar4 = lVar1; lVar3 = lVar1, pcVar6 = _String, lVar4 != lVar5;
      lVar4 = *(longlong *)(lVar4 + 0x48)) {
    lVar2 = 4;
    pcVar6 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
    bVar11 = pcVar6 == (char *)0x0;
    pcVar7 = "one";
    do {
      if (lVar2 == 0) break;
      lVar2 = lVar2 + -1;
      bVar11 = *pcVar6 == *pcVar7;
      pcVar6 = pcVar6 + 1;
      pcVar7 = pcVar7 + 1;
    } while (bVar11);
    if (bVar11) {
      pcVar6 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
      break;
    }
  }
  do {
    lVar4 = lVar1;
    pcVar7 = _String;
    if (lVar3 == lVar5) break;
    lVar2 = 4;
    pcVar7 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
    bVar11 = pcVar7 == (char *)0x0;
    pcVar8 = "two";
    do {
      if (lVar2 == 0) break;
      lVar2 = lVar2 + -1;
      bVar11 = *pcVar7 == *pcVar8;
      pcVar7 = pcVar7 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar11);
    if (bVar11) {
      pcVar7 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
      break;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
joined_r0x00014009348a:
  pcVar8 = _String;
  if (lVar4 == lVar5) goto joined_r0x0001400934b7;
  lVar3 = 6;
  pcVar8 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
  bVar11 = pcVar8 == (char *)0x0;
  pcVar9 = "three";
  do {
    if (lVar3 == 0) break;
    lVar3 = lVar3 + -1;
    bVar11 = *pcVar8 == *pcVar9;
    pcVar8 = pcVar8 + 1;
    pcVar9 = pcVar9 + 1;
  } while (bVar11);
  if (bVar11) {
    pcVar8 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
    goto joined_r0x0001400934b7;
  }
  lVar4 = *(longlong *)(lVar4 + 0x48);
  goto joined_r0x00014009348a;
joined_r0x0001400934b7:
  if (lVar1 == lVar5) {
LAB_14009350c:
    if (pcVar6 != (char *)0x0) {
      dVar12 = atof(pcVar6);
      *(float *)(param_1 + 0x888) = (float)dVar12;
    }
    if (pcVar7 != (char *)0x0) {
      dVar12 = atof(pcVar7);
      *(float *)(param_1 + 0x88c) = (float)dVar12;
    }
    if (pcVar8 != (char *)0x0) {
      dVar12 = atof(pcVar8);
      *(float *)(param_1 + 0x890) = (float)dVar12;
    }
    if (_String != (char *)0x0) {
      dVar12 = atof(_String);
      *(float *)(param_1 + 0x894) = (float)dVar12;
    }
    return;
  }
  lVar4 = 5;
  pcVar9 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
  bVar11 = pcVar9 == (char *)0x0;
  pcVar10 = "four";
  do {
    if (lVar4 == 0) break;
    lVar4 = lVar4 + -1;
    bVar11 = *pcVar9 == *pcVar10;
    pcVar9 = pcVar9 + 1;
    pcVar10 = pcVar10 + 1;
  } while (bVar11);
  if (bVar11) {
    _String = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
    goto LAB_14009350c;
  }
  lVar1 = *(longlong *)(lVar1 + 0x48);
  goto joined_r0x0001400934b7;
}



void FUN_1400935a0(longlong param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  char *_String;
  char *pcVar4;
  char *pcVar5;
  char *pcVar6;
  bool bVar7;
  double dVar8;
  
  _String = (char *)0x0;
  lVar1 = *(longlong *)(param_2 + 0xa0);
  for (lVar3 = lVar1; pcVar4 = _String, lVar3 != param_2 + 0x58; lVar3 = *(longlong *)(lVar3 + 0x48)
      ) {
    lVar2 = 8;
    pcVar4 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
    bVar7 = pcVar4 == (char *)0x0;
    pcVar5 = "instant";
    do {
      if (lVar2 == 0) break;
      lVar2 = lVar2 + -1;
      bVar7 = *pcVar4 == *pcVar5;
      pcVar4 = pcVar4 + 1;
      pcVar5 = pcVar5 + 1;
    } while (bVar7);
    if (bVar7) {
      pcVar4 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
      break;
    }
  }
  do {
    if (lVar1 == param_2 + 0x58) {
LAB_140093635:
      if (pcVar4 != (char *)0x0) {
        dVar8 = atof(pcVar4);
        *(double *)(param_1 + 0x38) = (double)(float)dVar8;
      }
      if (_String != (char *)0x0) {
        dVar8 = atof(_String);
        *(double *)(param_1 + 0x40) = (double)(float)dVar8;
      }
      return;
    }
    lVar3 = 9;
    pcVar5 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
    bVar7 = pcVar5 == (char *)0x0;
    pcVar6 = "timeover";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar7 = *pcVar5 == *pcVar6;
      pcVar5 = pcVar5 + 1;
      pcVar6 = pcVar6 + 1;
    } while (bVar7);
    if (bVar7) {
      _String = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
      goto LAB_140093635;
    }
    lVar1 = *(longlong *)(lVar1 + 0x48);
  } while( true );
}



void FUN_140093690(longlong param_1,longlong param_2)

{
  int *piVar1;
  int *piVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  char *pcVar6;
  char *pcVar7;
  bool bVar8;
  int local_res10 [2];
  
  lVar4 = *(longlong *)(param_2 + 0xa0);
  if (lVar4 == param_2 + 0x58) {
    return;
  }
  do {
    lVar5 = 3;
    pcVar6 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
    bVar8 = pcVar6 == (char *)0x0;
    pcVar7 = "id";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar8 = *pcVar6 == *pcVar7;
      pcVar6 = pcVar6 + 1;
      pcVar7 = pcVar7 + 1;
    } while (bVar8);
    if (bVar8) {
      pcVar6 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
      if (pcVar6 == (char *)0x0) {
        return;
      }
      iVar3 = atoi(pcVar6);
      piVar1 = *(int **)(param_1 + 0x78);
      local_res10[0] = iVar3;
      if ((local_res10 < piVar1) && (piVar2 = *(int **)(param_1 + 0x70), piVar2 <= local_res10)) {
        if (piVar1 == *(int **)(param_1 + 0x80)) {
          FUN_14007a1d0(param_1 + 0x70,1);
        }
        if (*(undefined4 **)(param_1 + 0x78) != (undefined4 *)0x0) {
          **(undefined4 **)(param_1 + 0x78) =
               *(undefined4 *)
                (*(longlong *)(param_1 + 0x70) + ((longlong)local_res10 - (longlong)piVar2 >> 2) * 4
                );
        }
      }
      else {
        if (piVar1 == *(int **)(param_1 + 0x80)) {
          FUN_14007a1d0(param_1 + 0x70,1);
        }
        if (*(int **)(param_1 + 0x78) != (int *)0x0) {
          **(int **)(param_1 + 0x78) = iVar3;
        }
      }
      *(longlong *)(param_1 + 0x78) = *(longlong *)(param_1 + 0x78) + 4;
      return;
    }
    lVar4 = *(longlong *)(lVar4 + 0x48);
    if (lVar4 == param_2 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_1400937a0(longlong param_1,longlong param_2)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  char *_Str;
  char *pcVar5;
  char *pcVar6;
  char *pcVar7;
  bool bVar8;
  
  if (param_2 == 0) {
    return;
  }
  _Str = (char *)0x0;
  lVar1 = *(longlong *)(param_2 + 0xa0);
  for (lVar4 = lVar1; pcVar5 = _Str, lVar4 != param_2 + 0x58; lVar4 = *(longlong *)(lVar4 + 0x48)) {
    lVar3 = 0x10;
    pcVar5 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
    bVar8 = pcVar5 == (char *)0x0;
    pcVar6 = "log_debug_level";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar8 = *pcVar5 == *pcVar6;
      pcVar5 = pcVar5 + 1;
      pcVar6 = pcVar6 + 1;
    } while (bVar8);
    if (bVar8) {
      pcVar5 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
      break;
    }
  }
  do {
    if (lVar1 == param_2 + 0x58) {
LAB_140093845:
      if (pcVar5 != (char *)0x0) {
        iVar2 = atoi(pcVar5);
        *(int *)(param_1 + 0x90) = iVar2;
      }
      if (_Str == (char *)0x0) {
        return;
      }
      iVar2 = atoi(_Str);
      *(int *)(param_1 + 0x94) = iVar2;
      return;
    }
    lVar4 = 0xf;
    pcVar6 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
    bVar8 = pcVar6 == (char *)0x0;
    pcVar7 = "log_info_level";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar8 = *pcVar6 == *pcVar7;
      pcVar6 = pcVar6 + 1;
      pcVar7 = pcVar7 + 1;
    } while (bVar8);
    if (bVar8) {
      _Str = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
      goto LAB_140093845;
    }
    lVar1 = *(longlong *)(lVar1 + 0x48);
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x000140094071)

void FUN_140093890(longlong param_1)

{
  char cVar1;
  longlong *plVar2;
  uint uVar3;
  ulonglong uVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong lVar8;
  ulonglong uVar9;
  char *pcVar10;
  undefined8 *puVar11;
  longlong lVar12;
  undefined1 auStack_a8 [32];
  longlong *local_88;
  undefined4 local_80;
  undefined8 local_78;
  undefined1 local_70;
  undefined7 uStack_6f;
  undefined8 local_60;
  ulonglong local_58;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined1 uStack_40;
  undefined1 uStack_3f;
  undefined2 uStack_3e;
  undefined4 uStack_3c;
  ulonglong local_38;
  ulonglong uVar4;
  
  local_78 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_a8;
  printf("-----------------------------------------\n");
  printf("-Content Control-------------------------\n");
  printf("Limit Level               : %d\n");
  printf("Cash Shop                 : %s\n");
  printf("Cash Shop All View        : %s\n");
  printf("PVP Ladder                : %s\n");
  printf("PVP Massive               : %s\n");
  printf("PVP Raid                  : %s\n");
  printf("PVP Ladder Ping           : %s , Notify Time %d (second) \n");
  printf("Inquiry                   : %s\n");
  printf("Fortune                   : %s\n");
  printf("ItemRuneMix               : %s\n");
  printf("PartySummon               : %s\n");
  printf("TradeCostume              : %s\n");
  printf("UsePlayPoint              : %s\n");
  printf("PcRoomService             : %s\n");
  printf("UseShutDown               : %s , Notify Time %d\n");
  printf("UseCoupon                 : %s\n");
  printf("Pet Inventory             : %s\n");
  printf("Avatar OnlyCreate         : %s\n");
  printf("Auction Commission        : Instant [ %.2f ] TimeOver [ %.2f ]\n");
  local_80 = *(undefined4 *)(param_1 + 0x58);
  local_88 = (longlong *)CONCAT44(local_88._4_4_,*(undefined4 *)(param_1 + 0x54));
  printf(
        "SmartBasisUserCount[ %d ] ServerLockDown[ %d ] ChannelAdd[ %d ] ChannelLockDown[ %d ] MaxServerChannel[ %d ]\n"
        );
  printf("Item Drop Count[ %d ]\n");
  printf("ExpID Level               : %d\n");
  printf("ExpID Use Mail            : %s\n");
  printf("ExpID Use Trade           : %s\n");
  printf("ExpID Use Auction         : %s\n");
  printf("ExpID Use Shop            : %s\n");
  printf("Book Pictorial            : %s\n");
  printf("Party Mission             : %s\n");
  printf("Hidden Dungeon            : %s\n");
  printf("Dungeon Hp Ratio          : %.2f\n");
  printf("Dungeon Attack Ratio      : %.2f\n");
  printf("Dungeon RangeHp Ratio     : %.2f\n");
  printf("Dungeon RangeAttack Ratio : %.2f\n");
  printf("PlayPointRatio [1]        : %.2f\n");
  printf("PlayPointRatio [2]        : %.2f\n");
  printf("PlayPointRatio [3]        : %.2f\n");
  printf("PlayPointRatio [4]        : %.2f\n");
  local_58 = 0xf;
  uVar9 = 0;
  local_60 = 0;
  local_70 = 0;
  plVar7 = (longlong *)**(longlong **)(param_1 + 0x850);
  if (plVar7 != *(longlong **)(param_1 + 0x850)) {
    do {
      local_48 = 0;
      uStack_44 = 0;
      uStack_40 = 0;
      uStack_3f = 0;
      _itoa_s(*(int *)((longlong)plVar7 + 0x1c),(char *)&local_48,10,10);
      FUN_14008a1e0(&local_70,&DAT_140285e54,1);
      uVar5 = 0xffffffffffffffff;
      pcVar10 = (char *)&local_48;
      do {
        if (uVar5 == 0) break;
        uVar5 = uVar5 - 1;
        cVar1 = *pcVar10;
        pcVar10 = pcVar10 + 1;
      } while (cVar1 != '\0');
      FUN_14008a1e0(&local_70,&local_48,~uVar5 - 1);
      FUN_14008a1e0(&local_70,&DAT_140285e58,1);
      if (*(char *)((longlong)plVar7 + 0x21) == '\0') {
        plVar6 = (longlong *)plVar7[2];
        if (*(char *)((longlong)plVar6 + 0x21) == '\0') {
          cVar1 = *(char *)(*plVar6 + 0x21);
          plVar7 = plVar6;
          plVar6 = (longlong *)*plVar6;
          while (cVar1 == '\0') {
            cVar1 = *(char *)(*plVar6 + 0x21);
            plVar7 = plVar6;
            plVar6 = (longlong *)*plVar6;
          }
        }
        else {
          cVar1 = *(char *)(plVar7[1] + 0x21);
          plVar2 = (longlong *)plVar7[1];
          plVar6 = plVar7;
          while ((plVar7 = plVar2, cVar1 == '\0' && (plVar6 == (longlong *)plVar7[2]))) {
            cVar1 = *(char *)(plVar7[1] + 0x21);
            plVar2 = (longlong *)plVar7[1];
            plVar6 = plVar7;
          }
        }
      }
    } while (plVar7 != *(longlong **)(param_1 + 0x850));
  }
  printf("PartyUserMax              : %s\n");
  printf("\n");
  puVar11 = (undefined8 *)(param_1 + 0xb0);
  lVar8 = 4;
  lVar12 = 4;
  do {
    local_88 = puVar11;
    if (0xf < (ulonglong)puVar11[3]) {
      local_88 = (undefined8 *)*puVar11;
    }
    printf("Use : %s\t FreeUse : %s\t Class [%d] %s\n");
    puVar11 = puVar11 + 7;
    lVar12 = lVar12 + -1;
  } while (lVar12 != 0);
  puVar11 = (undefined8 *)(param_1 + 400);
  lVar12 = 4;
  do {
    local_88 = puVar11;
    if (0xf < (ulonglong)puVar11[3]) {
      local_88 = (undefined8 *)*puVar11;
    }
    printf("Use : %s\t FreeUse : %s\t 2ND Class #1 [%d] %s\n");
    puVar11 = puVar11 + 0xe;
    lVar12 = lVar12 + -1;
  } while (lVar12 != 0);
  plVar7 = (longlong *)(param_1 + 0x1c8);
  do {
    local_88 = plVar7;
    if (0xf < (ulonglong)plVar7[3]) {
      local_88 = (longlong *)*plVar7;
    }
    printf("Use : %s\t FreeUse : %s\t 2ND Class #2 [%d] %s\n");
    plVar7 = plVar7 + 0xe;
    lVar8 = lVar8 + -1;
  } while (lVar8 != 0);
  printf("\n");
  lVar8 = 0x19;
  do {
    printf("Use : %s\t Shop [%d] %s\n");
    lVar8 = lVar8 + -1;
  } while (lVar8 != 0);
  printf("\n");
  plVar7 = (longlong *)(param_1 + 0x7f0);
  uVar5 = uVar9;
  if ((*(longlong *)(param_1 + 0x7f8) != 0) && (*(uint *)(param_1 + 0x800) != 0)) {
    uVar4 = uVar9;
    plVar6 = (longlong *)*plVar7;
    do {
      if (*plVar6 != 0) {
        uVar5 = ((longlong *)*plVar7)[uVar4];
        break;
      }
      uVar3 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar3;
      plVar6 = plVar6 + 1;
    } while (uVar3 < *(uint *)(param_1 + 0x800));
  }
  local_48 = (undefined4)uVar5;
  uStack_44 = (undefined4)(uVar5 >> 0x20);
  uStack_3c = (undefined4)((ulonglong)plVar7 >> 0x20);
  uStack_40 = SUB81(plVar7,0);
  uStack_3f = (undefined1)((ulonglong)plVar7 >> 8);
  uStack_3e = (undefined2)((ulonglong)plVar7 >> 0x10);
  do {
    do {
      uVar4 = uVar5;
      if (uVar4 == 0) {
        printf("\n");
        plVar7 = (longlong *)**(longlong **)(param_1 + 0x870);
        if (plVar7 != *(longlong **)(param_1 + 0x870)) {
          do {
            printf("USE GUILD CONTENT [ID:%d][USE:%d]\n");
            if (*(char *)((longlong)plVar7 + 0x21) == '\0') {
              plVar6 = (longlong *)plVar7[2];
              if (*(char *)((longlong)plVar6 + 0x21) == '\0') {
                cVar1 = *(char *)(*plVar6 + 0x21);
                plVar7 = plVar6;
                plVar6 = (longlong *)*plVar6;
                while (cVar1 == '\0') {
                  cVar1 = *(char *)(*plVar6 + 0x21);
                  plVar7 = plVar6;
                  plVar6 = (longlong *)*plVar6;
                }
              }
              else {
                cVar1 = *(char *)(plVar7[1] + 0x21);
                plVar2 = (longlong *)plVar7[1];
                plVar6 = plVar7;
                while ((plVar7 = plVar2, cVar1 == '\0' && (plVar6 == (longlong *)plVar7[2]))) {
                  cVar1 = *(char *)(plVar7[1] + 0x21);
                  plVar2 = (longlong *)plVar7[1];
                  plVar6 = plVar7;
                }
              }
            }
          } while (plVar7 != *(longlong **)(param_1 + 0x870));
        }
        printf("GUILD CREATE [USE:%d] [LEV:%d] [COST:%d]\n");
        printf("Quest Btn             : %s\n");
        printf("QuestAcceptBtn        : %s\n");
        printf("QuestRejectBtn        : %s\n");
        printf("Lobby Run             : %s\n");
        printf("BloodMode             : %s\n");
        printf("\n");
        if (*(longlong *)(param_1 + 0x78) - *(longlong *)(param_1 + 0x70) >> 2 != 0) {
          do {
            printf("Block Quset ID : %d\n");
            uVar9 = (ulonglong)((int)uVar9 + 1);
          } while (uVar9 < (ulonglong)
                           (*(longlong *)(param_1 + 0x78) - *(longlong *)(param_1 + 0x70) >> 2));
        }
        printf("LOG_DEBUG_LEVEL [%d]   LOG_INFO_LEVEL [%d]\n");
        printf("-----------------------------------------\n");
        if (0xf < local_58) {
          operator_delete((void *)CONCAT71(uStack_6f,local_70));
        }
        return;
      }
      if (*(longlong *)(uVar4 + 0x48) == 0) {
        printf("Use : %s\t Dungeon [%d] %s\n");
      }
      else {
        local_88 = (longlong *)(uVar4 + 0x38);
        if (0xf < *(ulonglong *)(uVar4 + 0x50)) {
          local_88 = (longlong *)*local_88;
        }
        printf("Use : %s\t Dungeon [%d] %s DiffOpen [ %s ]\n");
      }
      uVar5 = *(ulonglong *)(uVar4 + 0xe0);
    } while (*(ulonglong *)(uVar4 + 0xe0) != 0);
    uVar3 = *(uint *)(uVar4 + 0xe8) % *(uint *)(param_1 + 0x800) + 1;
    lVar8 = (longlong)(int)uVar3 << 3;
    uVar5 = uVar9;
    do {
      if (*(uint *)(param_1 + 0x800) <= uVar3) break;
      if (*(longlong *)(lVar8 + *plVar7) != 0) {
        uVar5 = *(ulonglong *)(lVar8 + *plVar7);
      }
      uVar3 = uVar3 + 1;
      lVar8 = lVar8 + 8;
    } while (uVar5 == 0);
  } while( true );
}



undefined * FUN_140094270(void)

{
  if ((DAT_140320f64 & 1) == 0) {
    DAT_140320f64 = DAT_140320f64 | 1;
    FUN_1400908e0();
    atexit((_func_5014 *)&LAB_140202650);
  }
  return &DAT_1403206b0;
}



void FUN_1400942b0(longlong param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  char *pcVar7;
  char *pcVar8;
  char *pcVar9;
  char *pcVar10;
  char *pcVar11;
  char *pcVar12;
  char *_Str;
  bool bVar13;
  
  lVar6 = param_2 + 0x58;
  _Str = (char *)0x0;
  lVar1 = *(longlong *)(param_2 + 0xa0);
  for (lVar5 = lVar1; lVar2 = lVar1, pcVar7 = _Str, lVar5 != lVar6;
      lVar5 = *(longlong *)(lVar5 + 0x48)) {
    lVar4 = 0xc;
    pcVar7 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
    bVar13 = pcVar7 == (char *)0x0;
    pcVar8 = "basis_count";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar13 = *pcVar7 == *pcVar8;
      pcVar7 = pcVar7 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar13);
    if (bVar13) {
      pcVar7 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
      break;
    }
  }
  do {
    lVar5 = lVar1;
    pcVar8 = _Str;
    if (lVar2 == lVar6) break;
    lVar4 = 0x10;
    pcVar8 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
    bVar13 = pcVar8 == (char *)0x0;
    pcVar9 = "server_lockdown";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar13 = *pcVar8 == *pcVar9;
      pcVar8 = pcVar8 + 1;
      pcVar9 = pcVar9 + 1;
    } while (bVar13);
    if (bVar13) {
      pcVar8 = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
      break;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
  } while( true );
joined_r0x00014009434e:
  lVar2 = lVar1;
  pcVar9 = _Str;
  if (lVar5 == lVar6) goto joined_r0x00014009437e;
  lVar4 = 0xc;
  pcVar9 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
  bVar13 = pcVar9 == (char *)0x0;
  pcVar10 = "channel_add";
  do {
    if (lVar4 == 0) break;
    lVar4 = lVar4 + -1;
    bVar13 = *pcVar9 == *pcVar10;
    pcVar9 = pcVar9 + 1;
    pcVar10 = pcVar10 + 1;
  } while (bVar13);
  if (bVar13) {
    pcVar9 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
    goto joined_r0x00014009437e;
  }
  lVar5 = *(longlong *)(lVar5 + 0x48);
  goto joined_r0x00014009434e;
joined_r0x00014009437e:
  pcVar10 = _Str;
  if (lVar2 == lVar6) goto joined_r0x0001400943a7;
  lVar5 = 0x11;
  pcVar10 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
  bVar13 = pcVar10 == (char *)0x0;
  pcVar11 = "channel_lockdown";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar13 = *pcVar10 == *pcVar11;
    pcVar10 = pcVar10 + 1;
    pcVar11 = pcVar11 + 1;
  } while (bVar13);
  if (bVar13) {
    pcVar10 = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
    goto joined_r0x0001400943a7;
  }
  lVar2 = *(longlong *)(lVar2 + 0x48);
  goto joined_r0x00014009437e;
joined_r0x0001400943a7:
  if (lVar1 == lVar6) {
LAB_140094409:
    if (pcVar7 != (char *)0x0) {
      iVar3 = atoi(pcVar7);
      *(int *)(param_1 + 0x48) = iVar3;
    }
    if (pcVar8 != (char *)0x0) {
      iVar3 = atoi(pcVar8);
      *(int *)(param_1 + 0x4c) = iVar3;
    }
    if (pcVar9 != (char *)0x0) {
      iVar3 = atoi(pcVar9);
      *(int *)(param_1 + 0x50) = iVar3;
    }
    if (pcVar10 != (char *)0x0) {
      iVar3 = atoi(pcVar10);
      *(int *)(param_1 + 0x54) = iVar3;
    }
    if (_Str != (char *)0x0) {
      iVar3 = atoi(_Str);
      *(int *)(param_1 + 0x58) = iVar3;
    }
    return;
  }
  lVar5 = 0x13;
  pcVar11 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
  bVar13 = pcVar11 == (char *)0x0;
  pcVar12 = "max_server_channel";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar13 = *pcVar11 == *pcVar12;
    pcVar11 = pcVar11 + 1;
    pcVar12 = pcVar12 + 1;
  } while (bVar13);
  if (bVar13) {
    _Str = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
    goto LAB_140094409;
  }
  lVar1 = *(longlong *)(lVar1 + 0x48);
  goto joined_r0x0001400943a7;
}



void FUN_140094490(longlong param_1,longlong param_2)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  char *_Str;
  char *pcVar5;
  char *pcVar6;
  char *pcVar7;
  bool bVar8;
  
  _Str = (char *)0x0;
  lVar1 = *(longlong *)(param_2 + 0xa0);
  for (lVar4 = lVar1; pcVar5 = _Str, lVar4 != param_2 + 0x58; lVar4 = *(longlong *)(lVar4 + 0x48)) {
    lVar3 = 4;
    pcVar5 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
    bVar8 = pcVar5 == (char *)0x0;
    pcVar6 = "use";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar8 = *pcVar5 == *pcVar6;
      pcVar5 = pcVar5 + 1;
      pcVar6 = pcVar6 + 1;
    } while (bVar8);
    if (bVar8) {
      pcVar5 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
      break;
    }
  }
  do {
    if (lVar1 == param_2 + 0x58) {
LAB_140094525:
      if (pcVar5 != (char *)0x0) {
        iVar2 = atoi(pcVar5);
        *(bool *)(param_1 + 0x14) = 0 < iVar2;
      }
      if (_Str != (char *)0x0) {
        iVar2 = atoi(_Str);
        *(int *)(param_1 + 0x18) = iVar2;
      }
      return;
    }
    lVar4 = 5;
    pcVar6 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
    bVar8 = pcVar6 == (char *)0x0;
    pcVar7 = "slot";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar8 = *pcVar6 == *pcVar7;
      pcVar6 = pcVar6 + 1;
      pcVar7 = pcVar7 + 1;
    } while (bVar8);
    if (bVar8) {
      _Str = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
      goto LAB_140094525;
    }
    lVar1 = *(longlong *)(lVar1 + 0x48);
  } while( true );
}



void FUN_140094570(longlong param_1,longlong param_2)

{
  longlong lVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  longlong lVar5;
  char *_Str;
  char *pcVar6;
  char *pcVar7;
  char *pcVar8;
  bool bVar9;
  int local_res10;
  undefined1 local_res14;
  undefined1 local_18 [16];
  
  _Str = (char *)0x0;
  lVar1 = *(longlong *)(param_2 + 0xa0);
  for (lVar5 = lVar1; pcVar6 = _Str, lVar5 != param_2 + 0x58; lVar5 = *(longlong *)(lVar5 + 0x48)) {
    lVar4 = 3;
    pcVar6 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
    bVar9 = pcVar6 == (char *)0x0;
    pcVar7 = "id";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar9 = *pcVar6 == *pcVar7;
      pcVar6 = pcVar6 + 1;
      pcVar7 = pcVar7 + 1;
    } while (bVar9);
    if (bVar9) {
      pcVar6 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
      break;
    }
  }
  do {
    if (lVar1 == param_2 + 0x58) {
LAB_140094605:
      if (pcVar6 != (char *)0x0) {
        local_res10 = atoi(pcVar6);
        local_res14 = 0;
        if (_Str != (char *)0x0) {
          iVar2 = atoi(_Str);
          local_res14 = (char)iVar2;
        }
        uVar3 = FUN_1400957f0(param_1 + 0x868,&local_res10);
        FUN_140095280(param_1 + 0x868,local_18,uVar3);
      }
      return;
    }
    lVar5 = 4;
    pcVar7 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
    bVar9 = pcVar7 == (char *)0x0;
    pcVar8 = "use";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar9 = *pcVar7 == *pcVar8;
      pcVar7 = pcVar7 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar9);
    if (bVar9) {
      _Str = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
      goto LAB_140094605;
    }
    lVar1 = *(longlong *)(lVar1 + 0x48);
  } while( true );
}



void FUN_140094670(longlong param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  longlong lVar5;
  longlong lVar6;
  char *_Str;
  char *pcVar7;
  char *pcVar8;
  char *pcVar9;
  char *pcVar10;
  bool bVar11;
  
  lVar1 = param_2 + 0x58;
  _Str = (char *)0x0;
  lVar2 = *(longlong *)(param_2 + 0xa0);
  for (lVar6 = lVar2; lVar3 = lVar2, pcVar7 = _Str, lVar6 != lVar1;
      lVar6 = *(longlong *)(lVar6 + 0x48)) {
    lVar5 = 4;
    pcVar7 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
    bVar11 = pcVar7 == (char *)0x0;
    pcVar8 = "use";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar11 = *pcVar7 == *pcVar8;
      pcVar7 = pcVar7 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar11);
    if (bVar11) {
      pcVar7 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
      break;
    }
  }
  do {
    pcVar8 = _Str;
    if (lVar3 == lVar1) break;
    lVar6 = 0x10;
    pcVar8 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
    bVar11 = pcVar8 == (char *)0x0;
    pcVar9 = "character_level";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar11 = *pcVar8 == *pcVar9;
      pcVar8 = pcVar8 + 1;
      pcVar9 = pcVar9 + 1;
    } while (bVar11);
    if (bVar11) {
      pcVar8 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
      break;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
joined_r0x0001400946f7:
  if (lVar2 == lVar1) {
LAB_14009473f:
    if (pcVar7 != (char *)0x0) {
      iVar4 = atoi(pcVar7);
      *(int *)(param_1 + 0x898) = iVar4;
    }
    if (pcVar8 != (char *)0x0) {
      iVar4 = atoi(pcVar8);
      *(int *)(param_1 + 0x89c) = iVar4;
    }
    if (_Str != (char *)0x0) {
      iVar4 = atoi(_Str);
      *(int *)(param_1 + 0x8a0) = iVar4;
    }
    return;
  }
  lVar6 = 0xc;
  pcVar9 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
  bVar11 = pcVar9 == (char *)0x0;
  pcVar10 = "gold_demand";
  do {
    if (lVar6 == 0) break;
    lVar6 = lVar6 + -1;
    bVar11 = *pcVar9 == *pcVar10;
    pcVar9 = pcVar9 + 1;
    pcVar10 = pcVar10 + 1;
  } while (bVar11);
  if (bVar11) {
    _Str = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
    goto LAB_14009473f;
  }
  lVar2 = *(longlong *)(lVar2 + 0x48);
  goto joined_r0x0001400946f7;
}



void FUN_1400947a0(longlong param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  char *pcVar5;
  char *pcVar6;
  bool bVar7;
  
  lVar1 = param_2 + 0x58;
  for (lVar2 = *(longlong *)(param_2 + 0xa0); lVar2 != lVar1; lVar2 = *(longlong *)(lVar2 + 0x48)) {
    lVar4 = 4;
    pcVar5 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
    bVar7 = pcVar5 == (char *)0x0;
    pcVar6 = "use";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar7 = *pcVar5 == *pcVar6;
      pcVar5 = pcVar5 + 1;
      pcVar6 = pcVar6 + 1;
    } while (bVar7);
    if (bVar7) {
      pcVar5 = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
      if (pcVar5 != (char *)0x0) {
        iVar3 = atoi(pcVar5);
        *(bool *)(param_1 + 0x6c) = 0 < iVar3;
      }
      break;
    }
  }
  lVar2 = *(longlong *)(param_2 + 0xa0);
  do {
    if (lVar2 == lVar1) {
LAB_14009485b:
      lVar2 = *(longlong *)(param_2 + 0xa0);
      do {
        if (lVar2 == lVar1) {
          return;
        }
        lVar4 = 7;
        pcVar5 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
        bVar7 = pcVar5 == (char *)0x0;
        pcVar6 = "reject";
        do {
          if (lVar4 == 0) break;
          lVar4 = lVar4 + -1;
          bVar7 = *pcVar5 == *pcVar6;
          pcVar5 = pcVar5 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar7);
        if (bVar7) {
          pcVar5 = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
          if (pcVar5 == (char *)0x0) {
            return;
          }
          iVar3 = atoi(pcVar5);
          *(bool *)(param_1 + 0x6e) = 0 < iVar3;
          return;
        }
        lVar2 = *(longlong *)(lVar2 + 0x48);
      } while( true );
    }
    lVar4 = 7;
    pcVar5 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
    bVar7 = pcVar5 == (char *)0x0;
    pcVar6 = "accept";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar7 = *pcVar5 == *pcVar6;
      pcVar5 = pcVar5 + 1;
      pcVar6 = pcVar6 + 1;
    } while (bVar7);
    if (bVar7) {
      pcVar5 = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
      if (pcVar5 != (char *)0x0) {
        iVar3 = atoi(pcVar5);
        *(bool *)(param_1 + 0x6d) = 0 < iVar3;
      }
      goto LAB_14009485b;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
  } while( true );
}



void FUN_1400948c0(longlong param_1)

{
  char cVar1;
  longlong *plVar2;
  longlong *plVar3;
  
  plVar2 = *(longlong **)(*(longlong *)(param_1 + 8) + 8);
  cVar1 = *(char *)((longlong)plVar2 + 0x21);
  while (cVar1 == '\0') {
    FUN_1400949d0(param_1,plVar2[2]);
    plVar3 = (longlong *)*plVar2;
    operator_delete(plVar2);
    plVar2 = plVar3;
    cVar1 = *(char *)((longlong)plVar3 + 0x21);
  }
  *(longlong *)(*(longlong *)(param_1 + 8) + 8) = *(longlong *)(param_1 + 8);
  *(undefined8 *)*(undefined8 *)(param_1 + 8) = *(undefined8 *)(param_1 + 8);
  *(longlong *)(*(longlong *)(param_1 + 8) + 0x10) = *(longlong *)(param_1 + 8);
  *(undefined8 *)(param_1 + 0x10) = 0;
  return;
}



longlong FUN_140094940(longlong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [4];
  
  *(undefined8 *)(param_1 + 0x10) = 0;
  pvVar1 = operator_new(0x28);
  if (pvVar1 != (void *)0x0) {
    *(void **)(param_1 + 8) = pvVar1;
    *(void **)pvVar1 = pvVar1;
    *(longlong *)(*(longlong *)(param_1 + 8) + 8) = *(longlong *)(param_1 + 8);
    *(longlong *)(*(longlong *)(param_1 + 8) + 0x10) = *(longlong *)(param_1 + 8);
    *(undefined1 *)(*(longlong *)(param_1 + 8) + 0x20) = 1;
    *(undefined1 *)(*(longlong *)(param_1 + 8) + 0x21) = 1;
    return param_1;
  }
  local_res8[0] = (char *)0x0;
  std::exception::exception((exception *)local_28,local_res8);
  local_28[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_28,(ThrowInfo *)&DAT_1402f47a8);
}



void FUN_1400949d0(undefined8 param_1,longlong *param_2)

{
  char cVar1;
  longlong *plVar2;
  
  cVar1 = *(char *)((longlong)param_2 + 0x21);
  while (cVar1 == '\0') {
    FUN_1400949d0(param_1,param_2[2]);
    plVar2 = (longlong *)*param_2;
    operator_delete(param_2);
    param_2 = plVar2;
    cVar1 = *(char *)((longlong)plVar2 + 0x21);
  }
  return;
}



undefined8 * FUN_140094a30(longlong param_1,undefined8 *param_2,longlong *param_3,longlong *param_4)

{
  char cVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined1 local_res8 [8];
  longlong *local_res18;
  
  if ((param_3 == (longlong *)**(longlong **)(param_1 + 8)) &&
     (param_4 == *(longlong **)(param_1 + 8))) {
    FUN_1400948c0();
    *param_2 = **(undefined8 **)(param_1 + 8);
    return param_2;
  }
  while (param_3 != param_4) {
    local_res18 = param_3;
    if (*(char *)((longlong)param_3 + 0x21) == '\0') {
      local_res18 = (longlong *)param_3[2];
      if (*(char *)((longlong)local_res18 + 0x21) == '\0') {
        cVar1 = *(char *)(*local_res18 + 0x21);
        plVar2 = (longlong *)*local_res18;
        while (cVar1 == '\0') {
          cVar1 = *(char *)(*plVar2 + 0x21);
          local_res18 = plVar2;
          plVar2 = (longlong *)*plVar2;
        }
      }
      else {
        cVar1 = *(char *)(param_3[1] + 0x21);
        plVar3 = (longlong *)param_3[1];
        plVar2 = param_3;
        while ((local_res18 = plVar3, cVar1 == '\0' && (plVar2 == (longlong *)local_res18[2]))) {
          cVar1 = *(char *)(local_res18[1] + 0x21);
          plVar3 = (longlong *)local_res18[1];
          plVar2 = local_res18;
        }
      }
    }
    FUN_140094b10(param_1,local_res8,param_3);
    param_3 = local_res18;
  }
  *param_2 = param_3;
  return param_2;
}



undefined8 * FUN_140094b10(longlong param_1,undefined8 *param_2,longlong *param_3)

{
  char cVar1;
  longlong *plVar2;
  longlong lVar3;
  code *pcVar4;
  longlong *plVar5;
  undefined8 *puVar6;
  longlong *plVar7;
  longlong *plVar8;
  longlong *plVar9;
  longlong *plVar10;
  
  if (*(char *)((longlong)param_3 + 0x21) != '\0') {
    std::_Xout_of_range("invalid map/set<T> iterator");
    pcVar4 = (code *)swi(3);
    puVar6 = (undefined8 *)(*pcVar4)();
    return puVar6;
  }
  plVar9 = (longlong *)param_3[2];
  plVar7 = param_3 + 2;
  if (*(char *)((longlong)plVar9 + 0x21) == '\0') {
    cVar1 = *(char *)(*plVar9 + 0x21);
    plVar8 = (longlong *)*plVar9;
    while (cVar1 == '\0') {
      cVar1 = *(char *)(*plVar8 + 0x21);
      plVar9 = plVar8;
      plVar8 = (longlong *)*plVar8;
    }
  }
  else {
    cVar1 = *(char *)(param_3[1] + 0x21);
    plVar10 = (longlong *)param_3[1];
    plVar8 = param_3;
    while ((plVar9 = plVar10, cVar1 == '\0' && (plVar8 == (longlong *)plVar9[2]))) {
      cVar1 = *(char *)(plVar9[1] + 0x21);
      plVar10 = (longlong *)plVar9[1];
      plVar8 = plVar9;
    }
  }
  plVar8 = (longlong *)*param_3;
  if (*(char *)((longlong)plVar8 + 0x21) == '\0') {
    plVar10 = plVar8;
    if ((*(char *)(*plVar7 + 0x21) == '\0') && (plVar10 = (longlong *)plVar9[2], plVar9 != param_3))
    {
      plVar8[1] = (longlong)plVar9;
      *plVar9 = *param_3;
      plVar8 = plVar9;
      if (plVar9 != (longlong *)*plVar7) {
        plVar8 = (longlong *)plVar9[1];
        if (*(char *)((longlong)plVar10 + 0x21) == '\0') {
          plVar10[1] = (longlong)plVar8;
        }
        *plVar8 = (longlong)plVar10;
        plVar9[2] = *plVar7;
        *(longlong **)(*plVar7 + 8) = plVar9;
      }
      if (*(longlong **)(*(longlong *)(param_1 + 8) + 8) == param_3) {
        *(longlong **)(*(longlong *)(param_1 + 8) + 8) = plVar9;
      }
      else {
        puVar6 = (undefined8 *)param_3[1];
        if ((longlong *)*puVar6 == param_3) {
          *puVar6 = plVar9;
        }
        else {
          puVar6[2] = plVar9;
        }
      }
      plVar9[1] = param_3[1];
      lVar3 = plVar9[4];
      *(char *)(plVar9 + 4) = (char)param_3[4];
      *(char *)(param_3 + 4) = (char)lVar3;
      goto LAB_140094cdf;
    }
  }
  else {
    plVar10 = (longlong *)*plVar7;
  }
  plVar8 = (longlong *)param_3[1];
  if (*(char *)((longlong)plVar10 + 0x21) == '\0') {
    plVar10[1] = (longlong)plVar8;
  }
  if (*(longlong **)(*(longlong *)(param_1 + 8) + 8) == param_3) {
    *(longlong **)(*(longlong *)(param_1 + 8) + 8) = plVar10;
  }
  else if ((longlong *)*plVar8 == param_3) {
    *plVar8 = (longlong)plVar10;
  }
  else {
    plVar8[2] = (longlong)plVar10;
  }
  if ((longlong *)**(undefined8 **)(param_1 + 8) == param_3) {
    plVar7 = plVar8;
    if (*(char *)((longlong)plVar10 + 0x21) == '\0') {
      cVar1 = *(char *)(*plVar10 + 0x21);
      plVar2 = (longlong *)*plVar10;
      plVar7 = plVar10;
      while (plVar5 = plVar2, cVar1 == '\0') {
        plVar2 = (longlong *)*plVar5;
        cVar1 = *(char *)((longlong)plVar2 + 0x21);
        plVar7 = plVar5;
      }
    }
    **(undefined8 **)(param_1 + 8) = plVar7;
  }
  lVar3 = *(longlong *)(param_1 + 8);
  if (*(longlong **)(lVar3 + 0x10) == param_3) {
    if (*(char *)((longlong)plVar10 + 0x21) == '\0') {
      cVar1 = *(char *)(plVar10[2] + 0x21);
      plVar7 = (longlong *)plVar10[2];
      plVar2 = plVar10;
      while (plVar5 = plVar7, cVar1 == '\0') {
        plVar7 = (longlong *)plVar5[2];
        cVar1 = *(char *)((longlong)plVar7 + 0x21);
        plVar2 = plVar5;
      }
      *(longlong **)(lVar3 + 0x10) = plVar2;
    }
    else {
      *(longlong **)(lVar3 + 0x10) = plVar8;
    }
  }
LAB_140094cdf:
  if ((char)param_3[4] == '\x01') {
    if (plVar10 != *(longlong **)(*(longlong *)(param_1 + 8) + 8)) {
      do {
        plVar7 = plVar8;
        if ((char)plVar10[4] != '\x01') break;
        plVar8 = (longlong *)*plVar7;
        if (plVar10 == plVar8) {
          plVar8 = (longlong *)plVar7[2];
          if ((char)plVar8[4] == '\0') {
            *(undefined1 *)(plVar8 + 4) = 1;
            *(undefined1 *)(plVar7 + 4) = 0;
            FUN_140094ed0(param_1,plVar7);
            plVar8 = (longlong *)plVar7[2];
          }
          if (*(char *)((longlong)plVar8 + 0x21) == '\0') {
            if ((*(char *)(*plVar8 + 0x20) != '\x01') || (*(char *)(plVar8[2] + 0x20) != '\x01')) {
              if (*(char *)(plVar8[2] + 0x20) == '\x01') {
                *(undefined1 *)(*plVar8 + 0x20) = 1;
                *(undefined1 *)(plVar8 + 4) = 0;
                FUN_140094e70(param_1,plVar8);
                plVar8 = (longlong *)plVar7[2];
              }
              *(char *)(plVar8 + 4) = (char)plVar7[4];
              *(undefined1 *)(plVar7 + 4) = 1;
              *(undefined1 *)(plVar8[2] + 0x20) = 1;
              FUN_140094ed0(param_1,plVar7);
              break;
            }
LAB_140094dd0:
            *(undefined1 *)(plVar8 + 4) = 0;
          }
        }
        else {
          if ((char)plVar8[4] == '\0') {
            *(undefined1 *)(plVar8 + 4) = 1;
            *(undefined1 *)(plVar7 + 4) = 0;
            FUN_140094e70(param_1,plVar7);
            plVar8 = (longlong *)*plVar7;
          }
          if (*(char *)((longlong)plVar8 + 0x21) == '\0') {
            if ((*(char *)(plVar8[2] + 0x20) == '\x01') && (*(char *)(*plVar8 + 0x20) == '\x01'))
            goto LAB_140094dd0;
            if (*(char *)(*plVar8 + 0x20) == '\x01') {
              *(undefined1 *)(plVar8[2] + 0x20) = 1;
              *(undefined1 *)(plVar8 + 4) = 0;
              FUN_140094ed0(param_1,plVar8);
              plVar8 = (longlong *)*plVar7;
            }
            *(char *)(plVar8 + 4) = (char)plVar7[4];
            *(undefined1 *)(plVar7 + 4) = 1;
            *(undefined1 *)(*plVar8 + 0x20) = 1;
            FUN_140094e70(param_1,plVar7);
            break;
          }
        }
        plVar8 = (longlong *)plVar7[1];
        plVar10 = plVar7;
      } while (plVar7 != *(longlong **)(*(longlong *)(param_1 + 8) + 8));
    }
    *(undefined1 *)(plVar10 + 4) = 1;
  }
  operator_delete(param_3);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -1;
  }
  *param_2 = plVar9;
  return param_2;
}



void FUN_140094e70(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *param_2;
  *param_2 = *(longlong *)(lVar1 + 0x10);
  if (*(char *)(*(longlong *)(lVar1 + 0x10) + 0x21) == '\0') {
    *(longlong **)(*(longlong *)(lVar1 + 0x10) + 8) = param_2;
  }
  *(longlong *)(lVar1 + 8) = param_2[1];
  if (param_2 == *(longlong **)(*(longlong *)(param_1 + 8) + 8)) {
    *(longlong *)(*(longlong *)(param_1 + 8) + 8) = lVar1;
    *(longlong **)(lVar1 + 0x10) = param_2;
    param_2[1] = lVar1;
    return;
  }
  plVar2 = (longlong *)param_2[1];
  if (param_2 == (longlong *)plVar2[2]) {
    plVar2[2] = lVar1;
    *(longlong **)(lVar1 + 0x10) = param_2;
    param_2[1] = lVar1;
    return;
  }
  *plVar2 = lVar1;
  *(longlong **)(lVar1 + 0x10) = param_2;
  param_2[1] = lVar1;
  return;
}



void FUN_140094ed0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  
  plVar1 = *(longlong **)(param_2 + 0x10);
  *(longlong *)(param_2 + 0x10) = *plVar1;
  if (*(char *)(*plVar1 + 0x21) == '\0') {
    *(longlong *)(*plVar1 + 8) = param_2;
  }
  plVar1[1] = *(longlong *)(param_2 + 8);
  if (param_2 == *(longlong *)(*(longlong *)(param_1 + 8) + 8)) {
    *(longlong **)(*(longlong *)(param_1 + 8) + 8) = plVar1;
    *plVar1 = param_2;
    *(longlong **)(param_2 + 8) = plVar1;
    return;
  }
  plVar2 = *(longlong **)(param_2 + 8);
  if (param_2 == *plVar2) {
    *plVar2 = (longlong)plVar1;
    *plVar1 = param_2;
    *(longlong **)(param_2 + 8) = plVar1;
    return;
  }
  plVar2[2] = (longlong)plVar1;
  *plVar1 = param_2;
  *(longlong **)(param_2 + 8) = plVar1;
  return;
}



uint * FUN_140094f30(longlong *param_1,uint param_2,undefined8 param_3)

{
  char cVar1;
  uint *puVar2;
  ulonglong uVar3;
  
  uVar3 = (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar1 = FUN_14000d350(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x38)) {
      if ((puVar2[0x3a] == param_2) && (*puVar2 == param_2)) {
        FUN_1400950f0(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_140095a60(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_1400950f0(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_140095000(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined4 uVar4;
  longlong *_Memory;
  ulonglong uVar5;
  uint uVar6;
  ulonglong uVar7;
  
  *(int *)(param_1 + 6) = (int)param_1[6] + 1;
  uVar5 = 0;
  if ((*param_1 != 0) && (uVar7 = uVar5, (int)param_1[2] != 0)) {
    do {
      lVar3 = *(longlong *)(*param_1 + uVar5);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0xe0);
        FUN_1400956d0(param_1,lVar3);
        lVar3 = lVar1;
      }
      uVar6 = (int)uVar7 + 1;
      uVar5 = uVar5 + 8;
      uVar7 = (ulonglong)uVar6;
    } while (uVar6 < *(uint *)(param_1 + 2));
  }
  operator_delete__((void *)*param_1);
  *param_1 = 0;
  param_1[1] = 0;
  if ((int)param_1[6] == 0) {
    uVar4 = FUN_14001de50(param_1,0);
    FUN_14000d350(param_1,uVar4,0);
  }
  param_1[8] = 0;
  _Memory = (longlong *)param_1[7];
  if ((longlong *)param_1[7] != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    param_1[7] = 0;
  }
  *(int *)(param_1 + 6) = (int)param_1[6] + -1;
  return;
}



void FUN_1400950d0(void)

{
  FUN_140095000();
  return;
}



undefined4 * FUN_1400950f0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  FUN_140003d50(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  FUN_140003d50(param_1 + 0xc,param_2 + 0xc,0,0xffffffffffffffff);
  param_1[0x16] = param_2[0x16];
  param_1[0x17] = param_2[0x17];
  param_1[0x18] = param_2[0x18];
  param_1[0x19] = param_2[0x19];
  param_1[0x1a] = param_2[0x1a];
  param_1[0x1b] = param_2[0x1b];
  param_1[0x1c] = param_2[0x1c];
  param_1[0x1d] = param_2[0x1d];
  param_1[0x1e] = param_2[0x1e];
  param_1[0x1f] = param_2[0x1f];
  param_1[0x20] = param_2[0x20];
  param_1[0x21] = param_2[0x21];
  param_1[0x22] = param_2[0x22];
  param_1[0x23] = param_2[0x23];
  param_1[0x24] = param_2[0x24];
  param_1[0x25] = param_2[0x25];
  param_1[0x26] = param_2[0x26];
  param_1[0x27] = param_2[0x27];
  param_1[0x28] = param_2[0x28];
  param_1[0x29] = param_2[0x29];
  param_1[0x2a] = param_2[0x2a];
  param_1[0x2b] = param_2[0x2b];
  param_1[0x2c] = param_2[0x2c];
  param_1[0x2d] = param_2[0x2d];
  param_1[0x2e] = param_2[0x2e];
  param_1[0x2f] = param_2[0x2f];
  param_1[0x30] = param_2[0x30];
  param_1[0x31] = param_2[0x31];
  param_1[0x32] = param_2[0x32];
  param_1[0x33] = param_2[0x33];
  param_1[0x34] = param_2[0x34];
  param_1[0x35] = param_2[0x35];
  return param_1;
}



undefined8 * FUN_140095280(longlong param_1,undefined8 *param_2,void *param_3)

{
  char cVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  bool bVar6;
  undefined1 local_res8 [8];
  
  puVar5 = *(undefined8 **)(param_1 + 8);
  bVar6 = true;
  if (*(char *)((longlong)puVar5[1] + 0x21) == '\0') {
    puVar4 = (undefined8 *)puVar5[1];
    do {
      puVar5 = puVar4;
      bVar6 = *(int *)((longlong)param_3 + 0x18) < *(int *)(puVar5 + 3);
      if (bVar6) {
        puVar4 = (undefined8 *)*puVar5;
      }
      else {
        puVar4 = (undefined8 *)puVar5[2];
      }
    } while (*(char *)((longlong)puVar4 + 0x21) == '\0');
  }
  puVar4 = puVar5;
  if (bVar6 != false) {
    if (puVar5 == (undefined8 *)**(undefined8 **)(param_1 + 8)) {
      bVar6 = true;
      goto LAB_1400952e7;
    }
    if (*(char *)((longlong)puVar5 + 0x21) == '\0') {
      puVar4 = (undefined8 *)*puVar5;
      if (*(char *)((longlong)puVar4 + 0x21) == '\0') {
        cVar1 = *(char *)((longlong)puVar4[2] + 0x21);
        puVar3 = (undefined8 *)puVar4[2];
        while (cVar1 == '\0') {
          cVar1 = *(char *)((longlong)puVar3[2] + 0x21);
          puVar4 = puVar3;
          puVar3 = (undefined8 *)puVar3[2];
        }
      }
      else {
        cVar1 = *(char *)((longlong)puVar5[1] + 0x21);
        puVar3 = (undefined8 *)puVar5[1];
        puVar4 = puVar5;
        while ((puVar2 = puVar3, cVar1 == '\0' && (puVar4 == (undefined8 *)*puVar2))) {
          cVar1 = *(char *)((longlong)puVar2[1] + 0x21);
          puVar3 = (undefined8 *)puVar2[1];
          puVar4 = puVar2;
        }
        if (*(char *)((longlong)puVar4 + 0x21) == '\0') {
          puVar4 = puVar2;
        }
      }
    }
    else {
      puVar4 = (undefined8 *)puVar5[2];
    }
  }
  if (*(int *)((longlong)param_3 + 0x18) <= *(int *)(puVar4 + 3)) {
    operator_delete(param_3);
    *param_2 = puVar4;
    *(undefined1 *)(param_2 + 1) = 0;
    return param_2;
  }
LAB_1400952e7:
  puVar5 = (undefined8 *)FUN_1400953a0(param_1,local_res8,bVar6,puVar5,param_3);
  *(undefined1 *)(param_2 + 1) = 1;
  *param_2 = *puVar5;
  return param_2;
}



undefined8 *
FUN_1400953a0(longlong param_1,undefined8 *param_2,char param_3,undefined8 *param_4,
             longlong *param_5)

{
  char cVar1;
  longlong *plVar2;
  code *pcVar3;
  undefined8 *puVar4;
  longlong lVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong *plVar8;
  
  if (0x1ffffffffffffffd < *(ulonglong *)(param_1 + 0x10)) {
    operator_delete(param_5);
    std::_Xlength_error("map/set<T> too long");
    pcVar3 = (code *)swi(3);
    puVar4 = (undefined8 *)(*pcVar3)();
    return puVar4;
  }
  *(ulonglong *)(param_1 + 0x10) = *(ulonglong *)(param_1 + 0x10) + 1;
  param_5[1] = (longlong)param_4;
  if (param_4 == *(undefined8 **)(param_1 + 8)) {
    (*(undefined8 **)(param_1 + 8))[1] = param_5;
    **(undefined8 **)(param_1 + 8) = param_5;
    lVar5 = *(longlong *)(param_1 + 8);
  }
  else {
    if (param_3 != '\0') {
      *param_4 = param_5;
      if (param_4 == (undefined8 *)**(longlong **)(param_1 + 8)) {
        **(longlong **)(param_1 + 8) = (longlong)param_5;
      }
      goto LAB_14009542a;
    }
    param_4[2] = param_5;
    lVar5 = *(longlong *)(param_1 + 8);
    if (param_4 != *(undefined8 **)(lVar5 + 0x10)) goto LAB_14009542a;
  }
  *(longlong **)(lVar5 + 0x10) = param_5;
LAB_14009542a:
  cVar1 = *(char *)(param_5[1] + 0x20);
  plVar7 = param_5;
  do {
    if (cVar1 != '\0') {
      lVar5 = *(longlong *)(param_1 + 8);
      *param_2 = param_5;
      *(undefined1 *)(*(longlong *)(lVar5 + 8) + 0x20) = 1;
      return param_2;
    }
    plVar6 = (longlong *)plVar7[1];
    plVar8 = (longlong *)plVar6[1];
    if (plVar6 == (longlong *)*plVar8) {
      lVar5 = plVar8[2];
      if (*(char *)(lVar5 + 0x20) != '\0') {
        if (plVar7 == (longlong *)plVar6[2]) {
          plVar7 = (longlong *)plVar6[2];
          plVar6[2] = *plVar7;
          if (*(char *)(*plVar7 + 0x21) == '\0') {
            *(longlong **)(*plVar7 + 8) = plVar6;
          }
          plVar7[1] = plVar6[1];
          if (plVar6 == *(longlong **)(*(longlong *)(param_1 + 8) + 8)) {
            *(longlong **)(*(longlong *)(param_1 + 8) + 8) = plVar7;
          }
          else {
            plVar8 = (longlong *)plVar6[1];
            if (plVar6 == (longlong *)*plVar8) {
              *plVar8 = (longlong)plVar7;
            }
            else {
              plVar8[2] = (longlong)plVar7;
            }
          }
          *plVar7 = (longlong)plVar6;
          plVar6[1] = (longlong)plVar7;
          plVar7 = plVar6;
        }
        *(undefined1 *)(plVar7[1] + 0x20) = 1;
        *(undefined1 *)(*(longlong *)(plVar7[1] + 8) + 0x20) = 0;
        plVar6 = *(longlong **)(plVar7[1] + 8);
        plVar8 = (longlong *)*plVar6;
        *plVar6 = plVar8[2];
        if (*(char *)(plVar8[2] + 0x21) == '\0') {
          *(longlong **)(plVar8[2] + 8) = plVar6;
        }
        plVar8[1] = plVar6[1];
        if (plVar6 == *(longlong **)(*(longlong *)(param_1 + 8) + 8)) {
          *(longlong **)(*(longlong *)(param_1 + 8) + 8) = plVar8;
          plVar8[2] = (longlong)plVar6;
        }
        else {
          plVar2 = (longlong *)plVar6[1];
          if (plVar6 == (longlong *)plVar2[2]) {
            plVar2[2] = (longlong)plVar8;
            plVar8[2] = (longlong)plVar6;
          }
          else {
            *plVar2 = (longlong)plVar8;
            plVar8[2] = (longlong)plVar6;
          }
        }
        goto LAB_140095608;
      }
LAB_140095532:
      *(undefined1 *)(plVar6 + 4) = 1;
      *(undefined1 *)(lVar5 + 0x20) = 1;
      *(undefined1 *)(*(longlong *)(plVar7[1] + 8) + 0x20) = 0;
      plVar7 = *(longlong **)(plVar7[1] + 8);
    }
    else {
      lVar5 = *plVar8;
      if (*(char *)(lVar5 + 0x20) == '\0') goto LAB_140095532;
      if (plVar7 == (longlong *)*plVar6) {
        lVar5 = *plVar6;
        *plVar6 = *(longlong *)(lVar5 + 0x10);
        if (*(char *)(*(longlong *)(lVar5 + 0x10) + 0x21) == '\0') {
          *(longlong **)(*(longlong *)(lVar5 + 0x10) + 8) = plVar6;
        }
        *(longlong *)(lVar5 + 8) = plVar6[1];
        if (plVar6 == *(longlong **)(*(longlong *)(param_1 + 8) + 8)) {
          *(longlong *)(*(longlong *)(param_1 + 8) + 8) = lVar5;
        }
        else {
          plVar7 = (longlong *)plVar6[1];
          if (plVar6 == (longlong *)plVar7[2]) {
            plVar7[2] = lVar5;
          }
          else {
            *plVar7 = lVar5;
          }
        }
        *(longlong **)(lVar5 + 0x10) = plVar6;
        plVar6[1] = lVar5;
        plVar7 = plVar6;
      }
      *(undefined1 *)(plVar7[1] + 0x20) = 1;
      *(undefined1 *)(*(longlong *)(plVar7[1] + 8) + 0x20) = 0;
      plVar6 = *(longlong **)(plVar7[1] + 8);
      plVar8 = (longlong *)plVar6[2];
      plVar6[2] = *plVar8;
      if (*(char *)(*plVar8 + 0x21) == '\0') {
        *(longlong **)(*plVar8 + 8) = plVar6;
      }
      plVar8[1] = plVar6[1];
      if (plVar6 == *(longlong **)(*(longlong *)(param_1 + 8) + 8)) {
        *(longlong **)(*(longlong *)(param_1 + 8) + 8) = plVar8;
      }
      else {
        puVar4 = (undefined8 *)plVar6[1];
        if (plVar6 == (longlong *)*puVar4) {
          *puVar4 = plVar8;
        }
        else {
          puVar4[2] = plVar8;
        }
      }
      *plVar8 = (longlong)plVar6;
LAB_140095608:
      plVar6[1] = (longlong)plVar8;
    }
    cVar1 = *(char *)(plVar7[1] + 0x20);
  } while( true );
}



void FUN_140095640(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0xe8) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0xe0); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0xe0))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0xe0) = *(undefined8 *)(param_2 + 0xe0);
      FUN_1400956d0(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0xe0);
  FUN_1400956d0(param_1,param_2);
  return;
}



void FUN_1400956d0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if (0xf < *(ulonglong *)(param_2 + 0x50)) {
    operator_delete(*(void **)(param_2 + 0x38));
  }
  *(undefined8 *)(param_2 + 0x50) = 0xf;
  *(undefined8 *)(param_2 + 0x48) = 0;
  *(undefined1 *)(param_2 + 0x38) = 0;
  if (0xf < *(ulonglong *)(param_2 + 0x28)) {
    operator_delete(*(void **)(param_2 + 0x10));
  }
  *(undefined8 *)(param_2 + 0x28) = 0xf;
  *(undefined8 *)(param_2 + 0x20) = 0;
  *(undefined1 *)(param_2 + 0x10) = 0;
  *(undefined8 *)(param_2 + 0xe0) = *(undefined8 *)(param_1 + 0x40);
  *(longlong *)(param_1 + 8) = *(longlong *)(param_1 + 8) + -1;
  *(longlong *)(param_1 + 0x40) = param_2;
  if ((*(ulonglong *)(param_1 + 8) < *(ulonglong *)(param_1 + 0x28)) &&
     (*(int *)(param_1 + 0x30) == 0)) {
    uVar2 = FUN_14001de50(param_1);
    FUN_1400958b0(param_1,uVar2);
  }
  if (*(longlong *)(param_1 + 8) == 0) {
    *(undefined8 *)(param_1 + 0x40) = 0;
    _Memory = *(longlong **)(param_1 + 0x38);
    if (*(longlong **)(param_1 + 0x38) != (longlong *)0x0) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      *(undefined8 *)(param_1 + 0x38) = 0;
    }
  }
  return;
}



void FUN_1400957b0(undefined8 param_1,undefined4 *param_2)

{
  longlong lVar1;
  
  lVar1 = FUN_140095830();
  if ((undefined4 *)(lVar1 + 0x18) != (undefined4 *)0x0) {
    *(undefined4 *)(lVar1 + 0x18) = *param_2;
    *(undefined4 *)(lVar1 + 0x1c) = param_2[1];
  }
  return;
}



void FUN_1400957f0(undefined8 param_1,undefined4 *param_2)

{
  longlong lVar1;
  
  lVar1 = FUN_140095830();
  if ((undefined4 *)(lVar1 + 0x18) != (undefined4 *)0x0) {
    *(undefined4 *)(lVar1 + 0x18) = *param_2;
    *(undefined1 *)(lVar1 + 0x1c) = *(undefined1 *)(param_2 + 1);
  }
  return;
}



void FUN_140095830(longlong param_1)

{
  undefined8 uVar1;
  undefined8 *puVar2;
  char *local_res10 [3];
  undefined **local_28 [4];
  
  puVar2 = operator_new(0x28);
  if (puVar2 != (undefined8 *)0x0) {
    *puVar2 = *(undefined8 *)(param_1 + 8);
    puVar2[1] = *(undefined8 *)(param_1 + 8);
    uVar1 = *(undefined8 *)(param_1 + 8);
    *(undefined2 *)(puVar2 + 4) = 0;
    puVar2[2] = uVar1;
    return;
  }
  local_res10[0] = (char *)0x0;
  std::exception::exception((exception *)local_28,local_res10);
  local_28[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_28,(ThrowInfo *)&DAT_1402f47a8);
}



void FUN_1400958b0(longlong *param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  __uint64 _Var4;
  void *_Dst;
  longlong lVar5;
  uint uVar6;
  float fVar7;
  
  if (param_2 == 0) {
    param_2 = FUN_14001de50(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_14000d350(param_1,param_2,0);
    }
    else {
      _Var4 = SUB168(ZEXT816(8) * ZEXT416(param_2),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_2),8) != 0) {
        _Var4 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var4);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_2 << 3);
      uVar6 = 0;
      if ((int)param_1[2] != 0) {
        lVar5 = 0;
        do {
          lVar3 = *(longlong *)(lVar5 + *param_1);
          while (lVar3 != 0) {
            lVar1 = *(longlong *)(lVar3 + 0xe0);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0xe8) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0xe0) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar3;
            lVar3 = lVar1;
          }
          uVar6 = uVar6 + 1;
          lVar5 = lVar5 + 8;
        } while (uVar6 < *(uint *)(param_1 + 2));
      }
      operator_delete__((void *)*param_1);
      *param_1 = (longlong)_Dst;
      *(uint *)(param_1 + 2) = param_2;
      fVar7 = (float)param_2 * *(float *)((longlong)param_1 + 0x1c);
      lVar5 = 0;
      if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      param_1[4] = (longlong)fVar7 + lVar5;
      fVar7 = (float)param_2 * *(float *)(param_1 + 3);
      lVar5 = 0;
      if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      param_1[5] = (longlong)fVar7 + lVar5;
      if ((ulonglong)((longlong)fVar7 + lVar5) < 0x11) {
        param_1[5] = 0;
      }
    }
  }
  return;
}



undefined4 *
FUN_140095a60(longlong *param_1,undefined4 param_2,ulonglong param_3,undefined4 param_4)

{
  undefined4 *puVar1;
  undefined1 auVar2 [16];
  undefined4 uVar3;
  longlong *plVar4;
  undefined8 *puVar5;
  int iVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (param_1[8] == 0) {
    uVar7 = CONCAT44(0,*(uint *)((longlong)param_1 + 0x34));
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar2._8_8_ = 0;
      auVar2._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar2,0) < 0xf0)
      goto LAB_140095b2d;
      lVar8 = uVar7 * 0xf0;
    }
    if ((-lVar8 - 1U < 0x10) || (plVar4 = malloc(lVar8 + 0x10), plVar4 == (longlong *)0x0)) {
LAB_140095b2d:
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    *plVar4 = param_1[7];
    param_1[7] = (longlong)plVar4;
    iVar6 = *(int *)((longlong)param_1 + 0x34);
    plVar4 = plVar4 + (ulonglong)(iVar6 - 1) * 0x1e + 2;
    while (iVar6 = iVar6 + -1, -1 < iVar6) {
      plVar4[0x1c] = param_1[8];
      param_1[8] = (longlong)plVar4;
      plVar4 = plVar4 + -0x1e;
    }
  }
  puVar1 = (undefined4 *)param_1[8];
  if (puVar1 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar1 + 0x38);
  *puVar1 = param_2;
  *(undefined8 *)(puVar1 + 10) = 0xf;
  *(undefined8 *)(puVar1 + 8) = 0;
  *(undefined1 *)(puVar1 + 4) = 0;
  *(undefined8 *)(puVar1 + 0x14) = 0xf;
  *(undefined8 *)(puVar1 + 0x12) = 0;
  *(undefined1 *)(puVar1 + 0xe) = 0;
  iVar6 = 4;
  puVar5 = (undefined8 *)(puVar1 + 0x18);
  while (iVar6 = iVar6 + -1, -1 < iVar6) {
    *puVar5 = 0;
    puVar5[1] = 0;
    puVar5[2] = 0;
    puVar5[3] = 0;
    puVar5 = puVar5 + 4;
  }
  puVar1[2] = 0xf0001;
  puVar1[0x3a] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar1 + 0x38) = *(undefined8 *)(*param_1 + (param_3 & 0xffffffff) * 8);
  *(undefined4 **)(*param_1 + (param_3 & 0xffffffff) * 8) = puVar1;
  if (((ulonglong)param_1[4] < (ulonglong)param_1[1]) && ((int)param_1[6] == 0)) {
    uVar3 = FUN_14001de50(param_1);
    FUN_1400958b0(param_1,uVar3);
  }
  return puVar1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined4 * FUN_140095c60(void)

{
  longlong *plVar1;
  char cVar2;
  int iVar3;
  longlong *plVar4;
  ulonglong uVar5;
  longlong lVar6;
  char *pcVar7;
  char *pcVar8;
  bool bVar9;
  undefined **local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined4 local_88;
  longlong *local_80;
  undefined8 local_78;
  undefined8 *local_70;
  void *local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined1 local_50;
  undefined4 local_4c;
  undefined8 *local_48;
  void *local_40;
  undefined4 local_38;
  undefined8 local_34;
  undefined1 local_2c;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  _DAT_140320180 = 0x100000001;
  _DAT_140320188 = 0x100000001;
  _DAT_140320190 = 0x100000001;
  _DAT_140320198 = 0x100000001;
  _DAT_1403201a0 = 0x100000001;
  _DAT_1403201a8 = 0x100000001;
  _DAT_1403201b0 = 0x100000001;
  _DAT_1403201b8 = 0x100000001;
  _DAT_1403201c0 = 0x100000001;
  pcVar7 = (char *)&DAT_140312ed0;
  if (0xf < DAT_140312ee8) {
    pcVar7 = DAT_140312ed0;
  }
  local_a0 = 0xffffffffffffffff;
  local_98 = 0;
  local_70 = &DAT_14031fee8;
  local_90 = 0;
  local_88 = 0;
  local_80 = (longlong *)0x0;
  local_78 = 0;
  local_60 = 0;
  local_58 = 0;
  local_a8 = TiXmlDocument::vftable;
  local_48 = &DAT_14031fee8;
  local_34 = 0xffffffffffffffff;
  local_38 = 4;
  local_2c = 0;
  uVar5 = 0xffffffffffffffff;
  pcVar8 = pcVar7;
  do {
    if (uVar5 == 0) break;
    uVar5 = uVar5 - 1;
    cVar2 = *pcVar8;
    pcVar8 = pcVar8 + 1;
  } while (cVar2 != '\0');
  FUN_140026290(&local_70,pcVar7,~uVar5 - 1);
  local_50 = 0;
  local_4c = 0;
  FUN_140026290(&local_48,&DAT_14027a10a,0);
  local_34 = 0;
  DAT_1403100dc = 0;
  cVar2 = FUN_1400276a0(&local_a8,local_70 + 2);
  plVar4 = local_80;
  if (cVar2 == '\0') {
    local_a8 = TiXmlDocument::vftable;
    if (local_48 != &DAT_14031fee8) {
      operator_delete__(local_40);
    }
    local_a8 = TiXmlNode::vftable;
    plVar4 = local_80;
    while (plVar4 != (longlong *)0x0) {
      plVar1 = (longlong *)plVar4[10];
      (**(code **)*plVar4)(plVar4,1);
      plVar4 = plVar1;
    }
    if (local_70 != &DAT_14031fee8) {
      operator_delete__(local_68);
    }
    goto LAB_140095f48;
  }
  for (; plVar4 != (longlong *)0x0; plVar4 = (longlong *)plVar4[10]) {
    bVar9 = (char *)(plVar4[7] + 0x10) == (char *)0x0;
    lVar6 = 4;
    pcVar7 = (char *)(plVar4[7] + 0x10);
    pcVar8 = "log";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar9 = *pcVar7 == *pcVar8;
      pcVar7 = pcVar7 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar9);
    if (bVar9) goto LAB_140095e26;
  }
  goto LAB_140095ef2;
code_r0x000140095e84:
  plVar4 = (longlong *)plVar4[10];
  if (plVar4 == (longlong *)0x0) goto LAB_140095ee9;
  goto LAB_140095e76;
LAB_140095e26:
  while (lVar6 = (**(code **)(*plVar4 + 0x30))(plVar4), lVar6 == 0) {
    do {
      plVar4 = (longlong *)plVar4[10];
      if (plVar4 == (longlong *)0x0) goto LAB_140095ef2;
      bVar9 = (char *)(plVar4[7] + 0x10) == (char *)0x0;
      lVar6 = 4;
      pcVar7 = (char *)(plVar4[7] + 0x10);
      pcVar8 = "log";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar9 = *pcVar7 == *pcVar8;
        pcVar7 = pcVar7 + 1;
        pcVar8 = pcVar8 + 1;
      } while (bVar9);
    } while (!bVar9);
  }
  lVar6 = (**(code **)(*plVar4 + 0x30))(plVar4);
  if (lVar6 != 0) {
    plVar4 = *(longlong **)(lVar6 + 0x28);
    if (plVar4 != (longlong *)0x0) {
LAB_140095e76:
      lVar6 = (**(code **)(*plVar4 + 0x30))(plVar4);
      if (lVar6 == 0) goto code_r0x000140095e84;
      for (plVar4 = (longlong *)(**(code **)(*plVar4 + 0x30))(plVar4); plVar4 != (longlong *)0x0;
          plVar4 = (longlong *)(**(code **)(*plVar4 + 0x30))(plVar4)) {
        iVar3 = _stricmp((char *)(plVar4[7] + 0x10),"log_type");
        if (iVar3 == 0) {
          FUN_140095f70(plVar4);
        }
        do {
          plVar4 = (longlong *)plVar4[10];
          if (plVar4 == (longlong *)0x0) goto LAB_140095ee9;
          lVar6 = (**(code **)(*plVar4 + 0x30))(plVar4);
        } while (lVar6 == 0);
      }
    }
LAB_140095ee9:
    FUN_140096080();
  }
LAB_140095ef2:
  local_a8 = TiXmlDocument::vftable;
  if (local_48 != &DAT_14031fee8) {
    operator_delete__(local_40);
  }
  local_a8 = TiXmlNode::vftable;
  plVar4 = local_80;
  while (plVar4 != (longlong *)0x0) {
    plVar1 = (longlong *)plVar4[10];
    (**(code **)*plVar4)(plVar4,1);
    plVar4 = plVar1;
  }
  if (local_70 != &DAT_14031fee8) {
    operator_delete__(local_68);
  }
LAB_140095f48:
  return &DAT_140320180;
}



void FUN_140095f70(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  uint uVar5;
  longlong lVar6;
  longlong lVar7;
  char *pcVar8;
  char *pcVar9;
  char *pcVar10;
  uint uVar11;
  char *pcVar12;
  bool bVar13;
  
  lVar1 = param_1 + 0x58;
  lVar2 = *(longlong *)(param_1 + 0xa0);
  for (lVar7 = lVar2; lVar3 = lVar2, lVar7 != lVar1; lVar7 = *(longlong *)(lVar7 + 0x48)) {
    lVar6 = 4;
    pcVar8 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar13 = pcVar8 == (char *)0x0;
    pcVar9 = "use";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar13 = *pcVar8 == *pcVar9;
      pcVar8 = pcVar8 + 1;
      pcVar9 = pcVar9 + 1;
    } while (bVar13);
    if (bVar13) {
      pcVar8 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      goto joined_r0x000140095fbe;
    }
  }
  pcVar8 = (char *)0x0;
joined_r0x000140095fbe:
  do {
    if (lVar3 == lVar1) break;
    lVar7 = 3;
    pcVar9 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
    bVar13 = pcVar9 == (char *)0x0;
    pcVar10 = "id";
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      bVar13 = *pcVar9 == *pcVar10;
      pcVar9 = pcVar9 + 1;
      pcVar10 = pcVar10 + 1;
    } while (bVar13);
    if (bVar13) {
      pcVar9 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
      goto joined_r0x000140095fea;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
  pcVar9 = (char *)0x0;
joined_r0x000140095fea:
  do {
    if (lVar2 == lVar1) {
LAB_140096011:
      uVar11 = 1;
      if (pcVar8 != (char *)0x0) {
        iVar4 = atoi(pcVar8);
        uVar11 = (uint)(0 < iVar4);
      }
      if ((pcVar9 != (char *)0x0) && (uVar5 = atoi(pcVar9), uVar5 < 0x12)) {
        (&DAT_140320180)[(int)uVar5] = uVar11;
      }
      return;
    }
    lVar7 = 5;
    pcVar10 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
    bVar13 = pcVar10 == (char *)0x0;
    pcVar12 = "name";
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      bVar13 = *pcVar10 == *pcVar12;
      pcVar10 = pcVar10 + 1;
      pcVar12 = pcVar12 + 1;
    } while (bVar13);
    if (bVar13) goto LAB_140096011;
    lVar2 = *(longlong *)(lVar2 + 0x48);
  } while( true );
}



void FUN_140096080(void)

{
  undefined **ppuVar1;
  
  wprintf(L"----------------------\n");
  wprintf(L"LOG Option\n");
  wprintf(L"----------------------\n");
  ppuVar1 = &PTR_u_LOG_CONNECTION_140310a50;
  do {
    wprintf(L"%s : %s\n");
    ppuVar1 = ppuVar1 + 1;
  } while ((longlong)ppuVar1 < 0x140310ae0);
                    // WARNING: Could not recover jumptable at 0x000140096126. Too many branches
                    // WARNING: Treating indirect jump as call
  wprintf(L"----------------------\n");
  return;
}



undefined8 * FUN_140096130(undefined8 *param_1,uint param_2)

{
  char cVar1;
  
  *param_1 = MagiFileStream::vftable;
  cVar1 = FUN_140096240();
  if (cVar1 != '\0') {
    fclose((FILE *)param_1[3]);
    param_1[3] = 0;
  }
  *param_1 = MagiStream::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1400961a0(undefined8 *param_1)

{
  char cVar1;
  
  *param_1 = MagiFileStream::vftable;
  cVar1 = FUN_140096240();
  if (cVar1 != '\0') {
    fclose((FILE *)param_1[3]);
    param_1[3] = 0;
  }
  *param_1 = MagiStream::vftable;
  return;
}



void FUN_1400961f0(longlong param_1,void *param_2,size_t param_3)

{
                    // WARNING: Could not recover jumptable at 0x000140096206. Too many branches
                    // WARNING: Treating indirect jump as call
  fread(param_2,param_3,1,*(FILE **)(param_1 + 0x18));
  return;
}



void FUN_140096210(longlong param_1,void *param_2,size_t param_3)

{
                    // WARNING: Could not recover jumptable at 0x000140096226. Too many branches
                    // WARNING: Treating indirect jump as call
  fwrite(param_2,param_3,1,*(FILE **)(param_1 + 0x18));
  return;
}



void FUN_140096230(longlong param_1,longlong param_2,int param_3)

{
                    // WARNING: Could not recover jumptable at 0x000140096234. Too many branches
                    // WARNING: Treating indirect jump as call
  _fseeki64(*(FILE **)(param_1 + 0x18),param_2,param_3);
  return;
}



bool FUN_140096240(longlong param_1)

{
  return *(longlong *)(param_1 + 0x18) != 0;
}



void FUN_140096250(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x000140096254. Too many branches
                    // WARNING: Treating indirect jump as call
  _ftelli64(*(FILE **)(param_1 + 0x18));
  return;
}



bool FUN_140096260(longlong param_1)

{
  int iVar1;
  
  iVar1 = feof(*(FILE **)(param_1 + 0x18));
  return iVar1 != 0;
}



undefined8 FUN_140096280(longlong param_1)

{
  longlong lVar1;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    _fseeki64(*(FILE **)(param_1 + 0x18),0,2);
    lVar1 = _ftelli64(*(FILE **)(param_1 + 0x18));
    *(longlong *)(param_1 + 8) = lVar1;
    _fseeki64(*(FILE **)(param_1 + 0x18),0,0);
    return *(undefined8 *)(param_1 + 8);
  }
  return *(undefined8 *)(param_1 + 8);
}



undefined8 * FUN_1400962e0(undefined8 *param_1,uint param_2)

{
  *param_1 = MagiMemoryStream::vftable;
  if ((void *)param_1[3] != (void *)0x0) {
    operator_delete__((void *)param_1[3]);
  }
  param_1[3] = 0;
  *param_1 = MagiStream::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140096340(undefined8 *param_1)

{
  *param_1 = MagiMemoryStream::vftable;
  if ((void *)param_1[3] != (void *)0x0) {
    operator_delete__((void *)param_1[3]);
  }
  param_1[3] = 0;
  *param_1 = MagiStream::vftable;
  return;
}



size_t FUN_140096380(longlong param_1,void *param_2,size_t param_3)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x20);
  if (*(ulonglong *)(param_1 + 0x28) < lVar1 + param_3) {
    param_3 = *(ulonglong *)(param_1 + 0x28) - lVar1;
  }
  if (param_3 != 0) {
    memcpy(param_2,(void *)(lVar1 + *(longlong *)(param_1 + 0x18)),param_3);
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + param_3;
    return param_3;
  }
  return 0;
}



size_t FUN_1400963f0(longlong param_1,void *param_2,size_t param_3)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x20);
  if (*(ulonglong *)(param_1 + 0x28) < lVar1 + param_3) {
    param_3 = *(ulonglong *)(param_1 + 0x28) - lVar1;
  }
  if (param_3 != 0) {
    memcpy((void *)(lVar1 + *(longlong *)(param_1 + 0x18)),param_2,param_3);
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + param_3;
    return param_3;
  }
  return 0;
}



undefined4 FUN_140096450(longlong *param_1,longlong param_2,int param_3)

{
  char cVar1;
  
  cVar1 = (**(code **)(*param_1 + 0x38))();
  if (cVar1 == '\0') {
    return 0xffffffff;
  }
  if (param_3 == 0) {
    param_1[4] = param_2;
  }
  else if (param_3 == 1) {
    param_1[4] = param_1[4] + param_2;
  }
  else if (param_3 == 2) {
    param_1[4] = param_1[5];
  }
  if ((ulonglong)param_1[5] < (ulonglong)param_1[4]) {
    param_1[4] = param_1[5];
  }
  return (int)param_1[4];
}



undefined8 FUN_1400964d0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x20);
}



undefined8 FUN_1400964e0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x28);
}



bool FUN_1400964f0(longlong param_1)

{
  return *(longlong *)(param_1 + 0x20) == *(longlong *)(param_1 + 0x28);
}



bool FUN_140096500(longlong param_1)

{
  return *(longlong *)(param_1 + 0x18) != 0;
}



void FUN_140096510(undefined8 *param_1)

{
  *param_1 = MagiStream::vftable;
  return;
}



undefined8 * FUN_140096520(undefined8 *param_1,byte param_2)

{
  *param_1 = MagiStream::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140096550(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_140096730();
  }
  return;
}



void FUN_140096570(undefined8 *param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  
  if (param_1[4] != 0) {
    puVar4 = (undefined8 *)*param_1;
    puVar1 = puVar4 + param_1[1];
    for (; puVar4 != puVar1; puVar4 = puVar4 + 1) {
      puVar2 = (undefined8 *)*puVar4;
      *puVar4 = 0;
      while (puVar2 != (undefined8 *)0x0) {
        puVar3 = (undefined8 *)*puVar2;
        if (7 < (ulonglong)puVar2[9]) {
          operator_delete((void *)puVar2[6]);
        }
        puVar2[9] = 7;
        puVar2[8] = 0;
        *(undefined2 *)(puVar2 + 6) = 0;
        if (7 < (ulonglong)puVar2[4]) {
          operator_delete((void *)puVar2[1]);
        }
        puVar2[4] = 7;
        puVar2[3] = 0;
        *(undefined2 *)(puVar2 + 1) = 0;
        operator_delete(puVar2);
        puVar2 = puVar3;
      }
    }
    param_1[4] = 0;
    param_1[6] = puVar1;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140096699)

longlong * FUN_140096650(longlong *param_1,ushort *param_2)

{
  ulonglong uVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  ushort *puVar4;
  ushort *puVar5;
  uint uVar6;
  
  param_1 = (longlong *)*param_1;
  if (param_1 == (longlong *)0x0) {
    return (longlong *)0x0;
  }
  uVar1 = *(ulonglong *)(param_2 + 8);
  do {
    uVar2 = param_1[3];
    puVar4 = (ushort *)(param_1 + 1);
    if (7 < (ulonglong)param_1[4]) {
      puVar4 = *(ushort **)puVar4;
    }
    puVar5 = param_2;
    if (7 < *(ulonglong *)(param_2 + 0xc)) {
      puVar5 = *(ushort **)param_2;
    }
    uVar3 = uVar2;
    if (uVar1 < uVar2) {
      uVar3 = uVar1;
    }
    for (; uVar3 != 0; uVar3 = uVar3 - 1) {
      if (*puVar5 != *puVar4) {
        uVar6 = 1;
        if (*puVar5 < *puVar4) {
          uVar6 = 0xffffffff;
        }
        goto LAB_1400966d8;
      }
      puVar5 = puVar5 + 1;
      puVar4 = puVar4 + 1;
    }
    uVar6 = 0;
LAB_1400966d8:
    if (uVar6 == 0) {
      if (uVar2 <= uVar1) {
        uVar6 = (uint)(uVar1 != uVar2);
        goto LAB_1400966ed;
      }
    }
    else {
LAB_1400966ed:
      if (uVar6 == 0) {
        return param_1;
      }
    }
    param_1 = (longlong *)*param_1;
    if (param_1 == (longlong *)0x0) {
      return (longlong *)0x0;
    }
  } while( true );
}



void FUN_140096730(undefined8 *param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  
  puVar4 = (undefined8 *)*param_1;
  puVar1 = puVar4 + param_1[1];
  for (; puVar4 != puVar1; puVar4 = puVar4 + 1) {
    puVar2 = (undefined8 *)*puVar4;
    *puVar4 = 0;
    while (puVar2 != (undefined8 *)0x0) {
      puVar3 = (undefined8 *)*puVar2;
      if (7 < (ulonglong)puVar2[9]) {
        operator_delete((void *)puVar2[6]);
      }
      puVar2[9] = 7;
      puVar2[8] = 0;
      *(undefined2 *)(puVar2 + 6) = 0;
      if (7 < (ulonglong)puVar2[4]) {
        operator_delete((void *)puVar2[1]);
      }
      puVar2[4] = 7;
      puVar2[3] = 0;
      *(undefined2 *)(puVar2 + 1) = 0;
      operator_delete(puVar2);
      puVar2 = puVar3;
    }
  }
  operator_delete((void *)*param_1);
  *param_1 = 0;
  return;
}



longlong * FUN_140096800(longlong *param_1,longlong *param_2,ushort *param_3,longlong param_4)

{
  undefined8 *puVar1;
  char cVar2;
  ushort *puVar3;
  undefined8 *puVar4;
  ushort *puVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  ushort *puVar8;
  longlong lVar9;
  longlong *local_40;
  undefined8 *local_38;
  undefined2 local_30;
  
  puVar5 = param_3;
  if (7 < *(ulonglong *)(param_3 + 0xc)) {
    puVar5 = *(ushort **)param_3;
  }
  puVar3 = param_3;
  if (7 < *(ulonglong *)(param_3 + 0xc)) {
    puVar3 = *(ushort **)param_3;
  }
  uVar7 = 0;
  lVar9 = param_4;
  puVar8 = param_3;
  for (; puVar3 != puVar5 + *(longlong *)(param_3 + 8); puVar3 = puVar3 + 1) {
    lVar9 = uVar7 * 0x40;
    puVar8 = (ushort *)((ulonglong)*puVar3 + (uVar7 >> 2) + lVar9 + 0x9e3779b9);
    uVar7 = uVar7 ^ (ulonglong)puVar8;
  }
  puVar6 = (undefined8 *)(*param_1 + (uVar7 % (ulonglong)param_1[1]) * 8);
  lVar9 = FUN_140096650(puVar6,param_3,puVar8,lVar9,0xfffffffffffffffe);
  if (lVar9 == 0) {
    local_38 = (undefined8 *)0x0;
    local_30 = 0;
    local_40 = param_1;
    FUN_140096ea0(&local_40);
    puVar1 = local_38;
    if (local_38 + 1 != (undefined8 *)0x0) {
      FUN_140096fe0(local_38 + 1,param_4);
    }
    local_30 = CONCAT11(1,(undefined1)local_30);
    cVar2 = FUN_140096a30(param_1);
    if (cVar2 != '\0') {
      puVar6 = (undefined8 *)(*param_1 + (uVar7 % (ulonglong)param_1[1]) * 8);
    }
    *puVar1 = *puVar6;
    *puVar6 = puVar1;
    param_1[4] = param_1[4] + 1;
    puVar4 = (undefined8 *)param_1[6];
    if (puVar6 < (undefined8 *)param_1[6]) {
      puVar4 = puVar6;
    }
    param_1[6] = (longlong)puVar4;
    *param_2 = (longlong)puVar6;
    param_2[1] = (longlong)puVar1;
    *(undefined1 *)(param_2 + 2) = 1;
  }
  else {
    *param_2 = (longlong)puVar6;
    param_2[1] = lVar9;
    *(undefined1 *)(param_2 + 2) = 0;
  }
  return param_2;
}



undefined8 *
FUN_140096970(undefined8 param_1,undefined8 *param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  undefined1 local_30 [16];
  undefined8 local_20;
  void *local_18;
  undefined2 local_10;
  
  uVar3 = 0xfffffffffffffffe;
  local_18 = (void *)0x0;
  local_10 = 0;
  local_20 = param_1;
  FUN_140096ea0(&local_20);
  if ((longlong)local_18 + 8 != 0) {
    FUN_140096fe0((longlong)local_18 + 8,param_3);
  }
  local_10._1_1_ = '\x01';
  puVar2 = (undefined8 *)FUN_140096aa0(param_1,local_30,&local_20,param_4,uVar3);
  pvVar1 = local_18;
  *param_2 = *puVar2;
  param_2[1] = puVar2[1];
  *(undefined1 *)(param_2 + 2) = 1;
  if (local_18 != (void *)0x0) {
    if (local_10._1_1_ != '\0') {
      FUN_140096f80((longlong)local_18 + 8);
    }
    operator_delete(pvVar1);
  }
  return param_2;
}



undefined8 FUN_140096a30(longlong param_1,ulonglong param_2)

{
  longlong lVar1;
  ulonglong *puVar2;
  ulonglong local_res8;
  ulonglong local_res10 [3];
  
  local_res10[0] = param_2;
  if (*(ulonglong *)(param_1 + 0x38) <= param_2) {
    local_res8 = (*(ulonglong *)(param_1 + 0x20) >> 1) + *(ulonglong *)(param_1 + 0x20);
    puVar2 = &local_res8;
    if (local_res8 <= param_2) {
      puVar2 = local_res10;
    }
    lVar1 = FUN_14001ed50(param_1,*puVar2);
    if (lVar1 != *(longlong *)(param_1 + 8)) {
      FUN_140096c70(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



longlong * FUN_140096aa0(longlong *param_1,longlong *param_2,longlong param_3)

{
  ulonglong *puVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined8 *puVar4;
  undefined8 uVar5;
  ushort *puVar6;
  ulonglong *puVar7;
  ulonglong uVar8;
  ushort *puVar9;
  ulonglong local_res8;
  
  lVar3 = *(longlong *)(param_3 + 8);
  puVar6 = (ushort *)(lVar3 + 8);
  puVar9 = puVar6;
  if (7 < *(ulonglong *)(lVar3 + 0x20)) {
    puVar9 = *(ushort **)puVar6;
  }
  if (7 < *(ulonglong *)(lVar3 + 0x20)) {
    puVar6 = *(ushort **)puVar6;
  }
  uVar8 = 0;
  for (; puVar6 != puVar9 + *(longlong *)(lVar3 + 0x18); puVar6 = puVar6 + 1) {
    uVar8 = uVar8 ^ (ulonglong)*puVar6 + (uVar8 >> 2) + uVar8 * 0x40 + 0x9e3779b9;
  }
  if (*param_1 == 0) {
    local_res8 = FUN_14001ed50(param_1);
    puVar1 = (ulonglong *)(param_1 + 1);
    puVar7 = &local_res8;
    if (local_res8 <= *puVar1) {
      puVar7 = puVar1;
    }
    *puVar1 = *puVar7;
    FUN_140097060(param_1);
    FUN_14009b090(param_1);
  }
  else {
    FUN_140096a30();
  }
  plVar2 = (longlong *)(*param_1 + (uVar8 % (ulonglong)param_1[1]) * 8);
  puVar4 = *(undefined8 **)(param_3 + 8);
  *(undefined8 *)(param_3 + 8) = 0;
  uVar5 = *plVar2;
  *param_2 = (longlong)plVar2;
  *puVar4 = uVar5;
  *plVar2 = (longlong)puVar4;
  param_1[4] = param_1[4] + 1;
  param_2[1] = (longlong)puVar4;
  param_1[6] = (longlong)plVar2;
  return param_2;
}



void FUN_140096bc0(void *param_1)

{
  if (7 < *(ulonglong *)((longlong)param_1 + 0x48)) {
    operator_delete(*(void **)((longlong)param_1 + 0x30));
  }
  *(undefined8 *)((longlong)param_1 + 0x48) = 7;
  *(undefined8 *)((longlong)param_1 + 0x40) = 0;
  *(undefined2 *)((longlong)param_1 + 0x30) = 0;
  if (7 < *(ulonglong *)((longlong)param_1 + 0x20)) {
    operator_delete(*(void **)((longlong)param_1 + 8));
  }
  *(undefined8 *)((longlong)param_1 + 0x20) = 7;
  *(undefined8 *)((longlong)param_1 + 0x18) = 0;
  *(undefined2 *)((longlong)param_1 + 8) = 0;
                    // WARNING: Could not recover jumptable at 0x000140096c1e. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(param_1);
  return;
}



void FUN_140096c30(longlong param_1)

{
  if (*(longlong *)(param_1 + 8) != 0) {
    if (*(char *)(param_1 + 0x11) != '\0') {
      FUN_140096f80(*(longlong *)(param_1 + 8) + 8);
    }
    operator_delete(*(void **)(param_1 + 8));
  }
  return;
}



void FUN_140096c70(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 *puVar3;
  ushort *puVar4;
  longlong *plVar5;
  longlong lVar6;
  ushort *puVar7;
  undefined8 *puVar8;
  longlong lVar9;
  ulonglong uVar10;
  double dVar11;
  longlong local_50;
  ulonglong local_48;
  longlong local_38;
  longlong local_30;
  
  lVar9 = param_1[4];
  lVar6 = param_1[1];
  lVar1 = *param_1;
  local_50 = 0;
  local_48 = param_2;
  FUN_140097060(&local_50,param_2,lVar6,param_4,0xfffffffffffffffe);
  local_30 = param_1[1];
  lVar2 = *param_1;
  *param_1 = 0;
  param_1[1] = local_30;
  param_1[4] = 0;
  for (puVar8 = (undefined8 *)param_1[6]; puVar8 != (undefined8 *)(lVar1 + lVar6 * 8);
      puVar8 = puVar8 + 1) {
    puVar3 = (undefined8 *)*puVar8;
    while (puVar3 != (undefined8 *)0x0) {
      puVar4 = (ushort *)(puVar3 + 1);
      puVar7 = puVar4;
      if (7 < (ulonglong)puVar3[4]) {
        puVar7 = *(ushort **)puVar4;
      }
      if (7 < (ulonglong)puVar3[4]) {
        puVar4 = *(ushort **)puVar4;
      }
      uVar10 = 0;
      for (; puVar4 != puVar7 + puVar3[3]; puVar4 = puVar4 + 1) {
        uVar10 = uVar10 ^ (ulonglong)*puVar4 + (uVar10 >> 2) + uVar10 * 0x40 + 0x9e3779b9;
      }
      *puVar8 = *puVar3;
      *puVar3 = *(undefined8 *)(local_50 + (uVar10 % local_48) * 8);
      *(undefined8 **)(local_50 + (uVar10 % local_48) * 8) = puVar3;
      puVar3 = (undefined8 *)*puVar8;
    }
  }
  param_1[4] = lVar9;
  lVar9 = *param_1;
  *param_1 = local_50;
  lVar6 = param_1[1];
  param_1[1] = local_48;
  plVar5 = (longlong *)*param_1;
  if (param_1[4] == 0) {
    param_1[6] = (longlong)(plVar5 + local_48);
  }
  else {
    param_1[6] = (longlong)plVar5;
    lVar1 = *plVar5;
    while (lVar1 == 0) {
      plVar5 = plVar5 + 1;
      param_1[6] = (longlong)plVar5;
      lVar1 = *plVar5;
    }
  }
  dVar11 = (double)param_1[1];
  if (param_1[1] < 0) {
    dVar11 = dVar11 + 1.8446744073709552e+19;
  }
  local_50 = lVar9;
  local_48 = lVar6;
  local_38 = lVar2;
  dVar11 = ceil((double)*(float *)(param_1 + 5) * dVar11);
  lVar6 = -1;
  if (dVar11 < 1.8446744073709552e+19) {
    lVar6 = 0;
    if ((9.223372036854776e+18 < dVar11) &&
       (dVar11 = dVar11 - 9.223372036854776e+18, dVar11 < 9.223372036854776e+18)) {
      lVar6 = -0x8000000000000000;
    }
    lVar6 = (longlong)dVar11 + lVar6;
  }
  param_1[7] = lVar6;
  if (lVar2 != 0) {
    FUN_140096730(&local_38);
    lVar9 = local_50;
  }
  if (lVar9 != 0) {
    FUN_140096730(&local_50);
  }
  return;
}



void FUN_140096ea0(longlong param_1)

{
  undefined8 *puVar1;
  char *local_res8 [4];
  undefined **local_88 [5];
  undefined8 uStack_60;
  undefined8 local_58;
  undefined8 uStack_50;
  undefined8 local_48;
  undefined8 uStack_40;
  undefined8 local_38;
  undefined8 uStack_30;
  undefined8 local_28;
  undefined8 uStack_20;
  undefined8 local_18;
  
  if (*(longlong *)(param_1 + 8) != 0) {
    FUN_140096f80(*(longlong *)(param_1 + 8) + 8);
    *(undefined1 *)(param_1 + 0x11) = 0;
    return;
  }
  *(undefined2 *)(param_1 + 0x10) = 0;
  puVar1 = operator_new(0x58);
  if (puVar1 != (undefined8 *)0x0) {
    *(undefined8 **)(param_1 + 8) = puVar1;
    *puVar1 = 0;
    puVar1[1] = uStack_60;
    puVar1[2] = local_58;
    puVar1[3] = uStack_50;
    puVar1[4] = local_48;
    puVar1[5] = uStack_40;
    puVar1[6] = local_38;
    puVar1[7] = uStack_30;
    puVar1[8] = local_28;
    puVar1[9] = uStack_20;
    puVar1[10] = local_18;
    *(undefined1 *)(param_1 + 0x10) = 1;
    return;
  }
  local_res8[0] = (char *)0x0;
  std::exception::exception((exception *)local_88,local_res8);
  local_88[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_88,(ThrowInfo *)&DAT_1402f47a8);
}



void FUN_140096f80(undefined8 *param_1)

{
  if (7 < (ulonglong)param_1[8]) {
    operator_delete((void *)param_1[5]);
  }
  param_1[8] = 7;
  param_1[7] = 0;
  *(undefined2 *)(param_1 + 5) = 0;
  if (7 < (ulonglong)param_1[3]) {
    operator_delete((void *)*param_1);
  }
  param_1[3] = 7;
  param_1[2] = 0;
  *(undefined2 *)param_1 = 0;
  return;
}



undefined2 * FUN_140096fe0(undefined2 *param_1,longlong param_2)

{
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  FUN_140001700(param_1,param_2,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x1c) = 0;
  param_1[0x14] = 0;
  FUN_140001700(param_1 + 0x14,param_2 + 0x28,0,0xffffffffffffffff);
  return param_1;
}



void FUN_140097060(undefined8 *param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  char *local_res8;
  undefined **local_40 [3];
  undefined8 *local_28;
  undefined8 local_20;
  undefined8 local_18;
  ulonglong local_10;
  
  local_28 = param_1 + 2;
  puVar1 = (undefined8 *)0x0;
  local_18 = 0;
  local_20 = 0;
  uVar3 = param_1[1] + 1;
  if ((uVar3 != 0) &&
     ((local_10 = uVar3, 0x1fffffffffffffff < uVar3 ||
      (puVar1 = operator_new(uVar3 * 8), puVar1 == (undefined8 *)0x0)))) {
    local_res8 = (char *)0x0;
    std::exception::exception((exception *)local_40,&local_res8);
    local_40[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_40,(ThrowInfo *)&DAT_1402f47a8);
  }
  for (puVar2 = puVar1; puVar2 != puVar1 + uVar3; puVar2 = puVar2 + 1) {
    if (puVar2 != (undefined8 *)0x0) {
      *puVar2 = 0;
    }
  }
  puVar1[param_1[1]] = puVar1 + param_1[1];
  *param_1 = puVar1;
  return;
}



undefined8 * FUN_140097150(undefined8 *param_1)

{
  LPCRITICAL_SECTION p_Var1;
  LPCRITICAL_SECTION lpCriticalSection;
  
  *param_1 = MBISingleton<>::vftable;
  param_1[1] = MBMultiThreadSync<>::vftable;
  p_Var1 = DAT_140320178;
  if ((DAT_140320178 == (LPCRITICAL_SECTION)0x0) &&
     (lpCriticalSection = operator_new(0x28), p_Var1 = (LPCRITICAL_SECTION)0x0,
     lpCriticalSection != (LPCRITICAL_SECTION)0x0)) {
    InitializeCriticalSection(lpCriticalSection);
    p_Var1 = lpCriticalSection;
  }
  DAT_140320178 = p_Var1;
  *param_1 = MagiTable::TableManager::vftable;
  param_1[1] = MagiTable::TableManager::vftable;
  param_1[2] = MagiTable::TableManager::vftable;
  FUN_140099f20(param_1 + 3);
  FUN_140099f20(param_1 + 0xb);
  param_1[0x13] = 0;
  param_1[0x14] = 0;
  param_1[0x15] = 0;
  *(undefined2 *)(param_1 + 0x17) = 0;
  param_1[0x18] = 0;
  param_1[0x19] = 0;
  param_1[0x1a] = 0;
  param_1[0x1b] = 0;
  return param_1;
}



void * FUN_140097240(void *param_1,uint param_2)

{
  FUN_140097270();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140097270(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  LPCRITICAL_SECTION p_Var1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  *param_1 = MagiTable::TableManager::vftable;
  param_1[1] = MagiTable::TableManager::vftable;
  param_1[2] = MagiTable::TableManager::vftable;
  FUN_140099fa0(param_1 + 3);
  FUN_140096570(param_1 + 0xb);
  if (param_1[0x19] != 0) {
    FUN_14009a6d0(param_1[0x19],param_1[0x1a],param_3,param_4,uVar2);
    operator_delete((void *)param_1[0x19]);
  }
  param_1[0x19] = 0;
  param_1[0x1a] = 0;
  param_1[0x1b] = 0;
  if (param_1[0x13] != 0) {
    FUN_14009a6d0(param_1[0x13],param_1[0x14],param_3,param_4,uVar2);
    operator_delete((void *)param_1[0x13]);
  }
  param_1[0x13] = 0;
  param_1[0x14] = 0;
  param_1[0x15] = 0;
  if (param_1[0xb] != 0) {
    FUN_140096730(param_1 + 0xb);
  }
  if (param_1[3] != 0) {
    FUN_14009a1f0(param_1 + 3);
  }
  param_1[1] = MBMultiThreadSync<>::vftable;
  p_Var1 = DAT_140320178;
  if (DAT_140320178 != (LPCRITICAL_SECTION)0x0) {
    DeleteCriticalSection(DAT_140320178);
    operator_delete(p_Var1);
  }
  DAT_140320178 = (LPCRITICAL_SECTION)0x0;
  *param_1 = MBISingleton<>::vftable;
  DAT_140320130 = 0;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400973c0(longlong param_1)

{
  int *piVar1;
  ushort *puVar2;
  short sVar3;
  undefined4 uVar4;
  undefined8 **ppuVar5;
  undefined8 **ppuVar6;
  void *pvVar7;
  undefined8 *puVar8;
  uint uVar9;
  undefined4 uVar10;
  short *psVar12;
  void **_Src;
  int iVar13;
  ulonglong uVar14;
  ushort *puVar15;
  longlong *plVar16;
  undefined4 *puVar17;
  undefined8 uVar18;
  ushort *puVar19;
  undefined4 *puVar20;
  longlong lVar21;
  short *psVar22;
  undefined4 *puVar23;
  bool bVar24;
  undefined1 auStack_168 [32];
  undefined8 *local_148;
  undefined8 *local_140;
  longlong local_138 [2];
  undefined4 *local_128;
  undefined1 local_100 [24];
  ushort local_e8;
  undefined6 uStack_e6;
  longlong local_d8;
  ulonglong local_d0;
  void *local_b8 [2];
  void *local_a8;
  void *local_a0;
  undefined2 local_90;
  undefined6 uStack_8e;
  undefined8 local_80;
  ulonglong local_78;
  undefined2 local_68;
  undefined6 uStack_66;
  undefined8 local_58;
  ulonglong local_50;
  ulonglong local_30;
  undefined4 *puVar11;
  
  local_138[1] = 0xfffffffffffffffe;
  local_30 = DAT_1402f85a0 ^ (ulonglong)auStack_168;
  EnterCriticalSection(DAT_140320178);
  FUN_140097940(&local_148,L"table\\TableList.rh");
  ppuVar5 = *(undefined8 ***)(param_1 + 0xa0);
  if ((&local_148 < ppuVar5) && (ppuVar6 = *(undefined8 ***)(param_1 + 0x98), ppuVar6 <= &local_148)
     ) {
    if (ppuVar5 == *(undefined8 ***)(param_1 + 0xa8)) {
      FUN_140099b40(param_1 + 0x98);
    }
    plVar16 = *(longlong **)(param_1 + 0xa0);
    if (plVar16 == (longlong *)0x0) goto LAB_1400974bd;
    lVar21 = *(longlong *)
              (((longlong)&local_148 - (longlong)ppuVar6 & 0xfffffffffffffff0U) +
              *(longlong *)(param_1 + 0x98));
    *plVar16 = lVar21;
    plVar16[1] = lVar21;
  }
  else {
    if (ppuVar5 == *(undefined8 ***)(param_1 + 0xa8)) {
      FUN_140099b40(param_1 + 0x98);
    }
    plVar16 = *(longlong **)(param_1 + 0xa0);
    if (plVar16 == (longlong *)0x0) goto LAB_1400974bd;
    *plVar16 = (longlong)local_148;
    plVar16[1] = (longlong)local_148;
    lVar21 = *plVar16;
  }
  if (lVar21 != 0) {
    LOCK();
    *(int *)(lVar21 + 8) = *(int *)(lVar21 + 8) + 1;
    UNLOCK();
  }
LAB_1400974bd:
  *(longlong *)(param_1 + 0xa0) = *(longlong *)(param_1 + 0xa0) + 0x10;
  puVar17 = (undefined4 *)0x0;
  puVar23 = puVar17;
  if (local_148 != (undefined8 *)0x0) {
    if (local_148 == local_140) {
      puVar23 = (undefined4 *)*local_148;
    }
    else {
      iVar13 = DAT_140320168 + 1;
      bVar24 = DAT_140320168 == 0;
      DAT_140320168 = iVar13;
      if (bVar24) {
        FUN_14001f5c0(1);
      }
    }
  }
  if ((*(longlong *)(puVar23 + 0x1c) != 0) && (puVar23[0x1e] != 0)) {
    puVar11 = puVar17;
    plVar16 = *(longlong **)(puVar23 + 0x1a);
    do {
      if (*plVar16 != 0) {
        puVar17 = (undefined4 *)(*(longlong **)(puVar23 + 0x1a))[(longlong)puVar11];
        break;
      }
      uVar9 = (int)puVar11 + 1;
      puVar11 = (undefined4 *)(ulonglong)uVar9;
      plVar16 = plVar16 + 1;
    } while (uVar9 < (uint)puVar23[0x1e]);
  }
  do {
    puVar11 = puVar17;
    puVar8 = local_148;
    uVar18 = 0;
    local_128 = puVar11;
    if (puVar11 == (undefined4 *)0x0) {
      if (local_148 != (undefined8 *)0x0) {
        if (local_148 == local_140) {
          if (local_148 != (undefined8 *)0x0) {
            LOCK();
            piVar1 = (int *)(local_148 + 1);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              local_148 = (undefined8 *)0x0;
              pvVar7 = (void *)*puVar8;
              if (pvVar7 != (void *)0x0) {
                FUN_14009b490(pvVar7);
                operator_delete(pvVar7);
              }
              operator_delete(puVar8);
            }
          }
        }
        else {
          iVar13 = DAT_14032016c + 1;
          bVar24 = DAT_14032016c == 0;
          DAT_14032016c = iVar13;
          if (bVar24) {
            FUN_14001f5c0(1);
          }
        }
      }
      LeaveCriticalSection(DAT_140320178);
      return;
    }
    uVar4 = *puVar11;
    if (local_148 != (undefined8 *)0x0) {
      if (local_148 == local_140) {
        uVar18 = *local_148;
      }
      else {
        iVar13 = DAT_140320168 + 1;
        bVar24 = DAT_140320168 == 0;
        DAT_140320168 = iVar13;
        if (bVar24) {
          FUN_14001f5c0(1);
        }
      }
    }
    uVar10 = FUN_14009bbf0(uVar18,L"szName");
    psVar12 = (short *)FUN_14009b870(uVar18,uVar4,uVar10,L"szName");
    if (local_148 == (undefined8 *)0x0) {
LAB_1400975d5:
      uVar18 = 0;
    }
    else {
      if (local_148 != local_140) {
        iVar13 = DAT_140320168 + 1;
        bVar24 = DAT_140320168 == 0;
        DAT_140320168 = iVar13;
        if (bVar24) {
          FUN_14001f5c0(1);
        }
        goto LAB_1400975d5;
      }
      uVar18 = *local_148;
    }
    uVar10 = FUN_14009bbf0(uVar18,L"szTableFile");
    local_138[0] = FUN_14009b870(uVar18,uVar4,uVar10,L"szTableFile");
    if (*(char *)(param_1 + 0xb9) == '\0') {
      if ((psVar12 != (short *)0x0) && (local_138[0] != 0)) {
        FUN_140098460(param_1,psVar12,local_138[0]);
      }
    }
    else {
      local_d0 = 7;
      local_d8 = 0;
      local_e8 = 0;
      uVar14 = 0xffffffffffffffff;
      psVar22 = psVar12;
      do {
        if (uVar14 == 0) break;
        uVar14 = uVar14 - 1;
        sVar3 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar3 != 0);
      FUN_140001b00(&local_e8,psVar12,~uVar14 - 1);
      puVar15 = &local_e8;
      if (7 < local_d0) {
        puVar15 = (ushort *)CONCAT62(uStack_e6,local_e8);
      }
      puVar2 = puVar15 + local_d8;
      puVar19 = &local_e8;
      if (7 < local_d0) {
        puVar19 = (ushort *)CONCAT62(uStack_e6,local_e8);
      }
      if (puVar19 != puVar2) {
        lVar21 = (longlong)puVar15 - (longlong)puVar19;
        do {
          iVar13 = tolower((uint)*puVar19);
          *(short *)((longlong)puVar19 + lVar21) = (short)iVar13;
          puVar19 = puVar19 + 1;
        } while (puVar19 != puVar2);
      }
      _Src = (void **)FUN_140099de0(&local_68,&local_e8,local_138);
      local_a0 = (void *)0x7;
      local_a8 = (void *)0x0;
      uVar14 = (ulonglong)local_b8[0] >> 0x10;
      local_b8[0] = (void *)(uVar14 << 0x10);
      if (local_b8 != _Src) {
        local_a0 = (void *)0x7;
        local_a8 = (void *)0x0;
        local_b8[0] = (void *)(uVar14 << 0x10);
        if (_Src[3] < (void *)0x8) {
          memmove(local_b8,_Src,((longlong)_Src[2] + 1) * 2);
        }
        else {
          local_b8[0] = *_Src;
          *_Src = (void *)0x0;
        }
        local_a8 = _Src[2];
        local_a0 = _Src[3];
        _Src[2] = (void *)0x0;
        _Src[3] = (void *)0x0;
      }
      local_78 = 7;
      local_80 = 0;
      local_90 = 0;
      uVar14 = 0xffffffffffffffff;
      psVar12 = _Src[5];
      do {
        if (uVar14 == 0) break;
        uVar14 = uVar14 - 1;
        sVar3 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar3 != 0);
      FUN_140001b00(&local_90,_Src[5],~uVar14 - 1);
      if (*(longlong *)(param_1 + 0x78) == 0) {
        FUN_140096970(param_1 + 0x58,local_100,local_b8);
      }
      else {
        FUN_140096800();
      }
      if (7 < local_78) {
        operator_delete((void *)CONCAT62(uStack_8e,local_90));
      }
      local_78 = 7;
      local_80 = 0;
      local_90 = 0;
      if ((void *)0x7 < local_a0) {
        operator_delete(local_b8[0]);
      }
      local_a0 = (void *)0x7;
      local_a8 = (void *)0x0;
      local_b8[0] = (void *)((ulonglong)local_b8[0] & 0xffffffffffff0000);
      if (7 < local_50) {
        operator_delete((void *)CONCAT62(uStack_66,local_68));
      }
      local_50 = 7;
      local_58 = 0;
      local_68 = 0;
      if (7 < local_d0) {
        operator_delete((void *)CONCAT62(uStack_e6,local_e8));
      }
      local_d0 = 7;
      local_d8 = 0;
      local_e8 = 0;
    }
    puVar20 = (undefined4 *)0x0;
    puVar17 = *(undefined4 **)(puVar11 + 6);
    if (*(undefined4 **)(puVar11 + 6) == (undefined4 *)0x0) {
      uVar9 = (uint)puVar11[8] % (uint)puVar23[0x1e] + 1;
      lVar21 = (longlong)(int)uVar9 << 3;
      do {
        puVar17 = puVar20;
        if ((uint)puVar23[0x1e] <= uVar9) break;
        if (*(longlong *)(*(longlong *)(puVar23 + 0x1a) + lVar21) != 0) {
          puVar20 = *(undefined4 **)(*(longlong *)(puVar23 + 0x1a) + lVar21);
        }
        uVar9 = uVar9 + 1;
        lVar21 = lVar21 + 8;
        puVar17 = puVar20;
      } while (puVar20 == (undefined4 *)0x0);
    }
  } while( true );
}



void FUN_140097900(undefined8 *param_1)

{
  if (7 < (ulonglong)param_1[3]) {
    operator_delete((void *)*param_1);
  }
  param_1[3] = 7;
  param_1[2] = 0;
  *(undefined2 *)param_1 = 0;
  return;
}



void FUN_140097930(longlong param_1)

{
  FUN_140099c50(param_1 + 8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_140097940(undefined8 *param_1,wchar_t *param_2)

{
  ulonglong *puVar1;
  undefined4 uVar2;
  char cVar3;
  void *pvVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  int iVar7;
  uint uVar8;
  ulonglong *puVar9;
  __uint64 _Size;
  size_t sVar10;
  size_t _Size_00;
  ulonglong uVar11;
  undefined1 auStack_db8 [32];
  undefined4 local_d98;
  undefined **local_d90;
  longlong local_d88;
  undefined4 local_d80;
  FILE *local_d78;
  ulonglong *local_d70;
  ulonglong *local_d68;
  int local_d60;
  undefined4 local_d5c;
  undefined **local_d58;
  undefined8 local_d50;
  undefined4 local_d48;
  void *local_d40;
  size_t local_d38;
  ulonglong local_d30;
  undefined ***local_d28;
  void *local_d20;
  undefined8 local_d18;
  undefined8 *local_d10;
  undefined8 local_d08;
  undefined8 uStack_d00;
  undefined8 local_cf8;
  undefined8 uStack_cf0;
  undefined1 local_ce8 [1136];
  undefined **local_878;
  HANDLE local_870;
  undefined2 local_868;
  void *local_68;
  void *local_60;
  void *local_58;
  int local_50;
  ulonglong local_40;
  
  local_d18 = 0xfffffffffffffffe;
  local_40 = DAT_1402f85a0 ^ (ulonglong)auStack_db8;
  local_d98 = 0;
  local_d10 = param_1;
  EnterCriticalSection(DAT_140320178);
  local_d70 = (ulonglong *)0x0;
  pvVar4 = operator_new(0xb0);
  if ((pvVar4 == (void *)0x0) || (uVar5 = FUN_14009b390(pvVar4), uVar5 == 0)) {
    local_d70 = (ulonglong *)0x0;
  }
  else {
    local_d70 = operator_new(0x10);
    *local_d70 = uVar5;
    *(undefined4 *)(local_d70 + 1) = 1;
  }
  puVar9 = local_d70;
  local_878 = CMyFile::vftable;
  local_870 = (HANDLE)0xffffffffffffffff;
  local_868 = 0;
  local_50 = 0;
  local_68 = (void *)0x0;
  local_58 = (void *)0x0;
  local_60 = (void *)0x0;
  local_d08 = 0x7072756933776b67;
  uStack_d00 = 0x30326a6b3b766d61;
  local_cf8 = 0x6b6473613b343839;
  uStack_cf0 = 0x66613174616a66;
  local_d68 = local_d70;
  FUN_14009c260(local_ce8,&local_d08);
  local_d80 = 0;
  local_d90 = MagiFileStream::vftable;
  local_d78 = (FILE *)0x0;
  local_d88 = 0;
  if (DAT_14031fea6 == '\0') {
    _wfopen_s(&local_d78,param_2,L"rb");
    if (local_d78 != (FILE *)0x0) {
      _fseeki64(local_d78,0,2);
      local_d88 = _ftelli64(local_d78);
      _fseeki64(local_d78,0,0);
    }
    (*(code *)local_d90[7])(&local_d90);
    local_d28 = &local_d90;
    if (local_d78 == (FILE *)0x0) {
      FUN_1401e4980(DAT_140320100,L"Invalid Table - %s",param_2);
      *param_1 = puVar9;
      param_1[1] = puVar9;
      if (puVar9 != (ulonglong *)0x0) {
        LOCK();
        *(int *)(puVar9 + 1) = (int)puVar9[1] + 1;
        UNLOCK();
        puVar9 = local_d70;
      }
      local_d98 = 1;
      local_d90 = MagiFileStream::vftable;
      cVar3 = FUN_140096240(&local_d90);
      if (cVar3 != '\0') {
        fclose(local_d78);
        local_d78 = (FILE *)0x0;
      }
      local_d90 = MagiStream::vftable;
      if (local_68 != (void *)0x0) {
        operator_delete__(local_68);
      }
      if (local_60 != (void *)0x0) {
        operator_delete__(local_60);
      }
      if (local_58 != (void *)0x0) {
        operator_delete__(local_58);
      }
      if (local_870 != (HANDLE)0xffffffffffffffff) {
        CloseHandle(local_870);
      }
      puVar1 = local_d70;
      if (puVar9 != (ulonglong *)0x0) {
        LOCK();
        puVar9 = puVar9 + 1;
        *(int *)puVar9 = (int)*puVar9 + -1;
        UNLOCK();
        if ((int)*puVar9 == 0) {
          pvVar4 = (void *)*local_d70;
          if (pvVar4 != (void *)0x0) {
            FUN_14009b490(pvVar4);
            operator_delete(pvVar4);
          }
          operator_delete(puVar1);
        }
      }
      goto LAB_14009841b;
    }
  }
  else {
    local_d28 = (undefined ***)(**(code **)(*DAT_14031fbf8 + 8))();
    if ((local_d28 == (undefined ***)0x0) &&
       (local_d28 = (undefined ***)(**(code **)(*DAT_14031fbf0 + 8))(DAT_14031fbf0,param_2),
       local_d28 == (undefined ***)0x0)) {
      FUN_1401e4980(DAT_140320100,L"Invalid Table - %s",param_2);
      *param_1 = puVar9;
      param_1[1] = puVar9;
      if (puVar9 != (ulonglong *)0x0) {
        LOCK();
        *(int *)(puVar9 + 1) = (int)puVar9[1] + 1;
        UNLOCK();
        puVar9 = local_d70;
      }
      local_d98 = 1;
      local_d90 = MagiFileStream::vftable;
      cVar3 = FUN_140096240(&local_d90);
      if (cVar3 != '\0') {
        fclose(local_d78);
        local_d78 = (FILE *)0x0;
      }
      local_d90 = MagiStream::vftable;
      if (local_68 != (void *)0x0) {
        operator_delete__(local_68);
      }
      if (local_60 != (void *)0x0) {
        operator_delete__(local_60);
      }
      if (local_58 != (void *)0x0) {
        operator_delete__(local_58);
      }
      if (local_870 != (HANDLE)0xffffffffffffffff) {
        CloseHandle(local_870);
      }
      puVar1 = local_d70;
      if (puVar9 != (ulonglong *)0x0) {
        LOCK();
        puVar9 = puVar9 + 1;
        *(int *)puVar9 = (int)*puVar9 + -1;
        UNLOCK();
        if ((int)*puVar9 == 0) {
          pvVar4 = (void *)*local_d70;
          if (pvVar4 != (void *)0x0) {
            FUN_14009b490(pvVar4);
            operator_delete(pvVar4);
          }
          operator_delete(puVar1);
        }
      }
      goto LAB_14009841b;
    }
  }
  cVar3 = FUN_14009c0b0(&local_d08);
  if (cVar3 == '\0') {
    *param_1 = puVar9;
    param_1[1] = puVar9;
    if (puVar9 != (ulonglong *)0x0) {
      LOCK();
      *(int *)(puVar9 + 1) = (int)puVar9[1] + 1;
      UNLOCK();
      puVar9 = local_d70;
    }
    local_d98 = 1;
    local_d90 = MagiFileStream::vftable;
    cVar3 = FUN_140096240(&local_d90);
    if (cVar3 != '\0') {
      fclose(local_d78);
      local_d78 = (FILE *)0x0;
    }
    local_d90 = MagiStream::vftable;
    if (local_68 != (void *)0x0) {
      operator_delete__(local_68);
    }
    if (local_60 != (void *)0x0) {
      operator_delete__(local_60);
    }
    if (local_58 != (void *)0x0) {
      operator_delete__(local_58);
    }
    if (local_870 != (HANDLE)0xffffffffffffffff) {
      CloseHandle(local_870);
    }
    puVar1 = local_d70;
    if (puVar9 != (ulonglong *)0x0) {
      LOCK();
      puVar9 = puVar9 + 1;
      *(int *)puVar9 = (int)*puVar9 + -1;
      UNLOCK();
      if ((int)*puVar9 == 0) {
        pvVar4 = (void *)*local_d70;
        if (pvVar4 != (void *)0x0) {
          FUN_14009b490(pvVar4);
          operator_delete(pvVar4);
        }
        operator_delete(puVar1);
      }
    }
  }
  else {
    sVar10 = (size_t)local_50;
    if (0 < local_50) {
      iVar7 = local_50 + 1;
      _Size = sVar10;
      if (local_50 < iVar7) {
        if (local_58 != (void *)0x0) {
          operator_delete__(local_58);
          local_58 = (void *)0x0;
        }
        local_58 = operator_new((longlong)iVar7);
        _Size = (longlong)iVar7;
      }
      pvVar4 = local_58;
      memset(local_58,0,_Size);
      cVar3 = FUN_14009cec0(local_ce8,local_68,pvVar4,sVar10);
      pvVar4 = local_58;
      if (cVar3 != '\0') {
        local_d50 = 0;
        local_d48 = 0;
        local_d58 = MagiMemoryStream::vftable;
        local_d20 = local_58;
        local_d40 = local_58;
        uVar5 = (ulonglong)local_50;
        local_d38 = 0;
        local_58 = (void *)0x0;
        local_d60 = 0;
        local_d5c = 0;
        _Size_00 = 4;
        sVar10 = 4;
        local_d30 = uVar5;
        if ((3 < uVar5) || (sVar10 = uVar5, uVar5 != 0)) {
          memcpy(&local_d60,pvVar4,sVar10);
          local_d38 = sVar10;
        }
        sVar10 = local_d38;
        if ((local_d38 + 4 <= uVar5) || (_Size_00 = uVar5 - local_d38, _Size_00 != 0)) {
          memcpy(&local_d5c,(void *)(local_d38 + (longlong)local_d20),_Size_00);
          local_d38 = sVar10 + _Size_00;
        }
        uVar2 = local_d5c;
        uVar11 = 0;
        uVar5 = uVar11;
        if (puVar9 != (ulonglong *)0x0) {
          uVar5 = *puVar9;
        }
        cVar3 = FUN_140098de0(local_d5c,uVar5,&local_d58);
        if (cVar3 == '\0') {
          *param_1 = puVar9;
          param_1[1] = puVar9;
          if (puVar9 != (ulonglong *)0x0) {
            LOCK();
            *(int *)(puVar9 + 1) = (int)puVar9[1] + 1;
            UNLOCK();
            puVar9 = local_d70;
          }
          local_d98 = 1;
          local_d58 = MagiMemoryStream::vftable;
          if (local_d40 != (void *)0x0) {
            operator_delete__(local_d40);
          }
          local_d40 = (void *)0x0;
          local_d58 = MagiStream::vftable;
          local_d90 = MagiFileStream::vftable;
          cVar3 = FUN_140096240(&local_d90);
          if (cVar3 != '\0') {
            fclose(local_d78);
            local_d78 = (FILE *)0x0;
          }
          local_d90 = MagiStream::vftable;
          if (local_68 != (void *)0x0) {
            operator_delete__(local_68);
          }
          if (local_60 != (void *)0x0) {
            operator_delete__(local_60);
          }
          if (local_870 != (HANDLE)0xffffffffffffffff) {
            CloseHandle(local_870);
          }
          puVar1 = local_d70;
          if (puVar9 != (ulonglong *)0x0) {
            LOCK();
            puVar9 = puVar9 + 1;
            *(int *)puVar9 = (int)*puVar9 + -1;
            UNLOCK();
            if ((int)*puVar9 == 0) {
              pvVar4 = (void *)*local_d70;
              if (pvVar4 != (void *)0x0) {
                FUN_14009b490(pvVar4);
                operator_delete(pvVar4);
              }
              operator_delete(puVar1);
            }
          }
        }
        else {
          uVar5 = uVar11;
          if (puVar9 != (ulonglong *)0x0) {
            uVar5 = *puVar9;
          }
          cVar3 = FUN_140099000(uVar2,uVar5,&local_d58);
          iVar7 = local_d60;
          if (cVar3 == '\0') {
            *param_1 = puVar9;
            param_1[1] = puVar9;
            if (puVar9 != (ulonglong *)0x0) {
              LOCK();
              *(int *)(puVar9 + 1) = (int)puVar9[1] + 1;
              UNLOCK();
              puVar9 = local_d70;
            }
            local_d98 = 1;
            local_d58 = MagiMemoryStream::vftable;
            if (local_d40 != (void *)0x0) {
              operator_delete__(local_d40);
            }
            local_d40 = (void *)0x0;
            local_d58 = MagiStream::vftable;
            local_d90 = MagiFileStream::vftable;
            cVar3 = FUN_140096240(&local_d90);
            if (cVar3 != '\0') {
              fclose(local_d78);
              local_d78 = (FILE *)0x0;
            }
            local_d90 = MagiStream::vftable;
            if (local_68 != (void *)0x0) {
              operator_delete__(local_68);
            }
            if (local_60 != (void *)0x0) {
              operator_delete__(local_60);
            }
            if (local_870 != (HANDLE)0xffffffffffffffff) {
              CloseHandle(local_870);
            }
            puVar1 = local_d70;
            if (puVar9 != (ulonglong *)0x0) {
              LOCK();
              puVar9 = puVar9 + 1;
              *(int *)puVar9 = (int)*puVar9 + -1;
              UNLOCK();
              if ((int)*puVar9 == 0) {
                pvVar4 = (void *)*local_d70;
                if (pvVar4 != (void *)0x0) {
                  FUN_14009b490(pvVar4);
                  operator_delete(pvVar4);
                }
                operator_delete(puVar1);
              }
            }
          }
          else {
            uVar5 = uVar11;
            if (0 < local_d60) {
              do {
                uVar6 = uVar11;
                if (puVar9 != (ulonglong *)0x0) {
                  uVar6 = *puVar9;
                }
                cVar3 = FUN_140099110(uVar2,uVar6,&local_d58);
                if (cVar3 == '\0') {
                  *param_1 = puVar9;
                  param_1[1] = puVar9;
                  if (puVar9 != (ulonglong *)0x0) {
                    LOCK();
                    *(int *)(puVar9 + 1) = (int)puVar9[1] + 1;
                    UNLOCK();
                    puVar9 = local_d70;
                  }
                  local_d98 = 1;
                  local_d58 = MagiMemoryStream::vftable;
                  if (local_d40 != (void *)0x0) {
                    operator_delete__(local_d40);
                  }
                  local_d40 = (void *)0x0;
                  local_d58 = MagiStream::vftable;
                  local_d90 = MagiFileStream::vftable;
                  cVar3 = FUN_140096240(&local_d90);
                  if (cVar3 != '\0') {
                    fclose(local_d78);
                    local_d78 = (FILE *)0x0;
                  }
                  local_d90 = MagiStream::vftable;
                  if (local_68 != (void *)0x0) {
                    operator_delete__(local_68);
                  }
                  if (local_60 != (void *)0x0) {
                    operator_delete__(local_60);
                  }
                  if (local_870 != (HANDLE)0xffffffffffffffff) {
                    CloseHandle(local_870);
                  }
                  puVar1 = local_d70;
                  if (puVar9 != (ulonglong *)0x0) {
                    LOCK();
                    puVar9 = puVar9 + 1;
                    *(int *)puVar9 = (int)*puVar9 + -1;
                    UNLOCK();
                    if ((int)*puVar9 == 0) {
                      pvVar4 = (void *)*local_d70;
                      if (pvVar4 != (void *)0x0) {
                        FUN_14009b490(pvVar4);
                        operator_delete(pvVar4);
                      }
                      operator_delete(puVar1);
                    }
                  }
                  goto LAB_14009841b;
                }
                uVar8 = (int)uVar5 + 1;
                uVar5 = (ulonglong)uVar8;
              } while ((int)uVar8 < iVar7);
            }
            if (DAT_14031fea6 != '\0') {
              *(int *)(local_d28 + 2) = *(int *)(local_d28 + 2) + -1;
            }
            *param_1 = puVar9;
            param_1[1] = puVar9;
            if (puVar9 != (ulonglong *)0x0) {
              LOCK();
              *(int *)(puVar9 + 1) = (int)puVar9[1] + 1;
              UNLOCK();
              puVar9 = local_d70;
            }
            local_d98 = 1;
            local_d58 = MagiMemoryStream::vftable;
            if (local_d40 != (void *)0x0) {
              operator_delete__(local_d40);
            }
            local_d40 = (void *)0x0;
            local_d58 = MagiStream::vftable;
            local_d90 = MagiFileStream::vftable;
            cVar3 = FUN_140096240(&local_d90);
            if (cVar3 != '\0') {
              fclose(local_d78);
              local_d78 = (FILE *)0x0;
            }
            local_d90 = MagiStream::vftable;
            if (local_68 != (void *)0x0) {
              operator_delete__(local_68);
            }
            if (local_60 != (void *)0x0) {
              operator_delete__(local_60);
            }
            if (local_870 != (HANDLE)0xffffffffffffffff) {
              CloseHandle(local_870);
            }
            puVar1 = local_d70;
            if (puVar9 != (ulonglong *)0x0) {
              LOCK();
              puVar9 = puVar9 + 1;
              *(int *)puVar9 = (int)*puVar9 + -1;
              UNLOCK();
              if ((int)*puVar9 == 0) {
                pvVar4 = (void *)*local_d70;
                if (pvVar4 != (void *)0x0) {
                  FUN_14009b490(pvVar4);
                  operator_delete(pvVar4);
                }
                operator_delete(puVar1);
              }
            }
          }
        }
        goto LAB_14009841b;
      }
    }
    *param_1 = puVar9;
    param_1[1] = puVar9;
    if (puVar9 != (ulonglong *)0x0) {
      LOCK();
      *(int *)(puVar9 + 1) = (int)puVar9[1] + 1;
      UNLOCK();
      puVar9 = local_d70;
    }
    local_d98 = 1;
    local_d90 = MagiFileStream::vftable;
    cVar3 = FUN_140096240(&local_d90);
    if (cVar3 != '\0') {
      fclose(local_d78);
      local_d78 = (FILE *)0x0;
    }
    local_d90 = MagiStream::vftable;
    if (local_68 != (void *)0x0) {
      operator_delete__(local_68);
    }
    if (local_60 != (void *)0x0) {
      operator_delete__(local_60);
    }
    if (local_58 != (void *)0x0) {
      operator_delete__(local_58);
    }
    if (local_870 != (HANDLE)0xffffffffffffffff) {
      CloseHandle(local_870);
    }
    puVar1 = local_d70;
    if (puVar9 != (ulonglong *)0x0) {
      LOCK();
      puVar9 = puVar9 + 1;
      *(int *)puVar9 = (int)*puVar9 + -1;
      UNLOCK();
      if ((int)*puVar9 == 0) {
        pvVar4 = (void *)*local_d70;
        if (pvVar4 != (void *)0x0) {
          FUN_14009b490(pvVar4);
          operator_delete(pvVar4);
        }
        operator_delete(puVar1);
      }
    }
  }
LAB_14009841b:
  LeaveCriticalSection(DAT_140320178);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140098460(longlong param_1,short *param_2,short *param_3)

{
  ulonglong *puVar1;
  ushort *puVar2;
  short sVar3;
  ushort uVar4;
  void *pvVar5;
  ulonglong *puVar6;
  int iVar7;
  undefined8 uVar8;
  ulonglong uVar9;
  ushort *puVar10;
  ushort *puVar11;
  ulonglong uVar12;
  ushort *puVar13;
  longlong lVar14;
  short *psVar15;
  bool bVar16;
  undefined1 auStack_1a8 [32];
  ulonglong *local_188;
  ulonglong *local_180;
  undefined8 local_178;
  longlong local_168;
  undefined1 local_160 [24];
  undefined1 local_148 [24];
  ushort local_130;
  undefined6 uStack_12e;
  longlong local_120;
  ulonglong local_118;
  ushort local_108;
  undefined6 uStack_106;
  longlong local_f8;
  ulonglong local_f0;
  void *local_e0 [2];
  longlong local_d0;
  ulonglong local_c8;
  ulonglong *local_b8;
  ulonglong *local_b0;
  ushort local_a8;
  undefined6 uStack_a6;
  longlong local_98;
  ulonglong local_90;
  void *local_80 [2];
  longlong local_70;
  ulonglong local_68;
  ulonglong *local_58;
  ulonglong *local_50;
  ulonglong local_40;
  
  local_178 = 0xfffffffffffffffe;
  local_40 = DAT_1402f85a0 ^ (ulonglong)auStack_1a8;
  EnterCriticalSection(DAT_140320178);
  local_118 = 7;
  uVar12 = 0;
  local_120 = 0;
  local_130 = 0;
  uVar9 = 0xffffffffffffffff;
  psVar15 = param_2;
  do {
    if (uVar9 == 0) break;
    uVar9 = uVar9 - 1;
    sVar3 = *psVar15;
    psVar15 = psVar15 + 1;
  } while (sVar3 != 0);
  FUN_140001b00(&local_130,param_2,~uVar9 - 1);
  puVar10 = (ushort *)CONCAT62(uStack_12e,local_130);
  puVar11 = &local_130;
  if (7 < local_118) {
    puVar11 = puVar10;
  }
  puVar2 = puVar11 + local_120;
  puVar13 = &local_130;
  if (7 < local_118) {
    puVar13 = puVar10;
  }
  if (puVar13 != puVar2) {
    lVar14 = (longlong)puVar11 - (longlong)puVar13;
    do {
      iVar7 = tolower((uint)*puVar13);
      *(short *)(lVar14 + (longlong)puVar13) = (short)iVar7;
      puVar13 = puVar13 + 1;
    } while (puVar13 != puVar2);
    puVar10 = (ushort *)CONCAT62(uStack_12e,local_130);
  }
  puVar11 = &local_130;
  if (7 < local_118) {
    puVar11 = puVar10;
  }
  local_90 = 7;
  local_98 = 0;
  local_a8 = 0;
  uVar9 = 0xffffffffffffffff;
  puVar10 = puVar11;
  do {
    if (uVar9 == 0) break;
    uVar9 = uVar9 - 1;
    uVar4 = *puVar10;
    puVar10 = puVar10 + 1;
  } while (uVar4 != 0);
  FUN_140001b00(&local_a8,puVar11,~uVar9 - 1);
  if (*(longlong *)(param_1 + 0x38) == 0) {
    local_168 = 0;
  }
  else {
    puVar10 = &local_a8;
    if (7 < local_90) {
      puVar10 = (ushort *)CONCAT62(uStack_a6,local_a8);
    }
    puVar11 = &local_a8;
    uVar9 = uVar12;
    if (7 < local_90) {
      puVar11 = (ushort *)CONCAT62(uStack_a6,local_a8);
    }
    for (; puVar11 != puVar10 + local_98; puVar11 = puVar11 + 1) {
      uVar4 = *puVar11;
      uVar9 = uVar9 ^ (uVar9 >> 2) + uVar9 * 0x40 + 0x9e3779b9 + (ulonglong)uVar4;
    }
    local_168 = FUN_140096650(*(longlong *)(param_1 + 0x18) +
                              (uVar9 % *(ulonglong *)(param_1 + 0x20)) * 8,&local_a8);
  }
  lVar14 = local_168;
  if (7 < local_90) {
    operator_delete((void *)CONCAT62(uStack_a6,local_a8));
  }
  local_90 = 7;
  local_98 = 0;
  local_a8 = 0;
  if (lVar14 == 0) {
    local_f0 = 7;
    local_f8 = 0;
    local_108 = 0;
    uVar9 = 0xffffffffffffffff;
    psVar15 = param_3;
    do {
      if (uVar9 == 0) break;
      uVar9 = uVar9 - 1;
      sVar3 = *psVar15;
      psVar15 = psVar15 + 1;
    } while (sVar3 != 0);
    FUN_140001b00(&local_108,param_3,~uVar9 - 1);
    puVar10 = (ushort *)CONCAT62(uStack_106,local_108);
    puVar11 = &local_108;
    if (7 < local_f0) {
      puVar11 = puVar10;
    }
    puVar2 = puVar11 + local_f8;
    puVar13 = &local_108;
    if (7 < local_f0) {
      puVar13 = puVar10;
    }
    if (puVar13 != puVar2) {
      lVar14 = (longlong)puVar11 - (longlong)puVar13;
      do {
        iVar7 = tolower((uint)*puVar13);
        *(short *)(lVar14 + (longlong)puVar13) = (short)iVar7;
        puVar13 = puVar13 + 1;
      } while (puVar13 != puVar2);
      puVar10 = (ushort *)CONCAT62(uStack_106,local_108);
    }
    puVar11 = &local_108;
    if (7 < local_f0) {
      puVar11 = puVar10;
    }
    FUN_140097940(&local_188,puVar11);
    puVar10 = &local_130;
    if (7 < local_118) {
      puVar10 = (ushort *)CONCAT62(uStack_12e,local_130);
    }
    if (local_188 != (ulonglong *)0x0) {
      if (local_188 == local_180) {
        uVar12 = *local_188;
      }
      else {
        iVar7 = DAT_140320168 + 1;
        bVar16 = DAT_140320168 == 0;
        DAT_140320168 = iVar7;
        if (bVar16) {
          FUN_14001f5c0(1);
        }
      }
    }
    uVar9 = 0xffffffffffffffff;
    puVar11 = puVar10;
    do {
      if (uVar9 == 0) break;
      uVar9 = uVar9 - 1;
      uVar4 = *puVar11;
      puVar11 = puVar11 + 1;
    } while (uVar4 != 0);
    FUN_140001b00(uVar12,puVar10,~uVar9 - 1);
    puVar10 = &local_130;
    if (7 < local_118) {
      puVar10 = (ushort *)CONCAT62(uStack_12e,local_130);
    }
    local_c8 = 7;
    local_d0 = 0;
    local_e0[0] = (void *)((ulonglong)local_e0[0] & 0xffffffffffff0000);
    uVar12 = 0xffffffffffffffff;
    puVar11 = puVar10;
    do {
      if (uVar12 == 0) break;
      uVar12 = uVar12 - 1;
      uVar4 = *puVar11;
      puVar11 = puVar11 + 1;
    } while (uVar4 != 0);
    FUN_140001b00(local_e0,puVar10,~uVar12 - 1);
    local_b8 = local_188;
    local_b0 = local_188;
    if (local_188 != (ulonglong *)0x0) {
      LOCK();
      *(int *)(local_188 + 1) = (int)local_188[1] + 1;
      UNLOCK();
    }
    local_68 = 7;
    local_70 = 0;
    local_80[0] = (void *)((ulonglong)local_80[0] & 0xffffffffffff0000);
    if (local_c8 < 8) {
      memmove(local_80,local_e0,local_d0 * 2 + 2);
      local_68 = local_c8;
    }
    else {
      local_80[0] = local_e0[0];
      local_e0[0] = (void *)0x0;
      local_68 = local_c8;
    }
    local_70 = local_d0;
    local_d0 = 0;
    local_c8 = 0;
    if (local_b8 != (ulonglong *)0x0) {
      LOCK();
      *(int *)(local_b8 + 1) = (int)local_b8[1] + 1;
      UNLOCK();
    }
    local_58 = local_b8;
    local_50 = local_b8;
    if (*(longlong *)(param_1 + 0x38) == 0) {
      FUN_14009a5b0(param_1 + 0x18,local_160,local_80);
    }
    else {
      FUN_14009a400(param_1 + 0x18,local_148,local_80,local_80);
    }
    FUN_140099bd0(&local_58);
    if (7 < local_68) {
      operator_delete(local_80[0]);
    }
    local_68 = 7;
    local_70 = 0;
    local_80[0] = (void *)((ulonglong)local_80[0] & 0xffffffffffff0000);
    FUN_140099bd0(&local_b8);
    if (7 < local_c8) {
      operator_delete(local_e0[0]);
    }
    puVar6 = local_188;
    local_c8 = 7;
    local_d0 = 0;
    local_e0[0] = (void *)((ulonglong)local_e0[0] & 0xffffffffffff0000);
    if (local_188 != (ulonglong *)0x0) {
      if (local_188 == local_180) {
        if (local_188 != (ulonglong *)0x0) {
          LOCK();
          puVar1 = local_188 + 1;
          *(int *)puVar1 = (int)*puVar1 + -1;
          UNLOCK();
          if ((int)*puVar1 == 0) {
            local_188 = (ulonglong *)0x0;
            pvVar5 = (void *)*puVar6;
            if (pvVar5 != (void *)0x0) {
              FUN_14009b490(pvVar5);
              operator_delete(pvVar5);
            }
            operator_delete(puVar6);
          }
        }
      }
      else {
        iVar7 = DAT_14032016c + 1;
        bVar16 = DAT_14032016c == 0;
        DAT_14032016c = iVar7;
        if (bVar16) {
          FUN_14001f5c0(1);
        }
      }
    }
    if (7 < local_f0) {
      operator_delete((void *)CONCAT62(uStack_106,local_108));
    }
    local_f0 = 7;
    local_f8 = 0;
    local_108 = 0;
    if (7 < local_118) {
      operator_delete((void *)CONCAT62(uStack_12e,local_130));
    }
    local_118 = 7;
    local_120 = 0;
    local_130 = 0;
    LeaveCriticalSection(DAT_140320178);
    uVar8 = 1;
  }
  else {
    if (7 < local_118) {
      operator_delete((void *)CONCAT62(uStack_12e,local_130));
    }
    local_118 = 7;
    local_120 = 0;
    local_130 = 0;
    LeaveCriticalSection(DAT_140320178);
    uVar8 = 0;
  }
  return uVar8;
}



void FUN_140098990(undefined8 *param_1)

{
  FUN_140099bd0(param_1 + 5);
  if (7 < (ulonglong)param_1[3]) {
    operator_delete((void *)*param_1);
  }
  param_1[3] = 7;
  param_1[2] = 0;
  *(undefined2 *)param_1 = 0;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1400989e0(longlong param_1,short *param_2)

{
  longlong *plVar1;
  short sVar2;
  ushort uVar3;
  longlong *plVar4;
  ulonglong *puVar5;
  ushort *puVar6;
  longlong *plVar7;
  int iVar8;
  ushort *puVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  ushort *puVar12;
  longlong *plVar13;
  ushort *puVar14;
  short *psVar15;
  longlong *plVar16;
  longlong lVar17;
  bool bVar18;
  undefined1 auStack_d8 [32];
  longlong *local_b8;
  longlong *plStack_b0;
  undefined8 local_a8;
  ushort local_a0;
  undefined6 uStack_9e;
  longlong local_90;
  ulonglong local_88;
  ushort local_78;
  undefined6 uStack_76;
  longlong local_68;
  ulonglong local_60;
  ulonglong local_48;
  
  local_a8 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_d8;
  EnterCriticalSection(DAT_140320178);
  if (*(longlong *)(param_1 + 0xc0) != 0) {
    (**(code **)**(undefined8 **)(param_1 + 0xc0))(*(undefined8 **)(param_1 + 0xc0),param_2);
  }
  local_88 = 7;
  uVar10 = 0;
  local_90 = 0;
  local_a0 = 0;
  uVar11 = 0xffffffffffffffff;
  psVar15 = param_2;
  do {
    if (uVar11 == 0) break;
    uVar11 = uVar11 - 1;
    sVar2 = *psVar15;
    psVar15 = psVar15 + 1;
  } while (sVar2 != 0);
  FUN_140001b00(&local_a0,param_2,~uVar11 - 1);
  puVar12 = (ushort *)CONCAT62(uStack_9e,local_a0);
  puVar9 = &local_a0;
  if (7 < local_88) {
    puVar9 = puVar12;
  }
  puVar6 = puVar9 + local_90;
  puVar14 = &local_a0;
  if (7 < local_88) {
    puVar14 = puVar12;
  }
  if (puVar14 != puVar6) {
    lVar17 = (longlong)puVar9 - (longlong)puVar14;
    do {
      iVar8 = tolower((uint)*puVar14);
      *(short *)(lVar17 + (longlong)puVar14) = (short)iVar8;
      puVar14 = puVar14 + 1;
    } while (puVar14 != puVar6);
    puVar12 = (ushort *)CONCAT62(uStack_9e,local_a0);
  }
  if (*(char *)(param_1 + 0xb9) == '\0') goto LAB_140098c12;
  if (*(longlong *)(param_1 + 0x78) == 0) {
LAB_140098b6e:
    plStack_b0 = (longlong *)0x0;
    local_b8 = (longlong *)0x0;
  }
  else {
    puVar9 = &local_a0;
    if (7 < local_88) {
      puVar9 = puVar12;
    }
    puVar6 = &local_a0;
    uVar11 = uVar10;
    if (7 < local_88) {
      puVar6 = puVar12;
    }
    for (; puVar6 != puVar9 + local_90; puVar6 = puVar6 + 1) {
      uVar3 = *puVar6;
      uVar11 = uVar11 ^ (uVar11 >> 2) + uVar11 * 0x40 + 0x9e3779b9 + (ulonglong)uVar3;
    }
    plVar1 = (longlong *)
             (*(longlong *)(param_1 + 0x58) + (uVar11 % *(ulonglong *)(param_1 + 0x60)) * 8);
    plStack_b0 = (longlong *)FUN_140096650(plVar1,&local_a0);
    puVar12 = (ushort *)CONCAT62(uStack_9e,local_a0);
    local_b8 = plVar1;
    if (plStack_b0 == (longlong *)0x0) goto LAB_140098b6e;
  }
  plVar7 = plStack_b0;
  plVar1 = local_b8;
  if (plStack_b0 != (longlong *)0x0) {
    plVar16 = plStack_b0 + 6;
    if (7 < (ulonglong)plStack_b0[9]) {
      plVar16 = (longlong *)*plVar16;
    }
    plVar13 = plStack_b0 + 1;
    if (7 < (ulonglong)plStack_b0[4]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_140098460(param_1,plVar13,plVar16);
    lVar17 = *plVar7;
    plVar16 = local_b8;
    while (lVar17 == 0) {
      plVar16 = plVar16 + 1;
      lVar17 = *plVar16;
    }
    *(longlong *)(param_1 + 0x78) = *(longlong *)(param_1 + 0x78) + -1;
    plVar13 = (longlong *)*plVar1;
    plVar4 = plVar1;
    while (plVar13 != plVar7) {
      plVar4 = (longlong *)*plVar4;
      plVar13 = (longlong *)*plVar4;
    }
    *plVar4 = *plVar7;
    FUN_140096bc0();
    if ((plVar1 == *(longlong **)(param_1 + 0x88)) && (*plVar1 == 0)) {
      *(longlong **)(param_1 + 0x88) = plVar16;
    }
    puVar12 = (ushort *)CONCAT62(uStack_9e,local_a0);
  }
LAB_140098c12:
  puVar9 = &local_a0;
  if (7 < local_88) {
    puVar9 = puVar12;
  }
  local_60 = 7;
  local_68 = 0;
  local_78 = 0;
  uVar11 = 0xffffffffffffffff;
  puVar12 = puVar9;
  do {
    if (uVar11 == 0) break;
    uVar11 = uVar11 - 1;
    uVar3 = *puVar12;
    puVar12 = puVar12 + 1;
  } while (uVar3 != 0);
  FUN_140001b00(&local_78,puVar9,~uVar11 - 1);
  uVar11 = uVar10;
  if (*(longlong *)(param_1 + 0x38) != 0) {
    puVar12 = &local_78;
    if (7 < local_60) {
      puVar12 = (ushort *)CONCAT62(uStack_76,local_78);
    }
    puVar9 = &local_78;
    if (7 < local_60) {
      puVar9 = (ushort *)CONCAT62(uStack_76,local_78);
    }
    for (; puVar9 != puVar12 + local_68; puVar9 = puVar9 + 1) {
      uVar3 = *puVar9;
      uVar11 = uVar11 ^ (uVar11 >> 2) + uVar11 * 0x40 + 0x9e3779b9 + (ulonglong)uVar3;
    }
    uVar11 = FUN_140096650(*(longlong *)(param_1 + 0x18) +
                           (uVar11 % *(ulonglong *)(param_1 + 0x20)) * 8,&local_78);
  }
  if (7 < local_60) {
    operator_delete((void *)CONCAT62(uStack_76,local_78));
  }
  local_60 = 7;
  local_68 = 0;
  local_78 = 0;
  if (uVar11 == 0) {
    FUN_1401e4980(DAT_140320100,L"Invalid TableName %s",param_2);
    if (7 < local_88) {
      operator_delete((void *)CONCAT62(uStack_9e,local_a0));
    }
    local_88 = 7;
    local_90 = 0;
    local_a0 = 0;
    LeaveCriticalSection(DAT_140320178);
    uVar10 = 0;
  }
  else {
    puVar5 = *(ulonglong **)(uVar11 + 0x30);
    if (puVar5 != (ulonglong *)0x0) {
      if (puVar5 == *(ulonglong **)(uVar11 + 0x38)) {
        uVar10 = *puVar5;
      }
      else {
        iVar8 = DAT_140320168 + 1;
        bVar18 = DAT_140320168 == 0;
        DAT_140320168 = iVar8;
        if (bVar18) {
          FUN_14001f5c0(1);
        }
      }
    }
    if (7 < local_88) {
      operator_delete((void *)CONCAT62(uStack_9e,local_a0));
    }
    local_88 = 7;
    local_90 = 0;
    local_a0 = 0;
    LeaveCriticalSection(DAT_140320178);
  }
  return uVar10;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140098de0(int param_1,longlong param_2,longlong *param_3)

{
  void *_Src;
  ushort uVar1;
  ulonglong uVar2;
  undefined2 *puVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  int iVar7;
  undefined1 auStack_a8 [32];
  ushort local_88 [2];
  undefined2 local_84 [2];
  int local_80;
  longlong local_78;
  undefined8 local_70;
  undefined2 local_68;
  undefined6 uStack_66;
  ulonglong local_58;
  ulonglong local_50;
  ulonglong local_40;
  
  local_70 = 0xfffffffffffffffe;
  local_40 = DAT_1402f85a0 ^ (ulonglong)auStack_a8;
  local_50 = 7;
  iVar7 = 0;
  local_58 = 0;
  local_68 = 0;
  param_2 = param_2 + 0x28;
  local_80 = param_1;
  local_78 = param_2;
  FUN_14008e890(param_2);
  if (0 < param_1) {
    do {
      (**(code **)(*param_3 + 8))(param_3,local_88,2);
      uVar2 = local_58;
      uVar1 = local_88[0];
      uVar5 = (ulonglong)local_88[0];
      uVar4 = (ulonglong)(int)(local_88[0] + 1);
      if ((local_58 <= uVar4) && (local_50 != uVar4)) {
        if (0x7ffffffffffffffe < uVar4) {
          std::_Xlength_error("string too long");
          break;
        }
        if (local_50 < uVar4) {
          FUN_140001930(&local_68,uVar4,local_58);
        }
        else if (uVar4 < 8) {
          uVar6 = local_58;
          if (uVar4 < local_58) {
            uVar6 = uVar4;
          }
          if (7 < local_50) {
            _Src = (void *)CONCAT62(uStack_66,local_68);
            if (uVar6 != 0) {
              memcpy(&local_68,_Src,uVar6 * 2);
            }
            operator_delete(_Src);
            param_2 = local_78;
          }
          local_50 = 7;
          local_58 = uVar6;
          (&local_68)[uVar6] = 0;
          param_1 = local_80;
        }
        else if (uVar4 == 0) {
          local_58 = 0;
          puVar3 = &local_68;
          if (7 < local_50) {
            puVar3 = (undefined2 *)CONCAT62(uStack_66,local_68);
          }
          *puVar3 = 0;
        }
        if (uVar4 != 0) {
          puVar3 = &local_68;
          if (7 < local_50) {
            puVar3 = (undefined2 *)CONCAT62(uStack_66,local_68);
          }
          local_58 = uVar2;
          puVar3[uVar2] = 0;
        }
      }
      if (uVar1 != 0) {
        do {
          (**(code **)(*param_3 + 8))(param_3,local_84,2);
          FUN_14008a4d0(&local_68,local_84[0]);
          uVar5 = uVar5 - 1;
        } while (uVar5 != 0);
      }
      FUN_14008e7a0(param_2,&local_68);
      FUN_140001b00(&local_68,&DAT_14027d1a0,0);
      iVar7 = iVar7 + 1;
    } while (iVar7 < param_1);
  }
  if (7 < local_50) {
    operator_delete((void *)CONCAT62(uStack_66,local_68));
  }
  return 1;
}



undefined8 FUN_140099000(uint param_1,longlong param_2,longlong *param_3)

{
  ulonglong *puVar1;
  void *_Dst;
  undefined4 *puVar2;
  undefined4 *puVar3;
  ulonglong uVar4;
  undefined4 local_res8 [2];
  
  _Dst = *(void **)(param_2 + 0x48);
  puVar1 = (ulonglong *)(param_2 + 0x48);
  uVar4 = (ulonglong)param_1;
  local_res8[0] = 0;
  if (_Dst != *(void **)(param_2 + 0x50)) {
    memmove(_Dst,*(void **)(param_2 + 0x50),0);
    *(void **)(param_2 + 0x50) = _Dst;
  }
  if (0 < (int)param_1) {
    do {
      (**(code **)(*param_3 + 8))(param_3,local_res8,4);
      puVar2 = *(undefined4 **)(param_2 + 0x50);
      if ((local_res8 < puVar2) && (puVar3 = (undefined4 *)*puVar1, puVar3 <= local_res8)) {
        if (puVar2 == *(undefined4 **)(param_2 + 0x58)) {
          FUN_14007a1d0(puVar1,1);
        }
        if (*(undefined4 **)(param_2 + 0x50) != (undefined4 *)0x0) {
          **(undefined4 **)(param_2 + 0x50) =
               *(undefined4 *)(*puVar1 + ((longlong)local_res8 - (longlong)puVar3 >> 2) * 4);
        }
      }
      else {
        if (puVar2 == *(undefined4 **)(param_2 + 0x58)) {
          FUN_14007a1d0(puVar1,1);
        }
        if (*(undefined4 **)(param_2 + 0x50) != (undefined4 *)0x0) {
          **(undefined4 **)(param_2 + 0x50) = local_res8[0];
        }
      }
      *(longlong *)(param_2 + 0x50) = *(longlong *)(param_2 + 0x50) + 4;
      uVar4 = uVar4 - 1;
    } while (uVar4 != 0);
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140099110(int param_1,longlong param_2,longlong *param_3)

{
  short sVar1;
  void **ppvVar2;
  void **ppvVar3;
  undefined4 *puVar4;
  undefined4 *puVar5;
  undefined1 auVar6 [16];
  undefined1 auVar7 [16];
  ushort uVar8;
  char cVar9;
  undefined8 *puVar10;
  ulonglong *puVar11;
  int *piVar12;
  short *psVar13;
  __uint64 _Var14;
  void *pvVar15;
  ulonglong *puVar16;
  undefined8 uVar17;
  undefined8 *puVar18;
  int *piVar19;
  short *psVar20;
  ulonglong uVar21;
  undefined8 *puVar22;
  int iVar23;
  longlong lVar24;
  int *piVar25;
  ulonglong *puVar26;
  ulonglong *puVar27;
  undefined1 auStack_138 [32];
  int local_118;
  undefined4 local_114;
  int local_110;
  int local_10c;
  undefined2 local_108 [2];
  int local_104;
  ushort local_100 [2];
  int local_fc;
  undefined2 local_f8 [2];
  ushort local_f4 [2];
  longlong local_f0;
  undefined8 local_e8;
  undefined8 *local_e0;
  undefined8 *local_d8;
  void *local_d0;
  void *local_c8;
  longlong local_c0;
  undefined4 local_b8;
  undefined8 *local_b0;
  undefined8 *local_a8;
  undefined8 local_a0;
  short local_98;
  undefined6 uStack_96;
  longlong local_88;
  ulonglong local_80;
  short local_70;
  undefined6 uStack_6e;
  longlong local_60;
  ulonglong local_58;
  ulonglong local_48;
  
  local_a0 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_138;
  lVar24 = (longlong)param_1;
  puVar26 = (ulonglong *)0x0;
  local_e0 = (undefined8 *)0x0;
  local_f0 = param_2;
  puVar10 = operator_new(0xa0);
  if (puVar10 == (undefined8 *)0x0) {
    local_e0 = (undefined8 *)0x0;
  }
  else {
    *puVar10 = 0;
    puVar10[1] = 0;
    puVar10[2] = 0;
    puVar10[4] = 0;
    puVar10[5] = 0;
    puVar10[6] = 0;
    puVar10[8] = 0;
    puVar10[9] = 0;
    puVar10[10] = 0;
    puVar10[0xc] = 0;
    puVar10[0xd] = 0;
    puVar10[0xe] = 0;
    puVar10[0x10] = 0;
    puVar10[0x11] = 0;
    puVar10[0x12] = 0;
    local_e0 = operator_new(0x10);
    *local_e0 = puVar10;
    *(undefined4 *)(local_e0 + 1) = 1;
  }
  puVar10 = local_e0;
  puVar27 = puVar26;
  local_d8 = local_e0;
  local_c0 = lVar24;
  if (0 < lVar24) {
    do {
      iVar23 = *(int *)(*(longlong *)(param_2 + 0x48) + (longlong)puVar27 * 4);
      puVar16 = puVar26;
      if (iVar23 == 0) {
        (**(code **)(*param_3 + 8))(param_3,&local_118,4);
        if (puVar10 != (undefined8 *)0x0) {
          puVar16 = (ulonglong *)*puVar10;
        }
        piVar12 = (int *)puVar16[0x11];
        if ((&local_118 < piVar12) && (piVar19 = (int *)puVar16[0x10], piVar19 <= &local_118)) {
          piVar25 = &local_118;
LAB_140099301:
          if (piVar12 == (int *)puVar16[0x12]) {
            FUN_14007a1d0(puVar16 + 0x10,1);
          }
          if ((undefined4 *)puVar16[0x11] != (undefined4 *)0x0) {
            *(undefined4 *)puVar16[0x11] =
                 *(undefined4 *)(puVar16[0x10] + ((longlong)piVar25 - (longlong)piVar19 >> 2) * 4);
          }
          goto LAB_14009933a;
        }
        if (piVar12 == (int *)puVar16[0x12]) {
          FUN_14007a1d0(puVar16 + 0x10,1);
        }
        if ((int *)puVar16[0x11] != (int *)0x0) {
          *(int *)puVar16[0x11] = local_118;
        }
        puVar16[0x11] = puVar16[0x11] + 4;
      }
      else if (iVar23 == 1) {
        (**(code **)(*param_3 + 8))(param_3,&local_114,4);
        puVar11 = puVar26;
        if (puVar10 != (undefined8 *)0x0) {
          puVar11 = (ulonglong *)*puVar10;
        }
        puVar4 = (undefined4 *)puVar11[0xd];
        if ((&local_114 < puVar4) && (puVar5 = (undefined4 *)puVar11[0xc], puVar5 <= &local_114)) {
          if (puVar4 == (undefined4 *)puVar11[0xe]) {
            FUN_14001c570(puVar11 + 0xc);
          }
          if ((undefined4 *)puVar11[0xd] != (undefined4 *)0x0) {
            *(undefined4 *)puVar11[0xd] =
                 *(undefined4 *)(puVar11[0xc] + ((longlong)&local_114 - (longlong)puVar5 >> 2) * 4);
          }
        }
        else {
          if (puVar4 == (undefined4 *)puVar11[0xe]) {
            FUN_14001c570(puVar11 + 0xc);
          }
          if ((undefined4 *)puVar11[0xd] != (undefined4 *)0x0) {
            *(undefined4 *)puVar11[0xd] = local_114;
          }
        }
        puVar11[0xd] = puVar11[0xd] + 4;
        puVar11 = puVar26;
        if (puVar10 != (undefined8 *)0x0) {
          puVar11 = (ulonglong *)*puVar10;
        }
        iVar23 = (int)((longlong)(puVar11[0xd] - puVar11[0xc]) >> 2) + -1;
        if (puVar10 != (undefined8 *)0x0) {
          puVar16 = (ulonglong *)*puVar10;
        }
        piVar12 = (int *)puVar16[0x11];
        local_110 = iVar23;
        if ((&local_110 < piVar12) && (piVar19 = (int *)puVar16[0x10], piVar19 <= &local_110)) {
          piVar25 = &local_110;
          goto LAB_140099301;
        }
        if (piVar12 == (int *)puVar16[0x12]) {
          FUN_14007a1d0(puVar16 + 0x10,1);
        }
        if ((int *)puVar16[0x11] != (int *)0x0) {
          *(int *)puVar16[0x11] = iVar23;
        }
LAB_14009933a:
        puVar16[0x11] = puVar16[0x11] + 4;
      }
      else {
        if (iVar23 == 2) {
          local_58 = 7;
          local_60 = 0;
          local_70 = 0;
          (**(code **)(*param_3 + 8))(param_3,local_100,2);
          uVar8 = local_100[0];
          uVar21 = (ulonglong)local_100[0];
          if ((local_100[0] + 1 != 7) &&
             (cVar9 = FUN_140001a20(&local_70,local_100[0] + 1,1), cVar9 != '\0')) {
            local_60 = 0;
            psVar13 = &local_70;
            if (7 < local_58) {
              psVar13 = (short *)CONCAT62(uStack_6e,local_70);
            }
            *psVar13 = 0;
          }
          if (uVar8 != 0) {
            do {
              (**(code **)(*param_3 + 8))(param_3,local_108,2);
              FUN_14008a4d0(&local_70,local_108[0]);
              uVar21 = uVar21 - 1;
            } while (uVar21 != 0);
          }
          auVar7._8_8_ = 0;
          auVar7._0_8_ = local_60 + 1;
          _Var14 = SUB168(ZEXT816(2) * auVar7,0);
          if (SUB168(ZEXT816(2) * auVar7,8) != 0) {
            _Var14 = 0xffffffffffffffff;
          }
          pvVar15 = operator_new(_Var14);
          psVar13 = (short *)CONCAT62(uStack_6e,local_70);
          uVar21 = local_58;
          local_d0 = pvVar15;
          if (pvVar15 != (void *)0x0) {
            psVar20 = &local_70;
            if (7 < local_58) {
              psVar20 = psVar13;
            }
            lVar24 = (longlong)pvVar15 - (longlong)psVar20;
            do {
              sVar1 = *psVar20;
              *(short *)(lVar24 + (longlong)psVar20) = sVar1;
              psVar20 = psVar20 + 1;
            } while (sVar1 != 0);
            *(undefined2 *)((longlong)pvVar15 + local_60 * 2) = 0;
            if (puVar10 != (undefined8 *)0x0) {
              puVar16 = (ulonglong *)*puVar10;
            }
            ppvVar2 = (void **)puVar16[9];
            if ((&local_d0 < ppvVar2) && (ppvVar3 = (void **)puVar16[8], ppvVar3 <= &local_d0)) {
              if (ppvVar2 == (void **)puVar16[10]) {
                FUN_14000b000(puVar16 + 8);
              }
              if ((undefined8 *)puVar16[9] != (undefined8 *)0x0) {
                *(undefined8 *)puVar16[9] =
                     *(undefined8 *)
                      (puVar16[8] + ((longlong)&local_d0 - (longlong)ppvVar3 >> 3) * 8);
              }
            }
            else {
              if (ppvVar2 == (void **)puVar16[10]) {
                FUN_14000b000(puVar16 + 8);
              }
              if ((undefined8 *)puVar16[9] != (undefined8 *)0x0) {
                *(undefined8 *)puVar16[9] = pvVar15;
              }
            }
            puVar16[9] = puVar16[9] + 8;
            puVar16 = puVar26;
            if (puVar10 != (undefined8 *)0x0) {
              puVar16 = (ulonglong *)*puVar10;
            }
            iVar23 = (int)((longlong)(puVar16[9] - puVar16[8]) >> 3) + -1;
            puVar16 = puVar26;
            if (puVar10 != (undefined8 *)0x0) {
              puVar16 = (ulonglong *)*puVar10;
            }
            piVar12 = (int *)puVar16[0x11];
            local_fc = iVar23;
            if ((&local_fc < piVar12) && (piVar19 = (int *)puVar16[0x10], piVar19 <= &local_fc)) {
              if (piVar12 == (int *)puVar16[0x12]) {
                FUN_14007a1d0(puVar16 + 0x10,1);
              }
              if ((undefined4 *)puVar16[0x11] != (undefined4 *)0x0) {
                *(undefined4 *)puVar16[0x11] =
                     *(undefined4 *)
                      (puVar16[0x10] + ((longlong)local_f8 + (-4 - (longlong)piVar19) >> 2) * 4);
              }
            }
            else {
              if (piVar12 == (int *)puVar16[0x12]) {
                FUN_14007a1d0(puVar16 + 0x10,1);
              }
              if ((int *)puVar16[0x11] != (int *)0x0) {
                *(int *)puVar16[0x11] = iVar23;
              }
            }
            puVar16[0x11] = puVar16[0x11] + 4;
            uVar21 = local_58;
          }
        }
        else {
          if (iVar23 != 3) {
            if (iVar23 != 4) goto LAB_14009998b;
            (**(code **)(*param_3 + 8))(param_3,&local_e8,8);
            puVar11 = puVar26;
            if (puVar10 != (undefined8 *)0x0) {
              puVar11 = (ulonglong *)*puVar10;
            }
            puVar18 = (undefined8 *)puVar11[1];
            if ((&local_e8 < puVar18) && (puVar22 = (undefined8 *)*puVar11, puVar22 <= &local_e8)) {
              if (puVar18 == (undefined8 *)puVar11[2]) {
                FUN_14000b000(puVar11);
              }
              puVar18 = (undefined8 *)puVar11[1];
              if (puVar18 != (undefined8 *)0x0) {
                uVar17 = *(undefined8 *)
                          (*puVar11 + ((longlong)&local_e8 - (longlong)puVar22 >> 3) * 8);
LAB_1400992a7:
                *puVar18 = uVar17;
              }
            }
            else {
              if (puVar18 == (undefined8 *)puVar11[2]) {
                FUN_14000b000(puVar11);
              }
              puVar18 = (undefined8 *)puVar11[1];
              uVar17 = local_e8;
              if (puVar18 != (undefined8 *)0x0) goto LAB_1400992a7;
            }
            puVar11[1] = puVar11[1] + 8;
            puVar11 = puVar26;
            if (puVar10 != (undefined8 *)0x0) {
              puVar11 = (ulonglong *)*puVar10;
            }
            iVar23 = (int)((longlong)(puVar11[1] - *puVar11) >> 3) + -1;
            if (puVar10 != (undefined8 *)0x0) {
              puVar16 = (ulonglong *)*puVar10;
            }
            piVar12 = (int *)puVar16[0x11];
            local_10c = iVar23;
            if ((&local_10c < piVar12) && (piVar19 = (int *)puVar16[0x10], piVar19 <= &local_10c)) {
              piVar25 = &local_10c;
              goto LAB_140099301;
            }
            if (piVar12 == (int *)puVar16[0x12]) {
              FUN_14007a1d0(puVar16 + 0x10,1);
            }
            if ((int *)puVar16[0x11] != (int *)0x0) {
              *(int *)puVar16[0x11] = iVar23;
            }
            puVar16[0x11] = puVar16[0x11] + 4;
            goto LAB_14009998b;
          }
          local_80 = 7;
          local_88 = 0;
          local_98 = 0;
          (**(code **)(*param_3 + 8))(param_3,local_f4,2);
          uVar8 = local_f4[0];
          uVar21 = (ulonglong)local_f4[0];
          if ((local_f4[0] + 1 != 7) &&
             (cVar9 = FUN_140001a20(&local_98,local_f4[0] + 1,1), cVar9 != '\0')) {
            local_88 = 0;
            psVar13 = &local_98;
            if (7 < local_80) {
              psVar13 = (short *)CONCAT62(uStack_96,local_98);
            }
            *psVar13 = 0;
          }
          if (uVar8 != 0) {
            do {
              (**(code **)(*param_3 + 8))(param_3,local_f8,2);
              FUN_14008a4d0(&local_98,local_f8[0]);
              uVar21 = uVar21 - 1;
            } while (uVar21 != 0);
          }
          auVar6._8_8_ = 0;
          auVar6._0_8_ = local_88 + 1;
          _Var14 = SUB168(ZEXT816(2) * auVar6,0);
          if (SUB168(ZEXT816(2) * auVar6,8) != 0) {
            _Var14 = 0xffffffffffffffff;
          }
          pvVar15 = operator_new(_Var14);
          psVar13 = (short *)CONCAT62(uStack_96,local_98);
          uVar21 = local_80;
          local_c8 = pvVar15;
          if (pvVar15 != (void *)0x0) {
            psVar20 = &local_98;
            if (7 < local_80) {
              psVar20 = psVar13;
            }
            lVar24 = (longlong)pvVar15 - (longlong)psVar20;
            do {
              sVar1 = *psVar20;
              *(short *)(lVar24 + (longlong)psVar20) = sVar1;
              psVar20 = psVar20 + 1;
            } while (sVar1 != 0);
            *(undefined2 *)((longlong)pvVar15 + local_88 * 2) = 0;
            if (puVar10 != (undefined8 *)0x0) {
              puVar16 = (ulonglong *)*puVar10;
            }
            ppvVar2 = (void **)puVar16[5];
            if ((&local_c8 < ppvVar2) && (ppvVar3 = (void **)puVar16[4], ppvVar3 <= &local_c8)) {
              if (ppvVar2 == (void **)puVar16[6]) {
                FUN_14000b000(puVar16 + 4);
              }
              if ((undefined8 *)puVar16[5] != (undefined8 *)0x0) {
                *(undefined8 *)puVar16[5] =
                     *(undefined8 *)
                      (puVar16[4] + ((longlong)&local_c8 - (longlong)ppvVar3 >> 3) * 8);
              }
            }
            else {
              if (ppvVar2 == (void **)puVar16[6]) {
                FUN_14000b000(puVar16 + 4);
              }
              if ((undefined8 *)puVar16[5] != (undefined8 *)0x0) {
                *(undefined8 *)puVar16[5] = pvVar15;
              }
            }
            puVar16[5] = puVar16[5] + 8;
            puVar16 = puVar26;
            if (puVar10 != (undefined8 *)0x0) {
              puVar16 = (ulonglong *)*puVar10;
            }
            iVar23 = (int)((longlong)(puVar16[5] - puVar16[4]) >> 3) + -1;
            puVar16 = puVar26;
            if (puVar10 != (undefined8 *)0x0) {
              puVar16 = (ulonglong *)*puVar10;
            }
            piVar12 = (int *)puVar16[0x11];
            local_104 = iVar23;
            if ((&local_104 < piVar12) && (piVar19 = (int *)puVar16[0x10], piVar19 <= &local_104)) {
              if (piVar12 == (int *)puVar16[0x12]) {
                FUN_14007a1d0(puVar16 + 0x10,1);
              }
              if ((undefined4 *)puVar16[0x11] != (undefined4 *)0x0) {
                *(undefined4 *)puVar16[0x11] =
                     *(undefined4 *)
                      (puVar16[0x10] + ((longlong)local_100 + (-4 - (longlong)piVar19) >> 2) * 4);
              }
            }
            else {
              if (piVar12 == (int *)puVar16[0x12]) {
                FUN_14007a1d0(puVar16 + 0x10,1);
              }
              if ((int *)puVar16[0x11] != (int *)0x0) {
                *(int *)puVar16[0x11] = iVar23;
              }
            }
            puVar16[0x11] = puVar16[0x11] + 4;
            uVar21 = local_80;
          }
        }
        param_2 = local_f0;
        if (7 < uVar21) {
          operator_delete(psVar13);
          param_2 = local_f0;
        }
      }
LAB_14009998b:
      puVar27 = (ulonglong *)((longlong)puVar27 + 1);
    } while ((longlong)puVar27 < local_c0);
  }
  puVar18 = local_e0;
  puVar27 = puVar26;
  if (puVar10 != (undefined8 *)0x0) {
    puVar27 = (ulonglong *)*puVar10;
  }
  if (puVar27[0x10] == puVar27[0x11]) {
    if (puVar10 != (undefined8 *)0x0) {
      LOCK();
      piVar12 = (int *)(puVar10 + 1);
      iVar23 = *piVar12;
      *piVar12 = *piVar12 + -1;
      UNLOCK();
      if (iVar23 == 1) {
        pvVar15 = (void *)*local_e0;
        if (pvVar15 != (void *)0x0) {
          FUN_14009b190(pvVar15);
          operator_delete(pvVar15);
        }
        operator_delete(puVar18);
      }
    }
    uVar17 = 0;
  }
  else {
    if (puVar10 != (undefined8 *)0x0) {
      puVar26 = (ulonglong *)*puVar10;
    }
    local_b8 = *(undefined4 *)puVar26[0x10];
    puVar18 = puVar10;
    if (puVar10 != (undefined8 *)0x0) {
      LOCK();
      *(int *)(puVar10 + 1) = *(int *)(puVar10 + 1) + 1;
      UNLOCK();
      puVar18 = local_e0;
    }
    local_b0 = puVar10;
    local_a8 = puVar10;
    FUN_140099e30(param_2 + 0x68,local_b8,&local_b0);
    puVar10 = local_e0;
    puVar22 = (undefined8 *)0x0;
    if (puVar18 != (undefined8 *)0x0) {
      LOCK();
      piVar12 = (int *)(puVar18 + 1);
      iVar23 = *piVar12;
      *piVar12 = *piVar12 + -1;
      UNLOCK();
      puVar22 = puVar10;
      if (iVar23 == 1) {
        pvVar15 = (void *)*local_e0;
        if (pvVar15 != (void *)0x0) {
          FUN_14009b190(pvVar15);
          operator_delete(pvVar15);
        }
        operator_delete(puVar10);
      }
    }
    puVar10 = local_e0;
    if (puVar22 != (undefined8 *)0x0) {
      LOCK();
      piVar12 = (int *)(puVar22 + 1);
      iVar23 = *piVar12;
      *piVar12 = *piVar12 + -1;
      UNLOCK();
      if (iVar23 == 1) {
        pvVar15 = (void *)*local_e0;
        if (pvVar15 != (void *)0x0) {
          FUN_14009b190(pvVar15);
          operator_delete(pvVar15);
        }
        operator_delete(puVar10);
      }
    }
    uVar17 = 1;
  }
  return uVar17;
}



void FUN_140099ad0(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_14009a6d0(*param_1,param_1[1]);
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void thunk_FUN_140099bd0(undefined8 *param_1)

{
  int *piVar1;
  undefined8 *puVar2;
  void *pvVar3;
  int iVar4;
  bool bVar5;
  
  puVar2 = (undefined8 *)*param_1;
  if (puVar2 != (undefined8 *)0x0) {
    if (puVar2 == (undefined8 *)param_1[1]) {
      if (puVar2 != (undefined8 *)0x0) {
        LOCK();
        piVar1 = (int *)(puVar2 + 1);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          *param_1 = 0;
          pvVar3 = (void *)*puVar2;
          if (pvVar3 != (void *)0x0) {
            FUN_14009b490(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_14032016c + 1;
      bVar5 = DAT_14032016c == 0;
      DAT_14032016c = iVar4;
      if (bVar5) {
        FUN_14001f5c0(1);
        return;
      }
    }
  }
  return;
}



void FUN_140099b20(void)

{
                    // WARNING: Could not recover jumptable at 0x000140099b27. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140320178);
  return;
}



void thunk_FUN_140099c50(void)

{
  FUN_140099c50();
  return;
}



void FUN_140099b40(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = param_1[1] - *param_1 >> 4;
  if (0xffffffffffffffe < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = param_1[2] - *param_1 >> 4;
  if (uVar2 < uVar3) {
    if (0xfffffffffffffff - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_140099cd0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140099cd0(param_1,uVar2);
  }
  return;
}



void FUN_140099bd0(undefined8 *param_1)

{
  int *piVar1;
  undefined8 *puVar2;
  void *pvVar3;
  int iVar4;
  bool bVar5;
  
  puVar2 = (undefined8 *)*param_1;
  if (puVar2 != (undefined8 *)0x0) {
    if (puVar2 == (undefined8 *)param_1[1]) {
      if (puVar2 != (undefined8 *)0x0) {
        LOCK();
        piVar1 = (int *)(puVar2 + 1);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          *param_1 = 0;
          pvVar3 = (void *)*puVar2;
          if (pvVar3 != (void *)0x0) {
            FUN_14009b490(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_14032016c + 1;
      bVar5 = DAT_14032016c == 0;
      DAT_14032016c = iVar4;
      if (bVar5) {
        FUN_14001f5c0(1);
        return;
      }
    }
  }
  return;
}



void FUN_140099c50(undefined8 *param_1)

{
  int *piVar1;
  undefined8 *puVar2;
  void *pvVar3;
  int iVar4;
  bool bVar5;
  
  puVar2 = (undefined8 *)*param_1;
  if (puVar2 != (undefined8 *)0x0) {
    if (puVar2 == (undefined8 *)param_1[1]) {
      if (puVar2 != (undefined8 *)0x0) {
        LOCK();
        piVar1 = (int *)(puVar2 + 1);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          *param_1 = 0;
          pvVar3 = (void *)*puVar2;
          if (pvVar3 != (void *)0x0) {
            FUN_14009b190(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_140320170 + 1;
      bVar5 = DAT_140320170 == 0;
      DAT_140320170 = iVar4;
      if (bVar5) {
        FUN_14001f5c0(1);
        return;
      }
    }
  }
  return;
}



void FUN_140099cd0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0xfffffffffffffff < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)(param_1[2] - *param_1 >> 4) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 << 4);
      if (local_res10 == (char *)0x0) {
        std::exception::exception((exception *)local_20,&local_res10);
        local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_20,(ThrowInfo *)&DAT_1402f47a8);
      }
    }
    pcVar4 = local_res10;
    FUN_14009aad0(*param_1,param_1[1],local_res10,param_4,uVar5);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_14009a6d0();
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x10);
    param_1[1] = (longlong)(pcVar4 + (lVar1 - lVar2 & 0xfffffffffffffff0));
    *param_1 = (longlong)pcVar4;
  }
  return;
}



undefined2 * FUN_140099de0(undefined2 *param_1,undefined8 param_2,undefined8 *param_3)

{
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  FUN_140001700(param_1,param_2,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x14) = *param_3;
  return param_1;
}



uint * FUN_140099e30(longlong *param_1,uint param_2,longlong *param_3)

{
  longlong lVar1;
  char cVar2;
  uint *puVar3;
  ulonglong uVar4;
  
  uVar4 = (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar2 = FUN_14000d350(param_1,uVar4,1,uVar4,0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar4) * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 6)) {
      if ((puVar3[8] == param_2) && (*puVar3 == param_2)) {
        if (*(longlong *)(puVar3 + 2) == *param_3) {
          return puVar3;
        }
        FUN_140099c50(puVar3 + 2);
        lVar1 = *param_3;
        *(longlong *)(puVar3 + 2) = lVar1;
        *(longlong *)(puVar3 + 4) = lVar1;
        if (lVar1 == 0) {
          return puVar3;
        }
        LOCK();
        *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
        UNLOCK();
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_14009a780(param_1,param_2,(ulonglong)param_2 % uVar4,param_2);
  if (*(longlong *)(puVar3 + 2) != *param_3) {
    FUN_140099c50(puVar3 + 2);
    lVar1 = *param_3;
    *(longlong *)(puVar3 + 2) = lVar1;
    *(longlong *)(puVar3 + 4) = lVar1;
    if (lVar1 != 0) {
      LOCK();
      *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
      UNLOCK();
    }
  }
  return puVar3;
}



undefined8 * FUN_140099f20(undefined8 *param_1)

{
  longlong lVar1;
  longlong lVar2;
  undefined **ppuVar3;
  
  ppuVar3 = (undefined **)&DAT_14027a110;
  lVar2 = 0x28;
  do {
    lVar1 = lVar2 / 2;
    if (ppuVar3[lVar1] < (undefined *)0xb) {
      ppuVar3 = ppuVar3 + lVar1 + 1;
      lVar1 = lVar2 + (-1 - lVar1);
    }
    lVar2 = lVar1;
  } while (0 < lVar1);
  if (ppuVar3 == &Proud::INetServerEvent::vftable_meta_ptr) {
    ppuVar3 = (undefined **)&UNK_14027a248;
  }
  param_1[1] = *ppuVar3;
  *param_1 = 0;
  *(undefined1 *)(param_1 + 3) = 0;
  param_1[4] = 0;
  *(undefined4 *)(param_1 + 5) = 0x3f800000;
  param_1[6] = 0;
  param_1[7] = 0;
  return param_1;
}



void FUN_140099fa0(undefined8 *param_1)

{
  int *piVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  void *pvVar6;
  int iVar7;
  DWORD DVar8;
  HANDLE hObject;
  HANDLE pvVar9;
  undefined8 *puVar10;
  
  if (param_1[4] != 0) {
    puVar10 = (undefined8 *)*param_1;
    puVar2 = puVar10 + param_1[1];
    for (; puVar10 != puVar2; puVar10 = puVar10 + 1) {
      puVar3 = (undefined8 *)*puVar10;
      *puVar10 = 0;
      iVar7 = DAT_14032016c;
      while (DAT_14032016c = iVar7, puVar3 != (undefined8 *)0x0) {
        puVar4 = (undefined8 *)*puVar3;
        puVar5 = (undefined8 *)puVar3[6];
        if (puVar5 != (undefined8 *)0x0) {
          if (puVar5 == (undefined8 *)puVar3[7]) {
            if (puVar5 != (undefined8 *)0x0) {
              LOCK();
              piVar1 = (int *)(puVar5 + 1);
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              if (*piVar1 == 0) {
                puVar3[6] = 0;
                pvVar6 = (void *)*puVar5;
                if (pvVar6 != (void *)0x0) {
                  FUN_14009b490(pvVar6);
                  operator_delete(pvVar6);
                }
                operator_delete(puVar5);
              }
            }
          }
          else {
            DAT_14032016c = iVar7 + 1;
            if ((iVar7 == 0) &&
               (hObject = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                      (HANDLE)0x0), hObject != (HANDLE)0x0)) {
              DVar8 = GetCurrentProcessId();
              pvVar9 = GetCurrentProcess();
              MiniDumpWriteDump(pvVar9,DVar8,hObject,2,0,0,0);
              CloseHandle(hObject);
            }
          }
        }
        if (7 < (ulonglong)puVar3[4]) {
          operator_delete((void *)puVar3[1]);
        }
        puVar3[4] = 7;
        puVar3[3] = 0;
        *(undefined2 *)(puVar3 + 1) = 0;
        operator_delete(puVar3);
        puVar3 = puVar4;
        iVar7 = DAT_14032016c;
      }
    }
    param_1[4] = 0;
    param_1[6] = puVar2;
  }
  return;
}



void FUN_14009a150(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_14009a1f0();
  }
  return;
}



void FUN_14009a170(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x20) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x18); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0x18))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x18) = *(undefined8 *)(param_2 + 0x18);
      FUN_14009acd0(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x18);
  FUN_14009acd0(param_1,param_2);
  return;
}



void FUN_14009a1f0(undefined8 *param_1)

{
  int *piVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  int iVar7;
  DWORD DVar8;
  HANDLE hObject;
  HANDLE pvVar9;
  undefined8 *puVar10;
  
  puVar10 = (undefined8 *)*param_1;
  puVar2 = puVar10 + param_1[1];
  for (; puVar10 != puVar2; puVar10 = puVar10 + 1) {
    puVar3 = (undefined8 *)*puVar10;
    *puVar10 = 0;
    iVar7 = DAT_14032016c;
    while (DAT_14032016c = iVar7, puVar3 != (undefined8 *)0x0) {
      puVar4 = (undefined8 *)*puVar3;
      puVar5 = (undefined8 *)puVar3[6];
      if (puVar5 != (undefined8 *)0x0) {
        if (puVar5 == (undefined8 *)puVar3[7]) {
          if (puVar5 != (undefined8 *)0x0) {
            LOCK();
            piVar1 = (int *)(puVar5 + 1);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              puVar3[6] = 0;
              puVar6 = (undefined8 *)*puVar5;
              if (puVar6 != (undefined8 *)0x0) {
                FUN_14009bd70(puVar6 + 0xd);
                FUN_14009bff0(puVar6 + 0xd);
                if ((void *)puVar6[9] != (void *)0x0) {
                  operator_delete((void *)puVar6[9]);
                }
                puVar6[9] = 0;
                puVar6[10] = 0;
                puVar6[0xb] = 0;
                FUN_14008eb80(puVar6 + 5);
                if (7 < (ulonglong)puVar6[3]) {
                  operator_delete((void *)*puVar6);
                }
                puVar6[3] = 7;
                puVar6[2] = 0;
                *(undefined2 *)puVar6 = 0;
                operator_delete(puVar6);
              }
              operator_delete(puVar5);
            }
          }
        }
        else {
          DAT_14032016c = iVar7 + 1;
          if ((iVar7 == 0) &&
             (hObject = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                    (HANDLE)0x0), hObject != (HANDLE)0x0)) {
            DVar8 = GetCurrentProcessId();
            pvVar9 = GetCurrentProcess();
            MiniDumpWriteDump(pvVar9,DVar8,hObject,2,0,0,0);
            CloseHandle(hObject);
          }
        }
      }
      if (7 < (ulonglong)puVar3[4]) {
        operator_delete((void *)puVar3[1]);
      }
      puVar3[4] = 7;
      puVar3[3] = 0;
      *(undefined2 *)(puVar3 + 1) = 0;
      operator_delete(puVar3);
      puVar3 = puVar4;
      iVar7 = DAT_14032016c;
    }
  }
  operator_delete((void *)*param_1);
  *param_1 = 0;
  return;
}



longlong * FUN_14009a400(longlong *param_1,longlong *param_2,ushort *param_3,longlong param_4)

{
  char cVar1;
  ushort *puVar2;
  longlong *plVar3;
  ushort *puVar4;
  ulonglong uVar5;
  ushort *puVar6;
  longlong lVar7;
  longlong *plVar8;
  longlong *plVar9;
  longlong *local_50;
  longlong *local_48;
  undefined2 local_40;
  
  puVar4 = param_3;
  if (7 < *(ulonglong *)(param_3 + 0xc)) {
    puVar4 = *(ushort **)param_3;
  }
  puVar2 = param_3;
  if (7 < *(ulonglong *)(param_3 + 0xc)) {
    puVar2 = *(ushort **)param_3;
  }
  uVar5 = 0;
  lVar7 = param_4;
  puVar6 = param_3;
  for (; puVar2 != puVar4 + *(longlong *)(param_3 + 8); puVar2 = puVar2 + 1) {
    lVar7 = uVar5 * 0x40;
    puVar6 = (ushort *)((ulonglong)*puVar2 + (uVar5 >> 2) + lVar7 + 0x9e3779b9);
    uVar5 = uVar5 ^ (ulonglong)puVar6;
  }
  plVar9 = (longlong *)(*param_1 + (uVar5 % (ulonglong)param_1[1]) * 8);
  lVar7 = FUN_140096650(plVar9,param_3,puVar6,lVar7,0xfffffffffffffffe);
  if (lVar7 == 0) {
    local_48 = (longlong *)0x0;
    local_40 = 0;
    local_50 = param_1;
    FUN_14009afa0(&local_50);
    plVar8 = local_48;
    plVar3 = local_48 + 1;
    if (plVar3 != (longlong *)0x0) {
      local_48[4] = 7;
      local_48[3] = 0;
      *(undefined2 *)plVar3 = 0;
      FUN_140001700(plVar3,param_4,0,0xffffffffffffffff);
      lVar7 = *(longlong *)(param_4 + 0x28);
      plVar8[6] = lVar7;
      plVar8[7] = lVar7;
      if (lVar7 != 0) {
        LOCK();
        *(int *)(lVar7 + 8) = *(int *)(lVar7 + 8) + 1;
        UNLOCK();
        plVar8 = local_48;
      }
    }
    local_40 = CONCAT11(1,(undefined1)local_40);
    cVar1 = FUN_14009a8d0(param_1);
    if (cVar1 != '\0') {
      plVar9 = (longlong *)(*param_1 + (uVar5 % (ulonglong)param_1[1]) * 8);
    }
    *plVar8 = *plVar9;
    *plVar9 = (longlong)plVar8;
    param_1[4] = param_1[4] + 1;
    plVar3 = (longlong *)param_1[6];
    if (plVar9 < (longlong *)param_1[6]) {
      plVar3 = plVar9;
    }
    param_1[6] = (longlong)plVar3;
    *param_2 = (longlong)plVar9;
    param_2[1] = (longlong)plVar8;
    *(undefined1 *)(param_2 + 2) = 1;
  }
  else {
    *param_2 = (longlong)plVar9;
    param_2[1] = lVar7;
    *(undefined1 *)(param_2 + 2) = 0;
  }
  return param_2;
}



undefined8 * FUN_14009a5b0(undefined8 param_1,undefined8 *param_2,longlong param_3)

{
  longlong lVar1;
  void *pvVar2;
  undefined8 *puVar3;
  undefined2 *puVar4;
  undefined8 uVar5;
  undefined1 local_40 [16];
  undefined8 local_30;
  void *local_28;
  undefined2 local_20;
  
  uVar5 = 0xfffffffffffffffe;
  local_28 = (void *)0x0;
  local_20 = 0;
  local_30 = param_1;
  FUN_14009afa0(&local_30);
  pvVar2 = local_28;
  puVar4 = (undefined2 *)((longlong)local_28 + 8);
  if (puVar4 != (undefined2 *)0x0) {
    *(undefined8 *)((longlong)local_28 + 0x20) = 7;
    *(undefined8 *)((longlong)local_28 + 0x18) = 0;
    *puVar4 = 0;
    FUN_140001700(puVar4,param_3,0,0xffffffffffffffff,uVar5);
    lVar1 = *(longlong *)(param_3 + 0x28);
    *(longlong *)((longlong)pvVar2 + 0x30) = lVar1;
    *(longlong *)((longlong)pvVar2 + 0x38) = lVar1;
    if (lVar1 != 0) {
      LOCK();
      *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
      UNLOCK();
    }
  }
  local_20._1_1_ = '\x01';
  puVar3 = (undefined8 *)FUN_14009a940(param_1,local_40,&local_30);
  pvVar2 = local_28;
  *param_2 = *puVar3;
  param_2[1] = puVar3[1];
  *(undefined1 *)(param_2 + 2) = 1;
  if (local_28 != (void *)0x0) {
    if (local_20._1_1_ != '\0') {
      puVar3 = (undefined8 *)((longlong)local_28 + 8);
      FUN_140099bd0((longlong)local_28 + 0x30);
      if (7 < *(ulonglong *)((longlong)pvVar2 + 0x20)) {
        operator_delete((void *)*puVar3);
      }
      *(undefined8 *)((longlong)pvVar2 + 0x20) = 7;
      *(undefined8 *)((longlong)pvVar2 + 0x18) = 0;
      *(undefined2 *)puVar3 = 0;
    }
    operator_delete(pvVar2);
  }
  return param_2;
}



void FUN_14009a6d0(undefined8 *param_1,undefined8 *param_2)

{
  int *piVar1;
  undefined8 *puVar2;
  void *pvVar3;
  int iVar4;
  
  iVar4 = DAT_14032016c;
  for (; param_1 != param_2; param_1 = param_1 + 2) {
    puVar2 = (undefined8 *)*param_1;
    DAT_14032016c = iVar4;
    if (puVar2 != (undefined8 *)0x0) {
      if (puVar2 == (undefined8 *)param_1[1]) {
        if (puVar2 != (undefined8 *)0x0) {
          LOCK();
          piVar1 = (int *)(puVar2 + 1);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            *param_1 = 0;
            pvVar3 = (void *)*puVar2;
            if (pvVar3 != (void *)0x0) {
              FUN_14009b490(pvVar3);
              operator_delete(pvVar3);
            }
            operator_delete(puVar2);
          }
        }
      }
      else {
        DAT_14032016c = iVar4 + 1;
        if (iVar4 == 0) {
          FUN_14001f5c0(1);
        }
      }
    }
    iVar4 = DAT_14032016c;
  }
  DAT_14032016c = iVar4;
  return;
}



undefined4 *
FUN_14009a780(longlong *param_1,undefined4 param_2,ulonglong param_3,undefined4 param_4)

{
  int iVar1;
  undefined4 *puVar2;
  undefined1 auVar3 [16];
  undefined4 uVar4;
  longlong *plVar5;
  ulonglong uVar6;
  longlong lVar7;
  
  if (param_1[8] == 0) {
    uVar6 = CONCAT44(0,*(uint *)((longlong)param_1 + 0x34));
    if (uVar6 == 0) {
      lVar7 = 0;
    }
    else {
      auVar3._8_8_ = 0;
      auVar3._0_8_ = uVar6;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar3,0) < 0x28)
      goto LAB_14009a837;
      lVar7 = uVar6 * 0x28;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_14009a837:
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 5 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[3] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -5;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 6);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 2) = 0;
  puVar2[8] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 6) = *(undefined8 *)(*param_1 + (param_3 & 0xffffffff) * 8);
  *(undefined4 **)(*param_1 + (param_3 & 0xffffffff) * 8) = puVar2;
  if (((ulonglong)param_1[4] < (ulonglong)param_1[1]) && ((int)param_1[6] == 0)) {
    uVar4 = FUN_14001de50(param_1);
    FUN_14009ab20(param_1,uVar4);
  }
  return puVar2;
}



undefined8 FUN_14009a8d0(longlong param_1,ulonglong param_2)

{
  longlong lVar1;
  ulonglong *puVar2;
  ulonglong local_res8;
  ulonglong local_res10 [3];
  
  local_res10[0] = param_2;
  if (*(ulonglong *)(param_1 + 0x38) <= param_2) {
    local_res8 = (*(ulonglong *)(param_1 + 0x20) >> 1) + *(ulonglong *)(param_1 + 0x20);
    puVar2 = &local_res8;
    if (local_res8 <= param_2) {
      puVar2 = local_res10;
    }
    lVar1 = FUN_14001ed50(param_1,*puVar2);
    if (lVar1 != *(longlong *)(param_1 + 8)) {
      FUN_14009ad70(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



longlong * FUN_14009a940(longlong *param_1,longlong *param_2,longlong param_3)

{
  ulonglong *puVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined8 *puVar4;
  undefined8 uVar5;
  ushort *puVar6;
  ulonglong *puVar7;
  ulonglong uVar8;
  ushort *puVar9;
  ulonglong local_res8;
  
  lVar3 = *(longlong *)(param_3 + 8);
  puVar6 = (ushort *)(lVar3 + 8);
  puVar9 = puVar6;
  if (7 < *(ulonglong *)(lVar3 + 0x20)) {
    puVar9 = *(ushort **)puVar6;
  }
  if (7 < *(ulonglong *)(lVar3 + 0x20)) {
    puVar6 = *(ushort **)puVar6;
  }
  uVar8 = 0;
  for (; puVar6 != puVar9 + *(longlong *)(lVar3 + 0x18); puVar6 = puVar6 + 1) {
    uVar8 = uVar8 ^ (ulonglong)*puVar6 + (uVar8 >> 2) + uVar8 * 0x40 + 0x9e3779b9;
  }
  if (*param_1 == 0) {
    local_res8 = FUN_14001ed50(param_1);
    puVar1 = (ulonglong *)(param_1 + 1);
    puVar7 = &local_res8;
    if (local_res8 <= *puVar1) {
      puVar7 = puVar1;
    }
    *puVar1 = *puVar7;
    FUN_140097060(param_1);
    FUN_14009b090(param_1);
  }
  else {
    FUN_14009a8d0();
  }
  plVar2 = (longlong *)(*param_1 + (uVar8 % (ulonglong)param_1[1]) * 8);
  puVar4 = *(undefined8 **)(param_3 + 8);
  *(undefined8 *)(param_3 + 8) = 0;
  uVar5 = *plVar2;
  *param_2 = (longlong)plVar2;
  *puVar4 = uVar5;
  *plVar2 = (longlong)puVar4;
  param_1[4] = param_1[4] + 1;
  param_2[1] = (longlong)puVar4;
  param_1[6] = (longlong)plVar2;
  return param_2;
}



void FUN_14009aa60(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 8);
  if (lVar1 != 0) {
    if (*(char *)(param_1 + 0x11) != '\0') {
      FUN_140099bd0(lVar1 + 0x30);
      if (7 < *(ulonglong *)(lVar1 + 0x20)) {
        operator_delete(*(void **)(lVar1 + 8));
      }
      *(undefined8 *)(lVar1 + 0x20) = 7;
      *(undefined8 *)(lVar1 + 0x18) = 0;
      *(undefined2 *)(lVar1 + 8) = 0;
    }
    operator_delete(*(void **)(param_1 + 8));
  }
  return;
}



longlong * FUN_14009aad0(longlong *param_1,longlong *param_2,longlong *param_3)

{
  longlong lVar1;
  
  for (; param_1 != param_2; param_1 = param_1 + 2) {
    if (param_3 != (longlong *)0x0) {
      lVar1 = *param_1;
      *param_3 = lVar1;
      param_3[1] = lVar1;
      if (lVar1 != 0) {
        LOCK();
        *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
        UNLOCK();
      }
    }
    param_3 = param_3 + 2;
  }
  return param_3;
}



void FUN_14009ab20(longlong *param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  __uint64 _Var4;
  void *_Dst;
  longlong lVar5;
  uint uVar6;
  float fVar7;
  
  if (param_2 == 0) {
    param_2 = FUN_14001de50(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_14000d350(param_1,param_2,0);
    }
    else {
      _Var4 = SUB168(ZEXT816(8) * ZEXT416(param_2),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_2),8) != 0) {
        _Var4 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var4);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_2 << 3);
      uVar6 = 0;
      if ((int)param_1[2] != 0) {
        lVar5 = 0;
        do {
          lVar3 = *(longlong *)(lVar5 + *param_1);
          while (lVar3 != 0) {
            lVar1 = *(longlong *)(lVar3 + 0x18);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x20) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x18) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar3;
            lVar3 = lVar1;
          }
          uVar6 = uVar6 + 1;
          lVar5 = lVar5 + 8;
        } while (uVar6 < *(uint *)(param_1 + 2));
      }
      operator_delete__((void *)*param_1);
      *param_1 = (longlong)_Dst;
      *(uint *)(param_1 + 2) = param_2;
      fVar7 = (float)param_2 * *(float *)((longlong)param_1 + 0x1c);
      lVar5 = 0;
      if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      param_1[4] = (longlong)fVar7 + lVar5;
      fVar7 = (float)param_2 * *(float *)(param_1 + 3);
      lVar5 = 0;
      if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      param_1[5] = (longlong)fVar7 + lVar5;
      if ((ulonglong)((longlong)fVar7 + lVar5) < 0x11) {
        param_1[5] = 0;
      }
    }
  }
  return;
}



void FUN_14009acd0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  FUN_140099c50(param_2 + 8);
  *(undefined8 *)(param_2 + 0x18) = *(undefined8 *)(param_1 + 0x40);
  *(longlong *)(param_1 + 8) = *(longlong *)(param_1 + 8) + -1;
  *(longlong *)(param_1 + 0x40) = param_2;
  if ((*(ulonglong *)(param_1 + 8) < *(ulonglong *)(param_1 + 0x28)) &&
     (*(int *)(param_1 + 0x30) == 0)) {
    uVar2 = FUN_14001de50(param_1);
    FUN_14009ab20(param_1,uVar2);
  }
  if (*(longlong *)(param_1 + 8) == 0) {
    *(undefined8 *)(param_1 + 0x40) = 0;
    _Memory = *(longlong **)(param_1 + 0x38);
    if (*(longlong **)(param_1 + 0x38) != (longlong *)0x0) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      *(undefined8 *)(param_1 + 0x38) = 0;
    }
  }
  return;
}



void FUN_14009ad70(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 *puVar3;
  ushort *puVar4;
  longlong *plVar5;
  longlong lVar6;
  ushort *puVar7;
  undefined8 *puVar8;
  longlong lVar9;
  ulonglong uVar10;
  double dVar11;
  longlong local_50;
  ulonglong local_48;
  longlong local_38;
  longlong local_30;
  
  lVar9 = param_1[4];
  lVar6 = param_1[1];
  lVar1 = *param_1;
  local_50 = 0;
  local_48 = param_2;
  FUN_140097060(&local_50,param_2,lVar6,param_4,0xfffffffffffffffe);
  local_30 = param_1[1];
  lVar2 = *param_1;
  *param_1 = 0;
  param_1[1] = local_30;
  param_1[4] = 0;
  for (puVar8 = (undefined8 *)param_1[6]; puVar8 != (undefined8 *)(lVar1 + lVar6 * 8);
      puVar8 = puVar8 + 1) {
    puVar3 = (undefined8 *)*puVar8;
    while (puVar3 != (undefined8 *)0x0) {
      puVar4 = (ushort *)(puVar3 + 1);
      puVar7 = puVar4;
      if (7 < (ulonglong)puVar3[4]) {
        puVar7 = *(ushort **)puVar4;
      }
      if (7 < (ulonglong)puVar3[4]) {
        puVar4 = *(ushort **)puVar4;
      }
      uVar10 = 0;
      for (; puVar4 != puVar7 + puVar3[3]; puVar4 = puVar4 + 1) {
        uVar10 = uVar10 ^ (ulonglong)*puVar4 + (uVar10 >> 2) + uVar10 * 0x40 + 0x9e3779b9;
      }
      *puVar8 = *puVar3;
      *puVar3 = *(undefined8 *)(local_50 + (uVar10 % local_48) * 8);
      *(undefined8 **)(local_50 + (uVar10 % local_48) * 8) = puVar3;
      puVar3 = (undefined8 *)*puVar8;
    }
  }
  param_1[4] = lVar9;
  lVar9 = *param_1;
  *param_1 = local_50;
  lVar6 = param_1[1];
  param_1[1] = local_48;
  plVar5 = (longlong *)*param_1;
  if (param_1[4] == 0) {
    param_1[6] = (longlong)(plVar5 + local_48);
  }
  else {
    param_1[6] = (longlong)plVar5;
    lVar1 = *plVar5;
    while (lVar1 == 0) {
      plVar5 = plVar5 + 1;
      param_1[6] = (longlong)plVar5;
      lVar1 = *plVar5;
    }
  }
  dVar11 = (double)param_1[1];
  if (param_1[1] < 0) {
    dVar11 = dVar11 + 1.8446744073709552e+19;
  }
  local_50 = lVar9;
  local_48 = lVar6;
  local_38 = lVar2;
  dVar11 = ceil((double)*(float *)(param_1 + 5) * dVar11);
  lVar6 = -1;
  if (dVar11 < 1.8446744073709552e+19) {
    lVar6 = 0;
    if ((9.223372036854776e+18 < dVar11) &&
       (dVar11 = dVar11 - 9.223372036854776e+18, dVar11 < 9.223372036854776e+18)) {
      lVar6 = -0x8000000000000000;
    }
    lVar6 = (longlong)dVar11 + lVar6;
  }
  param_1[7] = lVar6;
  if (lVar2 != 0) {
    FUN_14009a1f0(&local_38);
    lVar9 = local_50;
  }
  if (lVar9 != 0) {
    FUN_14009a1f0(&local_50);
  }
  return;
}



void FUN_14009afa0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 *puVar2;
  char *pcVar3;
  char *local_res8;
  undefined **local_60 [4];
  undefined8 uStack_40;
  undefined8 local_38;
  undefined8 uStack_30;
  undefined8 local_28;
  undefined8 uStack_20;
  undefined8 local_18;
  undefined8 uStack_10;
  
  lVar1 = *(longlong *)(param_1 + 8);
  if (lVar1 == 0) {
    *(undefined2 *)(param_1 + 0x10) = 0;
    puVar2 = operator_new(0x40);
    if (puVar2 == (undefined8 *)0x0) {
      local_res8 = (char *)0x0;
      std::exception::exception((exception *)local_60,&local_res8);
      local_60[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_60,(ThrowInfo *)&DAT_1402f47a8);
    }
    *(undefined8 **)(param_1 + 8) = puVar2;
    *puVar2 = 0;
    puVar2[1] = uStack_40;
    puVar2[2] = local_38;
    puVar2[3] = uStack_30;
    puVar2[4] = local_28;
    puVar2[5] = uStack_20;
    puVar2[6] = local_18;
    puVar2[7] = uStack_10;
    *(undefined1 *)(param_1 + 0x10) = 1;
  }
  else {
    pcVar3 = (char *)(lVar1 + 8);
    local_res8 = pcVar3;
    FUN_140099bd0(lVar1 + 0x30,param_2,param_3,param_4,0xfffffffffffffffe);
    if (7 < *(ulonglong *)(lVar1 + 0x20)) {
      operator_delete(*(void **)pcVar3);
    }
    *(undefined8 *)(lVar1 + 0x20) = 7;
    *(undefined8 *)(lVar1 + 0x18) = 0;
    pcVar3[0] = '\0';
    pcVar3[1] = '\0';
    *(undefined1 *)(param_1 + 0x11) = 0;
  }
  return;
}



void FUN_14009b090(longlong *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  
  if (param_1[4] == 0) {
    param_1[6] = *param_1 + param_1[1] * 8;
  }
  else {
    plVar1 = (longlong *)*param_1;
    param_1[6] = (longlong)plVar1;
    if (*plVar1 == 0) {
      do {
        plVar1 = plVar1 + 1;
        param_1[6] = (longlong)plVar1;
      } while (*plVar1 == 0);
      lVar2 = FUN_14009b100(param_1);
      param_1[7] = lVar2;
      return;
    }
  }
  lVar2 = FUN_14009b100(param_1);
  param_1[7] = lVar2;
  return;
}



longlong FUN_14009b100(longlong param_1)

{
  longlong lVar1;
  double dVar2;
  
  dVar2 = (double)*(longlong *)(param_1 + 8);
  if (*(longlong *)(param_1 + 8) < 0) {
    dVar2 = dVar2 + 1.8446744073709552e+19;
  }
  dVar2 = ceil((double)*(float *)(param_1 + 0x28) * dVar2);
  lVar1 = -1;
  if (dVar2 < 1.8446744073709552e+19) {
    lVar1 = 0;
    if ((9.223372036854776e+18 < dVar2) &&
       (dVar2 = dVar2 - 9.223372036854776e+18, dVar2 < 9.223372036854776e+18)) {
      lVar1 = -0x8000000000000000;
    }
    lVar1 = (longlong)dVar2 + lVar1;
  }
  return lVar1;
}



void FUN_14009b180(longlong param_1)

{
  FUN_140097240(param_1 + -8);
  return;
}



void FUN_14009b190(undefined8 *param_1)

{
  undefined8 *puVar1;
  
  puVar1 = (undefined8 *)param_1[8];
  if (puVar1 != (undefined8 *)param_1[9]) {
    do {
      operator_delete__((void *)*puVar1);
      puVar1 = puVar1 + 1;
    } while (puVar1 != (undefined8 *)param_1[9]);
  }
  puVar1 = (undefined8 *)param_1[4];
  if (puVar1 != (undefined8 *)param_1[5]) {
    do {
      operator_delete__((void *)*puVar1);
      puVar1 = puVar1 + 1;
    } while (puVar1 != (undefined8 *)param_1[5]);
  }
  if ((void *)param_1[0x10] != (void *)0x0) {
    operator_delete((void *)param_1[0x10]);
  }
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  if ((void *)param_1[0xc] != (void *)0x0) {
    operator_delete((void *)param_1[0xc]);
  }
  param_1[0xc] = 0;
  param_1[0xd] = 0;
  param_1[0xe] = 0;
  if ((void *)param_1[8] != (void *)0x0) {
    operator_delete((void *)param_1[8]);
  }
  param_1[8] = 0;
  param_1[9] = 0;
  param_1[10] = 0;
  if ((void *)param_1[4] != (void *)0x0) {
    operator_delete((void *)param_1[4]);
  }
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  if ((void *)*param_1 != (void *)0x0) {
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



undefined8 * FUN_14009b280(undefined8 *param_1,uint param_2)

{
  LPCRITICAL_SECTION lpCriticalSection;
  
  lpCriticalSection = DAT_140320178;
  *param_1 = MBMultiThreadSync<>::vftable;
  if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) {
    DeleteCriticalSection(lpCriticalSection);
    operator_delete(lpCriticalSection);
  }
  DAT_140320178 = (LPCRITICAL_SECTION)0x0;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14009b2f0(undefined8 *param_1)

{
  LPCRITICAL_SECTION lpCriticalSection;
  
  lpCriticalSection = DAT_140320178;
  *param_1 = MBMultiThreadSync<>::vftable;
  if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) {
    DeleteCriticalSection(lpCriticalSection);
    operator_delete(lpCriticalSection);
  }
  DAT_140320178 = (LPCRITICAL_SECTION)0x0;
  return;
}



undefined8 * FUN_14009b330(undefined8 *param_1,byte param_2)

{
  DAT_140320130 = 0;
  *param_1 = MBISingleton<>::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14009b370(undefined8 *param_1)

{
  DAT_140320130 = 0;
  *param_1 = MBISingleton<>::vftable;
  return;
}



// WARNING: Removing unreachable block (ram,0x00014009b425)
// WARNING: Removing unreachable block (ram,0x00014009b42e)
// WARNING: Removing unreachable block (ram,0x00014009b44f)
// WARNING: Removing unreachable block (ram,0x00014009b458)

undefined2 * FUN_14009b390(undefined2 *param_1)

{
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  *(undefined8 *)(param_1 + 0x14) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x1c) = 0;
  *(undefined8 *)(param_1 + 0x24) = 0;
  *(undefined8 *)(param_1 + 0x28) = 0;
  *(undefined8 *)(param_1 + 0x2c) = 0;
  *(undefined8 *)(param_1 + 0x34) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined4 *)(param_1 + 0x3c) = 0x11;
  *(undefined4 *)(param_1 + 0x4c) = 0;
  *(undefined4 *)(param_1 + 0x4e) = 10;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 0x54) = 0;
  *(undefined4 *)(param_1 + 0x3e) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x40) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x42) = 0x40100000;
  *(undefined8 *)(param_1 + 0x44) = 0x26;
  *(undefined8 *)(param_1 + 0x48) = 0;
  return param_1;
}



void thunk_FUN_14009bff0(void)

{
  FUN_14009bff0();
  return;
}



void FUN_14009b490(undefined8 *param_1)

{
  FUN_14009bd70(param_1 + 0xd);
  FUN_14009bff0(param_1 + 0xd);
  if ((void *)param_1[9] != (void *)0x0) {
    operator_delete((void *)param_1[9]);
  }
  param_1[9] = 0;
  param_1[10] = 0;
  param_1[0xb] = 0;
  FUN_14008eb80(param_1 + 5);
  if (7 < (ulonglong)param_1[3]) {
    operator_delete((void *)*param_1);
  }
  param_1[3] = 7;
  param_1[2] = 0;
  *(undefined2 *)param_1 = 0;
  return;
}



longlong FUN_14009b510(longlong param_1,ulonglong param_2,int param_3)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  longlong lVar4;
  void *pvVar5;
  ulonglong uVar6;
  
  uVar6 = param_2 & 0xffffffff;
  if (((int)(*(longlong *)(param_1 + 0x50) - *(longlong *)(param_1 + 0x48) >> 2) <= param_3) ||
     (*(int *)(*(longlong *)(param_1 + 0x48) + (longlong)param_3 * 4) != 0)) {
    FUN_14009bcd0(param_1,param_2,L"Not Found Column");
    return 0;
  }
  if (*(longlong *)(param_1 + 0x68) != 0) {
    for (piVar2 = *(int **)(*(longlong *)(param_1 + 0x68) +
                           (uVar6 % (ulonglong)*(uint *)(param_1 + 0x78)) * 8); piVar2 != (int *)0x0
        ; piVar2 = *(int **)(piVar2 + 6)) {
      if ((piVar2[8] == (int)param_2) && (*piVar2 == (int)param_2)) {
        if (piVar2 != (int *)0x0) {
          plVar3 = *(longlong **)(piVar2 + 2);
          if (plVar3 != (longlong *)0x0) {
            LOCK();
            *(int *)(plVar3 + 1) = (int)plVar3[1] + 1;
            UNLOCK();
            lVar4 = *plVar3;
            if (lVar4 != 0) {
              if (param_3 < (int)(*(longlong *)(lVar4 + 0x88) - *(longlong *)(lVar4 + 0x80) >> 2)) {
                lVar4 = *(longlong *)(lVar4 + 0x80);
                LOCK();
                plVar1 = plVar3 + 1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                if ((int)*plVar1 == 0) {
                  pvVar5 = (void *)*plVar3;
                  if (pvVar5 != (void *)0x0) {
                    FUN_14009b190(pvVar5);
                    operator_delete(pvVar5);
                  }
                  operator_delete(plVar3);
                }
                return lVar4 + (longlong)param_3 * 4;
              }
              FUN_14009bcd0(param_1,uVar6,L"Not Found LineTable Over Index");
              goto LAB_14009b63f;
            }
          }
          FUN_14009bcd0(param_1,uVar6,L"NULL LineTable");
          if (plVar3 == (longlong *)0x0) {
            return 0;
          }
LAB_14009b63f:
          LOCK();
          plVar1 = plVar3 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            pvVar5 = (void *)*plVar3;
            if (pvVar5 != (void *)0x0) {
              FUN_14009b190(pvVar5);
              operator_delete(pvVar5);
            }
            operator_delete(plVar3);
          }
          return 0;
        }
        break;
      }
    }
  }
  FUN_14009bcd0(param_1,uVar6,L"Not Found Line");
  return 0;
}



longlong FUN_14009b6a0(longlong param_1,ulonglong param_2,int param_3)

{
  longlong *plVar1;
  int iVar2;
  int *piVar3;
  longlong *plVar4;
  longlong lVar5;
  void *pvVar6;
  ulonglong uVar7;
  
  uVar7 = param_2 & 0xffffffff;
  if (((int)(*(longlong *)(param_1 + 0x50) - *(longlong *)(param_1 + 0x48) >> 2) <= param_3) ||
     (*(int *)(*(longlong *)(param_1 + 0x48) + (longlong)param_3 * 4) != 1)) {
    FUN_14009bcd0(param_1,param_2,L"Not Found Column",L"fBonusFactor");
    return 0;
  }
  if (*(longlong *)(param_1 + 0x68) != 0) {
    for (piVar3 = *(int **)(*(longlong *)(param_1 + 0x68) +
                           (uVar7 % (ulonglong)*(uint *)(param_1 + 0x78)) * 8); piVar3 != (int *)0x0
        ; piVar3 = *(int **)(piVar3 + 6)) {
      if ((piVar3[8] == (int)param_2) && (*piVar3 == (int)param_2)) {
        if (piVar3 != (int *)0x0) {
          plVar4 = *(longlong **)(piVar3 + 2);
          if (plVar4 != (longlong *)0x0) {
            LOCK();
            *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
            UNLOCK();
            lVar5 = *plVar4;
            if (lVar5 != 0) {
              if (param_3 < (int)(*(longlong *)(lVar5 + 0x88) - *(longlong *)(lVar5 + 0x80) >> 2)) {
                iVar2 = *(int *)(*(longlong *)(lVar5 + 0x80) + (longlong)param_3 * 4);
                if (iVar2 < (int)(*(longlong *)(lVar5 + 0x68) - *(longlong *)(lVar5 + 0x60) >> 2)) {
                  lVar5 = *(longlong *)(lVar5 + 0x60);
                  LOCK();
                  plVar1 = plVar4 + 1;
                  *(int *)plVar1 = (int)*plVar1 + -1;
                  UNLOCK();
                  if ((int)*plVar1 == 0) {
                    pvVar6 = (void *)*plVar4;
                    if (pvVar6 != (void *)0x0) {
                      FUN_14009b190(pvVar6);
                      operator_delete(pvVar6);
                    }
                    operator_delete(plVar4);
                  }
                  return lVar5 + (longlong)iVar2 * 4;
                }
                FUN_14009bcd0(param_1,uVar7,L"Not Found LineTable Over nFloatIdx",L"fBonusFactor");
              }
              else {
                FUN_14009bcd0(param_1,uVar7,L"Not Found LineTable Over Index",L"fBonusFactor");
              }
              goto LAB_14009b81d;
            }
          }
          FUN_14009bcd0(param_1,uVar7,L"NULL LineTable",L"fBonusFactor");
          if (plVar4 == (longlong *)0x0) {
            return 0;
          }
LAB_14009b81d:
          LOCK();
          plVar1 = plVar4 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            pvVar6 = (void *)*plVar4;
            if (pvVar6 != (void *)0x0) {
              FUN_14009b190(pvVar6);
              operator_delete(pvVar6);
            }
            operator_delete(plVar4);
          }
          return 0;
        }
        break;
      }
    }
  }
  FUN_14009bcd0(param_1,uVar7,L"Not Found Line",L"fBonusFactor");
  return 0;
}



undefined8 FUN_14009b870(longlong param_1,ulonglong param_2,int param_3)

{
  longlong *plVar1;
  int iVar2;
  int *piVar3;
  longlong *plVar4;
  longlong lVar5;
  undefined8 uVar6;
  void *pvVar7;
  ulonglong uVar8;
  
  uVar8 = param_2 & 0xffffffff;
  if (((int)(*(longlong *)(param_1 + 0x50) - *(longlong *)(param_1 + 0x48) >> 2) <= param_3) ||
     (*(int *)(*(longlong *)(param_1 + 0x48) + (longlong)param_3 * 4) != 2)) {
    FUN_14009bcd0(param_1,param_2,L"Not Found Column");
    return 0;
  }
  if (*(longlong *)(param_1 + 0x68) != 0) {
    for (piVar3 = *(int **)(*(longlong *)(param_1 + 0x68) +
                           (uVar8 % (ulonglong)*(uint *)(param_1 + 0x78)) * 8); piVar3 != (int *)0x0
        ; piVar3 = *(int **)(piVar3 + 6)) {
      if ((piVar3[8] == (int)param_2) && (*piVar3 == (int)param_2)) {
        if (piVar3 != (int *)0x0) {
          plVar4 = *(longlong **)(piVar3 + 2);
          if (plVar4 != (longlong *)0x0) {
            LOCK();
            *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
            UNLOCK();
            lVar5 = *plVar4;
            if (lVar5 != 0) {
              if (param_3 < (int)(*(longlong *)(lVar5 + 0x88) - *(longlong *)(lVar5 + 0x80) >> 2)) {
                iVar2 = *(int *)(*(longlong *)(lVar5 + 0x80) + (longlong)param_3 * 4);
                if (iVar2 < (int)(*(longlong *)(lVar5 + 0x48) - *(longlong *)(lVar5 + 0x40) >> 3)) {
                  uVar6 = *(undefined8 *)(*(longlong *)(lVar5 + 0x40) + (longlong)iVar2 * 8);
                  LOCK();
                  plVar1 = plVar4 + 1;
                  *(int *)plVar1 = (int)*plVar1 + -1;
                  UNLOCK();
                  if ((int)*plVar1 == 0) {
                    pvVar7 = (void *)*plVar4;
                    if (pvVar7 != (void *)0x0) {
                      FUN_14009b190(pvVar7);
                      operator_delete(pvVar7);
                    }
                    operator_delete(plVar4);
                  }
                  return uVar6;
                }
                FUN_14009bcd0(param_1,uVar8,L"Not Found LineTable Over nStringIdx");
              }
              else {
                FUN_14009bcd0(param_1,uVar8,L"Not Found LineTable Over Index");
              }
              goto LAB_14009b9d0;
            }
          }
          FUN_14009bcd0(param_1,uVar8,L"NULL LineTable");
          if (plVar4 == (longlong *)0x0) {
            return 0;
          }
LAB_14009b9d0:
          LOCK();
          plVar1 = plVar4 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            pvVar7 = (void *)*plVar4;
            if (pvVar7 != (void *)0x0) {
              FUN_14009b190(pvVar7);
              operator_delete(pvVar7);
            }
            operator_delete(plVar4);
          }
          return 0;
        }
        break;
      }
    }
  }
  FUN_14009bcd0(param_1,uVar8,L"Not Found Line");
  return 0;
}



undefined8 FUN_14009ba30(longlong param_1,ulonglong param_2,int param_3)

{
  longlong *plVar1;
  int iVar2;
  int *piVar3;
  longlong *plVar4;
  longlong lVar5;
  undefined8 uVar6;
  void *pvVar7;
  ulonglong uVar8;
  
  uVar8 = param_2 & 0xffffffff;
  if (((int)(*(longlong *)(param_1 + 0x50) - *(longlong *)(param_1 + 0x48) >> 2) <= param_3) ||
     (*(int *)(*(longlong *)(param_1 + 0x48) + (longlong)param_3 * 4) != 3)) {
    FUN_14009bcd0(param_1,param_2,L"Not Found Column");
    return 0;
  }
  if (*(longlong *)(param_1 + 0x68) != 0) {
    for (piVar3 = *(int **)(*(longlong *)(param_1 + 0x68) +
                           (uVar8 % (ulonglong)*(uint *)(param_1 + 0x78)) * 8); piVar3 != (int *)0x0
        ; piVar3 = *(int **)(piVar3 + 6)) {
      if ((piVar3[8] == (int)param_2) && (*piVar3 == (int)param_2)) {
        if (piVar3 != (int *)0x0) {
          plVar4 = *(longlong **)(piVar3 + 2);
          if (plVar4 != (longlong *)0x0) {
            LOCK();
            *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
            UNLOCK();
            lVar5 = *plVar4;
            if (lVar5 != 0) {
              if (param_3 < (int)(*(longlong *)(lVar5 + 0x88) - *(longlong *)(lVar5 + 0x80) >> 2)) {
                iVar2 = *(int *)(*(longlong *)(lVar5 + 0x80) + (longlong)param_3 * 4);
                if (iVar2 < (int)(*(longlong *)(lVar5 + 0x28) - *(longlong *)(lVar5 + 0x20) >> 3)) {
                  uVar6 = *(undefined8 *)(*(longlong *)(lVar5 + 0x20) + (longlong)iVar2 * 8);
                  LOCK();
                  plVar1 = plVar4 + 1;
                  *(int *)plVar1 = (int)*plVar1 + -1;
                  UNLOCK();
                  if ((int)*plVar1 == 0) {
                    pvVar7 = (void *)*plVar4;
                    if (pvVar7 != (void *)0x0) {
                      FUN_14009b190(pvVar7);
                      operator_delete(pvVar7);
                    }
                    operator_delete(plVar4);
                  }
                  return uVar6;
                }
                FUN_14009bcd0(param_1,uVar8,L"Not Found LineTable Over nWStringIdx");
              }
              else {
                FUN_14009bcd0(param_1,uVar8,L"Not Found LineTable Over Index");
              }
              goto LAB_14009bb90;
            }
          }
          FUN_14009bcd0(param_1,uVar8,L"NULL LineTable");
          if (plVar4 == (longlong *)0x0) {
            return 0;
          }
LAB_14009bb90:
          LOCK();
          plVar1 = plVar4 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            pvVar7 = (void *)*plVar4;
            if (pvVar7 != (void *)0x0) {
              FUN_14009b190(pvVar7);
              operator_delete(pvVar7);
            }
            operator_delete(plVar4);
          }
          return 0;
        }
        break;
      }
    }
  }
  FUN_14009bcd0(param_1,uVar8,L"Not Found Line");
  return 0;
}



int FUN_14009bbf0(longlong param_1,ushort *param_2)

{
  ushort uVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  ushort *puVar4;
  ulonglong uVar5;
  ushort *puVar6;
  uint uVar7;
  ushort *puVar8;
  int iVar9;
  
  puVar8 = *(ushort **)(param_1 + 0x28);
  iVar9 = 0;
  if (puVar8 == *(ushort **)(param_1 + 0x30)) {
    return 0;
  }
  do {
    uVar2 = *(ulonglong *)(puVar8 + 8);
    uVar5 = 0xffffffffffffffff;
    puVar6 = param_2;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      uVar1 = *puVar6;
      puVar6 = puVar6 + 1;
    } while (uVar1 != 0);
    uVar5 = ~uVar5 - 1;
    puVar6 = puVar8;
    if (7 < *(ulonglong *)(puVar8 + 0xc)) {
      puVar6 = *(ushort **)puVar8;
    }
    uVar3 = uVar5;
    puVar4 = param_2;
    if (uVar2 < uVar5) {
      uVar3 = uVar2;
    }
    for (; uVar3 != 0; uVar3 = uVar3 - 1) {
      if (*puVar6 != *puVar4) {
        uVar7 = 1;
        if (*puVar6 < *puVar4) {
          uVar7 = 0xffffffff;
        }
        goto LAB_14009bc77;
      }
      puVar6 = puVar6 + 1;
      puVar4 = puVar4 + 1;
    }
    uVar7 = 0;
LAB_14009bc77:
    if (uVar7 == 0) {
      if (uVar5 <= uVar2) {
        uVar7 = (uint)(uVar2 != uVar5);
        goto LAB_14009bc8b;
      }
    }
    else {
LAB_14009bc8b:
      if (uVar7 == 0) {
        return iVar9;
      }
    }
    puVar8 = puVar8 + 0x14;
    iVar9 = iVar9 + 1;
    if (puVar8 == *(ushort **)(param_1 + 0x30)) {
      return iVar9;
    }
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14009bcd0(undefined8 *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 auStack_248 [32];
  undefined8 local_228;
  undefined8 local_220;
  WCHAR local_218 [256];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_248;
  if (DAT_14031fea7 == '\0') {
    if (7 < (ulonglong)param_1[3]) {
      param_1 = (undefined8 *)*param_1;
    }
    local_228 = param_4;
    local_220 = param_3;
    FUN_14008f5a0(local_218,L"Table = %s, ID = %d, Column = %s - ErrorMsg %s",param_1,param_2);
    if (*(char *)(DAT_140320130 + 0xb8) == '\0') {
      MessageBoxW(DAT_14031fe88,local_218,L"table error",0);
    }
  }
  return;
}



void FUN_14009bd70(longlong *param_1)

{
  int *piVar1;
  undefined8 *puVar2;
  longlong lVar3;
  void *pvVar4;
  ulonglong uVar5;
  longlong *plVar6;
  uint uVar7;
  int iVar8;
  undefined4 uVar9;
  longlong lVar10;
  longlong lVar11;
  uint uVar12;
  longlong *plVar13;
  float fVar14;
  uint local_res8;
  longlong local_res10;
  
  *(int *)(param_1 + 6) = (int)param_1[6] + 1;
  if ((*param_1 != 0) && (local_res8 = 0, (int)param_1[2] != 0)) {
    local_res10 = 0;
    do {
      lVar10 = *(longlong *)(local_res10 + *param_1);
      iVar8 = DAT_140320170;
      while (DAT_140320170 = iVar8, lVar10 != 0) {
        puVar2 = *(undefined8 **)(lVar10 + 8);
        lVar3 = *(longlong *)(lVar10 + 0x18);
        if (puVar2 != (undefined8 *)0x0) {
          if (puVar2 == *(undefined8 **)(lVar10 + 0x10)) {
            if (puVar2 != (undefined8 *)0x0) {
              LOCK();
              piVar1 = (int *)(puVar2 + 1);
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              if (*piVar1 == 0) {
                *(undefined8 *)(lVar10 + 8) = 0;
                pvVar4 = (void *)*puVar2;
                if (pvVar4 != (void *)0x0) {
                  FUN_14009b190(pvVar4);
                  operator_delete(pvVar4);
                }
                operator_delete(puVar2);
              }
            }
          }
          else {
            DAT_140320170 = iVar8 + 1;
            if (iVar8 == 0) {
              FUN_14001f5c0(1);
            }
          }
        }
        lVar11 = 0;
        *(longlong *)(lVar10 + 0x18) = param_1[8];
        param_1[1] = param_1[1] + -1;
        uVar5 = param_1[1];
        param_1[8] = lVar10;
        if ((uVar5 < (ulonglong)param_1[5]) && ((int)param_1[6] == 0)) {
          fVar14 = (float)(longlong)uVar5;
          if ((longlong)uVar5 < 0) {
            fVar14 = fVar14 + 1.8446744e+19;
          }
          fVar14 = fVar14 / *(float *)((longlong)param_1 + 0x14);
          lVar10 = 0;
          if ((9.223372e+18 < fVar14) && (fVar14 = fVar14 - 9.223372e+18, fVar14 < 9.223372e+18)) {
            lVar10 = -0x8000000000000000;
          }
          uVar12 = (uint)((longlong)fVar14 + lVar10);
          if (0xffffffff < (ulonglong)((longlong)fVar14 + lVar10)) {
            uVar12 = 0xffffffff;
          }
          if (0x11 < uVar12) {
            do {
              lVar11 = lVar11 + 1;
            } while ((uint)(&DAT_14024ea30)[lVar11] < uVar12);
          }
          uVar7 = (&DAT_14024ea30)[lVar11];
          if ((&DAT_14024ea30)[lVar11] == 0xffffffff) {
            uVar7 = uVar12;
          }
          FUN_14009ab20(param_1,uVar7);
        }
        lVar10 = lVar3;
        iVar8 = DAT_140320170;
        if (param_1[1] == 0) {
          param_1[8] = 0;
          plVar13 = (longlong *)param_1[7];
          iVar8 = DAT_140320170;
          if ((longlong *)param_1[7] != (longlong *)0x0) {
            do {
              plVar6 = (longlong *)*plVar13;
              free(plVar13);
              plVar13 = plVar6;
            } while (plVar6 != (longlong *)0x0);
            param_1[7] = 0;
            iVar8 = DAT_140320170;
          }
        }
      }
      local_res8 = local_res8 + 1;
      local_res10 = local_res10 + 8;
    } while (local_res8 < *(uint *)(param_1 + 2));
  }
  operator_delete__((void *)*param_1);
  *param_1 = 0;
  param_1[1] = 0;
  if ((int)param_1[6] == 0) {
    uVar9 = FUN_14001de50(param_1,0);
    FUN_14000d350(param_1,uVar9,0);
  }
  param_1[8] = 0;
  plVar13 = (longlong *)param_1[7];
  if ((longlong *)param_1[7] != (longlong *)0x0) {
    do {
      plVar6 = (longlong *)*plVar13;
      free(plVar13);
      plVar13 = plVar6;
    } while (plVar6 != (longlong *)0x0);
    param_1[7] = 0;
  }
  *(int *)(param_1 + 6) = (int)param_1[6] + -1;
  return;
}



void FUN_14009bff0(void)

{
  FUN_14009bd70();
  return;
}



void FUN_14009c010(longlong param_1)

{
  if (*(void **)(param_1 + 0xca0) != (void *)0x0) {
    operator_delete__(*(void **)(param_1 + 0xca0));
    *(undefined8 *)(param_1 + 0xca0) = 0;
  }
  if (*(void **)(param_1 + 0xca8) != (void *)0x0) {
    operator_delete__(*(void **)(param_1 + 0xca8));
    *(undefined8 *)(param_1 + 0xca8) = 0;
  }
  if (*(void **)(param_1 + 0xcb0) != (void *)0x0) {
    operator_delete__(*(void **)(param_1 + 0xcb0));
    *(undefined8 *)(param_1 + 0xcb0) = 0;
  }
  *(undefined ***)(param_1 + 0x490) = CMyFile::vftable;
  if (*(HANDLE *)(param_1 + 0x498) != (HANDLE)0xffffffffffffffff) {
    CloseHandle(*(HANDLE *)(param_1 + 0x498));
    *(undefined8 *)(param_1 + 0x498) = 0xffffffffffffffff;
  }
  *(undefined2 *)(param_1 + 0x4a0) = 0;
  return;
}



undefined8 FUN_14009c0b0(longlong param_1,longlong *param_2)

{
  bool bVar1;
  uint uVar2;
  uint uVar3;
  int iVar4;
  size_t _Size;
  void *_Dst;
  longlong lVar5;
  
  uVar2 = (**(code **)(*param_2 + 0x28))(param_2);
  *(uint *)(param_1 + 0xcb8) = uVar2;
  if ((int)uVar2 < 1) {
    return 0;
  }
  bVar1 = false;
  uVar3 = uVar2 & 0x8000000f;
  if ((int)uVar3 < 0) {
    uVar3 = (uVar3 - 1 | 0xfffffff0) + 1;
  }
  if (uVar3 != 0) {
    uVar3 = uVar2 & 0x8000000f;
    if ((int)uVar3 < 0) {
      uVar3 = (uVar3 - 1 | 0xfffffff0) + 1;
    }
    while (uVar3 != 0) {
      uVar2 = uVar2 + 1;
      uVar3 = uVar2 & 0x8000000f;
      if ((int)uVar3 < 0) {
        uVar3 = (uVar3 - 1 | 0xfffffff0) + 1;
      }
    }
    *(uint *)(param_1 + 0xcb8) = uVar2;
    bVar1 = true;
  }
  iVar4 = *(int *)(param_1 + 0xcb8);
  _Size = (size_t)iVar4;
  _Dst = *(void **)(param_1 + 0xca0);
  if (iVar4 < iVar4 + 1) {
    if (_Dst != (void *)0x0) {
      operator_delete__(_Dst);
      *(undefined8 *)(param_1 + 0xca0) = 0;
    }
    _Size = (size_t)(iVar4 + 1);
    _Dst = operator_new(_Size);
    *(void **)(param_1 + 0xca0) = _Dst;
  }
  memset(_Dst,0,_Size);
  lVar5 = (**(code **)(*param_2 + 8))
                    (param_2,*(undefined8 *)(param_1 + 0xca0),(longlong)*(int *)(param_1 + 0xcb8));
  if (lVar5 != 0) {
    if (bVar1) {
      iVar4 = (**(code **)(*param_2 + 0x28))(param_2);
      *(undefined1 *)((longlong)iVar4 + *(longlong *)(param_1 + 0xca0)) = 0x2a;
    }
    return 1;
  }
  return 0;
}



undefined8 * FUN_14009c200(undefined8 *param_1,uint param_2)

{
  *param_1 = CMyFile::vftable;
  if ((HANDLE)param_1[1] != (HANDLE)0xffffffffffffffff) {
    CloseHandle((HANDLE)param_1[1]);
    param_1[1] = 0xffffffffffffffff;
  }
  *(undefined2 *)(param_1 + 2) = 0;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



ulonglong FUN_14009c260(undefined1 *param_1,byte *param_2)

{
  undefined4 uVar1;
  int iVar2;
  uint uVar3;
  ulonglong in_RAX;
  uint *puVar4;
  ulonglong uVar5;
  undefined1 *puVar6;
  int iVar7;
  longlong lVar8;
  ulonglong uVar9;
  int iVar10;
  int iVar11;
  uint *puVar12;
  byte *pbVar13;
  longlong lVar14;
  longlong lVar15;
  
  *param_1 = 0;
  if (param_2 == (byte *)0x0) {
    return in_RAX & 0xffffffffffffff00;
  }
  *(undefined4 *)(param_1 + 0x3c8) = 0x10;
  *(undefined4 *)(param_1 + 0x3c4) = 0x20;
  *(undefined **)(param_1 + 0x3d0) = (undefined *)0x0;
  *(undefined8 *)(param_1 + 0x3d8) = 0;
  memcpy(param_1 + 0x3f0,&PTR_1402884a8,(longlong)*(int *)(param_1 + 0x3c8));
  if (*(int *)(param_1 + 0x3c4) == 0x10) {
    if (*(int *)(param_1 + 0x3c8) == 0x10) {
      uVar1 = 10;
    }
    else {
      uVar1 = 0xe;
      if (*(int *)(param_1 + 0x3c8) == 0x18) {
        uVar1 = 0xc;
      }
    }
  }
  else {
    uVar1 = 0xe;
    if ((*(int *)(param_1 + 0x3c4) == 0x18) && (uVar1 = 0xe, *(int *)(param_1 + 0x3c8) != 0x20)) {
      uVar1 = 0xc;
    }
  }
  *(undefined4 *)(param_1 + 0x3cc) = uVar1;
  iVar7 = 0;
  iVar2 = (int)(*(int *)(param_1 + 0x3c8) + (*(int *)(param_1 + 0x3c8) >> 0x1f & 3U)) >> 2;
  lVar14 = (longlong)iVar2;
  if (-1 < *(int *)(param_1 + 0x3cc)) {
    puVar6 = param_1 + 4;
    do {
      if (0 < iVar2) {
        memset(puVar6,0,lVar14 << 2);
      }
      iVar7 = iVar7 + 1;
      puVar6 = puVar6 + 0x20;
    } while (iVar7 <= *(int *)(param_1 + 0x3cc));
  }
  iVar7 = 0;
  if (-1 < *(int *)(param_1 + 0x3cc)) {
    puVar6 = param_1 + 0x1e4;
    do {
      if (0 < iVar2) {
        memset(puVar6,0,lVar14 << 2);
      }
      iVar7 = iVar7 + 1;
      puVar6 = puVar6 + 0x20;
    } while (iVar7 <= *(int *)(param_1 + 0x3cc));
  }
  iVar7 = (*(int *)(param_1 + 0x3cc) + 1) * iVar2;
  uVar3 = (int)(*(int *)(param_1 + 0x3c4) + (*(int *)(param_1 + 0x3c4) >> 0x1f & 3U)) >> 2;
  uVar5 = (ulonglong)uVar3;
  lVar15 = (longlong)(int)uVar3;
  if (0 < (int)uVar3) {
    uVar9 = (ulonglong)uVar3;
    puVar4 = (uint *)(param_1 + 0x410);
    do {
      *puVar4 = (uint)*param_2 << 0x18;
      *puVar4 = *puVar4 | (uint)param_2[1] << 0x10;
      *puVar4 = *puVar4 | (uint)param_2[2] << 8;
      uVar5 = 0;
      *puVar4 = *puVar4 | (uint)param_2[3];
      uVar9 = uVar9 - 1;
      puVar4 = puVar4 + 1;
      param_2 = param_2 + 4;
    } while (uVar9 != 0);
  }
  iVar11 = 0;
  lVar8 = 0;
  if (0 < (int)uVar3) {
    puVar4 = (uint *)(param_1 + 0x410);
    iVar10 = iVar11;
    do {
      if (iVar7 <= iVar10) goto LAB_14009c657;
      lVar8 = lVar8 + 1;
      iVar11 = iVar10 + 1;
      *(uint *)(param_1 + ((longlong)(iVar10 % iVar2) + (longlong)(iVar10 / iVar2) * 8) * 4 + 4) =
           *puVar4;
      uVar5 = (ulonglong)*puVar4;
      *(uint *)(param_1 +
               ((longlong)(iVar10 % iVar2) +
               ((longlong)*(int *)(param_1 + 0x3cc) - (longlong)(iVar10 / iVar2)) * 8) * 4 + 0x1e4)
           = *puVar4;
      puVar4 = puVar4 + 1;
      iVar10 = iVar11;
    } while (lVar8 < lVar15);
  }
  if (iVar11 < iVar7) {
    pbVar13 = &DAT_140277fb0;
    do {
      uVar9 = (ulonglong)(int)*(uint *)(param_1 + lVar15 * 4 + 0x40c);
      uVar5 = 0;
      *(uint *)(param_1 + 0x410) =
           *(uint *)(param_1 + 0x410) ^
           CONCAT31(CONCAT21(CONCAT11((&DAT_140274db0)[(longlong)uVar9 >> 0x10 & 0xff] ^ *pbVar13,
                                      (&DAT_140274db0)[(longlong)uVar9 >> 8 & 0xff]),
                             (&DAT_140274db0)[uVar9 & 0xff]),
                    (&DAT_140274db0)[*(uint *)(param_1 + lVar15 * 4 + 0x40c) >> 0x18]);
      if (uVar3 == 8) {
        lVar8 = 3;
        puVar4 = (uint *)(param_1 + 0x414);
        do {
          *puVar4 = *puVar4 ^ puVar4[-1];
          lVar8 = lVar8 + -1;
          puVar4 = puVar4 + 1;
        } while (lVar8 != 0);
        uVar5 = (ulonglong)(int)*(uint *)(param_1 + 0x41c);
        *(uint *)(param_1 + 0x420) =
             *(uint *)(param_1 + 0x420) ^
             CONCAT31(CONCAT21(CONCAT11((&DAT_140274db0)[*(uint *)(param_1 + 0x41c) >> 0x18],
                                        (&DAT_140274db0)[(longlong)uVar5 >> 0x10 & 0xff]),
                               (&DAT_140274db0)[(longlong)uVar5 >> 8 & 0xff]),
                      (&DAT_140274db0)[uVar5 & 0xff]);
        lVar8 = 3;
        puVar4 = (uint *)(param_1 + 0x424);
        do {
          uVar5 = (ulonglong)puVar4[-1];
          *puVar4 = *puVar4 ^ puVar4[-1];
          lVar8 = lVar8 + -1;
          puVar4 = puVar4 + 1;
        } while (lVar8 != 0);
      }
      else if (1 < lVar15) {
        lVar8 = lVar15 + -1;
        puVar4 = (uint *)(param_1 + 0x414);
        do {
          uVar5 = (ulonglong)puVar4[-1];
          *puVar4 = *puVar4 ^ puVar4[-1];
          lVar8 = lVar8 + -1;
          puVar4 = puVar4 + 1;
        } while (lVar8 != 0);
      }
      lVar8 = 0;
      if (0 < (int)uVar3) {
        puVar4 = (uint *)(param_1 + 0x410);
        iVar10 = iVar11;
        do {
          if (iVar7 <= iVar10) goto LAB_14009c657;
          lVar8 = lVar8 + 1;
          iVar11 = iVar10 + 1;
          *(uint *)(param_1 + ((longlong)(iVar10 % iVar2) + (longlong)(iVar10 / iVar2) * 8) * 4 + 4)
               = *puVar4;
          uVar5 = (ulonglong)*puVar4;
          *(uint *)(param_1 +
                   ((longlong)(iVar10 % iVar2) +
                   ((longlong)*(int *)(param_1 + 0x3cc) - (longlong)(iVar10 / iVar2)) * 8) * 4 +
                   0x1e4) = *puVar4;
          puVar4 = puVar4 + 1;
          iVar10 = iVar11;
        } while (lVar8 < lVar15);
      }
      pbVar13 = pbVar13 + 1;
    } while (iVar11 < iVar7);
  }
LAB_14009c657:
  iVar2 = 1;
  if (1 < *(int *)(param_1 + 0x3cc)) {
    puVar4 = (uint *)(param_1 + 0x204);
    do {
      puVar12 = puVar4;
      lVar15 = lVar14;
      if (0 < lVar14) {
        do {
          uVar9 = (ulonglong)(int)*puVar12;
          uVar5 = uVar9 & 0xff;
          lVar15 = lVar15 + -1;
          *puVar12 = *(uint *)(&DAT_140276fb0 + (ulonglong)(*puVar12 >> 0x18) * 4) ^
                     *(uint *)(&DAT_1402773b0 + ((longlong)uVar9 >> 0x10 & 0xffU) * 4) ^
                     *(uint *)(&DAT_1402777b0 + ((longlong)uVar9 >> 8 & 0xffU) * 4) ^
                     *(uint *)(&DAT_140277bb0 + uVar5 * 4);
          puVar12 = puVar12 + 1;
        } while (lVar15 != 0);
      }
      iVar2 = iVar2 + 1;
      puVar4 = puVar4 + 8;
    } while (iVar2 < *(int *)(param_1 + 0x3cc));
  }
  *param_1 = 1;
  return CONCAT71((int7)(uVar5 >> 8),1);
}



void FUN_14009c720(longlong param_1,byte *param_2,byte *param_3)

{
  undefined4 uVar1;
  uint *puVar2;
  longlong lVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  uint uVar11;
  int iVar12;
  ulonglong uVar13;
  
  iVar12 = *(int *)(param_1 + 0x3cc);
  uVar6 = ((uint)*param_2 << 0x18 | (uint)param_2[1] << 0x10 | (uint)param_2[2] << 8 |
          (uint)param_2[3]) ^ *(uint *)(param_1 + 0x1e4);
  uVar5 = ((uint)param_2[4] << 0x18 | (uint)param_2[5] << 0x10 | (uint)param_2[6] << 8 |
          (uint)param_2[7]) ^ *(uint *)(param_1 + 0x1e8);
  uVar4 = ((uint)param_2[8] << 0x18 | (uint)param_2[9] << 0x10 | (uint)param_2[10] << 8 |
          (uint)param_2[0xb]) ^ *(uint *)(param_1 + 0x1ec);
  uVar11 = ((uint)CONCAT11(param_2[0xe],param_2[0xf]) |
           (uint)param_2[0xc] << 0x18 | (uint)param_2[0xd] << 0x10) ^ *(uint *)(param_1 + 0x1f0);
  if (1 < iVar12) {
    uVar13 = (ulonglong)(iVar12 - 1);
    puVar2 = (uint *)(param_1 + 0x20c);
    do {
      uVar10 = (ulonglong)(int)uVar5;
      uVar9 = (ulonglong)(int)uVar11;
      uVar8 = (ulonglong)(int)uVar4;
      uVar7 = (ulonglong)(int)uVar6;
      uVar5 = *(uint *)(&DAT_1402763b0 + ((longlong)uVar7 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_140275fb0 + ((longlong)uVar10 >> 0x18 & 0xffU) * 4) ^
              *(uint *)(&DAT_1402767b0 + ((longlong)uVar9 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_140276bb0 + (uVar8 & 0xff) * 4) ^ puVar2[-1];
      uVar4 = *(uint *)(&DAT_140275fb0 + ((longlong)uVar8 >> 0x18 & 0xffU) * 4) ^
              *(uint *)(&DAT_1402767b0 + ((longlong)uVar7 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_1402763b0 + ((longlong)uVar10 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_140276bb0 + (uVar9 & 0xff) * 4) ^ *puVar2;
      uVar11 = *(uint *)(&DAT_1402763b0 + ((longlong)uVar8 >> 0x10 & 0xffU) * 4) ^
               *(uint *)(&DAT_1402767b0 + ((longlong)uVar10 >> 8 & 0xffU) * 4) ^
               *(uint *)(&DAT_140275fb0 + ((longlong)uVar9 >> 0x18 & 0xffU) * 4) ^
               *(uint *)(&DAT_140276bb0 + (uVar7 & 0xff) * 4) ^ puVar2[1];
      uVar6 = *(uint *)(&DAT_140275fb0 + (ulonglong)(uVar6 >> 0x18) * 4) ^
              *(uint *)(&DAT_1402767b0 + ((longlong)uVar8 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_1402763b0 + ((longlong)uVar9 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_140276bb0 + (uVar10 & 0xff) * 4) ^ puVar2[-2];
      uVar13 = uVar13 - 1;
      puVar2 = puVar2 + 8;
    } while (uVar13 != 0);
    iVar12 = *(int *)(param_1 + 0x3cc);
  }
  uVar13 = (ulonglong)(int)uVar6;
  lVar3 = (longlong)iVar12 * 0x20;
  uVar8 = (ulonglong)(int)uVar4;
  uVar9 = (ulonglong)(int)uVar11;
  uVar1 = *(undefined4 *)(lVar3 + 0x1e4 + param_1);
  uVar7 = (ulonglong)(int)uVar5;
  *param_3 = (&DAT_140274eb0)[(longlong)uVar13 >> 0x18 & 0xff] ^ (byte)((uint)uVar1 >> 0x18);
  param_3[1] = (&DAT_140274eb0)[(longlong)uVar9 >> 0x10 & 0xff] ^ (byte)((uint)uVar1 >> 0x10);
  param_3[2] = (&DAT_140274eb0)[(longlong)uVar8 >> 8 & 0xff] ^ (byte)((uint)uVar1 >> 8);
  param_3[3] = (&DAT_140274eb0)[uVar7 & 0xff] ^ (byte)uVar1;
  uVar1 = *(undefined4 *)(lVar3 + 0x1e8 + param_1);
  param_3[4] = (&DAT_140274eb0)[(longlong)uVar7 >> 0x18 & 0xff] ^ (byte)((uint)uVar1 >> 0x18);
  param_3[5] = (&DAT_140274eb0)[(longlong)uVar13 >> 0x10 & 0xff] ^ (byte)((uint)uVar1 >> 0x10);
  param_3[6] = (&DAT_140274eb0)[(longlong)uVar9 >> 8 & 0xff] ^ (byte)((uint)uVar1 >> 8);
  param_3[7] = (&DAT_140274eb0)[uVar8 & 0xff] ^ (byte)uVar1;
  uVar1 = *(undefined4 *)(lVar3 + 0x1ec + param_1);
  param_3[8] = (&DAT_140274eb0)[(longlong)uVar8 >> 0x18 & 0xff] ^ (byte)((uint)uVar1 >> 0x18);
  param_3[9] = (&DAT_140274eb0)[(longlong)uVar7 >> 0x10 & 0xff] ^ (byte)((uint)uVar1 >> 0x10);
  param_3[10] = (&DAT_140274eb0)[(longlong)uVar13 >> 8 & 0xff] ^ (byte)((uint)uVar1 >> 8);
  param_3[0xb] = (&DAT_140274eb0)[uVar9 & 0xff] ^ (byte)uVar1;
  uVar1 = *(undefined4 *)(lVar3 + 0x1f0 + param_1);
  param_3[0xc] = (&DAT_140274eb0)[(longlong)uVar9 >> 0x18 & 0xff] ^ (byte)((uint)uVar1 >> 0x18);
  param_3[0xd] = (&DAT_140274eb0)[(longlong)uVar8 >> 0x10 & 0xff] ^ (byte)((uint)uVar1 >> 0x10);
  param_3[0xe] = (&DAT_140274eb0)[(longlong)uVar7 >> 8 & 0xff] ^ (byte)((uint)uVar1 >> 8);
  param_3[0xf] = (&DAT_140274eb0)[uVar13 & 0xff] ^ (byte)uVar1;
  return;
}



void FUN_14009cb40(longlong param_1,byte *param_2,byte *param_3)

{
  longlong lVar1;
  undefined4 uVar2;
  int iVar3;
  int iVar4;
  longlong lVar5;
  uint *puVar6;
  longlong lVar7;
  uint *puVar8;
  int iVar9;
  int iVar10;
  longlong lVar11;
  int iVar12;
  int local_res20;
  
  iVar3 = *(int *)(param_1 + 0x3c8);
  if (iVar3 != 0x10) {
    iVar3 = (int)(iVar3 + (iVar3 >> 0x1f & 3U)) >> 2;
    lVar11 = (longlong)iVar3;
    iVar4 = 0;
    if (iVar3 != 4) {
      iVar4 = (iVar3 != 6) + 1;
    }
    lVar5 = (longlong)iVar4 * 0x20;
    iVar4 = *(int *)(&DAT_140277fdc + lVar5);
    iVar9 = *(int *)(&DAT_140277fe4 + lVar5);
    iVar10 = *(int *)(&DAT_140277fec + lVar5);
    if (0 < iVar3) {
      puVar6 = (uint *)(param_1 + 0x450);
      puVar8 = (uint *)(param_1 + 0x1e4);
      lVar5 = lVar11;
      do {
        *puVar6 = (uint)*param_2 << 0x18;
        *puVar6 = *puVar6 | (uint)param_2[1] << 0x10;
        *puVar6 = *puVar6 | (uint)param_2[2] << 8;
        *puVar6 = *puVar6 | (uint)param_2[3];
        *puVar6 = *puVar6 ^ *puVar8;
        lVar5 = lVar5 + -1;
        puVar6 = puVar6 + 1;
        puVar8 = puVar8 + 1;
        param_2 = param_2 + 4;
      } while (lVar5 != 0);
    }
    local_res20 = 1;
    if (1 < *(int *)(param_1 + 0x3cc)) {
      lVar5 = 0x22c;
      puVar6 = (uint *)(param_1 + 0x204);
      do {
        if (0 < lVar11) {
          lVar7 = lVar11;
          puVar8 = puVar6;
          iVar12 = iVar4;
          do {
            lVar7 = lVar7 + -1;
            *(uint *)((longlong)puVar8 + lVar5) =
                 *(uint *)(&DAT_1402767b0 +
                          ((longlong)
                           (ulonglong)
                           *(uint *)(param_1 + 0x450 +
                                    (longlong)(((iVar9 - iVar4) + iVar12) % iVar3) * 4) >> 8 & 0xffU
                          ) * 4) ^
                 *(uint *)(&DAT_140276bb0 +
                          (ulonglong)
                          *(byte *)(param_1 + 0x450 +
                                   (longlong)(((iVar10 - iVar4) + iVar12) % iVar3) * 4) * 4) ^
                 *(uint *)(&DAT_1402763b0 +
                          ((longlong)
                           (ulonglong)*(uint *)(param_1 + 0x450 + (longlong)(iVar12 % iVar3) * 4) >>
                           0x10 & 0xffU) * 4) ^
                 *(uint *)(&DAT_140275fb0 +
                          (ulonglong)*(byte *)((longlong)puVar8 + lVar5 + 0x23) * 4) ^ *puVar8;
            puVar8 = puVar8 + 1;
            iVar12 = iVar12 + 1;
          } while (lVar7 != 0);
        }
        memcpy((void *)(param_1 + 0x450),(void *)(param_1 + 0x430),(longlong)(iVar3 * 4));
        local_res20 = local_res20 + 1;
        puVar6 = puVar6 + 8;
        lVar5 = lVar5 + -0x20;
      } while (local_res20 < *(int *)(param_1 + 0x3cc));
    }
    if (0 < lVar11) {
      iVar4 = iVar4 - iVar9;
      iVar10 = iVar10 - iVar9;
      lVar7 = 0;
      lVar5 = param_1 + 0x450;
      do {
        lVar1 = lVar7 + (longlong)*(int *)(param_1 + 0x3cc) * 8;
        lVar7 = lVar7 + 1;
        uVar2 = *(undefined4 *)(param_1 + 0x1e4 + lVar1 * 4);
        *param_3 = (&DAT_140274eb0)[*(byte *)(lVar5 + 3)] ^ (byte)((uint)uVar2 >> 0x18);
        param_3[1] = (&DAT_140274eb0)
                     [(longlong)
                      (ulonglong)
                      *(uint *)(param_1 + 0x450 + (longlong)((iVar4 + iVar9) % iVar3) * 4) >> 0x10 &
                      0xff] ^ (byte)((uint)uVar2 >> 0x10);
        param_3[2] = (&DAT_140274eb0)
                     [(longlong)
                      (ulonglong)*(uint *)(param_1 + 0x450 + (longlong)(iVar9 % iVar3) * 4) >> 8 &
                      0xff] ^ (byte)((uint)uVar2 >> 8);
        iVar12 = iVar10 + iVar9;
        iVar9 = iVar9 + 1;
        param_3[3] = (&DAT_140274eb0)[*(byte *)(param_1 + 0x450 + (longlong)(iVar12 % iVar3) * 4)] ^
                     (byte)uVar2;
        lVar5 = lVar5 + 4;
        param_3 = param_3 + 4;
      } while (lVar7 < lVar11);
    }
    return;
  }
  FUN_14009c720();
  return;
}



ulonglong FUN_14009cec0(char *param_1,longlong param_2,longlong param_3,ulonglong param_4)

{
  ulonglong in_RAX;
  ulonglong uVar1;
  uint uVar2;
  
  if (*param_1 == '\0') {
    uVar1 = in_RAX & 0xffffffffffffff00;
  }
  else {
    uVar2 = 0;
    uVar1 = 0;
    if (param_4 / (ulonglong)(longlong)*(int *)(param_1 + 0x3c8) != 0) {
      do {
        FUN_14009cb40(param_1,param_2,param_3);
        uVar2 = uVar2 + 1;
        uVar1 = param_4 / (ulonglong)(longlong)*(int *)(param_1 + 0x3c8);
        param_2 = param_2 + *(int *)(param_1 + 0x3c8);
        param_3 = param_3 + *(int *)(param_1 + 0x3c8);
      } while (uVar2 < uVar1);
    }
    uVar1 = CONCAT71((int7)(uVar1 >> 8),1);
  }
  return uVar1;
}



undefined8 FUN_14009cf70(void)

{
  return 0x8534;
}



undefined8 FUN_14009cf80(void)

{
  return 0x8541;
}



void * FUN_14009cf90(void *param_1,uint param_2)

{
  FUN_140186ed0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined1
FUN_14009cfc0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x8535);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,param_5[1]);
  FUN_14007c6e0(local_30,param_5[2]);
  FUN_14007c8a0(local_30,*(undefined8 *)(param_5 + 4));
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SERVER_REGISTER",0x8535);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009d0d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x8535);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,param_6[1]);
  FUN_14007c6e0(local_30,param_6[2]);
  FUN_14007c8a0(local_30,*(undefined8 *)(param_6 + 4));
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SERVER_REGISTER",0x8535);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009d200(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,longlong *param_6)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x8536);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,param_5[1]);
  FUN_14007c6e0(local_30,param_5[2]);
  FUN_14007c6e0(local_30,param_5[6]);
  FUN_14007c6e0(local_30,param_5[3]);
  FUN_14003c9e0(local_30,*(undefined1 *)(param_5 + 7));
  FUN_14003c9e0(local_30,*(undefined1 *)((longlong)param_5 + 0x1d));
  FUN_14007c8a0(local_30,*(undefined8 *)(param_5 + 4));
  FUN_14007c6e0(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_14007c6e0(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SERVER_INFORMATION",0x8536);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009d390(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,longlong *param_7)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x8536);
  FUN_14007c6e0(local_40,*param_5);
  FUN_14007c6e0(local_40,*param_6);
  FUN_14007c6e0(local_40,param_6[1]);
  FUN_14007c6e0(local_40,param_6[2]);
  FUN_14007c6e0(local_40,param_6[6]);
  FUN_14007c6e0(local_40,param_6[3]);
  FUN_14003c9e0(local_40,*(undefined1 *)(param_6 + 7));
  FUN_14003c9e0(local_40,*(undefined1 *)((longlong)param_6 + 0x1d));
  FUN_14007c8a0(local_40,*(undefined8 *)(param_6 + 4));
  FUN_14007c6e0(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_14007c6e0(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_SERVER_INFORMATION",0x8536);
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009d530(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x8537);
  FUN_14003c9e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SERVER_COMMAND_RESULT",0x8537);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009d630(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined1 *param_5,undefined4 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x8537);
  FUN_14003c9e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SERVER_COMMAND_RESULT",0x8537);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009d740(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined1 *param_5,undefined4 *param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x8538);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14003c9e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_140186d90(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PWE_RESP_RESULT_CODE",0x8538);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009d850(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined1 *param_6,undefined4 *param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x8538);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14003c9e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_140186d90(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PWE_RESP_RESULT_CODE",0x8538);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14009d970(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x8539);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"RESP_SERVER_LOCK",0x8539);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14009da30(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x8539);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"RESP_SERVER_LOCK",0x8539);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009db00(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x853a);
  FUN_140186d90(local_30,param_4);
  FUN_1401a2620(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"NOTIFY_STORAGE_ALARM",0x853a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009dc00(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x853a);
  FUN_140186d90(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"NOTIFY_STORAGE_ALARM",0x853a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009dd00(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x853b);
  FUN_140186d90(local_30,param_4);
  FUN_140186d90(local_30,param_5);
  FUN_1401a2620(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"NOTIFY_MAIL_ALARM",0x853b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009de10(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x853b);
  FUN_140186d90(local_30,param_5);
  FUN_140186d90(local_30,param_6);
  FUN_1401a2620(local_30,param_7);
  FUN_14007c6e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"NOTIFY_MAIL_ALARM",0x853b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009df30(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x853c);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14003cac0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_STATISTICS",0x853c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009e020(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x853c);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14003cac0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_STATISTICS",0x853c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009e120(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x853d);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SERVER_STEP",0x853d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009e200(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x853d);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SERVER_STEP",0x853d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009e2e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x853e);
  FUN_14007c6e0(local_30,*param_4);
  FUN_140186d90(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_MESSAGE",0x853e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009e3d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x853e);
  FUN_14007c6e0(local_30,*param_5);
  FUN_140186d90(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_MESSAGE",0x853e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009e4c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x853f);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BACKUP_CHARACTER_TABLE_COUNT",
                     0x853f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14009e5a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x853f);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BACKUP_CHARACTER_TABLE_COUNT",
                     0x853f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14009e680(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x8540);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BACKUP_CHARACTER_TABLE_END",0x8540)
  ;
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14009e740(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x8540);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BACKUP_CHARACTER_TABLE_END",
                     0x8540);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

undefined8 FUN_14009e810(longlong *param_1,int *param_2,undefined8 param_3)

{
  int *piVar1;
  int iVar2;
  wchar_t *pwVar3;
  longlong *******ppppppplVar4;
  char cVar5;
  undefined4 uVar6;
  DWORD DVar7;
  DWORD DVar8;
  undefined8 ******ppppppuVar9;
  undefined8 ******ppppppuVar10;
  void *pvVar11;
  undefined8 uVar12;
  int iVar13;
  undefined8 *******pppppppuVar14;
  undefined1 auStack_3f8 [32];
  undefined8 *******local_3d8;
  undefined8 *local_3d0;
  undefined8 *******local_3c8;
  undefined8 *******local_3b8;
  undefined1 local_3b0 [8];
  undefined4 local_3a8 [2];
  void *local_3a0;
  wchar_t *local_398;
  undefined8 local_390;
  undefined8 local_388;
  int local_380;
  undefined8 local_378;
  undefined8 ******local_370;
  undefined1 local_368;
  longlong *******local_360;
  undefined1 local_358;
  undefined1 local_350 [8];
  undefined8 local_348;
  wchar_t *local_340;
  int local_338;
  undefined8 local_330;
  int local_328;
  undefined1 local_318 [4];
  int local_314;
  undefined8 local_2e0;
  undefined8 *******local_2b8;
  undefined8 *******local_2b0;
  undefined8 *******local_2a8;
  undefined8 *******local_2a0;
  undefined8 *******local_298;
  undefined8 *****local_290;
  undefined8 *****local_288;
  undefined *local_280;
  undefined4 local_278 [2];
  longlong ******local_270;
  longlong ******local_268;
  undefined *local_260;
  longlong ******local_258;
  longlong ******local_250;
  longlong ******local_248;
  longlong ******local_240;
  longlong ******local_238;
  undefined *local_230;
  undefined *local_228;
  undefined *local_220;
  undefined *local_218;
  undefined *local_210;
  undefined *local_208;
  undefined *local_200;
  undefined *local_1f8;
  undefined1 local_1f0 [8];
  undefined1 local_1e8 [8];
  undefined1 local_1e0 [8];
  undefined1 local_1d8 [8];
  undefined1 local_1d0 [8];
  undefined1 local_1c8 [8];
  undefined1 local_1c0 [8];
  undefined1 local_1b8 [8];
  undefined1 local_1b0 [8];
  undefined1 local_1a8 [8];
  undefined1 local_1a0 [8];
  undefined1 local_198 [8];
  undefined1 local_190 [8];
  undefined1 local_188 [8];
  undefined1 local_180 [8];
  undefined1 local_178 [8];
  undefined1 local_170 [8];
  undefined1 local_168 [8];
  undefined8 local_160;
  undefined8 local_158;
  undefined1 local_150 [264];
  ulonglong local_48;
  undefined8 *******pppppppuVar15;
  
  local_160 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_3f8;
  iVar2 = param_2[10];
  if (iVar2 == 0) {
    FUN_140169430(param_1,0);
  }
  iVar13 = *param_2;
  cVar5 = FUN_140185e40(param_2,local_278);
  if (cVar5 == '\0') {
switchD_14009e8b4_default:
    FUN_140185160(param_2,(int)((iVar13 >> 0x1f & 7U) + iVar13) >> 3);
    return 0;
  }
  local_2e0 = param_3;
  switch(local_278[0]) {
  case 0x84d1:
    FUN_140140af0(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    pppppppuVar15 = (undefined8 *******)0x0;
    pppppppuVar14 = (undefined8 *******)0x0;
    local_3a0 = (void *)0x0;
    local_398 = (void *)0x0;
    local_390 = 0;
    FUN_1400a17c0(param_2,&local_3a0);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_SERVER_OPTIONS");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] != '\0') goto LAB_14009ecaf;
      local_3d8 = (undefined8 *******)&DAT_14027d1a0;
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x84d1,L"PT_SERVER_OPTIONS");
    }
    else {
      pppppppuVar14 = pppppppuVar15;
      if ((char)param_1[3] != '\0') goto LAB_14009ecaf;
      FUN_1400a3440();
      local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1400a3440();
      local_360 = (longlong *******)PTR_DAT_1402f8010;
      FUN_14003c600(&local_360,L"<Array %d>",((longlong)local_398 - (longlong)local_3a0) / 0xa0);
      FUN_14003c400(&local_3b8,&local_360);
      ppppppplVar4 = local_360;
      if (((local_360 != (longlong *******)0x0) &&
          (local_360 != (longlong *******)PTR_DAT_1402f8010)) &&
         (ppppppuVar10 = local_360 + -1, ppppppuVar10 != (undefined8 ******)0x0)) {
        ppppppuVar9 = (undefined8 ******)FUN_1400a3440();
        local_360 = (longlong *******)ppppppuVar9;
        FUN_1400a1c30(ppppppuVar9);
        local_358 = 1;
        piVar1 = (int *)((longlong)ppppppplVar4 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(ppppppuVar10);
        }
        FUN_1400d1290(ppppppuVar9);
      }
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      pppppppuVar14 = local_3b8;
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      local_360 = (longlong *******)FUN_14003c0c0(&local_3b8,&local_218,iVar13 + -2);
      if (pppppppuVar14 == (undefined8 *******)0x0) {
        pppppppuVar14 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      local_3b8 = pppppppuVar14;
      if ((undefined8 *******)*local_360 != pppppppuVar14) {
        ppppppuVar10 = (undefined8 ******)FUN_1400a3440();
        local_370 = ppppppuVar10;
        FUN_1400a1c30(ppppppuVar10);
        local_368 = 1;
        if (((pppppppuVar14 != (undefined8 *******)0x0) &&
            (pppppppuVar14 != (undefined8 *******)PTR_DAT_1402f8010)) &&
           (pppppppuVar14 + -1 != (undefined8 *******)0x0)) {
          uVar12 = FUN_1400a3440();
          local_348 = uVar12;
          FUN_1400a1c30(uVar12);
          local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
          piVar1 = (int *)((longlong)pppppppuVar14 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(pppppppuVar14 + -1);
          }
          FUN_1400d1290(uVar12);
        }
        pppppppuVar14 = (undefined8 *******)*local_360;
        if (((pppppppuVar14 != (undefined8 *******)PTR_DAT_1402f8010) &&
            (pppppppuVar14 != (undefined8 *******)0x0)) &&
           (pppppppuVar14 != (undefined8 *******)0x8)) {
          *(int *)((longlong)pppppppuVar14 + -4) = *(int *)((longlong)pppppppuVar14 + -4) + 1;
        }
        local_3b8 = pppppppuVar14;
        FUN_1400d1290(ppppppuVar10);
      }
      if (((local_218 != (undefined *)0x0) && (local_218 != PTR_DAT_1402f8010)) &&
         (local_218 + -8 != (undefined *)0x0)) {
        uVar12 = FUN_1400a3440();
        local_348 = uVar12;
        FUN_1400a1c30(uVar12);
        local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
        piVar1 = (int *)(local_218 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_218 + -8);
        }
        FUN_1400d1290(uVar12);
      }
      local_360 = (longlong *******)&local_2b8;
      local_218 = PTR_DAT_1402f8010;
      FUN_1400a3440();
      local_2b8 = (undefined8 *******)PTR_DAT_1402f8010;
      if (PTR_DAT_1402f8010 == (undefined *)0x0) {
        local_2b8 = pppppppuVar15;
      }
      if (pppppppuVar14 != (undefined8 *******)PTR_DAT_1402f8010) {
        uVar12 = FUN_1400a3440();
        local_348 = uVar12;
        FUN_1400a1c30(uVar12);
        local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
        FUN_1400031d0(&local_2b8);
        if (((pppppppuVar14 != (undefined8 *******)PTR_DAT_1402f8010) &&
            (pppppppuVar14 != (undefined8 *******)0x0)) &&
           (pppppppuVar14 != (undefined8 *******)0x8)) {
          *(int *)((longlong)pppppppuVar14 + -4) = *(int *)((longlong)pppppppuVar14 + -4) + 1;
        }
        local_2b8 = pppppppuVar14;
        FUN_1400d1290(uVar12);
      }
      FUN_1400a3440();
      local_220 = PTR_DAT_1402f8010;
      uVar6 = FUN_1400a32c0(L"PT_SERVER_OPTIONS");
      uVar12 = FUN_140002f20(&local_220,uVar6);
      FUN_1400a32f0(uVar12,L"PT_SERVER_OPTIONS",uVar6);
      FUN_140003000(&local_220);
      (**(code **)(*param_1 + 0x28))(param_1,0x84d1,&local_220,&local_2b8);
      local_3d8 = pppppppuVar14;
      if (pppppppuVar14 == (undefined8 *******)0x0) {
        local_3d8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x84d1,L"PT_SERVER_OPTIONS");
      if (((pppppppuVar14 != (undefined8 *******)0x0) &&
          (pppppppuVar14 != (undefined8 *******)PTR_DAT_1402f8010)) &&
         (pppppppuVar14 + -1 != (undefined8 *******)0x0)) {
        uVar12 = FUN_1400a3440();
        local_348 = uVar12;
        FUN_1400a1c30(uVar12);
        local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
        piVar1 = (int *)((longlong)pppppppuVar14 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(pppppppuVar14 + -1);
        }
        FUN_1400d1290(uVar12);
      }
    }
    pppppppuVar14 = pppppppuVar15;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_348 = CONCAT44(local_348._4_4_,0x84d1);
      local_340 = L"PT_SERVER_OPTIONS";
      local_338 = iVar2;
      local_330 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_348);
      DVar7 = GetTickCount();
      pppppppuVar14 = (undefined8 *******)(ulonglong)DVar7;
    }
LAB_14009ecaf:
    cVar5 = (**(code **)(*param_1 + 0x38))(param_1,iVar2,local_318,&local_3a0);
    if (cVar5 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_SERVER_OPTIONS");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_348 = CONCAT44(local_348._4_4_,0x84d1);
      local_340 = L"PT_SERVER_OPTIONS";
      local_338 = iVar2;
      local_330 = param_3;
      DVar7 = GetTickCount();
      local_328 = DVar7 - (int)pppppppuVar14;
      (**(code **)(*param_1 + 0x18))(param_1,&local_348);
    }
    pwVar3 = local_398;
    pvVar11 = local_3a0;
    if (local_3a0 == (void *)0x0) {
      return 1;
    }
    for (; pvVar11 != pwVar3; pvVar11 = (void *)((longlong)pvVar11 + 0xa0)) {
      FUN_14008d600(pvVar11);
    }
    operator_delete(local_3a0);
    return 1;
  case 0x84d2:
    FUN_140140af0(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    FUN_140185490(param_2,local_3b0,4);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_SERVER_COMMAND");
    DVar7 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_3d8 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84d2,L"PT_SERVER_COMMAND");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_3b8,local_3b0 + 4);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      local_360 = (longlong *******)FUN_14003c0c0(&local_3b8,&local_210,iVar13 + -2);
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      if ((undefined8 *******)*local_360 != local_3b8) {
        uVar12 = FUN_1400a3440();
        local_348 = uVar12;
        FUN_1400a1c30(uVar12);
        pppppppuVar14 = local_3b8;
        local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
        if (((local_3b8 != (undefined8 *******)0x0) &&
            (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) &&
           (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
          ppppppuVar10 = (undefined8 ******)FUN_1400a3440();
          local_370 = ppppppuVar10;
          FUN_1400a1c30(ppppppuVar10);
          local_368 = 1;
          piVar1 = (int *)((longlong)pppppppuVar14 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(pppppppuVar15);
          }
          FUN_1400d1290(ppppppuVar10);
        }
        local_3b8 = (undefined8 *******)*local_360;
        if (((local_3b8 != (undefined8 *******)PTR_DAT_1402f8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_1400d1290(uVar12);
      }
      if (((local_210 != (undefined *)0x0) && (local_210 != PTR_DAT_1402f8010)) &&
         (local_210 + -8 != (undefined *)0x0)) {
        uVar12 = FUN_1400a3440();
        local_348 = uVar12;
        FUN_1400a1c30(uVar12);
        local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
        piVar1 = (int *)(local_210 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_210 + -8);
        }
        FUN_1400d1290(uVar12);
      }
      local_360 = (longlong *******)&local_2a0;
      local_210 = PTR_DAT_1402f8010;
      FUN_1400a3440();
      local_2a0 = (undefined8 *******)PTR_DAT_1402f8010;
      if (PTR_DAT_1402f8010 == (undefined *)0x0) {
        local_2a0 = (undefined8 *******)0x0;
      }
      if (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010) {
        uVar12 = FUN_1400a3440();
        local_348 = uVar12;
        FUN_1400a1c30(uVar12);
        local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
        FUN_1400031d0(&local_2a0);
        local_2a0 = local_3b8;
        if (((local_3b8 != (undefined8 *******)PTR_DAT_1402f8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_1400d1290(uVar12);
      }
      FUN_1400a3440();
      local_228 = PTR_DAT_1402f8010;
      uVar6 = FUN_1400a32c0(L"PT_SERVER_COMMAND");
      uVar12 = FUN_140002f20(&local_228,uVar6);
      FUN_1400a32f0(uVar12,L"PT_SERVER_COMMAND",uVar6);
      FUN_140003000(&local_228);
      (**(code **)(*param_1 + 0x28))(param_1,0x84d2,&local_228,&local_2a0);
      local_3d8 = local_3b8;
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3d8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x84d2,L"PT_SERVER_COMMAND");
      pppppppuVar14 = local_3b8;
      if (((local_3b8 != (undefined8 *******)0x0) &&
          (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) &&
         (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
        uVar12 = FUN_1400a3440();
        local_348 = uVar12;
        FUN_1400a1c30(uVar12);
        local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
        piVar1 = (int *)((longlong)pppppppuVar14 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(pppppppuVar15);
        }
        FUN_1400d1290(uVar12);
      }
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84d2);
      local_398 = L"PT_SERVER_COMMAND";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_3a0);
      DVar7 = GetTickCount();
    }
    cVar5 = (**(code **)(*param_1 + 0x40))(param_1,iVar2,local_318,local_3b0 + 4);
    if (cVar5 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_SERVER_COMMAND");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84d2);
    local_398 = L"PT_SERVER_COMMAND";
    goto LAB_14009f130;
  case 0x84d3:
    FUN_140140af0(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    FUN_140185490(param_2,local_3b0,4);
    FUN_1400a3440();
    local_370 = (undefined8 ******)PTR_DAT_1402f8010;
    thunk_FUN_1401865d0(param_2,&local_370);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_SERVER_NOTICE");
    DVar7 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_3d8 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84d3,L"PT_SERVER_NOTICE");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_3b8,local_3b0 + 4);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      FUN_1401a2b80(&local_3b8,&local_370);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      DVar8 = DVar7;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) {
        DVar8 = *(DWORD *)(local_3b8 + -1);
      }
      local_360 = (longlong *******)FUN_14003c0c0(&local_3b8,&local_208,DVar8 - 2);
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      if ((undefined8 *******)*local_360 != local_3b8) {
        uVar12 = FUN_1400a3440();
        local_348 = uVar12;
        FUN_1400a1c30(uVar12);
        pppppppuVar14 = local_3b8;
        local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
        if (((local_3b8 != (undefined8 *******)0x0) &&
            (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) &&
           (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
          pvVar11 = (void *)FUN_1400a3440();
          local_3a0 = pvVar11;
          FUN_1400a1c30(pvVar11);
          local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
          piVar1 = (int *)((longlong)pppppppuVar14 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(pppppppuVar15);
          }
          FUN_1400d1290(pvVar11);
        }
        local_3b8 = (undefined8 *******)*local_360;
        if (((local_3b8 != (undefined8 *******)PTR_DAT_1402f8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_1400d1290(uVar12);
      }
      if (((local_208 != (undefined *)0x0) && (local_208 != PTR_DAT_1402f8010)) &&
         (local_208 + -8 != (undefined *)0x0)) {
        pvVar11 = (void *)FUN_1400a3440();
        local_3a0 = pvVar11;
        FUN_1400a1c30(pvVar11);
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        piVar1 = (int *)(local_208 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_208 + -8);
        }
        FUN_1400d1290(pvVar11);
      }
      local_360 = (longlong *******)&local_2b0;
      local_208 = PTR_DAT_1402f8010;
      FUN_1400a3440();
      local_2b0 = (undefined8 *******)PTR_DAT_1402f8010;
      if (PTR_DAT_1402f8010 == (undefined *)0x0) {
        local_2b0 = (undefined8 *******)0x0;
      }
      if (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010) {
        pvVar11 = (void *)FUN_1400a3440();
        local_3a0 = pvVar11;
        FUN_1400a1c30(pvVar11);
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        FUN_1400031d0(&local_2b0);
        local_2b0 = local_3b8;
        if (((local_3b8 != (undefined8 *******)PTR_DAT_1402f8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_1400d1290(pvVar11);
      }
      FUN_1400a3440();
      local_280 = PTR_DAT_1402f8010;
      uVar6 = FUN_1400a32c0(L"PT_SERVER_NOTICE");
      uVar12 = FUN_140002f20(&local_280,uVar6);
      FUN_1400a32f0(uVar12,L"PT_SERVER_NOTICE",uVar6);
      FUN_140003000(&local_280);
      (**(code **)(*param_1 + 0x28))(param_1,0x84d3,&local_280,&local_2b0);
      local_3d8 = local_3b8;
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3d8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x84d3,L"PT_SERVER_NOTICE");
      pppppppuVar14 = local_3b8;
      if (((local_3b8 != (undefined8 *******)0x0) &&
          (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) &&
         (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
        pvVar11 = (void *)FUN_1400a3440();
        local_3a0 = pvVar11;
        FUN_1400a1c30(pvVar11);
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        piVar1 = (int *)((longlong)pppppppuVar14 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(pppppppuVar15);
        }
        FUN_1400d1290(pvVar11);
      }
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84d3);
      local_398 = L"PT_SERVER_NOTICE";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_3a0);
      DVar7 = GetTickCount();
    }
    local_3d8 = &local_370;
    cVar5 = (**(code **)(*param_1 + 0x48))(param_1,iVar2,local_318,local_3b0 + 4);
    if (cVar5 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_SERVER_NOTICE");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84d3);
      local_398 = L"PT_SERVER_NOTICE";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      DVar8 = GetTickCount();
      local_380 = DVar8 - DVar7;
      (**(code **)(*param_1 + 0x18))(param_1,&local_3a0);
    }
    ppppppuVar10 = local_370;
    if (local_370 == (undefined8 ******)0x0) {
      return 1;
    }
    if (local_370 == (undefined8 ******)PTR_DAT_1402f8010) {
      return 1;
    }
    ppppppuVar9 = local_370 + -1;
    if (ppppppuVar9 == (undefined8 ******)0x0) {
      return 1;
    }
    pvVar11 = (void *)FUN_1400a3440();
    local_3a0 = pvVar11;
    FUN_1400a1c30(pvVar11);
    local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
    piVar1 = (int *)((longlong)ppppppuVar10 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(ppppppuVar9);
    }
    FUN_1400d1290(pvVar11);
    return 1;
  case 0x84d4:
    FUN_140140af0(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    FUN_140185490(param_2,local_3b0,4);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_SERVER_CONNECT");
    DVar7 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_3d8 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84d4,L"PT_SERVER_CONNECT");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_3b8,local_3b0 + 4);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      local_360 = (longlong *******)FUN_14003c0c0(&local_3b8,&local_1f8,iVar13 + -2);
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      if ((undefined8 *******)*local_360 != local_3b8) {
        pvVar11 = (void *)FUN_1400a3440();
        local_3a0 = pvVar11;
        FUN_1400a1c30(pvVar11);
        pppppppuVar14 = local_3b8;
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        if (((local_3b8 != (undefined8 *******)0x0) &&
            (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) &&
           (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
          uVar12 = FUN_1400a3440();
          local_348 = uVar12;
          FUN_1400a1c30(uVar12);
          local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
          piVar1 = (int *)((longlong)pppppppuVar14 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(pppppppuVar15);
          }
          FUN_1400d1290(uVar12);
        }
        local_3b8 = (undefined8 *******)*local_360;
        if (((local_3b8 != (undefined8 *******)PTR_DAT_1402f8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_1400d1290(pvVar11);
      }
      if (((local_1f8 != (undefined *)0x0) && (local_1f8 != PTR_DAT_1402f8010)) &&
         (local_1f8 + -8 != (undefined *)0x0)) {
        pvVar11 = (void *)FUN_1400a3440();
        local_3a0 = pvVar11;
        FUN_1400a1c30(pvVar11);
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        piVar1 = (int *)(local_1f8 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_1f8 + -8);
        }
        FUN_1400d1290(pvVar11);
      }
      local_360 = (longlong *******)&local_2a8;
      local_1f8 = PTR_DAT_1402f8010;
      FUN_1400a3440();
      local_2a8 = (undefined8 *******)PTR_DAT_1402f8010;
      if (PTR_DAT_1402f8010 == (undefined *)0x0) {
        local_2a8 = (undefined8 *******)0x0;
      }
      if (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010) {
        pvVar11 = (void *)FUN_1400a3440();
        local_3a0 = pvVar11;
        FUN_1400a1c30(pvVar11);
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        FUN_1400031d0(&local_2a8);
        local_2a8 = local_3b8;
        if (((local_3b8 != (undefined8 *******)PTR_DAT_1402f8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_1400d1290(pvVar11);
      }
      FUN_1400a3440();
      local_230 = PTR_DAT_1402f8010;
      uVar6 = FUN_1400a32c0(L"PT_SERVER_CONNECT");
      uVar12 = FUN_140002f20(&local_230,uVar6);
      FUN_1400a32f0(uVar12,L"PT_SERVER_CONNECT",uVar6);
      FUN_140003000(&local_230);
      (**(code **)(*param_1 + 0x28))(param_1,0x84d4,&local_230,&local_2a8);
      local_3d8 = local_3b8;
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3d8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x84d4,L"PT_SERVER_CONNECT");
      pppppppuVar14 = local_3b8;
      if (((local_3b8 != (undefined8 *******)0x0) &&
          (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) &&
         (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
        pvVar11 = (void *)FUN_1400a3440();
        local_3a0 = pvVar11;
        FUN_1400a1c30(pvVar11);
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        piVar1 = (int *)((longlong)pppppppuVar14 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(pppppppuVar15);
        }
        FUN_1400d1290(pvVar11);
      }
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84d4);
      local_398 = L"PT_SERVER_CONNECT";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_3a0);
      DVar7 = GetTickCount();
    }
    cVar5 = (**(code **)(*param_1 + 0x50))(param_1,iVar2,local_318,local_3b0 + 4);
    if (cVar5 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_SERVER_CONNECT");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84d4);
    local_398 = L"PT_SERVER_CONNECT";
    goto LAB_14009f130;
  case 0x84d5:
    FUN_140140af0(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    FUN_140185490(param_2,local_3a8,4);
    FUN_140185490(param_2,local_3a8,4);
    FUN_140185490(param_2,local_3a8,4);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_CHANNEL_STATUS_CHANGE");
    DVar7 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_3d8 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84d5,L"PT_CHANNEL_STATUS_CHANGE");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_3b8,local_3b0);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      FUN_1401a28c0(&local_3b8,&local_378);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      FUN_1401a28c0(&local_3b8,local_3b0 + 4);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      local_360 = (longlong *******)FUN_14003c0c0(&local_3b8,&local_200,iVar13 + -2);
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      if ((undefined8 *******)*local_360 != local_3b8) {
        pvVar11 = (void *)FUN_1400a3440();
        local_3a0 = pvVar11;
        FUN_1400a1c30(pvVar11);
        pppppppuVar14 = local_3b8;
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        if (((local_3b8 != (undefined8 *******)0x0) &&
            (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) &&
           (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
          uVar12 = FUN_1400a3440();
          local_348 = uVar12;
          FUN_1400a1c30(uVar12);
          local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
          piVar1 = (int *)((longlong)pppppppuVar14 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(pppppppuVar15);
          }
          FUN_1400d1290(uVar12);
        }
        local_3b8 = (undefined8 *******)*local_360;
        if (((local_3b8 != (undefined8 *******)PTR_DAT_1402f8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_1400d1290(pvVar11);
      }
      if (((local_200 != (undefined *)0x0) && (local_200 != PTR_DAT_1402f8010)) &&
         (local_200 + -8 != (undefined *)0x0)) {
        pvVar11 = (void *)FUN_1400a3440();
        local_3a0 = pvVar11;
        FUN_1400a1c30(pvVar11);
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        piVar1 = (int *)(local_200 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_200 + -8);
        }
        FUN_1400d1290(pvVar11);
      }
      local_360 = (longlong *******)&local_298;
      local_200 = PTR_DAT_1402f8010;
      FUN_1400a3440();
      local_298 = (undefined8 *******)PTR_DAT_1402f8010;
      if (PTR_DAT_1402f8010 == (undefined *)0x0) {
        local_298 = (undefined8 *******)0x0;
      }
      if (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010) {
        pvVar11 = (void *)FUN_1400a3440();
        local_3a0 = pvVar11;
        FUN_1400a1c30(pvVar11);
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        FUN_1400031d0(&local_298);
        local_298 = local_3b8;
        if (((local_3b8 != (undefined8 *******)PTR_DAT_1402f8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_1400d1290(pvVar11);
      }
      FUN_1400a3440();
      local_260 = PTR_DAT_1402f8010;
      uVar6 = FUN_1400a32c0(L"PT_CHANNEL_STATUS_CHANGE");
      uVar12 = FUN_140002f20(&local_260,uVar6);
      FUN_1400a32f0(uVar12,L"PT_CHANNEL_STATUS_CHANGE",uVar6);
      FUN_140003000(&local_260);
      (**(code **)(*param_1 + 0x28))(param_1,0x84d5,&local_260,&local_298);
      local_3d8 = local_3b8;
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3d8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x84d5,L"PT_CHANNEL_STATUS_CHANGE");
      pppppppuVar14 = local_3b8;
      if (((local_3b8 != (undefined8 *******)0x0) &&
          (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) &&
         (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
        pvVar11 = (void *)FUN_1400a3440();
        local_3a0 = pvVar11;
        FUN_1400a1c30(pvVar11);
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        piVar1 = (int *)((longlong)pppppppuVar14 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(pppppppuVar15);
        }
        FUN_1400d1290(pvVar11);
      }
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84d5);
      local_398 = L"PT_CHANNEL_STATUS_CHANGE";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_3a0);
      DVar7 = GetTickCount();
    }
    local_3d0 = (undefined8 *)(local_3b0 + 4);
    local_3d8 = (undefined8 *******)&local_378;
    cVar5 = (**(code **)(*param_1 + 0x58))(param_1,iVar2,local_318,local_3b0);
    if (cVar5 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PT_CHANNEL_STATUS_CHANGE");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84d5);
    local_398 = L"PT_CHANNEL_STATUS_CHANGE";
    goto LAB_14009f130;
  case 0x84d6:
    FUN_140140af0(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    FUN_1400a3440();
    local_370 = (undefined8 ******)PTR_DAT_1402f8010;
    thunk_FUN_1401865d0(param_2,&local_370);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,L"PT_USER_KICK");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_3d8 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84d6,L"PT_USER_KICK");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2b80(&local_3b8,&local_370);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      local_360 = (longlong *******)FUN_14003c0c0(&local_3b8,local_1c8,iVar13 + -2);
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      if ((undefined8 *******)*local_360 != local_3b8) {
        pvVar11 = (void *)FUN_1400a3440();
        local_3a0 = pvVar11;
        FUN_1400a1c30(pvVar11);
        pppppppuVar14 = local_3b8;
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        if (((local_3b8 != (undefined8 *******)0x0) &&
            (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) &&
           (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
          uVar12 = FUN_1400a3440();
          local_348 = uVar12;
          FUN_1400a1c30(uVar12);
          local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
          piVar1 = (int *)((longlong)pppppppuVar14 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(pppppppuVar15);
          }
          FUN_1400d1290(uVar12);
        }
        local_3b8 = (undefined8 *******)*local_360;
        if (((local_3b8 != (undefined8 *******)PTR_DAT_1402f8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_1400d1290(pvVar11);
      }
      FUN_1400031d0(local_1c8);
      local_360 = &local_270;
      FUN_1400a3440();
      local_270 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_270,&local_3b8);
      uVar12 = FUN_140003080(local_188,L"PT_USER_KICK",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x84d6,uVar12,&local_270);
      local_3d8 = local_3b8;
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3d8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x84d6,L"PT_USER_KICK");
      FUN_1400031d0(&local_3b8);
    }
    DVar7 = 0;
    if (((char)param_1[3] == '\0') && (DVar7 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84d6);
      local_398 = L"PT_USER_KICK";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_3a0);
      DVar7 = GetTickCount();
    }
    cVar5 = (**(code **)(*param_1 + 0x60))(param_1,iVar2,local_318,&local_370);
    if (cVar5 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_USER_KICK");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84d6);
      local_398 = L"PT_USER_KICK";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      DVar8 = GetTickCount();
      local_380 = DVar8 - DVar7;
      (**(code **)(*param_1 + 0x18))(param_1,&local_3a0);
    }
    pppppppuVar14 = &local_370;
    break;
  case 0x84d7:
    FUN_140140af0(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    FUN_140185490(param_2,local_3a8,4);
    FUN_140185490(param_2,local_3b0 + 4,4);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_CURRENT_USER_COUNT");
    DVar7 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_3d8 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84d7,L"PT_CURRENT_USER_COUNT");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_3b8,&local_378);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      FUN_1401a28c0(&local_3b8,local_3b0);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      DVar8 = DVar7;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) {
        DVar8 = *(DWORD *)(local_3b8 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_3b8,local_1c0,DVar8 - 2);
      FUN_140003100(&local_3b8,uVar12);
      FUN_1400031d0(local_1c0);
      local_360 = &local_250;
      FUN_1400a3440();
      local_250 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_250,&local_3b8);
      uVar12 = FUN_140003080(local_178,L"PT_CURRENT_USER_COUNT",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x84d7,uVar12,&local_250);
      local_3d8 = local_3b8;
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3d8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x84d7,L"PT_CURRENT_USER_COUNT");
      FUN_1400031d0(&local_3b8);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84d7);
      local_398 = L"PT_CURRENT_USER_COUNT";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_3a0);
      DVar7 = GetTickCount();
    }
    local_3d8 = (undefined8 *******)local_3b0;
    cVar5 = (**(code **)(*param_1 + 0x68))(param_1,iVar2,local_318,&local_378);
    if (cVar5 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_CURRENT_USER_COUNT")
      ;
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84d7);
    local_398 = L"PT_CURRENT_USER_COUNT";
    goto LAB_14009f130;
  case 0x84d8:
    FUN_140140af0(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    FUN_1400a3440();
    local_370 = (undefined8 ******)PTR_DAT_1402f8010;
    thunk_FUN_1401865d0(param_2,&local_370);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_STRING_COMMAND");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_3d8 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84d8,L"PT_STRING_COMMAND");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2b80(&local_3b8,&local_370);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_3b8,local_1b0,iVar13 + -2);
      FUN_140003100(&local_3b8,uVar12);
      FUN_1400031d0(local_1b0);
      local_360 = &local_240;
      FUN_1400a3440();
      local_240 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_240,&local_3b8);
      uVar12 = FUN_140003080(local_168,L"PT_STRING_COMMAND",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x84d8,uVar12,&local_240);
      local_3d8 = local_3b8;
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3d8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x84d8,L"PT_STRING_COMMAND");
      FUN_1400031d0(&local_3b8);
    }
    DVar7 = 0;
    if (((char)param_1[3] == '\0') && (DVar7 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84d8);
      local_398 = L"PT_STRING_COMMAND";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_3a0);
      DVar7 = GetTickCount();
    }
    cVar5 = (**(code **)(*param_1 + 0x70))(param_1,iVar2,local_318,&local_370);
    if (cVar5 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_STRING_COMMAND");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84d8);
      local_398 = L"PT_STRING_COMMAND";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      DVar8 = GetTickCount();
      local_380 = DVar8 - DVar7;
      (**(code **)(*param_1 + 0x18))(param_1,&local_3a0);
    }
    pppppppuVar14 = &local_370;
    break;
  case 0x84d9:
    FUN_140140af0(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    FUN_140185490(param_2,local_350,1);
    FUN_140185490(param_2,local_3a8,4);
    DVar7 = 0;
    local_158 = 0;
    memset(local_150,0,0x100);
    FUN_14007f570(param_2,&local_158);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_REAL_TIME_EVENT");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_3d8 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84d9,L"PT_REAL_TIME_EVENT");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a2720(&local_3b8,(undefined4 *)((longlong)&local_378 + 4));
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      FUN_1401a28c0(&local_3b8,local_3b0);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      FUN_14007f4c0(&local_3b8,&local_158);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      DVar8 = DVar7;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) {
        DVar8 = *(DWORD *)(local_3b8 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_3b8,local_1f0,DVar8 - 2);
      FUN_140003100(&local_3b8,uVar12);
      FUN_1400031d0(local_1f0);
      local_360 = &local_258;
      FUN_1400a3440();
      local_258 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_258,&local_3b8);
      uVar12 = FUN_140003080(local_1a8,L"PT_REAL_TIME_EVENT",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x84d9,uVar12,&local_258);
      local_3d8 = local_3b8;
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3d8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x84d9,L"PT_REAL_TIME_EVENT");
      FUN_1400031d0(&local_3b8);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84d9);
      local_398 = L"PT_REAL_TIME_EVENT";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_3a0);
      DVar7 = GetTickCount();
    }
    local_3d0 = &local_158;
    local_3d8 = (undefined8 *******)local_3b0;
    cVar5 = (**(code **)(*param_1 + 0x78))
                      (param_1,iVar2,local_318,(undefined4 *)((longlong)&local_378 + 4));
    if (cVar5 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_REAL_TIME_EVENT");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84d9);
    local_398 = L"PT_REAL_TIME_EVENT";
LAB_14009f130:
    local_390 = CONCAT44(local_390._4_4_,iVar2);
    local_388 = param_3;
    DVar8 = GetTickCount();
    local_380 = DVar8 - DVar7;
    (**(code **)(*param_1 + 0x18))(param_1,&local_3a0);
    return 1;
  case 0x84da:
    FUN_140140af0(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    cVar5 = FUN_140185490(param_2,local_3a8,4);
    if (cVar5 != '\0') {
      local_3b0._0_4_ = local_3a8[0];
    }
    FUN_1400a3440();
    local_370 = (undefined8 ******)PTR_DAT_1402f8010;
    thunk_FUN_1401865d0(param_2,&local_370);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PWE_REQ_PLAYER_KICK");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_3d8 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84da,L"PWE_REQ_PLAYER_KICK");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_3b8,local_3b0);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      FUN_1401a2b80(&local_3b8,&local_370);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_3b8,local_1d0,iVar13 + -2);
      FUN_140003100(&local_3b8,uVar12);
      FUN_1400031d0(local_1d0);
      local_360 = &local_238;
      FUN_1400a3440();
      local_238 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_238,&local_3b8);
      uVar12 = FUN_140003080(local_190,L"PWE_REQ_PLAYER_KICK",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x84da,uVar12,&local_238);
      local_3d8 = local_3b8;
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3d8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x84da,L"PWE_REQ_PLAYER_KICK");
      FUN_1400031d0(&local_3b8);
    }
    DVar7 = 0;
    if (((char)param_1[3] == '\0') && (DVar7 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84da);
      local_398 = L"PWE_REQ_PLAYER_KICK";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_3a0);
      DVar7 = GetTickCount();
    }
    local_3d8 = &local_370;
    cVar5 = (**(code **)(*param_1 + 0x80))(param_1,iVar2,local_318,local_3b0);
    if (cVar5 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PWE_REQ_PLAYER_KICK");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84da);
      local_398 = L"PWE_REQ_PLAYER_KICK";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      DVar8 = GetTickCount();
      local_380 = DVar8 - DVar7;
      (**(code **)(*param_1 + 0x18))(param_1,&local_3a0);
    }
    pppppppuVar14 = &local_370;
    break;
  case 0x84db:
    FUN_140140af0(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    cVar5 = FUN_140185490(param_2,local_3a8,4);
    if (cVar5 != '\0') {
      local_3b0._0_4_ = local_3a8[0];
    }
    FUN_1400a3440();
    local_370 = (undefined8 ******)PTR_DAT_1402f8010;
    thunk_FUN_1401865d0(param_2,&local_370);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PWE_REQ_PLAYER_BAN");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_3d8 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84db,L"PWE_REQ_PLAYER_BAN");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_3b8,local_3b0);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      FUN_1401a2b80(&local_3b8,&local_370);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_3b8,local_1d8,iVar13 + -2);
      FUN_140003100(&local_3b8,uVar12);
      FUN_1400031d0(local_1d8);
      local_360 = &local_248;
      FUN_1400a3440();
      local_248 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_248,&local_3b8);
      uVar12 = FUN_140003080(local_170,L"PWE_REQ_PLAYER_BAN",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x84db,uVar12,&local_248);
      local_3d8 = local_3b8;
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3d8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x84db,L"PWE_REQ_PLAYER_BAN");
      FUN_1400031d0(&local_3b8);
    }
    DVar7 = 0;
    if (((char)param_1[3] == '\0') && (DVar7 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84db);
      local_398 = L"PWE_REQ_PLAYER_BAN";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_3a0);
      DVar7 = GetTickCount();
    }
    local_3d8 = &local_370;
    cVar5 = (**(code **)(*param_1 + 0x88))(param_1,iVar2,local_318,local_3b0);
    if (cVar5 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PWE_REQ_PLAYER_BAN");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84db);
      local_398 = L"PWE_REQ_PLAYER_BAN";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      DVar8 = GetTickCount();
      local_380 = DVar8 - DVar7;
      (**(code **)(*param_1 + 0x18))(param_1,&local_3a0);
    }
    pppppppuVar14 = &local_370;
    break;
  case 0x84dc:
    FUN_140140af0(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    cVar5 = FUN_140185490(param_2,local_3a8,4);
    if (cVar5 != '\0') {
      local_3b0._0_4_ = local_3a8[0];
    }
    FUN_1400a3440();
    local_370 = (undefined8 ******)PTR_DAT_1402f8010;
    thunk_FUN_1401865d0(param_2,&local_370);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PWE_REQ_UPDATE_CASH");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_3d8 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84dc,L"PWE_REQ_UPDATE_CASH");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_3b8,local_3b0);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      FUN_1401a2b80(&local_3b8,&local_370);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_3b8,local_1b8,iVar13 + -2);
      FUN_140003100(&local_3b8,uVar12);
      FUN_1400031d0(local_1b8);
      local_360 = &local_268;
      FUN_1400a3440();
      local_268 = (longlong ******)PTR_DAT_1402f8010;
      FUN_140003100(&local_268,&local_3b8);
      uVar12 = FUN_140003080(local_180,L"PWE_REQ_UPDATE_CASH",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x84dc,uVar12,&local_268);
      local_3d8 = local_3b8;
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3d8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x84dc,L"PWE_REQ_UPDATE_CASH");
      FUN_1400031d0(&local_3b8);
    }
    DVar7 = 0;
    if (((char)param_1[3] == '\0') && (DVar7 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84dc);
      local_398 = L"PWE_REQ_UPDATE_CASH";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_3a0);
      DVar7 = GetTickCount();
    }
    local_3d8 = &local_370;
    cVar5 = (**(code **)(*param_1 + 0x90))(param_1,iVar2,local_318,local_3b0);
    if (cVar5 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PWE_REQ_UPDATE_CASH");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84dc);
      local_398 = L"PWE_REQ_UPDATE_CASH";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      DVar8 = GetTickCount();
      local_380 = DVar8 - DVar7;
      (**(code **)(*param_1 + 0x18))(param_1,&local_3a0);
    }
    pppppppuVar14 = &local_370;
    break;
  case 0x84dd:
    FUN_140140af0(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    cVar5 = FUN_140185490(param_2,local_3a8,4);
    if (cVar5 != '\0') {
      local_3b0._4_4_ = local_3a8[0];
    }
    FUN_1400a3440();
    local_360 = (longlong *******)PTR_DAT_1402f8010;
    thunk_FUN_1401865d0(param_2,&local_360);
    cVar5 = FUN_140185490(param_2,&local_370,4);
    if (cVar5 != '\0') {
      local_378._0_4_ = local_370._0_4_;
    }
    cVar5 = FUN_140185490(param_2,&local_3b8,4);
    if (cVar5 != '\0') {
      local_3b0._0_4_ = local_3b8._0_4_;
    }
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PWE_REQ_INSERT_ITEM");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_3d8 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84dd,L"PWE_REQ_INSERT_ITEM");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_3b8,local_3b0 + 4);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      FUN_1401a2b80(&local_3b8,&local_360);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      FUN_1401a28c0(&local_3b8,&local_378);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      FUN_1401a28c0(&local_3b8,local_3b0);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_3b8,local_1e8,iVar13 + -2);
      FUN_140003100(&local_3b8,uVar12);
      FUN_1400031d0(local_1e8);
      local_370 = &local_288;
      FUN_1400a3440();
      local_288 = (undefined8 *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_288,&local_3b8);
      uVar12 = FUN_140003080(local_1a0,L"PWE_REQ_INSERT_ITEM",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x84dd,uVar12,&local_288);
      local_3d8 = local_3b8;
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3d8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x84dd,L"PWE_REQ_INSERT_ITEM");
      FUN_1400031d0(&local_3b8);
    }
    DVar7 = 0;
    if (((char)param_1[3] == '\0') && (DVar7 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84dd);
      local_398 = L"PWE_REQ_INSERT_ITEM";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_3a0);
      DVar7 = GetTickCount();
    }
    local_3c8 = (undefined8 *******)local_3b0;
    local_3d0 = &local_378;
    local_3d8 = &local_360;
    cVar5 = (**(code **)(*param_1 + 0x98))(param_1,iVar2,local_318,local_3b0 + 4);
    if (cVar5 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PWE_REQ_INSERT_ITEM");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84dd);
      local_398 = L"PWE_REQ_INSERT_ITEM";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      DVar8 = GetTickCount();
      local_380 = DVar8 - DVar7;
      (**(code **)(*param_1 + 0x18))(param_1,&local_3a0);
    }
    goto LAB_1400a16a2;
  case 0x84de:
    FUN_140140af0(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    cVar5 = FUN_140185490(param_2,&local_3b8,4);
    if (cVar5 != '\0') {
      local_3b0._4_4_ = local_3b8._0_4_;
    }
    cVar5 = FUN_140185490(param_2,&local_370,4);
    if (cVar5 != '\0') {
      local_378._0_4_ = local_370._0_4_;
    }
    cVar5 = FUN_140185490(param_2,local_3a8,4);
    if (cVar5 != '\0') {
      local_3b0._0_4_ = local_3a8[0];
    }
    FUN_1400a3440();
    local_360 = (longlong *******)PTR_DAT_1402f8010;
    thunk_FUN_1401865d0(param_2,&local_360);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,L"PWE_REQ_NOTICE");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_3d8 = (undefined8 *******)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84de,L"PWE_REQ_NOTICE");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_3b8 = (undefined8 *******)PTR_DAT_1402f8010;
      FUN_1401a28c0(&local_3b8,local_3b0 + 4);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      FUN_1401a28c0(&local_3b8,&local_378);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      FUN_1401a28c0(&local_3b8,local_3b0);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      FUN_1401a2b80(&local_3b8,&local_360);
      FUN_14003c890(&local_3b8,&DAT_14027c73c);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1402f8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_3b8,local_1e0,iVar13 + -2);
      FUN_140003100(&local_3b8,uVar12);
      FUN_1400031d0(local_1e0);
      local_370 = &local_290;
      FUN_1400a3440();
      local_290 = (undefined8 *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_290,&local_3b8);
      uVar12 = FUN_140003080(local_198,L"PWE_REQ_NOTICE",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x84de,uVar12,&local_290);
      local_3d8 = local_3b8;
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3d8 = (undefined8 *******)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x84de,L"PWE_REQ_NOTICE");
      FUN_1400031d0(&local_3b8);
    }
    DVar7 = 0;
    if (((char)param_1[3] == '\0') && (DVar7 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84de);
      local_398 = L"PWE_REQ_NOTICE";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_3a0);
      DVar7 = GetTickCount();
    }
    local_3c8 = &local_360;
    local_3d0 = (undefined8 *)local_3b0;
    local_3d8 = (undefined8 *******)&local_378;
    cVar5 = (**(code **)(*param_1 + 0xa0))(param_1,iVar2,local_318,local_3b0 + 4);
    if (cVar5 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PWE_REQ_NOTICE");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3a0 = (void *)CONCAT44(local_3a0._4_4_,0x84de);
      local_398 = L"PWE_REQ_NOTICE";
      local_390 = CONCAT44(local_390._4_4_,iVar2);
      local_388 = param_3;
      DVar8 = GetTickCount();
      local_380 = DVar8 - DVar7;
      (**(code **)(*param_1 + 0x18))(param_1,&local_3a0);
    }
LAB_1400a16a2:
    pppppppuVar14 = &local_360;
    break;
  default:
    goto switchD_14009e8b4_default;
  }
  FUN_1400031d0(pppppppuVar14);
  return 1;
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl std::bad_alloc::`scalar deleting destructor'(unsigned
// int) __ptr64
// 
// Libraries: Visual Studio 2012 Release, Visual Studio 2015 Release

void * __thiscall std::bad_alloc::_scalar_deleting_destructor_(bad_alloc *this,uint param_1)

{
  *(undefined ***)this = RNP::Agent2ServerStub::vftable;
  FUN_14018a150();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_1400a1760(undefined8 *param_1)

{
  *param_1 = RNP::Agent2ServerStub::vftable;
  FUN_14018a150();
  return;
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl std::bad_alloc::`scalar deleting destructor'(unsigned
// int) __ptr64
// 
// Libraries: Visual Studio 2012 Release, Visual Studio 2015 Release

void * __thiscall std::bad_alloc::_scalar_deleting_destructor_(bad_alloc *this,uint param_1)

{
  *(undefined ***)this = RNP::Server2AgentProxy::vftable;
  FUN_140186ed0();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_1400a17b0(undefined8 *param_1)

{
  *param_1 = RNP::Server2AgentProxy::vftable;
  FUN_140186ed0();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400a17c0(undefined8 param_1,ulonglong *param_2)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  int iVar3;
  ulonglong uVar4;
  undefined1 auStack_118 [32];
  ulonglong local_f8;
  ulonglong local_f0;
  undefined8 local_e8;
  undefined8 local_d8;
  undefined4 local_d0;
  undefined1 local_cc;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined1 local_b8;
  undefined2 local_b0;
  undefined6 uStack_ae;
  undefined8 local_a0;
  ulonglong local_98;
  undefined2 local_88;
  undefined6 uStack_86;
  undefined8 local_78;
  ulonglong local_70;
  undefined2 local_60;
  undefined6 uStack_5e;
  undefined8 local_50;
  ulonglong local_48;
  ulonglong local_38;
  
  local_e8 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_118;
  FUN_140185490(param_1,&local_f8,4);
  uVar4 = local_f8;
  iVar3 = (int)local_f8;
  if (((int)local_f8 < 0) || (DAT_1402f8140 <= (int)local_f8)) {
    FUN_1401a2590(local_f8 & 0xffffffff);
  }
  FUN_14008da50(param_2,(longlong)iVar3);
  FUN_1400a19f0(param_2);
  if (0 < iVar3) {
    uVar4 = uVar4 & 0xffffffff;
    do {
      local_d8 = 0;
      local_d0 = 0;
      local_cc = 0;
      local_c8 = 0;
      local_c0 = 0;
      local_b8 = 0;
      local_98 = 7;
      local_a0 = 0;
      local_b0 = 0;
      local_70 = 7;
      local_78 = 0;
      local_88 = 0;
      local_48 = 7;
      local_50 = 0;
      local_60 = 0;
      FUN_14007f960(param_1,&local_d8);
      puVar1 = (undefined8 *)param_2[1];
      if ((&local_d8 < puVar1) && (puVar2 = (undefined8 *)*param_2, puVar2 <= &local_d8)) {
        if (puVar1 == (undefined8 *)param_2[2]) {
          FUN_14008d9a0(param_2,1);
        }
        local_f8 = param_2[1];
        local_f0 = local_f8;
        if (local_f8 != 0) {
          FUN_14008d690(local_f8,(((longlong)&local_d8 - (longlong)puVar2) / 0xa0) * 0xa0 + *param_2
                       );
        }
      }
      else {
        if (puVar1 == (undefined8 *)param_2[2]) {
          FUN_14008d9a0(param_2,1);
        }
        local_f8 = param_2[1];
        local_f0 = local_f8;
        if (local_f8 != 0) {
          FUN_14008d690(local_f8,&local_d8);
        }
      }
      param_2[1] = param_2[1] + 0xa0;
      if (7 < local_48) {
        operator_delete((void *)CONCAT62(uStack_5e,local_60));
      }
      local_48 = 7;
      local_50 = 0;
      local_60 = 0;
      if (7 < local_70) {
        operator_delete((void *)CONCAT62(uStack_86,local_88));
      }
      local_70 = 7;
      local_78 = 0;
      local_88 = 0;
      if (7 < local_98) {
        operator_delete((void *)CONCAT62(uStack_ae,local_b0));
      }
      uVar4 = uVar4 - 1;
    } while (uVar4 != 0);
  }
  return param_1;
}



void FUN_1400a19f0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = param_1[1];
  lVar2 = lVar1 - *param_1;
  lVar3 = lVar2 >> 0x3f;
  if ((lVar2 / 0xa0 + lVar3 != lVar3) && (*param_1 != lVar1)) {
    lVar2 = FUN_1400a1a80(lVar1,lVar1);
    lVar1 = param_1[1];
    for (lVar3 = lVar2; lVar3 != lVar1; lVar3 = lVar3 + 0xa0) {
      FUN_14008d600(lVar3);
    }
    param_1[1] = lVar2;
  }
  return;
}



undefined4 * FUN_1400a1a80(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 2;
    do {
      *param_3 = puVar2[-2];
      param_3[1] = puVar2[-1];
      param_3[2] = *puVar2;
      *(undefined1 *)(param_3 + 3) = *(undefined1 *)(puVar2 + 1);
      param_3[4] = puVar2[2];
      param_3[5] = puVar2[3];
      param_3[6] = puVar2[4];
      param_3[7] = puVar2[5];
      *(undefined1 *)(param_3 + 8) = *(undefined1 *)(puVar2 + 6);
      FUN_140001700(param_3 + 10,puVar2 + 8,0,0xffffffffffffffff);
      FUN_140001700(param_3 + 0x14,puVar2 + 0x12);
      FUN_140001700(param_3 + 0x1e,puVar2 + 0x1c);
      param_3 = param_3 + 0x28;
      puVar1 = puVar2 + 0x26;
      puVar2 = puVar2 + 0x28;
    } while (puVar1 != param_2);
  }
  return param_3;
}



undefined4 * FUN_1400a1b50(undefined4 *param_1,DWORD param_2,char param_3)

{
  int iVar1;
  BOOL BVar2;
  longlong lVar3;
  undefined1 local_58 [80];
  
  *(undefined1 *)(param_1 + 0xc) = 0;
  *param_1 = 0x3faf713;
  iVar1 = FUN_1400a2990();
  if (iVar1 == 1) {
    param_2 = 0;
  }
  if ((param_3 != '\0') && (lVar3 = FUN_1400a2b00(), *(longlong *)(lVar3 + 0x50) != 0)) {
    lVar3 = FUN_1400a2b00();
    iVar1 = (**(code **)(lVar3 + 0x50))(param_1 + 2,param_2,0x1000000);
    if (iVar1 != 0) {
      return param_1;
    }
    FUN_1400a2320(local_58,L"InitializeCriticalSectionEx Failure!",
                  L"Proud::CriticalSection::CriticalSection");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  if (param_2 == 0) {
    InitializeCriticalSection((LPCRITICAL_SECTION)(param_1 + 2));
  }
  else {
    BVar2 = InitializeCriticalSectionAndSpinCount((LPCRITICAL_SECTION)(param_1 + 2),param_2);
    if (BVar2 == 0) {
      FUN_1400a2320(local_58,L"InitializeCriticalSectionEx Failure!",
                    L"Proud::CriticalSection::CriticalSection");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
  }
  return param_1;
}



void FUN_1400a1c30(int *param_1)

{
  if (*param_1 != 0x3faf713) {
    FUN_1400a2b50(
                 L"Cannot enter critical section which has been already destroyed! NOTE: This may be solved by deleting CNetClient instance before your WinMain() finishes working."
                 );
  }
                    // WARNING: Could not recover jumptable at 0x0001400a1c56. Too many branches
                    // WARNING: Treating indirect jump as call
  EnterCriticalSection((LPCRITICAL_SECTION)(param_1 + 2));
  return;
}



void FUN_1400a1c60(int *param_1)

{
  if (*param_1 == 0x3faf713) {
    EnterCriticalSection((LPCRITICAL_SECTION)(param_1 + 2));
  }
  return;
}



bool FUN_1400a1c80(int *param_1)

{
  BOOL BVar1;
  
  if (*param_1 != 0x3faf713) {
    FUN_1400a2b50(
                 L"Lock invalid critical section is prohibited! NOTE: This may be solved by manually destroying ProudNet related objects if they are defined as Global Objects."
                 );
  }
  BVar1 = TryEnterCriticalSection((LPCRITICAL_SECTION)(param_1 + 2));
  return BVar1 != 0;
}



bool FUN_1400a1cc0(int *param_1)

{
  return *param_1 == 0x3faf713;
}



void FUN_1400a1cd0(undefined4 *param_1)

{
  undefined1 local_58 [80];
  
  if (*(char *)(param_1 + 0xc) == '\0') {
    if ((*(longlong *)(param_1 + 6) != 0) && (*(longlong *)(param_1 + 6) != -1)) {
      FUN_1400a2320(local_58,L"Critical section is still in use! Destruction may cause problems!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    DeleteCriticalSection((LPCRITICAL_SECTION)(param_1 + 2));
    *param_1 = 0;
    *(undefined8 *)(param_1 + 2) = 0;
    *(undefined8 *)(param_1 + 4) = 0;
    *(undefined8 *)(param_1 + 6) = 0;
    *(undefined8 *)(param_1 + 8) = 0;
    *(undefined8 *)(param_1 + 10) = 0;
  }
  return;
}



bool FUN_1400a1d50(longlong param_1)

{
  DWORD DVar1;
  
  DVar1 = GetCurrentThreadId();
  return *(ulonglong *)(param_1 + 0x18) == (ulonglong)DVar1;
}



void FUN_1400a1d70(longlong *param_1,int param_2,void *param_3,int param_4)

{
  void *pvVar1;
  
  if (param_1 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80070057);
  }
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80070057);
  }
  if (param_3 == (void *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80070057);
  }
  pvVar1 = (void *)*param_1;
  if (pvVar1 == param_3) {
    if (param_2 <= param_4) {
      *param_1 = (longlong)param_3;
      goto LAB_1400a1e01;
    }
    pvVar1 = calloc((longlong)param_2,1);
  }
  else {
    if (param_2 <= param_4) {
      free(pvVar1);
      *param_1 = (longlong)param_3;
      goto LAB_1400a1e01;
    }
    pvVar1 = _recalloc(pvVar1,(longlong)param_2,1);
    if (pvVar1 == (void *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  *param_1 = (longlong)pvVar1;
LAB_1400a1e01:
  if (*param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x8007000e);
  }
  return;
}



void FUN_1400a1e20(undefined8 *param_1)

{
  if ((undefined8 *)*param_1 != param_1 + 1) {
    free((undefined8 *)*param_1);
  }
  return;
}



void FUN_1400a1e40(undefined8 *param_1,LPCWSTR param_2,UINT param_3)

{
  code *pcVar1;
  int iVar2;
  int iVar3;
  DWORD DVar4;
  bool bVar5;
  
  if (param_2 == (LPCWSTR)0x0) {
    *param_1 = 0;
    return;
  }
  iVar2 = lstrlenW(param_2);
  iVar2 = iVar2 + 1;
  FUN_1400a1d70(param_1,iVar2 * 4,param_1 + 1,0x80);
  iVar3 = WideCharToMultiByte(param_3,0,param_2,iVar2,(LPSTR)*param_1,iVar2 * 4,(LPCSTR)0x0,
                              (LPBOOL)0x0);
  if (iVar3 == 0) {
    DVar4 = GetLastError();
    bVar5 = true;
    if (DVar4 == 0x7a) {
      iVar3 = WideCharToMultiByte(param_3,0,param_2,iVar2,(LPSTR)0x0,0,(LPCSTR)0x0,(LPBOOL)0x0);
      FUN_1400a1d70(param_1,iVar3,param_1 + 1,0x80);
      iVar2 = WideCharToMultiByte(param_3,0,param_2,iVar2,(LPSTR)*param_1,iVar3,(LPCSTR)0x0,
                                  (LPBOOL)0x0);
      bVar5 = iVar2 == 0;
    }
    if (bVar5) {
      FUN_14008a6a0();
      pcVar1 = (code *)swi(3);
      (*pcVar1)();
      return;
    }
  }
  return;
}



undefined * FUN_1400a1f80(longlong param_1)

{
  undefined *puVar1;
  
  puVar1 = *(undefined **)(param_1 + 0x40);
  if (*(undefined **)(param_1 + 0x40) == (undefined *)0x0) {
    puVar1 = PTR_DAT_1402f8008;
  }
  return puVar1;
}



void FUN_1400a1f90(exception *param_1)

{
  *(undefined ***)param_1 = Proud::Exception::vftable;
  FUN_14000c2a0(param_1 + 0x40);
                    // WARNING: Could not recover jumptable at 0x0001400a1fc2. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(param_1);
  return;
}



exception * FUN_1400a1fd0(exception *param_1,undefined8 param_2)

{
  std::exception::exception(param_1);
  *(undefined ***)param_1 = Proud::Exception::vftable;
  FUN_1400a3440();
  *(undefined **)(param_1 + 0x40) = PTR_DAT_1402f8008;
  *(undefined8 *)(param_1 + 0x20) = param_2;
  *(undefined4 *)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x38) = 4;
  return param_1;
}



void FUN_1400a2030(undefined8 *param_1)

{
  longlong *plVar1;
  longlong *plVar2;
  longlong lVar3;
  
  plVar2 = (longlong *)*param_1;
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar2 + 2;
    lVar3 = *plVar1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if (((int)lVar3 == 1) && (plVar2 != (longlong *)0x0)) {
      if (*plVar2 != 0) {
        Ordinal_6();
      }
      if ((void *)plVar2[1] != (void *)0x0) {
        operator_delete__((void *)plVar2[1]);
      }
      operator_delete(plVar2);
    }
    *param_1 = 0;
  }
  return;
}



undefined8 *
FUN_1400a2090(longlong param_1,undefined8 *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 *puVar2;
  undefined8 local_res8;
  
  local_res8 = 0;
  if (*(longlong *)(param_1 + 0x10) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x10) + 0x28))
              (*(longlong **)(param_1 + 0x10),&local_res8,param_3,param_4,0xfffffffffffffffe);
  }
  uVar1 = local_res8;
  puVar2 = operator_new(0x18);
  if (puVar2 != (undefined8 *)0x0) {
    puVar2[1] = 0;
    *(undefined4 *)(puVar2 + 2) = 1;
    *puVar2 = uVar1;
  }
  *param_2 = puVar2;
  if (puVar2 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_1400adba0(0x8007000e);
  }
  return param_2;
}



longlong * FUN_1400a2120(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined *puVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  undefined *puVar6;
  undefined *local_res8;
  undefined8 uVar7;
  
  uVar7 = 0xfffffffffffffffe;
  FUN_1400a3440();
  puVar2 = PTR_DAT_1402f8008;
  local_res8 = PTR_DAT_1402f8008;
  iVar3 = FUN_1400a3360();
  if (puVar2 == (undefined *)0x0) {
    iVar5 = 0;
  }
  else if (puVar2 == PTR_DAT_1402f8008) {
    iVar5 = 0;
  }
  else {
    iVar5 = *(int *)(puVar2 + -8);
  }
  iVar4 = iVar3;
  if (iVar3 <= iVar5) {
    if (puVar2 == (undefined *)0x0) {
      iVar4 = 0;
    }
    else if (puVar2 == PTR_DAT_1402f8008) {
      iVar4 = 0;
    }
    else {
      iVar4 = *(int *)(puVar2 + -8);
    }
  }
  iVar5 = 1;
  if (1 < iVar4) {
    iVar5 = iVar4;
  }
  if (puVar2 == (undefined *)0x0) {
    iVar4 = 0;
  }
  else if (puVar2 == PTR_DAT_1402f8008) {
    iVar4 = 0;
  }
  else {
    iVar4 = *(int *)(puVar2 + -8);
  }
  if (iVar4 < iVar5) {
    FUN_14000c1c0(&local_res8);
  }
  FUN_14000c330(&local_res8);
  puVar2 = local_res8;
  puVar6 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar6,param_2,iVar3,param_4,uVar7);
  iVar5 = FUN_1400a3360();
  iVar3 = 0;
  if (0 < iVar5) {
    iVar3 = iVar5;
  }
  if (puVar2 == (undefined *)0x0) {
    iVar5 = 0;
  }
  else if (puVar2 == PTR_DAT_1402f8008) {
    iVar5 = 0;
  }
  else {
    iVar5 = *(int *)(puVar2 + -8);
  }
  if (iVar5 <= iVar3) {
    if (puVar2 == (undefined *)0x0) {
      iVar3 = 0;
    }
    else if (puVar2 == PTR_DAT_1402f8008) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(puVar2 + -8);
    }
  }
  if (((puVar2 != PTR_DAT_1402f8008) && (puVar2 != (undefined *)0x0)) &&
     (piVar1 = (int *)(puVar2 + -8), piVar1 != (int *)0x0)) {
    *piVar1 = iVar3;
    *(undefined1 *)((longlong)iVar3 + 8 + (longlong)piVar1) = 0;
  }
  puVar6 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8008;
  }
  *param_1 = (longlong)puVar6;
  if (puVar2 != puVar6) {
    uVar7 = FUN_1400a3440();
    FUN_1400a1c30(uVar7);
    FUN_14000c2a0(param_1);
    *param_1 = (longlong)puVar2;
    if (((puVar2 != PTR_DAT_1402f8008) && (puVar2 != (undefined *)0x0)) &&
       (puVar2 != (undefined *)0x8)) {
      *(int *)(puVar2 + -4) = *(int *)(puVar2 + -4) + 1;
    }
    FUN_1400d1290(uVar7);
  }
  if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8008)) &&
     (puVar2 + -8 != (undefined *)0x0)) {
    uVar7 = FUN_1400a3440();
    FUN_1400a1c30(uVar7);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2 + -8);
    }
    FUN_1400d1290(uVar7);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

exception * FUN_1400a2320(exception *param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined *puVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  undefined *puVar6;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined1 auStack_928 [32];
  undefined *local_908;
  undefined1 local_900;
  exception *local_8f8;
  undefined8 local_8f0;
  undefined1 *local_8e8;
  undefined1 local_8e0 [136];
  wchar_t local_858 [1040];
  ulonglong local_38;
  
  local_8f0 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_928;
  local_res18 = param_3;
  local_res20 = param_4;
  local_8f8 = param_1;
  std::exception::exception(param_1);
  *(undefined ***)param_1 = Proud::Exception::vftable;
  FUN_1400a3440();
  *(undefined **)(param_1 + 0x40) = PTR_DAT_1402f8008;
  FUN_1400a3440();
  puVar2 = PTR_DAT_1402f8010;
  local_908 = PTR_DAT_1402f8010;
  if (param_2 == (wchar_t *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80070057);
  }
  iVar3 = vswprintf_s(local_858,0x400,param_2,(va_list)&local_res18);
  iVar4 = 0;
  if ((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8010)) {
    iVar4 = *(int *)(puVar2 + -8);
  }
  iVar5 = iVar3;
  if (((iVar3 <= iVar4) && (iVar5 = 0, puVar2 != (undefined *)0x0)) && (puVar2 != PTR_DAT_1402f8010)
     ) {
    iVar5 = *(int *)(puVar2 + -8);
  }
  iVar4 = 1;
  if (1 < iVar5) {
    iVar4 = iVar5;
  }
  iVar5 = 0;
  if ((puVar2 != (undefined *)0x0) && (iVar5 = 0, puVar2 != PTR_DAT_1402f8010)) {
    iVar5 = *(int *)(puVar2 + -8);
  }
  if (iVar5 < iVar4) {
    FUN_140002d50(&local_908);
  }
  FUN_140002e30(&local_908);
  puVar2 = local_908;
  puVar6 = local_908;
  if (local_908 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar6,local_858,iVar3);
  puVar6 = puVar2;
  if (puVar2 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8010;
  }
  iVar3 = FUN_1400a32c0(puVar6);
  iVar4 = 0;
  if (0 < iVar3) {
    iVar4 = iVar3;
  }
  iVar3 = 0;
  if ((puVar2 != (undefined *)0x0) && (iVar3 = 0, puVar2 != PTR_DAT_1402f8010)) {
    iVar3 = *(int *)(puVar2 + -8);
  }
  if ((iVar4 < iVar3) || (iVar4 = 0, puVar2 == (undefined *)0x0)) {
LAB_1400a2492:
    if (puVar2 != PTR_DAT_1402f8010) {
      puVar6 = PTR_DAT_1402f8010;
      if (puVar2 == (undefined *)0x0) goto LAB_1400a24c0;
      if ((int *)(puVar2 + -8) != (int *)0x0) {
        *(int *)(puVar2 + -8) = iVar4;
        *(undefined2 *)(puVar2 + (longlong)iVar4 * 2) = 0;
      }
    }
  }
  else if (puVar2 != PTR_DAT_1402f8010) {
    iVar4 = *(int *)(puVar2 + -8);
    goto LAB_1400a2492;
  }
  puVar6 = PTR_DAT_1402f8010;
  if (puVar2 != (undefined *)0x0) {
    puVar6 = puVar2;
  }
LAB_1400a24c0:
  local_8e8 = local_8e0;
  FUN_1400a1e40(&local_8e8,puVar6,3);
  FUN_1400a2120(param_1 + 0x40,local_8e8);
  if (local_8e8 != local_8e0) {
    free(local_8e8);
  }
  *(undefined4 *)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x38) = 1;
  if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8010)) &&
     (puVar2 + -8 != (undefined *)0x0)) {
    puVar6 = (undefined *)FUN_1400a3440();
    local_908 = puVar6;
    FUN_1400a1c30(puVar6);
    local_900 = 1;
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2 + -8);
    }
    FUN_1400d1290(puVar6);
  }
  return param_1;
}



exception *
FUN_1400a2570(exception *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  std::exception::exception(param_1);
  *(undefined ***)param_1 = Proud::Exception::vftable;
  FUN_1400a3440();
  *(undefined **)(param_1 + 0x40) = PTR_DAT_1402f8008;
  uVar1 = (**(code **)(*param_2 + 8))(param_2);
  FUN_1400a2120(param_1 + 0x40,uVar1,param_3,param_4,uVar2);
  *(longlong **)(param_1 + 0x28) = param_2;
  *(undefined4 *)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x38) = 2;
  return param_1;
}



exception *
FUN_1400a25f0(exception *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong *local_res10;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  std::exception::exception(param_1);
  *(undefined ***)param_1 = Proud::Exception::vftable;
  FUN_1400a3440();
  *(undefined **)(param_1 + 0x40) = PTR_DAT_1402f8008;
  plVar3 = (longlong *)FUN_1400a2090(param_2,&local_res10,param_3,param_4,uVar4);
  puVar1 = (undefined8 *)*plVar3;
  if (puVar1 == (undefined8 *)0x0) {
    uVar4 = 0;
  }
  else {
    if (puVar1[1] == 0) {
      uVar4 = FUN_1400adbb0(*puVar1);
      puVar1[1] = uVar4;
    }
    uVar4 = puVar1[1];
  }
  FUN_1400a2120(param_1 + 0x40,uVar4);
  if (local_res10 != (longlong *)0x0) {
    LOCK();
    plVar3 = local_res10 + 2;
    lVar2 = *plVar3;
    *(int *)plVar3 = (int)*plVar3 + -1;
    UNLOCK();
    if (((int)lVar2 == 1) && (local_res10 != (longlong *)0x0)) {
      if (*local_res10 != 0) {
        Ordinal_6();
      }
      if ((void *)local_res10[1] != (void *)0x0) {
        operator_delete__((void *)local_res10[1]);
      }
      operator_delete(local_res10);
    }
  }
  *(undefined8 *)(param_1 + 0x30) = param_2;
  *(undefined4 *)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x38) = 3;
  return param_1;
}



void FUN_1400a26d0(void)

{
  undefined1 local_58 [88];
  
  FUN_1400a2320(local_58,L"An invalid argument is detected!");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_1400a2700(void)

{
  undefined1 local_58 [88];
  
  FUN_1400a2320(local_58,L"Array index out of range!");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_1400a2730(undefined8 param_1)

{
  undefined1 local_58 [88];
  
  FUN_1400a2320(local_58,L"32bit integer out of range! %s",param_1);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_1400a2760(wchar_t *param_1,rsize_t param_2,wchar_t *param_3,rsize_t param_4)

{
  errno_t eVar1;
  
  eVar1 = wmemcpy_s(param_1,param_2,param_3,param_4);
  if (eVar1 != 0) {
    if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
  }
  return;
}



ushort * FUN_1400a27b0(HMODULE param_1,HRSRC param_2,uint param_3)

{
  DWORD DVar1;
  HGLOBAL hResData;
  ushort *puVar2;
  ushort *puVar3;
  
  hResData = LoadResource(param_1,param_2);
  if (hResData == (HGLOBAL)0x0) {
    return (ushort *)0x0;
  }
  puVar2 = LockResource(hResData);
  if (puVar2 != (ushort *)0x0) {
    DVar1 = SizeofResource(param_1,param_2);
    puVar3 = (ushort *)((ulonglong)DVar1 + (longlong)puVar2);
    for (param_3 = param_3 & 0xf; param_3 != 0; param_3 = param_3 - 1) {
      if (puVar3 <= puVar2) {
        return (ushort *)0x0;
      }
      puVar2 = puVar2 + (ulonglong)*puVar2 + 1;
    }
    if (puVar2 < puVar3) {
      if (*puVar2 == 0) {
        return (ushort *)0x0;
      }
      return puVar2;
    }
  }
  return (ushort *)0x0;
}



HMODULE FUN_1400a2850(uint param_1,WORD param_2)

{
  HMODULE hModule;
  HRSRC pHVar1;
  longlong lVar2;
  int iVar3;
  
  hModule = ATL::CAtlBaseModule::GetHInstanceAt((CAtlBaseModule *)&DAT_1403157e0,0);
  iVar3 = 0;
  while( true ) {
    if (hModule == (HMODULE)0x0) {
      return (HMODULE)0x0;
    }
    iVar3 = iVar3 + 1;
    pHVar1 = FindResourceExW(hModule,(LPCWSTR)0x6,
                             (LPCWSTR)(ulonglong)(ushort)((short)(param_1 >> 4) + 1),param_2);
    if ((pHVar1 != (HRSRC)0x0) && (lVar2 = FUN_1400a27b0(hModule,pHVar1,param_1), lVar2 != 0))
    break;
    hModule = ATL::CAtlBaseModule::GetHInstanceAt((CAtlBaseModule *)&DAT_1403157e0,iVar3);
  }
  return hModule;
}



void FUN_1400a2910(wchar_t *param_1,int param_2,wchar_t *param_3,uint param_4)

{
  wchar_t wVar1;
  errno_t eVar2;
  longlong lVar3;
  wchar_t *pwVar4;
  
  if (param_4 == 0xffffffff) {
    lVar3 = -1;
    pwVar4 = param_3;
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      wVar1 = *pwVar4;
      pwVar4 = pwVar4 + 1;
    } while (wVar1 != L'\0');
    param_4 = ~(uint)lVar3;
  }
  eVar2 = wmemcpy_s(param_1,(longlong)param_2,param_3,(longlong)(int)param_4);
  if (eVar2 != 0) {
    if (eVar2 == 0xc) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    if ((eVar2 == 0x16) || (eVar2 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80070057);
    }
    if (eVar2 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
  }
  return;
}



DWORD FUN_1400a2990(void)

{
  _SYSTEM_INFO local_38;
  
  GetSystemInfo(&local_38);
  return local_38.dwNumberOfProcessors;
}



undefined8 * FUN_1400a29b0(undefined8 *param_1)

{
  HMODULE hModule;
  FARPROC pFVar1;
  undefined1 local_58 [80];
  
  hModule = LoadLibraryA("kernel32.dll");
  param_1[0xc] = hModule;
  if (hModule == (HMODULE)0x0) {
    FUN_1400a2320(local_58,L"Cannot find kernel32.dll handle!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  pFVar1 = GetProcAddress(hModule,"CreateIoCompletionPort");
  *param_1 = pFVar1;
  pFVar1 = GetProcAddress((HMODULE)param_1[0xc],"HeapSetInformation");
  param_1[1] = pFVar1;
  pFVar1 = GetProcAddress((HMODULE)param_1[0xc],"QueueUserWorkItem");
  param_1[2] = pFVar1;
  pFVar1 = GetProcAddress((HMODULE)param_1[0xc],"GetQueuedCompletionStatus");
  param_1[3] = pFVar1;
  pFVar1 = GetProcAddress((HMODULE)param_1[0xc],"GetQueuedCompletionStatusEx");
  param_1[4] = pFVar1;
  pFVar1 = GetProcAddress((HMODULE)param_1[0xc],"AddVectoredExceptionHandler");
  param_1[5] = pFVar1;
  pFVar1 = GetProcAddress((HMODULE)param_1[0xc],"CreateTimerQueue");
  param_1[6] = pFVar1;
  pFVar1 = GetProcAddress((HMODULE)param_1[0xc],"CreateTimerQueueTimer");
  param_1[7] = pFVar1;
  pFVar1 = GetProcAddress((HMODULE)param_1[0xc],"DeleteTimerQueueTimer");
  param_1[8] = pFVar1;
  pFVar1 = GetProcAddress((HMODULE)param_1[0xc],"DeleteTimerQueueEx");
  param_1[9] = pFVar1;
  pFVar1 = GetProcAddress((HMODULE)param_1[0xc],"InitializeCriticalSectionEx");
  param_1[10] = pFVar1;
  pFVar1 = GetProcAddress((HMODULE)param_1[0xc],"GetLogicalProcessorInformation");
  param_1[0xb] = pFVar1;
  return param_1;
}



undefined * FUN_1400a2b00(void)

{
  if ((DAT_140313ee8 & 1) == 0) {
    DAT_140313ee8 = DAT_140313ee8 | 1;
    FUN_1400a29b0(&DAT_140313e80);
  }
  return &DAT_140313e80;
}



void FUN_1400a2b50(wchar_t *param_1)

{
  if (DAT_140313fc8 == 0) {
    OutputDebugStringW(param_1);
                    // WARNING: Could not recover jumptable at 0x0001400a2b80. Too many branches
                    // WARNING: Treating indirect jump as call
    MessageBoxW((HWND)0x0,param_1,L"ProudNet",0x10);
    return;
  }
  if (DAT_140313fc8 == 2) {
                    // WARNING: Could not recover jumptable at 0x0001400a2b91. Too many branches
                    // WARNING: Treating indirect jump as call
    OutputDebugStringW(param_1);
    return;
  }
                    // WARNING: Could not recover jumptable at 0x0001400a2ba7. Too many branches
                    // WARNING: Treating indirect jump as call
  wcscpy_s((wchar_t *)0x0,1000,param_1);
  return;
}



void FUN_1400a2bb0(void)

{
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x8007000e);
}



void FUN_1400a2bc0(longlong *param_1)

{
  int *piVar1;
  int iVar2;
  longlong *plVar3;
  longlong lVar4;
  
  lVar4 = *param_1;
  plVar3 = *(longlong **)(lVar4 + -0x18);
  if (*(int *)(lVar4 + -0x10) != 0) {
    if (*(int *)(lVar4 + -8) < 0) {
      if (*(int *)(lVar4 + -0xc) < 0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80070057);
      }
      *(undefined4 *)(lVar4 + -0x10) = 0;
      *(undefined2 *)*param_1 = 0;
      return;
    }
    LOCK();
    piVar1 = (int *)(lVar4 + -8);
    iVar2 = *piVar1;
    *piVar1 = *piVar1 + -1;
    UNLOCK();
    if (iVar2 + -1 < 1) {
      (**(code **)(**(longlong **)(lVar4 + -0x18) + 8))();
    }
    lVar4 = (**(code **)(*plVar3 + 0x18))(plVar3);
    *param_1 = lVar4 + 0x18;
  }
  return;
}



undefined8 FUN_1400a2c40(void)

{
  HANDLE pvVar1;
  bool bVar2;
  undefined4 local_res8 [8];
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  LOCK();
  bVar2 = DAT_140313f00 == 0;
  if (bVar2) {
    DAT_140313f00 = 1;
  }
  UNLOCK();
  if (bVar2) {
    local_res8[0] = 2;
    if ((DAT_140313ee8 & 1) == 0) {
      DAT_140313ee8 = DAT_140313ee8 | 1;
      FUN_1400a29b0(&DAT_140313e80);
    }
    if (DAT_140313e88 != (code *)0x0) {
      if ((DAT_140313ee8 & 1) == 0) {
        DAT_140313ee8 = DAT_140313ee8 | 1;
        FUN_1400a29b0(&DAT_140313e80);
      }
      pvVar1 = GetProcessHeap();
      (*DAT_140313e88)(pvVar1,0,local_res8,4,uVar3);
    }
  }
  return 1;
}



bool FUN_1400a2ce0(void)

{
  if ((DAT_140313ee8 & 1) == 0) {
    DAT_140313ee8 = DAT_140313ee8 | 1;
    FUN_1400a29b0(&DAT_140313e80);
  }
  return DAT_140313ea0 != 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * FUN_1400a2d20(void)

{
  char cVar1;
  int iVar2;
  char cVar3;
  undefined1 auStack_58 [32];
  undefined *local_38;
  char local_30;
  undefined8 local_28;
  CHAR local_20 [8];
  ulonglong local_18;
  
  local_28 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_58;
  local_38 = &DAT_140313f48;
  local_30 = '\0';
  cVar1 = FUN_1400a1cc0(&DAT_140313f48);
  cVar3 = '\0';
  if ((cVar1 != '\0') && (cVar3 = local_30, DAT_1402f8000 != '\0')) {
    local_30 = '\x01';
    FUN_1400a1c30(&DAT_140313f48);
    cVar3 = '\x01';
  }
  if ((DAT_140313f08 & 1) == 0) {
    DAT_140313f08 = DAT_140313f08 | 1;
    _DAT_140313f04 = 0;
    iVar2 = GetLocaleInfoA(0x800,5,local_20,7);
    if (iVar2 != 0) {
      _DAT_140313f04 = atoi(local_20);
    }
  }
  DAT_1402f8000 = 0;
  if (cVar3 != '\0') {
    FUN_1400d1290(&DAT_140313f48);
  }
  return &DAT_140313f04;
}



void FUN_1400a2e00(undefined8 *param_1,int param_2)

{
  int *piVar1;
  int iVar2;
  void *_Src;
  rsize_t _DstSize;
  undefined8 *puVar3;
  longlong lVar4;
  
  _Src = (void *)*param_1;
  iVar2 = *(int *)((longlong)_Src + -0x10);
  puVar3 = (undefined8 *)(**(code **)(**(longlong **)((longlong)_Src + -0x18) + 0x20))();
  lVar4 = (**(code **)*puVar3)(puVar3,param_2,2);
  if (lVar4 == 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a2bb0();
  }
  if (iVar2 < param_2) {
    param_2 = iVar2;
  }
  _DstSize = (longlong)(param_2 + 1) * 2;
  memcpy_s((void *)(lVar4 + 0x18),_DstSize,_Src,_DstSize);
  *(int *)(lVar4 + 8) = iVar2;
  LOCK();
  piVar1 = (int *)((longlong)_Src + -8);
  iVar2 = *piVar1;
  *piVar1 = *piVar1 + -1;
  UNLOCK();
  if (iVar2 + -1 < 1) {
    (**(code **)(**(longlong **)((longlong)_Src + -0x18) + 8))
              (*(longlong **)((longlong)_Src + -0x18),(longlong)_Src + -0x18);
  }
  *param_1 = (void *)(lVar4 + 0x18);
  return;
}



void FUN_1400a2eb0(longlong *param_1,int param_2)

{
  longlong lVar1;
  
  if ((*(int *)(*param_1 + -0xc) < param_2) && (0 < param_2)) {
    lVar1 = (**(code **)(**(longlong **)(*param_1 + -0x18) + 0x10))();
    if (lVar1 == 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a2bb0();
    }
    *param_1 = lVar1 + 0x18;
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a2bb0();
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * thunk_FUN_1400a2d20(void)

{
  char cVar1;
  int iVar2;
  char cVar3;
  undefined1 auStack_58 [32];
  undefined *puStack_38;
  char cStack_30;
  undefined8 uStack_28;
  CHAR aCStack_20 [8];
  ulonglong uStack_18;
  
  uStack_28 = 0xfffffffffffffffe;
  uStack_18 = DAT_1402f85a0 ^ (ulonglong)auStack_58;
  puStack_38 = &DAT_140313f48;
  cStack_30 = '\0';
  cVar1 = FUN_1400a1cc0(&DAT_140313f48);
  cVar3 = '\0';
  if ((cVar1 != '\0') && (cVar3 = cStack_30, DAT_1402f8000 != '\0')) {
    cStack_30 = '\x01';
    FUN_1400a1c30(&DAT_140313f48);
    cVar3 = '\x01';
  }
  if ((DAT_140313f08 & 1) == 0) {
    DAT_140313f08 = DAT_140313f08 | 1;
    _DAT_140313f04 = 0;
    iVar2 = GetLocaleInfoA(0x800,5,aCStack_20,7);
    if (iVar2 != 0) {
      _DAT_140313f04 = atoi(aCStack_20);
    }
  }
  DAT_1402f8000 = 0;
  if (cVar3 != '\0') {
    FUN_1400d1290(&DAT_140313f48);
  }
  return &DAT_140313f04;
}



void FUN_1400a2f10(longlong *param_1)

{
  int *piVar1;
  int iVar2;
  longlong lVar3;
  
  lVar3 = *param_1;
  LOCK();
  piVar1 = (int *)(lVar3 + -8);
  iVar2 = *piVar1;
  *piVar1 = *piVar1 + -1;
  UNLOCK();
  if (iVar2 + -1 < 1) {
    (**(code **)(**(longlong **)(lVar3 + -0x18) + 8))();
  }
  return;
}



void FUN_1400a2f40(longlong *param_1,int param_2)

{
  longlong lVar1;
  int iVar2;
  
  lVar1 = *param_1;
  if (param_2 < *(int *)(lVar1 + -0x10)) {
    param_2 = *(int *)(lVar1 + -0x10);
  }
  if (1 < *(int *)(lVar1 + -8)) {
    FUN_1400a2e00(param_1,param_2);
    return;
  }
  iVar2 = *(int *)(lVar1 + -0xc);
  if (iVar2 < param_2) {
    if (iVar2 < 0x40000001) {
      iVar2 = iVar2 + iVar2 / 2;
    }
    else {
      iVar2 = iVar2 + 0x100000;
    }
    if (iVar2 < param_2) {
      iVar2 = param_2;
    }
    FUN_1400a2eb0(param_1,iVar2);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001400a2ff9)

undefined8 FUN_1400a2fa0(longlong *param_1,HMODULE param_2,uint param_3)

{
  uint uVar1;
  ushort uVar2;
  HRSRC pHVar3;
  ushort *puVar4;
  uint uVar5;
  
  pHVar3 = FindResourceW(param_2,(LPCWSTR)(ulonglong)(ushort)((short)(param_3 >> 4) + 1),
                         (LPCWSTR)0x6);
  if ((pHVar3 == (HRSRC)0x0) ||
     (puVar4 = (ushort *)FUN_1400a27b0(param_2,pHVar3,param_3), puVar4 == (ushort *)0x0)) {
    return 0;
  }
  uVar2 = *puVar4;
  uVar5 = (uint)uVar2;
  if ((int)(1U - *(int *)(*param_1 + -8) | *(int *)(*param_1 + -0xc) - uVar5) < 0) {
    FUN_1400a2f40(param_1,uVar5);
  }
  FUN_1400a2910(*param_1,uVar5,puVar4 + 1,*puVar4);
  uVar1 = *(uint *)(*param_1 + -0xc);
  if (uVar2 != uVar1 && (int)uVar1 <= (int)uVar5) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80070057);
  }
  *(uint *)(*param_1 + -0x10) = (uint)uVar2;
  *(undefined2 *)(*param_1 + (ulonglong)uVar2 * 2) = 0;
  return 1;
}



void FUN_1400a3080(longlong *param_1,void *param_2,int param_3)

{
  uint uVar1;
  longlong lVar2;
  void *_Dst;
  rsize_t _DstSize;
  rsize_t _MaxCount;
  ulonglong uVar3;
  
  if (param_3 == 0) {
    FUN_1400a2bc0();
    return;
  }
  if (param_2 == (void *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80070057);
  }
  lVar2 = *param_1;
  uVar1 = *(uint *)(lVar2 + -0x10);
  uVar3 = (longlong)param_2 - lVar2 >> 1;
  if (param_3 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80070057);
  }
  if ((int)(1U - *(int *)(lVar2 + -8) | *(int *)(lVar2 + -0xc) - param_3) < 0) {
    FUN_1400a2f40(param_1,param_3);
  }
  _Dst = (void *)*param_1;
  _DstSize = (longlong)*(int *)((longlong)_Dst + -0xc) * 2;
  _MaxCount = (longlong)param_3 * 2;
  if (uVar1 < uVar3) {
    memcpy_s(_Dst,_DstSize,param_2,_MaxCount);
  }
  else {
    memmove_s(_Dst,_DstSize,(void *)((longlong)_Dst + uVar3 * 2),_MaxCount);
  }
  if (param_3 <= *(int *)(*param_1 + -0xc)) {
    *(int *)(*param_1 + -0x10) = param_3;
    *(undefined2 *)(_MaxCount + *param_1) = 0;
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80070057);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1400a3170(undefined8 *param_1)

{
  undefined4 uVar1;
  undefined8 uVar2;
  undefined1 auStack_258 [32];
  undefined4 local_238;
  WCHAR local_228 [264];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_258;
  local_238 = 0;
  GetModuleFileNameW((HMODULE)0x0,local_228,0x104);
  FUN_1400a3440();
  *param_1 = PTR_DAT_1402f8010;
  uVar1 = FUN_1400a32c0(local_228);
  uVar2 = FUN_140002f20(param_1,uVar1);
  FUN_1400a32f0(uVar2,local_228,uVar1);
  FUN_140003000(param_1);
  return param_1;
}



longlong * FUN_1400a3210(longlong *param_1,short *param_2,undefined8 param_3,undefined8 param_4)

{
  short sVar1;
  longlong lVar2;
  int iVar3;
  short *psVar4;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  lVar2 = (**(code **)(PTR_PTR_1402f8508 + 0x18))();
  *param_1 = lVar2 + 0x18;
  if (param_2 == (short *)0x0) {
    iVar3 = 0;
  }
  else {
    if (((ulonglong)param_2 & 0xffffffffffff0000) == 0) {
      lVar2 = FUN_1400a2850((ulonglong)param_2 & 0xffff,0);
      if (lVar2 == 0) {
        return param_1;
      }
      FUN_1400a2fa0(param_1,lVar2,(ulonglong)param_2 & 0xffff);
      return param_1;
    }
    lVar2 = -1;
    psVar4 = param_2;
    do {
      if (lVar2 == 0) break;
      lVar2 = lVar2 + -1;
      sVar1 = *psVar4;
      psVar4 = psVar4 + 1;
    } while (sVar1 != 0);
    iVar3 = ~(uint)lVar2 - 1;
  }
  FUN_1400a3080(param_1,param_2,iVar3,param_4,uVar5);
  return param_1;
}



int FUN_1400a32c0(short *param_1)

{
  short sVar1;
  longlong lVar2;
  
  if (param_1 == (short *)0x0) {
    return 0;
  }
  lVar2 = -1;
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    sVar1 = *param_1;
    param_1 = param_1 + 1;
  } while (sVar1 != 0);
  return ~(uint)lVar2 - 1;
}



void FUN_1400a32f0(void *param_1,void *param_2,int param_3)

{
  memcpy(param_1,param_2,(longlong)(param_3 + 1) * 2);
  return;
}



int FUN_1400a3300(ushort *param_1,longlong param_2)

{
  ushort uVar1;
  ushort uVar2;
  uint uVar3;
  
  param_2 = param_2 - (longlong)param_1;
  do {
    uVar1 = *param_1;
    uVar2 = *(ushort *)((longlong)param_1 + param_2);
    if (uVar1 != uVar2) {
      uVar3 = (uint)(uVar1 < uVar2);
      return (1 - uVar3) - (uint)(uVar3 != 0);
    }
    param_1 = param_1 + 1;
  } while (uVar1 != 0);
  return 0;
}



int __cdecl vswprintf_s(wchar_t *_Dst,size_t _SizeInWords,wchar_t *_Format,va_list _ArgList)

{
  int iVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001400a3320. Too many branches
                    // WARNING: Treating indirect jump as call
  iVar1 = vswprintf_s(_Dst,_SizeInWords,_Format,_ArgList);
  return iVar1;
}



wchar_t * __cdecl wcsstr(wchar_t *_Str,wchar_t *_SubStr)

{
  wchar_t *pwVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001400a3330. Too many branches
                    // WARNING: Treating indirect jump as call
  pwVar1 = wcsstr(_Str,_SubStr);
  return pwVar1;
}



longlong FUN_1400a3340(longlong param_1)

{
  return param_1 + 2;
}



int __cdecl iswspace(wint_t _C)

{
  int iVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001400a3350. Too many branches
                    // WARNING: Treating indirect jump as call
  iVar1 = iswspace(_C);
  return iVar1;
}



int FUN_1400a3360(char *param_1)

{
  char cVar1;
  longlong lVar2;
  
  if (param_1 == (char *)0x0) {
    return 0;
  }
  lVar2 = -1;
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    cVar1 = *param_1;
    param_1 = param_1 + 1;
  } while (cVar1 != '\0');
  return ~(uint)lVar2 - 1;
}



void FUN_1400a3390(void *param_1,void *param_2,int param_3)

{
  memcpy(param_1,param_2,(longlong)param_3);
  *(undefined1 *)((longlong)param_3 + (longlong)param_1) = 0;
  return;
}



int FUN_1400a33c0(byte *param_1,longlong param_2)

{
  byte bVar1;
  uint uVar2;
  
  param_2 = param_2 - (longlong)param_1;
  do {
    bVar1 = *param_1;
    if (bVar1 != param_1[param_2]) {
      uVar2 = (uint)(bVar1 < param_1[param_2]);
      return (1 - uVar2) - (uint)(uVar2 != 0);
    }
    param_1 = param_1 + 1;
  } while (bVar1 != 0);
  return 0;
}



int __cdecl vsprintf_s(char *_DstBuf,size_t _SizeInBytes,char *_Format,va_list _ArgList)

{
  int iVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001400a33e0. Too many branches
                    // WARNING: Treating indirect jump as call
  iVar1 = vsprintf_s(_DstBuf,_SizeInBytes,_Format,_ArgList);
  return iVar1;
}



char * FUN_1400a33f0(char *param_1,size_t param_2)

{
  errno_t eVar1;
  char *pcVar2;
  
  eVar1 = _strupr_s(param_1,param_2);
  pcVar2 = (char *)0x0;
  if (eVar1 == 0) {
    pcVar2 = param_1;
  }
  return pcVar2;
}



char * __cdecl strstr(char *_Str,char *_SubStr)

{
  char *pcVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001400a3410. Too many branches
                    // WARNING: Treating indirect jump as call
  pcVar1 = strstr(_Str,_SubStr);
  return pcVar1;
}



uchar * __cdecl _mbsinc(uchar *_Ptr)

{
  uchar *puVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001400a3420. Too many branches
                    // WARNING: Treating indirect jump as call
  puVar1 = _mbsinc(_Ptr);
  return puVar1;
}



void FUN_1400a3430(char param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001400a3433. Too many branches
                    // WARNING: Treating indirect jump as call
  _ismbcspace((int)param_1);
  return;
}



undefined * FUN_1400a3440(void)

{
  undefined4 uVar1;
  undefined8 in_R9;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  if ((DAT_140313fb8 & 1) == 0) {
    DAT_140313fb8 = DAT_140313fb8 | 1;
    uVar1 = FUN_1401692e0();
    FUN_1400a1b50(&DAT_140313f80,uVar1,1,in_R9,uVar2);
    atexit((_func_5014 *)&LAB_140202850);
  }
  DAT_140313fb0 = 1;
  return &DAT_140313f80;
}



undefined8 * FUN_1400a34a0(undefined8 *param_1)

{
  *param_1 = Proud::CFastHeap::vftable;
  return param_1;
}



void FUN_1400a34b0(undefined8 *param_1)

{
  *param_1 = Proud::CFastHeap::vftable;
  return;
}



void FUN_1400a34c0(SIZE_T param_1)

{
  HANDLE hHeap;
  SIZE_T dwBytes;
  
  dwBytes = 1;
  if (param_1 != 0) {
    dwBytes = param_1;
  }
  hHeap = GetProcessHeap();
                    // WARNING: Could not recover jumptable at 0x0001400a34e5. Too many branches
                    // WARNING: Treating indirect jump as call
  HeapAlloc(hHeap,0,dwBytes);
  return;
}



void FUN_1400a34f0(undefined8 param_1,longlong param_2)

{
  HANDLE pvVar1;
  longlong lVar2;
  
  lVar2 = 1;
  if (param_2 != 0) {
    lVar2 = param_2;
  }
  pvVar1 = GetProcessHeap();
                    // WARNING: Could not recover jumptable at 0x0001400a3524. Too many branches
                    // WARNING: Treating indirect jump as call
  HeapReAlloc(pvVar1,0,param_1,lVar2);
  return;
}



void FUN_1400a3530(LPVOID param_1)

{
  HANDLE hHeap;
  
  hHeap = GetProcessHeap();
                    // WARNING: Could not recover jumptable at 0x0001400a354c. Too many branches
                    // WARNING: Treating indirect jump as call
  HeapFree(hHeap,0,param_1);
  return;
}



undefined8 * FUN_1400a3560(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::CFastHeap::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8
FUN_1400a3590(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  HANDLE hHeap;
  LPVOID pvVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  hHeap = GetProcessHeap();
  pvVar1 = HeapAlloc(hHeap,0,0x80);
  if (pvVar1 == (LPVOID)0x0) {
    uVar2 = 0;
  }
  else {
    uVar2 = FUN_1400a3e40(pvVar1,param_1,param_2,param_4,uVar2);
  }
  return uVar2;
}



double FUN_1400a35f0(void)

{
  return (double)DAT_1402f8098 * DAT_1402f8090;
}



undefined * FUN_1400a3610(void)

{
  return &DAT_140313fd0;
}



undefined8 * FUN_1400a3620(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::CMemoryHeap::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1400a3650(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  *param_1 = Proud::CFastHeapImpl::vftable;
  lVar2 = 0;
  do {
    puVar1 = *(undefined8 **)(lVar2 + param_1[0xd]);
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1,param_3,param_4,uVar3);
    }
    lVar2 = lVar2 + 8;
  } while (lVar2 < 0x400);
  free((void *)param_1[0xd]);
  *(undefined4 *)(param_1 + 8) = 3;
  FUN_1400a34b0(param_1);
  return;
}



void FUN_1400a36d0(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  
  lVar2 = 0;
  do {
    iVar1 = (**(code **)(**(longlong **)(lVar2 + *(longlong *)(param_1 + 0x68)) + 0x18))();
    if (iVar1 != -2) {
      return;
    }
    lVar2 = lVar2 + 8;
  } while (lVar2 < 0x400);
  return;
}



void FUN_1400a3710(longlong param_1)

{
  undefined1 local_58 [88];
  
  if (*(short *)(param_1 + -0x10) != 0x71a) {
    FUN_1400a2320(local_58,L"Not a fastheap allocated block!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  return;
}



void FUN_1400a3750(longlong param_1,SIZE_T param_2)

{
  SIZE_T dwBytes;
  
  dwBytes = 1;
  if (param_2 != 0) {
    dwBytes = param_2;
  }
                    // WARNING: Could not recover jumptable at 0x0001400a3763. Too many branches
                    // WARNING: Treating indirect jump as call
  HeapAlloc(*(HANDLE *)(param_1 + 8),0,dwBytes);
  return;
}



void FUN_1400a3770(longlong param_1,undefined8 param_2,longlong param_3)

{
  longlong lVar1;
  
  lVar1 = 1;
  if (param_3 != 0) {
    lVar1 = param_3;
  }
                    // WARNING: Could not recover jumptable at 0x0001400a3786. Too many branches
                    // WARNING: Treating indirect jump as call
  HeapReAlloc(*(undefined8 *)(param_1 + 8),0,param_2,lVar1);
  return;
}



void FUN_1400a3790(longlong param_1,LPVOID param_2)

{
  if (*(HANDLE *)(param_1 + 8) == (HANDLE)0x0) {
    FUN_1400a2b50(
                 L"CMemoryHeap.Free(): Attempt Free after Heap destruction! Doing Free before WinMain returns in highly recommended. Refer the manual for the resolution."
                 );
    return;
  }
                    // WARNING: Could not recover jumptable at 0x0001400a37aa. Too many branches
                    // WARNING: Treating indirect jump as call
  HeapFree(*(HANDLE *)(param_1 + 8),0,param_2);
  return;
}



undefined8 FUN_1400a37c0(longlong param_1)

{
  HeapValidate(*(HANDLE *)(param_1 + 8),0,(LPCVOID)0x0);
  return 0xfffffffe;
}



undefined8 * FUN_1400a37e0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CMemoryHeapImpl::vftable;
  if (*(char *)(param_1 + 2) != '\0') {
    HeapDestroy((HANDLE)param_1[1]);
    param_1[1] = 0;
  }
  *param_1 = Proud::CMemoryHeap::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_1400a3840(undefined8 param_1,uint param_2)

{
  FUN_1400a3650();
  if ((param_2 & 1) != 0) {
    FUN_1400a3530(param_1);
  }
  return param_1;
}



undefined8 FUN_1400a3870(longlong param_1,longlong param_2)

{
  undefined1 auVar1 [16];
  undefined1 auVar2 [16];
  ulonglong uVar3;
  ulonglong uVar4;
  
  if (param_2 != 0) {
    uVar4 = *(ulonglong *)(param_1 + 0x60) >> 7;
    auVar1._8_8_ = 0;
    auVar1._0_8_ = uVar4;
    auVar2._8_8_ = 0;
    auVar2._0_8_ = param_2 - 1U;
    uVar3 = SUB168(auVar2 / auVar1,0);
    if (0xffffffff < uVar3) {
                    // WARNING: Subroutine does not return
      FUN_1400a2730(L"Proud::CFastHeapImpl::GetAllocByGroundSize",(param_2 - 1U) % uVar4);
    }
    if (uVar3 < 0x80) {
      return *(undefined8 *)
              (*(longlong *)(param_1 + 0x68) + (longlong)SUB164(auVar2 / auVar1,0) * 8);
    }
  }
  return 0;
}



undefined2 * FUN_1400a38d0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined1 auVar2 [16];
  undefined1 auVar3 [16];
  ulonglong uVar4;
  undefined2 *puVar5;
  ulonglong uVar6;
  longlong lVar7;
  undefined1 local_58 [80];
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (*(int *)(param_1 + 0x40) != 2) {
    FUN_1400a2b50(L"CFastHeapImpl.Alloc() is called after the allocator is already disposed!");
    return (undefined2 *)0x0;
  }
  uVar6 = *(ulonglong *)(param_1 + 0x60) >> 7;
  lVar7 = ((param_2 - 1U) / uVar6 + 1) * uVar6;
  if (lVar7 != 0) {
    auVar2._8_8_ = 0;
    auVar2._0_8_ = uVar6;
    auVar3._8_8_ = 0;
    auVar3._0_8_ = lVar7 - 1U;
    uVar4 = SUB168(auVar3 / auVar2,0);
    if (0xffffffff < uVar4) {
                    // WARNING: Subroutine does not return
      FUN_1400a2730(L"Proud::CFastHeapImpl::GetAllocByGroundSize",(lVar7 - 1U) % uVar6);
    }
    if ((uVar4 < 0x80) &&
       (plVar1 = *(longlong **)
                  (*(longlong *)(param_1 + 0x68) + (longlong)SUB164(auVar3 / auVar2,0) * 8),
       plVar1 != (longlong *)0x0)) {
      puVar5 = (undefined2 *)(**(code **)(*plVar1 + 8))(plVar1,lVar7 + 0x10);
      goto LAB_1400a3962;
    }
  }
  puVar5 = (undefined2 *)
           (**(code **)**(undefined8 **)(param_1 + 0x48))
                     (*(undefined8 **)(param_1 + 0x48),lVar7 + 0x10);
  if (puVar5 == (undefined2 *)0x0) {
    FUN_1400a2320(local_58,L"CRT malloc returned NULL at %s!",L"Proud::CFastHeapImpl::Alloc");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
LAB_1400a3962:
  *(longlong *)(puVar5 + 4) = lVar7;
  *puVar5 = 0x71a;
  return puVar5 + 8;
}



short * FUN_1400a39c0(longlong *param_1,longlong param_2,ulonglong param_3)

{
  undefined1 auVar1 [16];
  undefined1 auVar2 [16];
  ulonglong uVar3;
  ulonglong uVar4;
  longlong *plVar5;
  short *psVar6;
  short *psVar7;
  longlong lVar8;
  ulonglong uVar9;
  longlong *plVar10;
  ulonglong uVar11;
  undefined1 local_68 [80];
  
  if ((int)param_1[8] != 2) {
    FUN_1400a2b50(L"CFastHeapImpl::Realloc() is called after the allocator is already disposed!");
    return (short *)0x0;
  }
  if (param_3 == 0) {
    (**(code **)(*param_1 + 0x18))();
    return (short *)0x0;
  }
  if ((param_2 == 0) || (psVar6 = (short *)(param_2 + -0x10), *psVar6 != 0x71a)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  uVar9 = (ulonglong)param_1[0xc] >> 7;
  uVar11 = ((param_3 - 1) / uVar9 + 1) * uVar9;
  if (*(longlong *)(param_2 + -8) == 0) {
LAB_1400a3a88:
    plVar10 = (longlong *)0x0;
  }
  else {
    uVar3 = *(longlong *)(param_2 + -8) - 1;
    auVar1._8_8_ = 0;
    auVar1._0_8_ = uVar9;
    auVar2._8_8_ = 0;
    auVar2._0_8_ = uVar3;
    uVar4 = SUB168(auVar2 / auVar1,0);
    if (0xffffffff < uVar4) {
                    // WARNING: Subroutine does not return
      FUN_1400a2730(L"Proud::CFastHeapImpl::GetAllocByGroundSize",uVar3 % uVar9);
    }
    if (0x7f < uVar4) goto LAB_1400a3a88;
    plVar10 = *(longlong **)(param_1[0xd] + (longlong)SUB164(auVar2 / auVar1,0) * 8);
  }
  plVar5 = (longlong *)FUN_1400a3870(param_1,uVar11);
  if (plVar10 == (longlong *)0x0) {
    if (plVar5 == (longlong *)0x0) {
      psVar6 = (short *)(**(code **)(*(longlong *)param_1[9] + 8))
                                  ((longlong *)param_1[9],psVar6,param_3 + 0x10);
      *(ulonglong *)(psVar6 + 4) = uVar11;
      goto LAB_1400a3b9d;
    }
    psVar7 = (short *)(**(code **)(*plVar5 + 8))(plVar5,uVar11 + 0x10);
    uVar9 = uVar11;
    if (*(ulonglong *)(param_2 + -8) < uVar11) {
      uVar9 = *(ulonglong *)(param_2 + -8);
    }
    FUN_1400224d0(psVar7,psVar6,uVar9 + 0x10);
    *(ulonglong *)(psVar7 + 4) = uVar11;
    plVar10 = (longlong *)param_1[9];
    lVar8 = *plVar10;
  }
  else {
    if (plVar5 == (longlong *)0x0) {
      psVar7 = (short *)(*(code *)**(undefined8 **)param_1[9])
                                  ((undefined8 *)param_1[9],param_3 + 0x10);
      if (psVar7 == (short *)0x0) {
        FUN_1400a2320(local_68,L"CRT malloc returned NULL at %s!",L"Proud::CFastHeapImpl::Realloc");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_68,(ThrowInfo *)&DAT_1402f4860);
      }
      if (*(ulonglong *)(param_2 + -8) < param_3) {
        param_3 = *(ulonglong *)(param_2 + -8);
      }
    }
    else {
      if (plVar10 == plVar5) goto LAB_1400a3b9d;
      psVar7 = (short *)(**(code **)(*plVar5 + 8))(plVar5,uVar11 + 0x10);
      param_3 = uVar11;
      if (*(ulonglong *)(param_2 + -8) < uVar11) {
        param_3 = *(ulonglong *)(param_2 + -8);
      }
    }
    FUN_1400224d0(psVar7,psVar6,param_3 + 0x10);
    *(ulonglong *)(psVar7 + 4) = uVar11;
    lVar8 = *plVar10;
  }
  (**(code **)(lVar8 + 0x10))(plVar10,psVar6);
  psVar6 = psVar7;
LAB_1400a3b9d:
  return psVar6 + 8;
}



void FUN_1400a3bd0(longlong param_1,longlong param_2)

{
  short *psVar1;
  undefined1 auVar2 [16];
  undefined1 auVar3 [16];
  ulonglong uVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  longlong *plVar7;
  undefined1 local_58 [88];
  
  if (*(int *)(param_1 + 0x40) != 2) {
    FUN_1400a2b50(
                 L"CFastHeap.Free(): Attempt Free after Heap destruction! Doing Free before WinMain returns in highly recommended. Refer the manual for the resolution."
                 );
    return;
  }
  if ((param_2 == 0) || (psVar1 = (short *)(param_2 + -0x10), *psVar1 != 0x71a)) {
    FUN_1400a2320(local_58,
                  L"Not CFastHeap-allocated block! Refer to ProudNet help \'ProudNet Technical Note\' for more help."
                 );
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  *psVar1 = 0xb0c;
  if (*(longlong *)(param_2 + -8) != 0) {
    uVar6 = *(ulonglong *)(param_1 + 0x60) >> 7;
    uVar4 = *(longlong *)(param_2 + -8) - 1;
    auVar2._8_8_ = 0;
    auVar2._0_8_ = uVar6;
    auVar3._8_8_ = 0;
    auVar3._0_8_ = uVar4;
    uVar5 = SUB168(auVar3 / auVar2,0);
    if (0xffffffff < uVar5) {
                    // WARNING: Subroutine does not return
      FUN_1400a2730(L"Proud::CFastHeapImpl::GetAllocByGroundSize",uVar4 % uVar6);
    }
    if ((uVar5 < 0x80) &&
       (plVar7 = *(longlong **)
                  (*(longlong *)(param_1 + 0x68) + (longlong)SUB164(auVar3 / auVar2,0) * 8),
       plVar7 != (longlong *)0x0)) goto LAB_1400a3c58;
  }
  plVar7 = *(longlong **)(param_1 + 0x48);
LAB_1400a3c58:
                    // WARNING: Could not recover jumptable at 0x0001400a3c62. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*plVar7 + 0x10))(plVar7,psVar1);
  return;
}



undefined8 * FUN_1400a3c90(undefined1 param_1)

{
  undefined4 uVar1;
  undefined8 *puVar2;
  HANDLE pvVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined4 local_res8 [2];
  undefined *local_res10;
  
  puVar2 = operator_new(0x18);
  if (puVar2 == (undefined8 *)0x0) {
    puVar2 = (undefined8 *)0x0;
  }
  else {
    *puVar2 = Proud::CMemoryHeapImpl::vftable;
  }
  pvVar3 = HeapCreate(4,0,0);
  puVar2[1] = pvVar3;
  if (pvVar3 == (HANDLE)0x0) {
    FUN_1400a3440();
    local_res10 = PTR_DAT_1402f8010;
    uVar1 = FUN_1400a32c0(L"FATAL: HeapCreate failed!");
    uVar4 = FUN_140002f20(&local_res10,uVar1);
    FUN_1400a32f0(uVar4,L"FATAL: HeapCreate failed!",uVar1);
    FUN_140003000(&local_res10);
    FUN_1400a6370(&local_res10);
  }
  local_res8[0] = 2;
  lVar5 = FUN_1400a2b00();
  if (*(longlong *)(lVar5 + 8) != 0) {
    lVar5 = FUN_1400a2b00();
    (**(code **)(lVar5 + 8))(puVar2[1],0,local_res8,4);
  }
  *(undefined1 *)(puVar2 + 2) = param_1;
  return puVar2;
}



undefined8 * FUN_1400a3d70(void)

{
  bool bVar1;
  char cVar2;
  
  bVar1 = false;
  cVar2 = FUN_1400a1cc0(&DAT_140314030);
  if (cVar2 != '\0') {
    if (DAT_1402f8280 == '\0') {
      bVar1 = false;
    }
    else {
      bVar1 = true;
      FUN_1400a1c30(&DAT_140314030);
    }
  }
  if ((DAT_140314028 & 1) == 0) {
    DAT_140314028 = DAT_140314028 | 1;
    DAT_140314020 = FUN_1400a3c90(1);
    atexit(FUN_140202870);
  }
  DAT_1402f8280 = 0;
  if (bVar1) {
    FUN_1400d1290(&DAT_140314030);
  }
  return &DAT_140314020;
}



undefined8 FUN_1400a3e20(void)

{
  undefined8 *puVar1;
  
  puVar1 = (undefined8 *)FUN_1400a3d70();
  return *puVar1;
}



undefined8 * FUN_1400a3e40(undefined8 *param_1,ulonglong param_2,undefined8 param_3)

{
  undefined8 *puVar1;
  void *pvVar2;
  undefined8 uVar3;
  longlong lVar4;
  undefined1 local_a0 [72];
  undefined1 local_58 [80];
  
  FUN_1400a34a0();
  *param_1 = Proud::CFastHeapImpl::vftable;
  FUN_1400a6440(param_1 + 9);
  FUN_1400a3d70();
  if (param_2 < 0x80) {
    FUN_1400a2320(local_a0,L"bad AccelBlockSizeLimit value");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1402f4860);
  }
  if (param_1[9] == 0) {
    puVar1 = (undefined8 *)FUN_1400a3d70();
    param_1[9] = *puVar1;
  }
  param_1[0xc] = param_2;
  pvVar2 = malloc(0x400);
  param_1[0xd] = pvVar2;
  if (pvVar2 == (void *)0x0) {
    FUN_1400a2320(local_58,L"Cannot allocate FastHeap buckets! FATAL!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  lVar4 = 0;
  do {
    uVar3 = FUN_1400a63b0(param_3);
    *(undefined8 *)(lVar4 + param_1[0xd]) = uVar3;
    lVar4 = lVar4 + 8;
  } while (lVar4 < 0x400);
  *(undefined4 *)(param_1 + 8) = 2;
  return param_1;
}



void FUN_1400a3f50(char *param_1,size_t param_2)

{
  errno_t eVar1;
  
  eVar1 = _strlwr_s(param_1,param_2);
  if (eVar1 != 0) {
    if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
  }
  return;
}



void FUN_1400a3fa0(ulong param_1,char *param_2,size_t param_3,int param_4)

{
  errno_t eVar1;
  
  eVar1 = _ultoa_s(param_1,param_2,param_3,param_4);
  if (eVar1 != 0) {
    if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
  }
  return;
}



void FUN_1400a3ff0(undefined8 *param_1)

{
  *param_1 = Proud::IFastSocketDelegate::vftable;
  return;
}



void FUN_1400a4000(LPCWSTR param_1,int param_2,LPSTR param_3,int param_4)

{
  WideCharToMultiByte(0xfde9,0,param_1,param_2,param_3,param_4,(LPCSTR)0x0,(LPBOOL)0x0);
  return;
}



undefined8 FUN_1400a4040(byte param_1)

{
  switch(param_1) {
  case 0x20:
  case 0x22:
  case 0x23:
  case 0x24:
  case 0x25:
  case 0x26:
  case 0x2b:
  case 0x2c:
  case 0x3b:
  case 0x3c:
  case 0x3d:
  case 0x3e:
  case 0x3f:
  case 0x40:
  case 0x5b:
  case 0x5c:
  case 0x5d:
  case 0x5e:
  case 0x60:
  case 0x7b:
  case 0x7c:
  case 0x7d:
    break;
  default:
    if ((0x1f < param_1) && (param_1 < 0x7f)) {
      return 0;
    }
  }
  return 1;
}



undefined8
FUN_1400a40f0(longlong *param_1,char *param_2,uint param_3,undefined8 *param_4,uint *param_5,
             uint param_6,int param_7)

{
  char cVar1;
  longlong lVar2;
  uint uVar3;
  char *pcVar4;
  longlong lVar5;
  uint uVar6;
  uint uVar7;
  char *pcVar8;
  longlong lVar9;
  undefined8 uVar10;
  
  if (param_1 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if (param_2 == (char *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if (param_4 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if (param_5 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  lVar9 = *param_1;
  pcVar8 = (char *)*param_4;
  uVar10 = 0;
  if ((*param_2 != '/') && (*param_2 != '\\')) goto LAB_1400a41f9;
  cVar1 = *pcVar8;
  if ((cVar1 == '/') || (cVar1 == '\\')) {
    pcVar4 = pcVar8 + 1;
  }
  else {
    if ((cVar1 != '.') ||
       (((cVar1 = pcVar8[1], cVar1 != '/' && (cVar1 != '\\')) && (cVar1 != '\0'))))
    goto LAB_1400a41f9;
    lVar9 = lVar9 + -1;
    uVar7 = 0;
    lVar5 = lVar9;
    uVar6 = param_3 - 1;
    do {
      uVar3 = uVar6;
      lVar2 = lVar5;
      if (uVar3 == 0) goto LAB_1400a41e0;
      uVar7 = uVar3 - 1;
    } while ((*(char *)(lVar2 + -1) != '/') &&
            (lVar5 = lVar2 + -1, uVar6 = uVar7, *(char *)(lVar2 + -1) != '\\'));
    if (((-1 < (char)param_6) || (((param_6 >> 8 & 1) != 0 || (param_7 == 0)))) ||
       (param_7 + 1U < uVar7)) {
      uVar10 = 1;
      lVar9 = lVar2;
      param_3 = uVar3;
    }
LAB_1400a41e0:
    pcVar4 = pcVar8 + 2;
    if (param_3 != uVar7 + 1) {
      lVar9 = lVar9 + 1;
      goto LAB_1400a41f9;
    }
  }
  pcVar8 = pcVar4;
  uVar10 = 1;
LAB_1400a41f9:
  *param_1 = lVar9;
  *param_4 = pcVar8;
  *param_5 = param_3;
  return uVar10;
}



int FUN_1400a4220(byte *param_1,byte *param_2,int *param_3,uint param_4,uint param_5)

{
  short sVar1;
  int iVar2;
  byte *pbVar3;
  byte bVar4;
  short sVar5;
  uint uVar6;
  size_t _MaxCount;
  uint uVar7;
  size_t sVar8;
  byte *pbVar9;
  int iVar10;
  size_t sVar11;
  byte *local_res8;
  byte *local_res10;
  int *local_res18;
  uint local_58;
  uint local_54;
  byte *local_50;
  byte *local_48;
  
  local_res10 = param_2;
  local_res18 = param_3;
  if (param_1 == (byte *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if (param_2 == (byte *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if (param_1 == param_2) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  _MaxCount = 0;
  bVar4 = *param_1;
  local_50 = param_2 + param_4;
  uVar6 = 0;
  local_58 = 0;
  iVar2 = 1;
  iVar10 = 1;
  local_54 = 0;
  sVar8 = _MaxCount;
  sVar11 = _MaxCount;
  local_48 = param_2;
  if (bVar4 != 0) {
    do {
      uVar7 = (uint)sVar8;
      pbVar9 = param_1 + 1;
      uVar6 = (uint)_MaxCount;
      iVar2 = 0;
      if (uVar6 == param_4) {
        iVar10 = iVar2;
      }
      local_res8 = pbVar9;
      if (bVar4 == 0x3a) {
        if ((char)param_5 < '\0') {
          if ((int)sVar11 == 0) {
            if (iVar10 != 0) {
              *param_2 = (byte)sVar11;
              pbVar3 = param_2 + -_MaxCount;
              if ((pbVar3 < local_48) || (local_50 < pbVar3)) {
                    // WARNING: Subroutine does not return
                FUN_14000c6c0(0x80004005);
              }
              FUN_1400a3f50(pbVar3,local_50 + (1 - (longlong)pbVar3));
              uVar7 = local_54;
              if (uVar6 == 4) {
                iVar2 = strncmp("file",(char *)(param_2 + -4),_MaxCount);
                sVar11 = 5;
                uVar7 = local_54;
                if (iVar2 == 0) {
                  local_54 = 1;
                  uVar7 = 1;
                }
                goto LAB_1400a4439;
              }
            }
            sVar11 = (size_t)(uVar6 + 1);
          }
          goto LAB_1400a4439;
        }
LAB_1400a44c5:
        iVar2 = FUN_1400a4040(bVar4);
        if ((((iVar2 == 0) || ((param_5 & 2) != 0)) ||
            ((((param_5 & 0x10) != 0 && (bVar4 != 0x20)) ||
             (((param_5 & 8) != 0 && (bVar4 == 0x2e)))))) ||
           (((param_5 & 0x40) == 0 && (bVar4 == 0x25)))) {
          if (iVar10 != 0) {
            *param_2 = bVar4;
            param_2 = param_2 + 1;
            local_res10 = param_2;
          }
        }
        else if (uVar6 < param_4 - 3) {
          if (iVar10 != 0) {
            *param_2 = 0x25;
            pbVar3 = param_2 + 1;
            if (bVar4 < 0x10) {
              *pbVar3 = 0x30;
              pbVar3 = param_2 + 2;
            }
            FUN_1400a3fa0(bVar4,pbVar3,(longlong)local_50 - (longlong)pbVar3,0x10);
            param_2 = param_2 + 3;
            local_res10 = param_2;
          }
          uVar6 = uVar6 + 2;
        }
        else {
          iVar10 = 0;
          uVar6 = uVar6 + 2;
        }
        local_58 = uVar6 + 1;
        local_res8 = pbVar9;
      }
      else {
        if (bVar4 == 0x25) {
          if ((param_5 & 4) != 0) {
            bVar4 = *pbVar9;
            if (bVar4 == 0) goto LAB_1400a45d5;
            param_3 = local_res18;
            if ((byte)(bVar4 - 0x30) < 10) {
              sVar5 = bVar4 - 0x30;
            }
            else if ((byte)(bVar4 + 0xbf) < 6) {
              sVar5 = bVar4 - 0x37;
            }
            else {
              if (5 < (byte)(bVar4 + 0x9f)) goto LAB_1400a4594;
              sVar5 = bVar4 - 0x57;
            }
            if (sVar5 < 0) goto LAB_1400a4594;
            bVar4 = param_1[2];
            if (bVar4 == 0) goto LAB_1400a45d5;
            pbVar9 = param_1 + 3;
            if ((byte)(bVar4 - 0x30) < 10) {
              sVar1 = bVar4 - 0x30;
            }
            else if ((byte)(bVar4 + 0xbf) < 6) {
              sVar1 = bVar4 - 0x37;
            }
            else {
              if (5 < (byte)(bVar4 + 0x9f)) goto LAB_1400a4594;
              sVar1 = bVar4 - 0x57;
            }
            if (sVar1 < 0) goto LAB_1400a4594;
            bVar4 = (char)sVar5 * '\x10' + (char)sVar1;
            local_res8 = pbVar9;
          }
        }
        else if (((bVar4 == 0x3f) || (bVar4 == 0x23)) && ((param_5 & 0x20) != 0)) {
          param_5 = param_5 | 2;
        }
LAB_1400a4439:
        if ((-1 < (char)param_5) || ((param_5 & 2) != 0)) goto LAB_1400a44c5;
        if (bVar4 == 0x5c) {
          if ((((int)sVar11 != 0) || ((param_5 >> 8 & 1) != 0)) &&
             ((iVar10 != 0 && ((uVar7 == 0 || (uVar6 < 7)))))) {
            bVar4 = 0x2f;
          }
          goto LAB_1400a44c5;
        }
        if ((((bVar4 != 0x2e) || (uVar6 == 0)) || ((param_5 & 8) != 0)) ||
           (iVar2 = FUN_1400a40f0(&local_res10,param_2 + -1,_MaxCount,&local_res8,&local_58,param_5,
                                  (int)sVar11), param_2 = local_res10, pbVar9 = local_res8,
           uVar6 = local_58, iVar2 == 0)) goto LAB_1400a44c5;
      }
      _MaxCount = (size_t)local_58;
      bVar4 = *local_res8;
      uVar6 = local_58;
      if (bVar4 == 0) goto LAB_1400a45d5;
      sVar8 = (size_t)local_54;
      param_1 = local_res8;
    } while( true );
  }
LAB_1400a45e2:
  if (uVar6 < param_4) {
    *param_2 = 0;
  }
LAB_1400a4594:
  if (param_3 != (int *)0x0) {
    *param_3 = uVar6 + 1;
  }
  if (param_4 < uVar6 + 1) {
    iVar2 = 0;
  }
  return iVar2;
LAB_1400a45d5:
  iVar2 = iVar10;
  param_3 = local_res18;
  if (iVar2 == 0) goto LAB_1400a4594;
  goto LAB_1400a45e2;
}



undefined8 FUN_1400a45f0(longlong param_1,wchar_t *param_2)

{
  errno_t eVar1;
  size_t sVar2;
  
  sVar2 = wcsnlen(param_2,0x801);
  if (0x800 < (uint)sVar2) {
    return 0;
  }
  eVar1 = wcsncpy_s((wchar_t *)(param_1 + 0x448),0x801,param_2,sVar2 & 0xffffffff);
  if (eVar1 != 0) {
    if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
  }
  *(uint *)(param_1 + 0x2464) = (uint)sVar2;
  return 1;
}



void FUN_1400a46a0(undefined2 *param_1)

{
  *(undefined4 *)(param_1 + 0x1228) = 0xffffffff;
  param_1[0x1226] = 0;
  *(undefined8 *)(param_1 + 0x122a) = 0;
  *(undefined4 *)(param_1 + 0x122e) = 0;
  *(undefined8 *)(param_1 + 0x1230) = 0;
  *(undefined4 *)(param_1 + 0x1234) = 0;
  *param_1 = 0;
  param_1[0x21] = 0;
  param_1[0x122] = 0;
  param_1[0x1a3] = 0;
  param_1[0x224] = 0;
  param_1[0xa25] = 0;
  return;
}



undefined8 * FUN_1400a4700(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::IFastSocketDelegate::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1400a4730(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  undefined8 local_30;
  undefined **local_28;
  undefined4 local_20;
  undefined2 local_1c;
  undefined4 local_18;
  
  uVar4 = 0xfffffffffffffffe;
  lVar3 = param_1 + 0x30;
  lVar2 = lVar3;
  FUN_1400a1c30(lVar3);
  uVar5 = 1;
  *(undefined1 *)(param_1 + 0x80) = 1;
  FUN_1400aaa10(param_1 + 0x88);
  if ((*(longlong **)(param_1 + 0x10) != (longlong *)0x0) && (**(longlong **)(param_1 + 0x10) != 0))
  {
    FUN_1400a88b0();
    lVar3 = lVar2;
    while( true ) {
      local_28 = Proud::AddrPort::vftable;
      local_18 = 0;
      local_30 = 0;
      local_20 = DAT_1402f83d0;
      local_1c = DAT_1402f83d4;
      lVar2 = 0;
      if (*(longlong **)(param_1 + 0x10) != (longlong *)0x0) {
        lVar2 = **(longlong **)(param_1 + 0x10);
      }
      if (*(char *)(lVar2 + 0x280) == '\0') break;
      lVar2 = 0;
      if (*(longlong **)(param_1 + 0x10) != (longlong *)0x0) {
        lVar2 = **(longlong **)(param_1 + 0x10);
      }
      cVar1 = FUN_1400a87e0(lVar2,0,&local_30,param_4,uVar4,lVar3,uVar5);
      if ((cVar1 != '\0') || (DAT_1403142d0 != '\0')) break;
      Sleep(10);
    }
  }
  FUN_1400d1290(lVar3);
  return;
}



void FUN_1400a4840(undefined8 *param_1)

{
  free((void *)*param_1);
  *param_1 = 0;
  return;
}



wchar_t * FUN_1400a4860(wchar_t *param_1)

{
  errno_t eVar1;
  
  FUN_1400a46a0();
  param_1[0x1228] = L'\x02';
  param_1[0x1229] = L'\0';
  param_1[0x122a] = L'\x04';
  param_1[0x122b] = L'\0';
  param_1[0x1226] = L'P';
  eVar1 = wcsncpy_s(param_1,0x21,L"http",4);
  if (eVar1 != 0) {
    if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
  }
  return param_1;
}



void FUN_1400a48f0(longlong param_1)

{
  undefined8 uVar1;
  undefined *puVar2;
  int iVar3;
  
  puVar2 = *(undefined **)(param_1 + 0x20);
  uVar1 = 0;
  iVar3 = 0;
  if ((puVar2 != (undefined *)0x0) && (iVar3 = 0, puVar2 != PTR_DAT_1402f8008)) {
    iVar3 = *(int *)(puVar2 + -8);
  }
  if (puVar2 == (undefined *)0x0) {
    puVar2 = PTR_DAT_1402f8008;
  }
  if (*(undefined8 **)(param_1 + 0x10) != (undefined8 *)0x0) {
    uVar1 = **(undefined8 **)(param_1 + 0x10);
  }
  FUN_1400a9a10(uVar1,puVar2 + *(int *)(param_1 + 0x28),(iVar3 - *(int *)(param_1 + 0x28)) + 1);
  return;
}



void FUN_1400a4940(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_1400031d0(param_3);
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_1400a4950(short *param_1,undefined2 *param_2,undefined4 *param_3,uint param_4,
                 undefined4 param_5)

{
  short sVar1;
  undefined1 *_Memory;
  undefined1 *_Memory_00;
  int iVar2;
  int iVar3;
  undefined1 *puVar4;
  undefined1 *puVar5;
  ulonglong uVar6;
  uint uVar7;
  short *psVar8;
  undefined1 auStack_1218 [32];
  undefined4 local_11f8;
  uint local_11e8;
  undefined4 local_11e4;
  undefined1 *local_11e0;
  undefined1 *local_11d8;
  undefined4 *local_11d0;
  undefined8 local_11c8;
  undefined1 *local_11b8;
  undefined1 local_11b0 [264];
  undefined1 local_10a8 [2096];
  undefined1 local_878 [2096];
  ulonglong local_48;
  undefined8 uStack_40;
  
  uStack_40 = 0x1400a4966;
  local_11c8 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_1218;
  iVar3 = 0;
  local_11e8 = param_4;
  local_11d0 = param_3;
  if (param_1 == (short *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if (param_2 == (undefined2 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  uVar6 = 0xffffffffffffffff;
  psVar8 = param_1;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    sVar1 = *psVar8;
    psVar8 = psVar8 + 1;
  } while (sVar1 != 0);
  local_11e0 = (undefined1 *)(~uVar6 - 1);
  if ((int)local_11e0 == 0) {
    if (param_3 != (undefined4 *)0x0) {
      *param_3 = 1;
    }
    *param_2 = 0;
    iVar3 = 1;
  }
  else {
    iVar2 = FUN_1400a4000(param_1,(ulonglong)local_11e0 & 0xffffffff,0,0);
    if (iVar2 != 0) {
      uVar7 = iVar2 + 1;
      local_11d8 = (undefined1 *)0x0;
      puVar4 = local_10a8;
      if ((int)uVar7 < 1) {
        free((void *)0x0);
        iVar3 = 0;
      }
      else if ((uVar7 < 0x825) ||
              (puVar4 = malloc((longlong)(int)uVar7), local_11d8 = puVar4,
              puVar4 != (undefined1 *)0x0)) {
        _Memory_00 = local_11d8;
        iVar3 = FUN_1400a4000(param_1,(ulonglong)local_11e0 & 0xffffffff,puVar4,uVar7);
        puVar4[iVar3] = 0;
        puVar5 = local_878;
        local_11e0 = (undefined1 *)0x0;
        if ((local_11e8 < 0x825) ||
           (puVar5 = malloc((ulonglong)local_11e8), local_11e0 = puVar5, puVar5 != (undefined1 *)0x0
           )) {
          _Memory = local_11e0;
          local_11e4 = 0;
          local_11f8 = param_5;
          iVar3 = FUN_1400a4220(puVar4,puVar5,&local_11e4,local_11e8);
          if (iVar3 != 0) {
            local_11b8 = local_11b0;
            FUN_14008a6c0(&local_11b8,puVar5,3);
            FUN_1400a2760(param_2,local_11e8,local_11b8,local_11e4);
            if (local_11b8 != local_11b0) {
              free(local_11b8);
            }
          }
          if (param_3 != (undefined4 *)0x0) {
            *param_3 = local_11e4;
          }
          free(_Memory);
          free(_Memory_00);
        }
        else {
          free((void *)0x0);
          free(_Memory_00);
          iVar3 = 0;
        }
      }
      else {
        free((void *)0x0);
        iVar3 = 0;
      }
    }
  }
  return iVar3;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400a4ba0(wchar_t *param_1,uint param_2)

{
  wchar_t *_Src;
  errno_t eVar1;
  int iVar2;
  undefined1 auStack_1098 [32];
  uint local_1078;
  wchar_t local_1068;
  undefined1 local_1066 [4174];
  ulonglong local_18;
  undefined8 uStack_10;
  
  uStack_10 = 0x1400a4bb0;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_1098;
  eVar1 = _wcslwr_s(param_1,0x21);
  if (eVar1 != 0) {
    if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
  }
  eVar1 = wcscpy_s(&local_1068,0x824,param_1 + 0x122);
  if (eVar1 != 0) {
    if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
  }
  local_1078 = param_2;
  iVar2 = FUN_1400a4950(&local_1068,param_1 + 0x122,param_1 + 0x122e,0x80);
  if (iVar2 != 0) {
    *(int *)(param_1 + 0x122e) = *(int *)(param_1 + 0x122e) + -1;
    eVar1 = wcscpy_s(&local_1068,0x824,param_1 + 0x1a3);
    if (eVar1 != 0) {
      if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x8007000e);
      }
      if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80070057);
      }
      if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
    }
    local_1078 = param_2;
    iVar2 = FUN_1400a4950(&local_1068,param_1 + 0x1a3,param_1 + 0x1230,0x80);
    if (iVar2 != 0) {
      *(int *)(param_1 + 0x1230) = *(int *)(param_1 + 0x1230) + -1;
      eVar1 = wcscpy_s(&local_1068,0x824,param_1 + 0x21);
      if (eVar1 != 0) {
        if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
          FUN_14000c6c0(0x8007000e);
        }
        if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
          FUN_14000c6c0(0x80070057);
        }
        if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
          FUN_14000c6c0(0x80004005);
        }
      }
      local_1078 = param_2;
      iVar2 = FUN_1400a4950(&local_1068,param_1 + 0x21,param_1 + 0x122c,0x100);
      if (iVar2 != 0) {
        *(int *)(param_1 + 0x122c) = *(int *)(param_1 + 0x122c) + -1;
        eVar1 = wcscpy_s(&local_1068,0x824,param_1 + 0x224);
        if (eVar1 != 0) {
          if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
            FUN_14000c6c0(0x8007000e);
          }
          if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
            FUN_14000c6c0(0x80070057);
          }
          if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
            FUN_14000c6c0(0x80004005);
          }
        }
        local_1078 = param_2;
        iVar2 = FUN_1400a4950(&local_1068,param_1 + 0x224,param_1 + 0x1232,0x800);
        if ((((iVar2 != 0) &&
             (*(int *)(param_1 + 0x1232) = *(int *)(param_1 + 0x1232) + -1, (param_2 & 0x20) == 0))
            && (_Src = param_1 + 0xa25, _Src != (wchar_t *)0x0)) && (*_Src != L'\0')) {
          eVar1 = wcscpy_s(&local_1068,0x824,_Src);
          if (eVar1 != 0) {
            if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
              FUN_14000c6c0(0x8007000e);
            }
            if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
              FUN_14000c6c0(0x80070057);
            }
            if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
              FUN_14000c6c0(0x80004005);
            }
          }
          local_1078 = param_2;
          FUN_1400a4950(local_1066,param_1 + 0xa26,param_1 + 0x1234,0x7ff);
        }
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400a4ed0(undefined8 param_1,char *param_2,va_list param_3)

{
  int iVar1;
  undefined8 uVar2;
  undefined1 auStack_448 [32];
  char local_428 [1040];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_448;
  if (param_2 == (char *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80070057);
  }
  iVar1 = vsprintf_s(local_428,0x400,param_2,param_3);
  uVar2 = FUN_14000c420(param_1,iVar1);
  FUN_1400a3390(uVar2,local_428,iVar1);
  FUN_14000c510(param_1);
  return;
}



void FUN_1400a4f60(longlong *param_1,longlong *param_2)

{
  int *piVar1;
  int iVar2;
  int iVar3;
  undefined *puVar4;
  int iVar5;
  undefined4 uVar6;
  undefined *puVar7;
  
  puVar4 = (undefined *)*param_2;
  if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1402f8008)) && (0 < *(int *)(puVar4 + -8))
     ) {
    puVar7 = (undefined *)*param_1;
    if (puVar7 == (undefined *)0x0) {
      iVar5 = 0;
    }
    else if (puVar7 == PTR_DAT_1402f8008) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(puVar7 + -8);
    }
    iVar3 = *(int *)(puVar4 + -8) + iVar5;
    if (puVar7 == (undefined *)0x0) {
      iVar2 = 0;
    }
    else if (puVar7 == PTR_DAT_1402f8008) {
      iVar2 = 0;
    }
    else {
      iVar2 = *(int *)(puVar7 + -8);
    }
    if (iVar3 <= iVar2) {
      if (puVar7 == (undefined *)0x0) {
        iVar3 = 0;
      }
      else if (puVar7 == PTR_DAT_1402f8008) {
        iVar3 = 0;
      }
      else {
        iVar3 = *(int *)(puVar7 + -8);
      }
    }
    iVar2 = 1;
    if (1 < iVar3) {
      iVar2 = iVar3;
    }
    if (puVar7 == (undefined *)0x0) {
      iVar3 = 0;
    }
    else if (puVar7 == PTR_DAT_1402f8008) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(puVar7 + -8);
    }
    if (iVar3 < iVar2) {
      FUN_14000c1c0(param_1,iVar2);
    }
    FUN_14000c330(param_1);
    puVar4 = (undefined *)*param_2;
    puVar7 = (undefined *)*param_1;
    if ((undefined *)*param_1 == (undefined *)0x0) {
      puVar7 = PTR_DAT_1402f8008;
    }
    if (puVar4 == (undefined *)0x0) {
      uVar6 = 0;
    }
    else if (puVar4 == PTR_DAT_1402f8008) {
      uVar6 = 0;
    }
    else {
      uVar6 = *(undefined4 *)(puVar4 + -8);
    }
    if (puVar4 == (undefined *)0x0) {
      puVar4 = PTR_DAT_1402f8008;
    }
    FUN_1400a3390(puVar7 + iVar5,puVar4,uVar6);
    puVar4 = (undefined *)*param_2;
    if (puVar4 == (undefined *)0x0) {
      iVar3 = 0;
    }
    else if (puVar4 == PTR_DAT_1402f8008) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(puVar4 + -8);
    }
    iVar2 = 0;
    if (0 < iVar3 + iVar5) {
      iVar2 = iVar3 + iVar5;
    }
    puVar4 = (undefined *)*param_1;
    if (puVar4 == (undefined *)0x0) {
      iVar5 = 0;
    }
    else if (puVar4 == PTR_DAT_1402f8008) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(puVar4 + -8);
    }
    if (iVar5 <= iVar2) {
      if (puVar4 == (undefined *)0x0) {
        iVar2 = 0;
      }
      else if (puVar4 == PTR_DAT_1402f8008) {
        iVar2 = 0;
      }
      else {
        iVar2 = *(int *)(puVar4 + -8);
      }
    }
    if (((puVar4 != PTR_DAT_1402f8008) && (puVar4 != (undefined *)0x0)) &&
       (piVar1 = (int *)(puVar4 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar2;
      *(undefined1 *)((longlong)iVar2 + 8 + (longlong)piVar1) = 0;
    }
  }
  return;
}



void FUN_1400a50f0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 local_res18;
  undefined8 local_res20;
  
  local_res18 = param_3;
  local_res20 = param_4;
  FUN_1400a4ed0(param_1,param_2,&local_res18);
  return;
}



void FUN_1400a5120(longlong *param_1)

{
  longlong lVar1;
  
  if (*param_1 != 0) {
    *(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1;
    if (*(longlong *)(*param_1 + 8) == 0) {
      param_1 = (longlong *)*param_1;
      lVar1 = *param_1;
      if (lVar1 != 0) {
        FUN_1400a8cc0(lVar1);
        FUN_1400a3530(lVar1);
      }
      FUN_1400a3530(param_1);
    }
  }
  return;
}



void FUN_1400a5190(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *param_2;
  if (lVar1 != *param_1) {
    if (lVar1 != 0) {
      *(longlong *)(*param_2 + 8) = *(longlong *)(lVar1 + 8) + 1;
    }
    plVar2 = (longlong *)0x0;
    if ((*param_1 != 0) &&
       (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
       *(longlong *)(*param_1 + 8) == 0)) {
      plVar2 = (longlong *)*param_1;
    }
    *param_1 = *param_2;
    if (plVar2 != (longlong *)0x0) {
      lVar1 = *plVar2;
      if (lVar1 != 0) {
        FUN_1400a8cc0(lVar1);
        FUN_1400a3530(lVar1);
      }
      FUN_1400a3530(plVar2);
    }
  }
  return;
}



undefined4 FUN_1400a5220(longlong param_1)

{
  undefined *puVar1;
  undefined4 uVar2;
  int iVar3;
  undefined8 uVar4;
  undefined *local_res8;
  
  puVar1 = PTR_u_www_nettention_co_kr_1402f8288;
  FUN_1400a3440();
  local_res8 = PTR_DAT_1402f8010;
  uVar2 = FUN_1400a32c0(puVar1);
  uVar4 = FUN_140002f20(&local_res8,uVar2);
  FUN_1400a32f0(uVar4,puVar1,uVar2);
  FUN_140003000(&local_res8);
  uVar4 = 0;
  if (*(undefined8 **)(param_1 + 0x10) != (undefined8 *)0x0) {
    uVar4 = **(undefined8 **)(param_1 + 0x10);
  }
  iVar3 = FUN_1400a92b0(uVar4,&local_res8,DAT_1402f8290);
  if ((iVar3 != 0) && (iVar3 != 0x2733)) {
    return 0;
  }
  return 1;
}



void FUN_1400a52d0(int *param_1,undefined8 param_2)

{
  int *piVar1;
  undefined *puVar2;
  char cVar3;
  DWORD DVar4;
  int iVar5;
  int iVar6;
  int *piVar7;
  undefined8 uVar8;
  LPCWSTR pWVar9;
  LPCWSTR pWVar10;
  int iVar11;
  LPCWSTR local_res8;
  
  piVar1 = param_1 + 0xc;
  cVar3 = FUN_1400a1cc0(piVar1);
  if (cVar3 == '\0') {
    return;
  }
  FUN_1400a1c30(piVar1);
  puVar2 = *(undefined **)(param_1 + 2);
  if ((((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8010)) &&
      (*(int *)(puVar2 + -8) != 0)) ||
     ((*param_1 != 3 || (DVar4 = GetTickCount(), DVar4 - param_1[1] < 0x7531)))) goto LAB_1400a5591;
  FUN_140003100(param_1 + 2,param_2);
  *param_1 = 0;
  DVar4 = GetTickCount();
  param_1[1] = DVar4;
  FUN_1400a3440();
  pWVar10 = (LPCWSTR)PTR_DAT_1402f8010;
  local_res8 = (LPCWSTR)PTR_DAT_1402f8010;
  iVar5 = FUN_1400a32c0(L"**ErrorReport** ");
  iVar11 = 0;
  if ((pWVar10 != (LPCWSTR)0x0) && (pWVar10 != (LPCWSTR)PTR_DAT_1402f8010)) {
    iVar11 = *(int *)((longlong)pWVar10 + -8);
  }
  iVar6 = iVar5;
  if (iVar5 <= iVar11) {
    iVar6 = 0;
    if ((pWVar10 != (LPCWSTR)0x0) && (iVar6 = 0, pWVar10 != (LPCWSTR)PTR_DAT_1402f8010)) {
      iVar6 = *(int *)((longlong)pWVar10 + -8);
    }
  }
  iVar11 = 1;
  if (1 < iVar6) {
    iVar11 = iVar6;
  }
  iVar6 = 0;
  if ((pWVar10 != (LPCWSTR)0x0) && (pWVar10 != (LPCWSTR)PTR_DAT_1402f8010)) {
    iVar6 = *(int *)((longlong)pWVar10 + -8);
  }
  if (iVar6 < iVar11) {
    if (pWVar10 == (LPCWSTR)0x0) {
      pWVar10 = (LPCWSTR)PTR_DAT_1402f8010;
    }
    local_res8 = pWVar10;
    if (iVar11 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (iVar11 == 0) {
      FUN_1400031d0(&local_res8);
    }
    else {
      iVar6 = 0;
      if ((pWVar10 != (LPCWSTR)0x0) && (iVar6 = 0, pWVar10 != (LPCWSTR)PTR_DAT_1402f8010)) {
        iVar6 = *(int *)(pWVar10 + -4);
      }
      if (iVar11 != iVar6) {
        piVar7 = (int *)FUN_1400a34c0((longlong)iVar11 * 2 + 10);
        if (piVar7 != (int *)0x0) {
          *piVar7 = 0;
          piVar7[1] = 1;
        }
        *piVar7 = iVar11;
        iVar6 = 0;
        if ((pWVar10 != (LPCWSTR)0x0) && (iVar6 = 0, pWVar10 != (LPCWSTR)PTR_DAT_1402f8010)) {
          iVar6 = *(int *)(pWVar10 + -4);
        }
        pWVar9 = (LPCWSTR)PTR_DAT_1402f8010;
        if (iVar11 < iVar6) {
LAB_1400a5461:
          if (pWVar10 != (LPCWSTR)0x0) {
            pWVar9 = pWVar10;
          }
        }
        else {
          iVar11 = 0;
          if (pWVar10 != (LPCWSTR)0x0) {
            if (pWVar10 != (LPCWSTR)PTR_DAT_1402f8010) {
              iVar11 = *(int *)(pWVar10 + -4);
            }
            goto LAB_1400a5461;
          }
        }
        FUN_1400a32f0(piVar7 + 2,pWVar9,iVar11);
        FUN_1400031d0(&local_res8);
        local_res8 = (LPCWSTR)(piVar7 + 2);
      }
    }
  }
  FUN_140002e30(&local_res8);
  pWVar10 = local_res8;
  pWVar9 = local_res8;
  if (local_res8 == (LPCWSTR)0x0) {
    pWVar9 = (LPCWSTR)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(pWVar9,L"**ErrorReport** ",iVar5);
  pWVar9 = pWVar10;
  if (pWVar10 == (LPCWSTR)0x0) {
    pWVar9 = (LPCWSTR)PTR_DAT_1402f8010;
  }
  iVar5 = FUN_1400a32c0(pWVar9);
  iVar11 = 0;
  if (0 < iVar5) {
    iVar11 = iVar5;
  }
  iVar5 = 0;
  if ((pWVar10 != (LPCWSTR)0x0) && (pWVar10 != (LPCWSTR)PTR_DAT_1402f8010)) {
    iVar5 = *(int *)(pWVar10 + -4);
  }
  if ((iVar11 < iVar5) || (iVar11 = 0, pWVar10 == (LPCWSTR)0x0)) {
LAB_1400a54f9:
    if (((pWVar10 != (LPCWSTR)PTR_DAT_1402f8010) && (pWVar10 != (LPCWSTR)0x0)) &&
       (pWVar10 + -4 != (LPCWSTR)0x0)) {
      *(int *)(pWVar10 + -4) = iVar11;
      pWVar10[iVar11] = L'\0';
    }
  }
  else if (pWVar10 != (LPCWSTR)PTR_DAT_1402f8010) {
    iVar11 = *(int *)(pWVar10 + -4);
    goto LAB_1400a54f9;
  }
  FUN_14003c400(&local_res8,param_2);
  FUN_14003c890(&local_res8,&DAT_140272810);
  pWVar10 = local_res8;
  pWVar9 = local_res8;
  if (local_res8 == (LPCWSTR)0x0) {
    pWVar9 = (LPCWSTR)PTR_DAT_1402f8010;
  }
  OutputDebugStringW(pWVar9);
  if (((pWVar10 != (LPCWSTR)0x0) && (pWVar10 != (LPCWSTR)PTR_DAT_1402f8010)) &&
     (pWVar10 + -4 != (LPCWSTR)0x0)) {
    uVar8 = FUN_1400a3440();
    FUN_1400a1c30(uVar8);
    pWVar9 = pWVar10 + -2;
    *(int *)pWVar9 = *(int *)pWVar9 + -1;
    if (*(int *)pWVar9 == 0) {
      FUN_1400a3530(pWVar10 + -4);
    }
    FUN_1400d1290(uVar8);
  }
LAB_1400a5591:
  FUN_1400d1290(piVar1);
  return;
}



void FUN_1400a55c0(longlong param_1)

{
  longlong *plVar1;
  longlong lVar2;
  
  FUN_1400a4730();
  FUN_1400aaa90(param_1 + 0x88);
  FUN_1400a1cd0(param_1 + 0x30);
  FUN_14000c2a0(param_1 + 0x20);
  *(undefined ***)(param_1 + 0x18) = Proud::IFastSocketDelegate::vftable;
  if ((*(longlong *)(param_1 + 0x10) != 0) &&
     (*(longlong *)(*(longlong *)(param_1 + 0x10) + 8) =
           *(longlong *)(*(longlong *)(param_1 + 0x10) + 8) + -1,
     *(longlong *)(*(longlong *)(param_1 + 0x10) + 8) == 0)) {
    plVar1 = *(longlong **)(param_1 + 0x10);
    lVar2 = *plVar1;
    if (lVar2 != 0) {
      FUN_1400a8cc0(lVar2);
      FUN_1400a3530(lVar2);
    }
    FUN_1400a3530(plVar1);
  }
  FUN_1400031d0(param_1 + 8);
  return;
}



undefined8 * FUN_1400a5680(undefined8 *param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_1400a3440();
  *param_1 = PTR_DAT_1402f8008;
  FUN_1400223a0(param_1,param_2);
  FUN_1400a4f60(param_1,param_3);
  return param_1;
}



void FUN_1400a56f0(undefined4 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined *puVar2;
  longlong *plVar3;
  char cVar4;
  longlong lVar5;
  longlong *local_res8;
  undefined8 local_res10;
  undefined8 local_res18;
  undefined8 uVar6;
  
  uVar6 = 0xfffffffffffffffe;
  puVar2 = *(undefined **)(param_1 + 2);
  if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8010)) &&
     (*(int *)(puVar2 + -8) != 0)) {
    local_res8 = (longlong *)FUN_1400a34c0(0x400);
    if (local_res8 == (longlong *)0x0) {
      lVar5 = 0;
    }
    else {
      lVar5 = FUN_1400a8db0(local_res8,0,param_1 + 6,param_4,uVar6);
    }
    if (lVar5 == 0) {
      local_res8 = (longlong *)0x0;
    }
    else {
      local_res8 = (longlong *)FUN_1400a34c0(0x10);
      local_res8[1] = 1;
      *local_res8 = lVar5;
    }
    plVar1 = local_res8;
    FUN_1400a5190(param_1 + 4,&local_res8);
    plVar3 = local_res8;
    if (plVar1 != (longlong *)0x0) {
      plVar1 = plVar1 + 1;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        lVar5 = *local_res8;
        if (lVar5 != 0) {
          FUN_1400a8cc0(lVar5);
          FUN_1400a3530(lVar5);
        }
        FUN_1400a3530(plVar3);
      }
    }
    if (*(undefined8 **)(param_1 + 4) == (undefined8 *)0x0) {
      uVar6 = 0;
    }
    else {
      uVar6 = **(undefined8 **)(param_1 + 4);
    }
    cVar4 = FUN_1400aa930(uVar6);
    if (cVar4 == '\0') {
      local_res10 = 0;
      FUN_1400a5190(param_1 + 4,&local_res10);
      *param_1 = 3;
    }
    else {
      if (*(undefined8 **)(param_1 + 4) == (undefined8 *)0x0) {
        uVar6 = 0;
      }
      else {
        uVar6 = **(undefined8 **)(param_1 + 4);
      }
      FUN_1400a8090(uVar6,0);
      cVar4 = FUN_1400a5220(param_1);
      if (cVar4 == '\0') {
        local_res18 = 0;
        FUN_1400a5190(param_1 + 4,&local_res18);
        *param_1 = 3;
      }
      else {
        *param_1 = 1;
      }
    }
  }
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400a5860(undefined4 *param_1)

{
  longlong *plVar1;
  undefined *puVar2;
  int *piVar3;
  undefined4 *puVar4;
  undefined4 *puVar5;
  undefined1 *puVar6;
  char cVar7;
  errno_t eVar8;
  uint uVar9;
  uint uVar10;
  uint *puVar11;
  uint *puVar12;
  undefined8 uVar13;
  uint uVar14;
  ulonglong uVar15;
  undefined *puVar16;
  uint *puVar17;
  uint *puVar18;
  uint uVar19;
  ulonglong uVar20;
  uint uVar21;
  uint uVar22;
  undefined1 auStack_2c58 [32];
  uint *local_2c38;
  uint *local_2c30;
  undefined8 local_2c28;
  undefined1 local_2c20;
  undefined *local_2c18;
  undefined *local_2c10;
  int local_2c08 [2];
  undefined *local_2c00;
  undefined4 *local_2bf8;
  undefined8 local_2bf0;
  undefined1 *local_2be8;
  undefined1 local_2be0 [136];
  undefined1 *local_2b58;
  undefined1 local_2b50 [136];
  undefined1 local_2ac8 [1568];
  wchar_t local_24a8 [548];
  undefined1 local_2060 [8196];
  undefined2 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  ulonglong local_38;
  undefined8 local_30;
  
  local_30 = 0x1400a587c;
  local_2bf0 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_2c58;
  local_2bf8 = param_1;
  FUN_1400a8110(local_2ac8);
  plVar1 = (longlong *)(param_1 + 4);
  uVar20 = 0;
  uVar22 = 0;
  uVar15 = uVar20;
  if ((ulonglong *)*plVar1 != (ulonglong *)0x0) {
    uVar15 = *(ulonglong *)*plVar1;
  }
  FUN_1400a8130(local_2ac8,uVar15);
  uVar15 = uVar20;
  if ((ulonglong *)*plVar1 != (ulonglong *)0x0) {
    uVar15 = *(ulonglong *)*plVar1;
  }
  FUN_1400a8190(local_2ac8,uVar15);
  FUN_1400a81f0(local_2ac8,0);
  uVar15 = uVar20;
  if ((ulonglong *)*plVar1 != (ulonglong *)0x0) {
    uVar15 = *(ulonglong *)*plVar1;
  }
  cVar7 = FUN_1400a8250(local_2ac8,uVar15,local_2c08);
  if (cVar7 == '\0') {
    return;
  }
  uVar19 = 0;
  if (local_2c08[0] != 0) {
    cVar7 = FUN_1400a5220(param_1);
    if (cVar7 != '\0') {
      return;
    }
    local_2c18 = (undefined *)0x0;
    FUN_1400a5190(plVar1,&local_2c18);
    *param_1 = 3;
    return;
  }
  uVar15 = uVar20;
  if ((ulonglong *)*plVar1 != (ulonglong *)0x0) {
    uVar15 = *(ulonglong *)*plVar1;
  }
  FUN_1400a8090(uVar15,1);
  param_1[10] = 0;
  FUN_1400a46a0(local_24a8);
  local_58 = 2;
  local_54 = 4;
  local_5c = 0x50;
  eVar8 = wcsncpy_s(local_24a8,0x21,L"http",4);
  if (eVar8 != 0) {
    if (eVar8 == 0xc) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    if ((eVar8 == 0x16) || (eVar8 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80070057);
    }
    if (eVar8 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
  }
  puVar16 = *(undefined **)(param_1 + 2);
  if (*(undefined **)(param_1 + 2) == (undefined *)0x0) {
    puVar16 = PTR_DAT_1402f8010;
  }
  FUN_1400a45f0(local_24a8,puVar16);
  FUN_1400a4ba0(local_24a8,0);
  FUN_14001f680(param_1 + 2,&DAT_14027d1a0);
  puVar16 = PTR_s_GET__PNReport_ReportError_php_Te_1402f8298;
  FUN_1400a3440();
  puVar18 = (uint *)PTR_DAT_1402f8008;
  local_2c30 = (uint *)PTR_DAT_1402f8008;
  uVar9 = FUN_1400a3360(puVar16);
  uVar15 = uVar20;
  if ((puVar18 != (uint *)0x0) && (uVar15 = 0, puVar18 != (uint *)PTR_DAT_1402f8008)) {
    uVar15 = (ulonglong)*(uint *)((longlong)puVar18 + -8);
  }
  uVar10 = uVar9;
  if ((((int)uVar9 <= (int)uVar15) && (uVar10 = uVar19, puVar18 != (uint *)0x0)) &&
     (puVar18 != (uint *)PTR_DAT_1402f8008)) {
    uVar10 = *(uint *)((longlong)puVar18 + -8);
  }
  uVar21 = 1;
  if (1 < (int)uVar10) {
    uVar21 = uVar10;
  }
  uVar10 = uVar19;
  if ((puVar18 != (uint *)0x0) && (puVar18 != (uint *)PTR_DAT_1402f8008)) {
    uVar10 = *(uint *)((longlong)puVar18 + -8);
  }
  uVar14 = 0;
  if ((int)uVar10 < (int)uVar21) {
    if (puVar18 == (uint *)0x0) {
      puVar18 = (uint *)PTR_DAT_1402f8008;
    }
    local_2c30 = puVar18;
    if ((int)uVar21 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar21 == 0) {
      FUN_14000c2a0(&local_2c30);
    }
    else {
      uVar10 = uVar19;
      if ((puVar18 != (uint *)0x0) && (puVar18 != (uint *)PTR_DAT_1402f8008)) {
        uVar10 = puVar18[-2];
      }
      if (uVar21 != uVar10) {
        puVar11 = (uint *)FUN_1400a34c0((longlong)(int)uVar21 + 9);
        if (puVar11 != (uint *)0x0) {
          *puVar11 = 0;
          puVar11[1] = 1;
        }
        *puVar11 = uVar21;
        uVar10 = uVar14;
        if ((puVar18 != (uint *)0x0) && (puVar18 != (uint *)PTR_DAT_1402f8008)) {
          uVar10 = puVar18[-2];
        }
        puVar12 = (uint *)PTR_DAT_1402f8008;
        if ((int)uVar21 < (int)uVar10) {
LAB_1400a5b00:
          if (puVar18 != (uint *)0x0) {
            puVar12 = puVar18;
          }
        }
        else {
          uVar21 = uVar19;
          if (puVar18 != (uint *)0x0) {
            if (puVar18 != (uint *)PTR_DAT_1402f8008) {
              uVar21 = puVar18[-2];
            }
            goto LAB_1400a5b00;
          }
        }
        FUN_1400a3390(puVar11 + 2,puVar12,uVar21);
        FUN_14000c2a0(&local_2c30);
        local_2c30 = puVar11 + 2;
      }
    }
  }
  FUN_14000c330(&local_2c30);
  puVar18 = local_2c30;
  puVar11 = local_2c30;
  if (local_2c30 == (uint *)0x0) {
    puVar11 = (uint *)PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar11,puVar16,uVar9);
  puVar11 = puVar18;
  if (puVar18 == (uint *)0x0) {
    puVar11 = (uint *)PTR_DAT_1402f8008;
  }
  uVar10 = FUN_1400a3360(puVar11);
  uVar9 = uVar22;
  if (0 < (int)uVar10) {
    uVar9 = uVar10;
  }
  uVar10 = uVar14;
  if ((puVar18 != (uint *)0x0) && (puVar18 != (uint *)PTR_DAT_1402f8008)) {
    uVar10 = puVar18[-2];
  }
  if (((int)uVar9 < (int)uVar10) || (uVar9 = uVar14, puVar18 == (uint *)0x0)) {
LAB_1400a5b91:
    if (((puVar18 != (uint *)PTR_DAT_1402f8008) && (puVar18 != (uint *)0x0)) &&
       (puVar11 = puVar18 + -2, puVar11 != (uint *)0x0)) {
      *puVar11 = uVar9;
      *(undefined1 *)((longlong)(int)uVar9 + 8 + (longlong)puVar11) = 0;
    }
  }
  else if (puVar18 != (uint *)PTR_DAT_1402f8008) {
    uVar9 = puVar18[-2];
    goto LAB_1400a5b91;
  }
  local_2be8 = local_2be0;
  FUN_1400a1e40(&local_2be8,local_2060,3);
  puVar6 = local_2be8;
  FUN_1400a3440();
  puVar11 = (uint *)PTR_DAT_1402f8008;
  local_2c38 = (uint *)PTR_DAT_1402f8008;
  uVar9 = FUN_1400a3360(puVar6);
  uVar15 = uVar20;
  if ((puVar11 != (uint *)0x0) && (uVar15 = 0, puVar11 != (uint *)PTR_DAT_1402f8008)) {
    uVar15 = (ulonglong)*(uint *)((longlong)puVar11 + -8);
  }
  uVar10 = uVar9;
  if ((((int)uVar9 <= (int)uVar15) && (uVar10 = uVar14, puVar11 != (uint *)0x0)) &&
     (uVar10 = uVar22, puVar11 != (uint *)PTR_DAT_1402f8008)) {
    uVar10 = *(uint *)((longlong)puVar11 + -8);
  }
  uVar21 = 1;
  if (1 < (int)uVar10) {
    uVar21 = uVar10;
  }
  uVar10 = uVar22;
  if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1402f8008)) {
    uVar10 = *(uint *)((longlong)puVar11 + -8);
  }
  if ((int)uVar10 < (int)uVar21) {
    if (puVar11 == (uint *)0x0) {
      puVar11 = (uint *)PTR_DAT_1402f8008;
    }
    local_2c38 = puVar11;
    if ((int)uVar21 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar21 == 0) {
      FUN_14000c2a0(&local_2c38);
    }
    else {
      uVar10 = uVar14;
      if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1402f8008)) {
        uVar10 = puVar11[-2];
      }
      if (uVar21 != uVar10) {
        puVar12 = (uint *)FUN_1400a34c0((longlong)(int)uVar21 + 9);
        if (puVar12 != (uint *)0x0) {
          *puVar12 = 0;
          puVar12[1] = 1;
        }
        *puVar12 = uVar21;
        if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1402f8008)) {
          uVar14 = puVar11[-2];
        }
        puVar17 = (uint *)PTR_DAT_1402f8008;
        if ((int)uVar21 < (int)uVar14) {
LAB_1400a5cc4:
          if (puVar11 != (uint *)0x0) {
            puVar17 = puVar11;
          }
        }
        else {
          uVar21 = uVar19;
          if (puVar11 != (uint *)0x0) {
            if (puVar11 != (uint *)PTR_DAT_1402f8008) {
              uVar21 = puVar11[-2];
            }
            goto LAB_1400a5cc4;
          }
        }
        FUN_1400a3390(puVar12 + 2,puVar17,uVar21);
        FUN_14000c2a0(&local_2c38);
        local_2c38 = puVar12 + 2;
      }
    }
  }
  FUN_14000c330(&local_2c38);
  puVar11 = local_2c38;
  puVar12 = local_2c38;
  if (local_2c38 == (uint *)0x0) {
    puVar12 = (uint *)PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar12,puVar6,uVar9);
  puVar12 = puVar11;
  if (puVar11 == (uint *)0x0) {
    puVar12 = (uint *)PTR_DAT_1402f8008;
  }
  uVar9 = FUN_1400a3360(puVar12);
  uVar19 = uVar22;
  if (0 < (int)uVar9) {
    uVar19 = uVar9;
  }
  uVar9 = uVar22;
  if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1402f8008)) {
    uVar9 = puVar11[-2];
  }
  if (((int)uVar9 <= (int)uVar19) && (uVar19 = uVar22, puVar11 != (uint *)0x0)) {
    if (puVar11 == (uint *)PTR_DAT_1402f8008) goto LAB_1400a5d72;
    uVar19 = puVar11[-2];
  }
  if (((puVar11 != (uint *)PTR_DAT_1402f8008) && (puVar11 != (uint *)0x0)) &&
     (puVar12 = puVar11 + -2, puVar12 != (uint *)0x0)) {
    *puVar12 = uVar19;
    *(undefined1 *)((longlong)(int)uVar19 + 8 + (longlong)puVar12) = 0;
  }
LAB_1400a5d72:
  if (local_2be8 != local_2be0) {
    free(local_2be8);
  }
  FUN_1400a3440();
  local_2c10 = PTR_DAT_1402f8008;
  local_2b58 = local_2b50;
  FUN_1400a1e40(&local_2b58,PTR_u_www_nettention_co_kr_1402f8288,3);
  FUN_1400a50f0(&local_2c10,PTR_s_HTTP_1_1_User_Agent__Mozilla_5_0_1402f82a0,local_2b58);
  if (local_2b58 != local_2b50) {
    free(local_2b58);
  }
  uVar13 = FUN_1400a5680(&local_2c18,&local_2c30,&local_2c38);
  uVar13 = FUN_1400a5680(&local_2c00,uVar13,&local_2c10);
  puVar4 = local_2bf8;
  FUN_1400223a0(local_2bf8 + 8,uVar13);
  if (((local_2c00 != (undefined *)0x0) && (local_2c00 != PTR_DAT_1402f8008)) &&
     (local_2c00 + -8 != (undefined *)0x0)) {
    uVar13 = FUN_1400a3440();
    local_2c28 = uVar13;
    FUN_1400a1c30(uVar13);
    local_2c20 = 1;
    piVar3 = (int *)(local_2c00 + -4);
    *piVar3 = *piVar3 + -1;
    if (*piVar3 == 0) {
      FUN_1400a3530(local_2c00 + -8);
    }
    FUN_1400d1290(uVar13);
  }
  local_2c00 = PTR_DAT_1402f8008;
  if (((local_2c18 != (undefined *)0x0) && (local_2c18 != PTR_DAT_1402f8008)) &&
     (local_2c18 + -8 != (undefined *)0x0)) {
    uVar13 = FUN_1400a3440();
    local_2c28 = uVar13;
    FUN_1400a1c30(uVar13);
    local_2c20 = 1;
    piVar3 = (int *)(local_2c18 + -4);
    *piVar3 = *piVar3 + -1;
    if (*piVar3 == 0) {
      FUN_1400a3530(local_2c18 + -8);
    }
    FUN_1400d1290(uVar13);
  }
  puVar5 = local_2bf8;
  puVar16 = *(undefined **)(puVar4 + 8);
  if ((puVar16 != (undefined *)0x0) && (puVar16 != PTR_DAT_1402f8008)) {
    uVar22 = *(uint *)(puVar16 + -8);
  }
  if (puVar16 == (undefined *)0x0) {
    puVar16 = PTR_DAT_1402f8008;
  }
  if ((ulonglong *)*plVar1 != (ulonglong *)0x0) {
    uVar20 = *(ulonglong *)*plVar1;
  }
  FUN_1400a9a10(uVar20,puVar16 + (int)local_2bf8[10],(uVar22 - local_2bf8[10]) + 1);
  puVar16 = local_2c10;
  *puVar5 = 2;
  if (((local_2c10 != (undefined *)0x0) && (local_2c10 != PTR_DAT_1402f8008)) &&
     (puVar2 = local_2c10 + -8, puVar2 != (undefined *)0x0)) {
    uVar13 = FUN_1400a3440();
    local_2c28 = uVar13;
    FUN_1400a1c30(uVar13);
    local_2c20 = 1;
    piVar3 = (int *)(puVar16 + -4);
    *piVar3 = *piVar3 + -1;
    if (*piVar3 == 0) {
      FUN_1400a3530(puVar2);
    }
    FUN_1400d1290(uVar13);
  }
  if (((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1402f8008)) &&
     (puVar11 + -2 != (uint *)0x0)) {
    uVar13 = FUN_1400a3440();
    local_2c28 = uVar13;
    FUN_1400a1c30(uVar13);
    local_2c20 = 1;
    puVar12 = puVar11 + -1;
    *puVar12 = *puVar12 - 1;
    if (*puVar12 == 0) {
      FUN_1400a3530(puVar11 + -2);
    }
    FUN_1400d1290(uVar13);
  }
  if (((puVar18 != (uint *)0x0) && (puVar18 != (uint *)PTR_DAT_1402f8008)) &&
     (puVar18 + -2 != (uint *)0x0)) {
    uVar13 = FUN_1400a3440();
    local_2c28 = uVar13;
    FUN_1400a1c30(uVar13);
    local_2c20 = 1;
    puVar11 = puVar18 + -1;
    *puVar11 = *puVar11 - 1;
    if (*puVar11 == 0) {
      FUN_1400a3530(puVar18 + -2);
    }
    FUN_1400d1290(uVar13);
  }
  return;
}



void FUN_1400a6040(undefined4 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  char cVar2;
  undefined8 uVar3;
  int iVar4;
  undefined8 local_res8;
  undefined8 local_30;
  undefined **local_28;
  undefined4 local_20;
  undefined2 local_1c;
  int local_18;
  
  local_28 = Proud::AddrPort::vftable;
  uVar3 = 0;
  iVar4 = 0;
  local_18 = 0;
  local_30 = 0;
  local_20 = DAT_1402f83d0;
  local_1c = DAT_1402f83d4;
  if (*(undefined8 **)(param_1 + 4) != (undefined8 *)0x0) {
    uVar3 = **(undefined8 **)(param_1 + 4);
  }
  cVar2 = FUN_1400a87e0(uVar3,0,&local_30,param_4,0xfffffffffffffffe);
  if (cVar2 != '\0') {
    if ((local_30._4_4_ == 0) && (local_18 != 0)) {
      param_1[10] = param_1[10] + local_18;
      puVar1 = *(undefined **)(param_1 + 8);
      if (puVar1 != (undefined *)0x0) {
        if (puVar1 == PTR_DAT_1402f8008) {
          iVar4 = 0;
        }
        else {
          iVar4 = *(int *)(puVar1 + -8);
        }
      }
      if ((int)param_1[10] < iVar4 + 1) {
        FUN_1400a48f0(param_1);
      }
      else {
        *param_1 = 3;
        local_res8 = 0;
        FUN_1400a5190(param_1 + 4,&local_res8);
      }
    }
    else {
      *param_1 = 3;
      local_res8 = 0;
      FUN_1400a5190(param_1 + 4,&local_res8);
    }
  }
  return;
}



void FUN_1400a6130(int *param_1)

{
  int iVar1;
  
  FUN_1400a1c30(param_1 + 0xc);
  iVar1 = *param_1;
  if (iVar1 == 0) {
    FUN_1400a56f0(param_1);
  }
  else if (iVar1 == 1) {
    FUN_1400a5860(param_1);
  }
  else if (iVar1 == 2) {
    FUN_1400a6040(param_1);
  }
  FUN_1400d1290(param_1 + 0xc);
  return;
}



void FUN_1400a61b0(longlong param_1)

{
  char cVar1;
  DWORD DVar2;
  
  DVar2 = GetCurrentThreadId();
  FUN_1400aaed0(DVar2,"ErrReporter");
  cVar1 = *(char *)(param_1 + 0x80);
  while (cVar1 == '\0') {
    FUN_1400a6130(param_1);
    Sleep(5);
    cVar1 = *(char *)(param_1 + 0x80);
  }
  return;
}



undefined8 *
FUN_1400a6200(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1400a3440();
  param_1[1] = PTR_DAT_1402f8010;
  param_1[2] = 0;
  param_1[3] = Proud::CReportSocketDg::vftable;
  FUN_1400a3440();
  param_1[4] = PTR_DAT_1402f8008;
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 6,uVar1,1,param_4,uVar2);
  FUN_1400aa980(param_1 + 0x11,FUN_1400a61b0,param_1);
  *param_1 = 3;
  *(undefined1 *)(param_1 + 0x10) = 0;
  FUN_1400aab80(param_1 + 0x11);
  return param_1;
}



undefined * FUN_1400a62b0(void)

{
  bool bVar1;
  char cVar2;
  
  bVar1 = false;
  cVar2 = FUN_1400a1cc0(&DAT_140314148);
  if (cVar2 != '\0') {
    if (DAT_1402f8340 == '\0') {
      bVar1 = false;
    }
    else {
      bVar1 = true;
      FUN_1400a1c30(&DAT_140314148);
    }
  }
  if ((DAT_140314140 & 1) == 0) {
    DAT_140314140 = DAT_140314140 | 1;
    FUN_1400a6200(&DAT_140314080);
    atexit((_func_5014 *)&LAB_1402028c0);
  }
  DAT_1402f8340 = 0;
  if (bVar1) {
    FUN_1400d1290(&DAT_140314148);
  }
  return &DAT_140314080;
}



void FUN_1400a6370(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  uVar1 = FUN_1400a62b0();
  FUN_1400a52d0(uVar1,param_1,param_3,param_4,uVar2);
  FUN_1400031d0(param_1);
  return;
}



undefined8
FUN_1400a63b0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  lVar1 = FUN_1400a34c0(0x80);
  if (lVar1 == 0) {
    uVar2 = 0;
  }
  else {
    uVar2 = FUN_1400ab480(lVar1,param_1,param_3,param_4,uVar2);
  }
  return uVar2;
}



void FUN_1400a63f0(undefined8 *param_1)

{
  *param_1 = Proud::CLookasideAllocator::vftable;
  return;
}



undefined8 * FUN_1400a6400(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::CLookasideAllocator::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1400a6430(undefined8 *param_1)

{
  *param_1 = Proud::CLookasideAllocator::vftable;
  return param_1;
}



undefined8 * FUN_1400a6440(undefined8 *param_1)

{
  *(undefined1 *)(param_1 + 1) = 0;
  *(undefined4 *)((longlong)param_1 + 0xc) = 1;
  *param_1 = 0;
  param_1[2] = 0;
  return param_1;
}



void FUN_1400a6460(longlong param_1,undefined2 *param_2)

{
  undefined2 uVar1;
  
  uVar1 = Ordinal_9(*(undefined2 *)(param_1 + 0xc));
  param_2[1] = uVar1;
  *(undefined4 *)(param_2 + 2) = *(undefined4 *)(param_1 + 8);
  *param_2 = 2;
  return;
}



void FUN_1400a64a0(longlong param_1,longlong param_2)

{
  undefined2 uVar1;
  
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_2 + 4);
  uVar1 = Ordinal_15(*(undefined2 *)(param_2 + 2));
  *(undefined2 *)(param_1 + 0xc) = uVar1;
  return;
}



ulonglong FUN_1400a64d0(longlong param_1)

{
  ushort uVar1;
  uint uVar2;
  ulonglong uVar3;
  
  uVar1 = *(ushort *)(param_1 + 0xc);
  uVar3 = (ulonglong)uVar1;
  if ((uVar1 != 0) && (uVar1 != 0xffff)) {
    uVar2 = *(uint *)(param_1 + 8);
    uVar3 = (ulonglong)uVar2;
    if ((uVar2 != 0) && (uVar2 != 0xffffffff)) {
      return CONCAT71((uint7)(uint3)(uVar2 >> 8),1);
    }
  }
  return uVar3 & 0xffffffffffffff00;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400a6500(char param_1)

{
  HKEY hKey;
  LSTATUS LVar1;
  undefined8 uVar2;
  undefined1 auStackY_118 [32];
  uint local_c8 [2];
  HKEY local_c0;
  DWORD local_b8 [2];
  wchar_t local_b0 [20];
  wchar_t local_88 [56];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStackY_118;
  builtin_wcsncpy(local_88,L"SYSTEM\\CurrentControlSet\\services\\Tcpip\\Parameters",0x33);
  builtin_wcsncpy(local_b0,L"DisableTaskOffload",0x13);
  local_c0 = (HKEY)0x0;
  LVar1 = RegCreateKeyExW((HKEY)0xffffffff80000002,local_88,0,(LPWSTR)0x0,0,0x20006,
                          (LPSECURITY_ATTRIBUTES)0x0,&local_c0,local_b8);
  hKey = local_c0;
  if (LVar1 == 0) {
    local_c8[0] = (uint)(param_1 != '\x01');
    LVar1 = RegSetValueExW(local_c0,local_b0,0,4,(BYTE *)local_c8,4);
    if (LVar1 == 0) {
      if ((hKey == (HKEY)0x0) || (LVar1 = RegCloseKey(hKey), LVar1 == 0)) {
        uVar2 = 0;
      }
      else {
        uVar2 = 1;
        if (LVar1 == 5) {
          uVar2 = 0x12;
        }
      }
    }
    else if (LVar1 == 5) {
      if (hKey != (HKEY)0x0) {
        RegCloseKey(hKey);
      }
      uVar2 = 0x12;
    }
    else {
      if (hKey != (HKEY)0x0) {
        RegCloseKey(hKey);
      }
      uVar2 = 1;
    }
  }
  else {
    uVar2 = 1;
    if (LVar1 == 5) {
      uVar2 = 0x12;
    }
  }
  return uVar2;
}



undefined * FUN_1400a66e0(void)

{
  bool bVar1;
  char cVar2;
  
  bVar1 = false;
  cVar2 = FUN_1400a1cc0(&DAT_140314218);
  if (cVar2 != '\0') {
    if (DAT_1402f8380 == '\0') {
      bVar1 = false;
    }
    else {
      bVar1 = true;
      FUN_1400a1c30(&DAT_140314218);
    }
  }
  if ((DAT_140314184 & 1) == 0) {
    DAT_140314184 = DAT_140314184 | 1;
    FUN_1400a8320(&DAT_140314180);
    atexit((_func_5014 *)&LAB_1402028d0);
  }
  DAT_1402f8380 = 0;
  if (bVar1) {
    FUN_1400d1290(&DAT_140314218);
  }
  return &DAT_140314180;
}



void FUN_1400a67a0(undefined8 *param_1,longlong param_2)

{
  int iVar1;
  
  if (0 < param_2) {
    iVar1 = 0;
    do {
      if (param_1 != (undefined8 *)0x0) {
        FUN_1400a3440();
        *param_1 = PTR_DAT_1402f8008;
      }
      iVar1 = iVar1 + 1;
      param_1 = param_1 + 1;
    } while (iVar1 < param_2);
  }
  return;
}



undefined8 * FUN_1400a6800(undefined8 *param_1,longlong *param_2,undefined2 param_3)

{
  undefined4 uVar1;
  undefined *puVar2;
  
  *param_1 = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 1) = 0;
  *(undefined2 *)((longlong)param_1 + 0xc) = 0;
  puVar2 = (undefined *)*param_2;
  if ((undefined *)*param_2 == (undefined *)0x0) {
    puVar2 = PTR_DAT_1402f8008;
  }
  uVar1 = Ordinal_11(puVar2);
  *(undefined2 *)((longlong)param_1 + 0xc) = param_3;
  *(undefined4 *)(param_1 + 1) = uVar1;
  FUN_14000c2a0(param_2);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1400a6870(undefined8 *param_1,longlong *param_2,undefined2 param_3)

{
  undefined4 uVar1;
  undefined *puVar2;
  undefined1 auStack_d8 [32];
  longlong *local_b8;
  undefined8 local_b0;
  undefined1 *local_a8;
  undefined1 local_a0 [136];
  ulonglong local_18;
  
  local_b0 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_d8;
  *param_1 = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 1) = 0;
  *(undefined2 *)((longlong)param_1 + 0xc) = 0;
  puVar2 = (undefined *)*param_2;
  if ((undefined *)*param_2 == (undefined *)0x0) {
    puVar2 = PTR_DAT_1402f8010;
  }
  local_a8 = local_a0;
  local_b8 = param_2;
  FUN_1400a1e40(&local_a8,puVar2,3);
  uVar1 = Ordinal_11(local_a8);
  *(undefined4 *)(param_1 + 1) = uVar1;
  if (local_a8 != local_a0) {
    free(local_a8);
  }
  *(undefined2 *)((longlong)param_1 + 0xc) = param_3;
  FUN_1400031d0(param_2);
  return param_1;
}



void thunk_FUN_14000c2a0(longlong *param_1)

{
  int *piVar1;
  undefined *puVar2;
  undefined8 uVar3;
  
  puVar2 = (undefined *)*param_1;
  if (((puVar2 == (undefined *)0x0) || (puVar2 == PTR_DAT_1402f8008)) ||
     (puVar2 + -8 == (undefined *)0x0)) {
    *param_1 = (longlong)PTR_DAT_1402f8008;
  }
  else {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2 + -8);
    }
    FUN_1400d1290(uVar3);
    *param_1 = (longlong)PTR_DAT_1402f8008;
  }
  return;
}



void FUN_1400a6950(longlong *param_1,longlong param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined *puVar8;
  
  if (param_2 != 0) {
    iVar1 = FUN_1400a3360(param_2);
    puVar8 = (undefined *)*param_1;
    iVar7 = 0;
    iVar6 = 0;
    iVar3 = 0;
    iVar4 = iVar6;
    if ((puVar8 != (undefined *)0x0) && (iVar4 = iVar3, puVar8 != PTR_DAT_1402f8008)) {
      iVar4 = *(int *)(puVar8 + -8);
    }
    iVar5 = iVar4 + iVar1;
    if ((puVar8 != (undefined *)0x0) && (puVar8 != PTR_DAT_1402f8008)) {
      iVar3 = *(int *)(puVar8 + -8);
    }
    iVar2 = iVar5;
    if (((iVar5 <= iVar3) && (iVar2 = iVar6, puVar8 != (undefined *)0x0)) &&
       (puVar8 != PTR_DAT_1402f8008)) {
      iVar2 = *(int *)(puVar8 + -8);
    }
    iVar3 = 1;
    if (1 < iVar2) {
      iVar3 = iVar2;
    }
    if ((puVar8 != (undefined *)0x0) && (puVar8 != PTR_DAT_1402f8008)) {
      iVar7 = *(int *)(puVar8 + -8);
    }
    if (iVar7 < iVar3) {
      FUN_14000c1c0(param_1);
    }
    FUN_14000c330(param_1);
    puVar8 = (undefined *)*param_1;
    if ((undefined *)*param_1 == (undefined *)0x0) {
      puVar8 = PTR_DAT_1402f8008;
    }
    FUN_1400a3390(puVar8 + iVar4,param_2,iVar1);
    FUN_14000c4a0(param_1,iVar5);
  }
  return;
}



longlong * FUN_1400a6a40(longlong *param_1)

{
  int *piVar1;
  uchar *puVar2;
  undefined *puVar3;
  int iVar4;
  int iVar5;
  uchar *_Ptr;
  uchar *puVar6;
  int iVar7;
  undefined *_Dst;
  
  _Ptr = (uchar *)*param_1;
  if ((uchar *)*param_1 == (uchar *)0x0) {
    _Ptr = PTR_DAT_1402f8008;
  }
  iVar4 = FUN_1400a3430(*_Ptr);
  while (iVar4 != 0) {
    _Ptr = _mbsinc(_Ptr);
    iVar4 = FUN_1400a3430(*_Ptr);
  }
  puVar2 = (uchar *)*param_1;
  puVar6 = puVar2;
  if (puVar2 == (uchar *)0x0) {
    puVar6 = PTR_DAT_1402f8008;
  }
  if (_Ptr != puVar6) {
    iVar4 = (int)puVar2;
    if (puVar2 == (uchar *)0x0) {
      iVar4 = (int)PTR_DAT_1402f8008;
    }
    iVar4 = (int)_Ptr - iVar4;
    if (puVar2 == (uchar *)0x0) {
      iVar5 = 0;
    }
    else if (puVar2 == PTR_DAT_1402f8008) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(puVar2 + -8);
    }
    if (puVar2 == (uchar *)0x0) {
      iVar7 = 0;
    }
    else if (puVar2 == PTR_DAT_1402f8008) {
      iVar7 = 0;
    }
    else {
      iVar7 = *(int *)(puVar2 + -8);
    }
    if (iVar5 <= iVar7) {
      if (puVar2 == (uchar *)0x0) {
        iVar5 = 0;
      }
      else if (puVar2 == PTR_DAT_1402f8008) {
        iVar5 = 0;
      }
      else {
        iVar5 = *(int *)(puVar2 + -8);
      }
    }
    iVar7 = 1;
    if (1 < iVar5) {
      iVar7 = iVar5;
    }
    if (puVar2 == (uchar *)0x0) {
      iVar5 = 0;
    }
    else if (puVar2 == PTR_DAT_1402f8008) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(puVar2 + -8);
    }
    if (iVar5 < iVar7) {
      FUN_14000c1c0(param_1,iVar7);
    }
    FUN_14000c330(param_1);
    puVar3 = (undefined *)*param_1;
    _Dst = puVar3;
    if (puVar3 == (undefined *)0x0) {
      _Dst = PTR_DAT_1402f8008;
    }
    if (puVar3 == (undefined *)0x0) {
      iVar5 = 0;
    }
    else if (puVar3 == PTR_DAT_1402f8008) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(puVar3 + -8);
    }
    iVar5 = iVar5 - iVar4;
    if (puVar3 == (undefined *)0x0) {
      iVar7 = 0;
    }
    else if (puVar3 == PTR_DAT_1402f8008) {
      iVar7 = 0;
    }
    else {
      iVar7 = *(int *)(puVar3 + -8);
    }
    memmove_s(_Dst,(longlong)(iVar7 + 1),_Dst + iVar4,(longlong)(iVar5 + 1));
    puVar3 = (undefined *)*param_1;
    iVar4 = 0;
    if (0 < iVar5) {
      iVar4 = iVar5;
    }
    if (puVar3 == (undefined *)0x0) {
      iVar5 = 0;
    }
    else if (puVar3 == PTR_DAT_1402f8008) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(puVar3 + -8);
    }
    if (iVar5 <= iVar4) {
      if (puVar3 == (undefined *)0x0) {
        iVar4 = 0;
      }
      else if (puVar3 == PTR_DAT_1402f8008) {
        iVar4 = 0;
      }
      else {
        iVar4 = *(int *)(puVar3 + -8);
      }
    }
    if (((puVar3 != PTR_DAT_1402f8008) && (puVar3 != (undefined *)0x0)) &&
       (piVar1 = (int *)(puVar3 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar4;
      *(undefined1 *)((longlong)iVar4 + 8 + (longlong)piVar1) = 0;
    }
  }
  return param_1;
}



void FUN_1400a6c00(longlong *param_1,int param_2)

{
  int *piVar1;
  undefined *puVar2;
  int iVar3;
  int iVar4;
  
  FUN_14000c420();
  puVar2 = (undefined *)*param_1;
  iVar3 = 0;
  if (0 < param_2) {
    iVar3 = param_2;
  }
  if (puVar2 == (undefined *)0x0) {
    iVar4 = 0;
  }
  else if (puVar2 == PTR_DAT_1402f8008) {
    iVar4 = 0;
  }
  else {
    iVar4 = *(int *)(puVar2 + -8);
  }
  if (iVar4 <= iVar3) {
    if (puVar2 == (undefined *)0x0) {
      iVar3 = 0;
    }
    else if (puVar2 == PTR_DAT_1402f8008) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(puVar2 + -8);
    }
  }
  if (((puVar2 != PTR_DAT_1402f8008) && (puVar2 != (undefined *)0x0)) &&
     (piVar1 = (int *)(puVar2 + -8), piVar1 != (int *)0x0)) {
    *piVar1 = iVar3;
    *(undefined1 *)((longlong)iVar3 + 8 + (longlong)piVar1) = 0;
  }
  return;
}



void FUN_1400a6c80(longlong param_1,longlong param_2)

{
  ulonglong uVar1;
  uint uVar2;
  ulonglong uVar3;
  
  if (0 < param_2) {
    uVar1 = 0;
    uVar3 = uVar1;
    do {
      FUN_14000c2a0(param_1 + uVar1 * 8);
      uVar2 = (int)uVar3 + 1;
      uVar3 = (ulonglong)uVar2;
      uVar1 = (ulonglong)(int)uVar2;
    } while ((longlong)uVar1 < param_2);
  }
  return;
}



longlong * FUN_1400a6cd0(longlong *param_1)

{
  uchar uVar1;
  int iVar2;
  uchar *_Ptr;
  undefined *puVar3;
  uchar *puVar4;
  
  _Ptr = (uchar *)*param_1;
  if ((uchar *)*param_1 == (uchar *)0x0) {
    _Ptr = PTR_DAT_1402f8008;
  }
  puVar4 = (uchar *)0x0;
  uVar1 = *_Ptr;
  if (uVar1 != '\0') {
    do {
      iVar2 = FUN_1400a3430(uVar1);
      if (iVar2 == 0) {
        puVar4 = (uchar *)0x0;
      }
      else if (puVar4 == (uchar *)0x0) {
        puVar4 = _Ptr;
      }
      _Ptr = _mbsinc(_Ptr);
      uVar1 = *_Ptr;
    } while (uVar1 != '\0');
    if (puVar4 != (uchar *)0x0) {
      puVar3 = (undefined *)*param_1;
      if ((undefined *)*param_1 == (undefined *)0x0) {
        puVar3 = PTR_DAT_1402f8008;
      }
      FUN_1400a6c00(param_1,(int)puVar4 - (int)puVar3);
    }
  }
  return param_1;
}



void FUN_1400a6d60(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  int iVar4;
  undefined8 uVar5;
  undefined8 *puVar6;
  int iVar7;
  longlong lVar8;
  undefined8 *puVar9;
  undefined1 local_88 [80];
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  iVar4 = *(int *)(param_1 + 0x18);
  if (param_2 != iVar4) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar4 = FUN_1401a7da0(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
      lVar8 = (longlong)iVar4;
      plVar2 = *(longlong **)(param_1 + 8);
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar2 == (longlong *)0x0) {
          uVar5 = FUN_1400a34c0(lVar8 << 3);
        }
        else {
          uVar5 = (**(code **)(*plVar2 + 8))(plVar2,lVar8 << 3);
        }
        *(undefined8 *)(param_1 + 0x10) = uVar5;
        FUN_1400a67a0(uVar5,(longlong)param_2);
      }
      else {
        lVar3 = *(longlong *)(param_1 + 0x10);
        if (plVar2 == (longlong *)0x0) {
          puVar6 = (undefined8 *)FUN_1400a34c0(lVar8 << 3);
        }
        else {
          puVar6 = (undefined8 *)(**(code **)(*plVar2 + 8))(plVar2,lVar8 << 3);
        }
        iVar1 = *(int *)(param_1 + 0x18);
        iVar7 = 0;
        if (0 < (longlong)iVar1) {
          lVar8 = 0;
          puVar9 = puVar6;
          do {
            if (puVar9 != (undefined8 *)0x0) {
              FUN_1400a3440();
              *puVar9 = PTR_DAT_1402f8008;
              FUN_1400223a0(puVar9,lVar3 + lVar8 * 8);
            }
            iVar7 = iVar7 + 1;
            puVar9 = puVar9 + 1;
            lVar8 = (longlong)iVar7;
          } while (lVar8 < iVar1);
        }
        FUN_1400a67a0(puVar6 + *(int *)(param_1 + 0x18),
                      (longlong)(param_2 - *(int *)(param_1 + 0x18)));
        if (puVar6 == (undefined8 *)0x0) {
          FUN_1400a2320(local_88,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_88,(ThrowInfo *)&DAT_1402f4860);
        }
        FUN_1400a6c80(lVar3,(longlong)*(int *)(param_1 + 0x18));
        plVar2 = *(longlong **)(param_1 + 8);
        if (plVar2 == (longlong *)0x0) {
          FUN_1400a3530(lVar3);
        }
        else {
          (**(code **)(*plVar2 + 0x18))(plVar2,lVar3);
        }
        *(undefined8 **)(param_1 + 0x10) = puVar6;
      }
      *(int *)(param_1 + 0x1c) = iVar4;
    }
    else if (iVar4 - param_2 < 1) {
      if (0 < param_2 - iVar4) {
        FUN_1400a67a0(*(longlong *)(param_1 + 0x10) + (longlong)iVar4 * 8,
                      (longlong)(param_2 - iVar4));
      }
    }
    else {
      FUN_1400a6c80(*(longlong *)(param_1 + 0x10) + (longlong)param_2 * 8,
                    (longlong)(iVar4 - param_2));
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1400a6f50(longlong param_1,undefined8 *param_2)

{
  int *piVar1;
  undefined2 uVar2;
  undefined *puVar3;
  undefined1 *puVar4;
  undefined4 uVar5;
  undefined8 uVar6;
  undefined *puVar7;
  undefined1 auStack_188 [32];
  undefined4 local_168;
  undefined *local_160;
  undefined1 local_158;
  undefined8 local_150;
  undefined8 *local_148;
  undefined1 *local_138;
  undefined1 local_130 [264];
  ulonglong local_28;
  
  local_150 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_188;
  local_168 = 0;
  uVar5 = *(undefined4 *)(param_1 + 8);
  local_148 = param_2;
  FUN_1400a3440();
  local_160 = PTR_DAT_1402f8008;
  uVar2 = *(undefined2 *)(param_1 + 0xc);
  uVar6 = Ordinal_12(uVar5);
  FUN_1400a50f0(&local_160,"%s:%d",uVar6,uVar2);
  puVar3 = local_160;
  puVar7 = local_160;
  if (local_160 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1402f8008;
  }
  local_138 = local_130;
  FUN_14008a6c0(&local_138,puVar7,3);
  puVar4 = local_138;
  FUN_1400a3440();
  *param_2 = PTR_DAT_1402f8010;
  uVar5 = FUN_1400a32c0(puVar4);
  uVar6 = FUN_140002f20(param_2,uVar5);
  FUN_1400a32f0(uVar6,puVar4,uVar5);
  FUN_140003000(param_2);
  local_168 = 1;
  if (local_138 != local_130) {
    free(local_138);
  }
  if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1402f8008)) &&
     (puVar3 + -8 != (undefined *)0x0)) {
    puVar7 = (undefined *)FUN_1400a3440();
    local_160 = puVar7;
    FUN_1400a1c30(puVar7);
    local_158 = 1;
    piVar1 = (int *)(puVar3 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar3 + -8);
    }
    FUN_1400d1290(puVar7);
  }
  return param_2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1400a70c0(longlong param_1,undefined8 *param_2)

{
  int *piVar1;
  undefined *puVar2;
  undefined1 *puVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined *puVar6;
  undefined1 auStack_188 [32];
  undefined4 local_168;
  undefined *local_160;
  undefined1 local_158;
  undefined8 local_150;
  undefined8 *local_148;
  undefined1 *local_138;
  undefined1 local_130 [264];
  ulonglong local_28;
  
  local_150 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_188;
  local_168 = 0;
  uVar4 = *(undefined4 *)(param_1 + 8);
  local_148 = param_2;
  FUN_1400a3440();
  local_160 = PTR_DAT_1402f8008;
  uVar5 = Ordinal_12(uVar4);
  FUN_1400a2120(&local_160,uVar5);
  puVar2 = local_160;
  puVar6 = local_160;
  if (local_160 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8008;
  }
  local_138 = local_130;
  FUN_14008a6c0(&local_138,puVar6,3);
  puVar3 = local_138;
  FUN_1400a3440();
  *param_2 = PTR_DAT_1402f8010;
  uVar4 = FUN_1400a32c0(puVar3);
  uVar5 = FUN_140002f20(param_2,uVar4);
  FUN_1400a32f0(uVar5,puVar3,uVar4);
  FUN_140003000(param_2);
  local_168 = 1;
  if (local_138 != local_130) {
    free(local_138);
  }
  if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8008)) &&
     (puVar2 + -8 != (undefined *)0x0)) {
    puVar6 = (undefined *)FUN_1400a3440();
    local_160 = puVar6;
    FUN_1400a1c30(puVar6);
    local_158 = 1;
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2 + -8);
    }
    FUN_1400d1290(puVar6);
  }
  return param_2;
}



undefined8 * FUN_1400a7220(longlong param_1,undefined8 *param_2)

{
  undefined4 uVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  
  uVar2 = Ordinal_12(*(undefined4 *)(param_1 + 8));
  FUN_1400a3440();
  *param_2 = PTR_DAT_1402f8008;
  uVar1 = FUN_1400a3360(uVar2);
  uVar3 = FUN_14000c420(param_2,uVar1);
  FUN_1400a3390(uVar3,uVar2,uVar1);
  FUN_14000c510(param_2);
  return param_2;
}



undefined8 * FUN_1400a72a0(undefined8 *param_1,undefined8 param_2,undefined2 param_3)

{
  FUN_1400a3440();
  *param_1 = PTR_DAT_1402f8008;
  FUN_1400a2120(param_1,param_2);
  *(undefined2 *)(param_1 + 1) = param_3;
  return param_1;
}



undefined8 *
FUN_1400a7310(undefined8 *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined *local_res18;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1400a3440();
  *param_1 = PTR_DAT_1402f8008;
  uVar2 = FUN_1400a7220(param_2,&local_res18,param_3,param_4,uVar2);
  FUN_1400223a0(param_1,uVar2);
  if (((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1402f8008)) &&
     (local_res18 + -8 != (undefined *)0x0)) {
    uVar2 = FUN_1400a3440();
    FUN_1400a1c30(uVar2);
    piVar1 = (int *)(local_res18 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res18 + -8);
    }
    FUN_1400d1290(uVar2);
  }
  *(undefined2 *)(param_1 + 1) = *(undefined2 *)(param_2 + 0xc);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1400a73d0(longlong *param_1,undefined8 *param_2)

{
  int *piVar1;
  undefined1 *puVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  undefined *puVar5;
  undefined *puVar6;
  undefined1 auStack_188 [32];
  undefined4 local_168;
  undefined *local_160;
  undefined1 local_158;
  undefined8 local_150;
  undefined8 *local_148;
  undefined1 *local_138;
  undefined1 local_130 [264];
  ulonglong local_28;
  
  local_150 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_188;
  local_168 = 0;
  local_148 = param_2;
  FUN_1400a3440();
  local_160 = PTR_DAT_1402f8008;
  puVar6 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8008;
  }
  FUN_1400a50f0(&local_160,"%s:%d",puVar6,(short)param_1[1]);
  puVar6 = local_160;
  puVar5 = local_160;
  if (local_160 == (undefined *)0x0) {
    puVar5 = PTR_DAT_1402f8008;
  }
  local_138 = local_130;
  FUN_14008a6c0(&local_138,puVar5,3);
  puVar2 = local_138;
  FUN_1400a3440();
  *param_2 = PTR_DAT_1402f8010;
  uVar3 = FUN_1400a32c0(puVar2);
  uVar4 = FUN_140002f20(param_2,uVar3);
  FUN_1400a32f0(uVar4,puVar2,uVar3);
  FUN_140003000(param_2);
  local_168 = 1;
  if (local_138 != local_130) {
    free(local_138);
  }
  if (((puVar6 != (undefined *)0x0) && (puVar6 != PTR_DAT_1402f8008)) &&
     (puVar6 + -8 != (undefined *)0x0)) {
    puVar5 = (undefined *)FUN_1400a3440();
    local_160 = puVar5;
    FUN_1400a1c30(puVar5);
    local_158 = 1;
    piVar1 = (int *)(puVar6 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar6 + -8);
    }
    FUN_1400d1290(puVar5);
  }
  return param_2;
}



void FUN_1400a7540(undefined8 param_1,char *param_2)

{
  char cVar1;
  longlong lVar2;
  
  if (param_2 != (char *)0x0) {
    lVar2 = -1;
    do {
      if (lVar2 == 0) break;
      lVar2 = lVar2 + -1;
      cVar1 = *param_2;
      param_2 = param_2 + 1;
    } while (cVar1 != '\0');
    if (lVar2 != -2) {
      FUN_1400a2120(param_1);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1400a7580(undefined8 *param_1)

{
  int *piVar1;
  undefined *puVar2;
  undefined1 *puVar3;
  int iVar4;
  undefined4 uVar5;
  longlong lVar6;
  undefined8 uVar7;
  undefined *puVar8;
  uint uVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  undefined1 auStack_208 [32];
  undefined *local_1e8;
  undefined *local_1e0;
  undefined8 local_1d8;
  undefined1 local_1d0;
  undefined8 local_1c8;
  undefined1 *local_1b8;
  undefined1 local_1b0 [264];
  undefined1 local_a8 [128];
  ulonglong local_28;
  
  local_1c8 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_208;
  uVar10 = 0;
  local_1e8 = (undefined *)((ulonglong)local_1e8 & 0xffffffff00000000);
  iVar4 = Ordinal_57(local_a8,0x80);
  if (((iVar4 == 0) && (lVar6 = Ordinal_52(local_a8), lVar6 != 0)) &&
     (**(longlong **)(lVar6 + 0x18) != 0)) {
    FUN_1400a3440();
    local_1e0 = PTR_DAT_1402f8008;
    uVar11 = uVar10;
    if (0 < *(short *)(lVar6 + 0x12)) {
      do {
        FUN_1400a3440();
        local_1e8 = PTR_DAT_1402f8008;
        if (0 < (longlong)uVar11) {
          FUN_1400a6950(&local_1e0,&DAT_140283d4c);
        }
        FUN_1400a50f0(&local_1e8,&DAT_140205900,
                      *(undefined1 *)(**(longlong **)(lVar6 + 0x18) + uVar11));
        FUN_1400a4f60(&local_1e0,&local_1e8);
        puVar2 = local_1e8;
        if (((local_1e8 != (undefined *)0x0) && (local_1e8 != PTR_DAT_1402f8008)) &&
           (puVar8 = local_1e8 + -8, puVar8 != (undefined *)0x0)) {
          uVar7 = FUN_1400a3440();
          local_1d8 = uVar7;
          FUN_1400a1c30(uVar7);
          local_1d0 = 1;
          piVar1 = (int *)(puVar2 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(puVar8);
          }
          FUN_1400d1290(uVar7);
          local_1d0 = 0;
        }
        uVar9 = (int)uVar10 + 1;
        uVar10 = (ulonglong)uVar9;
        uVar11 = uVar11 + 1;
      } while ((int)uVar9 < (int)*(short *)(lVar6 + 0x12));
    }
    puVar2 = local_1e0;
    puVar8 = local_1e0;
    if (local_1e0 == (undefined *)0x0) {
      puVar8 = PTR_DAT_1402f8008;
    }
    local_1b8 = local_1b0;
    FUN_14008a6c0(&local_1b8,puVar8,3);
    puVar3 = local_1b8;
    FUN_1400a3440();
    *param_1 = PTR_DAT_1402f8010;
    uVar5 = FUN_1400a32c0(puVar3);
    uVar7 = FUN_140002f20(param_1,uVar5);
    FUN_1400a32f0(uVar7,puVar3,uVar5);
    FUN_140003000(param_1);
    if (local_1b8 != local_1b0) {
      free(local_1b8);
    }
    if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8008)) &&
       (puVar2 + -8 != (undefined *)0x0)) {
      uVar7 = FUN_1400a3440();
      local_1d8 = uVar7;
      FUN_1400a1c30(uVar7);
      local_1d0 = 1;
      piVar1 = (int *)(puVar2 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar2 + -8);
      }
      FUN_1400d1290(uVar7);
    }
  }
  else {
    FUN_1400a3440();
    *param_1 = PTR_DAT_1402f8010;
    uVar5 = FUN_1400a32c0(&DAT_14027d1a0);
    uVar7 = FUN_140002f20(param_1,uVar5);
    FUN_1400a32f0(uVar7,&DAT_14027d1a0,uVar5);
    FUN_140003000(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

longlong FUN_1400a7820(longlong param_1)

{
  int *piVar1;
  undefined *puVar2;
  undefined2 uVar3;
  undefined4 uVar4;
  undefined *puVar5;
  undefined *puVar6;
  undefined1 auStack_e8 [32];
  undefined *local_c8;
  undefined1 local_c0;
  undefined8 local_b8;
  longlong local_b0;
  undefined1 *local_a8;
  undefined1 local_a0 [136];
  ulonglong local_18;
  
  local_b8 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_e8;
  local_b0 = param_1;
  uVar4 = FUN_1401692e0();
  FUN_1400a1b50(param_1,uVar4,1);
  *(undefined ***)(param_1 + 0x38) = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 0x40) = 0;
  *(undefined2 *)(param_1 + 0x44) = 0;
  FUN_1400a66e0();
  FUN_1400a7580(&local_c8);
  puVar2 = local_c8;
  puVar6 = local_c8;
  if (local_c8 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8010;
  }
  local_a8 = local_a0;
  FUN_1400a1e40(&local_a8,puVar6,3);
  uVar4 = Ordinal_11(local_a8);
  if (local_a8 != local_a0) {
    free(local_a8);
  }
  *(undefined4 *)(param_1 + 0x40) = uVar4;
  uVar3 = Ordinal_9(0);
  *(undefined2 *)(param_1 + 0x44) = uVar3;
  if (((local_c8 != (undefined *)0x0) && (local_c8 != PTR_DAT_1402f8010)) &&
     (puVar6 = local_c8 + -8, puVar6 != (undefined *)0x0)) {
    puVar5 = (undefined *)FUN_1400a3440();
    local_c8 = puVar5;
    FUN_1400a1c30(puVar5);
    local_c0 = 1;
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar6);
    }
    FUN_1400d1290(puVar5);
  }
  return param_1;
}



undefined8 FUN_1400a7960(longlong *param_1)

{
  int iVar1;
  undefined8 uVar2;
  undefined *puVar3;
  
  uVar2 = FUN_1400a6cd0();
  uVar2 = FUN_1400a6a40(uVar2);
  FUN_1400223a0(param_1,uVar2);
  if (((short)param_1[1] != 0) && ((short)param_1[1] != -1)) {
    puVar3 = (undefined *)*param_1;
    if ((undefined *)*param_1 == (undefined *)0x0) {
      puVar3 = PTR_DAT_1402f8008;
    }
    iVar1 = FUN_1400a33c0(puVar3,&DAT_14027a10a);
    if (iVar1 != 0) {
      puVar3 = (undefined *)*param_1;
      if ((undefined *)*param_1 == (undefined *)0x0) {
        puVar3 = PTR_DAT_1402f8008;
      }
      iVar1 = FUN_1400a33c0(puVar3,"0.0.0.0");
      if (iVar1 != 0) {
        puVar3 = (undefined *)*param_1;
        if ((undefined *)*param_1 == (undefined *)0x0) {
          puVar3 = PTR_DAT_1402f8008;
        }
        iVar1 = FUN_1400a33c0(puVar3,"255.255.255.255");
        if (iVar1 != 0) {
          return 1;
        }
      }
    }
  }
  return 0;
}



undefined * FUN_1400a7a10(void)

{
  bool bVar1;
  char cVar2;
  
  bVar1 = false;
  cVar2 = FUN_1400a1cc0(&DAT_1403141e0);
  if (cVar2 != '\0') {
    if (DAT_1402f83c0 == '\0') {
      bVar1 = false;
    }
    else {
      bVar1 = true;
      FUN_1400a1c30(&DAT_1403141e0);
    }
  }
  if ((DAT_1403141d8 & 1) == 0) {
    DAT_1403141d8 = DAT_1403141d8 | 1;
    FUN_1400a7820(&DAT_140314190);
    atexit((_func_5014 *)&LAB_140202900);
  }
  DAT_1402f83c0 = 0;
  if (bVar1) {
    FUN_1400d1290(&DAT_1403141e0);
  }
  return &DAT_140314190;
}



undefined8 * FUN_1400a7ad0(undefined8 *param_1)

{
  undefined2 uVar1;
  undefined4 uVar2;
  longlong lVar3;
  
  lVar3 = FUN_1400a7a10();
  uVar2 = *(undefined4 *)(lVar3 + 0x40);
  uVar1 = *(undefined2 *)(lVar3 + 0x44);
  *param_1 = Proud::AddrPort::vftable;
  *(undefined2 *)((longlong)param_1 + 0xc) = uVar1;
  *(undefined4 *)(param_1 + 1) = uVar2;
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400a7b00(longlong param_1)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  int iVar4;
  longlong lVar5;
  undefined8 uVar6;
  longlong lVar7;
  longlong lVar8;
  uint uVar9;
  int iVar11;
  ulonglong uVar12;
  longlong lVar13;
  longlong lVar14;
  longlong lVar15;
  undefined1 auStack_128 [32];
  undefined *local_108;
  undefined *local_100;
  longlong local_f8;
  longlong local_f0;
  undefined8 local_e8;
  undefined1 local_e0;
  undefined8 local_d8;
  undefined1 local_d0;
  undefined8 local_c8;
  undefined1 local_b8 [128];
  ulonglong local_38;
  ulonglong uVar10;
  
  local_c8 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_128;
  local_f8 = param_1;
  FUN_1400a66e0();
  FUN_1400a6d60(param_1,0);
  iVar4 = Ordinal_57(local_b8,0x80);
  if ((iVar4 == 0) && (lVar5 = Ordinal_52(local_b8), lVar5 != 0)) {
    local_f0 = lVar5;
    for (lVar15 = 0; uVar10 = 0, *(longlong *)(lVar15 + *(longlong *)(lVar5 + 0x18)) != 0;
        lVar15 = lVar15 + 8) {
      FUN_1400a3440();
      local_108 = PTR_DAT_1402f8008;
      uVar12 = uVar10;
      if (0 < *(short *)(lVar5 + 0x12)) {
        do {
          FUN_1400a3440();
          local_100 = PTR_DAT_1402f8008;
          if (0 < (longlong)uVar12) {
            FUN_1400a6950(&local_108,&DAT_140283d4c);
          }
          FUN_1400a50f0(&local_100,&DAT_140205900,
                        *(undefined1 *)
                         (*(longlong *)(lVar15 + *(longlong *)(lVar5 + 0x18)) + uVar12));
          FUN_1400a4f60(&local_108,&local_100);
          puVar3 = local_100;
          if (((local_100 != (undefined *)0x0) && (local_100 != PTR_DAT_1402f8008)) &&
             (puVar1 = local_100 + -8, puVar1 != (undefined *)0x0)) {
            uVar6 = FUN_1400a3440();
            local_e8 = uVar6;
            FUN_1400a1c30(uVar6);
            local_e0 = 1;
            piVar2 = (int *)(puVar3 + -4);
            *piVar2 = *piVar2 + -1;
            if (*piVar2 == 0) {
              FUN_1400a3530(puVar1);
            }
            FUN_1400d1290(uVar6);
            local_e0 = 0;
          }
          uVar9 = (int)uVar10 + 1;
          uVar10 = (ulonglong)uVar9;
          uVar12 = uVar12 + 1;
        } while ((int)uVar9 < (int)*(short *)(lVar5 + 0x12));
      }
      puVar3 = local_108;
      iVar4 = *(int *)(param_1 + 0x18);
      if (iVar4 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      iVar11 = *(int *)(param_1 + 0x18);
      FUN_1400a6d60(param_1,iVar11 + 1);
      lVar8 = local_f8;
      iVar11 = iVar11 - iVar4;
      if ((0 < iVar11) && (iVar11 = iVar11 + -1, -1 < iVar11)) {
        lVar13 = (longlong)(iVar11 + iVar4 + 1) << 3;
        lVar14 = (longlong)(iVar11 + iVar4) << 3;
        do {
          lVar5 = FUN_1401b2160(lVar8);
          lVar7 = FUN_1401b2160(lVar8);
          FUN_1400223a0(lVar13 + lVar7,lVar14 + lVar5);
          lVar14 = lVar14 + -8;
          lVar13 = lVar13 + -8;
          iVar11 = iVar11 + -1;
          param_1 = local_f8;
          lVar5 = local_f0;
        } while (-1 < iVar11);
      }
      lVar8 = FUN_1401b2160(param_1);
      FUN_1400223a0(lVar8 + (longlong)iVar4 * 8,&local_108);
      if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1402f8008)) &&
         (puVar3 + -8 != (undefined *)0x0)) {
        uVar6 = FUN_1400a3440();
        local_d8 = uVar6;
        FUN_1400a1c30(uVar6);
        local_d0 = 1;
        piVar2 = (int *)(puVar3 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(puVar3 + -8);
        }
        FUN_1400d1290(uVar6);
        local_d0 = 0;
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1400a7db0(void)

{
  ulonglong uVar1;
  undefined1 auStack_1d8 [32];
  undefined1 local_1b8 [416];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_1d8;
  uVar1 = Ordinal_115(2,local_1b8);
  if ((int)uVar1 == 0) {
    if (((char)local_1b8._0_2_ == '\x02') && (SUB21(local_1b8._0_2_,1) == '\0')) {
      return 1;
    }
    uVar1 = Ordinal_116();
  }
  return uVar1 & 0xffffffffffffff00;
}



void FUN_1400a7e30(longlong param_1,undefined8 *param_2,undefined1 param_3)

{
  *(undefined1 *)(param_1 + 0x40) = param_3;
  if (param_2 != (undefined8 *)0x0) {
    *(undefined8 *)(param_1 + 0x18) = *param_2;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1400a7e50(longlong param_1,undefined8 *param_2)

{
  undefined2 uVar1;
  int iVar2;
  undefined1 auStack_48 [32];
  undefined4 local_28 [2];
  undefined1 local_20 [2];
  undefined2 local_1e;
  undefined4 local_1c;
  ulonglong local_10;
  
  local_10 = DAT_1402f85a0 ^ (ulonglong)auStack_48;
  local_28[0] = 0x10;
  iVar2 = Ordinal_6(*(undefined8 *)(param_1 + 0x3d0),local_20,local_28);
  if (iVar2 == 0) {
    uVar1 = Ordinal_15(local_1e);
    *(undefined4 *)(param_2 + 1) = local_1c;
    *param_2 = Proud::AddrPort::vftable;
    *(undefined2 *)((longlong)param_2 + 0xc) = uVar1;
  }
  else {
    *param_2 = Proud::AddrPort::vftable;
    *(undefined4 *)(param_2 + 1) = DAT_1402f83d0;
    *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1402f83d4;
  }
  return param_2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1400a7ef0(longlong param_1,undefined8 *param_2)

{
  undefined2 uVar1;
  int iVar2;
  undefined1 auStack_48 [32];
  undefined4 local_28 [2];
  undefined1 local_20 [2];
  undefined2 local_1e;
  undefined4 local_1c;
  ulonglong local_10;
  
  local_10 = DAT_1402f85a0 ^ (ulonglong)auStack_48;
  local_28[0] = 0x10;
  iVar2 = Ordinal_5(*(undefined8 *)(param_1 + 0x3d0),local_20,local_28);
  if (iVar2 == 0) {
    uVar1 = Ordinal_15(local_1e);
    *(undefined4 *)(param_2 + 1) = local_1c;
    *param_2 = Proud::AddrPort::vftable;
    *(undefined2 *)((longlong)param_2 + 0xc) = uVar1;
  }
  else {
    *param_2 = Proud::AddrPort::vftable;
    *(undefined4 *)(param_2 + 1) = DAT_1402f83d0;
    *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1402f83d4;
  }
  return param_2;
}



undefined1 FUN_1400a7f90(longlong param_1)

{
  return *(undefined1 *)(param_1 + 0x21);
}



void FUN_1400a7fa0(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 0x21) = param_2;
  return;
}



void FUN_1400a7fb0(longlong param_1,undefined8 param_2)

{
  undefined1 local_58 [88];
  
  if (*(longlong *)(param_1 + 0x2e8) != 0) {
    FUN_1400a2320(local_58,&DAT_1402059a0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  *(undefined8 *)(param_1 + 0x2e8) = param_2;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400a7ff0(longlong param_1)

{
  undefined1 auStack_78 [32];
  undefined8 *local_58;
  undefined4 local_50;
  undefined1 *local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined1 local_28 [8];
  undefined4 local_20;
  undefined2 local_1c;
  undefined4 local_1a;
  undefined4 local_16;
  undefined2 local_12;
  ulonglong local_10;
  
  local_10 = DAT_1402f85a0 ^ (ulonglong)auStack_78;
  local_1c = 0xcbac;
  local_38 = 0;
  local_40 = 0;
  local_48 = local_28;
  local_50 = 8;
  local_20 = 0xb5367df1;
  local_1a = 0xca9511cf;
  local_58 = &DAT_140314280;
  local_16 = 0x485f8000;
  local_12 = 0x92a1;
  WSAIoctl(*(undefined8 *)(param_1 + 0x3d0),0xc8000006,&local_20,0x10);
  return;
}



void FUN_1400a8090(longlong param_1,char param_2)

{
  uint local_res10 [6];
  
  local_res10[0] = (uint)(param_2 == '\0');
  Ordinal_10(*(undefined8 *)(param_1 + 0x3d0),0x8004667e,local_res10);
  return;
}



void FUN_1400a80c0(longlong param_1,char param_2)

{
  int iVar1;
  uint local_res10 [6];
  
  local_res10[0] = (uint)(param_2 == '\0');
  iVar1 = Ordinal_21(*(undefined8 *)(param_1 + 0x3d0),6,1,local_res10,4);
  if (iVar1 == -1) {
    Ordinal_111();
  }
  return;
}



undefined4 * FUN_1400a8110(undefined4 *param_1)

{
  *param_1 = 0;
  param_1[0x82] = 0;
  param_1[0x104] = 0;
  return param_1;
}



void FUN_1400a8130(longlong param_1,longlong param_2)

{
  uint uVar1;
  longlong *plVar2;
  uint uVar3;
  ulonglong uVar4;
  
  uVar1 = *(uint *)(param_1 + 0x208);
  uVar4 = 0;
  if (uVar1 != 0) {
    plVar2 = (longlong *)(param_1 + 0x210);
    do {
      if (*plVar2 == *(longlong *)(param_2 + 0x3d0)) break;
      uVar3 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar3;
      plVar2 = plVar2 + 1;
    } while (uVar3 < uVar1);
  }
  if (((uint)uVar4 == uVar1) && (uVar1 < 0x40)) {
    *(undefined8 *)(param_1 + 0x210 + uVar4 * 8) = *(undefined8 *)(param_2 + 0x3d0);
    *(int *)(param_1 + 0x208) = *(int *)(param_1 + 0x208) + 1;
  }
  return;
}



void FUN_1400a8190(longlong param_1,longlong param_2)

{
  uint uVar1;
  longlong *plVar2;
  uint uVar3;
  ulonglong uVar4;
  
  uVar1 = *(uint *)(param_1 + 0x410);
  uVar4 = 0;
  if (uVar1 != 0) {
    plVar2 = (longlong *)(param_1 + 0x418);
    do {
      if (*plVar2 == *(longlong *)(param_2 + 0x3d0)) break;
      uVar3 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar3;
      plVar2 = plVar2 + 1;
    } while (uVar3 < uVar1);
  }
  if (((uint)uVar4 == uVar1) && (uVar1 < 0x40)) {
    *(undefined8 *)(param_1 + 0x418 + uVar4 * 8) = *(undefined8 *)(param_2 + 0x3d0);
    *(int *)(param_1 + 0x410) = *(int *)(param_1 + 0x410) + 1;
  }
  return;
}



void FUN_1400a81f0(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint local_res8;
  int local_resc;
  
  puVar1 = (uint *)0x0;
  if (param_2 != 0xffffffff) {
    puVar1 = &local_res8;
    local_res8 = param_2 / 1000;
    local_resc = (param_2 % 1000) * 1000;
  }
  Ordinal_18(0,param_1,param_1 + 0x208,param_1 + 0x410,puVar1);
  return;
}



undefined8 FUN_1400a8250(longlong param_1,longlong param_2,undefined4 *param_3)

{
  int iVar1;
  undefined4 local_res8 [2];
  undefined4 local_res10 [2];
  
  iVar1 = Ordinal_151(*(undefined8 *)(param_2 + 0x3d0),param_1 + 0x208);
  if (iVar1 != 0) {
    *param_3 = 0;
    return 1;
  }
  iVar1 = Ordinal_151(*(undefined8 *)(param_2 + 0x3d0),param_1 + 0x410);
  if (iVar1 != 0) {
    local_res8[0] = 0;
    local_res10[0] = 4;
    Ordinal_7(*(undefined8 *)(param_2 + 0x3d0),0xffff,0x1007,local_res8,local_res10);
    *param_3 = local_res8[0];
    return 1;
  }
  return 0;
}



undefined8 FUN_1400a8320(undefined8 param_1)

{
  FUN_1400a7db0();
  return param_1;
}



undefined8 * FUN_1400a8350(undefined8 *param_1)

{
  *param_1 = Proud::IHasOverlappedIo::vftable;
  *(undefined1 *)(param_1 + 8) = 0;
  *(undefined1 *)(param_1 + 0x10) = 0;
  return param_1;
}



void FUN_1400a8370(undefined8 *param_1)

{
  *param_1 = Proud::IHasOverlappedIo::vftable;
  return;
}



undefined8 * FUN_1400a8380(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::IHasOverlappedIo::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1400a83b0(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if ((longlong *)param_2[2] != param_1) {
    FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                  L"Proud::CListNode<class Proud::CFastSocket>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  plVar1 = (longlong *)param_2[1];
  lVar2 = *param_2;
  if (plVar1 != (longlong *)0x0) {
    *plVar1 = lVar2;
  }
  if (lVar2 != 0) {
    *(longlong **)(lVar2 + 8) = plVar1;
  }
  if (plVar1 == (longlong *)0x0) {
    if ((longlong *)param_1[1] != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::CFastSocket>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if ((longlong *)*param_1 != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::CFastSocket>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    *param_1 = (longlong)plVar1;
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  *(int *)(param_1 + 2) = (int)param_1[2] + -1;
  return;
}



void FUN_1400a8490(longlong param_1,char param_2)

{
  undefined4 uVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 uVar4;
  undefined1 local_50 [72];
  
  uVar4 = 0xfffffffffffffffe;
  lVar3 = param_1 + 0x28;
  FUN_1400a1c30();
  if (*(char *)(param_1 + 0x80) == '\0') {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2 == '\0') {
    lVar2 = WSASocketW(2,2,0,0,0,1,uVar4,lVar3,1);
  }
  else {
    lVar2 = Ordinal_23(2);
  }
  *(longlong *)(param_1 + 0x3d0) = lVar2;
  if (lVar2 == -1) {
    uVar1 = Ordinal_111();
    FUN_1400a2320(local_50,&DAT_140205aa8,uVar1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
  }
  *(undefined1 *)(param_1 + 0x80) = 0;
  *(int *)(param_1 + 0x310) = *(int *)(param_1 + 0x310) + 1;
  FUN_1400d1290(lVar3);
  return;
}



undefined8 FUN_1400a8570(longlong param_1,undefined1 param_2,undefined4 *param_3)

{
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  undefined4 local_res8 [2];
  undefined4 local_res20 [2];
  
  if ((*(int *)(param_1 + 0x180) != 0x103) && (*(char *)(param_1 + 0x1c0) != '\0')) {
    iVar1 = WSAGetOverlappedResult
                      (*(undefined8 *)(param_1 + 0x3d0),(int *)(param_1 + 0x180),local_res20,param_2
                       ,local_res8);
    if (iVar1 == 0) {
      iVar2 = Ordinal_111();
      if (iVar2 == 0x3e4) {
        return 0;
      }
    }
    *param_3 = local_res8[0];
    param_3[6] = local_res20[0];
    if (iVar1 == 0) {
      uVar3 = Ordinal_111();
      param_3[1] = uVar3;
    }
    *(undefined1 *)(param_1 + 0x1c0) = 0;
    FUN_1400a64a0(param_3 + 2,param_1 + 0x2f0);
    return 1;
  }
  return 0;
}



undefined8 FUN_1400a8640(longlong param_1,undefined1 param_2,undefined4 *param_3)

{
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  undefined4 local_res8 [2];
  undefined4 local_res20 [2];
  
  if ((*(char *)(param_1 + 0x100) != '\0') && (*(int *)(param_1 + 0xc0) != 0x103)) {
    iVar1 = WSAGetOverlappedResult
                      (*(undefined8 *)(param_1 + 0x3d0),(int *)(param_1 + 0xc0),local_res20,param_2,
                       local_res8);
    if (iVar1 == 0) {
      iVar2 = Ordinal_111();
      if (iVar2 == 0x3e4) {
        return 0;
      }
    }
    *param_3 = local_res8[0];
    param_3[6] = local_res20[0];
    if (iVar1 == 0) {
      uVar3 = Ordinal_111();
      param_3[1] = uVar3;
    }
    *(undefined1 *)(param_1 + 0x100) = 0;
    FUN_1400a64a0(param_3 + 2,param_1 + 0x2f0);
    return 1;
  }
  return 0;
}



undefined8 FUN_1400a8710(longlong param_1,undefined1 param_2,undefined4 *param_3)

{
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  undefined4 local_res8 [2];
  undefined4 local_res20 [2];
  
  if ((*(char *)(param_1 + 0x380) != '\0') && (*(int *)(param_1 + 0x340) != 0x103)) {
    iVar1 = WSAGetOverlappedResult
                      (*(undefined8 *)(param_1 + 0x3d0),(int *)(param_1 + 0x340),local_res20,param_2
                       ,local_res8);
    if (iVar1 == 0) {
      iVar2 = Ordinal_111();
      if (iVar2 == 0x3e4) {
        return 0;
      }
    }
    *param_3 = local_res8[0];
    param_3[6] = local_res20[0];
    if (iVar1 == 0) {
      uVar3 = Ordinal_111();
      param_3[1] = uVar3;
    }
    *(undefined1 *)(param_1 + 0x100) = 0;
    FUN_1400a64a0(param_3 + 2,param_1 + 0x2f0);
    return 1;
  }
  return 0;
}



undefined8 FUN_1400a87e0(longlong param_1,undefined1 param_2,uint *param_3)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  uint local_res8 [2];
  uint local_res20 [2];
  
  if ((*(int *)(param_1 + 0x240) == 0x103) || (*(char *)(param_1 + 0x280) == '\0')) {
    return 0;
  }
  iVar1 = WSAGetOverlappedResult
                    (*(undefined8 *)(param_1 + 0x3d0),(int *)(param_1 + 0x240),local_res8,param_2,
                     local_res20);
  if (iVar1 == 0) {
    iVar2 = Ordinal_111();
    if (iVar2 == 0x3e4) {
      return 0;
    }
  }
  else if ((local_res8[0] == 0) && (local_res20[0] == 0)) {
    return 0;
  }
  param_3[6] = local_res8[0];
  *param_3 = local_res20[0];
  if (iVar1 == 0) {
    uVar3 = Ordinal_111();
    param_3[1] = uVar3;
  }
  *(undefined1 *)(param_1 + 0x280) = 0;
  return 1;
}



void FUN_1400a88b0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined1 uVar3;
  
  uVar2 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x28;
  uVar3 = 1;
  FUN_1400a1c60();
  if (*(char *)(param_1 + 0x80) == '\0') {
    *(undefined1 *)(param_1 + 0x80) = 1;
    FUN_1400aba10(*(undefined8 *)(param_1 + 0x3d0));
    Ordinal_3(*(undefined8 *)(param_1 + 0x3d0));
    if (*(longlong *)(param_1 + 0x3c8) != 0) {
      if (*(longlong *)(*(longlong *)(param_1 + 0x3c8) + 0x28) == 0) {
        if (*(char *)(param_1 + 0x1c0) != '\0') {
          *(undefined8 *)(param_1 + 0x180) = 0x80;
          FUN_1400ac930(*(undefined8 *)(param_1 + 0x3c8),param_1,2,param_4,uVar2,lVar1,uVar3);
        }
        if (*(char *)(param_1 + 0x280) != '\0') {
          *(undefined8 *)(param_1 + 0x240) = 0x80;
          FUN_1400ac930(*(undefined8 *)(param_1 + 0x3c8),param_1,1,param_4,uVar2,lVar1,uVar3);
        }
      }
      FUN_1400acb00(*(undefined8 *)(param_1 + 0x3c8),param_1);
      *(undefined8 *)(param_1 + 0x3c8) = 0;
    }
  }
  FUN_1400d1290(lVar1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400a89a0(longlong param_1,longlong param_2,longlong param_3,longlong param_4)

{
  undefined4 uVar1;
  undefined2 uVar2;
  int iVar3;
  PVOID lpOutputBuffer;
  undefined4 uVar4;
  undefined1 auStackY_b8 [32];
  undefined4 local_78;
  int local_74 [3];
  undefined1 local_68 [2];
  undefined2 local_66;
  undefined4 local_64;
  sockaddr *local_58 [2];
  sockaddr *local_48 [2];
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStackY_b8;
  local_74[0] = 0x10;
  local_74[1] = 0x10;
  if (*(int *)(param_2 + 0x158) == 0) {
    lpOutputBuffer = (PVOID)0x0;
  }
  else {
    lpOutputBuffer = *(PVOID *)(param_2 + 0x150);
  }
  GetAcceptExSockaddrs(lpOutputBuffer,0,0x20,0x20,local_58,local_74,local_48,local_74 + 1);
  FUN_1400a64a0(param_3,local_58);
  FUN_1400a64a0(param_4,local_48);
  iVar3 = Ordinal_21(*(undefined8 *)(param_1 + 0x3d0),0xffff,0x700b,param_2 + 0x3d0);
  if (iVar3 == -1) {
    Ordinal_111();
  }
  local_78 = 0x10;
  iVar3 = Ordinal_5(*(undefined8 *)(param_1 + 0x3d0),local_68,&local_78);
  uVar1 = local_64;
  uVar4 = DAT_1402f83d0;
  uVar2 = DAT_1402f83d4;
  if (iVar3 == 0) {
    uVar2 = Ordinal_15(local_66);
    uVar4 = uVar1;
  }
  *(undefined4 *)(param_4 + 8) = uVar4;
  *(undefined2 *)(param_4 + 0xc) = uVar2;
  local_78 = 0x10;
  iVar3 = Ordinal_6(*(undefined8 *)(param_1 + 0x3d0),local_68,&local_78);
  uVar2 = DAT_1402f83d4;
  if (iVar3 == 0) {
    uVar2 = Ordinal_15(local_66);
    *(undefined4 *)(param_3 + 8) = local_64;
    *(undefined2 *)(param_3 + 0xc) = uVar2;
  }
  else {
    *(undefined4 *)(param_3 + 8) = DAT_1402f83d0;
    *(undefined2 *)(param_3 + 0xc) = uVar2;
  }
  return;
}



undefined8 FUN_1400a8b30(longlong param_1)

{
  if (*(int *)(param_1 + 0x218) == 0) {
    return 0;
  }
  return *(undefined8 *)(param_1 + 0x210);
}



undefined1 FUN_1400a8b50(longlong param_1)

{
  longlong lVar1;
  undefined1 uVar2;
  char cVar3;
  
  lVar1 = param_1 + 0x28;
  cVar3 = FUN_1400a1cc0(lVar1);
  if (cVar3 == '\0') {
    return 1;
  }
  FUN_1400a1c30(lVar1);
  uVar2 = *(undefined1 *)(param_1 + 0x80);
  FUN_1400d1290(lVar1);
  return uVar2;
}



void FUN_1400a8ba0(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_1400a83b0(*(longlong *)(param_1 + 0x10),param_1);
  }
  return;
}



undefined8 * FUN_1400a8bc0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1400a8c20(longlong param_1)

{
  FUN_1400a66e0();
  *(undefined1 *)(param_1 + 0x314) = 0;
  *(undefined4 *)(param_1 + 0x310) = 0;
  *(undefined8 *)(param_1 + 0x3c8) = 0;
  FUN_1400a1c30(param_1 + 0x28);
  *(undefined1 *)(param_1 + 0x80) = 0;
  FUN_1400d1290(param_1 + 0x28);
  *(undefined1 *)(param_1 + 0x3c1) = 0;
  *(undefined8 *)(param_1 + 0x2e8) = 0;
  *(undefined1 *)(param_1 + 0x21) = 1;
  *(undefined8 *)(param_1 + 0x2f0) = 0;
  *(undefined8 *)(param_1 + 0x2f8) = 0;
  *(undefined8 *)(param_1 + 0x300) = 0;
  *(undefined4 *)(param_1 + 0x308) = 0xffffffff;
  *(undefined1 *)(param_1 + 0x30c) = 0;
  *(undefined1 *)(param_1 + 0x3c0) = 0;
  return;
}



void FUN_1400a8cc0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1400a88b0();
  *(undefined ***)(param_1 + 0x2c0) = Proud::CFastArray<>::vftable;
  if (*(longlong *)(param_1 + 0x2d0) != 0) {
    if (*(longlong **)(param_1 + 0x2c8) == (longlong *)0x0) {
      FUN_1400a3530(*(longlong *)(param_1 + 0x2d0));
    }
    else {
      (**(code **)(**(longlong **)(param_1 + 0x2c8) + 0x18))();
    }
  }
  *(undefined ***)(param_1 + 0x200) = Proud::CFastArray<>::vftable;
  if (*(longlong *)(param_1 + 0x210) != 0) {
    plVar1 = *(longlong **)(param_1 + 0x208);
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,*(longlong *)(param_1 + 0x210),plVar1,param_4,uVar2);
    }
  }
  *(undefined ***)(param_1 + 0x140) = Proud::CFastArray<>::vftable;
  if (*(longlong *)(param_1 + 0x150) != 0) {
    plVar1 = *(longlong **)(param_1 + 0x148);
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,*(longlong *)(param_1 + 0x150));
    }
  }
  FUN_1400a1cd0(param_1 + 0x28);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_1400a83b0(*(longlong *)(param_1 + 0x10),param_1);
  }
  return;
}



undefined8 * FUN_1400a8db0(undefined8 *param_1,int param_2,undefined8 param_3)

{
  undefined4 uVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined1 local_50 [72];
  
  uVar3 = 0xfffffffffffffffe;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 5,uVar1,1);
  param_1[0x18] = 0;
  param_1[0x19] = 0;
  param_1[0x1a] = 0;
  param_1[0x1b] = 0;
  *(undefined1 *)(param_1 + 0x20) = 0;
  param_1[0x29] = 0;
  param_1[0x2a] = 0;
  param_1[0x2b] = 0;
  *(undefined4 *)(param_1 + 0x2c) = 0;
  param_1[0x28] = Proud::CSocketBuffer::vftable;
  *(undefined4 *)((longlong)param_1 + 0x164) = 1;
  param_1[0x30] = 0;
  param_1[0x31] = 0;
  param_1[0x32] = 0;
  param_1[0x33] = 0;
  *(undefined1 *)(param_1 + 0x38) = 0;
  param_1[0x41] = 0;
  param_1[0x42] = 0;
  param_1[0x43] = 0;
  *(undefined4 *)(param_1 + 0x44) = 0;
  param_1[0x40] = Proud::CSocketBuffer::vftable;
  *(undefined4 *)((longlong)param_1 + 0x224) = 1;
  param_1[0x48] = 0;
  param_1[0x49] = 0;
  param_1[0x4a] = 0;
  param_1[0x4b] = 0;
  *(undefined1 *)(param_1 + 0x50) = 0;
  param_1[0x59] = 0;
  param_1[0x5a] = 0;
  param_1[0x5b] = 0;
  *(undefined4 *)(param_1 + 0x5c) = 0;
  param_1[0x58] = Proud::CSocketBuffer::vftable;
  *(undefined4 *)((longlong)param_1 + 0x2e4) = 1;
  param_1[0x68] = 0;
  param_1[0x69] = 0;
  param_1[0x6a] = 0;
  param_1[0x6b] = 0;
  *(undefined1 *)(param_1 + 0x70) = 0;
  *(undefined1 *)(param_1 + 4) = 0;
  param_1[3] = param_3;
  FUN_1400a8c20(param_1);
  if (param_2 == 0) {
    uVar2 = 1;
  }
  else if (param_2 == 1) {
    uVar2 = 2;
  }
  else {
    if (param_2 != 2) {
      FUN_1400a2b50(L"Invalid Parameter in Socket ctor!");
      goto LAB_1400a8f74;
    }
    uVar2 = 3;
  }
  uVar3 = WSASocketW(2,uVar2,0,0,0,1,uVar3);
  param_1[0x7a] = uVar3;
LAB_1400a8f74:
  if (param_1[0x7a] != -1) {
    return param_1;
  }
  uVar1 = Ordinal_111();
  FUN_1400a2320(local_50,&DAT_140205aa8,uVar1);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
}



undefined8 *
FUN_1400a8fd0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 5,uVar1,1,param_4,uVar2);
  param_1[0x18] = 0;
  param_1[0x19] = 0;
  param_1[0x1a] = 0;
  param_1[0x1b] = 0;
  *(undefined1 *)(param_1 + 0x20) = 0;
  param_1[0x29] = 0;
  param_1[0x2a] = 0;
  param_1[0x2b] = 0;
  *(undefined4 *)(param_1 + 0x2c) = 0;
  param_1[0x28] = Proud::CSocketBuffer::vftable;
  *(undefined4 *)((longlong)param_1 + 0x164) = 1;
  param_1[0x30] = 0;
  param_1[0x31] = 0;
  param_1[0x32] = 0;
  param_1[0x33] = 0;
  *(undefined1 *)(param_1 + 0x38) = 0;
  param_1[0x41] = 0;
  param_1[0x42] = 0;
  param_1[0x43] = 0;
  *(undefined4 *)(param_1 + 0x44) = 0;
  param_1[0x40] = Proud::CSocketBuffer::vftable;
  *(undefined4 *)((longlong)param_1 + 0x224) = 1;
  param_1[0x48] = 0;
  param_1[0x49] = 0;
  param_1[0x4a] = 0;
  param_1[0x4b] = 0;
  *(undefined1 *)(param_1 + 0x50) = 0;
  param_1[0x59] = 0;
  param_1[0x5a] = 0;
  param_1[0x5b] = 0;
  *(undefined4 *)(param_1 + 0x5c) = 0;
  param_1[0x58] = Proud::CSocketBuffer::vftable;
  *(undefined4 *)((longlong)param_1 + 0x2e4) = 1;
  param_1[0x68] = 0;
  param_1[0x69] = 0;
  param_1[0x6a] = 0;
  param_1[0x6b] = 0;
  *(undefined1 *)(param_1 + 0x70) = 0;
  *(undefined1 *)(param_1 + 4) = 0;
  param_1[0x7a] = param_2;
  param_1[3] = param_3;
  FUN_1400a8c20(param_1);
  return param_1;
}



void FUN_1400a9160(longlong param_1,int param_2,undefined8 param_3)

{
  int *piVar1;
  undefined *puVar2;
  undefined8 uVar3;
  undefined *local_res20;
  undefined *local_28;
  undefined8 local_20;
  undefined8 local_18;
  undefined1 local_10;
  
  if (((param_2 != 0x2733) && (local_20 = 0xfffffffffffffffe, param_2 != 0x3e5)) &&
     (*(char *)(param_1 + 0x21) == '\x01')) {
    FUN_1400a3440();
    local_28 = PTR_DAT_1402f8010;
    FUN_14003c600(&local_28,&DAT_140205c08,param_3,param_2);
    FUN_1400a3440();
    puVar2 = local_28;
    local_res20 = PTR_DAT_1402f8010;
    if (PTR_DAT_1402f8010 == (undefined *)0x0) {
      local_res20 = (undefined *)0x0;
    }
    if (local_28 != PTR_DAT_1402f8010) {
      uVar3 = FUN_1400a3440();
      local_18 = uVar3;
      FUN_1400a1c30(uVar3);
      local_10 = 1;
      FUN_1400031d0(&local_res20);
      local_res20 = puVar2;
      if (((puVar2 != PTR_DAT_1402f8010) && (puVar2 != (undefined *)0x0)) &&
         (puVar2 != (undefined *)0x8)) {
        *(int *)(puVar2 + -4) = *(int *)(puVar2 + -4) + 1;
      }
      FUN_1400d1290(uVar3);
    }
    (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
              (*(longlong **)(param_1 + 0x18),param_1,&local_res20);
    if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8010)) &&
       (puVar2 + -8 != (undefined *)0x0)) {
      uVar3 = FUN_1400a3440();
      local_18 = uVar3;
      FUN_1400a1c30(uVar3);
      local_10 = 1;
      piVar1 = (int *)(puVar2 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar2 + -8);
      }
      FUN_1400d1290(uVar3);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined4 FUN_1400a92b0(longlong param_1,longlong *param_2,undefined2 param_3)

{
  undefined1 *puVar1;
  undefined2 uVar2;
  uint uVar3;
  int iVar4;
  uint uVar5;
  undefined4 uVar6;
  uint *puVar7;
  longlong lVar8;
  uint *puVar9;
  undefined *puVar10;
  uint *puVar11;
  uint uVar12;
  undefined1 auStack_128 [32];
  uint *local_108;
  undefined1 local_100;
  longlong *local_f8;
  undefined8 local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined1 *local_d8;
  undefined1 local_d0 [136];
  ulonglong local_48;
  
  local_f0 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_128;
  puVar10 = (undefined *)*param_2;
  if ((undefined *)*param_2 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1402f8010;
  }
  local_d8 = local_d0;
  local_f8 = param_2;
  FUN_1400a1e40(&local_d8,puVar10,3);
  puVar1 = local_d8;
  FUN_1400a3440();
  puVar11 = (uint *)PTR_DAT_1402f8008;
  local_108 = (uint *)PTR_DAT_1402f8008;
  uVar3 = FUN_1400a3360();
  if (puVar11 == (uint *)0x0) {
    iVar4 = 0;
  }
  else if (puVar11 == (uint *)PTR_DAT_1402f8008) {
    iVar4 = 0;
  }
  else {
    iVar4 = *(int *)((longlong)puVar11 + -8);
  }
  uVar5 = uVar3;
  if ((int)uVar3 <= iVar4) {
    if (puVar11 == (uint *)0x0) {
      uVar5 = 0;
    }
    else if (puVar11 == (uint *)PTR_DAT_1402f8008) {
      uVar5 = 0;
    }
    else {
      uVar5 = *(uint *)((longlong)puVar11 + -8);
    }
  }
  uVar12 = 1;
  if (1 < (int)uVar5) {
    uVar12 = uVar5;
  }
  if (puVar11 == (uint *)0x0) {
    iVar4 = 0;
  }
  else if (puVar11 == (uint *)PTR_DAT_1402f8008) {
    iVar4 = 0;
  }
  else {
    iVar4 = *(int *)((longlong)puVar11 + -8);
  }
  if ((int)uVar12 <= iVar4) goto LAB_1400a9451;
  if (puVar11 == (uint *)0x0) {
    puVar11 = (uint *)PTR_DAT_1402f8008;
  }
  local_108 = puVar11;
  if ((int)uVar12 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (uVar12 == 0) {
    FUN_14000c2a0(&local_108);
    goto LAB_1400a9451;
  }
  if (puVar11 == (uint *)0x0) {
    uVar5 = 0;
  }
  else if (puVar11 == (uint *)PTR_DAT_1402f8008) {
    uVar5 = 0;
  }
  else {
    uVar5 = puVar11[-2];
  }
  if (uVar12 == uVar5) goto LAB_1400a9451;
  puVar7 = (uint *)FUN_1400a34c0();
  if (puVar7 != (uint *)0x0) {
    *puVar7 = 0;
    puVar7[1] = 1;
  }
  *puVar7 = uVar12;
  if (puVar11 == (uint *)0x0) {
    uVar5 = 0;
  }
  else if (puVar11 == (uint *)PTR_DAT_1402f8008) {
    uVar5 = 0;
  }
  else {
    uVar5 = puVar11[-2];
  }
  puVar9 = (uint *)PTR_DAT_1402f8008;
  if ((int)uVar12 < (int)uVar5) {
LAB_1400a942b:
    if (puVar11 != (uint *)0x0) {
      puVar9 = puVar11;
    }
  }
  else {
    if (puVar11 != (uint *)0x0) {
      if (puVar11 == (uint *)PTR_DAT_1402f8008) {
        uVar12 = 0;
      }
      else {
        uVar12 = puVar11[-2];
      }
      goto LAB_1400a942b;
    }
    uVar12 = 0;
  }
  FUN_1400a3390(puVar7 + 2,puVar9,uVar12);
  FUN_14000c2a0(&local_108);
  local_108 = puVar7 + 2;
LAB_1400a9451:
  FUN_14000c330(&local_108);
  puVar11 = local_108;
  puVar7 = local_108;
  if (local_108 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar7,puVar1,uVar3);
  uVar5 = FUN_1400a3360();
  uVar3 = 0;
  if (0 < (int)uVar5) {
    uVar3 = uVar5;
  }
  if (puVar11 == (uint *)0x0) {
    uVar5 = 0;
  }
  else if (puVar11 == (uint *)PTR_DAT_1402f8008) {
    uVar5 = 0;
  }
  else {
    uVar5 = puVar11[-2];
  }
  if ((int)uVar5 <= (int)uVar3) {
    if (puVar11 == (uint *)0x0) {
      uVar3 = 0;
    }
    else if (puVar11 == (uint *)PTR_DAT_1402f8008) {
      uVar3 = 0;
    }
    else {
      uVar3 = puVar11[-2];
    }
  }
  if (((puVar11 != (uint *)PTR_DAT_1402f8008) && (puVar11 != (uint *)0x0)) &&
     (puVar7 = puVar11 + -2, puVar7 != (uint *)0x0)) {
    *puVar7 = uVar3;
    *(undefined1 *)((longlong)(int)uVar3 + 8 + (longlong)puVar7) = 0;
  }
  if (local_d8 != local_d0) {
    free(local_d8);
  }
  local_e0 = 0;
  local_e8 = 2;
  puVar7 = puVar11;
  if (puVar11 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1402f8008;
  }
  iVar4 = Ordinal_11(puVar7);
  local_e8 = CONCAT44(iVar4,(undefined4)local_e8);
  if (iVar4 == -1) {
    puVar7 = puVar11;
    if (puVar11 == (uint *)0x0) {
      puVar7 = (uint *)PTR_DAT_1402f8008;
    }
    lVar8 = Ordinal_52(puVar7);
    if (lVar8 == 0) {
      uVar6 = Ordinal_111();
      FUN_1400a9160(param_1,uVar6,L"Proud::CFastSocket::Connect");
      if (((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1402f8008)) &&
         (puVar11 + -2 != (uint *)0x0)) {
        puVar9 = (uint *)FUN_1400a3440();
        local_108 = puVar9;
        FUN_1400a1c30(puVar9);
        local_100 = 1;
        puVar7 = puVar11 + -1;
        *puVar7 = *puVar7 - 1;
        if (*puVar7 == 0) {
          FUN_1400a3530(puVar11 + -2);
        }
        FUN_1400d1290(puVar9);
      }
      FUN_1400031d0(param_2);
      return uVar6;
    }
    local_e8 = CONCAT44(*(undefined4 *)**(undefined8 **)(lVar8 + 0x18),(undefined4)local_e8);
  }
  uVar2 = Ordinal_9(param_3);
  local_e8._0_4_ = CONCAT22(uVar2,(undefined2)local_e8);
  iVar4 = Ordinal_4(*(undefined8 *)(param_1 + 0x3d0),&local_e8,0x10);
  if (iVar4 == -1) {
    uVar6 = Ordinal_111();
    FUN_1400a9160(param_1,uVar6,L"Proud::CFastSocket::Connect");
    if (((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1402f8008)) &&
       (puVar11 + -2 != (uint *)0x0)) {
      puVar9 = (uint *)FUN_1400a3440();
      local_108 = puVar9;
      FUN_1400a1c30(puVar9);
      local_100 = 1;
      puVar7 = puVar11 + -1;
      *puVar7 = *puVar7 - 1;
      if (*puVar7 == 0) {
        FUN_1400a3530(puVar11 + -2);
      }
      FUN_1400d1290(puVar9);
    }
    FUN_1400031d0(param_2);
  }
  else {
    if (((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1402f8008)) &&
       (puVar11 + -2 != (uint *)0x0)) {
      puVar9 = (uint *)FUN_1400a3440();
      local_108 = puVar9;
      FUN_1400a1c30(puVar9);
      local_100 = 1;
      puVar7 = puVar11 + -1;
      *puVar7 = *puVar7 - 1;
      if (*puVar7 == 0) {
        FUN_1400a3530(puVar11 + -2);
      }
      FUN_1400d1290(puVar9);
    }
    FUN_1400031d0(param_2);
    uVar6 = 0;
  }
  return uVar6;
}



undefined4 FUN_1400a96e0(longlong param_1,int param_2)

{
  undefined4 uVar1;
  int iVar2;
  undefined8 uVar3;
  undefined *local_res8;
  undefined4 local_res10 [2];
  int local_18 [2];
  undefined8 local_10;
  
  if (*(char *)(param_1 + 0x1c0) != '\0') {
    FUN_1400a3440();
    local_res8 = PTR_DAT_1402f8010;
    uVar1 = FUN_1400a32c0(L"WARNING: IssueRecv is duplicated!");
    uVar3 = FUN_140002f20(&local_res8,uVar1);
    FUN_1400a32f0(uVar3,L"WARNING: IssueRecv is duplicated!",uVar1);
    FUN_140003000(&local_res8);
    (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
              (*(longlong **)(param_1 + 0x18),param_1,&local_res8);
  }
  if (param_2 < 1) {
    return 0x2726;
  }
  FUN_14003cda0(param_1 + 0x200,param_2);
  local_10 = 0;
  if (*(int *)(param_1 + 0x218) != 0) {
    local_10 = *(undefined8 *)(param_1 + 0x210);
  }
  *(undefined4 *)(param_1 + 0x304) = 0;
  local_res10[0] = 0;
  *(undefined1 *)(param_1 + 0x1c0) = 0;
  *(undefined1 *)(param_1 + 0x1c0) = 1;
  local_18[0] = param_2;
  iVar2 = WSARecv(*(undefined8 *)(param_1 + 0x3d0),local_18,1,local_res10,
                  (undefined4 *)(param_1 + 0x304),param_1 + 0x180,0);
  if (iVar2 != 0) {
    iVar2 = Ordinal_111();
    if (iVar2 != 0x3e5) {
      *(undefined1 *)(param_1 + 0x1c0) = 0;
      uVar1 = Ordinal_111();
      FUN_1400a9160(param_1,uVar1,L"Proud::CFastSocket::IssueRecv");
      return uVar1;
    }
  }
  return 0;
}



int FUN_1400a9850(longlong param_1,int param_2)

{
  undefined4 uVar1;
  int iVar2;
  undefined8 uVar3;
  undefined *local_res8;
  undefined4 local_res10 [2];
  int local_38 [2];
  undefined8 local_30;
  
  if (*(char *)(param_1 + 0x1c0) != '\0') {
    FUN_1400a3440();
    local_res8 = PTR_DAT_1402f8010;
    uVar1 = FUN_1400a32c0(L"WARNING: IssueRecvFrom is duplicated!");
    uVar3 = FUN_140002f20(&local_res8,uVar1);
    FUN_1400a32f0(uVar3,L"WARNING: IssueRecvFrom is duplicated!",uVar1);
    FUN_140003000(&local_res8);
    (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
              (*(longlong **)(param_1 + 0x18),param_1,&local_res8);
  }
  if (0 < param_2) {
    FUN_14003cda0(param_1 + 0x200,param_2);
    local_30 = 0;
    if (*(int *)(param_1 + 0x218) != 0) {
      local_30 = *(undefined8 *)(param_1 + 0x210);
    }
    local_res10[0] = 0;
    *(undefined4 *)(param_1 + 0x304) = 0;
    local_38[0] = param_2;
    while( true ) {
      *(undefined4 *)(param_1 + 0x300) = 0x10;
      *(undefined1 *)(param_1 + 0x1c0) = *(undefined1 *)(param_1 + 0x1c0);
      *(undefined1 *)(param_1 + 0x1c0) = 1;
      iVar2 = WSARecvFrom(*(undefined8 *)(param_1 + 0x3d0),local_38,1,local_res10,
                          (undefined4 *)(param_1 + 0x304),param_1 + 0x2f0,
                          (undefined4 *)(param_1 + 0x300),param_1 + 0x180,0);
      if (iVar2 == 0) {
        return 0;
      }
      iVar2 = Ordinal_111();
      if (iVar2 == 0x3e5) break;
      if (((iVar2 != 0x2738) && (iVar2 != 0x2744)) && (iVar2 != 0x2746)) {
        *(undefined1 *)(param_1 + 0x1c0) = 0;
        FUN_1400a9160(param_1,iVar2,L"Proud::CFastSocket::IssueRecvFrom");
        return iVar2;
      }
    }
    return 0;
  }
  return 0x2726;
}



undefined4 FUN_1400a9a10(longlong param_1,undefined8 *param_2,uint param_3)

{
  undefined1 uVar1;
  undefined4 uVar2;
  int iVar3;
  int iVar4;
  undefined8 uVar5;
  undefined8 *_Dst;
  ulonglong uVar6;
  ulonglong uVar7;
  undefined8 *puVar8;
  undefined *local_res8;
  undefined4 local_res18 [4];
  uint local_28 [2];
  undefined8 local_20;
  
  uVar7 = (ulonglong)(int)param_3;
  if (*(char *)(param_1 + 0x280) != '\0') {
    FUN_1400a3440();
    local_res8 = PTR_DAT_1402f8010;
    uVar2 = FUN_1400a32c0(L"WARNING: IssueSend is duplicated!");
    uVar5 = FUN_140002f20(&local_res8,uVar2);
    FUN_1400a32f0(uVar5,L"WARNING: IssueSend is duplicated!",uVar2);
    FUN_140003000(&local_res8);
    (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
              (*(longlong **)(param_1 + 0x18),param_1,&local_res8);
  }
  if ((int)param_3 < 1) {
    return 0x2726;
  }
  FUN_14003cda0(param_1 + 0x2c0,param_3);
  if (*(int *)(param_1 + 0x2d8) == 0) {
    _Dst = (undefined8 *)0x0;
  }
  else {
    _Dst = *(undefined8 **)(param_1 + 0x2d0);
  }
  if (uVar7 < 0x21) {
    uVar6 = (ulonglong)(param_3 & 7);
    for (uVar7 = uVar7 >> 3; uVar7 != 0; uVar7 = uVar7 - 1) {
      uVar5 = *param_2;
      param_2 = param_2 + 1;
      *_Dst = uVar5;
      _Dst = _Dst + 1;
    }
    if (uVar6 != 0) {
      puVar8 = param_2;
      do {
        uVar1 = *(undefined1 *)puVar8;
        puVar8 = (undefined8 *)((longlong)puVar8 + 1);
        uVar6 = uVar6 - 1;
        *(undefined1 *)((longlong)_Dst + (-1 - (longlong)param_2) + (longlong)puVar8) = uVar1;
      } while (uVar6 != 0);
    }
  }
  else {
    memcpy(_Dst,param_2,uVar7);
  }
  if (*(int *)(param_1 + 0x2d8) == 0) {
    local_20 = 0;
  }
  else {
    local_20 = *(undefined8 *)(param_1 + 0x2d0);
  }
  local_res18[0] = 0;
  *(undefined1 *)(param_1 + 0x280) = 0;
  *(undefined1 *)(param_1 + 0x280) = 1;
  local_28[0] = param_3;
  iVar3 = WSASend(*(undefined8 *)(param_1 + 0x3d0),local_28,1,local_res18,0,param_1 + 0x240,0);
  if ((iVar3 < 0) && (iVar4 = Ordinal_111(), iVar4 != 0x3e5)) {
    *(undefined1 *)(param_1 + 0x280) = 0;
    uVar2 = Ordinal_111();
    FUN_1400a9160(param_1,uVar2,L"Proud::CFastSocket::IssueSend");
    return uVar2;
  }
  *(bool *)(param_1 + 0x3c2) = iVar3 == 0;
  return 0;
}



undefined4 FUN_1400a9bf0(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  undefined4 uVar2;
  int iVar3;
  int iVar4;
  undefined8 uVar5;
  longlong *plVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  uint uVar10;
  ulonglong uVar11;
  undefined4 local_res8 [2];
  undefined *local_res10;
  
  if (*(char *)(param_1 + 0x280) != '\0') {
    FUN_1400a3440();
    local_res10 = PTR_DAT_1402f8010;
    uVar2 = FUN_1400a32c0(L"WARNING: IssueSend is duplicated!");
    uVar5 = FUN_140002f20(&local_res10,uVar2);
    FUN_1400a32f0(uVar5,L"WARNING: IssueSend is duplicated!",uVar2);
    FUN_140003000(&local_res10);
    (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
              (*(longlong **)(param_1 + 0x18),param_1,&local_res10);
  }
  lVar1 = param_2[1];
  uVar7 = 0;
  uVar9 = uVar7;
  uVar11 = uVar7;
  if (0 < lVar1) {
    do {
      if (((longlong)uVar7 < 0) || (lVar1 <= (longlong)uVar7)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if ((ulonglong)param_2[2] < 0x65) {
        plVar6 = param_2 + (uVar7 + 2) * 2;
      }
      else {
        plVar6 = (longlong *)(uVar7 * 0x10 + *param_2);
      }
      uVar10 = (int)uVar11 + (int)*plVar6;
      uVar8 = (int)uVar9 + 1;
      uVar7 = (ulonglong)(int)uVar8;
      uVar9 = (ulonglong)uVar8;
      uVar11 = (ulonglong)uVar10;
    } while ((longlong)uVar7 < lVar1);
    if (0 < (int)uVar10) {
      local_res8[0] = 0;
      *(undefined1 *)(param_1 + 0x280) = 0;
      *(undefined1 *)(param_1 + 0x280) = 1;
      if (0xffffffff < param_2[1] + 0x80000000U) {
                    // WARNING: Subroutine does not return
        FUN_1400a2730(L"Proud::CFastSocket::IssueSend_NoCopy");
      }
      plVar6 = param_2 + 4;
      if (100 < (ulonglong)param_2[2]) {
        plVar6 = (longlong *)*param_2;
      }
      iVar3 = WSASend(*(undefined8 *)(param_1 + 0x3d0),plVar6,param_2[1] & 0xffffffff,local_res8,0,
                      param_1 + 0x240,0);
      if ((iVar3 < 0) && (iVar4 = Ordinal_111(), iVar4 != 0x3e5)) {
        *(undefined1 *)(param_1 + 0x280) = 0;
        uVar2 = Ordinal_111();
        FUN_1400a9160(param_1,uVar2,L"Proud::CFastSocket::IssueSend_NoCopy");
        return uVar2;
      }
      *(bool *)(param_1 + 0x3c2) = iVar3 == 0;
      return 0;
    }
  }
  return 0x2726;
}



void FUN_1400a9dc0(longlong param_1)

{
  int iVar1;
  undefined4 uVar2;
  
  iVar1 = Ordinal_13(*(undefined8 *)(param_1 + 0x3d0),0x7fffffff);
  if (iVar1 != 0) {
    uVar2 = Ordinal_111();
    FUN_1400a9160(param_1,uVar2,L"Proud::CFastSocket::Listen");
  }
  return;
}



ulonglong FUN_1400a9e00(longlong param_1,undefined4 param_2)

{
  undefined4 uVar1;
  ulonglong uVar2;
  undefined4 local_res10 [6];
  
  local_res10[0] = param_2;
  uVar2 = Ordinal_21(*(undefined8 *)(param_1 + 0x3d0),0xffff,0x1001,local_res10,4);
  if ((int)uVar2 != 0) {
    uVar1 = Ordinal_111();
    FUN_1400a9160(param_1,uVar1,L"Proud::CFastSocket::SetSendBufferSize");
    uVar2 = uVar2 & 0xffffffff;
  }
  return uVar2;
}



ulonglong FUN_1400a9e60(longlong param_1,undefined4 param_2)

{
  undefined4 uVar1;
  ulonglong uVar2;
  undefined4 local_res10 [6];
  
  local_res10[0] = param_2;
  uVar2 = Ordinal_21(*(undefined8 *)(param_1 + 0x3d0),0xffff,0x1002,local_res10,4);
  if ((int)uVar2 != 0) {
    uVar1 = Ordinal_111();
    FUN_1400a9160(param_1,uVar1,L"Proud::CFastSocket::SetRecvBufferSize");
    uVar2 = uVar2 & 0xffffffff;
  }
  return uVar2;
}



int FUN_1400a9ec0(longlong param_1,longlong param_2)

{
  undefined4 uVar1;
  int iVar2;
  undefined8 uVar3;
  undefined *local_res8;
  
  if (*(char *)(param_1 + 0x100) != '\0') {
    FUN_1400a3440();
    local_res8 = PTR_DAT_1402f8010;
    uVar1 = FUN_1400a32c0(L"WARNING: AcceptEx is duplicated!");
    uVar3 = FUN_140002f20(&local_res8,uVar1);
    FUN_1400a32f0(uVar3,L"WARNING: AcceptEx is duplicated!",uVar1);
    FUN_140003000(&local_res8);
    (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
              (*(longlong **)(param_1 + 0x18),param_1,&local_res8);
  }
  if (DAT_140314280 == (code *)0x0) {
    FUN_1400a7ff0(param_1);
  }
  *(undefined1 *)(param_1 + 0x100) = 0;
  FUN_14003cda0(param_1 + 0x140,0x40);
  *(undefined1 *)(param_1 + 0x100) = 1;
  if (*(int *)(param_1 + 0x158) == 0) {
    uVar3 = 0;
  }
  else {
    uVar3 = *(undefined8 *)(param_1 + 0x150);
  }
  iVar2 = (*DAT_140314280)(*(undefined8 *)(param_1 + 0x3d0),*(undefined8 *)(param_2 + 0x3d0),uVar3,0
                           ,0x20,0x20,param_1 + 0x168,param_1 + 0xc0);
  if (iVar2 == 0) {
    iVar2 = Ordinal_111();
    if (((iVar2 != 0x2733) && (iVar2 != 0x3e5)) &&
       ((*(char *)(param_1 + 0x314) == '\0' || (iVar2 != 0x2736)))) {
      *(undefined1 *)(param_1 + 0x100) = 0;
      FUN_1400a9160(param_1,iVar2,L"Proud::CFastSocket::AcceptEx");
      return iVar2;
    }
  }
  return 0;
}



undefined4 FUN_1400aa030(longlong param_1,char param_2)

{
  int iVar1;
  undefined4 uVar2;
  uint local_res10 [6];
  
  local_res10[0] = (uint)(param_2 != '\0');
  iVar1 = Ordinal_21(*(undefined8 *)(param_1 + 0x3d0),0xffff,0x20,local_res10,4);
  if (iVar1 != 0) {
    uVar2 = Ordinal_111();
    FUN_1400a9160(param_1,uVar2,L"Proud::CFastSocket::EnableBroadcastOption");
    return uVar2;
  }
  *(char *)(param_1 + 0x20) = param_2;
  return 0;
}



int FUN_1400aa0b0(longlong param_1,undefined4 param_2)

{
  int iVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  wchar_t *pwVar4;
  undefined4 local_res8 [4];
  undefined4 local_res18 [2];
  undefined *local_res20;
  
  local_res8[0] = 4;
  iVar1 = Ordinal_7(*(undefined8 *)(param_1 + 0x3d0),0,4,local_res18,local_res8);
  if (iVar1 == 0) {
    local_res18[0] = param_2;
    iVar1 = Ordinal_21(*(undefined8 *)(param_1 + 0x3d0),0,4,local_res18,local_res8[0]);
    if (iVar1 == 0) {
      return 0;
    }
    FUN_1400a3440();
    local_res20 = PTR_DAT_1402f8010;
    uVar2 = FUN_1400a32c0(L"Cannot change TTL!");
    uVar3 = FUN_140002f20(&local_res20,uVar2);
    pwVar4 = L"Cannot change TTL!";
  }
  else {
    FUN_1400a3440();
    local_res20 = PTR_DAT_1402f8010;
    uVar2 = FUN_1400a32c0(L"This socket doesn\'t support TTL change!");
    uVar3 = FUN_140002f20(&local_res20,uVar2);
    pwVar4 = L"This socket doesn\'t support TTL change!";
  }
  FUN_1400a32f0(uVar3,pwVar4,uVar2);
  FUN_140003000(&local_res20);
  (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
            (*(longlong **)(param_1 + 0x18),param_1,&local_res20);
  return iVar1;
}



ulonglong FUN_1400aa1b0(longlong param_1,longlong param_2)

{
  int iVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  wchar_t *pwVar5;
  undefined *local_res10 [3];
  
  iVar1 = *(int *)(param_2 + 8);
  if (iVar1 == -1) {
    FUN_1400a3440();
    local_res10[0] = PTR_DAT_1402f8010;
    uVar2 = FUN_1400a32c0(L"Sending to 255.255.255.255 is not permitted!");
    uVar3 = FUN_140002f20(local_res10,uVar2);
    pwVar5 = L"Sending to 255.255.255.255 is not permitted!";
  }
  else if ((*(short *)(param_2 + 0xc) == -1) || (*(short *)(param_2 + 0xc) == 0)) {
    FUN_1400a3440();
    local_res10[0] = PTR_DAT_1402f8010;
    uVar2 = FUN_1400a32c0(L"Sending to prohibited port is not permitted!");
    uVar3 = FUN_140002f20(local_res10,uVar2);
    pwVar5 = L"Sending to prohibited port is not permitted!";
  }
  else {
    if (iVar1 != 0) {
      return CONCAT71((uint7)(uint3)((uint)iVar1 >> 8),1);
    }
    FUN_1400a3440();
    local_res10[0] = PTR_DAT_1402f8010;
    uVar2 = FUN_1400a32c0(L"Sending to 0.0.0.0 is not permitted!");
    uVar3 = FUN_140002f20(local_res10,uVar2);
    pwVar5 = L"Sending to 0.0.0.0 is not permitted!";
  }
  FUN_1400a32f0(uVar3,pwVar5,uVar2);
  FUN_140003000(local_res10);
  uVar4 = (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
                    (*(longlong **)(param_1 + 0x18),param_1,local_res10);
  return uVar4 & 0xffffffffffffff00;
}



ulonglong FUN_1400aa2c0(longlong param_1,undefined8 param_2)

{
  undefined4 uVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  undefined4 local_res8 [2];
  undefined *local_res18;
  
  local_res8[0] = 4;
  uVar2 = Ordinal_7(*(undefined8 *)(param_1 + 0x3d0),0,4,param_2,local_res8);
  if ((int)uVar2 != 0) {
    FUN_1400a3440();
    local_res18 = PTR_DAT_1402f8010;
    uVar1 = FUN_1400a32c0(L"This socket doesn\'t support TTL change!");
    uVar3 = FUN_140002f20(&local_res18,uVar1);
    FUN_1400a32f0(uVar3,L"This socket doesn\'t support TTL change!",uVar1);
    FUN_140003000(&local_res18);
    (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
              (*(longlong **)(param_1 + 0x18),param_1,&local_res18);
    uVar2 = uVar2 & 0xffffffff;
  }
  return uVar2;
}



void FUN_1400aa370(longlong param_1)

{
  if (*(char *)(param_1 + 0x30c) != '\0') {
    *(undefined1 *)(param_1 + 0x30c) = 0;
    FUN_1400aa0b0(param_1,*(undefined4 *)(param_1 + 0x308));
  }
  return;
}



undefined4 FUN_1400aa3a0(longlong param_1,undefined4 param_2)

{
  char cVar1;
  undefined4 uVar2;
  
  cVar1 = FUN_1400ab750(*(undefined8 *)(param_1 + 0x3d0),0,param_2);
  if (cVar1 == '\0') {
    uVar2 = Ordinal_111();
    FUN_1400a9160(param_1,uVar2,L"Proud::CFastSocket::Bind");
    return 0;
  }
  return 1;
}



undefined8 FUN_1400aa3f0(longlong param_1,char *param_2)

{
  char cVar1;
  undefined4 uVar2;
  longlong lVar3;
  char *pcVar4;
  
  if (param_2 != (char *)0x0) {
    lVar3 = -1;
    pcVar4 = param_2;
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      cVar1 = *pcVar4;
      pcVar4 = pcVar4 + 1;
    } while (cVar1 != '\0');
    if (lVar3 != -2) goto LAB_1400aa41d;
  }
  param_2 = (char *)0x0;
LAB_1400aa41d:
  cVar1 = FUN_1400ab750(*(undefined8 *)(param_1 + 0x3d0),param_2);
  if (cVar1 == '\0') {
    uVar2 = Ordinal_111();
    FUN_1400a9160(param_1,uVar2,L"Proud::CFastSocket::Bind");
    return 0;
  }
  return 1;
}



undefined4 FUN_1400aa460(longlong param_1,longlong param_2)

{
  char cVar1;
  undefined4 uVar2;
  
  cVar1 = FUN_1400ab6e0(*(undefined8 *)(param_1 + 0x3d0),*(undefined4 *)(param_2 + 8),
                        *(undefined2 *)(param_2 + 0xc));
  if (cVar1 == '\0') {
    uVar2 = Ordinal_111();
    FUN_1400a9160(param_1,uVar2,L"Proud::CFastSocket::Bind");
    return 0;
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_1400aa4b0(longlong param_1,longlong *param_2,longlong param_3,int param_4)

{
  longlong lVar1;
  char cVar2;
  undefined4 uVar3;
  int iVar4;
  undefined8 uVar5;
  longlong *plVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  uint uVar10;
  ulonglong uVar11;
  undefined1 auStack_b8 [32];
  undefined4 local_98;
  undefined1 *local_90;
  undefined4 local_88;
  longlong local_80;
  undefined8 local_78;
  undefined *local_68;
  undefined4 local_60;
  undefined4 local_5c;
  undefined **local_58;
  undefined4 local_50;
  undefined2 local_4c;
  undefined1 local_48 [16];
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_b8;
  if (*(char *)(param_1 + 0x280) != '\0') {
    FUN_1400a3440();
    local_68 = PTR_DAT_1402f8010;
    uVar3 = FUN_1400a32c0(L"WARNING: IssueSendTo is duplicated!");
    uVar5 = FUN_140002f20(&local_68,uVar3);
    FUN_1400a32f0(uVar5,L"WARNING: IssueSendTo is duplicated!",uVar3);
    FUN_140003000(&local_68);
    (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
              (*(longlong **)(param_1 + 0x18),param_1,&local_68);
  }
  lVar1 = param_2[1];
  uVar7 = 0;
  uVar9 = uVar7;
  uVar11 = uVar7;
  if (0 < lVar1) {
    do {
      if (((longlong)uVar7 < 0) || (lVar1 <= (longlong)uVar7)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if ((ulonglong)param_2[2] < 0x65) {
        plVar6 = param_2 + (uVar7 + 2) * 2;
      }
      else {
        plVar6 = (longlong *)(uVar7 * 0x10 + *param_2);
      }
      uVar10 = (int)uVar11 + (int)*plVar6;
      uVar8 = (int)uVar9 + 1;
      uVar7 = (ulonglong)(int)uVar8;
      uVar9 = (ulonglong)uVar8;
      uVar11 = (ulonglong)uVar10;
    } while ((longlong)uVar7 < lVar1);
    if (0 < (int)uVar10) {
      FUN_1400a6460(param_3,local_48);
      local_58 = Proud::AddrPort::vftable;
      local_50 = *(undefined4 *)(param_3 + 8);
      local_4c = *(undefined2 *)(param_3 + 0xc);
      local_5c = 0;
      cVar2 = FUN_1400aa1b0(param_1,&local_58);
      if (cVar2 == '\0') {
        return 0x271d;
      }
      if (((-1 < param_4) && (iVar4 = FUN_1400aa2c0(param_1,&local_60), iVar4 == 0)) &&
         (iVar4 = FUN_1400aa0b0(param_1,param_4), iVar4 == 0)) {
        *(undefined1 *)(param_1 + 0x30c) = 1;
        *(undefined4 *)(param_1 + 0x308) = local_60;
      }
      *(undefined1 *)(param_1 + 0x280) = 0;
      *(undefined1 *)(param_1 + 0x280) = 1;
      if (param_2[1] + 0x80000000U < 0x100000000) {
        plVar6 = param_2 + 4;
        if (100 < (ulonglong)param_2[2]) {
          plVar6 = (longlong *)*param_2;
        }
        local_78 = 0;
        local_80 = param_1 + 0x240;
        local_90 = local_48;
        local_88 = 0x10;
        local_98 = 0;
        iVar4 = WSASendTo(*(undefined8 *)(param_1 + 0x3d0),plVar6,param_2[1] & 0xffffffff,&local_5c)
        ;
        if ((iVar4 != 0) && (iVar4 = Ordinal_111(), iVar4 != 0x3e5)) {
          *(undefined1 *)(param_1 + 0x280) = 0;
          FUN_1400a9160(param_1,iVar4,L"Proud::CFastSocket::IssueSendTo_NoCopy_TempTtl");
          return iVar4;
        }
        return 0;
      }
                    // WARNING: Subroutine does not return
      FUN_1400a2730(L"Proud::CFastSocket::IssueSendTo_NoCopy_TempTtl");
    }
  }
  return 0x2726;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_1400aa6f0(longlong param_1,undefined8 *param_2,uint param_3,longlong param_4)

{
  undefined1 uVar1;
  char cVar2;
  undefined4 uVar3;
  int iVar4;
  undefined8 uVar5;
  undefined8 *_Dst;
  ulonglong uVar6;
  ulonglong uVar7;
  undefined8 *puVar8;
  undefined1 auStack_c8 [32];
  undefined4 local_a8;
  undefined1 *local_a0;
  undefined4 local_98;
  longlong local_90;
  undefined8 local_88;
  undefined4 local_78 [2];
  undefined *local_70;
  undefined **local_68;
  undefined4 local_60;
  undefined2 local_5c;
  uint local_58 [2];
  undefined8 local_50;
  undefined1 local_48 [16];
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_c8;
  uVar7 = (ulonglong)(int)param_3;
  if (*(char *)(param_1 + 0x280) != '\0') {
    FUN_1400a3440();
    local_70 = PTR_DAT_1402f8010;
    uVar3 = FUN_1400a32c0(L"WARNING: IssueSendTo is duplicated!");
    uVar5 = FUN_140002f20(&local_70,uVar3);
    FUN_1400a32f0(uVar5,L"WARNING: IssueSendTo is duplicated!",uVar3);
    FUN_140003000(&local_70);
    (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
              (*(longlong **)(param_1 + 0x18),param_1,&local_70);
  }
  if ((int)param_3 < 1) {
    iVar4 = 0x2726;
  }
  else {
    FUN_14003cda0(param_1 + 0x2c0,param_3);
    if (*(int *)(param_1 + 0x2d8) == 0) {
      _Dst = (undefined8 *)0x0;
    }
    else {
      _Dst = *(undefined8 **)(param_1 + 0x2d0);
    }
    if (uVar7 < 0x21) {
      uVar6 = (ulonglong)(param_3 & 7);
      for (uVar7 = uVar7 >> 3; uVar7 != 0; uVar7 = uVar7 - 1) {
        uVar5 = *param_2;
        param_2 = param_2 + 1;
        *_Dst = uVar5;
        _Dst = _Dst + 1;
      }
      if (uVar6 != 0) {
        puVar8 = param_2;
        do {
          uVar1 = *(undefined1 *)puVar8;
          puVar8 = (undefined8 *)((longlong)puVar8 + 1);
          uVar6 = uVar6 - 1;
          *(undefined1 *)((longlong)_Dst + (-1 - (longlong)param_2) + (longlong)puVar8) = uVar1;
        } while (uVar6 != 0);
      }
    }
    else {
      memcpy(_Dst,param_2,uVar7);
    }
    if (*(int *)(param_1 + 0x2d8) == 0) {
      local_50 = 0;
    }
    else {
      local_50 = *(undefined8 *)(param_1 + 0x2d0);
    }
    local_58[0] = param_3;
    FUN_1400a6460(param_4,local_48);
    local_68 = Proud::AddrPort::vftable;
    local_60 = *(undefined4 *)(param_4 + 8);
    local_5c = *(undefined2 *)(param_4 + 0xc);
    local_78[0] = 0;
    cVar2 = FUN_1400aa1b0(param_1,&local_68);
    if (cVar2 == '\0') {
      iVar4 = 0x271d;
    }
    else {
      local_88 = 0;
      *(undefined1 *)(param_1 + 0x280) = 0;
      local_90 = param_1 + 0x240;
      local_a0 = local_48;
      local_98 = 0x10;
      *(undefined1 *)(param_1 + 0x280) = 1;
      local_a8 = 0;
      iVar4 = WSASendTo(*(undefined8 *)(param_1 + 0x3d0),local_58,1,local_78);
      if ((iVar4 == 0) || (iVar4 = Ordinal_111(), iVar4 == 0x3e5)) {
        iVar4 = 0;
      }
      else {
        *(undefined1 *)(param_1 + 0x280) = 0;
        FUN_1400a9160(param_1,iVar4,L"Proud::CFastSocket::IssueSendTo");
      }
    }
  }
  return iVar4;
}



undefined4 FUN_1400aa930(longlong param_1)

{
  char cVar1;
  undefined4 uVar2;
  
  cVar1 = FUN_1400ab750(*(undefined8 *)(param_1 + 0x3d0),0,0);
  if (cVar1 == '\0') {
    uVar2 = Ordinal_111();
    FUN_1400a9160(param_1,uVar2,L"Proud::CFastSocket::Bind");
    return 0;
  }
  return 1;
}



undefined8 * FUN_1400aa980(undefined8 *param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_1400ad560(param_1 + 4,1);
  param_1[2] = param_2;
  param_1[3] = param_3;
  *param_1 = 0xffffffffffffffff;
  *(undefined4 *)(param_1 + 1) = 0;
  return param_1;
}



undefined8 FUN_1400aa9e0(longlong param_1)

{
  (**(code **)(param_1 + 0x10))(*(undefined8 *)(param_1 + 0x18));
  SetEvent(*(HANDLE *)(param_1 + 0x20));
  return 0x14d;
}



void FUN_1400aaa10(undefined8 *param_1)

{
  char cVar1;
  DWORD DVar2;
  
  if ((HANDLE)*param_1 != (HANDLE)0xffffffffffffffff) {
    DVar2 = WaitForSingleObject((HANDLE)*param_1,1);
    if (DVar2 == 0x102) {
      cVar1 = FUN_1401c1440(param_1 + 4,0x32);
      while ((cVar1 == '\0' && (DAT_1403142d0 == '\0'))) {
        cVar1 = FUN_1401c1440(param_1 + 4,0x32);
      }
    }
    CloseHandle((HANDLE)*param_1);
  }
  *(undefined4 *)(param_1 + 1) = 0;
  *param_1 = 0xffffffffffffffff;
  return;
}



void FUN_1400aaa90(longlong param_1)

{
  FUN_1400aaa10();
  FUN_14018a2d0(param_1 + 0x20);
  return;
}



MMRESULT * FUN_1400aaac0(MMRESULT *param_1,LPTIMECALLBACK param_2,UINT param_3)

{
  MMRESULT MVar1;
  
  MVar1 = timeSetEvent(param_3,param_3 / 10,param_2,0,0x11);
  *param_1 = MVar1;
  return param_1;
}



void FUN_1400aab00(UINT *param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001400aab02. Too many branches
                    // WARNING: Treating indirect jump as call
  timeKillEvent(*param_1);
  return;
}



void thunk_FUN_1400acf90(undefined8 *param_1)

{
  *param_1 = Proud::CRandom::vftable;
  FUN_1400a1cd0();
  return;
}



undefined8 * FUN_1400aab20(undefined8 *param_1)

{
  RPC_STATUS RVar1;
  UUID local_18;
  
  RVar1 = UuidCreate(&local_18);
  if (RVar1 != 0) {
    local_18.Data2 = 0;
    local_18.Data3 = 0;
    local_18.Data1 = 0;
    local_18.Data4[0] = '\0';
    local_18.Data4[1] = '\0';
    local_18.Data4[2] = '\0';
    local_18.Data4[3] = '\0';
    local_18.Data4[4] = '\0';
    local_18.Data4[5] = '\0';
    local_18.Data4[6] = '\0';
    local_18.Data4[7] = '\0';
  }
  *param_1 = CONCAT44(local_18._4_4_,local_18.Data1);
  param_1[1] = CONCAT44(local_18.Data4._4_4_,local_18.Data4._0_4_);
  return param_1;
}



void FUN_1400aab80(longlong *param_1)

{
  HANDLE pvVar1;
  undefined1 local_58 [80];
  
  if (*param_1 != -1) {
    FUN_1400a2320(local_58,L"Thread is already started!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  ResetEvent((HANDLE)param_1[4]);
  pvVar1 = CreateThread((LPSECURITY_ATTRIBUTES)0x0,0,FUN_1400aa9e0,param_1,0,(LPDWORD)(param_1 + 1))
  ;
  *param_1 = (longlong)pvVar1;
  return;
}



undefined8
FUN_1400aabf0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined *puVar2;
  
  uVar1 = 0xfffffffffffffffe;
  puVar2 = &DAT_1403142d8;
  FUN_1400a1c30(&DAT_1403142d8);
  FUN_1400ad610(&DAT_140314310,param_1,param_3,param_4,uVar1,puVar2,1);
  FUN_1400d1290(&DAT_1403142d8);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1400aac50(ulong *param_1,undefined8 param_2)

{
  RPC_STATUS RVar1;
  undefined4 extraout_var;
  undefined4 extraout_var_00;
  ulonglong uVar2;
  undefined1 auStack_168 [32];
  RPC_CSTR local_148;
  undefined8 local_140;
  UUID local_138;
  undefined1 *local_128;
  undefined1 local_120 [264];
  ulonglong local_18;
  
  local_140 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_168;
  local_138.Data1 = *param_1;
  local_138._4_4_ = param_1[1];
  local_138.Data4._0_4_ = param_1[2];
  local_138.Data4._4_4_ = param_1[3];
  RVar1 = UuidToStringA(&local_138,&local_148);
  if (RVar1 == 0) {
    local_128 = local_120;
    FUN_14008a6c0(&local_128,local_148,3);
    FUN_14001f680(param_2,local_128);
    if (local_128 != local_120) {
      free(local_128);
    }
    RVar1 = RpcStringFreeA(&local_148);
    uVar2 = CONCAT71((int7)(CONCAT44(extraout_var_00,RVar1) >> 8),1);
  }
  else {
    uVar2 = CONCAT44(extraout_var,RVar1) & 0xffffffffffffff00;
  }
  return uVar2;
}



longlong * FUN_1400aad20(undefined8 param_1,longlong *param_2)

{
  int *piVar1;
  undefined *puVar2;
  undefined *puVar3;
  char cVar4;
  undefined4 uVar5;
  undefined8 uVar6;
  undefined *local_res20;
  
  FUN_1400a3440();
  local_res20 = PTR_DAT_1402f8010;
  cVar4 = FUN_1400aac50(param_1,&local_res20);
  if (cVar4 == '\0') {
    FUN_1400a3440();
    *param_2 = (longlong)PTR_DAT_1402f8010;
    uVar5 = FUN_1400a32c0(&DAT_1402063e8);
    uVar6 = FUN_140002f20(param_2,uVar5);
    FUN_1400a32f0(uVar6,&DAT_1402063e8,uVar5);
    FUN_140003000(param_2);
    puVar3 = local_res20;
    if (local_res20 == (undefined *)0x0) {
      return param_2;
    }
    if (local_res20 == PTR_DAT_1402f8010) {
      return param_2;
    }
    puVar2 = local_res20 + -8;
    if (puVar2 == (undefined *)0x0) {
      return param_2;
    }
    uVar6 = FUN_1400a3440();
    FUN_1400a1c30(uVar6);
    piVar1 = (int *)(puVar3 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2);
    }
  }
  else {
    FUN_1400a3440();
    puVar2 = local_res20;
    puVar3 = PTR_DAT_1402f8010;
    *param_2 = (longlong)PTR_DAT_1402f8010;
    if (puVar3 == (undefined *)0x0) {
      *param_2 = (longlong)PTR_DAT_1402f8010;
    }
    if (local_res20 != (undefined *)*param_2) {
      uVar6 = FUN_1400a3440();
      FUN_1400a1c30(uVar6);
      FUN_1400031d0(param_2);
      *param_2 = (longlong)puVar2;
      if (((puVar2 != PTR_DAT_1402f8010) && (puVar2 != (undefined *)0x0)) &&
         (puVar2 != (undefined *)0x8)) {
        *(int *)(puVar2 + -4) = *(int *)(puVar2 + -4) + 1;
      }
      FUN_1400d1290(uVar6);
    }
    if (puVar2 == (undefined *)0x0) {
      return param_2;
    }
    if (puVar2 == PTR_DAT_1402f8010) {
      return param_2;
    }
    if (puVar2 + -8 == (undefined *)0x0) {
      return param_2;
    }
    uVar6 = FUN_1400a3440();
    FUN_1400a1c30(uVar6);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2 + -8);
    }
  }
  FUN_1400d1290(uVar6);
  return param_2;
}



void FUN_1400aaed0(undefined4 param_1,undefined8 param_2)

{
  undefined4 local_28 [2];
  undefined8 local_20;
  undefined4 local_18;
  undefined4 local_14;
  
  Sleep(10);
  local_28[0] = 0x1000;
  local_14 = 0;
  local_20 = param_2;
  local_18 = param_1;
  RaiseException(0x406d1388,0,3,(ULONG_PTR *)local_28);
  return;
}



undefined8 * FUN_1400aaf30(undefined8 *param_1,undefined8 param_2,undefined2 param_3)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0xe,uVar1,1);
  *param_1 = param_2;
  param_1[0xd] = 0;
  param_1[9] = 0;
  param_1[10] = 0;
  param_1[0xb] = 0;
  *(undefined4 *)(param_1 + 8) = 2;
  *(undefined2 *)(param_1 + 0xc) = param_3;
  *(undefined1 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_1400aafa0(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001400aafa7. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(**(longlong **)(param_1 + 8) + 0x18))();
  return;
}



ulonglong FUN_1400aafb0(longlong param_1)

{
  int *piVar1;
  int iVar2;
  ulonglong uVar3;
  int iVar4;
  LPVOID pvVar5;
  
  if (*(int *)(param_1 + 0x14) == 0) {
    return 0;
  }
  pvVar5 = TlsGetValue(DAT_140314d30);
  iVar4 = DAT_140314d28;
  if (pvVar5 == (LPVOID)0x0) {
    LOCK();
    piVar1 = (int *)(param_1 + 0x40);
    iVar2 = *piVar1;
    *piVar1 = *piVar1 + 1;
    UNLOCK();
    uVar3 = (longlong)(iVar2 + 1) % (longlong)iVar4;
    TlsSetValue(DAT_140314d30,(LPVOID)((longlong)(int)uVar3 + 1));
    return uVar3 & 0xffffffff;
  }
  return (longlong)pvVar5 - 1U & 0xffffffff;
}



undefined2 * FUN_1400ab030(longlong *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  char cVar3;
  undefined2 *puVar4;
  bool bVar5;
  undefined8 uVar6;
  longlong *plVar7;
  undefined1 uVar8;
  
  uVar6 = 0xfffffffffffffffe;
  if ((int)param_1[8] == 2) {
    bVar5 = *(int *)(*param_1 + 0x14) != 0;
    plVar1 = param_1 + 0xe;
    plVar7 = plVar1;
    if (bVar5) {
      FUN_1400a1c30();
    }
    *(undefined1 *)(param_1 + 0x15) = 1;
    uVar8 = bVar5;
    if (((*(int *)(*param_1 + 0x14) == 0) && (*(longlong *)(*param_1 + 0x18) != 0)) &&
       (cVar3 = FUN_1400a1d50(), cVar3 == '\0')) {
      FUN_1400a2b50();
    }
    if (param_2 != 0) {
      if (param_1[0xd] == 0) {
        param_1[0xd] = param_2;
      }
      else if (param_1[0xd] != param_2) {
        *(undefined1 *)(param_1 + 0x15) = 0;
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      lVar2 = param_1[9];
      if (lVar2 == 0) {
        puVar4 = (undefined2 *)
                 (**(code **)**(undefined8 **)(*param_1 + 8))
                           (*(undefined8 **)(*param_1 + 8),param_2 + 0x20,param_3,param_4,uVar6,
                            plVar7,uVar8);
        if (puVar4 != (undefined2 *)0x0) {
          puVar4[0xc] = 0;
          *(undefined8 *)(puVar4 + 8) = 0;
          *puVar4 = 0x10e1;
        }
        *(longlong *)(puVar4 + 4) = param_1[0xd];
        puVar4[0xc] = (short)param_1[0xc];
        param_1[0xb] = param_1[0xb] + 1;
        *(undefined1 *)(param_1 + 0x15) = 0;
        if (!bVar5) {
          return puVar4 + 0x10;
        }
        FUN_1400d1290(plVar1);
        return puVar4 + 0x10;
      }
      param_1[9] = *(longlong *)(lVar2 + 0x10);
      *(undefined8 *)(lVar2 + 0x10) = 0;
      *(short *)(lVar2 + 0x18) = (short)param_1[0xc];
      param_1[10] = param_1[10] + -1;
      *(undefined1 *)(param_1 + 0x15) = 0;
      if (!bVar5) {
        return (undefined2 *)(lVar2 + 0x20);
      }
      FUN_1400d1290(plVar1);
      return (undefined2 *)(lVar2 + 0x20);
    }
    *(undefined1 *)(param_1 + 0x15) = 0;
    if (bVar5) {
      FUN_1400d1290(plVar1);
    }
  }
  else {
    FUN_1400a2b50(L"CLookasideAllocator.Alloc() is called after the allocator is already disposed!")
    ;
  }
  return (undefined2 *)0x0;
}



void FUN_1400ab1c0(longlong *param_1,longlong param_2)

{
  char cVar1;
  bool bVar2;
  
  if ((int)param_1[8] != 2) {
    FUN_1400a2b50(
                 L"CLookasideAllocator.Free() is called after the allocator is already disposed! Doing Free before WinMain returns in highly recommended."
                 );
  }
  bVar2 = *(int *)(*param_1 + 0x14) != 0;
  if (bVar2) {
    FUN_1400a1c30(param_1 + 0xe);
  }
  *(undefined1 *)(param_1 + 0x15) = 1;
  if ((*(int *)(*param_1 + 0x14) == 0) && (*(longlong *)(*param_1 + 0x18) != 0)) {
    cVar1 = FUN_1400a1d50();
    if (cVar1 == '\0') {
      FUN_1400a2b50(L"Unsafe heap accessor with thread unsafety is detected!");
    }
  }
  if (*(longlong *)(param_2 + 0x10) == 0) {
    *(longlong *)(param_2 + 0x10) = param_1[9];
    param_1[9] = param_2;
    param_1[10] = param_1[10] + 1;
  }
  else {
    FUN_1400a2b50(
                 L"Not a CLookasideAllocator or owner CFastHeap allocated block! Refer to technical notes for more help."
                 );
    *(undefined1 *)(param_1 + 0x15) = 0;
  }
  *(undefined1 *)(param_1 + 0x15) = 0;
  if (bVar2) {
    FUN_1400d1290(param_1 + 0xe);
  }
  return;
}



void FUN_1400ab2b0(longlong *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  
  plVar1 = param_1 + 0xe;
  FUN_1400a1c60(plVar1);
  *(undefined4 *)(param_1 + 8) = 3;
  lVar2 = param_1[9];
  while (lVar2 != 0) {
    lVar2 = param_1[9];
    param_1[9] = *(longlong *)(lVar2 + 0x10);
    *(undefined8 *)(lVar2 + 0x10) = 0;
    (**(code **)(**(longlong **)(*param_1 + 8) + 0x10))();
    lVar2 = param_1[9];
  }
  FUN_1400d1290(plVar1);
  FUN_1400a1cd0(plVar1);
  return;
}



void FUN_1400ab350(longlong param_1,undefined8 param_2)

{
  int iVar1;
  
  iVar1 = FUN_1400aafb0();
  FUN_1400ab030(*(undefined8 *)(*(longlong *)(param_1 + 0x48) + (longlong)iVar1 * 8),param_2);
  return;
}



void FUN_1400ab390(longlong param_1,longlong param_2)

{
  longlong lVar1;
  
  if ((param_2 != 0) && (*(short *)(param_2 + -0x20) == 0x10e1)) {
    lVar1 = *(longlong *)(*(longlong *)(param_1 + 0x48) + (ulonglong)*(ushort *)(param_2 + -8) * 8);
    if ((*(ushort *)(param_2 + -8) < DAT_140314d28) &&
       (*(longlong *)(lVar1 + 0x68) == *(longlong *)(param_2 + -0x18))) {
      FUN_1400ab1c0(lVar1,param_2 + -0x20);
      return;
    }
  }
  FUN_1400a2b50(
               L"Not a CLookasideAllocator or owner CFastHeap allocated block! Refer to technical notes for more help."
               );
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1400ab3e0(void)

{
  undefined4 uVar1;
  DWORD DVar2;
  
  if ((DAT_140314d70 & 1) == 0) {
    DAT_140314d70 = DAT_140314d70 | 1;
    uVar1 = FUN_1401692e0();
    FUN_1400a1b50(&DAT_140314d38,uVar1,1);
    atexit((_func_5014 *)&LAB_140202940);
  }
  FUN_1400a1c30(&DAT_140314d38);
  if (DAT_140314d28 == 0) {
    DAT_140314d28 = FUN_1400a2990();
  }
  if (_DAT_140314d30 == 0) {
    DVar2 = TlsAlloc();
    _DAT_140314d30 = (ulonglong)DVar2;
  }
  FUN_1400d1290(&DAT_140314d38);
  return;
}



undefined8 * FUN_1400ab480(undefined8 *param_1,longlong *param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong lVar3;
  void *pvVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  ushort uVar8;
  
  FUN_1400a6430();
  *param_1 = Proud::CLookasideAllocatorImpl::vftable;
  plVar1 = param_1 + 1;
  FUN_1400a6440(plVar1);
  FUN_1400ab3e0(param_1);
  puVar5 = (undefined8 *)0x0;
  *(undefined4 *)(param_1 + 8) = 0;
  *plVar1 = *param_2;
  param_1[2] = param_2[1];
  param_1[3] = param_2[2];
  if (DAT_140313fcd != '\0') {
    *(undefined4 *)((longlong)param_1 + 0x14) = 1;
  }
  if (*plVar1 == 0) {
    lVar3 = FUN_1400a3e20();
    *plVar1 = lVar3;
  }
  if (*(int *)((longlong)param_1 + 0x14) == 0) {
    pvVar4 = malloc(8);
    param_1[9] = pvVar4;
    pvVar4 = operator_new(0xc0);
    if (pvVar4 != (void *)0x0) {
      puVar5 = (undefined8 *)FUN_1400aaf30(pvVar4,param_1,0);
    }
    *(undefined8 **)param_1[9] = puVar5;
  }
  else {
    pvVar4 = malloc((ulonglong)DAT_140314d28 << 3);
    param_1[9] = pvVar4;
    uVar8 = 0;
    if (DAT_140314d28 != 0) {
      do {
        puVar6 = operator_new(0xc0);
        puVar7 = puVar5;
        if (puVar6 != (undefined8 *)0x0) {
          uVar2 = FUN_1401692e0();
          FUN_1400a1b50(puVar6 + 0xe,uVar2,1);
          *puVar6 = param_1;
          puVar6[0xd] = 0;
          *(undefined4 *)(puVar6 + 8) = 2;
          puVar6[9] = 0;
          puVar6[10] = 0;
          puVar6[0xb] = 0;
          *(ushort *)(puVar6 + 0xc) = uVar8;
          *(undefined1 *)(puVar6 + 0x15) = 0;
          puVar7 = puVar6;
        }
        *(undefined8 **)(param_1[9] + (ulonglong)uVar8 * 8) = puVar7;
        uVar8 = uVar8 + 1;
      } while (uVar8 < DAT_140314d28);
    }
  }
  return param_1;
}



void FUN_1400ab5f0(undefined8 *param_1)

{
  void *pvVar1;
  uint uVar2;
  ushort uVar3;
  
  *param_1 = Proud::CLookasideAllocatorImpl::vftable;
  if (*(int *)((longlong)param_1 + 0x14) == 0) {
    pvVar1 = *(void **)param_1[9];
    if (pvVar1 != (void *)0x0) {
      FUN_1400ab2b0(pvVar1);
      operator_delete(pvVar1);
    }
  }
  else {
    uVar3 = 0;
    uVar2 = DAT_140314d28;
    if (DAT_140314d28 != 0) {
      do {
        pvVar1 = *(void **)(param_1[9] + (ulonglong)uVar3 * 8);
        if (pvVar1 != (void *)0x0) {
          FUN_1400ab2b0(pvVar1);
          operator_delete(pvVar1);
          uVar2 = DAT_140314d28;
        }
        uVar3 = uVar3 + 1;
      } while (uVar3 < uVar2);
    }
  }
  free((void *)param_1[9]);
  FUN_1400a63f0(param_1);
  return;
}



undefined8 FUN_1400ab6b0(undefined8 param_1,uint param_2)

{
  FUN_1400ab5f0();
  if ((param_2 & 1) != 0) {
    FUN_1400a3530(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

bool FUN_1400ab6e0(undefined8 param_1,undefined4 param_2,undefined2 param_3)

{
  undefined2 uVar1;
  int iVar2;
  undefined1 auStack_48 [32];
  undefined4 local_28;
  undefined4 uStack_24;
  undefined8 local_20;
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_48;
  local_20 = 0;
  _local_28 = CONCAT44(param_2,2);
  uVar1 = Ordinal_9(param_3);
  local_28 = CONCAT22(uVar1,(undefined2)local_28);
  iVar2 = Ordinal_2(param_1,&local_28,0x10);
  return iVar2 != -1;
}



ulonglong FUN_1400ab750(undefined8 param_1,longlong param_2,undefined4 param_3)

{
  int iVar1;
  ulonglong uVar2;
  
  if (param_2 == 0) {
    iVar1 = 0;
  }
  else {
    iVar1 = Ordinal_11(param_2);
    if (iVar1 == -1) {
      uVar2 = Ordinal_112(0x2726);
      return uVar2 & 0xffffffffffffff00;
    }
  }
  uVar2 = FUN_1400ab6e0(param_1,iVar1,param_3);
  return uVar2;
}



longlong * FUN_1400ab7b0(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined4 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  ulonglong uVar7;
  uint uVar8;
  undefined *local_res18;
  undefined *local_res20;
  undefined8 uVar10;
  ulonglong uVar9;
  
  uVar10 = 0xfffffffffffffffe;
  uVar7 = 0;
  local_res18 = (undefined *)((ulonglong)local_res18 & 0xffffffff00000000);
  lVar5 = Ordinal_52(param_2);
  if ((lVar5 == 0) || (**(longlong **)(lVar5 + 0x18) == 0)) {
    FUN_1400a3440();
    *param_1 = (longlong)PTR_DAT_1402f8008;
    uVar4 = FUN_1400a3360(&DAT_14027a10a);
    uVar6 = FUN_14000c420(param_1,uVar4);
    FUN_1400a3390(uVar6,&DAT_14027a10a,uVar4,param_4,uVar10);
    FUN_14000c510(param_1);
  }
  else {
    FUN_1400a3440();
    local_res20 = PTR_DAT_1402f8008;
    uVar9 = uVar7;
    if (0 < *(short *)(lVar5 + 0x12)) {
      do {
        FUN_1400a3440();
        local_res18 = PTR_DAT_1402f8008;
        if (0 < (longlong)uVar7) {
          FUN_1400a6950(&local_res20,&DAT_140283d4c);
        }
        FUN_1400a50f0(&local_res18,&DAT_140205900,
                      *(undefined1 *)(**(longlong **)(lVar5 + 0x18) + uVar7));
        FUN_1400a4f60(&local_res20,&local_res18);
        puVar3 = local_res18;
        if (((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1402f8008)) &&
           (puVar1 = local_res18 + -8, puVar1 != (undefined *)0x0)) {
          uVar10 = FUN_1400a3440();
          FUN_1400a1c30(uVar10);
          piVar2 = (int *)(puVar3 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_1400a3530(puVar1);
          }
          FUN_1400d1290(uVar10);
        }
        uVar8 = (int)uVar9 + 1;
        uVar9 = (ulonglong)uVar8;
        uVar7 = uVar7 + 1;
      } while ((int)uVar8 < (int)*(short *)(lVar5 + 0x12));
    }
    puVar1 = local_res20;
    FUN_1400a3440();
    puVar3 = PTR_DAT_1402f8008;
    *param_1 = (longlong)PTR_DAT_1402f8008;
    if (puVar3 == (undefined *)0x0) {
      *param_1 = (longlong)PTR_DAT_1402f8008;
    }
    if (puVar1 != (undefined *)*param_1) {
      uVar10 = FUN_1400a3440();
      FUN_1400a1c30(uVar10);
      FUN_14000c2a0(param_1);
      *param_1 = (longlong)puVar1;
      if (((puVar1 != PTR_DAT_1402f8008) && (puVar1 != (undefined *)0x0)) &&
         (puVar1 != (undefined *)0x8)) {
        *(int *)(puVar1 + -4) = *(int *)(puVar1 + -4) + 1;
      }
      FUN_1400d1290(uVar10);
    }
    if (((puVar1 != (undefined *)0x0) && (puVar1 != PTR_DAT_1402f8008)) &&
       (puVar1 + -8 != (undefined *)0x0)) {
      uVar10 = FUN_1400a3440();
      FUN_1400a1c30(uVar10);
      piVar2 = (int *)(puVar1 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1 + -8);
      }
      FUN_1400d1290(uVar10);
    }
  }
  return param_1;
}



void FUN_1400aba10(undefined8 param_1)

{
  int iVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  short local_res10;
  short local_res12;
  undefined4 local_res18 [2];
  undefined *local_res20;
  
  local_res18[0] = 4;
  iVar1 = Ordinal_7(param_1,0xffff,0x80,&local_res10,local_res18);
  if (((iVar1 == 0) && (local_res10 != 0)) && (local_res12 != 0)) {
    FUN_1400a3440();
    local_res20 = PTR_DAT_1402f8010;
    uVar2 = FUN_1400a32c0(
                         L"FATAL: Socket which has behavior of some waits in closesocket() has been detected!"
                         );
    uVar3 = FUN_140002f20(&local_res20,uVar2);
    FUN_1400a32f0(uVar3,
                  L"FATAL: Socket which has behavior of some waits in closesocket() has been detected!"
                  ,uVar2);
    FUN_140003000(&local_res20);
    FUN_1400a6370(&local_res20);
  }
  return;
}



void FUN_1400abab0(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined1 local_58 [88];
  
  lVar1 = *param_1;
  while( true ) {
    if (lVar1 == 0) {
      return;
    }
    plVar2 = (longlong *)*param_1;
    if ((longlong *)plVar2[2] != param_1) break;
    plVar3 = (longlong *)plVar2[1];
    lVar1 = *plVar2;
    if (plVar3 != (longlong *)0x0) {
      *plVar3 = lVar1;
    }
    if (lVar1 != 0) {
      *(longlong **)(lVar1 + 8) = plVar3;
    }
    if (plVar3 == (longlong *)0x0) {
      if ((longlong *)param_1[1] != plVar2) {
        FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                      L"Proud::CListNode<class Proud::CFastSocket>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      param_1[1] = lVar1;
    }
    if (lVar1 == 0) {
      if ((longlong *)*param_1 != plVar2) {
        FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                      L"Proud::CListNode<class Proud::CFastSocket>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      *param_1 = (longlong)plVar3;
    }
    *plVar2 = 0;
    plVar2[1] = 0;
    plVar2[2] = 0;
    *(int *)(param_1 + 2) = (int)param_1[2] + -1;
    lVar1 = *param_1;
  }
  FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                L"Proud::CListNode<class Proud::CFastSocket>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
}



void thunk_FUN_1400abab0(void)

{
  FUN_1400abab0();
  return;
}



longlong * FUN_1400abbb0(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  longlong *plVar3;
  
  plVar1 = (longlong *)param_1[1];
  if (plVar1 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  *param_2 = plVar1[2];
  param_2[1] = plVar1[3];
  param_2[2] = plVar1[4];
  lVar2 = *plVar1;
  param_1[1] = lVar2;
  if (lVar2 == 0) {
    param_1[2] = 0;
  }
  else {
    *(undefined8 *)(lVar2 + 8) = 0;
  }
  plVar3 = (longlong *)*param_1;
  if (plVar3 != (longlong *)0x0) {
    (**(code **)(*plVar3 + 0x10))(plVar3,plVar1);
    param_1[3] = param_1[3] + -1;
    return param_2;
  }
  FUN_1400a3530();
  param_1[3] = param_1[3] + -1;
  return param_2;
}



longlong FUN_1400abc50(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  
  if (param_2 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  lVar1 = *param_2;
  if (param_2 == (longlong *)param_1[1]) {
    param_1[1] = lVar1;
  }
  else {
    *(longlong *)param_2[1] = lVar1;
  }
  if (param_2 == (longlong *)param_1[2]) {
    param_1[2] = param_2[1];
  }
  else {
    *(longlong *)(*param_2 + 8) = param_2[1];
  }
  if ((longlong *)*param_1 != (longlong *)0x0) {
    (**(code **)(*(longlong *)*param_1 + 0x10))();
    param_1[3] = param_1[3] + -1;
    return lVar1;
  }
  FUN_1400a3530(param_2);
  param_1[3] = param_1[3] + -1;
  return lVar1;
}



undefined8 FUN_1400abce0(longlong param_1,undefined8 *param_2,uint param_3)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  bool bVar3;
  undefined4 uVar4;
  undefined2 uVar5;
  int iVar6;
  char cVar7;
  DWORD DVar8;
  longlong lVar9;
  undefined8 *puVar10;
  int iVar11;
  double dVar12;
  double dVar13;
  int local_res8 [2];
  longlong local_res20;
  longlong local_a8;
  undefined1 local_a0;
  undefined8 local_98;
  longlong local_90;
  undefined8 local_88;
  undefined4 local_80;
  undefined8 local_78;
  undefined **local_70;
  undefined4 local_68;
  undefined2 local_64;
  undefined4 local_60;
  
  local_98 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x28) == 0) {
    SetLastError(0);
    dVar12 = (double)FUN_1400ad790(param_1);
    local_res20 = param_1 + 0x50;
    puVar1 = (undefined8 *)(param_1 + 0x38);
    iVar11 = 0;
    do {
      local_a8 = param_1 + 0x50;
      FUN_1400a1c30(local_a8);
      local_a0 = 1;
      local_res8[0] = *(int *)(param_1 + 0x48) * 3 + 3;
      puVar2 = (undefined8 *)*puVar1;
      local_70 = Proud::AddrPort::vftable;
      local_60 = 0;
      local_78 = 0;
      local_68 = DAT_1402f83d0;
      local_64 = DAT_1402f83d4;
      for (; puVar2 != (undefined8 *)0x0; puVar2 = (undefined8 *)puVar2[1]) {
        cVar7 = FUN_1400a87e0(puVar2,0,&local_78);
        if (cVar7 != '\0') {
          *(undefined4 *)(param_2 + 2) = 1;
          puVar10 = puVar2 + 0x48;
LAB_1400ac049:
          FUN_1400a7e30(puVar10,0,0);
          *param_2 = puVar2[0x5d];
          *(undefined4 *)((longlong)param_2 + 0xc) = local_78._4_4_;
          *(undefined4 *)(param_2 + 1) = local_60;
          if (puVar2[2] != 0) {
            FUN_1400a83b0(puVar2[2],puVar2);
          }
          if (puVar2[2] != 0) {
            FUN_1400a83b0(puVar1,puVar2);
          }
          if (*(longlong *)(param_1 + 0x40) == 0) {
            *puVar1 = puVar2;
          }
          else {
            *(undefined8 **)(*(longlong *)(param_1 + 0x40) + 8) = puVar2;
            *puVar2 = *(undefined8 *)(param_1 + 0x40);
          }
          *(undefined8 **)(param_1 + 0x40) = puVar2;
          puVar2[2] = puVar1;
          *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
          lVar9 = local_res20;
          goto LAB_1400ac0fa;
        }
        cVar7 = FUN_1400a8570(puVar2,0,&local_78);
        if (cVar7 != '\0') {
          *(undefined4 *)(param_2 + 2) = 2;
          *(undefined4 *)(param_2 + 4) = *(undefined4 *)((longlong)puVar2 + 0x304);
          FUN_1400a64a0(param_2 + 5,puVar2 + 0x5e);
          puVar10 = puVar2 + 0x30;
          goto LAB_1400ac049;
        }
        cVar7 = FUN_1400a8640(puVar2,0,&local_78);
        if (cVar7 != '\0') {
          *(undefined4 *)(param_2 + 2) = 3;
          puVar10 = puVar2 + 0x18;
          goto LAB_1400ac049;
        }
        cVar7 = FUN_1400a8710(puVar2,0,&local_78);
        if (cVar7 != '\0') {
          *(undefined4 *)(param_2 + 2) = 4;
          puVar10 = puVar2 + 0x68;
          goto LAB_1400ac049;
        }
      }
      if (*(longlong *)(param_1 + 0xa0) != 0) {
        FUN_1400abbb0(param_1 + 0x88,&local_90);
        if (local_90 == 0) {
          *param_2 = 0;
        }
        else {
          *param_2 = *(undefined8 *)(local_90 + 0x2e8);
        }
        *(undefined4 *)(param_2 + 2) = local_80;
        param_2[3] = local_88;
        param_2[1] = 0;
        lVar9 = param_1 + 0x50;
LAB_1400ac0fa:
        FUN_1400d1290(lVar9);
        return 1;
      }
      FUN_1400d1290(param_1 + 0x50);
      local_a0 = 0;
      if ((param_3 == 0) ||
         ((param_3 != 0xffffffff &&
          (dVar13 = (double)FUN_1400ad790(param_1), (double)param_3 < (dVar13 - dVar12) * 1000.0))))
      {
        return 0;
      }
      bVar3 = local_res8[0] <= iVar11;
      iVar6 = 0;
      if (!bVar3) {
        iVar6 = iVar11 + 1;
      }
      iVar11 = iVar6;
      Sleep((uint)bVar3);
    } while( true );
  }
  local_res8[0] = 0;
  local_a8 = 0;
  local_res20 = 0;
  SetLastError(0);
  uVar5 = DAT_1402f83d4;
  uVar4 = DAT_1402f83d0;
  *param_2 = 0;
  param_2[1] = 0;
  *(undefined4 *)(param_2 + 2) = 5;
  param_2[3] = 0;
  *(undefined4 *)(param_2 + 4) = 0;
  *(undefined4 *)(param_2 + 6) = uVar4;
  *(undefined2 *)((longlong)param_2 + 0x34) = uVar5;
  lVar9 = FUN_1400a2b00();
  (**(code **)(lVar9 + 0x18))
            (*(undefined8 *)(param_1 + 0x28),local_res8,&local_a8,&local_res20,param_3);
  if (local_res20 == 0) {
    DVar8 = GetLastError();
    *(DWORD *)((longlong)param_2 + 0xc) = DVar8;
    return 0;
  }
  if (local_a8 == 0) {
    *param_2 = 0;
  }
  else {
    *param_2 = *(undefined8 *)(local_a8 + 0x2e8);
  }
  if (local_res20 < 0) {
    *(int *)(param_2 + 1) = local_res8[0];
    param_2[3] = local_res20;
    *(undefined8 *)((longlong)param_2 + 0xc) = 0;
    *(undefined4 *)(param_2 + 6) = DAT_1402f83d0;
    *(undefined2 *)((longlong)param_2 + 0x34) = DAT_1402f83d4;
    *(undefined4 *)(param_2 + 4) = 0;
    return 1;
  }
  if (local_a8 != 0) {
    lVar9 = local_a8 + 0x180;
    if (local_res20 == lVar9) {
      *(undefined4 *)(param_2 + 2) = 2;
      *(undefined4 *)(param_2 + 4) = *(undefined4 *)(local_a8 + 0x304);
      FUN_1400a64a0(param_2 + 5,local_a8 + 0x2f0);
      FUN_1400a7e30(lVar9,0,0);
      goto LAB_1400abe91;
    }
    if (local_res20 == local_a8 + 0x240) {
      *(undefined4 *)(param_2 + 2) = 1;
      FUN_1400a7e30(local_a8 + 0x240,0,0);
      goto LAB_1400abe91;
    }
    if (local_res20 == local_a8 + 0xc0) {
      *(undefined4 *)(param_2 + 2) = 3;
      FUN_1400a7e30(local_a8 + 0xc0,0,0);
      goto LAB_1400abe91;
    }
    if (local_res20 == local_a8 + 0x340) {
      *(undefined4 *)(param_2 + 2) = 4;
      FUN_1400a7e30(local_a8 + 0x340,0,0);
      goto LAB_1400abe91;
    }
  }
  *(undefined4 *)(param_2 + 2) = 0;
  param_2[3] = local_res20;
LAB_1400abe91:
  *(int *)(param_2 + 1) = local_res8[0];
  *(undefined4 *)((longlong)param_2 + 0xc) = 0;
  GetLastError();
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400ac130(longlong param_1,longlong param_2,uint *param_3,uint param_4)

{
  uint uVar1;
  longlong lVar2;
  undefined8 *puVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong *plVar6;
  bool bVar7;
  undefined4 uVar8;
  undefined2 uVar9;
  char cVar10;
  int iVar11;
  longlong lVar12;
  undefined8 *puVar13;
  undefined8 *puVar14;
  undefined8 uVar15;
  ulonglong uVar16;
  ulonglong uVar17;
  longlong *plVar18;
  double dVar19;
  double dVar20;
  undefined1 auStack_2a8 [32];
  uint local_288;
  undefined4 local_280;
  uint local_278 [2];
  undefined8 local_270;
  undefined4 local_268;
  undefined4 uStack_264;
  undefined4 local_260;
  undefined2 local_25c;
  ulonglong local_258;
  undefined4 local_250;
  undefined **local_248;
  undefined4 local_240;
  undefined2 local_23c;
  int local_238;
  uint local_234;
  longlong local_230;
  undefined8 local_228;
  undefined8 local_220;
  undefined4 local_218;
  undefined8 local_210;
  undefined4 local_208;
  undefined **local_200;
  undefined4 local_1f8;
  undefined2 local_1f4;
  longlong local_1f0;
  uint *local_1e8;
  longlong local_1e0;
  longlong local_1d8;
  undefined1 local_1d0;
  undefined8 local_1c8;
  longlong local_1b8 [3];
  undefined4 auStack_1a0 [74];
  ulonglong local_78;
  
  local_1c8 = 0xfffffffffffffffe;
  local_78 = DAT_1402f85a0 ^ (ulonglong)auStack_2a8;
  if (9 < *(uint *)(param_2 + 0x18)) {
    local_234 = param_4;
    local_1f0 = param_2;
    local_1e8 = param_3;
    if (*(longlong *)(param_1 + 0x28) == 0) {
      SetLastError(0);
      dVar19 = (double)FUN_1400ad790(param_1);
      local_278[0] = 0;
      *param_3 = 0;
      local_230 = param_1 + 0x50;
      plVar18 = (longlong *)(param_1 + 0x38);
      do {
        local_1d8 = param_1 + 0x50;
        FUN_1400a1c30(local_1d8);
        local_1d0 = 1;
        local_238 = *(int *)(param_1 + 0x48) * 3 + 3;
        puVar13 = (undefined8 *)*plVar18;
        local_268 = 0x40205338;
        uStack_264 = 1;
        local_258 = local_258 & 0xffffffff00000000;
        local_270 = 0;
        puVar3 = puVar13;
        local_260 = DAT_1402f83d0;
        local_25c = DAT_1402f83d4;
        do {
          if (puVar3 == (undefined8 *)0x0) break;
          local_200 = Proud::AddrPort::vftable;
          local_228 = 0;
          local_210 = 0;
          local_220 = 0;
          local_218 = 5;
          local_208 = 0;
          local_1f8 = DAT_1402f83d0;
          local_1f4 = DAT_1402f83d4;
          cVar10 = FUN_1400a87e0(puVar3,0,&local_270);
          if (cVar10 == '\0') {
            cVar10 = FUN_1400a8570(puVar3,0,&local_270);
            if (cVar10 != '\0') {
              local_218 = 2;
              local_208 = *(undefined4 *)((longlong)puVar3 + 0x304);
              FUN_1400a64a0(&local_200);
              puVar14 = puVar3 + 0x30;
              goto LAB_1400ac568;
            }
            cVar10 = FUN_1400a8640(puVar3,0,&local_270);
            if (cVar10 != '\0') {
              local_218 = 3;
              puVar14 = puVar3 + 0x18;
              goto LAB_1400ac568;
            }
            cVar10 = FUN_1400a8710(puVar3,0,&local_270);
            if (cVar10 != '\0') {
              local_218 = 4;
              puVar14 = puVar3 + 0x68;
              goto LAB_1400ac568;
            }
          }
          else {
            local_218 = 1;
            puVar14 = puVar3 + 0x48;
LAB_1400ac568:
            FUN_1400a7e30(puVar14,0,0);
            local_228 = puVar3[0x5d];
            local_220 = CONCAT44((int)((ulonglong)local_270 >> 0x20),(undefined4)local_258);
            if (puVar3[2] != 0) {
              FUN_1400a83b0();
            }
            if (puVar3[2] != 0) {
              FUN_1400a83b0(plVar18);
            }
            if (*(longlong *)(param_1 + 0x40) == 0) {
              *plVar18 = (longlong)puVar3;
            }
            else {
              *(undefined8 **)(*(longlong *)(param_1 + 0x40) + 8) = puVar3;
              *puVar3 = *(undefined8 *)(param_1 + 0x40);
            }
            *(undefined8 **)(param_1 + 0x40) = puVar3;
            puVar3[2] = plVar18;
            *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
            uVar1 = *param_3;
            if (((int)uVar1 < 0) || (*(int *)(param_2 + 0x18) <= (int)uVar1)) {
                    // WARNING: Subroutine does not return
              FUN_1400a2700();
            }
            puVar14 = (undefined8 *)((longlong)(int)uVar1 * 0x38 + *(longlong *)(param_2 + 0x10));
            *puVar14 = local_228;
            *(undefined4 *)(puVar14 + 1) = (undefined4)local_220;
            *(undefined4 *)((longlong)puVar14 + 0xc) = local_220._4_4_;
            *(undefined4 *)(puVar14 + 2) = local_218;
            puVar14[3] = local_210;
            *(undefined4 *)(puVar14 + 4) = local_208;
            *(undefined4 *)(puVar14 + 6) = local_1f8;
            *(undefined2 *)((longlong)puVar14 + 0x34) = local_1f4;
            *param_3 = *param_3 + 1;
            if (9 < *param_3) goto LAB_1400ac7e3;
          }
          puVar3 = (undefined8 *)puVar3[1];
        } while (puVar3 != puVar13);
        lVar12 = *(longlong *)(param_1 + 0xa0);
        uVar8 = DAT_1402f83d0;
        uVar9 = DAT_1402f83d4;
        while (DAT_1402f83d0 = uVar8, DAT_1402f83d4 = uVar9, lVar12 != 0) {
          plVar4 = *(longlong **)(param_1 + 0x90);
          if (plVar4 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000c6c0(0x80004005);
          }
          lVar12 = plVar4[2];
          lVar2 = plVar4[3];
          local_1e0 = plVar4[4];
          lVar5 = *plVar4;
          *(longlong *)(param_1 + 0x90) = lVar5;
          if (lVar5 == 0) {
            *(undefined8 *)(param_1 + 0x98) = 0;
          }
          else {
            *(undefined8 *)(lVar5 + 8) = 0;
          }
          plVar6 = *(longlong **)(param_1 + 0x88);
          if (plVar6 == (longlong *)0x0) {
            FUN_1400a3530();
          }
          else {
            (**(code **)(*plVar6 + 0x10))(plVar6,plVar4);
          }
          *(longlong *)(param_1 + 0xa0) = *(longlong *)(param_1 + 0xa0) + -1;
          uVar15 = 0;
          if (lVar12 != 0) {
            uVar15 = *(undefined8 *)(lVar12 + 0x2e8);
          }
          uVar1 = *local_1e8;
          if (((int)uVar1 < 0) || (*(int *)(local_1f0 + 0x18) <= (int)uVar1)) {
                    // WARNING: Subroutine does not return
            FUN_1400a2700();
          }
          puVar13 = (undefined8 *)((longlong)(int)uVar1 * 0x38 + *(longlong *)(local_1f0 + 0x10));
          *puVar13 = uVar15;
          puVar13[1] = 0;
          *(int *)(puVar13 + 2) = (int)local_1e0;
          puVar13[3] = lVar2;
          *(undefined4 *)(puVar13 + 4) = 0;
          *(undefined4 *)(puVar13 + 6) = uVar8;
          *(undefined2 *)((longlong)puVar13 + 0x34) = uVar9;
          *local_1e8 = *local_1e8 + 1;
          if (9 < *local_1e8) goto LAB_1400ac7e3;
          param_3 = local_1e8;
          param_2 = local_1f0;
          uVar8 = DAT_1402f83d0;
          uVar9 = DAT_1402f83d4;
          lVar12 = *(longlong *)(param_1 + 0xa0);
        }
        if (*param_3 != 0) {
LAB_1400ac7e3:
          FUN_1400d1290(local_230);
          return 1;
        }
        FUN_1400d1290(param_1 + 0x50);
        local_1d0 = 0;
        uVar16 = (ulonglong)local_234;
        if ((local_234 == 0) ||
           ((local_234 != 0xffffffff &&
            (dVar20 = (double)FUN_1400ad790(param_1), (double)uVar16 < (dVar20 - dVar19) * 1000.0)))
           ) {
          return 0;
        }
        bVar7 = local_238 <= (int)local_278[0];
        if (bVar7) {
          local_278[0] = 0;
        }
        else {
          local_278[0] = local_278[0] + 1;
        }
        Sleep((uint)bVar7);
      } while( true );
    }
    uVar16 = 0;
    local_278[0] = 0;
    SetLastError(0);
    lVar12 = FUN_1400a2b00();
    local_280 = 0;
    local_288 = param_4;
    iVar11 = (**(code **)(lVar12 + 0x20))(*(undefined8 *)(param_1 + 0x28),local_1b8,10,local_278);
    if (iVar11 == 0) {
      GetLastError();
    }
    else if (local_278[0] != 0) {
      *param_3 = local_278[0];
      plVar18 = local_1b8 + 1;
      uVar17 = uVar16;
      do {
        local_248 = Proud::AddrPort::vftable;
        local_270 = 0;
        local_258 = 0;
        local_268 = 0;
        uStack_264 = 0;
        local_260 = 5;
        local_250 = 0;
        local_240 = DAT_1402f83d0;
        local_23c = DAT_1402f83d4;
        lVar12 = *plVar18;
        iVar11 = (int)uVar17;
        if (lVar12 == 0) {
          uStack_264 = 0xffffffff;
          if ((iVar11 < 0) || (*(int *)(param_2 + 0x18) <= iVar11)) {
                    // WARNING: Subroutine does not return
            FUN_1400a2700();
          }
          lVar12 = *(longlong *)(param_2 + 0x10);
          *(undefined8 *)(uVar16 + lVar12) = 0;
        }
        else {
          lVar2 = plVar18[-1];
          if (lVar2 == 0) {
            local_270 = 0;
          }
          else {
            local_270 = *(undefined8 *)(lVar2 + 0x2e8);
          }
          if (lVar12 < 0) {
            local_268 = (undefined4)plVar18[2];
            uStack_264 = 0;
            local_260 = 0;
            local_250 = 0;
            if ((iVar11 < 0) || (local_258 = lVar12, *(int *)(param_2 + 0x18) <= iVar11)) {
              local_258 = lVar12;
                    // WARNING: Subroutine does not return
              FUN_1400a2700();
            }
          }
          else {
            if (lVar2 == 0) {
LAB_1400ac365:
              local_260 = 0;
              local_258 = lVar12;
            }
            else if (lVar12 == lVar2 + 0x180) {
              local_260 = 2;
              local_250 = *(undefined4 *)(lVar2 + 0x304);
              FUN_1400a64a0(&local_248,lVar2 + 0x2f0);
              FUN_1400a7e30(lVar2 + 0x180,0,0);
            }
            else if (lVar12 == lVar2 + 0x240) {
              local_260 = 1;
              FUN_1400a7e30(lVar2 + 0x240,0,0);
            }
            else if (lVar12 == lVar2 + 0xc0) {
              local_260 = 3;
              FUN_1400a7e30(lVar2 + 0xc0,0,0);
            }
            else {
              if (lVar12 != lVar2 + 0x340) goto LAB_1400ac365;
              local_260 = 4;
              FUN_1400a7e30(lVar2 + 0x340,0,0);
            }
            local_268 = (undefined4)plVar18[2];
            uStack_264 = 0;
            if ((iVar11 < 0) || (*(int *)(param_2 + 0x18) <= iVar11)) {
                    // WARNING: Subroutine does not return
              FUN_1400a2700();
            }
          }
          uStack_264 = 0;
          lVar12 = *(longlong *)(param_2 + 0x10);
          *(undefined8 *)(uVar16 + lVar12) = local_270;
        }
        *(undefined4 *)(uVar16 + 8 + lVar12) = local_268;
        *(undefined4 *)(uVar16 + 0xc + lVar12) = uStack_264;
        *(undefined4 *)(uVar16 + 0x10 + lVar12) = local_260;
        *(ulonglong *)(uVar16 + 0x18 + lVar12) = local_258;
        *(undefined4 *)(uVar16 + 0x20 + lVar12) = local_250;
        *(undefined4 *)(uVar16 + 0x30 + lVar12) = local_240;
        *(undefined2 *)(uVar16 + 0x34 + lVar12) = local_23c;
        uVar17 = (ulonglong)(iVar11 + 1U);
        plVar18 = plVar18 + 4;
        uVar16 = uVar16 + 0x38;
        if (local_278[0] <= iVar11 + 1U) {
          return 1;
        }
      } while( true );
    }
  }
  return 0;
}



void FUN_1400ac830(longlong param_1,ULONG_PTR param_2,LPOVERLAPPED param_3)

{
  undefined8 uVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  uint uStack_c;
  
  if (*(HANDLE *)(param_1 + 0x28) == (HANDLE)0x0) {
    FUN_1400a1c30(param_1 + 0x50);
    uVar1 = *(undefined8 *)(param_1 + 0x98);
    plVar2 = *(longlong **)(param_1 + 0x88);
    if (plVar2 == (longlong *)0x0) {
      puVar3 = (undefined8 *)FUN_1400a34c0(0x28);
    }
    else {
      puVar3 = (undefined8 *)(**(code **)(*plVar2 + 8))(plVar2,0x28);
    }
    if (puVar3 != (undefined8 *)0x0) {
      puVar3[2] = param_2;
      puVar3[3] = param_3;
      puVar3[4] = (ulonglong)uStack_c << 0x20;
    }
    puVar3[1] = uVar1;
    *puVar3 = 0;
    *(longlong *)(param_1 + 0xa0) = *(longlong *)(param_1 + 0xa0) + 1;
    if (*(undefined8 **)(param_1 + 0x98) == (undefined8 *)0x0) {
      *(undefined8 **)(param_1 + 0x90) = puVar3;
    }
    else {
      **(undefined8 **)(param_1 + 0x98) = puVar3;
    }
    *(undefined8 **)(param_1 + 0x98) = puVar3;
    FUN_1400d1290(param_1 + 0x50);
  }
  else {
    PostQueuedCompletionStatus(*(HANDLE *)(param_1 + 0x28),0,param_2,param_3);
  }
  return;
}



void FUN_1400ac930(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  undefined8 uVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  undefined4 uStack_c;
  
  FUN_1400a1c30(param_1 + 0x50);
  if (*(longlong *)(param_1 + 0x28) == 0) {
    uVar1 = *(undefined8 *)(param_1 + 0x98);
    plVar2 = *(longlong **)(param_1 + 0x88);
    if (plVar2 == (longlong *)0x0) {
      puVar3 = (undefined8 *)FUN_1400a34c0(0x28);
    }
    else {
      puVar3 = (undefined8 *)(**(code **)(*plVar2 + 8))(plVar2,0x28);
    }
    if (puVar3 != (undefined8 *)0x0) {
      puVar3[2] = param_2;
      puVar3[3] = 0;
      puVar3[4] = CONCAT44(uStack_c,param_3);
    }
    puVar3[1] = uVar1;
    *puVar3 = 0;
    *(longlong *)(param_1 + 0xa0) = *(longlong *)(param_1 + 0xa0) + 1;
    if (*(undefined8 **)(param_1 + 0x98) == (undefined8 *)0x0) {
      *(undefined8 **)(param_1 + 0x90) = puVar3;
    }
    else {
      **(undefined8 **)(param_1 + 0x98) = puVar3;
    }
    *(undefined8 **)(param_1 + 0x98) = puVar3;
  }
  FUN_1400d1290(param_1 + 0x50);
  return;
}



longlong FUN_1400aca10(longlong param_1,undefined8 param_2,char param_3)

{
  undefined4 uVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  longlong lVar4;
  undefined1 local_50 [72];
  
  FUN_1400ad6b0();
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined4 *)(param_1 + 0x48) = 0;
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0x50,uVar1,1);
  *(undefined8 *)(param_1 + 0x88) = 0;
  *(undefined8 *)(param_1 + 0xa0) = 0;
  *(undefined8 *)(param_1 + 0x90) = 0;
  *(undefined8 *)(param_1 + 0x98) = 0;
  *(undefined8 *)(param_1 + 0x30) = param_2;
  *(undefined8 *)(param_1 + 0x28) = 0;
  if (param_3 != '\0') {
    plVar2 = (longlong *)FUN_1400a2b00();
    if (*plVar2 != 0) {
      puVar3 = (undefined8 *)FUN_1400a2b00();
      lVar4 = (*(code *)*puVar3)(0xffffffffffffffff,0,0,0);
      *(longlong *)(param_1 + 0x28) = lVar4;
      if (lVar4 == 0) {
        FUN_1400a2320(local_50,L"Cannot create IOCP object!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
      }
    }
  }
  FUN_1400ad700(param_1);
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x0001400acb9a)
// WARNING: Removing unreachable block (ram,0x0001400acba5)

void FUN_1400acb00(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  FUN_1400a1c30(param_1 + 0x50);
  puVar2 = *(undefined8 **)(param_1 + 0x90);
  while (puVar2 != (undefined8 *)0x0) {
    if (puVar2[2] == param_2) {
      puVar1 = (undefined8 *)*puVar2;
      FUN_1400abc50(param_1 + 0x88,puVar2);
      puVar2 = puVar1;
    }
    else {
      puVar2 = (undefined8 *)*puVar2;
    }
  }
  if (*(longlong *)(param_2 + 0x10) != 0) {
    FUN_1400a83b0(*(longlong *)(param_2 + 0x10),param_2,param_3,param_4,uVar3);
  }
  *(undefined8 *)(param_2 + 0x3c8) = 0;
  FUN_1400d1290(param_1 + 0x50);
  return;
}



void FUN_1400acbf0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  longlong lVar2;
  undefined8 *puVar3;
  longlong *plVar4;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  if (*(HANDLE *)(param_1 + 0x28) != (HANDLE)0x0) {
    CloseHandle(*(HANDLE *)(param_1 + 0x28));
    *(undefined8 *)(param_1 + 0x28) = 0;
  }
  lVar2 = *(longlong *)(param_1 + 0xa0);
  while( true ) {
    if (lVar2 == 0) {
      *(undefined8 *)(param_1 + 0x90) = 0;
      *(undefined8 *)(param_1 + 0x98) = 0;
      iVar1 = *(int *)(param_1 + 0x48);
      while (0 < iVar1) {
        FUN_1400acb00(param_1,*(undefined8 *)(param_1 + 0x38));
        iVar1 = *(int *)(param_1 + 0x48);
      }
      FUN_1401a4f30(param_1 + 0x88);
      FUN_1400a1cd0(param_1 + 0x50);
      FUN_1400abab0(param_1 + 0x38);
      return;
    }
    puVar3 = *(undefined8 **)(param_1 + 0x90);
    if (puVar3 == (undefined8 *)0x0) break;
    *(undefined8 *)(param_1 + 0x90) = *puVar3;
    plVar4 = *(longlong **)(param_1 + 0x88);
    if (plVar4 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar4 + 0x10))(plVar4,puVar3,plVar4,param_4,uVar5);
    }
    *(longlong *)(param_1 + 0xa0) = *(longlong *)(param_1 + 0xa0) + -1;
    lVar2 = *(longlong *)(param_1 + 0xa0);
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



void FUN_1400accf0(longlong param_1,undefined8 param_2)

{
  int *piVar1;
  undefined *puVar2;
  DWORD DVar3;
  undefined *local_res8;
  undefined *local_res18;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res18 = PTR_DAT_1402f8010;
  DVar3 = GetLastError();
  FUN_14003c600(&local_res18,&DAT_140205c08,param_2,DVar3,uVar4);
  FUN_1400a3440();
  puVar2 = local_res18;
  local_res8 = PTR_DAT_1402f8010;
  if (PTR_DAT_1402f8010 == (undefined *)0x0) {
    local_res8 = (undefined *)0x0;
  }
  if (local_res18 != PTR_DAT_1402f8010) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    FUN_1400031d0(&local_res8);
    local_res8 = puVar2;
    if (((puVar2 != PTR_DAT_1402f8010) && (puVar2 != (undefined *)0x0)) &&
       (puVar2 != (undefined *)0x8)) {
      *(int *)(puVar2 + -4) = *(int *)(puVar2 + -4) + 1;
    }
    FUN_1400d1290(uVar4);
  }
  (**(code **)(**(longlong **)(param_1 + 0x30) + 8))
            (*(longlong **)(param_1 + 0x30),param_1,&local_res8);
  if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8010)) &&
     (puVar2 + -8 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2 + -8);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



void FUN_1400ace20(longlong param_1,undefined8 *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  longlong lVar2;
  undefined1 local_50 [72];
  
  if (param_2[0x5d] == 0) {
    FUN_1400a2320(local_50,&DAT_140206b90,param_3,param_4,0xfffffffffffffffe);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
  }
  if (param_2[0x79] != 0) {
    FUN_1400a2320(local_50,&DAT_140206b70,param_3,param_4,0xfffffffffffffffe);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
  }
  if (*(longlong *)(param_1 + 0x28) != 0) {
    puVar1 = (undefined8 *)FUN_1400a2b00();
    lVar2 = (*(code *)*puVar1)(param_2[0x7a],*(undefined8 *)(param_1 + 0x28),param_2,0);
    if (lVar2 == 0) {
      FUN_1400accf0(param_1,L"Proud::CompletionPort::AssociateSocket");
    }
  }
  FUN_1400a1c30(param_1 + 0x50);
  puVar1 = (undefined8 *)(param_1 + 0x38);
  if (param_2[2] != 0) {
    FUN_1400a83b0(puVar1,param_2);
  }
  if (*(longlong *)(param_1 + 0x40) == 0) {
    *puVar1 = param_2;
  }
  else {
    *(undefined8 **)(*(longlong *)(param_1 + 0x40) + 8) = param_2;
    *param_2 = *(undefined8 *)(param_1 + 0x40);
  }
  *(undefined8 **)(param_1 + 0x40) = param_2;
  param_2[2] = puVar1;
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
  param_2[0x79] = param_1;
  FUN_1400d1290(param_1 + 0x50);
  return;
}



undefined8 * FUN_1400acf50(undefined8 *param_1)

{
  undefined4 uVar1;
  
  *param_1 = Proud::CRandom::vftable;
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0x13c,uVar1,1);
  *(undefined4 *)(param_1 + 0x13b) = 0xfffffffe;
  return param_1;
}



void FUN_1400acf90(undefined8 *param_1)

{
  *param_1 = Proud::CRandom::vftable;
  FUN_1400a1cd0();
  return;
}



undefined8 * FUN_1400acfb0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CRandom::vftable;
  FUN_1400a1cd0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1400ad000(longlong param_1,uint param_2)

{
  uint *puVar1;
  int iVar2;
  
  FUN_1400a1c30(param_1 + 0x9e0);
  param_2 = param_2 | 1;
  *(undefined4 *)(param_1 + 0x9d8) = 0;
  *(uint *)(param_1 + 8) = param_2;
  iVar2 = 0x26f;
  puVar1 = (uint *)(param_1 + 0xc);
  do {
    param_2 = param_2 * 0x10dcd;
    iVar2 = iVar2 + -1;
    *puVar1 = param_2;
    puVar1 = puVar1 + 1;
  } while (iVar2 != 0);
  FUN_1400d1290(param_1 + 0x9e0);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400ad070(longlong param_1)

{
  longlong lVar1;
  DWORD DVar2;
  BOOL BVar3;
  DWORD DVar4;
  ushort uVar5;
  undefined1 auStackY_78 [32];
  DWORD local_48 [6];
  longlong local_30;
  undefined1 local_28;
  _SYSTEMTIME local_20;
  ulonglong local_10;
  
  local_48[4] = 0xfffffffe;
  local_48[5] = 0xffffffff;
  local_10 = DAT_1402f85a0 ^ (ulonglong)auStackY_78;
  lVar1 = param_1 + 0x9e0;
  local_30 = lVar1;
  FUN_1400a1c30(lVar1);
  local_28 = 1;
  local_48[1] = 0;
  local_48[2] = 0;
  local_48[0] = 0;
  local_48[3] = 0;
  DVar2 = GetTickCount();
  BVar3 = GetDiskFreeSpaceW((LPCWSTR)0x0,local_48 + 1,local_48 + 2,local_48,local_48 + 3);
  if (BVar3 == 0) {
    local_20.wYear = 0;
    local_20.wMonth = 0;
    local_20.wDayOfWeek = 0;
    local_20.wDay = 0;
    local_20.wHour = 0;
    local_20.wMinute = 0;
    local_20.wSecond = 0;
    local_20.wMilliseconds = 0;
    GetSystemTime(&local_20);
    uVar5 = local_20.wMilliseconds << 8 |
            (ushort)(byte)(local_20.wMilliseconds._1_1_ + (char)local_20.wSecond);
  }
  else {
    uVar5 = (ushort)local_48[0];
    DVar4 = GetTickCount();
    uVar5 = uVar5 ^ (ushort)DVar4;
  }
  FUN_1400ad000(param_1,DVar2 << 0x10 | (uint)uVar5);
  FUN_1400d1290(lVar1);
  return;
}



uint FUN_1400ad180(longlong param_1)

{
  uint uVar1;
  uint uVar2;
  uint *puVar3;
  uint *puVar4;
  uint *puVar5;
  uint *puVar6;
  uint uVar7;
  int iVar8;
  uint *puVar9;
  
  if (*(int *)(param_1 + 0x9d8) < -1) {
    FUN_1400ad070();
  }
  *(undefined4 *)(param_1 + 0x9d8) = 0x26f;
  *(longlong *)(param_1 + 0x9d0) = param_1 + 0xc;
  iVar8 = 0xe3;
  puVar3 = (uint *)(param_1 + 0x10);
  puVar5 = (uint *)(param_1 + 8);
  uVar1 = *(uint *)(param_1 + 0xc);
  uVar2 = *(uint *)(param_1 + 8);
  do {
    uVar7 = uVar1;
    puVar4 = puVar3 + 1;
    puVar6 = puVar5 + 1;
    iVar8 = iVar8 + -1;
    *puVar5 = ((uVar7 ^ uVar2) & 0x7ffffffe ^ uVar2) >> 1 ^ -(uint)((uVar7 & 1) != 0) & 0x9908b0df ^
              *(uint *)((longlong)puVar3 + ((param_1 + 0x63c) - (param_1 + 0x10)));
    uVar1 = *puVar3;
    puVar3 = puVar4;
    puVar5 = puVar6;
    uVar2 = uVar7;
  } while (iVar8 != 0);
  iVar8 = 0x18c;
  puVar3 = (uint *)(param_1 + 8);
  do {
    uVar2 = uVar1;
    puVar5 = puVar6 + 1;
    puVar9 = puVar3 + 1;
    iVar8 = iVar8 + -1;
    *puVar6 = ((uVar2 ^ uVar7) & 0x7ffffffe ^ uVar7) >> 1 ^ -(uint)((uVar2 & 1) != 0) & 0x9908b0df ^
              *puVar3;
    uVar1 = *puVar4;
    puVar4 = puVar4 + 1;
    puVar6 = puVar5;
    puVar3 = puVar9;
    uVar7 = uVar2;
  } while (iVar8 != 0);
  uVar1 = *(uint *)(param_1 + 8);
  uVar7 = uVar1 ^ uVar1 >> 0xb;
  *puVar5 = ((uVar1 ^ uVar2) & 0x7ffffffe ^ uVar2) >> 1 ^ -(uint)((uVar1 & 1) != 0) & 0x9908b0df ^
            *puVar9;
  uVar7 = uVar7 ^ (uVar7 & 0xff3a58ad) << 7;
  uVar7 = uVar7 ^ (uVar7 & 0xffffdf8c) << 0xf;
  return uVar7 >> 0x12 ^ uVar7;
}



uint FUN_1400ad2f0(longlong param_1)

{
  int *piVar1;
  uint uVar2;
  
  FUN_1400a1c30(param_1 + 0x9e0);
  piVar1 = (int *)(param_1 + 0x9d8);
  *piVar1 = *piVar1 + -1;
  if (*piVar1 < 0) {
    uVar2 = FUN_1400ad180(param_1);
  }
  else {
    uVar2 = **(uint **)(param_1 + 0x9d0);
    *(uint **)(param_1 + 0x9d0) = *(uint **)(param_1 + 0x9d0) + 1;
    uVar2 = uVar2 ^ uVar2 >> 0xb;
    uVar2 = uVar2 ^ (uVar2 & 0xff3a58ad) << 7;
    uVar2 = uVar2 ^ (uVar2 & 0xffffdf8c) << 0xf;
    uVar2 = uVar2 >> 0x12 ^ uVar2;
  }
  FUN_1400d1290(param_1 + 0x9e0);
  return uVar2;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * FUN_1400ad390(void)

{
  char cVar1;
  undefined4 uVar2;
  char cVar3;
  undefined8 in_R9;
  undefined8 uVar4;
  undefined *puVar5;
  char cVar6;
  
  uVar4 = 0xfffffffffffffffe;
  puVar5 = &DAT_1403157a0;
  cVar6 = '\0';
  cVar1 = FUN_1400a1cc0(&DAT_1403157a0);
  cVar3 = '\0';
  if ((cVar1 != '\0') && (cVar3 = cVar6, DAT_1402f8500 != '\0')) {
    cVar6 = '\x01';
    FUN_1400a1c30(&DAT_1403157a0);
    cVar3 = '\x01';
  }
  if ((DAT_140315798 & 1) == 0) {
    DAT_140315798 = DAT_140315798 | 1;
    _DAT_140314d80 = Proud::CRandom::vftable;
    uVar2 = FUN_1401692e0();
    FUN_1400a1b50(&DAT_140315760,uVar2,1,in_R9,uVar4,puVar5,cVar6);
    _DAT_140315758 = 0xfffffffe;
    atexit((_func_5014 *)&LAB_140202960);
  }
  DAT_1402f8500 = 0;
  if (cVar3 != '\0') {
    FUN_1400d1290(&DAT_1403157a0);
  }
  return &DAT_140314d80;
}



void FUN_1400ad460(void)

{
  undefined8 uVar1;
  
  uVar1 = FUN_1400ad390();
  FUN_1400ad2f0(uVar1);
  return;
}



bool FUN_1400ad480(undefined8 *param_1)

{
  DWORD DVar1;
  
  DVar1 = WaitForSingleObject((HANDLE)*param_1,0xffffffff);
  return DVar1 == 0;
}



DWORD FUN_1400ad4a0(longlong param_1,uint param_2,DWORD param_3,BOOL param_4)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  undefined1 local_258 [72];
  HANDLE apvStack_210 [65];
  
  if ((int)param_2 < 0x41) {
    lVar4 = 0;
    if (0 < (int)param_2) {
      do {
        lVar1 = lVar4 * 8;
        lVar4 = lVar4 + 1;
        apvStack_210[lVar4] = (HANDLE)**(undefined8 **)(param_1 + lVar1);
      } while (lVar4 < (int)param_2);
    }
    DVar2 = WaitForMultipleObjects(param_2,apvStack_210 + 1,param_4,param_3);
    DVar3 = 0xffffffff;
    if (DVar2 < param_2) {
      DVar3 = DVar2;
    }
    return DVar3;
  }
  FUN_1400a2320(local_258,&DAT_140206c70);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_258,(ThrowInfo *)&DAT_1402f4860);
}



undefined8 * FUN_1400ad530(undefined8 *param_1)

{
  HANDLE pvVar1;
  
  pvVar1 = CreateEventW((LPSECURITY_ATTRIBUTES)0x0,0,0,(LPCWSTR)0x0);
  *param_1 = pvVar1;
  return param_1;
}



undefined8 * FUN_1400ad560(undefined8 *param_1,byte param_2,byte param_3)

{
  HANDLE pvVar1;
  
  pvVar1 = CreateEventW((LPSECURITY_ATTRIBUTES)0x0,(uint)param_2,(uint)param_3,(LPCWSTR)0x0);
  *param_1 = pvVar1;
  return param_1;
}



void FUN_1400ad590(void)

{
  FUN_1400ad2f0();
  return;
}



int FUN_1400ad5c0(undefined8 param_1,int param_2)

{
  uint uVar1;
  int iVar2;
  double dVar3;
  
  uVar1 = FUN_1400ad2f0();
  dVar3 = (double)uVar1 / 4294967295.0;
  if (dVar3 <= 0.0) {
    dVar3 = 0.0;
  }
  iVar2 = (int)((double)(param_2 + 1) * dVar3);
  if (iVar2 < param_2) {
    param_2 = iVar2;
  }
  return param_2;
}



undefined4 * FUN_1400ad610(undefined8 param_1,undefined4 *param_2)

{
  uint uVar1;
  longlong lVar2;
  double dVar3;
  
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  param_2[3] = 0;
  lVar2 = 0;
  do {
    uVar1 = FUN_1400ad2f0(param_1);
    dVar3 = (double)uVar1 / 4294967295.0;
    if (dVar3 <= 0.0) {
      dVar3 = 0.0;
    }
    *(double *)(param_2 + lVar2 * 2) = dVar3;
    lVar2 = lVar2 + 1;
  } while (lVar2 < 2);
  return param_2;
}



undefined2 * FUN_1400ad6b0(undefined2 *param_1)

{
  BOOL BVar1;
  LARGE_INTEGER local_res8 [4];
  
  *param_1 = 0x100;
  *(undefined8 *)(param_1 + 4) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0xc) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  BVar1 = QueryPerformanceFrequency(local_res8);
  *(bool *)param_1 = BVar1 != 0;
  *(LARGE_INTEGER *)(param_1 + 4) = local_res8[0];
  return param_1;
}



void FUN_1400ad700(char *param_1)

{
  LARGE_INTEGER local_res8 [4];
  
  if (*param_1 != '\0') {
    QueryPerformanceCounter(local_res8);
    if (param_1[1] != '\0') {
      *(longlong *)(param_1 + 0x20) =
           *(longlong *)(param_1 + 0x20) + (local_res8[0].QuadPart - *(longlong *)(param_1 + 0x10));
    }
    param_1[0x10] = '\0';
    param_1[0x11] = '\0';
    param_1[0x12] = '\0';
    param_1[0x13] = '\0';
    param_1[0x14] = '\0';
    param_1[0x15] = '\0';
    param_1[0x16] = '\0';
    param_1[0x17] = '\0';
    ((LARGE_INTEGER *)(param_1 + 0x18))->QuadPart = (LONGLONG)local_res8[0];
    param_1[1] = '\0';
  }
  return;
}



void FUN_1400ad750(char *param_1)

{
  LARGE_INTEGER LVar1;
  LARGE_INTEGER local_res8 [4];
  
  if ((*param_1 != '\0') && (param_1[1] == '\0')) {
    LVar1.QuadPart = ((LARGE_INTEGER *)(param_1 + 0x10))->QuadPart;
    if (((LARGE_INTEGER *)(param_1 + 0x10))->QuadPart == 0) {
      QueryPerformanceCounter(local_res8);
      LVar1 = local_res8[0];
    }
    ((LARGE_INTEGER *)(param_1 + 0x10))->QuadPart = (LONGLONG)LVar1;
    ((LARGE_INTEGER *)(param_1 + 0x18))->QuadPart = (LONGLONG)LVar1;
    param_1[1] = '\x01';
  }
  return;
}



double FUN_1400ad790(char *param_1)

{
  LARGE_INTEGER LVar1;
  LARGE_INTEGER local_res8 [4];
  
  if (*param_1 == '\0') {
    return -1.0;
  }
  LVar1.QuadPart = ((LARGE_INTEGER *)(param_1 + 0x10))->QuadPart;
  if (((LARGE_INTEGER *)(param_1 + 0x10))->QuadPart == 0) {
    QueryPerformanceCounter(local_res8);
    LVar1 = local_res8[0];
  }
  return (double)LVar1.QuadPart / (double)*(longlong *)(param_1 + 8);
}



double FUN_1400ad7f0(char *param_1)

{
  longlong lVar1;
  LARGE_INTEGER LVar2;
  LARGE_INTEGER local_res8 [4];
  
  if (*param_1 == '\0') {
    return -1.0;
  }
  LVar2.QuadPart = ((LARGE_INTEGER *)(param_1 + 0x10))->QuadPart;
  if (((LARGE_INTEGER *)(param_1 + 0x10))->QuadPart == 0) {
    QueryPerformanceCounter(local_res8);
    LVar2 = local_res8[0];
  }
  lVar1 = *(longlong *)(param_1 + 0x18);
  ((LARGE_INTEGER *)(param_1 + 0x18))->QuadPart = (LONGLONG)LVar2;
  return (double)(LVar2.QuadPart - lVar1) / (double)*(longlong *)(param_1 + 8);
}



undefined1 FUN_1400ad850(longlong param_1)

{
  return *(undefined1 *)(param_1 + 1);
}



void Ordinal_151(void)

{
                    // WARNING: Could not recover jumptable at 0x0001400ad856. Too many branches
                    // WARNING: Treating indirect jump as call
  Ordinal_151();
  return;
}



void __stdcall
GetAcceptExSockaddrs
          (PVOID lpOutputBuffer,DWORD dwReceiveDataLength,DWORD dwLocalAddressLength,
          DWORD dwRemoteAddressLength,sockaddr **LocalSockaddr,LPINT LocalSockaddrLength,
          sockaddr **RemoteSockaddr,LPINT RemoteSockaddrLength)

{
                    // WARNING: Could not recover jumptable at 0x0001400ad85c. Too many branches
                    // WARNING: Treating indirect jump as call
  GetAcceptExSockaddrs
            (lpOutputBuffer,dwReceiveDataLength,dwLocalAddressLength,dwRemoteAddressLength,
             LocalSockaddr,LocalSockaddrLength,RemoteSockaddr,RemoteSockaddrLength);
  return;
}



// Library Function - Single Match
//  public: __cdecl ATL::CAtlBaseModule::~CAtlBaseModule(void) __ptr64
// 
// Library: Visual Studio

void __thiscall ATL::CAtlBaseModule::~CAtlBaseModule(CAtlBaseModule *this)

{
  DeleteCriticalSection((LPCRITICAL_SECTION)(this + 0x28));
  if (*(void **)(this + 0x50) != (void *)0x0) {
    free(*(void **)(this + 0x50));
    *(undefined8 *)(this + 0x50) = 0;
  }
  *(undefined4 *)(this + 0x58) = 0;
  *(undefined4 *)(this + 0x5c) = 0;
  return;
}



// Library Function - Single Match
//  public: struct HINSTANCE__ * __ptr64 __cdecl ATL::CAtlBaseModule::GetHInstanceAt(int) __ptr64
// 
// Libraries: Visual Studio 2008 Release, Visual Studio 2010 Release

HINSTANCE__ * __thiscall ATL::CAtlBaseModule::GetHInstanceAt(CAtlBaseModule *this,int param_1)

{
  code *pcVar1;
  HINSTANCE__ *pHVar2;
  
  EnterCriticalSection((LPCRITICAL_SECTION)(this + 0x28));
  if ((*(int *)(this + 0x58) < param_1) || (param_1 < 0)) {
    LeaveCriticalSection((LPCRITICAL_SECTION)(this + 0x28));
    pHVar2 = (HINSTANCE__ *)0x0;
  }
  else {
    if (param_1 == *(int *)(this + 0x58)) {
      pHVar2 = *(HINSTANCE__ **)(this + 0x10);
    }
    else {
      if (*(int *)(this + 0x58) <= param_1) {
        RaiseException(0xc000008c,1,0,(ULONG_PTR *)0x0);
        pcVar1 = (code *)swi(3);
        pHVar2 = (HINSTANCE__ *)(*pcVar1)();
        return pHVar2;
      }
      pHVar2 = *(HINSTANCE__ **)(*(longlong *)(this + 0x50) + (longlong)param_1 * 8);
    }
    LeaveCriticalSection((LPCRITICAL_SECTION)(this + 0x28));
  }
  return pHVar2;
}



// Library Function - Single Match
//  public: __cdecl ATL::CAtlBaseModule::CAtlBaseModule(void) __ptr64
// 
// Library: Visual Studio 2010 Release

CAtlBaseModule * __thiscall ATL::CAtlBaseModule::CAtlBaseModule(CAtlBaseModule *this)

{
  DWORD DVar1;
  BOOL BVar2;
  DWORD DVar3;
  
  memset(this + 0x28,0,0x28);
  *(undefined8 *)(this + 0x50) = 0;
  *(undefined4 *)(this + 0x58) = 0;
  *(undefined4 *)(this + 0x5c) = 0;
  *(IMAGE_DOS_HEADER **)(this + 0x10) = &IMAGE_DOS_HEADER_140000000;
  *(IMAGE_DOS_HEADER **)(this + 8) = &IMAGE_DOS_HEADER_140000000;
  *(undefined4 *)this = 0x60;
  *(undefined4 *)(this + 0x18) = 0xa00;
  *(undefined **)(this + 0x20) = &DAT_140206cf0;
  BVar2 = InitializeCriticalSectionAndSpinCount((LPCRITICAL_SECTION)(this + 0x28),0);
  if (BVar2 == 0) {
    DVar3 = GetLastError();
    DVar1 = DVar3 & 0xffff | 0x80070000;
    if ((int)DVar3 < 1) {
      DVar1 = DVar3;
    }
    if ((int)DVar1 < 0) {
      DAT_140320110 = 1;
    }
  }
  return this;
}



void FUN_1400ad9c0(longlong param_1,LPVOID param_2)

{
  if (param_2 != (LPVOID)0x0) {
    HeapFree(*(HANDLE *)(param_1 + 8),0,param_2);
  }
  return;
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl ATL::CWin32Heap::Reallocate(void * __ptr64,unsigned
// __int64) __ptr64
// 
// Libraries: Visual Studio 2010 Release, Visual Studio 2012 Release

void * __thiscall ATL::CWin32Heap::Reallocate(CWin32Heap *this,void *param_1,__uint64 param_2)

{
  void *pvVar1;
  
  if (param_1 == (void *)0x0) {
                    // WARNING: Could not recover jumptable at 0x0001400ad9f3. Too many branches
                    // WARNING: Treating indirect jump as call
    pvVar1 = (void *)(*(code *)**(undefined8 **)this)(this,param_2);
    return pvVar1;
  }
  if (param_2 == 0) {
    (**(code **)(*(longlong *)this + 8))();
    return (void *)0x0;
  }
                    // WARNING: Could not recover jumptable at 0x0001400ada18. Too many branches
                    // WARNING: Treating indirect jump as call
  pvVar1 = (void *)HeapReAlloc(*(undefined8 *)(this + 8),0,param_1,param_2);
  return pvVar1;
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl ATL::CWin32Heap::`scalar deleting destructor'(unsigned
// int) __ptr64
// 
// Libraries: Visual Studio 2008 Release, Visual Studio 2010 Release, Visual Studio 2012 Release

void * __thiscall ATL::CWin32Heap::_scalar_deleting_destructor_(CWin32Heap *this,uint param_1)

{
  *(undefined ***)this = &PTR_LAB_140206d00;
  if ((this[0x10] != (CWin32Heap)0x0) && (*(HANDLE *)(this + 8) != (HANDLE)0x0)) {
    HeapDestroy(*(HANDLE *)(this + 8));
  }
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



longlong FUN_1400ada88(longlong param_1)

{
  LOCK();
  *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) + 1;
  UNLOCK();
  return param_1 + 0x10;
}



// public: __cdecl std::_Mutex::_Mutex(enum std::_Uninitialized) __ptr64

_Mutex * __thiscall std::_Mutex::_Mutex(_Mutex *this,_Uninitialized param_1)

{
                    // 0xada94  1  ??0_Mutex@std@@QEAA@W4_Uninitialized@1@@Z
                    // 0xada94  2  ??4_Init_locks@std@@QEAAAEAV01@AEBV01@@Z
  return this;
}



undefined8 * FUN_1400ada98(undefined8 *param_1,byte param_2)

{
  *param_1 = &PTR_Allocate_140206d28;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// Library Function - Single Match
//  public: virtual struct ATL::CStringData * __ptr64 __cdecl ATL::CAtlStringMgr::Allocate(int,int)
// __ptr64
// 
// Libraries: Visual Studio 2008 Release, Visual Studio 2010 Release

CStringData * __thiscall ATL::CAtlStringMgr::Allocate(CAtlStringMgr *this,int param_1,int param_2)

{
  undefined1 auVar1 [16];
  CStringData *pCVar2;
  uint uVar3;
  ulonglong uVar4;
  
  uVar3 = param_1 + 8U & 0xfffffff8;
  if (uVar3 == 0) {
    uVar4 = 0;
  }
  else {
    auVar1._8_8_ = 0;
    auVar1._0_8_ = (longlong)(int)uVar3;
    if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) <
        (ulonglong)(longlong)param_2) {
      return (CStringData *)0x0;
    }
    uVar4 = (longlong)(int)uVar3 * (longlong)param_2;
    if (0xffffffffffffffe7 < uVar4) {
      return (CStringData *)0x0;
    }
  }
  pCVar2 = (CStringData *)
           (**(code **)**(undefined8 **)(this + 8))(*(undefined8 **)(this + 8),uVar4 + 0x18);
  if (pCVar2 == (CStringData *)0x0) {
    return (CStringData *)0x0;
  }
  *(undefined4 *)(pCVar2 + 8) = 0;
  *(CAtlStringMgr **)pCVar2 = this;
  *(undefined4 *)(pCVar2 + 0x10) = 1;
  *(uint *)(pCVar2 + 0xc) = uVar3 - 1;
  return pCVar2;
}



// Library Function - Single Match
//  public: virtual struct ATL::CStringData * __ptr64 __cdecl ATL::CAtlStringMgr::Reallocate(struct
// ATL::CStringData * __ptr64,int,int) __ptr64
// 
// Libraries: Visual Studio 2008 Release, Visual Studio 2010 Release

CStringData * __thiscall
ATL::CAtlStringMgr::Reallocate(CAtlStringMgr *this,CStringData *param_1,int param_2,int param_3)

{
  CStringData *pCVar1;
  uint uVar2;
  uint uVar3;
  ulonglong uVar4;
  
  uVar2 = param_2 + 8U & 0xfffffff8;
  uVar4 = (ulonglong)uVar2 * (ulonglong)(uint)param_3;
  if (((uVar4 < 0x100000000) && (uVar3 = (uint)uVar4, uVar3 < 0xffffffe8)) &&
     (pCVar1 = (CStringData *)
               (**(code **)(**(longlong **)(this + 8) + 0x10))
                         (*(longlong **)(this + 8),param_1,uVar3 + 0x18),
     pCVar1 != (CStringData *)0x0)) {
    *(uint *)(pCVar1 + 0xc) = uVar2 - 1;
    return pCVar1;
  }
  return (CStringData *)0x0;
}



void * __cdecl operator_new(__uint64 param_1)

{
  void *pvVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001400ade8c. Too many branches
                    // WARNING: Treating indirect jump as call
  pvVar1 = operator_new(param_1);
  return pvVar1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1400adba0(undefined8 param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001400adba2. Too many branches
                    // WARNING: Treating indirect jump as call
  (*_DAT_1402f8538)(param_1,0);
  return;
}



LPSTR FUN_1400adbb0(LPCWSTR param_1)

{
  WCHAR WVar1;
  int iVar2;
  DWORD DVar3;
  LPSTR lpMultiByteStr;
  longlong lVar4;
  LPCWSTR pWVar5;
  
  lpMultiByteStr = (LPSTR)0x0;
  if (param_1 != (LPCWSTR)0x0) {
    lVar4 = -1;
    pWVar5 = param_1;
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      WVar1 = *pWVar5;
      pWVar5 = pWVar5 + 1;
    } while (WVar1 != L'\0');
    iVar2 = WideCharToMultiByte(0,0,param_1,~(uint)lVar4,(LPSTR)0x0,0,(LPCSTR)0x0,(LPBOOL)0x0);
    if (iVar2 == 0) {
      DVar3 = GetLastError();
      if (0 < (int)DVar3) {
        DVar3 = DVar3 & 0xffff | 0x80070000;
      }
                    // WARNING: Subroutine does not return
      FUN_1400adba0(DVar3);
    }
    lpMultiByteStr = operator_new((longlong)iVar2);
    if (lpMultiByteStr == (LPSTR)0x0) {
                    // WARNING: Subroutine does not return
      FUN_1400adba0(0x8007000e);
    }
    iVar2 = WideCharToMultiByte(0,0,param_1,~(uint)lVar4,lpMultiByteStr,iVar2,(LPCSTR)0x0,
                                (LPBOOL)0x0);
    if (iVar2 == 0) {
      operator_delete(lpMultiByteStr);
      DVar3 = GetLastError();
      if (0 < (int)DVar3) {
        DVar3 = DVar3 & 0xffff | 0x80070000;
      }
                    // WARNING: Subroutine does not return
      FUN_1400adba0(DVar3);
    }
  }
  return lpMultiByteStr;
}



// Library Function - Single Match
//  public: virtual __cdecl _com_error::~_com_error(void) __ptr64
// 
// Libraries: Visual Studio 2005 Release, Visual Studio 2010 Release, Visual Studio 2012 Release

void __thiscall _com_error::~_com_error(_com_error *this)

{
  *(undefined ***)this = &PTR_FUN_140206d80;
  if (*(longlong **)(this + 0x10) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(this + 0x10) + 0x10))();
  }
  if (*(HLOCAL *)(this + 0x18) != (HLOCAL)0x0) {
    LocalFree(*(HLOCAL *)(this + 0x18));
  }
  return;
}



void FUN_1400add00(undefined4 param_1,undefined8 param_2)

{
  undefined **local_28;
  undefined4 local_20;
  undefined8 local_18;
  undefined8 local_10;
  
  local_10 = 0;
  local_28 = &PTR_FUN_140206d80;
  local_20 = param_1;
  local_18 = param_2;
                    // WARNING: Subroutine does not return
  _CxxThrowException(&local_28,(ThrowInfo *)&DAT_1402f46b8);
}



// Library Function - Single Match
//  public: __cdecl _com_error::_com_error(class _com_error const & __ptr64) __ptr64
// 
// Libraries: Visual Studio 2008 Release, Visual Studio 2010 Release, Visual Studio 2012 Release

_com_error * __thiscall _com_error::_com_error(_com_error *this,_com_error *param_1)

{
  longlong *plVar1;
  
  *(undefined ***)this = &PTR_FUN_140206d80;
  *(undefined4 *)(this + 8) = *(undefined4 *)(param_1 + 8);
  plVar1 = *(longlong **)(param_1 + 0x10);
  *(undefined8 *)(this + 0x18) = 0;
  *(longlong **)(this + 0x10) = plVar1;
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 8))(plVar1);
  }
  return this;
}



undefined8 * FUN_1400add80(undefined8 *param_1,uint param_2)

{
  *param_1 = &PTR_FUN_140206d80;
  if ((longlong *)param_1[2] != (longlong *)0x0) {
    (**(code **)(*(longlong *)param_1[2] + 0x10))();
  }
  if ((HLOCAL)param_1[3] != (HLOCAL)0x0) {
    LocalFree((HLOCAL)param_1[3]);
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void __cdecl operator_delete(void *param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001400addd4. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(param_1);
  return;
}



// WARNING: This is an inlined function
// Library Function - Single Match
//  __security_check_cookie
// 
// Libraries: Visual Studio 2005 Debug, Visual Studio 2005 Release, Visual Studio 2010 Debug, Visual
// Studio 2010 Release

void __cdecl __security_check_cookie(uintptr_t _StackCookie)

{
  if ((_StackCookie == DAT_1402f85a0) && ((short)(_StackCookie >> 0x30) == 0)) {
    return;
  }
                    // WARNING: Subroutine does not return
  __report_gsfailure(_StackCookie);
}



// Library Function - Single Match
//  public: virtual void * __ptr64 __cdecl type_info::`vector deleting destructor'(unsigned int)
// __ptr64
// 
// Library: Visual Studio 2010 Release

void * __thiscall type_info::_vector_deleting_destructor_(type_info *this,uint param_1)

{
  if ((param_1 & 2) == 0) {
    type_info::_type_info_dtor_internal_method(this);
    if ((param_1 & 1) != 0) {
      operator_delete(this);
    }
  }
  else {
    _eh_vector_destructor_iterator_
              (this,0x18,*(int *)(this + -8),type_info::_type_info_dtor_internal_method);
    if ((param_1 & 1) != 0) {
      operator_delete(this + -8);
    }
    this = this + -8;
  }
  return this;
}



char * __thiscall std::exception::what(exception *this)

{
  char *pcVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001400ade86. Too many branches
                    // WARNING: Treating indirect jump as call
  pcVar1 = what(this);
  return pcVar1;
}



void * __cdecl operator_new(__uint64 param_1)

{
  void *pvVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001400ade8c. Too many branches
                    // WARNING: Treating indirect jump as call
  pvVar1 = operator_new(param_1);
  return pvVar1;
}



// Library Function - Single Match
//  _onexit
// 
// Libraries: Visual Studio 2008 Release, Visual Studio 2010 Release, Visual Studio 2012 Release

_onexit_t __cdecl _onexit(_onexit_t _Func)

{
  _onexit_t p_Var1;
  PVOID pvVar2;
  PVOID local_res10;
  PVOID local_res18 [2];
  
  local_res10 = DecodePointer(DAT_140321228);
  if (local_res10 == (PVOID)0xffffffffffffffff) {
    p_Var1 = _onexit(_Func);
  }
  else {
    _lock(8);
    local_res10 = DecodePointer(DAT_140321228);
    local_res18[0] = DecodePointer(DAT_140321220);
    pvVar2 = EncodePointer(_Func);
    p_Var1 = (_onexit_t)__dllonexit(pvVar2,&local_res10,local_res18);
    DAT_140321228 = EncodePointer(local_res10);
    DAT_140321220 = EncodePointer(local_res18[0]);
    _unlock(8);
  }
  return p_Var1;
}



// Library Function - Single Match
//  atexit
// 
// Libraries: Visual Studio 2008 Release, Visual Studio 2010 Release, Visual Studio 2012 Release

int __cdecl atexit(_func_5014 *param_1)

{
  _onexit_t p_Var1;
  
  p_Var1 = _onexit((_onexit_t)param_1);
  return (p_Var1 != (_onexit_t)0x0) - 1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1400adf5c(void)

{
  atexit(FUN_1400ae67c);
  _DAT_140315874 = DAT_140315e04;
  _DAT_140315870 =
       __wgetmainargs(&DAT_140315858,&DAT_140315868,&DAT_140315860,DAT_140315e00,&DAT_140315874);
  if (_DAT_140315870 < 0) {
    _amsg_exit(8);
  }
  return;
}



// Library Function - Single Match
//  __tmainCRTStartup
// 
// Library: Visual Studio 2010 Release

ulonglong __tmainCRTStartup(void)

{
  void *pvVar1;
  bool bVar2;
  void *pvVar3;
  int iVar4;
  BOOL BVar5;
  void *pvVar6;
  ulonglong uVar7;
  bool bVar8;
  
  pvVar1 = StackBase;
  bVar2 = false;
  while( true ) {
    pvVar6 = (void *)0x0;
    LOCK();
    bVar8 = DAT_140321210 == (void *)0x0;
    pvVar3 = pvVar1;
    if (!bVar8) {
      pvVar6 = DAT_140321210;
      pvVar3 = DAT_140321210;
    }
    DAT_140321210 = pvVar3;
    UNLOCK();
    if (bVar8) goto LAB_1400ae00a;
    if (pvVar6 == pvVar1) break;
    Sleep(1000);
  }
  bVar2 = true;
LAB_1400ae00a:
  if (DAT_140321208 == 1) {
    _amsg_exit(0x1f);
  }
  else if (DAT_140321208 == 0) {
    DAT_140321208 = 1;
    iVar4 = _initterm_e(&DAT_140203ff0,&DAT_140204008);
    if (iVar4 != 0) {
      return 0xff;
    }
  }
  else {
    DAT_14031587c = 1;
  }
  if (DAT_140321208 == 1) {
    _initterm(&DAT_140203c00,&DAT_140203fe8);
    DAT_140321208 = 2;
  }
  if (!bVar2) {
    LOCK();
    DAT_140321210 = (void *)0x0;
    UNLOCK();
  }
  if ((DAT_140321218 != (code *)0x0) &&
     (BVar5 = _IsNonwritableInCurrentImage((PBYTE)&DAT_140321218), BVar5 != 0)) {
    (*DAT_140321218)(0,2);
  }
  *(undefined8 *)__winitenv_exref = DAT_140315860;
  uVar7 = FUN_1400012e0(DAT_140315858,DAT_140315868,DAT_140315860);
  DAT_140315878 = (uint)uVar7;
  if (DAT_14031585c != 0) {
    if (DAT_14031587c == 0) {
      _cexit();
      uVar7 = (ulonglong)DAT_140315878;
    }
    return uVar7;
  }
                    // WARNING: Subroutine does not return
  exit(DAT_140315878);
}



// WARNING: Removing unreachable block (ram,0x0001400ae156)

undefined8 FUN_1400ae144(void)

{
  DAT_14031585c = 0;
  __set_app_type(1);
  DAT_140321220 = EncodePointer((PVOID)0xffffffffffffffff);
  DAT_140321228 = DAT_140321220;
  *(undefined4 *)_fmode_exref = DAT_140315e0c;
  *(undefined4 *)_commode_exref = DAT_140315e08;
  FUN_1400ae644();
  FUN_1400ae790();
  if (DAT_1402f85cc == 0) {
    __setusermatherr(FUN_1400ae790);
  }
  if (DAT_1402f85c8 == -1) {
    _configthreadlocale(-1);
  }
  return 0;
}



void entry(void)

{
  __security_init_cookie();
  __tmainCRTStartup();
  return;
}



void __stdcall _CxxThrowException(void *pExceptionObject,ThrowInfo *pThrowInfo)

{
                    // WARNING: Could not recover jumptable at 0x0001400ae226. Too many branches
                    // WARNING: Subroutine does not return
                    // WARNING: Treating indirect jump as call
  _CxxThrowException(pExceptionObject,pThrowInfo);
  return;
}



void __CxxFrameHandler3(void)

{
                    // WARNING: Could not recover jumptable at 0x0001400ae22c. Too many branches
                    // WARNING: Subroutine does not return
                    // WARNING: Treating indirect jump as call
  __CxxFrameHandler3();
  return;
}



void __cdecl operator_delete__(void *param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001400ae232. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete__(param_1);
  return;
}



void __cdecl free(void *_Memory)

{
                    // WARNING: Could not recover jumptable at 0x0001400ae238. Too many branches
                    // WARNING: Treating indirect jump as call
  free(_Memory);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// Library Function - Single Match
//  __GSHandlerCheckCommon
// 
// Libraries: Visual Studio 2008 Release, Visual Studio 2010 Release, Visual Studio 2012 Release,
// Visual Studio 2019 Release

longlong __GSHandlerCheckCommon(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x10);
  lVar2 = (ulonglong)*(uint *)(lVar1 + 8) + *(longlong *)(param_2 + 8);
  if ((*(byte *)(lVar2 + 3) & 0xf) != 0) {
    lVar1 = (longlong)(int)(*(byte *)(lVar2 + 3) & 0xfffffff0);
  }
  return lVar1;
}



// Library Function - Single Match
//  __GSHandlerCheck
// 
// Libraries: Visual Studio 2008 Release, Visual Studio 2010 Release, Visual Studio 2012 Release,
// Visual Studio 2019 Release

undefined8
__GSHandlerCheck(undefined8 param_1,undefined8 param_2,undefined8 param_3,longlong param_4)

{
  __GSHandlerCheckCommon(param_2,param_4,*(undefined8 *)(param_4 + 0x38));
  return 1;
}



undefined8 FUN_1400ae2c4(longlong param_1,undefined8 param_2,undefined8 param_3,longlong param_4)

{
  uint uVar1;
  longlong lVar2;
  uint uVar3;
  
  lVar2 = *(longlong *)(param_4 + 0x38);
  __GSHandlerCheckCommon(param_2,param_4,lVar2 + 4);
  uVar1 = *(uint *)(lVar2 + 4);
  uVar3 = uVar1 & 2;
  if ((*(uint *)(param_1 + 4) & 0x66) == 0) {
    uVar3 = uVar1 & 1;
  }
  if (uVar3 != 0) {
                    // WARNING: Subroutine does not return
    __CxxFrameHandler3(param_1,param_2,param_3,param_4);
  }
  return 1;
}



errno_t __cdecl wmemcpy_s(wchar_t *_S1,rsize_t _N1,wchar_t *_S2,rsize_t _N)

{
  errno_t eVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001400ae354. Too many branches
                    // WARNING: Treating indirect jump as call
  eVar1 = wmemcpy_s(_S1,_N1,_S2,_N);
  return eVar1;
}



void * __cdecl memset(void *_Dst,int _Val,size_t _Size)

{
  void *pvVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001400ae35a. Too many branches
                    // WARNING: Treating indirect jump as call
  pvVar1 = memset(_Dst,_Val,_Size);
  return pvVar1;
}



void * __cdecl memcpy(void *_Dst,void *_Src,size_t _Size)

{
  void *pvVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001400ae360. Too many branches
                    // WARNING: Treating indirect jump as call
  pvVar1 = memcpy(_Dst,_Src,_Size);
  return pvVar1;
}



void _purecall(void)

{
                    // WARNING: Could not recover jumptable at 0x0001400ae366. Too many branches
                    // WARNING: Treating indirect jump as call
  _purecall();
  return;
}



// Library Function - Single Match
//  void __cdecl __ArrayUnwind(void * __ptr64,unsigned __int64,int,void (__cdecl*)(void * __ptr64))
// 
// Library: Visual Studio 2010 Release

void __cdecl __ArrayUnwind(void *param_1,__uint64 param_2,int param_3,_func_void_void_ptr *param_4)

{
  while( true ) {
    param_3 = param_3 + -1;
    if (param_3 < 0) break;
    param_1 = (void *)((longlong)param_1 - param_2);
    (*param_4)(param_1);
  }
  return;
}



// Library Function - Single Match
//  void __cdecl `eh vector destructor iterator'(void * __ptr64,unsigned __int64,int,void
// (__cdecl*)(void * __ptr64))
// 
// Library: Visual Studio 2010 Release

void __cdecl
_eh_vector_destructor_iterator_
          (void *param_1,__uint64 param_2,int param_3,_func_void_void_ptr *param_4)

{
  void *pvVar1;
  uint uVar2;
  ulonglong uVar3;
  
  uVar3 = (ulonglong)param_3;
  pvVar1 = (void *)(uVar3 * param_2 + (longlong)param_1);
  while( true ) {
    uVar2 = (int)uVar3 - 1;
    uVar3 = (ulonglong)uVar2;
    if ((int)uVar2 < 0) break;
    pvVar1 = (void *)((longlong)pvVar1 - param_2);
    (*param_4)(pvVar1);
  }
  return;
}



// WARNING: This is an inlined function
// Library Function - Single Match
//  __chkstk
// 
// Libraries: Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio 2012

void __chkstk(void)

{
  undefined1 *in_RAX;
  undefined1 *puVar1;
  undefined1 *puVar2;
  undefined1 local_res8 [32];
  
  puVar1 = local_res8 + -(longlong)in_RAX;
  if (local_res8 < in_RAX) {
    puVar1 = (undefined1 *)0x0;
  }
  if (puVar1 < StackLimit) {
    puVar2 = StackLimit;
    do {
      puVar2 = puVar2 + -0x1000;
      *puVar2 = 0;
    } while ((undefined1 *)((ulonglong)puVar1 & 0xfffffffffffff000) != puVar2);
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address
// Library Function - Single Match
//  __report_gsfailure
// 
// Libraries: Visual Studio 2005 Debug, Visual Studio 2005 Release, Visual Studio 2010 Debug, Visual
// Studio 2010 Release

void __cdecl __report_gsfailure(uintptr_t _StackCookie)

{
  HANDLE hProcess;
  DWORD64 unaff_retaddr;
  uintptr_t local_res8 [4];
  PVOID local_48;
  ulonglong local_40;
  PRUNTIME_FUNCTION local_38;
  DWORD64 local_30;
  DWORD64 local_28;
  undefined8 local_20;
  undefined8 local_18;
  
  local_res8[0] = _StackCookie;
  RtlCaptureContext(&DAT_140315930);
  local_30 = DAT_140315a28;
  local_38 = RtlLookupFunctionEntry(DAT_140315a28,&local_28,(PUNWIND_HISTORY_TABLE)0x0);
  if (local_38 == (PRUNTIME_FUNCTION)0x0) {
    _DAT_1403159c8 = local_res8;
    DAT_140315a28 = unaff_retaddr;
  }
  else {
    RtlVirtualUnwind(0,local_28,local_30,local_38,(PCONTEXT)&DAT_140315930,&local_48,&local_40,
                     (PKNONVOLATILE_CONTEXT_POINTERS)0x0);
  }
  _DAT_1403158a0 = DAT_140315a28;
  _DAT_1403159b0 = local_res8[0];
  _DAT_140315890 = 0xc0000409;
  _DAT_140315894 = 1;
  local_20 = DAT_1402f85a0;
  local_18 = DAT_1402f85a8;
  DAT_140315928 = IsDebuggerPresent();
  __crt_debugger_hook(1);
  SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)0x0);
  UnhandledExceptionFilter((_EXCEPTION_POINTERS *)&PTR_DAT_140206d98);
  if (DAT_140315928 == 0) {
    __crt_debugger_hook(1);
  }
  hProcess = GetCurrentProcess();
  TerminateProcess(hProcess,0xc0000409);
  return;
}



void __cdecl _unlock(int _File)

{
                    // WARNING: Could not recover jumptable at 0x0001400ae5ce. Too many branches
                    // WARNING: Treating indirect jump as call
  _unlock(_File);
  return;
}



void __dllonexit(void)

{
                    // WARNING: Could not recover jumptable at 0x0001400ae5d4. Too many branches
                    // WARNING: Treating indirect jump as call
  __dllonexit();
  return;
}



void __cdecl _lock(int _File)

{
                    // WARNING: Could not recover jumptable at 0x0001400ae5da. Too many branches
                    // WARNING: Treating indirect jump as call
  _lock(_File);
  return;
}



undefined8 FUN_1400ae5e0(undefined8 *param_1)

{
  int iVar1;
  int *piVar2;
  
  piVar2 = (int *)*param_1;
  if (((*piVar2 == -0x1f928c9d) && (piVar2[6] == 4)) &&
     ((iVar1 = piVar2[8], iVar1 == 0x19930520 ||
      (((iVar1 == 0x19930521 || (iVar1 == 0x19930522)) || (iVar1 == 0x1994000)))))) {
                    // WARNING: Subroutine does not return
    terminate();
  }
  return 0;
}



undefined8 FUN_1400ae624(void)

{
  SetUnhandledExceptionFilter(FUN_1400ae5e0);
  return 0;
}



void __cdecl _amsg_exit(int param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001400ae63c. Too many branches
                    // WARNING: Treating indirect jump as call
  _amsg_exit(param_1);
  return;
}



void FUN_1400ae644(void)

{
  undefined8 *puVar1;
  
  for (puVar1 = &DAT_14029fc58; puVar1 < &DAT_14029fc58; puVar1 = puVar1 + 1) {
    if ((code *)*puVar1 != (code *)0x0) {
      (*(code *)*puVar1)();
    }
  }
  return;
}



void FUN_1400ae67c(void)

{
  undefined8 *puVar1;
  
  for (puVar1 = &DAT_14029fc68; puVar1 < &DAT_14029fc68; puVar1 = puVar1 + 1) {
    if ((code *)*puVar1 != (code *)0x0) {
      (*(code *)*puVar1)();
    }
  }
  return;
}



int __cdecl _XcptFilter(ulong _ExceptionNum,_EXCEPTION_POINTERS *_ExceptionPtr)

{
  int iVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001400ae6b4. Too many branches
                    // WARNING: Treating indirect jump as call
  iVar1 = _XcptFilter(_ExceptionNum,_ExceptionPtr);
  return iVar1;
}



// Library Function - Single Match
//  _ValidateImageBase
// 
// Libraries: Visual Studio 2008 Release, Visual Studio 2010 Release

BOOL __cdecl _ValidateImageBase(PBYTE pImageBase)

{
  uint uVar1;
  
  if (*(short *)pImageBase != 0x5a4d) {
    return 0;
  }
  uVar1 = 0;
  if (*(int *)(pImageBase + *(int *)(pImageBase + 0x3c)) == 0x4550) {
    uVar1 = (uint)((short)*(int *)((longlong)(pImageBase + *(int *)(pImageBase + 0x3c)) + 0x18) ==
                  0x20b);
  }
  return uVar1;
}



// Library Function - Single Match
//  _FindPESection
// 
// Libraries: Visual Studio 2008 Release, Visual Studio 2010 Release, Visual Studio 2019 Release

PIMAGE_SECTION_HEADER __cdecl _FindPESection(PBYTE pImageBase,DWORD_PTR rva)

{
  int iVar1;
  PIMAGE_SECTION_HEADER p_Var2;
  uint uVar3;
  
  iVar1 = *(int *)(pImageBase + 0x3c);
  uVar3 = 0;
  p_Var2 = (PIMAGE_SECTION_HEADER)
           (pImageBase +
           (ulonglong)*(ushort *)(pImageBase + (longlong)iVar1 + 0x14) + 0x18 + (longlong)iVar1);
  if (*(ushort *)(pImageBase + (longlong)iVar1 + 6) != 0) {
    do {
      if ((p_Var2->VirtualAddress <= rva) &&
         (rva < (p_Var2->Misc).PhysicalAddress + p_Var2->VirtualAddress)) {
        return p_Var2;
      }
      uVar3 = uVar3 + 1;
      p_Var2 = p_Var2 + 1;
    } while (uVar3 < *(ushort *)(pImageBase + (longlong)iVar1 + 6));
  }
  return (PIMAGE_SECTION_HEADER)0x0;
}



// Library Function - Single Match
//  _IsNonwritableInCurrentImage
// 
// Library: Visual Studio 2010 Release

BOOL __cdecl _IsNonwritableInCurrentImage(PBYTE pTarget)

{
  BOOL BVar1;
  uint uVar2;
  PIMAGE_SECTION_HEADER p_Var3;
  IMAGE_DOS_HEADER *pImageBase;
  
  pImageBase = &IMAGE_DOS_HEADER_140000000;
  BVar1 = _ValidateImageBase((PBYTE)&IMAGE_DOS_HEADER_140000000);
  uVar2 = 0;
  if (BVar1 != 0) {
    p_Var3 = _FindPESection((PBYTE)pImageBase,(longlong)pTarget - (longlong)pImageBase);
    uVar2 = 0;
    if (p_Var3 != (PIMAGE_SECTION_HEADER)0x0) {
      uVar2 = ~(p_Var3->Characteristics >> 0x1f) & 1;
    }
  }
  return uVar2;
}



void _initterm(void)

{
                    // WARNING: Could not recover jumptable at 0x0001400ae782. Too many branches
                    // WARNING: Treating indirect jump as call
  _initterm();
  return;
}



void _initterm_e(void)

{
                    // WARNING: Could not recover jumptable at 0x0001400ae788. Too many branches
                    // WARNING: Treating indirect jump as call
  _initterm_e();
  return;
}



undefined8 FUN_1400ae790(void)

{
  return 0;
}



// Library Function - Single Match
//  __security_init_cookie
// 
// Libraries: Visual Studio 2008 Release, Visual Studio 2010 Release

void __cdecl __security_init_cookie(void)

{
  _FILETIME _Var1;
  DWORD DVar2;
  DWORD DVar3;
  DWORD DVar4;
  _FILETIME local_res8;
  LARGE_INTEGER local_res10;
  
  local_res8.dwLowDateTime = 0;
  local_res8.dwHighDateTime = 0;
  if (DAT_1402f85a0 == 0x2b992ddfa232) {
    GetSystemTimeAsFileTime(&local_res8);
    _Var1 = local_res8;
    DVar2 = GetCurrentProcessId();
    DVar3 = GetCurrentThreadId();
    DVar4 = GetTickCount();
    QueryPerformanceCounter(&local_res10);
    DAT_1402f85a0 =
         (local_res10.QuadPart ^
         (ulonglong)_Var1 ^ (ulonglong)DVar2 ^ (ulonglong)DVar3 ^ (ulonglong)DVar4) & 0xffffffffffff
    ;
    if (DAT_1402f85a0 == 0x2b992ddfa232) {
      DAT_1402f85a0 = 0x2b992ddfa233;
    }
  }
  DAT_1402f85a8 = ~DAT_1402f85a0;
  return;
}



void __cdecl terminate(void)

{
                    // WARNING: Could not recover jumptable at 0x0001400ae848. Too many branches
                    // WARNING: Subroutine does not return
                    // WARNING: Treating indirect jump as call
  terminate();
  return;
}



void __cdecl __crt_debugger_hook(int param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001400ae84e. Too many branches
                    // WARNING: Treating indirect jump as call
  __crt_debugger_hook(param_1);
  return;
}



void __thiscall type_info::_type_info_dtor_internal_method(type_info *this)

{
                    // WARNING: Could not recover jumptable at 0x0001400ae854. Too many branches
                    // WARNING: Treating indirect jump as call
  _type_info_dtor_internal_method(this);
  return;
}



void MiniDumpWriteDump(void)

{
                    // WARNING: Could not recover jumptable at 0x0001400ae85a. Too many branches
                    // WARNING: Treating indirect jump as call
  MiniDumpWriteDump();
  return;
}



undefined8 * FUN_1400ae860(undefined8 *param_1)

{
  void *pvVar1;
  undefined8 uVar2;
  
  FUN_1400b6f80();
  *param_1 = CkCrypt2::vftable;
  uVar2 = 0;
  param_1[1] = 0;
  *(undefined1 *)(param_1 + 3) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1c) = 0;
  _eh_vector_constructor_iterator_(param_1 + 4,0x20,10,FUN_1400af0d0,FUN_1400af160);
  pvVar1 = operator_new(0xcd8);
  if (pvVar1 != (void *)0x0) {
    uVar2 = FUN_1400b0310(pvVar1);
  }
  param_1[2] = uVar2;
  return param_1;
}



undefined1 FUN_1400ae8f0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined1 local_148 [160];
  undefined1 local_a8 [160];
  
  uVar3 = 0xfffffffffffffffe;
  FUN_1400b6fd0(local_a8);
  FUN_1400b7270(local_a8,param_2);
  uVar2 = *(undefined8 *)(param_1 + 0x10);
  FUN_1400b6fd0(local_148);
  uVar1 = FUN_1400b68d0(uVar2,local_a8,local_148,param_4,uVar3);
  uVar2 = FUN_1400b7ce0(local_148);
  FUN_1400af200(param_3,uVar2);
  FUN_1400b7090(local_148);
  FUN_1400b7090(local_a8);
  return uVar1;
}



undefined1 FUN_1400ae9a0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined8 uVar2;
  undefined1 local_148 [160];
  undefined1 local_a8 [160];
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1400b6fd0(local_a8);
  FUN_1400b83b0(local_a8,param_2,*(undefined1 *)(param_1 + 0x18),param_4,uVar2);
  uVar2 = *(undefined8 *)(param_1 + 0x10);
  FUN_1400b6fd0(local_148);
  uVar1 = FUN_1400b6750(uVar2,local_a8,local_148);
  uVar2 = FUN_1400b7ce0(local_148);
  FUN_1400af200(param_3,uVar2);
  FUN_1400b7090(local_148);
  FUN_1400b7090(local_a8);
  return uVar1;
}



void FUN_1400aea60(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined1 local_a8 [160];
  
  uVar1 = 0xfffffffffffffffe;
  FUN_1400b6fd0(local_a8);
  FUN_1400b83b0(local_a8,param_2,*(undefined1 *)(param_1 + 0x18),param_4,uVar1);
  FUN_1400baad0(*(undefined8 *)(param_1 + 0x10),local_a8);
  FUN_1400b7090(local_a8);
  return;
}



void FUN_1400aead0(longlong param_1)

{
  FUN_1400b3440(*(undefined8 *)(param_1 + 0x10));
  return;
}



void FUN_1400aeae0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  undefined1 local_148 [160];
  undefined1 local_a8 [160];
  
  uVar2 = 0xfffffffffffffffe;
  uVar1 = *(undefined8 *)(param_1 + 0x10);
  FUN_1400b6fd0(local_a8);
  FUN_1400b6fd0(local_148);
  FUN_1400b83b0(local_a8,param_3,*(undefined1 *)(param_1 + 0x18),param_4,uVar2);
  FUN_1400b83b0(local_148,param_2,*(undefined1 *)(param_1 + 0x18));
  FUN_1400b3b00(uVar1,local_148,local_a8);
  FUN_1400b7090(local_148);
  FUN_1400b7090(local_a8);
  return;
}



void FUN_1400aeba0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  undefined1 local_148 [160];
  undefined1 local_a8 [160];
  
  uVar2 = 0xfffffffffffffffe;
  uVar1 = *(undefined8 *)(param_1 + 0x10);
  FUN_1400b6fd0(local_a8);
  FUN_1400b6fd0(local_148);
  FUN_1400b83b0(local_a8,param_3,*(undefined1 *)(param_1 + 0x18),param_4,uVar2);
  FUN_1400b83b0(local_148,param_2,*(undefined1 *)(param_1 + 0x18));
  FUN_1400b3cd0(uVar1,local_148,local_a8);
  FUN_1400b7090(local_148);
  FUN_1400b7090(local_a8);
  return;
}



void FUN_1400aec60(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  undefined1 local_a8 [160];
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1400b6fd0(local_a8);
  FUN_1400b83b0(local_a8,param_2,*(undefined1 *)(param_1 + 0x18),param_4,uVar2);
  uVar2 = *(undefined8 *)(param_1 + 0x10);
  uVar1 = FUN_1401320e0(param_3);
  FUN_1400b0280(uVar2,local_a8,uVar1);
  FUN_1400b70e0(local_a8);
  FUN_1400b7090(local_a8);
  return;
}



void FUN_1400aecf0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined1 local_a8 [160];
  
  uVar1 = 0xfffffffffffffffe;
  FUN_1400b6fd0(local_a8);
  FUN_1400b83b0(local_a8,param_2,*(undefined1 *)(param_1 + 0x18),param_4,uVar1);
  FUN_1400b34f0(*(undefined8 *)(param_1 + 0x10),local_a8);
  FUN_1400b7090(local_a8);
  return;
}



void FUN_1400aed60(longlong param_1)

{
  FUN_1400b0220(*(undefined8 *)(param_1 + 0x10));
  return;
}



void FUN_1400aed70(longlong param_1)

{
  FUN_1400b35e0(*(undefined8 *)(param_1 + 0x10));
  return;
}



void FUN_1400aed80(longlong param_1,undefined8 param_2)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar1 = *(undefined8 *)(param_1 + 0x10);
  uVar2 = FUN_1401320e0(param_2);
  FUN_1400b0190(uVar1,uVar2);
  return;
}



undefined1 FUN_1400aedb0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined1 uVar2;
  undefined8 uVar3;
  undefined1 local_a8 [160];
  
  uVar3 = 0xfffffffffffffffe;
  uVar1 = *(undefined8 *)(param_1 + 0x10);
  FUN_1400b6fd0(local_a8);
  FUN_1400b83b0(local_a8,param_2,*(undefined1 *)(param_1 + 0x18),param_4,uVar3);
  uVar2 = FUN_1400b0a50(uVar1,local_a8);
  FUN_1400b7090(local_a8);
  return uVar2;
}



undefined8 FUN_1400aee30(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined1 local_a8 [160];
  
  uVar3 = 0xfffffffffffffffe;
  FUN_1400b6fd0(local_a8);
  *(int *)(param_1 + 0x1c) = *(int *)(param_1 + 0x1c) + 1;
  if (9 < *(uint *)(param_1 + 0x1c)) {
    *(undefined4 *)(param_1 + 0x1c) = 0;
  }
  lVar2 = ((ulonglong)*(uint *)(param_1 + 0x1c) + 1) * 0x20 + param_1;
  FUN_1400af1f0(lVar2);
  cVar1 = FUN_1400ae8f0(param_1,param_2,lVar2,param_4,uVar3);
  if (cVar1 == '\0') {
    FUN_1400b7090(local_a8);
    uVar3 = 0;
  }
  else {
    if (*(char *)(param_1 + 0x18) == '\0') {
      uVar3 = FUN_1400af1d0(lVar2);
    }
    else {
      uVar3 = FUN_1400af1e0();
    }
    FUN_1400b7090(local_a8);
  }
  return uVar3;
}



undefined8 * FUN_1400aeee0(undefined8 *param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  
  *param_1 = CkCrypt2::vftable;
  puVar1 = (undefined8 *)param_1[2];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,0xfffffffffffffffe);
  }
  param_1[2] = 0;
  _eh_vector_destructor_iterator_(param_1 + 4,0x20,10,FUN_1400af160);
  FUN_1400b6f90(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1400aef60(undefined8 *param_1)

{
  void *pvVar1;
  undefined8 uVar2;
  
  FUN_1400b6f80();
  *param_1 = CkByteData::vftable;
  *(undefined1 *)(param_1 + 2) = 0;
  uVar2 = 0;
  param_1[3] = 0;
  pvVar1 = operator_new(0x28);
  if (pvVar1 != (void *)0x0) {
    uVar2 = FUN_1400b8c40(pvVar1);
  }
  param_1[1] = uVar2;
  return param_1;
}



void FUN_1400aefd0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  
  *param_1 = CkByteData::vftable;
  puVar1 = (undefined8 *)param_1[1];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,0xfffffffffffffffe);
  }
  param_1[1] = 0;
  puVar1 = (undefined8 *)param_1[3];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  param_1[3] = 0;
  FUN_1400b6f90(param_1);
  return;
}



undefined8 * FUN_1400af040(undefined8 *param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  
  *param_1 = CkByteData::vftable;
  puVar1 = (undefined8 *)param_1[1];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,0xfffffffffffffffe);
  }
  param_1[1] = 0;
  puVar1 = (undefined8 *)param_1[3];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  param_1[3] = 0;
  FUN_1400b6f90(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1400af0d0(undefined8 *param_1)

{
  void *pvVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  
  FUN_1400b6f80();
  *param_1 = CkString::vftable;
  *(undefined1 *)(param_1 + 2) = 0;
  pvVar1 = operator_new(0xa0);
  uVar3 = 0;
  uVar2 = uVar3;
  if (pvVar1 != (void *)0x0) {
    uVar2 = FUN_1400b6fd0(pvVar1);
  }
  param_1[1] = uVar2;
  pvVar1 = operator_new(0x30);
  if (pvVar1 != (void *)0x0) {
    uVar3 = FUN_1400bcc20(pvVar1);
  }
  param_1[3] = uVar3;
  return param_1;
}



void FUN_1400af160(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  
  *param_1 = CkString::vftable;
  puVar1 = (undefined8 *)param_1[1];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,0xfffffffffffffffe);
    param_1[1] = 0;
  }
  puVar1 = (undefined8 *)param_1[3];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[3] = 0;
  }
  FUN_1400b6f90(param_1);
  return;
}



void FUN_1400af1d0(longlong param_1)

{
  FUN_1400b7950(*(undefined8 *)(param_1 + 8));
  return;
}



void FUN_1400af1e0(longlong param_1)

{
  FUN_1400b7ce0(*(undefined8 *)(param_1 + 8));
  return;
}



void FUN_1400af1f0(longlong param_1)

{
  FUN_1400b7180(*(undefined8 *)(param_1 + 8));
  return;
}



void FUN_1400af200(longlong param_1)

{
  FUN_1400b7270(*(undefined8 *)(param_1 + 8));
  return;
}



void FUN_1400af210(longlong param_1)

{
  if (*(char *)(param_1 + 0x10) != '\0') {
    FUN_1400b7ce0();
    return;
  }
  FUN_1400b7950(*(undefined8 *)(param_1 + 8));
  return;
}



undefined8 * FUN_1400af230(undefined8 *param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  
  *param_1 = CkString::vftable;
  puVar1 = (undefined8 *)param_1[1];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,0xfffffffffffffffe);
    param_1[1] = 0;
  }
  puVar1 = (undefined8 *)param_1[3];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[3] = 0;
  }
  FUN_1400b6f90(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined1 * FUN_1400af2c0(void)

{
  undefined1 *puVar1;
  
  if (DAT_140316130 != '\0') {
    return &DAT_140316130;
  }
  if (DAT_1403163b0 != '\0') {
    return &DAT_1403163b0;
  }
  if (DAT_140315e10 != '\0') {
    return &DAT_140315e10;
  }
  if (DAT_140316220 != '\0') {
    return &DAT_140316220;
  }
  if (DAT_140315e60 != '\0') {
    return &DAT_140315e60;
  }
  if (DAT_140315f50 != '\0') {
    return &DAT_140315f50;
  }
  if (DAT_1403160e0 != '\0') {
    return &DAT_1403160e0;
  }
  if (DAT_1403162c0 != '\0') {
    return &DAT_1403162c0;
  }
  if (DAT_140316400 != '\0') {
    return &DAT_140316400;
  }
  if (DAT_140316360 != '\0') {
    return &DAT_140316360;
  }
  if (DAT_140316090 != '\0') {
    return &DAT_140316090;
  }
  if (DAT_140316270 != '\0') {
    return &DAT_140316270;
  }
  if (DAT_140316180 != '\0') {
    return &DAT_140316180;
  }
  if (DAT_140315eb0 != '\0') {
    return &DAT_140315eb0;
  }
  if (DAT_140316040 != '\0') {
    return &DAT_140316040;
  }
  if (DAT_140315fa0 != '\0') {
    return &DAT_140315fa0;
  }
  if (DAT_1403161d0 != '\0') {
    return &DAT_1403161d0;
  }
  if (DAT_140315f00 != '\0') {
    return &DAT_140315f00;
  }
  puVar1 = &DAT_140315ff0;
  if (DAT_140315ff0 == '\0') {
    puVar1 = &DAT_140207088;
  }
  return puVar1;
}



void FUN_1400af410(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  char cVar2;
  char *pcVar3;
  undefined1 *puVar4;
  undefined8 uVar5;
  undefined1 local_40 [56];
  
  uVar5 = 0xfffffffffffffffe;
  FUN_1400bbe30(param_2);
  if (DAT_140316450 == '\0') {
    DAT_140315f00 = 0;
    DAT_140316130 = 0;
    DAT_1403163b0 = 0;
    DAT_140315e10 = 0;
    DAT_140316220 = 0;
    DAT_140315e60 = 0;
    DAT_140315f50 = 0;
    DAT_1403160e0 = 0;
    DAT_1403162c0 = 0;
    DAT_140316400 = 0;
    DAT_140316360 = 0;
    DAT_140316090 = 0;
    DAT_140316270 = 0;
    DAT_140316180 = 0;
    DAT_140315eb0 = 0;
    DAT_140316040 = 0;
    DAT_140315fa0 = 0;
    DAT_1403161d0 = 0;
    DAT_140315ff0 = 0;
    DAT_140316450 = '\x01';
  }
  iVar1 = *(int *)(param_1 + 0x154);
  if ((-1 < iVar1) && (iVar1 < 0x65)) {
    if (iVar1 == 1) {
      puVar4 = &DAT_140316130;
    }
    else if (iVar1 == 2) {
      puVar4 = &DAT_1403163b0;
    }
    else if (iVar1 == 3) {
      puVar4 = &DAT_140315e10;
    }
    else if (iVar1 == 4) {
      puVar4 = &DAT_140316220;
    }
    else if (iVar1 == 0x13) {
      puVar4 = &DAT_140315f00;
    }
    else if (iVar1 == 5) {
      puVar4 = &DAT_140315e60;
    }
    else if (iVar1 == 6) {
      puVar4 = &DAT_140315f50;
    }
    else if (iVar1 == 7) {
      puVar4 = &DAT_1403160e0;
    }
    else if (iVar1 == 8) {
      puVar4 = &DAT_1403162c0;
    }
    else if (iVar1 == 0x12) {
      puVar4 = &DAT_140316400;
    }
    else if (iVar1 == 9) {
      puVar4 = &DAT_140316360;
    }
    else if (iVar1 == 10) {
      puVar4 = &DAT_140316090;
    }
    else if (iVar1 == 0xb) {
      puVar4 = &DAT_140316270;
    }
    else if (iVar1 == 0xc) {
      puVar4 = &DAT_140316180;
    }
    else if (iVar1 == 0xd) {
      puVar4 = &DAT_140315eb0;
    }
    else if (iVar1 == 0x15) {
      puVar4 = &DAT_140316310;
    }
    else if (iVar1 == 0xe) {
      puVar4 = &DAT_140316040;
    }
    else if (iVar1 == 0xf) {
      puVar4 = &DAT_140315fa0;
    }
    else if (iVar1 == 0x10) {
      puVar4 = &DAT_1403161d0;
    }
    else if (iVar1 == 0x14) {
      puVar4 = &DAT_140315ff0;
    }
    else {
      puVar4 = (undefined1 *)FUN_1400af2c0();
    }
    FUN_1400bdb00(param_2,puVar4,param_3,param_4,uVar5);
    cVar2 = FUN_1400bc610(param_2,0x3a);
    if (cVar2 != '\0') {
      pcVar3 = (char *)FUN_1400b8b90(param_2);
      pcVar3 = strchr(pcVar3,0x3a);
      if (pcVar3 != (char *)0x0) {
        FUN_1400bcaa0(local_40,pcVar3 + 1);
        FUN_1400bbc30(local_40);
        FUN_1400bbe30(param_2);
        FUN_1400bda40(param_2,local_40);
        FUN_1400bceb0(local_40);
      }
    }
  }
  return;
}



void FUN_1400af6a0(int param_1,longlong param_2)

{
  char *_Source;
  undefined1 local_40 [56];
  
  if (param_2 != 0) {
    if (DAT_140316450 == '\0') {
      DAT_140315f00 = 0;
      DAT_140316130 = 0;
      DAT_1403163b0 = 0;
      DAT_140315e10 = 0;
      DAT_140316220 = 0;
      DAT_140315e60 = 0;
      DAT_140315f50 = 0;
      DAT_1403160e0 = 0;
      DAT_1403162c0 = 0;
      DAT_140316400 = 0;
      DAT_140316360 = 0;
      DAT_140316090 = 0;
      DAT_140316270 = 0;
      DAT_140316180 = 0;
      DAT_140315eb0 = 0;
      DAT_140316040 = 0;
      DAT_140315fa0 = 0;
      DAT_1403161d0 = 0;
      DAT_140315ff0 = 0;
      DAT_140316450 = '\x01';
    }
    FUN_1400bcc20(local_40);
    FUN_1400bc640(local_40,param_2);
    FUN_1400bbd50(local_40,0x5f);
    _Source = (char *)FUN_1400b8b90(local_40);
    if (param_1 == 1) {
      strncpy(&DAT_140316130,_Source,0x4f);
      DAT_14031617f = 0;
    }
    else if (param_1 == 2) {
      strncpy(&DAT_1403163b0,_Source,0x4f);
      DAT_1403163ff = 0;
    }
    else if (param_1 == 3) {
      strncpy(&DAT_140315e10,_Source,0x4f);
      DAT_140315e5f = 0;
    }
    else if (param_1 == 4) {
      strncpy(&DAT_140316220,_Source,0x4f);
      DAT_14031626f = 0;
    }
    else if (param_1 == 0x13) {
      strncpy(&DAT_140315f00,_Source,0x4f);
      DAT_140315f4f = 0;
    }
    else if (param_1 == 5) {
      strncpy(&DAT_140315e60,_Source,0x4f);
      DAT_140315eaf = 0;
    }
    else if (param_1 == 6) {
      strncpy(&DAT_140315f50,_Source,0x4f);
      DAT_140315f9f = 0;
    }
    else if (param_1 == 7) {
      strncpy(&DAT_1403160e0,_Source,0x4f);
      DAT_14031612f = 0;
    }
    else if (param_1 == 8) {
      strncpy(&DAT_1403162c0,_Source,0x4f);
      DAT_14031630f = 0;
    }
    else if (param_1 == 0x12) {
      strncpy(&DAT_140316400,_Source,0x4f);
      DAT_14031644f = 0;
    }
    else if (param_1 == 9) {
      strncpy(&DAT_140316360,_Source,0x4f);
      DAT_1403163af = 0;
    }
    else if (param_1 == 10) {
      strncpy(&DAT_140316090,_Source,0x4f);
      DAT_1403160df = 0;
    }
    else if (param_1 == 0xb) {
      strncpy(&DAT_140316270,_Source,0x4f);
      DAT_1403162bf = 0;
    }
    else if (param_1 == 0xc) {
      strncpy(&DAT_140316180,_Source,0x4f);
      DAT_1403161cf = 0;
    }
    else if (param_1 == 0xd) {
      strncpy(&DAT_140315eb0,_Source,0x4f);
      DAT_140315eff = 0;
    }
    else if (param_1 == 0x15) {
      strncpy(&DAT_140316310,_Source,0x4f);
      DAT_14031635f = 0;
    }
    else if (param_1 == 0xe) {
      strncpy(&DAT_140316040,_Source,0x4f);
      DAT_14031608f = 0;
    }
    else if (param_1 == 0xf) {
      strncpy(&DAT_140315fa0,_Source,0x4f);
      DAT_140315fef = 0;
    }
    else if (param_1 == 0x10) {
      strncpy(&DAT_1403161d0,_Source,0x4f);
      DAT_14031621f = 0;
    }
    else if (param_1 == 0x14) {
      strncpy(&DAT_140315ff0,_Source,0x4f);
      DAT_14031603f = 0;
    }
    FUN_1400bbde0(local_40);
    FUN_1400bceb0(local_40);
  }
  return;
}



void FUN_1400afa80(longlong param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  int iVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 local_40 [56];
  
  uVar4 = 0xfffffffffffffffe;
  if (DAT_140316450 == '\0') {
    DAT_140315f00 = 0;
    DAT_140316130 = 0;
    DAT_1403163b0 = 0;
    DAT_140315e10 = 0;
    DAT_140316220 = 0;
    DAT_140315e60 = 0;
    DAT_140315f50 = 0;
    DAT_1403160e0 = 0;
    DAT_1403162c0 = 0;
    DAT_140316400 = 0;
    DAT_140316360 = 0;
    DAT_140316090 = 0;
    DAT_140316270 = 0;
    DAT_140316180 = 0;
    DAT_140315eb0 = 0;
    DAT_140316040 = 0;
    DAT_140315fa0 = 0;
    DAT_1403161d0 = 0;
    DAT_140315ff0 = 0;
    DAT_140316450 = '\x01';
  }
  iVar2 = *(int *)(param_1 + 0x154);
  if (iVar2 < 0) {
    iVar2 = 0;
  }
  *(int *)(param_1 + 0x154) = iVar2;
  if (100 < iVar2) {
    iVar2 = 0;
  }
  *(int *)(param_1 + 0x154) = iVar2;
  FUN_1400bcc20(local_40);
  FUN_1400af410(param_1,local_40);
  lVar1 = *param_2;
  uVar3 = FUN_1400b8b90(local_40);
  (**(code **)(lVar1 + 0x58))(param_2,"UnlockPrefix",uVar3,param_4,uVar4);
  FUN_1400bceb0(local_40);
  return;
}



undefined8 * FUN_1400afba0(undefined8 *param_1)

{
  FUN_1400d0eb0();
  *param_1 = ClsBase::vftable;
  FUN_1400cea60(param_1 + 2);
  FUN_1400bcc20(param_1 + 0x24);
  *(undefined4 *)(param_1 + 0x2a) = 0x991144aa;
  *(undefined4 *)((longlong)param_1 + 0x154) = 0;
  return param_1;
}



void FUN_1400afc00(undefined8 *param_1)

{
  *param_1 = ClsBase::vftable;
  *(undefined4 *)(param_1 + 0x2a) = 0;
  FUN_1400bceb0(param_1 + 0x24);
  FUN_1400cead0(param_1 + 2);
  FUN_1400d0ee0(param_1);
  return;
}



void FUN_1400afc50(undefined8 param_1,longlong *param_2)

{
  char *pcVar1;
  
  if (DAT_140316454 == 3) {
    pcVar1 = "ActiveX / x64";
  }
  else if (DAT_140316454 == 1) {
    pcVar1 = ".NET 1.*";
  }
  else if (DAT_140316454 == 2) {
    pcVar1 = ".NET 2.0";
  }
  else if (DAT_140316454 == 0x108) {
    pcVar1 = ".NET 2.0 / x64";
  }
  else if (DAT_140316454 == 4) {
    pcVar1 = ".NET 4.0";
  }
  else if (DAT_140316454 == 0x1d0) {
    pcVar1 = ".NET 4.0 / x64";
  }
  else if (DAT_140316454 == 10) {
    pcVar1 = "Windows Ruby";
  }
  else if (DAT_140316454 == 0xb) {
    pcVar1 = "Windows Python";
  }
  else if (DAT_140316454 == 0xc) {
    pcVar1 = "Windows Perl";
  }
  else {
    pcVar1 = "Windows Java";
    if (DAT_140316454 != 0xd) {
      pcVar1 = "Visual C++ 10.0 / x64";
    }
  }
                    // WARNING: Could not recover jumptable at 0x0001400afcfe. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_2 + 0x58))(param_2,"Language",pcVar1);
  return;
}



void FUN_1400afd10(undefined8 param_1,longlong *param_2)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined8 uVar4;
  undefined1 *puVar5;
  char *pcVar6;
  undefined1 local_70 [48];
  undefined1 local_40 [56];
  
  FUN_1400bcc20(local_70);
  FUN_1400ce800(local_70);
  FUN_1400bcc20(local_40);
  FUN_1400ce880(local_40);
  iVar3 = FUN_1400bbb10(local_40);
  if (iVar3 == 0) {
    puVar5 = local_70;
  }
  else {
    FUN_1400bbe50(local_40,0x3a);
    FUN_1400bda40(local_40,local_70);
    puVar5 = local_40;
  }
  lVar1 = *param_2;
  uVar4 = FUN_1400b8b90(puVar5);
  (**(code **)(lVar1 + 0x58))(param_2,"Username",uVar4);
  FUN_1400bbe30(local_70);
  cVar2 = FUN_140102de0();
  pcVar6 = "Big Endian; ";
  if (cVar2 == '\0') {
    pcVar6 = "Little Endian; ";
  }
  FUN_1400bc640(local_70,pcVar6);
  FUN_1400bc640(local_70,"64-bit");
  lVar1 = *param_2;
  uVar4 = FUN_1400b8b90(local_70);
  (**(code **)(lVar1 + 0x58))(param_2,"Architecture",uVar4);
  FUN_1400afc50(param_1,param_2);
  FUN_1400bceb0(local_40);
  FUN_1400bceb0(local_70);
  return;
}



void FUN_1400afe40(longlong param_1,char param_2)

{
  if (param_2 != '\0') {
                    // WARNING: Could not recover jumptable at 0x0001400afe53. Too many branches
                    // WARNING: Treating indirect jump as call
    (**(code **)(*(longlong *)(param_1 + 0x10) + 0x30))(param_1 + 0x10,"Success.");
    return;
  }
                    // WARNING: Could not recover jumptable at 0x0001400afe5e. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + 0x10) + 0x28))(param_1 + 0x10,"Failed.");
  return;
}



undefined8 * FUN_1400afe70(undefined8 *param_1,uint param_2)

{
  *param_1 = ClsBase::vftable;
  *(undefined4 *)(param_1 + 0x2a) = 0;
  FUN_1400bceb0(param_1 + 0x24);
  FUN_1400cead0(param_1 + 2);
  FUN_1400d0ee0(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8
FUN_1400afee0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,char param_5
             ,char param_6,char param_7,longlong *param_8)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined1 local_58 [64];
  
  if (param_5 == '\0') {
    iVar3 = FUN_1400c0c60(param_2);
    if (iVar3 == 0x6faf) {
      FUN_1400c0be0(local_58);
      FUN_1400c0c70(local_58,0x4e4);
      cVar2 = FUN_1400b83e0(param_3,local_58,param_4);
      FUN_1400c0c30(local_58);
    }
    else {
      cVar2 = FUN_1400b83e0(param_3,param_2,param_4);
    }
  }
  else {
    cVar2 = FUN_1400b8520(param_3,param_2,param_4,param_4,0xfffffffffffffffe);
  }
  if (cVar2 == '\0') {
    (**(code **)(*param_8 + 0x28))(param_8,"Character encoding conversion failed.");
    uVar4 = FUN_1400b8350(param_3);
    FUN_1400cf520(param_8,"NumCharsIn",uVar4);
    lVar1 = *param_8;
    uVar5 = FUN_1400c0c50(param_2);
    (**(code **)(lVar1 + 0x58))(param_8,"Charset",uVar5);
    uVar4 = FUN_1400b8b80(param_4);
    FUN_1400cf520(param_8,"ConvertedToNumBytes",uVar4);
    if (param_6 != '\0') {
      (**(code **)(*param_8 + 0x30))
                (param_8,
                 "Set the Charset property equal to an appropriate charset (see http://www.chilkatsoft.com/p/p_463.asp)"
                );
    }
    if (param_7 != '\0') {
      (**(code **)(*(longlong *)(param_1 + 0x10) + 0x28))((longlong *)(param_1 + 0x10),"Failed.");
      (**(code **)(*param_8 + 0x50))(param_8);
    }
    uVar5 = 0;
  }
  else {
    uVar5 = 1;
  }
  return uVar5;
}



void FUN_1400b0050(longlong param_1,undefined8 param_2)

{
  (**(code **)(*(longlong *)(param_1 + 0x10) + 0x40))(param_1 + 0x10);
  (**(code **)(*(longlong *)(param_1 + 0x10) + 0x48))(param_1 + 0x10,param_2,1);
  (**(code **)(*(longlong *)(param_1 + 0x10) + 0x58))(param_1 + 0x10,"DllDate","Apr 18 2012");
  FUN_1400afa80(param_1,param_1 + 0x10);
  FUN_1400afd10(param_1,param_1 + 0x10);
  return;
}



void FUN_1400b00d0(longlong param_1)

{
  int iVar1;
  
  iVar1 = *(int *)(param_1 + 0x6f4);
  if (iVar1 != 1) {
    if (iVar1 == 2) {
      FUN_1400bdb00(param_1 + 0xac0,"rijndael");
      return;
    }
    if (iVar1 == 3) {
      FUN_1400bdb00(param_1 + 0xac0,"blowfish");
      return;
    }
    if (iVar1 == 6) {
      FUN_1400bdb00(param_1 + 0xac0,"blowfish2");
      return;
    }
    if (iVar1 == 4) {
      FUN_1400bdb00(param_1 + 0xac0,"twofish");
      return;
    }
    if (iVar1 == 10) {
      FUN_1400bdb00(param_1 + 0xac0,"pbes1");
      return;
    }
    if (iVar1 == 0xb) {
      FUN_1400bdb00(param_1 + 0xac0,"pbes2");
      return;
    }
    *(undefined4 *)(param_1 + 0x6f4) = 1;
  }
  FUN_1400bdb00(param_1 + 0xac0,&DAT_140207430);
  return;
}



void FUN_1400b0190(longlong param_1,undefined8 param_2)

{
  undefined8 uVar1;
  undefined4 uVar2;
  
  FUN_1400d1280(param_1 + 0x3c8);
  FUN_1400b8b30(param_1 + 0xa98);
  uVar2 = FUN_1400b8b80(param_2);
  uVar1 = FUN_1400b8b90(param_2);
  FUN_1400b97e0(param_1 + 0xa98,uVar1,uVar2);
  FUN_1400d1290(param_1 + 0x3c8);
  return;
}



void FUN_1400b0210(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x704) = param_2;
  return;
}



void FUN_1400b0220(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0xa68) = param_2;
  return;
}



undefined4 FUN_1400b0230(longlong param_1)

{
  int iVar1;
  undefined4 uVar2;
  
  iVar1 = *(int *)(param_1 + 0x6f4);
  if (iVar1 == 2) {
    return 0x10;
  }
  if ((((iVar1 != 3) && (iVar1 != 6)) && (iVar1 != 7)) && (iVar1 != 8)) {
    if (iVar1 == 9) {
      return 1;
    }
    uVar2 = 0;
    if (iVar1 == 4) {
      uVar2 = 0x10;
    }
    return uVar2;
  }
  return 8;
}



void FUN_1400b0280(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  undefined4 uVar1;
  int iVar2;
  int iVar3;
  
  FUN_1400b0050(param_1 + 0x3f8,"GenerateSecretKey");
  uVar1 = FUN_1400c0c60(param_1 + 0x818);
  FUN_1400d14a0(param_2,uVar1,param_3);
  iVar3 = (int)((*(int *)(param_1 + 0x6ec) >> 0x1f & 7U) + *(int *)(param_1 + 0x6ec)) >> 3;
  iVar2 = FUN_1400b8b80(param_3);
  if (iVar3 < iVar2) {
    FUN_1400b8be0(param_3,iVar2 - iVar3);
  }
                    // WARNING: Could not recover jumptable at 0x0001400b0305. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + 0x408) + 0x50))();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1400b0310(undefined8 *param_1)

{
  UINT UVar1;
  undefined1 auStack_88 [32];
  undefined8 *local_68;
  undefined8 local_60;
  char local_58 [56];
  ulonglong local_20;
  
  local_60 = 0xfffffffffffffffe;
  local_20 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  local_68 = param_1;
  FUN_1400ba820();
  FUN_1400bb9f0(param_1 + 0x30);
  FUN_1400bb8d0(param_1 + 0x6e);
  FUN_1400d1210(param_1 + 0x79);
  FUN_1400afba0(param_1 + 0x7f);
  *param_1 = ClsCrypt::vftable;
  param_1[0x30] = ClsCrypt::vftable;
  param_1[0x6e] = ClsCrypt::vftable;
  param_1[0x79] = ClsCrypt::vftable;
  param_1[0x7f] = ClsCrypt::vftable;
  FUN_1400d3540(param_1 + 0xaa);
  FUN_1400d0a70(param_1 + 0xc6);
  FUN_1400d1a40(param_1 + 0xcb);
  *(undefined2 *)(param_1 + 0xd6) = 0x100;
  FUN_1400bcc20(param_1 + 0xd7);
  *(undefined4 *)(param_1 + 0xdd) = 0;
  *(undefined4 *)((longlong)param_1 + 0x6ec) = 0x80;
  *(undefined4 *)(param_1 + 0xde) = 0x80;
  *(undefined4 *)((longlong)param_1 + 0x6f4) = 2;
  *(undefined4 *)(param_1 + 0xdf) = 1;
  *(undefined8 *)((longlong)param_1 + 0x6fc) = 3;
  *(undefined4 *)((longlong)param_1 + 0x704) = 0;
  *(undefined4 *)(param_1 + 0xe1) = 0x10100;
  FUN_1400d16b0(param_1 + 0xe2);
  FUN_1400b8c40(param_1 + 0xea);
  FUN_1400b8c40(param_1 + 0xef);
  *(undefined4 *)(param_1 + 0xf8) = 8;
  param_1[0xf9] = 0;
  param_1[0xfa] = 0;
  param_1[0xfb] = 0;
  param_1[0xfc] = 0;
  param_1[0xfd] = 0;
  param_1[0xfe] = 0;
  param_1[0xff] = 0;
  param_1[0x100] = 0;
  param_1[0x101] = 0;
  param_1[0x102] = 0;
  FUN_1400c0be0(param_1 + 0x103);
  FUN_1400d0a70(param_1 + 0x10b);
  param_1[0x110] = 0;
  param_1[0x111] = 0;
  *(undefined1 *)(param_1 + 0x112) = 0;
  param_1[0x113] = 0;
  FUN_1400b8c40(param_1 + 0x114);
  param_1[0x119] = 0;
  FUN_1400b6fd0(param_1 + 0x11a);
  FUN_1400b6fd0(param_1 + 0x12e);
  FUN_1400b8c40(param_1 + 0x142);
  *(undefined4 *)(param_1 + 0x147) = 0x400;
  *(undefined1 *)((longlong)param_1 + 0xa3c) = 0;
  FUN_1400b8c40(param_1 + 0x148);
  *(undefined4 *)(param_1 + 0x14d) = 0;
  FUN_1400b8c40(param_1 + 0x14e);
  FUN_1400b8c40(param_1 + 0x153);
  FUN_1400bcc20(param_1 + 0x158);
  FUN_1400b6fd0(param_1 + 0x15e);
  FUN_1400b6fd0(param_1 + 0x172);
  FUN_1400b6fd0(param_1 + 0x186);
  *(undefined1 *)(param_1 + 0x19a) = 0;
  sprintf(local_58,"%d");
  FUN_1400b00d0(param_1);
  UVar1 = GetACP();
  FUN_1400c0c70(param_1 + 0x103,UVar1);
  FUN_1400b86c0(param_1 + 0x12e,&DAT_1402074c0);
  FUN_1400bdb00(param_1 + 0xd7,&DAT_1402749b8);
  *(undefined4 *)((longlong)param_1 + 0x54c) = 5;
  return param_1;
}



void FUN_1400b0680(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  
  *param_1 = ClsCrypt::vftable;
  param_1[0x30] = ClsCrypt::vftable;
  param_1[0x6e] = ClsCrypt::vftable;
  param_1[0x79] = ClsCrypt::vftable;
  param_1[0x7f] = ClsCrypt::vftable;
  puVar1 = (undefined8 *)param_1[0x102];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,0xfffffffffffffffe);
    param_1[0x102] = 0;
  }
  puVar1 = (undefined8 *)param_1[0xf9];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[0xf9] = 0;
  }
  if ((void *)param_1[0xfa] != (void *)0x0) {
    operator_delete((void *)param_1[0xfa]);
    param_1[0xfa] = 0;
  }
  puVar1 = (undefined8 *)param_1[0xfb];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[0xfb] = 0;
  }
  puVar1 = (undefined8 *)param_1[0xfc];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[0xfc] = 0;
  }
  puVar1 = (undefined8 *)param_1[0xfd];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[0xfd] = 0;
  }
  puVar1 = (undefined8 *)param_1[0xfe];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[0xfe] = 0;
  }
  puVar1 = (undefined8 *)param_1[0xff];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[0xff] = 0;
  }
  puVar1 = (undefined8 *)param_1[0x100];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[0x100] = 0;
  }
  puVar1 = (undefined8 *)param_1[0x101];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[0x101] = 0;
  }
  puVar1 = (undefined8 *)param_1[0x111];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[0x111] = 0;
  }
  puVar1 = (undefined8 *)param_1[0x113];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[0x113] = 0;
  }
  puVar1 = (undefined8 *)param_1[0x110];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[0x110] = 0;
  }
  puVar1 = (undefined8 *)param_1[0x119];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[0x119] = 0;
  }
  FUN_1400b8b00(param_1 + 0x114);
  FUN_1400b8b00(param_1 + 0x148);
  FUN_1400d0d30(param_1 + 0xc6);
  FUN_1400d0d30(param_1 + 0x10b);
  FUN_1400b7090(param_1 + 0x186);
  FUN_1400b7090(param_1 + 0x172);
  FUN_1400b7090(param_1 + 0x15e);
  FUN_1400bceb0(param_1 + 0x158);
  FUN_1400b92d0(param_1 + 0x153);
  FUN_1400b92d0(param_1 + 0x14e);
  FUN_1400b92d0(param_1 + 0x148);
  FUN_1400b92d0(param_1 + 0x142);
  FUN_1400b7090(param_1 + 0x12e);
  FUN_1400b7090(param_1 + 0x11a);
  FUN_1400b92d0(param_1 + 0x114);
  FUN_1400d0e10(param_1 + 0x10b);
  FUN_1400c0c30(param_1 + 0x103);
  FUN_1400b92d0(param_1 + 0xef);
  FUN_1400b92d0(param_1 + 0xea);
  FUN_1400d17c0(param_1 + 0xe2);
  FUN_1400bceb0(param_1 + 0xd7);
  FUN_1400d1a80(param_1 + 0xcb);
  FUN_1400d0e10(param_1 + 0xc6);
  FUN_1400d3480(param_1 + 0xaa);
  FUN_1400afc00(param_1 + 0x7f);
  FUN_1400d1240(param_1 + 0x79);
  FUN_1400bb910(param_1 + 0x6e);
  FUN_1400bba50(param_1 + 0x30);
  FUN_1400ba8d0(param_1);
  return;
}



bool FUN_1400b0a50(longlong param_1,undefined8 param_2)

{
  undefined8 uVar1;
  longlong *plVar2;
  bool bVar3;
  undefined1 local_res8 [8];
  
  uVar1 = FUN_1400b7950(param_2);
  FUN_1400d1280(param_1 + 0x3c8);
  FUN_1400af6a0(5,uVar1);
  FUN_1400b0050(param_1 + 0x3f8,"UnlockComponent");
  plVar2 = (longlong *)(param_1 + 0x408);
  (**(code **)(*plVar2 + 0x58))(plVar2,"component","Crypt");
  (**(code **)(*plVar2 + 0x58))(plVar2,"unlockCode",uVar1);
  FUN_1400d3c10(local_res8);
  DAT_140316458 =
       FUN_1400d4280(local_res8,uVar1,"Q3J5cHQ=","Q2hpbGthdENyeXB0",&DAT_1402f86a0,plVar2,0);
  (**(code **)(*plVar2 + 0x50))(plVar2);
  FUN_1400d1290(param_1 + 0x3c8);
  bVar3 = DAT_140316458 == '\0';
  if (bVar3) {
    FUN_1400d3c20(local_res8);
  }
  else {
    FUN_1400d3c20(local_res8);
  }
  return !bVar3;
}



undefined8
FUN_1400b0b60(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             longlong *param_5)

{
  int iVar1;
  uint uVar2;
  void *pvVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *pcVar6;
  
  FUN_1400b8b30(param_4);
  if (*(int *)(param_1 + 0x6f4) == 5) {
    (**(code **)(*param_5 + 0x58))(param_5,"algorithm",&DAT_1402076c4);
    pvVar3 = operator_new(0x28);
    if (pvVar3 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(pvVar3);
    }
    FUN_1400b9e90(uVar4,param_3);
  }
  else {
    iVar1 = FUN_1400b8b80(param_3);
    if (iVar1 == 0) {
      *(undefined1 *)(param_1 + 0x70b) = 0;
      pvVar3 = operator_new(0x28);
      if (pvVar3 == (void *)0x0) {
        uVar4 = 0;
      }
      else {
        uVar4 = FUN_1400b8c40(pvVar3);
      }
    }
    else {
      *(undefined1 *)(param_1 + 0x70b) = 1;
      iVar1 = *(int *)(param_1 + 0x6f4);
      if (iVar1 == 2) {
        lVar5 = FUN_1400d17d0(param_2);
        if (lVar5 == 0) {
          pvVar3 = operator_new(0x28);
          if (pvVar3 == (void *)0x0) {
            uVar4 = 0;
          }
          else {
            uVar4 = FUN_1400b8c40(pvVar3);
          }
        }
        else {
          (**(code **)(*param_5 + 0x58))(param_5,"algorithm",&DAT_1402749b8);
          FUN_1400cf520(param_5,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
          FUN_1400b7180(param_1 + 0xaf0);
          FUN_1400bdb00(param_1 + 0xac0,"rijndael");
          FUN_1400e34a0(lVar5,*(undefined4 *)(param_1 + 0x6ec));
          if (*(int *)(param_1 + 0x704) == 1) {
            FUN_1400e3570();
          }
          else {
            FUN_1400e3580(lVar5);
          }
          FUN_1400e3500(lVar5,param_1 + 0xa98);
          if (*(char *)(param_1 + 0xa3c) != '\0') {
            uVar4 = FUN_1400b8b90(param_1 + 0xa40);
            FUN_1400e2800(lVar5,uVar4);
          }
          FUN_1400e3560(lVar5,*(undefined4 *)(param_1 + 0xa68));
          iVar1 = FUN_1400b8b80(param_3);
          if (iVar1 == 0) {
            FUN_1400b8b30(param_4);
            FUN_1400b9e90(param_4,param_1 + 0xa40);
            pvVar3 = operator_new(0x28);
            if (pvVar3 == (void *)0x0) {
              uVar4 = 0;
            }
            else {
              uVar4 = FUN_1400b8c40(pvVar3);
            }
          }
          else {
            uVar4 = FUN_1400e44d0(lVar5,param_3,param_5);
            FUN_1400b8b30(param_4);
            uVar2 = FUN_1400b8b80(uVar4);
            if (0xf < uVar2) {
              lVar5 = FUN_1400b8b90(uVar4);
              uVar2 = FUN_1400b8b80(uVar4);
              FUN_1400b97e0(param_4,lVar5 + -0x10 + (ulonglong)uVar2,0x10);
            }
          }
        }
      }
      else if (iVar1 == 3) {
        (**(code **)(*param_5 + 0x58))(param_5,"algorithm","blowfishOld");
        FUN_1400cf520(param_5,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
        lVar5 = FUN_1400d1820(param_2);
        if (lVar5 == 0) {
          pvVar3 = operator_new(0x28);
          if (pvVar3 == (void *)0x0) {
            uVar4 = 0;
          }
          else {
            uVar4 = FUN_1400b8c40(pvVar3);
          }
        }
        else {
          FUN_1400b7180(param_1 + 0xaf0);
          FUN_1400bdb00(param_1 + 0xac0,"blowfish");
          FUN_1400e0dd0(lVar5,*(undefined4 *)(param_1 + 0x6ec));
          FUN_1400e0e00(lVar5,param_1 + 0xa98);
          FUN_1400e0e30(lVar5,*(undefined4 *)(param_1 + 0xa68));
          uVar4 = FUN_1400e1f00(lVar5,param_3,param_5);
        }
      }
      else if (iVar1 == 6) {
        (**(code **)(*param_5 + 0x58))(param_5,"algorithm","blowfish");
        FUN_1400cf520(param_5,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
        lVar5 = FUN_1400d1870(param_2);
        if (lVar5 == 0) {
          pvVar3 = operator_new(0x28);
          if (pvVar3 == (void *)0x0) {
            uVar4 = 0;
          }
          else {
            uVar4 = FUN_1400b8c40(pvVar3);
          }
        }
        else {
          FUN_1400b7180(param_1 + 0xaf0);
          FUN_1400bdb00(param_1 + 0xac0,"blowfish2");
          FUN_1400dd3d0(lVar5,*(undefined4 *)(param_1 + 0x6ec));
          FUN_1400dd4f0(lVar5,param_1 + 0xa98);
          FUN_1400dd400(lVar5,*(undefined4 *)(param_1 + 0xa68));
          if (*(int *)(param_1 + 0x704) == 1) {
            FUN_1400dd410();
          }
          else if (*(int *)(param_1 + 0x704) == 2) {
            FUN_1400dd430();
          }
          else {
            FUN_1400dd420(lVar5);
          }
          if (*(char *)(param_1 + 0xa3c) != '\0') {
            uVar4 = FUN_1400b8b90(param_1 + 0xa40);
            FUN_1400dd440(lVar5,uVar4);
          }
          iVar1 = FUN_1400b8b80(param_3);
          if (iVar1 == 0) {
            FUN_1400b8b30(param_4);
            FUN_1400b9e90(param_4,param_1 + 0xa40);
            pvVar3 = operator_new(0x28);
            if (pvVar3 == (void *)0x0) {
              uVar4 = 0;
            }
            else {
              uVar4 = FUN_1400b8c40(pvVar3);
            }
          }
          else {
            uVar4 = FUN_1400dfed0(lVar5,param_3,param_4,param_5);
          }
        }
      }
      else if (iVar1 == 7) {
        (**(code **)(*param_5 + 0x58))(param_5,"algorithm",&DAT_1402074c0);
        FUN_1400cf520(param_5,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
        FUN_1400b7180(param_1 + 0xaf0);
        FUN_1400bdb00(param_1 + 0xac0,&DAT_1402074c0);
        lVar5 = FUN_1400d19b0(param_2);
        if (lVar5 == 0) {
          pvVar3 = operator_new(0x28);
          if (pvVar3 == (void *)0x0) {
            uVar4 = 0;
          }
          else {
            uVar4 = FUN_1400b8c40(pvVar3);
          }
        }
        else {
          FUN_1400dbe50(lVar5,param_1 + 0xa98,*(undefined4 *)(param_1 + 0x6ec),param_5);
          FUN_1400dbfb0(lVar5,*(undefined4 *)(param_1 + 0xa68));
          if (*(int *)(param_1 + 0x704) == 1) {
            uVar4 = 1;
          }
          else if (*(int *)(param_1 + 0x704) == 2) {
            uVar4 = 2;
          }
          else {
            uVar4 = 0;
          }
          FUN_1400dc010(lVar5,uVar4);
          if (*(char *)(param_1 + 0xa3c) != '\0') {
            FUN_1400dbfc0(lVar5,param_1 + 0xa40);
          }
          iVar1 = FUN_1400b8b80(param_3);
          if (iVar1 == 0) {
            FUN_1400b8b30(param_4);
            FUN_1400b9e90(param_4,param_1 + 0xa40);
            pvVar3 = operator_new(0x28);
            if (pvVar3 == (void *)0x0) {
              uVar4 = 0;
            }
            else {
              uVar4 = FUN_1400b8c40(pvVar3);
            }
          }
          else {
            uVar4 = FUN_1400dc2b0(lVar5,param_3,param_4,param_5);
          }
        }
      }
      else if (iVar1 == 8) {
        (**(code **)(*param_5 + 0x58))(param_5,"algorithm",&DAT_140207694);
        FUN_1400cf520(param_5,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
        FUN_1400b7180(param_1 + 0xaf0);
        FUN_1400bdb00(param_1 + 0xac0,&DAT_140207694);
        lVar5 = FUN_1400d1910(param_2);
        if (lVar5 == 0) {
          pvVar3 = operator_new(0x28);
          if (pvVar3 == (void *)0x0) {
            uVar4 = 0;
          }
          else {
            uVar4 = FUN_1400b8c40(pvVar3);
          }
        }
        else {
          FUN_1400d7b90(lVar5,param_1 + 0xa98,
                        (int)((*(int *)(param_1 + 0x6ec) >> 0x1f & 7U) + *(int *)(param_1 + 0x6ec))
                        >> 3,*(undefined4 *)(param_1 + 0x6f0));
          FUN_1400d6f90(lVar5,*(undefined4 *)(param_1 + 0xa68));
          FUN_1400d6fe0(lVar5,*(int *)(param_1 + 0x704) == 1);
          if (*(char *)(param_1 + 0xa3c) != '\0') {
            FUN_1400d6fa0(lVar5,param_1 + 0xa40);
          }
          iVar1 = FUN_1400b8b80(param_3);
          if (iVar1 == 0) {
            FUN_1400b8b30(param_4);
            FUN_1400b9e90(param_4,param_1 + 0xa40);
            pvVar3 = operator_new(0x28);
            if (pvVar3 == (void *)0x0) {
              uVar4 = 0;
            }
            else {
              uVar4 = FUN_1400b8c40(pvVar3);
            }
          }
          else {
            uVar4 = FUN_1400d76d0(lVar5,param_3,param_4,param_5);
          }
        }
      }
      else if (iVar1 == 9) {
        (**(code **)(*param_5 + 0x58))(param_5,"algorithm",&DAT_14020768c);
        FUN_1400cf520(param_5,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
        FUN_1400b7180(param_1 + 0xaf0);
        FUN_1400bdb00(param_1 + 0xac0,&DAT_14020768c);
        lVar5 = FUN_1400d1960(param_2);
        if (lVar5 == 0) {
          pvVar3 = operator_new(0x28);
          if (pvVar3 == (void *)0x0) {
            uVar4 = 0;
          }
          else {
            uVar4 = FUN_1400b8c40(pvVar3);
          }
        }
        else {
          FUN_1400d6ed0(lVar5,param_1 + 0xa98,
                        (int)((*(int *)(param_1 + 0x6ec) >> 0x1f & 7U) + *(int *)(param_1 + 0x6ec))
                        >> 3);
          if (*(char *)(param_1 + 0xcd0) != '\0') {
            FUN_1400d6e60(lVar5);
          }
          iVar1 = FUN_1400b8b80(param_3);
          if (iVar1 == 0) {
            pvVar3 = operator_new(0x28);
            if (pvVar3 == (void *)0x0) {
              uVar4 = 0;
            }
            else {
              uVar4 = FUN_1400b8c40(pvVar3);
            }
          }
          else {
            uVar4 = FUN_1400d6d60(lVar5,param_3);
          }
        }
      }
      else if (iVar1 == 4) {
        (**(code **)(*param_5 + 0x58))(param_5,"algorithm","twofish");
        FUN_1400cf520(param_5,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
        lVar5 = FUN_1400d18c0(param_2);
        if (lVar5 == 0) {
          pvVar3 = operator_new(0x28);
          if (pvVar3 == (void *)0x0) {
            uVar4 = 0;
          }
          else {
            uVar4 = FUN_1400b8c40(pvVar3);
          }
        }
        else {
          FUN_1400b7180(param_1 + 0xaf0);
          FUN_1400bdb00(param_1 + 0xac0,"twofish");
          FUN_1400d5c10(lVar5,*(undefined4 *)(param_1 + 0x6ec));
          FUN_1400d6600(lVar5,param_1 + 0xa98);
          if (*(int *)(param_1 + 0x704) == 1) {
            FUN_1400d6800();
          }
          else {
            FUN_1400d6810(lVar5);
          }
          if (*(char *)(param_1 + 0xa3c) != '\0') {
            uVar4 = FUN_1400b8b90(param_1 + 0xa40);
            FUN_1400d5bf0(lVar5,uVar4);
          }
          iVar1 = FUN_1400b8b80(param_3);
          if (iVar1 == 0) {
            FUN_1400b8b30(param_4);
            FUN_1400b9e90(param_4,param_1 + 0xa40);
            pvVar3 = operator_new(0x28);
            if (pvVar3 == (void *)0x0) {
              uVar4 = 0;
            }
            else {
              uVar4 = FUN_1400b8c40(pvVar3);
            }
          }
          else {
            uVar4 = FUN_1400d6870(lVar5,param_3,param_4,param_5);
          }
        }
      }
      else {
        if (iVar1 == 10) {
          pcVar6 = "PBES1 not supported with chunks.";
        }
        else if (iVar1 == 0xb) {
          pcVar6 = "PBES2 not supported with chunks.";
        }
        else {
          pcVar6 = "Cannot do public-key encryption in chunks.";
          if (iVar1 != 1) {
            pcVar6 = "Unrecognized encryption method";
          }
        }
        (**(code **)(*param_5 + 0x28))(param_5,pcVar6);
        uVar4 = 0;
      }
    }
  }
  return uVar4;
}



undefined8
FUN_1400b1580(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             longlong *param_5)

{
  int iVar1;
  uint uVar2;
  void *pvVar3;
  longlong lVar4;
  char *pcVar5;
  undefined8 uVar6;
  
  uVar6 = 0xfffffffffffffffe;
  if (*(int *)(param_1 + 0x6f4) == 5) {
    pvVar3 = operator_new(0x28);
    if (pvVar3 == (void *)0x0) {
      uVar6 = 0;
    }
    else {
      uVar6 = FUN_1400b8c40(pvVar3);
    }
    FUN_1400b9e90(uVar6,param_3);
  }
  else {
    iVar1 = FUN_1400b8b80(param_3);
    if (iVar1 == 0) {
      pvVar3 = operator_new(0x28);
      if (pvVar3 == (void *)0x0) {
        uVar6 = 0;
      }
      else {
        uVar6 = FUN_1400b8c40(pvVar3);
      }
    }
    else {
      iVar1 = *(int *)(param_1 + 0x6f4);
      if (iVar1 == 2) {
        lVar4 = FUN_1400d17d0(param_2);
        if (lVar4 == 0) {
          pvVar3 = operator_new(0x28);
          if (pvVar3 == (void *)0x0) {
            uVar6 = 0;
          }
          else {
            uVar6 = FUN_1400b8c40(pvVar3);
          }
        }
        else {
          uVar6 = FUN_1400e4680(lVar4,param_3,param_4,param_5);
          FUN_1400b8b30(param_4);
          uVar2 = FUN_1400b8b80(uVar6);
          if (0xf < uVar2) {
            lVar4 = FUN_1400b8b90(uVar6);
            uVar2 = FUN_1400b8b80(uVar6);
            FUN_1400b97e0(param_4,lVar4 + -0x10 + (ulonglong)uVar2,0x10);
          }
        }
      }
      else if (iVar1 == 3) {
        lVar4 = FUN_1400d1820(param_2);
        if (lVar4 == 0) {
          pvVar3 = operator_new(0x28);
          if (pvVar3 == (void *)0x0) {
            uVar6 = 0;
          }
          else {
            uVar6 = FUN_1400b8c40(pvVar3);
          }
        }
        else {
          uVar6 = FUN_1400e2010(lVar4,param_3,param_5);
        }
      }
      else if (iVar1 == 6) {
        lVar4 = FUN_1400d1870(param_2);
        if (lVar4 == 0) {
          pvVar3 = operator_new(0x28);
          if (pvVar3 == (void *)0x0) {
            uVar6 = 0;
          }
          else {
            uVar6 = FUN_1400b8c40(pvVar3);
          }
        }
        else {
          uVar6 = FUN_1400e00a0(lVar4,param_3,param_4,param_5);
        }
      }
      else if (iVar1 == 7) {
        lVar4 = FUN_1400d19b0(param_2);
        if (lVar4 == 0) {
          pvVar3 = operator_new(0x28);
          if (pvVar3 == (void *)0x0) {
            uVar6 = 0;
          }
          else {
            uVar6 = FUN_1400b8c40(pvVar3);
          }
        }
        else {
          uVar6 = FUN_1400dc570(lVar4,param_3,param_4,param_5);
        }
      }
      else if (iVar1 == 8) {
        lVar4 = FUN_1400d1910(param_2);
        if (lVar4 == 0) {
          pvVar3 = operator_new(0x28);
          if (pvVar3 == (void *)0x0) {
            uVar6 = 0;
          }
          else {
            uVar6 = FUN_1400b8c40(pvVar3);
          }
        }
        else {
          uVar6 = FUN_1400d7840(lVar4,param_3,param_4,param_5);
        }
      }
      else if (iVar1 == 9) {
        lVar4 = FUN_1400d1960(param_2);
        if (lVar4 == 0) {
          pvVar3 = operator_new(0x28);
          if (pvVar3 == (void *)0x0) {
            uVar6 = 0;
          }
          else {
            uVar6 = FUN_1400b8c40(pvVar3);
          }
        }
        else {
          uVar6 = FUN_1400d6d60(lVar4,param_3);
        }
      }
      else if (iVar1 == 4) {
        lVar4 = FUN_1400d18c0(param_2);
        if (lVar4 == 0) {
          pvVar3 = operator_new(0x28);
          if (pvVar3 == (void *)0x0) {
            uVar6 = 0;
          }
          else {
            uVar6 = FUN_1400b8c40(pvVar3);
          }
        }
        else {
          uVar6 = FUN_1400d5c50(lVar4,param_3,param_4,param_5,uVar6);
        }
      }
      else {
        if (iVar1 == 1) {
          pcVar5 = "Cannot do public-key encryption in chunks.";
        }
        else if (iVar1 == 10) {
          pcVar5 = "PBES1 not supported with chunks.";
        }
        else {
          pcVar5 = "PBES2 not supported with chunks.";
          if (iVar1 != 0xb) {
            pcVar5 = "Unrecognized encryption method";
          }
        }
        (**(code **)(*param_5 + 0x28))(param_5,pcVar5);
        uVar6 = 0;
      }
    }
  }
  return uVar6;
}



undefined8
FUN_1400b1900(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             longlong *param_5)

{
  int iVar1;
  void *pvVar2;
  longlong lVar3;
  char *pcVar4;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  if (*(int *)(param_1 + 0x6f4) == 5) {
    pvVar2 = operator_new(0x28);
    if (pvVar2 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar2);
    }
    FUN_1400b9e90(uVar5,param_3);
  }
  else {
    iVar1 = FUN_1400b8b80(param_3);
    if (iVar1 == 0) {
      pvVar2 = operator_new(0x28);
      if (pvVar2 == (void *)0x0) {
        uVar5 = 0;
      }
      else {
        uVar5 = FUN_1400b8c40(pvVar2);
      }
    }
    else {
      iVar1 = *(int *)(param_1 + 0x6f4);
      if (iVar1 == 2) {
        lVar3 = FUN_1400d17d0(param_2);
        if (lVar3 == 0) {
          pvVar2 = operator_new(0x28);
          if (pvVar2 == (void *)0x0) {
            uVar5 = 0;
          }
          else {
            uVar5 = FUN_1400b8c40(pvVar2);
          }
        }
        else {
          uVar5 = FUN_1400e4800(lVar3,param_3,param_4,param_5);
        }
      }
      else if (iVar1 == 3) {
        lVar3 = FUN_1400d1820(param_2);
        if (lVar3 == 0) {
          pvVar2 = operator_new(0x28);
          if (pvVar2 == (void *)0x0) {
            uVar5 = 0;
          }
          else {
            uVar5 = FUN_1400b8c40(pvVar2);
          }
        }
        else {
          uVar5 = FUN_1400e2110(lVar3,param_3,param_5);
        }
      }
      else if (iVar1 == 7) {
        lVar3 = FUN_1400d19b0(param_2);
        if (lVar3 == 0) {
          pvVar2 = operator_new(0x28);
          if (pvVar2 == (void *)0x0) {
            uVar5 = 0;
          }
          else {
            uVar5 = FUN_1400b8c40(pvVar2);
          }
        }
        else {
          uVar5 = FUN_1400dc810(lVar3,param_3,param_4,param_5);
        }
      }
      else if (iVar1 == 6) {
        lVar3 = FUN_1400d1870(param_2);
        if (lVar3 == 0) {
          pvVar2 = operator_new(0x28);
          if (pvVar2 == (void *)0x0) {
            uVar5 = 0;
          }
          else {
            uVar5 = FUN_1400b8c40(pvVar2);
          }
        }
        else {
          uVar5 = FUN_1400e0280(lVar3,param_3,param_4,param_5);
        }
      }
      else if (iVar1 == 8) {
        lVar3 = FUN_1400d1910(param_2);
        if (lVar3 == 0) {
          pvVar2 = operator_new(0x28);
          if (pvVar2 == (void *)0x0) {
            uVar5 = 0;
          }
          else {
            uVar5 = FUN_1400b8c40(pvVar2);
          }
        }
        else {
          uVar5 = FUN_1400d79b0(lVar3,param_3,param_4,param_5);
        }
      }
      else if (iVar1 == 9) {
        lVar3 = FUN_1400d1960(param_2);
        if (lVar3 == 0) {
          pvVar2 = operator_new(0x28);
          if (pvVar2 == (void *)0x0) {
            uVar5 = 0;
          }
          else {
            uVar5 = FUN_1400b8c40(pvVar2);
          }
        }
        else {
          uVar5 = FUN_1400d6d60(lVar3,param_3);
        }
      }
      else if (iVar1 == 4) {
        lVar3 = FUN_1400d18c0(param_2);
        if (lVar3 == 0) {
          pvVar2 = operator_new(0x28);
          if (pvVar2 == (void *)0x0) {
            uVar5 = 0;
          }
          else {
            uVar5 = FUN_1400b8c40(pvVar2);
          }
        }
        else {
          uVar5 = FUN_1400d5df0(lVar3,param_3,param_4,param_5,uVar5);
        }
      }
      else {
        if (iVar1 == 1) {
          pcVar4 = "Cannot do public-key encryption in chunks.";
        }
        else if (iVar1 == 10) {
          pcVar4 = "PBES1 not supported with chunks.";
        }
        else {
          pcVar4 = "PBES2 not supported with chunks.";
          if (iVar1 != 0xb) {
            pcVar4 = "Unrecognized encryption method";
          }
        }
        (**(code **)(*param_5 + 0x28))(param_5,pcVar4);
        uVar5 = 0;
      }
    }
  }
  return uVar5;
}



undefined8
FUN_1400b1c30(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             longlong *param_5)

{
  int iVar1;
  void *pvVar2;
  longlong lVar3;
  char *pcVar4;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  iVar1 = FUN_1400b8b80(param_3);
  if (iVar1 == 0) {
    *(undefined1 *)(param_1 + 0x70b) = 0;
    pvVar2 = operator_new(0x28);
    if (pvVar2 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar2);
    }
  }
  else {
    *(undefined1 *)(param_1 + 0x70b) = 1;
    iVar1 = *(int *)(param_1 + 0x6f4);
    if (iVar1 == 5) {
      pvVar2 = operator_new(0x28);
      if (pvVar2 == (void *)0x0) {
        uVar5 = 0;
      }
      else {
        uVar5 = FUN_1400b8c40(pvVar2);
      }
      FUN_1400b9e90(uVar5,param_3);
    }
    else if (iVar1 == 2) {
      lVar3 = FUN_1400d17d0(param_2);
      if (lVar3 == 0) {
        pvVar2 = operator_new(0x28);
        if (pvVar2 == (void *)0x0) {
          uVar5 = 0;
        }
        else {
          uVar5 = FUN_1400b8c40(pvVar2);
        }
      }
      else {
        FUN_1400b7180(param_1 + 0xaf0);
        FUN_1400bdb00(param_1 + 0xac0,"rijndael");
        FUN_1400e34a0(lVar3,*(undefined4 *)(param_1 + 0x6ec));
        if (*(int *)(param_1 + 0x704) == 1) {
          FUN_1400e3570();
        }
        else {
          FUN_1400e3580(lVar3);
        }
        FUN_1400e3500(lVar3,param_1 + 0xa98);
        if (*(char *)(param_1 + 0xa3c) != '\0') {
          uVar5 = FUN_1400b8b90(param_1 + 0xa40);
          FUN_1400e2800(lVar3,uVar5);
        }
        FUN_1400e3560(lVar3,*(undefined4 *)(param_1 + 0xa68));
        FUN_1400e34e0(lVar3,*(undefined1 *)(param_1 + 0x708));
        uVar5 = FUN_1400e4b50(lVar3,param_3,param_4,param_5);
      }
    }
    else if (iVar1 == 3) {
      lVar3 = FUN_1400d1820(param_2);
      if (lVar3 == 0) {
        pvVar2 = operator_new(0x28);
        if (pvVar2 == (void *)0x0) {
          uVar5 = 0;
        }
        else {
          uVar5 = FUN_1400b8c40(pvVar2);
        }
      }
      else {
        FUN_1400b7180(param_1 + 0xaf0);
        FUN_1400bdb00(param_1 + 0xac0,"blowfish");
        FUN_1400e0dd0(lVar3,*(undefined4 *)(param_1 + 0x6ec));
        FUN_1400e0e00(lVar3,param_1 + 0xa98);
        FUN_1400e0e30(lVar3,*(undefined4 *)(param_1 + 0xa68));
        FUN_1400e0e40(lVar3,*(undefined1 *)(param_1 + 0x708));
        uVar5 = FUN_1400e24c0(lVar3,param_3,param_5);
      }
    }
    else if (iVar1 == 7) {
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,&DAT_1402074c0);
      lVar3 = FUN_1400d19b0(param_2);
      if (lVar3 == 0) {
        pvVar2 = operator_new(0x28);
        if (pvVar2 == (void *)0x0) {
          uVar5 = 0;
        }
        else {
          uVar5 = FUN_1400b8c40(pvVar2);
        }
      }
      else {
        FUN_1400dbe50(lVar3,param_1 + 0xa98,*(undefined4 *)(param_1 + 0x6ec),param_5);
        FUN_1400dbfb0(lVar3,*(undefined4 *)(param_1 + 0xa68));
        if (*(int *)(param_1 + 0x704) == 1) {
          uVar5 = 1;
        }
        else if (*(int *)(param_1 + 0x704) == 2) {
          uVar5 = 2;
        }
        else {
          uVar5 = 0;
        }
        FUN_1400dc010(lVar3,uVar5);
        if (*(char *)(param_1 + 0xa3c) != '\0') {
          FUN_1400dbfc0(lVar3,param_1 + 0xa40);
        }
        uVar5 = FUN_1400dcd30(lVar3,param_3,param_4,param_5);
      }
    }
    else if (iVar1 == 6) {
      lVar3 = FUN_1400d1870(param_2);
      if (lVar3 == 0) {
        pvVar2 = operator_new(0x28);
        if (pvVar2 == (void *)0x0) {
          uVar5 = 0;
        }
        else {
          uVar5 = FUN_1400b8c40(pvVar2);
        }
      }
      else {
        FUN_1400b7180(param_1 + 0xaf0);
        FUN_1400bdb00(param_1 + 0xac0,"blowfish2");
        FUN_1400dd3d0(lVar3,*(undefined4 *)(param_1 + 0x6ec));
        FUN_1400dd4f0(lVar3,param_1 + 0xa98);
        FUN_1400dd400(lVar3,*(undefined4 *)(param_1 + 0xa68));
        if (*(int *)(param_1 + 0x704) == 1) {
          FUN_1400dd410();
        }
        else if (*(int *)(param_1 + 0x704) == 2) {
          FUN_1400dd430();
        }
        else {
          FUN_1400dd420(lVar3);
        }
        if (*(char *)(param_1 + 0xa3c) != '\0') {
          uVar5 = FUN_1400b8b90(param_1 + 0xa40);
          FUN_1400dd440(lVar3,uVar5);
        }
        uVar5 = FUN_1400e0850(lVar3,param_3,param_4,param_5);
      }
    }
    else if (iVar1 == 8) {
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,&DAT_140207694);
      lVar3 = FUN_1400d1910(param_2);
      if (lVar3 == 0) {
        pvVar2 = operator_new(0x28);
        if (pvVar2 == (void *)0x0) {
          uVar5 = 0;
        }
        else {
          uVar5 = FUN_1400b8c40(pvVar2);
        }
      }
      else {
        FUN_1400d7b90(lVar3,param_1 + 0xa98,
                      (int)((*(int *)(param_1 + 0x6ec) >> 0x1f & 7U) + *(int *)(param_1 + 0x6ec)) >>
                      3,*(undefined4 *)(param_1 + 0x6f0),uVar5);
        FUN_1400d6f90(lVar3,*(undefined4 *)(param_1 + 0xa68));
        FUN_1400d6fe0(lVar3,*(int *)(param_1 + 0x704) == 1);
        if (*(char *)(param_1 + 0xa3c) != '\0') {
          FUN_1400d6fa0(lVar3,param_1 + 0xa40);
        }
        uVar5 = FUN_1400d81c0(lVar3,param_3,param_4,param_5);
      }
    }
    else if (iVar1 == 9) {
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,&DAT_14020768c);
      lVar3 = FUN_1400d1960(param_2);
      if (lVar3 == 0) {
        pvVar2 = operator_new(0x28);
        if (pvVar2 == (void *)0x0) {
          uVar5 = 0;
        }
        else {
          uVar5 = FUN_1400b8c40(pvVar2);
        }
      }
      else {
        FUN_1400d6ed0(lVar3,param_1 + 0xa98,
                      (int)((*(int *)(param_1 + 0x6ec) >> 0x1f & 7U) + *(int *)(param_1 + 0x6ec)) >>
                      3);
        if (*(char *)(param_1 + 0xcd0) != '\0') {
          FUN_1400d6e60(lVar3);
        }
        uVar5 = FUN_1400d6d60(lVar3,param_3);
      }
    }
    else if (iVar1 == 4) {
      lVar3 = FUN_1400d18c0(param_2);
      if (lVar3 == 0) {
        pvVar2 = operator_new(0x28);
        if (pvVar2 == (void *)0x0) {
          uVar5 = 0;
        }
        else {
          uVar5 = FUN_1400b8c40(pvVar2);
        }
      }
      else {
        FUN_1400b7180(param_1 + 0xaf0);
        FUN_1400bdb00(param_1 + 0xac0,"twofish");
        FUN_1400d6640(lVar3,*(undefined1 *)(param_1 + 0x708));
        FUN_1400d5c10(lVar3,*(undefined4 *)(param_1 + 0x6ec));
        FUN_1400d6600(lVar3,param_1 + 0xa98);
        if (*(int *)(param_1 + 0x704) == 1) {
          FUN_1400d6800();
        }
        else {
          FUN_1400d6810(lVar3);
        }
        if (*(char *)(param_1 + 0xa3c) != '\0') {
          uVar5 = FUN_1400b8b90(param_1 + 0xa40);
          FUN_1400d5bf0(lVar3,uVar5);
        }
        FUN_1400d62e0(lVar3,*(undefined4 *)(param_1 + 0xa68));
        uVar5 = FUN_1400d6a10(lVar3,param_3,param_4,param_5);
      }
    }
    else {
      if (iVar1 == 10) {
        pcVar4 = "PBES1 not supported with chunks.";
      }
      else {
        pcVar4 = "PBES2 not supported with chunks.";
        if (iVar1 != 0xb) {
          pcVar4 = "Algorithm ID is unrecognized";
        }
      }
      (**(code **)(*param_5 + 0x28))(param_5,pcVar4);
      uVar5 = 0;
    }
  }
  return uVar5;
}



undefined8
FUN_1400b2300(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             longlong *param_5)

{
  int iVar1;
  void *pvVar2;
  undefined8 uVar3;
  longlong lVar4;
  char *pcVar5;
  
  iVar1 = *(int *)(param_1 + 0x6f4);
  if (iVar1 == 5) {
    pvVar2 = operator_new(0x28);
    if (pvVar2 == (void *)0x0) {
      uVar3 = 0;
    }
    else {
      uVar3 = FUN_1400b8c40(pvVar2);
    }
    FUN_1400b9e90(uVar3,param_3);
  }
  else if (iVar1 == 2) {
    lVar4 = FUN_1400d17d0(param_2);
    if (lVar4 == 0) {
      pvVar2 = operator_new(0x28);
      if (pvVar2 == (void *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = FUN_1400b8c40(pvVar2);
      }
    }
    else {
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,"rijndael");
      FUN_1400e34a0(lVar4,*(undefined4 *)(param_1 + 0x6ec));
      if (*(int *)(param_1 + 0x704) == 1) {
        FUN_1400e3570();
      }
      else {
        FUN_1400e3580(lVar4);
      }
      FUN_1400e3500(lVar4,param_1 + 0xa98);
      if (*(char *)(param_1 + 0xa3c) != '\0') {
        uVar3 = FUN_1400b8b90(param_1 + 0xa40);
        FUN_1400e2800(lVar4,uVar3);
      }
      FUN_1400e3560(lVar4,*(undefined4 *)(param_1 + 0xa68));
      FUN_1400e34e0(lVar4,*(undefined1 *)(param_1 + 0x708));
      uVar3 = FUN_1400e4cd0(lVar4,param_3,param_4,param_5);
    }
  }
  else if (iVar1 == 3) {
    lVar4 = FUN_1400d1820(param_2);
    if (lVar4 == 0) {
      pvVar2 = operator_new(0x28);
      if (pvVar2 == (void *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = FUN_1400b8c40(pvVar2);
      }
    }
    else {
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,"blowfish");
      FUN_1400e0dd0(lVar4,*(undefined4 *)(param_1 + 0x6ec));
      FUN_1400e0e00(lVar4,param_1 + 0xa98);
      FUN_1400e0e30(lVar4,*(undefined4 *)(param_1 + 0xa68));
      FUN_1400e0e40(lVar4,*(undefined1 *)(param_1 + 0x708));
      uVar3 = FUN_1400e25d0(lVar4,param_3,param_5);
    }
  }
  else if (iVar1 == 6) {
    lVar4 = FUN_1400d1870(param_2);
    if (lVar4 == 0) {
      pvVar2 = operator_new(0x28);
      if (pvVar2 == (void *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = FUN_1400b8c40(pvVar2);
      }
    }
    else {
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,"blowfish2");
      FUN_1400dd3d0(lVar4,*(undefined4 *)(param_1 + 0x6ec));
      FUN_1400dd4f0(lVar4,param_1 + 0xa98);
      FUN_1400dd400(lVar4,*(undefined4 *)(param_1 + 0xa68));
      if (*(int *)(param_1 + 0x704) == 1) {
        FUN_1400dd410();
      }
      else if (*(int *)(param_1 + 0x704) == 2) {
        FUN_1400dd430();
      }
      else {
        FUN_1400dd420(lVar4);
      }
      uVar3 = FUN_1400e0a30(lVar4,param_3,param_4,param_5);
    }
  }
  else if (iVar1 == 7) {
    lVar4 = FUN_1400d19b0(param_2);
    if (lVar4 == 0) {
      pvVar2 = operator_new(0x28);
      if (pvVar2 == (void *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = FUN_1400b8c40(pvVar2);
      }
    }
    else {
      uVar3 = FUN_1400dcf80(lVar4,param_3,param_4,param_5);
    }
  }
  else if (iVar1 == 8) {
    lVar4 = FUN_1400d1910(param_2);
    if (lVar4 == 0) {
      pvVar2 = operator_new(0x28);
      if (pvVar2 == (void *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = FUN_1400b8c40(pvVar2);
      }
    }
    else {
      uVar3 = FUN_1400d8300(lVar4,param_3,param_4,param_5);
    }
  }
  else if (iVar1 == 9) {
    lVar4 = FUN_1400d1960(param_2);
    if (lVar4 == 0) {
      pvVar2 = operator_new(0x28);
      if (pvVar2 == (void *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = FUN_1400b8c40(pvVar2);
      }
    }
    else {
      uVar3 = FUN_1400d6d60(lVar4,param_3);
    }
  }
  else if (iVar1 == 4) {
    lVar4 = FUN_1400d18c0(param_2);
    if (lVar4 == 0) {
      pvVar2 = operator_new(0x28);
      if (pvVar2 == (void *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = FUN_1400b8c40(pvVar2);
      }
    }
    else {
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,"twofish");
      FUN_1400d6640(lVar4,*(undefined1 *)(param_1 + 0x708));
      FUN_1400d5c10(lVar4,*(undefined4 *)(param_1 + 0x6ec));
      FUN_1400d6600(lVar4,param_1 + 0xa98);
      if (*(int *)(param_1 + 0x704) == 1) {
        FUN_1400d6800();
      }
      else {
        FUN_1400d6810(lVar4);
      }
      if (*(char *)(param_1 + 0xa3c) != '\0') {
        uVar3 = FUN_1400b8b90(param_1 + 0xa40);
        FUN_1400d5bf0(lVar4,uVar3);
      }
      FUN_1400d62e0(lVar4,*(undefined4 *)(param_1 + 0xa68));
      uVar3 = FUN_1400d5fb0(lVar4,param_3,param_4,param_5);
    }
  }
  else {
    if (iVar1 == 10) {
      pcVar5 = "PBES1 not supported with chunks.";
    }
    else {
      pcVar5 = "PBES2 not supported with chunks.";
      if (iVar1 != 0xb) {
        pcVar5 = "Algorithm ID is unrecognized";
      }
    }
    (**(code **)(*param_5 + 0x28))(param_5,pcVar5,param_3,param_4,0xfffffffffffffffe);
    uVar3 = 0;
  }
  return uVar3;
}



undefined8
FUN_1400b27f0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             longlong *param_5)

{
  int iVar1;
  void *pvVar2;
  undefined8 uVar3;
  longlong lVar4;
  char *pcVar5;
  
  iVar1 = *(int *)(param_1 + 0x6f4);
  if (iVar1 == 5) {
    pvVar2 = operator_new(0x28);
    if (pvVar2 == (void *)0x0) {
      uVar3 = 0;
    }
    else {
      uVar3 = FUN_1400b8c40(pvVar2);
    }
    FUN_1400b9e90(uVar3,param_3);
  }
  else if (iVar1 == 2) {
    lVar4 = FUN_1400d17d0(param_2);
    if (lVar4 == 0) {
      pvVar2 = operator_new(0x28);
      if (pvVar2 == (void *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = FUN_1400b8c40(pvVar2);
      }
    }
    else {
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,"rijndael");
      FUN_1400e34a0(lVar4,*(undefined4 *)(param_1 + 0x6ec));
      if (*(int *)(param_1 + 0x704) == 1) {
        FUN_1400e3570();
      }
      else {
        FUN_1400e3580(lVar4);
      }
      FUN_1400e3500(lVar4,param_1 + 0xa98);
      if (*(char *)(param_1 + 0xa3c) != '\0') {
        uVar3 = FUN_1400b8b90(param_1 + 0xa40);
        FUN_1400e2800(lVar4,uVar3);
      }
      FUN_1400e3560(lVar4,*(undefined4 *)(param_1 + 0xa68));
      FUN_1400e34e0(lVar4,*(undefined1 *)(param_1 + 0x708));
      uVar3 = FUN_1400e4e40(lVar4,param_3,param_4,param_5);
    }
  }
  else if (iVar1 == 7) {
    lVar4 = FUN_1400d19b0(param_2);
    if (lVar4 == 0) {
      pvVar2 = operator_new(0x28);
      if (pvVar2 == (void *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = FUN_1400b8c40(pvVar2);
      }
    }
    else {
      uVar3 = FUN_1400dd180(lVar4,param_3,param_4,param_5);
    }
  }
  else if (iVar1 == 3) {
    lVar4 = FUN_1400d1820(param_2);
    if (lVar4 == 0) {
      pvVar2 = operator_new(0x28);
      if (pvVar2 == (void *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = FUN_1400b8c40(pvVar2);
      }
    }
    else {
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,"blowfish");
      FUN_1400e0dd0(lVar4,*(undefined4 *)(param_1 + 0x6ec));
      FUN_1400e0e00(lVar4,param_1 + 0xa98);
      FUN_1400e0e30(lVar4,*(undefined4 *)(param_1 + 0xa68));
      FUN_1400e0e40(lVar4,*(undefined1 *)(param_1 + 0x708));
      uVar3 = FUN_1400e26d0(lVar4,param_3,param_5);
    }
  }
  else if (iVar1 == 6) {
    lVar4 = FUN_1400d1870(param_2);
    if (lVar4 == 0) {
      pvVar2 = operator_new(0x28);
      if (pvVar2 == (void *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = FUN_1400b8c40(pvVar2);
      }
    }
    else {
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,"blowfish2");
      FUN_1400dd3d0(lVar4,*(undefined4 *)(param_1 + 0x6ec));
      FUN_1400dd4f0(lVar4,param_1 + 0xa98);
      FUN_1400dd400(lVar4,*(undefined4 *)(param_1 + 0xa68));
      if (*(int *)(param_1 + 0x704) == 1) {
        FUN_1400dd410();
      }
      else if (*(int *)(param_1 + 0x704) == 2) {
        FUN_1400dd430();
      }
      else {
        FUN_1400dd420(lVar4);
      }
      uVar3 = FUN_1400e0bf0(lVar4,param_3,param_4,param_5);
    }
  }
  else if (iVar1 == 8) {
    lVar4 = FUN_1400d1910(param_2);
    if (lVar4 == 0) {
      pvVar2 = operator_new(0x28);
      if (pvVar2 == (void *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = FUN_1400b8c40(pvVar2);
      }
    }
    else {
      uVar3 = FUN_1400d8440(lVar4,param_3,param_4,param_5);
    }
  }
  else if (iVar1 == 9) {
    lVar4 = FUN_1400d1960(param_2);
    if (lVar4 == 0) {
      pvVar2 = operator_new(0x28);
      if (pvVar2 == (void *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = FUN_1400b8c40(pvVar2);
      }
    }
    else {
      uVar3 = FUN_1400d6d60(lVar4,param_3);
    }
  }
  else if (iVar1 == 4) {
    lVar4 = FUN_1400d18c0(param_2);
    if (lVar4 == 0) {
      pvVar2 = operator_new(0x28);
      if (pvVar2 == (void *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = FUN_1400b8c40(pvVar2);
      }
    }
    else {
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,"twofish");
      FUN_1400d6640(lVar4,*(undefined1 *)(param_1 + 0x708));
      FUN_1400d5c10(lVar4,*(undefined4 *)(param_1 + 0x6ec));
      FUN_1400d6600(lVar4,param_1 + 0xa98);
      if (*(int *)(param_1 + 0x704) == 1) {
        FUN_1400d6800();
      }
      else {
        FUN_1400d6810(lVar4);
      }
      if (*(char *)(param_1 + 0xa3c) != '\0') {
        uVar3 = FUN_1400b8b90(param_1 + 0xa40);
        FUN_1400d5bf0(lVar4,uVar3);
      }
      FUN_1400d62e0(lVar4,*(undefined4 *)(param_1 + 0xa68));
      uVar3 = FUN_1400d6140(lVar4,param_3,param_4,param_5);
    }
  }
  else {
    if (iVar1 == 10) {
      pcVar5 = "PBES1 not supported with chunks.";
    }
    else {
      pcVar5 = "PBES2 not supported with chunks.";
      if (iVar1 != 0xb) {
        pcVar5 = "Algorithm ID is unrecognized";
      }
    }
    (**(code **)(*param_5 + 0x28))(param_5,pcVar5,param_3,param_4,0xfffffffffffffffe);
    uVar3 = 0;
  }
  return uVar3;
}



undefined8 * FUN_1400b2ce0(longlong param_1,undefined8 param_2,longlong *param_3,undefined1 param_4)

{
  longlong lVar1;
  undefined8 *puVar2;
  char cVar3;
  char cVar4;
  int iVar5;
  undefined4 uVar6;
  longlong lVar7;
  undefined8 uVar8;
  undefined8 *puVar9;
  char local_res8 [8];
  void *local_res18 [2];
  undefined1 local_318;
  undefined1 local_317 [7];
  longlong local_310;
  undefined1 local_308 [40];
  undefined1 local_2e0 [40];
  undefined1 local_2b8 [48];
  undefined1 local_288 [48];
  undefined8 local_258;
  undefined1 local_248 [160];
  undefined1 local_1a8 [160];
  undefined1 local_108 [208];
  
  local_258 = 0xfffffffffffffffe;
  (**(code **)(*param_3 + 0x58))(param_3,"algorithm",&DAT_140207430);
  FUN_1400b7180(param_1 + 0xaf0);
  FUN_1400bdb00(param_1 + 0xac0,&DAT_140207430);
  FUN_1400b8c40(local_308);
  FUN_1400bcc20(local_2b8);
  FUN_1400bcc20(local_288);
  local_res8[0] = '\0';
  if (*(longlong *)(param_1 + 0x898) != 0) {
    (**(code **)(*param_3 + 0x30))(param_3,"Using specific decrypt certificate.");
    lVar7 = FUN_1400ec6e0(*(undefined8 *)(param_1 + 0x898));
    if (lVar7 == 0) {
      (**(code **)(*param_3 + 0x28))(param_3,"Decrypt certificate is null");
      FUN_1400bceb0(local_288);
      FUN_1400bceb0(local_2b8);
      FUN_1400b92d0(local_308);
      return (undefined8 *)0x0;
    }
    FUN_1400b6fd0(local_1a8);
    FUN_1400ecf20(lVar7,local_1a8,param_3);
    lVar1 = *param_3;
    uVar8 = FUN_1400b7ce0(local_1a8);
    (**(code **)(lVar1 + 0x58))(param_3,"certSerialNumber",uVar8);
    uVar8 = FUN_1400b7ce0(local_1a8);
    FUN_1400bc640(local_2b8,uVar8);
    FUN_1400b6fd0(local_248);
    FUN_1400ecd90(lVar7,&DAT_140207978,local_248,param_3);
    lVar1 = *param_3;
    uVar8 = FUN_1400b7ce0(local_248);
    (**(code **)(lVar1 + 0x58))(param_3,"certIssuerCN",uVar8);
    uVar8 = FUN_1400b7ce0(local_248);
    FUN_1400bc640(local_288,uVar8);
    iVar5 = FUN_1400b8b80(param_1 + 0x8a0);
    if (iVar5 == 0) {
      (**(code **)(*param_3 + 0x30))(param_3,"Getting pre-installed private key.");
      cVar3 = FUN_1400ed2c0(lVar7,local_308,local_res8,1,param_3);
      if ((cVar3 == '\0') && (local_res8[0] == '\0')) {
        (**(code **)(*param_3 + 0x28))(param_3,"Certificate does not have a private key installed.")
        ;
        FUN_1400b7090(local_248);
        FUN_1400b7090(local_1a8);
        FUN_1400bceb0(local_288);
        FUN_1400bceb0(local_2b8);
        FUN_1400b92d0(local_308);
        return (undefined8 *)0x0;
      }
    }
    else {
      (**(code **)(*param_3 + 0x30))(param_3,"Using pre-specified private key.");
      FUN_1400b9e90(local_308,param_1 + 0x8a0);
    }
    FUN_1400b7090(local_248);
    FUN_1400b7090(local_1a8);
  }
  local_res18[0] = operator_new(0x28);
  if (local_res18[0] == (void *)0x0) {
    puVar9 = (undefined8 *)0x0;
  }
  else {
    puVar9 = (undefined8 *)FUN_1400b8c40(local_res18[0]);
  }
  local_310 = 0;
  local_317[0] = 0;
  FUN_1400e7290(local_108);
  if ((local_res8[0] == '\0') &&
     (cVar3 = FUN_1400ec550(local_108,param_2,0,local_317,param_3,*(undefined1 *)(param_1 + 0x6b0)),
     cVar3 == '\0')) {
    cVar3 = '\0';
    (**(code **)(*param_3 + 0x28))(param_3,"Not PKCS7 DER");
    goto LAB_1400b3176;
  }
  FUN_1400b8c40(local_2e0);
  if (*(longlong *)(param_1 + 0x898) == 0) {
    (**(code **)(*param_3 + 0x30))
              (param_3,
               "Will search for matching PFX and pre-installed certificates for PKCS7 unenvelope.");
    local_res18[0] = (void *)((ulonglong)local_res18[0] & 0xffffffffffffff00);
    local_318 = 0;
    cVar3 = FUN_1400ec470(local_108,param_1 + 0x658,puVar9,local_2e0,local_res18,&local_318,param_3,
                          param_4);
    if (cVar3 == '\0') {
      if (((char)local_res18[0] == '\0') || (cVar4 = FUN_1400bec30(param_1 + 0x3f8), cVar4 == '\0'))
      goto LAB_1400b3116;
      goto LAB_1400b30ea;
    }
  }
  else {
    (**(code **)(*param_3 + 0x30))(param_3,"Using pre-specified certificate for PKCS7 unenvelope.");
    if ((local_res8[0] == '\0') || (cVar3 = FUN_1400bec30(param_1 + 0x3f8), cVar3 == '\0')) {
      cVar3 = FUN_1400ebef0(local_108,local_2b8,local_288,local_308,puVar9,param_3,param_4);
      if (cVar3 != '\0') {
        lVar7 = FUN_1400ec6e0(*(undefined8 *)(param_1 + 0x898));
        if (lVar7 != 0) {
          local_310 = FUN_1400ecb90(lVar7);
        }
        goto LAB_1400b3111;
      }
    }
    else {
LAB_1400b30ea:
      (**(code **)(*param_3 + 0x30))
                (param_3,"Decrypting using CryptoAPI to avoid private key export");
      cVar3 = FUN_1400edde0(param_2,puVar9,&local_310,param_3);
LAB_1400b3111:
      if (cVar3 != '\0') goto LAB_1400b3126;
    }
LAB_1400b3116:
    (**(code **)(*param_3 + 0x28))(param_3,"Failed to unenvelope PKCS7 message");
  }
LAB_1400b3126:
  if ((local_310 == 0) && (iVar5 = FUN_1400b8b80(local_2e0), iVar5 != 0)) {
    uVar6 = FUN_1400b8b80(local_2e0);
    uVar8 = FUN_1400b8b90(local_2e0);
    local_310 = FUN_1400ecad0(uVar8,uVar6,param_3,*(undefined1 *)(param_1 + 0x6b0));
  }
  FUN_1400b92d0(local_2e0);
LAB_1400b3176:
  if (local_310 != 0) {
    FUN_1400b7180(param_1 + 0xaf0);
    FUN_1400ecc50(local_310,param_1 + 0xaf0,param_3);
    FUN_1400bdb00(param_1 + 0xac0,&DAT_140207430);
    puVar2 = *(undefined8 **)(param_1 + 0x8c8);
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
      *(undefined8 *)(param_1 + 0x8c8) = 0;
    }
    local_res18[0] = operator_new(0x170);
    uVar8 = 0;
    if (local_res18[0] != (void *)0x0) {
      uVar8 = FUN_1400ec6f0(local_res18[0],local_310,0,0);
    }
    *(undefined8 *)(param_1 + 0x8c8) = uVar8;
  }
  if (cVar3 == '\0') {
    if (puVar9 != (undefined8 *)0x0) {
      (**(code **)*puVar9)(puVar9,1);
    }
    puVar9 = (undefined8 *)0x0;
  }
  FUN_1400e9480(local_108);
  FUN_1400bceb0(local_288);
  FUN_1400bceb0(local_2b8);
  FUN_1400b92d0(local_308);
  return puVar9;
}



undefined8 FUN_1400b3270(longlong param_1)

{
  longlong lVar1;
  char cVar2;
  undefined8 uVar3;
  undefined1 local_c8 [16];
  undefined1 local_b8 [48];
  undefined8 local_88;
  undefined1 local_78 [112];
  
  local_88 = 0xfffffffffffffffe;
  if (DAT_140316458 == '\0') {
    FUN_1400bcc20(local_b8);
    FUN_1400f0d10(local_c8);
    FUN_1400f3060(local_c8,local_b8,PTR_s_VHJpYWwgUGVyaW9kIEV4cGlyZWQ__1402f86a8);
    lVar1 = *(longlong *)(param_1 + 0x408);
    uVar3 = FUN_1400b8b90(local_b8);
    (**(code **)(lVar1 + 0x28))(param_1 + 0x408,uVar3);
    (**(code **)(*(longlong *)(param_1 + 0x408) + 0x50))(param_1 + 0x408);
    FUN_1400d1290(param_1 + 0x3c8);
    FUN_1400f0d30(local_c8);
    FUN_1400bceb0(local_b8);
    uVar3 = 0;
  }
  else {
    if (DAT_1402f86a0 != '\0') {
      FUN_1400ef8e0(local_78);
      FUN_1400efcc0(local_78,"ChilkatCrypt");
      cVar2 = FUN_1400f0ca0(local_78,param_1 + 0x408);
      if (cVar2 == '\0') {
        FUN_1400bcc20(local_b8);
        FUN_1400f0d10(local_c8);
        FUN_1400f3060(local_c8,local_b8,PTR_s_MzAtRGF5IFRyaWFsIEV4cGlyZWQ__1402f86b0);
        lVar1 = *(longlong *)(param_1 + 0x408);
        uVar3 = FUN_1400b8b90(local_b8);
        (**(code **)(lVar1 + 0x28))(param_1 + 0x408,uVar3);
        (**(code **)(*(longlong *)(param_1 + 0x408) + 0x50))(param_1 + 0x408);
        FUN_1400d1290(param_1 + 0x3c8);
        FUN_1400f0d30(local_c8);
        FUN_1400bceb0(local_b8);
        FUN_1400ef960(local_78);
        return 0;
      }
      FUN_1400ef960(local_78);
    }
    uVar3 = 1;
  }
  return uVar3;
}



void FUN_1400b3420(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x6f4) = param_2;
  return;
}



undefined4 FUN_1400b3430(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x6f4);
}



void FUN_1400b3440(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  undefined1 local_40 [56];
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1400d1280(param_1 + 0x3c8);
  FUN_1400bcc20(local_40);
  FUN_1400bc640(local_40,param_2,param_3,param_4,uVar2);
  FUN_1400bdd00(local_40,0x2d);
  FUN_1400bbc30(local_40);
  FUN_1400bd760(local_40);
  FUN_1400bdc90(param_1 + 0x6b8,local_40);
  uVar1 = FUN_1400f3170(param_2);
  *(undefined4 *)(param_1 + 0x6f4) = uVar1;
  FUN_1400d1290(param_1 + 0x3c8);
  FUN_1400bceb0(local_40);
  return;
}



void FUN_1400b34f0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  char cVar2;
  int iVar3;
  undefined8 uVar4;
  undefined1 local_40 [56];
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400d1280(param_1 + 0x3c8);
  FUN_1400bcc20(local_40);
  uVar1 = FUN_1400b7ce0(param_2);
  FUN_1400bc640(local_40,uVar1,param_3,param_4,uVar4);
  FUN_1400bdd00(local_40,0x2d);
  FUN_1400bdd00(local_40,0x20);
  FUN_1400bbc30(local_40);
  FUN_1400bd760(local_40);
  cVar2 = FUN_1400bc7e0(local_40,&DAT_140207a98);
  if (cVar2 == '\0') {
    cVar2 = FUN_1400bdf70(local_40,&DAT_140207a6c);
    iVar3 = (cVar2 != '\0') + 1;
  }
  else {
    iVar3 = 0;
  }
  *(int *)(param_1 + 0x704) = iVar3;
  FUN_1400d1290(param_1 + 0x3c8);
  FUN_1400bceb0(local_40);
  return;
}



void FUN_1400b35d0(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x6f0) = param_2;
  return;
}



void FUN_1400b35e0(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x6ec) = param_2;
  return;
}



void FUN_1400b35f0(longlong param_1,undefined8 param_2)

{
  undefined8 uVar1;
  uint uVar2;
  undefined4 uVar3;
  
  FUN_1400d1280(param_1 + 0x3c8);
  FUN_1400b8b30(param_1 + 0xa40);
  uVar2 = FUN_1400b8b80(param_2);
  if (uVar2 < 0x10) {
    uVar3 = FUN_1400b8b80(param_2);
    uVar1 = FUN_1400b8b90(param_2);
    FUN_1400b97e0(param_1 + 0xa40,uVar1,uVar3);
  }
  else {
    uVar1 = FUN_1400b8b90();
    FUN_1400b97e0(param_1 + 0xa40,uVar1,0x10);
  }
  *(undefined1 *)(param_1 + 0xa3c) = 1;
  FUN_1400d1290(param_1 + 0x3c8);
  return;
}



undefined8 FUN_1400b36b0(int param_1,int param_2,longlong param_3,longlong *param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  
  if (param_1 == 2) {
    lVar1 = param_3 + 0x10;
    if (param_2 < 0x81) {
      FUN_1400bdb00(lVar1,"2.16.840.1.101.3.4.1.2");
      *(undefined4 *)(param_3 + 0x98) = 0x80;
    }
    else if (param_2 < 0xc1) {
      FUN_1400bdb00(lVar1,"2.16.840.1.101.3.4.1.22");
      *(undefined4 *)(param_3 + 0x98) = 0xc0;
    }
    else {
      FUN_1400bdb00(lVar1,"2.16.840.1.101.3.4.1.42");
      *(undefined4 *)(param_3 + 0x98) = 0x100;
    }
    FUN_1400b8b30(param_3 + 0x40);
    *(undefined4 *)(param_3 + 0x68) = 0;
    FUN_1400b8b30(param_3 + 0x70);
    FUN_1400c0600(0x10,param_3 + 0x70);
    uVar2 = 1;
  }
  else if (param_1 == 7) {
    if (param_2 < 0x29) {
      FUN_1400bdb00(param_3 + 0x10,"1.3.14.3.2.7");
      *(undefined4 *)(param_3 + 0x98) = 0x28;
    }
    else {
      FUN_1400bdb00(param_3 + 0x10,"1.2.840.113549.3.7");
      *(undefined4 *)(param_3 + 0x98) = 0xc0;
    }
    FUN_1400b8b30(param_3 + 0x40);
    *(undefined4 *)(param_3 + 0x68) = 0;
    FUN_1400b8b30(param_3 + 0x70);
    FUN_1400c0600(8,param_3 + 0x70);
    uVar2 = 1;
  }
  else if (param_1 == 8) {
    FUN_1400bdb00(param_3 + 0x10,"1.2.840.113549.3.2");
    *(int *)(param_3 + 0x98) = param_2;
    FUN_1400b8b30(param_3 + 0x40);
    *(undefined4 *)(param_3 + 0x68) = 0;
    FUN_1400b8b30(param_3 + 0x70);
    FUN_1400c0600(8,param_3 + 0x70);
    uVar2 = 1;
  }
  else if (param_1 == 9) {
    FUN_1400bdb00(param_3 + 0x10,"1.2.840.113549.3.4");
    *(int *)(param_3 + 0x98) = param_2;
    FUN_1400b8b30(param_3 + 0x40);
    *(undefined4 *)(param_3 + 0x68) = 0;
    FUN_1400b8b30(param_3 + 0x70);
    uVar2 = 1;
  }
  else {
    (**(code **)(*param_4 + 0x28))(param_4,"Unsupported encryption algorithm for PKCS7.");
    FUN_1400cf520(param_4,"encryptionAlgId",param_1);
    uVar2 = 0;
  }
  return uVar2;
}



undefined8 FUN_1400b3880(longlong param_1,longlong param_2,longlong *param_3)

{
  longlong lVar1;
  char cVar2;
  undefined8 uVar3;
  undefined *puVar4;
  
  cVar2 = FUN_1400bdf70(param_2 + 0x10,"1.2.840.113549.3.2");
  if (cVar2 == '\0') {
    cVar2 = FUN_1400bdf70(param_2 + 0x10,"2.16.840.1.101.3.4.1.2");
    if (cVar2 == '\0') {
      cVar2 = FUN_1400bdf70(param_2 + 0x10,"2.16.840.1.101.3.4.1.22");
      if (cVar2 == '\0') {
        cVar2 = FUN_1400bdf70(param_2 + 0x10,"2.16.840.1.101.3.4.1.42");
        if (cVar2 != '\0') {
          *(undefined4 *)(param_1 + 0x704) = 0;
          FUN_1400b3440(param_1,&DAT_1402749b8);
          *(undefined4 *)(param_1 + 0x6ec) = 0x100;
          FUN_1400b35f0(param_1,param_2 + 0x70);
          return 1;
        }
        cVar2 = FUN_1400bdf70(param_2 + 0x10,"1.2.840.113549.3.7");
        if (cVar2 == '\0') {
          cVar2 = FUN_1400bdf70(param_2 + 0x10,"1.3.14.3.2.7");
          if (cVar2 != '\0') {
            *(undefined4 *)(param_1 + 0x704) = 0;
            FUN_1400b3440(param_1,&DAT_1402074c0);
            *(undefined4 *)(param_1 + 0x6ec) = 0x28;
            FUN_1400b35f0(param_1,param_2 + 0x70);
            return 1;
          }
          cVar2 = FUN_1400bdf70(param_2 + 0x10,"1.2.840.113549.3.4");
          if (cVar2 != '\0') {
            *(undefined4 *)(param_1 + 0x704) = 0;
            FUN_1400b3440(param_1,&DAT_14020768c);
            *(undefined4 *)(param_1 + 0x6ec) = *(undefined4 *)(param_2 + 0x98);
            return 1;
          }
          (**(code **)(*param_3 + 0x28))
                    (param_3,"Unrecognized OID for symmetric encryption algorithm.");
          lVar1 = *param_3;
          uVar3 = FUN_1400b8b90(param_2 + 0x10);
          (**(code **)(lVar1 + 0x58))(param_3,&DAT_140207ba0,uVar3);
          return 0;
        }
        puVar4 = &DAT_1402074c0;
      }
      else {
        puVar4 = &DAT_1402749b8;
      }
      *(undefined4 *)(param_1 + 0x704) = 0;
      FUN_1400b3440(param_1,puVar4);
      *(undefined4 *)(param_1 + 0x6ec) = 0xc0;
      FUN_1400b35f0(param_1,param_2 + 0x70);
    }
    else {
      *(undefined4 *)(param_1 + 0x704) = 0;
      FUN_1400b3440(param_1,&DAT_1402749b8);
      *(undefined4 *)(param_1 + 0x6ec) = 0x80;
      FUN_1400b35f0(param_1,param_2 + 0x70);
    }
  }
  else {
    *(undefined4 *)(param_1 + 0x704) = 0;
    FUN_1400b3440(param_1,&DAT_140207694);
    *(undefined4 *)(param_1 + 0x6ec) = *(undefined4 *)(param_2 + 0x98);
    FUN_1400b35f0(param_1,param_2 + 0x70);
    *(undefined4 *)(param_1 + 0x6f0) = *(undefined4 *)(param_2 + 0x98);
  }
  return 1;
}



void FUN_1400b3ac0(longlong param_1)

{
  FUN_1400b3e00(param_1 + -0x3c8);
  return;
}



void FUN_1400b3ad0(longlong param_1)

{
  FUN_1400b3e00(param_1 + -0x370);
  return;
}



void FUN_1400b3ae0(longlong param_1)

{
  FUN_1400b3e00(param_1 + -0x180);
  return;
}



void FUN_1400b3af0(longlong param_1)

{
  FUN_1400b3e00(param_1 + -0x3f8);
  return;
}



void FUN_1400b3b00(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  longlong lVar1;
  int iVar2;
  uint uVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined1 local_40 [40];
  
  FUN_1400d1280(param_1 + 0x3c8);
  FUN_1400b0050(param_1 + 0x3f8,"SetEncodedKey");
  lVar1 = *(longlong *)(param_1 + 0x408);
  uVar5 = FUN_1400b7ce0(param_2);
  (**(code **)(lVar1 + 0x58))(param_1 + 0x408,"keyStr",uVar5);
  lVar1 = *(longlong *)(param_1 + 0x408);
  uVar5 = FUN_1400b7ce0(param_3);
  (**(code **)(lVar1 + 0x58))(param_1 + 0x408,"encoding",uVar5);
  FUN_1400b8c40(local_40);
  FUN_1400bb720(param_1,param_2,param_3,local_40,0);
  iVar2 = FUN_1400b8b80(local_40);
  if (iVar2 == 0) {
    (**(code **)(*(longlong *)(param_1 + 0x408) + 0x30))
              (param_1 + 0x408,"Key not set, no data provided.");
  }
  else {
    uVar3 = FUN_1400b8b80(local_40);
    iVar2 = uVar3 * 8;
    FUN_1400cf520(param_1 + 0x408,"keyLengthInBits",iVar2);
    if (0x100 < uVar3) {
      uVar3 = 0x100;
    }
    uVar5 = FUN_1400b8b90(local_40);
    FUN_1400cf340(param_1 + 0x408,"keyData",uVar5,uVar3);
    *(int *)(param_1 + 0x6ec) = iVar2;
    FUN_1400d1280(param_1 + 0x3c8);
    FUN_1400b8b30(param_1 + 0xa98);
    uVar4 = FUN_1400b8b80(local_40);
    uVar5 = FUN_1400b8b90(local_40);
    FUN_1400b97e0(param_1 + 0xa98,uVar5,uVar4);
    FUN_1400d1290(param_1 + 0x3c8);
  }
  (**(code **)(*(longlong *)(param_1 + 0x408) + 0x50))(param_1 + 0x408);
  FUN_1400d1290(param_1 + 0x3c8);
  FUN_1400b92d0(local_40);
  return;
}



void FUN_1400b3cd0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  int iVar1;
  uint uVar2;
  undefined8 uVar3;
  undefined1 local_30 [40];
  
  FUN_1400d1280(param_1 + 0x3c8);
  FUN_1400b0050(param_1 + 0x3f8,"SetEncodedIV");
  FUN_1400b8c40(local_30);
  FUN_1400bb720(param_1,param_2,param_3,local_30,0);
  FUN_1400b35f0(param_1,local_30);
  iVar1 = FUN_1400b8b80(local_30);
  if (iVar1 == 0) {
    (**(code **)(*(longlong *)(param_1 + 0x408) + 0x30))
              ((longlong *)(param_1 + 0x408),"IV not set, no data provided.");
  }
  else {
    uVar2 = FUN_1400b8b80(local_30);
    FUN_1400cf520(param_1 + 0x408,"ivSizeInBytes",uVar2);
    if (0x100 < uVar2) {
      uVar2 = 0x100;
    }
    uVar3 = FUN_1400b8b90(local_30);
    FUN_1400cf340(param_1 + 0x408,"ivData",uVar3,uVar2);
  }
  (**(code **)(*(longlong *)(param_1 + 0x408) + 0x50))((longlong *)(param_1 + 0x408));
  FUN_1400d1290(param_1 + 0x3c8);
  FUN_1400b92d0(local_30);
  return;
}



void * FUN_1400b3e00(void *param_1,uint param_2)

{
  FUN_1400b0680();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

longlong * FUN_1400b3e30(longlong param_1,undefined8 param_2,undefined8 param_3,longlong *param_4)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  longlong *plVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  longlong lVar9;
  char *pcVar10;
  undefined *puVar11;
  longlong *plVar12;
  undefined1 auStack_18d8 [32];
  longlong local_18b8;
  longlong *local_18b0;
  longlong *local_18a8;
  longlong *local_18a0;
  undefined8 local_1898;
  longlong *local_1890;
  longlong *local_1888;
  longlong *local_1878;
  void *local_1870;
  undefined1 local_1868 [40];
  undefined8 local_1840;
  undefined1 local_1838 [160];
  undefined1 local_1798 [160];
  undefined1 local_16f8 [336];
  undefined1 local_15a8 [1056];
  undefined1 local_1188 [4400];
  ulonglong local_58;
  undefined8 uStack_48;
  
  uStack_48 = 0x1400b3e4f;
  local_1840 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_18d8;
  iVar3 = *(int *)(param_1 + 0x6f4);
  local_1870 = (void *)param_2;
  if (iVar3 == 5) {
    (**(code **)(*param_4 + 0x58))(param_4,"algorithm",&DAT_1402076c4);
    local_1870 = operator_new(0x28);
    if (local_1870 == (void *)0x0) {
      plVar5 = (longlong *)0x0;
    }
    else {
      plVar5 = (longlong *)FUN_1400b8c40(local_1870);
    }
    FUN_1400b9e90(plVar5,param_2);
    return plVar5;
  }
  if ((((iVar3 == 1) || (iVar3 == 10)) || (iVar3 == 0xb)) ||
     (iVar3 = FUN_1400b8b80(param_1 + 0xa98), iVar3 != 0)) {
    iVar3 = FUN_1400b8b80(param_2);
    if (iVar3 == 0) {
      local_1870 = operator_new(0x28);
      if (local_1870 == (void *)0x0) {
        return (longlong *)0x0;
      }
      plVar5 = (longlong *)FUN_1400b8c40(local_1870);
      return plVar5;
    }
    iVar3 = *(int *)(param_1 + 0x6f4);
    if (iVar3 == 2) {
      (**(code **)(*param_4 + 0x58))(param_4,"algorithm",&DAT_1402749b8);
      FUN_1400cf520(param_4,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,"rijndael");
      FUN_1400e2820(local_16f8);
      FUN_1400e34a0(local_16f8,*(undefined4 *)(param_1 + 0x6ec));
      if (*(int *)(param_1 + 0x704) == 1) {
        FUN_1400e3570();
      }
      else {
        FUN_1400e3580(local_16f8);
      }
      FUN_1400e3500(local_16f8,param_1 + 0xa98);
      if (*(char *)(param_1 + 0xa3c) != '\0') {
        uVar6 = FUN_1400b8b90(param_1 + 0xa40);
        FUN_1400e2800(local_16f8,uVar6);
      }
      FUN_1400e3560(local_16f8,*(undefined4 *)(param_1 + 0xa68));
      plVar5 = (longlong *)FUN_1400e49b0(local_16f8,param_2,param_4);
      FUN_1400e2870(local_16f8);
      return plVar5;
    }
    if (iVar3 == 3) {
      (**(code **)(*param_4 + 0x58))(param_4,"algorithm","blowfishOld");
      FUN_1400cf520(param_4,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,"blowfish");
      FUN_1400e0e50(local_1798);
      FUN_1400e0dd0(local_1798,*(undefined4 *)(param_1 + 0x6ec));
      FUN_1400e0e00(local_1798,param_1 + 0xa98);
      FUN_1400e0e30(local_1798,*(undefined4 *)(param_1 + 0xa68));
      plVar5 = (longlong *)FUN_1400e2240(local_1798,param_2,param_4);
      FUN_1400e0ea0(local_1798);
      return plVar5;
    }
    if (iVar3 == 6) {
      (**(code **)(*param_4 + 0x58))(param_4,"algorithm","blowfish");
      FUN_1400cf520(param_4,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,"blowfish2");
      FUN_1400dd450(local_1798);
      FUN_1400dd3d0(local_1798,*(undefined4 *)(param_1 + 0x6ec));
      FUN_1400dd4f0(local_1798,param_1 + 0xa98);
      FUN_1400dd400(local_1798,*(undefined4 *)(param_1 + 0xa68));
      if (*(int *)(param_1 + 0x704) == 1) {
        FUN_1400dd410();
      }
      else if (*(int *)(param_1 + 0x704) == 2) {
        FUN_1400dd430();
      }
      else {
        FUN_1400dd420(local_1798);
      }
      if (*(char *)(param_1 + 0xa3c) != '\0') {
        uVar6 = FUN_1400b8b90(param_1 + 0xa40);
        FUN_1400dd440(local_1798,uVar6);
      }
      plVar5 = (longlong *)FUN_1400e0470(local_1798,param_2,param_4);
      FUN_1400dd4b0(local_1798);
      return plVar5;
    }
    if (iVar3 == 7) {
      puVar11 = &DAT_1402074c0;
      if (0x40 < *(int *)(param_1 + 0x6ec)) {
        puVar11 = &DAT_140207d60;
      }
      (**(code **)(*param_4 + 0x58))(param_4,"algorithm",puVar11);
      FUN_1400cf520(param_4,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,&DAT_1402074c0);
      FUN_1400d8590(local_15a8);
      FUN_1400dbe50(local_15a8,param_1 + 0xa98,*(undefined4 *)(param_1 + 0x6ec),param_4);
      FUN_1400dbfb0(local_15a8,*(undefined4 *)(param_1 + 0xa68));
      if (*(int *)(param_1 + 0x704) == 1) {
        uVar6 = 1;
      }
      else if (*(int *)(param_1 + 0x704) == 2) {
        uVar6 = 2;
      }
      else {
        uVar6 = 0;
      }
      FUN_1400dc010(local_15a8,uVar6);
      if (*(char *)(param_1 + 0xa3c) != '\0') {
        FUN_1400dbfc0(local_15a8,param_1 + 0xa40);
      }
      plVar5 = (longlong *)FUN_1400dc020(local_15a8,param_2,param_4);
      FUN_1400d85f0(local_15a8);
      return plVar5;
    }
    if (iVar3 == 8) {
      (**(code **)(*param_4 + 0x58))(param_4,"algorithm",&DAT_140207694);
      FUN_1400cf520(param_4,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,&DAT_140207694);
      FUN_1400d6f40(local_1798);
      FUN_1400d7b90(local_1798,param_1 + 0xa98,
                    (int)((*(int *)(param_1 + 0x6ec) >> 0x1f & 7U) + *(int *)(param_1 + 0x6ec)) >> 3
                    ,*(undefined4 *)(param_1 + 0x6f0));
      FUN_1400d6f90(local_1798,*(undefined4 *)(param_1 + 0xa68));
      FUN_1400d6fe0(local_1798,*(int *)(param_1 + 0x704) == 1);
      if (*(char *)(param_1 + 0xa3c) != '\0') {
        FUN_1400d6fa0(local_1798,param_1 + 0xa40);
      }
      plVar5 = (longlong *)FUN_1400d7540(local_1798,param_2,param_4);
      FUN_1400d6f80(local_1798);
      return plVar5;
    }
    if (iVar3 == 9) {
      (**(code **)(*param_4 + 0x58))(param_4,"algorithm",&DAT_14020768c);
      FUN_1400cf520(param_4,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,&DAT_14020768c);
      FUN_1400d6bb0(local_15a8);
      FUN_1400d6ed0(local_15a8,param_1 + 0xa98,
                    (int)((*(int *)(param_1 + 0x6ec) >> 0x1f & 7U) + *(int *)(param_1 + 0x6ec)) >> 3
                   );
      if (*(char *)(param_1 + 0xcd0) != '\0') {
        FUN_1400d6e60(local_15a8);
      }
      plVar5 = (longlong *)FUN_1400d6d60(local_15a8,param_2);
      FUN_1400d6bf0(local_15a8);
      return plVar5;
    }
    if (iVar3 == 10) {
      (**(code **)(*param_4 + 0x58))(param_4,"algorithm","pbes1");
      lVar1 = *param_4;
      uVar6 = FUN_1400b7ce0(param_1 + 0x970);
      (**(code **)(lVar1 + 0x58))(param_4,"pbesAlgorithm",uVar6);
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,"pbes1");
      FUN_1400b8c40(local_1868);
      FUN_1400b83e0(param_1 + 0x8d0,param_1 + 0x818,local_1868);
      FUN_1400b9550(local_1868,0);
      FUN_1400b6fd0(local_1838);
      FUN_1400bcc20(local_1798);
      FUN_1400f3400(*(undefined4 *)(param_1 + 0x6f8),local_1798);
      uVar6 = FUN_1400b8b90(local_1798);
      FUN_1400b7270(local_1838,uVar6);
      FUN_1400bceb0(local_1798);
      local_1870 = operator_new(0x28);
      if (local_1870 == (void *)0x0) {
        local_1878 = (longlong *)0x0;
      }
      else {
        local_1878 = (longlong *)FUN_1400b8c40(local_1870);
      }
      uVar6 = FUN_1400b7ce0(param_1 + 0x970);
      uVar7 = FUN_1400b7ce0(local_1838);
      uVar8 = FUN_1400b8b90(local_1868);
      plVar5 = local_1878;
      local_18a8 = local_1878;
      local_18b8 = CONCAT44(local_18b8._4_4_,*(undefined4 *)(param_1 + 0xa38));
      local_18b0 = (longlong *)param_2;
      local_18a0 = param_4;
      cVar2 = FUN_140103a30(uVar8,uVar7,uVar6,param_1 + 0xa10);
      plVar12 = plVar5;
      if ((cVar2 == '\0') && (plVar12 = (longlong *)0x0, plVar5 != (longlong *)0x0)) {
        (**(code **)*plVar5)(plVar5,1);
      }
      FUN_1400b7090(local_1838);
      FUN_1400b92d0(local_1868);
      return plVar12;
    }
    if (iVar3 == 0xb) {
      (**(code **)(*param_4 + 0x58))(param_4,"algorithm","pbes2");
      lVar1 = *param_4;
      uVar6 = FUN_1400b7ce0(param_1 + 0x970);
      (**(code **)(lVar1 + 0x58))(param_4,"pbesAlgorithm",uVar6);
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,"pbes2");
      FUN_1400b8c40(local_1868);
      FUN_1400b83e0(param_1 + 0x8d0,param_1 + 0x818,local_1868);
      FUN_1400b9550(local_1868,0);
      FUN_1400b6fd0(local_1838);
      FUN_1400bcc20(local_1798);
      FUN_1400f3400(*(undefined4 *)(param_1 + 0x6f8),local_1798);
      uVar6 = FUN_1400b8b90(local_1798);
      FUN_1400b7270(local_1838,uVar6);
      FUN_1400bceb0(local_1798);
      local_1878 = operator_new(0x28);
      if (local_1878 == (void *)0x0) {
        local_1878 = (longlong *)0x0;
      }
      else {
        local_1878 = (longlong *)FUN_1400b8c40(local_1878);
      }
      uVar6 = FUN_1400b7ce0(param_1 + 0x970);
      uVar7 = FUN_1400b7ce0(local_1838);
      uVar8 = FUN_1400b8b90(local_1868);
      plVar5 = local_1878;
      local_1890 = local_1878;
      local_1898 = local_1870;
      local_18a8 = (longlong *)CONCAT44(local_18a8._4_4_,*(undefined4 *)(param_1 + 0xa38));
      local_18b8 = CONCAT44(local_18b8._4_4_,*(undefined4 *)(param_1 + 0x6f0));
      local_18b0 = (longlong *)(param_1 + 0xa10);
      local_18a0 = (longlong *)(param_1 + 0xa40);
      local_1888 = param_4;
      cVar2 = FUN_140103de0(uVar8,uVar7,uVar6,*(undefined4 *)(param_1 + 0x6ec));
      plVar12 = plVar5;
      if ((cVar2 == '\0') && (plVar12 = (longlong *)0x0, plVar5 != (longlong *)0x0)) {
        (**(code **)*plVar5)(plVar5,1);
      }
      FUN_1400b7090(local_1838);
      FUN_1400b92d0(local_1868);
      return plVar12;
    }
    if (iVar3 == 4) {
      (**(code **)(*param_4 + 0x58))(param_4,"algorithm","twofish");
      FUN_1400cf520(param_4,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
      FUN_1400b7180(param_1 + 0xaf0);
      FUN_1400bdb00(param_1 + 0xac0,"twofish");
      FUN_1400d5b30(local_1188);
      FUN_1400d5c10(local_1188,*(undefined4 *)(param_1 + 0x6ec));
      FUN_1400d6600(local_1188,param_1 + 0xa98);
      if (*(int *)(param_1 + 0x704) == 1) {
        FUN_1400d6800();
      }
      else {
        FUN_1400d6810(local_1188);
      }
      if (*(char *)(param_1 + 0xa3c) != '\0') {
        uVar6 = FUN_1400b8b90(param_1 + 0xa40);
        FUN_1400d5bf0(local_1188,uVar6);
      }
      FUN_1400d62e0(local_1188,*(undefined4 *)(param_1 + 0xa68));
      plVar5 = (longlong *)FUN_1400d6450(local_1188,param_2,param_4);
      FUN_1400d5bd0(local_1188);
      return plVar5;
    }
    if (iVar3 == 1) {
      (**(code **)(*param_4 + 0x58))(param_4,"algorithm",&DAT_140207430);
      lVar1 = param_1 + 0x858;
      iVar3 = FUN_140139d70(lVar1);
      if (iVar3 != 0) {
        lVar9 = FUN_1400d0aa0(lVar1,0);
        if (lVar9 != 0) {
          FUN_1400b7180(param_1 + 0xaf0);
          FUN_1400ecc50(lVar9,param_1 + 0xaf0,param_4);
          FUN_1400bdb00(param_1 + 0xac0,&DAT_140207430);
        }
        local_1870 = operator_new(0x28);
        if (local_1870 == (void *)0x0) {
          plVar5 = (longlong *)0x0;
        }
        else {
          plVar5 = (longlong *)FUN_1400b8c40(local_1870);
        }
        cVar2 = FUN_1400bc7e0(param_1 + 0x558,"Crypto-Pro GOST");
        if (cVar2 == '\0') {
          FUN_1400ef410(local_1798);
          FUN_140102fe0(local_1798,param_3);
          uVar4 = FUN_1400b8b80(param_2);
          uVar6 = FUN_1400b8b90(param_2);
          FUN_1400ef3e0(local_1798,uVar6,uVar4,0);
          local_18b8 = param_1 + 0x658;
          local_18a0 = (longlong *)CONCAT71(local_18a0._1_7_,*(undefined1 *)(param_1 + 0x6b0));
          local_18b0 = plVar5;
          local_18a8 = param_4;
          cVar2 = FUN_1400e9870(local_1798,*(undefined4 *)(param_1 + 0x7c0),
                                *(undefined4 *)(param_1 + 0x6ec),lVar1);
          FUN_1400ef440(local_1798);
        }
        else {
          (**(code **)(*param_4 + 0x30))(param_4,"Must use MS Crypto API for encryption...");
          uVar4 = FUN_1400b8b80(param_2);
          uVar6 = FUN_1400b8b90(param_2);
          local_18b8 = lVar1;
          local_18b0 = param_4;
          cVar2 = FUN_1400ee4d0(param_1 + 0x550,uVar6,uVar4,plVar5);
        }
        if (cVar2 == '\0') {
          if (plVar5 == (longlong *)0x0) {
            return (longlong *)0x0;
          }
          (**(code **)*plVar5)(plVar5,1);
          return (longlong *)0x0;
        }
        return plVar5;
      }
      pcVar10 = "No encryption certificates were specified.";
    }
    else {
      pcVar10 = "Unrecognized encryption method";
    }
  }
  else {
    pcVar10 = "No secret key has been set.  Need a secret key for symmetric encryption algorithms";
  }
  (**(code **)(*param_4 + 0x28))(param_4,pcVar10);
  return (longlong *)0x0;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_1400b4ae0(longlong param_1,undefined8 param_2,longlong *param_3)

{
  int iVar1;
  longlong lVar2;
  undefined8 *puVar3;
  char cVar4;
  undefined8 *puVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  undefined1 auStack_18c8 [32];
  longlong local_18a8;
  longlong local_18a0;
  undefined8 local_1898;
  undefined8 *local_1890;
  longlong *local_1888;
  undefined8 *local_1880;
  longlong *local_1878;
  undefined8 *local_1868;
  void *local_1860;
  undefined1 local_1858 [40];
  undefined8 local_1830;
  undefined1 local_1828 [160];
  undefined1 local_1788 [160];
  undefined1 local_16e8 [336];
  undefined1 local_1598 [1056];
  undefined1 local_1178 [4400];
  ulonglong local_48;
  undefined8 uStack_40;
  
  uStack_40 = 0x1400b4afe;
  local_1830 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_18c8;
  _DAT_140316f18 = 0x73;
  iVar1 = *(int *)(param_1 + 0x6f4);
  local_1860 = (void *)param_2;
  if (iVar1 == 5) {
    _DAT_140316f18 = 0x74;
    (**(code **)(*param_3 + 0x58))(param_3,"algorithm",&DAT_1402076c4);
    local_1860 = operator_new(0x28);
    if (local_1860 == (void *)0x0) {
      puVar5 = (undefined8 *)0x0;
    }
    else {
      puVar5 = (undefined8 *)FUN_1400b8c40(local_1860);
    }
    FUN_1400b9e90(puVar5,param_2);
  }
  else if (iVar1 == 2) {
    _DAT_140316f18 = 0x75;
    (**(code **)(*param_3 + 0x58))(param_3,"algorithm",&DAT_1402749b8);
    FUN_1400cf520(param_3,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
    FUN_1400b7180(param_1 + 0xaf0);
    FUN_1400bdb00(param_1 + 0xac0,"rijndael");
    FUN_1400e2820(local_16e8);
    FUN_1400e34a0(local_16e8,*(undefined4 *)(param_1 + 0x6ec));
    if (*(int *)(param_1 + 0x704) == 1) {
      FUN_1400e3570();
    }
    else {
      FUN_1400e3580(local_16e8);
    }
    FUN_1400e3500(local_16e8,param_1 + 0xa98);
    if (*(char *)(param_1 + 0xa3c) != '\0') {
      uVar6 = FUN_1400b8b90(param_1 + 0xa40);
      FUN_1400e2800(local_16e8,uVar6);
    }
    FUN_1400e3560(local_16e8,*(undefined4 *)(param_1 + 0xa68));
    FUN_1400e34e0(local_16e8,*(undefined1 *)(param_1 + 0x708));
    puVar5 = (undefined8 *)FUN_1400e4fd0(local_16e8,param_2,param_3);
    FUN_1400e2870(local_16e8);
  }
  else if (iVar1 == 3) {
    _DAT_140316f18 = 0x76;
    (**(code **)(*param_3 + 0x58))(param_3,"algorithm","blowfishOld");
    FUN_1400cf520(param_3,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
    FUN_1400b7180(param_1 + 0xaf0);
    FUN_1400bdb00(param_1 + 0xac0,"blowfish");
    FUN_1400e0e50(local_1788);
    FUN_1400e0dd0(local_1788,*(undefined4 *)(param_1 + 0x6ec));
    FUN_1400e0e00(local_1788,param_1 + 0xa98);
    FUN_1400e0e30(local_1788,*(undefined4 *)(param_1 + 0xa68));
    FUN_1400e0e40(local_1788,*(undefined1 *)(param_1 + 0x708));
    puVar5 = (undefined8 *)FUN_1400e2380(local_1788,param_2,param_3);
    FUN_1400e0ea0(local_1788);
  }
  else if (iVar1 == 6) {
    _DAT_140316f18 = 0x77;
    (**(code **)(*param_3 + 0x58))(param_3,"algorithm","blowfish");
    FUN_1400cf520(param_3,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
    FUN_1400b7180(param_1 + 0xaf0);
    FUN_1400bdb00(param_1 + 0xac0,"blowfish2");
    FUN_1400dd450(local_1788);
    FUN_1400dd3d0(local_1788,*(undefined4 *)(param_1 + 0x6ec));
    FUN_1400dd4f0(local_1788,param_1 + 0xa98);
    FUN_1400dd400(local_1788,*(undefined4 *)(param_1 + 0xa68));
    if (*(int *)(param_1 + 0x704) == 1) {
      FUN_1400dd410();
    }
    else if (*(int *)(param_1 + 0x704) == 2) {
      FUN_1400dd430();
    }
    else {
      FUN_1400dd420(local_1788);
    }
    if (*(char *)(param_1 + 0xa3c) != '\0') {
      uVar6 = FUN_1400b8b90(param_1 + 0xa40);
      FUN_1400dd440(local_1788,uVar6);
    }
    puVar5 = (undefined8 *)FUN_1400e0650(local_1788,param_2,param_3);
    FUN_1400dd4b0(local_1788);
  }
  else if (iVar1 == 7) {
    _DAT_140316f18 = 0x78;
    (**(code **)(*param_3 + 0x58))(param_3,"algorithm",&DAT_1402074c0);
    FUN_1400cf520(param_3,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
    FUN_1400b7180(param_1 + 0xaf0);
    FUN_1400bdb00(param_1 + 0xac0,&DAT_1402074c0);
    FUN_1400d8590(local_1598);
    FUN_1400dbe50(local_1598,param_1 + 0xa98,*(undefined4 *)(param_1 + 0x6ec),param_3);
    FUN_1400dbfb0(local_1598,*(undefined4 *)(param_1 + 0xa68));
    if (*(int *)(param_1 + 0x704) == 1) {
      uVar6 = 1;
    }
    else if (*(int *)(param_1 + 0x704) == 2) {
      uVar6 = 2;
    }
    else {
      uVar6 = 0;
    }
    FUN_1400dc010(local_1598,uVar6);
    if (*(char *)(param_1 + 0xa3c) == '\0') {
      FUN_1400dc000(local_1598);
    }
    else {
      FUN_1400dbfc0(local_1598,param_1 + 0xa40);
    }
    puVar5 = (undefined8 *)FUN_1400dcaf0(local_1598,param_2,param_3);
    FUN_1400d85f0(local_1598);
  }
  else if (iVar1 == 8) {
    _DAT_140316f18 = 0x79;
    (**(code **)(*param_3 + 0x58))(param_3,"algorithm",&DAT_140207694);
    FUN_1400cf520(param_3,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
    FUN_1400b7180(param_1 + 0xaf0);
    FUN_1400bdb00(param_1 + 0xac0,&DAT_140207694);
    FUN_1400d6f40(local_1788);
    FUN_1400d7b90(local_1788,param_1 + 0xa98,
                  (int)((*(int *)(param_1 + 0x6ec) >> 0x1f & 7U) + *(int *)(param_1 + 0x6ec)) >> 3,
                  *(undefined4 *)(param_1 + 0x6f0));
    FUN_1400d6f90(local_1788,*(undefined4 *)(param_1 + 0xa68));
    FUN_1400d6fe0(local_1788,*(int *)(param_1 + 0x704) == 1);
    if (*(char *)(param_1 + 0xa3c) != '\0') {
      FUN_1400d6fa0(local_1788,param_1 + 0xa40);
    }
    puVar5 = (undefined8 *)FUN_1400d8080(local_1788,param_2,param_3);
    FUN_1400d6f80(local_1788);
  }
  else if (iVar1 == 9) {
    _DAT_140316f18 = 0x7a;
    (**(code **)(*param_3 + 0x58))(param_3,"algorithm",&DAT_14020768c);
    FUN_1400cf520(param_3,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
    FUN_1400b7180(param_1 + 0xaf0);
    FUN_1400bdb00(param_1 + 0xac0,&DAT_14020768c);
    FUN_1400d6bb0(local_1598);
    FUN_1400d6ed0(local_1598,param_1 + 0xa98,
                  (int)((*(int *)(param_1 + 0x6ec) >> 0x1f & 7U) + *(int *)(param_1 + 0x6ec)) >> 3);
    if (*(char *)(param_1 + 0xcd0) != '\0') {
      FUN_1400d6e60(local_1598);
    }
    puVar5 = (undefined8 *)FUN_1400d6d60(local_1598,param_2);
    FUN_1400d6bf0(local_1598);
  }
  else if (iVar1 == 4) {
    _DAT_140316f18 = 0x7b;
    (**(code **)(*param_3 + 0x58))(param_3,"algorithm","twofish");
    FUN_1400cf520(param_3,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
    FUN_1400b7180(param_1 + 0xaf0);
    FUN_1400bdb00(param_1 + 0xac0,"twofish");
    FUN_1400d5b30(local_1178);
    FUN_1400d5c10(local_1178,*(undefined4 *)(param_1 + 0x6ec));
    FUN_1400d6600(local_1178,param_1 + 0xa98);
    FUN_1400d6640(local_1178,*(undefined1 *)(param_1 + 0x708));
    if (*(int *)(param_1 + 0x704) == 1) {
      FUN_1400d6800();
    }
    else {
      FUN_1400d6810(local_1178);
    }
    if (*(char *)(param_1 + 0xa3c) != '\0') {
      uVar6 = FUN_1400b8b90(param_1 + 0xa40);
      FUN_1400d5bf0(local_1178,uVar6);
    }
    FUN_1400d62e0(local_1178,*(undefined4 *)(param_1 + 0xa68));
    puVar5 = (undefined8 *)FUN_1400d6650(local_1178,param_2,param_3);
    FUN_1400d5bd0(local_1178);
  }
  else if (iVar1 == 10) {
    _DAT_140316f18 = 0x7c;
    (**(code **)(*param_3 + 0x58))(param_3,"algorithm","pbes1");
    lVar2 = *param_3;
    uVar6 = FUN_1400b7ce0(param_1 + 0x970);
    (**(code **)(lVar2 + 0x58))(param_3,"pbesAlgorithm",uVar6);
    FUN_1400b7180(param_1 + 0xaf0);
    FUN_1400bdb00(param_1 + 0xac0,"pbes1");
    FUN_1400b8c40(local_1858);
    FUN_1400b83e0(param_1 + 0x8d0,param_1 + 0x818,local_1858);
    FUN_1400b9550(local_1858,0);
    FUN_1400b6fd0(local_1828);
    FUN_1400bcc20(local_1788);
    FUN_1400f3400(*(undefined4 *)(param_1 + 0x6f8),local_1788);
    uVar6 = FUN_1400b8b90(local_1788);
    FUN_1400b7270(local_1828,uVar6);
    FUN_1400bceb0(local_1788);
    local_1860 = operator_new(0x28);
    if (local_1860 == (void *)0x0) {
      local_1868 = (undefined8 *)0x0;
    }
    else {
      local_1868 = (undefined8 *)FUN_1400b8c40(local_1860);
    }
    uVar6 = FUN_1400b7ce0(param_1 + 0x970);
    uVar7 = FUN_1400b7ce0(local_1828);
    uVar8 = FUN_1400b8b90(local_1858);
    puVar3 = local_1868;
    local_1890 = local_1868;
    local_18a0 = CONCAT44(local_18a0._4_4_,*(undefined4 *)(param_1 + 0xa38));
    local_18a8 = param_1 + 0xa10;
    local_1898 = param_2;
    local_1888 = param_3;
    cVar4 = FUN_140103820(uVar8,uVar7,uVar6,*(undefined4 *)(param_1 + 0x6ec));
    puVar5 = puVar3;
    if ((cVar4 == '\0') && (puVar5 = (undefined8 *)0x0, puVar3 != (undefined8 *)0x0)) {
      (**(code **)*puVar3)(puVar3,1);
    }
    FUN_1400b7090(local_1828);
    FUN_1400b92d0(local_1858);
  }
  else if (iVar1 == 0xb) {
    _DAT_140316f18 = 0x7d;
    (**(code **)(*param_3 + 0x58))(param_3,"algorithm","pbes2");
    lVar2 = *param_3;
    uVar6 = FUN_1400b7ce0(param_1 + 0x970);
    (**(code **)(lVar2 + 0x58))(param_3,"pbesAlgorithm",uVar6);
    FUN_1400b7180(param_1 + 0xaf0);
    FUN_1400bdb00(param_1 + 0xac0,"pbes2");
    FUN_1400b8c40(local_1858);
    FUN_1400b83e0(param_1 + 0x8d0,param_1 + 0x818,local_1858);
    FUN_1400b9550(local_1858,0);
    FUN_1400b6fd0(local_1828);
    FUN_1400bcc20(local_1788);
    FUN_1400f3400(*(undefined4 *)(param_1 + 0x6f8),local_1788);
    uVar6 = FUN_1400b8b90(local_1788);
    FUN_1400b7270(local_1828,uVar6);
    FUN_1400bceb0(local_1788);
    local_1868 = operator_new(0x28);
    if (local_1868 == (void *)0x0) {
      local_1868 = (undefined8 *)0x0;
    }
    else {
      local_1868 = (undefined8 *)FUN_1400b8c40(local_1868);
    }
    uVar6 = FUN_1400b7ce0(param_1 + 0x970);
    uVar7 = FUN_1400b7ce0(local_1828);
    uVar8 = FUN_1400b8b90(local_1858);
    puVar3 = local_1868;
    local_1880 = local_1868;
    local_1888 = local_1860;
    local_1898 = CONCAT44(local_1898._4_4_,*(undefined4 *)(param_1 + 0xa38));
    local_18a8 = CONCAT44(local_18a8._4_4_,*(undefined4 *)(param_1 + 0x6f0));
    local_18a0 = param_1 + 0xa10;
    local_1890 = (undefined8 *)(param_1 + 0xa40);
    local_1878 = param_3;
    cVar4 = FUN_140103c30(uVar8,uVar7,uVar6,*(undefined4 *)(param_1 + 0x6ec));
    puVar5 = puVar3;
    if ((cVar4 == '\0') && (puVar5 = (undefined8 *)0x0, puVar3 != (undefined8 *)0x0)) {
      (**(code **)*puVar3)(puVar3,1);
    }
    FUN_1400b7090(local_1828);
    FUN_1400b92d0(local_1858);
  }
  else if (iVar1 == 1) {
    puVar5 = (undefined8 *)FUN_1400b2ce0();
  }
  else {
    (**(code **)(*param_3 + 0x28))(param_3,"Algorithm ID is unrecognized");
    puVar5 = (undefined8 *)0x0;
  }
  return puVar5;
}



void FUN_1400b5640(longlong param_1,undefined8 param_2,longlong *param_3)

{
  longlong lVar1;
  undefined4 uVar2;
  uint uVar3;
  undefined8 uVar4;
  undefined *puVar5;
  undefined1 local_e8 [40];
  undefined8 local_c0;
  undefined1 local_b8 [160];
  
  local_c0 = 0xfffffffffffffffe;
  (**(code **)(*param_3 + 0x48))(param_3,"EncryptionParams",1);
  FUN_1400b6fd0(local_b8);
  FUN_1400b7180(local_b8);
  lVar1 = *param_3;
  uVar4 = FUN_1400b8b90(param_1 + 0x6b8);
  (**(code **)(lVar1 + 0x58))(param_3,"algorithm",uVar4);
  FUN_1400cf520(param_3,"keyLength",*(undefined4 *)(param_1 + 0x6ec));
  FUN_1400cf520(param_3,"paddingScheme",*(undefined4 *)(param_1 + 0xa68));
  FUN_1400b7180(local_b8);
  if (*(int *)(param_1 + 0x704) == 0) {
    puVar5 = &DAT_1402749d8;
  }
  else {
    puVar5 = &DAT_140207a6c;
    if (*(int *)(param_1 + 0x704) != 2) {
      puVar5 = &DAT_140207a68;
    }
  }
  FUN_1400b7270(local_b8,puVar5);
  lVar1 = *param_3;
  uVar4 = FUN_1400b7ce0(local_b8);
  (**(code **)(lVar1 + 0x58))(param_3,"cipherMode",uVar4);
  FUN_1400b7180(local_b8);
  FUN_1400ba920(param_1,local_b8);
  lVar1 = *param_3;
  uVar4 = FUN_1400b7ce0(local_b8);
  (**(code **)(lVar1 + 0x58))(param_3,"encodingMode",uVar4);
  FUN_1400b7180(local_b8);
  FUN_1400d1280(param_1 + 0x3c8);
  uVar4 = FUN_1400c0c50(param_1 + 0x818);
  FUN_1400b7270(local_b8,uVar4);
  FUN_1400d1290(param_1 + 0x3c8);
  lVar1 = *param_3;
  uVar4 = FUN_1400b7ce0(local_b8);
  (**(code **)(lVar1 + 0x58))(param_3,"charset",uVar4);
  FUN_1400b8c40(local_e8);
  FUN_1400b8b30(local_e8);
  FUN_1400d1280(param_1 + 0x3c8);
  FUN_1400b8b30(local_e8);
  uVar2 = FUN_1400b8b80(param_1 + 0xa98);
  uVar4 = FUN_1400b8b90(param_1 + 0xa98);
  FUN_1400b97e0(local_e8,uVar4,uVar2);
  FUN_1400d1290(param_1 + 0x3c8);
  uVar2 = FUN_1400b8b80(local_e8);
  uVar4 = FUN_1400b8b90(local_e8);
  FUN_1400cf340(param_3,"secretKey",uVar4,uVar2);
  FUN_1400b8b30(local_e8);
  if (*(char *)(param_1 + 0xa3c) == '\0') {
    FUN_1400b8b30(local_e8);
  }
  else {
    FUN_1400b8b30(local_e8);
    uVar3 = FUN_1400b8b80(param_1 + 0xa40);
    if (uVar3 < 0x10) {
      uVar2 = FUN_1400b8b80();
      uVar4 = FUN_1400b8b90(param_1 + 0xa40);
    }
    else {
      uVar4 = FUN_1400b8b90(param_1 + 0xa40);
      uVar2 = 0x10;
    }
    FUN_1400b97e0(local_e8,uVar4,uVar2);
  }
  uVar2 = FUN_1400b8b80(local_e8);
  uVar4 = FUN_1400b8b90(local_e8);
  FUN_1400cf340(param_3,&DAT_140207e30,uVar4,uVar2);
  uVar2 = FUN_1400b8b80(param_2);
  FUN_1400cf520(param_3,"inDataNumBytes",uVar2);
  uVar3 = FUN_1400b8b80(param_2);
  if (uVar3 < 0x101) {
    if (uVar3 == 0) goto LAB_1400b593d;
  }
  else {
    uVar3 = 0x100;
  }
  uVar4 = FUN_1400b8b90(param_2);
  FUN_1400cf340(param_3,"inData",uVar4,uVar3);
LAB_1400b593d:
  (**(code **)(*param_3 + 0x50))(param_3);
  FUN_1400b92d0(local_e8);
  FUN_1400b7090(local_b8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

longlong FUN_1400b5980(longlong param_1,undefined1 *param_2,undefined8 param_3,longlong *param_4,
                      char param_5)

{
  char cVar1;
  uint uVar2;
  undefined4 uVar3;
  int iVar4;
  uint uVar5;
  int iVar6;
  longlong lVar7;
  undefined8 uVar8;
  ulonglong uVar9;
  longlong lVar10;
  void *_Src;
  undefined1 *puVar11;
  undefined1 auStack_138 [32];
  longlong *local_118;
  undefined1 local_108 [40];
  undefined8 local_e0;
  undefined1 local_d8 [128];
  ulonglong local_58;
  
  local_e0 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_138;
  if (param_5 != '\0') {
    FUN_1400b5640(param_1,param_2,param_4);
  }
  iVar4 = *(int *)(param_1 + 0x6f4);
  if (iVar4 == 2) {
LAB_1400b5a0f:
    uVar5 = 0x10;
LAB_1400b5a14:
    if (((*(int *)(param_1 + 0x704) == 0) &&
        (((((iVar4 == 2 || (iVar4 == 6)) || (iVar4 == 3)) || ((iVar4 == 4 || (iVar4 == 7)))) ||
         (iVar4 == 8)))) && (uVar2 = FUN_1400b8b80(param_1 + 0xa40), uVar2 != uVar5)) {
      (**(code **)(*param_4 + 0x28))
                (param_4,"Warning: IV length is not equal to the algorithm\'s block size");
      FUN_1400cf520(param_4,"blockSize",uVar5);
      uVar3 = FUN_1400b8b80(param_1 + 0xa40);
      FUN_1400cf520(param_4,"IV_len",uVar3);
    }
  }
  else {
    if (iVar4 == 3) {
      uVar5 = 8;
      goto LAB_1400b5a14;
    }
    if (iVar4 == 6) {
      uVar5 = 8;
      goto LAB_1400b5a14;
    }
    if (iVar4 == 7) {
      uVar5 = 8;
      goto LAB_1400b5a14;
    }
    if (iVar4 == 8) {
      uVar5 = 8;
      goto LAB_1400b5a14;
    }
    if (iVar4 == 9) {
      uVar5 = 1;
      goto LAB_1400b5a14;
    }
    if (iVar4 == 4) goto LAB_1400b5a0f;
    uVar5 = 0;
  }
  iVar4 = FUN_1400b8b80(param_1 + 0xa98);
  if (((uint)(iVar4 * 8) < *(uint *)(param_1 + 0x6ec)) &&
     ((((iVar4 = *(int *)(param_1 + 0x6f4), iVar4 == 2 || (iVar4 == 6)) ||
       ((iVar4 == 3 || (((iVar4 == 4 || (iVar4 == 7)) || (iVar4 == 8)))))) || (iVar4 == 9)))) {
    (**(code **)(*param_4 + 0x28))
              (param_4,"Warning: Secret key size not equal to specified key length");
    FUN_1400cf520(param_4,"keyLengthInBits",*(undefined4 *)(param_1 + 0x6ec));
    uVar3 = FUN_1400b8b80(param_1 + 0xa98);
    FUN_1400cf520(param_4,"secretKeyLengthInBytes",uVar3);
  }
  if (((*(char *)(param_1 + 0x70b) == '\0') && (*(char *)(param_1 + 0x709) == '\0')) &&
     (*(char *)(param_1 + 0x70a) != '\0')) {
    iVar4 = FUN_1400b8b80(param_1 + 0x778);
    if (iVar4 == 0) {
      lVar7 = FUN_1400b3e30(param_1,param_2,param_3,param_4);
    }
    else {
      FUN_1400b8c40(local_108);
      FUN_1400b9e90(local_108,param_1 + 0x778);
      FUN_1400b9e90(local_108,param_2);
      lVar7 = FUN_1400b3e30(param_1,local_108,param_3,param_4);
      FUN_1400b92d0(local_108);
    }
    if (lVar7 == 0) {
      return 0;
    }
    if (param_5 == '\0') {
      return lVar7;
    }
    uVar5 = FUN_1400b8b80(lVar7);
    if (uVar5 < 0x101) {
      if (uVar5 == 0) {
        return lVar7;
      }
    }
    else {
      uVar5 = 0x100;
    }
    uVar8 = FUN_1400b8b90(lVar7);
    FUN_1400cf340(param_4,"encryptedData",uVar8,uVar5);
    return lVar7;
  }
  if (uVar5 == 0) {
LAB_1400b5f55:
    lVar7 = FUN_1400b3e30(param_1,param_2,param_3,param_4);
    if ((lVar7 != 0) && (param_5 != '\0')) {
      uVar5 = FUN_1400b8b80(lVar7);
      if (uVar5 < 0x101) {
        if (uVar5 == 0) {
          return lVar7;
        }
      }
      else {
        uVar5 = 0x100;
      }
      uVar8 = FUN_1400b8b90(lVar7);
      FUN_1400cf340(param_4,"encryptedData",uVar8,uVar5);
    }
    return lVar7;
  }
  cVar1 = *(char *)(param_1 + 0x709);
  local_118 = param_4;
  if ((cVar1 != '\0') && (*(char *)(param_1 + 0x70a) == '\0')) {
    FUN_1400d16e0(param_1 + 0x710);
    lVar7 = param_1 + 0x778;
    FUN_1400b8b30(lVar7);
    *(undefined1 *)(param_1 + 0x70b) = 0;
    uVar9 = FUN_1400b8b80(param_2);
    uVar9 = (uVar9 & 0xffffffff) % (ulonglong)uVar5;
    iVar4 = (int)uVar9;
    if (iVar4 != 0) {
      iVar6 = FUN_1400b8b80(param_2);
      uVar8 = FUN_1400b8ba0(param_2,iVar6 - iVar4);
      FUN_1400b97e0(lVar7,uVar8,uVar9);
      FUN_1400b8be0(param_2,uVar9);
    }
    lVar10 = FUN_1400b0b60(param_1,param_1 + 0x710,param_2,param_1 + 0x750);
    if (iVar4 == 0) {
      return lVar10;
    }
    FUN_1400b9e90(param_2,lVar7);
    return lVar10;
  }
  if (*(char *)(param_1 + 0x70b) == '\0') {
    if (cVar1 != '\0') goto LAB_1400b5f55;
    if (*(char *)(param_1 + 0x70a) == '\0') {
      FUN_1400d16e0(param_1 + 0x710);
      FUN_1400b8c40(local_108);
      FUN_1400b9e90(local_108,param_1 + 0x778);
      FUN_1400b9e90(local_108);
      FUN_1400b8b30(param_1 + 0x778);
      uVar9 = FUN_1400b8b80(local_108);
      uVar9 = (uVar9 & 0xffffffff) % (ulonglong)uVar5;
      if ((int)uVar9 != 0) {
        iVar4 = FUN_1400b8b80(local_108);
        uVar8 = FUN_1400b8ba0(local_108,iVar4 - (int)uVar9);
        FUN_1400b8b30(param_1 + 0x778);
        FUN_1400b97e0(param_1 + 0x778,uVar8,uVar9);
        FUN_1400b8be0(local_108,uVar9);
      }
      lVar7 = FUN_1400b0b60(param_1,param_1 + 0x710,local_108,param_1 + 0x750);
      FUN_1400b92d0(local_108);
      return lVar7;
    }
  }
  if (cVar1 != '\0') goto LAB_1400b5f55;
  if (*(char *)(param_1 + 0x70a) != '\0') {
    if (*(char *)(param_1 + 0x70a) != '\0') {
      iVar4 = FUN_1400b8b80(param_1 + 0x778);
      if (iVar4 != 0) {
        FUN_1400b8c40(local_108);
        FUN_1400b9e90(local_108,param_1 + 0x778);
        FUN_1400b9e90(local_108,param_2);
        lVar7 = FUN_1400b1900(param_1,param_1 + 0x710,local_108,param_1 + 0x750);
        FUN_1400b92d0(local_108);
        return lVar7;
      }
      lVar7 = FUN_1400b1900(param_1,param_1 + 0x710,param_2,param_1 + 0x750);
      return lVar7;
    }
    goto LAB_1400b5f55;
  }
  iVar4 = FUN_1400b8b80(param_1 + 0x778);
  iVar6 = FUN_1400b8b80(param_2);
  uVar9 = (ulonglong)(uint)(iVar6 + iVar4) % (ulonglong)uVar5;
  if (0x80 < (uint)uVar9) {
    uVar9 = 0x80;
  }
  iVar6 = (int)uVar9;
  FUN_1400b8c40(local_108);
  puVar11 = param_2;
  if (iVar4 != 0) {
    FUN_1400b9e90(local_108,param_1 + 0x778);
    FUN_1400b9e90(local_108,param_2);
    puVar11 = local_108;
    FUN_1400b8b30(param_1 + 0x778);
  }
  if (iVar6 != 0) {
    iVar4 = FUN_1400b8b80(puVar11);
    _Src = (void *)FUN_1400b8ba0(puVar11,iVar4 - iVar6);
    FUN_1400b97e0(param_1 + 0x778,_Src,uVar9);
    FUN_1400b8be0(puVar11,uVar9);
    if (puVar11 == param_2) {
      memcpy(local_d8,_Src,uVar9);
      goto LAB_1400b5e6b;
    }
  }
  iVar6 = 0;
LAB_1400b5e6b:
  lVar7 = FUN_1400b1580(param_1,param_1 + 0x710,puVar11,param_1 + 0x750);
  if (iVar6 != 0) {
    FUN_1400b97e0(puVar11,local_d8,iVar6);
  }
  FUN_1400b92d0(local_108);
  return lVar7;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

longlong FUN_1400b5fd0(longlong param_1,undefined1 *param_2,longlong *param_3)

{
  char cVar1;
  uint uVar2;
  undefined4 uVar3;
  int iVar4;
  int iVar5;
  longlong lVar6;
  ulonglong uVar7;
  undefined8 uVar8;
  longlong lVar9;
  uint uVar10;
  undefined1 *puVar11;
  undefined1 auStack_138 [32];
  longlong *local_118;
  undefined1 local_108 [40];
  void *local_e0;
  undefined8 local_d8;
  undefined1 local_c8 [128];
  ulonglong local_48;
  
  local_d8 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_138;
  if (*(char *)(param_1 + 0x6b0) != '\0') {
    FUN_1400b5640();
  }
  _DAT_140316f18 = 100;
  iVar4 = *(int *)(param_1 + 0x6f4);
  if (iVar4 == 2) {
LAB_1400b606b:
    uVar10 = 0x10;
LAB_1400b6070:
    if (((*(int *)(param_1 + 0x704) == 0) &&
        (((((iVar4 == 2 || (iVar4 == 6)) || (iVar4 == 3)) || ((iVar4 == 4 || (iVar4 == 7)))) ||
         (iVar4 == 8)))) && (uVar2 = FUN_1400b8b80(param_1 + 0xa40), uVar2 != uVar10)) {
      (**(code **)(*param_3 + 0x28))
                (param_3,"Warning: IV length is not equal to the algorithm\'s block size");
      FUN_1400cf520(param_3,"blockSize",uVar10);
      uVar3 = FUN_1400b8b80(param_1 + 0xa40);
      FUN_1400cf520(param_3,"IV_len",uVar3);
    }
  }
  else {
    if (iVar4 == 3) {
      uVar10 = 8;
      goto LAB_1400b6070;
    }
    if (iVar4 == 6) {
      uVar10 = 8;
      goto LAB_1400b6070;
    }
    if (iVar4 == 7) {
      uVar10 = 8;
      goto LAB_1400b6070;
    }
    if (iVar4 == 8) {
      uVar10 = 8;
      goto LAB_1400b6070;
    }
    if (iVar4 == 9) {
      uVar10 = 1;
      goto LAB_1400b6070;
    }
    if (iVar4 == 4) goto LAB_1400b606b;
    uVar10 = 0;
  }
  iVar4 = FUN_1400b8b80(param_1 + 0xa98);
  if (((uint)(iVar4 * 8) < *(uint *)(param_1 + 0x6ec)) &&
     ((((iVar4 = *(int *)(param_1 + 0x6f4), iVar4 == 2 || (iVar4 == 6)) ||
       ((iVar4 == 3 || (((iVar4 == 4 || (iVar4 == 7)) || (iVar4 == 8)))))) || (iVar4 == 9)))) {
    (**(code **)(*param_3 + 0x28))
              (param_3,"Warning: Secret key size not equal to specified key length");
    FUN_1400cf520(param_3,"keyLengthInBits",*(undefined4 *)(param_1 + 0x6ec));
    uVar3 = FUN_1400b8b80(param_1 + 0xa98);
    FUN_1400cf520(param_3,"secretKeyLengthInBytes",uVar3);
  }
  if (((*(char *)(param_1 + 0x70b) == '\0') && (*(char *)(param_1 + 0x709) == '\0')) &&
     (*(char *)(param_1 + 0x70a) != '\0')) {
    iVar4 = FUN_1400b8b80(param_1 + 0x778);
    if (iVar4 != 0) {
      FUN_1400b8c40(local_108);
      FUN_1400b9e90(local_108,param_1 + 0x778);
      FUN_1400b9e90(local_108,param_2);
      lVar6 = FUN_1400b4ae0(param_1,local_108,param_3);
      FUN_1400b92d0(local_108);
      return lVar6;
    }
    lVar6 = FUN_1400b4ae0(param_1,param_2,param_3);
    return lVar6;
  }
  if (uVar10 != 0) {
    cVar1 = *(char *)(param_1 + 0x709);
    local_118 = param_3;
    if ((cVar1 != '\0') && (*(char *)(param_1 + 0x70a) == '\0')) {
      _DAT_140316f18 = 0x68;
      FUN_1400d16e0(param_1 + 0x710);
      lVar6 = param_1 + 0x778;
      FUN_1400b8b30(lVar6);
      *(undefined1 *)(param_1 + 0x70b) = 0;
      uVar7 = FUN_1400b8b80(param_2);
      uVar7 = (uVar7 & 0xffffffff) % (ulonglong)uVar10;
      iVar4 = (int)uVar7;
      if (iVar4 != 0) {
        iVar5 = FUN_1400b8b80(param_2);
        uVar8 = FUN_1400b8ba0(param_2,iVar5 - iVar4);
        FUN_1400b97e0(lVar6,uVar8,uVar7);
        FUN_1400b8be0(param_2,uVar7);
      }
      _DAT_140316f18 = 0x69;
      lVar9 = FUN_1400b1c30(param_1,param_1 + 0x710,param_2,param_1 + 0x7a0);
      if (iVar4 == 0) {
        return lVar9;
      }
      FUN_1400b9e90(param_2,lVar6);
      return lVar9;
    }
    if (*(char *)(param_1 + 0x70b) == '\0') {
      if (cVar1 != '\0') goto LAB_1400b65b9;
      if (*(char *)(param_1 + 0x70a) == '\0') {
        FUN_1400d16e0(param_1 + 0x710);
        FUN_1400b8c40(local_108);
        FUN_1400b9e90(local_108,param_1 + 0x778);
        FUN_1400b9e90(local_108);
        FUN_1400b8b30(param_1 + 0x778);
        _DAT_140316f18 = 0x6a;
        uVar7 = FUN_1400b8b80(local_108);
        uVar7 = (uVar7 & 0xffffffff) % (ulonglong)uVar10;
        if ((int)uVar7 != 0) {
          iVar4 = FUN_1400b8b80(local_108);
          uVar8 = FUN_1400b8ba0(local_108,iVar4 - (int)uVar7);
          FUN_1400b8b30(param_1 + 0x778);
          FUN_1400b97e0(param_1 + 0x778,uVar8,uVar7);
          FUN_1400b8be0(local_108,uVar7);
        }
        _DAT_140316f18 = 0x6b;
        lVar6 = FUN_1400b1c30(param_1,param_1 + 0x710,local_108,param_1 + 0x7a0);
        FUN_1400b92d0(local_108);
        return lVar6;
      }
    }
    if (cVar1 == '\0') {
      if (*(char *)(param_1 + 0x70a) == '\0') {
        iVar4 = FUN_1400b8b80(param_1 + 0x778);
        iVar5 = FUN_1400b8b80(param_2);
        uVar10 = (uint)(iVar5 + iVar4) % uVar10;
        if (0x80 < uVar10) {
          uVar10 = 0x80;
        }
        _DAT_140316f18 = 0x6c;
        FUN_1400b8c40(local_108);
        lVar6 = param_1 + 0x778;
        puVar11 = param_2;
        if (iVar4 != 0) {
          FUN_1400b9e90(local_108,lVar6);
          FUN_1400b9e90(local_108,param_2);
          puVar11 = local_108;
          FUN_1400b8b30(lVar6);
        }
        uVar2 = 0;
        if (uVar10 != 0) {
          _DAT_140316f18 = 0x6d;
          iVar4 = FUN_1400b8b80(puVar11);
          local_e0 = (void *)FUN_1400b8ba0(puVar11,iVar4 - uVar10);
          FUN_1400b97e0(lVar6,local_e0,uVar10);
          FUN_1400b8be0(puVar11,uVar10);
          if (puVar11 == param_2) {
            memcpy(local_c8,local_e0,(ulonglong)uVar10);
            uVar2 = uVar10;
          }
        }
        _DAT_140316f18 = 0x6e;
        lVar6 = FUN_1400b2300(param_1,param_1 + 0x710,puVar11,param_1 + 0x7a0);
        if (uVar2 != 0) {
          FUN_1400b97e0(puVar11,local_c8,uVar2);
        }
        _DAT_140316f18 = 0x6f;
        FUN_1400b92d0(local_108);
        return lVar6;
      }
      if (*(char *)(param_1 + 0x70a) != '\0') {
        iVar4 = FUN_1400b8b80(param_1 + 0x778);
        if (iVar4 != 0) {
          _DAT_140316f18 = 0x70;
          FUN_1400b8c40(local_108);
          FUN_1400b9e90(local_108,param_1 + 0x778);
          FUN_1400b9e90(local_108,param_2);
          lVar6 = FUN_1400b27f0(param_1,param_1 + 0x710,local_108,param_1 + 0x7a0);
          FUN_1400b92d0(local_108);
          return lVar6;
        }
        _DAT_140316f18 = 0x71;
        lVar6 = FUN_1400b27f0(param_1,param_1 + 0x710,param_2,param_1 + 0x7a0);
        return lVar6;
      }
    }
  }
LAB_1400b65b9:
  _DAT_140316f18 = 0x72;
  lVar6 = FUN_1400b4ae0(param_1,param_2,param_3);
  if (lVar6 == 0) {
    (**(code **)(*param_3 + 0x28))(param_3,"Failed to decrypt.");
  }
  else {
    uVar3 = FUN_1400b8b80(lVar6);
    FUN_1400cf520(param_3,"outputSize",uVar3);
  }
  return lVar6;
}



undefined8
FUN_1400b6640(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             longlong *param_5,undefined1 param_6)

{
  undefined8 *puVar1;
  
  puVar1 = (undefined8 *)FUN_1400b5980(param_1,param_2,param_4,param_5,param_6);
  if (puVar1 == (undefined8 *)0x0) {
    (**(code **)(*param_5 + 0x28))(param_5,"Failed to encrypt data");
    return 0;
  }
  FUN_1400ba380(param_3,puVar1);
  (**(code **)*puVar1)(puVar1,1);
  return 1;
}



undefined8 FUN_1400b66d0(undefined8 param_1,undefined8 param_2,undefined8 param_3,longlong *param_4)

{
  undefined8 *puVar1;
  
  puVar1 = (undefined8 *)FUN_1400b5fd0(param_1,param_2,param_4);
  if (puVar1 == (undefined8 *)0x0) {
    (**(code **)(*param_4 + 0x28))(param_4,"Failed to decrypt data");
    return 0;
  }
  FUN_1400ba380(param_3,puVar1);
  (**(code **)*puVar1)(puVar1,1);
  return 1;
}



undefined8 FUN_1400b6750(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  longlong *plVar1;
  char cVar2;
  undefined8 *puVar3;
  undefined8 uVar4;
  undefined1 local_40 [40];
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400d1280(param_1 + 0x3c8);
  FUN_1400b0050(param_1 + 0x3f8,"EncryptStringENC");
  cVar2 = FUN_1400b3270(param_1);
  if (cVar2 != '\0') {
    FUN_1400b8c40(local_40);
    plVar1 = (longlong *)(param_1 + 0x408);
    cVar2 = FUN_1400afee0(param_1 + 0x3f8,param_1 + 0x818,param_2,local_40,0,1,1,plVar1,uVar4);
    if (cVar2 != '\0') {
      puVar3 = (undefined8 *)
               FUN_1400b5980(param_1,local_40,0,plVar1,*(undefined1 *)(param_1 + 0x6b0));
      if (puVar3 == (undefined8 *)0x0) {
        FUN_1400afe40(param_1 + 0x3f8,0);
        (**(code **)(*plVar1 + 0x50))(plVar1);
        FUN_1400d1290(param_1 + 0x3c8);
        FUN_1400b92d0(local_40);
        return 0;
      }
      FUN_1400bb190(param_1,puVar3,param_3,0);
      (**(code **)*puVar3)(puVar3,1);
      FUN_1400afe40(param_1 + 0x3f8,1);
      (**(code **)(*plVar1 + 0x50))(plVar1);
      FUN_1400d1290(param_1 + 0x3c8);
      FUN_1400b92d0(local_40);
      return 1;
    }
    FUN_1400d1290(param_1 + 0x3c8);
    FUN_1400b92d0(local_40);
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400b68d0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  longlong lVar1;
  char cVar2;
  undefined4 uVar3;
  int iVar4;
  undefined4 uVar5;
  uint uVar6;
  undefined8 uVar7;
  undefined8 *puVar8;
  undefined1 auStack_1c8 [32];
  undefined4 local_1a8;
  undefined1 *local_1a0;
  undefined1 local_198 [40];
  undefined1 local_170 [40];
  undefined8 local_148;
  undefined1 local_140 [56];
  undefined1 local_108 [192];
  ulonglong local_48;
  
  local_148 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_1c8;
  FUN_1400d1280(param_1 + 0x3c8);
  FUN_1400b0050(param_1 + 0x3f8,"DecryptStringENC");
  cVar2 = FUN_1400b3270(param_1);
  if (cVar2 != '\0') {
    FUN_1400b8c40(local_198);
    FUN_1400bad30(param_1,param_2,local_198,0);
    uVar3 = FUN_1400b8b80(local_198);
    FUN_1400cf520(param_1 + 0x408,"SizeAfterDecoding",uVar3);
    iVar4 = FUN_1400b8b80(local_198);
    if (iVar4 == 0) {
      cVar2 = FUN_1400b8070(param_2);
      if (cVar2 == '\0') {
        (**(code **)(*(longlong *)(param_1 + 0x408) + 0x28))
                  (param_1 + 0x408,"Input string does not conform to EncodingMode");
      }
      uVar3 = FUN_1400b8350(param_2);
      FUN_1400cf520(param_1 + 0x408,"InNumChars",uVar3);
      iVar4 = FUN_1400b8350(param_2);
      if (iVar4 < 1000) {
        lVar1 = *(longlong *)(param_1 + 0x408);
        uVar7 = FUN_1400b7ce0(param_2);
        (**(code **)(lVar1 + 0x58))(param_1 + 0x408,"InStr",uVar7);
      }
      FUN_1400baa50(param_1,param_1 + 0x408);
    }
    puVar8 = (undefined8 *)FUN_1400b5fd0(param_1,local_198,param_1 + 0x408);
    if (puVar8 != (undefined8 *)0x0) {
      if (*(char *)(param_1 + 0x6b0) != '\0') {
        uVar3 = FUN_1400b8b80(puVar8);
        FUN_1400cf520(param_1 + 0x408,"decryptedSizeInBytes",uVar3);
        uVar3 = FUN_1400c0c60(param_1 + 0x818);
        FUN_1400cf520(param_1 + 0x408,"codePage",uVar3);
        FUN_1400bcc20(local_140);
        uVar3 = FUN_1400b8b80(puVar8);
        uVar7 = FUN_1400b8b90(puVar8);
        FUN_1400be290(local_140,uVar7,uVar3);
        lVar1 = *(longlong *)(param_1 + 0x408);
        uVar7 = FUN_1400b8b90(local_140);
        (**(code **)(lVar1 + 0x58))(param_1 + 0x408,"decryptedData",uVar7);
        FUN_1400bceb0(local_140);
      }
      FUN_1400c2840(local_108);
      FUN_1400b8c40(local_170);
      uVar3 = FUN_1400b8b80(puVar8);
      uVar7 = FUN_1400b8b90(puVar8);
      uVar5 = FUN_1400c0c60(param_1 + 0x818);
      local_1a0 = local_170;
      local_1a8 = uVar3;
      FUN_1400cded0(local_108,uVar5,0x4b0,uVar7);
      iVar4 = FUN_1400b8b80(local_170);
      if (iVar4 == 0) {
        iVar4 = FUN_1400b8b80(puVar8);
        if (iVar4 != 0) {
          FUN_1400b9550(puVar8,0);
          uVar7 = FUN_1400b8b90(puVar8);
          FUN_1400b7200(param_3,uVar7);
        }
      }
      else {
        uVar6 = FUN_1400b8b80(local_170);
        uVar7 = FUN_1400b8b90(local_170);
        FUN_1400b74d0(param_3,uVar7,uVar6 >> 1);
      }
      (**(code **)*puVar8)(puVar8,1);
      FUN_1400afe40(param_1 + 0x3f8,1);
      (**(code **)(*(longlong *)(param_1 + 0x408) + 0x50))(param_1 + 0x408);
      FUN_1400d1290(param_1 + 0x3c8);
      FUN_1400b92d0(local_170);
      FUN_1400c2880(local_108);
      FUN_1400b92d0(local_198);
      return 1;
    }
    (**(code **)(*(longlong *)(param_1 + 0x408) + 0x28))(param_1 + 0x408,"Failed to decrypt data.");
    (**(code **)(*(longlong *)(param_1 + 0x408) + 0x50))(param_1 + 0x408);
    FUN_1400d1290(param_1 + 0x3c8);
    FUN_1400b92d0(local_198);
  }
  return 0;
}



undefined8
FUN_1400b6c80(longlong param_1,longlong *param_2,undefined8 param_3,undefined8 param_4,
             longlong *param_5)

{
  bool bVar1;
  bool bVar2;
  longlong *plVar3;
  char cVar4;
  int iVar5;
  undefined4 uVar6;
  undefined8 uVar7;
  undefined8 *puVar8;
  undefined8 uVar9;
  undefined1 local_d8 [40];
  undefined1 local_b0 [40];
  undefined8 local_88;
  undefined1 local_78 [64];
  
  plVar3 = param_5;
  local_88 = 0xfffffffffffffffe;
  (**(code **)(*param_5 + 0x48))(param_5,"encryptSourceToOutput",1);
  FUN_1400d1530(local_78,*(undefined4 *)(param_1 + 0x6f4));
  param_5._0_4_ = 0;
  FUN_1400b8c40(local_d8);
  FUN_1400ba520(local_d8,0xfa40);
  uVar7 = FUN_1400b8b90(local_d8);
  bVar1 = true;
  bVar2 = false;
  FUN_1400b8c40(local_b0);
  cVar4 = (**(code **)(*param_2 + 0x18))(param_2);
  while (cVar4 == '\0') {
    cVar4 = (**(code **)(*param_2 + 8))(param_2,uVar7,64000,&param_5,plVar3);
    if (cVar4 == '\0') {
      (**(code **)(*plVar3 + 0x28))(plVar3,"Failed to read next chunk from data source");
      (**(code **)(*plVar3 + 0x50))(plVar3);
      FUN_1400b92d0(local_b0);
      FUN_1400b92d0(local_d8);
      FUN_1400d17c0(local_78);
      return 0;
    }
    cVar4 = (**(code **)(*param_2 + 0x18))(param_2);
    if (cVar4 != '\0') {
      if (bVar1) {
        FUN_1400b8c10(local_d8,(int)param_5);
        puVar8 = (undefined8 *)
                 FUN_1400b5980(param_1,local_d8,param_4,plVar3,*(undefined1 *)(param_1 + 0x6b0));
        if (puVar8 != (undefined8 *)0x0) {
          iVar5 = FUN_1400b8b80(puVar8);
          if (iVar5 != 0) {
            uVar6 = FUN_1400b8b80(puVar8);
            uVar7 = FUN_1400b8b90(puVar8);
            FUN_140104440(param_3,uVar7,uVar6,1,plVar3);
          }
          (**(code **)*puVar8)(puVar8,1);
        }
        (**(code **)(*plVar3 + 0x50))(plVar3);
        FUN_1400b92d0(local_b0);
        FUN_1400b92d0(local_d8);
        goto LAB_1400b6f57;
      }
      bVar2 = true;
    }
    if ((int)param_5 == 0) break;
    FUN_1400b8c10(local_d8);
    if (bVar1) {
      puVar8 = (undefined8 *)FUN_1400b0b60();
    }
    else if (bVar2) {
      puVar8 = (undefined8 *)FUN_1400b1900();
    }
    else {
      puVar8 = (undefined8 *)FUN_1400b1580(param_1,local_78,local_d8,local_b0,plVar3);
    }
    if (puVar8 == (undefined8 *)0x0) {
      (**(code **)(*plVar3 + 0x28))(plVar3,"Failed to encrypt data source to output...");
      (**(code **)(*plVar3 + 0x50))(plVar3);
      FUN_1400b92d0(local_b0);
      FUN_1400b92d0(local_d8);
      FUN_1400d17c0(local_78);
      return 0;
    }
    iVar5 = FUN_1400b8b80(puVar8);
    if (iVar5 != 0) {
      uVar6 = FUN_1400b8b80(puVar8);
      uVar9 = FUN_1400b8b90(puVar8);
      FUN_140104440(param_3,uVar9,uVar6,1,plVar3);
    }
    (**(code **)*puVar8)(puVar8,1);
    bVar1 = false;
    cVar4 = (**(code **)(*param_2 + 0x18))(param_2);
  }
  (**(code **)(*plVar3 + 0x50))(plVar3);
  FUN_1400b92d0(local_b0);
  FUN_1400b92d0(local_d8);
LAB_1400b6f57:
  FUN_1400d17c0(local_78);
  return 1;
}



undefined8 * FUN_1400b6f80(undefined8 *param_1)

{
  *param_1 = CkObject::vftable;
  return param_1;
}



void FUN_1400b6f90(undefined8 *param_1)

{
  *param_1 = CkObject::vftable;
  return;
}



undefined8 * FUN_1400b6fa0(undefined8 *param_1,byte param_2)

{
  *param_1 = CkObject::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 *
FUN_1400b6fd0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  FUN_1400d0eb0();
  *param_1 = XString::vftable;
  *(undefined4 *)(param_1 + 2) = 0;
  *(undefined2 *)((longlong)param_1 + 0x14) = 0x101;
  *(undefined1 *)((longlong)param_1 + 0x16) = 1;
  FUN_1400b8c40(param_1 + 3);
  FUN_1400bcc20(param_1 + 8);
  FUN_1400bcc20(param_1 + 0xe);
  FUN_1400ba520(param_1 + 3,2,param_3,param_4,uVar1);
  FUN_1400b9550(param_1 + 3,0);
  FUN_1400b9550(param_1 + 3,0);
  FUN_1400bc9f0(param_1 + 8);
  FUN_1400bc9f0(param_1 + 0xe);
  return param_1;
}



void FUN_1400b7090(undefined8 *param_1)

{
  *param_1 = XString::vftable;
  FUN_1400bceb0(param_1 + 0xe);
  FUN_1400bceb0(param_1 + 8);
  FUN_1400b92d0(param_1 + 3);
  FUN_1400d0ee0(param_1);
  return;
}



void FUN_1400b70e0(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x10) = 0;
  FUN_1400bbe30(param_1 + 0x40);
  FUN_1400bbe30(param_1 + 0x70);
  FUN_1400b8b00(param_1 + 0x18);
  FUN_1400b9550(param_1 + 0x18,0);
  FUN_1400b9550(param_1 + 0x18,0);
  *(undefined2 *)(param_1 + 0x14) = 0x101;
  *(undefined1 *)(param_1 + 0x16) = 1;
  FUN_1400bbde0(param_1 + 0x40);
  FUN_1400bbde0(param_1 + 0x70);
  FUN_1400bc9f0(param_1 + 0x40);
  FUN_1400bc9f0(param_1 + 0x70);
  return;
}



void FUN_1400b7180(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x10) = 0;
  FUN_1400bbe30(param_1 + 0x40);
  FUN_1400bbe30(param_1 + 0x70);
  FUN_1400b8b30(param_1 + 0x18);
  FUN_1400b9550(param_1 + 0x18,0);
  FUN_1400b9550(param_1 + 0x18,0);
  *(undefined2 *)(param_1 + 0x14) = 0x101;
  *(undefined1 *)(param_1 + 0x16) = 1;
  FUN_1400bc9f0(param_1 + 0x40);
  FUN_1400bc9f0(param_1 + 0x70);
  return;
}



void FUN_1400b7200(longlong param_1,char *param_2)

{
  *(undefined4 *)(param_1 + 0x10) = 1;
  if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
    *(undefined1 *)(param_1 + 0x16) = 0;
    FUN_1400bbe30(param_1 + 0x70);
    *(undefined1 *)(param_1 + 0x14) = 0;
    FUN_1400b8b30(param_1 + 0x18);
    *(undefined1 *)(param_1 + 0x15) = 1;
    FUN_1400bdb00(param_1 + 0x40,param_2);
    FUN_1400bc9f0(param_1 + 0x40);
    return;
  }
  FUN_1400b7180();
  return;
}



void FUN_1400b7270(longlong param_1,char *param_2)

{
  if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
    *(undefined1 *)(param_1 + 0x16) = 1;
    *(undefined1 *)(param_1 + 0x14) = 0;
    FUN_1400b8b30(param_1 + 0x18);
    *(undefined1 *)(param_1 + 0x15) = 0;
    FUN_1400bbe30(param_1 + 0x40);
    *(undefined4 *)(param_1 + 0x10) = 0;
    if ((*param_2 == -0x11) && ((param_2[1] == -0x45 && (param_2[2] == -0x41)))) {
      param_2 = param_2 + 3;
    }
    FUN_1400bdb00(param_1 + 0x70,param_2);
    FUN_1400bc9f0(param_1 + 0x70);
    return;
  }
  FUN_1400b7180();
  return;
}



void FUN_1400b7300(longlong param_1,char *param_2,int param_3)

{
  if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
    *(undefined1 *)(param_1 + 0x16) = 1;
    FUN_1400bbe30(param_1 + 0x70);
    *(undefined1 *)(param_1 + 0x14) = 0;
    FUN_1400b8b30(param_1 + 0x18);
    *(undefined1 *)(param_1 + 0x15) = 0;
    FUN_1400bbe30(param_1 + 0x40);
    *(undefined4 *)(param_1 + 0x10) = 0;
    if ((((param_3 != 0) && (*param_2 == -0x11)) && (param_3 != 1)) &&
       (((param_2[1] == -0x45 && (param_3 != 2)) && (param_2[2] == -0x41)))) {
      param_3 = param_3 + -3;
      if (param_3 == 0) {
        return;
      }
      param_2 = param_2 + 3;
    }
    FUN_1400bc8a0(param_1 + 0x70,param_2,param_3);
    FUN_1400bc9f0(param_1 + 0x70);
    return;
  }
  FUN_1400b7180();
  return;
}



void FUN_1400b73d0(longlong param_1,longlong param_2)

{
  if (param_2 != param_1) {
    *(undefined4 *)(param_1 + 0x10) = *(undefined4 *)(param_2 + 0x10);
    *(undefined1 *)(param_1 + 0x14) = *(undefined1 *)(param_2 + 0x14);
    *(undefined1 *)(param_1 + 0x15) = *(undefined1 *)(param_2 + 0x15);
    *(undefined1 *)(param_1 + 0x16) = *(undefined1 *)(param_2 + 0x16);
    FUN_1400b8b30();
    FUN_1400b9e90(param_1 + 0x18,param_2 + 0x18);
    FUN_1400bdc90(param_1 + 0x40,param_2 + 0x40);
    FUN_1400bdc90(param_1 + 0x70,param_2 + 0x70);
  }
  return;
}



void FUN_1400b7450(longlong param_1,char *param_2)

{
  if ((param_2 != (char *)0x0) && ((*param_2 != '\0' || (param_2[1] != '\0')))) {
    *(undefined1 *)(param_1 + 0x15) = 0;
    FUN_1400bbe30(param_1 + 0x40);
    *(undefined1 *)(param_1 + 0x16) = 0;
    FUN_1400bbe30(param_1 + 0x70);
    FUN_1400b8b30(param_1 + 0x18);
    FUN_1400ba580(param_1 + 0x18,param_2);
    *(undefined1 *)(param_1 + 0x14) = 1;
    *(undefined4 *)(param_1 + 0x10) = 0;
    return;
  }
  FUN_1400b7180();
  return;
}



void FUN_1400b74d0(longlong param_1,char *param_2,int param_3)

{
  if (((param_2 != (char *)0x0) && (param_3 != 0)) && ((*param_2 != '\0' || (param_2[1] != '\0'))))
  {
    *(undefined1 *)(param_1 + 0x15) = 0;
    FUN_1400bbe30(param_1 + 0x40);
    *(undefined1 *)(param_1 + 0x16) = 0;
    FUN_1400bbe30(param_1 + 0x70);
    FUN_1400b8b30(param_1 + 0x18);
    FUN_1400b97e0(param_1 + 0x18,param_2,param_3 * 2);
    FUN_1400b9550(param_1 + 0x18,0);
    FUN_1400b9550(param_1 + 0x18,0);
    *(undefined1 *)(param_1 + 0x14) = 1;
    *(undefined4 *)(param_1 + 0x10) = 0;
    return;
  }
  FUN_1400b7180();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400b7580(longlong param_1)

{
  longlong lVar1;
  undefined4 uVar2;
  UINT UVar3;
  undefined8 uVar4;
  undefined1 auStack_118 [32];
  undefined4 local_f8;
  longlong local_f0;
  undefined8 local_e8;
  undefined1 local_d8 [192];
  ulonglong local_18;
  
  local_e8 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_118;
  if (*(char *)(param_1 + 0x14) == '\0') {
    if (*(char *)(param_1 + 0x16) != '\0') {
      lVar1 = param_1 + 0x18;
      FUN_1400b8b30(lVar1);
      FUN_1400c2840(local_d8);
      uVar2 = FUN_1400bbb10(param_1 + 0x70);
      uVar4 = FUN_1400b8b90(param_1 + 0x70);
      local_f8 = uVar2;
      local_f0 = lVar1;
      FUN_1400cded0(local_d8,0xfde9,0x4b0,uVar4);
      FUN_1400b9550(lVar1,0);
      FUN_1400b9550(lVar1,0);
      *(undefined1 *)(param_1 + 0x14) = 1;
      uVar4 = FUN_1400b8b90(lVar1);
      FUN_1400c2880(local_d8);
      return uVar4;
    }
    if (*(char *)(param_1 + 0x15) != '\0') {
      lVar1 = param_1 + 0x18;
      FUN_1400b8b30(lVar1);
      FUN_1400c2840(local_d8);
      uVar2 = FUN_1400bbb10(param_1 + 0x40);
      uVar4 = FUN_1400b8b90(param_1 + 0x40);
      UVar3 = GetACP();
      local_f8 = uVar2;
      local_f0 = lVar1;
      FUN_1400cded0(local_d8,UVar3,0x4b0,uVar4);
      FUN_1400b9550(lVar1,0);
      FUN_1400b9550(lVar1,0);
      *(undefined1 *)(param_1 + 0x14) = 1;
      uVar4 = FUN_1400b8b90(lVar1);
      FUN_1400c2880(local_d8);
      return uVar4;
    }
    FUN_1400b7180();
  }
  uVar4 = FUN_1400b8b90(param_1 + 0x18);
  return uVar4;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1400b7720(longlong param_1)

{
  int iVar1;
  char cVar2;
  undefined4 uVar3;
  UINT UVar4;
  undefined8 uVar5;
  undefined1 auStack_138 [32];
  undefined4 local_118;
  undefined1 *local_110;
  undefined1 local_108 [40];
  undefined8 local_e0;
  undefined1 local_d8 [192];
  ulonglong local_18;
  
  local_e0 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_138;
  iVar1 = *(int *)(param_1 + 0x10);
  if (iVar1 != 1) {
    if (iVar1 == 2) {
      return 0;
    }
    if (*(char *)(param_1 + 0x14) != '\0') {
      FUN_1400b8c40(local_108);
      FUN_1400c2840(local_d8);
      uVar3 = FUN_1400b8b80(param_1 + 0x18);
      uVar5 = FUN_1400b8b90(param_1 + 0x18);
      UVar4 = GetACP();
      local_110 = local_108;
      local_118 = uVar3;
      cVar2 = FUN_1400cded0(local_d8,0x4b0,UVar4,uVar5);
      FUN_1400bbe30(param_1 + 0x40);
      uVar3 = FUN_1400b8b40(local_108);
      uVar5 = FUN_1400b8b90(local_108);
      FUN_1400bc8a0(param_1 + 0x40,uVar5,uVar3);
      *(undefined1 *)(param_1 + 0x15) = 1;
      if (cVar2 == '\0') {
        FUN_1400bbe30(param_1 + 0x40);
        *(undefined1 *)(param_1 + 0x15) = 0;
        *(undefined4 *)(param_1 + 0x10) = 2;
      }
      else {
        *(undefined4 *)(param_1 + 0x10) = 1;
      }
      iVar1 = *(int *)(param_1 + 0x10);
      FUN_1400c2880(local_d8);
      FUN_1400b92d0(local_108);
      return (ulonglong)(iVar1 == 1);
    }
    if (*(char *)(param_1 + 0x16) != '\0') {
      FUN_1400b8c40(local_108);
      FUN_1400c2840(local_d8);
      uVar3 = FUN_1400bbb10(param_1 + 0x70);
      uVar5 = FUN_1400b8b90(param_1 + 0x70);
      UVar4 = GetACP();
      local_110 = local_108;
      local_118 = uVar3;
      cVar2 = FUN_1400cded0(local_d8,0xfde9,UVar4,uVar5);
      FUN_1400bbe30(param_1 + 0x40);
      uVar3 = FUN_1400b8b80(local_108);
      uVar5 = FUN_1400b8b90(local_108);
      FUN_1400bc8a0(param_1 + 0x40,uVar5,uVar3);
      *(undefined1 *)(param_1 + 0x15) = 1;
      if (cVar2 == '\0') {
        FUN_1400bbe30(param_1 + 0x40);
        *(undefined1 *)(param_1 + 0x15) = 0;
        *(undefined4 *)(param_1 + 0x10) = 2;
      }
      else {
        *(undefined4 *)(param_1 + 0x10) = 1;
      }
      iVar1 = *(int *)(param_1 + 0x10);
      FUN_1400c2880(local_d8);
      FUN_1400b92d0(local_108);
      return (ulonglong)(iVar1 == 1);
    }
  }
  return CONCAT71((uint7)(uint3)((uint)iVar1 >> 8),1);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400b7950(longlong param_1)

{
  char cVar1;
  undefined4 uVar2;
  UINT UVar3;
  uint uVar4;
  int iVar5;
  undefined8 uVar6;
  undefined1 auStack_138 [32];
  int local_118;
  undefined1 *local_110;
  undefined1 local_108 [40];
  undefined8 local_e0;
  undefined1 local_d8 [192];
  ulonglong local_18;
  
  local_e0 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_138;
  if (*(char *)(param_1 + 0x15) == '\0') {
    if (*(char *)(param_1 + 0x16) != '\0') {
      FUN_1400b8c40(local_108);
      FUN_1400c2840(local_d8);
      uVar2 = FUN_1400bbb10(param_1 + 0x70);
      uVar6 = FUN_1400b8b90(param_1 + 0x70);
      UVar3 = GetACP();
      local_110 = local_108;
      local_118 = uVar2;
      cVar1 = FUN_1400cded0(local_d8,0xfde9,UVar3,uVar6);
      FUN_1400b9550(local_108,0);
      FUN_1400bda60(param_1 + 0x40,local_108);
      *(undefined1 *)(param_1 + 0x15) = 1;
      *(uint *)(param_1 + 0x10) = 2 - (uint)(cVar1 != '\0');
      uVar6 = FUN_1400b8b90(param_1 + 0x40);
      FUN_1400c2880(local_d8);
      FUN_1400b92d0(local_108);
      return uVar6;
    }
    if (*(char *)(param_1 + 0x14) != '\0') {
      FUN_1400b8c40(local_108);
      cVar1 = '\x01';
      uVar4 = FUN_1400b8b80(param_1 + 0x18);
      if (3 < uVar4) {
        FUN_1400c2840(local_d8);
        iVar5 = FUN_1400b8b80(param_1 + 0x18);
        uVar6 = FUN_1400b8b90(param_1 + 0x18);
        UVar3 = GetACP();
        local_110 = local_108;
        local_118 = iVar5 + -2;
        cVar1 = FUN_1400cded0(local_d8,0x4b0,UVar3,uVar6);
        FUN_1400c2880(local_d8);
      }
      FUN_1400bbe30(param_1 + 0x40);
      uVar2 = FUN_1400b8b80(local_108);
      uVar6 = FUN_1400b8b90(local_108);
      FUN_1400bc8a0(param_1 + 0x40,uVar6,uVar2);
      *(undefined1 *)(param_1 + 0x15) = 1;
      FUN_1400bc9f0(param_1 + 0x40);
      *(uint *)(param_1 + 0x10) = 2 - (uint)(cVar1 != '\0');
      uVar6 = FUN_1400b8b90(param_1 + 0x40);
      FUN_1400b92d0(local_108);
      return uVar6;
    }
    FUN_1400b7180();
  }
  uVar6 = FUN_1400b8b90(param_1 + 0x40);
  return uVar6;
}



void FUN_1400b7b60(longlong param_1,undefined8 param_2)

{
  if (*(char *)(param_1 + 0x15) == '\0') {
    FUN_1400b7950();
  }
  *(undefined1 *)(param_1 + 0x14) = 0;
  *(undefined1 *)(param_1 + 0x16) = 0;
  FUN_1400bc640(param_1 + 0x40,param_2);
  return;
}



void FUN_1400b7ba0(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  if (*(char *)(param_1 + 0x15) == '\0') {
    FUN_1400b7950();
  }
  *(undefined1 *)(param_1 + 0x14) = 0;
  *(undefined1 *)(param_1 + 0x16) = 0;
  FUN_1400bc8a0(param_1 + 0x40,param_2,param_3);
  return;
}



void FUN_1400b7bf0(longlong param_1,longlong param_2)

{
  uint uVar1;
  
  if (param_2 != 0) {
    if (*(char *)(param_1 + 0x14) == '\0') {
      FUN_1400b7580();
    }
    *(undefined2 *)(param_1 + 0x15) = 0;
    param_1 = param_1 + 0x18;
    uVar1 = FUN_1400b8b80(param_1);
    if (1 < uVar1) {
      FUN_1400b8be0(param_1,2);
    }
    FUN_1400ba580(param_1,param_2);
  }
  return;
}



void FUN_1400b7c50(longlong param_1,longlong param_2,int param_3)

{
  uint uVar1;
  
  if ((param_2 != 0) && (param_3 != 0)) {
    if (*(char *)(param_1 + 0x14) == '\0') {
      FUN_1400b7580();
    }
    *(undefined2 *)(param_1 + 0x15) = 0;
    param_1 = param_1 + 0x18;
    uVar1 = FUN_1400b8b80(param_1);
    if (1 < uVar1) {
      FUN_1400b8be0(param_1,2);
    }
    FUN_1400b97e0(param_1,param_2,param_3 * 2);
    FUN_1400b9550(param_1,0);
    FUN_1400b9550(param_1,0);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400b7ce0(longlong param_1)

{
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  UINT UVar4;
  uint uVar5;
  undefined8 uVar6;
  undefined1 auStack_138 [32];
  int local_118;
  undefined1 *local_110;
  undefined1 local_108 [40];
  undefined8 local_e0;
  undefined1 local_d8 [192];
  ulonglong local_18;
  
  local_e0 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_138;
  if (*(char *)(param_1 + 0x16) == '\0') {
    if (*(char *)(param_1 + 0x15) != '\0') {
      FUN_1400b8c40(local_108);
      FUN_1400c2840(local_d8);
      iVar1 = FUN_1400bbb10(param_1 + 0x40);
      iVar2 = FUN_1400bbb10(param_1 + 0x40);
      FUN_1400ba520(local_108,iVar2 + 4 + ((int)((iVar1 >> 0x1f & 0xfU) + iVar1) >> 4));
      uVar3 = FUN_1400bbb10(param_1 + 0x40);
      uVar6 = FUN_1400b8b90(param_1 + 0x40);
      UVar4 = GetACP();
      local_110 = local_108;
      local_118 = uVar3;
      FUN_1400cded0(local_d8,UVar4,0xfde9,uVar6);
      FUN_1400b9550(local_108,0);
      FUN_1400bda60(param_1 + 0x70,local_108);
      *(undefined1 *)(param_1 + 0x16) = 1;
      uVar6 = FUN_1400b8b90(param_1 + 0x70);
      FUN_1400c2880(local_d8);
      FUN_1400b92d0(local_108);
      return uVar6;
    }
    if (*(char *)(param_1 + 0x14) != '\0') {
      FUN_1400b8c40(local_108);
      uVar5 = FUN_1400b8b80(param_1 + 0x18);
      if (3 < uVar5) {
        FUN_1400c2840(local_d8);
        iVar1 = FUN_1400b8b80(param_1 + 0x18);
        uVar6 = FUN_1400b8b90(param_1 + 0x18);
        local_110 = local_108;
        local_118 = iVar1 + -2;
        FUN_1400cded0(local_d8,0x4b0,0xfde9,uVar6);
        FUN_1400c2880(local_d8);
      }
      FUN_1400bbe30(param_1 + 0x70);
      uVar3 = FUN_1400b8b80(local_108);
      uVar6 = FUN_1400b8b90(local_108);
      FUN_1400bc8a0(param_1 + 0x70,uVar6,uVar3);
      *(undefined1 *)(param_1 + 0x16) = 1;
      FUN_1400bc9f0(param_1 + 0x70);
      uVar6 = FUN_1400b8b90(param_1 + 0x70);
      FUN_1400b92d0(local_108);
      return uVar6;
    }
    FUN_1400b7180();
  }
  uVar6 = FUN_1400b8b90(param_1 + 0x70);
  return uVar6;
}



bool FUN_1400b7f00(longlong param_1,char *param_2)

{
  int iVar1;
  wchar_t *_Str2;
  wchar_t *_Str1;
  undefined **local_b8 [2];
  undefined4 local_a8;
  undefined2 local_a4;
  undefined1 local_a2;
  undefined1 local_a0 [40];
  undefined1 local_78 [48];
  undefined1 local_48 [48];
  undefined8 local_18;
  
  local_18 = 0xfffffffffffffffe;
  FUN_1400b7580();
  FUN_1400b6fd0(local_b8);
  if ((param_2 == (char *)0x0) || (*param_2 == '\0')) {
    local_a8 = 0;
    FUN_1400bbe30(local_78);
    FUN_1400bbe30(local_48);
    FUN_1400b8b30(local_a0);
    FUN_1400b9550(local_a0,0);
    FUN_1400b9550(local_a0,0);
    local_a4 = 0x101;
    local_a2 = 1;
    FUN_1400bc9f0(local_78);
  }
  else {
    local_a2 = 1;
    local_a4 = (ushort)local_a4._1_1_ << 8;
    FUN_1400b8b30(local_a0);
    local_a4 = local_a4 & 0xff;
    FUN_1400bbe30(local_78);
    local_a8 = 0;
    if (((*param_2 == -0x11) && (param_2[1] == -0x45)) && (param_2[2] == -0x41)) {
      FUN_1400bdb00(local_48,param_2 + 3);
    }
    else {
      FUN_1400bdb00(local_48,param_2);
    }
  }
  FUN_1400bc9f0(local_48);
  FUN_1400b7580(local_b8);
  _Str2 = (wchar_t *)FUN_1400b8b90(local_a0);
  _Str1 = (wchar_t *)FUN_1400b8b90(param_1 + 0x18);
  iVar1 = _wcsicmp(_Str1,_Str2);
  local_b8[0] = XString::vftable;
  FUN_1400bceb0(local_48);
  FUN_1400bceb0(local_78);
  FUN_1400b92d0(local_a0);
  FUN_1400d0ee0(local_b8);
  return iVar1 == 0;
}



bool FUN_1400b8070(longlong param_1)

{
  int iVar1;
  
  if (*(char *)(param_1 + 0x16) != '\0') {
    iVar1 = FUN_1400bbb10(param_1 + 0x70);
    return iVar1 == 0;
  }
  if (*(char *)(param_1 + 0x15) != '\0') {
    iVar1 = FUN_1400bbb10(param_1 + 0x40);
    return iVar1 == 0;
  }
  iVar1 = FUN_1400b8b80(param_1 + 0x18);
  if (1 < iVar1) {
    iVar1 = iVar1 + -2;
  }
  return iVar1 == 0;
}



void FUN_1400b80d0(longlong param_1)

{
  if (*(char *)(param_1 + 0x16) == '\0') {
    FUN_1400b7ce0();
  }
  FUN_1400bbb10(param_1 + 0x70);
  return;
}



void FUN_1400b8100(longlong param_1)

{
  if (*(char *)(param_1 + 0x16) == '\0') {
    FUN_1400b7ce0();
  }
  FUN_1400bbc30(param_1 + 0x70);
  *(undefined2 *)(param_1 + 0x14) = 0;
  return;
}



void FUN_1400b8130(longlong param_1)

{
  FUN_1400b7580();
  FUN_1400b8d70(param_1 + 0x18,0);
  *(undefined2 *)(param_1 + 0x15) = 0;
  return;
}



undefined1 FUN_1400b8160(longlong param_1,char *param_2)

{
  undefined1 uVar1;
  
  if (param_2 != (char *)0x0) {
    if (*(char *)(param_1 + 0x16) == '\0') {
      FUN_1400b7ce0();
    }
    if (((*param_2 == -0x11) && (param_2[1] == -0x45)) && (param_2[2] == -0x41)) {
      param_2 = param_2 + 3;
    }
    uVar1 = FUN_1400bde10(param_1 + 0x70,param_2);
    return uVar1;
  }
  return 0;
}



void FUN_1400b81c0(longlong param_1,undefined1 param_2,undefined1 param_3)

{
  undefined2 *puVar1;
  undefined1 local_res10;
  undefined1 local_res11;
  undefined1 local_res12;
  undefined **local_a8 [2];
  undefined1 local_94;
  char local_93;
  undefined1 local_92;
  undefined1 local_90 [40];
  undefined1 local_68 [48];
  undefined1 local_38 [48];
  
  local_res12 = 0;
  local_res10 = param_2;
  local_res11 = param_3;
  FUN_1400b6fd0(local_a8);
  if (local_93 == '\0') {
    FUN_1400b7950(local_a8);
  }
  local_94 = 0;
  local_92 = 0;
  FUN_1400bc640(local_68,&local_res10);
  puVar1 = (undefined2 *)FUN_1400b7580(local_a8);
  if (puVar1 == (undefined2 *)0x0) {
    local_a8[0] = XString::vftable;
    FUN_1400bceb0(local_38);
    FUN_1400bceb0(local_68);
    FUN_1400b92d0(local_90);
  }
  else {
    FUN_1400b7580(param_1);
    FUN_1400b8d20(param_1 + 0x18,*puVar1,puVar1[1]);
    *(undefined2 *)(param_1 + 0x15) = 0;
    local_a8[0] = XString::vftable;
    FUN_1400bceb0(local_38);
    FUN_1400bceb0(local_68);
    FUN_1400b92d0(local_90);
  }
  FUN_1400d0ee0(local_a8);
  return;
}



longlong FUN_1400b82d0(longlong param_1)

{
  return param_1 + 0x18;
}



undefined8 * FUN_1400b82e0(undefined8 *param_1,uint param_2)

{
  *param_1 = XString::vftable;
  FUN_1400bceb0(param_1 + 0xe);
  FUN_1400bceb0(param_1 + 8);
  FUN_1400b92d0(param_1 + 3);
  FUN_1400d0ee0(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



ulonglong FUN_1400b8350(longlong param_1)

{
  int iVar1;
  ulonglong uVar2;
  
  if (*(char *)(param_1 + 0x15) != '\0') {
    uVar2 = FUN_1400bbb10(param_1 + 0x40);
    return uVar2;
  }
  if (*(char *)(param_1 + 0x14) == '\0') {
    FUN_1400b7580();
  }
  if (*(char *)(param_1 + 0x14) != '\0') {
    iVar1 = FUN_1400b8b80(param_1 + 0x18);
    if (1 < iVar1) {
      iVar1 = iVar1 + -2;
    }
    return (ulonglong)(uint)(iVar1 / 2);
  }
  return 0;
}



void FUN_1400b83b0(undefined8 param_1,undefined8 param_2,char param_3)

{
  if (param_3 != '\0') {
    FUN_1400b7270();
    return;
  }
  FUN_1400b7200();
  return;
}



void thunk_FUN_1400b7450(longlong param_1,char *param_2)

{
  if ((param_2 != (char *)0x0) && ((*param_2 != '\0' || (param_2[1] != '\0')))) {
    *(undefined1 *)(param_1 + 0x15) = 0;
    FUN_1400bbe30(param_1 + 0x40);
    *(undefined1 *)(param_1 + 0x16) = 0;
    FUN_1400bbe30(param_1 + 0x70);
    FUN_1400b8b30(param_1 + 0x18);
    FUN_1400ba580(param_1 + 0x18,param_2);
    *(undefined1 *)(param_1 + 0x14) = 1;
    *(undefined4 *)(param_1 + 0x10) = 0;
    return;
  }
  FUN_1400b7180();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 thunk_FUN_1400b7580(longlong param_1)

{
  longlong lVar1;
  undefined4 uVar2;
  UINT UVar3;
  undefined8 uVar4;
  undefined1 auStack_118 [32];
  undefined4 uStack_f8;
  longlong lStack_f0;
  undefined8 uStack_e8;
  undefined1 auStack_d8 [192];
  ulonglong uStack_18;
  
  uStack_e8 = 0xfffffffffffffffe;
  uStack_18 = DAT_1402f85a0 ^ (ulonglong)auStack_118;
  if (*(char *)(param_1 + 0x14) == '\0') {
    if (*(char *)(param_1 + 0x16) != '\0') {
      lVar1 = param_1 + 0x18;
      FUN_1400b8b30(lVar1);
      FUN_1400c2840(auStack_d8);
      uVar2 = FUN_1400bbb10(param_1 + 0x70);
      uVar4 = FUN_1400b8b90(param_1 + 0x70);
      uStack_f8 = uVar2;
      lStack_f0 = lVar1;
      FUN_1400cded0(auStack_d8,0xfde9,0x4b0,uVar4);
      FUN_1400b9550(lVar1,0);
      FUN_1400b9550(lVar1,0);
      *(undefined1 *)(param_1 + 0x14) = 1;
      uVar4 = FUN_1400b8b90(lVar1);
      FUN_1400c2880(auStack_d8);
      return uVar4;
    }
    if (*(char *)(param_1 + 0x15) != '\0') {
      lVar1 = param_1 + 0x18;
      FUN_1400b8b30(lVar1);
      FUN_1400c2840(auStack_d8);
      uVar2 = FUN_1400bbb10(param_1 + 0x40);
      uVar4 = FUN_1400b8b90(param_1 + 0x40);
      UVar3 = GetACP();
      uStack_f8 = uVar2;
      lStack_f0 = lVar1;
      FUN_1400cded0(auStack_d8,UVar3,0x4b0,uVar4);
      FUN_1400b9550(lVar1,0);
      FUN_1400b9550(lVar1,0);
      *(undefined1 *)(param_1 + 0x14) = 1;
      uVar4 = FUN_1400b8b90(lVar1);
      FUN_1400c2880(auStack_d8);
      return uVar4;
    }
    FUN_1400b7180();
  }
  uVar4 = FUN_1400b8b90(param_1 + 0x18);
  return uVar4;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 FUN_1400b83e0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  int iVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined1 auStack_1f8 [32];
  int local_1d8;
  undefined8 local_1d0;
  undefined8 local_1c8;
  undefined1 local_1b8 [192];
  undefined1 local_f8 [192];
  ulonglong local_38;
  
  local_1c8 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_1f8;
  uVar1 = 1;
  local_1d0 = param_3;
  if (*(char *)(param_1 + 0x14) == '\0') {
    if (*(char *)(param_1 + 0x16) == '\0') {
      FUN_1400b7ce0();
    }
    FUN_1400c2840(local_f8);
    uVar3 = FUN_1400bbb10(param_1 + 0x70);
    uVar5 = FUN_1400b8b90(param_1 + 0x70);
    uVar4 = FUN_1400c0c60(param_2);
    local_1d8 = uVar3;
    uVar1 = FUN_1400cded0(local_f8,0xfde9,uVar4,uVar5);
    FUN_1400c2880(local_f8);
  }
  else {
    iVar2 = FUN_1400b8b80(param_1 + 0x18);
    if (1 < iVar2) {
      iVar2 = iVar2 + -2;
    }
    FUN_1400b8b30(param_3);
    if (iVar2 != 0) {
      FUN_1400c2840(local_1b8);
      uVar5 = FUN_1400b8b90(param_1 + 0x18);
      uVar3 = FUN_1400c0c60(param_2);
      local_1d8 = iVar2;
      uVar1 = FUN_1400cded0(local_1b8,0x4b0,uVar3,uVar5);
      FUN_1400c2880(local_1b8);
    }
  }
  return uVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 FUN_1400b8520(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 uVar2;
  int iVar3;
  undefined8 uVar4;
  undefined1 *puVar5;
  undefined1 auStack_1e8 [32];
  int local_1c8;
  undefined8 local_1c0;
  undefined8 local_1b8;
  undefined1 local_1a8 [192];
  undefined1 local_e8 [192];
  ulonglong local_28;
  
  local_1b8 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_1e8;
  FUN_1400b8b30(param_3);
  local_1c0 = param_3;
  if (*(char *)(param_1 + 0x14) == '\0') {
    if (*(char *)(param_1 + 0x16) == '\0') {
      FUN_1400b7ce0(param_1);
    }
    FUN_1400c2840(local_e8);
    iVar3 = FUN_1400bbb10(param_1 + 0x70);
    uVar4 = FUN_1400b8b90(param_1 + 0x70);
    uVar2 = FUN_1400c0c60(param_2);
    local_1c8 = iVar3;
    uVar1 = FUN_1400ce720(local_e8,0xfde9,uVar2,uVar4);
    puVar5 = local_e8;
  }
  else {
    local_1c8 = FUN_1400b8b80(param_1 + 0x18);
    if (1 < local_1c8) {
      local_1c8 = local_1c8 + -2;
    }
    FUN_1400c2840(local_1a8);
    uVar4 = FUN_1400b8b90(param_1 + 0x18);
    uVar2 = FUN_1400c0c60(param_2);
    uVar1 = FUN_1400ce720(local_1a8,0x4b0,uVar2,uVar4);
    puVar5 = local_1a8;
  }
  FUN_1400c2880(puVar5);
  return uVar1;
}



undefined1 FUN_1400b8660(longlong param_1,char *param_2)

{
  undefined1 uVar1;
  
  if (param_2 != (char *)0x0) {
    if (*(char *)(param_1 + 0x16) == '\0') {
      FUN_1400b7ce0();
    }
    if (((*param_2 == -0x11) && (param_2[1] == -0x45)) && (param_2[2] == -0x41)) {
      param_2 = param_2 + 3;
    }
    uVar1 = FUN_1400bc7e0(param_1 + 0x70,param_2);
    return uVar1;
  }
  return 0;
}



void FUN_1400b86c0(longlong param_1,char *param_2)

{
  if (param_2 != (char *)0x0) {
    if (*(char *)(param_1 + 0x16) == '\0') {
      FUN_1400b7ce0();
    }
    *(undefined2 *)(param_1 + 0x14) = 0;
    if (((*param_2 == -0x11) && (param_2[1] == -0x45)) && (param_2[2] == -0x41)) {
      param_2 = param_2 + 3;
    }
    FUN_1400bc640(param_1 + 0x70,param_2);
  }
  return;
}



void FUN_1400b8720(longlong param_1,char *param_2,int param_3)

{
  if ((param_2 != (char *)0x0) && (param_3 != 0)) {
    if (*(char *)(param_1 + 0x16) == '\0') {
      FUN_1400b7ce0();
    }
    *(undefined2 *)(param_1 + 0x14) = 0;
    if ((((*param_2 == -0x11) && (param_3 != 1)) && (param_2[1] == -0x45)) &&
       ((param_3 != 2 && (param_2[2] == -0x41)))) {
      param_3 = param_3 + -3;
      if (param_3 == 0) {
        return;
      }
      param_2 = param_2 + 3;
    }
    FUN_1400bc8a0(param_1 + 0x70,param_2,param_3);
  }
  return;
}



longlong FUN_1400b87a0(longlong param_1)

{
  FUN_1400b7ce0();
  return param_1 + 0x70;
}



void FUN_1400b87c0(longlong param_1)

{
  uint uVar1;
  int iVar2;
  
  if (*(char *)(param_1 + 0x15) == '\0') {
    if (*(char *)(param_1 + 0x14) == '\0') {
      FUN_1400b7580();
    }
    if (*(char *)(param_1 + 0x14) == '\0') {
      uVar1 = 0;
    }
    else {
      iVar2 = FUN_1400b8b80(param_1 + 0x18);
      if (1 < iVar2) {
        iVar2 = iVar2 + -2;
      }
      uVar1 = iVar2 / 2;
    }
  }
  else {
    uVar1 = FUN_1400bbb10(param_1 + 0x40);
  }
  uVar1 = uVar1 & 0x80000001;
  if ((int)uVar1 < 0) {
    uVar1 = (uVar1 - 1 | 0xfffffffe) + 1;
  }
  if (uVar1 != 0) {
    if (*(char *)(param_1 + 0x16) == '\0') {
      FUN_1400b7ce0(param_1);
    }
    *(undefined2 *)(param_1 + 0x14) = 0;
    FUN_1400bbf40(param_1 + 0x70,&DAT_140279374);
  }
  return;
}



void FUN_1400b8850(longlong param_1,longlong param_2)

{
  char *pcVar1;
  undefined8 uVar2;
  
  if (*(char *)(param_2 + 0x16) == '\0') {
    if (*(char *)(param_2 + 0x14) != '\0') {
      uVar2 = FUN_1400b8b90(param_2 + 0x18);
      FUN_1400b7bf0(param_1,uVar2);
      return;
    }
    uVar2 = FUN_1400b8b90(param_2 + 0x40);
    if (*(char *)(param_1 + 0x15) == '\0') {
      FUN_1400b7950(param_1);
    }
    *(undefined1 *)(param_1 + 0x14) = 0;
    *(undefined1 *)(param_1 + 0x16) = 0;
    FUN_1400bc640(param_1 + 0x40,uVar2);
  }
  else {
    pcVar1 = (char *)FUN_1400b8b90(param_2 + 0x70);
    if (pcVar1 != (char *)0x0) {
      if (*(char *)(param_1 + 0x16) == '\0') {
        FUN_1400b7ce0(param_1);
      }
      *(undefined2 *)(param_1 + 0x14) = 0;
      if (((*pcVar1 == -0x11) && (pcVar1[1] == -0x45)) && (pcVar1[2] == -0x41)) {
        FUN_1400bc640(param_1 + 0x70,pcVar1 + 3);
        return;
      }
      FUN_1400bc640(param_1 + 0x70,pcVar1);
      return;
    }
  }
  return;
}



undefined8 FUN_1400b8930(longlong param_1,char *param_2)

{
  int iVar1;
  undefined8 uVar2;
  
  if (param_2 != (char *)0x0) {
    FUN_1400b7ce0();
    if (((*param_2 == -0x11) && (param_2[1] == -0x45)) && (param_2[2] == -0x41)) {
      param_2 = param_2 + 3;
    }
    uVar2 = FUN_1400bdf70(param_1 + 0x70,param_2);
    return uVar2;
  }
  if (*(char *)(param_1 + 0x15) == '\0') {
    if (*(char *)(param_1 + 0x14) == '\0') {
      FUN_1400b7580();
    }
    if (*(char *)(param_1 + 0x14) == '\0') {
      return 1;
    }
    iVar1 = FUN_1400b8b80(param_1 + 0x18);
    if (1 < iVar1) {
      iVar1 = iVar1 + -2;
    }
    iVar1 = iVar1 / 2;
  }
  else {
    iVar1 = FUN_1400bbb10(param_1 + 0x40);
  }
  if (iVar1 == 0) {
    return 1;
  }
  return 0;
}



int FUN_1400b89d0(longlong param_1,char *param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  char *_Str;
  char *pcVar2;
  undefined8 uVar3;
  undefined **local_a8 [2];
  char local_94;
  char local_93;
  undefined1 local_90 [40];
  undefined1 local_68 [48];
  undefined1 local_38 [48];
  
  uVar3 = 0xfffffffffffffffe;
  if (param_2 != (char *)0x0) {
    if (*(char *)(param_1 + 0x16) == '\0') {
      FUN_1400b7ce0();
    }
    if (((*param_2 == -0x11) && (param_2[1] == -0x45)) && (param_2[2] == -0x41)) {
      param_2 = param_2 + 3;
    }
    _Str = (char *)FUN_1400b8b90(param_1 + 0x70);
    pcVar2 = strstr(_Str,param_2);
    if (pcVar2 != (char *)0x0) {
      if (pcVar2 != _Str) {
        FUN_1400b6fd0(local_a8);
        FUN_1400b7300(local_a8,_Str,(int)pcVar2 - (int)_Str,param_4,uVar3);
        if (local_93 == '\0') {
          if ((local_94 == '\0') && (FUN_1400b7580(local_a8), local_94 == '\0')) {
            iVar1 = 0;
          }
          else {
            iVar1 = FUN_1400b8b80(local_90);
            if (1 < iVar1) {
              iVar1 = iVar1 + -2;
            }
            iVar1 = iVar1 / 2;
          }
        }
        else {
          iVar1 = FUN_1400bbb10(local_68);
        }
        local_a8[0] = XString::vftable;
        FUN_1400bceb0(local_38);
        FUN_1400bceb0(local_68);
        FUN_1400b92d0(local_90);
        FUN_1400d0ee0(local_a8);
        return iVar1;
      }
      return 0;
    }
  }
  return -1;
}



void FUN_1400b8b00(longlong param_1)

{
  if ((*(void **)(param_1 + 0x18) != (void *)0x0) && (*(uint *)(param_1 + 0x20) != 0)) {
    memset(*(void **)(param_1 + 0x18),0,(ulonglong)*(uint *)(param_1 + 0x20));
  }
  *(undefined4 *)(param_1 + 0x20) = 0;
  return;
}



void FUN_1400b8b30(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x20) = 0;
  return;
}



int FUN_1400b8b40(longlong param_1)

{
  char cVar1;
  longlong lVar2;
  uint uVar3;
  ulonglong uVar4;
  
  lVar2 = *(longlong *)(param_1 + 0x18);
  if ((lVar2 != 0) && (*(int *)(param_1 + 0x20) != 0)) {
    uVar3 = *(int *)(param_1 + 0x20) - 1;
    uVar4 = (ulonglong)uVar3;
    cVar1 = *(char *)(uVar4 + lVar2);
    while( true ) {
      if (cVar1 != '\0') {
        return uVar3 + 1;
      }
      if ((int)uVar4 == 0) break;
      uVar3 = (int)uVar4 - 1;
      uVar4 = (ulonglong)uVar3;
      cVar1 = *(char *)(uVar4 + lVar2);
    }
    return 0;
  }
  return *(int *)(param_1 + 0x20);
}



undefined4 FUN_1400b8b80(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x20);
}



undefined8 FUN_1400b8b90(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x18);
}



longlong FUN_1400b8ba0(longlong param_1,int param_2)

{
  if (((*(longlong *)(param_1 + 0x18) != 0) && (-1 < param_2)) &&
     (param_2 < *(int *)(param_1 + 0x20))) {
    return (longlong)param_2 + *(longlong *)(param_1 + 0x18);
  }
  return 0;
}



ulonglong FUN_1400b8bc0(longlong param_1)

{
  byte *pbVar1;
  
  pbVar1 = *(byte **)(param_1 + 0x18);
  if ((pbVar1 != (byte *)0x0) && (*(int *)(param_1 + 0x20) != 0)) {
    return (ulonglong)*pbVar1;
  }
  return (ulonglong)pbVar1 & 0xffffffffffffff00;
}



void FUN_1400b8be0(longlong param_1,uint param_2)

{
  uint uVar1;
  uint uVar2;
  
  uVar1 = *(uint *)(param_1 + 0x20);
  uVar2 = uVar1;
  if (param_2 < uVar1) {
    uVar2 = param_2;
  }
  *(uint *)(param_1 + 0x20) = uVar1 - uVar2;
  return;
}



void FUN_1400b8c00(longlong param_1)

{
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  return;
}



void FUN_1400b8c10(longlong param_1,uint param_2)

{
  *(uint *)(param_1 + 0x20) = param_2;
  if (*(uint *)(param_1 + 0x24) < param_2) {
    *(uint *)(param_1 + 0x20) = *(uint *)(param_1 + 0x24);
  }
  return;
}



undefined8 FUN_1400b8c20(longlong param_1)

{
  undefined8 uVar1;
  
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  uVar1 = *(undefined8 *)(param_1 + 0x18);
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined1 *)(param_1 + 0x11) = 0;
  return uVar1;
}



undefined8 * FUN_1400b8c40(undefined8 *param_1)

{
  FUN_1400d0eb0();
  param_1[3] = 0;
  param_1[4] = 0;
  *(undefined2 *)(param_1 + 2) = 0xdb;
  *param_1 = DataBuffer::vftable;
  return param_1;
}



undefined8 * FUN_1400b8c80(undefined8 *param_1,undefined8 param_2,undefined4 param_3)

{
  FUN_1400d0eb0();
  param_1[3] = param_2;
  *(undefined4 *)(param_1 + 4) = param_3;
  *(undefined4 *)((longlong)param_1 + 0x24) = param_3;
  *param_1 = DataBuffer::vftable;
  *(undefined2 *)(param_1 + 2) = 0xdb;
  return param_1;
}



void FUN_1400b8cd0(longlong param_1)

{
  undefined1 uVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  
  if ((1 < *(uint *)(param_1 + 0x20)) && (*(longlong *)(param_1 + 0x18) != 0)) {
    iVar3 = *(uint *)(param_1 + 0x20) - 1;
    lVar6 = 0;
    lVar4 = (longlong)iVar3;
    if (0 < iVar3) {
      do {
        lVar2 = *(longlong *)(param_1 + 0x18);
        lVar5 = lVar4 + -1;
        lVar6 = lVar6 + 1;
        uVar1 = *(undefined1 *)(lVar2 + -1 + lVar6);
        *(undefined1 *)(lVar2 + -1 + lVar6) = *(undefined1 *)(lVar2 + 1 + lVar5);
        *(undefined1 *)(lVar4 + *(longlong *)(param_1 + 0x18)) = uVar1;
        lVar4 = lVar5;
      } while (lVar6 < lVar5);
    }
  }
  return;
}



void FUN_1400b8d20(longlong param_1,short param_2,short param_3)

{
  short sVar1;
  uint uVar2;
  ulonglong uVar3;
  short *psVar4;
  
  if (((*(short **)(param_1 + 0x18) != (short *)0x0) && (param_2 != 0)) && (param_3 != 0)) {
    uVar2 = *(uint *)(param_1 + 0x20) >> 1;
    if ((uVar2 != 0) && (*(uint *)(param_1 + 0x20) >> 1 != 0)) {
      uVar3 = (ulonglong)uVar2;
      psVar4 = *(short **)(param_1 + 0x18);
      do {
        sVar1 = *psVar4;
        if (*psVar4 == param_2) {
          sVar1 = param_3;
        }
        uVar3 = uVar3 - 1;
        *psVar4 = sVar1;
        psVar4 = psVar4 + 1;
      } while (uVar3 != 0);
    }
  }
  return;
}



void FUN_1400b8d70(longlong param_1)

{
  undefined2 uVar1;
  uint uVar2;
  undefined2 *puVar3;
  ulonglong uVar4;
  
  if ((*(undefined2 **)(param_1 + 0x18) != (undefined2 *)0x0) &&
     (uVar2 = *(uint *)(param_1 + 0x20) >> 1, uVar2 != 0)) {
    uVar4 = (ulonglong)uVar2;
    puVar3 = *(undefined2 **)(param_1 + 0x18);
    do {
      uVar1 = FUN_140105890(*puVar3);
      uVar4 = uVar4 - 1;
      *puVar3 = uVar1;
      puVar3 = puVar3 + 1;
    } while (uVar4 != 0);
  }
  return;
}



undefined1 FUN_1400b8db0(longlong param_1,undefined8 param_2,longlong *param_3)

{
  char cVar1;
  uint uVar2;
  void *pvVar3;
  undefined1 uVar4;
  undefined1 local_res20 [8];
  uint local_e8;
  uint local_e4;
  undefined1 local_e0 [24];
  undefined1 local_c8 [8];
  undefined8 local_c0;
  undefined1 local_b8 [160];
  
  local_c0 = 0xfffffffffffffffe;
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  if (*(void **)(param_1 + 0x18) != (void *)0x0) {
    if (*(char *)(param_1 + 0x11) == '\0') {
      operator_delete(*(void **)(param_1 + 0x18));
    }
    *(undefined8 *)(param_1 + 0x18) = 0;
  }
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined1 *)(param_1 + 0x11) = 0;
  FUN_1400b6fd0(local_b8);
  FUN_1400b7450(local_b8,param_2);
  FUN_140104980(local_e0);
  cVar1 = FUN_1400c00c0(local_e0,local_b8,local_c8,param_3);
  if (cVar1 == '\0') {
    FUN_1401049e0(local_e0);
    FUN_1400b7090(local_b8);
    uVar4 = 0;
  }
  else {
    uVar2 = FUN_140104d40(local_e0);
    local_e4 = uVar2;
    if (uVar2 == 0xffffffff) {
      FUN_1401049e0(local_e0);
      FUN_1400b7090(local_b8);
      uVar4 = 0;
    }
    else if (uVar2 == 0) {
      FUN_1401049e0(local_e0);
      FUN_1400b7090(local_b8);
      uVar4 = 1;
    }
    else {
      pvVar3 = operator_new((ulonglong)(uVar2 + 4));
      *(void **)(param_1 + 0x18) = pvVar3;
      if (*(void **)(param_1 + 0x18) == (void *)0x0) {
        if (param_3 != (longlong *)0x0) {
          (**(code **)(*param_3 + 0x28))
                    (param_3,"Out of memory when loading Unicode file into data buffer.");
          FUN_1400cf520(param_3,"fileSize",uVar2);
        }
        FUN_1401049e0(local_e0);
        FUN_1400b7090(local_b8);
        uVar4 = 0;
      }
      else {
        memset(*(void **)(param_1 + 0x18),0,(ulonglong)(uVar2 + 4));
        *(uint *)(param_1 + 0x20) = uVar2;
        *(uint *)(param_1 + 0x24) = uVar2;
        local_e8 = 0;
        cVar1 = FUN_140104fa0(local_e0,*(undefined8 *)(param_1 + 0x18),uVar2,&local_e8,local_res20,
                              param_3);
        uVar4 = 1;
        if (cVar1 == '\0') {
          if (param_3 != (longlong *)0x0) {
            FUN_1400cf640(param_3);
          }
          uVar4 = 0;
        }
        if (local_e8 != uVar2) {
          uVar4 = 0;
        }
        FUN_1401049e0(local_e0);
        FUN_1400b7090(local_b8);
      }
    }
  }
  return uVar4;
}



undefined8 FUN_1400b8fc0(longlong param_1,undefined8 param_2,longlong *param_3)

{
  char cVar1;
  longlong lVar2;
  void *pvVar3;
  undefined8 uVar4;
  undefined1 local_res20 [8];
  int local_1a8;
  int local_1a4;
  int local_1a0 [2];
  undefined1 local_198 [24];
  undefined1 local_180 [8];
  undefined8 local_178;
  undefined1 local_168 [160];
  undefined1 local_c8 [160];
  
  local_178 = 0xfffffffffffffffe;
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  if (*(void **)(param_1 + 0x18) != (void *)0x0) {
    if (*(char *)(param_1 + 0x11) == '\0') {
      operator_delete(*(void **)(param_1 + 0x18));
    }
    *(undefined8 *)(param_1 + 0x18) = 0;
  }
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined1 *)(param_1 + 0x11) = 0;
  FUN_1400b6fd0(local_168);
  FUN_1400b7200(local_168,param_2);
  FUN_140104980(local_198);
  cVar1 = FUN_1400c00c0(local_198,local_168,local_180,param_3);
  if (cVar1 == '\0') {
    FUN_1401049e0(local_198);
    FUN_1400b7090(local_168);
    uVar4 = 0;
  }
  else {
    lVar2 = FUN_140104e00(local_198,param_3);
    if (lVar2 < 0) {
      FUN_1401049e0(local_198);
      FUN_1400b7090(local_168);
      uVar4 = 0;
    }
    else if (lVar2 == 0) {
      FUN_1401049e0(local_198);
      FUN_1400b7090(local_168);
      uVar4 = 1;
    }
    else {
      local_1a8 = 0;
      local_1a0[0] = 0;
      FUN_140105950(lVar2,&local_1a8,local_1a0);
      if (local_1a0[0] == 0) {
        pvVar3 = operator_new((ulonglong)(local_1a8 + 4));
        *(void **)(param_1 + 0x18) = pvVar3;
        if (*(void **)(param_1 + 0x18) == (void *)0x0) {
          if (param_3 != (longlong *)0x0) {
            (**(code **)(*param_3 + 0x28))(param_3,"Out of memory");
            FUN_1400cf520(param_3,"fileSize",local_1a8);
          }
          FUN_1401049e0(local_198);
          FUN_1400b7090(local_168);
          uVar4 = 0;
        }
        else {
          memset(*(void **)(param_1 + 0x18),0,(ulonglong)(local_1a8 + 4));
          *(int *)(param_1 + 0x20) = local_1a8;
          *(int *)(param_1 + 0x24) = local_1a8 + 4;
          local_1a4 = 0;
          cVar1 = FUN_140104fa0(local_198,*(undefined8 *)(param_1 + 0x18),local_1a8,&local_1a4,
                                local_res20,param_3);
          uVar4 = 1;
          if (cVar1 == '\0') {
            if (param_3 != (longlong *)0x0) {
              (**(code **)(*param_3 + 0x58))(param_3,"filename",param_2);
              FUN_1400b6fd0(local_c8);
              FUN_1400beda0(local_c8);
              lVar2 = *param_3;
              uVar4 = FUN_1400b7950(local_c8);
              (**(code **)(lVar2 + 0x58))(param_3,"current_dir",uVar4);
              FUN_1400b7090(local_c8);
            }
            uVar4 = 0;
          }
          if (local_1a4 != local_1a8) {
            if (param_3 != (longlong *)0x0) {
              FUN_1400cf520(param_3,"fileSize");
              FUN_1400cf520(param_3,"numBytesRead",local_1a4);
              (**(code **)(*param_3 + 0x28))(param_3,"Failed to read the entire file (2)");
            }
            uVar4 = 0;
          }
          FUN_1401049e0(local_198);
          FUN_1400b7090(local_168);
        }
      }
      else {
        if (param_3 != (longlong *)0x0) {
          (**(code **)(*param_3 + 0x28))(param_3,"Out of memory for data buffer");
          FUN_1400cf580(param_3,"fileSize",lVar2);
        }
        FUN_1401049e0(local_198);
        FUN_1400b7090(local_168);
        uVar4 = 0;
      }
    }
  }
  return uVar4;
}



void FUN_1400b92d0(undefined8 *param_1)

{
  *param_1 = DataBuffer::vftable;
  *(undefined1 *)(param_1 + 2) = 0;
  if ((void *)param_1[3] != (void *)0x0) {
    if (*(char *)((longlong)param_1 + 0x11) == '\0') {
      operator_delete((void *)param_1[3]);
    }
    param_1[3] = 0;
  }
  param_1[4] = 0;
  FUN_1400d0ee0(param_1);
  return;
}



undefined8 FUN_1400b9330(longlong param_1,uint param_2)

{
  void *_Dst;
  undefined8 uVar1;
  
  _Dst = operator_new((ulonglong)param_2);
  if (_Dst == (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x18));
    *(undefined8 *)(param_1 + 0x18) = 0;
    *(undefined8 *)(param_1 + 0x20) = 0;
    uVar1 = 0;
  }
  else {
    if (*(uint *)(param_1 + 0x20) != 0) {
      memcpy(_Dst,*(void **)(param_1 + 0x18),(ulonglong)*(uint *)(param_1 + 0x20));
    }
    if ((*(char *)(param_1 + 0x11) == '\0') && (*(void **)(param_1 + 0x18) != (void *)0x0)) {
      operator_delete(*(void **)(param_1 + 0x18));
    }
    *(void **)(param_1 + 0x18) = _Dst;
    *(uint *)(param_1 + 0x24) = param_2;
    uVar1 = 1;
  }
  *(undefined1 *)(param_1 + 0x11) = 0;
  return uVar1;
}



longlong FUN_1400b93e0(longlong param_1,longlong param_2)

{
  uint uVar1;
  int iVar2;
  undefined4 extraout_var;
  
  uVar1 = *(uint *)(param_1 + 0x20);
  if (*(uint *)(param_2 + 0x20) != uVar1) {
    return (ulonglong)(uint3)(uVar1 >> 8) << 8;
  }
  if (uVar1 == 0) {
    return 1;
  }
  iVar2 = memcmp(*(void **)(param_2 + 0x18),*(void **)(param_1 + 0x18),(ulonglong)uVar1);
  return CONCAT71((int7)(CONCAT44(extraout_var,iVar2) >> 8),iVar2 == 0);
}



bool FUN_1400b9420(longlong param_1,void *param_2,uint param_3)

{
  int iVar1;
  
  if (param_3 == *(uint *)(param_1 + 0x20)) {
    if (param_3 == 0) {
      return true;
    }
    if (param_2 != (void *)0x0) {
      iVar1 = memcmp(param_2,*(void **)(param_1 + 0x18),(ulonglong)param_3);
      return iVar1 == 0;
    }
  }
  return false;
}



void FUN_1400b9460(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  if (*(void **)(param_1 + 0x18) != (void *)0x0) {
    if (*(char *)(param_1 + 0x11) == '\0') {
      operator_delete(*(void **)(param_1 + 0x18));
    }
    *(undefined8 *)(param_1 + 0x18) = 0;
    *(undefined8 *)(param_1 + 0x20) = 0;
  }
  *(undefined8 *)(param_1 + 0x18) = param_2;
  *(undefined4 *)(param_1 + 0x24) = param_3;
  *(undefined4 *)(param_1 + 0x20) = param_3;
  *(undefined1 *)(param_1 + 0x11) = 1;
  return;
}



void FUN_1400b94d0(longlong param_1,longlong param_2)

{
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  if (*(void **)(param_1 + 0x18) != (void *)0x0) {
    if (*(char *)(param_1 + 0x11) == '\0') {
      operator_delete(*(void **)(param_1 + 0x18));
    }
    *(undefined8 *)(param_1 + 0x18) = 0;
    *(undefined8 *)(param_1 + 0x20) = 0;
  }
  *(undefined1 *)(param_1 + 0x11) = *(undefined1 *)(param_2 + 0x11);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(param_2 + 0x20);
  *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(param_2 + 0x24);
  *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
  *(undefined8 *)(param_2 + 0x18) = 0;
  *(undefined8 *)(param_2 + 0x20) = 0;
  return;
}



ulonglong FUN_1400b9550(longlong param_1,undefined1 param_2)

{
  uint uVar1;
  ulonglong uVar2;
  
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  uVar1 = *(int *)(param_1 + 0x20) + 1;
  uVar2 = (ulonglong)uVar1;
  if (*(uint *)(param_1 + 0x24) < uVar1) {
    uVar2 = FUN_1400b9330(param_1,*(int *)(param_1 + 0x20) + 10000);
    if ((char)uVar2 == '\0') goto LAB_1400b9588;
  }
  if (*(longlong *)(param_1 + 0x18) != 0) {
    uVar1 = *(uint *)(param_1 + 0x20);
    *(undefined1 *)((ulonglong)uVar1 + *(longlong *)(param_1 + 0x18)) = param_2;
    *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) + 1;
    return CONCAT71((uint7)(uint3)(uVar1 >> 8),1);
  }
LAB_1400b9588:
  return uVar2 & 0xffffffffffffff00;
}



undefined8 FUN_1400b95c0(longlong param_1,undefined1 param_2,uint param_3)

{
  char cVar1;
  uint uVar2;
  ulonglong uVar3;
  
  uVar3 = (ulonglong)param_3;
  if (param_3 != 0) {
    if (*(char *)(param_1 + 0x10) != -0x25) {
      DAT_00000000 = 0x78;
    }
    uVar2 = *(int *)(param_1 + 0x20) + param_3;
    if (((*(uint *)(param_1 + 0x24) < uVar2) &&
        (cVar1 = FUN_1400b9330(param_1,uVar2 + 10000), cVar1 == '\0')) ||
       (*(longlong *)(param_1 + 0x18) == 0)) {
      return 0;
    }
    if (param_3 != 0) {
      do {
        *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x20) + *(longlong *)(param_1 + 0x18)) =
             param_2;
        *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) + 1;
        uVar3 = uVar3 - 1;
      } while (uVar3 != 0);
    }
  }
  return 1;
}



uint FUN_1400b9660(longlong param_1,ushort param_2)

{
  char cVar1;
  uint uVar2;
  uint uVar3;
  undefined1 local_res8;
  byte local_res9;
  byte local_resa;
  
  if (param_2 < 0x80) {
    uVar3 = 1;
  }
  else {
    uVar3 = 3 - (param_2 < 0x800);
  }
  if (uVar3 != 1) {
    if (uVar3 != 2) {
      if (uVar3 != 3) goto LAB_1400b96c7;
      local_resa = (byte)param_2 & 0x3f | 0x80;
      param_2 = param_2 >> 6 | 0x800;
    }
    local_res9 = (byte)param_2 & 0x3f | 0x80;
    param_2 = (param_2 | 0x3000) >> 6;
  }
  local_res8 = (undefined1)param_2;
LAB_1400b96c7:
  if (*(uint *)(param_1 + 0x24) < *(int *)(param_1 + 0x20) + uVar3) {
    uVar2 = uVar3;
    if (uVar3 < 20000) {
      uVar2 = 20000;
    }
    cVar1 = FUN_1400b9330(param_1,*(int *)(param_1 + 0x20) + uVar2);
    if (cVar1 == '\0') {
      return 0;
    }
  }
  if (*(longlong *)(param_1 + 0x18) == 0) {
    return 0;
  }
  memcpy((void *)((ulonglong)*(uint *)(param_1 + 0x20) + *(longlong *)(param_1 + 0x18)),&local_res8,
         (longlong)(int)uVar3);
  *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) + uVar3;
  return uVar3;
}



void FUN_1400b9730(longlong param_1,uint param_2)

{
  uint uVar1;
  
  if ((((((11999999 < param_2) || (uVar1 = 12000000, *(uint *)(param_1 + 0x20) < 12000000)) &&
        ((7999999 < param_2 || (uVar1 = 8000000, *(uint *)(param_1 + 0x20) < 8000000)))) &&
       ((3999999 < param_2 || (uVar1 = 4000000, *(uint *)(param_1 + 0x20) < 4000000)))) &&
      ((2999999 < param_2 || (uVar1 = 3000000, *(uint *)(param_1 + 0x20) < 3000000)))) &&
     (((((1999999 < param_2 || (uVar1 = 2000000, *(uint *)(param_1 + 0x20) < 2000000)) &&
        ((999999 < param_2 || (uVar1 = 1000000, *(uint *)(param_1 + 0x20) < 1000000)))) &&
       ((99999 < param_2 || (uVar1 = 100000, *(uint *)(param_1 + 0x20) < 100000)))) &&
      (((49999 < param_2 || (uVar1 = 50000, *(uint *)(param_1 + 0x20) < 50000)) &&
       (uVar1 = param_2, param_2 < 20000)))))) {
    uVar1 = 20000;
  }
  FUN_1400b9330(param_1,uVar1 + *(int *)(param_1 + 0x20));
  return;
}



undefined8 FUN_1400b97e0(longlong param_1,void *param_2,uint param_3)

{
  char cVar1;
  
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  if ((param_2 != (void *)0x0) && (param_3 != 0)) {
    if ((*(uint *)(param_1 + 0x24) < param_3 + *(int *)(param_1 + 0x20)) &&
       (cVar1 = FUN_1400b9730(param_1,(ulonglong)param_3), cVar1 == '\0')) {
      return 0;
    }
    if (*(longlong *)(param_1 + 0x18) == 0) {
      return 0;
    }
    memcpy((void *)((ulonglong)*(uint *)(param_1 + 0x20) + *(longlong *)(param_1 + 0x18)),param_2,
           (ulonglong)param_3);
    *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) + param_3;
  }
  return 1;
}



void FUN_1400b9870(longlong param_1)

{
  undefined1 uVar1;
  int iVar2;
  undefined4 *puVar3;
  undefined1 *puVar4;
  uint uVar5;
  ulonglong uVar6;
  undefined4 local_res8;
  
  if (*(undefined4 **)(param_1 + 0x18) != (undefined4 *)0x0) {
    uVar5 = *(uint *)(param_1 + 0x20) >> 2;
    if (*(uint *)(param_1 + 0x20) >> 2 != 0) {
      uVar6 = (ulonglong)uVar5;
      puVar3 = *(undefined4 **)(param_1 + 0x18);
      do {
        uVar6 = uVar6 - 1;
        local_res8 = CONCAT13(*(undefined1 *)puVar3,
                              CONCAT12(*(undefined1 *)((longlong)puVar3 + 1),
                                       CONCAT11(*(undefined1 *)((longlong)puVar3 + 2),
                                                *(undefined1 *)((longlong)puVar3 + 3))));
        *puVar3 = local_res8;
        puVar3 = puVar3 + 1;
      } while (uVar6 != 0);
    }
    iVar2 = *(int *)(param_1 + 0x20) + uVar5 * -4;
    if (iVar2 == 2) {
      puVar4 = (undefined1 *)((longlong)(int)(uVar5 * 4) + *(longlong *)(param_1 + 0x18));
      uVar1 = puVar4[1];
      puVar4[1] = *puVar4;
      *puVar4 = uVar1;
      return;
    }
    if (iVar2 == 3) {
      puVar4 = (undefined1 *)((longlong)(int)(uVar5 * 4) + *(longlong *)(param_1 + 0x18));
      uVar1 = puVar4[2];
      puVar4[2] = *puVar4;
      *puVar4 = uVar1;
    }
  }
  return;
}



undefined8 FUN_1400b9910(longlong param_1,void *param_2,uint param_3)

{
  char cVar1;
  
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  if ((*(uint *)(param_1 + 0x24) < *(int *)(param_1 + 0x20) + param_3) &&
     (cVar1 = FUN_1400b9330(), cVar1 == '\0')) {
    return 0;
  }
  if (*(longlong *)(param_1 + 0x18) == 0) {
    return 0;
  }
  memcpy((void *)((ulonglong)*(uint *)(param_1 + 0x20) + *(longlong *)(param_1 + 0x18)),param_2,
         (ulonglong)param_3);
  *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) + param_3;
  return 1;
}



void FUN_1400b9990(longlong param_1,int param_2,int param_3)

{
  undefined1 *puVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  
  lVar2 = (longlong)param_2;
  if ((-1 < param_2) && (0 < param_3)) {
    iVar4 = param_2 + param_3;
    if (*(int *)(param_1 + 0x20) < iVar4) {
      *(int *)(param_1 + 0x20) = param_2;
      return;
    }
    if (*(longlong *)(param_1 + 0x18) != 0) {
      lVar3 = (longlong)iVar4;
      if (iVar4 < *(int *)(param_1 + 0x20)) {
        do {
          iVar4 = iVar4 + 1;
          lVar2 = lVar2 + 1;
          puVar1 = (undefined1 *)(*(longlong *)(param_1 + 0x18) + lVar3);
          lVar3 = lVar3 + 1;
          *(undefined1 *)(*(longlong *)(param_1 + 0x18) + -1 + lVar2) = *puVar1;
        } while (iVar4 < *(int *)(param_1 + 0x20));
      }
      *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) - param_3;
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void * FUN_1400b9a00(longlong param_1,int param_2,uint param_3)

{
  int iVar1;
  void *pvVar2;
  uint uVar3;
  int _Val;
  uint uVar4;
  undefined1 *puVar5;
  ulonglong uVar6;
  undefined1 auStack_68 [32];
  undefined1 local_48 [16];
  void *local_38;
  
  local_38 = (void *)(DAT_1402f85a0 ^ (ulonglong)auStack_68);
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  if (param_2 == 0) {
    if (param_3 != 8) {
      param_3 = 0x10;
    }
    uVar3 = *(uint *)(param_1 + 0x20) % param_3;
    uVar4 = param_3;
    if (uVar3 != 0) {
      uVar4 = param_3 - uVar3;
    }
    if (param_3 != 0) {
      memset(local_48,uVar4 & 0xff,(ulonglong)param_3);
    }
    if (*(char *)(param_1 + 0x10) != -0x25) {
      DAT_00000000 = 0x78;
    }
    if ((uVar4 + *(int *)(param_1 + 0x20) <= *(uint *)(param_1 + 0x24)) ||
       (pvVar2 = (void *)FUN_1400b9330(param_1), (char)pvVar2 != '\0')) {
      pvVar2 = (void *)0x0;
      if (*(longlong *)(param_1 + 0x18) != 0) {
        pvVar2 = memcpy((void *)((ulonglong)*(uint *)(param_1 + 0x20) +
                                *(longlong *)(param_1 + 0x18)),local_48,(ulonglong)uVar4);
        *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) + uVar4;
      }
    }
  }
  else if (param_2 == 1) {
    if (param_3 != 8) {
      param_3 = 0x10;
    }
    uVar3 = *(uint *)(param_1 + 0x20) % param_3;
    uVar4 = param_3;
    if (uVar3 != 0) {
      uVar4 = param_3 - uVar3;
    }
    uVar3 = uVar4 - 1;
    if (uVar3 != 0) {
      uVar6 = (ulonglong)uVar3;
      puVar5 = local_48;
      do {
        iVar1 = rand();
        uVar6 = uVar6 - 1;
        *puVar5 = (char)iVar1;
        puVar5 = puVar5 + 1;
      } while (uVar6 != 0);
    }
    if (uVar3 < param_3) {
      memset(local_48 + (int)uVar3,uVar4 & 0xff,(ulonglong)(param_3 - uVar3));
    }
    if (*(char *)(param_1 + 0x10) != -0x25) {
      DAT_00000000 = 0x78;
    }
    if ((uVar4 + *(int *)(param_1 + 0x20) <= *(uint *)(param_1 + 0x24)) ||
       (pvVar2 = (void *)FUN_1400b9330(param_1), (char)pvVar2 != '\0')) {
      pvVar2 = (void *)0x0;
      if (*(longlong *)(param_1 + 0x18) != 0) {
        pvVar2 = memcpy((void *)((ulonglong)*(uint *)(param_1 + 0x20) +
                                *(longlong *)(param_1 + 0x18)),local_48,(ulonglong)uVar4);
        *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) + uVar4;
      }
    }
  }
  else {
    if (param_2 == 2) {
      if (param_3 != 8) {
        param_3 = 0x10;
      }
      uVar6 = (ulonglong)param_3;
      pvVar2 = (void *)(*(uint *)(param_1 + 0x20) / uVar6);
      uVar4 = *(uint *)(param_1 + 0x20) % param_3;
      if (uVar4 == 0) {
        iVar1 = 0;
      }
      else {
        iVar1 = param_3 - uVar4;
      }
      if (param_3 != 0) {
        puVar5 = local_48;
        do {
          uVar4 = rand();
          pvVar2 = (void *)(ulonglong)uVar4;
          uVar6 = uVar6 - 1;
          *puVar5 = (char)uVar4;
          puVar5 = puVar5 + 1;
        } while (uVar6 != 0);
      }
    }
    else {
      if (param_2 == 3) {
        if (param_3 != 8) {
          param_3 = 0x10;
        }
        uVar4 = *(uint *)(param_1 + 0x20) % param_3;
        if (uVar4 == 0) {
          iVar1 = 0;
          _Val = 0;
        }
        else {
          iVar1 = param_3 - uVar4;
          _Val = 0;
        }
      }
      else {
        if (param_2 != 4) {
          return local_38;
        }
        if (param_3 != 8) {
          param_3 = 0x10;
        }
        uVar4 = *(uint *)(param_1 + 0x20) % param_3;
        if (uVar4 == 0) {
          iVar1 = 0;
        }
        else {
          iVar1 = param_3 - uVar4;
        }
        _Val = 0x20;
      }
      pvVar2 = memset(local_48,_Val,(longlong)(int)param_3);
    }
    if (iVar1 != 0) {
      pvVar2 = (void *)FUN_1400b9910(param_1,local_48,iVar1);
    }
  }
  return pvVar2;
}



undefined8 FUN_1400b9c60(longlong param_1,int param_2)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  uVar1 = *(uint *)(param_1 + 0x20);
  if (((uVar1 != 0) && (*(longlong *)(param_1 + 0x18) != 0)) && ((param_2 == 0 || (param_2 == 1))))
  {
    uVar3 = (uint)*(byte *)((ulonglong)(uVar1 - 1) + *(longlong *)(param_1 + 0x18));
    uVar2 = uVar1;
    if (uVar3 < uVar1) {
      uVar2 = uVar3;
    }
    *(uint *)(param_1 + 0x20) = uVar1 - uVar2;
  }
  return 1;
}



void FUN_1400b9cb0(longlong param_1,uint param_2)

{
  uint uVar1;
  uint uVar2;
  ulonglong uVar3;
  
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  if (*(longlong *)(param_1 + 0x18) != 0) {
    if (*(uint *)(param_1 + 0x20) <= param_2) {
      *(undefined4 *)(param_1 + 0x20) = 0;
      return;
    }
    uVar2 = param_2;
    do {
      uVar3 = (ulonglong)uVar2;
      uVar1 = uVar2 - param_2;
      uVar2 = uVar2 + 1;
      *(undefined1 *)((ulonglong)uVar1 + *(longlong *)(param_1 + 0x18)) =
           *(undefined1 *)(uVar3 + *(longlong *)(param_1 + 0x18));
    } while (uVar2 < *(uint *)(param_1 + 0x20));
    *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) - param_2;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x0001400b9db0)

void FUN_1400b9d20(byte *param_1,int param_2,undefined8 param_3)

{
  char cVar1;
  byte bVar2;
  longlong lVar3;
  int iVar4;
  undefined1 auStack_238 [32];
  char local_218 [512];
  ulonglong local_18;
  
  if (((param_1 != (byte *)0x0) && (local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_238, param_2 != 0)
      ) && (iVar4 = 0, param_2 != 0)) {
    lVar3 = 0;
    do {
      bVar2 = *param_1 >> 4;
      if (bVar2 < 10) {
        cVar1 = bVar2 + 0x30;
      }
      else {
        cVar1 = bVar2 + 0x37;
      }
      iVar4 = iVar4 + 1;
      local_218[lVar3] = cVar1;
      lVar3 = lVar3 + 1;
      if (iVar4 == 500) {
        FUN_1400bc8a0(param_3,local_218);
        iVar4 = 0;
        lVar3 = 0;
      }
      bVar2 = *param_1 & 0xf;
      if (bVar2 < 10) {
        cVar1 = bVar2 + 0x30;
      }
      else {
        cVar1 = bVar2 + 0x37;
      }
      iVar4 = iVar4 + 1;
      local_218[lVar3] = cVar1;
      lVar3 = lVar3 + 1;
      if (iVar4 == 500) {
        FUN_1400bc8a0(param_3,local_218);
        iVar4 = 0;
        lVar3 = 0;
      }
      param_1 = param_1 + 1;
      param_2 = param_2 + -1;
    } while (param_2 != 0);
    if (iVar4 != 0) {
      FUN_1400bc8a0(param_3,local_218);
    }
  }
  return;
}



undefined4 FUN_1400b9e30(undefined8 param_1,undefined8 param_2)

{
  undefined8 uVar1;
  int iVar2;
  undefined4 uVar3;
  
  iVar2 = FUN_1400bbb10(param_2);
  if (iVar2 != 0) {
    uVar3 = FUN_1400bbb10(param_2);
    uVar1 = FUN_1400b8b90(param_2);
    uVar3 = FUN_1400b97e0(param_1,uVar1,uVar3);
    return uVar3;
  }
  return 1;
}



undefined1 FUN_1400b9e90(undefined8 param_1,longlong param_2)

{
  undefined1 uVar1;
  
  if (*(int *)(param_2 + 0x20) != 0) {
    uVar1 = FUN_1400b97e0(param_1,*(undefined8 *)(param_2 + 0x18));
    return uVar1;
  }
  return 1;
}



void FUN_1400b9eb0(undefined8 param_1,longlong param_2,uint param_3,uint param_4)

{
  uint uVar1;
  
  uVar1 = *(uint *)(param_2 + 0x20);
  if (param_3 < uVar1) {
    if (uVar1 - param_3 < param_4) {
      param_4 = uVar1 - param_3;
    }
    if (((*(longlong *)(param_2 + 0x18) == 0) || ((int)param_3 < 0)) || ((int)uVar1 <= (int)param_3)
       ) {
      FUN_1400b97e0(param_1,0,param_4);
      return;
    }
    FUN_1400b97e0(param_1,(longlong)(int)param_3 + *(longlong *)(param_2 + 0x18),param_4);
  }
  return;
}



undefined1 FUN_1400b9f10(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  ushort uVar1;
  ushort uVar2;
  char cVar3;
  undefined1 uVar4;
  undefined4 uVar5;
  undefined8 uVar6;
  bool bVar7;
  undefined **local_a8 [2];
  undefined2 local_98;
  void *local_90;
  undefined8 local_88;
  undefined1 local_80 [16];
  undefined1 local_70 [48];
  undefined1 local_40 [48];
  undefined8 local_10;
  
  local_10 = 0xfffffffffffffffe;
  FUN_1400bcaa0(local_40,param_3);
  FUN_1400bbc30(local_40);
  FUN_1400bcaa0(local_70,param_2);
  FUN_1400d0eb0(local_a8);
  local_a8[0] = DataBuffer::vftable;
  local_98 = 0xdb;
  local_90 = (void *)0x0;
  local_88 = 0;
  cVar3 = FUN_1400be010(local_40,"base64");
  if (cVar3 == '\0') {
    cVar3 = FUN_1400be010(local_40,"base-64");
    if (cVar3 != '\0') goto LAB_1400ba08a;
    cVar3 = FUN_1400be010(local_40,&DAT_1402085ac);
    if (cVar3 == '\0') {
      cVar3 = FUN_1400be010(local_40,"quoted-printable");
      if (cVar3 == '\0') {
        cVar3 = FUN_1400be010(local_40,&DAT_1402749dc);
        if (cVar3 == '\0') {
          cVar3 = FUN_1400be010(local_40,"hexidecimal");
          if (cVar3 == '\0') {
            cVar3 = FUN_1400be010(local_40,&DAT_1402749d4);
            if (cVar3 != '\0') {
              FUN_1401052b0(local_70,local_a8);
            }
            goto LAB_1400ba0ce;
          }
        }
        FUN_1400bbc30(local_70);
        FUN_1400bc2a0(local_70,local_a8);
        goto LAB_1400ba0ce;
      }
    }
    FUN_1400bbc30(local_70);
    FUN_1400f0d10(local_80);
    uVar5 = FUN_1400bbb10(local_70);
    uVar6 = FUN_1400b8b90(local_70);
    FUN_1400f19c0(local_80,uVar6,uVar5,local_a8);
  }
  else {
LAB_1400ba08a:
    FUN_1400bbc30(local_70);
    FUN_1400f0d10(local_80);
    uVar5 = FUN_1400bbb10(local_70);
    uVar6 = FUN_1400b8b90(local_70);
    FUN_1400f3110(local_80,uVar6,uVar5,local_a8);
  }
  FUN_1400f0d30(local_80);
LAB_1400ba0ce:
  if ((int)local_88 == 0) {
    uVar4 = 1;
  }
  else {
    uVar4 = FUN_1400b97e0(param_1,local_90);
  }
  uVar1 = local_98;
  local_a8[0] = DataBuffer::vftable;
  local_98 = local_98 & 0xff00;
  uVar2 = local_98;
  if (local_90 != (void *)0x0) {
    local_98._1_1_ = SUB21(uVar1,1);
    bVar7 = local_98._1_1_ == '\0';
    local_98 = uVar2;
    if (bVar7) {
      operator_delete(local_90);
    }
    local_90 = (void *)0x0;
  }
  local_88 = 0;
  FUN_1400d0ee0(local_a8);
  FUN_1400bceb0(local_70);
  FUN_1400bceb0(local_40);
  return uVar4;
}



void FUN_1400ba150(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4,
                  undefined8 param_5)

{
  char cVar1;
  undefined1 local_50 [16];
  undefined1 local_40 [56];
  
  FUN_1400bcaa0(local_40);
  FUN_1400bbc30(local_40);
  cVar1 = FUN_1400be010(local_40,"base64");
  if (cVar1 == '\0') {
    cVar1 = FUN_1400be010(local_40,"base-64");
    if (cVar1 != '\0') goto LAB_1400ba2c8;
    cVar1 = FUN_1400be010(local_40,&DAT_1402085ac);
    if (cVar1 == '\0') {
      cVar1 = FUN_1400be010(local_40,"quoted-printable");
      if (cVar1 == '\0') {
        cVar1 = FUN_1400be010(local_40,&DAT_1402749dc);
        if (cVar1 == '\0') {
          cVar1 = FUN_1400be010(local_40,"hexidecimal");
          if (cVar1 == '\0') {
            cVar1 = FUN_1400be010(local_40,&DAT_1402085e0);
            if (cVar1 == '\0') {
              cVar1 = FUN_1400be010(local_40,&DAT_140206fd0);
              if (cVar1 == '\0') {
                cVar1 = FUN_1400be010(local_40,&DAT_1402749d4);
                if (cVar1 == '\0') {
                  FUN_1400bbe30(param_5);
                }
                else {
                  FUN_140105160(param_3,param_4,param_5);
                }
                goto LAB_1400ba2f1;
              }
            }
            FUN_1400bc8a0(param_5,param_3,param_4);
            goto LAB_1400ba2f1;
          }
        }
        FUN_1400b9d20(param_3,param_4,param_5);
        goto LAB_1400ba2f1;
      }
    }
    FUN_1400f0d10(local_50);
    FUN_1400f2610(local_50,param_3,param_4,param_5);
  }
  else {
LAB_1400ba2c8:
    FUN_1400f0d10(local_50);
    FUN_1400f30f0(param_3,param_4,param_5);
  }
  FUN_1400f0d30(local_50);
LAB_1400ba2f1:
  FUN_1400bceb0(local_40);
  return;
}



void FUN_1400ba310(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  if (*(void **)(param_1 + 0x18) != (void *)0x0) {
    if (*(char *)(param_1 + 0x11) == '\0') {
      operator_delete(*(void **)(param_1 + 0x18));
    }
    *(undefined8 *)(param_1 + 0x18) = 0;
    *(undefined8 *)(param_1 + 0x20) = 0;
  }
  *(undefined8 *)(param_1 + 0x18) = param_2;
  *(undefined4 *)(param_1 + 0x24) = param_3;
  *(undefined4 *)(param_1 + 0x20) = param_3;
  *(undefined1 *)(param_1 + 0x11) = 0;
  return;
}



void FUN_1400ba380(longlong param_1,longlong param_2)

{
  if (param_2 == 0) {
    *(undefined4 *)(param_1 + 0x20) = 0;
    return;
  }
  FUN_1400b94d0();
  return;
}



undefined8 * FUN_1400ba390(undefined8 *param_1,uint param_2)

{
  *param_1 = DataBuffer::vftable;
  *(undefined1 *)(param_1 + 2) = 0;
  if ((void *)param_1[3] != (void *)0x0) {
    if (*(char *)((longlong)param_1 + 0x11) == '\0') {
      operator_delete((void *)param_1[3]);
    }
    param_1[3] = 0;
  }
  param_1[4] = 0;
  FUN_1400d0ee0(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined1 FUN_1400ba410(longlong param_1,undefined8 param_2,longlong *param_3,undefined8 param_4)

{
  char cVar1;
  undefined1 uVar2;
  undefined8 uVar3;
  undefined1 local_a8 [160];
  
  uVar3 = 0xfffffffffffffffe;
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  FUN_1400b6fd0(local_a8);
  FUN_1400b7270(local_a8,param_2);
  cVar1 = FUN_1400b7720(local_a8);
  if (cVar1 == '\0') {
    if (param_3 != (longlong *)0x0) {
      (**(code **)(*param_3 + 0x48))(param_3,"loadFileUnicode",1,param_4,uVar3);
    }
    uVar3 = FUN_1400b7580(local_a8);
    uVar2 = FUN_1400b8db0(param_1,uVar3,param_3);
    if (param_3 != (longlong *)0x0) {
      (**(code **)(*param_3 + 0x50))(param_3);
    }
  }
  else {
    if (param_3 != (longlong *)0x0) {
      (**(code **)(*param_3 + 0x48))(param_3,"loadFileAnsi",1);
    }
    uVar3 = FUN_1400b7950(local_a8);
    uVar2 = FUN_1400b8fc0(param_1,uVar3,param_3);
    if (param_3 != (longlong *)0x0) {
      (**(code **)(*param_3 + 0x50))(param_3);
    }
  }
  FUN_1400b7090(local_a8);
  return uVar2;
}



bool FUN_1400ba520(longlong param_1,uint param_2)

{
  if (param_2 == 0) {
    return true;
  }
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  if (*(uint *)(param_1 + 0x24) < param_2) {
    FUN_1400b9330();
  }
  return *(longlong *)(param_1 + 0x18) != 0;
}



void FUN_1400ba560(longlong param_1)

{
  if (*(int *)(param_1 + 0x20) + 4U < *(uint *)(param_1 + 0x24)) {
    FUN_1400b9330();
  }
  return;
}



void FUN_1400ba580(longlong param_1,short *param_2)

{
  short sVar1;
  char cVar2;
  short *psVar3;
  int iVar4;
  
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  if (param_2 == (short *)0x0) {
    if (*(char *)(param_1 + 0x10) != -0x25) {
      DAT_00000000 = 0x78;
    }
    if (((*(int *)(param_1 + 0x20) + 1U <= *(uint *)(param_1 + 0x24)) ||
        (cVar2 = FUN_1400b9330(param_1,*(int *)(param_1 + 0x20) + 10000), cVar2 != '\0')) &&
       (*(longlong *)(param_1 + 0x18) != 0)) {
      *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x20) + *(longlong *)(param_1 + 0x18)) = 0;
      *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) + 1;
    }
    if (*(char *)(param_1 + 0x10) != -0x25) {
      DAT_00000000 = 0x78;
    }
    if (((*(int *)(param_1 + 0x20) + 1U <= *(uint *)(param_1 + 0x24)) ||
        (cVar2 = FUN_1400b9330(param_1,*(int *)(param_1 + 0x20) + 10000), cVar2 != '\0')) &&
       (*(longlong *)(param_1 + 0x18) != 0)) {
      *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x20) + *(longlong *)(param_1 + 0x18)) = 0;
      *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) + 1;
      return;
    }
  }
  else {
    iVar4 = 0;
    sVar1 = *param_2;
    psVar3 = param_2;
    while (sVar1 != 0) {
      psVar3 = psVar3 + 1;
      iVar4 = iVar4 + 1;
      sVar1 = *psVar3;
    }
    FUN_1400b97e0(param_1,param_2,iVar4 * 2 + 2);
  }
  return;
}



void FUN_1400ba650(longlong param_1,void *param_2,uint param_3)

{
  int iVar1;
  uint uVar2;
  longlong lVar3;
  
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  if ((param_2 != (void *)0x0) && (param_3 != 0)) {
    uVar2 = param_3 + *(int *)(param_1 + 0x20);
    if (uVar2 != 0) {
      if (*(char *)(param_1 + 0x10) != -0x25) {
        DAT_00000000 = 0x78;
      }
      if (*(uint *)(param_1 + 0x24) < uVar2) {
        FUN_1400b9330();
      }
    }
    if (*(longlong *)(param_1 + 0x18) != 0) {
      iVar1 = *(int *)(param_1 + 0x20) + -1;
      lVar3 = (longlong)iVar1;
      if (-1 < iVar1) {
        uVar2 = iVar1 + param_3;
        do {
          *(undefined1 *)((ulonglong)uVar2 + *(longlong *)(param_1 + 0x18)) =
               *(undefined1 *)(*(longlong *)(param_1 + 0x18) + lVar3);
          uVar2 = uVar2 - 1;
          lVar3 = lVar3 + -1;
        } while (-1 < lVar3);
      }
      memcpy(*(void **)(param_1 + 0x18),param_2,(ulonglong)param_3);
      *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) + param_3;
    }
  }
  return;
}



void FUN_1400ba700(longlong param_1,undefined8 param_2)

{
  if (*(char *)(param_1 + 0x10) != -0x25) {
    DAT_00000000 = 0x78;
  }
  if (*(longlong *)(param_1 + 0x18) != 0) {
    FUN_1400b9d20(*(longlong *)(param_1 + 0x18),*(undefined4 *)(param_1 + 0x20),param_2);
  }
  return;
}



undefined8 FUN_1400ba730(longlong param_1,longlong param_2,longlong param_3)

{
  uint uVar1;
  ulonglong uVar2;
  
  uVar1 = *(uint *)(param_2 + 0x20);
  if (uVar1 == *(uint *)(param_3 + 0x20)) {
    if (uVar1 == 0) {
      *(undefined4 *)(param_1 + 0x20) = 0;
      return 1;
    }
    if (*(char *)(param_1 + 0x10) != -0x25) {
      DAT_00000000 = 0x78;
    }
    if (*(uint *)(param_1 + 0x24) < uVar1) {
      FUN_1400b9330();
    }
    if (*(longlong *)(param_1 + 0x18) != 0) {
      uVar1 = *(uint *)(param_2 + 0x20);
      *(uint *)(param_1 + 0x20) = uVar1;
      if (*(uint *)(param_1 + 0x24) < uVar1) {
        *(uint *)(param_1 + 0x20) = *(uint *)(param_1 + 0x24);
      }
      uVar2 = 0;
      if (*(int *)(param_2 + 0x20) != 0) {
        do {
          *(byte *)(uVar2 + *(longlong *)(param_1 + 0x18)) =
               *(byte *)(*(longlong *)(param_3 + 0x18) + uVar2) ^
               *(byte *)(*(longlong *)(param_2 + 0x18) + uVar2);
          uVar1 = (int)uVar2 + 1;
          uVar2 = (ulonglong)uVar1;
        } while (uVar1 < *(uint *)(param_2 + 0x20));
      }
      return 1;
    }
  }
  return 0;
}



void FUN_1400ba800(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_1400ba150(param_1,param_2,*(undefined8 *)(param_1 + 0x18),*(undefined4 *)(param_1 + 0x20),
                param_3);
  return;
}



undefined8 *
FUN_1400ba820(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  *param_1 = ClsEncode::vftable;
  *(undefined4 *)(param_1 + 1) = 1;
  FUN_1400bcc20(param_1 + 2);
  FUN_1400b6fd0(param_1 + 8);
  FUN_1400b6fd0(param_1 + 0x1c);
  FUN_1400bc640(param_1 + 2,&DAT_14020868c,param_3,param_4,uVar1);
  FUN_1400b86c0(param_1 + 8,"file.dat");
  FUN_1400b86c0(param_1 + 0x1c,&DAT_1402083e0);
  return param_1;
}



void FUN_1400ba8d0(undefined8 *param_1)

{
  *param_1 = ClsEncode::vftable;
  FUN_1400b7090(param_1 + 0x1c);
  FUN_1400b7090(param_1 + 8);
  FUN_1400bceb0(param_1 + 2);
  return;
}



void FUN_1400ba920(longlong param_1,undefined8 param_2)

{
  int iVar1;
  char *pcVar2;
  
  iVar1 = *(int *)(param_1 + 8);
  if (iVar1 != 1) {
    if (iVar1 == 2) {
      FUN_1400b7270(param_2,&DAT_1402085ac);
      return;
    }
    if (iVar1 == 3) {
      FUN_1400b7270(param_2,&DAT_1402749dc);
      return;
    }
    if (iVar1 == 4) {
      FUN_1400b7270(param_2,&DAT_1402749d4);
      return;
    }
    if (iVar1 == 5) {
      FUN_1400b7270(param_2,&DAT_140208724);
      return;
    }
    if (iVar1 == 6) {
      FUN_1400b7270(param_2,&DAT_140206fd0);
      return;
    }
    if (iVar1 == 7) {
      FUN_1400b7270(param_2,"base32");
      return;
    }
    if (iVar1 == 0xf) {
      FUN_1400b7270(param_2,&DAT_140208718);
      return;
    }
    if (iVar1 == 0x10) {
      FUN_1400b7270(param_2,&DAT_140208714);
      return;
    }
    if (iVar1 == 0xb) {
      FUN_1400b7270(param_2,"url_rfc1738");
      return;
    }
    if (iVar1 == 0xc) {
      FUN_1400b7270(param_2,"url_rfc2396");
      return;
    }
    if (iVar1 == 0xd) {
      FUN_1400b7270(param_2,"url_rfc3986");
      return;
    }
    if (iVar1 == 0xe) {
      FUN_1400b7270(param_2,"url_oauth");
      return;
    }
    if (iVar1 == 8) {
      FUN_1400b7270(param_2,&DAT_1402086d4);
      return;
    }
    pcVar2 = "modBase64";
    if (iVar1 == 10) goto LAB_1400baa46;
  }
  pcVar2 = "base64";
LAB_1400baa46:
  FUN_1400b7270(param_2,pcVar2);
  return;
}



void FUN_1400baa50(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined1 local_a8 [160];
  
  uVar3 = 0xfffffffffffffffe;
  FUN_1400b6fd0(local_a8);
  FUN_1400ba920(param_1,local_a8);
  lVar1 = *param_2;
  uVar2 = FUN_1400b7ce0(local_a8);
  (**(code **)(lVar1 + 0x58))(param_2,"EncodingMode",uVar2,param_4,uVar3);
  FUN_1400b7090(local_a8);
  return;
}



void FUN_1400baad0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  char cVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined1 local_40 [56];
  
  uVar5 = 0xfffffffffffffffe;
  FUN_1400bcc20(local_40);
  uVar1 = FUN_1400b7ce0(param_2);
  FUN_1400bc640(local_40,uVar1,param_3,param_4,uVar5);
  FUN_1400bdd00(local_40,0x2d);
  FUN_1400bdd00(local_40,0x20);
  FUN_1400bbc30(local_40);
  FUN_1400bd760(local_40);
  cVar2 = FUN_1400bc7e0(local_40,&DAT_1402087b0);
  if (cVar2 == '\0') {
    cVar2 = FUN_1400bdf70(local_40,&DAT_140208718);
    if (cVar2 != '\0') {
      *(undefined4 *)(param_1 + 8) = 0xf;
      goto LAB_1400bad12;
    }
    cVar2 = FUN_1400bdf70(local_40,&DAT_140208714);
    if (cVar2 != '\0') {
      *(undefined4 *)(param_1 + 8) = 0x10;
      goto LAB_1400bad12;
    }
    cVar2 = FUN_1400bc7e0(local_40,&DAT_140208718);
    if (cVar2 != '\0') {
      *(undefined4 *)(param_1 + 8) = 2;
      goto LAB_1400bad12;
    }
    cVar2 = FUN_1400bc7e0(local_40,&DAT_1402749dc);
    if (cVar2 != '\0') {
      *(undefined4 *)(param_1 + 8) = 3;
      goto LAB_1400bad12;
    }
    cVar2 = FUN_1400bc7e0(local_40,&DAT_1402087a8);
    if (cVar2 == '\0') {
      cVar2 = FUN_1400bc7e0(local_40,&DAT_1402087a4);
      if (cVar2 != '\0') {
        *(undefined4 *)(param_1 + 8) = 5;
        goto LAB_1400bad12;
      }
      cVar2 = FUN_1400bc7e0(local_40,&DAT_1402087a0);
      if (cVar2 == '\0') {
        cVar2 = FUN_1400bc7e0(local_40,&DAT_1402085e0);
        if (cVar2 == '\0') {
          cVar2 = FUN_1400bc7e0(local_40,"usasc");
          if (cVar2 == '\0') {
            cVar2 = FUN_1400bc7e0(local_40,"modbase");
            if (cVar2 != '\0') {
              *(undefined4 *)(param_1 + 8) = 10;
              goto LAB_1400bad12;
            }
            cVar2 = FUN_1400bde50(local_40,&DAT_1402086d4);
            uVar4 = 8;
            goto LAB_1400bad05;
          }
        }
      }
      *(undefined4 *)(param_1 + 8) = 6;
      goto LAB_1400bad12;
    }
    cVar2 = FUN_1400be010(local_40,"url_rfc1738");
    if (cVar2 != '\0') {
      *(undefined4 *)(param_1 + 8) = 0xb;
      goto LAB_1400bad12;
    }
    cVar2 = FUN_1400be010(local_40,"url_rfc2396");
    if (cVar2 != '\0') {
      *(undefined4 *)(param_1 + 8) = 0xc;
      goto LAB_1400bad12;
    }
    cVar2 = FUN_1400be010(local_40,"url_rfc3986");
    if (cVar2 != '\0') {
      *(undefined4 *)(param_1 + 8) = 0xd;
      goto LAB_1400bad12;
    }
    cVar2 = FUN_1400be010(local_40,"url_oauth");
    uVar3 = 4;
    uVar4 = 0xe;
  }
  else {
    cVar2 = FUN_1400bde10(local_40,&DAT_1402087ac);
    uVar4 = 7;
LAB_1400bad05:
    uVar3 = 1;
  }
  if (cVar2 != '\0') {
    uVar3 = uVar4;
  }
  *(undefined4 *)(param_1 + 8) = uVar3;
LAB_1400bad12:
  FUN_1400bceb0(local_40);
  return;
}



void FUN_1400bad30(longlong param_1,undefined8 param_2,undefined8 param_3,char param_4)

{
  int iVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined1 local_88 [16];
  undefined1 local_78 [48];
  undefined8 local_48;
  undefined1 local_40 [56];
  
  local_48 = 0xfffffffffffffffe;
  iVar1 = *(int *)(param_1 + 8);
  if (iVar1 == 1) {
    FUN_1400b8100(param_2);
    FUN_1400f0d10(local_88);
    uVar3 = FUN_1400b87a0(param_2);
    if (param_4 == '\0') {
      uVar2 = FUN_1400bbb10(uVar3);
      uVar3 = FUN_1400b8b90(uVar3);
      FUN_1400f3110(local_88,uVar3,uVar2,param_3);
    }
    else {
      FUN_1400b8c40(local_78);
      uVar2 = FUN_1400bbb10(uVar3);
      uVar3 = FUN_1400b8b90(uVar3);
      FUN_1400f3110(local_88,uVar3,uVar2,param_3);
      FUN_1400b9e90(param_3,local_78);
      FUN_1400b92d0(local_78);
    }
    FUN_1400f0d30(local_88);
  }
  else if (iVar1 == 2) {
    FUN_1400b8100(param_2);
    FUN_1400f0d10(local_88);
    uVar3 = FUN_1400b87a0(param_2);
    if (param_4 == '\0') {
      uVar2 = FUN_1400bbb10(uVar3);
      uVar3 = FUN_1400b8b90(uVar3);
      FUN_1400f19c0(local_88,uVar3,uVar2,param_3);
    }
    else {
      FUN_1400b8c40(local_78);
      uVar2 = FUN_1400bbb10(uVar3);
      uVar3 = FUN_1400b8b90(uVar3);
      FUN_1400f19c0(local_88,uVar3,uVar2,param_3);
      FUN_1400b9e90(param_3,local_78);
      FUN_1400b92d0(local_78);
    }
    FUN_1400f0d30(local_88);
  }
  else if (iVar1 == 3) {
    FUN_1400b8100(param_2);
    if (param_4 == '\0') {
      FUN_1400b8b30(param_3);
    }
    uVar3 = FUN_1400b87a0(param_2);
    FUN_1400bc2a0(uVar3,param_3);
  }
  else if ((((iVar1 == 4) || (iVar1 == 0xe)) || (iVar1 == 0xb)) ||
          ((iVar1 == 0xc || (iVar1 == 0xd)))) {
    if (param_4 == '\0') {
      FUN_1400b8b30(param_3);
    }
    uVar3 = FUN_1400b87a0(param_2);
    FUN_1401052b0(uVar3,param_3);
  }
  else if (iVar1 == 6) {
    FUN_1400bcc20(local_78);
    uVar3 = FUN_1400b7950(param_2);
    FUN_1400bc640(local_78,uVar3);
    if (param_4 == '\0') {
      FUN_1400b8b30(param_3);
    }
    FUN_1400b9e30(param_3,local_78);
    FUN_1400bceb0(local_78);
  }
  else if (iVar1 == 8) {
    FUN_140105a80(local_40);
    if (param_4 == '\0') {
      FUN_1400b8b30(param_3);
    }
    FUN_1400bcc20(local_78);
    uVar3 = FUN_1400b7950(param_2);
    FUN_140105bc0(local_40,uVar3,param_3,param_1 + 0x10,local_78);
    uVar3 = FUN_1400b8b90(local_78);
    FUN_1400b7200(param_1 + 0x40,uVar3);
    FUN_1400bceb0(local_78);
    FUN_140105ab0(local_40);
  }
  else if (iVar1 == 7) {
    FUN_1400b8100(param_2);
    uVar3 = FUN_1400b87a0(param_2);
    if (param_4 == '\0') {
      FUN_1400b8b30(param_3);
    }
    uVar2 = FUN_1400bbb10(uVar3);
    uVar3 = FUN_1400b8b90(uVar3);
    FUN_1400f1030(uVar3,uVar2,param_3);
  }
  else if ((iVar1 == 0x10) || (iVar1 == 0xf)) {
    if (param_4 == '\0') {
      FUN_1400b8b30(param_3);
    }
    FUN_1400bcc20(local_78);
    uVar3 = FUN_1400b7ce0(param_2);
    FUN_1400bc640(local_78,uVar3);
    FUN_1400f0d10(local_88);
    FUN_1400f2d20(local_88,local_78,0);
    FUN_1400b9e30(param_3,local_78);
    FUN_1400f0d30(local_88);
    FUN_1400bceb0(local_78);
  }
  else if ((iVar1 != 5) && (iVar1 == 10)) {
    FUN_1400b8100(param_2);
    FUN_1400b81c0(param_2,0x2d,0x2b);
    FUN_1400b81c0(param_2,0x5f,0x2f);
    FUN_1400f0d10(local_88);
    uVar3 = FUN_1400b87a0(param_2);
    if (param_4 == '\0') {
      uVar2 = FUN_1400bbb10(uVar3);
      uVar3 = FUN_1400b8b90(uVar3);
      FUN_1400f3110(local_88,uVar3,uVar2,param_3);
    }
    else {
      FUN_1400b8c40(local_78);
      uVar2 = FUN_1400bbb10(uVar3);
      uVar3 = FUN_1400b8b90(uVar3);
      FUN_1400f3110(local_88,uVar3,uVar2,param_3);
      FUN_1400b9e90(param_3,local_78);
      FUN_1400b92d0(local_78);
    }
    FUN_1400f0d30(local_88);
  }
  return;
}



void FUN_1400bb190(longlong param_1,undefined8 param_2,undefined8 param_3,char param_4)

{
  int iVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 local_98 [48];
  undefined1 local_68 [12];
  undefined1 local_5c;
  undefined8 local_58;
  undefined1 local_50 [56];
  
  local_58 = 0xfffffffffffffffe;
  iVar1 = *(int *)(param_1 + 8);
  if (iVar1 == 1) {
    FUN_1400f0d10(local_68);
    FUN_1400bcc20(local_98);
    uVar2 = FUN_1400b8b80(param_2);
    uVar3 = FUN_1400b8b90(param_2);
    FUN_1400f30f0(uVar3,uVar2,local_98);
    uVar3 = FUN_1400b8b90(local_98);
    if (param_4 == '\0') {
      FUN_1400b7270(param_3,uVar3);
    }
    else {
      FUN_1400b86c0();
    }
    FUN_1400bceb0(local_98);
    FUN_1400f0d30(local_68);
  }
  else if (iVar1 == 2) {
    FUN_1400f0d10(local_68);
    FUN_1400bcc20(local_98);
    uVar2 = FUN_1400b8b80(param_2);
    uVar3 = FUN_1400b8b90(param_2);
    FUN_1400f2610(local_68,uVar3,uVar2,local_98);
    uVar3 = FUN_1400b8b90(local_98);
    if (param_4 == '\0') {
      FUN_1400b7270(param_3,uVar3);
    }
    else {
      FUN_1400b86c0();
    }
    FUN_1400bceb0(local_98);
    FUN_1400f0d30(local_68);
  }
  else {
    if (iVar1 == 3) {
      FUN_1400bcc20(local_98);
      FUN_1400ba700(param_2,local_98);
      uVar3 = FUN_1400b8b90(local_98);
      if (param_4 == '\0') {
        FUN_1400b7270(param_3,uVar3);
      }
      else {
        FUN_1400b86c0();
      }
    }
    else if (iVar1 == 4) {
      FUN_1400bcc20(local_98);
      FUN_140105850(param_2,local_98);
      uVar3 = FUN_1400b8b90(local_98);
      if (param_4 == '\0') {
        FUN_1400b7270(param_3,uVar3);
      }
      else {
        FUN_1400b86c0();
      }
    }
    else if (iVar1 == 0xb) {
      FUN_1400bcc20(local_98);
      uVar2 = FUN_1400b8b80(param_2);
      uVar3 = FUN_1400b8b90(param_2);
      FUN_140105500(uVar3,uVar2,local_98);
      uVar3 = FUN_1400b8b90(local_98);
      if (param_4 == '\0') {
        FUN_1400b7270(param_3,uVar3);
      }
      else {
        FUN_1400b86c0();
      }
    }
    else if (iVar1 == 0xc) {
      FUN_1400bcc20(local_98);
      uVar2 = FUN_1400b8b80(param_2);
      uVar3 = FUN_1400b8b90(param_2);
      FUN_1401056b0(uVar3,uVar2,local_98);
      uVar3 = FUN_1400b8b90(local_98);
      if (param_4 == '\0') {
        FUN_1400b7270(param_3,uVar3);
      }
      else {
        FUN_1400b86c0();
      }
    }
    else if ((iVar1 == 0xd) || (iVar1 == 0xe)) {
      FUN_1400bcc20(local_98);
      uVar2 = FUN_1400b8b80(param_2);
      uVar3 = FUN_1400b8b90(param_2);
      FUN_140105390(uVar3,uVar2,local_98);
      uVar3 = FUN_1400b8b90(local_98);
      if (param_4 == '\0') {
        FUN_1400b7270(param_3,uVar3);
      }
      else {
        FUN_1400b86c0();
      }
    }
    else if (iVar1 == 6) {
      FUN_1400bcc20(local_98);
      FUN_1400be440(local_98,param_2);
      uVar3 = FUN_1400b8b90(local_98);
      if (param_4 == '\0') {
        FUN_1400b7270(param_3,uVar3);
      }
      else {
        FUN_1400b86c0();
      }
    }
    else {
      if (iVar1 == 8) {
        FUN_140105a80(local_50);
        FUN_1400bcc20(local_98);
        uVar3 = FUN_1400b7950(param_1 + 0x40);
        uVar4 = FUN_1400b8b90(param_1 + 0x10);
        FUN_140105f30(local_50,param_2,uVar4,uVar3,local_98);
        uVar3 = FUN_1400b8b90(local_98);
        if (param_4 == '\0') {
          FUN_1400b7270(param_3,uVar3);
        }
        else {
          FUN_1400b86c0();
        }
        FUN_1400bceb0(local_98);
        FUN_140105ab0(local_50);
        return;
      }
      if (iVar1 != 7) {
        if (iVar1 == 0xf) {
          FUN_1400f0d10(local_68);
          local_5c = 1;
          FUN_1400bcc20(local_98);
          uVar3 = FUN_1400b7ce0(param_1 + 0xe0);
          uVar2 = FUN_1400b8b80(param_2);
          uVar4 = FUN_1400b8b90(param_2);
          FUN_1400f2c40(local_68,uVar4,uVar2,uVar3,local_98);
          uVar3 = FUN_1400b8b90(local_98);
          if (param_4 == '\0') {
            FUN_1400b7270(param_3,uVar3);
          }
          else {
            FUN_1400b86c0();
          }
          FUN_1400bceb0(local_98);
          FUN_1400f0d30(local_68);
          return;
        }
        if (iVar1 == 0x10) {
          FUN_1400f0d10(local_68);
          local_5c = 1;
          FUN_1400bcc20(local_98);
          uVar3 = FUN_1400b7ce0(param_1 + 0xe0);
          uVar2 = FUN_1400b8b80(param_2);
          uVar4 = FUN_1400b8b90(param_2);
          FUN_1400f2b90(local_68,uVar4,uVar2,uVar3,local_98);
          uVar3 = FUN_1400b8b90(local_98);
          if (param_4 == '\0') {
            FUN_1400b7270(param_3,uVar3);
          }
          else {
            FUN_1400b86c0();
          }
          FUN_1400bceb0(local_98);
          FUN_1400f0d30(local_68);
          return;
        }
        if (iVar1 == 5) {
          return;
        }
        if (iVar1 != 10) {
          return;
        }
        FUN_1400f0d10(local_68);
        FUN_1400bcc20(local_98);
        uVar2 = FUN_1400b8b80(param_2);
        uVar3 = FUN_1400b8b90(param_2);
        FUN_1400f3100(uVar3,uVar2,local_98);
        uVar3 = FUN_1400b8b90(local_98);
        if (param_4 == '\0') {
          FUN_1400b7270(param_3,uVar3);
        }
        else {
          FUN_1400b86c0();
        }
        FUN_1400bceb0(local_98);
        FUN_1400f0d30(local_68);
        return;
      }
      FUN_1400bcc20(local_98);
      uVar2 = FUN_1400b8b80(param_2);
      uVar3 = FUN_1400b8b90(param_2);
      FUN_1400f1250(uVar3,uVar2,local_98);
      uVar3 = FUN_1400b8b90(local_98);
      if (param_4 == '\0') {
        FUN_1400b7270(param_3,uVar3);
      }
      else {
        FUN_1400b86c0();
      }
    }
    FUN_1400bceb0(local_98);
  }
  return;
}



void FUN_1400bb720(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                  undefined1 param_5)

{
  undefined **local_188;
  undefined4 local_180;
  undefined1 local_178 [48];
  undefined1 local_148 [160];
  undefined1 local_a8 [160];
  
  local_188 = ClsEncode::vftable;
  local_180 = 1;
  FUN_1400bcc20(local_178);
  FUN_1400b6fd0(local_148);
  FUN_1400b6fd0(local_a8);
  FUN_1400bc640(local_178,&DAT_14020868c);
  FUN_1400b86c0(local_148,"file.dat");
  FUN_1400b86c0(local_a8,&DAT_1402083e0);
  FUN_1400b73d0(local_a8,param_1 + 0xe0);
  FUN_1400bdc90(local_178,param_1 + 0x10);
  FUN_1400b73d0(local_148,param_1 + 0x40);
  FUN_1400baad0(&local_188,param_3);
  FUN_1400bad30(&local_188,param_2,param_4,param_5);
  local_188 = ClsEncode::vftable;
  FUN_1400b7090(local_a8);
  FUN_1400b7090(local_148);
  FUN_1400bceb0(local_178);
  return;
}



undefined8 * FUN_1400bb860(undefined8 *param_1,uint param_2)

{
  *param_1 = ClsEncode::vftable;
  FUN_1400b7090(param_1 + 0x1c);
  FUN_1400b7090(param_1 + 8);
  FUN_1400bceb0(param_1 + 2);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1400bb8d0(undefined8 *param_1)

{
  *param_1 = ClsLastSignerCerts::vftable;
  FUN_1400d0a70(param_1 + 1);
  FUN_1400d0a70(param_1 + 6);
  return param_1;
}



void FUN_1400bb910(undefined8 *param_1)

{
  *param_1 = ClsLastSignerCerts::vftable;
  FUN_1400d0d30(param_1 + 1);
  FUN_1400d0d30(param_1 + 6);
  FUN_1400d0e10(param_1 + 6);
  FUN_1400d0e10(param_1 + 1);
  return;
}



undefined8 * FUN_1400bb970(undefined8 *param_1,uint param_2)

{
  *param_1 = ClsLastSignerCerts::vftable;
  FUN_1400d0d30(param_1 + 1);
  FUN_1400d0d30(param_1 + 6);
  FUN_1400d0e10(param_1 + 6);
  FUN_1400d0e10(param_1 + 1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1400bb9f0(undefined8 *param_1)

{
  *param_1 = ClsCades::vftable;
  *(undefined1 *)(param_1 + 1) = 0;
  FUN_1400b6fd0(param_1 + 2);
  FUN_1400b6fd0(param_1 + 0x16);
  FUN_1400b6fd0(param_1 + 0x2a);
  return param_1;
}



void FUN_1400bba50(undefined8 *param_1)

{
  *param_1 = ClsCades::vftable;
  FUN_1400b7090(param_1 + 0x2a);
  FUN_1400b7090(param_1 + 0x16);
  FUN_1400b7090(param_1 + 2);
  return;
}



undefined8 * FUN_1400bbaa0(undefined8 *param_1,uint param_2)

{
  *param_1 = ClsCades::vftable;
  FUN_1400b7090(param_1 + 0x2a);
  FUN_1400b7090(param_1 + 0x16);
  FUN_1400b7090(param_1 + 2);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined4 FUN_1400bbb10(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x24);
}



longlong FUN_1400bbb20(longlong param_1,int param_2)

{
  return (longlong)param_2 + *(longlong *)(param_1 + 0x18);
}



bool FUN_1400bbb30(longlong param_1)

{
  return *(char *)(param_1 + 0x10) == -0x56;
}



void FUN_1400bbb40(undefined8 param_1,int param_2)

{
  operator_new((longlong)param_2);
  return;
}



void FUN_1400bbb70(longlong param_1)

{
  if (*(undefined **)(param_1 + 0x18) != &DAT_140316459) {
    operator_delete(*(undefined **)(param_1 + 0x18));
  }
  *(undefined8 *)(param_1 + 0x18) = 0;
  return;
}



void FUN_1400bbba0(longlong param_1,char *param_2,char param_3)

{
  char cVar1;
  char *pcVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
    pcVar2 = strstr(*(char **)(param_1 + 0x18),param_2);
    if (pcVar2 != (char *)0x0) {
      if (param_3 != '\0') {
        uVar3 = 0xffffffffffffffff;
        do {
          if (uVar3 == 0) break;
          uVar3 = uVar3 - 1;
          cVar1 = *param_2;
          param_2 = param_2 + 1;
        } while (cVar1 != '\0');
        pcVar2 = pcVar2 + (~uVar3 - 1);
      }
      *pcVar2 = '\0';
      lVar4 = -1;
      pcVar2 = *(char **)(param_1 + 0x18);
      do {
        if (lVar4 == 0) break;
        lVar4 = lVar4 + -1;
        cVar1 = *pcVar2;
        pcVar2 = pcVar2 + 1;
      } while (cVar1 != '\0');
      *(uint *)(param_1 + 0x24) = ~(uint)lVar4 - 1;
    }
  }
  return;
}



void FUN_1400bbc30(longlong param_1)

{
  char *pcVar1;
  char *pcVar2;
  char cVar3;
  char *pcVar4;
  char *pcVar5;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (*(int *)(param_1 + 0x24) == 0) {
    return;
  }
  pcVar2 = *(char **)(param_1 + 0x18);
  cVar3 = *pcVar2;
  pcVar5 = pcVar2;
  if (cVar3 != '\0') {
    do {
      if ((((cVar3 != ' ') && (cVar3 != '\t')) && (cVar3 != '\n')) && (cVar3 != '\r')) break;
      cVar3 = pcVar5[1];
      pcVar5 = pcVar5 + 1;
    } while (cVar3 != '\0');
    if (pcVar5 != pcVar2) {
      *pcVar2 = *pcVar5;
      cVar3 = *pcVar5;
      pcVar4 = pcVar2;
      while (cVar3 != '\0') {
        pcVar1 = pcVar5 + 1;
        pcVar5 = pcVar5 + 1;
        pcVar4 = pcVar4 + 1;
        *pcVar4 = *pcVar1;
        cVar3 = *pcVar5;
      }
      pcVar4 = pcVar4 + -1;
      goto LAB_1400bbcb0;
    }
  }
  pcVar4 = pcVar2 + (*(int *)(param_1 + 0x24) + -1);
LAB_1400bbcb0:
  for (; ((cVar3 = *pcVar4, cVar3 == ' ' || (cVar3 == '\t')) || ((cVar3 == '\n' || (cVar3 == '\r')))
         ); pcVar4 = pcVar4 + -1) {
    *pcVar4 = '\0';
  }
  *(int *)(param_1 + 0x24) = ((int)pcVar4 - (int)pcVar2) + 1;
  return;
}



void FUN_1400bbce0(longlong param_1,char param_2,int param_3)

{
  byte bVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (param_3 < *(int *)(param_1 + 0x24)) {
    lVar3 = (longlong)param_3;
    lVar4 = lVar3;
    iVar2 = param_3;
    do {
      bVar1 = *(byte *)(*(longlong *)(param_1 + 0x18) + lVar3);
      if ((uint)bVar1 != (int)param_2) {
        *(byte *)(*(longlong *)(param_1 + 0x18) + lVar4) = bVar1;
        param_3 = param_3 + 1;
        lVar4 = lVar4 + 1;
      }
      iVar2 = iVar2 + 1;
      lVar3 = lVar3 + 1;
    } while (iVar2 < *(int *)(param_1 + 0x24));
    *(undefined1 *)((longlong)param_3 + *(longlong *)(param_1 + 0x18)) = 0;
    *(int *)(param_1 + 0x24) = param_3;
  }
  return;
}



void FUN_1400bbd50(longlong param_1,char param_2)

{
  byte *pbVar1;
  int iVar2;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  iVar2 = 0;
  if (0 < *(int *)(param_1 + 0x24)) {
    pbVar1 = *(byte **)(param_1 + 0x18);
    while ((uint)*pbVar1 != (int)param_2) {
      iVar2 = iVar2 + 1;
      pbVar1 = pbVar1 + 1;
      if (*(int *)(param_1 + 0x24) <= iVar2) {
        *(int *)(param_1 + 0x24) = iVar2;
        return;
      }
    }
    (*(byte **)(param_1 + 0x18))[iVar2] = 0;
  }
  *(int *)(param_1 + 0x24) = iVar2;
  return;
}



void FUN_1400bbda0(longlong param_1,char param_2,undefined1 param_3)

{
  ulonglong uVar1;
  uint uVar2;
  ulonglong uVar3;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  uVar1 = 0;
  uVar3 = uVar1;
  if (0 < *(int *)(param_1 + 0x24)) {
    do {
      if (*(char *)(*(longlong *)(param_1 + 0x18) + uVar1) == param_2) {
        *(undefined1 *)(*(longlong *)(param_1 + 0x18) + uVar1) = param_3;
      }
      uVar2 = (int)uVar3 + 1;
      uVar3 = (ulonglong)uVar2;
      uVar1 = uVar1 + 1;
    } while ((int)uVar2 < *(int *)(param_1 + 0x24));
  }
  return;
}



void FUN_1400bbde0(longlong param_1)

{
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (*(int *)(param_1 + 0x24) != 0) {
    memset(*(void **)(param_1 + 0x18),0x20,(longlong)*(int *)(param_1 + 0x24));
  }
  **(undefined1 **)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x24) = 0;
  return;
}



void FUN_1400bbe30(longlong param_1)

{
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  **(undefined1 **)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x24) = 0;
  return;
}



undefined8 FUN_1400bbe50(longlong param_1,undefined1 param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  void *_Dst;
  int iVar4;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  iVar4 = *(int *)(param_1 + 0x24);
  if (*(int *)(param_1 + 0x20) <= iVar4 + 1) {
    _Dst = operator_new((longlong)(*(int *)(param_1 + 0x28) + 1 + iVar4));
    if (_Dst == (void *)0x0) {
      return 0;
    }
    memcpy(_Dst,*(void **)(param_1 + 0x18),(longlong)*(int *)(param_1 + 0x24));
    if (*(undefined **)(param_1 + 0x18) != &DAT_140316459) {
      operator_delete(*(undefined **)(param_1 + 0x18));
    }
    *(void **)(param_1 + 0x18) = _Dst;
    iVar1 = *(int *)(param_1 + 0x28);
    iVar4 = *(int *)(param_1 + 0x24);
    iVar3 = iVar1 + 1 + iVar4;
    *(int *)(param_1 + 0x20) = iVar3;
    if ((iVar1 < iVar3) && (iVar1 < 500000)) {
      iVar3 = iVar3 / 2;
      if (500000 < iVar3) {
        iVar3 = 500000;
      }
      *(int *)(param_1 + 0x28) = iVar3;
    }
  }
  *(undefined1 *)((longlong)iVar4 + *(longlong *)(param_1 + 0x18)) = param_2;
  *(int *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) + 1;
  lVar2 = *(longlong *)(param_1 + 0x18);
  *(undefined1 *)(*(int *)(param_1 + 0x24) + lVar2) = 0;
  return CONCAT71((int7)((ulonglong)lVar2 >> 8),1);
}



undefined8 FUN_1400bbf40(longlong param_1,char *param_2)

{
  char cVar1;
  void *_Dst;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  char *pcVar5;
  int iVar6;
  longlong lVar7;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (param_2 != (char *)0x0) {
    lVar3 = -1;
    pcVar5 = param_2;
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      cVar1 = *pcVar5;
      pcVar5 = pcVar5 + 1;
    } while (cVar1 != '\0');
    iVar2 = ~(uint)lVar3 - 1;
    if (iVar2 == 0) {
      *(undefined1 *)((longlong)*(int *)(param_1 + 0x24) + *(longlong *)(param_1 + 0x18)) = 0;
    }
    else {
      iVar6 = *(int *)(param_1 + 0x24);
      lVar3 = 0;
      if (*(int *)(param_1 + 0x20) <= iVar6 + iVar2) {
        _Dst = operator_new((longlong)(*(int *)(param_1 + 0x28) + iVar6 + 1 + iVar2));
        if (_Dst == (void *)0x0) {
          return 0;
        }
        memcpy(_Dst,*(void **)(param_1 + 0x18),(longlong)*(int *)(param_1 + 0x24));
        FUN_1400bbb70(param_1);
        *(void **)(param_1 + 0x18) = _Dst;
        iVar6 = *(int *)(param_1 + 0x24);
        *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x28) + iVar6 + 1 + iVar2;
      }
      *(undefined1 *)((longlong)(iVar6 + iVar2) + *(longlong *)(param_1 + 0x18)) = 0;
      lVar4 = (longlong)(iVar6 + -1);
      lVar7 = (longlong)(iVar6 + iVar2 + -1);
      if (-1 < iVar6 + -1) {
        do {
          *(undefined1 *)(lVar7 + *(longlong *)(param_1 + 0x18)) =
               *(undefined1 *)(*(longlong *)(param_1 + 0x18) + lVar4);
          lVar7 = lVar7 + -1;
          lVar4 = lVar4 + -1;
        } while (-1 < lVar4);
      }
      if (0 < iVar2) {
        do {
          *(char *)(lVar3 + *(longlong *)(param_1 + 0x18)) = param_2[lVar3];
          lVar3 = lVar3 + 1;
        } while (lVar3 < iVar2);
      }
      *(int *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) + iVar2;
    }
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400bc0a0(char *param_1,uint param_2,undefined8 param_3)

{
  char cVar1;
  char cVar2;
  char cVar3;
  ulonglong uVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  undefined1 auStack_238 [32];
  char local_218 [512];
  ulonglong local_18;
  
  if ((param_1 != (char *)0x0) && (local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_238, param_2 != 0))
  {
    iVar5 = 0;
    cVar3 = 'F';
    if ((param_2 & 1) != 0) {
      local_218[0] = *param_1;
      if (local_218[0] < ':') {
        local_218[0] = local_218[0] + -0x30;
      }
      else if (local_218[0] == 'a') {
        local_218[0] = '\n';
      }
      else if (local_218[0] == 'b') {
        local_218[0] = '\v';
      }
      else if (local_218[0] == 'c') {
        local_218[0] = '\f';
      }
      else if (local_218[0] == 'd') {
        local_218[0] = '\r';
      }
      else if (local_218[0] == 'e') {
        local_218[0] = '\x0e';
      }
      else {
        if (local_218[0] == 'f') {
          local_218[0] = cVar3;
        }
        local_218[0] = local_218[0] + -0x37;
      }
      param_1 = param_1 + 1;
      iVar5 = 1;
      param_2 = param_2 - 1;
    }
    if (param_2 != 1) {
      param_1 = param_1 + 1;
      uVar4 = (ulonglong)((param_2 - 2 >> 1) + 1);
      lVar6 = (longlong)iVar5;
      do {
        cVar2 = param_1[-1];
        if (cVar2 < ':') {
          cVar2 = cVar2 + -0x30;
        }
        else if (cVar2 == 'a') {
          cVar2 = '\n';
        }
        else if (cVar2 == 'b') {
          cVar2 = '\v';
        }
        else if (cVar2 == 'c') {
          cVar2 = '\f';
        }
        else if (cVar2 == 'd') {
          cVar2 = '\r';
        }
        else if (cVar2 == 'e') {
          cVar2 = '\x0e';
        }
        else {
          if (cVar2 == 'f') {
            cVar2 = cVar3;
          }
          cVar2 = cVar2 + -0x37;
        }
        cVar1 = *param_1;
        if (cVar1 < ':') {
          cVar1 = cVar1 + -0x30;
        }
        else if (cVar1 == 'a') {
          cVar1 = '\n';
        }
        else if (cVar1 == 'b') {
          cVar1 = '\v';
        }
        else if (cVar1 == 'c') {
          cVar1 = '\f';
        }
        else if (cVar1 == 'd') {
          cVar1 = '\r';
        }
        else if (cVar1 == 'e') {
          cVar1 = '\x0e';
        }
        else {
          if (cVar1 == 'f') {
            cVar1 = cVar3;
          }
          cVar1 = cVar1 + -0x37;
        }
        iVar5 = iVar5 + 1;
        lVar7 = lVar6 + 1;
        local_218[lVar6] = cVar1 + cVar2 * '\x10';
        if (iVar5 == 500) {
          FUN_1400b97e0(param_3,local_218,500);
          iVar5 = 0;
          lVar7 = 0;
        }
        param_1 = param_1 + 2;
        uVar4 = uVar4 - 1;
        lVar6 = lVar7;
      } while (uVar4 != 0);
    }
    if (iVar5 != 0) {
      FUN_1400b97e0(param_3,local_218,iVar5);
    }
  }
  return;
}



void FUN_1400bc2a0(longlong param_1,undefined8 param_2)

{
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  FUN_1400bc0a0(*(undefined8 *)(param_1 + 0x18),*(undefined4 *)(param_1 + 0x24),param_2);
  return;
}



void FUN_1400bc2c0(longlong param_1)

{
  uint uVar1;
  
  uVar1 = *(uint *)(param_1 + 0x24) & 0x80000001;
  if ((int)uVar1 < 0) {
    uVar1 = (uVar1 - 1 | 0xfffffffe) + 1;
  }
  if (uVar1 != 0) {
    FUN_1400bbf40(param_1,&DAT_140279374);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001400bc34a)

undefined8 FUN_1400bc2f0(longlong param_1,byte *param_2,int param_3)

{
  char cVar1;
  byte bVar2;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if ((param_2 != (byte *)0x0) && (0 < param_3)) {
    do {
      bVar2 = *param_2 >> 4;
      if (bVar2 < 10) {
        cVar1 = bVar2 + 0x30;
      }
      else {
        cVar1 = bVar2 + 0x37;
      }
      cVar1 = FUN_1400bbe50(param_1,cVar1);
      if (cVar1 == '\0') {
        return 0;
      }
      bVar2 = *param_2 & 0xf;
      if (bVar2 < 10) {
        cVar1 = bVar2 + 0x30;
      }
      else {
        cVar1 = bVar2 + 0x37;
      }
      cVar1 = FUN_1400bbe50(param_1,cVar1);
      if (cVar1 == '\0') {
        return 0;
      }
      param_2 = param_2 + 1;
      param_3 = param_3 + -1;
    } while (param_3 != 0);
  }
  return 1;
}



int FUN_1400bc3a0(longlong param_1)

{
  byte bVar1;
  bool bVar2;
  int iVar3;
  byte *pbVar4;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (*(int *)(param_1 + 0x24) == 0) {
    return 0;
  }
  pbVar4 = *(byte **)(param_1 + 0x18);
  iVar3 = 0;
  bVar2 = false;
  if (*pbVar4 == 0x2d) {
    bVar2 = true;
  }
  else if (*pbVar4 != 0x2b) goto LAB_1400bc3d6;
  pbVar4 = pbVar4 + 1;
LAB_1400bc3d6:
  bVar1 = *pbVar4;
  while (bVar1 == 0x30) {
    pbVar4 = pbVar4 + 1;
    bVar1 = *pbVar4;
  }
  bVar1 = *pbVar4;
  while (((bVar1 != 0 && (bVar1 < 0x3a)) && (0x2f < bVar1))) {
    pbVar4 = pbVar4 + 1;
    iVar3 = (bVar1 - 0x30) + iVar3 * 10;
    bVar1 = *pbVar4;
  }
  if (bVar2) {
    iVar3 = -iVar3;
  }
  return iVar3;
}



void FUN_1400bc420(undefined8 param_1,longlong param_2)

{
  if (param_2 != 0) {
    FUN_140105970(param_1,param_2,10);
  }
  return;
}



uint FUN_1400bc440(int param_1,undefined1 *param_2)

{
  undefined1 uVar1;
  int iVar2;
  longlong lVar3;
  int iVar4;
  ulonglong uVar5;
  undefined1 *puVar6;
  undefined1 *puVar7;
  uint uVar8;
  ulonglong uVar10;
  int iVar9;
  
  if (param_2 == (undefined1 *)0x0) {
    return 0;
  }
  uVar5 = 0;
  uVar10 = uVar5;
  iVar4 = param_1;
  if (param_1 < 0) {
    iVar4 = -param_1;
  }
  do {
    iVar9 = (int)uVar10;
    uVar8 = iVar9 + 1;
    iVar2 = iVar4 / 10;
    param_2[uVar5] = "0123456789abcdefghijklmnopqrstuvwxyz"[iVar4 % 10];
    if (0x25 < (longlong)(uVar5 + 1)) break;
    uVar5 = uVar5 + 1;
    uVar10 = (ulonglong)uVar8;
    iVar4 = iVar2;
  } while (0 < iVar2);
  if (param_1 < 0) {
    lVar3 = (longlong)(int)uVar8;
    uVar8 = iVar9 + 2;
    param_2[lVar3] = 0x2d;
  }
  param_2[(int)uVar8] = 0;
  if ((uVar8 != 0) && (lVar3 = (longlong)(int)(uVar8 - 1), 0 < (int)(uVar8 - 1))) {
    puVar6 = param_2;
    do {
      uVar1 = *puVar6;
      puVar7 = puVar6 + 1;
      *puVar6 = param_2[lVar3];
      param_2[lVar3] = uVar1;
      lVar3 = lVar3 + -1;
      puVar6 = puVar7;
    } while ((longlong)puVar7 - (longlong)param_2 < lVar3);
  }
  return uVar8;
}



void FUN_1400bc510(longlong param_1,int param_2)

{
  if ((-1 < param_2) && (param_2 < 3)) {
    *(char *)(param_1 + 0x11) = (char)param_2;
    return;
  }
  *(undefined1 *)(param_1 + 0x11) = 0;
  return;
}



undefined8 FUN_1400bc530(longlong param_1,int param_2)

{
  int iVar1;
  uint uVar2;
  void *_Dst;
  ulonglong uVar3;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  uVar2 = *(int *)(param_1 + 0x24) + param_2;
  uVar3 = (ulonglong)uVar2;
  if (*(int *)(param_1 + 0x20) <= (int)uVar2) {
    _Dst = operator_new((longlong)
                        (*(int *)(param_1 + 0x28) + *(int *)(param_1 + 0x24) + 1 + param_2));
    if (_Dst == (void *)0x0) {
      return 0;
    }
    memcpy(_Dst,*(void **)(param_1 + 0x18),(longlong)*(int *)(param_1 + 0x24));
    if (*(undefined **)(param_1 + 0x18) != &DAT_140316459) {
      operator_delete(*(undefined **)(param_1 + 0x18));
    }
    *(void **)(param_1 + 0x18) = _Dst;
    iVar1 = *(int *)(param_1 + 0x28);
    uVar2 = *(int *)(param_1 + 0x24) + iVar1 + 1 + param_2;
    uVar3 = (ulonglong)uVar2;
    *(uint *)(param_1 + 0x20) = uVar2;
    if ((iVar1 < (int)uVar2) && (iVar1 < 500000)) {
      uVar3 = (ulonglong)(uint)((int)uVar2 / 2);
      if (500000 < (int)uVar2 / 2) {
        uVar3 = 500000;
      }
      *(int *)(param_1 + 0x28) = (int)uVar3;
    }
  }
  return CONCAT71((int7)(uVar3 >> 8),1);
}



bool FUN_1400bc610(longlong param_1,char param_2)

{
  char *pcVar1;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  pcVar1 = strchr(*(char **)(param_1 + 0x18),(int)param_2);
  return pcVar1 != (char *)0x0;
}



undefined8 FUN_1400bc640(longlong param_1,char *param_2)

{
  char cVar1;
  int iVar2;
  int iVar3;
  void *_Dst;
  int iVar4;
  int iVar5;
  longlong lVar6;
  char *pcVar7;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (param_2 != (char *)0x0) {
    lVar6 = -1;
    pcVar7 = param_2;
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      cVar1 = *pcVar7;
      pcVar7 = pcVar7 + 1;
    } while (cVar1 != '\0');
    iVar4 = ~(uint)lVar6 - 1;
    if (iVar4 == 0) {
      *(undefined1 *)((longlong)*(int *)(param_1 + 0x24) + *(longlong *)(param_1 + 0x18)) = 0;
    }
    else {
      iVar5 = *(int *)(param_1 + 0x24);
      if (*(int *)(param_1 + 0x20) <= iVar5 + iVar4) {
        _Dst = operator_new((longlong)(*(int *)(param_1 + 0x28) + iVar5 + 1 + iVar4));
        if (_Dst == (void *)0x0) {
          return 0;
        }
        memcpy(_Dst,*(void **)(param_1 + 0x18),(longlong)*(int *)(param_1 + 0x24));
        FUN_1400bbb70(param_1);
        *(void **)(param_1 + 0x18) = _Dst;
        iVar2 = *(int *)(param_1 + 0x28);
        iVar5 = *(int *)(param_1 + 0x24);
        iVar3 = iVar2 + iVar5 + 1 + iVar4;
        *(int *)(param_1 + 0x20) = iVar3;
        if ((iVar2 < iVar3) && (iVar2 < 500000)) {
          iVar3 = iVar3 / 2;
          if (500000 < iVar3) {
            iVar3 = 500000;
          }
          *(int *)(param_1 + 0x28) = iVar3;
        }
      }
      pcVar7 = (char *)((longlong)iVar5 + *(longlong *)(param_1 + 0x18));
      do {
        cVar1 = *param_2;
        *pcVar7 = cVar1;
        param_2 = param_2 + 1;
        pcVar7 = pcVar7 + 1;
      } while (cVar1 != '\0');
      *(int *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) + iVar4;
    }
  }
  return 1;
}



ulonglong FUN_1400bc770(longlong param_1,char *param_2)

{
  char cVar1;
  char cVar2;
  uint uVar3;
  ulonglong in_RAX;
  char *pcVar4;
  int iVar5;
  longlong lVar6;
  
  if (param_2 != (char *)0x0) {
    lVar6 = -1;
    pcVar4 = param_2;
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      cVar1 = *pcVar4;
      pcVar4 = pcVar4 + 1;
    } while (cVar1 != '\0');
    iVar5 = ~(uint)lVar6 - 1;
    if (iVar5 == 0) {
      return 1;
    }
    uVar3 = *(uint *)(param_1 + 0x24);
    in_RAX = (ulonglong)uVar3;
    if (iVar5 <= (int)uVar3) {
      pcVar4 = (char *)((longlong)(int)(uVar3 - iVar5) + *(longlong *)(param_1 + 0x18));
      lVar6 = (longlong)param_2 - (longlong)pcVar4;
      do {
        cVar1 = *pcVar4;
        cVar2 = pcVar4[lVar6];
        if (cVar1 != cVar2) break;
        pcVar4 = pcVar4 + 1;
      } while (cVar2 != '\0');
      return CONCAT71((int7)((ulonglong)pcVar4 >> 8),cVar1 == cVar2);
    }
  }
  return in_RAX & 0xffffffffffffff00;
}



ulonglong FUN_1400bc7e0(longlong param_1,char *param_2)

{
  char cVar1;
  int iVar2;
  ulonglong in_RAX;
  undefined4 extraout_var;
  longlong lVar3;
  char *pcVar4;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (param_2 == (char *)0x0) {
    return in_RAX & 0xffffffffffffff00;
  }
  lVar3 = -1;
  pcVar4 = param_2;
  do {
    if (lVar3 == 0) break;
    lVar3 = lVar3 + -1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + 1;
  } while (cVar1 != '\0');
  iVar2 = strncmp(param_2,*(char **)(param_1 + 0x18),(longlong)(int)(~(uint)lVar3 - 1));
  return CONCAT71((int7)(CONCAT44(extraout_var,iVar2) >> 8),iVar2 == 0);
}



ulonglong FUN_1400bc840(longlong param_1,char *param_2)

{
  char cVar1;
  int iVar2;
  ulonglong in_RAX;
  undefined4 extraout_var;
  longlong lVar3;
  char *pcVar4;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (param_2 == (char *)0x0) {
    return in_RAX & 0xffffffffffffff00;
  }
  lVar3 = -1;
  pcVar4 = param_2;
  do {
    if (lVar3 == 0) break;
    lVar3 = lVar3 + -1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + 1;
  } while (cVar1 != '\0');
  iVar2 = _strnicmp(param_2,*(char **)(param_1 + 0x18),(longlong)(int)(~(uint)lVar3 - 1));
  return CONCAT71((int7)(CONCAT44(extraout_var,iVar2) >> 8),iVar2 == 0);
}



undefined8 FUN_1400bc8a0(longlong param_1,void *param_2,int param_3)

{
  int iVar1;
  int iVar2;
  int iVar3;
  void *_Dst;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if ((param_2 != (void *)0x0) && (0 < param_3)) {
    iVar3 = *(int *)(param_1 + 0x24);
    if (*(int *)(param_1 + 0x20) <= iVar3 + param_3) {
      _Dst = operator_new((longlong)(*(int *)(param_1 + 0x28) + iVar3 + param_3));
      if (_Dst == (void *)0x0) {
        return 0;
      }
      if (*(int *)(param_1 + 0x24) != 0) {
        memcpy(_Dst,*(void **)(param_1 + 0x18),(longlong)*(int *)(param_1 + 0x24));
      }
      FUN_1400bbb70(param_1);
      *(void **)(param_1 + 0x18) = _Dst;
      iVar1 = *(int *)(param_1 + 0x28);
      iVar3 = *(int *)(param_1 + 0x24);
      iVar2 = iVar1 + iVar3 + param_3;
      *(int *)(param_1 + 0x20) = iVar2;
      if ((iVar1 < iVar2) && (iVar1 < 500000)) {
        iVar2 = iVar2 / 2;
        if (500000 < iVar2) {
          iVar2 = 500000;
        }
        *(int *)(param_1 + 0x28) = iVar2;
      }
    }
    memcpy((void *)((longlong)iVar3 + *(longlong *)(param_1 + 0x18)),param_2,(longlong)param_3);
    *(int *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) + param_3;
    *(undefined1 *)((longlong)*(int *)(param_1 + 0x24) + *(longlong *)(param_1 + 0x18)) = 0;
    if (*(int *)(param_1 + 0x24) != 0) {
      do {
        if (*(char *)((longlong)*(int *)(param_1 + 0x24) + -1 + *(longlong *)(param_1 + 0x18)) !=
            '\0') {
          return 1;
        }
        iVar3 = *(int *)(param_1 + 0x24) + -1;
        *(int *)(param_1 + 0x24) = iVar3;
      } while (iVar3 != 0);
    }
  }
  return 1;
}



void FUN_1400bc9f0(longlong param_1)

{
  void *_Dst;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (*(int *)(param_1 + 0x24) + 4 < *(int *)(param_1 + 0x20)) {
    _Dst = operator_new((longlong)(*(int *)(param_1 + 0x24) + 1));
    if (_Dst != (void *)0x0) {
      memcpy(_Dst,*(void **)(param_1 + 0x18),(longlong)(*(int *)(param_1 + 0x24) + 1));
      *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x24) + 1;
      if (*(undefined **)(param_1 + 0x18) != &DAT_140316459) {
        operator_delete(*(undefined **)(param_1 + 0x18));
      }
      *(void **)(param_1 + 0x18) = _Dst;
    }
  }
  return;
}



undefined8 * FUN_1400bcaa0(undefined8 *param_1,char *param_2)

{
  char cVar1;
  void *pvVar2;
  uint uVar3;
  longlong lVar4;
  char *pcVar5;
  
  FUN_1400d0eb0();
  *param_1 = chilkat::StringBuffer::vftable;
  *(undefined2 *)(param_1 + 2) = 0xaa;
  *(undefined4 *)(param_1 + 5) = 200;
  param_1[3] = 0;
  if (param_2 == (char *)0x0) {
    pvVar2 = operator_new(4);
    param_1[3] = pvVar2;
    if ((undefined1 *)param_1[3] == (undefined1 *)0x0) {
      param_1[3] = &DAT_140316459;
      param_1[4] = 1;
    }
    else {
      *(undefined1 *)param_1[3] = 0;
      param_1[4] = 4;
    }
  }
  else {
    lVar4 = -1;
    pcVar5 = param_2;
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      cVar1 = *pcVar5;
      pcVar5 = pcVar5 + 1;
    } while (cVar1 != '\0');
    uVar3 = ~(uint)lVar4;
    pvVar2 = operator_new((longlong)(int)uVar3);
    param_1[3] = pvVar2;
    pcVar5 = (char *)param_1[3];
    if (pcVar5 == (char *)0x0) {
      param_1[3] = &DAT_140316459;
      param_1[4] = 1;
    }
    else {
      do {
        cVar1 = *param_2;
        *pcVar5 = cVar1;
        param_2 = param_2 + 1;
        pcVar5 = pcVar5 + 1;
      } while (cVar1 != '\0');
      *(uint *)(param_1 + 4) = uVar3;
      *(uint *)((longlong)param_1 + 0x24) = uVar3 - 1;
    }
  }
  return param_1;
}



undefined8 *
FUN_1400bcbb0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  pvVar1 = operator_new(0x30);
  if (pvVar1 == (void *)0x0) {
    puVar2 = (undefined8 *)0x0;
  }
  else {
    puVar2 = (undefined8 *)FUN_1400bcaa0(pvVar1,param_1,param_3,param_4,uVar3);
  }
  if ((undefined *)puVar2[3] == &DAT_140316459) {
    (**(code **)*puVar2)(puVar2,1);
    puVar2 = (undefined8 *)0x0;
  }
  return puVar2;
}



undefined8 *
FUN_1400bcc20(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1400d0eb0();
  *param_1 = chilkat::StringBuffer::vftable;
  *(undefined2 *)(param_1 + 2) = 0xaa;
  *(undefined4 *)((longlong)param_1 + 0x24) = 0;
  *(undefined4 *)(param_1 + 5) = 0xca;
  puVar1 = (undefined1 *)FUN_1400bbb40(param_1,0xca,param_3,param_4,uVar2);
  param_1[3] = puVar1;
  if (puVar1 == (undefined1 *)0x0) {
    puVar1 = (undefined1 *)FUN_1400bbb40(param_1,4,param_3,param_4,uVar2);
    param_1[3] = puVar1;
    if (puVar1 == (undefined1 *)0x0) {
      param_1[3] = &DAT_140316459;
      *(undefined4 *)(param_1 + 4) = 1;
    }
    else {
      *puVar1 = 0;
      *(undefined4 *)(param_1 + 4) = 4;
    }
  }
  else {
    *puVar1 = 0;
    *(undefined4 *)(param_1 + 4) = *(undefined4 *)(param_1 + 5);
  }
  return param_1;
}



undefined8 *
FUN_1400bccc0(undefined8 *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  char *pcVar4;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  FUN_1400d0eb0();
  *param_1 = chilkat::StringBuffer::vftable;
  *(undefined1 *)(param_1 + 2) = 0xaa;
  iVar2 = *(int *)(param_2 + 0x24);
  *(int *)((longlong)param_1 + 0x24) = iVar2;
  pcVar3 = (char *)FUN_1400bbb40(param_1,iVar2 + 1,param_3,param_4,uVar5);
  param_1[3] = pcVar3;
  if (pcVar3 == (char *)0x0) {
    param_1[3] = &DAT_140316459;
    param_1[4] = 1;
  }
  else {
    *(int *)(param_1 + 4) = *(int *)((longlong)param_1 + 0x24) + 1;
    pcVar4 = *(char **)(param_2 + 0x18);
    do {
      cVar1 = *pcVar4;
      *pcVar3 = cVar1;
      pcVar4 = pcVar4 + 1;
      pcVar3 = pcVar3 + 1;
    } while (cVar1 != '\0');
    *(undefined4 *)(param_1 + 5) = 200;
    *(undefined1 *)((longlong)param_1 + 0x11) = *(undefined1 *)(param_2 + 0x11);
  }
  return param_1;
}



undefined8 * FUN_1400bcd60(undefined8 *param_1,void *param_2,int param_3,int param_4)

{
  longlong lVar1;
  
  FUN_1400d0eb0();
  *param_1 = chilkat::StringBuffer::vftable;
  *(undefined2 *)(param_1 + 2) = 0xaa;
  *(undefined4 *)((longlong)param_1 + 0x24) = 0;
  *(int *)(param_1 + 5) = param_4;
  if (param_4 == 0) {
    *(undefined4 *)(param_1 + 5) = 200;
  }
  lVar1 = FUN_1400bbb40(param_1,param_3 + 1);
  param_1[3] = lVar1;
  if (lVar1 == 0) {
    param_1[3] = &DAT_140316459;
    param_1[4] = 1;
  }
  else {
    *(undefined1 *)(param_3 + lVar1) = 0;
    memcpy((void *)param_1[3],param_2,(longlong)param_3);
    *(int *)(param_1 + 4) = param_3 + 1;
    *(int *)((longlong)param_1 + 0x24) = param_3;
  }
  return param_1;
}



undefined8 * FUN_1400bce20(undefined8 *param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1400d0eb0();
  *param_1 = chilkat::StringBuffer::vftable;
  *(undefined2 *)(param_1 + 2) = 0xaa;
  *(undefined4 *)((longlong)param_1 + 0x24) = 0;
  *(int *)(param_1 + 5) = param_2;
  if (param_2 == 0) {
    *(undefined4 *)(param_1 + 5) = 200;
  }
  puVar1 = (undefined1 *)FUN_1400bbb40(param_1,*(undefined4 *)(param_1 + 5),param_3,param_4,uVar2);
  param_1[3] = puVar1;
  if (puVar1 == (undefined1 *)0x0) {
    param_1[3] = &DAT_140316459;
    param_1[4] = 1;
  }
  else {
    *puVar1 = 0;
    *(undefined4 *)(param_1 + 4) = *(undefined4 *)(param_1 + 5);
  }
  return param_1;
}



void FUN_1400bceb0(undefined8 *param_1)

{
  *param_1 = chilkat::StringBuffer::vftable;
  *(undefined1 *)(param_1 + 2) = 0;
  if ((undefined *)param_1[3] != &DAT_140316459) {
    operator_delete((undefined *)param_1[3]);
  }
  param_1[3] = 0xdddddddd;
  *(undefined4 *)((longlong)param_1 + 0x24) = 0xdddddddd;
  *(undefined4 *)(param_1 + 4) = 0xdddddddd;
  *(undefined4 *)(param_1 + 5) = 0xdddddddd;
  FUN_1400d0ee0(param_1);
  return;
}



undefined8 FUN_1400bcf20(longlong param_1,undefined4 *param_2)

{
  undefined8 uVar1;
  undefined1 *puVar2;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (param_2 != (undefined4 *)0x0) {
    *param_2 = *(undefined4 *)(param_1 + 0x24);
  }
  uVar1 = *(undefined8 *)(param_1 + 0x18);
  puVar2 = (undefined1 *)FUN_1400bbb40(param_1,*(undefined4 *)(param_1 + 0x28));
  *(undefined1 **)(param_1 + 0x18) = puVar2;
  if (puVar2 == (undefined1 *)0x0) {
    *(undefined8 *)(param_1 + 0x20) = 1;
    *(undefined **)(param_1 + 0x18) = &DAT_140316459;
    return uVar1;
  }
  *puVar2 = 0;
  *(undefined4 *)(param_1 + 0x24) = 0;
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(param_1 + 0x28);
  return uVar1;
}



undefined8 FUN_1400bcfa0(longlong param_1,char *param_2,longlong param_3)

{
  char cVar1;
  char *pcVar2;
  undefined1 *puVar3;
  ulonglong uVar4;
  longlong lVar5;
  char *pcVar6;
  int iVar7;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if ((((param_2 == (char *)0x0) || (*param_2 == '\0')) ||
      (*(char **)(param_1 + 0x18) == (char *)0x0)) ||
     (pcVar2 = strstr(*(char **)(param_1 + 0x18),param_2), pcVar2 == (char *)0x0)) {
    return 0;
  }
  pcVar6 = pcVar2;
  if (param_3 != 0) {
    uVar4 = 0xffffffffffffffff;
    do {
      if (uVar4 == 0) break;
      uVar4 = uVar4 - 1;
      cVar1 = *param_2;
      param_2 = param_2 + 1;
    } while (cVar1 != '\0');
    pcVar6 = pcVar2 + (~uVar4 - 1);
  }
  puVar3 = (undefined1 *)0x0;
  iVar7 = *(int *)(param_1 + 0x24) - ((int)pcVar6 - *(int *)(param_1 + 0x18));
  if (0 < iVar7) {
    puVar3 = operator_new((longlong)(iVar7 + 1));
    if (puVar3 == (undefined1 *)0x0) {
      return 0;
    }
    *puVar3 = 0x61;
    puVar3[iVar7] = 0x61;
    lVar5 = (longlong)puVar3 - (longlong)pcVar6;
    do {
      cVar1 = *pcVar6;
      pcVar6[lVar5] = cVar1;
      pcVar6 = pcVar6 + 1;
    } while (cVar1 != '\0');
    puVar3[iVar7] = 0;
  }
  *pcVar2 = '\0';
  lVar5 = -1;
  pcVar2 = *(char **)(param_1 + 0x18);
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    cVar1 = *pcVar2;
    pcVar2 = pcVar2 + 1;
  } while (cVar1 != '\0');
  *(uint *)(param_1 + 0x24) = ~(uint)lVar5 - 1;
  FUN_1400bc640(param_1,param_3);
  if (iVar7 != 0) {
    FUN_1400bc640(param_1,puVar3);
    operator_delete(puVar3);
  }
  return 1;
}



int FUN_1400bd110(longlong param_1,char *param_2,undefined8 param_3)

{
  char cVar1;
  undefined *puVar2;
  char *pcVar3;
  void *pvVar4;
  char *pcVar5;
  longlong lVar6;
  int iVar7;
  int iVar8;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (((param_2 != (char *)0x0) && (*param_2 != '\0')) &&
     (pcVar3 = strstr(*(char **)(param_1 + 0x18),param_2), pcVar3 != (char *)0x0)) {
    puVar2 = *(undefined **)(param_1 + 0x18);
    *(undefined8 *)(param_1 + 0x18) = 0;
    pvVar4 = operator_new((longlong)*(int *)(param_1 + 0x28));
    *(void **)(param_1 + 0x18) = pvVar4;
    if (*(longlong *)(param_1 + 0x18) != 0) {
      *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(param_1 + 0x28);
      *(undefined4 *)(param_1 + 0x24) = 0;
      lVar6 = -1;
      pcVar5 = param_2;
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        cVar1 = *pcVar5;
        pcVar5 = pcVar5 + 1;
      } while (cVar1 != '\0');
      iVar7 = ~(uint)lVar6 - 1;
      *pcVar3 = '\0';
      FUN_1400bc640(param_1,puVar2);
      FUN_1400bc640(param_1,param_3);
      iVar8 = 1;
      *pcVar3 = *param_2;
      pcVar3 = pcVar3 + iVar7;
      cVar1 = *pcVar3;
      do {
        if (cVar1 == '\0') {
LAB_1400bd26b:
          if (puVar2 == &DAT_140316459) {
            return iVar8;
          }
          operator_delete(puVar2);
          return iVar8;
        }
        pcVar5 = strstr(pcVar3,param_2);
        if (pcVar5 == (char *)0x0) {
          FUN_1400bc640(param_1,pcVar3);
          goto LAB_1400bd26b;
        }
        *pcVar5 = '\0';
        FUN_1400bc640(param_1,pcVar3);
        FUN_1400bc640(param_1,param_3);
        iVar8 = iVar8 + 1;
        *pcVar5 = *param_2;
        pcVar3 = pcVar5 + iVar7;
        cVar1 = *pcVar3;
      } while( true );
    }
    *(undefined **)(param_1 + 0x18) = puVar2;
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400bd2a0(longlong param_1,undefined8 param_2,longlong *param_3)

{
  longlong lVar1;
  char *pcVar2;
  char cVar3;
  uint uVar4;
  undefined4 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined1 auStack_198 [32];
  undefined1 *local_178;
  longlong *local_170;
  uint local_168;
  undefined1 local_164 [4];
  longlong local_160 [5];
  undefined1 local_138 [24];
  undefined1 local_120 [8];
  undefined8 local_118;
  undefined1 local_108 [192];
  ulonglong local_48;
  
  local_118 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_198;
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  uVar6 = 0;
  FUN_140104980(local_138);
  cVar3 = FUN_1400c00c0(local_138,param_2,local_120,param_3);
  if (cVar3 == '\0') {
    FUN_1401049e0(local_138);
    uVar6 = 0;
  }
  else {
    uVar4 = FUN_140104d40(local_138,param_3);
    if (uVar4 == 0) {
      FUN_1401049e0(local_138);
      uVar6 = 1;
    }
    else if (uVar4 == 0xffffffff) {
      if (param_3 != (longlong *)0x0) {
        lVar1 = *param_3;
        uVar6 = FUN_1400b7950(param_2);
        (**(code **)(lVar1 + 0x58))(param_3,"filename",uVar6);
        (**(code **)(*param_3 + 0x28))
                  (param_3,"Failed to get file size when loading string from file");
      }
      FUN_1401049e0(local_138);
      uVar6 = 0;
    }
    else {
      cVar3 = FUN_1400bc530(param_1,uVar4 + 4,0x3ea);
      if (cVar3 == '\0') {
        if (param_3 != (longlong *)0x0) {
          (**(code **)(*param_3 + 0x28))(param_3,"Out of memory reading file into string buffer");
          FUN_1400cf520(param_3,"fileSize",uVar4);
        }
        FUN_1401049e0(local_138);
        uVar6 = 0;
      }
      else {
        local_168 = 0;
        local_178 = local_164;
        local_170 = param_3;
        cVar3 = FUN_140104fa0(local_138,
                              (longlong)*(int *)(param_1 + 0x24) + *(longlong *)(param_1 + 0x18),
                              uVar4,&local_168);
        if (cVar3 == '\0') {
          *(undefined1 *)((longlong)*(int *)(param_1 + 0x24) + *(longlong *)(param_1 + 0x18)) = 0;
          if (param_3 != (longlong *)0x0) {
            lVar1 = *param_3;
            uVar7 = FUN_1400b7950(param_2);
            (**(code **)(lVar1 + 0x58))(param_3,"filename",uVar7);
            (**(code **)(*param_3 + 0x28))(param_3,"Failed to read data from file");
          }
        }
        else if (local_168 == uVar4) {
          *(int *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) + local_168;
          *(undefined1 *)((longlong)*(int *)(param_1 + 0x24) + *(longlong *)(param_1 + 0x18)) = 0;
          pcVar2 = *(char **)(param_1 + 0x18);
          if ((*pcVar2 == -1) && (pcVar2[1] == -2)) {
            FUN_1400c2840(local_108);
            FUN_1400b8c40(local_160);
            local_170 = local_160;
            local_178 = (undefined1 *)CONCAT44(local_178._4_4_,*(undefined4 *)(param_1 + 0x24));
            FUN_1400cded0(local_108,0x4b0,0xfde9,*(undefined8 *)(param_1 + 0x18));
            if (*(char *)(param_1 + 0x10) != -0x56) {
              DAT_00000000 = 0x78;
            }
            **(undefined1 **)(param_1 + 0x18) = 0;
            *(undefined4 *)(param_1 + 0x24) = 0;
            uVar5 = FUN_1400b8b80(local_160);
            uVar6 = FUN_1400b8b90(local_160);
            FUN_1400bc8a0(param_1,uVar6,uVar5);
            FUN_1400b92d0(local_160);
            FUN_1400c2880(local_108);
          }
          else if ((*pcVar2 == -2) && (pcVar2[1] == -1)) {
            FUN_1400c2840(local_108);
            FUN_1400b8c40(local_160);
            local_170 = local_160;
            local_178 = (undefined1 *)CONCAT44(local_178._4_4_,*(undefined4 *)(param_1 + 0x24));
            FUN_1400cded0(local_108,0x4b1,0xfde9,*(undefined8 *)(param_1 + 0x18));
            if (*(char *)(param_1 + 0x10) != -0x56) {
              DAT_00000000 = 0x78;
            }
            **(undefined1 **)(param_1 + 0x18) = 0;
            *(undefined4 *)(param_1 + 0x24) = 0;
            uVar5 = FUN_1400b8b80(local_160);
            uVar6 = FUN_1400b8b90(local_160);
            FUN_1400bc8a0(param_1,uVar6,uVar5);
            FUN_1400b92d0(local_160);
            FUN_1400c2880(local_108);
          }
          else if ((((3 < *(int *)(param_1 + 0x24)) && (*pcVar2 == -0x11)) && (pcVar2[1] == -0x45))
                  && (pcVar2[2] == -0x41)) {
            FUN_1400b8c40(local_160);
            FUN_1400b97e0(local_160,pcVar2 + 3,*(int *)(param_1 + 0x24) + -3);
            if (*(char *)(param_1 + 0x10) != -0x56) {
              DAT_00000000 = 0x78;
            }
            **(undefined1 **)(param_1 + 0x18) = 0;
            *(undefined4 *)(param_1 + 0x24) = 0;
            uVar5 = FUN_1400b8b80(local_160);
            uVar6 = FUN_1400b8b90(local_160);
            FUN_1400bc8a0(param_1,uVar6,uVar5);
            FUN_1400b92d0(local_160);
          }
          uVar6 = 1;
        }
        else {
          *(undefined1 *)((longlong)*(int *)(param_1 + 0x24) + *(longlong *)(param_1 + 0x18)) = 0;
          if (param_3 != (longlong *)0x0) {
            FUN_1400cf520(param_3,"filesize",uVar4);
            FUN_1400cf520(param_3,"bytes_received",local_168);
            lVar1 = *param_3;
            uVar7 = FUN_1400b7950(param_2);
            (**(code **)(lVar1 + 0x58))(param_3,"filename",uVar7);
            (**(code **)(*param_3 + 0x28))(param_3,"Failed to read the entire file (3)");
          }
        }
        FUN_1401049e0(local_138);
      }
    }
  }
  return uVar6;
}



void FUN_1400bd6e0(longlong param_1)

{
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  FUN_1400bd110(param_1,&DAT_140208d30,"&amp;");
  FUN_1400bd110(param_1,&DAT_14027b674,&DAT_14027ba68);
  FUN_1400bd110(param_1,&DAT_14027b5a4,&DAT_14027ba60);
  FUN_1400bd110(param_1,&DAT_14027b5c4,"&quot;");
  return;
}



void FUN_1400bd760(longlong param_1)

{
  char cVar1;
  byte bVar2;
  char *pcVar3;
  int iVar4;
  longlong lVar5;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (*(int *)(param_1 + 0x24) != 0) {
    pcVar3 = *(char **)(param_1 + 0x18);
    lVar5 = 0;
    cVar1 = *pcVar3;
    while (cVar1 != '\0') {
      bVar2 = pcVar3[lVar5];
      if ((char)bVar2 < '\0') {
        if ((byte)(bVar2 + 0x40) < 0x20) {
          pcVar3[lVar5] = bVar2 + 0x20;
        }
      }
      else {
        iVar4 = tolower((uint)bVar2);
        *(char *)(lVar5 + *(longlong *)(param_1 + 0x18)) = (char)iVar4;
      }
      pcVar3 = *(char **)(param_1 + 0x18);
      lVar5 = lVar5 + 1;
      cVar1 = pcVar3[lVar5];
    }
  }
  return;
}



void FUN_1400bd7d0(longlong param_1)

{
  char cVar1;
  byte bVar2;
  char *pcVar3;
  int iVar4;
  longlong lVar5;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (*(int *)(param_1 + 0x24) != 0) {
    pcVar3 = *(char **)(param_1 + 0x18);
    lVar5 = 0;
    cVar1 = *pcVar3;
    while (cVar1 != '\0') {
      bVar2 = pcVar3[lVar5];
      if ((char)bVar2 < '\0') {
        if (0xdf < bVar2) {
          pcVar3[lVar5] = bVar2 - 0x20;
        }
      }
      else {
        iVar4 = toupper((uint)bVar2);
        *(char *)(lVar5 + *(longlong *)(param_1 + 0x18)) = (char)iVar4;
      }
      pcVar3 = *(char **)(param_1 + 0x18);
      lVar5 = lVar5 + 1;
      cVar1 = pcVar3[lVar5];
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400bd840(longlong param_1)

{
  undefined1 uVar1;
  int iVar2;
  undefined1 auVar3 [16];
  __uint64 _Var4;
  int *piVar5;
  uint uVar6;
  ulonglong uVar7;
  uint uVar8;
  int *piVar9;
  longlong lVar10;
  uint uVar11;
  uint uVar12;
  uint *puVar13;
  undefined1 auStack_c8 [32];
  longlong local_a8;
  int *local_a0;
  longlong local_98;
  undefined8 local_90;
  undefined1 local_88 [96];
  byte local_28 [16];
  ulonglong local_18;
  
  local_90 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_c8;
  if (1 < *(int *)(param_1 + 0x24)) {
    local_a8 = 0;
    local_a0 = (int *)0x0;
    auVar3._8_8_ = 0;
    auVar3._0_8_ = (longlong)*(int *)(param_1 + 0x24);
    _Var4 = SUB168(ZEXT816(4) * auVar3,0);
    if (SUB168(ZEXT816(4) * auVar3,8) != 0) {
      _Var4 = 0xffffffffffffffff;
    }
    local_98 = param_1;
    piVar5 = operator_new(_Var4);
    if (piVar5 != (int *)0x0) {
      uVar7 = 0;
      piVar9 = piVar5;
      if (*(int *)(param_1 + 0x24) != 0) {
        do {
          *piVar9 = (int)uVar7;
          local_a8 = local_a8 + (ulonglong)*(byte *)(uVar7 + *(longlong *)(param_1 + 0x18));
          uVar8 = (int)uVar7 + 1;
          uVar7 = (ulonglong)uVar8;
          piVar9 = piVar9 + 1;
        } while (uVar8 < *(uint *)(param_1 + 0x24));
      }
      local_a8 = local_a8 * *(int *)(param_1 + 0x24);
      local_a0 = piVar5;
      FUN_1400f4fd0(local_88);
      FUN_1400f52e0(local_88,&local_a8,8);
      uVar12 = 0;
      uVar7 = 0;
      uVar11 = 0;
      lVar10 = 0;
      uVar8 = *(uint *)(param_1 + 0x24);
      piVar9 = piVar5;
      if (uVar8 != 0) {
        do {
          iVar2 = *piVar9;
          for (uVar6 = (int)uVar7 + (uint)local_28[lVar10] + iVar2; uVar7 = (ulonglong)uVar6,
              uVar8 <= uVar6; uVar6 = uVar6 - uVar8) {
          }
          *piVar9 = piVar5[uVar7];
          piVar5[uVar7] = iVar2;
          uVar12 = uVar12 + 1;
          lVar10 = lVar10 + 1;
          if (0xf < uVar12) {
            uVar12 = 0;
            lVar10 = 0;
          }
          uVar11 = uVar11 + 1;
          uVar8 = *(uint *)(param_1 + 0x24);
          piVar9 = piVar9 + 1;
        } while (uVar11 < uVar8);
      }
      uVar8 = *(int *)(param_1 + 0x24) - 1;
      uVar7 = (ulonglong)uVar8;
      if (uVar8 != 0) {
        puVar13 = (uint *)(piVar5 + (int)uVar8);
        do {
          lVar10 = *(longlong *)(param_1 + 0x18);
          uVar1 = *(undefined1 *)(uVar7 + lVar10);
          *(undefined1 *)(uVar7 + lVar10) = *(undefined1 *)((ulonglong)*puVar13 + lVar10);
          *(undefined1 *)((ulonglong)*puVar13 + *(longlong *)(param_1 + 0x18)) = uVar1;
          puVar13 = puVar13 + -1;
          uVar8 = (int)uVar7 - 1;
          uVar7 = (ulonglong)uVar8;
        } while (uVar8 != 0);
      }
      lVar10 = *(longlong *)(param_1 + 0x18);
      uVar1 = *(undefined1 *)(lVar10 + uVar7);
      *(undefined1 *)(lVar10 + uVar7) = *(undefined1 *)((ulonglong)(uint)piVar5[uVar7] + lVar10);
      *(undefined1 *)((ulonglong)(uint)piVar5[uVar7] + *(longlong *)(param_1 + 0x18)) = uVar1;
      operator_delete(piVar5);
      FUN_1400f5000(local_88);
    }
  }
  return;
}



void FUN_1400bda40(longlong param_1,longlong param_2)

{
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  FUN_1400bc8a0(param_1,*(undefined8 *)(param_2 + 0x18),*(undefined4 *)(param_2 + 0x24));
  return;
}



void FUN_1400bda60(longlong param_1,undefined8 param_2)

{
  uint uVar1;
  undefined4 uVar2;
  int iVar3;
  undefined8 uVar4;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  **(undefined1 **)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x24) = 0;
  uVar1 = FUN_1400b8b80(param_2);
  if (1 < uVar1) {
    if (*(undefined **)(param_1 + 0x18) != &DAT_140316459) {
      operator_delete(*(undefined **)(param_1 + 0x18));
    }
    *(undefined8 *)(param_1 + 0x18) = 0;
    *(undefined8 *)(param_1 + 0x24) = 0;
    *(undefined4 *)(param_1 + 0x20) = 0;
    uVar4 = FUN_1400b8b90(param_2);
    *(undefined8 *)(param_1 + 0x18) = uVar4;
    uVar2 = FUN_1400bbb10(param_2);
    *(undefined4 *)(param_1 + 0x20) = uVar2;
    iVar3 = FUN_1400b8b80(param_2);
    *(undefined4 *)(param_1 + 0x28) = 0x400;
    *(int *)(param_1 + 0x24) = iVar3 + -1;
    FUN_1400b8c00(param_2);
  }
  return;
}



ulonglong FUN_1400bdb00(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  byte bVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  undefined **local_40 [2];
  ushort local_30;
  undefined1 *local_28;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  
  uVar4 = 0xfffffffffffffffe;
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  FUN_1400d0eb0(local_40);
  local_40[0] = chilkat::StringBuffer::vftable;
  local_30 = 0xaa;
  local_1c = 0;
  local_18 = 0xca;
  local_28 = (undefined1 *)FUN_1400bbb40(local_40,0xca);
  if (local_28 == (undefined1 *)0x0) {
    local_28 = (undefined1 *)FUN_1400bbb40(local_40,4);
    if (local_28 == (undefined1 *)0x0) {
      local_28 = &DAT_140316459;
      local_20 = 1;
    }
    else {
      *local_28 = 0;
      local_20 = 4;
    }
  }
  else {
    *local_28 = 0;
    local_20 = local_18;
  }
  cVar1 = FUN_1400bc640(local_40,param_2);
  if (cVar1 == '\0') {
    local_40[0] = chilkat::StringBuffer::vftable;
    local_30 = local_30 & 0xff00;
    if (local_28 != &DAT_140316459) {
      operator_delete(local_28);
    }
    local_28 = (undefined1 *)0xdddddddd;
    local_1c = 0xdddddddd;
    local_20 = 0xdddddddd;
    local_18 = 0xdddddddd;
    uVar3 = FUN_1400d0ee0(local_40);
    uVar3 = uVar3 & 0xffffffffffffff00;
  }
  else {
    if (*(char *)(param_1 + 0x10) != -0x56) {
      DAT_00000000 = 0x78;
    }
    **(undefined1 **)(param_1 + 0x18) = 0;
    *(undefined4 *)(param_1 + 0x24) = 0;
    bVar2 = FUN_1400bc8a0(param_1,local_28,local_1c,param_4,uVar4);
    local_40[0] = chilkat::StringBuffer::vftable;
    local_30 = local_30 & 0xff00;
    if (local_28 != &DAT_140316459) {
      operator_delete(local_28);
    }
    local_28 = (undefined1 *)0xdddddddd;
    local_1c = 0xdddddddd;
    local_20 = 0xdddddddd;
    local_18 = 0xdddddddd;
    FUN_1400d0ee0(local_40);
    uVar3 = (ulonglong)bVar2;
  }
  return uVar3;
}



void FUN_1400bdc90(longlong param_1,longlong param_2)

{
  if ((*(char *)(param_1 + 0x10) != -0x56) &&
     (DAT_00000000 = 0x78, *(char *)(param_1 + 0x10) != -0x56)) {
    DAT_00000000 = 0x78;
  }
  **(undefined1 **)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x24) = 0;
  FUN_1400bc8a0(param_1,*(undefined8 *)(param_2 + 0x18),*(undefined4 *)(param_2 + 0x24));
  return;
}



ulonglong FUN_1400bdcd0(ulonglong param_1)

{
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (*(int *)(param_1 + 0x24) == 0) {
    return param_1 & 0xffffffffffffff00;
  }
  return (ulonglong)
         *(byte *)(*(longlong *)(param_1 + 0x18) + -1 + (longlong)*(int *)(param_1 + 0x24));
}



void FUN_1400bdd00(longlong param_1,char param_2)

{
  char cVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  int iVar5;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  iVar2 = 0;
  iVar5 = 0;
  lVar3 = 0;
  lVar4 = 0;
  if (0 < *(int *)(param_1 + 0x24)) {
    do {
      cVar1 = *(char *)(*(longlong *)(param_1 + 0x18) + lVar3);
      if (cVar1 != param_2) {
        if (lVar4 < lVar3) {
          *(char *)(*(longlong *)(param_1 + 0x18) + lVar4) = cVar1;
        }
        iVar2 = iVar2 + 1;
        lVar4 = lVar4 + 1;
      }
      iVar5 = iVar5 + 1;
      lVar3 = lVar3 + 1;
    } while (iVar5 < *(int *)(param_1 + 0x24));
  }
  *(int *)(param_1 + 0x24) = iVar2;
  *(undefined1 *)((longlong)iVar2 + *(longlong *)(param_1 + 0x18)) = 0;
  return;
}



void FUN_1400bdd70(longlong param_1)

{
  byte bVar1;
  ulonglong uVar2;
  uint uVar3;
  ulonglong uVar4;
  int iVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  uVar2 = 0;
  iVar5 = 0;
  uVar4 = uVar2;
  uVar6 = uVar2;
  uVar7 = uVar2;
  if (0 < *(int *)(param_1 + 0x24)) {
    do {
      bVar1 = *(byte *)(*(longlong *)(param_1 + 0x18) + uVar7);
      if ((((((0x7f < bVar1) || ((byte)(bVar1 + 0x9f) < 0x1a)) || ((byte)(bVar1 + 0xbf) < 0x1a)) ||
           (((byte)(bVar1 - 0x30) < 10 || (bVar1 == 0x2e)))) ||
          ((bVar1 == 0x2d || ((bVar1 == 0x5f || (bVar1 == 0x3a)))))) || (bVar1 == 0x21)) {
        if ((longlong)uVar2 < (longlong)uVar7) {
          *(byte *)(*(longlong *)(param_1 + 0x18) + uVar2) = bVar1;
        }
        uVar6 = (ulonglong)((int)uVar6 + 1);
        uVar2 = uVar2 + 1;
      }
      iVar5 = (int)uVar6;
      uVar3 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar3;
      uVar7 = uVar7 + 1;
    } while ((int)uVar3 < *(int *)(param_1 + 0x24));
  }
  *(int *)(param_1 + 0x24) = iVar5;
  *(undefined1 *)((longlong)iVar5 + *(longlong *)(param_1 + 0x18)) = 0;
  return;
}



bool FUN_1400bde10(longlong param_1,char *param_2)

{
  char *pcVar1;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (param_2 == (char *)0x0) {
    return false;
  }
  pcVar1 = strstr(*(char **)(param_1 + 0x18),param_2);
  return pcVar1 != (char *)0x0;
}



bool FUN_1400bde50(longlong param_1,longlong param_2)

{
  longlong lVar1;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (param_2 == 0) {
    return false;
  }
  lVar1 = FUN_1400d0f20(*(undefined8 *)(param_1 + 0x18));
  return lVar1 != 0;
}



void FUN_1400bde90(longlong param_1,int param_2,int param_3)

{
  char cVar1;
  char *pcVar2;
  char *pcVar3;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if ((param_2 < *(int *)(param_1 + 0x24)) && (param_3 + param_2 <= *(int *)(param_1 + 0x24))) {
    pcVar3 = (char *)((longlong)(param_3 + param_2) + *(longlong *)(param_1 + 0x18));
    pcVar2 = (char *)((longlong)param_2 + *(longlong *)(param_1 + 0x18));
    cVar1 = *pcVar3;
    while (cVar1 != '\0') {
      pcVar3 = pcVar3 + 1;
      *pcVar2 = cVar1;
      pcVar2 = pcVar2 + 1;
      cVar1 = *pcVar3;
    }
    *pcVar2 = '\0';
    *(int *)(param_1 + 0x24) = (int)pcVar2 - *(int *)(param_1 + 0x18);
  }
  return;
}



void FUN_1400bdef0(longlong param_1,undefined4 param_2)

{
  HLOCAL local_res8 [4];
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  local_res8[0] = (HLOCAL)0x0;
  FUN_1400ce960(0x1300,0,param_2,0x400,local_res8,0,0);
  if (local_res8[0] != (HLOCAL)0x0) {
    FUN_1400bc640(param_1);
    FUN_1400bbc30(param_1);
    LocalFree(local_res8[0]);
  }
  return;
}



bool FUN_1400bdf70(longlong param_1,char *param_2)

{
  char cVar1;
  char cVar2;
  char *pcVar3;
  longlong lVar4;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (param_2 == (char *)0x0) {
    return *(int *)(param_1 + 0x24) == 0;
  }
  pcVar3 = *(char **)(param_1 + 0x18);
  if (*param_2 != *pcVar3) {
    return false;
  }
  lVar4 = (longlong)param_2 - (longlong)pcVar3;
  do {
    cVar1 = *pcVar3;
    cVar2 = pcVar3[lVar4];
    if (cVar1 != cVar2) break;
    pcVar3 = pcVar3 + 1;
  } while (cVar2 != '\0');
  return cVar1 == cVar2;
}



uint FUN_1400bdfc0(longlong param_1,longlong param_2)

{
  char cVar1;
  char cVar2;
  uint uVar3;
  char *pcVar4;
  longlong lVar5;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  uVar3 = *(uint *)(param_1 + 0x24);
  if (*(uint *)(param_2 + 0x24) == uVar3) {
    pcVar4 = *(char **)(param_1 + 0x18);
    uVar3 = 0;
    if (**(char **)(param_2 + 0x18) == *pcVar4) {
      lVar5 = (longlong)*(char **)(param_2 + 0x18) - (longlong)pcVar4;
      do {
        cVar1 = *pcVar4;
        cVar2 = pcVar4[lVar5];
        if (cVar1 != cVar2) break;
        pcVar4 = pcVar4 + 1;
      } while (cVar2 != '\0');
      return (uint)(cVar1 == cVar2);
    }
  }
  return uVar3 & 0xffffff00;
}



bool FUN_1400be010(longlong param_1,char *param_2)

{
  int iVar1;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (param_2 == (char *)0x0) {
    return *(int *)(param_1 + 0x24) == 0;
  }
  iVar1 = _stricmp(*(char **)(param_1 + 0x18),param_2);
  return iVar1 == 0;
}



longlong FUN_1400be050(longlong param_1,longlong param_2)

{
  int iVar1;
  undefined4 extraout_var;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (*(int *)(param_2 + 0x24) != *(int *)(param_1 + 0x24)) {
    return (ulonglong)(uint3)((uint)*(int *)(param_1 + 0x24) >> 8) << 8;
  }
  iVar1 = _stricmp(*(char **)(param_1 + 0x18),*(char **)(param_2 + 0x18));
  return CONCAT71((int7)(CONCAT44(extraout_var,iVar1) >> 8),iVar1 == 0);
}



void FUN_1400be090(longlong param_1,char param_2,undefined1 param_3,undefined8 param_4)

{
  char *pcVar1;
  ulonglong uVar2;
  uint uVar3;
  uint uVar5;
  undefined8 uVar6;
  undefined1 local_a8 [160];
  ulonglong uVar4;
  
  uVar6 = 0xfffffffffffffffe;
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  uVar2 = 0;
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  pcVar1 = strchr(*(char **)(param_1 + 0x18),(int)param_2);
  if (pcVar1 != (char *)0x0) {
    if (*(char *)(param_1 + 0x10) != -0x56) {
      DAT_00000000 = 0x78;
    }
    uVar5 = *(uint *)(param_1 + 0x24);
    if (uVar5 != 0) {
      uVar4 = uVar2;
      do {
        if ((*(byte *)(uVar4 + *(longlong *)(param_1 + 0x18)) & 0x80) != 0) {
          FUN_1400b6fd0(local_a8);
          FUN_1400b8720(local_a8,*(undefined8 *)(param_1 + 0x18),*(undefined4 *)(param_1 + 0x24),
                        param_4,uVar6);
          FUN_1400b81c0(local_a8,param_2,param_3);
          uVar6 = FUN_1400b7ce0(local_a8);
          FUN_1400bdb00(param_1,uVar6);
          FUN_1400b7090(local_a8);
          return;
        }
        uVar3 = (int)uVar4 + 1;
        uVar4 = (ulonglong)uVar3;
      } while (uVar3 < uVar5);
    }
    uVar4 = uVar2;
    if (0 < (int)uVar5) {
      do {
        if (*(char *)(*(longlong *)(param_1 + 0x18) + uVar2) == param_2) {
          *(undefined1 *)(*(longlong *)(param_1 + 0x18) + uVar2) = param_3;
        }
        uVar5 = (int)uVar4 + 1;
        uVar4 = (ulonglong)uVar5;
        uVar2 = uVar2 + 1;
      } while ((int)uVar5 < *(int *)(param_1 + 0x24));
    }
  }
  return;
}



undefined1 FUN_1400be1c0(longlong param_1,byte param_2,int param_3,undefined8 param_4)

{
  undefined1 uVar1;
  void *_Dst;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (param_3 < 1) {
    uVar1 = 1;
  }
  else {
    _Dst = operator_new((longlong)(param_3 + 1));
    if (_Dst == (void *)0x0) {
      uVar1 = 0;
    }
    else {
      if (0 < param_3) {
        memset(_Dst,(uint)param_2,(longlong)param_3);
      }
      *(undefined1 *)((longlong)param_3 + (longlong)_Dst) = 0;
      uVar1 = FUN_1400bc8a0(param_1,_Dst,param_3,param_4,uVar2);
      operator_delete(_Dst);
    }
  }
  return uVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x0001400be339)

undefined8 FUN_1400be290(longlong param_1,byte *param_2,int param_3)

{
  longlong lVar1;
  undefined8 uVar2;
  char cVar3;
  byte bVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  undefined1 auStack_c8 [32];
  char local_a8 [128];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_c8;
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if ((param_2 == (byte *)0x0) || (iVar8 = 0, param_3 < 1)) {
    uVar2 = 1;
  }
  else {
    iVar6 = 0;
    iVar5 = 0;
    do {
      bVar4 = *param_2 >> 4;
      if (bVar4 < 10) {
        cVar3 = bVar4 + 0x30;
      }
      else {
        cVar3 = bVar4 + 0x37;
      }
      iVar7 = iVar8 + 1;
      local_a8[iVar8] = cVar3;
      if (iVar7 == 0x80) {
        cVar3 = FUN_1400bc8a0(param_1,local_a8);
        if (cVar3 == '\0') {
          return 0;
        }
        iVar7 = 0;
      }
      bVar4 = *param_2 & 0xf;
      if (bVar4 < 10) {
        cVar3 = bVar4 + 0x30;
      }
      else {
        cVar3 = bVar4 + 0x37;
      }
      iVar8 = iVar7 + 1;
      local_a8[iVar7] = cVar3;
      if (iVar8 == 0x80) {
        cVar3 = FUN_1400bc8a0(param_1,local_a8);
        if (cVar3 == '\0') {
          return 0;
        }
        iVar8 = 0;
      }
      iVar6 = iVar6 + 1;
      param_2 = param_2 + 1;
      if (iVar6 == 2) {
        iVar6 = 0;
        if (iVar5 < 0xf) {
          lVar1 = (longlong)iVar8;
          iVar8 = iVar8 + 1;
          local_a8[lVar1] = ' ';
          if (iVar8 == 0x80) {
            cVar3 = FUN_1400bc8a0(param_1,local_a8);
            if (cVar3 == '\0') {
              return 0;
            }
            iVar8 = 0;
            iVar6 = 0;
          }
        }
      }
      iVar5 = iVar5 + 1;
      param_3 = param_3 + -1;
      if (0xf < iVar5) {
        lVar1 = (longlong)iVar8;
        iVar8 = iVar8 + 1;
        iVar5 = 0;
        local_a8[lVar1] = '\n';
        if (iVar8 == 0x80) {
          cVar3 = FUN_1400bc8a0(param_1,local_a8);
          if (cVar3 == '\0') {
            return 0;
          }
          iVar8 = 0;
        }
      }
    } while (param_3 != 0);
    if (iVar8 == 0) {
      uVar2 = 1;
    }
    else {
      uVar2 = FUN_1400bc8a0(param_1,local_a8);
    }
  }
  return uVar2;
}



void FUN_1400be440(longlong param_1,undefined8 param_2)

{
  undefined8 uVar1;
  undefined4 uVar2;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  uVar2 = FUN_1400b8b80(param_2);
  uVar1 = FUN_1400b8b90(param_2);
  FUN_1400bc8a0(param_1,uVar1,uVar2);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400be4a0(longlong param_1,int param_2)

{
  char cVar1;
  int iVar2;
  longlong lVar3;
  uint uVar4;
  ulonglong uVar6;
  int iVar7;
  longlong lVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  undefined1 auStack_58 [32];
  char local_38 [40];
  ulonglong local_10;
  int iVar5;
  
  local_10 = DAT_1402f85a0 ^ (ulonglong)auStack_58;
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  uVar9 = 0;
  uVar6 = uVar9;
  uVar10 = uVar9;
  iVar7 = param_2;
  if (param_2 < 0) {
    iVar7 = -param_2;
  }
  do {
    iVar5 = (int)uVar6;
    uVar4 = iVar5 + 1;
    iVar2 = iVar7 / 10;
    local_38[uVar10] = "0123456789abcdefghijklmnopqrstuvwxyz"[iVar7 % 10];
    if (0x25 < (longlong)(uVar10 + 1)) break;
    uVar6 = (ulonglong)uVar4;
    uVar10 = uVar10 + 1;
    iVar7 = iVar2;
  } while (0 < iVar2);
  if (param_2 < 0) {
    lVar3 = (longlong)(int)uVar4;
    uVar4 = iVar5 + 2;
    local_38[lVar3] = '-';
  }
  local_38[(int)uVar4] = '\0';
  if ((uVar4 != 0) && (lVar3 = (longlong)(int)(uVar4 - 1), 0 < (int)(uVar4 - 1))) {
    do {
      cVar1 = local_38[uVar9];
      lVar8 = lVar3 + -1;
      local_38[uVar9] = local_38[lVar3];
      local_38[lVar3] = cVar1;
      uVar9 = uVar9 + 1;
      lVar3 = lVar8;
    } while ((longlong)uVar9 < lVar8);
  }
  FUN_1400bc640(param_1,local_38);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400be5a0(longlong param_1,uint param_2)

{
  char cVar1;
  int iVar2;
  uint uVar3;
  ulonglong uVar6;
  longlong lVar7;
  longlong lVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  undefined1 auStack_58 [32];
  char local_38 [40];
  ulonglong local_10;
  int iVar4;
  ulonglong uVar5;
  
  local_10 = DAT_1402f85a0 ^ (ulonglong)auStack_58;
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  uVar9 = 0;
  uVar5 = uVar9;
  uVar6 = (ulonglong)param_2;
  uVar10 = uVar9;
  do {
    iVar4 = (int)uVar5;
    uVar3 = iVar4 + 1;
    uVar5 = (ulonglong)uVar3;
    iVar2 = (int)(uVar6 / 10);
    local_38[uVar10] = "0123456789abcdefghijklmnopqrstuvwxyz"[(uint)((int)uVar6 + iVar2 * -10)];
    if (0x25 < (longlong)(uVar10 + 1)) break;
    uVar6 = uVar6 / 10;
    uVar10 = uVar10 + 1;
  } while (iVar2 != 0);
  local_38[(int)uVar3] = '\0';
  if ((uVar3 != 0) && (lVar7 = (longlong)iVar4, 0 < iVar4)) {
    do {
      cVar1 = local_38[uVar9];
      lVar8 = lVar7 + -1;
      local_38[uVar9] = local_38[lVar7];
      local_38[lVar7] = cVar1;
      uVar9 = uVar9 + 1;
      lVar7 = lVar8;
    } while ((longlong)uVar9 < lVar8);
  }
  FUN_1400bc640(param_1,local_38);
  return;
}



undefined8 * FUN_1400be680(undefined8 *param_1,uint param_2)

{
  *param_1 = chilkat::StringBuffer::vftable;
  *(undefined1 *)(param_1 + 2) = 0;
  if ((undefined *)param_1[3] != &DAT_140316459) {
    operator_delete((undefined *)param_1[3]);
  }
  param_1[3] = 0xdddddddd;
  *(undefined4 *)((longlong)param_1 + 0x24) = 0xdddddddd;
  *(undefined4 *)(param_1 + 4) = 0xdddddddd;
  *(undefined4 *)(param_1 + 5) = 0xdddddddd;
  FUN_1400d0ee0(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 *
FUN_1400be710(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  pvVar1 = operator_new(0x30);
  if (pvVar1 == (void *)0x0) {
    puVar2 = (undefined8 *)0x0;
  }
  else {
    puVar2 = (undefined8 *)FUN_1400bcc20(pvVar1);
  }
  if ((undefined *)puVar2[3] == &DAT_140316459) {
    (**(code **)*puVar2)(puVar2,1,param_3,param_4,uVar3);
    puVar2 = (undefined8 *)0x0;
  }
  return puVar2;
}



undefined8 *
FUN_1400be770(undefined4 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  pvVar1 = operator_new(0x30);
  if (pvVar1 == (void *)0x0) {
    puVar2 = (undefined8 *)0x0;
  }
  else {
    puVar2 = (undefined8 *)FUN_1400bce20(pvVar1,param_1,param_3,param_4,uVar3);
  }
  if ((undefined *)puVar2[3] == &DAT_140316459) {
    (**(code **)*puVar2)(puVar2,1);
    puVar2 = (undefined8 *)0x0;
  }
  return puVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400be7e0(longlong param_1,undefined8 param_2,char param_3,char param_4,char param_5)

{
  bool bVar1;
  bool bVar2;
  undefined8 uVar3;
  longlong lVar4;
  longlong lVar5;
  byte bVar6;
  int iVar7;
  byte *pbVar8;
  undefined1 auStack_168 [32];
  char local_148;
  byte local_138 [256];
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_168;
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  if (*(int *)(param_1 + 0x24) == 0) {
    uVar3 = 1;
  }
  else {
    local_148 = param_3;
    lVar4 = FUN_1400be710();
    uVar3 = 0;
    if (lVar4 != 0) {
      pbVar8 = *(byte **)(param_1 + 0x18);
      bVar6 = *pbVar8;
      bVar1 = false;
      bVar2 = false;
      iVar7 = 0;
      if (bVar6 != 0) {
        do {
          if (param_5 == '\0') {
LAB_1400be8e7:
            if (param_4 == '\0') {
LAB_1400be922:
              if ((uint)bVar6 == (int)local_148) {
                if (iVar7 != 0) {
                  FUN_1400bc8a0(lVar4,local_138,iVar7);
                  iVar7 = 0;
                }
                FUN_1400bc9f0(lVar4);
                FUN_1400d0c90(param_2,lVar4);
                lVar4 = FUN_1400be710();
                if (lVar4 == 0) {
                  return 0;
                }
              }
              else {
LAB_1400be966:
                lVar5 = (longlong)iVar7;
                iVar7 = iVar7 + 1;
                local_138[lVar5] = bVar6;
                if (iVar7 == 0xff) {
                  FUN_1400bc8a0(lVar4,local_138,0xff);
                  iVar7 = 0;
                }
              }
            }
            else {
              if (bVar6 != 0x22) {
                if (!bVar2) goto LAB_1400be922;
                goto LAB_1400be966;
              }
              lVar5 = (longlong)iVar7;
              iVar7 = iVar7 + 1;
              local_138[lVar5] = 0x22;
              if (iVar7 == 0xff) {
                FUN_1400bc8a0(lVar4,local_138,0xff);
                iVar7 = 0;
              }
              bVar2 = !bVar2;
            }
          }
          else if (bVar1) {
            lVar5 = (longlong)iVar7;
            iVar7 = iVar7 + 1;
            local_138[lVar5] = bVar6;
            if (iVar7 == 0xff) {
              FUN_1400bc8a0(lVar4,local_138,0xff);
              iVar7 = 0;
            }
            bVar1 = false;
          }
          else {
            if (bVar6 != 0x5c) goto LAB_1400be8e7;
            lVar5 = (longlong)iVar7;
            iVar7 = iVar7 + 1;
            local_138[lVar5] = 0x5c;
            if (iVar7 == 0xff) {
              FUN_1400bc8a0(lVar4,local_138,0xff);
              iVar7 = 0;
            }
            bVar1 = true;
          }
          bVar6 = pbVar8[1];
          pbVar8 = pbVar8 + 1;
        } while (bVar6 != 0);
        if (iVar7 != 0) {
          FUN_1400bc8a0(lVar4,local_138,iVar7);
        }
      }
      FUN_1400bc9f0(lVar4);
      FUN_1400d0c90(param_2,lVar4);
      uVar3 = 1;
    }
  }
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1400bea10(undefined8 param_1,longlong *param_2)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined8 *puVar6;
  char *pcVar7;
  undefined1 auStack_4f8 [32];
  char local_4d8 [8];
  void *local_4d0;
  undefined8 local_4c8;
  undefined1 local_4b8 [160];
  char local_418 [8];
  char local_410 [1000];
  ulonglong local_28;
  
  local_4c8 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_4f8;
  pcVar3 = (char *)FUN_1400b7ce0();
  strncpy(local_418,pcVar3,999);
  iVar2 = _strnicmp(local_418,"file:///",8);
  pcVar3 = local_410;
  if (iVar2 != 0) {
    pcVar3 = local_418;
  }
  if (*pcVar3 != '\0') {
    pcVar7 = pcVar3;
    do {
      cVar1 = *pcVar7;
      if (*pcVar7 == '|') {
        cVar1 = ':';
      }
      *pcVar7 = cVar1;
      pcVar7 = pcVar7 + 1;
    } while (*pcVar7 != '\0');
  }
  local_4d8[0] = '\0';
  uVar4 = FUN_1400b7ce0(param_1);
  lVar5 = FUN_1400c0040(uVar4,param_2,local_4d8);
  cVar1 = FUN_140105960(lVar5 + 200);
  if (cVar1 == '\0') {
    if (local_4d8[0] != '\0') {
      FUN_1400b6fd0(local_4b8);
      FUN_1400b7270(local_4b8,pcVar3);
      local_4d0 = operator_new(0x30);
      if (local_4d0 == (void *)0x0) {
        puVar6 = (undefined8 *)0x0;
      }
      else {
        puVar6 = (undefined8 *)FUN_1400bcc20(local_4d0);
      }
      if (puVar6 == (undefined8 *)0x0) {
        if (param_2 != (longlong *)0x0) {
          (**(code **)(*param_2 + 0x28))(param_2,"File too large to hold in memory.");
        }
        FUN_1400b7090(local_4b8);
        return (undefined8 *)0x0;
      }
      cVar1 = FUN_1400bd2a0(puVar6,param_1,param_2);
      if (cVar1 == '\0') {
        (**(code **)*puVar6)(puVar6,1);
        puVar6 = (undefined8 *)0x0;
      }
      FUN_1400b7090(local_4b8);
      return puVar6;
    }
  }
  else if (param_2 != (longlong *)0x0) {
    (**(code **)(*param_2 + 0x28))(param_2,"File too large to hold in memory");
  }
  return (undefined8 *)0x0;
}



void FUN_1400bebc0(longlong param_1)

{
  DWORD DVar1;
  
  if (*(char *)(param_1 + 0x10) != -0x56) {
    DAT_00000000 = 0x78;
  }
  DVar1 = GetLastError();
  FUN_1400bdef0(param_1,DVar1);
  return;
}



undefined8 * FUN_1400bebf0(undefined8 *param_1)

{
  FUN_1400cf320();
  *param_1 = LogNull::vftable;
  return param_1;
}



void FUN_1400bec20(undefined8 *param_1)

{
  *param_1 = LogNull::vftable;
  FUN_1400cf330();
  return;
}



undefined1 FUN_1400bec30(void)

{
  return 1;
}



undefined8 * FUN_1400bec40(undefined8 *param_1,uint param_2)

{
  *param_1 = LogNull::vftable;
  FUN_1400cf330();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400bec80(undefined8 param_1,undefined8 param_2)

{
  char cVar1;
  DWORD DVar2;
  LPCSTR lpFileName;
  undefined8 uVar3;
  LPCWSTR lpFileName_00;
  WCHAR *pWVar4;
  undefined1 auStack_10f8 [32];
  LPWSTR local_10d8;
  undefined8 local_10d0;
  undefined1 local_10c8 [160];
  WCHAR local_1028 [2056];
  ulonglong local_18;
  undefined8 uStack_10;
  
  uStack_10 = 0x1400bec8c;
  local_10d0 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_10f8;
  FUN_1400b7180(param_2);
  FUN_140106950(local_10c8);
  cVar1 = FUN_140106990(local_10c8);
  if (cVar1 == '\0') {
    lpFileName_00 = (LPCWSTR)thunk_FUN_1400b7580(param_1);
    DVar2 = GetFullPathNameW(lpFileName_00,0x800,local_1028,&local_10d8);
    if (DVar2 == 0) {
      pWVar4 = (WCHAR *)thunk_FUN_1400b7580(param_1);
    }
    else {
      pWVar4 = local_1028;
    }
    thunk_FUN_1400b7450(param_2,pWVar4);
  }
  else {
    lpFileName = (LPCSTR)FUN_1400b7950();
    DVar2 = GetFullPathNameA(lpFileName,0x800,(LPSTR)local_1028,(LPSTR *)&local_10d8);
    if (DVar2 == 0) {
      uVar3 = FUN_1400b7950(param_1);
      FUN_1400b7200(param_2,uVar3);
    }
    else {
      FUN_1400b7200(param_2,local_1028);
    }
  }
  FUN_140106980(local_10c8);
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400beda0(undefined8 param_1)

{
  char cVar1;
  DWORD DVar2;
  undefined1 auStack_1908 [32];
  undefined8 local_18e8;
  undefined1 local_18d8 [160];
  CHAR local_1838 [2064];
  WCHAR local_1028 [2056];
  ulonglong local_18;
  undefined8 uStack_10;
  
  uStack_10 = 0x1400bedac;
  local_18e8 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_1908;
  FUN_140106950(local_18d8);
  cVar1 = FUN_140106990(local_18d8);
  if ((cVar1 == '\0') && (DVar2 = GetCurrentDirectoryW(0x800,local_1028), DVar2 != 0)) {
    thunk_FUN_1400b7450(param_1,local_1028);
  }
  else {
    GetCurrentDirectoryA(0x800,local_1838);
    FUN_1400b7200(param_1,local_1838);
  }
  FUN_140106980(local_18d8);
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400bee60(undefined8 param_1)

{
  char cVar1;
  DWORD DVar2;
  undefined1 auStack_1908 [32];
  undefined8 local_18e8;
  undefined1 local_18d8 [160];
  CHAR local_1838 [2064];
  WCHAR local_1028 [2056];
  ulonglong local_18;
  undefined8 uStack_10;
  
  uStack_10 = 0x1400bee6c;
  local_18e8 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_1908;
  FUN_140106950(local_18d8);
  cVar1 = FUN_140106990(local_18d8);
  if (cVar1 == '\0') {
    DVar2 = GetTempPathW(0x800,local_1028);
    if (DVar2 == 0) {
      DVar2 = GetTempPathA(0x800,local_1838);
      if (DVar2 == 0) {
        local_1838[0] = '\0';
      }
      FUN_1400b7200(param_1,local_1838);
    }
    else {
      thunk_FUN_1400b7450(param_1,local_1028);
    }
  }
  else {
    GetTempPathA(0x800,local_1838);
    FUN_1400b7200(param_1,local_1838);
  }
  FUN_140106980(local_18d8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

bool FUN_1400bef50(undefined8 param_1,longlong *param_2)

{
  longlong lVar1;
  char cVar2;
  BOOL BVar3;
  int iVar4;
  DWORD DVar5;
  LPCSTR lpFileName;
  undefined8 uVar6;
  LPCWSTR pWVar7;
  bool bVar8;
  undefined1 auStack_2d8 [32];
  undefined8 local_2b8;
  undefined1 local_2a8 [160];
  undefined1 local_208 [160];
  undefined1 local_168 [160];
  undefined1 local_c8 [160];
  ulonglong local_28;
  
  local_2b8 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_2d8;
  FUN_1400b6fd0(local_2a8);
  FUN_1400b8850(local_2a8,param_1);
  FUN_1400b81c0(local_2a8,0x2f,0x5c);
  FUN_140106950(local_c8);
  cVar2 = FUN_140106990(local_c8);
  if (cVar2 == '\0') {
    iVar4 = FUN_1400b8350(local_2a8);
    if (iVar4 < 0x105) {
      pWVar7 = (LPCWSTR)thunk_FUN_1400b7580(local_2a8);
      BVar3 = DeleteFileW(pWVar7);
      if (BVar3 == 0) {
        DVar5 = GetLastError();
        if (param_2 != (longlong *)0x0) {
          FUN_1400cf710(param_2,DVar5);
          lVar1 = *param_2;
          uVar6 = FUN_1400b7ce0(local_2a8);
          (**(code **)(lVar1 + 0x58))(param_2,"failedToDeleteFilepath",uVar6);
        }
        if (DVar5 == 2) {
          BVar3 = 1;
        }
      }
      bVar8 = BVar3 != 0;
      FUN_140106980(local_c8);
    }
    else {
      FUN_1400b6fd0(local_168);
      FUN_1400bec80(local_2a8,local_168);
      FUN_1400b6fd0(local_208);
      FUN_1400b86c0(local_208,&DAT_140208fcc);
      uVar6 = FUN_1400b7ce0(local_168);
      FUN_1400b86c0(local_208,uVar6);
      pWVar7 = (LPCWSTR)thunk_FUN_1400b7580(local_208);
      BVar3 = DeleteFileW(pWVar7);
      if (BVar3 == 0) {
        DVar5 = GetLastError();
        if (DVar5 == 2) {
          BVar3 = 1;
        }
      }
      bVar8 = BVar3 != 0;
      FUN_1400b7090(local_208);
      FUN_1400b7090(local_168);
      FUN_140106980(local_c8);
    }
  }
  else {
    lpFileName = (LPCSTR)FUN_1400b7950();
    BVar3 = DeleteFileA(lpFileName);
    bVar8 = BVar3 != 0;
    FUN_140106980(local_c8);
  }
  FUN_1400b7090(local_2a8);
  return bVar8;
}



void FUN_1400bf150(LPCSTR param_1,DWORD param_2,DWORD param_3,LPSECURITY_ATTRIBUTES param_4,
                  DWORD param_5,DWORD param_6,HANDLE param_7)

{
  CreateFileA(param_1,param_2,param_3,param_4,param_5,param_6,param_7);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1400bf180(undefined8 param_1,DWORD *param_2,DWORD *param_3,longlong *param_4)

{
  char cVar1;
  int iVar2;
  DWORD DVar3;
  ulonglong uVar4;
  LPCSTR lpFileName;
  longlong lVar5;
  LPCWSTR pWVar6;
  undefined1 auStack_2e8 [32];
  undefined8 local_2c8;
  undefined1 local_2b8 [160];
  undefined1 local_218 [160];
  undefined1 local_178 [160];
  undefined1 local_d8 [160];
  ulonglong local_38;
  
  local_2c8 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_2e8;
  *param_3 = 0;
  *param_2 = 0xffffffff;
  uVar4 = FUN_1400b8350();
  if ((int)uVar4 == 0) {
    if (param_4 != (longlong *)0x0) {
      uVar4 = (**(code **)(*param_4 + 0x28))(param_4,"GetAttributes: filename is empty");
    }
    return uVar4 & 0xffffffffffffff00;
  }
  FUN_1400b6fd0(local_2b8);
  FUN_1400b8850(local_2b8,param_1);
  FUN_1400b81c0(local_2b8,0x2f,0x5c);
  iVar2 = FUN_1400b8350(local_2b8);
  FUN_140106950(local_d8);
  if ((iVar2 < 0x104) &&
     ((cVar1 = FUN_1400b7720(local_2b8), cVar1 != '\0' ||
      (cVar1 = FUN_140106990(local_d8), cVar1 != '\0')))) {
    lpFileName = (LPCSTR)FUN_1400b7950(local_2b8);
    DVar3 = GetFileAttributesA(lpFileName);
    *param_2 = DVar3;
    goto LAB_1400bf34f;
  }
  if (iVar2 < 1) {
    pWVar6 = (LPCWSTR)FUN_1400b7580(local_2b8);
    DVar3 = GetFileAttributesW(pWVar6);
    *param_2 = DVar3;
  }
  else {
    FUN_1400b6fd0(local_218);
    FUN_1400b6fd0(local_178);
    FUN_1400bec80(local_2b8,local_178);
    cVar1 = FUN_1400b8660(local_178,&DAT_140208fcc);
    if (cVar1 == '\0') {
      cVar1 = FUN_1400b8660(local_178,&DAT_140208fc8);
      if (cVar1 == '\0') {
        FUN_1400b7270(local_218,&DAT_140208fcc);
        goto LAB_1400bf2f9;
      }
      FUN_1400b7270(local_218,"\\\\?\\UNC");
      lVar5 = FUN_1400b7ce0(local_178);
      lVar5 = lVar5 + 1;
    }
    else {
      FUN_1400b7180(local_218);
LAB_1400bf2f9:
      lVar5 = FUN_1400b7ce0(local_178);
    }
    FUN_1400b86c0(local_218,lVar5);
    FUN_1400b7090(local_178);
    pWVar6 = (LPCWSTR)FUN_1400b7580(local_218);
    DVar3 = GetFileAttributesW(pWVar6);
    *param_2 = DVar3;
    FUN_1400b7090(local_218);
  }
  DVar3 = *param_2;
LAB_1400bf34f:
  if (DVar3 == 0xffffffff) {
    DVar3 = GetLastError();
    *param_3 = DVar3;
  }
  DVar3 = *param_2;
  FUN_140106980(local_d8);
  FUN_1400b7090(local_2b8);
  return (ulonglong)(DVar3 != 0xffffffff);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

bool FUN_1400bf3a0(undefined8 param_1,DWORD param_2)

{
  char cVar1;
  int iVar2;
  BOOL BVar3;
  uint uVar4;
  undefined8 uVar5;
  LPCSTR lpFileName;
  longlong lVar6;
  LPCWSTR pWVar7;
  undefined1 auStack_2f8 [32];
  undefined1 local_2d8 [48];
  undefined1 local_2a8 [160];
  undefined8 local_208;
  undefined1 local_1f8 [160];
  undefined1 local_158 [160];
  undefined1 local_b8 [160];
  ulonglong local_18;
  
  local_208 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_2f8;
  FUN_1400b6fd0(local_2a8);
  FUN_1400b8850(local_2a8,param_1);
  FUN_1400b81c0(local_2a8,0x2f,0x5c);
  cVar1 = FUN_1400b8160(local_2a8,&DAT_1402749ec);
  if (cVar1 != '\0') {
    iVar2 = FUN_1400b89d0(local_2a8,&DAT_1402749ec);
    if (iVar2 < 8) {
      if (0 < iVar2) {
        FUN_1400bcc20(local_2d8);
        uVar5 = FUN_1400b7ce0(local_2a8);
        FUN_1400bc640(local_2d8,uVar5);
        FUN_1400bcfa0(local_2d8,&DAT_1402749ec,"_COLON_");
        cVar1 = FUN_1400bc610(local_2d8,0x3a);
        if (cVar1 != '\0') {
          FUN_1400be090(local_2d8,0x3a,0x5f);
          FUN_1400bcfa0(local_2d8,"_COLON_",&DAT_1402749ec);
          FUN_1400b7180(local_2a8);
          uVar5 = FUN_1400b8b90(local_2d8);
          FUN_1400b86c0(local_2a8,uVar5);
        }
        FUN_1400bceb0(local_2d8);
      }
    }
    else {
      FUN_1400b81c0(local_2a8,0x3a,0x5f);
    }
  }
  cVar1 = FUN_1400b8160(local_2a8,&DAT_14020901c);
  if (cVar1 != '\0') {
    FUN_1400b81c0(local_2a8,0x7c,0x5f);
  }
  cVar1 = FUN_1400b8160(local_2a8,&DAT_140209018);
  if (cVar1 != '\0') {
    FUN_1400b81c0(local_2a8,0x2a,0x5f);
  }
  cVar1 = FUN_1400b8160(local_2a8,&DAT_14027b674);
  if (cVar1 != '\0') {
    FUN_1400b81c0(local_2a8,0x3c,0x5f);
  }
  cVar1 = FUN_1400b8160(local_2a8,&DAT_14027b5a4);
  if (cVar1 != '\0') {
    FUN_1400b81c0(local_2a8,0x3e,0x5f);
  }
  cVar1 = FUN_1400b8160(local_2a8,&DAT_14027b5c4);
  if (cVar1 != '\0') {
    FUN_1400b81c0(local_2a8,0x22,0x5f);
  }
  FUN_140106950(local_b8);
  cVar1 = FUN_140106990(local_b8);
  if (cVar1 != '\0') {
    lpFileName = (LPCSTR)FUN_1400b7950();
    BVar3 = SetFileAttributesA(lpFileName,param_2);
    uVar4 = (uint)(BVar3 != 0);
    goto LAB_1400bf6d2;
  }
  iVar2 = FUN_1400b8350(local_2a8);
  if (iVar2 < 1) {
    pWVar7 = (LPCWSTR)thunk_FUN_1400b7580(local_2a8);
    uVar4 = SetFileAttributesW(pWVar7,param_2);
    goto LAB_1400bf6d2;
  }
  FUN_1400b6fd0(local_1f8);
  FUN_1400b6fd0(local_158);
  FUN_1400bec80(local_2a8,local_158);
  cVar1 = FUN_1400b8660(local_158,&DAT_140208fcc);
  if (cVar1 == '\0') {
    cVar1 = FUN_1400b8660(local_158,&DAT_140208fc8);
    if (cVar1 == '\0') {
      FUN_1400b7270(local_1f8,&DAT_140208fcc);
      goto LAB_1400bf675;
    }
    FUN_1400b7270(local_1f8,"\\\\?\\UNC");
    lVar6 = FUN_1400b7ce0(local_158);
    lVar6 = lVar6 + 1;
  }
  else {
    FUN_1400b7180(local_1f8);
LAB_1400bf675:
    lVar6 = FUN_1400b7ce0(local_158);
  }
  FUN_1400b86c0(local_1f8,lVar6);
  FUN_1400b7090(local_158);
  pWVar7 = (LPCWSTR)thunk_FUN_1400b7580(local_1f8);
  uVar4 = SetFileAttributesW(pWVar7,param_2);
  FUN_1400b7090(local_1f8);
LAB_1400bf6d2:
  FUN_140106980(local_b8);
  FUN_1400b7090(local_2a8);
  return uVar4 != 0;
}



undefined8 FUN_1400bf720(undefined8 param_1,longlong param_2)

{
  char cVar1;
  int iVar2;
  int local_res18 [2];
  undefined1 local_res20 [8];
  undefined8 uVar3;
  undefined1 local_a8 [160];
  
  uVar3 = 0xfffffffffffffffe;
  FUN_1400b6fd0(local_a8);
  FUN_1400b7200(local_a8,param_1);
  iVar2 = FUN_1400b8350(local_a8);
  if (iVar2 == 0) {
LAB_1400bf7aa:
    uVar3 = 0;
  }
  else {
    cVar1 = FUN_1400bf180(local_a8,local_res20,local_res18,0,uVar3);
    if (cVar1 == '\0') {
      if (((local_res18[0] == 2) || (local_res18[0] == 3)) || (local_res18[0] == 0x15)) {
        if (param_2 != 0) {
          FUN_1400cf710(param_2);
        }
        goto LAB_1400bf7aa;
      }
    }
    uVar3 = 1;
  }
  FUN_1400b7090(local_a8);
  return uVar3;
}



undefined1
FUN_1400bf7d0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined8 uVar2;
  undefined1 local_a8 [160];
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1400b6fd0(local_a8);
  FUN_1400b7270(local_a8,param_1,param_3,param_4,uVar2);
  uVar1 = FUN_1400bef50(local_a8,param_2);
  FUN_1400b7090(local_a8);
  return uVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

longlong FUN_1400bf840(undefined8 param_1,char param_2,char param_3,char param_4,char param_5,
                      char param_6,int *param_7,longlong *param_8)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined8 uVar4;
  longlong lVar5;
  int iVar6;
  uint uVar7;
  uint uVar8;
  undefined4 uVar9;
  undefined1 *puVar10;
  undefined1 auStack_368 [32];
  undefined8 local_348;
  int local_340;
  undefined4 local_338;
  undefined8 local_330;
  int *local_328;
  longlong *local_320;
  char local_318;
  char local_317;
  char local_316;
  uint local_314;
  int local_310;
  undefined4 local_30c;
  LONG local_308 [2];
  int *local_300;
  undefined1 local_2f8 [160];
  undefined1 local_258 [48];
  undefined8 local_228;
  undefined1 local_218 [160];
  undefined1 local_178 [160];
  undefined1 local_d8 [160];
  ulonglong local_38;
  
  local_228 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_368;
  local_300 = param_7;
  uVar7 = 0;
  iVar6 = 0;
  *param_7 = 0;
  local_318 = param_3;
  local_317 = param_4;
  local_316 = param_2;
  FUN_1400b6fd0(local_2f8);
  FUN_1400b8850(local_2f8,param_1);
  FUN_1400b81c0(local_2f8,0x2f,0x5c);
  cVar2 = FUN_1400b8160(local_2f8,&DAT_1402749ec);
  if (cVar2 != '\0') {
    iVar3 = FUN_1400b89d0(local_2f8,&DAT_1402749ec);
    if (iVar3 < 8) {
      if (0 < iVar3) {
        FUN_1400bcc20(local_258);
        uVar4 = FUN_1400b7ce0(local_2f8);
        FUN_1400bc640(local_258,uVar4);
        FUN_1400bcfa0(local_258,&DAT_1402749ec,"_COLON_");
        cVar2 = FUN_1400bc610(local_258,0x3a);
        if (cVar2 != '\0') {
          FUN_1400be090(local_258,0x3a,0x5f);
          FUN_1400bcfa0(local_258,"_COLON_",&DAT_1402749ec);
          FUN_1400b7180(local_2f8);
          uVar4 = FUN_1400b8b90(local_258);
          FUN_1400b86c0(local_2f8,uVar4);
        }
        FUN_1400bceb0(local_258);
      }
    }
    else {
      FUN_1400b81c0(local_2f8,0x3a,0x5f);
    }
  }
  cVar2 = FUN_1400b8160(local_2f8,&DAT_14020901c);
  if (cVar2 != '\0') {
    FUN_1400b81c0(local_2f8,0x7c,0x5f);
  }
  cVar2 = FUN_1400b8160(local_2f8,&DAT_140209018);
  if (cVar2 != '\0') {
    FUN_1400b81c0(local_2f8,0x2a,0x5f);
  }
  cVar2 = FUN_1400b8160(local_2f8,&DAT_14027b674);
  if (cVar2 != '\0') {
    FUN_1400b81c0(local_2f8,0x3c,0x5f);
  }
  cVar2 = FUN_1400b8160(local_2f8,&DAT_14027b5a4);
  if (cVar2 != '\0') {
    FUN_1400b81c0(local_2f8,0x3e,0x5f);
  }
  cVar2 = FUN_1400b8160(local_2f8,&DAT_14027b5c4);
  if (cVar2 != '\0') {
    FUN_1400b81c0(local_2f8,0x22,0x5f);
  }
  iVar3 = FUN_1400b8350(local_2f8);
  if (iVar3 == 0) {
    FUN_1400b7090(local_2f8);
    return 0;
  }
  uVar9 = 0x80;
  if (param_5 != '\0') {
    uVar9 = 2;
  }
  if (local_316 == '\0') {
    uVar8 = uVar7;
    if (local_318 != '\0') {
      iVar6 = 2;
      goto LAB_1400bfaca;
    }
  }
  else {
    iVar6 = (local_318 != '\0') + 3;
    uVar8 = 0x80000000;
LAB_1400bfaca:
    if (local_318 != '\0') {
      uVar8 = uVar8 | 0x40000000;
    }
  }
  if ((local_317 == '\0') && (uVar7 = 0, local_316 != '\0')) {
    uVar7 = 3;
  }
  local_30c = uVar9;
  FUN_140106950(local_d8);
  local_340 = iVar6;
  if ((iVar3 < 0x104) &&
     ((cVar2 = FUN_1400b7720(local_2f8), cVar2 != '\0' ||
      (cVar2 = FUN_140106990(local_d8), cVar2 != '\0')))) {
    uVar4 = FUN_1400b7950(local_2f8);
    local_320 = param_8;
    local_328 = &local_310;
    local_330 = 0;
    local_348 = 0;
    local_338 = uVar9;
    lVar5 = FUN_1401069d0(2000,uVar4,uVar8,uVar7);
    if (lVar5 == 0) {
      local_314 = 0;
      local_30c = 0;
      cVar2 = FUN_1400bf180(local_2f8,&local_314,&local_30c,param_8);
      if (((cVar2 != '\0') && ((local_314 & 1) != 0)) &&
         (cVar2 = FUN_1400bf3a0(local_2f8,local_314 & 0xfffffffe), cVar2 != '\0')) {
        uVar4 = FUN_1400b7950(local_2f8);
        local_320 = param_8;
        local_328 = &local_310;
        local_330 = 0;
        local_348 = 0;
        local_340 = iVar6;
        local_338 = uVar9;
        lVar5 = FUN_1401069d0(0x83f,uVar4,uVar8,uVar7);
      }
    }
  }
  else {
    puVar10 = local_2f8;
    FUN_1400b6fd0(local_218);
    if (-1 < iVar3) {
      FUN_1400b6fd0(local_178);
      FUN_1400bec80(local_2f8,local_178);
      cVar2 = FUN_1400b8660(local_178,&DAT_140208fcc);
      if (cVar2 == '\0') {
        cVar2 = FUN_1400b8660(local_178,&DAT_140208fc8);
        if (cVar2 == '\0') {
          FUN_1400b7270(local_218,&DAT_140208fcc);
          goto LAB_1400bfc97;
        }
        FUN_1400b7270(local_218,"\\\\?\\UNC");
        lVar5 = FUN_1400b7ce0(local_178);
        lVar5 = lVar5 + 1;
      }
      else {
        FUN_1400b7180(local_218);
LAB_1400bfc97:
        lVar5 = FUN_1400b7ce0(local_178);
      }
      FUN_1400b86c0(local_218,lVar5);
      FUN_1400b7090(local_178);
      puVar10 = local_218;
    }
    uVar4 = FUN_1400b7580(puVar10);
    local_320 = param_8;
    local_328 = &local_310;
    local_330 = 0;
    local_338 = local_30c;
    local_348 = 0;
    lVar5 = FUN_140106c30(0x7d1,uVar4,uVar8,uVar7);
    if (lVar5 == 0) {
      local_314 = 0;
      local_308[0] = 0;
      cVar2 = FUN_1400bf180(local_2f8,&local_314,local_308,param_8);
      if (((cVar2 != '\0') && ((local_314 & 1) != 0)) &&
         (cVar2 = FUN_1400bf3a0(local_2f8,local_314 & 0xfffffffe), cVar2 != '\0')) {
        uVar4 = FUN_1400b7580(puVar10);
        local_320 = param_8;
        local_328 = &local_310;
        local_330 = 0;
        local_338 = local_30c;
        local_348 = 0;
        local_340 = iVar6;
        lVar5 = FUN_140106c30(0x7d1,uVar4,uVar8,uVar7);
      }
    }
    FUN_1400b7090(local_218);
  }
  if (param_8 == (longlong *)0x0) {
    if (lVar5 == 0) goto LAB_1400bfe0f;
  }
  else if (lVar5 == 0) {
    if (local_310 == 5) {
      *local_300 = 1;
    }
    else {
      *local_300 = (local_310 != 3) + 2;
    }
    lVar1 = *param_8;
    uVar4 = FUN_1400b7ce0(local_2f8);
    (**(code **)(lVar1 + 0x58))(param_8,"localWindowsFilePath",uVar4);
    goto LAB_1400bfe0f;
  }
  if (param_6 != '\0') {
    local_308[0] = 0;
    SetFilePointer(*(HANDLE *)(lVar5 + 8),0,local_308,2);
  }
LAB_1400bfe0f:
  FUN_140106980(local_d8);
  FUN_1400b7090(local_2f8);
  return lVar5;
}



undefined8 FUN_1400bfe60(undefined8 param_1,undefined8 param_2,longlong *param_3)

{
  undefined8 uVar1;
  
  if (param_3 != (longlong *)0x0) {
    (**(code **)(*param_3 + 0x48))(param_3,"openForReadWin32",1);
  }
  uVar1 = FUN_1400bf840(param_1,1,0,0,0,0,param_2,param_3);
  if (param_3 != (longlong *)0x0) {
    (**(code **)(*param_3 + 0x50))(param_3);
  }
  return uVar1;
}



undefined8 FUN_1400bfee0(undefined8 param_1,undefined1 param_2,undefined8 param_3,longlong *param_4)

{
  undefined8 uVar1;
  
  if (param_4 != (longlong *)0x0) {
    (**(code **)(*param_4 + 0x48))(param_4,"openForReadWriteWin32",1);
  }
  uVar1 = FUN_1400bf840(param_1,1,1,param_2,0,0,param_3,param_4);
  if (param_4 != (longlong *)0x0) {
    (**(code **)(*param_4 + 0x50))(param_4);
  }
  return uVar1;
}



longlong FUN_1400bff70(undefined8 param_1,longlong *param_2,undefined1 *param_3)

{
  undefined8 *puVar1;
  longlong lVar2;
  undefined1 local_res10 [8];
  
  *param_3 = 0;
  if (param_2 != (longlong *)0x0) {
    (**(code **)(*param_2 + 0x48))(param_2,"openForReadWin32",1);
  }
  puVar1 = (undefined8 *)FUN_1400bf840(param_1,1,0,0,0,0,local_res10,param_2);
  if (param_2 != (longlong *)0x0) {
    (**(code **)(*param_2 + 0x50))(param_2);
  }
  if (puVar1 == (undefined8 *)0x0) {
    return 0;
  }
  lVar2 = FUN_140104e00(puVar1,param_2);
  (**(code **)*puVar1)(puVar1,1);
  if (lVar2 < 0) {
    return 0;
  }
  *param_3 = 1;
  return lVar2;
}



undefined8
FUN_1400c0040(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined1 local_a8 [160];
  
  uVar1 = 0xfffffffffffffffe;
  FUN_1400b6fd0(local_a8);
  FUN_1400b7270(local_a8,param_1);
  uVar1 = FUN_1400bff70(local_a8,param_2,param_3,param_4,uVar1);
  FUN_1400b7090(local_a8);
  return uVar1;
}



undefined8
FUN_1400c00c0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  
  puVar1 = (undefined8 *)FUN_1400bfe60(param_2,param_3,param_4);
  if (puVar1 == (undefined8 *)0x0) {
    return 0;
  }
  FUN_140104f30(param_1,puVar1);
  (**(code **)*puVar1)(puVar1,1);
  return 1;
}



undefined8
FUN_1400c0120(undefined8 param_1,undefined8 param_2,undefined1 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined8 *puVar1;
  
  puVar1 = (undefined8 *)FUN_1400bfee0(param_2,param_3,param_4,param_5);
  if (puVar1 == (undefined8 *)0x0) {
    return 0;
  }
  FUN_140104f30(param_1,puVar1);
  (**(code **)*puVar1)(puVar1,1);
  return 1;
}



undefined8 FUN_1400c0190(undefined8 param_1,longlong param_2,int param_3,longlong *param_4)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined8 *puVar4;
  undefined8 uVar5;
  ulonglong in_stack_ffffffffffffffa8;
  undefined1 local_38 [8];
  undefined8 local_30;
  undefined1 local_28 [32];
  
  local_30 = 0xfffffffffffffffe;
  iVar3 = FUN_1400b8350();
  if (iVar3 != 0) {
    FUN_140104980(local_28);
    if (param_4 != (longlong *)0x0) {
      (**(code **)(*param_4 + 0x48))(param_4,"openForWriteWin32",1);
    }
    puVar4 = (undefined8 *)
             FUN_1400bf840(param_1,0,1,1,in_stack_ffffffffffffffa8 & 0xffffffffffffff00,0,local_38,
                           param_4);
    if (param_4 != (longlong *)0x0) {
      (**(code **)(*param_4 + 0x50))(param_4);
    }
    if (puVar4 == (undefined8 *)0x0) {
      if (param_4 != (longlong *)0x0) {
        lVar1 = *param_4;
        uVar5 = FUN_1400b7ce0(param_1);
        (**(code **)(lVar1 + 0x58))(param_4,"filename",uVar5);
        (**(code **)(*param_4 + 0x28))(param_4,"Failed to write complete file (7)");
      }
    }
    else {
      FUN_140104f30(local_28,puVar4);
      (**(code **)*puVar4)(puVar4,1);
      if (((param_2 == 0) || (param_3 == 0)) ||
         (cVar2 = FUN_140104bd0(local_28,param_2,param_3,local_38,param_4), cVar2 != '\0')) {
        FUN_1401049e0(local_28);
        return 1;
      }
      if (param_4 != (longlong *)0x0) {
        lVar1 = *param_4;
        uVar5 = FUN_1400b7ce0(param_1);
        (**(code **)(lVar1 + 0x58))(param_4,"filename",uVar5);
        (**(code **)(*param_4 + 0x28))(param_4,"Failed to write complete file (1)");
      }
    }
    FUN_1401049e0(local_28);
  }
  return 0;
}



undefined1
FUN_1400c0310(undefined8 param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined8 uVar2;
  undefined1 local_a8 [160];
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1400b6fd0(local_a8);
  FUN_1400b7270(local_a8,param_1);
  uVar1 = FUN_1400c0190(local_a8,param_2,param_3,param_4,uVar2);
  FUN_1400b7090(local_a8);
  return uVar1;
}



undefined1
FUN_1400c0390(undefined8 param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined8 uVar2;
  undefined1 local_a8 [160];
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1400b6fd0(local_a8);
  FUN_1400b7200(local_a8,param_1);
  uVar1 = FUN_1400c0190(local_a8,param_2,param_3,param_4,uVar2);
  FUN_1400b7090(local_a8);
  return uVar1;
}



void FUN_1400c0410(void)

{
  char cVar1;
  DWORD DVar2;
  DWORD DVar3;
  uint uVar4;
  int iVar5;
  uint uVar6;
  uint uVar7;
  uint *puVar8;
  uint *puVar9;
  
  DAT_140316460 = 0;
  DAT_1402f8e40 = 0x67;
  cVar1 = FUN_140106e90(1000,&DAT_140316470);
  if (cVar1 == '\0') {
    DVar2 = GetTickCount();
    DVar3 = GetCurrentThreadId();
    srand(DVar2 ^ DVar3);
    puVar8 = &DAT_140316854;
    do {
      uVar4 = rand();
      iVar5 = rand();
      uVar6 = rand();
      puVar9 = puVar8 + -1;
      *puVar8 = uVar6 & 3 | (iVar5 << 0xf | uVar4) << 2;
      puVar8 = puVar9;
    } while (0x14031646f < (longlong)puVar9);
  }
  uVar6 = 0x80000000;
  puVar8 = &DAT_14031647c;
  uVar4 = 0xffffffff;
  do {
    uVar7 = uVar4 & *puVar8 | uVar6;
    uVar6 = uVar6 >> 1;
    *puVar8 = uVar7;
    puVar8 = puVar8 + 7;
    uVar4 = uVar4 >> 1;
  } while (uVar6 != 0);
  return;
}



uint FUN_1400c04f0(void)

{
  uint uVar1;
  uint uVar2;
  longlong lVar3;
  longlong lVar4;
  
  if (DAT_140316465 == '\0') {
    FUN_1400c0580();
    if (DAT_140316858 != 0) {
      FUN_1400d1280();
      lVar3 = DAT_140316858;
      lVar4 = (longlong)(int)DAT_140316460;
      uVar1 = *(uint *)(&DAT_140316470 + (longlong)(int)DAT_1402f8e40 * 4);
      uVar2 = *(uint *)(&DAT_140316470 + lVar4 * 4);
      DAT_140316460 = (uint)(byte)(&DAT_1402f8e50)[lVar4];
      DAT_1402f8e40 = (uint)(byte)(&DAT_1402f8e50)[(int)DAT_1402f8e40];
      *(uint *)(&DAT_140316470 + lVar4 * 4) = uVar1 ^ uVar2;
      FUN_1400d1290(lVar3);
      return uVar1 ^ uVar2;
    }
  }
  return 0;
}



void FUN_1400c0580(void)

{
  uint _Seed;
  void *pvVar1;
  undefined8 uVar2;
  
  if ((DAT_140316465 == '\0') && (DAT_140316464 == '\0')) {
    DAT_140316464 = '\x01';
    pvVar1 = operator_new(0x30);
    uVar2 = 0;
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400d1210(pvVar1);
    }
    DAT_140316858 = uVar2;
    FUN_1400d1280(uVar2);
    FUN_1400c0410();
    _Seed = FUN_1400c04f0();
    srand(_Seed);
    FUN_1400d1290(DAT_140316858);
  }
  return;
}



void FUN_1400c0600(int param_1,undefined8 param_2)

{
  uint *puVar1;
  int iVar2;
  uint uVar3;
  longlong lVar4;
  ulonglong uVar5;
  
  if (((DAT_140316465 == '\0') && (FUN_1400c0580(), DAT_140316858 != 0)) && (param_1 != 0)) {
    iVar2 = FUN_1400b8b80(param_2);
    FUN_1400ba520(param_2,param_1 + iVar2);
    iVar2 = 0;
    FUN_1400d1280(DAT_140316858);
    if (0 < param_1) {
      uVar3 = (param_1 - 1U >> 2) + 1;
      uVar5 = (ulonglong)uVar3;
      iVar2 = uVar3 * 4;
      do {
        lVar4 = (longlong)(int)DAT_1402f8e40;
        puVar1 = (uint *)(&DAT_140316470 + (longlong)(int)DAT_140316460 * 4);
        DAT_140316460 = (uint)(byte)(&DAT_1402f8e50)[(int)DAT_140316460];
        DAT_1402f8e40 = (uint)(byte)(&DAT_1402f8e50)[lVar4];
        *puVar1 = *puVar1 ^ *(uint *)(&DAT_140316470 + lVar4 * 4);
        FUN_1400b97e0(param_2,puVar1,4);
        uVar5 = uVar5 - 1;
      } while (uVar5 != 0);
    }
    FUN_1400d1290(DAT_140316858);
    if (param_1 < iVar2) {
      FUN_1400b8be0(param_2,iVar2 - param_1);
    }
  }
  return;
}



void FUN_1400c0720(int param_1,undefined8 param_2)

{
  longlong lVar1;
  uint *puVar2;
  int iVar3;
  DWORD _Seed;
  longlong lVar4;
  int iVar5;
  
  if ((((DAT_140316465 == '\0') && (FUN_1400c0580(), DAT_140316858 != 0)) && (param_1 != 0)) &&
     (-1 < param_1)) {
    iVar3 = FUN_1400b8b80(param_2);
    FUN_1400ba520(param_2,param_1 + iVar3);
    iVar3 = 0;
    FUN_1400d1280(DAT_140316858);
    iVar5 = 0;
    if (0 < param_1) {
      do {
        lVar4 = (longlong)(int)DAT_1402f8e40;
        lVar1 = (longlong)(int)DAT_140316460 * 4;
        puVar2 = (uint *)(&DAT_140316470 + lVar1);
        DAT_140316460 = (uint)(byte)(&DAT_1402f8e50)[(int)DAT_140316460];
        DAT_1402f8e40 = (uint)(byte)(&DAT_1402f8e50)[lVar4];
        *puVar2 = *puVar2 ^ *(uint *)(&DAT_140316470 + lVar4 * 4);
        if ((((char)*puVar2 == '\0') || ((&DAT_140316471)[lVar1] == '\0')) ||
           (((&DAT_140316472)[lVar1] == '\0' || ((&DAT_140316473)[lVar1] == '\0')))) {
          iVar5 = iVar5 + 1;
          if (100 < iVar5) {
            if ((DAT_140316465 == '\0') && (FUN_1400c0580(), DAT_140316858 != 0)) {
              FUN_1400d1280();
              _Seed = GetTickCount();
              srand(_Seed);
              FUN_1400c0410();
              FUN_1400d1290(DAT_140316858);
            }
            goto LAB_1400c084b;
          }
        }
        else {
          FUN_1400b97e0(param_2,puVar2,4);
          iVar3 = iVar3 + 4;
LAB_1400c084b:
          iVar5 = 0;
        }
      } while (iVar3 < param_1);
    }
    FUN_1400d1290(DAT_140316858);
    if (param_1 < iVar3) {
      FUN_1400b8be0(param_2,iVar3 - param_1);
    }
  }
  return;
}



undefined8 FUN_1400c0890(undefined8 param_1)

{
  char cVar1;
  undefined1 local_40 [56];
  
  FUN_1400bcc20(local_40);
  FUN_1400bc640(local_40,param_1);
  FUN_1400bbc30(local_40);
  FUN_1400bdd00(local_40,0x20);
  FUN_1400bdd00(local_40,9);
  FUN_1400bdd00(local_40,0x2d);
  FUN_1400bd760(local_40);
  FUN_1400bd110(local_40,"digest",&DAT_14027a10a);
  cVar1 = FUN_1400bde50(local_40,&DAT_140209300);
  if (cVar1 == '\0') {
    cVar1 = FUN_1400bde50(local_40,&DAT_1402092fc);
    if (cVar1 != '\0') {
      FUN_1400bceb0(local_40);
      return 4;
    }
    cVar1 = FUN_1400bde50(local_40,&DAT_1402092f8);
    if (cVar1 != '\0') {
      FUN_1400bceb0(local_40);
      return 5;
    }
    cVar1 = FUN_1400bde50(local_40,"sha256");
    if (cVar1 != '\0') {
      FUN_1400bceb0(local_40);
      return 7;
    }
    cVar1 = FUN_1400bde50(local_40,"sha384");
    if (cVar1 != '\0') {
      FUN_1400bceb0(local_40);
      return 2;
    }
    cVar1 = FUN_1400bde50(local_40,"sha512");
    if (cVar1 != '\0') {
      FUN_1400bceb0(local_40);
      return 3;
    }
    cVar1 = FUN_1400bde50(local_40,&DAT_1402092d8);
    if (cVar1 != '\0') {
      FUN_1400bceb0(local_40);
      return 0xd;
    }
  }
  FUN_1400bceb0(local_40);
  return 1;
}



undefined4 FUN_1400c0a30(int param_1)

{
  undefined4 uVar1;
  
  if (param_1 == 1) {
    return 0x14;
  }
  if ((param_1 == 4) || (param_1 == 5)) {
    return 0x10;
  }
  if (param_1 == 7) {
    return 0x20;
  }
  if (param_1 == 2) {
    return 0x30;
  }
  uVar1 = 0x10;
  if (param_1 == 3) {
    uVar1 = 0x40;
  }
  return uVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400c0a70(undefined8 param_1,undefined4 param_2,int param_3,undefined8 param_4)

{
  undefined1 auStack_e8 [32];
  undefined8 local_c8;
  undefined1 local_b8 [112];
  undefined1 local_48 [32];
  ulonglong local_28;
  
  local_c8 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_e8;
  FUN_1400b8b30(param_4);
  if (param_3 == 1) {
    FUN_1400f37a0(local_b8);
    FUN_1400f46e0(local_b8,param_1,param_2,param_4);
  }
  else {
    if (param_3 == 4) {
      FUN_1400f53e0(local_b8);
      FUN_1400f5790(local_b8,param_1,param_2,param_4);
      FUN_1400f53f0(local_b8);
      return;
    }
    if (param_3 == 5) {
      FUN_1400f4fd0(local_b8);
      FUN_1400f52e0(local_b8,param_1,param_2,local_48);
      FUN_1400b97e0(param_4,local_48,0x10);
      FUN_1400f5000(local_b8);
      return;
    }
    if (param_3 == 7) {
      FUN_140102ac0(param_1,param_2,param_4);
      return;
    }
    if (param_3 == 2) {
      FUN_1401029a0(param_1,param_2,param_4);
      return;
    }
    if (param_3 == 3) {
      FUN_140102a30(param_1,param_2,param_4);
      return;
    }
    FUN_1400f37a0(local_b8);
    FUN_1400f46e0(local_b8,param_1,param_2,param_4);
  }
  FUN_1400f37f0(local_b8);
  return;
}



undefined8 * FUN_1400c0be0(undefined8 *param_1)

{
  *param_1 = _ckCharset::vftable;
  FUN_1400bcc20(param_1 + 1);
  *(undefined4 *)(param_1 + 7) = 0;
  FUN_1400bc9f0(param_1 + 1);
  return param_1;
}



void FUN_1400c0c30(undefined8 *param_1)

{
  *param_1 = _ckCharset::vftable;
  FUN_1400bceb0();
  return;
}



void FUN_1400c0c50(longlong param_1)

{
  FUN_1400b8b90(param_1 + 8);
  return;
}



undefined4 FUN_1400c0c60(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x38);
}



void FUN_1400c0c70(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 uVar2;
  undefined1 local_40 [56];
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1400bcc20(local_40);
  cVar1 = FUN_140106f10(param_2,local_40,param_3,param_4,uVar2);
  if (cVar1 == '\0') {
    *(undefined4 *)(param_1 + 0x38) = 0;
    FUN_1400bbe30(param_1 + 8);
  }
  else {
    *(undefined4 *)(param_1 + 0x38) = param_2;
    FUN_1400bdc90(param_1 + 8,local_40);
  }
  FUN_1400bc9f0(param_1 + 8);
  FUN_1400bceb0(local_40);
  return;
}



undefined8 * FUN_1400c0cf0(undefined8 *param_1,uint param_2)

{
  *param_1 = _ckCharset::vftable;
  FUN_1400bceb0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1400c0d30(undefined8 param_1)

{
  FUN_1400bc640(param_1,
                "c4aeUs6+QAABCWmgzMUFZJlNZ2XC/3wA6h//////////////////////////////////////////////gN/3wvooBhVoGgVrQBQNKlVFAoUFAAUoAKAIRQKoKUYAA99FBKEklFVKWk+QHB0KhIs5BwcoHONyo5xxxznGay6kA6aoAMIAAAJAAAAqgAAAALzmxFb3cREgEDQAEwEwBAYmIwCYmRgCZNMCZMmABGCaMmjTTTBMmmRphMmhiGJhGjRkYjEMU8Q0yZMCZNAMRppkQinomgEAAATIwp4E00yYTE0AGgBogGhpqm9Cmwp5GKNpDamnpqNqeptNI9E9TAmaQABoAeoBoAyZGgAAaAAAFVPwIAEDQDIxTBNE8jQFPDU2pmgFNiDCoYym9Cam0"
               );
  FUN_1400bc640(param_1,
                "YDKek0ymep6Gqemk0wm0I9TQGBAaDQGR6jQ0AGmgNAAAAABqfoiEJAU00RlPSZTQZHkgep5TQGjQ9TIND1MhoHqABoBoGmgPU0AA0AAADTQAAAAAAAAAAAA00A1PaRJEmqB6hgjRoABkZNAAaABoaMQZAMmjQGmIDQBoAAyAaAaaGmAQyDQDIAADTQBoBoAAASIkQCATFNk0aBNMTT1T0ZU9pok9PE0KfoIw0GjU009PUam1PRop+U9GlPamBR7U9Bqg9T1Hpk9TI0TT1HkT1BtT0nqMEaeUHpPRGjEDQBoDRp5T1PKFR4Zik4KqVbueq3yL5PNLCmElhYWPoRjCSQuYQMEUYkAgVGkfUaQIIaBADYCLTQgQshpL/dpCwGa5pAitpCE2JNpBjtID"
               );
  FUN_1400bc640(param_1,
                "HaEC9+0IowENtoEYbCGIQ2Y7vMJaFjNQ0hTF7HoTSIqkiW7ExjW49Ywq41MZFsxhL40SXpFb5ixhdm8eLHfXSeqbSy8IsLzJbEm2IFTRbxINqBtHi4JKjDTcvqnVisYl8MW7eEsiV6aWpcTLjrjOaPb09+zucG4bZuK5jQqy88PJiCWjHsmjQdm73Jp+pXpu7U1znNqdaukkrTz5VVO41YYtllzSDklVW4krF9spbS9FHsPcotTabce4vYNeDwrWcPC3p1mLy76ozp6Ex0KvK72KwcinA/S3TwNoAvfnJflebXLTudccXjIg05xqrQW6utl00EmiAGXWRKV6r6qiPMaNuYRz1c99TWRZbwmuWoZb5LBb9WTR7k3V2pN7c73rLa7nnPX06uNMe5zp"
               );
  FUN_1400bc640(param_1,
                "Wd9JxbifI9XMuGfvUvPAmZDbUJ1Jn4sct9V1St9ZnD4PbC4XTxwYQGnBc+L8Ndt6vfrOvmGuO/vno/wcd1Je9fd385z2BvHJ/lPEX7UxnLEJn4OfffjKltM+K6eIAseL7FoNy4HHk2ZvNCpsoUfdiPpvKn+l2MKq1S6wl4rR6lKaull4rpZhFy1GO9o1L0VjDkjSaOPXp03D76Spp+xBxz3jo2ngjN01Jt9ttacfYzs4Ts0cbXNjSvJz34dvJtVyXIlj10zLu8hnpl+6Yqq7sn32HCqjP7Ox1mRc/Os2dlFrMo8IsR5uLgWc5863T9+fU8z3zyevvzft/P3qzrPdvu7i8ZVXBZBDwHqNdU0XqoLNmN+8u0qPfvOX/azUN7DDlV0i9iXr6lt13klj"
               );
  FUN_1400bc640(param_1,
                "AJa35Tzv0Rcba5lykYZkwkvrAqRYgw85kTppDw35cEltTVMD/20NNtvq4kNJ6xCBC4MxymiOjCrs+ctLy01TzENmDBM5rAWKqqYCp4OK7anlqGnhUZpzxpRQxSFJolVmUKm8mGosjIgMuc6zzaWkJaFluC0Y068qzlZmHaFIlDJG8VpqY5pTTT8s5l5lbtc1uIQhUtS74eaPpj63UvW4yv2Y8L5XpwPhXOOztGTf0ppfljE/f/3s0l33jZ3zq//InX70nOfdv6zWWrjsEOHD7Zz8CL65A3c8Syp5PMnB2FWS7+9GA7DsfXH3+6TW8tcfEblv2r+h317npRcgd3DWeVInTgYJFbF9ua5i9GsVmoaYIRBC7pLdhMNAEORSPC/Tlh8MeEg2MSv0uYEY"
               );
  FUN_1400bc640(param_1,
                "MKCxrmeNayBcyVlwgmLwFR9iFZ4iybMU3PAkWiCAFi0JmHmXSarDQj6TOc34Z1PUxNHFKLTqlUVavVd/CqFDAXwN2VWEC+f97Nn0Ttr5T3d18Jq2PbvvtnjWO1sV3CE6RhDo/IhRU4eO6+s9Hcz+ZYruujxLetjru9mL1s6D0dc1j3Xt3n5nOIZbXb2pEVlaEgpd2ZV3rrGW3QKmPRpNxpSCTgm0ZfXnVq+Cng+fOXoxBKhRc85nubxLaXOapujLdNJi6GmUjSSoqgh5EebMUg2/HUkGx2+inuL0bOuDXsvjFyJLR6D0XWe3s5+J953a/D7yHqIdLbo5tKXyTqnj2qUiXdvVqgF09y4xNCZgBNpiaafsCZiPMUFDYzn3kgYtBi3FNtzTTQWV7DdI"
               );
  FUN_1400bc640(param_1,
                "2SC/ZfDkVLbXb631a/hXoU+2dOZ4fdrDbvH8t0lO+5BHm+7NbapeZZYatqAgwmV8GtVYp1rVUr+i8ulbuakEdOl6xh02fdRRH3sYvgeHM8r2/lZiL4P3nVaMHn5rUCn5So+2W9ahaYYTQzCTbeZMSR5KMH4oZgsaXiL5YzpecayxAaZ7M9Ap5R53aYtmF9ULOMZMzDRRj0xkHT2KUEREHZcZ3FqxpbOFNn8Bq2NfBu2qUdiI6Bw2zBY3VJAMeMjyKuWr/Ye4/A7r0Z5nHsZvCggSfPU8LfozuNe00xGWsmyXJ7Bnj42TG/nfmq33M321vOX3jsZRkU/DOjE+A8MX08XmYnd8ZPqR1x1NVUpQ7rpFjWHTkJE1dd7XxWc5QJHoMXGNtMQ17BMnE2RR"
               );
  FUN_1400bc640(param_1,
                "8GFNSeuQ5FeRrY7q6bTxKw028KNoJpjeFz8zp1XO4okafgKtNJcCPtrWMk00NQFYKjymlRqjWRuBg6SXCAm6arVVUmBRhiAEDEzulTALTbudqw4xXpO7ZTtciyY+mmM2mFAYiy8VKruvCsPXHbbsZNRS0GxFluPFNFmuCpD6hCF5kTfl2zBFcPAJ6bpnBI0YQMVuOLfe1UWZGryNx7LFuWk1NU4A8mkwJrUIptArdMjKY613KTQCsR0h4HNGKNbiaRGHes0piy1k2aeptaaD7fH29qZ1rZ22zIrzRM2h1ixFQgGNhygRdlU5uDqJsKI7G48ZnMgrzue1dXWH7quOM576nbMuHdxW6mkPCG6bxHTE1VIcE8yadPNdIzoPIQRUmNTjgYCN0Z7P3ZYd"
               );
  FUN_1400bc640(param_1,
                "NbIm7MSJ7JjbxVN8V1VGAxmoyJuomYhB5bzTi5MVrWtOzTVq43FDAIQsmc9013tLYb+fmlso1wXp3HGxTFsTeM2L1rpN5BoTy0OQQ03HYxaSpc7ZzEUrb2aWr1TVLQ8KxjbowqFLcIFAJptjKlzDwUVdTOpeKqYyTyicEaILOX+eF5HO9c0uRd1rqNNswdPGdXY/C1UdZlcaM9rt5rLzmsZE/RcS4tbMiVBgCOcJ4VKHrVWFZZempulF0a6aaEmYZl3OnVXcUVxVOPNZ08sDuFjIlDrc4lY2bO4SzRtQfdyk8YWgJAnUUTTgTYIm6dQeGPdUoUhDkR2bp9Foxl6uoGTFZLUVoTvNVauRCbB4fOnV3R2pNC9d12za5v6PFnhidd5TbmnqvKWaLb5N"
               );
  FUN_1400bc640(param_1,
                "mhLvQsMQ2yyiZGtNmWpHx4/dNVxZleFKW062OqxONVKwItoyHRWhQpmxIlTB50KgIZRTbNKmXTMWvF4o4tiQDeHw2tJtBoeAXaNUe8MWQqNbbXQsdZkpA33nNd0SeaicWSY4IAQ9xSu2Wg5NTjNRNtoe3nhzStncKhcPCaEjbUiHZiKcDUwCt/uZUZnfMGXrNmGdvyVSxZzS22qw41DR4cPN4W4u1cU7B8PNvRXV5twoFHVltXBWoVBAOFuNONRphiRpPfnFkoWQNt974tlZbRQ0VxdUivW06zcIPPPjVhLkGYQZbyRCjHQcVKARMl5rDvMYiRolx0vmoqKvUS91VzWz1rqteilS4Wpl+M8ssxzqYXju70nnMkb8K4uses6xkrCEYNvHmTSAYYTy"
               );
  FUN_1400bc640(param_1,
                "PyMVQ1zbrvq67jMYY4B403DxdwBDS01OjWqyuZJzt41UuUadoxJJAGIeaqCttPJFA09TDO6LUTzacXiLd1DmDqsTLowr8B/C4a7VuLQttoXe8US+rpVvTiT6kUQkU5bVV6Y7dIws+HMws1afWnfrW14HcZOza0YZQk0xZrxrxvCydDBU8kSBaOSBl5uk4nGsPLVzE4p5Yt5mjsZMLZgrUka0QyOx4OHqPQmbR2Kq5ZOL3LuvKpENVpxYrum6x1xqY202NPJNJeq7aM3NVltUgy7caVOQNgxWBU07M1hqjUcMcXUWC3211vJbGY4cb3XGnkx4HOtRpR2dxXDWyF6GoimngNNPp01oFMyRkBQDZccWqTCiI1NwzNszacwqJruuti+8TOqTTHhuITIo"
               );
  FUN_1400bc640(param_1,
                "RHfKmMUdiq+OcmDHeKIhBKCxDBzHiCE0ajMCcnn2atabvhrEFox/Hj1UmmeqRb77qn5W1MGtXntnItb3VKjITAo4gY0gRgOO9qL469lUYxoYicRRRobQN+jl5ti7GSisCQgMGLy4rqT1ROqciuTAYEUn3CvLv2zTXpfbKXfOMri6orgXdXaIecyoJBiqYQqr4vzzrAY/g1ACW1vbV6efKotUslHFtFPqXTpdD9TTUWQaG0GTCfTMyI4b4enXNat5W0J1UUWstvMZQAhR2ceFpQEYuz8TOCFlt4keuHKsJ556vNttDyoxpSTZW7ijbaE03TFBDw0ITajSm1qqTapvIUIUeKqpTZHXsOquJ6edPO9RQ02oLVJziQjWBveZGhUnIrIFD5FjKjx6j8Jk"
               );
  FUN_1400bc640(param_1,
                "2hAIzODMuFpjCuZECA9cwy2nlsjWXCGdRVMqZzTtRusIQR2UQoK6qoUsmbuWIQIEhB63aoltD1uPjamaiCFn++tc5grxPYjOCvUP3cZrwch6u5UeKARiAu5wsxUKlbuWqdDKG2cVebXcdm9o2IMZjajDwJFk3mlHeOSlvhPamt5shhmAxndUlzwZUOG7bQspNaqomYsZhQYw6zZLtSJyShLo911SlbqjaM0EtcllO6kHgdNEeAZgDZqKLSoO6Q1RFGVLambeZbraGRjUZsy6VahDQmGsxd27IpQ5qglMNU48tunVSNtuBHmmXaQGEOmNx41TGcjoQ5MyojZPN1baCnwQ06F1JSrlwKfnalaL6LSCMsUxODcshVyxWrToTw6altuo40rdOtVfbKdi"
               );
  FUN_1400bc640(param_1,
                "ffxKzeeOJlWYbxmRwCPEyxQwJsY28AjSG3rJsPOsqNcVxfBfx5qHJGRT38ipo4Zp8abOhZKjXjfy3FLRrBdEi21Vvi+I1afu3CPQhvGp3zCg28KroqqK9mvCrg0g11If2njjEeXmM7U7oGD8tyat66uCp7zKCDwCLLRFI4cq6jKsdPFC2RUngbSG1XducZayBBMmbivwdpTMQdU/XOonfHW65vRDOoDbgn2MvUWor1CUgjUKoU02B6iulRKs5l7Fum2cXhiOt5ixWRYcjhoqqBOqoVOSdPDTznyNU4tDGXKbZQR6A2nBAY2JFFWzJSaHlC6eaoMW2vCRX3t6reuHnkVeRmJnQwwYMEOJOGrKQlvLxGmsZdVWLbzKzXOr5vOVYXsnJxd+nizwdW8J"
               );
  FUN_1400bc640(param_1,
                "hXNUJtHDV2bmOTWpPiN3dM6EuOHdmN0qVNrq/YmLEgx1WSitzmJd4srLs6lTF7lZ6y91x9pvF426zu+bW400FazEdN1CLNSIAojcbeGORzBgoirwtS63HlcOdZhNZqZjAJTu2qFYmcZVkwW/MiyCbw8vSnxMV+Dm/nCWtTsVShvEGCt4IxikkcJG1YO5dXtmUjDheTFKDXsyQ8RIy4ztFEK/G1Dlu7OKQSKou8xEfCpSDNEt8W7q1oXiLx6da3b317XWueH7jnhGKT2D/GxnN+HCqzgayMlSd4mYrWZ6H2uhcriarDmk10ilJiuaeZq/Z6/hf+f/aC5je1OI0gQCPDaQkIFUxCBDYkkr5pCQhdO0gRW0X7AOufjtHUsSPf+vC67xfiSi/YkjTsLr"
               );
  FUN_1400bc640(param_1,
                "AM60GA0vdveOplt2sjLngfEsLPaepBXlxVzVJNI8h+y1hP4+Fc21DUtGo4yL5mS1AxBn8yDLfgYOg5ri1ItNtKvAgl163qdJ0ePravi4XBt8i9DixDFpeOhWmYDE+MhQ1fuGXmaa+x6vj1apqed62S7ysGK8JnKVfYm0wyGZWpj91mM7jNS6vcaGVpGu3aAQY6EljO+q9r2P4fA+ja0mw9XKwpqQF1i9hw7DSD0mJTfxAwr4/jKc66m8rM1dCmXpeNk0bVTbMxohjOTiGcs4svPuWzln4uFodFYq6h4LNFb0kkcm+Rkj0nqJjTvk55Bkt5sZ2YAA0/E5n2tdx3Oe2wumuXENgMGkxgMy4gwIczINp+C1hbKnrOXRhnIw3cqhVD4kBlOaMh7GEkd9"
               );
  FUN_1400bc640(param_1,
                "sTmsf6vP4Fjm+ZuazIipNibDXW9RgURU8uIY+PcadwN5ThjYxiFn73s7TYVBW5iEL1NZotVlVIph4NnCqXMTXyVBBnr/Iz3q8taLAuTa1cxbiBiYK143CxsjU17NpWY4gQVCAxHLHOE4DkFICXlu6sJVuoAK5X/W54L1iZ3lEOBixwLi00xnx4AFeEBO2EIggfZ78iMHcZ7962atsNF5FUABhDM/6Nuf5dWlsVpZ4A7Wtby4KcBg6j2PHkQEXekmUQZ0iym5jiiCeP5m6t3LMtlJdwCYK00sFVgX1NPE+tRU085leqABgr+UtSqoPEbzwpU5A6KgAPxKWC4d9bc8tk1UnqkyVm8L4stA5pSsqBKeyXMPdY6qQjQYODzzs2+LW9cYqJI0Fpr6WBZa"
               );
  FUN_1400bc640(param_1,
                "JT0QJx0aRSeObJC2aHmMzUQUQg9DDtL6gUFmRV88UhsX/ihUKqPolI4oit10kENtoue4k0bGqko8HzLMvoIJIM29xKz0+LHYJhs8xWHq32vaSZ+o4mbT4+vTSx4LEoRqRL2tEZTGaSGM+VZeMtjJgaggY+3reAzDdtUGmyYr/HQ/9Fwn1V/Z2XWs2cMNrQ3hj6zfhlqm7W9olkq3Lhd52H06F1LwLLMJcvKhEnNGVzVY5BorZZ/d4m7ZTrCgKVSAH2hfRnMRmqOI0qEBAyYQiNZFJ11HGCmEuwxW1HOeejjsYZSX0Z22Ms4r3zOYgczmLn0SQXW9Wk0YxCgni8K/hHGldWJSC6O3tTmiaVdBLS4JYBbzz85GdkNnUAla9HKeYMBlQ8CEOvsiaASt"
               );
  FUN_1400bc640(param_1,
                "xbZpLiTJldel1jFudaKILgnlwZPY9i0/Upov6r14vUs4F1IiDPfYK8y8Dg95GsOtdFBQHpE1hmpN62+QQwhCEOLJhO1PnM8nPZaK4i2OISce9lNnWF0hTRX4RtqS+USFEWObnZOlasGohloCsqde8JNaePIgHhBA4PDX685UNnJFlsz4ChdW3HLjujv8zS85Sb9ucrQvNI5MFxFlUPUOtwdqhJdFlBkBprLVuLu7UpzIX8q5ksksjQZYnGUqVznrJHweM2m/FRn2ki4RX20OQPTYe6hmGkwA8Ccox+kK7623SQBd2M2rmFeczzCUyn5HKSEILQJlPHw9jhvgw06xbwbyFvy4o5r4nk+05CzY0XlxzBGz427l7aQir5PCvj6cONrqp+GfD2kTbPfo"
               );
  FUN_1400bc640(param_1,
                "0JV/1eVpr/TqY2AzXoWmFkutRZVEqE6bSW7Cft0X0IFuGTSzZyEm50YWQFPcSBy7/MbBUTNtd2/WuIWDHJGcu3OMjk3j5DGYkNizzT37SdZiytrHdD5CD6RYpLhWFswaEBDF9KggCsuulU5JhtPIRCFo+rqRb0k1JqRrO5LRe83u9cxn1TISXRFA0C8jnSnKjukqEYabwr8D9e9Lxdibc5KVi27b2tfGRo7cjDkx4StitwdSvzb1ZlvtFdAfIcFz9wNu6kINc3alfqcdUD9Ors1eqb4EK/okzH0aHdO8VgB8eafa46x0pZIdgjBu9+a+ur2ihUSXTrXkc7ACy6dvllXTq+W1AAHdl0AqhiQsy8yBlu31IMfELOj0Wl59+Vykn/5SbhQojXQgVJtt"
               );
  FUN_1400bc640(param_1,
                "g6cc4/bFUfZat9tpKPGmDDKdm1m5bt+V9qcBCSNmTrlypCaO1JDwil2dGUxvU74LqZ6e351waI5v0WXwtOyfwlwbSClbE5CIgVojcElxgnZFpZ0SNtXVwkXNlRrkhXjUxg8DXdbrxuM+Aqz2F66wzN2o8zPSfgIGxVGN4IHB5jjo30xJCAjXCfEnRnlpILzbIIL3eEKwp5JLGBXvjkT6Ine55nNq6uUikmRePiTu0ckdOpuco0ubbDAqTqZIVw8jtm47iRtPSzGaDEj+dAMaCYQxIB34RkUgiHUxUkYDSL2AJBpSvjoRuGfTtQ1oGzJfbc6Gs2xzYde95RkwCwO4eT8Q99J+8+ys9aDs0z1IlHaNz4YgOiTBqrgZReBR3jzAskEkgGmBGAOS41Gm"
               );
  FUN_1400bc640(param_1,
                "51KI/Zh8HqcJhYU9/VMJ5k4fWhWf4IwZ6xy9O7uthJcLkUcZ9Fu2dSGkqwWlVJr3c1E57ogadwsFVvMv/SPkxfJNTybhSoWKjFiJBsXJShu+WxUPEaEIob4pLRrl/pmO3E5DTPvJO/UbZWVSnzlo71QYdpkxYrZtiSe8ZRPcHlsmYEDSXoX68vUqKaAX+aEwcCOLe2MzYzCgRrLM96Y7GGE2dTZlbcQF+DXJcqVyguvhhiF+K/eCV2jOQJmSoNdXJaSkvv8Um4WDOFjAzEAcKOuek/cRHN3RbZqToQOhzzb5fRjI8u8jxD3WeR1YDyxgTDYX5KW6xFqMwo+LjLzdZSAGwA8BJJnr+pYb4gsOx56YOgEqp6hNXu9HNe2gy2q/dxjO41sXGayNNxL+"
               );
  FUN_1400bc640(param_1,
                "lNa4HvYg5hrXtaekF7l3L/vY0OIeBAPMDYN3sTiEBrBJXPBCILYCIDvDmjx+KI3AlDfkTgiIAC7m86BLCQaVRJCGQgcQtyHqwplj8oRMKYIIxAFiv3MB3tTlQ7KXkZtC8zsXlTDGcKIC7GpnPPOPkajX9fqMClResGTmfoTFeLYhU5fX6Ho6irEZDB8H286PQ1XdHVgumDMkv4eB6fOUBJco8zxlqk8pf/J763Il0f8Hi8T6vSITOXHVcWPYK6EyQNMqKSnK1iCo7M7SjfbeR/kVGJj9aa6J+jr/951ki2f9VW5YylPJ2bv1lju0vIWjzV4NGypmWX7LtQncBJ/iTW4e+oOEonIIYw5vJj53y/L+bTDaRqWkbyPyd3QSOoZka+Badh1vkWpFRjfv"
               );
  FUN_1400bc640(param_1,
                "Yjn+dg6hri1QHRP3m3pK8FxgM945vWI2LpmwabDpO6fLzmzvukjpWVcjGSxYT2ruPeM30wKzbu31HSbvQzUGcaElu+YijxY0UohmeYEOmenJxJq3j4yqzOEzaO03oNBMu/xMenf1Q43EIShpE9nHTvO00s4cwMYNXLEiFuaQsiuZNLCgxnFvGlC4fwqvoaypGdas1WmTay5nIeqaFm8vuuDSw01xcycOYA6zwpt297wtBorR7e9BmtHizb6jfTUYMY8gtnjaeoJopSe3UjGUxfVJtueYEAEFEtZY8wDg8MnEPglDncD2Jb4fUIhSdkPB5vEzzx5nQLeYpgYWWMr3KQcfI5tBS6fomFl3pJEy8788MGOs/xXvpb989c5I5fVroev63ZU+qFroNjaH"
               );
  FUN_1400bc640(param_1,
                "ew4bmzz2j25v+5oEk0FCD4Xq03U8kjwVUz1/W6F5FAhjo+l1l/K71DtfC752/7/I5Nh/bRX7G+XwRDNbEqtJetuOhkLs5bnjUGUsTeW/HKxfXSvannhl1pp5hkJSuEfqLbzlEoi1molfX7pW3lSBzXN0Vq0jnpeSvKXYFFFfepQ8OEVlptXKTyZ05cGQvkT6kRdwsU9V18nLen994mjz0Usr2LIK4wt5yeDEvaS0BtIJwtSDfvGTJUde7XYCaxQGRfik3wE0YEFhZSA8eM3RLKrv7Tv3HBy5J6d+OoLJjLDwdRlW1Ow3tZcv1c7QP0zW2YdiRu1suEAeqVStQiY5YehMSuWl2/krYsUi2FVnNOG8m3dZcyW0sa+kn8TIWL0Vk2iHVZpOFV0lZJr2"
               );
  FUN_1400bc640(param_1,
                "dilEiKWk2NXCplCMIVImeQsOW4MqpLbwnzBV2VWKjWxYml12YcvQncZZNzwn9lC3x1u7v3TBy6BpcVDENvB0PJy+XB8OoupyNRpFf7JfXnU2B/DjPsXh0pj2JIb4SzDAzWP6DWYU4ShJVvKm6d+y029HmK1oK93tlfIOhmJYt1jcdXG38/ANutrj4m+3JlYFJLiQdzDyQYTD5pGDOvqNy+7vLPbmFHoBIVYyWV5FmihFCjedekQBnAghVyZXHEjykN1insHJBh09oOAURx2g5qtGOBFrdVlah1tvJSNukKjCYJDV01XLQ2ckBiKS+pYhAExcw+J6cT6w8dIZ8qTbPiZA+Lsr/TMBGyLZwEjdcqKb1RvEhH5ePuoeFROE2pEUgC9MuNaokgtK12fr"
               );
  FUN_1400bc640(param_1,
                "CE9xMdnz2K+Zt6afj0E3OWSUKvoGGvkOKyMqY7jTzKY8zV1rjD5MFwlhxY7Dd4UtKmzri/gypG6hcKL7VO+w3yNNtcO7h6goGzj2MI8LKlOd6iNlnFI6HFeWOqZw0tlbj7RO0hruZFWOpm7dP3COLDnJvrleDhSF3pD/lYVV/JYxOGDWt5EnsKeG47tZqw1c6421bcxkAkQXe20jjQOs4R9ilT0ZtYdvBsdHfREZAgLFVdGIk+VwcPiVNU88MxIc6Lg7U7NNAagxHCgOCo6M4rgSSiHE0nTGkbYENB9FynkV+2i5Ooq+TpFiCDl5r6Ou6ImSmM5uQzNXd7Tc4Gsp71qz0jINU9nquV09K2O1HB1VCTVvdsxHj6yK2cxPLzR4cQiL7jeM3tRd18LO"
               );
  FUN_1400bc640(param_1,
                "ZVskzzLm4j3D0JnbEl6Nlh0nDuEIw4ozuTBUuVGG45ZoSZxlHR+xktKeUxmQD7uqD6T621isp7rulH+yPXfWuZMUfrafl6sZBVOH0do96A1BV0/9/bdFhPOyP+iykm3Y5eFi7GoltaEUd9yaR3XKLGg8prQl2Y/Exuam/+VrfV03YaP7c6Jmo/Wjy2g9BpLe9J3U7jDjbMDK6KBtLqdVCU2HAdMRDZSuBVs8poo5jnt+beoL53n1rEl3PeR11O8v/wmWqyD8WCE29D1MTg7C/xKirxoEjuPB2nia2nybM2Njeiiefgjhs7TFg5KrUxKETg7jEot0xHPNZDO2nKktHEjr2CyvE5yax0ZDbRlwu3m5NHKLuqmeFizJnuwxZKw8gD4UHsYcIhpIgcxA"
               );
  FUN_1400bc640(param_1,
                "HnNMlW7XpLdkEobelH2jeo+3tGM2sMaak3uOiz276Czw+InQTAgh6ZXm9NFnnZxkU2Z8dJm6q8g8Pda3Qhy7UkVbDz9apgdDu6/y8/cOsFhxnGSGHsvAgNAm8K7HDpdxd1Fby4tJSMc5UZcYRKFODNLt+lbV3Imnht8x/s4l7Awl2ARm5NuVAySmOa4oxzuBlq1oFAy1WA4mzbunZk2eZ56Gc1ZxD5XU0kPFQmdvlt2dGMKzwkDhnm74rlDx24UWqge1MF35HLqiFvXPyOajYhbR8Tq7TR7F6RpLctsEqRdzc2oTi+kyMlNVQktfb8Zy7VSHNTXeuYdw47qpcpd8uZuuKYmf7d11NjlqSU2BXuPuqcpGJJSiK9TblPUq1pirUdpa3KxAS+inOVvB"
               );
  FUN_1400bc640(param_1,
                "gGu2OYhXfdKrM9Zd2TElljE0FRxls7H8PjqjgshW8YWXjNQrwzIRCfALGdmdT9DO079NnraSeOzWKKOi/iZniysxI6NXUjzjVmZK8DDgXpt+899KPCbeNIkowNAu9m/PBbIvLg97Gu1QPER5itLoyMxF9XHTXnysvEan4azHvz96NVvllCQNDb5CkI24j6pV9a2GMxvNNGY+V+cL7JnePCV4c1Zvs7knFsY6DgaIoCCYgQBDfUmzrDr5kSv3jyQsuBmJLrK0SnhtxtTETAfREnGIQcqziPHOMijbRIURUFShQKYBOmwiyDwjwGBTD2JKbY8oYAkEJIkcCHGNNMrwECiDVsVmRz2aBxuJZ7P3nWMh6FxjOebkVVX3lHlAYT92tctFXU7sodB2WYp3"
               );
  FUN_1400bc640(param_1,
                "amvX70/w7ytyPpunVNeF5TpO55cBSD+XOboeVdPrfD7p/rK+VnKJzfXVH3nBUg1WvmjFltO9E5jBhdZ9mpU+Z28h6ZaAk7DCwHuhhiDSXA330uFTgdBppNd1cHNsrtxfPvGYT7LMjkmuyxui3Nio3DEi28Hr4jJgIZt3DT71nj9fRANm8ooe2hI+nuYKdG4DXvJ8azK4bNzmxZZNrFqpUMN5fzL0sWdxj7ihNO0/Iu1fg6fRXVlEI49caIhEEFLHZMeUaLyuEw6MPuigiAhukHx67xO35PecxEYYsiJd2prUmLjkIdtbdogVMWG83NeoQFrXGui86d0FZKrUvnYMlfs+8Shp31C7dVtPYNvu9KA9Gihkiee5RtzL6chPtmBYttBGiOeKjjo4Dtk8"
               );
  FUN_1400bc640(param_1,
                "vkTTlE06KTMciAXzrln2nvrSs+kenu5pK9QjS8UBs4uH1dKLJlUOPY51uNoIqZTeqsfq9vm94R2Vev1LWgtCxcFCTanKAOUE1sWScpE3ZdyK5ml2XdrMZEPwdZJALgayHTb4xtO1h0V9joT4CcIenIaNui2QxkFxQ0hj+5IRTBwxgsrozcBwkfDYdLpIBDZeDI0rfi5cWgpsObAy5lAta3P2D09iAgjCbwnit1AqVM7BxEGTgXEolwKkIgZCM48+xIi7b1JpIhQFSuIENgezXniPiNiBmCkAhoXBIKSWwn5QCSOYBrGkkPpUmZIPXImMkB7m4RmO2Ub7mTLwVQuroVwQoI1NBeDF/2fXy2yq/k42b1+2KqXK5NnGCEj4NnT2ykua9grFTnt2bRYE"
               );
  FUN_1400bc640(param_1,
                "Ut+1gldm2dPDjVRZjNLCyEhL2K+LynQ7anz4j/Dten4vE8Pi8D9u15DSDl2bN8i13LMTyIOl2MLF2sLZNG2ar8Hp5LLNC0le3UclavpTZR/YctCfU5E3d1uK6eE9v1sBy2+38reWdZIoT7/uozlIep4FjtLm7rsb54jXAZ8rd3dr8Dw8/fR0M2YsUHLEDDzeS/Ujye3Lr7xYEfCaVIu4zpoY52Xy9+3vtfHV10BS7QWqFHbODoG89iFG5rHLQp3dU7yn4guHR0kOzJrnSqAn8Q3lhqUzdE52Z09o9N4CqSm7dOGppCHz16q4isXtDDWmnHXYhPkCDq+FzB7EC8RzqsyTULzA41usumN/cI8zzULq950npN+i+0u79VirQcG+kM+0TyUgfZve+aoZ"
               );
  FUN_1400bc640(param_1,
                "lXaZe1sIdSp0r6fi+jR1WDW6tTLpwl3+5bI0k5LKOmc6EHLe7LREDQT5zVZDMxDWb+k4nJHDQUKFuWUoiFMQzku+TQMxcE1m5L7wCHImWJ9L+HnebwN/R0uuz+fWVTmbu/38fhav2Ot3Ti0/aq5qbGaOez3awgTBmQVOHdnxoa1X8IU31xsSN9PuJw9zSL2LtPnXr3o3mlEKGbjyWlV6ywG7r6FvAXkKus5qI/2Oo0Jk9lH1z9jSXKkH71qQAEwDitI7vf+PPcvpfra2Ub1qjSzrBdv2UTSG264gXu4g62I7PC0uoqPQrNq0SfB1+tp/H9uM2Y8F2s2Fa7XTd3RXnurMUpvvxr1VOrbH3XFjiryGTWyVRfSb5q/w75J3k6qJyRVR7ExInHW9BHjS"
               );
  FUN_1400bc640(param_1,
                "tTjp4iKjIMt54ur5keZrxM7e4MdjFFrjNzPMWB5rOh0OW+kUY+tZJMSoAeaR7AqSCITr/2JJVIT0oXyrXiIk9Vi+b0Xtl4wpp7nFIMPOF7trvdElhJyezGhNr5g7O/MKWLnjKbYgBGw3tLovvnGdNMJS9Jw0rYce22/bdDvna34fu7ObulezG+kNLAIpKXBMMu2dZmuvUN8uIVDPBK9/tfZtXSEMdiUyfHPm9+yNRIJPQIp9jeL9xBFcI6IDc5pAhAHw3mvptzssOhwfmxteDHVMRn76Pc4kK7yUWtPCO472wSb3zbk4d2Fjl6wkAKIwjRuDtHxbQfPR3HRm9wN+UTd+bRDDXRh4qjCBN2eK4Pa6ZaMN+QiE0GAv2wrguoMPXDz5E1Mjy1m2SHPs"
               );
  FUN_1400bc640(param_1,
                "YVHslLfU+sjwZ53viY4QTuDqpxqXwHcpCLbiIjp3SJdE8esQTURIhERVggA6EgQeVZiBedL6nO/o1yfFqbvJm+J9XwVOX1IHjZ9Bf/i4fGH6XHdgf5UN7WtoX4w432vagHsXTOR428+xF9NZKE9+0y8ljn7wFB51SunwbjphJc/L/Z5MW/Zc3c5G0/SrPRD6E/k6nwaqAeG6J3I3YpiBx2UJ23FoG8pUKSFFDjJggRgYAL0jAVESIRvIRVRiNs1hykS0BCH7gtmXNW7BpRdWkQ17PkLpXol/bM/G3agKoEKPrB4op4JAMJOKiXkcbr+k1+Sh9IbyXwi+zGdobJXjG6Lyy8uU6XIHcTvINBO92qKQnichNIdBvvJx/f2vdsXMnX8/z/63/fZeDtNC"
               );
  FUN_1400bc640(param_1,
                "rbdKo+x1zKXHwMb5uem5OSjndf1lIgrusxW5H5V+D6ztdo5Dqcyhh6VIZ90Sd0Pua/LhVwMqRysuVXjnbl80YgANyMFB7ZZ2MKEhitRiBHkSBAJ3GXGAFQdYCAgqckt25ekcx0zy8lzcnJF3MZwUyRmOqdvMjU9nj2lRBPasZYsjXchYR01Aqhmh7E1CECaZWkQwkFTcldDAkNiy/+jq3CJxJbmlO4o7x+LPpt2N6jRhx4DSn5Jag+lDpHJ1l3PkrGMo7aWuMweAj1fV3B7nwXzdoebUTLVMMjttX6bIS5vZeY1ArcNknn0vcql8wAJXATZtEKR4wEIPEMQLw7IYC6IwAGsYLxRwSXhMG3NGCNfXz60QJ5rsDJ0nUhBIYGqntb6nQis+NONH4ZY6"
               );
  FUN_1400bc640(param_1,
                "KojT4TTeJMOVrEyEtamZvar36fJ/MszkXqMnO9fNUeD9WpbUGD/T088SENKx8ZTriAqd6JVqqcNeN/VrDiFD7XsqXLphfleBfosCv8PS5zlH5VyNI0g5tnoPOvzmBw/s1ysJijl3593b/I6TrN1z/gX3n1Xj8d7yHpk5xQRu0y3gf+AVIH25fHp3BBHF/KJ0TbEeq6MXSc/Z7NU4nA9zv5VKgsWHDeUfnqWJ0Kn0x63Iw5rcehqgqCW+5Tu7E5XmiKa0HryZC+v0ZIAAXVZyAoBkcAjkafOMfjzilHCJdidyMbue7wMPE/JkgKqPwe2h/pzIhfL+Pg+R6fr1JDrc+RZf+c/pb2NYmC2Vl/S/za8R2wVJnF0f1+j1NgPS8X+WVDDGGr3yAEIyBkgK"
               );
  FUN_1400bc640(param_1,
                "0YhEoEiKEoXrUpRuSf4LG8uBjzEUBEBodt3k/Rzum/8DtNf93IxvbK+e/f/xQ9hM9C/5lVET1eAN5HtWl9mv2opeRH3V4oByLghfZ8O898nxtnqmAfBqzmQACFm+0hcGs8IZHYaFSCJV6VWlg55gj4l3TIV+a/YcX81qIKPBqj/0zwnqAjz6snMbpmAsq/Vhj9d+OUXYn0hiGt1xAAHFGIBJoxDGAc0f2dlJpcNvXtV9tyjcWvu+1XPki4d8i4ZWnv6qcV6RMtqX9PfuxUI8ce840cT7URNEgdtEjfrpAgANiMAFnJzK251kVAhsY5g7n2mtHYW6y6S+LPT31gxnnuYblv3ykhOiob5KMUzKbDgkkpZGCBCFFDAUb1Ti4Jzy67n9Rx9dXSNco73p"
               );
  FUN_1400bc640(param_1,
                "xlq220gduR9adLUSSttRZlSTCWHAjjRh4RhJ2RAAAu6x5U0zUSqnbfN7T4rI0Vp/baw6uhS7Fca1G2Z+uQNJwJM2tdlOU5G9iXOeGQFkNVGAgBLHhDF3xg5I+97GjtlpcH0Jab42YluSkebl6PGe8iZ047UnybcwYU4G1OSNwVOx+buY/sgDXkrpc1GC8MAECHTtsj1/jW8tX7yQapqGRF1X18v0KSIxAIDx4VehksDa3YlPBGoP5sm51xaf6m4ocY0DhDEIBGniHpySGUZHz4Q35ZCrSMQhGu7ICUluSSWIwgQALpWjizE50cKoRRIBAFCvr9QTwWPoktQBiEDv6vvePT42g2me9Or6T8jv6uZ+BU/1Y6BiOWYH0fLgSPRYaNiSR7ZpBqOxgQuP"
               );
  FUN_1400bc640(param_1,
                "YIlghCN20BRpatiXINJGS0JR5kAhWGgS7RggvNAf3s6tr02CD5jAEcbso6tt/VfEYl7DAPnWPhT09eZ92iQZNnlfrbP7/6njcC0kBtZ/dTuMUge0/dImCnqchj85QAALB/vida96ha6uVf/mueKxKKj1mFBFZUYAD+MTgSkVPx62FTceXM6sdN4v1fmg6eJ3JPgy5DWspy1pCwCFJWO0Won5K0bo/2v7RpJ3lrm9Hc6/+6eD1IjlWKGAgyZqo+HUnOmi+VtinFrTTjeQrzEE8PfR3hT6jDLbTg5rvaWamWGvsd90mnF6JdiHshgITr4WHjam8vJtn7JpwaUwfVumi9cNtJaMwdQejxPMxY0F0ra69g0EAtxiAS1wYihePkl0Vy71iFJfR+6/FUcv"
               );
  FUN_1400bc640(param_1,
                "88ZWy8adkJBcVbPd/lGbL9aSwEAF1No69zsuE5eO/Y/djNvxSPgne+peUFb/SdN+tN/XDR6Pm7foGqXyNDeO6xETvX/hhfGAAX+OfqqHs71as+ovM2FjONHlbKVL5eq/yfo15JCTt16LR9+svwnGrNJk6ZyUwOGGIQqHYYHedZGUpNzX63FzPBoqT8iMct0k1FfD7e1iu04V5Qnnv13FjbR+yvtAJ3S8z5u4+K3AURcQg1SlCc0Nl22cl3HS8oPjKw1Vs1wugLM5CbWc6XwQ5/fJNdILvNLB0phyJdg8zMQmACmaz81NLw1ZFUMRcYf6bplZnMHdNnp8LJ34xqRV6qFFfubW6k9RdHAJYP5bIFhzkosJZGIQezX/pg/HHmvfzOUqeb7YXYyDnaZr"
               );
  FUN_1400bc640(param_1,
                "6s+jBRdAvnbfzVLwUXZNX9LpMvLe5GIoYAAtsgalnJb5JPexKVJq7zedLn227M+/1Pq2itl8KpOaHofZSnFgrs+9+0YmIAA9WfFm6NHyvDFZrl81aacFqOivfQc4mfAmYGaW2+Q++tUP/936/vzpkQgxpNDi0imqzo2MeqPVtDeFGnv/S9+EhhlmNfIvxiEBi3z4Zkq1Cv447P6esshy5N3b3NV6cQu6QH4AJUWjX9SnMUD0nm7D945qd8TtTuMhzyv7UFQj7HFOvNw7qRQeaqQ6T3YJePYKU6xZ7pZL84voKgIMP3Z9R4TmekOQ3b07MQckzKcpHYxydOn/RuYgcFOQzZmw2i2srbeGogEGZYzVkvSxjz1Gow25sEmqt2/e9mVuhgAK1r70z5j3"
               );
  FUN_1400bc640(param_1,
                "On6sy/ODX24nvszcsV6SHn5pMAFzOw5Vng4b9QlZP0s/p4v4nt8YR71Rmj0AEEcgu05A9FK+lzz/noIpuCzjpRIBC1DsxNfqmma6QRDSPq5UkJHGACjmQgQCSdH63FnilWbfkQmIkEhADrFq5JUHFjAE8Yg4IxCB6Y3P6tUAVEArdx9BKpuHr7GqkVEIVkjEBWKpEyMNGfIAApoH8IsJTe4sAhaH+qtCmY60sLLGIQSb51ZIvWlRAVGIAaRg95bo3/Q3fEayefQaxmqQIBdS0djvLYSqwiECAS7YOxL08zK2BMBCBWuG1foSgX1lqXxMQgBcco8thSEIWEIRwkRhJCel4lCDEAuh7vO+vQv+J5Xdfaq8qqF+mwR3bQj7z6JiEdwxAvRYlv/PgBJf"
               );
  FUN_1400bc640(param_1,
                "cYj6DBHGtIEfy4f9EiMRoELZ+tHzGINc478xUT2xz/QYLDEAvlCYfDycvF7r8YABBHXd9Z0Jx4POXNRgABYTU4uExPAw64wEIItZbLuwKAABr0mAi5dZpOX+uAaaYxAJatFZoLFPgfXvYRClXgEaY6sYhAd7H90xOYGz6DqSbRrYwAQdHvTFyd/naFowYALL+Gvbrcl17q5MvdDBNnY2xkBCDnr+McOqwZLAIVmOKHljoRiAVpT3tGTLva4a32gVASlsa+hWTHz4RcRRvTyQAhjEALVmR6HWPu+T3ysWNGJECEHhv8vJcOCV7gxCChmNBfzOy9uDii+jdmwgAG/D5JO4bKPB9sKhQZtpVVsSBYGAhQWPu4u0hSu1+3/P/IL7jtFLswaDb/dYEgAA"
               );
  FUN_1400bc640(param_1,
                "Kwm83xw0fDxk609S5G1jfB6hnIT7V04YmIQGaeo8cx14OhWTEb0MGG1a4q4jOLUgBACAy9mS7rU51pcJHYeyt9vDKs35fONdqDQTo9zeyF1Yk7g4EABUZCV8Pjv+bInSh7NBKnMUkyHIX9c6omjF0RaPhXx+f71tsFwwtDAWQP38shmGIAkO4E0mXaj4ZXW+jCtf43+jBeEm3m+Im4G5VhGIV2pvErI4uOutaTxPfmMbr2S9KdRsuZ4n06qH1nwwHZXHckAgJ+FASFvLdURRwjSMRgiz9UM62nRpXDX2z3cr8MB1n0pHw4q0yIJQA8YxAHCrKVcXSXgo4HUYGioNpL1ltSneKF85Vot9qG19/kUxN2jC0DYNZ/4JchOiiBeIYhB88z07CtsG3B9L"
               );
  FUN_1400bc640(param_1,
                "Hf2EP5uaY06m2dqS03knd6XrQv+46DL9BO1I1J48LypfgSxXewMeSsVYh6GAC3772DzAeOTst8h0Ws3JOXSszKj65NW3IymPTV/kRFYkK8oykHnTWfaY1LKF3oYKPnIAQZQwDBsUZrmfPT3ShwnhKR/7Q8nMUP9zog3wPaTQKnQs9q8FPObSUmTRVihpvIUD7jAHUYhAjyHkhHZIPL0/x7p1Z044N0lO1+dCUTRDb9zN7CG9Q/+ia79NTi1Jul4LL7YmRBvaTmJOSMwNBunokIA3vpmnXZ9bpsGYhW2rSVn9co+K+kK0+T5O2LK31juUVYcI+1xe52jrSdF6PTtecY4xXgwEAGdDHZVltw4Banden3U/Z1tqh6bfPeVYOX5X21E0JEzbRl5Rbhp1"
               );
  FUN_1400bc640(param_1,
                "/DGIBOfwWes8+q/T0x+0NJXrcIxuZFqm35QktpFEfVQbER/QMRv6Kwq++vi0jiGxrf9UkIA1xVs00q47bJDSOZs+PoOOq/plfYuNx20CUXyK64Ik4IhnGBMYhC4so+6974kxCcrkbxlpOh5NzRYDIynvcPamtdCk7q4HUJgIAUpFM4Zrlb9TP+kqarC/MJlEfllEkJRJ2RdH43K8ZMOiMQTmvd/I61PHhDvEYWLvVMelMvdXUTDPr/YGpScXML6l+OMAF5aj+ThvDl1WI6ij011sylT8HQCACrXsFqT8kcTaLgsYcuCQAhTPQ0YHBfyoY1eoEgPFSNxfdfOrSDjuL+XIIx2kjvvjQdgwSX2mIF0PrwLN+RAgAEEkMQgABCPxgACAQgq98/33hkj3"
               );
  FUN_1400bc640(param_1,
                "Mg22ixUyJrladrjsU+MQgC5nXfwUSRl9jz3KehUc+0g8ixoJ9VoS/48H0Y7D/rYau9Z8D047RiDzgwbhYN+J19xZu8h50On0jN4OGGAAGDUV/2lrSDTeuYDP7hPJr0qFYnMwCGMQCCypeQzUQZ3x+1y+V27PPfgQXqeT80X66chZNBLMRDw/tRLJ1xHttSxL0jABBE07ZkQ0gwwPGjrqEqzcOnA59TKHjyVxOaymhXHI92oTab092cVYpn+hTYQCBrRlvj573mTEAtLdzo+c44Dp75Pdn0NscznS58baY+BQEAIAIZZ6a+XEULXAT+zRY9W6UWTSIPi7jn6W9p8bSdrfFYW+lSAhvlxXapSyuQikBO9ogBCCyOULRwOBuWjvy+JlOOyxY+7vzc7Y"
               );
  FUN_1400bc640(param_1,
                "lf+9qPZSoexpbf5uq6VQoug0TWp4z0hsXJKiAQMxMryt451LfcGuV96c3aOHrtEns1EmdY/8+ML1m2kkXGidNthqR3dG566Qc/rqYuDuMBCEdQO8of3MMyv4W9Q0+nQUfU6tid200nJVbD83leVPRTeH9GW4cZUm3miQeJPPKEw3CRYIBSrGJ5GACDfvis9St3EbuOsMPunOOkqxY6KHQrnOUfvlpr0rGkl3vj+k/zVBu3SGrq3kifh1kaNT/5OS/Tf5jQ++KvKEM5nQgAAc/0Tu+H8TSv41Vu2VIeLaSi7JTK7Aq1O7UZUjaEuWOeOv3wS0W4eU7lTnaWLz+zzwJ1redUknpvIKHqg2/8XnhzQxCAUQ7kiDL+zadjwT3oMvTcidDNF/nm4/wte/"
               );
  FUN_1400bc640(param_1,
                "8YfeNPQXYfruHjsnL+nqRxUVKnUDXJiPgn7s+ty2eflsh3TKL3uz7XrOzsGf3kBjDEAhGFyiskM/IyHjwoUY15eJ9XbzZ8st7f812YqvylWaHfYx/er6Je2yJXiNBtXVaqlqPfoXShySnL292sekFl9lB40vzqq1TjhW+HofjcoACANL7zsc0I8nwmfglofCxp7eSv63MnHaH7dWCDm5TgQrkcveBbPV/tXmMrgeeZzuczGKXwa/mTtVp4fqoj+C+jXX3RstKpthqzHmwcba1Kik584dmbhv5e5zlGdLDgU4lDjEIAB6unn+0SWbQ7hAQH68qisXXvKcPrs8eYTtGWpFU8hEQOxRdU+v+BxX5K+9l5sb16yBSfg0Gj5KNLM6Mx56GmbylC3J2/w9"
               );
  FUN_1400bc640(param_1,
                "ME+FAvUX535PXt5HuuyMkYgELX8Ruhbbxm6QUr2+3cOipZRpf1sbWb73JEYZedCbmUDb9/WeeR+tizQZ6aXNI6L1dhNOlVPny+uJ0mOm2m/OOckzMFpWhKCuuwddKSXQ9rTc+HTnd/0eZkshrXXfP8UifFCqBmfbo97wlRBzhgACDNYlpUKN/cZS3lm9CcpVG4V0o59ab01JPVq7hdabVHLcK/gtElAV+z9NTD+fMhPpxAdOby1ZJSToLH10ewipGVltXpnlUkP3P2i2b657XSR1ytE/NvIRg0RB9E+skKYGGSMAABMETcu8EktETMMUE5GqD6n/pK3Gz1mqsX1zvuv6+3tYQ+2WNIZFzH5Dg81Mwdt+wXXlepcz51lOjcC+PuarhyJHP1o/cRNQ"
               );
  FUN_1400bc640(param_1,
                "fIZXgLXWWmYzL5THIdmI8cZw4A0N6YiIH0RiEIQu3wepj9OJKPO3l1aw7TW7sU6t2G9TkTC76buLf76RiHkN5hvKDrJlAXelruYdXxlGs3+uVanG/mAafhgNdPdvcWp/niTklE+MOxqerInueitxRLTG5rmLW7QwlKf0PpMDtm1xISOMQpkYgAQpg4Be5/sPIAz5qDmFqpe8iFsE3EgIpXW/c1JczD9/FSreC9MSp3O/5332LfrrH3O10xmE+axfi6cerPLpovlV+8/A0zloebDcN7g0T+yUMfv0m51HndHdCqTRZh4P+KE58YA+jAHsYAIBB4kLV5O9n97VninIc3yw/beMy2Q87ez4XH6KcrMjv2/VJnJc7Xv17wz/qsHXHTcZ11Hcrm4slDDz"
               );
  FUN_1400bc640(param_1,
                "pqTkLrZ8ugJ2hzaeXqaMptKyT9ryy82rgbwoVmvTfdFM2CVLqDNx6HrUrLLHeIXp4srmrF2TvGn1/6zjI6FiLmgrwRCQbzpf5OK/c2IFQ031J1h2dy2lY4MLzN/FGJWXZpJKIDXBGScfIOzC0beofJe9zXOXyaP9jcyh2KZPnnyfUdzz79+b+uzK6+b0/k/lM64OPl69+Lg6/bP+Twn2/V593T4IgX/qyK5H5QhASDqlhtXhRWQN3D/w0aIr9PPzVDdcSceAX+lkhwGuOCUorCBA8VrIgdgh0UvmJn3lQnkCgIGAkouwUgfM0fAjZ81NE7/QqzdRMv317yZCO4j5L8nK+pgF/r+QsXulfDy6T6F/K4tLUkNsduNM/1FNevHAPTf+3Nc/5/l4vj+E"
               );
  FUN_1400bc640(param_1,
                "/1+Xjh7ugAPH4uSrcXZ4WarwrNul8jn+aWfwLxBHL+q3vC5EqbwvmPkKUR8j3Pw3vl5PnsvbFldt+Of6XHweK+l8qAvoz/N9NAHyR8ONVlf3Jp3eB76na4XCm3Z9LAoWrGfgrofYcP5bPs4cerVk3qKNNuY/KoRmWMDMz9vC6/qp6q5Dzjt6yhLdx4vRRS7FTmqZTs0izDIoNg5u0pXQei6aLFZs7HiUsk/X7bE9Go4eNZmzc8K9JtHX+O4ev0Wa/Kl/uM+rn05fpeLJ8766fFJr/56Xq8CXv8uPGBfUL9ShRhiO8yZi93rpurGw9b63z8Tje3wfoX0ZcRe2mHhYdVcPSzd86ktBmQol/UXhHuQ/gQ7uxBgvnFw22/2HvdMWFnVU+Rz8Lg5BmShA"
               );
  FUN_1400bc640(param_1,
                "ciCYnHhfdM0YhxhEV9eODCyfSJ+yMU/4hZ/vyLOtmUC/fGD5ZH4VEM21mImU4Tww6zP9JJU66i+b8K9tV5X/U8+b+cr1D4r9dxr332TXbn5DvfdtO73PIaabtSPGZd/ZhHGtIADz2ID/8XckU4UJDZcL/fA="
               );
  return;
}



void FUN_1400c1090(undefined8 param_1)

{
  FUN_1400bc640(param_1,
                "c4aeUs4aDAABCWmgzMUFZJlNZcR5oEgA4L//////////////////sbAISAFABCBJ////////////////gMH74KSvpgaGqoFNrSU1VJTSUhSipEqVKKpUApVURFKARgOepQAAAI1voCgG67pAYtBMtQ7Gd1w3O6CQKAFHbAAAAwQAAAAAAGqoAFCERNAAjAQZGAjTEaaGmmjQGhk000ANAGgAEwEMmRpkyaMhppoEZGphT9RkxRiZMmhjUKpgBMmRppo0yNAAZDTRoNAAAEYjKaTaBRPU9qeie1U8jFMnojQHqAAADI0ABkAABkOqfmQ0YjTE1Nk0yZDTRqegRpPQaNJsUzRPSegaMpgZMp5DUyTZPU0TNBqaaAaaaMgNNAAAAAAAankCTRCanqYk0"
               );
  FUN_1400bc640(param_1,
                "8VH6kaPUaMg0BpoGgAAAAaAAAGgGgAAAADTQAAABoAAaYiCI0CaEih+U9FPZUB+pPU9EGmgAAADQAAAAGQAAAAAAAAAAAAAEmpETSZI1MAAaEE9Jg2iE8jJoh6JtFPKep6aajyaNT0DJkaajZMjRGRjSeo9TIMgA0GmRkeoaaNkanppkI64CHYYoixzhCTqkFKDIzZ103q3HM21oY2ksNtlmvXobFsOwqSQ2yBOqSEJA914dQJoYCga7NdAITz9nRIQ3CQhMWQJTJs+iqQukCXaEk4rCBZkkswFkN/VGsmZWYJIb9kIYIu2xz3vaqKaSTioQCmLkhRfGxS2qhSotQJ1LJA8hgGTAukMSCbi6BIKpUplvzre7uSCfc/Jjx15tZh6pcS2xoZUuIkZd"
               );
  FUN_1400bc640(param_1,
                "vahjGDKRGFOBRApgWbJLXQpH5VUyHUpITfMhrMgSXYAkDJg9qy2CzCCyGWIPBQyAI7Dum6N/V9dJF6ZGQ0UAiRdomhI0CWSJqIiSJkICCRZFjTVXpYk3DDJhioGWGZDBMNDVxRODyLoUYuZxcIW1RT/27ezh7W2vTxNxbwXVHagupz1jKLDwRm+axogc52bVjm472+usZcwd+aAMiKqqYCbIKih5+3qX27PN6nLO7otxA5mOBRi2Gymw0oo3lGn1kSURxNyEcFVxmfzuGGFcoDwdPqtgKOcWd1xSoCN5ghbCpezLUFRa2lZIGdAwERMaqzixZKZs0gpTuUpLOWV7ahqY2hdwSgM//tFXvoi3S1Nrso9OrmFaOBsXvmQhu+t7Lm8u3M0Zg08Xrbaz"
               );
  FUN_1400bc640(param_1,
                "NhCE6VCBDFJIBSSCgQ4XSVp7OiEN6hITOJIbxJVs/CvA3ze/XWJT46S+W6LBFwc+tVmBumSKcDNXuLdjbKmoKAKIAOpVOcSSIFtZQNrCwciZcNKgsIfR7irgLVUNA6MKIXQL2qFFZrAbK9MYGdhFgLFWAsDCY0BdlqqJERBBsme0sm3QuSxFIwcKsSkFkFVS+ipZgpFKQCyF80HZVUHKrmGaxz6qiCCKIJIyDCSTOKkMIJJS1BY3oSZksMC2MjWegrBJjakC3y6hYucNlVwrXgSQcnPegICGUABEIwlvtIvHFQBh3/skCxB51NLZQZgKJQmo2jZwasILKZVRHMkGlJ5LxW8pDi58vMmQ/KQ838LmBolAzorkkLLuh0YlMMAUENKQwSSmKSLIsEYU"
               );
  FUN_1400bc640(param_1,
                "0gKKtqKgsRGLFppVZFEYxigKit2gTCwaUsS+e1rmjLIcjC2GORYFmKIyhoVVF1bW8zNKzAY0/MsWjaiCCwVUQVSMiJjhWDL+92mF7qbqqQY3KLu+TtcKiqpLuON5il7YVZfEh74WCRTQZpEoMiETHV4DFEBmBQMWRUElsK6Zl1xYOFrYViy0cGknuLUiwUFkhZgQpFBYUk29s5Y2rAsyClIA3ureGPICIFrkH216e3HFcJkXsxEruenjsZAaED284EaGB4CGKBCBFqpKv4P+b+EWR9JBAcTGUYy4yG+Wd34VazmOXm7uqzF5FHtD+N69WjtJtPy9UAM9tN9zBuFDWtfeVgsMKMLTOnkXol9pztGU5iXTrX2fven0MVy40sN7jWwQR28vxKd3f5zG"
               );
  FUN_1400bc640(param_1,
                "94Ff3Os9kQucMVydMdIndLXqhLCLjl+xv5Ccj1JHUPl8Z+d9z9rCAX+ug30F/g/b7DPa6YM1uJaG3S+p4ljvnDk4994GHu3t033U1A/CzE5teo7tk+Nw+daadxX5vJro0PayrivB6FYfzcc6a809xWvat+ywnq177p+F+nfzwArk0Q6RELplPWOO6t0ICiO7uiYSMJFBAZHmHO2wsl3Do6JJDumRYAoHmslMgoSChIEWSGphXS/c19Th4H93qeHb1Xw/xbj/y8hxve/J9i51ne9Jb1X4E+s/u59fB9tYew9L0WPVH0MOfRhvNu6/r3jxy8mzDJ8mKJHt1y2r4mBIGowkkmdhyvO8q34PG3WzvNVM/vq/b/7/FjdzdFay+unj7x31Nx3fEfLTQtYe"
               );
  FUN_1400bc640(param_1,
                "PNPVFHLR84VyMs2iACYEGwwAFgEBYEFhAWBWtydf7eAe8+hXecjdoTA8fvPDpgHl7T1yMhWCkodTXWmqsW0MEG8xEPISSZJ6eXY9n62PrHib7lcnuur1dtqluhtdPIzW0bbb21MNw2rQ56udJjr2nvHC+WpMjDC769oE6NkWBP7WnpdGG54OXXJmO/cxuS8RAYqqkcjVWY6mel7b6jxWQIIkgREAcSALEkZ/y17+zNkDsdJCyghlTIlwQSfWy7mNGGyqGlAAUJCLDzs1b/X4Fv3Xv0MU1ei07LZ8WLGSFeRa0jgbEkNSmGV2KBAB32dWOWuWGyn6b1163DupijLYJmUyIktbvjqr94+me4ydiFcYYYWotJAksYZmcsDrNQ8lzol4lAAcpjy66evn"
               );
  FUN_1400bc640(param_1,
                "Tfv8e1URvPM3rY6lT4k/m5ZLjkGdFERsR4jGhjXuzwnBjFTQ/KpQYJI14cZk+Svg9JjWULEQOBGsouMImjgjUlackNWIiI6EswwOouGH3ysdZ09RANkdRbT1jZzMvMLp5QhDgp7bxtYRS4GCA4TcO7bstp1PKyubkMm8sMiWhEfMEKbu9/XGrHvabMCZwWdybsuruielqLcJFuijWafBG08fHjn1XlchsZZGggW36xAmOI+d8n6qRMzh3KSZIlHeIDA+wkIHt3UHI2IzODz2CvBBtqQnC0LkonI8lgmIEYNSlnpNgakkblk9tdMhBXvaiDSu0aTxLomxoTLq7EQyrLr+mhUd1cHJ1CnU+Bbp4Y5GazaBukIl5Gm0iVNCQS9KG6rUdaXHHKQmteN9"
               );
  FUN_1400bc640(param_1,
                "2Iwsr47drevV4QO3KCNcRYWSG07JhtiCZYWjvlKOB08leqxQwYnXk+JG1b3ffGS6Kw1aU2QzKQfSp0OxNrO5JQslKoxjaWL64LmyHcYow1MOCRwnVMmps1TDDxjWsLI6KDJJ30IDuFA5q9nMWpU3By1NPlbvaFLlcqZA9ccuzYLXh9Saq7ARRbNnG8jVeiwL9tqnwJTSzY6ueSEkUQjxSBqX1mbyjG3b067s2yCeSGcPhwVhbfcvWU3Qe3AXIzl2Gy9Dmat+9c4yZLtR2boD4mXBWpudvKuNnF9cz3G4Jt6wgQO7ZUcrem1dOCXuUBGeitPapXlo32y2tipmy1py6fYXcDabRwOMO51UN0xv5xSL20kZvJYEjaml3yyw9TBaznMm6GKko2naqq7z"
               );
  FUN_1400bc640(param_1,
                "KtHJDMeCmY62yxNi+5TpzVTcp8imOhCLN+PLwzQyo5HG8imkHz9sa6SbLdT6aMPNrTMYtwTk1vQRxhstYI43s1lIHBm+HC7JY4XbzvKY2GdrptC9PyF5duza0KIRES+m5O8XaQn3ZqXIJFJmpiUBseIFGZBjXUZRNjJRK61ceFUoWWDud3RI7THPOWQUbnW66WQYPAaKN2dbDlVENN6cu5AfAMAMQCiYIgrArN3oKoZE35b/NVamFjVuTLOmreodCUpMyiaS0KIxdC5kqzdpxM0pCRcWYQKUYery0eXNsgnJuybLVdwMGAZJdBDBENCpnZWYpNN45Der1x79r60rm7W1U6JrnInklErZNopGyu6LIBp2YhFMuv1Yu5mmUaK8+9l5UY4ubI3HS9XJ"
               );
  FUN_1400bc640(param_1,
                "jGmOdkKNooMrs+pMllkFUqiN2Hd0ciChVGeKRNVoZPUrJAoh96Gj0ealtdXyItjNpJGSmoF0xLRMS9sSgyVCeegzkcLQ/Y6TnMYzh+NBETI0viFk80o5MLKaTEtO7WojNmZiEaIxeYFU8weJVu5Y7DCzwEwBtXp8w9sFDjQvQcg7btaAT1V0xYA0ELNkEUDTRg3d7W82MEl8s4HdWLwL2EplaHLBiw5eep06KRvYyw++c8IYSNNeuCZIB0IZexCMDXDQyZBntVRNZR2UXdFNIpi2WAzEHlO8ycFSwLtsvMnVQzzeHuodEjOFBvAXGbkRsU5uLuCnaUrzCaynNrNqVsroVyXYUDIJJO8jJ9bIU2tMkt7nfwrUigbpNhXctyhqQWheZaCSxbat6tJe"
               );
  FUN_1400bc640(param_1,
                "SNLs0szBbUJo3l5qjZxJ7tW7wVAZjpM60qF/C2TFkCkYS9tIdh0WHNmZ3nJjffm+08LcrKZzOFMOTrJnQ3T/CkXe5J5ILQFj6TG1W1NjRlhEYM6zaQilMzF1IZVNmKTbQQe9TSl1oQplZGXYirg7iGYaNN3NVLWxznssO70lA0P7OJYW8FRqSc9zZpYIaKM7X2qfutriQbILgWwgkYSUrXR1PctGdGzRCnDM8PGs1RvPKt1VPNbxi7BIQsUNZlmyXYn2a650znBKU6tcjQrbMyzw2Q0dYDUiuju2HYLAmERFdjUbJp0NZFGb5Nz9ihzlsxfEKkNeqi1lWMMLFqy+DCqixR8JZa3HBOpvYdeCJtWHo1J6NjZLeib+a48JkbuqRYwPKsEa2szSiVnm"
               );
  FUN_1400bc640(param_1,
                "mMpUQJLvqbcXHbTVOayh7Pdoy6LeZ6DU7kkLwzFduaYNronWCVUptaUKWA6lEVK44cQRvlVqa628rYynO6tpijW144Da7SwVbVdRADb0O9xOk7iMmXopE2gxu4veZBscsK6lreRu1phAJHukEQaOcJxcVLXTiIgI2DEayOK7uUL2tBfbhDJmr+hre1rBdW3x5OcmFBJ9DDeUBRfocG+GoTxdOS9zdqzdKa9xMYrkYjQi3cqIYSweycAmqqZUYb6zx342lG0oX6Knvcu0U5fC6HHSORg7HZsteRUPo6OOopxeWEU8OLto8a6VWJAvDkNRF5ROEueF0+K6Z70ss9Hs5DpCN9bYyl9eL47zsp9lb+Vs5zZGMMMnhITxwwu4Qc235z3PJAZjvrTt0vrv"
               );
  FUN_1400bc640(param_1,
                "xk7efp2XoWIWB0cvcXyOD0sEOZGY3dXpJQ3ay0fVpuMqw7+VMWpwFK2c8lGFQukJE6WkSaaLDeRZdTJGLqbob+LDgmsKFWMTpKomoCYkEzHCmDElxId8ogfB4tch2iTfESlTU8HUoGxS0LUjM3dmAjjcmbk1hjziiGvcMiR0IM01o/EZ472wOF92y1ilKt3a1aiehEXmrlPvEHNxL3Mg7Un5qCZTId04N10udSNIojUqKRYw7Ugg1UoBooSctB1fAbNhoVjP1fOtON0+SwdEJRdE7u1xFE2CRHfSsAQeCrE+fhbtULmzcBOmUdVgdKkgVNmtJfVBAUVhtEHE6TzdJd1UzOzsNDtaZXTlI3VsxYnBy1F99Ok+qkhZ0kOc7tSKkwpYmb6xLJGh0NuV"
               );
  FUN_1400bc640(param_1,
                "rRI2FlPYqGjD+zMCuiUqxsVKR0UasIw1NSSnq29zw0RamWtqxfK2u6vgqUHkFMePmnw0aYuLyxoQywTZCtdWKsObW13FpVjBvNLhI2SMFbX3+5RnlnKzho4+k0bo7oVPMu5DgUSg0rLhU2gkzs0iiIAmdxYOOAqTkRT35ubOjCNGoEQlkVA25RhxE2rI6s1MEDriOz1yasemG91xHQ7LxE/9834f/PW22uncVvOr8b9bW3OapCSBt0khA2bAhCblhIBoQkJCmASkCALAJFCCwAm8ZAJ+ZgSScVgSEOcwDaPrsyYaEOtdRD2WEKZZAgbpkCBxGe786oSBPaYSHSoQ0fpVAmTOjYSBdkkJ1G12v//v/K5Xt+H3fk+fyNX4mzoJIEeFRvGEOP1Wy2nA"
               );
  FUN_1400bc640(param_1,
                "5/I4m96vUgE1WAaRkhCLFU07agOow8HW5fac7LgetlqBIENIw6x+R03D9tj0ntsxJCwEAASs9b/x65VOHz1EACIzD5BTuyNU2N4Us9WpmtK/R8qkQEAEGJAaNVRxsq1KfZOMY0BEBEGNQUAhke1ei+vEdglg1s3NpBEQBh+sRRj+5dpHX1CvRyNACj0lebXLKdk/N+6tNaSQFrWynQAAFAFVXYpZa0jFIjTqMRHaSJTOlzP19eu3YSihOpFdI6eJE4gK5F18lMmYupqet0tKlmpVyeNYJNxgo76yf9Yjs1KGAdATF0QJugeHaINFxEtdMzJdAkDoEEL6IX/wQNPbW3PKqOMkDolu19zuRi0A5x6V+3vr613lbmd+u/ibAwbP1JhaPId06VCAAQim"
               );
  FUN_1400bc640(param_1,
                "yf1ex26PAYuX9cclEUwEAF4UjiREY1p8EBECVaqRTHfjPT7SoS1RoAOqyD4LdDuyyheSJdHsDJzPhdLjhFjz2lPJSb2SdUXqg92M6xbX19T9EUJiOU6dAdJQNL8OlIwGiqPdobsltND5IEKlDES8ctvW8BFOMk23Bx5PQaUtlIlmBgC1bIcIShnwnkslyIsJ3uGATe1zVxlowboDoECTYIVOCHdAjkoJ4OI7o8N32kUlhHu+4wveNdX+sI1XANA4B4MB0QJwmzAATTsiUsXy6S5ssgvsexpaZNGVYKHBbCfUzRqiPirlKeckkAStixEBd3h9hNnW77TaVl37U8tu4g/3GdhDeVFqyNkChyjaM5LIKY+lXZ0s0DEkpt6iCOeTkV+NHIaO5YhiX+iT"
               );
  FUN_1400bc640(param_1,
                "SCmvcrjsqskq5lJ/yZi5OAFMjVhZlaiERGX7V4tpRlYuKboeno4cJQFerkfKaHS53oFjFg2vNGOMZ4mkLFGFjrMlQ5nXLeq3MO4FpiPVvcFj7MSDPP76ovEnqCtbLR0vJwcm8+5GPjA4IJj3vXQARggHQwwAyhWuwME/QHVFLpioZwwPhHo2UAwYUVbK9HKHyoYkJOTx4m3eDkdb0HQOCIj3JoNFGfhpsubxzh6g5417vkoQ6xfms1xGMarbhyt7kVeXxi8OWnNSopVDAuyTN3jxpDcdF2EO4ZzJKSP9Flcgw87OWiM6VirwkENz93c11bSz6OK+ezcIRwjAHzhEkbnBW8e0JdmAZgJhNYHwkGyfjVyXxbbL/lzGkBdbc6K1iHkvcNkUEW/tMjcc"
               );
  FUN_1400bc640(param_1,
                "SmDgUwSyrmpzq4IJTvXamEMyg69OZmVgaV2giIoLAVRnjBtzplKj48MA3uj3I6iqrATx4j1XYxV3Xt1ePecYZk6W1bmxpHzPPLIMWMNXFpNSJ6LKpGkIGsAgfibbjp4phe3QNvsQs9A6cNTLrPB6o919JobMq5BMkt1Sxv4kzN2PEqMDpar3TaMZ66RFvwspl2SsVDCC2Bxtar9OHjzZHtEp2C8EHCqO9fXZXloRLe1dY4ETmuoN5GQiID624KHFNG5YS3bhUCSGds60/HHccg0biZhoQAPHIgYgs5SpoqFSCIpTPPhzd+RSQ+wi9/TKahQEvDaKDMnRHjP3dvCBhyKJHuCy7TiVWRsl4pxQ91vBWTZNJizq5l6lQ7iZd8d4YHnhrybbnUOeUWMf"
               );
  FUN_1400bc640(param_1,
                "3zAwbhh9waWq0NUizjrKWAgDyWTRkSVCCABA17VaY2FnEJUiFCAAxo1Q1dANgvDIhmXhm5Id9E7B3YNEeuki9bh8GqYUcx/JKp6xXudPERSQryI5ZuoUfneaYhb9Zw5kLFBGws41FhhFM9bPYHN6blnYUSGOQDpLH+6Or3V5tZcowIQAPxF8c1uTiob5dPHhB0Uuyv4DBSO6YwPA1p0DFwhdnQ6VF/c7+ijzQKmx0bXYrOBt/ifUBCvihdpapjf9+Y5XF6e+M+kFNa490mWJmn1a9bWPXOg/jRPNU3iFWZi/2MsdJlprj3jIAbNR/owf0hl7ZAo6+Ybf+Hgw64oB9nxLos4yB22xRIdf3+v1fd+P3ePc5TBJJJx+T3HI22ABJkk0kARAAWkEAEBK"
               );
  FUN_1400bc640(param_1,
                "GVRbmgnYpt3CcqEkzBmoWVsS5SWAjnkgFC6R45rM4PvhjVk4WdWOHr8LEI/NhAFL3Jeg+Nh0CILeUJVYp/B10FVOWL0jqj+uUlYl3ibiFzjUydaIK11YgtbxEDeWbPPoa7Ru12m9R0GJvEIslNxUAJRe096yLI9/4IVqOygHd8uP70zRFcd++PM+Iiu/fD1WfCtXGdoXV7WdTVZfQ/CYJRgaFtD82dgyyp1boLFGWkrYHYHYq53eqrUGiTs3zBwSW7hGIGkdarSu67ffng4mXe2ebZ2twNKvw7aICRZNq5ase6dV2fBf0iQbEfRB2v1L/O/Lnv9L2v4BlxoUsMSdU4qzVl2+2kC6zxw/QOHoR/oXI89ejfcWmVpmUTMvLQCozYDwanEBb+jUko1c"
               );
  FUN_1400bc640(param_1,
                "g8jJtSWEkq7jmDs0WTwfXkBKCDIUnbRHw3NBuxub8OCvJp7KN1lt+qE8plmJMKmLPGMmKmhKqNEdGJzzBqlWWBzuM+wmxpFiRLT+BBqC5s0hqcCqFfGqowE28icTDUrd2xjqDIdOgVUD0uw5egF3cUjyR11GTRWmCPRWV2ujvzX7xJ68KzZAIzUxCaokApAjYeRiht2V02pHQYQs6fPiDnNPKaGJEUhT79KgdjHAebQqvJk6UvRikuwq+e+HeAHbHSm3E8ruQTQH15ZUhGdDiU6UsKgTkeU8M/5xeHfNsppiRM/xTNeXNEek09miYuxGgETCsmUzk7rwKfTnbEjt0nwQF7yPiK6LgbOOWpCVKN2s/tNTciEa01yuVWphHCqYVDTgxw3+V6y0aSPu"
               );
  FUN_1400bc640(param_1,
                "bm35UWhp0/HTlVXkftV0HVyQDja0iGVjX8aXuCWQoOVtbhG56DDMuJPZmntnn0LvUrKuWnZ1C2NrVDhM3o8jOHPOcuBJ8aEH0pGVQ90/doZiuH22+irko7Eu9ldlvXqjOUpJU9rbtr5L9AfyQ8qDUfmXo7UN9dtGsvi5tpLU8vZueDVn7wDUCzUzwlErU6L3mT56LwV2/HCL7P1u4/JPup8kYCWz8hRyqWY+xspL2d0l/X3ce6fN+z4u3w7chvOyd0F0fdwHy9Gyvmk080cvgkqrRrN7h//W+5Uyt3elVEtdXE9P65Eu5626hAPUQ3Hg/Atk7tDoPo/EoO5QJ4DyvD0WJAO9dBq0BJ3HLoREAEDclEiWUUU4/eXj6loU0unJW1+ietotyiv1FkpC"
               );
  FUN_1400bc640(param_1,
                "WjRODx7IxlqTTQZCLyW+nZhZkxApnNTygaxRdI4VivDuKRwFGFwmVeLFgIaTVU9B3qt9+Cn0J3vO6ZhgjmQxWxfcOV40I25d6NB5w1GyxXfF2ggY457wg/ljsMt3J/MsfZw2S5VeScCysr7QkFriKJvgvDLrWRhjGksU8O6p6e4xdGVAdcXEdoREAApLcRFjEOJl18QptuYtoY9vLOdzR2d9CQeR4jJO+AVSajBAOyJr8umO12FaEstagfcS9l3GNbDihHv/xOVBhoiW2tSMuwQOKqw476spBpYtwZyVz3fekiVga8qIVa4s14dcDTjmtCvDZ/OYgQCNduG1zUvvtty9SkTzMy6EXbq7PBO1Wfh9N6Zb4jU2/lsT5zlInsk7DLLaWDHu7oWgrrtn"
               );
  FUN_1400bc640(param_1,
                "3EEh2dEz35MrLuizFdhUasVW3dT5O2yVZnDrQaQkRPLTyBP9e/q6MGxQ3+Zq9xi7B886TyeGqZHxDWUdM6fGuZcfCbX2SN8YVQzfcgcX0g7TA+agi9HHeW+/nTRCafvbvWRRyv5VlKkAN9KsBDRGyk6fVOsge8w7eA/mrEtPIITJE260NUIvoiRK3P2sXYxOnVF8Pa+kQpSJMqEtLEthQk9fPEkb1feaNbx4DSFmgMGeZ9WntSKeGtpsOwtfDsVWpBX7TH0OORhNhubhLbv3KLXfM09KgeoKJG6tq2NMZV2WlS5fdgTC6/yUCLDxqlKhBCTN3MrSNHgOLifMvG9XGBP/QWSQBC+IAgKmafmCIhTWdaYACLcgAAAIBiY8WkeW+NgplMeNgqaK4Uat"
               );
  FUN_1400bc640(param_1,
                "g/op8AZI4nLzKGswBi+e8iZZh5u31wG30S18l0SW/gcqxA/CJ7x3llSVh1IohFeKaI3EqYB8tSULBKAn6nPrmPlItgsImmOE3aw1DYsoR3NUchaT5iHO4D4a2jWyfzOqWU3CkZkdOA9Lo1DtEih6vRVDPIe+tX2En159UcJlUhV7Mtsn+6OZou+mO0wPRM9Q1/3INrh88tLZZ3r37izoEFfakKJsoL+3i1eFJ4KrgWts53vUg/yodSXSfeBC1euo7Tv7rPVgzjh0n1jw9xMcpOHWWiC2KMiwnIhb+PCNTuljkH5YEZwYupJTPLZ3wvne65tgN0z8VlRZcWJsZFiePlhEjXzKFapGiqJsu+K0NvdIrD3Uvnq0euNOfboKQU6uMYs5Beb8oNx1XRhT"
               );
  FUN_1400bc640(param_1,
                "YRhXI7VONKEIJDLMClGT8h8YTO5mNRwYjpyZlpkMz3Q2Y9pL3eFqeUv71JmhYzWHdgruld3/9W/BB3HsVHnNpBWd/zWmk2k69YCTgPMunks0bTG9gsyetQ+/p/K2Wpr1SZMm2mfpwJtbfYyCkXPzAxCBRkriYfQUAH/BBABY1pQEB0CAOCixTBABj2WIZHs6cw2iwaq7i4Vvo31sou3yY8xU3OTL0U+bX4ziyocxqO0Uk3SLElS7cR4ZuuU6XA56GhUj4zdUJcYGAUqEKtXWHNjFNTkwgmKp4J9kER7B28ZQgIsqkZ6mo5+eHdJmEdvkFYkIFimOXB6KdiONwWUe+RqyQXVZKRPOZVHjp5Ir3pKFe5fNliD4WPejwgxWpmhSBMSEjZWe6ctMM24x"
               );
  FUN_1400bc640(param_1,
                "SRHO01eLLlTJGZh3BQgtipDlvrmfQE5ktmT+qcfUraTPqVPme5cmxQ5GVS5Dgky579to4ypvJUo/UzYYbt218DSTtgYW+N+UWgb2z1p+94CwjN+qFQSb1BiVZsqrj27NaNgQpSme60+39Iv2Eh56jPP607f6mB8/SmaD9H0Ke2V4lOnyM/3Sm8k850n1KcHHPZ9n2ptamYCr4XPl9slrkTS89TX63+JQnlpnFfvhfHA5+R6XZ7vxbn8nK5tvLf1HYQnzWQNXZ1CE7hJ83ua4m+4nG3eO/0S2Ra1xZjYCqOTPx6XR1dZotzLHR0a80mXS5OmwdLcaZx8LSQ0VMsWCfm0NOopu44YeFVTHYJLwNWskAk4iO4OlUJvDD9YZuk9qPgthRo0PIe16512D"
               );
  FUN_1400bc640(param_1,
                "IenbEKqGGzoZVybMDY2Rho0FLOdmpuGA0QeJFTgDpJxmwDyAYRMhquIKLgjvgK1/OXWKh/SFwoYErc5QIbM4umesrukMduPWSeSCWpCYSuV2JSQPVDfCB2wapB7V1QTBKy/gDwloxobSY0hU2F6WCkbmczy9TzTn2s+z+Jj8XVok1nXOmqZLAzHrEdSud2f6+fR+Vi+TMfsi6FZy+W+WVLP9GaW0SOJNbpND4VZ6tpr/z+N7Pd73/jGGw5/x1Nlta6/tq5rA+4hDebfm1YCQy7qt2giIZJAAACYd3KA0+hMfaM3cKFKGTcTCSTg3N1O89gXGlOX+9g5SCrdy2pqINx1F+Gg36bt1F6Qgo8/Kxp3TKaMAGC9CzfM8Gsq0qxMJsJySI+G/LWIiBwJ8"
               );
  FUN_1400bc640(param_1,
                "M5fDbvTq79kydFHuNCMW80+RWhXJHP5VQ7r6NPLdo2YUFHXPfSRQIpaSCMAliDxl0BadUHrZqo6UHYv7lkesMdMo9xPCXsLLloCw2zJcz18DtQ1x7mKBr72h61mBkdlHEm5uCMNloucZpsTsb7b60ymb+JxAO2qk7bMbk9becFLLYyen4PBv3uNHOTBJ8p8XucbQJroQA5jCE9F3vbc+3N3W74i2w/i59BmetfRga85/v+Ys2eH8LfFBF8F2vS7W/tP8e2QUrafTzG2mJ5BCE5dAUyvf8dr6tAbTrAio7X+Us5jyY/JLMM1EeX0/GbhF4NdlnJkk+aybHgZJJVvUy6Wea/18usnqbjHz4OvmT59TvcPHd05YsGrp7ZJ1WiJgLZZhxM/3eZPeKe+r"
               );
  FUN_1400bc640(param_1,
                "lbCjWZjlNPQtskusIzcqnJ6krIt8MGh41PKlmBDdUHuweKP1mKyd1IoINlXbrU0f5kDLIAbZAGz1iiAhUXGPbmiIYZBABnWp+K/g7q5Q1RQm14ms8bHVy6VzDDHU2J/HWrn7yfNc081288ptvDNmcl0eT8jG37aXOzMlFiIKelyJ685vZIdKWrjHxClJmtDtC2CYnl0/PmJYLj+7/Mo4Hmr3e/tQb5NDzUE5PZHAvHQY95xuwC+hMZkZNQnkM9+gerKfR11+5Rork/1MAaS+TnYcW8jpkINXSwvVUUt55Lj8EQ/0IAgATl3QGAnIG6TfhF4KOutKzZwT9GevMS1jHBrInvdi3bwXg0meLqZtppfi4RpurornONJwCNKgYCU2q5mgPVJGhrSM6Da4"
               );
  FUN_1400bc640(param_1,
                "AT6XYzd4hXshl+11cAkFaBgUh5ELfVWKXnZ5dzbdV4BOqRji21oFLpxfVUovOHzr0vqCy9TvN0lQ2+iaQulDPFNBryqlrLacvcVCFjfNv4Kz1YQa4ggDcgiABXkABpCZr6ylG3Ta0IWbTSrPWDYX4aWElVJZClKzO4VfaKVTXJHlfX5yJYqPNWeLgf4zUXUqp4zC4SqGd3ioWs+x60C7o3IlZXZTpAEJMp2nsxJPssLJMD1YhcN7hRDQERB8QDSADLul2KOjPVkExpEXQte0w21VY7/Lmqb8iuUpczdGVa0solkuhZcO2XwAof77FZGy1RzjPnmcOyW5KvHx7qVErHf9NqxbR0unarBhNqA9/rD1rt4huM67svfbnbVRD/qhuzsok5QvDKogAIBX"
               );
  FUN_1400bc640(param_1,
                "E4SAA7bxq7ssc6tfPX86aHf02wb3heCRwcfrvzqA629OhZIS7UIGXl27l68N5SFPE0On0jcPWuNljoSeqR0Y7CtZblLW1BHvnzlNl+5njL2vQSv/7j4HPB5z4c2J5jAs5Ulx++AcE5Lz8OxsjhiXxQryBCIMxBKACK8i2sjV97jHadhjcOa3u+mSszSsKyJsRK/V8NBDPaEpkuJV3ifMOwJubo3eV8INB32Wo3e2FJRbi4HqrpvKTu+z2/LEQXTRiWKmDEPg6nTdje54OUlyT76+/lrcS7Gh7G9T3iTZpm+Sa6h9z/Y1MQBB+QQAKcgCCiiX6m7P8ThnBzPeXVvKCmUr4XajEmTkEKJOy7K65fsaeOcQZVjqOWaNl26bOnJo/ebkWVoeX91gyQh5"
               );
  FUN_1400bc640(param_1,
                "5T2l1aTDov7WEBHzKCjBnygBhBARCftSjS6b+mxDyCYQU8HXZuJqlzJ1+Whvb2YkI9hLCvl/y9Gf+OBWa/NXc2fj4lS00HsWbfg3wMKjQh3XzOOy54J+wvIxgccx59Y2ZmrOcw+pe4SSF6MEhBjkFSQQETr0oDroH6uB0sqZi+7CKE+UWp7/bgTDmY3FNR69njXZUp/0qlzpT2dk3vrj2vPxGM7wwfjns8HSumML75ba2+zmMDy1tOr+B7Zc+bJNDwknpgoAABh708YsYFVa8rTY9LOSa8243cSVu9ceUVQeV6jSl/tFRaGwl1mOrCYbWVScWH+lDRTZm9x3HV9FRfTA+3jTYRoYRBqCCIipIJNR5bO5h+tpERMbinEbB1yUcuwL9ThVd2dBX0ns"
               );
  FUN_1400bc640(param_1,
                "0pr03Ogbw4PraKsaDtfd8XTPxUlDS7FrAauWr3/rWRZ39y7ZACLpFAAEcx5JuZuJHUmIGnC9udMjPp6MZU25OXQ/aWzPUanw0Ok9qKai59pbhxu/1vpaef2vG6LaHeV0PS7/AOT/Tveyv4WVbbfVDjs+0w9pCBxkBZp1GynKusSRdvQ47sTPnVXtO+YQr8pL5VPLPzKe2rLO9noEl7vfC2kbcsh/zpzRQ4vbO5fVg3rujgyEG1OFCLnFEKEgAIunvas92he0yZ/JDgiJcv1fs1sOmTH+im0/0U+DZ3zkAKvM/M382fMuCdJJkmkxLNThRER2CI9W6r6rfttu2WIo/zTuUHz46P7nclGvr0UBR1N/PSKnyNK/4ENlWeDb1U+/TcZUuRk9diaHlhX2"
               );
  FUN_1400bc640(param_1,
                "caCwgAABPLqd07gxJ6kpd5gnj1edvKU87xZMhhVtXSH2ZcBWa6DH+vflxYB8M0l9EK8ICiSWqJtElKysClBiREQREGNusqKY/FPpXNTjo8ZHWPf6VoT23CVKGkb13itHMzhqqwTrTG15VbnGcobS8w1B8ZhW8tDgfU78wM0gbhBBaQQAameh658LOyP/B9SyEVmd3HPBSo9217cmlzMGdwupExg0X55G2sZP1we8gMvKXzEARniCAAcQnY2rJOE8sLE1Tp9dpF48JD0JI2c5zInNpOe3oSF32Uq3mtqn0zLRmAdC2DOepWcJxMjcKGA0KPGSAYWyIACIXOF0y8n12mViqKd44loYEPCKpsVdRc2uN2vPZxlHc0Kb01SB+DHGqJ3t1VR9a9uHiys8"
               );
  FUN_1400bc640(param_1,
                "OuMdPEERDFnr15GZ/dHV22R1oLKgz+Sesr5Xt4iz361UZcbRLuGiuwdn7lMmvzbYmSQT5B1SAADbMYU1mUGAdaVtBvRjUSQMX3PJUaNDYcJlJxpPqSI+ahstWdW1Ma9NZLdE9bGAFWQQAAzHqW9wlkmxpt1nAkMExSR5Vg5nsM4VhKD4pjTRLclG4II7hA+ZAABgNf83CXlT2yb7LjKrUo19SqhOrWUyUfSixmDh2hi+pfY5tK6bUibUXFAG1ndoDQ9ez/sYJ8n6EEQFoeLMS4P27yHi91rTZBKiXg1R71azGU2JY1PentT6VnWem9KcCiPR8g0BEJ6kUTx/wTULrtJSFGH7PCp+PP2MPIgCVjOfJ4j3TfljOigAAOa4xvjbQsL9LFdd6kmy4VqZ"
               );
  FUN_1400bc640(param_1,
                "RqeqFNrV/v/avnEQAy3a7VNOI0IICErtT3TnP5g/opU+5ZSpOx20LzdTmUKUv9ie+nKP3UBQG1IAAPamJeDZ3Mc/eLbqhN7+NvQ3Z4UHivDBBqQREIebPm030+I+AfBqn8pvpufKqNmSLSAHdIDoggA6Pj3sg1xHtuNuhOHWlWldvUPpP5hA0CH1pQEQ7F7LEj+i3QYSGTy97m9x7LhT5mOTuEEHBBCrIAAOavqjPfH+JlH4/IZQ7hzc0R0SCABMNPG7+/AX3CF7wow+sg0JBEeVX2Yv+83iNJygzPtSaZAdpi/aaUKhRCMABCfIEyx7/gt92O4QTxADF+PMYIj5lVjbtjISQ/8kxV7ku+hKG+QRAH5NcihpBopk8y+HyMA0iAgiC6wcVet4/YfG"
               );
  FUN_1400bc640(param_1,
                "8L7fXaO1YQ+Dq12Dy97RAMNz5lpwGeKkJnfNQ26QNRgTc/hokJ3qQOpZIX2Om9G5CdukJ3jAk2GBOKySBzEgcdgG1YQDLrqCAZ9Sp3yBoTtHyvY9T8+0/f1NPuc/s+dUANVgSGwwkJOYkJA9DwehafYZJ5aBPS7ajnJA/vfb6lG1SQz/68r5P3fkcHt8pziOCAN2QRAKy+dMYiE7EI4IF8yKGsQBEJZJ/7C2Ubxozd9bkGCpIIANHk5MOd7Kk6qv4SIfQQCavpoDQAQWc+19z9Ar5UBaMoBbE1iCACuq+zzm5incW11IiiINwjQi5FvGCAhd++4n6Q8Ghal6aP5ze8eyyD+HcKAgEqLB1UPWVVtVSpl9a/e7acA+BAG6IAiD/IyOA3L1ZhAqoznK"
               );
  FUN_1400bc640(param_1,
                "1K84UGfLQALFnwGB9euUMsgiMBluG+66Y0epFu7jXl/a0cOvHetfh4ufiX1nAWv6igIClV0ERXa3VGTyIQSZ6lHAPeRtW+Chqbg+ObpZhgUxBtiALwgAHmcapHf6NpiFGPoLPJv+8l+W+3MDGnfQYiSlALAnaIGIQRAKxfVd2fooNIr03VZb4dvib1X02GpMqWK6kSMsKNNAAAH0Kap7gGobud+Pkq0fn084y92kyqfTdzLw5f2+nLTPbhqpPEF8QQEP1veG8b28A+GKltKY1L3T1vKPBd8nt/M0cMggAbPF8c232rM+cu/DycEJ/L9KFr8kZgHYRYsp1o5bf5TqAfB6igADY50X8NXQeSMbuu2diieY9CviaMzDaFsessVZBnfxPDckFuQYhBAA"
               );
  FUN_1400bc640(param_1,
                "gu5G8s4cjvOsglY9SV+cnbT3jceDyr7ZHkSnXyo6Y4W5M6+KIAAbae+cTsjwn7W/kfRtbC553/hnwZxKkmzMhSeBFFLWkCsJSErJ8oUoEERF0c94U6lFHz2W6rnP1g1Citf+vFNsFM6Ypxa+2WbhwXROjBzzM/NKAiLek3NT5+6qoHDyou+X/HVXbkSvvqbA2dlVxrGqNVRUWpwbDHLr4e9Tng7im4MREDaj3c0aoIIANhtPZzy90xFbd6FePP58mOtpaDYsMlWEW8V6aPPOsL7LPGtpwheVA2MjkKvzzJ0ltulEAF9soFR2J9cvUhbkDaeV1383yCNxdX01WXxX7/XdQ6Hm2p1tKZhFzUpg8Df01lcekkUEWT+KZ5SAIhasEfD2J+H81sC1nMXI"
               );
  FUN_1400bc640(param_1,
                "yJE7SE8DrVZUfzWLu/UQ5mF22vHWVzx9fJQKQJHfQ2NXgHTJ/rMG6IIiLTO43a1Kci3ln6dc+d68PHveXBie2//6V3+rHTHtp3n4bBwgQCCM3ycjWxpCv8FCHsO/Nmb2EDRIAGk8ZAE4ggAzFljpNL+MORuv02t/Gwx2UxfzHIe6YNjk3e9o8qZHxkB4jfZ0PevniCl8RQAhADpIIgGSk/LXrfH5kO5icKY/SWs/X9pczPTv5Kx5f4Y1P60+Kvt0IcMPgcuz16hXa0lsdlMChAIC8mYQQBYQREFGfoMrlTQr+WehbdI5i9iL43+o0vrLK30Hee+jXUTfVIZXlJgeRcagCpSYc0aO15tLtxmhwXnW+k/v8hwBOvSzicoh+JAxSAAjfb1BLShZxoq2"
               );
  FUN_1400bc640(param_1,
                "a5/ySAWLQf8XNrx/KXtXXZPWKeaULEeQ3Moj0CkkUF9aHf1+O/R0Z4PpII1BAAB9Xx6k9TcVMMhI3Tv/RZ3qbCj9izLm2eFS4aH2G0nLt8Tmhq6zHVAf8F7y52QcF7wq+fbwzg89QsplB4AubDT7h88ACKSgtKRrY5/V3pHduszgVO26kEaqaPcD7wMaDM0bWoS+FW79aLE6KeCrRB58TTSG8KvMzjWFuUL0giABay8nHov015B08wzIVKhSJUL6PXVrOzWe72Ynyx4SZy+spk3YyW/OaNDzYCLpPV1fxGD5CVhJ2SUDdcofn+RRAQAxnWVlIhO5szCiVrvnRz8F5e1dBuKW8mb9nyhs9Vcr8DCpZpn0mawc3VW52Hi4b4sxar7nvyVd5/L/mDj+"
               );
  FUN_1400bc640(param_1,
                "rLSr3R6QaIc1C0yTW3McdbzZpwdhBCu5igGwQBPEEAHGToT9LfweyRlQLKSSv9HySI9HxaK+u9uegfSELPc4ofVm3ynwqbQM3caeLszjP4tsRiwPADp6UKPr9NSaOCTEIAAAeaniTsE3lumHfps9fjur7BnXpfJ0YJeRKm0pmtoMxngoMM1P34jHB0XTIkiObQViBX9nfM7qZu5Nm6SWYUgsCBmEjEABG3sT8OwtInIoV47voQ2ej1qAaKMoFFoeJrW0tRa+Hz5XlzniJphVGzJ3cLkbxaPCvV4B8iW20XmpSiIAHR5V2pN9M42TT8BH+HnoMtn2rA+HeUGxT7uvwkSFDt7l7nz17h0KF2c36qqRpT6aB9MC3S9tlD9pv8Z/tXxtXalANPwYxg6B"
               );
  FUN_1400bc640(param_1,
                "OfBKFWQRsSAADMGyW1UyMz9v2u2mV9VemDOus/3a8F+h91SZ5Lz9yUFOB04ugE4dJfysrTX8x/7yMJqyqTYhAsVJQ7CBXkEAAMnpoV1B1+bXpvfNbenfXu5OcNWtoJGTtTk2wZ+j7bE0LH3+rzmsrX/M8linTWQvc71kylIBBh90DDNASEERHyJ5lJcVMd81ZQMmvho8+wcIOBOHvmV/G+waD0YUevQjxPGZtmcgPzfl+pix1OQ+F6k+/az6HDPzVndmBhksiTUZ0YMjqKtVFAYBAAQg/PtdEh98iORAwRaeTn/jecHjDmdE/k79e6p4vVJTdtygW48tDgJgUe9HyeJbOgbeY/ZyqvA8ci8nEdsnU/sUYbrG9TbVOuu7nT6hQnIyIFjMylRvJalE"
               );
  FUN_1400bc640(param_1,
                "bz7VxgCIvbvemg30xO+tWKFoWN87njobGzIzCiFm1kZNMVe00aqoPIFmhzOp376pUP8eSszFiWi2287hKtFepdYRrn0rYzfoRgYSqsNIwB5yBCJHIIgIJylr7O2dDX7Oz0BRiGxYfb4sjuUSBDFAMbjRlibjBu7HQDcYGfpSDOa2V+JHxZtrsdwJZEeX9FRHGnjvp+Gs55jwBCIL/U5Lc0HhKkiHJLPEwG0uAbOEAGBBEA7pAFK+gTTeI3oeh330XKsj7jChn6e3ydjMWx/2ualfbNmrCRhRaFjx3Weopr5u+QYNmmpZi6rq/6GGOE5j2+o0h3pwfUt867Ocp16A65/YrNCJ9CSmNBt9JQqiBccZQGrIIiOzWPcq5fYPDJjWuf+co2E0a4BrVzmW"
               );
  FUN_1400bc640(param_1,
                "cwY8jVFd+Ho/lbe+1jbHZx4sCPVUeXQBxRDPM/Cu05aDt9qiWNzwYL9RVJdDMzUDZqineHJOs/Y+Mn1ZQPSKnS1jwAnIHFOlxyCLWUUAyyCIB4KH4U29wcFdTwkdrDp66jS39upW1E6/V7GMuvm9v9GFlN3ffpNDGy6/w7NTGnD6SIkbubPpxl4hBpbeplKLSwhqZ1ik72ncGB8ClQo9PN6D19Q7eYbD5ihweEvz/eVSQBET9tX/iqRI9pt7+G0UNc2cbNN4uAWX3zcK0k4j55jbezm7uImi+tpjpMJbqN/xl5FHVcdc8j1LG5o6v8M74Q41M41Jtt3ueTnHvr7pRqUkwYFzklCKQT5AoCC9ilEKgghs6XnMERAGYNoLPPa73bQ0SVCUC0+reN+7"
               );
  FUN_1400bc640(param_1,
                "7enL+GvcW+iB9AfZtDyjuZRTyw8YfxrNN1Hl/7i2hLlr7Jqb0+I+OcTDIARiLiQWBaLKSYrFneo0Dt+73DVT4rRB1Tn2F8amFs48Ll6O3vDUbyho2RHXMPZVqkNBYveoG3vEpgh9Cfz/Bbn9okYZ2eVaqn/hvU8FBzIx8bvOe8FY3Y/VzbvtoLNbd5SrkmTfHu4/t++3n9sqGbubaW0anBTuivF2jWbnrVnpCBgaW4TyDAWExCAOZ7KcwBEQ//F3JFOFCQcR5oEg"
               );
  return;
}



void FUN_1400c1370(undefined8 param_1)

{
  FUN_1400bc640(param_1,
                "c4aeUs+6QAABCWmgzMUFZJlNZjvFEDAA773/////////////////+YAoCAEACIBJv///////////////gOF3wQAEQoBI+tUoAAAoAAACgAFChQAAAAAAh6UCfAhFJRJ9GJLrfM7Q3VetRsBp2TTau2SGuWuhbve71kiVlqlW3uzQAaCgUKAUUpiaFVRQ6AAABqQKVz6+ZbHyxCQgAAjEMTJkaaaJhkBoABoNBoDRpoaMmmmg0mBoBMmAR6mINIegmBTamoeBQaGhoRNIAgJkNNMRoyMIwmIwmCGCNGhpppoJhPICYEGRpPRpoTVP1PAmgFPBTTxCehqekBkAGnqEVPBBG0TSeSMp6YTEYhppo1TwGo9JtT000yJo2po09Q2VPNGhNDAEJP0p+p6E2"
               );
  FUN_1400bc640(param_1,
                "lB6mmg00AaAAaAADQNT9EQhEEETE0m0k9GpsoaaBsoHqPKD1A0aDyjQaAD1GnqD0QAAyaA09Q2oxDQDIAAA0ADVP0SBFPSeo/VAaGQDEGgPUNNANNNNPUBppoekGgaBkD1BkNGgB5QaAAA0AANAAAAkRITSaCGSnho0GjU9TDVHgT1J+gTCm2pPJkyGJPU8RkmNTaTTDSNNpGR6anoj0mjQ0AAAADQeo0HpqGauWJh1KI6xBtRZa4q/XTDrqLdBjMzJciGhCAUMQBqGgQJbxA0IliSAQqNCbQJCVrECQtCxBtGIusSSRU0A2ksRggxGkAuWxBRpIG2wEZ22AliENmI75oliFnYhJTEYjImIpJEjsmcO7GdaK6rsTrWWNWtJGG0VRdnPsEX8wqsKX"
               );
  FUN_1400bc640(param_1,
                "M3uy3VCWTCsl5+fWbaQDTasTyY6qoCoB92lm3RZhLNuGFTdRlX1T4ftEMowN6FhBNm4tCi2JqzRDJXTXy8tbda4vHti5Eq4b7ZkfRMcHqqHsZlhNbmcudtTyy8ULGMqafnVGhXaeLdx3uQgivcjpVL6+VmrDnxfwKXAIQR8RfPN+bSsEZwJPjScpqHqb0GbzTaeDXi617OcKUmbIYhdemS/P2HnWV02VOeec4WUac51VoLdXu7poJNEBR2pMidNqeludncpBuJPns/u41ZYxcGJk5isi+CMPZLivl0y7Ul/bOf/vKG9RrxfbX3fhXWmPcrtqGUeUcaOR6qW3Hp2pt4vToUE+ZJn7glHNrnnN5VcRcFI9wXG+pyJZMMG4MXPm/DO+z3aZ7Yxcb570"
               );
  FUN_1400bc640(param_1,
                "vVfUXwxfSnbvzrK6BvGAX0RiF+C2UH5mrjU7Gr7v2cOvAqhNpjY7jHhxLhx9ePkU/HKqYjTPS9SKYPnzW+4ZU9AyGVvhMjGoXqBSeFscqo5mJZh0WKM0l2jcl9lwodjqcdjTTJp4m2kn5GsNq1238XGd3rKpyMwhH1v5Ir/b2zn850n9Pd+qj1Lb9zebvxr6zb+KfB1rxvWlXr4y/b9xXnF9tdulezSvMwLWBPAIMfpjC6pren+I958R8Kz7o/rT4RPw3re/Q8S34enw8a5M918kZhbriJi34yenXpktqxdGtMFVDxG4cC1TxhL5AmOppsiuIHLFDGMD1Yw7KIlmXEPPRDTYC7Ptw1RpDEuUeiPIN4wzMuIbEhE1dYCzFVUBUQ71cs9GmLTWKLCp"
               );
  FUN_1400bc640(param_1,
                "MI8pRSdajqs3xecZNGIs1kUpMNSYlRxKjD5kVU0zBMyvQPIy008JivKa4LJjmLQvPN5vObrfOldIwFM07sfDzEfUPrdS9TdfhSo07zWOdNKzuaCm/iy+1w2L7emr019y/wdV+J39vNiPBNdej53VfMb6tqKecnFScNWLz91NeYlk1x8rmj2Os5/LZ4+57qdAcivakT4cDBIrZ98NefU0grMjsiIGMJctOXFdIljoyqWylIG6JjiIahukWspMKjH7sQxDdbIawqokY0wuOR4AtmAWsgZqqy4QYlB/JaoyY908Cqee5ItkEBbxgGYy7iqYMNCPzE5zfhnU9ONUuHWhlUpFWr1XhwqhQ9tMhst1MYsYzF197XSsmOOmySZdvquUDoRtALRsIVMH1p1z"
               );
  FUN_1400bc640(param_1,
                "5bLlxJghe1IUCCM39/tn33PVL4vvnn6nOFMjXud5MFZS0LEEqy2vuvBPFjKK7ENllRDdyvFkK6q5TcsJmMplG2piyM0mVfzp29TrIsSniLrjM6vEtrhvJTGjLdNKGrriXBSPUlQyzs5lNhVDLIzsqN/tNa6KgwryJJOhM+y9P2c9Hq78z4V+9+K7dv+W8h7CHXx3RKnTXtXat9pPeefArLoVtMp4Xlb1aYHYeyyCaEzAANtwQ40bJamHXIXHRl9lSS2VtodTkm4TP0bW7TKf+oXhu4hX9j9N14fKk7fyIt1hD8SX3fVZxJII8ykou8eetZpHoqRmY8z+yXWOG8iN21AQJmK/QVurIZz1Sv4vT0stloR2kFPfNf3T9IK0WYXyn48V50sv/DMRfePO"
               );
  FUN_1400bc640(param_1,
                "WCBGPN+fhSerisRH4lgdqzJt9U9ggyDBYbeExIG9OYklSgXtXFFgPIx8s0uO0iyxAaOXCCPc1r1VjO3vdTRmu+l3l6HN7zkyuDC9s3p5xtvTw0WL1xhG0P5kkMWfa1rv9ZrvK18cxWlXsnNqvox8GGrd6fnPmRmm0C8jD0NJtbJsVZav2T5+v+3rzznjNWYUFTeEyhcc3dKirol04mqiio8ImI8mqNEv/HXjrPH5NxcDz1IsnTicavNczObzjtHbDUThh5aT+i6ME/sTDF9edGJ/0+P8qvtO36Lql3FSA4IoymlQR4xQ5UdNqquqpltey3KWXIvWNBYqlteVYdJsTQvbHsXojQnb0UQw18Q4lReVXdlioSdacW3mv3Osxp4pWDwm2lw2i6c4dEVX"
               );
  FUN_1400bc640(param_1,
                "mn8EpXhZRffwq928poBLQpK8H2voWQ1rdbFsSD6D+dMLXdquEJjHinAItt0cCVlA0KRijkKb985bVjEyx8lNwEaqYvMspM7iZYmZ+qcA2J+yb4pQDba2J+ObJTbSYhGIXTMp2ABJLFPJ3dN1LU4yqF9eLfbM05dbtqh4sFCyFDTTqcWQS5iIiEyITURDnKjr0WqMQaVD6bWXfaossd7fN43thQtZmLKxNNY8udxZbwGdvdO7GjCttCe4R1eJ6q5MRGbiWjG7ah5kQBY8AOyYzl4sWxoDLVkxkS2KIlcRFe9w6VmExO3Mu9PPTsDKCFZpSDSG5dUipBvNOfQjUDltGaXETImKqqkWawLdaIkCxo7+O/O7zpyPAuXDh/melWVTenlrqUK6lt7KlkTw"
               );
  FUN_1400bc640(param_1,
                "tR54eFapsZk1SqruUDw0LPlU6L8Ny9WxR4ElSJsu6xE44uKzQ3W0JoopGC5zSuNjFealCzokkaybywQi9tLWcWTFt6ricXXNPuPRZ8T4dSznPcXaqOjComepSj6MK9NUWGItNRcGTIUPLTXeBmqtspqCI0RqxVKm28erjMWW7ODEQ3Xj2tdXrVXToZ6xk1FDjMxL3IcVCJxocVOcD8ss2MKaZl41ABNtLgglXFxUJvPElEkDFCHuWqHgbBxqoqisBTQ0FioKdcZrNqxN5j/KVINt5TsdA04nPri7dYEcJvNp/TpnWmpyMwlUTWMt1H5TNutlEz97GonsZc1d2O4xWSPRQqy0qnhEzFCzoanhqWAxXHuarGS9F03GtZqOPGdDXLeWzLgJ21qld6hd"
               );
  FUN_1400bc640(param_1,
                "EYwFcZ2ayKGIfstOq9L47PeWcgMXm2UDSdGHjBnqRDfOazRHulU1Io1iXVMVLlwKG6x7FOg59NUs2CaDBCTUZKHhtxCjTEp08LdPFXw6qvEiFAbdejvzS7GsbqLXU8MZV76mqXUTW3CmIpGFJODAqNA27kNwXptmhXDaht3Xa5Kcjhn1uXcgm9RdzVnZNmQKQCGjDsejHN1jItS8R0RSvXUXsF4iftRZgFODXDwzyGY4vsQzTli8RUUXxIgAwF2/GtSpIx6j7zwrDtgGDtHKbwCBdFBXl95Vca5HWPAxKeK9x1HxEmAIxMnWrS3lPI7eTwFosSr+C1ECEjEeo56JEgWJw8J6bFRPBkoqVhytcXQucs3nWVYAqtquw/dFn3nWCeGmb7Zyr9TsrHYv"
               );
  FUN_1400bc640(param_1,
                "Tddz03Ws2EEx6anDpZvN5Mu+dIrIIuk+2WpkaQIEIXgYceKjWdUb1mca1Ck47bUabbVZcinsuewJ3mJrh4kkS5mLmGMbfsE7/0olsx1bEcPa7kpMps9maqhRZpzOk807xGKOxidNeVSNdeMzd6qhxsdNO3iqqYhJOG5u6KMIrU03rLy+0TF6m0U8iULpwrs4VT4EgpBTRLlplHDGPXRAyXVI4GTFToylugpZerV56Fo3iaw6KwgUBCRHiKq4obChIzJi2lUumJ9m78m7wY1b1u0CUppggAQk7c+hV06YHBslm1+PrSpmZmoe/dqWRzTobnk8PQdp2M7vejec09zdd9fl+VVV105tenqhDdjZdmZiXDtZBMQRENuO/iylcw2yIiWO9JVDFumKYQ2z"
               );
  FUN_1400bc640(param_1,
                "0DnAZ9yO2ULnLWrmaySvgSeTVWjq2uHa2Z4dd8v1097HLa7ko5CONZmPWQws2wlvoio3aqhxwh4Gq8pvbVIUcjj0OnsdabzSUy8A22SzVX7mvHa1nMttqG2S1deCOmC4bHeriSyFE2xKaxHLkh4Yxgxtu41CdpMuhQMEeKGrYeLvJu+VLzWk3M3ILwEHGrJirahu+qes5zt2AqbTbRJO+WtFIZmQcIDwmLqXVEkVR4xRsrTWi87MlKW1d3Ak8ZUarboiEqHmOYRQmN6bP12ZYnlOypmnKO1Vm8QvlqXUTTbEzCAV1MRGnOzWV1ntthbTw9ITqTsYrQuBSN2MpuqaiH4OKhVqtW1ezPm1wK6wNoBiMmzRntmZ1IMsSuneW21ebpFRsOBypLfYXGdz"
               );
  FUN_1400bc640(param_1,
                "L00XVmjCtR5CZIHjbwqVYa5ki8BPGaW6xS1c4qorIcDwatsRNzFi7Uqvi6FB9tNTZyZKPfi4muq3q8TMbFzdoJwJlCr2mlxw7vUYt7Zqp+VFVJvlrgxkBatfxZVqiSPGTQsQLbbSdCahZ81tWm/pZxoV0rUc06dSHXodKsuaGjCpP2teBVXinImd3GRmzBl4qNJxzkfGng3rVYYq0Mr2XDetVVDDAcbHOOGvwCsYEAobPN166eLN3WNorl0hE1z6qvjiqo0+OOd1kynJmpGMdPPuU48CptWREUaindzDupClFUgrFzt5QrprJRk6Mqk8MSHuKstBoxezQoraaPYtqIChpitZaq35xO1QpEHhPCd7T72mRo5ImTPZl9Cys3qk8VTZFl0YO70FWolf"
               );
  FUN_1400bc640(param_1,
                "TSm6mExxpU045Kjxp2KqZ+2O014VjRWr6soGc5lOhHTw0CErz4VWhMRqOySkm6pipyTs8NHOf49UQORpBndqdpiSxtuNQxDgaMEaDHZwqtyhEyhdnmqDFtNNNVunl3nU29rseVrrmkTD9G3Ecv6mJnQwEIMFOR6FXaTFdmzEbwrdSU0G8vGtVEprMFbO5u86NaZjICE1CdHF3Pb0z0vFW2BXLpNoKOHZMcmckzVeDs6Et7dZZjY6BC9zUmQT4kR0QiATEmAtCbfbMVFczMS8bayrkYuPsnhVd7nbebxynrnY75tcRoTHXDxVMKkiyOhunDboDFMpx4MXURVKVNx3kc4yetSlT3xrOU6dwjeI8xKGzDp2JmIK9WostP1DWQTeHbeUe/ivwc4+kS1q"
               );
  FUN_1400bc640(param_1,
                "dyqxsTdVcVW0esTI3TaszLjGRvArGWJhaa+HUqlb8o0qGztFELPrtQ03dnFIJ9pm1kt+MicUUOHiRiu5jRR5C8und1t769WrXvb52qXbKuthH/Cb5148Kle21kZ3q6rwEqN6ueuds0u2nL0SpmnVR5lfYfqPz/6z/n+8/G/YfhfG+o+2PY9rzm7aABCOmxIEIWddGJJCG0hJQ0kJChpCQL4rQCLjRomdNgjptf5aQa/OQtZ6PcSLUMEjcsLzAMliMFihm0Z0qsOc1rmPL3HA0WP2u9svjH2coPCZD2OvhVtvM9KDlPt82Ct6hogZjUgAMApQvb63bm+WiUgJiAiQkCEUwfI4Y/+XTf+hBtluzJyZaokCQN6KvngsNt1Yl/zahrZOGegzcPKztWl3"
               );
  FUN_1400bc640(param_1,
                "1Snj9pJhYMHUZntVGstpJDRqWtRgx02Xz1bWS6mcHVwGYw8RoEBl/cj0Vj38+r+U8v8f8f7lyh+MFpxxa+TnsYlPzf3qQIAMBAk4SjKECAH8hAhJwvY99RUbTydVVgbWsr9LcwZLRRm3Yoe+cJrgOLz9hy2bHFPV19DdvTNZdyZI2bhPbMjg2S5hvTxmOWkJZsdTuuzZ3WbzNT2vI61/mb/eX0bzP5j8XPXfQvhSwGDSY0mxrH30xMA23q4T4k/6cujB6PFi9pIVQ+tAfAc3IgabL5gj2+rjczS9eex2MzsanndfMwsGnH8DAq53gWS2xNrOe5n+PRFWRBCfKeXJCbyHDTYxoF3Pa4HuaSpf9dj7O/iWhao57nHcGgDkT0MFgaSAbNMmCQACrd3s"
               );
  FUN_1400bc640(param_1,
                "3w+RunkJEJdiC84pwCIAIgIARy9/m9e0nkziu8P/dS7CcWHuTpBoAC+OIFG5LOEo74gQhlZBHJ2+SnqqI5wjwBgGvX+VGkYKBB3wmgOPrl/5AN8cij7e5i2BIgEeOMKIj4YwfwZb9my+wjOhxEI8XASOtjNoZAeKlACCZtB7mtcIZ4p6HXl+OytrCUtIA7ZKNxgkADdpqywXLN/7DLOvxz82EfGsIEEFdFXqPNXSSuMMfW75FGhRA2VK/l4WaA91K22O9pJGA/yjuozi/zGJXeu++X046s8WMsAD/33oPxaOS5Kv1Xra6Epj2XSK0kmAB9Ti8bZ3l1ElaY28EYbAqSssjpZxFvWLSik0mietVAUeTa5fqjqMPanROlSikJtwT7pjNKl72yZd6qnU"
               );
  FUN_1400bc640(param_1,
                "sXaHXUhAfLTpuKeYzfNeSacDj9luyowa6aKoGcRXL/PEvofSmmFcYCHrjX/2yWDz8FOjfZ1GikkgF+Ov1vzfqDgC6tYbBFoa0V3ONwQB+wM1/WvYblfeWxbA44PF4GjTEGnX3EaGQy8O8+P3FJQWrVcJr/7W/WHfDOQk2/H2qITv2IPO6v0XGgpg8qUO/gDdNLbXVgj4C5XFVdQUPnQyu4uC5NfVl2Ea28XvVTd1wNpliurjw3zOAnj9DSJoM7PIbTW3VEIrOTIsu2+SRqrGvCnLuctTdahpvR1E7s7ZPsIzmHtObCJKdlShV8J34Fy7WJGxKrbyPndeLHiF2KlHe9VNPkVuYXXs8q2Qj5S85QJiraPldJ4KeeT6OwSknLvOwaZZzIr5PktA3xJQ"
               );
  FUN_1400bc640(param_1,
                "cj8ZQitqUe9ld30UOegwUg3FlKlyKbiw9/VtAmdrstF+tVOXiS3gla/dOBJxmFdz5aFkWwbCYhyoa/jbQdweQLBrw70dDlgq1Xca1nn27UcocOHAxdDZoJ1HQ5mTGzeMy1ppy057nDo8LUHbjlOUSh43DtYO1WkITIcY76qPySByH1k2nYqvtI5v713vYNKQgqEdTfMkzXb9ejpDaM0ASm694gbKanz4Wk3bRZWrbqo2QgUyvgB3V+YLbHmR+wgnd4Ejv2MPzIA1AgZzh5dHL3D1GYMa2u2aw1hte5EPtaNwOG4NSbWvM5ao8N6Nzg1oOZmPbHuvVRQFK08vO2fzUYFsiGRKk7kx4fSG57ykDNkeMwD1e9KNpNPflsT1Epit4ehY9wIK2YeV5Qma"
               );
  FUN_1400bc640(param_1,
                "5qwMjT5cBacm1bGJCA2qBX8/k4UFUtC4hnPzWdzZGczouqKNxULB3WTI0MaoXBGRgRDFVZKXf8TOGhlDEF+go3VFEwKdoVF9k65uFWRUx6J4QRZwYPPsYiWI4aYrKRGqPDlEfBsILF3Ty1XyEV9AWm8uRpRHDDpTCYynUrZgx+6nipjVa9Mi4jYyiS5gv7q23luLUU4rtCh7ct1ZpRwwWId/sM+gTMpBrvGH4r6LYUzJ/2ztB1fslYedVn/j5zg6R4t7a3Mt+fdb6njZ2a6dDkJkPEJVORk2I1RCchkmO9GIZM8jOJLi9vS1rFLAU+L+Hi8JsfgjcYdLCVVvpyE39226VnrgL1r5kXlXsmjyW2/9u1vNJr7Xo0kG+Tl5GQ5f7GmsgzryIgBO8kkE"
               );
  FUN_1400bc640(param_1,
                "UyVeFVhTX57X8/Hl2FjdRJtsfY83H2Z96liCS2cK30B/qbuVcYjS+1VDZVHLFeUXD41Hd1nM3mYHkmiyBtDOHePOCyg2i2KoZ0sXEkW9Zt3FidaYU7etYKfJ2/Yg/fKkVASZr8S02BzTg2F/Q1VUMrN7nJQhL9S6HF9TOwrb2uEYWjSeiYBtg6obBuMWeYyQCFeq79kzJRVE74MF+o6bZKTTpW1rUZz+VSVoqK3iIDvEKNay1fMj77A/pc2cWUpMiQ7CBOIeCJqoM3cTIyLHQ9mwNpbtciTP5jreiH1PV89cE7xUi23dQtzjYTShVx5OHuTZ03VcSMn0tgCo5+YwPCqcbtavmeASd/FV6eiXFzencbnaghzWMGOsxJrD4M1mChTtrcpkfwbn/2Gf"
               );
  FUN_1400bc640(param_1,
                "69vTRVDrUDLTNKXXNRooXrHThcDvp88hZZDuWM9paX1qg2ZLZHIpkII7vvrdY5HZKBk6xfwqSRJgyW9SNiMqhFvlYVv1oXkW2e0E86NvMYjLyBA0Y04MJYtm1pt8GXkhM8KObHj7PSsrrEG4uGXkjUo8qQdl3QuCtO2fcFcjM8sX5ksDLPEnVOfGnevPSbQ8l6YAIqaK6TSr13sRjwdNwrvdHnMIaI9dpTM7mhga8WQZCUS/aVNrKoGhY1wfLixrmOOb299JQ2WTG6zOF9XO3K+8cGVEMx2uc1LXF5G8lVJOVXOay3yjU31fG7iHkNHgH1MCuvUUGo+raSDANK8EoZedKl0MKYxzTtaog4ZKpPQ8ilnUmCIgHb1h+VsMLNB1PL6iFL2RmMJ6Invc"
               );
  FUN_1400bc640(param_1,
                "4yHw6KiXJJGbZg6vCavBbaodmJpBEMzPVdUyVAjUsvqhWlRRp8Mig44gUhjsFe9TKyNDdGdo6dUduboScIb3lbIYGTBCEA1tIr7o6phOzwNeLzAMHO+Z33zYPE+0sNhVYbcabtH80/ZbWtlpDoYytWctz+BzDvfS1VcdPEV5cebT9/J5VAdMkpCJiAaIgAECs6hek2sNcXRTKJoAQ0bNNoIDYtHE9a/kDXVQZD3vNpuqaNmPSA2b3Hv6SnLEjI8sXKMpXWxlznJKV5dElNRFrJDA5NJNloVJjkRJ9BUkkFxmwwNZLpwuHG1qA1jBC2WFhzsHyfGtnWxr5CH2zRDWlyZ1VNFSDGePU9FJw3cY8XImXOhc9ChDjwYBLZY225/HqseU0i22N+8enKnP"
               );
  FUN_1400bc640(param_1,
                "TAxgyzz9zQBeT5vOmzrcCcRrKvVkmohQahxhaWUjbv41/ztVtLfh3bgX7Wzqv3PhxBa/UYLo93o9hsmrQTEgkmSiv3WweQkTJ0/LhA+W7e1pQFmDgvFgMRAlY9brcEw9zXRIGaPokAGnnhlCmK0ytTCemTyIgwJNdssGAwCC6hFpn7SEz5y6yRygB4RdmRjA4tLpMyHZXV4k1E0BvN9noKO+egzoFM2UcrcmnBq2dfJmHuUTiDodgZJE9tqes3Cq7IHid4PfoK4fty07FXDrQuC/bJULKgxuVbSoHfzV56kinNpXj1VQa91eglpD2xgYHHlYZfQ/9qNxg3dDIve7lfmlWHTOSCMG5xm2OFKePbbIsc4DglGUwaFoUJ5JUTOWbB5ARTi2wLdxrx7L"
               );
  FUN_1400bc640(param_1,
                "mlRMjhqnu2mA+GX1uystXz0sWD8Mb2pbU7Gdmx8e82daXiey9Sy8fWe9h7TiX/m89RSW5Ll8umSL2hTt5ljZT9KdrO1KFV6r4GNbg8+vrqzhW+MspGs6hHt5p6LYy9N9V89ehI5l432mqDHnx+ynpH+8K3es2k4sQT80eKqycvYVtws6d+tOnKqmiwyV+5SWmd7qdDxWXZx24FGmjumeC6j29JFXy4GEPYiTcPhd6jWQ6d5MSQ3gAtZUYmN2JOLIsKYLMsw8w/iFd1sbTLsTINjilSceLryfBwnps0SKc5Z7bOlBMN5/I1IG2MLXXyyDjbdUssQePpeHaL1lb4nVib0rwIhXE9lj5NSWQilclmWqPViyf1YR5flNkOPqUxyZbpsei7WWNkILdrus"
               );
  FUN_1400bc640(param_1,
                "rbH6n6QKBouLVUGW9006iPtpJ9SN38Gfg0bv1Zl5eSzs5FVNp/IwX2rGjq0M54mt3Ewry889mlFQtRkWDGhpdJhXxJPau4124y2PgVRlkykhKNnoOUjZepfVm53JbubIehzdY+skESOyzGcvRw3cyjF0+tE2rpw8ccKUNTw55vHZvfCyuMm1kR0dtZizI9VdbEfLAwImoq2zmqhfvZd11s5qkHLC2qBoPpOGwynCzCkEbp86NCXO0HXNd56k5LXk7RlPJDjO0syB2WTVsnKWKszBlYOU2xHKN6ZyVTbTILP8j13nv8bWRePLSsZbMMLTFE7h8SzgbOWCy3eNID9VpN3J6FJWeuBBGVw81/KuMlDUd0GwceOnHf8eRQs/INSpHDHWLu3B4to5meF9"
               );
  FUN_1400bc640(param_1,
                "jFyFZddgczNOwn0zru3DfE0VNR4pUqgz2Jd+mZcuO+lXbe21kYEtcsTxIaTA16Dql06yPc9j39mUazPeEG/Ri3taBhopTr5uaBrxzFUZGohb7xbgdobQa+jDxbSVL928lAwVhluIOspdJpaVpFuCiBlqUK7TLwtTXXr+6lX6rSaJDUhDVMhjxWnSOBBsdFVEihWXix86tKt0eASraWrBehemfT7uLjbpORNH4EQiN5od5sOb3Fhf+bCxuleJNOwdkHu0axShHccbkoIoOeMccS3pKnwpoCDPwtEmiI1j7Tfo8qlPuuVH9vSx/h0Hl9++14H/dv2XQBlba14vRtc8R+qzY1Tvaz35MYzSpBr1KXuINMS+PK+ew2j0fRhCxGkj6Xp/B+JRaW5z5ymB"
               );
  FUN_1400bc640(param_1,
                "4Lxmtc1G6jIaU2uDcOKQQ15TRcsitorc1dHyOI6g4z4rXeMEuZ50YjG3RprgnoFAXglAREewV+K81rQsHGiUSAQM2B063Y7mzCTSOrYE0B99BGMzlPlMpzubxqIR2mUQtixHH7fvuHRGmu5uqosA3mRILufB1emzarg6Mhto+ZBv5v51jlHtPW7bbVUy+NE8UQwkbjs7ivPRSEeF0Zu/AhI5gXSY4Bb8V/BgQi+byq3vQMDySalZ33QFtOtxPuHlh9wrAavU6eMjkkGWpKnwMiFgJpjtt0/RIu2azF9yUWX5S3/KtXNs4SXHWR1oTnDEKGnvMPkPoC1Wxd7H4PYVxE5l6e9JjpLByCszvVI1nsb7b01jszoZUYzzQXUIUtDNrX2G9zmOzs6fmWJ6"
               );
  FUN_1400bc640(param_1,
                "7CotvPM04syuo4E2PT48t46ZJbWHpPjOCfdl4VBxYt3l4n+Fy3qQBik47LAkzMp4VvG6EugqmVwQxcVUwp8+xkpG2dZJRfKPhCTpouJ2OhVdRW14aTevFzCM12CfTbj8qD72ubs8Fn69dbI5vBrZ61Yk2kwcPGYnHI+EZCzSOlKuZ5Myk+ekNrqsrKQz81zc1LJXPw+TXs/ahqv8uNdMQzOkvWpTVGXllSt7lJivamQpthxGOTGlwONKrZQUIlvRnm6+yzSZFEQ7lXg7jK+gxopwnYzY82M8kuATXtD8VHPVDTuU9atvoIzb+8zPC5i9k2ojr6aaKjdnz75Q3ZlCjiVkAw4PTJe5aZqtv15HPIT387B63cqdgq+Djxfi+LP65sfOeylCGhR5PobZ"
               );
  FUN_1400bc640(param_1,
                "S/6NpNr7Oh+YXmLjaqGJO0TEkAKIhcvc4w0BB7qbu/E1mTyVIWyzmbfxrFojziXt2lw71+c9AMmXgmddQeB0NrgIcIn9RS4pU6bvdiqVDJNKEkUwcwvIpdmHAIMR2oMq4NPilB+4K+OKIj5BDMEzLLDUlN3RAtZAwwQlQC6LDQPXszNVAh3ql1NWgcfO8OJbs9aFj8cOCyXfXjOOLBMbYqI1RXnXRhJk8CM1Gib+cqPnf2sEBduziwtg0NUQQ1yAQEhIAEgV51lu+K1U2HLRQTfgyDAdCsF/ylD2D12xZAk0MzFn1jgu2ki3jZ7f0jMjxnLW3cNOxnSy6AHoOGU5DIeNBDEaRkcmA8zzMWdh5etldRmV48F81OP0L/PbDNtuWjW0iNdHFZlQqXbg"
               );
  FUN_1400bc640(param_1,
                "nOKVcwLphY71SU0WdlLJutWT0rryTIhtbdghKzYC2SPjRnJmusbrwDOwgVKy7yIinBOTmumXkmdKdOZbHZOQ6so2+kw2dCSKluFqa0dQ/4mKLEwkFRQ6Q+XtZKlfpSnmw3ZdumjZhIBwVSwwzPix9s8F3RdmBHx+gxMX7TONcMV4zz1sMHTPhe9jcxeMVxoXNAtwLblN8GGNVvLSCn5JRA9SB1+uR5ddlK8WcuFxJ7MZGZc2mxR2G3KibMNdrXuwuVQ3iahpSLlwHUhTsacmTFTh3ctea4w2JnfvyhoUlffaQvNEZvN5aChiJVWrZMeel8O65RnJl320DJzjpLHyYeg28uBmsYOCu5KqxbUtX5oa1SZONDjddbDuobPNmOQtGiWjAnrGmZLsYCJ6"
               );
  FUN_1400bc640(param_1,
                "gefyLUa51OgXtClS8Bm3Fk6Tf3z+wISBUThApyby20Vp/iwm5hJIqAHJF6Iy6NzzP3SNGGpiSxj6yBFxuvrF5Cg7kWkxu5+PnVuci29fW7T+ta9DPyhbjFcbmn3+Ol1456tuL/1XPRTv0ieJtXKBQ1RkAfUQFpBEKiGUACFcQJcniNbLpQGx2m7laDawHrMNu1XjeFKuPzWJeLgRet9eVLXeuIQpDQl35BExmqcZbzKn0A1PBTMYFBLfjq0JXCTJFto43aIJPWLaMkNg1945RyzbvszF8bBBRX6NiKaDYQ7mIBZ47Lwsa4XsHSXuQfaRduysC8ednztHKGwhFLX27vw3KybYGvCG7OvNVQmFrNLo747rxdP1R7multTQaOeMNeaizncWaR/H45hQ"
               );
  FUN_1400bc640(param_1,
                "odVMnsdjdcTxZvKWPbP56VKmfyx5KpbevvzOR4hY0nZNaeiiOd00VYRohYO4793zwuVZcJDxRR+Mtdlz7NufMcWCXMMQ6/BUZB+z206dRQoSc6nuQgIofIlmXT2rraJ6+7lGBDa6kg2t2bIxHiq5pxxhQOtfIZQyfIZ4fjTRb+xyslV0AniXFUmSbGoZX9p9Y0oiIaAh482NpK0DwcxYjAzKpSmpDt4kK1mCDi2ssmh9lCSCkwcmi4NF95z/R1aV/Y/eStdJKyg/lg/NNFDNRuqGqg+IZpAEBdkr2dsXkTc65MEaUgmEEXxBEIvVZluDYFEFIpQJnsDDLcSjk3780GRwOxAJEg6AnC0KUFW3UBedXCeb1xqWqozPEFgpaZSJ0CrvMXwUMMxcsyzM"
               );
  FUN_1400bc640(param_1,
                "VJSZsalXXlaeCvR7giMD5S97J5sy6DJRykZPPAV6ungWrSr3mkijSMjJLTH2D8Rs+fAMbfGkEQ0tph69vkS0JNhX4T+GuQERJ54qHQcfmSQpQo+tfGWGUbh1CYuE1RtcHgm4dIeaEFFCeYtdQ7pxc4KcscjDN+VkcKcFVBLYhsggnJGincfDuoEx7piDvK4CKcrDMNo+Xaq6C07JeuyB0sw8iRCvUMC4q6sQ4nJo1TCA/EAAL8SEAl/9JXY2r2hkeg4MUa80UF2QBDRu7gveSFDOZDEsQquY2BYZa0+XksCjhAkcBQhEsrO6RYyG/EX9+7RhiRttDq6GvpouV7evrW5+k24CA1dQcDMW83grTA2snLQewqVN44vdpgjS96ky4c+9nMXVB84Uv5rq"
               );
  FUN_1400bc640(param_1,
                "45DIRKZCrDY3R7QC0zm777PQKjy5Re6mKYnFpeeQHBBDfySg5q2r2qhRO8XHNNDq9yrVe6t9Fkx2a3UlXUZM1rlVMxiKrlswL+Xnr4/cOs2P0t9c4gRxIcIABAWiS/G/HO5sUwmgOkNYSJEEBUEAKlqUBm2VelvUHMa5qJGvZNDdlR66C6NBlZrZNUT0s/mj3KglfKZxqC/NbF4R7mRTjKgOkilg6fSq1T/Tx4xmYMrOl3SKZT9szVM9ALCk8DynmOcQ/Svjx8hhAA3EKGyePYDczc3DarChH8SHC4D1uulknpavUqivzdqHKZrd9K1TPnfStRXFUHsXliAADMgNYrSFHNFkCGQQbHihEKhEwLPkliaAkeqID8uLW0r1GofPd7fVgO97kzTEgyM/"
               );
  FUN_1400bc640(param_1,
                "eb5i7iBdgty3B268XcawFE0prTjuEOvhytYWYlPmizMwof/cjRisNVu43MyJwI4d1LXrqRiubhxWSsBfgS2Z+9HL7at0fgzvrq5SkFUOYuN63UUO7B6DACgIBlCQhAC3ECJD1CBOMQAFiuMDHFikUq7pG/wZsLSm7Mzzobvifs6sPbF6l0Zg9vkipB5oDyPwXml6M60sH2fc1HUhSSSa+12avD6o8K4OhDhGaqTO7LeSZsNs9m4W3+jbmr093aF7u+4OKX7EtUwbQKt65nVeM+U0HR4FcrWtEPQuPma/1RDtWzhqTWAh2G9kwxmMTd08mN9+jy56xcXIpUfqbb+W8oyOD4urjjntuupr3UOTz+Pc0zjM3qZOjLc7R/T37lys3K1vYlVSYcwghZEA"
               );
  FUN_1400bc640(param_1,
                "BG+qygOkTE8JglQGhV6Y/Zma5B2uuploPpz93Mi2l3jZSMG3RYp1V7np6J5Alqyo5vShXOdOT0eViU8Pa/H627+Ti+27j4LS6DXVaBa8fmPuWie8iD1XGTGynP6CA3vjTdKeLAhCS04s7jeD3J8nptSk/O41KDEq+lzyVfiVs8yo5SI5Q5rZbbbT4pORN4eOmxIidSGPQMrRrMbyU7BIICIa5Li+KA8Q8SzdZpw7FOPToXJYFGm3Lu/xv7Oes9Qfff6qSkv6OvVqMybq0CSVfT9mesJ+fN4+5UII55cqp9nulDcH+CgCpIIgANCCQg4mPFLO3VutWJKSlvq9pkT1FyQ0MDGrbPwXsGC9fQ6zsXay8Ifuwej3+fxtWfcf5JIrVyisRNiNWZrad0ay"
               );
  FUN_1400bc640(param_1,
                "Q8LNoiAhIEsQTZBERcEEQQ0hXhtbO8MvsRF4PIbr4EY4qr7Jq8k7dCnTY3ifOHO/aeSItpOi6UulsCzipKzlWT9LNJ7CUdOigtaTpLDsIACANCABsmC/my9/G8fz8N9MsPOYpssxHNQEddwV7Pq/tYuyVGLmynXrT0sxNPfLBmjPLOlTFmUIgIW/PcQ9Sl02GLzWqRCVX6cbZuwodi7KM5brrN6y5rYTiJnqeq58KW63S+nOmN6XWj4SJieggCAg0JQEF5BKCOmNc+9bMrjY5abxGN/h+iEuCus47S3ltY7XxFlJxZCw7o0dT1Keiq8ckSUw0VCmpo87gGUBFhBEA4iAIDPK/mvfc+Ni3GOVepq/H3ml3puPDR4OfR+i9sZsLlXeL0tQ7VWzod5Z"
               );
  FUN_1400bc640(param_1,
                "6UKOCga4OJyw7szbEgEADhAF8ze7C1182ZVsC5s9h5um2zxkvhqqzy5RhzjdU73R6b9foeGifzyrq3jhhmyeVR+J1uGhkiAIiB1tDId08pCrxiBKVbpL9OzCvpvEmFVJsJtrZ2PArsY7RcVGVl+1j2H+E0GjQSENBjzRwREU3sKDe50OMfDspN3yp3zPjqJbLlfO7Lr1KVpeR41tB3LxN0y/DhqIWi8U4WAskwhEEBAKGXYo+veJCbIbqRRMo3WatshQ65gTK9jZV6ixpa4Jb/yyFF/K8XznnR8Nc+r+37UMokNnfSStJ+JBERrzmrKUueEDOXVfQ1RWVnSxvmMsJ1OaWM5L9H3ToVu4nNPLA/jG31XuxPN/t0+9B6EQxBAJIgCAsL455alhGi5W"
               );
  FUN_1400bc640(param_1,
                "Cw+1zGzZnT6NNlxmnDPdo4dFMz9tyf0Rylp7mDFNF1KEzp3E8l3UjaaO1OzELGjIICK6lKRW6k7x3s3M0+bYIO7scOEyimma/R487OYL41zx8dkxmdJUDnyzlW51jihZnlH0pFRBzCCIjhkzQ+juesnuKsNtELObnZbVp7lNAit/Vpy1FkdeGaNoI66wWOykobbb7qxR7lBwDtcUAAAdJF29MZplvzOabh4jd/QdaXVQSVKf8j1K8p/fkNEwVnr789T786KoOWDpBJwnvmMaEG+IIgAQKVGoXHdNMpsPrTRL6JAo8ngrLnok3FBdN/ca0cua7lZp2/5bKytjeuDdMkaQAAERTU/1I/RSeXLPH9v6MzB+9ZZYUDm7Mb8pqOcon2dadWTnyrjwVEFQ"
               );
  FUN_1400bc640(param_1,
                "LCCID/8QFDjHPYuVgdKAzmaajX8HvjS3S2+lbfP62trLxsH5RsVJxkARFTuFbvjf/Fe64KOE53978NGxadr52gJIyTlOECHcbUNFj891r28vTIpczf0tAx/YnsEgpCCAgFJte7gwqetqLKTLe67j++lbzM5e7zXPuqFfus/zll2Jead7LonN0077fgnUYAuIN8QBETmKarUeQu+6ueyaW2jQerACP6dNThWEsXFVvEm3+OVJ573+va1XNksIQK4gAEsrbYz3cvsweygghDlo0/0NpPzlrzo2Lcet9Bac6nft2F740E929yDgmGlfELD/ogAIz0v8rOd3qvwWKeB6UPoiTuVsN5ptMRe+bMYXOhwpR1EFn3SZoRsyAIC0WV217+9sSqqt3n/PBRZR"
               );
  FUN_1400bc640(param_1,
                "7wULGl6OmpixKaosUc12HC/fYbThlcvzn+/BaB0mCAhwHMqX4ED6W1X01E+P3z7uZtk/L7oOBn0qHfxKVPO0LOqSURAAABMtvIXFu221jV/ik0brG0Kktx80bzPRUzy8g7vYp/pVzH5MF1hq3s1Xs5MkEgiI5k5002fSSpV37HdzQ1ba91YuqnkTFCWGi2KB96ivzIAgMvVK9Tx7yrXOyUo9s9uRUptJNgXfDZbqHIVTi+qvai4qVYVZBEQe5Th04W3C5Zxu6Xj0LE2kuYVY53DQgIBXT/Fvqr2uSdqjM2qvxPMLb8afAmyofFKZ5ggIfX7Qk/5YD15kzjjB8tAouL5FU/1zXONTwFtZaxrn/lcAgNk2npzCA1aLU0959aRrZ3VwfHhKlg6A54gu"
               );
  FUN_1400bc640(param_1,
                "EAxxAAJbTvx67yK1QwPmu2dZ0fVuLOx6vn4IZ0REN7M57Dot6vnVUUh/29UGeZun6igTVeWYAiDDPgQn7E3mva/L86NuR5j4lDIhIscggAnZxb5vxnJI/K+HhiMkaGoxTNtMAiEzz7llK2dPTHaKl7GRnT3lZZACMQBAF+g/maCY6o/K2y9BGd7ejUS8RBAQkK3HNrHKYs+xpvxQRryIrtTgIAdu0lnTT8JWw3C/XVYuEbCyph+IwgEJtOtL5Na5kz2fu9kfM0cH3JdH60Mr8OKmZbXZeIAEQYYO598xR9hbXPV4LyAiABGZ1FCsw/P1i6hnZ7ZOyn2bloiAABOZMIsbS7KAAHzy8GV5L6JM5N08jQkXYmoMExkSZIIgDrhfac05nNp/MqOIZSL6"
               );
  FUN_1400bc640(param_1,
                "xAADhoN7J5UlaThKeNy+KQAB34ZULbmAZsVV2eEBCfObJYvs9I0MEQD/z4zqmBM6RwBF8QGWfXalf7cs4AADqln4JgiP4094WACEzL+f5GAIBZPSrH+SgEZM69bGAIA2/ZrV+00IDl+p0NDk1IXJ9jx5N2xILucjYNIOngwhbpgliNdRi3jBBqfD9r/lBdJo4jr33Y6/u+Rz9Jg6y7eYLF9nzpX8GjHYjssBI3rS75pb1gevo/ZkA5Ocg79iNJ3vLyL3bV1sSw+rEL5qIoAHjI90ShEAgR8G65jQgBHX3lgIh17L7QqjQf5kEQAqNIOdDA3kkAAN8Xr+RgjUkEQe6PNG4atF0fFsfEBCupvDsw52pwpc8pNlAtOKQgBWgwksWyPi/S2VLTgIAXve"
               );
  FUN_1400bc640(param_1,
                "+yFxQG8b8v033vPFHN6e7iWQEuRAAB1E7Zxcx9iTwZB8LveKAABLZn18bSzmp23IIiHVF/U03VIqWx9E0gAQGXKup5/9zdp7F8qZsIREJjeisdbUq1u/YFxrZIl7eGr+ClUpxMsoWxAHWIIjJBk91g7V8ExSfRpvIeGyKTnf33zPCQAAf3V4NcrpEJyy9FGrzdc30vCXhDxgiIo8O0PLsCx+R3I67PHqTQCISznOnk+n1ftfTuIskUqMAECqWQzQuT/f2n2XqZ8nPBRJTD6n0jeiHABCfO0U/p5uVnqUYs2GphuFJhA2xIQBTeDA1/S3lyP2NkRQk8kuzXwayTRKGJO03gcpgCITExnQPJ5kaxX9tePYpW6wF+Jj+LCN733a6ONiFbCAEC/y8qjR"
               );
  FUN_1400bc640(param_1,
                "iG5tzH1rtsXi+ul7y2AreSjb1sUgDHIOsQQHuOFyKen3CfHEersBf/twaUmU7p1szWO9HA+K+h1EW4uuSAAil9mhW9Pjn8vbzrtkFfCvsbev5eVQZVtjf1tZlEEhADLEAAMRjfNUpmbpx/Bi5aFkpnCqoFU2EzO0H5eY6bmEIzxBAQ2iCDiH3tbx/FTeebz9UPtcm8m7ShubGOlSzRdZFzj22R3UOS/4/goRAH3HiTx3a/WWlTsWK0S/RGjcd06fNAInCAIAa1OUEf3T9p/loQY8eorWnKg4f0O8JzXWySCj8eVYhyV3slsQ+spUEsZ8vYKAeUQITo8dXxKLSRv1f1Tr3F0L2q2iqVw70sxVjNYtyyfmskUB/g1KAICAH+hAEASfzGxJWxD6x2yv"
               );
  FUN_1400bc640(param_1,
                "zO9lSjQnKyBsXOPQr7/TqdBanomJVpr3bd1JybXsN6fxPnAEcUgAAac5wrZjsuLWX0ejVvHng8Nrp9eCcwve3jvXMaVl6Hx7PSkNri9qQYI6JBAQQMUO8ltclyiuL/esF914DOCgltl8hkbJzT7eDDxmCnG0KeXERBhIX1Wpu80e/RTTbgvuunmtqnQta2fk5gkkQNZ+VtMtmigGgARwHVy9fqPt35Mti/1daA3e87rS/arCFt/NguphzkaQKVIlDRxhOi/mEG8IAAT+VQ5TzZ/UzmX1X4dP72qB1MJXKPka08l27z9euitt1pP8mroqEta2+k15qJ815/RBQ8TAoAAW/ZAJnVih3QuoZS1HdTPJ3eCXlPP+r9Di1NOmjuXc7Nmu62o43KyW7+zN"
               );
  FUN_1400bc640(param_1,
                "f0l2lthlCAj+9M1NX6YzyY2xdLT0n47GBpuUea/m1I+rtnVkfUX6ykm0fsyWXpKAAANxxlbkSuCGjRdd1Dw+5rzFn8xNfNu3YJ0yulPcJ7U8OyzceSUP0mgfBgQPxKKEBF0R8mPSGUbI3Zw1Yafx9Xw75Cep33aa6/HUpLIs6sD45ZXoUv2jX7zZjvlLEBHhupmzkdn3e/G9ezuM5Ksg+KcTh4K5noUt5udh6hP6mdcaZXqNzGPIdnwSkkyAIgD6lN+/zIvatk1+pR33Gju9IrJtr+w0GmZw+jSpEbbU617yft+RBuzmRqnIT1fKzRJzylCaIACONzsldBee+t14VHzQPOyyaS4Tsqe9bRZasibu/CWdym5kXfqS7v69bx9ZO7Wvld69KEBAJ5yr"
               );
  FUN_1400bc640(param_1,
                "Sl4N1zUkVjqEOGIESf96b9zU7NR/jW8sLWgyXuf42Ee8aL7jaTn/BPUZhVOQQEQcd2xlujDybp9fR2yVbessJrEaqof5RPLX/Tg5ou1m/CVslkW6U5UwyD6WhX83ViWgIIAAVWZvbk/R+34OE1zW9W6VPNINHBnKDnPd8BaqRQHtl8jJGLiTa2WYa9mUAAIWRPwP3XyQ3p31+Ql5m3e1NyU1G4uaSdH7STC1+d/3m3WWSCdApLewp3kNgHmIIgPLzNk2dxzjLyaOLDNyC6CqPVt5gFfG+4T/9JCKCqdrKG/rY7g/RtpW6jTz1EC4ga5AEROTJzKSYnwmImes5DlLtWs1zpIl4hibOcjeqhpe925Tdmr9DoiABfI/IbfX5eA34CzGH63b7yVjyksk"
               );
  FUN_1400bc640(param_1,
                "5r+3dPe46bC6hvyqzD7O+fO824EyayDUspvT5gBwkABAMTlqKdN1hQyI26tcsKrpnFDfE4zJ/6nrjg2eiSNPEhN/9Pr3KnO5TfmXWMu7QKBqQP7kEBANaxT7v0ZqKwM7Nw9n9j+ZQ5NC3913RU9505HXVPPQ16l81keh6oNXGjtXOmaTkABF7pbRXguz5pDVfLNuD88r2UF592lwK3tru1rGLRT3QnJprcFu0QyyDP55FFUZ6NEhOtOkzfJ03RQgIgpa+k990olljX0T7vky+LDAqc8ePVTWtn0MkTs+D7vnG9NXr+QMjzl/n3MuREaziAICFgqtE32z8uY37bo/x5kiPYlIl895uX5RUXT4maJMtXQYewbMJ9OsoQEB0rv68R7J8p+wXJdz+uFX"
               );
  FUN_1400bc640(param_1,
                "evgb+em7otr+GZd1lNDZrPsx+ByEe4fg+zpbHxJVI463jKTSUehOd8TwHyFaZQCIAcOMXlvbVNArdtNf51172eT1HDqGXUwvYmzlePwPa/EqtNdA58HX9qoMH74lN9FdhCr/aZO/H2YqvbPC2G6EhAAmnlzPbRM+xjX+fw8uHNzWVWDgHvJN9CmJFC6bXqSUxNo6gMTs2Xp6XBvnIGSQaIgDAIAj7CAID3+hzQ/uMxnvi7P69BTzqiQNGP9W8f4uV/PV3GhPLF72BvP7xjqSm/wMVeImY5FLyFqplifaUhAAlrTX7vs5l+ifgbyONxyup9sN8rOtVfHe/vl7MGF52+hcqJbJ9deOeUUQGLyfLA+QR+JAARCqV4d2ewNukrp/Acw20FHUW2PBp1bF"
               );
  FUN_1400bc640(param_1,
                "nbq/H62HonlmCXjaZ7D7/afO5ZvZYFB5iDukBSQBARQeJ50L4cdvW6E3M6vRR8/mZyJmofMPfd4DrEkLbxjisZDbOrDoMJkrXnKlXa6+cc39QqSbFAAB2EAAELHp+HVmmGatismEri2UHJ/H0M69tZ7wp2Naqh6SK7tfyqslnQGwKVoO0gBsEAQGkoShEQCXvW1Qv7NLGacKarNUDdssrnGxZvvq8st9ZwvbBTZo/BrLuzzPJdEEak3dQx2tNZBgAa9RXtvWBYCM6QRAQQ0M33UM5ULFT+x24XnvWbJNsP7Knpfgxm9iPNf3rjwYf7b9svDe42RgPhJcCAEIAZ52ftM8DRhbbFD1/t6vtaFfPHmuTZQUTiTCUr+XGWRuPI65XtcpM5Fno3s9iU79"
               );
  FUN_1400bc640(param_1,
                "AptkXtkjIBrktN29NgIa5BERAMeokshA/pES3c8zHCnyHV6aS+ndiJkCOf/PPU4HHHOQcss3sbf3t9guDRmy6HfbSujRMGpffC5KGaJMIQISWJAIAE9MHvPqqjka68T8O191G3dflI1dO2mlcM9SX9Jl3t4dlfWt7/KxWvO2wX8WTPL9g6q6WhI7ps7R3GdAsEHTuLltFGi4wPtsSSDY4OTxnp3w2ihgePN8Y3K6l8i4/JZjz5UgFrtmSRkkKLo5m3sxUwqdjuRMvW9fNc5fJoB2h0KWP40/OmlXJr7Pv6T5t6Rnn1Pn5F8XLfIpda0F2DCdNXbPQgi2/9OeRcIzXz+XelVae2zCvqxZywgLxBcRfFRKrQfNFxoShn5FpVMXFdcLZw7rdGBTCHhT"
               );
  FUN_1400bc640(param_1,
                "elLgE0Tk68yVTNrUJDUXaeLFJJBi3xYGJQJ1H2KXESdRAURhpj9Zj+Jn9x8Z0tGNtbqjoYfC+JJeXEfAEs1XnWbdYuHyJiCNv6q84WxKm8LMw0fW8dta4dk+41Nsh9sF61Vj7jbry0ZsVSbIs3LW8zAIjCS7YoGE8dOctsnL1B0tVy7S8868B7W29OcsiHxebE4Pf5/Cq0zC/3Lo8SkOp3+uoSBjn8P4yvgOR23j0KuKfDHaBInVKiL3fyHGrWfkTWJVteV8ZT4uT0fyd+V5J9jPAUMHzeJ+B6FdUmm3uYML6ulBYF6b86VCXgdCka34/flXfy9v0fpeuq6XwEH8jVaM1SQAR2RtBknk4xNATPGJHi8M5s2QwH9WZaGA5/M1KGSIAMI3EZkqSAyn"
               );
  FUN_1400bc640(param_1,
                "Gu4+HzFJXwkSibWoiJiRVGf2sBYqCcO3u7dVEPdEw7Zi5/11V3wuon479dX+r1jivtZ6fdfyd67fV/tNzt19d4PdTvoMhihgXWfhuwadgkAeExAf/F3JFOFCQjvFEDA="
               );
  return;
}



void FUN_1400c16c0(undefined8 param_1)

{
  FUN_1400bc640(param_1,
                "c4aeUs14NAQBCWmgzMUFZJlNZuiKA+QB1/f/////////////////////////////////////////////gS/3wAABQCXoA+709SAB0AAAAAAPIAAAAAAAAB2AADMdzrXbAAOKt3ZguBdmg40HBzAA+lAAAxAAAADQqhSi++7gAAO2ADCAhBGsLMbWqkDQFAAFAoAAAB0AAPAgAAAAOgAAAAAAAAdBvZ4iIhNNMTEyaZDQ0xDTQyAAAAmAJhMAAAAABMmmQyDTJhMhoAAnoaaTaAADTQFNkwBNGjJoBhKe0aKGU8AjAjQ0aNMQ0GTIGRMATRghhJ5AU9TRhqeinjTQ01GhHoykAAAbU9QAABiAAAAAAADIAAAGgGmogCDQaATEwIGQaTAANTAAmE0ya"
               );
  FUN_1400bc640(param_1,
                "NJNBP1QA09ENBiAxNAA0NAANAADIAAAAAAAAANNDINMQiE0E0ChkxTTCpsyUepibU2p6QNGg0A0A0ekAAAGnqAAYQGEDIAAAABoAAAAANA0DEGgAAYkmiNU9PSp+Cp+lHp4o2SR4k/VH6oD0RhPaoHqHqAaANAAAABoAAAAAABoAAaAAAABoAANNAANNAaCFSQFNoRppPSepgJ6mgAE9U8BR6I8U9E9Ieo9TQMIyADTTQANAAAAAAA0AAAAAAAaAAADQA0ZAI7shDtMURZ0yhJ2SClBkQNDFmIddd1PPSdG1nNW5mMiy3NObH4vd5DnlHwZUd+Fe3lBU2oAECikUCgBPE9LhVTIjZCYkTEq9GR6MiL4soJnkoSgAaKQpUWihRaD6clVcSkUSiJTT"
               );
  FUN_1400bc640(param_1,
                "VAYlUD7newAGaFKEz1UCA4kChcSKjiaQrPCGLECocuRHKSJQM0oZpEFykChVQoFV1yI4gUyhM0JiAVTEI55UDegc8IjokEMSBShSLQFLQogYgBMQUAGjGBChMQGiBMQvThQFzSBQqhnkFApVDn4wb1qgF1woaIFKQaCgBoSgCgoE1WJDXYhKSgKBDKUyhUOfCgoao6qRV0SJTQqlI0hQpSFCpQgUJWeTRAUi5QpiRA6cqgDotcAcaQUNEipQNIpSqUgaYENMiGUtAFChQoZShljAincSggmaRA0yoGuDTZXbZZZKiueQEvT4FMSjQUgmuAxKtOuQxIDjLAoUmIExImeR+rkR7aUF6uREAASRAEQCYG2qA6GTHMwqp/9j2/1Li5ED9e+6d+zlI6ZF"
               );
  FUN_1400bc640(param_1,
                "DXK/56cb0DmhSkMoR/thROvlUzwhTSClCNAJQFIrvQuISkBKVA35VMQNABSqGIFDfihQe3gO2k8KDwepmyTwO6wDuwcuHs7kSAHYSqZ5XqeBteHmROXKgGqSkHq5UcZau3zCqd3AmaFzXcSi4lF+RhVEDmwhlImrdwuUAj1cABQI86AdkD3UgZQh3k6sWBQ282W3mMa9pMayoq95uoPag+HyTRBBFHKTPEi3LRZH7NBEEX5lpK2Iz9OgJJ3UAD4BFA6Hk0TEWqT/a5sfaRohdkGarRZ4y85hRToyp5HKxs1fb5bfl9HsuYCAgARypz+RY95PVklESe0VINjEnrCJHvKQMt5ng+7ZQA/Nh18OAQ2d9hTXl2+T/7/NgA/thHyZA/504UP9pA5/qMKL"
               );
  FUN_1400bc640(param_1,
                "3Mh07dhPyIA/fhPUyifswoH6UPSlQP+oEf3r9qEM0LSiUJQIFAh5eQcShiQMSPRkTEg0Aj5eVRxIuIQMZsAlIobcAFFIXDw5KOaA6MDpgNEhv+iwo+TA6JA7WU0XkyHnIE9cgPEl5svFIvWSJ/hALphbz2P9pDmSD7n5jD30Jty8Mes9JhfMwH/0jqhDzEr1t4sJn/VwHrZ4uBHZIHjS8WWEedEOCAA/dtrs4vDg2gARVpjCuyDXzQ5KAW3Xrwz34cDJPSgGlCMRCCCBGh7DoXLIk17CAEfEIAjSUo9DKtsxUPD75gn4Dlv2Qfq1RtR/hcFcanJ+A4Mbj+p5AiuSwTKdnJBlGlLklPWhvS/DHyDyR7qVGhgWwyfYzRI97Ie/w6gamBEaGB8D8X+D"
               );
  FUN_1400bc640(param_1,
                "f+r7148pG5Gn2pfkvp/+FycdG1+Fnn8LxqcDw+//cJkRRJgNFBWLpDJfUVF1ajQDMgsLLSISiAx8ur+9vcDfPefeJgej5Dj2ZB5+77dKBI0ILUQjEpDtNdtNVZbQyQW2E85QBwj+1zS1/dte7HdRz8vkx4suKF78qJebRb8uFbzMwrU+XVMBBZIRo4JQDdLLDjyOBllg+8WAOY8ptvszajmaQ2d+DHBLzkBiqqR0IijRizHcYE9cXvUee0CDEQIEkCAKJz/y18e3OEDudJC0SAJiNCApkNwQSfjZeBaFbqI/D2vL6PV/Kz9uIFkcOe2/HkxZkhRiUbUCyOJskhqUwyuqO9urOjXPLDKfv3sY2IA7TEYE4VRJlsEzKZESWuHylV9GffnvMniQsjVj"
               );
  FUN_1400bc640(param_1,
                "Vbl2QLLIFNsCSyTxOKmzJ4JfJqPQY9rbX6xOu+/o41FEbnsOK4tGBsRCMMjzJ/eJZLjoGdVHE+YxqY28NOU5MZqaHztIGASACSNuXOZPs19h1mNpVnkRxKMjVE4OpG6QgCzoRvrVVXtW2NR77IY+jK1+ue5iqBAR3L4fEe13cwIul7loUh34mOZEVhd7CA8DkNAYIhu0+J2IjpawcEMnEsMiWoj4ZCnDxj481Z8XcMEmLMalGTEo5ayEpkryJ5poaA+RRQRoTlURqIRoaCjEjFsUsTXNAogwL7sa0LryH7p9s++2Lu9ZkpJpQASiBzIhg/bZCB7+FByOJ0nJ7OIWIINjYiEXB1LkonQezYTzUtadZsGpJHBaHvrroEFihgxFEGlho0nmXRNmhMus"
               );
  FUN_1400bc640(param_1,
                "OGVaHd+wQqPCuUyQATsDJA2XpLhPLPQzWlwOEhEvQa8ZEqaEiAS9aHCro7UueekhNbeWeutPV6OBkxr73jUjP35IHppRHGqASHQ8rp8kE1qQjwlRolHI6+zXozQyYnbo+ZHGt3jeNGEaKyhDaAFkBNkMykH1qdTxJu3gkoGypUCjGeMsY2yXNoeBFGGrqQSPA73bAhYuJxVMfZmiOCo2Se5CoiZCodq8pi6QpuDpMtQKL6K/GUGumCpmPjzo7bBZC83xboijEYIhFFs243I2Xu3GO+6n0kppaWdnPRCSBRgAIgc0gal90ziURx7+vdw0vQgk9ENMvlIHJ2GNzGEg9km6Ex3mSNjZkgcs4HZMbkR3HJHibNmXg8utCdULNkFbvx5rHNACzGNtJ8Dg"
               );
  FUN_1400bc640(param_1,
                "E9++ZIyYXBQzENK2oJeyCM9iu/XtT9vPa9Ob1oYMXBW7kyp4mZ5mK7lEjVRJ3wgD2KyAKIHbtbRmOFjabLBI6IB3M6aazgWYpIMkSdicoa1ZRvoqrD0lC46KANCSTAHiaJjtvRjWMXPeq27FU5KLI6JQyOpCLOOfT1ZoaKNzk7oU4SCDPYYHxREkPrRa4U+urD0u5kRm+Scmt0Ec5TMFqMmBzIxahaJA5M4y9yH2045GBlrXiUzGQDwJGinczmYA8pm5fq8kMEIirnfqpoUYGXYYcrrsgGRJBIwm8MlRzmqmDhIiyADXLFaVcGyiV8svJqsWhay0QOE4mSYjvMddNGQUcHbC7bUBgjkNVEcNNrHSsEO1nCMqUAhOqAKUQyCQkaIozD1GNqmgjilC"
               );
  FUN_1400bc640(param_1,
                "JODA6Hcx7hrYws7NyZZ12mJnYTMSUREmIEyiaS1KOcKMGSrTMRZnMulISLAsskwCkAMvZ6NHp2NkEjQ4aem7iMmBqaBsmUESdSgYEURSw5agMpO5GSB5TnGceXfjjalgjDXGqcCKMQa7JE9EolcU2kIRhEWsOiyDSkshGAmhA+IYG51yjeGiKMDgYeb/HzNqtfJ2yLMA9UiOBEDOUTWvDXx0F4UKALIay53QgQ0gBoRoDEYMCzgjrrMyEQNDEFDGJgIiz6RiLxjUyCY7ktDEUYEPxQGrQGp0qWGl3EAdDEXlRpaJjQwEWRAGEg0VVoRVqI1tAQyiMC16bCkjwdT/a4XsRF0hqdiJMDykAIi7UHhliNStFN4YhmI9XVDQi8IMgEgMiL6ocWoFHZth"
               );
  FUN_1400bc640(param_1,
                "mIRAwQNTAzdMEwIxhRFEARRgDyEC4nTKg8mEFR/BgRM3GwAaYRa3NOEdqqlO+nTZRoKlKzmDCaIHKQiDQNMBECDhPCi7Ue3lEloAcSNDkHttZIEYtRBMC2oUVJcAMgMnzKB4NXw72Omq01UQOw7HUjVImBghmBnHVxZEHgQgGlHEhERtlMgMwdFCIM9WHQQJiK0R4qMOinCSgIsEC9FAhsg+YvmZagFWwDL5ZuwAd8Dbaak5IFSgSABtSo5oL0zAGSBR5EWdpGWCpcQLIhEDN0nCMWY2MQ91A0ygIGPUyxgGQYgkAkDcxofi5CE3cyS3wcY8iEDYigcJNhYctmTEDcoEcDN26MEhkQ+i54UcLVkcMt224EI9DF4ObkXinEBXMMHz7N4goQGRHUzO"
               );
  FUN_1400bc640(param_1,
                "1KRjytkxaUQSjCMJfFEOx1WXNzAkwEdyNDG5x2LvPK+lqZ0nKmHJQG0lanCbj5owBgvg0wNCC0BZ92WQDxp3sVBooSQiMmdpuQjCUuTGCpCgqmzFJtkQiTD3QmkBLrUhTK0GjsisAjgQGQGjTeDVS1xLA0MRoe0geHu0I1P93MsLcFRsYJGng2aWTDRRnjjjU/NccCQINqFyLYQSPnghtUuGzqR4pCNiDs2aIQnLM89VpVHAielPhSnsQ3GcMEhCyhtMsQbULtTI7TttprppfBJquDXQ0K46uJLI5ckNnWQ1I2v1NJ2lhbDFAIxArP9B4rmxiUNeSGSIxohGp9M8zFSdee2daWEOHcou1WcsLN1oWeZiIVU0RR8xZa4HJMxsQjgiO48iSLMVlatS"
               );
  FUN_1400bc640(param_1,
                "e1scZZAD3UNHHtzHmMjgo72yxkewskbXbNKiBZjbZM2URggWZnd9TI9orBjBBwtKUTl13ganm5wHiXJIIARjzGSCKXfpcgzGCidoJVSm1GpFEQaeQ6lEVEpc8oUR3FY3eUuhHoMROqA0IG2VHDXDWOlT3mMu2FjosqqAe6Hi4ljUwBwI0MvVSJuDHDm9zINnRhYUSWYA3McDG1IUCR+NQRBwdqUxGRi3lSKqoRgMjiR5MzJQxdwIL78oaGax622LqyF3Nvn0c6GFEAk+tlvRAUX63JvlsE84TkvhMATNuNMJTT+qKMvoYjUi/BUQwlk9s5BLoiiJMCSIy33TzO+eLRuUMdVT3cu4py+WEwT5ThnQ2eUt6ccFVPCUdfbxIzbFYmpGWuBkgURxMYaA"
               );
  FUN_1400bc640(param_1,
                "JAzUkPBGbROqXphe91x9SnOFohsYA4GJIlIV3LpWlzx1zr8dyxPLHdpG1qNiEYitWNJpIX5acZkISY7r26zZAZjxpakR3nXG286Hj6mvbihZCyOrl8C+hyethDsMaRw7mANZKHDaWj7ibjRWPHpTF04ClcXPRSCCMmGQBhIASJ1uRJposN6C13GSM4U4Q35sOCaOSAjRjJydbWCcUEyQTdeCYZJkWJnSqH5TycbFQBUqyIGdatKmp5OpQNlLUtSNJw0LMBEDJHAs4JrLHplENe+0EjqQZprVQA/OVHPduBHLHDitopSrPhtVyT1IjE4yVPMg7SHZyYAsHolPagmrsTKkHK9fbFjhWCNiopFjLsijEIgtVKgNFCTo0HWMhs2NSs6fmeytRzMDBAfR"
               );
  FUN_1400bc640(param_1,
                "QMnVCU0aJ4d7iKJsJEeNKwCDyQFGBmVHqGMvhshJtuAnTKOyyOtSYgURJswtZfcgoFFZbRBzOs9jpLwqmZ4uxqeNzKAjr0kOOFcZEk5OjUY3p0n3KSFprIc6cNiKkwpYmcbRLJGpA1MCz0u4Y4i1PaqGrD+IYFdUpVmyjAkwiANSAFGyCMNTUkp7MN8Hloi6Za41nGi44dYyVKgPQJGIZB90h2NctWmMDEsakMsE2hW2zFWFHYQiI4nBEC5VmDiaXKRysaldJ7vqdbabWtqdeX3XB0PUymDZ7CMkSkASBglB2tPBXFEm+XCsEUBd9SxI7yrOhGJz27OgIplQjg4oVSWhVDppTzAZaRt0xX1NMkD2RFVunFe84g9IjC/33mve+Td953LdHZLV/wBG"
               );
  FUN_1400bc640(param_1,
                "73I8ru/PdQObr6OXunndY7d562T6WQPK6GzJU9VCApz5QeTAr6aX1UCJ5uUTRCinOlR91gMQI4t32jAOPg8AB0IFA50nqoVPVyCO9O3GaF3Z/6jL0mDglF9NAibsB05RE0Q8iBaR34VEN74wwga4DyZ5sIjvQcHq8HIjKeCTf9Xh9/nqpPfY7GDcg5c7J3YHlybdrl3IpQHZHyUnBG7CIPDCegubAPBIAONeB0SgceEQe19twp6KRedLy5UPbJ9ZCgneyj0rq4XTKjvSjiUAej0MO/KB1cKPZSCD7hCHoIE6qT/2EDqQptQ797vAhy5RE2qjsIB6cjz5OjJ0pHnQIddAnJlU5UoqdfPrULskG6WA/8g0SIbJ3JB6EJzJQeyhBHi42E7Taz5AcEJt"
               );
  FUN_1400bc640(param_1,
                "WaDEcmUGhAOKVADakdN6WM8jrgOTIG5czj8nJM1lCc2xBudPBlb0bsqcMDx7HZYMoNEDiXny0qfO8GE5MBrmnRLmg5UO1Ltb+DPD4FslUAK5IDqY8T4GSAPOYAA9wiKI34oB2o0LGgUmIlKZ94lM+HDvqR0PnI1NkAYPlHsKNtkBx7UBwBtGnWULBsFzzSJLCPGSQooghItmWUuFBdM8gRjamqq11AQypUt+Y0BilJ1EaS60xQulIT70jBglreIoQWKDFVpSZEZVWUpFsqRJN2PPj1WhiRqCxikJgP3ZM/DauUrMphBkkIwVIAy0BXRqLPSmlITFcqpdsQ5GmjNQhQNGJqarIzrrc2AynasacY40YcTsz4FFHjXWw7c5558G7AGyeRGqQ7CE5N04"
               );
  FUN_1400bc640(param_1,
                "Da2YNlyNWM8GIDkSJ9dWfPaFkSR7ZEaHzmIsgZyo7CPeGANNdHGmFvwmiNqeDlcfJHdtqeXatOOznj3Y9XgA7O0z2/Bg3kLhSICO5Y11QQqzInXuKjcI0KiFZCiiHoWL1gLCpXR5WOVdVLzbdjpQdpPaTyITsY4rueZg4LZcU9dJhETjNKYRSoRgwKCUDaIEBkEDGjqQPuqkEAUjSMXFYVlPQFFCFBlIo0Mai9AATkAwv6rgDEq+Iaci7UGJ3J1xrg76XsuXg4pDi6OA1TTRtWJNzLBt3Mg2bmFABOrkzwrrh1RvwnFt72RtcPFkL10Bub2rJ5EDjs8ByYU7SF1SNIG7AuyA1RyZrgk5ccEpogD56Q3JE7SQOCVzyhsg7GM3DhE9/lKV66AA13wc"
               );
  FUN_1400bc640(param_1,
                "8eB5EeWl5kIZpDZHLk5soeDFI54eVFAHh2yAzVA6IXEBtSCAneyK65A3IO1kDlwAb8uq7iBOoQp3sjrlLn4QMQO9IBt8GDmwBwxmlTfhHhgXik4ZPn4ANcmmUO8kOsg5MBq4sB5aBeTIBuyO3KB40Ccy7WM0py/MYejI8yBDXFDxQuaCm7TAnThDsNeA4ungMoE67GBPXYOdJSiAPQCNUr0o6+DNHRz453wuFOhw4KRONI78AdlJ3XcYyjp9/3OSB2+5jZ2G2Py7hQNaQ7AYycEEhkD0FmPORbUQyOpFnBj2WhvKHryFwMmGQzHaQDnfyelUVVPBA1OhA+v0o9u0B8YRuYivllFDjz18+9jBwfhJZ7tNJ98R1OeKyQzxyiDjRubOVkZS7k8iQpxd"
               );
  FUN_1400bc640(param_1,
                "9eDqwPWTvbMD5/VQHsGT6Zkz0hRJ4mI+E0Xl0J7fjvq3tXEZI8ezD+M9LA8eTZJr3bAd1BonP2GE0XRkzQeBJuS9/veccZKDaWjGsBEUkBiUBXV+gYUUg+wxD0ZklhxpVGrPyZbDpAbrqblKAaMQht9SZxtwS1oGgRBoxViYUFkp7ZsjcxA5zj3JHf7QUbSoHn63c5BwQLPpEcFXr+T43MQn49rV/RcY1ZVRXSF0osWxIcgbhAY1G/QGPVJDQ0Kd0wyKuloyAs1WpoAOV8oZeG4wIGRUkBRQoKVNs2XvSlM51zYVd5xQtObq0mESSBpHdIGvUUEssKSmQPKUyiFlHOhQwmVBzhlrTNIGIXpSkmGE5JzSBIuKFMgbB2GPTrFQiYQEqkWKSsIwMq19"
               );
  FUN_1400bc640(param_1,
                "fSWISgJAJXKVeKC7H6lhNY55oFNBSk4vFvLRgjL9MoTiGyK5D51nFCS2pbd5eQWorDDGlhtBYdKVWPCVhHCLpSOxQUtAo2TYBomHdUBCztrhxlO4hjCo1k42Bu2DBkDhSMcdTaJOdE4vCISKVtANcaOtgcrEcayk4dXr+Rmncs9v2aM0KnlQooh1XMPXuh3udByheVUvO9HoyHx8+3kngScM5F5q0kFZ5Tak8SaADVePHWcOO5z4DVDy50wnQnxZd63Nww55Dn2yc5nMYjzEHTJ8fXjBDuRqsufrDJc5J0snHgxr52BoNnFgeXHG8XCceeMWIaMrgxj1qdwnj2eONmxSdtc+KeKNe9hciUpAhQe2rUGlImapFX017hpKAmonAmMyoIEOVnp3MSRH"
               );
  FUN_1400bc640(param_1,
                "EiOhZ2HqqIgXIWxhdmrCPoMB/ZEI8hUbUcrp448FPdR1UBXaXfwbsPXR1kh0ZXZJ1RMy0hqjsZ0EdbD3k9t3OFzdt0shOGNlChOQcjOQIvFXsaxYgGQTIT1coJVkLhCbjHuBpoji6mE8Kd/j4725kJR7VJ5u5km5uex72Z7KTtz13HayO7jZlplOKDtbxpTT4GM0h412d18nXRs0HgZHPPHwHBLuy+ROee2jlXiSdqztTvR1kPKqMvaevy7+xL1NXsGRtEPsUYJfQwPj+f0dfxdDQ7t1IzdZhXbjwyHyJO2jT4XsmXBPKvEg5UGa0c7AG5bb5/BouRCd+XLwdWnORhEWCG6FChKZQDbmKTdPkzeeSwBikCaX346wgjmSUGnCFAdnOpOkpYfUBoEn"
               );
  FUN_1400bc640(param_1,
                "XKBGHeTolMjIMs5RCXSkdpSTNVQ7+nL1+llEDN7D8zCcpHfKTC60qXUUgwiKBQVpWVcZiLxaaZMnW435XZJbpaxKIjjtWJ7yKKENOi4WkRVZjUPIdE0qUxckoDk+mZZgaDJAxim2woDsO48Mhbg38BhhEHBnKRMaWpBOBwLb/iqXcmm50vqQVV0uzFDjUeUrpKXAedl7wtyq2hSmvAcRpmExIj86uyIVqDhAimLUV2mSQNMjAdnrQQ6zrGoylYjMZUo7+yoSDkkJptUXGMmNsxq2w1JM83c1SKIlyFYDcnR7I4aQZlZa5ckWoY7IRtuQOxh0FCgcUmKRPMYhHZ8Rx7Ur7Pa9nZatAIH3MhPX4PujOOe2nlr4JHyRgLyIEjzEa+CquLCMD4JARfRC"
               );
  FUN_1400bc640(param_1,
                "PfEfANA8eP2KZRjt6X140I9cj1j3eXVjloh2HffoPS1zeQZPvDC6drAJF2hGvkWnGhmd7QCIFGA0EI4ED0d6GTHyhjXyb1EiLBGgqQ92oqCPfysi0zAOR8PjI9zRQEM7YmjEaEKp0TuGnh08Wrx9OmO6IDr9Og6rN2M7dlLy9vCp7XK73e+NkgedlTmQHtHlYUNUd/AIGaVBECyUCAIgF7jX0Zuvco7LoHJyqA5AUqAe0sIsXz4pKkCID1qFwhBn6ciHZutVsfGXjdWoOKuplBIIgBRACSSRBRUidDPPLYCDQKUN+BcQ3n7PhiMoEjg8Z5TpHYBGpQgyqObIFzNjZOXEQBYISG7sdbAFHdUEGXuRlgmnl9HKwiClwPc+gceR36qauCMitWHTKucM"
               );
  FUN_1400bc640(param_1,
                "mYDDkcFKV5Ggg1iANYoBfKIg8hmEMaCmiHyISgv66kJAHKQgvENmqY9veWAMIpIGXnZ9t1oAYhFEp2FzJ0elhEyNxSeY7HN4Kd0M6eLryGOGDsk8Orj47iXfGrqhUgFogRiTdv8GtI460Tu8TwGt5c7n8eM6+5q5dq738kNULAVDvObe+yAyDtayhqa/g3GAg2jzCLiL5MS1XYHr48C+7It+DwYGZxuCV14Eq9kNEh/So6WXmyG0pvxN7VkWMpwAZpJqW95YEbRVUs7TLFOdqrsqtSmMgGAdSqYGxLwYnc5UcQYDHPPuc7SCmZpA1XFIIx5Xc/t6M1/HcSkfIfGRy+TQqMCUOmpwVUlZ1DedEXT1/MwgTuoWMdVyGJfuWdQCDNA017TRPURAbf19"
               );
  FUN_1400bc640(param_1,
                "9/6SErQFoB1APn55RMPSNHziehwVaw8GDrhz+dWVI7reXqbjUoVBpvZHSrgzFIlrAChuEPF6PToxHg0fGIZ/saHPpRMZ5ANE35OQtNafOKx5PCrntbuS+120nM+gpzkUIWFBBRKeBcALDhCvdfYj9UWqUBbEvaWdC2/DnZda+5o3oCAgNN+BhB1AKAOpKBhgiJQZX6ExjOwt9qOQGSlWV4VObFK8JjgFQDHs49Leq5tZin5rut0xrUuLjbW201iqHlLJAhJITGNcG3NVjRlHokL8NXAw2NMN7y35iqmXy8E6DRbQYtuOtAKhkdSg7eCtzoyWOnL34ZIqB7DxJ9xhE2SiRcKYVis4qhtqsQC8aM0xWph7SHiyQgrECbhNQ+J4NbeaoOnloyc7EZzu"
               );
  FUN_1400bc640(param_1,
                "tSn7K5JASsUxd6n1sbxkCCAb0yib7+vgB7POuQgxQQxm2e2D2bfRFybrz/aZhTDIu1lATi73l6zDQ4b6liDIwZ1SRoUe53ViKSgQK2c6sGvrtMQGCXrLRLBLHWrD1eiM3jg3AYvDyBYlZutH9DKa1L89aCgfCQI3arV4p+jrs8BGCScaKq9meYZU+y02QGiJwMeHG79vG1W0dzcVYiFkojaS5wwu95WpZQcR2CBwlJwNjqpcUpzYbwTcPcYh7DzVakugzXKdR1CgescWzY0XrPLkV8nvRYowxMmTOSRjbwzIvPvxQEiIQ9jc7tHZDEmTLk33qOluSI+kQErl8gaBgsyvBiM2wUpUJG3T39+054u2FdxgK0yABUjjjHWGJF1XdwKAQU9nTeDDoNx2"
               );
  FUN_1400bc640(param_1,
                "bY4eqY2iVjzaKkCTSsgDkIjGEhMg7DivCKIVvjlr9/RZSebpjFJpPLhreI1ThEZfYp4oKFlRBwMO+N5jkLXHhUGASANvwBWtfCsm+rgMvDwtaPGzGwm2RSBFw2Jis85QIe8aYEPod9p4oO0iSUHQZ/TdXJIjRNXkYnEJRiKQc3joBd8HzGIH1AJnd2Gva4O3PRiwUAtA6laM3e52gh4IAt6eGudgCQUQRvConNEUXFjQKIm6CjXKrU0VDpZ7zezB1kBpjZJskxwGRu6zPPJwo9/x/LZudnPOyuuHUXUrqGPXDd3ctJ2WNm0YAO6jYcRjUez47fd9DkmeTK52OMZD5nRgDXRDrqfYrBxu60+VnEzwdLwnzW6wkehfgYRIhGOaQKDiXL54XXWwEZO2"
               );
  FUN_1400bc640(param_1,
                "HnL7KM9BRAHweQF8jbPSQ4ebrvLQJPIdO8h27TzIxYJ0R91ANQtg1SkoG9qjqXvmSZs+PGnXqLaC6UCYUwOUKDKBJoNQGoDPBxSJ1Ge88yBFIFIoBARsClw77ADZQcRTqGIq/o4WO9N0Yk6c8AjYxVWoBvheYI8anmR48ZxBCRq5T3YzVnvvuhJgOi43lwuNADqOWGOugwEEJSofBGrtsIBGBiA9YKcZ6TkxJMMqLutoEZBkgo42+uu3KWiTgUUN5sbuM6HXajqIl4zAcUYA4RsCRHlQWZHd2x4qAOkJVz1zbzwdoT3UCOBtSWcMTwuedsZyo4xFYlrViW6rSAC2SRAD02Ws2wygGwRaKQDUD2BWp4MaNhR6VKNGSeCgwAQI02K+/TdbCCgce4/4"
               );
  FUN_1400bc640(param_1,
                "xTGmOKPHstvImOJyrSFHC4aGe9iP0MHCrR3kD5A1iikiCIt9/VRZFW1EmxGkS4W4FCPkDkWI4jiauJdcWgkkMgh8pLB12hNDbFefzrQcZQaWSoIkooK6GOaIKW7YUJSEYQggW6mTRkzNWlLnCq8H8GSsBIDUMFOQsZWg7BBFg0oKkepEQTSSkYi0CIxQLFakIAxDoW8CAR9yCB3nI2ignmKRKHAKMqrKbkyYMKRBFSoQ6CKIPQYDHaj0HKjVwjDIcpK6MlXUJ8SJqMi6sTljPOGCBrnGalTb1Ki2PGUSmRyZfY9Rk3TF4+x5EbGqFJi9QVxy8ufFn47aJpWAobURVV+2Fw1Y1DNiw4yOJSBQPoQwYo5OzwShKk4F/vRpkQTszfusBKBFtzm1Xx4h"
               );
  FUN_1400bc640(param_1,
                "ALGdn6MnbwYm3zQDOBeNGsFDjxFdu8FWXOJdkNqGzo21gYJduPLe5j0XptYNTjEKU7RUm0cAFJW5j6bAkiSi349GpgYsh7gISKZxEQFBUhVF7/HMkWmhUn6teZdzp25PnP6/IrpIEE4KGARPJO8dXtnThnirmvc1t6ik2obvJOxm+a+pIQUBLHJv8Pj05kwDUlPo9Y3e/hx1eRQyznFB04YU7lZfHY0gJWJiSklVMiXGXGUA8CHgU54euCRg0nHJGHB6O7qHEqy471Kh1SGBRID5u2FJjXOlIYYbVHlt62JkVmuTCrzeng2uKZADlU9gLyjNO7jh6RMv61eW7peAzl7JQaalDTFNx3GZ8NvL0BmSd07kvWuzK8jmix7hApW8tY5lCJRZsysdy+dy"
               );
  FUN_1400bc640(param_1,
                "VjZD7MwuJaUILIVnbNJbnJ4VjJOxtZ2F3+RpJ2PO49lm6cI94+UpwZqiRBjL5LNjpfktB0nEq1YhgZQWAepVCn7AEQw4WAAbK0HYTmo2zNOrhBF6msvVBakJ6XJDoACw/o5EMBEFyGVIWO+aJTQIFIjROvgKr7l5aN3oee9NmTM+YIwfhmeXkrzmgncQLp3TdyEw8WLeangz502bDCMTPfobAfoHybuTK3WeojwkSeJQ83ZPisc+9tUcqhPn4re54cCl5pUyNAMEhBi0wrHOLGU3DdsTGYDCHNGTbZ0tfHzarIFMhIgOqUwj0RFDqDCvLfv3LHDRF6Pe6EfpUnl+MVovyM9QlwEUHUsAmAAAySpN2gAKgCw7xQ1BaeDTEiPMyNUsycVqaPHSwrzI"
               );
  FUN_1400bc640(param_1,
                "yyk8kGvLcqZuB5b+t3T58/J34BBGzaK0oscNVgPlIQdTOeFjZlhqgg6QpemPDUVGSAzw5oAlEGGlnCAg05xw4GIEJUIACu809d/MaEAqqkCBLseha2pnetvCx3susyyA2CI4PkzyqjN2b7CrMfnRqO1kz4o2p+9BJ76ncDGVM3+rB7sO/fl5bwEII79VUYgR79dSwxnTaDEorODocmhEwn7Dmj5evyvsokemQoZBwoZKyCN1r0PLxMw5K9tnlyM7C5XrXbam1syv1z5Pf4Bl7VpdLbYxpKAbBEQG/FCk0MPl0gztzyiCH5QZwF+3s2Vaw5MmfaNwHjgAg6mpTBrA8bdEMEGSXODwk3TxF8tjMuN7PialS3pSGRgJGdhp3FC0y50qpeBiNrKAGdYu"
               );
  FUN_1400bc640(param_1,
                "ytVmjbUI5xeNScM6duxYR36GXjULliLACObos5zO9o769B0AXUKW32QM3l55I8kCXbzpgOKKSGRlRC0uHbNyVJkDbWxJoOgAIKAQAD6UAFj9HHmGtqUHNaz16lE4sSbKdFyv0WKzOTY33pvJW4HNGfr42I9KbAlEARzHBFVC490bmrm1G+nmU1HqcFOSGhqVFZwPbwKlkafFZw2F1+XWc2GpMChklE0umqFuEG3GNms+0PJjtRQx74zhdnxQH7MjUr0fE+CQB8sXSI0DqamorQ9CLKF1AKIQXRF9oPUKbshgede0RIadNjYK7v/gb/M77W5diKeOr4O6Uf4lOBATBASxp/ZJm7PXzTMldqlMiNxtDKm182m21dBwStqfXKNiMF312XSdt2cdhahi"
               );
  FUN_1400bc640(param_1,
                "t6uX8mgN8wP+ce9ybZZC1bn4z+XjasFgMv1LbyjfIEDdvKCADO7cHI5+bla4nEZKBBld7hy5bIRyIoIJpACh57nRzmpmev1ZhxR9eHZ7XNy+iXVJVKACA0E9kSOaF6EMVxGFhSjBbXRqwjsGsADJyochyutiDPU9MFJR0+g7TCUTTe9QZIbnuSe5r05cFr1Ykt91p5Zvpzy+XuKxPBEyJ5+yY/N5n/XSJK5T4zpjwshkMCmd+qJH6PHCrRqJ4Vr0tftFYk7BPjGlesPTfPRqVHxOUxST7TNbDE2ar2H4ZQc2BiUxPi5l2+tMc4BExVJCl0kAkRk3qpJUBYszB2RgJFSyPeAxjKUp1rar9XDBvUSci5dXJUgY0vFkmgECSK1mtq942lt9FzGHB1Y2"
               );
  FUN_1400bc640(param_1,
                "KDkfRLm/ckrvsbyn4AnasKSEHMoaEpajNTenAWqOjW6TRmI3RZjLszblhSU5Kvh4GZJ4M2XAMFnxQK/TQkP6WwNH2MiCgchLKa0bgTkdR7bPDYPogyMk0bWs4i9upL9W7TkT9ubao1HyQJk92Ug0kUoY1sXp561BsfgamGXdlaq0MboX1UWsYkWLWfQINATBgjtzAKQNwWk/gI1NhGLrUHOLbazhUjzkN01lgHi0SU3zwLes7wKJUgt02E5Khyo8mRHgadUQ41FS+xJDYmUbu1hJfuqTzhitQhJi68UY1syefefiDxPXQYN1xgDi2KRkqYszNTIJBp4bgVsAKuMhLso3yY5DA21fWjv5kOLPnSQWCNgyfrL9x3rZpdVFEOLh9aVtX8EV4RP28Upl"
               );
  FUN_1400bc640(param_1,
                "pWAPKdbF8rSTTgT+Dfrhxqk56CAzbf8LrgZAqGmqTg6E204+rNy9g9Ws3ps0m5Q/UpFOoaMGME+vvKLZZA2WpLuLJsY8fknrUjI28liNpkADC7SA9FQt8rJygqHsWHNqwPleAa0qyg8lY95c5i1nSWs1iTWK4u0kFCo240fCEubYsgo6GIPYQKpBZV8uKinYOr1OBKwsbeZeLbtfa2VbE6Q6XbyZKexcYG9GHfPbjb7vFvH5qdR+4ze36iCk+/u5TBXHxgDcCrQwwoiFaYn1Sl135ghL4YF3u/Q8XkeX2LcPdgIQcnyPz3kATt0yjH+BxGfY3JUCrub3ossfV8fD0cOEvixUGd4ehYpwiVOKTDo9/t+3pPxCditlr/blqOzNvczLxRMEEPF/6gop"
               );
  FUN_1400bc640(param_1,
                "HGaDhcWIMF+anSS40QwCLHh0hABGkAAeU6Hp31og6i+IqkQcmioIjHqXnplzhab8XivZeLG9VmnX2e+Ll2d136B194Byku5YovJ2ECvARtRo+utj3YSOwrAd35e4J2oELjiljikoccUPga+OR9TWoTFfTNZTVU7D/2V5fARmM4pWtBGKhiVBO6aloYVysvBYO/DiVHYhOgk88qxY8AY3WjNUallffhPea66CZFfRRHXdF5ylzbzEtYjxwu13TjkTNctMmlxdXxDpI9cTsl3lFZ6oZFl+VGHnxX2v2r0B54sPOcm/14ql967rNKx3J7qXWDZkmnEBqH35ULiGb3XWJC+4wdZQ8VrXFrhJgnPvj9LTYy1ROcTaQAsRIiKrxyGg1eyhGwLPP4I4bYG1"
               );
  FUN_1400bc640(param_1,
                "ffgt2azfRuQMevLbEMLX35R44CtqyXTLQ8eSzbnR1ysDJ6eTZ3ehGs4+C4MyLt6Ps1H0lpeZYnEbsjbKq1ELuvl4oWJ1uVzrJ6A1HFK6ZC1/KnKS23SrjpzLneo16LqrMGUgzg4qN+fsAvtrNn4Gi0wn2Bu3oT2xsMyRpMLibD0du+MiaurZv6/Ul09uPmVEiFZrMDQ9jm44HIe/eDDGV+rvz34Lb55a3B5t98tVQnABPVtUEWLUdIz88yqA83wq907fSi1jIINEeXabFoD3H4cVzf47261MmUGdbeex4Sz8haEooJeBokcRJwCE1G0MNEGzYaAef7Pt9BOdzeTFMbMpqd7YXUk9wiR6n4eNOazRwCL1+oEfl8HgBj7Ydvt9rs52kiWvUrN076lq"
               );
  FUN_1400bc640(param_1,
                "bQ1WqHM4s+YvYJyXYMu/l3xce5mPmD1lQkQZqz1sOeYKWwLmKqtiDS2C2O1v7K5KCwyxFXyyMh8YCQS8IieGAhBzaUgAAAPMUESABBysaSDSMQVlfMOCucrqg2em5moOts8c0uhc21rXyqFdLyNKti1oArv3nXHl1oe92/LA1XsWv81bDkvoHLTHG68X2zfCtIUGiJhn+SjEKfleOynsMXS14AfH4flPIisxQ9iEQ+949IfmzmIlC6UpgYhkc6w5OzoGvOY9uidym0KqNh0/lRkYDx3NoG447HvfHSCOHeeVLzkHU16QwNFIdJ5Kr0TvaGKxWumM20NNK96Lc9mDW0eZ2ht1c7NyypBZyICB7bDPr3tn384wRK6pXo4Xmc99fPzocK9sCFs+WgSj"
               );
  FUN_1400bc640(param_1,
                "cy1c93CMFOe6vv/ZRGdIw3FIomrNj6qMeFm0dRWfadjDnX4CtgV3QkInO6OaF772rGSBUnnXqsRRkSLt0RIvHp1g1bhTDlBVOIjRJ0KQ6mWO4NaQ8yU3cVmPcsFAGZTFKUsQTM18DKbSxa0saiXDemy6NwpePriJGXfUcVEJ0Z/QXkNJPatjYUfdv5BSgMszIekVEsVSv1d5PABzfdzudwO3ubvFqN4dp+IxDoqtErsZ5by3Yg2/w394fJdb9vfFeuOwaKe/5do3E7D1tcTD6BZN0cuYZ7VahHUwfyZno7bryqE3PnSV4pJWdvCMSGgqS7ewQBIU4wWDjB03AIABB/gxCEJkiyBBaDCjMVBIgCW0NOTLSLoSUbKN5ndFSy9rQSpydcDZVkOzdZW2"
               );
  FUN_1400bc640(param_1,
                "q703uaXfY6xr0xizSjDvmG4Lk6J4YCQQnIr6nO5ifskBIkhwGSCwQumH04Ykuy0QOkcAvVAivIOTQsGAmtOK9ZuMdhh2iJQ+93BGo57sQqxZGmo6sYXqKRHncNdKheCzJfed1zx0o+r0VXyvRNWeAKrFuVXrRJZqPBwiIySqO5vpQzLsRC9IDsbxbKclaVHwNEwT4NQRAZ29s4cQNjYrlL55h1BzGV7tDw+rZlphR78SzDgkSV31Rs0qhmIiTfdwa0MklvzNoEtCiXBfr3Z5e8uovmMAdUDTshtaF0hyCXBpTuEDFRMQgdSVtiVnBaClzMz+NpiWuzr+NdbA/eniI54eZzcOG45AfAD/8ZIIPw9Ho0uYLIRXlBpO4DHBIc0GTFkRRc3WQ7OHItnS"
               );
  FUN_1400bc640(param_1,
                "6N1rpWbyJ7z7HTMEuiV0jfTSUlrupYQEZDmQisOT4l0Xi6gvoLWIoL0/MMReoGE+1LfGHsF+cWg++7Z/sWB7rk61+2PwRvFAE9uUQJFjqA9UQPb+/Kr0q+JPawPSnuzywXbe8tiWko6Cu2Vpamx1Ok2UNcwZ+BrrCzLMY4aCiXyyZrFrojSlkpI2ztmvVw64uW9Mt6NJFD8nvpIcmDPUX6fYfU0U/XOfyZHsLEedgwxM+R5fLFbE1ZEXzteqSS7z7k2JsEj+Y46ivJ3VIkuCMdPez6EuY9ky6LwOPMRP2JzMFeNBH6sBKn2XbjqH2BNY+6hXmRARcFhlE5RLLHa3tfaIOIAkxITSFmm0sgB5ob0MKuBsxzm7UQO6tf7I0JRUsJtEWOkXC7DX9Hb+"
               );
  FUN_1400bc640(param_1,
                "0/s6MxsO9ke9ndfZsnU1fk/zW/hZ/1EfvNvlL8fKw1Y0lDz8wSycrSwy8tJHWO/7l2PWi3o2n68hXw30cicX4FTwFJqPMtvj3/WWWxuM7+sx+P6v3vZR/YaQZ5d/hUkaUrU5lbpRE/QICJQh3VgBAsoEADnWqec0gJJu+Nxht1d70qXXBId7OuTE7PR8fbT+33lef0+G58DscxFprvLRIwiHui3VX/uKJUPgFFvcPFix+5AMGDGFV8NZ3a5mTO7PtvCuye5dlRiXczJOiizn0hLvynTqI/iodajBjcubmamn+3z9xL6Xrel1FJ/haXjd5NayWHQhSVY0x8OJgCmAxe495tLL2Sv4q810mAik6cQyEC/F7vs/nO/Gm9IMWySFhs78OdrvBA8Neys8"
               );
  FUN_1400bc640(param_1,
                "D8u7rSlQ8k12mnTFk4SO+VRMZMwpw5LqmePN2ehj/HA6N3j9lw66/c5t2rIby6h1vmPR7W9u9UqMeVpQ3yGSAPYlPhyOppQAAMwxQowDKGwx8aTDMCKYKQBF9OTpVvlmyPhnGmOXlKYNKSNQ6TC8gPDmzph34fTO5N+O6SrPVyqjbS458xk8kqnc5K3zLAu5oAfxCWfsnZrXLr8skorZH7dRfmn8pKuM07QUEmpXY0ldqgdBFu9S4syfX8G1XXeNppR4t6tKtHdZgxd5izs7lk3XDctU9I24L2C79vS/+HnMj6k5PsZen8z4bw6l9E5wdNI3a3IBinmdM/OFO4bac6fhI67xFklYzcnDoy5y/KctTDHtStBGuTeUKRELdpygvMMKUYBdDEARTsQG"
               );
  FUN_1400bc640(param_1,
                "oBqau7yaOtFWGzOV/NBOWMsyeIzb7PI/7Tcy4ByPNgfkQguTowkypD8/eCE0XBD+WaKb9Ano85fe7md31yKjfqK8PuflZprxaXydcIIHuyBu/tgPVYMaMGXXaer/e9sT7Y61Li85UG331t9P1gu8L4hvOXAzevk6xijwRA9hE3FkvtqytwlIrVXgut7CkZq6TU1UKuoHDUu74vwdtdor1xMTS1x0YLKvH2SPFTrkCtg0Oq+RxYN/nMmX75gA9AwAQCY5tSSC6MNONZoCNGsi5GIuaBaWFYikkZMsFsYV6iScWc1qaMxH0s3ZG3g0+MTFTURDDEvTyvUcujKL52pmp89UnzjcNenFNlqSn4/tj4+x1gJ6bGoL1E4bE6yG+Kb2OxDr9f6aL6r/X6BL"
               );
  FUN_1400bc640(param_1,
                "dLpBSHrWaEesB5B3gtnpng613Logs17RGtWMmixnzEdp9syN3CIsU1W6jEWGYNRnsK25nGeoKAn2Z9Cy6tqd6hbCPoFHnQFYkYuQoBbICAcpQZR9Ze5/Ox6FrwlVKN5+n2Y9rP+Ai6cWXF8kiLXa+gh9oQQdiDLdEwNkYXz5WH/H8JHu9iKimxrrKb/LU9LhInA/E19enZYCYUT6JibqOuW1ja18cum32LHw8VaOpcIY2d1zyemFpRV2RIcitIrHmrJCPGAgAT4MoMAZccjUPT0Vh4QlNHsENp5CsUQsbkbi3Oz40FEdamJYQhTR0fHMEBaweiROwNeL89B2qSiY7buamDmCjCabdIu7XID7Pf/66yLb14aEN3a4mE5IHRw0M02XLWuXFZaSkc/e"
               );
  FUN_1400bc640(param_1,
                "s9JO9KawJZQKLd3sr/trhVkAt0d9WSfUmy2LER3VW6EtdjY3h7JjBgIQg0I92MNesTtsnoy0hAJmiWhlyKrTq4mv2cy5FJfeNCSdPDdkjbNlyLdeOFUWMqmE6ZjvEtPH0ux2Mdg9HC8lozwqmzZNU0aql41GwlMuzSwrTkPEK+DPbi/PRP2KbJGqyx6D8ZCt4b/w2x9r633Cxx/C+LD9zrNDA9d7D1fBwtJxeVQ3iL5CJJ2FIABPM3a5t7yWha9h6Pb3LRLcTRL90QjeYrEioHT7tS+lYCcZWAb3LLtQWmmJi8X5OCuoz3pVt/p6vVXJC5DvBdNWqVu0S8OezZgdmPMnnjb9Do+GnLy7Y0kaE2FOtA5KCmFs8yBrjVYtPM3TaPfMFJDaTHfZkyF2"
               );
  FUN_1400bc640(param_1,
                "+NFOUVQ2N9hQ2MBA9DEAhPoxAcbEVvp0u+aWeBq+kRcTKlzOooK5kBrxYu4Pem53Jfo9nq46a4WN7jOIBny/kHS2TdktJyyi71xbV5r1r9bNKhaotZLVFxyPui2tbDGqHh8u3qqdWeKgFzeHCBQSUgAJGIBAJLoSBPdy+PtUVLni79BXjO0sLxZpHkhrmpo9KLmw3P2VWS9PTm80F8hiaFn7PMufVRxB6HXqfnAfPX0teIo7aXVZJwrfpHuXUwAOVLUPi2GI/LJpq4EMtR1DoiQ2Z7k6covMMix1PNRLDMuiXAMjE6DEdGIQgAtRkBfF39BB8hlgGR56Azi7YkQmNgQfju3SJ1iFtQ4C/BdL8zOd5A2m09211PcD218JsMZDW7pQ13llC8ZpLPib"
               );
  FUN_1400bc640(param_1,
                "rxjdFNZXWuU63rNnFd3UOdhf1LdGM9w5T31bskOBHwyDLK4LXwbgoG4GzHiBAIQWWOzEgWX7i6jrNax6dQu61DgyEdg7Y9Hf4hH9ug/+zfw7nVuaVVp7xDXc6rcRny0rplq5dC2rpq5mvldk6taxUUyXSfQZj9WHhdngG7EoFiMT8MAEIDowHrXWRdDz2heDA7XfMa4jcun8KCfieC+XUb3af9w8na7GeZutsBnwOaWlmHWUfc/EauhR4BTAq+m3pLyG2fk4Dusy312f9hNwjg6Nz3+2GY1cgRtBgE3rSBAIAt3qio2KQnjpKbeq7zbZV3O8a85O+q8Uarlcq4Y254Dbc3im770kzRd5TcJz1LxAPzrmxCO2nao5wTMxMuR08FIRO8mqKgD71aO+"
               );
  FUN_1400bc640(param_1,
                "x6TipdJSDTKfjFB74gIg7xQel6+Rd+S1OLZ1bD+tVicHm9x4vl/hp0FWSlu110ObcohJ4/XsdjW94IiIrvH/5HzHb2sb3GhHMm82QMtu51FxjQM259/aNKxs7ZfDdsmXRveyWatbs0RadSVru/wUVRFw2DGQE2nIEDyMQAIHqAxpTZNz9DG8N0coalDfShy3+XyDK8K5e+wOnPczz4tvAojnRfsP62LiZG9LFwZOm+k73TthNMOyGvD1KkhMoIEIQBrRrmsqYqE3lHHUExhsBmk+065mPo9Zj8v5Cdb29v5GW3wHFfapAmkD8Ow5zf0X9JALhqE3i3Jxu/x6BdyX7MINXWk68kUDmwtITpxgvjEAADMwP7o7QeiZnql+PWWV+X4ILbs2cJadFryW"
               );
  FUN_1400bc640(param_1,
                "eIGz7li/6xlqJLW7pKyt3E1VU1yTm9LfdwOW0xpj4/93675D0d5sfNH1vcrWIg4lcJ+kProVUFKFQo8QgSp6mZu7bc7wK908TYZzF57i7w7pTuhgvh/mZOgeeDsxKAo4QmdQ2beSZ2RXS72vTL6Q0USTB5KS318juNaWOL9/qyhfpHkDxOlgfIB+JDWDDbjECEYAIQQbNI7JaBVOTX6tBjDfn+lNTpbdKsp/Nbmf3VO96y0ZrfPMJYJXP6TbL7O6sAd8YM/LI6YxCAGYYgACwdpqhpmxb4qLKcrAoz+H1pSWy7Mzw13yfpkfeu+nv+GawXCV0PKxHDd4Uul9L2ycmUgaJhbWwA5zJBJ7ZAWEWHZZJAVTaQLjDgCSI8YCEKaredaWchp9L35Ep9+p"
               );
  FUN_1400bc640(param_1,
                "F4rmul+mwVWgfVleeiI+rIRyaSHoZeuxLCVmTm3vXzrwRd7Bpr35m20E/elErDXWl4BTrzJDMMAEKuZqR1/+32unFGFPME3adZcjlx5w9mxw6x14jTH1LHkWCTya2FJmMQdJFGJwHJamjZBuqIlB2oxLQwDUDEAhSqeB9NF4uFJ8mRDAklOleK5dbuea73iA2IDZ03hNtZNyL71d5QFWFjC68kHXzk5ItfCJhOOZ7Jlc5bzLYTcwRs5VlFiHVlZ0kAkBiAQg1D8r0d6iA7W2SOkmKr93HY9c1dyKuL2zbHU6hGQOltppxbLcsJKNy85soUERVECqBiFshh6BiEAgjln+1OivqIOaWltMgpTsrjZgfHQwkAwW4GzYGgMgBkUGE3fmvu/QO15+miFX"
               );
  FUN_1400bc640(param_1,
                "X2ictNloQa2ZEDUCMEaNlBWDCAMIp8Knfh0Fihl+oFByA+/iCGYbEyYQf8HpguxSf80i2TV7O+1tYfzr6nphZN3OV3+TcP4tHVKrSgu8WNbfSYNxMxQrelsFOj2lPLRFKb3jAQAoF7jy5QOblaUkS0OcGIBAD0VygAkylxajuWUJDbKFv/tgMLNMm0uSF4bA3dCpgS8e2vAY2pBcc3NJTO1B3/EY6gSLFEwMNsM/Eo5RN5HDnBbabn35YFIKeSDftBNYXKoNcKFW4FuEWbQbRR0cGtErKoAVgG8pqc39aSHrYwesreYk4Pld4OFLaB/JFIFSMPbEAIACK0Rzjeq3JYdwVmLMMioDOnAULhhfBbCIP68Kzk/cZ64dRsvSOA3+DF25MqkZQ9nWUfYu"
               );
  FUN_1400bc640(param_1,
                "+JshS4TTs7w9EV7moIE+vhAhAAKdL5M24fCnIdOetd7Nl+TMS3s8rtsTbYIJiWqlEolVB2nxOOL0KymTwN54A7vruN7AdN0+Hz+7z+hpDDaMLK5eGCniNfXiYF0FoAggbgplYokTasnYLdwue5hSTFc7A7VlYFW84wXb2D3gvIRwdp+fYvVPVgifpD0+SQNGABpz9GiKCLDE2DABC00RVb3WxeX63nn2a2428uFgwnFK+wUivZYGdnLbd2F8nRGiOgP7akgUq9ECFdjAQCv711+/2qjDgs8WbJb5p9CtpDJsW28T5u/3V6B6n1VNqD/n5uRS0vU+4GG08LFv9+x0AJmSImmSObN0848cU8Ex356RKgIvpTpIhQwwABB8eNNz+wt/l+kxPOGvjHvi"
               );
  FUN_1400bc640(param_1,
                "4282LcFy0pLR7+mQx86AofpqF+pSL8EkDG1SOZUZ7PtgaCySAD7FDL+oPv5e1+r04dt9T0+j0bQyA0WmW6GLAA4yVkvmgiRy/oW3YK1FAe4hoiBJg9/PV/vzFr1f0zno4WDF12d6Boic0zyDe5CvX7PnvKgW++j28dFwkaP6fJ2f9pqQPinBkSBuf1Bl9NRpAleG7PWBo+hunp9oHpI2tQlVBL0PnuNwtHhhEjWhv4wABByoF+N6CFu+Wn+7gcAM2PXsQwZBjBiPCPgz7w7sWUEl/F/nvYyW6vewowHL2/aDoytNmJLqGfUBlsLmmy22ZDgtANAM6jorGm0xZD8f2K8PaTJPTH3xiB3GAm8YgEIjP+S/9Wl30Dh2D628jX7ZMmfojtAlx0Bz6/Dn"
               );
  FUN_1400bc640(param_1,
                "+edeejNAg3vPBfyXLQyrAwMDkDjKLXODaa8GN1SOidV/EfySbuTZyZpGQWkSBAGiGIBCeZeU+l5fscCjz9YZJYsWDTEn5hazi+89vaqpKfUNn30/59SLfGOj3LIGlGJSMBAG5w5j68wpkXFlOPUg9KOKpaGGwc7L6845mYgV7VVYVcpqEOw2DZGC6UaTG4jIExVBNU8RV8tobeQMLhoI5ZQgWlTkYowEIUaMHKFoiXLycKov9ptCqV3DfxMTetwNlHWt0w2maJTaMHmQowuJnvMqfRVmG+PXywhIxJmFhCVYr6W6aQKEAfmkGZmokokoAl7T2rntGs4dM4zYwCk9VcSACDw4OTvf68bzz47rvkr6N1ufhQ5fl8ME4KdZ4Qq5iYawvZgP/MoAoQ3E"
               );
  FUN_1400bc640(param_1,
                "Eilalh6nxDK7CTK4zJ45NqShrtcGuBL44SlTgECCdPr0+mUP7/kNRm8zxNYYANDw1quLAEU49QPqmSARDEIBFJn9n5m4j7QOd5uKetzn+F95nlgqk1Ib1pOVGKdv7+/qmFBx+qD48c8GAIyMy3xhYRJWKnpbamZBKPTtdnQu22Vu45zTv+vlCt5NfeSBQZcYgAECKx8M9lMQwcL9e3rIyR/Kwkhqh4Wh0IfW9WCfend7Xbv8wWLF8GSZYFf0eYNJiB5gwbwLyScATswshlZWUGgsyuM/X+QGdnEleAs23gm19ZYuQUsiRhDAQC9y7XH2F9f6LAqZ+D1GT7dBwSga73eXu5U40IHl/8MCIfdSgfHwAZvovR87MiH0EoH20CD8nAB5EAqewwAfIyLy"
               );
  FUN_1400bc640(param_1,
                "YUQ1ex4VENfGwIfFwinkyC7JED08qg9OFHw4EA9ZemleTIAn2EoJtQAO3AD8dIiepkX+aQB24AF3JAUfl4VF/q9H9lkP7sIxowEABW7ogLkYAAqgaowQC8MBAAW6fweyv4fgT/2c7v6/j8+zpcfX/m93+p/VMT97O+sbeeW038pOvk0jZ7snUtoQ3/jcG4sZ0E9JbJLFd/i+YFDKeA8CZUfPn14PUfP3HnMA0ntuwB3eYm4DoK8HFjAXVGIQgtnZCtryfqayggFO3ktCl834a7Bu7ONjP47n+/mrcX+EDb4+XRq5n17L9FgE+z281g0yG0YwTAYRg5ggNMjIHLs6lgZmqokHVy0o6cYf+UEBNjEAgC8+ZudjK6xm4qOmgbWn+P9yXiF/Ru720wm6"
               );
  FUN_1400bc640(param_1,
                "Be/wsCO7UGrClpZ+VqnQHP+v8xOBcmuCFDKBQQHG+2b/P+O3k7vwMj/0lIVJvwJkIJhchUdCPA41g+KrcjG22zhSm9pzpIooYgEJQAKs/CpKCKujrr6+bfpNVEtZy6MTtYXK62xj39/czGnDmfLUVyFdBx8vutJ+s/DxHYH+zgfIS07/tPdL4LgAuBX2ZlmBiYmyJs2L5AxHwopNPVsC56HJ1EkGA0jIsKAAABnZOMdqGLKmMXaP+p6qf+VSCytNi0t3+K9NplBiyw/kkCd2B8FpeCQb/j+VAtgyZZerUyPrOEbkgAwx0owEABdNGsYvcxNEPhcCxoZsFf/TK89Q/TJYgfomt/fHLIy/N75jVQMgunrFdmjNGOlGsMfAkAELeZRVVLyKun37exTD"
               );
  FUN_1400bc640(param_1,
                "dU6zvuKGVP/o4KLvE3/COQEYzxk5fX3LQNKCK3iKc79Dv/psNVlrgMoGWhVsPFBPjC3hfmyOfppx/zCvBGK9zyAAQnLbUHroSvSrMN6WPLd/lc7bpLU0lCq0DlAu708qP68mkt+Llxta+Va5z35M6eqV1N+kTLgrdCygyhggzAzMwZLkzgpWyj/b6d7mdXI1v4OYB+4wFzhgIBTw7kiZ92BNpm7526D5fQu7ua9HNOdGknl/9eBgwFFDRFzkcur5l19Hx9+ixue81ns4DFrNjolP9M4Mr5boQNKmabXQXQZ+x8nPt61+LQSEs2I1d+7l+7cFwFTVTySGP4CAtxiAQrbqRTn5oBezafaK4KTinj+9Xu8PJgZv93b1zsLuel+mfIeHr6OCTRuq4Z7u"
               );
  FUN_1400bc640(param_1,
                "8AH3RB7W3zafUsuxfElK0pA8vec3Q+faAQe1fBlBlX0HkTmabD8rKf6KbW6JscGF1eojmTM3atrTkEabzkAACCU8e86WSj7SmG+rldV53vH+Pxbl7WJ4q+4Gy40f/XKamXAm71Fvs68/b7TH/JaemnjYIlLGw7CONMe4rB/BWCPdua9hFejT7/ZVTc2rQtmqaCQsBi4QxAEoMQCDiY/zq9hjtVnXtH0GI37hyX7xbFaZa0t7ToTnoQts26EhuGn+STBogAvB8AYRAwEAArwvr4tovu4Zil9LA+5m3ivRK1PDpeZzZruu/E2Gt2nzr23hIMSPLXW9dQje8ktlT+J7BtnvoVQXJzpqh6fd2HNDSN+07ogi7zx3/2VygHwNLq5VyfjjkFhNyUAvAzg6"
               );
  FUN_1400bc640(param_1,
                "AsTeFNv/Imv96jRyLsHbpyN8iTQPN1Pw1vkSpJaSqTMvsG3RAAALbzrbit8FsrRq+hqNS0DXy/KYVvbSRzdEmt4YYF1NGWBwoHcEx8F5QkIQ95y5ZZDgPxMr6jrQ4nPV2d5t2v39Y3WbNzOlRimBiAQl6R+36t1hGfC4lcyOCVsUmZwUrm/fJl9HDb/1UzR1of7Je3yYAcGDuJIlhdgb2XpVYIKvE1nS33u2TewgfV3WBTBfAvMe0/O8+TPKm0wlQdNUIDJkSRoruw5My+GYZmju1QvgZDauUhR/rysjxiobhy6/CKCzRiEINl2//uA/4e0x6Mpts2PXjQZdzmUvviAlkHnO76QyK9e4zCB3b/G58+7MaPv4/i3f5TveO+jhI+JXqAOgvnkaZgu4"
               );
  FUN_1400bc640(param_1,
                "XkJ4kJFG+hkCTpzZu6xGtwg6HbuLe+RziMmY0MsWR/GO97DHE6+O9bSkLQZtUxn1KlQZ+0MLA3/bfn/1W/L+T7V30PsVwkCziRiuVzXyUl+UaXFY9kgBAIN74+NldR26ryfsH8joKv07Jkx0p272VI/uzYZnlksz09Sx6tsI1vII0zBTtNeVFhjErGIMIYAIRT+E/zmZdL66TjEerBV/CSWg9wfzz7OC2nHsioFxIAaeT0vZBcgdxDMlzfpXVw3Lvj75r2q5b4z3PwMWWE7DlpwgQgAWHbK+jxsRZyvqQ4PIfmif+85Y73A5fZ3bNC1+Nt9CoNGU5O6OlQMUhEoMJMb4OTayAfgGIAEHl2v1QndU3z28m7t92jAjXq0yLjqe4kUaSVhUU1B6nZlJ"
               );
  FUN_1400bc640(param_1,
                "080EntnOVqHsFgqB3ml4hOVhkCAQg/yjs9fMtegs6XJs3eC7WJqvXIvTk/w9pk/jq5boTcvbw2j53JP/Qvq1w+6uuHh8dTrJGPzH8qHQO0pJgYZU5UsJQ4MQhC+TLIR+W9Mvl6RJqb7Wgq1n4dm2RubZso26YAk6RBjLmtLRtNpSpRqYxkcgu1EyoyEWtJSDlIggAEAOe79HlSYFe1wNP+GBbVO1Oaz2eZgTL66aOh49OgyIngQ24fI6n6cAXlO79XtiNLn1cBiPEY78XaMzlXOASt6aJE4tffiIsrNjODX0tiT1hgIQtFXzjzgaxY8+7XW/xsMH4NOSj4eek4ZsL/9jwZ7TIT7baXjHTNsAPMecRW/f2wtPD0EqvSe1cs7Qy75AVxoCBhS8Jbmo"
               );
  FUN_1400bc640(param_1,
                "qwLLy1xiRSIxCAQJu1/0lL+eZe3fjfPT8mDZkJw+ZDesvv/RUtcy3u7DmWkz/Nl71+y1lAbK7F11Nuwt5cuIFwp1uI3S7yQ+Vq2HjLeNMU8Aw1YwAoPjDEAFhiEABkZnh6zjnOrl2vMxSunX8T0xpkDIdmq2cIiyPhI6RrY7NjzSudEyWlpd/ruQbXOIMHdce76IwaR3LvnFIABjANCMQhB86xtkKzJ1vW/nvvrVjS/u/Dy3nbk87lLrpgM/o26+Exzn8FxCGAzbu54SgxG0LvN7JW8FXP1tguZ/Oki/Su3THTLYcFt4L7BFbJbYNjVPRbTIyAjBgiHqBiAF8YhAAavcYVah85FYhgcFRX7BE59hm55wGqV3MYsqvSZ2Fs9IkMPfwBfgunY2pxn1"
               );
  FUN_1400bc640(param_1,
                "9M0WTtbclgKFwfjNywlBM8TgbieTlgqO27Umz3BYASN5DGukCD+xhcjEIQBbV/X4bxg9nxfp8MyK69rLOmqRhoi4S8teHATtVV96MCJd1z6GW4vq0+TQdtuk11qOIly8ciXgrCPs6600sW7P47p8fCoOQwAUEMBCFzPXl/xxe97sT2f51u9doo2njZIY57pb/xTNawWU/22XWqGyze7Rb7pR5zdzxHByh4i4PgtcGozb3RlgqMpBydrXlg6j+vvpwqAUkVqd0tFQAQBr4nw6FRh9q68t2bvWPFqPsYY/0O0zBwJ6W1i8B4NPw6Lf099lp3t0ZwNKFRXLgOKrd77VpIQ1sED13jF10IPQIDAdey1pkplIL7UlEdCQFSMQgEC809DcfL1eT9tKr+r0"
               );
  FUN_1400bc640(param_1,
                "Y3/nH7cOgwr68ev1yabPWm/yoAbMaWhDK6ymYGmmppNQNP2eS992oizbxBT68U20w7bkoJ6yrEx2iuhdeQSLrDjBpKkgCm2IB4/cgAAQvjiRCrOnnrjPHxNNkhIQy8cNhGG4HoYNxLyTv0l1tj3izkXPfIHCvaYmOkW7XsSDhJINuNvlAw2un16HUXFdbvhB6aRUNjQoKT/fxhLnvXhpEqKzBQQZrWmuyijNLFpViKFgmxiCKzSADIGAAVGAhCgeb99JU873WXay2A8ceqiB709o3+UOHQoCYzP9hs1gcmMSw/huy7zOrarcZUN2LulO4R2OC7yGzlfVcE+NprGRGVAHJ2IB37XVgCgqEdYMBAAujsP41+RkHYTIhYWRUaA1xZ1LuX3Ss1q40J+k"
               );
  FUN_1400bc640(param_1,
                "UOpHQ6NIRxDa7pj8S33SqkL05Rd3Mm00l64sw5loKN8GXQbbcE5BtpUlGJsriSBiRjCxHIDABADU277MorHBknyreIlVAW9B2NhVre8xJDh0Eqkk5SZl8xoVMK6iC1guUZO6bOUA7r2jBemio8KdOHprgdTR8i7gTDtZxOLRZFbMvM5B1dMiAMAc3iEcGGIAAELqeXP+t4pfjyeiHO5zNrE/PUNyFrkfP2TxxeBf4XScrxthZxaDdoClGtO02/mFtb1+PXaZVW2zmtuxZvyoSnv2g3AyMDSmshlh+8U7aXDrikNIkAE3vrUkWmHtrAgIYYAEYMAAAKz/9uW5/uo03WyHjsLXm7LJpl6kcY9tJ1mz45cIF6cL77pRIGqpdXlYuggVv6oYmxp/6NAd"
               );
  FUN_1400bc640(param_1,
                "q+RZYAMhajga2+wUXBWrcaNhkIYpIjDQnSA6AwjhiEAgc0HiMRS5/aW18Ot4V77y3K/m85jsndemtHA2JiL5R5pw0AIcasq9mp3kkoc6LS5KBS0q+d65goEx2+pySiadUpzU6WYbZE57iOS1pcQI/xga8oAhjEAhBm+xTxNxgYMfF7I6wMSCpiqduhW5TE3UhHmcCRby544Gexs9S9WLhzLNjkFsW/dFRSULF1pj5OhZWTU7taChM/mp0rhTrTDGthIU44cbDoVRIpnmEIT5ACE+DAQCfvc52dQ9/MylsPMq/PzYPImW7ONAuG9E4Q7BVStR/z5t8tjTZDVWa+2eqSR3J9va0C+UQHolVuD7hPdR8ln7DSOOrm2oxRwtDXSk6xrkiunbI5SqqnNU"
               );
  FUN_1400bc640(param_1,
                "astL41wlOHF0bKMItenT5Te6EgBBMj+9gIEIQAr+xZi9L59RHUfP5lXnGkzb/JLH+9uJ3ToXj1fqcBRNKqy7f6FmQBpZKXlV0qcqbN0KSpppXIrbduAr69my4MJhfNOmC1JKg/dIjrbUFGvpoZBozVwCRwcTpCQFxRhCDkhiABC79Z06XrK9f4/lfe3c/Bt5/t3Vtu/Tsfsm/DvAW4301P/KmRkkaSphWxmCYStGAmPBeJgTAz7trbVjc6L3aoJHuWbCZdYYmnpYsINllo3WbVcSSdpcyCN6O6D+FPFncL6e4XCciLVycixQqWzvJitXIKgEoMUdGcelKA3DkRrb+QzDtVF4+lGMYAjGIQC3AwFgdG07fbvVfHulOi8Xu1/cmuv42SAhmx1qnV5z"
               );
  FUN_1400bc640(param_1,
                "j6+iyzPRaLHdNby4QllgSmC02Hvd9Aw17o5sVleTjyzcq2wzkJo2qBL6STNwR62jo/hI74GO+mcdNG6MsH2Ic9gxGpdRFy076kBQJOqMuZQFHkIB7GE3xCBAJ9GIQhBk3MN/Vp8q2Br4//f++344//uFpP3jn/EvpeDtfprKakx+HbIA97ExAXjXV2tSjs9Y8shJgJuIkaDbeub80xNbvv8e5iZyMgtM9hXypOfDBI5OlL8DHWL7QVCqhjkYav9Npy6hOYq9xxUOy/DpjrukwftmR5TqHgTUO7qtvyIF5vDA8aiCc74ffZiz9GO7rZ5kM7vq4BubgHeCcTdVQHkbwzOq/i2TDUqaDp11upWfS5XdlcQebjPUWxrRnQGWlTD9KyRCB7dI56rTkRCQ"
               );
  FUN_1400bc640(param_1,
                "B1IyGeFe6EkOmQQtrl7c9ErKtePoyj9yyA4fGIwsYg6MAABLUZA2B8wuapR4NpoDieqY1CbYkS5FFtSk1DSE44N09q9TTYE4bh+umnzM0hsWj8qKgWPO9f26Kd2SPWPf6U/dfYhzaa1iUYnIjqcr6cIgTuZPEhHzxAQ4xLQwUjErhyBCdRiFb1fQJEIQgZwUPDPTJ9ddrbYaWyAIdK6RaMLscGh79jGxdOG3G69hmD471CmZjK2/NuRvrWZ/ulbp5rPrKNL4P2zaec+QgcBnHRoKueoK9JOPvEkNONesI+pBSCPwca1v9Zi33Nlrm4+/4zt6nn4+2Ul4E3XJ15yoAshVidnSVKLlrFWfesor6D5w4yshCE+l7lw6PBfZrgto20iu7fGhk7+ttM5T"
               );
  FUN_1400bc640(param_1,
                "CoZCgP3y8UwbScyvXFpbIhbYo+Jn0ycsDoqIbmCnfLPioCsYXRlCI1djCQXxzIwEAUXH7zIAf/xdyRThQkLoigPk"
               );
  return;
}



void FUN_1400c1b30(undefined8 param_1)

{
  FUN_1400bc640(param_1,
                "c4aeUs8UNAQBCWmgzMUFZJlNZnmbSQwB8P//////////////////////////////////////////////gKv8AA+Pt5ErOBQAAAAAAAAAAAAADgPgAAAAPhsAADPu+8AHjsAxsDPMM3uc5rTZlJSlKoKqvACaAqgAAAFAFAVCJhMQGgADRomp4BNNGBNNMTJhMACYhpgExomJgTEZMACaYjAmACZAMExGgwmTIyYIwCMAE0GmJCJogICnkaaap+qn+RU/U9oE0HoTNT0qfpiYqbwp5MnpoGmUxT2k9TGJoyp4VPajapp+KTyJ5R7SmPSn6obTU/RTaaaj1P1JsUeU09E9T9UbRk9KNqPRpqfqjTJo2kyeU9J+qPSBVPAJk00aBoAJkZBNIiTTamgNA"
               );
  FUN_1400bc640(param_1,
                "eUHlGh6gaANAZNonqYxMmkyP1E9Rp6jajIAAAAaAA0AAAAAaAAABo9QqemggJJ5NoSaHqGjRoBpoA0A00AAAADQaAGmhoANBoBoyAAAAAAAAAAAAAAAAAANTxCEEECTEBExHpGhoDTQAAAAAANGgAAGgAAADQADQZAAAAAAAAAAAAANAESkEJpNMlPyI2gp6ZTNMmp5JpvSEzU9Rk09Qaeo9TQ9TaaYoyPKD1NHoR6ZDFGamT1A8poGmh6TQaDR6jyjQBoAB6hkADQAAAGmjJAS2q9VVCuVYmFbgWXb9K6r9/mMW0UdFFDKRRBa4oXYsiZiZmAilYodiIXlVKKEBBeDWAAoYUAFG/AAVDCiCgAYAICQCILIQghBQUHvURUUwraIiVwRBEJFBLY5y"
               );
  FUN_1400bc640(param_1,
                "KqKWxAQWqIqKVkBB4mlEBBxJmoCAlsVBy8VEULIZK2goI5yIgqFcwYiAlcER0MBEG/EVEyUQW2AKjdgWyqU42igiVQkRW7BXjIgCNkTKxAUbImZgCg0iXbKJhyu5Rx4W1y3ZV4s2FuUhcrUATk6jFryZCwx4X5bKQpEN1KsWgq7+NUxo+Dghz0QuzQTQclpdJVkaK0xs/RFEcKK6TI5Xla1EEy0N9ExISUiUu5uoHL20ayD1UBXNxqI1wzNspXx96oUz0ph0Fx4JIaS9oKraFCwtYC19HrAXnu6YOm7tRvvFQNSj13QkifMemNyUETyWBCuU0vKKDSCIIXpKHhxdgb+SVhHA8X+0QLACw8gbYB1I3fQXhIJA09YCybIkyWJSABBl0JBm9wPmkjVA"
               );
  FUN_1400bc640(param_1,
                "ZrBhcMpFp6WHByqEHN4E7XziEKnJDAo4u0Wk3+uwearpx2r/btrPeR1N/oTCJFwIH57TTeOpj7Onsu4oXb/LGyNaU7el5PqaowU3QKAEIT15kvkjPO3bwV54VAthMQXPG2AazV8rBRPAZ518Zg/5jRNv3x5GYqxDiDLiSBRlcRc9hbe4gQgAhjlbjuZSFUHb3LyO37azcwy3B6TY1/L52nwomJOluUTST2EwYPFTHnXTycPU+Ppr85nTh/0sOezuDUlCTz3JZ3ytdieYgdH4ChpdQa25W1Ti6UJUR00ycrURH00BbJ1lfQdlwdH2Nw/5v9r2Fbr54jjeBq+53vfu17S9rOz3H5utAQpPw+ZGxGVVMJPm5fvjk7+UmK8/WCddmCaAp2tiFOFYcYW6"
               );
  FUN_1400bc640(param_1,
                "g84SAmKYkB2JAAiQg3EinxyhY/1LzhR9myNJ9rLkX3wMmKyrUXkYsjZZpgSx6G7qq4iszmYsqvNJKs1WAglcWRdvKcDNeU8hq/j5juu56jU6mNK+30sKjacphRM3RAAGbIkDWIhJTnz0USmKfKFOMUEBlBUnE+wgUihFg1Q197Guk2OobiRimSP4LLocEXgkwJHYPUAgp4aMQ+QRCJQCEJxwiwtWGOxJ6xbivomNNUmytEmoKOW3Z4mFOKIV6IqEMsVYo3rZJYPdy7ZKNkCfYGpyhOyFvKfyq5+X8PyL/f6/tuUW49PDphHZribKCku+Y3U85qgr9PXIcRJhC0FrER7j72vSiNyJyslayxJktoaU2Q1bxZHjsfl9zvpzjR8eW06GR38PysMljiGT"
               );
  FUN_1400bc640(param_1,
                "bbwEB6f6urdnBciNASdOKXLye0CjB9D8jljiZ08q90hkbtXV5+npDgLhD4UryX6/mGIAOvltYs0skHs6WL9woA1yeDwm7RsgRb2rzVOlrXg9es2jRBUgqEIdCmdVOgzx+/VYz4KqCkgC6WMc0hnskdydYUgUpQAC+Ct5BoQErAd/7fFcgqB6lexZy1Hwz6e38/WnXpnFtC+s8HghpYIZ6rqQbCISJHhR0XUm9O3uULCQ14wjzujPikhvrmMK/jpv9FdTQQ9pMcCiZNp94bs5KkE6NZITIgRqikC0FebxJAuRMwH0GZ7+Q3lSIVir5g99AEuArktRzifApSsq3pZoH1X0JaYQSljYGx8mtJXJ9y8EyUYIDIAHe829ESqQmF8FNpItB6F0dEbEY1VP"
               );
  FUN_1400bc640(param_1,
                "DjRCc/ZX6T4/S5uI0jpaEm06qA0F4PeyxpKaR3Iv1JQFMuzOT0ztIQjBwRpJIigsyjEKVdyPENOK5GZMgp6a+DQkbXI10lyfDb8O86zPE4hA0UzNIFUWK65d51iGUTwbZAzs0wll20Nk+anScExUw1DBIKLZLXFwYPWcl3UkEjMNnuq0nIIJAg6ntma41F0tyKULE9Rq3gS8Rr1LLmnHOrlzNX0lPUzHn20ODZlO9XcQMqBQuaJz1PpgKgkrnDiLtt+Z11i00MdiYiZUaET+LLszOh7UwISEcqYMKGOSfiSpUkbntRG/U792erfNmRluov0oDUhSjZ0mYIUkmA+N45mSWM0gdzh+Xd9dWxzunzLO+3c1nteXyMW4mSGRRC3fNjROImUlyNOALWtc"
               );
  FUN_1400bc640(param_1,
                "khBGtFzMm8pcjGjC1KM50OIEEdhGZuXbWKceDGsiTK8EiJkkPH5OscLhVch34xLjS3AQJvGVZlo770JBJmka5mIyVrcMgkgmJdqI17Kfllf56GM8NY1OyUpOmeGVIKgHGJESr4XaIo0Da+HieFdWbtygMG6WhYOSiRHbcQF2kFzQ0LsL9jD78jG2yOFBqIgbLixfH7GcyCEsYCsIIMA8YbgkkmxsQzuoiWVLhAeFHAvtcM6DG9F+JxAOvByX1eSTFX9B0gHls9zedUwsvxkW6cdo1FEELDDhNpcmExlhWJsNEi79EYuEMm1yMJRhZaIIgg5jZOaN4F9Pqnt46Q7YW2lkNCI1VShC3JY2clPclwIhFvCdNNJPdCcXLJuEheFDM3NRYTUBsim3cozL"
               );
  FUN_1400bc640(param_1,
                "7aQjF2951BxOiDvcN27N89V8jsOSMqyye+pnjEo0RJi2y4SpMlHK4ZJKPjc3GmLDfHePJGpvOzU5UktQjrF5gO0sOkrkCDRFEu/Q4uVFU71rynorGdXq8mI0wrzxoXJkUM8G9FgHovVDeRwv48sNBDatpnKFMKFz5Vpiaww/AhwulaUhMoOxBPQggbAuVXRNGfPMME31qHkMd9MUYVtsw2cQkIwUww0Og3LUqaklXbnprIcW2ceHnF79SQFJCMHtSVAffJHSt3B6SMg2GuaPfSMUOB6yNDJtdJHs0QGJrYoKGQ23chGFC4RL5tYh3NikIIfLDoTwOus4uTL0gaHnMzpMGpsjMXc1RZiILfXKNFHVSlee2FH4G2K0eczgLHTEkSJbbwmsRwgdZHjZ"
               );
  FUN_1400bc640(param_1,
                "ovTLvmjXF6PSYaupaSWJVJWJAzIpwLkJJcw1gK/VylZHN2RFFG5zdQ+VUGJA3IioIbQb6alyN1qduvtaXkE2znpc9HbuKuq2WjstUIO8I8jd3PdOLTTGWtjJ5HMqaloswedccVQ6MZzM6NAi8Dk+Mx1ViKHFW3Z9kSL4oPph206FmDG0dk8u8UcDfl4i/akS9BxzMglT1xl05EYTBJHJBG2AbkMsmHZyR0kM7FapYK0fuy021pXvhRRsoQvK1OnjNMwCSOaCzoW8qcKh3Ot4OMIFod7CudjZVGjagMF92egyZOUyCdt9o7ulPBRaCJ6jBcaJka71rGxqYfOO6+B4xORsJULmtQS4NrAMlsJBWk4vNcNVZyqlXlE7ZTxotemHOiF8juzaSJGqQa3q"
               );
  FUN_1400bc640(param_1,
                "8TaewoG25Z7Uz0xfOVMFIUYjdo2klBckraXnhMhGyNHLzcTK+FUmViX1ITfgufcvgm+av3IiArKntEeFibVCkdiHYZO+qtePFtnK7/zTlsIxWkHEiVRD1hBk0Eb9MCHzmBMDNKLt13hGhFQu1nGPYjpc+cYjIJl7GA4yeZZgiTtDJ7vDrvPcxbi8dNdHc2cihjEQiIhE81JEnU0xxvGkhC5sbGhxQxdplrNPBhorBCutJ5PXWcRoDwvTu+8dtT361pcJRJiNmB073Yo6pRiGySzYiPGvt8TL6kqIKuiFiESeBUyQ5iNDDIklbxHErVTaqnBM2kwbI4V3BtEXLRClTzV8Uphc75oTmG8lLCJmAqyHblGlJTI6fAQiqaLzDNj2abnSadDY7mKFPBzT"
               );
  FUN_1400bc640(param_1,
                "mJvLd9GMGGVENlvMaZXiJfFdGmmhxpSeFKVtLyYSMZhsXaalIxcK0gkSEQmcmDJ/Orq7I45WgI49rq2ixfLWmfq8cDgYzhtYeSI7RRN+WRGeZVPwFr1XdnlXjgmYN2eqBEb4T3b3yhy4pO72SDjR4NhM0w1iozVAMlQUUrkXKJnnMXMXWWED3Di8DnG58/i0sqmfOXymZEYxMcKNWRXNS93RtvduEg8N1HLGMXFzFFCXGG8KXMXVhGicLVqr347a1aCgkB3LthFbHViMmBiAzg6EbKnaMBGkGDERMACJBlgLhN3eb5qIkk0QKMd1WZkKEis3TEwRPCQwylrQcAronlM4QVavR8jN41iCd8+BmLoRShKyKJPYH4mNzvVpaQKv16uByKorUplDwVMR"
               );
  FUN_1400bc640(param_1,
                "Bos6EdGOWM61c8OmeECSH0bJwOCDGOncQM4rwVHXXWYqeJfElEiCyUig1uoqFbopW3pbRVwoM9+WHPiMmI0MNYIEC5iINy7EySbR51IYoxft6cZ7uLIXSHeEbkCtAaDHM2UbsY4eFNTJBeHEJVLEGDEcOzOl8Zj7PsWvErlfbO3VcAMA9vTEWMWHMuniGbZaR0NJInrgLu6S7dGzpg6MTvDsnk9rokLHByRgFECEFqY6LfOsXjZNyrllDZI2L5NPk0NaCZNUx4zkpmVoQjDJwcQJFINoUOCPitYvKrJ7K0fRSNxcqjgu2qbsOg3FRMwjc13vJB407E/rsvWBe1u/76NY4uwA8h9D5n/6tv/MWsLAcyLChegooWRABkVBXLxQRVpFFVELkBVVQKRF"
               );
  FUN_1400bc640(param_1,
                "FSkFQRJFREkVUkRRUykAV5SCoA2wWuehh3UEAqg8/FC9F7uAlIIoPUxAq2mXqQO8iKCZ6N6dFLsMOCikDSQMO9k+7wMrTW3u8gAC3omSimNf0FMCtCwiJCSGbIBel+9xnF6GxERLpM7MXLUErIFmaopbTLGJcsG9CiC4YNiQoDAFN83SIXCQ4IdFsXbSfYCC/v+DT+TjXBkbF/ZYBu7jNhvPKEHlUPDFU6mVonnPPbKIBEXOPt4LRgssDHZdM/2zngZsyfzepaYqNgQ8fJFyCpwgDRSGeSur10dVlvRdGotmy3/6jjI36745N9KJ6iPDWIAQXZbxkCU3lBuf4oJs4jUWeswLuQgRI8nncu5/O+XiGdYNRvDsgepT0RB0rYTctY6L5AHkKYGwAAyP"
               );
  FUN_1400bc640(param_1,
                "4JgNsAUox82mQnSBaZUgMfR7bk5W9/jwpOsGGQga8hwkDvvaMirIYyTX9eFF2BuqDXWF8EQk3l2y7axFeKbsmLiuMUpo0x4J3JJ2DPwQvMLlwTGQBkyMymxEc4bm9eUJK48MNsNUGka54moxngoufugFgiFrkrKO4Mu9TxzshRa+Maos7cCmOLZsBs2CKmeSZJ6bI9YS7A7aK2WSTFNpYRN71/kxdC5mzeVhhbaUI6+BF0uzPHtDpFSMGW1s2NYmJnnw0GEL9kPFtVZnwhjZiRQDZb0QTT43RPDVwlZnGWk7Ummpc9vLFUS6BmsIMNBx10Ux8xIXhzgo1ZskXCzAh6g6XbcVPNqworwhHRW7aF661q3ynzze3NRdWOMNVWEUQnoFQyEJkoEp+W94"
               );
  FUN_1400bc640(param_1,
                "BahD07ERtmp2I1JbqevcEg8CCcwQNS11cjXNhVbdRumhJWeJ+0S9xlBznylGp4ED9kW/VcKt79FpJ4AZImgiqiuLdJtPBGPUBYCy9dZAUt7aGmbJo1clK6UXQiiK+ukephSBOA9yaECzrkVJhzqvYVdnYcqxGe655wIxPvKXPhaLHoUm7s30NoCrG5OuorJdjJZXUalXCcuOlZFgdGs/Hsvm6RUuwzslmugqLnDFwlomt1FsPHIsC9t16AQ9l7SKzMCq9HhwKtD17VdgEjEYohnnwv3stNKMKRVBNrYtLCOIDYACbrHuy+W7Gp5vSuy6DO5AKDXDBm5sxNh4jS2isYcE8CBUHRSAULKVQ1WtrI3m3ZD2ZWviZM+3c9c9sWF+YQBSJInrJKpHR6Gm"
               );
  FUN_1400bc640(param_1,
                "unJmNkc14Xmvz2HhmLY9e4lAQRhLWyYDJ925Ap7X6ppIUZI3LibLNXDnYO6qpGSU7mtMjiPHAPJ+0r8DHpyrWwEwTx34o3tEuga2MvRgkEFe2Fz7YW3Qj4VQjARi+eEJcTVOxSh1lNMh6auvWJL+y627Xpf0plt6PP826MypyrGEmpch16bnUozOpsg3oRYvxzsnuOUAaMW8IIISCPdUO4CC7aOejjpeRsh7BFydFUvc7x4PVr2cFEHqlODiFfOxMl3KdkE91vGB4PAIuyuNUOjdNHbYloCBQRJwEPAPCTgI15Ba15baq0VNc2/aKTA1hpYpuuDVDiu0qi3HEa9YgEe3u01oeNgQTwAwVcE2czgA7jGZIBQxHhNni219UrGTx4wAPwFDXGIO4Vl7"
               );
  FUN_1400bc640(param_1,
                "eCaXyjC/WMuaXyAF12puKDY/WVpNgMBCrC35zvKnygBIGEnyQhHp52W40VkXom1tOoDfnR8wef5dsjdkP0n0vHY43vuD3AQ+pRD+EpLQKcKKoz1P+uK7qnRz+1hckkADHxqVoXfRaCt6Gh1tgRm+r7g/76XLOq3abG5i3DdgPDhHyz9xcEdOOzaL4c/Gfpt30Jc94kyqtnmMzpD47eIYXB9wrb6qF4UHWYIzSapvFeh9R6iKjbI5uZaMlAqeVlUB8pj74p5uD9/n+nLMkWhyLsQwvTexmE29RJG87XpZIWAxn4+IFhBFeY3VSggyCnWeK6HXbrqbVzxBdVBoXLeou2YG75mrVd56h7tisk8AeyEXce9tb6Bj2PehfGvu2ytWwMEUTSD8qH3F3vvx"
               );
  FUN_1400bc640(param_1,
                "5HBsQn1SIM/FjN5pNFU/h0FP2i4TRtdPfk4g+0QbxA52jY9btNHJ4096ZS0hQ+Asz6BXst3SIJP6nIJPCbD41tEgBq9KYYKsvGTrIkm8uKC+bXgElXSPCbxtaMgo6o63UxxkDFVLkgRAQw9UfF+HlBUffg0e405dYyK9NiiuQdGEDnazVS7jEE95wR3DWQLjXK5vGylDrhICPAoJLLhdTa6EQRay6qLCLRNdUzNFIAcKK6+VLaOXBEdM1IgMo5iLeWyCoak7epmjVgLlTcM0Dq8FeXduLxhofa0EcMcIBqkllNP2DnUmRQLxOjxj5Vv1KXGR9auwp5LqrBIZSccO6LHdrNE3kyB8rzBDYaYU0CqlIJeWh9r7M5Jjh2tK/Oex6B4goYmQxwDXDhVE"
               );
  FUN_1400bc640(param_1,
                "u/EWNhlV4RqzbvjKcdApAF27ohWwSTXyJjtwYeR1mo6X4T5MoX0HjbnBvAqndfwLYyA2+cGNSOG5tIeQK5YJHxYaY5CI6onK9m7He9BZPFuDmIrI524uLuxI/1XmYWiasW6eOued4ek70wS20TmC9CaerQyOesyJ7+L9YZy77gPyttWswTzv8K765gEVaZEoq4Hl9CJSzarTIpyO1NDxJDU87N6bCNkLD0gNkrg2Ex1ZDZmTYd5tl8W6VKFpCmtUHKSmpsh33sQ86MRxRT77y4lfASQjiFPhSvc/Cm/eUFl+cfFMSt+18+hOqo79MQr5SXDIBbn3sT7Z18x6JIpvBOXNldutvAYEgnEDenrTNuxvXzqvlnTDx56dJcTx63Zpg05vZp34QW5RZ3IB"
               );
  FUN_1400bc640(param_1,
                "ZfXdwXimOgnxXyMff9PmPc/X/i/tfZF/P7e7yIfQkQU4sCsjclWUEWXlYWv4MSxc7XChKf7PqLo/5f2O7xnCwa4547Oo0srh6tjqV3u++pB9ZwHI28U+uJ1db9ps2gYCXwvF7dv42BkYTZ2vvHS1AlWkQO8rioX9SL9QbpTuSf5Hv0dnd1rRaE3YPt/Gbefmzdwg54fqK2r5JRx4dV21/98rNp1fVUe8lQ4K7dpB0ZX0N79qz3fZ9BpdfZ7HtqGw9P2GD+X7GouKbzztEdL6QpvopymwoAV7HzlBxhl4/JyiF8XJ0/ESSCKyoi0mAVXknbOOcrsFdIlWBKyc0RLDCdhmR8iMnkJbF3CBdz48knqyP9t6v3y5pmQ+R3RJarBwpQEQMLavLKbbTVd3"
               );
  FUN_1400bc640(param_1,
                "UDCGW6ryJHS2OctV8HdwKuxhLvsg3IVEELXbSXwvXueaHuICyP+sNH6xOFufXvjhrXdISdR67Yba5TAgvjVwYtu6nBBJnbjYqqj76qCvJlMtXjuni8hCdMmTPwL6t9b7t9y7ScOFT8ts8Vc0LvYZ2B5RWaPbpg0bSlPrmM3DeevaDVnDfZZVTlBl48l6JJOotNISTE44UGw5NO4tUPzs1T/RmkWIdpUzgp0ORHLqXJNoR1J4U38U9WnVvkeXiuSIcd9NEttFVL8U176Wo3ELzwZVUK6CO7DTChrUx8ONskUXCNPU5hZ+TZxm6uI7huoyj3uFqpstmE1Bb3uevVpxf6Vxc2USa5DYm/OQ5DJSfHq28TwiEiqMO40t3Lm9HOBoIiNvvPkJe/mnaffT"
               );
  FUN_1400bc640(param_1,
                "JyJruMW7dChsiJVN4CVtNpW1ccs2nPgxdMz1bYoAKL1TQ1yCKyR/qxKCuGCpk+UVeEj2TV2TRCwLCFONh5XbO3z7/9X9D73xaev/PiFHFbTRHsPxqOVePSuiKw1Kye9tXLDjcOOaekrqzqVGqyO1uvbSjhi6VvLTrfHQrIbvm43OKpUsL6tdqXbaCXFeRsIL/RUyaBXs+Db5GjH2rah1PWhTeim1o5k+VqsTfnKTez4DT3a1A+lvQLhQfu405EGRdY8o2IQXVPOcss5BSDAde75l5oXTp2IeqIjdj9IV5P7AY+SsFz8BQTze0KBzEA5HoqcdzfTavl9t0dzwtXS62rCu239Ht9qLvvdVdyfwfR9WEy1I7CjR+GITfAj+SiGH0jJ53CoeoP6BJgvu"
               );
  FUN_1400bc640(param_1,
                "QmW+nvTITCx7D204apJk1eE18kUGs45TzgnGK1yj+ZiMMt4BjSE9T0XiPtLNEI4PEKoB5i+bI86K+/vQ+OWa5GNZJ/SwT2PlyjTIQEnE/KvMxjX6Hpm4y2qC7dtaqbg1DJxcmyAZC07ShkwrK/njQkKE1P4hivW8lFGm96GaCeSbwaRkjVInEYbrkzncGwoYHIn3oZozmC2YZn6X0nZdXBwP4huRX+eFEuUHHJOD29pLMJsC1a82IkvbbZNubunR1FTDrfkh2tB6n8Z0Ua9WXWq+7eIhunKJdyVWkiNjEfNjpZ1Sl4jBjWBl2rN06k6F6p3p1Vg2ABN95+3+v9pb91522T/H8r1t/sfWrOsP8MuiIPoMKrwdOAjz11Z/x4pBcabJ+IHTLWqrpYXv"
               );
  FUN_1400bc640(param_1,
                "YENP6zUJnc5pDl+hJWXtA7XShj/+s6/TKcUdHfuOCjY6Rp8hzPJroeTU0K7wqzcU+zuW1i7ozp2JsknrtrgXmyeLNh6CibGay+PMFXDXMs6H2d9IXD/QpBUZmLBFqUtOjJgwbWfgHdmLPI75FVEjMQIzlFBDZ+4onC4eT5+tHUwLs3cemxsapCeWpterps9xn8pesmn3PoNx0/VaxB4Si7XxCzPdoaloyPL4qVhXcaPzdTTP4SeKmf06B/KDeQuGxqSVholhc6M30IvRclMcv26ltmAPUWzJ9P70dbu00l+bTlJEa5U9BK7g1SxKhNb83fMuXaiD5WPbJJTjSBPaXHMIiRPDt7UtL8ebqhfzlxg+CFlrrUlQG2cSUzGLwQwNG8QPVfJ8HUMfw+XP"
               );
  FUN_1400bc640(param_1,
                "wXOnqkHWWF8gadIMEORoqWAu8NzLj6UqttmggyMUbQcU1gsHfBM1Dw0Y9Byp9STrxmYske+adBgnFuwJKG2DlwKLpLldRNdeIpZ0V7PmfcvX/7dz/RL6b7Xy4xLn+HKoLWKt1ShF1M9V2+9lQbM9lnMmheNV5iwDnefdldn8IxT1RttHrUCbsarE0bJ/jYH/PbO+UndwCvLNoLrQ/8Za/VWuqkRMuxfWzJHQOJ7EHylL3PxzGikKv9uS2upRn5VDrqKU63e6dknpfn6Bai8gafhtcG4u1RN+zKTDGW2ZSEvL4oA4EgQGhbCDhRDg1V5GmIycTDwk4mLTLT15mCpxIW6hXiDFjJHrksdFVI4jMVUusBgtjvMeiCSGOrIw7A06if8FYmeh0fgQhoZB"
               );
  FUN_1400bc640(param_1,
                "RFF5QJvAimb6QNDwqPHnllJvR4UavCk18OXflrXbLpfXpaVr9XDJR3e/1a663TFheDhI0gz2hzIh6WPluq1etodc2RyHqeUDZodq81qPI5cAZUUrVaks9JakSoA8vaucI0eahp4EeXkjGCcb4LkbQ86ulIFwc/Y/9fs+wgb5z2zy/nv1kUOvn47WsM2HXHhUZReMjCeCrhmjMzafJ9khzrpAmizZgR6V3aUxl+ap2ReqLv6vhMr6iO7Q0HWnhpDA2LC3lXp9TxBrnu/voDCk2GQrzWP7/rwdf2bGc09TwmQICQWullmz//R2mINOF2foNevLciwe3ykMHkFwx9PvO4YhFlnfGCQwixRDFE8ThLi4FBUnjHrO57HUgI68UppNCcPDOopFcYVC9pI1"
               );
  FUN_1400bc640(param_1,
                "Fi2qKzyQVjG1xYo+ARaJpDwDaxhIM0jzvQ+F6Og9wNvllXWQROW/4HdPbWS3eZsdBABbuAhVmFWq1c4JHXXZBLGBXeWM0hRAMbESuZKbbzTdQbONno8O9lhloEeFTTcNEQBRmcGhIBebjECDR4hftkQRx7k2N3zGP9cdxlwmYW0rYIUwnwf/a5v1j5L8rN5XS/2Kr6PzTNaaj0phyMaJE90QvG/+71NJSPFXWGfY67MNRWXurfKQLlb/uy7MRcqRrhZe7bOpXym1c1d2Py5f89SZ6vnenK7zjIa7QKG5Hm2XPYqD7TwSgQAhCEIQCGNG/KEIQoCnmguJPPYX7ZGGmovzr+ydLbabiXreKom17FBQxtzzmKS9M7ZMVOsL0/1/n2edLQ93z/xvmLJr"
               );
  FUN_1400bc640(param_1,
                "JRERYEkzg+fwgc8T2u2IlCvKpNlDmuTNAqSjEDzZhhHMtmK769BcSvhHqP1dvlQbyT4FJocruIzOpNexk2nPpeDraVpozso9HuQ9QiQrH+Fi+g5u2VzdfD6iEyNvijxI87bsCGRjTf/RUSfgnaWwGukLS3A4PFkx1b0/4UWZ6raQ7EtK3jaKvqlun93X8xD4fE+Hh5B+cyozOLGzYyh9eLYSARcmXAsGT06eeW79/t3VasNgLYKiDBvqRE+CuvL0rrqqsuCF9cLVKpadhwoppGJwo0dL553oDGrYEud4gLyxQzAs/s6i5YVZ99HTJBZYoIXYxfC7v7/h61d366bztoeMhDKr7zPZNBvXnH8QFJs7SQMu355XRB65jmxta3mv4fYvZ5kk1E5+b1fU"
               );
  FUN_1400bc640(param_1,
                "2jj6Oc15PsUgKNHXM6xiXvnzNm17C3K9jVozNJ3xW6vTIwLkzXvFHDRO1sEXNAYQAnMMKqEG43I4OxDWJKjd5OPElFbZqFXe5wq0Ki7fybQ0C5uLtWdwV+1UobipkLxm1WR6kH7UxpBWu+1YlPFnP3R5ZI9cU+R5LrA5vybS0/c/vf3/Nwe31Mzx/6LvbnPkkvfpvnsk4A28UUglc/j5FJFXyjEHSdnZmY6s+ikSPdtG1W+FMTiKJEXea2WK/SeEt/1u2B0nK6rkVWfn+BWdHuvttGnNDme+40mAZmzw1p2c50TRw0HDKTvxIFuPS0i44gBGggS2ebi5u82BtxP19Re8Hdo4ASs7fJplG/hXRjR8OPOMvVW5QMvDL2hFf6bNLDXFESWcwPA9CRtO"
               );
  FUN_1400bc640(param_1,
                "rx9S670Y1nzOaL5rU8hKg1vuZLileSQ1+MpuRKnyDXtpfPP8U+rWYcCclvtMmkBeV9NNOPf+Wo4UCSZhNvpf2+dLu4HlSESK9yIIAAQGcOuEAr/LLUtzrB2bYxcypyEkECnvTjO0rR6iejP8C2meWpXq9sDZWs0NBWxNg0F8/K9ieyuhPyQ/FnW/g3ck1md4ZUYEC/VWN5PAlvdKw7gxp2Eguj9sT85Goy8yxvIQjbVMKEt89DAg6y+j8GUOt5LxzOrsJXa4ncRzEd6A9jru32F74exB6c+mdrFeP5BpE/PKzOb8wASwGrEGbvfGurZ5csznl1jVb1FOhRjlVYN0tfpqVqJU6KTA1QRY/nEhIQ46N7kLTxLfKEz7lWO2ep05MgUJutk/bCebDEaZ"
               );
  FUN_1400bc640(param_1,
                "6W8Qp896TL+xeUzvL/z3eYnz9ns3CicgaHc3noZ1SRrXU+LD/zqpKKX8PmsJ/2FmAOjF89ZrM9I3hwCw0QFh4pQACd939ZaHVnHYYrbeO6N2ULFXtXc7ZbCnEErFenyI+18Zle2u+wlEcCB5pQ8kek8vcRJsrAEW8365s3C/kkNh/FkCWGs7Ih4DFX+Rp8xhXzusbMNKgOAwiGSabt2m3LrblJDZAXVceYZWVdCKgkRwcc5/hvWYEG6B5Zjs0IgXOAH9yoldrObAqOgz7wkIFZsSg83rzzi+NZpFGQOOkrW1TsbUH17L4u2GP5sh/FHyJPZdTuuejDWUzKfHC4v7a6MT0XQIceYqGt+o4XL5rkiv2tCSvaGTx6TgLY0gFDt0ng+HnRC8gCdauUln"
               );
  FUN_1400bc640(param_1,
                "SQo9Gi/SlslD7L/Wo7Ih4YkAAyhJUVNMap4XiDVzTLemRenZNbvElhqiWMiQuW8XsWElKYjoksFfYue7Bf0rIsUmqQ8ZwQwKcx4ecofBHJ08MfbzGQ861smQPgWiOmIwdBYNVbtZG3oOXTc4zmJjjcGzoRs/aLCvvFLXRmX/2oHcgMHtkSX1/ZcBODkcwQIAIM5EBx2QHLD5bOkVE6xJUCQT2XAJULf4U2AyfBtjdfQII+O5qkm8xh9MK94mcvvHPe75Elkw34QgSFVM+xvvxjEssmC2rCTFluuXqE+v8lQYLAaSDV/EIAIAC8Mj2oUAtVHjHZM8kLxZtQT3bmF5FT5ia9PviXYKGmnXa+FmYz/Reofipu7IWuVWtPXUfJT+AukOm5pzLOsiis96"
               );
  FUN_1400bc640(param_1,
                "uMp3RQ6n7MMwAE1uSgQgeSa78WfnG7mhBJy1Q2/MRJblT2D5hjVRMAYqujJRmGSxykvvGis1rW4y3rZrzg8puP00Lpl8khiwK1CIAHcDI4EgEs7TO17aaFVNvG7XXRI+3h8/J7dd2PN+n8X+X89vm7QAz88vF9npm5Y0exhzYWxKYgQEqYkBQAACKryJJ3i+9pZcLIJSULSq85f4XZSJibV6a1KxNssHmhbiZmI/qzoQ7nVyJs5Py+4czel9Id0IEDwpZzNS+2mqxKqXzOnXooAfpdjcKfRmULPxj4oRjuAxyXUf5hoAgjEPqCW0k3EVRt5NmXTWxhktIoqNN2xExoNKniIgXd0PzeFWXfiUcvfopMbMchpCzia8nwO99badlqKHX8vQxc9R0MQw"
               );
  FUN_1400bc640(param_1,
                "dVuMHm+t5HnO0vJvIDlY6fwWi2UrA20EtMPnd7hddh4Uyl4Bsy3M67q7Ab0yP78ti1iOT6fb1ImfroqHNZagDucrQGaHiKhHTQVxIIPJwz0FXHqpgRBHNQBLsRDAimmgNsAa7k4qpUTMxXDionvogJiQFwIiJ8GIFzAoKBuYKdxEQ9dEcGKC5KCLiQEHZxRQPDxBR4+KcKAtyCKOXiotIorgxFMiKrrICD9OCjkROHE30RR+9AQNBEFEPmQUAzUBF6/h0P3zHiPB/Vp9jWdrtKelgB43R/u3n6ec8zyG96TATU67cbLt7ANW0IA+sOOK0wwPoYABG24uJNnoJjb7eLTe5CwLuWfjMFagwgrPUxAKAfMehMHcEAAB5pmsaepzD9jUfgxjWr35dTa1"
               );
  FUN_1400bc640(param_1,
                "XZX1UTGi3sQEpwiBMAYWn1xDcNoDAFAuGHHxLLUhbSCo9yHukvyHh9zH3/ruTw0TqQz7tf4kzow8Ac0Q7g0+GUhCY0Y1FvnoiW4r99XcI/WAZnK6OOCWMVxJf33i9yKwkY06d7rI6GayaFbl1cYV5FoDB2hghVMEsT0QGF3hAYQYQQN894ZE9lQ5zD9T1wpyXY0Wm7eVkebwnOYZqaHHjyUzO+LMZOI4CG50U5zIHHGyGu9ulwY+o8HAnQwaYbnBUooAQAdFP9qdgNzZjeCPt7oQx4vxqO19Y3eq+v8HX5JMLdpp9ZXL5P+HBjZJgt+gex36GoKOj27Fyaj6R2L6Dvinjbqidj6uIoAFUMIAAfspT3TNOtUU5VbZqJjWYOx1vHvWfCG5MrhsqkcL"
               );
  FUN_1400bc640(param_1,
                "FnTAvbqoVLjgh8xAWeAmQ9DdD39+XJsX57ERqD3QwVIYQAAtuXaynv9qQqzYtVuyqzT/JjXPagAKE0ihWjfiPh14vcm5k8wEgAmK1DxfKlPd9CvVLsUHfHfkxUMNDFbIcEyiBXjl0DN6cEJgSEI1rZ6fistFuv/a7bT/pQOv5jpfY8Xl0uDJXHahfj6dm6+BtabD+Vy66UTnY0nYHYKw3RUZrE2yVPWpJevRghj09YeWXhgGEOM3rsAoIARxa/GZwqlQixS7jQ7G/L1ides2m4l+hu/Y997zseziT1JdvZ2uhwvPuZ3r4U20yu7PTGfQehqpv4pTXKns/870ey/tN0mEHpLjPFDeWZw/aavjWf5UlKT6GOoRiWbrxdgLYi4HFBtHlUNQWEAIONmn"
               );
  FUN_1400bc640(param_1,
                "xL8z2hsfa57Znji6oitcto5L7belHpJRRPGfO8GM4rj4nWWp9IuylinITpkvcV7Nk7+5KVv7nbBtqVomuMpVUnlvvRgsBbNLck5rOa3aNvIebdty5O6xgYqz6ySaIfjuolnIAKsIkigekMAQW9E36AnKGFxcDQxJE3Sc4ot9U05OT8Ki4LqK6V5dd+zVjeHm4mQfZ0HykXnsRw5GyMNy2KldjgqoWjV43vzEocy56C1HA/0olH0VaLzDruSftGwhbOITCGAll/pSFgzcOzFdizGtu6QGBAADob+g5rE1rWxW9R5BxbHrG2eVwWV7XrdMTEL1xkTfS2tt8gAi+jGNb40D4ZTyoue+MvbbkrKm874XdOgTsOYMcc+Pd5rKc/EkkwwfOz1JsjN+v1HN"
               );
  FUN_1400bc640(param_1,
                "zqWp1HYs4Qhel3eM+S9Rs9OzULcj1kwSuD0nZhuRameCAB+9HdFACAmKP25pP9qUgksapitNfYZs2wb9R7wESHQoLdOfTsBceLdY7SOvoiyc/Pe2ZiZWulCtewRHnyubqcDgZrBKRp+6gTiN6hf5Pb33zg+vNcqLI0lFBRvUvF85OXlQeaqFNc7tZ0JKaZTMHAO/WfigsQNVcBPuGD4ohCkFhAC4WXRZ3hoS3FyiqL3JyWR6MJVRmMwviXvjpq5OJd1q6lPPz4l3KQuVVUki/GktJbrqre5rBe/cnJz0bZ6Wz1lKqJof7UebATxSfKKb/L3JtRDsCnMDXcg7t9JjzmQj6nxl3ri6kVxWV34js9DiA4G7YCAAESqW9PONphX+2nQLxx/tLjI9zO5q"
               );
  FUN_1400bc640(param_1,
                "ZgJphU9HzmxrsNJ6UFYzKtffFSoCiUnbLJY/k9tnQcq1zTpCnP1/p26b/yhdetOtv6fu27J+aUPwOGKjTIRLUvdOHzKYSrz/09OeDnZyYmCoLN/sTeXvz2YyAIvDzOaBkyCv072kC3jVleT7mauqT4NFI93QxXKjKs1GGQAWweN0/kzz40YAIACXReEa0g/UwbXgxGlkmsFhTvX8mzIFDGlue+ZKZtp0Y/oSqQKtKZr7jIofaVI12v4d9G75+d354dDB35ik6o0Dqr3FJJzoFBep/IlTDAWy5UpnbGV69PcyDTXN3m9FZMkWABV0nphtjzEKDqttbF81QqRWJniBaAu0zttX7fXHBACApC/Y9wH8YqLa9+D/OreY0pRzZBXvyaMmvu1wRsnmZ0hg"
               );
  FUN_1400bc640(param_1,
                "6xEFG7ZfILxGya38Sk78HG+C4eDjRNOL2O9Qv7x5rSCNTPB0+/cX4yPI3+/BrEWxWw9ZNhVgdtEK1dVShvqNxbRR7K1V243b98W+WQ/4cWEiNQh2Qwto6Oka11BgaYZ6nQLggBIDwPJaf9eElVKX/0bZtsVyPbeHlIRNDFQu38X6OZyr+4P/sO+/LvTEcFVqgi8m35diQW25wYWkV5Aa9TSYumt8oddvKAZKP3rOPx0B3j1ZPsJZEtAwH0Xe8Ol+uaNQi9Y0hYMKtpKvEeDV9HA920W8gsFJWLm1oRnPGueSKQki3GACACLpWxq627uQ2vA0Tf/nlFOeCc+0n29v1ud9Fcs9RK2DW22l323eUv2Wkfa0fjvlnEwuYyovjRFUcjnHSnEbZ/1LCjet"
               );
  FUN_1400bc640(param_1,
                "RNV81PwEODRG4ty1WOUPzvo0N88eDk3/lREvydCCtcZ28bXP7vas9LRX5/Gjsmn2SMammKP3brLhN3Gr8i5nbV71ncFBjxP+6mRS8nHoeZQsGRuJ9uwoRgFfdP08WiYAgM7I1hX0DxU4QIAOm48teFofKwoHKgju6tt2U9DEQJ1mcj0DB490x26WKWZKmYJn+4ccnNzz8U3F6tGjhAVt64FWnCrGx+HlqJYF/pffI6Nl8fFGs3yc0JE56M01/JPjh6nyMcgQ2keMzFaDS+xMtlHcyfTMYFZ6DBeO3Wa3LuzhCldHNtm9Ss7kMu8RqQS+j0i9H1ELu2O0k6vP9B1mo8N5TF798fuj/1mOrWWtRhm7iVKyeaDIXAznt1Ur/s2dIOCAwBgCzM6AhKx4"
               );
  FUN_1400bc640(param_1,
                "R1vpFmP9czFE6FbQxiGqSE5TeOn87zcQUHdvXrbdqu764Zr8oc/ysv7Qz97gqpfdOY7VTI1NaJ2ba2o6Xi31YM659M2iu81mqeBG4/mstmN4/wqccnoL5hRaoZ3oTMI0PsW7KTEaZw7Ux211v4mpi4yQa/OQnnctVTx7IbRk8XCScRigcsItdZFfYp72BiN3qQQ3sHdAZAleYxf4xLvSG9RNpkXJcCXrIB59RcEDFQRKINE1ees4yBiS9nIF4AggeCeaH4fL1bztHCsXiAEFdDhlYgozsfvQcHqg1dZkIEIfqNY7TuDmRyLhj8vx38XjHhJPihSNS0wy2VX5DNjbp3+UH1eFxOLL2eMuJjdmHSnBVd6gjFGVyx0PkcGkR8AYNcPaHCOHGvB6osfE"
               );
  FUN_1400bc640(param_1,
                "vHYCV4hRNe0hWr1VHOwkzpWXp9U73Swr5RNqZf9uHlL1D/msyeg+hajZAsYwB/8kGsxNFaXDUwJzHpsLaqr69O56YlvyH8fMeGff7cZsQKoeUx24IonOUIUafrlEl2X+pGlQvHe2gLaJxJDBc+Ig75oxZKJ8qPWZuBh7fY6TIV8aNcXCLtzmlpHmp1Xjhlp3r8wPguORidrCQFA72RUZ/G6UPJSrK5r7S6DajEYS+RfLJHptMm/TPsvUu+3S27EYSw0gEAIAP/F3JFOFCQnmbSQw"
               );
  return;
}



void FUN_1400c1dd0(undefined8 param_1)

{
  FUN_1400bc640(param_1,
                "c4aeUswY0AQBCWmgzMUFZJlNZJOZ6ugB/Gv/////////////////////////////////////////////gXp58T77AGm0qV9NoKapoAYrqBGBYLYUaAAAAAAAAAAAAAAAAAAAAAAAAAAF5s8B6NKVrJtqCgBQDQNNUAaDEABKgAApIoAM2DVSVtbVCtAbZ8Pve906dAAAAUYi3gHt0PUpeD2ccMd7tVsBgAAAAAAAAAQAIAAAAAAAAAIEFh30AHxVQ6iAFAAeKhAmBMmBA0AaAaBoAATACYAAJiZGCMEYmTJpk0GE0YRpk0MmE0GTU8Q0xGIMQ0aZBpkwmTTTINAU8aKDVP0QQACZAACaaATIAFGTCmJhNMU8gjTyNIyDQNNDRoaDTIepoZHppA9Qy"
               );
  FUN_1400bc640(param_1,
                "PUGQNADQDQAGgAAGjQBpoM1Bqn6CAgTImgE00J6mmmJlM0E0xpU/0xRp6T1T1TxPU9KP9SaYp+mKnvUiPUejU/VHqeJGnlH6p7VPTBRvSmgeU0ZGgeo0ZPJDQZNBoaNNA0GgAHqAbU9QNTxIRGQTRPRPTUwJqeptEKfoCn6p4k03iUeU9Q/VPKNP0o9Tamj1BoNNAHqaHpAPUbKD1P1Q2oGjIHqG0gDQ0G1AB6gA0AAaAGyagAEmkSRBTU9TTTVPKep+ppHqaGIyYQZAeoNAGgNNABiDIDTTIAAeoAA0AAyaADQANNDQDRk0aAABoAAGgAiUkImmo0ng1GEaPSGRPU9PUmyaT9SPEno1Nqeo2JPU/VM1NoZT9Saegm1GyJmiZpqemptTTR6GkBp4"
               );
  FUN_1400bc640(param_1,
                "obEjE0yGxI0ZqeiPJD1HpDanpMagaDRoZiT001LmBFlVhUKmJKrFNvHOmoI9WiqXnt6Ya8b7qSBQIBIH14ICSQgilIKho4iIpWiIgnhcBQFFA3EFV8CApmIgo3mKKX6IKWcVRJEUA4OIg2sAS1gqlaIDe4WUfZRRh7VUMfBISFZOiykKx6p6u1dE9CYmCu4Tlw+9pWfdOuskIfVf89PgUhDXs+uw9tdawyJXEVI5pFSBQ/DkVOz2bsJHIrhrtDmqATS92mbo4rf37AOCQRYX7gqKIjAzTq9dWsDGZsAqSF89M7sKqTcwwqTOUqGOoqMczMiGLSxGGK1I76Lk27cjnMAhWRywGtlGEBRSCqoIwWD2obtNaxSWtqFTGrlr7xNTEFixVFFBawKkFNtK"
               );
  FUN_1400bc640(param_1,
                "gVzrDJrDpnHU1B5TE7bmBbYVhVEu2TGCPVoiTUqL35ZM9lQriFW09KYnh2pMGKK0v+vL0yVVSSoVh4PMlBGa1HOrXBjfGzGYp898T59jhxnQimZvfl5zxlFqm1Wjq4D+GXfdPxnQUxMrmwrZjAHIejM4HAR1HuS2z3y0vwdD0u/m6VIvVoiVrDxYfbMOs4gZxoqy5SZlhghiqihbRRKIgB71NvbTwSLBEgZEdWSBUk9Ho95QPF2Kni8RuZWYJpHS6GmJjX2kLCBZcgjJIIEynrlSZOHHbZMuiKgVkbbq8NmUpvNPNjBko5gxaXOYKQGJ97sKtZerR17rQPLZjeEtwSrbodu1uLLtQ9x3/Tytih0EkKSTb0U/+iMDmyaY4vjenS3Vn7pYpbxvqjI+"
               );
  FUN_1400bc640(param_1,
                "kMkTasaTUc/BaN6l6x2hSi9wlq3wZNBXJnl7LhhLj+40SeczXBdKKNFLPd0GfPR4UukreNErTBGm9311aOZPoGathtOmi7D7zS67hdrHXTh5cyXa5Zgae5syHHlpgIzrpvOaGNRPs4DZHyRXM7Krc2pL3FzoQ0/M/00hZ6PoSCx40FYj5lFUQgtvB5ntPbbGXT/LbcTKO/40RICQOXI9uJgVhPQ+e6+1hz3e/jpfeUF/m/C0zsLfAkQyYE/vMqzDrRvxW3SDwO61fzGB5lnXomia71PHnaz+/cjg2ZxkwXOo4PAYyEc/CpTMhIChJkR+0VKP3MMR2Av+wb9NQcfTMZbZkdpC1FQvnQxsdObuxPJGFqEo6ifgzHGVr2fD6EIAeO8IO+R1rm6Dk9Xo"
               );
  FUN_1400bc640(param_1,
                "R0EeRw28B6lBnEaiEPWI9THWoZNfwtf9pPCJTGYPqy6fOcySNgk1pUaAWHGyOdnq0fEvYOf4EVpvP86OKoM7otsXY2tUeJzFFTG+I+xdpssASsFV/FRSFh643MHKRQ0nL2SOBEn/wiEaIIuutruTWqWfplT4nQQUzSWKYESPrsJX4Os5yQz+wWEP0DM+XFyVEETk7jNE2PSiduCOBsogU4GOikFOCM7CHRUe3E0GUonoSWAhBUGpNKqXPbRLMvmRC7ifdUucSMjAEeHc4b0nTmQJDtczSgb+dd33MJMqZ+jr/EI4QkZYXr1S7yyWN4Y+mpKm/o0lIfrvx4Sl3/j/Fn26Csfh901Xu89PicXWjSmMZ/bQ1/FFy9Hduwu34/F2+H3MA1Zrz70mdBGy"
               );
  FUN_1400bc640(param_1,
                "vZ/LaPMTqELzI/rzc/yVQWp+kXa6VrsoveNPqoQ/hmHeVUJd9bXowGX6fH7OJWdlVIuWvuXanZT0xqfTb80sfucQn3PO/Q9i3bPryMTd4HDBmXqdLbe86/2Or3XqM7cSzi4g5vhFnjtsyrC7nuKPNsK63i1dp+18xVGPOt3vLfEoJ1SuO/2Uo2fZzcdKWSjl1tWxsNfeQcBZX5NKHlF6I7uWc/BLvbPuZvkgj6ylrQHY7peXv+dsxeqAYf95Nx3Dm7ysb+1swngmk3sQ4bFUhR9fiAHQYQ681w/VRpaUmroZYbHIKcr8mWPBgjM65DXFOzfI7exLVRJJtHWWrrC1Ik8/2D2ktvCOJBI2BAcNu57u6Tw2YSpe+Uti1NwejhZ1i0cE9LVt3YROrJcd"
               );
  FUN_1400bc640(param_1,
                "GvTv56f4uQ0fQNC94w1lL0hIYKmG0vxthwxGcu0yPR+jTYi8dyU305STFY77XsDLiT3lcbrkNrbaBiY6X07fpZQoARljRQJ3JAu1qis4BoutSmcc+V76cJiiegbjZecsLvqNNYpFlbAOM0w1tDSoqwSTxnmEiPgMNuCZIMqRcOTtzXHL0GYxSe15Elgk8VWQOd+g3oXR2DGCvttdBsFDEEslq2PDNwoJd0BZUQDbtWEPbn1NMq3F5Umr1hlGAZpN5skyaEWw9rnBhbMOo5ZoSZ3kVogYkHSKLFgnhoN1YXMhs0pgtvkZK448oMOVjCUartJGZFCoOCwynLOtMrxYNV+0nPNdQWn1puLOIBFOrAvhGEppSqFF8wxE6NEQlKrYUjKinPirZq2VtrJ9"
               );
  FUN_1400bc640(param_1,
                "G2IqSQTJaqoZWn6ukdnDBnVai6cPb+RXbeX5Fwjk+9KTMvZeGtzJe+LUkg6eGbMjZ8Q2I6ffle9Sz/HK/HtPbwViet7C2LEk8v7VRnYhSkMkRu/8TH6nLWLErN/xcHex6jmVvopm31gfVAooEgcQoz39CiIio9DFoz0Us5dz8W4MBkQGUSRiS8D0q/RMujT0Hdf77eGuEgmRCUh7B67GyZrvpyVNfwbiqhxKy2gMdZatJKo8SawcsiigqWlQKgo+xZrrBTVTiYyCkUiMzLjjIsqCyKZtxXm2GCoshtsWMS2yMYLELQqK21+RZjM6R9bM63w3rnxv8jrOLRPdpiKjETKUiko1kWpLS+4TwcYaSQSDIyZWiBbfOj7csUXX9lu4KEjrsyFwMXqSG74S"
               );
  FUN_1400bc640(param_1,
                "/O7iYyWDkp28/1DjVzF2fZaXIePcrLPZOz0K0Zdg5Y6FcfJ9Y77Jmo4PFXX1VEv4r4cTVn3XQY8M83wVZ1a+seS+5z6ZvLNiQ+07GLtq4ZKJOiHtRS4gXQmsYP9xN4hl6U0wOTp+/l8jD6vSjhWY9lnQQ0JBdBXQQxEuegp2EivdlRTeT3MOCH626q+zl2TexKw6bOPfFoev/JhqgOCCMT4reybjFnTLk9D3Whpe6tkMXHH8Tq9O8dHN286rHh8KVdt1v46fR183RfQyTTmB/Lexh7yGO5hRPDxt+e/4cUyCJD1l9fLwidGHm8Fr6bZOlEkpch2isMXUkRlFIhilPVbYjWW38+7+hCVguLEb672OpS4EU0fiH1DAvV9Z4VngVAr1qxgmy/PALz/B"
               );
  FUN_1400bc640(param_1,
                "KNs9N6gZJAAIKIJAqHSVGMFFJ6v7egcSKanPnN3VKhfR/zyanmnMsqoHLX0UJ3ZOKiKzjxFWGcaKG6UWLFHLAqctXEsSQX12SiOVpRSRTswKyOdu2nyGe7zoZEYpOzKrBQ6ZKKJ2Q/AZYg+71WHRWjkgp7Xldbzqz9WqnhUece6nkP/Z9E+qxw7fPhfgz7suNf6S+b8qGxsj4Cw8n4nQVrTYh3T6h+d73a5/Kl+JjLpfi+1viMzUpGgfjv0bvH4fse0/pePb/l9o+5ep8KeTGV8U72wWFawWUtPdJR9VgVDWfHoZ879DuaI+o9MxijaVkWsrFBQU9myxIIyDnr5CGKhFIO0C2yazxTp11Kz2bA6R1ooShsQixCELkK5e39r1OV7WvW591D0Pr3/0"
               );
  FUN_1400bc640(param_1,
                "pJ0+Ykumg0roCnkkcaqonrNcSVnrWgpMb45cAWJ7uk+P/6WawVVWKoKoRSAvZrIKiiSpOmCwxkWIrHaVHbJuVYRJAZK9SugYPR5Sr9p5OSBkN12TdwN3SkjIySlKjDEBSex89mCyLBN5lc8LUkRmoWM1We5cRYsFm7YGtZqRYCeNokxOtq3n1j9J25Oyebnhuem3RBVBYTu+CQ+YZKnGTkYoFQL2oYzGCKwFtsKlQcpVcTycSNtT4z03dsiqCyPL01WGCofjmUZFUxK8Q8nEWCkVZEYag1aBn3Xz8Po+B0iqodhG0h52kPBnZCcYGoAosVZONXKFVMpYvE7OMffrRixTpqLBGLUqgkUFCiFViysrBFRloKXq9ZRYxIqIaxagqkUgiQUV/EWSpj8Q"
               );
  FUN_1400bc640(param_1,
                "kriKWlI+5sogKeyYazGRUVVS0uMoz6WzUMSKCyTWURVi1qKpltRZiYyraRQFkWTGpF+EaqCkTKVnjaYi1kiIKoiHqMCqikxIT7NlgosxIsPNmIKKMS+zuICiMn7p5+hsl2wS0lFis8mFQOyVIMWMFEYsk/9WovKQFCtQrEYctWSlsUWGJWKiNtYjFgjIIyVIVkylRBVmJWPegVWRYYlQqFSVJrisqFZ0l2lQVQWNKSqJIsX2GZlgqkPbp05aSosWHTKrz7TTBMSsrIcEMywrIsiJIpRKinGxfRYSqiIakCloeGUVYi8pV2hYMQRTmUwQFCj+QYYRi9ku0FzLJFnZqqiJ2Qq8oFVbSQnjfGTFu0KiwrItaPZI2gHghecuTECiImWk1hUFmM7ZU6pW"
               );
  FUN_1400bc640(param_1,
                "pU1lKUm+9U1HlA7vXfwzpRkUUiqGIamRDq3GTUxiyRalGCgjAUmYXBJrJcL8UmCsWLFFft96T1k1VisUFIs80rF20FWTvW4zEFGM7tPDOt1XiRpQU1M63FhK2MrxDNLCqWxRW0LbJULrZDEy1GKZaEoqIyY4rMVBQ+ssMykULaoKCnqPSG7YIwKqStQUDpmK8SsUXWKUZKhU87cS/K2pPlGVHtYQKlXlhWBlpWGMKOJKna2O0qtYNsUFFgCkU1JUWHkwlSbtJjIY0REFU43Gy7mCxSCxVLbMaqKsBalZEVgarYw9VsVnHWYxemBemii8S24kxJS3xYVhMGblURkxsQzOYHtuWGssZU9shgrDK2F86VgCrMtlezj7hKxYvikrCLFONQ5aRYLJ4pK/"
               );
  FUN_1400bc640(param_1,
                "OMKPVsevLMMbOzjAWGsqxNbbK8MlIoGMlYsbQKhKysnH6BDjqQ3LDg7700DOUyJFxkqVCpWBRUWLWNsUxgLjUqT1U0VDWVRnTJxxCKLrRWKsURFUiqPuqXLLbdtVBGKRjlsFiplDmbt0FEGCNaKJUqxmNak80xfYoahiEXlsFkqURSKsf5lKI5VPNDFcisKIJymMUnd1IooKAqkiwXLYceYWLqFSpiTEgiYyCyUS2hbYrbKzjCoKB2SpNaxViwW21rqVRBxosxhUHLjMRaJcsqr1axtrBQ4hKiIqyaoqKViqY4iuWHTJRiz16UUi6h2yqSYz6Uy4dZiRblBZjCi875g6igsCsFnKFUOZW0DR1ARr6UxBHGtRfwznvdDunZIaKii9J3StS+mmsWBl"
               );
  FUN_1400bc640(param_1,
                "oo2hY3bjBjFFnSFVcbFAWVkqChrWKTpLyhzm4AjLaVPxLjFMSoIg2+o4iwWOUAqFtiqinJYViiIsUXySiKLEVFIsBYCrqHdOJqChqBRlZOnF5txC8zHGLFK6lT1mFViqZercBfatBk6o2VkqVWCigpWHZqeSTwTODYSiDyzEMj9ntDLRYoAsimtYGJKhMQqIkMtkrAqoVO7iCwzaY41BTwSoicagsF23iDbBEDGHv6TGRyhY6wxx9RqKAqwUWLlp4Xu4GjKz70yp2T27MYopxrBYxvjZjOIS2kqjBU87u2TVREWcykzLKsRFYLRiwqCiIa1BSKAjj4oYzjrDGRRVh224xdQqo5Q6dc2qGJtuMiIoei08rQXUvVqHxG2Y1KiCKVC21BREUK6KkuUJ"
               );
  FUN_1400bc640(param_1,
                "bVA8czPNDHElEJVYHrsKmIKeLDO1iyFFGY0RRYoY9J5ujOkCsUVj01KkomJVSLFFqCwrWFQFERahUVtCsiJBtDrKIIjO7WG2xSiS2xt6eM+X2gsBSIrE/+NDr7BmTxSVmpUVQsa1FAqCgod0mOJ3Qta+NhWG+GYY0RGCIvMpmWHHGDtBStZVQUxCiLiVJFOnj4ocZO7L1KVAowqSsUOnp19RkU4iK8dcE4kqiLlosqViqAoLCKpiSpbZgw/ZWhMYOtFIYIFQik6azLfqaSooIwUWYyjLaCkBE4gdtq5pQUKyVUBQHGhUKhWSpWiYyqyLDWVi6k9hx9VDrzsmsEeruErbQRWY1FWLPS3bzlDYxTsMrBEMQeWTGCkxfOkMV4iyoApRkKgKHTxmFLRW"
               );
  FUN_1400bc640(param_1,
                "L1lJjFVYIkffuoYeaanZhVUZEVBTyYVJ3Z3TdsFhrCvZqLIL0yamM6TmNcuN5TGCk+Xu5UUCsCpyAIYwx+JcSYnZBtIiTGBWTHEMRQrVYsv6qkxOkJTaQ8G5Z7OmOHb2VMYxgGPklRwsVQeNCo2yYkrDFW2LBVk9yle6SojEYiHTU4koihFlaVqqt6uJFiyCgoKsiMix77kMEFrDWVDp1O7Kgip0ypBYvEK9WgpHqyiKEVEBdv0GTFVmIcYVFVGIixYr5Ngqhtli+DfTaKkU1K1IVCp1lBY5ag41TGDauNZNZKwJqVWsDGS5Y7S5ZWW0FrWCqKLLmYHBqOlKkUbYtQbW0BEnyLfb0LtIVJ8U1DttMTLSKAoZlDGd0Dv611A4iwKqqwUUFjFem2lS"
               );
  FUN_1400bc640(param_1,
                "IguDAqqzHiVmMk7pC8trQFAYxQUPaJeWFSCm2h6rJUFBe20MSPGj6KVcNwLlRWtYKCwFlUYbhVlYVBY+O4GK9NjD5Vxhuli9kqoQVygKCkJS7mMxKm5mRVMSijBcSsiyDEWaklR21UkFFVGDtCsVtlQj2pNdYblKwWEWQVYoqrFRixViirPG1yyiVh7nDmErbuViuNA7NEiJ5OjjCvrskxUBRZxrr4MxiyRRRREFxCUQRRUlGosilZCgizjUgKRTEh4NYRSGMUqTy8LNQdoSsztmSRZFjthdoVBYtawWZZYsmtYKKFQMcTcsUEQxFkndkxgY9MrlqDAqFRQWL0ysgqMylgKKEFWJbRWKCxeJUgoJlDphgmI2gLFHKuMWGIRZKystqigosmK4zdqk"
               );
  FUN_1400bc640(param_1,
                "9W0FN220zvaq5VnX1+yfTOUFGOqM8EMFQWRFUxzrZne1BtKzXOUruXVQ1hut8WVHbJRrJWKCMFXUqKQRWOWjFtoBU6yyDjVUUESakrBy16ZMSTIgsEYeCSYmLyySsBQOmuKnmk+kb1kqIwleZQMevud3sl5WlZ1lhUxIsEwskxxBQwcYVPx7rBQRNdcYxWCqFfFhKmKJOmBWQWEUiKiikMtiwWKKcQuNB8bUF1okFOmjiVVXjZiSsRRgjFgojBZBQEZjKIsWLUxK4wXXEFDGSpVXysCrx/K4FRVJxDycHEttRTG4i0EVQQ4yjBwoVgouMqIkWXLMrji4ltlYpRKwXWFFY2lRZ9X5STFE1lYpOJWLDN3NSStRtuWe2Ya6IjJqSosnEDVyvtKVDiVg"
               );
  FUN_1400bc640(param_1,
                "oRXbjMQWLjAplKzLLIPPGmO0CsRktUsLzDBZFlawWLFxKrjRdpj9UzZzQqCJBEDzfNPcd6ctkKgtZ0h011ArKixUaihUYxEimtTGFSoSq+jxzm8woKjjV3bgjLbKlUQRFi20xKyM3cxlRQMtM6uuI7YW2os7JRgsMu4UMmGpIgk2SeUdH/4ekYp7exz/M9wfxul5sT+OH1Fnt4Hxnkx5Jy3V8xVpyzpq6uLpKxWCQAOViAgoZWDvICp9WKIIiF/gdJFQbJiVRES9wwHvKV5e6e8yU5tyB6e9N+YpAA4vtfeXBSIwET3t2mEDoI2vN8RgbxH2Z882A7hWSFuwgdkj2DQOr7Hjefj9b8fqYrM/Muu9ctBeuZASCIB31bi9NMYx69c6oAkKsIEtTno5"
               );
  FUN_1400bc640(param_1,
                "22mBo/8lNJQ6k2SMWo9ShMmpYs6SuEW3WsFrtJXWRDioxsyvrmc1mbnTwPay2XSx4wlERAQSNFiuZBCRwYMi2n8DurW3Z+DiZG1E40lQoqQfGv45+1+YxbYhyMEqpAwplI4LzXoGQcOOOhjaZ1FLUb+CgSl91aabIoRCaM2RjCaD0GCu1OhyKbVjvKMBMiCNdKoG7KeirJV5Ir/w9KwS9OLMqfMSBtWXqZBBByGoi2JIBr642lhLTmXYb/py1erBerB0mVXFjB1K5EznpN5gO59nC5jgMeqlZ6bpGCt8asAgqqQQWOyA5cpJt9LTfp0uBZcYmRAsJxIAsssACc25YjAkkFE/pcbYW5q06KEwmk5u1PNG1RkICwQlIIIUs8uBrAT6iDZh6mstKZb1"
               );
  FUN_1400bc640(param_1,
                "6MW9XTxvVkBOVApgU+C+E0lsT3tYqsVZ2DfR1tZxfhN7Oua1WlUlnnWQ8XjScGRA4ECp6ckzkzLHdWFsZqCeCg3rkLzQiiXKIxOSGputyII4cTloRuZEJMDFQc2VGkg40QRoMsbM5kIaeW3Xbpa7Y2NkLUmIFhgCkESnvkE1mC8hoJTWsNCZy7Sn6vKknXvViFcWOPqcDtOeFZUACUrGl4SRrzUxYKHb4HD1et0IWpbFtnbjB5TV949dUMTBBWVLWp4yB0zNXMk6IIJTos2qsutZCNTZBzTdbllQNquUKDc77ndU18ESQbiIsiNV2GFmWggTy5F1dd2tZm/Juu6c2rNRO5ITom1jcb125GEh4OYpJzrIwcS6dqg3TKu1IEEJa7wPzt0GCFCgIBJI"
               );
  FUN_1400bc640(param_1,
                "1JxoMKMFULi1WLqFrNBuslN1eJk8Eiywa9fMWSJiKXkykZsaEIK/E/tpwDMzUN2Fc5CMSZsiroSkqKtHAo0kI4FrENlBrbYWZcJDwnDdD5mzvxBv2kyKriyrDNa8Jjb1tzWiUyZE5zyizI9ouqea3kMBGUyNNyQbSHFpGQwI1BkmS3FYr3ZZOLbnB5EjLTuYHm9kGhRAnhPKsWaRo1I0LnxhNNXP3s1IdBEKjmWhSENyZt6WXkQBsfdTcqmZoRSWZUCepUIVC96WS4kPczptUhosxOOaVYkTIkZEpa5HA1ukCbCGTjzY6+lzlj1lLdUkhnKEYDzmBYzFo/4tqjjD67NK6IXt1hdrtKiqhi50QjOpcggbJ40wFbY71Ftqnn12w0ER1aV6CJSGuomn"
               );
  FUN_1400bc640(param_1,
                "QOqTG9x03W0zBK4oWq1m+5IBURvIl12PYyDrTCDLkbezJcmmC9y2d9VgtREBo8JDJnIBtcha9BURtJakBNl8bGQGs6VG7igc1NB6VmVDKnKrwZCGEcCh2oM6jwnCajBjIDHxQxlCTB/C8ua7a0d21BmwT35cLmQQcDuKluZVJAWutzAx6QQXaIRCyCjOkUjRG9qlDkTQcXm3017GgfFDV/H0uJknVzoljGQjultcvShqGMysKLJIhSFUEBMCFB3jBMcVKNOBMd7I3HkUTUoN+KO3ejYo1JWZV1DlbnxVYn3Z3rGiHqMAe9GcESEFAXokpCANPIqCbYgXl/txWvRpdFyeXMygvI01c0TIMrkxlASeUwTVlMjUVLVg6NXecHBo5OTdk6b3+Ajo5Iyq"
               );
  FUN_1400bc640(param_1,
                "Hw3qMRsRLlcA+tBUXAAvQcDsxo28ciYzlzBA6bb4dOmt74AIdNbWURo8KiH2GVMFeB0EQNehM2LXz7tbqpsWTkXpdY25bTMRCRDiQCYhQT1ak6NCNN6cpgzMGlCkVeKwPwOQBTBQdmmZzA5MqhBHYmB+mrr4OiPIQk9FuHM4ZCLzZFlK7nTdbTypiMPDrWMgUaKdN7XHCJnJuxHnvhhpQJgCfNFYCe6tzGA+KWhmEUunp8F/FvAdMdm/YFcBlr8uiHS+Bx9gi0440g2cnLjXJ2qB3JC4KSFtUweww6YEHysiGDSp8GzdLNvz7fasUZs3Y9szghrIQYJkCgimlASp2HNeUbhiXywmiJjIJkITORLgbwIlcmWmFfSkFAbi2eNr5kEYKwTKkFDkDGzL"
               );
  FUN_1400bc640(param_1,
                "IN/Ysvg4QgMFhTD2dzOSbxPr2Uq9NP38LGnvWVwszO/7duuzook+JDURjl6dbGkV05a+VvLo65JR3OMyjpItFgpezeRHTe1nIm4ranFdNwu43PERFZEOHIthZw69XRVa94p76783fXCeqrivE9UorI0dUurDZZZJYcRkIpwouDWNquJpd4Tv87gIzrn9XmkaaE4SpKd6xTTNcOjzdg8LQ0VJnxp4Tldly08ePTs24qJct83XNsdsm5HsN8qlQksKrAQXI0tJBDAhTlwbmYA+q9A1NdB29qAhXSvOb9FmO7taGVoQEIlgFg6h5NuqKGTa7Hs8ND586e8pHWqbMkswaAZvbM983Z0FLyGksTCqGX9pnlE3nduOgwxQ05Gzt7VFiuXMVn5e8zqBml4w"
               );
  FUN_1400bc640(param_1,
                "jtMznYE4db3vPh0vrI3Nl58dkkHAGrwRxVokRfexftE092FtDe3z8HumNp29elZJEtOwwRF06ARcUl1xhQbBIg7jGYIjfhhhdfNpk7+ffTGKyOauiSk4Jlm/m4lmtQS6kjKjabacUTsbta2GliU+dM4LJCUlNDAEFiDo83DRU0Ce2rr45RNRTwk4yi6TuoZGmBaEsM5tSqkSIyqU4UeImd/wW+dgCw4u5YGUV47Gk6mJDFV9bjh80L8NkbD8pK5GUYeblY+kwaIYQooxIOgjvQhMUfkUX7Wa/I1SRGD7iigNZLd8BQ7M4QK2ZPBva8miRzOX1MDMKpM9yyUKZp3HCy5GyfKl14jil05THU2a/7+RbsdGoEOJO/wsUAQDlKmirwLzVhPNXdCORsFS"
               );
  FUN_1400bc640(param_1,
                "qF7DEY27SFGzBqibVQlZIpSTLKWSjwooJHjmzjyR7vI6LbfO2ek2GYp62jqcAiR+hAhU00IF+dkGIZsHLkhmlxrjMUqcmSbA6Z8pk88dWKHCyLm0xhgNaSKU8vYgZBTI1mbGnuuMfqsAjwBLJWXEV97QIw1uOKIHFU0SEbtSbzr9MdMgbiZx+753ZvloHm2yNZ+mLlur+H0QxC1BwIeRl1pxuSEzTe96tzoHHZgWIhgEVaqQbnJNpSi+FeoxEyVryqupo5e5IJ4X5Onrra+k7lv1IKmxKnvX4qiznIzkXw/Qv0ZXcseSFgMB5ESS0JhZxK+bzb1660hCZqtXfkHVUnej3LUVl5966zBtyZJ2RRJwK4UhKwmtRSQudPeqlyZbxDzX5738AdGJJRI5"
               );
  FUN_1400bc640(param_1,
                "OVm9fwLM7WGExFeY5Krg30tpVDzlxxUI0XZ0UaPZSiPVeoeuKh4jDbYYW26QPRJDORHfCpESsK7R5bNXFWplZiYa6ih5593bPFVc3gfDA1cIQ5c3zsrDRHsRROlhhajS9Hkeb0U5LIXZ+1VlSdUgxTpi3t7yTNYMgR5W4iNbSsdpi4V8zn66goMmv5DJM+r8QwecdSSSoN71io2fSMF1KCLbypsJhkWGZDxnWPB9/QuNsFWXyNZATKhSvMyCcMEVcbapdr8pFM00Mxz1p6SpuOgWCTnvRsSBGFJrUwiwNNgZrhrDhfWh1p0SpWMM3SZm78a55ksckGOgL7ydJ8U4pbd0n8jdu277HvpRfU8VA3cEaMQ2oyfELtLeCbkucbIVKIJ7qBj4CbvJZRs8"
               );
  FUN_1400bc640(param_1,
                "o7FG0A1rKhbEjlTvztEa9hLQZpJV51c1aYnymIi67+HDsM5Nk8T3yM2aZlQeH/oiywkWey9KAckNYWdisYFwhOW9OuK9RCCLsPhyBslSQZv/0SdqZWoDq+lWNiYZBKtczk7bVDTYazOYGE3Wm8Ro6976UdLmGkO7xnLyZJTmZJZXMwwjQsiocIQUwSMIu83L9w9hllCW5ZZZM7J3zWUBZklEoYp5TAliWCm/wubR1ele/33bmVDPgXb3k0QobrEFQ08ijYX5kFx2z+OSWEjY/NmxuYe+k2pKHbpdFMb6kQZcsi4eze9gciSeDvyfZty5UhiOi1hmZhy5XBY0xycPWlySPNqbi7JkjfBG5BFiVTh7GdvZzSvlWVY/b+yg2QE2BBH9MgiIoMWC1RSc"
               );
  FUN_1400bc640(param_1,
                "DerClRiLiRyEdFO6PS1/JoST7iVxI+b5HZntyDjzXMrhSC5BHcmEiQed8sir7BcTfr9WiR1h10RL6cO5Wd42LEbs8q9Rfi947Bdc7GRfFuKwdp881Lb5sKvIJMSZlvRe7qRsZFZz661reAg9OjRLPKMcKKEiG+Dd2MdAZSHIJIoG3DM0VZf+emTE5DL4aSwRNSTD2MDAaM1L8wDcheJwms4WXwGDYR3erKF8VyRezpTCGSLx2X6b6oQhfqFGqlsBu3SCi5LeSYraYVO0mbcd0GzdUVvDiFZmlWGI24XNIWkDBAitqwyLPYQqBPgFNXPVQdB8VmybfyTIacj+jVkWB4wfUL/VIxtHwODMuXI5gJtkUWsjVCDw6FCnPr8ef3zjpbSS8fK5m3Ego8Dx"
               );
  FUN_1400bc640(param_1,
                "MH3TjAICZp39GIr4yh+fy+Yo5jWQlOrV7jIzNmj8bJF5cvvaKHuBDUtVhFZ/C9Pj8FkU5nEvV0M9EqDxJryhnEVcYtbYTrnRdf42nDi93oqibEFE0zfQ1ICDHco1xtGY8mlA6giI29vpdVVi8PrZo/BpyScobLqRBmPoNB27YVL2g4qrldEbg73bYRDA5SXIUyc6NcEcFI8S++lSxuXpbLP2QvHuhMg6ou/ZDhbEH5EkUERqFAhlT1ObI6U26n7u+g5LwnvIbviVtr6u/42b5MVrMpxxpWeaxKoDHiUG9IGYCAnOaLPcza/Eei6GOyNFnwIOssmROW1arEs48z7o3T2LKL8j1mhKVYmC/igav0UrIu81Xb92ldO9HEYyGngYBkwDTR6ksMcCWiIN"
               );
  FUN_1400bc640(param_1,
                "0fheKSscr8AqltgIecO5JDB36keZcdeVk+a5FBMQIQYLUXHb3vgx2u4XRLtKAy5ktM5GQfQyBbkiss2ODDktolETQ7jy5JGNGpPoIbludCs9qHqudBzN2rAmLBMsDHkX402YHKSZjH5aGsypA3X41E/R7XBFArTKgW1PYtZEKKnVDN7L8/h7F2GEnZKiiOPYrIPGm3XniZSHwdioC3jtZ4jsdeujSgZBsYoSbGtsiB86RZsbQnO2HdLWL4bpZYgNWzEtWGKB+BGhbchwe7me+B+c3LaT3fqqoZcATJHFR5NLlLC9MTGZGURJbwQUl44W54WZHAIMfj9DJWvzz1uuT2MmrO7xmSuOVk2xXes24z0K0bemV735FfADd38Sz6ogveNYo9EntFbN+GvJ"
               );
  FUN_1400bc640(param_1,
                "viquhEdXi+eib2iOK/oLZeR39bpJpexKAjAhbbfeTdx3hs+vkgqb7U5EtM/syugZakfOndkSCL5zcxnNSksBxx61q21qCDy68f0xkcHD4WnxL2tTlPjRc7JvVsDWARdF+mFw6JPQsHXGKVnrGlrTGXEEjjCnP597tBJma9jGOXfeHSfIvTHxmS/XfkREZnrryZJw+Zqi2/j+dofr3JHQg21Q8PEnBofn3pY5BoiLlKbOp292OhoGwGQxDfiud0OESjHZp4fDfLzSwxVGjWqiGZIKiFoYigmIw8jLFyNtIf5ffVLor6Hj0eWdcxSf09ORnrnC8dPNU0AsyqKFfx52sHuaEUHbKooIcYZO5Rl67pIPX5nXkaG8p71d1mcUnY6vsZ27CX73XV/I7tbx"
               );
  FUN_1400bc640(param_1,
                "emjkR2eqlqb8WbBJTejHJeM3d0qr32p0xIGzSSYJ3BjoJqdGtmh6Ag/LoRa0H9Hvy85Fbc+FO7biWBvLMCtcTIPZMkBuNE0GpRDkEcLNOlgZoodpMnBJIQnE4gSR2MgNkfFsN3fqZII5FHEhZ9yzMFaX8E2U4YrY9IkxLxqT1DV3IKYslYrFTuSceDZ6zSRLnTO/HTZZifAlTqqonU6UwkVEN5zhURmtngVT4ppvHP054xDrKE7L7/b3tXteIKTeWhcaVMxY9NbN9YRDAPUNxgxewkUoZTl+hhe7k72fe0Nx1ysgDCTdgSiUJv7kto0R8jfKVOc4AYF9zOFyMrWifJRv+llivPjjgp4IzZXCzgYGkDGXEYjiaqrl8i9bsShLkJ29d7bsqXHARCCd"
               );
  FUN_1400bc640(param_1,
                "FeBQwk0UYnMvdmVWYnsc6vBo63CnjDlkQClwmBPMgxm3Kjz0kPhSHC7IQ5pzIxiWBirsD8nFrdwRAROncolONkECkSMCGNMCjGuX+Qj8ruSzVZW2MGI11Uswkqamu5iaR2EjlRIyHcUQRnmo4Fpxo4bXfYECTLZwhbBg4lVhkThEJYGtvqs8DQR2tAgdZYGTIqdRtI5xibB1ZIBEEG9lCsmRU8DJuYcfpNvGWZCDxGw7SyRLlQe4KGDQRdnRhwEZbEHAh5OJ6mrKqkLDikLW7LxxV+Lv6CzDlEdLEs+LrFOt0DgbdGdY3R2tSEJsRbYcEmdXnPUkRgU8TBMyja5vpIYe2n0lrKyMnBLpbfiuqc0AzwInHakFxoIbres5Yar8CvLjSXwyrhOPrcuB"
               );
  FUN_1400bc640(param_1,
                "6AKZN0zGOIQkeOZYmJ0HkBGJxz5mZNafRkeWSCC9bDLlUp4UApbaRCKJ3UjnscExpz8fcgUMzaZxJSFhttSUNQ0HpjZgOPnRx1pGFxFO1BFs2K+lCEIRK0gQk7aQJF2ZOQLPGHFG5Fs0Aq8VHbjoL5rUzpjPvtrPbrkNeLWyx7iY0TtPJxYvxDy+787cMDbPnWaDm0O2ZEy0G+FuNUlyTJEgy5B5u0hHAluU4YggmXCQgQ9HJTGect9hctscmaGa1SRrgKtRSvyYoiYt4905YCKdaZed8CuIQumjPxV5L7zf5QWr3+vDM28ig44ChvCYHN9dzGoL+lApqOI4jZqQOJIGtEIMA6CEOFBi+Zsmc2gJhV5yyFCaUwu6sMgbZkiCcyQsSE7tDjeWuakZ"
               );
  FUN_1400bc640(param_1,
                "TO8rVSnGgXYfftxlxDHXbAuJnTw1RsgzTQqKBUVHSe17gs6YT6hmbG2bVDHKiZkd6Qml+RrcCV6dFUCLkQraFUGepJkxsNvQb+wmNaBhaNEKNC87vHrrRTjIQQMxEEZnRGQMcqhBIhgpsRDwrvqOa9PWsH3Ut8Tbox8pAhFEeDV59biPB4+WNouThzoyDEYNDVka0kZsiP50gbjRx6SGA5UhPrCmdpK8hAk9VlTldpyOVp2SLa5Nuk4lYUFswqxPSkMsiuieqz7E0EbJkBcZM68rEJaWs61FRaXHZal1ZRxpSJGnOg86t41Xi11Q1wt7LQERvvCRBAMXIqmGilBXwdxxoFybVjBFWBc5FE6a3pAWZVGMhjZvhKzDRvYNit+aplDrm3rUVgpxqXMG"
               );
  FUN_1400bc640(param_1,
                "7I2ossKeGmK7C53zuZeRl6nGgXMqRsSoMQU762Waa4skyRm3Dkra2ANeoEN+9RXRDrXW2AJubXTlVXCFUg2pkPTDjYwXvaVz3KWozR1pmWHA8kSxuwvGZDA1LbIR1TJWHExgMQECN9KxEc3qYByFTm5EwmEjlOAnbFeyCCMGswQQ7DtzprbniQZM+LC3WjEDNruozkTTkFSaroq+xDaglOQhZBAiw6m3KF47HZG3FY2JnISradjKDD2tQKjlgin5cVve5PVkzV8vkDJjsGYZWRrzVabYoGaIckO/W/ldQqXmvdwiFL3EkjCQh5il5R86jacLRp+MjMYN+BVkbHe1rOO3mYyCciPWzOd5GsuDU2EczGFQYKCpTz+1bO00pnO0jhr0Qja9LHxzaaOL"
               );
  FUN_1400bc640(param_1,
                "7pqEizFoJ6WhfUV72u58kUVrQ5UwQpfhRrECByQbWRYci+mymESHTbFon2VvVuYJybpehjwqFN26Tc7U7EohyoINWxwWwoGS8kLJXtey88Spgqh1Sshg5cc+uMOihm1Z20mU2DhVHwOrvMAzjI6A9fDDB0LM1AWyc8W8uk5YsrGUQ50oyoEK6W101Q0noY1lz3Caapl4F10XShXmMAgz6EyME9ZYojRCCYaORmk3HQXuThS/SwRP7JWZMGXLdwiDXwZTcYH48ixmHVyPWxqUJLsYpMNrlliTdlwRMfjcr0QLo92zsd776ebvFilZ8/iF8Ea4B6V7cjdiy/20bDsdJrKjmP8/XBuV/nYvL2bTHrsEVRb8OFGKdDMxF9YRsCmzoCEtpx2U1Mm124pn"
               );
  FUN_1400bc640(param_1,
                "TfXhIM7qBxsLTUclC7wlC+/hdb3RLOADyL5FCLSKiZdfusUTc2cX4wMuux+yXW1aWHCNmmiNlf3junez6mCmIApQKfZSYjceqj9N48G9hYZMCfNjcdWbDNd18xY8N2w0KPfcrY4+36YhhiXUTtC0eTUey29xiOy1H6JF3lrtbm+c59/Qa/k7bfbvy+Pz+SvXo8Po+e1tcB0ETG7+9VIP0pnNKlG2neNDqd4pfCr0dJz7r1MPQRK3AQvwjJAkeR1Fij4pC9/j+v4vH+t9LyYj5WnYW28fRPUwd/hfO3fbP0K0+but97a3h/GnLyPnptEb22kLrjJbI5lX5+VQ3DDnr9Sr/J9hEPhVfaT1No+TzTQt5tSQACxl+25YeX6y+/NH1PYcBqZa2MVZ2tdJ"
               );
  FUN_1400bc640(param_1,
                "KYS2vlYWvBAPAiCjqLKmjr0KjX8pN9tz2KYNiowpqNqhJ6EFJH1B+H27IWac6aedFaKFhWBKa+Rg5bda/AMOFxbWrcR0EPGJAMKhvYWY8a42bj9lDzvCZSkJY8mF+u42vbrCYsBymBK2ik4QfJo6A8pUDpbkUZI5tBtuyND596iADphZDd144oIakTIUgq2bGMiRBOxLDE28r+zKAjMaaimZrznLJyhyyKt9T2T/LQOFul6wTl7MDtbL+/gHw+hVRi6PqubgeChCeFE861OcNx+HxksuIpdDmxt+pYnmwzrwO7GjcyAwwIHlG9WbN3OqzYliJtXMwZfk/crRVKv4+RNiOI6s6c5cAyyhmBsK5oWeS5IG3JEc0Pe+rfuosxRQTuyqqz0sxkbDA0fI"
               );
  FUN_1400bc640(param_1,
                "wboWj+AaHoR5CPrcVTRUcxeRdjzqMZfIg+6h2MpOIwOg7p/Y4sDTASe+UtzbOzRo0eCeKBnXIFKnn4jDsto1wxeCNF8aZfJvXI7JqxUxYvWfnwRiiWe/mUOan9ft0CS50G33MPc11zPNwaFzx5cETeXanHJ2URYhJMYWm+GdRI5Qe/gm3sedplkRlTUXRaszHkDkibc5BW5KvquGLX+neJu6JaPQvu2C3BV91U8B0li+250y9EP2bIpez7FfOftXX4X+2q7vcxx+v46b5giVuDLK1g5SMz090+BNKGKpWcyJ9l2PVxgaTBO3t8Lfa+PiG+7rZ8XfJF0V+Rvf+kq/eQ63UW5JNcU1f8HAyUUI8rV6yqeLEamfSwc5/MGmzkb4Hyxw+ps+V7U3Nx8U"
               );
  FUN_1400bc640(param_1,
                "HPHKvnP11bVhvUUSRouH3EUXo4aHsJ1ecJ8fOkp4vks22MyQ+QL6I4EZzQsZT7+7bgPr874PWisImi3eL0xxR8JvcfqZa39/0JE3OriL1Ta3nxMvnwaG5PsH+Fc2efVlolkzSTkeZwpwMmYGESnjzp5jolrm+H9nVP3fA+AsMG2UbYfA4fPfP5Hdum2ODRsxBdZ1TJtTofsi8X1xh8Rhv8D2XnV7r226Tpfm+biennWfJ51HXj8jtuRHQ9S4uzI6VqVYnfi2ho1aH++aMy1+vC2X17xsy+a30Re1jQ4U0nvnxnmdlx5u69t8NSu2I7NR2LhuwF/O6Ve+RuoYsn5JA0s5jgml/2Ouh6MUs7pCDF9javJ2RSad+vU+XJjkgUT+++7xtwPepQoYDlwq"
               );
  FUN_1400bc640(param_1,
                "O3qY1p167cwZIdl9Mwyt5sObGyme6TfONk2PizFFZKGdDYdE7HNd8FeWjzVvwyvyzryyo6uuGSbj8GHB3TQs3UoutBRmQVGXlT5ztisiaImYlS1Oi6WrLzOgrirSyxrbUqFLBsO9ulKlZRalTPbbncpkfum0xMBkSZa4blbKnhWHakCM4LF8TG0KxA71qPj5Pr4rYohlNMnX4OLfYhxrv/OfB+fYI3pny+/XQcGJ/HamCN+BnN0xqOsugDGJOdbZV6OhMtiOJ5UQxpHTmh7XJC9BDru6L2QvrnZayKI9okwPOF4zss5d7NvPjeM5idOoU4UqXm90jdfpbbbFEpfq/KZ6SPs9ucGO1TvVY6jNUy2UsmWQpls+BvYA8wYocPi9D82AbotVXwFu1TrB"
               );
  FUN_1400bc640(param_1,
                "5LapNIVS1hCEXxe9pZBvtfSwIcBvkQd7U1eIqTB7eFRMYJL/033DGGPmWk3QuCXU2OtROq19MUAykdJLED4TQsCOQXl+VWsHtNivuRoD6FDA1L0FJMYYZBOkuV+LirMmeTdYg9ubGO12NM445HTwQwSTtp7O8cV2tYK9LvkOXf3+mvXaldVLEbjtmKrKtDZGaqZmYS9yOBrMcbXLV2tDwJdI5WiijxTTByFZCjDgpk6sTd9TYmPMh3nVuQaZ7FhiQneiQpgbQ3ZrqwMwPC3MFhzNlhpX6DRlcOeKB9CCHFIsDfCgbDjVBqSIhaEouo0VtflqSR2COa7JDbFyiVPElpgq5bqR3oXvt1bl7TgeiUPZF+ZGkZoRIot2ajOnbuPjbNz7q34CLbzHDisZ"
               );
  FUN_1400bc640(param_1,
                "v6zcYx5VCZx3+HnYRsyjhcjUw+kvLcZb8XaXV18jJ/48t3coNEOMaskSBE8QRbEUiYg9RTSbKMOgHK5gkBDDCOhgVwBzuet2JLv9lthLCsyKzaUdV8GxRJde0X3ndWUX8vDmrLXFnknM4yIQyBcZ1mhSwKPrQsFzBlnHjIrecXvVitY41zO76tt+HqylSfk+AMUpzIEksVLpZ76KGREXnL9tp7L7ZubwXX3bPenSAfflsct/foydxnXGnn+ir6nHSfMbj6updHLC2xObZP+5v8uI2+4LCpmWnNBOU8s9OB4/h7ySb1HXJvm+p1p/2vh3rQ7bZx4iGusZzhSlC4Le7+D7v3yY7UCQdv385/j19I7Q135t9UJRDnNcUnu/fxVSM8tfr7bw8Kx9tflz"
               );
  FUN_1400bc640(param_1,
                "WcDp/DrJONNdqNlor78SGrPbObvhsCsz7/pQDjufvzHdtdaDSvlq1ocrn9z3FOqT0dGol9A2idx7yjnlmr8Yfrfdxj2yru29m/i6T/fUgnRfZ/36GLEdLyR9MTtvzhxd7Jr1UiK31/xbTOBI27norHbDvcWOihjHjJhYRMFezIVVzr7JngP1s1KPlVI6n/fn9ht+W0PJddtMfzuQxOAz2R+V7TSX1FxMBNV7raUqcdMr7Wlv0PV1WUVspun5Mexbz4Sw9L5dB1C6/kXbz/f/17lygip8fX51v9WMSENgE5ePc3mG4yBIEpASPp89Ygk6PIeG/Rs+ZOyVEpWmr8zNHlkCwWMAQHzO0sfPqnWroN2u2dlm5bD9Xsy8vETuOk1FnJOSjRJsWCAf3ECZ"
               );
  FUN_1400bc640(param_1,
                "fd3NtEPoPpmpzjblI6ksh6iQ0pxjMj5G/K9kHa4EVvQRTs8SYtv62/Kv5WVzyu+ckfT3rtcq8eiz2rsF4M9mI5U58fNJ8B3YY9S96z5nP+F51IDa3eJFo6clR+Xs0zhhCfR7lKrpPIz2keTF962b4lGnXTFPxhZsqrtYF0zVURBvqqmaHJX2bq7PWpkfMPpw2SK/s8mjfLd7aS34fgrXj3/eH+3bsXd+tn1LU430543EPwnm8PSMW18Pm8+nmm0dcPV/tpXj4dCs+1j5Kj5Vbx7ydOqOTbXKxGeldBq65PtoqArk+NW1uVylcb0FrMntG1OT73ZhhHqx/M/naWx9CJJrr65R2PjE98d9vjrxvJ+Gr8Ccf8H5Hdzjv4bufr3FeAIieqm0fGlOPePH"
               );
  FUN_1400bc640(param_1,
                "yfz59xQ7wypbJSqP++6/C1vteCjxHdhd5Jkp3PgU0FMKAptYwe2IEroXZofvPqdfgj5CHSInWkt0qV29MKe395b58Uo37tajDJN0uohL26yPFAQZcDad91omElVL1Vc8LE8khsOVe3BMd7zKeuvESOEhCJJVkFjRh1MShQRQYEIAURDEIB8sPaeaJYdC4G9Xg3WnwTkGuqt7Ez5MGJjG9/OLZbP9jaYNxnLmVBBwEYGmWDXJlY1N24Euxd3lvGMl/w8WNmPcag0JR3d7EZw86qj2WlNffwlADkMEYxSjK/w7m5JZ6PMMUErExyGv/eqzKKxSYpPTlLacLAba+AaBI2jcGvC76Ma0Sz5X9Kb4T3SRpGiX/9wd8/9ifrqHN8/bvsVrJKeGfajAQL5p"
               );
  FUN_1400bc640(param_1,
                "5bx2AGfrxnCb1XJbkSgHv1L7fyVj0j+ePvlvI1R6QkfF2ZPX6aX/a6H568QAAgBQobeGEDLw+TWOwt6xY0Wnqa8WzssnSoUQ7G0o15aVV6hQrGmpAuRYCWBEYK2mfyOWfcTHx5u000e3+NzKXxn8en7vR9lb+2p6f7n6ueyLhVflnDy9zZ9DZ9p7HOXwbxl6HG0Y8aXzO92Vp73LVTdKOdS/geq0/fNh+SxcP4xfafrPnF+i++Tf0fI6pKOap8Mx+Qz328MrZ0r8pseTJ+Toi5tvX+2P1EUV5R1efuVlk0SYPjZn/R1A6L1+S+qdjT1WJBY2pQP5dic1GfxW9jhhVKBxizNbyIs9P1mULndFyt1WbKPLjxfbSWz07uHeo4w5zEYGEAEG4qQx+pmf"
               );
  FUN_1400bc640(param_1,
                "aCIaRFZaSQ3fZfz+60xbuxk28Ejmd6mo/RUobn+lbkbD9WpheAx0g9knUfz9uDSt3DXu8hkoSa2uyAAq14efhsS8vyCTdPk+jQ60pY6oZily55vjAsaPkeUkL89xzawR0G+nNsh4zPXmz8Tss9fUh+wwazmsKQZ8spXB8G0TFF45icEnAZ65L2wmTJayQkRqTyv1IkmToORYcikLcwAIAAAX4aNJ9IZst6iDg9yMAAAAAAIM85e35+nV4LiVEsFg8Pz2VzYP1FAjA9m736gRp/PnsxhOX7Tt0/T6o9ePhTv+D6f6zKeeMr97Y4Ii3xIqOac/hDcSI9bdcSdv39ccE+1j+Le32/pD4TAw/uwtuwURu+Gvcn12z3WqXZ/G3aW0MREKnJ53we89H8fe"
               );
  FUN_1400bc640(param_1,
                "+bq0tj9uz2Hg/qw15x24t8J9m2u9RwWo1lczEDMerQ/l4dBA4a6oPDyqJgevUgAJb3EgBKkKUwRPnqdV3vXOfWToRZ9MvDMYfdTc6hsICTIyCBll8mOXqIRuQjIhYmWUQwxBwENvLGRxEMrWaNBloCrlIO3aISJJetLT1dVi+Tsg+v5lOE9Cneaa2qQGvAkTBRVTCy34ygZCABiUJwUoU2uwwWLWCQkKvtqkURyJZMIJbKIpFfAhIhpZMVFn+E37ezK5k+SWtRA17bv78F/hs8FlKjYxUMDw9FEODlz9alzMxMPLGQ0Na8ZyxfrWhIemoRwUMUwx0ENACqrUK2ereM/2kQaqwoBR1+5piwnO+fBSoTE7QaghiBBAClLh0e+6NHOXHOnyvA3xFcPO"
               );
  FUN_1400bc640(param_1,
                "zWMD3f4vsehEgPaGUhKQwGQwLKvY0paV69XG/j6bp974NnjIXEPvRVxUUbaCc9Tke0vVWVpY0cx/pUsXNNJAEqiIWUJbfIns8p72w6CJeYC2LPB1Chg8pd4bm/32DgevogBaYimQxHt9JxFf3eU3NXRTkIoHFwUv0G/6Pgre/19d/inoQMDkKIrg7/4XM+LX6y7o6X06GLmziqXyamKAXrHcHU6mYyAjhdRQVa/R6Lu++rgdRBE4mIJZR3UBTpcnvqhQuIIvdQ5uKJscR61XLQENbEW5y9FHHzhcJ4fW1lQ5zs6KBu8X5RUoGylp7/ZY3PZLH9D+u43PmW5GbVOJraEqqJ+QaAC7DCAALtr39Rj+GqI1jj+x2JA5QYAACziPk4rpQz0RS8gEQJyJ"
               );
  FUN_1400bc640(param_1,
                "h+4Q7HMcz6lBjwLay/s/pzXI9hFUVw2QKZenmDx/nSv8l/IHOz57yEkVF5BYyI8jHpJpxaVLDKBHu5LxDaUi6CHSPB/47cgHzfEFChehBGLyZej6qpuKBc931OdCcSpQiPFjLSfGi5cDCb014ESYLIiay/Mcy6ClzB2WHuBnq56FFLG/ZPYqnyaGhVzqNaNlan1IRjtdkqnt84IgtvKXBDpKxg7fcd3aGddSRZlpbjSyQVty3sz2IlOaOqJmqk9VBKub8/K0EFXQdNzUQqGRq6sukZSpniI0CrlHAjAaLr0N5RqsHbIxIxfNas2HEBBi/b+rp4BauMbX2Bs2hszEDwaa9uwHiwQQAgA4tbNdMlyaMd7PQp7FL7JmkjiX2GDvNI+egai29V7HGWjQ"
               );
  FUN_1400bc640(param_1,
                "3yxM3ULEvmfL2o3vT1MwhpHN+yazKfSRGroat91reX0SPEu+KTNC3zORl9V+nZZKaD6OrF3FPCTW2W/XKGX2Pp5eJ2e197bK2BUiN3MpHFYyNrSmLPylLLqLMmnlq11RoIlCSsv7Lm16zh9ExvnpO/+y9KfyrrxI/ac1mr58HvHcKVbUWYnk8lvhXLGdzlXskYqiqJxX0HLDrYwxDtuvCvjf2fFCMDnYedv9cmK6k7+n/F/L7b9sVsYKJ/fhT+iOkvmPxrr57L9YnrioKHnY8j5Pyp5n33Qyp8ADyD1giuKuwHKkycMseWs5mG4gcn37pqBuvKK0f6mrZW8lgaiEm0FJDmy78dLEwN3rfs28UyDsnpGiK3jrgKwFVhi2tHTTQ01/yfXQ5kVXmDbI"
               );
  FUN_1400bc640(param_1,
                "N+cWzvTCUTFY50UYqk0RuU7kjb7heVGhqUgfhJe/EbNrxxfwCBxfRfn0f76yaWpzEzypuS7FLdVlfy1p13WWi6hzpIyWjTTOkJrk8HlDZkBSXIEsHEeTCzhGUGe7lW84560XjVDjF75r896aIojIV/K+Pb60zICGtylWEeL5cHzpSiGBBBBFP8LufanRoCNLBHaIX4xBl3M9C3Rl9woo89adHb+DOwVoZhzt1M/PIX+QpdZ17/Wyq1JikoWf/N5uKzxrCLz9pLRPkaN6SNFF33y6IO4doM/xkQchWvlEDLixFNQvf7gCfDWbFTwtgGh8sdPybmzEv4BFYfa2zuk3z3ob6srWSjcryvapOjVQOd5N3YWNbaPu1yMBURc61p2/rQ01Bd5J50sTKREd"
               );
  FUN_1400bc640(param_1,
                "JfUQkr8GXs2yNiOH4F+fPcNieV+pZ3puiEl3hmQ8w+WiaMw6+6Zvieu7aeACcfZ2M5BpZaNSHnrGLIBSpj2MHmo5ocAIASBf8fVYxffYynNHp9R0ge89i9kfoqlIVodboo73vXy95zkPFcYYLhqYy+aOoPQImolrwp3QZeVwEjep0t9eBmtCuzQOjQ5P6H287W/7l2LG+wKAftUul7LJ4iY35iQ/gmO2i+JqrcIWLrj+pxUHoubn6eBI5aksnWg991n1N6v3/86LGz93QM9thhP4Y9C231P0p860fOxdypHXUt5UHmGKB+dnYuBx0KQSz2FOBir38pbvLIPhuHe1fFJ4rtmzwMVyl5X3vNgf7tFVSC0doJAMZWlLONYOxDuxOR9DgOEf35z4si1a"
               );
  FUN_1400bc640(param_1,
                "MzX1qVZMBACCFmPBxm5kybpLepkcfQ/Gai0aFoATKI18TRr/c+xOTePpdQZqlZXROb8nJ7ar2EYhS6mKD63+mqaJSyyPNL5fiKP0qWSJruxGVyR2LeNCY0Ca+lPYEBzkm7z41Y38trsX0TzhvxcxzNzW23ZZq4X3sXuBjDkahv4J6gM93dPnT9rN+GjZ7Ozy67kW6JKwAgAAABN18Jmrg+rXXVp1RQrsd5x8tBH3VQL1o80mKZr8evPr+Wxt0W2pzn936WcfqvRcs4E7b0xmQH/1GqoVSzgy3nH+iA938GUgO1r2eV6lrWrIvKc47YhrsS7axGKa/9+93V7/BTC9tMb/6J11ye7l+Xpp9kBnka/4dEkt18saZ0uz1om6u135ZEMRMvdT4Hnl7bVL"
               );
  FUN_1400bc640(param_1,
                "PA5vXHeCbfq3YLXtcbeP2FofbTHaRYinBXhAVRUvUaNzx+cUnkeQfyJdVu+APU1syK0BABBAk+dK+z/Yn/NJdn+rdJUo+T8B2x4N76O3df6b7Iuje76cKI5y+UqJllse1IfPnWLVzlvSYfxqpeQDMX1X3GheyWkCv501zEWo5lWm5CR9PFg1yaNrq0PUeVup3/pD8n3DErNDbyqSm/d5r5Ipt59orzDeKON3SbjrfsmtZMHxD6K58xxaivlTOONFcd0JXrc6ahF4xkhfa9rCHTrX7ILnL270i4y3VJoq3thEXMoQAggtK15fugC6nDu7/JHp0hy+A29Y2YwELhSUnOGkjqgKoGVnW4QUgNM57dC5syYJeHHu19E11ZW/XkXPccpxp0BHsPiUuCw1"
               );
  FUN_1400bc640(param_1,
                "YDnHITiNlIxqRR7BDoH35azKhNJhkVb1Y4Dafn7iQqYHUHktlg9NkynI6stKpaI4SZqnmkWAIIGG5Kf91hhOV7HiAwtvG/pd443Z4Rjy/jhvOFt4TMnl1QsFjgffF67xRJUbvelbL4xBLn2CY/x9iDE8XTDE6lZlFUZFfJN+o2X3wQHGLF1lY3dgQXDWsa0IqI60G0SEhOsYD5XLju1NGonqUto3YyWEBdrFGj2XHo+xGbyJfVS5brvlJiTTy2bHCwBBAucZW7PB9RXjIO6VuFvoKor9kpmqQy6K10ET+oiGBFbFiKPwegopX3/7GeabvIuN9O0PzJJ7NhmB3SaDHdTlnyev83MXxcpOwVR69LHpE2Liwjjb5Xh+l2WRSVyt4Hq0GfXPX3JTX6mG"
               );
  FUN_1400bc640(param_1,
                "H85eTrlN/k0RAJDXjBhDE0MIAQQvNY7e4k3vQ8yt9OuMuetM1aHmWzJyuTOpENF0jZiyKT5LMmMfAQtbiTBxTAxhmg1rtzGho3nfYmGJxprrLztv1W5++Aoza3ObZugFbrrBNNikQszplTVH5L0zN+PLTendnPkHQMmSP+Bg4XdIpYSFcPtUtIoprgrKDAhInIIXW7VUTsbktx3BgZ+8xKG2m93EFISEKMSgW9XtStQ/xF/WhmFNh+HLDiQfjDCCCYur6nUTAWbyHjGegJRbfU+lU5Ead18tV6mZ1veG0PibISyxIcN4zTcR3tH9rZVvTYJ2sac+OLee2Gs3M6/Mhe2W8KRB6e6MoWGXTSSxh8JmS+A2k2GaJAnwwBACMUtwP9u4kc2jnYxFupdw"
               );
  FUN_1400bc640(param_1,
                "1s20bY+kduF1rIu2DdIme29VSDMHqofVXmehYfTQ295wcLHO9NbnCc6Y4u+86eGoR9KU3v5nA3jsK6XFsjkRPgcpWgv7Xnz8QRigwBBAHrVFXZhqF0R7HJ6bNqt7Yx8CDLFcDxvJ2lx68k6+eebpKRnNfvqrg/bkqqhpjazs3YoZX1sRROEUXfI2c33X2Z4ONx1BiSHfmnzBk5B98VH+zQn67b53BGxUi7mOMVHPuvFq65aG88ie3ggAggmemcq9E6/xRXjUdMIo6ql1jWdO5znO2yt5JMYmHFxWauUhO06i+FM2h1c8cGhfFM4zOlVHQrayQetO6Jiu7pOfCFN8hPMv4YgLl/uLHIerUohVkQIAAQJ7fR9XKXRtI6MU+pYPbF3CRmZN+nouV4Z3"
               );
  FUN_1400bc640(param_1,
                "f+tVMmUEhaRyUvJpxMxUzhqVg3J9Lyr6DVg0329z2SugK57J+p0o7j574NHhAlABXHyRfkTywOCAEDzZqenFp5H135kOKfBrXIb9u1c5C5R8veCwO+dcJfNsHG/no7RQqs4tVsLHjg0doD4Ek3ctp1BStAuyzVpfIpc91mzn+5/o9qywVz4hPJYCfQjhQC/Eq0wWEAIEJukwRxR5oTx4+2FNurVQnqD4SGkSF0iDS349kyPnAwgBKVB7lyeGA+wYQAAGrAmWr0UNlpPbfwrC2fR0OJgJ2UeuiidlETlZg+Soq5aANlEU9SKHjwRDNxE28AF6OKnvoIGXij+6AgJjO6omChtoIn0YKABm4qKYuAIHrRAUsoKqd3EDOwUBdZAUHEwUK8BXOxEDTRUF"
               );
  FUN_1400bc640(param_1,
                "1cFAN3ETE46gqc1AAyOu4/P3dft+3oAZLhaH5u5uN3Wf0xFu8RpDX47/VnhbNQvpzXWdRW3U1kA5+K4e1urmsC7L0/sVP3Yj1kEztiUSvFeggX+bW+3GHrcdAA4aIvETBRSZH9lSvAzEwU63EUU7CIHzooYTT0UDbeL533Ky6qCm1gDMzjfRrKORiidV8LP1eJA4KKPaxA38OYiAevfqJfYoXMDtorysFC/Q/FPH3dBTqplvEo+xirbQWtATl81RORgBW1uuye+y2572d7eDTWd1UGEiJhthmvy5Hb4nB279TRVt7Fu7BhzE8tFZg+UWAJnSTvjsNAxIip9x7f1xHB6pqZAeW6Lo9dc7iwEECD6PUMc1nFvLKPiOGdl/MCaToWCoftoeCubxdsrv"
               );
  FUN_1400bc640(param_1,
                "yfE2Kp44Bfx95g1dCvKMHtFYcgRdn2k6YV25ZpREArwrkRG/md9iwWlvMkEgWxDG84sIAQF+ugGGHc7YgcQmH67g5MxfAYoUyWdqLo2aAfpfrfdvmMN/2i407t/Nxvbm2+FGHnz8kp051qONKL4zXWYDWRRQMFYECAAJZ2TugS07vyt5KRIn4QLUK22iFdQVNqzuTCwyIyckkfH5nV/9LVDSznS/dxRTH0JmBY4NjdyKpCYZwn4Oad4qqBcmt9OtqTrFmbyEWIAPb5Uww/jAgBBN0ZBoShCrTO3GUrYeSa7my0yoi5dEFJMSzl9YMFUAxSXbp607JYI1a8rE3MHQ8sRFYEmwtEPeqB0imLR+iUeuojLZCOtfn9JMpp86nuRYABBM207Ht4n6apz3"
               );
  FUN_1400bc640(param_1,
                "ehA/eb8pD5D74oVnWhiVb2I8vGpZal3RbES9Jkq2nvG0qA1y2AGuV5u/MjyCqAcjc9rp5oWOpebTLJbZG774FQbJg/a7npvSNoQQQAkJYL73vR5eMT5VCS/Q+a9+SdXqfSIO9AkHkt5RrW+3ILxDIluZydl9e1v84X9f3ZrwhbwukRcXkX2OPJv/SStwV/Hi0pfksBBcFzRF1YVMHI6Hdag7pwuYNXwYSbpSYw6lMFgOkmxYOcWo9MaldqA9DU1lndy8NZouKo4pj+1tYPdf089frI7IN0p59i/MAyBQRZFRIB/xJGJKiJ6R1tvBYQQQMvE5Vfm9xdgmGbyOibaaQSyij+wD/a4avCfWHvOd4CXOfcn4buMI/E5facgv6yhcfbN1PARty8B0BAZy"
               );
  FUN_1400bc640(param_1,
                "1NYuts6Ww5CFwB8YcVGFETympvdh49fDYcRc6KOcpsPp9O04iKD6stKKCAED6Zj4vtTkPbK5z2ESg8BzeQWkH3FeLwtxgN/mMpeWXSuUuC3G1RMP0YMVlFljRQ/1Nscs/xnXOxrh0G4ZJUI4XCHoZHrg0WAL94dwO7Crsaa/iMmEflRFf5JLa6vZFG88BkV051I3afSHjrK9IpPkURHmucpxoDs5UjUTL5HsMWKCCAC5+OKcezIve8+8aICme0gesPbY8u2HVOielp/Cs6eSLj6t7G1loQaS2+axMTnqtaj2BMRDwelUjb78vq/eGarvv8jC6wnikP4/Lu7Kwx9G2tDLF4RpTBh9PG46gmKBNZXg6WYrm038GFGLFv8ZhvsVWRYANmotmRYABBJy"
               );
  FUN_1400bc640(param_1,
                "2Kel/iqYonA+J0I8KTaHAWkElcXg+ptcp5ay6L0ZQYp5KyOUCIfvt55inkBeDCbxxZpXyQK9n2Aj5/V907cx2RTiQ8oyJYYdqD4KsGNqYzKMXEa/J/85b6hdzqbraiB8uzpS1lKbXcuwrHeeuBxBLjG/i2DAvjXFzGR0qe0yhQLpPkTQ8wiQXlZvfdxM7zGZGZnzVGyjVtaRfKpGfXuJT5RJJLBPn3CIbIvfN0qPTxYN7/HKPGgCCB/aDJMrfNgJIZO3b93bRFY/ZsLNp8/uzQc6z76r9ozwlATrJ8oPMisvKOUHe9QOvyfjSB0kX0ByuqKqC2oSWVTYzzZ/zyIHn4IQlsd+Epfo1qODbM649fr/bsXs36Bj2N8vSYxIxnjCpQx9UacXIwk/4+gW"
               );
  FUN_1400bc640(param_1,
                "fS0p+04feLMD6Dt+hnA/cFczFSS7iQn73xkttHjyoXx2H/DEGdin/qF6Lxr/IsIAQLr3SnbqKPC3Druvl4+m5+4OC6hzCX6iq+35+Ie10QR4ehG1/ljf4kK17s2b7DoPi6PB6J33Adw4+CGJWBULyn3YNP14c+LI+E6a8xV0SMwPocNR/2Uej2JTtyLAq9xO8zWEX01qhD/i4s+WYT2v8SeXILfK70yXB4dWn8AtQkxMjqNIoAQAL2+/4TFiImdd2e7y2qvPrpDQdr3Kgif1yDxvr9e7MY+nz8HRhkfBc1H+caHy4r5fs9ZNX/JZ4cH75oRXbAUKVaxR7cqg93XrKZtXg/rfuOBzbj93YoNz5q8LfiS9efwFgy+rYww4E03e642/b5yJpsEY6Ma4"
               );
  FUN_1400bc640(param_1,
                "QqskU7ztrpcqKegPhToi4mFAMOUwzFUn4+nJAal7bMp6XikIwkus2dIlcwVRkhxyAxTzE4PF/5Beg0RNjNUW/WFVbyVMr0bLlLGLIg0U1zFKJEQIAAASm0kowduagXZaAdstjGWtnxik/f031/1fSa+LE5u3DTVsyqtUwJ1OqAVYPwFzTtV0Up0sRifTEP5mhwJJHU1xYyRgkvgCefEMegl4/CBj7touTt+B1Azvth9GLSn6rFwrrVre7OGeTZWJxEmN0aYHn2WUxMnvt43/nxLjI8Xb/BglrVY2TQP2RjU2CPWYNr8sn9vX/sGBcy78+Kfx0JQg4u2GxrekkoZv5SPXwb/jzRvfo3eUpBfX4sU7qC8y+OEgTlcV2IeAhHo1hqMsj8InzOY2igBB"
               );
  FUN_1400bc640(param_1,
                "AZKfh7p548rMGT4jTXN1vIM3YQ7yFrVbHtP7/bdwbY1ZfvTkovCLQEphGKJNYTcxI9/cw2uNmEsiVBwrv/2xwZVLWSMBysQlnnB26W29hTYzJEq0UhDrZJGRtGGjkA1fAZuEYv6UR8xMCaLoRrntKnUZ1VOjvJYBtLn0DfiRAdPvVPeWgYlmLYO41FB193PUGVeKlP33K236s/Xmog3bIvXFoUkDoEZC40t88vjpW0Dh45Dm/cXMz470/0jL8fKzgDvfFm+w52vuF297aPpvzU3viknxk6LgjrtFh6cbtBjwM/hshuoHmCJxsROfojsraX0fjm4Zv/191B38UOfFrO37kl1XtOeFQQM3s5X6oa4LanpOo01E0bkuRtDgy+mLpN+y6T7r3xSn/t5L"
               );
  FUN_1400bc640(param_1,
                "osxQHzCQu2Fqzle1+M6usrAZz/9VvatRmTaaMRyGerR5ju09Rnp85WMrU4MeHf7LVJauVNp6ma/SCi6jUce/gUSbBr5H7KvKKWzZl1ZhjeNFchLWNQQzCVfVL0tJEJFFxpQC1xBRfB/9pzVzLHNYEpNkN0I9o/V2Gm0W5EDPZRifIBwc3oKUdVU2ofx1z8I7K/m7g8PZWoDDOZGFTfFPhrUUvQj/Rm6t1UeFLqda3N/D77bZJS0x/85y2GRS61BBqEiGAAAvIWEZIifGU/jG3gYW6DX7qhqFbxUZ9RoMHmIjvIZXkI0wb2NFjC/zY3bD3SSjBw4ZwPhnGAxVikypPT/koDUK8PWia5ABiMzrzxHmvTu86uqHNR4EQptBWyNJtZl6qXr8x1S2BVb+"
               );
  FUN_1400bc640(param_1,
                "LHc/PrxS5skSsYo4+aNtdh9rGmFGi5T+QTTyaZhgMLdsjHw7RAZGIP71CowNUIKrcL6wwahgGyh2BWLIZuW1GHEHT0sD6TMCgC2hhIGxyGJNQJzVyunYq8H50mGTxSrQElnkQmIeJwSQlOwiwvEhyWSnA2gCqPGBqkWqJCZFoioZJ7T/yImoaEz1bcNRFIpOrnvTGmnS0jxPhFJyLcA8hHJ0ZHQMirCNpVRWX1MJpLYaWx50K8Y+V8uT2Vg8vxNkngGEvHl2ReA7SF4urVkHUNpZBAAAAC8nLj4iwzrO1z/XFItKSlsqxGHJVIlUWm971vZQkxYHDFBReX0JgXujf6FBBAC46xMEaHN1P5NP2Bg1nx7WJk/G9oLLg6jI4yvfglD9FZu1U0qOs/6N"
               );
  FUN_1400bc640(param_1,
                "s7lR7p9e3m3msfVvW/Hbj3P8Ftm0iSXBkWajGI/WG0hnneNjf2Ud1T2Y2RDx5fexDwgggWwrWuPqPr8DeLhA2PSRQP0QE+7gJRhhAC3oYQAXyEjkGlcnIZCqnYQAQQAVNg6kbHX/fx8Xj9PxVrx0Tiu4p1P5KYqAFiKHGYbZ9J0ui77s+n720VeUw2o21bVxPmQAOf/5T1O04mozsz3n7i629cV7naaHK1hA3uZplYKHKeXRVP7/+oIHknM+VsczprAg4ryKVRBPixVOi0vkZrB56wA8hBUOxiCFv2u6u6x3/U0UA7z89DxoqBwkUQwGI6+q6muu6FiALuIADr57mKiZuFnBUed8nOVJ68VF5ff9tb4mvhNhTz4G8iKBu/Nw9Sgh8bbIphYHIMII"
               );
  FUN_1400bc640(param_1,
                "IIIAORbVfxh4b7eIawfd209NlKssbs9WF4GcaBzvpE/QWBoQxAlEMAAgBACNeTuiZGOltvGQFNt3MkbozTs5MmFdaOdoR/fvcLcSvdw8/d0iyjpz6/u6d4JFD3vDIIF0kAAsMAQAAAAH/oH3B3oPpsynzERr6u+y16+5TphWC/PyoOc2L4mw7OsB2+kgaauYjYfwHOkCouqVp8voNS9tpvH68Iyx4Kl251tjb/ANMQWz07jss9VYdGxJdODxzfiQwEA6nwE5PIGAAAIkGAIAQQAgepGSersz1webFBb6BL8t39R95deR6XDZzpLjzb5dVZ3W6vGcbfeghc+dt6kS8V+4qQVTCxVDppcon0qKPnEfXggsc4gnzbVOEjOEPFUP5P6FPg1V5cSXieKs"
               );
  FUN_1400bc640(param_1,
                "JswKkh5/qgvHMhBlIkV1/n3YZ5VjMQUEDUyOEoORFC5xOA3DAbaYRAfttZGc8y+an7PHUersnihEeMdS2GetxoWQESkT2MZZxL3Bxv6AsWSSARUmOgKMWVnLK4KodSBDpZPw9+52E+6vG/5dL1ZaRjMejt8738r1Trx7vWyfD3eLFNBH2NybpR8W5aEgk7XDO/OSRz/xaG+6LVMNJHpIoJw/0QhkkFhmmBdlMkPBV7IEkR4ZLMsdLQ05JOCQQFoLrnpr/8neaAmRqiUCfRgNPFbH8lklAoXoqIZ/2S2SWvEKBEasoYiENCahVGlMSqpe4yhJc0Wy0oaIUdVhRdhr/8kXtuX7xtsynSkQlVClJtvxvvhFFw9WjRipP6lUulbsaMS1YxdJPcuZgjMr"
               );
  FUN_1400bc640(param_1,
                "TtjcWvjVoPwT+bk+SVNMNjRk+MI5aMFbW2C6BzJx2KdjJ57AqYUJvil5ukr6LHprMZ0/+zpIYGqpwMIwvXImLLHlmv4WNJ34CI3Ch1kW5341+tD61cIsP5md3Nd1NK2tdq3shMTGwUM8NM+NBoltGlMsvoW7E6GRuy0Yw4ob5vyvusj7mueWb0iD/UnHwNmMn5E8jQwO3kgyjqMWGQP3sUhBNMUsoqZncu5OuC6px2c3XXT2eppRimbXztwlGAKqz4fmUw/xz72WNRZ5pJ62qSb0QnB56dnzGjz/T4Fu3wmSqzL+fh9+biHeRP3UqCV/gxdn1lj8f+CaQasWZv28MBclRCGrGy9rUNhrnZH8cfolv9p9z8uOWByJamwjVOg+3egGbDUz8Px/hLye"
               );
  FUN_1400bc640(param_1,
                "j5rhVKKeCQ9rFyHyfJSBxwSltFr15QYSOZl1oQ+td1PYP8tpzOi3q/jMohaBNTIDS5CWNzs51H9ZztJdhPj7OqITkev0+dFhHj9x4fjljaUl4U6kL9X9PcmOx09XjsJ4WotxPN29q/7TlxkQ7ppOJd3921xYhpG46Z04SSEv2t9X+g6RiPDws5mIX1cSrA1GnC9s7m5WYr5Pr0ues6Ppy4JaeVne3R+7vGVqYJBZHyuB36ejJWBBAuTnUakbSkpFj+a8NaJTwtpQc0g6Cs0QEGuC2kQJO4QmTbbYzRGCqPGqq0nCpEN+YjsmU3X7EwLnRnG0kpg5ItxvWy2s3nKAWbKTApWijsFGmSpv7h2DOhIbyMCJPaYtou9HFZURcRbVKFnMl7aM0D90262x"
               );
  FUN_1400bc640(param_1,
                "PMa0nat1GcjkOsIw4YgKumCIQP3XiwcMU/jKs0p9lNek6e+GVWrVyHaZ6uoogcj8hQDFrD7YyZRFIvpFp2dtX97YwaYbHeeHuZ5zFkl2+9YIyCl+8ovtW0hHP0zk+z1noME1xTiQ1jfRBD0T5NLJg/IVAzxFSIjY7th8tIjsNNrl0p71W2NhHaiKLt3w1sYlkFy7S9MqKpMjM47ty9DBci1EQITYiDJ+W3GD91z9WTcmqSQepoTi2kcw7BFCdCJqwUIqWbCx4DjSU2WQ6GtpPSrSZBLA2UtsouB4qSo0TQZs6h/MTek7rJWat98mqkpQQP3rjANKqMTK59lQzVLwFzp+ZSSxdYqlnJdLsKhWHVdJkSewWniIq6N0IytxuNzznS0TWpX1kFLVQ0bl"
               );
  FUN_1400bc640(param_1,
                "NIW4hardi1s5eVB7MDZgabclFsYRcOEaM/Yl4Q4lDGxmSOOSiGMOa0lKIRK5rjm6bqAR24CqhpqgaKCXtGtZOOlmxQCq0I4I4rpP5xvNhWM2Q44zfnuIGQQpYyDIhSGSRGnRNRAgkjr3qBUsQSLLTbZWbu6AgzSzedBHUlgpCagT97UlaLXMehQjGrnIYGiOZW0wKdwulfQtWIB8K1/t0+2jDBk57YKjX328k5Rd4upQhlSRG06YUeO3FpPNJMUDTDRVB9hrdjTZzoPvoBt2r3m2UVF1IIm1hOMZ95JZ5o5bB2jakFDTWVoqlL3RqCt3QhStW0vQNdjaKvpRa98sp6bmmylzkT7b1q51jCb207g8eECkNW/0lxokfs/LRa93RNfcX8EbM9pBTzJq"
               );
  FUN_1400bc640(param_1,
                "Nn7OsC9PCjo76D9ky9tGf4CX/KrHkPYgNaJv5I2/BbPKaObHt4O5+m/Ijyo1+owtLY4MFPKcZkXkWwr6NFeZwULHfnBViqPvKgPLSMOU7KiGb6NTs2iEDrNkHdLmEXSw6NePvHuNjeDQSLChKTFWEQ1Ou1pLICZghJjNsnFcaoogbGkgEu1sK8sVH3EbVEyUKu3SZPRAgOTglcoDRmkyCehm+beLAUsXEx/Ciods4ehKp25T/I/gwat6JxaKBiWTs8DvuSho0pPxUw4Z0gmtVFNPgPAv4NspQsDyQ+KgtP15oI7+94+7J6LfJtmGDN56JBMTiYndNDw2/nr2er7C5oUqve/JwHiesn1I+N5qWW1rHLL0flXX7GjrJ4H1eNZYDxoDvd5QFAH/4u5I"
               );
  FUN_1400bc640(param_1,"pwoSBJzPV0A=");
  return;
}



void FUN_1400c22d0(undefined8 param_1)

{
  FUN_1400bc640(param_1,
                "c4aeUsx52AQBCWmgzMUFZJlNZD3jqZgCkvf/////////////////////////////////////////////gTd8AAAAAAAAAABQAAAfQKAFKlSJKhUoASJIgApRKgAKOh8a+tsxhtbaVzbdu7rXWurmoNAAdAAdGulddarZdOte7PeZt07trNq1Yy0WtUU0mXWcLTWj76+ivoAAAAAAAAAAAA+gAAA8IAAAAAAAAAAAAAAAB6AJ9OIlIAAAAAAAGgAAABMTBMJiT0wJgTI0yaNMAATTJgTCGCYAEwBMACGmACaMCGmIyGjQaIRTIgjQngpjQMibQDIZGibQnoAaMgTJ6DQMRpkZNTZMibQJhM1M1MJplPRhDEp+pjRM0poyAAAAAAAAAAACKaBCNNTRm"
               );
  FUN_1400bc640(param_1,
                "CZAyGmgxNMAIaYmmQ0aaJ6GlT8ExGm0jTE9I02k0zSaZM1JsI1T8TTT1J6anqbIkeU9QZAAAAAAAAAADQEUyEMkwmAACamxNMjQJhGmm0aJgE9AaBMTE0YDUwaEPQmieBEzIyaaZMRlPJJ6npqYnqaAANAAAAAAAAAGmkkEAJmjQAAAANEyZoJiaYCYJpgBGCGRk0NGQADRpoaGgmk8IBPUxqp7QpoMg/VPUGCDNQBgg00AxGjICFSRAmiMJiaaMIwjFPEA0T00jaaJkyTzSMjJip5p6JjSp5qngyp6bUJ4CZMGimaanqPaUNNA0aNNMj1MgNGTQaNB6hoNA0eSehoNoFIVpU+jIKSkqC5oAHn4FF5kAAv0B+VKYBEQoUFoVFaVEF1ZR1khlIg00"
               );
  FUN_1400bc640(param_1,
                "qI6k4lMKkrSAtYIVUoQExCqpiWgRUwSAFCoFIKicqREcS8CQVHYSoiZ4QM8oqf2dfhFBD/BIaUjoQFJSq8uQVcQAgdPChmgE4MZpEUMoVMSqgdpICfOzYVoRXNAqhroAMpKEaFMoUHVhATNKB+/KKBmlUoRaSnZQgGhI0ALiVFfpSmUo0iujALQg54BvsYVQA6WVM5A0ohSCZocSAhiVE3MK5SII0IJu5RFxAOjCJngQpUKEApEHdwpmlBFKUGhaFCloFKFSgH6MqOIBDNA0gDQq7eAUFygTgygOIWkShWlUf68IiZ5VddIacCFKhlCYkEUzyII7+VEc8iAu3gTeyghnhaKUQ/1yriUHewKhiEKUE05DEo6cIqUBlAOIFcQiYlSnEAgGlIoj9CEA"
               );
  FUN_1400bc640(param_1,
                "XeQAIOgVZiXEGnCYlDkybWQ+rbuVdKER0JpAoEdnOhKAZQFA5pRTEIp/alxIH5sCmIACgEpApE1sqasJ+TAfz4VX8eVTXyaMi0oUqrr5NKDNCGJQeFCqYnPKDjNgMSg6cvpIAzwIFABt4A2UBsIBQ18Lz0Dv40YEVAoVA0oUflwoupCApQKLrZQefkFXQhQDq4FDPFDlCRJmkxLRl52DK2lqyZQGlGrHG9pg0OixoyNFF0mDzI9XBrpTV1cK/kQhpQdl5GNXNgXnve4AdfZpAzymhAORIciQxIdfIOlC9TKGzuPd1D92QfSSunGhC76FykTNH60hlIv7UIYgRumwIYvypFxKBs5AxC0cuXEoBQUgmxz4EMQ5QJ/klHEgOrK4lE1YQMT9K3UhlIUj"
               );
  FUN_1400bc640(param_1,
                "toQXEDpliUvy8Cc/lgHPDiFe7lAMQUgUUqBwIDEom1sQpqw5oMoU52VoFygpUzSlUhmlHopU9fmzZZpTEUtGeFc0JwrtZFMpUzQhnlM8gefCh20JmlQ4loQBowOaV9GXhyGUutxgA1INGAyqXRlBP40mUNoYQM8ZShz8GNDAtKV5kZQtKZEHpdhgDYSZoM8hsINLNzck1M2DyP0sAaMaUBR+j4mHN4+AMZ8CkQ02/9VkoZXEgMQB3EvQyB0MhuYPNl0P0MB28OUGthxA/nWnC9BGpA9dCfW3Py8nTlDjWyk2/b4QxH3YD7c7/uMKPRyaUOrCcKzaeBDVk5t+3Gb2WExacBmywaeODkukaEZpiPX5hFcShVAKWbEanpbLYQgf34NrZpAOROlpWnkq"
               );
  FUN_1400bc640(param_1,
                "Bg6jpjIRfnaeEU1snqdTAo5oBedh5Wpj20Am8kQPbyA66AHW2CQXVlVdHNgUMoROckFO9hADQkEOggROLZSqGulQ0MsIpSIeJgwglCpQgJEoAFIAUAIn/CURcSgHpIMQjQgNIIFAtIi0iiakiGJAaBUYkAKVQPWQacIH6siZoAFzwLQqbWAANnKoJlAguslFOZAgZZYVE2EAjsIVNpCuIEHnZQBDvIRTKEQDsZAB1YR0pUMQKFCglCpQohmkEXEAGnGUACUAKZMggsSitIAhSgauMCIlKvs4AcSKPPSAH68oaEZpBShFdZAiaelmyBAykU9nKq5SoaEICayEX3EIuykzkimjjCoHdwgGj0Vg3e3wCuwlHiRsdjgU18hp6Xn9jp6H29n+74eh9zvN"
               );
  FUN_1400bc640(param_1,
                "iscva+BkedUxZiTRGEoZwwA9ugODy1NRXekfq7hF7/C9SbdJAyFSubxaQPCANYyx9OB+bD3kPkw+t8X9jJVPkSPxpQA6uQFR/UkFEP4JQEDt4ETsYfUfbwqgHoyKH/eD2UKAPGlEdCQB6CEVH4MI9xCC9fAgv7UvvpEBPHhPZQoJr43UgA9/ID5siIa6X6ciB/vgVD1MGt/cwCHoyKp6MgcmFFPChFHqoEdtL+xH4Mg7+RUP2YQf3oQB++gDtZf3oQD08Ig9Jo4BH/tAKnNt3Ae2hRXed1gANdCgfry6UqA+fDtpUF9NAD1sBw+qwI8aT6kqHqJU9/CIOvgDU/cxuI2Mm7hDwYTuYQCvrSiDsJH6sO5jhTiP4sD4/fYPrwvnd9hA6LcYEA5NTlGh"
               );
  FUN_1400bc640(param_1,
                "PTQgDw4AP2YflxtJT6kby4kPRdFjjfUwn78OrIniQPDuilPsbHCifXkeVBzsjuoBV6qBPN22P24DacDAcW7eeL1uAMQfcgPsynEn0nCwn40p7ODQgPlQ8SHeyZ7vZNrAD8WNlHPSfXh3kmylEQzwdHBs5HspD7NlHTSOl6ONx9rHq7ez+JCaP8GE307aO94mE+DcHh4fKvDk+1Ah0kHhQb/ZYOBe1lV6y40htpTfQCgbqUXU2eADkyZ549vLiT3kifwoDYSPxZO6gTnoOp5GD3kupHbTsd3hA4khng8KV/lQeplD5MAn38r0cal2Mvzp5E+jGuhFU91An827raYAPn3XSdPAdp03Ky433MCHWQbjr8Bz0cL4OGjWdzjv4eol2Ea6B3sB3OUqQGAq"
               );
  FUN_1400bc640(param_1,
                "TZsygDs2RTyGENGRFGvIYUFmRmFLMgJX28axD4UBubkwbj0+B5MHzLcTy5PyLxY0pQexjZw5SayB3239jk8Pxuhy3FvrqY+NCfYgNbKgLupDcbLAPiz1UnQw7mDuLS7DNkgZW/gp5E9nusaED5VpSfw4NLa6mTie0h6S+8h/D2+ND7evyDd3QyHZx4sceE4RzvrMjpbnOFin3sayA5ydr+Hg1l50prY+19HAfCucj00HRxwpOrg/C42EN1Gujaw+4vbR0077tMOiq6pTVeqgR2baDVJo6BAyyiB6QKMiNIFNfLe6SoJkoh08Dwo2Eb28iEeb0uADkc7+ZkOUvr/t4TPDmjw47ud7CIgdZAfmQprZE0Y8GEOBJ1F6iE8qTu+twmf2+PEuDDmg0Z8C"
               );
  FUN_1400bc640(param_1,
                "F9NDw5DpY6+dzB2t08HKkfVS+u7fHAqQ/KjXQGnDvoTyuBhDtpeN8fCayB4sL2kHfdhhSg+8nx40el42XrIODeqthJ7m0rPdXHxu5wmjzmE8GT2s6UmUDwoxJ4uywbuDr7lXHl57RwdjDxYO/tjAcy5Pt8a3p8Lu7wJNCQO6gV4EmeU7WC2mNnB4EAakOlJ2flYDrbdQ+4ywnRQIinvY18hv4fb9dgfX/i440hrfy8HreiwuaTiS9VHq+vMG6g6O7K48+2k7OfGkObKVf9KzYBK42YztFA1W3TIIgX5AvCA8KCtzZ18aRBDEAVm/wJzJHyLvYDrYM8e7k9h1mBDcR97GldnBoSceHr5PFtLseXk6PbYOwvizwoO8nwofvYdtOsjve7wCPJavkmoI"
               );
  FUN_1400bc640(param_1,
                "pPkbhaKJcZWiywIDwjOKDOKDhG9KJTlAHpd5LsfaYHwIf48JpWb3OHqfEwPNnmQU+XOLexuoSJH/52osOuusQBZkOCmhEqiWZmjTmLtlTHefgYA2h1QOSI7FUDHPlhX1giOWr1ihElSHNDDMCIgkCE08JQN6UCRJD8C5km8nTh73gYDu7W3bx5cHhTr41LQjUnq45yAtrWwbVrYUxAD6dI3ZucdYN0t+Q/FBKchbkprlETWIyzRWpJ8+RAF6aOvleZJ+BPnzxYDa3Uw9vau52253Wd9j5mEPOk3MB1cB0VrORgTwblR7zx8D5cdZB6s1JCPSgdHBmlQVRFEUGCYJ0oFWUuiJ432fNcFpEzThF2RUESJA7G7UWpAG7KJYFJKZVA8kJ560BMRDHLQu"
               );
  FUN_1400bc640(param_1,
                "JVUcqqRRSK4iioMIfSQ/FhCnSkoGVajCNWsVEbESBTgm+NeZkjxJdjFOrAdtPxLw47S2vV4O8ID2cBtoPW7vBut/g0p1lrrxo+BJn/N6TJDxYClCk20fFkeshAkT0COFRVnVanq5Q/3a+4oHp6MffMn5hYUoA+kJQb9RoT/DY6NgUqdmw7LQSgPY6ip3inAI6xCJw+WoH5iEwmn9iXNFbsCDkWnOclPjx11sIDmx3PTYfXXuoODel7rBlOwI5UdBRqEqTEkaUkuob40506xaoixKNjzTvDJcBQmOQB6ygzinMg5feYdZByYDzoDc7bDybt4OR9zDvbj3d+Hj31x4e2l8bz8HK5/AeZ2WOl7jD8efNg3ufD6udKXb8TD2t7W86ET5EpznS4+HC7T4"
               );
  FUN_1400bc640(param_1,
                "eHxo727qfk+/w7m3/hbzL2Mv3Z2VzZD2EbaDieHg7mdfBsYx6rDmj40vSz3EvP2sh314ElsUoyEEeQG+Yr6cQ1ZFNBKgkzgYagQZa1VTskIIc7rN6DnMz7S2l0MHxJREQ93Ap3WwwG+trA9zO9vXe+WDISCIwOF32RhCStMqAdMpPVKh/KCFhZO1aT5dpWZ6h0UiiAgemRM89WVMbL91iJGNKKyWo4NpIYgb42dDEsRyZYgaUCpsrvr4seml93Dyp04Tf/L8jb5kvYeLlyodl5WD1MbeSaIGQQn3wKiVMKQBvCHpEMdKfUcwoBvYykZOlMsoncIekAulAiCHBDREOYP34DEFoYMoOFRKBFkcEoKCpWWLYoLU7w5UcttoqLVpUyiikJXECIIF+QOA"
               );
  FUN_1400bc640(param_1,
                "dYpU3FkwDdnVKVsRjN2qEiXICmZrlvTXy6gSZQCfIAoSA+nvysSwRhYQgzCglijkgCcIhjm4fEYHhQUTpWiBfuFSb3SoA9dqiYXUXfSi+EoBamfKQMIqUphTBkCXLkpRX6oGUCoGj4ClVQqnOolAaMuQImqWo3u2wJry6p4TaEJYFEeyChPCa4pL1CiNoXjEdGaIEERZacawOSEdlsRHmmu5Fl4QHJGzHqg5x2QUiSAltB4jABSmSiFEWUhSBTEDWPK6KgOCiOCJupVBWEDPPO8KoHOyqQRFBrKKIoLgoj0gcmDVIEiZp1giAOXtsJyd9geonwLtIDzdzg6jk7TJ1fMx6Xj4T8aNfA/Mk4UaUPy7rZ4Ofk5D2cnd3ybj6Wu6Dn+H6z6Wkh51tpTd"
               );
  FUN_1400bc640(param_1,
                "yO++K08UaxSHIg2ypr3apKFBhkP9CqJjcdRVVqoLsgRZtiKg5xGsbMoBu4xQ5Ikza+RRSkCMNsQN6Q/uqFiI+75Qj8U/KUFwYs4pwatZIw5A4pTilBSFKgpDRcWwJiETZF+7xvI9r8jBuY5ch4MHyrgQbuRDicvGwg2se/uuvUXTfH++1nS77QTcRzYHlRzLNA7SXxPd4fLl8OTuODjsNDAitIlyBV7So6KZJqOoo16mP4dA27JrzBHVKV+/VBQFyQljLVmpU3rdHRwdBXwgPCmKUDdpYwzPTi2IBWGZqFEAUTT7iyxShg5d8SX087fZ4cb3Dnk4m3xsp2u6xtreW+k9CDSnw5O/8bA5riQb6OcvAk8y+bJrtfj5/SY1luJFHsYAetkEAHqdXGtn"
               );
  FUN_1400bc640(param_1,
                "9CQT3Upwo1kPD/H7DITTvkfiey3GgkqQN5bqlyfdHZDPceyZEgNigbEbrLUcY0JA8RTiGkhlF4R3ygmPOswdJ/pGD+5Z7Ve09MOUfSByCErSOe2UEiWzL1gE77FTLoVbF6UYQkqQ+kehRRMtiK6Q/GzslPAc0iI4KgB0ZwjNImCB689daClmJui/l+jFHJNeU6puSLsvz1RZaqokWUJ2SBAEAPDEGUm1RA2Iuijc6RHS525stOXysfmgggyEu6JaYhPJjqguiBgPdVj0pCkPhA0NxRmkCdkFEvxfGxKwzE0qJ0SgfygGpILhEc6EVOEaaaVAJHnU7BzSKnTUCVIkCkYY0sOgRkG3OCcSax2JhkVV0uYRZGjyFy+YtMQ+lES6L8RxiNqMVJE8D0eu"
               );
  FUN_1400bc640(param_1,
                "FaArSk5vF3RHc8yiiMyXwpDFEyDtED/7TqORe1DM0+Yj6estUROlNQ59wo0j4yHBRIIhL0vlwqDdlLYonqy5jnSTYcCcmcFq3IHTbrAkXJbFBDYap68WHw982DXLtWJxynrpPQn13S8Ti5heDbuHjwdHocLIfBvfx5MfAj7+DqJ2ZtdRUFeQ7zpZifflbDBlFPEQjkjsEewhHZAoiKkhBETdKxE1/pVAJiIVAL8pllAJMolpQqALDiLjU6j3cFa2cVyUOq5HFyO59DAPLuZf0LX6uE1J189/C/OnWz1l1MVc7hETvFN7hq6IqpFeZDqmQUAft6qI/7pZIgeM6ZEvoRb+0K08IpAAxFso8ZQVBRL4iB21HZPWNUUD9KSbAmgeaQ/yyoOOYUwhHO8S"
               );
  FUN_1400bc640(param_1,
                "gXZFgdwokYdoixLRGFPw27aAEUbo9lxpMr6taL4sG9g4s/I4eA/mSd5LroOLL1UGUuhJ3+z9h3mboY6O7adte7g2E/Dved51WQeojS5ntsgPmQZ9XCdjJt5ypwh/IqS6I3CkARDkz6oXa7zV6sE0EjSkEUv39RuvcqfEQvkR312sG4+HwNbmd5HZSPTweXy+p5GZ5EBwY2UHkyJQ8E0PxLWEdqxCxLi2ZRkXBDcpfGDI6ZAd1ahMjxrHkJAmhL6RAwi/GW5gtRUvilERIgh7vF5EsqNiEtDEyKjjncKck4xTAKCcM2YbRVIS78bAJqEUJyy3id1VbTbrXCjjEDzHF2J5nZInTMnpEZhEWUcSuswCjy1AEeY+IxYFu2EOXJRzQKgTvFBCEDCr4xk0"
               );
  FUN_1400bc640(param_1,
                "VITsGSID5OLz6dRgc27cScU3myBbEXXonuo0kcR3ZVQJwxvQwmDrlBs8WNZyX98t2sDkKkQR0zuzQwajPNoU6BA7xldtwyWIvG6ga5tDu7NfTrTEo0EEtzVAoeJ7GBJrQWFIGdxFjDYlBqGYKdh4rYiNPbOdGrXkNin9qXVLO+WUIblEEwU6U8o2cJXwjlETnXVPMcLpKPN7FG65ioiAXRlCgHGm1RJkoHV4ocHYIf9yActSp2SHRTB1FRBJnBKWZTfcG2ZRFEcZipYkCHPFhVARyUh3a2ewoFIUfylItWxNI2BydVZIpV7v0MHzv02wfeUHGOlBYDAMk3J+PjMs+Q2hSPUQNwoNLPUUW+jWIjmu6TBkGnPVxFcFI9+UX3MXZKTxmiOh6loYRUn3"
               );
  FUN_1400bc640(param_1,
                "UEx/NFWrIlJjL0G7T/Z+0OBq59rHwNbgMo6PsMHjQP4MG6h8eU1J9CNtHZw/SSoNohmqo1yiacS2ZDz6oBk06oHsUoeny2i2r2VrmrTjLDkPfOoSCKJRUq+6OVEA1Yeh9frlG4dlK14sweqQluYYgHhKK0hOkQgx3UVEtCeM8qy/6ihOrGqJs1MiolSA2I8ZScivjzN5llwN0YyAACAIACASat9bTe/Q/Ebzuq9xnM9zlsYgJDLMNyQCW9sF3L7dzyfvwvV9GG//NnZdO0AgF6UApCiekhB2j4SE3pF+ROmoOQaspGGmQjL329ZlQStzHnzx8+xOJZKPgRui5IedyyYNHuqIryPGdcgOOGqPWOIZpIfxstOq/1TjzHezWMwUEjyWfid2LKcjp9lR"
               );
  FUN_1400bc640(param_1,
                "aeTQv9hsnBOVeLXUMjyuJBu7eHvTNv1IfLKff6/Q2TRKCRVW8tKshfmwi3mSLSc+yZMMF6EJJIe0ZMEjFSOBxOnZYFhXbhjAwEdLq5BQW4iO+7GDyGmciZ/HrmU4rr83UmfXi1ZsjT17Bq+kcGKWEKxKnA/SJ2hE8IiIxLf7WzUbefzuuaHpCIVynDLRMgK38l4yqXSh+uqim6I5SbIt1Nor3rUpyZzbG1D5K2U8sV7qgRs7VuluEVnj8V5DabfFr2ctfeqVXPYevVXswboXkdC5BLiaMNqo4fKsBhQkyx5XQleLSfwMSTgHQz2owD25cdOKtqKj1NjKh9eKvToRPTvXvXRMlzedKQC+Wch8grUgulRO9EzKvxIqHvmShAFgGCkG95xe7O5QRUpr"
               );
  FUN_1400bc640(param_1,
                "qMgNtfEPcig2cFwoY611UGpT1UA3taPQoauVOtbuDZcKdED6IH54Q2Xts1nrXif1zwKrS8meQXeiSmDdwYZJhaWx9RapwOPe73h9BjbNjIDwGBhaCBzhzBPXEErmve3f2rowE1f9qjm95tdosvJZG+fvDphC5Y67UwnHGPr+NbPJBlp+BCmoOExmS62re3K3SnH2DzzfTpXdo6nMlrykpMmmKrUAKe2/wKPAbdrcTm1m32KHZsDgDF7IgDPqliPn0fQ7F4mimcQFboD+DfDU2IwWixx3DZDqtr88HBySWe+5TLVhnlFr+6akkESUjgAbzPAcZy8BUzr2kohq2xoA2YnsyW6ud4EemQmu/sxgajObL62OuztM6iuzPFIk5yBZtdhssgSGESwkoxz6"
               );
  FUN_1400bc640(param_1,
                "4jGpwjxH/SFoFUi7oWRS6qawrHtuid+Y31LOCA+UasCnD/p4qlSXLaZfK792XtBA3YDBNWv38K9Aupb3KN9bLVEc91TXHSU/BpYpULlyEcqNANCjwTNwUCFd3jPPjIZWsd689Y2S7uGpnPFk5UsdBaIFYgmjgPFUDDaTLl/MSOY1z+fOVM7I6r3HL86Q5OW0m/0bEiP7ccYPMIAw7VH67qn+mbtpblInW+06L7gVzKRa/XJ9DQ5LAmXFQShHFSZ5BYgCawurWPZyV8WlEpZpvJDXKhysYm0+fWj9TMwDc4KSKR4HCBQc4Wo4HDyTNnLse2XyBJeOeUPFQsSPglx2ulj6EnWNlqTRyR+XkjAPKIiFWSm6GumilKpXoF49xlqOK6DWz5XOgMZ9UhoG"
               );
  FUN_1400bc640(param_1,
                "JIBtCImeKaJUirZbMQlK7reqTbATjoTyN58zXjUEdNIhHRukd0TGenRMEELX08myV+T06ySNlnWVrlEerXz7rLmT6e+fSbteg7HLVunPI1I62aFnI7G7KCcEGBqtTrKi4D5lA+3iNMWqLzCV9z3JAP4Ku12imdDjEPxW83BxKhAyMM7cUXpzpzvXTI0MHoEQmruTSwzZw28WPdyCKe4cR0SzWq6ZrasZ8wxoYuXduy4JxA9EQ5EBNtizV0x4nfRueU0iMetmmyUsiWjqWIKxsuVleiXtitXwwy2kUKWV8ZY74+kkXPEhKRb1tT3VyUf6vEN0JyJPAeiRVwYwtoKj6qZ7tKa3IfJ0Jel5cWb4WHJg76CpiyMIXpTr+MoAjkVhvacyXDJppwkO10k5"
               );
  FUN_1400bc640(param_1,
                "NFORxIeteewrz9nmSGfHJ6pJGOI11r2NKhr6dZSc043Sap6eqpg6YVqVT2nl2gdlbUH72yGDO1GAYQvZEyujZLPVlXfUMnvE7Jqo92SgzZRKhLeRcMGDQYbogIcrd2yDD7lqtsL+LqHM0oiTe2IWIqDumHe095HtqSPy85oDlGPI7ZsI2gvGrs3MauAc/J8OU1EkZUoo65TXNdRKmIfoNMPIYZkgYaAwYnt4MK4AvT85kCPB2qy0aH1kd6UhcbipK3NA9aTo8DyWmMdipGNqjK/yRZPmERLCIDL67jWs1lTneRSazWXl4+UnIkWiiHE1uuxKoPOLA8RWwdfkhjYzckiY8D+47RtNqOYCQvBznNDdsq/Egn8Z7SZTcCkIjjQ/Th5LXQ+dZr3RfSnH"
               );
  FUN_1400bc640(param_1,
                "PG26V83xt/Fle6nbZhA19NbwpLiWq3kDuaGIZeiPtLpDA3c0xpi2snfIfilDtfjpVsJ5hmrHhKIOCPCdMySEEjREBqjGQ5j0ZJLeyfFHBInYzq+nU1FXLSFNdaXflYBAcxzdKI2Lh4x9dMldFEM+pHEx8a9VZud4rWPpNSC2QYq4GR0FFTRHQxBLdwfnrGY/ZKCXF519CGkxbvHnKfLL5VhLHka9/2PrcVJHHHgoGAfaR5j4JuTZ9JEnPr687DZDEOLn7WAPIIFOBh1LLqF+a41nM0UpxfFRxa570jIAn3x7kTwTtRsLiXduPC22RB8xls5NxlMvHGR7Whf3HectPs6qd7cXP0VAyyg2jFcr5mRUtgMU+jdav4WpoXRyo+EejuzDDzSVEfgtHwiW"
               );
  FUN_1400bc640(param_1,
                "CYZFDUxC0rZa5+9nrFreP7ffjN+Nh1mrlFJA3iMU/cCIk2OL3LgNIMc7s03IWcKXxm4NQmZFSfCkbGCcM0+2y4gNRKUFLiDkkIz7Iw6KBW6Y61Y+2jAa4glaweLSj8PJcY9XdqTBbWfxiyVWq1T5nn+mQn5O5k9vi7ygknNoZno8Vgtz8+kucQnTI6p99ZoZ27+dvx5JkkrqtJmoHmMvxMPUHRnBgu8eQSBHiVZgQa5O5Tnuz0RhICsbwflcJavBfbp0jgIg6PbZ7a/DYNOOjftadndQ6iVb2bBdY6pZGjIbHWc6nkgr2E+5zA4mSojlVlc5IS7o4WbZ4SYvcMx0BOBblT17Ty/O5tW+woLU3TUBNxzNAtlDHGi244tDogpwCikCxpJGiyLTRw/P"
               );
  FUN_1400bc640(param_1,
                "t9K/qpigte5CbRtzyNjE0mhdcpXYMgRucKSfjqsZAQ/qdGMz3i6VXQPuFCWMvF3BSN0PIMR90SASEW+hk/TY+0jaTZ5kTxyD7/cHJFr2UkcYuAVoCdiod/mJIv1VnP4hZmK+8N49KPiBpCjfuuRqBREaJJoy2gUAS0te3zUsFRJZKu9gmRgFQn4nPLRktxaAgBdVVZM4n81a1sXq7M/2mJeEARHUumf1CAlyZkolF4lwaFUHXid4+NDbI8ZEcJPRjDIEATuznEgzEAPJ0ZBB6i8XkhkOyqz/TFGmXl9kkAvF494sNHv4GCMjg8JwHWfpZnULYCeIAtOitWZb4l5fx67ExOYtr4VAxTzJZUEdhL65Rck3ljF5M+2sjiw75QtOiOLWLF/Dx7bQSnzF"
               );
  FUN_1400bc640(param_1,
                "lD7TP6PZ9UM2GqvDu/c2nDckdciI46+Uj6PMt0aTU5jIWD4TB+Q0Hrz+W0lGQI79Jc70bXnaoiI7B8cv32yZBv8Bf0s1ZMyTuVn6htjGAI+qMXCP0Ebf3KJn7VU7XxxTOXa17MuDUR3XUBMWixGB35qZmfPdV9aAtjuGLI+ozp7nHW4flAJjoRiBl+Q1PWxU/YZ3pnyhuISHbf3xKWpH53CpICWEGMJtRZeCnv7gwHBYCJZU7pYmz3uE0OTDd6IavSPoMzo4MS0zn7tlZtbDMciYI8xHCITudOuYPTRqILOUT5G5vttjojl83BYALWYWRI8vFqaRr8JTyHhzyonZIvymqURhHaMlnLYvOmwcju3VQ11a6xDMY+k8Q3Ps3/wayapRoFG29+7c3lt4"
               );
  FUN_1400bc640(param_1,
                "Jepl321zOdfNCmfFvjJUygbso8KD2ZntympMincLGm8MK8zqisbASR3hS5xZeexaSIxXLY9j4/j5Z89G340cFR2UiSEoiOSRcGdtp3qZFy3rCE4xFWFWUXEYIIwRTTklgDm6SvDlWi6BgjbziiuIckC37azZgiBUzi202tNW0/WnuZUOKGTXge/ZZWXFgzRkF2zbdLrsE5nqPsh6DAxOu38ZkYJbV4oR0XpQZ5QfIeaQnD+yl4PZ4fWcI/5SvCPPy5Bl2QOs0tXTr3uut0cc0JGzkPjGi6XE4bQHrPdIGVaLsGIz+fXNYxD2pXgYyjAMhIfZNtAnd2dLGd24qIKmj9R+i/WohSJ351HaiVAaODPbbJcgckpem5I6G64rAH6RVME9MoLfizrJROVr"
               );
  FUN_1400bc640(param_1,
                "s+vN14BqS608zu9HUYBLcLbf2uN4VSxIjyL78Vqyh09KFsGyeOyXYIGSc82RGsQGim3+RR5OjB55aEh0qFgzcZaz2aHvaA4hAcYk0wCrKY5LOhSYAHEdA/Jax2C6KMEAdxBgYVYWQF+LkUA4AtMQalcON4JB/mq7o7Vcu5mR6tlvyiiDMKYx+wWqiALc9HpKiOSJMgUX5uD1G7agKeqFXiQMQ01zTuGoBusdUdnIPQo3F21pkJ+YzOr2vJTSjewwojOy/LfzfG9L7bWy5tsuPOQGX6Yn7vE5zylNP0di0Ej8hZ2rjhx9G3bujFAimN/yFTRIFXoLGaqgcUpjZebLcKx03FPP8ycaoCKwpoOlgOmoH4yllndtg0jMEdr4PuxTaU3Yuc8+Ao3Iekdq"
               );
  FUN_1400bc640(param_1,
                "sUbJ5xDzlbzotCGIJR3Pw1JZCYbysQLtlqaW3oMxofhI+I/SRSkWR5u76TGU64HWooYQzZO4cylWgKVxyzV13JYNgiUIGOQk/aS0q083758l+2lSKU9A2BCdI3xQRPmW89u2PwQXqy9cbko+tzcA+IhwRUV4VM3e4bKwjGxVTU+nqwvalvtsaayfUFkUozWa63M1N0dNwRfuNKU0Og+dqU7svMvrTyuexDZFKSpSjKCEIdnKPDoceSqvBz72fuet5X+gKR55HA4HTa+YjwkWhorzqSAlOs3zTyjC51Gzb6EpfNnPgcSp6B6JRIiajGJa0Xd5vmt7fYcpinUayBdNQvjVJc7F+qX/f9+w18Uzkhjw6JEJmKjwjTaVBHQS+f6vxso/l8uFS01Bwg5H"
               );
  FUN_1400bc640(param_1,
                "pzls67068Nlt5h32WCwplTW46gC2vr1mJjqld79TVdS7dE+IoLvtqmRrLeCD2YvoEnrQfXNsUYICzwVwJ/S0jQqRFTZwwS040e9D51vxNaXXpRb2SlMwHn01ERnYDJz2xcO0JyoUJ2Dpn7vIo3KT8XPihPib8TkeIjDqtjozua3qCB+LHUfUfyEUBGV7aaVaE7TTfy4U38PE5oPkues0NY+I9Dmr9HuUTfy7EpbTTeVxlmb2NZd89RaFBwrRdK+UfDmvKscJs8mVwa+jhGpY+o6hg5Ic+K7lxxyconokQUiDibrVrY8vetLHR4eojIvI0YAuER62uNFWV037E6hcc5jxZKlyoEdgjvnnEc4iXMYYGWEfqcF274MQ+cp2o7Rv7VRVl2fpKDtiDN5G"
               );
  FUN_1400bc640(param_1,
                "B1lCiBh+ddG5DyFl7cmDe0HhSo4NxJrUcZkcslyysyVidPrZW9waKWb+v3x+BxdTXp1qnUVfFPGbwyhfqNR+AoHNFtW0jnbf0eh7wH6mib/3u4V249pGwU34+1RD4+S6a5zZZ2to2TglF7xevY9jg58yu5v6yZ+Rsk321Tw01MFNsHnzHjsaAaGbTJse6JpxBCEdWDgnb+pHJxBUVPYgvveZk53b2DNranuI2gfnI9RG/+XwsDJznsUpjavHrZ+O8tZKvltZxPfrHo0Y1zT1qpikWpDmRYAUAFSLFBsAdC9nVddWlNTQs6QJCIEyR8tmVUn6ldeVVU70WTWCPwYanAXhN1S/L06ngaYMqjp5gPtkM+WmnyxwsrJaA7Z2uaohtnnlgdfgUiDugNo9"
               );
  FUN_1400bc640(param_1,
                "bX73mP0weJOqLgv+YhZzg6oWfmmkhnCII0RB2hONpu3kC5O5UPH+wbujDGuKWXGUapGedouqhZwoOP64SH9lOK+biqfahd6OlA2P1zscvS0BjgE/7A2QPBhm6pwkEk/kIJ9MpCtMqQ7pYNSYfF59ddyVY4Lhe26+leNmb1Rh+he/iPOPENqWMV3k1TFfVDvlLFiUea7Q7J5xF6QHsMKqUrIN24Mtb1AtK6QgBpXXruuhS/CINTC65IQsy4U+zvbFBniVoa/XSQkZjRaqsuXEpEPmpo+diByUmz8hws5ZTReunUfwRm5tlv6qHynkXB+LfYjMYkidK8V2udpt2ejHCrw6UNLiTzXCaL0oG8eVtOcWH0KfKTU/NyTtzuJ0JTbEym1HX9MwDOfGF5oO"
               );
  FUN_1400bc640(param_1,
                "Ygp6Lri9QrvStUjhIFstk89jMxq2EpRMBKHsZyFLcOMiOyWDYAREDQA4iiJmiw3lFtqIHPnIOTvZxZfcFhsmSCI8TJANNqsj/dBjz9jUhGIaURApetis4arDnJY0hzc8Nv7T2ncaK+deWy9DGiugFS4LqFbVJy39LQJyp0dqIEYhgVWMO/bAUB947P4UrpK9TOlsBZJK22nCfMlbEH7+EvNzbNOwJCKJKK5aSObAshzSOwi+Ifks5qDTBm4i5ZGIKVhcupJ/3jwAvrxsnw2IoIg9h9wc2f6QMsmX33KXVfMj7pmES/xpTIuLBMtcMgkg0O3ZGa6KCKKEHPIq8u0aNA4oy+/Thvr2efqwNL1r+Zi23K5PNYBslEq5tceIiOXHyjecl5u+1hDrBuE5"
               );
  FUN_1400bc640(param_1,
                "2meql8YcUCplwyDNX0d3ckufwrloG7PJHzJNmTSrR0dQM83liuvWbbnvy9CfyVt/4WCAtpqs6CDpp1YOyjVXS38wU87BhqAgJwwS5BOLsj+4V2V8SiFWILSu6JN1bgkPKBhWkxIr0BPM7njnGM8xa5BgBoWowm8GuaJeoxxZCikwe96kMQim4hOLPqbQg/Jg5M83p8HZye5tbPR3UTpG76nm5tqdramGILQ0tz1sRqueDnUNIM+R9FfrRsVXwsDdGKj96z09blMAyrXVwfM2n4PHnedAdTxFnLmuRMRNH6YkirFZACi7kWZdw3BupKqmti0pi2IgAjDZspooijerfGV4xK7yyotsLLarmKh2R1K5cugL6jIUuk95DGvFCqBtaNv2pA04CoREDGPM"
               );
  FUN_1400bc640(param_1,
                "iL86am51/XsW0GE1TgtJn4YYKtUYe1qLNSXwrygjth8aTMug5KIpgPOsQnmiaQHsKmDU3An6d717eA2QyTE+y8C8JWrMQiG4gZIIbs0JpDhzeAiRGTd7ltHJVyEEdZTRlMiUHGs6wkbPEGqJZOsqh7zKOvi6PJ5TGUOVYjp4c2O0DtqHV6HWXGU2rKo0RZG8h9NFH13eswarZeOdchX2UYWY2RKIteu6S1bCkEnEoojXE7ovBZrX1AEwvBK7wIlaGjQ2UEMPjSAQItT0oeDu+QuiWdxVmtDLNttzzuIeIL+Iw2p5RrDSAcdLbmzLzTsfaEGS2XtuvcU6pQkq4JEsbTe0BxQsHTic1joySGdrQqSx7BfSUqCK+APx4Y6jOAfxiCMLZEmBNeJtdMNV"
               );
  FUN_1400bc640(param_1,
                "I0yDowLe31J3UyxG0zXX7EzRB2Gx+B+YiKORy5oFkOXb10NzqdylfJyEzn70/Gt+31yAwt6FEPlVM40Oyq922hvt87UFqWd2VJwkI42Ruz7vs9suzTsC3mN1a3wYaORoqKuIX8d8hJCO0sCKK/5Lpx1ezZXJ+Q6wh48orIUPExUEzLBGyusp2uwYpRO+Igxsx2HiVZLs2oc8dPcqtfpbRl7Q73dhESlZ2oXMNf4NSS2hTNNqlwZLJZ27hRiVfjTjqoJFN5ROgjThbxrBrXRcqnQ20vDtCR4LplkZtjNwxW+PDwoGiZJusn1joPVVbkHOzUg3bd9wX2NFUTGmXhihxtz4zhXJn9w1HsYpDF7BRThQXgocuROSdpa2NOnlXVN2saRjamDSGxdmnzsv"
               );
  FUN_1400bc640(param_1,
                "2KlEWGwLdwNbAtp04iNXUheRjZvI6zPKr9qIRszt3Nbrx0lIvvKhGhC+kia5vF49GqOmK5/I7EwrKyauAakMK58JutZj45ydJbizfbtaa6CcNxN+5yjVwIk7k1Ce4cLjN+uT2tfoMTD2kvPJN5ZcPdi4bcEPdhN/KzW11KJ9ybRXnDZq3HAkt1vRQdyvHuX+rAUdC3MCfZL5FCl2Z2zeWB1pLvjHPDCw1D2FWX6ykfNSc8TV53NgeIpnk9LoPgLlTiaw1qRPAd0Tnlxu0rNNBRgnTtTcoZVlFvcf1ljiNJADthmUkRoxxM2Zddfmy6iDiTdfddavfKm/uuhi0ggrmAOeOwTruVrklncWLYLz5l32Ae2oDpz9pcdXRj8yOjtkzpi3mjidmKvtt8TE"
               );
  FUN_1400bc640(param_1,
                "BUplwfL5Nno7QZV+d8qPVo6HHA9PUxo7HuUFhSYpgxXnuX3SgbMxwtxDaD1s7jyx1ko1igxkm24RLXPWMpIrfURwPS8PK6F6ipdxnUduUso7Aufa8xwMmSYebv7Ba1yedN6gvAaeVgTKKT2LhlE+leH7a8LFuDkurJg6vmWKEWsMMldWxmIKlPiLJ948hrlDranvCwB7CjzDkG9TqYFKhUY6xQylzcwIOjFYdozijTIzmSmFq2EgQteRbzuUGXAWdOKNadqv6bRQ8EKJw6LMta+2tjAqb1zp37D3Z/opojYUq2dXUvUmLRlWj9BVaHpmLIc3BKwUC6Z9C5JkuE83YOcCUUa3ud2uTXgg4N8YUvdunrbEeOPFOV04dYP/EpXSKQTvXwuYFr0qmxqt"
               );
  FUN_1400bc640(param_1,
                "No5U7iIju6IwBncqyZDq4/UidKNQyDV/G0Ns5ybS9zNO+SCmzOAK19fydGRSST1w2Rz/BqKg2JPK6aqedqVNkFmkI3dI3eesSQr33CJVdsEVREWsDSJrbHyu6td3G2I67EjXbF34zx5cZ68zr+9h2VkrXBO3shyEDLGYYrBXKZsXouKBn18XNV2CtK3Vn/C0Ld7E4rBWkoMp8EeW7PvJheixbXlxOrFYkHbZuWqx5jtMbKJsWx/g5K+HOTmR3WNshj6COuT9KbL4V90MqAIBKLMQ1/JxL6Q1qkNhdGeBZCbbb58kS2y8YKj4yIsSDaU8mW2K2MslupkTS5DBqob/uazs7LmyLe13ds7OiIq3wMCbjZpwd84uGK5EvE+pd/syROjlRapFp45tVjxr"
               );
  FUN_1400bc640(param_1,
                "NYxcMkyLoD2BADhiMUfCOv025BrWGHXFag+zH0NnM1nbipgSgOj63CSRjC5ol0TaPpjE8LDKMe48C3FYK9fFMvkuhguS2WzscNl651eZIsRJHPi3ZOup5s7OrIkSbquCb44PM24naMrBZT1g2mkkC3DDu/RxcBwNydUZax+BdUxIcDz3LvUqVmgUt+z2CWuOcb3w+WrHsYNxIrGx5dqobq0QoLmIFLwOcarOdkibN4UFii5vWPF6Nlf8JoWLLZm7vXHTPU9JIzFZhZDhbkNUDOmZpEcs+LpTl9wLQDeoMVdo5tlO3UPuBG2xaD6rS12sM3eW+6Z4kzTecc8p6oOeUQFxeNaMgFok2RD0wRe4jyAk1IVUsvlaYLuTsEiMOtxJm5ZTQ5/bxbaI9RAA"
               );
  FUN_1400bc640(param_1,
                "Si2rCr7irbf6VuqagfiNPCZ7UhBdx3E1ESaRZYyEoWQ6BH5bCLr2HcDtzOFLJ6jC6lhjQQNa2702OuAocNwQciAMR31PXeF4nWsqc+nB52HB4PLKhrH9GBqCX3HVtvIWoYYw+UFrfZ9XD0S1lbDDsV2b6iuG5p6FxJOjFDFUKugwUJiTWuKOAraLOyvBMYcsvkcjL7zontqQbKCEz0My01i7vFaW1ThnEHPna3rFhBZj7suOXwh64m4oreSprmJ01GFZBq3bhlCcGAOdg4gkHgurdjnRcwrARHK+YRWlKl3MTrr6TS2jES2YMfTmwAVOtKJDRvMrZCO8aOnM0wiPOIMVbkrmdnM6AI/Yqn5h9ESnWm5aBAxmReZNPLeCa8nh0TMxL0IhmC+z5BMs"
               );
  FUN_1400bc640(param_1,
                "PRtZJ90lhnH6sNq+KWaLx7d1Tfv7ebjSO+IBoCiV8ZusDP53rIdA0CXB4pwrB6QwxcwYZorXv6WgjYF8C5u92I1ZnCHRL4Bf2FsZUmGufOKw6knDdbOnQwYiuMliaQ62WZpbem6iKRBh5R5khX6Nw0NX9BPUMbCdSTU3yPuhjNkWEkTEDDXii5Vb823MM6ofJXel3SWiMd079SafkNtE+jNAIQAqo5lvFK7Qi0NGYJBFbWl2TLbWzeahT5W5VNLgtg3R9np4nkV0hqg2buVJB2+BBGDLYer2lhkBJmWnHbafHsaBUO/iD5uwSgVMK7Z1PDJngxmlvTlEYWE0mAlS8bOOErIyQwwROJu2mWlG3rU+/3kYKRYYhCpkN9qPFtAi40XykSzoTq7agane"
               );
  FUN_1400bc640(param_1,
                "nvM0VUPa4j5HkwLpJSBkFhJidivaXIIWS7ucoobwxrmLOtn9ONXcBqO/Msco9Vx8yhdx+bNemCtC9VUdpHR0Tp3en0Pd1aRlnq1EDU6vbZ4ynRhlvz4iK3pO9qdfX7jbrdyECoT59Y8LiWr+9JpDGUwX8oxrdg1LTY/g9HCzaY8PGM6YtwvL2e+UiudeC5yLo68n6gmELX2h74lXr8twjuLwmkHIGOxX+RMEsRK5kbdLKkhZdWYk7ary4SHCOucVKE0nMRegQAqXYed4V3PZKZvlGpLvEl11Wc24ErV81vp2eT46tc64s+T5xBOiIt1yp/rTh6Lpy50mUyAauYT0n3cAhLHheXg4yQ8jmX0Yg/l9mxgMh7t0eOhNGLups0V4xcWxnn5Y5Oe0dfLL"
               );
  FUN_1400bc640(param_1,
                "Bn98dI048ykCFe2vPv6M03VofDplpI8fjXeeXCO71fm3pb0HaZjHUC0winRh5DI69VspceULnCcC6ZzKCc28VpKwU3KyyZkv265hrSN08sp3hrTgOeGLclTXFvdJtsxutzmiPp7s7Hx5uCNCHp95olWYu/uQixXfxp7S7pSLL4o5hhfvozqwdeOMCBwG2L+x1iT54ABFiKw2Txe9m20XKRKfpPIx4G5zJg5lC2FSfwPs4yZYZELO8PeVwJPqCGAu3HGzJ7bpXChXWmaRfDmKvboyHU2jXLM1x2LFnI0sQNuhvZRzkOdKsTSzAEc/PsTtqtJdCthZgqlmls53L01bSQNzTJVkVM4Y7jmahlm8mserPu7mejY4/HozzzwKOxXWCm8TGvMd6SQ2E6iI"
               );
  FUN_1400bc640(param_1,
                "TjCLAePHCT0MeJAzqqZEobHCTE5dfSYxlfvN4cq7SWlG10usYDmS1t9RM/QYRxfUdIqDl3x3v1kJZGOmqdG2vuS3wy3Qo3X4xqQuhJmLadMRb096pNIJUanpfFTWC9zmuHzk+HKFEbjg9893uGRFDVQraao7Z9O2iSUeaq2lU1U+PJJLIToNNFgo8hSCZv40qrPeChnpLekiXgt+px/Jop52ZvdY0NEWkJzSYRJGr0xssfesrqx2hxE1iUBkVb7OsinBOTWDHV76Y8ovqQ/dYB5RNFg2dAjKjqZ5VOU+ZjKmCEFYrPryqSUTLTqwRRozglqYklJPKdBRFQw4f1aWt7yHufb/uid8+K/ZLjg36HWWvIHD9pZg9HlN48k0Ve/O3KNLTpETI8HuHHf6"
               );
  FUN_1400bc640(param_1,
                "mEZrQFnb2kqrUYx1YmYgEAC7owF56VB78lO3gFMOMYuexl+n9b5v6v6P5/+7nf6Z4H/z62ryu73Vyv1M1JpsSllIeWZaLtDVOz3n5uNb/U9yftex6jYApXiSDI3Q18JWMr4Y4TrTc4FAQAByUmyECAl+Kke0bd3+j9DylZX/D+tvuf+j9NrIvN/t2fp9nyfx6nVi/0NSoyGt/RbAKP8/jSU8n2WvuaR2F5HdUwU5aoiGv6qmOnd5kqMu39jEVQBlGCAQADsMABhCOA7go+RzRVj526+3NZTbLC4kDT/T/vGSMcufyJMYtTvNIKN/sjAyOfDmKv/v3N/SF3m4YH1aPiGyY7a4FKEIuhI+HU2KHyO7JcnmD036/iBwfcDKd74wwbKZhEkQiZpARMr8"
               );
  FUN_1400bc640(param_1,
                "9swBCLVR/0i/6O7sY1jHU1DXrkZPza/wyZHgT3hk/9OnO9KXPpBb3fz6p/amwkppflcMrYCkuim+VG7dPIlE0VnzgsaRSM8/JJmuMeL2kU9tVEAEA6EAA7EColUSDeWwKdr/3/3Q9bZR4WVD/UzDVYzzbfz/0Ued1SXn8udI/bU/+DvrDN6ZjVmvvMoRaprJqmFJObErW4cnW/n8k3D8Vr4UIP1EcWa++sA9aD1w/V+QcUn0uCdPj/O7WbMuS2x6Yd0vQ9jQ88nMOo+GiNDkM4CAUWMEpDAFsDAAFkYIQCcRjgMEA5f1URfSw1H+RxkRVqPbNAVHpzZTOHJnOKR8eh/j79RcN+u+6zi8i57Ar/E+TPVQ/pnX/iR9bnOedG8XRQmBA+ajsmq8qByj"
               );
  FUN_1400bc640(param_1,
                "ANxggEAnwYIAiRgwdtXap2/XFVyRAukL/uZCq3y2ZvryLAxZwaNtXSK3UHuSYzK+wvR8o7SlHDaIDjQ/40gbxinJK4HJT429AdJ4hAAJ4wQDDXsYPcTRn9u6jx2vKUN95xQGRTWE1uHlY4apvMvOXVdnybZ30pmwYjk828/qe18GguJ5Lv+pFsoMkSxCEABDMOb4CdlUQjkV4fZG/oRhgZ3Zn1U+zusqW72aWhNFchLrhh+s3xUPu04VTCA9eFVDnPYlXuZMtAF8a0FlZi8MmiqAhCEEgMBfcx3Or4hTfTrcJfWXLzqOIPn9sg96T3eDifrl3T4mdS7BxBmrnY3elwtfaZuXLJVlhl+InuAua4d/hzvdL+GQCABJe9m553PZ7PznmGy2ndqpj8xs"
               );
  FUN_1400bc640(param_1,
                "uW0eTmejnmj6WWZjOPbL2SqPXbqtLVJuRN9iJILNWCMAAL8YAgEDa2JNDA1/yqUBZ4IEjvsB1LDBIjLYh+RF4E/Vkv6gQgaa17qzXH/JrNMi4FtMtp3RRBCAQIhxZEMc2FyaYsEi2+3c/64YXVhhr5AxpuRqmzw6iGtQNXFPCxqN6AACAHYYBFPze/qZg9nunbdDcqq3bLOdb1DgfHe+hRE+fTOOd9wZJ6WmfSo+x4cJhs+a24DuK6naKAAAmStZOCe05I6pYLiSfwDxr6DZ+yslJG5mT5NNkPXbUJ3P7qTSJ7xOpMi9J56ZeU45YKlTvLpn9yOpIhCANGoUNvX249IJlzoftQK2m1jNohJ4+kn0HTLnGxVuyQGyRvVbRy/fG5KtoRe34P8xFq0j"
               );
  FUN_1400bc640(param_1,
                "CEAg4r1CgJbWbpxoo+l/sI+9++7Jk/i9jnclgxQPeZo5tpfACPoNXyxK5tg1IhoqNNHvyQ60XeeMaAgECUMA+tZrK3n3uR9P0+pVpXJ3qjmbXu0sZtWOPcqF0O4KhOmUfqJlHKUPVxGif4SLc3KsFjofy98elBfO+VWEipZjChDxSAQhA/d7BPO0j4o4aS3x9hc6Vsgncco8vnyIZ789z5MqR5IOjGx7hjm8YquMrMe2r3jRHfpoRVa06wvpB4v5Vlg2UE+RGQtQR0mLUdlIDvWD6fmAfw0EWUiGqe8xz/qusIAIQJKbJIT/teqhRoKD6yW0N6Sns/s59k5QsMwLBHA5nyrs5l8t2BUmT5DOBYL1VPSyMupehebTP4VVAWAxkFGapi67xwO/keQu"
               );
  FUN_1400bc640(param_1,
                "mqAIQg43/Ikii5Hd5xiZ7j4EGFLyp07pHY2x+ZIcH+jj9b0yVoB0YsAJWrZ2ZwmAtvxy/JF9l3g/t+rfiX5KnGeV8K71JfqGq0XlKtw0xwgo7cNeFFCWAABA6aHIMYifI/H8iS+crvycoP421oFb2GvRsCvqv+75YOjSVGn6QMmlpOrKsmhQg2bQ6Wxv0ijt0HnJAAQAXtesi8dhjefvcRzDVZqu4felBihjORF95r+RfI/dBgjT/EKljZ+LUhfGDsjZCAQgD4tdd/UbITfJrSFehZ+Li+WPa8n03V6qWeKHw8/861wfl2t+HwyiueCv6VhQfu01X9jTJq4kdhmtZn6pwCABISY7aXLTtkqYxs0uvjkZkWURqxk/mvMpovW0tJOxlSx9yhmsDo6Z"
               );
  FUN_1400bc640(param_1,
                "VrldeVA6nw1Zn7KOa7O/FSOWhO4WX542WuDNGTVSrMVYBAK2GAIEQvQnb8L+Z6DfLfkzDICcdTfpZp5WQ0PNiW2PAXvOGRteiBi60PXZt/IxY45/qyM5pSRM2cnGqe7iQgiEIAnBgCOJednOGp4W0uKF3QHpYppFo5verIUXDyRfO3MAzhvkoaKKv6WpK9hhXicqVkIQgALGj/pjvyHTGq20VnuEfc2eCqe5z+OjfyZUnUsus3UnSt5UlSmSXxYeALUE0QQABA/om/3r+NRHoe4naJpKpZkJB8A8HcTt50lRV5l/aT2YduxMziXM7sjdZPRVVEII6fJtBVCdMBAIQSsVZMPY3fg1thpsJRJh2l1ivPJFfrxflaQ+lYjO6q/KyB35mjtmjHU2cZFl"
               );
  FUN_1400bc640(param_1,
                "B2h/bbIF2QoEeCfNfzDwCEAHvfiJalLEPxYUIbV5MqTDuxnXH05t69KUDRRMftbiIbpHCVkaofMItiS9OFTUDk6vmZvIinymMAAEd7I4IAAwUrfcV5+eZmuYUtwfLbQz02mkcFNxoKXggsGye7F4lIU/SeiQnuUBJA1di8xYFqebRHqzvSoOqWzxJaAhCB5vvtqzvo+BDKEkimZaoqhKm0/L5bmvcdxDBp9A4pPklEZJtKZOmrRDP5ibjNn1QzRkGd0+AAEHLZfywPszxD2MT8+Fj+Dzr3VHVJrXyXSznKIaXnQrZI8R6F3SK5tJLk5bOeMRnw+nh2mlyfuyTdSEfzURogEARqs/ZlvPY89bqbTE19OSRHbSmL6ZowrxetmkENgvi/yUvs9bk5BT"
               );
  FUN_1400bc640(param_1,
                "owRk83XnVsu179mKXUMFwFwMhkXT9NCCVUxrog95hJyr2+xsW5re4w+P65/PLMejLjK6hqNlEIBAwUwxBLZXQ7vGTZqYymGqPZX3mKX3/qw42XPXvRmWPqvOjTLIZOEsxnmXPpwkWSxGi1EYNi6Lat47zdfKvApnxqNSVRpK/Sv1s3uGxbAQCBeV92+TUDSfohlwIyRPbhaGyWHJLfqMX8hMtotHO2Y2eFry66xKNZcdNHVHVuSddFLQEIA/OWknH2iCehT/ifZlWa4EQ6P0PjUyRTZ5VqN8r0kkCkbux9NvdMnLIpBUexDIcxm/JocuAcaWG/HYhxIsDTTxAAAqvUHothzAEb+0pUN2srS1DlIsutQTj3fffodkFfplSOA8tG9bCrKO6J0xNy7A"
               );
  FUN_1400bc640(param_1,
                "71yWbvUHJNbQxqW2tdxPEAACJi8GjeJ+bRuxFmpbjjJJ3BOiWuud4fm/7KZbhaXpEph/UZFnJG3epi4ZhIqCXg/tUIkcBAyDBCASGTZD8fpqHcD61k+3cptY6ZgU/NYWjrSPZbir1DhFWjZv98h/dDIUT9169l5nfV0QQgAFrAaSOHzk9F7tu/N5lmYsBtbem8yDHgfWNqmXv2ntoZ3e6/S4tXZ+JElfihSe2jCEBsMAAAP7lumIOZN2ZThXC7pssMUsqmt22IFizG8wYtSQt1k6V1Ry1mVYsUI/V3uKy+PywGoWY2gjgACDRSZyM+2c04lJwtXuonFJBzcLqzks5yeFf2Tln/QwnY3evMWsedvdiMCFv7AsJkNzRl+MNKFIyiNQlFeOV08iAQgB"
               );
  FUN_1400bc640(param_1,
                "z783lupTOd5ERO17Yr7QhdNLn68s8sahQr573vqZLLS2WBb2P+NZeZ5d3t4diM8eZqVFyowqSIQClekXEM8Uz2V4WPZ7Fw7equPDB2MCQJQEHxe1d3sJFZycHHnEg1ZA4rk+UDNcKyn9t4kP1Mo2pn4moamQo4IBAHW0vFMh8qbHKg5/zTlzm22vyll/pJbG1m2M+SuXJdT4IJnglGeOnYgABMqs+n2cNvsk+PWpkL3eCJd+m0d7SeCujeeZ1MrE7evUfjt3NDzCzIIUHbX9m0iEGyTl3sFSOACACY/8exmJGLsPdWgnm54ohi3dHpV22N7HiTFlySWGvmG3dxtTuWWb6nawV79WWHCzSQAQBTaaWQGa+lg+Y1el/Nau2BX9HgR5I6/L95Aqb3Aj"
               );
  FUN_1400bc640(param_1,
                "GdHfJ5qqA6rZj5R738DW6jw11aZWjc0aIBAHgeWw/QzV0Rj6KaPTQ66Q+c3Vytp+MCeuZPDj/DH7C/I73px1R/CTmLP4UfTRBCEAfgwjeKGqysGlpbdfr004/jw7A10mWwuffkDxaoOgDZxKD7VUHiaVy9lvEt9VIQwAABaWzRy34tyWI/Ju9E39X49fuBi+dvfVrk9sVi9PXN6Dpuofi8HogEIPHhHit9P4dbBgnaG6+t/hg+c10H6ekWyLmP68th8I3p6VRrU/P07qHMEtbJUB/MXqvNSBFAQCjSBMNvXa20bmXpajw2ahu2P9W3E5VJmOpUusWaJfWcNc1MrL0LVKlUCpPG14lVCUGgNyqDYr8qBQWuRkgS3PDer4wuJc6VQEApDlnPujPB8R"
               );
  FUN_1400bc640(param_1,
                "IxWhNMJQcWl/oGtTiwF/Jcc4P0UOWABf0frlS8vIuTkrBty+3Koqvhd3BzXG/0kvxWc3XjuWsP2FaxRQ+RCG9ohdErIgAQTgXddVN6DsUK/GeKerTF/L8pH797qmisrMTy8xyFGq2Kr+49BWqFcNYDtHj7UV+shYQF+m/hSVyJ4nt4GDArDlLuUB8IJ2StVI2/bZ51oAEINjW8byPt3hYD5t2RxaUCDUuXvyaFcnb0pKLzi9rSUrqoKp4p5Rk1Amqdf4tUFN1Fsf2SYlz0SSBFqdASVu7NFn+KT9RAAEBXba1kNvMTHTFbb+J8tjnla1vroXl3ymCDYabfhBlRewoh/1vTQ6Kp9NTAPB0ow4ilbssF49ODlOeGJyFoHq6jc/LChJF4e4iNP2KKYs"
               );
  FUN_1400bc640(param_1,
                "EYY5LghAIEZSgLic1fdZ7FpGJo2e+K0hWZ83HqBRGIgAQTAwvfdzii+3JbY6P9FE/U0ccyoQmcOurhu4P7DGG+oo2MobgIQZTieceaTOdjQa9W5DWkGnCY66nuih23vHKai9nfc2AQAIqe/WeD6bfsLvezqz10hQnR+4y39dd+rdM4GPvhTScWrm0XlpbD9P16enCPHou1yff8gBgGbXA90tIUHFTagaLK32J3i4U4ewEQKhb2kWt+llC9pKDux4Xl5jHqR4scz0zQbP/huPkQBCAOs4Y+ySxkzqxyEe9rx22vEyhI0kPSkjOSIbU1t2pldDYAAApsmHa37iRU7Pb4idVY9ngGhxxtb2JsLzp6b6L04A2acfzueeAAhf4YcvSorOkEVtbcaXZqoK"
               );
  FUN_1400bc640(param_1,
                "xoyz2QnFoAAAR7HXoxvSue3+ek5GO+fMKV2dTCmbkvABAHs47SISmy0byIQAAY1zMNeXzycfOHtO7vOiyyQjeFA5cG88lkGBFNLYp31mKWI7L9A2enlB0djCTKJjooYAIAnaF/wR7rE1V1BQ9Ep3u6gsnaqU296p74JF6581Q9jWw/rWcIGWrSuzFNm5amFtsiV6b4ewqqDZ4uz9W3P0FWMkQaYgCdaURAIShgv5MsfwoNLRhgyztE0O5hLSxWIAEYjADIdMK4pDQ5la4iLIn1hXlySUgIQdvFPXS3y1f2mEEyoq37nu6oMnD6SO75KAXzSSvXxuNItE9pL7DzkxtpdK5k0rp+phn0kQCEr/TtZ9WFNHFSNQ7TzVdSvxaA8u6BUQfxuRWYiR2p6P"
               );
  FUN_1400bc640(param_1,
                "U13p2AhAENR8Fbiuow376oZKLhkP+RMZgRW30+AoIC8QCAG7EadVihy4awZcFYkwAIAgpalS9Sq9dhhbFLPRnFrlIgEAfa8yNWgfkpLDBadlGQ6SBKPxzbvDRM0O/vc932k3fpuY7tKhS5l1HRtQAAQk3zUqyOqQ7TIaLmPDlVICc52mYX3F7B7+eHDRB6p7UIYQ8aCu+FgZXS4Y89a6LyaHkAl7bOjCABB5b7UWyYea4QcD0uz00ta4Nba1sM2xMA7/ClEHv5KP7PucCQgiBEeuGP7MW0pJLQ7zGVCmo9DZ00DMneXkT04wfuyEh3Ky2Miy+tfdKCTv3LKc4Xqy2AAAKt2OHpLQLyWZXPPjHMonwV4dZk4QL8IXXvygW2G5IVWCW91aoez4J8Pm"
               );
  FUN_1400bc640(param_1,
                "tHc5Xf9e3l4+dEl1Pio9dVsA0FTfoTEwNvuXZvW9yiIAAVaXwQ7Ab9N8zzhAtK+X1fmXvbeeLxXQVXU4Buydb6QkV3TdXGobm7RWrXWMf1nbpb8XdEEACMoiBXoejZiUo9qZB3J7MH0P2UoD9jczQ6MgAQgjMTw0rrvNrH+/m1p8K+IekS1PVuO+z+swEAAFVTR1f3Oz597+OPRaWQuk+b97w7dQh55+j+8PoKtyuvIThjUeQN3r9YttVWZx2hQVvZdzS0SlMpbjRAIURKreSe6bSa5/SIJNSJgEAgzd3LS5fFYlqcwk+kqvwPRn5bA7hT9fQLBGz4ei0L1yNjBuBAUEdYz5uDr25AL4UGywbePdX3wSn3p2ILXjuRNb15/lj13z5K36VxwSJLrL"
               );
  FUN_1400bc640(param_1,
                "BzSaK8IAAWYo/pe5DP2zVceZhcTkPyJygBAAMPTZrECywOVlv/u7lTSobd268lJ3k69CkL1B+I0J7ODYAAOUYITl3WPG4fuf7mt8vrtDRED4XWfp7Tj/n6AqP4sKGrKpoQIf45UD0JUP1IRO5hBE+VCA54AA7mBRTzZBBH86QRD5/9LAgdhIp5P62FUdHb4RH9KQPsdl+Fpf/c4g+h9X/N5P8vr/s8fPn+n9TvvoaoiH2xBrApxFGhJ1a3P605+049/gNz5l2edlxemah01CbAqOAAADoqyip/9lVyqUUWtPkwAAAbX/vSvHmcjB6dH8Wq4tcnYGkLfCGM24p32kex2rSC45zYciL8p0C/w6g7xKhcB1DBef2jvnJWP8bIm/eW3Q34Xu8B71tTjX"
               );
  FUN_1400bc640(param_1,
                "S6ENQ6yUZDBuItkAxXOaxXXAEAAko6N6bQfti5QS6lEy2kZ39IYSCAQAUMjs+my5Gu/FZEsA6l7T9yZm1KbD9RNZ78vcaxFZyWFZvX9dTEYOcHD72Wk8Wf6kV4m0YQhACQSH/lfSX68cv1HZ9Jv78fQQK5QuHFORgACBSOv725wtgHAju0x16aybfVCj4DWoWiPzS/SdUokNQEIArZTjxjVNTl477vii/T4ejm6prtu7y2IXn2lZSLo5kJK/yp5xjqxlVbyWTpNGelBjGoQhAJ+nz3H6qtJyh6c0XIvcjyMJeNQQl/vpP9ZE0w1wZaVymCnzaWB5S35NIz87BHQSiAXVFmyyHgPLdaO3ldZJOFhlyCdEv+5pRwnkiaqgAAgmNJkQGSHeEaSzFhI2"
               );
  FUN_1400bc640(param_1,
                "vZYRCAbXFoVqkHuPP3vRhNrfHhR4TTY+MnYLE/+3p9HQb20u9GbuIiDkKsj3oZ5IUbjSuLpjg8QIE3Wx0dAIhuXmLP+6RYARwMEIVUmKuluzDl44T73qRNIX8xZcod+dmq2so/e6qb4c04JTl7WGUYsknihfasFBgciKa30lwsFFV/3GrsG78ni0ywBCEE9OEN9coKfiILfkxCpQZ8k/7/DLupfEQLfIfC8SSi8zT3EYycQCEgr3ov/bYvdF4H/YVeai0SkQALMY/Truvfg14pV/ySgIQATWaiv2kf637q4v9IMRBlakgTXH0TTiHJLGAgAArO44KW1rTVK2K8nq5NceLmwXZegRKJeIBCsCRA3EkbI0zUvmLyO2bupRavIsM4pDfg2R39bSRTj7"
               );
  FUN_1400bc640(param_1,
                "BdS7sZN/NBw6PAcYhDAQADRNZZjrQ97g1Tz3sOkHgoyIoEAABtsMlFRZW2lISct/ivr3fZz5MknmsuEIQqFnrKtOb9Niqj91jSQ0ZFW5S9ouRtHBV1aJezWm/pw/tcCf7A8Y/XGGIWLhZXBg9s6ciY57I+fTTgW1c74HiJPD80p4z3GFC997ymZcYSqsIQggipTSh35ZfaMLpZc2RVIU6v4LDVTC4jG2GI/v+r+m/FY+5oE+MklMF6+v89CzWEMQAAdG5jnBEtuKELiMQhCPZmZ1FzMVSdZqXxo6FVPMP2dPV6C4QCEHe7hqqHN3RvEuXIkQyE8CgdnHDlwnAhEAAD2VxWdNoyAxIRy2WL865BOQ4J13Xk5byNkboBEgQRYCEftY8+mRCfvdPwEI"
               );
  FUN_1400bc640(param_1,
                "Aw0htsca1O/USV0cgS0uFztQ7kutdMdf8VMXPxUXjR81d9DEdgIQsy6BqvVkLHVHikwQWkff7P8OOdAkU+89LZ1x7COM0aq+ZigTbx9QzkFu2JBhjbpxdE+oOjyl3sNmLNRgeBgCEKsp3PDQFT/QZRIkWs6Xa230ydCWClMWyBe/8V2CfZEl/Gmky7LdT6UEyXVrz4aEAjwYIAFM0NvzaZyExldf01tFZYhvz5vYSOyyZ2B4Wv8HVYbAIAA9+uGPdZGS+xhyOe4u81e9xHKTzoSjJDP+UqcRNJxMbI+G0IGronghAJzVEcxKuuxNOJPI64285qcWM0Lmctl8EsytnjVLqJNgEAgKvYX/WCKhvOLLc3TV5wIdijXFyyqKaNOCuKlZNOpbO5nP+9Ud"
               );
  FUN_1400bc640(param_1,
                "EuRk9sGR7k2ihi6bUTXn25vxeM4O8Q/B9GKDAKOLeUriUCDVYNUAAFL+SdJzCjOkQouPzHHUiMIO7tLMh5zko836S737ZyVD2fgXfkYBcyCYPE6ywfrxjTWtKNrZqBk588dOMdLO30wAEIEd8TchlQ/1xNdYlIMt1VCQRTc0OCuZcvcQWSyzx/f+H3l+hRQrEpuZUT16bIvdde0TCYm7g9q6obHV9817yv6CuzNP3DD80n6m+8+SvOmFwQhAGvTdjRwMSlI0sqLS2EWkcycXKnz7kmg4OKziHmeHk23Rmykofwb3qR7qWN0N0gwqRoY6SpjDuRZKqF3WfQRC15R5cJEl6w5Aa8D0X039KShCEAB0BqUd45otMk/qOP69kOxH6UbfVoqVivR46WTC"
               );
  FUN_1400bc640(param_1,
                "DoVDn5+3EcSm9SOT4iburz59GeXojNWnqM9wLXm4DmAvva2n2dvUaqIBAHqn63frqx6h3lR98YmLFOWpjD1eZFjpBBgIrR6g6ee+vpy1R+DDYZpgVux66DiUzwfi/yUv0ffR0oA6QwBCE8Mj6xujIM1JdMY3BzzWvSYkKf1D4+nsHnyn0cvFJa7mV0KN9OLDQdloT9DOhbpZRxAIA53hnftlM3afzCph8z77Lib2f2yDD+R1e1kv1NLEqmNi2puizjkY6UZn8qD3+VuZMNDuFHE+/hxxoAApBt90LgKuETKNqe33n3yyZwd87JZV3+z++EOkUZMJ2febgAhB6exsu3gQBzyfPOP1PWqe7/CrA3SIrP80780w5mBhjF2h6ClohDv1raZAQMH5zfyG"
               );
  FUN_1400bc640(param_1,
                "tdR6PX9MlSB7y1Wz0oAEAbUzZRRAsPtqhexAbLJ49+wd9z3eVAfm+AP896Okb/fvF2JWlp8w7mJwI3fhmKo2bte+SUAhAFLw4xVHvedEXO99l556eSmKjS+yPbRbfLVGoxMyM6+bnC25G823wQGOZyPmzzMXf0ZCjCEAANvvKT04f7SnWbp9d9NKMhNUr5nw5TGqszJdr2cUtUmkdTMsYcAAgD3Ueqk9bqGlA//nr50NZ0/3YS0r1ah4gUjaRO6jPqJn4pePlRH8reFiIHYC+y1otNfXW9BwvWisZnxjN1lJVvoSHPR4qwdkFIQhCK3M4NsoZlTlDIcWrGHNxLO8C8OsihmpKP65J4bSwxFcuq6adb85C/w7ddywisX0IYhCEXZF5eE9tQzJjCYp"
               );
  FUN_1400bc640(param_1,
                "z1u5BFbKMYPXN5NPKDNUjt4qEXbmAHOI4KGPV35bjTEi6TotlhE355ekt/cy59b3Pzz5gfUBCEALx7nGekV6XunrDu5PymFBdKURjvKPduW8xXSoLSEsvHO7U8SVPR+PZKXGrWiJArC5STHzkWB8BCAP9CdZR78yVNl4svytDQJ3Xuufd0l2xo2PtkycUdYc8+xixeUfO5SUEjEQhUxJ+ACECiaDs9wTFzTR+iRE91R58qzwm53Cv2m/rYHf+HwIplj7r4542JdGGI21ygVFZtT2Ox5f5JlCZ3SlIEACCq4JB2nTgbWEXmemY1gkaEQspWuJwhpcvoz6QkMJkozxpHjagtcZDs4WQjXIS/5W2aPp47RpIi0lxxHABAGH+DtlJ+8oNc0WYmT0CP8f"
               );
  FUN_1400bc640(param_1,
                "5z86m5249h7rd7mtdLituocuDR04cHdL3TdDS5A0ykLzmjrBNC15kkBCEE6elx2cSJtLcG7h+fblYrDJrJZ0nJ8phlUlT9OgTmDZp9SBJUKMNN/eP19AzNqZTMjdr3TfVW/B45kaAhAHDudAsMf+49ErZWJ6PKsz2l3JrHLE0vbazUiU6DpTjPlH8rugqXxiq+xTIlDEIBAkGVF3SLhxsitJs8wuygepfOh21bCNGrezR+c8pMfwXgaofddiC+fqme/mrMm1GoYSSfs8t9i3Zu/KGFf+2onbz0xBQwEEW5q4AIAzGj1zUj35Y9QeoOV/e3/nAwEftjq4REzdK1D7wX/7LZzMqpF7fg6eNFmSwqmCqPuNTL9ZQwt02g3E4o/Xb87+wEKr8DX0SM6+"
               );
  FUN_1400bc640(param_1,
                "bVswNLGXPV1FwBCAOGfrFOTTLubiTj5uOR9FtE6OvlMKn9t4q7HXUaBEp0X5L4Z/aTh+tfJJ6qdKBJrGUK0YAEAufB2iFXIcjseROfdXBaanqImsy8NwTd8w2JYpjFvSS7H9WNQ6bTyducLiQBeMVvjtI+V3zLo6fehS84ABAE4O9nfTkJEHoKCovPXKRaf7Caza1fPV1YmkvOrNgdWGw0QF3tKiGUZvE8r9PekvarZ634XX1f2DLOyonCK4WxonAACDqoN01TmrbUPLUFrEukVj1EqPtF7dH6DJTmKT1uLpUM7IFmH65CcNGrY+meSTDn+GmTou/bF7m2yc74ZCVBPEIQAfPeJzu384ZLWaju6x5LJ3V5vhvHmLe5Stnsd0ODtEQXyFvQJ72ZSg"
               );
  FUN_1400bc640(param_1,
                "7/9+BZ0EdnPbu1nSXyd6gVKOHW3r3J4hCAU2r6bk3+6mJ482dX+6iLn9oNb9NfaQNk26EQyUMfmKdNQoLh8cVGztvHIGEk8shBxJQcddWiCkaIBAHahaAwmD1JXpM58RBzc4eRYpXWaMotZyalt78Xa1JHFyi3tTXbu2MoEg/R2F5GfV5/mfO2hGIQhIPKhvoyf2IpqNFIySjxyI2/yZKPZe7N7HXJfv5/J5c18qOMvTZPjdCGt70M6oEVa6K30a1HEAAL/h56fZLEh84hiRvidSDCvOcUdLPRgXiOrlO8UjYIcP+l6TXx8Upm/HO/4ZbK8/SsaTnyzBSNKSim8sYAIQAzv57pSZn4qu899LDK3t9mD2SUg+v3tyM7rqKEj05hhWR2xOyjq2XPEW"
               );
  FUN_1400bc640(param_1,
                "V2jZO9NQ0j2n27dD094ko1VtwtF671Q6qnMs1+ps9pe/MpqI64ACAC908nRm45F8w7xM6WPDJ9hv0Es1dkidC+OMPV2fJp2uSa9znmeDpsdDIJRlFbFkXSVwZVLTYqQ+jiAABJGAEFcQCWi2msn5x7p2urpENsmWy4cXagRO0RQ6y3BztvPSWT1L5sNpVCnkAQAIDIY4aHvX7T0qo9/xzkeUzGaEwQ7Ht6uAoTSeG3l9PcXMQ+YeDn2Qfkdv9HqNzk0m/h6lnjIogEIKotdPDw1LVH+vYZCPa4EvyRXsHjOS4fAOb11OzfFrS24bsfbg+jUIPellJ+NM37eTy4c++DqOPMGIknZ17CHcOUspSseBsLjI++Ht/iQ4VRwURkWWOzAiPiSIAEDD/DLI"
               );
  FUN_1400bc640(param_1,
                "7CDqp8lhraAP+JuovQTvv+7hpuOzeVytNZDWxhHjbFrE0r/UMnhMQPd5lqnybOuwinYxTYe81o/zlX2opD9qj4ypSAAARRbF//DXTN+cA2DOgHExVysQH2SPFyKsvV+iwEYFDVw3l8fX7nLAnqIhrqt94FppHeVy8jL+ncSgS67PSY/GXXtjt5tWXcP9dbV4OvCMVMvwP91XxANQEIQKlH4tPtVVsfEDBQK2T3IeZpuVPkOAt1osNyWeqf99ta7tEAznNmwcMaLq1LZF/7yDdHlq/+9twaFHA0XsFm/mvS/nY/v4GulD6q/QgM0+8uAIQBcuv6X1u+GPHk6fm9lWhUKlU9BXjuqtWiEso8FHVDGCIem8Qj4tNgKrzuZenDwifWcbrJ83xllOb1eS"
               );
  FUN_1400bc640(param_1,
                "7O1EAAQVJyofB6wPr3HP5Pi39VdQJqJgjYHxRulRyUv4ZBVlnvpv+h5l8o78x1yyw6wwp9aGIBCCgXi/idflrX9KomFpdumnq+qQXaNcP4zBLDxL5rlemNeKumOnfOvFjyo3WtLM+N5j4juZjdlUmtGSnhylIAAQYF4zv9xitPARdCsGKtzCGeOd1hBvE3DPfBWhP4G42oozlvyJ64yEjLaViNBAIAheS7JUtw6hhp/xKOGc+6XrY5pF/6i1dbMxE/50rkX9hBdknAdWLQv8qd2OocSfD+6npNnwGiEIV7pwxo3WUHxEmEoLPDxjfVyfqSq0OBc+2YeyJbErpSlpMQ0B/DG52G4y9D5LZamyyur+lxNGiEIQSr+eRqnDe95lCk6cvnz17NNcDwRn"
               );
  FUN_1400bc640(param_1,
                "a1U+Ki8csH6Q3pNeetZnyVg51XMhQ+rqoQgAQJC3VRvg/e4RsXwIKvmeKDDpX7qoSGwMiMuFZwwOdVxeyA5JhBSJhX/kQqnr4OF0gZMLPQbBfXFySIBAHO+Uqtl5mr3/GwutNKEkph9+6vX+osVfH+F5bvtm2FntN5itSrJHzNJQLQOp+9XqZ4oqrCN89die/x8NwVINAtPGipCAAEMQaivl26YQB0erS/4OcG/v3792eSTDR4hs2g0NYcuFjSJNjnDTyV6akpbzFrSPjHXxUUZv8nvb7BZNloAAgJfhBouiu3cWiH6IT77bXzFOt/RTJTCE1HA9Hq7HA9VGrTaoOVQ7dfXv948WRh99V9Dfi6k/KQJlWzieIBCBpsyH+/3UlpqbMYhk82/yubNu"
               );
  FUN_1400bc640(param_1,
                "p9Uo2zVBZ6B6UGz1srKU33hss6rPDjf7frw+CxWaJ62PWA/u37Wbt6cIQowYAhCAvRB/SZB5F7RbLLxzl1toRkqpU6u4cnCPZTj5ay+0mxP0hF3mT2p3HkLTLZKWYZYYafXsH9PFVkDpLtPMjRvr99vCGGv52m2qXjlfsKoYK565lDRx9zGK0bMocX5P79vl/DgrtfxNhH/w/1ZtpEGoUA/x0Kp/Cf4iEQV5AH9Fdzam+/8wxt1/xS655I71KtuevO8DV8Zcpb9DEMGk+wEKGdjV8KKpGPb5N8/hWr7XvrsNNh2n339pCmzC9tSM1qKZREIBEQwQAAWPT82Pj/bvKqJoAPqo6/QHLoOLqPu/ooDPSm3FUZSCjVm0xdFAv1O9zzFbwTLks4Wc5DZw"
               );
  FUN_1400bc640(param_1,
                "cebrL3WC12aYZj55F+NHkt8xUR+zNVbN0x7PwYX8mDVvn1t4Rn1RknYgTo3QjljAQGwwQCARTqw3D7djJpVZiYnlJyp/6lhxzLSyv6LdijffKHnQy01LvZtuuecYVp1CuRregyxPRUMPzeFA9vUTGUzQgjGQD78h96BN7XPYTAoVCTbTETqjJyVIg7IwAEIOzF8NGs7U1K7jA7qGre+Hv/pr4FVsJPhBYd1HwfifB1EmpJzrG1XeNdaIU7FoUSfnr1I5gvjNXYUwtnzFO8MB8isQAIAJrjoIvbUsHx+2pxmSQkowz2aWzotok80MjtP2VMDnfchKYb7NVoQciZe/tE9jvkb8EVprp68lZ6X3wWynmlAKYZ1BggEK+GCC9GCAAFHLsH7djz3jXBn3"
               );
  FUN_1400bc640(param_1,
                "w7nopW2B6y1vPsOs7CB/u4vdXL/K5b/qf5N2/BtAH/ZGgNGAaUeUpJsDdikoSf1dxu5LQhW6/uObR+fm77B4bNAv0BGMcNQGa10GNTzGB/B/Of2/7K/VtSbA/fplYMfR6lBX1xPF3AeiSwEb/QkpSMgNUQYcBiT8U08bEGKyyijuKIpt+lqd/Ac4flDaME/LND/wus63QZNkcpih9OX/rX4Nu8dYtYZEQfJufnxWhBmBVVcKH1i/lP8sB8rE8BGG1+3Ce+Ab06q0Y2qbfuNJQN1+bpfrV3sb4HXcxME0nKldXUwHn9pgVT/+LuSKcKEgHvHUzA=="
               );
  return;
}



longlong FUN_1400c27d0(void)

{
  char cVar1;
  ulonglong uVar2;
  char *pcVar3;
  undefined4 local_res10 [6];
  undefined8 uVar4;
  undefined1 local_20 [24];
  
  uVar4 = 0xfffffffffffffffe;
  if (DAT_140316ef0 == 0) {
    local_res10[0] = 0;
    FUN_1400f0d10();
    uVar2 = 0xffffffffffffffff;
    pcVar3 = PTR_DAT_1402f9300;
    do {
      if (uVar2 == 0) break;
      uVar2 = uVar2 - 1;
      cVar1 = *pcVar3;
      pcVar3 = pcVar3 + 1;
    } while (cVar1 != '\0');
    DAT_140316ef0 = FUN_1400f1860(PTR_DAT_1402f9300,~uVar2 - 1,local_res10,PTR_DAT_1402f9300,uVar4);
    FUN_1400f0d30(local_20);
  }
  return DAT_140316ef0;
}



undefined8 * FUN_1400c2840(undefined8 *param_1)

{
  *(undefined1 *)(param_1 + 1) = 0;
  *param_1 = EncodingConvert::vftable;
  *(undefined8 *)((longlong)param_1 + 0xc) = 0;
  *(undefined4 *)((longlong)param_1 + 0x14) = 0;
  *(undefined8 *)((longlong)param_1 + 0x7c) = 0;
  FUN_1400bcc20();
  return param_1;
}



void FUN_1400c2880(undefined8 *param_1)

{
  *param_1 = EncodingConvert::vftable;
  FUN_1400bceb0();
  return;
}



// WARNING: Removing unreachable block (ram,0x0001400c28f9)

void FUN_1400c28a0(undefined8 param_1,byte *param_2,int param_3,undefined8 param_4)

{
  char cVar1;
  byte bVar2;
  
  if ((param_3 != 0) && (param_2 != (byte *)0x0)) {
    do {
      bVar2 = *param_2 >> 4;
      if (bVar2 < 10) {
        cVar1 = bVar2 + 0x30;
      }
      else {
        cVar1 = bVar2 + 0x37;
      }
      FUN_1400b9550(param_4,cVar1);
      bVar2 = *param_2 & 0xf;
      if (bVar2 < 10) {
        cVar1 = bVar2 + 0x30;
      }
      else {
        cVar1 = bVar2 + 0x37;
      }
      FUN_1400b9550(param_4,cVar1);
      param_2 = param_2 + 1;
      param_3 = param_3 + -1;
    } while (param_3 != 0);
  }
  return;
}



void FUN_1400c2940(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  int iVar1;
  undefined4 uVar2;
  int iVar3;
  
  iVar1 = *(int *)(param_1 + 0xc);
  if (iVar1 == 7) {
    if (*(char *)(param_1 + 0x84) != '\0') {
      FUN_1400b9550(param_3,0xfd);
      FUN_1400b9550(param_3,0xef);
      FUN_1400b9550(param_3,2);
    }
    FUN_1400b97e0(param_3,param_2,2);
    return;
  }
  if ((iVar1 == 1) && (*(int *)(param_1 + 0x14) != 0)) {
    if (*(char *)(param_1 + 0x84) != '\0') {
      FUN_1400b9550(param_3,0xfd);
      FUN_1400b9550(param_3,0xef);
      FUN_1400b9550(param_3,*(undefined1 *)(param_1 + 0x14));
    }
    FUN_1400b97e0(param_3,param_1 + 0x18,*(undefined4 *)(param_1 + 0x14));
    return;
  }
  if (iVar1 == 2) {
    if (*(char *)(param_1 + 0x84) != '\0') {
      FUN_1400b9550(param_3,0xfd);
      FUN_1400b9550(param_3,0xef);
      FUN_1400b9550(param_3,6);
    }
    FUN_1400b9550(param_3,0x26);
    FUN_1400b9550(param_3,0x23);
    FUN_1400b9550(param_3,0x78);
    FUN_1400c28a0(param_1,param_2,2,param_3);
    FUN_1400b9550(param_3,0x3b);
    return;
  }
  if (iVar1 == 6) {
    iVar1 = *(int *)(param_1 + 0x80);
    iVar3 = iVar1;
    if (*(int *)(param_1 + 0x10) != 0) {
      iVar3 = *(int *)(param_1 + 0x10);
    }
    uVar2 = *(undefined4 *)(param_1 + 0x7c);
    *(undefined4 *)(param_1 + 0xc) = 0;
    FUN_1400cded0(param_1,0x4b0,iVar3,param_2,2,param_3);
    *(undefined4 *)(param_1 + 0x7c) = uVar2;
    *(int *)(param_1 + 0x80) = iVar1;
    *(undefined4 *)(param_1 + 0xc) = 6;
  }
  return;
}



ulonglong FUN_1400c2af0(longlong param_1,longlong param_2,int param_3,undefined8 param_4)

{
  int iVar1;
  undefined4 uVar2;
  int iVar3;
  uint uVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  
  if ((param_2 == 0) || (param_3 == 0)) {
    return 0;
  }
  uVar4 = FUN_14010c650(param_2,param_3);
  uVar6 = (ulonglong)uVar4;
  iVar1 = *(int *)(param_1 + 0xc);
  if (iVar1 == 7) {
    if (*(char *)(param_1 + 0x84) != '\0') {
      FUN_1400b9550(param_4,0xfd);
      FUN_1400b9550(param_4,0xef);
      FUN_1400b9550(param_4,uVar6 & 0xff);
    }
    FUN_1400b97e0(param_4,param_2,uVar6);
    return uVar6;
  }
  if ((iVar1 == 1) && (*(int *)(param_1 + 0x14) != 0)) {
    if (*(char *)(param_1 + 0x84) != '\0') {
      FUN_1400b9550(param_4,0xfd);
      FUN_1400b9550(param_4,0xef);
      FUN_1400b9550(param_4,*(undefined1 *)(param_1 + 0x14));
    }
    FUN_1400b97e0(param_4,param_1 + 0x18,*(undefined4 *)(param_1 + 0x14));
    return uVar6;
  }
  if (iVar1 != 2) {
    if ((iVar1 == 6) && (*(char *)(param_1 + 0x85) == '\0')) {
      iVar1 = *(int *)(param_1 + 0x80);
      iVar3 = iVar1;
      if (*(int *)(param_1 + 0x10) != 0) {
        iVar3 = *(int *)(param_1 + 0x10);
      }
      uVar2 = *(undefined4 *)(param_1 + 0x7c);
      *(undefined4 *)(param_1 + 0xc) = 0;
      FUN_1400cded0(param_1,0xfde9,iVar3,param_2,uVar4,param_4);
      *(undefined4 *)(param_1 + 0x7c) = uVar2;
      *(undefined4 *)(param_1 + 0xc) = 6;
      *(int *)(param_1 + 0x80) = iVar1;
    }
    return uVar6;
  }
  if (*(char *)(param_1 + 0x84) != '\0') {
    FUN_1400b9550(param_4,0xfd);
    FUN_1400b9550(param_4,0xef);
    FUN_1400b9550(param_4,uVar4 + 4);
  }
  FUN_1400b9550(param_4,0x26);
  FUN_1400b9550(param_4,0x23);
  FUN_1400b9550(param_4,0x78);
  uVar5 = uVar6;
  if (0 < (int)uVar4) {
    do {
      FUN_1400c28a0(param_1,param_2,1,param_4);
      param_2 = param_2 + 1;
      uVar5 = uVar5 - 1;
    } while (uVar5 != 0);
  }
  FUN_1400b9550(param_4,0x3b);
  return uVar6;
}



void FUN_1400c2cf0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  int iVar1;
  undefined4 uVar2;
  int iVar3;
  
  iVar1 = *(int *)(param_1 + 0xc);
  if (iVar1 == 7) {
    if (*(char *)(param_1 + 0x84) != '\0') {
      FUN_1400b9550(param_3,0xfd);
      FUN_1400b9550(param_3,0xef);
      FUN_1400b9550(param_3,1);
    }
    FUN_1400b97e0(param_3,param_2,1);
    return;
  }
  if (iVar1 == 8) {
    FUN_1400b97e0(param_3,param_2,1);
    FUN_1400b9550(param_3,0);
    return;
  }
  if ((iVar1 == 1) && (*(int *)(param_1 + 0x14) != 0)) {
    if (*(char *)(param_1 + 0x84) != '\0') {
      FUN_1400b9550(param_3,0xfd);
      FUN_1400b9550(param_3,0xef);
      FUN_1400b9550(param_3,*(undefined1 *)(param_1 + 0x14));
    }
    FUN_1400b97e0(param_3,param_1 + 0x18,*(undefined4 *)(param_1 + 0x14));
    return;
  }
  if (iVar1 == 2) {
    if (*(char *)(param_1 + 0x84) != '\0') {
      FUN_1400b9550(param_3,0xfd);
      FUN_1400b9550(param_3,0xef);
      FUN_1400b9550(param_3,5);
    }
    FUN_1400b9550(param_3,0x26);
    FUN_1400b9550(param_3,0x23);
    FUN_1400b9550(param_3,0x78);
    FUN_1400c28a0(param_1,param_2,1,param_3);
    FUN_1400b9550(param_3,0x3b);
    return;
  }
  if ((iVar1 == 6) && (*(char *)(param_1 + 0x85) == '\0')) {
    iVar1 = *(int *)(param_1 + 0x80);
    uVar2 = *(undefined4 *)(param_1 + 0x7c);
    iVar3 = iVar1;
    if (*(int *)(param_1 + 0x10) != 0) {
      iVar3 = *(int *)(param_1 + 0x10);
    }
    *(undefined4 *)(param_1 + 0xc) = 0;
    FUN_1400cded0(param_1,uVar2,iVar3,param_2,1,param_3);
    *(undefined4 *)(param_1 + 0x7c) = uVar2;
    *(int *)(param_1 + 0x80) = iVar1;
    *(undefined4 *)(param_1 + 0xc) = 6;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1
FUN_1400c2ed0(longlong param_1,longlong param_2,longlong param_3,uint param_4,undefined1 *param_5)

{
  byte bVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  int iVar5;
  int iVar6;
  undefined8 uVar7;
  undefined1 uVar8;
  char *pcVar9;
  uint uVar10;
  ulonglong uVar11;
  int iVar12;
  ulonglong uVar13;
  undefined1 auStack_2f8 [32];
  int *local_2d8;
  undefined1 *local_2d0;
  undefined1 local_2c8;
  char local_2c7;
  uint local_2c4;
  int local_2c0 [2];
  char *local_2b8;
  undefined4 local_2b0;
  undefined4 local_2ac;
  longlong local_2a8;
  longlong local_2a0;
  undefined1 local_298 [40];
  undefined8 local_270;
  undefined1 local_268 [16];
  byte local_258 [528];
  ulonglong local_48;
  
  local_270 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_2f8;
  uVar11 = 0;
  local_2c4 = param_4;
  local_2a8 = param_3;
  local_2a0 = param_2;
  FUN_1400bbe50(param_1 + 0x88,0x44);
  if (param_2 != 0) {
    if ((param_3 == 0) || (param_4 == 0)) {
      return 1;
    }
    if ((param_4 & 1) != 0) {
      local_2c4 = param_4 - 1;
      param_4 = local_2c4;
    }
    if (param_4 != 0) {
      local_2c7 = FUN_1401422b0(param_2);
      local_2c0[0] = 0;
      local_2c8 = 1;
      FUN_1400b8c40(local_298);
      uVar13 = 0;
      uVar8 = 1;
      if (param_4 != 0) {
        do {
          iVar12 = (int)uVar13;
          iVar6 = (int)uVar11;
          if ((((*(char *)(param_1 + 0x85) == '\0') || (param_4 < iVar12 + 3U)) ||
              (*(char *)(uVar13 + param_3) != -3)) ||
             (*(char *)((ulonglong)(iVar12 + 1) + param_3) != -0x11)) {
            if (((local_2c7 == '\0') || (*(char *)((ulonglong)(iVar12 + 1) + param_3) != '\0')) ||
               (0x7f < *(byte *)(uVar13 + param_3))) {
              pcVar9 = (char *)(uVar13 + param_3);
              local_2d8 = local_2c0;
              local_2b8 = pcVar9;
              FUN_14010d220(local_2a0,pcVar9,2,local_268);
              if (local_2c0[0] == 0) {
                if ((*pcVar9 == '\0') && (*(char *)((ulonglong)(iVar12 + 1) + param_3) == '\0')) {
                  local_258[uVar11] = 0;
                  uVar10 = iVar6 + 1;
                  uVar11 = (ulonglong)uVar10;
                  if (0x1ff < uVar10) {
                    FUN_1400b97e0(param_5,local_258,uVar10);
                    uVar11 = 0;
                  }
                }
                else {
                  iVar5 = *(int *)(param_1 + 0xc);
                  if (iVar5 != 0) {
                    if (*(char *)(param_1 + 0x85) == '\0') {
LAB_1400c32ad:
                      if (iVar6 != 0) {
                        FUN_1400b97e0(param_5,local_258,uVar11);
                        uVar11 = 0;
                      }
                      FUN_1400c2940(param_1,pcVar9,param_5);
                    }
                    else if (iVar5 == 1) {
                      if (*(int *)(param_1 + 0x14) != 0) {
                        if (iVar6 != 0) {
                          FUN_1400b97e0(param_5,local_258,uVar11);
                          uVar11 = 0;
                        }
                        FUN_1400b97e0(param_5,param_1 + 0x18,*(undefined4 *)(param_1 + 0x14));
                      }
                    }
                    else if (iVar5 == 7) {
                      if (iVar6 != 0) {
                        FUN_1400b97e0(param_5,local_258,uVar11);
                        uVar11 = 0;
                      }
                      uVar2 = *(undefined4 *)(param_1 + 0xc);
                      uVar3 = *(undefined4 *)(param_1 + 0x7c);
                      uVar4 = *(undefined4 *)(param_1 + 0x80);
                      *(undefined4 *)(param_1 + 0xc) = 0;
                      local_2d0 = param_5;
                      local_2d8 = (int *)CONCAT44(local_2d8._4_4_,2);
                      FUN_1400cd810(param_1,0x4b0,uVar3,local_2b8);
                      *(undefined4 *)(param_1 + 0xc) = uVar2;
                      *(undefined4 *)(param_1 + 0x7c) = uVar3;
                      *(undefined4 *)(param_1 + 0x80) = uVar4;
                      param_3 = local_2a8;
                    }
                    else {
                      if (iVar5 != 2) goto LAB_1400c32ad;
                      FUN_1400b8b30(local_298);
                      local_2ac = *(undefined4 *)(param_1 + 0xc);
                      local_2b0 = *(undefined4 *)(param_1 + 0x7c);
                      local_2b8 = (char *)CONCAT44(local_2b8._4_4_,*(undefined4 *)(param_1 + 0x80));
                      *(undefined4 *)(param_1 + 0xc) = 0;
                      local_2d0 = local_298;
                      local_2d8 = (int *)CONCAT44(local_2d8._4_4_,2);
                      FUN_1400cd810(param_1,0x4b0,local_2b0,pcVar9);
                      iVar5 = FUN_1400b8b80(local_298);
                      if (iVar5 != 0) {
                        if (iVar6 != 0) {
                          FUN_1400b97e0(param_5,local_258,uVar11);
                          uVar11 = 0;
                        }
                        iVar6 = FUN_1400b8b80(local_298);
                        FUN_1400b9550(param_5,0x26);
                        FUN_1400b9550(param_5,0x23);
                        FUN_1400b9550(param_5,0x78);
                        iVar5 = 0;
                        if (0 < iVar6) {
                          do {
                            uVar7 = FUN_1400b8ba0(local_298,iVar5);
                            FUN_1400c28a0(param_1,uVar7,1,param_5);
                            iVar5 = iVar5 + 1;
                          } while (iVar5 < iVar6);
                        }
                        FUN_1400b9550(param_5,0x3b);
                      }
                      *(undefined4 *)(param_1 + 0xc) = local_2ac;
                      *(undefined4 *)(param_1 + 0x7c) = local_2b0;
                      *(undefined4 *)(param_1 + 0x80) = local_2b8._0_4_;
                    }
                  }
                  local_2c8 = 0;
                  param_4 = local_2c4;
                }
              }
              else {
                if (iVar6 != 0) {
                  FUN_1400b97e0(param_5,local_258,uVar11);
                  uVar11 = 0;
                }
                FUN_1400b97e0(param_5,local_268,local_2c0[0]);
              }
            }
            else {
              local_258[uVar11] = *(byte *)(uVar13 + param_3);
              uVar10 = iVar6 + 1;
              uVar11 = (ulonglong)uVar10;
              if (0x1ff < uVar10) {
                FUN_1400b97e0(param_5,local_258,uVar10);
                uVar11 = 0;
              }
              local_2c0[0] = 1;
            }
            uVar13 = (ulonglong)(iVar12 + 2);
          }
          else {
            uVar13 = (ulonglong)(iVar12 + 2);
            bVar1 = *(byte *)(uVar13 + param_3);
            if (bVar1 < 6) {
              uVar13 = (ulonglong)(iVar12 + 3U);
              uVar10 = (uint)bVar1 + iVar12 + 3U;
              param_4 = local_2c4;
              if (uVar10 <= local_2c4) {
                if (iVar6 != 0) {
                  FUN_1400b97e0(param_5,local_258,uVar11);
                  uVar11 = 0;
                }
                FUN_1400b97e0(param_5,uVar13 + param_3,bVar1);
                uVar13 = (ulonglong)uVar10;
                param_4 = local_2c4;
              }
            }
          }
        } while ((uint)uVar13 < param_4);
        uVar8 = local_2c8;
        if ((int)uVar11 != 0) {
          FUN_1400b97e0(param_5,local_258,uVar11);
          uVar8 = local_2c8;
        }
      }
      FUN_1400b92d0(local_298);
      return uVar8;
    }
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 FUN_1400c3370(longlong param_1,ushort *param_2,uint param_3,undefined8 param_4)

{
  byte bVar1;
  ushort uVar2;
  char cVar3;
  int iVar4;
  uint uVar5;
  uint uVar6;
  ushort *puVar7;
  longlong lVar8;
  longlong lVar9;
  undefined1 uVar10;
  undefined1 auStack_288 [32];
  undefined1 local_268;
  undefined1 local_264;
  undefined1 uStack_263;
  undefined1 local_258 [528];
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_288;
  FUN_1400bbe50(param_1 + 0x88,0x42);
  cVar3 = FUN_140102de0();
  if ((param_2 == (ushort *)0x0) || (param_3 == 0)) {
    uVar10 = 1;
  }
  else {
    uVar10 = 1;
    uVar6 = 0;
    local_268 = 1;
    if ((param_3 & 1) != 0) {
      param_3 = param_3 - 1;
      if (param_3 == 0) {
        return 0;
      }
      uVar10 = 0;
      local_268 = 0;
    }
    lVar8 = 0;
    if (param_3 != 0) {
      do {
        puVar7 = param_2;
        if (cVar3 != '\0') {
          local_264 = *(undefined1 *)((longlong)param_2 + 1);
          uStack_263 = (char)*param_2;
          puVar7 = (ushort *)&local_264;
        }
        uVar2 = *puVar7;
        lVar9 = lVar8;
        if (uVar2 == 0) {
LAB_1400c355c:
          puVar7 = param_2 + 1;
          uVar5 = param_3 - 2;
        }
        else {
          if (((*(char *)(param_1 + 0x85) == '\0') || (param_3 < 4)) || (uVar2 != 0xfdef)) {
            if (uVar2 < 0x80) {
              uVar6 = uVar6 + 1;
              lVar9 = lVar8 + 1;
              local_258[lVar8] = (char)*puVar7;
              if (0x1ff < uVar6) {
                FUN_1400b97e0(param_4,local_258,uVar6);
                uVar6 = 0;
                lVar9 = 0;
              }
            }
            else {
              if (uVar6 != 0) {
                FUN_1400b97e0(param_4,local_258,uVar6);
                uVar6 = 0;
                lVar9 = 0;
              }
              iVar4 = FUN_1400b9660(param_4,*puVar7);
              if ((iVar4 == -1) && (*(int *)(param_1 + 0xc) != 0)) {
                if (uVar6 != 0) {
                  FUN_1400b97e0(param_4,local_258,uVar6);
                  uVar6 = 0;
                  lVar9 = 0;
                }
                FUN_1400c2940(param_1,param_2,param_4);
              }
            }
            goto LAB_1400c355c;
          }
          bVar1 = (byte)param_2[1];
          puVar7 = param_2 + 1;
          uVar5 = param_3 - 2;
          if (bVar1 < 6) {
            uVar5 = param_3 - 3;
            puVar7 = (ushort *)((longlong)param_2 + 3);
            if (bVar1 <= uVar5) {
              if (uVar6 != 0) {
                FUN_1400b97e0(param_4,local_258,uVar6);
                uVar6 = 0;
                lVar8 = 0;
              }
              FUN_1400b97e0(param_4,puVar7,(uint)bVar1);
              puVar7 = (ushort *)((longlong)puVar7 + (ulonglong)bVar1);
              lVar9 = lVar8;
              uVar5 = uVar5 - bVar1;
            }
          }
        }
        param_3 = uVar5;
        uVar10 = local_268;
        param_2 = puVar7;
        lVar8 = lVar9;
      } while (param_3 != 0);
      if (uVar6 != 0) {
        FUN_1400b97e0(param_4,local_258,uVar6);
      }
    }
  }
  return uVar10;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400c35b0(longlong param_1,byte *param_2,int param_3,undefined8 param_4)

{
  char cVar1;
  char cVar2;
  byte bVar3;
  int iVar4;
  int iVar5;
  uint uVar6;
  ulonglong uVar7;
  undefined1 auStack_288 [32];
  byte local_268;
  byte local_267;
  byte local_258 [528];
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_288;
  uVar7 = 0;
  FUN_1400bbe50(param_1 + 0x88,0x45);
  if ((param_2 != (byte *)0x0) && (param_3 != 0)) {
    cVar1 = FUN_140102de0();
    if (param_3 != 0) {
      do {
        iVar5 = (int)uVar7;
        if (*param_2 < 0x80) {
          local_258[uVar7] = *param_2;
          local_258[iVar5 + 1] = 0;
          uVar6 = iVar5 + 2;
          uVar7 = (ulonglong)uVar6;
          if (0x1ff < uVar6) {
            FUN_1400b97e0(param_4,local_258,uVar6);
            uVar7 = 0;
          }
          param_2 = param_2 + 1;
          param_3 = param_3 + -1;
        }
        else {
          iVar4 = FUN_14010d370(param_2,param_3,&local_268);
          if (iVar4 < 0) {
            if ((iVar4 == -1) || (iVar4 == -2)) {
              if (*(int *)(param_1 + 0xc) != 0) {
                cVar2 = FUN_1400bec30();
                if (cVar2 != '\0') {
                  if (iVar5 != 0) {
                    FUN_1400b97e0(param_4,local_258,uVar7);
                    uVar7 = 0;
                  }
                  iVar4 = FUN_1400c2af0(param_1,param_2,param_3,param_4);
                  goto LAB_1400c3736;
                }
                if (iVar5 != 0) {
                  FUN_1400b97e0(param_4,local_258,uVar7);
                  uVar7 = 0;
                }
                FUN_1400c2cf0(param_1,param_2,param_4);
              }
              iVar4 = 1;
            }
            else {
              iVar4 = -2 - iVar4;
            }
          }
          else {
            if (cVar1 == '\0') {
              local_258[uVar7] = local_268;
              bVar3 = local_267;
            }
            else {
              local_258[uVar7] = local_267;
              bVar3 = local_268;
            }
            local_258[iVar5 + 1] = bVar3;
            uVar6 = iVar5 + 2;
            uVar7 = (ulonglong)uVar6;
            if (0x1ff < uVar6) {
              FUN_1400b97e0(param_4,local_258,uVar6);
              uVar7 = 0;
            }
          }
LAB_1400c3736:
          param_2 = param_2 + iVar4;
          param_3 = param_3 - iVar4;
        }
      } while (param_3 != 0);
      if ((int)uVar7 != 0) {
        FUN_1400b97e0(param_4,local_258,uVar7);
      }
    }
  }
  return 1;
}



void FUN_1400c3790(undefined8 param_1,char *param_2,undefined8 param_3,char param_4)

{
  ushort *puVar1;
  char cVar2;
  char cVar3;
  ushort uVar4;
  char cVar5;
  undefined2 *puVar6;
  undefined2 *puVar7;
  ushort *puVar8;
  short sVar9;
  undefined8 uVar10;
  undefined2 local_res10;
  undefined4 uVar11;
  undefined2 local_48;
  undefined2 local_44;
  undefined2 local_40;
  undefined1 local_3c;
  undefined1 local_3b;
  undefined2 local_38;
  
  cVar3 = FUN_140102de0();
  sVar9 = 0;
  cVar5 = '\0';
  local_48 = 0;
  cVar2 = *param_2;
  while (cVar2 != '\0') {
    if (cVar3 == '\0') {
      local_44 = CONCAT11(param_2[2],param_2[1]);
    }
    else {
      local_44 = CONCAT11(param_2[1],param_2[2]);
    }
    cVar5 = cVar2 + cVar5;
    local_48 = local_44 + local_48;
    uVar4 = (ushort)local_res10 >> 8;
    local_res10 = CONCAT11((char)uVar4,cVar5);
    local_40._1_1_ = (undefined1)((ushort)local_48 >> 8);
    if (param_4 == '\0') {
      uVar11 = 2;
      uVar10 = 1;
      puVar6 = &local_res10;
      if (cVar3 == '\0') {
        puVar7 = &local_40;
      }
      else {
        puVar7 = &local_38;
        local_38 = CONCAT11((char)local_48,local_40._1_1_);
      }
    }
    else {
      uVar11 = 1;
      puVar7 = &local_res10;
      uVar10 = 2;
      if (cVar3 == '\0') {
        puVar6 = &local_40;
      }
      else {
        puVar6 = (undefined2 *)&local_3c;
        local_3c = local_40._1_1_;
        local_3b = (char)local_48;
      }
    }
    local_40 = local_48;
    FUN_14010ce00(param_3,puVar6,uVar10,puVar7,uVar11);
    cVar2 = param_2[3];
    param_2 = param_2 + 3;
  }
  puVar8 = (ushort *)(param_2 + 1);
  if (cVar3 == '\0') {
    local_48 = 0;
    uVar4 = *puVar8;
    local_40 = sVar9;
    while (uVar4 != 0) {
      local_40 = local_40 + puVar8[1];
      sVar9 = local_48 + uVar4;
      local_48._1_1_ = (undefined1)((ushort)sVar9 >> 8);
      local_res10 = CONCAT11((char)sVar9,local_48._1_1_);
      if (param_4 == '\0') {
        puVar6 = &local_40;
        puVar7 = &local_res10;
      }
      else {
        puVar6 = &local_res10;
        puVar7 = &local_40;
      }
      local_48 = sVar9;
      FUN_14010ce00(param_3,puVar7,2,puVar6,2);
      puVar1 = puVar8 + 2;
      puVar8 = puVar8 + 2;
      uVar4 = *puVar1;
    }
  }
  else {
    local_48 = 0;
    uVar4 = *puVar8 << 8 | *puVar8 >> 8;
    while (uVar4 != 0) {
      local_48 = local_48 + uVar4;
      sVar9 = sVar9 + (puVar8[1] << 8 | puVar8[1] >> 8);
      local_38._1_1_ = (undefined1)((ushort)sVar9 >> 8);
      local_res10 = CONCAT11((char)sVar9,local_38._1_1_);
      if (param_4 == '\0') {
        puVar6 = &local_res10;
        puVar7 = &local_48;
      }
      else {
        puVar6 = &local_48;
        puVar7 = &local_res10;
      }
      local_38 = sVar9;
      FUN_14010ce00(param_3,puVar7,2,puVar6,2);
      puVar1 = puVar8 + 2;
      puVar8 = puVar8 + 2;
      uVar4 = *puVar1 << 8 | *puVar1 >> 8;
    }
  }
  return;
}



void FUN_1400c39a0(undefined8 param_1,short *param_2,undefined8 param_3)

{
  short sVar1;
  char cVar2;
  char cVar3;
  short *psVar4;
  short *psVar5;
  undefined1 *puVar6;
  char local_res10 [8];
  
  sVar1 = *param_2;
  while (sVar1 != 0) {
    FUN_14010cc50(param_3,param_2,2);
    param_2 = param_2 + 1;
    sVar1 = *param_2;
  }
  psVar5 = param_2 + 1;
  cVar3 = (char)param_2[1];
  cVar2 = local_res10[0];
  while (local_res10[0] = cVar3, local_res10[0] != '\0') {
    puVar6 = (undefined1 *)((longlong)psVar5 + 1);
    FUN_14010cc50(param_3,(undefined1 *)((longlong)psVar5 + 1),2);
    psVar5 = (short *)((longlong)psVar5 + 3);
    FUN_14010ce00(param_3,puVar6,2,local_res10,1);
    cVar2 = local_res10[0];
    cVar3 = *(char *)psVar5;
  }
  psVar4 = (short *)((longlong)psVar5 + 1);
  if (*(short *)((longlong)psVar5 + 1) != 0) {
    puVar6 = (undefined1 *)((longlong)psVar5 + 3);
    local_res10[0] = cVar2;
    do {
      FUN_14010cc50(param_3,puVar6,2);
      FUN_14010ce00(param_3,puVar6,2,psVar4,2);
      psVar4 = psVar4 + 2;
      puVar6 = puVar6 + 4;
    } while (*psVar4 != 0);
  }
  return;
}



void FUN_1400c3a90(undefined8 param_1,char *param_2,undefined8 param_3,char param_4)

{
  char cVar1;
  undefined4 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  ulonglong uVar5;
  char *pcVar6;
  int local_res10 [2];
  undefined1 local_b8 [16];
  undefined1 local_a8 [40];
  undefined1 local_80 [40];
  undefined8 local_58;
  undefined1 local_50 [40];
  
  local_58 = 0xfffffffffffffffe;
  cVar1 = *param_2;
  FUN_1400f0d10(local_b8);
  FUN_1400b8c40();
  uVar5 = 0xffffffffffffffff;
  pcVar6 = param_2;
  do {
    pcVar6 = pcVar6 + 1;
    if (uVar5 == 0) break;
    uVar5 = uVar5 - 1;
  } while (*pcVar6 != '\0');
  lVar3 = FUN_1400f1860(param_2 + 1,~uVar5 - 1,local_res10);
  if (lVar3 == 0) {
    FUN_1400b92d0(local_a8);
  }
  else if (local_res10[0] == 0) {
    FUN_1400b92d0(local_a8);
  }
  else {
    FUN_1400ba310(local_a8,lVar3);
    FUN_1400b8c40(local_80);
    if (cVar1 == 'x') {
      uVar2 = FUN_1400b8b80(local_a8);
      uVar4 = FUN_1400b8b90(local_a8);
      FUN_1400b97e0(local_80,uVar4,uVar2);
    }
    else {
      FUN_1400f36a0(local_50);
      FUN_1400f3580(local_50,local_a8,local_80);
      FUN_1400f36c0(local_50);
    }
    pcVar6 = (char *)FUN_1400b8b90(local_80);
    if (pcVar6 == (char *)0x0) {
      FUN_1400b92d0(local_80);
      FUN_1400b92d0(local_a8);
    }
    else {
      FUN_14010cb40(param_3,*pcVar6 == 'a');
      if (pcVar6[1] == 'd') {
        if (param_4 != '\0') {
          FUN_1400c39a0(param_1,pcVar6 + 2,param_3);
        }
      }
      else {
        FUN_1400c3790(param_1,pcVar6 + 2,param_3,param_4);
      }
      FUN_1400b92d0(local_80);
      FUN_1400b92d0(local_a8);
    }
  }
  FUN_1400f0d30(local_b8);
  return;
}



void FUN_1400c3c50(undefined8 param_1,int param_2)

{
  void *pvVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined1 local_40 [56];
  
  uVar3 = 0xfffffffffffffffe;
  if (param_2 == 0x6faf) {
    if (DAT_140316860 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs3YBAABCWmgzMUFZJlNZweap4gAAs+vR9jNlogSACAAgABMAAAJAAAIBwBEgAHQaCTQGhpkAeUGFQDQGg0AJI8TEEkTpUOtu9QshrPK1gRQEUCSR5FtMmJnEEACrvOsA16MYsoykMDaVF8R3hFmX50ID8XckU4UJDB5qniA="
                    ,lVar2,1,uVar3);
      DAT_140316860 = lVar2;
    }
  }
  else if (param_2 == 0x6fb0) {
    if (DAT_140316870 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZPOmhpQAAs3ff/uhiA0IAACAAAiAAAgAgAAADKAFJCIAwOImMYCAAlUMSU2ppkBkwmgAyPEgkSJNADQ0DI0AAZHXJCVJRhakyltwMiIIIL7JFETnCc4kxBUIFlNu0OA00s96bbSwOpEgnC79DBqzbiMftd79ysZlYiSG84hFlQldbMSrF75/PtXikVyatWVrjDKPrlMAZKMmJAzQjCTiBmiB3RP8XckU4UJA86aGl"
                    ,lVar2,1,uVar3);
      DAT_140316870 = lVar2;
    }
  }
  else if (param_2 == 0x6fb1) {
    if (DAT_140316880 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs3ABAABCWmgzMUFZJlNZ35TQFgAAr/Pf+idgEliAAAYgAAIAIAAABDgAABAIAIgICEAgAHUJRNQaNA0DQADaKU0AANNNNHinF40QLBMDAjjYo0RMJHBsInrabGWtz2IrC2xkgqICG8vMI9uJZg9WRVqAQJZAohdgtpQMU1euldQbHZpL9frS1b0RGj+LuSKcKEhvymgLAA=="
                    ,lVar2,1,uVar3);
      DAT_140316880 = lVar2;
    }
  }
  else if (param_2 == 0x6fb2) {
    if (DAT_140316890 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZywUMgQAAtnXf/7BYmmAAAGAgAAIAIAAAAKoQJAUgSSBUCSAgAJVDFBCZNNDRoGTEaabIEiRIekABpoAaAGZ2SQKuqKDEQ02J32RglBSZInMTabibUhocRQk+Rr0GpzGToUoHciCT3RFtTkeOVf7s+wVGKG1iQJW1gcZIMoc9PnR4vBdUrpBb6+S4BCEMfdUf+U2iIGaIigTbqyGkWgjVAjYXckU4UJDLBQyB"
                    ,lVar2,1,uVar3);
      DAT_140316890 = lVar2;
    }
  }
  else if (param_2 == 0x6fb3) {
    if (DAT_1403168a0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZRDhECwAAvufI+YAABAACBAIgEEIAIABAAAQAIABUMkNBpkyCJTUPUGgdRqhA8ioYiCSBUu8Ki0IhcAkKULS7tWRPpXFIPi7kinChIIhwiBY="
                    ,lVar2,1,uVar3);
      DAT_1403168a0 = lVar2;
    }
  }
  else if (param_2 == 0x6fb4) {
    if (DAT_1403168b0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs/4AAABCWmgzMUFZJlNZedOt5QAAfGPA9yCAEAAQoAACACABAACgAFRTCYTAESU09JoBxPNhxBcxQb1RV1qCIUIhcwQ6zVgv4vPXWFzRdyRThQkHnTreUA=="
                    ,lVar2,1,uVar3);
      DAT_1403168b0 = lVar2;
    }
  }
  else if (param_2 == 0x6fb5) {
    if (DAT_1403168c0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs3kBAABCWmgzMUFZJlNZ9+fP1wAAuOXp/BAABACAIAACACAACAAgAgACEAAgAFCmAAmgk1TKZI09NSmVUh9ZIYQCWqZaGSkPGmabTDptIQmJCEwRJtro41Mid689vf73N8efxdyRThQkPfnz9cA="
                    ,lVar2,1,uVar3);
      DAT_1403168c0 = lVar2;
    }
  }
  else if (param_2 == 0x6fb6) {
    if (DAT_1403168d0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUsxkBAABCWmgzMUFZJlNZwiyJoQAAiPHzfEBAMEUAIAACACAAAgAgAAAgIAQgAFQ1NGgA9RkESo0GmmmgYjjMFpFCRQkFrbStARMhrEELSsEA80XJKjxZ1dB8XckU4UJDCLImhA=="
                    ,lVar2,1,uVar3);
      DAT_1403168d0 = lVar2;
    }
  }
  else if (param_2 == 0x6fb7) {
    if (DAT_1403168e0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZbRNAJAAAvvXDeAAgAMACAAIgAAIAMAAgACACIABUNQ0xDR5QRKmanpAFTrAq1BKICmru87wUXTgEWyGS4XC1ksEpgPi7kinChINomgEg"
                    ,lVar2,1,uVar3);
      DAT_1403168e0 = lVar2;
    }
  }
  else if (param_2 == 0x6fb8) {
    if (DAT_1403168f0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZxttNZAAAuPX//7BIvUAAACAgAAIAQAAAgAAgCOGwAAABACCwACAAlAkknpQ09T1ANGgeoPFBppTIZAAAABUb4AgRkhVATCFCoiAkoQoIDnrArXMYCHtwhPZFKLKEcXg8mQgJsBWvl0spVwzzAxbANYAE0FYIJorRpd4o/Wv2fIv7o5f5SziV2SuyRat/DpL+LuSKcKEhjbaayA=="
                    ,lVar2,1,uVar3);
      DAT_1403168f0 = lVar2;
    }
  }
  else if (param_2 == 0x6fb9) {
    if (DAT_140316900 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs20BAABCWmgzMUFZJlNZI797KgAAtUHAYgIgAAIAQAAgAFRDACFJoUyjkA+kAOSIsC7IKbd3M7cLuSKcKEgR372VAA=="
                    ,lVar2,1,uVar3);
      DAT_140316900 = lVar2;
    }
  }
  else if (param_2 == 0x6fbb) {
    if (DAT_140316910 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZsS8ACgAAsn3v/7BAEUAQBAAEACAAAgBAAAAIAwAhADlbvx4IACAAlAxUzUmgAA0DTR6RsjUGnqkjTNEMQwQDEMmjA3ByTNACGECEgSh2OgAT0NERAnuULw+pNS6kMns9wah1LwMyDIkh6oRAI1IHFSunbRfDfC31ozhAJEFIDWQQeIIQI2V9Gj+u91eYRtf3rlKLWVRdJ08JzvGQCaAJxwnZNgCf4u5IpwoSFiXgAUA="
                    ,lVar2,1,uVar3);
      DAT_140316910 = lVar2;
    }
  }
  else if (param_2 == 0x6fbd) {
    if (DAT_140316920 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZXIPusQAAvvPJ9gIBgIABCAAgAAIAQAAAAgAkAQAgAFQkoaAA0EmqnpD1ABbigk6YBM0CKpOLqhbTVm6ASYSzCBKSICjAf0dbd2915B8XckU4UJBcg+6x"
                    ,lVar2,1,uVar3);
      DAT_140316920 = lVar2;
    }
  }
  else if (param_2 == 0x4e2) {
    if (DAT_140316930 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs3YBAABCWmgzMUFZJlNZV12RcgAAq3////tkI0AAAQQEIAACIAATAAAAhABAAAgAEQjAsDqAQFAwALIGRKNqABiDRo9NRo0NPTKDCgkZAAA0AAADGQyGg0GjQBoAGhlaMYiIMw6EBBEUSUHBlBNMMMVIwCG2TEosipQRVpitCCplkgBO45zTGG4yRSgQfiJxIKUXy9X+lbarrxfhRXMLDamtGBCBtVWByrOAC+1jSRvQm7u0Ajl9QjDRGf80mXipgcIVMFyRslRDPMCeCGElIARBSgpjFhhJQAf4u5IpwoSCuuyLkA=="
                    ,lVar2,1,uVar3);
      DAT_140316930 = lVar2;
    }
  }
  else if (param_2 == 0x4e3) {
    if (DAT_140316940 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4IBAABCWmgzMUFZJlNZSVbfhQAAsv3b/zXsCAAgIIABACAQEgAQAEAAACAAQVCDThKgAIAlNJNCAAGmmRoM01DDQyZAyMQYmTQ0xoTODM0ERQ4khO4O7toRaoIOWp2LFWq1YipQQCQVIAC5X4RIfVaic84RvjDKT1W53UF2+nj5jbu4HUYYMHD0sfeFIx81zVioZq3lBmksU01g8p5TpmmGP4u5IpwoSCSrb8KA"
                    ,lVar2,1,uVar3);
      DAT_140316940 = lVar2;
    }
  }
  else if (param_2 == 0x4e4) {
    if (DAT_140316950 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs3YBAABCWmgzMUFZJlNZweap4gAAs+vR9jNlogSACAAgABMAAAJAAAIBwBEgAHQaCTQGhpkAeUGFQDQGg0AJI8TEEkTpUOtu9QshrPK1gRQEUCSR5FtMmJnEEACrvOsA16MYsoykMDaVF8R3hFmX50ID8XckU4UJDB5qniA="
                    ,lVar2,1,uVar3);
      DAT_140316950 = lVar2;
    }
  }
  else if (param_2 == 0x4e5) {
    if (DAT_140316960 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs1IBAABCWmgzMUFZJlNZyinksQAAoe23/DFhZCAAAgAgABMAAEBAAAEAAgASAlAAIAByIEE0yDCYDUESSRiBoeoyAvG1lSQRwiFESEWQlVUTdj5taZRvtnbKKIfIn2Mj20o0xVQvH9mF4XhghPZy7MGKMBuWiTWVX2aEFCFPxdyRThQkMop5LEA="
                    ,lVar2,1,uVar3);
      DAT_140316960 = lVar2;
    }
  }
  else if (param_2 == 0x4e6) {
    if (DAT_140316970 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs3ABAABCWmgzMUFZJlNZ7J8llgAAsH3T/jlhsuAABIAQACAAEwAABMAAIAAGAkARIAByGpPKAaAA0APFBIkKGmnqBp6jTRoAyazkklRiKDAQzRCuZD4MtfGVd9p1ZswgWDSBHxnJ5yliNzObuASMetltmFRn2+FS3JgUqVnBJ2huSRjDKphGJwH4u5IpwoSHZPkssA=="
                    ,lVar2,1,uVar3);
      DAT_140316970 = lVar2;
    }
  }
  else if (param_2 == 0x4e7) {
    if (DAT_140316980 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs0ABAABCWmgzMUFZJlNZ71roNgAAmHm39zNhcEJABAAgAEMAAEhAAAAgBBQACEAQIAByICgGmmgDQZH6oIkpGg0GmjRpoA7R2WKaIjIjI6pUM4IVGaik21nY3X1bL7q5zKIIfcKKg4S0U1wAcYmViY/PekRNzF9YusVN6FALCVDF4nHs2EgwQz/F3JFOFCQ71roNgA=="
                    ,lVar2,1,uVar3);
      DAT_140316980 = lVar2;
    }
  }
  else if (param_2 == 0x4e8) {
    if (DAT_140316990 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZBoYeEAAAuf+x//3hIACABBCBAAEAoAATAEBBQAACgETQMAC4g1GU0AaAANAB6hjJpkDJoZBkaYEYM1TUCPSMgGQ0ABkOIbBpgmqh1iUCaVRIArUmw7iiic7aVmsvsowN119NlOm3jEzK6Woe8arwiG25lQ5DTBZx8xQMF6GgUhYoWJNpJLWJ8qk5jMACQZkpyc2tufMfEA1CTi+eJmK3LAsWp2pA+bTavyn1HoWEE+eMD1CUB+LuSKcKEgDQw8IA"
                    ,lVar2,1,uVar3);
      DAT_140316990 = lVar2;
    }
  }
  else if (param_2 == 0x4e9) {
    if (DAT_1403169a0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs2EBAABCWmgzMUFZJlNZRJlhDAAAmv2//7F4NkAQBEAEICAAMwBAAMAAAQAhADlbvxzIUDAAu1g0kRk0GEyAMRk0PUHqHpDyZCCp4U0wI0wEwQxDTTQyNNMCU0lGgABoAAAGgADCmcIJCQgSaJ5kHmOZKA4oE6CFQEYU02iIVJOsyQQR0HMCNRknEFi2kCSERFctxCAvu4mEscMLvkj+Ol+V0k45ymIEIGid0mTY3eNgbPrjZs3CWBv12Y//1L7e06VIe58FrVhPiU6t1l21h0hEAJZgFGIgTTNNZKxmAXNcAIC8XckU4UJBEmWEMA=="
                    ,lVar2,1,uVar3);
      DAT_1403169a0 = lVar2;
    }
  }
  else if (param_2 == 0x4ea) {
    if (DAT_1403169b0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs2oBAABCWmgzMUFZJlNZB2RxUAAAqv/1/TNhNEYABAAgABAAKAAjABAIAAREAAQABEJUECAAlAlCUMh4UZB6g0Gnk1BikAAAAAAYo6tEgthFBEhxABgQCCBQdYCwIwItK3cw9638ocMI391HXdHCSUQAooYq2TphqIs28BAnDagdVK6wSGaslota6drfNiSXCjWxe4TOTaKla1clNGAsqfxdyRThQkAdkcVA"
                    ,lVar2,1,uVar3);
      DAT_1403169b0 = lVar2;
    }
  }
  else if (param_2 == 0x3a4) {
    if (DAT_140316e60 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x1df5);
      FUN_1400bcc20(local_40);
      FUN_1400c0d30(local_40);
      uVar3 = FUN_1400b8b90(local_40);
      FUN_1400c3a90(param_1,uVar3,lVar2,1);
      DAT_140316e60 = lVar2;
      FUN_1400bceb0(local_40);
    }
  }
  else if (param_2 == 0x3a8) {
    if (DAT_140316eb0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x1de1);
      FUN_1400bcc20(local_40);
      FUN_1400c22d0(local_40);
      uVar3 = FUN_1400b8b90(local_40);
      FUN_1400c3a90(param_1,uVar3,lVar2,1);
      DAT_140316eb0 = lVar2;
      FUN_1400bceb0(local_40);
    }
  }
  else if (param_2 == 0xcec8) {
    if (DAT_140316eb0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x1de1);
      FUN_1400bcc20(local_40);
      FUN_1400c22d0(local_40);
      uVar3 = FUN_1400b8b90(local_40);
      FUN_1400c3a90(param_1,uVar3,lVar2,1);
      DAT_140316eb0 = lVar2;
      FUN_1400bceb0(local_40);
    }
  }
  else if (param_2 == 0x3b5) {
    if (DAT_140316e80 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x1df5);
      FUN_1400bcc20(local_40);
      FUN_1400c16c0(local_40);
      uVar3 = FUN_1400b8b90(local_40);
      FUN_1400c3a90(param_1,uVar3,lVar2,1);
      DAT_140316e80 = lVar2;
      FUN_1400bceb0(local_40);
    }
  }
  else if (param_2 == 0x3b6) {
    if (DAT_140316ea0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x1de1);
      FUN_1400bcc20(local_40);
      FUN_1400c1dd0(local_40);
      uVar3 = FUN_1400b8b90(local_40);
      FUN_1400c3a90(param_1,uVar3,lVar2,1);
      DAT_140316ea0 = lVar2;
      FUN_1400bceb0(local_40);
    }
  }
  else if (param_2 == 0xcadc) {
    if (DAT_140316ec0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x1337);
      FUN_1400bcc20(local_40);
      FUN_1400c1370(local_40);
      uVar3 = FUN_1400b8b90(local_40);
      FUN_1400c3a90(param_1,uVar3,lVar2,1);
      DAT_140316ec0 = lVar2;
      FUN_1400bceb0(local_40);
    }
  }
  else if (param_2 == 0xcae0) {
    if (DAT_140316ed0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x1de1);
      FUN_1400bcc20(local_40);
      FUN_1400c22d0(local_40);
      uVar3 = FUN_1400b8b90(local_40);
      FUN_1400c3a90(param_1,uVar3,lVar2,1);
      DAT_140316ed0 = lVar2;
      FUN_1400bceb0(local_40);
    }
  }
  else if (param_2 == 0xcaed) {
    if (DAT_140316ee0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x1df5);
      FUN_1400bcc20(local_40);
      FUN_1400c1090(local_40);
      uVar3 = FUN_1400b8b90(local_40);
      FUN_1400c3a90(param_1,uVar3,lVar2,1);
      DAT_140316ee0 = lVar2;
      FUN_1400bceb0(local_40);
    }
  }
  else if (param_2 == 0x551) {
    if (DAT_140316e90 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x1df5);
      FUN_1400bcc20(local_40);
      FUN_1400c1b30(local_40);
      uVar3 = FUN_1400b8b90(local_40);
      FUN_1400c3a90(param_1,uVar3,lVar2,1);
      DAT_140316e90 = lVar2;
      FUN_1400bceb0(local_40);
    }
  }
  else if (param_2 == 0x2711) {
    if (DAT_140316e70 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x1337);
      FUN_1400bcc20(local_40);
      FUN_1400c0d30(local_40);
      uVar3 = FUN_1400b8b90(local_40);
      FUN_1400c3a90(param_1,uVar3,lVar2,1);
      FUN_1400c3a90(param_1,
                    "c4aeUs2ABAABCWmgzMUFZJlNZN161YAAATP/9yAIlQL2JOSh///iAf///7wPBj4//7t/8hAIDwHhDMADTaGIAACYAABMmEYAAACYmTCZGJiGATNBoNAHCYmmgMjTQ/1U009EDTTTEPFDE9Q0bTU9lTQZoj0IbUxpqaaZMNRpkaDTSSQaA0AGQGgDINGgyAAAaAAaPUGgDIAAeo2/fLEx1yKVFNh5osXWbPacBJRfDxccOJF6OmObIO6jxa48Orc24L32AAAAAAA8Q+uT2EEEEVqtflFJMM5kyqpaivpUTJoJKKjNQNGcLRQRFk6UaM222294JUjm51UKqgKQe1ZJZ0qFV8xhDDJKSpe40a/yT+/q7pv0HH45/XX87wJfFonw+WLHGiLWsXIFm1a9m0PcIIIJADBBAACAQeqJAK6rRCMAJREdNF89hoL6ERcv2od4qztqxhI9jy+6/BdfK/TFcUAKSSAJy22GgKL7Rz9/nKEf4u5IpwoSBuvWrAA=="
                    ,lVar2,1);
      DAT_140316e70 = lVar2;
      FUN_1400bceb0(local_40);
    }
  }
  else if (param_2 == 0x25) {
    if (DAT_1403169c0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZNWTxtgABWH/f5mZrsmM2VoISCCIIAaoCQiQAwAwgYiQwfgpX+feGsADZIVT0m0nqAaADTQ0AGhoDQMgaDE9TTCGhzCaMjQ0MhhGhkNNGgAxGTIBhAMAkVKNNMgAANGnpDTIADTQDQZGCNNPR6o2mCQhsQIj5caNliUiYxsBZWfEi+zaeIzCMBjRI9ti/bER/MO5uWRI1mR9HX4XqpjilmyECQQKqc4JOiaxzxnl0uQb6MUcznPCzMlASQbIaKAk8TQQQn4xOzmqIEdkG5HewJcIFaafcCzbB42PBTQb1RBct9xEbTL8IYYrs1ungvR2eybCnFNhC/iyfknwSEo6Rgzjhu4ABYWCSUGkCP8XckU4UJA1ZPG2A"
                    ,lVar2,1,uVar3);
      DAT_1403169c0 = lVar2;
    }
  }
  else if (param_2 == 0x1b5) {
    if (DAT_1403169d0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZAIKJSQAAo3e////m7IDACI0ACDAAEgAIAHQLAKAAAJAAizuv/rAA8jCCmTUeo9I0MjQGgGgAGho0NDCBoJGoMgAAAAAAAAABpqkyDQAAGgAABkBkGhjUfMkJ0yjGCaFa19GOBDmKhMeQnGmrGuBTQwiITEQB0wlx7CwU33VgJeUQTkMQKYmmApqYeMBpktNKZDOIVyAF0b+3RlU511L54SCL6t+KNoxHRJTkoxNLJ99WJn1zVrT0dyFgzzaE0EZJTGOF8DSE1m1frzwCPd9Yfqg8vbaR3KLCQOQk262/FpgQ4kBjM5mUDEvllIhLNBAdJAolNXaULqBHk4lVYwD5AfIy+1kHIoIl1oSAP0FaovAYikJCiAlooAAr+LuSKcKEgAQUSkg="
                    ,lVar2,1,uVar3);
      DAT_1403169d0 = lVar2;
    }
  }
  else if (param_2 == 500) {
    if (DAT_1403169e0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZks3h1wABWv//52fromE2VoISCCIIISICUiQAgQAADCBiJDB8Alf5946wANkhUaE0yAAaABo0ADQ00A0BozRNommhzCaMjQ0MhhGhkNNGgAxGTIBhAMAkUpGTTRkAaNNNNPUAAaZNGgyGmgAyZNo2mgEhtCQRc0qJlzHRkttAszRgi81SkQMIwGNF97DFduQP5h2McogGtpQIqnT3ftgli68gUrhAmSC1w6lMo4+ytXvYdOYGXMfntGrDsvFkJ3HGw6pEIjS80oIwyALi6rRxnwHLQyWySBZD2DyMVM0TEUpFAMDqQzxQGtknvLlJP3qPzUkx7cJcd+Rgu4LFsskk5Bgzfj1f8AWFoACNiSDELuSKcKEhJZvDrg=="
                    ,lVar2,1,uVar3);
      DAT_1403169e0 = lVar2;
    }
  }
  else if (param_2 == 0x2c4) {
    if (DAT_1403169f0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZ6MFgbQAAr/e///unASI6AAUIAGAAAggAEhChCAAAgDkNBASGQ7AAuSIEmmRGgAaAaAA0xo9FDAADQABk0AAAaAYkjUZPUGjQAAA0AA0SKIZEvRAOlAEPCQqMLL3SxEpOZgZU+SOFiEbnloTM4AMheQeoRwcRlQAIoQkV1HJinoip+md2bzFBr8bltIO29FPlMLJ8Pj0+SgBERyysSIVSGFUeRk1JWQaAR0EfvjcoO97rCpY27TBxUsrrcsEJIGIwIZySlgJ0RMqUQR/F3JFOFCQ6MFgbQA=="
                    ,lVar2,1,uVar3);
      DAT_1403169f0 = lVar2;
    }
  }
  else if (param_2 == 0x2d0) {
    if (DAT_140316a00 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZxn/ELwAArP/r/9NkeAODCAAAFEAAIBCCAEAAABqiABUAAjKr97AA2RDIommTTQAaA0ADQNNNlNqGGhoAAANAAAAADFCMp6jQDQAAAAABFFhJEEAciJDwi9j2wQDGRaxNTUEpEJEHJ6jQYZlJLWUznNqtYiIq4g6djkBTlpwcSkSkbqE80InvSPDghzSxvTIBU5WKGtww2PlkHFUsTEheGOp/RtbMQRGhIPlBA6KKazAY0NEmmhXwGWrcI+32uhIl4e1e8oxJ/SyQV6HxQlKBiSUqOSH6leVWuUn82uV8OQkQQBnQI/i7kinChIYz/iF4"
                    ,lVar2,1,uVar3);
      DAT_140316a00 = lVar2;
    }
  }
  else if (param_2 == 0x2e1) {
    if (DAT_140316a10 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZqld7JgAArP/7/ldsbACBIABABAACIAACAAAAwBhAACgAEAACNq+3sAC5QimNQ0ATAATaTCMjGRDADTRoNMQAAAMgBJqkRojyQDQAA9QabSNlNLKioIKEWSLBcwgsLFYoUamVpU6GjqaOtC7xprbrKQ6GaLaQJakvT1Zil8BVraqXBDsgAm4wiUVKgqZ+nABPKbghkkKC9xy8L+kKRAkzpsTZhaHBXKP47Xdpuzl37lZBc3Hv5K8E3J3JfhQMsaUVm/Kmr74sa4HOyTakMv8XckU4UJCqV3sm"
                    ,lVar2,1,uVar3);
      DAT_140316a10 = lVar2;
    }
  }
  else if (param_2 == 0x307) {
    if (DAT_140316a20 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZBIkEowAApX+////07cGIsAARxeAIMAACAACMSgBsoBgIEAgPmvWvsAD2xCImmoNNNAeoAAADQA00aBtTTQGTTQiaaUPIQA0BoAAAAAAAAAGmkUnlMCYmBMmQxBo000yaZNGCYmAam0ciY6UrOEAkQEFCcAJY64rgJiEAQREpLYxCk6lEhBIYqulBzlpDC0iCbRcaogOqrCoDkAq6QsHpcbCGUiAxhCEMowERFPh+KmPGggquZZKJbUdh96kk9jzABeb4aefgHM2bYwovfWSRDomW/MrslyGqP48GIAE+y18cV5QpjKtVMHBqSvr2TEyc71NqjXYY4yA6Tfq0sj1lDqewikL42bs6UHHfxBN4IJAkVqOZofqcWPb+DEeKAezygJJKBB/kXz0FAnWQj5QdhCAlAj/IXckU4UJAEiQSjA=="
                    ,lVar2,1,uVar3);
      DAT_140316a20 = lVar2;
    }
  }
  else if (param_2 == 0x352) {
    if (DAT_140316a30 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZ0kQ1bQAAoH/f/3/0aYCAGAMbRSwAMAgCAAIARgVmJYCQFgCKO73vsADbZhU1AxNNB6jTRoDQAAA0eo9Q2owTTQzUIEk0DQAGgaAAAAAAaA0D0gxSU2U9QYE0NBiYI0xGmIyGmEYANT09TmRfcADqADr7CEgWJiLEgg4g8iD4p5EV0BCWQKkD4zCM7MQQZgRAIoIBNDz1pg0EuiJOqEj2Sk3Qks8xkloxQwQ9oOp9TMT48V1r02YQZgaDiofqnkSBTYmWWioDStjJFrfTLXGRYiIT2FFXXXxuDjFeX4+BMgOBoCClEZfdaTWbROh6uXQ2Q6Q1GJz2cHEW7WEQIkdldgEKH+iTvRgoxXCTCgWoAR0SS3gLuSKcKEhpIhq2gA=="
                    ,lVar2,1,uVar3);
      DAT_140316a30 = lVar2;
    }
  }
  else if (param_2 == 0x354) {
    if (DAT_140316a40 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZuwxqigAApf+7//P1YXmACCAZLAgKMQgCABAQQoIi4MpTClq/zrAA8TCJpQyaGjRk0BoA0AaAPUNNAyBpkeoNT1Mike1JgTJowjAE0aYgGCBiDJppholGgAAGgAAAAAAADT1PKQLIpz3xRgILCChkFRIxKB7ZSNUPc1S0hrCSCVVUDShYSASINaSyBDyHFb5RAFSQgVFmmDnI5VQEEkFxVHRX8L/afn6a/rqs8AuEacOulN1P59n5sX+olBEW2SjaMwnjQPvKAGF/AifCQAAwkQvGL1O1Ct2Qg/K+jQHUIo07zS9naFOvke2UF3HOnCc+qsQ+erDHXdvspEO68xFxCFkQS9m0E6nBLaQ19QAJBkI+hBKMkrQAHJggoxCMiBKMEQX/F3JFOFCQuwxqig=="
                    ,lVar2,1,uVar3);
      DAT_140316a40 = lVar2;
    }
  }
  else if (param_2 == 0x357) {
    if (DAT_140316a50 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZHoIR5wAArHef/3v0JACBOSQKgCAAAgBDACCA7ABDAAIStBawANNqIVG0TAJkwCMRtCYADTQYk1NRo0AAAAAADQEppSNANAAAAA0DQekpoywiiQZECkAIysQkSGZmLuoFIgRRDuxOiSpM1mhEQYMBQQeDyuwkAEUEqUzACcITjnaiGiHclE5SIzKSk0ZyESOP7JCyate0jKJkMQ/hWHsUgWVuIIiAHNy05YUpajXGj31av8HcEQJ5PeTns3pATKCY7zPBM06YIWHGghiCK6Y+pmSZp+hdyRThQkB6CEec"
                    ,lVar2,1,uVar3);
      DAT_140316a50 = lVar2;
    }
  }
  else if (param_2 == 0x359) {
    if (DAT_140316a60 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZ4XhUsgAAoP+f/X/0aIqCCAEbxaQAOAQCAGYBRiWAggqCihu/57AA2SGRkwnqGRoDRoA0AAGmmmJtTCGJk/UhwDCMJpiGAQDIAYRpkyYRgIaDEiU8oaepk9IGjTTTINBoANBhMTQZNP0okY2A20BsRsTHosEiWTIskki5GRJEiRF650SyBilYCg5hTiYSJ6cgpmBESIc/S1c1ytCSZiQXPKjTLEkpdOOAIgZhYNDB5lakMgehfqPTzUH0ZDC5HCR52hu+HG9u8RK68LAWEBrCZtqnTTe0Ebqyg/V9U9sgiZpiSKIRCVPl8y1qO5c0zCrqSzzaAL5bfs+zlYHMgBEjBfNpiJ/Fp0HogCEsHAAW0SYIAmf/F3JFOFCQ4XhUsg=="
                    ,lVar2,1,uVar3);
      DAT_140316a60 = lVar2;
    }
  }
  else if (param_2 == 0x35a) {
    if (DAT_140316a70 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZ0T5QwAAAn//////0aYCACAEbRSwAMAgCAAIACgBGBWYlgIAGAIobve+wANtmGNQMT1NDRo0aNNNAAABp6RphNPTUyNpCBFGINDIAyAGgAAAAAA0CU1KTaTABMAgZDE0YAExDQGEM1I6aJAAeQD0RwyQzk5M5IRARCQNbUJMeKAF4QQTMIypjbIEoMCIBFJAJofedMOg6qRO6oiPRJm6H9wQ+2kNEskUjkTh1vZ5jhH7IOVIAQVYbIPqcCR70uZ12B49oK7TZd8aL90TaraADmbChIYxDFMfIwy/WdMNM1gMTLKxxXRVGgaVSLtflvMWUEGPd1cjP/rmP5MxT8HA+gCim49fDPJgswcUwSkAD/+LuSKcKEhonyhgA"
                    ,lVar2,1,uVar3);
      DAT_140316a70 = lVar2;
    }
  }
  else if (param_2 == 0x35c) {
    if (DAT_140316a80 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZv/OA4QAAofe///+0fIDAAIUACDAAEgAAgHQDACgAAJABijO7/7AA9sUQU01PU0w1GIGIABoDQMmmTEaEMop6gZAAyAAAAAAADTU1CAGgA0AAAAAAZqPhSq5Qrkc+CxCaLEIQBoeCI85jWqZBRCCHF1QpRQRBJVS6cSvEPlwqahRhJUhHiigwF8pYI5CJ1+PWJfwiPJjtVnBmgxYVXqHZ0HRKzSam81Qjwt9INLr6lXpa642s+olLpjHrLGCu+pTdthrb2CIRkFPvPhYcpl1MRLukMxPLdPkEh4ECNRnlYY/zQQH/JncZEZCAOzTSMicqBCYgxtnKnsgDJ6YnAoInGRFE/QiesJTBSYjSEFkoEAb/F3JFOFCQv/OA4Q=="
                    ,lVar2,1,uVar3);
      DAT_140316a80 = lVar2;
    }
  }
  else if (param_2 == 0x35d) {
    if (DAT_140316a90 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZn30FOgAAoXe//9/37IDACA0ECDAAEgAEAFYJAqAAAJAAizur/rAA+bMIimyj1HpqZDTR6hoaaGmnqAAyMgNHqCqep+qeRBoxBoMI0yDTI0yaYjTIyNPQYSRQPSNDJpkNMQGTQA0GmjIw1KEWJI7iInET0OJBqxDESogBNzoQgmwpJMCZBx1YZG3tTQL7Y11utiG3YZ2VKTUMhIxbaSBQGS2cMRwxCAkEd7IVhg+L0QXuowfUu1wwFrprpzX8VXgDN8Y2yuvRfUDmcpGLC6shChvYWNWs1eIAFNHQCc9zIzsGRV2FUTSUAYYhrTVTRVAuR8zzICWw9paDpgrd53DiCQYjnsvolg1j9o9NNaDmRzI8uVg+qI1SelADPo6K2iYakdKFKIN1AECn/F3JFOFCQn30FOg="
                    ,lVar2,1,uVar3);
      DAT_140316a90 = lVar2;
    }
  }
  else if (param_2 == 0x35e) {
    if (DAT_140316aa0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZFm/fAAAAp3+///90eIDAAAQIDQQIMAASAApAUAsAgIAAkACCM6u/sADZIQmkmanppAAaMhoAADQDxTEOYACZMACYTBMIYAjAA00IpGnhJ6jTTNCGQBkaYIxGnpPSUooREnIERCMpZ16Z3cQlUc1hn5IMQS5ES9Hl6uHpmZhY9GtlrahbiopAkIWlbRciHLFg5AWdUQQ5G79nzhHEg4LoJRHa2o97RMZBrGGVkFJ1LSOFsCYbJDPMmMRAAl4ELFwKo2yKQ7iISVDrXI4V14Q/OXJ0+TXp/Saz4GjQokk56Zr8UGs7+2uZ6Du2qNxo79rD3IqLngUA3/y1Zuur/giVlEoKBEr4i7kinChICzfvgAA="
                    ,lVar2,1,uVar3);
      DAT_140316aa0 = lVar2;
    }
  }
  else if (param_2 == 0x35f) {
    if (DAT_140316ab0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZZ2alZwAAoHe//99m7YCACowgAChAhgABFGQoAIAAAJAAojqr/7AA9sQhCnkmGkGQaNAANGjRkA009TCEApPUHqAADQBiAyAaAABppFAaAAGgDQAAAA00aNITEJxCrGAjCBpohqdRTBxZCNIAJTEyQjUwFwhuJRpMhxRmMVoUCMZxUspRGNJKBWqA6Q4WtJKjUUQMBBWTFI60h9+vUkhwUXyZR6D5b1eedaZZ1KZqE2FP8NUjSG8f4CorHsTlKaMkpG5Yabq8HGmARCXqUP01SmYIaHGmAApBI9ojc+yxoiDEDADTWe1pDB6qbXEbI5PZhZZO41jQMxEez0GI+Q+Q68oG4pkLSiaiIH1ggrMplB+IEJQC2QiAQ/xdyRThQkGdmpWc"
                    ,lVar2,1,uVar3);
      DAT_140316ab0 = lVar2;
    }
  }
  else if (param_2 == 0x360) {
    if (DAT_140316ac0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZeLG0PAAAp3+//9+t2+CQAIADEAFAIAACEAAIgEBIToogKAD5u6UvsAD5VQ1GplGmgBoDTQA0ABoaaNAeo0NDjJkyYjEwAmTBMgBowjAEMAzUkk9JtTIGgyaADQAMgGgNPU9RkBytSSV8kViISivDnsTQQKeSmkNCvE5JqcWnJQCQswVAqN+NLZntzNQwSrjcLbHDJZ4BChXIAYnn1lNXVg0dDPPvAkQPFEcOZSfPbTN04Ya35q4Yw5x+43Ibv3LS+4h4y6v3qpeCmLz3l3Zq5c5C4sNCrGG4HWenUjPVdwV6SEXnZmziU76v5OpiFYRLoiQwcwUf44UaAjQJLGKoqGrY8A/oW6dYvwpqhfxkyRlErGWGmh/F3JFOFCQeLG0PAA=="
                    ,lVar2,1,uVar3);
      DAT_140316ac0 = lVar2;
    }
  }
  else if (param_2 == 0x361) {
    if (DAT_140316ad0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZl7vlQgAAone//9/u7IDACI0ACDAAEgAIAFYLAKAAAJAAizuv/rAA8jCJomSY1HqBo0GgBoMgDQNANPSBqn6JTag0AAAAAAAAAAGmqTQMgBo0AAAGmgNAGhjUeLiB0uRS4GhrXkVgQzFRxr55XSDCVjAhAL9AS+RAGkJcXCwU4brWJeQNMdiBSJpAUqRCIDSAr5VCRDJSIEDChnZHScRcuTt8hw8/C/hlUYWJmV+lp9Olb98qDnA5qlnJLbSWSB1DTbONZomDhJgP9Gtniu5QAnXgUPaYHNQme/JvWmwQJBeYr+Y4eaLDQElM9mSoVL7sNARc3MwQiCRTVfnd7shPJxqajAPkB8pk9rIOJQRLrQkAfoKtSCOIikJCiAl8ogAV/F3JFOFCQl7vlQg="
                    ,lVar2,1,uVar3);
      DAT_140316ad0 = lVar2;
    }
  }
  else if (param_2 == 0x362) {
    if (DAT_140316ae0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZNcM9PAAAsn3f/tckbACAIAAAFCAAAgAAEEAAAEAAIBAAAzKru6AAlIZEg9KHqB5QDIAPTUaDTKNUNqA0ADRkaAeUkWhABgA4KcQIlFqjUkCWc4CMLqMksqRaKFXcHEOZSSZISDcnR6iUWcJ4qlKRs9WCO2bn4Iomt3KnEggCCDzmZ9QrQGdYC/vGFUGEKYs8i02ynW/o0+Ju3tATI3Efjk5JqEDOWAmWAp/F3JFOFCQNcM9PAA=="
                    ,lVar2,1,uVar3);
      DAT_140316ae0 = lVar2;
    }
  }
  else if (param_2 == 0x365) {
    if (DAT_140316af0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZYVervAAAsH///vf0pACAAEAEhAAaIIgCAEAAoAMBwAAEAIACGAKTtCawANihEhMIZom0aR6AmmTaAho9E9BhoaAAADQAAAAAzVMip6jIGgAADQyGgNN6piHRuBdgklsDTsPGLAVhsQ5xUaQRERRkqaAlgSOw1UrjjJZVijIiIwtKUjagUizlTZHQZSseQvMkuJbWt3kKubLD8dr5zS857m5lIB/69yjxhAACalHwBCa2RAHzYyduhUnRacl4xal4jxT7fwa1DVt2+iVyjua+j0jSJ731RaRK4ktX7eElcSuNZBq41/i7kinChIMKvV3g"
                    ,lVar2,1,uVar3);
      DAT_140316af0 = lVar2;
    }
  }
  else if (param_2 == 0x366) {
    if (DAT_140316b00 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZBXBA6AABVP///+fjp+MzVACSIAABLQgCUCBAoaAAlCgwMWB4I+Xt9wewARiENE1U2p4poNA0PUDRoNBoNGQ9QAB+pNMnhJtJ6n5UODINGgDJpiGmgyDEMIGgNGJiNAAAJEkmkaAAA0AAAAAAAAABoCGoQCIGCYMYwkxjQoczEEnYNJUGkUBoc88kSahqeri3lDU9KVZKJmIqmAOaYkFGgRpSxmd0yKLbQKuuIRUaxJQkvpo+OyCowCA9r+AtdLNNwDVPMp7i7cWfO6iTKSGZM0ynoKBitgSPfncl+6/ZiOiW4pAs1WObySA0uqt1O2s/T7oEeN6oxzYhivSO1bvilHzOzVs/v17yV3WNfZ8ULlHX64V2FgAFGZERC9MsD1GOWMLSsDXgOXkD7b8cdKKXOvt/O9mLhFIhJhagE7VAFo5SgRMMgj+aVJgkj/F3JFOFCQBXBA6A"
                    ,lVar2,1,uVar3);
      DAT_140316b00 = lVar2;
    }
  }
  else if (param_2 == 0x36a) {
    if (DAT_140316b10 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZurs7CgAAvePq/kIiAQAIIAACACEAAAgAQABAQBggAFRHpU2kGmgyeUEmqhpkAALEAKMgF6GKEN2BWt0Jxa6zRmqAwOWTADZQF0XVYi1H7WIzRqp8fS8zofi7kinChIXV2dhQ"
                    ,lVar2,1,uVar3);
      DAT_140316b10 = lVar2;
    }
  }
  else if (param_2 == 0x36b) {
    if (DAT_140316b20 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs/ACAABCWmgzMUFZJlNZdZW+TQABX////u/j5mEy1AQC0AQBIQQCUCIIgwADEAACIWBwCkXp/wWwANiREKYmmgNNADTQDQAADQDRptBPUZDhppghkNNMjJhANNAGE0aZMACBoJElJkDR6gDTEABkAB6gAADTTNRtMEkoYNobBNok0NiQ2k2BJpSaRTYhY3Fha27B504aKrYxBPjwhTRCMutCRdYa8oW40g/mc9+BFz1gutBpPbrQH3PkySm1IWng0sreaRkSxH5hw2E5xjxR3nchj18pA9jeKp2cKhXb2tNKcOPV9LvWIKCw54OZTJiWM1TPgh+IwJFiu9C1GxAAgBcYgAABCEYMSVFyb9owC80AXmJbTEX2JUMETtCo/xdyRThQkHWVvk0="
                    ,lVar2,1,uVar3);
      DAT_140316b20 = lVar2;
    }
  }
  else if (param_2 == 0x402) {
    if (DAT_140316b30 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZT37A2QABV////2PrI+W2VIrUAAIIACIPSqQMhACABgggpCB0Fhf594KwANkRCQmRkATGk2kxGmEwA1NqaDATT0T00D0E00ONDQNGmRpo0yAxMEAANAaA0yAwJkCRRU0A0DQGjRoDEADIGgaAA0ZAZPUbTBICW0JYsZUVKGhBBzmhBZ4sT8wCvciwm2ApeRAP1hoxgfw0K29OJAVd22WmlmzYBQ5w2OrZa0QBggT4MC2QCr22PpPfPehZKh0kuR1R6+jnI2RVnzcaMjnq6XjW0GuSD6+MvJBEK3CFpjfp+7XUoJLsJsKI6GWTZG1bWc44VJl8/iRTYZX7c093VZDfYMGKk+U5rjTebCgB4D7dp0BsREQdIIglRMOSKSJGCkYi00gkaEI/xdyRThQkE9+wNkA="
                    ,lVar2,1,uVar3);
      DAT_140316b30 = lVar2;
    }
  }
  else if (param_2 == 0x417) {
    if (DAT_140316b40 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZp4nMfAABWX/f52drsiM2XoISCCIIAaICQiQA0AwgYyQwfAJ3+dcmsADZIVTZT0IAAAyAAA0aaBpkBoabRNGQ0OGhk00NMjQ0yMgyMjQyAxNGTQBkyMQwkVKaPUaBoNBoxGagGg0DRoaAGgAbJlG0xJCGwBEXBDEyPBRPY2AZrAoMUbVWdASjAYxQ1YBXvOAjYdDhGKk63DydX9zmGKEsnBACpu5iZU6anepxDSOv48lotVxFI8aNYIEAttRmS3yDrSRBjebZ7aYBRnkCmRVjP9YN40lwCW9kEeURdsV6mEjwauEy28O6VBcW9bcv7LFT2cW/PmvTqUkcniSGEWRgyxNiX0ApWhJKZoBH+LuSKcKEhTxOY+A="
                    ,lVar2,1,uVar3);
      DAT_140316b40 = lVar2;
    }
  }
  else if (param_2 == 0x474) {
    if (DAT_140316b50 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZq6N9sAABV3/f9mZjsuM2VoISCCIIAaoCQiQAwA4gYmQwfgpX+feGsADZIVNE9R6gAAGg0AAMg0BoBkMTahk0NDjJgmhkMjIyaGgDQZGEA0GjTIYhoAJFKI09QAADQaA0ADQAAB6gB6n6pp5S+cASENoVJggNqpWZLTRbsbAV3fwRFmU6TJxgMaLLy2L8lgfrDlbqEEYzK27v883GWJAoYKIQHhBuS5mET0KGtu2DIMQgkmcc9sSC5YDzvTDYikGyZmBCcgd1GkXwR1Qa7+xUSoQTUegFU2VqA1uxZA2jTlXTjV4ZF3Hgwv5sKv/fWbLYkorwkoompx+I9pEtDcGDNajOiAKyxJK1aQE7SFOwVDSQH+LuSKcKEhV0b7YA"
                    ,lVar2,1,uVar3);
      DAT_140316b50 = lVar2;
    }
  }
  else if (param_2 == 0x475) {
    if (DAT_140316b60 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZyS8uxgABWP//92fjMuE2VoIxACoIiCIC0iSggBgIB0AiZDBUAtf5/4awANkhVMmmjIaAAAaAADQDQAAaNNP1EaeoNDgyDRoAyaYhpoMgxDCBoDRiYjQAACRSmoMjRo0ANA0DQaAGRoA0AAAekzUnuAkgJTACDSSDdmS14xCum2Ap0+ARsMmVAtDSYxfzyr+Au9xsP2vBLHZTo8tau61S4nAypEJEJA/Vy7o1+evJJSmDOUZrgl5WPGZxIFfnlqk4BlskRgsUJJRigcljVV0Gt5pN0QC2AU1+AhwlaExB0GEJyChKZFlgb60uaDBixFHAp2fvN9r69lyUoEyS714o7HH2FgtkUnJiRpJFliSUTBBaYJcTEEjAA/xdyRThQkMkvLsY"
                    ,lVar2,1,uVar3);
      DAT_140316b60 = lVar2;
    }
  }
  else if (param_2 == 0x476) {
    if (DAT_140316b70 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZZuP89QABV3//92fjIuE+VgIyACAIACAKSCRmggAACiIj5ShcAhf//8KwANkhUajTTTTQAADRo0AADQABk0wj0BAc0xGRk0yaAZDRkMmQAAAyNMjQMIZA2lJRo0aB6gAAGgAHpAAAaADQ9E3qkrgkCE2hKRgBt5tEq2gXKYCvsCAp2ZckCymDTFYeY5Wir+QnaVZ8tGAslmfNUrPomoW6WjBTGhBjHAdpYX63kkKSZrcEAYslfMwrTcc+ljZ0a7IgoOkjOxxL+yPySqYiBwGYeFHouSNObUAYymtQLKPUC8TC151v1Pz5YcppFwk/4I71r1KUacFSj2yT/UvcsRWop03TccauAKwwAoNISi0IssRFoEl/i7kinChIM3H+eoA="
                    ,lVar2,1,uVar3);
      DAT_140316b70 = lVar2;
    }
  }
  else if (param_2 == 0x477) {
    if (DAT_140316b80 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZNTUioAABV3//92fjMuM/VgIYACAIACYK2yQGkhgADiAmZTRWIlf994KwANkRBTUBqZDRgBNAMRpppgATENGRkejT0U2mmTSfqhxoZNNMmgAYIA0GTQADJoAAAZMgGgkkpDE0yaYgBkaYjIDQBoZAZMg0NGIBphFZwJAPGSScwgRwyPDFLGGljDAKJkuC4yfM8ZBeGFdaTE5vTCD1b/YPy447oDkSGNXnq/vUUMT4fhpGC4QB8qsKU9WDHNW6XICXDy7LjXM4+8iCup0STlsNacfC4wdt0jNxWz69cnRATxkyC7z4XOw9dk2U1I4K6V1+qw/dGSOSl7UbA1V0qs8CyH/6XG1o3VN7PYt5poppJoaM3ujAYB7kRmxERDeQgIi7IEBfYEttkIvsABgF3JFOFCQNTUioAA=="
                    ,lVar2,1,uVar3);
      DAT_140316b80 = lVar2;
    }
  }
  else if (param_2 == 0x478) {
    if (DAT_140316b90 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZVbeq6AABWX//92fjKuE2VoI3ASIIBqBCwiYRgCgEmqRiZDhYAhf598KwANkRCRTNNBGmhkYj0amnqYmBGAgGQyaep6mbVPIYTT0gcaGTTTJoAGCANBk0AAyaAAAGTIBoJFJRoAAANAAZGhkDRoA0AA0BkZD1F44AkBE0gIMSQbe7aWZSr0rUYCur2AVmGPFAjaVGEBfjyWik/thWj6ok7EgGMzN3+zikFFhI8yACsy6vqlqVS+k1hI3CsfxvNF1pGRZIFpN1w65IMgNp03E7+6UBQV6Um1Z7URGSXl98NllBgn4SR9HAu2n/B/rPFURKsufWI9YbhF2wWCQlbJuhNbVgR27joe5o9tx/S69B7QI/sOPCrM1iIiBiAICOW0II2gCNgH8wAP8XckU4UJBVt6ro"
                    ,lVar2,1,uVar3);
      DAT_140316b90 = lVar2;
    }
  }
  else if (param_2 == 0x479) {
    if (DAT_140316ba0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZOYxIOQABWH//92ZrouE2VoISECIIaC4SWiAAgYAADiggZDDeAxf/9wKwANkhhM1GgaAADQAA0A0ABoMhtExMCBwNBpkNNGhhAyGhgjQ0yaNAMgxAAGgkUlBoaBoANB6gAAPUaGgAA0AD1MylJwEkIbQRMSA3aEbK1ki4baBXd/BFdrIigTDAY0TPJpQF/VoFhhzsdAgGMyOTi6fyTgtbYFGENpOhBDjzh1ENXmg47kskFRFXexglwgUyiuo4AXC2plcAD8iO32bVNZW5lPQcDOIQIjCBnhPaSLWJTTCPbLrDgaurqppPPYz8lhD5b69j7j9KlGfa2IqM/7FL1EpESDBmrPmSgCrtJJWjSAmYJTNCnYID/F3JFOFCQOYxIOQ="
                    ,lVar2,1,uVar3);
      DAT_140316ba0 = lVar2;
    }
  }
  else if (param_2 == 0x47a) {
    if (DAT_140316bb0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZ40LbCwABVv/f92ZjsvM21oISCCKIACoCQiQAgA4oYmRw2goX/feGsADZENQk2oGkaZMmEwEwjEwEDRgRgmxNT1PT1ND1DjQ0DRpkaaNMgMTBAADQGgNMgMCZAkUpDEyBoGg0NDIAGQYgAZDCDIB6iY4JCENiUZggKUigyzfIlMbAWJjwR9NT40CIYDGj8c9i+bUD7Yc7ccgjNZq8VTq9+YkCjj2nGF8oyY9Smr52S3VTLdW54s5ckOqsXDC1NbZ3OnJb4NYGXTnZTr3+kB6ZsfVnFiOuUQZewL6d7Ex8GE7VPGguoja42wk7RYE/S+8uUhuj++sFM03NZLjxDSPwICotgoBRY+E00AAE4lICEJxKICJglEwX8wEH+LuSKcKEhxoW2Fg="
                    ,lVar2,1,uVar3);
      DAT_140316bb0 = lVar2;
    }
  }
  else if (param_2 == 0x47b) {
    if (DAT_140316bc0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZhHlHWwABV///92frIuk+XoIWkCIIADIGQiQBkCAA2iBqZDhaAif59xKwANm2FU0GjQ0AAxDQAABpiaAaAANigNAKpoDagBkAaAaYgAyAAAGTQ0NGmT1AJFKT1NGgDQADIAAABoAA0aAAzKeknuAAgmMEoNAI3NmpOPSJK1GAru+gEbCjMgStJjF/PJpQR6uRh1NOaQI2Y7Myf28pNFEcAwAcldtLnkhqRhOR8bV4xlXiiCmMCxH9eWdqCK2OyrrCVWRUoTghR2LC6/Vy9TfwDKrZjLEgDvYsO8z10APkuOgVzHwCztEAFc8lCCSMiyp7UmBQqYv5yTpa8LSvVmVvqtWI4tsdNkChhVUkiRpCVFgBK0gJWgK7QAf4u5IpwoSEI8o62A=="
                    ,lVar2,1,uVar3);
      DAT_140316bc0 = lVar2;
    }
  }
  else if (param_2 == 0x47c) {
    if (DAT_140316bd0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZ0zIHTwABWf//92fjouE2VoISCCIIISICUiQAgQAADiBiZDB8Alf5946wANkhUaTEyAAAGjQAA00aaAAaDaEwQ0OMmCaGQyMjJoaANBkYQDQaNMhiGgAkUlHqekAAAaDQAADQaZGQNADTah5TEcEAkNgomABwSUmWbhF420CwsaCLbWfFAmGAxo/HoYcBfdmBKw6mOQgGaylxU61rpI5AZMIEjggQHAft6kLWMHZOkoc4YIiP9lLlcGqjr4ZA9lgKLpQyLrCSxJLwWlNKxhPsG7Iq+VHBM8AVUbFQLF6gkV5oXnLTJoni1xzW1Nb+tZ3pw0J9SFCe3FL8y9HaViM3RgzYny5QBfrSSUbARMxCmaRO0gD/F3JFOFCQ0zIHTw=="
                    ,lVar2,1,uVar3);
      DAT_140316bd0 = lVar2;
    }
  }
  else if (param_2 == 0x47d) {
    if (DAT_140316be0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZNC4mNAABWf//92fjIvE2XApQCQAIQCJCQiQggAIAAiBgYiBUAmf7/4awANkhVMR6mhoAHqBoaANAA02poDQYxQ9Q0OMjTJiaDJkwmmQMhoDQGmTQwAmgMJFST0h6gaeoGg0yAyAaaeoMgGgAbRo1I3AgEhtIoNABZpX4j0hSyxpIjeiwotbNCBYk0NgTOrHAl5svsleOMWczasydR+99HIE1IwZ0AWGHD4Gm26bPVU8dxmDO7DMqPoeMAGpYonkisHeiCQ9pmMJ8ju1oyZFPiwWyzAgrb+bprwQEeRUcRftBXupQiIvpGQHc7kX+y1ackU+/Bp5WvPghml5s+YcKibZvT6uFJIxMSShaEE7El7NI8GCA/xdyRThQkDQuJjQ="
                    ,lVar2,1,uVar3);
      DAT_140316be0 = lVar2;
    }
  }
  else if (param_2 == 10000) {
    if (DAT_140316bf0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZyoZ67AAAo3+//354/iYSFixCAEgAKsIDAAhQQCAERkIQjCUp63D7sADZENTSEn6piZMEepk2k2gDRPUaMJ5TaNTE0/UBPJ6hxoyZGEYgGE0GATQaBkyaMmQwgMMSUelGJpoZGE0ZNGEZBowQDRggxHlCRlsBPfHcyIkKSiBGRG8m2XuW3GckfRDq9meoEDPRgMtgyJHSqqL0Ka45jQKR3NuJyAAjqF4b3wuiXYJRhiI8MgHBRnbIfZIdbehYgKSXPu0bFxneT/OeuJ+xlk74lNQO2sd+ZbW+dWSZpfaHi4cD3MFyANAUSCS2mHinR2gGlxK2/jA3VGY1Ja2oAXaUzmwSABYICcQHSapY3J46iMgh+kOzUwOpCcpi/MjGJEwoQoZ0BEgf5Ag/4u5IpwoSGVDPXYA="
                    ,lVar2,1,uVar3);
      DAT_140316bf0 = lVar2;
    }
  }
  else if (param_2 == 0x2714) {
    if (DAT_140316c00 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZE/DxggAAuuv7/+/AbgQAIAAgAAYAIAAIAkAAAAEAQABEAKCwALNoinlNPUBoANB6hp5QSJJlNqabU0ADQAEipPSGCDAACMbTIaVGIMWCCTQTcOt8jVcoY3OsYV0UvtOh3tAacZESyezKMLa5G9iAuaODSIbYxg2DY2S8qIPzCFCQjhiEW9oKZqKAk/cFccxSHVhtK4yNStiRgyEgtykM4+zgDCHykDDcIB0LuSKcKEgJ+HjBAA=="
                    ,lVar2,1,uVar3);
      DAT_140316c00 = lVar2;
    }
  }
  else if (param_2 == 0x2715) {
    if (DAT_140316c10 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4IBAABCWmgzMUFZJlNZ7BgAPQAAs/vf/0GYEEQgABAQACAAAgAEAEAABAAAEAGWABFAE6AAkQ1T9SNA00AGgG1PUEmqEU9qJptAEZMAsQukCamBhjQxS+VakFW7MUC7wyywscElGyBnekkgqi21Vr6aK+wUaDRdniuFqBrfLuyJ52ECdmQ4pJiCSZvvR952Axd5U0EaME5HCMQqYqqK1SBIPxdyRThQkOwYAD0="
                    ,lVar2,1,uVar3);
      DAT_140316c10 = lVar2;
    }
  }
  else if (param_2 == 0x2716) {
    if (DAT_140316c20 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZGfzCFwAAq3+f/7Z/z7EAeAwDhACAIAACAEAACAQA0qEQ/f81DrAA22wVTxTRkyGBMIZqMhpkGjQDJoNNM1NCJkmQTR6TQGgAANAA0ABoyAkSKmTRpoBoAAAA02oGgANpP1S+4Sm0TxpSQ5QMsW5InKJtlqFDRosAhpNJKFYCWFocIvihsgBgQMcBAwESjgYnp55akR8fP1dNQSYZQ1Vi8SuDBdJyG8kJ7Jo71Ft/FylPAEpKMP1vaycBcMXUVyl4l51Welz2nlt1Oq/E29QvIFuMO6fyy21XSPfBXm5CXppdjP27XYFn/EYLMILlqCjyndaRRn40H28TMLo1heKkBRhRpGY0HG0rjD/F3JFOFCQGfzCFwA=="
                    ,lVar2,1,uVar3);
      DAT_140316c20 = lVar2;
    }
  }
  else if (param_2 == 0x2717) {
    if (DAT_140316c30 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZiQQRkQAAs3+//r9PaRQQAAQgAAAEIACCAAAIQwAEAAAxAEBjQ2IqoACUhkqegnqNDQepiMjTTQaHpqD0gxJqjQAAGgAAD1B6Ei7Egl06ggGCJg2CANlCZ+sJgtrskK6LRsUBSypcEYQ4kFqcUBBLBnfcIBQpnqeYZgGq+LHSGVVdL4Za4nbwCTahDrBe9Yw13YwW0OUY52/pqohehI2IAWEP6/Ixix+fZScUKjcxkid6IFIu5IpwoSESCCMi"
                    ,lVar2,1,uVar3);
      DAT_140316c30 = lVar2;
    }
  }
  else if (param_2 == 0x271a) {
    if (DAT_140316c40 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZ/s621wAAov+//356/qQBFuxAAEgAKoKCAAhQQCAERkKQSSVpynD7sADWxDRTSaR6mAE0yYD1AEYmBPQEYGmg0aeoQ1E0gDQAAAAAAAAAAADTUkGQACYCYAAmABGjAAaGiZwwkyXUEGUVk2SZkoAET8IWXJ0lYBhSC1DXuQzBlEKBcPlKBASGwqcUURNkwFkdY1LlYgByUYIDhpbMW25bwh8hYKBYFkAwb1JA0P70tObW/QYdg6v5cZ2uVKyzdy5WmR3V82uSb6YKWV/z/wL5KhVjH2CQYIs3dgG3Rb6vm3PUAtSuu/Q4wHJkp5XCdu9AF5yo+O0wHjIJMFIMGfiIpBOtLWDJ02WVIjJEYp4KeiAGi0U3e1AeyAAP8XckU4UJD+zrbXA="
                    ,lVar2,1,uVar3);
      DAT_140316c40 = lVar2;
    }
  }
  else if (param_2 == 0x2721) {
    if (DAT_140316c50 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZHxIvxgAAs3/3/r9PfRQQIAQgAAAEIACCABAAAAhDAACxACAnQ2AqoACUhKSnpqZAHqD1GhoZA0A2oaeoGIigAAAAAAAaPUSMGJBMEGQEAiXa04AnO0cabWqsWSoUWAf3wWGvLsuRjE8KKVUKEERw2HciNC3VS5C8D1trt02TEueaDZ2e9QIicVBQPhIfsfWMTzL6riSSWqDmD1IhtQNJH8hMgPH3y59TfJSiBLYwEkDqQA/i7kinChID4kX4wA=="
                    ,lVar2,1,uVar3);
      DAT_140316c50 = lVar2;
    }
  }
  else if (param_2 == 0x2725) {
    if (DAT_140316c60 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs6gCAABCWmgzMUFZJlNZEZqJowABT/fJ/mIgAFAAAQAACAAEAlACgBAAiACgBCAAVCUUANpAyZlBIqDaIaAAfNWIEgkxK5oAvZDhqjytnGE5KjECF3oCAbqCIA21MXrheJNk1b/PnRbKOoQoR+LuSKcKEgIzUTRg"
                    ,lVar2,1,uVar3);
      DAT_140316c60 = lVar2;
    }
  }
  else if (param_2 == 0x272d) {
    if (DAT_140316c70 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZTS0stgAArP////5IA5QAAARDJAAQYooSAABABGBAAMBGCRIgIUFRdC6wAPszBopNqBtI9QAA09QaABpp6Q09RkGqfpFPFPKAAAAAAAAABKnqaSEyYIZGjACaMAEGaA9Rk9w8EoQZ6Jipvgw6QTTWGc8ROaRnoSgh7UC6ikUAhBIk80HJaBz2qieiSIyBRYWFhgQMxYZZDSFGImIH2kR7J5MHta+NDEtT4Jrc5ywGvXtpLCCmOcyihc4+80OtAtPZ7YdUZmIEYiJZgiGxrIGTYUxyN3pICKwxe681AmllvqjfBByz5fqn49LpgCdCjkeQRfHUm+BI0rHBBFDpUcUBFos7yQdEHZOd2VdFBEUAdxdyRThQkE0tLLY="
                    ,lVar2,1,uVar3);
      DAT_140316c70 = lVar2;
    }
  }
  else if (param_2 == 0x275f) {
    if (DAT_140316c80 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZTqGVtwAAof+//358/iYSFk0iQEgAKoICAAgQQGAEZFAwzCUp6nH7sADZIRNU0aNDQAAAZANBo0GhpkGjTI00aNDjJk0aA0aYjI0MQwJo0xBiNBhAAYJTU1JpNAyD1BoyAAAAaNAaNAA0PNU7FVdq9OVOMxMnvpHVaR0muLvuwJUJBXTEqWDBmbKRooays+aAVMjldnQBJPgP0eLlFKlFjkV1+2mQB+vjhBUxRE+CWsJguG0ygWY5FLOcPByuNJFS4nvNbdZeO4lotobUqslB+mxuXWPqDmEi+wAgCQgdLYNSF/RYAR4QamynXmXKPcwMujO2ZALKCqiKorRcPy3DTRUR5o3r0ALyJkfqKEwTonTXIwCKGA/xdyRThQkE6hlbcA=="
                    ,lVar2,1,uVar3);
      DAT_140316c80 = lVar2;
    }
  }
  else if (param_2 == 0x2761) {
    if (DAT_140316c90 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZ5NzhYgAAo/+//374/6QSFCxCAEgAqoICAAhQQCAERkMQlQUp6nD7sADZIQUnpBoAABoADQaANMRo0B6gGmhxoyZGEYgGE0GATQaBkyaMmQwgMJTU0iTQaaGnqDEAAAANABoaaaB4ptJq7llFS1Ud0xJWgzEUVU0yd5TIeKQeKMF2EqZrKaVq0CCGLCYw0aCtTQlRV54EEARnkH9bj0RRIHRDMSDb0EAJyw8Fkn6tFfgjuJIvkNroYNq/c6mPKwssl5+up7sV59pvxLZjaOOrewmE1RAVQExCAtE5CI9c7fs7MAQHm605fz8yim/bvYQW/SbciXkxqJivJAKHpdvq5k6XRIzcKGwb8Cwj7TToD9VK/rsAnQxQmClMN/i7kinChIcm5wsQ"
                    ,lVar2,1,uVar3);
      DAT_140316c90 = lVar2;
    }
  }
  else if (param_2 == 0x2762) {
    if (DAT_140316ca0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZdR8RbgAAoP///35MTmySFkwCAEgCIoISEAAAiFBEIARCQDBINTXiav+wANbENIoNAAAAA0AAAaHqaANDIekInqCjQ0aADRoAAAAAAAAAMVIEwE0waAmjIYAAAE9EGCM00yg5lJBzFDDkGIkggEnfoJYkkwhQghA0hQbMO0LEAJCLAUNMIgvJbAD5ENJlRUBgfQnQZROxEvW4Ra2JdujNgjaVB6jVOrsb8FZZyEWDvoJ0QUbXIW16u6sfBpeBhrJonJpHWw2qsIZ1Wl+UVGeiJd05ZSIt+Zp632s99i7PiAATDfzj5dRH1b7J7IU2mIJqrzPCuNQFa/HIUTMSjhJmV5TgkmADMM5DKhKR6IhtEtptBxxgm0gBcRAPcXckU4UJB1HxFuA="
                    ,lVar2,1,uVar3);
      DAT_140316ca0 = lVar2;
    }
  }
  else if (param_2 == 0x4e89) {
    if (DAT_140316cb0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZ5226KQAAwPK0dAAAAIgAABACQAAQCAAAICAAMQNA0BEVNGh6SWiK9611kUVqI+xEDe75P8uTJ9wXckU4UJDnbbop"
                    ,lVar2,1,uVar3);
      DAT_140316cb0 = lVar2;
    }
  }
  else if (param_2 == 0x4e8a) {
    if (DAT_140316cc0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZ2Lq3bwAAwfCQ/4AQCmAAAkAgAAACIABURPKDQaaeoIpRmo8kBMOygZhMQghycXu11VTcgi94VFuH4Vku0hjIQQp8XckU4UJDYurdvA=="
                    ,lVar2,1,uVar3);
      DAT_140316cc0 = lVar2;
    }
  }
  else if (param_2 == 0x4e8b) {
    if (DAT_140316cd0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZd7qDNgAAwXiRd0IABmAAAIACQCAACAAgAFQkiAAaCJQmj1DQbRsheEIADnmxvwdXKKlZwgLRrAqJ0yUFXqMTOcJLsPDB8XckU4UJB3uoM2A="
                    ,lVar2,1,uVar3);
      DAT_140316cd0 = lVar2;
    }
  }
  else if (param_2 == 0x4e8c) {
    if (DAT_140316ce0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZhVdQsgAAwXiQ/IIQASAAABACQCAAAAEgAFQlT0mgMmgiVNPTU0aFxxhVqCCcR1CrzfWsoC/EaBNwQLdhnTI3Dk1gpB8XckU4UJCFV1Cy"
                    ,lVar2,1,uVar3);
      DAT_140316ce0 = lVar2;
    }
  }
  else if (param_2 == 0x4e9f) {
    if (DAT_140316cf0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,"xYXUgoAAAAAA=",lVar2,1,uVar3);
      DAT_140316cf0 = lVar2;
    }
  }
  else if (param_2 == 0x4f25) {
    if (DAT_140316d00 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZwr1xdwAAv+HQYAAAAKAAAgAgAAACIAAxDAEfqRMlzcUFwCUDpvuy/i7kinChIYV64u4="
                    ,lVar2,1,uVar3);
      DAT_140316d00 = lVar2;
    }
  }
  else if (param_2 == 0x4f2d) {
    if (DAT_140316d10 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZwr1xdwAAv+HQYAAAAKAAAgAgAAACIAAxDAEfqRMlzcUFwCUDpvuy/i7kinChIYV64u4="
                    ,lVar2,1,uVar3);
      DAT_140316d10 = lVar2;
    }
  }
  else if (param_2 == 0x4f31) {
    if (DAT_140316d20 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZXc1e0wABWf//52frMmE2VoIxACoIiCIC0iSggBgIBUAiJDBUAtf5/4awANkhVNqaaGRoAAAADQGgNA0BkyYaRtQaHNMRkZNMmgGQ0ZDJkAAAMjTI0DCGQJFKjRpoNAaANNNBkGmQND1Bo0GgBoZMajaaSQhtJIJ/FhSV5yBSm2ApeVALbDUvoF4aTGK45rFYdtharwS0ZkDen9cVdxVccJJVz4Bwzkey+s5LihRTqDNWbJbZU9HtWBmJkA0WyhB0winSA2REgUYctGqoNNcCzK4c4BA5iJe/BHpUkVwKjFJgCYCsRhcHFxDLE4/8kVYwTvtqdZyJeDHQgSo8Slf3LvVYLpIRQcedeSSI2JJKJiBH+LuSKcKEgu5q9pg="
                    ,lVar2,1,uVar3);
      DAT_140316d20 = lVar2;
    }
  }
  else if (param_2 == 0x4f35) {
    if (DAT_140316d30 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZmPLM2QABWH//52fjIuE+VgIyACBIACAKQCRmggAAKCIj5ShcAhf//8KwALkio1GmgyAAGgA0ABoDQDQNMyTExGhxkwTQyGRkZNDQBoMjCAaDRpkMQ0AG0pKaPUNGhkADQDIAPUAA0GhoaNDT1NqNjSBCbQkLR3NCMrzgvkwFhUYCtsz4oFxMGmKV02Ff7hbaVp4vPexCzGaXBJafVJGlpxqSnBb7BX0sDSweNdJOq0YAMaUNBhWo23+hEId7TK4dThZDkhcfsobqYlyiQG40jkliwAntKgGayoscZBPEF4oH4qi/E6+WJgNeWyz/rNkTmifNqwU+bwil+sTxWQpwpU3rObK/gBXGIAmYJC/xdyRThQkJjyzNkA=="
                    ,lVar2,1,uVar3);
      DAT_140316d30 = lVar2;
    }
  }
  else if (param_2 == 0x4f36) {
    if (DAT_140316d40 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZZb0LtwABWH//52fjMmM/VgIYACBIACYK0yQGkhgALCAmZTRWIlf994KwANkhVPQQ0aAAA0NAAAAAAAaGE9EZNAcNDRk0aNGmhkZDCAMgBkGmgAAZAyAJFRQPRAA9QGgAAADRoAAAA0GnppqNpgkIbECMjZodsR6WCU8YCuLuAJGrJwtBWGKV4295Qh5uqw/ZICPpnwooMy9/qqcZRpxBiRFFgOHdM6sfl1mIylyxm7xTArqkLlWAguHGxEAqD312bBdNBYgX7o5xIppxS2mwPkAidwklGRIQLBMGSAgeIRt4ogcZIPbIiPnVtnoemvj9F9O3/vWTXlqZVPinTakE6aSGrLGQiz5o6ySRM0hJabQhH+LuSKcKEgy3oXbg"
                    ,lVar2,1,uVar3);
      DAT_140316d40 = lVar2;
    }
  }
  else if (param_2 == 0x4f38) {
    if (DAT_140316d50 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZBODCLwABWv//52frKmU2VoI3ASIIBqBCwiYRgCgEmKRiJDhYAhf598KwANmzEREGgAAAAAAAAAAAD1AxNDahiZGgADTQA000DQaNGmgABoNAB6jI9TIMkonpGEaBgEwCYRkYAEYEYAJggyMiIUIAJCIQSB30qrHmGdYlkEABa9igNyAP1yhwQm4pQP6kFCM6b0A3cL64pyhQHcgi+mGysLqALV0Awx0uXmMbV54pHWWF5wQZwPgOiyBYXPcAwiJqvsZIkLUVEL5VQBApCkKIjwjILljkjbLmreFfce8bXUYBEYvMOKRI5xOPU2iNKmicRNV3GdwpfXcTkfeWJlMWlQNR9lPS+qpIDL+MNCe+/CEIQJjEAAAAUZJIH+LuSKcKEgCcGEXg"
                    ,lVar2,1,uVar3);
      DAT_140316d50 = lVar2;
    }
  }
  else if (param_2 == 0x4f3c) {
    if (DAT_140316d60 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZ+l25SAABWX//52ZromE2VoISECIIaC4SWiAAgYAADCggJDDeAxf/9wKwANkhhPU9E0AAA00AANAAAyGgZPSYZIHNGjQ0wgGmBNNAGQ0MQBoxGhgjIAJFJQ0aAADTI9QAGQ0NGhoANAAbCjaYkhDYAiPgoRst3aKLbQLCx4IkapxQJhgMaJnUYrluBKwtMdAgGdlQI6/L1flexRFenEi8KKT6qAErq7oOmzCDDEj/Dtzh7r0tKm2xDCWkQWV0IfywCKkZ0uNKQzw8cXJdM1YwpdDsP2i0cIS4LiNcAR3nGRSTmDID4fht+bgl/Y/exeT71WLAnuRSdpIRHCMGbc+nKAKZiSSnaAR/i7kinChIfS7cpAA="
                    ,lVar2,1,uVar3);
      DAT_140316d60 = lVar2;
    }
  }
  else if (param_2 == 0x4f3d) {
    if (DAT_140316d70 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZbVQvywABWH/f52ZrsnM21oIWCCIIACoCQiQAgAwoYiRw2goX/feGsADZIVTE2kaNAAAAAAaAB6gNNDMownqGhzRo0NMIBpgTTQBkNDEAaMRoYIyACRSkzUADQDTI0GmgAD1GQZAABo09TyjaYJCGxAitvxVmeM9F+xsBYdGCLrVWdAlGAxokdVi/PKB+sLLcRBGczU4o+m5ZL0URHUNBmMAIShymxWaU/aclBGekynLKesmaDDR9LjKF1i9kXzjKgg54a0IhNYALBvEEZgH3CcsBVok94Aji51umM5tdtkjgWDEa3Z5c+yfvS9eXAmqQlwZrt5Jck7yQnm8MGbVibV/gBSsEkpmkCP8XckU4UJBtVC/L"
                    ,lVar2,1,uVar3);
      DAT_140316d70 = lVar2;
    }
  }
  else if (param_2 == 0x4f42) {
    if (DAT_140316d80 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs7ECAABCWmgzMUFZJlNZtx1LJAABRP3//O5rMusyVAAyAAKAIkAghJAgQAAAAiAhUAKF6fcEsAC5IamonqaAaAMhoBpoDQGnqepk2o9TIcwmATACYTCaYAABMmmgYSKSCYmIwmjCNNDAhiGAQzRo2mAIIMSCWwiYomkB1QgHg8bmu9P1RI2siZRagxDaSO2vBBQcbXnKgigwDkwXDZALIAYStkAHSNETGJCbS6KCZ+dHIG1tPk6TapZVnVJumvIgaCYeD8R0o9siVjwymJiFxces807U8Z1K0SGAE5GMABG0kL5jgLgwFzZI0BI0rb5sCRiR0F3JFOFCQtx1LJA="
                    ,lVar2,1,uVar3);
      DAT_140316d80 = lVar2;
    }
  }
  else if (param_2 == 0x4f49) {
    if (DAT_140316d90 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZo11K5AABWX//52frIm0+XoIWkCIIADIGQiQBkCAA2CBqJDhaAif59xKwANkhUIaeiAANAAAAyaANAAZNNGNRhAcDQaZDTRoYQMhoYI0NMmjQDIMQABoJFKTTQ0AADQAAAAA0ADRoAHtCjaYkhDYAjQ3dqtZlexSpjAV1fQCRhlUIEzSYxSvL44I9HFh1NOkQJGYzM687apSFROFh5LcrKaEdQxssN9B0/Z1sGNlprEANOm+xEHxm8RQxra/pHzWqBCkiquL60+6FsA38MJipIFkyBmKrKoFGhVw+Bd1nJw4Fz2il8BIhwpHRwMivi/tW0mnhTnkoR/IxJaO4OsyBk4cqSRM0kkp2gEf4u5IpwoSFGupXIA=="
                    ,lVar2,1,uVar3);
      DAT_140316d90 = lVar2;
    }
  }
  else if (param_2 == 0x4fc4) {
    if (DAT_140316da0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs+oCAABCWmgzMUFZJlNZubxI3gABXf3///73MmMyVAASgAAIBkBkAIAJARAAQCAgVEJN6/eGsAEYlQ01Ik02k0yYRkxGJhHpkCZPU9TNTAeptTQOaZGQyYIaMJgjTRoxA0yZGAAIJCpMhAAANAAAaAAeoANDRtUQoYA2JDY2RiUaQKqKMQNlJI4SJtDGTOhQ1isLFqBZYUtIs02qFnullxhgNCKmrbOHZxDwsJYwxCzNGI+2GxRDNYE8ogYfQ1T4FEXqVGUQWjfKOEAOlREP9Rjb1tceeZdueyY+Q7x3Mb34lDKS6rQUkNL/fagPz4xw15UnWXJplRNxVYERC82kB1sSFXdu3sHqrgRgHS0T6tirL0XLU9qlULK5a4HPOaABwIQcygYQx5QjIDxRK5DD1IHR+7QX2IvtIw2L/F3JFOFCQubxI3g="
                    ,lVar2,1,uVar3);
      DAT_140316da0 = lVar2;
    }
  }
  else if (param_2 == 0x4fc7) {
    if (DAT_140316db0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs+0CAABCWmgzMUFZJlNZfAS/SQABXv/n/+/jImMyVAAAEBAAIAACxCCAhQIgIFIGJen3EbAA8RiNJJkaBoBppoyGgAGgxA0zTUGakVPapoZMIaGgaNNNA0AZNBiGGkppoZGhgRpoBowmRiYEAD1AZACbYJNqQ21AmoG1AmDgUAgGwTdgcCqnCVQkE6Qkp015KVKpNKQ2gSYMpOeLYftSBPaASSrkDasShq3uwmtA0+sggCnMqDIFEc5iYwHTz3EOmPu+2sAu0wsEtwRR8sCaiJmrqVxu1/vmxLBF9Ph0QITcgRb8wrdXkPWp+7i76ip0MxMRq7OqjIAiLaYAAbMF710VhaDKFVH2SKc5WPipEwSapU0q7iFUPtBc9oEAcwIAHMAcxAiH8XckU4UJB8BL9JA="
                    ,lVar2,1,uVar3);
      DAT_140316db0 = lVar2;
    }
  }
  else if (param_2 == 0x4fc8) {
    if (DAT_140316dc0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs5ACAABCWmgzMUFZJlNZJYXNbwABL3/P9e5rtnM2VAoCCAAIQYgCQCAAoEIkIHMqd+n3hLAA2SFT1JggaGgDTQANNNAMhoaGGk9TI2ocZMmhiMTRgEYCYQBgJpo0yNAMJFKT0gaNHqZNGjTTQBkABoDE0YGmp6bTUASS02CI2iJg2qbgyJiUGADfXq8jV7QDXabG0AR6kAJGcTnMsMAzNBkuQJGCEqGQE7ZohMAY2HTW4pIe9GdGM9uNmrIey8aJgkCZzLxUhwro8OLrWlyoj1CAH5XZhfpMSUTiKk02lEt+hXQKskWUaBGiKvjAxJLfaAWbZlJpogUrEpGuPDCViJWvFoJmIJmAGcXckU4UJAlhc1vA"
                    ,lVar2,1,uVar3);
      DAT_140316dc0 = lVar2;
    }
  }
  else if (param_2 == 0x5166) {
    if (DAT_140316dd0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs/MCAABCWmgzMUFZJlNZJ+e/4wABZv/n937zsmMyVAASAAIAQQgCYCAAgYAgIHCCTen3BLAAuSGpop6mgAaaAANAMQAyDyNTIcwmATACYTCaYAABMmmgYRKUmgNqBppiGgBoZA0aaABppIxABpBc6VorXghXjV1b+lxwyZ42JINTAbOsFFb8NiLtXKAH7GqtRU0ImWK/eSiwgYYSdcqoA3EDC6T8PLv4tsa9EiM/aN9tiXiDa+CmJVAdZLePz6O/IUxKOaXAiKd7KBxn3OmWZqZaZJMqwYwxEDAA64CB7bNP6xQQyxVzQM0VD/F3JFOFCQJ+e/4w"
                    ,lVar2,1,uVar3);
      DAT_140316dd0 = lVar2;
    }
  }
  else if (param_2 == 0x5182) {
    if (DAT_140316de0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZ4GNTkwAAs3W//vKnDgIBQAAgAAIAABBAAAAIAEJQAoYA8BqwALgMAMmmgyGCGmI0YMAMmmgyGCGmI0YEiUp+pNkxR5Jg1HqaHobU9UsahCUmrmJWsMLJKV0Kt2qPjbc0lkw4s2MyvhYNBW0hsG0aDQEDBeTrAEFR4KqHIg7jKDqMS9mR6FY2TMyhggR1aFN+rQDNYSMqgIBzYRpGducg0nAtk4ju48azxpIKNCP8XckU4UJDgY1OTA=="
                    ,lVar2,1,uVar3);
      DAT_140316de0 = lVar2;
    }
  }
  else if (param_2 == 0x5187) {
    if (DAT_140316df0 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZDkAblQABWv/v52frIvE2XApQCQAIQCJCQiQggAIgYGIgVAJn+/+GsADZbDIaaAaaaMjRiAwjIaaGmBAyGmj1G0mQybRPUaNMg0AyDIMmhpoGI0aDE0ep6gMEipRtRpkGj1AyZANAD1G1MEYgAB6mNG00AkNoSDTj0pZ55QpUBpIpOJhC1WyoFjTQ2Bhe20vBkrP5wjFoRQG7HJZPvvnizFIzrZiZhDoeffwNwYQjwxuDF93fmN2ANgQTegC/6FAzbiqmT46gAGTe4m945ojfqYevmmEh+5x7jxhIF4AbECNQK+IqWIEZQyd2GERa/73d15IZq8GtQ/ZsM7F/x0sQ5yzm2V5tnGkkTNAAerSSDILuSKcKEgHIA3Kg"
                    ,lVar2,1,uVar3);
      DAT_140316df0 = lVar2;
    }
  }
  else if (param_2 == 0x5190) {
    if (DAT_140316e00 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZDGAeAAABY3///v/jpmsy3YAeAAQQIQACUCAAkVBEEACEMCB4A8Xp9xewAPiQxiEyAAA0aDQAaaAANAGEZMT1Mhw0MmmhpkaGmRkGRkaGQGJoyaAMmRiGEiiU00bUBp6gGgAPUAAAAAADI8pM4ISRFoQ2AIg1bNJK4aAka27mdnjIio20FRhdNKDXUwmxKsUH41nyQrsdeAgssoYHgyX7jEotQhuQ6GFZrLc7mZbnrLEpn5o5jRfsM5gKJqeFZdAZrInRcnTxlEewENZXBN5xiIOA5HDpqBSbZFsXXUV6KIh3ndSjxdwFgVA/WZ8FeQcUBrHpmPJVDnmDPRfZ66y0+PE0SSJWWhAS1qIoLVEAKGgVLEj3YUtIqtCCliP8XckU4UJAMYB4AA=="
                    ,lVar2,1,uVar3);
      DAT_140316e00 = lVar2;
    }
  }
  else if (param_2 == 0x51a9) {
    if (DAT_140316e10 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs+0CAABCWmgzMUFZJlNZt84lfwABTX//+mfzq+WyVAlcgAAUAAJHQqQAxACApggApStxFlXp9wewAPiIhJMmTTRMjTBPSYCYEwINMABNoAJ+k1PyhocGQaNAGTTENNBkGIYQNAaMTEaAAASJKjIA0APUaAAAAAAAAaADTRo2mIBSkQghihgE5gSaUmm4aKyUDGpNVrQ2CgrosnXuZhPbZOY2CVi8HXobdqUpwqDbAVndwFNhYSg/RoVRwMVJ/jKbSmayGrwKCiAvsXsxy2k8jqWXCxmfg1ZeDiOtdJ4Ep/7L1GPfQ3/KWujgYeb3QSfoiGZq0VTD5p/lPtjTSW0+6KJlcZS8M6f6S2rLfnYZSsqdW0AV7bHG21Ga9QSAYewREQKQBAR/m+RWzOrYFQPUX6dMpq5znuRVWf0+KjS1WkEzRbNCqsKrQhH+LuSKcKEhb5xK/g=="
                    ,lVar2,1,uVar3);
      DAT_140316e10 = lVar2;
    }
  }
  else if (param_2 == 0x51bc) {
    if (DAT_140316e20 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs/8CAABCWmgzMUFZJlNZbjaSrAABWf/f/2djtuOzXoASASoIBSICQiQAkQwwIiQwfELn6dcGsAD5EGoapmkIyYTJo9IyaMQMnqMmJo9JiMmBo9CjaT1DmmIyMmmTQDIaMhkyAAAGRpkaBhDIEipT0mg00GmgaaA0aaAyAGgAGIBpjRpJrgEkikwCFoAbAUppQsSksIWkTWiBggfJK2mXZCMdjYBmsDLYrrVCGAjGAw4MmagG3aUCA4C/whBwZmr63cX62EuXIwMQ9qiAOrHmJ3Hnwc0GnodiulxTYn1uuc9Ja2dg/m+peBS5mlWiBQ53tFtg6Xg3YwNTNetgah9vkHNCiZn+ROQoqpklqO/hqb1M74elMO2Pw/jzYdCxSGDoOPC/EAomhJYN6LIuSFE0BGwRgO8wLjQr7FfYJB/i7kinChINxtJVgA=="
                    ,lVar2,1,uVar3);
      DAT_140316e20 = lVar2;
    }
  }
  else if (param_2 == 0x5221) {
    if (DAT_140316e30 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUswIDAABCWmgzMUFZJlNZQ/MZFgABY3/////jpmsy3YAeAAQQIQACUCAAkVBEEACEMCB4A8Xp9xewAPiQxpoTIAADTIAAyAABoaDCMmJ6mQ5o0aGmEA0wJpoAyGhiANGI0MEZABIolD1G1ADQaAAHqAAaAAAAGR5Sq4ISRFoQ2AIg1K0kpWgJGty4nZ4yIuW2gtWF00oNdTCriyxQfjWhJDAY7uAgsMoYHgyb7jEoswhuw6GFRrMc7wWWx6zRKZ+aOa0XzDPYIsmZEVl0BGMhdDzdOESN7AM1mcC3oEEY0DkcjUeQk2yHauumr1TsEJmqEnB7gKAqB+qz4J8g4oCWOxlvJHmvMF+ilHrrLT4kWhxxKw0ICapRFBZa/qICSpYkezClpErQgpYj/F3JFOFCQQ/MZFg="
                    ,lVar2,1,uVar3);
      DAT_140316e30 = lVar2;
    }
  }
  else if (param_2 == 0x556a) {
    if (DAT_140316e40 == 0) {
      pvVar1 = operator_new(0x18);
      if (pvVar1 == (void *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = FUN_14010cb50(pvVar1);
      }
      FUN_14010cbf0(lVar2,0x10d);
      FUN_1400c3a90(param_1,
                    "c4aeUs4UBAABCWmgzMUFZJlNZepb/rQAAsv3//vKnDgoBEABAACAAAgAAQAAQQAAACAAA0AKGQOAasAC4DDQyGmTQDENNNGhoww0Mhpk0AxDTTRoaMEiKak9T9UeoyHqHqHpDQaeNUq1AFwykQlg0jcMbDh0zuW/CFL61GN+DA6hq4aWdYDzZeyc+2VwYsmkv0YioxLY+YFBJoSFjIgOYyw5MTftBmUKjZccSx3JC+GAavoeTQF5y0oUKJDUHGUQAwevqSSD/I+q3I5NatU0gjm4/ra7Y0CzEj/F3JFOFCQepb/rQ"
                    ,lVar2,1,uVar3);
      DAT_140316e40 = lVar2;
    }
  }
  else if ((param_2 == 0x96c6) && (DAT_140316e50 == 0)) {
    pvVar1 = operator_new(0x18);
    if (pvVar1 == (void *)0x0) {
      lVar2 = 0;
    }
    else {
      lVar2 = FUN_14010cb50(pvVar1);
    }
    FUN_14010cbf0(lVar2,0x10d);
    FUN_1400c3a90(param_1,
                  "c4aeUs4UBAABCWmgzMUFZJlNZO5yhiQAAvnPD9ABAM0GCAAEgAAIAQABAoAIEEAAgAFQkkg0BiHigk1UAaNAAsQ4YSS1kUgLBSBg0vsNUKOiSIWaA3ZAC2Bg+aL0e1Hico9l5nVfi7kinChIHc5QxIA=="
                  ,lVar2,1,uVar3);
    DAT_140316e50 = lVar2;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400c6810(undefined8 param_1,undefined8 param_2,longlong param_3)

{
  char cVar1;
  char cVar2;
  undefined2 *puVar3;
  int iVar4;
  undefined1 auStack_88 [32];
  int *local_68;
  char local_58 [4];
  undefined2 local_54;
  int local_50 [2];
  undefined2 local_48;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  local_58[0] = '\x01';
  cVar1 = FUN_140102de0();
  cVar2 = FUN_1401422b0(param_2);
  puVar3 = (undefined2 *)(param_3 + 10);
  iVar4 = 1;
  do {
    if ((cVar2 == '\0') || (0x7f < iVar4)) {
      local_68 = local_50;
      local_50[0] = 0;
      FUN_14010d220(param_2,local_58,1,&local_48);
      if (local_50[0] == 2) {
        if (cVar1 == '\0') {
          *puVar3 = local_48;
        }
        else {
          local_54 = CONCAT11((undefined1)local_48,local_48._1_1_);
          *puVar3 = local_54;
        }
      }
      else {
        *puVar3 = 0;
      }
    }
    else {
      *puVar3 = (short)iVar4;
    }
    local_58[0] = local_58[0] + '\x01';
    iVar4 = iVar4 + 1;
    puVar3 = puVar3 + 1;
  } while (iVar4 < 0x100);
  return;
}


/*
Unable to decompile 'FUN_1400c6910'
Cause: Exception while decompiling 1400c6910: process: timeout

*/


undefined8 * FUN_1400caf10(undefined8 *param_1,uint param_2)

{
  *param_1 = EncodingConvert::vftable;
  FUN_1400bceb0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_1400caf60(longlong param_1,longlong param_2,byte *param_3,uint param_4,undefined8 param_5)

{
  short sVar1;
  undefined8 uVar2;
  longlong lVar3;
  byte *pbVar4;
  ulonglong uVar5;
  uint uVar6;
  undefined1 auStack_288 [32];
  char local_268;
  undefined2 local_264;
  longlong local_260;
  undefined1 local_258 [528];
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_288;
  uVar5 = (ulonglong)param_4;
  local_260 = param_2;
  FUN_1400bbe50(param_1 + 0x88,0x46);
  if ((param_3 == (byte *)0x0) || (param_4 == 0)) {
    uVar2 = 1;
  }
  else {
    local_268 = FUN_140102de0();
    uVar6 = 0;
    lVar3 = 0;
    uVar2 = 1;
    pbVar4 = param_3;
    if (param_4 != 0) {
      do {
        if (*pbVar4 == 0) {
          local_258[lVar3] = 0;
          local_258[lVar3 + 1] = 0;
LAB_1400cb038:
          uVar6 = uVar6 + 2;
          lVar3 = lVar3 + 2;
          if (0x1ff < uVar6) {
            FUN_1400b97e0(param_5,local_258,uVar6);
            uVar6 = 0;
            lVar3 = 0;
          }
        }
        else {
          sVar1 = *(short *)(local_260 + 8 + (ulonglong)*pbVar4 * 2);
          local_264 = sVar1;
          if (sVar1 != 0) {
            local_264._1_1_ = (undefined1)((ushort)sVar1 >> 8);
            if (local_268 == '\0') {
              local_258[lVar3] = (char)sVar1;
              local_258[lVar3 + 1] = local_264._1_1_;
            }
            else {
              local_258[lVar3] = local_264._1_1_;
              local_258[lVar3 + 1] = (char)sVar1;
            }
            goto LAB_1400cb038;
          }
          if (*(int *)(param_1 + 0xc) != 0) {
            if (uVar6 != 0) {
              FUN_1400b97e0(param_5,local_258,uVar6);
              uVar6 = 0;
              lVar3 = 0;
            }
            FUN_1400c2cf0(param_1,param_3,param_5);
          }
          uVar2 = 0;
        }
        uVar5 = uVar5 - 1;
        pbVar4 = pbVar4 + 1;
      } while (uVar5 != 0);
      if (uVar6 != 0) {
        FUN_1400b97e0(param_5,local_258,uVar6);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_1400cb100(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  int iVar1;
  int iVar2;
  int iVar3;
  undefined8 uVar4;
  
  iVar1 = *(int *)(param_1 + 0x7c);
  if (((((iVar1 == 0x3a4) || (iVar1 == 0x3a8)) || (iVar1 == 0x3b5)) ||
      ((iVar1 == 0x3b6 || (iVar1 == 0xcadc)))) || ((iVar1 == 0xcae0 || (iVar1 == 0xcaed)))) {
    iVar2 = *(int *)(param_1 + 0xc);
    if (iVar2 == 7) {
      if (*(char *)(param_1 + 0x84) != '\0') {
        FUN_1400b9550(param_3,0xfd);
        FUN_1400b9550(param_3,0xef);
        FUN_1400b9550(param_3,2);
      }
      FUN_1400b97e0(param_3,param_2,2);
    }
    else if ((iVar2 == 1) && (*(int *)(param_1 + 0x14) != 0)) {
      if (*(char *)(param_1 + 0x84) != '\0') {
        FUN_1400b9550(param_3,0xfd);
        FUN_1400b9550(param_3,0xef);
        FUN_1400b9550(param_3,*(undefined1 *)(param_1 + 0x14));
      }
      FUN_1400b97e0(param_3,param_1 + 0x18,*(undefined4 *)(param_1 + 0x14));
    }
    else if (iVar2 == 2) {
      if (*(char *)(param_1 + 0x84) != '\0') {
        FUN_1400b9550(param_3,0xfd);
        FUN_1400b9550(param_3,0xef);
        FUN_1400b9550(param_3,6);
      }
      FUN_1400b9550(param_3,0x26);
      FUN_1400b9550(param_3,0x23);
      FUN_1400b9550(param_3,0x78);
      FUN_1400c28a0(param_1,param_2,2,param_3);
      FUN_1400b9550(param_3,0x3b);
    }
    else if ((iVar2 == 6) && (*(char *)(param_1 + 0x85) == '\0')) {
      iVar2 = *(int *)(param_1 + 0x80);
      *(undefined4 *)(param_1 + 0xc) = 0;
      iVar3 = iVar2;
      if (*(int *)(param_1 + 0x10) != 0) {
        iVar3 = *(int *)(param_1 + 0x10);
      }
      FUN_1400cded0(param_1,iVar1,iVar3,param_2,2,param_3);
      *(int *)(param_1 + 0x80) = iVar2;
      *(undefined4 *)(param_1 + 0xc) = 6;
      *(int *)(param_1 + 0x7c) = iVar1;
    }
    uVar4 = 2;
  }
  else {
    FUN_1400c2cf0();
    uVar4 = 1;
  }
  return uVar4;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_1400cb2e0(longlong param_1,longlong param_2,longlong param_3,uint param_4,undefined8 param_5)

{
  longlong lVar1;
  longlong lVar2;
  char cVar3;
  int iVar4;
  undefined8 uVar5;
  undefined1 *puVar6;
  byte *pbVar7;
  uint uVar8;
  ulonglong uVar9;
  undefined1 auStack_98 [32];
  int *local_78;
  undefined1 local_68 [4];
  int local_64;
  longlong local_60;
  longlong local_58;
  undefined1 local_50 [16];
  ulonglong local_40;
  
  local_40 = DAT_1402f85a0 ^ (ulonglong)auStack_98;
  local_60 = param_2;
  local_58 = param_3;
  FUN_1400bbe50(param_1 + 0x88,0x48);
  if (param_2 == 0) {
    uVar5 = 0;
  }
  else if ((param_3 == 0) || (param_4 == 0)) {
    uVar5 = 1;
  }
  else {
    cVar3 = FUN_1401422b0(param_2);
    uVar9 = 0;
    local_64 = 0;
    local_68[0] = 0;
    uVar5 = 1;
    if (param_4 != 0) {
      do {
        lVar2 = local_58;
        uVar8 = (uint)uVar9;
        if (uVar8 == param_4 - 1) {
          lVar1 = uVar9 + local_58;
          if (*(byte *)(uVar9 + local_58) == 0) {
            puVar6 = local_68;
          }
          else {
            if ((cVar3 == '\0') || (0x7f < *(byte *)(uVar9 + local_58))) {
              local_78 = &local_64;
              FUN_14010d220(local_60,lVar1,1,local_50);
              if (local_64 == 0) {
                if (*(int *)(param_1 + 0xc) != 0) {
                  FUN_1400c2cf0(param_1,lVar1,param_5);
                }
                uVar5 = 0;
                iVar4 = 1;
                goto LAB_1400cb582;
              }
LAB_1400cb55e:
              FUN_1400b97e0(param_5,local_50);
              iVar4 = 1;
              goto LAB_1400cb582;
            }
LAB_1400cb3ac:
            puVar6 = (undefined1 *)(uVar9 + lVar2);
          }
LAB_1400cb3af:
          FUN_1400b97e0(param_5,puVar6,1);
          FUN_1400b97e0(param_5,local_68,1);
          iVar4 = 1;
        }
        else {
          local_78 = &local_64;
          pbVar7 = (byte *)(uVar9 + local_58);
          FUN_14010d220(local_60,pbVar7,2,local_50);
          if (local_64 == 0) {
            if (uVar8 < param_4 - 2) {
              local_78 = &local_64;
              FUN_14010d220(local_60,pbVar7,3,local_50);
              if (local_64 != 0) {
                FUN_1400b97e0(param_5,local_50);
                iVar4 = 3;
                goto LAB_1400cb582;
              }
              if (uVar8 < param_4 - 3) {
                local_78 = &local_64;
                local_64 = 0;
                FUN_14010d220(local_60,pbVar7,4,local_50);
                if (local_64 != 0) {
                  FUN_1400b97e0(param_5,local_50);
                  iVar4 = 4;
                  goto LAB_1400cb582;
                }
              }
            }
            if (*pbVar7 == 0) {
              puVar6 = local_68;
              goto LAB_1400cb3af;
            }
            if ((cVar3 != '\0') && (*pbVar7 < 0x80)) goto LAB_1400cb3ac;
            local_78 = &local_64;
            FUN_14010d220(local_60,pbVar7,1,local_50);
            if (local_64 != 0) goto LAB_1400cb55e;
            if (*(int *)(param_1 + 0xc) == 0) {
              iVar4 = 1;
              uVar5 = 0;
            }
            else {
              iVar4 = FUN_1400cb100(param_1,pbVar7,param_5);
              uVar5 = 0;
            }
          }
          else {
            FUN_1400b97e0(param_5,local_50);
            iVar4 = 2;
          }
        }
LAB_1400cb582:
        uVar9 = (ulonglong)(uVar8 + iVar4);
      } while (uVar8 + iVar4 < param_4);
    }
  }
  return uVar5;
}



undefined1 FUN_1400cb5c0(longlong param_1,int param_2,byte *param_3,uint param_4,undefined8 param_5)

{
  undefined1 uVar1;
  void *pvVar2;
  longlong lVar3;
  undefined8 uVar4;
  ulonglong uVar5;
  
  uVar5 = (ulonglong)param_4;
  FUN_1400bbe50(param_1 + 0x88,0x43);
  if ((param_3 == (byte *)0x0) || (param_4 == 0)) {
    uVar1 = 1;
  }
  else {
    FUN_1400c3c50(param_1,param_2);
    if (param_2 == 0x6faf) {
      uVar1 = FUN_1400c2ed0(param_1,DAT_140316860,param_3,uVar5,param_5);
    }
    else if (param_2 == 0x6fb0) {
      uVar1 = FUN_1400c2ed0(param_1,DAT_140316870,param_3,param_4,param_5);
    }
    else if (param_2 == 0x6fb1) {
      uVar1 = FUN_1400c2ed0(param_1,DAT_140316880,param_3,param_4,param_5);
    }
    else if (param_2 == 0x6fb2) {
      uVar1 = FUN_1400c2ed0(param_1,DAT_140316890,param_3,param_4,param_5);
    }
    else if (param_2 == 0x6fb3) {
      uVar1 = FUN_1400c2ed0(param_1,DAT_1403168a0,param_3,param_4,param_5);
    }
    else if (param_2 == 0x6fb4) {
      pvVar2 = operator_new(uVar5);
      if (param_4 != 0) {
        lVar3 = (longlong)pvVar2 - (longlong)param_3;
        uVar5 = (ulonglong)((param_4 - 1 >> 1) + 1);
        do {
          if (param_3[1] == 6) {
            if ((*param_3 < 0x60) || (0x69 < *param_3)) {
              if ((*param_3 < 0xf0) || (0xf9 < *param_3)) goto LAB_1400cb756;
              param_3[lVar3 + 1] = 0;
              param_3[lVar3] = *param_3 + 0x40;
            }
            else {
              param_3[lVar3 + 1] = 0;
              param_3[lVar3] = *param_3 - 0x30;
            }
          }
          else {
LAB_1400cb756:
            param_3[lVar3] = *param_3;
            param_3[lVar3 + 1] = param_3[1];
          }
          param_3 = param_3 + 2;
          uVar5 = uVar5 - 1;
        } while (uVar5 != 0);
      }
      uVar1 = FUN_1400c2ed0(param_1,DAT_1403168b0,pvVar2,param_4,param_5);
      operator_delete(pvVar2);
    }
    else {
      uVar4 = DAT_1403168c0;
      if ((((((param_2 != 0x6fb5) && (uVar4 = DAT_1403168d0, param_2 != 0x6fb6)) &&
            (uVar4 = DAT_1403168e0, param_2 != 0x6fb7)) &&
           (((uVar4 = DAT_140316910, param_2 != 0x6fbb && (uVar4 = DAT_140316920, param_2 != 0x6fbd)
             ) && ((uVar4 = DAT_140316930, param_2 != 0x4e2 &&
                   ((uVar4 = DAT_140316940, param_2 != 0x4e3 &&
                    (uVar4 = DAT_140316950, param_2 != 0x4e4)))))))) &&
          (uVar4 = DAT_140316960, param_2 != 0x4e5)) &&
         ((uVar4 = DAT_140316970, param_2 != 0x4e6 && (uVar4 = DAT_140316980, param_2 != 0x4e7)))) {
        if (param_2 == 0x4e8) {
          pvVar2 = operator_new(uVar5);
          if (param_4 != 0) {
            lVar3 = (longlong)pvVar2 - (longlong)param_3;
            uVar5 = (ulonglong)((param_4 - 1 >> 1) + 1);
            do {
              if (param_3[1] == 6) {
                if ((*param_3 < 0x60) || (0x69 < *param_3)) {
                  if ((*param_3 < 0xf0) || (0xf9 < *param_3)) goto LAB_1400cb9b2;
                  param_3[lVar3 + 1] = 0;
                  param_3[lVar3] = *param_3 + 0x40;
                }
                else {
                  param_3[lVar3 + 1] = 0;
                  param_3[lVar3] = *param_3 - 0x30;
                }
              }
              else {
LAB_1400cb9b2:
                param_3[lVar3] = *param_3;
                param_3[lVar3 + 1] = param_3[1];
              }
              param_3 = param_3 + 2;
              uVar5 = uVar5 - 1;
            } while (uVar5 != 0);
          }
          uVar1 = FUN_1400c2ed0(param_1,DAT_140316990,pvVar2,param_4,param_5);
          operator_delete(pvVar2);
          return uVar1;
        }
        uVar4 = DAT_1403169a0;
        if ((((((((param_2 != 0x4e9) && (uVar4 = DAT_1403169b0, param_2 != 0x4ea)) &&
                (uVar4 = DAT_140316e60, param_2 != 0x3a4)) &&
               ((uVar4 = DAT_140316eb0, param_2 != 0x3a8 &&
                (uVar4 = DAT_140316e80, param_2 != 0x3b5)))) &&
              ((uVar4 = DAT_140316ea0, param_2 != 0x3b6 &&
               ((uVar4 = DAT_140316ec0, param_2 != 0xcadc &&
                (uVar4 = DAT_140316ed0, param_2 != 0xcae0)))))) &&
             (((uVar4 = DAT_140316ee0, param_2 != 0xcaed &&
               (((uVar4 = DAT_140316e90, param_2 != 0x551 &&
                 (uVar4 = DAT_140316e70, param_2 != 0x2711)) &&
                (uVar4 = DAT_1403169c0, param_2 != 0x25)))) &&
              (((((uVar4 = DAT_1403169d0, param_2 != 0x1b5 &&
                  (uVar4 = DAT_1403169e0, param_2 != 500)) &&
                 ((uVar4 = DAT_1403169f0, param_2 != 0x2c4 &&
                  ((uVar4 = DAT_140316a00, param_2 != 0x2d0 &&
                   (uVar4 = DAT_140316a10, param_2 != 0x2e1)))))) &&
                (uVar4 = DAT_140316a20, param_2 != 0x307)) &&
               (((((uVar4 = DAT_140316a30, param_2 != 0x352 &&
                   (uVar4 = DAT_140316a40, param_2 != 0x354)) &&
                  (uVar4 = DAT_140316a50, param_2 != 0x357)) &&
                 ((uVar4 = DAT_140316a60, param_2 != 0x359 &&
                  (uVar4 = DAT_140316a70, param_2 != 0x35a)))) &&
                (((uVar4 = DAT_140316a80, param_2 != 0x35c &&
                  ((uVar4 = DAT_140316a90, param_2 != 0x35d &&
                   (uVar4 = DAT_140316aa0, param_2 != 0x35e)))) &&
                 (uVar4 = DAT_140316ab0, param_2 != 0x35f)))))))))) &&
            (((((((uVar4 = DAT_140316ac0, param_2 != 0x360 &&
                  (uVar4 = DAT_140316ad0, param_2 != 0x361)) &&
                 (uVar4 = DAT_140316ae0, param_2 != 0x362)) &&
                ((uVar4 = DAT_140316af0, param_2 != 0x365 &&
                 (uVar4 = DAT_140316b00, param_2 != 0x366)))) &&
               (((((uVar4 = DAT_140316b10, param_2 != 0x36a &&
                   ((uVar4 = DAT_140316b20, param_2 != 0x36b &&
                    (uVar4 = DAT_140316b30, param_2 != 0x402)))) &&
                  (uVar4 = DAT_140316b40, param_2 != 0x417)) &&
                 ((((uVar4 = DAT_140316b50, param_2 != 0x474 &&
                    (uVar4 = DAT_140316b60, param_2 != 0x475)) &&
                   (uVar4 = DAT_140316b70, param_2 != 0x476)) &&
                  (((uVar4 = DAT_140316b80, param_2 != 0x477 &&
                    (uVar4 = DAT_140316b90, param_2 != 0x478)) &&
                   ((uVar4 = DAT_140316ba0, param_2 != 0x479 &&
                    ((uVar4 = DAT_140316bb0, param_2 != 0x47a &&
                     (uVar4 = DAT_140316bc0, param_2 != 0x47b)))))))))) &&
                ((uVar4 = DAT_140316bd0, param_2 != 0x47c &&
                 (((uVar4 = DAT_140316be0, param_2 != 0x47d &&
                   (uVar4 = DAT_140316bf0, param_2 != 10000)) &&
                  (uVar4 = DAT_140316c00, param_2 != 0x2714)))))))) &&
              ((((uVar4 = DAT_140316c10, param_2 != 0x2715 &&
                 (uVar4 = DAT_140316c20, param_2 != 0x2716)) &&
                ((uVar4 = DAT_140316c30, param_2 != 0x2717 &&
                 ((uVar4 = DAT_140316c40, param_2 != 0x271a &&
                  (uVar4 = DAT_140316c50, param_2 != 0x2721)))))) &&
               ((uVar4 = DAT_140316c60, param_2 != 0x2725 &&
                (((((((uVar4 = DAT_140316c70, param_2 != 0x272d &&
                      (uVar4 = DAT_140316c80, param_2 != 0x275f)) &&
                     (uVar4 = DAT_140316c90, param_2 != 0x2761)) &&
                    ((uVar4 = DAT_140316ca0, param_2 != 0x2762 &&
                     (uVar4 = DAT_140316cb0, param_2 != 0x4e89)))) &&
                   (uVar4 = DAT_140316cc0, param_2 != 0x4e8a)) &&
                  (((uVar4 = DAT_140316cd0, param_2 != 0x4e8b &&
                    (uVar4 = DAT_140316ce0, param_2 != 0x4e8c)) &&
                   ((uVar4 = DAT_140316cf0, param_2 != 0x4e9f &&
                    (((uVar4 = DAT_140316d00, param_2 != 0x4f25 &&
                      (uVar4 = DAT_140316d10, param_2 != 0x4f2d)) &&
                     (uVar4 = DAT_140316d20, param_2 != 0x4f31)))))))) &&
                 ((uVar4 = DAT_140316d30, param_2 != 0x4f35 &&
                  (uVar4 = DAT_140316d40, param_2 != 0x4f36)))))))))) &&
             (((uVar4 = DAT_140316d50, param_2 != 0x4f38 &&
               (((uVar4 = DAT_140316d60, param_2 != 0x4f3c &&
                 (uVar4 = DAT_140316d70, param_2 != 0x4f3d)) &&
                ((uVar4 = DAT_140316d80, param_2 != 0x4f42 &&
                 (((uVar4 = DAT_140316d90, param_2 != 0x4f49 &&
                   (uVar4 = DAT_140316da0, param_2 != 0x4fc4)) &&
                  (uVar4 = DAT_140316db0, param_2 != 0x4fc7)))))))) &&
              ((uVar4 = DAT_140316dc0, param_2 != 0x4fc8 &&
               (uVar4 = DAT_140316dd0, param_2 != 0x5166)))))))) &&
           ((uVar4 = DAT_140316de0, param_2 != 0x5182 &&
            (((uVar4 = DAT_140316df0, param_2 != 0x5187 &&
              (uVar4 = DAT_140316e00, param_2 != 0x5190)) &&
             ((uVar4 = DAT_140316e10, param_2 != 0x51a9 &&
              ((((uVar4 = DAT_140316e20, param_2 != 0x51bc &&
                 (uVar4 = DAT_140316e30, param_2 != 0x5221)) &&
                (uVar4 = DAT_140316e40, param_2 != 0x556a)) &&
               (uVar4 = DAT_140316e50, param_2 != 0x96c6)))))))))) {
          return 0;
        }
      }
      uVar1 = FUN_1400c2ed0(param_1,uVar4,param_3,param_4,param_5);
    }
  }
  return uVar1;
}



undefined8
FUN_1400cc600(longlong param_1,int param_2,longlong param_3,int param_4,undefined8 param_5)

{
  undefined8 uVar1;
  
  FUN_1400bbe50(param_1 + 0x88,0x47);
  if ((param_3 == 0) || (param_4 == 0)) {
    uVar1 = 1;
  }
  else {
    FUN_1400c6910(param_1,param_2);
    if (param_2 == 0x6faf) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316868,param_3,param_4,param_5);
    }
    else if (param_2 == 0x6fb0) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316878,param_3,param_4,param_5);
    }
    else if (param_2 == 0x6fb1) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316888,param_3,param_4,param_5);
    }
    else if (param_2 == 0x6fb2) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316898,param_3,param_4,param_5);
    }
    else if (param_2 == 0x6fb3) {
      uVar1 = FUN_1400caf60(param_1,DAT_1403168a8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x6fb4) {
      uVar1 = FUN_1400caf60(param_1,DAT_1403168b8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x6fb5) {
      uVar1 = FUN_1400caf60(param_1,DAT_1403168c8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x6fb6) {
      uVar1 = FUN_1400caf60(param_1,DAT_1403168d8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x6fb7) {
      uVar1 = FUN_1400caf60(param_1,DAT_1403168e8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x6fbb) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316918,param_3,param_4,param_5);
    }
    else if (param_2 == 0x6fbd) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316928,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4e2) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316938,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4e3) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316948,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4e4) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316958,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4e5) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316968,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4e6) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316978,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4e7) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316988,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4e8) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316998,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4e9) {
      uVar1 = FUN_1400caf60(param_1,DAT_1403169a8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4ea) {
      uVar1 = FUN_1400caf60(param_1,DAT_1403169b8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x3a4) {
      uVar1 = FUN_1400cb2e0(param_1,DAT_140316e68,param_3,param_4,param_5);
    }
    else if (param_2 == 0x3a8) {
      uVar1 = FUN_1400cb2e0(param_1,DAT_140316eb8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x3b6) {
      uVar1 = FUN_1400cb2e0(param_1,DAT_140316ea8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x3b5) {
      uVar1 = FUN_1400cb2e0(param_1,DAT_140316e88,param_3,param_4,param_5);
    }
    else if (param_2 == 0xcadc) {
      uVar1 = FUN_1400cb2e0(param_1,DAT_140316ec8,param_3,param_4,param_5);
    }
    else if (param_2 == 0xcae0) {
      uVar1 = FUN_1400cb2e0(param_1,DAT_140316ed8,param_3,param_4,param_5);
    }
    else if (param_2 == 0xcaed) {
      uVar1 = FUN_1400cb2e0(param_1,DAT_140316ee8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x551) {
      uVar1 = FUN_1400cb2e0(param_1,DAT_140316e98,param_3,param_4,param_5);
    }
    else if (param_2 == 0x2711) {
      uVar1 = FUN_1400cb2e0(param_1,DAT_140316e78,param_3,param_4,param_5);
    }
    else if (param_2 == 0x25) {
      uVar1 = FUN_1400caf60(param_1,DAT_1403169c8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x1b5) {
      uVar1 = FUN_1400caf60(param_1,DAT_1403169d8,param_3,param_4,param_5);
    }
    else if (param_2 == 500) {
      uVar1 = FUN_1400caf60(param_1,DAT_1403169e8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x2c4) {
      uVar1 = FUN_1400caf60(param_1,DAT_1403169f8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x2d0) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316a08,param_3,param_4,param_5);
    }
    else if (param_2 == 0x2e1) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316a18,param_3,param_4,param_5);
    }
    else if (param_2 == 0x307) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316a28,param_3,param_4,param_5);
    }
    else if (param_2 == 0x352) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316a38,param_3,param_4,param_5);
    }
    else if (param_2 == 0x354) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316a48,param_3,param_4,param_5);
    }
    else if (param_2 == 0x357) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316a58,param_3,param_4,param_5);
    }
    else if (param_2 == 0x359) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316a68,param_3,param_4,param_5);
    }
    else if (param_2 == 0x35a) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316a78,param_3,param_4,param_5);
    }
    else if (param_2 == 0x35c) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316a88,param_3,param_4,param_5);
    }
    else if (param_2 == 0x35d) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316a98,param_3,param_4,param_5);
    }
    else if (param_2 == 0x35e) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316aa8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x35f) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316ab8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x360) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316ac8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x361) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316ad8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x362) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316ae8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x365) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316af8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x366) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316b08,param_3,param_4,param_5);
    }
    else if (param_2 == 0x36a) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316b18,param_3,param_4,param_5);
    }
    else if (param_2 == 0x36b) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316b28,param_3,param_4,param_5);
    }
    else if (param_2 == 0x402) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316b38,param_3,param_4,param_5);
    }
    else if (param_2 == 0x417) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316b48,param_3,param_4,param_5);
    }
    else if (param_2 == 0x474) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316b58,param_3,param_4,param_5);
    }
    else if (param_2 == 0x475) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316b68,param_3,param_4,param_5);
    }
    else if (param_2 == 0x476) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316b78,param_3,param_4,param_5);
    }
    else if (param_2 == 0x477) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316b88,param_3,param_4,param_5);
    }
    else if (param_2 == 0x478) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316b98,param_3,param_4,param_5);
    }
    else if (param_2 == 0x479) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316ba8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x47a) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316bb8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x47b) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316bc8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x47c) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316bd8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x47d) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316be8,param_3,param_4,param_5);
    }
    else if (param_2 == 10000) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316bf8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x2714) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316c08,param_3,param_4,param_5);
    }
    else if (param_2 == 0x2715) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316c18,param_3,param_4,param_5);
    }
    else if (param_2 == 0x2716) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316c28,param_3,param_4,param_5);
    }
    else if (param_2 == 0x2717) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316c38,param_3,param_4,param_5);
    }
    else if (param_2 == 0x271a) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316c48,param_3,param_4,param_5);
    }
    else if (param_2 == 0x2721) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316c58,param_3,param_4,param_5);
    }
    else if (param_2 == 0x2725) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316c68,param_3,param_4,param_5);
    }
    else if (param_2 == 0x272d) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316c78,param_3,param_4,param_5);
    }
    else if (param_2 == 0x275f) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316c88,param_3,param_4,param_5);
    }
    else if (param_2 == 0x2761) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316c98,param_3,param_4,param_5);
    }
    else if (param_2 == 0x2762) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316ca8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4e89) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316cb8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4e8a) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316cc8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4e8b) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316cd8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4e8c) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316ce8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4e9f) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316cf8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4f25) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316d08,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4f2d) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316d18,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4f31) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316d28,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4f35) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316d38,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4f36) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316d48,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4f38) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316d58,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4f3c) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316d68,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4f3d) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316d78,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4f42) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316d88,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4f49) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316d98,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4fc4) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316da8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4fc7) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316db8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x4fc8) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316dc8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x5166) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316dd8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x5182) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316de8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x5187) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316df8,param_3,param_4,param_5);
    }
    else if (param_2 == 0x5190) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316e08,param_3,param_4,param_5);
    }
    else if (param_2 == 0x51a9) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316e18,param_3,param_4,param_5);
    }
    else if (param_2 == 0x51bc) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316e28,param_3,param_4,param_5);
    }
    else if (param_2 == 0x5221) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316e38,param_3,param_4,param_5);
    }
    else if (param_2 == 0x556a) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316e48,param_3,param_4,param_5);
    }
    else if (param_2 == 0x96c6) {
      uVar1 = FUN_1400caf60(param_1,DAT_140316e58,param_3,param_4,param_5);
    }
    else {
      uVar1 = 0;
    }
  }
  return uVar1;
}



undefined1
FUN_1400cd810(longlong param_1,int param_2,int param_3,char *param_4,uint param_5,undefined8 param_6
             )

{
  bool bVar1;
  undefined1 uVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 uVar5;
  int iVar6;
  undefined1 *puVar7;
  char *pcVar8;
  longlong lVar9;
  uint uVar10;
  bool bVar11;
  undefined1 local_f8 [40];
  undefined1 local_d0 [40];
  undefined1 local_a8 [40];
  undefined8 local_80;
  undefined1 local_78 [40];
  undefined1 local_50 [40];
  
  local_80 = 0xfffffffffffffffe;
  FUN_1400bbe50(param_1 + 0x88,0x41);
  if (param_4 == (char *)0x0) {
    return 1;
  }
  if (param_5 == 0) {
    return 1;
  }
  bVar11 = false;
  if (param_2 == 0xfde9) {
    if ((((2 < param_5) && (*param_4 == -0x11)) && (param_4[1] == -0x45)) && (param_4[2] == -0x41))
    {
      param_4 = param_4 + 3;
      param_5 = param_5 - 3;
      if (param_5 == 0) {
        return 1;
      }
    }
  }
  else {
    bVar1 = false;
    if (param_2 != 0x4b0) {
      if (param_2 != 0x4b1) {
        if ((param_2 != 0xfded) && (param_2 == 0xfdee)) {
          bVar11 = true;
        }
        goto LAB_1400cd90d;
      }
      bVar1 = true;
    }
    bVar11 = bVar1;
    if (1 < param_5) {
      if ((*param_4 == -2) && (param_4[1] == -1)) {
        param_4 = param_4 + 2;
        param_5 = param_5 - 2;
        if (param_5 == 0) {
          return 1;
        }
        bVar11 = true;
      }
      else if ((*param_4 == -1) && (param_4[1] == -2)) {
        param_4 = param_4 + 2;
        param_5 = param_5 - 2;
        if (param_5 == 0) {
          return 1;
        }
        bVar11 = false;
      }
    }
  }
LAB_1400cd90d:
  if (param_2 == param_3) {
    FUN_1400b97e0(param_6,param_4,param_5);
    return 1;
  }
  FUN_1400b8c40();
  if (bVar11) {
    if ((param_2 != 0x4b0) && (param_2 != 0x4b1)) {
      FUN_1400b8c40(local_a8);
      uVar10 = param_5 >> 2;
      if (param_5 >> 2 == 0) {
        FUN_1400b92d0(local_a8);
        goto LAB_1400cde9b;
      }
      iVar6 = uVar10 * 4;
      pvVar4 = operator_new((ulonglong)(iVar6 + 4));
      puVar7 = (undefined1 *)((longlong)pvVar4 + 2);
      lVar9 = (longlong)param_4 - (longlong)pvVar4;
      do {
        puVar7[-2] = puVar7[lVar9 + 1];
        puVar7[-1] = puVar7[lVar9];
        *puVar7 = puVar7[lVar9 + -1];
        puVar7[1] = puVar7[lVar9 + -2];
        puVar7 = puVar7 + 4;
        uVar10 = uVar10 - 1;
      } while (uVar10 != 0);
      FUN_1400ba310(local_a8,pvVar4,iVar6);
      FUN_14010c9c0(local_a8,local_f8);
      param_4 = (char *)FUN_1400b8b90(local_f8);
      param_5 = FUN_1400b8b80(local_f8);
      param_2 = 0xfde9;
      goto LAB_1400cdb15;
    }
    uVar10 = param_5 >> 1;
    if (uVar10 == 0) goto LAB_1400cde9b;
    param_5 = uVar10 * 2;
    pvVar4 = operator_new((ulonglong)(uVar10 * 2 + 4));
    pcVar8 = param_4 + 1;
    do {
      pcVar8[((longlong)pvVar4 - (longlong)param_4) + -1] = *pcVar8;
      pcVar8[(longlong)pvVar4 - (longlong)param_4] = pcVar8[-1];
      pcVar8 = pcVar8 + 2;
      uVar10 = uVar10 - 1;
    } while (uVar10 != 0);
    FUN_1400ba310(local_f8,pvVar4,param_5);
    param_4 = (char *)FUN_1400b8b90();
    param_2 = 0x4b0;
  }
  else {
    if ((param_2 == 0xfded) || (param_2 == 0xfdee)) {
      FUN_1400b8c40(local_50);
      FUN_1400b9460(local_50,param_4,param_5);
      FUN_14010c9c0(local_50,local_f8);
      param_4 = (char *)FUN_1400b8b90(local_f8);
      param_5 = FUN_1400b8b80(local_f8);
      param_2 = 0xfde9;
    }
    else {
      if (param_2 != 65000) goto LAB_1400cdb1a;
      FUN_1400b8c40(local_78);
      FUN_1400b9460(local_78,param_4,param_5);
      FUN_14010d7d0(local_78,local_f8);
      param_4 = (char *)FUN_1400b8b90(local_f8);
      param_5 = FUN_1400b8b80(local_f8);
      param_2 = 0x4b0;
    }
LAB_1400cdb15:
    FUN_1400b92d0();
  }
LAB_1400cdb1a:
  bVar11 = param_3 != 0xfde9;
  if (param_2 == 0x4b0) {
    *(undefined2 *)(param_1 + 0x84) = 0;
    FUN_1400bbe50(param_1 + 0x88,0x55);
    if (param_3 != 0x4b0) {
      iVar6 = (param_5 >> 1) + 4;
      if (!bVar11) {
        FUN_1400ba520(param_6,iVar6);
        uVar2 = FUN_1400c3370(param_1,param_4,param_5,param_6);
        FUN_1400b92d0(local_f8);
        return uVar2;
      }
      FUN_1400ba520(param_6,iVar6);
      uVar2 = FUN_1400cb5c0(param_1,param_3,param_4,param_5,param_6);
      FUN_1400b92d0(local_f8);
      return uVar2;
    }
    FUN_1400b97e0(param_6,param_4,param_5);
  }
  else if (param_3 == 0x4b0) {
    *(undefined2 *)(param_1 + 0x84) = 0;
    FUN_1400bbe50(param_1 + 0x88,0x75);
    FUN_1400ba520(param_6,param_5 * 2);
    if (param_2 == 0xfde9) {
      uVar2 = FUN_1400c35b0(param_1,param_4,param_5,param_6);
      FUN_1400b92d0(local_f8);
      return uVar2;
    }
    uVar2 = FUN_1400cc600(param_1,param_2,param_4,param_5,param_6);
    FUN_1400b92d0(local_f8);
    return uVar2;
  }
  if (param_2 != 0xfde9) {
    FUN_1400b8c40(local_d0);
    if (bVar11) {
      *(undefined2 *)(param_1 + 0x84) = 1;
      FUN_1400ba520(local_d0,param_5 * 2 + 4);
      FUN_1400cc600(param_1,param_2,param_4,param_5,local_d0);
      *(undefined2 *)(param_1 + 0x84) = 0x100;
      uVar10 = FUN_1400b8b80(local_d0);
      FUN_1400ba520(param_6,(uVar10 >> 1) + 4);
      uVar3 = FUN_1400b8b80(local_d0);
      uVar5 = FUN_1400b8b90(local_d0);
      uVar2 = FUN_1400cb5c0(param_1,param_3,uVar5,uVar3,param_6);
      *(undefined2 *)(param_1 + 0x84) = 0;
      FUN_1400b92d0(local_d0);
      FUN_1400b92d0(local_f8);
      return uVar2;
    }
    *(undefined2 *)(param_1 + 0x84) = 1;
    FUN_1400ba520(local_d0,param_5 * 2 + 4);
    FUN_1400cc600(param_1,param_2,param_4,param_5,local_d0);
    *(undefined2 *)(param_1 + 0x84) = 0x100;
    uVar10 = FUN_1400b8b80(local_d0);
    FUN_1400ba520(param_6,(uVar10 >> 1) + 4);
    uVar3 = FUN_1400b8b80(local_d0);
    uVar5 = FUN_1400b8b90(local_d0);
    uVar2 = FUN_1400c3370(param_1,uVar5,uVar3,param_6);
    *(undefined2 *)(param_1 + 0x84) = 0;
    FUN_1400b92d0(local_d0);
    FUN_1400b92d0(local_f8);
    return uVar2;
  }
  if (bVar11) {
    FUN_1400b8c40(local_d0);
    FUN_1400ba520(local_d0,param_5 * 2 + 4);
    *(undefined2 *)(param_1 + 0x84) = 1;
    FUN_1400c35b0(param_1,param_4,param_5,local_d0);
    *(undefined2 *)(param_1 + 0x84) = 0x100;
    uVar10 = FUN_1400b8b80(local_d0);
    FUN_1400ba520(param_6,(uVar10 >> 1) + 4);
    uVar3 = FUN_1400b8b80(local_d0);
    uVar5 = FUN_1400b8b90(local_d0);
    uVar2 = FUN_1400cb5c0(param_1,param_3,uVar5,uVar3,param_6);
    *(undefined2 *)(param_1 + 0x84) = 0;
    FUN_1400b92d0(local_d0);
    FUN_1400b92d0(local_f8);
    return uVar2;
  }
  FUN_1400b97e0(param_6,param_4,param_5);
LAB_1400cde9b:
  FUN_1400b92d0(local_f8);
  return 1;
}



undefined1
FUN_1400cded0(longlong param_1,int param_2,int param_3,undefined8 param_4,uint param_5,
             undefined8 param_6)

{
  byte bVar1;
  bool bVar2;
  char cVar3;
  undefined1 uVar4;
  uint uVar5;
  undefined4 uVar6;
  void *pvVar7;
  undefined1 *puVar8;
  undefined8 uVar9;
  byte *pbVar10;
  byte *pbVar11;
  longlong lVar12;
  int iVar13;
  byte *pbVar14;
  byte *pbVar15;
  byte *pbVar16;
  longlong lVar17;
  longlong local_res8;
  int local_res10;
  int local_res18;
  longlong local_c8;
  undefined1 local_c0 [40];
  uint local_98;
  byte *local_90;
  byte *local_88;
  byte *local_80;
  undefined1 local_78 [40];
  undefined1 local_50 [48];
  undefined8 local_20;
  
  local_20 = 0xfffffffffffffffe;
  local_res8 = param_1;
  local_res10 = param_2;
  FUN_1400bbe30(param_1 + 0x88);
  if (param_3 == 0) {
    param_3 = param_2;
  }
  local_res18 = param_3;
  if ((param_2 == 0) || (param_2 == param_3)) {
    FUN_1400b97e0(param_6,param_4,param_5);
  }
  else {
    FUN_1400b8c40(local_78);
    if (param_2 == 0x2714) {
      FUN_1400b97e0(local_78,param_4,param_5);
      local_88 = (byte *)FUN_1400b8b90();
      bVar2 = false;
      local_90 = (byte *)0x0;
      FUN_1400bcc20();
      pbVar16 = (byte *)0x0;
      local_98 = 0;
      local_80 = (byte *)0x0;
      if (param_5 != 0) {
        lVar17 = -(longlong)local_88;
        pbVar11 = pbVar16;
        pbVar14 = pbVar16;
        pbVar15 = local_88;
        local_c8 = lVar17;
        do {
          bVar1 = *pbVar15;
          uVar5 = (uint)pbVar14;
          if (bVar2) {
            if ((bVar1 < 0x20) || (*(int *)(&DAT_1402f8f00 + (ulonglong)bVar1 * 4) == 0)) {
              iVar13 = uVar5 - (int)pbVar16;
              if (1 < iVar13) {
                FUN_1400bbe30(local_50);
                FUN_1400bc8a0(local_50,local_88 + (int)local_90,iVar13);
                lVar12 = FUN_1400b8b90(local_50);
                pbVar14 = pbVar15 + (lVar17 - (longlong)pbVar11) + -1;
                pbVar16 = local_90;
                pbVar11 = local_80;
                lVar17 = local_c8;
                if (-1 < (longlong)pbVar14) {
                  pbVar10 = local_88 + (longlong)local_80;
                  do {
                    *pbVar10 = pbVar14[lVar12];
                    pbVar10 = pbVar10 + 1;
                    pbVar14 = pbVar14 + -1;
                  } while (-1 < (longlong)pbVar14);
                }
              }
              bVar2 = false;
              uVar5 = local_98;
            }
          }
          else if ((0x1f < bVar1) && (*(int *)(&DAT_1402f8f00 + (ulonglong)bVar1 * 4) != 0)) {
            bVar2 = true;
            pbVar11 = pbVar15 + lVar17;
            pbVar16 = pbVar14;
            local_90 = pbVar14;
            local_80 = pbVar11;
          }
          bVar1 = *pbVar15;
          if ((bVar1 < 0xb0) || (0xb9 < bVar1)) {
            if ((bVar1 < 0xa0) || (0xaf < bVar1)) {
              if ((((((bVar1 == 0xba) || (bVar1 == 0xbc)) || (bVar1 == 0xbd)) ||
                   ((bVar1 == 0xbe || (bVar1 == 0xdb)))) || (bVar1 == 0xdc)) ||
                 (((bVar1 == 0xdd || (bVar1 == 0xde)) ||
                  ((bVar1 == 0xdf || (((bVar1 == 0xfb || (bVar1 == 0xfc)) || (bVar1 == 0xfd))))))))
              goto LAB_1400ce0b1;
              if (bVar1 == 0x81) {
                *pbVar15 = 0xa0;
              }
            }
            else if ((bVar1 != 0xac) && (bVar1 != 0xa5)) goto LAB_1400ce0b1;
          }
          else {
LAB_1400ce0b1:
            *pbVar15 = bVar1 + 0x80;
          }
          local_98 = uVar5 + 1;
          pbVar14 = (byte *)(ulonglong)local_98;
          pbVar15 = pbVar15 + 1;
        } while (local_98 < param_5);
        param_3 = local_res18;
        if ((bVar2) && (iVar13 = local_98 - (int)pbVar16, 1 < iVar13)) {
          FUN_1400bbe30(local_50);
          pbVar16 = local_88 + (int)local_90;
          FUN_1400bc8a0(local_50,pbVar16,iVar13);
          lVar17 = FUN_1400b8b90(local_50);
          lVar12 = (longlong)(iVar13 + -1);
          param_3 = local_res18;
          if (-1 < iVar13 + -1) {
            do {
              *pbVar16 = *(byte *)(lVar12 + lVar17);
              pbVar16 = pbVar16 + 1;
              lVar12 = lVar12 + -1;
            } while (-1 < lVar12);
          }
        }
      }
      param_4 = FUN_1400b8b90(local_78);
      FUN_1400bceb0(local_50);
      param_2 = local_res10;
    }
    else {
      if (param_2 - 0xc42cU < 3) {
        FUN_14010de30(&local_c8);
        FUN_1400b8c40(local_c0);
        FUN_14010e7d0(&local_c8,param_4,param_5,local_c0);
        uVar4 = 1;
        iVar13 = FUN_1400b8b80(local_c0);
        if (iVar13 != 0) {
          uVar6 = FUN_1400b8b80(local_c0);
          uVar9 = FUN_1400b8b90(local_c0);
          uVar4 = FUN_1400cded0(local_res8,0x3a4,param_3,uVar9,uVar6,param_6);
        }
        FUN_1400b92d0(local_c0);
        FUN_14010de40(&local_c8);
        FUN_1400b92d0(local_78);
        return uVar4;
      }
      if (param_2 == 0xc431) {
        FUN_14010dac0(&local_c8);
        FUN_1400b8c40(local_c0);
        FUN_14010dae0(&local_c8,param_4,param_5,local_c0);
        uVar4 = 1;
        iVar13 = FUN_1400b8b80(local_c0);
        if (iVar13 != 0) {
          uVar6 = FUN_1400b8b80(local_c0);
          uVar9 = FUN_1400b8b90(local_c0);
          uVar4 = FUN_1400cded0(local_res8,0x3b5,param_3,uVar9,uVar6,param_6);
        }
        FUN_1400b92d0(local_c0);
        FUN_14010dad0(&local_c8);
        FUN_1400b92d0(local_78);
        return uVar4;
      }
    }
    *(undefined1 *)(local_res8 + 0x85) = 0;
    *(int *)(local_res8 + 0x7c) = param_2;
    *(int *)(local_res8 + 0x80) = param_3;
    if (param_3 == 65000) {
      FUN_1400b8c40(local_c0);
      cVar3 = FUN_1400cd810(local_res8,param_2,0x4b0,param_4,param_5,local_c0);
      if (cVar3 == '\0') {
        FUN_1400b92d0(local_c0);
        FUN_1400b92d0(local_78);
        return 0;
      }
      uVar4 = FUN_14010d580(local_c0,param_6);
      FUN_1400b92d0(local_c0);
      FUN_1400b92d0(local_78);
      return uVar4;
    }
    if ((param_3 == 0xfded) || (param_3 == 0xfdee)) {
      FUN_1400b8c40(local_c0);
      cVar3 = FUN_1400cd810(local_res8,param_2,0xfde9,param_4,param_5,local_c0);
      if (cVar3 == '\0') {
        FUN_1400b92d0(local_c0);
        FUN_1400b92d0(local_78);
        return 0;
      }
      if (param_3 == 0xfded) {
        uVar4 = FUN_14010c6b0();
        FUN_1400b92d0(local_c0);
        FUN_1400b92d0(local_78);
        return uVar4;
      }
      uVar4 = FUN_14010c820(local_c0,param_6);
      FUN_1400b92d0(local_c0);
      FUN_1400b92d0(local_78);
      return uVar4;
    }
    if (param_3 != 0x4b1) {
      if (param_3 - 0xc42cU < 3) {
        FUN_1400b8c40(local_c0);
        uVar4 = FUN_1400cd810(local_res8,param_2,0x3a4,param_4,param_5,local_c0);
        iVar13 = FUN_1400b8b80(local_c0);
        if (iVar13 != 0) {
          FUN_14010de30(&local_res8);
          uVar6 = FUN_1400b8b80(local_c0);
          uVar9 = FUN_1400b8b90(local_c0);
          FUN_14010e030(&local_res8,uVar9,uVar6,param_6);
          FUN_14010de40(&local_res8);
        }
        FUN_1400b92d0(local_c0);
        FUN_1400b92d0(local_78);
        return uVar4;
      }
      if (param_3 == 0xc431) {
        FUN_1400b8c40(local_c0);
        uVar4 = FUN_1400cd810(local_res8,param_2,0x3b5,param_4,param_5,local_c0);
        iVar13 = FUN_1400b8b80(local_c0);
        if (iVar13 != 0) {
          FUN_14010dac0(&local_res8);
          uVar6 = FUN_1400b8b80(local_c0);
          uVar9 = FUN_1400b8b90(local_c0);
          FUN_14010dc50(&local_res8,uVar9,uVar6,param_6);
          FUN_14010dad0(&local_res8);
        }
        FUN_1400b92d0(local_c0);
        FUN_1400b92d0(local_78);
        return uVar4;
      }
      uVar4 = FUN_1400cd810(local_res8,param_2,param_3,param_4,param_5,param_6);
      FUN_1400b92d0(local_78);
      return uVar4;
    }
    *(undefined4 *)(local_res8 + 0x80) = 0x4b0;
    FUN_1400b8c40(local_c0);
    FUN_1400cd810(local_res8,param_2,0x4b0,param_4,param_5,local_c0);
    uVar5 = FUN_1400b8b80(local_c0);
    uVar5 = uVar5 >> 1;
    if ((uVar5 != 0) && (lVar17 = FUN_1400b8b90(local_c0), lVar17 != 0)) {
      iVar13 = uVar5 * 2;
      pvVar7 = operator_new((ulonglong)(uVar5 * 2 + 4));
      puVar8 = (undefined1 *)FUN_1400b8b90(local_c0);
      lVar17 = (longlong)pvVar7 - (longlong)puVar8;
      do {
        puVar8[lVar17] = puVar8[1];
        puVar8[lVar17 + 1] = *puVar8;
        puVar8 = puVar8 + 2;
        uVar5 = uVar5 - 1;
      } while (uVar5 != 0);
      FUN_1400b97e0(param_6,pvVar7,iVar13);
      operator_delete(pvVar7);
    }
    FUN_1400b92d0(local_c0);
    FUN_1400b92d0(local_78);
  }
  return 1;
}



ulonglong FUN_1400ce630(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                       undefined4 param_5,undefined8 param_6)

{
  ulonglong uVar1;
  ulonglong uVar2;
  
  *(undefined1 *)(param_1 + 0x85) = 0;
  uVar1 = FUN_140108370(param_2);
  uVar2 = uVar1 & 0xffffffff;
  if ((int)uVar1 != 0) {
    uVar1 = FUN_140108370(param_3);
    if ((int)uVar1 != 0) {
      uVar1 = FUN_1400cded0(param_1,uVar2,uVar1 & 0xffffffff,param_4,param_5,param_6);
      return uVar1;
    }
  }
  return uVar1 & 0xffffffffffffff00;
}



void FUN_1400ce6b0(longlong param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
                  undefined4 param_5,undefined8 param_6)

{
  int iVar1;
  
  *(undefined1 *)(param_1 + 0x85) = 0;
  iVar1 = FUN_140108370(param_2);
  if (iVar1 == 0) {
    return;
  }
  FUN_1400cded0(param_1,iVar1,param_3,param_4,param_5,param_6);
  return;
}



void FUN_1400ce720(undefined8 param_1,int param_2,int param_3,undefined8 param_4,undefined4 param_5,
                  undefined8 param_6)

{
  undefined8 uVar1;
  
  if (param_3 == 0) {
    param_3 = param_2;
  }
  if (param_3 == 0xfde9) {
    FUN_1400b9550(param_6,0xef);
    FUN_1400b9550(param_6,0xbb);
    uVar1 = 0xbf;
  }
  else if (param_3 == 0x4b1) {
    FUN_1400b9550(param_6,0xfe);
    uVar1 = 0xff;
  }
  else {
    if (param_3 != 0x4b0) goto LAB_1400ce7a2;
    FUN_1400b9550(param_6,0xff);
    uVar1 = 0xfe;
  }
  FUN_1400b9550(param_6,uVar1);
LAB_1400ce7a2:
  FUN_1400cded0(param_1,param_2,param_3,param_4,param_5,param_6);
  return;
}



void __stdcall Sleep(DWORD dwMilliseconds)

{
                    // WARNING: Could not recover jumptable at 0x0001400ce7e0. Too many branches
                    // WARNING: Treating indirect jump as call
  Sleep(dwMilliseconds);
  return;
}



DWORD __stdcall GetTickCount(void)

{
  DWORD DVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001400ce7f0. Too many branches
                    // WARNING: Treating indirect jump as call
  DVar1 = GetTickCount();
  return DVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400ce800(undefined8 param_1)

{
  BOOL BVar1;
  undefined1 auStack_208 [32];
  DWORD local_1e8 [4];
  CHAR local_1d8 [448];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_208;
  local_1e8[0] = 400;
  BVar1 = GetUserNameA(local_1d8,local_1e8);
  if (BVar1 == 0) {
    local_1d8[0] = '\0';
  }
  FUN_1400bc640(param_1,local_1d8);
  return;
}



UINT __stdcall GetACP(void)

{
  UINT UVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001400ce870. Too many branches
                    // WARNING: Treating indirect jump as call
  UVar1 = GetACP();
  return UVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400ce880(undefined8 param_1)

{
  BOOL BVar1;
  undefined1 auStack_c8 [32];
  DWORD local_a8 [4];
  CHAR local_98 [128];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_c8;
  local_a8[0] = 0x76;
  BVar1 = GetComputerNameA(local_98,local_a8);
  if (BVar1 == 0) {
    local_98[0] = '\0';
  }
  FUN_1400bc640(param_1,local_98);
  return;
}



void FUN_1400ce8f0(HKEY param_1,LPCSTR param_2,DWORD param_3,REGSAM param_4,PHKEY param_5)

{
  RegOpenKeyExA(param_1,param_2,param_3,param_4,param_5);
  return;
}



void FUN_1400ce910(HKEY param_1,LPCSTR param_2,DWORD param_3,LPSTR param_4,DWORD param_5,
                  REGSAM param_6,LPSECURITY_ATTRIBUTES param_7,PHKEY param_8,LPDWORD param_9)

{
  RegCreateKeyExA(param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9);
  return;
}



void FUN_1400ce960(DWORD param_1,LPCVOID param_2,DWORD param_3,DWORD param_4,LPSTR param_5,
                  DWORD param_6,va_list *param_7)

{
  FormatMessageA(param_1,param_2,param_3,param_4,param_5,param_6,param_7);
  return;
}



void FUN_1400ce990(HCRYPTPROV *param_1,LPCSTR param_2,LPCSTR param_3,DWORD param_4,DWORD param_5)

{
  CryptAcquireContextA(param_1,param_2,param_3,param_4,param_5);
  return;
}



undefined8 FUN_1400ce9b0(void)

{
  BOOL BVar1;
  HCRYPTPROV local_res8 [4];
  
  local_res8[0] = 0;
  BVar1 = CryptAcquireContextA
                    (local_res8,(LPCSTR)0x0,"Microsoft Base Cryptographic Provider v1.0",1,
                     0xf0000000);
  if (BVar1 == 0) {
    BVar1 = CryptAcquireContextA
                      (local_res8,(LPCSTR)0x0,"Microsoft Base Cryptographic Provider v1.0",1,
                       0xf0000008);
    if (BVar1 == 0) {
      BVar1 = CryptAcquireContextA
                        (local_res8,(LPCSTR)0x0,"Microsoft Base Cryptographic Provider v1.0",1,
                         0xf0000020);
      if (BVar1 == 0) {
        BVar1 = CryptAcquireContextA
                          (local_res8,(LPCSTR)0x0,"Microsoft Base Cryptographic Provider v1.0",1,
                           0xf0000028);
        if (BVar1 == 0) {
          return 0;
        }
      }
    }
  }
  return local_res8[0];
}



undefined8 * FUN_1400cea60(undefined8 *param_1)

{
  FUN_1400cf320();
  FUN_1400d1210(param_1 + 1);
  *param_1 = Logger::vftable;
  param_1[1] = Logger::vftable;
  FUN_14010eaa0(param_1 + 7);
  *(undefined4 *)(param_1 + 0xd) = 0;
  FUN_1400b6fd0(param_1 + 0xe);
  return param_1;
}



void FUN_1400cead0(undefined8 *param_1)

{
  *param_1 = Logger::vftable;
  param_1[1] = Logger::vftable;
  FUN_1400b7090(param_1 + 0xe);
  FUN_14010eb90(param_1 + 7);
  FUN_1400d1240(param_1 + 1);
  FUN_1400cf330(param_1);
  return;
}



undefined1 FUN_1400ceb30(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined1 local_40 [56];
  
  FUN_1400d1280(param_1 + 8);
  FUN_1400bcc20(local_40);
  FUN_14010ee50(param_1 + 0x38,local_40);
  uVar2 = FUN_1400bbb10(local_40);
  uVar3 = FUN_1400b8b90(local_40);
  uVar1 = FUN_1400c0390(param_3,uVar3,uVar2,0);
  FUN_1400d1290(param_1 + 8);
  FUN_1400bceb0(local_40);
  return uVar1;
}



void FUN_1400cebd0(longlong param_1,undefined8 param_2)

{
  FUN_1400d1280(param_1 + 8);
  FUN_1400bbe30(param_2);
  FUN_14010ee50(param_1 + 0x38,param_2);
  FUN_1400d1290(param_1 + 8);
  return;
}



void FUN_1400cec20(longlong param_1,undefined8 param_2)

{
  FUN_1400d1280(param_1 + 8);
  FUN_1400bbe30(param_2);
  FUN_14010eeb0(param_1 + 0x38,param_2);
  FUN_1400d1290(param_1 + 8);
  return;
}



void FUN_1400cec70(longlong param_1,undefined8 param_2)

{
  FUN_1400d1280(param_1 + 8);
  FUN_1400bbe30(param_2);
  FUN_14010ee80(param_1 + 0x38,param_2);
  FUN_1400d1290(param_1 + 8);
  return;
}



undefined4 FUN_1400cecc0(longlong param_1,longlong param_2)

{
  char *_Filename;
  int iVar1;
  FILE *_File;
  undefined1 local_40 [56];
  
  if (param_2 != 0) {
    FUN_1400d1280(param_1 + 8);
    FUN_14010ecc0(param_1 + 0x38,param_2);
    iVar1 = FUN_1400b8350(param_1 + 0x70);
    if (iVar1 != 0) {
      _Filename = (char *)FUN_1400b7950(param_1 + 0x70);
      _File = fopen(_Filename,"a");
      if (_File != (FILE *)0x0) {
        FUN_1400bcc20(local_40);
        FUN_1400be1c0(local_40,0x20,*(int *)(param_1 + 0x68) << 2);
        FUN_1400b8b90(local_40);
        fprintf(_File,"%s%s\n");
        fclose(_File);
        FUN_1400bceb0(local_40);
      }
    }
    FUN_1400d1290(param_1 + 8);
  }
  return 1;
}



undefined4 FUN_1400cedb0(longlong param_1,longlong param_2)

{
  char *_Filename;
  int iVar1;
  FILE *_File;
  undefined1 local_40 [56];
  
  if (param_2 != 0) {
    FUN_1400d1280(param_1 + 8);
    FUN_14010ed80(param_1 + 0x38,param_2);
    iVar1 = FUN_1400b8350(param_1 + 0x70);
    if (iVar1 != 0) {
      _Filename = (char *)FUN_1400b7950(param_1 + 0x70);
      _File = fopen(_Filename,"a");
      if (_File != (FILE *)0x0) {
        FUN_1400bcc20(local_40);
        FUN_1400be1c0(local_40,0x20,*(int *)(param_1 + 0x68) << 2);
        FUN_1400b8b90(local_40);
        fprintf(_File,"%s%s\n");
        fclose(_File);
        FUN_1400bceb0(local_40);
      }
    }
    FUN_1400d1290(param_1 + 8);
  }
  return 1;
}



undefined1 FUN_1400ceea0(longlong param_1)

{
  FUN_1400d1280(param_1 + 8);
  FUN_14010eb20(param_1 + 0x38);
  *(undefined4 *)(param_1 + 0x68) = 0;
  FUN_1400d1290(param_1 + 8);
  return 1;
}



undefined4 FUN_1400ceee0(longlong param_1,undefined8 param_2)

{
  char *_Filename;
  int iVar1;
  FILE *_File;
  undefined1 local_40 [56];
  
  FUN_1400d1280(param_1 + 8);
  FUN_14010ec00(param_1 + 0x38,param_2);
  iVar1 = FUN_1400b8350(param_1 + 0x70);
  if (iVar1 != 0) {
    _Filename = (char *)FUN_1400b7950(param_1 + 0x70);
    _File = fopen(_Filename,"a");
    if (_File != (FILE *)0x0) {
      FUN_1400bcc20(local_40);
      FUN_1400be1c0(local_40,0x20,*(int *)(param_1 + 0x68) << 2);
      FUN_1400b8b90(local_40);
      fprintf(_File,"%s%s:\n");
      fclose(_File);
      FUN_1400bceb0(local_40);
    }
  }
  *(int *)(param_1 + 0x68) = *(int *)(param_1 + 0x68) + 1;
  FUN_1400d1290(param_1 + 8);
  return 1;
}



undefined8 FUN_1400cefd0(longlong param_1)

{
  int iVar1;
  char *_Filename;
  FILE *_File;
  undefined1 local_40 [56];
  
  FUN_1400d1280(param_1 + 8);
  FUN_14010ec70(param_1 + 0x38);
  iVar1 = FUN_1400b8350(param_1 + 0x70);
  if (iVar1 != 0) {
    _Filename = (char *)FUN_1400b7950(param_1 + 0x70);
    _File = fopen(_Filename,"a");
    if (_File != (FILE *)0x0) {
      FUN_1400bcc20(local_40);
      FUN_1400be1c0(local_40,0x20,*(int *)(param_1 + 0x68) << 2);
      FUN_1400b8b90(local_40);
      fprintf(_File,"%s(leaveContext)\n");
      fclose(_File);
      FUN_1400bceb0(local_40);
    }
  }
  if (0 < *(int *)(param_1 + 0x68)) {
    *(int *)(param_1 + 0x68) = *(int *)(param_1 + 0x68) + -1;
  }
  FUN_1400d1290(param_1 + 8);
  return 1;
}



// WARNING: Restarted to delay deadcode elimination for space: register

undefined8 FUN_1400cf0b0(longlong param_1,undefined8 param_2,char *param_3)

{
  int iVar1;
  undefined8 uVar2;
  char *pcVar3;
  FILE *_File;
  undefined8 uVar4;
  undefined1 local_70 [48];
  undefined1 local_40 [56];
  
  FUN_1400bcc20(local_70);
  FUN_1400bc640(local_70,param_2);
  FUN_1400bbc30(local_70);
  FUN_1400bd110(local_70,&DAT_14027b59c,&DAT_140209100);
  iVar1 = FUN_1400bbb10(local_70);
  if (iVar1 == 0) {
    FUN_1400bceb0(local_70);
    uVar2 = 0;
  }
  else {
    pcVar3 = "(NULL)";
    if (param_3 != (char *)0x0) {
      pcVar3 = param_3;
    }
    FUN_1400d1280(param_1 + 8);
    uVar2 = FUN_1400b8b90(local_70);
    FUN_14010ede0(param_1 + 0x38,uVar2,pcVar3);
    iVar1 = FUN_1400b8350(param_1 + 0x70);
    if (iVar1 != 0) {
      pcVar3 = (char *)FUN_1400b7950(param_1 + 0x70);
      _File = fopen(pcVar3,"a");
      if (_File != (FILE *)0x0) {
        FUN_1400bcc20(local_40);
        FUN_1400be1c0(local_40,0x20,*(int *)(param_1 + 0x68) << 2);
        uVar2 = FUN_1400b8b90(local_70);
        uVar4 = FUN_1400b8b90(local_40);
        fprintf(_File,"%s%s: %s\n",uVar4,uVar2);
        fclose(_File);
        FUN_1400bceb0(local_40);
      }
    }
    FUN_1400d1290(param_1 + 8);
    FUN_1400bceb0(local_70);
    uVar2 = 1;
  }
  return uVar2;
}



undefined1 FUN_1400cf240(longlong param_1,longlong param_2)

{
  if (param_2 != 0) {
    FUN_1400d1280(param_1 + 8);
    FUN_14010ed20(param_1 + 0x38,param_2);
    FUN_1400d1290(param_1 + 8);
  }
  return 1;
}



void FUN_1400cf290(longlong param_1)

{
  FUN_1400cf2a0(param_1 + -8);
  return;
}



undefined8 * FUN_1400cf2a0(undefined8 *param_1,uint param_2)

{
  *param_1 = Logger::vftable;
  param_1[1] = Logger::vftable;
  FUN_1400b7090(param_1 + 0xe);
  FUN_14010eb90(param_1 + 7);
  FUN_1400d1240(param_1 + 1);
  FUN_1400cf330(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1400cf320(undefined8 *param_1)

{
  *param_1 = LogBase::vftable;
  return param_1;
}



void FUN_1400cf330(undefined8 *param_1)

{
  *param_1 = LogBase::vftable;
  return;
}



void FUN_1400cf340(longlong *param_1,undefined8 param_2,undefined8 param_3,int param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined1 local_40 [56];
  
  FUN_1400bcc20(local_40);
  if (param_4 != 0) {
    FUN_1400be290(local_40,param_3,param_4);
    FUN_1400bbc30(local_40);
  }
  lVar1 = *param_1;
  uVar2 = FUN_1400b8b90(local_40);
  (**(code **)(lVar1 + 0x58))(param_1,param_2,uVar2);
  FUN_1400bceb0(local_40);
  return;
}



void FUN_1400cf3d0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  longlong lVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined1 local_80 [16];
  undefined1 local_70 [48];
  undefined1 local_40 [56];
  
  FUN_1400bcc20(local_40);
  FUN_1400bcaa0(local_70,param_3);
  FUN_1400f0d10(local_80);
  uVar2 = FUN_1400bbb10(local_70);
  uVar3 = FUN_1400b8b90(local_70);
  FUN_1400f2610(local_80,uVar3,uVar2,local_40);
  lVar1 = *param_1;
  uVar3 = FUN_1400b8b90(local_40);
  (**(code **)(lVar1 + 0x58))(param_1,param_2,uVar3);
  FUN_1400f0d30(local_80);
  FUN_1400bceb0(local_70);
  FUN_1400bceb0(local_40);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400cf4a0(longlong *param_1,undefined8 param_2,uint param_3)

{
  DWORD DVar1;
  undefined1 auStack_98 [32];
  char local_78 [80];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_98;
  DVar1 = GetTickCount();
  if ((param_3 <= DVar1) && (DVar1 - param_3 < 900000000)) {
    sprintf(local_78,"Elapsed time: %d millisec");
    (**(code **)(*param_1 + 0x58))(param_1,param_2,local_78);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400cf520(longlong *param_1,undefined8 param_2,undefined4 param_3)

{
  undefined1 auStack_58 [32];
  undefined1 local_38 [40];
  ulonglong local_10;
  
  local_10 = DAT_1402f85a0 ^ (ulonglong)auStack_58;
  FUN_1400bc440(param_3,local_38);
  (**(code **)(*param_1 + 0x58))(param_1,param_2,local_38);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400cf580(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  undefined1 auStack_88 [32];
  undefined1 local_68 [80];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  FUN_1400bc420(param_3,local_68);
  (**(code **)(*param_1 + 0x58))(param_1,param_2,local_68);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400cf5e0(longlong *param_1,undefined8 param_2)

{
  undefined1 auStack_48 [32];
  char local_28 [24];
  ulonglong local_10;
  
  local_10 = DAT_1402f85a0 ^ (ulonglong)auStack_48;
  sprintf(local_28,"0x%x");
  (**(code **)(*param_1 + 0x58))(param_1,param_2,local_28);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400cf640(longlong *param_1)

{
  longlong lVar1;
  DWORD DVar2;
  undefined8 uVar3;
  undefined1 auStack_88 [32];
  undefined8 local_68;
  undefined1 local_60 [48];
  char local_30 [24];
  ulonglong local_18;
  
  local_68 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  DVar2 = GetLastError();
  FUN_1400bcc20(local_60);
  FUN_1400bdef0(local_60,DVar2);
  lVar1 = *param_1;
  uVar3 = FUN_1400b8b90(local_60);
  (**(code **)(lVar1 + 0x58))(param_1,"WindowsError",uVar3);
  sprintf(local_30,"0x%x");
  (**(code **)(*param_1 + 0x58))(param_1,"WindowsErrorCode",local_30);
  FUN_1400bceb0(local_60);
  return;
}



void FUN_1400cf710(longlong *param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined1 local_40 [56];
  
  if (param_2 != 0) {
    uVar3 = 0xfffffffffffffffe;
    FUN_1400bcc20(local_40);
    FUN_1400bdef0(local_40,param_2);
    lVar1 = *param_1;
    uVar2 = FUN_1400b8b90(local_40);
    (**(code **)(lVar1 + 0x58))(param_1,"WindowsError",uVar2,param_4,uVar3);
    FUN_1400bceb0(local_40);
  }
  return;
}



undefined8 * FUN_1400cf780(undefined8 *param_1,byte param_2)

{
  *param_1 = LogBase::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400cf7b0(longlong *param_1,undefined4 param_2,undefined4 param_3)

{
  undefined1 auStack_68 [32];
  undefined1 local_48 [40];
  ulonglong local_20;
  
  local_20 = DAT_1402f85a0 ^ (ulonglong)auStack_68;
  (**(code **)(*param_1 + 0x28))(param_1,"Memory allocation failed.");
  FUN_1400bc440(param_2,local_48);
  (**(code **)(*param_1 + 0x58))(param_1,"failurePoint",local_48);
  FUN_1400bc440(param_3,local_48);
  (**(code **)(*param_1 + 0x58))(param_1,"numBytes",local_48);
  return;
}



undefined8 * FUN_1400cf840(undefined8 *param_1)

{
  *param_1 = DateParser::vftable;
  return param_1;
}



void FUN_1400cf850(undefined8 *param_1)

{
  *param_1 = DateParser::vftable;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

char * FUN_1400cf860(uint param_1,char *param_2,char *param_3,char *param_4)

{
  char cVar1;
  char *pcVar2;
  undefined1 auStack_78 [32];
  char local_58 [64];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_78;
  sprintf(local_58,param_2,(ulonglong)param_1);
  pcVar2 = local_58;
  while( true ) {
    if (param_4 <= param_3) {
      return param_3;
    }
    cVar1 = *pcVar2;
    pcVar2 = pcVar2 + 1;
    *param_3 = cVar1;
    if (cVar1 == '\0') break;
    param_3 = param_3 + 1;
  }
  return param_3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

char * FUN_1400cf8e0(char *param_1,int *param_2,char *param_3,char *param_4)

{
  char cVar1;
  int iVar2;
  undefined8 uVar3;
  uint uVar4;
  char *pcVar5;
  int iVar6;
  undefined *puVar7;
  char *pcVar8;
  char *pcVar9;
  int iVar10;
  uint uVar11;
  undefined1 auStack_98 [32];
  int *local_78;
  char *local_70;
  int local_68;
  int local_64;
  int local_60;
  int local_5c;
  int local_58;
  int local_54;
  int local_50;
  int local_4c;
  int local_48;
  char local_40 [32];
  ulonglong local_20;
  
  local_20 = DAT_1402f85a0 ^ (ulonglong)auStack_98;
  cVar1 = *param_1;
  local_78 = param_2;
  do {
    if (cVar1 == '\0') {
      return param_3;
    }
    pcVar8 = param_1;
    if (cVar1 != '%') goto switchD_1400cf95d_caseD_1;
    cVar1 = param_1[1];
    pcVar8 = param_1 + 1;
    local_70 = pcVar8;
    pcVar9 = param_3;
    switch(cVar1) {
    case '\0':
      pcVar8 = param_1;
    default:
switchD_1400cf95d_caseD_1:
      if (param_3 == param_4) {
        return param_3;
      }
      pcVar9 = param_3 + 1;
      *param_3 = *pcVar8;
      break;
    case '+':
      pcVar9 = (char *)FUN_1400cf8e0("%a, %d %b %Y %H:%M:%S %z",param_2,param_3,param_4);
      break;
    case 'A':
      iVar2 = param_2[6];
      if ((iVar2 < 0) || (6 < iVar2)) {
        pcVar5 = "?";
      }
      else {
        pcVar5 = (&PTR_s_Sunday_1402f9388)[iVar2];
      }
      for (; pcVar9 < param_4; pcVar9 = pcVar9 + 1) {
        cVar1 = *pcVar5;
        pcVar5 = pcVar5 + 1;
        *pcVar9 = cVar1;
        if (cVar1 == '\0') break;
      }
      break;
    case 'B':
      iVar2 = param_2[4];
      if ((iVar2 < 0) || (0xb < iVar2)) {
        pcVar5 = "?";
      }
      else {
        pcVar5 = (&PTR_s_January_1402f93c0)[iVar2];
      }
      for (; pcVar9 < param_4; pcVar9 = pcVar9 + 1) {
        cVar1 = *pcVar5;
        pcVar5 = pcVar5 + 1;
        *pcVar9 = cVar1;
        if (cVar1 == '\0') break;
      }
      break;
    case 'C':
      iVar2 = (param_2[5] + 0x76c) / 100 + (param_2[5] + 0x76c >> 0x1f);
      goto LAB_1400cfad9;
    case 'D':
    case 'x':
      pcVar9 = (char *)FUN_1400cf8e0("%m/%d/%y",param_2,param_3,param_4);
      break;
    case 'F':
      pcVar9 = (char *)FUN_1400cf8e0("%Y-%m-%d",param_2,param_3,param_4);
      break;
    case 'G':
    case 'V':
    case 'g':
      iVar2 = param_2[7];
      uVar11 = param_2[5] + 0x76c;
      uVar4 = uVar11 & 0x80000003;
      if ((int)uVar4 < 0) {
        uVar4 = (uVar4 - 1 | 0xfffffffc) + 1;
      }
      while( true ) {
        if ((uVar4 == 0) &&
           ((uVar11 != ((int)uVar11 / 100) * 100 || (uVar11 == ((int)uVar11 / 400) * 400)))) {
          uVar4 = 0x16e;
        }
        else {
          uVar4 = 0x16d;
        }
        iVar10 = ((iVar2 - param_2[6]) + 0xb) % 7 + -3;
        iVar6 = ((uVar4 / 7) * 7 - uVar4) + iVar10;
        if (iVar6 < -3) {
          iVar6 = iVar6 + 7;
        }
        if ((int)(iVar6 + uVar4) <= iVar2) {
          uVar11 = uVar11 + 1;
          iVar2 = 1;
          goto LAB_1400cff28;
        }
        if (iVar10 <= iVar2) break;
        uVar11 = uVar11 - 1;
        uVar4 = uVar11 & 0x80000003;
        if ((int)uVar4 < 0) {
          uVar4 = (uVar4 - 1 | 0xfffffffc) + 1;
        }
        if ((uVar4 == 0) &&
           ((uVar11 != ((int)uVar11 / 100) * 100 || (uVar11 == ((int)uVar11 / 400) * 400)))) {
          iVar2 = iVar2 + 0x16e;
        }
        else {
          iVar2 = iVar2 + 0x16d;
        }
      }
      iVar2 = (iVar2 - iVar10) / 7 + 1;
LAB_1400cff28:
      if (cVar1 == 'V') {
        pcVar9 = (char *)FUN_1400cf860(iVar2,&DAT_14023eab0,param_3,param_4);
        param_2 = local_78;
      }
      else if (cVar1 == 'g') {
        pcVar9 = (char *)FUN_1400cf860((int)uVar11 % 100,&DAT_14023eab0,param_3,param_4);
        param_2 = local_78;
      }
      else {
        pcVar9 = (char *)FUN_1400cf860(uVar11,&DAT_14023ea3c,param_3,param_4);
        param_2 = local_78;
      }
      break;
    case 'H':
      iVar2 = param_2[2];
      goto LAB_1400cfae0;
    case 'I':
      iVar2 = 0xc;
      if (param_2[2] % 0xc != 0) {
        iVar2 = param_2[2] % 0xc;
      }
      goto LAB_1400cfae0;
    case 'M':
      iVar2 = param_2[1];
      goto LAB_1400cfae0;
    case 'R':
      pcVar9 = (char *)FUN_1400cf8e0("%H:%M",param_2,param_3,param_4);
      break;
    case 'S':
      iVar2 = *param_2;
      goto LAB_1400cfae0;
    case 'T':
    case 'X':
      pcVar9 = (char *)FUN_1400cf8e0("%H:%M:%S",param_2,param_3,param_4);
      break;
    case 'U':
      iVar2 = param_2[7] - param_2[6];
      goto LAB_1400cfda5;
    case 'W':
      if (param_2[6] == 0) {
        iVar2 = param_2[7] + -6;
      }
      else {
        iVar2 = param_2[7] - (param_2[6] + -1);
      }
LAB_1400cfda5:
      iVar2 = (iVar2 + 7) / 7 + (iVar2 + 7 >> 0x1f);
LAB_1400cfad9:
      iVar2 = iVar2 - (iVar2 >> 0x1f);
      goto LAB_1400cfae0;
    case 'Y':
      puVar7 = &DAT_14023ea3c;
      iVar2 = param_2[5] + 0x76c;
      goto LAB_1400cfae7;
    case 'Z':
      pcVar5 = "?";
      for (; pcVar9 < param_4; pcVar9 = pcVar9 + 1) {
        cVar1 = *pcVar5;
        pcVar5 = pcVar5 + 1;
        *pcVar9 = cVar1;
        if (cVar1 == '\0') break;
      }
      break;
    case 'a':
      iVar2 = param_2[6];
      if ((iVar2 < 0) || (6 < iVar2)) {
        pcVar5 = "?";
      }
      else {
        pcVar5 = &DAT_14023e7f8 + (longlong)iVar2 * 7;
      }
      for (; pcVar9 < param_4; pcVar9 = pcVar9 + 1) {
        cVar1 = *pcVar5;
        pcVar5 = pcVar5 + 1;
        *pcVar9 = cVar1;
        if (cVar1 == '\0') break;
      }
      break;
    case 'b':
    case 'h':
      iVar2 = param_2[4];
      if ((iVar2 < 0) || (0xb < iVar2)) {
        pcVar5 = "?";
      }
      else {
        pcVar5 = &DAT_14023e8c0 + (longlong)iVar2 * 0xc;
      }
      for (; pcVar9 < param_4; pcVar9 = pcVar9 + 1) {
        cVar1 = *pcVar5;
        pcVar5 = pcVar5 + 1;
        *pcVar9 = cVar1;
        if (cVar1 == '\0') break;
      }
      break;
    case 'c':
      pcVar9 = (char *)FUN_1400cf8e0("%a %b %e %H:%M:%S %Y",param_2,param_3,param_4);
      break;
    case 'd':
      iVar2 = param_2[3];
      goto LAB_1400cfae0;
    case 'e':
      puVar7 = &DAT_14023ea84;
      iVar2 = param_2[3];
      goto LAB_1400cfae7;
    case 'j':
      puVar7 = &DAT_14023ea70;
      iVar2 = param_2[7] + 1;
      goto LAB_1400cfae7;
    case 'k':
      puVar7 = &DAT_14023ea84;
      iVar2 = param_2[2];
      goto LAB_1400cfae7;
    case 'l':
      puVar7 = &DAT_14023ea84;
      iVar2 = 0xc;
      if (param_2[2] % 0xc != 0) {
        iVar2 = param_2[2] % 0xc;
      }
      goto LAB_1400cfae7;
    case 'm':
      iVar2 = param_2[4] + 1;
      goto LAB_1400cfae0;
    case 'n':
      pcVar5 = "\n";
      for (; pcVar9 < param_4; pcVar9 = pcVar9 + 1) {
        cVar1 = *pcVar5;
        pcVar5 = pcVar5 + 1;
        *pcVar9 = cVar1;
        if (cVar1 == '\0') break;
      }
      break;
    case 'p':
      pcVar5 = "am";
      if (0xb < param_2[2]) {
        pcVar5 = "pm";
      }
      for (; pcVar9 < param_4; pcVar9 = pcVar9 + 1) {
        cVar1 = *pcVar5;
        pcVar5 = pcVar5 + 1;
        *pcVar9 = cVar1;
        if (cVar1 == '\0') break;
      }
      break;
    case 'r':
      pcVar9 = (char *)FUN_1400cf8e0("%I:%M:%S %p",param_2,param_3,param_4);
      break;
    case 's':
      local_68 = *param_2;
      local_64 = param_2[1];
      local_60 = param_2[2];
      local_5c = param_2[3];
      local_58 = param_2[4];
      local_54 = param_2[5];
      local_50 = param_2[6];
      local_4c = param_2[7];
      local_48 = param_2[8];
      FUN_1400d0470(&local_68);
      sprintf(local_40,"%lu");
      pcVar5 = local_40;
      for (; pcVar9 < param_4; pcVar9 = pcVar9 + 1) {
        cVar1 = *pcVar5;
        pcVar5 = pcVar5 + 1;
        *pcVar9 = cVar1;
        if (cVar1 == '\0') break;
      }
      break;
    case 't':
      pcVar5 = "\t";
      for (; pcVar9 < param_4; pcVar9 = pcVar9 + 1) {
        cVar1 = *pcVar5;
        pcVar5 = pcVar5 + 1;
        *pcVar9 = cVar1;
        if (cVar1 == '\0') break;
      }
      break;
    case 'u':
      puVar7 = &DAT_14027b594;
      iVar2 = param_2[6];
      if (param_2[6] == 0) {
        iVar2 = 7;
      }
      goto LAB_1400cfae7;
    case 'v':
      pcVar9 = (char *)FUN_1400cf8e0("%e-%b-%Y",param_2,param_3,param_4);
      break;
    case 'w':
      puVar7 = &DAT_14027b594;
      iVar2 = param_2[6];
      goto LAB_1400cfae7;
    case 'y':
      iVar2 = (param_2[5] + 0x76c) % 100;
LAB_1400cfae0:
      puVar7 = &DAT_14023eab0;
LAB_1400cfae7:
      pcVar9 = (char *)FUN_1400cf860(iVar2,puVar7,param_3,param_4);
      break;
    case 'z':
      FUN_1400d04a0(local_40);
      FUN_1400d06d0(local_40);
      iVar2 = FUN_1400d0870(local_40);
      if (iVar2 < 0) {
        pcVar8 = "-";
        for (; param_3 < param_4; param_3 = param_3 + 1) {
          cVar1 = *pcVar8;
          pcVar8 = pcVar8 + 1;
          *param_3 = cVar1;
          if (cVar1 == '\0') break;
        }
      }
      else {
        pcVar8 = "+";
        for (; param_3 < param_4; param_3 = param_3 + 1) {
          cVar1 = *pcVar8;
          pcVar8 = pcVar8 + 1;
          *param_3 = cVar1;
          if (cVar1 == '\0') break;
        }
      }
      uVar3 = FUN_1400cf860(iVar2 / 0xe10,&DAT_14023eab0,param_3,param_4);
      pcVar9 = (char *)FUN_1400cf860((iVar2 % 0xe10) / 0x3c,&DAT_14023eab0,uVar3,param_4);
      param_2 = local_78;
      pcVar8 = local_70;
    }
    cVar1 = pcVar8[1];
    param_1 = pcVar8 + 1;
    param_3 = pcVar9;
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400d0260(undefined8 param_1)

{
  char cVar1;
  undefined1 *puVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  undefined1 auStack_198 [32];
  __time64_t local_178;
  undefined1 local_170 [24];
  undefined1 local_158 [40];
  char local_130 [72];
  char local_e8 [200];
  undefined1 local_20 [8];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_198;
  FUN_1400d04a0(local_170);
  FUN_1400d06d0(local_170);
  FUN_1400d0870(local_170);
  sprintf(local_130,"%+.2d%.2d");
  local_178 = _time64((__time64_t *)0x0);
  FUN_1400d03e0(&local_178,local_158);
  puVar2 = (undefined1 *)FUN_1400cf8e0("%a, %d %b %Y %H:%M:%S ",local_158,local_e8,local_20);
  if (puVar2 != local_20) {
    *puVar2 = 0;
  }
  lVar3 = -1;
  pcVar4 = local_e8;
  do {
    pcVar5 = pcVar4;
    if (lVar3 == 0) break;
    lVar3 = lVar3 + -1;
    pcVar5 = pcVar4 + 1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar5;
  } while (cVar1 != '\0');
  lVar3 = 0;
  do {
    cVar1 = local_130[lVar3];
    pcVar5[lVar3 + -1] = cVar1;
    lVar3 = lVar3 + 1;
  } while (cVar1 != '\0');
  FUN_1400bdb00(param_1,local_e8);
  return;
}



undefined8 * FUN_1400d03b0(undefined8 *param_1,byte param_2)

{
  *param_1 = DateParser::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



int * FUN_1400d03e0(__time64_t *param_1,int *param_2)

{
  tm *ptVar1;
  
  if (DAT_140316ef8 == '\0') {
    _tzset();
    DAT_140316ef8 = '\x01';
  }
  ptVar1 = _localtime64(param_1);
  if ((ptVar1 != (tm *)0x0) && (param_2 != (int *)0x0)) {
    *param_2 = ptVar1->tm_sec;
    param_2[1] = ptVar1->tm_min;
    param_2[2] = ptVar1->tm_hour;
    param_2[3] = ptVar1->tm_mday;
    param_2[4] = ptVar1->tm_mon;
    param_2[5] = ptVar1->tm_year;
    param_2[6] = ptVar1->tm_wday;
    param_2[7] = ptVar1->tm_yday;
    param_2[8] = ptVar1->tm_isdst;
  }
  return param_2;
}



void FUN_1400d0470(tm *param_1)

{
  if (DAT_140316ef8 == '\0') {
    _tzset();
    DAT_140316ef8 = '\x01';
  }
                    // WARNING: Could not recover jumptable at 0x0001400d0497. Too many branches
                    // WARNING: Treating indirect jump as call
  _mktime64(param_1);
  return;
}



undefined8 * FUN_1400d04a0(undefined8 *param_1)

{
  *(undefined4 *)(param_1 + 2) = 0x10100;
  *(undefined4 *)((longlong)param_1 + 0x14) = 0xffffffff;
  *param_1 = 0;
  param_1[1] = 0;
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400d04c0(ushort *param_1,__time64_t *param_2)

{
  __time64_t _Var1;
  longlong lVar2;
  undefined1 auStack_78 [32];
  _FILETIME local_58;
  SYSTEMTIME local_50;
  tm local_40;
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_78;
  if ((char)param_1[8] == '\0') {
    local_50.wYear = *param_1;
    local_50.wSecond = param_1[6];
    local_50.wMonth = param_1[1];
    local_50.wMinute = param_1[5];
    local_50.wMilliseconds = param_1[7];
    local_50.wHour = param_1[4];
    local_50.wDayOfWeek = param_1[2];
    local_50.wDay = param_1[3];
    SystemTimeToFileTime(&local_50,&local_58);
    lVar2 = ((ulonglong)local_58.dwHighDateTime << 0x20) + -0x19db1ded53e8000 +
            (ulonglong)local_58.dwLowDateTime;
    lVar2 = SUB168(SEXT816(-0x29406b2a1a85bd43) * SEXT816(lVar2),8) + lVar2;
    *param_2 = (lVar2 >> 0x17) - (lVar2 >> 0x3f);
  }
  else {
    local_40.tm_year = *param_1 - 0x76c;
    local_40.tm_mon = param_1[1] - 1;
    local_40.tm_isdst = -1;
    local_40._26_6_ = 0;
    local_40.tm_wday._0_2_ = param_1[2];
    local_40.tm_mday._0_2_ = param_1[3];
    local_40.tm_hour = (uint)param_1[4];
    local_40.tm_mday._2_2_ = 0;
    local_40.tm_min._0_2_ = param_1[5];
    local_40.tm_sec = (uint)param_1[6];
    local_40.tm_min._2_2_ = 0;
    if (DAT_140316ef8 == '\0') {
      _tzset();
      DAT_140316ef8 = '\x01';
    }
    _Var1 = _mktime64(&local_40);
    *param_2 = _Var1;
  }
  *(undefined1 *)(param_2 + 1) = *(undefined1 *)((longlong)param_1 + 0x11);
  *(char *)((longlong)param_2 + 9) = (char)param_1[9];
  *(undefined1 *)((longlong)param_2 + 10) = *(undefined1 *)((longlong)param_1 + 0x13);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400d0640(WORD *param_1)

{
  undefined1 auStack_48 [32];
  _SYSTEMTIME local_28;
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_48;
  GetSystemTime(&local_28);
  param_1[6] = local_28.wSecond;
  *param_1 = local_28.wYear;
  param_1[1] = local_28.wMonth;
  param_1[10] = 0xffff;
  param_1[0xb] = 0xffff;
  param_1[5] = local_28.wMinute;
  param_1[8] = 0x100;
  param_1[9] = 1;
  param_1[7] = local_28.wMilliseconds;
  param_1[4] = local_28.wHour;
  param_1[2] = local_28.wDayOfWeek;
  param_1[3] = local_28.wDay;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400d06d0(WORD *param_1)

{
  undefined1 auStack_48 [32];
  _SYSTEMTIME local_28;
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_48;
  GetLocalTime(&local_28);
  param_1[6] = local_28.wSecond;
  *param_1 = local_28.wYear;
  param_1[1] = local_28.wMonth;
  param_1[10] = 0xffff;
  param_1[0xb] = 0xffff;
  param_1[5] = local_28.wMinute;
  param_1[8] = 0x101;
  param_1[9] = 1;
  param_1[7] = local_28.wMilliseconds;
  param_1[4] = local_28.wHour;
  param_1[2] = local_28.wDayOfWeek;
  param_1[3] = local_28.wDay;
  return;
}



void FUN_1400d0760(short *param_1)

{
  tm *ptVar1;
  ulonglong local_res8;
  ulonglong local_48;
  undefined2 local_40;
  undefined1 local_3e;
  short local_38;
  short local_34;
  short local_30;
  short local_2c;
  short local_28;
  short local_24;
  short local_20;
  int local_18;
  
  if ((char)param_1[8] == '\0') {
    local_48 = 0;
    local_3e = 0;
    local_40 = 0x101;
    FUN_1400d04c0(param_1,&local_48);
    local_res8 = local_48 & 0xffffffff;
    if (DAT_140316ef8 == '\0') {
      _tzset();
      DAT_140316ef8 = '\x01';
    }
    ptVar1 = _localtime64((__time64_t *)&local_res8);
    if (ptVar1 != (tm *)0x0) {
      local_38 = (short)ptVar1->tm_sec;
      local_34 = (short)ptVar1->tm_min;
      local_30 = (short)ptVar1->tm_hour;
      local_2c = (short)ptVar1->tm_mday;
      local_28 = (short)ptVar1->tm_mon;
      local_24 = (short)ptVar1->tm_year;
      local_20 = (short)ptVar1->tm_wday;
      local_18 = ptVar1->tm_isdst;
    }
    param_1[7] = 0;
    *(int *)(param_1 + 10) = local_18;
    *param_1 = local_24 + 0x76c;
    *(undefined1 *)(param_1 + 8) = 1;
    param_1[1] = local_28 + 1;
    param_1[2] = local_20 + -1;
    param_1[3] = local_2c;
    param_1[4] = local_30;
    param_1[5] = local_34;
    param_1[6] = local_38;
  }
  return;
}



ulonglong FUN_1400d0870(undefined8 *param_1)

{
  ulonglong uVar1;
  undefined8 local_38;
  undefined2 local_30;
  undefined1 local_2e;
  undefined8 local_28;
  undefined2 local_20;
  undefined2 local_1e;
  undefined2 local_1c;
  undefined2 local_1a;
  undefined1 local_18;
  undefined1 local_17;
  undefined1 local_16;
  undefined1 local_15;
  undefined4 local_14;
  
  if (*(char *)(param_1 + 2) == '\0') {
    local_18 = 0;
    local_1c = *(undefined2 *)((longlong)param_1 + 0xc);
    local_1e = *(undefined2 *)((longlong)param_1 + 10);
    local_1a = *(undefined2 *)((longlong)param_1 + 0xe);
    local_20 = *(undefined2 *)(param_1 + 1);
    local_28 = *param_1;
    local_17 = *(undefined1 *)((longlong)param_1 + 0x11);
    local_16 = *(undefined1 *)((longlong)param_1 + 0x12);
    local_15 = *(undefined1 *)((longlong)param_1 + 0x13);
    local_14 = *(undefined4 *)((longlong)param_1 + 0x14);
    FUN_1400d0760(&local_28);
    uVar1 = FUN_1400d0870(&local_28);
    return uVar1;
  }
  *(undefined1 *)(param_1 + 2) = 0;
  local_38 = 0;
  local_30 = 0x101;
  local_2e = 0;
  FUN_1400d04c0(param_1,&local_38);
  *(undefined1 *)(param_1 + 2) = 1;
  local_28 = 0;
  local_20 = 0x101;
  local_1e = (ushort)local_1e._1_1_ << 8;
  FUN_1400d04c0(param_1,&local_28);
  return (ulonglong)(uint)((int)local_38 - (int)local_28);
}



void FUN_1400d0960(longlong param_1)

{
  __uint64 _Var1;
  void *pvVar2;
  
  if (*(longlong *)(param_1 + 0x18) == 0) {
    *(undefined4 *)(param_1 + 0xc) = 5;
    _Var1 = SUB168(ZEXT816(8) * ZEXT816(5),0);
    if (SUB168(ZEXT816(8) * ZEXT816(5),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    pvVar2 = operator_new(_Var1);
    *(void **)(param_1 + 0x18) = pvVar2;
    if (*(void **)(param_1 + 0x18) == (void *)0x0) {
      *(undefined4 *)(param_1 + 0xc) = 0;
    }
    else {
      memset(*(void **)(param_1 + 0x18),0,(longlong)*(int *)(param_1 + 0xc) << 3);
    }
  }
  return;
}



undefined8 * FUN_1400d09e0(undefined8 *param_1,int param_2,int param_3)

{
  undefined1 auVar1 [16];
  __uint64 _Var2;
  void *_Dst;
  
  *(int *)((longlong)param_1 + 0xc) = param_2;
  *(int *)(param_1 + 1) = param_3;
  *(undefined4 *)(param_1 + 2) = 0;
  *(undefined1 *)(param_1 + 4) = 0;
  *param_1 = ExtPtrArray::vftable;
  if (param_2 < 1) {
    param_2 = 5;
  }
  if (param_3 < 1) {
    param_3 = 5;
  }
  *(int *)((longlong)param_1 + 0xc) = param_2;
  *(int *)(param_1 + 1) = param_3;
  auVar1._8_8_ = 0;
  auVar1._0_8_ = (longlong)param_2;
  _Var2 = SUB168(ZEXT816(8) * auVar1,0);
  if (SUB168(ZEXT816(8) * auVar1,8) != 0) {
    _Var2 = 0xffffffffffffffff;
  }
  _Dst = operator_new(_Var2);
  param_1[3] = _Dst;
  if (_Dst != (void *)0x0) {
    memset(_Dst,0,(longlong)*(int *)((longlong)param_1 + 0xc) << 3);
    return param_1;
  }
  *(undefined4 *)((longlong)param_1 + 0xc) = 0;
  return param_1;
}



undefined8 * FUN_1400d0a70(undefined8 *param_1)

{
  param_1[1] = 5;
  *param_1 = ExtPtrArray::vftable;
  *(undefined4 *)(param_1 + 2) = 0;
  param_1[3] = 0;
  *(undefined1 *)(param_1 + 4) = 0;
  return param_1;
}



undefined8 FUN_1400d0aa0(longlong param_1,int param_2)

{
  if (((-1 < param_2) && (param_2 < *(int *)(param_1 + 0x10))) &&
     (*(longlong *)(param_1 + 0x18) != 0)) {
    return *(undefined8 *)(*(longlong *)(param_1 + 0x18) + (longlong)param_2 * 8);
  }
  return 0;
}



undefined8 FUN_1400d0ac0(longlong param_1)

{
  int iVar1;
  int iVar2;
  
  iVar2 = *(int *)(param_1 + 0x10);
  if ((((iVar2 != 0) && (iVar1 = iVar2 + -1, -1 < iVar1)) && (iVar1 < iVar2)) &&
     (*(longlong *)(param_1 + 0x18) != 0)) {
    return *(undefined8 *)(*(longlong *)(param_1 + 0x18) + (longlong)iVar1 * 8);
  }
  return 0;
}



undefined8 FUN_1400d0af0(longlong param_1)

{
  int iVar1;
  undefined1 auVar2 [16];
  undefined8 uVar3;
  __uint64 _Var4;
  void *_Dst;
  int iVar5;
  
  FUN_1400d0960();
  if (*(longlong *)(param_1 + 0x18) == 0) {
LAB_1400d0b17:
    uVar3 = 0;
  }
  else {
    *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
    iVar1 = *(int *)(param_1 + 0x10);
    if (*(int *)(param_1 + 0xc) < iVar1) {
      iVar5 = *(int *)(param_1 + 0xc) + *(int *)(param_1 + 8);
      *(int *)(param_1 + 0xc) = iVar5;
      if (iVar5 <= iVar1) {
        *(int *)(param_1 + 0xc) = iVar1 + 1;
      }
      auVar2._8_8_ = 0;
      auVar2._0_8_ = (longlong)*(int *)(param_1 + 0xc);
      _Var4 = SUB168(ZEXT816(8) * auVar2,0);
      if (SUB168(ZEXT816(8) * auVar2,8) != 0) {
        _Var4 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var4);
      if (_Dst == (void *)0x0) goto LAB_1400d0b17;
      memset(_Dst,0,(longlong)*(int *)(param_1 + 0xc) << 3);
      if ((*(int *)(param_1 + 0x10) != 0) && (*(void **)(param_1 + 0x18) != (void *)0x0)) {
        memcpy(_Dst,*(void **)(param_1 + 0x18),(longlong)(*(int *)(param_1 + 0x10) + -1) << 3);
      }
      if (*(void **)(param_1 + 0x18) != (void *)0x0) {
        operator_delete(*(void **)(param_1 + 0x18));
      }
      *(void **)(param_1 + 0x18) = _Dst;
      if (*(int *)(param_1 + 8) < 100000) {
        iVar1 = *(int *)(param_1 + 0xc);
        if (100000 < *(int *)(param_1 + 0xc)) {
          iVar1 = 100000;
        }
        *(int *)(param_1 + 8) = iVar1;
      }
    }
    uVar3 = 1;
  }
  return uVar3;
}



void FUN_1400d0bf0(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x10) = 0;
  return;
}



undefined8 FUN_1400d0c00(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  int iVar3;
  
  iVar3 = *(int *)(param_1 + 0x10);
  if ((((iVar3 != 0) && (-1 < param_2)) && (param_2 < iVar3)) &&
     (lVar1 = *(longlong *)(param_1 + 0x18), lVar1 != 0)) {
    uVar2 = *(undefined8 *)(lVar1 + (longlong)param_2 * 8);
    if (param_2 == iVar3 + -1) {
      *(int *)(param_1 + 0x10) = iVar3 + -1;
      return uVar2;
    }
    iVar3 = (iVar3 - param_2) + -1;
    if (0 < iVar3) {
      memmove((void *)(lVar1 + (longlong)param_2 * 8),(void *)(lVar1 + (longlong)(param_2 + 1) * 8),
              (longlong)iVar3 << 3);
    }
    *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + -1;
    return uVar2;
  }
  return 0;
}



void FUN_1400d0c90(longlong param_1,undefined8 param_2)

{
  char cVar1;
  
  cVar1 = FUN_1400d0af0();
  if ((cVar1 != '\0') && (*(longlong *)(param_1 + 0x18) != 0)) {
    *(undefined8 *)(*(longlong *)(param_1 + 0x18) + -8 + (longlong)*(int *)(param_1 + 0x10) * 8) =
         param_2;
  }
  return;
}



undefined8 FUN_1400d0cd0(longlong param_1)

{
  undefined8 uVar1;
  
  if (*(int *)(param_1 + 0x10) == 0) {
    return 0;
  }
  FUN_1400d0960();
  if (*(longlong *)(param_1 + 0x18) == 0) {
    return 0;
  }
  uVar1 = *(undefined8 *)
           (*(longlong *)(param_1 + 0x18) + -8 + (longlong)*(int *)(param_1 + 0x10) * 8);
  FUN_1400d0c00(param_1,*(int *)(param_1 + 0x10) + -1);
  return uVar1;
}



void FUN_1400d0d30(longlong param_1)

{
  undefined8 *puVar1;
  ulonglong uVar2;
  uint uVar3;
  ulonglong uVar4;
  
  if ((*(int *)(param_1 + 0x10) != 0) && (*(longlong *)(param_1 + 0x18) != 0)) {
    uVar2 = 0;
    uVar4 = uVar2;
    if (0 < *(int *)(param_1 + 0x10)) {
      do {
        if (*(longlong *)(uVar2 + *(longlong *)(param_1 + 0x18)) != 0) {
          puVar1 = *(undefined8 **)(uVar2 + *(longlong *)(param_1 + 0x18));
          if (puVar1 != (undefined8 *)0x0) {
            (**(code **)*puVar1)(puVar1,1);
          }
          *(undefined8 *)(uVar2 + *(longlong *)(param_1 + 0x18)) = 0;
        }
        uVar3 = (int)uVar4 + 1;
        uVar2 = uVar2 + 8;
        uVar4 = (ulonglong)uVar3;
      } while ((int)uVar3 < *(int *)(param_1 + 0x10));
    }
    *(undefined4 *)(param_1 + 0x10) = 0;
  }
  return;
}



void FUN_1400d0db0(void)

{
  undefined8 *puVar1;
  
  puVar1 = operator_new(0x28);
  if (puVar1 != (undefined8 *)0x0) {
    *puVar1 = ExtPtrArray::vftable;
    puVar1[1] = 5;
    *(undefined4 *)(puVar1 + 2) = 0;
    puVar1[3] = 0;
    *(undefined1 *)(puVar1 + 4) = 0;
  }
  return;
}



void FUN_1400d0e10(undefined8 *param_1)

{
  *param_1 = ExtPtrArray::vftable;
  if (*(char *)(param_1 + 4) != '\0') {
    FUN_1400d0d30();
  }
  if ((void *)param_1[3] != (void *)0x0) {
    operator_delete((void *)param_1[3]);
  }
  param_1[3] = 0;
  param_1[1] = 0;
  *(undefined4 *)(param_1 + 2) = 0;
  return;
}



undefined8 * FUN_1400d0e50(undefined8 *param_1,uint param_2)

{
  *param_1 = ExtPtrArray::vftable;
  if (*(char *)(param_1 + 4) != '\0') {
    FUN_1400d0d30();
  }
  if ((void *)param_1[3] != (void *)0x0) {
    operator_delete((void *)param_1[3]);
  }
  param_1[3] = 0;
  param_1[1] = 0;
  *(undefined4 *)(param_1 + 2) = 0;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1400d0eb0(undefined8 *param_1)

{
  *param_1 = ChilkatObject::vftable;
  param_1[1] = DAT_1402f9470;
  DAT_1402f9470 = DAT_1402f9470 + 1;
  return param_1;
}



void FUN_1400d0ee0(undefined8 *param_1)

{
  *param_1 = ChilkatObject::vftable;
  return;
}



undefined8 * FUN_1400d0ef0(undefined8 *param_1,byte param_2)

{
  *param_1 = ChilkatObject::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



char * FUN_1400d0f20(char *param_1,char *param_2)

{
  char cVar1;
  char cVar2;
  int iVar3;
  char cVar4;
  int iVar5;
  char *pcVar6;
  
  if (((param_1 != (char *)0x0) && (param_2 != (char *)0x0)) && (cVar4 = *param_1, cVar4 != '\0')) {
    cVar1 = *param_2;
    do {
      iVar5 = (int)cVar4;
      if ((byte)(cVar4 + 0x9fU) < 0x1a) {
        iVar5 = iVar5 + -0x20;
      }
      iVar3 = (int)cVar1;
      if ((byte)(cVar1 + 0x9fU) < 0x1a) {
        iVar3 = iVar3 + -0x20;
      }
      if (iVar5 == iVar3) {
        if (cVar4 == '\0') {
          return (char *)0x0;
        }
        pcVar6 = param_1;
        cVar4 = cVar1;
        while( true ) {
          cVar2 = *pcVar6;
          if ((cVar2 < 'a') || ('z' < cVar2)) {
            iVar5 = (int)cVar2;
          }
          else {
            iVar5 = cVar2 + -0x20;
          }
          iVar3 = (int)cVar4;
          if ((byte)(cVar4 + 0x9fU) < 0x1a) {
            iVar3 = iVar3 + -0x20;
          }
          if (iVar5 != iVar3) break;
          cVar4 = pcVar6[(longlong)(param_2 + (1 - (longlong)param_1))];
          pcVar6 = pcVar6 + 1;
          if (cVar4 == '\0') {
            return param_1;
          }
        }
      }
      cVar4 = param_1[1];
      param_1 = param_1 + 1;
    } while (cVar4 != '\0');
  }
  return (char *)0x0;
}



bool FUN_1400d0fd0(char *param_1,char *param_2,char param_3)

{
  char cVar1;
  char cVar2;
  int iVar3;
  uint uVar4;
  char *pcVar5;
  ulonglong uVar6;
  uint uVar7;
  char *pcVar8;
  longlong lVar9;
  ulonglong _MaxCount;
  bool bVar10;
  
  if ((param_1 == (char *)0x0) || (*param_1 == '\0')) {
    if (param_2 == (char *)0x0) {
      return true;
    }
    do {
      cVar1 = *param_2;
      if (cVar1 == '\0') {
        return true;
      }
      param_2 = param_2 + 1;
    } while (cVar1 == '*');
  }
  else if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
    pcVar5 = strchr(param_2,0x2a);
    if (pcVar5 != (char *)0x0) {
      uVar4 = (int)pcVar5 - (int)param_2;
      if (param_3 == '\0') {
        iVar3 = _strnicmp(param_1,param_2,(ulonglong)uVar4);
      }
      else {
        iVar3 = strncmp(param_1,param_2,(ulonglong)uVar4);
      }
      if (iVar3 != 0) {
        return false;
      }
      param_1 = param_1 + uVar4;
      do {
        uVar6 = 0xffffffffffffffff;
        pcVar8 = param_1;
        do {
          if (uVar6 == 0) break;
          uVar6 = uVar6 - 1;
          cVar1 = *pcVar8;
          pcVar8 = pcVar8 + 1;
        } while (cVar1 != '\0');
        uVar6 = ~uVar6 - 1;
        cVar1 = *pcVar5;
        pcVar8 = pcVar5;
        while (cVar1 == '*') {
          pcVar8 = pcVar8 + 1;
          cVar1 = *pcVar8;
        }
        if (*pcVar8 == '\0') {
          return true;
        }
        pcVar5 = strchr(pcVar8,0x2a);
        if (pcVar5 == (char *)0x0) {
          lVar9 = -1;
          pcVar5 = pcVar8;
          goto code_r0x0001400d1131;
        }
        uVar4 = (int)pcVar5 - (int)pcVar8;
        if ((uint)uVar6 < uVar4) {
          return false;
        }
        while( true ) {
          if (param_3 == '\0') {
            iVar3 = _strnicmp(param_1,pcVar8,(ulonglong)uVar4);
          }
          else {
            iVar3 = strncmp(param_1,pcVar8,(ulonglong)uVar4);
          }
          if (iVar3 == 0) break;
          uVar7 = (int)uVar6 - 1;
          uVar6 = (ulonglong)uVar7;
          param_1 = param_1 + 1;
          if (uVar7 < uVar4) {
            return false;
          }
        }
        param_1 = param_1 + uVar4;
      } while( true );
    }
    if (param_3 == '\0') {
      iVar3 = _stricmp(param_1,param_2);
      return iVar3 == 0;
    }
    lVar9 = (longlong)param_2 - (longlong)param_1;
    do {
      cVar1 = *param_1;
      cVar2 = param_1[lVar9];
      if (cVar1 != cVar2) break;
      param_1 = param_1 + 1;
    } while (cVar2 != '\0');
    return cVar1 == cVar2;
  }
  return false;
  while( true ) {
    lVar9 = lVar9 + -1;
    cVar1 = *pcVar5;
    pcVar5 = pcVar5 + 1;
    if (cVar1 == '\0') break;
code_r0x0001400d1131:
    if (lVar9 == 0) break;
  }
  uVar4 = ~(uint)lVar9 - 1;
  bVar10 = false;
  if (uVar4 <= (uint)uVar6) {
    _MaxCount = (ulonglong)uVar4;
    if (param_3 == '\0') {
      iVar3 = _strnicmp(param_1 + ((uVar6 & 0xffffffff) - _MaxCount),pcVar8,_MaxCount);
      bVar10 = iVar3 == 0;
    }
    else {
      iVar3 = strncmp(param_1 + ((uVar6 & 0xffffffff) - _MaxCount),pcVar8,_MaxCount);
      bVar10 = iVar3 == 0;
    }
  }
  return bVar10;
}



undefined1 FUN_1400d11b0(longlong param_1,longlong param_2)

{
  undefined1 uVar1;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    uVar1 = FUN_1400d0fd0();
    return uVar1;
  }
  return 0;
}



void * FUN_1400d11d0(uint param_1)

{
  void *pvVar1;
  
  if (param_1 == 0) {
    pvVar1 = (void *)0x0;
  }
  else {
    pvVar1 = operator_new((ulonglong)param_1);
  }
  return pvVar1;
}



undefined8 * FUN_1400d1210(undefined8 *param_1)

{
  *param_1 = ChilkatCritSec::vftable;
  InitializeCriticalSection((LPCRITICAL_SECTION)(param_1 + 1));
  return param_1;
}



void FUN_1400d1240(undefined8 *param_1)

{
  LPCRITICAL_SECTION lpCriticalSection;
  
  lpCriticalSection = (LPCRITICAL_SECTION)(param_1 + 1);
  *param_1 = ChilkatCritSec::vftable;
  EnterCriticalSection(lpCriticalSection);
  LeaveCriticalSection(lpCriticalSection);
                    // WARNING: Could not recover jumptable at 0x0001400d126e. Too many branches
                    // WARNING: Treating indirect jump as call
  DeleteCriticalSection(lpCriticalSection);
  return;
}



void FUN_1400d1280(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001400d1284. Too many branches
                    // WARNING: Treating indirect jump as call
  EnterCriticalSection((LPCRITICAL_SECTION)(param_1 + 8));
  return;
}



void FUN_1400d1290(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001400d1294. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection((LPCRITICAL_SECTION)(param_1 + 8));
  return;
}



undefined8 * FUN_1400d12a0(undefined8 *param_1,uint param_2)

{
  *param_1 = ChilkatCritSec::vftable;
  EnterCriticalSection((LPCRITICAL_SECTION)(param_1 + 1));
  LeaveCriticalSection((LPCRITICAL_SECTION)(param_1 + 1));
  DeleteCriticalSection((LPCRITICAL_SECTION)(param_1 + 1));
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400d1300(undefined8 param_1,undefined8 param_2)

{
  undefined4 uVar1;
  undefined8 uVar2;
  undefined1 auStack_108 [32];
  undefined8 local_e8;
  undefined1 local_e0 [16];
  undefined1 local_d0 [56];
  undefined1 local_98 [96];
  undefined1 local_38 [16];
  undefined1 local_28 [16];
  ulonglong local_18;
  
  local_e8 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  FUN_1400b8b30(param_2);
  FUN_1400f4fd0(local_98);
  FUN_1400f5330(local_98,param_1,local_28);
  FUN_1400f0d10(local_e0);
  FUN_1400bcc20(local_d0);
  uVar1 = FUN_1400b8b80(param_1);
  uVar2 = FUN_1400b8b90(param_1);
  FUN_1400f30f0(uVar2,uVar1,local_d0);
  FUN_1400f5260(local_98,local_d0,local_38);
  FUN_1400b97e0(param_2,local_28,0x10);
  FUN_1400b97e0(param_2,local_38,0x10);
  FUN_1400bceb0(local_d0);
  FUN_1400f0d30(local_e0);
  FUN_1400f5000(local_98);
  return;
}



void FUN_1400d1420(char *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  ulonglong uVar2;
  char *pcVar3;
  undefined8 uVar4;
  undefined1 local_30 [40];
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400b8c40();
  uVar2 = 0xffffffffffffffff;
  pcVar3 = param_1;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    cVar1 = *pcVar3;
    pcVar3 = pcVar3 + 1;
  } while (cVar1 != '\0');
  FUN_1400b97e0(local_30,param_1,~uVar2 - 1,param_4,uVar4);
  FUN_1400d1300(local_30,param_2);
  FUN_1400b92d0(local_30);
  return;
}



void FUN_1400d14a0(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined1 local_70 [40];
  undefined1 local_48 [64];
  
  uVar1 = 0xfffffffffffffffe;
  FUN_1400b8c40(local_70);
  FUN_1400c0be0(local_48);
  FUN_1400c0c70(local_48,param_2);
  FUN_1400b83e0(param_1,local_48,local_70,param_4,uVar1);
  FUN_1400d1300(local_70,param_3);
  FUN_1400c0c30(local_48);
  FUN_1400b92d0(local_70);
  return;
}



undefined8 * FUN_1400d1530(undefined8 *param_1,int param_2)

{
  void *pvVar1;
  undefined8 uVar2;
  
  *param_1 = CryptoPtr::vftable;
  uVar2 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  if (param_2 == 2) {
    pvVar1 = operator_new(0x148);
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400e2820(pvVar1);
    }
    param_1[1] = uVar2;
  }
  else if (param_2 == 3) {
    pvVar1 = operator_new(0x48);
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400e0e50(pvVar1);
    }
    param_1[2] = uVar2;
  }
  else if (param_2 == 6) {
    pvVar1 = operator_new(0x58);
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400dd450(pvVar1);
    }
    param_1[3] = uVar2;
  }
  else if (param_2 == 4) {
    pvVar1 = operator_new(0x1130);
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400d5b30(pvVar1);
    }
    param_1[4] = uVar2;
  }
  else if (param_2 == 7) {
    pvVar1 = operator_new(800);
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400d8590(pvVar1);
    }
    param_1[7] = uVar2;
  }
  else if (param_2 == 8) {
    pvVar1 = operator_new(0xa0);
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400d6f40(pvVar1);
    }
    param_1[5] = uVar2;
  }
  else if (param_2 == 9) {
    pvVar1 = operator_new(0x418);
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400d6bb0(pvVar1);
    }
    param_1[6] = uVar2;
  }
  return param_1;
}



undefined8 * FUN_1400d16b0(undefined8 *param_1)

{
  *param_1 = CryptoPtr::vftable;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  return param_1;
}



void FUN_1400d16e0(longlong param_1)

{
  void *pvVar1;
  undefined8 *puVar2;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_1400e0ea0(pvVar1);
    operator_delete(pvVar1);
    *(undefined8 *)(param_1 + 0x10) = 0;
  }
  pvVar1 = *(void **)(param_1 + 0x18);
  if (pvVar1 != (void *)0x0) {
    FUN_1400dd4b0(pvVar1);
    operator_delete(pvVar1);
    *(undefined8 *)(param_1 + 0x18) = 0;
  }
  pvVar1 = *(void **)(param_1 + 8);
  if (pvVar1 != (void *)0x0) {
    FUN_1400e2870(pvVar1);
    operator_delete(pvVar1);
    *(undefined8 *)(param_1 + 8) = 0;
  }
  puVar2 = *(undefined8 **)(param_1 + 0x20);
  if (puVar2 != (undefined8 *)0x0) {
    (**(code **)*puVar2)(puVar2,1);
    *(undefined8 *)(param_1 + 0x20) = 0;
  }
  puVar2 = *(undefined8 **)(param_1 + 0x38);
  if (puVar2 != (undefined8 *)0x0) {
    (**(code **)*puVar2)(puVar2,1);
    *(undefined8 *)(param_1 + 0x38) = 0;
  }
  puVar2 = *(undefined8 **)(param_1 + 0x28);
  if (puVar2 != (undefined8 *)0x0) {
    (**(code **)*puVar2)(puVar2,1);
    *(undefined8 *)(param_1 + 0x28) = 0;
  }
  puVar2 = *(undefined8 **)(param_1 + 0x30);
  if (puVar2 != (undefined8 *)0x0) {
    (**(code **)*puVar2)(puVar2,1);
    *(undefined8 *)(param_1 + 0x30) = 0;
  }
  return;
}



void FUN_1400d17c0(undefined8 *param_1)

{
  *param_1 = CryptoPtr::vftable;
  FUN_1400d16e0();
  return;
}



undefined8 FUN_1400d17d0(longlong param_1)

{
  void *pvVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    FUN_1400d16e0();
    pvVar1 = operator_new(0x148);
    uVar2 = 0;
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400e2820(pvVar1);
    }
    *(undefined8 *)(param_1 + 8) = uVar2;
  }
  else {
    uVar2 = *(undefined8 *)(param_1 + 8);
  }
  return uVar2;
}



undefined8 FUN_1400d1820(longlong param_1)

{
  void *pvVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_1400d16e0();
    pvVar1 = operator_new(0x48);
    uVar2 = 0;
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400e0e50(pvVar1);
    }
    *(undefined8 *)(param_1 + 0x10) = uVar2;
  }
  else {
    uVar2 = *(undefined8 *)(param_1 + 0x10);
  }
  return uVar2;
}



undefined8 FUN_1400d1870(longlong param_1)

{
  void *pvVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 0x18) == 0) {
    FUN_1400d16e0();
    pvVar1 = operator_new(0x58);
    uVar2 = 0;
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400dd450(pvVar1);
    }
    *(undefined8 *)(param_1 + 0x18) = uVar2;
  }
  else {
    uVar2 = *(undefined8 *)(param_1 + 0x18);
  }
  return uVar2;
}



undefined8 FUN_1400d18c0(longlong param_1)

{
  void *pvVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 0x20) == 0) {
    FUN_1400d16e0();
    pvVar1 = operator_new(0x1130);
    uVar2 = 0;
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400d5b30(pvVar1);
    }
    *(undefined8 *)(param_1 + 0x20) = uVar2;
  }
  else {
    uVar2 = *(undefined8 *)(param_1 + 0x20);
  }
  return uVar2;
}



undefined8 FUN_1400d1910(longlong param_1)

{
  void *pvVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 0x28) == 0) {
    FUN_1400d16e0();
    pvVar1 = operator_new(0xa0);
    uVar2 = 0;
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400d6f40(pvVar1);
    }
    *(undefined8 *)(param_1 + 0x28) = uVar2;
  }
  else {
    uVar2 = *(undefined8 *)(param_1 + 0x28);
  }
  return uVar2;
}



undefined8 FUN_1400d1960(longlong param_1)

{
  void *pvVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 0x30) == 0) {
    FUN_1400d16e0();
    pvVar1 = operator_new(0x418);
    uVar2 = 0;
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400d6bb0(pvVar1);
    }
    *(undefined8 *)(param_1 + 0x30) = uVar2;
  }
  else {
    uVar2 = *(undefined8 *)(param_1 + 0x30);
  }
  return uVar2;
}



undefined8 FUN_1400d19b0(longlong param_1)

{
  void *pvVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 0x38) == 0) {
    FUN_1400d16e0();
    pvVar1 = operator_new(800);
    uVar2 = 0;
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400d8590(pvVar1);
    }
    *(undefined8 *)(param_1 + 0x38) = uVar2;
  }
  else {
    uVar2 = *(undefined8 *)(param_1 + 0x38);
  }
  return uVar2;
}



undefined8 * FUN_1400d1a00(undefined8 *param_1,uint param_2)

{
  *param_1 = CryptoPtr::vftable;
  FUN_1400d16e0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1400d1a40(undefined8 *param_1)

{
  *param_1 = SystemCerts::vftable;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  param_1[8] = 0;
  param_1[9] = 0;
  param_1[10] = 0;
  return param_1;
}



void FUN_1400d1a80(undefined8 *param_1)

{
  undefined8 *puVar1;
  
  *param_1 = SystemCerts::vftable;
  puVar1 = (undefined8 *)param_1[5];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[5] = 0;
  }
  puVar1 = (undefined8 *)param_1[6];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[6] = 0;
  }
  puVar1 = (undefined8 *)param_1[3];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[3] = 0;
  }
  puVar1 = (undefined8 *)param_1[4];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[4] = 0;
  }
  puVar1 = (undefined8 *)param_1[8];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[8] = 0;
  }
  puVar1 = (undefined8 *)param_1[7];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[7] = 0;
  }
  puVar1 = (undefined8 *)param_1[1];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[1] = 0;
  }
  puVar1 = (undefined8 *)param_1[2];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[2] = 0;
  }
  puVar1 = (undefined8 *)param_1[9];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[9] = 0;
  }
  puVar1 = (undefined8 *)param_1[10];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[10] = 0;
  }
  return;
}



undefined8
FUN_1400d1b90(longlong param_1,undefined8 param_2,undefined8 param_3,char param_4,undefined1 param_5
             ,undefined1 *param_6,longlong *param_7,char param_8)

{
  char cVar1;
  undefined8 uVar2;
  undefined8 *puVar3;
  char *pcVar4;
  undefined1 local_50 [40];
  
  *param_6 = 0;
  if (param_8 != '\0') {
    (**(code **)(*param_7 + 0x48))(param_7,"SearchRegistryCertificateStores",1);
    (**(code **)(*param_7 + 0x58))(param_7,"certSerialNumber",param_2);
    (**(code **)(*param_7 + 0x58))(param_7,"certIssuerCN",param_3);
    FUN_1400cf520(param_7,"needPrivateKey",param_4);
  }
  if (*(longlong *)(param_1 + 8) == 0) {
    uVar2 = FUN_1400ee800(1,param_7);
    *(undefined8 *)(param_1 + 8) = uVar2;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    uVar2 = FUN_1400eec10(1,param_7);
    *(undefined8 *)(param_1 + 0x10) = uVar2;
  }
  if (*(longlong *)(param_1 + 8) != 0) {
    puVar3 = (undefined8 *)FUN_1400ef110(*(longlong *)(param_1 + 8),param_2,param_3,param_7,param_8)
    ;
    if (puVar3 == (undefined8 *)0x0) {
      if (param_8 != '\0') {
        (**(code **)(*param_7 + 0x30))
                  (param_7,"No match found in MY current-user certificate store.");
      }
      goto LAB_1400d1d5b;
    }
    if (param_4 != '\0') {
      cVar1 = FUN_1401112d0(puVar3,param_7);
      if (cVar1 == '\0') {
        (**(code **)(*param_7 + 0x28))
                  (param_7,"Found matching certificate, but no private key is available.");
      }
      else {
        FUN_1401111b0(puVar3,param_7);
        FUN_1400b8c40(local_50);
        cVar1 = FUN_140110b20(puVar3,param_5,local_50,param_6,param_7);
        if (cVar1 == '\0') {
          (**(code **)(*param_7 + 0x30))
                    (param_7,"Found matching certificate, but no private key accessible.");
        }
        FUN_1400b92d0(local_50);
        if (cVar1 != '\0') goto LAB_1400d1d13;
      }
      (**(code **)*puVar3)(puVar3,1);
      goto LAB_1400d2475;
    }
LAB_1400d1d13:
    if (param_8 == '\0') goto LAB_1400d1d39;
    pcVar4 = "Found match in MY current-user certificate store.";
LAB_1400d1d1f:
    (**(code **)(*param_7 + 0x30))(param_7,pcVar4);
    (**(code **)(*param_7 + 0x50))(param_7);
    goto LAB_1400d1d39;
  }
LAB_1400d1d5b:
  if (*(longlong *)(param_1 + 0x10) != 0) {
    puVar3 = (undefined8 *)
             FUN_1400ef110(*(longlong *)(param_1 + 0x10),param_2,param_3,param_7,param_8);
    if (puVar3 != (undefined8 *)0x0) {
      if (param_4 != '\0') {
        cVar1 = FUN_1401112d0(puVar3,param_7);
        if (cVar1 == '\0') {
          (**(code **)(*param_7 + 0x28))
                    (param_7,"Found matching certificate, but no private key is available.");
        }
        else {
          FUN_1401111b0(puVar3,param_7);
          FUN_1400b8c40(local_50);
          cVar1 = FUN_140110b20(puVar3,param_5,local_50,param_6,param_7);
          if (cVar1 == '\0') {
            (**(code **)(*param_7 + 0x30))
                      (param_7,"Found matching certificate, but no private key accessible.");
          }
          FUN_1400b92d0(local_50);
          if (cVar1 != '\0') goto LAB_1400d1e1e;
        }
        (**(code **)*puVar3)(puVar3,1);
        goto LAB_1400d2475;
      }
LAB_1400d1e1e:
      if (param_8 == '\0') goto LAB_1400d1d39;
      pcVar4 = "Found match in MY local-machine certificate store.";
      goto LAB_1400d1d1f;
    }
    if (param_8 != '\0') {
      (**(code **)(*param_7 + 0x30))
                (param_7,"No match found in MY local-machine certificate store.");
    }
  }
  if (*(longlong *)(param_1 + 0x20) == 0) {
    uVar2 = FUN_1400eedd0("Software/Microsoft/SystemCertificates/AddressBook",1,param_7);
    *(undefined8 *)(param_1 + 0x20) = uVar2;
  }
  if (*(longlong *)(param_1 + 0x18) == 0) {
    uVar2 = FUN_1400eece0("Software/Microsoft/SystemCertificates/AddressBook",1,param_7);
    *(undefined8 *)(param_1 + 0x18) = uVar2;
  }
  if (*(longlong *)(param_1 + 0x20) != 0) {
    puVar3 = (undefined8 *)
             FUN_1400ef110(*(longlong *)(param_1 + 0x20),param_2,param_3,param_7,param_8);
    if (puVar3 != (undefined8 *)0x0) {
      if (param_4 != '\0') {
        cVar1 = FUN_1401112d0(puVar3,param_7);
        if (cVar1 == '\0') {
          (**(code **)(*param_7 + 0x28))
                    (param_7,"Found matching certificate, but no private key is available.");
        }
        else {
          FUN_1401111b0(puVar3,param_7);
          FUN_1400b8c40(local_50);
          cVar1 = FUN_140110b20(puVar3,param_5,local_50,param_6,param_7);
          if (cVar1 == '\0') {
            (**(code **)(*param_7 + 0x30))
                      (param_7,"Found matching certificate, but no private key accessible.");
          }
          FUN_1400b92d0(local_50);
          if (cVar1 != '\0') goto LAB_1400d1f43;
        }
        (**(code **)*puVar3)(puVar3,1);
        goto LAB_1400d2475;
      }
LAB_1400d1f43:
      if (param_8 == '\0') goto LAB_1400d1d39;
      pcVar4 = "Found match in AddressBook current-user certificate store.";
      goto LAB_1400d1d1f;
    }
    if (param_8 != '\0') {
      (**(code **)(*param_7 + 0x30))
                (param_7,"No match found in AddressBook current-user certificate store.");
    }
  }
  if (*(longlong *)(param_1 + 0x18) != 0) {
    puVar3 = (undefined8 *)
             FUN_1400ef110(*(longlong *)(param_1 + 0x18),param_2,param_3,param_7,param_8);
    if (puVar3 != (undefined8 *)0x0) {
      if (param_4 != '\0') {
        cVar1 = FUN_1401112d0(puVar3,param_7);
        if (cVar1 == '\0') {
          (**(code **)(*param_7 + 0x28))
                    (param_7,"Found matching certificate, but no private key is available.");
        }
        else {
          FUN_1401111b0(puVar3,param_7);
          FUN_1400b8c40(local_50);
          cVar1 = FUN_140110b20(puVar3,param_5,local_50,param_6,param_7);
          if (cVar1 == '\0') {
            (**(code **)(*param_7 + 0x30))
                      (param_7,"Found matching certificate, but no private key accessible.");
          }
          FUN_1400b92d0(local_50);
          if (cVar1 != '\0') goto LAB_1400d2030;
        }
        (**(code **)*puVar3)(puVar3,1);
        goto LAB_1400d2475;
      }
LAB_1400d2030:
      if (param_8 == '\0') goto LAB_1400d1d39;
      pcVar4 = "Found match in AddressBook local-machine certificate store.";
      goto LAB_1400d1d1f;
    }
    if (param_8 != '\0') {
      (**(code **)(*param_7 + 0x30))
                (param_7,"No match found in AddressBook local-machine certificate store.");
    }
  }
  if (*(longlong *)(param_1 + 0x30) == 0) {
    uVar2 = FUN_1400ee8d0(1,param_7);
    *(undefined8 *)(param_1 + 0x30) = uVar2;
  }
  if (*(longlong *)(param_1 + 0x28) == 0) {
    uVar2 = FUN_1400ee9a0(1,param_7);
    *(undefined8 *)(param_1 + 0x28) = uVar2;
  }
  if (*(longlong *)(param_1 + 0x30) != 0) {
    puVar3 = (undefined8 *)
             FUN_1400ef110(*(longlong *)(param_1 + 0x30),param_2,param_3,param_7,param_8);
    if (puVar3 != (undefined8 *)0x0) {
      if (param_4 != '\0') {
        cVar1 = FUN_1401112d0(puVar3,param_7);
        if (cVar1 == '\0') {
          (**(code **)(*param_7 + 0x28))
                    (param_7,"Found matching certificate, but no private key is available.");
        }
        else {
          FUN_1401111b0(puVar3,param_7);
          FUN_1400b8c40(local_50);
          cVar1 = FUN_140110b20(puVar3,param_5,local_50,param_6,param_7);
          if (cVar1 == '\0') {
            (**(code **)(*param_7 + 0x30))
                      (param_7,"Found matching certificate, but no private key accessible.");
          }
          FUN_1400b92d0(local_50);
          if (cVar1 != '\0') goto LAB_1400d2147;
        }
        (**(code **)*puVar3)(puVar3,1);
        goto LAB_1400d2475;
      }
LAB_1400d2147:
      if (param_8 == '\0') goto LAB_1400d1d39;
      pcVar4 = "Found match in CA current-user certificate store.";
      goto LAB_1400d1d1f;
    }
    if (param_8 != '\0') {
      (**(code **)(*param_7 + 0x30))(param_7,"No match found in CA current-user certificate store.")
      ;
    }
  }
  if (*(longlong *)(param_1 + 0x28) != 0) {
    puVar3 = (undefined8 *)
             FUN_1400ef110(*(longlong *)(param_1 + 0x28),param_2,param_3,param_7,param_8);
    if (puVar3 != (undefined8 *)0x0) {
      if (param_4 != '\0') {
        cVar1 = FUN_1401112d0(puVar3,param_7);
        if (cVar1 == '\0') {
          (**(code **)(*param_7 + 0x28))
                    (param_7,"Found matching certificate, but no private key is available.");
        }
        else {
          FUN_1401111b0(puVar3,param_7);
          FUN_1400b8c40(local_50);
          cVar1 = FUN_140110b20(puVar3,param_5,local_50,param_6,param_7);
          if (cVar1 == '\0') {
            (**(code **)(*param_7 + 0x30))
                      (param_7,"Found matching certificate, but no private key accessible.");
          }
          FUN_1400b92d0(local_50);
          if (cVar1 != '\0') goto LAB_1400d2234;
        }
        (**(code **)*puVar3)(puVar3,1);
        goto LAB_1400d2475;
      }
LAB_1400d2234:
      if (param_8 == '\0') goto LAB_1400d1d39;
      pcVar4 = "Found match in CA local-machine certificate store.";
      goto LAB_1400d1d1f;
    }
    if (param_8 != '\0') {
      (**(code **)(*param_7 + 0x30))
                (param_7,"No match found in CA local-machine certificate store.");
    }
  }
  if (*(longlong *)(param_1 + 0x40) == 0) {
    uVar2 = FUN_1400eeb40(1,param_7);
    *(undefined8 *)(param_1 + 0x40) = uVar2;
  }
  if (*(longlong *)(param_1 + 0x38) == 0) {
    uVar2 = FUN_1400eea70(1,param_7);
    *(undefined8 *)(param_1 + 0x38) = uVar2;
  }
  if (*(longlong *)(param_1 + 0x40) != 0) {
    puVar3 = (undefined8 *)
             FUN_1400ef110(*(longlong *)(param_1 + 0x40),param_2,param_3,param_7,param_8);
    if (puVar3 != (undefined8 *)0x0) {
      if (param_4 != '\0') {
        cVar1 = FUN_1401112d0(puVar3,param_7);
        if (cVar1 == '\0') {
          (**(code **)(*param_7 + 0x28))
                    (param_7,"Found matching certificate, but no private key is available.");
        }
        else {
          FUN_1401111b0(puVar3,param_7);
          FUN_1400b8c40(local_50);
          cVar1 = FUN_140110b20(puVar3,param_5,local_50,param_6,param_7);
          if (cVar1 == '\0') {
            (**(code **)(*param_7 + 0x30))
                      (param_7,"Found matching certificate, but no private key accessible.");
          }
          FUN_1400b92d0(local_50);
          if (cVar1 != '\0') goto LAB_1400d234b;
        }
        (**(code **)*puVar3)(puVar3,1);
        goto LAB_1400d2475;
      }
LAB_1400d234b:
      if (param_8 == '\0') goto LAB_1400d1d39;
      pcVar4 = "Found match in ROOT current-user certificate store.";
      goto LAB_1400d1d1f;
    }
    if (param_8 != '\0') {
      (**(code **)(*param_7 + 0x30))
                (param_7,"No match found in ROOT current-user certificate store.");
    }
  }
  if (*(longlong *)(param_1 + 0x38) == 0) goto LAB_1400d2475;
  puVar3 = (undefined8 *)
           FUN_1400ef110(*(longlong *)(param_1 + 0x38),param_2,param_3,param_7,param_8);
  if (puVar3 == (undefined8 *)0x0) {
    if (param_8 == '\0') {
      return 0;
    }
    (**(code **)(*param_7 + 0x30))
              (param_7,"No match found in ROOT local-machine certificate store.");
    goto LAB_1400d2475;
  }
  if (param_4 != '\0') {
    cVar1 = FUN_1401112d0(puVar3,param_7);
    if (cVar1 == '\0') {
      (**(code **)(*param_7 + 0x28))
                (param_7,"Found matching certificate, but no private key is available.");
    }
    else {
      FUN_1401111b0(puVar3,param_7);
      FUN_1400b8c40(local_50);
      cVar1 = FUN_140110b20(puVar3,param_5,local_50,param_6,param_7);
      if (cVar1 == '\0') {
        (**(code **)(*param_7 + 0x30))
                  (param_7,"Found matching certificate, but no private key accessible.");
      }
      FUN_1400b92d0(local_50);
      if (cVar1 != '\0') goto LAB_1400d2435;
    }
    (**(code **)*puVar3)(puVar3,1);
LAB_1400d2475:
    if (param_8 != '\0') {
      (**(code **)(*param_7 + 0x50))(param_7);
    }
    return 0;
  }
LAB_1400d2435:
  if (param_8 != '\0') {
    (**(code **)(*param_7 + 0x30))(param_7,"Found match in ROOT local-machine certificate store.");
    (**(code **)(*param_7 + 0x50))(param_7);
  }
LAB_1400d1d39:
  uVar2 = FUN_1400ed0d0(puVar3,param_5,param_7);
  return uVar2;
}



undefined8
FUN_1400d24b0(longlong param_1,undefined8 param_2,char param_3,undefined1 param_4,
             undefined1 *param_5,longlong *param_6,char param_7)

{
  char cVar1;
  undefined8 uVar2;
  undefined8 *puVar3;
  char *pcVar4;
  undefined1 local_50 [40];
  
  *param_5 = 0;
  if (param_7 != '\0') {
    (**(code **)(*param_6 + 0x48))(param_6,"SearchRegistryCertificateStores",1);
    (**(code **)(*param_6 + 0x58))(param_6,"subjectKeyId",param_2);
    FUN_1400cf520(param_6,"needPrivateKey",param_3);
  }
  if (*(longlong *)(param_1 + 8) == 0) {
    uVar2 = FUN_1400ee800(1,param_6);
    *(undefined8 *)(param_1 + 8) = uVar2;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    uVar2 = FUN_1400eec10(1,param_6);
    *(undefined8 *)(param_1 + 0x10) = uVar2;
  }
  if (*(longlong *)(param_1 + 8) != 0) {
    puVar3 = (undefined8 *)FUN_1400eeec0(*(longlong *)(param_1 + 8),param_2,param_6,param_7);
    if (puVar3 == (undefined8 *)0x0) {
      if (param_7 != '\0') {
        (**(code **)(*param_6 + 0x30))
                  (param_6,"No match found in MY current-user certificate store.");
      }
      goto LAB_1400d2660;
    }
    if (param_3 != '\0') {
      cVar1 = FUN_1401112d0(puVar3,param_6);
      if (cVar1 == '\0') {
        (**(code **)(*param_6 + 0x28))
                  (param_6,"Found matching certificate, but no private key is available.");
      }
      else {
        FUN_1401111b0(puVar3,param_6);
        FUN_1400b8c40(local_50);
        cVar1 = FUN_140110b20(puVar3,param_4,local_50,param_5,param_6);
        if (cVar1 == '\0') {
          (**(code **)(*param_6 + 0x30))
                    (param_6,"Found matching certificate, but no private key accessible.");
        }
        FUN_1400b92d0(local_50);
        if (cVar1 != '\0') goto LAB_1400d2618;
      }
      (**(code **)*puVar3)(puVar3,1);
      goto LAB_1400d2d3e;
    }
LAB_1400d2618:
    if (param_7 == '\0') goto LAB_1400d263a;
    pcVar4 = "Found match in MY current-user certificate store.";
LAB_1400d2624:
    (**(code **)(*param_6 + 0x30))(param_6,pcVar4);
    (**(code **)(*param_6 + 0x50))(param_6);
    goto LAB_1400d263a;
  }
LAB_1400d2660:
  if (*(longlong *)(param_1 + 0x10) != 0) {
    puVar3 = (undefined8 *)FUN_1400eeec0(*(longlong *)(param_1 + 0x10),param_2,param_6,param_7);
    if (puVar3 != (undefined8 *)0x0) {
      if (param_3 != '\0') {
        cVar1 = FUN_1401112d0(puVar3,param_6);
        if (cVar1 == '\0') {
          (**(code **)(*param_6 + 0x28))
                    (param_6,"Found matching certificate, but no private key is available.");
        }
        else {
          FUN_1401111b0(puVar3,param_6);
          FUN_1400b8c40(local_50);
          cVar1 = FUN_140110b20(puVar3,param_4,local_50,param_5,param_6);
          if (cVar1 == '\0') {
            (**(code **)(*param_6 + 0x30))
                      (param_6,"Found matching certificate, but no private key accessible.");
          }
          FUN_1400b92d0(local_50);
          if (cVar1 != '\0') goto LAB_1400d271b;
        }
        (**(code **)*puVar3)(puVar3,1);
        goto LAB_1400d2d3e;
      }
LAB_1400d271b:
      if (param_7 == '\0') goto LAB_1400d263a;
      pcVar4 = "Found match in MY local-machine certificate store.";
      goto LAB_1400d2624;
    }
    if (param_7 != '\0') {
      (**(code **)(*param_6 + 0x30))
                (param_6,"No match found in MY local-machine certificate store.");
    }
  }
  if (*(longlong *)(param_1 + 0x20) == 0) {
    uVar2 = FUN_1400eedd0("Software/Microsoft/SystemCertificates/AddressBook",1,param_6);
    *(undefined8 *)(param_1 + 0x20) = uVar2;
  }
  if (*(longlong *)(param_1 + 0x18) == 0) {
    uVar2 = FUN_1400eece0("Software/Microsoft/SystemCertificates/AddressBook",1,param_6);
    *(undefined8 *)(param_1 + 0x18) = uVar2;
  }
  if (*(longlong *)(param_1 + 0x20) != 0) {
    puVar3 = (undefined8 *)FUN_1400eeec0(*(longlong *)(param_1 + 0x20),param_2,param_6,param_7);
    if (puVar3 != (undefined8 *)0x0) {
      if (param_3 != '\0') {
        cVar1 = FUN_1401112d0(puVar3,param_6);
        if (cVar1 == '\0') {
          (**(code **)(*param_6 + 0x28))
                    (param_6,"Found matching certificate, but no private key is available.");
        }
        else {
          FUN_1401111b0(puVar3,param_6);
          FUN_1400b8c40(local_50);
          cVar1 = FUN_140110b20(puVar3,param_4,local_50,param_5,param_6);
          if (cVar1 == '\0') {
            (**(code **)(*param_6 + 0x30))
                      (param_6,"Found matching certificate, but no private key accessible.");
          }
          FUN_1400b92d0(local_50);
          if (cVar1 != '\0') goto LAB_1400d2838;
        }
        (**(code **)*puVar3)(puVar3,1);
        goto LAB_1400d2d3e;
      }
LAB_1400d2838:
      if (param_7 == '\0') goto LAB_1400d263a;
      pcVar4 = "Found match in AddressBook current-user certificate store.";
      goto LAB_1400d2624;
    }
    if (param_7 != '\0') {
      (**(code **)(*param_6 + 0x30))
                (param_6,"No match found in AddressBook current-user certificate store.");
    }
  }
  if (*(longlong *)(param_1 + 0x18) != 0) {
    puVar3 = (undefined8 *)FUN_1400eeec0(*(longlong *)(param_1 + 0x18),param_2,param_6,param_7);
    if (puVar3 != (undefined8 *)0x0) {
      if (param_3 != '\0') {
        cVar1 = FUN_1401112d0(puVar3,param_6);
        if (cVar1 == '\0') {
          (**(code **)(*param_6 + 0x28))
                    (param_6,"Found matching certificate, but no private key is available.");
        }
        else {
          FUN_1401111b0(puVar3,param_6);
          FUN_1400b8c40(local_50);
          cVar1 = FUN_140110b20(puVar3,param_4,local_50,param_5,param_6);
          if (cVar1 == '\0') {
            (**(code **)(*param_6 + 0x30))
                      (param_6,"Found matching certificate, but no private key accessible.");
          }
          FUN_1400b92d0(local_50);
          if (cVar1 != '\0') goto LAB_1400d291d;
        }
        (**(code **)*puVar3)(puVar3,1);
        goto LAB_1400d2d3e;
      }
LAB_1400d291d:
      if (param_7 == '\0') goto LAB_1400d263a;
      pcVar4 = "Found match in AddressBook local-machine certificate store.";
      goto LAB_1400d2624;
    }
    if (param_7 != '\0') {
      (**(code **)(*param_6 + 0x30))
                (param_6,"No match found in AddressBook local-machine certificate store.");
    }
  }
  if (*(longlong *)(param_1 + 0x30) == 0) {
    uVar2 = FUN_1400ee8d0(1,param_6);
    *(undefined8 *)(param_1 + 0x30) = uVar2;
  }
  if (*(longlong *)(param_1 + 0x28) == 0) {
    uVar2 = FUN_1400ee9a0(1,param_6);
    *(undefined8 *)(param_1 + 0x28) = uVar2;
  }
  if (*(longlong *)(param_1 + 0x30) != 0) {
    puVar3 = (undefined8 *)FUN_1400eeec0(*(longlong *)(param_1 + 0x30),param_2,param_6,param_7);
    if (puVar3 != (undefined8 *)0x0) {
      if (param_3 != '\0') {
        cVar1 = FUN_1401112d0(puVar3,param_6);
        if (cVar1 == '\0') {
          (**(code **)(*param_6 + 0x28))
                    (param_6,"Found matching certificate, but no private key is available.");
        }
        else {
          FUN_1401111b0(puVar3,param_6);
          FUN_1400b8c40(local_50);
          cVar1 = FUN_140110b20(puVar3,param_4,local_50,param_5,param_6);
          if (cVar1 == '\0') {
            (**(code **)(*param_6 + 0x30))
                      (param_6,"Found matching certificate, but no private key accessible.");
          }
          FUN_1400b92d0(local_50);
          if (cVar1 != '\0') goto LAB_1400d2a2c;
        }
        (**(code **)*puVar3)(puVar3,1);
        goto LAB_1400d2d3e;
      }
LAB_1400d2a2c:
      if (param_7 == '\0') goto LAB_1400d263a;
      pcVar4 = "Found match in CA current-user certificate store.";
      goto LAB_1400d2624;
    }
    if (param_7 != '\0') {
      (**(code **)(*param_6 + 0x30))(param_6,"No match found in CA current-user certificate store.")
      ;
    }
  }
  if (*(longlong *)(param_1 + 0x28) != 0) {
    puVar3 = (undefined8 *)FUN_1400eeec0(*(longlong *)(param_1 + 0x28),param_2,param_6,param_7);
    if (puVar3 != (undefined8 *)0x0) {
      if (param_3 != '\0') {
        cVar1 = FUN_1401112d0(puVar3,param_6);
        if (cVar1 == '\0') {
          (**(code **)(*param_6 + 0x28))
                    (param_6,"Found matching certificate, but no private key is available.");
        }
        else {
          FUN_1401111b0(puVar3,param_6);
          FUN_1400b8c40(local_50);
          cVar1 = FUN_140110b20(puVar3,param_4,local_50,param_5,param_6);
          if (cVar1 == '\0') {
            (**(code **)(*param_6 + 0x30))
                      (param_6,"Found matching certificate, but no private key accessible.");
          }
          FUN_1400b92d0(local_50);
          if (cVar1 != '\0') goto LAB_1400d2b11;
        }
        (**(code **)*puVar3)(puVar3,1);
        goto LAB_1400d2d3e;
      }
LAB_1400d2b11:
      if (param_7 == '\0') goto LAB_1400d263a;
      pcVar4 = "Found match in CA local-machine certificate store.";
      goto LAB_1400d2624;
    }
    if (param_7 != '\0') {
      (**(code **)(*param_6 + 0x30))
                (param_6,"No match found in CA local-machine certificate store.");
    }
  }
  if (*(longlong *)(param_1 + 0x40) == 0) {
    uVar2 = FUN_1400eeb40(1,param_6);
    *(undefined8 *)(param_1 + 0x40) = uVar2;
  }
  if (*(longlong *)(param_1 + 0x38) == 0) {
    uVar2 = FUN_1400eea70(1,param_6);
    *(undefined8 *)(param_1 + 0x38) = uVar2;
  }
  if (*(longlong *)(param_1 + 0x40) != 0) {
    puVar3 = (undefined8 *)FUN_1400eeec0(*(longlong *)(param_1 + 0x40),param_2,param_6,param_7);
    if (puVar3 != (undefined8 *)0x0) {
      if (param_3 != '\0') {
        cVar1 = FUN_1401112d0(puVar3,param_6);
        if (cVar1 == '\0') {
          (**(code **)(*param_6 + 0x28))
                    (param_6,"Found matching certificate, but no private key is available.");
        }
        else {
          FUN_1401111b0(puVar3,param_6);
          FUN_1400b8c40(local_50);
          cVar1 = FUN_140110b20(puVar3,param_4,local_50,param_5,param_6);
          if (cVar1 == '\0') {
            (**(code **)(*param_6 + 0x30))
                      (param_6,"Found matching certificate, but no private key accessible.");
          }
          FUN_1400b92d0(local_50);
          if (cVar1 != '\0') goto LAB_1400d2c20;
        }
        (**(code **)*puVar3)(puVar3,1);
        goto LAB_1400d2d3e;
      }
LAB_1400d2c20:
      if (param_7 == '\0') goto LAB_1400d263a;
      pcVar4 = "Found match in ROOT current-user certificate store.";
      goto LAB_1400d2624;
    }
    if (param_7 != '\0') {
      (**(code **)(*param_6 + 0x30))
                (param_6,"No match found in ROOT current-user certificate store.");
    }
  }
  if (*(longlong *)(param_1 + 0x38) == 0) goto LAB_1400d2d3e;
  puVar3 = (undefined8 *)FUN_1400eeec0(*(longlong *)(param_1 + 0x38),param_2,param_6,param_7);
  if (puVar3 == (undefined8 *)0x0) {
    if (param_7 == '\0') {
      return 0;
    }
    (**(code **)(*param_6 + 0x30))
              (param_6,"No match found in ROOT local-machine certificate store.");
    goto LAB_1400d2d3e;
  }
  if (param_3 != '\0') {
    cVar1 = FUN_1401112d0(puVar3,param_6);
    if (cVar1 == '\0') {
      (**(code **)(*param_6 + 0x28))
                (param_6,"Found matching certificate, but no private key is available.");
    }
    else {
      FUN_1401111b0(puVar3,param_6);
      FUN_1400b8c40(local_50);
      cVar1 = FUN_140110b20(puVar3,param_4,local_50,param_5,param_6);
      if (cVar1 == '\0') {
        (**(code **)(*param_6 + 0x30))
                  (param_6,"Found matching certificate, but no private key accessible.");
      }
      FUN_1400b92d0(local_50);
      if (cVar1 != '\0') goto LAB_1400d2d02;
    }
    (**(code **)*puVar3)(puVar3,1);
LAB_1400d2d3e:
    if (param_7 != '\0') {
      (**(code **)(*param_6 + 0x50))(param_6);
    }
    return 0;
  }
LAB_1400d2d02:
  if (param_7 != '\0') {
    (**(code **)(*param_6 + 0x30))(param_6,"Found match in ROOT local-machine certificate store.");
    (**(code **)(*param_6 + 0x50))(param_6);
  }
LAB_1400d263a:
  uVar2 = FUN_1400ed0d0(puVar3,param_4,param_6);
  return uVar2;
}



char FUN_1400d2d70(longlong param_1,undefined8 param_2,undefined8 param_3,longlong param_4,
                  undefined1 *param_5,longlong *param_6,undefined1 param_7)

{
  char cVar1;
  int iVar2;
  undefined8 *puVar3;
  undefined1 local_70 [40];
  undefined1 local_48 [48];
  
  *param_5 = 0;
  FUN_1400b8b30(param_3);
  if (*(longlong *)(param_1 + 0x50) != 0) {
    FUN_1400b8c40(local_48);
    FUN_1400b9f10(local_48,param_2,"base64");
    FUN_1400b8c40(local_70);
    cVar1 = FUN_1400ecca0(*(undefined8 *)(param_1 + 0x50),local_70,param_6);
    if (((cVar1 != '\0') && (cVar1 = FUN_1400b93e0(local_70,local_48), cVar1 != '\0')) &&
       (cVar1 = FUN_1400ed3a0(*(undefined8 *)(param_1 + 0x50),param_3,param_5,param_6),
       cVar1 != '\0')) {
      if (param_4 != 0) {
        FUN_1400b8b30(param_4);
        cVar1 = FUN_1400ecf30(*(undefined8 *)(param_1 + 0x50),param_4,param_6);
      }
      if (cVar1 != '\0') {
        FUN_1400b92d0(local_70);
        FUN_1400b92d0(local_48);
        return '\x01';
      }
    }
    FUN_1400b92d0(local_70);
    FUN_1400b92d0(local_48);
  }
  if (((*(longlong *)(param_1 + 0x48) != 0) &&
      (cVar1 = FUN_14010f1c0(*(longlong *)(param_1 + 0x48),param_2,param_3,param_6,param_7),
      cVar1 != '\0')) && (iVar2 = FUN_1400b8b80(param_3), iVar2 != 0)) {
    *param_5 = 1;
    if ((param_4 != 0) &&
       (cVar1 = FUN_14010f9d0(*(undefined8 *)(param_1 + 0x48),param_2,param_4,param_6,param_7),
       cVar1 == '\0')) {
      (**(code **)(*param_6 + 0x28))
                (param_6,"Found private key using subject key identifier, but not certificate.");
      return '\0';
    }
    return '\x01';
  }
  puVar3 = (undefined8 *)FUN_1400d24b0(param_1,param_2,1,0,param_5,param_6,param_7);
  if (puVar3 == (undefined8 *)0x0) {
    return '\0';
  }
  cVar1 = FUN_1400ed3a0(puVar3,param_3,param_5,param_6);
  if (cVar1 == '\0') {
    (**(code **)(*param_6 + 0x28))(param_6,"No private key available");
  }
  if (param_4 != 0) {
    FUN_1400b8b30(param_4);
    cVar1 = FUN_1400ecf30(puVar3,param_4,param_6);
  }
  (**(code **)*puVar3)(puVar3,1);
  return cVar1;
}



char FUN_1400d2fa0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                  longlong param_5,undefined1 *param_6,longlong *param_7,undefined1 param_8)

{
  char cVar1;
  int iVar2;
  undefined8 *puVar3;
  longlong *in_stack_fffffffffffffe68;
  undefined8 uVar4;
  undefined1 local_168 [160];
  undefined1 local_c8 [160];
  
  uVar4 = 0xfffffffffffffffe;
  *param_6 = 0;
  FUN_1400b8b30(param_4);
  if (*(longlong *)(param_1 + 0x50) != 0) {
    FUN_1400b6fd0(local_c8);
    FUN_1400ecf20(*(undefined8 *)(param_1 + 0x50),local_c8,param_7);
    cVar1 = FUN_1400b7f00(local_c8,param_2);
    if (cVar1 != '\0') {
      FUN_1400b6fd0(local_168);
      FUN_1400ecd90(*(undefined8 *)(param_1 + 0x50),&DAT_140207978,local_168,param_7);
      cVar1 = FUN_1400b8930(local_168,param_3);
      if ((cVar1 != '\0') &&
         (cVar1 = FUN_1400ed3a0(*(undefined8 *)(param_1 + 0x50),param_4,param_6,param_7),
         cVar1 != '\0')) {
        if (param_5 != 0) {
          FUN_1400b8b30(param_5);
          cVar1 = FUN_1400ecf30(*(undefined8 *)(param_1 + 0x50),param_5,param_7);
        }
        if (cVar1 != '\0') {
          FUN_1400b7090(local_168);
          FUN_1400b7090(local_c8);
          return '\x01';
        }
      }
      FUN_1400b7090(local_168);
    }
    FUN_1400b7090(local_c8);
  }
  if (((*(longlong *)(param_1 + 0x48) != 0) &&
      (in_stack_fffffffffffffe68 = param_7,
      cVar1 = FUN_14010f3d0(*(longlong *)(param_1 + 0x48),param_2,param_3,param_4,param_7,param_8),
      cVar1 != '\0')) && (iVar2 = FUN_1400b8b80(param_4), iVar2 != 0)) {
    if ((param_5 != 0) &&
       (cVar1 = FUN_14010f910(*(undefined8 *)(param_1 + 0x48),param_2,param_3,param_5,param_7,
                              param_8), cVar1 == '\0')) {
      (**(code **)(*param_7 + 0x28))(param_7,"Found private key, but not certificate.");
      return '\0';
    }
    return '\x01';
  }
  puVar3 = (undefined8 *)
           FUN_1400d1b90(param_1,param_2,param_3,1,
                         (ulonglong)in_stack_fffffffffffffe68 & 0xffffffffffffff00,param_6,param_7,
                         param_8,uVar4);
  if (puVar3 == (undefined8 *)0x0) {
    return '\0';
  }
  cVar1 = FUN_1400ed3a0(puVar3,param_4,param_6,param_7);
  if (cVar1 == '\0') {
    (**(code **)(*param_7 + 0x28))(param_7,"No private key available");
  }
  if (param_5 != 0) {
    FUN_1400b8b30(param_5);
    cVar1 = FUN_1400ecf30(puVar3,param_5,param_7);
  }
  (**(code **)*puVar3)(puVar3,1);
  return cVar1;
}



undefined1
FUN_1400d3200(longlong param_1,undefined8 param_2,longlong param_3,undefined1 *param_4,
             undefined8 param_5)

{
  char cVar1;
  
  *param_4 = 0;
  FUN_1400b8b30(param_2);
  if ((*(longlong *)(param_1 + 0x50) != 0) &&
     (cVar1 = FUN_1400ed3a0(*(longlong *)(param_1 + 0x50),param_2,param_4,param_5), cVar1 != '\0'))
  {
    if (param_3 != 0) {
      FUN_1400b8b30(param_3);
      cVar1 = FUN_1400ecf30(*(undefined8 *)(param_1 + 0x50),param_3,param_5);
    }
    if (cVar1 != '\0') {
      return 1;
    }
  }
  return 0;
}



undefined1
FUN_1400d3290(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined1 param_6)

{
  char cVar1;
  undefined1 uVar2;
  int iVar3;
  undefined8 *puVar4;
  undefined1 local_res8 [8];
  undefined8 uVar5;
  undefined1 local_158 [160];
  undefined1 local_b8 [160];
  
  uVar5 = 0xfffffffffffffffe;
  FUN_1400b8b30(param_4);
  if (*(longlong *)(param_1 + 0x50) == 0) {
LAB_1400d338f:
    if (*(longlong *)(param_1 + 0x48) != 0) {
      cVar1 = FUN_14010f910(*(longlong *)(param_1 + 0x48),param_2,param_3,param_4,param_5,param_6);
      if (cVar1 != '\0') {
        iVar3 = FUN_1400b8b80(param_4);
        if (iVar3 != 0) goto LAB_1400d3370;
      }
    }
    local_res8[0] = 0;
    puVar4 = (undefined8 *)
             FUN_1400d1b90(param_1,param_2,param_3,0,1,local_res8,param_5,param_6,uVar5);
    uVar2 = 0;
    if (puVar4 != (undefined8 *)0x0) {
      uVar2 = FUN_1400ecf30(puVar4,param_4,param_5);
      (**(code **)*puVar4)(puVar4,1);
    }
  }
  else {
    FUN_1400b6fd0(local_b8);
    FUN_1400ecf20(*(undefined8 *)(param_1 + 0x50),local_b8,param_5);
    cVar1 = FUN_1400b7f00(local_b8,param_2);
    if (cVar1 == '\0') {
LAB_1400d3382:
      FUN_1400b7090(local_b8);
      goto LAB_1400d338f;
    }
    FUN_1400b6fd0(local_158);
    FUN_1400ecd90(*(undefined8 *)(param_1 + 0x50),&DAT_140207978,local_158,param_5);
    cVar1 = FUN_1400b8930(local_158,param_3);
    if (cVar1 == '\0') {
LAB_1400d3377:
      FUN_1400b7090(local_158);
      goto LAB_1400d3382;
    }
    cVar1 = FUN_1400ecf30(*(undefined8 *)(param_1 + 0x50),param_4,param_5);
    if (cVar1 == '\0') goto LAB_1400d3377;
    FUN_1400b7090(local_158);
    FUN_1400b7090(local_b8);
LAB_1400d3370:
    uVar2 = 1;
  }
  return uVar2;
}



void * FUN_1400d3450(void *param_1,uint param_2)

{
  FUN_1400d1a80();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1400d3480(undefined8 *param_1)

{
  *param_1 = CryptoSettings2::vftable;
  FUN_1400bceb0(param_1 + 0x16);
  FUN_1400bceb0(param_1 + 0xf);
  FUN_1400bceb0(param_1 + 7);
  FUN_1400bceb0(param_1 + 1);
  return;
}



undefined8 * FUN_1400d34d0(undefined8 *param_1,uint param_2)

{
  *param_1 = CryptoSettings2::vftable;
  FUN_1400bceb0(param_1 + 0x16);
  FUN_1400bceb0(param_1 + 0xf);
  FUN_1400bceb0(param_1 + 7);
  FUN_1400bceb0(param_1 + 1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1400d3540(undefined8 *param_1)

{
  *param_1 = CryptoSettings2::vftable;
  FUN_1400bcc20(param_1 + 1);
  FUN_1400bcc20(param_1 + 7);
  *(undefined1 *)(param_1 + 0xd) = 0;
  *(undefined8 *)((longlong)param_1 + 0x6c) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  FUN_1400bcc20(param_1 + 0xf);
  param_1[0x15] = 0;
  FUN_1400bcc20(param_1 + 0x16);
  return param_1;
}



undefined4 FUN_1400d35c0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x14);
}



void FUN_1400d35d0(longlong param_1)

{
  FUN_1400b8b90(param_1 + 0x18);
  return;
}



undefined8 *
FUN_1400d35e0(undefined8 *param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4)

{
  FUN_1400d0eb0();
  *param_1 = CryptoAlg::vftable;
  *(undefined4 *)(param_1 + 2) = param_2;
  *(undefined4 *)((longlong)param_1 + 0x14) = param_3;
  FUN_1400bcc20(param_1 + 3);
  FUN_1400bc640(param_1 + 3,param_4);
  return param_1;
}



undefined8 * FUN_1400d3660(undefined8 *param_1,uint param_2)

{
  *param_1 = CryptoAlg::vftable;
  FUN_1400bceb0(param_1 + 3);
  FUN_1400d0ee0(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_1400d36c0(longlong param_1,undefined8 param_2)

{
  char cVar1;
  uint uVar2;
  char *pcVar3;
  
  uVar2 = *(uint *)(param_1 + 0x10) & 0xe000;
  if (uVar2 == 0x8000) {
    cVar1 = FUN_1400be010(param_1 + 0x18,&DAT_140209300);
    if ((cVar1 != '\0') || (cVar1 = FUN_1400be010(param_1 + 0x18,"sha-1"), cVar1 != '\0')) {
      pcVar3 = "1.3.14.3.2.26";
      goto LAB_1400d3998;
    }
    cVar1 = FUN_1400be010(param_1 + 0x18,&DAT_14023f500);
    if (cVar1 != '\0') {
      pcVar3 = "1.3.14.3.2.18";
      goto LAB_1400d3998;
    }
    cVar1 = FUN_1400be010(param_1 + 0x18,&DAT_1402092f8);
    if (cVar1 != '\0') {
      pcVar3 = "1.2.840.113549.2.5";
      goto LAB_1400d3998;
    }
    cVar1 = FUN_1400be010(param_1 + 0x18,&DAT_14023f4ec);
    if (cVar1 != '\0') {
      pcVar3 = "1.2.840.113549.2.4";
      goto LAB_1400d3998;
    }
    cVar1 = FUN_1400be010(param_1 + 0x18,&DAT_1402092fc);
    if (cVar1 != '\0') {
      pcVar3 = "1.2.840.113549.2.2";
      goto LAB_1400d3998;
    }
    cVar1 = FUN_1400be010(param_1 + 0x18,"GOST R 34.11-94");
    if (cVar1 == '\0') {
      uVar2 = *(uint *)(param_1 + 0x10) & 0x1ff;
      if (uVar2 == 0xc) {
        pcVar3 = "2.16.840.1.101.3.4.2.1";
      }
      else if (uVar2 == 0xd) {
        pcVar3 = "2.16.840.1.101.3.4.2.2";
      }
      else {
        if (uVar2 != 0xe) {
          FUN_1400bc640(param_2,"1.3.14.3.2.26");
          return 0;
        }
        pcVar3 = "2.16.840.1.101.3.4.2.3";
      }
      goto LAB_1400d3998;
    }
  }
  else {
    if ((uVar2 != 0x6000) && (uVar2 != 0x4000)) {
      return 0;
    }
    cVar1 = FUN_1400be010(param_1 + 0x18,&DAT_1402074c0);
    if (cVar1 != '\0') {
      pcVar3 = "1.3.14.3.2.7";
      goto LAB_1400d3998;
    }
    cVar1 = FUN_1400be010(param_1 + 0x18,&DAT_140207d60);
    if ((cVar1 != '\0') || (cVar1 = FUN_1400be010(param_1 + 0x18,"3DES TWO KEY"), cVar1 != '\0')) {
      pcVar3 = "1.2.840.113549.3.7";
      goto LAB_1400d3998;
    }
    cVar1 = FUN_1400be010(param_1 + 0x18,&DAT_140207694);
    if (cVar1 != '\0') {
      pcVar3 = "1.2.840.113549.3.2";
      goto LAB_1400d3998;
    }
    cVar1 = FUN_1400bc770(param_1 + 0x18,&DAT_14023f4a4);
    if ((cVar1 != '\0') || (cVar1 = FUN_1400bc770(param_1 + 0x18,&DAT_14023f4a0), cVar1 != '\0')) {
      pcVar3 = "1.2.840.113549.3.4";
      goto LAB_1400d3998;
    }
    cVar1 = FUN_1400be010(param_1 + 0x18,"GOST 28147-89");
    if (cVar1 == '\0') {
      cVar1 = FUN_1400be010(param_1 + 0x18,&DAT_1402749b8);
      if ((((cVar1 == '\0') && (cVar1 = FUN_1400be010(param_1 + 0x18,"aes 128"), cVar1 == '\0')) &&
          (cVar1 = FUN_1400be010(param_1 + 0x18,"aes 192"), cVar1 == '\0')) &&
         (cVar1 = FUN_1400be010(param_1 + 0x18,"aes 256"), cVar1 == '\0')) {
        FUN_1400bc640(param_2,"1.2.840.113549.3.2");
        return 0;
      }
      if (*(int *)(param_1 + 0x14) == 0x80) {
        pcVar3 = "2.16.840.1.101.3.4.1.2";
      }
      else if (*(int *)(param_1 + 0x14) == 0xc0) {
        pcVar3 = "2.16.840.1.101.3.4.1.22";
      }
      else {
        pcVar3 = "2.16.840.1.101.3.4.1.42";
      }
      goto LAB_1400d3998;
    }
  }
  pcVar3 = "1.2.643.2.2.21";
LAB_1400d3998:
  FUN_1400bc640(param_2,pcVar3);
  return 1;
}



// WARNING: Restarted to delay deadcode elimination for space: register

ulonglong FUN_1400d39b0(undefined8 param_1,undefined8 param_2,undefined4 *param_3,
                       undefined4 *param_4,undefined4 *param_5,longlong *param_6)

{
  longlong lVar1;
  int iVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  char *_Src;
  undefined1 local_res18 [16];
  undefined1 local_50 [56];
  
  FUN_1400bcc20(local_50);
  FUN_1400bc640(local_50,param_2);
  FUN_1400bebf0(local_res18);
  FUN_140111c70("1x0zlsd",local_50,local_res18);
  *param_3 = 1;
  *param_4 = 1;
  *param_5 = 0x7d8;
  iVar2 = FUN_1400bbb10(local_50);
  if (iVar2 == 0) {
    FUN_1400bec20(local_res18);
    uVar3 = FUN_1400bceb0(local_50);
    uVar3 = uVar3 & 0xffffffffffffff00;
  }
  else {
    if (param_6 != (longlong *)0x0) {
      lVar1 = *param_6;
      uVar4 = FUN_1400b8b90(local_50);
      (**(code **)(lVar1 + 0x58))(param_6,"dateStr",uVar4);
    }
    _Src = (char *)FUN_1400b8b90(local_50);
    iVar2 = sscanf(_Src,"%d%d%d",param_3,param_4);
    FUN_1400bec20(local_res18);
    FUN_1400bceb0(local_50);
    uVar3 = (ulonglong)(iVar2 == 3);
  }
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400d3ae0(void)

{
  undefined4 in_R9D;
  undefined8 in_stack_00000028;
  longlong *in_stack_00000030;
  undefined1 auStack_c8 [32];
  undefined4 local_a8;
  undefined1 local_98 [8];
  undefined8 local_90;
  char local_88 [112];
  ulonglong local_18;
  
  local_90 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_c8;
  local_a8 = in_R9D;
  sprintf(local_88,"%d %d %d");
  FUN_1400bc640(in_stack_00000028,local_88);
  if (in_stack_00000030 != (longlong *)0x0) {
    (**(code **)(*in_stack_00000030 + 0x58))(in_stack_00000030,"mdyString",local_88);
  }
  FUN_1400bebf0(local_98);
  FUN_140111a30("1x0zlsd",in_stack_00000028,local_98);
  FUN_1400bec20(local_98);
  return;
}



void FUN_1400d3bb0(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  undefined2 local_28;
  undefined2 local_26;
  undefined2 local_22;
  
  FUN_1400d04a0(&local_28);
  FUN_1400d0640(&local_28);
  FUN_1400d3ae0(param_1,local_26,local_22,local_28,param_2,param_3);
  return;
}



undefined8 * FUN_1400d3c10(undefined8 *param_1)

{
  *param_1 = RegKey::vftable;
  return param_1;
}



void FUN_1400d3c20(undefined8 *param_1)

{
  *param_1 = RegKey::vftable;
  return;
}



char * FUN_1400d3c30(undefined8 param_1,byte *param_2,byte *param_3)

{
  byte bVar1;
  char cVar2;
  char *pcVar3;
  int iVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  uint uVar7;
  char *pcVar8;
  char *pcVar9;
  byte *pbVar10;
  longlong lVar11;
  byte *pbVar12;
  longlong lVar13;
  
  uVar5 = 0xffffffffffffffff;
  pbVar12 = param_3;
  do {
    if (uVar5 == 0) break;
    uVar5 = uVar5 - 1;
    bVar1 = *pbVar12;
    pbVar12 = pbVar12 + 1;
  } while (bVar1 != 0);
  if (~uVar5 - 1 < 8) {
    pcVar3 = operator_new(0x14);
    builtin_strncpy(pcVar3,"__^!@",6);
    return pcVar3;
  }
  uVar6 = 0;
  lVar13 = 7;
  lVar11 = 7;
  uVar5 = uVar6;
  pbVar12 = param_2;
  do {
    iVar4 = (int)(char)pbVar12[1] - (int)(char)*pbVar12;
    if (iVar4 < 0) {
      iVar4 = -iVar4;
    }
    if (-1 < (int)uVar5) {
      iVar4 = -iVar4;
    }
    uVar7 = (int)uVar5 + iVar4;
    uVar5 = (ulonglong)uVar7;
    lVar11 = lVar11 + -1;
    pbVar12 = pbVar12 + 1;
  } while (lVar11 != 0);
  if ((int)uVar7 < 0) {
    uVar7 = -uVar7;
  }
  iVar4 = uVar7 + 0x30;
  if (((((iVar4 < 0x30) || (0x39 < iVar4)) && ((iVar4 < 0x61 || (0x7a < iVar4)))) &&
      (((iVar4 < 0x41 || (0x5a < iVar4)) && ((iVar4 = 0x7a - uVar7, iVar4 < 0x30 || (0x39 < iVar4)))
       ))) && (((iVar4 < 0x61 || (0x7a < iVar4)) && ((iVar4 < 0x41 || (0x5a < iVar4)))))) {
    iVar4 = 0x78;
  }
  param_3[8] = (byte)iVar4;
  pbVar12 = param_2 + 2;
  iVar4 = (int)(char)(param_2[8] ^ param_2[7] ^ param_2[6] ^ param_2[5] ^ param_2[4] ^ param_2[3] ^
                      param_2[1] ^ *pbVar12 ^ *param_2);
  if (iVar4 < 0x30) {
    iVar4 = (char)*param_3 + 1;
  }
  if (0x7a < iVar4) {
    iVar4 = (char)param_3[1] + 1;
  }
  if (((iVar4 < 0x30) || (0x39 < iVar4)) &&
     (((iVar4 < 0x61 || (0x7a < iVar4)) && ((iVar4 < 0x41 || (0x5a < iVar4)))))) {
    iVar4 = 0x52;
  }
  param_3[9] = (byte)iVar4;
  uVar5 = uVar6;
  pbVar10 = param_3;
  do {
    iVar4 = (int)(char)pbVar10[1] - (int)(char)*pbVar10;
    if (iVar4 < 0) {
      iVar4 = -iVar4;
    }
    if (-1 < (int)uVar5) {
      iVar4 = -iVar4;
    }
    uVar5 = (ulonglong)(uint)((int)uVar5 + iVar4);
    lVar13 = lVar13 + -1;
    pbVar10 = pbVar10 + 1;
  } while (lVar13 != 0);
  lVar11 = 8;
  do {
    iVar4 = (int)(char)*pbVar12 - (int)(char)pbVar12[-2];
    if (iVar4 < 0) {
      iVar4 = -iVar4;
    }
    if (-1 < (int)uVar5) {
      iVar4 = -iVar4;
    }
    uVar7 = (int)uVar5 + iVar4;
    uVar5 = (ulonglong)uVar7;
    pbVar12 = pbVar12 + 1;
    lVar11 = lVar11 + -1;
  } while (lVar11 != 0);
  if ((int)uVar7 < 0) {
    uVar7 = -uVar7;
  }
  iVar4 = uVar7 + 0x30;
  if ((((((iVar4 < 0x30) || (0x39 < iVar4)) && ((iVar4 < 0x61 || (0x7a < iVar4)))) &&
       ((iVar4 < 0x41 || (0x5a < iVar4)))) &&
      ((iVar4 = 0x7a - uVar7, iVar4 < 0x30 || (0x39 < iVar4)))) &&
     (((iVar4 < 0x61 || (0x7a < iVar4)) && ((iVar4 < 0x41 || (0x5a < iVar4)))))) {
    iVar4 = 0x6e;
  }
  param_3[10] = (byte)iVar4;
  uVar5 = uVar6;
  do {
    pbVar12 = param_2 + uVar6;
    uVar6 = uVar6 + 2;
    uVar7 = (uint)uVar5 ^ (int)(char)*pbVar12;
    uVar5 = (ulonglong)uVar7;
  } while ((longlong)uVar6 < 10);
  uVar7 = uVar7 ^ (int)(char)(param_3[7] ^ param_3[6] ^ param_3[4] ^ param_3[3] ^ *param_3 ^
                              param_3[1] ^ param_3[2] ^ param_3[5]);
  if ((int)uVar7 < 0x30) {
    uVar7 = (int)(char)param_3[5] + 0x14;
  }
  if (0x7a < (int)uVar7) {
    uVar7 = (int)(char)param_3[2] - 10;
  }
  if ((int)uVar7 < 0x30) {
    uVar7 = (int)(char)param_3[3] + 0x14;
  }
  if (0x7a < (int)uVar7) {
    uVar7 = (int)(char)param_3[4] - 10;
  }
  if (((((int)uVar7 < 0x30) || (0x39 < (int)uVar7)) && (((int)uVar7 < 0x61 || (0x7a < (int)uVar7))))
     && (((int)uVar7 < 0x41 || (0x5a < (int)uVar7)))) {
    uVar7 = 0x47;
  }
  uVar5 = 0xffffffffffffffff;
  param_3[0xb] = (byte)uVar7;
  param_3[0xc] = 0;
  pbVar12 = param_2;
  do {
    if (uVar5 == 0) break;
    uVar5 = uVar5 - 1;
    bVar1 = *pbVar12;
    pbVar12 = pbVar12 + 1;
  } while (bVar1 != 0);
  uVar6 = 0xffffffffffffffff;
  pbVar12 = param_3;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    bVar1 = *pbVar12;
    pbVar12 = pbVar12 + 1;
  } while (bVar1 != 0);
  pcVar3 = operator_new(~uVar5 + ~uVar6);
  pbVar12 = param_2;
  do {
    bVar1 = *pbVar12;
    pbVar12[(longlong)pcVar3 - (longlong)param_2] = bVar1;
    pbVar12 = pbVar12 + 1;
  } while (bVar1 != 0);
  lVar11 = -1;
  pcVar8 = pcVar3;
  do {
    pcVar9 = pcVar8;
    if (lVar11 == 0) break;
    lVar11 = lVar11 + -1;
    pcVar9 = pcVar8 + 1;
    cVar2 = *pcVar8;
    pcVar8 = pcVar9;
  } while (cVar2 != '\0');
  lVar11 = -1;
  pcVar9[-1] = '_';
  pcVar9[0] = '\0';
  pcVar8 = pcVar3;
  do {
    pcVar9 = pcVar8;
    if (lVar11 == 0) break;
    lVar11 = lVar11 + -1;
    pcVar9 = pcVar8 + 1;
    cVar2 = *pcVar8;
    pcVar8 = pcVar9;
  } while (cVar2 != '\0');
  lVar11 = 0;
  do {
    bVar1 = param_3[lVar11];
    pcVar9[lVar11 + -1] = bVar1;
    lVar11 = lVar11 + 1;
  } while (bVar1 != 0);
  return pcVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1400d3f70(undefined8 param_1,int param_2,uint param_3,int param_4,int *param_5,
                       undefined4 *param_6,int *param_7,longlong *param_8)

{
  longlong lVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  undefined1 auStack_1a8 [32];
  int local_188;
  ulonglong local_178;
  undefined1 local_170 [8];
  ushort local_168;
  ushort local_166;
  ushort local_162;
  undefined8 local_150;
  undefined1 local_148 [48];
  undefined8 local_118;
  longlong local_110;
  int local_108;
  int iStack_104;
  undefined8 local_100;
  undefined4 local_f8;
  undefined8 local_f0;
  longlong local_e8;
  int local_e0;
  int iStack_dc;
  undefined8 local_d8;
  undefined4 local_d0;
  undefined1 local_c8 [12];
  undefined4 local_bc;
  int local_b8;
  int local_b4;
  char local_98 [80];
  ulonglong local_48;
  
  local_150 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_1a8;
  FUN_1400d04a0(&local_168);
  FUN_1400d0640(&local_168);
  local_f0 = 0;
  local_d8 = 0;
  local_d0 = 0;
  local_118 = 0;
  local_100 = 0;
  local_f8 = 0;
  _local_e0 = CONCAT44(local_168 - 0x76c,local_166 - 1);
  local_e8 = (ulonglong)local_162 << 0x20;
  _local_108 = CONCAT44(param_4 + -0x76c,param_2 + -1);
  local_110 = (ulonglong)param_3 << 0x20;
  local_178 = FUN_1400d0470(&local_118);
  uVar2 = FUN_1400d0470(&local_f0);
  _time64((__time64_t *)0x0);
  local_178 = local_178 + 0x278d00;
  FUN_1400d03e0(&local_178,local_c8);
  *param_6 = local_bc;
  *param_5 = local_b8 + 1;
  local_188 = local_b4 + 0x76c;
  *param_7 = local_188;
  if (param_8 != (longlong *)0x0) {
    sprintf(local_98,"%d/%d/%d");
    (**(code **)(*param_8 + 0x58))(param_8,"expireMdy",local_98);
    FUN_1400cf520(param_8,&DAT_1402403e8,local_178 & 0xffffffff);
    FUN_1400cf520(param_8,&DAT_1402403e0,uVar2 & 0xffffffff);
    FUN_1400bcc20(local_148);
    FUN_1400cf840(local_170);
    FUN_1400d0260(local_148);
    lVar1 = *param_8;
    uVar3 = FUN_1400b8b90(local_148);
    (**(code **)(lVar1 + 0x58))(param_8,"curDT",uVar3);
    FUN_1400cf850(local_170);
    FUN_1400bceb0(local_148);
  }
  if ((longlong)local_178 < (longlong)uVar2) {
    local_178 = local_178 & 0xffffffffffffff00;
  }
  else {
    local_178 = CONCAT71((int7)(local_178 - 0x2a3000 >> 8),
                         (longlong)(local_178 - 0x2a3000) <= (longlong)uVar2);
  }
  return local_178;
}



undefined8 * FUN_1400d4190(undefined8 *param_1,byte param_2)

{
  *param_1 = RegKey::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

bool FUN_1400d41c0(undefined8 param_1,char *param_2)

{
  char cVar1;
  char cVar2;
  char *pcVar3;
  char *pcVar4;
  bool bVar5;
  undefined1 auStack_438 [32];
  char local_418 [1024];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_438;
  strncpy(local_418,param_2,0x3ff);
  pcVar3 = strchr(local_418,0x5f);
  bVar5 = false;
  if (pcVar3 != (char *)0x0) {
    *pcVar3 = '\0';
    pcVar3[9] = '\0';
    pcVar4 = (char *)FUN_1400d3c30(param_1,local_418,pcVar3 + 1);
    pcVar3 = pcVar4;
    do {
      cVar1 = *pcVar3;
      cVar2 = pcVar3[(longlong)param_2 - (longlong)pcVar4];
      if (cVar1 != cVar2) break;
      pcVar3 = pcVar3 + 1;
    } while (cVar2 != '\0');
    bVar5 = cVar1 == cVar2;
    operator_delete(pcVar4);
  }
  return bVar5;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

char FUN_1400d4280(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                  undefined1 *param_5,longlong *param_6,char param_7)

{
  bool bVar1;
  bool bVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  undefined4 uVar6;
  char *pcVar7;
  undefined8 uVar8;
  longlong lVar9;
  char *pcVar10;
  undefined **ppuVar11;
  undefined1 auStack_398 [32];
  undefined8 *local_378;
  undefined1 local_368 [16];
  undefined8 local_358;
  undefined8 local_350;
  undefined8 local_348;
  undefined4 local_340 [2];
  undefined1 local_338 [48];
  undefined1 local_308 [48];
  undefined1 local_2d8 [48];
  undefined1 local_2a8 [48];
  undefined1 local_278 [48];
  undefined1 local_248 [48];
  undefined1 local_218 [48];
  undefined1 local_1e8 [48];
  undefined1 local_1b8 [48];
  undefined1 local_188 [48];
  ushort local_158;
  ushort local_156;
  ushort local_152;
  undefined8 local_130;
  undefined1 local_128 [112];
  undefined8 local_b8;
  char local_a8 [80];
  ulonglong local_58;
  
  local_b8 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_398;
  local_358 = param_1;
  local_350 = param_3;
  local_348 = param_4;
  local_130 = param_2;
  (**(code **)(*param_6 + 0x48))(param_6,"RegKey",1);
  (**(code **)(*param_6 + 0x58))(param_6,"LibDate","Apr 18 2012");
  bVar2 = false;
  FUN_1400bcc20(local_248);
  FUN_1400ce880(local_248);
  iVar4 = FUN_1400bbb10(local_248);
  if (5 < iVar4) {
    FUN_1400bcfa0(local_248,&DAT_140240998,&DAT_14024099c);
    iVar4 = FUN_1400bc3a0(local_248);
    if (iVar4 == 0xe1197) {
      bVar2 = true;
    }
    else {
      cVar3 = FUN_1400bc7e0(local_248,"chilkat");
      if ((cVar3 != '\0') && (cVar3 = FUN_1400bc770(local_248,".private"), cVar3 != '\0')) {
        cVar3 = FUN_1400bde10(local_248,"tosx.");
        bVar2 = false;
        if (cVar3 != '\0') {
          bVar2 = true;
        }
      }
    }
  }
  FUN_1400bbde0(local_248);
  FUN_1400bceb0(local_248);
  FUN_1400bcc20(local_338);
  FUN_1400bc640(local_338,param_2);
  iVar4 = FUN_1400bbb10(local_338);
  FUN_1400bbc30(local_338);
  iVar5 = FUN_1400bbb10(local_338);
  if (iVar5 == 0) {
    pcVar10 = 
    "ERROR: Your application passed a string containing only SPACE, TAB, or other whitespace characters to UnlockComponent."
    ;
    if (iVar4 == 0) {
      pcVar10 = "ERROR: Your application passed an empty string or NULL to UnlockComponent.";
    }
    (**(code **)(*param_6 + 0x28))(param_6,pcVar10);
    (**(code **)(*param_6 + 0x50))(param_6);
    goto LAB_1400d5afc;
  }
  pcVar10 = (char *)FUN_1400b8b90(local_338);
  cVar3 = FUN_1400bc840(local_338,&DAT_1402408a8);
  if (cVar3 != '\0') {
    (**(code **)(*param_6 + 0x28))(param_6,"Invalid code...");
    (**(code **)(*param_6 + 0x50))(param_6);
    goto LAB_1400d5afc;
  }
  cVar3 = FUN_1400bc610(local_338,0x3a);
  if ((cVar3 != '\0') && (pcVar7 = strchr(pcVar10,0x3a), pcVar7 != (char *)0x0)) {
    FUN_1400bcaa0(local_a8,pcVar7 + 1);
    FUN_1400bbc30(local_a8);
    FUN_1400bbe30(local_338);
    FUN_1400bda40(local_338,local_a8);
    pcVar10 = (char *)FUN_1400b8b90(local_338);
    FUN_1400bceb0(local_a8);
  }
  *param_5 = 0;
  FUN_1400f0d10(local_368);
  if (pcVar10 == (char *)0x0) {
    (**(code **)(*param_6 + 0x28))(param_6,"No reg code");
    (**(code **)(*param_6 + 0x50))(param_6);
    FUN_1400f0d30(local_368);
    goto LAB_1400d5afc;
  }
  FUN_1400bcaa0(local_1b8,PTR_DAT_1402f9c78);
  FUN_1400b8c40(local_248);
  uVar6 = FUN_1400bbb10(local_1b8);
  uVar8 = FUN_1400b8b90(local_1b8);
  FUN_1400f3110(local_368,uVar8,uVar6,local_248);
  FUN_1400bbe30(local_1b8);
  FUN_1400be440(local_1b8,local_248);
  FUN_1400b8b30(local_248);
  FUN_1400d0a70(&local_158);
  local_378 = (undefined8 *)((ulonglong)local_378 & 0xffffffffffffff00);
  FUN_1400be7e0(local_1b8,&local_158,0x2c,0);
  iVar4 = FUN_140139d70(&local_158);
  bVar1 = false;
  iVar5 = 0;
  if (0 < iVar4) {
    do {
      lVar9 = FUN_1400d0aa0(&local_158,iVar5);
      if (lVar9 != 0) {
        pcVar7 = (char *)FUN_1400b8b90(lVar9);
        pcVar7 = strstr(pcVar10,pcVar7);
        if (pcVar7 != (char *)0x0) {
          bVar1 = true;
          break;
        }
      }
      iVar5 = iVar5 + 1;
    } while (iVar5 < iVar4);
  }
  FUN_1400d0d30(&local_158);
  if (bVar1) {
    (**(code **)(*param_6 + 0x28))(param_6,"Error 200");
    (**(code **)(*param_6 + 0x50))(param_6);
    FUN_1400d0e10(&local_158);
    FUN_1400b92d0(local_248);
    FUN_1400bceb0(local_1b8);
    FUN_1400f0d30(local_368);
    goto LAB_1400d5afc;
  }
  FUN_1400bbde0(local_1b8);
  FUN_1400d0e10(&local_158);
  FUN_1400b92d0(local_248);
  FUN_1400bceb0(local_1b8);
  FUN_1400bcc20(local_1e8);
  FUN_1400bcc20(local_2a8);
  FUN_1400bcc20(local_218);
  FUN_1400bcc20(local_278);
  FUN_1400ef8e0(local_128);
  FUN_1400bcc20(local_308);
  FUN_1400bc640(local_308,PTR_DAT_1402f9c70);
  FUN_1400bbe50(local_308,0x6d);
  FUN_1400bc640(local_308,PTR_DAT_1402f9c80);
  FUN_1400bd7d0(local_308);
  pcVar7 = (char *)FUN_1400b8b90(local_308);
  pcVar7 = strstr(pcVar10,pcVar7);
  if (pcVar7 != (char *)0x0) {
    Sleep(5000);
    (**(code **)(*param_6 + 0x28))(param_6,"Unlock code is invalid.");
    (**(code **)(*param_6 + 0x50))(param_6);
    FUN_1400bbde0(local_308);
    FUN_1400bceb0(local_308);
    FUN_1400ef960(local_128);
    FUN_1400bceb0(local_278);
    FUN_1400bceb0(local_218);
    FUN_1400bceb0(local_2a8);
    FUN_1400bceb0(local_1e8);
    FUN_1400f0d30(local_368);
    goto LAB_1400d5afc;
  }
  if (PTR_s_Aptare_1402f9510 != (undefined *)0x0) {
    ppuVar11 = &PTR_s_WebSpirit_1402f9518;
    pcVar7 = PTR_s_Aptare_1402f9510;
    do {
      if (*pcVar7 == '\0') break;
      pcVar7 = strstr(pcVar10,pcVar7);
      if (pcVar7 != (char *)0x0) {
        Sleep(2000);
        (**(code **)(*param_6 + 0x28))(param_6,"This code has been revoked.");
        (**(code **)(*param_6 + 0x50))(param_6);
        FUN_1400bceb0(local_308);
        FUN_1400ef960(local_128);
        FUN_1400bceb0(local_278);
        FUN_1400bceb0(local_218);
        FUN_1400bceb0(local_2a8);
        FUN_1400bceb0(local_1e8);
        FUN_1400f0d30(local_368);
        goto LAB_1400d5afc;
      }
      pcVar7 = *ppuVar11;
      ppuVar11 = ppuVar11 + 1;
    } while (pcVar7 != (char *)0x0);
  }
  pcVar7 = strstr(pcVar10,"$TEAM");
  if ((((pcVar7 != (char *)0x0) || (pcVar7 = strstr(pcVar10,"$BEAN"), pcVar7 != (char *)0x0)) ||
      (pcVar7 = strstr(pcVar10,"!TEAM"), pcVar7 != (char *)0x0)) ||
     (pcVar7 = strstr(pcVar10,"!BEAN"), pcVar7 != (char *)0x0)) {
    (**(code **)(*param_6 + 0x28))(param_6,"Unlock code is invalid.");
    (**(code **)(*param_6 + 0x50))(param_6);
    FUN_1400bceb0(local_308);
    FUN_1400ef960(local_128);
    FUN_1400bceb0(local_278);
    FUN_1400bceb0(local_218);
    FUN_1400bceb0(local_2a8);
    FUN_1400bceb0(local_1e8);
    FUN_1400f0d30(local_368);
    goto LAB_1400d5afc;
  }
  iVar4 = strncmp(pcVar10,"SITETA",6);
  if ((((((iVar4 == 0) || (iVar4 = strncmp(pcVar10,"NICOLE",6), iVar4 == 0)) ||
        ((iVar4 = strncmp(pcVar10,"RUTHFR",6), iVar4 == 0 ||
         ((iVar4 = strncmp(pcVar10,"LIRANM",6), iVar4 == 0 ||
          (iVar4 = strncmp(pcVar10,"MEISTEMHT",9), iVar4 == 0)))))) ||
       (iVar4 = strncmp(pcVar10,"YESSDA",6), iVar4 == 0)) ||
      ((((((iVar4 = strncmp(pcVar10,"JOHNEK",6), iVar4 == 0 ||
           (iVar4 = strncmp(pcVar10,"SIKORS",6), iVar4 == 0)) ||
          (iVar4 = strncmp(pcVar10,"UNIQUE",6), iVar4 == 0)) ||
         ((iVar4 = strncmp(pcVar10,"MIKEWA",6), iVar4 == 0 ||
          (iVar4 = strncmp(pcVar10,"kfywhl",6), iVar4 == 0)))) ||
        (((iVar4 = strncmp(pcVar10,"GATECI",6), iVar4 == 0 ||
          ((iVar4 = strncmp(pcVar10,"SALDANA",6), iVar4 == 0 ||
           (iVar4 = strncmp(pcVar10,"YVESLA",6), iVar4 == 0)))) ||
         (iVar4 = strncmp(pcVar10,"MARISK",6), iVar4 == 0)))) ||
       (((iVar4 = strncmp(pcVar10,"PARMBI",6), iVar4 == 0 ||
         (iVar4 = strncmp(pcVar10,"ISHIIL",6), iVar4 == 0)) ||
        (iVar4 = strncmp(pcVar10,"CLSTCK",6), iVar4 == 0)))))) ||
     (((iVar4 = strncmp(pcVar10,"SETUNO",6), iVar4 == 0 ||
       (iVar4 = strncmp(pcVar10,"GRUPOI",6), iVar4 == 0)) ||
      (iVar4 = strncmp(pcVar10,"SBioImage",9), iVar4 == 0)))) {
    Sleep(1000);
    (**(code **)(*param_6 + 0x28))(param_6,"This code has been revoked");
    (**(code **)(*param_6 + 0x50))(param_6);
    FUN_1400bceb0(local_308);
    FUN_1400ef960(local_128);
    FUN_1400bceb0(local_278);
    FUN_1400bceb0(local_218);
    FUN_1400bceb0(local_2a8);
    FUN_1400bceb0(local_1e8);
    FUN_1400f0d30(local_368);
    goto LAB_1400d5afc;
  }
  iVar4 = strncmp(pcVar10,"JEFFRE",6);
  if ((iVar4 == 0) &&
     ((((((pcVar7 = strstr(pcVar10,"_m3ZZp"), pcVar7 != (char *)0x0 ||
          (pcVar7 = strstr(pcVar10,"_Y7BE"), pcVar7 != (char *)0x0)) ||
         ((pcVar7 = strstr(pcVar10,"_cpO7"), pcVar7 != (char *)0x0 ||
          (((((pcVar7 = strstr(pcVar10,"_Y7BE"), pcVar7 != (char *)0x0 ||
              (pcVar7 = strstr(pcVar10,"_OgXr"), pcVar7 != (char *)0x0)) ||
             (pcVar7 = strstr(pcVar10,"_Dzf7"), pcVar7 != (char *)0x0)) ||
            ((pcVar7 = strstr(pcVar10,"_7E3X"), pcVar7 != (char *)0x0 ||
             (pcVar7 = strstr(pcVar10,"_c0xN"), pcVar7 != (char *)0x0)))) ||
           (pcVar7 = strstr(pcVar10,"_taqf"), pcVar7 != (char *)0x0)))))) ||
        ((pcVar7 = strstr(pcVar10,"_B7on"), pcVar7 != (char *)0x0 ||
         (pcVar7 = strstr(pcVar10,"_ucsR"), pcVar7 != (char *)0x0)))) ||
       ((pcVar7 = strstr(pcVar10,"_oQ8H"), pcVar7 != (char *)0x0 ||
        (((pcVar7 = strstr(pcVar10,"_Gp6N"), pcVar7 != (char *)0x0 ||
          (pcVar7 = strstr(pcVar10,"_GEx4"), pcVar7 != (char *)0x0)) ||
         (pcVar7 = strstr(pcVar10,"_FQ3m"), pcVar7 != (char *)0x0)))))) ||
      (((pcVar7 = strstr(pcVar10,"_6zVn"), pcVar7 != (char *)0x0 ||
        (pcVar7 = strstr(pcVar10,"_zhxE"), pcVar7 != (char *)0x0)) ||
       ((pcVar7 = strstr(pcVar10,"_p6s7"), pcVar7 != (char *)0x0 ||
        ((pcVar7 = strstr(pcVar10,"_k3qB"), pcVar7 != (char *)0x0 ||
         (pcVar7 = strstr(pcVar10,"_Mg2o"), pcVar7 != (char *)0x0)))))))))) {
    Sleep(1000);
    (**(code **)(*param_6 + 0x28))(param_6,"This code has been revoked!");
    (**(code **)(*param_6 + 0x50))(param_6);
    FUN_1400bceb0(local_308);
    FUN_1400ef960(local_128);
    FUN_1400bceb0(local_278);
    FUN_1400bceb0(local_218);
    FUN_1400bceb0(local_2a8);
    FUN_1400bceb0(local_1e8);
    FUN_1400f0d30(local_368);
    goto LAB_1400d5afc;
  }
  FUN_1400f3060(local_368,local_1e8,"VW5sb2NrIGtleSBpcyBpbnZhbGlk");
  FUN_1400f3060(local_368,local_2a8,local_350);
  FUN_1400f3060(local_368,local_218,"Q2hpbGthdCBTb2Z0d2FyZSwgSW5jLg==");
  FUN_1400bcc20(local_188);
  FUN_1400f3060(local_368,local_188,"U0hPQ0s=");
  FUN_1400f3060(local_368,local_278,local_348);
  FUN_1400bcc20(local_2d8);
  FUN_1400bc640(local_2d8,pcVar10);
  FUN_1400bbc30(local_2d8);
  FUN_1400bbc30(local_2a8);
  uVar8 = FUN_1400b8b90(local_2d8);
  cVar3 = FUN_1400d41c0(local_358,uVar8);
  if (cVar3 == '\0') {
    if (param_7 != '\0') {
      Sleep(100);
      (**(code **)(*param_6 + 0x58))(param_6,"unlockCode",local_130);
      (**(code **)(*param_6 + 0x28))(param_6,"Requires permanent code");
      (**(code **)(*param_6 + 0x50))(param_6);
      FUN_1400bceb0(local_2d8);
      FUN_1400bceb0(local_188);
      FUN_1400bceb0(local_308);
      FUN_1400ef960(local_128);
      FUN_1400bceb0(local_278);
      FUN_1400bceb0(local_218);
      FUN_1400bceb0(local_2a8);
      FUN_1400bceb0(local_1e8);
      FUN_1400f0d30(local_368);
      goto LAB_1400d5afc;
    }
    *param_5 = 1;
    local_340[0] = 0;
    uVar8 = FUN_1400b8b90(local_278);
    FUN_1400efcc0(local_128,uVar8);
    cVar3 = FUN_1400f0710(local_128,local_340,param_6);
    if (bVar2) {
      (**(code **)(*param_6 + 0x30))(param_6,&DAT_14024049c);
      *param_5 = 0;
      cVar3 = '\x01';
    }
    else if (cVar3 == '\0') {
      FUN_1400bcc20(local_1b8);
      FUN_1400bc640(local_1b8,"Trial has expired. ");
      FUN_1400be4a0(local_1b8,local_340[0]);
      lVar9 = *param_6;
      uVar8 = FUN_1400b8b90(local_1b8);
      (**(code **)(lVar9 + 0x28))(param_6,uVar8);
      FUN_1400bceb0(local_1b8);
      Sleep(100);
      goto LAB_1400d5995;
    }
    (**(code **)(*param_6 + 0x30))(param_6,"Component successfully unlocked using trial key");
LAB_1400d5995:
    (**(code **)(*param_6 + 0x50))(param_6);
    FUN_1400bceb0(local_2d8);
    FUN_1400bceb0(local_188);
    FUN_1400bceb0(local_308);
    FUN_1400ef960(local_128);
    FUN_1400bceb0(local_278);
    FUN_1400bceb0(local_218);
    FUN_1400bceb0(local_2a8);
    FUN_1400bceb0(local_1e8);
    FUN_1400f0d30(local_368);
    FUN_1400bceb0(local_338);
    return cVar3;
  }
  pcVar10 = (char *)FUN_1400b8b90(local_2a8);
  pcVar7 = (char *)FUN_1400b8b90(local_2d8);
  pcVar10 = strstr(pcVar7,pcVar10);
  if (pcVar10 == (char *)0x0) {
    FUN_1400bcc20(local_248);
    FUN_1400bcc20(local_1b8);
    FUN_1400bbe50(local_248,0x5b);
    FUN_1400bbe50(local_1b8,0x5b);
    FUN_1400bda40(local_248,local_2d8);
    FUN_1400bda40(local_1b8,local_2a8);
    FUN_1400bbe50(local_248,0x5d);
    FUN_1400bbe50(local_1b8,0x5d);
    (**(code **)(*param_6 + 0x28))(param_6,"Unlock code is invalid. (reason=11)");
    lVar9 = *param_6;
    uVar8 = FUN_1400b8b90(local_1b8);
    (**(code **)(lVar9 + 0x58))(param_6,"required",uVar8);
    lVar9 = *param_6;
    uVar8 = FUN_1400b8b90(local_248);
    (**(code **)(lVar9 + 0x58))(param_6,"regCode",uVar8);
    (**(code **)(*param_6 + 0x50))(param_6);
    Sleep(100);
    FUN_1400bceb0(local_1b8);
    FUN_1400bceb0(local_248);
    FUN_1400bceb0(local_2d8);
    FUN_1400bceb0(local_188);
    FUN_1400bceb0(local_308);
    FUN_1400ef960(local_128);
    FUN_1400bceb0(local_278);
    FUN_1400bceb0(local_218);
    FUN_1400bceb0(local_2a8);
    FUN_1400bceb0(local_1e8);
    FUN_1400f0d30(local_368);
    goto LAB_1400d5afc;
  }
  pcVar10 = (char *)FUN_1400b8b90(local_188);
  pcVar7 = (char *)FUN_1400b8b90(local_2d8);
  pcVar10 = strstr(pcVar7,pcVar10);
  if (pcVar10 != (char *)0x0) {
    FUN_1400bbde0(local_188);
    (**(code **)(*param_6 + 0x28))(param_6,"Error 201");
    (**(code **)(*param_6 + 0x50))(param_6);
    Sleep(10000);
    FUN_1400bceb0(local_2d8);
    FUN_1400bceb0(local_188);
    FUN_1400bceb0(local_308);
    FUN_1400ef960(local_128);
    FUN_1400bceb0(local_278);
    FUN_1400bceb0(local_218);
    FUN_1400bceb0(local_2a8);
    FUN_1400bceb0(local_1e8);
    FUN_1400f0d30(local_368);
    goto LAB_1400d5afc;
  }
  FUN_1400cf520(param_6,"requiresPerm",param_7);
  if (param_7 == '\0') {
    lVar9 = FUN_1400b8b90(local_2d8);
    local_378 = &local_358;
    iVar4 = sscanf((char *)(lVar9 + 1),"%02d%02d%04d");
    if (iVar4 == 3) {
      iVar4 = (int)local_358;
    }
    else {
      (**(code **)(*param_6 + 0x30))(param_6,"re-parsing expire date...");
      local_378 = &local_358;
      iVar4 = sscanf((char *)(lVar9 + 1),"%02d%02d%02d");
      if (iVar4 != 3) goto LAB_1400d55fe;
      iVar4 = (int)local_358 + 2000;
      local_358 = CONCAT44(local_358._4_4_,iVar4);
    }
    if (iVar4 < 100) {
      iVar4 = iVar4 + 2000;
      local_358 = CONCAT44(local_358._4_4_,iVar4);
    }
    local_378 = (undefined8 *)CONCAT44(local_378._4_4_,iVar4);
    sprintf(local_a8,"%d/%d/%d");
    (**(code **)(*param_6 + 0x58))(param_6,"TempExpireDate",local_a8);
    if (0xe < (int)local_358 - 0x7d6U) {
      (**(code **)(*param_6 + 0x30))(param_6,"Year out of range, failed.");
      (**(code **)(*param_6 + 0x50))(param_6);
      FUN_1400bceb0(local_2d8);
      FUN_1400bceb0(local_188);
      FUN_1400bceb0(local_308);
      FUN_1400ef960(local_128);
      FUN_1400bceb0(local_278);
      FUN_1400bceb0(local_218);
      FUN_1400bceb0(local_2a8);
      FUN_1400bceb0(local_1e8);
      FUN_1400f0d30(local_368);
      goto LAB_1400d5afc;
    }
    if (((uint)local_348 < 0xe) && ((uint)local_350 < 0x21)) {
      FUN_1400d04a0(&local_158);
      FUN_1400d0640(&local_158);
      if ((int)local_358 < (int)(uint)local_158) {
        (**(code **)(*param_6 + 0x30))(param_6,"Temporary unlock code expired.");
        (**(code **)(*param_6 + 0x50))(param_6);
        FUN_1400bceb0(local_2d8);
        FUN_1400bceb0(local_188);
        FUN_1400bceb0(local_308);
        FUN_1400ef960(local_128);
        FUN_1400bceb0(local_278);
        FUN_1400bceb0(local_218);
        FUN_1400bceb0(local_2a8);
        FUN_1400bceb0(local_1e8);
        FUN_1400f0d30(local_368);
      }
      else {
        if ((int)(uint)local_158 < (int)local_358) {
          (**(code **)(*param_6 + 0x30))
                    (param_6,"Component successfully unlocked using temporary unlock code.");
          (**(code **)(*param_6 + 0x50))(param_6);
          FUN_1400bceb0(local_2d8);
          FUN_1400bceb0(local_188);
          FUN_1400bceb0(local_308);
          FUN_1400ef960(local_128);
          FUN_1400bceb0(local_278);
          FUN_1400bceb0(local_218);
          FUN_1400bceb0(local_2a8);
          FUN_1400bceb0(local_1e8);
          FUN_1400f0d30(local_368);
          FUN_1400bceb0(local_338);
          return '\x01';
        }
        if ((int)(uint)local_348 < (int)(uint)local_156) {
          (**(code **)(*param_6 + 0x30))(param_6,"Temporary unlock code expired.");
          (**(code **)(*param_6 + 0x50))(param_6);
          FUN_1400bceb0(local_2d8);
          FUN_1400bceb0(local_188);
          FUN_1400bceb0(local_308);
          FUN_1400ef960(local_128);
          FUN_1400bceb0(local_278);
          FUN_1400bceb0(local_218);
          FUN_1400bceb0(local_2a8);
          FUN_1400bceb0(local_1e8);
          FUN_1400f0d30(local_368);
        }
        else {
          if ((int)(uint)local_156 < (int)(uint)local_348) {
            (**(code **)(*param_6 + 0x30))
                      (param_6,"Component successfully unlocked using temporary unlock code.");
            (**(code **)(*param_6 + 0x50))(param_6);
            FUN_1400bceb0(local_2d8);
            FUN_1400bceb0(local_188);
            FUN_1400bceb0(local_308);
            FUN_1400ef960(local_128);
            FUN_1400bceb0(local_278);
            FUN_1400bceb0(local_218);
            FUN_1400bceb0(local_2a8);
            FUN_1400bceb0(local_1e8);
            FUN_1400f0d30(local_368);
            FUN_1400bceb0(local_338);
            return '\x01';
          }
          if ((int)(uint)local_152 <= (int)(uint)local_350) {
            (**(code **)(*param_6 + 0x30))
                      (param_6,"Component successfully unlocked using temporary unlock code.");
            (**(code **)(*param_6 + 0x50))(param_6);
            FUN_1400bceb0(local_2d8);
            FUN_1400bceb0(local_188);
            FUN_1400bceb0(local_308);
            FUN_1400ef960(local_128);
            FUN_1400bceb0(local_278);
            FUN_1400bceb0(local_218);
            FUN_1400bceb0(local_2a8);
            FUN_1400bceb0(local_1e8);
            FUN_1400f0d30(local_368);
            FUN_1400bceb0(local_338);
            return '\x01';
          }
          (**(code **)(*param_6 + 0x30))(param_6,"Temporary unlock code expired.");
          (**(code **)(*param_6 + 0x50))(param_6);
          FUN_1400bceb0(local_2d8);
          FUN_1400bceb0(local_188);
          FUN_1400bceb0(local_308);
          FUN_1400ef960(local_128);
          FUN_1400bceb0(local_278);
          FUN_1400bceb0(local_218);
          FUN_1400bceb0(local_2a8);
          FUN_1400bceb0(local_1e8);
          FUN_1400f0d30(local_368);
        }
      }
      goto LAB_1400d5afc;
    }
  }
LAB_1400d55fe:
  cVar3 = FUN_1400bc610(local_2d8,0x2d);
  if (cVar3 == '\0') {
    pcVar10 = (char *)FUN_1400b8b90(local_2d8);
    cVar3 = *pcVar10;
    while( true ) {
      if (cVar3 == '\0') {
        (**(code **)(*param_6 + 0x30))
                  (param_6,"Component successfully unlocked using permanent unlock code.");
        (**(code **)(*param_6 + 0x50))(param_6);
        FUN_1400bbde0(local_338);
        FUN_1400bbde0(local_2d8);
        FUN_1400bceb0(local_2d8);
        FUN_1400bceb0(local_188);
        FUN_1400bceb0(local_308);
        FUN_1400ef960(local_128);
        FUN_1400bceb0(local_278);
        FUN_1400bceb0(local_218);
        FUN_1400bceb0(local_2a8);
        FUN_1400bceb0(local_1e8);
        FUN_1400f0d30(local_368);
        FUN_1400bceb0(local_338);
        return '\x01';
      }
      if ((cVar3 != '_') &&
         ((((cVar3 < '0' || (('9' < cVar3 && (cVar3 < 'A')))) || (('Z' < cVar3 && (cVar3 < 'a'))))
          || ('z' < cVar3)))) break;
      pcVar10 = pcVar10 + 1;
      cVar3 = *pcVar10;
    }
    (**(code **)(*param_6 + 0x28))(param_6,"Invalid characters in unlock code.");
    (**(code **)(*param_6 + 0x50))(param_6);
    FUN_1400bceb0(local_2d8);
    FUN_1400bceb0(local_188);
    FUN_1400bceb0(local_308);
    FUN_1400ef960(local_128);
    FUN_1400bceb0(local_278);
    FUN_1400bceb0(local_218);
    FUN_1400bceb0(local_2a8);
    FUN_1400bceb0(local_1e8);
    FUN_1400f0d30(local_368);
  }
  else {
    (**(code **)(*param_6 + 0x30))(param_6,"Temporary unlock code expired.");
    (**(code **)(*param_6 + 0x50))(param_6);
    FUN_1400bceb0(local_2d8);
    FUN_1400bceb0(local_188);
    FUN_1400bceb0(local_308);
    FUN_1400ef960(local_128);
    FUN_1400bceb0(local_278);
    FUN_1400bceb0(local_218);
    FUN_1400bceb0(local_2a8);
    FUN_1400bceb0(local_1e8);
    FUN_1400f0d30(local_368);
  }
LAB_1400d5afc:
  FUN_1400bceb0(local_338);
  return '\0';
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1400d5b30(undefined8 *param_1)

{
  undefined1 auStack_48 [48];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_48;
  *param_1 = TwoFish::vftable;
  FUN_1400b8c40();
  param_1[0x222] = 0x100;
  *(undefined1 *)(param_1 + 0x223) = 0;
  *(undefined4 *)((longlong)param_1 + 0x111c) = 2;
  param_1[0x224] = 0x440531f69a8174ae;
  param_1[0x225] = 0xd2d55f7865b3ba2c;
  return param_1;
}



void FUN_1400d5bd0(undefined8 *param_1)

{
  *param_1 = TwoFish::vftable;
  FUN_1400b92d0();
  return;
}



void FUN_1400d5bf0(longlong param_1,undefined8 *param_2)

{
  if (param_2 != (undefined8 *)0x0) {
    *(undefined8 *)(param_1 + 0x1120) = *param_2;
    *(undefined8 *)(param_1 + 0x1128) = param_2[1];
  }
  return;
}



undefined8 FUN_1400d5c10(longlong param_1,int param_2)

{
  if (0xc0 < param_2) {
    *(undefined4 *)(param_1 + 0x1110) = 0x100;
    return 0x100;
  }
  if (0x80 < param_2) {
    *(undefined4 *)(param_1 + 0x1110) = 0xc0;
    return 0xc0;
  }
  *(undefined4 *)(param_1 + 0x1110) = 0x80;
  return 0x80;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400d5c50(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  uint uVar4;
  undefined8 uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  undefined8 uVar8;
  undefined8 uVar9;
  undefined1 auStack_98 [32];
  int local_78;
  undefined8 local_70;
  void *local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  ulonglong local_48;
  
  local_60 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_98;
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    local_68 = operator_new(0x28);
    if (local_68 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(local_68);
    }
  }
  else {
    local_68 = operator_new(0x28);
    uVar5 = 0;
    if (local_68 != (void *)0x0) {
      uVar5 = FUN_1400b8c40(local_68);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x41c,iVar2 + 0x20);
      uVar5 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar5,uVar3);
      if ((*(int *)(param_1 + 0x111c) == 1) || (uVar4 = FUN_1400b8b80(param_3), uVar4 < 0x10)) {
        local_50 = 0;
        local_58 = 0;
      }
      else {
        puVar6 = (undefined8 *)FUN_1400b8b90(param_3);
        local_58 = *puVar6;
        local_50 = puVar6[1];
      }
      lVar7 = FUN_1400b8b90(param_2);
      if (lVar7 != 0) {
        uVar8 = FUN_1400b8b90(uVar5);
        iVar2 = FUN_1400b8b80(param_2);
        uVar9 = FUN_1400b8b90(param_2);
        local_78 = iVar2 << 3;
        local_70 = uVar8;
        FUN_140113360(param_1 + 8,*(undefined4 *)(param_1 + 0x111c),&local_58,uVar9);
        FUN_1400b8b30(param_3);
        FUN_1400b97e0(param_3,&local_58,0x10);
      }
    }
  }
  return uVar5;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400d5df0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  uint uVar5;
  undefined8 uVar6;
  undefined8 *puVar7;
  longlong lVar8;
  undefined8 uVar9;
  undefined8 uVar10;
  undefined1 auStack_98 [32];
  int local_78;
  undefined8 local_70;
  void *local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  ulonglong local_48;
  
  local_60 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_98;
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    local_68 = operator_new(0x28);
    if (local_68 == (void *)0x0) {
      uVar6 = 0;
    }
    else {
      uVar6 = FUN_1400b8c40(local_68);
    }
  }
  else {
    iVar2 = FUN_1400b8b80(param_2);
    FUN_1400b9a00(param_2,*(undefined4 *)(param_1 + 0x1114),0x10);
    local_68 = operator_new(0x28);
    uVar6 = 0;
    if (local_68 != (void *)0x0) {
      uVar6 = FUN_1400b8c40(local_68);
    }
    iVar3 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar6,iVar3 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x41d,iVar2 + 0x20);
      uVar6 = 0;
    }
    else {
      uVar4 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar6,uVar4);
      if ((*(int *)(param_1 + 0x111c) == 1) || (uVar5 = FUN_1400b8b80(param_3), uVar5 < 0x10)) {
        local_50 = 0;
        local_58 = 0;
      }
      else {
        puVar7 = (undefined8 *)FUN_1400b8b90(param_3);
        local_58 = *puVar7;
        local_50 = puVar7[1];
      }
      lVar8 = FUN_1400b8b90(param_2);
      if (lVar8 != 0) {
        uVar9 = FUN_1400b8b90(uVar6);
        iVar3 = FUN_1400b8b80(param_2);
        uVar10 = FUN_1400b8b90(param_2);
        local_78 = iVar3 << 3;
        local_70 = uVar9;
        FUN_140113360(param_1 + 8,*(undefined4 *)(param_1 + 0x111c),&local_58,uVar10);
      }
      iVar3 = FUN_1400b8b80(param_2);
      if (iVar3 - iVar2 != 0) {
        FUN_1400b8be0(param_2,iVar3 - iVar2);
      }
    }
  }
  return uVar6;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400d5fb0(longlong param_1,undefined8 param_2,undefined8 *param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined1 auStack_98 [32];
  int local_78;
  undefined8 local_70;
  void *local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  ulonglong local_48;
  
  local_60 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_98;
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    local_68 = operator_new(0x28);
    if (local_68 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(local_68);
    }
  }
  else {
    local_68 = operator_new(0x28);
    uVar4 = 0;
    if (local_68 != (void *)0x0) {
      uVar4 = FUN_1400b8c40(local_68);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar4,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x41f,iVar2 + 0x20);
      uVar4 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar4,uVar3);
      if ((*(int *)(param_1 + 0x111c) == 1) || (param_3 == (undefined8 *)0x0)) {
        local_50 = 0;
        local_58 = 0;
      }
      else {
        local_58 = *param_3;
        local_50 = param_3[1];
      }
      lVar5 = FUN_1400b8b90(param_2);
      if (lVar5 != 0) {
        uVar6 = FUN_1400b8b90(uVar4);
        iVar2 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(param_2);
        local_78 = iVar2 << 3;
        local_70 = uVar6;
        FUN_140113f20(param_1 + 8,*(undefined4 *)(param_1 + 0x111c),&local_58,uVar7);
      }
      if (*(char *)(param_1 + 0x1118) != '\0') {
        FUN_1400b9870(uVar4);
      }
      if (param_3 != (undefined8 *)0x0) {
        *param_3 = local_58;
        param_3[1] = local_50;
      }
    }
  }
  return uVar4;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400d6140(longlong param_1,undefined8 param_2,undefined8 *param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined1 auStack_98 [32];
  int local_78;
  undefined8 local_70;
  void *local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  ulonglong local_48;
  
  local_60 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_98;
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    local_68 = operator_new(0x28);
    if (local_68 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(local_68);
    }
  }
  else {
    local_68 = operator_new(0x28);
    uVar4 = 0;
    if (local_68 != (void *)0x0) {
      uVar4 = FUN_1400b8c40(local_68);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar4,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x420,iVar2 + 0x20);
      uVar4 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar4,uVar3);
      if ((*(int *)(param_1 + 0x111c) == 1) || (param_3 == (undefined8 *)0x0)) {
        local_50 = 0;
        local_58 = 0;
      }
      else {
        local_58 = *param_3;
        local_50 = param_3[1];
      }
      lVar5 = FUN_1400b8b90(param_2);
      if (lVar5 != 0) {
        uVar6 = FUN_1400b8b90(uVar4);
        iVar2 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(param_2);
        local_78 = iVar2 << 3;
        local_70 = uVar6;
        FUN_140113f20(param_1 + 8,*(undefined4 *)(param_1 + 0x111c),&local_58,uVar7);
      }
      FUN_1400b9c60(uVar4,*(undefined4 *)(param_1 + 0x1114),0x10,param_4);
      if (*(char *)(param_1 + 0x1118) != '\0') {
        FUN_1400b9870(uVar4);
      }
    }
  }
  return uVar4;
}



void FUN_1400d62e0(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x1114) = param_2;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400d62f0(longlong param_1,undefined8 param_2)

{
  int iVar1;
  uint uVar2;
  longlong lVar3;
  undefined8 *puVar4;
  void *_Src;
  undefined1 *puVar5;
  undefined1 auStack_88 [32];
  undefined8 local_68;
  undefined8 uStack_60;
  undefined8 local_58;
  undefined8 uStack_50;
  undefined8 local_48;
  undefined8 uStack_40;
  undefined8 local_38;
  undefined8 uStack_30;
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  FUN_140113320(param_1 + 8,param_2,*(undefined4 *)(param_1 + 0x1110));
  local_68 = 0;
  uStack_60 = 0;
  local_58 = 0;
  uStack_50 = 0;
  local_48 = 0;
  uStack_40 = 0;
  local_38 = 0;
  uStack_30 = 0;
  lVar3 = FUN_1400b8b90(param_1 + 0x10e8);
  if (lVar3 != 0) {
    iVar1 = FUN_1400b8b80(param_1 + 0x10e8);
    if (iVar1 != 0) {
      uVar2 = FUN_1400b8b80(param_1 + 0x10e8);
      if (uVar2 < 0x41) {
        uVar2 = FUN_1400b8b80(param_1 + 0x10e8);
        _Src = (void *)FUN_1400b8b90(param_1 + 0x10e8);
        memcpy(&local_68,_Src,(ulonglong)uVar2);
      }
      else {
        puVar4 = (undefined8 *)FUN_1400b8b90();
        local_68 = *puVar4;
        uStack_60 = puVar4[1];
        local_58 = puVar4[2];
        uStack_50 = puVar4[3];
        local_48 = puVar4[4];
        uStack_40 = puVar4[5];
        local_38 = puVar4[6];
        uStack_30 = puVar4[7];
      }
    }
  }
  iVar1 = 0;
  if (0 < (int)(*(int *)(param_1 + 0x1110) + (*(int *)(param_1 + 0x1110) >> 0x1f & 7U)) >> 3) {
    puVar5 = (undefined1 *)(param_1 + 0x18);
    do {
      iVar1 = iVar1 + 1;
      *puVar5 = puVar5[(longlong)&local_68 - (param_1 + 0x18)];
      puVar5 = puVar5 + 1;
    } while (iVar1 < (int)(*(int *)(param_1 + 0x1110) + (*(int *)(param_1 + 0x1110) >> 0x1f & 7U))
                     >> 3);
  }
  FUN_140112730(param_1 + 8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400d6450(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined1 auStack_88 [32];
  int local_68;
  undefined8 local_60;
  void *local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  ulonglong local_38;
  
  local_50 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    local_58 = operator_new(0x28);
    if (local_58 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(local_58);
    }
  }
  else {
    FUN_1400d62f0(param_1,0);
    FUN_1400b9a00(param_2,*(undefined4 *)(param_1 + 0x1114),0x10);
    local_58 = operator_new(0x28);
    uVar4 = 0;
    if (local_58 != (void *)0x0) {
      uVar4 = FUN_1400b8c40(local_58);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar4,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,0x421,iVar2 + 0x20);
      uVar4 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar4,uVar3);
      if (*(int *)(param_1 + 0x111c) == 1) {
        local_48 = 0;
        local_40 = 0;
      }
      else {
        local_48 = *(undefined8 *)(param_1 + 0x1120);
        local_40 = *(undefined8 *)(param_1 + 0x1128);
      }
      lVar5 = FUN_1400b8b90(param_2);
      if (lVar5 != 0) {
        uVar6 = FUN_1400b8b90(uVar4);
        iVar2 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(param_2);
        local_68 = iVar2 << 3;
        local_60 = uVar6;
        FUN_140113360(param_1 + 8,*(undefined4 *)(param_1 + 0x111c),&local_48,uVar7);
      }
      FUN_1400b9c60(param_2,*(undefined4 *)(param_1 + 0x1114),0x10,param_3);
    }
  }
  return uVar4;
}



void FUN_1400d6600(longlong param_1,undefined8 param_2)

{
  FUN_1400b8b30(param_1 + 0x10e8);
  FUN_1400b9e90(param_1 + 0x10e8,param_2);
  return;
}



void FUN_1400d6640(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 0x1118) = param_2;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400d6650(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined1 auStack_88 [32];
  int local_68;
  undefined8 local_60;
  void *local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  ulonglong local_38;
  
  local_50 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    local_58 = operator_new(0x28);
    if (local_58 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(local_58);
    }
  }
  else {
    FUN_1400d62f0(param_1,1);
    local_58 = operator_new(0x28);
    uVar4 = 0;
    if (local_58 != (void *)0x0) {
      uVar4 = FUN_1400b8c40(local_58);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar4,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,0x422,iVar2 + 0x20);
      uVar4 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar4,uVar3);
      if (*(int *)(param_1 + 0x111c) == 1) {
        local_48 = 0;
        local_40 = 0;
      }
      else {
        local_48 = *(undefined8 *)(param_1 + 0x1120);
        local_40 = *(undefined8 *)(param_1 + 0x1128);
      }
      lVar5 = FUN_1400b8b90(param_2);
      if (lVar5 != 0) {
        uVar6 = FUN_1400b8b90(uVar4);
        iVar2 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(param_2);
        local_68 = iVar2 << 3;
        local_60 = uVar6;
        FUN_140113f20(param_1 + 8,*(undefined4 *)(param_1 + 0x111c),&local_48,uVar7);
      }
      FUN_1400b9c60(uVar4,*(undefined4 *)(param_1 + 0x1114),0x10,param_3);
      if (*(char *)(param_1 + 0x1118) != '\0') {
        FUN_1400b9870(uVar4);
      }
    }
  }
  return uVar4;
}



undefined1 FUN_1400d6800(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x111c) = 1;
  return 1;
}



undefined1 FUN_1400d6810(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x111c) = 2;
  return 1;
}



undefined8 * FUN_1400d6820(undefined8 *param_1,uint param_2)

{
  *param_1 = TwoFish::vftable;
  FUN_1400b92d0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400d6870(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined1 auStack_98 [32];
  int local_78;
  undefined8 local_70;
  void *local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  ulonglong local_48;
  
  local_60 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_98;
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    local_68 = operator_new(0x28);
    if (local_68 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(local_68);
    }
  }
  else {
    FUN_1400d62f0(param_1,0);
    local_68 = operator_new(0x28);
    uVar4 = 0;
    if (local_68 != (void *)0x0) {
      uVar4 = FUN_1400b8c40(local_68);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar4,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x41b,iVar2 + 0x20);
      uVar4 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar4,uVar3);
      if (*(int *)(param_1 + 0x111c) == 1) {
        local_58 = 0;
        local_50 = 0;
      }
      else {
        local_58 = *(undefined8 *)(param_1 + 0x1120);
        local_50 = *(undefined8 *)(param_1 + 0x1128);
      }
      lVar5 = FUN_1400b8b90(param_2);
      if (lVar5 != 0) {
        uVar6 = FUN_1400b8b90(uVar4);
        iVar2 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(param_2);
        local_78 = iVar2 << 3;
        local_70 = uVar6;
        FUN_140113360(param_1 + 8,*(undefined4 *)(param_1 + 0x111c),&local_58,uVar7);
        FUN_1400b8b30(param_3);
        FUN_1400b97e0(param_3,&local_58,0x10);
      }
    }
  }
  return uVar4;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400d6a10(longlong param_1,undefined8 param_2,undefined8 *param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined1 auStack_98 [32];
  int local_78;
  undefined8 local_70;
  void *local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  ulonglong local_48;
  
  local_60 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_98;
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    local_68 = operator_new(0x28);
    if (local_68 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(local_68);
    }
  }
  else {
    FUN_1400d62f0(param_1,1);
    local_68 = operator_new(0x28);
    uVar4 = 0;
    if (local_68 != (void *)0x0) {
      uVar4 = FUN_1400b8c40(local_68);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar4,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x41e,iVar2 + 0x20);
      uVar4 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar4,uVar3);
      if (*(int *)(param_1 + 0x111c) == 1) {
        local_58 = 0;
        local_50 = 0;
      }
      else {
        local_58 = *(undefined8 *)(param_1 + 0x1120);
        local_50 = *(undefined8 *)(param_1 + 0x1128);
      }
      lVar5 = FUN_1400b8b90(param_2);
      if (lVar5 != 0) {
        uVar6 = FUN_1400b8b90(uVar4);
        iVar2 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(param_2);
        local_78 = iVar2 << 3;
        local_70 = uVar6;
        FUN_140113f20(param_1 + 8,*(undefined4 *)(param_1 + 0x111c),&local_58,uVar7);
      }
      if (*(char *)(param_1 + 0x1118) != '\0') {
        FUN_1400b9870(uVar4);
      }
      if (param_3 != (undefined8 *)0x0) {
        *param_3 = local_58;
        param_3[1] = local_50;
      }
    }
  }
  return uVar4;
}



undefined8 * FUN_1400d6bb0(undefined8 *param_1)

{
  *(undefined4 *)(param_1 + 0x82) = 0x10;
  *param_1 = ChilkatArc4::vftable;
  param_1[0x81] = 0;
  memset(param_1 + 1,0,0x400);
  return param_1;
}



void FUN_1400d6bf0(undefined8 *param_1)

{
  *param_1 = ChilkatArc4::vftable;
  return;
}



void FUN_1400d6c00(longlong param_1,longlong param_2,int param_3)

{
  int iVar1;
  uint uVar2;
  int *piVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  int *piVar7;
  longlong lVar8;
  ulonglong uVar9;
  ulonglong uVar3;
  
  uVar9 = 0;
  piVar4 = (int *)(param_1 + 8);
  lVar8 = 0x100;
  *(undefined8 *)(param_1 + 0x408) = 0;
  uVar3 = uVar9;
  piVar7 = piVar4;
  do {
    *piVar7 = (int)uVar3;
    uVar2 = (int)uVar3 + 1;
    uVar3 = (ulonglong)uVar2;
    piVar7 = piVar7 + 1;
    uVar5 = uVar9;
    uVar6 = uVar9;
  } while ((int)uVar2 < 0x100);
  do {
    iVar1 = *piVar4;
    uVar5 = (ulonglong)(byte)(*(char *)(uVar6 + param_2) + (char)uVar5 + (char)iVar1);
    uVar3 = uVar6 + 1;
    if ((longlong)param_3 <= (longlong)(uVar6 + 1)) {
      uVar3 = uVar9;
    }
    lVar8 = lVar8 + -1;
    *piVar4 = *(int *)(param_1 + 8 + uVar5 * 4);
    *(int *)(param_1 + 8 + uVar5 * 4) = iVar1;
    piVar4 = piVar4 + 1;
    uVar6 = uVar3;
  } while (lVar8 != 0);
  return;
}



void FUN_1400d6cb0(longlong param_1,longlong param_2,byte *param_3,int param_4)

{
  undefined4 uVar1;
  undefined4 uVar2;
  byte bVar3;
  ulonglong uVar4;
  byte *pbVar5;
  char cVar6;
  longlong lVar7;
  byte bVar8;
  ulonglong uVar9;
  
  uVar9 = (ulonglong)*(uint *)(param_1 + 0x408);
  uVar4 = (ulonglong)*(uint *)(param_1 + 0x40c);
  lVar7 = (longlong)param_4;
  if (0 < lVar7) {
    pbVar5 = param_3;
    do {
      bVar8 = (char)uVar9 + 1;
      uVar9 = (ulonglong)bVar8;
      uVar1 = *(undefined4 *)(param_1 + 8 + uVar9 * 4);
      cVar6 = (char)uVar1;
      bVar3 = (char)uVar4 + cVar6;
      uVar4 = (ulonglong)bVar3;
      uVar2 = *(undefined4 *)(param_1 + 8 + uVar4 * 4);
      *(undefined4 *)(param_1 + 8 + uVar9 * 4) = uVar2;
      *(undefined4 *)(param_1 + 8 + uVar4 * 4) = uVar1;
      lVar7 = lVar7 + -1;
      *pbVar5 = *(byte *)(param_1 + 8 + (ulonglong)(byte)((char)uVar2 + cVar6) * 4) ^
                (pbVar5 + 1)[(param_2 - (longlong)param_3) + -1];
      pbVar5 = pbVar5 + 1;
    } while (lVar7 != 0);
    *(uint *)(param_1 + 0x408) = (uint)bVar8;
    *(uint *)(param_1 + 0x40c) = (uint)bVar3;
    return;
  }
  *(uint *)(param_1 + 0x40c) = *(uint *)(param_1 + 0x40c);
  *(uint *)(param_1 + 0x408) = *(uint *)(param_1 + 0x408);
  return;
}



void FUN_1400d6d60(undefined8 param_1,undefined8 param_2)

{
  int iVar1;
  uint uVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 uVar5;
  void *pvVar6;
  
  iVar1 = FUN_1400b8b80(param_2);
  if (iVar1 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 != (void *)0x0) {
      FUN_1400b8c40(pvVar4);
    }
  }
  else {
    uVar2 = FUN_1400b8b80(param_2);
    pvVar4 = operator_new((ulonglong)uVar2);
    uVar3 = FUN_1400b8b80(param_2);
    uVar5 = FUN_1400b8b90(param_2);
    FUN_1400d6cb0(param_1,uVar5,pvVar4,uVar3);
    pvVar6 = operator_new(0x28);
    if (pvVar6 != (void *)0x0) {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c80(pvVar6,pvVar4,uVar3);
    }
  }
  return;
}



undefined8 * FUN_1400d6e30(undefined8 *param_1,byte param_2)

{
  *param_1 = ChilkatArc4::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1400d6e60(undefined8 param_1)

{
  void *pvVar1;
  void *_Dst;
  
  pvVar1 = operator_new(0x600);
  _Dst = operator_new(0x600);
  memset(_Dst,0,0x600);
  FUN_1400d6cb0(param_1,_Dst,pvVar1,0x600);
  operator_delete(_Dst);
  operator_delete(pvVar1);
  return;
}



void FUN_1400d6ed0(longlong param_1,undefined8 param_2,uint param_3)

{
  undefined8 uVar1;
  uint uVar2;
  
  uVar2 = 0x100;
  if ((param_3 < 0x101) && (uVar2 = param_3, param_3 == 0)) {
    uVar2 = 1;
  }
  FUN_1400ba520(param_2,uVar2);
  *(uint *)(param_1 + 0x410) = uVar2;
  uVar1 = FUN_1400b8b90(param_2);
  FUN_1400d6c00(param_1,uVar1,uVar2);
  return;
}



undefined8 * FUN_1400d6f40(undefined8 *param_1)

{
  *(undefined4 *)(param_1 + 0x12) = 0x10;
  *(undefined8 *)((longlong)param_1 + 0x94) = 0x80;
  *param_1 = ChilkatRc2::vftable;
  *(undefined4 *)((longlong)param_1 + 0x9c) = 0;
  param_1[0x11] = 0;
  return param_1;
}



void FUN_1400d6f80(undefined8 *param_1)

{
  *param_1 = ChilkatRc2::vftable;
  return;
}



void FUN_1400d6f90(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x9c) = param_2;
  return;
}



void FUN_1400d6fa0(longlong param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  uint uVar2;
  
  uVar2 = FUN_1400b8b80(param_2);
  if (7 < uVar2) {
    puVar1 = (undefined8 *)FUN_1400b8b90(param_2);
    *(undefined8 *)(param_1 + 0x88) = *puVar1;
  }
  return;
}



void FUN_1400d6fe0(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x98) = param_2;
  return;
}



ulonglong FUN_1400d6ff0(longlong param_1,void *param_2,uint param_3,int param_4)

{
  byte *pbVar1;
  char cVar2;
  byte bVar3;
  ulonglong in_RAX;
  char *pcVar4;
  byte *pbVar5;
  char *_Dst;
  uint uVar6;
  ulonglong uVar7;
  char cVar8;
  int iVar9;
  ulonglong uVar10;
  uint uVar11;
  
  uVar7 = (ulonglong)(int)param_3;
  if (param_3 < 0x81) {
    _Dst = (char *)(param_1 + 8);
    if (param_4 == 0) {
      param_4 = 0x400;
    }
    memcpy(_Dst,param_2,(ulonglong)param_3);
    if (param_3 < 0x80) {
      cVar8 = *(char *)((ulonglong)(param_3 - 1) + 8 + param_1);
      pcVar4 = (char *)(uVar7 + 8 + param_1);
      do {
        cVar2 = *_Dst;
        uVar6 = (int)uVar7 + 1;
        uVar7 = (ulonglong)uVar6;
        _Dst = _Dst + 1;
        cVar8 = (&DAT_140240b50)[(byte)(cVar8 + cVar2)];
        *pcVar4 = cVar8;
        pcVar4 = pcVar4 + 1;
      } while (uVar6 < 0x80);
    }
    uVar11 = param_4 + 7U >> 3;
    uVar6 = 0x80 - uVar11;
    uVar7 = (ulonglong)uVar6;
    bVar3 = (&DAT_140240b50)
            [0xffL >> (-(char)param_4 & 7U) & (ulonglong)*(byte *)(uVar7 + 8 + param_1)];
    *(byte *)(uVar7 + 8 + param_1) = bVar3;
    if (uVar6 != 0) {
      pbVar5 = (byte *)((longlong)(int)uVar6 + 8 + param_1);
      do {
        pbVar1 = pbVar5 + ((ulonglong)uVar11 - 1);
        pbVar5 = pbVar5 + -1;
        uVar6 = (int)uVar7 - 1;
        uVar7 = (ulonglong)uVar6;
        bVar3 = (&DAT_140240b50)[*pbVar1 ^ bVar3];
        *pbVar5 = bVar3;
      } while (uVar6 != 0);
    }
    pbVar5 = (byte *)(param_1 + 0x86);
    uVar7 = 0x3f;
    do {
      uVar10 = uVar7;
      iVar9 = (int)uVar10;
      *(ushort *)pbVar5 = (ushort)pbVar5[1] * 0x100 + (ushort)*pbVar5;
      pbVar5 = pbVar5 + -2;
      uVar7 = (ulonglong)(iVar9 - 1);
    } while (iVar9 != 0);
    uVar7 = CONCAT71((int7)(uVar10 >> 8),1);
  }
  else {
    uVar7 = in_RAX & 0xffffffffffffff00;
  }
  return uVar7;
}



void FUN_1400d7130(longlong param_1,longlong param_2,longlong param_3,int param_4)

{
  uint uVar1;
  undefined1 *puVar2;
  byte *pbVar3;
  ushort *puVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  uint uVar8;
  
  if (param_4 != 0) {
    puVar2 = (undefined1 *)(param_3 + 2);
    pbVar3 = (byte *)(param_2 + 6);
    do {
      uVar1 = (uint)pbVar3[1] * 0x100 + (uint)*pbVar3;
      uVar5 = (uint)pbVar3[-1] * 0x100 + (uint)pbVar3[-2];
      uVar6 = (uint)pbVar3[-3] * 0x100 + (uint)pbVar3[-4];
      uVar7 = (uint)pbVar3[-5] * 0x100 + (uint)pbVar3[-6];
      uVar8 = 0;
      puVar4 = (ushort *)(param_1 + 0xc);
      do {
        uVar7 = (~uVar1 & uVar6) + (uint)puVar4[-2] + (uVar5 & uVar1) + uVar7;
        uVar7 = (uVar7 >> 0xf & 1) + uVar7 * 2;
        uVar6 = (~uVar7 & uVar5) + (uint)puVar4[-1] + (uVar7 & uVar1) + uVar6;
        uVar6 = (uVar6 >> 0xe & 3) + uVar6 * 4;
        uVar5 = (~uVar6 & uVar1) + (uVar7 & uVar6) + *puVar4 + uVar5;
        uVar5 = (uVar5 >> 0xd & 7) + uVar5 * 8;
        uVar1 = (~uVar5 & uVar7) + (uint)puVar4[1] + (uVar6 & uVar5) + uVar1;
        uVar1 = (uVar1 >> 0xb & 0x1f) + uVar1 * 0x20;
        if ((uVar8 == 4) || (uVar8 == 10)) {
          uVar7 = uVar7 + *(ushort *)(param_1 + 8 + (ulonglong)(uVar1 & 0x3f) * 2);
          uVar6 = uVar6 + *(ushort *)(param_1 + 8 + (ulonglong)(uVar7 & 0x3f) * 2);
          uVar5 = uVar5 + *(ushort *)(param_1 + 8 + (ulonglong)(uVar6 & 0x3f) * 2);
          uVar1 = uVar1 + *(ushort *)(param_1 + 8 + (ulonglong)(uVar5 & 0x3f) * 2);
        }
        uVar8 = uVar8 + 1;
        puVar4 = puVar4 + 4;
      } while (uVar8 < 0x10);
      pbVar3[(param_3 - param_2) + -6] = (byte)uVar7;
      *puVar2 = (char)uVar6;
      puVar2[2] = (char)uVar5;
      puVar2[4] = (char)uVar1;
      puVar2[-1] = (char)(uVar7 >> 8);
      puVar2[1] = (char)(uVar6 >> 8);
      puVar2[3] = (char)(uVar5 >> 8);
      puVar2[5] = (char)(uVar1 >> 8);
      puVar2 = puVar2 + 8;
      pbVar3 = pbVar3 + 8;
      param_4 = param_4 + -8;
    } while (param_4 != 0);
  }
  return;
}



void FUN_1400d72f0(longlong param_1,byte *param_2,longlong param_3,longlong param_4,int param_5)

{
  byte bVar1;
  byte bVar2;
  byte bVar3;
  byte bVar4;
  byte bVar5;
  byte bVar6;
  byte bVar7;
  byte bVar8;
  byte bVar9;
  byte bVar10;
  byte bVar11;
  byte bVar12;
  byte bVar13;
  byte bVar14;
  byte bVar15;
  byte bVar16;
  uint uVar17;
  uint uVar18;
  uint uVar19;
  uint uVar20;
  uint uVar21;
  ushort *puVar22;
  byte *pbVar23;
  byte *pbVar24;
  longlong lVar25;
  ulonglong local_38;
  
  if (param_5 != 0) {
    lVar25 = param_4 - param_3;
    local_38 = (ulonglong)((param_5 - 1U >> 3) + 1);
    pbVar23 = (byte *)(param_4 + 2);
    pbVar24 = (byte *)(param_3 + 2);
    do {
      bVar1 = pbVar24[-2];
      bVar2 = *param_2;
      pbVar24[lVar25 + -2] = bVar1 ^ bVar2;
      bVar3 = pbVar24[-1];
      bVar4 = param_2[1];
      pbVar23[-1] = bVar3 ^ bVar4;
      bVar5 = *pbVar24;
      bVar6 = param_2[2];
      *pbVar23 = bVar5 ^ bVar6;
      bVar7 = pbVar24[1];
      bVar8 = param_2[3];
      pbVar23[1] = bVar7 ^ bVar8;
      bVar9 = pbVar24[2];
      bVar10 = param_2[4];
      pbVar23[2] = bVar9 ^ bVar10;
      bVar11 = pbVar24[3];
      bVar12 = param_2[5];
      pbVar23[3] = bVar11 ^ bVar12;
      bVar13 = pbVar24[4];
      bVar14 = param_2[6];
      pbVar23[4] = bVar13 ^ bVar14;
      bVar15 = pbVar24[5];
      bVar16 = param_2[7];
      pbVar23[5] = bVar15 ^ bVar16;
      uVar19 = (uint)(bVar15 ^ bVar16) * 0x100 + (uint)(bVar13 ^ bVar14);
      uVar18 = (uint)(bVar11 ^ bVar12) * 0x100 + (uint)(bVar9 ^ bVar10);
      uVar20 = (uint)(bVar7 ^ bVar8) * 0x100 + (uint)(bVar5 ^ bVar6);
      puVar22 = (ushort *)(param_1 + 10);
      uVar21 = (uint)(bVar3 ^ bVar4) * 0x100 + (uint)(bVar1 ^ bVar2);
      uVar17 = 0;
      do {
        uVar21 = (~uVar19 & uVar20) + (uint)puVar22[-1] + (uVar18 & uVar19) + uVar21;
        uVar21 = (uVar21 >> 0xf & 1) + uVar21 * 2;
        uVar20 = (~uVar21 & uVar18) + (uVar21 & uVar19) + *puVar22 + uVar20;
        uVar20 = (uVar20 >> 0xe & 3) + uVar20 * 4;
        uVar18 = (~uVar20 & uVar19) + (uint)puVar22[1] + (uVar21 & uVar20) + uVar18;
        uVar18 = (uVar18 >> 0xd & 7) + uVar18 * 8;
        uVar19 = (~uVar18 & uVar21) + (uint)puVar22[2] + (uVar20 & uVar18) + uVar19;
        uVar19 = (uVar19 >> 0xb & 0x1f) + uVar19 * 0x20;
        if ((uVar17 == 4) || (uVar17 == 10)) {
          uVar21 = uVar21 + *(ushort *)(param_1 + 8 + (ulonglong)(uVar19 & 0x3f) * 2);
          uVar20 = uVar20 + *(ushort *)(param_1 + 8 + (ulonglong)(uVar21 & 0x3f) * 2);
          uVar18 = uVar18 + *(ushort *)(param_1 + 8 + (ulonglong)(uVar20 & 0x3f) * 2);
          uVar19 = uVar19 + *(ushort *)(param_1 + 8 + (ulonglong)(uVar18 & 0x3f) * 2);
        }
        uVar17 = uVar17 + 1;
        puVar22 = puVar22 + 4;
      } while (uVar17 < 0x10);
      pbVar24[lVar25 + -2] = (byte)uVar21;
      *pbVar23 = (byte)uVar20;
      pbVar23[2] = (byte)uVar18;
      pbVar23[4] = (byte)uVar19;
      pbVar23[-1] = (byte)(uVar21 >> 8);
      pbVar23[1] = (byte)(uVar20 >> 8);
      pbVar23[3] = (byte)(uVar18 >> 8);
      pbVar24 = pbVar24 + 8;
      pbVar23[5] = (byte)(uVar19 >> 8);
      pbVar23 = pbVar23 + 8;
      local_38 = local_38 - 1;
      *(undefined8 *)param_2 = *(undefined8 *)(pbVar24 + lVar25 + -10);
    } while (local_38 != 0);
  }
  return;
}



undefined8 FUN_1400d7540(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  void *pvVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar5 = operator_new(0x28);
    if (pvVar5 == (void *)0x0) {
      uVar6 = 0;
    }
    else {
      uVar6 = FUN_1400b8c40(pvVar5);
    }
  }
  else {
    iVar2 = FUN_1400b8b80(param_2);
    FUN_1400b9a00(param_2,*(undefined4 *)(param_1 + 0x9c),8);
    pvVar5 = operator_new(0x28);
    if (pvVar5 == (void *)0x0) {
      uVar6 = 0;
    }
    else {
      uVar6 = FUN_1400b8c40(pvVar5);
    }
    iVar3 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar6,iVar3 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,0x409,iVar2 + 0x20);
      uVar6 = 0;
    }
    else {
      uVar4 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar6,uVar4);
      if (*(int *)(param_1 + 0x98) == 1) {
        uVar4 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(uVar6);
        uVar8 = FUN_1400b8b90(param_2);
        FUN_1400d7130(param_1,uVar8,uVar7,uVar4);
      }
      else {
        uVar4 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(uVar6);
        uVar8 = FUN_1400b8b90(param_2);
        FUN_1400d72f0(param_1,param_1 + 0x88,uVar8,uVar7,uVar4);
      }
      iVar3 = FUN_1400b8b80(param_2);
      if (iVar3 - iVar2 != 0) {
        FUN_1400b8be0(param_2,iVar3 - iVar2);
      }
    }
  }
  return uVar6;
}



undefined8 FUN_1400d76d0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined8 *puVar8;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
  }
  else {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x40a,iVar2 + 0x20);
      uVar5 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar5,uVar3);
      if (*(int *)(param_1 + 0x98) == 1) {
        uVar3 = FUN_1400b8b80(param_2);
        uVar6 = FUN_1400b8b90(uVar5);
        uVar7 = FUN_1400b8b90(param_2);
        FUN_1400d7130(param_1,uVar7,uVar6,uVar3);
      }
      else {
        FUN_1400ba520(param_3,8);
        puVar8 = (undefined8 *)FUN_1400b8b90(param_3);
        *puVar8 = *(undefined8 *)(param_1 + 0x88);
        uVar3 = FUN_1400b8b80(param_2);
        uVar6 = FUN_1400b8b90(uVar5);
        uVar7 = FUN_1400b8b90(param_2);
        FUN_1400d72f0(param_1,puVar8,uVar7,uVar6,uVar3);
      }
    }
  }
  return uVar5;
}



undefined8 FUN_1400d7840(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
  }
  else {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x40b,iVar2 + 0x20);
      uVar5 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar5,uVar3);
      if (*(int *)(param_1 + 0x98) == 1) {
        uVar3 = FUN_1400b8b80(param_2);
        uVar6 = FUN_1400b8b90(uVar5);
        uVar7 = FUN_1400b8b90(param_2);
        FUN_1400d7130(param_1,uVar7,uVar6,uVar3);
      }
      else {
        FUN_1400ba520(param_3,8);
        uVar6 = FUN_1400b8b90(param_3);
        uVar3 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(uVar5);
        uVar8 = FUN_1400b8b90(param_2);
        FUN_1400d72f0(param_1,uVar6,uVar8,uVar7,uVar3);
      }
    }
  }
  return uVar5;
}



undefined8 FUN_1400d79b0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  void *pvVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  undefined8 uVar9;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar5 = operator_new(0x28);
    if (pvVar5 == (void *)0x0) {
      uVar6 = 0;
    }
    else {
      uVar6 = FUN_1400b8c40(pvVar5);
    }
  }
  else {
    iVar2 = FUN_1400b8b80(param_2);
    FUN_1400b9a00(param_2,*(undefined4 *)(param_1 + 0x9c),8);
    pvVar5 = operator_new(0x28);
    if (pvVar5 == (void *)0x0) {
      uVar6 = 0;
    }
    else {
      uVar6 = FUN_1400b8c40(pvVar5);
    }
    iVar3 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar6,iVar3 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x40c,iVar2 + 0x20);
      uVar6 = 0;
    }
    else {
      uVar4 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar6,uVar4);
      if (*(int *)(param_1 + 0x98) == 1) {
        uVar4 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(uVar6);
        uVar8 = FUN_1400b8b90(param_2);
        FUN_1400d7130(param_1,uVar8,uVar7,uVar4);
      }
      else {
        FUN_1400ba520(param_3,8);
        uVar7 = FUN_1400b8b90(param_3);
        uVar4 = FUN_1400b8b80(param_2);
        uVar8 = FUN_1400b8b90(uVar6);
        uVar9 = FUN_1400b8b90(param_2);
        FUN_1400d72f0(param_1,uVar7,uVar9,uVar8,uVar4);
      }
      iVar3 = FUN_1400b8b80(param_2);
      if (iVar3 - iVar2 != 0) {
        FUN_1400b8be0(param_2,iVar3 - iVar2);
      }
    }
  }
  return uVar6;
}



undefined8 * FUN_1400d7b60(undefined8 *param_1,byte param_2)

{
  *param_1 = ChilkatRc2::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1400d7b90(longlong param_1,undefined8 param_2,uint param_3,uint param_4)

{
  undefined8 uVar1;
  uint uVar2;
  uint uVar3;
  
  uVar3 = 0x80;
  if ((param_3 < 0x81) && (uVar3 = param_3, param_3 == 0)) {
    uVar3 = 1;
  }
  uVar2 = 0x400;
  if ((param_4 != 0) && (uVar2 = param_4, 0x400 < param_4)) {
    uVar2 = 0x400;
  }
  *(uint *)(param_1 + 0x90) = uVar3;
  *(uint *)(param_1 + 0x94) = uVar2;
  FUN_1400ba520(param_2,uVar3);
  uVar1 = FUN_1400b8b90(param_2);
  FUN_1400d6ff0(param_1,uVar1,uVar3,uVar2);
  return;
}



void FUN_1400d7c20(longlong param_1,longlong param_2,longlong param_3,int param_4)

{
  uint uVar1;
  undefined1 *puVar2;
  byte *pbVar3;
  ushort *puVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  int iVar8;
  bool bVar9;
  
  if (param_4 != 0) {
    puVar2 = (undefined1 *)(param_3 + 2);
    pbVar3 = (byte *)(param_2 + 6);
    do {
      uVar1 = (uint)pbVar3[1] * 0x100 + (uint)*pbVar3;
      uVar5 = (uint)pbVar3[-1] * 0x100 + (uint)pbVar3[-2];
      uVar6 = (uint)pbVar3[-3] * 0x100 + (uint)pbVar3[-4];
      puVar4 = (ushort *)(param_1 + 0x84);
      uVar7 = (uint)pbVar3[-5] * 0x100 + (uint)pbVar3[-6];
      iVar8 = 0xf;
      do {
        uVar1 = ((((uVar1 & 0xffff) * 0x800 - (~uVar5 & uVar7)) - (uint)puVar4[1]) - (uVar6 & uVar5)
                ) + ((uVar1 & 0xffff) >> 5);
        uVar5 = ((((uVar5 & 0xffff) * 0x2000 - (~uVar6 & uVar1)) - (uVar7 & uVar6)) +
                ((uVar5 & 0xffff) >> 3)) - (uint)*puVar4;
        uVar6 = ((((uVar6 & 0xffff) * 0x4000 - (~uVar7 & uVar5)) - (uint)puVar4[-1]) -
                (uVar7 & uVar1)) + ((uVar6 & 0xffff) >> 2);
        uVar7 = (((((uVar7 & 0xffff) >> 1) - (~uVar1 & uVar6)) - (uint)puVar4[-2]) - (uVar5 & uVar1)
                ) + (uVar7 & 0xffff) * 0x8000;
        if ((iVar8 == 5) || (iVar8 == 0xb)) {
          uVar1 = uVar1 - *(ushort *)(param_1 + 8 + (ulonglong)(uVar5 & 0x3f) * 2);
          uVar5 = uVar5 - *(ushort *)(param_1 + 8 + (ulonglong)(uVar6 & 0x3f) * 2);
          uVar6 = uVar6 - *(ushort *)(param_1 + 8 + (ulonglong)(uVar7 & 0x3f) * 2);
          uVar7 = uVar7 - *(ushort *)(param_1 + 8 + (ulonglong)(uVar1 & 0x3f) * 2);
        }
        puVar4 = puVar4 + -4;
        bVar9 = iVar8 != 0;
        iVar8 = iVar8 + -1;
      } while (bVar9);
      pbVar3[(param_3 - param_2) + -6] = (byte)uVar7;
      *puVar2 = (char)uVar6;
      puVar2[2] = (char)uVar5;
      puVar2[4] = (char)uVar1;
      puVar2[-1] = (char)(uVar7 >> 8);
      puVar2[1] = (char)(uVar6 >> 8);
      puVar2[3] = (char)(uVar5 >> 8);
      puVar2[5] = (char)(uVar1 >> 8);
      puVar2 = puVar2 + 8;
      pbVar3 = pbVar3 + 8;
      param_4 = param_4 + -8;
    } while (param_4 != 0);
  }
  return;
}



void FUN_1400d7e10(longlong param_1,byte *param_2,longlong param_3,longlong param_4,int param_5)

{
  undefined8 uVar1;
  ushort *puVar2;
  int iVar3;
  byte *pbVar4;
  byte *pbVar5;
  uint uVar6;
  uint uVar7;
  uint uVar8;
  uint uVar9;
  ulonglong uVar10;
  bool bVar11;
  
  if (param_5 != 0) {
    pbVar4 = (byte *)(param_3 + 6);
    uVar10 = (ulonglong)((param_5 - 1U >> 3) + 1);
    pbVar5 = (byte *)(param_4 + 2);
    do {
      puVar2 = (ushort *)(param_1 + 0x84);
      uVar1 = *(undefined8 *)(pbVar4 + -6);
      uVar6 = (uint)pbVar4[1] * 0x100 + (uint)*pbVar4;
      uVar7 = (uint)pbVar4[-1] * 0x100 + (uint)pbVar4[-2];
      uVar8 = (uint)pbVar4[-3] * 0x100 + (uint)pbVar4[-4];
      uVar9 = (uint)pbVar4[-5] * 0x100 + ((uint)uVar1 & 0xff);
      iVar3 = 0xf;
      do {
        uVar6 = ((((uVar6 & 0xffff) * 0x800 - (~uVar7 & uVar9)) - (uint)puVar2[1]) - (uVar8 & uVar7)
                ) + ((uVar6 & 0xffff) >> 5);
        uVar7 = ((((uVar7 & 0xffff) * 0x2000 - (~uVar8 & uVar6)) - (uVar9 & uVar8)) +
                ((uVar7 & 0xffff) >> 3)) - (uint)*puVar2;
        uVar8 = ((((uVar8 & 0xffff) * 0x4000 - (~uVar9 & uVar7)) - (uint)puVar2[-1]) -
                (uVar9 & uVar6)) + ((uVar8 & 0xffff) >> 2);
        uVar9 = (((((uVar9 & 0xffff) >> 1) - (~uVar6 & uVar8)) - (uint)puVar2[-2]) - (uVar7 & uVar6)
                ) + (uVar9 & 0xffff) * 0x8000;
        if ((iVar3 == 5) || (iVar3 == 0xb)) {
          uVar6 = uVar6 - *(ushort *)(param_1 + 8 + (ulonglong)(uVar7 & 0x3f) * 2);
          uVar7 = uVar7 - *(ushort *)(param_1 + 8 + (ulonglong)(uVar8 & 0x3f) * 2);
          uVar8 = uVar8 - *(ushort *)(param_1 + 8 + (ulonglong)(uVar9 & 0x3f) * 2);
          uVar9 = uVar9 - *(ushort *)(param_1 + 8 + (ulonglong)(uVar6 & 0x3f) * 2);
        }
        puVar2 = puVar2 + -4;
        bVar11 = iVar3 != 0;
        iVar3 = iVar3 + -1;
      } while (bVar11);
      pbVar4[(param_4 - param_3) + -6] = (byte)uVar9;
      *pbVar5 = (byte)uVar8;
      pbVar5[2] = (byte)uVar7;
      pbVar5[4] = (byte)uVar6;
      pbVar5[-1] = (byte)(uVar9 >> 8);
      pbVar5[1] = (byte)(uVar8 >> 8);
      pbVar5[3] = (byte)(uVar7 >> 8);
      pbVar5[5] = (byte)(uVar6 >> 8);
      pbVar4 = pbVar4 + 8;
      pbVar4[(param_4 - param_3) + -0xe] = pbVar4[(param_4 - param_3) + -0xe] ^ *param_2;
      pbVar5[-1] = pbVar5[-1] ^ param_2[1];
      *pbVar5 = *pbVar5 ^ param_2[2];
      pbVar5[1] = pbVar5[1] ^ param_2[3];
      pbVar5[2] = pbVar5[2] ^ param_2[4];
      pbVar5[3] = pbVar5[3] ^ param_2[5];
      pbVar5[4] = pbVar5[4] ^ param_2[6];
      pbVar5[5] = pbVar5[5] ^ param_2[7];
      uVar10 = uVar10 - 1;
      *(undefined8 *)param_2 = uVar1;
      pbVar5 = pbVar5 + 8;
    } while (uVar10 != 0);
  }
  return;
}



undefined8 FUN_1400d8080(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  uint uVar2;
  void *pvVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  
  uVar2 = FUN_1400b8b80(param_2);
  if ((uVar2 & 7) != 0) {
    uVar2 = uVar2 - (uVar2 & 7);
  }
  pvVar3 = operator_new(0x28);
  if (uVar2 == 0) {
    if (pvVar3 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(pvVar3);
    }
  }
  else {
    if (pvVar3 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(pvVar3);
    }
    cVar1 = FUN_1400ba520(uVar4,uVar2 + 0x20);
    if (cVar1 == '\0') {
      FUN_1400cf7b0(param_3,0x410,uVar2 + 0x20);
      uVar4 = 0;
    }
    else {
      FUN_1400b8c10(uVar4,uVar2);
      if (*(int *)(param_1 + 0x98) == 1) {
        uVar5 = FUN_1400b8b90(uVar4);
        uVar6 = FUN_1400b8b90(param_2);
        FUN_1400d7c20(param_1,uVar6,uVar5,uVar2);
      }
      else {
        uVar5 = FUN_1400b8b90(uVar4);
        uVar6 = FUN_1400b8b90(param_2);
        FUN_1400d7e10(param_1,param_1 + 0x88,uVar6,uVar5,uVar2);
      }
      FUN_1400b9c60(uVar4,*(undefined4 *)(param_1 + 0x9c),8,param_3);
    }
  }
  return uVar4;
}



undefined8 FUN_1400d81c0(longlong param_1,undefined8 param_2,undefined8 *param_3,undefined8 param_4)

{
  char cVar1;
  uint uVar2;
  void *pvVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  
  uVar2 = FUN_1400b8b80(param_2);
  if ((uVar2 & 7) != 0) {
    uVar2 = uVar2 - (uVar2 & 7);
  }
  pvVar3 = operator_new(0x28);
  if (uVar2 == 0) {
    if (pvVar3 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(pvVar3);
    }
  }
  else {
    if (pvVar3 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(pvVar3);
    }
    cVar1 = FUN_1400ba520(uVar4,uVar2 + 0x20);
    if (cVar1 == '\0') {
      FUN_1400cf7b0(param_4,0x411,uVar2 + 0x20);
      uVar4 = 0;
    }
    else {
      FUN_1400b8c10(uVar4,uVar2);
      if (*(int *)(param_1 + 0x98) == 1) {
        uVar5 = FUN_1400b8b90();
        uVar6 = FUN_1400b8b90(param_2);
        FUN_1400d7c20(param_1,uVar6,uVar5,uVar2);
      }
      else if (param_3 == (undefined8 *)0x0) {
        FUN_1400b8b30(uVar4);
      }
      else {
        *param_3 = *(undefined8 *)(param_1 + 0x88);
        uVar5 = FUN_1400b8b90();
        uVar6 = FUN_1400b8b90(param_2);
        FUN_1400d7e10(param_1,param_3,uVar6,uVar5,uVar2);
      }
    }
  }
  return uVar4;
}



undefined8 FUN_1400d8300(longlong param_1,undefined8 param_2,longlong param_3,undefined8 param_4)

{
  char cVar1;
  uint uVar2;
  void *pvVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  
  uVar2 = FUN_1400b8b80(param_2);
  if ((uVar2 & 7) != 0) {
    uVar2 = uVar2 - (uVar2 & 7);
  }
  pvVar3 = operator_new(0x28);
  if (uVar2 == 0) {
    if (pvVar3 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(pvVar3);
    }
  }
  else {
    if (pvVar3 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(pvVar3);
    }
    cVar1 = FUN_1400ba520(uVar4,uVar2 + 0x20);
    if (cVar1 == '\0') {
      FUN_1400cf7b0(param_4,0x412,uVar2 + 0x20);
      uVar4 = 0;
    }
    else {
      FUN_1400b8c10(uVar4,uVar2);
      if (*(int *)(param_1 + 0x98) == 1) {
        uVar5 = FUN_1400b8b90();
        uVar6 = FUN_1400b8b90(param_2);
        FUN_1400d7c20(param_1,uVar6,uVar5,uVar2);
      }
      else if (param_3 == 0) {
        FUN_1400b8b30(uVar4);
      }
      else {
        uVar5 = FUN_1400b8b90();
        uVar6 = FUN_1400b8b90(param_2);
        FUN_1400d7e10(param_1,param_3,uVar6,uVar5,uVar2);
      }
    }
  }
  return uVar4;
}



undefined8 FUN_1400d8440(longlong param_1,undefined8 param_2,longlong param_3,undefined8 param_4)

{
  char cVar1;
  uint uVar2;
  void *pvVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  
  uVar2 = FUN_1400b8b80(param_2);
  if ((uVar2 & 7) != 0) {
    uVar2 = uVar2 - (uVar2 & 7);
  }
  pvVar3 = operator_new(0x28);
  if (uVar2 == 0) {
    if (pvVar3 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(pvVar3);
    }
  }
  else {
    if (pvVar3 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(pvVar3);
    }
    cVar1 = FUN_1400ba520(uVar4,uVar2 + 0x20);
    if (cVar1 == '\0') {
      FUN_1400cf7b0(param_4,0x413,uVar2 + 0x20);
      uVar4 = 0;
    }
    else {
      FUN_1400b8c10(uVar4,uVar2);
      if (*(int *)(param_1 + 0x98) == 1) {
        uVar5 = FUN_1400b8b90();
        uVar6 = FUN_1400b8b90(param_2);
        FUN_1400d7c20(param_1,uVar6,uVar5,uVar2);
      }
      else if (param_3 == 0) {
        FUN_1400b8b30(uVar4);
      }
      else {
        uVar5 = FUN_1400b8b90();
        uVar6 = FUN_1400b8b90(param_2);
        FUN_1400d7e10(param_1,param_3,uVar6,uVar5,uVar2);
      }
      FUN_1400b9c60(uVar4,*(undefined4 *)(param_1 + 0x9c),8,param_4);
    }
  }
  return uVar4;
}



undefined8 * FUN_1400d8590(undefined8 *param_1)

{
  *(undefined4 *)(param_1 + 0x62) = 0xa8;
  *(undefined8 *)((longlong)param_1 + 0x314) = 1;
  *param_1 = ChilkatDes::vftable;
  memset(param_1 + 1,0,0x180);
  memset(param_1 + 0x31,0,0x180);
  param_1[0x61] = 0;
  return param_1;
}



void FUN_1400d85f0(undefined8 *param_1)

{
  *param_1 = ChilkatDes::vftable;
  return;
}



void FUN_1400d8600(undefined8 param_1,uint *param_2,byte *param_3)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  int iVar6;
  uint uVar7;
  
  uVar3 = CONCAT31(CONCAT21(CONCAT11(*param_3,param_3[1]),param_3[2]),param_3[3]);
  uVar5 = CONCAT31(CONCAT21(CONCAT11(param_3[4],param_3[5]),param_3[6]),param_3[7]);
  uVar2 = (uVar5 >> 4 ^ uVar3) & 0xf0f0f0f;
  uVar3 = uVar3 ^ uVar2;
  uVar5 = uVar5 ^ uVar2 << 4;
  uVar5 = uVar5 ^ (uVar5 ^ uVar3) & 0x10101010;
  uVar3 = (((((*(uint *)(&DAT_140241590 + (ulonglong)(uVar3 >> 5 & 0xf) * 4) & 0x1fffff) << 3 |
             *(uint *)(&DAT_140241590 + (ulonglong)(*param_3 >> 5) * 4) & 0xffffff) * 2 |
            *(uint *)(&DAT_140241590 + (ulonglong)(uVar3 & 0xf) * 4) & 0x1ffffff) * 2 |
           *(uint *)(&DAT_140241590 + (ulonglong)(uVar3 >> 8 & 0xf) * 4) & 0x3ffffff) * 2 |
          *(uint *)(&DAT_140241590 + (ulonglong)(uVar3 >> 0x10 & 0xf) * 4) & 0x7ffffff) * 2 |
          ((*(int *)(&DAT_140241590 + (ulonglong)(uVar3 >> 0xd & 0xf) * 4) * 2 |
           *(uint *)(&DAT_140241590 + (ulonglong)(uVar3 >> 0x15 & 0xf) * 4)) << 5 |
          *(uint *)(&DAT_140241590 + (ulonglong)(uVar3 >> 0x18 & 0xf) * 4)) & 0xfffffff;
  uVar2 = (((((*(uint *)(&DAT_1402415d0 + (ulonglong)(uVar5 >> 4 & 0xf) * 4) & 0x1fffff) * 2 |
             *(uint *)(&DAT_1402415d0 + (ulonglong)(uVar5 >> 0xc & 0xf) * 4) & 0x3fffff) << 2 |
            *(uint *)(&DAT_1402415d0 + (ulonglong)(uVar5 >> 0x1c) * 4) & 0xffffff) * 2 |
           *(uint *)(&DAT_1402415d0 + (ulonglong)(uVar5 >> 1 & 0xf) * 4) & 0x1ffffff) * 2 |
          *(uint *)(&DAT_1402415d0 + (ulonglong)(uVar5 >> 9 & 0xf) * 4) & 0x3ffffff) << 2 |
          ((*(int *)(&DAT_1402415d0 + (ulonglong)(uVar5 >> 0x14 & 0xf) * 4) << 4 |
           *(uint *)(&DAT_1402415d0 + (ulonglong)(uVar5 >> 0x11 & 0xf) * 4)) * 2 |
          *(uint *)(&DAT_1402415d0 + (ulonglong)(uVar5 >> 0x19 & 0xf) * 4)) & 0xfffffff;
  iVar6 = 0;
  do {
    if (((iVar6 < 2) || (iVar6 == 8)) || (iVar6 == 0xf)) {
      uVar7 = uVar3 >> 0x1b | uVar3 * 2;
      uVar4 = uVar2 >> 0x1b;
      uVar5 = uVar2 * 2;
    }
    else {
      uVar7 = uVar3 >> 0x1a | uVar3 * 4;
      uVar4 = uVar2 >> 0x1a;
      uVar5 = uVar2 * 4;
    }
    uVar3 = uVar7 & 0xfffffff;
    uVar1 = uVar5 & 0xfffffff;
    uVar2 = uVar4 | uVar1;
    *param_2 = (((((((((uVar1 >> 2 & 0x2000000 | uVar5 & 0x1000000) >> 6 | uVar5 & 0x100000) >> 4 |
                     uVar5 & 0x800000) >> 1 | uVar5 & 0x4000000) >> 3 | uVar5 & 0x4000 |
                   uVar7 & 0x4000000) >> 5 | uVar5 & 0x400) >> 1 | uVar5 & 0x10000) >> 1 |
                uVar5 & 0x40) >> 2 | uVar5 & 0x800 | uVar7 & 0x200000) >> 1 |
               ((((((((uVar7 & 1) << 10 | uVar7 & 0x82) << 4 | uVar7 & 0x2000) << 4 | uVar7 & 0x100)
                   * 2 | uVar7 & 0x1000) << 3 | uVar5 & 0x20 | uVar7 & 0x40000) << 2 |
                uVar7 & 0x2400000) << 2 | uVar7 & 0x8000) << 2 | uVar5 & 0x100;
    iVar6 = iVar6 + 1;
    param_2[1] = (((((((((((uVar7 & 0x10) << 5 | uVar7 & 0x800) * 2 | uVar7 & 0x20) * 2 |
                        uVar7 & 0x4004) << 4 | uVar7 & 0x200) * 2 | uVar7 & 0x20000) << 2 |
                     uVar5 & 0x10) * 2 | (uVar4 | uVar5) & 2) << 4 | uVar7 & 0x10000) * 2 |
                  uVar4 & 1) * 2 | uVar7 & 0x800000) * 2 |
                 (((((((uVar1 >> 7 & 0x8000 | uVar5 & 0x2020000) >> 5 | uVar5 & 0x80000) >> 2 |
                     uVar5 & 0x1000) >> 1 | uVar7 & 0x1000000) >> 2 | uVar7 & 0x100000) >> 1 |
                  uVar5 & 0x88) >> 1 | uVar7 & 0x8000000 | uVar5 & 0x8000) >> 2 | uVar5 & 0x200;
    param_2 = param_2 + 2;
  } while (iVar6 < 0x10);
  return;
}



void FUN_1400d8a90(undefined8 param_1,uint *param_2,undefined1 *param_3,undefined1 *param_4)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  
  uVar4 = CONCAT31(CONCAT21(CONCAT11(*param_3,param_3[1]),param_3[2]),param_3[3]);
  uVar2 = CONCAT31(CONCAT21(CONCAT11(param_3[4],param_3[5]),param_3[6]),param_3[7]);
  uVar1 = (uVar4 >> 4 ^ uVar2) & 0xf0f0f0f;
  uVar2 = uVar2 ^ uVar1;
  uVar4 = uVar4 ^ uVar1 << 4;
  uVar1 = (uVar4 >> 0x10 ^ uVar2) & 0xffff;
  uVar2 = uVar2 ^ uVar1;
  uVar4 = uVar4 ^ uVar1 << 0x10;
  uVar1 = (uVar2 >> 2 ^ uVar4) & 0x33333333;
  uVar4 = uVar4 ^ uVar1;
  uVar2 = uVar2 ^ uVar1 << 2;
  uVar1 = (uVar2 >> 8 ^ uVar4) & 0xff00ff;
  uVar4 = uVar4 ^ uVar1;
  uVar2 = uVar1 << 8 ^ uVar2;
  uVar5 = uVar2 << 1 | (uint)((int)uVar2 < 0);
  uVar3 = (uVar5 ^ uVar4) & 0xaaaaaaaa;
  uVar5 = uVar5 ^ uVar3;
  uVar3 = uVar3 ^ uVar4;
  uVar1 = *param_2 ^ uVar5;
  uVar2 = (uVar5 >> 4 | uVar5 << 0x1c) ^ param_2[1];
  uVar3 = (uVar3 << 1 | (uint)((int)uVar3 < 0)) ^
          *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[2] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[3];
  uVar4 = uVar5 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[4] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[5];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[6] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[7];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[8] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[9];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[10] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0xb];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0xc] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0xd];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0xe] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0xf];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x10] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x11];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x12] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x13];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x14] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x15];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x16] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x17];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x18] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x19];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x1a] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x1b];
  uVar5 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x1c] ^ uVar5;
  uVar2 = (uVar5 >> 4 | uVar5 << 0x1c) ^ param_2[0x1d];
  uVar4 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x1e] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x1f];
  uVar1 = *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4) ^
          uVar5 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4);
  uVar3 = uVar1 >> 1 | (uint)((uVar1 & 1) != 0) << 0x1f;
  uVar1 = (uVar3 ^ uVar4) & 0xaaaaaaaa;
  uVar3 = uVar3 ^ uVar1;
  uVar1 = uVar1 ^ uVar4;
  uVar2 = uVar1 >> 1 | (uint)((uVar1 & 1) != 0) << 0x1f;
  uVar1 = (uVar2 >> 8 ^ uVar3) & 0xff00ff;
  uVar3 = uVar3 ^ uVar1;
  uVar2 = uVar2 ^ uVar1 << 8;
  uVar1 = (uVar2 >> 2 ^ uVar3) & 0x33333333;
  uVar3 = uVar3 ^ uVar1;
  uVar2 = uVar2 ^ uVar1 << 2;
  uVar1 = (uVar3 >> 0x10 ^ uVar2) & 0xffff;
  uVar2 = uVar2 ^ uVar1;
  uVar3 = uVar3 ^ uVar1 << 0x10;
  uVar1 = (uVar3 >> 4 ^ uVar2) & 0xf0f0f0f;
  uVar2 = uVar2 ^ uVar1;
  uVar3 = uVar3 ^ uVar1 << 4;
  param_4[7] = (char)uVar2;
  param_4[3] = (char)uVar3;
  *param_4 = (char)(uVar3 >> 0x18);
  param_4[1] = (char)(uVar3 >> 0x10);
  param_4[2] = (char)(uVar3 >> 8);
  param_4[4] = (char)(uVar2 >> 0x18);
  param_4[5] = (char)(uVar2 >> 0x10);
  param_4[6] = (char)(uVar2 >> 8);
  return;
}



void FUN_1400d9580(longlong param_1,longlong param_2,longlong param_3,int param_4)

{
  if (param_4 != 0) {
    param_2 = param_2 - param_3;
    do {
      FUN_1400d8a90(param_1,param_1 + 8,param_2 + param_3,param_3);
      param_3 = param_3 + 8;
      param_4 = param_4 + -8;
    } while (param_4 != 0);
  }
  return;
}



void FUN_1400d95f0(longlong param_1,longlong param_2,longlong param_3,int param_4)

{
  if (param_4 != 0) {
    param_2 = param_2 - param_3;
    do {
      FUN_1400d8a90(param_1,param_1 + 0x188,param_2 + param_3,param_3);
      param_3 = param_3 + 8;
      param_4 = param_4 + -8;
    } while (param_4 != 0);
  }
  return;
}



void FUN_1400d9660(undefined8 param_1,uint *param_2,undefined1 *param_3,undefined1 *param_4)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  
  uVar4 = CONCAT31(CONCAT21(CONCAT11(*param_3,param_3[1]),param_3[2]),param_3[3]);
  uVar2 = CONCAT31(CONCAT21(CONCAT11(param_3[4],param_3[5]),param_3[6]),param_3[7]);
  uVar1 = (uVar4 >> 4 ^ uVar2) & 0xf0f0f0f;
  uVar2 = uVar2 ^ uVar1;
  uVar4 = uVar4 ^ uVar1 << 4;
  uVar1 = (uVar4 >> 0x10 ^ uVar2) & 0xffff;
  uVar2 = uVar2 ^ uVar1;
  uVar4 = uVar4 ^ uVar1 << 0x10;
  uVar1 = (uVar2 >> 2 ^ uVar4) & 0x33333333;
  uVar4 = uVar4 ^ uVar1;
  uVar2 = uVar2 ^ uVar1 << 2;
  uVar1 = (uVar2 >> 8 ^ uVar4) & 0xff00ff;
  uVar4 = uVar4 ^ uVar1;
  uVar2 = uVar1 << 8 ^ uVar2;
  uVar3 = uVar2 << 1 | (uint)((int)uVar2 < 0);
  uVar5 = (uVar3 ^ uVar4) & 0xaaaaaaaa;
  uVar3 = uVar3 ^ uVar5;
  uVar5 = uVar5 ^ uVar4;
  uVar1 = *param_2 ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[1];
  uVar4 = (uVar5 << 1 | (uint)((int)uVar5 < 0)) ^
          *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[2] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[3];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[4] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[5];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[6] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[7];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[8] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[9];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[10] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0xb];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0xc] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0xd];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0xe] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0xf];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x10] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x11];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x12] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x13];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x14] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x15];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x16] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x17];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x18] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x19];
  uVar5 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x1a] ^ uVar5;
  uVar2 = (uVar5 >> 4 | uVar5 << 0x1c) ^ param_2[0x1b];
  uVar4 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x1c] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x1d];
  uVar6 = uVar5 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x1e] ^ uVar6;
  uVar2 = uVar6 >> 4 | uVar6 << 0x1c;
  uVar5 = uVar2 ^ param_2[0x21];
  uVar2 = uVar2 ^ param_2[0x1f];
  uVar3 = param_2[0x20] ^ uVar6;
  uVar3 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240e90 + (ulonglong)(uVar3 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241090 + (ulonglong)(uVar3 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241290 + (ulonglong)(uVar3 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241490 + (ulonglong)(uVar3 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar5 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar5 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar5 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar5 & 0x3f) * 4);
  uVar1 = param_2[0x22] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x23];
  uVar4 = uVar6 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x24] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x25];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x26] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x27];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x28] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x29];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x2a] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x2b];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x2c] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x2d];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x2e] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x2f];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x30] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x31];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x32] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x33];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x34] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x35];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x36] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x37];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x38] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x39];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x3a] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x3b];
  uVar6 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x3c] ^ uVar6;
  uVar2 = (uVar6 >> 4 | uVar6 << 0x1c) ^ param_2[0x3d];
  uVar4 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x3e] ^ uVar4;
  uVar2 = uVar4 >> 4 | uVar4 << 0x1c;
  uVar5 = uVar2 ^ param_2[0x41];
  uVar2 = uVar2 ^ param_2[0x3f];
  uVar3 = param_2[0x40] ^ uVar4;
  uVar5 = uVar6 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240e90 + (ulonglong)(uVar3 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241090 + (ulonglong)(uVar3 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241290 + (ulonglong)(uVar3 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241490 + (ulonglong)(uVar3 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar5 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar5 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar5 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar5 & 0x3f) * 4);
  uVar1 = param_2[0x42] ^ uVar5;
  uVar2 = (uVar5 >> 4 | uVar5 << 0x1c) ^ param_2[0x43];
  uVar3 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x44] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x45];
  uVar4 = uVar5 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x46] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x47];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x48] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x49];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x4a] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x4b];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x4c] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x4d];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x4e] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x4f];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x50] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x51];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x52] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x53];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x54] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x55];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x56] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x57];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x58] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x59];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x5a] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x5b];
  uVar3 = uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x5c] ^ uVar3;
  uVar2 = (uVar3 >> 4 | uVar3 << 0x1c) ^ param_2[0x5d];
  uVar4 = uVar4 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4);
  uVar1 = param_2[0x5e] ^ uVar4;
  uVar2 = (uVar4 >> 4 | uVar4 << 0x1c) ^ param_2[0x5f];
  uVar1 = *(uint *)(&DAT_140240d90 + (ulonglong)(uVar2 >> 0x18 & 0x3f) * 4) ^
          *(uint *)(&DAT_140240f90 + (ulonglong)(uVar2 >> 0x10 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241190 + (ulonglong)(uVar2 >> 8 & 0x3f) * 4) ^
          *(uint *)(&DAT_140241390 + (ulonglong)(uVar2 & 0x3f) * 4) ^
          uVar3 ^ *(uint *)(&DAT_140240e90 + (ulonglong)(uVar1 >> 0x18 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241090 + (ulonglong)(uVar1 >> 0x10 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241290 + (ulonglong)(uVar1 >> 8 & 0x3f) * 4) ^
                  *(uint *)(&DAT_140241490 + (ulonglong)(uVar1 & 0x3f) * 4);
  uVar3 = uVar1 >> 1 | (uint)((uVar1 & 1) != 0) << 0x1f;
  uVar1 = (uVar3 ^ uVar4) & 0xaaaaaaaa;
  uVar3 = uVar3 ^ uVar1;
  uVar1 = uVar1 ^ uVar4;
  uVar2 = uVar1 >> 1 | (uint)((uVar1 & 1) != 0) << 0x1f;
  uVar1 = (uVar2 >> 8 ^ uVar3) & 0xff00ff;
  uVar3 = uVar3 ^ uVar1;
  uVar2 = uVar2 ^ uVar1 << 8;
  uVar1 = (uVar2 >> 2 ^ uVar3) & 0x33333333;
  uVar3 = uVar3 ^ uVar1;
  uVar2 = uVar2 ^ uVar1 << 2;
  uVar1 = (uVar3 >> 0x10 ^ uVar2) & 0xffff;
  uVar2 = uVar2 ^ uVar1;
  uVar3 = uVar3 ^ uVar1 << 0x10;
  uVar1 = (uVar3 >> 4 ^ uVar2) & 0xf0f0f0f;
  uVar2 = uVar2 ^ uVar1;
  uVar3 = uVar3 ^ uVar1 << 4;
  *param_4 = (char)(uVar3 >> 0x18);
  param_4[1] = (char)(uVar3 >> 0x10);
  param_4[2] = (char)(uVar3 >> 8);
  param_4[3] = (char)uVar3;
  param_4[7] = (char)uVar2;
  param_4[4] = (char)(uVar2 >> 0x18);
  param_4[5] = (char)(uVar2 >> 0x10);
  param_4[6] = (char)(uVar2 >> 8);
  return;
}



void FUN_1400db4a0(longlong param_1,longlong param_2,longlong param_3,int param_4)

{
  if (param_4 != 0) {
    param_2 = param_2 - param_3;
    do {
      FUN_1400d9660(param_1,param_1 + 8,param_2 + param_3,param_3);
      param_3 = param_3 + 8;
      param_4 = param_4 + -8;
    } while (param_4 != 0);
  }
  return;
}



void FUN_1400db510(longlong param_1,longlong param_2,longlong param_3,int param_4)

{
  if (param_4 != 0) {
    param_2 = param_2 - param_3;
    do {
      FUN_1400d9660(param_1,param_1 + 0x188,param_2 + param_3,param_3);
      param_3 = param_3 + 8;
      param_4 = param_4 + -8;
    } while (param_4 != 0);
  }
  return;
}



void FUN_1400db580(longlong param_1,byte *param_2,longlong param_3,longlong param_4,int param_5)

{
  byte *pbVar1;
  byte *pbVar2;
  byte *pbVar3;
  ulonglong uVar4;
  
  if (0 < param_5) {
    pbVar3 = (byte *)(param_4 + 2);
    uVar4 = (ulonglong)((param_5 - 1U >> 3) + 1);
    pbVar2 = (byte *)(param_3 + 2);
    do {
      pbVar1 = pbVar2 + (param_4 - param_3) + -2;
      *pbVar1 = pbVar2[-2] ^ *param_2;
      pbVar3[-1] = pbVar2[-1] ^ param_2[1];
      *pbVar3 = *pbVar2 ^ param_2[2];
      pbVar3[1] = pbVar2[1] ^ param_2[3];
      pbVar3[2] = pbVar2[2] ^ param_2[4];
      pbVar3[3] = pbVar2[3] ^ param_2[5];
      pbVar3[4] = pbVar2[4] ^ param_2[6];
      pbVar3[5] = pbVar2[5] ^ param_2[7];
      FUN_1400d8a90(param_1,param_1 + 8,pbVar1,pbVar1);
      pbVar3 = pbVar3 + 8;
      pbVar2 = pbVar2 + 8;
      uVar4 = uVar4 - 1;
      *(undefined8 *)param_2 = *(undefined8 *)pbVar1;
    } while (uVar4 != 0);
  }
  return;
}



void FUN_1400db680(longlong param_1,byte *param_2,undefined8 *param_3,longlong param_4,int param_5)

{
  undefined8 uVar1;
  byte *pbVar2;
  ulonglong uVar3;
  
  if (0 < param_5) {
    uVar3 = (ulonglong)((param_5 - 1U >> 3) + 1);
    pbVar2 = (byte *)(param_4 + 2);
    do {
      uVar1 = *param_3;
      FUN_1400d8a90(param_1,param_1 + 0x188,param_3,pbVar2 + -2);
      pbVar2[-2] = pbVar2[-2] ^ *param_2;
      param_3 = param_3 + 1;
      pbVar2[-1] = pbVar2[-1] ^ param_2[1];
      *pbVar2 = *pbVar2 ^ param_2[2];
      pbVar2[1] = pbVar2[1] ^ param_2[3];
      pbVar2[2] = pbVar2[2] ^ param_2[4];
      pbVar2[3] = pbVar2[3] ^ param_2[5];
      pbVar2[4] = pbVar2[4] ^ param_2[6];
      pbVar2[5] = pbVar2[5] ^ param_2[7];
      uVar3 = uVar3 - 1;
      *(undefined8 *)param_2 = uVar1;
      pbVar2 = pbVar2 + 8;
    } while (uVar3 != 0);
  }
  return;
}



void FUN_1400db760(longlong param_1,undefined8 *param_2,longlong param_3,longlong param_4,
                  int param_5)

{
  byte *pbVar1;
  byte *pbVar2;
  byte *pbVar3;
  ulonglong uVar4;
  
  if (0 < param_5) {
    uVar4 = (ulonglong)((param_5 - 1U >> 3) + 1);
    pbVar2 = (byte *)(param_3 + 2);
    pbVar3 = (byte *)(param_4 + 2);
    do {
      pbVar1 = pbVar2 + (param_4 - param_3) + -2;
      FUN_1400d8a90(param_1,param_1 + 8,param_2,pbVar1);
      *pbVar1 = *pbVar1 ^ pbVar2[-2];
      pbVar3[-1] = pbVar3[-1] ^ pbVar2[-1];
      *pbVar3 = *pbVar3 ^ *pbVar2;
      pbVar3[1] = pbVar3[1] ^ pbVar2[1];
      pbVar3[2] = pbVar3[2] ^ pbVar2[2];
      pbVar3[3] = pbVar3[3] ^ pbVar2[3];
      pbVar3[4] = pbVar3[4] ^ pbVar2[4];
      pbVar3[5] = pbVar3[5] ^ pbVar2[5];
      uVar4 = uVar4 - 1;
      *param_2 = *(undefined8 *)pbVar1;
      pbVar2 = pbVar2 + 8;
      pbVar3 = pbVar3 + 8;
    } while (uVar4 != 0);
  }
  return;
}



void FUN_1400db840(longlong param_1,undefined8 *param_2,longlong param_3,longlong param_4,
                  int param_5)

{
  byte *pbVar1;
  byte *pbVar2;
  byte *pbVar3;
  ulonglong uVar4;
  
  if (0 < param_5) {
    uVar4 = (ulonglong)((param_5 - 1U >> 3) + 1);
    pbVar2 = (byte *)(param_3 + 2);
    pbVar3 = (byte *)(param_4 + 2);
    do {
      pbVar1 = pbVar2 + (param_4 - param_3) + -2;
      FUN_1400d8a90(param_1,param_1 + 8,param_2,pbVar1);
      *pbVar1 = *pbVar1 ^ pbVar2[-2];
      pbVar3[-1] = pbVar3[-1] ^ pbVar2[-1];
      *pbVar3 = *pbVar3 ^ *pbVar2;
      pbVar3[1] = pbVar3[1] ^ pbVar2[1];
      pbVar3[2] = pbVar3[2] ^ pbVar2[2];
      pbVar3[3] = pbVar3[3] ^ pbVar2[3];
      pbVar3[4] = pbVar3[4] ^ pbVar2[4];
      pbVar3[5] = pbVar3[5] ^ pbVar2[5];
      uVar4 = uVar4 - 1;
      *param_2 = *(undefined8 *)(pbVar2 + -2);
      pbVar2 = pbVar2 + 8;
      pbVar3 = pbVar3 + 8;
    } while (uVar4 != 0);
  }
  return;
}



void FUN_1400db920(longlong param_1,longlong param_2,undefined8 param_3)

{
  undefined4 uVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 *puVar4;
  longlong lVar5;
  undefined4 *puVar6;
  
  FUN_1400d8600(param_1,param_1 + 8,param_2,param_3);
  FUN_1400d8600(param_1,param_1 + 0x208,param_2 + 8,param_3);
  lVar5 = 0x10;
  puVar4 = (undefined4 *)(param_1 + 0x84);
  puVar6 = (undefined4 *)(param_1 + 0x18c);
  do {
    uVar1 = puVar4[-1];
    lVar5 = lVar5 + -1;
    puVar6[-1] = uVar1;
    uVar2 = *puVar4;
    *puVar6 = uVar2;
    puVar6[-0x41] = puVar4[0x7f];
    uVar3 = puVar4[0x80];
    puVar6[0x3f] = uVar1;
    puVar6[-0x40] = uVar3;
    puVar6[0x40] = uVar2;
    puVar6[-0x21] = puVar6[-0x61];
    puVar6[-0x20] = puVar6[-0x60];
    puVar4 = puVar4 + -2;
    puVar6 = puVar6 + 2;
  } while (lVar5 != 0);
  return;
}



void FUN_1400db9e0(longlong param_1,longlong param_2,undefined8 param_3)

{
  longlong lVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  
  FUN_1400d8600(param_1,param_1 + 8,param_2,param_3);
  FUN_1400d8600(param_1,param_1 + 0x208,param_2 + 8,param_3);
  FUN_1400d8600(param_1,param_1 + 0x108,param_2 + 0x10,param_3);
  lVar1 = 0x10;
  puVar2 = (undefined4 *)(param_1 + 0x184);
  puVar3 = (undefined4 *)(param_1 + 0x18c);
  do {
    lVar1 = lVar1 + -1;
    puVar3[-1] = puVar2[-1];
    *puVar3 = *puVar2;
    puVar3[-0x41] = puVar2[0x3f];
    puVar3[-0x40] = puVar2[0x40];
    puVar3[0x3f] = puVar2[-0x41];
    puVar3[0x40] = puVar2[-0x40];
    puVar2 = puVar2 + -2;
    puVar3 = puVar3 + 2;
  } while (lVar1 != 0);
  return;
}



void FUN_1400dbab0(longlong param_1,byte *param_2,longlong param_3,longlong param_4,int param_5)

{
  byte *pbVar1;
  byte *pbVar2;
  byte *pbVar3;
  ulonglong uVar4;
  
  if (0 < param_5) {
    pbVar3 = (byte *)(param_4 + 2);
    uVar4 = (ulonglong)((param_5 - 1U >> 3) + 1);
    pbVar2 = (byte *)(param_3 + 2);
    do {
      pbVar1 = pbVar2 + (param_4 - param_3) + -2;
      *pbVar1 = pbVar2[-2] ^ *param_2;
      pbVar3[-1] = pbVar2[-1] ^ param_2[1];
      *pbVar3 = *pbVar2 ^ param_2[2];
      pbVar3[1] = pbVar2[1] ^ param_2[3];
      pbVar3[2] = pbVar2[2] ^ param_2[4];
      pbVar3[3] = pbVar2[3] ^ param_2[5];
      pbVar3[4] = pbVar2[4] ^ param_2[6];
      pbVar3[5] = pbVar2[5] ^ param_2[7];
      FUN_1400d9660(param_1,param_1 + 8,pbVar1,pbVar1);
      pbVar3 = pbVar3 + 8;
      pbVar2 = pbVar2 + 8;
      uVar4 = uVar4 - 1;
      *(undefined8 *)param_2 = *(undefined8 *)pbVar1;
    } while (uVar4 != 0);
  }
  return;
}



void FUN_1400dbbb0(longlong param_1,undefined8 *param_2,longlong param_3,longlong param_4,
                  int param_5)

{
  byte *pbVar1;
  byte *pbVar2;
  byte *pbVar3;
  ulonglong uVar4;
  
  if (0 < param_5) {
    uVar4 = (ulonglong)((param_5 - 1U >> 3) + 1);
    pbVar2 = (byte *)(param_3 + 2);
    pbVar3 = (byte *)(param_4 + 2);
    do {
      pbVar1 = pbVar2 + (param_4 - param_3) + -2;
      FUN_1400d9660(param_1,param_1 + 8,param_2,pbVar1);
      *pbVar1 = *pbVar1 ^ pbVar2[-2];
      pbVar3[-1] = pbVar3[-1] ^ pbVar2[-1];
      *pbVar3 = *pbVar3 ^ *pbVar2;
      pbVar3[1] = pbVar3[1] ^ pbVar2[1];
      pbVar3[2] = pbVar3[2] ^ pbVar2[2];
      pbVar3[3] = pbVar3[3] ^ pbVar2[3];
      pbVar3[4] = pbVar3[4] ^ pbVar2[4];
      pbVar3[5] = pbVar3[5] ^ pbVar2[5];
      uVar4 = uVar4 - 1;
      *param_2 = *(undefined8 *)pbVar1;
      pbVar2 = pbVar2 + 8;
      pbVar3 = pbVar3 + 8;
    } while (uVar4 != 0);
  }
  return;
}



void FUN_1400dbc90(longlong param_1,byte *param_2,undefined8 *param_3,longlong param_4,int param_5)

{
  undefined8 uVar1;
  byte *pbVar2;
  ulonglong uVar3;
  
  if (0 < param_5) {
    uVar3 = (ulonglong)((param_5 - 1U >> 3) + 1);
    pbVar2 = (byte *)(param_4 + 2);
    do {
      uVar1 = *param_3;
      FUN_1400d9660(param_1,param_1 + 0x188,param_3,pbVar2 + -2);
      pbVar2[-2] = pbVar2[-2] ^ *param_2;
      param_3 = param_3 + 1;
      pbVar2[-1] = pbVar2[-1] ^ param_2[1];
      *pbVar2 = *pbVar2 ^ param_2[2];
      pbVar2[1] = pbVar2[1] ^ param_2[3];
      pbVar2[2] = pbVar2[2] ^ param_2[4];
      pbVar2[3] = pbVar2[3] ^ param_2[5];
      pbVar2[4] = pbVar2[4] ^ param_2[6];
      pbVar2[5] = pbVar2[5] ^ param_2[7];
      uVar3 = uVar3 - 1;
      *(undefined8 *)param_2 = uVar1;
      pbVar2 = pbVar2 + 8;
    } while (uVar3 != 0);
  }
  return;
}



void FUN_1400dbd70(longlong param_1,undefined8 *param_2,longlong param_3,longlong param_4,
                  int param_5)

{
  byte *pbVar1;
  byte *pbVar2;
  byte *pbVar3;
  ulonglong uVar4;
  
  if (0 < param_5) {
    uVar4 = (ulonglong)((param_5 - 1U >> 3) + 1);
    pbVar2 = (byte *)(param_3 + 2);
    pbVar3 = (byte *)(param_4 + 2);
    do {
      pbVar1 = pbVar2 + (param_4 - param_3) + -2;
      FUN_1400d9660(param_1,param_1 + 8,param_2,pbVar1);
      *pbVar1 = *pbVar1 ^ pbVar2[-2];
      pbVar3[-1] = pbVar3[-1] ^ pbVar2[-1];
      *pbVar3 = *pbVar3 ^ *pbVar2;
      pbVar3[1] = pbVar3[1] ^ pbVar2[1];
      pbVar3[2] = pbVar3[2] ^ pbVar2[2];
      pbVar3[3] = pbVar3[3] ^ pbVar2[3];
      pbVar3[4] = pbVar3[4] ^ pbVar2[4];
      pbVar3[5] = pbVar3[5] ^ pbVar2[5];
      uVar4 = uVar4 - 1;
      *param_2 = *(undefined8 *)(pbVar2 + -2);
      pbVar2 = pbVar2 + 8;
      pbVar3 = pbVar3 + 8;
    } while (uVar4 != 0);
  }
  return;
}



void FUN_1400dbe50(longlong param_1,undefined8 param_2,int param_3,undefined8 param_4)

{
  uint uVar1;
  undefined8 uVar2;
  undefined4 *puVar3;
  longlong lVar4;
  int iVar5;
  undefined4 *puVar6;
  
  iVar5 = 0;
  if (param_3 < 0x70) {
    uVar1 = FUN_1400b8b80(param_2);
    while (uVar1 < 8) {
      FUN_1400b9550(param_2,0);
      iVar5 = iVar5 + 1;
      uVar1 = FUN_1400b8b80(param_2);
    }
    *(undefined4 *)(param_1 + 0x310) = 0x38;
    uVar2 = FUN_1400b8b90(param_2);
    FUN_1400d8600(param_1,param_1 + 8,uVar2,param_4);
    lVar4 = 0x10;
    puVar3 = (undefined4 *)(param_1 + 0x84);
    puVar6 = (undefined4 *)(param_1 + 0x18c);
    do {
      lVar4 = lVar4 + -1;
      puVar6[-1] = puVar3[-1];
      *puVar6 = *puVar3;
      puVar3 = puVar3 + -2;
      puVar6 = puVar6 + 2;
    } while (lVar4 != 0);
  }
  else if (param_3 < 0xa8) {
    uVar1 = FUN_1400b8b80(param_2);
    while (uVar1 < 0x10) {
      FUN_1400b9550(param_2,0);
      iVar5 = iVar5 + 1;
      uVar1 = FUN_1400b8b80(param_2);
    }
    *(undefined4 *)(param_1 + 0x310) = 0x70;
    uVar2 = FUN_1400b8b90(param_2);
    FUN_1400db920(param_1,uVar2,param_4);
  }
  else {
    uVar1 = FUN_1400b8b80(param_2);
    while (uVar1 < 0x18) {
      FUN_1400b9550(param_2,0);
      iVar5 = iVar5 + 1;
      uVar1 = FUN_1400b8b80(param_2);
    }
    *(undefined4 *)(param_1 + 0x310) = 0xa8;
    uVar2 = FUN_1400b8b90(param_2);
    FUN_1400db9e0(param_1,uVar2,param_4);
  }
  if (iVar5 != 0) {
    FUN_1400b8be0(param_2,iVar5);
  }
  return;
}



void FUN_1400dbfb0(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x318) = param_2;
  return;
}



void FUN_1400dbfc0(longlong param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  uint uVar2;
  
  uVar2 = FUN_1400b8b80(param_2);
  if (7 < uVar2) {
    puVar1 = (undefined8 *)FUN_1400b8b90(param_2);
    *(undefined8 *)(param_1 + 0x308) = *puVar1;
  }
  return;
}



void FUN_1400dc000(longlong param_1)

{
  *(undefined8 *)(param_1 + 0x308) = 0;
  return;
}



void FUN_1400dc010(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x314) = param_2;
  return;
}



undefined8 FUN_1400dc020(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  void *pvVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar5 = operator_new(0x28);
    if (pvVar5 == (void *)0x0) {
      uVar6 = 0;
    }
    else {
      uVar6 = FUN_1400b8c40(pvVar5);
    }
  }
  else {
    iVar2 = FUN_1400b8b80(param_2);
    FUN_1400b9a00(param_2,*(undefined4 *)(param_1 + 0x318),8);
    pvVar5 = operator_new(0x28);
    if (pvVar5 == (void *)0x0) {
      uVar6 = 0;
    }
    else {
      uVar6 = FUN_1400b8c40(pvVar5);
    }
    iVar3 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar6,iVar3 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,0x400,iVar2 + 0x20);
      uVar6 = 0;
    }
    else {
      uVar4 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar6,uVar4);
      iVar3 = *(int *)(param_1 + 0x314);
      if (*(int *)(param_1 + 0x310) < 0x41) {
        if (iVar3 == 1) {
          uVar4 = FUN_1400b8b80(param_2);
          uVar7 = FUN_1400b8b90(uVar6);
          uVar8 = FUN_1400b8b90(param_2);
          FUN_1400d9580(param_1,uVar8,uVar7,uVar4);
        }
        else if (iVar3 == 2) {
          uVar4 = FUN_1400b8b80(param_2);
          uVar7 = FUN_1400b8b90(uVar6);
          uVar8 = FUN_1400b8b90(param_2);
          FUN_1400db760(param_1,param_1 + 0x308,uVar8,uVar7,uVar4);
        }
        else {
          uVar4 = FUN_1400b8b80(param_2);
          uVar7 = FUN_1400b8b90(uVar6);
          uVar8 = FUN_1400b8b90(param_2);
          FUN_1400db580(param_1,param_1 + 0x308,uVar8,uVar7,uVar4);
        }
      }
      else if (iVar3 == 1) {
        uVar4 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(uVar6);
        uVar8 = FUN_1400b8b90(param_2);
        FUN_1400db4a0(param_1,uVar8,uVar7,uVar4);
      }
      else if (iVar3 == 2) {
        uVar4 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(uVar6);
        uVar8 = FUN_1400b8b90(param_2);
        FUN_1400dbbb0(param_1,param_1 + 0x308,uVar8,uVar7,uVar4);
      }
      else {
        uVar4 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(uVar6);
        uVar8 = FUN_1400b8b90(param_2);
        FUN_1400dbab0(param_1,param_1 + 0x308,uVar8,uVar7,uVar4);
      }
      iVar3 = FUN_1400b8b80(param_2);
      if (iVar3 - iVar2 != 0) {
        FUN_1400b8be0(param_2,iVar3 - iVar2);
      }
    }
  }
  return uVar6;
}



undefined8 FUN_1400dc2b0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined8 *puVar8;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
  }
  else {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x401,iVar2 + 0x20);
      uVar5 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar5,uVar3);
      iVar2 = *(int *)(param_1 + 0x314);
      if (*(int *)(param_1 + 0x310) < 0x41) {
        if (iVar2 == 1) {
          uVar3 = FUN_1400b8b80(param_2);
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400d9580(param_1,uVar7,uVar6,uVar3);
        }
        else if (iVar2 == 2) {
          FUN_1400ba520(param_3,8);
          puVar8 = (undefined8 *)FUN_1400b8b90(param_3);
          *puVar8 = *(undefined8 *)(param_1 + 0x308);
          uVar3 = FUN_1400b8b80(param_2);
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400db760(param_1,puVar8,uVar7,uVar6,uVar3);
        }
        else {
          FUN_1400ba520(param_3,8);
          puVar8 = (undefined8 *)FUN_1400b8b90(param_3);
          *puVar8 = *(undefined8 *)(param_1 + 0x308);
          uVar3 = FUN_1400b8b80(param_2);
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400db580(param_1,puVar8,uVar7,uVar6,uVar3);
        }
      }
      else if (iVar2 == 1) {
        uVar3 = FUN_1400b8b80(param_2);
        uVar6 = FUN_1400b8b90(uVar5);
        uVar7 = FUN_1400b8b90(param_2);
        FUN_1400db4a0(param_1,uVar7,uVar6,uVar3);
      }
      else if (iVar2 == 2) {
        FUN_1400ba520(param_3,8);
        puVar8 = (undefined8 *)FUN_1400b8b90(param_3);
        *puVar8 = *(undefined8 *)(param_1 + 0x308);
        uVar3 = FUN_1400b8b80(param_2);
        uVar6 = FUN_1400b8b90(uVar5);
        uVar7 = FUN_1400b8b90(param_2);
        FUN_1400dbbb0(param_1,puVar8,uVar7,uVar6,uVar3);
      }
      else {
        FUN_1400ba520(param_3,8);
        puVar8 = (undefined8 *)FUN_1400b8b90(param_3);
        *puVar8 = *(undefined8 *)(param_1 + 0x308);
        uVar3 = FUN_1400b8b80(param_2);
        uVar6 = FUN_1400b8b90(uVar5);
        uVar7 = FUN_1400b8b90(param_2);
        FUN_1400dbab0(param_1,puVar8,uVar7,uVar6,uVar3);
      }
    }
  }
  return uVar5;
}



undefined8 FUN_1400dc570(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
  }
  else {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x402,iVar2 + 0x20);
      uVar5 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar5,uVar3);
      iVar2 = *(int *)(param_1 + 0x314);
      if (*(int *)(param_1 + 0x310) < 0x41) {
        if (iVar2 == 1) {
          uVar3 = FUN_1400b8b80(param_2);
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400d9580(param_1,uVar7,uVar6,uVar3);
        }
        else if (iVar2 == 2) {
          FUN_1400ba520(param_3,8);
          uVar6 = FUN_1400b8b90(param_3);
          uVar3 = FUN_1400b8b80(param_2);
          uVar7 = FUN_1400b8b90(uVar5);
          uVar8 = FUN_1400b8b90(param_2);
          FUN_1400db760(param_1,uVar6,uVar8,uVar7,uVar3);
        }
        else {
          FUN_1400ba520(param_3,8);
          uVar6 = FUN_1400b8b90(param_3);
          uVar3 = FUN_1400b8b80(param_2);
          uVar7 = FUN_1400b8b90(uVar5);
          uVar8 = FUN_1400b8b90(param_2);
          FUN_1400db580(param_1,uVar6,uVar8,uVar7,uVar3);
        }
      }
      else if (iVar2 == 1) {
        uVar3 = FUN_1400b8b80(param_2);
        uVar6 = FUN_1400b8b90(uVar5);
        uVar7 = FUN_1400b8b90(param_2);
        FUN_1400db4a0(param_1,uVar7,uVar6,uVar3);
      }
      else if (iVar2 == 2) {
        FUN_1400ba520(param_3,8);
        uVar6 = FUN_1400b8b90(param_3);
        uVar3 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(uVar5);
        uVar8 = FUN_1400b8b90(param_2);
        FUN_1400dbbb0(param_1,uVar6,uVar8,uVar7,uVar3);
      }
      else {
        FUN_1400ba520(param_3,8);
        uVar6 = FUN_1400b8b90(param_3);
        uVar3 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(uVar5);
        uVar8 = FUN_1400b8b90(param_2);
        FUN_1400dbab0(param_1,uVar6,uVar8,uVar7,uVar3);
      }
    }
  }
  return uVar5;
}



undefined8 FUN_1400dc810(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  void *pvVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  undefined8 uVar9;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar5 = operator_new(0x28);
    if (pvVar5 == (void *)0x0) {
      uVar6 = 0;
    }
    else {
      uVar6 = FUN_1400b8c40(pvVar5);
    }
  }
  else {
    iVar2 = FUN_1400b8b80(param_2);
    FUN_1400b9a00(param_2,*(undefined4 *)(param_1 + 0x318),8);
    pvVar5 = operator_new(0x28);
    if (pvVar5 == (void *)0x0) {
      uVar6 = 0;
    }
    else {
      uVar6 = FUN_1400b8c40(pvVar5);
    }
    iVar3 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar6,iVar3 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x403,iVar2 + 0x20);
      uVar6 = 0;
    }
    else {
      uVar4 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar6,uVar4);
      iVar3 = *(int *)(param_1 + 0x314);
      if (*(int *)(param_1 + 0x310) < 0x41) {
        if (iVar3 == 1) {
          uVar4 = FUN_1400b8b80(param_2);
          uVar7 = FUN_1400b8b90(uVar6);
          uVar8 = FUN_1400b8b90(param_2);
          FUN_1400d9580(param_1,uVar8,uVar7,uVar4);
        }
        else if (iVar3 == 2) {
          FUN_1400ba520(param_3,8);
          uVar7 = FUN_1400b8b90(param_3);
          uVar4 = FUN_1400b8b80(param_2);
          uVar8 = FUN_1400b8b90(uVar6);
          uVar9 = FUN_1400b8b90(param_2);
          FUN_1400db760(param_1,uVar7,uVar9,uVar8,uVar4);
        }
        else {
          FUN_1400ba520(param_3,8);
          uVar7 = FUN_1400b8b90(param_3);
          uVar4 = FUN_1400b8b80(param_2);
          uVar8 = FUN_1400b8b90(uVar6);
          uVar9 = FUN_1400b8b90(param_2);
          FUN_1400db580(param_1,uVar7,uVar9,uVar8,uVar4);
        }
      }
      else if (iVar3 == 1) {
        uVar4 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(uVar6);
        uVar8 = FUN_1400b8b90(param_2);
        FUN_1400db4a0(param_1,uVar8,uVar7,uVar4);
      }
      else if (iVar3 == 2) {
        FUN_1400ba520(param_3,8);
        uVar7 = FUN_1400b8b90(param_3);
        uVar4 = FUN_1400b8b80(param_2);
        uVar8 = FUN_1400b8b90(uVar6);
        uVar9 = FUN_1400b8b90(param_2);
        FUN_1400dbbb0(param_1,uVar7,uVar9,uVar8,uVar4);
      }
      else {
        FUN_1400ba520(param_3,8);
        uVar7 = FUN_1400b8b90(param_3);
        uVar4 = FUN_1400b8b80(param_2);
        uVar8 = FUN_1400b8b90(uVar6);
        uVar9 = FUN_1400b8b90(param_2);
        FUN_1400dbab0(param_1,uVar7,uVar9,uVar8,uVar4);
      }
      iVar3 = FUN_1400b8b80(param_2);
      if (iVar3 - iVar2 != 0) {
        FUN_1400b8be0(param_2,iVar3 - iVar2);
      }
    }
  }
  return uVar6;
}



undefined8 FUN_1400dcaf0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  int iVar1;
  char cVar2;
  uint uVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  int iVar8;
  
  uVar3 = FUN_1400b8b80(param_2);
  uVar5 = 0;
  iVar8 = 0;
  if (*(int *)(param_1 + 0x314) == 2) {
    if ((uVar3 & 7) != 0) {
      iVar8 = 8 - (uVar3 & 7);
      uVar3 = uVar3 + iVar8;
      FUN_1400b95c0(param_2,0,iVar8);
    }
  }
  else if ((uVar3 & 7) != 0) {
    uVar3 = uVar3 - (uVar3 & 7);
  }
  pvVar4 = operator_new(0x28);
  if (uVar3 == 0) {
    if (pvVar4 != (void *)0x0) {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
  }
  else {
    if (pvVar4 != (void *)0x0) {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
    cVar2 = FUN_1400ba520(uVar5,uVar3 + 0x20);
    if (cVar2 == '\0') {
      FUN_1400cf7b0(param_3,0x405,uVar3 + 0x20);
      uVar5 = 0;
    }
    else {
      FUN_1400b8c10(uVar5,uVar3);
      iVar1 = *(int *)(param_1 + 0x314);
      if (*(int *)(param_1 + 0x310) == 0x38) {
        if (iVar1 == 1) {
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400d95f0(param_1,uVar7,uVar6,uVar3);
        }
        else if (iVar1 == 2) {
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400db840(param_1,param_1 + 0x308,uVar7,uVar6,uVar3);
        }
        else {
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400db680(param_1,param_1 + 0x308,uVar7,uVar6,uVar3);
        }
      }
      else if (iVar1 == 1) {
        uVar6 = FUN_1400b8b90(uVar5);
        uVar7 = FUN_1400b8b90(param_2);
        FUN_1400db510(param_1,uVar7,uVar6,uVar3);
      }
      else if (iVar1 == 2) {
        uVar6 = FUN_1400b8b90(uVar5);
        uVar7 = FUN_1400b8b90(param_2);
        FUN_1400dbd70(param_1,param_1 + 0x308,uVar7,uVar6,uVar3);
      }
      else {
        uVar6 = FUN_1400b8b90(uVar5);
        uVar7 = FUN_1400b8b90(param_2);
        FUN_1400dbc90(param_1,param_1 + 0x308,uVar7,uVar6,uVar3);
      }
      FUN_1400b9c60(uVar5,*(undefined4 *)(param_1 + 0x318),8,param_3);
      if (iVar8 != 0) {
        FUN_1400b8be0(param_2,iVar8);
      }
    }
  }
  return uVar5;
}



undefined8 FUN_1400dcd30(longlong param_1,undefined8 param_2,undefined8 *param_3,undefined8 param_4)

{
  int iVar1;
  char cVar2;
  uint uVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  
  uVar3 = FUN_1400b8b80(param_2);
  if ((uVar3 & 7) != 0) {
    uVar3 = uVar3 - (uVar3 & 7);
  }
  pvVar4 = operator_new(0x28);
  if (uVar3 == 0) {
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
  }
  else {
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
    cVar2 = FUN_1400ba520(uVar5,uVar3 + 0x20);
    if (cVar2 == '\0') {
      FUN_1400cf7b0(param_4,0x406,uVar3 + 0x20);
      uVar5 = 0;
    }
    else {
      FUN_1400b8c10(uVar5,uVar3);
      iVar1 = *(int *)(param_1 + 0x314);
      if (*(int *)(param_1 + 0x310) == 0x38) {
        if (iVar1 == 1) {
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400d95f0(param_1,uVar7,uVar6,uVar3);
          return uVar5;
        }
        if (iVar1 == 2) {
          if (param_3 != (undefined8 *)0x0) {
            *param_3 = *(undefined8 *)(param_1 + 0x308);
          }
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400db840(param_1,param_3,uVar7,uVar6,uVar3);
          return uVar5;
        }
        if (param_3 != (undefined8 *)0x0) {
          *param_3 = *(undefined8 *)(param_1 + 0x308);
          uVar6 = FUN_1400b8b90();
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400db680(param_1,param_3,uVar7,uVar6,uVar3);
          return uVar5;
        }
      }
      else {
        if (iVar1 == 1) {
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400db510(param_1,uVar7,uVar6,uVar3);
          return uVar5;
        }
        if (iVar1 == 2) {
          if (param_3 != (undefined8 *)0x0) {
            *param_3 = *(undefined8 *)(param_1 + 0x308);
          }
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400dbd70(param_1,param_3,uVar7,uVar6,uVar3);
          return uVar5;
        }
        if (param_3 != (undefined8 *)0x0) {
          *param_3 = *(undefined8 *)(param_1 + 0x308);
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400dbc90(param_1,param_3,uVar7,uVar6,uVar3);
          return uVar5;
        }
      }
      FUN_1400b8b30(uVar5);
    }
  }
  return uVar5;
}



undefined8 FUN_1400dcf80(longlong param_1,undefined8 param_2,longlong param_3,undefined8 param_4)

{
  int iVar1;
  char cVar2;
  uint uVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  
  uVar3 = FUN_1400b8b80(param_2);
  if ((uVar3 & 7) != 0) {
    uVar3 = uVar3 - (uVar3 & 7);
  }
  pvVar4 = operator_new(0x28);
  if (uVar3 == 0) {
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
  }
  else {
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
    cVar2 = FUN_1400ba520(uVar5,uVar3 + 0x20);
    if (cVar2 == '\0') {
      FUN_1400cf7b0(param_4,0x407,uVar3 + 0x20);
      uVar5 = 0;
    }
    else {
      FUN_1400b8c10(uVar5,uVar3);
      iVar1 = *(int *)(param_1 + 0x314);
      if (*(int *)(param_1 + 0x310) == 0x38) {
        if (iVar1 == 1) {
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400d95f0(param_1,uVar7,uVar6,uVar3);
          return uVar5;
        }
        if (iVar1 == 2) {
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400db840(param_1,param_3,uVar7,uVar6,uVar3);
          return uVar5;
        }
        if (param_3 != 0) {
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400db680(param_1,param_3,uVar7,uVar6,uVar3);
          return uVar5;
        }
      }
      else {
        if (iVar1 == 1) {
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400db510(param_1,uVar7,uVar6,uVar3);
          return uVar5;
        }
        if (iVar1 == 2) {
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400dbd70(param_1,param_3,uVar7,uVar6,uVar3);
          return uVar5;
        }
        if (param_3 != 0) {
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400dbc90(param_1,param_3,uVar7,uVar6,uVar3);
          return uVar5;
        }
      }
      FUN_1400b8b30();
    }
  }
  return uVar5;
}



undefined8 FUN_1400dd180(longlong param_1,undefined8 param_2,longlong param_3,undefined8 param_4)

{
  int iVar1;
  char cVar2;
  uint uVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  
  uVar3 = FUN_1400b8b80(param_2);
  if ((uVar3 & 7) != 0) {
    uVar3 = uVar3 - (uVar3 & 7);
  }
  pvVar4 = operator_new(0x28);
  if (uVar3 == 0) {
    if (pvVar4 != (void *)0x0) {
      uVar5 = FUN_1400b8c40(pvVar4);
      return uVar5;
    }
    return 0;
  }
  if (pvVar4 == (void *)0x0) {
    uVar5 = 0;
  }
  else {
    uVar5 = FUN_1400b8c40(pvVar4);
  }
  cVar2 = FUN_1400ba520(uVar5,uVar3 + 0x20);
  if (cVar2 == '\0') {
    FUN_1400cf7b0(param_4,0x408,uVar3 + 0x20);
    return 0;
  }
  FUN_1400b8c10(uVar5,uVar3);
  iVar1 = *(int *)(param_1 + 0x314);
  if (*(int *)(param_1 + 0x310) == 0x38) {
    if (iVar1 == 1) {
      uVar6 = FUN_1400b8b90(uVar5);
      uVar7 = FUN_1400b8b90(param_2);
      FUN_1400d95f0(param_1,uVar7,uVar6,uVar3);
      goto LAB_1400dd35d;
    }
    if (iVar1 == 2) {
      uVar6 = FUN_1400b8b90(uVar5);
      uVar7 = FUN_1400b8b90(param_2);
      FUN_1400db840(param_1,param_3,uVar7,uVar6,uVar3);
      goto LAB_1400dd35d;
    }
    if (param_3 != 0) {
      uVar6 = FUN_1400b8b90(uVar5);
      uVar7 = FUN_1400b8b90(param_2);
      FUN_1400db680(param_1,param_3,uVar7,uVar6,uVar3);
      goto LAB_1400dd35d;
    }
  }
  else {
    if (iVar1 == 1) {
      uVar6 = FUN_1400b8b90(uVar5);
      uVar7 = FUN_1400b8b90(param_2);
      FUN_1400db510(param_1,uVar7,uVar6,uVar3);
      goto LAB_1400dd35d;
    }
    if (iVar1 == 2) {
      uVar6 = FUN_1400b8b90(uVar5);
      uVar7 = FUN_1400b8b90(param_2);
      FUN_1400dbd70(param_1,param_3,uVar7,uVar6,uVar3);
      goto LAB_1400dd35d;
    }
    if (param_3 != 0) {
      uVar6 = FUN_1400b8b90(uVar5);
      uVar7 = FUN_1400b8b90(param_2);
      FUN_1400dbc90(param_1,param_3,uVar7,uVar6,uVar3);
      goto LAB_1400dd35d;
    }
  }
  FUN_1400b8b30();
LAB_1400dd35d:
  FUN_1400b9c60(uVar5,*(undefined4 *)(param_1 + 0x318),8,param_4);
  return uVar5;
}



undefined8 * FUN_1400dd3a0(undefined8 *param_1,byte param_2)

{
  *param_1 = ChilkatDes::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1400dd3d0(longlong param_1,int param_2)

{
  uint uVar1;
  
  if (0x1c0 < param_2) {
    param_2 = 0x1c0;
  }
  uVar1 = param_2 + (param_2 >> 0x1f & 7U) & 0xfffffff8;
  if ((int)uVar1 < 0x20) {
    uVar1 = 0x20;
  }
  *(uint *)(param_1 + 0x48) = uVar1;
  return;
}



void FUN_1400dd400(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x50) = param_2;
  return;
}



undefined1 FUN_1400dd410(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x4c) = 1;
  return 1;
}



undefined1 FUN_1400dd420(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x4c) = 0;
  return 1;
}



undefined1 FUN_1400dd430(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x4c) = 2;
  return 1;
}



void FUN_1400dd440(longlong param_1,undefined8 *param_2)

{
  *(undefined8 *)(param_1 + 0x40) = *param_2;
  return;
}



undefined1 * FUN_1400dd450(undefined1 *param_1)

{
  void *pvVar1;
  
  *param_1 = 0;
  FUN_1400b8c40(param_1 + 0x18);
  *(undefined4 *)(param_1 + 0x48) = 0x80;
  *(undefined8 *)(param_1 + 0x4c) = 1;
  pvVar1 = operator_new(0x48);
  *(void **)(param_1 + 8) = pvVar1;
  pvVar1 = operator_new(0x1000);
  *(void **)(param_1 + 0x10) = pvVar1;
  *(undefined8 *)(param_1 + 0x40) = 0;
  return param_1;
}



void FUN_1400dd4b0(longlong param_1)

{
  operator_delete(*(void **)(param_1 + 8));
  operator_delete(*(void **)(param_1 + 0x10));
  FUN_1400b92d0(param_1 + 0x18);
  return;
}



void FUN_1400dd4f0(longlong param_1,undefined8 param_2)

{
  FUN_1400b8b30(param_1 + 0x18);
  FUN_1400b9e90(param_1 + 0x18,param_2);
  return;
}



void FUN_1400dd520(longlong param_1,uint *param_2,uint *param_3)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  longlong lVar4;
  longlong lVar5;
  uint uVar6;
  uint uVar7;
  
  lVar2 = *(longlong *)(param_1 + 0x10);
  puVar3 = *(uint **)(param_1 + 8);
  uVar7 = *puVar3 ^ *param_2;
  uVar6 = (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar7 >> 0x10) * 4) +
           *(int *)(lVar2 + (ulonglong)(uVar7 >> 0x18) * 4) ^
          *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar7 >> 8) * 4)) +
          *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar7 & 0xff) * 4) ^ puVar3[1] ^ *param_3;
  uVar7 = uVar7 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 0x10) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 >> 0x18) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 8) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 & 0xff) * 4) ^ puVar3[2];
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar7 >> 0x10) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar7 >> 0x18) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar7 >> 8) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar7 & 0xff) * 4) ^ puVar3[3];
  uVar7 = uVar7 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 0x10) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 >> 0x18) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 8) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 & 0xff) * 4) ^ puVar3[4];
  lVar4 = *(longlong *)(param_1 + 0x10);
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar7 >> 0x10) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar7 >> 0x18) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar7 >> 8) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar7 & 0xff) * 4) ^ puVar3[5];
  uVar7 = uVar7 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 0x10) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 >> 0x18) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 8) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 & 0xff) * 4) ^ puVar3[6];
  lVar5 = *(longlong *)(param_1 + 8);
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar7 >> 0x10) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar7 >> 0x18) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar7 >> 8) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar7 & 0xff) * 4) ^ puVar3[7];
  uVar7 = uVar7 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 0x10) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 >> 0x18) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar6 >> 8) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar6 & 0xff) * 4) ^ *(uint *)(lVar5 + 0x20);
  uVar6 = uVar6 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar7 >> 0x10) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar7 >> 0x18) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar7 >> 8) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar7 & 0xff) * 4) ^ *(uint *)(lVar5 + 0x24);
  uVar7 = uVar7 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar6 >> 0x10) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar6 >> 0x18) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar6 >> 8) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar6 & 0xff) * 4) ^ *(uint *)(lVar5 + 0x28);
  lVar2 = *(longlong *)(param_1 + 8);
  uVar6 = uVar6 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar7 >> 0x10) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar7 >> 0x18) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar7 >> 8) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar7 & 0xff) * 4) ^ *(uint *)(lVar5 + 0x2c);
  uVar7 = uVar7 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar6 >> 0x10) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar6 >> 0x18) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar6 >> 8) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar6 & 0xff) * 4) ^ *(uint *)(lVar5 + 0x30);
  uVar6 = uVar6 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar7 >> 0x10) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar7 >> 0x18) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar7 >> 8) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar7 & 0xff) * 4) ^ *(uint *)(lVar5 + 0x34);
  uVar7 = uVar7 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar6 >> 0x10) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar6 >> 0x18) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar6 >> 8) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar6 & 0xff) * 4) ^ *(uint *)(lVar5 + 0x38);
  uVar6 = uVar6 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar7 >> 0x10) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar7 >> 0x18) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar7 >> 8) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar7 & 0xff) * 4) ^ *(uint *)(lVar2 + 0x3c);
  uVar1 = *(uint *)(lVar2 + 0x44);
  *param_3 = uVar7 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar6 >> 0x10) * 4) +
                      *(int *)(lVar4 + (ulonglong)(uVar6 >> 0x18) * 4) ^
                     *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar6 >> 8) * 4)) +
                     *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar6 & 0xff) * 4) ^
                     *(uint *)(lVar2 + 0x40);
  *param_2 = uVar6 ^ uVar1;
  return;
}



void FUN_1400dd980(longlong param_1,uint *param_2,uint *param_3)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  longlong lVar4;
  longlong lVar5;
  uint uVar6;
  uint uVar7;
  
  lVar2 = *(longlong *)(param_1 + 0x10);
  puVar3 = *(uint **)(param_1 + 8);
  uVar7 = *puVar3 ^ *param_2;
  uVar6 = (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar7 >> 8) * 4) +
           *(int *)(lVar2 + (ulonglong)(uVar7 & 0xff) * 4) ^
          *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar7 >> 0x10) * 4)) +
          *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar7 >> 0x18) * 4) ^ puVar3[1] ^ *param_3;
  uVar7 = uVar7 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ puVar3[2];
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar7 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar7 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar7 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar7 >> 0x18) * 4) ^ puVar3[3];
  uVar7 = uVar7 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ puVar3[4];
  lVar4 = *(longlong *)(param_1 + 0x10);
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar7 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar7 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar7 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar7 >> 0x18) * 4) ^ puVar3[5];
  uVar7 = uVar7 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ puVar3[6];
  lVar5 = *(longlong *)(param_1 + 8);
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar7 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar7 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar7 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar7 >> 0x18) * 4) ^ puVar3[7];
  uVar7 = uVar7 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ *(uint *)(lVar5 + 0x20)
  ;
  uVar6 = uVar6 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar7 >> 8) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar7 & 0xff) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar7 >> 0x10) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar7 >> 0x18) * 4) ^ *(uint *)(lVar5 + 0x24)
  ;
  uVar7 = uVar7 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ *(uint *)(lVar5 + 0x28)
  ;
  lVar2 = *(longlong *)(param_1 + 8);
  uVar6 = uVar6 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar7 >> 8) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar7 & 0xff) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar7 >> 0x10) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar7 >> 0x18) * 4) ^ *(uint *)(lVar5 + 0x2c)
  ;
  uVar7 = uVar7 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ *(uint *)(lVar5 + 0x30)
  ;
  uVar6 = uVar6 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar7 >> 8) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar7 & 0xff) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar7 >> 0x10) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar7 >> 0x18) * 4) ^ *(uint *)(lVar5 + 0x34)
  ;
  uVar7 = uVar7 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ *(uint *)(lVar5 + 0x38)
  ;
  uVar6 = uVar6 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar7 >> 8) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar7 & 0xff) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar7 >> 0x10) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar7 >> 0x18) * 4) ^ *(uint *)(lVar2 + 0x3c)
  ;
  uVar1 = *(uint *)(lVar2 + 0x44);
  *param_3 = uVar7 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                      *(int *)(lVar4 + (ulonglong)(uVar6 & 0xff) * 4) ^
                     *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                     *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^
                     *(uint *)(lVar2 + 0x40);
  *param_2 = uVar6 ^ uVar1;
  return;
}



void FUN_1400dddf0(longlong param_1,undefined1 *param_2,undefined1 *param_3)

{
  uint *puVar1;
  longlong lVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 local_res8;
  undefined4 local_res10;
  
  puVar1 = *(uint **)(param_1 + 8);
  lVar2 = *(longlong *)(param_1 + 0x10);
  local_res8 = CONCAT13(*param_2,CONCAT12(param_2[1],CONCAT11(param_2[2],param_2[3])));
  local_res8 = local_res8 ^ *puVar1;
  local_res10 = CONCAT13(*param_3,CONCAT12(param_3[1],CONCAT11(param_3[2],param_3[3])));
  local_res10 = local_res10 ^
                (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res8 >> 0x10) * 4) +
                 *(int *)(lVar2 + (ulonglong)(local_res8 >> 0x18) * 4) ^
                *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res8 >> 8) * 4)) +
                *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res8 & 0xff) * 4) ^ puVar1[1];
  local_res8 = local_res8 ^
               (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res10 >> 0x10) * 4) +
                *(int *)(lVar2 + (ulonglong)(local_res10 >> 0x18) * 4) ^
               *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res10 >> 8) * 4)) +
               *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res10 & 0xff) * 4) ^ puVar1[2];
  local_res10 = local_res10 ^
                (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res8 >> 0x10) * 4) +
                 *(int *)(lVar2 + (ulonglong)(local_res8 >> 0x18) * 4) ^
                *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res8 >> 8) * 4)) +
                *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res8 & 0xff) * 4) ^ puVar1[3];
  local_res8 = local_res8 ^
               (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res10 >> 0x10) * 4) +
                *(int *)(lVar2 + (ulonglong)(local_res10 >> 0x18) * 4) ^
               *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res10 >> 8) * 4)) +
               *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res10 & 0xff) * 4) ^ puVar1[4];
  local_res10 = local_res10 ^
                (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res8 >> 0x10) * 4) +
                 *(int *)(lVar2 + (ulonglong)(local_res8 >> 0x18) * 4) ^
                *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res8 >> 8) * 4)) +
                *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res8 & 0xff) * 4) ^ puVar1[5];
  local_res8 = local_res8 ^
               (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res10 >> 0x10) * 4) +
                *(int *)(lVar2 + (ulonglong)(local_res10 >> 0x18) * 4) ^
               *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res10 >> 8) * 4)) +
               *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res10 & 0xff) * 4) ^ puVar1[6];
  local_res10 = local_res10 ^
                (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res8 >> 0x10) * 4) +
                 *(int *)(lVar2 + (ulonglong)(local_res8 >> 0x18) * 4) ^
                *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res8 >> 8) * 4)) +
                *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res8 & 0xff) * 4) ^ puVar1[7];
  local_res8 = local_res8 ^
               (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res10 >> 0x10) * 4) +
                *(int *)(lVar2 + (ulonglong)(local_res10 >> 0x18) * 4) ^
               *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res10 >> 8) * 4)) +
               *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res10 & 0xff) * 4) ^ puVar1[8];
  local_res10 = local_res10 ^
                (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res8 >> 0x10) * 4) +
                 *(int *)(lVar2 + (ulonglong)(local_res8 >> 0x18) * 4) ^
                *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res8 >> 8) * 4)) +
                *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res8 & 0xff) * 4) ^ puVar1[9];
  local_res8 = local_res8 ^
               (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res10 >> 0x10) * 4) +
                *(int *)(lVar2 + (ulonglong)(local_res10 >> 0x18) * 4) ^
               *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res10 >> 8) * 4)) +
               *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res10 & 0xff) * 4) ^ puVar1[10];
  local_res10 = local_res10 ^
                (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res8 >> 0x10) * 4) +
                 *(int *)(lVar2 + (ulonglong)(local_res8 >> 0x18) * 4) ^
                *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res8 >> 8) * 4)) +
                *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res8 & 0xff) * 4) ^ puVar1[0xb];
  local_res8 = local_res8 ^
               (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res10 >> 0x10) * 4) +
                *(int *)(lVar2 + (ulonglong)(local_res10 >> 0x18) * 4) ^
               *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res10 >> 8) * 4)) +
               *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res10 & 0xff) * 4) ^ puVar1[0xc];
  local_res10 = local_res10 ^
                (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res8 >> 0x10) * 4) +
                 *(int *)(lVar2 + (ulonglong)(local_res8 >> 0x18) * 4) ^
                *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res8 >> 8) * 4)) +
                *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res8 & 0xff) * 4) ^ puVar1[0xd];
  lVar3 = *(longlong *)(param_1 + 8);
  local_res8 = local_res8 ^
               (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res10 >> 0x10) * 4) +
                *(int *)(lVar2 + (ulonglong)(local_res10 >> 0x18) * 4) ^
               *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res10 >> 8) * 4)) +
               *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res10 & 0xff) * 4) ^ puVar1[0xe];
  local_res10 = local_res10 ^
                (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res8 >> 0x10) * 4) +
                 *(int *)(lVar2 + (ulonglong)(local_res8 >> 0x18) * 4) ^
                *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res8 >> 8) * 4)) +
                *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res8 & 0xff) * 4) ^
                *(uint *)(lVar3 + 0x3c);
  uVar4 = local_res10 ^ *(uint *)(lVar3 + 0x44);
  local_res8 = local_res8 ^
               (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res10 >> 0x10) * 4) +
                *(int *)(lVar2 + (ulonglong)(local_res10 >> 0x18) * 4) ^
               *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res10 >> 8) * 4)) +
               *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res10 & 0xff) * 4) ^
               *(uint *)(lVar3 + 0x40);
  *param_3 = (char)(local_res8 >> 0x18);
  param_3[2] = (char)(local_res8 >> 8);
  param_3[3] = (undefined1)local_res8;
  param_3[1] = (char)(local_res8 >> 0x10);
  *param_2 = (char)(uVar4 >> 0x18);
  param_2[2] = (char)(uVar4 >> 8);
  local_res10._0_1_ = (undefined1)uVar4;
  param_2[1] = (char)(uVar4 >> 0x10);
  param_2[3] = (undefined1)local_res10;
  return;
}



void FUN_1400de2d0(longlong param_1,uint *param_2,uint *param_3)

{
  uint *puVar1;
  longlong lVar2;
  longlong lVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  undefined1 local_res8;
  undefined1 local_res10;
  
  puVar1 = *(uint **)(param_1 + 8);
  lVar2 = *(longlong *)(param_1 + 0x10);
  uVar6 = *param_2 ^ *puVar1;
  uVar4 = *param_3 ^
          (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
           *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
          *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
          *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ puVar1[1];
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar4 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar4 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar4 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar4 >> 0x18) * 4) ^ puVar1[2];
  uVar4 = uVar4 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ puVar1[3];
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar4 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar4 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar4 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar4 >> 0x18) * 4) ^ puVar1[4];
  uVar4 = uVar4 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ puVar1[5];
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar4 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar4 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar4 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar4 >> 0x18) * 4) ^ puVar1[6];
  uVar4 = uVar4 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ puVar1[7];
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar4 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar4 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar4 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar4 >> 0x18) * 4) ^ puVar1[8];
  uVar4 = uVar4 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ puVar1[9];
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar4 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar4 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar4 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar4 >> 0x18) * 4) ^ puVar1[10];
  uVar4 = uVar4 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ puVar1[0xb];
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar4 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar4 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar4 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar4 >> 0x18) * 4) ^ puVar1[0xc];
  uVar4 = uVar4 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ puVar1[0xd];
  lVar3 = *(longlong *)(param_1 + 8);
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar4 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar4 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar4 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar4 >> 0x18) * 4) ^ puVar1[0xe];
  uVar4 = uVar4 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ *(uint *)(lVar3 + 0x3c)
  ;
  uVar5 = uVar4 ^ *(uint *)(lVar3 + 0x44);
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar4 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar4 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar4 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar4 >> 0x18) * 4) ^ *(uint *)(lVar3 + 0x40)
  ;
  local_res8 = (undefined1)uVar6;
  *(undefined1 *)param_3 = local_res8;
  *(char *)((longlong)param_3 + 1) = (char)(uVar6 >> 8);
  *(char *)((longlong)param_3 + 3) = (char)(uVar6 >> 0x18);
  local_res10 = (undefined1)uVar5;
  *(char *)((longlong)param_3 + 2) = (char)(uVar6 >> 0x10);
  *(undefined1 *)param_2 = local_res10;
  *(char *)((longlong)param_2 + 1) = (char)(uVar5 >> 8);
  *(char *)((longlong)param_2 + 3) = (char)(uVar5 >> 0x18);
  *(char *)((longlong)param_2 + 2) = (char)(uVar5 >> 0x10);
  return;
}



void FUN_1400de7c0(longlong param_1,undefined1 *param_2,undefined1 *param_3)

{
  longlong lVar1;
  longlong lVar2;
  uint *puVar3;
  uint uVar4;
  undefined4 local_res8;
  undefined4 local_res10;
  
  lVar1 = *(longlong *)(param_1 + 8);
  lVar2 = *(longlong *)(param_1 + 0x10);
  local_res8 = CONCAT13(*param_2,CONCAT12(param_2[1],CONCAT11(param_2[2],param_2[3])));
  local_res8 = local_res8 ^ *(uint *)(lVar1 + 0x44);
  local_res10 = CONCAT13(*param_3,CONCAT12(param_3[1],CONCAT11(param_3[2],param_3[3])));
  local_res10 = local_res10 ^
                (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res8 >> 0x10) * 4) +
                 *(int *)(lVar2 + (ulonglong)(local_res8 >> 0x18) * 4) ^
                *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res8 >> 8) * 4)) +
                *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res8 & 0xff) * 4) ^
                *(uint *)(lVar1 + 0x40);
  local_res8 = local_res8 ^
               (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res10 >> 0x10) * 4) +
                *(int *)(lVar2 + (ulonglong)(local_res10 >> 0x18) * 4) ^
               *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res10 >> 8) * 4)) +
               *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res10 & 0xff) * 4) ^
               *(uint *)(lVar1 + 0x3c);
  local_res10 = local_res10 ^
                (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res8 >> 0x10) * 4) +
                 *(int *)(lVar2 + (ulonglong)(local_res8 >> 0x18) * 4) ^
                *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res8 >> 8) * 4)) +
                *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res8 & 0xff) * 4) ^
                *(uint *)(lVar1 + 0x38);
  local_res8 = local_res8 ^
               (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res10 >> 0x10) * 4) +
                *(int *)(lVar2 + (ulonglong)(local_res10 >> 0x18) * 4) ^
               *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res10 >> 8) * 4)) +
               *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res10 & 0xff) * 4) ^
               *(uint *)(lVar1 + 0x34);
  local_res10 = local_res10 ^
                (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res8 >> 0x10) * 4) +
                 *(int *)(lVar2 + (ulonglong)(local_res8 >> 0x18) * 4) ^
                *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res8 >> 8) * 4)) +
                *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res8 & 0xff) * 4) ^
                *(uint *)(lVar1 + 0x30);
  local_res8 = local_res8 ^
               (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res10 >> 0x10) * 4) +
                *(int *)(lVar2 + (ulonglong)(local_res10 >> 0x18) * 4) ^
               *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res10 >> 8) * 4)) +
               *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res10 & 0xff) * 4) ^
               *(uint *)(lVar1 + 0x2c);
  local_res10 = local_res10 ^
                (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res8 >> 0x10) * 4) +
                 *(int *)(lVar2 + (ulonglong)(local_res8 >> 0x18) * 4) ^
                *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res8 >> 8) * 4)) +
                *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res8 & 0xff) * 4) ^
                *(uint *)(lVar1 + 0x28);
  local_res8 = local_res8 ^
               (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res10 >> 0x10) * 4) +
                *(int *)(lVar2 + (ulonglong)(local_res10 >> 0x18) * 4) ^
               *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res10 >> 8) * 4)) +
               *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res10 & 0xff) * 4) ^
               *(uint *)(lVar1 + 0x24);
  local_res10 = local_res10 ^
                (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res8 >> 0x10) * 4) +
                 *(int *)(lVar2 + (ulonglong)(local_res8 >> 0x18) * 4) ^
                *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res8 >> 8) * 4)) +
                *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res8 & 0xff) * 4) ^
                *(uint *)(lVar1 + 0x20);
  local_res8 = local_res8 ^
               (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res10 >> 0x10) * 4) +
                *(int *)(lVar2 + (ulonglong)(local_res10 >> 0x18) * 4) ^
               *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res10 >> 8) * 4)) +
               *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res10 & 0xff) * 4) ^
               *(uint *)(lVar1 + 0x1c);
  local_res10 = local_res10 ^
                (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res8 >> 0x10) * 4) +
                 *(int *)(lVar2 + (ulonglong)(local_res8 >> 0x18) * 4) ^
                *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res8 >> 8) * 4)) +
                *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res8 & 0xff) * 4) ^
                *(uint *)(lVar1 + 0x18);
  local_res8 = local_res8 ^
               (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res10 >> 0x10) * 4) +
                *(int *)(lVar2 + (ulonglong)(local_res10 >> 0x18) * 4) ^
               *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res10 >> 8) * 4)) +
               *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res10 & 0xff) * 4) ^
               *(uint *)(lVar1 + 0x14);
  local_res10 = local_res10 ^
                (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res8 >> 0x10) * 4) +
                 *(int *)(lVar2 + (ulonglong)(local_res8 >> 0x18) * 4) ^
                *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res8 >> 8) * 4)) +
                *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res8 & 0xff) * 4) ^
                *(uint *)(lVar1 + 0x10);
  puVar3 = *(uint **)(param_1 + 8);
  local_res8 = local_res8 ^
               (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res10 >> 0x10) * 4) +
                *(int *)(lVar2 + (ulonglong)(local_res10 >> 0x18) * 4) ^
               *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res10 >> 8) * 4)) +
               *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res10 & 0xff) * 4) ^
               *(uint *)(lVar1 + 0xc);
  local_res10 = local_res10 ^
                (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res8 >> 0x10) * 4) +
                 *(int *)(lVar2 + (ulonglong)(local_res8 >> 0x18) * 4) ^
                *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res8 >> 8) * 4)) +
                *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res8 & 0xff) * 4) ^ puVar3[2];
  uVar4 = local_res10 ^ *puVar3;
  local_res8 = local_res8 ^
               (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(local_res10 >> 0x10) * 4) +
                *(int *)(lVar2 + (ulonglong)(local_res10 >> 0x18) * 4) ^
               *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(local_res10 >> 8) * 4)) +
               *(int *)(lVar2 + 0xc00 + (ulonglong)(local_res10 & 0xff) * 4) ^ puVar3[1];
  *param_3 = (char)(local_res8 >> 0x18);
  param_3[2] = (char)(local_res8 >> 8);
  param_3[3] = (undefined1)local_res8;
  param_3[1] = (char)(local_res8 >> 0x10);
  *param_2 = (char)(uVar4 >> 0x18);
  param_2[2] = (char)(uVar4 >> 8);
  local_res10._0_1_ = (undefined1)uVar4;
  param_2[1] = (char)(uVar4 >> 0x10);
  param_2[3] = (undefined1)local_res10;
  return;
}



void FUN_1400deca0(longlong param_1,uint *param_2,uint *param_3)

{
  longlong lVar1;
  longlong lVar2;
  uint *puVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  undefined1 local_res8;
  undefined1 local_res10;
  
  lVar1 = *(longlong *)(param_1 + 8);
  lVar2 = *(longlong *)(param_1 + 0x10);
  uVar6 = *param_2 ^ *(uint *)(lVar1 + 0x44);
  uVar4 = *param_3 ^
          (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
           *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
          *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
          *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ *(uint *)(lVar1 + 0x40);
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar4 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar4 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar4 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar4 >> 0x18) * 4) ^ *(uint *)(lVar1 + 0x3c)
  ;
  uVar4 = uVar4 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ *(uint *)(lVar1 + 0x38)
  ;
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar4 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar4 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar4 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar4 >> 0x18) * 4) ^ *(uint *)(lVar1 + 0x34)
  ;
  uVar4 = uVar4 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ *(uint *)(lVar1 + 0x30)
  ;
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar4 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar4 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar4 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar4 >> 0x18) * 4) ^ *(uint *)(lVar1 + 0x2c)
  ;
  uVar4 = uVar4 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ *(uint *)(lVar1 + 0x28)
  ;
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar4 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar4 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar4 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar4 >> 0x18) * 4) ^ *(uint *)(lVar1 + 0x24)
  ;
  uVar4 = uVar4 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ *(uint *)(lVar1 + 0x20)
  ;
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar4 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar4 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar4 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar4 >> 0x18) * 4) ^ *(uint *)(lVar1 + 0x1c)
  ;
  uVar4 = uVar4 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ *(uint *)(lVar1 + 0x18)
  ;
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar4 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar4 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar4 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar4 >> 0x18) * 4) ^ *(uint *)(lVar1 + 0x14)
  ;
  uVar4 = uVar4 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ *(uint *)(lVar1 + 0x10)
  ;
  puVar3 = *(uint **)(param_1 + 8);
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar4 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar4 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar4 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar4 >> 0x18) * 4) ^ *(uint *)(lVar1 + 0xc);
  uVar4 = uVar4 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 >> 0x18) * 4) ^ puVar3[2];
  uVar5 = uVar4 ^ *puVar3;
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar4 >> 8) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar4 & 0xff) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar4 >> 0x10) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar4 >> 0x18) * 4) ^ puVar3[1];
  local_res8 = (undefined1)uVar6;
  *(undefined1 *)param_3 = local_res8;
  *(char *)((longlong)param_3 + 1) = (char)(uVar6 >> 8);
  *(char *)((longlong)param_3 + 3) = (char)(uVar6 >> 0x18);
  local_res10 = (undefined1)uVar5;
  *(char *)((longlong)param_3 + 2) = (char)(uVar6 >> 0x10);
  *(undefined1 *)param_2 = local_res10;
  *(char *)((longlong)param_2 + 1) = (char)(uVar5 >> 8);
  *(char *)((longlong)param_2 + 3) = (char)(uVar5 >> 0x18);
  *(char *)((longlong)param_2 + 2) = (char)(uVar5 >> 0x10);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400df180(undefined1 *param_1)

{
  uint *puVar1;
  char cVar2;
  uint uVar3;
  longlong lVar4;
  undefined8 *puVar5;
  void *_Src;
  int iVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  longlong lVar10;
  ulonglong uVar11;
  undefined1 auStack_a8 [32];
  int local_88;
  undefined4 local_84 [3];
  undefined8 local_78;
  undefined8 uStack_70;
  undefined8 local_68;
  undefined8 uStack_60;
  undefined8 local_58;
  undefined8 uStack_50;
  undefined8 local_48;
  undefined8 uStack_40;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_a8;
  cVar2 = FUN_1400bec30();
  *param_1 = 1;
  local_88 = (int)(*(int *)(param_1 + 0x48) + (*(int *)(param_1 + 0x48) >> 0x1f & 7U)) >> 3;
  local_78 = 0;
  uStack_70 = 0;
  local_68 = 0;
  uStack_60 = 0;
  local_58 = 0;
  uStack_50 = 0;
  local_48 = 0;
  uStack_40 = 0;
  uVar3 = FUN_1400b8b80(param_1 + 0x18);
  if (uVar3 < 0x41) {
    lVar4 = FUN_1400b8b90(param_1 + 0x18);
    if (lVar4 != 0) {
      uVar3 = FUN_1400b8b80(param_1 + 0x18);
      _Src = (void *)FUN_1400b8b90(param_1 + 0x18);
      memcpy(&local_78,_Src,(ulonglong)uVar3);
    }
  }
  else {
    lVar4 = FUN_1400b8b90(param_1 + 0x18);
    if (lVar4 != 0) {
      puVar5 = (undefined8 *)FUN_1400b8b90(param_1 + 0x18);
      local_78 = *puVar5;
      uStack_70 = puVar5[1];
      local_68 = puVar5[2];
      uStack_60 = puVar5[3];
      local_58 = puVar5[4];
      uStack_50 = puVar5[5];
      local_48 = puVar5[6];
      uStack_40 = puVar5[7];
    }
  }
  uVar7 = 0;
  uVar9 = uVar7;
  do {
    *(undefined4 *)(uVar9 + *(longlong *)(param_1 + 8)) =
         *(undefined4 *)((longlong)&DAT_1402f9d50 + uVar9);
    *(undefined4 *)(uVar9 + 4 + *(longlong *)(param_1 + 8)) =
         *(undefined4 *)((longlong)&DAT_1402f9d54 + uVar9);
    uVar8 = uVar9 + 0x18;
    *(undefined4 *)(uVar9 + 8 + *(longlong *)(param_1 + 8)) =
         *(undefined4 *)((longlong)&DAT_1402f9d58 + uVar9);
    *(undefined4 *)(uVar9 + 0xc + *(longlong *)(param_1 + 8)) =
         *(undefined4 *)((longlong)&DAT_1402f9d5c + uVar9);
    *(undefined4 *)(uVar9 + 0x10 + *(longlong *)(param_1 + 8)) =
         *(undefined4 *)((longlong)&DAT_1402f9d60 + uVar9);
    *(undefined4 *)(uVar9 + 0x14 + *(longlong *)(param_1 + 8)) =
         *(undefined4 *)((longlong)&DAT_1402f9d64 + uVar9);
    uVar11 = uVar7;
    uVar9 = uVar8;
  } while ((longlong)uVar8 < 0x48);
  do {
    lVar10 = 0x40;
    lVar4 = uVar11 + 0xc;
    do {
      *(undefined4 *)(uVar11 + *(longlong *)(param_1 + 0x10)) =
           *(undefined4 *)((longlong)&DAT_1402f9da0 + uVar11);
      *(undefined4 *)(uVar11 + 4 + *(longlong *)(param_1 + 0x10)) =
           *(undefined4 *)((longlong)&DAT_1402f9da4 + uVar11);
      uVar9 = uVar11 + 0x10;
      lVar10 = lVar10 + -1;
      *(undefined4 *)(uVar11 + 8 + *(longlong *)(param_1 + 0x10)) =
           *(undefined4 *)((longlong)&DAT_1402f9da8 + uVar11);
      *(undefined4 *)(lVar4 + *(longlong *)(param_1 + 0x10)) =
           *(undefined4 *)((longlong)&DAT_1402f9dac + uVar11);
      uVar11 = uVar9;
      lVar4 = lVar4 + 0x10;
    } while (lVar10 != 0);
  } while ((longlong)uVar9 < 0x1000);
  uVar9 = uVar7;
  uVar11 = uVar7;
  if (cVar2 == '\0') {
    do {
      iVar6 = (int)uVar9;
      *(uint *)(uVar11 + *(longlong *)(param_1 + 8)) =
           *(uint *)(uVar11 + *(longlong *)(param_1 + 8)) ^
           CONCAT31(CONCAT21(CONCAT11(*(undefined1 *)((longlong)&local_78 + (longlong)iVar6 + 3),
                                      *(undefined1 *)
                                       ((longlong)&local_78 + (longlong)((iVar6 + 2) % local_88))),
                             *(undefined1 *)
                              ((longlong)&local_78 + (longlong)((iVar6 + 1) % local_88))),
                    *(undefined1 *)((longlong)&local_78 + (longlong)(iVar6 % local_88)));
      uVar9 = (longlong)(iVar6 + 4) % (longlong)local_88;
      iVar6 = (int)uVar9;
      puVar1 = (uint *)(uVar11 + 4 + *(longlong *)(param_1 + 8));
      *puVar1 = *puVar1 ^ CONCAT31(CONCAT21(CONCAT11(*(undefined1 *)
                                                      ((longlong)&local_78 + (longlong)iVar6 + 3),
                                                     *(undefined1 *)
                                                      ((longlong)&local_78 +
                                                      (longlong)((iVar6 + 2) % local_88))),
                                            *(undefined1 *)
                                             ((longlong)&local_78 +
                                             (longlong)((iVar6 + 1) % local_88))),
                                   *(undefined1 *)
                                    ((longlong)&local_78 +
                                    (longlong)
                                    (int)((longlong)
                                          ((ulonglong)(uint)(iVar6 >> 0x1f) << 0x20 |
                                          uVar9 & 0xffffffff) % (longlong)local_88)));
      uVar9 = (longlong)(iVar6 + 4) % (longlong)local_88;
      iVar6 = (int)uVar9;
      puVar1 = (uint *)(uVar11 + 8 + *(longlong *)(param_1 + 8));
      *puVar1 = *puVar1 ^ CONCAT31(CONCAT21(CONCAT11(*(undefined1 *)
                                                      ((longlong)&local_78 + (longlong)iVar6 + 3),
                                                     *(undefined1 *)
                                                      ((longlong)&local_78 +
                                                      (longlong)((iVar6 + 2) % local_88))),
                                            *(undefined1 *)
                                             ((longlong)&local_78 +
                                             (longlong)((iVar6 + 1) % local_88))),
                                   *(undefined1 *)
                                    ((longlong)&local_78 +
                                    (longlong)
                                    (int)((longlong)
                                          ((ulonglong)(uint)(iVar6 >> 0x1f) << 0x20 |
                                          uVar9 & 0xffffffff) % (longlong)local_88)));
      uVar11 = uVar11 + 0xc;
      uVar9 = (longlong)(iVar6 + 4) % (longlong)local_88 & 0xffffffff;
    } while ((longlong)uVar11 < 0x48);
  }
  else {
    do {
      iVar6 = (int)uVar9;
      *(uint *)(uVar11 + *(longlong *)(param_1 + 8)) =
           *(uint *)(uVar11 + *(longlong *)(param_1 + 8)) ^
           CONCAT31(CONCAT21(CONCAT11(*(undefined1 *)((longlong)&local_78 + (longlong)iVar6),
                                      *(undefined1 *)
                                       ((longlong)&local_78 + (longlong)((iVar6 + 1) % local_88))),
                             *(undefined1 *)
                              ((longlong)&local_78 + (longlong)((iVar6 + 2) % local_88))),
                    *(undefined1 *)((longlong)&local_78 + (longlong)((iVar6 + 3) % local_88)));
      iVar6 = (iVar6 + 4) % local_88;
      puVar1 = (uint *)(uVar11 + 4 + *(longlong *)(param_1 + 8));
      *puVar1 = *puVar1 ^ CONCAT31(CONCAT21(CONCAT11(*(undefined1 *)
                                                      ((longlong)&local_78 + (longlong)iVar6),
                                                     *(undefined1 *)
                                                      ((longlong)&local_78 +
                                                      (longlong)((iVar6 + 1) % local_88))),
                                            *(undefined1 *)
                                             ((longlong)&local_78 +
                                             (longlong)((iVar6 + 2) % local_88))),
                                   *(undefined1 *)
                                    ((longlong)&local_78 + (longlong)((iVar6 + 3) % local_88)));
      iVar6 = (iVar6 + 4) % local_88;
      puVar1 = (uint *)(uVar11 + 8 + *(longlong *)(param_1 + 8));
      *puVar1 = *puVar1 ^ CONCAT31(CONCAT21(CONCAT11(*(undefined1 *)
                                                      ((longlong)&local_78 + (longlong)iVar6),
                                                     *(undefined1 *)
                                                      ((longlong)&local_78 +
                                                      (longlong)((iVar6 + 1) % local_88))),
                                            *(undefined1 *)
                                             ((longlong)&local_78 +
                                             (longlong)((iVar6 + 2) % local_88))),
                                   *(undefined1 *)
                                    ((longlong)&local_78 + (longlong)((iVar6 + 3) % local_88)));
      uVar11 = uVar11 + 0xc;
      uVar9 = (longlong)(iVar6 + 4) % (longlong)local_88 & 0xffffffff;
    } while ((longlong)uVar11 < 0x48);
  }
  local_84[0] = 0;
  local_88 = 0;
  uVar9 = uVar7;
  if (cVar2 == '\0') {
    do {
      FUN_1400dd980(param_1,local_84,&local_88);
      *(undefined4 *)(uVar9 + *(longlong *)(param_1 + 8)) = local_84[0];
      *(int *)(uVar9 + 4 + *(longlong *)(param_1 + 8)) = local_88;
      uVar9 = uVar9 + 8;
    } while ((longlong)uVar9 < 0x48);
    do {
      lVar4 = 0x80;
      do {
        FUN_1400dd980(param_1,local_84,&local_88);
        *(undefined4 *)(uVar7 + *(longlong *)(param_1 + 0x10)) = local_84[0];
        *(int *)(uVar7 + 4 + *(longlong *)(param_1 + 0x10)) = local_88;
        uVar7 = uVar7 + 8;
        lVar4 = lVar4 + -1;
      } while (lVar4 != 0);
    } while ((longlong)uVar7 < 0x1000);
  }
  else {
    do {
      FUN_1400dd520(param_1,local_84,&local_88);
      *(undefined4 *)(uVar9 + *(longlong *)(param_1 + 8)) = local_84[0];
      *(int *)(uVar9 + 4 + *(longlong *)(param_1 + 8)) = local_88;
      uVar9 = uVar9 + 8;
    } while ((longlong)uVar9 < 0x48);
    do {
      lVar4 = 0x80;
      do {
        FUN_1400dd520(param_1,local_84,&local_88);
        *(undefined4 *)(uVar7 + *(longlong *)(param_1 + 0x10)) = local_84[0];
        *(int *)(uVar7 + 4 + *(longlong *)(param_1 + 0x10)) = local_88;
        uVar7 = uVar7 + 8;
        lVar4 = lVar4 + -1;
      } while (lVar4 != 0);
    } while ((longlong)uVar7 < 0x1000);
  }
  *param_1 = 0;
  return;
}



ulonglong FUN_1400df730(undefined8 param_1,void *param_2,void *param_3,uint param_4)

{
  char cVar1;
  ulonglong _Size;
  ulonglong uVar2;
  
  _Size = (ulonglong)param_4;
  if ((((param_2 == (void *)0x0) || (param_3 == (void *)0x0)) || (param_2 == param_3)) ||
     ((param_4 & 7) != 0)) {
    _Size = 0;
  }
  else {
    cVar1 = FUN_1400bec30();
    memcpy(param_3,param_2,_Size);
    if (cVar1 == '\0') {
      if (param_4 != 0) {
        uVar2 = (ulonglong)((param_4 - 1 >> 3) + 1);
        do {
          FUN_1400de2d0(param_1,param_3,(longlong)param_3 + 4);
          param_3 = (void *)((longlong)param_3 + 8);
          uVar2 = uVar2 - 1;
        } while (uVar2 != 0);
      }
    }
    else if (param_4 != 0) {
      uVar2 = (ulonglong)((param_4 - 1 >> 3) + 1);
      do {
        FUN_1400dddf0(param_1,param_3,(longlong)param_3 + 4);
        param_3 = (void *)((longlong)param_3 + 8);
        uVar2 = uVar2 - 1;
      } while (uVar2 != 0);
    }
  }
  return _Size;
}



undefined8
FUN_1400df810(undefined8 param_1,void *param_2,void *param_3,uint param_4,longlong *param_5)

{
  char cVar1;
  undefined8 uVar2;
  ulonglong uVar3;
  
  if (param_2 == (void *)0x0) {
    (**(code **)(*param_5 + 0x28))(param_5,"NULL blowfish2 input.");
    uVar2 = 0;
  }
  else if (param_3 == (void *)0x0) {
    (**(code **)(*param_5 + 0x28))(param_5,"NULL blowfish2 output.");
    uVar2 = 0;
  }
  else if (param_2 == param_3) {
    (**(code **)(*param_5 + 0x28))(param_5,"blowfish2 input = output.");
    uVar2 = 0;
  }
  else if ((param_4 & 7) == 0) {
    cVar1 = FUN_1400bec30();
    memcpy(param_3,param_2,(ulonglong)param_4);
    if (cVar1 == '\0') {
      if (param_4 != 0) {
        uVar3 = (ulonglong)((param_4 - 1 >> 3) + 1);
        do {
          FUN_1400deca0(param_1,param_3,(longlong)param_3 + 4);
          param_3 = (void *)((longlong)param_3 + 8);
          uVar3 = uVar3 - 1;
        } while (uVar3 != 0);
      }
    }
    else if (param_4 != 0) {
      uVar3 = (ulonglong)((param_4 - 1 >> 3) + 1);
      do {
        FUN_1400de7c0(param_1,param_3,(longlong)param_3 + 4);
        param_3 = (void *)((longlong)param_3 + 8);
        uVar3 = uVar3 - 1;
      } while (uVar3 != 0);
    }
    uVar2 = 1;
  }
  else {
    (**(code **)(*param_5 + 0x28))
              (param_5,"Blowfish2 input size not a multiple of 8 (the blowfish block size)");
    FUN_1400cf520(param_5,"inputSizeInBytes",param_4);
    uVar2 = 0;
  }
  return uVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_1400df960(undefined8 param_1,void *param_2,void *param_3,uint param_4,undefined8 *param_5,
             longlong *param_6)

{
  undefined1 uVar1;
  undefined1 uVar2;
  undefined1 uVar3;
  undefined2 uVar4;
  uint6 uVar5;
  uint7 uVar6;
  undefined8 uVar7;
  undefined1 *puVar8;
  undefined1 auStack_98 [32];
  undefined1 local_78;
  char local_77;
  byte local_76;
  undefined1 local_75;
  undefined8 local_70;
  ulonglong local_68;
  undefined8 *local_60;
  undefined1 local_58 [3];
  undefined1 uStack_55;
  undefined4 uStack_54;
  ulonglong local_50;
  
  local_50 = DAT_1402f85a0 ^ (ulonglong)auStack_98;
  local_60 = param_5;
  local_70 = param_1;
  if (param_2 == (void *)0x0) {
    (**(code **)(*param_6 + 0x28))(param_6,"NULL blowfish2 input.");
    uVar7 = 0;
  }
  else if (param_3 == (void *)0x0) {
    (**(code **)(*param_6 + 0x28))(param_6,"NULL blowfish2 output.");
    uVar7 = 0;
  }
  else if (param_2 == param_3) {
    (**(code **)(*param_6 + 0x28))(param_6,"blowfish2 input = output.");
    uVar7 = 0;
  }
  else if ((param_4 & 7) == 0) {
    local_77 = FUN_1400bec30();
    memcpy(param_3,param_2,(ulonglong)param_4);
    _local_58 = *param_5;
    if (param_4 != 0) {
      local_68 = (ulonglong)((param_4 - 1 >> 3) + 1);
      puVar8 = (undefined1 *)((longlong)param_3 + 2);
      uVar7 = local_70;
      do {
        local_76 = puVar8[3];
        uVar4 = *(undefined2 *)(puVar8 + -2);
        uVar1 = *puVar8;
        uVar2 = puVar8[1];
        uVar3 = puVar8[2];
        local_75 = puVar8[4];
        local_78 = puVar8[5];
        if (local_77 == '\0') {
          FUN_1400deca0(local_70,puVar8 + -2,puVar8 + 2);
          uVar7 = local_70;
        }
        else {
          FUN_1400de7c0(uVar7);
        }
        *(uint *)(puVar8 + -2) = *(uint *)(puVar8 + -2) ^ _local_58;
        *(uint *)(puVar8 + 2) = *(uint *)(puVar8 + 2) ^ uStack_54;
        local_68 = local_68 - 1;
        _local_58 = (uint6)local_76 << 0x28;
        uVar5 = (uint6)_local_58 >> 0x18;
        local_58[2] = uVar1;
        local_58._0_2_ = uVar4;
        _local_58 = CONCAT16(local_75,CONCAT33((int3)uVar5,local_58));
        uVar6 = (uint7)_local_58 >> 0x20;
        _local_58 = CONCAT13(uVar2,local_58);
        _local_58 = CONCAT17(local_78,CONCAT34((int3)uVar6,_local_58));
        _local_58 = CONCAT14(uVar3,_local_58);
        puVar8 = puVar8 + 8;
        param_5 = local_60;
      } while (local_68 != 0);
    }
    *param_5 = _local_58;
    uVar7 = 1;
  }
  else {
    (**(code **)(*param_6 + 0x28))
              (param_6,"Blowfish2 input size not a multiple of 8 (the blowfish block size)");
    FUN_1400cf520(param_6,"inputSizeInBytes",(ulonglong)param_4);
    uVar7 = 0;
  }
  return uVar7;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

uint FUN_1400dfb50(undefined8 param_1,uint *param_2,uint *param_3,uint param_4,undefined8 *param_5)

{
  char cVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  uint *puVar4;
  undefined1 auStack_78 [32];
  uint local_58;
  uint local_54;
  undefined8 local_50;
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_78;
  if ((((param_2 == (uint *)0x0) || (param_3 == (uint *)0x0)) || (param_2 == param_3)) ||
     ((param_4 & 7) != 0)) {
    param_4 = 0;
  }
  else {
    uVar3 = *param_5;
    local_50 = uVar3;
    cVar1 = FUN_1400bec30();
    if (param_4 != 0) {
      uVar2 = (ulonglong)((param_4 - 1 >> 3) + 1);
      puVar4 = param_2;
      local_58 = local_50._4_4_;
      local_54 = (uint)local_50;
      do {
        local_54 = *puVar4 ^ local_54;
        local_58 = puVar4[1] ^ local_58;
        if (cVar1 == '\0') {
          FUN_1400de2d0(param_1,&local_54,&local_58);
        }
        else {
          FUN_1400dddf0();
        }
        puVar4 = puVar4 + 2;
        uVar2 = uVar2 - 1;
        *(uint *)((longlong)param_3 + (-8 - (longlong)param_2) + (longlong)puVar4) = local_54;
        *(uint *)((longlong)param_3 + (-4 - (longlong)param_2) + (longlong)puVar4) = local_58;
      } while (uVar2 != 0);
      local_50 = CONCAT44(local_58,local_54);
      uVar3 = local_50;
    }
    *param_5 = uVar3;
  }
  return param_4;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

uint FUN_1400dfc50(undefined8 param_1,uint *param_2,uint *param_3,uint param_4,undefined8 *param_5)

{
  char cVar1;
  uint *puVar2;
  ulonglong uVar3;
  undefined1 auStack_58 [32];
  undefined8 local_38;
  ulonglong local_30;
  
  local_30 = DAT_1402f85a0 ^ (ulonglong)auStack_58;
  if ((((param_2 == (uint *)0x0) || (param_3 == (uint *)0x0)) || (param_2 == param_3)) ||
     ((param_4 & 7) != 0)) {
    param_4 = 0;
  }
  else {
    cVar1 = FUN_1400bec30();
    local_38 = *param_5;
    if (param_4 != 0) {
      uVar3 = (ulonglong)((param_4 - 1 >> 3) + 1);
      puVar2 = param_3;
      do {
        if (cVar1 == '\0') {
          FUN_1400de2d0(param_1,&local_38,(longlong)&local_38 + 4);
        }
        else {
          FUN_1400dddf0();
        }
        *puVar2 = *(uint *)((longlong)puVar2 + ((longlong)param_2 - (longlong)param_3)) ^
                  (uint)local_38;
        local_38._4_4_ =
             *(uint *)((longlong)puVar2 + ((longlong)param_2 - (longlong)param_3) + 4) ^
             local_38._4_4_;
        uVar3 = uVar3 - 1;
        puVar2[1] = local_38._4_4_;
        local_38 = CONCAT44(local_38._4_4_,*puVar2);
        puVar2 = puVar2 + 2;
      } while (uVar3 != 0);
    }
    *param_5 = local_38;
  }
  return param_4;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_1400dfd50(undefined8 param_1,uint *param_2,uint *param_3,uint param_4,undefined8 *param_5,
             longlong *param_6)

{
  char cVar1;
  undefined8 uVar2;
  uint *puVar3;
  uint *puVar4;
  uint *puVar5;
  ulonglong uVar6;
  undefined1 auStack_78 [32];
  undefined8 local_58;
  ulonglong local_50;
  
  local_50 = DAT_1402f85a0 ^ (ulonglong)auStack_78;
  if (param_2 == (uint *)0x0) {
    (**(code **)(*param_6 + 0x28))(param_6,"NULL blowfish2 input.");
    uVar2 = 0;
  }
  else if (param_3 == (uint *)0x0) {
    (**(code **)(*param_6 + 0x28))(param_6,"NULL blowfish2 output.");
    uVar2 = 0;
  }
  else if (param_2 == param_3) {
    (**(code **)(*param_6 + 0x28))(param_6,"blowfish2 input = output.");
    uVar2 = 0;
  }
  else if ((param_4 & 7) == 0) {
    cVar1 = FUN_1400bec30();
    memcpy(param_3,param_2,(ulonglong)param_4);
    local_58 = *param_5;
    if (param_4 != 0) {
      uVar6 = (ulonglong)((param_4 - 1 >> 3) + 1);
      puVar3 = param_2;
      puVar5 = param_2 + 1;
      do {
        if (cVar1 == '\0') {
          FUN_1400de2d0(param_1,&local_58,(longlong)&local_58 + 4);
        }
        else {
          FUN_1400dddf0();
        }
        puVar4 = puVar3 + 2;
        *(uint *)((longlong)param_3 + (-8 - (longlong)param_2) + (longlong)puVar4) =
             *puVar3 ^ (uint)local_58;
        uVar6 = uVar6 - 1;
        *(uint *)((longlong)param_3 + (-4 - (longlong)param_2) + (longlong)puVar4) =
             *puVar5 ^ local_58._4_4_;
        local_58 = CONCAT44(*puVar5,*puVar3);
        puVar3 = puVar4;
        puVar5 = puVar5 + 2;
      } while (uVar6 != 0);
    }
    *param_5 = local_58;
    uVar2 = 1;
  }
  else {
    (**(code **)(*param_6 + 0x28))
              (param_6,"Blowfish2 input size not a multiple of 8 (the blowfish block size)");
    FUN_1400cf520(param_6,"inputSizeInBytes",param_4);
    uVar2 = 0;
  }
  return uVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400dfed0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined1 auStack_88 [32];
  void **local_68;
  undefined8 local_58;
  void *local_50;
  ulonglong local_48;
  
  local_58 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    local_50 = operator_new(0x28);
    if (local_50 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(local_50);
    }
  }
  else {
    local_50 = operator_new(0x28);
    if (local_50 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(local_50);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar4,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x3f8,iVar2 + 0x20);
      uVar4 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar4,uVar3);
      FUN_1400df180(param_1);
      if (*(int *)(param_1 + 0x4c) == 1) {
        uVar3 = FUN_1400b8b80(param_2);
        uVar5 = FUN_1400b8b90(uVar4);
        uVar6 = FUN_1400b8b90(param_2);
        FUN_1400df730(param_1,uVar6,uVar5,uVar3);
      }
      else {
        local_50 = *(void **)(param_1 + 0x40);
        if (*(int *)(param_1 + 0x4c) == 0) {
          uVar3 = FUN_1400b8b80(param_2);
          uVar5 = FUN_1400b8b90(uVar4);
          uVar6 = FUN_1400b8b90(param_2);
          local_68 = &local_50;
          FUN_1400dfb50(param_1,uVar6,uVar5,uVar3);
        }
        else {
          uVar3 = FUN_1400b8b80(param_2);
          uVar5 = FUN_1400b8b90(uVar4);
          uVar6 = FUN_1400b8b90(param_2);
          local_68 = &local_50;
          FUN_1400dfc50(param_1,uVar6,uVar5,uVar3);
        }
        FUN_1400b8b30(param_3);
        FUN_1400b97e0(param_3,&local_50,8);
      }
    }
  }
  return uVar4;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400e00a0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 *puVar7;
  undefined1 auStack_88 [32];
  void **local_68;
  undefined8 local_58;
  void *local_50;
  ulonglong local_48;
  
  local_58 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    local_50 = operator_new(0x28);
    if (local_50 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(local_50);
    }
  }
  else {
    local_50 = operator_new(0x28);
    if (local_50 == (void *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1400b8c40(local_50);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar4,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x3f9,iVar2 + 0x20);
      uVar4 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar4,uVar3);
      if (*(int *)(param_1 + 0x4c) == 1) {
        uVar3 = FUN_1400b8b80(param_2);
        uVar5 = FUN_1400b8b90(uVar4);
        uVar6 = FUN_1400b8b90(param_2);
        FUN_1400df730(param_1,uVar6,uVar5,uVar3);
      }
      else {
        if (*(int *)(param_1 + 0x4c) == 0) {
          puVar7 = (undefined8 *)FUN_1400b8b90(param_3);
          local_50 = (void *)*puVar7;
          uVar3 = FUN_1400b8b80(param_2);
          uVar5 = FUN_1400b8b90(uVar4);
          uVar6 = FUN_1400b8b90(param_2);
          local_68 = &local_50;
          FUN_1400dfb50(param_1,uVar6,uVar5,uVar3);
        }
        else {
          puVar7 = (undefined8 *)FUN_1400b8b90(param_3);
          local_50 = (void *)*puVar7;
          uVar3 = FUN_1400b8b80(param_2);
          uVar5 = FUN_1400b8b90(uVar4);
          uVar6 = FUN_1400b8b90(param_2);
          local_68 = &local_50;
          FUN_1400dfc50(param_1,uVar6,uVar5,uVar3);
        }
        FUN_1400b8b30(param_3);
        FUN_1400b97e0(param_3,&local_50,8);
      }
    }
  }
  return uVar4;
}



undefined8 FUN_1400e0280(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined8 *puVar8;
  void *local_28;
  undefined8 local_20;
  
  local_20 = 0xfffffffffffffffe;
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    local_28 = operator_new(0x28);
    if (local_28 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(local_28);
    }
  }
  else {
    iVar2 = FUN_1400b8b80(param_2);
    FUN_1400b9a00(param_2,*(undefined4 *)(param_1 + 0x50),8);
    local_28 = operator_new(0x28);
    if (local_28 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(local_28);
    }
    iVar3 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar5,iVar3 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x3fa,iVar2 + 0x20);
      uVar5 = 0;
    }
    else {
      uVar4 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar5,uVar4);
      if (*(int *)(param_1 + 0x4c) == 1) {
        uVar4 = FUN_1400b8b80(param_2);
        uVar6 = FUN_1400b8b90(uVar5);
        uVar7 = FUN_1400b8b90(param_2);
        FUN_1400df730(param_1,uVar7,uVar6,uVar4);
      }
      else if (*(int *)(param_1 + 0x4c) == 0) {
        puVar8 = (undefined8 *)FUN_1400b8b90(param_3);
        local_28 = (void *)*puVar8;
        uVar4 = FUN_1400b8b80(param_2);
        uVar6 = FUN_1400b8b90(uVar5);
        uVar7 = FUN_1400b8b90(param_2);
        FUN_1400dfb50(param_1,uVar7,uVar6,uVar4,&local_28);
      }
      else {
        puVar8 = (undefined8 *)FUN_1400b8b90(param_3);
        local_28 = (void *)*puVar8;
        uVar4 = FUN_1400b8b80(param_2);
        uVar6 = FUN_1400b8b90(uVar5);
        uVar7 = FUN_1400b8b90(param_2);
        FUN_1400dfc50(param_1,uVar7,uVar6,uVar4,&local_28);
      }
      iVar3 = FUN_1400b8b80(param_2);
      if (iVar3 - iVar2 != 0) {
        FUN_1400b8be0(param_2,iVar3 - iVar2);
      }
    }
  }
  return uVar5;
}



undefined8 FUN_1400e0470(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  void *local_res20;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    local_res20 = operator_new(0x28);
    if (local_res20 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(local_res20);
    }
  }
  else {
    iVar2 = FUN_1400b8b80(param_2);
    FUN_1400b9a00(param_2,*(undefined4 *)(param_1 + 0x50),8);
    local_res20 = operator_new(0x28);
    if (local_res20 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(local_res20);
    }
    iVar3 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar5,iVar3 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,0x3fb,iVar2 + 0x20);
      uVar5 = 0;
    }
    else {
      uVar4 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar5,uVar4);
      FUN_1400df180(param_1);
      if (*(int *)(param_1 + 0x4c) == 1) {
        uVar4 = FUN_1400b8b80(param_2);
        uVar6 = FUN_1400b8b90(uVar5);
        uVar7 = FUN_1400b8b90(param_2);
        FUN_1400df730(param_1,uVar7,uVar6,uVar4);
      }
      else {
        local_res20 = *(void **)(param_1 + 0x40);
        if (*(int *)(param_1 + 0x4c) == 0) {
          uVar4 = FUN_1400b8b80(param_2);
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400dfb50(param_1,uVar7,uVar6,uVar4,&local_res20);
        }
        else {
          uVar4 = FUN_1400b8b80(param_2);
          uVar6 = FUN_1400b8b90(uVar5);
          uVar7 = FUN_1400b8b90(param_2);
          FUN_1400dfc50(param_1,uVar7,uVar6,uVar4,&local_res20);
        }
      }
      iVar3 = FUN_1400b8b80(param_2);
      if (iVar3 - iVar2 != 0) {
        FUN_1400b8be0(param_2,iVar3 - iVar2);
      }
    }
  }
  return uVar5;
}



undefined8 * FUN_1400e0650(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  void *local_res20;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    local_res20 = operator_new(0x28);
    if (local_res20 == (void *)0x0) {
      puVar4 = (undefined8 *)0x0;
    }
    else {
      puVar4 = (undefined8 *)FUN_1400b8c40(local_res20);
    }
  }
  else {
    FUN_1400df180(param_1);
    local_res20 = operator_new(0x28);
    puVar4 = (undefined8 *)0x0;
    puVar5 = puVar4;
    if (local_res20 != (void *)0x0) {
      puVar5 = (undefined8 *)FUN_1400b8c40(local_res20);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(puVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,0x3fc,iVar2 + 0x20);
      puVar4 = (undefined8 *)0x0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(puVar5,uVar3);
      if (*(int *)(param_1 + 0x4c) == 1) {
        uVar3 = FUN_1400b8b80(param_2);
        uVar6 = FUN_1400b8b90(puVar5);
        uVar7 = FUN_1400b8b90(param_2);
        cVar1 = FUN_1400df810(param_1,uVar7,uVar6,uVar3,param_3);
      }
      else {
        local_res20 = *(void **)(param_1 + 0x40);
        if (*(int *)(param_1 + 0x4c) == 0) {
          uVar3 = FUN_1400b8b80(param_2);
          uVar6 = FUN_1400b8b90(puVar5);
          uVar7 = FUN_1400b8b90(param_2);
          cVar1 = FUN_1400df960(param_1,uVar7,uVar6,uVar3,&local_res20,param_3);
        }
        else {
          uVar3 = FUN_1400b8b80(param_2);
          uVar6 = FUN_1400b8b90(puVar5);
          uVar7 = FUN_1400b8b90(param_2);
          cVar1 = FUN_1400dfd50(param_1,uVar7,uVar6,uVar3,&local_res20,param_3);
        }
      }
      if (cVar1 == '\0') {
        if (puVar5 != (undefined8 *)0x0) {
          (**(code **)*puVar5)(puVar5,1);
        }
      }
      else {
        FUN_1400b9c60(puVar5,*(undefined4 *)(param_1 + 0x50),8,param_3);
        puVar4 = puVar5;
      }
    }
  }
  return puVar4;
}



undefined8 *
FUN_1400e0850(longlong param_1,undefined8 param_2,undefined8 *param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  undefined8 *puVar9;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      puVar5 = (undefined8 *)0x0;
    }
    else {
      puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
  }
  else {
    FUN_1400df180(param_1);
    pvVar4 = operator_new(0x28);
    puVar9 = (undefined8 *)0x0;
    puVar6 = puVar9;
    if (pvVar4 != (void *)0x0) {
      puVar6 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(puVar6,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x3fd,iVar2 + 0x20);
      puVar5 = (undefined8 *)0x0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(puVar6,uVar3);
      iVar2 = *(int *)(param_1 + 0x4c);
      if (iVar2 == 1) {
        uVar3 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(puVar6);
        uVar8 = FUN_1400b8b90(param_2);
        cVar1 = FUN_1400df810(param_1,uVar8,uVar7,uVar3,param_4);
      }
      else {
        *param_3 = *(undefined8 *)(param_1 + 0x40);
        if (iVar2 == 0) {
          uVar3 = FUN_1400b8b80(param_2);
          uVar7 = FUN_1400b8b90(puVar6);
          uVar8 = FUN_1400b8b90(param_2);
          cVar1 = FUN_1400df960(param_1,uVar8,uVar7,uVar3,param_3,param_4);
        }
        else {
          uVar3 = FUN_1400b8b80(param_2);
          uVar7 = FUN_1400b8b90(puVar6);
          uVar8 = FUN_1400b8b90(param_2);
          cVar1 = FUN_1400dfd50(param_1,uVar8,uVar7,uVar3,param_3,param_4);
        }
      }
      puVar5 = puVar6;
      if ((cVar1 == '\0') && (puVar5 = puVar9, puVar6 != (undefined8 *)0x0)) {
        (**(code **)*puVar6)(puVar6,1);
      }
    }
  }
  return puVar5;
}



undefined8 *
FUN_1400e0a30(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  undefined8 *puVar9;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      puVar5 = (undefined8 *)0x0;
    }
    else {
      puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
  }
  else {
    pvVar4 = operator_new(0x28);
    puVar9 = (undefined8 *)0x0;
    puVar6 = puVar9;
    if (pvVar4 != (void *)0x0) {
      puVar6 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(puVar6,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x3fe,iVar2 + 0x20);
      puVar5 = (undefined8 *)0x0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(puVar6,uVar3);
      if (*(int *)(param_1 + 0x4c) == 1) {
        uVar3 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(puVar6);
        uVar8 = FUN_1400b8b90(param_2);
        cVar1 = FUN_1400df810(param_1,uVar8,uVar7,uVar3,param_4);
      }
      else if (*(int *)(param_1 + 0x4c) == 0) {
        uVar3 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(puVar6);
        uVar8 = FUN_1400b8b90(param_2);
        cVar1 = FUN_1400df960(param_1,uVar8,uVar7,uVar3,param_3,param_4);
      }
      else {
        uVar3 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(puVar6);
        uVar8 = FUN_1400b8b90(param_2);
        cVar1 = FUN_1400dfd50(param_1,uVar8,uVar7,uVar3,param_3,param_4);
      }
      puVar5 = puVar6;
      if ((cVar1 == '\0') && (puVar5 = puVar9, puVar6 != (undefined8 *)0x0)) {
        (**(code **)*puVar6)(puVar6,1);
      }
    }
  }
  return puVar5;
}



undefined8 *
FUN_1400e0bf0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      puVar5 = (undefined8 *)0x0;
    }
    else {
      puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
  }
  else {
    pvVar4 = operator_new(0x28);
    puVar5 = (undefined8 *)0x0;
    puVar6 = puVar5;
    if (pvVar4 != (void *)0x0) {
      puVar6 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(puVar6,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x3ff,iVar2 + 0x20);
      puVar5 = (undefined8 *)0x0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(puVar6,uVar3);
      if (*(int *)(param_1 + 0x4c) == 1) {
        uVar3 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(puVar6);
        uVar8 = FUN_1400b8b90(param_2);
        cVar1 = FUN_1400df810(param_1,uVar8,uVar7,uVar3,param_4);
      }
      else if (*(int *)(param_1 + 0x4c) == 0) {
        uVar3 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(puVar6);
        uVar8 = FUN_1400b8b90(param_2);
        cVar1 = FUN_1400df960(param_1,uVar8,uVar7,uVar3,param_3,param_4);
      }
      else {
        uVar3 = FUN_1400b8b80(param_2);
        uVar7 = FUN_1400b8b90(puVar6);
        uVar8 = FUN_1400b8b90(param_2);
        cVar1 = FUN_1400dfd50(param_1,uVar8,uVar7,uVar3,param_3,param_4);
      }
      if (cVar1 == '\0') {
        if (puVar6 != (undefined8 *)0x0) {
          (**(code **)*puVar6)(puVar6,1);
        }
      }
      else {
        FUN_1400b9c60(puVar6,*(undefined4 *)(param_1 + 0x50),8,param_4);
        puVar5 = puVar6;
      }
    }
  }
  return puVar5;
}



void FUN_1400e0dd0(longlong param_1,int param_2)

{
  uint uVar1;
  
  if (0x1c0 < param_2) {
    param_2 = 0x1c0;
  }
  uVar1 = param_2 + (param_2 >> 0x1f & 7U) & 0xfffffff8;
  if ((int)uVar1 < 0x28) {
    uVar1 = 0x28;
  }
  *(uint *)(param_1 + 0x10) = uVar1;
  return;
}



void FUN_1400e0e00(longlong param_1,undefined8 param_2)

{
  FUN_1400b8b30(param_1 + 0x20);
  FUN_1400b9e90(param_1 + 0x20,param_2);
  return;
}



void FUN_1400e0e30(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x14) = param_2;
  return;
}



void FUN_1400e0e40(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 0x18) = param_2;
  return;
}



undefined8 * FUN_1400e0e50(undefined8 *param_1)

{
  void *pvVar1;
  
  param_1[2] = 0x80;
  *(undefined1 *)(param_1 + 3) = 0;
  FUN_1400b8c40(param_1 + 4);
  pvVar1 = operator_new(0x48);
  *param_1 = pvVar1;
  pvVar1 = operator_new(0x1000);
  param_1[1] = pvVar1;
  return param_1;
}



void FUN_1400e0ea0(undefined8 *param_1)

{
  operator_delete((void *)*param_1);
  operator_delete((void *)param_1[1]);
  FUN_1400b92d0(param_1 + 4);
  return;
}



void FUN_1400e0ee0(undefined8 *param_1,uint *param_2,uint *param_3)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  longlong lVar4;
  uint uVar5;
  uint uVar6;
  
  lVar2 = param_1[1];
  puVar3 = (uint *)*param_1;
  uVar6 = *param_2 ^ *puVar3;
  uVar5 = (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 0x10) * 4) +
           *(int *)(lVar2 + (ulonglong)(uVar6 >> 0x18) * 4) ^
          *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 8) * 4)) +
          *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 & 0xff) * 4) ^ puVar3[1] ^ *param_3;
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar5 >> 0x10) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar5 >> 0x18) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar5 >> 8) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar5 & 0xff) * 4) ^ puVar3[2];
  uVar5 = uVar5 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 0x10) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 >> 0x18) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 8) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 & 0xff) * 4) ^ puVar3[3];
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar5 >> 0x10) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar5 >> 0x18) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar5 >> 8) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar5 & 0xff) * 4) ^ puVar3[4];
  lVar4 = param_1[1];
  uVar5 = uVar5 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 0x10) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 >> 0x18) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 8) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 & 0xff) * 4) ^ puVar3[5];
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar5 >> 0x10) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar5 >> 0x18) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar5 >> 8) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar5 & 0xff) * 4) ^ puVar3[6];
  uVar5 = uVar5 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar6 >> 0x10) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar6 >> 0x18) * 4) ^
                  *(uint *)(lVar2 + 0x800 + (ulonglong)(byte)(uVar6 >> 8) * 4)) +
                  *(int *)(lVar2 + 0xc00 + (ulonglong)(uVar6 & 0xff) * 4) ^ puVar3[7];
  uVar6 = uVar6 ^ (*(int *)(lVar2 + 0x400 + (ulonglong)(byte)(uVar5 >> 0x10) * 4) +
                   *(int *)(lVar2 + (ulonglong)(uVar5 >> 0x18) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar5 >> 8) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar5 & 0xff) * 4) ^ puVar3[8];
  uVar5 = uVar5 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar6 >> 0x10) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar6 >> 0x18) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar6 >> 8) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar6 & 0xff) * 4) ^ puVar3[9];
  uVar6 = uVar6 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar5 >> 0x10) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar5 >> 0x18) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar5 >> 8) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar5 & 0xff) * 4) ^ puVar3[10];
  uVar5 = uVar5 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar6 >> 0x10) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar6 >> 0x18) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar6 >> 8) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar6 & 0xff) * 4) ^ puVar3[0xb];
  uVar6 = uVar6 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar5 >> 0x10) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar5 >> 0x18) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar5 >> 8) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar5 & 0xff) * 4) ^ puVar3[0xc];
  uVar5 = uVar5 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar6 >> 0x10) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar6 >> 0x18) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar6 >> 8) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar6 & 0xff) * 4) ^ puVar3[0xd];
  uVar6 = uVar6 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar5 >> 0x10) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar5 >> 0x18) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar5 >> 8) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar5 & 0xff) * 4) ^ puVar3[0xe];
  uVar5 = uVar5 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar6 >> 0x10) * 4) +
                   *(int *)(lVar4 + (ulonglong)(uVar6 >> 0x18) * 4) ^
                  *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar6 >> 8) * 4)) +
                  *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar6 & 0xff) * 4) ^ puVar3[0xf];
  uVar1 = puVar3[0x11];
  *param_3 = uVar6 ^ (*(int *)(lVar4 + 0x400 + (ulonglong)(byte)(uVar5 >> 0x10) * 4) +
                      *(int *)(lVar4 + (ulonglong)(uVar5 >> 0x18) * 4) ^
                     *(uint *)(lVar4 + 0x800 + (ulonglong)(byte)(uVar5 >> 8) * 4)) +
                     *(int *)(lVar4 + 0xc00 + (ulonglong)(uVar5 & 0xff) * 4) ^ puVar3[0x10];
  *param_2 = uVar5 ^ uVar1;
  return;
}



void FUN_1400e1340(undefined8 *param_1,uint *param_2,uint *param_3)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  uint uVar5;
  longlong lVar6;
  uint *puVar7;
  longlong lVar8;
  uint uVar9;
  uint uVar10;
  
  lVar6 = param_1[1];
  puVar7 = (uint *)*param_1;
  uVar10 = puVar7[0x11] ^ *param_2;
  uVar9 = (*(int *)(lVar6 + 0x400 + (ulonglong)(byte)(uVar10 >> 0x10) * 4) +
           *(int *)(lVar6 + (ulonglong)(uVar10 >> 0x18) * 4) ^
          *(uint *)(lVar6 + 0x800 + (ulonglong)(byte)(uVar10 >> 8) * 4)) +
          *(int *)(lVar6 + 0xc00 + (ulonglong)(uVar10 & 0xff) * 4) ^ puVar7[0x10] ^ *param_3;
  uVar10 = uVar10 ^ (*(int *)(lVar6 + 0x400 + (ulonglong)(byte)(uVar9 >> 0x10) * 4) +
                     *(int *)(lVar6 + (ulonglong)(uVar9 >> 0x18) * 4) ^
                    *(uint *)(lVar6 + 0x800 + (ulonglong)(byte)(uVar9 >> 8) * 4)) +
                    *(int *)(lVar6 + 0xc00 + (ulonglong)(uVar9 & 0xff) * 4) ^ puVar7[0xf];
  uVar9 = uVar9 ^ (*(int *)(lVar6 + 0x400 + (ulonglong)(byte)(uVar10 >> 0x10) * 4) +
                   *(int *)(lVar6 + (ulonglong)(uVar10 >> 0x18) * 4) ^
                  *(uint *)(lVar6 + 0x800 + (ulonglong)(byte)(uVar10 >> 8) * 4)) +
                  *(int *)(lVar6 + 0xc00 + (ulonglong)(uVar10 & 0xff) * 4) ^ puVar7[0xe];
  uVar10 = uVar10 ^ (*(int *)(lVar6 + 0x400 + (ulonglong)(byte)(uVar9 >> 0x10) * 4) +
                     *(int *)(lVar6 + (ulonglong)(uVar9 >> 0x18) * 4) ^
                    *(uint *)(lVar6 + 0x800 + (ulonglong)(byte)(uVar9 >> 8) * 4)) +
                    *(int *)(lVar6 + 0xc00 + (ulonglong)(uVar9 & 0xff) * 4) ^ puVar7[0xd];
  uVar9 = uVar9 ^ (*(int *)(lVar6 + 0x400 + (ulonglong)(byte)(uVar10 >> 0x10) * 4) +
                   *(int *)(lVar6 + (ulonglong)(uVar10 >> 0x18) * 4) ^
                  *(uint *)(lVar6 + 0x800 + (ulonglong)(byte)(uVar10 >> 8) * 4)) +
                  *(int *)(lVar6 + 0xc00 + (ulonglong)(uVar10 & 0xff) * 4) ^ puVar7[0xc];
  uVar10 = uVar10 ^ (*(int *)(lVar6 + 0x400 + (ulonglong)(byte)(uVar9 >> 0x10) * 4) +
                     *(int *)(lVar6 + (ulonglong)(uVar9 >> 0x18) * 4) ^
                    *(uint *)(lVar6 + 0x800 + (ulonglong)(byte)(uVar9 >> 8) * 4)) +
                    *(int *)(lVar6 + 0xc00 + (ulonglong)(uVar9 & 0xff) * 4) ^ puVar7[0xb];
  lVar8 = param_1[1];
  uVar9 = uVar9 ^ (*(int *)(lVar6 + 0x400 + (ulonglong)(byte)(uVar10 >> 0x10) * 4) +
                   *(int *)(lVar6 + (ulonglong)(uVar10 >> 0x18) * 4) ^
                  *(uint *)(lVar6 + 0x800 + (ulonglong)(byte)(uVar10 >> 8) * 4)) +
                  *(int *)(lVar6 + 0xc00 + (ulonglong)(uVar10 & 0xff) * 4) ^ puVar7[10];
  uVar10 = uVar10 ^ (*(int *)(lVar8 + 0x400 + (ulonglong)(byte)(uVar9 >> 0x10) * 4) +
                     *(int *)(lVar8 + (ulonglong)(uVar9 >> 0x18) * 4) ^
                    *(uint *)(lVar8 + 0x800 + (ulonglong)(byte)(uVar9 >> 8) * 4)) +
                    *(int *)(lVar8 + 0xc00 + (ulonglong)(uVar9 & 0xff) * 4) ^ puVar7[9];
  uVar9 = uVar9 ^ (*(int *)(lVar8 + 0x400 + (ulonglong)(byte)(uVar10 >> 0x10) * 4) +
                   *(int *)(lVar8 + (ulonglong)(uVar10 >> 0x18) * 4) ^
                  *(uint *)(lVar8 + 0x800 + (ulonglong)(byte)(uVar10 >> 8) * 4)) +
                  *(int *)(lVar8 + 0xc00 + (ulonglong)(uVar10 & 0xff) * 4) ^ puVar7[8];
  uVar10 = uVar10 ^ (*(int *)(lVar8 + 0x400 + (ulonglong)(byte)(uVar9 >> 0x10) * 4) +
                     *(int *)(lVar8 + (ulonglong)(uVar9 >> 0x18) * 4) ^
                    *(uint *)(lVar8 + 0x800 + (ulonglong)(byte)(uVar9 >> 8) * 4)) +
                    *(int *)(lVar8 + 0xc00 + (ulonglong)(uVar9 & 0xff) * 4) ^ puVar7[7];
  uVar9 = uVar9 ^ (*(int *)(lVar8 + 0x400 + (ulonglong)(byte)(uVar10 >> 0x10) * 4) +
                   *(int *)(lVar8 + (ulonglong)(uVar10 >> 0x18) * 4) ^
                  *(uint *)(lVar8 + 0x800 + (ulonglong)(byte)(uVar10 >> 8) * 4)) +
                  *(int *)(lVar8 + 0xc00 + (ulonglong)(uVar10 & 0xff) * 4) ^ puVar7[6];
  uVar10 = uVar10 ^ (*(int *)(lVar8 + 0x400 + (ulonglong)(byte)(uVar9 >> 0x10) * 4) +
                     *(int *)(lVar8 + (ulonglong)(uVar9 >> 0x18) * 4) ^
                    *(uint *)(lVar8 + 0x800 + (ulonglong)(byte)(uVar9 >> 8) * 4)) +
                    *(int *)(lVar8 + 0xc00 + (ulonglong)(uVar9 & 0xff) * 4) ^ puVar7[5];
  uVar9 = uVar9 ^ (*(int *)(lVar8 + 0x400 + (ulonglong)(byte)(uVar10 >> 0x10) * 4) +
                   *(int *)(lVar8 + (ulonglong)(uVar10 >> 0x18) * 4) ^
                  *(uint *)(lVar8 + 0x800 + (ulonglong)(byte)(uVar10 >> 8) * 4)) +
                  *(int *)(lVar8 + 0xc00 + (ulonglong)(uVar10 & 0xff) * 4) ^ puVar7[4];
  uVar10 = uVar10 ^ (*(int *)(lVar8 + 0x400 + (ulonglong)(byte)(uVar9 >> 0x10) * 4) +
                     *(int *)(lVar8 + (ulonglong)(uVar9 >> 0x18) * 4) ^
                    *(uint *)(lVar8 + 0x800 + (ulonglong)(byte)(uVar9 >> 8) * 4)) +
                    *(int *)(lVar8 + 0xc00 + (ulonglong)(uVar9 & 0xff) * 4) ^ puVar7[3];
  uVar9 = uVar9 ^ (*(int *)(lVar8 + 0x400 + (ulonglong)(byte)(uVar10 >> 0x10) * 4) +
                   *(int *)(lVar8 + (ulonglong)(uVar10 >> 0x18) * 4) ^
                  *(uint *)(lVar8 + 0x800 + (ulonglong)(byte)(uVar10 >> 8) * 4)) +
                  *(int *)(lVar8 + 0xc00 + (ulonglong)(uVar10 & 0xff) * 4) ^ puVar7[2];
  iVar1 = *(int *)(lVar8 + 0x400 + (ulonglong)(byte)(uVar9 >> 0x10) * 4);
  iVar2 = *(int *)(lVar8 + (ulonglong)(uVar9 >> 0x18) * 4);
  uVar3 = *(uint *)(lVar8 + 0x800 + (ulonglong)(byte)(uVar9 >> 8) * 4);
  iVar4 = *(int *)(lVar8 + 0xc00 + (ulonglong)(uVar9 & 0xff) * 4);
  uVar5 = puVar7[1];
  *param_2 = *puVar7 ^ uVar9;
  *param_3 = uVar10 ^ (iVar1 + iVar2 ^ uVar3) + iVar4 ^ uVar5;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400e17a0(longlong *param_1)

{
  uint *puVar1;
  uint uVar2;
  longlong lVar3;
  undefined8 *puVar4;
  void *_Src;
  int iVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  longlong lVar10;
  longlong lVar11;
  undefined1 auStack_a8 [32];
  int local_88;
  undefined4 local_84 [3];
  undefined8 local_78;
  undefined8 uStack_70;
  undefined8 local_68;
  undefined8 uStack_60;
  undefined8 local_58;
  undefined8 uStack_50;
  undefined8 local_48;
  undefined8 uStack_40;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_a8;
  local_88 = (int)((int)param_1[2] + ((int)param_1[2] >> 0x1f & 7U)) >> 3;
  local_78 = 0;
  uStack_70 = 0;
  local_68 = 0;
  uStack_60 = 0;
  local_58 = 0;
  uStack_50 = 0;
  local_48 = 0;
  uStack_40 = 0;
  uVar2 = FUN_1400b8b80(param_1 + 4);
  if (uVar2 < 0x41) {
    lVar3 = FUN_1400b8b90(param_1 + 4);
    if (lVar3 != 0) {
      uVar2 = FUN_1400b8b80(param_1 + 4);
      _Src = (void *)FUN_1400b8b90(param_1 + 4);
      memcpy(&local_78,_Src,(ulonglong)uVar2);
    }
  }
  else {
    lVar3 = FUN_1400b8b90(param_1 + 4);
    if (lVar3 != 0) {
      puVar4 = (undefined8 *)FUN_1400b8b90(param_1 + 4);
      local_78 = *puVar4;
      uStack_70 = puVar4[1];
      local_68 = puVar4[2];
      uStack_60 = puVar4[3];
      local_58 = puVar4[4];
      uStack_50 = puVar4[5];
      local_48 = puVar4[6];
      uStack_40 = puVar4[7];
    }
  }
  uVar6 = 0;
  lVar3 = 0xc;
  uVar8 = uVar6;
  do {
    *(undefined4 *)(uVar8 + *param_1) = *(undefined4 *)((longlong)&DAT_1402fada0 + uVar8);
    *(undefined4 *)(uVar8 + 4 + *param_1) = *(undefined4 *)((longlong)&DAT_1402fada4 + uVar8);
    uVar9 = uVar8 + 0x18;
    *(undefined4 *)(uVar8 + 8 + *param_1) = *(undefined4 *)((longlong)&DAT_1402fada8 + uVar8);
    *(undefined4 *)(uVar8 + 0xc + *param_1) = *(undefined4 *)((longlong)&DAT_1402fadac + uVar8);
    *(undefined4 *)(uVar8 + 0x10 + *param_1) = *(undefined4 *)((longlong)&DAT_1402fadb0 + uVar8);
    *(undefined4 *)(uVar8 + 0x14 + *param_1) = *(undefined4 *)((longlong)&DAT_1402fadb4 + uVar8);
    uVar7 = uVar6;
    uVar8 = uVar9;
  } while ((longlong)uVar9 < 0x48);
  do {
    lVar10 = 0x40;
    lVar11 = uVar7 + 0xc;
    do {
      *(undefined4 *)(uVar7 + param_1[1]) = *(undefined4 *)((longlong)&DAT_1402fadf0 + uVar7);
      *(undefined4 *)(param_1[1] + 4 + uVar7) = *(undefined4 *)((longlong)&DAT_1402fadf4 + uVar7);
      uVar8 = uVar7 + 0x10;
      lVar10 = lVar10 + -1;
      *(undefined4 *)(param_1[1] + -0x1402fadec + (longlong)((longlong)&DAT_1402fadf4 + uVar7)) =
           *(undefined4 *)((longlong)&DAT_1402fadf8 + uVar7);
      *(undefined4 *)(lVar11 + param_1[1]) = *(undefined4 *)((longlong)&DAT_1402fadfc + uVar7);
      uVar7 = uVar8;
      lVar11 = lVar11 + 0x10;
    } while (lVar10 != 0);
    uVar9 = uVar6;
  } while ((longlong)uVar8 < 0x1000);
  do {
    iVar5 = (int)uVar9;
    puVar1 = (uint *)(lVar3 + -0xc + *param_1);
    *puVar1 = *puVar1 ^ CONCAT31(CONCAT21(CONCAT11(*(undefined1 *)
                                                    ((longlong)&local_78 + (longlong)iVar5),
                                                   *(undefined1 *)
                                                    ((longlong)&local_78 +
                                                    (longlong)((iVar5 + 1) % local_88))),
                                          *(undefined1 *)
                                           ((longlong)&local_78 + (longlong)((iVar5 + 2) % local_88)
                                           )),
                                 *(undefined1 *)
                                  ((longlong)&local_78 + (longlong)((iVar5 + 3) % local_88)));
    iVar5 = (iVar5 + 4) % local_88;
    puVar1 = (uint *)(lVar3 + -8 + *param_1);
    *puVar1 = *puVar1 ^ CONCAT31(CONCAT21(CONCAT11(*(undefined1 *)
                                                    ((longlong)&local_78 + (longlong)iVar5),
                                                   *(undefined1 *)
                                                    ((longlong)&local_78 +
                                                    (longlong)((iVar5 + 1) % local_88))),
                                          *(undefined1 *)
                                           ((longlong)&local_78 + (longlong)((iVar5 + 2) % local_88)
                                           )),
                                 *(undefined1 *)
                                  ((longlong)&local_78 + (longlong)((iVar5 + 3) % local_88)));
    iVar5 = (iVar5 + 4) % local_88;
    puVar1 = (uint *)(lVar3 + -4 + *param_1);
    *puVar1 = *puVar1 ^ CONCAT31(CONCAT21(CONCAT11(*(undefined1 *)
                                                    ((longlong)&local_78 + (longlong)iVar5),
                                                   *(undefined1 *)
                                                    ((longlong)&local_78 +
                                                    (longlong)((iVar5 + 1) % local_88))),
                                          *(undefined1 *)
                                           ((longlong)&local_78 + (longlong)((iVar5 + 2) % local_88)
                                           )),
                                 *(undefined1 *)
                                  ((longlong)&local_78 + (longlong)((iVar5 + 3) % local_88)));
    iVar5 = (iVar5 + 4) % local_88;
    *(uint *)(lVar3 + *param_1) =
         *(uint *)(lVar3 + *param_1) ^
         CONCAT31(CONCAT21(CONCAT11(*(undefined1 *)((longlong)&local_78 + (longlong)iVar5),
                                    *(undefined1 *)
                                     ((longlong)&local_78 + (longlong)((iVar5 + 1) % local_88))),
                           *(undefined1 *)((longlong)&local_78 + (longlong)((iVar5 + 2) % local_88))
                          ),
                  *(undefined1 *)((longlong)&local_78 + (longlong)((iVar5 + 3) % local_88)));
    iVar5 = (iVar5 + 4) % local_88;
    puVar1 = (uint *)(lVar3 + 4 + *param_1);
    *puVar1 = *puVar1 ^ CONCAT31(CONCAT21(CONCAT11(*(undefined1 *)
                                                    ((longlong)&local_78 + (longlong)iVar5),
                                                   *(undefined1 *)
                                                    ((longlong)&local_78 +
                                                    (longlong)((iVar5 + 1) % local_88))),
                                          *(undefined1 *)
                                           ((longlong)&local_78 + (longlong)((iVar5 + 2) % local_88)
                                           )),
                                 *(undefined1 *)
                                  ((longlong)&local_78 + (longlong)((iVar5 + 3) % local_88)));
    iVar5 = (iVar5 + 4) % local_88;
    lVar11 = lVar3 + 0x18;
    puVar1 = (uint *)(lVar3 + 8 + *param_1);
    *puVar1 = *puVar1 ^ CONCAT31(CONCAT21(CONCAT11(*(undefined1 *)
                                                    ((longlong)&local_78 + (longlong)iVar5),
                                                   *(undefined1 *)
                                                    ((longlong)&local_78 +
                                                    (longlong)((iVar5 + 1) % local_88))),
                                          *(undefined1 *)
                                           ((longlong)&local_78 + (longlong)((iVar5 + 2) % local_88)
                                           )),
                                 *(undefined1 *)
                                  ((longlong)&local_78 + (longlong)((iVar5 + 3) % local_88)));
    uVar9 = (longlong)(iVar5 + 4) % (longlong)local_88 & 0xffffffff;
    lVar3 = lVar11;
  } while (lVar11 < 0x54);
  local_84[0] = 0;
  local_88 = 0;
  uVar8 = uVar6;
  do {
    FUN_1400e0ee0(param_1,local_84,&local_88);
    *(undefined4 *)(uVar8 + *param_1) = local_84[0];
    *(int *)(uVar8 + 4 + *param_1) = local_88;
    uVar8 = uVar8 + 8;
  } while ((longlong)uVar8 < 0x48);
  do {
    lVar3 = 0x80;
    do {
      FUN_1400e0ee0(param_1,local_84,&local_88);
      *(undefined4 *)(uVar6 + param_1[1]) = local_84[0];
      *(int *)(uVar6 + 4 + param_1[1]) = local_88;
      uVar6 = uVar6 + 8;
      lVar3 = lVar3 + -1;
    } while (lVar3 != 0);
  } while ((longlong)uVar6 < 0x1000);
  return;
}



uint FUN_1400e1c80(undefined8 param_1,undefined1 *param_2,undefined1 *param_3,uint param_4)

{
  undefined1 uVar1;
  uint uVar2;
  undefined1 *puVar3;
  undefined1 *_Dst;
  ulonglong uVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  bool bVar8;
  
  if ((param_2 == (undefined1 *)0x0) || (param_3 == (undefined1 *)0x0)) {
    return 0;
  }
  bVar8 = param_2 == param_3;
  uVar5 = param_4;
  if ((param_4 & 7) != 0) {
    uVar5 = (param_4 - (param_4 & 7)) + 8;
  }
  uVar6 = 0;
  if (uVar5 != 0) {
    param_3 = param_3 + 2;
    do {
      if (bVar8) {
        if (param_4 - 7 <= uVar6) {
          if (0 < (int)(uVar5 - param_4)) {
            memset(param_2 + param_4,0,(ulonglong)(uVar5 - param_4));
          }
        }
        FUN_1400e0ee0(param_1);
      }
      else {
        if (uVar6 < param_4 - 7) {
          param_3[-2] = *param_2;
          param_3[-1] = param_2[1];
          *param_3 = param_2[2];
          param_3[1] = param_2[3];
          param_3[2] = param_2[4];
          param_3[3] = param_2[5];
          param_3[4] = param_2[6];
          param_3[5] = param_2[7];
        }
        else {
          _Dst = param_3 + -2;
          uVar2 = param_4 - uVar6;
          uVar7 = 0;
          if (0 < (int)uVar2) {
            uVar4 = (ulonglong)uVar2;
            puVar3 = _Dst;
            do {
              uVar1 = *param_2;
              _Dst = puVar3 + 1;
              param_2 = param_2 + 1;
              uVar4 = uVar4 - 1;
              *puVar3 = uVar1;
              puVar3 = _Dst;
            } while (uVar4 != 0);
            uVar7 = uVar2;
            if (7 < (int)uVar2) goto LAB_1400e1dc1;
          }
          memset(_Dst,0,(ulonglong)(8 - uVar7));
        }
LAB_1400e1dc1:
        FUN_1400e0ee0(param_1);
        param_3 = param_3 + 8;
      }
      param_2 = param_2 + 8;
      uVar6 = uVar6 + 8;
    } while (uVar6 < uVar5);
  }
  return uVar5;
}



void FUN_1400e1e10(undefined8 param_1,undefined1 *param_2,undefined1 *param_3,int param_4)

{
  ulonglong uVar1;
  bool bVar2;
  
  if (((param_2 != (undefined1 *)0x0) && (param_3 != (undefined1 *)0x0)) &&
     (bVar2 = param_2 == param_3, param_4 != 0)) {
    param_3 = param_3 + 2;
    uVar1 = (ulonglong)((param_4 - 1U >> 3) + 1);
    do {
      if (bVar2) {
        FUN_1400e1340(param_1,param_2,param_2 + 4);
      }
      else {
        param_3[-2] = *param_2;
        param_3[-1] = param_2[1];
        *param_3 = param_2[2];
        param_3[1] = param_2[3];
        param_3[2] = param_2[4];
        param_3[3] = param_2[5];
        param_3[4] = param_2[6];
        param_3[5] = param_2[7];
        FUN_1400e1340(param_1);
        param_3 = param_3 + 8;
      }
      param_2 = param_2 + 8;
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0);
  }
  return;
}



undefined8 FUN_1400e1f00(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
  }
  else {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,0x3f0,iVar2 + 0x20);
      uVar5 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar5,uVar3);
      FUN_1400e17a0(param_1);
      uVar3 = FUN_1400b8b80(param_2);
      uVar6 = FUN_1400b8b90(uVar5);
      uVar7 = FUN_1400b8b90(param_2);
      FUN_1400e1c80(param_1,uVar7,uVar6,uVar3);
    }
  }
  return uVar5;
}



undefined8 FUN_1400e2010(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
  }
  else {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,0x3f1,iVar2 + 0x20);
      uVar5 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar5,uVar3);
      uVar3 = FUN_1400b8b80(param_2);
      uVar6 = FUN_1400b8b90(uVar5);
      uVar7 = FUN_1400b8b90(param_2);
      FUN_1400e1c80(param_1,uVar7,uVar6,uVar3);
    }
  }
  return uVar5;
}



undefined8 FUN_1400e2110(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
  }
  else {
    FUN_1400b9a00(param_2,*(undefined4 *)(param_1 + 0x14),0x10);
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,0x3f2,iVar2 + 0x20);
      uVar5 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar5,uVar3);
      uVar3 = FUN_1400b8b80(param_2);
      uVar6 = FUN_1400b8b90(uVar5);
      uVar7 = FUN_1400b8b90(param_2);
      FUN_1400e1c80(param_1,uVar7,uVar6,uVar3);
      FUN_1400b9c60(param_2,0,8,param_3);
    }
  }
  return uVar5;
}



undefined8 FUN_1400e2240(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
  }
  else {
    FUN_1400b9a00(param_2,*(undefined4 *)(param_1 + 0x14),0x10);
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,0x3f3,iVar2 + 0x20);
      uVar5 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar5,uVar3);
      FUN_1400e17a0(param_1);
      uVar3 = FUN_1400b8b80(param_2);
      uVar6 = FUN_1400b8b90(uVar5);
      uVar7 = FUN_1400b8b90(param_2);
      FUN_1400e1c80(param_1,uVar7,uVar6,uVar3);
      FUN_1400b9c60(param_2,0,8,param_3);
    }
  }
  return uVar5;
}



undefined8 FUN_1400e2380(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
  }
  else {
    FUN_1400e17a0(param_1);
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,0x3f4,iVar2 + 0x20);
      uVar5 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar5,uVar3);
      uVar3 = FUN_1400b8b80(param_2);
      uVar6 = FUN_1400b8b90(uVar5);
      uVar7 = FUN_1400b8b90(param_2);
      FUN_1400e1e10(param_1,uVar7,uVar6,uVar3);
      if (*(char *)(param_1 + 0x18) != '\0') {
        FUN_1400b9870(uVar5);
      }
      FUN_1400b9c60(uVar5,0,8,param_3);
    }
  }
  return uVar5;
}



undefined8 FUN_1400e24c0(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
  }
  else {
    FUN_1400e17a0(param_1);
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,0x3f5,iVar2 + 0x20);
      uVar5 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar5,uVar3);
      uVar3 = FUN_1400b8b80(param_2);
      uVar6 = FUN_1400b8b90(uVar5);
      uVar7 = FUN_1400b8b90(param_2);
      FUN_1400e1e10(param_1,uVar7,uVar6,uVar3);
    }
  }
  return uVar5;
}



undefined8 FUN_1400e25d0(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
  }
  else {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,0x3f6,iVar2 + 0x20);
      uVar5 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar5,uVar3);
      uVar3 = FUN_1400b8b80(param_2);
      uVar6 = FUN_1400b8b90(uVar5);
      uVar7 = FUN_1400b8b90(param_2);
      FUN_1400e1e10(param_1,uVar7,uVar6,uVar3);
    }
  }
  return uVar5;
}



undefined8 FUN_1400e26d0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
  }
  else {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(uVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,0x3f7,iVar2 + 0x20);
      uVar5 = 0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(uVar5,uVar3);
      uVar3 = FUN_1400b8b80(param_2);
      uVar6 = FUN_1400b8b90(uVar5);
      uVar7 = FUN_1400b8b90(param_2);
      FUN_1400e1e10(param_1,uVar7,uVar6,uVar3);
      if (*(char *)(param_1 + 0x18) != '\0') {
        FUN_1400b9870(uVar5);
      }
      FUN_1400b9c60(uVar5,0,8,param_3);
    }
  }
  return uVar5;
}



void FUN_1400e2800(longlong param_1,undefined8 *param_2)

{
  if (param_2 != (undefined8 *)0x0) {
    *(undefined8 *)(param_1 + 0x40) = *param_2;
    *(undefined8 *)(param_1 + 0x48) = param_2[1];
  }
  return;
}



undefined4 * FUN_1400e2820(undefined4 *param_1)

{
  *param_1 = 0;
  *(undefined1 *)(param_1 + 1) = 0;
  FUN_1400b8c40(param_1 + 2);
  param_1[0xc] = 2;
  param_1[0xe] = 1;
  param_1[0xd] = 1;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x12) = 0;
  return param_1;
}



void FUN_1400e2870(longlong param_1)

{
  FUN_1400b92d0(param_1 + 8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400e2880(longlong param_1,void *param_2)

{
  longlong lVar1;
  uint *puVar2;
  longlong lVar3;
  longlong lVar4;
  int iVar5;
  longlong lVar6;
  int iVar7;
  byte *pbVar8;
  longlong lVar9;
  int iVar10;
  undefined1 auStack_68 [28];
  undefined4 uStack_4c;
  undefined4 local_48;
  uint local_44 [2];
  byte local_3c;
  byte local_3b;
  byte local_3a;
  byte local_39;
  byte local_38;
  byte local_37;
  byte local_36;
  byte local_35;
  uint auStack_34 [3];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_68;
  iVar5 = *(int *)(param_1 + 0x50) + -6;
  lVar4 = (longlong)iVar5;
  if (0 < iVar5) {
    memcpy(&local_48,param_2,lVar4 << 2);
  }
  iVar10 = 0;
  iVar7 = 0;
  lVar6 = 0;
  lVar3 = 0;
  if (0 < iVar5) {
    lVar9 = 0x15;
    do {
      if (*(int *)(param_1 + 0x50) < iVar10) break;
      for (; (lVar6 < lVar4 && (lVar3 < 4)); lVar3 = lVar3 + 1) {
        lVar1 = lVar6 + -1;
        lVar6 = lVar6 + 1;
        iVar7 = iVar7 + 1;
        *(uint *)(param_1 + (lVar9 + lVar3) * 4) = local_44[lVar1];
      }
      if (lVar3 == 4) {
        iVar10 = iVar10 + 1;
        lVar9 = lVar9 + 4;
        iVar7 = 0;
        lVar3 = 0;
      }
    } while (lVar6 < lVar4);
  }
  lVar6 = (longlong)iVar10;
  lVar3 = (longlong)iVar7;
  if (iVar10 <= *(int *)(param_1 + 0x50)) {
    pbVar8 = &DAT_1402feff0;
    do {
      local_48._0_1_ =
           (byte)local_48 ^ (&DAT_1402fbdf0)[*(byte *)((longlong)&uStack_4c + lVar4 * 4 + 1)];
      local_48._1_1_ =
           local_48._1_1_ ^ (&DAT_1402fbdf0)[*(byte *)((longlong)&uStack_4c + lVar4 * 4 + 2)];
      local_48._2_1_ =
           local_48._2_1_ ^ (&DAT_1402fbdf0)[*(byte *)((longlong)&uStack_4c + lVar4 * 4 + 3)];
      local_48._3_1_ = local_48._3_1_ ^ (&DAT_1402fbdf0)[*(byte *)(&uStack_4c + lVar4)];
      local_48._0_1_ = (byte)local_48 ^ *pbVar8;
      if (iVar5 == 8) {
        lVar9 = 3;
        puVar2 = local_44;
        do {
          *puVar2 = *puVar2 ^ puVar2[-1];
          lVar9 = lVar9 + -1;
          puVar2 = puVar2 + 1;
        } while (lVar9 != 0);
        lVar9 = 5;
        local_38 = local_38 ^ (&DAT_1402fbdf0)[local_3c];
        local_37 = local_37 ^ (&DAT_1402fbdf0)[local_3b];
        local_36 = local_36 ^ (&DAT_1402fbdf0)[local_3a];
        local_35 = local_35 ^ (&DAT_1402fbdf0)[local_39];
        do {
          puVar2 = &uStack_4c + lVar9;
          lVar9 = lVar9 + 1;
          (&uStack_4c)[lVar9] = (&uStack_4c)[lVar9] ^ *puVar2;
        } while (lVar9 < 8);
      }
      else {
        lVar9 = 1;
        if (1 < lVar4) {
          do {
            puVar2 = &uStack_4c + lVar9;
            lVar9 = lVar9 + 1;
            (&uStack_4c)[lVar9] = (&uStack_4c)[lVar9] ^ *puVar2;
          } while (lVar9 < lVar4);
        }
      }
      lVar9 = 0;
      if (0 < iVar5) {
        do {
          if (*(int *)(param_1 + 0x50) < iVar10) {
            return;
          }
          for (; (lVar9 < lVar4 && (lVar3 < 4)); lVar3 = lVar3 + 1) {
            lVar1 = lVar9 + -1;
            lVar9 = lVar9 + 1;
            *(uint *)(param_1 + 0x54 + (lVar3 + lVar6 * 4) * 4) = local_44[lVar1];
          }
          if (lVar3 == 4) {
            iVar10 = iVar10 + 1;
            lVar6 = lVar6 + 1;
            lVar3 = 0;
          }
        } while (lVar9 < lVar4);
      }
      pbVar8 = pbVar8 + 4;
    } while (iVar10 <= *(int *)(param_1 + 0x50));
  }
  return;
}



void FUN_1400e2a90(longlong param_1)

{
  byte *pbVar1;
  int iVar2;
  
  iVar2 = 1;
  if (1 < *(int *)(param_1 + 0x50)) {
    pbVar1 = (byte *)(param_1 + 0x66);
    do {
      iVar2 = iVar2 + 1;
      *(uint *)(pbVar1 + -2) =
           *(uint *)(&DAT_1402febf0 + (ulonglong)pbVar1[1] * 4) ^
           *(uint *)(&DAT_1402fe3f0 + (ulonglong)pbVar1[-1] * 4) ^
           *(uint *)(&DAT_1402fe7f0 + (ulonglong)*pbVar1 * 4) ^
           *(uint *)(&DAT_1402fdff0 + (ulonglong)pbVar1[-2] * 4);
      *(uint *)(pbVar1 + 2) =
           *(uint *)(&DAT_1402febf0 + (ulonglong)pbVar1[5] * 4) ^
           *(uint *)(&DAT_1402fe7f0 + (ulonglong)pbVar1[4] * 4) ^
           *(uint *)(&DAT_1402fe3f0 + (ulonglong)pbVar1[3] * 4) ^
           *(uint *)(&DAT_1402fdff0 + (ulonglong)pbVar1[2] * 4);
      *(uint *)(pbVar1 + 6) =
           *(uint *)(&DAT_1402febf0 + (ulonglong)pbVar1[9] * 4) ^
           *(uint *)(&DAT_1402fe7f0 + (ulonglong)pbVar1[8] * 4) ^
           *(uint *)(&DAT_1402fe3f0 + (ulonglong)pbVar1[7] * 4) ^
           *(uint *)(&DAT_1402fdff0 + (ulonglong)pbVar1[6] * 4);
      *(uint *)(pbVar1 + 10) =
           *(uint *)(&DAT_1402febf0 + (ulonglong)pbVar1[0xd] * 4) ^
           *(uint *)(&DAT_1402fe7f0 + (ulonglong)pbVar1[0xc] * 4) ^
           *(uint *)(&DAT_1402fe3f0 + (ulonglong)pbVar1[0xb] * 4) ^
           *(uint *)(&DAT_1402fdff0 + (ulonglong)pbVar1[10] * 4);
      pbVar1 = pbVar1 + 0x10;
    } while (iVar2 < *(int *)(param_1 + 0x50));
  }
  return;
}



void FUN_1400e2bb0(longlong param_1,uint *param_2,uint *param_3)

{
  ulonglong uVar1;
  uint uVar2;
  uint *puVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  uint uVar8;
  int iVar9;
  byte local_1c;
  
  uVar5 = *(uint *)(param_1 + 0x60) ^ param_2[3];
  uVar7 = *(uint *)(param_1 + 0x5c) ^ param_2[2];
  uVar2 = *(uint *)(param_1 + 0x54) ^ *param_2;
  uVar8 = *(uint *)(param_1 + 0x58) ^ param_2[1];
  iVar9 = 1;
  *param_3 = *(uint *)(&DAT_1402fcaf0 + (ulonglong)(uVar5 >> 0x18) * 4) ^
             *(uint *)(&DAT_1402fc6f0 + (ulonglong)(uVar7 >> 0x10 & 0xff) * 4) ^
             *(uint *)(&DAT_1402fc2f0 + (ulonglong)(uVar8 >> 8 & 0xff) * 4) ^
             *(uint *)(&DAT_1402fbef0 + (ulonglong)(uVar2 & 0xff) * 4);
  uVar4 = *(uint *)(&DAT_1402fc6f0 + (ulonglong)(uVar5 >> 0x10 & 0xff) * 4) ^
          *(uint *)(&DAT_1402fc2f0 + (ulonglong)(uVar7 >> 8 & 0xff) * 4) ^
          *(uint *)(&DAT_1402fcaf0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
          *(uint *)(&DAT_1402fbef0 + (ulonglong)(uVar8 & 0xff) * 4);
  param_3[1] = uVar4;
  uVar6 = *(uint *)(&DAT_1402fc2f0 + (ulonglong)(uVar5 >> 8 & 0xff) * 4) ^
          *(uint *)(&DAT_1402fcaf0 + (ulonglong)(uVar8 >> 0x18) * 4) ^
          *(uint *)(&DAT_1402fc6f0 + (ulonglong)(uVar2 >> 0x10 & 0xff) * 4) ^
          *(uint *)(&DAT_1402fbef0 + (ulonglong)(uVar7 & 0xff) * 4);
  param_3[2] = uVar6;
  local_1c = (byte)uVar5;
  uVar2 = *(uint *)(&DAT_1402fcaf0 + (ulonglong)(uVar7 >> 0x18) * 4) ^
          *(uint *)(&DAT_1402fc6f0 + (ulonglong)(uVar8 >> 0x10 & 0xff) * 4) ^
          *(uint *)(&DAT_1402fc2f0 + (ulonglong)(uVar2 >> 8 & 0xff) * 4) ^
          *(uint *)(&DAT_1402fbef0 + (ulonglong)local_1c * 4);
  param_3[3] = uVar2;
  if (1 < *(int *)(param_1 + 0x50) + -1) {
    puVar3 = (uint *)(param_1 + 0x68);
    do {
      uVar7 = uVar4 ^ *puVar3;
      uVar5 = puVar3[-1] ^ *param_3;
      uVar8 = puVar3[1] ^ uVar6;
      uVar2 = puVar3[2] ^ uVar2;
      iVar9 = iVar9 + 1;
      puVar3 = puVar3 + 4;
      *param_3 = *(uint *)(&DAT_1402fcaf0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
                 *(uint *)(&DAT_1402fc6f0 + (ulonglong)(uVar8 >> 0x10 & 0xff) * 4) ^
                 *(uint *)(&DAT_1402fc2f0 + (ulonglong)(uVar7 >> 8 & 0xff) * 4) ^
                 *(uint *)(&DAT_1402fbef0 + (ulonglong)(uVar5 & 0xff) * 4);
      uVar4 = *(uint *)(&DAT_1402fc6f0 + (ulonglong)(uVar2 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_1402fc2f0 + (ulonglong)(uVar8 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_1402fcaf0 + (ulonglong)(uVar5 >> 0x18) * 4) ^
              *(uint *)(&DAT_1402fbef0 + (ulonglong)(uVar7 & 0xff) * 4);
      param_3[1] = uVar4;
      uVar6 = *(uint *)(&DAT_1402fc2f0 + (ulonglong)(uVar2 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_1402fcaf0 + (ulonglong)(uVar7 >> 0x18) * 4) ^
              *(uint *)(&DAT_1402fc6f0 + (ulonglong)(uVar5 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_1402fbef0 + (ulonglong)(uVar8 & 0xff) * 4);
      param_3[2] = uVar6;
      local_1c = (byte)uVar2;
      uVar2 = *(uint *)(&DAT_1402fcaf0 + (ulonglong)(uVar8 >> 0x18) * 4) ^
              *(uint *)(&DAT_1402fc6f0 + (ulonglong)(uVar7 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_1402fc2f0 + (ulonglong)(uVar5 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_1402fbef0 + (ulonglong)local_1c * 4);
      param_3[3] = uVar2;
    } while (iVar9 < *(int *)(param_1 + 0x50) + -1);
  }
  uVar2 = *(int *)(param_1 + 0x50) - 1;
  uVar1 = (ulonglong)uVar2;
  uVar4 = *(uint *)(param_1 + 0x54 + uVar1 * 0x10) ^ *param_3;
  uVar5 = *(uint *)(param_1 + 0x58 + uVar1 * 0x10) ^ param_3[1];
  uVar6 = *(uint *)(param_1 + 0x5c + uVar1 * 0x10) ^ param_3[2];
  uVar2 = *(uint *)(param_1 + ((ulonglong)uVar2 + 6) * 0x10) ^ param_3[3];
  *(undefined *)param_3 = (&DAT_1402fbef1)[(ulonglong)(uVar4 & 0xff) * 4];
  *(undefined *)((longlong)param_3 + 1) = (&DAT_1402fbef1)[(ulonglong)(uVar5 >> 8 & 0xff) * 4];
  *(undefined *)((longlong)param_3 + 2) = (&DAT_1402fbef1)[(ulonglong)(uVar6 >> 0x10 & 0xff) * 4];
  *(undefined *)((longlong)param_3 + 3) = (&DAT_1402fbef1)[(ulonglong)(uVar2 >> 0x18) * 4];
  *(undefined *)(param_3 + 1) = (&DAT_1402fbef1)[(ulonglong)(uVar5 & 0xff) * 4];
  *(undefined *)((longlong)param_3 + 5) = (&DAT_1402fbef1)[(ulonglong)(uVar6 >> 8 & 0xff) * 4];
  *(undefined *)((longlong)param_3 + 6) = (&DAT_1402fbef1)[(ulonglong)(uVar2 >> 0x10 & 0xff) * 4];
  *(undefined *)((longlong)param_3 + 7) = (&DAT_1402fbef1)[(ulonglong)(uVar4 >> 0x18) * 4];
  *(undefined *)(param_3 + 2) = (&DAT_1402fbef1)[(ulonglong)(uVar6 & 0xff) * 4];
  *(undefined *)((longlong)param_3 + 9) = (&DAT_1402fbef1)[(ulonglong)(uVar2 >> 8 & 0xff) * 4];
  *(undefined *)((longlong)param_3 + 10) = (&DAT_1402fbef1)[(ulonglong)(uVar4 >> 0x10 & 0xff) * 4];
  *(undefined *)((longlong)param_3 + 0xb) = (&DAT_1402fbef1)[(ulonglong)(uVar5 >> 0x18) * 4];
  local_1c = (byte)uVar2;
  *(undefined *)(param_3 + 3) = (&DAT_1402fbef1)[(ulonglong)local_1c * 4];
  *(undefined *)((longlong)param_3 + 0xd) = (&DAT_1402fbef1)[(ulonglong)(uVar4 >> 8 & 0xff) * 4];
  *(undefined *)((longlong)param_3 + 0xe) = (&DAT_1402fbef1)[(ulonglong)(uVar5 >> 0x10 & 0xff) * 4];
  *(undefined *)((longlong)param_3 + 0xf) = (&DAT_1402fbef1)[(ulonglong)(uVar6 >> 0x18) * 4];
  *param_3 = *param_3 ^ *(uint *)(param_1 + 0x54 + (ulonglong)*(uint *)(param_1 + 0x50) * 0x10);
  param_3[1] = param_3[1] ^ *(uint *)(param_1 + 0x58 + (ulonglong)*(uint *)(param_1 + 0x50) * 0x10);
  param_3[2] = param_3[2] ^ *(uint *)(param_1 + 0x5c + (ulonglong)*(uint *)(param_1 + 0x50) * 0x10);
  param_3[3] = param_3[3] ^ *(uint *)(param_1 + ((ulonglong)*(uint *)(param_1 + 0x50) + 6) * 0x10);
  return;
}



void FUN_1400e3030(longlong param_1,uint *param_2,uint *param_3)

{
  longlong lVar1;
  uint uVar2;
  longlong lVar3;
  uint *puVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  ulonglong uVar8;
  uint uVar9;
  uint uVar10;
  byte local_1c;
  
  uVar8 = (ulonglong)*(uint *)(param_1 + 0x50);
  uVar9 = *(uint *)(param_1 + 0x5c + uVar8 * 0x10) ^ param_2[2];
  uVar2 = *(uint *)(param_1 + 0x54 + uVar8 * 0x10) ^ *param_2;
  uVar10 = *(uint *)(param_1 + 0x58 + uVar8 * 0x10) ^ param_2[1];
  uVar6 = *(uint *)(param_1 + (uVar8 + 6) * 0x10) ^ param_2[3];
  *param_3 = *(uint *)(&DAT_1402fd2f0 + (ulonglong)(uVar6 >> 8 & 0xff) * 4) ^
             *(uint *)(&DAT_1402fd6f0 + (ulonglong)(uVar9 >> 0x10 & 0xff) * 4) ^
             *(uint *)(&DAT_1402fdaf0 + (ulonglong)(uVar10 >> 0x18) * 4) ^
             *(uint *)(&DAT_1402fcef0 + (ulonglong)(uVar2 & 0xff) * 4);
  uVar5 = *(uint *)(&DAT_1402fd6f0 + (ulonglong)(uVar6 >> 0x10 & 0xff) * 4) ^
          *(uint *)(&DAT_1402fdaf0 + (ulonglong)(uVar9 >> 0x18) * 4) ^
          *(uint *)(&DAT_1402fd2f0 + (ulonglong)(uVar2 >> 8 & 0xff) * 4) ^
          *(uint *)(&DAT_1402fcef0 + (ulonglong)(uVar10 & 0xff) * 4);
  param_3[1] = uVar5;
  uVar7 = *(uint *)(&DAT_1402fdaf0 + (ulonglong)(uVar6 >> 0x18) * 4) ^
          *(uint *)(&DAT_1402fd2f0 + (ulonglong)(uVar10 >> 8 & 0xff) * 4) ^
          *(uint *)(&DAT_1402fd6f0 + (ulonglong)(uVar2 >> 0x10 & 0xff) * 4) ^
          *(uint *)(&DAT_1402fcef0 + (ulonglong)(uVar9 & 0xff) * 4);
  param_3[2] = uVar7;
  local_1c = (byte)uVar6;
  uVar2 = *(uint *)(&DAT_1402fd2f0 + (ulonglong)(uVar9 >> 8 & 0xff) * 4) ^
          *(uint *)(&DAT_1402fd6f0 + (ulonglong)(uVar10 >> 0x10 & 0xff) * 4) ^
          *(uint *)(&DAT_1402fdaf0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
          *(uint *)(&DAT_1402fcef0 + (ulonglong)local_1c * 4);
  param_3[3] = uVar2;
  lVar1 = (longlong)(*(int *)(param_1 + 0x50) + -1);
  if (1 < lVar1) {
    lVar3 = lVar1 + -1;
    puVar4 = (uint *)(param_1 + 0x58 + lVar1 * 0x10);
    do {
      uVar9 = uVar5 ^ *puVar4;
      uVar6 = puVar4[-1] ^ *param_3;
      uVar10 = puVar4[1] ^ uVar7;
      uVar2 = puVar4[2] ^ uVar2;
      puVar4 = puVar4 + -4;
      *param_3 = *(uint *)(&DAT_1402fd2f0 + (ulonglong)(uVar2 >> 8 & 0xff) * 4) ^
                 *(uint *)(&DAT_1402fd6f0 + (ulonglong)(uVar10 >> 0x10 & 0xff) * 4) ^
                 *(uint *)(&DAT_1402fdaf0 + (ulonglong)(uVar9 >> 0x18) * 4) ^
                 *(uint *)(&DAT_1402fcef0 + (ulonglong)(uVar6 & 0xff) * 4);
      uVar5 = *(uint *)(&DAT_1402fd6f0 + (ulonglong)(uVar2 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_1402fdaf0 + (ulonglong)(uVar10 >> 0x18) * 4) ^
              *(uint *)(&DAT_1402fd2f0 + (ulonglong)(uVar6 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_1402fcef0 + (ulonglong)(uVar9 & 0xff) * 4);
      param_3[1] = uVar5;
      uVar7 = *(uint *)(&DAT_1402fdaf0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_1402fd2f0 + (ulonglong)(uVar9 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_1402fd6f0 + (ulonglong)(uVar6 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_1402fcef0 + (ulonglong)(uVar10 & 0xff) * 4);
      param_3[2] = uVar7;
      local_1c = (byte)uVar2;
      uVar2 = *(uint *)(&DAT_1402fd2f0 + (ulonglong)(uVar10 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_1402fd6f0 + (ulonglong)(uVar9 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_1402fdaf0 + (ulonglong)(uVar6 >> 0x18) * 4) ^
              *(uint *)(&DAT_1402fcef0 + (ulonglong)local_1c * 4);
      lVar3 = lVar3 + -1;
      param_3[3] = uVar2;
    } while (lVar3 != 0);
  }
  uVar7 = *(uint *)(param_1 + 100) ^ *param_3;
  uVar2 = *(uint *)(param_1 + 0x70) ^ param_3[3];
  uVar5 = *(uint *)(param_1 + 0x6c) ^ param_3[2];
  uVar6 = *(uint *)(param_1 + 0x68) ^ param_3[1];
  *(undefined *)param_3 = (&DAT_1402fdef0)[uVar7 & 0xff];
  *(undefined *)((longlong)param_3 + 1) = (&DAT_1402fdef0)[uVar2 >> 8 & 0xff];
  *(undefined *)((longlong)param_3 + 2) = (&DAT_1402fdef0)[uVar5 >> 0x10 & 0xff];
  *(undefined *)((longlong)param_3 + 3) = (&DAT_1402fdef0)[uVar6 >> 0x18];
  *(undefined *)(param_3 + 1) = (&DAT_1402fdef0)[uVar6 & 0xff];
  *(undefined *)((longlong)param_3 + 5) = (&DAT_1402fdef0)[uVar7 >> 8 & 0xff];
  *(undefined *)((longlong)param_3 + 6) = (&DAT_1402fdef0)[uVar2 >> 0x10 & 0xff];
  *(undefined *)((longlong)param_3 + 7) = (&DAT_1402fdef0)[uVar5 >> 0x18];
  *(undefined *)(param_3 + 2) = (&DAT_1402fdef0)[uVar5 & 0xff];
  *(undefined *)((longlong)param_3 + 9) = (&DAT_1402fdef0)[uVar6 >> 8 & 0xff];
  *(undefined *)((longlong)param_3 + 10) = (&DAT_1402fdef0)[uVar7 >> 0x10 & 0xff];
  *(undefined *)((longlong)param_3 + 0xb) = (&DAT_1402fdef0)[uVar2 >> 0x18];
  local_1c = (byte)uVar2;
  *(undefined *)(param_3 + 3) = (&DAT_1402fdef0)[local_1c];
  *(undefined *)((longlong)param_3 + 0xd) = (&DAT_1402fdef0)[uVar5 >> 8 & 0xff];
  *(undefined *)((longlong)param_3 + 0xe) = (&DAT_1402fdef0)[uVar6 >> 0x10 & 0xff];
  *(undefined *)((longlong)param_3 + 0xf) = (&DAT_1402fdef0)[uVar7 >> 0x18];
  *param_3 = *param_3 ^ *(uint *)(param_1 + 0x54);
  param_3[1] = param_3[1] ^ *(uint *)(param_1 + 0x58);
  param_3[2] = param_3[2] ^ *(uint *)(param_1 + 0x5c);
  param_3[3] = param_3[3] ^ *(uint *)(param_1 + 0x60);
  return;
}



undefined8 FUN_1400e34a0(longlong param_1,int param_2)

{
  if (0xc0 < param_2) {
    *(undefined4 *)(param_1 + 0x30) = 2;
    return 0x100;
  }
  if (0x80 < param_2) {
    *(undefined4 *)(param_1 + 0x30) = 1;
    return 0xc0;
  }
  *(undefined4 *)(param_1 + 0x30) = 0;
  return 0x80;
}



void FUN_1400e34e0(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 4) = param_2;
  return;
}



void FUN_1400e34f0(longlong param_1,undefined8 param_2)

{
  FUN_1400d1420(param_2,param_1 + 8);
  return;
}



void FUN_1400e3500(longlong param_1,undefined8 param_2)

{
  FUN_1400b8b30(param_1 + 8);
  FUN_1400b9e90(param_1 + 8,param_2);
  return;
}



void FUN_1400e3530(longlong param_1,undefined8 param_2)

{
  FUN_1400b8b30(param_2);
  FUN_1400b9e90(param_2,param_1 + 8);
  return;
}



void FUN_1400e3560(undefined4 *param_1,undefined4 param_2)

{
  *param_1 = param_2;
  return;
}



undefined1 FUN_1400e3570(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x38) = 0;
  return 1;
}



undefined1 FUN_1400e3580(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x38) = 1;
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400e3590(longlong param_1,int param_2,int param_3)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  longlong lVar4;
  undefined8 *puVar5;
  void *_Src;
  ulonglong uVar6;
  ulonglong uVar7;
  undefined1 auStack_88 [32];
  undefined8 local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined1 local_48 [32];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  iVar1 = *(int *)(param_1 + 0x30);
  local_68 = 0;
  local_60 = 0;
  local_58 = 0;
  local_50 = 0;
  lVar4 = FUN_1400b8b90(param_1 + 8);
  if ((lVar4 != 0) && (iVar2 = FUN_1400b8b80(param_1 + 8), iVar2 != 0)) {
    uVar3 = FUN_1400b8b80(param_1 + 8);
    if (uVar3 < 0x21) {
      uVar3 = FUN_1400b8b80(param_1 + 8);
      _Src = (void *)FUN_1400b8b90(param_1 + 8);
      memcpy(&local_68,_Src,(ulonglong)uVar3);
    }
    else {
      puVar5 = (undefined8 *)FUN_1400b8b90();
      local_68 = *puVar5;
      local_60 = puVar5[1];
      local_50 = puVar5[3];
      local_58 = puVar5[2];
    }
  }
  *(undefined4 *)(param_1 + 0x34) = 1;
  if (((((param_2 == 1) || (param_2 == 0)) || (param_2 == 2)) || (param_2 == 3)) &&
     ((*(int *)(param_1 + 0x38) = param_2, param_3 == 0 || (param_3 == 1)))) {
    *(int *)(param_1 + 0x3c) = param_3;
    if (iVar1 == 0) {
      uVar3 = 0x10;
      *(undefined4 *)(param_1 + 0x50) = 10;
    }
    else if (iVar1 == 1) {
      uVar3 = 0x18;
      *(undefined4 *)(param_1 + 0x50) = 0xc;
    }
    else {
      if (iVar1 != 2) {
        return;
      }
      uVar3 = 0x20;
      *(undefined4 *)(param_1 + 0x50) = 0xe;
    }
    if (uVar3 != 0) {
      uVar7 = (ulonglong)uVar3;
      uVar6 = 0;
      puVar5 = &local_68;
      do {
        uVar7 = uVar7 - 1;
        local_48[(uVar6 & 0xfffffffffffffffc) + (ulonglong)((uint)uVar6 & 3)] =
             *(undefined1 *)puVar5;
        uVar6 = uVar6 + 1;
        puVar5 = (undefined8 *)((longlong)puVar5 + 1);
      } while (uVar7 != 0);
    }
    FUN_1400e2880(param_1,local_48);
    if (*(int *)(param_1 + 0x3c) == 1) {
      FUN_1400e2a90(param_1);
    }
    *(undefined4 *)(param_1 + 0x34) = 0;
  }
  return;
}



int FUN_1400e3750(longlong param_1,uint *param_2,int param_3,longlong param_4,undefined8 param_5,
                 char param_6)

{
  uint uVar1;
  undefined8 *puVar2;
  uint *puVar3;
  int iVar4;
  longlong lVar5;
  int iVar6;
  uint local_28;
  uint local_24;
  uint local_20;
  uint local_1c;
  
  uVar1 = FUN_1400b8b80(param_5);
  if (uVar1 < 0x10) {
    lVar5 = 0x10;
    do {
      FUN_1400b9550(param_5,0);
      lVar5 = lVar5 + -1;
    } while (lVar5 != 0);
  }
  if ((param_6 == '\0') &&
     (puVar2 = (undefined8 *)FUN_1400b8b90(param_5), puVar2 != (undefined8 *)0x0)) {
    *(undefined8 *)(param_1 + 0x40) = *puVar2;
    *(undefined8 *)(param_1 + 0x48) = puVar2[1];
  }
  if (*(int *)(param_1 + 0x34) == 0) {
    if (*(int *)(param_1 + 0x3c) == 0) {
      if ((param_2 == (uint *)0x0) || (param_3 < 1)) {
        iVar6 = 0;
      }
      else {
        iVar6 = (int)((param_3 >> 0x1f & 0x7fU) + param_3) >> 7;
        if (*(int *)(param_1 + 0x38) == 0) {
          if (0 < iVar6) {
            lVar5 = param_4;
            iVar4 = iVar6;
            do {
              FUN_1400e2bb0(param_1,(longlong)param_2 + (lVar5 - param_4),lVar5);
              iVar4 = iVar4 + -1;
              lVar5 = lVar5 + 0x10;
            } while (0 < iVar4);
          }
        }
        else {
          if (*(int *)(param_1 + 0x38) != 1) {
            return -1;
          }
          local_28 = *(uint *)(param_1 + 0x40) ^ *param_2;
          local_24 = param_2[1] ^ *(uint *)(param_1 + 0x44);
          local_20 = param_2[2] ^ *(uint *)(param_1 + 0x48);
          local_1c = param_2[3] ^ *(uint *)(param_1 + 0x4c);
          FUN_1400e2bb0(param_1,&local_28,param_4);
          iVar4 = iVar6 + -1;
          if (0 < iVar4) {
            puVar3 = (uint *)(param_4 + 8);
            do {
              local_28 = puVar3[-2] ^ param_2[4];
              local_24 = puVar3[-1] ^ param_2[5];
              local_20 = param_2[6] ^ *puVar3;
              local_1c = puVar3[1] ^ param_2[7];
              FUN_1400e2bb0(param_1,&local_28,puVar3 + 2);
              iVar4 = iVar4 + -1;
              puVar3 = puVar3 + 4;
              param_2 = param_2 + 4;
            } while (0 < iVar4);
            return iVar6 << 7;
          }
        }
        iVar6 = iVar6 << 7;
      }
    }
    else {
      iVar6 = -6;
    }
  }
  else {
    iVar6 = -5;
  }
  return iVar6;
}



int FUN_1400e3910(longlong param_1,uint *param_2,int param_3,longlong param_4)

{
  byte *pbVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  uint uVar4;
  ulonglong uVar5;
  int iVar6;
  byte bVar7;
  uint uVar8;
  int iVar9;
  ulonglong uVar10;
  uint *puVar11;
  longlong lVar12;
  byte bVar13;
  uint uVar14;
  byte bVar15;
  byte bVar16;
  byte bVar17;
  byte local_res8;
  byte local_68;
  byte local_67;
  byte local_66;
  byte local_65;
  byte local_64;
  byte local_63;
  byte local_62;
  byte local_61;
  byte local_60;
  byte local_5f;
  byte local_5e;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  uint local_48;
  uint local_44;
  uint local_40;
  uint local_3c;
  int local_38;
  int local_34;
  
  if (*(int *)(param_1 + 0x34) != 0) {
    return -5;
  }
  if (*(int *)(param_1 + 0x3c) != 0) {
    return -6;
  }
  if ((param_2 == (uint *)0x0) || (param_3 < 1)) {
    return 0;
  }
  iVar6 = (int)(param_3 + (param_3 >> 0x1f & 0x7fU)) >> 7;
  iVar9 = *(int *)(param_1 + 0x38);
  local_34 = iVar6;
  if (iVar9 == 0) {
    if (0 < iVar6) {
      lVar12 = param_4;
      iVar9 = iVar6;
      do {
        FUN_1400e2bb0(param_1,(longlong)param_2 + (lVar12 - param_4),lVar12);
        iVar9 = iVar9 + -1;
        lVar12 = lVar12 + 0x10;
      } while (0 < iVar9);
    }
  }
  else if (iVar9 == 1) {
    local_48 = *(uint *)(param_1 + 0x40) ^ *param_2;
    local_44 = *(uint *)(param_1 + 0x44) ^ param_2[1];
    local_40 = *(uint *)(param_1 + 0x48) ^ param_2[2];
    local_3c = *(uint *)(param_1 + 0x4c) ^ param_2[3];
    FUN_1400e2bb0(param_1,&local_48,param_4);
    iVar9 = iVar6 + -1;
    if (0 < iVar9) {
      puVar11 = (uint *)(param_4 + 8);
      do {
        local_48 = puVar11[-2] ^ param_2[4];
        local_44 = puVar11[-1] ^ param_2[5];
        local_40 = param_2[6] ^ *puVar11;
        local_3c = puVar11[1] ^ param_2[7];
        FUN_1400e2bb0(param_1,&local_48,puVar11 + 2);
        iVar9 = iVar9 + -1;
        puVar11 = puVar11 + 4;
        param_2 = param_2 + 4;
      } while (0 < iVar9);
      return iVar6 << 7;
    }
  }
  else {
    if (iVar9 != 2) {
      return -1;
    }
    uVar8 = *(uint *)(param_1 + 0x40);
    uVar2 = *(undefined4 *)(param_1 + 0x44);
    uVar3 = *(undefined4 *)(param_1 + 0x48);
    uVar4 = *(uint *)(param_1 + 0x4c);
    if (0 < iVar6) {
      local_50._2_1_ = (byte)((uint)uVar3 >> 0x10);
      uVar14 = uVar4 & 0xff;
      local_50._3_1_ = (byte)((uint)uVar3 >> 0x18);
      local_62 = local_50._3_1_;
      local_50._1_1_ = (byte)((uint)uVar3 >> 8);
      local_64 = local_50._2_1_;
      local_50._0_1_ = (byte)uVar3;
      local_66 = local_50._1_1_;
      local_54._3_1_ = (byte)((uint)uVar2 >> 0x18);
      local_61 = local_54._3_1_;
      local_54._1_1_ = (byte)((uint)uVar2 >> 8);
      local_68 = (byte)local_50;
      local_54._2_1_ = (byte)((uint)uVar2 >> 0x10);
      local_63 = local_54._1_1_;
      local_58._3_1_ = (byte)(uVar8 >> 0x18);
      local_4c._3_1_ = (byte)(uVar4 >> 0x18);
      local_65 = local_58._3_1_;
      local_58._1_1_ = (byte)(uVar8 >> 8);
      local_5f = local_54._2_1_;
      local_54._0_1_ = (byte)uVar2;
      local_4c._2_1_ = (byte)(uVar4 >> 0x10);
      local_67 = local_58._1_1_;
      local_58._0_1_ = (byte)uVar8;
      local_5e = (byte)local_54;
      local_58._2_1_ = (byte)(uVar8 >> 0x10);
      local_4c._1_1_ = (byte)(uVar4 >> 8);
      local_res8 = (byte)local_58;
      local_60 = local_58._2_1_;
      bVar15 = local_4c._3_1_;
      bVar16 = local_4c._2_1_;
      bVar17 = local_4c._1_1_;
      local_58 = uVar8;
      local_54 = uVar2;
      local_50 = uVar3;
      local_4c = uVar4;
      local_38 = iVar6;
      do {
        uVar10 = 0;
        do {
          local_48 = local_58;
          local_44 = local_54;
          local_40 = local_50;
          local_3c = local_4c;
          FUN_1400e2bb0(param_1,&local_48,&local_48);
          uVar5 = uVar10 >> 3;
          bVar7 = (byte)uVar10 & 7;
          pbVar1 = (byte *)(uVar5 + param_4);
          *pbVar1 = *pbVar1 ^ ((byte)local_48 & 0x80) >> bVar7;
          local_res8 = local_67 >> 7 | local_res8 * '\x02';
          local_67 = local_60 >> 7 | local_67 * '\x02';
          local_60 = local_65 >> 7 | local_60 * '\x02';
          local_65 = local_5e >> 7 | local_65 * '\x02';
          local_58 = CONCAT13(local_65,CONCAT12(local_60,CONCAT11(local_67,local_res8)));
          local_5e = local_63 >> 7 | local_5e * '\x02';
          local_63 = local_5f >> 7 | local_63 * '\x02';
          local_5f = local_61 >> 7 | local_5f * '\x02';
          uVar8 = (int)uVar10 + 1;
          uVar10 = (ulonglong)uVar8;
          local_61 = local_68 >> 7 | local_61 * '\x02';
          local_54 = CONCAT13(local_61,CONCAT12(local_5f,CONCAT11(local_63,local_5e)));
          local_68 = local_66 >> 7 | local_68 * '\x02';
          local_66 = local_64 >> 7 | local_66 * '\x02';
          local_64 = local_62 >> 7 | local_64 * '\x02';
          local_62 = (byte)uVar14 >> 7 | local_62 * '\x02';
          bVar13 = bVar17 >> 7 | (byte)uVar14 * '\x02';
          uVar14 = (uint)bVar13;
          bVar17 = bVar16 >> 7 | bVar17 * '\x02';
          bVar16 = bVar15 >> 7 | bVar16 * '\x02';
          bVar15 = *(byte *)(uVar5 + param_4) >> (7 - bVar7 & 0x1f) & 1 | bVar15 * '\x02';
          local_50 = CONCAT13(local_62,CONCAT12(local_64,CONCAT11(local_66,local_68)));
          local_4c = CONCAT13(bVar15,CONCAT12(bVar16,CONCAT11(bVar17,bVar13)));
        } while ((int)uVar8 < 0x80);
        local_38 = local_38 + -1;
      } while (0 < local_38);
      return local_34 << 7;
    }
  }
  return iVar6 << 7;
}



int FUN_1400e3dc0(longlong param_1,longlong param_2,int param_3,longlong param_4)

{
  byte *pbVar1;
  uint *puVar2;
  int iVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  ulonglong uVar7;
  int iVar8;
  int iVar9;
  uint *puVar10;
  byte bVar11;
  byte bVar12;
  uint *puVar13;
  uint uVar14;
  ulonglong uVar15;
  byte bVar16;
  byte bVar17;
  uint uVar18;
  uint local_res8;
  byte local_68;
  byte local_67;
  byte local_66;
  byte local_65;
  byte local_64;
  byte local_63;
  byte local_62;
  byte local_61;
  byte local_60;
  byte local_5f;
  byte local_5e;
  byte local_5d;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  uint local_48;
  uint local_40;
  uint local_3c;
  uint local_38;
  uint local_34;
  int local_30;
  
  if (*(int *)(param_1 + 0x34) != 0) {
    return -5;
  }
  iVar3 = *(int *)(param_1 + 0x38);
  if ((iVar3 != 2) && (*(int *)(param_1 + 0x3c) == 0)) {
    return -6;
  }
  if ((param_2 == 0) || (param_3 < 1)) {
    return 0;
  }
  iVar9 = (int)(param_3 + (param_3 >> 0x1f & 0x7fU)) >> 7;
  iVar8 = iVar9;
  local_30 = iVar9;
  if (iVar3 == 0) {
    for (; 0 < iVar8; iVar8 = iVar8 + -1) {
      FUN_1400e3030(param_1,param_2,param_4);
      param_2 = param_2 + 0x10;
      param_4 = param_4 + 0x10;
    }
  }
  else if (iVar3 == 1) {
    local_res8 = *(uint *)(param_1 + 0x48);
    uVar14 = *(uint *)(param_1 + 0x40);
    uVar18 = *(uint *)(param_1 + 0x44);
    local_48 = *(uint *)(param_1 + 0x4c);
    if (0 < iVar9) {
      puVar13 = (uint *)(param_2 + 8);
      puVar10 = (uint *)(param_4 + 8);
      do {
        puVar2 = (uint *)((param_2 - param_4) + -8 + (longlong)puVar10);
        FUN_1400e3030(param_1,puVar2,&local_40);
        local_38 = local_38 ^ local_res8;
        local_34 = local_34 ^ local_48;
        local_3c = local_3c ^ uVar18;
        local_40 = local_40 ^ uVar14;
        uVar14 = *puVar2;
        puVar10[-2] = local_40;
        uVar18 = puVar13[-1];
        puVar10[-1] = local_3c;
        local_res8 = *puVar13;
        *puVar10 = local_38;
        local_48 = puVar13[1];
        iVar9 = iVar9 + -1;
        puVar10[1] = local_34;
        puVar13 = puVar13 + 4;
        puVar10 = puVar10 + 4;
      } while (0 < iVar9);
      return local_30 << 7;
    }
  }
  else {
    if (iVar3 != 2) {
      return -1;
    }
    uVar14 = *(uint *)(param_1 + 0x40);
    uVar4 = *(undefined4 *)(param_1 + 0x44);
    uVar5 = *(undefined4 *)(param_1 + 0x48);
    uVar6 = *(undefined4 *)(param_1 + 0x4c);
    if (0 < iVar9) {
      local_50._3_1_ = (byte)((uint)uVar5 >> 0x18);
      local_4c._3_1_ = (byte)((uint)uVar6 >> 0x18);
      local_4c._2_1_ = (byte)((uint)uVar6 >> 0x10);
      local_4c._1_1_ = (byte)((uint)uVar6 >> 8);
      local_61 = (byte)uVar6;
      local_50._2_1_ = (byte)((uint)uVar5 >> 0x10);
      local_65 = local_50._2_1_;
      local_50._0_1_ = (byte)uVar5;
      local_63 = local_50._3_1_;
      local_50._1_1_ = (byte)((uint)uVar5 >> 8);
      local_68 = (byte)local_50;
      local_54._2_1_ = (byte)((uint)uVar4 >> 0x10);
      local_67 = local_50._1_1_;
      local_54._3_1_ = (byte)((uint)uVar4 >> 0x18);
      local_62 = local_54._2_1_;
      local_54._0_1_ = (byte)uVar4;
      local_5f = local_54._3_1_;
      local_54._1_1_ = (byte)((uint)uVar4 >> 8);
      local_64 = (byte)local_54;
      local_58._2_1_ = (byte)(uVar14 >> 0x10);
      local_5d = local_54._1_1_;
      local_58._3_1_ = (byte)(uVar14 >> 0x18);
      local_66 = local_58._2_1_;
      local_58._0_1_ = (byte)uVar14;
      local_5e = local_58._3_1_;
      local_58._1_1_ = (byte)(uVar14 >> 8);
      local_res8._0_1_ = (byte)local_58;
      local_60 = local_58._1_1_;
      bVar16 = local_4c._3_1_;
      bVar17 = local_4c._2_1_;
      bVar12 = local_4c._1_1_;
      local_58 = uVar14;
      local_54 = uVar4;
      local_50 = uVar5;
      local_4c = uVar6;
      local_48 = iVar9;
      do {
        uVar15 = 0;
        do {
          local_40 = local_58;
          local_3c = local_54;
          local_38 = local_50;
          local_34 = local_4c;
          FUN_1400e2bb0(param_1,&local_40,&local_40);
          local_res8._0_1_ = local_60 >> 7 | (byte)local_res8 * '\x02';
          local_60 = local_66 >> 7 | local_60 * '\x02';
          local_66 = local_5e >> 7 | local_66 * '\x02';
          local_5e = local_64 >> 7 | local_5e * '\x02';
          local_58 = CONCAT13(local_5e,CONCAT12(local_66,CONCAT11(local_60,(byte)local_res8)));
          local_64 = local_5d >> 7 | local_64 * '\x02';
          local_5d = local_62 >> 7 | local_5d * '\x02';
          local_62 = local_5f >> 7 | local_62 * '\x02';
          local_5f = local_68 >> 7 | local_5f * '\x02';
          local_54 = CONCAT13(local_5f,CONCAT12(local_62,CONCAT11(local_5d,local_64)));
          local_68 = local_67 >> 7 | local_68 * '\x02';
          local_67 = local_65 >> 7 | local_67 * '\x02';
          local_65 = local_63 >> 7 | local_65 * '\x02';
          local_63 = local_61 >> 7 | local_63 * '\x02';
          bVar11 = (byte)uVar15 & 7;
          local_61 = bVar12 >> 7 | local_61 * '\x02';
          bVar12 = bVar17 >> 7 | bVar12 * '\x02';
          bVar17 = bVar16 >> 7 | bVar17 * '\x02';
          uVar7 = uVar15 >> 3;
          uVar14 = (int)uVar15 + 1;
          uVar15 = (ulonglong)uVar14;
          local_50 = CONCAT13(local_63,CONCAT12(local_65,CONCAT11(local_67,local_68)));
          bVar16 = *(byte *)(uVar7 + param_2) >> (7 - bVar11 & 0x1f) & 1 | bVar16 * '\x02';
          local_4c = CONCAT13(bVar16,CONCAT12(bVar17,CONCAT11(bVar12,local_61)));
          pbVar1 = (byte *)(uVar7 + param_4);
          *pbVar1 = *pbVar1 ^ ((byte)local_40 & 0x80) >> bVar11;
        } while ((int)uVar14 < 0x80);
        local_48 = local_48 + -1;
      } while (0 < (int)local_48);
      return local_30 << 7;
    }
  }
  return iVar9 << 7;
}



int FUN_1400e42b0(longlong param_1,longlong param_2,int param_3,longlong param_4,uint *param_5,
                 char param_6)

{
  uint *puVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  uint *puVar5;
  int local_64;
  uint *local_58;
  uint local_48;
  uint uStack_44;
  uint local_40;
  uint uStack_3c;
  uint local_38;
  uint local_34;
  uint local_30;
  uint local_2c;
  
  if (*(int *)(param_1 + 0x34) != 0) {
    return -5;
  }
  iVar2 = *(int *)(param_1 + 0x38);
  if ((iVar2 != 2) && (*(int *)(param_1 + 0x3c) == 0)) {
    return -6;
  }
  if ((param_2 != 0) && (0 < param_3)) {
    iVar4 = (int)(param_3 + (param_3 >> 0x1f & 0x7fU)) >> 7;
    iVar3 = iVar4;
    if (iVar2 == 0) {
      for (; 0 < iVar3; iVar3 = iVar3 + -1) {
        FUN_1400e3030(param_1,param_2,param_4);
        param_2 = param_2 + 0x10;
        param_4 = param_4 + 0x10;
      }
      iVar4 = iVar4 << 7;
    }
    else if (iVar2 == 1) {
      if (param_6 == '\0') {
        local_40 = param_5[2];
        local_48 = *param_5;
        uStack_44 = param_5[1];
        uStack_3c = param_5[3];
      }
      else {
        local_40 = *(uint *)(param_1 + 0x48);
        local_48 = *(uint *)(param_1 + 0x40);
        uStack_44 = *(uint *)(param_1 + 0x44);
        uStack_3c = *(uint *)(param_1 + 0x4c);
      }
      if (0 < iVar4) {
        local_58 = (uint *)(param_2 + 8);
        puVar5 = (uint *)(param_4 + 8);
        local_64 = iVar4;
        do {
          puVar1 = (uint *)((param_2 - param_4) + -8 + (longlong)puVar5);
          FUN_1400e3030(param_1,puVar1,&local_38);
          local_34 = local_34 ^ uStack_44;
          local_38 = local_38 ^ local_48;
          local_48 = *puVar1;
          puVar5[-2] = local_38;
          uStack_44 = local_58[-1];
          puVar5[-1] = local_34;
          local_30 = local_30 ^ local_40;
          local_40 = *local_58;
          local_2c = local_2c ^ uStack_3c;
          *puVar5 = local_30;
          uStack_3c = local_58[1];
          local_64 = local_64 + -1;
          local_58 = local_58 + 4;
          puVar5[1] = local_2c;
          puVar5 = puVar5 + 4;
        } while (0 < local_64);
      }
      *(ulonglong *)param_5 = CONCAT44(uStack_44,local_48);
      iVar4 = iVar4 << 7;
      *(ulonglong *)(param_5 + 2) = CONCAT44(uStack_3c,local_40);
    }
    else {
      iVar4 = -1;
    }
    return iVar4;
  }
  return 0;
}



undefined8 * FUN_1400e44d0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  longlong lVar7;
  undefined8 uVar8;
  undefined8 uVar9;
  undefined1 local_40 [40];
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      puVar5 = (undefined8 *)0x0;
    }
    else {
      puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
  }
  else {
    FUN_1400e3590(param_1,*(undefined4 *)(param_1 + 0x38),0);
    pvVar4 = operator_new(0x28);
    puVar5 = (undefined8 *)0x0;
    puVar6 = puVar5;
    if (pvVar4 != (void *)0x0) {
      puVar6 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(puVar6,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,1000,iVar2 + 0x20);
      puVar5 = (undefined8 *)0x0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(puVar6,uVar3);
      FUN_1400b8c40(local_40);
      lVar7 = FUN_1400b8b90(param_2);
      if (lVar7 != 0) {
        uVar8 = FUN_1400b8b90(puVar6);
        iVar2 = FUN_1400b8b80(param_2);
        uVar9 = FUN_1400b8b90(param_2);
        iVar2 = FUN_1400e3750(param_1,uVar9,iVar2 << 3,uVar8,local_40,1);
        if (0 < iVar2) {
          FUN_1400b92d0(local_40);
          return puVar6;
        }
      }
      if (puVar6 != (undefined8 *)0x0) {
        (**(code **)*puVar6)(puVar6,1);
      }
      pvVar4 = operator_new(0x28);
      if (pvVar4 != (void *)0x0) {
        puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
      }
      FUN_1400b92d0(local_40);
    }
  }
  return puVar5;
}



undefined8 *
FUN_1400e4680(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  longlong lVar7;
  undefined8 uVar8;
  undefined8 uVar9;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      puVar5 = (undefined8 *)0x0;
    }
    else {
      puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
  }
  else {
    pvVar4 = operator_new(0x28);
    puVar5 = (undefined8 *)0x0;
    puVar6 = puVar5;
    if (pvVar4 != (void *)0x0) {
      puVar6 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(puVar6,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x3e9,iVar2 + 0x20);
      puVar5 = (undefined8 *)0x0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(puVar6,uVar3);
      lVar7 = FUN_1400b8b90(param_2);
      if (lVar7 != 0) {
        uVar8 = FUN_1400b8b90(puVar6);
        iVar2 = FUN_1400b8b80(param_2);
        uVar9 = FUN_1400b8b90(param_2);
        iVar2 = FUN_1400e3750(param_1,uVar9,iVar2 << 3,uVar8,param_3,0);
        if (0 < iVar2) {
          return puVar6;
        }
      }
      if (puVar6 != (undefined8 *)0x0) {
        (**(code **)*puVar6)(puVar6,1);
      }
      pvVar4 = operator_new(0x28);
      if (pvVar4 != (void *)0x0) {
        puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
      }
    }
  }
  return puVar5;
}



undefined8 *
FUN_1400e4800(undefined4 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 *puVar5;
  longlong lVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      puVar5 = (undefined8 *)0x0;
    }
    else {
      puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
  }
  else {
    FUN_1400b9a00(param_2,*param_1,0x10);
    pvVar4 = operator_new(0x28);
    puVar5 = (undefined8 *)0x0;
    if (pvVar4 != (void *)0x0) {
      puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(puVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x3ea,iVar2 + 0x20);
      puVar5 = (undefined8 *)0x0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(puVar5,uVar3);
      iVar2 = 0;
      lVar6 = FUN_1400b8b90(param_2);
      if (lVar6 != 0) {
        uVar7 = FUN_1400b8b90(puVar5);
        iVar2 = FUN_1400b8b80(param_2);
        uVar8 = FUN_1400b8b90(param_2);
        iVar2 = FUN_1400e3750(param_1,uVar8,iVar2 << 3,uVar7,param_3,0);
      }
      FUN_1400b9c60(param_2,*param_1,0x10,param_4);
      if (iVar2 < 1) {
        if (puVar5 != (undefined8 *)0x0) {
          (**(code **)*puVar5)(puVar5,1);
        }
        pvVar4 = operator_new(0x28);
        puVar5 = (undefined8 *)0x0;
        if (pvVar4 != (void *)0x0) {
          puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
        }
      }
    }
  }
  return puVar5;
}



undefined8 * FUN_1400e49b0(undefined4 *param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 *puVar5;
  longlong lVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      puVar5 = (undefined8 *)0x0;
    }
    else {
      puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
  }
  else {
    FUN_1400e3590(param_1,param_1[0xe],0);
    FUN_1400b9a00(param_2,*param_1,0x10);
    pvVar4 = operator_new(0x28);
    puVar5 = (undefined8 *)0x0;
    if (pvVar4 != (void *)0x0) {
      puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(puVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,0x3eb,iVar2 + 0x20);
      puVar5 = (undefined8 *)0x0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(puVar5,uVar3);
      iVar2 = 0;
      lVar6 = FUN_1400b8b90(param_2);
      if (lVar6 != 0) {
        uVar7 = FUN_1400b8b90(puVar5);
        iVar2 = FUN_1400b8b80(param_2);
        uVar8 = FUN_1400b8b90(param_2);
        iVar2 = FUN_1400e3910(param_1,uVar8,iVar2 << 3,uVar7);
      }
      FUN_1400b9c60(param_2,*param_1,0x10,param_3);
      if (iVar2 < 1) {
        if (puVar5 != (undefined8 *)0x0) {
          (**(code **)*puVar5)(puVar5,1);
        }
        pvVar4 = operator_new(0x28);
        puVar5 = (undefined8 *)0x0;
        if (pvVar4 != (void *)0x0) {
          puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
        }
      }
    }
  }
  return puVar5;
}



undefined8 *
FUN_1400e4b50(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 *puVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      puVar5 = (undefined8 *)0x0;
    }
    else {
      puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
  }
  else {
    FUN_1400e3590(param_1,*(undefined4 *)(param_1 + 0x38),1);
    pvVar4 = operator_new(0x28);
    puVar5 = (undefined8 *)0x0;
    if (pvVar4 != (void *)0x0) {
      puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(puVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x3ef,iVar2 + 0x20);
      puVar5 = (undefined8 *)0x0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(puVar5,uVar3);
      uVar6 = FUN_1400b8b90(puVar5);
      iVar2 = FUN_1400b8b80(param_2);
      uVar7 = FUN_1400b8b90(param_2);
      iVar2 = FUN_1400e42b0(param_1,uVar7,iVar2 << 3,uVar6,param_3,1);
      if (iVar2 < 1) {
        if (puVar5 != (undefined8 *)0x0) {
          (**(code **)*puVar5)(puVar5,1);
        }
        pvVar4 = operator_new(0x28);
        puVar5 = (undefined8 *)0x0;
        if (pvVar4 != (void *)0x0) {
          puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
        }
      }
    }
  }
  return puVar5;
}



undefined8 *
FUN_1400e4cd0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 *puVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      puVar5 = (undefined8 *)0x0;
    }
    else {
      puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
  }
  else {
    pvVar4 = operator_new(0x28);
    puVar5 = (undefined8 *)0x0;
    if (pvVar4 != (void *)0x0) {
      puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(puVar5,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x3ec,iVar2 + 0x20);
      puVar5 = (undefined8 *)0x0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(puVar5,uVar3);
      uVar6 = FUN_1400b8b90(puVar5);
      iVar2 = FUN_1400b8b80(param_2);
      uVar7 = FUN_1400b8b90(param_2);
      iVar2 = FUN_1400e42b0(param_1,uVar7,iVar2 << 3,uVar6,param_3,0);
      if (iVar2 < 1) {
        if (puVar5 != (undefined8 *)0x0) {
          (**(code **)*puVar5)(puVar5,1);
        }
        pvVar4 = operator_new(0x28);
        puVar5 = (undefined8 *)0x0;
        if (pvVar4 != (void *)0x0) {
          puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
        }
      }
    }
  }
  return puVar5;
}



undefined8 *
FUN_1400e4e40(undefined4 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  void *pvVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    pvVar4 = operator_new(0x28);
    if (pvVar4 == (void *)0x0) {
      puVar5 = (undefined8 *)0x0;
    }
    else {
      puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
  }
  else {
    pvVar4 = operator_new(0x28);
    puVar5 = (undefined8 *)0x0;
    puVar6 = puVar5;
    if (pvVar4 != (void *)0x0) {
      puVar6 = (undefined8 *)FUN_1400b8c40(pvVar4);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(puVar6,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x3ed,iVar2 + 0x20);
      puVar5 = (undefined8 *)0x0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(puVar6,uVar3);
      uVar7 = FUN_1400b8b90(puVar6);
      iVar2 = FUN_1400b8b80(param_2);
      uVar8 = FUN_1400b8b90(param_2);
      iVar2 = FUN_1400e42b0(param_1,uVar8,iVar2 << 3,uVar7,param_3,0);
      if (iVar2 < 1) {
        if (puVar6 != (undefined8 *)0x0) {
          (**(code **)*puVar6)(puVar6,1);
        }
        pvVar4 = operator_new(0x28);
        if (pvVar4 != (void *)0x0) {
          puVar5 = (undefined8 *)FUN_1400b8c40(pvVar4);
        }
      }
      else {
        if (*(char *)(param_1 + 1) != '\0') {
          FUN_1400b9870(puVar6);
        }
        FUN_1400b9c60(puVar6,*param_1,0x10,param_4);
        puVar5 = puVar6;
      }
    }
  }
  return puVar5;
}



undefined8 * FUN_1400e4fd0(undefined4 *param_1,undefined8 param_2,longlong *param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  int iVar4;
  void *pvVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  undefined8 uVar8;
  undefined8 uVar9;
  
  iVar2 = FUN_1400b8b80(param_2);
  if (iVar2 == 0) {
    (**(code **)(*param_3 + 0x30))(param_3,"Input data size is 0.");
    pvVar5 = operator_new(0x28);
    if (pvVar5 == (void *)0x0) {
      puVar6 = (undefined8 *)0x0;
    }
    else {
      puVar6 = (undefined8 *)FUN_1400b8c40(pvVar5);
    }
  }
  else {
    FUN_1400e3590(param_1,param_1[0xe],1);
    pvVar5 = operator_new(0x28);
    puVar6 = (undefined8 *)0x0;
    puVar7 = puVar6;
    if (pvVar5 != (void *)0x0) {
      puVar7 = (undefined8 *)FUN_1400b8c40(pvVar5);
    }
    iVar2 = FUN_1400b8b80(param_2);
    cVar1 = FUN_1400ba520(puVar7,iVar2 + 0x20);
    if (cVar1 == '\0') {
      iVar2 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_3,0x3ee,iVar2 + 0x20);
      puVar6 = (undefined8 *)0x0;
    }
    else {
      uVar3 = FUN_1400b8b80(param_2);
      FUN_1400b8c10(puVar7,uVar3);
      uVar8 = FUN_1400b8b90(puVar7);
      iVar2 = FUN_1400b8b80(param_2);
      uVar9 = FUN_1400b8b90(param_2);
      iVar2 = FUN_1400e3dc0(param_1,uVar9,iVar2 << 3,uVar8);
      if (iVar2 < 1) {
        (**(code **)(*param_3 + 0x28))(param_3,"Decryption failed");
        FUN_1400cf520(param_3,"error_code",iVar2);
        if (puVar7 != (undefined8 *)0x0) {
          (**(code **)*puVar7)(puVar7,1);
        }
        pvVar5 = operator_new(0x28);
        if (pvVar5 != (void *)0x0) {
          puVar6 = (undefined8 *)FUN_1400b8c40(pvVar5);
        }
      }
      else {
        if (*(char *)(param_1 + 1) != '\0') {
          FUN_1400b9870(puVar7);
        }
        iVar2 = FUN_1400b8b80(puVar7);
        FUN_1400b9c60(puVar7,*param_1,0x10,param_3);
        iVar4 = FUN_1400b8b80(puVar7);
        puVar6 = puVar7;
        if ((iVar2 != 0) && (iVar4 == 0)) {
          FUN_1400cf520(param_3,"outSizeBeforeUnpadding",iVar2);
          FUN_1400cf520(param_3,"outSizeAfterUnpadding",0);
        }
      }
    }
  }
  return puVar6;
}



void FUN_1400e51d0(undefined4 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  char cVar3;
  int iVar4;
  undefined4 uVar5;
  
  iVar4 = FUN_1400b8b80(param_2);
  if (iVar4 != 0) {
    FUN_1400e3590(param_1,param_1[0xe],1);
    iVar4 = FUN_1400b8b80(param_2);
    cVar3 = FUN_1400ba520(param_3,iVar4 + 0x20);
    if (cVar3 == '\0') {
      iVar4 = FUN_1400b8b80(param_2);
      FUN_1400cf7b0(param_4,0x42f,iVar4 + 0x20);
      return;
    }
    uVar5 = FUN_1400b8b80(param_2);
    FUN_1400b8c10(param_3,uVar5);
    uVar1 = FUN_1400b8b90(param_3);
    iVar4 = FUN_1400b8b80(param_2);
    uVar2 = FUN_1400b8b90(param_2);
    iVar4 = FUN_1400e3dc0(param_1,uVar2,iVar4 << 3,uVar1);
    if (0 < iVar4) {
      if (*(char *)(param_1 + 1) != '\0') {
        FUN_1400b9870(param_3);
      }
      FUN_1400b9c60(param_3,*param_1,0x10,param_4);
    }
  }
  return;
}



undefined8 * FUN_1400e52e0(undefined8 *param_1)

{
  *param_1 = Pkcs7_EncryptedData::vftable;
  FUN_1400b8c40();
  return param_1;
}



char FUN_1400e5310(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                  longlong *param_5)

{
  longlong lVar1;
  longlong lVar2;
  char cVar3;
  char cVar4;
  undefined8 uVar5;
  undefined1 local_b8 [160];
  
  cVar4 = '\0';
  FUN_1400b6fd0(local_b8);
  FUN_1400b86c0(local_b8,param_4);
  lVar1 = param_1 + 0x10;
  cVar3 = FUN_1400bdf70(lVar1,"1.2.840.113549.1.12.1.6");
  if (cVar3 == '\0') {
    cVar3 = FUN_1400bdf70(lVar1,"1.2.840.113549.1.12.1.1");
    if (cVar3 == '\0') {
      cVar3 = FUN_1400bdf70(lVar1,"1.2.840.113549.1.12.1.2");
      if (cVar3 == '\0') {
        cVar3 = FUN_1400bdf70(lVar1,"1.2.840.113549.1.12.1.3");
        if (cVar3 == '\0') {
          cVar3 = FUN_1400bdf70(lVar1,"1.2.840.113549.1.12.1.4");
          if (cVar3 == '\0') {
            cVar3 = FUN_1400bdf70(lVar1,"1.2.840.113549.1.12.1.5");
            if (cVar3 == '\0') {
              (**(code **)(*param_5 + 0x28))(param_5,"Cannot password decrypt using this algorithm")
              ;
              lVar2 = *param_5;
              uVar5 = FUN_1400b8b90(lVar1);
              (**(code **)(lVar2 + 0x58))(param_5,&DAT_140207ba0,uVar5);
            }
            else {
              cVar4 = FUN_140117e70(local_b8,&DAT_140209300,&DAT_140207694,0x80,param_1 + 0x40,
                                    *(undefined4 *)(param_1 + 0x68),param_2,param_3,param_5);
              if (cVar4 == '\0') {
                (**(code **)(*param_5 + 0x28))
                          (param_5,"PKCS12 decryption failed (SHA1 and 128-bit RC2)");
              }
            }
          }
          else {
            cVar4 = FUN_140117e70(local_b8,&DAT_140209300,&DAT_140207d60,0x80,param_1 + 0x40,
                                  *(undefined4 *)(param_1 + 0x68),param_2,param_3,param_5);
            if (cVar4 == '\0') {
              (**(code **)(*param_5 + 0x28))
                        (param_5,"PKCS12 decryption failed (SHA1 and 2 key triple DES)");
            }
          }
        }
        else {
          cVar4 = FUN_140117e70(local_b8,&DAT_140209300,&DAT_140207d60,0xc0,param_1 + 0x40,
                                *(undefined4 *)(param_1 + 0x68),param_2,param_3,param_5);
          if (cVar4 == '\0') {
            (**(code **)(*param_5 + 0x28))
                      (param_5,"PKCS12 decryption failed (SHA1 and 3 key triple DES)");
          }
        }
      }
      else {
        cVar4 = FUN_140117e70(local_b8,&DAT_140209300,&DAT_140241f18,0x28,param_1 + 0x40,
                              *(undefined4 *)(param_1 + 0x68),param_2,param_3,param_5);
        if (cVar4 == '\0') {
          (**(code **)(*param_5 + 0x28))(param_5,"PKCS12 decryption failed (SHA1 and 40-bit RC4)");
        }
      }
    }
    else {
      cVar4 = FUN_140117e70(local_b8,&DAT_140209300,&DAT_140241f18,0x80,param_1 + 0x40,
                            *(undefined4 *)(param_1 + 0x68),param_2,param_3,param_5);
      if (cVar4 == '\0') {
        (**(code **)(*param_5 + 0x28))(param_5,"PKCS12 decryption failed (SHA1 and 128-bit RC4)");
      }
    }
  }
  else {
    cVar4 = FUN_140117e70(local_b8,&DAT_140209300,&DAT_140207694,0x28,param_1 + 0x40,
                          *(undefined4 *)(param_1 + 0x68),param_2,param_3,param_5);
    if (cVar4 == '\0') {
      (**(code **)(*param_5 + 0x28))(param_5,"PKCS12 decryption failed (SHA1 and 40-bit RC2)");
    }
  }
  FUN_1400b7090(local_b8);
  return cVar4;
}



undefined8 * FUN_1400e5690(undefined8 *param_1)

{
  FUN_1400d0eb0();
  *param_1 = SignerInfo::vftable;
  FUN_1400b6fd0(param_1 + 2);
  FUN_1400b6fd0(param_1 + 0x16);
  FUN_1400b6fd0(param_1 + 0x2a);
  FUN_1400b6fd0(param_1 + 0x3e);
  FUN_1400b6fd0(param_1 + 0x52);
  FUN_1400b8c40(param_1 + 0x66);
  FUN_1400b6fd0(param_1 + 0x6b);
  FUN_1400b8c40(param_1 + 0x7f);
  return param_1;
}



void FUN_1400e5730(undefined8 *param_1)

{
  *param_1 = SignerInfo::vftable;
  FUN_1400b92d0(param_1 + 0x7f);
  FUN_1400b7090(param_1 + 0x6b);
  FUN_1400b92d0(param_1 + 0x66);
  FUN_1400b7090(param_1 + 0x52);
  FUN_1400b7090(param_1 + 0x3e);
  FUN_1400b7090(param_1 + 0x2a);
  FUN_1400b7090(param_1 + 0x16);
  FUN_1400b7090(param_1 + 2);
  FUN_1400d0ee0(param_1);
  return;
}



BADSPACEBASE * FUN_1400e57d0(longlong param_1,longlong param_2,longlong *param_3)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  char cVar7;
  uint uVar8;
  int iVar9;
  undefined8 *puVar10;
  undefined8 uVar11;
  int iVar12;
  undefined1 local_60 [56];
  
  if (param_2 != 0) {
    (**(code **)(*param_3 + 0x48))(param_3,"IssuerAndSerialNumber",1,param_3,0xfffffffffffffffe);
    FUN_1400bbe30(param_1 + 8);
    FUN_140118e00(param_2,param_1 + 8);
    puVar10 = (undefined8 *)FUN_140119210(param_2);
    lVar1 = param_1 + 0x38;
    FUN_1400bbe30(lVar1);
    lVar2 = param_1 + 0x68;
    FUN_1400bbe30(lVar2);
    lVar3 = param_1 + 200;
    FUN_1400bbe30(lVar3);
    lVar4 = param_1 + 0xf8;
    FUN_1400bbe30(lVar4);
    lVar5 = param_1 + 0x98;
    FUN_1400bbe30(lVar5);
    param_1 = param_1 + 0x128;
    FUN_1400bbe30(param_1);
    FUN_1401194f0(puVar10,&DAT_1402420c0,lVar1);
    uVar8 = FUN_1400bbb10(lVar1);
    uVar8 = uVar8 & 0x80000001;
    if ((int)uVar8 < 0) {
      uVar8 = (uVar8 - 1 | 0xfffffffe) + 1;
    }
    if (uVar8 != 0) {
      FUN_1400bbf40(lVar1,&DAT_140279374);
    }
    FUN_1400bc2c0(lVar1);
    lVar6 = *param_3;
    uVar11 = FUN_1400b8b90(lVar1);
    (**(code **)(lVar6 + 0x58))(param_3,"serialNumber1",uVar11);
    FUN_140118fe0(puVar10,0);
    iVar9 = FUN_1401184f0(puVar10);
    FUN_1400bcc20(local_60);
    iVar12 = 0;
    if (0 < iVar9) {
      do {
        FUN_140118fe0(puVar10,iVar12);
        FUN_140118fe0(puVar10,0);
        FUN_1400bbe30(local_60);
        FUN_1401194f0(puVar10,&DAT_140207ba0,local_60);
        cVar7 = FUN_1400bdf70(local_60,"2.5.4.3");
        if (cVar7 == '\0') {
          cVar7 = FUN_1400bdf70(local_60,"2.5.4.6");
          if (cVar7 != '\0') {
            cVar7 = FUN_1401194f0(puVar10,&DAT_1402420a0,lVar3);
            lVar1 = lVar3;
            goto joined_r0x0001400e5a59;
          }
          cVar7 = FUN_1400bdf70(local_60,"2.5.4.7");
          if (cVar7 != '\0') {
            cVar7 = FUN_1401194f0(puVar10,&DAT_1402420a0,param_1);
            lVar1 = param_1;
            goto joined_r0x0001400e5a59;
          }
          cVar7 = FUN_1400bdf70(local_60,"2.5.4.8");
          if (cVar7 != '\0') {
            cVar7 = FUN_1401194f0(puVar10,&DAT_1402420a0,lVar4);
            lVar1 = lVar4;
            goto joined_r0x0001400e5a59;
          }
          cVar7 = FUN_1400bdf70(local_60,"2.5.4.10");
          if (cVar7 != '\0') {
            cVar7 = FUN_1401194f0(puVar10,&DAT_1402420a0,lVar5);
            lVar1 = lVar5;
            goto joined_r0x0001400e5a59;
          }
        }
        else {
          cVar7 = FUN_1401194f0(puVar10,&DAT_1402420a0,lVar2);
          lVar1 = lVar2;
joined_r0x0001400e5a59:
          if (cVar7 == '\0') {
            FUN_1401194f0(puVar10,"printable",lVar1);
          }
        }
        FUN_140119290(puVar10);
        FUN_140119290(puVar10);
        iVar12 = iVar12 + 1;
      } while (iVar12 < iVar9);
    }
    if (puVar10 != (undefined8 *)0x0) {
      (**(code **)*puVar10)(puVar10,1);
    }
    lVar1 = *param_3;
    uVar11 = FUN_1400b8b90(lVar2);
    (**(code **)(lVar1 + 0x58))(param_3,"issuerCommonName",uVar11);
    lVar1 = *param_3;
    uVar11 = FUN_1400b8b90(lVar3);
    (**(code **)(lVar1 + 0x58))(param_3,"issuerCountry",uVar11);
    lVar1 = *param_3;
    uVar11 = FUN_1400b8b90(lVar4);
    (**(code **)(lVar1 + 0x58))(param_3,"issuerState",uVar11);
    lVar1 = *param_3;
    uVar11 = FUN_1400b8b90(param_1);
    (**(code **)(lVar1 + 0x58))(param_3,"issuerLocality",uVar11);
    lVar1 = *param_3;
    uVar11 = FUN_1400b8b90(lVar5);
    (**(code **)(lVar1 + 0x58))(param_3,"issuerOrganization",uVar11);
    (**(code **)(*param_3 + 0x50))(param_3);
    FUN_1400bceb0(local_60);
    register0x00000020 = (BADSPACEBASE *)0x1;
  }
  return register0x00000020;
}



undefined8 * FUN_1400e5b60(undefined8 *param_1)

{
  *param_1 = IssuerAndSerialNumber::vftable;
  FUN_1400bcc20(param_1 + 1);
  FUN_1400bcc20(param_1 + 7);
  FUN_1400bcc20(param_1 + 0xd);
  FUN_1400bcc20(param_1 + 0x13);
  FUN_1400bcc20(param_1 + 0x19);
  FUN_1400bcc20(param_1 + 0x1f);
  FUN_1400bcc20(param_1 + 0x25);
  return param_1;
}



void FUN_1400e5be0(undefined8 *param_1)

{
  *param_1 = IssuerAndSerialNumber::vftable;
  FUN_1400bceb0(param_1 + 0x25);
  FUN_1400bceb0(param_1 + 0x1f);
  FUN_1400bceb0(param_1 + 0x19);
  FUN_1400bceb0(param_1 + 0x13);
  FUN_1400bceb0(param_1 + 0xd);
  FUN_1400bceb0(param_1 + 7);
  FUN_1400bceb0(param_1 + 1);
  return;
}



void FUN_1400e5c60(longlong param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  longlong lVar2;
  undefined8 uVar3;
  int iVar4;
  undefined1 local_70 [48];
  undefined1 local_40 [56];
  
  (**(code **)(*param_2 + 0x48))(param_2,"RecipientInfos",1,param_4,0xfffffffffffffffe);
  FUN_1400bcc20(local_70);
  FUN_1400bcc20(local_40);
  iVar1 = FUN_140139d70(param_1 + 8);
  iVar4 = 0;
  if (0 < iVar1) {
    do {
      lVar2 = FUN_1400d0aa0(param_1 + 8,iVar4);
      if (lVar2 != 0) {
        FUN_1400bbe30(local_70);
        FUN_1400bdc90(local_70,lVar2 + 0x48);
        FUN_1400bc2c0(local_70);
        FUN_1400bbe30(local_40);
        FUN_1400bdc90(local_40,lVar2 + 0x78);
        (**(code **)(*param_2 + 0x48))(param_2,"recipient",1);
        lVar2 = *param_2;
        uVar3 = FUN_1400b8b90(local_70);
        (**(code **)(lVar2 + 0x58))(param_2,"certSerialNum",uVar3);
        lVar2 = *param_2;
        uVar3 = FUN_1400b8b90(local_40);
        (**(code **)(lVar2 + 0x58))(param_2,"certIssuerCN",uVar3);
        (**(code **)(*param_2 + 0x50))(param_2);
      }
      iVar4 = iVar4 + 1;
    } while (iVar4 < iVar1);
  }
  (**(code **)(*param_2 + 0x50))(param_2);
  FUN_1400bceb0(local_40);
  FUN_1400bceb0(local_70);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

char FUN_1400e5dd0(longlong param_1,undefined8 param_2,undefined8 param_3,longlong *param_4)

{
  char cVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  undefined1 auStack_d48 [32];
  undefined8 local_d28;
  undefined1 local_d18 [3296];
  ulonglong local_38;
  
  local_d28 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_d48;
  FUN_1400b0310(local_d18);
  cVar1 = FUN_1400bdf70(param_1 + 0x40,"1.2.840.113549.3.4");
  if (cVar1 != '\0') {
    iVar3 = FUN_1400b8b80(param_2);
    *(int *)(param_1 + 200) = iVar3 << 3;
  }
  cVar2 = FUN_1400b3880(local_d18,param_1 + 0x30,param_4);
  uVar4 = FUN_1400b8b80(param_2);
  FUN_1400cf520(param_4,"symmetricKeySizeInBytes",uVar4);
  FUN_1400b0190(local_d18,param_2);
  cVar1 = '\0';
  if (cVar2 != '\0') {
    uVar4 = FUN_1400b8b80(param_1 + 0xd0);
    FUN_1400cf520(param_4,"numBytesToDecrypt",uVar4);
    cVar1 = FUN_1400b66d0(local_d18,param_1 + 0xd0,param_3,param_4);
    if (cVar1 == '\0') {
      (**(code **)(*param_4 + 0x28))(param_4,"Symmetric decryption failed.");
    }
    else {
      uVar4 = FUN_1400b8b80(param_3);
      FUN_1400cf520(param_4,"symmetricDecryptOutputSize",uVar4);
    }
  }
  FUN_1400b0680(local_d18);
  return cVar1;
}



longlong FUN_1400e5f10(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                      undefined1 *param_5,undefined8 param_6,undefined1 param_7)

{
  longlong lVar1;
  longlong *plVar2;
  bool bVar3;
  bool bVar4;
  undefined1 *puVar5;
  char cVar6;
  int iVar7;
  longlong lVar8;
  undefined8 uVar9;
  undefined8 uVar10;
  int iVar11;
  undefined1 local_98 [48];
  undefined1 local_68 [48];
  
  puVar5 = param_5;
  *param_5 = 0;
  FUN_1400b8b30(param_3);
  plVar2 = (longlong *)CONCAT44(param_6._4_4_,(int)param_6);
  (**(code **)(*plVar2 + 0x48))(plVar2,"FindPrivateKeyFromSystemCerts",1);
  param_1 = param_1 + 8;
  param_6._0_4_ = FUN_140139d70(param_1);
  FUN_1400cf520(plVar2,"NumRecipientInfos",(int)param_6);
  FUN_1400bcc20(local_98);
  FUN_1400bcc20(local_68);
  bVar4 = false;
  bVar3 = false;
  lVar8 = 0;
  iVar11 = 0;
  if (0 < (int)param_6) {
    do {
      lVar8 = FUN_1400d0aa0(param_1,iVar11);
      if (lVar8 != 0) {
        FUN_1400bbe30(local_98);
        FUN_1400bdc90(local_98,lVar8 + 0x48);
        FUN_1400bc2c0(local_98);
        FUN_1400bbe30(local_68);
        FUN_1400bdc90(local_68,lVar8 + 0x78);
        lVar1 = *plVar2;
        uVar9 = FUN_1400b8b90(local_98);
        (**(code **)(lVar1 + 0x58))(plVar2,"certSerialNumber",uVar9);
        lVar1 = *plVar2;
        uVar9 = FUN_1400b8b90(local_68);
        (**(code **)(lVar1 + 0x58))(plVar2,"certIssuerCN",uVar9);
        lVar1 = *plVar2;
        uVar9 = FUN_1400b8b90(lVar8 + 0x168);
        (**(code **)(lVar1 + 0x58))(plVar2,"subjectKeyIdentifier",uVar9);
        param_5._0_1_ = '\0';
        iVar7 = FUN_1400bbb10(lVar8 + 0x168);
        if (iVar7 != 0) {
          uVar9 = FUN_1400b8b90(lVar8 + 0x168);
          cVar6 = FUN_1400d2d70(param_2,uVar9,param_3,param_4,&param_5,plVar2,param_7);
          if (cVar6 != '\0') break;
          if ((char)param_5 != '\0') {
            *puVar5 = 1;
          }
        }
        cVar6 = FUN_1400bc7e0(local_98,&DAT_1402422b4);
        if (cVar6 != '\0') {
          FUN_1400bcfa0(local_98,&DAT_1402422b4,&DAT_14027a10a);
          uVar9 = FUN_1400b8b90(local_68);
          uVar10 = FUN_1400b8b90(local_98);
          cVar6 = FUN_1400d2fa0(param_2,uVar10,uVar9,param_3,param_4,&param_5,plVar2,param_7);
          if (cVar6 != '\0') break;
          if ((char)param_5 != '\0') {
            *puVar5 = 1;
          }
          FUN_1400bbf40(local_98,&DAT_1402422b4);
        }
        uVar9 = FUN_1400b8b90(local_68);
        uVar10 = FUN_1400b8b90(local_98);
        cVar6 = FUN_1400d2fa0(param_2,uVar10,uVar9,param_3,param_4,&param_5,plVar2,param_7);
        if (cVar6 != '\0') break;
        if ((char)param_5 != '\0') {
          *puVar5 = 1;
        }
        iVar7 = FUN_1400bbb10(lVar8 + 0x168);
        if ((iVar7 != 0) && (iVar7 = FUN_1400bbb10(local_98), iVar7 == 0)) {
          iVar7 = FUN_1400bbb10(local_68);
          bVar3 = bVar4;
          if (iVar7 == 0) {
            bVar4 = true;
            bVar3 = true;
          }
        }
        lVar8 = 0;
      }
      iVar11 = iVar11 + 1;
    } while (iVar11 < (int)param_6);
  }
  (**(code **)(*plVar2 + 0x50))(plVar2);
  if (lVar8 != 0) {
    *puVar5 = 0;
  }
  if (((bVar3) && (lVar8 == 0)) && (lVar8 = FUN_1400d0aa0(param_1,0), lVar8 != 0)) {
    param_5._0_1_ = '\0';
    cVar6 = FUN_1400d3200(param_2,param_3,param_4,&param_5,plVar2,param_7);
    if (cVar6 == '\0') {
      lVar8 = 0;
    }
    else {
      (**(code **)(*plVar2 + 0x30))(plVar2,"No match was found for the SubjectKeyIdentifier.");
      (**(code **)(*plVar2 + 0x30))(plVar2,"Using the first available cert...");
    }
  }
  FUN_1400bceb0(local_68);
  FUN_1400bceb0(local_98);
  return lVar8;
}



undefined8 *
FUN_1400e62a0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,longlong *param_6,char param_7)

{
  char cVar1;
  int iVar2;
  int iVar3;
  longlong lVar4;
  void *pvVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  uint uVar8;
  undefined1 local_60 [40];
  undefined8 *puVar9;
  
  FUN_1400b8c40(local_60);
  (**(code **)(*param_6 + 0x48))(param_6,"Pkcs7_SignedData_findSignerCert",1);
  iVar2 = FUN_140139d70(param_4);
  if (param_7 != '\0') {
    FUN_1400cf520(param_6,"numPkcs7Certs",iVar2);
  }
  puVar7 = (undefined8 *)0x0;
  puVar9 = puVar7;
  if (0 < iVar2) {
    do {
      lVar4 = FUN_1400d0aa0(param_4,puVar9);
      if ((lVar4 != 0) && (iVar3 = FUN_1400b8b80(lVar4), iVar3 != 0)) {
        pvVar5 = operator_new(0x200);
        puVar6 = puVar7;
        if (pvVar5 != (void *)0x0) {
          puVar6 = (undefined8 *)FUN_140119b70(pvVar5);
        }
        cVar1 = FUN_140119860(puVar6,lVar4,param_6,param_7);
        if ((cVar1 != '\0') &&
           (cVar1 = FUN_14011ab00(puVar6,param_2,param_3,param_6), cVar1 != '\0')) {
          if (param_7 != '\0') {
            (**(code **)(*param_6 + 0x30))(param_6,"Found matching certificate in PKCS7");
          }
          (**(code **)(*param_6 + 0x50))(param_6);
          FUN_1400b92d0(local_60);
          return puVar6;
        }
        if (puVar6 != (undefined8 *)0x0) {
          (**(code **)*puVar6)(puVar6,1);
        }
      }
      uVar8 = (int)puVar9 + 1;
      puVar9 = (undefined8 *)(ulonglong)uVar8;
    } while ((int)uVar8 < iVar2);
  }
  cVar1 = FUN_1400d3290(param_5,param_3,param_2,local_60,param_6,param_7);
  if (cVar1 == '\0') {
    (**(code **)(*param_6 + 0x50))(param_6);
  }
  else {
    pvVar5 = operator_new(0x200);
    if (pvVar5 != (void *)0x0) {
      puVar7 = (undefined8 *)FUN_140119b70(pvVar5);
    }
    cVar1 = FUN_140119860(puVar7,local_60,param_6,param_7);
    if (cVar1 != '\0') {
      (**(code **)(*param_6 + 0x50))();
      FUN_1400b92d0(local_60);
      return puVar7;
    }
    (**(code **)(*param_6 + 0x28))(param_6,"Failed to load certificate DER...");
    if (puVar7 != (undefined8 *)0x0) {
      (**(code **)*puVar7)(puVar7,1);
    }
    (**(code **)(*param_6 + 0x50))(param_6);
  }
  FUN_1400b92d0(local_60);
  return (undefined8 *)0x0;
}



char FUN_1400e64e0(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  char *pcVar2;
  char *pcVar3;
  undefined1 local_48 [8];
  undefined8 local_40;
  undefined1 local_38 [48];
  
  local_40 = 0xfffffffffffffffe;
  FUN_1400bbe30(param_3);
  FUN_1400bebf0(local_48);
  FUN_1400bcc20(local_38);
  cVar1 = FUN_14011d520(param_2,1,local_38,0,local_48,0);
  if (cVar1 != '\0') {
    pcVar2 = (char *)FUN_1400b8b90(local_38);
    pcVar2 = strstr(pcVar2,"<oid>1.2.840.113549.1.9.5</oid>");
    if (pcVar2 != (char *)0x0) {
      pcVar2 = strstr(pcVar2,"<utctime>");
      if (pcVar2 != (char *)0x0) {
        pcVar2 = pcVar2 + 9;
        pcVar3 = strchr(pcVar2,0x3c);
        if (pcVar3 != (char *)0x0) {
          FUN_1400bc8a0(param_3,pcVar2,(int)pcVar3 - (int)pcVar2);
        }
      }
    }
  }
  FUN_1400bceb0(local_38);
  FUN_1400bec20(local_48);
  return cVar1;
}



void FUN_1400e65d0(longlong param_1)

{
  FUN_14011d980(param_1 + 0xe8);
  FUN_14011d980(param_1 + 200);
  FUN_14011d980(param_1 + 0xa8);
  FUN_14011d980(param_1 + 0x88);
  FUN_14011d980(param_1 + 0x68);
  FUN_14011d980(param_1 + 0x48);
  FUN_14011d980(param_1 + 0x28);
  FUN_14011d980(param_1 + 8);
  return;
}



longlong FUN_1400e6650(longlong param_1,undefined8 param_2,undefined8 param_3,longlong *param_4)

{
  char cVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  int iVar5;
  undefined1 local_b8 [48];
  undefined1 local_88 [48];
  undefined8 local_58;
  undefined1 local_50 [56];
  
  local_58 = 0xfffffffffffffffe;
  FUN_1400bccc0(local_88);
  cVar1 = FUN_1400bc7e0(local_88,&DAT_1402422b4);
  if (cVar1 != '\0') {
    FUN_1400bcfa0(local_88,&DAT_1402422b4,&DAT_14027a10a);
  }
  (**(code **)(*param_4 + 0x48))(param_4,"FindMatchingRecipientInfo",1);
  lVar4 = *param_4;
  uVar3 = FUN_1400b8b90(local_88);
  (**(code **)(lVar4 + 0x58))(param_4,"NeedSerial",uVar3);
  lVar4 = *param_4;
  uVar3 = FUN_1400b8b90(param_3);
  (**(code **)(lVar4 + 0x58))(param_4,"NeedIssuerCN",uVar3);
  iVar2 = FUN_140139d70(param_1 + 8);
  FUN_1400cf520(param_4,"NumRecipientInfos",iVar2);
  FUN_1400bcc20(local_b8);
  FUN_1400bcc20(local_50);
  lVar4 = 0;
  iVar5 = 0;
  if (0 < iVar2) {
    do {
      lVar4 = FUN_1400d0aa0(param_1 + 8,iVar5);
      if (lVar4 != 0) {
        FUN_1400bbe30(local_b8);
        FUN_1400bdc90(local_b8,lVar4 + 0x48);
        FUN_1400bc2c0(local_b8);
        cVar1 = FUN_1400bc7e0(local_b8,&DAT_1402422b4);
        if (cVar1 != '\0') {
          FUN_1400bcfa0(local_b8,&DAT_1402422b4,&DAT_14027a10a);
        }
        cVar1 = FUN_1400be050(local_b8,local_88);
        if (cVar1 != '\0') {
          FUN_1400bbe30(local_50);
          FUN_1400bdc90(local_50,lVar4 + 0x78);
          cVar1 = FUN_1400bdfc0(local_50,param_3);
          if (cVar1 != '\0') {
            (**(code **)(*param_4 + 0x30))(param_4,"Found matching RecipientInfo");
            break;
          }
        }
        lVar4 = 0;
      }
      iVar5 = iVar5 + 1;
    } while (iVar5 < iVar2);
  }
  (**(code **)(*param_4 + 0x50))(param_4);
  FUN_1400bceb0(local_50);
  FUN_1400bceb0(local_b8);
  FUN_1400bceb0(local_88);
  return lVar4;
}



undefined8 * FUN_1400e6860(undefined8 *param_1)

{
  *param_1 = Pkcs7_SignedData::vftable;
  FUN_1400b8c40(param_1 + 1);
  FUN_1400d0a70(param_1 + 6);
  FUN_1400d0a70(param_1 + 0xb);
  FUN_1400d0a70(param_1 + 0x10);
  FUN_1400d0a70(param_1 + 0x15);
  return param_1;
}



void FUN_1400e68d0(undefined8 *param_1)

{
  *param_1 = Pkcs7_SignedData::vftable;
  FUN_1400d0d30(param_1 + 0xb);
  FUN_1400d0d30(param_1 + 6);
  FUN_1400d0d30(param_1 + 0x10);
  FUN_1400d0d30(param_1 + 0x15);
  FUN_1400d0e10(param_1 + 0x15);
  FUN_1400d0e10(param_1 + 0x10);
  FUN_1400d0e10(param_1 + 0xb);
  FUN_1400d0e10(param_1 + 6);
  FUN_1400b92d0(param_1 + 1);
  return;
}



void FUN_1400e6980(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  int iVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  
  (**(code **)(*param_2 + 0x48))(param_2,"AlgorithmIdentifier",1);
  lVar1 = *param_2;
  uVar4 = FUN_1400b8b90(param_1 + 0x10);
  (**(code **)(lVar1 + 0x58))(param_2,&DAT_140207ba0,uVar4);
  if (*(int *)(param_1 + 0x68) != 0) {
    FUN_1400cf520(param_2,"numIterations");
  }
  iVar2 = FUN_1400b8b80(param_1 + 0x40);
  if (iVar2 != 0) {
    uVar3 = FUN_1400b8b80(param_1 + 0x40);
    uVar4 = FUN_1400b8b90(param_1 + 0x40);
    FUN_1400cf340(param_2,&DAT_140242528,uVar4,uVar3);
  }
  if (*(int *)(param_1 + 0x98) != 0) {
    FUN_1400cf520(param_2,"keyLengthInBits");
  }
  param_1 = param_1 + 0x70;
  iVar2 = FUN_1400b8b80(param_1);
  if (iVar2 != 0) {
    uVar3 = FUN_1400b8b80(param_1);
    uVar4 = FUN_1400b8b90(param_1);
    FUN_1400cf340(param_2,&DAT_140207e30,uVar4,uVar3);
  }
                    // WARNING: Could not recover jumptable at 0x0001400e6a83. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_2 + 0x50))(param_2);
  return;
}



void FUN_1400e6a90(undefined8 *param_1)

{
  *param_1 = AlgorithmIdentifier::vftable;
  FUN_1400b92d0(param_1 + 0xe);
  FUN_1400b92d0(param_1 + 8);
  FUN_1400bceb0(param_1 + 2);
  FUN_1400d0ee0(param_1);
  return;
}



undefined8 * FUN_1400e6ae0(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 *puVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  bool bVar8;
  
  puVar5 = (undefined8 *)FUN_140116780();
  uVar6 = FUN_1400b8b90(param_1 + 0x10);
  uVar6 = FUN_140116400(uVar6);
  FUN_140114c20(puVar5,uVar6);
  cVar2 = FUN_1400bdf70(param_1 + 0x10,"1.2.840.113549.1.1.1");
  if (cVar2 == '\0') {
    cVar2 = FUN_1400bdf70(param_1 + 0x10,"1.2.840.113549.3.2");
    if (cVar2 == '\0') {
      cVar2 = FUN_1400bdf70(param_1 + 0x10,"2.16.840.1.101.3.4.1.2");
      if ((((cVar2 == '\0') &&
           (cVar2 = FUN_1400bdf70(param_1 + 0x10,"2.16.840.1.101.3.4.1.22"), cVar2 == '\0')) &&
          (cVar2 = FUN_1400bdf70(param_1 + 0x10,"2.16.840.1.101.3.4.1.42"), cVar2 == '\0')) &&
         ((cVar2 = FUN_1400bdf70(param_1 + 0x10,"1.3.14.3.2.7"), cVar2 == '\0' &&
          (cVar2 = FUN_1400bdf70(param_1 + 0x10,"1.2.840.113549.3.7"), cVar2 == '\0')))) {
        cVar2 = FUN_1400bdf70(param_1 + 0x10,"1.2.840.113549.3.4");
        if (cVar2 == '\0') {
          cVar2 = FUN_1400bc7e0(param_1 + 0x10,"1.2.840.113549.1.12.1");
          if (cVar2 == '\0') {
            if (puVar5 != (undefined8 *)0x0) {
              (**(code **)*puVar5)(puVar5,1);
            }
            (**(code **)(*param_2 + 0x28))(param_2,"Unrecognized encryption algorithm OID");
            lVar1 = *param_2;
            uVar6 = FUN_1400b8b90(param_1 + 0x10);
            (**(code **)(lVar1 + 0x58))(param_2,&DAT_140207ba0,uVar6);
            return (undefined8 *)0x0;
          }
          uVar6 = FUN_140116780();
          uVar4 = FUN_1400b8b80(param_1 + 0x40);
          uVar7 = FUN_1400b8b90(param_1 + 0x40);
          uVar7 = FUN_140116200(uVar7,uVar4);
          FUN_140114c20(uVar6,uVar7);
          uVar7 = FUN_140115ff0(*(undefined4 *)(param_1 + 0x68));
          FUN_140114c20(uVar6,uVar7);
        }
        else {
          uVar6 = FUN_140116700();
        }
      }
      else {
        uVar4 = FUN_1400b8b80(param_1 + 0x70);
        uVar6 = FUN_1400b8b90(param_1 + 0x70);
        uVar6 = FUN_140116200(uVar6,uVar4);
      }
    }
    else {
      uVar6 = FUN_140116780();
      iVar3 = *(int *)(param_1 + 0x98);
      if (iVar3 < 0x100) {
        if (iVar3 == 0x28) {
          iVar3 = 0xa0;
        }
        else if (iVar3 == 0x38) {
          iVar3 = 0x34;
        }
        else {
          bVar8 = iVar3 != 0x40;
          iVar3 = 0x78;
          if (bVar8) {
            iVar3 = 0x3a;
          }
        }
      }
      uVar7 = FUN_140115ff0(iVar3);
      FUN_140114c20(uVar6,uVar7);
      iVar3 = FUN_1400b8b80(param_1 + 0x70);
      if (iVar3 != 8) {
        FUN_1400b8b30(param_1 + 0x70);
        FUN_1400c0600(8,param_1 + 0x70);
      }
      uVar4 = FUN_1400b8b80(param_1 + 0x70);
      uVar7 = FUN_1400b8b90(param_1 + 0x70);
      uVar7 = FUN_140116200(uVar7,uVar4);
      FUN_140114c20(uVar6,uVar7);
    }
    FUN_140114c20(puVar5,uVar6);
  }
  else {
    uVar6 = FUN_140116700();
    FUN_140114c20(puVar5,uVar6);
  }
  return puVar5;
}



ulonglong FUN_1400e6db0(longlong param_1,undefined8 param_2,longlong *param_3,char param_4)

{
  longlong lVar1;
  char cVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  char *pcVar5;
  int local_108;
  undefined1 local_100 [48];
  undefined8 local_d0;
  undefined1 local_c8 [160];
  
  local_d0 = 0xfffffffffffffffe;
  cVar2 = FUN_140118300(param_2,"sequence");
  if ((cVar2 == '\0') || (cVar2 = FUN_140119410(param_2), cVar2 == '\0')) {
    uVar3 = (**(code **)(*param_3 + 0x28))(param_3,"Invalid XML for AlgorithmIdentifier");
LAB_1400e725e:
    return uVar3 & 0xffffffffffffff00;
  }
  cVar2 = FUN_140118300(param_2,&DAT_140207ba0);
  if (cVar2 == '\0') {
    (**(code **)(*param_3 + 0x28))(param_3,"Invalid XML(2) for AlgorithmIdentifier");
    uVar3 = FUN_140119290(param_2);
    goto LAB_1400e725e;
  }
  uVar3 = 1;
  FUN_1400bbe30(param_1 + 0x10);
  FUN_140118490(param_2,param_1 + 0x10);
  FUN_140119290(param_2);
  if (param_4 != '\0') {
    (**(code **)(*param_3 + 0x48))(param_3,"AlgorithmIdentifier",1);
    lVar1 = *param_3;
    uVar4 = FUN_1400b8b90(param_1 + 0x10);
    (**(code **)(lVar1 + 0x58))(param_3,&DAT_140207ba0,uVar4);
  }
  cVar2 = FUN_1400bdf70(param_1 + 0x10,"1.2.840.113549.3.2");
  if (cVar2 != '\0') {
    (**(code **)(*param_3 + 0x30))(param_3,"RC2_CBC");
    FUN_1400b6fd0(local_c8);
    FUN_140118710(param_2,"sequence|octets|*",local_c8,param_3);
    lVar1 = *param_3;
    uVar4 = FUN_1400b7ce0(local_c8);
    (**(code **)(lVar1 + 0x58))(param_3,&DAT_1402426e8,uVar4);
    uVar4 = FUN_1400b7ce0(local_c8);
    FUN_1400b9f10(param_1 + 0x70,uVar4,"base64");
    FUN_1400b7180(local_c8);
    FUN_140118710(param_2,"sequence|int|*",local_c8,param_3);
    pcVar5 = (char *)FUN_1400b7ce0(local_c8);
    sscanf(pcVar5,"%x");
    if (local_108 == 0xa0) {
      *(undefined4 *)(param_1 + 0x98) = 0x28;
    }
    else if (local_108 == 0x34) {
      *(undefined4 *)(param_1 + 0x98) = 0x38;
    }
    else if (local_108 == 0x78) {
      *(undefined4 *)(param_1 + 0x98) = 0x40;
    }
    else if (local_108 == 0x3a) {
      *(undefined4 *)(param_1 + 0x98) = 0x80;
    }
    else {
      uVar3 = 0;
    }
    FUN_1400cf520(param_3,"KeyLength",*(undefined4 *)(param_1 + 0x98));
    FUN_1400b7090(local_c8);
    goto LAB_1400e723a;
  }
  cVar2 = FUN_1400bdf70(param_1 + 0x10,"2.16.840.1.101.3.4.1.2");
  if ((((cVar2 == '\0') &&
       (cVar2 = FUN_1400bdf70(param_1 + 0x10,"2.16.840.1.101.3.4.1.22"), cVar2 == '\0')) &&
      (cVar2 = FUN_1400bdf70(param_1 + 0x10,"2.16.840.1.101.3.4.1.42"), cVar2 == '\0')) &&
     ((cVar2 = FUN_1400bdf70(param_1 + 0x10,"1.3.14.3.2.7"), cVar2 == '\0' &&
      (cVar2 = FUN_1400bdf70(param_1 + 0x10,"1.2.840.113549.3.7"), cVar2 == '\0')))) {
    cVar2 = FUN_1400bdf70(param_1 + 0x10,"1.2.840.113549.3.4");
    if (cVar2 != '\0') {
      lVar1 = *param_3;
      uVar4 = FUN_1400b8b90();
      (**(code **)(lVar1 + 0x58))(param_3,"encryptionAlgorithmOid",uVar4);
      goto LAB_1400e723a;
    }
    cVar2 = FUN_1400bc7e0(param_1 + 0x10,"1.2.840.113549.1.12.1");
    if (cVar2 != '\0') {
      (**(code **)(*param_3 + 0x30))(param_3,"PBE encryption.");
      FUN_1400b6fd0(local_c8);
      FUN_140118710(param_2,"sequence|octets|*",local_c8,param_3);
      lVar1 = *param_3;
      uVar4 = FUN_1400b7ce0(local_c8);
      (**(code **)(lVar1 + 0x58))(param_3,&DAT_140242694,uVar4);
      uVar4 = FUN_1400b7ce0(local_c8);
      FUN_1400b9f10(param_1 + 0x40,uVar4,"base64");
      FUN_1400b7180(local_c8);
      FUN_140118710(param_2,"sequence|int|*",local_c8,param_3);
      pcVar5 = (char *)FUN_1400b7ce0(local_c8);
      sscanf(pcVar5,"%x");
      FUN_1400cf520(param_3,"Iterations",*(undefined4 *)(param_1 + 0x68));
      FUN_1400b7090(local_c8);
      goto LAB_1400e723a;
    }
    cVar2 = FUN_1400bdf70(param_1 + 0x10,"1.2.840.113549.3.4");
    if (cVar2 == '\0') {
      uVar3 = 1;
      goto LAB_1400e723a;
    }
    (**(code **)(*param_3 + 0x28))(param_3,"ARC4 encryption.");
    FUN_1400bcc20(local_100);
    FUN_140118e00(param_2,local_100);
    lVar1 = *param_3;
    uVar4 = FUN_1400b8b90(local_100);
    (**(code **)(lVar1 + 0x58))(param_3,"algorithm_identifier_xml",uVar4);
    uVar3 = 0;
  }
  else {
    FUN_1400bcc20(local_100);
    FUN_1401194f0(param_2,"octets",local_100);
    lVar1 = *param_3;
    uVar4 = FUN_1400b8b90(param_1 + 0x10);
    (**(code **)(lVar1 + 0x58))(param_3,"encryptionAlgorithmOid",uVar4);
    lVar1 = *param_3;
    uVar4 = FUN_1400b8b90(local_100);
    (**(code **)(lVar1 + 0x58))(param_3,&DAT_1402426e8,uVar4);
    uVar4 = FUN_1400b8b90(local_100);
    FUN_1400b9f10(param_1 + 0x70,uVar4,"base64");
  }
  FUN_1400bceb0(local_100);
LAB_1400e723a:
  if (param_4 == '\0') {
    return uVar3;
  }
  (**(code **)(*param_3 + 0x50))(param_3);
  return uVar3;
}



undefined8 * FUN_1400e7290(undefined8 *param_1)

{
  FUN_1400d1210();
  FUN_1400d0eb0(param_1 + 6);
  *param_1 = Pkcs7::vftable;
  param_1[6] = Pkcs7::vftable;
  *(undefined4 *)(param_1 + 8) = 0;
  param_1[9] = 0;
  param_1[10] = 0;
  param_1[0xb] = 0;
  param_1[0xc] = 0;
  param_1[0xd] = 0;
  param_1[0xe] = 0;
  FUN_1400d0a70(param_1 + 0xf);
  FUN_1400d0a70(param_1 + 0x14);
  return param_1;
}



void FUN_1400e7320(longlong param_1)

{
  undefined8 *puVar1;
  
  *(undefined4 *)(param_1 + 0x40) = 0;
  puVar1 = *(undefined8 **)(param_1 + 0x48);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  puVar1 = *(undefined8 **)(param_1 + 0x50);
  *(undefined8 *)(param_1 + 0x48) = 0;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  puVar1 = *(undefined8 **)(param_1 + 0x58);
  *(undefined8 *)(param_1 + 0x50) = 0;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  puVar1 = *(undefined8 **)(param_1 + 0x60);
  *(undefined8 *)(param_1 + 0x58) = 0;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  puVar1 = *(undefined8 **)(param_1 + 0x68);
  *(undefined8 *)(param_1 + 0x60) = 0;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  puVar1 = *(undefined8 **)(param_1 + 0x70);
  *(undefined8 *)(param_1 + 0x68) = 0;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  *(undefined8 *)(param_1 + 0x70) = 0;
  FUN_1400d0d30(param_1 + 0x78);
  FUN_1400d0d30(param_1 + 0xa0);
  return;
}



undefined4 FUN_1400e73e0(undefined8 param_1,longlong param_2,undefined8 param_3)

{
  undefined8 uVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  longlong lVar5;
  
  if (param_2 != 0) {
    iVar3 = FUN_140118470();
    if (iVar3 < 6) {
      cVar2 = FUN_140118eb0(param_1,&DAT_140242790,&DAT_140242794);
      if (cVar2 != '\0') {
        uVar4 = FUN_140118210();
        lVar5 = FUN_1400d0aa0(param_2,uVar4);
        if (lVar5 != 0) {
          FUN_1400b9e90(param_3,lVar5);
          return 1;
        }
        return 0;
      }
    }
  }
  uVar1 = FUN_140118400(param_1);
  FUN_1400b9f10(param_3,uVar1,"base64");
  return 1;
}



void FUN_1400e7490(longlong param_1)

{
  void *pvVar1;
  undefined8 uVar2;
  
  pvVar1 = operator_new(0x28);
  uVar2 = 0;
  if (pvVar1 != (void *)0x0) {
    uVar2 = FUN_1400b8c40(pvVar1);
  }
  FUN_1400d0c90(param_1 + 0xa0,uVar2);
  return;
}



void FUN_1400e74e0(longlong param_1,longlong param_2,undefined8 param_3)

{
  int iVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  void *pvVar5;
  undefined8 uVar6;
  int iVar7;
  
  if ((param_2 != 0) && (*(longlong *)(param_2 + 0x28) != 0)) {
    iVar1 = FUN_140139d70();
    lVar3 = FUN_1400d0aa0(*(undefined8 *)(param_2 + 0x28),iVar1 + -1);
    if ((lVar3 != 0) && (*(longlong *)(lVar3 + 0x28) != 0)) {
      iVar1 = FUN_140139d70();
      iVar7 = 0;
      if (0 < iVar1) {
        do {
          lVar4 = FUN_1400d0aa0(*(undefined8 *)(lVar3 + 0x28),iVar7);
          if (lVar4 == 0) {
            FUN_1400e7490(param_1);
          }
          else if (*(longlong *)(lVar4 + 0x28) == 0) {
            FUN_1400e7490(param_1);
          }
          else {
            iVar2 = FUN_140139d70();
            if (iVar2 < 5) {
              FUN_1400e7490(param_1);
            }
            else {
              lVar4 = FUN_1400d0aa0(*(undefined8 *)(lVar4 + 0x28),3);
              if (lVar4 == 0) {
                FUN_1400e7490(param_1);
              }
              else if (*(longlong *)(lVar4 + 0x28) == 0) {
                FUN_1400e7490(param_1);
              }
              else {
                *(undefined2 *)(lVar4 + 0x10) = 0;
                *(undefined4 *)(lVar4 + 0x14) = 0x11;
                pvVar5 = operator_new(0x28);
                if (pvVar5 == (void *)0x0) {
                  uVar6 = 0;
                }
                else {
                  uVar6 = FUN_1400b8c40(pvVar5);
                }
                FUN_140115620(lVar4,uVar6,0,0,param_3);
                FUN_1400d0c90(param_1 + 0xa0,uVar6);
              }
            }
          }
          iVar7 = iVar7 + 1;
        } while (iVar7 < iVar1);
      }
    }
  }
  return;
}



void FUN_1400e7660(longlong param_1,undefined8 param_2,longlong *param_3,undefined1 param_4)

{
  char cVar1;
  undefined4 uVar2;
  int iVar3;
  uint uVar4;
  undefined8 uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  longlong lVar8;
  longlong lVar9;
  undefined8 *puVar10;
  int iVar11;
  undefined1 local_458 [48];
  void *local_428;
  undefined8 local_420;
  undefined1 local_418 [160];
  undefined1 local_378 [160];
  undefined1 local_2d8 [160];
  undefined1 local_238 [512];
  
  local_420 = 0xfffffffffffffffe;
  (**(code **)(*param_3 + 0x48))(param_3,"DecodeToAsn",1);
  uVar2 = FUN_1400b8b80(param_2);
  uVar5 = FUN_1400b8b90(param_2);
  puVar6 = (undefined8 *)FUN_1401176f0(uVar5,uVar2,0,param_3);
  (**(code **)(*param_3 + 0x50))(param_3);
  if (puVar6 == (undefined8 *)0x0) {
    FUN_1400cf520(param_3,"extractCertsFromSignedDataAsnError",1);
  }
  else {
    if (puVar6[5] == 0) {
      uVar2 = 2;
    }
    else {
      lVar7 = FUN_1400d0aa0(puVar6[5],0);
      if (lVar7 == 0) {
        uVar2 = 3;
      }
      else {
        cVar1 = FUN_1401153d0(lVar7);
        if (cVar1 != '\0') {
          FUN_1400bcc20(local_458);
          FUN_1401153e0(lVar7,local_458);
          cVar1 = FUN_1400bdf70(local_458,"1.2.840.113549.1.7.2");
          if (cVar1 == '\0') {
            FUN_1400cf520(param_3,"extractCertsFromSignedDataAsnError",5);
            (**(code **)*puVar6)(puVar6,1);
          }
          else {
            lVar7 = FUN_1400d0aa0(puVar6[5],1);
            if (lVar7 == 0) {
              FUN_1400cf520(param_3,"extractCertsFromSignedDataAsnError",6);
              (**(code **)*puVar6)(puVar6,1);
            }
            else if (*(longlong *)(lVar7 + 0x28) == 0) {
              FUN_1400cf520(param_3,"extractCertsFromSignedDataAsnError",7);
              (**(code **)*puVar6)(puVar6,1);
            }
            else {
              lVar7 = FUN_1400d0aa0(*(longlong *)(lVar7 + 0x28),0);
              if (lVar7 == 0) {
                FUN_1400cf520(param_3,"extractCertsFromSignedDataAsnError",8);
                (**(code **)*puVar6)(puVar6,1);
              }
              else if (*(longlong *)(lVar7 + 0x28) == 0) {
                FUN_1400cf520(param_3,"extractCertsFromSignedDataAsnError",9);
                (**(code **)*puVar6)(puVar6,1);
              }
              else {
                FUN_1400e74e0(param_1,lVar7,param_3,param_4);
                lVar7 = FUN_1400d0aa0(*(undefined8 *)(lVar7 + 0x28),3);
                if (lVar7 == 0) {
                  FUN_1400cf520(param_3,"extractCertsFromSignedDataAsnError",10);
                  (**(code **)*puVar6)(puVar6,1);
                }
                else if (*(longlong *)(lVar7 + 0x28) == 0) {
                  FUN_1400cf520(param_3,"extractCertsFromSignedDataAsnError",0xb);
                  (**(code **)*puVar6)(puVar6,1);
                }
                else {
                  (**(code **)(*param_3 + 0x48))(param_3,"ExtractCertsFromSignedData2",1);
                  iVar3 = FUN_140139d70(*(undefined8 *)(lVar7 + 0x28));
                  FUN_1400cf520(param_3,"numCerts",iVar3);
                  iVar11 = 0;
                  if (0 < iVar3) {
                    do {
                      lVar8 = FUN_1400d0aa0(*(undefined8 *)(lVar7 + 0x28),iVar11);
                      if ((((lVar8 != 0) && (cVar1 = FUN_1401153c0(lVar8), cVar1 != '\0')) &&
                          (lVar9 = FUN_140114bc0(lVar8,0), lVar9 != 0)) &&
                         (cVar1 = FUN_1401153c0(lVar9), cVar1 != '\0')) {
                        local_428 = operator_new(0x28);
                        if (local_428 == (void *)0x0) {
                          puVar10 = (undefined8 *)0x0;
                        }
                        else {
                          puVar10 = (undefined8 *)FUN_1400b8c40(local_428);
                        }
                        FUN_140115620(lVar8,puVar10,0,0,param_3);
                        (**(code **)(*param_3 + 0x48))(param_3,"certificate",1);
                        FUN_140119b70(local_238);
                        FUN_140119860(local_238,puVar10,param_3,0);
                        FUN_1400b6fd0(local_378);
                        FUN_14011aa30(local_238,local_378,param_3);
                        lVar8 = *param_3;
                        uVar5 = FUN_1400b7ce0(local_378);
                        (**(code **)(lVar8 + 0x58))(param_3,"IssuerCN",uVar5);
                        FUN_1400b6fd0(local_2d8);
                        FUN_140119c40(local_238,local_2d8,param_3);
                        lVar8 = *param_3;
                        uVar5 = FUN_1400b7ce0(local_2d8);
                        (**(code **)(lVar8 + 0x58))(param_3,"SerialNum",uVar5);
                        FUN_1400b6fd0(local_418);
                        FUN_14011a5e0(local_238,1,1,local_418,param_3);
                        lVar8 = *param_3;
                        FUN_1400b7ce0(local_418);
                        (**(code **)(lVar8 + 0x58))(param_3,"SubjectDN");
                        (**(code **)(*param_3 + 0x50))(param_3);
                        FUN_1400b7090(local_418);
                        FUN_1400b7090(local_2d8);
                        FUN_1400b7090(local_378);
                        FUN_140119be0(local_238);
                        uVar4 = FUN_1400b8b80(puVar10);
                        if (uVar4 < 0x29) {
                          if (puVar10 != (undefined8 *)0x0) {
                            (**(code **)*puVar10)(puVar10,1);
                          }
                        }
                        else {
                          (**(code **)(*param_3 + 0x30))(param_3,"Adding cert to internal list...");
                          FUN_1400d0c90(param_1 + 0x78,puVar10);
                        }
                      }
                      iVar11 = iVar11 + 1;
                    } while (iVar11 < iVar3);
                  }
                  (**(code **)(*param_3 + 0x50))(param_3);
                  (**(code **)*puVar6)(puVar6,1);
                }
              }
            }
          }
          FUN_1400bceb0(local_458);
          return;
        }
        uVar2 = 4;
      }
    }
    FUN_1400cf520(param_3,"extractCertsFromSignedDataAsnError",uVar2);
    (**(code **)*puVar6)(puVar6,1);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1
FUN_1400e7b90(undefined8 param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined1 auStack_e48 [32];
  undefined8 local_e28;
  undefined8 local_e18;
  undefined1 local_e08 [224];
  undefined1 local_d28 [3296];
  ulonglong local_48;
  
  local_e18 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_e48;
  FUN_1400b0310(local_d28);
  FUN_1400b3420(local_d28,param_2);
  FUN_1400b35e0(local_d28,param_3);
  FUN_1400b35d0(local_d28,param_3);
  FUN_1400b0190(local_d28,param_4);
  FUN_1400b35f0(local_d28,param_5);
  FUN_1400b0210(local_d28,0);
  FUN_14012fed0(local_e08,param_6);
  local_e28 = param_7;
  uVar1 = FUN_1400b6c80(local_d28,param_1,local_e08,0);
  FUN_14012ff50(local_e08);
  FUN_1400b0680(local_d28);
  return uVar1;
}



undefined8 FUN_1400e7cc0(undefined8 param_1,longlong *param_2)

{
  int iVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  longlong lVar4;
  undefined8 uVar5;
  undefined1 local_d8 [40];
  undefined8 local_b0;
  undefined1 local_a8 [160];
  
  local_b0 = 0xfffffffffffffffe;
  FUN_1400b6fd0(local_a8);
  FUN_1400ecf20(param_1,local_a8,param_2);
  lVar4 = *param_2;
  uVar3 = FUN_1400b7ce0(local_a8);
  (**(code **)(lVar4 + 0x58))(param_2,"issuerSerialNum",uVar3);
  iVar1 = FUN_1400b8350(local_a8);
  if (iVar1 == 0) {
    (**(code **)(*param_2 + 0x28))(param_2,"Failed to get certificate\'s serial number");
    FUN_1400b7090(local_a8);
    uVar5 = 0;
  }
  else {
    lVar4 = FUN_1400ecb80(param_1,param_2);
    if (lVar4 == 0) {
      FUN_1400b7090(local_a8);
      uVar5 = 0;
    }
    else {
      FUN_1400b8c40(local_d8);
      uVar3 = FUN_1400b7ce0(local_a8);
      FUN_1400b9f10(local_d8,uVar3,&DAT_1402749dc);
      uVar2 = FUN_1400b8b80(local_d8);
      uVar3 = FUN_1400b8b90(local_d8);
      uVar3 = FUN_140116100(uVar3,uVar2,0xf00,param_2);
      uVar5 = FUN_140116780();
      FUN_140114c20(uVar5,lVar4);
      FUN_140114c20(uVar5,uVar3);
      FUN_1400b92d0(local_d8);
      FUN_1400b7090(local_a8);
    }
  }
  return uVar5;
}



void FUN_1400e7e10(longlong param_1)

{
  FUN_1400ebf70(param_1 + -0x30);
  return;
}



undefined8 FUN_1400e7e20(longlong param_1,undefined8 param_2,undefined8 param_3,longlong *param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  char *pcVar4;
  
  cVar1 = FUN_140118300(param_2,"sequence");
  if (cVar1 == '\0') {
    (**(code **)(*param_4 + 0x28))(param_4,"PKCS7 Data root tag must be a sequence.");
  }
  else {
    iVar2 = FUN_1401184f0(param_2);
    if (iVar2 == 2) {
      FUN_140119410(param_2);
      cVar1 = FUN_140118300(param_2,&DAT_140207ba0);
      if (cVar1 == '\0') {
        pcVar4 = "PKCS7 Data -- 1st child must be oid.";
      }
      else {
        cVar1 = FUN_140118380(param_2,"1.2.840.113549.1.7.1");
        if (cVar1 == '\0') {
          pcVar4 = "PKCS7 Data -- oid must be 1.2.840.113549.1.7.1";
        }
        else {
          FUN_140119480(param_2);
          cVar1 = FUN_140118300(param_2,"contextSpecific");
          if (cVar1 == '\0') {
            pcVar4 = "PKCS7 Data -- 2nd child must be contextSpecific.";
          }
          else {
            cVar1 = FUN_140119410(param_2);
            if ((cVar1 != '\0') && (cVar1 = FUN_140118300(param_2,"octets"), cVar1 != '\0')) {
              FUN_1400e73e0(param_2,param_3,param_1 + 8);
              (**(code **)(*param_4 + 0x30))(param_4,"PKCS7 Data");
              uVar3 = FUN_1400b8b80(param_1 + 8);
              FUN_1400cf520(param_4,"dataSize",uVar3);
              FUN_140119300(param_2);
              return 1;
            }
            pcVar4 = "PKCS7 Data -- contextSpecific child should be octets";
          }
        }
      }
      (**(code **)(*param_4 + 0x28))(param_4,pcVar4);
      FUN_140119300(param_2);
    }
    else {
      (**(code **)(*param_4 + 0x28))(param_4,"PKCS7 Data must have 2 top-level children.");
    }
  }
  return 0;
}



undefined8 * FUN_1400e7f90(undefined8 *param_1,uint param_2)

{
  *param_1 = Pkcs7_Data::vftable;
  FUN_1400b92d0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1400e7fd0(undefined8 *param_1,byte param_2)

{
  *param_1 = Pkcs7_DigestedData::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1400e8000(undefined8 *param_1,uint param_2)

{
  *param_1 = Pkcs7_EncryptedData::vftable;
  FUN_1400b92d0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined1
FUN_1400e8040(longlong param_1,undefined8 param_2,undefined8 param_3,undefined1 *param_4,
             longlong *param_5,undefined1 param_6)

{
  char cVar1;
  undefined1 uVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  int iVar6;
  undefined1 *puVar7;
  undefined1 local_238 [40];
  undefined8 local_210;
  undefined **local_208 [2];
  undefined1 local_1f8 [48];
  undefined1 local_1c8 [40];
  undefined4 local_1a0;
  undefined1 local_198 [40];
  undefined4 local_170;
  undefined1 local_168 [160];
  undefined1 local_c8 [160];
  
  local_210 = 0xfffffffffffffffe;
  puVar7 = &DAT_14027a10a;
  if (param_4 != (undefined1 *)0x0) {
    puVar7 = param_4;
  }
  FUN_1400b8b30(param_1 + 8);
  FUN_1400b6fd0(local_c8);
  cVar1 = FUN_140118710(param_2,"contextSpecific|sequence|sequence|sequence|$",local_c8,param_5);
  if (cVar1 == '\0') {
    (**(code **)(*param_5 + 0x28))
              (param_5,"Failed to navigate to AlgorithmIdentifier in PKCS7 EncryptedData.");
    uVar2 = 0;
    goto LAB_1400e828a;
  }
  FUN_1400d0eb0(local_208);
  local_208[0] = AlgorithmIdentifier::vftable;
  FUN_1400bcc20(local_1f8);
  FUN_1400b8c40(local_1c8);
  iVar6 = 0;
  local_1a0 = 0;
  FUN_1400b8c40(local_198);
  local_170 = 0;
  cVar1 = FUN_1400e6db0(local_208,param_2,param_5,param_6);
  uVar2 = 0;
  if (cVar1 != '\0') {
    FUN_140119300(param_2);
    FUN_1400b8c40(local_238);
    FUN_1400b6fd0(local_168);
    cVar1 = FUN_140118710(param_2,"contextSpecific|sequence|sequence|contextSpecific|octets|$",
                          local_168,param_5);
    if (cVar1 == '\0') {
      cVar1 = FUN_140118710(param_2,"contextSpecific|sequence|sequence|contextSpecific|*",local_168,
                            param_5);
      if (cVar1 != '\0') {
        uVar5 = FUN_1400b7ce0(local_168);
        FUN_1400b9f10(local_238,uVar5,"base64");
        goto LAB_1400e81f3;
      }
      (**(code **)(*param_5 + 0x28))
                (param_5,"Failed to get encrypted data from PKCS7 EncryptedData");
      uVar2 = 0;
    }
    else {
      FUN_140119290();
      iVar3 = FUN_1401184f0(param_2);
      if (0 < iVar3) {
        do {
          FUN_140118fe0(param_2,iVar6);
          FUN_1400e73e0(param_2,param_3,local_238);
          FUN_140119290(param_2);
          iVar6 = iVar6 + 1;
        } while (iVar6 < iVar3);
      }
LAB_1400e81f3:
      uVar4 = FUN_1400b8b80(local_238);
      FUN_1400cf520(param_5,"numEncryptedBytes",uVar4);
      uVar2 = FUN_1400e5310(local_208,local_238,param_1 + 8,puVar7,param_5);
    }
    FUN_1400b7090(local_168);
    FUN_1400b92d0(local_238);
  }
  local_208[0] = AlgorithmIdentifier::vftable;
  FUN_1400b92d0(local_198);
  FUN_1400b92d0(local_1c8);
  FUN_1400bceb0(local_1f8);
  FUN_1400d0ee0(local_208);
LAB_1400e828a:
  FUN_140119300(param_2);
  FUN_1400b7090(local_c8);
  return uVar2;
}



void FUN_1400e82d0(undefined8 *param_1)

{
  *param_1 = RecipientInfo::vftable;
  FUN_1400b92d0(param_1 + 0x47);
  param_1[0x33] = AlgorithmIdentifier::vftable;
  FUN_1400b92d0(param_1 + 0x41);
  FUN_1400b92d0(param_1 + 0x3b);
  FUN_1400bceb0(param_1 + 0x35);
  FUN_1400d0ee0(param_1 + 0x33);
  FUN_1400bceb0(param_1 + 0x2d);
  FUN_1400e5be0(param_1 + 2);
  FUN_1400d0ee0(param_1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_1400e8370(longlong param_1,undefined8 param_2,undefined8 param_3,longlong *param_4,char param_5)

{
  longlong lVar1;
  char cVar2;
  undefined4 uVar3;
  uint uVar4;
  undefined8 uVar5;
  undefined8 *puVar6;
  undefined1 auStack_2e8 [32];
  undefined4 local_2c8;
  undefined1 *local_2c0;
  undefined1 local_2b8 [40];
  undefined1 local_290 [40];
  undefined8 local_268;
  undefined1 local_258 [160];
  undefined1 local_1b8 [160];
  undefined1 local_118 [192];
  ulonglong local_58;
  
  local_268 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_2e8;
  cVar2 = FUN_140118710(param_2,"sequence|int|*",param_1 + 0x10);
  if (cVar2 == '\0') {
    (**(code **)(*param_4 + 0x28))
              (param_4,"Failed to get signing certificate\'s serial number from SignerInfo.");
    uVar5 = 0;
  }
  else {
    if (param_5 != '\0') {
      lVar1 = *param_4;
      uVar5 = FUN_1400b7ce0(param_1 + 0x10);
      (**(code **)(lVar1 + 0x58))(param_4,"serialNumber2",uVar5);
    }
    cVar2 = FUN_140118710(param_2,"sequence|sequence|/C/oid,2.5.4.3|..|printable|*",param_1 + 0xb0,
                          param_4);
    if (cVar2 == '\0') {
      cVar2 = FUN_140118710(param_2,"sequence|sequence|/C/oid,2.5.4.3|..|utf8|*",param_1 + 0xb0,
                            param_4);
      if (cVar2 == '\0') {
        cVar2 = FUN_140118710(param_2,"sequence|sequence|/C/oid,2.5.4.3|..|ia5|*",param_1 + 0xb0,
                              param_4);
        if (cVar2 == '\0') {
          FUN_1400b6fd0(local_1b8);
          cVar2 = FUN_140118710(param_2,"sequence|sequence|/C/oid,2.5.4.3|..|universal|*",local_1b8,
                                param_4);
          if (cVar2 == '\0') {
            (**(code **)(*param_4 + 0x28))
                      (param_4,"Warning: The IssuerCN is not present in the SignerInfo.");
          }
          else {
            FUN_1400b8c40(local_2b8);
            uVar5 = FUN_1400b7ce0(local_1b8);
            FUN_1400b9f10(local_2b8,uVar5,"base64");
            FUN_1400c2840(local_118);
            FUN_1400b8c40(local_290);
            uVar3 = FUN_1400b8b80(local_2b8);
            uVar5 = FUN_1400b8b90(local_2b8);
            local_2c0 = local_290;
            local_2c8 = uVar3;
            FUN_1400cded0(local_118,0x4b1,0x4b0,uVar5);
            uVar4 = FUN_1400b8b80(local_290);
            uVar5 = FUN_1400b8b90(local_290);
            FUN_1400b7c50(param_1 + 0xb0,uVar5,uVar4 >> 1);
            lVar1 = *param_4;
            uVar5 = FUN_1400b7ce0(param_1 + 0xb0);
            (**(code **)(lVar1 + 0x58))(param_4,"bmpStr2",uVar5);
            FUN_1400b92d0(local_290);
            FUN_1400c2880(local_118);
            FUN_1400b92d0(local_2b8);
          }
          FUN_1400b7090(local_1b8);
        }
      }
    }
    if (param_5 != '\0') {
      lVar1 = *param_4;
      uVar5 = FUN_1400b7ce0(param_1 + 0xb0);
      (**(code **)(lVar1 + 0x58))(param_4,"issuerCN",uVar5);
    }
    cVar2 = FUN_140118710(param_2,"sequence[1]|oid|*",param_1 + 0x150,param_4);
    if (cVar2 == '\0') {
      (**(code **)(*param_4 + 0x28))
                (param_4,"Failed to get digest algorithm identifier in SignerInfo");
      uVar5 = 0;
    }
    else {
      if (param_5 != '\0') {
        lVar1 = *param_4;
        uVar5 = FUN_1400b7ce0(param_1 + 0x150);
        (**(code **)(lVar1 + 0x58))(param_4,"digestAlgorithmOid",uVar5);
      }
      cVar2 = FUN_140118710(param_2,
                            "/A/contextSpecific,tag,0|/C/oid,1.2.840.113549.1.9.3|..|set|oid|*",
                            param_1 + 0x1f0,param_4);
      if (cVar2 != '\0') {
        lVar1 = *param_4;
        uVar5 = FUN_1400b7ce0(param_1 + 0x1f0);
        (**(code **)(lVar1 + 0x58))(param_4,"contentType",uVar5);
      }
      FUN_1400b6fd0(local_258);
      puVar6 = (undefined8 *)FUN_140119210(param_2);
      cVar2 = FUN_140118710(puVar6,
                            "/A/contextSpecific,tag,0|/C/oid,1.2.840.113549.1.9.4|..|set|octets|$",
                            local_258,param_4);
      if (cVar2 == '\0') {
        (**(code **)(*param_4 + 0x28))(param_4,"No SignerInfo message digest found.");
        FUN_1400b8b30(param_1 + 0x330);
      }
      else {
        FUN_1400e73e0(puVar6,param_3,param_1 + 0x330);
        uVar3 = FUN_1400b8b80(param_1 + 0x330);
        uVar5 = FUN_1400b8b90(param_1 + 0x330);
        FUN_1400cf340(param_4,"messageDigestHex",uVar5,uVar3);
      }
      if (puVar6 != (undefined8 *)0x0) {
        (**(code **)*puVar6)(puVar6,1);
      }
      cVar2 = FUN_140118710(param_2,
                            "/A/contextSpecific,tag,0|/C/oid,1.2.840.113549.1.9.5|..|set|utctime|*",
                            param_1 + 0x290,param_4);
      if (cVar2 != '\0') {
        lVar1 = *param_4;
        uVar5 = FUN_1400b7ce0(param_1 + 0x290);
        (**(code **)(lVar1 + 0x58))(param_4,"signingTime",uVar5);
      }
      cVar2 = FUN_140118710(param_2,"sequence[2]|oid|*",param_1 + 0x358,param_4);
      if (cVar2 == '\0') {
        (**(code **)(*param_4 + 0x28))
                  (param_4,"Failed to get digest encryption algorithm identifier in SignerInfo");
        FUN_1400b7090(local_258);
        uVar5 = 0;
      }
      else {
        if (param_5 != '\0') {
          lVar1 = *param_4;
          uVar5 = FUN_1400b7ce0(param_1 + 0x358);
          (**(code **)(lVar1 + 0x58))(param_4,"digestEncryptionAlgorithmOid",uVar5);
        }
        puVar6 = (undefined8 *)FUN_140119210(param_2);
        cVar2 = FUN_140118710(puVar6,"octets|$",local_258,param_4);
        if (cVar2 == '\0') {
          if (puVar6 != (undefined8 *)0x0) {
            (**(code **)*puVar6)(puVar6,1);
          }
          (**(code **)(*param_4 + 0x28))
                    (param_4,"Failed to get encrypted digest bytes in SignerInfo");
          FUN_1400b7090(local_258);
          uVar5 = 0;
        }
        else {
          FUN_1400e73e0(puVar6,param_3,param_1 + 0x3f8);
          if (puVar6 != (undefined8 *)0x0) {
            (**(code **)*puVar6)(puVar6,1);
          }
          if (param_5 != '\0') {
            uVar3 = FUN_1400b8b80(param_1 + 0x3f8);
            FUN_1400cf520(param_4,"encryptedDigestSize",uVar3);
          }
          FUN_1400b7090(local_258);
          uVar5 = 1;
        }
      }
    }
  }
  return uVar5;
}



undefined8 *
FUN_1400e88a0(undefined8 *param_1,longlong param_2,undefined8 param_3,longlong *param_4,
             undefined1 param_5,undefined1 *param_6)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 *puVar5;
  undefined8 uVar6;
  undefined8 *puVar7;
  
  FUN_1400d0eb0();
  *param_1 = RecipientInfo::vftable;
  FUN_1400e5b60(param_1 + 2);
  FUN_1400bcc20(param_1 + 0x2d);
  puVar7 = param_1 + 0x33;
  FUN_1400d0eb0(puVar7);
  *puVar7 = AlgorithmIdentifier::vftable;
  FUN_1400bcc20(param_1 + 0x35);
  FUN_1400b8c40(param_1 + 0x3b);
  *(undefined4 *)(param_1 + 0x40) = 0;
  FUN_1400b8c40(param_1 + 0x41);
  *(undefined4 *)(param_1 + 0x46) = 0;
  FUN_1400b8c40(param_1 + 0x47);
  *param_6 = 0;
  if (param_2 != 0) {
    iVar3 = FUN_1401184f0(param_2);
    if (iVar3 == 4) {
      puVar5 = (undefined8 *)FUN_140119050(param_2,0);
      if (puVar5 != (undefined8 *)0x0) {
        iVar3 = FUN_140118210(puVar5);
        (**(code **)*puVar5)(puVar5,1);
        if ((iVar3 == 2) &&
           (puVar5 = (undefined8 *)FUN_140119050(param_2,1), puVar5 != (undefined8 *)0x0)) {
          cVar2 = FUN_140118300(puVar5,"contextSpecific");
          if (cVar2 != '\0') {
            FUN_140118490(puVar5,param_1 + 0x2d);
            lVar1 = *param_4;
            uVar6 = FUN_1400b8b90(param_1 + 0x2d);
            (**(code **)(lVar1 + 0x58))(param_4,"subjectKeyIdentifier",uVar6);
          }
          (**(code **)*puVar5)(puVar5,1);
        }
      }
      iVar3 = FUN_1400bbb10(param_1 + 0x2d);
      if (iVar3 == 0) {
        puVar5 = (undefined8 *)FUN_140119050(param_2,1);
        if (puVar5 == (undefined8 *)0x0) {
          return param_1;
        }
        cVar2 = FUN_1400e57d0(param_1 + 2,puVar5,param_4);
        (**(code **)*puVar5)(puVar5,1);
        if (cVar2 == '\0') {
          return param_1;
        }
      }
      puVar5 = (undefined8 *)FUN_140119050(param_2,2);
      if (puVar5 != (undefined8 *)0x0) {
        cVar2 = FUN_1400e6db0(puVar7,puVar5,param_4,param_5);
        (**(code **)*puVar5)(puVar5,1);
        if ((cVar2 != '\0') &&
           (puVar7 = (undefined8 *)FUN_140119050(param_2,3), puVar7 != (undefined8 *)0x0)) {
          FUN_1400e73e0(puVar7,param_3,param_1 + 0x47);
          (**(code **)*puVar7)(puVar7,1);
          iVar3 = FUN_1400b8b80(param_1 + 0x47);
          if (iVar3 != 0) {
            uVar4 = FUN_1400b8b80(param_1 + 0x47);
            FUN_1400cf520(param_4,"encryptedKeyNumBytes",uVar4);
            *param_6 = 1;
          }
        }
      }
    }
    else {
      (**(code **)(*param_4 + 0x28))(param_4,"Expected 4 parts in RecipientInfo");
    }
  }
  return param_1;
}



void * FUN_1400e8b50(void *param_1,uint param_2)

{
  FUN_1400e5730();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void * FUN_1400e8b80(void *param_1,uint param_2)

{
  FUN_1400e5be0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8
FUN_1400e8bb0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             longlong *param_5,undefined1 param_6)

{
  char cVar1;
  undefined4 uVar2;
  int iVar3;
  undefined8 uVar4;
  undefined8 *puVar5;
  longlong lVar6;
  longlong lVar7;
  undefined1 local_168 [48];
  undefined1 local_138 [8];
  undefined1 local_130 [32];
  undefined1 local_110 [32];
  undefined1 local_f0 [32];
  undefined1 local_d0 [32];
  undefined1 local_b0 [32];
  undefined1 local_90 [32];
  undefined1 local_70 [32];
  undefined1 local_50 [40];
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  FUN_1400bbe30(param_3);
  FUN_1400b8b30(param_4);
  FUN_1401305d0(local_138);
  cVar1 = FUN_140131bc0(param_2,local_138,param_5);
  if (cVar1 == '\0') {
    (**(code **)(*param_5 + 0x28))(param_5,"Invalid RSA DER public key.");
    FUN_14011d980(local_50);
    FUN_14011d980(local_70);
    FUN_14011d980(local_90);
    FUN_14011d980(local_b0);
    FUN_14011d980(local_d0);
    FUN_14011d980(local_f0);
    FUN_14011d980(local_110);
  }
  else {
    FUN_1400b8c40(local_168);
    uVar2 = FUN_1400b8b80(param_1 + 0x3f8);
    uVar4 = FUN_1400b8b90(param_1 + 0x3f8);
    cVar1 = FUN_1401312e0(uVar4,uVar2,local_138,local_168,param_5,param_6);
    if (cVar1 == '\0') {
      (**(code **)(*param_5 + 0x28))(param_5,"Failed to decrypt (unsign) digest.");
      FUN_1400b92d0(local_168);
      FUN_14011d980(local_50);
      FUN_14011d980(local_70);
      FUN_14011d980(local_90);
      FUN_14011d980(local_b0);
      FUN_14011d980(local_d0);
      FUN_14011d980(local_f0);
      FUN_14011d980(local_110);
    }
    else {
      uVar2 = FUN_1400b8b80(local_168);
      uVar4 = FUN_1400b8b90(local_168);
      puVar5 = (undefined8 *)FUN_1401176f0(uVar4,uVar2,0,param_5);
      if (puVar5 == (undefined8 *)0x0) {
        (**(code **)(*param_5 + 0x28))(param_5,"Failed to decode digest ASN.1.");
        FUN_1400b92d0(local_168);
        FUN_14011d980(local_50);
        FUN_14011d980(local_70);
        FUN_14011d980(local_90);
        FUN_14011d980(local_b0);
        FUN_14011d980(local_d0);
        FUN_14011d980(local_f0);
        FUN_14011d980(local_110);
      }
      else {
        if ((puVar5[5] != 0) && (iVar3 = FUN_140139d70(), iVar3 == 2)) {
          lVar6 = FUN_1400d0aa0(puVar5[5],0);
          lVar7 = FUN_1400d0aa0(puVar5[5],1);
          if ((lVar6 != 0) &&
             (((lVar7 != 0 && (*(longlong *)(lVar6 + 0x28) != 0)) &&
              (lVar6 = FUN_1400d0aa0(*(longlong *)(lVar6 + 0x28),0), lVar6 != 0)))) {
            FUN_1401153e0(lVar6,param_3);
            iVar3 = FUN_1400bbb10(param_3);
            if (iVar3 != 0) {
              FUN_1400b8b30(param_4);
              FUN_1401154f0(lVar7,param_4);
              iVar3 = FUN_1400b8b80(param_4);
              if (iVar3 != 0) {
                (**(code **)*puVar5)(puVar5,1);
                FUN_1400b92d0(local_168);
                FUN_1400e65d0(local_138);
                return 1;
              }
            }
          }
        }
        (**(code **)(*param_5 + 0x28))(param_5,"Invalid digest ASN.1");
        uVar2 = FUN_1400b8b80(local_168);
        uVar4 = FUN_1400b8b90(local_168);
        FUN_1400cf340(param_5,"ASN1_data",uVar4,uVar2);
        (**(code **)*puVar5)(puVar5,1);
        FUN_1400b92d0(local_168);
        FUN_14011d980(local_50);
        FUN_14011d980(local_70);
        FUN_14011d980(local_90);
        FUN_14011d980(local_b0);
        FUN_14011d980(local_d0);
        FUN_14011d980(local_f0);
        FUN_14011d980(local_110);
      }
    }
  }
  FUN_14011d980(local_130);
  return 0;
}



undefined1
FUN_1400e8f50(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *param_5,longlong *param_6,char param_7)

{
  char cVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined1 local_80 [40];
  undefined1 local_58 [48];
  
  *param_5 = 0;
  uVar2 = 0;
  (**(code **)(*param_6 + 0x48))(param_6,"UnEnvelope3",1);
  FUN_1400b8c40(local_58);
  lVar3 = FUN_1400e5f10(param_1,param_2,local_58,param_4,param_5,param_6,param_7);
  if (lVar3 == 0) {
    (**(code **)(*param_6 + 0x28))(param_6,"No certificate with private key found.");
    if (param_7 != '\0') {
      FUN_1400e5c60(param_1,param_6);
    }
  }
  else {
    FUN_1400e6980(lVar3 + 0x198,param_6);
    cVar1 = FUN_1400bdf70(lVar3 + 0x1a8,"1.2.840.113549.1.1.1");
    if (cVar1 == '\0') {
      (**(code **)(*param_6 + 0x28))(param_6,"Unsupported public key algorithm");
      uVar2 = 0;
    }
    else {
      (**(code **)(*param_6 + 0x30))(param_6,"Decrypting symmetric key...(1)");
      FUN_1400b8c40(local_80);
      cVar1 = FUN_1401314b0(local_58,lVar3 + 0x238,local_80,param_6,param_7);
      uVar2 = 0;
      if (cVar1 != '\0') {
        (**(code **)(*param_6 + 0x30))(param_6,"Decrypting data using symmetric key (1)");
        uVar2 = FUN_1400e5dd0(param_1,local_80,param_3,param_6,param_7);
      }
      FUN_1400b92d0(local_80);
    }
  }
  (**(code **)(*param_6 + 0x50))(param_6);
  FUN_1400b92d0(local_58);
  return uVar2;
}



undefined1
FUN_1400e9100(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,longlong *param_6,undefined1 param_7)

{
  char cVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined1 local_40 [40];
  
  uVar2 = 0;
  (**(code **)(*param_6 + 0x48))(param_6,"UnEnvelope2",1);
  lVar3 = FUN_1400e6650(param_1,param_2,param_3,param_6,param_7);
  if (lVar3 == 0) {
    (**(code **)(*param_6 + 0x28))(param_6,"No matching RecipientInfo found.");
  }
  else {
    FUN_1400e6980(lVar3 + 0x198,param_6);
    cVar1 = FUN_1400bdf70(lVar3 + 0x1a8,"1.2.840.113549.1.1.1");
    if (cVar1 == '\0') {
      (**(code **)(*param_6 + 0x28))(param_6,"Unsupported public key algorithm");
      uVar2 = 0;
    }
    else {
      (**(code **)(*param_6 + 0x30))(param_6,"Decrypting symmetric key...(3)");
      FUN_1400b8c40(local_40);
      cVar1 = FUN_1401314b0(param_4,lVar3 + 0x238,local_40,param_6,param_7);
      if (cVar1 == '\0') {
        (**(code **)(*param_6 + 0x28))(param_6,"Failed to decrypt symmetric key.");
        uVar2 = 0;
      }
      else {
        (**(code **)(*param_6 + 0x30))(param_6,"Decrypting data using symmetric key (3)");
        uVar2 = FUN_1400e5dd0(param_1,local_40,param_5,param_6,param_7);
      }
      FUN_1400b92d0(local_40);
    }
  }
  (**(code **)(*param_6 + 0x50))(param_6);
  return uVar2;
}



undefined8 * FUN_1400e9280(undefined8 *param_1)

{
  *param_1 = Pkcs7_EnvelopedData::vftable;
  FUN_1400d0a70(param_1 + 1);
  FUN_1400d0eb0(param_1 + 6);
  param_1[6] = AlgorithmIdentifier::vftable;
  FUN_1400bcc20(param_1 + 8);
  FUN_1400b8c40(param_1 + 0xe);
  *(undefined4 *)(param_1 + 0x13) = 0;
  FUN_1400b8c40(param_1 + 0x14);
  *(undefined4 *)(param_1 + 0x19) = 0;
  FUN_1400b8c40(param_1 + 0x1a);
  return param_1;
}



void FUN_1400e9320(undefined8 *param_1)

{
  *param_1 = Pkcs7_EnvelopedData::vftable;
  FUN_1400d0d30(param_1 + 1);
  FUN_1400b92d0(param_1 + 0x1a);
  param_1[6] = AlgorithmIdentifier::vftable;
  FUN_1400b92d0(param_1 + 0x14);
  FUN_1400b92d0(param_1 + 0xe);
  FUN_1400bceb0(param_1 + 8);
  FUN_1400d0ee0(param_1 + 6);
  FUN_1400d0e10(param_1 + 1);
  return;
}



undefined8 * FUN_1400e93b0(undefined8 *param_1,byte param_2)

{
  *param_1 = Pkcs7_SeData::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void * FUN_1400e93e0(void *param_1,uint param_2)

{
  FUN_1400e68d0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1400e9410(undefined8 *param_1,uint param_2)

{
  *param_1 = AlgorithmIdentifier::vftable;
  FUN_1400b92d0(param_1 + 0xe);
  FUN_1400b92d0(param_1 + 8);
  FUN_1400bceb0(param_1 + 2);
  FUN_1400d0ee0(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1400e9480(undefined8 *param_1)

{
  *param_1 = Pkcs7::vftable;
  param_1[6] = Pkcs7::vftable;
  FUN_1400e7320();
  FUN_1400d0e10(param_1 + 0x14);
  FUN_1400d0e10(param_1 + 0xf);
  FUN_1400d0ee0(param_1 + 6);
  FUN_1400d1240(param_1);
  return;
}



undefined8 *
FUN_1400e94f0(undefined8 param_1,undefined8 param_2,longlong *param_3,undefined1 param_4)

{
  bool bVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 *puVar5;
  longlong lVar6;
  undefined8 *puVar7;
  undefined8 uVar8;
  longlong lVar9;
  int iVar10;
  longlong local_138 [5];
  undefined1 local_110 [40];
  undefined **local_e8 [2];
  undefined1 local_d8 [48];
  undefined1 local_a8 [40];
  undefined4 local_80;
  undefined1 local_78 [40];
  undefined4 local_50;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  puVar5 = (undefined8 *)FUN_140116820();
  bVar1 = true;
  iVar3 = FUN_140139d70(param_2);
  iVar10 = 0;
  if (0 < iVar3) {
    do {
      lVar6 = FUN_1400d0aa0(param_2,iVar10);
      if (lVar6 != 0) {
        (**(code **)(*param_3 + 0x48))(param_3,"buildRecipientInfo",1);
        puVar7 = (undefined8 *)FUN_140116780();
        uVar8 = FUN_140115ff0(0);
        FUN_140114c20(puVar7,uVar8);
        lVar9 = FUN_1400e7cc0(lVar6,param_3);
        if (lVar9 == 0) {
          (**(code **)(*param_3 + 0x28))(param_3,"Failed to create IssuerAndSerial ASN.1");
          if (puVar7 != (undefined8 *)0x0) {
            (**(code **)*puVar7)(puVar7,1);
          }
          (**(code **)(*param_3 + 0x50))(param_3);
        }
        else {
          FUN_140114c20(puVar7,lVar9);
          FUN_1400d0eb0(local_e8);
          local_e8[0] = AlgorithmIdentifier::vftable;
          FUN_1400bcc20(local_d8);
          FUN_1400b8c40(local_a8);
          local_80 = 0;
          FUN_1400b8c40(local_78);
          local_50 = 0;
          FUN_1400bdb00(local_d8,"1.2.840.113549.1.1.1");
          uVar8 = FUN_1400e6ae0(local_e8,param_3);
          FUN_140114c20(puVar7,uVar8);
          FUN_1400b8c40(local_110);
          cVar2 = FUN_1400ecf70(lVar6,local_110,param_3);
          if (cVar2 == '\0') {
            (**(code **)(*param_3 + 0x30))(param_3,"Failed to get public key.");
            if (puVar7 != (undefined8 *)0x0) {
              (**(code **)*puVar7)(puVar7,1);
            }
            (**(code **)(*param_3 + 0x50))(param_3);
            FUN_1400b92d0(local_110);
            local_e8[0] = AlgorithmIdentifier::vftable;
            FUN_1400b92d0(local_78);
            FUN_1400b92d0(local_a8);
            FUN_1400bceb0(local_d8);
          }
          else {
            FUN_1400b8c40(local_138);
            cVar2 = FUN_140131690(local_110,param_1,local_138,param_3,param_4);
            if (cVar2 != '\0') {
              uVar4 = FUN_1400b8b80(local_138);
              uVar8 = FUN_1400b8b90(local_138);
              uVar8 = FUN_140116200(uVar8,uVar4);
              FUN_140114c20(puVar7,uVar8);
              (**(code **)(*param_3 + 0x50))(param_3);
              FUN_1400b92d0(local_138);
              FUN_1400b92d0(local_110);
              local_e8[0] = AlgorithmIdentifier::vftable;
              FUN_1400b92d0(local_78);
              FUN_1400b92d0(local_a8);
              FUN_1400bceb0(local_d8);
              FUN_1400d0ee0(local_e8);
              if (puVar7 != (undefined8 *)0x0) {
                FUN_140114c20(puVar5,puVar7);
                goto LAB_1400e9818;
              }
              goto LAB_1400e9805;
            }
            (**(code **)(*param_3 + 0x30))(param_3,"Failed to RSA encrypt symmetric key.");
            if (puVar7 != (undefined8 *)0x0) {
              (**(code **)*puVar7)(puVar7,1);
            }
            (**(code **)(*param_3 + 0x50))(param_3);
            FUN_1400b92d0(local_138);
            FUN_1400b92d0(local_110);
            local_e8[0] = AlgorithmIdentifier::vftable;
            FUN_1400b92d0(local_78);
            FUN_1400b92d0(local_a8);
            FUN_1400bceb0(local_d8);
          }
          FUN_1400d0ee0(local_e8);
        }
LAB_1400e9805:
        (**(code **)(*param_3 + 0x28))(param_3,"Failed to build RecipientInfo ASN.1");
        bVar1 = false;
      }
LAB_1400e9818:
      iVar10 = iVar10 + 1;
    } while (iVar10 < iVar3);
    if (!bVar1) {
      if (puVar5 != (undefined8 *)0x0) {
        (**(code **)*puVar5)(puVar5,1);
      }
      puVar5 = (undefined8 *)0x0;
    }
  }
  return puVar5;
}



ulonglong FUN_1400e9870(undefined8 param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4,
                       undefined8 param_5,undefined8 param_6,longlong *param_7,undefined1 param_8)

{
  char cVar1;
  byte bVar2;
  undefined4 uVar3;
  ulonglong uVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 uVar7;
  longlong lVar8;
  undefined8 uVar9;
  undefined8 uVar10;
  undefined1 local_108 [48];
  undefined **local_d8 [2];
  undefined1 local_c8 [48];
  undefined1 local_98 [40];
  undefined4 local_70;
  undefined1 local_68 [40];
  int local_40;
  void *local_38;
  undefined8 local_30;
  
  local_30 = 0xfffffffffffffffe;
  FUN_1400d0eb0(local_d8);
  local_d8[0] = AlgorithmIdentifier::vftable;
  FUN_1400bcc20(local_c8);
  FUN_1400b8c40(local_98);
  uVar10 = 0;
  local_70 = 0;
  FUN_1400b8c40(local_68);
  local_40 = 0;
  cVar1 = FUN_1400b36b0(param_2,param_3,local_d8,param_7);
  if (cVar1 == '\0') {
    (**(code **)(*param_7 + 0x28))(param_7,"Unsupported PKCS7 encryption algorithm");
    local_d8[0] = AlgorithmIdentifier::vftable;
    FUN_1400b92d0(local_68);
    FUN_1400b92d0(local_98);
    FUN_1400bceb0(local_c8);
    uVar4 = FUN_1400d0ee0(local_d8);
    uVar4 = uVar4 & 0xffffffffffffff00;
  }
  else {
    puVar5 = (undefined8 *)FUN_1400e6ae0(local_d8,param_7);
    if (puVar5 == (undefined8 *)0x0) {
      (**(code **)(*param_7 + 0x28))(param_7,"Unsupported encryption algorithm OID");
      local_d8[0] = AlgorithmIdentifier::vftable;
      FUN_1400b92d0(local_68);
      FUN_1400b92d0(local_98);
      FUN_1400bceb0(local_c8);
      uVar4 = FUN_1400d0ee0(local_d8);
      uVar4 = uVar4 & 0xffffffffffffff00;
    }
    else {
      FUN_1400b8c40(local_108);
      FUN_1400c0600((int)((local_40 >> 0x1f & 7U) + local_40) >> 3,local_108);
      puVar6 = (undefined8 *)FUN_140116780();
      uVar7 = FUN_140115ff0(0);
      FUN_140114c20(puVar6,uVar7);
      lVar8 = FUN_1400e94f0(local_108,param_4,param_7,param_8);
      if (lVar8 == 0) {
        (**(code **)(*param_7 + 0x28))(param_7,"Failed to build PKCS7 enveloped.");
        if (puVar6 != (undefined8 *)0x0) {
          (**(code **)*puVar6)(puVar6,1);
        }
        FUN_1400b8b00(local_108);
        (**(code **)*puVar5)(puVar5,1);
        FUN_1400b92d0(local_108);
        local_d8[0] = AlgorithmIdentifier::vftable;
        FUN_1400b92d0(local_68);
        FUN_1400b92d0(local_98);
        FUN_1400bceb0(local_c8);
        uVar4 = FUN_1400d0ee0(local_d8);
        uVar4 = uVar4 & 0xffffffffffffff00;
      }
      else {
        FUN_140114c20(puVar6,lVar8);
        uVar7 = FUN_140116780();
        uVar9 = FUN_140116400("1.2.840.113549.1.7.1");
        FUN_140114c20(uVar7,uVar9);
        FUN_140114c20(uVar7,puVar5);
        local_38 = operator_new(0x28);
        if (local_38 != (void *)0x0) {
          uVar10 = FUN_1400b8c40(local_38);
        }
        cVar1 = FUN_1400e7b90(param_1,param_2,param_3,local_108,local_68,uVar10,param_7,param_8);
        if (cVar1 == '\0') {
          (**(code **)(*param_7 + 0x28))(param_7,"Symmetric encryption of data failed.");
        }
        else {
          uVar3 = FUN_1400b8b80(uVar10);
          FUN_1400cf520(param_7,"symmetricEncryptedDataSize",uVar3);
        }
        uVar10 = FUN_140115ef0(0,uVar10);
        FUN_140114c20(uVar7,uVar10);
        FUN_140114c20(puVar6,uVar7);
        FUN_1400b8b00(local_108);
        puVar5 = (undefined8 *)FUN_140116780();
        uVar10 = FUN_140116400("1.2.840.113549.1.7.3");
        FUN_140114c20(puVar5,uVar10);
        uVar10 = FUN_140115e40(0);
        FUN_140114c20(uVar10,puVar6);
        FUN_140114c20(puVar5,uVar10);
        bVar2 = FUN_140115620(puVar5,param_6,0,0,param_7);
        if (puVar5 != (undefined8 *)0x0) {
          (**(code **)*puVar5)(puVar5,1);
        }
        FUN_1400b92d0(local_108);
        local_d8[0] = AlgorithmIdentifier::vftable;
        FUN_1400b92d0(local_68);
        FUN_1400b92d0(local_98);
        FUN_1400bceb0(local_c8);
        FUN_1400d0ee0(local_d8);
        uVar4 = (ulonglong)bVar2;
      }
    }
  }
  return uVar4;
}



undefined8
FUN_1400e9c30(longlong param_1,undefined8 param_2,undefined8 param_3,longlong *param_4,
             undefined1 param_5)

{
  char cVar1;
  int iVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  void *pvVar7;
  undefined8 *puVar8;
  undefined1 *puVar9;
  int iVar10;
  int iVar11;
  longlong *local_res20;
  undefined1 local_188 [160];
  undefined1 local_e8 [168];
  
  local_res20 = param_4;
  (**(code **)(*param_4 + 0x48))(param_4,"Pkcs7_EnvelopedData",1);
  puVar3 = (undefined8 *)FUN_140119210(param_2);
  FUN_1400b6fd0(local_188);
  cVar1 = FUN_140118710(puVar3,"contextSpecific|sequence|$",local_188,param_4);
  if (cVar1 == '\0') {
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    (**(code **)(*param_4 + 0x28))(param_4,"Failed to find XML path to EncryptedContentInfo");
    (**(code **)(*param_4 + 0x50))(param_4);
  }
  else {
    puVar4 = (undefined8 *)FUN_140119050(puVar3,2);
    if (puVar4 == (undefined8 *)0x0) {
      if (puVar3 != (undefined8 *)0x0) {
        (**(code **)*puVar3)(puVar3,1);
      }
      (**(code **)(*param_4 + 0x28))(param_4,"No EncryptedContentInfo found.");
      (**(code **)(*param_4 + 0x50))(param_4);
    }
    else {
      puVar8 = puVar4;
      iVar2 = FUN_1401184f0(puVar4);
      if (iVar2 == 3) {
        if (puVar3 != (undefined8 *)0x0) {
          (**(code **)*puVar3)(puVar3,1);
        }
        puVar3 = (undefined8 *)FUN_140119050(puVar4,0);
        puVar5 = (undefined8 *)FUN_140119050(puVar4,1);
        cVar1 = FUN_1400e6db0(param_1 + 0x30,puVar5,param_4,param_5);
        if (cVar1 == '\0') {
          if (puVar3 != (undefined8 *)0x0) {
            (**(code **)*puVar3)(puVar3,1);
          }
          if (puVar5 != (undefined8 *)0x0) {
            (**(code **)*puVar5)(puVar5,1);
          }
          (**(code **)*puVar4)(puVar4,1);
          (**(code **)(*param_4 + 0x28))(param_4,"Invalid or unsupported AlgorithmIdentifier");
          (**(code **)(*param_4 + 0x50))(param_4);
        }
        else {
          puVar6 = (undefined8 *)FUN_140119050(puVar4,2);
          if (puVar6 != (undefined8 *)0x0) {
            cVar1 = FUN_140118300(puVar6,"octets");
            if (cVar1 == '\0') {
              cVar1 = FUN_140118300(puVar6,"contextSpecific");
              if ((cVar1 == '\0') || (iVar2 = FUN_1401184f0(puVar6), iVar2 != 0)) {
                cVar1 = FUN_140118300(puVar6,"contextSpecific");
                if (cVar1 == '\0') {
                  if (puVar3 != (undefined8 *)0x0) {
                    (**(code **)*puVar3)(puVar3,1);
                  }
                  if (puVar5 != (undefined8 *)0x0) {
                    (**(code **)*puVar5)(puVar5,1);
                  }
                  (**(code **)*puVar4)(puVar4,1);
                  (**(code **)*puVar6)(puVar6,1);
                  (**(code **)(*param_4 + 0x28))(param_4,"Unrecognized encrypted content ASN.1");
                  (**(code **)(*param_4 + 0x50))(param_4);
                  goto LAB_1400ea1cc;
                }
                iVar2 = FUN_1401184f0(puVar6);
                iVar10 = 0;
                if (0 < iVar2) {
                  do {
                    puVar4 = puVar8;
                    puVar8 = (undefined8 *)FUN_140119050(puVar6,iVar10);
                    if (puVar8 != (undefined8 *)0x0) {
                      cVar1 = FUN_140118300(puVar8,"octets");
                      if (cVar1 != '\0') {
                        FUN_1400e73e0(puVar8,param_3,param_1 + 0xd0);
                      }
                      (**(code **)*puVar8)(puVar8,1);
                    }
                    iVar10 = iVar10 + 1;
                    param_4 = local_res20;
                    puVar8 = puVar4;
                  } while (iVar10 < iVar2);
                }
              }
              else {
                FUN_1400e73e0(puVar6,param_3,param_1 + 0xd0);
              }
            }
            else {
              FUN_1400e73e0(puVar6,param_3,param_1 + 0xd0);
            }
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            if (puVar5 != (undefined8 *)0x0) {
              (**(code **)*puVar5)(puVar5,1);
            }
            (**(code **)*puVar6)(puVar6,1);
            (**(code **)*puVar4)(puVar4,1);
            FUN_1400b7090(local_188);
            puVar3 = (undefined8 *)FUN_140119210(param_2);
            FUN_1400b6fd0(local_e8);
            cVar1 = FUN_140118710(puVar3,"contextSpecific|sequence|set|$",local_e8,param_4);
            if (cVar1 == '\0') {
              (**(code **)(*param_4 + 0x28))(param_4,"Failed to find XML path to RecipientInfos");
              (**(code **)(*param_4 + 0x50))(param_4);
              puVar9 = local_e8;
            }
            else {
              iVar2 = FUN_1401184f0(puVar3);
              FUN_1400cf520(param_4,"numRecipients",iVar2);
              iVar11 = 0;
              iVar10 = 0;
              if (0 < iVar2) {
                do {
                  puVar4 = (undefined8 *)FUN_140119050(puVar3,iVar10);
                  if (puVar4 != (undefined8 *)0x0) {
                    (**(code **)(*param_4 + 0x48))(param_4,"RecipientInfo",1);
                    cVar1 = '\0';
                    local_res20 = (longlong *)((ulonglong)local_res20 & 0xffffffffffffff00);
                    pvVar7 = operator_new(0x260);
                    if (pvVar7 == (void *)0x0) {
                      puVar8 = (undefined8 *)0x0;
                    }
                    else {
                      puVar8 = (undefined8 *)
                               FUN_1400e88a0(pvVar7,puVar4,param_3,param_4,param_5,&local_res20,
                                             pvVar7);
                      cVar1 = (char)local_res20;
                    }
                    if (cVar1 == '\0') {
                      if (puVar8 != (undefined8 *)0x0) {
                        (**(code **)*puVar8)(puVar8,1);
                      }
                    }
                    else {
                      iVar11 = iVar11 + 1;
                      FUN_1400d0c90(param_1 + 8,puVar8);
                    }
                    (**(code **)*puVar4)(puVar4,1);
                    (**(code **)(*param_4 + 0x50))(param_4);
                  }
                  iVar10 = iVar10 + 1;
                } while (iVar10 < iVar2);
              }
              if (puVar3 != (undefined8 *)0x0) {
                (**(code **)*puVar3)(puVar3,1);
              }
              (**(code **)(*param_4 + 0x50))(param_4);
              if (iVar11 == iVar2) {
                FUN_1400b7090(local_e8);
                return 1;
              }
              puVar9 = local_e8;
            }
            goto LAB_1400ea1d1;
          }
          if (puVar3 != (undefined8 *)0x0) {
            (**(code **)*puVar3)(puVar3,1);
          }
          if (puVar5 != (undefined8 *)0x0) {
            (**(code **)*puVar5)(puVar5,1);
          }
          (**(code **)*puVar4)(puVar4,1);
          (**(code **)(*param_4 + 0x28))(param_4,"Invalid EncryptedContentInfo");
          (**(code **)(*param_4 + 0x50))(param_4);
        }
      }
      else {
        if (puVar3 != (undefined8 *)0x0) {
          (**(code **)*puVar3)(puVar3,1);
        }
        (**(code **)*puVar4)(puVar4,1);
        (**(code **)(*param_4 + 0x28))(param_4,"EncryptedContentInfo not complete.");
        (**(code **)(*param_4 + 0x50))(param_4);
      }
    }
  }
LAB_1400ea1cc:
  puVar9 = local_188;
LAB_1400ea1d1:
  FUN_1400b7090(puVar9);
  return 0;
}



undefined8
FUN_1400ea1f0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined1 *param_4,
             longlong *param_5,undefined1 param_6)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  void *pvVar8;
  undefined8 uVar9;
  int iVar10;
  undefined1 local_108 [160];
  undefined1 local_68 [48];
  
  *param_4 = 0;
  (**(code **)(*param_5 + 0x48))(param_5,"Pkcs7_SignedData",1);
  puVar5 = (undefined8 *)FUN_140119210(param_2);
  FUN_1400b6fd0(local_108);
  cVar2 = FUN_140118710(puVar5,"contextSpecific|sequence|set|$",local_108,param_5);
  if (cVar2 == '\0') {
    if (puVar5 != (undefined8 *)0x0) {
      (**(code **)*puVar5)(puVar5,1);
    }
    (**(code **)(*param_5 + 0x28))(param_5,"Failed to find XML path to DigestAlgorithmIdentifiers");
    (**(code **)(*param_5 + 0x50))(param_5);
  }
  else {
    iVar3 = FUN_1401184f0(puVar5);
    FUN_1400cf520(param_5,"NumDigestAlgorithmIdentifiers",iVar3);
    iVar10 = 0;
    if (0 < iVar3) {
      do {
        puVar6 = (undefined8 *)FUN_140119050(puVar5,iVar10);
        if (puVar6 != (undefined8 *)0x0) {
          puVar7 = operator_new(0xa0);
          if (puVar7 == (undefined8 *)0x0) {
            puVar7 = (undefined8 *)0x0;
          }
          else {
            FUN_1400d0eb0(puVar7);
            *puVar7 = AlgorithmIdentifier::vftable;
            FUN_1400bcc20(puVar7 + 2);
            FUN_1400b8c40(puVar7 + 8);
            *(undefined4 *)(puVar7 + 0xd) = 0;
            FUN_1400b8c40(puVar7 + 0xe);
            *(undefined4 *)(puVar7 + 0x13) = 0;
          }
          cVar2 = FUN_1400e6db0(puVar7,puVar6,param_5,param_6);
          if (cVar2 == '\0') {
            if (puVar5 != (undefined8 *)0x0) {
              (**(code **)*puVar5)(puVar5,1);
            }
            (**(code **)(*param_5 + 0x28))(param_5,"Failed to load AlgorithmIdentifier");
            (**(code **)(*param_5 + 0x50))(param_5);
            goto LAB_1400ea82e;
          }
          cVar2 = FUN_1400bdf70(puVar7 + 2,"1.2.643.2.2.9");
          if (cVar2 != '\0') {
            (**(code **)(*param_5 + 0x30))(param_5,"Reverting to MS Crypto API for GOST...");
            *param_4 = 1;
            (**(code **)*puVar6)(puVar6,1);
            if (puVar7 != (undefined8 *)0x0) {
              (**(code **)*puVar7)(puVar7,1);
            }
            if (puVar5 != (undefined8 *)0x0) {
              (**(code **)*puVar5)(puVar5,1);
            }
            goto LAB_1400ea82e;
          }
          FUN_1400d0c90(param_1 + 0x58,puVar7);
          FUN_1400e6980(puVar7,param_5);
          (**(code **)*puVar6)(puVar6,1);
        }
        iVar10 = iVar10 + 1;
      } while (iVar10 < iVar3);
    }
    if (puVar5 != (undefined8 *)0x0) {
      (**(code **)*puVar5)(puVar5,1);
    }
    FUN_1400b7090(local_108);
    puVar5 = (undefined8 *)FUN_140119210(param_2);
    FUN_1400b6fd0(local_108);
    cVar2 = FUN_140118710(puVar5,"contextSpecific|sequence|$",local_108,param_5);
    if (cVar2 == '\0') {
      if (puVar5 != (undefined8 *)0x0) {
        (**(code **)*puVar5)(puVar5,1);
      }
      (**(code **)(*param_5 + 0x28))(param_5,"Failed to find XML path to ContentInfo");
      (**(code **)(*param_5 + 0x50))(param_5);
    }
    else {
      puVar6 = (undefined8 *)FUN_140119050(puVar5,2);
      if (puVar6 == (undefined8 *)0x0) {
        if (puVar5 != (undefined8 *)0x0) {
          (**(code **)*puVar5)(puVar5,1);
        }
        (**(code **)(*param_5 + 0x28))(param_5,"No ContentInfo found.");
        (**(code **)(*param_5 + 0x50))(param_5);
      }
      else {
        iVar3 = FUN_1401184f0(puVar6);
        if (iVar3 == 1) {
          cVar2 = FUN_140119110(puVar6,&DAT_140207ba0,"1.2.840.113549.1.7.1");
          if (cVar2 != '\0') {
            (**(code **)(*param_5 + 0x30))(param_5,"This is a detached signature.");
          }
        }
        else {
          iVar3 = FUN_1401184f0(puVar6);
          if (iVar3 != 2) {
            (**(code **)(*param_5 + 0x28))(param_5,"Unexpected ContentInfo..");
            FUN_1400bcc20(local_68);
            FUN_140118e00(puVar6,local_68);
            lVar1 = *param_5;
            uVar9 = FUN_1400b8b90(local_68);
            (**(code **)(lVar1 + 0x58))(param_5,"ContentInfoXml",uVar9);
            (**(code **)*puVar6)(puVar6,1);
            if (puVar5 != (undefined8 *)0x0) {
              (**(code **)*puVar5)(puVar5,1);
            }
            (**(code **)(*param_5 + 0x50))(param_5);
            FUN_1400bceb0(local_68);
            goto LAB_1400ea82e;
          }
          cVar2 = FUN_140119110(puVar6,&DAT_140207ba0,"1.2.840.113549.1.7.1");
          if (cVar2 != '\0') {
            FUN_1400b8b30(param_1 + 8);
            (**(code **)(*param_5 + 0x30))(param_5,"This is an opaque signature.");
            FUN_140118fe0(puVar6,1);
            FUN_1401190f0(puVar6,param_1 + 8,param_3);
            (**(code **)(*param_5 + 0x30))(param_5,"Recovered original content.");
            uVar4 = FUN_1400b8b80(param_1 + 8);
            FUN_1400cf520(param_5,"OriginalContentLen",uVar4);
          }
        }
        (**(code **)*puVar6)(puVar6,1);
        if (puVar5 != (undefined8 *)0x0) {
          (**(code **)*puVar5)(puVar5,1);
        }
        FUN_1400b7090(local_108);
        puVar5 = (undefined8 *)FUN_140119210(param_2);
        FUN_1400b6fd0(local_108);
        cVar2 = FUN_140118710(puVar5,"contextSpecific|sequence|$",local_108,param_5);
        if (cVar2 != '\0') {
          iVar3 = FUN_1401184f0(puVar5);
          puVar6 = (undefined8 *)FUN_140119050(puVar5,iVar3 + -1);
          if (puVar5 != (undefined8 *)0x0) {
            (**(code **)*puVar5)(puVar5,1);
          }
          iVar3 = FUN_1401184f0(puVar6);
          FUN_1400cf520(param_5,"numSigners",iVar3);
          iVar10 = 0;
          if (0 < iVar3) {
            do {
              puVar5 = (undefined8 *)FUN_140119050(puVar6,iVar10);
              if (puVar5 != (undefined8 *)0x0) {
                (**(code **)(*param_5 + 0x48))(param_5,"SignerInfo",1);
                pvVar8 = operator_new(0x420);
                if (pvVar8 == (void *)0x0) {
                  puVar7 = (undefined8 *)0x0;
                }
                else {
                  puVar7 = (undefined8 *)FUN_1400e5690(pvVar8);
                }
                cVar2 = FUN_1400e8370(puVar7,puVar5,param_3,param_5,param_6);
                if (cVar2 == '\0') {
                  if (puVar7 != (undefined8 *)0x0) {
                    (**(code **)*puVar7)(puVar7,1);
                  }
                }
                else {
                  FUN_1400d0c90(param_1 + 0x30,puVar7);
                }
                (**(code **)*puVar5)(puVar5,1);
                (**(code **)(*param_5 + 0x50))(param_5);
              }
              iVar10 = iVar10 + 1;
            } while (iVar10 < iVar3);
          }
          if (puVar6 != (undefined8 *)0x0) {
            (**(code **)*puVar6)(puVar6,1);
          }
          FUN_1400b7090(local_108);
          (**(code **)(*param_5 + 0x50))(param_5);
          return 1;
        }
        if (puVar5 != (undefined8 *)0x0) {
          (**(code **)*puVar5)(puVar5,1);
        }
        (**(code **)(*param_5 + 0x28))(param_5,"Failed to find XML path to SignedData");
        (**(code **)(*param_5 + 0x50))(param_5);
      }
    }
  }
LAB_1400ea82e:
  FUN_1400b7090(local_108);
  return 0;
}



ulonglong FUN_1400ea860(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                       longlong *param_5,undefined1 param_6)

{
  char cVar1;
  byte bVar2;
  ulonglong uVar3;
  
  (**(code **)(*param_5 + 0x48))(param_5,"Pkcs7_EncryptedData",1);
  cVar1 = FUN_140118300(param_2,"sequence");
  if (cVar1 == '\0') {
    (**(code **)(*param_5 + 0x28))(param_5,"PKCS7 EncryptedData root tag must be a sequence.");
  }
  else {
    cVar1 = FUN_140119410(param_2);
    if (((cVar1 != '\0') && (cVar1 = FUN_140118300(param_2,&DAT_140207ba0), cVar1 != '\0')) &&
       (cVar1 = FUN_140118380(param_2,"1.2.840.113549.1.7.6"), cVar1 != '\0')) {
      FUN_140119300(param_2);
      bVar2 = FUN_1400e8040(param_1,param_2,param_3,param_4,param_5,param_6);
      (**(code **)(*param_5 + 0x50))(param_5);
      return (ulonglong)bVar2;
    }
    FUN_140119300(param_2);
    (**(code **)(*param_5 + 0x28))
              (param_5,"PKCS7 EncryptedData -- first child must be oid with 1.2.840.113549.1.7.1");
  }
  uVar3 = (**(code **)(*param_5 + 0x50))(param_5);
  return uVar3 & 0xffffffffffffff00;
}



void * FUN_1400ea980(void *param_1,uint param_2)

{
  FUN_1400e82d0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1400ea9b0(longlong param_1,longlong *param_2,undefined8 param_3,undefined8 param_4,
                       longlong *param_5,longlong *param_6,char param_7)

{
  bool bVar1;
  char cVar2;
  char cVar3;
  int iVar4;
  uint uVar5;
  undefined4 uVar6;
  int iVar7;
  longlong lVar8;
  void *pvVar9;
  void *pvVar10;
  void *pvVar11;
  void *pvVar12;
  longlong lVar13;
  undefined8 uVar14;
  undefined8 uVar15;
  longlong lVar16;
  ulonglong uVar17;
  char *pcVar18;
  int iVar19;
  byte bVar20;
  byte bVar21;
  undefined1 auStack_438 [32];
  longlong *local_418;
  longlong *local_410;
  char local_408;
  char local_3f8;
  char local_3f7;
  char local_3f6;
  char local_3f5;
  char local_3f4;
  char local_3f3;
  char local_3f2;
  uint local_3f0 [2];
  longlong local_3e8;
  int local_3e0;
  int local_3dc;
  longlong *local_3d8;
  longlong local_3d0;
  undefined1 local_3c8 [40];
  undefined1 local_3a0 [40];
  undefined1 local_378 [48];
  undefined8 local_348;
  undefined1 local_340 [40];
  undefined8 local_318;
  longlong *local_310;
  undefined8 local_308;
  undefined1 local_2f8 [96];
  undefined1 local_298 [96];
  undefined1 local_238 [112];
  undefined1 local_1c8 [112];
  longlong local_158 [2];
  undefined8 local_148;
  undefined8 local_140;
  undefined4 local_138;
  undefined8 local_130;
  undefined8 local_128;
  undefined8 local_120;
  undefined8 local_118;
  undefined8 local_110;
  undefined8 local_108;
  undefined8 local_100;
  undefined8 local_f8;
  undefined8 local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  char local_78 [40];
  ulonglong local_50;
  
  local_308 = 0xfffffffffffffffe;
  local_50 = DAT_1402f85a0 ^ (ulonglong)auStack_438;
  local_310 = param_5;
  local_3f2 = param_7;
  local_3d8 = param_2;
  local_3d0 = param_1;
  local_348 = param_3;
  local_318 = param_4;
  FUN_1400d0d30(param_1 + 0x80);
  FUN_1400d0d30(param_1 + 0xa8);
  (**(code **)(*param_6 + 0x48))(param_6,"verifySignature",1);
  local_3e8 = param_1 + 0x30;
  local_3e0 = FUN_140139d70(local_3e8);
  FUN_1400cf520(param_6,"NumSigners",local_3e0);
  FUN_1400f53e0(local_2f8);
  FUN_1400f4fd0(local_298);
  FUN_1400f37a0(local_238);
  pvVar9 = (void *)0x0;
  pvVar10 = (void *)0x0;
  pvVar11 = (void *)0x0;
  local_3f4 = '\0';
  cVar3 = '\0';
  local_3f3 = '\0';
  local_3f7 = '\0';
  local_3f5 = '\0';
  local_3f6 = '\0';
  local_3f8 = '\0';
  param_1 = param_1 + 0x58;
  local_158[0] = param_1;
  local_3dc = FUN_140139d70(param_1);
  FUN_1400cf520(param_6,"NumDigestAlgorithms",local_3dc);
  iVar19 = 0;
  if (0 < local_3dc) {
    do {
      lVar8 = FUN_1400d0aa0(param_1,iVar19);
      if (lVar8 != 0) {
        lVar8 = lVar8 + 0x10;
        cVar2 = FUN_1400bdf70(lVar8,"1.3.14.3.2.26");
        if (cVar2 == '\0') {
          cVar2 = FUN_1400bdf70(lVar8,"1.2.840.113549.2.5");
          if (cVar2 == '\0') {
            cVar2 = FUN_1400bdf70(lVar8,"1.2.840.113549.2.2");
            if (cVar2 == '\0') {
              cVar2 = FUN_1400bdf70(lVar8,"2.16.840.1.101.3.4.2.1");
              if (cVar2 == '\0') {
                cVar2 = FUN_1400bdf70(lVar8,"2.16.840.1.101.3.4.2.2");
                if (cVar2 == '\0') {
                  cVar2 = FUN_1400bdf70(lVar8,"2.16.840.1.101.3.4.2.3");
                  if (cVar2 == '\0') {
                    (**(code **)(*param_6 + 0x28))(param_6,"Unsupported PKCS7 digest algorithm.");
                    lVar13 = *param_6;
                    uVar14 = FUN_1400b8b90(lVar8);
                    (**(code **)(lVar13 + 0x58))(param_6,"digestOid",uVar14);
                    param_1 = local_158[0];
                    cVar3 = local_3f3;
                  }
                  else {
                    param_1 = local_158[0];
                    if (local_3f8 == '\0') {
                      local_3f8 = '\x01';
                      (**(code **)(*param_6 + 0x30))(param_6,"Computing SHA512 message digest.");
                      pvVar11 = (void *)FUN_140102260();
                      FUN_1400f5d70(pvVar11);
                      param_1 = local_158[0];
                    }
                  }
                }
                else {
                  param_1 = local_158[0];
                  if (local_3f6 == '\0') {
                    local_3f6 = '\x01';
                    (**(code **)(*param_6 + 0x30))(param_6,"Computing SHA384 message digest.");
                    pvVar10 = (void *)FUN_1401021b0();
                    FUN_1400f5d70(pvVar10);
                    param_1 = local_158[0];
                  }
                }
              }
              else {
                param_1 = local_158[0];
                if (local_3f5 == '\0') {
                  local_3f5 = '\x01';
                  (**(code **)(*param_6 + 0x30))(param_6,"Computing SHA256 message digest.");
                  pvVar9 = (void *)FUN_140102140();
                  FUN_1400f5d70(pvVar9);
                  param_1 = local_158[0];
                }
              }
            }
            else {
              param_1 = local_158[0];
              if (local_3f4 == '\0') {
                local_3f4 = '\x01';
                (**(code **)(*param_6 + 0x30))(param_6,"Computing MD2 message digest.");
                FUN_1400f5400(local_2f8);
                param_1 = local_158[0];
              }
            }
          }
          else {
            param_1 = local_158[0];
            if (cVar3 == '\0') {
              local_3f3 = '\x01';
              (**(code **)(*param_6 + 0x30))(param_6,"Computing MD5 message digest.");
              FUN_1400f4fa0(local_298);
              param_1 = local_158[0];
              cVar3 = '\x01';
            }
          }
        }
        else {
          param_1 = local_158[0];
          if (local_3f7 == '\0') {
            local_3f7 = '\x01';
            (**(code **)(*param_6 + 0x30))(param_6,"Computing SHA1 message digest.");
            FUN_1400f3800(local_238);
            param_1 = local_158[0];
          }
        }
      }
      iVar19 = iVar19 + 1;
    } while (iVar19 < local_3dc);
  }
  iVar19 = 0;
  cVar3 = local_3f3;
  if (0 < local_3e0) {
    do {
      lVar8 = FUN_1400d0aa0(local_3e8,iVar19);
      if ((lVar8 != 0) && (iVar4 = FUN_1400b8b80(lVar8 + 0x330), iVar4 != 0)) {
        lVar8 = lVar8 + 0x150;
        cVar2 = FUN_1400b8930(lVar8,"1.3.14.3.2.26");
        if (cVar2 == '\0') {
          cVar2 = FUN_1400b8930(lVar8,"1.2.840.113549.2.5");
          if (cVar2 == '\0') {
            cVar2 = FUN_1400b8930(lVar8,"1.2.840.113549.2.2");
            if (cVar2 == '\0') {
              cVar2 = FUN_1400b8930(lVar8,"2.16.840.1.101.3.4.2.1");
              if (cVar2 == '\0') {
                cVar2 = FUN_1400b8930(lVar8,"2.16.840.1.101.3.4.2.2");
                if (cVar2 == '\0') {
                  cVar2 = FUN_1400b8930(lVar8,"2.16.840.1.101.3.4.2.3");
                  if ((cVar2 != '\0') && (local_3f8 == '\0')) {
                    local_3f8 = '\x01';
                    (**(code **)(*param_6 + 0x30))(param_6,"Computing SHA512 message digest.");
                    pvVar12 = (void *)FUN_140102260();
                    pvVar11 = pvVar12;
                    goto LAB_1400eaea5;
                  }
                }
                else if (local_3f6 == '\0') {
                  local_3f6 = '\x01';
                  (**(code **)(*param_6 + 0x30))(param_6,"Computing SHA384 message digest.");
                  pvVar12 = (void *)FUN_1401021b0();
                  pvVar10 = pvVar12;
LAB_1400eaea5:
                  FUN_1400f5d70(pvVar12);
                }
              }
              else if (local_3f5 == '\0') {
                local_3f5 = '\x01';
                (**(code **)(*param_6 + 0x30))(param_6,"Computing SHA256 message digest.");
                pvVar12 = (void *)FUN_140102140();
                pvVar9 = pvVar12;
                goto LAB_1400eaea5;
              }
            }
            else if (local_3f4 == '\0') {
              local_3f4 = '\x01';
              (**(code **)(*param_6 + 0x30))(param_6,"Computing MD2 message digest.");
              FUN_1400f5400(local_2f8);
            }
          }
          else if (cVar3 == '\0') {
            cVar3 = '\x01';
            (**(code **)(*param_6 + 0x30))(param_6,"Computing MD5 message digest.");
            FUN_1400f4fa0(local_298);
          }
        }
        else if (local_3f7 == '\0') {
          local_3f7 = '\x01';
          (**(code **)(*param_6 + 0x30))(param_6,"Computing SHA1 message digest.");
          FUN_1400f3800(local_238);
        }
      }
      iVar19 = iVar19 + 1;
    } while (iVar19 < local_3e0);
  }
  pvVar12 = operator_new(5000);
  local_3f0[0] = 0;
  lVar8 = 0;
  cVar2 = (**(code **)(*local_3d8 + 0x18))(local_3d8);
  while (cVar2 == '\0') {
    local_418 = param_6;
    cVar2 = (**(code **)(*local_3d8 + 8))(local_3d8,pvVar12,0x1000,local_3f0);
    uVar17 = (ulonglong)local_3f0[0];
    if ((local_3f0[0] == 0) || (cVar2 == '\0')) break;
    lVar8 = lVar8 + uVar17;
    if (local_3f7 != '\0') {
      FUN_1400f3cf0(local_238,pvVar12);
      uVar17 = (ulonglong)local_3f0[0];
    }
    if (cVar3 != '\0') {
      FUN_1400f5010(local_298,pvVar12,uVar17);
      uVar17 = (ulonglong)local_3f0[0];
    }
    if (local_3f4 != '\0') {
      FUN_1400f55b0(local_2f8,pvVar12,uVar17);
      uVar17 = (ulonglong)local_3f0[0];
    }
    if ((local_3f5 != '\0') && (pvVar9 != (void *)0x0)) {
      FUN_140102310(pvVar9,pvVar12,uVar17);
      uVar17 = (ulonglong)local_3f0[0];
    }
    if ((local_3f6 != '\0') && (pvVar10 != (void *)0x0)) {
      FUN_140102310(pvVar10,pvVar12,uVar17);
      uVar17 = (ulonglong)local_3f0[0];
    }
    if ((local_3f8 != '\0') && (pvVar11 != (void *)0x0)) {
      FUN_140102310(pvVar11,pvVar12,uVar17);
    }
    cVar2 = (**(code **)(*local_3d8 + 0x18))();
  }
  operator_delete(pvVar12);
  FUN_1400cf580(param_6,"NumBytesDigested",lVar8);
  local_148 = 0;
  local_140 = 0;
  local_138 = 0;
  local_120 = 0;
  local_118 = 0;
  local_130 = 0;
  local_128 = 0;
  local_110 = 0;
  local_108 = 0;
  local_100 = 0;
  local_f8 = 0;
  local_f0 = 0;
  local_e8 = 0;
  local_e0 = 0;
  local_d8 = 0;
  local_d0 = 0;
  local_c8 = 0;
  local_b8 = 0;
  local_b0 = 0;
  local_a8 = 0;
  local_a0 = 0;
  local_98 = 0;
  local_90 = 0;
  local_88 = 0;
  local_80 = 0;
  cVar2 = local_3f2;
  if ((local_3f7 != '\0') &&
     (FUN_1400f44e0(local_238,&local_148), cVar2 = local_3f2, local_3f2 != '\0')) {
    FUN_1400cf340(param_6,"sha1_hash",&local_148,0x14);
  }
  if ((cVar3 != '\0') && (FUN_1400f5150(local_298,&local_120), cVar2 != '\0')) {
    FUN_1400cf340(param_6,"md5_hash",&local_120,0x10);
  }
  if (local_3f4 != '\0') {
    FUN_1400b8c40(local_340);
    FUN_1400f5680(local_2f8,local_340);
    uVar5 = FUN_1400b8b80(local_340);
    pvVar12 = (void *)FUN_1400b8b90(local_340);
    memcpy(&local_130,pvVar12,(ulonglong)uVar5);
    if (cVar2 != '\0') {
      FUN_1400cf340(param_6,"md2_hash",&local_130,0x10);
    }
    FUN_1400b92d0(local_340);
  }
  if ((local_3f5 != '\0') && (pvVar9 != (void *)0x0)) {
    FUN_140102520(pvVar9,&local_110);
    operator_delete(pvVar9);
    if (cVar2 != '\0') {
      FUN_1400cf340(param_6,"sha256_hash",&local_110,0x20);
    }
  }
  if ((local_3f6 != '\0') && (pvVar10 != (void *)0x0)) {
    FUN_140102520(pvVar10,&local_f0);
    operator_delete(pvVar10);
    if (cVar2 != '\0') {
      FUN_1400cf340(param_6,"sha384_hash",&local_f0,0x30);
    }
  }
  if ((local_3f8 != '\0') && (pvVar11 != (void *)0x0)) {
    FUN_140102520(pvVar11,&local_b8);
    operator_delete(pvVar11);
    if (cVar2 != '\0') {
      FUN_1400cf340(param_6,"sha512_hash",&local_b8,0x40);
    }
  }
  iVar19 = local_3e0;
  FUN_1400cf520(param_6,"numSigners",local_3e0);
  bVar1 = false;
  iVar4 = 0;
  lVar8 = local_3e8;
  if (0 < iVar19) {
    do {
      lVar13 = FUN_1400d0aa0(lVar8,iVar4);
      if (lVar13 != 0) {
        lVar8 = *param_6;
        uVar14 = FUN_1400b7ce0(lVar13 + 0x150);
        (**(code **)(lVar8 + 0x58))(param_6,"signerDigestAlgOid",uVar14);
        lVar8 = lVar13 + 0x330;
        uVar6 = FUN_1400b8b80(lVar8);
        FUN_1400cf520(param_6,"messageDigestSize",uVar6);
        iVar7 = FUN_1400b8b80(lVar8);
        if (iVar7 == 0) {
          (**(code **)(*param_6 + 0x28))(param_6,"SignerInfo message digest is empty.");
        }
        else {
          cVar3 = FUN_1400b8930(lVar13 + 0x150,"1.3.14.3.2.26");
          if (cVar3 == '\0') {
            cVar3 = FUN_1400b8930(lVar13 + 0x150,"1.2.840.113549.2.5");
            if (cVar3 == '\0') {
              cVar3 = FUN_1400b8930(lVar13 + 0x150,"1.2.840.113549.2.2");
              if (cVar3 == '\0') {
                cVar3 = FUN_1400b8930(lVar13 + 0x150,"2.16.840.1.101.3.4.2.1");
                if (cVar3 == '\0') {
                  cVar3 = FUN_1400b8930(lVar13 + 0x150,"2.16.840.1.101.3.4.2.2");
                  if (cVar3 == '\0') {
                    cVar3 = FUN_1400b8930(lVar13 + 0x150,"2.16.840.1.101.3.4.2.3");
                    if (cVar3 == '\0') {
                      (**(code **)(*param_6 + 0x28))
                                (param_6,"Unrecognized digest algorithm OID in SignerInfo.");
                      lVar8 = *param_6;
                      uVar14 = FUN_1400b7ce0(lVar13 + 0x150);
                      (**(code **)(lVar8 + 0x58))(param_6,&DAT_140207ba0,uVar14);
                      (**(code **)(*param_6 + 0x50))(param_6);
                      FUN_1400f37f0(local_238);
                      FUN_1400f5000(local_298);
                      goto LAB_1400ebebd;
                    }
                    cVar3 = FUN_1400b9420(lVar8,&local_b8,0x40);
                    if (cVar3 == '\0') {
                      (**(code **)(*param_6 + 0x28))
                                (param_6,"SHA512 message digest does not match.");
                      (**(code **)(*param_6 + 0x50))(param_6);
                      FUN_1400f37f0(local_238);
                      FUN_1400f5000(local_298);
                      goto LAB_1400ebebd;
                    }
                  }
                  else {
                    cVar3 = FUN_1400b9420(lVar8,&local_f0,0x30);
                    if (cVar3 == '\0') {
                      (**(code **)(*param_6 + 0x28))
                                (param_6,"SHA384 message digest does not match.");
                      (**(code **)(*param_6 + 0x50))(param_6);
                      FUN_1400f37f0(local_238);
                      FUN_1400f5000(local_298);
                      goto LAB_1400ebebd;
                    }
                  }
                }
                else {
                  cVar3 = FUN_1400b9420(lVar8,&local_110,0x20);
                  if (cVar3 == '\0') {
                    (**(code **)(*param_6 + 0x28))(param_6,"SHA256 message digest does not match.");
                    (**(code **)(*param_6 + 0x50))(param_6);
                    FUN_1400f37f0(local_238);
                    FUN_1400f5000(local_298);
                    goto LAB_1400ebebd;
                  }
                }
              }
              else {
                cVar3 = FUN_1400b9420(lVar8,&local_130,0x10);
                if (cVar3 == '\0') {
                  (**(code **)(*param_6 + 0x28))(param_6,"MD2 message digest does not match.");
                  (**(code **)(*param_6 + 0x50))(param_6);
                  FUN_1400f37f0(local_238);
                  FUN_1400f5000(local_298);
                  goto LAB_1400ebebd;
                }
              }
            }
            else {
              cVar3 = FUN_1400b9420(lVar8,&local_120,0x10);
              if (cVar3 == '\0') {
                (**(code **)(*param_6 + 0x28))(param_6,"MD5 message digest does not match.");
                (**(code **)(*param_6 + 0x50))(param_6);
                FUN_1400f37f0(local_238);
                FUN_1400f5000(local_298);
                goto LAB_1400ebebd;
              }
            }
          }
          else {
            cVar3 = FUN_1400b9420(lVar8,&local_148,0x14);
            if (cVar3 == '\0') {
              FUN_1400cf340(param_6,"computedHash",&local_148,0x14);
              (**(code **)(*param_6 + 0x28))(param_6,"SHA1 message digest does not match.");
              (**(code **)(*param_6 + 0x50))(param_6);
              FUN_1400f37f0(local_238);
              FUN_1400f5000(local_298);
              goto LAB_1400ebebd;
            }
          }
        }
        bVar1 = true;
        lVar8 = local_3e8;
      }
      iVar4 = iVar4 + 1;
    } while (iVar4 < iVar19);
    if (bVar1) {
      bVar20 = 0;
      bVar21 = 0;
      iVar19 = 0;
      do {
        lVar8 = FUN_1400d0aa0(lVar8,iVar19);
        if (lVar8 != 0) {
          iVar4 = FUN_1400b8b80(lVar8 + 0x330);
          uVar14 = local_348;
          if (iVar4 == 0) {
            lVar8 = FUN_1400d0aa0(local_348,0);
            if (lVar8 != 0) {
              (**(code **)(*param_6 + 0x30))(param_6,"Adding extracted cert to signers list.");
              uVar6 = FUN_140139d70(uVar14);
              FUN_1400cf520(param_6,"numExtractedCerts",uVar6);
              local_3d8 = operator_new(0x200);
              if (local_3d8 == (longlong *)0x0) {
                uVar14 = 0;
              }
              else {
                uVar14 = FUN_140119b70(local_3d8);
              }
              FUN_140119860(uVar14,lVar8,param_6,0);
              uVar15 = FUN_1400be710();
              lVar8 = local_3d0;
              FUN_1400d0c90(local_3d0 + 0x80,uVar14);
              FUN_1400d0c90(lVar8 + 0xa8,uVar15);
            }
            bVar20 = 1;
            bVar21 = 1;
          }
          else {
            sprintf(local_78,"Signer_%d");
            (**(code **)(*param_6 + 0x48))(param_6,local_78,1);
            lVar13 = lVar8 + 0xb0;
            iVar4 = FUN_1400b8350(lVar13);
            if (iVar4 == 0) {
              (**(code **)(*param_6 + 0x30))(param_6,"Warning: Issuer CN is emtpy.");
            }
            else {
              lVar16 = *param_6;
              uVar14 = FUN_1400b7ce0(lVar13);
              (**(code **)(lVar16 + 0x58))(param_6,"issuerCN",uVar14);
            }
            iVar4 = FUN_1400b8350(lVar8 + 0x10);
            if (iVar4 == 0) {
              pcVar18 = "Serial number is emtpy.";
            }
            else {
              lVar16 = *param_6;
              uVar14 = FUN_1400b7ce0(lVar8 + 0x10);
              (**(code **)(lVar16 + 0x58))(param_6,"serialNum",uVar14);
              uVar14 = FUN_1400b7ce0(lVar8 + 0x10);
              uVar15 = FUN_1400b7ce0(lVar13);
              lVar13 = local_3d0;
              cVar3 = local_3f2;
              local_408 = local_3f2;
              local_410 = param_6;
              local_418 = local_310;
              lVar16 = FUN_1400e62a0(local_3d0,uVar15,uVar14,local_348);
              if (lVar16 != 0) {
                FUN_1400b8c40(local_340);
                cVar2 = FUN_14011a8d0(lVar16,local_340,param_6);
                if (cVar2 == '\0') {
                  (**(code **)(*param_6 + 0x30))(param_6,"Failed to get public key..");
                  (**(code **)(*param_6 + 0x50))(param_6);
                  FUN_1400d0c90(lVar13 + 0x80,lVar16);
                  uVar14 = FUN_1400be710();
                  FUN_1400d0c90(lVar13 + 0xa8,uVar14);
                }
                else {
                  FUN_1400bcc20(local_378);
                  FUN_1400b8c40(local_3a0);
                  local_410 = (longlong *)CONCAT71(local_410._1_7_,cVar3);
                  local_418 = param_6;
                  cVar3 = FUN_1400e8bb0(lVar8,local_340,local_378,local_3a0);
                  if (cVar3 == '\0') {
                    (**(code **)(*param_6 + 0x30))(param_6,"Failed to decrypt digest.");
                    (**(code **)(*param_6 + 0x50))(param_6);
                    FUN_1400d0c90(lVar13 + 0x80,lVar16);
                    uVar14 = FUN_1400be710();
                    FUN_1400d0c90(lVar13 + 0xa8,uVar14);
                    FUN_1400b92d0(local_3a0);
                    FUN_1400bceb0(local_378);
                  }
                  else {
                    lVar8 = *param_6;
                    uVar14 = FUN_1400b8b90(local_378);
                    (**(code **)(lVar8 + 0x58))(param_6,"digestOid",uVar14);
                    lVar8 = FUN_1400be710();
                    lVar13 = FUN_1400d0aa0(local_318,iVar19);
                    if (((lVar8 == 0) || (lVar13 == 0)) ||
                       (iVar4 = FUN_1400b8b80(lVar13), iVar4 == 0)) {
                      cVar3 = FUN_1400bdf70(local_378,"1.3.14.3.2.26");
                      if (cVar3 == '\0') {
                        cVar3 = FUN_1400bdf70(local_378,"1.2.840.113549.2.5");
                        if (cVar3 == '\0') {
                          cVar3 = FUN_1400bdf70(local_378,"1.2.840.113549.2.2");
                          if (cVar3 == '\0') {
                            cVar3 = FUN_1400bdf70(local_378,"2.16.840.1.101.3.4.2.1");
                            if (cVar3 == '\0') {
                              cVar3 = FUN_1400bdf70(local_378,"2.16.840.1.101.3.4.2.2");
                              if (cVar3 == '\0') {
                                cVar3 = FUN_1400bdf70(local_378,"2.16.840.1.101.3.4.2.3");
                                if (cVar3 == '\0') {
                                  (**(code **)(*param_6 + 0x28))(param_6,"Unrecognized digest OID");
                                  lVar13 = *param_6;
                                  uVar14 = FUN_1400b8b90(local_378);
                                  (**(code **)(lVar13 + 0x58))(param_6,"digestOID",uVar14);
                                  cVar3 = '\0';
                                }
                                else {
                                  cVar3 = FUN_1400b9420(local_3a0,&local_b8,0x40);
                                }
                              }
                              else {
                                cVar3 = FUN_1400b9420(local_3a0,&local_f0,0x30);
                              }
                            }
                            else {
                              cVar3 = FUN_1400b9420(local_3a0,&local_110,0x20);
                            }
                          }
                          else {
                            cVar3 = FUN_1400b9420(local_3a0,&local_130,0x10);
                          }
                        }
                        else {
                          cVar3 = FUN_1400b9420(local_3a0,&local_120,0x10);
                        }
                      }
                      else {
                        cVar3 = FUN_1400b9420(local_3a0,&local_148,0x14);
                      }
                    }
                    else {
                      local_418 = (longlong *)CONCAT71(local_418._1_7_,local_3f2);
                      FUN_1400e64e0(local_3d0,lVar13,lVar8,param_6);
                      FUN_1400b8c40(local_3c8);
                      cVar3 = FUN_1400bdf70(local_378,"1.3.14.3.2.26");
                      if (cVar3 == '\0') {
                        cVar3 = FUN_1400bdf70(local_378,"1.2.840.113549.2.5");
                        if (cVar3 == '\0') {
                          cVar3 = FUN_1400bdf70(local_378,"1.2.840.113549.2.2");
                          if (cVar3 == '\0') {
                            cVar3 = FUN_1400bdf70(local_378,"2.16.840.1.101.3.4.2.1");
                            if (cVar3 == '\0') {
                              cVar3 = FUN_1400bdf70(local_378,"2.16.840.1.101.3.4.2.2");
                              if (cVar3 == '\0') {
                                cVar3 = FUN_1400bdf70(local_378,"2.16.840.1.101.3.4.2.3");
                                if (cVar3 == '\0') {
                                  (**(code **)(*param_6 + 0x28))(param_6,"Unrecognized digest OID");
                                  lVar13 = *param_6;
                                  uVar14 = FUN_1400b8b90(local_378);
                                  (**(code **)(lVar13 + 0x58))(param_6,"digestOID",uVar14);
                                }
                                else {
                                  FUN_140102d40(lVar13,local_3c8);
                                }
                              }
                              else {
                                FUN_140102ca0(lVar13,local_3c8);
                              }
                            }
                            else {
                              FUN_140102bb0(lVar13,local_3c8);
                            }
                          }
                          else {
                            FUN_1400f53e0(local_1c8);
                            FUN_1400f5700(local_1c8,lVar13,local_3c8);
                            FUN_1400f53f0(local_1c8);
                          }
                        }
                        else {
                          FUN_1400f4fd0(local_1c8);
                          FUN_1400f5330(local_1c8,lVar13,local_158);
                          FUN_1400b97e0(local_3c8,local_158,0x10);
                          FUN_1400f5000(local_1c8);
                        }
                      }
                      else {
                        FUN_1400f37a0(local_1c8);
                        FUN_1400f4650(local_1c8,lVar13,local_3c8);
                        FUN_1400f37f0(local_1c8);
                      }
                      cVar3 = '\0';
                      iVar4 = FUN_1400b8b80(local_3c8);
                      if (iVar4 != 0) {
                        cVar3 = FUN_1400b93e0(local_3a0,local_3c8);
                        if ((cVar3 == '\0') && (cVar3 = FUN_1400b8bc0(local_3c8), cVar3 == '\0')) {
                          iVar4 = FUN_1400b8b80(local_3a0);
                          iVar7 = FUN_1400b8b80(local_3c8);
                          if (iVar7 == iVar4 + 1) {
                            FUN_1400b9990(local_3c8,0,1);
                          }
                        }
                        cVar3 = FUN_1400b93e0(local_3a0,local_3c8);
                        if (cVar3 == '\0') {
                          (**(code **)(*param_6 + 0x28))
                                    (param_6,
                                     "Authenticated attributes DER digest does not match the decrypted digest."
                                    );
                          uVar6 = FUN_1400b8b80(local_3c8);
                          uVar14 = FUN_1400b8b90(local_3c8);
                          FUN_1400cf340(param_6,"aaDigest",uVar14,uVar6);
                          uVar6 = FUN_1400b8b80(local_3c8);
                          FUN_1400cf520(param_6,"aaDigestSize",uVar6);
                          uVar6 = FUN_1400b8b80(local_3a0);
                          uVar14 = FUN_1400b8b90(local_3a0);
                          FUN_1400cf340(param_6,"decryptedDigest",uVar14,uVar6);
                          uVar6 = FUN_1400b8b80(local_3a0);
                          FUN_1400cf520(param_6,"decryptedDigestSize",uVar6);
                          cVar3 = '\0';
                        }
                        else {
                          (**(code **)(*param_6 + 0x30))
                                    (param_6,"Digest of authenticated attributes DER matches.");
                          cVar3 = '\x01';
                        }
                      }
                      FUN_1400b92d0(local_3c8);
                    }
                    lVar13 = local_3d0;
                    FUN_1400d0c90(local_3d0 + 0x80,lVar16);
                    FUN_1400d0c90(lVar13 + 0xa8,lVar8);
                    bVar21 = bVar20;
                    if (cVar3 != '\0') {
                      bVar21 = 1;
                    }
                    (**(code **)(*param_6 + 0x50))(param_6);
                    FUN_1400b92d0(local_3a0);
                    FUN_1400bceb0(local_378);
                    bVar20 = bVar21;
                  }
                }
                FUN_1400b92d0(local_340);
                goto LAB_1400ebe21;
              }
              pcVar18 = "Cannot find matching certificate.";
            }
            (**(code **)(*param_6 + 0x30))(param_6,pcVar18);
            (**(code **)(*param_6 + 0x50))(param_6);
          }
        }
LAB_1400ebe21:
        iVar19 = iVar19 + 1;
        lVar8 = local_3e8;
        if (local_3e0 <= iVar19) {
          if (bVar21 == 0) {
            (**(code **)(*param_6 + 0x28))(param_6,"Failed to verify signature.");
          }
          else {
            (**(code **)(*param_6 + 0x30))(param_6,"Signature verified.");
          }
          (**(code **)(*param_6 + 0x50))(param_6);
          FUN_1400f37f0(local_238);
          FUN_1400f5000(local_298);
          FUN_1400f53f0(local_2f8);
          return (ulonglong)bVar21;
        }
      } while( true );
    }
  }
  (**(code **)(*param_6 + 0x28))(param_6,"Unable to verify hash!");
  (**(code **)(*param_6 + 0x50))(param_6);
  FUN_1400f37f0(local_238);
  FUN_1400f5000(local_298);
LAB_1400ebebd:
  uVar17 = FUN_1400f53f0(local_2f8);
  return uVar17 & 0xffffffffffffff00;
}



ulonglong FUN_1400ebef0(longlong param_1)

{
  ulonglong uVar1;
  longlong *in_stack_00000030;
  
  if (*(longlong *)(param_1 + 0x60) == 0) {
    uVar1 = (**(code **)(*in_stack_00000030 + 0x28))
                      (in_stack_00000030,
                       "Cannot unenvelope (2) -- not a PKCS7 EnvelopedData object.");
    return uVar1 & 0xffffffffffffff00;
  }
  uVar1 = FUN_1400e9100();
  return uVar1;
}



void * FUN_1400ebf40(void *param_1,uint param_2)

{
  FUN_1400e9320();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void * FUN_1400ebf70(void *param_1,uint param_2)

{
  FUN_1400e9480();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



ulonglong FUN_1400ebfa0(longlong param_1,undefined8 param_2,undefined8 param_3,char param_4,
                       undefined8 param_5,undefined1 *param_6,longlong *param_7,undefined1 param_8)

{
  longlong lVar1;
  char cVar2;
  byte bVar3;
  undefined8 uVar4;
  ulonglong uVar5;
  undefined8 *puVar6;
  void *pvVar7;
  undefined1 local_1b8 [416];
  
  *param_6 = 0;
  FUN_1400e7320();
  FUN_140118090(local_1b8);
  uVar4 = FUN_1400b8b90(param_2);
  FUN_1401195c0(local_1b8,uVar4,1);
  if (param_4 != '\0') {
    FUN_1400bbe30(param_2);
  }
  (**(code **)(*param_7 + 0x48))(param_7,"Pkcs7_loadXml",1);
  cVar2 = FUN_140118300(local_1b8,"sequence");
  if (cVar2 == '\0') {
    (**(code **)(*param_7 + 0x28))(param_7,"Expected PKCS7 to begin with a sequence tag.");
    (**(code **)(*param_7 + 0x50))(param_7);
    uVar5 = FUN_140118160(local_1b8);
    return uVar5 & 0xffffffffffffff00;
  }
  FUN_140119410(local_1b8);
  cVar2 = FUN_140118300(local_1b8,&DAT_140207ba0);
  if (cVar2 == '\0') {
    (**(code **)(*param_7 + 0x28))(param_7,"Expected oid tag for 1st child in PKCS7");
    (**(code **)(*param_7 + 0x50))(param_7);
    uVar5 = FUN_140118160(local_1b8);
    return uVar5 & 0xffffffffffffff00;
  }
  cVar2 = FUN_140118380(local_1b8,"1.2.840.113549.1.7.1");
  if (cVar2 == '\0') {
    cVar2 = FUN_140118380(local_1b8,"1.2.840.113549.1.7.2");
    if (cVar2 != '\0') {
      FUN_140119290();
      *(undefined4 *)(param_1 + 0x40) = 2;
      pvVar7 = operator_new(0xd0);
      if (pvVar7 == (void *)0x0) {
        uVar4 = 0;
      }
      else {
        uVar4 = FUN_1400e6860(pvVar7);
      }
      *(undefined8 *)(param_1 + 0x70) = uVar4;
      bVar3 = FUN_1400ea1f0(uVar4,local_1b8,param_3,param_6,param_7,param_8);
      goto LAB_1400ec31f;
    }
    cVar2 = FUN_140118380(local_1b8,"1.2.840.113549.1.7.3");
    if (cVar2 != '\0') {
      FUN_140119290();
      *(undefined4 *)(param_1 + 0x40) = 3;
      pvVar7 = operator_new(0xf8);
      if (pvVar7 == (void *)0x0) {
        uVar4 = 0;
      }
      else {
        uVar4 = FUN_1400e9280(pvVar7);
      }
      *(undefined8 *)(param_1 + 0x60) = uVar4;
      bVar3 = FUN_1400e9c30(uVar4,local_1b8,param_3,param_7,param_8);
      goto LAB_1400ec31f;
    }
    cVar2 = FUN_140118380(local_1b8,"1.2.840.113549.1.7.4");
    if (cVar2 == '\0') {
      cVar2 = FUN_140118380(local_1b8,"1.2.840.113549.1.7.5");
      if (cVar2 == '\0') {
        cVar2 = FUN_140118380(local_1b8,"1.2.840.113549.1.7.6");
        if (cVar2 != '\0') {
          FUN_140119290();
          *(undefined4 *)(param_1 + 0x40) = 6;
          pvVar7 = operator_new(0x30);
          if (pvVar7 == (void *)0x0) {
            uVar4 = 0;
          }
          else {
            uVar4 = FUN_1400e52e0(pvVar7);
          }
          *(undefined8 *)(param_1 + 0x58) = uVar4;
          bVar3 = FUN_1400ea860(uVar4,local_1b8,param_3,param_5,param_7,param_8);
          goto LAB_1400ec31f;
        }
        lVar1 = *param_7;
        uVar4 = FUN_140118400(local_1b8);
        (**(code **)(lVar1 + 0x58))(param_7,"UnexpectedOid",uVar4);
      }
      else {
        FUN_140119290();
        *(undefined4 *)(param_1 + 0x40) = 5;
        puVar6 = operator_new(8);
        if (puVar6 == (undefined8 *)0x0) {
          puVar6 = (undefined8 *)0x0;
        }
        else {
          *puVar6 = Pkcs7_DigestedData::vftable;
        }
        *(undefined8 **)(param_1 + 0x50) = puVar6;
      }
    }
    else {
      FUN_140119290();
      *(undefined4 *)(param_1 + 0x40) = 4;
      puVar6 = operator_new(8);
      if (puVar6 == (undefined8 *)0x0) {
        puVar6 = (undefined8 *)0x0;
      }
      else {
        *puVar6 = Pkcs7_SeData::vftable;
      }
      *(undefined8 **)(param_1 + 0x68) = puVar6;
    }
    bVar3 = 0;
  }
  else {
    FUN_140119290();
    *(undefined4 *)(param_1 + 0x40) = 1;
    puVar6 = operator_new(0x30);
    if (puVar6 == (undefined8 *)0x0) {
      puVar6 = (undefined8 *)0x0;
    }
    else {
      *puVar6 = Pkcs7_Data::vftable;
      FUN_1400b8c40(puVar6 + 1);
    }
    *(undefined8 **)(param_1 + 0x48) = puVar6;
    bVar3 = FUN_1400e7e20(puVar6,local_1b8,param_3,param_7,param_8);
LAB_1400ec31f:
    if (bVar3 != 0) goto LAB_1400ec34a;
  }
  FUN_1400e7320(param_1);
LAB_1400ec34a:
  (**(code **)(*param_7 + 0x50))(param_7);
  FUN_140118160(local_1b8);
  return (ulonglong)bVar3;
}



undefined1
FUN_1400ec380(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined1 param_7)

{
  undefined1 uVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined1 local_68 [96];
  
  FUN_1400b8b30(param_2);
  FUN_1400b9e90(param_2,param_1 + 8);
  FUN_1400ef410(local_68);
  uVar2 = FUN_1400b8b80(param_1 + 8);
  uVar3 = FUN_1400b8b90(param_1 + 8);
  FUN_1400ef3e0(local_68,uVar3,uVar2,0);
  uVar1 = FUN_1400ea9b0(param_1,local_68,param_3,param_4,param_5,param_6,param_7);
  FUN_1400ef440(local_68);
  return uVar1;
}



ulonglong FUN_1400ec470(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                       undefined1 *param_5,undefined1 *param_6,longlong *param_7,undefined1 param_8)

{
  ulonglong uVar1;
  
  *param_5 = 0;
  *param_6 = 0;
  if (*(longlong *)(param_1 + 0x60) != 0) {
    uVar1 = FUN_1400e8f50(*(longlong *)(param_1 + 0x60));
    return uVar1;
  }
  if (*(longlong *)(param_1 + 0x70) != 0) {
    *param_6 = 1;
    if (*(longlong *)(param_1 + 0x70) == 0) {
      uVar1 = (**(code **)(*param_7 + 0x28))
                        (param_7,"Cannot verify opaque signature -- not a PKCS7 SignedData object.")
      ;
      return uVar1 & 0xffffffffffffff00;
    }
    uVar1 = FUN_1400ec380(*(longlong *)(param_1 + 0x70),param_3,param_1 + 0x78,param_1 + 0xa0,
                          param_2,param_7,param_8);
    return uVar1;
  }
  uVar1 = (**(code **)(*param_7 + 0x28))
                    (param_7,"Cannot unenvelope (3) -- not a PKCS7 EnvelopedData object.");
  return uVar1 & 0xffffffffffffff00;
}



ulonglong FUN_1400ec550(longlong param_1,undefined8 param_2,undefined8 param_3,undefined1 *param_4,
                       longlong *param_5)

{
  char cVar1;
  byte bVar2;
  DWORD DVar3;
  ulonglong uVar4;
  ulonglong in_stack_ffffffffffffff70;
  undefined1 local_70 [40];
  undefined1 local_48 [48];
  
  *param_4 = 0;
  FUN_1400e7320();
  FUN_1400d0a70(local_70);
  FUN_1400bcc20(local_48);
  DVar3 = GetTickCount();
  cVar1 = FUN_14011d520(param_2,1,local_48,local_70,param_5,
                        in_stack_ffffffffffffff70 & 0xffffffffffffff00);
  if (cVar1 == '\0') {
    (**(code **)(*param_5 + 0x28))(param_5,"Failed to decode DER.");
    FUN_1400bceb0(local_48);
    uVar4 = FUN_1400d0e10(local_70);
    uVar4 = uVar4 & 0xffffffffffffff00;
  }
  else {
    FUN_1400cf4a0(param_5,"DerParseTimeMs",DVar3);
    DVar3 = GetTickCount();
    bVar2 = FUN_1400ebfa0(param_1,local_48,local_70,1,param_3,param_4,param_5,0);
    FUN_1400cf4a0(param_5,"Pkcs7XmlLoadTimeMs",DVar3);
    FUN_1400d0d30(local_70);
    if (*(int *)(param_1 + 0x40) == 2) {
      DVar3 = GetTickCount();
      (**(code **)(*param_5 + 0x48))(param_5,"ExtractCertsFromSignedData1",1);
      FUN_1400e7660(param_1,param_2,param_5,0);
      FUN_1400cf4a0(param_5,"ExtractCertsTimeMs",DVar3);
      (**(code **)(*param_5 + 0x50))(param_5);
    }
    FUN_1400bceb0(local_48);
    FUN_1400d0e10(local_70);
    uVar4 = (ulonglong)bVar2;
  }
  return uVar4;
}



undefined8 FUN_1400ec6e0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x160);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1400ec6f0(undefined8 *param_1,longlong param_2,longlong param_3,char param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  undefined1 auStack_a8 [32];
  undefined8 *local_88;
  void *local_80;
  undefined8 local_78;
  char local_70 [56];
  ulonglong local_38;
  
  local_78 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_a8;
  local_88 = param_1;
  FUN_1400afba0();
  *param_1 = ClsCert::vftable;
  *(undefined2 *)(param_1 + 0x2b) = 0;
  uVar2 = 0;
  param_1[0x2c] = 0;
  param_1[0x2d] = 0;
  sprintf(local_70,"%d");
  if (param_2 != 0) {
    if (param_4 == '\0') {
      param_1[0x2c] = param_2;
    }
    else {
      uVar1 = FUN_1400ecb90(param_2);
      param_1[0x2c] = uVar1;
    }
  }
  if (param_3 != 0) {
    if (param_4 == '\0') {
      param_1[0x2d] = param_3;
    }
    else {
      local_80 = operator_new(0x28);
      if (local_80 != (void *)0x0) {
        uVar2 = FUN_1400d0a70(local_80);
      }
      param_1[0x2d] = uVar2;
      FUN_14010fbe0(param_3,uVar2);
    }
  }
  return param_1;
}



void FUN_1400ec800(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  
  *param_1 = ClsCert::vftable;
  puVar1 = (undefined8 *)param_1[0x2c];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,0xfffffffffffffffe);
    param_1[0x2c] = 0;
  }
  if (param_1[0x2d] != 0) {
    FUN_1400d0d30();
    puVar1 = (undefined8 *)param_1[0x2d];
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    param_1[0x2d] = 0;
  }
  FUN_1400afc00(param_1);
  return;
}



void * FUN_1400ec880(void *param_1,uint param_2)

{
  FUN_1400ec800();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1400ec8b0(undefined8 *param_1)

{
  FUN_1400d0eb0();
  *param_1 = Certificate::vftable;
  param_1[2] = 0;
  FUN_140119b70(param_1 + 3);
  FUN_1400b8c40(param_1 + 0x43);
  *(undefined1 *)(param_1 + 0x48) = 0;
  *(undefined4 *)((longlong)param_1 + 0x244) = 0;
  return param_1;
}



void FUN_1400ec910(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  
  *param_1 = Certificate::vftable;
  puVar1 = (undefined8 *)param_1[2];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,0xfffffffffffffffe);
    param_1[2] = 0;
  }
  FUN_1400b8b00(param_1 + 0x43);
  FUN_1400b92d0(param_1 + 0x43);
  FUN_140119be0(param_1 + 3);
  FUN_1400d0ee0(param_1);
  return;
}



undefined4 FUN_1400ec990(longlong param_1,undefined8 param_2)

{
  undefined8 uVar1;
  int iVar2;
  undefined4 uVar3;
  longlong lVar4;
  undefined1 local_30 [40];
  
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_1400b8c40(local_30);
    FUN_140119830(param_1 + 0x18,local_30);
    iVar2 = FUN_1400b8b80(local_30);
    if (iVar2 != 0) {
      uVar3 = FUN_1400b8b80(local_30);
      uVar1 = FUN_1400b8b90(local_30);
      lVar4 = FUN_140111700(uVar1,uVar3,param_2);
      *(longlong *)(param_1 + 0x10) = lVar4;
      if (lVar4 != 0) {
        iVar2 = FUN_1400b8b80(param_1 + 0x218);
        if (iVar2 != 0) {
          uVar3 = FUN_1400b8b80(param_1 + 0x218);
          uVar1 = FUN_1400b8b90(param_1 + 0x218);
          FUN_14010fd40(*(undefined8 *)(param_1 + 0x10),uVar1,uVar3);
        }
        FUN_1400b92d0(local_30);
        goto LAB_1400eca53;
      }
    }
    FUN_1400b92d0(local_30);
    uVar3 = 0;
  }
  else {
LAB_1400eca53:
    uVar3 = 1;
  }
  return uVar3;
}



void FUN_1400eca80(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  FUN_1400b8b00(param_1 + 0x218);
  FUN_1400b97e0(param_1 + 0x218,param_2,param_3);
  return;
}



undefined8 *
FUN_1400ecad0(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined1 param_4)

{
  char cVar1;
  void *pvVar2;
  undefined8 *puVar3;
  
  pvVar2 = operator_new(0x248);
  if (pvVar2 == (void *)0x0) {
    puVar3 = (undefined8 *)0x0;
  }
  else {
    puVar3 = (undefined8 *)FUN_1400ec8b0(pvVar2);
  }
  cVar1 = FUN_140119990(puVar3 + 3,param_1,param_2,param_3,param_4);
  if (cVar1 == '\0') {
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    puVar3 = (undefined8 *)0x0;
  }
  return puVar3;
}



void FUN_1400ecb80(longlong param_1,undefined8 param_2)

{
  FUN_14011a6d0(param_1 + 0x18,0,param_2);
  return;
}



longlong FUN_1400ecb90(longlong param_1)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined1 local_res8 [8];
  void *local_res10;
  undefined1 local_30 [40];
  
  local_res10 = operator_new(0x248);
  if (local_res10 == (void *)0x0) {
    lVar1 = 0;
  }
  else {
    lVar1 = FUN_1400ec8b0(local_res10);
  }
  if (*(longlong *)(param_1 + 0x10) != 0) {
    uVar2 = FUN_1401117b0();
    *(undefined8 *)(lVar1 + 0x10) = uVar2;
  }
  FUN_1400b9e90(lVar1 + 0x218,param_1 + 0x218);
  FUN_1400b8c40(local_30);
  FUN_140119830(param_1 + 0x18,local_30);
  FUN_1400bebf0(local_res8);
  FUN_140119860(lVar1 + 0x18,local_30,local_res8,0);
  FUN_1400bec20(local_res8);
  FUN_1400b92d0(local_30);
  return lVar1;
}



void FUN_1400ecc50(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_1400b7180(param_2);
  FUN_14011a5e0(param_1 + 0x18,1,0,param_2,param_3);
  return;
}



ulonglong FUN_1400ecca0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  int iVar1;
  char *pcVar2;
  ulonglong uVar3;
  undefined1 local_40 [56];
  
  FUN_1400bcc20(local_40);
  FUN_14011ac80(param_1 + 0x18,&DAT_140244420,local_40,param_3,0);
  FUN_1400bbba0(local_40,"</contextSpecific>",0);
  pcVar2 = (char *)FUN_1400b8b90(local_40);
  pcVar2 = strchr(pcVar2,0x3e);
  if (pcVar2 == (char *)0x0) {
    uVar3 = FUN_1400bceb0(local_40);
    uVar3 = uVar3 & 0xffffffffffffff00;
  }
  else {
    pcVar2 = strchr(pcVar2 + 1,0x3e);
    if (pcVar2 == (char *)0x0) {
      uVar3 = FUN_1400bceb0(local_40);
      uVar3 = uVar3 & 0xffffffffffffff00;
    }
    else {
      FUN_1400b9f10(param_2,pcVar2 + 1,"base64");
      iVar1 = FUN_1400b8b80(param_2);
      FUN_1400bceb0(local_40);
      uVar3 = (ulonglong)(iVar1 != 0);
    }
  }
  return uVar3;
}



ulonglong FUN_1400ecd90(longlong param_1,char *param_2,undefined8 param_3,longlong *param_4)

{
  ulonglong uVar1;
  longlong lVar2;
  char *pcVar3;
  char *pcVar4;
  bool bVar5;
  
  uVar1 = FUN_1400b7180(param_3);
  if (param_2 == (char *)0x0) {
    return uVar1 & 0xffffffffffffff00;
  }
  lVar2 = 3;
  bVar5 = false;
  pcVar3 = param_2;
  pcVar4 = "CN";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *pcVar3 == *pcVar4;
    pcVar3 = pcVar3 + 1;
    pcVar4 = pcVar4 + 1;
  } while (bVar5);
  if (bVar5) {
    uVar1 = FUN_14011aa30(param_1 + 0x18,param_3,param_4);
  }
  else {
    lVar2 = 2;
    pcVar3 = param_2;
    pcVar4 = "C";
    do {
      if (lVar2 == 0) break;
      lVar2 = lVar2 + -1;
      bVar5 = *pcVar3 == *pcVar4;
      pcVar3 = pcVar3 + 1;
      pcVar4 = pcVar4 + 1;
    } while (bVar5);
    if (bVar5) {
      uVar1 = FUN_14011a990(param_1 + 0x18,param_3,param_4);
    }
    else {
      lVar2 = 2;
      pcVar3 = param_2;
      pcVar4 = "L";
      do {
        if (lVar2 == 0) break;
        lVar2 = lVar2 + -1;
        bVar5 = *pcVar3 == *pcVar4;
        pcVar3 = pcVar3 + 1;
        pcVar4 = pcVar4 + 1;
      } while (bVar5);
      if (bVar5) {
        uVar1 = FUN_14011a9d0(param_1 + 0x18,param_3,param_4);
      }
      else {
        lVar2 = 2;
        pcVar3 = param_2;
        pcVar4 = "O";
        do {
          if (lVar2 == 0) break;
          lVar2 = lVar2 + -1;
          bVar5 = *pcVar3 == *pcVar4;
          pcVar3 = pcVar3 + 1;
          pcVar4 = pcVar4 + 1;
        } while (bVar5);
        if (bVar5) {
          uVar1 = FUN_14011a9f0(param_1 + 0x18,param_3,param_4);
        }
        else {
          lVar2 = 3;
          pcVar3 = param_2;
          pcVar4 = "OU";
          do {
            if (lVar2 == 0) break;
            lVar2 = lVar2 + -1;
            bVar5 = *pcVar3 == *pcVar4;
            pcVar3 = pcVar3 + 1;
            pcVar4 = pcVar4 + 1;
          } while (bVar5);
          if (bVar5) {
            uVar1 = FUN_14011aa10(param_1 + 0x18,param_3,param_4);
          }
          else {
            lVar2 = 2;
            pcVar3 = param_2;
            pcVar4 = "S";
            do {
              if (lVar2 == 0) break;
              lVar2 = lVar2 + -1;
              bVar5 = *pcVar3 == *pcVar4;
              pcVar3 = pcVar3 + 1;
              pcVar4 = pcVar4 + 1;
            } while (bVar5);
            if (bVar5) {
              uVar1 = FUN_14011a9b0(param_1 + 0x18,param_3,param_4);
            }
            else {
              lVar2 = 2;
              pcVar3 = param_2;
              pcVar4 = "E";
              do {
                if (lVar2 == 0) break;
                lVar2 = lVar2 + -1;
                bVar5 = *pcVar3 == *pcVar4;
                pcVar3 = pcVar3 + 1;
                pcVar4 = pcVar4 + 1;
              } while (bVar5);
              if (bVar5) {
                uVar1 = FUN_14011aa50(param_1 + 0x18,param_3,param_4);
              }
              else {
                (**(code **)(*param_4 + 0x28))(param_4,"Unrecognized certificate issuer part");
                uVar1 = (**(code **)(*param_4 + 0x58))(param_4,&DAT_14024442c,param_2);
                uVar1 = uVar1 & 0xffffffffffffff00;
              }
            }
          }
        }
      }
    }
  }
  return uVar1;
}



void FUN_1400ecf20(longlong param_1)

{
  FUN_140119c40(param_1 + 0x18);
  return;
}



bool FUN_1400ecf30(longlong param_1,undefined8 param_2)

{
  int iVar1;
  
  FUN_1400b8b30(param_2);
  FUN_140119830(param_1 + 0x18,param_2);
  iVar1 = FUN_1400b8b80(param_2);
  return iVar1 != 0;
}



void FUN_1400ecf70(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_1400b8b30(param_2);
  FUN_14011a8d0(param_1 + 0x18,param_2,param_3);
  return;
}



undefined8
FUN_1400ecfb0(longlong param_1,undefined8 param_2,undefined8 param_3,char param_4,longlong *param_5)

{
  char cVar1;
  int iVar2;
  undefined8 uVar3;
  char *pcVar4;
  
  iVar2 = FUN_1400b8b80(param_1 + 0x218);
  if (iVar2 == 0) {
    FUN_1400ec990(param_1,param_5);
    if (*(longlong *)(param_1 + 0x10) != 0) {
      pcVar4 = "Getting private key for key exchange (i.e. encryption)";
      if (param_4 == '\0') {
        pcVar4 = "Getting private key for signing";
      }
      (**(code **)(*param_5 + 0x30))(param_5,pcVar4);
      *(char *)(*(longlong *)(param_1 + 0x10) + 0x38c) = param_4;
      cVar1 = FUN_140111330(*(undefined8 *)(param_1 + 0x10),param_2,param_5);
      if (cVar1 != '\0') {
        uVar3 = FUN_140110b20(*(undefined8 *)(param_1 + 0x10),0,param_1 + 0x218,param_3,param_5);
        return uVar3;
      }
    }
    uVar3 = 0;
  }
  else {
    uVar3 = 1;
  }
  return uVar3;
}



void * FUN_1400ed080(void *param_1,uint param_2)

{
  FUN_1400ec910();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_1400ed0b0(longlong param_1)

{
  FUN_1400ec990();
  return *(undefined8 *)(param_1 + 0x10);
}



undefined8 * FUN_1400ed0d0(longlong param_1,undefined1 param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined8 *puVar4;
  undefined8 uVar5;
  void *local_res8;
  undefined1 local_res20 [8];
  undefined1 local_40 [40];
  
  if (param_1 != 0) {
    local_res8 = operator_new(0x248);
    if (local_res8 == (void *)0x0) {
      puVar4 = (undefined8 *)0x0;
    }
    else {
      puVar4 = (undefined8 *)FUN_1400ec8b0(local_res8);
    }
    puVar4[2] = param_1;
    FUN_1400b8c40(local_40);
    cVar1 = FUN_14010ffc0(param_1,local_40,param_3);
    if ((cVar1 == '\0') || (cVar1 = FUN_140119860(puVar4 + 3,local_40,param_3,0), cVar1 == '\0')) {
      (**(code **)*puVar4)(puVar4,1);
      puVar4 = (undefined8 *)0x0;
    }
    else {
      FUN_1400b8b30(local_40);
      FUN_1400bebf0(local_res20);
      local_res8 = (void *)((ulonglong)local_res8 & 0xffffffffffffff00);
      FUN_140110b20(param_1,param_2,local_40,&local_res8,param_3);
      iVar2 = FUN_1400b8b80(local_40);
      if (iVar2 == 0) {
        *(undefined1 *)(puVar4 + 0x48) = local_res8._0_1_;
      }
      else {
        uVar3 = FUN_1400b8b80(local_40);
        uVar5 = FUN_1400b8b90(local_40);
        FUN_1400eca80(puVar4,uVar5,uVar3);
      }
      FUN_1400bec20(local_res20);
    }
    FUN_1400b92d0(local_40);
    return puVar4;
  }
  return (undefined8 *)0x0;
}



undefined8 FUN_1400ed230(longlong param_1,undefined1 param_2,longlong *param_3,undefined8 param_4)

{
  void *pvVar1;
  undefined8 uVar2;
  
  if (param_1 == 0) {
    uVar2 = 0;
  }
  else {
    (**(code **)(*param_3 + 0x48))(param_3,"createCertFromMsContext",1,param_4,0xfffffffffffffffe);
    pvVar1 = operator_new(0x390);
    uVar2 = 0;
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1401114e0(pvVar1,param_1,param_3);
    }
    uVar2 = FUN_1400ed0d0(uVar2,param_2,param_3);
    (**(code **)(*param_3 + 0x50))(param_3);
  }
  return uVar2;
}



char FUN_1400ed2c0(longlong param_1,undefined8 param_2,undefined1 *param_3,undefined1 param_4,
                  longlong *param_5)

{
  int iVar1;
  char cVar2;
  undefined1 local_e8 [224];
  
  FUN_1400d3540(local_e8);
  *param_3 = 0;
  FUN_1400b8b30(param_2);
  FUN_1400b9e90(param_2,param_1 + 0x218);
  iVar1 = FUN_1400b8b80(param_1 + 0x218);
  cVar2 = iVar1 != 0;
  if (!(bool)cVar2) {
    (**(code **)(*param_5 + 0x30))(param_5,"Getting private key via Crypto API...");
    cVar2 = FUN_1400ecfb0(param_1,local_e8,param_3,param_4,param_5);
    if (cVar2 == '\0') {
      *(undefined1 *)(param_1 + 0x240) = *param_3;
    }
  }
  FUN_1400d3480(local_e8);
  return cVar2;
}



void FUN_1400ed3a0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  
  cVar1 = FUN_1400ed2c0();
  if (cVar1 == '\0') {
    FUN_1400ed2c0(param_1,param_2,param_3,1,param_4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

bool FUN_1400ed400(undefined8 param_1,undefined8 param_2,undefined8 param_3,longlong *param_4)

{
  DWORD cbData;
  BOOL BVar1;
  HCRYPTMSG hCryptMsg;
  BYTE *pbData;
  undefined8 *pvData;
  PCERT_INFO pCertId;
  undefined8 *puVar2;
  HCERTSTORE hCertStore;
  undefined8 *pvData_00;
  void *pvData_01;
  char *pcVar3;
  undefined1 auStackY_b8 [32];
  DWORD local_88;
  int local_84;
  undefined8 *local_80;
  PCCERT_CONTEXT local_78;
  HCRYPTPROV local_70;
  undefined8 local_68;
  undefined4 local_60 [2];
  HCRYPTPROV local_58;
  undefined4 local_50;
  undefined4 local_4c;
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStackY_b8;
  local_68 = param_2;
  FUN_1400b8b30(param_2);
  hCryptMsg = CryptMsgOpenToDecode(0x10001,0,0,0,(PCERT_INFO)0x0,(PCMSG_STREAM_INFO)0x0);
  if (hCryptMsg == (HCRYPTMSG)0x0) {
    FUN_1400cf640(param_4);
    (**(code **)(*param_4 + 0x28))(param_4,"CryptMsgOpenToDecode failed.");
    return false;
  }
  cbData = FUN_1400b8b80(param_1);
  pbData = (BYTE *)FUN_1400b8b90(param_1);
  BVar1 = CryptMsgUpdate(hCryptMsg,pbData,cbData,1);
  if (BVar1 == 0) {
    CryptMsgClose(hCryptMsg);
    FUN_1400cf640(param_4);
    (**(code **)(*param_4 + 0x28))(param_4,"CryptMsgOpenToDecode failed.");
    return false;
  }
  local_88 = 4;
  local_84 = 0;
  BVar1 = CryptMsgGetParam(hCryptMsg,1,0,&local_84,&local_88);
  if (BVar1 == 0) {
    CryptMsgClose(hCryptMsg);
    FUN_1400cf640(param_4);
    (**(code **)(*param_4 + 0x28))(param_4,"CryptMsgGetParam CMSG_TYPE_PARAM failed.");
    return false;
  }
  if (local_84 != 3) {
    CryptMsgClose(hCryptMsg);
    (**(code **)(*param_4 + 0x28))(param_4,"Not a PKCS7 enveloped message.");
    return false;
  }
  local_88 = 0;
  BVar1 = CryptMsgGetParam(hCryptMsg,4,0,(void *)0x0,&local_88);
  if (BVar1 == 0) {
    CryptMsgClose(hCryptMsg);
    FUN_1400cf640(param_4);
    (**(code **)(*param_4 + 0x28))(param_4,"CryptMsgGetParam CMSG_INNER_CONTENT_TYPE_PARAM failed.")
    ;
    return false;
  }
  if (local_88 == 0) {
    CryptMsgClose(hCryptMsg);
    (**(code **)(*param_4 + 0x30))(param_4,"Inner content is 0-length.");
    return true;
  }
  pvData = operator_new((ulonglong)local_88);
  if (pvData == (undefined8 *)0x0) {
    CryptMsgClose(hCryptMsg);
    (**(code **)(*param_4 + 0x28))(param_4,"Failed to allocated memory for inner content.");
    return false;
  }
  BVar1 = CryptMsgGetParam(hCryptMsg,4,0,pvData,&local_88);
  if (BVar1 == 0) {
    CryptMsgClose(hCryptMsg);
    FUN_1400cf640(param_4);
    pcVar3 = "CryptMsgGetParam CMSG_INNER_CONTENT_TYPE_PARAM(2) failed.";
LAB_1400ed661:
    (**(code **)(*param_4 + 0x28))(param_4,pcVar3);
    operator_delete(pvData);
    return false;
  }
  local_88 = 0;
  BVar1 = CryptMsgGetParam(hCryptMsg,0x13,0,(void *)0x0,&local_88);
  if (BVar1 == 0) {
    CryptMsgClose(hCryptMsg);
    FUN_1400cf640(param_4);
    pcVar3 = "CryptMsgGetParam CMSG_RECIPIENT_INFO_PARAM failed.";
    goto LAB_1400ed661;
  }
  FUN_1400cf520(param_4,"CertRecipientInfoSize",local_88);
  pCertId = operator_new((ulonglong)local_88);
  if (pCertId == (PCERT_INFO)0x0) {
    CryptMsgClose(hCryptMsg);
    operator_delete(pvData);
    (**(code **)(*param_4 + 0x28))(param_4,"Failed to allocated memory for X509 cert.");
    return false;
  }
  BVar1 = CryptMsgGetParam(hCryptMsg,0x13,0,pCertId,&local_88);
  if (BVar1 == 0) {
    CryptMsgClose(hCryptMsg);
    FUN_1400cf640(param_4);
    (**(code **)(*param_4 + 0x28))(param_4,"CryptMsgGetParam CMSG_RECIPIENT_INFO_PARAM(2) failed.");
    operator_delete(pCertId);
    operator_delete(pvData);
    return false;
  }
  puVar2 = (undefined8 *)FUN_1400ee800(1,param_4);
  if (puVar2 == (undefined8 *)0x0) {
    CryptMsgClose(hCryptMsg);
    (**(code **)(*param_4 + 0x28))(param_4,"Failed to open current-user cert store.");
    operator_delete(pCertId);
    goto LAB_1400eda1b;
  }
  hCertStore = (HCERTSTORE)FUN_140139d60(puVar2);
  local_78 = CertGetSubjectCertificateFromStore(hCertStore,0x10001,pCertId);
  if (local_78 == (PCCERT_CONTEXT)0x0) {
    CryptMsgClose(hCryptMsg);
    FUN_1400cf640(param_4);
    (**(code **)(*param_4 + 0x28))(param_4,"CertGetSubjectCertificateFromStore failed.");
    operator_delete(pCertId);
    operator_delete(pvData);
    (**(code **)*puVar2)(puVar2,1);
    return false;
  }
  local_88 = 0;
  BVar1 = CertGetCertificateContextProperty(local_78,2,(void *)0x0,&local_88);
  pvData_00 = (undefined8 *)0x0;
  local_80 = (undefined8 *)0x0;
  if (BVar1 == 0) {
LAB_1400ed9cd:
    FUN_1400cf640(param_4);
    (**(code **)(*param_4 + 0x28))(param_4,"CertGetCertificateContextProperty failed.");
    CryptMsgClose(hCryptMsg);
    operator_delete(pCertId);
    operator_delete(pvData);
    CertFreeCertificateContext(local_78);
  }
  else {
    if ((local_88 != 0) &&
       (pvData_00 = operator_new((ulonglong)local_88), local_80 = pvData_00,
       pvData_00 != (undefined8 *)0x0)) {
      BVar1 = CertGetCertificateContextProperty(local_78,2,pvData_00,&local_88);
    }
    if ((BVar1 == 0) || (pvData_00 == (undefined8 *)0x0)) goto LAB_1400ed9cd;
    CertFreeCertificateContext(local_78);
    local_70 = 0;
    BVar1 = CryptAcquireContextW
                      (&local_70,(LPCWSTR)*pvData_00,(LPCWSTR)pvData_00[1],*(DWORD *)(pvData_00 + 2)
                       ,*(DWORD *)((longlong)pvData_00 + 0x14));
    if (BVar1 == 0) {
      FUN_1400cf640(param_4);
      pcVar3 = "CryptAcquireContext failed.";
    }
    else {
      local_60[0] = 0x18;
      local_50 = *(undefined4 *)(pvData_00 + 5);
      local_4c = 0;
      local_58 = local_70;
      BVar1 = CryptMsgControl(hCryptMsg,0,2,local_60);
      if (BVar1 != 0) {
        local_88 = 0;
        BVar1 = CryptMsgGetParam(hCryptMsg,2,0,(void *)0x0,&local_88);
        if (BVar1 != 0) {
          pvData_01 = operator_new((ulonglong)local_88);
          if ((local_88 != 0) && (pvData_01 != (void *)0x0)) {
            BVar1 = CryptMsgGetParam(hCryptMsg,2,0,pvData_01,&local_88);
          }
          if ((BVar1 == 0) || (local_88 == 0)) {
LAB_1400ed96a:
            if (pvData_01 != (void *)0x0) {
              operator_delete(pvData_01);
            }
          }
          else if (pvData_01 != (void *)0x0) {
            FUN_1400b97e0(local_68,pvData_01);
            goto LAB_1400ed96a;
          }
          if (BVar1 != 0) goto LAB_1400ed995;
        }
        FUN_1400cf640(param_4);
        (**(code **)(*param_4 + 0x28))(param_4,"CryptMsgControl failed.");
LAB_1400ed995:
        CryptMsgClose(hCryptMsg);
        operator_delete(pCertId);
        operator_delete(pvData);
        (**(code **)*puVar2)(puVar2,1);
        operator_delete(local_80);
        return BVar1 != 0;
      }
      FUN_1400cf640(param_4);
      pcVar3 = "CryptMsgControl failed.";
    }
    (**(code **)(*param_4 + 0x28))(param_4,pcVar3);
    CryptMsgClose(hCryptMsg);
    operator_delete(pCertId);
    operator_delete(pvData);
  }
  (**(code **)*puVar2)(puVar2,1);
  pvData = local_80;
LAB_1400eda1b:
  operator_delete(pvData);
  return false;
}



undefined8
FUN_1400eda60(undefined8 param_1,undefined8 param_2,undefined8 *param_3,longlong *param_4)

{
  undefined1 auVar1 [16];
  char cVar2;
  DWORD DVar3;
  BOOL BVar4;
  HCERTSTORE hCertStore;
  HCERTSTORE hCertStore_00;
  __uint64 _Var5;
  HCERTSTORE *ppvVar6;
  BYTE *pBVar7;
  BYTE *pbEncryptedBlob;
  undefined8 uVar8;
  uint uVar9;
  PCCERT_CONTEXT *ppXchgCert;
  DWORD local_res18 [2];
  PCCERT_CONTEXT local_68;
  undefined1 local_60 [8];
  undefined8 local_58;
  _CRYPT_DECRYPT_MESSAGE_PARA local_50;
  
  local_58 = 0xfffffffffffffffe;
  FUN_1400b8b30(param_2);
  if (param_3 != (undefined8 *)0x0) {
    *param_3 = 0;
  }
  hCertStore = CertOpenStore((LPCSTR)0xa,0,0,0x18000,&DAT_1402448c4);
  if (hCertStore == (HCERTSTORE)0x0) {
    FUN_1400cf640(param_4);
  }
  hCertStore_00 = CertOpenStore((LPCSTR)0xa,0,0,0x28000,&DAT_1402448c4);
  if (hCertStore_00 == (HCERTSTORE)0x0) {
    FUN_1400cf640(param_4);
  }
  if ((hCertStore == (HCERTSTORE)0x0) && (hCertStore_00 == (HCERTSTORE)0x0)) {
    FUN_1400cf640(param_4);
    (**(code **)(*param_4 + 0x28))(param_4,"Failed to open Windows certificate stores.");
    return 0;
  }
  uVar9 = (uint)(hCertStore != (HCERTSTORE)0x0);
  if (hCertStore_00 != (HCERTSTORE)0x0) {
    uVar9 = uVar9 + 1;
  }
  auVar1._8_8_ = 0;
  auVar1._0_8_ = (longlong)(int)uVar9;
  _Var5 = SUB168(ZEXT816(8) * auVar1,0);
  if (SUB168(ZEXT816(8) * auVar1,8) != 0) {
    _Var5 = 0xffffffffffffffff;
  }
  ppvVar6 = operator_new(_Var5);
  if (hCertStore != (HCERTSTORE)0x0) {
    *ppvVar6 = hCertStore;
  }
  if (hCertStore_00 != (HCERTSTORE)0x0) {
    ppvVar6[(int)(uint)(hCertStore != (HCERTSTORE)0x0)] = hCertStore_00;
  }
  local_50.cbSize = 0x18;
  local_50.dwMsgAndCertEncodingType = 0x10001;
  local_50._12_4_ = 0;
  local_50.cCertStore = uVar9;
  local_res18[0] = 0;
  local_50.rghCertStore = ppvVar6;
  DVar3 = FUN_1400b8b80(param_1);
  pBVar7 = (BYTE *)FUN_1400b8b90(param_1);
  BVar4 = CryptDecryptMessage(&local_50,pBVar7,DVar3,(BYTE *)0x0,local_res18,(PCCERT_CONTEXT *)0x0);
  if (BVar4 == 0) {
    FUN_1400cf640(param_4);
    (**(code **)(*param_4 + 0x28))(param_4,"cryptoAPI decrypt failed (1)");
    operator_delete(ppvVar6);
    if (hCertStore != (HCERTSTORE)0x0) {
      CertCloseStore(hCertStore,0);
    }
    if (hCertStore_00 != (HCERTSTORE)0x0) {
      CertCloseStore(hCertStore_00,0);
    }
  }
  else {
    cVar2 = FUN_1400ba520(param_2,local_res18[0] + 0x20);
    if (cVar2 == '\0') {
      FUN_1400cf7b0(param_4,0x428,local_res18[0] + 0x20);
      operator_delete(ppvVar6);
      if (hCertStore != (HCERTSTORE)0x0) {
        CertCloseStore(hCertStore,0);
      }
      if (hCertStore_00 != (HCERTSTORE)0x0) {
        CertCloseStore(hCertStore_00,0);
        return 0;
      }
    }
    else {
      pBVar7 = (BYTE *)FUN_1400b8b90(param_2);
      local_68 = (PCCERT_CONTEXT)0x0;
      ppXchgCert = &local_68;
      if (param_3 == (undefined8 *)0x0) {
        ppXchgCert = (PCCERT_CONTEXT *)0x0;
      }
      DVar3 = FUN_1400b8b80(param_1);
      pbEncryptedBlob = (BYTE *)FUN_1400b8b90(param_1);
      BVar4 = CryptDecryptMessage(&local_50,pbEncryptedBlob,DVar3,pBVar7,local_res18,ppXchgCert);
      if (BVar4 != 0) {
        FUN_1400b8c10(param_2,local_res18[0]);
        if ((local_68 != (PCCERT_CONTEXT)0x0) && (param_3 != (undefined8 *)0x0)) {
          FUN_1400bebf0(local_60);
          uVar8 = FUN_1400ed230(local_68,0,local_60);
          *param_3 = uVar8;
          FUN_1400bec20(local_60);
        }
        if (hCertStore != (HCERTSTORE)0x0) {
          CertCloseStore(hCertStore,0);
        }
        if (hCertStore_00 != (HCERTSTORE)0x0) {
          CertCloseStore(hCertStore_00,0);
        }
        operator_delete(ppvVar6);
        return 1;
      }
      FUN_1400cf640(param_4);
      (**(code **)(*param_4 + 0x28))(param_4,"cryptoAPI decrypt failed (2)");
      operator_delete(ppvVar6);
      if (hCertStore != (HCERTSTORE)0x0) {
        CertCloseStore(hCertStore,0);
      }
      if (hCertStore_00 != (HCERTSTORE)0x0) {
        CertCloseStore(hCertStore_00,0);
        return 0;
      }
    }
  }
  return 0;
}



char FUN_1400edde0(undefined8 param_1,undefined8 param_2,undefined8 param_3,longlong *param_4)

{
  char cVar1;
  
  (**(code **)(*param_4 + 0x48))(param_4,"msDecrypt1",1);
  cVar1 = FUN_1400eda60(param_1,param_2,param_3,param_4);
  if (cVar1 == '\0') {
    FUN_1400b8b30(param_2);
    (**(code **)(*param_4 + 0x48))(param_4,"LowLevelMsCryptoAlternative",1);
    cVar1 = FUN_1400ed400(param_1,param_2,param_3,param_4);
    (**(code **)(*param_4 + 0x50))(param_4);
  }
  (**(code **)(*param_4 + 0x50))(param_4);
  return cVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1400edea0(longlong param_1,BYTE *param_2,DWORD param_3,undefined8 param_4,
                       undefined8 param_5,longlong *param_6)

{
  undefined1 auVar1 [16];
  DWORD cbToBeEncrypted;
  char cVar2;
  char cVar3;
  DWORD cRecipientCert;
  undefined4 uVar4;
  BOOL BVar5;
  longlong lVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  undefined8 *puVar9;
  __uint64 _Var10;
  PCCERT_CONTEXT *ppCVar11;
  longlong lVar12;
  PCCERT_CONTEXT pCVar13;
  undefined8 *puVar14;
  ulonglong uVar15;
  LPSTR pCVar16;
  BYTE *pBVar17;
  char *pcVar18;
  int iVar19;
  undefined4 *puVar20;
  undefined1 auStackY_438 [32];
  DWORD local_3f8 [2];
  undefined8 *local_3f0;
  DWORD local_3e8;
  PCCERT_CONTEXT *local_3e0;
  undefined4 local_3d8;
  undefined4 local_3d4;
  BYTE *local_3d0;
  HCRYPTPROV_LEGACY local_3c8;
  _CRYPT_ENCRYPT_MESSAGE_PARA local_3c0;
  undefined8 local_388;
  undefined8 local_380;
  DWORD local_378;
  undefined4 uStack_374;
  undefined4 local_368 [2];
  undefined8 *local_360;
  undefined8 local_358;
  undefined1 local_350 [56];
  undefined1 local_318 [160];
  undefined8 local_278;
  undefined8 local_270;
  undefined8 local_268;
  undefined8 local_260;
  BYTE local_258 [512];
  ulonglong local_58;
  
  local_358 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStackY_438;
  local_3e8 = param_3;
  local_3d0 = param_2;
  local_388 = param_4;
  if ((param_2 == (BYTE *)0x0) || (param_3 == 0)) {
    pcVar18 = "Nothing to encrypt, data size is zero";
LAB_1400ee4a0:
    uVar15 = (**(code **)(*param_6 + 0x28))(param_6,pcVar18);
    goto LAB_1400ee4a9;
  }
  cRecipientCert = FUN_140139d70(param_5);
  iVar19 = 0;
  if (0 < (int)cRecipientCert) {
    do {
      lVar6 = FUN_1400d0aa0(param_5,iVar19);
      if (lVar6 == 0) {
        pcVar18 = "Internal error with certificate array.";
        goto LAB_1400ee4a0;
      }
      iVar19 = iVar19 + 1;
    } while (iVar19 < (int)cRecipientCert);
  }
  iVar19 = FUN_1400bbb10(param_1 + 8);
  if (iVar19 == 0) {
LAB_1400edfcc:
    puVar9 = (undefined8 *)FUN_140132260(0,1,param_6);
    uVar15 = 0;
    if (puVar9 == (undefined8 *)0x0) goto LAB_1400ee4a9;
  }
  else {
    lVar6 = *param_6;
    uVar7 = FUN_1400b8b90(param_1 + 8);
    (**(code **)(lVar6 + 0x58))(param_6,"csp_provider",uVar7);
    lVar6 = *param_6;
    uVar7 = FUN_1400b8b90(param_1 + 0x38);
    (**(code **)(lVar6 + 0x58))(param_6,"csp_keyContainer",uVar7);
    uVar7 = FUN_1400b8b90(param_1 + 0x38);
    uVar8 = FUN_1400b8b90(param_1 + 8);
    puVar9 = (undefined8 *)FUN_1401328c0(uVar8,uVar7,1,param_6);
    if (puVar9 == (undefined8 *)0x0) {
      local_3f0 = puVar9;
      (**(code **)(*param_6 + 0x28))(param_6,"(warning) Unable to acquire requested CSP.");
      goto LAB_1400edfcc;
    }
  }
  local_3f0 = puVar9;
  local_3c8 = FUN_1401320e0(puVar9);
  FUN_1400cf520(param_6,"numCerts",cRecipientCert);
  if (cRecipientCert != 0) {
    (**(code **)(*param_6 + 0x48))(param_6,"msEncryptCerts",1);
  }
  auVar1._8_8_ = 0;
  auVar1._0_8_ = (longlong)(int)cRecipientCert;
  _Var10 = SUB168(ZEXT816(8) * auVar1,0);
  if (SUB168(ZEXT816(8) * auVar1,8) != 0) {
    _Var10 = 0xffffffffffffffff;
  }
  ppCVar11 = operator_new(_Var10);
  iVar19 = 0;
  lVar6 = 0;
  local_3e0 = ppCVar11;
  if (0 < (int)cRecipientCert) {
    do {
      lVar12 = FUN_1400d0aa0(param_5,iVar19);
      if (lVar12 != 0) {
        uVar7 = FUN_1400ed0b0(lVar12,param_6);
        pCVar13 = (PCCERT_CONTEXT)FUN_1401320e0(uVar7);
        ppCVar11[lVar6] = pCVar13;
        FUN_1400b6fd0(local_318);
        FUN_140110ac0(uVar7,local_318,param_6);
        lVar12 = *param_6;
        uVar7 = FUN_1400b7ce0(local_318);
        (**(code **)(lVar12 + 0x58))(param_6,"cert_subject",uVar7);
        FUN_1400b7090(local_318);
      }
      iVar19 = iVar19 + 1;
      lVar6 = lVar6 + 1;
      puVar9 = local_3f0;
    } while (lVar6 < (int)cRecipientCert);
  }
  if (cRecipientCert != 0) {
    (**(code **)(*param_6 + 0x50))(param_6);
  }
  local_278 = 0;
  local_270 = 0;
  local_268 = 0;
  local_260 = 0;
  pBVar17 = (BYTE *)0x0;
  local_380 = 0;
  local_378 = 0;
  uStack_374 = 0;
  puVar14 = (undefined8 *)FUN_140132730(puVar9);
  if (puVar14 != (undefined8 *)0x0) {
    FUN_1400bcc20(local_350);
    cVar2 = FUN_1400d36c0(puVar14,local_350);
    if (cVar2 == '\0') {
      (**(code **)(*param_6 + 0x28))
                (param_6,
                 "Unsupported encryption algorithm.  Please contact Chilkat Software for support.");
    }
    lVar6 = *param_6;
    uVar7 = FUN_1400d35d0(puVar14);
    (**(code **)(lVar6 + 0x58))(param_6,"alg_name",uVar7);
    uVar4 = FUN_1400d35c0(puVar14);
    FUN_1400cf520(param_6,"alg_bits",uVar4);
    iVar19 = FUN_1400d35c0(puVar14);
    (**(code **)*puVar14)(puVar14,1);
    pCVar16 = (LPSTR)FUN_1400b8b90(local_350);
    cVar2 = FUN_1400bdf70(local_350,"1.2.840.113549.3.4");
    if (cVar2 != '\0') {
      (**(code **)(*param_6 + 0x30))(param_6,"Need ARC4 Aux Info...");
      local_368[0] = 0xb;
      local_360 = &local_268;
      local_3f0 = (undefined8 *)CONCAT44(local_3f0._4_4_,500);
      CryptEncodeObject(0x10001,(LPCSTR)0x19,local_368,local_258,(DWORD *)&local_3f0);
      pBVar17 = local_258;
      local_378 = (DWORD)local_3f0;
    }
    cVar3 = FUN_1400bdf70(local_350,"1.2.840.113549.3.2");
    if (cVar3 != '\0') {
      (**(code **)(*param_6 + 0x30))(param_6,"Adding RC2CBC parameter (1)");
      FUN_1400cf520(param_6,"rc2_numBits",iVar19);
      if (iVar19 == 0x80) {
        uVar4 = 0x3a;
      }
      else if (iVar19 == 0x40) {
        uVar4 = 0x78;
      }
      else {
        uVar4 = 0xa0;
        if (iVar19 == 0x38) {
          uVar4 = 0x34;
        }
      }
      local_278 = CONCAT44(1,uVar4);
      local_270 = 0;
      local_3f0 = (undefined8 *)CONCAT44(local_3f0._4_4_,500);
      BVar5 = CryptEncodeObject(0x10001,"1.2.840.113549.3.2",&local_278,local_258,
                                (DWORD *)&local_3f0);
      pBVar17 = local_258;
      local_378 = (DWORD)local_3f0;
      if (BVar5 == 0) {
        FUN_1400cf640(param_6);
        (**(code **)(*param_6 + 0x28))(param_6,"CryptEncodeObject failed.");
      }
    }
    (**(code **)(*param_6 + 0x58))(param_6,"encryptOid",pCVar16);
    puVar20 = (undefined4 *)0x0;
    local_3c0.pvEncryptionAuxInfo = (void *)0x0;
    local_3c0.dwFlags = 0;
    local_3c0.dwInnerContentType = 0;
    local_3c0.cbSize = 0x38;
    local_3c0.dwMsgEncodingType = 0x10001;
    local_3c0.hCryptProv = local_3c8;
    local_3c0.ContentEncryptionAlgorithm.Parameters.cbData = local_378;
    local_3c0.ContentEncryptionAlgorithm.Parameters._4_4_ = uStack_374;
    local_3d8 = 8;
    local_3d4 = 0x58;
    local_3c0.ContentEncryptionAlgorithm.pszObjId = pCVar16;
    local_3c0.ContentEncryptionAlgorithm.Parameters.pbData = pBVar17;
    if (cVar2 != '\0') {
      (**(code **)(*param_6 + 0x30))(param_6,"Using ARC4 aux info...");
      puVar20 = &local_3d8;
    }
    ppCVar11 = local_3e0;
    cbToBeEncrypted = local_3e8;
    local_3c0.pvEncryptionAuxInfo = puVar20;
    BVar5 = CryptEncryptMessage(&local_3c0,cRecipientCert,local_3e0,local_3d0,local_3e8,(BYTE *)0x0,
                                local_3f8);
    if (BVar5 == 0) {
      FUN_1400cf640();
      iVar19 = 0;
    }
    else {
      FUN_1400cf520(param_6,"expectedEncryptedSize",local_3f8[0]);
      pBVar17 = operator_new((ulonglong)(local_3f8[0] + 4));
      if (pBVar17 == (BYTE *)0x0) {
        iVar19 = 0;
      }
      else {
        iVar19 = CryptEncryptMessage(&local_3c0,cRecipientCert,ppCVar11,local_3d0,cbToBeEncrypted,
                                     pBVar17,local_3f8);
        if (iVar19 == 0) {
          FUN_1400cf640(param_6);
          operator_delete(pBVar17);
        }
        else {
          FUN_1400ba310(local_388,pBVar17,local_3f8[0]);
        }
      }
    }
    operator_delete(ppCVar11);
    (**(code **)*puVar9)(puVar9,1);
    FUN_1400bceb0(local_350);
    return (ulonglong)(iVar19 != 0);
  }
  (**(code **)(*param_6 + 0x28))(param_6,"No encryption algorithms available.");
  operator_delete(local_3e0);
  uVar15 = (**(code **)*puVar9)(puVar9,1);
LAB_1400ee4a9:
  return uVar15 & 0xffffffffffffff00;
}



undefined1
FUN_1400ee4d0(undefined8 param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,longlong *param_6)

{
  undefined1 uVar1;
  
  (**(code **)(*param_6 + 0x48))(param_6,"msEncrypt",1);
  uVar1 = FUN_1400edea0(param_1,param_2,param_3,param_4,param_5,param_6);
  (**(code **)(*param_6 + 0x50))(param_6);
  return uVar1;
}



undefined8 * FUN_1400ee560(undefined8 *param_1,undefined8 param_2,undefined1 param_3)

{
  FUN_1400d0eb0();
  *param_1 = CertificateStore::vftable;
  param_1[2] = param_2;
  *(undefined1 *)(param_1 + 3) = 0;
  FUN_1400bcc20(param_1 + 4);
  param_1[10] = 0;
  *(undefined1 *)(param_1 + 0xb) = 0;
  FUN_1400bcc20(param_1 + 0xc);
  FUN_1400bcc20(param_1 + 0x12);
  *(undefined1 *)(param_1 + 0x18) = 0;
  *(undefined1 *)((longlong)param_1 + 0xc1) = param_3;
  FUN_140132920(param_1 + 0x19);
  return param_1;
}



void FUN_1400ee600(longlong param_1)

{
  int iVar1;
  PCCERT_CONTEXT pCertContext;
  PCCERT_CONTEXT pCVar2;
  undefined8 *puVar3;
  undefined8 uVar4;
  undefined1 local_res8 [8];
  void *local_res10;
  undefined1 local_50 [56];
  
  FUN_1400bebf0(local_res8);
  if (*(char *)(param_1 + 0xc1) != '\0') {
    if ((*(HCERTSTORE *)(param_1 + 0x10) != (HCERTSTORE)0x0) &&
       (pCertContext = CertEnumCertificatesInStore
                                 (*(HCERTSTORE *)(param_1 + 0x10),(PCCERT_CONTEXT)0x0),
       pCertContext != (PCCERT_CONTEXT)0x0)) {
      do {
        pCVar2 = CertDuplicateCertificateContext(pCertContext);
        local_res10 = operator_new(0x390);
        puVar3 = (undefined8 *)0x0;
        if (local_res10 != (void *)0x0) {
          puVar3 = (undefined8 *)FUN_1401114e0(local_res10,pCVar2,local_res8);
        }
        FUN_1400bcc20(local_50);
        FUN_1401110f0(puVar3,local_50,local_res8);
        iVar1 = FUN_1400bbb10(local_50);
        if (iVar1 != 0) {
          local_res10 = (void *)0x0;
          uVar4 = FUN_1400b8b90(local_50);
          FUN_1400ce990(&local_res10,uVar4,"Microsoft Enhanced Cryptographic Provider v1.0",1,0x10);
        }
        if (puVar3 != (undefined8 *)0x0) {
          (**(code **)*puVar3)(puVar3,1);
        }
        FUN_1400bceb0(local_50);
        pCertContext = CertEnumCertificatesInStore(*(HCERTSTORE *)(param_1 + 0x10),pCertContext);
      } while (pCertContext != (PCCERT_CONTEXT)0x0);
    }
    *(undefined1 *)(param_1 + 0xc1) = 0;
  }
  FUN_1400bec20(local_res8);
  return;
}



void FUN_1400ee760(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  *param_1 = CertificateStore::vftable;
  FUN_1400ee600();
  if ((HCERTSTORE)param_1[2] != (HCERTSTORE)0x0) {
    CertCloseStore((HCERTSTORE)param_1[2],2);
  }
  param_1[2] = 0;
  puVar1 = (undefined8 *)param_1[10];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,uVar2);
    param_1[10] = 0;
  }
  FUN_140132960(param_1 + 0x19);
  FUN_1400bceb0(param_1 + 0x12);
  FUN_1400bceb0(param_1 + 0xc);
  FUN_1400bceb0(param_1 + 4);
  FUN_1400d0ee0(param_1);
  return;
}



longlong FUN_1400ee800(char param_1,longlong param_2)

{
  HCERTSTORE pvVar1;
  void *pvVar2;
  longlong lVar3;
  uint uVar4;
  
  lVar3 = 0;
  uVar4 = 0;
  if (param_1 != '\0') {
    uVar4 = 0x8000;
  }
  pvVar1 = CertOpenStore((LPCSTR)0xa,0,0,uVar4 | 0x10000,&DAT_1402448c4);
  if (pvVar1 == (HCERTSTORE)0x0) {
    if (param_2 != 0) {
      FUN_1400cf640(param_2);
    }
    lVar3 = 0;
  }
  else {
    pvVar2 = operator_new(0x110);
    if (pvVar2 != (void *)0x0) {
      lVar3 = FUN_1400ee560(pvVar2,pvVar1,0);
    }
    FUN_1400bdb00(lVar3 + 0x60,"[Current User Certificate Store]");
    *(undefined1 *)(lVar3 + 0x58) = 1;
    FUN_1400bdb00(lVar3 + 0x90,"HKEY_CURRENT_USER");
    FUN_1401329a0(lVar3 + 200);
  }
  return lVar3;
}



longlong FUN_1400ee8d0(char param_1,longlong param_2)

{
  HCERTSTORE pvVar1;
  void *pvVar2;
  longlong lVar3;
  uint uVar4;
  
  lVar3 = 0;
  uVar4 = 0;
  if (param_1 != '\0') {
    uVar4 = 0x8000;
  }
  pvVar1 = CertOpenStore((LPCSTR)0xa,0,0,uVar4 | 0x10000,&DAT_140244cb4);
  if (pvVar1 == (HCERTSTORE)0x0) {
    if (param_2 != 0) {
      FUN_1400cf640(param_2);
    }
    lVar3 = 0;
  }
  else {
    pvVar2 = operator_new(0x110);
    if (pvVar2 != (void *)0x0) {
      lVar3 = FUN_1400ee560(pvVar2,pvVar1,0);
    }
    FUN_1400bdb00(lVar3 + 0x60,"[CA Current User Certificate Store]");
    *(undefined1 *)(lVar3 + 0x58) = 1;
    FUN_1400bdb00(lVar3 + 0x90,"HKEY_CURRENT_USER");
    FUN_1401329a0(lVar3 + 200);
  }
  return lVar3;
}



longlong FUN_1400ee9a0(char param_1,longlong param_2)

{
  HCERTSTORE pvVar1;
  void *pvVar2;
  longlong lVar3;
  uint uVar4;
  
  lVar3 = 0;
  uVar4 = 0;
  if (param_1 != '\0') {
    uVar4 = 0x8000;
  }
  pvVar1 = CertOpenStore((LPCSTR)0xa,0,0,uVar4 | 0x20000,&DAT_140244cb4);
  if (pvVar1 == (HCERTSTORE)0x0) {
    if (param_2 != 0) {
      FUN_1400cf640(param_2);
    }
    lVar3 = 0;
  }
  else {
    pvVar2 = operator_new(0x110);
    if (pvVar2 != (void *)0x0) {
      lVar3 = FUN_1400ee560(pvVar2,pvVar1,0);
    }
    FUN_1400bdb00(lVar3 + 0x60,"[CA Local Machine Certificate Store]");
    *(undefined1 *)(lVar3 + 0x58) = 1;
    FUN_1400bdb00(lVar3 + 0x90,"HKEY_LOCAL_MACHINE");
    FUN_1401329c0(lVar3 + 200);
  }
  return lVar3;
}



longlong FUN_1400eea70(char param_1,longlong param_2)

{
  HCERTSTORE pvVar1;
  void *pvVar2;
  longlong lVar3;
  uint uVar4;
  
  lVar3 = 0;
  uVar4 = 0;
  if (param_1 != '\0') {
    uVar4 = 0x8000;
  }
  pvVar1 = CertOpenStore((LPCSTR)0xa,0,0,uVar4 | 0x20000,L"ROOT");
  if (pvVar1 == (HCERTSTORE)0x0) {
    if (param_2 != 0) {
      FUN_1400cf640(param_2);
    }
    lVar3 = 0;
  }
  else {
    pvVar2 = operator_new(0x110);
    if (pvVar2 != (void *)0x0) {
      lVar3 = FUN_1400ee560(pvVar2,pvVar1,0);
    }
    FUN_1400bdb00(lVar3 + 0x60,"[ROOT Local Machine Certificate Store]");
    *(undefined1 *)(lVar3 + 0x58) = 1;
    FUN_1400bdb00(lVar3 + 0x90,"HKEY_LOCAL_MACHINE");
    FUN_1401329c0(lVar3 + 200);
  }
  return lVar3;
}



longlong FUN_1400eeb40(char param_1,longlong param_2)

{
  HCERTSTORE pvVar1;
  void *pvVar2;
  longlong lVar3;
  uint uVar4;
  
  lVar3 = 0;
  uVar4 = 0;
  if (param_1 != '\0') {
    uVar4 = 0x8000;
  }
  pvVar1 = CertOpenStore((LPCSTR)0xa,0,0,uVar4 | 0x10000,L"ROOT");
  if (pvVar1 == (HCERTSTORE)0x0) {
    if (param_2 != 0) {
      FUN_1400cf640(param_2);
    }
    lVar3 = 0;
  }
  else {
    pvVar2 = operator_new(0x110);
    if (pvVar2 != (void *)0x0) {
      lVar3 = FUN_1400ee560(pvVar2,pvVar1,0);
    }
    FUN_1400bdb00(lVar3 + 0x60,"[ROOT Local Machine Certificate Store]");
    *(undefined1 *)(lVar3 + 0x58) = 1;
    FUN_1400bdb00(lVar3 + 0x90,"HKEY_LOCAL_MACHINE");
    FUN_1401329c0(lVar3 + 200);
  }
  return lVar3;
}



longlong FUN_1400eec10(char param_1,longlong param_2)

{
  HCERTSTORE pvVar1;
  void *pvVar2;
  longlong lVar3;
  uint uVar4;
  
  lVar3 = 0;
  uVar4 = 0;
  if (param_1 != '\0') {
    uVar4 = 0x8000;
  }
  pvVar1 = CertOpenStore((LPCSTR)0xa,0,0,uVar4 | 0x20000,&DAT_1402448c4);
  if (pvVar1 == (HCERTSTORE)0x0) {
    if (param_2 != 0) {
      FUN_1400cf640(param_2);
    }
    lVar3 = 0;
  }
  else {
    pvVar2 = operator_new(0x110);
    if (pvVar2 != (void *)0x0) {
      lVar3 = FUN_1400ee560(pvVar2,pvVar1,0);
    }
    FUN_1400bdb00(lVar3 + 0x60,"[Local Machine Certificate Store]");
    *(undefined1 *)(lVar3 + 0x58) = 1;
    FUN_1400bdb00(lVar3 + 0x90,"HKEY_LOCAL_MACHINE");
    FUN_1401329c0(lVar3 + 200);
  }
  return lVar3;
}



longlong FUN_1400eece0(undefined8 param_1,char param_2,longlong param_3)

{
  void *pvVar1;
  HCERTSTORE pvVar2;
  longlong lVar3;
  longlong lVar4;
  
  pvVar1 = (void *)FUN_140132ce0();
  if (pvVar1 != (void *)0x0) {
    lVar3 = 0;
    lVar4 = lVar3;
    if (param_2 != '\0') {
      lVar4 = 0x8000;
    }
    pvVar2 = CertOpenStore((LPCSTR)0x4,0,0,(DWORD)lVar4,pvVar1);
    if (pvVar2 != (HCERTSTORE)0x0) {
      FUN_140132a80(pvVar1);
      pvVar1 = operator_new(0x110);
      if (pvVar1 != (void *)0x0) {
        lVar3 = FUN_1400ee560(pvVar1,pvVar2,0);
      }
      FUN_1400bdb00(lVar3 + 0x60,param_1);
      *(undefined1 *)(lVar3 + 0x58) = 1;
      FUN_1400bdb00(lVar3 + 0x90,"HKEY_LOCAL_MACHINE");
      FUN_140132a00(lVar3 + 200,param_1);
      return lVar3;
    }
    if (param_3 != 0) {
      FUN_1400cf640(param_3);
    }
    FUN_140132a80(pvVar1);
  }
  return 0;
}



longlong FUN_1400eedd0(undefined8 param_1,char param_2,longlong param_3)

{
  void *pvVar1;
  HCERTSTORE pvVar2;
  longlong lVar3;
  longlong lVar4;
  
  pvVar1 = (void *)FUN_140132d00();
  if (pvVar1 != (void *)0x0) {
    lVar3 = 0;
    lVar4 = lVar3;
    if (param_2 != '\0') {
      lVar4 = 0x8000;
    }
    pvVar2 = CertOpenStore((LPCSTR)0x4,0,0,(DWORD)lVar4,pvVar1);
    if (pvVar2 != (HCERTSTORE)0x0) {
      FUN_140132a80(pvVar1);
      pvVar1 = operator_new(0x110);
      if (pvVar1 != (void *)0x0) {
        lVar3 = FUN_1400ee560(pvVar1,pvVar2,0);
      }
      FUN_1400bdb00(lVar3 + 0x60,param_1);
      *(undefined1 *)(lVar3 + 0x58) = 1;
      FUN_1400bdb00(lVar3 + 0x90,"HKEY_CURRENT_USER");
      FUN_1401329e0(lVar3 + 200,param_1);
      return lVar3;
    }
    if (param_3 != 0) {
      FUN_1400cf640(param_3);
    }
    FUN_140132a80(pvVar1);
  }
  return 0;
}



undefined8 FUN_1400eeec0(longlong param_1,undefined8 param_2,longlong *param_3)

{
  char cVar1;
  PCCERT_CONTEXT pPrevCertContext;
  void *pvVar2;
  undefined8 uVar3;
  undefined1 local_88 [40];
  undefined1 local_60 [40];
  undefined8 local_38;
  undefined1 local_30 [40];
  
  local_38 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x10) == 0) {
    (**(code **)(*param_3 + 0x28))(param_3,"No certificate store opened.");
  }
  else {
    FUN_1400b8c40(local_30);
    FUN_1400b9f10(local_30,param_2,"base64");
    FUN_1400b8c40(local_88);
    FUN_1400b8c40(local_60);
    for (pPrevCertContext =
              CertEnumCertificatesInStore(*(HCERTSTORE *)(param_1 + 0x10),(PCCERT_CONTEXT)0x0);
        pPrevCertContext != (PCCERT_CONTEXT)0x0;
        pPrevCertContext =
             CertEnumCertificatesInStore(*(HCERTSTORE *)(param_1 + 0x10),pPrevCertContext)) {
      FUN_1400b8b30(local_88);
      FUN_1400b8b30(local_60);
      FUN_1401101f0(pPrevCertContext,local_88,local_60);
      cVar1 = FUN_1400b93e0(local_88,local_30);
      if (cVar1 != '\0') {
        pvVar2 = operator_new(0x390);
        if (pvVar2 == (void *)0x0) {
          uVar3 = 0;
        }
        else {
          uVar3 = FUN_1401114e0(pvVar2,pPrevCertContext,param_3);
        }
        FUN_1400b92d0(local_60);
        FUN_1400b92d0(local_88);
        FUN_1400b92d0(local_30);
        return uVar3;
      }
    }
    FUN_1400b92d0(local_60);
    FUN_1400b92d0(local_88);
    FUN_1400b92d0(local_30);
  }
  return 0;
}



void FUN_1400ef030(longlong param_1,undefined8 param_2)

{
  char *pcVar1;
  
  if (*(char *)(param_1 + 0x18) != '\0') {
    FUN_1400bc640(param_2,"(file) ");
    FUN_1400bda40(param_2,param_1 + 0x20);
    return;
  }
  if (*(char *)(param_1 + 0x58) != '\0') {
    FUN_1400bc640(param_2,"(registry) ");
    FUN_1400bda40(param_2,param_1 + 0x90);
    FUN_1400bc640(param_2,&DAT_140244ed0);
    FUN_1400bda40(param_2,param_1 + 0x60);
    return;
  }
  pcVar1 = "[In-Memory Certificate Store]";
  if (*(char *)(param_1 + 0xc0) == '\0') {
    pcVar1 = "unknown";
  }
  FUN_1400bc640(param_2,pcVar1);
  return;
}



void * FUN_1400ef0e0(void *param_1,uint param_2)

{
  FUN_1400ee760();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8
FUN_1400ef110(longlong param_1,undefined8 param_2,undefined8 param_3,longlong *param_4,char param_5)

{
  longlong lVar1;
  char cVar2;
  undefined8 uVar3;
  PCCERT_CONTEXT pPrevCertContext;
  void *pvVar4;
  undefined1 local_1d0 [48];
  undefined1 local_1a0 [56];
  undefined1 local_168 [160];
  undefined1 local_c8 [160];
  
  if (*(longlong *)(param_1 + 0x10) == 0) {
LAB_1400ef3b7:
    uVar3 = 0;
  }
  else {
    if (param_5 != '\0') {
      (**(code **)(*param_4 + 0x48))
                (param_4,"FindCertBySerialAndIssuerCN",1,param_4,0xfffffffffffffffe);
      FUN_1400bcc20(local_1a0);
      FUN_1400ef030(param_1,local_1a0);
      lVar1 = *param_4;
      uVar3 = FUN_1400b8b90(local_1a0);
      (**(code **)(lVar1 + 0x58))(param_4,"CertStoreLocation",uVar3);
      FUN_1400bceb0(local_1a0);
    }
    FUN_1400bcc20(local_1d0);
    FUN_1400b6fd0(local_c8);
    FUN_1400b6fd0(local_168);
    FUN_1400b86c0(local_168,&DAT_140244ea0);
    FUN_1400b86c0(local_168,param_3);
    FUN_1400b86c0(local_168,&DAT_1402749e8);
    if (param_5 != '\0') {
      (**(code **)(*param_4 + 0x58))(param_4,"serialNumberToFind",param_2);
      lVar1 = *param_4;
      uVar3 = FUN_1400b7ce0(local_168);
      (**(code **)(lVar1 + 0x58))(param_4,"stringToFind",uVar3);
      (**(code **)(*param_4 + 0x30))(param_4,&DAT_140244fb0);
    }
    pPrevCertContext = (PCCERT_CONTEXT)0x0;
    do {
      do {
        pPrevCertContext =
             CertEnumCertificatesInStore(*(HCERTSTORE *)(param_1 + 0x10),pPrevCertContext);
        if (pPrevCertContext == (PCCERT_CONTEXT)0x0) {
          if (param_5 != '\0') {
            (**(code **)(*param_4 + 0x30))(param_4,"Did not find matching certificate.");
            (**(code **)(*param_4 + 0x50))(param_4);
          }
          FUN_1400b7090(local_168);
          FUN_1400b7090(local_c8);
          FUN_1400bceb0(local_1d0);
          goto LAB_1400ef3b7;
        }
        FUN_140110630(pPrevCertContext,local_1d0);
        if (param_5 != '\0') {
          lVar1 = *param_4;
          uVar3 = FUN_1400b8b90(local_1d0);
          (**(code **)(lVar1 + 0x58))(param_4,"serialNumber",uVar3);
        }
        cVar2 = FUN_1400be010(local_1d0,param_2);
      } while (cVar2 == '\0');
      if (param_5 != '\0') {
        (**(code **)(*param_4 + 0x30))(param_4,"Found certificate with matching serial number!");
      }
      FUN_14010ff60(pPrevCertContext,local_c8);
      FUN_1400b86c0(local_c8,&DAT_1402749e8);
      if (param_5 != '\0') {
        lVar1 = *param_4;
        uVar3 = FUN_1400b7ce0(local_c8);
        (**(code **)(lVar1 + 0x58))(param_4,"IssuerX500",uVar3);
      }
      uVar3 = FUN_1400b7ce0(local_168);
      cVar2 = FUN_1400b8160(local_c8,uVar3);
    } while (cVar2 == '\0');
    if (param_5 != '\0') {
      (**(code **)(*param_4 + 0x30))(param_4,"Found matching certificate.");
      (**(code **)(*param_4 + 0x50))(param_4);
    }
    pvVar4 = operator_new(0x390);
    if (pvVar4 == (void *)0x0) {
      uVar3 = 0;
    }
    else {
      uVar3 = FUN_1401114e0(pvVar4,pPrevCertContext,param_4);
    }
    FUN_1400b7090(local_168);
    FUN_1400b7090(local_c8);
    FUN_1400bceb0(local_1d0);
  }
  return uVar3;
}



void FUN_1400ef3e0(longlong param_1,undefined8 param_2,uint param_3,char param_4)

{
  *(undefined8 *)(param_1 + 0x48) = param_2;
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(ulonglong *)(param_1 + 0x50) = (ulonglong)param_3;
  if (param_4 != '\0') {
    FUN_140132fc0(param_1 + 8);
  }
  return;
}



undefined8 * FUN_1400ef410(undefined8 *param_1)

{
  FUN_140102f50();
  param_1[9] = 0;
  param_1[10] = 0;
  param_1[0xb] = 0;
  *param_1 = MemoryDataSource::vftable;
  return param_1;
}



void FUN_1400ef440(undefined8 *param_1)

{
  *param_1 = MemoryDataSource::vftable;
  param_1[9] = 0;
  param_1[10] = 0;
  param_1[0xb] = 0;
  FUN_140102fc0();
  return;
}



undefined8 FUN_1400ef460(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x58);
}



void FUN_1400ef470(longlong param_1)

{
  *(undefined8 *)(param_1 + 0x58) = 0;
  return;
}



bool FUN_1400ef480(longlong param_1)

{
  return *(longlong *)(param_1 + 0x50) <= *(longlong *)(param_1 + 0x58);
}



void FUN_1400ef490(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
                    // WARNING: Could not recover jumptable at 0x0001400ef496. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0x28))(param_1,param_2,param_4);
  return;
}



undefined8 FUN_1400ef4a0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  plVar1 = (longlong *)(param_1 + 0x58);
  *plVar1 = *plVar1 + param_2;
  uVar3 = *(undefined8 *)(param_1 + 0x58);
  if (*plVar1 < 0) {
    uVar3 = 0;
  }
  *(undefined8 *)(param_1 + 0x58) = uVar3;
  lVar2 = *(longlong *)(param_1 + 0x50);
  if (lVar2 < *(longlong *)(param_1 + 0x58)) {
    *(longlong *)(param_1 + 0x58) = lVar2;
  }
  return CONCAT71((int7)((ulonglong)lVar2 >> 8),1);
}



undefined8 FUN_1400ef4d0(longlong param_1,longlong param_2)

{
  longlong lVar1;
  
  if (param_2 < 0) {
    param_2 = 0;
  }
  lVar1 = *(longlong *)(param_1 + 0x50);
  *(longlong *)(param_1 + 0x58) = param_2;
  if (lVar1 < param_2) {
    *(longlong *)(param_1 + 0x58) = lVar1;
  }
  return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
}



void FUN_1400ef4f0(longlong *param_1)

{
  (**(code **)(*param_1 + 8))();
  return;
}



ulonglong FUN_1400ef510(longlong param_1,void *param_2,ulonglong param_3,int *param_4,
                       longlong *param_5)

{
  longlong lVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  char local_res8 [8];
  
  if ((param_2 == *(void **)(param_1 + 0x48)) &&
     ((param_3 & 0xffffffff) == *(ulonglong *)(param_1 + 0x50))) {
    if (*(longlong *)(param_1 + 0x58) != 0) {
      if (param_4 != (int *)0x0) {
        *param_4 = 0;
      }
      return param_3 & 0xffffff00;
    }
    if (param_4 != (int *)0x0) {
      *param_4 = *(int *)(param_1 + 0x50);
    }
    FUN_140102ef0(param_1,*(undefined4 *)(param_1 + 0x50));
    lVar1 = *(longlong *)(param_1 + 0x50);
    *(longlong *)(param_1 + 0x18) = *(longlong *)(param_1 + 0x18) + lVar1;
    *(longlong *)(param_1 + 0x58) = lVar1;
    uVar3 = 1;
    if (*(longlong *)(param_1 + 0x20) != 0) {
      local_res8[0] = '\0';
      FUN_1401030c0(*(longlong *)(param_1 + 0x20),lVar1,local_res8);
      if (local_res8[0] != '\0') {
        if (param_5 != (longlong *)0x0) {
          (**(code **)(*param_5 + 0x30))(param_5,"Aborted by application");
        }
        uVar3 = 0;
      }
    }
    return uVar3;
  }
  uVar3 = *(longlong *)(param_1 + 0x50) - *(longlong *)(param_1 + 0x58);
  if ((longlong)(param_3 & 0xffffffff) < (longlong)uVar3) {
    uVar3 = param_3;
  }
  if (param_4 != (int *)0x0) {
    *param_4 = (int)uVar3;
  }
  uVar2 = FUN_140102ef0(param_1,uVar3 & 0xffffffff);
  if ((int)uVar3 == 0) {
    uVar2 = uVar2 & 0xffffffffffffff00;
  }
  else {
    memcpy(param_2,(void *)(*(longlong *)(param_1 + 0x58) + *(longlong *)(param_1 + 0x48)),
           uVar3 & 0xffffffff);
    *(longlong *)(param_1 + 0x58) = *(longlong *)(param_1 + 0x58) + (uVar3 & 0xffffffff);
    *(longlong *)(param_1 + 0x18) = *(longlong *)(param_1 + 0x18) + (uVar3 & 0xffffffff);
    uVar2 = 1;
    if (*(longlong *)(param_1 + 0x20) != 0) {
      local_res8[0] = '\0';
      FUN_1401032d0(*(longlong *)(param_1 + 0x20),uVar3 & 0xffffffff,local_res8);
      if (local_res8[0] != '\0') {
        if (param_5 != (longlong *)0x0) {
          (**(code **)(*param_5 + 0x30))(param_5,"Aborted by application");
        }
        uVar2 = 0;
      }
    }
  }
  return uVar2;
}



ulonglong FUN_1400ef670(longlong param_1,uint param_2,longlong *param_3)

{
  uint uVar1;
  longlong lVar2;
  uint uVar3;
  ulonglong uVar4;
  longlong lVar6;
  ulonglong uVar5;
  
  *param_3 = 0;
  uVar4 = FUN_1400bec30();
  lVar6 = *(longlong *)(param_1 + 0x50) + -4;
  if (lVar6 < *(longlong *)(param_1 + 0x58)) {
    return uVar4 & 0xffffffffffffff00;
  }
  while( true ) {
    lVar2 = *(longlong *)(param_1 + 0x58);
    uVar5 = *(ulonglong *)(param_1 + 0x48);
    if ((char)uVar4 == '\0') {
      uVar1 = *(uint *)(lVar2 + uVar5);
      uVar3 = (uVar1 & 0xff00) << 8 | uVar1 >> 0x18;
      uVar5 = (ulonglong)uVar3;
      uVar3 = uVar1 >> 8 & 0xff00ff00 | uVar1 << 0x18 | uVar3;
    }
    else {
      uVar3 = *(uint *)(lVar2 + uVar5);
    }
    if (uVar3 == param_2) break;
    *(ulonglong *)(param_1 + 0x58) = lVar2 + 1U;
    *param_3 = *param_3 + 1;
    if (lVar6 < *(longlong *)(param_1 + 0x58)) {
      return lVar2 + 1U & 0xffffffffffffff00;
    }
  }
  *(longlong *)(param_1 + 0x58) = *(longlong *)(param_1 + 0x58) + 4;
  return CONCAT71((int7)(uVar5 >> 8),1);
}



undefined8 * FUN_1400ef730(undefined8 *param_1,uint param_2)

{
  *param_1 = MemoryDataSource::vftable;
  param_1[9] = 0;
  param_1[10] = 0;
  param_1[0xb] = 0;
  FUN_140102fc0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400ef780(undefined8 param_1,longlong *param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined1 auStack_b8 [32];
  undefined1 local_98 [8];
  ushort local_90;
  ushort local_8e;
  ushort local_8a;
  undefined1 local_78 [48];
  undefined8 local_48;
  char local_40 [40];
  ulonglong local_18;
  
  local_48 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_b8;
  FUN_1400d04a0(&local_90);
  FUN_1400d0640(&local_90);
  FUN_1400bcc20(local_78);
  FUN_1400cf840(local_98);
  FUN_1400d0260(local_78);
  lVar1 = *param_2;
  uVar2 = FUN_1400b8b90(local_78);
  (**(code **)(lVar1 + 0x58))(param_2,"hcCurDate",uVar2);
  sprintf(local_40,"%d/%d");
  (**(code **)(*param_2 + 0x58))(param_2,"hcExpire",local_40);
  if (local_8a < 0x1d) {
    FUN_1400cf850(local_98);
  }
  else if (local_90 < 0x7dc) {
    FUN_1400cf850(local_98);
  }
  else {
    if (local_90 != 0x7dc) {
      FUN_1400cf850(local_98);
      FUN_1400bceb0(local_78);
      return 0;
    }
    if (7 < local_8e) {
      FUN_1400cf850(local_98);
      FUN_1400bceb0(local_78);
      return 0;
    }
    FUN_1400cf850(local_98);
  }
  FUN_1400bceb0(local_78);
  return 1;
}



undefined8 *
FUN_1400ef8e0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined1 local_20 [24];
  
  uVar1 = 0xfffffffffffffffe;
  *param_1 = ThirtyDayTrial::vftable;
  FUN_1400bcc20(param_1 + 1);
  FUN_1400bcc20(param_1 + 7);
  FUN_1400f0d10(local_20);
  FUN_1400f3060(local_20,param_1 + 1,"Q2hpbGthdCBTb2Z0d2FyZSwgSW5jLg==",param_4,uVar1);
  FUN_1400f0d30(local_20);
  return param_1;
}



void FUN_1400ef960(undefined8 *param_1)

{
  *param_1 = ThirtyDayTrial::vftable;
  FUN_1400bceb0(param_1 + 7);
  FUN_1400bceb0(param_1 + 1);
  return;
}



void FUN_1400ef9a0(longlong param_1,undefined8 param_2)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  undefined1 local_f8 [16];
  undefined8 local_e8;
  undefined1 local_e0 [56];
  undefined1 local_a8 [160];
  
  local_e8 = 0xfffffffffffffffe;
  FUN_1400b6fd0(local_a8);
  FUN_1400bee60(local_a8);
  iVar2 = FUN_1400b8350(local_a8);
  if (iVar2 != 0) {
    uVar4 = FUN_1400b7ce0(local_a8);
    FUN_1400bc640(param_2,uVar4);
    cVar1 = FUN_1400bdcd0(param_2);
    if ((cVar1 != '/') && (cVar1 = FUN_1400bdcd0(param_2), cVar1 != '\\')) {
      FUN_1400bbe50(param_2,0x2f);
    }
    FUN_1400bcc20(local_e0);
    FUN_1400f0d10(local_f8);
    uVar3 = FUN_1400bbb10(param_1 + 0x38);
    uVar4 = FUN_1400b8b90(param_1 + 0x38);
    FUN_1400f30f0(uVar4,uVar3,local_e0);
    FUN_1400bd110(local_e0,&DAT_140244e70,&DAT_14027a10a);
    FUN_1400bda40(param_2,local_e0);
    FUN_1400bc640(param_2,&DAT_140209104);
    FUN_1400f0d30(local_f8);
    FUN_1400bceb0(local_e0);
  }
  FUN_1400b7090(local_a8);
  return;
}



void FUN_1400efad0(undefined8 param_1,undefined8 param_2)

{
  undefined8 uVar1;
  int iVar2;
  undefined8 *puVar3;
  undefined1 local_e8 [48];
  undefined8 local_b8;
  undefined1 local_a8 [160];
  
  local_b8 = 0xfffffffffffffffe;
  FUN_1400bcc20(local_e8);
  FUN_1400ef9a0(param_1,local_e8);
  iVar2 = FUN_1400bbb10(local_e8);
  if (iVar2 != 0) {
    FUN_1400b6fd0(local_a8);
    uVar1 = FUN_1400b8b90(local_e8);
    FUN_1400b7200(local_a8,uVar1);
    puVar3 = (undefined8 *)FUN_1400bea10(local_a8,0);
    if (puVar3 == (undefined8 *)0x0) {
      FUN_1400b7090(local_a8);
    }
    else {
      FUN_1400bdc90(param_2,puVar3);
      (**(code **)*puVar3)(puVar3,1);
      FUN_1400b7090(local_a8);
    }
  }
  FUN_1400bceb0(local_e8);
  return;
}



undefined1 FUN_1400efba0(undefined8 param_1,undefined8 param_2)

{
  char cVar1;
  undefined1 uVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined1 local_res18 [16];
  undefined1 local_70 [48];
  undefined1 local_40 [56];
  
  FUN_1400bcc20(local_70);
  FUN_1400ef9a0(param_1,local_70);
  iVar3 = FUN_1400bbb10(local_70);
  if (iVar3 == 0) {
    FUN_1400bceb0(local_70);
    uVar2 = 0;
  }
  else {
    uVar5 = FUN_1400b8b90(local_70);
    cVar1 = FUN_1400bf720(uVar5,0);
    if (cVar1 == '\0') {
      FUN_1400bcc20(local_40);
      FUN_1400d3c10(local_res18);
      FUN_1400d3bb0(local_res18,local_40,param_2);
      uVar4 = FUN_1400bbb10(local_40);
      uVar5 = FUN_1400b8b90(local_40);
      uVar6 = FUN_1400b8b90(local_70);
      uVar2 = FUN_1400c0310(uVar6,uVar5,uVar4,0);
      FUN_1400d3c20(local_res18);
      FUN_1400bceb0(local_40);
      FUN_1400bceb0(local_70);
    }
    else {
      FUN_1400bceb0(local_70);
      uVar2 = 1;
    }
  }
  return uVar2;
}



void FUN_1400efcc0(longlong param_1)

{
  FUN_1400bdb00(param_1 + 0x38);
  return;
}



undefined8 FUN_1400efcd0(void)

{
  int iVar1;
  undefined8 local_res10 [3];
  
  local_res10[0] = 0;
  iVar1 = FUN_1400ce8f0(0xffffffff80000002,"Software",0,0x20019,local_res10);
  if (iVar1 != 0) {
    iVar1 = FUN_1400ce8f0(0xffffffff80000001,"Software",0,0x20019,local_res10);
    if (iVar1 != 0) {
      return 0;
    }
  }
  return local_res10[0];
}



undefined8 FUN_1400efd50(void)

{
  int iVar1;
  HKEY local_res10;
  HKEY local_res18;
  undefined8 local_res20;
  
  local_res10 = (HKEY)0x0;
  iVar1 = FUN_1400ce8f0(0xffffffff80000002,"Software",0,0x20019,&local_res10);
  if ((iVar1 != 0) &&
     (iVar1 = FUN_1400ce8f0(0xffffffff80000001,"Software",0,0x20019,&local_res10), iVar1 != 0)) {
    return 0;
  }
  iVar1 = FUN_1400ce8f0(local_res10,"Classes",0,0x20019,&local_res18);
  if (iVar1 == 0) {
    iVar1 = FUN_1400ce8f0(local_res18,"WMZebra",0,0x20019,&local_res20);
    if (iVar1 == 0) {
      RegCloseKey(local_res18);
      RegCloseKey(local_res10);
      return local_res20;
    }
    RegCloseKey(local_res18);
  }
  RegCloseKey(local_res10);
  return 0;
}



undefined8 FUN_1400efe40(undefined8 param_1,char param_2)

{
  int iVar1;
  undefined8 uVar2;
  undefined1 local_res10 [8];
  HKEY local_res18;
  HKEY local_res20;
  undefined8 *puVar3;
  undefined8 local_18 [3];
  
  local_res18 = (HKEY)0x0;
  if (param_2 == '\0') {
    uVar2 = 0xffffffff80000001;
  }
  else {
    uVar2 = 0xffffffff80000002;
  }
  iVar1 = FUN_1400ce8f0(uVar2,"Software",0,0x2001f,&local_res18);
  if (iVar1 != 0) {
    return 0;
  }
  iVar1 = FUN_1400ce8f0(local_res18,"Classes",0,0x2001f,&local_res20);
  if (iVar1 != 0) {
    RegCloseKey(local_res18);
    return 0;
  }
  puVar3 = local_18;
  iVar1 = FUN_1400ce8f0(local_res20,"WMZebra",0,0x2001f,puVar3);
  if (iVar1 != 0) {
    iVar1 = FUN_1400ce910(local_res20,"WMZebra",0,&DAT_14027a10a,
                          (ulonglong)puVar3 & 0xffffffff00000000,0x2001f,0,local_18,local_res10);
    if (iVar1 != 0) {
      RegCloseKey(local_res18);
      RegCloseKey(local_res20);
      return 0;
    }
  }
  RegCloseKey(local_res20);
  RegCloseKey(local_res18);
  return local_18[0];
}



void FUN_1400effa0(longlong param_1,undefined8 param_2)

{
  int iVar1;
  HKEY hKey;
  undefined8 uVar2;
  HKEY local_res18;
  HKEY local_res20;
  undefined1 local_18 [8];
  undefined8 local_10;
  
  local_10 = 0xfffffffffffffffe;
  FUN_1400bbe30(param_2);
  hKey = (HKEY)FUN_1400efcd0(param_1);
  if (hKey != (HKEY)0x0) {
    uVar2 = FUN_1400b8b90(param_1 + 8);
    iVar1 = FUN_1400ce8f0(hKey,uVar2,0,0x20019,&local_res18);
    if (iVar1 == 0) {
      uVar2 = FUN_1400b8b90(param_1 + 0x38);
      iVar1 = FUN_1400ce8f0(local_res18,uVar2,0,0x20019,&local_res20);
      if (iVar1 == 0) {
        FUN_1400bebf0(local_18);
        FUN_140132d80(local_res20,"Key30",param_2,local_18);
        RegCloseKey(hKey);
        RegCloseKey(local_res18);
        RegCloseKey(local_res20);
        FUN_1400bec20(local_18);
      }
    }
    else {
      RegCloseKey(hKey);
    }
  }
  return;
}



ulonglong FUN_1400f00a0(longlong param_1,char param_2,longlong *param_3)

{
  HKEY hKey;
  int iVar1;
  LSTATUS LVar2;
  ulonglong uVar3;
  undefined4 extraout_var;
  undefined4 extraout_var_00;
  undefined8 uVar4;
  undefined1 local_res10 [8];
  HKEY local_res20;
  HKEY *ppHVar5;
  HKEY local_68;
  HKEY local_60;
  undefined1 local_58 [8];
  undefined8 local_50;
  undefined1 local_48 [48];
  
  local_50 = 0xfffffffffffffffe;
  local_68 = (HKEY)0x0;
  uVar4 = 0xffffffff80000002;
  if (param_2 == '\0') {
    uVar4 = 0xffffffff80000001;
  }
  uVar3 = FUN_1400ce8f0(uVar4,"Software",0,0x2001f,&local_68);
  hKey = local_68;
  if (((int)uVar3 == 0) && (local_68 != (HKEY)0x0)) {
    uVar4 = FUN_1400b8b90(param_1 + 8);
    ppHVar5 = &local_res20;
    iVar1 = FUN_1400ce8f0(hKey,uVar4,0,0x2001f,ppHVar5);
    if (iVar1 != 0) {
      uVar4 = FUN_1400b8b90(param_1 + 8);
      iVar1 = FUN_1400ce910(hKey,uVar4,0,&DAT_14027a10a,(ulonglong)ppHVar5 & 0xffffffff00000000,
                            0x2001f,0,&local_res20,local_res10);
      if (iVar1 != 0) {
        if (param_3 != (longlong *)0x0) {
          (**(code **)(*param_3 + 0x28))(param_3,"Failed to create registry key (2)");
        }
        LVar2 = RegCloseKey(hKey);
        uVar3 = CONCAT44(extraout_var,LVar2);
        goto LAB_1400f0325;
      }
    }
    uVar4 = FUN_1400b8b90(param_1 + 0x38);
    ppHVar5 = &local_60;
    iVar1 = FUN_1400ce8f0(local_res20,uVar4,0,0x2001f,ppHVar5);
    if (iVar1 != 0) {
      uVar4 = FUN_1400b8b90(param_1 + 0x38);
      iVar1 = FUN_1400ce910(local_res20,uVar4,0,&DAT_14027a10a,
                            (ulonglong)ppHVar5 & 0xffffffff00000000,0x2001f,0,&local_60,local_res10)
      ;
      if (iVar1 != 0) {
        if (param_3 != (longlong *)0x0) {
          (**(code **)(*param_3 + 0x28))(param_3,"Failed to create registry key (3)");
        }
        RegCloseKey(hKey);
        LVar2 = RegCloseKey(local_res20);
        uVar3 = CONCAT44(extraout_var_00,LVar2);
        goto LAB_1400f0325;
      }
    }
    FUN_1400bcc20(local_48);
    FUN_1400d3c10(local_58);
    FUN_1400d3bb0(local_58,local_48,param_3);
    uVar3 = 0;
    uVar4 = FUN_1400b8b90(local_48);
    iVar1 = FUN_140132d20(local_60,"Key30",uVar4,param_3);
    if (iVar1 == 0) {
      uVar3 = 1;
    }
    else if (param_3 != (longlong *)0x0) {
      (**(code **)(*param_3 + 0x28))(param_3,"Failed to create registry key (4)");
    }
    RegCloseKey(hKey);
    RegCloseKey(local_res20);
    RegCloseKey(local_60);
    FUN_1400d3c20(local_58);
    FUN_1400bceb0(local_48);
  }
  else {
    if (param_3 != (longlong *)0x0) {
      uVar3 = (**(code **)(*param_3 + 0x28))(param_3,"Failed to open registry (1)");
    }
LAB_1400f0325:
    uVar3 = uVar3 & 0xffffffffffffff00;
  }
  return uVar3;
}



void FUN_1400f0340(longlong param_1,undefined8 param_2)

{
  int iVar1;
  undefined4 uVar2;
  HKEY hKey;
  undefined8 uVar3;
  HKEY local_res20;
  HKEY local_68;
  undefined1 local_60 [8];
  undefined8 local_58;
  undefined1 local_50 [16];
  undefined1 local_40 [56];
  
  local_58 = 0xfffffffffffffffe;
  FUN_1400bbe30(param_2);
  hKey = (HKEY)FUN_1400efd50(param_1);
  if (hKey != (HKEY)0x0) {
    iVar1 = FUN_1400ce8f0(hKey,"CLSID",0,0x20019,&local_res20);
    if (iVar1 == 0) {
      FUN_1400bcc20(local_40);
      FUN_1400f0d10(local_50);
      uVar2 = FUN_1400bbb10(param_1 + 0x38);
      uVar3 = FUN_1400b8b90(param_1 + 0x38);
      FUN_1400f0d40(local_50,uVar3,uVar2,local_40);
      uVar3 = FUN_1400b8b90(local_40);
      iVar1 = FUN_1400ce8f0(local_res20,uVar3,0,0x20019,&local_68);
      if (iVar1 == 0) {
        FUN_1400bebf0(local_60);
        FUN_140132d80(local_68,&DAT_1402452f0,param_2,local_60);
        RegCloseKey(hKey);
        RegCloseKey(local_res20);
        RegCloseKey(local_68);
        FUN_1400bec20(local_60);
        FUN_1400f0d30(local_50);
      }
      else {
        FUN_1400f0d30(local_50);
      }
      FUN_1400bceb0(local_40);
    }
    else {
      RegCloseKey(hKey);
    }
  }
  return;
}



ulonglong FUN_1400f04c0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  int iVar1;
  LSTATUS LVar2;
  undefined4 uVar3;
  HKEY hKey;
  undefined4 extraout_var;
  undefined8 uVar4;
  ulonglong uVar5;
  undefined1 local_res20 [8];
  HKEY *ppHVar6;
  HKEY local_a8;
  HKEY local_a0;
  undefined1 local_98 [8];
  undefined1 local_90 [16];
  undefined8 local_80;
  undefined1 local_78 [48];
  undefined1 local_48 [48];
  
  local_80 = 0xfffffffffffffffe;
  hKey = (HKEY)FUN_1400efe40();
  uVar5 = 0;
  if (hKey != (HKEY)0x0) {
    ppHVar6 = &local_a8;
    iVar1 = FUN_1400ce8f0(hKey,"CLSID",0,0x2001f,ppHVar6);
    if ((iVar1 == 0) ||
       (iVar1 = FUN_1400ce910(hKey,"CLSID",0,&DAT_14027a10a,(ulonglong)ppHVar6 & 0xffffffff00000000,
                              0x2001f,0,&local_a8,local_res20), iVar1 == 0)) {
      FUN_1400bcc20(local_78);
      FUN_1400f0d10(local_90);
      uVar3 = FUN_1400bbb10(param_1 + 0x38);
      uVar4 = FUN_1400b8b90(param_1 + 0x38);
      FUN_1400f0d40(local_90,uVar4,uVar3,local_78);
      uVar4 = FUN_1400b8b90(local_78);
      ppHVar6 = &local_a0;
      iVar1 = FUN_1400ce8f0(local_a8,uVar4,0,0x2001f,ppHVar6);
      if (iVar1 != 0) {
        uVar4 = FUN_1400b8b90(local_78);
        iVar1 = FUN_1400ce910(local_a8,uVar4,0,&DAT_14027a10a,
                              (ulonglong)ppHVar6 & 0xffffffff00000000,0x2001f,0,&local_a0,
                              local_res20);
        if (iVar1 != 0) {
          RegCloseKey(hKey);
          RegCloseKey(local_a8);
          FUN_1400f0d30(local_90);
          uVar5 = FUN_1400bceb0(local_78);
          return uVar5 & 0xffffffffffffff00;
        }
      }
      FUN_1400bcc20(local_48);
      FUN_1400d3c10(local_98);
      FUN_1400d3bb0(local_98,local_48,param_3);
      uVar4 = FUN_1400b8b90(local_48);
      iVar1 = FUN_140132d20(local_a0,&DAT_1402452f0,uVar4,0);
      RegCloseKey(hKey);
      RegCloseKey(local_a8);
      RegCloseKey(local_a0);
      FUN_1400d3c20(local_98);
      FUN_1400bceb0(local_48);
      FUN_1400f0d30(local_90);
      FUN_1400bceb0(local_78);
      return (ulonglong)(iVar1 == 0);
    }
    LVar2 = RegCloseKey(hKey);
    uVar5 = CONCAT44(extraout_var,LVar2);
  }
  return uVar5 & 0xffffffffffffff00;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 FUN_1400f0710(undefined8 param_1,undefined4 *param_2,longlong *param_3)

{
  longlong lVar1;
  bool bVar2;
  undefined1 uVar3;
  char cVar4;
  int iVar5;
  undefined8 uVar6;
  undefined1 auStack_148 [32];
  undefined4 *local_128;
  longlong *local_120;
  undefined4 *local_118;
  longlong *local_110;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8 [2];
  undefined1 local_f0 [8];
  undefined4 local_e8 [2];
  undefined1 local_e0 [48];
  undefined8 local_b0;
  undefined1 local_a8 [6];
  short local_a2;
  char local_88 [80];
  ulonglong local_38;
  
  local_b0 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_148;
  FUN_1400bcc20(local_e0);
  FUN_1400d04a0(local_a8);
  FUN_1400d0640(local_a8);
  bVar2 = 4 < (ushort)(local_a2 - 0x18U);
  if (bVar2) {
    FUN_1400effa0(param_1,local_e0);
  }
  else {
    FUN_1400f0340(param_1,local_e0,param_3);
  }
  iVar5 = FUN_1400bbb10(local_e0);
  if (iVar5 == 0) {
    if (param_3 != (longlong *)0x0) {
      (**(code **)(*param_3 + 0x30))(param_3,"No key yet in registry");
    }
    if (bVar2) {
      FUN_1400f00a0(param_1,0,param_3);
      FUN_1400f00a0(param_1,1,param_3);
      FUN_1400effa0(param_1,local_e0);
    }
    else {
      FUN_1400f04c0();
      FUN_1400f04c0(param_1,1,param_3);
      FUN_1400f0340(param_1,local_e0,param_3);
    }
    iVar5 = FUN_1400bbb10(local_e0);
    if (iVar5 == 0) {
      if (param_3 != (longlong *)0x0) {
        (**(code **)(*param_3 + 0x30))(param_3,"Failed to create key in registry");
        FUN_1400bcc20(local_88);
        FUN_1400ce800(local_88);
        lVar1 = *param_3;
        uVar6 = FUN_1400b8b90(local_88);
        (**(code **)(lVar1 + 0x58))(param_3,"LoggedOnUser",uVar6);
        FUN_1400bceb0(local_88);
      }
      *param_2 = 0x48;
      uVar3 = FUN_1400ef780(param_1,param_3);
      goto LAB_1400f095c;
    }
  }
  FUN_1400d3c10(local_f0);
  local_100 = 0;
  local_108 = 0;
  local_104 = 0;
  local_fc = 0;
  local_e8[0] = 0;
  local_f8[0] = 0;
  *param_2 = 0x26;
  uVar6 = FUN_1400b8b90(local_e0);
  local_128 = &local_104;
  local_120 = param_3;
  cVar4 = FUN_1400d39b0(local_f0,uVar6,&local_100,&local_108);
  if ((param_3 != (longlong *)0x0) && (cVar4 != '\0')) {
    local_128 = (undefined4 *)CONCAT44(local_128._4_4_,local_104);
    sprintf(local_88,"%d/%d/%d");
    (**(code **)(*param_3 + 0x58))(param_3,&DAT_140245350,local_88);
  }
  local_118 = local_f8;
  local_120 = (longlong *)local_e8;
  local_128 = &local_fc;
  local_110 = param_3;
  uVar3 = FUN_1400d3f70(local_f0,local_100,local_108,local_104);
  FUN_1400d3c20(local_f0);
LAB_1400f095c:
  FUN_1400bceb0(local_e0);
  return uVar3;
}



undefined1 FUN_1400f0990(undefined8 param_1,longlong *param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  int iVar3;
  undefined8 uVar4;
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined4 local_58;
  undefined4 local_54;
  undefined1 local_50 [8];
  undefined4 local_48;
  undefined4 local_44;
  undefined1 local_40 [48];
  undefined8 local_10;
  
  local_10 = 0xfffffffffffffffe;
  FUN_1400bcc20(local_40);
  FUN_1400efad0(param_1,local_40);
  iVar3 = FUN_1400bbb10(local_40);
  if (iVar3 == 0) {
    FUN_1400efba0(param_1,param_2);
    FUN_1400efad0(param_1,local_40);
    iVar3 = FUN_1400bbb10(local_40);
    if (iVar3 == 0) {
      FUN_1400bceb0(local_40);
      return 1;
    }
  }
  if (param_2 != (longlong *)0x0) {
    lVar1 = *param_2;
    uVar4 = FUN_1400b8b90(local_40);
    (**(code **)(lVar1 + 0x58))(param_2,&DAT_1402453d0,uVar4);
  }
  FUN_1400d3c10(local_50);
  local_58 = 0;
  local_res20[0] = 0;
  local_res18[0] = 0;
  local_54 = 0;
  local_48 = 0;
  local_44 = 0;
  uVar4 = FUN_1400b8b90(local_40);
  FUN_1400d39b0(local_50,uVar4,&local_58,local_res20,local_res18,param_2);
  uVar2 = FUN_1400d3f70(local_50,local_58,local_res20[0],local_res18[0],&local_54,&local_48,
                        &local_44,param_2);
  FUN_1400d3c20(local_50);
  FUN_1400bceb0(local_40);
  return uVar2;
}



undefined1 FUN_1400f0ae0(undefined8 param_1,longlong *param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  int iVar3;
  undefined8 uVar4;
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined4 local_58;
  undefined4 local_54;
  undefined1 local_50 [8];
  undefined4 local_48;
  undefined4 local_44;
  undefined1 local_40 [48];
  undefined8 local_10;
  
  local_10 = 0xfffffffffffffffe;
  FUN_1400bcc20(local_40);
  FUN_1400f0340(param_1,local_40,param_2);
  iVar3 = FUN_1400bbb10(local_40);
  if (iVar3 == 0) {
    FUN_1400f04c0(param_1,0,param_2);
    FUN_1400f04c0(param_1,1,param_2);
    FUN_1400f0340(param_1,local_40,param_2);
    iVar3 = FUN_1400bbb10(local_40);
    if (iVar3 == 0) {
      FUN_1400bceb0(local_40);
      return 1;
    }
  }
  if (param_2 != (longlong *)0x0) {
    lVar1 = *param_2;
    uVar4 = FUN_1400b8b90(local_40);
    (**(code **)(lVar1 + 0x58))(param_2,"srKey",uVar4);
  }
  FUN_1400d3c10(local_50);
  local_58 = 0;
  local_res20[0] = 0;
  local_res18[0] = 0;
  local_54 = 0;
  local_48 = 0;
  local_44 = 0;
  uVar4 = FUN_1400b8b90(local_40);
  FUN_1400d39b0(local_50,uVar4,&local_58,local_res20,local_res18,param_2);
  uVar2 = FUN_1400d3f70(local_50,local_58,local_res20[0],local_res18[0],&local_54,&local_48,
                        &local_44,param_2);
  FUN_1400d3c20(local_50);
  FUN_1400bceb0(local_40);
  return uVar2;
}



undefined8 * FUN_1400f0c40(undefined8 *param_1,uint param_2)

{
  *param_1 = ThirtyDayTrial::vftable;
  FUN_1400bceb0(param_1 + 7);
  FUN_1400bceb0(param_1 + 1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined1 FUN_1400f0ca0(undefined8 param_1,undefined8 param_2)

{
  char cVar1;
  undefined1 uVar2;
  undefined1 local_28 [12];
  ushort local_1c;
  
  cVar1 = FUN_1400ef780();
  if (cVar1 != '\0') {
    return 1;
  }
  FUN_1400d04a0(local_28);
  FUN_1400d0640(local_28);
  if (0x1e < local_1c) {
    uVar2 = FUN_1400f0990();
    return uVar2;
  }
  uVar2 = FUN_1400f0ae0(param_1,param_2);
  return uVar2;
}



undefined8 * FUN_1400f0d10(undefined8 *param_1)

{
  *(undefined4 *)(param_1 + 1) = 0x4c;
  *(undefined1 *)((longlong)param_1 + 0xc) = 0;
  *param_1 = ContentCoding::vftable;
  return param_1;
}



void FUN_1400f0d30(undefined8 *param_1)

{
  *param_1 = ContentCoding::vftable;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400f0d40(longlong param_1,byte *param_2,int param_3,undefined8 param_4)

{
  byte bVar1;
  byte bVar2;
  byte bVar3;
  uint uVar4;
  longlong lVar5;
  int iVar6;
  char cVar7;
  ulonglong uVar8;
  int iVar9;
  int iVar10;
  int iVar11;
  byte *pbVar12;
  undefined1 auStack_1a8 [32];
  int local_188;
  longlong local_180;
  byte *local_178;
  char local_168 [272];
  ulonglong local_58;
  
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_1a8;
  iVar6 = param_3 * 5 + 10;
  iVar6 = (int)(((longlong)iVar6 / 3 + ((longlong)iVar6 >> 0x3f) & 0xffffffffU) >> 0x1f) +
          iVar6 / 3 + (iVar6 >> 0x1f);
  if (*(int *)(param_1 + 8) == 0) {
    iVar6 = iVar6 + 3;
  }
  else {
    iVar6 = iVar6 + 3 + (iVar6 * 2) / *(int *)(param_1 + 8);
  }
  local_188 = param_3;
  local_180 = param_1;
  local_178 = param_2;
  FUN_1400bc530(param_4,iVar6,0x3f1);
  lVar5 = local_180;
  if ((param_3 != 0) && (param_2 != (byte *)0x0)) {
    iVar10 = 0;
    iVar11 = 0;
    iVar6 = 0;
    uVar4 = param_3 / 3;
    if (0 < (int)uVar4) {
      uVar8 = (ulonglong)uVar4;
      pbVar12 = param_2;
      do {
        bVar1 = *pbVar12;
        bVar2 = pbVar12[1];
        bVar3 = pbVar12[2];
        local_168[iVar6] =
             "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
             [(longlong)(ulonglong)bVar1 >> 2];
        local_168[iVar6 + 1] =
             "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
             [(longlong)(ulonglong)bVar2 >> 4 | (longlong)(int)((bVar1 & 3) << 4)];
        iVar10 = iVar10 + 4;
        iVar11 = iVar11 + 3;
        pbVar12 = pbVar12 + 3;
        local_168[iVar6 + 2] =
             *(char *)(((longlong)(int)((bVar2 & 0xf) << 2) | (longlong)(ulonglong)bVar3 >> 6) +
                      0x140245430);
        iVar9 = iVar6 + 4;
        local_168[iVar6 + 3] =
             "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[bVar3 & 0x3f];
        if (*(int *)(lVar5 + 8) <= iVar10) {
          local_168[iVar9] = '\r';
          iVar9 = iVar6 + 6;
          local_168[iVar6 + 5] = '\n';
          iVar10 = 0;
        }
        iVar6 = iVar9;
        if (0xff < iVar9) {
          FUN_1400bc8a0(param_4,local_168,iVar9);
          iVar6 = 0;
        }
        param_2 = local_178;
        param_3 = local_188;
        uVar8 = uVar8 - 1;
      } while (uVar8 != 0);
      if (iVar6 != 0) {
        FUN_1400bc8a0(param_4,local_168,iVar6);
      }
    }
    param_3 = param_3 + uVar4 * -3;
    if (param_3 != 0) {
      if (param_3 == 1) {
        bVar1 = param_2[iVar11];
        FUN_1400bbe50(param_4,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
                              [(longlong)(ulonglong)bVar1 >> 2]);
        FUN_1400bbe50(param_4,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
                              [(int)((bVar1 & 3) << 4)]);
        cVar7 = '=';
      }
      else {
        if (param_3 != 2) {
          return;
        }
        bVar1 = param_2[iVar11];
        bVar2 = param_2[(longlong)iVar11 + 1];
        FUN_1400bbe50(param_4,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
                              [(longlong)(ulonglong)bVar1 >> 2]);
        FUN_1400bbe50(param_4,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
                              [(longlong)(ulonglong)(uint)bVar2 >> 4 |
                               (longlong)(int)((bVar1 & 3) << 4)]);
        cVar7 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
                [(int)((bVar2 & 0xf) << 2)];
      }
      FUN_1400bbe50(param_4,cVar7);
      FUN_1400bbe50(param_4,0x3d);
    }
    FUN_1400bbe50(param_4,0xd);
    FUN_1400bbe50(param_4,10);
  }
  return;
}



void FUN_1400f1030(byte *param_1,int param_2,undefined8 param_3)

{
  byte *pbVar1;
  byte *pbVar2;
  byte *pbVar3;
  byte *pbVar4;
  byte *pbVar5;
  byte *pbVar6;
  byte bVar7;
  byte bVar8;
  byte bVar9;
  byte bVar10;
  byte bVar11;
  byte bVar12;
  byte bVar13;
  byte bVar14;
  int iVar15;
  void *pvVar16;
  longlong lVar17;
  longlong lVar18;
  int iVar19;
  ulonglong uVar20;
  
  if ((param_1 != (byte *)0x0) && (param_2 != 0)) {
    pvVar16 = operator_new(400);
    iVar19 = 0;
    if (param_2 != 0) {
      uVar20 = (ulonglong)(param_2 + 7U >> 3);
      lVar17 = 0;
      do {
        pbVar1 = param_1 + 2;
        pbVar2 = param_1 + 3;
        pbVar3 = param_1 + 4;
        pbVar4 = param_1 + 5;
        pbVar5 = param_1 + 6;
        bVar7 = *param_1;
        pbVar6 = param_1 + 7;
        bVar8 = (&DAT_1402ff380)[param_1[1] & 0x7f];
        param_1 = param_1 + 8;
        lVar18 = lVar17 + 5;
        bVar9 = (&DAT_1402ff380)[*pbVar1 & 0x7f];
        bVar10 = (&DAT_1402ff380)[*pbVar2 & 0x7f];
        bVar11 = (&DAT_1402ff380)[*pbVar3 & 0x7f];
        bVar12 = (&DAT_1402ff380)[*pbVar4 & 0x7f];
        bVar13 = (&DAT_1402ff380)[*pbVar5 & 0x7f];
        bVar14 = (&DAT_1402ff380)[*pbVar6 & 0x7f];
        *(byte *)((longlong)pvVar16 + lVar17) = (&DAT_1402ff380)[bVar7 & 0x7f] << 3 | bVar8 >> 2 & 7
        ;
        *(byte *)((longlong)pvVar16 + lVar17 + 1) =
             (bVar9 & 0x1f | bVar8 << 5) * '\x02' | bVar10 >> 4 & 1;
        *(byte *)((longlong)pvVar16 + lVar17 + 2) = bVar11 >> 1 & 0xf | bVar10 << 4;
        *(byte *)((longlong)pvVar16 + lVar17 + 3) =
             (bVar12 & 0x1f | bVar11 << 5) << 2 | bVar13 >> 3 & 3;
        *(byte *)((longlong)pvVar16 + lVar17 + 4) = bVar14 & 0x1f | bVar13 << 5;
        iVar15 = iVar19 + 5;
        if (bVar14 == 0x20) {
          lVar18 = lVar17 + 4;
          iVar15 = iVar19 + 4;
          if (bVar12 == 0x20) {
            lVar18 = lVar17 + 3;
            iVar15 = iVar19 + 3;
            if (bVar11 == 0x20) {
              lVar18 = lVar17 + 2;
              iVar15 = iVar19 + 2;
              if (bVar9 == 0x20) {
                lVar18 = lVar17 + 1;
                iVar15 = iVar19 + 1;
              }
            }
          }
        }
        iVar19 = iVar15;
        if (0x18a < iVar19) {
          FUN_1400b97e0(param_3,pvVar16,iVar19);
          iVar19 = 0;
          lVar18 = 0;
        }
        uVar20 = uVar20 - 1;
        lVar17 = lVar18;
      } while (uVar20 != 0);
      if (iVar19 != 0) {
        FUN_1400b97e0(param_3,pvVar16,iVar19);
      }
    }
    operator_delete(pvVar16);
  }
  return;
}



void FUN_1400f1250(byte *param_1,uint param_2,undefined8 param_3)

{
  void *pvVar1;
  uint uVar2;
  byte bVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  byte bVar6;
  byte bVar7;
  ulonglong uVar8;
  byte bVar9;
  byte bVar10;
  ulonglong uVar11;
  ulonglong uVar12;
  int iVar13;
  longlong lVar14;
  longlong lVar15;
  byte local_res10;
  
  if ((param_2 != 0) && (param_1 != (byte *)0x0)) {
    pvVar1 = operator_new(400);
    iVar13 = 0;
    lVar14 = 0;
    if (param_2 != 0) {
      do {
        uVar2 = 5;
        if (param_2 < 5) {
          uVar2 = param_2;
        }
        uVar11 = 0;
        bVar10 = 0;
        bVar6 = 0;
        bVar9 = 0;
        uVar4 = 0;
        bVar3 = 0;
        uVar12 = 0;
        uVar8 = 0;
        bVar7 = 0;
        uVar5 = 0;
        if (uVar2 == 1) {
LAB_1400f1356:
          uVar11 = (ulonglong)(byte)(bVar10 | (*param_1 & 7) << 2);
          local_res10 = *param_1 >> 3;
        }
        else {
          if (uVar2 == 2) {
LAB_1400f1336:
            bVar10 = param_1[1];
            bVar6 = bVar10 >> 1 & 0x1f;
            bVar9 = bVar9 | (bVar10 & 1) << 4;
            bVar10 = bVar10 >> 6;
            goto LAB_1400f1356;
          }
          if (uVar2 == 3) {
LAB_1400f1323:
            uVar4 = (ulonglong)(byte)(bVar3 | (param_1[2] & 0xf) * '\x02');
            bVar9 = param_1[2] >> 4;
            goto LAB_1400f1336;
          }
          if (uVar2 == 4) {
LAB_1400f1305:
            bVar3 = param_1[3];
            uVar12 = (ulonglong)(bVar3 >> 2 & 0x1f);
            uVar8 = (ulonglong)(byte)(bVar7 | (bVar3 & 3) << 3);
            bVar3 = bVar3 >> 7;
            goto LAB_1400f1323;
          }
          if (uVar2 == 5) {
            uVar5 = (ulonglong)(param_1[4] & 0x1f);
            bVar7 = param_1[4] >> 5;
            goto LAB_1400f1305;
          }
        }
        param_2 = param_2 - uVar2;
        param_1 = param_1 + uVar2;
        if (uVar2 == 1) {
          bVar9 = 0x20;
          bVar6 = 0x20;
LAB_1400f138a:
          uVar4 = 0x20;
LAB_1400f138c:
          uVar8 = 0x20;
          uVar12 = 0x20;
LAB_1400f1393:
          uVar5 = 0x20;
        }
        else {
          if (uVar2 == 2) goto LAB_1400f138a;
          if (uVar2 == 3) goto LAB_1400f138c;
          if (uVar2 == 4) goto LAB_1400f1393;
        }
        iVar13 = iVar13 + 8;
        lVar15 = lVar14 + 8;
        *(char *)(lVar14 + (longlong)pvVar1) = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="[local_res10];
        *(char *)((longlong)pvVar1 + lVar14 + 1) = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="[uVar11];
        *(char *)((longlong)pvVar1 + lVar14 + 2) = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="[bVar6];
        *(char *)((longlong)pvVar1 + lVar14 + 3) = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="[bVar9];
        *(char *)((longlong)pvVar1 + lVar14 + 4) = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="[uVar4];
        *(char *)((longlong)pvVar1 + lVar14 + 5) = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="[uVar12];
        *(char *)((longlong)pvVar1 + lVar14 + 6) = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="[uVar8];
        *(char *)((longlong)pvVar1 + lVar14 + 7) = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="[uVar5];
        if (0x186 < iVar13) {
          FUN_1400bc8a0(param_3);
          iVar13 = 0;
          lVar15 = 0;
        }
        lVar14 = lVar15;
      } while (param_2 != 0);
      if (iVar13 != 0) {
        FUN_1400bc8a0(param_3,pvVar1,iVar13);
      }
    }
    operator_delete(pvVar1);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400f1480(byte *param_1,int param_2,longlong param_3,undefined8 param_4)

{
  byte bVar1;
  byte bVar2;
  byte bVar3;
  int iVar4;
  undefined1 uVar5;
  ulonglong uVar6;
  longlong lVar7;
  longlong lVar8;
  byte *pbVar9;
  int iVar10;
  undefined1 auStack_188 [32];
  undefined1 local_168 [272];
  ulonglong local_58;
  
  if ((param_2 != 0) && (local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_188, param_1 != (byte *)0x0))
  {
    iVar4 = param_2 * 5 + 10;
    iVar4 = (int)(((longlong)iVar4 / 3 + ((longlong)iVar4 >> 0x3f) & 0xffffffffU) >> 0x1f) +
            iVar4 / 3 + (iVar4 >> 0x1f);
    FUN_1400bc530(param_4,iVar4 + 3 + (iVar4 * 2) / param_2,0x3f0);
    iVar10 = 0;
    iVar4 = 0;
    if (0 < param_2 / 3) {
      uVar6 = (ulonglong)(uint)(param_2 / 3);
      lVar7 = 0;
      pbVar9 = param_1;
      do {
        bVar1 = *pbVar9;
        bVar2 = pbVar9[1];
        bVar3 = pbVar9[2];
        iVar4 = iVar4 + 4;
        local_168[lVar7] = *(undefined1 *)(((longlong)(ulonglong)bVar1 >> 2) + param_3);
        iVar10 = iVar10 + 3;
        lVar8 = lVar7 + 4;
        local_168[lVar7 + 1] =
             *(undefined1 *)
              (((longlong)(ulonglong)bVar2 >> 4 | (longlong)(int)((bVar1 & 3) << 4)) + param_3);
        pbVar9 = pbVar9 + 3;
        local_168[lVar7 + 2] =
             *(undefined1 *)
              (((longlong)(int)((bVar2 & 0xf) << 2) | (longlong)(ulonglong)bVar3 >> 6) + param_3);
        local_168[lVar7 + 3] = *(undefined1 *)((ulonglong)(bVar3 & 0x3f) + param_3);
        if (0xff < iVar4) {
          FUN_1400bc8a0(param_4,local_168,iVar4);
          iVar4 = 0;
          lVar8 = 0;
        }
        uVar6 = uVar6 - 1;
        lVar7 = lVar8;
      } while (uVar6 != 0);
      if (iVar4 != 0) {
        FUN_1400bc8a0(param_4,local_168,iVar4);
      }
    }
    if (param_2 % 3 == 1) {
      bVar1 = param_1[iVar10];
      FUN_1400bbe50(param_4,*(undefined1 *)(((longlong)(ulonglong)bVar1 >> 2) + param_3));
      FUN_1400bbe50(param_4,*(undefined1 *)((int)((bVar1 & 3) << 4) + param_3));
      uVar5 = 0x3d;
    }
    else {
      if (param_2 % 3 != 2) {
        return;
      }
      bVar1 = param_1[iVar10];
      bVar2 = param_1[(longlong)iVar10 + 1];
      FUN_1400bbe50(param_4,*(undefined1 *)(((longlong)(ulonglong)bVar1 >> 2) + param_3));
      FUN_1400bbe50(param_4,*(undefined1 *)
                             (((longlong)(ulonglong)(uint)bVar2 >> 4 |
                              (longlong)(int)((bVar1 & 3) << 4)) + param_3));
      uVar5 = *(undefined1 *)((int)((bVar2 & 0xf) << 2) + param_3);
    }
    FUN_1400bbe50(param_4,uVar5);
    FUN_1400bbe50(param_4,0x3d);
  }
  return;
}



byte * FUN_1400f16e0(undefined8 param_1,longlong param_2,int param_3,int *param_4,
                    undefined1 *param_5)

{
  char cVar1;
  byte *pbVar2;
  uint uVar3;
  byte bVar4;
  int iVar5;
  ulonglong uVar6;
  byte *pbVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  
  *param_5 = 0;
  if (param_4 == (int *)0x0) {
    return (byte *)0x0;
  }
  uVar6 = 0;
  iVar5 = 0;
  *param_4 = 0;
  if ((param_3 == 0) || (param_2 == 0)) {
    *param_5 = 1;
    pbVar2 = (byte *)0x0;
  }
  else {
    pbVar2 = operator_new((longlong)(((int)(param_3 * 3 + (param_3 * 3 >> 0x1f & 3U)) >> 2) + 4));
    if (pbVar2 != (byte *)0x0) {
      pbVar7 = pbVar2;
      uVar8 = uVar6;
      uVar9 = uVar6;
      if (0 < param_3) {
        do {
          iVar5 = (int)uVar8;
          cVar1 = *(char *)(uVar9 + param_2);
          if ((cVar1 == '=') || (cVar1 == '\0')) break;
          if (((cVar1 != '\r') && (((cVar1 != '\n' && (cVar1 != '\t')) && (cVar1 != ' ')))) &&
             ((int)cVar1 - 0x2bU < 0x50)) {
            uVar3 = (uint)uVar6 & 0x80000003;
            bVar4 = (&DAT_1402ff330)[(int)((int)cVar1 - 0x2bU)];
            if ((int)uVar3 < 0) {
              uVar3 = (uVar3 - 1 | 0xfffffffc) + 1;
            }
            if (uVar3 == 0) {
              bVar4 = bVar4 << 2;
LAB_1400f1824:
              *pbVar7 = bVar4;
            }
            else {
              if (uVar3 == 1) {
                uVar8 = (ulonglong)(iVar5 + 1);
                *pbVar7 = *pbVar7 | (char)bVar4 >> 4;
                bVar4 = bVar4 << 4;
                pbVar7 = pbVar7 + 1;
                goto LAB_1400f1824;
              }
              if (uVar3 == 2) {
                uVar8 = (ulonglong)(iVar5 + 1);
                *pbVar7 = *pbVar7 | (char)bVar4 >> 2;
                bVar4 = bVar4 << 6;
                pbVar7 = pbVar7 + 1;
                goto LAB_1400f1824;
              }
              if (uVar3 == 3) {
                *pbVar7 = *pbVar7 | bVar4;
                uVar8 = (ulonglong)(iVar5 + 1);
                pbVar7 = pbVar7 + 1;
              }
            }
            uVar6 = (ulonglong)((uint)uVar6 + 1);
          }
          iVar5 = (int)uVar8;
          uVar9 = uVar9 + 1;
        } while ((longlong)uVar9 < (longlong)param_3);
      }
      *param_4 = iVar5;
      pbVar2[(longlong)iVar5 + 1] = 0;
      *param_5 = 1;
    }
  }
  return pbVar2;
}



byte * FUN_1400f1860(longlong param_1,int param_2,int *param_3)

{
  char cVar1;
  byte *pbVar2;
  uint uVar3;
  byte bVar4;
  int iVar5;
  ulonglong uVar6;
  byte *pbVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  
  if (param_3 == (int *)0x0) {
    return (byte *)0x0;
  }
  uVar6 = 0;
  iVar5 = 0;
  *param_3 = 0;
  if ((param_2 == 0) || (param_1 == 0)) {
    pbVar2 = (byte *)0x0;
  }
  else {
    pbVar2 = operator_new((longlong)(((int)(param_2 * 3 + (param_2 * 3 >> 0x1f & 3U)) >> 2) + 8));
    if (pbVar2 != (byte *)0x0) {
      pbVar7 = pbVar2;
      uVar8 = uVar6;
      uVar9 = uVar6;
      if (0 < param_2) {
        do {
          iVar5 = (int)uVar8;
          cVar1 = *(char *)(uVar9 + param_1);
          if ((cVar1 == '=') || (cVar1 == '\0')) break;
          if (((cVar1 != '\r') && (((cVar1 != '\n' && (cVar1 != '\t')) && (cVar1 != ' ')))) &&
             ((int)cVar1 - 0x2bU < 0x50)) {
            uVar3 = (uint)uVar6 & 0x80000003;
            bVar4 = (&DAT_1402ff330)[(int)((int)cVar1 - 0x2bU)];
            if ((int)uVar3 < 0) {
              uVar3 = (uVar3 - 1 | 0xfffffffc) + 1;
            }
            if (uVar3 == 0) {
              bVar4 = bVar4 << 2;
LAB_1400f1993:
              *pbVar7 = bVar4;
            }
            else {
              if (uVar3 == 1) {
                uVar8 = (ulonglong)(iVar5 + 1);
                *pbVar7 = *pbVar7 | (char)bVar4 >> 4;
                bVar4 = bVar4 << 4;
                pbVar7 = pbVar7 + 1;
                goto LAB_1400f1993;
              }
              if (uVar3 == 2) {
                uVar8 = (ulonglong)(iVar5 + 1);
                *pbVar7 = *pbVar7 | (char)bVar4 >> 2;
                bVar4 = bVar4 << 6;
                pbVar7 = pbVar7 + 1;
                goto LAB_1400f1993;
              }
              if (uVar3 == 3) {
                *pbVar7 = *pbVar7 | bVar4;
                uVar8 = (ulonglong)(iVar5 + 1);
                pbVar7 = pbVar7 + 1;
              }
            }
            uVar6 = (ulonglong)((uint)uVar6 + 1);
          }
          iVar5 = (int)uVar8;
          uVar9 = uVar9 + 1;
        } while ((longlong)uVar9 < (longlong)param_2);
      }
      *param_3 = iVar5;
      pbVar2[(longlong)iVar5 + 1] = 0;
    }
  }
  return pbVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400f19c0(undefined8 param_1,char *param_2,uint param_3,undefined8 param_4)

{
  char cVar1;
  bool bVar2;
  byte bVar3;
  uint uVar4;
  uint uVar5;
  byte *pbVar6;
  longlong lVar7;
  uint uVar8;
  char *pcVar9;
  char *pcVar10;
  longlong lVar11;
  uint uVar12;
  uint uVar13;
  ulonglong uVar14;
  longlong lVar15;
  longlong lVar16;
  undefined1 auStack_858 [32];
  char local_838;
  char local_837;
  undefined8 local_830;
  uint local_828;
  uint local_824;
  char *local_820;
  char *local_818;
  ulonglong local_810;
  byte local_808 [2000];
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_858;
  if ((param_3 != 0) && (param_2 != (char *)0x0)) {
    uVar14 = 0;
    pcVar10 = param_2;
    local_824 = param_3;
    uVar4 = 0;
    if (param_3 != 0) {
      do {
        local_824 = uVar4;
        if (*pcVar10 == '\0') break;
        uVar4 = local_824 + 1;
        pcVar10 = pcVar10 + 1;
        local_824 = param_3;
      } while (uVar4 < param_3);
    }
    if (local_824 != 0) {
      local_828 = 0;
      local_830 = param_4;
      local_820 = param_2;
      uVar4 = local_824;
      if (local_824 != 0) {
        do {
          local_837 = '\0';
          pcVar9 = local_820 + local_828;
          cVar1 = *pcVar9;
          pcVar10 = pcVar9;
          uVar5 = local_828;
          while (cVar1 != '\n') {
            if (uVar4 == uVar5) {
              if (*pcVar10 != '\n') goto LAB_1400f1ab4;
              break;
            }
            pcVar10 = pcVar10 + 1;
            uVar5 = uVar5 + 1;
            cVar1 = *pcVar10;
          }
          local_837 = '\x01';
LAB_1400f1ab4:
          uVar5 = (int)pcVar10 - (int)pcVar9;
          uVar8 = uVar5 + 1;
          local_810 = (ulonglong)uVar8;
          if (uVar5 != 0) {
            pbVar6 = (byte *)(local_820 + (longlong)(int)uVar5 + (longlong)(int)local_828 + -1);
            do {
              bVar3 = *pbVar6 & 0x7f;
              if ((((bVar3 != 10) && (bVar3 != 0xd)) && (bVar3 != 0x20)) && (bVar3 != 9)) break;
              pbVar6 = pbVar6 + -1;
              uVar5 = uVar5 - 1;
            } while (uVar5 != 0);
          }
          uVar12 = 0;
          lVar7 = 0;
          local_838 = '\0';
          if (uVar5 != 0) {
            lVar11 = (longlong)(int)local_828;
            local_818 = local_820 + lVar11;
            lVar15 = (longlong)(int)uVar14;
            do {
              if ((local_818[lVar7] & 0x7fU) == 0x3d) {
                if (uVar12 == uVar5 - 1) {
                  local_838 = '\x01';
                  lVar16 = lVar15;
                }
                else {
                  bVar2 = false;
                  uVar8 = (int)local_820[lVar7 + lVar11 + 1] & 0x7f;
                  uVar4 = uVar8 - 0x30;
                  if (9 < uVar4) {
                    if (uVar8 - 0x41 < 6) {
                      uVar4 = uVar8 - 0x37;
                    }
                    else if (uVar8 - 0x61 < 6) {
                      uVar4 = uVar8 - 0x57;
                    }
                    else {
                      bVar2 = true;
                      uVar4 = 0;
                    }
                  }
                  uVar13 = (int)local_820[lVar7 + lVar11 + 2] & 0x7f;
                  uVar8 = uVar13 - 0x30;
                  if (9 < uVar8) {
                    if (uVar13 - 0x41 < 6) {
                      uVar8 = uVar13 - 0x37;
                    }
                    else if (uVar13 - 0x61 < 6) {
                      uVar8 = uVar13 - 0x57;
                    }
                    else {
                      bVar2 = true;
                      uVar8 = 0;
                    }
                  }
                  if ((uVar4 == 0xf) && (uVar8 == 0xf)) {
                    param_4 = local_830;
                    if ((((local_820[lVar7 + lVar11 + 3] & 0x7fU) == 0x46) &&
                        (((local_820[lVar7 + lVar11 + 4] & 0x7fU) == 0x46 &&
                         ((local_820[lVar7 + lVar11 + 5] & 0x7fU) == 0x46)))) &&
                       ((local_820[lVar7 + lVar11 + 6] & 0x7fU) == 0x46)) {
                      lVar16 = lVar7 + lVar11 + 7;
                      lVar7 = lVar7 + 6;
                      uVar12 = uVar12 + 6;
                      uVar8 = (int)local_820[lVar16] & 0x7f;
                      uVar4 = uVar8 - 0x30;
                      if (9 < uVar4) {
                        if (uVar8 - 0x41 < 6) {
                          uVar4 = uVar8 - 0x37;
                        }
                        else if (uVar8 - 0x61 < 6) {
                          uVar4 = uVar8 - 0x57;
                        }
                        else {
                          uVar4 = 0;
                        }
                      }
                      uVar13 = (int)local_820[lVar7 + lVar11 + 2] & 0x7f;
                      uVar8 = uVar13 - 0x30;
                      if (9 < uVar8) {
                        if (uVar13 - 0x41 < 6) {
                          uVar8 = uVar13 - 0x37;
                        }
                        else if (uVar13 - 0x61 < 6) {
                          uVar8 = uVar13 - 0x57;
                        }
                        else {
                          uVar8 = 0;
                        }
                      }
                    }
                  }
                  uVar13 = (int)uVar14 + 1;
                  uVar14 = (ulonglong)uVar13;
                  if (bVar2) {
                    local_808[lVar15] = local_818[lVar7];
                    goto LAB_1400f1cee;
                  }
                  lVar16 = lVar15 + 1;
                  local_808[lVar15] = (char)uVar4 * '\x10' + (char)uVar8;
                  if (uVar13 == 2000) {
                    FUN_1400b97e0(param_4,local_808,2000);
                    uVar14 = 0;
                    lVar16 = 0;
                  }
                  uVar12 = uVar12 + 2;
                  lVar7 = lVar7 + 2;
                }
              }
              else {
                local_808[lVar15] = local_818[lVar7];
                uVar14 = (ulonglong)((int)uVar14 + 1);
LAB_1400f1cee:
                lVar16 = lVar15 + 1;
                if ((int)uVar14 == 2000) {
                  FUN_1400b97e0(param_4,local_808,uVar14);
                  uVar14 = 0;
                  lVar16 = 0;
                }
              }
              uVar12 = uVar12 + 1;
              lVar7 = lVar7 + 1;
              lVar15 = lVar16;
            } while (uVar12 < uVar5);
            uVar8 = (uint)local_810;
            uVar4 = local_824;
          }
          uVar5 = local_828;
          if ((local_837 != '\0') && (local_838 == '\0')) {
            local_808[uVar14] = 0xd;
            uVar12 = (int)uVar14 + 1;
            uVar14 = (ulonglong)uVar12;
            if (uVar12 == 2000) {
              FUN_1400b97e0(param_4,local_808,2000);
              uVar14 = 0;
            }
            local_808[uVar14] = 10;
            uVar12 = (int)uVar14 + 1;
            uVar14 = (ulonglong)uVar12;
            if (uVar12 == 2000) {
              FUN_1400b97e0(param_4,local_808,2000);
              uVar14 = 0;
            }
          }
          local_828 = uVar5 + uVar8;
        } while (local_828 < uVar4);
        if ((int)uVar14 != 0) {
          FUN_1400b97e0(param_4,local_808,uVar14);
        }
      }
      return 1;
    }
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400f1e10(undefined8 param_1,longlong param_2,int param_3,undefined4 *param_4)

{
  byte bVar1;
  undefined8 uVar2;
  uint uVar3;
  longlong lVar4;
  int iVar5;
  int iVar6;
  undefined1 auStack_858 [32];
  undefined1 local_838 [48];
  undefined8 local_808;
  byte local_7f8 [2000];
  ulonglong local_28;
  
  local_808 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_858;
  if (param_4 != (undefined4 *)0x0) {
    *param_4 = 0;
  }
  if (((param_3 == 0) || (param_2 == 0)) || (param_4 == (undefined4 *)0x0)) {
    uVar2 = 0;
  }
  else {
    FUN_1400bce20(local_838,3000);
    iVar6 = 0;
    lVar4 = 0;
    if (0 < param_3) {
      do {
        bVar1 = *(byte *)(lVar4 + param_2);
        if ((((bVar1 < 0x21) || (0x3c < bVar1)) &&
            ((uVar3 = (uint)bVar1, uVar3 != 0x3e && ((uVar3 < 0x40 || (0x5e < bVar1)))))) &&
           ((bVar1 < 0x60 || (0x7e < bVar1)))) {
          iVar5 = iVar6 + 1;
          if (bVar1 != 0x20) {
            local_7f8[iVar6] = 0x3d;
            if (iVar5 == 2000) {
              FUN_1400bc8a0(local_838,local_7f8);
              iVar5 = 0;
            }
            local_7f8[iVar5] = s_0123456789ABCDEF_1402ff400[(longlong)(ulonglong)bVar1 >> 4];
            iVar6 = iVar5 + 1;
            if (iVar6 == 2000) {
              FUN_1400bc8a0(local_838,local_7f8);
              iVar6 = 0;
            }
            local_7f8[iVar6] = s_0123456789ABCDEF_1402ff400[uVar3 & 0xf];
            goto LAB_1400f1f51;
          }
          local_7f8[iVar6] = 0x5f;
          iVar6 = iVar5;
        }
        else {
          local_7f8[iVar6] = bVar1;
LAB_1400f1f51:
          iVar6 = iVar6 + 1;
        }
        if (iVar6 == 2000) {
          FUN_1400bc8a0(local_838,local_7f8);
          iVar6 = 0;
        }
        lVar4 = lVar4 + 1;
      } while (lVar4 < param_3);
      if (iVar6 != 0) {
        FUN_1400bc8a0(local_838,local_7f8);
      }
    }
    uVar2 = FUN_1400bcf20(local_838,param_4);
    FUN_1400bceb0(local_838);
  }
  return uVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1400f1fe0(undefined8 param_1,longlong param_2,int param_3,undefined4 *param_4)

{
  byte bVar1;
  undefined8 uVar2;
  uint uVar3;
  longlong lVar4;
  int iVar5;
  int iVar6;
  undefined1 auStack_868 [32];
  undefined1 local_848 [48];
  undefined8 local_818;
  byte local_808 [2000];
  ulonglong local_38;
  
  local_818 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_868;
  if (param_4 != (undefined4 *)0x0) {
    *param_4 = 0;
  }
  if (((param_3 == 0) || (param_2 == 0)) || (param_4 == (undefined4 *)0x0)) {
    uVar2 = 0;
  }
  else {
    FUN_1400bce20(local_848,3000);
    iVar5 = 0;
    lVar4 = 0;
    if (0 < param_3) {
      do {
        bVar1 = *(byte *)(lVar4 + param_2);
        if (bVar1 == 0x2c) {
          local_808[iVar5] = 0x3d;
          iVar5 = iVar5 + 1;
          if (iVar5 == 2000) {
            FUN_1400bc8a0(local_848,local_808);
            iVar5 = 0;
          }
          local_808[iVar5] = 0x32;
          iVar5 = iVar5 + 1;
          if (iVar5 == 2000) {
            FUN_1400bc8a0(local_848,local_808);
            iVar5 = 0;
          }
          local_808[iVar5] = 0x43;
LAB_1400f2182:
          iVar5 = iVar5 + 1;
        }
        else {
          uVar3 = (uint)bVar1;
          if ((((0x20 < bVar1) && (bVar1 < 0x3d)) ||
              ((uVar3 == 0x3e || ((0x3f < bVar1 && (bVar1 < 0x5f)))))) ||
             ((0x5f < bVar1 && (bVar1 < 0x7f)))) {
            local_808[iVar5] = bVar1;
            goto LAB_1400f2182;
          }
          iVar6 = iVar5 + 1;
          if (uVar3 != 0x20) {
            local_808[iVar5] = 0x3d;
            if (iVar6 == 2000) {
              FUN_1400bc8a0(local_848,local_808);
              iVar6 = 0;
            }
            local_808[iVar6] = s_0123456789ABCDEF_1402ff400[(longlong)(ulonglong)bVar1 >> 4];
            iVar5 = iVar6 + 1;
            if (iVar5 == 2000) {
              FUN_1400bc8a0(local_848,local_808);
              iVar5 = 0;
            }
            local_808[iVar5] = s_0123456789ABCDEF_1402ff400[uVar3 & 0xf];
            goto LAB_1400f2182;
          }
          local_808[iVar5] = 0x5f;
          iVar5 = iVar6;
        }
        if (iVar5 == 2000) {
          FUN_1400bc8a0(local_848,local_808);
          iVar5 = 0;
        }
        lVar4 = lVar4 + 1;
      } while (lVar4 < param_3);
      if (iVar5 != 0) {
        FUN_1400bc8a0(local_848,local_808);
      }
    }
    uVar2 = FUN_1400bcf20(local_848,param_4);
    FUN_1400bceb0(local_848);
  }
  return uVar2;
}



char * FUN_1400f2210(undefined8 param_1,byte *param_2,int param_3,int *param_4)

{
  byte bVar1;
  byte bVar2;
  byte bVar3;
  char *pcVar4;
  int iVar5;
  int iVar6;
  char *pcVar7;
  byte *pbVar8;
  ulonglong uVar9;
  
  if (param_4 == (int *)0x0) {
    return (char *)0x0;
  }
  iVar6 = 0;
  *param_4 = 0;
  if ((param_3 == 0) || (param_2 == (byte *)0x0)) {
    return (char *)0x0;
  }
  iVar5 = param_3 * 5;
  iVar5 = iVar5 / 3 + (iVar5 >> 0x1f) + 4 +
          (int)(((longlong)iVar5 / 3 + ((longlong)iVar5 >> 0x3f) & 0xffffffffU) >> 0x1f);
  *param_4 = iVar5;
  pcVar4 = operator_new((longlong)iVar5);
  if (pcVar4 == (char *)0x0) {
    return (char *)0x0;
  }
  iVar5 = 0;
  if (0 < param_3 / 3) {
    uVar9 = (ulonglong)(uint)(param_3 / 3);
    pcVar7 = pcVar4;
    pbVar8 = param_2;
    do {
      bVar1 = *pbVar8;
      bVar2 = pbVar8[1];
      bVar3 = pbVar8[2];
      *pcVar7 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
                [(longlong)(ulonglong)bVar1 >> 2];
      iVar6 = iVar6 + 3;
      pbVar8 = pbVar8 + 3;
      pcVar7[1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
                  [(longlong)(ulonglong)bVar2 >> 4 | (longlong)(int)((bVar1 & 3) << 4)];
      iVar5 = iVar5 + 4;
      uVar9 = uVar9 - 1;
      pcVar7[2] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
                  [(longlong)(int)((bVar2 & 0xf) << 2) | (longlong)(ulonglong)bVar3 >> 6];
      pcVar7[3] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[bVar3 & 0x3f];
      pcVar7 = pcVar7 + 4;
    } while (uVar9 != 0);
  }
  if (param_3 % 3 == 1) {
    bVar1 = param_2[iVar6];
    pcVar4[iVar5] =
         "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
         [(longlong)(ulonglong)bVar1 >> 2];
    pcVar4[iVar5 + 1] =
         "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(int)((bVar1 & 3) << 4)]
    ;
    pcVar4[iVar5 + 2] = '=';
  }
  else {
    if (param_3 % 3 != 2) goto LAB_1400f2420;
    bVar1 = param_2[(longlong)iVar6 + 1];
    bVar2 = param_2[iVar6];
    pcVar4[iVar5] =
         "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
         [(longlong)(ulonglong)bVar2 >> 2];
    pcVar4[iVar5 + 1] =
         "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
         [(longlong)(ulonglong)bVar1 >> 4 | (longlong)(int)((bVar2 & 3) << 4)];
    pcVar4[iVar5 + 2] =
         "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
         [(int)((bVar1 & 0xf) << 2)];
  }
  iVar6 = iVar5 + 3;
  iVar5 = iVar5 + 4;
  pcVar4[iVar6] = '=';
LAB_1400f2420:
  pcVar4[iVar5] = '\0';
  *param_4 = iVar5;
  return pcVar4;
}



void * FUN_1400f2460(char *param_1,int param_2,int *param_3)

{
  byte bVar1;
  void *pvVar2;
  char cVar3;
  byte bVar4;
  uint uVar5;
  longlong lVar6;
  char cVar7;
  uint uVar8;
  int iVar9;
  ulonglong uVar10;
  char *pcVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  int iVar14;
  int iVar15;
  
  if (param_1 == (char *)0x0) {
    return (void *)0x0;
  }
  uVar10 = 0;
  iVar15 = 0;
  if (param_2 < 1) {
    lVar6 = -1;
    pcVar11 = param_1;
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      cVar3 = *pcVar11;
      pcVar11 = pcVar11 + 1;
    } while (cVar3 != '\0');
    param_2 = ~(uint)lVar6 - 1;
  }
  if ((param_2 == 0) || (pvVar2 = operator_new((longlong)(param_2 + 1)), pvVar2 == (void *)0x0)) {
    pvVar2 = (void *)0x0;
  }
  else {
    if (0 < param_2) {
      iVar14 = 1;
      uVar12 = uVar10;
      do {
        bVar4 = param_1[uVar12];
        iVar15 = iVar14 + 1;
        uVar13 = uVar12 + 1;
        iVar9 = (int)uVar10;
        if ((((bVar4 < 0x21) || (0x3c < bVar4)) && (bVar4 != 0x3e)) &&
           ((((bVar4 < 0x40 || (0x5e < bVar4)) && ((bVar4 < 0x60 || (0x7e < bVar4)))) &&
            (bVar4 < 0xa0)))) {
          if (bVar4 == 0x5f) {
            *(undefined1 *)((longlong)iVar9 + (longlong)pvVar2) = 0x20;
            goto LAB_1400f25c5;
          }
          if (bVar4 == 0x20) {
            *(undefined1 *)((longlong)iVar9 + (longlong)pvVar2) = 0x20;
            goto LAB_1400f25c5;
          }
          if (bVar4 == 0x3d) {
            if (iVar15 < param_2) {
              bVar4 = param_1[uVar13];
              uVar5 = (uint)bVar4;
              bVar1 = param_1[uVar12 + 2];
              uVar8 = (uint)bVar1;
              if (bVar4 - 0x61 < 6) {
                uVar5 = bVar4 - 0x20;
              }
              if (bVar1 - 0x61 < 6) {
                uVar8 = bVar1 - 0x20;
              }
              if (uVar5 - 0x30 < 10) {
                cVar3 = (char)(uVar5 - 0x30);
              }
              else {
                if (5 < uVar5 - 0x41) goto LAB_1400f25fe;
                cVar3 = (char)uVar5 + -0x37;
              }
              if (uVar8 - 0x30 < 10) {
                cVar7 = (char)(uVar8 - 0x30);
              }
              else {
                if (5 < uVar8 - 0x41) goto LAB_1400f25fe;
                cVar7 = (char)uVar8 + -0x37;
              }
              iVar15 = iVar14 + 3;
              uVar13 = uVar12 + 3;
              bVar4 = cVar3 * '\x10' + cVar7;
              goto LAB_1400f25bf;
            }
LAB_1400f25fe:
            *(undefined1 *)((longlong)iVar9 + (longlong)pvVar2) = 0x3d;
            goto LAB_1400f25c5;
          }
        }
        else {
LAB_1400f25bf:
          *(byte *)((longlong)iVar9 + (longlong)pvVar2) = bVar4;
LAB_1400f25c5:
          uVar10 = (ulonglong)(iVar9 + 1);
        }
        iVar14 = iVar15;
        iVar15 = (int)uVar10;
        uVar12 = uVar13;
      } while ((longlong)uVar13 < (longlong)param_2);
    }
    *(undefined1 *)((longlong)iVar15 + (longlong)pvVar2) = 0;
    if (param_3 != (int *)0x0) {
      *param_3 = iVar15;
    }
  }
  return pvVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400f2610(longlong param_1,longlong param_2,uint param_3,undefined8 param_4)

{
  byte bVar1;
  longlong lVar2;
  ulonglong uVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  ulonglong uVar8;
  longlong lVar9;
  int iVar10;
  int iVar11;
  int iVar12;
  undefined1 auStack_848 [32];
  int local_828;
  uint local_824;
  byte local_818 [2000];
  ulonglong local_48;
  
  if ((param_3 != 0) && (local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_848, param_2 != 0)) {
    local_824 = param_3;
    FUN_1400bc530(param_4,param_3);
    uVar3 = (ulonglong)(int)local_824;
    iVar4 = *(int *)(param_1 + 8) + -1;
    iVar5 = 0;
    iVar7 = 0;
    iVar6 = 0;
    if (0 < (int)local_824) {
      iVar11 = 3;
      uVar8 = uVar3;
      lVar2 = 0;
      local_828 = iVar4;
      do {
        bVar1 = *(byte *)(lVar2 + param_2);
        lVar9 = lVar2 + 1;
        iVar10 = iVar5 + 1;
        iVar12 = iVar11 + 1;
        if (iVar7 == 0) {
          if (bVar1 == 0x2e) {
            iVar4 = iVar6 + 1;
            local_818[iVar6] = 0x3d;
            if (iVar4 == 2000) {
              FUN_1400bc8a0(param_4,local_818);
              iVar4 = 0;
            }
            iVar5 = iVar4 + 1;
            local_818[iVar4] = s_0123456789ABCDEF_1402ff400[2];
            bVar1 = s_0123456789ABCDEF_1402ff400[0xe];
            if (iVar5 == 2000) {
              FUN_1400bc8a0(param_4,local_818);
              iVar5 = 0;
              bVar1 = s_0123456789ABCDEF_1402ff400[0xe];
            }
LAB_1400f2724:
            iVar6 = iVar5 + 1;
            local_818[iVar5] = bVar1;
            if (iVar6 == 2000) {
              FUN_1400bc8a0(param_4,local_818);
              iVar6 = 0;
            }
            iVar7 = 3;
            iVar4 = local_828;
            iVar5 = iVar10;
            iVar11 = iVar12;
            goto LAB_1400f2a9b;
          }
          if (bVar1 != 0x46) goto LAB_1400f27ec;
          if (((iVar12 < (int)uVar3) && (*(char *)(lVar9 + param_2) == 'r')) &&
             ((*(char *)(lVar2 + 2 + param_2) == 'o' &&
              ((*(char *)(lVar2 + 3 + param_2) == 'm' && (*(char *)(lVar2 + 4 + param_2) == ' ')))))
             ) {
            iVar4 = iVar6 + 1;
            local_818[iVar6] = 0x3d;
            if (iVar4 == 2000) {
              FUN_1400bc8a0(param_4,local_818);
              iVar4 = 0;
            }
            iVar5 = iVar4 + 1;
            local_818[iVar4] = s_0123456789ABCDEF_1402ff400[4];
            bVar1 = s_0123456789ABCDEF_1402ff400[6];
            if (iVar5 == 2000) {
              FUN_1400bc8a0(param_4,local_818);
              iVar5 = 0;
              bVar1 = s_0123456789ABCDEF_1402ff400[6];
            }
            goto LAB_1400f2724;
          }
LAB_1400f2957:
          lVar2 = (longlong)iVar6;
          iVar6 = iVar6 + 1;
          local_818[lVar2] = bVar1;
          if (iVar6 == 2000) {
            FUN_1400bc8a0(param_4,local_818);
            iVar6 = 0;
            iVar4 = local_828;
          }
          iVar7 = iVar7 + 1;
          iVar5 = iVar10;
          iVar11 = iVar12;
        }
        else {
LAB_1400f27ec:
          if (((0x3d < bVar1) && (bVar1 < 0x7f)) || (bVar1 - 0x21 < 0x1c)) goto LAB_1400f2957;
          if ((bVar1 == 0x20) || (bVar1 == 9)) {
            if ((lVar9 < (longlong)uVar8) &&
               ((((int)uVar3 + -1 <= iVar10 || (*(char *)(lVar9 + param_2) != '\r')) ||
                (*(char *)(lVar2 + 2 + param_2) != '\n')))) goto LAB_1400f2957;
            if (iVar4 + -2 <= iVar7) {
              iVar4 = iVar6 + 1;
              local_818[iVar6] = 0x3d;
              if (iVar4 == 2000) {
                FUN_1400bc8a0(param_4,local_818);
                iVar4 = 0;
              }
              iVar5 = iVar4 + 1;
              local_818[iVar4] = 0xd;
              if (iVar5 == 2000) {
                FUN_1400bc8a0(param_4,local_818);
                iVar5 = 0;
              }
              iVar6 = iVar5 + 1;
              local_818[iVar5] = 10;
              if (iVar6 == 2000) {
                FUN_1400bc8a0(param_4,local_818);
                iVar6 = 0;
              }
              iVar7 = 0;
            }
            iVar4 = iVar6 + 1;
            local_818[iVar6] = 0x3d;
            if (iVar4 == 2000) {
              FUN_1400bc8a0(param_4,local_818);
              iVar4 = 0;
            }
LAB_1400f2a1f:
            iVar5 = iVar4 + 1;
            local_818[iVar4] = s_0123456789ABCDEF_1402ff400[(uint)((int)(uint)bVar1 >> 4)];
            if (iVar5 == 2000) {
              FUN_1400bc8a0(param_4,local_818);
              iVar5 = 0;
            }
            iVar6 = iVar5 + 1;
            local_818[iVar5] = s_0123456789ABCDEF_1402ff400[bVar1 & 0xf];
            if (iVar6 == 2000) {
              FUN_1400bc8a0(param_4,local_818);
              iVar6 = 0;
            }
            iVar7 = iVar7 + 3;
            iVar4 = local_828;
            iVar5 = iVar10;
            iVar11 = iVar12;
          }
          else if ((lVar9 < (longlong)uVar8) &&
                  ((bVar1 == 0xd && (*(char *)(lVar9 + param_2) == '\n')))) {
            iVar4 = iVar6 + 1;
            lVar9 = lVar2 + 2;
            local_818[iVar6] = 0xd;
            if (iVar4 == 2000) {
              FUN_1400bc8a0(param_4,local_818);
              iVar4 = 0;
            }
            iVar6 = iVar4 + 1;
            local_818[iVar4] = 10;
            if (iVar6 == 2000) {
              FUN_1400bc8a0(param_4,local_818);
              iVar6 = 0;
            }
            iVar7 = 0;
            iVar4 = local_828;
            iVar5 = iVar5 + 2;
            iVar11 = iVar11 + 2;
          }
          else if (((((char)bVar1 < '\0') || ((bVar1 & 0xe0) == 0)) || (bVar1 == 0x7f)) ||
                  (iVar5 = iVar10, iVar11 = iVar12, bVar1 == 0x3d)) {
            if (iVar4 + -2 <= iVar7) {
              iVar4 = iVar6 + 1;
              local_818[iVar6] = 0x3d;
              if (iVar4 == 2000) {
                FUN_1400bc8a0(param_4,local_818);
                iVar4 = 0;
              }
              iVar5 = iVar4 + 1;
              local_818[iVar4] = 0xd;
              if (iVar5 == 2000) {
                FUN_1400bc8a0(param_4,local_818);
                iVar5 = 0;
              }
              iVar6 = iVar5 + 1;
              local_818[iVar5] = 10;
              if (iVar6 == 2000) {
                FUN_1400bc8a0(param_4,local_818);
                iVar6 = 0;
              }
              iVar7 = 0;
            }
            iVar4 = iVar6 + 1;
            local_818[iVar6] = 0x3d;
            if (iVar4 == 2000) {
              FUN_1400bc8a0(param_4,local_818);
              iVar4 = 0;
            }
            goto LAB_1400f2a1f;
          }
        }
LAB_1400f2a9b:
        uVar3 = (ulonglong)local_824;
        if ((iVar4 <= iVar7) &&
           ((((int)(local_824 - 1) <= iVar5 || (*(char *)(lVar9 + param_2) != '\r')) ||
            (*(char *)(lVar9 + 1 + param_2) != '\n')))) {
          iVar4 = iVar6 + 1;
          local_818[iVar6] = 0x3d;
          if (iVar4 == 2000) {
            FUN_1400bc8a0(param_4,local_818);
            iVar4 = 0;
          }
          iVar7 = iVar4 + 1;
          local_818[iVar4] = 0xd;
          if (iVar7 == 2000) {
            FUN_1400bc8a0(param_4,local_818);
            iVar7 = 0;
          }
          iVar6 = iVar7 + 1;
          local_818[iVar7] = 10;
          if (iVar6 == 2000) {
            FUN_1400bc8a0(param_4,local_818);
            iVar6 = 0;
          }
          uVar3 = (ulonglong)local_824;
          iVar7 = 0;
          iVar4 = local_828;
        }
        uVar8 = (ulonglong)(int)uVar3;
        lVar2 = lVar9;
      } while (lVar9 < (longlong)uVar8);
      if (iVar6 != 0) {
        FUN_1400bc8a0(param_4,local_818);
      }
    }
  }
  return;
}



void FUN_1400f2b90(undefined8 param_1,longlong param_2,int param_3,longlong param_4,
                  undefined8 param_5)

{
  void *pvVar1;
  
  if (((param_2 != 0) && (param_4 != 0)) && (param_3 != 0)) {
    pvVar1 = (void *)FUN_1400f2210();
    FUN_1400bc640(param_5,&DAT_1402455ac);
    FUN_1400bc640(param_5,param_4);
    FUN_1400bc640(param_5,&DAT_1402455b0);
    FUN_1400bc640(param_5,pvVar1);
    FUN_1400bc640(param_5,&DAT_1402455a4);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_1400f2c30(longlong param_1,int param_2)

{
  int iVar1;
  
  iVar1 = 10;
  if (10 < param_2) {
    iVar1 = param_2;
  }
  *(int *)(param_1 + 8) = iVar1;
  return;
}



void FUN_1400f2c40(longlong param_1,longlong param_2,int param_3,char *param_4,undefined8 param_5)

{
  void *pvVar1;
  char *pcVar2;
  undefined1 local_res10 [8];
  undefined **local_20;
  undefined4 local_18;
  undefined1 local_14;
  
  if ((param_2 != 0) && (param_3 != 0)) {
    pcVar2 = "utf-8";
    if ((param_4 != (char *)0x0) && (*param_4 != '\0')) {
      pcVar2 = param_4;
    }
    local_20 = ContentCoding::vftable;
    local_18 = 0x4c;
    local_14 = 0;
    if (*(char *)(param_1 + 0xc) == '\0') {
      pvVar1 = (void *)FUN_1400f1e10(&local_20,param_2,param_3,local_res10,0xfffffffffffffffe);
    }
    else {
      pvVar1 = (void *)FUN_1400f1fe0();
    }
    FUN_1400bc640(param_5,&DAT_1402455ac);
    FUN_1400bc640(param_5,pcVar2);
    FUN_1400bc640(param_5,&DAT_1402455a8);
    FUN_1400bc640(param_5,pvVar1);
    FUN_1400bc640(param_5,&DAT_1402455a4);
    operator_delete(pvVar1);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400f2d20(undefined8 param_1,undefined8 param_2)

{
  bool bVar1;
  char cVar2;
  char *pcVar3;
  char *pcVar4;
  void *pvVar5;
  undefined8 uVar6;
  ulonglong uVar7;
  int iVar8;
  char *pcVar9;
  undefined1 auStack_188 [32];
  undefined4 local_168;
  undefined1 *local_160;
  undefined4 local_158 [2];
  undefined1 local_150 [40];
  undefined1 local_128 [48];
  undefined8 local_f8;
  undefined1 local_e8 [192];
  ulonglong local_28;
  
  local_f8 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_188;
  FUN_1400b8c40(local_150);
  pcVar3 = (char *)FUN_1400b8b90(param_2);
  FUN_1400bcc20(local_128);
  pcVar4 = strstr(pcVar3,"=?");
  while (pcVar4 != (char *)0x0) {
    if ((int)pcVar4 != (int)pcVar3) {
      FUN_1400b97e0(local_150,pcVar3);
    }
    pcVar4 = pcVar4 + 2;
    cVar2 = *pcVar4;
    pcVar9 = pcVar4;
    while (cVar2 != '?') {
      if (cVar2 == '\0') goto LAB_1400f2ff7;
      pcVar9 = pcVar9 + 1;
      cVar2 = *pcVar9;
    }
    if (*pcVar9 == '\0') goto LAB_1400f2ff7;
    FUN_1400bbe30(local_128);
    FUN_1400bc8a0(local_128,pcVar4,(int)pcVar9 - (int)pcVar4);
    cVar2 = FUN_1400be010(local_128,&DAT_1402456e8);
    if (cVar2 != '\0') {
      FUN_1400bdb00(local_128,&DAT_1402083e0);
    }
    bVar1 = false;
    cVar2 = pcVar9[1];
    if (cVar2 == '\0') goto LAB_1400f2ff7;
    if ((cVar2 == 'B') || (cVar2 == 'b')) {
      bVar1 = true;
    }
    if (((pcVar9[2] != '?') || (pcVar9 = pcVar9 + 3, *pcVar9 == '\0')) ||
       (pcVar3 = strstr(pcVar9,"?="), pcVar3 == (char *)0x0)) goto LAB_1400f2ff7;
    iVar8 = (int)pcVar3 - (int)pcVar9;
    if (iVar8 != 0) {
      local_158[0] = 0;
      if (bVar1) {
        pvVar5 = (void *)FUN_1400f1860();
        if (pvVar5 != (void *)0x0) {
          cVar2 = FUN_1400be010(local_128,&DAT_1402083e0);
          if (cVar2 == '\0') {
            uVar6 = FUN_1400b8b90(local_128);
            cVar2 = FUN_14010c5a0(uVar6);
            if (cVar2 == '\0') goto LAB_1400f2f9e;
            FUN_1400c2840(local_e8);
            uVar6 = FUN_1400b8b90(local_128);
            local_160 = local_150;
            local_168 = local_158[0];
            FUN_1400ce630(local_e8,uVar6,&DAT_1402083e0,pvVar5);
            FUN_1400c2880(local_e8);
          }
          else {
LAB_1400f2f9e:
            FUN_1400b97e0(local_150,pvVar5,local_158[0]);
          }
LAB_1400f2fb0:
          operator_delete(pvVar5);
        }
      }
      else {
        pvVar5 = (void *)FUN_1400f2460(pcVar9,iVar8,local_158);
        if (pvVar5 != (void *)0x0) {
          cVar2 = FUN_1400be010(local_128,&DAT_1402083e0);
          if (cVar2 == '\0') {
            uVar6 = FUN_1400b8b90(local_128);
            cVar2 = FUN_14010c5a0(uVar6);
            if (cVar2 != '\0') {
              FUN_1400c2840(local_e8);
              uVar6 = FUN_1400b8b90(local_128);
              local_160 = local_150;
              local_168 = local_158[0];
              FUN_1400ce630(local_e8,uVar6,&DAT_1402083e0,pvVar5);
              FUN_1400c2880(local_e8);
              goto LAB_1400f2fb0;
            }
          }
          goto LAB_1400f2f9e;
        }
      }
    }
    pcVar3 = pcVar3 + 2;
    pcVar4 = strstr(pcVar3,"=?");
  }
  uVar7 = 0xffffffffffffffff;
  pcVar4 = pcVar3;
  do {
    if (uVar7 == 0) break;
    uVar7 = uVar7 - 1;
    cVar2 = *pcVar4;
    pcVar4 = pcVar4 + 1;
  } while (cVar2 != '\0');
  FUN_1400b97e0(local_150,pcVar3,~uVar7 - 1);
LAB_1400f2ff7:
  FUN_1400bbe30(param_2);
  FUN_1400be440(param_2,local_150);
  FUN_1400bc510(param_2,2);
  FUN_1400bceb0(local_128);
  FUN_1400b92d0(local_150);
  return;
}



void FUN_1400f3060(undefined8 param_1,undefined8 param_2,char *param_3)

{
  char cVar1;
  void *pvVar2;
  longlong lVar3;
  char *pcVar4;
  undefined4 local_res20 [2];
  
  lVar3 = -1;
  pcVar4 = param_3;
  do {
    if (lVar3 == 0) break;
    lVar3 = lVar3 + -1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + 1;
  } while (cVar1 != '\0');
  pvVar2 = (void *)FUN_1400f1860(param_3,~(uint)lVar3 - 1,local_res20);
  if (pvVar2 != (void *)0x0) {
    FUN_1400bc8a0(param_2,pvVar2,local_res20[0]);
    operator_delete(pvVar2);
  }
  return;
}



undefined8 * FUN_1400f30c0(undefined8 *param_1,byte param_2)

{
  *param_1 = ContentCoding::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1400f30f0(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_1400f1480(param_1,param_2,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
                param_3);
  return;
}



void FUN_1400f3100(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_1400f1480(param_1,param_2,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
                param_3);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001400f314e)

ulonglong FUN_1400f3110(void)

{
  void *pvVar1;
  ulonglong extraout_RAX;
  ulonglong uVar2;
  
  pvVar1 = (void *)FUN_1400f16e0();
  uVar2 = 0;
  if (pvVar1 != (void *)0x0) {
    operator_delete(pvVar1);
    uVar2 = extraout_RAX;
  }
  return uVar2 & 0xffffffffffffff00;
}



undefined8
FUN_1400f3170(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 uVar2;
  undefined1 local_40 [56];
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1400bcc20(local_40);
  FUN_1400bc640(local_40,param_1,param_3,param_4,uVar2);
  FUN_1400bdd00(local_40,0x2d);
  FUN_1400bbc30(local_40);
  FUN_1400bd760(local_40);
  cVar1 = FUN_1400bdf70(local_40,&DAT_1402749b8);
  if (((cVar1 == '\0') && (cVar1 = FUN_1400bc7e0(local_40,&DAT_140245744), cVar1 == '\0')) &&
     (cVar1 = FUN_1400bc7e0(local_40,&DAT_14024573c), cVar1 == '\0')) {
    cVar1 = FUN_1400bdf70(local_40,"blowfish2");
    if (cVar1 != '\0') {
      FUN_1400bceb0(local_40);
      return 6;
    }
    cVar1 = FUN_1400bdf70(local_40,"blowfish");
    if (cVar1 != '\0') {
      FUN_1400bceb0(local_40);
      return 3;
    }
    cVar1 = FUN_1400bdf70(local_40,"pbes1");
    if (cVar1 != '\0') {
      FUN_1400bceb0(local_40);
      return 10;
    }
    cVar1 = FUN_1400bdf70(local_40,"pbes2");
    if (cVar1 != '\0') {
      FUN_1400bceb0(local_40);
      return 0xb;
    }
    cVar1 = FUN_1400bdf70(local_40,"twofish");
    if (cVar1 != '\0') {
      FUN_1400bceb0(local_40);
      return 4;
    }
    cVar1 = FUN_1400bdf70(local_40,&DAT_1402074c0);
    if (((cVar1 != '\0') || (cVar1 = FUN_1400bdf70(local_40,&DAT_140207d60), cVar1 != '\0')) ||
       ((cVar1 = FUN_1400bdf70(local_40,"tripledes"), cVar1 != '\0' ||
        (cVar1 = FUN_1400bdf70(local_40,&DAT_140245728), cVar1 != '\0')))) {
      FUN_1400bceb0(local_40);
      return 7;
    }
    cVar1 = FUN_1400bdf70(local_40,&DAT_140207694);
    if (cVar1 != '\0') {
      FUN_1400bceb0(local_40);
      return 8;
    }
    cVar1 = FUN_1400bde10(local_40,&DAT_140241f18);
    if ((cVar1 != '\0') || (cVar1 = FUN_1400bde10(local_40,"arcfour"), cVar1 != '\0')) {
      FUN_1400bceb0(local_40);
      return 9;
    }
    cVar1 = FUN_1400bdf70(local_40,&DAT_140207430);
    if (cVar1 != '\0') {
      FUN_1400bceb0(local_40);
      return 1;
    }
    cVar1 = FUN_1400bdf70(local_40,&DAT_1402076c4);
    if (cVar1 != '\0') {
      FUN_1400bceb0(local_40);
      return 5;
    }
  }
  FUN_1400bceb0(local_40);
  return 2;
}



undefined8 FUN_1400f3400(int param_1,undefined8 param_2)

{
  if (param_1 == 1) {
    FUN_1400bc640(param_2,&DAT_140209300);
    return 1;
  }
  if (param_1 == 7) {
    FUN_1400bc640(param_2,"sha256");
    return 1;
  }
  if (param_1 == 2) {
    FUN_1400bc640(param_2,"sha384");
    return 1;
  }
  if (param_1 == 3) {
    FUN_1400bc640(param_2,"sha512");
    return 1;
  }
  if (param_1 == 4) {
    FUN_1400bc640(param_2,&DAT_1402092fc);
    return 1;
  }
  if (param_1 == 8) {
    FUN_1400bc640(param_2,&DAT_14023f4ec);
    return 1;
  }
  if (param_1 == 5) {
    FUN_1400bc640(param_2,&DAT_1402092f8);
    return 1;
  }
  if (param_1 == 9) {
    FUN_1400bc640(param_2,"ripemd128");
    return 1;
  }
  if (param_1 == 10) {
    FUN_1400bc640(param_2,"ripemd160");
    return 1;
  }
  if (param_1 == 0xb) {
    FUN_1400bc640(param_2,"ripemd256");
    return 1;
  }
  if (param_1 == 0xc) {
    FUN_1400bc640(param_2,"ripemd320");
    return 1;
  }
  if (param_1 == 6) {
    FUN_1400bc640(param_2,"haval");
    return 1;
  }
  if (param_1 == 0xd) {
    FUN_1400bc640(param_2,"GOST R 34.11-94");
    return 1;
  }
  FUN_1400bc640(param_2,&DAT_140209300);
  return 0;
}



undefined1 FUN_1400f3580(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  undefined1 uVar2;
  int iVar3;
  int *piVar4;
  longlong lVar5;
  undefined8 uVar6;
  int iVar7;
  uint uVar8;
  int local_res20 [2];
  
  iVar3 = FUN_1400b8b80(param_2);
  if (iVar3 == 0) {
    FUN_1400b8b30(param_3);
    return 1;
  }
  piVar4 = (int *)FUN_1400b8b90(param_2);
  if (piVar4 != (int *)0x0) {
    iVar3 = *piVar4;
    cVar1 = FUN_1400bec30();
    iVar7 = -0x1e586b4d;
    if (cVar1 != '\0') {
      iVar7 = -0x4c6b581f;
    }
    if (iVar3 == iVar7) {
      if (cVar1 == '\0') {
        uVar8 = piVar4[1];
        uVar8 = uVar8 >> 8 & 0xff00ff00 | uVar8 << 0x18 | (uVar8 & 0xff00) << 8 | uVar8 >> 0x18;
      }
      else {
        uVar8 = piVar4[1];
      }
      cVar1 = FUN_1400ba520(param_3,uVar8 + 0x14);
      if (cVar1 != '\0') {
        FUN_1400b8b30(param_3);
        lVar5 = FUN_1400b8b90(param_2);
        if (lVar5 != 0) {
          local_res20[0] = uVar8 + 0x14;
          iVar3 = FUN_1400b8b80(param_2);
          uVar6 = FUN_1400b8b90(param_3);
          uVar2 = FUN_140137080(param_1,uVar6,local_res20,lVar5 + 8,iVar3 + -8);
          FUN_1400b8c10(param_3,local_res20[0]);
          return uVar2;
        }
      }
    }
    return 0;
  }
  return 0;
}



undefined8 * FUN_1400f36a0(undefined8 *param_1)

{
  *param_1 = ChilkatBzip2::vftable;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  return param_1;
}



void FUN_1400f36c0(undefined8 *param_1)

{
  *param_1 = ChilkatBzip2::vftable;
  if ((void *)param_1[1] != (void *)0x0) {
    operator_delete((void *)param_1[1]);
    param_1[1] = 0;
  }
  if ((void *)param_1[2] != (void *)0x0) {
    operator_delete((void *)param_1[2]);
    param_1[2] = 0;
  }
  if ((void *)param_1[3] != (void *)0x0) {
    operator_delete((void *)param_1[3]);
    param_1[3] = 0;
  }
  return;
}



undefined8 * FUN_1400f3720(undefined8 *param_1,uint param_2)

{
  *param_1 = ChilkatBzip2::vftable;
  if ((void *)param_1[1] != (void *)0x0) {
    operator_delete((void *)param_1[1]);
    param_1[1] = 0;
  }
  if ((void *)param_1[2] != (void *)0x0) {
    operator_delete((void *)param_1[2]);
    param_1[2] = 0;
  }
  if ((void *)param_1[3] != (void *)0x0) {
    operator_delete((void *)param_1[3]);
    param_1[3] = 0;
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1400f37a0(undefined8 *param_1)

{
  *param_1 = Sha1::vftable;
  param_1[1] = 0;
  *(undefined4 *)((longlong)param_1 + 0x24) = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  param_1[8] = 0;
  param_1[9] = 0;
  param_1[10] = 0;
  param_1[0xb] = 0;
  param_1[0xc] = 0;
  return param_1;
}



void FUN_1400f37f0(undefined8 *param_1)

{
  *param_1 = Sha1::vftable;
  return;
}



void FUN_1400f3800(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x10) = 0x67452301;
  *(undefined4 *)(param_1 + 0x14) = 0xefcdab89;
  *(undefined4 *)(param_1 + 0x18) = 0x98badcfe;
  *(undefined4 *)(param_1 + 0x1c) = 0x10325476;
  *(undefined4 *)(param_1 + 0x20) = 0xc3d2e1f0;
  *(undefined4 *)(param_1 + 0x24) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400f3830(longlong param_1)

{
  uint uVar1;
  undefined1 uVar2;
  undefined1 uVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  undefined1 *puVar7;
  undefined1 *puVar8;
  uint *puVar9;
  int *piVar10;
  uint uVar11;
  longlong lVar12;
  uint uVar13;
  uint uVar14;
  uint uVar15;
  uint uVar16;
  uint uVar17;
  longlong lVar18;
  undefined4 auStack_1a1 [10];
  uint local_178 [40];
  int local_d8 [20];
  int local_88 [20];
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)local_178;
  lVar18 = 4;
  lVar12 = 4;
  puVar7 = (undefined1 *)(param_1 + 0x29);
  do {
    puVar8 = puVar7 + 0x10;
    uVar2 = puVar7[4];
    *(uint *)(puVar8 + (longlong)auStack_1a1 + (-0x10 - param_1)) =
         CONCAT31(CONCAT21(CONCAT11(puVar7[-1],*puVar7),puVar7[1]),puVar7[2]);
    uVar3 = puVar7[8];
    *(uint *)(puVar8 + (longlong)auStack_1a1 + (-0xc - param_1)) =
         CONCAT31(CONCAT21(CONCAT11(puVar7[3],uVar2),puVar7[5]),puVar7[6]);
    uVar2 = puVar7[0xc];
    *(uint *)(puVar8 + (longlong)auStack_1a1 + (-8 - param_1)) =
         CONCAT31(CONCAT21(CONCAT11(puVar7[7],uVar3),puVar7[9]),puVar7[10]);
    lVar12 = lVar12 + -1;
    *(uint *)(puVar8 + (longlong)auStack_1a1 + (-4 - param_1)) =
         CONCAT31(CONCAT21(CONCAT11(puVar7[0xb],uVar2),puVar7[0xd]),puVar7[0xe]);
    puVar7 = puVar8;
  } while (lVar12 != 0);
  uVar4 = *(uint *)(param_1 + 0x10);
  uVar5 = *(uint *)(param_1 + 0x14);
  uVar16 = *(uint *)(param_1 + 0x18);
  uVar17 = *(uint *)(param_1 + 0x1c);
  uVar11 = *(uint *)(param_1 + 0x20);
  lVar12 = 0x10;
  puVar9 = local_178 + 8;
  do {
    uVar15 = puVar9[-8] ^ puVar9[5] ^ *puVar9 ^ puVar9[-6];
    uVar6 = puVar9[-7] ^ puVar9[6] ^ puVar9[1] ^ puVar9[-5];
    uVar15 = uVar15 << 1 | (uint)((int)uVar15 < 0);
    puVar9[8] = uVar15;
    puVar9[9] = uVar6 << 1 | (uint)((int)uVar6 < 0);
    uVar6 = puVar9[7] ^ puVar9[-4] ^ puVar9[2] ^ puVar9[-6];
    puVar9[10] = uVar6 << 1 | (uint)((int)uVar6 < 0);
    uVar6 = puVar9[-3] ^ puVar9[3] ^ uVar15 ^ puVar9[-5];
    lVar12 = lVar12 + -1;
    puVar9[0xb] = uVar6 << 1 | (uint)((int)uVar6 < 0);
    puVar9 = puVar9 + 4;
  } while (lVar12 != 0);
  lVar12 = 4;
  puVar9 = local_178;
  uVar15 = uVar4;
  uVar6 = uVar5;
  do {
    uVar14 = uVar6 << 0x1e | uVar6 >> 2;
    uVar6 = uVar11 + 0x5a827999 +
            (uVar15 << 5 | uVar15 >> 0x1b) + ((uVar17 ^ uVar16) & uVar6 ^ uVar17) + *puVar9;
    uVar13 = uVar15 << 0x1e | uVar15 >> 2;
    uVar15 = uVar17 + 0x5a827999 +
             (uVar6 * 0x20 | uVar6 >> 0x1b) + ((uVar16 ^ uVar14) & uVar15 ^ uVar16) + puVar9[1];
    uVar11 = uVar6 * 0x40000000 | uVar6 >> 2;
    uVar1 = uVar16 + 0x5a827999 +
            (uVar15 * 0x20 | uVar15 >> 0x1b) + ((uVar14 ^ uVar13) & uVar6 ^ uVar14) + puVar9[2];
    uVar17 = uVar15 * 0x40000000 | uVar15 >> 2;
    uVar6 = uVar14 + 0x5a827999 +
            (uVar1 * 0x20 | uVar1 >> 0x1b) + ((uVar11 ^ uVar13) & uVar15 ^ uVar13) + puVar9[3];
    uVar16 = uVar1 * 0x40000000 | uVar1 >> 2;
    lVar12 = lVar12 + -1;
    uVar15 = uVar13 + 0x5a827999 +
             (uVar6 * 0x20 | uVar6 >> 0x1b) + ((uVar11 ^ uVar17) & uVar1 ^ uVar11) + puVar9[4];
    puVar9 = puVar9 + 5;
  } while (lVar12 != 0);
  lVar12 = 4;
  puVar9 = local_178 + 0x14;
  do {
    uVar14 = uVar6 << 0x1e | uVar6 >> 2;
    uVar6 = uVar11 + 0x6ed9eba1 +
            (uVar15 << 5 | uVar15 >> 0x1b) + (uVar17 ^ uVar16 ^ uVar6) + *puVar9;
    uVar13 = uVar15 << 0x1e | uVar15 >> 2;
    uVar15 = uVar17 + 0x6ed9eba1 +
             (uVar6 * 0x20 | uVar6 >> 0x1b) + (uVar16 ^ uVar14 ^ uVar15) + puVar9[1];
    uVar11 = uVar6 * 0x40000000 | uVar6 >> 2;
    uVar1 = uVar16 + 0x6ed9eba1 +
            (uVar15 * 0x20 | uVar15 >> 0x1b) + (uVar6 ^ uVar14 ^ uVar13) + puVar9[2];
    uVar17 = uVar15 * 0x40000000 | uVar15 >> 2;
    uVar6 = uVar14 + 0x6ed9eba1 +
            (uVar1 * 0x20 | uVar1 >> 0x1b) + (uVar11 ^ uVar15 ^ uVar13) + puVar9[3];
    uVar16 = uVar1 * 0x40000000 | uVar1 >> 2;
    lVar12 = lVar12 + -1;
    uVar15 = uVar13 + 0x6ed9eba1 +
             (uVar6 * 0x20 | uVar6 >> 0x1b) + (uVar11 ^ uVar17 ^ uVar1) + puVar9[4];
    puVar9 = puVar9 + 5;
  } while (lVar12 != 0);
  lVar12 = 4;
  piVar10 = local_d8;
  do {
    uVar14 = uVar6 << 0x1e | uVar6 >> 2;
    uVar6 = ((uVar16 | uVar6) & uVar17 | uVar16 & uVar6) + *piVar10 + uVar11 + -0x70e44324 +
            (uVar15 << 5 | uVar15 >> 0x1b);
    uVar13 = uVar15 << 0x1e | uVar15 >> 2;
    uVar15 = ((uVar14 | uVar15) & uVar16 | uVar14 & uVar15) + piVar10[1] + uVar17 + -0x70e44324 +
             (uVar6 * 0x20 | uVar6 >> 0x1b);
    uVar11 = uVar6 * 0x40000000 | uVar6 >> 2;
    uVar1 = ((uVar6 | uVar13) & uVar14 | uVar6 & uVar13) + piVar10[2] + uVar16 + -0x70e44324 +
            (uVar15 * 0x20 | uVar15 >> 0x1b);
    uVar17 = uVar15 * 0x40000000 | uVar15 >> 2;
    uVar6 = ((uVar11 | uVar15) & uVar13 | uVar11 & uVar15) + piVar10[3] + uVar14 + -0x70e44324 +
            (uVar1 * 0x20 | uVar1 >> 0x1b);
    uVar16 = uVar1 * 0x40000000 | uVar1 >> 2;
    lVar12 = lVar12 + -1;
    uVar15 = ((uVar17 | uVar1) & uVar11 | uVar17 & uVar1) + piVar10[4] + uVar13 + -0x70e44324 +
             (uVar6 * 0x20 | uVar6 >> 0x1b);
    piVar10 = piVar10 + 5;
  } while (lVar12 != 0);
  piVar10 = local_88;
  do {
    uVar14 = uVar6 << 0x1e | uVar6 >> 2;
    uVar6 = (uVar17 ^ uVar16 ^ uVar6) + *piVar10 + uVar11 + -0x359d3e2a +
            (uVar15 << 5 | uVar15 >> 0x1b);
    uVar13 = uVar15 << 0x1e | uVar15 >> 2;
    uVar15 = (uVar16 ^ uVar14 ^ uVar15) + piVar10[1] + uVar17 + -0x359d3e2a +
             (uVar6 * 0x20 | uVar6 >> 0x1b);
    uVar11 = uVar6 * 0x40000000 | uVar6 >> 2;
    uVar1 = (uVar6 ^ uVar14 ^ uVar13) + piVar10[2] + uVar16 + -0x359d3e2a +
            (uVar15 * 0x20 | uVar15 >> 0x1b);
    uVar17 = uVar15 * 0x40000000 | uVar15 >> 2;
    uVar6 = (uVar11 ^ uVar15 ^ uVar13) + piVar10[3] + uVar14 + -0x359d3e2a +
            (uVar1 * 0x20 | uVar1 >> 0x1b);
    uVar16 = uVar1 * 0x40000000 | uVar1 >> 2;
    lVar18 = lVar18 + -1;
    uVar15 = (uVar11 ^ uVar17 ^ uVar1) + piVar10[4] + uVar13 + -0x359d3e2a +
             (uVar6 * 0x20 | uVar6 >> 0x1b);
    piVar10 = piVar10 + 5;
  } while (lVar18 != 0);
  *(uint *)(param_1 + 0x10) = uVar4 + uVar15;
  *(uint *)(param_1 + 0x14) = uVar5 + uVar6;
  *(uint *)(param_1 + 0x18) = *(int *)(param_1 + 0x18) + uVar16;
  *(uint *)(param_1 + 0x1c) = *(int *)(param_1 + 0x1c) + uVar17;
  *(uint *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) + uVar11;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400f3cf0(longlong param_1,undefined8 *param_2,uint param_3)

{
  undefined1 uVar1;
  undefined1 uVar2;
  uint uVar3;
  uint uVar4;
  undefined1 *puVar5;
  undefined1 *puVar6;
  uint *puVar7;
  int *piVar8;
  uint uVar9;
  uint uVar10;
  uint uVar11;
  uint uVar12;
  uint uVar13;
  longlong lVar14;
  uint uVar15;
  uint uVar16;
  undefined1 auStack_1b1 [4];
  undefined4 uStack_1ad;
  undefined1 auStack_1a8 [3];
  undefined4 auStack_1a5 [7];
  uint local_188 [40];
  int local_e8 [20];
  int local_98 [20];
  ulonglong local_48;
  
  if (param_2 != (undefined8 *)0x0) {
    local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_1a8;
    while (param_3 != 0) {
      if ((*(int *)(param_1 + 0x24) == 0) && (0x3f < param_3)) {
        *(undefined8 *)(param_1 + 0x28) = *param_2;
        *(undefined8 *)(param_1 + 0x30) = param_2[1];
        *(undefined8 *)(param_1 + 0x38) = param_2[2];
        *(undefined8 *)(param_1 + 0x40) = param_2[3];
        *(undefined8 *)(param_1 + 0x48) = param_2[4];
        *(undefined8 *)(param_1 + 0x50) = param_2[5];
        *(undefined8 *)(param_1 + 0x58) = param_2[6];
        *(undefined8 *)(param_1 + 0x60) = param_2[7];
        lVar14 = 4;
        puVar5 = (undefined1 *)(param_1 + 0x29);
        do {
          puVar6 = puVar5 + 0x10;
          uVar1 = puVar5[4];
          *(uint *)(puVar6 + (longlong)auStack_1a5 + (-0x1c - param_1)) =
               CONCAT31(CONCAT21(CONCAT11(puVar5[-1],*puVar5),puVar5[1]),puVar5[2]);
          uVar2 = puVar5[8];
          *(uint *)(puVar6 + (longlong)auStack_1a5 + (-0x18 - param_1)) =
               CONCAT31(CONCAT21(CONCAT11(puVar5[3],uVar1),puVar5[5]),puVar5[6]);
          uVar1 = puVar5[0xc];
          *(uint *)(puVar6 + (longlong)auStack_1a5 + (-0x14 - param_1)) =
               CONCAT31(CONCAT21(CONCAT11(puVar5[7],uVar2),puVar5[9]),puVar5[10]);
          lVar14 = lVar14 + -1;
          *(uint *)(puVar6 + (longlong)auStack_1a5 + (-0x10 - param_1)) =
               CONCAT31(CONCAT21(CONCAT11(puVar5[0xb],uVar1),puVar5[0xd]),puVar5[0xe]);
          puVar5 = puVar6;
        } while (lVar14 != 0);
        uVar3 = *(uint *)(param_1 + 0x10);
        uVar12 = *(uint *)(param_1 + 0x14);
        uVar15 = *(uint *)(param_1 + 0x18);
        uVar16 = *(uint *)(param_1 + 0x1c);
        uVar9 = *(uint *)(param_1 + 0x20);
        lVar14 = 0x10;
        puVar7 = local_188 + 8;
        do {
          uVar13 = puVar7[-8] ^ puVar7[5] ^ puVar7[-6] ^ *puVar7;
          uVar4 = puVar7[-7] ^ puVar7[6] ^ puVar7[1] ^ puVar7[-5];
          uVar13 = uVar13 << 1 | (uint)((int)uVar13 < 0);
          puVar7[8] = uVar13;
          puVar7[9] = uVar4 << 1 | (uint)((int)uVar4 < 0);
          uVar4 = puVar7[7] ^ puVar7[-4] ^ puVar7[2] ^ puVar7[-6];
          puVar7[10] = uVar4 << 1 | (uint)((int)uVar4 < 0);
          uVar4 = puVar7[-3] ^ puVar7[3] ^ uVar13 ^ puVar7[-5];
          lVar14 = lVar14 + -1;
          puVar7[0xb] = uVar4 << 1 | (uint)((int)uVar4 < 0);
          puVar7 = puVar7 + 4;
        } while (lVar14 != 0);
        lVar14 = 4;
        puVar7 = local_188;
        uVar4 = uVar3;
        do {
          uVar11 = uVar12 << 0x1e | uVar12 >> 2;
          uVar12 = uVar9 + 0x5a827999 +
                   (uVar4 << 5 | uVar4 >> 0x1b) + ((uVar16 ^ uVar15) & uVar12 ^ uVar16) + *puVar7;
          uVar10 = uVar4 << 0x1e | uVar4 >> 2;
          uVar4 = uVar16 + 0x5a827999 +
                  (uVar12 * 0x20 | uVar12 >> 0x1b) + ((uVar15 ^ uVar11) & uVar4 ^ uVar15) +
                  puVar7[1];
          uVar9 = uVar12 * 0x40000000 | uVar12 >> 2;
          uVar13 = uVar15 + 0x5a827999 +
                   (uVar4 * 0x20 | uVar4 >> 0x1b) + ((uVar11 ^ uVar10) & uVar12 ^ uVar11) +
                   puVar7[2];
          uVar16 = uVar4 * 0x40000000 | uVar4 >> 2;
          uVar12 = uVar11 + 0x5a827999 +
                   (uVar13 * 0x20 | uVar13 >> 0x1b) + ((uVar9 ^ uVar10) & uVar4 ^ uVar10) +
                   puVar7[3];
          uVar15 = uVar13 * 0x40000000 | uVar13 >> 2;
          lVar14 = lVar14 + -1;
          uVar4 = uVar10 + 0x5a827999 +
                  (uVar12 * 0x20 | uVar12 >> 0x1b) + ((uVar9 ^ uVar16) & uVar13 ^ uVar9) + puVar7[4]
          ;
          puVar7 = puVar7 + 5;
        } while (lVar14 != 0);
        lVar14 = 4;
        puVar7 = local_188 + 0x14;
        do {
          uVar11 = uVar12 << 0x1e | uVar12 >> 2;
          uVar12 = uVar9 + 0x6ed9eba1 +
                   (uVar4 << 5 | uVar4 >> 0x1b) + (uVar16 ^ uVar15 ^ uVar12) + *puVar7;
          uVar10 = uVar4 << 0x1e | uVar4 >> 2;
          uVar4 = uVar16 + 0x6ed9eba1 +
                  (uVar12 * 0x20 | uVar12 >> 0x1b) + (uVar15 ^ uVar11 ^ uVar4) + puVar7[1];
          uVar9 = uVar12 * 0x40000000 | uVar12 >> 2;
          uVar13 = uVar15 + 0x6ed9eba1 +
                   (uVar4 * 0x20 | uVar4 >> 0x1b) + (uVar12 ^ uVar11 ^ uVar10) + puVar7[2];
          uVar16 = uVar4 * 0x40000000 | uVar4 >> 2;
          uVar12 = uVar11 + 0x6ed9eba1 +
                   (uVar13 * 0x20 | uVar13 >> 0x1b) + (uVar9 ^ uVar4 ^ uVar10) + puVar7[3];
          uVar15 = uVar13 * 0x40000000 | uVar13 >> 2;
          lVar14 = lVar14 + -1;
          uVar4 = uVar10 + 0x6ed9eba1 +
                  (uVar12 * 0x20 | uVar12 >> 0x1b) + (uVar9 ^ uVar16 ^ uVar13) + puVar7[4];
          puVar7 = puVar7 + 5;
        } while (lVar14 != 0);
        lVar14 = 4;
        piVar8 = local_e8;
        do {
          uVar11 = uVar12 << 0x1e | uVar12 >> 2;
          uVar12 = ((uVar15 | uVar12) & uVar16 | uVar15 & uVar12) + *piVar8 + uVar9 + -0x70e44324 +
                   (uVar4 << 5 | uVar4 >> 0x1b);
          uVar10 = uVar4 << 0x1e | uVar4 >> 2;
          uVar4 = ((uVar11 | uVar4) & uVar15 | uVar11 & uVar4) + piVar8[1] + uVar16 + -0x70e44324 +
                  (uVar12 * 0x20 | uVar12 >> 0x1b);
          uVar9 = uVar12 * 0x40000000 | uVar12 >> 2;
          uVar13 = ((uVar12 | uVar10) & uVar11 | uVar12 & uVar10) + piVar8[2] + uVar15 + -0x70e44324
                   + (uVar4 * 0x20 | uVar4 >> 0x1b);
          uVar16 = uVar4 * 0x40000000 | uVar4 >> 2;
          uVar12 = ((uVar9 | uVar4) & uVar10 | uVar9 & uVar4) + piVar8[3] + uVar11 + -0x70e44324 +
                   (uVar13 * 0x20 | uVar13 >> 0x1b);
          uVar15 = uVar13 * 0x40000000 | uVar13 >> 2;
          lVar14 = lVar14 + -1;
          uVar4 = ((uVar16 | uVar13) & uVar9 | uVar16 & uVar13) + piVar8[4] + uVar10 + -0x70e44324 +
                  (uVar12 * 0x20 | uVar12 >> 0x1b);
          piVar8 = piVar8 + 5;
        } while (lVar14 != 0);
        lVar14 = 4;
        piVar8 = local_98;
        do {
          uVar11 = uVar12 << 0x1e | uVar12 >> 2;
          uVar12 = (uVar16 ^ uVar15 ^ uVar12) + *piVar8 + uVar9 + -0x359d3e2a +
                   (uVar4 << 5 | uVar4 >> 0x1b);
          uVar10 = uVar4 << 0x1e | uVar4 >> 2;
          uVar4 = (uVar15 ^ uVar11 ^ uVar4) + piVar8[1] + uVar16 + -0x359d3e2a +
                  (uVar12 * 0x20 | uVar12 >> 0x1b);
          uVar9 = uVar12 * 0x40000000 | uVar12 >> 2;
          uVar13 = (uVar12 ^ uVar11 ^ uVar10) + piVar8[2] + uVar15 + -0x359d3e2a +
                   (uVar4 * 0x20 | uVar4 >> 0x1b);
          uVar16 = uVar4 * 0x40000000 | uVar4 >> 2;
          uVar12 = (uVar9 ^ uVar4 ^ uVar10) + piVar8[3] + uVar11 + -0x359d3e2a +
                   (uVar13 * 0x20 | uVar13 >> 0x1b);
          uVar15 = uVar13 * 0x40000000 | uVar13 >> 2;
          lVar14 = lVar14 + -1;
          uVar4 = (uVar9 ^ uVar16 ^ uVar13) + piVar8[4] + uVar10 + -0x359d3e2a +
                  (uVar12 * 0x20 | uVar12 >> 0x1b);
          piVar8 = piVar8 + 5;
        } while (lVar14 != 0);
        *(longlong *)(param_1 + 8) = *(longlong *)(param_1 + 8) + 0x200;
        param_2 = param_2 + 8;
        *(uint *)(param_1 + 0x10) = uVar3 + uVar4;
        *(uint *)(param_1 + 0x14) = *(int *)(param_1 + 0x14) + uVar12;
        *(uint *)(param_1 + 0x18) = *(int *)(param_1 + 0x18) + uVar15;
        *(uint *)(param_1 + 0x1c) = *(int *)(param_1 + 0x1c) + uVar16;
        param_3 = param_3 - 0x40;
        *(uint *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) + uVar9;
      }
      else {
        uVar12 = 0x40 - *(int *)(param_1 + 0x24);
        if (param_3 < uVar12) {
          uVar12 = param_3;
        }
        stack0xfffffffffffffe50 = 0x1400f423b;
        memcpy((void *)((ulonglong)*(uint *)(param_1 + 0x24) + 0x28 + param_1),param_2,
               (ulonglong)uVar12);
        *(int *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) + uVar12;
        param_2 = (undefined8 *)((longlong)param_2 + (ulonglong)uVar12);
        param_3 = param_3 - uVar12;
        if (*(int *)(param_1 + 0x24) == 0x40) {
          stack0xfffffffffffffe50 = 0x1400f4252;
          FUN_1400f3830(param_1);
          *(longlong *)(param_1 + 8) = *(longlong *)(param_1 + 8) + 0x200;
          *(undefined4 *)(param_1 + 0x24) = 0;
        }
      }
    }
  }
  return;
}



undefined8 * FUN_1400f42b0(undefined8 *param_1,byte param_2)

{
  *param_1 = Sha1::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400f42e0(longlong param_1,undefined8 param_2,char param_3)

{
  uint uVar1;
  undefined1 *puVar2;
  longlong lVar3;
  longlong lVar4;
  undefined8 uVar5;
  undefined1 auStack_58 [32];
  undefined1 local_38 [7];
  undefined1 local_31;
  undefined1 local_30;
  undefined1 local_2f;
  undefined1 local_2e;
  undefined1 local_2d;
  undefined1 local_2c;
  undefined1 local_2b;
  undefined1 local_2a;
  undefined1 local_29;
  undefined1 local_28;
  undefined1 local_27;
  undefined1 local_26;
  undefined1 local_25;
  ulonglong local_20;
  
  local_20 = DAT_1402f85a0 ^ (ulonglong)auStack_58;
  *(longlong *)(param_1 + 8) =
       *(longlong *)(param_1 + 8) + (ulonglong)(*(uint *)(param_1 + 0x24) * 8);
  *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x24) + 0x28 + param_1) = 0x80;
  *(int *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) + 1;
  uVar1 = *(uint *)(param_1 + 0x24);
  if (0x38 < uVar1) {
    while (uVar1 < 0x40) {
      *(undefined1 *)((ulonglong)uVar1 + 0x28 + param_1) = 0;
      *(int *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) + 1;
      uVar1 = *(uint *)(param_1 + 0x24);
    }
    FUN_1400f3830();
    *(undefined4 *)(param_1 + 0x24) = 0;
  }
  uVar1 = *(uint *)(param_1 + 0x24);
  while (uVar1 < 0x38) {
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x24) + 0x28 + param_1) = 0;
    *(int *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) + 1;
    uVar1 = *(uint *)(param_1 + 0x24);
  }
  uVar5 = *(undefined8 *)(param_1 + 8);
  *(char *)(param_1 + 0x60) = (char)((ulonglong)uVar5 >> 0x38);
  *(char *)(param_1 + 0x61) = (char)((ulonglong)uVar5 >> 0x30);
  *(char *)(param_1 + 0x62) = (char)((ulonglong)uVar5 >> 0x28);
  *(char *)(param_1 + 99) = (char)((ulonglong)uVar5 >> 0x20);
  *(char *)(param_1 + 100) = (char)((ulonglong)uVar5 >> 0x18);
  *(char *)(param_1 + 0x66) = (char)((ulonglong)uVar5 >> 8);
  *(char *)(param_1 + 0x65) = (char)((ulonglong)uVar5 >> 0x10);
  *(undefined1 *)(param_1 + 0x67) = *(undefined1 *)(param_1 + 8);
  FUN_1400f3830(param_1);
  if (param_3 == '\0') {
    local_38[0] = *(undefined1 *)(param_1 + 0x13);
    uVar5 = 0x14;
    local_38[1] = *(undefined1 *)(param_1 + 0x12);
    local_38[2] = *(undefined1 *)(param_1 + 0x11);
    local_38[3] = *(undefined1 *)(param_1 + 0x10);
    local_38[4] = *(undefined1 *)(param_1 + 0x17);
    local_38[5] = *(undefined1 *)(param_1 + 0x16);
    local_38[6] = *(undefined1 *)(param_1 + 0x15);
    local_31 = *(undefined1 *)(param_1 + 0x14);
    local_30 = *(undefined1 *)(param_1 + 0x1b);
    local_2f = *(undefined1 *)(param_1 + 0x1a);
    local_2e = *(undefined1 *)(param_1 + 0x19);
    local_2d = *(undefined1 *)(param_1 + 0x18);
    local_2c = *(undefined1 *)(param_1 + 0x1f);
    local_2b = *(undefined1 *)(param_1 + 0x1e);
    local_2a = *(undefined1 *)(param_1 + 0x1d);
    local_29 = *(undefined1 *)(param_1 + 0x1c);
    local_28 = *(undefined1 *)(param_1 + 0x23);
    local_27 = *(undefined1 *)(param_1 + 0x22);
    local_26 = *(undefined1 *)(param_1 + 0x21);
    local_25 = *(undefined1 *)(param_1 + 0x20);
  }
  else {
    *(uint *)(param_1 + 0x14) = *(uint *)(param_1 + 0x14) ^ *(uint *)(param_1 + 0x1c);
    *(uint *)(param_1 + 0x10) =
         *(uint *)(param_1 + 0x10) ^ *(uint *)(param_1 + 0x20) ^ *(uint *)(param_1 + 0x18);
    puVar2 = (undefined1 *)(param_1 + 0x11);
    lVar3 = 0;
    do {
      lVar4 = lVar3 + 4;
      local_38[lVar3] = puVar2[-1];
      local_38[lVar3 + 1] = *puVar2;
      local_38[lVar3 + 2] = puVar2[1];
      local_38[lVar3 + 3] = puVar2[2];
      puVar2 = puVar2 + 4;
      lVar3 = lVar4;
    } while (lVar4 < 8);
    uVar5 = 8;
  }
  FUN_1400b97e0(param_2,local_38,uVar5);
  return;
}



void FUN_1400f44e0(longlong param_1,undefined1 *param_2)

{
  uint uVar1;
  undefined8 uVar2;
  
  if (param_2 != (undefined1 *)0x0) {
    *(longlong *)(param_1 + 8) =
         *(longlong *)(param_1 + 8) + (ulonglong)(*(uint *)(param_1 + 0x24) * 8);
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x24) + 0x28 + param_1) = 0x80;
    *(int *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) + 1;
    uVar1 = *(uint *)(param_1 + 0x24);
    if (0x38 < uVar1) {
      while (uVar1 < 0x40) {
        *(undefined1 *)((ulonglong)uVar1 + 0x28 + param_1) = 0;
        *(int *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) + 1;
        uVar1 = *(uint *)(param_1 + 0x24);
      }
      FUN_1400f3830();
      *(undefined4 *)(param_1 + 0x24) = 0;
    }
    uVar1 = *(uint *)(param_1 + 0x24);
    while (uVar1 < 0x38) {
      *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x24) + 0x28 + param_1) = 0;
      *(int *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) + 1;
      uVar1 = *(uint *)(param_1 + 0x24);
    }
    uVar2 = *(undefined8 *)(param_1 + 8);
    *(char *)(param_1 + 0x60) = (char)((ulonglong)uVar2 >> 0x38);
    *(char *)(param_1 + 0x61) = (char)((ulonglong)uVar2 >> 0x30);
    *(char *)(param_1 + 0x62) = (char)((ulonglong)uVar2 >> 0x28);
    *(char *)(param_1 + 99) = (char)((ulonglong)uVar2 >> 0x20);
    *(char *)(param_1 + 100) = (char)((ulonglong)uVar2 >> 0x18);
    *(char *)(param_1 + 0x66) = (char)((ulonglong)uVar2 >> 8);
    *(char *)(param_1 + 0x65) = (char)((ulonglong)uVar2 >> 0x10);
    *(undefined1 *)(param_1 + 0x67) = *(undefined1 *)(param_1 + 8);
    FUN_1400f3830(param_1);
    *param_2 = *(undefined1 *)(param_1 + 0x13);
    param_2[1] = *(undefined1 *)(param_1 + 0x12);
    param_2[2] = *(undefined1 *)(param_1 + 0x11);
    param_2[3] = *(undefined1 *)(param_1 + 0x10);
    param_2[4] = *(undefined1 *)(param_1 + 0x17);
    param_2[5] = *(undefined1 *)(param_1 + 0x16);
    param_2[6] = *(undefined1 *)(param_1 + 0x15);
    param_2[7] = *(undefined1 *)(param_1 + 0x14);
    param_2[8] = *(undefined1 *)(param_1 + 0x1b);
    param_2[9] = *(undefined1 *)(param_1 + 0x1a);
    param_2[10] = *(undefined1 *)(param_1 + 0x19);
    param_2[0xb] = *(undefined1 *)(param_1 + 0x18);
    param_2[0xc] = *(undefined1 *)(param_1 + 0x1f);
    param_2[0xd] = *(undefined1 *)(param_1 + 0x1e);
    param_2[0xe] = *(undefined1 *)(param_1 + 0x1d);
    param_2[0xf] = *(undefined1 *)(param_1 + 0x1c);
    param_2[0x10] = *(undefined1 *)(param_1 + 0x23);
    param_2[0x11] = *(undefined1 *)(param_1 + 0x22);
    param_2[0x12] = *(undefined1 *)(param_1 + 0x21);
    param_2[0x13] = *(undefined1 *)(param_1 + 0x20);
  }
  return;
}



void FUN_1400f4650(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  *(undefined4 *)(param_1 + 0x10) = 0x67452301;
  *(undefined4 *)(param_1 + 0x14) = 0xefcdab89;
  *(undefined4 *)(param_1 + 0x18) = 0x98badcfe;
  *(undefined4 *)(param_1 + 0x1c) = 0x10325476;
  *(undefined4 *)(param_1 + 0x24) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined4 *)(param_1 + 0x20) = 0xc3d2e1f0;
  uVar1 = FUN_1400b8b80(param_2);
  uVar2 = FUN_1400b8b90(param_2);
  FUN_1400f3cf0(param_1,uVar2,uVar1);
  FUN_1400f42e0(param_1,param_3,0);
  return;
}



void FUN_1400f46e0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  *(undefined4 *)(param_1 + 0x10) = 0x67452301;
  *(undefined4 *)(param_1 + 0x14) = 0xefcdab89;
  *(undefined4 *)(param_1 + 0x18) = 0x98badcfe;
  *(undefined4 *)(param_1 + 0x24) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined4 *)(param_1 + 0x1c) = 0x10325476;
  *(undefined4 *)(param_1 + 0x20) = 0xc3d2e1f0;
  FUN_1400f3cf0();
  FUN_1400f42e0(param_1,param_4,0);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400f4740(int *param_1,longlong param_2)

{
  int iVar1;
  uint uVar2;
  undefined2 *puVar3;
  uint uVar4;
  uint uVar5;
  int *piVar6;
  uint uVar7;
  longlong lVar8;
  uint uVar9;
  int local_78 [4];
  int local_68;
  int local_64;
  int local_60;
  int local_5c;
  int local_58;
  int local_54;
  int local_50;
  int local_4c;
  int local_48;
  int local_44;
  int local_40;
  int local_3c;
  
  iVar1 = *param_1;
  uVar9 = param_1[1];
  uVar7 = param_1[2];
  uVar4 = param_1[3];
  lVar8 = 0x10;
  puVar3 = (undefined2 *)(param_2 + 2);
  piVar6 = local_78;
  do {
    lVar8 = lVar8 + -1;
    *piVar6 = CONCAT31(CONCAT21(*puVar3,*(undefined1 *)((longlong)puVar3 + -1)),
                       *(undefined1 *)(puVar3 + -1));
    puVar3 = puVar3 + 2;
    piVar6 = piVar6 + 1;
  } while (lVar8 != 0);
  uVar2 = (~uVar9 & uVar4 | uVar7 & uVar9) + local_78[0] + -0x28955b88 + iVar1;
  uVar2 = (uVar2 * 0x80 | uVar2 >> 0x19) + uVar9;
  uVar4 = (~uVar2 & uVar7 | uVar9 & uVar2) + local_78[1] + -0x173848aa + uVar4;
  uVar4 = (uVar4 * 0x1000 | uVar4 >> 0x14) + uVar2;
  uVar7 = (~uVar4 & uVar9 | uVar4 & uVar2) + local_78[2] + 0x242070db + uVar7;
  uVar7 = (uVar7 >> 0xf | uVar7 * 0x20000) + uVar4;
  uVar9 = (~uVar7 & uVar2 | uVar4 & uVar7) + local_78[3] + -0x3e423112 + uVar9;
  uVar9 = (uVar9 >> 10 | uVar9 * 0x400000) + uVar7;
  uVar2 = (~uVar9 & uVar4 | uVar7 & uVar9) + local_68 + -0xa83f051 + uVar2;
  uVar2 = (uVar2 * 0x80 | uVar2 >> 0x19) + uVar9;
  uVar4 = (~uVar2 & uVar7 | uVar9 & uVar2) + local_64 + 0x4787c62a + uVar4;
  uVar4 = (uVar4 * 0x1000 | uVar4 >> 0x14) + uVar2;
  uVar7 = (~uVar4 & uVar9 | uVar4 & uVar2) + local_60 + -0x57cfb9ed + uVar7;
  uVar7 = (uVar7 >> 0xf | uVar7 * 0x20000) + uVar4;
  uVar9 = (~uVar7 & uVar2 | uVar4 & uVar7) + local_5c + -0x2b96aff + uVar9;
  uVar9 = (uVar9 >> 10 | uVar9 * 0x400000) + uVar7;
  uVar2 = (~uVar9 & uVar4 | uVar7 & uVar9) + local_58 + 0x698098d8 + uVar2;
  uVar2 = (uVar2 * 0x80 | uVar2 >> 0x19) + uVar9;
  uVar4 = (~uVar2 & uVar7 | uVar9 & uVar2) + local_54 + -0x74bb0851 + uVar4;
  uVar4 = (uVar4 * 0x1000 | uVar4 >> 0x14) + uVar2;
  uVar7 = (~uVar4 & uVar9 | uVar4 & uVar2) + local_50 + -0xa44f + uVar7;
  uVar7 = (uVar7 >> 0xf | uVar7 * 0x20000) + uVar4;
  uVar9 = (~uVar7 & uVar2 | uVar4 & uVar7) + local_4c + -0x76a32842 + uVar9;
  uVar9 = (uVar9 >> 10 | uVar9 * 0x400000) + uVar7;
  uVar2 = (~uVar9 & uVar4 | uVar7 & uVar9) + local_48 + 0x6b901122 + uVar2;
  uVar2 = (uVar2 * 0x80 | uVar2 >> 0x19) + uVar9;
  uVar4 = (~uVar2 & uVar7 | uVar9 & uVar2) + local_44 + -0x2678e6d + uVar4;
  uVar4 = (uVar4 * 0x1000 | uVar4 >> 0x14) + uVar2;
  uVar7 = (~uVar4 & uVar9 | uVar4 & uVar2) + local_40 + -0x5986bc72 + uVar7;
  uVar7 = (uVar7 >> 0xf | uVar7 * 0x20000) + uVar4;
  uVar9 = (~uVar7 & uVar2 | uVar4 & uVar7) + local_3c + 0x49b40821 + uVar9;
  uVar9 = (uVar9 >> 10 | uVar9 * 0x400000) + uVar7;
  uVar2 = (~uVar4 & uVar7 | uVar4 & uVar9) + local_78[1] + -0x9e1da9e + uVar2;
  uVar2 = (uVar2 * 0x20 | uVar2 >> 0x1b) + uVar9;
  uVar4 = (~uVar7 & uVar9 | uVar7 & uVar2) + local_60 + -0x3fbf4cc0 + uVar4;
  uVar4 = (uVar4 * 0x200 | uVar4 >> 0x17) + uVar2;
  uVar7 = (~uVar9 & uVar2 | uVar4 & uVar9) + local_4c + 0x265e5a51 + uVar7;
  uVar7 = (uVar7 * 0x4000 | uVar7 >> 0x12) + uVar4;
  uVar9 = (~uVar2 & uVar4 | uVar7 & uVar2) + local_78[0] + -0x16493856 + uVar9;
  uVar9 = (uVar9 >> 0xc | uVar9 * 0x100000) + uVar7;
  uVar2 = (~uVar4 & uVar7 | uVar4 & uVar9) + local_64 + -0x29d0efa3 + uVar2;
  uVar2 = (uVar2 * 0x20 | uVar2 >> 0x1b) + uVar9;
  uVar4 = (~uVar7 & uVar9 | uVar7 & uVar2) + local_50 + 0x2441453 + uVar4;
  uVar4 = (uVar4 * 0x200 | uVar4 >> 0x17) + uVar2;
  uVar7 = (~uVar9 & uVar2 | uVar4 & uVar9) + local_3c + -0x275e197f + uVar7;
  uVar7 = (uVar7 * 0x4000 | uVar7 >> 0x12) + uVar4;
  uVar9 = (~uVar2 & uVar4 | uVar7 & uVar2) + local_68 + -0x182c0438 + uVar9;
  uVar9 = (uVar9 >> 0xc | uVar9 * 0x100000) + uVar7;
  uVar2 = (~uVar4 & uVar7 | uVar4 & uVar9) + local_54 + 0x21e1cde6 + uVar2;
  uVar2 = (uVar2 * 0x20 | uVar2 >> 0x1b) + uVar9;
  uVar4 = (~uVar7 & uVar9 | uVar7 & uVar2) + local_40 + -0x3cc8f82a + uVar4;
  uVar4 = (uVar4 * 0x200 | uVar4 >> 0x17) + uVar2;
  uVar7 = (~uVar9 & uVar2 | uVar4 & uVar9) + local_78[3] + -0xb2af279 + uVar7;
  uVar7 = (uVar7 * 0x4000 | uVar7 >> 0x12) + uVar4;
  uVar9 = (~uVar2 & uVar4 | uVar7 & uVar2) + local_58 + 0x455a14ed + uVar9;
  uVar9 = (uVar9 >> 0xc | uVar9 * 0x100000) + uVar7;
  uVar2 = (~uVar4 & uVar7 | uVar4 & uVar9) + local_44 + -0x561c16fb + uVar2;
  uVar2 = (uVar2 * 0x20 | uVar2 >> 0x1b) + uVar9;
  uVar4 = (~uVar7 & uVar9 | uVar7 & uVar2) + local_78[2] + -0x3105c08 + uVar4;
  uVar4 = (uVar4 * 0x200 | uVar4 >> 0x17) + uVar2;
  uVar7 = (~uVar9 & uVar2 | uVar4 & uVar9) + local_5c + 0x676f02d9 + uVar7;
  uVar7 = (uVar7 * 0x4000 | uVar7 >> 0x12) + uVar4;
  uVar9 = (~uVar2 & uVar4 | uVar7 & uVar2) + local_48 + -0x72d5b376 + uVar9;
  uVar9 = (uVar9 >> 0xc | uVar9 * 0x100000) + uVar7;
  uVar2 = (uVar4 ^ uVar7 ^ uVar9) + local_64 + -0x5c6be + uVar2;
  uVar2 = (uVar2 * 0x10 | uVar2 >> 0x1c) + uVar9;
  uVar4 = (uVar7 ^ uVar9 ^ uVar2) + local_58 + -0x788e097f + uVar4;
  uVar4 = (uVar4 * 0x800 | uVar4 >> 0x15) + uVar2;
  uVar7 = (uVar4 ^ uVar9 ^ uVar2) + local_4c + 0x6d9d6122 + uVar7;
  uVar7 = (uVar7 * 0x10000 | uVar7 >> 0x10) + uVar4;
  uVar9 = (uVar4 ^ uVar7 ^ uVar2) + local_40 + -0x21ac7f4 + uVar9;
  uVar9 = (uVar9 >> 9 | uVar9 * 0x800000) + uVar7;
  uVar2 = (uVar4 ^ uVar7 ^ uVar9) + local_78[1] + -0x5b4115bc + uVar2;
  uVar2 = (uVar2 * 0x10 | uVar2 >> 0x1c) + uVar9;
  uVar4 = (uVar7 ^ uVar9 ^ uVar2) + local_68 + 0x4bdecfa9 + uVar4;
  uVar4 = (uVar4 * 0x800 | uVar4 >> 0x15) + uVar2;
  uVar7 = (uVar4 ^ uVar9 ^ uVar2) + local_5c + -0x944b4a0 + uVar7;
  uVar7 = (uVar7 * 0x10000 | uVar7 >> 0x10) + uVar4;
  uVar9 = (uVar4 ^ uVar7 ^ uVar2) + local_50 + -0x41404390 + uVar9;
  uVar9 = (uVar9 >> 9 | uVar9 * 0x800000) + uVar7;
  uVar2 = (uVar4 ^ uVar7 ^ uVar9) + local_44 + 0x289b7ec6 + uVar2;
  uVar2 = (uVar2 * 0x10 | uVar2 >> 0x1c) + uVar9;
  uVar4 = (uVar7 ^ uVar9 ^ uVar2) + local_78[0] + -0x155ed806 + uVar4;
  uVar4 = (uVar4 * 0x800 | uVar4 >> 0x15) + uVar2;
  uVar7 = (uVar4 ^ uVar9 ^ uVar2) + local_78[3] + -0x2b10cf7b + uVar7;
  uVar7 = (uVar7 * 0x10000 | uVar7 >> 0x10) + uVar4;
  uVar9 = (uVar4 ^ uVar7 ^ uVar2) + local_60 + 0x4881d05 + uVar9;
  uVar9 = (uVar9 >> 9 | uVar9 * 0x800000) + uVar7;
  uVar2 = (uVar4 ^ uVar7 ^ uVar9) + local_54 + -0x262b2fc7 + uVar2;
  uVar2 = (uVar2 * 0x10 | uVar2 >> 0x1c) + uVar9;
  uVar4 = (uVar7 ^ uVar9 ^ uVar2) + local_48 + -0x1924661b + uVar4;
  uVar4 = (uVar4 * 0x800 | uVar4 >> 0x15) + uVar2;
  uVar7 = (uVar4 ^ uVar9 ^ uVar2) + local_3c + 0x1fa27cf8 + uVar7;
  uVar7 = (uVar7 * 0x10000 | uVar7 >> 0x10) + uVar4;
  uVar9 = (uVar4 ^ uVar7 ^ uVar2) + local_78[2] + -0x3b53a99b + uVar9;
  uVar9 = (uVar9 >> 9 | uVar9 * 0x800000) + uVar7;
  uVar2 = ((~uVar4 | uVar9) ^ uVar7) + local_78[0] + -0xbd6ddbc + uVar2;
  uVar2 = (uVar2 * 0x40 | uVar2 >> 0x1a) + uVar9;
  uVar4 = ((~uVar7 | uVar2) ^ uVar9) + local_5c + 0x432aff97 + uVar4;
  uVar4 = (uVar4 * 0x400 | uVar4 >> 0x16) + uVar2;
  uVar7 = ((~uVar9 | uVar4) ^ uVar2) + local_40 + -0x546bdc59 + uVar7;
  uVar7 = (uVar7 * 0x8000 | uVar7 >> 0x11) + uVar4;
  uVar9 = ((~uVar2 | uVar7) ^ uVar4) + local_64 + -0x36c5fc7 + uVar9;
  uVar9 = (uVar9 >> 0xb | uVar9 * 0x200000) + uVar7;
  uVar2 = ((~uVar4 | uVar9) ^ uVar7) + local_48 + 0x655b59c3 + uVar2;
  uVar2 = (uVar2 * 0x40 | uVar2 >> 0x1a) + uVar9;
  uVar4 = ((~uVar7 | uVar2) ^ uVar9) + local_78[3] + -0x70f3336e + uVar4;
  uVar4 = (uVar4 * 0x400 | uVar4 >> 0x16) + uVar2;
  uVar7 = ((~uVar9 | uVar4) ^ uVar2) + local_50 + -0x100b83 + uVar7;
  uVar7 = (uVar7 * 0x8000 | uVar7 >> 0x11) + uVar4;
  uVar9 = ((~uVar2 | uVar7) ^ uVar4) + local_78[1] + -0x7a7ba22f + uVar9;
  uVar9 = (uVar9 >> 0xb | uVar9 * 0x200000) + uVar7;
  uVar2 = ((~uVar4 | uVar9) ^ uVar7) + local_58 + 0x6fa87e4f + uVar2;
  uVar2 = (uVar2 * 0x40 | uVar2 >> 0x1a) + uVar9;
  uVar4 = ((~uVar7 | uVar2) ^ uVar9) + local_3c + -0x1d31920 + uVar4;
  uVar4 = (uVar4 * 0x400 | uVar4 >> 0x16) + uVar2;
  uVar7 = ((~uVar9 | uVar4) ^ uVar2) + local_60 + -0x5cfebcec + uVar7;
  uVar7 = (uVar7 * 0x8000 | uVar7 >> 0x11) + uVar4;
  uVar9 = ((~uVar2 | uVar7) ^ uVar4) + local_44 + 0x4e0811a1 + uVar9;
  uVar9 = (uVar9 >> 0xb | uVar9 * 0x200000) + uVar7;
  uVar2 = ((~uVar4 | uVar9) ^ uVar7) + local_68 + -0x8ac817e + uVar2;
  uVar5 = (uVar2 * 0x40 | uVar2 >> 0x1a) + uVar9;
  uVar4 = ((~uVar7 | uVar5) ^ uVar9) + local_4c + -0x42c50dcb + uVar4;
  uVar2 = (uVar4 * 0x400 | uVar4 >> 0x16) + uVar5;
  uVar7 = ((~uVar9 | uVar2) ^ uVar5) + local_78[2] + 0x2ad7d2bb + uVar7;
  *param_1 = iVar1 + uVar5;
  uVar4 = (uVar7 * 0x8000 | uVar7 >> 0x11) + uVar2;
  uVar9 = ((~uVar5 | uVar4) ^ uVar2) + local_54 + -0x14792c6f + uVar9;
  param_1[1] = (uVar9 >> 0xb | uVar9 * 0x200000) + param_1[1] + uVar4;
  param_1[2] = param_1[2] + uVar4;
  param_1[3] = param_1[3] + uVar2;
  return;
}



void FUN_1400f4fa0(longlong param_1)

{
  *(undefined4 *)(param_1 + 8) = 0x67452301;
  *(undefined4 *)(param_1 + 0xc) = 0xefcdab89;
  *(undefined4 *)(param_1 + 0x10) = 0x98badcfe;
  *(undefined4 *)(param_1 + 0x14) = 0x10325476;
  *(undefined8 *)(param_1 + 0x18) = 0;
  return;
}



undefined8 * FUN_1400f4fd0(undefined8 *param_1)

{
  *(undefined4 *)(param_1 + 1) = 0x67452301;
  *(undefined4 *)((longlong)param_1 + 0xc) = 0xefcdab89;
  *param_1 = Md5::vftable;
  *(undefined4 *)(param_1 + 2) = 0x98badcfe;
  param_1[3] = 0;
  *(undefined4 *)((longlong)param_1 + 0x14) = 0x10325476;
  return param_1;
}



void FUN_1400f5000(undefined8 *param_1)

{
  *param_1 = Md5::vftable;
  return;
}



void FUN_1400f5010(longlong param_1,longlong param_2,uint param_3)

{
  undefined1 *puVar1;
  ulonglong uVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  
  if ((param_2 != 0) && (param_3 != 0)) {
    uVar5 = *(uint *)(param_1 + 0x18);
    uVar3 = uVar5 + param_3 * 8;
    *(uint *)(param_1 + 0x18) = uVar3;
    uVar5 = uVar5 >> 3 & 0x3f;
    if (uVar3 < param_3 * 8) {
      *(int *)(param_1 + 0x1c) = *(int *)(param_1 + 0x1c) + 1;
    }
    uVar3 = -uVar5 + 0x40;
    *(int *)(param_1 + 0x1c) = *(int *)(param_1 + 0x1c) + (param_3 >> 0x1d);
    if (param_3 < uVar3) {
      uVar4 = 0;
    }
    else {
      if (uVar3 != 0) {
        uVar2 = (ulonglong)uVar3;
        puVar1 = (undefined1 *)((longlong)(int)uVar5 + 0x20 + param_1);
        do {
          uVar2 = uVar2 - 1;
          *puVar1 = puVar1[((param_2 - (int)uVar5) - param_1) + -0x20];
          puVar1 = puVar1 + 1;
        } while (uVar2 != 0);
      }
      FUN_1400f4740(param_1 + 8,param_1 + 0x20);
      uVar5 = -uVar5;
      while (uVar4 = uVar3, uVar5 + 0x7f < param_3) {
        FUN_1400f4740(param_1 + 8,(ulonglong)uVar4 + param_2);
        uVar3 = uVar4 + 0x40;
        uVar5 = uVar4;
      }
      uVar5 = 0;
    }
    if (param_3 - uVar4 != 0) {
      uVar2 = (ulonglong)(param_3 - uVar4);
      puVar1 = (undefined1 *)((longlong)(int)uVar5 + 0x20 + param_1);
      do {
        uVar2 = uVar2 - 1;
        *puVar1 = puVar1[(((longlong)(int)uVar4 - (longlong)(int)uVar5) - param_1) + -0x20 + param_2
                        ];
        puVar1 = puVar1 + 1;
      } while (uVar2 != 0);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400f5150(longlong param_1,longlong param_2)

{
  uint uVar1;
  undefined1 *puVar2;
  undefined1 *puVar3;
  int iVar4;
  longlong lVar5;
  undefined1 auStack_38 [32];
  undefined1 local_18 [8];
  ulonglong local_10;
  
  local_10 = DAT_1402f85a0 ^ (ulonglong)auStack_38;
  lVar5 = 2;
  puVar2 = local_18 + 1;
  puVar3 = (undefined1 *)(param_1 + 0x1a);
  do {
    lVar5 = lVar5 + -1;
    puVar2[-1] = puVar3[-2];
    *puVar2 = puVar3[-1];
    puVar2[1] = *puVar3;
    puVar2[2] = puVar3[1];
    puVar2 = puVar2 + 4;
    puVar3 = puVar3 + 4;
  } while (lVar5 != 0);
  iVar4 = 0x38;
  uVar1 = *(uint *)(param_1 + 0x18) >> 3 & 0x3f;
  if (0x37 < uVar1) {
    iVar4 = 0x78;
  }
  FUN_1400f5010(param_1,&DAT_1402ff550,iVar4 - uVar1);
  FUN_1400f5010(param_1,local_18,8);
  lVar5 = 4;
  puVar2 = (undefined1 *)(param_2 + 1);
  puVar3 = (undefined1 *)(param_1 + 10);
  do {
    lVar5 = lVar5 + -1;
    puVar2[-1] = puVar3[-2];
    *puVar2 = puVar3[-1];
    puVar2[1] = *puVar3;
    puVar2[2] = puVar3[1];
    puVar2 = puVar2 + 4;
    puVar3 = puVar3 + 4;
  } while (lVar5 != 0);
  return;
}



void FUN_1400f5260(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  *(undefined4 *)(param_1 + 8) = 0x67452301;
  *(undefined4 *)(param_1 + 0xc) = 0xefcdab89;
  *(undefined4 *)(param_1 + 0x10) = 0x98badcfe;
  *(undefined4 *)(param_1 + 0x14) = 0x10325476;
  *(undefined8 *)(param_1 + 0x18) = 0;
  uVar1 = FUN_1400bbb10(param_2);
  uVar2 = FUN_1400b8b90(param_2);
  FUN_1400f5010(param_1,uVar2,uVar1);
  FUN_1400f5150(param_1,param_3);
  return;
}



void FUN_1400f52e0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  *(undefined4 *)(param_1 + 8) = 0x67452301;
  *(undefined4 *)(param_1 + 0xc) = 0xefcdab89;
  *(undefined4 *)(param_1 + 0x10) = 0x98badcfe;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x14) = 0x10325476;
  FUN_1400f5010();
  FUN_1400f5150(param_1,param_4);
  return;
}



void FUN_1400f5330(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  *(undefined4 *)(param_1 + 8) = 0x67452301;
  *(undefined4 *)(param_1 + 0xc) = 0xefcdab89;
  *(undefined4 *)(param_1 + 0x10) = 0x98badcfe;
  *(undefined4 *)(param_1 + 0x14) = 0x10325476;
  *(undefined8 *)(param_1 + 0x18) = 0;
  uVar1 = FUN_1400b8b80(param_2);
  uVar2 = FUN_1400b8b90(param_2);
  FUN_1400f5010(param_1,uVar2,uVar1);
  FUN_1400f5150(param_1,param_3);
  return;
}



undefined8 * FUN_1400f53b0(undefined8 *param_1,byte param_2)

{
  *param_1 = Md5::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1400f53e0(undefined8 *param_1)

{
  *param_1 = Md2::vftable;
  return param_1;
}



void FUN_1400f53f0(undefined8 *param_1)

{
  *param_1 = Md2::vftable;
  return;
}



void FUN_1400f5400(longlong param_1)

{
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x28) = 0;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined4 *)(param_1 + 0x58) = 0;
  return;
}



void FUN_1400f5430(longlong param_1)

{
  byte bVar1;
  byte bVar2;
  ulonglong uVar3;
  int iVar4;
  byte *pbVar5;
  longlong lVar6;
  
  lVar6 = 0x10;
  pbVar5 = (byte *)(param_1 + 0x28);
  do {
    lVar6 = lVar6 + -1;
    *pbVar5 = pbVar5[0x20];
    pbVar5[0x10] = pbVar5[-0x10] ^ pbVar5[0x20];
    pbVar5 = pbVar5 + 1;
  } while (lVar6 != 0);
  uVar3 = 0;
  iVar4 = 0;
  do {
    lVar6 = 8;
    pbVar5 = (byte *)(param_1 + 0x19);
    do {
      bVar1 = (&DAT_1402457d0)[uVar3];
      bVar2 = pbVar5[-1];
      pbVar5[-1] = bVar1 ^ bVar2;
      bVar1 = (&DAT_1402457d0)[bVar1 ^ bVar2];
      bVar2 = *pbVar5;
      *pbVar5 = bVar1 ^ bVar2;
      bVar1 = (&DAT_1402457d0)[bVar1 ^ bVar2];
      bVar2 = pbVar5[1];
      pbVar5[1] = bVar1 ^ bVar2;
      bVar1 = (&DAT_1402457d0)[bVar1 ^ bVar2];
      bVar2 = pbVar5[2];
      pbVar5[2] = bVar1 ^ bVar2;
      bVar1 = (&DAT_1402457d0)[bVar1 ^ bVar2];
      bVar2 = pbVar5[3];
      pbVar5[3] = bVar1 ^ bVar2;
      bVar1 = (&DAT_1402457d0)[bVar1 ^ bVar2] ^ pbVar5[4];
      uVar3 = (ulonglong)bVar1;
      lVar6 = lVar6 + -1;
      pbVar5[4] = bVar1;
      pbVar5 = pbVar5 + 6;
    } while (lVar6 != 0);
    uVar3 = (ulonglong)(byte)(bVar1 + (char)iVar4);
    iVar4 = iVar4 + 1;
  } while (iVar4 < 0x12);
  return;
}



void FUN_1400f5510(longlong param_1)

{
  byte bVar1;
  byte bVar2;
  byte bVar3;
  byte *pbVar4;
  longlong lVar5;
  
  bVar3 = *(byte *)(param_1 + 0x17);
  lVar5 = 4;
  pbVar4 = (byte *)(param_1 + 8);
  do {
    bVar1 = *pbVar4;
    bVar3 = (&DAT_1402457d0)[pbVar4[0x40] ^ bVar3];
    *pbVar4 = bVar3 ^ bVar1;
    bVar2 = pbVar4[1];
    bVar3 = (&DAT_1402457d0)[(byte)(pbVar4[0x41] ^ bVar3 ^ bVar1)];
    pbVar4[1] = bVar3 ^ bVar2;
    bVar1 = pbVar4[2];
    bVar3 = (&DAT_1402457d0)[(byte)(pbVar4[0x42] ^ bVar3 ^ bVar2)];
    pbVar4[2] = bVar3 ^ bVar1;
    bVar3 = (&DAT_1402457d0)[(byte)(pbVar4[0x43] ^ bVar3 ^ bVar1)] ^ pbVar4[3];
    lVar5 = lVar5 + -1;
    pbVar4[3] = bVar3;
    pbVar4 = pbVar4 + 4;
  } while (lVar5 != 0);
  return;
}



void FUN_1400f55b0(longlong param_1,void *param_2,uint param_3)

{
  uint uVar1;
  
  if (param_2 != (void *)0x0) {
    while (param_3 != 0) {
      uVar1 = 0x10 - *(int *)(param_1 + 0x58);
      if (param_3 < uVar1) {
        uVar1 = param_3;
      }
      memcpy((void *)((ulonglong)*(uint *)(param_1 + 0x58) + 0x48 + param_1),param_2,
             (ulonglong)uVar1);
      *(int *)(param_1 + 0x58) = *(int *)(param_1 + 0x58) + uVar1;
      param_2 = (void *)((longlong)param_2 + (ulonglong)uVar1);
      param_3 = param_3 - uVar1;
      if (*(int *)(param_1 + 0x58) == 0x10) {
        FUN_1400f5430(param_1);
        FUN_1400f5510(param_1);
        *(undefined4 *)(param_1 + 0x58) = 0;
      }
    }
  }
  return;
}



undefined8 * FUN_1400f5650(undefined8 *param_1,byte param_2)

{
  *param_1 = Md2::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1400f5680(longlong param_1,undefined8 param_2)

{
  uint uVar1;
  
  uVar1 = *(uint *)(param_1 + 0x58);
  if (uVar1 < 0x10) {
    memset((void *)((longlong)(int)uVar1 + 0x48 + param_1),0x10 - uVar1,(ulonglong)(0x10 - uVar1));
  }
  FUN_1400f5430(param_1);
  FUN_1400f5510(param_1);
  *(undefined8 *)(param_1 + 0x48) = *(undefined8 *)(param_1 + 8);
  *(undefined8 *)(param_1 + 0x50) = *(undefined8 *)(param_1 + 0x10);
  FUN_1400f5430(param_1);
  FUN_1400b97e0(param_2,param_1 + 0x18,0x10);
  return;
}



void FUN_1400f5700(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x28) = 0;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined4 *)(param_1 + 0x58) = 0;
  uVar1 = FUN_1400b8b80(param_2);
  uVar2 = FUN_1400b8b90(param_2);
  FUN_1400f55b0(param_1,uVar2,uVar1);
  FUN_1400f5680(param_1,param_3);
  return;
}



void FUN_1400f5790(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x28) = 0;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined4 *)(param_1 + 0x58) = 0;
  FUN_1400f55b0();
  FUN_1400f5680(param_1,param_4);
  return;
}



undefined8 FUN_1400f57f0(undefined8 *param_1,uint *param_2,uint *param_3)

{
  uint uVar1;
  undefined8 local_res8;
  
  uVar1 = (uint)((ulonglong)*param_1 >> 0x20);
  local_res8._0_4_ = (uint)*param_1;
  local_res8 = CONCAT44((uVar1 | param_2[1]) & param_3[1] | uVar1 & param_2[1],
                        ((uint)local_res8 | *param_2) & *param_3 | (uint)local_res8 & *param_2);
  return local_res8;
}



undefined8 FUN_1400f5870(ulonglong *param_1)

{
  ulonglong uVar1;
  uint uVar2;
  undefined8 local_res8;
  
  uVar1 = *param_1;
  local_res8._4_4_ = (uint)(uVar1 >> 0x20);
  uVar2 = (uint)uVar1;
  local_res8 = CONCAT44((local_res8._4_4_ >> 0x1c | uVar2 << 4) ^
                        ((uint)(uVar1 >> 2) & 0x3fffffff | local_res8._4_4_ << 0x1e) ^
                        ((uint)(uVar1 >> 7) & 0x1ffffff | local_res8._4_4_ << 0x19),
                        (uVar2 >> 0x1c | local_res8._4_4_ << 4) ^
                        (uVar2 << 0x1e | local_res8._4_4_ >> 2) ^
                        (uVar2 << 0x19 | local_res8._4_4_ >> 7));
  return local_res8;
}



undefined8 FUN_1400f59c0(ulonglong *param_1)

{
  ulonglong uVar1;
  uint uVar2;
  undefined8 local_res8;
  
  uVar1 = *param_1;
  local_res8._4_4_ = (uint)(uVar1 >> 0x20);
  uVar2 = (uint)uVar1;
  local_res8 = CONCAT44((local_res8._4_4_ >> 0xe | uVar2 << 0x12) ^
                        (local_res8._4_4_ >> 0x12 | uVar2 << 0xe) ^
                        ((uint)(uVar1 >> 9) & 0x7fffff | local_res8._4_4_ << 0x17),
                        (uVar2 >> 0xe | local_res8._4_4_ << 0x12) ^
                        (uVar2 >> 0x12 | local_res8._4_4_ << 0xe) ^
                        (uVar2 << 0x17 | local_res8._4_4_ >> 9));
  return local_res8;
}



undefined8 FUN_1400f5b20(undefined8 *param_1)

{
  uint uVar1;
  undefined8 local_res8;
  undefined4 local_res18;
  
  local_res18 = (uint)*param_1;
  uVar1 = (uint)((ulonglong)*param_1 >> 0x20);
  local_res8 = CONCAT44((uVar1 >> 1 | local_res18 << 0x1f) ^ (uVar1 >> 8 | local_res18 << 0x18) ^
                        (uVar1 >> 7 | local_res18 << 0x19),
                        (local_res18 >> 1 | uVar1 << 0x1f) ^ (local_res18 >> 8 | uVar1 << 0x18) ^
                        local_res18 >> 7);
  return local_res8;
}



undefined8 FUN_1400f5c50(ulonglong *param_1)

{
  ulonglong uVar1;
  uint uVar2;
  undefined8 local_res8;
  undefined4 local_res18;
  
  uVar1 = *param_1;
  local_res18 = (uint)uVar1;
  uVar2 = (uint)(uVar1 >> 0x20);
  local_res8 = CONCAT44((uVar2 >> 0x13 | local_res18 << 0xd) ^
                        ((uint)(uVar1 >> 0x1d) & 7 | uVar2 << 3) ^
                        (uVar2 >> 6 | local_res18 << 0x1a),
                        (local_res18 >> 0x13 | uVar2 << 0xd) ^ (local_res18 << 3 | uVar2 >> 0x1d) ^
                        local_res18 >> 6);
  return local_res8;
}



void FUN_1400f5d70(int *param_1)

{
  int iVar1;
  undefined8 uVar2;
  
  iVar1 = *param_1;
  if (iVar1 == 0) {
    param_1[1] = 0x67452301;
    param_1[2] = -0x10325477;
    param_1[3] = -0x67452302;
    param_1[4] = 0x10325476;
    param_1[5] = -0x3c2d1e10;
    param_1[9] = 0;
    param_1[10] = 0;
    return;
  }
  if (iVar1 != 1) {
    if (iVar1 == 2) {
      param_1[0x2b] = -0x344462a3;
      param_1[0x2c] = -0x3efa6128;
      param_1[0x2d] = 0x629a292a;
      param_1[0x2e] = 0x367cd507;
      param_1[0x2f] = -0x6ea6fea6;
      param_1[0x30] = 0x3070dd17;
      param_1[0x31] = 0x152fecd8;
      param_1[0x32] = -0x8f1a6c7;
      param_1[0x33] = 0x67332667;
      param_1[0x34] = -0x3ff4cf;
      param_1[0x35] = -0x714bb579;
      param_1[0x36] = 0x68581511;
      param_1[0x37] = -0x24f3d1f3;
      param_1[0x38] = 0x64f98fa7;
      uVar2 = 0xbefa4fa447b5481d;
    }
    else {
      if (iVar1 != 3) {
        return;
      }
      param_1[0x2b] = 0x6a09e667;
      param_1[0x2c] = -0xc4336f8;
      param_1[0x2d] = -0x4498517b;
      param_1[0x2e] = -0x7b3558c5;
      param_1[0x2f] = 0x3c6ef372;
      param_1[0x30] = -0x16b07d5;
      param_1[0x31] = -0x5ab00ac6;
      param_1[0x32] = 0x5f1d36f1;
      param_1[0x33] = 0x510e527f;
      param_1[0x34] = -0x52197d2f;
      param_1[0x35] = -0x64fa9774;
      param_1[0x36] = 0x2b3e6c1f;
      param_1[0x37] = 0x1f83d9ab;
      param_1[0x38] = -0x4be4295;
      uVar2 = 0x137e21795be0cd19;
    }
    *(undefined8 *)(param_1 + 0x39) = uVar2;
    param_1[0x3b] = 0;
    param_1[0x3c] = 0;
    param_1[0x3d] = 0;
    param_1[0x3e] = 0;
    return;
  }
  param_1[1] = 0x6a09e667;
  param_1[2] = -0x4498517b;
  param_1[3] = 0x3c6ef372;
  param_1[4] = -0x5ab00ac6;
  param_1[5] = 0x510e527f;
  param_1[6] = -0x64fa9774;
  param_1[7] = 0x1f83d9ab;
  param_1[8] = 0x5be0cd19;
  param_1[9] = 0;
  param_1[10] = 0;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1400f5ef0(int *param_1)

{
  undefined1 *puVar1;
  undefined1 *puVar2;
  undefined1 *puVar3;
  undefined1 *puVar4;
  ulonglong uVar5;
  uint uVar6;
  int iVar7;
  uint uVar8;
  uint uVar9;
  uint uVar10;
  uint uVar11;
  uint uVar12;
  undefined8 uVar13;
  undefined8 uVar14;
  undefined8 uVar15;
  uint uVar16;
  uint uVar17;
  uint *puVar18;
  undefined1 *puVar19;
  int *piVar20;
  uint uVar21;
  int iVar22;
  uint uVar23;
  longlong lVar24;
  longlong lVar25;
  undefined1 auStack_398 [32];
  undefined8 local_378;
  undefined8 local_370;
  undefined8 local_368;
  undefined8 local_360;
  undefined8 local_358;
  undefined8 local_350;
  uint local_348;
  uint uStack_344;
  undefined8 local_340;
  undefined8 local_338;
  undefined8 local_330;
  undefined8 local_328;
  undefined8 local_320;
  undefined8 local_318;
  undefined8 local_310;
  uint local_308;
  undefined8 local_300;
  uint local_2f8;
  uint uStack_2f4;
  undefined8 local_2f0;
  undefined8 local_2e8;
  ulonglong local_2e0;
  ulonglong local_2d8;
  undefined8 local_2d0;
  undefined8 local_2c8;
  undefined8 local_2c0;
  uint local_2b8 [23];
  uint local_25c;
  int local_258;
  uint local_254;
  int local_250;
  uint local_24c;
  int local_248;
  uint local_244;
  int local_240;
  uint local_23c;
  int local_238;
  uint uStack_234;
  int local_230;
  uint local_22c;
  int local_228;
  uint local_224;
  int local_220;
  uint local_21c;
  int local_218;
  uint local_214;
  int local_210;
  uint local_20c;
  int local_208;
  uint local_204;
  int local_200;
  uint local_1fc;
  int local_1f8;
  uint local_1f4;
  int local_1f0;
  uint local_1ec;
  int local_1e8;
  uint local_1e4;
  int local_1e0;
  uint local_1dc;
  int local_1d8;
  uint local_1d4;
  int local_1d0;
  uint local_1cc;
  int local_1c8;
  uint local_1c4;
  int local_1c0;
  uint local_1bc;
  int local_1b8;
  uint local_1b4;
  int local_1b0;
  uint local_1ac;
  int local_1a8;
  uint local_1a4;
  int local_1a0;
  uint local_19c;
  int local_198;
  uint local_194;
  int local_190;
  uint local_18c;
  int local_188;
  uint local_184;
  int local_180;
  uint local_17c;
  int local_178;
  uint local_174;
  int local_170;
  uint local_16c;
  int local_168;
  uint local_164;
  int local_160;
  uint local_15c;
  int local_158;
  uint local_154;
  int local_150;
  uint local_14c;
  int local_148;
  uint local_144;
  int local_140;
  uint local_13c;
  int local_138;
  uint local_134;
  int local_130;
  uint local_12c;
  int local_128;
  uint local_124;
  int local_120;
  uint local_11c;
  int local_118;
  uint local_114;
  int local_110;
  uint local_10c;
  int local_108;
  uint local_104;
  int local_100;
  uint local_fc;
  int local_f8;
  uint local_f4;
  int local_f0;
  uint local_ec;
  int local_e8;
  uint local_e4;
  int local_e0;
  uint local_dc;
  int local_d8;
  uint local_d4;
  int local_d0;
  uint local_cc;
  int local_c8;
  uint local_c4;
  int local_c0;
  uint local_bc;
  int local_b8;
  uint local_b4;
  int local_b0;
  uint local_ac;
  int local_a8;
  uint local_a4;
  int local_a0;
  uint local_9c;
  int local_98;
  uint local_94;
  int local_90;
  uint local_8c;
  int local_88;
  uint local_84;
  int local_80;
  uint local_7c;
  int local_78;
  uint local_74;
  int local_70;
  uint local_6c;
  int local_68;
  uint local_64;
  int local_60;
  uint local_5c;
  int local_58;
  uint local_54;
  int local_50;
  uint local_4c;
  int local_48;
  uint local_44;
  int local_40;
  uint local_3c;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_398;
  iVar22 = *param_1;
  if (iVar22 == 0) {
    lVar24 = 0;
    piVar20 = param_1 + 0xb;
    lVar25 = lVar24;
    do {
      lVar25 = lVar25 + 4;
      *(uint *)((longlong)&local_2c8 + lVar25 * 4) =
           CONCAT31(CONCAT21(CONCAT11((char)*piVar20,*(undefined1 *)((longlong)piVar20 + 1)),
                             *(undefined1 *)((longlong)piVar20 + 2)),
                    *(undefined1 *)((longlong)piVar20 + 3));
      *(uint *)((longlong)&local_2c8 + lVar25 * 4 + 4) =
           CONCAT31(CONCAT21(CONCAT11((char)piVar20[1],*(undefined1 *)((longlong)piVar20 + 5)),
                             *(undefined1 *)((longlong)piVar20 + 6)),
                    *(undefined1 *)((longlong)piVar20 + 7));
      *(uint *)((longlong)&local_2c0 + lVar25 * 4) =
           CONCAT31(CONCAT21(CONCAT11((char)piVar20[2],*(undefined1 *)((longlong)piVar20 + 9)),
                             *(undefined1 *)((longlong)piVar20 + 10)),
                    *(undefined1 *)((longlong)piVar20 + 0xb));
      *(uint *)((longlong)&local_2c0 + lVar25 * 4 + 4) =
           CONCAT31(CONCAT21(CONCAT11((char)piVar20[3],*(undefined1 *)((longlong)piVar20 + 0xd)),
                             *(undefined1 *)((longlong)piVar20 + 0xe)),
                    *(undefined1 *)((longlong)piVar20 + 0xf));
      piVar20 = piVar20 + 4;
    } while (lVar25 < 0x10);
    lVar25 = 0x10;
    puVar18 = local_2b8 + 8;
    do {
      uVar6 = puVar18[-8] ^ puVar18[5] ^ *puVar18 ^ puVar18[-6];
      puVar18[8] = uVar6 << 1 | (uint)((int)uVar6 < 0);
      uVar6 = puVar18[-7] ^ puVar18[6] ^ puVar18[1] ^ puVar18[-5];
      puVar18[9] = uVar6 << 1 | (uint)((int)uVar6 < 0);
      uVar6 = puVar18[7] ^ puVar18[-4] ^ puVar18[2] ^ puVar18[-6];
      puVar18[10] = uVar6 << 1 | (uint)((int)uVar6 < 0);
      uVar6 = puVar18[-3] ^ puVar18[3] ^ puVar18[8] ^ puVar18[-5];
      lVar25 = lVar25 + -1;
      puVar18[0xb] = uVar6 << 1 | (uint)((int)uVar6 < 0);
      puVar18 = puVar18 + 4;
    } while (lVar25 != 0);
    uVar6 = param_1[2];
    uVar17 = param_1[3];
    uVar16 = param_1[4];
    uVar8 = param_1[5];
    uVar9 = param_1[1];
    do {
      lVar24 = lVar24 + 5;
      uVar23 = uVar6 >> 2 | uVar6 << 0x1e;
      uVar6 = (uVar9 << 5 | uVar9 >> 0x1b) + (~uVar6 & uVar16 | uVar17 & uVar6) +
              *(int *)((longlong)&local_2d0 + lVar24 * 4 + 4) + 0x5a827999 + uVar8;
      uVar12 = uVar9 >> 2 | uVar9 << 0x1e;
      uVar9 = (uVar6 * 0x20 | uVar6 >> 0x1b) + (~uVar9 & uVar17 | uVar23 & uVar9) +
              *(int *)((longlong)&local_2c8 + lVar24 * 4) + 0x5a827999 + uVar16;
      uVar8 = uVar6 >> 2 | uVar6 * 0x40000000;
      uVar21 = (uVar9 * 0x20 | uVar9 >> 0x1b) + (~uVar6 & uVar23 | uVar12 & uVar6) +
               *(int *)((longlong)&local_2c8 + lVar24 * 4 + 4) + 0x5a827999 + uVar17;
      uVar16 = uVar9 >> 2 | uVar9 * 0x40000000;
      uVar6 = (uVar21 * 0x20 | uVar21 >> 0x1b) + (~uVar9 & uVar12 | uVar8 & uVar9) +
              *(int *)((longlong)&local_2c0 + lVar24 * 4) + 0x5a827999 + uVar23;
      uVar17 = uVar21 >> 2 | uVar21 * 0x40000000;
      uVar9 = (uVar6 * 0x20 | uVar6 >> 0x1b) + (~uVar21 & uVar8 | uVar16 & uVar21) +
              *(int *)((longlong)&local_2c0 + lVar24 * 4 + 4) + 0x5a827999 + uVar12;
    } while (lVar24 < 0x14);
    lVar25 = 0x14;
    do {
      lVar25 = lVar25 + 5;
      uVar23 = uVar6 >> 2 | uVar6 << 0x1e;
      uVar6 = (uVar9 << 5 | uVar9 >> 0x1b) + (uVar16 ^ uVar17 ^ uVar6) +
              *(int *)((longlong)&local_2d0 + lVar25 * 4 + 4) + 0x6ed9eba1 + uVar8;
      uVar12 = uVar9 >> 2 | uVar9 << 0x1e;
      uVar9 = (uVar6 * 0x20 | uVar6 >> 0x1b) + (uVar17 ^ uVar23 ^ uVar9) +
              *(int *)((longlong)&local_2c8 + lVar25 * 4) + 0x6ed9eba1 + uVar16;
      uVar8 = uVar6 >> 2 | uVar6 * 0x40000000;
      uVar21 = (uVar9 * 0x20 | uVar9 >> 0x1b) + (uVar23 ^ uVar12 ^ uVar6) +
               *(int *)((longlong)&local_2c8 + lVar25 * 4 + 4) + 0x6ed9eba1 + uVar17;
      uVar16 = uVar9 >> 2 | uVar9 * 0x40000000;
      uVar6 = (uVar21 * 0x20 | uVar21 >> 0x1b) + (uVar12 ^ uVar8 ^ uVar9) +
              *(int *)((longlong)&local_2c0 + lVar25 * 4) + 0x6ed9eba1 + uVar23;
      uVar17 = uVar21 >> 2 | uVar21 * 0x40000000;
      uVar9 = (uVar6 * 0x20 | uVar6 >> 0x1b) + (uVar8 ^ uVar16 ^ uVar21) +
              *(int *)((longlong)&local_2c0 + lVar25 * 4 + 4) + 0x6ed9eba1 + uVar12;
    } while (lVar25 < 0x28);
    lVar25 = 0x28;
    do {
      lVar25 = lVar25 + 5;
      uVar23 = uVar6 >> 2 | uVar6 << 0x1e;
      uVar6 = ((uVar17 | uVar6) & uVar16 | uVar17 & uVar6) +
              *(int *)((longlong)&local_2d0 + lVar25 * 4 + 4) + -0x70e44324 +
              (uVar9 << 5 | uVar9 >> 0x1b) + uVar8;
      uVar12 = uVar9 >> 2 | uVar9 << 0x1e;
      uVar9 = ((uVar23 | uVar9) & uVar17 | uVar23 & uVar9) +
              *(int *)((longlong)&local_2c8 + lVar25 * 4) + -0x70e44324 +
              (uVar6 * 0x20 | uVar6 >> 0x1b) + uVar16;
      uVar8 = uVar6 >> 2 | uVar6 * 0x40000000;
      uVar21 = ((uVar12 | uVar6) & uVar23 | uVar12 & uVar6) +
               *(int *)((longlong)&local_2c8 + lVar25 * 4 + 4) + -0x70e44324 +
               (uVar9 * 0x20 | uVar9 >> 0x1b) + uVar17;
      uVar16 = uVar9 >> 2 | uVar9 * 0x40000000;
      uVar6 = ((uVar8 | uVar9) & uVar12 | uVar8 & uVar9) +
              *(int *)((longlong)&local_2c0 + lVar25 * 4) + -0x70e44324 +
              (uVar21 * 0x20 | uVar21 >> 0x1b) + uVar23;
      uVar17 = uVar21 >> 2 | uVar21 * 0x40000000;
      uVar9 = ((uVar16 | uVar21) & uVar8 | uVar16 & uVar21) +
              *(int *)((longlong)&local_2c0 + lVar25 * 4 + 4) + -0x70e44324 +
              (uVar6 * 0x20 | uVar6 >> 0x1b) + uVar12;
    } while (lVar25 < 0x3c);
    lVar25 = 0x3c;
    do {
      lVar25 = lVar25 + 5;
      uVar23 = uVar6 >> 2 | uVar6 << 0x1e;
      uVar6 = (uVar16 ^ uVar17 ^ uVar6) + *(int *)((longlong)&local_2d0 + lVar25 * 4 + 4) +
              -0x359d3e2a + (uVar9 << 5 | uVar9 >> 0x1b) + uVar8;
      uVar12 = uVar9 >> 2 | uVar9 << 0x1e;
      uVar9 = (uVar17 ^ uVar23 ^ uVar9) + *(int *)((longlong)&local_2c8 + lVar25 * 4) + -0x359d3e2a
              + (uVar6 * 0x20 | uVar6 >> 0x1b) + uVar16;
      uVar8 = uVar6 >> 2 | uVar6 * 0x40000000;
      uVar21 = (uVar23 ^ uVar12 ^ uVar6) + *(int *)((longlong)&local_2c8 + lVar25 * 4 + 4) +
               -0x359d3e2a + (uVar9 * 0x20 | uVar9 >> 0x1b) + uVar17;
      uVar16 = uVar9 >> 2 | uVar9 * 0x40000000;
      uVar6 = (uVar12 ^ uVar8 ^ uVar9) + *(int *)((longlong)&local_2c0 + lVar25 * 4) + -0x359d3e2a +
              (uVar21 * 0x20 | uVar21 >> 0x1b) + uVar23;
      uVar17 = uVar21 >> 2 | uVar21 * 0x40000000;
      uVar9 = (uVar8 ^ uVar16 ^ uVar21) + *(int *)((longlong)&local_2c0 + lVar25 * 4 + 4) +
              -0x359d3e2a + (uVar6 * 0x20 | uVar6 >> 0x1b) + uVar12;
    } while (lVar25 < 0x50);
    param_1[1] = param_1[1] + uVar9;
    param_1[2] = param_1[2] + uVar6;
    param_1[3] = param_1[3] + uVar17;
    param_1[4] = param_1[4] + uVar16;
    param_1[5] = param_1[5] + uVar8;
  }
  else if (iVar22 == 1) {
    lVar25 = 0;
    piVar20 = param_1 + 0xb;
    do {
      lVar25 = lVar25 + 4;
      *(uint *)((longlong)&local_2c8 + lVar25 * 4) =
           CONCAT31(CONCAT21(CONCAT11((char)*piVar20,*(undefined1 *)((longlong)piVar20 + 1)),
                             *(undefined1 *)((longlong)piVar20 + 2)),
                    *(undefined1 *)((longlong)piVar20 + 3));
      *(uint *)((longlong)&local_2c8 + lVar25 * 4 + 4) =
           CONCAT31(CONCAT21(CONCAT11((char)piVar20[1],*(undefined1 *)((longlong)piVar20 + 5)),
                             *(undefined1 *)((longlong)piVar20 + 6)),
                    *(undefined1 *)((longlong)piVar20 + 7));
      *(uint *)((longlong)&local_2c0 + lVar25 * 4) =
           CONCAT31(CONCAT21(CONCAT11((char)piVar20[2],*(undefined1 *)((longlong)piVar20 + 9)),
                             *(undefined1 *)((longlong)piVar20 + 10)),
                    *(undefined1 *)((longlong)piVar20 + 0xb));
      *(uint *)((longlong)&local_2c0 + lVar25 * 4 + 4) =
           CONCAT31(CONCAT21(CONCAT11((char)piVar20[3],*(undefined1 *)((longlong)piVar20 + 0xd)),
                             *(undefined1 *)((longlong)piVar20 + 0xe)),
                    *(undefined1 *)((longlong)piVar20 + 0xf));
      piVar20 = piVar20 + 4;
    } while (lVar25 < 0x10);
    lVar25 = 0xc;
    puVar18 = local_2b8;
    do {
      uVar6 = puVar18[1];
      uVar9 = puVar18[0xe];
      puVar18[0x10] =
           ((uVar6 << 0xe | uVar6 >> 0x12) ^ (uVar6 >> 7 | uVar6 << 0x19) ^ uVar6 >> 3) +
           ((uVar9 << 0xf | uVar9 >> 0x11) ^ (uVar9 << 0xd | uVar9 >> 0x13) ^ uVar9 >> 10) +
           puVar18[9] + *puVar18;
      uVar6 = puVar18[2];
      uVar9 = puVar18[0xf];
      puVar18[0x11] =
           ((uVar6 << 0xe | uVar6 >> 0x12) ^ (uVar6 >> 7 | uVar6 << 0x19) ^ uVar6 >> 3) +
           ((uVar9 << 0xf | uVar9 >> 0x11) ^ (uVar9 << 0xd | uVar9 >> 0x13) ^ uVar9 >> 10) +
           puVar18[10] + puVar18[1];
      uVar6 = puVar18[3];
      uVar9 = puVar18[0x10];
      puVar18[0x12] =
           ((uVar6 << 0xe | uVar6 >> 0x12) ^ (uVar6 >> 7 | uVar6 << 0x19) ^ uVar6 >> 3) +
           ((uVar9 << 0xf | uVar9 >> 0x11) ^ (uVar9 << 0xd | uVar9 >> 0x13) ^ uVar9 >> 10) +
           puVar18[0xb] + puVar18[2];
      uVar6 = puVar18[4];
      uVar9 = puVar18[0x11];
      puVar18[0x13] =
           ((uVar6 << 0xe | uVar6 >> 0x12) ^ (uVar6 >> 7 | uVar6 << 0x19) ^ uVar6 >> 3) +
           ((uVar9 << 0xf | uVar9 >> 0x11) ^ (uVar9 << 0xd | uVar9 >> 0x13) ^ uVar9 >> 10) +
           puVar18[0xc] + puVar18[3];
      lVar25 = lVar25 + -1;
      puVar18 = puVar18 + 4;
    } while (lVar25 != 0);
    uVar6 = param_1[5];
    uVar9 = param_1[1];
    uVar17 = param_1[7];
    uVar16 = param_1[6];
    uVar8 = param_1[2];
    iVar22 = ((uVar6 >> 0xb | uVar6 << 0x15) ^ (uVar6 << 7 | uVar6 >> 0x19) ^
             (uVar6 >> 6 | uVar6 << 0x1a)) + ((uVar17 ^ uVar16) & uVar6 ^ uVar17) + param_1[8] +
             0x428a2f98 + local_2b8[0];
    uVar11 = ((uVar8 | uVar9) & param_1[3] | uVar8 & uVar9) +
             iVar22 + ((uVar9 >> 0xd | uVar9 << 0x13) ^ (uVar9 << 10 | uVar9 >> 0x16) ^
                      (uVar9 >> 2 | uVar9 << 0x1e));
    uVar12 = iVar22 + param_1[4];
    iVar22 = ((uVar16 ^ uVar6) & uVar12 ^ uVar16) +
             ((uVar12 >> 0xb | uVar12 * 0x200000) ^ (uVar12 * 0x80 | uVar12 >> 0x19) ^
             (uVar12 >> 6 | uVar12 * 0x4000000)) + local_2b8[1] + 0x71374491 + uVar17;
    uVar17 = param_1[3] + iVar22;
    uVar21 = ((uVar11 | uVar9) & uVar8 | uVar11 & uVar9) +
             iVar22 + ((uVar11 >> 0xd | uVar11 * 0x80000) ^ (uVar11 * 0x400 | uVar11 >> 0x16) ^
                      (uVar11 >> 2 | uVar11 * 0x40000000));
    iVar22 = ((uVar6 ^ uVar12) & uVar17 ^ uVar6) +
             ((uVar17 >> 0xb | uVar17 * 0x200000) ^ (uVar17 * 0x80 | uVar17 >> 0x19) ^
             (uVar17 >> 6 | uVar17 * 0x4000000)) + local_2b8[2] + -0x4a3f0431 + uVar16;
    uVar8 = uVar8 + iVar22;
    uVar16 = ((uVar11 | uVar21) & uVar9 | uVar11 & uVar21) +
             iVar22 + ((uVar21 >> 0xd | uVar21 * 0x80000) ^ (uVar21 * 0x400 | uVar21 >> 0x16) ^
                      (uVar21 >> 2 | uVar21 * 0x40000000));
    iVar22 = ((uVar12 ^ uVar17) & uVar8 ^ uVar12) +
             ((uVar8 >> 0xb | uVar8 * 0x200000) ^ (uVar8 * 0x80 | uVar8 >> 0x19) ^
             (uVar8 >> 6 | uVar8 * 0x4000000)) + local_2b8[3] + -0x164a245b + uVar6;
    uVar9 = uVar9 + iVar22;
    uVar23 = ((uVar21 | uVar16) & uVar11 | uVar21 & uVar16) +
             iVar22 + ((uVar16 >> 0xd | uVar16 * 0x80000) ^ (uVar16 * 0x400 | uVar16 >> 0x16) ^
                      (uVar16 >> 2 | uVar16 * 0x40000000));
    iVar22 = ((uVar17 ^ uVar8) & uVar9 ^ uVar17) +
             ((uVar9 >> 0xb | uVar9 * 0x200000) ^ (uVar9 * 0x80 | uVar9 >> 0x19) ^
             (uVar9 >> 6 | uVar9 * 0x4000000)) + local_2b8[4] + 0x3956c25b + uVar12;
    uVar11 = uVar11 + iVar22;
    uVar12 = ((uVar16 | uVar23) & uVar21 | uVar16 & uVar23) +
             iVar22 + ((uVar23 >> 0xd | uVar23 * 0x80000) ^ (uVar23 * 0x400 | uVar23 >> 0x16) ^
                      (uVar23 >> 2 | uVar23 * 0x40000000));
    iVar22 = ((uVar8 ^ uVar9) & uVar11 ^ uVar8) +
             ((uVar11 >> 0xb | uVar11 * 0x200000) ^ (uVar11 * 0x80 | uVar11 >> 0x19) ^
             (uVar11 >> 6 | uVar11 * 0x4000000)) + local_2b8[5] + 0x59f111f1 + uVar17;
    uVar21 = uVar21 + iVar22;
    uVar6 = ((uVar23 | uVar12) & uVar16 | uVar23 & uVar12) +
            iVar22 + ((uVar12 >> 0xd | uVar12 * 0x80000) ^ (uVar12 * 0x400 | uVar12 >> 0x16) ^
                     (uVar12 >> 2 | uVar12 * 0x40000000));
    iVar22 = ((uVar11 ^ uVar9) & uVar21 ^ uVar9) +
             ((uVar21 >> 0xb | uVar21 * 0x200000) ^ (uVar21 * 0x80 | uVar21 >> 0x19) ^
             (uVar21 >> 6 | uVar21 * 0x4000000)) + local_2b8[6] + -0x6dc07d5c + uVar8;
    uVar16 = uVar16 + iVar22;
    uVar17 = ((uVar12 | uVar6) & uVar23 | uVar12 & uVar6) +
             iVar22 + ((uVar6 >> 0xd | uVar6 * 0x80000) ^ (uVar6 * 0x400 | uVar6 >> 0x16) ^
                      (uVar6 >> 2 | uVar6 * 0x40000000));
    iVar22 = ((uVar11 ^ uVar21) & uVar16 ^ uVar11) +
             ((uVar16 >> 0xb | uVar16 * 0x200000) ^ (uVar16 * 0x80 | uVar16 >> 0x19) ^
             (uVar16 >> 6 | uVar16 * 0x4000000)) + local_2b8[7] + -0x54e3a12b + uVar9;
    uVar23 = uVar23 + iVar22;
    uVar10 = ((uVar6 | uVar17) & uVar12 | uVar6 & uVar17) +
             iVar22 + ((uVar17 >> 0xd | uVar17 * 0x80000) ^ (uVar17 * 0x400 | uVar17 >> 0x16) ^
                      (uVar17 >> 2 | uVar17 * 0x40000000));
    iVar22 = ((uVar21 ^ uVar16) & uVar23 ^ uVar21) +
             ((uVar23 >> 0xb | uVar23 * 0x200000) ^ (uVar23 * 0x80 | uVar23 >> 0x19) ^
             (uVar23 >> 6 | uVar23 * 0x4000000)) + local_2b8[8] + -0x27f85568 + uVar11;
    uVar12 = uVar12 + iVar22;
    uVar11 = ((uVar17 | uVar10) & uVar6 | uVar17 & uVar10) +
             iVar22 + ((uVar10 >> 0xd | uVar10 * 0x80000) ^ (uVar10 * 0x400 | uVar10 >> 0x16) ^
                      (uVar10 >> 2 | uVar10 * 0x40000000));
    iVar22 = ((uVar16 ^ uVar23) & uVar12 ^ uVar16) +
             ((uVar12 >> 0xb | uVar12 * 0x200000) ^ (uVar12 * 0x80 | uVar12 >> 0x19) ^
             (uVar12 >> 6 | uVar12 * 0x4000000)) + local_2b8[9] + 0x12835b01 + uVar21;
    uVar6 = uVar6 + iVar22;
    uVar9 = ((uVar11 | uVar10) & uVar17 | uVar11 & uVar10) +
            iVar22 + ((uVar11 >> 0xd | uVar11 * 0x80000) ^ (uVar11 * 0x400 | uVar11 >> 0x16) ^
                     (uVar11 >> 2 | uVar11 * 0x40000000));
    iVar22 = ((uVar23 ^ uVar12) & uVar6 ^ uVar23) +
             ((uVar6 >> 0xb | uVar6 * 0x200000) ^ (uVar6 * 0x80 | uVar6 >> 0x19) ^
             (uVar6 >> 6 | uVar6 * 0x4000000)) + local_2b8[10] + 0x243185be + uVar16;
    uVar17 = uVar17 + iVar22;
    uVar16 = ((uVar11 | uVar9) & uVar10 | uVar11 & uVar9) +
             iVar22 + ((uVar9 >> 0xd | uVar9 * 0x80000) ^ (uVar9 * 0x400 | uVar9 >> 0x16) ^
                      (uVar9 >> 2 | uVar9 * 0x40000000));
    iVar22 = ((uVar12 ^ uVar6) & uVar17 ^ uVar12) +
             ((uVar17 >> 0xb | uVar17 * 0x200000) ^ (uVar17 * 0x80 | uVar17 >> 0x19) ^
             (uVar17 >> 6 | uVar17 * 0x4000000)) + local_2b8[0xb] + 0x550c7dc3 + uVar23;
    uVar10 = uVar10 + iVar22;
    uVar21 = ((uVar9 | uVar16) & uVar11 | uVar9 & uVar16) +
             iVar22 + ((uVar16 >> 0xd | uVar16 * 0x80000) ^ (uVar16 * 0x400 | uVar16 >> 0x16) ^
                      (uVar16 >> 2 | uVar16 * 0x40000000));
    iVar22 = ((uVar6 ^ uVar17) & uVar10 ^ uVar6) +
             ((uVar10 >> 0xb | uVar10 * 0x200000) ^ (uVar10 * 0x80 | uVar10 >> 0x19) ^
             (uVar10 >> 6 | uVar10 * 0x4000000)) + local_2b8[0xc] + 0x72be5d74 + uVar12;
    uVar11 = uVar11 + iVar22;
    uVar8 = ((uVar16 | uVar21) & uVar9 | uVar16 & uVar21) +
            iVar22 + ((uVar21 >> 0xd | uVar21 * 0x80000) ^ (uVar21 * 0x400 | uVar21 >> 0x16) ^
                     (uVar21 >> 2 | uVar21 * 0x40000000));
    iVar22 = ((uVar17 ^ uVar10) & uVar11 ^ uVar17) +
             ((uVar11 >> 0xb | uVar11 * 0x200000) ^ (uVar11 * 0x80 | uVar11 >> 0x19) ^
             (uVar11 >> 6 | uVar11 * 0x4000000)) + local_2b8[0xd] + -0x7f214e02 + uVar6;
    uVar9 = uVar9 + iVar22;
    uVar6 = ((uVar21 | uVar8) & uVar16 | uVar21 & uVar8) +
            iVar22 + ((uVar8 >> 0xd | uVar8 * 0x80000) ^ (uVar8 * 0x400 | uVar8 >> 0x16) ^
                     (uVar8 >> 2 | uVar8 * 0x40000000));
    iVar22 = ((uVar11 ^ uVar10) & uVar9 ^ uVar10) +
             ((uVar9 >> 0xb | uVar9 * 0x200000) ^ (uVar9 * 0x80 | uVar9 >> 0x19) ^
             (uVar9 >> 6 | uVar9 * 0x4000000)) + local_2b8[0xe] + -0x6423f959 + uVar17;
    uVar17 = ((uVar8 | uVar6) & uVar21 | uVar8 & uVar6) +
             iVar22 + ((uVar6 >> 0xd | uVar6 * 0x80000) ^ (uVar6 * 0x400 | uVar6 >> 0x16) ^
                      (uVar6 >> 2 | uVar6 * 0x40000000));
    uVar16 = uVar16 + iVar22;
    iVar22 = ((uVar11 ^ uVar9) & uVar16 ^ uVar11) +
             ((uVar16 >> 0xb | uVar16 * 0x200000) ^ (uVar16 * 0x80 | uVar16 >> 0x19) ^
             (uVar16 >> 6 | uVar16 * 0x4000000)) + local_2b8[0xf] + -0x3e640e8c + uVar10;
    uVar21 = uVar21 + iVar22;
    uVar12 = ((uVar6 | uVar17) & uVar8 | uVar6 & uVar17) +
             iVar22 + ((uVar17 >> 0xd | uVar17 * 0x80000) ^ (uVar17 * 0x400 | uVar17 >> 0x16) ^
                      (uVar17 >> 2 | uVar17 * 0x40000000));
    iVar22 = ((uVar9 ^ uVar16) & uVar21 ^ uVar9) +
             ((uVar21 >> 0xb | uVar21 * 0x200000) ^ (uVar21 * 0x80 | uVar21 >> 0x19) ^
             (uVar21 >> 6 | uVar21 * 0x4000000)) + local_2b8[0x10] + -0x1b64963f + uVar11;
    uVar8 = uVar8 + iVar22;
    uVar23 = ((uVar17 | uVar12) & uVar6 | uVar17 & uVar12) +
             iVar22 + ((uVar12 >> 0xd | uVar12 * 0x80000) ^ (uVar12 * 0x400 | uVar12 >> 0x16) ^
                      (uVar12 >> 2 | uVar12 * 0x40000000));
    iVar22 = ((uVar16 ^ uVar21) & uVar8 ^ uVar16) +
             ((uVar8 >> 0xb | uVar8 * 0x200000) ^ (uVar8 * 0x80 | uVar8 >> 0x19) ^
             (uVar8 >> 6 | uVar8 * 0x4000000)) + local_2b8[0x11] + -0x1041b87a + uVar9;
    uVar6 = uVar6 + iVar22;
    uVar9 = ((uVar23 | uVar12) & uVar17 | uVar23 & uVar12) +
            iVar22 + ((uVar23 >> 0xd | uVar23 * 0x80000) ^ (uVar23 * 0x400 | uVar23 >> 0x16) ^
                     (uVar23 >> 2 | uVar23 * 0x40000000));
    iVar22 = ((uVar21 ^ uVar8) & uVar6 ^ uVar21) +
             ((uVar6 >> 0xb | uVar6 * 0x200000) ^ (uVar6 * 0x80 | uVar6 >> 0x19) ^
             (uVar6 >> 6 | uVar6 * 0x4000000)) + local_2b8[0x12] + 0xfc19dc6 + uVar16;
    uVar17 = uVar17 + iVar22;
    uVar16 = ((uVar23 | uVar9) & uVar12 | uVar23 & uVar9) +
             iVar22 + ((uVar9 >> 0xd | uVar9 * 0x80000) ^ (uVar9 * 0x400 | uVar9 >> 0x16) ^
                      (uVar9 >> 2 | uVar9 * 0x40000000));
    iVar22 = ((uVar8 ^ uVar6) & uVar17 ^ uVar8) +
             ((uVar17 >> 0xb | uVar17 * 0x200000) ^ (uVar17 * 0x80 | uVar17 >> 0x19) ^
             (uVar17 >> 6 | uVar17 * 0x4000000)) + local_2b8[0x13] + 0x240ca1cc + uVar21;
    uVar21 = ((uVar9 | uVar16) & uVar23 | uVar9 & uVar16) +
             iVar22 + ((uVar16 >> 0xd | uVar16 * 0x80000) ^ (uVar16 * 0x400 | uVar16 >> 0x16) ^
                      (uVar16 >> 2 | uVar16 * 0x40000000));
    uVar12 = uVar12 + iVar22;
    iVar22 = ((uVar6 ^ uVar17) & uVar12 ^ uVar6) +
             ((uVar12 >> 0xb | uVar12 * 0x200000) ^ (uVar12 * 0x80 | uVar12 >> 0x19) ^
             (uVar12 >> 6 | uVar12 * 0x4000000)) + local_2b8[0x14] + 0x2de92c6f + uVar8;
    uVar23 = uVar23 + iVar22;
    uVar8 = ((uVar16 | uVar21) & uVar9 | uVar16 & uVar21) +
            iVar22 + ((uVar21 >> 0xd | uVar21 * 0x80000) ^ (uVar21 * 0x400 | uVar21 >> 0x16) ^
                     (uVar21 >> 2 | uVar21 * 0x40000000));
    iVar22 = ((uVar17 ^ uVar12) & uVar23 ^ uVar17) +
             ((uVar23 >> 0xb | uVar23 * 0x200000) ^ (uVar23 * 0x80 | uVar23 >> 0x19) ^
             (uVar23 >> 6 | uVar23 * 0x4000000)) + local_2b8[0x15] + 0x4a7484aa + uVar6;
    uVar9 = uVar9 + iVar22;
    uVar6 = ((uVar21 | uVar8) & uVar16 | uVar21 & uVar8) +
            iVar22 + ((uVar8 >> 0xd | uVar8 * 0x80000) ^ (uVar8 * 0x400 | uVar8 >> 0x16) ^
                     (uVar8 >> 2 | uVar8 * 0x40000000));
    iVar22 = ((uVar23 ^ uVar12) & uVar9 ^ uVar12) +
             ((uVar9 >> 0xb | uVar9 * 0x200000) ^ (uVar9 * 0x80 | uVar9 >> 0x19) ^
             (uVar9 >> 6 | uVar9 * 0x4000000)) + local_2b8[0x16] + 0x5cb0a9dc + uVar17;
    uVar16 = uVar16 + iVar22;
    uVar17 = ((uVar8 | uVar6) & uVar21 | uVar8 & uVar6) +
             iVar22 + ((uVar6 >> 0xd | uVar6 * 0x80000) ^ (uVar6 * 0x400 | uVar6 >> 0x16) ^
                      (uVar6 >> 2 | uVar6 * 0x40000000));
    iVar22 = ((uVar23 ^ uVar9) & uVar16 ^ uVar23) +
             ((uVar16 >> 0xb | uVar16 * 0x200000) ^ (uVar16 * 0x80 | uVar16 >> 0x19) ^
             (uVar16 >> 6 | uVar16 * 0x4000000)) + local_25c + 0x76f988da + uVar12;
    uVar21 = uVar21 + iVar22;
    uVar12 = ((uVar6 | uVar17) & uVar8 | uVar6 & uVar17) +
             iVar22 + ((uVar17 >> 0xd | uVar17 * 0x80000) ^ (uVar17 * 0x400 | uVar17 >> 0x16) ^
                      (uVar17 >> 2 | uVar17 * 0x40000000));
    iVar22 = ((uVar9 ^ uVar16) & uVar21 ^ uVar9) +
             ((uVar21 >> 0xb | uVar21 * 0x200000) ^ (uVar21 * 0x80 | uVar21 >> 0x19) ^
             (uVar21 >> 6 | uVar21 * 0x4000000)) + local_258 + -0x67c1aeae + uVar23;
    uVar8 = uVar8 + iVar22;
    uVar23 = ((uVar17 | uVar12) & uVar6 | uVar17 & uVar12) +
             iVar22 + ((uVar12 >> 0xd | uVar12 * 0x80000) ^ (uVar12 * 0x400 | uVar12 >> 0x16) ^
                      (uVar12 >> 2 | uVar12 * 0x40000000));
    iVar22 = ((uVar16 ^ uVar21) & uVar8 ^ uVar16) +
             ((uVar8 >> 0xb | uVar8 * 0x200000) ^ (uVar8 * 0x80 | uVar8 >> 0x19) ^
             (uVar8 >> 6 | uVar8 * 0x4000000)) + local_254 + -0x57ce3993 + uVar9;
    uVar6 = uVar6 + iVar22;
    uVar9 = ((uVar23 | uVar12) & uVar17 | uVar23 & uVar12) +
            iVar22 + ((uVar23 >> 0xd | uVar23 * 0x80000) ^ (uVar23 * 0x400 | uVar23 >> 0x16) ^
                     (uVar23 >> 2 | uVar23 * 0x40000000));
    iVar22 = ((uVar21 ^ uVar8) & uVar6 ^ uVar21) +
             ((uVar6 >> 0xb | uVar6 * 0x200000) ^ (uVar6 * 0x80 | uVar6 >> 0x19) ^
             (uVar6 >> 6 | uVar6 * 0x4000000)) + local_250 + -0x4ffcd838 + uVar16;
    uVar17 = uVar17 + iVar22;
    uVar16 = ((uVar23 | uVar9) & uVar12 | uVar23 & uVar9) +
             iVar22 + ((uVar9 >> 0xd | uVar9 * 0x80000) ^ (uVar9 * 0x400 | uVar9 >> 0x16) ^
                      (uVar9 >> 2 | uVar9 * 0x40000000));
    iVar22 = ((uVar8 ^ uVar6) & uVar17 ^ uVar8) +
             ((uVar17 >> 0xb | uVar17 * 0x200000) ^ (uVar17 * 0x80 | uVar17 >> 0x19) ^
             (uVar17 >> 6 | uVar17 * 0x4000000)) + local_24c + -0x40a68039 + uVar21;
    uVar12 = uVar12 + iVar22;
    uVar21 = ((uVar9 | uVar16) & uVar23 | uVar9 & uVar16) +
             iVar22 + ((uVar16 >> 0xd | uVar16 * 0x80000) ^ (uVar16 * 0x400 | uVar16 >> 0x16) ^
                      (uVar16 >> 2 | uVar16 * 0x40000000));
    iVar22 = ((uVar6 ^ uVar17) & uVar12 ^ uVar6) +
             ((uVar12 >> 0xb | uVar12 * 0x200000) ^ (uVar12 * 0x80 | uVar12 >> 0x19) ^
             (uVar12 >> 6 | uVar12 * 0x4000000)) + local_248 + -0x391ff40d + uVar8;
    uVar23 = uVar23 + iVar22;
    uVar8 = ((uVar16 | uVar21) & uVar9 | uVar16 & uVar21) +
            iVar22 + ((uVar21 >> 0xd | uVar21 * 0x80000) ^ (uVar21 * 0x400 | uVar21 >> 0x16) ^
                     (uVar21 >> 2 | uVar21 * 0x40000000));
    iVar22 = ((uVar17 ^ uVar12) & uVar23 ^ uVar17) +
             ((uVar23 >> 0xb | uVar23 * 0x200000) ^ (uVar23 * 0x80 | uVar23 >> 0x19) ^
             (uVar23 >> 6 | uVar23 * 0x4000000)) + local_244 + -0x2a586eb9 + uVar6;
    uVar9 = uVar9 + iVar22;
    uVar6 = ((uVar21 | uVar8) & uVar16 | uVar21 & uVar8) +
            iVar22 + ((uVar8 >> 0xd | uVar8 * 0x80000) ^ (uVar8 * 0x400 | uVar8 >> 0x16) ^
                     (uVar8 >> 2 | uVar8 * 0x40000000));
    iVar22 = ((uVar23 ^ uVar12) & uVar9 ^ uVar12) +
             ((uVar9 >> 0xb | uVar9 * 0x200000) ^ (uVar9 * 0x80 | uVar9 >> 0x19) ^
             (uVar9 >> 6 | uVar9 * 0x4000000)) + local_240 + 0x6ca6351 + uVar17;
    uVar16 = uVar16 + iVar22;
    uVar17 = ((uVar8 | uVar6) & uVar21 | uVar8 & uVar6) +
             iVar22 + ((uVar6 >> 0xd | uVar6 * 0x80000) ^ (uVar6 * 0x400 | uVar6 >> 0x16) ^
                      (uVar6 >> 2 | uVar6 * 0x40000000));
    iVar22 = ((uVar23 ^ uVar9) & uVar16 ^ uVar23) +
             ((uVar16 >> 0xb | uVar16 * 0x200000) ^ (uVar16 * 0x80 | uVar16 >> 0x19) ^
             (uVar16 >> 6 | uVar16 * 0x4000000)) + local_23c + 0x14292967 + uVar12;
    uVar21 = uVar21 + iVar22;
    uVar12 = ((uVar6 | uVar17) & uVar8 | uVar6 & uVar17) +
             iVar22 + ((uVar17 >> 0xd | uVar17 * 0x80000) ^ (uVar17 * 0x400 | uVar17 >> 0x16) ^
                      (uVar17 >> 2 | uVar17 * 0x40000000));
    iVar22 = ((uVar9 ^ uVar16) & uVar21 ^ uVar9) +
             ((uVar21 >> 0xb | uVar21 * 0x200000) ^ (uVar21 * 0x80 | uVar21 >> 0x19) ^
             (uVar21 >> 6 | uVar21 * 0x4000000)) + local_238 + 0x27b70a85 + uVar23;
    uVar8 = uVar8 + iVar22;
    uVar23 = ((uVar17 | uVar12) & uVar6 | uVar17 & uVar12) +
             iVar22 + ((uVar12 >> 0xd | uVar12 * 0x80000) ^ (uVar12 * 0x400 | uVar12 >> 0x16) ^
                      (uVar12 >> 2 | uVar12 * 0x40000000));
    iVar22 = ((uVar16 ^ uVar21) & uVar8 ^ uVar16) +
             ((uVar8 >> 0xb | uVar8 * 0x200000) ^ (uVar8 * 0x80 | uVar8 >> 0x19) ^
             (uVar8 >> 6 | uVar8 * 0x4000000)) + uStack_234 + 0x2e1b2138 + uVar9;
    uVar6 = uVar6 + iVar22;
    uVar9 = ((uVar23 | uVar12) & uVar17 | uVar23 & uVar12) +
            iVar22 + ((uVar23 >> 0xd | uVar23 * 0x80000) ^ (uVar23 * 0x400 | uVar23 >> 0x16) ^
                     (uVar23 >> 2 | uVar23 * 0x40000000));
    iVar22 = ((uVar21 ^ uVar8) & uVar6 ^ uVar21) +
             ((uVar6 >> 0xb | uVar6 * 0x200000) ^ (uVar6 * 0x80 | uVar6 >> 0x19) ^
             (uVar6 >> 6 | uVar6 * 0x4000000)) + local_230 + 0x4d2c6dfc + uVar16;
    uVar17 = uVar17 + iVar22;
    uVar16 = ((uVar23 | uVar9) & uVar12 | uVar23 & uVar9) +
             iVar22 + ((uVar9 >> 0xd | uVar9 * 0x80000) ^ (uVar9 * 0x400 | uVar9 >> 0x16) ^
                      (uVar9 >> 2 | uVar9 * 0x40000000));
    iVar22 = ((uVar8 ^ uVar6) & uVar17 ^ uVar8) +
             ((uVar17 >> 0xb | uVar17 * 0x200000) ^ (uVar17 * 0x80 | uVar17 >> 0x19) ^
             (uVar17 >> 6 | uVar17 * 0x4000000)) + local_22c + 0x53380d13 + uVar21;
    uVar12 = uVar12 + iVar22;
    uVar21 = ((uVar9 | uVar16) & uVar23 | uVar9 & uVar16) +
             iVar22 + ((uVar16 >> 0xd | uVar16 * 0x80000) ^ (uVar16 * 0x400 | uVar16 >> 0x16) ^
                      (uVar16 >> 2 | uVar16 * 0x40000000));
    iVar22 = ((uVar6 ^ uVar17) & uVar12 ^ uVar6) +
             ((uVar12 >> 0xb | uVar12 * 0x200000) ^ (uVar12 * 0x80 | uVar12 >> 0x19) ^
             (uVar12 >> 6 | uVar12 * 0x4000000)) + local_228 + 0x650a7354 + uVar8;
    uVar23 = uVar23 + iVar22;
    uVar8 = ((uVar16 | uVar21) & uVar9 | uVar16 & uVar21) +
            iVar22 + ((uVar21 >> 0xd | uVar21 * 0x80000) ^ (uVar21 * 0x400 | uVar21 >> 0x16) ^
                     (uVar21 >> 2 | uVar21 * 0x40000000));
    iVar22 = ((uVar17 ^ uVar12) & uVar23 ^ uVar17) +
             ((uVar23 >> 0xb | uVar23 * 0x200000) ^ (uVar23 * 0x80 | uVar23 >> 0x19) ^
             (uVar23 >> 6 | uVar23 * 0x4000000)) + local_224 + 0x766a0abb + uVar6;
    uVar9 = uVar9 + iVar22;
    uVar6 = ((uVar21 | uVar8) & uVar16 | uVar21 & uVar8) +
            iVar22 + ((uVar8 >> 0xd | uVar8 * 0x80000) ^ (uVar8 * 0x400 | uVar8 >> 0x16) ^
                     (uVar8 >> 2 | uVar8 * 0x40000000));
    iVar22 = ((uVar23 ^ uVar12) & uVar9 ^ uVar12) +
             ((uVar9 >> 0xb | uVar9 * 0x200000) ^ (uVar9 * 0x80 | uVar9 >> 0x19) ^
             (uVar9 >> 6 | uVar9 * 0x4000000)) + local_220 + -0x7e3d36d2 + uVar17;
    uVar16 = uVar16 + iVar22;
    uVar17 = ((uVar8 | uVar6) & uVar21 | uVar8 & uVar6) +
             iVar22 + ((uVar6 >> 0xd | uVar6 * 0x80000) ^ (uVar6 * 0x400 | uVar6 >> 0x16) ^
                      (uVar6 >> 2 | uVar6 * 0x40000000));
    iVar22 = ((uVar23 ^ uVar9) & uVar16 ^ uVar23) +
             ((uVar16 >> 0xb | uVar16 * 0x200000) ^ (uVar16 * 0x80 | uVar16 >> 0x19) ^
             (uVar16 >> 6 | uVar16 * 0x4000000)) + local_21c + -0x6d8dd37b + uVar12;
    uVar21 = uVar21 + iVar22;
    uVar12 = ((uVar6 | uVar17) & uVar8 | uVar6 & uVar17) +
             iVar22 + ((uVar17 >> 0xd | uVar17 * 0x80000) ^ (uVar17 * 0x400 | uVar17 >> 0x16) ^
                      (uVar17 >> 2 | uVar17 * 0x40000000));
    iVar22 = ((uVar9 ^ uVar16) & uVar21 ^ uVar9) +
             ((uVar21 >> 0xb | uVar21 * 0x200000) ^ (uVar21 * 0x80 | uVar21 >> 0x19) ^
             (uVar21 >> 6 | uVar21 * 0x4000000)) + local_218 + -0x5d40175f + uVar23;
    uVar8 = uVar8 + iVar22;
    uVar23 = ((uVar17 | uVar12) & uVar6 | uVar17 & uVar12) +
             iVar22 + ((uVar12 >> 0xd | uVar12 * 0x80000) ^ (uVar12 * 0x400 | uVar12 >> 0x16) ^
                      (uVar12 >> 2 | uVar12 * 0x40000000));
    iVar22 = ((uVar16 ^ uVar21) & uVar8 ^ uVar16) +
             ((uVar8 >> 0xb | uVar8 * 0x200000) ^ (uVar8 * 0x80 | uVar8 >> 0x19) ^
             (uVar8 >> 6 | uVar8 * 0x4000000)) + local_214 + -0x57e599b5 + uVar9;
    uVar6 = uVar6 + iVar22;
    uVar9 = ((uVar23 | uVar12) & uVar17 | uVar23 & uVar12) +
            iVar22 + ((uVar23 >> 0xd | uVar23 * 0x80000) ^ (uVar23 * 0x400 | uVar23 >> 0x16) ^
                     (uVar23 >> 2 | uVar23 * 0x40000000));
    iVar22 = ((uVar21 ^ uVar8) & uVar6 ^ uVar21) +
             ((uVar6 >> 0xb | uVar6 * 0x200000) ^ (uVar6 * 0x80 | uVar6 >> 0x19) ^
             (uVar6 >> 6 | uVar6 * 0x4000000)) + local_210 + -0x3db47490 + uVar16;
    uVar17 = uVar17 + iVar22;
    uVar16 = ((uVar23 | uVar9) & uVar12 | uVar23 & uVar9) +
             iVar22 + ((uVar9 >> 0xd | uVar9 * 0x80000) ^ (uVar9 * 0x400 | uVar9 >> 0x16) ^
                      (uVar9 >> 2 | uVar9 * 0x40000000));
    iVar22 = ((uVar8 ^ uVar6) & uVar17 ^ uVar8) +
             ((uVar17 >> 0xb | uVar17 * 0x200000) ^ (uVar17 * 0x80 | uVar17 >> 0x19) ^
             (uVar17 >> 6 | uVar17 * 0x4000000)) + local_20c + -0x3893ae5d + uVar21;
    uVar12 = uVar12 + iVar22;
    uVar21 = ((uVar9 | uVar16) & uVar23 | uVar9 & uVar16) +
             iVar22 + ((uVar16 >> 0xd | uVar16 * 0x80000) ^ (uVar16 * 0x400 | uVar16 >> 0x16) ^
                      (uVar16 >> 2 | uVar16 * 0x40000000));
    iVar22 = ((uVar6 ^ uVar17) & uVar12 ^ uVar6) +
             ((uVar12 >> 0xb | uVar12 * 0x200000) ^ (uVar12 * 0x80 | uVar12 >> 0x19) ^
             (uVar12 >> 6 | uVar12 * 0x4000000)) + local_208 + -0x2e6d17e7 + uVar8;
    uVar23 = uVar23 + iVar22;
    uVar8 = ((uVar16 | uVar21) & uVar9 | uVar16 & uVar21) +
            iVar22 + ((uVar21 >> 0xd | uVar21 * 0x80000) ^ (uVar21 * 0x400 | uVar21 >> 0x16) ^
                     (uVar21 >> 2 | uVar21 * 0x40000000));
    iVar22 = ((uVar17 ^ uVar12) & uVar23 ^ uVar17) +
             ((uVar23 >> 0xb | uVar23 * 0x200000) ^ (uVar23 * 0x80 | uVar23 >> 0x19) ^
             (uVar23 >> 6 | uVar23 * 0x4000000)) + local_204 + -0x2966f9dc + uVar6;
    uVar9 = uVar9 + iVar22;
    uVar6 = ((uVar21 | uVar8) & uVar16 | uVar21 & uVar8) +
            iVar22 + ((uVar8 >> 0xd | uVar8 * 0x80000) ^ (uVar8 * 0x400 | uVar8 >> 0x16) ^
                     (uVar8 >> 2 | uVar8 * 0x40000000));
    iVar22 = ((uVar23 ^ uVar12) & uVar9 ^ uVar12) +
             ((uVar9 >> 0xb | uVar9 * 0x200000) ^ (uVar9 * 0x80 | uVar9 >> 0x19) ^
             (uVar9 >> 6 | uVar9 * 0x4000000)) + local_200 + -0xbf1ca7b + uVar17;
    uVar16 = uVar16 + iVar22;
    uVar17 = ((uVar8 | uVar6) & uVar21 | uVar8 & uVar6) +
             iVar22 + ((uVar6 >> 0xd | uVar6 * 0x80000) ^ (uVar6 * 0x400 | uVar6 >> 0x16) ^
                      (uVar6 >> 2 | uVar6 * 0x40000000));
    iVar22 = ((uVar23 ^ uVar9) & uVar16 ^ uVar23) +
             ((uVar16 >> 0xb | uVar16 * 0x200000) ^ (uVar16 * 0x80 | uVar16 >> 0x19) ^
             (uVar16 >> 6 | uVar16 * 0x4000000)) + local_1fc + 0x106aa070 + uVar12;
    uVar21 = uVar21 + iVar22;
    uVar12 = ((uVar6 | uVar17) & uVar8 | uVar6 & uVar17) +
             iVar22 + ((uVar17 >> 0xd | uVar17 * 0x80000) ^ (uVar17 * 0x400 | uVar17 >> 0x16) ^
                      (uVar17 >> 2 | uVar17 * 0x40000000));
    iVar22 = ((uVar9 ^ uVar16) & uVar21 ^ uVar9) +
             ((uVar21 >> 0xb | uVar21 * 0x200000) ^ (uVar21 * 0x80 | uVar21 >> 0x19) ^
             (uVar21 >> 6 | uVar21 * 0x4000000)) + local_1f8 + 0x19a4c116 + uVar23;
    uVar8 = uVar8 + iVar22;
    uVar23 = ((uVar17 | uVar12) & uVar6 | uVar17 & uVar12) +
             iVar22 + ((uVar12 >> 0xd | uVar12 * 0x80000) ^ (uVar12 * 0x400 | uVar12 >> 0x16) ^
                      (uVar12 >> 2 | uVar12 * 0x40000000));
    iVar22 = ((uVar16 ^ uVar21) & uVar8 ^ uVar16) +
             ((uVar8 >> 0xb | uVar8 * 0x200000) ^ (uVar8 * 0x80 | uVar8 >> 0x19) ^
             (uVar8 >> 6 | uVar8 * 0x4000000)) + local_1f4 + 0x1e376c08 + uVar9;
    uVar6 = uVar6 + iVar22;
    uVar9 = ((uVar23 | uVar12) & uVar17 | uVar23 & uVar12) +
            iVar22 + ((uVar23 >> 0xd | uVar23 * 0x80000) ^ (uVar23 * 0x400 | uVar23 >> 0x16) ^
                     (uVar23 >> 2 | uVar23 * 0x40000000));
    iVar22 = ((uVar21 ^ uVar8) & uVar6 ^ uVar21) +
             ((uVar6 >> 0xb | uVar6 * 0x200000) ^ (uVar6 * 0x80 | uVar6 >> 0x19) ^
             (uVar6 >> 6 | uVar6 * 0x4000000)) + local_1f0 + 0x2748774c + uVar16;
    uVar17 = uVar17 + iVar22;
    uVar16 = ((uVar23 | uVar9) & uVar12 | uVar23 & uVar9) +
             iVar22 + ((uVar9 >> 0xd | uVar9 * 0x80000) ^ (uVar9 * 0x400 | uVar9 >> 0x16) ^
                      (uVar9 >> 2 | uVar9 * 0x40000000));
    iVar22 = ((uVar8 ^ uVar6) & uVar17 ^ uVar8) +
             ((uVar17 >> 0xb | uVar17 * 0x200000) ^ (uVar17 * 0x80 | uVar17 >> 0x19) ^
             (uVar17 >> 6 | uVar17 * 0x4000000)) + local_1ec + 0x34b0bcb5 + uVar21;
    uVar12 = uVar12 + iVar22;
    uVar21 = ((uVar9 | uVar16) & uVar23 | uVar9 & uVar16) +
             iVar22 + ((uVar16 >> 0xd | uVar16 * 0x80000) ^ (uVar16 * 0x400 | uVar16 >> 0x16) ^
                      (uVar16 >> 2 | uVar16 * 0x40000000));
    iVar22 = ((uVar6 ^ uVar17) & uVar12 ^ uVar6) +
             ((uVar12 >> 0xb | uVar12 * 0x200000) ^ (uVar12 * 0x80 | uVar12 >> 0x19) ^
             (uVar12 >> 6 | uVar12 * 0x4000000)) + local_1e8 + 0x391c0cb3 + uVar8;
    uVar23 = uVar23 + iVar22;
    uVar8 = ((uVar16 | uVar21) & uVar9 | uVar16 & uVar21) +
            iVar22 + ((uVar21 >> 0xd | uVar21 * 0x80000) ^ (uVar21 * 0x400 | uVar21 >> 0x16) ^
                     (uVar21 >> 2 | uVar21 * 0x40000000));
    iVar22 = ((uVar17 ^ uVar12) & uVar23 ^ uVar17) +
             ((uVar23 >> 0xb | uVar23 * 0x200000) ^ (uVar23 * 0x80 | uVar23 >> 0x19) ^
             (uVar23 >> 6 | uVar23 * 0x4000000)) + local_1e4 + 0x4ed8aa4a + uVar6;
    uVar9 = uVar9 + iVar22;
    uVar10 = ((uVar21 | uVar8) & uVar16 | uVar21 & uVar8) +
             iVar22 + ((uVar8 >> 0xd | uVar8 * 0x80000) ^ (uVar8 * 0x400 | uVar8 >> 0x16) ^
                      (uVar8 >> 2 | uVar8 * 0x40000000));
    iVar22 = ((uVar23 ^ uVar12) & uVar9 ^ uVar12) +
             ((uVar9 >> 0xb | uVar9 * 0x200000) ^ (uVar9 * 0x80 | uVar9 >> 0x19) ^
             (uVar9 >> 6 | uVar9 * 0x4000000)) + local_1e0 + 0x5b9cca4f + uVar17;
    uVar16 = uVar16 + iVar22;
    uVar11 = ((uVar8 | uVar10) & uVar21 | uVar8 & uVar10) +
             iVar22 + ((uVar10 >> 0xd | uVar10 * 0x80000) ^ (uVar10 * 0x400 | uVar10 >> 0x16) ^
                      (uVar10 >> 2 | uVar10 * 0x40000000));
    iVar22 = ((uVar23 ^ uVar9) & uVar16 ^ uVar23) +
             ((uVar16 >> 0xb | uVar16 * 0x200000) ^ (uVar16 * 0x80 | uVar16 >> 0x19) ^
             (uVar16 >> 6 | uVar16 * 0x4000000)) + local_1dc + 0x682e6ff3 + uVar12;
    uVar21 = uVar21 + iVar22;
    uVar6 = ((uVar10 | uVar11) & uVar8 | uVar10 & uVar11) +
            iVar22 + ((uVar11 >> 0xd | uVar11 * 0x80000) ^ (uVar11 * 0x400 | uVar11 >> 0x16) ^
                     (uVar11 >> 2 | uVar11 * 0x40000000));
    iVar22 = ((uVar9 ^ uVar16) & uVar21 ^ uVar9) +
             ((uVar21 >> 0xb | uVar21 * 0x200000) ^ (uVar21 * 0x80 | uVar21 >> 0x19) ^
             (uVar21 >> 6 | uVar21 * 0x4000000)) + local_1d8 + 0x748f82ee + uVar23;
    uVar8 = uVar8 + iVar22;
    uVar23 = ((uVar11 | uVar6) & uVar10 | uVar11 & uVar6) +
             iVar22 + ((uVar6 >> 0xd | uVar6 * 0x80000) ^ (uVar6 * 0x400 | uVar6 >> 0x16) ^
                      (uVar6 >> 2 | uVar6 * 0x40000000));
    iVar22 = ((uVar16 ^ uVar21) & uVar8 ^ uVar16) +
             ((uVar8 >> 0xb | uVar8 * 0x200000) ^ (uVar8 * 0x80 | uVar8 >> 0x19) ^
             (uVar8 >> 6 | uVar8 * 0x4000000)) + local_1d4 + 0x78a5636f + uVar9;
    uVar17 = ((uVar23 | uVar6) & uVar11 | uVar23 & uVar6) +
             iVar22 + ((uVar23 >> 0xd | uVar23 * 0x80000) ^ (uVar23 * 0x400 | uVar23 >> 0x16) ^
                      (uVar23 >> 2 | uVar23 * 0x40000000));
    uVar10 = uVar10 + iVar22;
    iVar22 = ((uVar21 ^ uVar8) & uVar10 ^ uVar21) +
             ((uVar10 >> 0xb | uVar10 * 0x200000) ^ (uVar10 * 0x80 | uVar10 >> 0x19) ^
             (uVar10 >> 6 | uVar10 * 0x4000000)) + local_1d0 + -0x7b3787ec + uVar16;
    uVar11 = uVar11 + iVar22;
    uVar16 = ((uVar23 | uVar17) & uVar6 | uVar23 & uVar17) +
             iVar22 + ((uVar17 >> 0xd | uVar17 * 0x80000) ^ (uVar17 * 0x400 | uVar17 >> 0x16) ^
                      (uVar17 >> 2 | uVar17 * 0x40000000));
    iVar22 = ((uVar8 ^ uVar10) & uVar11 ^ uVar8) +
             ((uVar11 >> 0xb | uVar11 * 0x200000) ^ (uVar11 * 0x80 | uVar11 >> 0x19) ^
             (uVar11 >> 6 | uVar11 * 0x4000000)) + local_1cc + -0x7338fdf8 + uVar21;
    uVar6 = uVar6 + iVar22;
    uVar9 = ((uVar17 | uVar16) & uVar23 | uVar17 & uVar16) +
            iVar22 + ((uVar16 >> 0xd | uVar16 * 0x80000) ^ (uVar16 * 0x400 | uVar16 >> 0x16) ^
                     (uVar16 >> 2 | uVar16 * 0x40000000));
    iVar22 = ((uVar10 ^ uVar11) & uVar6 ^ uVar10) +
             ((uVar6 >> 0xb | uVar6 * 0x200000) ^ (uVar6 * 0x80 | uVar6 >> 0x19) ^
             (uVar6 >> 6 | uVar6 * 0x4000000)) + local_1c8 + -0x6f410006 + uVar8;
    uVar23 = uVar23 + iVar22;
    uVar12 = ((uVar16 | uVar9) & uVar17 | uVar16 & uVar9) +
             iVar22 + ((uVar9 >> 0xd | uVar9 * 0x80000) ^ (uVar9 * 0x400 | uVar9 >> 0x16) ^
                      (uVar9 >> 2 | uVar9 * 0x40000000));
    iVar22 = ((uVar11 ^ uVar6) & uVar23 ^ uVar11) +
             ((uVar23 >> 0xb | uVar23 * 0x200000) ^ (uVar23 * 0x80 | uVar23 >> 0x19) ^
             (uVar23 >> 6 | uVar23 * 0x4000000)) + local_1c4 + -0x5baf9315 + uVar10;
    uVar17 = uVar17 + iVar22;
    uVar21 = ((uVar9 | uVar12) & uVar16 | uVar9 & uVar12) +
             iVar22 + ((uVar12 >> 0xd | uVar12 * 0x80000) ^ (uVar12 * 0x400 | uVar12 >> 0x16) ^
                      (uVar12 >> 2 | uVar12 * 0x40000000));
    iVar22 = ((uVar23 ^ uVar6) & uVar17 ^ uVar6) +
             ((uVar17 >> 0xb | uVar17 * 0x200000) ^ (uVar17 * 0x80 | uVar17 >> 0x19) ^
             (uVar17 >> 6 | uVar17 * 0x4000000)) + local_1c0 + -0x41065c09 + uVar11;
    uVar8 = ((uVar12 | uVar21) & uVar9 | uVar12 & uVar21) +
            iVar22 + ((uVar21 >> 0xd | uVar21 * 0x80000) ^ (uVar21 * 0x400 | uVar21 >> 0x16) ^
                     (uVar21 >> 2 | uVar21 * 0x40000000));
    uVar16 = uVar16 + iVar22;
    iVar22 = ((uVar23 ^ uVar17) & uVar16 ^ uVar23) +
             ((uVar16 >> 0xb | uVar16 * 0x200000) ^ (uVar16 * 0x80 | uVar16 >> 0x19) ^
             (uVar16 >> 6 | uVar16 * 0x4000000)) + local_1bc + -0x398e870e + uVar6;
    param_1[1] = ((uVar21 | uVar8) & uVar12 | uVar21 & uVar8) +
                 param_1[1] +
                 ((uVar8 >> 0xd | uVar8 * 0x80000) ^ (uVar8 * 0x400 | uVar8 >> 0x16) ^
                 (uVar8 >> 2 | uVar8 * 0x40000000)) + iVar22;
    param_1[2] = param_1[2] + uVar8;
    param_1[3] = param_1[3] + uVar21;
    param_1[4] = param_1[4] + uVar12;
    param_1[5] = param_1[5] + iVar22 + uVar9;
    param_1[6] = param_1[6] + uVar16;
    param_1[7] = param_1[7] + uVar17;
    param_1[8] = param_1[8] + uVar23;
  }
  else if (iVar22 - 2U < 2) {
    piVar20 = param_1 + 0xb;
    lVar25 = 4;
    puVar19 = (undefined1 *)((longlong)param_1 + 0x32);
    puVar18 = local_2b8 + 3;
    do {
      puVar18[-2] = CONCAT31(CONCAT21(CONCAT11(puVar19[-2],puVar19[-1]),*puVar19),puVar19[1]);
      puVar18[-3] = CONCAT31(CONCAT21(CONCAT11((char)*piVar20,puVar19[-5]),puVar19[-4]),puVar19[-3])
      ;
      *puVar18 = CONCAT31(CONCAT21(CONCAT11(puVar19[6],puVar19[7]),puVar19[8]),puVar19[9]);
      puVar18[-1] = CONCAT31(CONCAT21(CONCAT11(puVar19[2],puVar19[3]),puVar19[4]),puVar19[5]);
      puVar18[2] = CONCAT31(CONCAT21(CONCAT11(puVar19[0xe],puVar19[0xf]),puVar19[0x10]),
                            puVar19[0x11]);
      puVar18[1] = CONCAT31(CONCAT21(CONCAT11(puVar19[10],puVar19[0xb]),puVar19[0xc]),puVar19[0xd]);
      puVar18[4] = CONCAT31(CONCAT21(CONCAT11(puVar19[0x16],puVar19[0x17]),puVar19[0x18]),
                            puVar19[0x19]);
      puVar1 = puVar19 + 0x12;
      puVar2 = puVar19 + 0x13;
      puVar3 = puVar19 + 0x14;
      puVar4 = puVar19 + 0x15;
      piVar20 = piVar20 + 8;
      puVar19 = puVar19 + 0x20;
      lVar25 = lVar25 + -1;
      puVar18[3] = CONCAT31(CONCAT21(CONCAT11(*puVar1,*puVar2),*puVar3),*puVar4);
      puVar18 = puVar18 + 8;
    } while (lVar25 != 0);
    iVar22 = 0xe;
    lVar25 = 0x40;
    puVar18 = local_2b8 + 1;
    local_2c0 = param_1;
    do {
      uVar13 = FUN_1400f5b20(local_2b8 + (longlong)(iVar22 + -0xd) * 2);
      local_300 = uVar13;
      uVar14 = FUN_1400f5c50(local_2b8 + (longlong)iVar22 * 2);
      uVar6 = (int)((ulonglong)uVar14 >> 0x20) + puVar18[0x12];
      local_370._0_4_ = (uint)uVar14;
      if (uVar6 < puVar18[0x12]) {
        local_370._0_4_ = (uint)local_370 + 1;
      }
      iVar7 = (uint)local_370 + puVar18[0x11];
      uVar6 = uVar6 + local_300._4_4_;
      if (uVar6 < local_300._4_4_) {
        iVar7 = iVar7 + 1;
      }
      iVar7 = iVar7 + (int)uVar13;
      uVar6 = uVar6 + *puVar18;
      if (uVar6 < *puVar18) {
        iVar7 = iVar7 + 1;
      }
      iVar22 = iVar22 + 1;
      lVar25 = lVar25 + -1;
      local_370 = CONCAT44(uVar6,iVar7 + puVar18[-1]);
      *(ulonglong *)(puVar18 + 0x1f) = local_370;
      puVar18 = puVar18 + 2;
    } while (lVar25 != 0);
    local_340 = *(ulonglong *)(param_1 + 0x35);
    local_330 = *(undefined8 *)(param_1 + 0x2d);
    local_370 = *(ulonglong *)(param_1 + 0x33);
    uVar13 = *(undefined8 *)(param_1 + 0x2b);
    uVar14 = *(undefined8 *)(param_1 + 0x39);
    local_350 = *(undefined8 *)(param_1 + 0x2f);
    local_358 = *(undefined8 *)(param_1 + 0x31);
    local_320 = local_340 >> 0x20;
    uVar5 = *(ulonglong *)(param_1 + 0x37);
    local_360._0_4_ = (uint)uVar5;
    uVar9 = (uint)local_360;
    local_2d0 = uVar5 >> 0x20;
    uVar21 = (uint)(uVar5 >> 0x20);
    local_2e0 = local_370 >> 0x20;
    uVar8 = uVar21 ^ (uint)(local_340 >> 0x20);
    local_348 = (uint)local_340;
    uVar16 = local_348;
    local_348 = local_348 ^ (uint)local_360;
    local_360._0_4_ = (uint)local_370;
    uVar17 = (uint)local_360;
    uVar6 = (uint)local_360 & local_348;
    _local_348 = CONCAT44(uVar8,local_348);
    uVar8 = uVar8 & (uint)(local_370 >> 0x20);
    local_360 = CONCAT44(uVar8,uVar6);
    local_300 = local_360;
    uVar8 = uVar8 ^ uVar21;
    local_368 = uVar13;
    uVar15 = FUN_1400f59c0(&local_370);
    uVar12 = (uint)((ulonglong)uVar15 >> 0x20);
    uVar21 = (int)((ulonglong)uVar14 >> 0x20) + uVar12;
    local_348 = (uint)uVar14;
    if (uVar21 < uVar12) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar15;
    uVar21 = uVar21 + uVar8;
    if (uVar21 < uVar8) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + (uVar6 ^ uVar9);
    uVar21 = uVar21 + 0xd728ae22;
    if (uVar21 < 0xd728ae22) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x428a2f98;
    uVar21 = uVar21 + local_2b8[1];
    if (uVar21 < local_2b8[1]) {
      iVar7 = iVar22 + 0x428a2f99;
    }
    local_378._0_4_ = (uint)uVar13;
    uVar6 = (uint)local_378 | (uint)local_330;
    local_378._0_4_ = (uint)local_378 & (uint)local_330;
    local_2c8._0_4_ = (uint)local_330;
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    local_378._4_4_ = local_330._4_4_ & uVar9;
    local_318._0_4_ = (uint)local_350;
    uVar6 = uVar6 & (uint)local_350;
    uVar9 = (local_330._4_4_ | uVar9) & local_350._4_4_;
    local_360 = CONCAT44(uVar9,uVar6);
    local_300 = local_360;
    uVar6 = uVar6 | (uint)local_378;
    uVar9 = uVar9 | local_378._4_4_;
    local_348 = iVar7 + local_2b8[0];
    uStack_344 = uVar21;
    uVar13 = FUN_1400f5870(&local_368);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uStack_344 = uStack_344 + uVar8;
    if (uStack_344 < uVar8) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar8 = uStack_344 + uVar9;
    if (uVar8 < uVar9) {
      iVar22 = iVar22 + 1;
    }
    uVar6 = iVar22 + uVar6;
    _local_348 = CONCAT44(uVar8,uVar6);
    uVar9 = local_358._4_4_ + uVar21;
    if (uVar9 < uVar21) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    uVar23 = local_340._4_4_;
    uVar12 = (uint)local_340;
    uVar10 = (uint)local_358 + iVar7 + local_2b8[0];
    local_378 = CONCAT44(local_378._4_4_,uVar10);
    uVar21 = uVar10 & (uVar17 ^ (uint)local_340);
    local_360 = CONCAT44(local_340._4_4_ ^ (uint)local_2e0,uVar17 ^ (uint)local_340);
    local_2d8 = (ulonglong)uVar9;
    uVar11 = (local_340._4_4_ ^ (uint)local_2e0) & uVar9;
    local_340 = CONCAT44(uVar11,uVar21);
    local_300 = local_340;
    uVar11 = uVar11 ^ uVar23;
    local_308 = uVar6;
    local_358._0_4_ = uVar10;
    local_358._4_4_ = uVar9;
    uVar13 = FUN_1400f59c0(&local_358);
    uVar23 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar9 = (int)local_2d0 + uVar23;
    local_360._0_4_ = (uint)*(undefined8 *)(local_2c0 + 0x37);
    if (uVar9 < uVar23) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar9 = uVar9 + uVar11;
    if (uVar9 < uVar11) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + (uVar21 ^ uVar12);
    uVar9 = uVar9 + 0x23ef65cd;
    if (uVar9 < 0x23ef65cd) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x71374491;
    uVar9 = uVar9 + local_2b8[3];
    if (uVar9 < local_2b8[3]) {
      iVar7 = iVar22 + 0x71374492;
    }
    local_360._0_4_ = iVar7 + local_2b8[2];
    local_338._4_4_ = uVar8 & local_368._4_4_;
    local_338._0_4_ = uVar6 & (uint)local_368;
    local_310._0_4_ = (uint)local_368;
    local_2f8 = (uVar6 | (uint)local_368) & (uint)local_2c8;
    uVar6 = (uVar8 | local_368._4_4_) & local_330._4_4_;
    local_340 = CONCAT44(uVar6,local_2f8);
    local_300 = local_340;
    uVar6 = uVar6 | local_338._4_4_;
    local_2f8 = local_2f8 | (uint)local_338;
    local_328._0_4_ = (uint)local_360;
    local_360._4_4_ = uVar9;
    uVar13 = FUN_1400f5870(&local_348);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    local_360._4_4_ = local_360._4_4_ + uVar21;
    if (local_360._4_4_ < uVar21) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar21 = local_360._4_4_ + uVar6;
    if (uVar21 < uVar6) {
      iVar22 = iVar22 + 1;
    }
    uVar6 = iVar22 + local_2f8;
    local_360 = CONCAT44(uVar21,uVar6);
    local_350._4_4_ = local_350._4_4_ + uVar9;
    if (local_350._4_4_ < uVar9) {
      local_318._0_4_ = (uint)local_318 + 1;
    }
    uVar11 = (uint)local_318 + (uint)local_328;
    uVar23 = local_370._4_4_;
    uVar12 = (uint)local_370;
    local_318 = CONCAT44(local_318._4_4_,uVar11);
    uVar9 = uVar11 & (uVar10 ^ (uint)local_370);
    local_340 = CONCAT44(local_370._4_4_ ^ (uint)local_2d8,uVar10 ^ (uint)local_370);
    local_2d0 = (ulonglong)local_350._4_4_;
    uVar10 = (local_370._4_4_ ^ (uint)local_2d8) & local_350._4_4_;
    local_370 = CONCAT44(uVar10,uVar9);
    local_300 = local_370;
    uVar10 = uVar10 ^ uVar23;
    local_328 = CONCAT44(local_328._4_4_,uVar9 ^ uVar12);
    local_350._0_4_ = uVar11;
    local_2e8._0_4_ = uVar6;
    uVar13 = FUN_1400f59c0(&local_350);
    uVar12 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar9 = (int)local_320 + uVar12;
    if (uVar9 < uVar12) {
      uVar16 = uVar16 + 1;
    }
    iVar22 = uVar16 + (int)uVar13;
    uVar9 = uVar9 + uVar10;
    if (uVar9 < uVar10) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + (uint)local_328;
    uVar9 = uVar9 + 0xec4d3b2f;
    if (uVar9 < 0xec4d3b2f) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x4a3f0431;
    uVar9 = uVar9 + local_2b8[5];
    if (uVar9 < local_2b8[5]) {
      iVar7 = iVar22 + -0x4a3f0430;
    }
    local_370._0_4_ = iVar7 + local_2b8[4];
    local_338 = CONCAT44(local_338._4_4_,(uint)local_370);
    uVar16 = (uVar6 | local_308) & (uint)local_310;
    uVar12 = (uVar8 | uVar21) & local_368._4_4_;
    local_340 = CONCAT44(uVar12,uVar16);
    local_320 = local_340;
    uVar12 = uVar12 | uVar8 & uVar21;
    local_328 = CONCAT44(uVar8 & uVar21,uVar16 | uVar6 & local_308);
    local_370._4_4_ = uVar9;
    uVar13 = FUN_1400f5870(&local_360);
    uVar6 = (uint)((ulonglong)uVar13 >> 0x20);
    local_370._4_4_ = local_370._4_4_ + uVar6;
    if (local_370._4_4_ < uVar6) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar6 = local_370._4_4_ + uVar12;
    if (uVar6 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar16 = iVar22 + (uint)local_328;
    local_370 = CONCAT44(uVar6,uVar16);
    local_340 = local_370;
    local_330._4_4_ = local_330._4_4_ + uVar9;
    if (local_330._4_4_ < uVar9) {
      local_2c8._0_4_ = (uint)local_2c8 + 1;
    }
    local_330._0_4_ = (uint)local_2c8 + (uint)local_338;
    local_2c8 = CONCAT44(local_2c8._4_4_,(uint)local_330);
    local_370 = CONCAT44(local_358._4_4_ ^ (uint)local_2d0,uVar11 ^ (uint)local_378);
    local_320._0_4_ = (uint)local_330 & (uVar11 ^ (uint)local_378);
    local_300 = (ulonglong)local_330._4_4_;
    local_378._4_4_ = (local_358._4_4_ ^ (uint)local_2d0) & local_330._4_4_;
    uVar10 = (uint)local_320 ^ (uint)local_378;
    uVar23 = local_378._4_4_ ^ local_358._4_4_;
    local_378._0_4_ = (uint)local_320;
    local_320._4_4_ = local_378._4_4_;
    local_2f8 = uVar16;
    uVar13 = FUN_1400f59c0(&local_330);
    uVar12 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar9 = (int)local_2e0 + uVar12;
    if (uVar9 < uVar12) {
      uVar17 = uVar17 + 1;
    }
    iVar22 = uVar17 + (int)uVar13;
    uVar9 = uVar9 + uVar23;
    if (uVar9 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar9 = uVar9 + 0x8189dbbc;
    if (uVar9 < 0x8189dbbc) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x164a245b;
    uVar9 = uVar9 + local_2b8[7];
    if (uVar9 < local_2b8[7]) {
      iVar7 = iVar22 + -0x164a245a;
    }
    local_370._0_4_ = iVar7 + local_2b8[6];
    local_378 = CONCAT44(local_378._4_4_,(uint)local_370);
    uVar23 = uVar16 & (uint)local_2e8;
    local_328 = CONCAT44(uVar21 & uVar6,uVar23);
    uVar12 = (uVar21 | uVar6) & uVar8;
    uVar17 = (uVar16 | (uint)local_2e8) & local_308;
    local_338 = CONCAT44(uVar12,uVar17);
    local_320 = local_338;
    uVar12 = uVar12 | uVar21 & uVar6;
    local_370._4_4_ = uVar9;
    uVar13 = FUN_1400f5870(&local_340);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    local_370._4_4_ = local_370._4_4_ + uVar16;
    if (local_370._4_4_ < uVar16) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar16 = local_370._4_4_ + uVar12;
    if (uVar16 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar17 = iVar22 + (uVar17 | uVar23);
    local_370 = CONCAT44(uVar16,uVar17);
    local_368._4_4_ = local_368._4_4_ + uVar9;
    if (local_368._4_4_ < uVar9) {
      local_310._0_4_ = (uint)local_310 + 1;
    }
    local_368._0_4_ = (uint)local_310 + (uint)local_378;
    local_310 = CONCAT44(local_310._4_4_,(uint)local_368);
    local_378 = CONCAT44(local_350._4_4_ ^ (uint)local_300,(uint)local_330 ^ (uint)local_318);
    local_338._0_4_ = (uint)local_368 & ((uint)local_330 ^ (uint)local_318);
    local_2e0 = (ulonglong)local_368._4_4_;
    local_338._4_4_ = (local_350._4_4_ ^ (uint)local_300) & local_368._4_4_;
    uVar10 = (uint)local_338 ^ (uint)local_318;
    uVar23 = local_338._4_4_ ^ local_350._4_4_;
    local_308 = uVar17;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    uVar13 = FUN_1400f59c0(&local_368);
    uVar12 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar9 = (int)local_2d8 + uVar12;
    if (uVar9 < uVar12) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar9 = uVar9 + uVar23;
    if (uVar9 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar9 = uVar9 + 0xf348b538;
    if (uVar9 < 0xf348b538) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x3956c25b;
    uVar9 = uVar9 + local_2b8[9];
    if (uVar9 < local_2b8[9]) {
      iVar7 = iVar22 + 0x3956c25c;
    }
    local_358._0_4_ = iVar7 + local_2b8[8];
    local_338 = CONCAT44(local_338._4_4_,(uint)local_358);
    local_328._0_4_ = uVar17 & local_2f8;
    local_328._4_4_ = uVar6 & uVar16;
    uVar12 = (uVar6 | uVar16) & uVar21;
    uVar17 = (uVar17 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar12,uVar17);
    local_320 = local_378;
    uVar23 = uVar12 | local_328._4_4_;
    local_378 = CONCAT44(uVar12,uVar17 | (uint)local_328);
    local_358._4_4_ = uVar9;
    uVar13 = FUN_1400f5870(&local_370);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    local_358._4_4_ = local_358._4_4_ + uVar17;
    if (local_358._4_4_ < uVar17) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar17 = local_358._4_4_ + uVar23;
    if (uVar17 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_358 = CONCAT44(uVar17,uVar12);
    uVar8 = uVar9 + uVar8;
    if (uVar8 < uVar9) {
      local_348 = local_348 + 1;
    }
    local_348 = local_348 + (uint)local_338;
    local_328 = CONCAT44(local_328._4_4_,local_348);
    local_378 = CONCAT44(local_330._4_4_ ^ (uint)local_2e0,(uint)local_368 ^ (uint)local_2c8);
    local_338._0_4_ = local_348 & ((uint)local_368 ^ (uint)local_2c8);
    local_2d8 = (ulonglong)uVar8;
    local_338._4_4_ = (local_330._4_4_ ^ (uint)local_2e0) & uVar8;
    uVar10 = (uint)local_338 ^ (uint)local_2c8;
    uVar23 = local_338._4_4_ ^ local_330._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    uStack_344 = uVar8;
    local_2e8._0_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_348);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar9 = (int)local_2d0 + uVar8;
    if (uVar9 < uVar8) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar9 = uVar9 + uVar23;
    if (uVar9 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar9 = uVar9 + 0xb605d019;
    if (uVar9 < 0xb605d019) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x59f111f1;
    uVar9 = uVar9 + local_2b8[0xb];
    if (uVar9 < local_2b8[0xb]) {
      iVar7 = iVar22 + 0x59f111f2;
    }
    local_350._0_4_ = iVar7 + local_2b8[10];
    local_338 = CONCAT44(local_338._4_4_,(uint)local_350);
    local_318._0_4_ = uVar12 & local_308;
    local_318._4_4_ = uVar16 & uVar17;
    uVar23 = (uVar16 | uVar17) & uVar6;
    uVar8 = (uVar12 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar23,uVar8);
    local_320 = local_378;
    uVar12 = uVar23 | local_318._4_4_;
    local_378 = CONCAT44(uVar23,uVar8 | (uint)local_318);
    local_350._4_4_ = uVar9;
    uVar13 = FUN_1400f5870(&local_358);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    local_350._4_4_ = local_350._4_4_ + uVar8;
    if (local_350._4_4_ < uVar8) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar8 = local_350._4_4_ + uVar12;
    if (uVar8 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_350 = CONCAT44(uVar8,uVar12);
    uVar21 = uVar9 + uVar21;
    if (uVar21 < uVar9) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    local_360._0_4_ = (uint)local_360 + (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,(uint)local_360);
    local_378 = CONCAT44(local_368._4_4_ ^ (uint)local_2d8,local_348 ^ (uint)local_310);
    local_338._0_4_ = (uint)local_360 & (local_348 ^ (uint)local_310);
    local_2d0 = (ulonglong)uVar21;
    local_338._4_4_ = (local_368._4_4_ ^ (uint)local_2d8) & uVar21;
    uVar10 = (uint)local_338 ^ (uint)local_310;
    uVar23 = local_338._4_4_ ^ local_368._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_360._4_4_ = uVar21;
    local_2f8 = uVar12;
    uVar13 = FUN_1400f59c0(&local_360);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar9 = (int)local_300 + uVar21;
    if (uVar9 < uVar21) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar9 = uVar9 + uVar23;
    if (uVar9 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar9 = uVar9 + 0xaf194f9b;
    if (uVar9 < 0xaf194f9b) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x6dc07d5c;
    uVar9 = uVar9 + local_2b8[0xd];
    if (uVar9 < local_2b8[0xd]) {
      iVar7 = iVar22 + -0x6dc07d5b;
    }
    local_330._0_4_ = iVar7 + local_2b8[0xc];
    local_338 = CONCAT44(local_338._4_4_,(uint)local_330);
    local_310._4_4_ = uVar8 & uVar17;
    local_310._0_4_ = uVar12 & (uint)local_2e8;
    uVar23 = (uVar8 | uVar17) & uVar16;
    uVar21 = (uVar12 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar23,uVar21);
    local_320 = local_378;
    uVar12 = uVar23 | local_310._4_4_;
    local_378 = CONCAT44(uVar23,uVar21 | (uint)local_310);
    local_330._4_4_ = uVar9;
    uVar13 = FUN_1400f5870(&local_350);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    local_330._4_4_ = local_330._4_4_ + uVar21;
    if (local_330._4_4_ < uVar21) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar21 = local_330._4_4_ + uVar12;
    if (uVar21 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_330 = CONCAT44(uVar21,uVar12);
    uVar6 = uVar9 + uVar6;
    if (uVar6 < uVar9) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    local_340._0_4_ = (uint)local_340 + (uint)local_338;
    local_310 = CONCAT44(local_310._4_4_,(uint)local_340);
    local_378 = CONCAT44((uint)local_2d0 ^ uStack_344,(uint)local_360 ^ (uint)local_328);
    local_338._0_4_ = (uint)local_340 & ((uint)local_360 ^ (uint)local_328);
    local_300 = (ulonglong)uVar6;
    local_338._4_4_ = ((uint)local_2d0 ^ uStack_344) & uVar6;
    uVar10 = (uint)local_338 ^ (uint)local_328;
    uVar23 = local_338._4_4_ ^ uStack_344;
    local_308 = uVar12;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_340._4_4_ = uVar6;
    uVar13 = FUN_1400f59c0(&local_340);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2e0 + uVar9;
    if (uVar6 < uVar9) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xda6d8118;
    if (uVar6 < 0xda6d8118) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x54e3a12b;
    uVar6 = uVar6 + local_2b8[0xf];
    if (uVar6 < local_2b8[0xf]) {
      iVar7 = iVar22 + -0x54e3a12a;
    }
    local_368._0_4_ = iVar7 + local_2b8[0xe];
    local_338 = CONCAT44(local_338._4_4_,(uint)local_368);
    local_328._4_4_ = uVar21 & uVar8;
    local_328._0_4_ = uVar12 & local_2f8;
    uVar23 = (uVar21 | uVar8) & uVar17;
    uVar9 = (uVar12 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar23,uVar9);
    local_320 = local_378;
    uVar12 = uVar23 | local_328._4_4_;
    local_378 = CONCAT44(uVar23,uVar9 | (uint)local_328);
    local_368._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_330);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    local_368._4_4_ = local_368._4_4_ + uVar9;
    if (local_368._4_4_ < uVar9) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar9 = local_368._4_4_ + uVar12;
    if (uVar9 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_368 = CONCAT44(uVar9,uVar12);
    uVar16 = uVar6 + uVar16;
    if (uVar16 < uVar6) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    local_370._0_4_ = (uint)local_370 + (uint)local_338;
    local_328 = CONCAT44(local_328._4_4_,(uint)local_370);
    local_378 = CONCAT44(local_360._4_4_ ^ (uint)local_300,(uint)local_340 ^ (uint)local_318);
    local_338._0_4_ = (uint)local_370 & ((uint)local_340 ^ (uint)local_318);
    local_2e0 = (ulonglong)uVar16;
    local_338._4_4_ = (local_360._4_4_ ^ (uint)local_300) & uVar16;
    uVar10 = (uint)local_338 ^ (uint)local_318;
    uVar23 = local_338._4_4_ ^ local_360._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_370._4_4_ = uVar16;
    local_2e8._0_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_370);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d8 + uVar16;
    if (uVar6 < uVar16) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xa3030242;
    if (uVar6 < 0xa3030242) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x27f85568;
    uVar6 = uVar6 + local_2b8[0x11];
    if (uVar6 < local_2b8[0x11]) {
      iVar7 = iVar22 + -0x27f85567;
    }
    local_348 = iVar7 + local_2b8[0x10];
    local_338 = CONCAT44(local_338._4_4_,local_348);
    local_318._4_4_ = uVar9 & uVar21;
    local_318._0_4_ = uVar12 & local_308;
    uVar23 = (uVar9 | uVar21) & uVar8;
    uVar16 = (uVar12 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar23,uVar16);
    local_320 = local_378;
    uVar12 = uVar23 | local_318._4_4_;
    local_378 = CONCAT44(uVar23,uVar16 | (uint)local_318);
    uStack_344 = uVar6;
    uVar13 = FUN_1400f5870(&local_368);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    uStack_344 = uStack_344 + uVar16;
    if (uStack_344 < uVar16) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar16 = uStack_344 + uVar12;
    if (uVar16 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    _local_348 = CONCAT44(uVar16,uVar12);
    uVar17 = uVar6 + uVar17;
    if (uVar17 < uVar6) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    local_358._0_4_ = (uint)local_358 + (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,(uint)local_358);
    local_378 = CONCAT44(local_340._4_4_ ^ (uint)local_2e0,(uint)local_370 ^ (uint)local_310);
    local_338._0_4_ = (uint)local_358 & ((uint)local_370 ^ (uint)local_310);
    local_2d8 = (ulonglong)uVar17;
    local_338._4_4_ = (local_340._4_4_ ^ (uint)local_2e0) & uVar17;
    uVar10 = (uint)local_338 ^ (uint)local_310;
    uVar23 = local_338._4_4_ ^ local_340._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_358._4_4_ = uVar17;
    local_2f8 = uVar12;
    uVar13 = FUN_1400f59c0(&local_358);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d0 + uVar17;
    if (uVar6 < uVar17) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x45706fbe;
    if (uVar6 < 0x45706fbe) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x12835b01;
    uVar6 = uVar6 + local_2b8[0x13];
    if (uVar6 < local_2b8[0x13]) {
      iVar7 = iVar22 + 0x12835b02;
    }
    local_360._0_4_ = iVar7 + local_2b8[0x12];
    local_338 = CONCAT44(local_338._4_4_,(uint)local_360);
    local_310._4_4_ = uVar16 & uVar9;
    local_310._0_4_ = uVar12 & (uint)local_2e8;
    uVar23 = (uVar16 | uVar9) & uVar21;
    uVar17 = (uVar12 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar23,uVar17);
    local_320 = local_378;
    uVar12 = uVar23 | local_310._4_4_;
    local_378 = CONCAT44(uVar23,uVar17 | (uint)local_310);
    local_360._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_348);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    local_360._4_4_ = local_360._4_4_ + uVar17;
    if (local_360._4_4_ < uVar17) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar17 = local_360._4_4_ + uVar12;
    if (uVar17 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_360 = CONCAT44(uVar17,uVar12);
    uVar8 = uVar6 + uVar8;
    if (uVar8 < uVar6) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    local_350._0_4_ = (uint)local_350 + (uint)local_338;
    local_310 = CONCAT44(local_310._4_4_,(uint)local_350);
    local_378 = CONCAT44(local_370._4_4_ ^ (uint)local_2d8,(uint)local_358 ^ (uint)local_328);
    local_338._0_4_ = (uint)local_350 & ((uint)local_358 ^ (uint)local_328);
    local_2d0 = (ulonglong)uVar8;
    local_338._4_4_ = (local_370._4_4_ ^ (uint)local_2d8) & uVar8;
    uVar10 = (uint)local_338 ^ (uint)local_328;
    uVar23 = local_338._4_4_ ^ local_370._4_4_;
    local_308 = uVar12;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_350._4_4_ = uVar8;
    uVar13 = FUN_1400f59c0(&local_350);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_300 + uVar8;
    if (uVar6 < uVar8) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x4ee4b28c;
    if (uVar6 < 0x4ee4b28c) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x243185be;
    uVar6 = uVar6 + local_2b8[0x15];
    if (uVar6 < local_2b8[0x15]) {
      iVar7 = iVar22 + 0x243185bf;
    }
    local_340._0_4_ = iVar7 + local_2b8[0x14];
    local_338 = CONCAT44(local_338._4_4_,(uint)local_340);
    local_328._0_4_ = uVar12 & local_2f8;
    local_328._4_4_ = uVar16 & uVar17;
    uVar23 = (uVar16 | uVar17) & uVar9;
    uVar8 = (uVar12 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar23,uVar8);
    local_320 = local_378;
    uVar12 = uVar23 | local_328._4_4_;
    local_378 = CONCAT44(uVar23,uVar8 | (uint)local_328);
    local_340._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_360);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    local_340._4_4_ = local_340._4_4_ + uVar8;
    if (local_340._4_4_ < uVar8) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar8 = local_340._4_4_ + uVar12;
    if (uVar8 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_340 = CONCAT44(uVar8,uVar12);
    uVar21 = uVar6 + uVar21;
    if (uVar21 < uVar6) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    local_330._0_4_ = (uint)local_330 + (uint)local_338;
    local_328 = CONCAT44(local_328._4_4_,(uint)local_330);
    local_378 = CONCAT44(local_358._4_4_ ^ (uint)local_2d0,(uint)local_350 ^ (uint)local_318);
    local_338._0_4_ = (uint)local_330 & ((uint)local_350 ^ (uint)local_318);
    local_300 = (ulonglong)uVar21;
    local_338._4_4_ = (local_358._4_4_ ^ (uint)local_2d0) & uVar21;
    uVar10 = (uint)local_338 ^ (uint)local_318;
    uVar23 = local_338._4_4_ ^ local_358._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_330._4_4_ = uVar21;
    local_2e8._0_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_330);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2e0 + uVar21;
    if (uVar6 < uVar21) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xd5ffb4e2;
    if (uVar6 < 0xd5ffb4e2) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x550c7dc3;
    uVar6 = uVar6 + local_25c;
    if (uVar6 < local_25c) {
      iVar7 = iVar22 + 0x550c7dc4;
    }
    local_370._0_4_ = iVar7 + local_2b8[0x16];
    local_338 = CONCAT44(local_338._4_4_,(uint)local_370);
    local_318._0_4_ = uVar12 & local_308;
    local_318._4_4_ = uVar17 & uVar8;
    uVar23 = (uVar17 | uVar8) & uVar16;
    uVar21 = (uVar12 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar23,uVar21);
    local_320 = local_378;
    uVar12 = uVar23 | local_318._4_4_;
    local_378 = CONCAT44(uVar23,uVar21 | (uint)local_318);
    local_370._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_340);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    local_370._4_4_ = local_370._4_4_ + uVar21;
    if (local_370._4_4_ < uVar21) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar21 = local_370._4_4_ + uVar12;
    if (uVar21 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_370 = CONCAT44(uVar21,uVar12);
    uVar9 = uVar6 + uVar9;
    if (uVar9 < uVar6) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    local_368._0_4_ = (uint)local_368 + (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,(uint)local_368);
    local_378 = CONCAT44(local_350._4_4_ ^ (uint)local_300,(uint)local_330 ^ (uint)local_310);
    local_338._0_4_ = (uint)local_368 & ((uint)local_330 ^ (uint)local_310);
    local_2e0 = (ulonglong)uVar9;
    local_338._4_4_ = (local_350._4_4_ ^ (uint)local_300) & uVar9;
    uVar10 = (uint)local_338 ^ (uint)local_310;
    uVar23 = local_338._4_4_ ^ local_350._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_368._4_4_ = uVar9;
    local_2f8 = uVar12;
    uVar13 = FUN_1400f59c0(&local_368);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d8 + uVar9;
    if (uVar6 < uVar9) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xf27b896f;
    if (uVar6 < 0xf27b896f) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x72be5d74;
    uVar6 = uVar6 + local_254;
    if (uVar6 < local_254) {
      iVar7 = iVar22 + 0x72be5d75;
    }
    local_358._0_4_ = iVar7 + local_258;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_358);
    local_310._0_4_ = uVar12 & (uint)local_2e8;
    local_310._4_4_ = uVar8 & uVar21;
    uVar23 = (uVar8 | uVar21) & uVar17;
    uVar9 = (uVar12 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar23,uVar9);
    local_320 = local_378;
    uVar12 = uVar23 | local_310._4_4_;
    local_378 = CONCAT44(uVar23,uVar9 | (uint)local_310);
    local_358._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_370);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    local_358._4_4_ = local_358._4_4_ + uVar9;
    if (local_358._4_4_ < uVar9) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar9 = local_358._4_4_ + uVar12;
    if (uVar9 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_358 = CONCAT44(uVar9,uVar12);
    uVar16 = uVar6 + uVar16;
    if (uVar16 < uVar6) {
      local_348 = local_348 + 1;
    }
    local_348 = local_348 + (uint)local_338;
    local_310 = CONCAT44(local_310._4_4_,local_348);
    local_378 = CONCAT44(local_330._4_4_ ^ (uint)local_2e0,(uint)local_368 ^ (uint)local_328);
    local_338._0_4_ = local_348 & ((uint)local_368 ^ (uint)local_328);
    local_2d8 = (ulonglong)uVar16;
    local_338._4_4_ = (local_330._4_4_ ^ (uint)local_2e0) & uVar16;
    uVar10 = (uint)local_338 ^ (uint)local_328;
    uVar23 = local_338._4_4_ ^ local_330._4_4_;
    local_308 = uVar12;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    uStack_344 = uVar16;
    uVar13 = FUN_1400f59c0(&local_348);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d0 + uVar16;
    if (uVar6 < uVar16) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x3b1696b1;
    if (uVar6 < 0x3b1696b1) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x7f214e02;
    uVar6 = uVar6 + local_24c;
    if (uVar6 < local_24c) {
      iVar7 = iVar22 + -0x7f214e01;
    }
    local_350._0_4_ = iVar7 + local_250;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_350);
    local_328._0_4_ = uVar12 & local_2f8;
    local_328._4_4_ = uVar21 & uVar9;
    uVar23 = (uVar21 | uVar9) & uVar8;
    uVar16 = (uVar12 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar23,uVar16);
    local_320 = local_378;
    uVar12 = uVar23 | local_328._4_4_;
    local_378 = CONCAT44(uVar23,uVar16 | (uint)local_328);
    local_350._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_358);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    local_350._4_4_ = local_350._4_4_ + uVar16;
    if (local_350._4_4_ < uVar16) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar16 = local_350._4_4_ + uVar12;
    if (uVar16 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_350 = CONCAT44(uVar16,uVar12);
    uVar17 = uVar6 + uVar17;
    if (uVar17 < uVar6) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    local_360._0_4_ = (uint)local_360 + (uint)local_338;
    local_328 = CONCAT44(local_328._4_4_,(uint)local_360);
    local_378 = CONCAT44(local_368._4_4_ ^ (uint)local_2d8,local_348 ^ (uint)local_318);
    local_338._0_4_ = (uint)local_360 & (local_348 ^ (uint)local_318);
    local_2d0 = (ulonglong)uVar17;
    local_338._4_4_ = (local_368._4_4_ ^ (uint)local_2d8) & uVar17;
    uVar10 = (uint)local_338 ^ (uint)local_318;
    uVar23 = local_338._4_4_ ^ local_368._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_360._4_4_ = uVar17;
    local_2e8._0_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_360);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_300 + uVar17;
    if (uVar6 < uVar17) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x25c71235;
    if (uVar6 < 0x25c71235) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x6423f959;
    uVar6 = uVar6 + local_244;
    if (uVar6 < local_244) {
      iVar7 = iVar22 + -0x6423f958;
    }
    local_330._0_4_ = iVar7 + local_248;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_330);
    local_318._4_4_ = uVar16 & uVar9;
    local_318._0_4_ = uVar12 & local_308;
    uVar23 = (uVar16 | uVar9) & uVar21;
    uVar17 = (uVar12 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar23,uVar17);
    local_320 = local_378;
    uVar12 = uVar23 | local_318._4_4_;
    local_378 = CONCAT44(uVar23,uVar17 | (uint)local_318);
    local_330._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_350);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    local_330._4_4_ = local_330._4_4_ + uVar17;
    if (local_330._4_4_ < uVar17) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar17 = local_330._4_4_ + uVar12;
    if (uVar17 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_330 = CONCAT44(uVar17,uVar12);
    uVar8 = uVar6 + uVar8;
    if (uVar8 < uVar6) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    local_340._0_4_ = (uint)local_340 + (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,(uint)local_340);
    local_378 = CONCAT44((uint)local_2d0 ^ uStack_344,(uint)local_360 ^ (uint)local_310);
    local_338._0_4_ = (uint)local_340 & ((uint)local_360 ^ (uint)local_310);
    local_300 = (ulonglong)uVar8;
    local_338._4_4_ = ((uint)local_2d0 ^ uStack_344) & uVar8;
    uVar10 = (uint)local_338 ^ (uint)local_310;
    uVar23 = local_338._4_4_ ^ uStack_344;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_340._4_4_ = uVar8;
    local_2f8 = uVar12;
    uVar13 = FUN_1400f59c0(&local_340);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2e0 + uVar8;
    if (uVar6 < uVar8) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xcf692694;
    if (uVar6 < 0xcf692694) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x3e640e8c;
    uVar6 = uVar6 + local_23c;
    if (uVar6 < local_23c) {
      iVar7 = iVar22 + -0x3e640e8b;
    }
    local_368._0_4_ = iVar7 + local_240;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_368);
    local_310._4_4_ = uVar17 & uVar16;
    local_310._0_4_ = uVar12 & (uint)local_2e8;
    uVar23 = (uVar17 | uVar16) & uVar9;
    uVar8 = (uVar12 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar23,uVar8);
    local_320 = local_378;
    uVar12 = uVar23 | local_310._4_4_;
    local_378 = CONCAT44(uVar23,uVar8 | (uint)local_310);
    local_368._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_330);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    local_368._4_4_ = local_368._4_4_ + uVar8;
    if (local_368._4_4_ < uVar8) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar8 = local_368._4_4_ + uVar12;
    if (uVar8 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_368 = CONCAT44(uVar8,uVar12);
    uVar21 = uVar6 + uVar21;
    if (uVar21 < uVar6) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    local_370._0_4_ = (uint)local_370 + (uint)local_338;
    local_310 = CONCAT44(local_310._4_4_,(uint)local_370);
    local_378 = CONCAT44(local_360._4_4_ ^ (uint)local_300,(uint)local_340 ^ (uint)local_328);
    local_338._0_4_ = (uint)local_370 & ((uint)local_340 ^ (uint)local_328);
    local_2e0 = (ulonglong)uVar21;
    local_338._4_4_ = (local_360._4_4_ ^ (uint)local_300) & uVar21;
    uVar10 = (uint)local_338 ^ (uint)local_328;
    uVar23 = local_338._4_4_ ^ local_360._4_4_;
    local_308 = uVar12;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_370._4_4_ = uVar21;
    uVar13 = FUN_1400f59c0(&local_370);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d8 + uVar21;
    if (uVar6 < uVar21) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x9ef14ad2;
    if (uVar6 < 0x9ef14ad2) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x1b64963f;
    uVar6 = uVar6 + uStack_234;
    if (uVar6 < uStack_234) {
      iVar7 = iVar22 + -0x1b64963e;
    }
    local_348 = iVar7 + local_238;
    local_338 = CONCAT44(local_338._4_4_,local_348);
    local_328._4_4_ = uVar8 & uVar17;
    local_328._0_4_ = uVar12 & local_2f8;
    uVar23 = (uVar8 | uVar17) & uVar16;
    uVar21 = (uVar12 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar23,uVar21);
    local_320 = local_378;
    uVar12 = uVar23 | local_328._4_4_;
    local_378 = CONCAT44(uVar23,uVar21 | (uint)local_328);
    uStack_344 = uVar6;
    uVar13 = FUN_1400f5870(&local_368);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uStack_344 = uStack_344 + uVar21;
    if (uStack_344 < uVar21) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar21 = uStack_344 + uVar12;
    if (uVar21 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    _local_348 = CONCAT44(uVar21,uVar12);
    uVar9 = uVar6 + uVar9;
    if (uVar9 < uVar6) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    local_358._0_4_ = (uint)local_358 + (uint)local_338;
    local_328 = CONCAT44(local_328._4_4_,(uint)local_358);
    local_378 = CONCAT44(local_340._4_4_ ^ (uint)local_2e0,(uint)local_370 ^ (uint)local_318);
    local_338._0_4_ = (uint)local_358 & ((uint)local_370 ^ (uint)local_318);
    local_2d8 = (ulonglong)uVar9;
    local_338._4_4_ = (local_340._4_4_ ^ (uint)local_2e0) & uVar9;
    uVar10 = (uint)local_338 ^ (uint)local_318;
    uVar23 = local_338._4_4_ ^ local_340._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_358._4_4_ = uVar9;
    local_2e8._0_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_358);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d0 + uVar9;
    if (uVar6 < uVar9) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x384f25e3;
    if (uVar6 < 0x384f25e3) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x1041b87a;
    uVar6 = uVar6 + local_22c;
    if (uVar6 < local_22c) {
      iVar7 = iVar22 + -0x1041b879;
    }
    local_360._0_4_ = iVar7 + local_230;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_360);
    local_318._0_4_ = uVar12 & local_308;
    local_318._4_4_ = uVar8 & uVar21;
    uVar23 = (uVar8 | uVar21) & uVar17;
    uVar9 = (uVar12 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar23,uVar9);
    local_320 = local_378;
    uVar12 = uVar23 | local_318._4_4_;
    local_378 = CONCAT44(uVar23,uVar9 | (uint)local_318);
    local_360._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_348);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    local_360._4_4_ = local_360._4_4_ + uVar9;
    if (local_360._4_4_ < uVar9) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar9 = local_360._4_4_ + uVar12;
    if (uVar9 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_360 = CONCAT44(uVar9,uVar12);
    uVar16 = uVar6 + uVar16;
    if (uVar16 < uVar6) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    local_350._0_4_ = (uint)local_350 + (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,(uint)local_350);
    local_378 = CONCAT44(local_370._4_4_ ^ (uint)local_2d8,(uint)local_358 ^ (uint)local_310);
    local_338._0_4_ = (uint)local_350 & ((uint)local_358 ^ (uint)local_310);
    local_2d0 = (ulonglong)uVar16;
    local_338._4_4_ = (local_370._4_4_ ^ (uint)local_2d8) & uVar16;
    uVar10 = (uint)local_338 ^ (uint)local_310;
    uVar23 = local_338._4_4_ ^ local_370._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_350._4_4_ = uVar16;
    local_2f8 = uVar12;
    uVar13 = FUN_1400f59c0(&local_350);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_300 + uVar16;
    if (uVar6 < uVar16) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x8b8cd5b5;
    if (uVar6 < 0x8b8cd5b5) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0xfc19dc6;
    uVar6 = uVar6 + local_224;
    if (uVar6 < local_224) {
      iVar7 = iVar22 + 0xfc19dc7;
    }
    local_340._0_4_ = iVar7 + local_228;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_340);
    local_310._0_4_ = uVar12 & (uint)local_2e8;
    local_310._4_4_ = uVar21 & uVar9;
    uVar23 = (uVar21 | uVar9) & uVar8;
    uVar16 = (uVar12 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar23,uVar16);
    local_320 = local_378;
    uVar12 = uVar23 | local_310._4_4_;
    local_378 = CONCAT44(uVar23,uVar16 | (uint)local_310);
    local_340._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_360);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    local_340._4_4_ = local_340._4_4_ + uVar16;
    if (local_340._4_4_ < uVar16) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar16 = local_340._4_4_ + uVar12;
    if (uVar16 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_340 = CONCAT44(uVar16,uVar12);
    uVar17 = uVar6 + uVar17;
    if (uVar17 < uVar6) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    local_330._0_4_ = (uint)local_330 + (uint)local_338;
    local_310 = CONCAT44(local_310._4_4_,(uint)local_330);
    local_378 = CONCAT44(local_358._4_4_ ^ (uint)local_2d0,(uint)local_350 ^ (uint)local_328);
    local_338._0_4_ = (uint)local_330 & ((uint)local_350 ^ (uint)local_328);
    local_300 = (ulonglong)uVar17;
    local_338._4_4_ = (local_358._4_4_ ^ (uint)local_2d0) & uVar17;
    uVar10 = (uint)local_338 ^ (uint)local_328;
    uVar23 = local_338._4_4_ ^ local_358._4_4_;
    local_308 = uVar12;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_330._4_4_ = uVar17;
    uVar13 = FUN_1400f59c0(&local_330);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2e0 + uVar17;
    if (uVar6 < uVar17) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x77ac9c65;
    if (uVar6 < 0x77ac9c65) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x240ca1cc;
    uVar6 = uVar6 + local_21c;
    if (uVar6 < local_21c) {
      iVar7 = iVar22 + 0x240ca1cd;
    }
    local_370._0_4_ = iVar7 + local_220;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_370);
    local_328._0_4_ = uVar12 & local_2f8;
    local_328._4_4_ = uVar9 & uVar16;
    uVar23 = (uVar9 | uVar16) & uVar21;
    uVar17 = (uVar12 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar23,uVar17);
    local_320 = local_378;
    uVar12 = uVar23 | local_328._4_4_;
    local_378 = CONCAT44(uVar23,uVar17 | (uint)local_328);
    local_370._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_340);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    local_370._4_4_ = local_370._4_4_ + uVar17;
    if (local_370._4_4_ < uVar17) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar17 = local_370._4_4_ + uVar12;
    if (uVar17 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_370 = CONCAT44(uVar17,uVar12);
    uVar8 = uVar6 + uVar8;
    if (uVar8 < uVar6) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    local_368._0_4_ = (uint)local_368 + (uint)local_338;
    local_328 = CONCAT44(local_328._4_4_,(uint)local_368);
    local_378 = CONCAT44(local_350._4_4_ ^ (uint)local_300,(uint)local_330 ^ (uint)local_318);
    local_338._0_4_ = (uint)local_368 & ((uint)local_330 ^ (uint)local_318);
    local_2e0 = (ulonglong)uVar8;
    local_338._4_4_ = (local_350._4_4_ ^ (uint)local_300) & uVar8;
    uVar10 = (uint)local_338 ^ (uint)local_318;
    uVar23 = local_338._4_4_ ^ local_350._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_368._4_4_ = uVar8;
    local_2e8._0_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_368);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d8 + uVar8;
    if (uVar6 < uVar8) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x592b0275;
    if (uVar6 < 0x592b0275) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x2de92c6f;
    uVar6 = uVar6 + local_214;
    if (uVar6 < local_214) {
      iVar7 = iVar22 + 0x2de92c70;
    }
    local_358._0_4_ = iVar7 + local_218;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_358);
    local_318._0_4_ = uVar12 & local_308;
    local_318._4_4_ = uVar16 & uVar17;
    uVar23 = (uVar16 | uVar17) & uVar9;
    uVar8 = (uVar12 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar23,uVar8);
    local_320 = local_378;
    uVar12 = uVar23 | local_318._4_4_;
    local_378 = CONCAT44(uVar23,uVar8 | (uint)local_318);
    local_358._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_370);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    local_358._4_4_ = local_358._4_4_ + uVar8;
    if (local_358._4_4_ < uVar8) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar8 = local_358._4_4_ + uVar12;
    if (uVar8 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_358 = CONCAT44(uVar8,uVar12);
    uVar21 = uVar6 + uVar21;
    if (uVar21 < uVar6) {
      local_348 = local_348 + 1;
    }
    local_348 = local_348 + (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,local_348);
    local_378 = CONCAT44(local_330._4_4_ ^ (uint)local_2e0,(uint)local_368 ^ (uint)local_310);
    local_338._0_4_ = local_348 & ((uint)local_368 ^ (uint)local_310);
    local_2d8 = (ulonglong)uVar21;
    local_338._4_4_ = (local_330._4_4_ ^ (uint)local_2e0) & uVar21;
    uVar23 = (uint)local_338 ^ (uint)local_310;
    uVar10 = local_338._4_4_ ^ local_330._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    uStack_344 = uVar21;
    local_2f8 = uVar12;
    uVar13 = FUN_1400f59c0(&local_348);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d0 + uVar21;
    if (uVar6 < uVar21) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar6 = uVar6 + uVar10;
    if (uVar6 < uVar10) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar23;
    uVar6 = uVar6 + 0x6ea6e483;
    if (uVar6 < 0x6ea6e483) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x4a7484aa;
    uVar6 = uVar6 + local_20c;
    if (uVar6 < local_20c) {
      iVar7 = iVar22 + 0x4a7484ab;
    }
    local_350._0_4_ = iVar7 + local_210;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_350);
    local_310._0_4_ = uVar12 & (uint)local_2e8;
    local_310._4_4_ = uVar17 & uVar8;
    uVar23 = (uVar17 | uVar8) & uVar16;
    uVar21 = (uVar12 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar23,uVar21);
    local_320 = local_378;
    uVar12 = uVar23 | local_310._4_4_;
    local_378 = CONCAT44(uVar23,uVar21 | (uint)local_310);
    local_350._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_358);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    local_350._4_4_ = local_350._4_4_ + uVar21;
    if (local_350._4_4_ < uVar21) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar21 = local_350._4_4_ + uVar12;
    if (uVar21 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_350 = CONCAT44(uVar21,uVar12);
    uVar9 = uVar6 + uVar9;
    if (uVar9 < uVar6) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    local_360._0_4_ = (uint)local_360 + (uint)local_338;
    local_310 = CONCAT44(local_310._4_4_,(uint)local_360);
    local_378 = CONCAT44(local_368._4_4_ ^ (uint)local_2d8,local_348 ^ (uint)local_328);
    local_338._0_4_ = (uint)local_360 & (local_348 ^ (uint)local_328);
    local_2d0 = (ulonglong)uVar9;
    local_338._4_4_ = (local_368._4_4_ ^ (uint)local_2d8) & uVar9;
    uVar10 = (uint)local_338 ^ (uint)local_328;
    uVar23 = local_338._4_4_ ^ local_368._4_4_;
    local_308 = uVar12;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_360._4_4_ = uVar9;
    uVar13 = FUN_1400f59c0(&local_360);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_300 + uVar9;
    if (uVar6 < uVar9) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xbd41fbd4;
    if (uVar6 < 0xbd41fbd4) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x5cb0a9dc;
    uVar6 = uVar6 + local_204;
    if (uVar6 < local_204) {
      iVar7 = iVar22 + 0x5cb0a9dd;
    }
    local_330._0_4_ = iVar7 + local_208;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_330);
    local_328._4_4_ = uVar21 & uVar8;
    local_328._0_4_ = uVar12 & local_2f8;
    uVar23 = (uVar21 | uVar8) & uVar17;
    uVar9 = (uVar12 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar23,uVar9);
    local_320 = local_378;
    uVar12 = uVar23 | local_328._4_4_;
    local_378 = CONCAT44(uVar23,uVar9 | (uint)local_328);
    local_330._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_350);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    local_330._4_4_ = local_330._4_4_ + uVar9;
    if (local_330._4_4_ < uVar9) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar9 = local_330._4_4_ + uVar12;
    if (uVar9 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_330 = CONCAT44(uVar9,uVar12);
    uVar16 = uVar6 + uVar16;
    if (uVar16 < uVar6) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    local_340._0_4_ = (uint)local_340 + (uint)local_338;
    local_328 = CONCAT44(local_328._4_4_,(uint)local_340);
    local_378 = CONCAT44((uint)local_2d0 ^ uStack_344,(uint)local_360 ^ (uint)local_318);
    local_338._0_4_ = (uint)local_340 & ((uint)local_360 ^ (uint)local_318);
    local_300 = (ulonglong)uVar16;
    local_338._4_4_ = ((uint)local_2d0 ^ uStack_344) & uVar16;
    uVar10 = (uint)local_338 ^ (uint)local_318;
    uVar23 = local_338._4_4_ ^ uStack_344;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_340._4_4_ = uVar16;
    local_2e8._0_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_340);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2e0 + uVar16;
    if (uVar6 < uVar16) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x831153b5;
    if (uVar6 < 0x831153b5) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x76f988da;
    uVar6 = uVar6 + local_1fc;
    if (uVar6 < local_1fc) {
      iVar7 = iVar22 + 0x76f988db;
    }
    local_368._0_4_ = iVar7 + local_200;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_368);
    local_318._4_4_ = uVar9 & uVar21;
    local_318._0_4_ = uVar12 & local_308;
    uVar23 = (uVar9 | uVar21) & uVar8;
    uVar16 = (uVar12 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar23,uVar16);
    local_320 = local_378;
    uVar12 = uVar23 | local_318._4_4_;
    local_378 = CONCAT44(uVar23,uVar16 | (uint)local_318);
    local_368._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_330);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    local_368._4_4_ = local_368._4_4_ + uVar16;
    if (local_368._4_4_ < uVar16) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar16 = local_368._4_4_ + uVar12;
    if (uVar16 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_368 = CONCAT44(uVar16,uVar12);
    uVar17 = uVar6 + uVar17;
    if (uVar17 < uVar6) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    local_370._0_4_ = (uint)local_370 + (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,(uint)local_370);
    local_378 = CONCAT44(local_360._4_4_ ^ (uint)local_300,(uint)local_340 ^ (uint)local_310);
    local_338._0_4_ = (uint)local_370 & ((uint)local_340 ^ (uint)local_310);
    local_2e0 = (ulonglong)uVar17;
    local_338._4_4_ = (local_360._4_4_ ^ (uint)local_300) & uVar17;
    uVar10 = (uint)local_338 ^ (uint)local_310;
    uVar23 = local_338._4_4_ ^ local_360._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_370._4_4_ = uVar17;
    local_2f8 = uVar12;
    uVar13 = FUN_1400f59c0(&local_370);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d8 + uVar17;
    if (uVar6 < uVar17) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xee66dfab;
    if (uVar6 < 0xee66dfab) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x67c1aeae;
    uVar6 = uVar6 + local_1f4;
    if (uVar6 < local_1f4) {
      iVar7 = iVar22 + -0x67c1aead;
    }
    local_348 = iVar7 + local_1f8;
    local_338 = CONCAT44(local_338._4_4_,local_348);
    local_310._4_4_ = uVar16 & uVar9;
    local_310._0_4_ = uVar12 & (uint)local_2e8;
    uVar23 = (uVar16 | uVar9) & uVar21;
    uVar17 = (uVar12 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar23,uVar17);
    local_320 = local_378;
    uVar12 = uVar23 | local_310._4_4_;
    local_378 = CONCAT44(uVar23,uVar17 | (uint)local_310);
    uStack_344 = uVar6;
    uVar13 = FUN_1400f5870(&local_368);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    uStack_344 = uStack_344 + uVar17;
    if (uStack_344 < uVar17) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar17 = uStack_344 + uVar12;
    if (uVar17 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    _local_348 = CONCAT44(uVar17,uVar12);
    uVar8 = uVar6 + uVar8;
    if (uVar8 < uVar6) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    local_358._0_4_ = (uint)local_358 + (uint)local_338;
    local_310 = CONCAT44(local_310._4_4_,(uint)local_358);
    local_378 = CONCAT44(local_340._4_4_ ^ (uint)local_2e0,(uint)local_370 ^ (uint)local_328);
    local_338._0_4_ = (uint)local_358 & ((uint)local_370 ^ (uint)local_328);
    local_2d8 = (ulonglong)uVar8;
    local_338._4_4_ = (local_340._4_4_ ^ (uint)local_2e0) & uVar8;
    uVar10 = (uint)local_338 ^ (uint)local_328;
    uVar23 = local_338._4_4_ ^ local_340._4_4_;
    local_308 = uVar12;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_358._4_4_ = uVar8;
    uVar13 = FUN_1400f59c0(&local_358);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d0 + uVar8;
    if (uVar6 < uVar8) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x2db43210;
    if (uVar6 < 0x2db43210) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x57ce3993;
    uVar6 = uVar6 + local_1ec;
    if (uVar6 < local_1ec) {
      iVar7 = iVar22 + -0x57ce3992;
    }
    local_360._0_4_ = iVar7 + local_1f0;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_360);
    local_328._0_4_ = uVar12 & local_2f8;
    local_328._4_4_ = uVar16 & uVar17;
    uVar23 = (uVar16 | uVar17) & uVar9;
    uVar8 = (uVar12 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar23,uVar8);
    local_320 = local_378;
    uVar12 = uVar23 | local_328._4_4_;
    local_378 = CONCAT44(uVar23,uVar8 | (uint)local_328);
    local_360._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_348);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    local_360._4_4_ = local_360._4_4_ + uVar8;
    if (local_360._4_4_ < uVar8) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar8 = local_360._4_4_ + uVar12;
    if (uVar8 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_360 = CONCAT44(uVar8,uVar12);
    uVar21 = uVar6 + uVar21;
    if (uVar21 < uVar6) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    local_350._0_4_ = (uint)local_350 + (uint)local_338;
    local_328 = CONCAT44(local_328._4_4_,(uint)local_350);
    local_378 = CONCAT44(local_370._4_4_ ^ (uint)local_2d8,(uint)local_358 ^ (uint)local_318);
    local_338._0_4_ = (uint)local_350 & ((uint)local_358 ^ (uint)local_318);
    local_2d0 = (ulonglong)uVar21;
    local_338._4_4_ = (local_370._4_4_ ^ (uint)local_2d8) & uVar21;
    uVar10 = (uint)local_338 ^ (uint)local_318;
    uVar23 = local_338._4_4_ ^ local_370._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_350._4_4_ = uVar21;
    local_2e8._0_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_350);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_300 + uVar21;
    if (uVar6 < uVar21) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x98fb213f;
    if (uVar6 < 0x98fb213f) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x4ffcd838;
    uVar6 = uVar6 + local_1e4;
    if (uVar6 < local_1e4) {
      iVar7 = iVar22 + -0x4ffcd837;
    }
    local_340._0_4_ = iVar7 + local_1e8;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_340);
    local_318._0_4_ = uVar12 & local_308;
    local_318._4_4_ = uVar17 & uVar8;
    uVar23 = (uVar17 | uVar8) & uVar16;
    uVar21 = (uVar12 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar23,uVar21);
    local_320 = local_378;
    uVar12 = uVar23 | local_318._4_4_;
    local_378 = CONCAT44(uVar23,uVar21 | (uint)local_318);
    local_340._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_360);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    local_340._4_4_ = local_340._4_4_ + uVar21;
    if (local_340._4_4_ < uVar21) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar21 = local_340._4_4_ + uVar12;
    if (uVar21 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_340 = CONCAT44(uVar21,uVar12);
    uVar9 = uVar6 + uVar9;
    if (uVar9 < uVar6) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    local_330._0_4_ = (uint)local_330 + (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,(uint)local_330);
    local_378 = CONCAT44(local_358._4_4_ ^ (uint)local_2d0,(uint)local_350 ^ (uint)local_310);
    local_338._0_4_ = (uint)local_330 & ((uint)local_350 ^ (uint)local_310);
    local_300 = (ulonglong)uVar9;
    local_338._4_4_ = (local_358._4_4_ ^ (uint)local_2d0) & uVar9;
    uVar10 = (uint)local_338 ^ (uint)local_310;
    uVar23 = local_338._4_4_ ^ local_358._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_330._4_4_ = uVar9;
    local_2f8 = uVar12;
    uVar13 = FUN_1400f59c0(&local_330);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2e0 + uVar9;
    if (uVar6 < uVar9) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xbeef0ee4;
    if (uVar6 < 0xbeef0ee4) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x40a68039;
    uVar6 = uVar6 + local_1dc;
    if (uVar6 < local_1dc) {
      iVar7 = iVar22 + -0x40a68038;
    }
    local_370._0_4_ = iVar7 + local_1e0;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_370);
    local_310._0_4_ = uVar12 & (uint)local_2e8;
    local_310._4_4_ = uVar8 & uVar21;
    uVar23 = (uVar8 | uVar21) & uVar17;
    uVar9 = (uVar12 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar23,uVar9);
    local_320 = local_378;
    uVar12 = uVar23 | local_310._4_4_;
    local_378 = CONCAT44(uVar23,uVar9 | (uint)local_310);
    local_370._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_340);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    local_370._4_4_ = local_370._4_4_ + uVar9;
    if (local_370._4_4_ < uVar9) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar9 = local_370._4_4_ + uVar12;
    if (uVar9 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_370 = CONCAT44(uVar9,uVar12);
    uVar16 = uVar6 + uVar16;
    if (uVar16 < uVar6) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    local_368._0_4_ = (uint)local_368 + (uint)local_338;
    local_310 = CONCAT44(local_310._4_4_,(uint)local_368);
    local_378 = CONCAT44(local_350._4_4_ ^ (uint)local_300,(uint)local_330 ^ (uint)local_328);
    local_338._0_4_ = (uint)local_368 & ((uint)local_330 ^ (uint)local_328);
    local_2e0 = (ulonglong)uVar16;
    local_338._4_4_ = (local_350._4_4_ ^ (uint)local_300) & uVar16;
    uVar10 = (uint)local_338 ^ (uint)local_328;
    uVar23 = local_338._4_4_ ^ local_350._4_4_;
    local_308 = uVar12;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_368._4_4_ = uVar16;
    uVar13 = FUN_1400f59c0(&local_368);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d8 + uVar16;
    if (uVar6 < uVar16) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x3da88fc2;
    if (uVar6 < 0x3da88fc2) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x391ff40d;
    uVar6 = uVar6 + local_1d4;
    if (uVar6 < local_1d4) {
      iVar7 = iVar22 + -0x391ff40c;
    }
    local_358._0_4_ = iVar7 + local_1d8;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_358);
    local_328._0_4_ = uVar12 & local_2f8;
    local_328._4_4_ = uVar21 & uVar9;
    uVar23 = (uVar21 | uVar9) & uVar8;
    uVar16 = (uVar12 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar23,uVar16);
    local_320 = local_378;
    uVar12 = uVar23 | local_328._4_4_;
    local_378 = CONCAT44(uVar23,uVar16 | (uint)local_328);
    local_358._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_370);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    local_358._4_4_ = local_358._4_4_ + uVar16;
    if (local_358._4_4_ < uVar16) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar16 = local_358._4_4_ + uVar12;
    if (uVar16 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_358 = CONCAT44(uVar16,uVar12);
    uVar17 = uVar6 + uVar17;
    if (uVar17 < uVar6) {
      local_348 = local_348 + 1;
    }
    local_348 = local_348 + (uint)local_338;
    local_328 = CONCAT44(local_328._4_4_,local_348);
    local_378 = CONCAT44(local_330._4_4_ ^ (uint)local_2e0,(uint)local_368 ^ (uint)local_318);
    local_338._0_4_ = local_348 & ((uint)local_368 ^ (uint)local_318);
    local_2d8 = (ulonglong)uVar17;
    local_338._4_4_ = (local_330._4_4_ ^ (uint)local_2e0) & uVar17;
    uVar10 = (uint)local_338 ^ (uint)local_318;
    uVar23 = local_338._4_4_ ^ local_330._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    uStack_344 = uVar17;
    local_2e8._0_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_348);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d0 + uVar17;
    if (uVar6 < uVar17) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x930aa725;
    if (uVar6 < 0x930aa725) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x2a586eb9;
    uVar6 = uVar6 + local_1cc;
    if (uVar6 < local_1cc) {
      iVar7 = iVar22 + -0x2a586eb8;
    }
    local_350._0_4_ = iVar7 + local_1d0;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_350);
    local_318._0_4_ = uVar12 & local_308;
    local_318._4_4_ = uVar9 & uVar16;
    uVar23 = (uVar9 | uVar16) & uVar21;
    uVar17 = (uVar12 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar23,uVar17);
    local_320 = local_378;
    uVar12 = uVar23 | local_318._4_4_;
    local_378 = CONCAT44(uVar23,uVar17 | (uint)local_318);
    local_350._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_358);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    local_350._4_4_ = local_350._4_4_ + uVar17;
    if (local_350._4_4_ < uVar17) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar17 = local_350._4_4_ + uVar12;
    if (uVar17 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_350 = CONCAT44(uVar17,uVar12);
    uVar8 = uVar6 + uVar8;
    if (uVar8 < uVar6) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    local_360._0_4_ = (uint)local_360 + (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,(uint)local_360);
    local_378 = CONCAT44(local_368._4_4_ ^ (uint)local_2d8,local_348 ^ (uint)local_310);
    local_338._0_4_ = (uint)local_360 & (local_348 ^ (uint)local_310);
    local_2d0 = (ulonglong)uVar8;
    local_338._4_4_ = (local_368._4_4_ ^ (uint)local_2d8) & uVar8;
    uVar10 = (uint)local_338 ^ (uint)local_310;
    uVar23 = local_338._4_4_ ^ local_368._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_360._4_4_ = uVar8;
    local_2f8 = uVar12;
    uVar13 = FUN_1400f59c0(&local_360);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_300 + uVar8;
    if (uVar6 < uVar8) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xe003826f;
    if (uVar6 < 0xe003826f) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x6ca6351;
    uVar6 = uVar6 + local_1c4;
    if (uVar6 < local_1c4) {
      iVar7 = iVar22 + 0x6ca6352;
    }
    local_330._0_4_ = iVar7 + local_1c8;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_330);
    local_310._4_4_ = uVar17 & uVar16;
    local_310._0_4_ = uVar12 & (uint)local_2e8;
    uVar23 = (uVar17 | uVar16) & uVar9;
    uVar8 = (uVar12 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar23,uVar8);
    local_320 = local_378;
    uVar12 = uVar23 | local_310._4_4_;
    local_378 = CONCAT44(uVar23,uVar8 | (uint)local_310);
    local_330._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_350);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    local_330._4_4_ = local_330._4_4_ + uVar8;
    if (local_330._4_4_ < uVar8) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar8 = local_330._4_4_ + uVar12;
    if (uVar8 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_330 = CONCAT44(uVar8,uVar12);
    uVar21 = uVar6 + uVar21;
    if (uVar21 < uVar6) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    local_340._0_4_ = (uint)local_340 + (uint)local_338;
    local_310 = CONCAT44(local_310._4_4_,(uint)local_340);
    local_378 = CONCAT44((uint)local_2d0 ^ uStack_344,(uint)local_360 ^ (uint)local_328);
    local_338._0_4_ = (uint)local_340 & ((uint)local_360 ^ (uint)local_328);
    local_300 = (ulonglong)uVar21;
    local_338._4_4_ = ((uint)local_2d0 ^ uStack_344) & uVar21;
    uVar10 = (uint)local_338 ^ (uint)local_328;
    uVar23 = local_338._4_4_ ^ uStack_344;
    local_308 = uVar12;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_340._4_4_ = uVar21;
    uVar13 = FUN_1400f59c0(&local_340);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2e0 + uVar21;
    if (uVar6 < uVar21) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xa0e6e70;
    if (uVar6 < 0xa0e6e70) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x14292967;
    uVar6 = uVar6 + local_1bc;
    if (uVar6 < local_1bc) {
      iVar7 = iVar22 + 0x14292968;
    }
    local_368._0_4_ = iVar7 + local_1c0;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_368);
    local_328._4_4_ = uVar8 & uVar17;
    local_328._0_4_ = uVar12 & local_2f8;
    uVar23 = (uVar8 | uVar17) & uVar16;
    uVar21 = (uVar12 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar23,uVar21);
    local_320 = local_378;
    uVar12 = uVar23 | local_328._4_4_;
    local_378 = CONCAT44(uVar23,uVar21 | (uint)local_328);
    local_368._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_330);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    local_368._4_4_ = local_368._4_4_ + uVar21;
    if (local_368._4_4_ < uVar21) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar21 = local_368._4_4_ + uVar12;
    if (uVar21 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    local_2c8._0_4_ = iVar22 + (uint)local_378;
    uVar9 = uVar6 + uVar9;
    if (uVar9 < uVar6) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    local_370._0_4_ = (uint)local_370 + (uint)local_338;
    local_328 = CONCAT44(local_328._4_4_,(uint)local_370);
    local_378 = CONCAT44(local_360._4_4_ ^ (uint)local_300,(uint)local_340 ^ (uint)local_318);
    local_338._0_4_ = (uint)local_370 & ((uint)local_340 ^ (uint)local_318);
    local_2e0 = (ulonglong)uVar9;
    local_338._4_4_ = (local_360._4_4_ ^ (uint)local_300) & uVar9;
    uVar23 = (uint)local_338 ^ (uint)local_318;
    uVar12 = local_338._4_4_ ^ local_360._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_368._0_4_ = (uint)local_2c8;
    local_2c8._4_4_ = uVar21;
    local_2e8._0_4_ = (uint)local_368;
    local_368._4_4_ = uVar21;
    local_370._4_4_ = uVar9;
    uVar13 = FUN_1400f59c0(&local_370);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d8 + uVar9;
    if (uVar6 < uVar9) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar6 = uVar6 + uVar12;
    if (uVar6 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar23;
    uVar6 = uVar6 + 0x46d22ffc;
    if (uVar6 < 0x46d22ffc) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x27b70a85;
    uVar6 = uVar6 + local_1b4;
    if (uVar6 < local_1b4) {
      iVar7 = iVar22 + 0x27b70a86;
    }
    local_348 = iVar7 + local_1b8;
    local_338 = CONCAT44(local_338._4_4_,local_348);
    local_318._4_4_ = uVar8 & local_2c8._4_4_;
    uVar12 = (uVar8 | local_2c8._4_4_) & uVar17;
    local_318._0_4_ = (uint)local_2c8 & local_308;
    uVar9 = ((uint)local_2c8 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar12,uVar9);
    local_320 = local_378;
    uVar23 = uVar12 | local_318._4_4_;
    local_378 = CONCAT44(uVar12,uVar9 | (uint)local_318);
    uStack_344 = uVar6;
    uVar13 = FUN_1400f5870(&local_368);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    uStack_344 = uStack_344 + uVar9;
    if (uStack_344 < uVar9) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar9 = uStack_344 + uVar23;
    if (uVar9 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    local_2c8._0_4_ = iVar22 + (uint)local_378;
    uVar16 = uVar6 + uVar16;
    if (uVar16 < uVar6) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    local_358._0_4_ = (uint)local_358 + (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,(uint)local_358);
    local_378 = CONCAT44(local_340._4_4_ ^ (uint)local_2e0,(uint)local_370 ^ (uint)local_310);
    local_338._0_4_ = (uint)local_358 & ((uint)local_370 ^ (uint)local_310);
    local_2d8 = (ulonglong)uVar16;
    local_338._4_4_ = (local_340._4_4_ ^ (uint)local_2e0) & uVar16;
    uVar12 = (uint)local_338 ^ (uint)local_310;
    uVar23 = local_338._4_4_ ^ local_340._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_348 = (uint)local_2c8;
    local_2c8._4_4_ = uVar9;
    local_2f8 = local_348;
    uStack_344 = uVar9;
    local_358._4_4_ = uVar16;
    uVar13 = FUN_1400f59c0(&local_358);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d0 + uVar16;
    if (uVar6 < uVar16) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar12;
    uVar6 = uVar6 + 0x5c26c926;
    if (uVar6 < 0x5c26c926) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x2e1b2138;
    uVar6 = uVar6 + local_1ac;
    if (uVar6 < local_1ac) {
      iVar7 = iVar22 + 0x2e1b2139;
    }
    local_360._0_4_ = iVar7 + local_1b0;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_360);
    local_310._4_4_ = uVar21 & local_2c8._4_4_;
    uVar12 = (uVar21 | local_2c8._4_4_) & uVar8;
    local_310._0_4_ = (uint)local_2c8 & (uint)local_2e8;
    uVar16 = ((uint)local_2c8 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar12,uVar16);
    local_320 = local_378;
    uVar23 = uVar12 | local_310._4_4_;
    local_378 = CONCAT44(uVar12,uVar16 | (uint)local_310);
    local_360._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_348);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    local_360._4_4_ = local_360._4_4_ + uVar16;
    if (local_360._4_4_ < uVar16) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar16 = local_360._4_4_ + uVar23;
    if (uVar16 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    local_308 = iVar22 + (uint)local_378;
    uVar17 = uVar6 + uVar17;
    if (uVar17 < uVar6) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    local_350._0_4_ = (uint)local_350 + (uint)local_338;
    local_310 = CONCAT44(local_310._4_4_,(uint)local_350);
    local_378 = CONCAT44(local_370._4_4_ ^ (uint)local_2d8,(uint)local_358 ^ (uint)local_328);
    local_338._0_4_ = (uint)local_350 & ((uint)local_358 ^ (uint)local_328);
    local_2d0 = (ulonglong)uVar17;
    local_338._4_4_ = (local_370._4_4_ ^ (uint)local_2d8) & uVar17;
    uVar23 = (uint)local_338 ^ (uint)local_328;
    uVar12 = local_338._4_4_ ^ local_370._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_2c8._0_4_ = local_308;
    local_2c8._4_4_ = uVar16;
    local_360._0_4_ = local_308;
    local_360._4_4_ = uVar16;
    local_350._4_4_ = uVar17;
    uVar13 = FUN_1400f59c0(&local_350);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_300 + uVar17;
    if (uVar6 < uVar17) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar6 = uVar6 + uVar12;
    if (uVar6 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar23;
    uVar6 = uVar6 + 0x5ac42aed;
    if (uVar6 < 0x5ac42aed) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x4d2c6dfc;
    uVar6 = uVar6 + local_1a4;
    if (uVar6 < local_1a4) {
      iVar7 = iVar22 + 0x4d2c6dfd;
    }
    local_340._0_4_ = iVar7 + local_1a8;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_340);
    local_328._4_4_ = uVar9 & local_2c8._4_4_;
    uVar12 = (uVar9 | local_2c8._4_4_) & uVar21;
    local_328._0_4_ = (uint)local_2c8 & local_2f8;
    uVar17 = ((uint)local_2c8 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar12,uVar17);
    local_320 = local_378;
    uVar23 = uVar12 | local_328._4_4_;
    local_378 = CONCAT44(uVar12,uVar17 | (uint)local_328);
    local_340._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_360);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    local_340._4_4_ = local_340._4_4_ + uVar17;
    if (local_340._4_4_ < uVar17) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar17 = local_340._4_4_ + uVar23;
    if (uVar17 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    local_2c8._0_4_ = iVar22 + (uint)local_378;
    uVar8 = uVar6 + uVar8;
    if (uVar8 < uVar6) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    local_330._0_4_ = (uint)local_330 + (uint)local_338;
    local_328 = CONCAT44(local_328._4_4_,(uint)local_330);
    local_378 = CONCAT44(local_358._4_4_ ^ (uint)local_2d0,(uint)local_350 ^ (uint)local_318);
    local_338._0_4_ = (uint)local_330 & ((uint)local_350 ^ (uint)local_318);
    local_300 = (ulonglong)uVar8;
    local_338._4_4_ = (local_358._4_4_ ^ (uint)local_2d0) & uVar8;
    uVar23 = (uint)local_338 ^ (uint)local_318;
    uVar12 = local_338._4_4_ ^ local_358._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_340._0_4_ = (uint)local_2c8;
    local_2c8._4_4_ = uVar17;
    local_2e8._0_4_ = (uint)local_340;
    local_340._4_4_ = uVar17;
    local_330._4_4_ = uVar8;
    uVar13 = FUN_1400f59c0(&local_330);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2e0 + uVar8;
    if (uVar6 < uVar8) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar6 = uVar6 + uVar12;
    if (uVar6 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar23;
    uVar6 = uVar6 + 0x9d95b3df;
    if (uVar6 < 0x9d95b3df) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x53380d13;
    uVar6 = uVar6 + local_19c;
    if (uVar6 < local_19c) {
      iVar7 = iVar22 + 0x53380d14;
    }
    local_370._0_4_ = iVar7 + local_1a0;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_370);
    local_318._4_4_ = uVar16 & local_2c8._4_4_;
    uVar12 = (uVar16 | local_2c8._4_4_) & uVar9;
    local_318._0_4_ = (uint)local_2c8 & local_308;
    uVar8 = ((uint)local_2c8 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar12,uVar8);
    local_320 = local_378;
    uVar23 = uVar12 | local_318._4_4_;
    local_378 = CONCAT44(uVar12,uVar8 | (uint)local_318);
    local_370._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_340);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    local_370._4_4_ = local_370._4_4_ + uVar8;
    if (local_370._4_4_ < uVar8) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar8 = local_370._4_4_ + uVar23;
    if (uVar8 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_370 = CONCAT44(uVar8,uVar12);
    local_368._4_4_ = uVar6 + uVar21;
    if (local_368._4_4_ < uVar6) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    local_368._0_4_ = (uint)local_368 + (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,(uint)local_368);
    local_378 = CONCAT44(local_350._4_4_ ^ (uint)local_300,(uint)local_330 ^ (uint)local_310);
    local_338._0_4_ = (uint)local_368 & ((uint)local_330 ^ (uint)local_310);
    local_2e0 = (ulonglong)local_368._4_4_;
    local_338._4_4_ = (local_350._4_4_ ^ (uint)local_300) & local_368._4_4_;
    uVar10 = (uint)local_338 ^ (uint)local_310;
    uVar23 = local_338._4_4_ ^ local_350._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_2f8 = uVar12;
    uVar13 = FUN_1400f59c0(&local_368);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d8 + uVar21;
    if (uVar6 < uVar21) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x8baf63de;
    if (uVar6 < 0x8baf63de) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x650a7354;
    uVar6 = uVar6 + local_194;
    if (uVar6 < local_194) {
      iVar7 = iVar22 + 0x650a7355;
    }
    local_358._0_4_ = iVar7 + local_198;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_358);
    local_310._0_4_ = uVar12 & (uint)local_2e8;
    local_310._4_4_ = uVar17 & uVar8;
    uVar23 = (uVar17 | uVar8) & uVar16;
    uVar21 = (uVar12 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar23,uVar21);
    local_320 = local_378;
    uVar12 = uVar23 | local_310._4_4_;
    local_378 = CONCAT44(uVar23,uVar21 | (uint)local_310);
    local_358._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_370);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    local_358._4_4_ = local_358._4_4_ + uVar21;
    if (local_358._4_4_ < uVar21) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar21 = local_358._4_4_ + uVar12;
    if (uVar21 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_358 = CONCAT44(uVar21,uVar12);
    uStack_344 = uVar6 + uVar9;
    if (uStack_344 < uVar6) {
      local_348 = local_348 + 1;
    }
    local_348 = local_348 + (uint)local_338;
    local_310 = CONCAT44(local_310._4_4_,local_348);
    local_378 = CONCAT44(local_330._4_4_ ^ (uint)local_2e0,(uint)local_368 ^ (uint)local_328);
    local_338._0_4_ = local_348 & ((uint)local_368 ^ (uint)local_328);
    local_2d8 = (ulonglong)uStack_344;
    local_338._4_4_ = (local_330._4_4_ ^ (uint)local_2e0) & uStack_344;
    uVar10 = (uint)local_338 ^ (uint)local_328;
    uVar23 = local_338._4_4_ ^ local_330._4_4_;
    local_308 = uVar12;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    uVar13 = FUN_1400f59c0(&local_348);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d0 + uVar9;
    if (uVar6 < uVar9) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x3c77b2a8;
    if (uVar6 < 0x3c77b2a8) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x766a0abb;
    uVar6 = uVar6 + local_18c;
    if (uVar6 < local_18c) {
      iVar7 = iVar22 + 0x766a0abc;
    }
    local_350._0_4_ = iVar7 + local_190;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_350);
    local_328._0_4_ = uVar12 & local_2f8;
    local_328._4_4_ = uVar8 & uVar21;
    uVar23 = (uVar8 | uVar21) & uVar17;
    uVar9 = (uVar12 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar23,uVar9);
    local_320 = local_378;
    uVar12 = uVar23 | local_328._4_4_;
    local_378 = CONCAT44(uVar23,uVar9 | (uint)local_328);
    local_350._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_358);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    local_350._4_4_ = local_350._4_4_ + uVar9;
    if (local_350._4_4_ < uVar9) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar9 = local_350._4_4_ + uVar12;
    if (uVar9 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_350 = CONCAT44(uVar9,uVar12);
    local_360._4_4_ = uVar6 + uVar16;
    if (local_360._4_4_ < uVar6) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    local_360._0_4_ = (uint)local_360 + (uint)local_338;
    local_328 = CONCAT44(local_328._4_4_,(uint)local_360);
    local_378 = CONCAT44(local_368._4_4_ ^ (uint)local_2d8,local_348 ^ (uint)local_318);
    local_338._0_4_ = (uint)local_360 & (local_348 ^ (uint)local_318);
    local_2d0 = (ulonglong)local_360._4_4_;
    local_338._4_4_ = (local_368._4_4_ ^ (uint)local_2d8) & local_360._4_4_;
    uVar10 = (uint)local_338 ^ (uint)local_318;
    uVar23 = local_338._4_4_ ^ local_368._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_2e8._0_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_360);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_300 + uVar16;
    if (uVar6 < uVar16) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x47edaee6;
    if (uVar6 < 0x47edaee6) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x7e3d36d2;
    uVar6 = uVar6 + local_184;
    if (uVar6 < local_184) {
      iVar7 = iVar22 + -0x7e3d36d1;
    }
    local_330._0_4_ = iVar7 + local_188;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_330);
    local_318._4_4_ = uVar9 & uVar21;
    local_318._0_4_ = uVar12 & local_308;
    uVar23 = (uVar9 | uVar21) & uVar8;
    uVar16 = (uVar12 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar23,uVar16);
    local_320 = local_378;
    uVar12 = uVar23 | local_318._4_4_;
    local_378 = CONCAT44(uVar23,uVar16 | (uint)local_318);
    local_330._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_350);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    local_330._4_4_ = local_330._4_4_ + uVar16;
    if (local_330._4_4_ < uVar16) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar16 = local_330._4_4_ + uVar12;
    if (uVar16 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_330 = CONCAT44(uVar16,uVar12);
    local_340._4_4_ = uVar6 + uVar17;
    if (local_340._4_4_ < uVar6) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    local_340._0_4_ = (uint)local_340 + (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,(uint)local_340);
    local_378 = CONCAT44((uint)local_2d0 ^ uStack_344,(uint)local_360 ^ (uint)local_310);
    local_338._0_4_ = (uint)local_340 & ((uint)local_360 ^ (uint)local_310);
    local_300 = (ulonglong)local_340._4_4_;
    local_338._4_4_ = ((uint)local_2d0 ^ uStack_344) & local_340._4_4_;
    uVar10 = (uint)local_338 ^ (uint)local_310;
    uVar23 = local_338._4_4_ ^ uStack_344;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_2f8 = uVar12;
    uVar13 = FUN_1400f59c0(&local_340);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2e0 + uVar17;
    if (uVar6 < uVar17) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x1482353b;
    if (uVar6 < 0x1482353b) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x6d8dd37b;
    uVar6 = uVar6 + local_17c;
    if (uVar6 < local_17c) {
      iVar7 = iVar22 + -0x6d8dd37a;
    }
    local_368._0_4_ = iVar7 + local_180;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_368);
    local_310._0_4_ = uVar12 & (uint)local_2e8;
    local_310._4_4_ = uVar9 & uVar16;
    uVar23 = (uVar9 | uVar16) & uVar21;
    uVar17 = (uVar12 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar23,uVar17);
    local_320 = local_378;
    uVar12 = uVar23 | local_310._4_4_;
    local_378 = CONCAT44(uVar23,uVar17 | (uint)local_310);
    local_368._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_330);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    local_368._4_4_ = local_368._4_4_ + uVar17;
    if (local_368._4_4_ < uVar17) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar17 = local_368._4_4_ + uVar12;
    if (uVar17 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_368 = CONCAT44(uVar17,uVar12);
    uVar8 = uVar6 + uVar8;
    if (uVar8 < uVar6) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    local_370._0_4_ = (uint)local_370 + (uint)local_338;
    local_310 = CONCAT44(local_310._4_4_,(uint)local_370);
    local_378 = CONCAT44(local_360._4_4_ ^ (uint)local_300,(uint)local_340 ^ (uint)local_328);
    local_338._0_4_ = (uint)local_370 & ((uint)local_340 ^ (uint)local_328);
    local_2e0 = (ulonglong)uVar8;
    local_338._4_4_ = (local_360._4_4_ ^ (uint)local_300) & uVar8;
    uVar10 = (uint)local_338 ^ (uint)local_328;
    uVar23 = local_338._4_4_ ^ local_360._4_4_;
    local_308 = uVar12;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_370._4_4_ = uVar8;
    uVar13 = FUN_1400f59c0(&local_370);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d8 + uVar8;
    if (uVar6 < uVar8) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x4cf10364;
    if (uVar6 < 0x4cf10364) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x5d40175f;
    uVar6 = uVar6 + local_174;
    if (uVar6 < local_174) {
      iVar7 = iVar22 + -0x5d40175e;
    }
    local_348 = iVar7 + local_178;
    local_338 = CONCAT44(local_338._4_4_,local_348);
    local_328._0_4_ = uVar12 & local_2f8;
    local_328._4_4_ = uVar16 & uVar17;
    uVar23 = (uVar16 | uVar17) & uVar9;
    uVar8 = (uVar12 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar23,uVar8);
    local_320 = local_378;
    uVar12 = uVar23 | local_328._4_4_;
    local_378 = CONCAT44(uVar23,uVar8 | (uint)local_328);
    uStack_344 = uVar6;
    uVar13 = FUN_1400f5870(&local_368);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uStack_344 = uStack_344 + uVar8;
    if (uStack_344 < uVar8) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar8 = uStack_344 + uVar12;
    if (uVar8 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    _local_348 = CONCAT44(uVar8,uVar12);
    uVar21 = uVar6 + uVar21;
    if (uVar21 < uVar6) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    local_358._0_4_ = (uint)local_358 + (uint)local_338;
    local_328 = CONCAT44(local_328._4_4_,(uint)local_358);
    local_378 = CONCAT44(local_340._4_4_ ^ (uint)local_2e0,(uint)local_370 ^ (uint)local_318);
    local_338._0_4_ = (uint)local_358 & ((uint)local_370 ^ (uint)local_318);
    local_2d8 = (ulonglong)uVar21;
    local_338._4_4_ = (local_340._4_4_ ^ (uint)local_2e0) & uVar21;
    uVar10 = (uint)local_338 ^ (uint)local_318;
    uVar23 = local_338._4_4_ ^ local_340._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_358._4_4_ = uVar21;
    local_2e8._0_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_358);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d0 + uVar21;
    if (uVar6 < uVar21) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xbc423001;
    if (uVar6 < 0xbc423001) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x57e599b5;
    uVar6 = uVar6 + local_16c;
    if (uVar6 < local_16c) {
      iVar7 = iVar22 + -0x57e599b4;
    }
    local_360._0_4_ = iVar7 + local_170;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_360);
    local_318._0_4_ = uVar12 & local_308;
    local_318._4_4_ = uVar17 & uVar8;
    uVar23 = (uVar17 | uVar8) & uVar16;
    uVar21 = (uVar12 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar23,uVar21);
    local_320 = local_378;
    uVar12 = uVar23 | local_318._4_4_;
    local_378 = CONCAT44(uVar23,uVar21 | (uint)local_318);
    local_360._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_348);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    local_360._4_4_ = local_360._4_4_ + uVar21;
    if (local_360._4_4_ < uVar21) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar21 = local_360._4_4_ + uVar12;
    if (uVar21 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_360 = CONCAT44(uVar21,uVar12);
    uVar9 = uVar6 + uVar9;
    if (uVar9 < uVar6) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    local_350._0_4_ = (uint)local_350 + (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,(uint)local_350);
    local_378 = CONCAT44(local_370._4_4_ ^ (uint)local_2d8,(uint)local_358 ^ (uint)local_310);
    local_338._0_4_ = (uint)local_350 & ((uint)local_358 ^ (uint)local_310);
    local_2d0 = (ulonglong)uVar9;
    local_338._4_4_ = (local_370._4_4_ ^ (uint)local_2d8) & uVar9;
    uVar10 = (uint)local_338 ^ (uint)local_310;
    uVar23 = local_338._4_4_ ^ local_370._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_350._4_4_ = uVar9;
    local_2f8 = uVar12;
    uVar13 = FUN_1400f59c0(&local_350);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_300 + uVar9;
    if (uVar6 < uVar9) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xd0f89791;
    if (uVar6 < 0xd0f89791) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x3db47490;
    uVar6 = uVar6 + local_164;
    if (uVar6 < local_164) {
      iVar7 = iVar22 + -0x3db4748f;
    }
    local_340._0_4_ = iVar7 + local_168;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_340);
    local_310._0_4_ = uVar12 & (uint)local_2e8;
    local_310._4_4_ = uVar8 & uVar21;
    uVar23 = (uVar8 | uVar21) & uVar17;
    uVar9 = (uVar12 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar23,uVar9);
    local_320 = local_378;
    uVar12 = uVar23 | local_310._4_4_;
    local_378 = CONCAT44(uVar23,uVar9 | (uint)local_310);
    local_340._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_360);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    local_340._4_4_ = local_340._4_4_ + uVar9;
    if (local_340._4_4_ < uVar9) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar9 = local_340._4_4_ + uVar12;
    if (uVar9 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_340 = CONCAT44(uVar9,uVar12);
    uVar16 = uVar6 + uVar16;
    if (uVar16 < uVar6) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    local_330._0_4_ = (uint)local_330 + (uint)local_338;
    local_310 = CONCAT44(local_310._4_4_,(uint)local_330);
    local_378 = CONCAT44(local_358._4_4_ ^ (uint)local_2d0,(uint)local_350 ^ (uint)local_328);
    local_338._0_4_ = (uint)local_330 & ((uint)local_350 ^ (uint)local_328);
    local_300 = (ulonglong)uVar16;
    local_338._4_4_ = (local_358._4_4_ ^ (uint)local_2d0) & uVar16;
    uVar10 = (uint)local_338 ^ (uint)local_328;
    uVar23 = local_338._4_4_ ^ local_358._4_4_;
    local_308 = uVar12;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_330._4_4_ = uVar16;
    uVar13 = FUN_1400f59c0(&local_330);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2e0 + uVar16;
    if (uVar6 < uVar16) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x654be30;
    if (uVar6 < 0x654be30) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x3893ae5d;
    uVar6 = uVar6 + local_15c;
    if (uVar6 < local_15c) {
      iVar7 = iVar22 + -0x3893ae5c;
    }
    local_370._0_4_ = iVar7 + local_160;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_370);
    local_328._0_4_ = uVar12 & local_2f8;
    local_328._4_4_ = uVar21 & uVar9;
    uVar23 = (uVar21 | uVar9) & uVar8;
    uVar16 = (uVar12 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar23,uVar16);
    local_320 = local_378;
    uVar12 = uVar23 | local_328._4_4_;
    local_378 = CONCAT44(uVar23,uVar16 | (uint)local_328);
    local_370._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_340);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    local_370._4_4_ = local_370._4_4_ + uVar16;
    if (local_370._4_4_ < uVar16) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar16 = local_370._4_4_ + uVar12;
    if (uVar16 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_370 = CONCAT44(uVar16,uVar12);
    uVar17 = uVar6 + uVar17;
    if (uVar17 < uVar6) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    local_368._0_4_ = (uint)local_368 + (uint)local_338;
    local_328 = CONCAT44(local_328._4_4_,(uint)local_368);
    local_378 = CONCAT44(local_350._4_4_ ^ (uint)local_300,(uint)local_330 ^ (uint)local_318);
    local_338._0_4_ = (uint)local_368 & ((uint)local_330 ^ (uint)local_318);
    local_2e0 = (ulonglong)uVar17;
    local_338._4_4_ = (local_350._4_4_ ^ (uint)local_300) & uVar17;
    uVar23 = (uint)local_338 ^ (uint)local_318;
    uVar10 = local_338._4_4_ ^ local_350._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_368._4_4_ = uVar17;
    local_2e8._0_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_368);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d8 + uVar17;
    if (uVar6 < uVar17) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar6 = uVar6 + uVar10;
    if (uVar6 < uVar10) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar23;
    uVar6 = uVar6 + 0xd6ef5218;
    if (uVar6 < 0xd6ef5218) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x2e6d17e7;
    uVar6 = uVar6 + local_154;
    if (uVar6 < local_154) {
      iVar7 = iVar22 + -0x2e6d17e6;
    }
    local_358._0_4_ = iVar7 + local_158;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_358);
    local_318._0_4_ = uVar12 & local_308;
    local_318._4_4_ = uVar9 & uVar16;
    uVar23 = (uVar9 | uVar16) & uVar21;
    uVar17 = (uVar12 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar23,uVar17);
    local_320 = local_378;
    uVar12 = uVar23 | local_318._4_4_;
    local_378 = CONCAT44(uVar23,uVar17 | (uint)local_318);
    local_358._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_370);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    local_358._4_4_ = local_358._4_4_ + uVar17;
    if (local_358._4_4_ < uVar17) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar17 = local_358._4_4_ + uVar12;
    local_2c8 = (ulonglong)uVar17;
    if (uVar17 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_358 = CONCAT44(uVar17,uVar12);
    uVar8 = uVar6 + uVar8;
    if (uVar8 < uVar6) {
      local_348 = local_348 + 1;
    }
    local_348 = local_348 + (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,local_348);
    local_378 = CONCAT44(local_330._4_4_ ^ (uint)local_2e0,(uint)local_368 ^ (uint)local_310);
    local_338._0_4_ = local_348 & ((uint)local_368 ^ (uint)local_310);
    local_2d8 = (ulonglong)uVar8;
    local_338._4_4_ = (local_330._4_4_ ^ (uint)local_2e0) & uVar8;
    uVar10 = (uint)local_338 ^ (uint)local_310;
    uVar23 = local_338._4_4_ ^ local_330._4_4_;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    uStack_344 = uVar8;
    local_2f8 = uVar12;
    uVar13 = FUN_1400f59c0(&local_348);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d0 + uVar8;
    if (uVar6 < uVar8) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x5565a910;
    if (uVar6 < 0x5565a910) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x2966f9dc;
    uVar6 = uVar6 + local_14c;
    if (uVar6 < local_14c) {
      iVar7 = iVar22 + -0x2966f9db;
    }
    local_350._0_4_ = iVar7 + local_150;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_350);
    local_310._0_4_ = uVar12 & (uint)local_2e8;
    local_310._4_4_ = uVar16 & uVar17;
    uVar23 = (uVar16 | uVar17) & uVar9;
    uVar8 = (uVar12 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar23,uVar8);
    local_320 = local_378;
    uVar12 = uVar23 | local_310._4_4_;
    local_378 = CONCAT44(uVar23,uVar8 | (uint)local_310);
    local_350._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_358);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    local_350._4_4_ = local_350._4_4_ + uVar8;
    if (local_350._4_4_ < uVar8) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar8 = local_350._4_4_ + uVar12;
    local_2f0 = (ulonglong)uVar8;
    if (uVar8 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_350 = CONCAT44(uVar8,uVar12);
    uVar21 = uVar6 + uVar21;
    if (uVar21 < uVar6) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    local_360._0_4_ = (uint)local_360 + (uint)local_338;
    local_310 = CONCAT44(local_310._4_4_,(uint)local_360);
    local_378 = CONCAT44(local_368._4_4_ ^ (uint)local_2d8,local_348 ^ (uint)local_328);
    local_338._0_4_ = (uint)local_360 & (local_348 ^ (uint)local_328);
    local_2d0 = (ulonglong)uVar21;
    local_338._4_4_ = (local_368._4_4_ ^ (uint)local_2d8) & uVar21;
    uVar10 = (uint)local_338 ^ (uint)local_328;
    uVar23 = local_338._4_4_ ^ local_368._4_4_;
    local_308 = uVar12;
    local_320._0_4_ = (uint)local_338;
    local_320._4_4_ = local_338._4_4_;
    local_360._4_4_ = uVar21;
    uVar13 = FUN_1400f59c0(&local_360);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_300 + uVar21;
    if (uVar6 < uVar21) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x5771202a;
    if (uVar6 < 0x5771202a) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0xbf1ca7b;
    uVar6 = uVar6 + local_144;
    if (uVar6 < local_144) {
      iVar7 = iVar22 + -0xbf1ca7a;
    }
    local_330._0_4_ = iVar7 + local_148;
    local_328 = CONCAT44(uVar8 & uVar17,uVar12 & local_2f8);
    uVar23 = (uVar8 | uVar17) & uVar16;
    uVar21 = (uVar12 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar23,uVar21);
    local_320 = local_378;
    uVar10 = uVar23 | uVar8 & uVar17;
    local_378 = CONCAT44(uVar23,uVar21 | uVar12 & local_2f8);
    local_338._0_4_ = (uint)local_330;
    local_330._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_350);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    local_330._4_4_ = local_330._4_4_ + uVar21;
    if (local_330._4_4_ < uVar21) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar21 = local_330._4_4_ + uVar10;
    if (uVar21 < uVar10) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_330 = CONCAT44(uVar21,uVar12);
    uVar9 = uVar6 + uVar9;
    if (uVar9 < uVar6) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    local_340._0_4_ = (uint)local_340 + (uint)local_338;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_340);
    local_378._4_4_ = (uint)local_2d0 ^ uStack_344;
    local_378._0_4_ = (uint)local_360 ^ (uint)local_318;
    local_300 = (ulonglong)uVar9;
    local_328 = CONCAT44(local_378._4_4_ & uVar9,(uint)local_340 & (uint)local_378);
    local_320 = local_328;
    uVar10 = (uint)local_340 & (uint)local_378 ^ (uint)local_318;
    uVar23 = local_378._4_4_ & uVar9 ^ uStack_344;
    local_340._4_4_ = uVar9;
    local_2e8._0_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_340);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2e0 + uVar9;
    if (uVar6 < uVar9) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x32bbd1b8;
    if (uVar6 < 0x32bbd1b8) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x106aa070;
    uVar6 = uVar6 + local_13c;
    if (uVar6 < local_13c) {
      iVar7 = iVar22 + 0x106aa071;
    }
    local_368._0_4_ = iVar7 + local_140;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_368);
    local_318 = CONCAT44(uVar8 & uVar21,uVar12 & local_308);
    local_328._4_4_ = (uVar8 | uVar21) & uVar17;
    local_328._0_4_ = (uVar12 | local_308) & local_2f8;
    uVar9 = (uint)local_328 | uVar12 & local_308;
    uVar12 = local_328._4_4_ | uVar8 & uVar21;
    local_368._4_4_ = uVar6;
    local_320._0_4_ = (uint)local_328;
    local_320._4_4_ = local_328._4_4_;
    uVar13 = FUN_1400f5870(&local_330);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    local_368._4_4_ = local_368._4_4_ + uVar17;
    if (local_368._4_4_ < uVar17) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar17 = local_368._4_4_ + uVar12;
    if (uVar17 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar9 = iVar22 + uVar9;
    local_368 = CONCAT44(uVar17,uVar9);
    uVar16 = uVar6 + uVar16;
    if (uVar16 < uVar6) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    uVar6 = (uint)local_370 + (uint)local_378;
    local_328 = CONCAT44(local_328._4_4_,uVar6);
    local_378._4_4_ = local_360._4_4_ ^ (uint)local_300;
    local_378._0_4_ = (uint)local_340 ^ (uint)local_310;
    local_2e0 = (ulonglong)uVar16;
    local_318 = CONCAT44(local_378._4_4_ & uVar16,uVar6 & (uint)local_378);
    local_320 = local_318;
    uVar10 = uVar6 & (uint)local_378 ^ (uint)local_310;
    uVar23 = local_378._4_4_ & uVar16 ^ local_360._4_4_;
    local_370._0_4_ = uVar6;
    local_370._4_4_ = uVar16;
    local_2f8 = uVar9;
    uVar13 = FUN_1400f59c0(&local_370);
    uVar12 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar16 = (int)local_2d8 + uVar12;
    if (uVar16 < uVar12) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar16 = uVar16 + uVar23;
    if (uVar16 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar16 = uVar16 + 0xb8d2d0c8;
    if (uVar16 < 0xb8d2d0c8) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x19a4c116;
    uVar16 = uVar16 + local_134;
    if (uVar16 < local_134) {
      iVar7 = iVar22 + 0x19a4c117;
    }
    local_348 = iVar7 + local_138;
    local_378 = CONCAT44(local_378._4_4_,local_348);
    local_310 = CONCAT44(uVar21 & uVar17,uVar9 & (uint)local_2e8);
    local_318._4_4_ = (uVar21 | uVar17) & uVar8;
    local_318._0_4_ = (uVar9 | (uint)local_2e8) & local_308;
    uVar9 = (uint)local_318 | uVar9 & (uint)local_2e8;
    uVar12 = local_318._4_4_ | uVar21 & uVar17;
    uStack_344 = uVar16;
    local_320._0_4_ = (uint)local_318;
    local_320._4_4_ = local_318._4_4_;
    uVar13 = FUN_1400f5870(&local_368);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uStack_344 = uStack_344 + uVar8;
    if (uStack_344 < uVar8) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar8 = uStack_344 + uVar12;
    if (uVar8 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar9 = iVar22 + uVar9;
    _local_348 = CONCAT44(uVar8,uVar9);
    uVar12 = (int)local_2c8 + uVar16;
    if (uVar12 < uVar16) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    local_358._0_4_ = (uint)local_358 + (uint)local_378;
    uVar16 = (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,(uint)local_358);
    local_378._4_4_ = local_340._4_4_ ^ (uint)local_2e0;
    local_378._0_4_ = uVar6 ^ (uint)local_338;
    uVar6 = (uint)local_358 & (uint)local_378;
    local_2d8 = (ulonglong)uVar12;
    local_338 = CONCAT44(local_378._4_4_ & uVar12,uVar6);
    local_320 = local_338;
    uVar10 = local_378._4_4_ & uVar12 ^ local_340._4_4_;
    local_308 = uVar9;
    local_358._4_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_358);
    uVar23 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar12 = (int)local_2d0 + uVar23;
    if (uVar12 < uVar23) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar12 = uVar12 + uVar10;
    if (uVar12 < uVar10) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + (uVar6 ^ uVar16);
    uVar12 = uVar12 + 0x5141ab53;
    if (uVar12 < 0x5141ab53) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x1e376c08;
    uVar12 = uVar12 + local_12c;
    if (uVar12 < local_12c) {
      iVar7 = iVar22 + 0x1e376c09;
    }
    local_360._0_4_ = iVar7 + local_130;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_360);
    local_310._0_4_ = uVar9 & local_2f8;
    local_310._4_4_ = uVar17 & uVar8;
    uVar16 = (uVar17 | uVar8) & uVar21;
    uVar6 = (uVar9 | local_2f8) & (uint)local_2e8;
    local_338 = CONCAT44(uVar16,uVar6);
    local_320 = local_338;
    uVar6 = uVar6 | (uint)local_310;
    uVar16 = uVar16 | local_310._4_4_;
    local_360._4_4_ = uVar12;
    uVar13 = FUN_1400f5870(&local_348);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    local_360._4_4_ = local_360._4_4_ + uVar9;
    if (local_360._4_4_ < uVar9) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar9 = local_360._4_4_ + uVar16;
    if (uVar9 < uVar16) {
      iVar22 = iVar22 + 1;
    }
    uVar6 = iVar22 + uVar6;
    local_360 = CONCAT44(uVar9,uVar6);
    uVar16 = (int)local_2f0 + uVar12;
    if (uVar16 < uVar12) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    local_350._0_4_ = (uint)local_350 + (uint)local_378;
    local_310 = CONCAT44(local_310._4_4_,(uint)local_350);
    local_378 = CONCAT44(local_370._4_4_ ^ (uint)local_2d8,(uint)local_358 ^ (uint)local_328);
    local_338._0_4_ = (uint)local_350 & ((uint)local_358 ^ (uint)local_328);
    local_2d0 = (ulonglong)uVar16;
    local_338._4_4_ = (local_370._4_4_ ^ (uint)local_2d8) & uVar16;
    uVar10 = (uint)local_338 ^ (uint)local_328;
    uVar23 = local_338._4_4_ ^ local_370._4_4_;
    local_2f0._0_4_ = (uint)local_338;
    local_2f0._4_4_ = local_338._4_4_;
    local_350._4_4_ = uVar16;
    local_2e8._0_4_ = uVar6;
    uVar13 = FUN_1400f59c0(&local_350);
    uVar12 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar16 = (int)local_300 + uVar12;
    if (uVar16 < uVar12) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar16 = uVar16 + uVar23;
    if (uVar16 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar16 = uVar16 + 0xdf8eeb99;
    if (uVar16 < 0xdf8eeb99) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x2748774c;
    uVar16 = uVar16 + local_124;
    if (uVar16 < local_124) {
      iVar7 = iVar22 + 0x2748774d;
    }
    local_340._0_4_ = iVar7 + local_128;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_340);
    local_328._0_4_ = uVar6 & local_308;
    local_328._4_4_ = uVar8 & uVar9;
    uVar12 = (uVar8 | uVar9) & uVar17;
    uVar6 = (uVar6 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar12,uVar6);
    local_2f0 = local_378;
    uVar23 = uVar12 | local_328._4_4_;
    local_378 = CONCAT44(uVar12,uVar6 | (uint)local_328);
    local_340._4_4_ = uVar16;
    uVar13 = FUN_1400f5870(&local_360);
    uVar6 = (uint)((ulonglong)uVar13 >> 0x20);
    local_340._4_4_ = local_340._4_4_ + uVar6;
    if (local_340._4_4_ < uVar6) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar6 = local_340._4_4_ + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_340 = CONCAT44(uVar6,uVar12);
    uVar21 = uVar16 + uVar21;
    if (uVar21 < uVar16) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    local_330._0_4_ = (uint)local_330 + (uint)local_338;
    local_328 = CONCAT44(local_328._4_4_,(uint)local_330);
    local_378 = CONCAT44(local_358._4_4_ ^ (uint)local_2d0,(uint)local_350 ^ (uint)local_318);
    local_338._0_4_ = (uint)local_330 & ((uint)local_350 ^ (uint)local_318);
    local_300 = (ulonglong)uVar21;
    local_338._4_4_ = (local_358._4_4_ ^ (uint)local_2d0) & uVar21;
    uVar10 = (uint)local_338 ^ (uint)local_318;
    uVar23 = local_338._4_4_ ^ local_358._4_4_;
    local_2f0._0_4_ = (uint)local_338;
    local_2f0._4_4_ = local_338._4_4_;
    local_330._4_4_ = uVar21;
    local_2f8 = uVar12;
    uVar13 = FUN_1400f59c0(&local_330);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar16 = (int)local_2e0 + uVar21;
    if (uVar16 < uVar21) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar16 = uVar16 + uVar23;
    if (uVar16 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar16 = uVar16 + 0xe19b48a8;
    if (uVar16 < 0xe19b48a8) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x34b0bcb5;
    uVar16 = uVar16 + local_11c;
    if (uVar16 < local_11c) {
      iVar7 = iVar22 + 0x34b0bcb6;
    }
    local_370._0_4_ = iVar7 + local_120;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_370);
    local_318._0_4_ = uVar12 & (uint)local_2e8;
    local_318._4_4_ = uVar9 & uVar6;
    uVar23 = (uVar9 | uVar6) & uVar8;
    uVar21 = (uVar12 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar23,uVar21);
    local_2f0 = local_378;
    uVar12 = uVar23 | local_318._4_4_;
    local_378 = CONCAT44(uVar23,uVar21 | (uint)local_318);
    local_370._4_4_ = uVar16;
    uVar13 = FUN_1400f5870(&local_340);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    local_370._4_4_ = local_370._4_4_ + uVar21;
    if (local_370._4_4_ < uVar21) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar21 = local_370._4_4_ + uVar12;
    if (uVar21 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_370 = CONCAT44(uVar21,uVar12);
    uVar17 = uVar16 + uVar17;
    if (uVar17 < uVar16) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    local_368._0_4_ = (uint)local_368 + (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,(uint)local_368);
    local_378 = CONCAT44(local_350._4_4_ ^ (uint)local_300,(uint)local_330 ^ (uint)local_310);
    local_338._0_4_ = (uint)local_368 & ((uint)local_330 ^ (uint)local_310);
    local_2e0 = (ulonglong)uVar17;
    local_338._4_4_ = (local_350._4_4_ ^ (uint)local_300) & uVar17;
    uVar10 = (uint)local_338 ^ (uint)local_310;
    uVar23 = local_338._4_4_ ^ local_350._4_4_;
    local_308 = uVar12;
    local_2f0._0_4_ = (uint)local_338;
    local_2f0._4_4_ = local_338._4_4_;
    local_368._4_4_ = uVar17;
    uVar13 = FUN_1400f59c0(&local_368);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar17 = (int)local_2d8 + uVar16;
    if (uVar17 < uVar16) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar17 = uVar17 + uVar23;
    if (uVar17 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar17 = uVar17 + 0xc5c95a63;
    if (uVar17 < 0xc5c95a63) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x391c0cb3;
    uVar17 = uVar17 + local_114;
    if (uVar17 < local_114) {
      iVar7 = iVar22 + 0x391c0cb4;
    }
    local_358._0_4_ = iVar7 + local_118;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_358);
    local_310._0_4_ = uVar12 & local_2f8;
    local_310._4_4_ = uVar6 & uVar21;
    uVar23 = (uVar6 | uVar21) & uVar9;
    uVar16 = (uVar12 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar23,uVar16);
    local_2f0 = local_378;
    uVar12 = uVar23 | local_310._4_4_;
    local_378 = CONCAT44(uVar23,uVar16 | (uint)local_310);
    local_358._4_4_ = uVar17;
    uVar13 = FUN_1400f5870(&local_370);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    local_358._4_4_ = local_358._4_4_ + uVar16;
    if (local_358._4_4_ < uVar16) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar16 = local_358._4_4_ + uVar12;
    if (uVar16 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_358 = CONCAT44(uVar16,uVar12);
    uVar8 = uVar17 + uVar8;
    if (uVar8 < uVar17) {
      local_348 = local_348 + 1;
    }
    local_348 = local_348 + (uint)local_338;
    local_310 = CONCAT44(local_310._4_4_,local_348);
    local_378 = CONCAT44(local_330._4_4_ ^ (uint)local_2e0,(uint)local_368 ^ (uint)local_328);
    local_338._0_4_ = local_348 & ((uint)local_368 ^ (uint)local_328);
    local_2d8 = (ulonglong)uVar8;
    local_338._4_4_ = (local_330._4_4_ ^ (uint)local_2e0) & uVar8;
    uVar23 = (uint)local_338 ^ (uint)local_328;
    uVar10 = local_338._4_4_ ^ local_330._4_4_;
    local_2f0._0_4_ = (uint)local_338;
    local_2f0._4_4_ = local_338._4_4_;
    uStack_344 = uVar8;
    local_2e8._0_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_348);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar17 = (int)local_2d0 + uVar8;
    if (uVar17 < uVar8) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar17 = uVar17 + uVar10;
    if (uVar17 < uVar10) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar23;
    uVar17 = uVar17 + 0xe3418acb;
    if (uVar17 < 0xe3418acb) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x4ed8aa4a;
    uVar17 = uVar17 + local_10c;
    if (uVar17 < local_10c) {
      iVar7 = iVar22 + 0x4ed8aa4b;
    }
    local_350._0_4_ = iVar7 + local_110;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_350);
    local_328._0_4_ = uVar12 & local_308;
    local_328._4_4_ = uVar21 & uVar16;
    uVar23 = (uVar21 | uVar16) & uVar6;
    uVar8 = (uVar12 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar23,uVar8);
    local_2f0 = local_378;
    uVar12 = uVar23 | local_328._4_4_;
    local_378 = CONCAT44(uVar23,uVar8 | (uint)local_328);
    local_350._4_4_ = uVar17;
    uVar13 = FUN_1400f5870(&local_358);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    local_350._4_4_ = local_350._4_4_ + uVar8;
    if (local_350._4_4_ < uVar8) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar8 = local_350._4_4_ + uVar12;
    if (uVar8 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_350 = CONCAT44(uVar8,uVar12);
    uVar9 = uVar17 + uVar9;
    if (uVar9 < uVar17) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    local_360._0_4_ = (uint)local_360 + (uint)local_338;
    local_328 = CONCAT44(local_328._4_4_,(uint)local_360);
    local_378 = CONCAT44(local_368._4_4_ ^ (uint)local_2d8,local_348 ^ (uint)local_318);
    local_338._0_4_ = (uint)local_360 & (local_348 ^ (uint)local_318);
    local_2d0 = (ulonglong)uVar9;
    local_338._4_4_ = (local_368._4_4_ ^ (uint)local_2d8) & uVar9;
    uVar10 = (uint)local_338 ^ (uint)local_318;
    uVar23 = local_338._4_4_ ^ local_368._4_4_;
    local_2f0._0_4_ = (uint)local_338;
    local_2f0._4_4_ = local_338._4_4_;
    local_360._4_4_ = uVar9;
    local_2f8 = uVar12;
    uVar13 = FUN_1400f59c0(&local_360);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar9 = (int)local_300 + uVar17;
    if (uVar9 < uVar17) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar9 = uVar9 + uVar23;
    if (uVar9 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar9 = uVar9 + 0x7763e373;
    if (uVar9 < 0x7763e373) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x5b9cca4f;
    uVar9 = uVar9 + local_104;
    if (uVar9 < local_104) {
      iVar7 = iVar22 + 0x5b9cca50;
    }
    local_330._0_4_ = iVar7 + local_108;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_330);
    local_318._0_4_ = uVar12 & (uint)local_2e8;
    local_318._4_4_ = uVar16 & uVar8;
    uVar23 = (uVar16 | uVar8) & uVar21;
    uVar17 = (uVar12 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar23,uVar17);
    local_2f0 = local_378;
    uVar12 = uVar23 | local_318._4_4_;
    local_378 = CONCAT44(uVar23,uVar17 | (uint)local_318);
    local_330._4_4_ = uVar9;
    uVar13 = FUN_1400f5870(&local_350);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    local_330._4_4_ = local_330._4_4_ + uVar17;
    if (local_330._4_4_ < uVar17) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar17 = local_330._4_4_ + uVar12;
    if (uVar17 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_330 = CONCAT44(uVar17,uVar12);
    uVar6 = uVar9 + uVar6;
    if (uVar6 < uVar9) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    local_340._0_4_ = (uint)local_340 + (uint)local_338;
    local_318 = CONCAT44(local_318._4_4_,(uint)local_340);
    local_378 = CONCAT44((uint)local_2d0 ^ uStack_344,(uint)local_360 ^ (uint)local_310);
    local_338._0_4_ = (uint)local_340 & ((uint)local_360 ^ (uint)local_310);
    local_300 = (ulonglong)uVar6;
    local_338._4_4_ = ((uint)local_2d0 ^ uStack_344) & uVar6;
    uVar10 = (uint)local_338 ^ (uint)local_310;
    uVar23 = local_338._4_4_ ^ uStack_344;
    local_308 = uVar12;
    local_2f0._0_4_ = (uint)local_338;
    local_2f0._4_4_ = local_338._4_4_;
    local_340._4_4_ = uVar6;
    uVar13 = FUN_1400f59c0(&local_340);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2e0 + uVar9;
    if (uVar6 < uVar9) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xd6b2b8a3;
    if (uVar6 < 0xd6b2b8a3) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x682e6ff3;
    uVar6 = uVar6 + local_fc;
    if (uVar6 < local_fc) {
      iVar7 = iVar22 + 0x682e6ff4;
    }
    local_368._0_4_ = iVar7 + local_100;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_368);
    local_310._0_4_ = uVar12 & local_2f8;
    local_310._4_4_ = uVar8 & uVar17;
    uVar23 = (uVar8 | uVar17) & uVar16;
    uVar9 = (uVar12 | local_2f8) & (uint)local_2e8;
    local_378 = CONCAT44(uVar23,uVar9);
    local_2f0 = local_378;
    uVar12 = uVar23 | local_310._4_4_;
    local_378 = CONCAT44(uVar23,uVar9 | (uint)local_310);
    local_368._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_330);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    local_368._4_4_ = local_368._4_4_ + uVar9;
    if (local_368._4_4_ < uVar9) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar9 = local_368._4_4_ + uVar12;
    if (uVar9 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_368 = CONCAT44(uVar9,uVar12);
    local_2e8 = CONCAT44(local_2e8._4_4_,uVar12);
    uVar21 = uVar6 + uVar21;
    if (uVar21 < uVar6) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    local_370._0_4_ = (uint)local_370 + (uint)local_338;
    local_310 = CONCAT44(local_310._4_4_,(uint)local_370);
    local_378 = CONCAT44(local_360._4_4_ ^ (uint)local_300,(uint)local_340 ^ (uint)local_328);
    local_338._0_4_ = (uint)local_370 & ((uint)local_340 ^ (uint)local_328);
    local_2e0 = (ulonglong)uVar21;
    local_338._4_4_ = (local_360._4_4_ ^ (uint)local_300) & uVar21;
    uVar10 = (uint)local_338 ^ (uint)local_328;
    uVar23 = local_338._4_4_ ^ local_360._4_4_;
    local_2f0._0_4_ = (uint)local_338;
    local_2f0._4_4_ = local_338._4_4_;
    local_370._4_4_ = uVar21;
    uVar13 = FUN_1400f59c0(&local_370);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d8 + uVar21;
    if (uVar6 < uVar21) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x5defb2fc;
    if (uVar6 < 0x5defb2fc) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x748f82ee;
    uVar6 = uVar6 + local_f4;
    if (uVar6 < local_f4) {
      iVar7 = iVar22 + 0x748f82ef;
    }
    local_348 = iVar7 + local_f8;
    local_338 = CONCAT44(local_338._4_4_,local_348);
    local_328._0_4_ = uVar12 & local_308;
    local_328._4_4_ = uVar17 & uVar9;
    uVar23 = (uVar17 | uVar9) & uVar8;
    uVar21 = (uVar12 | local_308) & local_2f8;
    local_378 = CONCAT44(uVar23,uVar21);
    local_2f0 = local_378;
    uVar12 = uVar23 | local_328._4_4_;
    local_378 = CONCAT44(uVar23,uVar21 | (uint)local_328);
    uStack_344 = uVar6;
    uVar13 = FUN_1400f5870(&local_368);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uStack_344 = uStack_344 + uVar21;
    if (uStack_344 < uVar21) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar21 = uStack_344 + uVar12;
    if (uVar21 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    _local_348 = CONCAT44(uVar21,uVar12);
    local_328 = CONCAT44(local_328._4_4_,uVar12);
    uVar16 = uVar6 + uVar16;
    if (uVar16 < uVar6) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    local_358._0_4_ = (uint)local_358 + (uint)local_338;
    _local_2f8 = CONCAT44(uStack_2f4,(uint)local_358);
    local_378 = CONCAT44(local_340._4_4_ ^ (uint)local_2e0,(uint)local_370 ^ (uint)local_318);
    local_338._0_4_ = (uint)local_358 & ((uint)local_370 ^ (uint)local_318);
    local_2d8 = (ulonglong)uVar16;
    local_338._4_4_ = (local_340._4_4_ ^ (uint)local_2e0) & uVar16;
    uVar10 = (uint)local_338 ^ (uint)local_318;
    uVar23 = local_338._4_4_ ^ local_340._4_4_;
    local_2f0._0_4_ = (uint)local_338;
    local_2f0._4_4_ = local_338._4_4_;
    local_358._4_4_ = uVar16;
    uVar13 = FUN_1400f59c0(&local_358);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d0 + uVar16;
    if (uVar6 < uVar16) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x43172f60;
    if (uVar6 < 0x43172f60) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x78a5636f;
    uVar6 = uVar6 + local_ec;
    if (uVar6 < local_ec) {
      iVar7 = iVar22 + 0x78a56370;
    }
    local_360._0_4_ = iVar7 + local_f0;
    local_338 = CONCAT44(local_338._4_4_,(uint)local_360);
    local_318 = CONCAT44(uVar9 & uVar21,uVar12 & (uint)local_2e8);
    uVar23 = (uVar9 | uVar21) & uVar17;
    uVar16 = (uVar12 | (uint)local_2e8) & local_308;
    local_378 = CONCAT44(uVar23,uVar16);
    local_2f0 = local_378;
    uVar10 = uVar23 | uVar9 & uVar21;
    local_378 = CONCAT44(uVar23,uVar16 | uVar12 & (uint)local_2e8);
    local_360._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_348);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    local_360._4_4_ = local_360._4_4_ + uVar16;
    if (local_360._4_4_ < uVar16) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar16 = local_360._4_4_ + uVar10;
    if (uVar16 < uVar10) {
      iVar22 = iVar22 + 1;
    }
    uVar12 = iVar22 + (uint)local_378;
    local_360 = CONCAT44(uVar16,uVar12);
    uVar8 = uVar6 + uVar8;
    if (uVar8 < uVar6) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    local_308 = (uint)local_350 + (uint)local_338;
    local_378 = CONCAT44(local_370._4_4_ ^ (uint)local_2d8,(uint)local_358 ^ (uint)local_310);
    local_338._0_4_ = local_308 & ((uint)local_358 ^ (uint)local_310);
    local_2d0 = (ulonglong)uVar8;
    local_338._4_4_ = (local_370._4_4_ ^ (uint)local_2d8) & uVar8;
    uVar10 = (uint)local_338 ^ (uint)local_310;
    uVar23 = local_338._4_4_ ^ local_370._4_4_;
    local_2f0._0_4_ = (uint)local_338;
    local_2f0._4_4_ = local_338._4_4_;
    local_350._0_4_ = local_308;
    local_350._4_4_ = uVar8;
    uVar13 = FUN_1400f59c0(&local_350);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_300 + uVar8;
    if (uVar6 < uVar8) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xa1f0ab72;
    if (uVar6 < 0xa1f0ab72) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x7b3787ec;
    uVar6 = uVar6 + local_e4;
    if (uVar6 < local_e4) {
      iVar7 = iVar22 + -0x7b3787eb;
    }
    local_340._0_4_ = iVar7 + local_e8;
    local_318._0_4_ = uVar12 & (uint)local_328;
    local_318._4_4_ = uVar21 & uVar16;
    uVar23 = (uVar21 | uVar16) & uVar9;
    uVar8 = (uVar12 | (uint)local_328) & (uint)local_2e8;
    local_378 = CONCAT44(uVar23,uVar8);
    local_2f0 = local_378;
    uVar12 = uVar23 | local_318._4_4_;
    local_378 = CONCAT44(uVar23,uVar8 | (uint)local_318);
    local_338._0_4_ = (uint)local_340;
    local_340._4_4_ = uVar6;
    uVar13 = FUN_1400f5870(&local_360);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    local_340._4_4_ = local_340._4_4_ + uVar8;
    if (local_340._4_4_ < uVar8) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar8 = local_340._4_4_ + uVar12;
    if (uVar8 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    local_340 = CONCAT44(uVar8,iVar22 + (uint)local_378);
    uVar17 = uVar6 + uVar17;
    if (uVar17 < uVar6) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    uVar6 = (uint)local_330 + (uint)local_338;
    local_338 = CONCAT44(local_338._4_4_,uVar6);
    local_378._4_4_ = local_358._4_4_ ^ (uint)local_2d0;
    local_378._0_4_ = (uint)local_350 ^ local_2f8;
    local_2e8 = (ulonglong)uVar17;
    local_328._0_4_ = uVar6 & (uint)local_378;
    local_328._4_4_ = local_378._4_4_ & uVar17;
    uVar23 = (uint)local_328 ^ local_2f8;
    uVar10 = local_328._4_4_ ^ local_358._4_4_;
    local_2f0._0_4_ = (uint)local_328;
    local_2f0._4_4_ = local_328._4_4_;
    local_330._0_4_ = uVar6;
    local_330._4_4_ = uVar17;
    uVar13 = FUN_1400f59c0(&local_330);
    uVar12 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar17 = (int)local_2e0 + uVar12;
    if (uVar17 < uVar12) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar17 = uVar17 + uVar10;
    if (uVar17 < uVar10) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar23;
    uVar17 = uVar17 + 0x1a6439ec;
    if (uVar17 < 0x1a6439ec) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x7338fdf8;
    uVar17 = uVar17 + local_dc;
    if (uVar17 < local_dc) {
      iVar7 = iVar22 + -0x7338fdf7;
    }
    local_370._0_4_ = iVar7 + local_e0;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_370);
    local_370._4_4_ = uVar17;
    local_300 = FUN_1400f57f0(&local_340,&local_360,&local_348);
    uVar13 = FUN_1400f5870(&local_340);
    uVar12 = (uint)((ulonglong)uVar13 >> 0x20);
    local_370._4_4_ = local_370._4_4_ + uVar12;
    if (local_370._4_4_ < uVar12) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar12 = local_370._4_4_ + local_300._4_4_;
    if (uVar12 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_370 = CONCAT44(uVar12,iVar22 + (uint)local_300);
    uVar9 = uVar17 + uVar9;
    if (uVar9 < uVar17) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    uVar17 = (uint)local_368 + (uint)local_378;
    local_328 = CONCAT44(local_328._4_4_,uVar17);
    local_378._4_4_ = local_350._4_4_ ^ (uint)local_2e8;
    local_378._0_4_ = uVar6 ^ local_308;
    local_2f8 = uVar17 & (uint)local_378;
    local_2e0 = (ulonglong)uVar9;
    uStack_2f4 = local_378._4_4_ & uVar9;
    uVar10 = local_2f8 ^ local_308;
    uVar23 = uStack_2f4 ^ local_350._4_4_;
    local_2f0._0_4_ = local_2f8;
    local_2f0._4_4_ = uStack_2f4;
    local_368._0_4_ = uVar17;
    local_368._4_4_ = uVar9;
    uVar13 = FUN_1400f59c0(&local_368);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d8 + uVar9;
    if (uVar6 < uVar9) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x23631e28;
    if (uVar6 < 0x23631e28) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x6f410006;
    uVar6 = uVar6 + local_d4;
    if (uVar6 < local_d4) {
      iVar7 = iVar22 + -0x6f410005;
    }
    local_358._0_4_ = iVar7 + local_d8;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_358);
    local_358._4_4_ = uVar6;
    local_300 = FUN_1400f57f0(&local_370,&local_340,&local_360);
    uVar13 = FUN_1400f5870(&local_370);
    uVar9 = (uint)((ulonglong)uVar13 >> 0x20);
    local_358._4_4_ = local_358._4_4_ + uVar9;
    if (local_358._4_4_ < uVar9) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar9 = local_358._4_4_ + local_300._4_4_;
    if (uVar9 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_358 = CONCAT44(uVar9,iVar22 + (uint)local_300);
    uVar21 = uVar21 + uVar6;
    if (uVar21 < uVar6) {
      local_348 = local_348 + 1;
    }
    uVar6 = local_348 + (uint)local_378;
    _local_2f8 = CONCAT44(uStack_2f4,uVar6);
    local_378._4_4_ = local_330._4_4_ ^ (uint)local_2e0;
    local_378._0_4_ = uVar17 ^ (uint)local_338;
    local_2f0._0_4_ = uVar6 & (uint)local_378;
    local_2d8 = (ulonglong)uVar21;
    local_338._4_4_ = local_378._4_4_ & uVar21;
    uVar10 = (uint)local_2f0 ^ (uint)local_338;
    uVar23 = local_338._4_4_ ^ local_330._4_4_;
    local_338._0_4_ = (uint)local_2f0;
    local_2f0._4_4_ = local_338._4_4_;
    local_348 = uVar6;
    uStack_344 = uVar21;
    uVar13 = FUN_1400f59c0(&local_348);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar17 = (int)local_2d0 + uVar21;
    if (uVar17 < uVar21) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar17 = uVar17 + uVar23;
    if (uVar17 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar17 = uVar17 + 0xde82bde9;
    if (uVar17 < 0xde82bde9) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x5baf9315;
    uVar17 = uVar17 + local_cc;
    if (uVar17 < local_cc) {
      iVar7 = iVar22 + -0x5baf9314;
    }
    local_350._0_4_ = iVar7 + local_d0;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_350);
    local_350._4_4_ = uVar17;
    local_300 = FUN_1400f57f0(&local_358,&local_370,&local_340);
    uVar13 = FUN_1400f5870(&local_358);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    local_350._4_4_ = local_350._4_4_ + uVar21;
    if (local_350._4_4_ < uVar21) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar21 = local_350._4_4_ + local_300._4_4_;
    if (uVar21 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_350 = CONCAT44(uVar21,iVar22 + (uint)local_300);
    uVar16 = uVar16 + uVar17;
    if (uVar16 < uVar17) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    uVar17 = (uint)local_360 + (uint)local_378;
    local_338 = CONCAT44(local_338._4_4_,uVar17);
    local_378._4_4_ = local_368._4_4_ ^ (uint)local_2d8;
    local_378._0_4_ = uVar6 ^ (uint)local_328;
    local_2f0._0_4_ = uVar17 & (uint)local_378;
    local_2d0 = (ulonglong)uVar16;
    local_328._4_4_ = local_378._4_4_ & uVar16;
    uVar10 = (uint)local_2f0 ^ (uint)local_328;
    uVar23 = local_328._4_4_ ^ local_368._4_4_;
    local_328._0_4_ = (uint)local_2f0;
    local_2f0._4_4_ = local_328._4_4_;
    local_360._0_4_ = uVar17;
    local_360._4_4_ = uVar16;
    uVar13 = FUN_1400f59c0(&local_360);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2e8 + uVar16;
    if (uVar6 < uVar16) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xb2c67915;
    if (uVar6 < 0xb2c67915) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x41065c09;
    uVar6 = uVar6 + local_c4;
    if (uVar6 < local_c4) {
      iVar7 = iVar22 + -0x41065c08;
    }
    local_330._0_4_ = iVar7 + local_c8;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_330);
    local_330._4_4_ = uVar6;
    local_300 = FUN_1400f57f0(&local_350,&local_358,&local_370);
    uVar13 = FUN_1400f5870(&local_350);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    local_330._4_4_ = local_330._4_4_ + uVar16;
    if (local_330._4_4_ < uVar16) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar16 = local_330._4_4_ + local_300._4_4_;
    if (uVar16 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_330 = CONCAT44(uVar16,iVar22 + (uint)local_300);
    uVar8 = uVar8 + uVar6;
    if (uVar8 < uVar6) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    uVar6 = (uint)local_340 + (uint)local_378;
    local_328 = CONCAT44(local_328._4_4_,uVar6);
    local_378._4_4_ = (uint)local_2d0 ^ uStack_344;
    local_378._0_4_ = uVar17 ^ local_2f8;
    local_2f0._0_4_ = uVar6 & (uint)local_378;
    local_2e8 = (ulonglong)uVar8;
    uStack_2f4 = local_378._4_4_ & uVar8;
    uVar10 = (uint)local_2f0 ^ local_2f8;
    uVar23 = uStack_2f4 ^ uStack_344;
    local_2f8 = (uint)local_2f0;
    local_2f0._4_4_ = uStack_2f4;
    local_340._0_4_ = uVar6;
    local_340._4_4_ = uVar8;
    uVar13 = FUN_1400f59c0(&local_340);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar17 = (int)local_2e0 + uVar8;
    if (uVar17 < uVar8) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar17 = uVar17 + uVar23;
    if (uVar17 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar17 = uVar17 + 0xe372532b;
    if (uVar17 < 0xe372532b) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x398e870e;
    uVar17 = uVar17 + local_bc;
    if (uVar17 < local_bc) {
      iVar7 = iVar22 + -0x398e870d;
    }
    local_368._0_4_ = iVar7 + local_c0;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_368);
    local_368._4_4_ = uVar17;
    local_300 = FUN_1400f57f0(&local_330,&local_350,&local_358);
    uVar13 = FUN_1400f5870(&local_330);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    local_368._4_4_ = local_368._4_4_ + uVar8;
    if (local_368._4_4_ < uVar8) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar8 = local_368._4_4_ + local_300._4_4_;
    if (uVar8 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_368 = CONCAT44(uVar8,iVar22 + (uint)local_300);
    uVar12 = uVar17 + uVar12;
    if (uVar12 < uVar17) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    uVar17 = (uint)local_370 + (uint)local_378;
    _local_2f8 = CONCAT44(uStack_2f4,uVar17);
    local_378._4_4_ = local_360._4_4_ ^ (uint)local_2e8;
    local_378._0_4_ = uVar6 ^ (uint)local_338;
    local_2f0._0_4_ = uVar17 & (uint)local_378;
    local_2e0 = (ulonglong)uVar12;
    local_338._4_4_ = local_378._4_4_ & uVar12;
    uVar10 = (uint)local_2f0 ^ (uint)local_338;
    uVar23 = local_338._4_4_ ^ local_360._4_4_;
    local_338._0_4_ = (uint)local_2f0;
    local_2f0._4_4_ = local_338._4_4_;
    local_370._0_4_ = uVar17;
    local_370._4_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_370);
    uVar12 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d8 + uVar12;
    if (uVar6 < uVar12) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xea26619c;
    if (uVar6 < 0xea26619c) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x35d8c132;
    uVar6 = uVar6 + local_b4;
    if (uVar6 < local_b4) {
      iVar7 = iVar22 + -0x35d8c131;
    }
    local_348 = iVar7 + local_b8;
    local_378 = CONCAT44(local_378._4_4_,local_348);
    uStack_344 = uVar6;
    local_300 = FUN_1400f57f0(&local_368,&local_330,&local_350);
    uVar13 = FUN_1400f5870(&local_368);
    uVar12 = (uint)((ulonglong)uVar13 >> 0x20);
    uStack_344 = uStack_344 + uVar12;
    if (uStack_344 < uVar12) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar12 = uStack_344 + local_300._4_4_;
    if (uVar12 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    _local_348 = CONCAT44(uVar12,iVar22 + (uint)local_300);
    uVar9 = uVar6 + uVar9;
    if (uVar9 < uVar6) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    uVar6 = (uint)local_358 + (uint)local_378;
    local_338 = CONCAT44(local_338._4_4_,uVar6);
    local_378._4_4_ = local_340._4_4_ ^ (uint)local_2e0;
    local_378._0_4_ = uVar17 ^ (uint)local_328;
    local_2f0._0_4_ = uVar6 & (uint)local_378;
    local_2d8 = (ulonglong)uVar9;
    local_328._4_4_ = local_378._4_4_ & uVar9;
    uVar10 = (uint)local_2f0 ^ (uint)local_328;
    uVar23 = local_328._4_4_ ^ local_340._4_4_;
    local_328._0_4_ = (uint)local_2f0;
    local_2f0._4_4_ = local_328._4_4_;
    local_358._0_4_ = uVar6;
    local_358._4_4_ = uVar9;
    uVar13 = FUN_1400f59c0(&local_358);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar9 = (int)local_2d0 + uVar17;
    if (uVar9 < uVar17) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar9 = uVar9 + uVar23;
    if (uVar9 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar9 = uVar9 + 0x21c0c207;
    if (uVar9 < 0x21c0c207) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x2e794739;
    uVar9 = uVar9 + local_ac;
    if (uVar9 < local_ac) {
      iVar7 = iVar22 + -0x2e794738;
    }
    local_360._0_4_ = iVar7 + local_b0;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_360);
    local_360._4_4_ = uVar9;
    local_300 = FUN_1400f57f0(&local_348,&local_368,&local_330);
    uVar13 = FUN_1400f5870(&local_348);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    local_360._4_4_ = local_360._4_4_ + uVar17;
    if (local_360._4_4_ < uVar17) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar17 = local_360._4_4_ + local_300._4_4_;
    if (uVar17 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_360 = CONCAT44(uVar17,iVar22 + (uint)local_300);
    uVar21 = uVar9 + uVar21;
    if (uVar21 < uVar9) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    uVar9 = (uint)local_350 + (uint)local_378;
    local_328 = CONCAT44(local_328._4_4_,uVar9);
    local_378._4_4_ = local_370._4_4_ ^ (uint)local_2d8;
    local_378._0_4_ = uVar6 ^ local_2f8;
    local_2f0._0_4_ = uVar9 & (uint)local_378;
    local_2d0 = (ulonglong)uVar21;
    uStack_2f4 = local_378._4_4_ & uVar21;
    uVar10 = (uint)local_2f0 ^ local_2f8;
    uVar23 = uStack_2f4 ^ local_370._4_4_;
    local_2f8 = (uint)local_2f0;
    local_2f0._4_4_ = uStack_2f4;
    local_350._0_4_ = uVar9;
    local_350._4_4_ = uVar21;
    uVar13 = FUN_1400f59c0(&local_350);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2e8 + uVar21;
    if (uVar6 < uVar21) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xcde0eb1e;
    if (uVar6 < 0xcde0eb1e) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0x1525822a;
    uVar6 = uVar6 + local_a4;
    if (uVar6 < local_a4) {
      iVar7 = iVar22 + -0x15258229;
    }
    local_340._0_4_ = iVar7 + local_a8;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_340);
    local_340._4_4_ = uVar6;
    local_300 = FUN_1400f57f0(&local_360,&local_348,&local_368);
    uVar13 = FUN_1400f5870(&local_360);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    local_340._4_4_ = local_340._4_4_ + uVar21;
    if (local_340._4_4_ < uVar21) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar21 = local_340._4_4_ + local_300._4_4_;
    if (uVar21 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_340 = CONCAT44(uVar21,iVar22 + (uint)local_300);
    uVar16 = uVar6 + uVar16;
    if (uVar16 < uVar6) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    uVar6 = (uint)local_330 + (uint)local_378;
    _local_2f8 = CONCAT44(uStack_2f4,uVar6);
    local_378._4_4_ = local_358._4_4_ ^ (uint)local_2d0;
    local_378._0_4_ = uVar9 ^ (uint)local_338;
    local_2f0._0_4_ = uVar6 & (uint)local_378;
    local_2e8 = (ulonglong)uVar16;
    local_338._4_4_ = local_378._4_4_ & uVar16;
    uVar10 = (uint)local_2f0 ^ (uint)local_338;
    uVar23 = local_338._4_4_ ^ local_358._4_4_;
    local_338._0_4_ = (uint)local_2f0;
    local_2f0._4_4_ = local_338._4_4_;
    local_330._0_4_ = uVar6;
    local_330._4_4_ = uVar16;
    uVar13 = FUN_1400f59c0(&local_330);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar9 = (int)local_2e0 + uVar16;
    if (uVar9 < uVar16) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar9 = uVar9 + uVar23;
    if (uVar9 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar9 = uVar9 + 0xee6ed178;
    if (uVar9 < 0xee6ed178) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + -0xa82b081;
    uVar9 = uVar9 + local_9c;
    if (uVar9 < local_9c) {
      iVar7 = iVar22 + -0xa82b080;
    }
    local_370._0_4_ = iVar7 + local_a0;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_370);
    local_370._4_4_ = uVar9;
    local_300 = FUN_1400f57f0(&local_340,&local_360,&local_348);
    uVar13 = FUN_1400f5870(&local_340);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    local_370._4_4_ = local_370._4_4_ + uVar16;
    if (local_370._4_4_ < uVar16) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar16 = local_370._4_4_ + local_300._4_4_;
    if (uVar16 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_370 = CONCAT44(uVar16,iVar22 + (uint)local_300);
    uVar8 = uVar9 + uVar8;
    if (uVar8 < uVar9) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    uVar9 = (uint)local_368 + (uint)local_378;
    local_338 = CONCAT44(local_338._4_4_,uVar9);
    local_378._4_4_ = local_350._4_4_ ^ (uint)local_2e8;
    local_378._0_4_ = uVar6 ^ (uint)local_328;
    local_2f0._0_4_ = uVar9 & (uint)local_378;
    local_2e0 = (ulonglong)uVar8;
    local_328._4_4_ = local_378._4_4_ & uVar8;
    uVar10 = (uint)local_2f0 ^ (uint)local_328;
    uVar23 = local_328._4_4_ ^ local_350._4_4_;
    local_328._0_4_ = (uint)local_2f0;
    local_2f0._4_4_ = local_328._4_4_;
    local_368._0_4_ = uVar9;
    local_368._4_4_ = uVar8;
    uVar13 = FUN_1400f59c0(&local_368);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d8 + uVar8;
    if (uVar6 < uVar8) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x72176fba;
    if (uVar6 < 0x72176fba) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x6f067aa;
    uVar6 = uVar6 + local_94;
    if (uVar6 < local_94) {
      iVar7 = iVar22 + 0x6f067ab;
    }
    local_358._0_4_ = iVar7 + local_98;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_358);
    local_358._4_4_ = uVar6;
    local_300 = FUN_1400f57f0(&local_370,&local_340,&local_360);
    uVar13 = FUN_1400f5870(&local_370);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    local_358._4_4_ = local_358._4_4_ + uVar8;
    if (local_358._4_4_ < uVar8) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar13;
    uVar8 = local_358._4_4_ + local_300._4_4_;
    if (uVar8 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_358 = CONCAT44(uVar8,iVar22 + (uint)local_300);
    uVar12 = uVar6 + uVar12;
    if (uVar12 < uVar6) {
      local_348 = local_348 + 1;
    }
    uVar6 = local_348 + (uint)local_378;
    local_328 = CONCAT44(local_328._4_4_,uVar6);
    local_378._4_4_ = local_330._4_4_ ^ (uint)local_2e0;
    local_378._0_4_ = uVar9 ^ local_2f8;
    local_2f0._0_4_ = uVar6 & (uint)local_378;
    local_2d8 = (ulonglong)uVar12;
    uStack_2f4 = local_378._4_4_ & uVar12;
    uVar10 = (uint)local_2f0 ^ local_2f8;
    uVar23 = uStack_2f4 ^ local_330._4_4_;
    local_2f8 = (uint)local_2f0;
    local_2f0._4_4_ = uStack_2f4;
    local_348 = uVar6;
    uStack_344 = uVar12;
    uVar13 = FUN_1400f59c0(&local_348);
    uVar12 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar9 = (int)local_2d0 + uVar12;
    if (uVar9 < uVar12) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar9 = uVar9 + uVar23;
    if (uVar9 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar9 = uVar9 + 0xa2c898a6;
    if (uVar9 < 0xa2c898a6) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0xa637dc5;
    uVar9 = uVar9 + local_8c;
    if (uVar9 < local_8c) {
      iVar7 = iVar22 + 0xa637dc6;
    }
    local_350._0_4_ = iVar7 + local_90;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_350);
    local_350._4_4_ = uVar9;
    local_300 = FUN_1400f57f0(&local_358,&local_370,&local_340);
    uVar13 = FUN_1400f5870(&local_358);
    uVar12 = (uint)((ulonglong)uVar13 >> 0x20);
    local_350._4_4_ = local_350._4_4_ + uVar12;
    if (local_350._4_4_ < uVar12) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar12 = local_350._4_4_ + local_300._4_4_;
    if (uVar12 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_350 = CONCAT44(uVar12,iVar22 + (uint)local_300);
    uVar17 = uVar9 + uVar17;
    if (uVar17 < uVar9) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    uVar9 = (uint)local_360 + (uint)local_378;
    _local_2f8 = CONCAT44(uStack_2f4,uVar9);
    local_378._4_4_ = local_368._4_4_ ^ (uint)local_2d8;
    local_378._0_4_ = uVar6 ^ (uint)local_338;
    local_2f0._0_4_ = uVar9 & (uint)local_378;
    local_2d0 = (ulonglong)uVar17;
    local_338._4_4_ = local_378._4_4_ & uVar17;
    uVar10 = (uint)local_2f0 ^ (uint)local_338;
    uVar23 = local_338._4_4_ ^ local_368._4_4_;
    local_338._0_4_ = (uint)local_2f0;
    local_2f0._4_4_ = local_338._4_4_;
    local_360._0_4_ = uVar9;
    local_360._4_4_ = uVar17;
    uVar13 = FUN_1400f59c0(&local_360);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2e8 + uVar17;
    if (uVar6 < uVar17) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0xbef90dae;
    if (uVar6 < 0xbef90dae) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x113f9804;
    uVar6 = uVar6 + local_84;
    if (uVar6 < local_84) {
      iVar7 = iVar22 + 0x113f9805;
    }
    local_330._0_4_ = iVar7 + local_88;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_330);
    local_330._4_4_ = uVar6;
    local_300 = FUN_1400f57f0(&local_350,&local_358,&local_370);
    uVar13 = FUN_1400f5870(&local_350);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    local_330._4_4_ = local_330._4_4_ + uVar17;
    if (local_330._4_4_ < uVar17) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    iVar22 = (uint)local_330 + (int)uVar13;
    uVar17 = local_330._4_4_ + local_300._4_4_;
    if (uVar17 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_330 = CONCAT44(uVar17,iVar22 + (uint)local_300);
    uVar21 = uVar6 + uVar21;
    if (uVar21 < uVar6) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    uVar6 = (uint)local_340 + (uint)local_378;
    local_338 = CONCAT44(local_338._4_4_,uVar6);
    local_378._4_4_ = (uint)local_2d0 ^ uStack_344;
    local_378._0_4_ = uVar9 ^ (uint)local_328;
    local_2f0._0_4_ = uVar6 & (uint)local_378;
    local_2e8 = (ulonglong)uVar21;
    local_328._4_4_ = local_378._4_4_ & uVar21;
    uVar10 = (uint)local_2f0 ^ (uint)local_328;
    uVar23 = local_328._4_4_ ^ uStack_344;
    local_328._0_4_ = (uint)local_2f0;
    local_2f0._4_4_ = local_328._4_4_;
    local_340._0_4_ = uVar6;
    local_340._4_4_ = uVar21;
    uVar13 = FUN_1400f59c0(&local_340);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar9 = (int)local_2e0 + uVar21;
    if (uVar9 < uVar21) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar9 = uVar9 + uVar23;
    if (uVar9 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar9 = uVar9 + 0x131c471b;
    if (uVar9 < 0x131c471b) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x1b710b35;
    uVar9 = uVar9 + local_7c;
    if (uVar9 < local_7c) {
      iVar7 = iVar22 + 0x1b710b36;
    }
    local_368._0_4_ = iVar7 + local_80;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_368);
    local_368._4_4_ = uVar9;
    local_300 = FUN_1400f57f0(&local_330,&local_350,&local_358);
    uVar13 = FUN_1400f5870(&local_330);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    local_368._4_4_ = local_368._4_4_ + uVar21;
    if (local_368._4_4_ < uVar21) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar21 = local_368._4_4_ + local_300._4_4_;
    if (uVar21 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_368 = CONCAT44(uVar21,iVar22 + (uint)local_300);
    uVar16 = uVar9 + uVar16;
    if (uVar16 < uVar9) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    uVar9 = (uint)local_370 + (uint)local_378;
    local_328 = CONCAT44(local_328._4_4_,uVar9);
    local_378._4_4_ = local_360._4_4_ ^ (uint)local_2e8;
    local_378._0_4_ = uVar6 ^ local_2f8;
    local_2f0._0_4_ = uVar9 & (uint)local_378;
    local_2e0 = (ulonglong)uVar16;
    uStack_2f4 = local_378._4_4_ & uVar16;
    uVar10 = (uint)local_2f0 ^ local_2f8;
    uVar23 = uStack_2f4 ^ local_360._4_4_;
    local_2f8 = (uint)local_2f0;
    local_2f0._4_4_ = uStack_2f4;
    local_370._0_4_ = uVar9;
    local_370._4_4_ = uVar16;
    uVar13 = FUN_1400f59c0(&local_370);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar6 = (int)local_2d8 + uVar16;
    if (uVar6 < uVar16) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar6 = uVar6 + uVar23;
    if (uVar6 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar6 = uVar6 + 0x23047d84;
    if (uVar6 < 0x23047d84) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x28db77f5;
    uVar6 = uVar6 + local_74;
    if (uVar6 < local_74) {
      iVar7 = iVar22 + 0x28db77f6;
    }
    local_348 = iVar7 + local_78;
    local_378 = CONCAT44(local_378._4_4_,local_348);
    uStack_344 = uVar6;
    local_300 = FUN_1400f57f0(&local_368,&local_330,&local_350);
    uVar13 = FUN_1400f5870(&local_368);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    uStack_344 = uStack_344 + uVar16;
    if (uStack_344 < uVar16) {
      local_348 = local_348 + 1;
    }
    iVar22 = local_348 + (int)uVar13;
    uVar16 = uStack_344 + local_300._4_4_;
    if (uVar16 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    _local_348 = CONCAT44(uVar16,iVar22 + (uint)local_300);
    uVar8 = uVar6 + uVar8;
    if (uVar8 < uVar6) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    uVar6 = (uint)local_358 + (uint)local_378;
    local_378._4_4_ = local_340._4_4_ ^ (uint)local_2e0;
    local_378._0_4_ = uVar9 ^ (uint)local_338;
    local_2f0._0_4_ = uVar6 & (uint)local_378;
    local_2d8 = (ulonglong)uVar8;
    local_338._4_4_ = local_378._4_4_ & uVar8;
    uVar10 = (uint)local_2f0 ^ (uint)local_338;
    uVar23 = local_338._4_4_ ^ local_340._4_4_;
    local_338._0_4_ = (uint)local_2f0;
    local_2f0._4_4_ = local_338._4_4_;
    local_358._0_4_ = uVar6;
    local_358._4_4_ = uVar8;
    local_2f8 = uVar6;
    uVar13 = FUN_1400f59c0(&local_358);
    uVar8 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar9 = (int)local_2d0 + uVar8;
    if (uVar9 < uVar8) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar13;
    uVar9 = uVar9 + uVar23;
    if (uVar9 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar9 = uVar9 + 0x40c72493;
    if (uVar9 < 0x40c72493) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x32caab7b;
    uVar9 = uVar9 + local_6c;
    if (uVar9 < local_6c) {
      iVar7 = iVar22 + 0x32caab7c;
    }
    local_360._0_4_ = iVar7 + local_70;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_360);
    local_360._4_4_ = uVar9;
    uVar13 = FUN_1400f57f0(&local_348,&local_368,&local_330);
    local_2f0 = uVar13;
    uVar14 = FUN_1400f5870(&local_348);
    uVar8 = (uint)((ulonglong)uVar14 >> 0x20);
    local_360._4_4_ = local_360._4_4_ + uVar8;
    if (local_360._4_4_ < uVar8) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    iVar22 = (uint)local_360 + (int)uVar14;
    local_360._4_4_ = local_360._4_4_ + local_2f0._4_4_;
    local_320 = (ulonglong)local_360._4_4_;
    if (local_360._4_4_ < local_2f0._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_360 = CONCAT44(local_360._4_4_,iVar22 + (int)uVar13);
    uVar12 = uVar9 + uVar12;
    if (uVar12 < uVar9) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    uVar9 = (uint)local_350 + (uint)local_378;
    local_338 = CONCAT44(local_338._4_4_,uVar9);
    local_378._4_4_ = local_370._4_4_ ^ (uint)local_2d8;
    local_378._0_4_ = uVar6 ^ (uint)local_328;
    local_2f0._0_4_ = uVar9 & (uint)local_378;
    local_2d0 = (ulonglong)uVar12;
    local_328._4_4_ = local_378._4_4_ & uVar12;
    uVar10 = (uint)local_2f0 ^ (uint)local_328;
    uVar23 = local_328._4_4_ ^ local_370._4_4_;
    local_328._0_4_ = (uint)local_2f0;
    local_2f0._4_4_ = local_328._4_4_;
    local_350._0_4_ = uVar9;
    local_350._4_4_ = uVar12;
    uVar13 = FUN_1400f59c0(&local_350);
    uVar12 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar8 = (int)local_2e8 + uVar12;
    if (uVar8 < uVar12) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar8 = uVar8 + uVar23;
    if (uVar8 < uVar23) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar8 = uVar8 + 0x15c9bebc;
    if (uVar8 < 0x15c9bebc) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x3c9ebe0a;
    uVar8 = uVar8 + local_64;
    if (uVar8 < local_64) {
      iVar7 = iVar22 + 0x3c9ebe0b;
    }
    local_340._0_4_ = iVar7 + local_68;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_340);
    local_340._4_4_ = uVar8;
    local_300 = FUN_1400f57f0(&local_360,&local_348,&local_368);
    uVar13 = FUN_1400f5870(&local_360);
    uVar12 = local_358._4_4_;
    uVar23 = (uint)((ulonglong)uVar13 >> 0x20);
    local_340._4_4_ = local_340._4_4_ + uVar23;
    if (local_340._4_4_ < uVar23) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    iVar22 = (uint)local_340 + (int)uVar13;
    uVar23 = local_340._4_4_ + local_300._4_4_;
    if (uVar23 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_340 = CONCAT44(uVar23,iVar22 + (uint)local_300);
    uVar17 = uVar8 + uVar17;
    if (uVar17 < uVar8) {
      local_330._0_4_ = (uint)local_330 + 1;
    }
    uVar8 = (uint)local_330 + (uint)local_378;
    local_378._4_4_ = local_358._4_4_ ^ (uint)local_2d0;
    local_378._0_4_ = uVar9 ^ local_2f8;
    local_310 = (ulonglong)uVar17;
    local_358 = CONCAT44(local_378._4_4_ & uVar17,uVar8 & (uint)local_378);
    local_2f0 = local_358;
    uVar10 = uVar8 & (uint)local_378 ^ local_2f8;
    uVar12 = local_378._4_4_ & uVar17 ^ uVar12;
    local_330._0_4_ = uVar8;
    local_330._4_4_ = uVar17;
    local_328._0_4_ = uVar8;
    uVar13 = FUN_1400f59c0(&local_330);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar9 = (int)local_2e0 + uVar17;
    if (uVar9 < uVar17) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar9 = uVar9 + uVar12;
    if (uVar9 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar9 = uVar9 + 0x9c100d4c;
    if (uVar9 < 0x9c100d4c) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x431d67c4;
    uVar9 = uVar9 + local_5c;
    if (uVar9 < local_5c) {
      iVar7 = iVar22 + 0x431d67c5;
    }
    local_370._0_4_ = iVar7 + local_60;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_370);
    local_370._4_4_ = uVar9;
    local_300 = FUN_1400f57f0(&local_340,&local_360,&local_348);
    uVar13 = FUN_1400f5870(&local_340);
    uVar17 = (uint)((ulonglong)uVar13 >> 0x20);
    local_370._4_4_ = local_370._4_4_ + uVar17;
    if (local_370._4_4_ < uVar17) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    iVar22 = (uint)local_370 + (int)uVar13;
    uVar17 = local_370._4_4_ + local_300._4_4_;
    if (uVar17 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_370 = CONCAT44(uVar17,iVar22 + (uint)local_300);
    uVar21 = uVar9 + uVar21;
    if (uVar21 < uVar9) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    uVar9 = (uint)local_368 + (uint)local_378;
    local_2e8 = CONCAT44(local_2e8._4_4_,uVar9);
    local_378._0_4_ = uVar9 & (uVar8 ^ (uint)local_338);
    local_358 = CONCAT44(local_350._4_4_ ^ (uint)local_310,uVar8 ^ (uint)local_338);
    local_2e0 = (ulonglong)uVar21;
    local_378._4_4_ = (local_350._4_4_ ^ (uint)local_310) & uVar21;
    uVar10 = (uint)local_378 ^ (uint)local_338;
    uVar12 = local_378._4_4_ ^ local_350._4_4_;
    local_2f0._0_4_ = (uint)local_378;
    local_2f0._4_4_ = local_378._4_4_;
    local_368._0_4_ = uVar9;
    local_368._4_4_ = uVar21;
    uVar13 = FUN_1400f59c0(&local_368);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar8 = (int)local_2d8 + uVar21;
    if (uVar8 < uVar21) {
      uVar6 = uVar6 + 1;
    }
    iVar22 = uVar6 + (int)uVar13;
    uVar8 = uVar8 + uVar12;
    if (uVar8 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar8 = uVar8 + 0xcb3e42b6;
    if (uVar8 < 0xcb3e42b6) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x4cc5d4be;
    uVar8 = uVar8 + local_54;
    if (uVar8 < local_54) {
      iVar7 = iVar22 + 0x4cc5d4bf;
    }
    local_358._0_4_ = iVar7 + local_58;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_358);
    local_358._4_4_ = uVar8;
    uVar13 = FUN_1400f57f0(&local_370,&local_340,&local_360);
    local_2f0 = uVar13;
    uVar14 = FUN_1400f5870(&local_370);
    uVar6 = (uint)((ulonglong)uVar14 >> 0x20);
    local_358._4_4_ = local_358._4_4_ + uVar6;
    if (local_358._4_4_ < uVar6) {
      local_358._0_4_ = (uint)local_358 + 1;
    }
    iVar22 = (uint)local_358 + (int)uVar14;
    uVar6 = local_358._4_4_ + local_2f0._4_4_;
    if (uVar6 < local_2f0._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_308 = iVar22 + (int)uVar13;
    local_358 = CONCAT44(uVar6,local_308);
    uVar16 = uVar8 + uVar16;
    if (uVar16 < uVar8) {
      local_348 = local_348 + 1;
    }
    uVar8 = local_348 + (uint)local_378;
    _local_2f8 = CONCAT44(uStack_2f4,uVar8);
    local_378._4_4_ = local_330._4_4_ ^ (uint)local_2e0;
    local_378._0_4_ = uVar9 ^ (uint)local_328;
    local_338._0_4_ = uVar8 & (uint)local_378;
    local_2d8 = (ulonglong)uVar16;
    local_338._4_4_ = local_378._4_4_ & uVar16;
    uVar10 = (uint)local_338 ^ (uint)local_328;
    uVar12 = local_338._4_4_ ^ local_330._4_4_;
    local_2f0._0_4_ = (uint)local_338;
    local_2f0._4_4_ = local_338._4_4_;
    local_348 = uVar8;
    uStack_344 = uVar16;
    uVar13 = FUN_1400f59c0(&local_348);
    uVar21 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar16 = (int)local_2d0 + uVar21;
    if (uVar16 < uVar21) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar16 = uVar16 + uVar12;
    if (uVar16 < uVar12) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar10;
    uVar16 = uVar16 + 0xfc657e2a;
    if (uVar16 < 0xfc657e2a) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x597f299c;
    uVar16 = uVar16 + local_4c;
    if (uVar16 < local_4c) {
      iVar7 = iVar22 + 0x597f299d;
    }
    local_350._0_4_ = iVar7 + local_50;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_350);
    local_350._4_4_ = uVar16;
    local_300 = FUN_1400f57f0(&local_358,&local_370,&local_340);
    uVar13 = FUN_1400f5870(&local_358);
    uVar21 = local_368._4_4_;
    uVar12 = (uint)((ulonglong)uVar13 >> 0x20);
    local_350._4_4_ = local_350._4_4_ + uVar12;
    if (local_350._4_4_ < uVar12) {
      local_350._0_4_ = (uint)local_350 + 1;
    }
    iVar22 = (uint)local_350 + (int)uVar13;
    uVar12 = local_350._4_4_ + local_300._4_4_;
    if (uVar12 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_350 = CONCAT44(uVar12,iVar22 + (uint)local_300);
    local_328 = CONCAT44(local_328._4_4_,iVar22 + (uint)local_300);
    uVar10 = (int)local_320 + uVar16;
    if (uVar10 < uVar16) {
      local_360._0_4_ = (uint)local_360 + 1;
    }
    local_360._0_4_ = (uint)local_360 + (uint)local_378;
    local_318 = CONCAT44(local_318._4_4_,(uint)local_360);
    local_378._4_4_ = local_368._4_4_ ^ (uint)local_2d8;
    local_378._0_4_ = uVar8 ^ (uint)local_2e8;
    local_320 = (ulonglong)uVar10;
    local_368 = CONCAT44(local_378._4_4_ & uVar10,(uint)local_360 & (uint)local_378);
    local_2f0 = local_368;
    uVar11 = (uint)local_360 & (uint)local_378 ^ (uint)local_2e8;
    uVar21 = local_378._4_4_ & uVar10 ^ uVar21;
    local_360._4_4_ = uVar10;
    uVar13 = FUN_1400f59c0(&local_360);
    uVar10 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar8 = (int)local_310 + uVar10;
    uVar16 = (uint)local_330;
    if (uVar8 < uVar10) {
      uVar16 = (uint)local_330 + 1;
    }
    iVar22 = uVar16 + (int)uVar13;
    uVar8 = uVar8 + uVar21;
    if (uVar8 < uVar21) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar11;
    uVar8 = uVar8 + 0x3ad6faec;
    if (uVar8 < 0x3ad6faec) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x5fcb6fab;
    uVar8 = uVar8 + local_44;
    if (uVar8 < local_44) {
      iVar7 = iVar22 + 0x5fcb6fac;
    }
    local_368._0_4_ = iVar7 + local_48;
    local_378._0_4_ = (uint)local_368;
    local_368._4_4_ = uVar8;
    local_300 = FUN_1400f57f0(&local_350,&local_358,&local_370);
    uVar13 = FUN_1400f5870(&local_350);
    uVar16 = (uint)((ulonglong)uVar13 >> 0x20);
    local_368._4_4_ = local_368._4_4_ + uVar16;
    if (local_368._4_4_ < uVar16) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar13;
    uVar16 = local_368._4_4_ + local_300._4_4_;
    if (uVar16 < local_300._4_4_) {
      iVar22 = iVar22 + 1;
    }
    local_338 = CONCAT44(local_338._4_4_,iVar22 + (uint)local_300);
    local_368 = CONCAT44(uVar16,iVar22 + (uint)local_300);
    local_330 = local_368;
    uVar23 = uVar8 + uVar23;
    if (uVar23 < uVar8) {
      local_340._0_4_ = (uint)local_340 + 1;
    }
    local_340._0_4_ = (uint)local_340 + (uint)local_378;
    local_378 = CONCAT44(local_378._4_4_,(uint)local_340);
    uVar21 = (uint)local_320 ^ uStack_344;
    local_368 = CONCAT44(uVar21,(uint)local_360 ^ local_2f8);
    uVar8 = (uint)local_340 & ((uint)local_360 ^ local_2f8);
    uVar21 = uVar23 & uVar21;
    local_2e8 = CONCAT44(uVar21,uVar8);
    local_2f0 = local_2e8;
    uVar8 = uVar8 ^ local_2f8;
    uVar21 = uVar21 ^ uStack_344;
    local_340._4_4_ = uVar23;
    uVar13 = FUN_1400f59c0(&local_340);
    uVar10 = (uint)((ulonglong)uVar13 >> 0x20);
    uVar23 = (int)local_2e0 + uVar10;
    if (uVar23 < uVar10) {
      uVar9 = uVar9 + 1;
    }
    iVar22 = uVar9 + (int)uVar13;
    uVar23 = uVar23 + uVar21;
    if (uVar23 < uVar21) {
      iVar22 = iVar22 + 1;
    }
    iVar22 = iVar22 + uVar8;
    uVar23 = uVar23 + 0x4a475817;
    if (uVar23 < 0x4a475817) {
      iVar22 = iVar22 + 1;
    }
    iVar7 = iVar22 + 0x6c44198c;
    uVar23 = uVar23 + local_3c;
    if (uVar23 < local_3c) {
      iVar7 = iVar22 + 0x6c44198d;
    }
    local_368._0_4_ = iVar7 + local_40;
    local_368._4_4_ = uVar23;
    uVar13 = FUN_1400f57f0(&local_330,&local_350,&local_358);
    local_2f0 = uVar13;
    uVar14 = FUN_1400f5870(&local_330);
    uVar9 = (uint)((ulonglong)uVar14 >> 0x20);
    local_368._4_4_ = local_368._4_4_ + uVar9;
    if (local_368._4_4_ < uVar9) {
      local_368._0_4_ = (uint)local_368 + 1;
    }
    iVar22 = (uint)local_368 + (int)uVar14;
    local_368._4_4_ = local_368._4_4_ + local_2f0._4_4_;
    if (local_368._4_4_ < local_2f0._4_4_) {
      iVar22 = iVar22 + 1;
    }
    uVar17 = uVar23 + uVar17;
    if (uVar17 < uVar23) {
      local_370._0_4_ = (uint)local_370 + 1;
    }
    local_2c0[0x2c] = local_2c0[0x2c] + local_368._4_4_;
    if ((uint)local_2c0[0x2c] < local_368._4_4_) {
      local_2c0[0x2b] = local_2c0[0x2b] + 1;
    }
    local_2c0[0x2b] = local_2c0[0x2b] + iVar22 + (int)uVar13;
    local_2c0[0x2e] = local_2c0[0x2e] + uVar16;
    if ((uint)local_2c0[0x2e] < uVar16) {
      local_2c0[0x2d] = local_2c0[0x2d] + 1;
    }
    local_2c0[0x2d] = local_2c0[0x2d] + (uint)local_338;
    local_2c0[0x30] = local_2c0[0x30] + uVar12;
    if ((uint)local_2c0[0x30] < uVar12) {
      local_2c0[0x2f] = local_2c0[0x2f] + 1;
    }
    local_2c0[0x2f] = local_2c0[0x2f] + (uint)local_328;
    local_2c0[0x32] = local_2c0[0x32] + uVar6;
    if ((uint)local_2c0[0x32] < uVar6) {
      local_2c0[0x31] = local_2c0[0x31] + 1;
    }
    local_2c0[0x31] = local_2c0[0x31] + local_308;
    local_2c0[0x34] = local_2c0[0x34] + uVar17;
    if ((uint)local_2c0[0x34] < uVar17) {
      local_2c0[0x33] = local_2c0[0x33] + 1;
    }
    local_2c0[0x33] = local_2c0[0x33] + (uint)local_370 + iVar7 + local_40;
    local_2c0[0x36] = local_2c0[0x36] + local_340._4_4_;
    if ((uint)local_2c0[0x36] < local_340._4_4_) {
      local_2c0[0x35] = local_2c0[0x35] + 1;
    }
    local_2c0[0x35] = local_2c0[0x35] + (uint)local_378;
    local_2c0[0x38] = local_2c0[0x38] + local_360._4_4_;
    if ((uint)local_2c0[0x38] < local_360._4_4_) {
      local_2c0[0x37] = local_2c0[0x37] + 1;
    }
    local_2c0[0x37] = local_2c0[0x37] + (uint)local_318;
    local_2c0[0x3a] = local_2c0[0x3a] + uStack_344;
    if ((uint)local_2c0[0x3a] < uStack_344) {
      local_2c0[0x39] = local_2c0[0x39] + 1;
    }
    local_2c0[0x39] = local_2c0[0x39] + local_2f8;
  }
  return;
}



void FUN_140102140(void)

{
  undefined4 *puVar1;
  
  puVar1 = operator_new(0xfc);
  if (puVar1 != (undefined4 *)0x0) {
    puVar1[1] = 0x6a09e667;
    puVar1[2] = 0xbb67ae85;
    puVar1[3] = 0x3c6ef372;
    puVar1[4] = 0xa54ff53a;
    puVar1[5] = 0x510e527f;
    puVar1[6] = 0x9b05688c;
    puVar1[7] = 0x1f83d9ab;
    *(undefined8 *)(puVar1 + 8) = 0x5be0cd19;
    puVar1[10] = 0;
    *puVar1 = 1;
    return;
  }
  return;
}



undefined4 * FUN_1401021b0(void)

{
  undefined4 *puVar1;
  
  puVar1 = operator_new(0xfc);
  if (puVar1 != (undefined4 *)0x0) {
    *(undefined8 *)(puVar1 + 0x2b) = 0xc1059ed8cbbb9d5d;
    *(undefined8 *)(puVar1 + 0x2d) = 0x367cd507629a292a;
    *(undefined8 *)(puVar1 + 0x2f) = 0x3070dd179159015a;
    *(undefined8 *)(puVar1 + 0x31) = 0xf70e5939152fecd8;
    *(undefined8 *)(puVar1 + 0x33) = 0xffc00b3167332667;
    *(undefined8 *)(puVar1 + 0x35) = 0x685815118eb44a87;
    *(undefined8 *)(puVar1 + 0x37) = 0x64f98fa7db0c2e0d;
    *(undefined8 *)(puVar1 + 0x39) = 0xbefa4fa447b5481d;
    *(undefined8 *)(puVar1 + 0x3b) = 0;
    *(undefined8 *)(puVar1 + 0x3d) = 0;
    *puVar1 = 2;
    return puVar1;
  }
  return (undefined4 *)0x0;
}



undefined4 * FUN_140102260(void)

{
  undefined4 *puVar1;
  
  puVar1 = operator_new(0xfc);
  if (puVar1 != (undefined4 *)0x0) {
    *(undefined8 *)(puVar1 + 0x2b) = 0xf3bcc9086a09e667;
    *(undefined8 *)(puVar1 + 0x2d) = 0x84caa73bbb67ae85;
    *(undefined8 *)(puVar1 + 0x2f) = 0xfe94f82b3c6ef372;
    *(undefined8 *)(puVar1 + 0x31) = 0x5f1d36f1a54ff53a;
    *(undefined8 *)(puVar1 + 0x33) = 0xade682d1510e527f;
    *(undefined8 *)(puVar1 + 0x35) = 0x2b3e6c1f9b05688c;
    *(undefined8 *)(puVar1 + 0x37) = 0xfb41bd6b1f83d9ab;
    *(undefined8 *)(puVar1 + 0x39) = 0x137e21795be0cd19;
    *(undefined8 *)(puVar1 + 0x3b) = 0;
    *(undefined8 *)(puVar1 + 0x3d) = 0;
    *puVar1 = 3;
    return puVar1;
  }
  return (undefined4 *)0x0;
}



void FUN_140102310(int *param_1,undefined8 *param_2,uint param_3)

{
  int iVar1;
  uint uVar2;
  uint uVar3;
  int *_Dst;
  uint uVar4;
  ulonglong uVar5;
  ulonglong _Size;
  
  if (param_2 == (undefined8 *)0x0) {
    return;
  }
  _Size = (ulonglong)param_3;
  if (param_3 == 0) {
    return;
  }
  iVar1 = *param_1;
  if (iVar1 < 0) {
    return;
  }
  if (iVar1 < 2) {
    uVar4 = param_1[9];
    uVar3 = uVar4 + param_3 * 8;
    param_1[9] = uVar3;
    if (uVar3 < uVar4) {
      param_1[10] = param_1[10] + 1;
    }
    param_1[10] = param_1[10] + (param_3 >> 0x1d);
    uVar4 = uVar4 >> 3 & 0x3f;
    if (uVar4 != 0) {
      _Dst = (int *)((ulonglong)uVar4 + 0x2c + (longlong)param_1);
      uVar4 = 0x40 - uVar4;
      if (param_3 < uVar4) goto LAB_1401024fe;
      memcpy(_Dst,param_2,(ulonglong)uVar4);
      FUN_1400f5ef0(param_1);
      param_2 = (undefined8 *)((longlong)param_2 + (ulonglong)uVar4);
      _Size = (ulonglong)(param_3 - uVar4);
    }
    uVar4 = (uint)_Size;
    if (0x3f < uVar4) {
      uVar5 = _Size >> 6;
      do {
        *(undefined8 *)(param_1 + 0xb) = *param_2;
        *(undefined8 *)(param_1 + 0xd) = param_2[1];
        *(undefined8 *)(param_1 + 0xf) = param_2[2];
        *(undefined8 *)(param_1 + 0x11) = param_2[3];
        *(undefined8 *)(param_1 + 0x13) = param_2[4];
        *(undefined8 *)(param_1 + 0x15) = param_2[5];
        *(undefined8 *)(param_1 + 0x17) = param_2[6];
        *(undefined8 *)(param_1 + 0x19) = param_2[7];
        FUN_1400f5ef0(param_1);
        param_2 = param_2 + 8;
        uVar4 = (int)_Size - 0x40;
        _Size = (ulonglong)uVar4;
        uVar5 = uVar5 - 1;
      } while (uVar5 != 0);
    }
  }
  else {
    if (3 < iVar1) {
      return;
    }
    uVar4 = param_1[0x3c];
    uVar3 = param_1[0x3b];
    uVar2 = uVar4 + param_3 * 8;
    param_1[0x3c] = uVar2;
    if (uVar2 < uVar4) {
      param_1[0x3b] = uVar3 + 1;
    }
    uVar2 = param_1[0x3e];
    param_1[0x3b] = param_1[0x3b] + (param_3 >> 0x1d);
    if ((uint)param_1[0x3b] < uVar3) {
      param_1[0x3e] = uVar2 + 1;
    }
    if ((uint)param_1[0x3e] < uVar2) {
      param_1[0x3d] = param_1[0x3d] + 1;
    }
    uVar4 = uVar4 >> 3 & 0x7f;
    if (uVar4 != 0) {
      _Dst = (int *)((ulonglong)uVar4 + 0x2c + (longlong)param_1);
      uVar4 = 0x80 - uVar4;
      if (param_3 < uVar4) goto LAB_1401024fe;
      memcpy(_Dst,param_2,(ulonglong)uVar4);
      FUN_1400f5ef0(param_1);
      param_2 = (undefined8 *)((longlong)param_2 + (ulonglong)uVar4);
      _Size = (ulonglong)(param_3 - uVar4);
    }
    uVar4 = (uint)_Size;
    if (0x7f < uVar4) {
      uVar5 = _Size >> 7;
      do {
        memcpy(param_1 + 0xb,param_2,0x80);
        FUN_1400f5ef0(param_1);
        param_2 = param_2 + 0x10;
        uVar4 = (int)_Size - 0x80;
        _Size = (ulonglong)uVar4;
        uVar5 = uVar5 - 1;
      } while (uVar5 != 0);
    }
  }
  _Dst = param_1 + 0xb;
  _Size = (ulonglong)uVar4;
LAB_1401024fe:
  memcpy(_Dst,param_2,_Size);
  return;
}



void FUN_140102520(int *param_1,undefined1 *param_2)

{
  int iVar1;
  uint uVar2;
  int *_Dst;
  undefined1 *puVar3;
  longlong lVar4;
  uint uVar5;
  
  iVar1 = *param_1;
  if (-1 < iVar1) {
    if (iVar1 < 2) {
      uVar5 = (uint)param_1[9] >> 3 & 0x3f;
      iVar1 = -uVar5;
      uVar2 = iVar1 + 0x3f;
      puVar3 = (undefined1 *)((ulonglong)uVar5 + 0x2c + (longlong)param_1);
      *puVar3 = 0x80;
      puVar3 = puVar3 + 1;
      if (uVar2 < 8) {
        memset(puVar3,0,(ulonglong)uVar2);
        FUN_1400f5ef0(param_1);
        param_1[0xb] = 0;
        param_1[0xc] = 0;
        param_1[0xd] = 0;
        param_1[0xe] = 0;
        param_1[0xf] = 0;
        param_1[0x10] = 0;
        param_1[0x11] = 0;
        param_1[0x12] = 0;
        param_1[0x13] = 0;
        param_1[0x14] = 0;
        param_1[0x15] = 0;
        param_1[0x16] = 0;
        param_1[0x17] = 0;
        param_1[0x18] = 0;
      }
      else {
        memset(puVar3,0,(ulonglong)(iVar1 + 0x37));
      }
      *(char *)((longlong)param_1 + 0x67) = (char)param_1[10];
      *(undefined1 *)((longlong)param_1 + 0x66) = *(undefined1 *)((longlong)param_1 + 0x29);
      *(undefined1 *)((longlong)param_1 + 0x65) = *(undefined1 *)((longlong)param_1 + 0x2a);
      *(undefined1 *)(param_1 + 0x19) = *(undefined1 *)((longlong)param_1 + 0x2b);
      *(char *)((longlong)param_1 + 0x6b) = (char)param_1[9];
      *(undefined1 *)((longlong)param_1 + 0x6a) = *(undefined1 *)((longlong)param_1 + 0x25);
      *(undefined1 *)((longlong)param_1 + 0x69) = *(undefined1 *)((longlong)param_1 + 0x26);
      *(undefined1 *)(param_1 + 0x1a) = *(undefined1 *)((longlong)param_1 + 0x27);
      FUN_1400f5ef0(param_1);
      if (*param_1 == 0) {
        param_2[3] = (char)param_1[1];
        param_2[2] = *(undefined1 *)((longlong)param_1 + 5);
        param_2[1] = *(undefined1 *)((longlong)param_1 + 6);
        *param_2 = *(undefined1 *)((longlong)param_1 + 7);
        param_2[7] = (char)param_1[2];
        param_2[6] = *(undefined1 *)((longlong)param_1 + 9);
        param_2[5] = *(undefined1 *)((longlong)param_1 + 10);
        param_2[4] = *(undefined1 *)((longlong)param_1 + 0xb);
        param_2[0xb] = (char)param_1[3];
        param_2[10] = *(undefined1 *)((longlong)param_1 + 0xd);
        param_2[9] = *(undefined1 *)((longlong)param_1 + 0xe);
        param_2[8] = *(undefined1 *)((longlong)param_1 + 0xf);
        param_2[0xf] = (char)param_1[4];
        param_2[0xe] = *(undefined1 *)((longlong)param_1 + 0x11);
        param_2[0xd] = *(undefined1 *)((longlong)param_1 + 0x12);
        param_2[0xc] = *(undefined1 *)((longlong)param_1 + 0x13);
        param_2[0x13] = (char)param_1[5];
        param_2[0x12] = *(undefined1 *)((longlong)param_1 + 0x15);
        param_2[0x11] = *(undefined1 *)((longlong)param_1 + 0x16);
        param_2[0x10] = *(undefined1 *)((longlong)param_1 + 0x17);
      }
      else if (*param_1 == 1) {
        param_2[3] = (char)param_1[1];
        param_2[2] = *(undefined1 *)((longlong)param_1 + 5);
        param_2[1] = *(undefined1 *)((longlong)param_1 + 6);
        *param_2 = *(undefined1 *)((longlong)param_1 + 7);
        param_2[7] = (char)param_1[2];
        param_2[6] = *(undefined1 *)((longlong)param_1 + 9);
        param_2[5] = *(undefined1 *)((longlong)param_1 + 10);
        param_2[4] = *(undefined1 *)((longlong)param_1 + 0xb);
        param_2[0xb] = (char)param_1[3];
        param_2[10] = *(undefined1 *)((longlong)param_1 + 0xd);
        param_2[9] = *(undefined1 *)((longlong)param_1 + 0xe);
        param_2[8] = *(undefined1 *)((longlong)param_1 + 0xf);
        param_2[0xf] = (char)param_1[4];
        param_2[0xe] = *(undefined1 *)((longlong)param_1 + 0x11);
        param_2[0xd] = *(undefined1 *)((longlong)param_1 + 0x12);
        param_2[0xc] = *(undefined1 *)((longlong)param_1 + 0x13);
        param_2[0x13] = (char)param_1[5];
        param_2[0x12] = *(undefined1 *)((longlong)param_1 + 0x15);
        param_2[0x11] = *(undefined1 *)((longlong)param_1 + 0x16);
        param_2[0x10] = *(undefined1 *)((longlong)param_1 + 0x17);
        param_2[0x17] = (char)param_1[6];
        param_2[0x16] = *(undefined1 *)((longlong)param_1 + 0x19);
        param_2[0x15] = *(undefined1 *)((longlong)param_1 + 0x1a);
        param_2[0x14] = *(undefined1 *)((longlong)param_1 + 0x1b);
        param_2[0x1b] = (char)param_1[7];
        param_2[0x1a] = *(undefined1 *)((longlong)param_1 + 0x1d);
        param_2[0x19] = *(undefined1 *)((longlong)param_1 + 0x1e);
        param_2[0x18] = *(undefined1 *)((longlong)param_1 + 0x1f);
        param_2[0x1f] = (char)param_1[8];
        param_2[0x1e] = *(undefined1 *)((longlong)param_1 + 0x21);
        param_2[0x1d] = *(undefined1 *)((longlong)param_1 + 0x22);
        param_2[0x1c] = *(undefined1 *)((longlong)param_1 + 0x23);
        FUN_1400f5d70(param_1);
        return;
      }
    }
    else if (iVar1 < 4) {
      uVar5 = (uint)param_1[0x3c] >> 3 & 0x7f;
      iVar1 = -uVar5;
      uVar2 = iVar1 + 0x7f;
      puVar3 = (undefined1 *)((ulonglong)uVar5 + 0x2c + (longlong)param_1);
      _Dst = (int *)(puVar3 + 1);
      *puVar3 = 0x80;
      if (uVar2 < 0x10) {
        memset(_Dst,0,(ulonglong)uVar2);
        FUN_1400f5ef0(param_1);
        _Dst = param_1 + 0xb;
        uVar2 = 0x70;
      }
      else {
        uVar2 = iVar1 + 0x6f;
      }
      memset(_Dst,0,(ulonglong)uVar2);
      *(char *)((longlong)param_1 + 0xa3) = (char)param_1[0x3e];
      *(undefined1 *)((longlong)param_1 + 0xa2) = *(undefined1 *)((longlong)param_1 + 0xf9);
      *(undefined1 *)((longlong)param_1 + 0xa1) = *(undefined1 *)((longlong)param_1 + 0xfa);
      *(undefined1 *)(param_1 + 0x28) = *(undefined1 *)((longlong)param_1 + 0xfb);
      *(char *)((longlong)param_1 + 0x9f) = (char)param_1[0x3d];
      *(undefined1 *)((longlong)param_1 + 0x9e) = *(undefined1 *)((longlong)param_1 + 0xf5);
      *(undefined1 *)((longlong)param_1 + 0x9d) = *(undefined1 *)((longlong)param_1 + 0xf6);
      *(undefined1 *)(param_1 + 0x27) = *(undefined1 *)((longlong)param_1 + 0xf7);
      *(char *)((longlong)param_1 + 0xab) = (char)param_1[0x3c];
      *(undefined1 *)((longlong)param_1 + 0xaa) = *(undefined1 *)((longlong)param_1 + 0xf1);
      *(undefined1 *)((longlong)param_1 + 0xa9) = *(undefined1 *)((longlong)param_1 + 0xf2);
      *(undefined1 *)(param_1 + 0x2a) = *(undefined1 *)((longlong)param_1 + 0xf3);
      *(char *)((longlong)param_1 + 0xa7) = (char)param_1[0x3b];
      *(undefined1 *)((longlong)param_1 + 0xa6) = *(undefined1 *)((longlong)param_1 + 0xed);
      *(undefined1 *)((longlong)param_1 + 0xa5) = *(undefined1 *)((longlong)param_1 + 0xee);
      *(undefined1 *)(param_1 + 0x29) = *(undefined1 *)((longlong)param_1 + 0xef);
      FUN_1400f5ef0(param_1);
      if (*param_1 == 2) {
        lVar4 = 6;
        puVar3 = (undefined1 *)((longlong)param_1 + 0xb2);
        do {
          lVar4 = lVar4 + -1;
          param_2[7] = puVar3[-2];
          param_2[6] = puVar3[-1];
          param_2[5] = *puVar3;
          param_2[4] = puVar3[1];
          param_2[3] = puVar3[-6];
          param_2[2] = puVar3[-5];
          param_2[1] = puVar3[-4];
          *param_2 = puVar3[-3];
          puVar3 = puVar3 + 8;
          param_2 = param_2 + 8;
        } while (lVar4 != 0);
        FUN_1400f5d70(param_1);
        return;
      }
      if (*param_1 == 3) {
        lVar4 = 8;
        puVar3 = (undefined1 *)((longlong)param_1 + 0xb2);
        do {
          lVar4 = lVar4 + -1;
          param_2[7] = puVar3[-2];
          param_2[6] = puVar3[-1];
          param_2[5] = *puVar3;
          param_2[4] = puVar3[1];
          param_2[3] = puVar3[-6];
          param_2[2] = puVar3[-5];
          param_2[1] = puVar3[-4];
          *param_2 = puVar3[-3];
          puVar3 = puVar3 + 8;
          param_2 = param_2 + 8;
        } while (lVar4 != 0);
        FUN_1400f5d70(param_1);
        return;
      }
    }
  }
  FUN_1400f5d70(param_1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401029a0(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  void *pvVar1;
  undefined1 auStack_78 [32];
  undefined1 local_58 [48];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_78;
  pvVar1 = (void *)FUN_1401021b0();
  FUN_1400f5d70(pvVar1);
  FUN_140102310();
  FUN_140102520(pvVar1,local_58);
  operator_delete(pvVar1);
  FUN_1400b97e0(param_3,local_58,0x30);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140102a30(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  void *pvVar1;
  undefined1 auStack_88 [32];
  undefined1 local_68 [64];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  pvVar1 = (void *)FUN_140102260();
  FUN_1400f5d70(pvVar1);
  FUN_140102310();
  FUN_140102520(pvVar1,local_68);
  operator_delete(pvVar1);
  FUN_1400b97e0(param_3,local_68,0x40);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140102ac0(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  undefined4 *puVar1;
  undefined1 auStack_68 [32];
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_30;
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_68;
  local_48 = 0;
  local_40 = 0;
  local_38 = 0;
  local_30 = 0;
  puVar1 = operator_new(0xfc);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1[1] = 0x6a09e667;
    puVar1[2] = 0xbb67ae85;
    puVar1[3] = 0x3c6ef372;
    puVar1[4] = 0xa54ff53a;
    puVar1[5] = 0x510e527f;
    puVar1[6] = 0x9b05688c;
    puVar1[7] = 0x1f83d9ab;
    *(undefined8 *)(puVar1 + 8) = 0x5be0cd19;
    puVar1[10] = 0;
    *puVar1 = 1;
  }
  FUN_1400f5d70(puVar1);
  FUN_140102310();
  FUN_140102520(puVar1,&local_48);
  operator_delete(puVar1);
  FUN_1400b97e0(param_3,&local_48,0x20);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140102bb0(undefined8 param_1,undefined8 param_2)

{
  undefined4 uVar1;
  undefined4 *puVar2;
  undefined8 uVar3;
  undefined1 auStack_68 [32];
  undefined1 local_48 [32];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_68;
  puVar2 = operator_new(0xfc);
  if (puVar2 == (undefined4 *)0x0) {
    puVar2 = (undefined4 *)0x0;
  }
  else {
    puVar2[1] = 0x6a09e667;
    puVar2[2] = 0xbb67ae85;
    puVar2[3] = 0x3c6ef372;
    puVar2[4] = 0xa54ff53a;
    puVar2[5] = 0x510e527f;
    puVar2[6] = 0x9b05688c;
    puVar2[7] = 0x1f83d9ab;
    *(undefined8 *)(puVar2 + 8) = 0x5be0cd19;
    puVar2[10] = 0;
    *puVar2 = 1;
  }
  FUN_1400f5d70(puVar2);
  uVar1 = FUN_1400b8b80(param_1);
  uVar3 = FUN_1400b8b90(param_1);
  FUN_140102310(puVar2,uVar3,uVar1);
  FUN_140102520(puVar2,local_48);
  operator_delete(puVar2);
  FUN_1400b97e0(param_2,local_48,0x20);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140102ca0(undefined8 param_1,undefined8 param_2)

{
  undefined4 uVar1;
  void *pvVar2;
  undefined8 uVar3;
  undefined1 auStack_78 [32];
  undefined1 local_58 [48];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_78;
  pvVar2 = (void *)FUN_1401021b0();
  FUN_1400f5d70(pvVar2);
  uVar1 = FUN_1400b8b80(param_1);
  uVar3 = FUN_1400b8b90(param_1);
  FUN_140102310(pvVar2,uVar3,uVar1);
  FUN_140102520(pvVar2,local_58);
  operator_delete(pvVar2);
  FUN_1400b97e0(param_2,local_58,0x30);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140102d40(undefined8 param_1,undefined8 param_2)

{
  undefined4 uVar1;
  void *pvVar2;
  undefined8 uVar3;
  undefined1 auStack_88 [32];
  undefined1 local_68 [64];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  pvVar2 = (void *)FUN_140102260();
  FUN_1400f5d70(pvVar2);
  uVar1 = FUN_1400b8b80(param_1);
  uVar3 = FUN_1400b8b90(param_1);
  FUN_140102310(pvVar2,uVar3,uVar1);
  FUN_140102520(pvVar2,local_68);
  operator_delete(pvVar2);
  FUN_1400b97e0(param_2,local_68,0x40);
  return;
}



undefined1 FUN_140102de0(void)

{
  return 0;
}



bool FUN_140102df0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  void *pvVar2;
  ulonglong uVar3;
  bool bVar4;
  int local_28 [4];
  
  pvVar2 = operator_new(0x4e28);
  if (pvVar2 == (void *)0x0) {
    return false;
  }
  bVar4 = true;
  local_28[0] = 0;
  while( true ) {
    if ((param_2 == 0) || (cVar1 = (**(code **)(*param_1 + 0x18))(param_1), cVar1 != '\0'))
    goto LAB_140102eaf;
    uVar3 = 20000;
    if ((longlong)param_2 < 20000) {
      uVar3 = param_2 & 0xffffffff;
      param_2 = 0;
    }
    else {
      param_2 = param_2 - 20000;
    }
    cVar1 = (**(code **)(*param_1 + 8))(param_1,pvVar2,uVar3,local_28,param_4);
    if (cVar1 == '\0') break;
    if (local_28[0] != (int)uVar3) {
      cVar1 = (**(code **)(*param_1 + 0x18))(param_1);
      bVar4 = cVar1 != '\0';
LAB_140102eaf:
      operator_delete(pvVar2);
      return bVar4;
    }
  }
  bVar4 = false;
  goto LAB_140102eaf;
}



undefined1 FUN_140102ee0(void)

{
  undefined4 *in_R9;
  
  if (in_R9 != (undefined4 *)0x0) {
    *in_R9 = 0;
  }
  return 0;
}



void FUN_140102ef0(longlong param_1,ulonglong param_2)

{
  DWORD DVar1;
  
  if ((((*(longlong *)(param_1 + 0x30) != 0) &&
       (**(longlong **)(param_1 + 0x30) = **(longlong **)(param_1 + 0x30) + (param_2 & 0xffffffff),
       *(longlong *)(param_1 + 0x30) != 0)) && (*(longlong *)(param_1 + 0x40) != 0)) &&
     (*(int *)(param_1 + 0x38) != 0)) {
    DVar1 = GetTickCount();
    if (*(uint *)(param_1 + 0x38) < DVar1) {
      **(undefined4 **)(param_1 + 0x40) =
           (int)((**(longlong **)(param_1 + 0x30) * 1000) /
                (longlong)(ulonglong)(DVar1 - *(uint *)(param_1 + 0x38)));
    }
  }
  return;
}



undefined8 * FUN_140102f50(undefined8 *param_1)

{
  *param_1 = DataSource::vftable;
  FUN_140133450(param_1 + 1);
  param_1[3] = 0;
  param_1[4] = 0;
  *(undefined1 *)(param_1 + 5) = 1;
  param_1[6] = 0;
  *(undefined4 *)(param_1 + 7) = 0;
  param_1[8] = 0;
  FUN_140132fb0(param_1 + 1);
  return param_1;
}



undefined1 FUN_140102fb0(undefined8 param_1,undefined8 param_2,undefined8 *param_3)

{
  *param_3 = 0;
  return 0;
}



void FUN_140102fc0(undefined8 *param_1)

{
  param_1[4] = 0;
  *param_1 = DataSource::vftable;
  FUN_140132f70();
  return;
}



void FUN_140102fe0(longlong param_1,undefined8 param_2)

{
  *(undefined8 *)(param_1 + 0x20) = param_2;
  return;
}



undefined8 * FUN_140102ff0(undefined8 *param_1,uint param_2)

{
  param_1[4] = 0;
  *param_1 = DataSource::vftable;
  FUN_140132f70(param_1 + 1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



longlong FUN_140103040(undefined8 param_1,longlong param_2,longlong param_3)

{
  if (0 < param_3) {
    for (; 1000000 < param_3; param_3 = param_3 / 10) {
      param_2 = param_2 / 10;
    }
    return (param_2 * 100) / param_3;
  }
  return 100;
}



void FUN_1401030c0(longlong param_1,longlong param_2,char *param_3)

{
  longlong lVar1;
  uint uVar2;
  uint uVar3;
  DWORD DVar4;
  longlong lVar5;
  char cVar6;
  char local_res8 [8];
  
  *param_3 = '\0';
  lVar5 = *(longlong *)(param_1 + 0x18);
  lVar1 = *(longlong *)(param_1 + 0x20);
  local_res8[0] = '\0';
  uVar2 = FUN_140103040(param_1,lVar1,lVar5);
  cVar6 = *(char *)(param_1 + 0x50);
  if ((cVar6 == '\0') &&
     (lVar1 = lVar1 + param_2, *(longlong *)(param_1 + 0x20) = lVar1, lVar5 < lVar1)) {
    *(longlong *)(param_1 + 0x20) = lVar5;
  }
  uVar3 = 0;
  if (cVar6 == '\0') {
    uVar3 = FUN_140103040(param_1,*(undefined8 *)(param_1 + 0x20),lVar5);
  }
  if (*(longlong *)(param_1 + 0x30) != 0) {
    if (((cVar6 == '\0') && (uVar2 < uVar3)) && (*(uint *)(param_1 + 0x28) < uVar3)) {
      DVar4 = GetTickCount();
      *(DWORD *)(param_1 + 0x3c) = DVar4;
      if ((*(char *)(param_1 + 0x51) == '\0') || (uVar3 != 100)) {
        *(uint *)(param_1 + 0x28) = uVar3;
        (**(code **)(**(longlong **)(param_1 + 0x30) + 8))
                  (*(longlong **)(param_1 + 0x30),uVar3,local_res8);
      }
      if (local_res8[0] != '\0') {
        *(undefined1 *)(param_1 + 0x38) = 1;
        *param_3 = local_res8[0];
      }
    }
    else if (((*(longlong *)(param_1 + 0x30) != 0) && (*(char *)(param_1 + 0x44) == '\0')) &&
            (*(int *)(param_1 + 0x40) != 0)) {
      DVar4 = GetTickCount();
      uVar2 = *(uint *)(param_1 + 0x40);
      if (uVar2 == 0) {
        uVar2 = 300;
      }
      if (uVar2 < DVar4 - *(int *)(param_1 + 0x3c)) {
        *(DWORD *)(param_1 + 0x48) = DVar4;
        *(DWORD *)(param_1 + 0x3c) = DVar4;
        (**(code **)(**(longlong **)(param_1 + 0x30) + 0x10))
                  (*(longlong **)(param_1 + 0x30),local_res8);
        if (local_res8[0] != '\0') {
          *param_3 = local_res8[0];
          *(undefined1 *)(param_1 + 0x38) = 1;
        }
      }
    }
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401031f0(longlong param_1,longlong param_2)

{
  uint uVar1;
  uint uVar2;
  DWORD DVar3;
  longlong lVar4;
  longlong lVar5;
  undefined1 local_res8 [8];
  
  if (*(char *)(param_1 + 0x50) == '\0') {
    _DAT_140316f54 = 0x70;
    lVar5 = *(longlong *)(param_1 + 0x18);
    lVar4 = *(longlong *)(param_1 + 0x20);
    uVar1 = FUN_140103040(param_1,lVar4,lVar5);
    *(longlong *)(param_1 + 0x20) = lVar4 + param_2;
    if (lVar5 < lVar4 + param_2) {
      *(longlong *)(param_1 + 0x20) = lVar5;
    }
    uVar2 = FUN_140103040(param_1,*(undefined8 *)(param_1 + 0x20),lVar5);
    if ((*(char *)(param_1 + 0x51) != '\0') && (uVar2 == 100)) {
      _DAT_140316f54 = 0x71;
      return;
    }
    _DAT_140316f54 = 0x72;
    if ((*(longlong *)(param_1 + 0x30) != 0) &&
       ((uVar1 < uVar2 && (*(uint *)(param_1 + 0x28) < uVar2)))) {
      DVar3 = GetTickCount();
      *(uint *)(param_1 + 0x28) = uVar2;
      *(DWORD *)(param_1 + 0x3c) = DVar3;
      (**(code **)(**(longlong **)(param_1 + 0x30) + 8))
                (*(longlong **)(param_1 + 0x30),uVar2,local_res8);
    }
    _DAT_140316f54 = 0x73;
  }
  return;
}



void FUN_1401032d0(undefined8 param_1,undefined4 param_2)

{
  FUN_1401030c0(param_1,param_2);
  return;
}



void FUN_1401032e0(longlong param_1,longlong param_2,char *param_3)

{
  longlong *plVar1;
  uint uVar2;
  uint uVar3;
  longlong lVar4;
  
  *param_3 = '\0';
  lVar4 = *(longlong *)(param_1 + 0x18);
  uVar2 = FUN_140103040(param_1,*(undefined8 *)(param_1 + 0x20),lVar4);
  *(longlong *)(param_1 + 0x20) = param_2;
  if (lVar4 < param_2) {
    *(longlong *)(param_1 + 0x20) = lVar4;
  }
  uVar3 = FUN_140103040(param_1,*(undefined8 *)(param_1 + 0x20),lVar4);
  plVar1 = *(longlong **)(param_1 + 0x30);
  if ((((plVar1 != (longlong *)0x0) && (uVar2 < uVar3)) && (*(uint *)(param_1 + 0x28) < uVar3)) &&
     ((*(char *)(param_1 + 0x51) == '\0' || (uVar3 != 100)))) {
    *(uint *)(param_1 + 0x28) = uVar3;
    (**(code **)(*plVar1 + 8))(plVar1,uVar3,param_3);
    if (*param_3 != '\0') {
      *(undefined1 *)(param_1 + 0x38) = 1;
    }
  }
  return;
}



void FUN_140103370(undefined8 param_1,undefined4 param_2)

{
  FUN_1401032e0(param_1,param_2);
  return;
}



void FUN_140103380(longlong param_1,uint param_2)

{
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(ulonglong *)(param_1 + 0x18) = (ulonglong)param_2;
  *(undefined1 *)(param_1 + 0x38) = 0;
  *(undefined4 *)(param_1 + 0x28) = 0;
  return;
}



void FUN_1401033a0(longlong param_1)

{
  DWORD DVar1;
  undefined1 local_res8 [32];
  
  if (0 < *(longlong *)(param_1 + 0x18) - *(longlong *)(param_1 + 0x20)) {
    FUN_1401031f0();
  }
  if ((*(char *)(param_1 + 0x51) != '\0') && (*(longlong *)(param_1 + 0x30) != 0)) {
    DVar1 = GetTickCount();
    *(DWORD *)(param_1 + 0x3c) = DVar1;
    (**(code **)(**(longlong **)(param_1 + 0x30) + 8))
              (*(longlong **)(param_1 + 0x30),100,local_res8);
  }
  return;
}



undefined8
FUN_1401033f0(undefined8 param_1,undefined8 param_2,undefined8 param_3,uint param_4,uint param_5,
             undefined8 param_6)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  uint uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  byte *pbVar8;
  longlong lVar9;
  byte *pbVar10;
  ulonglong uVar11;
  ulonglong uVar12;
  undefined1 local_128;
  undefined1 local_127;
  undefined1 local_126;
  undefined1 local_125;
  int local_124;
  int local_120;
  int local_11c;
  int local_118;
  undefined1 local_110 [40];
  undefined1 local_e8 [40];
  undefined1 local_c0 [40];
  undefined1 local_98 [40];
  undefined8 local_70;
  undefined1 local_68 [48];
  
  local_70 = 0xfffffffffffffffe;
  FUN_1400b8b30(param_6);
  FUN_1400bcc20(local_68);
  FUN_1400bc640(local_68,param_1);
  uVar2 = FUN_1400c0890(param_2);
  local_118 = FUN_1400c0a30(uVar2);
  local_11c = (int)(local_118 + -1 + param_5) / local_118;
  local_120 = (int)param_5 % local_118;
  local_124 = 1;
  if (0 < local_11c) {
    do {
      iVar1 = local_124;
      uVar3 = FUN_1400b8b80(param_3);
      uVar6 = FUN_1400b8b90(param_3);
      uVar4 = FUN_1400bbb10(local_68);
      uVar7 = FUN_1400b8b90(local_68);
      local_128 = (undefined1)((uint)iVar1 >> 0x18);
      local_127 = (undefined1)((uint)iVar1 >> 0x10);
      local_126 = (undefined1)((uint)iVar1 >> 8);
      local_125 = (undefined1)iVar1;
      FUN_1400b8c40(local_c0);
      FUN_1400b97e0(local_c0,uVar6,uVar3);
      FUN_1400b97e0(local_c0,&local_128,4);
      FUN_1400b8c40(local_98);
      FUN_1400b8c40(local_e8);
      FUN_1400b8c40(local_110);
      uVar3 = FUN_1400b8b80(local_c0);
      uVar6 = FUN_1400b8b90(local_c0);
      FUN_140103fa0(uVar6,uVar3,uVar7,uVar4,uVar2,local_110);
      FUN_1400b9e90(local_e8,local_110);
      uVar5 = FUN_1400b8b80(local_110);
      if (param_5 < uVar5) {
        uVar5 = param_5;
      }
      pbVar8 = (byte *)FUN_1400b8b90(local_110);
      if (1 < param_4) {
        uVar11 = (ulonglong)(param_4 - 1);
        do {
          uVar3 = FUN_1400b8b80(local_e8);
          uVar6 = FUN_1400b8b90(local_e8);
          FUN_140103fa0(uVar6,uVar3,uVar7,uVar4,uVar2,local_98);
          lVar9 = FUN_1400b8b90(local_98);
          if (uVar5 != 0) {
            uVar12 = (ulonglong)uVar5;
            pbVar10 = pbVar8;
            do {
              *pbVar10 = *pbVar10 ^ pbVar10[lVar9 - (longlong)pbVar8];
              pbVar10 = pbVar10 + 1;
              uVar12 = uVar12 - 1;
            } while (uVar12 != 0);
          }
          FUN_1400b8b30(local_e8);
          FUN_1400b9e90(local_e8,local_98);
          FUN_1400b8b30(local_98);
          uVar11 = uVar11 - 1;
        } while (uVar11 != 0);
      }
      FUN_1400b9e90(param_6,local_110);
      FUN_1400b92d0(local_110);
      FUN_1400b92d0(local_e8);
      FUN_1400b92d0(local_98);
      FUN_1400b92d0(local_c0);
      local_124 = local_124 + 1;
    } while (local_124 <= local_11c);
  }
  FUN_1400b8be0(param_6,local_118 - local_120);
  FUN_1400bceb0(local_68);
  return 1;
}



undefined8
FUN_1401036c0(undefined8 param_1,undefined8 param_2,undefined8 param_3,int param_4,int param_5,
             undefined8 param_6)

{
  undefined4 uVar1;
  undefined4 uVar2;
  int iVar3;
  undefined8 uVar4;
  ulonglong uVar5;
  undefined1 local_60 [40];
  undefined1 local_38 [48];
  
  FUN_1400bcc20(local_38);
  FUN_1400bc640(local_38,param_1);
  FUN_1400b8c40(local_60);
  FUN_1400b9e30(local_60,local_38);
  FUN_1400b9e90(local_60,param_3);
  uVar1 = FUN_1400c0890(param_2);
  FUN_1400b8b30(param_6);
  uVar2 = FUN_1400b8b80(local_60);
  uVar4 = FUN_1400b8b90(local_60);
  FUN_1400c0a70(uVar4,uVar2,uVar1,param_6);
  if (0 < (int)(param_4 - 1U)) {
    uVar5 = (ulonglong)(param_4 - 1U);
    do {
      FUN_1400b8b30(local_60);
      FUN_1400b9e90(local_60,param_6);
      FUN_1400b8b30(param_6);
      uVar2 = FUN_1400b8b80(local_60);
      uVar4 = FUN_1400b8b90(local_60);
      FUN_1400c0a70(uVar4,uVar2,uVar1,param_6);
      uVar5 = uVar5 - 1;
    } while (uVar5 != 0);
  }
  iVar3 = FUN_1400b8b80(param_6);
  if (0 < iVar3 - param_5) {
    FUN_1400b8be0(param_6,iVar3 - param_5);
  }
  FUN_1400b92d0(local_60);
  FUN_1400bceb0(local_38);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_140103820(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                       undefined8 param_5,undefined4 param_6,undefined8 param_7,undefined8 param_8,
                       longlong *param_9)

{
  char cVar1;
  byte bVar2;
  int iVar3;
  ulonglong uVar4;
  undefined8 uVar5;
  undefined1 auStack_de8 [32];
  undefined4 local_dc8;
  undefined1 *local_dc0;
  longlong *local_db8;
  undefined1 local_da8 [40];
  undefined8 local_d80;
  undefined1 local_d78 [40];
  undefined1 local_d50 [40];
  undefined1 local_d28 [3296];
  ulonglong local_48;
  
  local_d80 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_de8;
  FUN_1400b8b30(param_8);
  FUN_1400b8c40(local_da8);
  local_db8 = param_9;
  local_dc0 = local_da8;
  local_dc8 = 0x10;
  cVar1 = FUN_1401036c0(param_1,param_2,param_5,param_6);
  if (cVar1 == '\0') {
    uVar4 = FUN_1400b92d0(local_da8);
    return uVar4 & 0xffffffffffffff00;
  }
  FUN_1400b0310(local_d28);
  FUN_1400b3440(local_d28,param_3);
  iVar3 = FUN_1400b3430(local_d28);
  if (iVar3 != 7) {
    if (iVar3 != 8) {
      (**(code **)(*param_9 + 0x30))
                (param_9,
                 "Using RC2.  Underlying decryption algorithm for PBES1 must be either DES or RC2.")
      ;
      FUN_1400b3420(local_d28,8);
      iVar3 = 8;
    }
    uVar5 = 0x40;
    if (iVar3 != 7) goto LAB_140103932;
  }
  uVar5 = 0x38;
LAB_140103932:
  FUN_1400b35e0(local_d28,uVar5);
  FUN_1400b0210(local_d28,0);
  FUN_1400b0220(local_d28,0);
  FUN_1400b35d0(local_d28,0x40);
  FUN_1400b8c40(local_d50);
  FUN_1400b8c40(local_d78);
  FUN_1400b9eb0(local_d78,local_da8,0,8);
  FUN_1400b9eb0(local_d50,local_da8,8);
  FUN_1400b0190(local_d28,local_d78);
  FUN_1400b35f0(local_d28,local_d50);
  bVar2 = FUN_1400b66d0(local_d28,param_7,param_8,param_9);
  FUN_1400b92d0(local_d78);
  FUN_1400b92d0(local_d50);
  FUN_1400b0680(local_d28);
  FUN_1400b92d0(local_da8);
  return (ulonglong)bVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_140103a30(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                       undefined4 param_5,undefined8 param_6,undefined8 param_7,longlong *param_8)

{
  char cVar1;
  byte bVar2;
  int iVar3;
  ulonglong uVar4;
  undefined1 auStack_df8 [32];
  longlong *local_dd8;
  undefined1 *local_dd0;
  longlong *local_dc8;
  undefined1 local_db8 [40];
  undefined8 local_d90;
  undefined1 local_d88 [40];
  undefined1 local_d60 [40];
  undefined1 local_d38 [3296];
  ulonglong local_58;
  
  local_d90 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_df8;
  FUN_1400b8b30(param_7);
  FUN_1400b8c40(local_db8);
  local_dc8 = param_8;
  local_dd0 = local_db8;
  local_dd8 = (longlong *)CONCAT44(local_dd8._4_4_,0x10);
  cVar1 = FUN_1401036c0(param_1,param_2,param_4,param_5);
  if (cVar1 == '\0') {
    uVar4 = FUN_1400b92d0(local_db8);
    uVar4 = uVar4 & 0xffffffffffffff00;
  }
  else {
    FUN_1400b0310(local_d38);
    FUN_1400b3440(local_d38,param_3);
    iVar3 = FUN_1400b3430(local_d38);
    if ((iVar3 != 7) && (iVar3 != 8)) {
      (**(code **)(*param_8 + 0x30))
                (param_8,
                 "Using RC2.  Underlying encryption algorithm for PBES1 must be either DES or RC2.")
      ;
      FUN_1400b3420(local_d38,8);
    }
    FUN_1400b35e0(local_d38,0x40);
    FUN_1400b0210(local_d38,0);
    FUN_1400b0220(local_d38,0);
    FUN_1400b35d0(local_d38,0x40);
    FUN_1400b8c40(local_d60);
    FUN_1400b8c40(local_d88);
    FUN_1400b9eb0(local_d88,local_db8,0,8);
    FUN_1400b9eb0(local_d60,local_db8,8);
    FUN_1400b0190(local_d38,local_d88);
    FUN_1400b35f0(local_d38,local_d60);
    local_dd0 = (undefined1 *)((ulonglong)local_dd0 & 0xffffffffffffff00);
    local_dd8 = param_8;
    bVar2 = FUN_1400b6640(local_d38,param_6,param_7,0);
    FUN_1400b92d0(local_d88);
    FUN_1400b92d0(local_d60);
    FUN_1400b0680(local_d38);
    FUN_1400b92d0(local_db8);
    uVar4 = (ulonglong)bVar2;
  }
  return uVar4;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_140103c30(undefined8 param_1,undefined8 param_2,undefined8 param_3,int param_4,
                       undefined4 param_5,undefined8 param_6,undefined4 param_7,undefined8 param_8,
                       undefined8 param_9,undefined8 param_10,undefined8 param_11)

{
  char cVar1;
  byte bVar2;
  ulonglong uVar3;
  undefined1 auStack_db8 [32];
  int local_d98;
  undefined1 *local_d90;
  undefined8 local_d88;
  undefined8 local_d78;
  undefined8 local_d70;
  undefined8 local_d68;
  undefined1 local_d60 [40];
  undefined1 local_d38 [3296];
  ulonglong local_58;
  
  local_d68 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_db8;
  local_d78 = param_8;
  local_d70 = param_9;
  FUN_1400b8b30(param_10);
  FUN_1400b8c40(local_d60);
  local_d88 = param_11;
  local_d90 = local_d60;
  local_d98 = (int)((param_4 >> 0x1f & 7U) + param_4) >> 3;
  cVar1 = FUN_1401033f0(param_1,param_2,param_6,param_7);
  if (cVar1 == '\0') {
    uVar3 = FUN_1400b92d0(local_d60);
    uVar3 = uVar3 & 0xffffffffffffff00;
  }
  else {
    FUN_1400b0310(local_d38);
    FUN_1400b3440(local_d38,param_3);
    FUN_1400b35e0(local_d38,param_4);
    FUN_1400b0210(local_d38,0);
    FUN_1400b0220(local_d38,0);
    FUN_1400b35d0(local_d38,param_5);
    FUN_1400b0190(local_d38,local_d60);
    FUN_1400b35f0(local_d38,local_d78);
    bVar2 = FUN_1400b66d0(local_d38,local_d70,param_10,param_11);
    FUN_1400b0680(local_d38);
    FUN_1400b92d0(local_d60);
    uVar3 = (ulonglong)bVar2;
  }
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_140103de0(undefined8 param_1,undefined8 param_2,undefined8 param_3,int param_4,
                       undefined4 param_5,undefined8 param_6,undefined4 param_7,undefined8 param_8,
                       undefined8 param_9,undefined8 param_10,undefined8 param_11)

{
  char cVar1;
  byte bVar2;
  ulonglong uVar3;
  undefined1 auStack_db8 [32];
  undefined8 local_d98;
  undefined1 *local_d90;
  undefined8 local_d88;
  undefined8 local_d78;
  undefined8 local_d70;
  undefined8 local_d68;
  undefined1 local_d60 [40];
  undefined1 local_d38 [3296];
  ulonglong local_58;
  
  local_d68 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_db8;
  local_d78 = param_8;
  local_d70 = param_9;
  FUN_1400b8b30(param_10);
  FUN_1400b8c40(local_d60);
  local_d88 = param_11;
  local_d90 = local_d60;
  local_d98 = CONCAT44(local_d98._4_4_,(int)((param_4 >> 0x1f & 7U) + param_4) >> 3);
  cVar1 = FUN_1401033f0(param_1,param_2,param_6,param_7);
  if (cVar1 == '\0') {
    uVar3 = FUN_1400b92d0(local_d60);
    uVar3 = uVar3 & 0xffffffffffffff00;
  }
  else {
    FUN_1400b0310(local_d38);
    FUN_1400b3440(local_d38,param_3);
    FUN_1400b35e0(local_d38,param_4);
    FUN_1400b0210(local_d38,0);
    FUN_1400b0220(local_d38,0);
    FUN_1400b35d0(local_d38,param_5);
    FUN_1400b0190(local_d38,local_d60);
    FUN_1400b35f0(local_d38,local_d78);
    local_d90 = (undefined1 *)((ulonglong)local_d90 & 0xffffffffffffff00);
    local_d98 = param_11;
    bVar2 = FUN_1400b6640(local_d38,local_d70,param_10,0);
    FUN_1400b0680(local_d38);
    FUN_1400b92d0(local_d60);
    uVar3 = (ulonglong)bVar2;
  }
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140103fa0(undefined8 param_1,undefined4 param_2,void *param_3,int param_4,int param_5,
                  undefined8 param_6)

{
  undefined4 uVar1;
  undefined8 uVar2;
  int iVar3;
  size_t _Size;
  longlong lVar4;
  undefined1 auStack_248 [32];
  undefined4 local_228;
  undefined1 local_220 [40];
  undefined1 local_1f8 [40];
  undefined8 local_1d0;
  undefined1 local_1c8 [40];
  undefined1 local_1a0 [40];
  byte local_178 [144];
  byte local_e8 [144];
  ulonglong local_58;
  
  local_1d0 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_248;
  local_228 = param_2;
  FUN_1400b8b30(param_6);
  iVar3 = 0x40;
  if (param_5 == 3) {
    iVar3 = 0x80;
  }
  FUN_1400b8c40(local_1a0);
  if (iVar3 < param_4) {
    FUN_1400c0a70(param_3,param_4,param_5,local_1a0);
    param_3 = (void *)FUN_1400b8b90(local_1a0);
    param_4 = FUN_1400c0a30(param_5);
    if (iVar3 < param_4) {
      param_4 = iVar3;
    }
  }
  _Size = (size_t)iVar3;
  memset(local_178,0,_Size);
  memset(local_e8,0,_Size);
  memcpy(local_178,param_3,(longlong)param_4);
  memcpy(local_e8,param_3,(longlong)param_4);
  lVar4 = 0;
  if (iVar3 != 0) {
    do {
      local_178[lVar4] = local_178[lVar4] ^ 0x36;
      local_e8[lVar4] = local_e8[lVar4] ^ 0x5c;
      lVar4 = lVar4 + 1;
    } while (lVar4 < (longlong)_Size);
  }
  FUN_1400b8c40(local_220);
  FUN_1400b97e0(local_220,local_178,iVar3);
  FUN_1400b97e0(local_220,param_1,local_228);
  FUN_1400b8c40(local_1c8);
  uVar1 = FUN_1400b8b80(local_220);
  uVar2 = FUN_1400b8b90(local_220);
  FUN_1400c0a70(uVar2,uVar1,param_5,local_1c8);
  FUN_1400b8c40(local_1f8);
  FUN_1400b97e0(local_1f8,local_e8,iVar3);
  FUN_1400b9e90(local_1f8,local_1c8);
  uVar1 = FUN_1400b8b80(local_1f8);
  uVar2 = FUN_1400b8b90(local_1f8);
  FUN_1400c0a70(uVar2,uVar1,param_5,param_6);
  FUN_1400b92d0(local_1f8);
  FUN_1400b92d0(local_1c8);
  FUN_1400b92d0(local_220);
  FUN_1400b92d0(local_1a0);
  return;
}



undefined8 * FUN_1401041a0(undefined8 *param_1)

{
  longlong lVar1;
  
  *(undefined4 *)(param_1 + 1) = 6;
  *param_1 = ChilkatDeflate::vftable;
  param_1[2] = 0;
  param_1[3] = 0;
  lVar1 = FUN_1400d11d0(60000);
  param_1[4] = lVar1;
  *(uint *)(param_1 + 5) = -(uint)(lVar1 != 0) & 60000;
  return param_1;
}



void FUN_1401041f0(undefined8 *param_1)

{
  undefined8 *puVar1;
  
  *param_1 = ChilkatDeflate::vftable;
  puVar1 = (undefined8 *)param_1[3];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[3] = 0;
  }
  puVar1 = (undefined8 *)param_1[2];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[2] = 0;
  }
  if ((void *)param_1[4] != (void *)0x0) {
    operator_delete((void *)param_1[4]);
    param_1[4] = 0;
  }
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140104260(undefined8 param_1,undefined8 param_2,undefined8 param_3,longlong *param_4)

{
  char cVar1;
  undefined1 auStack_8788 [32];
  char *local_8768;
  longlong *local_8760;
  undefined4 *local_8758;
  char local_8748 [4];
  undefined4 local_8744;
  undefined8 local_8740;
  undefined1 local_8738 [224];
  undefined1 local_8658 [34352];
  ulonglong local_28;
  undefined8 uStack_20;
  
  uStack_20 = 0x14010426e;
  local_8740 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_8788;
  FUN_140137860(local_8658);
  FUN_140137a20(local_8658,0x8000);
  FUN_14012fed0(local_8738,param_3);
  local_8748[0] = '\0';
  local_8758 = &local_8744;
  local_8768 = local_8748;
  local_8760 = param_4;
  cVar1 = FUN_140139120(local_8658,param_2,1,local_8738);
  if (cVar1 == '\0') {
    FUN_1400cf520(param_4,"deflateError",local_8744);
    FUN_14012ff50(local_8738);
  }
  else {
    if (local_8748[0] != '\0') {
      FUN_14012ff50(local_8738);
      FUN_1401379a0(local_8658);
      return 1;
    }
    (**(code **)(*param_4 + 0x28))(param_4,"Deflated data ended prematurely.");
    FUN_14012ff50(local_8738);
  }
  FUN_1401379a0(local_8658);
  return 0;
}



void * FUN_140104390(void *param_1,uint param_2)

{
  FUN_1401041f0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1401043c0(undefined8 *param_1)

{
  *param_1 = Output::vftable;
  return param_1;
}



void FUN_1401043d0(undefined8 *param_1)

{
  *param_1 = Output::vftable;
  return;
}



void FUN_1401043e0(undefined8 param_1,undefined8 param_2)

{
  FUN_1400bdb00(param_2,"unknown");
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401043f0(longlong *param_1)

{
  _DAT_140316f4c = 0x72;
  (**(code **)(*param_1 + 8))();
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined4 FUN_140104420(void)

{
  undefined4 in_R9D;
  
  _DAT_140316f4c = 0x73;
  return in_R9D;
}



undefined4 FUN_140104430(void)

{
  undefined4 in_R9D;
  
  return in_R9D;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140104440(undefined8 *param_1)

{
  _DAT_140316f4c = 0x6f;
  (**(code **)*param_1)();
  _DAT_140316f4c = 0x70;
  return;
}



undefined8 * FUN_140104480(undefined8 *param_1,byte param_2)

{
  *param_1 = Output::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined1 FUN_1401044b0(longlong param_1,undefined8 param_2)

{
  char cVar1;
  
  cVar1 = FUN_140104ae0(param_1 + 0x18);
  if (cVar1 != '\0') {
    FUN_140105950(param_2,param_1 + 0x14,param_1 + 0xc);
    return 1;
  }
  return 0;
}



void FUN_140104500(longlong param_1,undefined8 param_2)

{
  undefined8 uVar1;
  int iVar2;
  
  FUN_1400bdb00(param_2,&DAT_140283d70);
  iVar2 = FUN_1400b80d0(param_1 + 0x30);
  if (iVar2 != 0) {
    FUN_1400bc640(param_2,&DAT_140246168);
    uVar1 = FUN_1400b7ce0(param_1 + 0x30);
    FUN_1400bc640(param_2,uVar1);
  }
  return;
}



void FUN_140104560(longlong param_1)

{
  FUN_140105940(*(undefined4 *)(param_1 + 0x14),*(undefined4 *)(param_1 + 0xc));
  return;
}



void FUN_140104570(longlong param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = FUN_140105940(*(undefined4 *)(param_1 + 0x14),*(undefined4 *)(param_1 + 0xc));
  param_2 = param_2 + lVar1;
  FUN_140105950(param_2,param_1 + 0x14,param_1 + 0xc);
  lVar1 = FUN_140105940(*(undefined4 *)(param_1 + 0x10),*(undefined4 *)(param_1 + 8));
  if (lVar1 < param_2) {
    FUN_140105950(param_2,param_1 + 0x10,param_1 + 8);
  }
  return;
}



uint FUN_1401045f0(longlong param_1,longlong param_2,longlong param_3,uint param_4,longlong param_5,
                  longlong *param_6)

{
  char cVar1;
  char local_res10 [8];
  
  if (((param_2 == 0) || (param_3 == 0)) || (param_4 == 0)) {
    return 0;
  }
  param_3 = (ulonglong)param_4 * param_3;
  if (param_5 != 0) {
    local_res10[0] = '\0';
    FUN_1401030c0(param_5,param_3,local_res10);
    if (local_res10[0] != '\0') {
      (**(code **)(*param_6 + 0x30))(param_6,"Aborted by application.");
      return 0;
    }
  }
  cVar1 = FUN_140104bd0(param_1 + 0x18,param_2,param_3,0,param_6);
  if (cVar1 == '\0') {
    return 0;
  }
  *(longlong *)(param_1 + 0xd0) = *(longlong *)(param_1 + 0xd0) + param_3;
  FUN_140104570(param_1,param_3);
  return param_4;
}



undefined8 * FUN_1401046d0(undefined8 *param_1)

{
  FUN_1401043c0();
  *param_1 = OutputFile::vftable;
  param_1[1] = 0;
  param_1[2] = 0;
  FUN_140104980(param_1 + 3);
  FUN_1400b6fd0(param_1 + 6);
  param_1[0x1a] = 0;
  return param_1;
}



void FUN_140104730(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x14) = *(undefined4 *)(param_1 + 0x10);
  *(undefined4 *)(param_1 + 0xc) = *(undefined4 *)(param_1 + 8);
  FUN_140104a30();
  return;
}



undefined1 FUN_140104750(longlong param_1,undefined8 param_2)

{
  undefined8 uVar1;
  undefined1 uVar2;
  undefined1 local_res8 [8];
  
  *(undefined8 *)(param_1 + 0xd0) = 0;
  if ((*(int *)(param_1 + 0xc) == 0) && (*(int *)(param_1 + 0x14) == 0)) {
    return 1;
  }
  FUN_1401049a0(param_1 + 0x18);
  uVar1 = FUN_1400b7ce0(param_1 + 0x30);
  FUN_1400bf7d0(uVar1,0);
  uVar2 = FUN_1400c0120(param_1 + 0x18,param_1 + 0x30,1,local_res8,param_2);
  return uVar2;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401047d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
                  undefined8 param_5,undefined8 param_6)

{
  _DAT_140316f4c = 0x6e;
  (**(code **)(*param_1 + 8))(param_1,param_2,param_3,param_4,param_5,param_6);
  return;
}



undefined8 FUN_140104810(void)

{
  void *pvVar1;
  undefined8 uVar2;
  
  uVar2 = 0;
  pvVar1 = operator_new(0xd8);
  if (pvVar1 != (void *)0x0) {
    uVar2 = FUN_1401046d0(pvVar1);
  }
  return uVar2;
}



longlong * FUN_140104860(undefined8 param_1,longlong *param_2)

{
  char cVar1;
  longlong *plVar2;
  undefined1 local_res18 [8];
  
  plVar2 = (longlong *)FUN_140104810();
  if (plVar2 == (longlong *)0x0) {
    (**(code **)(*param_2 + 0x28))(param_2,"OutputFile: out of memory for new object. (1)");
    return (longlong *)0x0;
  }
  FUN_1400b7270(plVar2 + 6,param_1);
  FUN_1400bf7d0(param_1,0);
  cVar1 = FUN_1400c0120(plVar2 + 3,plVar2 + 6,1,local_res18,param_2);
  if (cVar1 == '\0') {
    (**(code **)(*plVar2 + 0x10))(plVar2,1);
    plVar2 = (longlong *)0x0;
  }
  return plVar2;
}



undefined8 * FUN_140104910(undefined8 *param_1,uint param_2)

{
  *param_1 = OutputFile::vftable;
  param_1[2] = 0;
  param_1[1] = 0;
  FUN_1400b7090(param_1 + 6);
  FUN_1401049e0(param_1 + 3);
  FUN_1401043d0(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_140104980(undefined8 *param_1)

{
  param_1[1] = 0xffffffffffffffff;
  param_1[2] = 0;
  *param_1 = ChilkatHandle::vftable;
  return param_1;
}



void FUN_1401049a0(longlong param_1)

{
  if (*(HANDLE *)(param_1 + 8) != (HANDLE)0xffffffffffffffff) {
    CloseHandle(*(HANDLE *)(param_1 + 8));
    *(undefined8 *)(param_1 + 8) = 0xffffffffffffffff;
  }
  if (*(FILE **)(param_1 + 0x10) != (FILE *)0x0) {
    fclose(*(FILE **)(param_1 + 0x10));
    *(undefined8 *)(param_1 + 0x10) = 0;
  }
  return;
}



void FUN_1401049e0(undefined8 *param_1)

{
  *param_1 = ChilkatHandle::vftable;
  if ((HANDLE)param_1[1] != (HANDLE)0xffffffffffffffff) {
    CloseHandle((HANDLE)param_1[1]);
    param_1[1] = 0xffffffffffffffff;
  }
  if ((FILE *)param_1[2] != (FILE *)0x0) {
    fclose((FILE *)param_1[2]);
    param_1[2] = 0;
  }
  return;
}



ulonglong FUN_140104a30(longlong param_1,longlong *param_2)

{
  DWORD DVar1;
  int iVar2;
  undefined4 extraout_var;
  ulonglong uVar3;
  undefined4 extraout_var_00;
  LONG local_res8 [2];
  
  if (*(HANDLE *)(param_1 + 8) == (HANDLE)0xffffffffffffffff) {
    uVar3 = 0xffffffffffffffff;
    if (*(FILE **)(param_1 + 0x10) != (FILE *)0x0) {
      iVar2 = fseek(*(FILE **)(param_1 + 0x10),0,2);
      uVar3 = CONCAT44(extraout_var_00,iVar2);
      if (iVar2 == 0) goto LAB_140104aa0;
      if (param_2 != (longlong *)0x0) {
        uVar3 = (**(code **)(*param_2 + 0x28))(param_2,"Failed to fseek to end of file");
      }
    }
  }
  else {
    local_res8[0] = 0;
    DVar1 = SetFilePointer(*(HANDLE *)(param_1 + 8),0,local_res8,2);
    uVar3 = CONCAT44(extraout_var,DVar1);
    if (DVar1 != 0xffffffff) {
LAB_140104aa0:
      return CONCAT71((int7)(uVar3 >> 8),1);
    }
    if (param_2 != (longlong *)0x0) {
      DVar1 = GetLastError();
      (**(code **)(*param_2 + 0x28))(param_2,"Failed to SetFilePointer to end of file.");
      uVar3 = FUN_1400cf710(param_2,DVar1);
      return uVar3 & 0xffffffffffffff00;
    }
  }
  return uVar3 & 0xffffffffffffff00;
}



ulonglong FUN_140104ae0(longlong param_1,undefined8 param_2,longlong *param_3)

{
  DWORD DVar1;
  int iVar2;
  ulonglong in_RAX;
  undefined4 extraout_var;
  undefined4 extraout_var_00;
  LONG local_res8 [2];
  LONG local_res20 [2];
  
  if (*(longlong *)(param_1 + 8) == -1) {
    if (*(FILE **)(param_1 + 0x10) == (FILE *)0x0) goto LAB_140104baf;
    iVar2 = fseek(*(FILE **)(param_1 + 0x10),(long)param_2,0);
    in_RAX = CONCAT44(extraout_var_00,iVar2);
    if (iVar2 == 0) goto LAB_140104b60;
    if (param_3 == (longlong *)0x0) goto LAB_140104baf;
    (**(code **)(*param_3 + 0x28))(param_3,"Failed to fseek to absolute file position");
  }
  else {
    local_res20[0] = 0;
    local_res8[0] = 0;
    FUN_140105950(param_2,local_res20,local_res8);
    DVar1 = SetFilePointer(*(HANDLE *)(param_1 + 8),local_res20[0],local_res8,0);
    in_RAX = CONCAT44(extraout_var,DVar1);
    if (DVar1 != 0xffffffff) {
LAB_140104b60:
      return CONCAT71((int7)(in_RAX >> 8),1);
    }
    if (param_3 == (longlong *)0x0) goto LAB_140104baf;
    DVar1 = GetLastError();
    (**(code **)(*param_3 + 0x28))(param_3,"Failed to SetFilePointer to absolute file position");
    FUN_1400cf710(param_3,DVar1);
  }
  in_RAX = FUN_1400cf580(param_3,"position",param_2);
LAB_140104baf:
  return in_RAX & 0xffffffffffffff00;
}



undefined8
FUN_140104bd0(longlong param_1,LPCVOID param_2,ulonglong param_3,longlong *param_4,longlong *param_5
             )

{
  DWORD DVar1;
  BOOL BVar2;
  size_t sVar3;
  uint uVar4;
  DWORD nNumberOfBytesToWrite;
  size_t _Size;
  DWORD local_res8 [2];
  
  if ((*(longlong *)(param_1 + 8) == -1) && (*(longlong *)(param_1 + 0x10) == 0)) {
    if (param_5 != (longlong *)0x0) {
      (**(code **)(*param_5 + 0x28))(param_5,"Failed to write because file is not open.");
    }
    return 0;
  }
  uVar4 = local_res8[0];
  if (param_4 != (longlong *)0x0) {
    *param_4 = 0;
  }
  do {
    if (param_3 == 0) {
      return 1;
    }
    _Size = param_3 & 0xffffffff;
    if (10000000 < (longlong)param_3) {
      _Size = 10000000;
    }
    nNumberOfBytesToWrite = (DWORD)_Size;
    if (*(HANDLE *)(param_1 + 8) == (HANDLE)0xffffffffffffffff) {
      DVar1 = local_res8[0];
      if ((*(FILE **)(param_1 + 0x10) != (FILE *)0x0) &&
         (sVar3 = fwrite(param_2,_Size,1,*(FILE **)(param_1 + 0x10)), uVar4 = nNumberOfBytesToWrite,
         DVar1 = nNumberOfBytesToWrite, sVar3 != 1)) {
        if (param_5 != (longlong *)0x0) {
          (**(code **)(*param_5 + 0x28))(param_5,"fwrite failed.");
        }
        return 0;
      }
    }
    else {
      local_res8[0] = 0;
      BVar2 = WriteFile(*(HANDLE *)(param_1 + 8),param_2,nNumberOfBytesToWrite,local_res8,
                        (LPOVERLAPPED)0x0);
      if ((BVar2 == 0) ||
         (uVar4 = local_res8[0], DVar1 = local_res8[0], local_res8[0] != nNumberOfBytesToWrite)) {
        if (param_5 != (longlong *)0x0) {
          (**(code **)(*param_5 + 0x48))(param_5,"WriteFileError",1);
          FUN_1400cf640(param_5);
          (**(code **)(*param_5 + 0x50))(param_5);
        }
        return 0;
      }
    }
    local_res8[0] = DVar1;
    param_2 = (LPCVOID)((longlong)param_2 + _Size);
    param_3 = param_3 - _Size;
    if (param_4 != (longlong *)0x0) {
      *param_4 = *param_4 + (ulonglong)uVar4;
    }
  } while( true );
}



DWORD FUN_140104d40(longlong param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  DWORD DVar2;
  int _FileHandle;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 local_40 [56];
  
  uVar4 = 0xfffffffffffffffe;
  if (*(HANDLE *)(param_1 + 8) == (HANDLE)0xffffffffffffffff) {
    if (*(FILE **)(param_1 + 0x10) == (FILE *)0x0) {
      DVar2 = 0xffffffff;
    }
    else {
      _FileHandle = _fileno(*(FILE **)(param_1 + 0x10));
      DVar2 = _filelength(_FileHandle);
    }
  }
  else {
    DVar2 = GetFileSize(*(HANDLE *)(param_1 + 8),(LPDWORD)0x0);
    if ((DVar2 == 0xffffffff) && (param_2 != (longlong *)0x0)) {
      FUN_1400bcc20(local_40);
      FUN_1400bebc0(local_40);
      lVar1 = *param_2;
      uVar3 = FUN_1400b8b90(local_40);
      (**(code **)(lVar1 + 0x28))(param_2,uVar3,param_3,param_4,uVar4);
      (**(code **)(*param_2 + 0x28))(param_2,"Failed to get file size (32)");
      FUN_1400bceb0(local_40);
    }
  }
  return DVar2;
}



longlong FUN_140104e00(longlong param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  DWORD DVar1;
  int _FileHandle;
  longlong lVar2;
  DWORD local_res8 [2];
  undefined8 uVar3;
  undefined1 local_40 [56];
  
  uVar3 = 0xfffffffffffffffe;
  if (*(HANDLE *)(param_1 + 8) == (HANDLE)0xffffffffffffffff) {
    if (*(FILE **)(param_1 + 0x10) != (FILE *)0x0) {
      _FileHandle = _fileno(*(FILE **)(param_1 + 0x10));
      lVar2 = _filelengthi64(_FileHandle);
      return lVar2;
    }
  }
  else {
    local_res8[0] = 0;
    DVar1 = GetFileSize(*(HANDLE *)(param_1 + 8),local_res8);
    if (DVar1 != 0xffffffff) {
      lVar2 = FUN_140105940(DVar1,local_res8[0],param_3,param_4,uVar3);
      return lVar2;
    }
    if (param_2 != (longlong *)0x0) {
      FUN_1400bcc20(local_40);
      FUN_1400bebc0(local_40);
      lVar2 = *param_2;
      uVar3 = FUN_1400b8b90(local_40);
      (**(code **)(lVar2 + 0x28))(param_2,uVar3);
      (**(code **)(*param_2 + 0x28))(param_2,"Failed to get file size (64)");
      FUN_1400bceb0(local_40);
    }
  }
  return -1;
}



undefined8 * FUN_140104ec0(undefined8 *param_1,uint param_2)

{
  *param_1 = ChilkatHandle::vftable;
  if ((HANDLE)param_1[1] != (HANDLE)0xffffffffffffffff) {
    CloseHandle((HANDLE)param_1[1]);
    param_1[1] = 0xffffffffffffffff;
  }
  if ((FILE *)param_1[2] != (FILE *)0x0) {
    fclose((FILE *)param_1[2]);
    param_1[2] = 0;
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140104f30(longlong param_1,longlong param_2)

{
  if (*(HANDLE *)(param_1 + 8) != (HANDLE)0xffffffffffffffff) {
    CloseHandle(*(HANDLE *)(param_1 + 8));
    *(undefined8 *)(param_1 + 8) = 0xffffffffffffffff;
  }
  if (*(FILE **)(param_1 + 0x10) != (FILE *)0x0) {
    fclose(*(FILE **)(param_1 + 0x10));
    *(undefined8 *)(param_1 + 0x10) = 0;
  }
  *(undefined8 *)(param_1 + 8) = *(undefined8 *)(param_2 + 8);
  *(undefined8 *)(param_2 + 8) = 0xffffffffffffffff;
  *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(param_2 + 0x10);
  *(undefined8 *)(param_2 + 0x10) = 0;
  return;
}



ulonglong FUN_140104fa0(longlong param_1,LPVOID param_2,uint param_3,int *param_4,char *param_5,
                       longlong *param_6)

{
  bool bVar1;
  char *pcVar2;
  longlong *plVar3;
  BOOL BVar4;
  DWORD DVar5;
  uint extraout_EAX;
  int iVar6;
  ulonglong uVar7;
  char *pcVar9;
  uint nNumberOfBytesToRead;
  size_t sVar8;
  
  plVar3 = param_6;
  pcVar2 = param_5;
  uVar7 = 0;
  *param_5 = '\0';
  *param_4 = 0;
  if (param_2 == (LPVOID)0x0) {
    if (param_6 != (longlong *)0x0) {
      uVar7 = (**(code **)(*param_6 + 0x28))(param_6,"NULL buf pointer.");
    }
    return uVar7 & 0xffffffffffffff00;
  }
  do {
    uVar7 = 0;
    if (param_3 == 0) break;
    *pcVar2 = '\0';
    nNumberOfBytesToRead = param_3;
    if (0x10000 < param_3) {
      nNumberOfBytesToRead = 0x10000;
    }
    param_5._0_4_ = 0;
    if ((nNumberOfBytesToRead == 0) || (param_2 == (LPVOID)0x0)) {
      if (plVar3 != (longlong *)0x0) {
        pcVar9 = "NULL buf or bufSize";
LAB_140105106:
        (**(code **)(*plVar3 + 0x28))(plVar3,pcVar9);
      }
LAB_14010510f:
      bVar1 = false;
    }
    else {
      if (*(HANDLE *)(param_1 + 8) == (HANDLE)0xffffffffffffffff) {
        if (*(FILE **)(param_1 + 0x10) == (FILE *)0x0) {
          if (plVar3 != (longlong *)0x0) {
            pcVar9 = "No file is open.";
            goto LAB_140105106;
          }
        }
        else {
          sVar8 = fread(param_2,1,(ulonglong)nNumberOfBytesToRead,*(FILE **)(param_1 + 0x10));
          extraout_EAX = (uint)sVar8;
          param_5._0_4_ = extraout_EAX;
          if (extraout_EAX == nNumberOfBytesToRead) {
            bVar1 = true;
            goto LAB_140105111;
          }
          iVar6 = ferror(*(FILE **)(param_1 + 0x10));
          if (iVar6 == 0) goto LAB_140105076;
          if (plVar3 != (longlong *)0x0) {
            FUN_1400cf640();
          }
        }
        goto LAB_14010510f;
      }
      BVar4 = ReadFile(*(HANDLE *)(param_1 + 8),param_2,nNumberOfBytesToRead,(LPDWORD)&param_5,
                       (LPOVERLAPPED)0x0);
      if (BVar4 == 0) {
        DVar5 = GetLastError();
        if (DVar5 != 0x26) {
          if (plVar3 != (longlong *)0x0) {
            FUN_1400cf710(plVar3,DVar5);
          }
          goto LAB_14010510f;
        }
LAB_140105076:
        *pcVar2 = '\x01';
        bVar1 = true;
      }
      else {
        if ((uint)param_5 == 0) {
          *pcVar2 = '\x01';
        }
        bVar1 = true;
      }
    }
LAB_140105111:
    uVar7 = (ulonglong)(uint)param_5;
    *param_4 = *param_4 + (uint)param_5;
    param_3 = param_3 - (uint)param_5;
    param_2 = (LPVOID)((longlong)param_2 + uVar7);
    if (!bVar1) {
      return (ulonglong)(uint3)((uint)param_5 >> 8) << 8;
    }
  } while (*pcVar2 == '\0');
  return CONCAT71((int7)(uVar7 >> 8),1);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x00014010522a)

void FUN_140105160(byte *param_1,uint param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  uint uVar3;
  ulonglong uVar4;
  byte bVar5;
  ulonglong uVar6;
  undefined1 auStack_88 [32];
  byte local_68 [56];
  ulonglong local_30;
  
  if (((param_1 != (byte *)0x0) && (local_30 = DAT_1402f85a0 ^ (ulonglong)auStack_88, param_2 != 0))
     && (uVar4 = 0, param_2 != 0)) {
    uVar6 = (ulonglong)param_2;
    do {
      bVar5 = *param_1;
      iVar2 = isalnum((uint)bVar5);
      if (iVar2 == 0) {
        if (bVar5 == 0x20) {
          local_68[uVar4] = 0x2b;
        }
        else {
          local_68[uVar4] = 0x25;
          uVar3 = (int)uVar4 + 1;
          uVar4 = (ulonglong)uVar3;
          if (uVar3 == 0x32) {
            FUN_1400bc8a0(param_3,local_68,0x32);
            uVar4 = 0;
          }
          cVar1 = '7';
          if (bVar5 >> 4 < 10) {
            cVar1 = '0';
          }
          local_68[uVar4] = (bVar5 >> 4) + cVar1;
          uVar3 = (int)uVar4 + 1;
          uVar4 = (ulonglong)uVar3;
          if (uVar3 == 0x32) {
            FUN_1400bc8a0(param_3,local_68,0x32);
            uVar4 = 0;
          }
          bVar5 = bVar5 & 0xf;
          if (bVar5 < 10) {
            bVar5 = bVar5 + 0x30;
          }
          else {
            bVar5 = bVar5 + 0x37;
          }
          local_68[uVar4] = bVar5;
        }
      }
      else {
        local_68[uVar4] = bVar5;
      }
      uVar3 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar3;
      if (uVar3 == 0x32) {
        FUN_1400bc8a0(param_3,local_68,0x32);
        uVar4 = 0;
      }
      param_1 = param_1 + 1;
      uVar6 = uVar6 - 1;
    } while (uVar6 != 0);
    if ((int)uVar4 != 0) {
      FUN_1400bc8a0(param_3,local_68,uVar4);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401052b0(undefined8 param_1,undefined8 param_2)

{
  byte bVar1;
  byte bVar2;
  char cVar3;
  char *pcVar4;
  longlong lVar5;
  char cVar6;
  int iVar7;
  undefined1 auStack_68 [32];
  char local_48 [56];
  ulonglong local_10;
  
  local_10 = DAT_1402f85a0 ^ (ulonglong)auStack_68;
  pcVar4 = (char *)FUN_1400b8b90();
  iVar7 = 0;
  cVar3 = *pcVar4;
  lVar5 = 0;
  if (cVar3 != '\0') {
    do {
      if (cVar3 == '+') {
        local_48[lVar5] = ' ';
      }
      else {
        if (cVar3 == '%') {
          bVar1 = pcVar4[1];
          if (bVar1 == 0) break;
          bVar2 = pcVar4[2];
          pcVar4 = pcVar4 + 2;
          if (bVar2 == 0) break;
          if ((char)bVar1 < 'A') {
            cVar6 = bVar1 - 0x30;
          }
          else {
            cVar6 = (bVar1 & 0x4f) - 0x37;
          }
          if ((char)bVar2 < 'A') {
            cVar3 = bVar2 - 0x30;
          }
          else {
            cVar3 = (bVar2 & 0x4f) - 0x37;
          }
          cVar3 = cVar3 + cVar6 * '\x10';
        }
        local_48[lVar5] = cVar3;
      }
      iVar7 = iVar7 + 1;
      lVar5 = lVar5 + 1;
      if (iVar7 == 0x32) {
        FUN_1400b97e0(param_2,local_48);
        iVar7 = 0;
        lVar5 = 0;
      }
      cVar3 = pcVar4[1];
      pcVar4 = pcVar4 + 1;
    } while (cVar3 != '\0');
    if (iVar7 != 0) {
      FUN_1400b97e0(param_2,local_48);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x000140105466)

void FUN_140105390(byte *param_1,uint param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  uint uVar3;
  ulonglong uVar4;
  byte bVar5;
  ulonglong uVar6;
  undefined1 auStack_88 [32];
  byte local_68 [56];
  ulonglong local_30;
  
  if (((param_1 != (byte *)0x0) && (local_30 = DAT_1402f85a0 ^ (ulonglong)auStack_88, param_2 != 0))
     && (uVar4 = 0, param_2 != 0)) {
    uVar6 = (ulonglong)param_2;
    do {
      bVar5 = *param_1;
      iVar2 = isalnum((uint)bVar5);
      if (((iVar2 == 0) && (bVar5 != 0x2d)) &&
         ((bVar5 != 0x2e && ((bVar5 != 0x5f && (bVar5 != 0x7e)))))) {
        local_68[uVar4] = 0x25;
        uVar3 = (int)uVar4 + 1;
        uVar4 = (ulonglong)uVar3;
        if (uVar3 == 0x32) {
          FUN_1400bc8a0(param_3,local_68,0x32);
          uVar4 = 0;
        }
        cVar1 = '7';
        if (bVar5 >> 4 < 10) {
          cVar1 = '0';
        }
        local_68[uVar4] = (bVar5 >> 4) + cVar1;
        uVar3 = (int)uVar4 + 1;
        uVar4 = (ulonglong)uVar3;
        if (uVar3 == 0x32) {
          FUN_1400bc8a0(param_3,local_68,0x32);
          uVar4 = 0;
        }
        bVar5 = bVar5 & 0xf;
        if (bVar5 < 10) {
          local_68[uVar4] = bVar5 + 0x30;
        }
        else {
          local_68[uVar4] = bVar5 + 0x37;
        }
      }
      else {
        local_68[uVar4] = bVar5;
      }
      uVar3 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar3;
      if (uVar3 == 0x32) {
        FUN_1400bc8a0(param_3,local_68,0x32);
        uVar4 = 0;
      }
      param_1 = param_1 + 1;
      uVar6 = uVar6 - 1;
    } while (uVar6 != 0);
    if ((int)uVar4 != 0) {
      FUN_1400bc8a0(param_3,local_68,uVar4);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x00014010561c)

void FUN_140105500(byte *param_1,uint param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  uint uVar3;
  ulonglong uVar4;
  byte bVar5;
  ulonglong uVar6;
  undefined1 auStack_88 [32];
  byte local_68 [56];
  ulonglong local_30;
  
  if (((param_1 != (byte *)0x0) && (local_30 = DAT_1402f85a0 ^ (ulonglong)auStack_88, param_2 != 0))
     && (uVar4 = 0, param_2 != 0)) {
    uVar6 = (ulonglong)param_2;
    do {
      bVar5 = *param_1;
      iVar2 = isalnum((uint)bVar5);
      if ((((iVar2 == 0) && (bVar5 != 0x24)) &&
          ((bVar5 != 0x2d && ((bVar5 != 0x5f && (bVar5 != 0x2e)))))) &&
         ((bVar5 != 0x2b &&
          (((((bVar5 != 0x21 && (bVar5 != 0x2a)) && (bVar5 != 0x27)) &&
            ((bVar5 != 0x28 && (bVar5 != 0x29)))) && (bVar5 != 0x2c)))))) {
        local_68[uVar4] = 0x25;
        uVar3 = (int)uVar4 + 1;
        uVar4 = (ulonglong)uVar3;
        if (uVar3 == 0x32) {
          FUN_1400bc8a0(param_3,local_68,0x32);
          uVar4 = 0;
        }
        cVar1 = '7';
        if (bVar5 >> 4 < 10) {
          cVar1 = '0';
        }
        local_68[uVar4] = (bVar5 >> 4) + cVar1;
        uVar3 = (int)uVar4 + 1;
        uVar4 = (ulonglong)uVar3;
        if (uVar3 == 0x32) {
          FUN_1400bc8a0(param_3,local_68,0x32);
          uVar4 = 0;
        }
        bVar5 = bVar5 & 0xf;
        if (bVar5 < 10) {
          local_68[uVar4] = bVar5 + 0x30;
        }
        else {
          local_68[uVar4] = bVar5 + 0x37;
        }
      }
      else {
        local_68[uVar4] = bVar5;
      }
      uVar3 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar3;
      if (uVar3 == 0x32) {
        FUN_1400bc8a0(param_3,local_68,0x32);
        uVar4 = 0;
      }
      param_1 = param_1 + 1;
      uVar6 = uVar6 - 1;
    } while (uVar6 != 0);
    if ((int)uVar4 != 0) {
      FUN_1400bc8a0(param_3,local_68,uVar4);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x0001401057b8)

void FUN_1401056b0(byte *param_1,uint param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  uint uVar3;
  ulonglong uVar4;
  byte bVar5;
  ulonglong uVar6;
  undefined1 auStack_88 [32];
  byte local_68 [56];
  ulonglong local_30;
  
  if (((param_1 != (byte *)0x0) && (local_30 = DAT_1402f85a0 ^ (ulonglong)auStack_88, param_2 != 0))
     && (uVar4 = 0, param_2 != 0)) {
    uVar6 = (ulonglong)param_2;
    do {
      bVar5 = *param_1;
      iVar2 = isalnum((uint)bVar5);
      if ((((iVar2 == 0) && (bVar5 != 0x2d)) &&
          ((bVar5 != 0x5f && ((bVar5 != 0x2e && (bVar5 != 0x21)))))) &&
         ((bVar5 != 0x7e &&
          ((((bVar5 != 0x2a && (bVar5 != 0x27)) && (bVar5 != 0x28)) && (bVar5 != 0x29)))))) {
        local_68[uVar4] = 0x25;
        uVar3 = (int)uVar4 + 1;
        uVar4 = (ulonglong)uVar3;
        if (uVar3 == 0x32) {
          FUN_1400bc8a0(param_3,local_68,0x32);
          uVar4 = 0;
        }
        cVar1 = '7';
        if (bVar5 >> 4 < 10) {
          cVar1 = '0';
        }
        local_68[uVar4] = (bVar5 >> 4) + cVar1;
        uVar3 = (int)uVar4 + 1;
        uVar4 = (ulonglong)uVar3;
        if (uVar3 == 0x32) {
          FUN_1400bc8a0(param_3,local_68,0x32);
          uVar4 = 0;
        }
        bVar5 = bVar5 & 0xf;
        if (bVar5 < 10) {
          local_68[uVar4] = bVar5 + 0x30;
        }
        else {
          local_68[uVar4] = bVar5 + 0x37;
        }
      }
      else {
        local_68[uVar4] = bVar5;
      }
      uVar3 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar3;
      if (uVar3 == 0x32) {
        FUN_1400bc8a0(param_3,local_68,0x32);
        uVar4 = 0;
      }
      param_1 = param_1 + 1;
      uVar6 = uVar6 - 1;
    } while (uVar6 != 0);
    if ((int)uVar4 != 0) {
      FUN_1400bc8a0(param_3,local_68,uVar4);
    }
  }
  return;
}



void FUN_140105850(undefined8 param_1,undefined8 param_2)

{
  undefined8 uVar1;
  undefined4 uVar2;
  
  uVar2 = FUN_1400b8b80();
  uVar1 = FUN_1400b8b90(param_1);
  FUN_140105160(uVar1,uVar2,param_2);
  return;
}



ulonglong FUN_140105890(ushort param_1)

{
  longlong lVar1;
  ushort uVar2;
  ulonglong uVar3;
  longlong lVar4;
  int iVar5;
  longlong lVar6;
  
  if (param_1 == 0) {
    return 0;
  }
  if (0x7f < param_1) {
    if ((ushort)(param_1 - 0xa0) < 0x40) {
      uVar3 = 0xd7;
      if (param_1 != 0xd7) {
        return (ulonglong)(param_1 + 0x20);
      }
    }
    else {
      iVar5 = 0;
      lVar4 = 0;
      lVar6 = (ulonglong)((uint)param_1 % 100) * 200;
      uVar2 = *(ushort *)(&DAT_1402ff680 + lVar6);
      while (uVar2 != 0) {
        if (uVar2 == param_1) {
          return (ulonglong)
                 *(ushort *)((longlong)(&DAT_1402ff680 + lVar6) + (ulonglong)(iVar5 + 1) * 2);
        }
        lVar1 = lVar4 * 2;
        lVar4 = lVar4 + 2;
        iVar5 = iVar5 + 2;
        uVar2 = *(ushort *)(&DAT_1402ff684 + lVar1 + lVar6);
      }
      uVar3 = (ulonglong)param_1;
    }
    return uVar3;
  }
                    // WARNING: Could not recover jumptable at 0x0001401058aa. Too many branches
                    // WARNING: Treating indirect jump as call
  uVar3 = towlower(param_1);
  return uVar3;
}



undefined8 FUN_140105940(undefined4 param_1,undefined4 param_2)

{
  return CONCAT44(param_2,param_1);
}



void FUN_140105950(undefined8 param_1,undefined4 *param_2,undefined4 *param_3)

{
  *param_2 = (int)param_1;
  *param_3 = (int)((ulonglong)param_1 >> 0x20);
  return;
}



bool FUN_140105960(undefined8 param_1)

{
  return (int)((ulonglong)param_1 >> 0x20) != 0;
}



char * FUN_140105970(longlong param_1,char *param_2,uint param_3)

{
  longlong lVar1;
  char cVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  char *pcVar6;
  
  if ((param_3 == 10) && (param_1 < 0)) {
    *param_2 = '-';
    lVar3 = -param_1;
    pcVar5 = param_2 + 1;
    do {
      pcVar4 = pcVar5;
      lVar1 = lVar3 / 10;
      cVar2 = (char)(lVar3 % 10);
      if (lVar3 % 10 < 10) {
        cVar2 = cVar2 + '0';
      }
      else {
        cVar2 = cVar2 + 'W';
      }
      *pcVar4 = cVar2;
      lVar3 = lVar1;
      pcVar5 = pcVar4 + 1;
    } while (0 < lVar1);
    pcVar4[1] = '\0';
    pcVar5 = param_2 + 1;
    do {
      cVar2 = *pcVar4;
      pcVar6 = pcVar5 + 1;
      *pcVar4 = *pcVar5;
      *pcVar5 = cVar2;
      pcVar4 = pcVar4 + -1;
      pcVar5 = pcVar6;
    } while (pcVar6 < pcVar4);
    return param_2;
  }
  pcVar5 = param_2;
  do {
    pcVar4 = pcVar5;
    lVar3 = param_1 / (longlong)(ulonglong)param_3;
    param_1 = param_1 % (longlong)(ulonglong)param_3;
    cVar2 = (char)param_1;
    if (param_1 < 10) {
      cVar2 = cVar2 + '0';
    }
    else {
      cVar2 = cVar2 + 'W';
    }
    *pcVar4 = cVar2;
    param_1 = lVar3;
    pcVar5 = pcVar4 + 1;
  } while (0 < lVar3);
  pcVar4[1] = '\0';
  pcVar5 = param_2;
  do {
    cVar2 = *pcVar4;
    pcVar6 = pcVar5 + 1;
    *pcVar4 = *pcVar5;
    *pcVar5 = cVar2;
    pcVar4 = pcVar4 + -1;
    pcVar5 = pcVar6;
  } while (pcVar6 < pcVar4);
  return param_2;
}



ulonglong FUN_140105a60(ulonglong param_1)

{
  ulonglong uVar1;
  
  uVar1 = param_1 & 0xffffffff;
  if (((longlong)param_1 >> 0x20 & 0xffffffffU) != 0) {
    uVar1 = 0xffffffff;
  }
  return uVar1;
}



undefined8 * FUN_140105a80(undefined8 *param_1)

{
  *param_1 = Uu::vftable;
  FUN_1400bcc20();
  return param_1;
}



void FUN_140105ab0(undefined8 *param_1)

{
  *param_1 = Uu::vftable;
  FUN_1400bceb0();
  return;
}



char * FUN_140105ad0(undefined8 param_1,char *param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  longlong lVar4;
  
  do {
    if ((param_2 == (char *)0x0) || (*param_2 == '\0')) {
      return (char *)0x0;
    }
    pcVar3 = strchr(param_2,10);
    if (pcVar3 == (char *)0x0) {
      lVar4 = -1;
      pcVar3 = param_2;
      do {
        if (lVar4 == 0) break;
        lVar4 = lVar4 + -1;
        cVar1 = *pcVar3;
        pcVar3 = pcVar3 + 1;
      } while (cVar1 != '\0');
      FUN_1400bdb00(param_3,param_2);
      FUN_1400bdd00(param_3,0xd);
      FUN_1400bdd00(param_3,10);
      param_2 = param_2 + (int)(~(uint)lVar4 - 1);
    }
    else {
      FUN_1400bbe30(param_3);
      FUN_1400bc8a0(param_3,param_2,(int)pcVar3 - (int)param_2);
      FUN_1400bdd00(param_3,0xd);
      param_2 = pcVar3 + 1;
    }
    if (param_2 == (char *)0x0) {
      return (char *)0x0;
    }
    pcVar3 = (char *)FUN_1400b8b90(param_3);
    iVar2 = _strnicmp(pcVar3,"begin ",6);
    if (iVar2 == 0) {
      return param_2;
    }
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_140105bc0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5)

{
  byte bVar1;
  byte bVar2;
  byte bVar3;
  char cVar4;
  int iVar5;
  byte *_Str;
  undefined8 uVar6;
  char *pcVar7;
  char *pcVar8;
  void *pvVar9;
  longlong lVar10;
  longlong lVar11;
  uint uVar12;
  byte *pbVar13;
  undefined1 auStack_f8 [40];
  undefined1 local_d0 [48];
  undefined1 local_a0 [48];
  undefined8 local_70;
  char local_68 [40];
  ulonglong local_40;
  
  local_70 = 0xfffffffffffffffe;
  local_40 = DAT_1402f85a0 ^ (ulonglong)auStack_f8;
  FUN_1400bbe30(param_4);
  FUN_1400bbe30(param_5);
  FUN_1400bcc20(local_a0);
  _Str = (byte *)FUN_140105ad0(param_1,param_2,local_a0);
  if (_Str == (byte *)0x0) {
    FUN_1400bceb0(local_a0);
    uVar6 = 0;
  }
  else {
    pcVar7 = (char *)FUN_1400b8b90(local_a0);
    iVar5 = sscanf(pcVar7,"begin %o");
    if (iVar5 == 1) {
      sprintf(local_68,"%o");
      FUN_1400bc640(param_4,local_68);
      pcVar7 = (char *)FUN_1400b8b90(local_a0);
      pcVar7 = strchr(pcVar7,0x20);
      if ((pcVar7 != (char *)0x0) || (pcVar7 = strchr((char *)0x0,9), pcVar7 != (char *)0x0)) {
        for (; (*pcVar7 == ' ' || (*pcVar7 == '\t')); pcVar7 = pcVar7 + 1) {
        }
        pcVar7 = strchr(pcVar7,0x20);
        if ((pcVar7 != (char *)0x0) || (pcVar7 = strchr((char *)0x0,9), pcVar7 != (char *)0x0)) {
          for (; (*pcVar7 == ' ' || (*pcVar7 == '\t')); pcVar7 = pcVar7 + 1) {
          }
          cVar4 = *pcVar7;
          pcVar8 = pcVar7;
          while (((cVar4 != '\0' && (cVar4 != '\r')) && (cVar4 != '\n'))) {
            pcVar8 = pcVar8 + 1;
            cVar4 = *pcVar8;
          }
          FUN_1400bc8a0(param_5,pcVar7,(int)pcVar8 - (int)pcVar7);
        }
      }
      pvVar9 = operator_new(200);
      iVar5 = 0;
      FUN_1400bcc20(local_d0);
      lVar11 = 0;
      while (uVar12 = *_Str - 0x20 & 0x3f, uVar12 != 0) {
        pbVar13 = _Str + 1;
        do {
          bVar1 = pbVar13[1];
          bVar2 = pbVar13[2];
          bVar3 = pbVar13[3];
          if (0 < (int)uVar12) {
            *(byte *)(lVar11 + (longlong)pvVar9) =
                 (byte)((int)(bVar1 - 0x20) >> 4) & 3 | (*pbVar13 - 0x20) * '\x04';
            iVar5 = iVar5 + 1;
            lVar11 = lVar11 + 1;
          }
          if (1 < (int)uVar12) {
            *(byte *)(lVar11 + (longlong)pvVar9) =
                 (byte)((int)(bVar2 - 0x20) >> 2) & 0xf | bVar1 << 4;
            iVar5 = iVar5 + 1;
            lVar11 = lVar11 + 1;
          }
          if (2 < (int)uVar12) {
            *(byte *)(lVar11 + (longlong)pvVar9) = bVar3 - 0x20 & 0x3f | bVar2 << 6;
            iVar5 = iVar5 + 1;
            lVar11 = lVar11 + 1;
          }
          if (0xc3 < iVar5) {
            FUN_1400b97e0(param_3,pvVar9,iVar5);
            iVar5 = 0;
            lVar11 = 0;
          }
          pbVar13 = pbVar13 + 4;
          uVar12 = uVar12 - 3;
        } while (0 < (int)uVar12);
        if (*_Str == 0) {
          pbVar13 = (byte *)0x0;
        }
        else {
          pcVar7 = strchr((char *)_Str,10);
          if (pcVar7 == (char *)0x0) {
            lVar10 = -1;
            pbVar13 = _Str;
            do {
              if (lVar10 == 0) break;
              lVar10 = lVar10 + -1;
              bVar1 = *pbVar13;
              pbVar13 = pbVar13 + 1;
            } while (bVar1 != 0);
            pbVar13 = _Str + (int)(~(uint)lVar10 - 1);
            FUN_1400bdb00(local_d0,_Str);
            FUN_1400bdd00(local_d0,0xd);
            FUN_1400bdd00(local_d0,10);
          }
          else {
            FUN_1400bbe30(local_d0);
            FUN_1400bc8a0(local_d0,_Str,(int)pcVar7 - (int)_Str);
            FUN_1400bdd00(local_d0,0xd);
            pbVar13 = (byte *)(pcVar7 + 1);
          }
        }
        cVar4 = FUN_1400bc7e0(local_d0,&DAT_1402464e8);
        if ((cVar4 != '\0') || (_Str = pbVar13, pbVar13 == (byte *)0x0)) break;
      }
      if (iVar5 != 0) {
        FUN_1400b97e0(param_3,pvVar9,iVar5);
      }
      operator_delete(pvVar9);
      FUN_1400bceb0(local_d0);
      FUN_1400bceb0(local_a0);
      uVar6 = 1;
    }
    else {
      FUN_1400bceb0(local_a0);
      uVar6 = 0;
    }
  }
  return uVar6;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140105f30(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                  undefined8 param_5)

{
  byte bVar1;
  byte bVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  void *_Src;
  void *pvVar6;
  char cVar7;
  uint uVar8;
  char *pcVar9;
  ulonglong uVar10;
  int iVar11;
  byte *pbVar12;
  undefined1 auStack_108 [32];
  undefined1 local_e8 [48];
  undefined1 local_b8 [48];
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 local_70;
  undefined8 local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined1 local_50;
  ulonglong local_48;
  
  local_88 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  iVar4 = FUN_1400b8b80(param_2);
  _Src = (void *)FUN_1400b8b90(param_2);
  if ((_Src != (void *)0x0) && (iVar4 != 0)) {
    FUN_1400bcaa0(local_b8,param_3);
    FUN_1400bcaa0(local_e8,param_4);
    FUN_1400bbc30(local_b8);
    FUN_1400bbc30(local_e8);
    iVar5 = FUN_1400bbb10(local_b8);
    if (iVar5 == 0) {
      FUN_1400bc640(local_b8,&DAT_14020868c);
    }
    iVar5 = FUN_1400bbb10(local_e8);
    if (iVar5 == 0) {
      FUN_1400bc640(local_e8,"file.dat");
    }
    FUN_1400bc640(param_5,"begin ");
    FUN_1400bda40(param_5,local_b8);
    FUN_1400bbe50(param_5,0x20);
    FUN_1400bda40(param_5,local_e8);
    FUN_1400bc640(param_5,&DAT_140208d34);
    pvVar6 = operator_new(200);
    if (0 < iVar4) {
      cVar3 = '`';
      do {
        iVar5 = iVar4;
        if (0x2d < iVar4) {
          iVar5 = 0x2d;
        }
        local_80 = 0;
        local_78 = 0;
        local_70 = 0;
        local_68 = 0;
        local_60 = 0;
        local_58 = 0;
        local_50 = 0;
        memcpy(&local_80,_Src,(longlong)iVar5);
        FUN_1400bbe50(param_5,iVar5 + 0x20);
        iVar11 = 0;
        if (0 < iVar5) {
          pbVar12 = (byte *)((longlong)&local_80 + 1);
          pcVar9 = (char *)((longlong)pvVar6 + 1);
          uVar8 = (iVar5 - 1U) / 3 + 1;
          uVar10 = (ulonglong)uVar8;
          iVar11 = uVar8 * 4;
          do {
            bVar1 = pbVar12[-1];
            pcVar9[-1] = (bVar1 >> 2) + 0x20;
            bVar2 = *pbVar12;
            cVar7 = (bVar2 >> 4 | (bVar1 & 3) << 4) + 0x20;
            if (cVar7 == ' ') {
              cVar7 = cVar3;
            }
            *pcVar9 = cVar7;
            bVar1 = pbVar12[1];
            cVar7 = (bVar1 >> 6 | (bVar2 & 0xf) << 2) + 0x20;
            if (cVar7 == ' ') {
              cVar7 = cVar3;
            }
            pcVar9[1] = cVar7;
            cVar7 = (bVar1 & 0x3f) + 0x20;
            if (cVar7 == ' ') {
              cVar7 = cVar3;
            }
            pcVar9[2] = cVar7;
            pcVar9 = pcVar9 + 4;
            pbVar12 = pbVar12 + 3;
            uVar10 = uVar10 - 1;
          } while (uVar10 != 0);
        }
        FUN_1400bc8a0(param_5,pvVar6,iVar11);
        FUN_1400bbe50(param_5,0xd);
        FUN_1400bbe50(param_5,10);
        iVar4 = iVar4 - iVar5;
        _Src = (void *)((longlong)_Src + (longlong)iVar5);
      } while (0 < iVar4);
    }
    cVar3 = FUN_1400bdcd0(param_5);
    if (cVar3 != '\n') {
      FUN_1400bc640(param_5,&DAT_140208d34);
    }
    FUN_1400bc640(param_5,"`\r\nend\r\n");
    operator_delete(pvVar6);
    FUN_1400bceb0(local_e8);
    FUN_1400bceb0(local_b8);
  }
  return;
}



undefined8 * FUN_140106230(undefined8 *param_1,uint param_2)

{
  *param_1 = Uu::vftable;
  FUN_1400bceb0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 *
FUN_140106270(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  *param_1 = ParseEngine::vftable;
  FUN_1400bcc20(param_1 + 1);
  *(undefined4 *)(param_1 + 8) = 0;
  uVar1 = FUN_1400bbb20(param_1 + 1,0,param_3,param_4,uVar1);
  param_1[7] = uVar1;
  return param_1;
}



undefined8 *
FUN_1401062d0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  *param_1 = ParseEngine::vftable;
  FUN_1400bcc20(param_1 + 1);
  *(undefined4 *)(param_1 + 8) = 0;
  uVar1 = FUN_1400b8b80(param_2);
  uVar2 = FUN_1400b8b90(param_2);
  FUN_1400bc8a0(param_1 + 1,uVar2,uVar1,param_4,uVar3);
  uVar2 = FUN_1400bbb20(param_1 + 1,0);
  param_1[7] = uVar2;
  return param_1;
}



void FUN_140106360(undefined8 *param_1)

{
  *param_1 = ParseEngine::vftable;
  FUN_1400bceb0();
  return;
}



void FUN_140106380(longlong param_1,char param_2)

{
  char *pcVar1;
  char cVar2;
  char *pcVar3;
  
  pcVar3 = (char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
  cVar2 = *pcVar3;
  while ((cVar2 != '\0' && (cVar2 != param_2))) {
    *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
    pcVar1 = pcVar3 + 1;
    pcVar3 = pcVar3 + 1;
    cVar2 = *pcVar1;
  }
  return;
}



undefined8 FUN_1401063b0(longlong param_1,char param_2,char param_3)

{
  char cVar1;
  char *pcVar2;
  
  pcVar2 = (char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
  cVar1 = *pcVar2;
  while( true ) {
    if (cVar1 == '\0') {
      return 1;
    }
    if (cVar1 == param_3) break;
    if (cVar1 == param_2) {
      return 1;
    }
    *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
    cVar1 = pcVar2[1];
    pcVar2 = pcVar2 + 1;
  }
  return 0;
}



int FUN_1401063e0(longlong param_1,char *param_2,undefined8 param_3)

{
  char *pcVar1;
  char cVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  longlong lVar6;
  char *pcVar7;
  char *pcVar8;
  
  if (param_2 == (char *)0x0) {
    return 0;
  }
  lVar6 = -1;
  iVar3 = 0;
  pcVar8 = param_2;
  do {
    if (lVar6 == 0) break;
    lVar6 = lVar6 + -1;
    cVar2 = *pcVar8;
    pcVar8 = pcVar8 + 1;
  } while (cVar2 != '\0');
  iVar4 = ~(uint)lVar6 - 1;
  if (iVar4 != 0) {
    iVar3 = *(int *)(param_1 + 0x40);
    pcVar7 = (char *)((longlong)iVar3 + *(longlong *)(param_1 + 0x38));
    cVar2 = *pcVar7;
    pcVar8 = pcVar7;
    while (cVar2 != '\0') {
      iVar5 = 0;
      lVar6 = 0;
      if (0 < iVar4) {
        do {
          if (param_2[lVar6] == cVar2) break;
          lVar6 = lVar6 + 1;
          iVar5 = iVar5 + 1;
        } while (lVar6 < iVar4);
      }
      if (iVar5 != iVar4) break;
      *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
      pcVar1 = pcVar8 + 1;
      pcVar8 = pcVar8 + 1;
      cVar2 = *pcVar1;
    }
    FUN_1400bc8a0(param_3,pcVar7,*(int *)(param_1 + 0x40) - iVar3);
    iVar3 = *(int *)(param_1 + 0x40) - iVar3;
  }
  return iVar3;
}



void FUN_1401064a0(longlong param_1,longlong param_2)

{
  undefined8 uVar1;
  
  if (param_2 != 0) {
    FUN_1400bc640(param_1 + 8);
    uVar1 = FUN_1400bbb20(param_1 + 8,0);
    *(undefined8 *)(param_1 + 0x38) = uVar1;
  }
  return;
}



void FUN_1401064e0(longlong param_1,char *param_2,undefined8 param_3)

{
  char cVar1;
  char *pcVar2;
  char *pcVar3;
  
  pcVar2 = (char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
  cVar1 = *pcVar2;
  pcVar3 = pcVar2;
  if (cVar1 != '\0') {
    do {
      if ((((*param_2 == cVar1) || (param_2[1] == cVar1)) || (param_2[2] == cVar1)) ||
         (((param_2[3] == cVar1 || (param_2[4] == cVar1)) ||
          ((param_2[5] == cVar1 || (param_2[6] == cVar1)))))) break;
      cVar1 = pcVar3[1];
      pcVar3 = pcVar3 + 1;
    } while (cVar1 != '\0');
  }
  *(int *)(param_1 + 0x40) = (*(int *)(param_1 + 0x40) - (int)pcVar2) + (int)pcVar3;
  FUN_1400bc8a0(param_3,pcVar2,(int)pcVar3 - (int)pcVar2);
  return;
}



void FUN_140106550(longlong param_1,char *param_2,undefined8 param_3)

{
  char cVar1;
  char *pcVar2;
  char *pcVar3;
  
  pcVar2 = (char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
  cVar1 = *pcVar2;
  pcVar3 = pcVar2;
  if (cVar1 != '\0') {
    do {
      if ((((*param_2 == cVar1) || (param_2[1] == cVar1)) || (param_2[2] == cVar1)) ||
         ((param_2[3] == cVar1 || (param_2[4] == cVar1)))) break;
      cVar1 = pcVar3[1];
      pcVar3 = pcVar3 + 1;
    } while (cVar1 != '\0');
  }
  *(int *)(param_1 + 0x40) = (*(int *)(param_1 + 0x40) - (int)pcVar2) + (int)pcVar3;
  FUN_1400bc8a0(param_3,pcVar2,(int)pcVar3 - (int)pcVar2);
  return;
}



void FUN_1401065c0(longlong param_1,char *param_2,undefined8 param_3)

{
  char cVar1;
  char *pcVar2;
  char *pcVar3;
  
  pcVar2 = (char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
  cVar1 = *pcVar2;
  pcVar3 = pcVar2;
  if (cVar1 != '\0') {
    do {
      if ((*param_2 == cVar1) || (param_2[1] == cVar1)) break;
      cVar1 = pcVar3[1];
      pcVar3 = pcVar3 + 1;
    } while (cVar1 != '\0');
  }
  *(int *)(param_1 + 0x40) = (*(int *)(param_1 + 0x40) - (int)pcVar2) + (int)pcVar3;
  FUN_1400bc8a0(param_3,pcVar2,(int)pcVar3 - (int)pcVar2);
  return;
}



void FUN_140106620(longlong param_1,char param_2,undefined8 param_3)

{
  char *pcVar1;
  char *pcVar2;
  char cVar3;
  int iVar4;
  char *pcVar5;
  
  iVar4 = *(int *)(param_1 + 0x40);
  pcVar2 = (char *)(*(longlong *)(param_1 + 0x38) + (longlong)iVar4);
  cVar3 = *pcVar2;
  pcVar5 = pcVar2;
  while ((cVar3 != '\0' && (cVar3 != param_2))) {
    *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
    pcVar1 = pcVar5 + 1;
    pcVar5 = pcVar5 + 1;
    cVar3 = *pcVar1;
  }
  FUN_1400bc8a0(param_3,pcVar2,*(int *)(param_1 + 0x40) - iVar4);
  return;
}



bool FUN_140106670(longlong param_1,char param_2,char param_3,int param_4,undefined8 param_5)

{
  char *pcVar1;
  
  for (pcVar1 = (char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
      (param_4 != 0 && (*pcVar1 != '\0')); pcVar1 = pcVar1 + 1) {
    FUN_1400bbe50(param_5);
    if (*pcVar1 == param_3) {
      param_4 = param_4 + -1;
    }
    else if (*pcVar1 == param_2) {
      param_4 = param_4 + 1;
    }
    *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
  }
  return param_4 == 0;
}



undefined8 FUN_1401066f0(longlong param_1,char *param_2,undefined8 param_3)

{
  char cVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong lVar4;
  longlong lVar5;
  int iVar6;
  
  lVar5 = (longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38);
  lVar2 = FUN_1400d0f20();
  uVar3 = 0;
  if (lVar2 != 0) {
    lVar4 = -1;
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      cVar1 = *param_2;
      param_2 = param_2 + 1;
    } while (cVar1 != '\0');
    iVar6 = ((int)lVar2 - (int)lVar5) + -1 + ~(uint)lVar4;
    FUN_1400bc8a0(param_3,lVar5,iVar6);
    *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + iVar6;
    uVar3 = 1;
  }
  return uVar3;
}



undefined8 FUN_140106760(longlong param_1,char *param_2)

{
  char cVar1;
  char *pcVar2;
  longlong lVar3;
  char *_Str;
  
  _Str = (char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
  pcVar2 = strstr(_Str,param_2);
  if (pcVar2 == (char *)0x0) {
    return 0;
  }
  lVar3 = -1;
  do {
    if (lVar3 == 0) break;
    lVar3 = lVar3 + -1;
    cVar1 = *param_2;
    param_2 = param_2 + 1;
  } while (cVar1 != '\0');
  *(int *)(param_1 + 0x40) =
       *(int *)(param_1 + 0x40) + (~(uint)lVar3 - 1) + ((int)pcVar2 - (int)_Str);
  return 1;
}



undefined8 * FUN_1401067d0(undefined8 *param_1,uint param_2)

{
  *param_1 = ParseEngine::vftable;
  FUN_1400bceb0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_140106810(undefined8 *param_1,char *param_2,char *param_3)

{
  undefined8 uVar1;
  
  FUN_1400d0eb0();
  *param_1 = StringPair::vftable;
  param_1[2] = 0;
  param_1[3] = 0;
  if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
    uVar1 = FUN_1400bcbb0(param_2);
    param_1[2] = uVar1;
  }
  if ((param_3 != (char *)0x0) && (*param_3 != '\0')) {
    uVar1 = FUN_1400bcbb0(param_3);
    param_1[3] = uVar1;
  }
  return param_1;
}



undefined1 * FUN_1401068a0(longlong param_1)

{
  undefined1 *puVar1;
  
  if (*(longlong *)(param_1 + 0x10) == 0) {
    return &DAT_14027a10a;
  }
  puVar1 = (undefined1 *)FUN_1400b8b90();
  return puVar1;
}



undefined8 * FUN_1401068c0(undefined8 *param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  
  *param_1 = StringPair::vftable;
  puVar1 = (undefined8 *)param_1[2];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,0xfffffffffffffffe);
    param_1[2] = 0;
  }
  puVar1 = (undefined8 *)param_1[3];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[3] = 0;
  }
  FUN_1400d0ee0(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_140106950(undefined8 *param_1)

{
  *param_1 = WindowsVersion::vftable;
  ((LPOSVERSIONINFOA)(param_1 + 1))->dwOSVersionInfoSize = 0x94;
  GetVersionExA((LPOSVERSIONINFOA)(param_1 + 1));
  return param_1;
}



void FUN_140106980(undefined8 *param_1)

{
  *param_1 = WindowsVersion::vftable;
  return;
}



bool FUN_140106990(longlong param_1)

{
  return *(int *)(param_1 + 0xc) == 4;
}



undefined8 * FUN_1401069a0(undefined8 *param_1,byte param_2)

{
  *param_1 = WindowsVersion::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 *
FUN_1401069d0(undefined8 param_1,undefined8 param_2,undefined4 param_3,int param_4,
             undefined8 param_5,undefined4 param_6,undefined4 param_7,undefined8 param_8,
             DWORD *param_9,longlong *param_10)

{
  longlong lVar1;
  DWORD DVar2;
  undefined8 uVar3;
  void *pvVar4;
  undefined8 *puVar5;
  undefined8 uVar6;
  int iVar7;
  undefined1 local_128 [48];
  undefined1 local_f8 [48];
  undefined1 local_c8 [160];
  
  *param_9 = 0;
  FUN_1400bcaa0(local_f8);
  FUN_1400bbda0(local_f8,0x2f,0x5c);
  uVar3 = FUN_1400b8b90(local_f8);
  pvVar4 = operator_new(0x18);
  if (pvVar4 == (void *)0x0) {
    puVar5 = (undefined8 *)0x0;
  }
  else {
    puVar5 = (undefined8 *)FUN_140104980(pvVar4);
  }
  iVar7 = 0;
  uVar6 = FUN_1400bf150(uVar3,param_3,param_4,param_5,param_6,param_7,param_8);
  puVar5[1] = uVar6;
  do {
    if (puVar5[1] != -1) goto LAB_140106bf5;
    DVar2 = GetLastError();
    *param_9 = DVar2;
    if (DVar2 != 0x20) break;
    if (param_4 == 1) {
      param_4 = 3;
    }
    iVar7 = iVar7 + 1;
    Sleep(0x32);
    uVar6 = FUN_1400bf150(uVar3,param_3,param_4,param_5,param_6,param_7,param_8);
    puVar5[1] = uVar6;
  } while (iVar7 < 3);
  if (puVar5[1] == -1) {
    DVar2 = GetLastError();
    *param_9 = DVar2;
    if (param_10 != (longlong *)0x0) {
      FUN_1400bcc20(local_128);
      FUN_1400bebc0(local_128);
      (**(code **)(*param_10 + 0x28))(param_10,"Failed to open file (2)");
      (**(code **)(*param_10 + 0x58))(param_10,"localFilePath",uVar3);
      FUN_1400b6fd0(local_c8);
      FUN_1400beda0(local_c8);
      lVar1 = *param_10;
      uVar3 = FUN_1400b7ce0(local_c8);
      (**(code **)(lVar1 + 0x58))(param_10,"currentWorkingDirectory",uVar3);
      lVar1 = *param_10;
      uVar3 = FUN_1400b8b90(local_128);
      (**(code **)(lVar1 + 0x58))(param_10,"osErrorInfo",uVar3);
      FUN_1400b7090(local_c8);
      FUN_1400bceb0(local_128);
    }
    (**(code **)*puVar5)(puVar5,1);
    puVar5 = (undefined8 *)0x0;
  }
LAB_140106bf5:
  FUN_1400bceb0(local_f8);
  return puVar5;
}



undefined8 *
FUN_140106c30(undefined8 param_1,undefined8 param_2,DWORD param_3,DWORD param_4,
             LPSECURITY_ATTRIBUTES param_5,DWORD param_6,DWORD param_7,HANDLE param_8,DWORD *param_9
             ,longlong *param_10)

{
  longlong lVar1;
  DWORD DVar2;
  LPCWSTR lpFileName;
  void *pvVar3;
  undefined8 *puVar4;
  HANDLE pvVar5;
  undefined8 uVar6;
  int iVar7;
  undefined1 local_198 [48];
  undefined1 local_168 [160];
  undefined1 local_c8 [160];
  
  *param_9 = 0;
  FUN_1400b6fd0(local_168);
  FUN_1400b7bf0(local_168,param_2);
  FUN_1400b81c0(local_168,0x2f,0x5c);
  lpFileName = (LPCWSTR)FUN_1400b7580(local_168);
  pvVar3 = operator_new(0x18);
  if (pvVar3 == (void *)0x0) {
    puVar4 = (undefined8 *)0x0;
  }
  else {
    puVar4 = (undefined8 *)FUN_140104980(pvVar3);
  }
  iVar7 = 0;
  pvVar5 = CreateFileW(lpFileName,param_3,param_4,param_5,param_6,param_7,param_8);
  puVar4[1] = pvVar5;
  do {
    if (puVar4[1] != -1) goto LAB_140106e57;
    DVar2 = GetLastError();
    *param_9 = DVar2;
    if (DVar2 != 0x20) break;
    iVar7 = iVar7 + 1;
    Sleep(0x32);
    pvVar5 = CreateFileW(lpFileName,param_3,param_4,param_5,param_6,param_7,param_8);
    puVar4[1] = pvVar5;
  } while (iVar7 < 3);
  if (puVar4[1] == -1) {
    DVar2 = GetLastError();
    *param_9 = DVar2;
    if (param_10 != (longlong *)0x0) {
      FUN_1400bcc20(local_198);
      FUN_1400bebc0(local_198);
      (**(code **)(*param_10 + 0x28))(param_10,"Failed to open file (3)");
      FUN_1400b6fd0(local_c8);
      FUN_1400b7450(local_c8,lpFileName);
      lVar1 = *param_10;
      uVar6 = FUN_1400b7ce0(local_c8);
      (**(code **)(lVar1 + 0x58))(param_10,"utf8Filename",uVar6);
      lVar1 = *param_10;
      uVar6 = FUN_1400b8b90(local_198);
      (**(code **)(lVar1 + 0x58))(param_10,"osErrorInfo",uVar6);
      FUN_1400b7090(local_c8);
      FUN_1400bceb0(local_198);
    }
    (**(code **)*puVar4)(puVar4,1);
    puVar4 = (undefined8 *)0x0;
  }
LAB_140106e57:
  FUN_1400b7090(local_168);
  return puVar4;
}



ulonglong FUN_140106e90(DWORD param_1,BYTE *param_2)

{
  BOOL BVar1;
  ulonglong in_RAX;
  HCRYPTPROV hProv;
  ulonglong uVar2;
  
  if ((-1 < (int)param_1) && (param_2 != (BYTE *)0x0)) {
    hProv = FUN_1400ce9b0();
    uVar2 = 0;
    if (hProv != 0) {
      BVar1 = CryptGenRandom(hProv,param_1,param_2);
      CryptReleaseContext(hProv,0);
      uVar2 = (ulonglong)(BVar1 != 0);
    }
    return uVar2;
  }
  return in_RAX & 0xffffffffffffff00;
}



undefined8 FUN_140106f10(int param_1,undefined8 param_2)

{
  FUN_1400bbe30(param_2);
  if (param_1 == 0x4e9f) {
    FUN_1400bc640(param_2,"us-ascii");
    return 1;
  }
  if (param_1 == 0x4b0) {
    FUN_1400bc640(param_2,"unicode");
    return 1;
  }
  if (param_1 == 0x4b1) {
    FUN_1400bc640(param_2,"unicodefffe");
    return 1;
  }
  if (param_1 - 0x6fafU < 0xf) {
    if (param_1 == 0x6faf) {
      FUN_1400bc640(param_2,&DAT_140246d08);
      return 1;
    }
    if (param_1 == 0x6fb0) {
      FUN_1400bc640(param_2,&DAT_140246cf8);
      return 1;
    }
    if (param_1 == 0x6fb1) {
      FUN_1400bc640(param_2,&DAT_140246ce8);
      return 1;
    }
    if (param_1 == 0x6fb2) {
      FUN_1400bc640(param_2,&DAT_140246cd8);
      return 1;
    }
    if (param_1 == 0x6fb3) {
      FUN_1400bc640(param_2,&DAT_140246cc8);
      return 1;
    }
    if (param_1 == 0x6fb4) {
      FUN_1400bc640(param_2,&DAT_1402455f8);
      return 1;
    }
    if (param_1 == 0x6fb5) {
      FUN_1400bc640(param_2,&DAT_140246cb8);
      return 1;
    }
    if (param_1 == 0x6fb6) {
      FUN_1400bc640(param_2,&DAT_140246ca8);
      return 1;
    }
    if (param_1 == 0x6fb7) {
      FUN_1400bc640(param_2,&DAT_140245618);
      return 1;
    }
    if (param_1 == 0x6fbb) {
      FUN_1400bc640(param_2,&DAT_140246c98);
      return 1;
    }
    if (param_1 == 0x6fbd) {
      FUN_1400bc640(param_2,&DAT_140246c88);
      return 1;
    }
  }
  else if (param_1 - 0x4e2U < 9) {
    if (param_1 == 0x4e2) {
      FUN_1400bc640(param_2,"windows-1250");
      return 1;
    }
    if (param_1 == 0x4e3) {
      FUN_1400bc640(param_2,"windows-1251");
      return 1;
    }
    if (param_1 == 0x4e4) {
      FUN_1400bc640(param_2,"windows-1252");
      return 1;
    }
    if (param_1 == 0x4e5) {
      FUN_1400bc640(param_2,"windows-1253");
      return 1;
    }
    if (param_1 == 0x4e6) {
      FUN_1400bc640(param_2,"windows-1254");
      return 1;
    }
    if (param_1 == 0x4e7) {
      FUN_1400bc640(param_2,"windows-1255");
      return 1;
    }
    if (param_1 == 0x4e8) {
      FUN_1400bc640(param_2,"windows-1256");
      return 1;
    }
    if (param_1 == 0x4e9) {
      FUN_1400bc640(param_2,"windows-1257");
      return 1;
    }
    if (param_1 == 0x4ea) {
      FUN_1400bc640(param_2,"windows-1258");
      return 1;
    }
  }
  else if (param_1 < 65000) {
    if (param_1 - 0x3a4U < 0x13) {
      if (param_1 == 0x3a4) {
        FUN_1400bc640(param_2,"shift_jis");
        return 1;
      }
      if (param_1 == 0x3a8) {
        FUN_1400bc640(param_2,&DAT_140245664);
        return 1;
      }
      if (param_1 == 0x3b5) {
        FUN_1400bc640(param_2,"ks_c_5601-1987");
        return 1;
      }
      if (param_1 == 0x3b6) {
        FUN_1400bc640(param_2,&DAT_140245640);
        return 1;
      }
    }
    else {
      if (param_1 - 0xc42cU < 0x126d) {
        if (param_1 != 0xc42c) {
          if (param_1 == 0xc42d) {
            FUN_1400bc640(param_2,&DAT_140246bd8);
            return 1;
          }
          if (param_1 != 0xc42e) {
            if (param_1 == 0xc431) {
              FUN_1400bc640(param_2,&DAT_140245670);
              return 1;
            }
            if (param_1 == 0xc433) {
              FUN_1400bc640(param_2,&DAT_140246bc8);
              return 1;
            }
            if (param_1 != 0xcadc) {
              if (param_1 == 0xcae0) {
                FUN_1400bc640(param_2,&DAT_140245650);
                return 1;
              }
              if (param_1 == 0xcaed) {
                FUN_1400bc640(param_2,&DAT_14024567c);
                return 1;
              }
              if (param_1 == 0xcec8) {
                FUN_1400bc640(param_2,&DAT_140245658);
                return 1;
              }
              if (param_1 != 0xd698) {
                return 0;
              }
              FUN_1400bc640(param_2,&DAT_140246bc0);
              return 1;
            }
LAB_140107477:
            FUN_1400bc640(param_2,&DAT_140245684);
            return 1;
          }
        }
        FUN_1400bc640(param_2,&DAT_140245690);
        return 1;
      }
      if (param_1 - 10000U < 0x53) {
        if (param_1 == 10000) {
          FUN_1400bc640(param_2,"macintosh");
          return 1;
        }
        if (param_1 == 0x2711) {
          FUN_1400bc640(param_2,"x-mac-japanese");
          return 1;
        }
        if (param_1 == 0x2712) {
          FUN_1400bc640(param_2,"x-mac-chinesetrad");
          return 1;
        }
        if (param_1 == 0x2713) {
          FUN_1400bc640(param_2,"x-mac-korean");
          return 1;
        }
        if (param_1 == 0x2714) {
          FUN_1400bc640(param_2,"x-mac-arabic");
          return 1;
        }
        if (param_1 == 0x2715) {
          FUN_1400bc640(param_2,"x-mac-hebrew");
          return 1;
        }
        if (param_1 == 0x2716) {
          FUN_1400bc640(param_2,"x-mac-greek");
          return 1;
        }
        if (param_1 == 0x2717) {
          FUN_1400bc640(param_2,"x-mac-cyrillic");
          return 1;
        }
        if (param_1 == 0x2718) {
          FUN_1400bc640(param_2,"x-mac-chinesesimp");
          return 1;
        }
        if (param_1 == 0x271a) {
          FUN_1400bc640(param_2,"x-mac-romanian");
          return 1;
        }
        if (param_1 == 0x2721) {
          FUN_1400bc640(param_2,"x-mac-ukrainian");
          return 1;
        }
        if (param_1 == 0x2725) {
          FUN_1400bc640(param_2,"x-mac-thai");
          return 1;
        }
        if (param_1 == 0x272d) {
          FUN_1400bc640(param_2,"x-mac-ce");
          return 1;
        }
        if (param_1 == 0x275f) {
          FUN_1400bc640(param_2,"x-mac-icelandic");
          return 1;
        }
        if (param_1 == 0x2761) {
          FUN_1400bc640(param_2,"x-mac-turkish");
          return 1;
        }
        if (param_1 == 0x2762) {
          FUN_1400bc640(param_2,"x-mac-croatian");
          return 1;
        }
      }
      else if (param_1 - 0x25U < 0x347) {
        if (param_1 == 0x25) {
          FUN_1400bc640(param_2,&DAT_140246aa4);
          return 1;
        }
        if (param_1 == 0x1b5) {
          FUN_1400bc640(param_2,&DAT_140246a9c);
          return 1;
        }
        if (param_1 == 500) {
          FUN_1400bc640(param_2,&DAT_140246a94);
          return 1;
        }
        if (param_1 == 0x2c4) {
          FUN_1400bc640(param_2,&DAT_140246a88);
          return 1;
        }
        if (param_1 == 0x2d0) {
          FUN_1400bc640(param_2,&DAT_140246a80);
          return 1;
        }
        if (param_1 == 0x2e1) {
          FUN_1400bc640(param_2,&DAT_140246a74);
          return 1;
        }
        if (param_1 == 0x307) {
          FUN_1400bc640(param_2,&DAT_140246a6c);
          return 1;
        }
        if (param_1 == 0x352) {
          FUN_1400bc640(param_2,&DAT_140246a64);
          return 1;
        }
        if (param_1 == 0x354) {
          FUN_1400bc640(param_2,&DAT_140246a5c);
          return 1;
        }
        if (param_1 == 0x357) {
          FUN_1400bc640(param_2,&DAT_140246a54);
          return 1;
        }
        if (param_1 == 0x359) {
          FUN_1400bc640(param_2,&DAT_140246a4c);
          return 1;
        }
        if (param_1 == 0x35a) {
          FUN_1400bc640(param_2,&DAT_140246a40);
          return 1;
        }
        if (param_1 == 0x35c) {
          FUN_1400bc640(param_2,&DAT_140246a38);
          return 1;
        }
        if (param_1 == 0x35d) {
          FUN_1400bc640(param_2,&DAT_140246a30);
          return 1;
        }
        if (param_1 == 0x35e) {
          FUN_1400bc640(param_2,&DAT_140246a28);
          return 1;
        }
        if (param_1 == 0x35f) {
          FUN_1400bc640(param_2,&DAT_140246a20);
          return 1;
        }
        if (param_1 == 0x360) {
          FUN_1400bc640(param_2,&DAT_140246a18);
          return 1;
        }
        if (param_1 == 0x361) {
          FUN_1400bc640(param_2,&DAT_140246a10);
          return 1;
        }
        if (param_1 == 0x362) {
          FUN_1400bc640(param_2,&DAT_140246a08);
          return 1;
        }
        if (param_1 == 0x365) {
          FUN_1400bc640(param_2,&DAT_140246a00);
          return 1;
        }
        if (param_1 == 0x366) {
          FUN_1400bc640(param_2,&DAT_1402469f8);
          return 1;
        }
        if (param_1 == 0x36a) {
          FUN_1400bc640(param_2,"windows-874");
          return 1;
        }
        if (param_1 == 0x36b) {
          FUN_1400bc640(param_2,&DAT_1402469f0);
          return 1;
        }
      }
      else if (param_1 - 0x402U < 0x7c) {
        if (param_1 == 0x402) {
          FUN_1400bc640(param_2,&DAT_1402469e8);
          return 1;
        }
        if (param_1 == 0x417) {
          FUN_1400bc640(param_2,&DAT_1402469d8);
          return 1;
        }
        if (param_1 == 0x474) {
          FUN_1400bc640(param_2,&DAT_1402469c8);
          return 1;
        }
        if (param_1 == 0x475) {
          FUN_1400bc640(param_2,&DAT_1402469b8);
          return 1;
        }
        if (param_1 == 0x476) {
          FUN_1400bc640(param_2,&DAT_1402469a8);
          return 1;
        }
        if (param_1 == 0x477) {
          FUN_1400bc640(param_2,&DAT_140246998);
          return 1;
        }
        if (param_1 == 0x478) {
          FUN_1400bc640(param_2,&DAT_140246988);
          return 1;
        }
        if (param_1 == 0x479) {
          FUN_1400bc640(param_2,&DAT_140246978);
          return 1;
        }
        if (param_1 == 0x47a) {
          FUN_1400bc640(param_2,&DAT_140246968);
          return 1;
        }
        if (param_1 == 0x47b) {
          FUN_1400bc640(param_2,&DAT_140246958);
          return 1;
        }
        if (param_1 == 0x47c) {
          FUN_1400bc640(param_2,&DAT_140246948);
          return 1;
        }
        if (param_1 == 0x47d) {
          FUN_1400bc640(param_2,&DAT_140246938);
          return 1;
        }
      }
      else {
        if (param_1 == 0x551) {
          FUN_1400bc640(param_2,&DAT_140246930);
          return 1;
        }
        if (param_1 - 20000U < 0x48a7) {
          if (param_1 == 20000) {
            FUN_1400bc640(param_2,"x-chinese-cns");
            return 1;
          }
          if (param_1 == 0x4e21) {
            FUN_1400bc640(param_2,&DAT_140246910);
            return 1;
          }
          if (param_1 == 0x4e22) {
            FUN_1400bc640(param_2,"x-chinese-eten");
            return 1;
          }
          if (param_1 == 0x4e23) {
            FUN_1400bc640(param_2,&DAT_1402468f0);
            return 1;
          }
          if (param_1 == 0x4e24) {
            FUN_1400bc640(param_2,&DAT_1402468e0);
            return 1;
          }
          if (param_1 == 0x4e25) {
            FUN_1400bc640(param_2,&DAT_1402468d0);
            return 1;
          }
          if (param_1 == 0x4e89) {
            FUN_1400bc640(param_2,&DAT_1402468c8);
            return 1;
          }
          if (param_1 == 0x4e8a) {
            FUN_1400bc640(param_2,"x-ia5-german");
            return 1;
          }
          if (param_1 == 0x4e8b) {
            FUN_1400bc640(param_2,"x-ia5-swedish");
            return 1;
          }
          if (param_1 == 0x4e8c) {
            FUN_1400bc640(param_2,"x-ia5-norwegian");
            return 1;
          }
          if (param_1 == 0x4f25) {
            FUN_1400bc640(param_2,&DAT_140246888);
            return 1;
          }
          if (param_1 == 0x4f2d) {
            FUN_1400bc640(param_2,&DAT_140246878);
            return 1;
          }
          if (param_1 == 0x4f31) {
            FUN_1400bc640(param_2,&DAT_140246870);
            return 1;
          }
          if (param_1 == 0x4f35) {
            FUN_1400bc640(param_2,&DAT_140246868);
            return 1;
          }
          if (param_1 == 0x4f36) {
            FUN_1400bc640(param_2,&DAT_140246860);
            return 1;
          }
          if (param_1 == 0x4f38) {
            FUN_1400bc640(param_2,&DAT_140246858);
            return 1;
          }
          if (param_1 == 0x4f3c) {
            FUN_1400bc640(param_2,&DAT_140246850);
            return 1;
          }
          if (param_1 == 0x4f3d) {
            FUN_1400bc640(param_2,&DAT_140246848);
            return 1;
          }
          if (param_1 == 0x4f42) {
            FUN_1400bc640(param_2,&DAT_140246840);
            return 1;
          }
          if (param_1 == 0x4f49) {
            FUN_1400bc640(param_2,&DAT_140246838);
            return 1;
          }
          if (param_1 == 0x4fc4) {
            FUN_1400bc640(param_2,&DAT_140246830);
            return 1;
          }
          if (param_1 == 0x4fc7) {
            FUN_1400bc640(param_2,&DAT_140246828);
            return 1;
          }
          if (param_1 == 0x4fc8) {
            FUN_1400bc640(param_2,&DAT_140246820);
            return 1;
          }
          if (param_1 == 0x5161) {
            FUN_1400bc640(param_2,"x-ebcdic-koreanextended");
            return 1;
          }
          if (param_1 == 0x5166) {
            FUN_1400bc640(param_2,&DAT_1402467f8);
            return 1;
          }
          if (param_1 == 0x5182) {
            FUN_1400bc640(param_2,&DAT_1402467ec);
            return 1;
          }
          if (param_1 == 0x5187) {
            FUN_1400bc640(param_2,&DAT_1402467e4);
            return 1;
          }
          if (param_1 == 0x5190) {
            FUN_1400bc640(param_2,&DAT_1402467dc);
            return 1;
          }
          if (param_1 == 0x51a9) {
            FUN_1400bc640(param_2,&DAT_1402467d4);
            return 1;
          }
          if (param_1 == 0x51bc) {
            FUN_1400bc640(param_2,&DAT_1402467c8);
            return 1;
          }
          if (param_1 == 0x51c4) goto LAB_140107477;
          if (param_1 == 0x51c8) {
            FUN_1400bc640(param_2,&DAT_1402467b8);
            return 1;
          }
          if (param_1 == 0x51d5) {
            FUN_1400bc640(param_2,&DAT_1402467a8);
            return 1;
          }
          if (param_1 == 0x5221) {
            FUN_1400bc640(param_2,&DAT_14024679c);
            return 1;
          }
          if (param_1 == 0x556a) {
            FUN_1400bc640(param_2,&DAT_140246794);
            return 1;
          }
          if (param_1 == 0x7149) {
            FUN_1400bc640(param_2,"x-europa");
            return 1;
          }
          if (param_1 == 0x96c6) {
            FUN_1400bc640(param_2,&DAT_140246778);
            return 1;
          }
        }
        else if (param_1 - 0xdeaaU < 10) {
          if (param_1 == 0xdeaa) {
            FUN_1400bc640(param_2,"x-iscii-de");
            return 1;
          }
          if (param_1 == 0xdeab) {
            FUN_1400bc640(param_2,"x-iscii-be");
            return 1;
          }
          if (param_1 == 0xdeac) {
            FUN_1400bc640(param_2,"x-iscii-ta");
            return 1;
          }
          if (param_1 == 0xdead) {
            FUN_1400bc640(param_2,"x-iscii-te");
            return 1;
          }
          if (param_1 == 0xdeae) {
            FUN_1400bc640(param_2,"x-iscii-as");
            return 1;
          }
          if (param_1 == 0xdeaf) {
            FUN_1400bc640(param_2,"x-iscii-or");
            return 1;
          }
          if (param_1 == 0xdeb0) {
            FUN_1400bc640(param_2,"x-iscii-ka");
            return 1;
          }
          if (param_1 == 0xdeb1) {
            FUN_1400bc640(param_2,"x-iscii-ma");
            return 1;
          }
          if (param_1 == 0xdeb2) {
            FUN_1400bc640(param_2,"x-iscii-gu");
            return 1;
          }
          if (param_1 == 0xdeb3) {
            FUN_1400bc640(param_2,"x-iscii-pa");
            return 1;
          }
        }
      }
    }
  }
  else {
    if (param_1 == 65000) {
      FUN_1400bc640(param_2,&DAT_140246c0c);
      return 1;
    }
    if (param_1 == 0xfde9) {
      FUN_1400bc640(param_2,&DAT_1402083e0);
      return 1;
    }
    if (param_1 == 0xfded) {
      FUN_1400bc640(param_2,&DAT_140246c04);
      return 1;
    }
    if (param_1 == 0xfdee) {
      FUN_1400bc640(param_2,&DAT_140246bf8);
      return 1;
    }
  }
  return 0;
}



UINT FUN_140108370(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  UINT UVar3;
  char *pcVar4;
  longlong lVar5;
  char *pcVar6;
  char *pcVar7;
  bool bVar8;
  undefined8 uVar9;
  undefined1 local_40 [56];
  
  uVar9 = 0xfffffffffffffffe;
  if (param_1 == 0) {
    return 0;
  }
  FUN_1400bcc20(local_40);
  FUN_1400bc640(local_40,param_1);
  FUN_1400bbc30(local_40);
  FUN_1400bd760(local_40);
  FUN_1400bbda0(local_40,0x5f,0x2d,param_4,uVar9);
  iVar2 = FUN_1400bbb10(local_40);
  if (2 < iVar2) {
    cVar1 = FUN_1400be010(local_40,&DAT_140206fd0);
    if (cVar1 != '\0') {
      UVar3 = GetACP();
      FUN_1400bceb0(local_40);
      return UVar3;
    }
    pcVar4 = (char *)FUN_1400b8b90(local_40);
    cVar1 = *pcVar4;
    if (cVar1 == 'i') {
      if ((pcVar4[1] == 's') && (bVar8 = pcVar4[2] == 'o', bVar8)) {
        lVar5 = 0xb;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-1";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6faf;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-2";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb0;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-3";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb1;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-4";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb2;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-5";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb3;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-6";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb4;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-7";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb5;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-8";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb6;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-9";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb7;
        }
        lVar5 = 0xc;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-11";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x36a;
        }
        lVar5 = 0xc;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-13";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fbb;
        }
        lVar5 = 0xc;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-15";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fbd;
        }
        lVar5 = 0xd;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-8-i";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x96c6;
        }
        lVar5 = 0xc;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-2022-jp";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xc42c;
        }
        lVar5 = 0xc;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-2022-kr";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xc431;
        }
        lVar5 = 0x10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-10646-ucs-2";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4b0;
        }
        lVar5 = 0xf;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-2022-jpeuc";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xcadc;
        }
        lVar5 = 0xe;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-2022-kr-7";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xc431;
        }
        lVar5 = 0x11;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-2022-kr-7bit";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xc431;
        }
        lVar5 = 0xe;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-2022-kr-8";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xcaed;
        }
        lVar5 = 0x11;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-2022-kr-8bit";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xcaed;
        }
        lVar5 = 0x12;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-8 visual";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb6;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-ir-100";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6faf;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-ir-101";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb0;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-ir-109";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb1;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-ir-110";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb2;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-ir-126";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb5;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-ir-127";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb4;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-ir-138";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb6;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-ir-144";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb3;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-ir-148";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb7;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-ir-149";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3b5;
        }
        lVar5 = 10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-ir-58";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3a8;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-ir-6";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e9f;
        }
        lVar5 = 10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso646-us";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e9f;
        }
        lVar5 = 0x11;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-646.irv:1991";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e9f;
        }
        lVar5 = 0x10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-1:1987";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6faf;
        }
        lVar5 = 0x10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-2:1987";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb0;
        }
        lVar5 = 0x10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-3:1988";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb1;
        }
        lVar5 = 0x10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-4:1988";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb2;
        }
        lVar5 = 0x10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-5:1988";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb3;
        }
        lVar5 = 0x10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-6:1987";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb4;
        }
        lVar5 = 0x10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-7:1987";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb5;
        }
        lVar5 = 0x10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-8:1988";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb6;
        }
        lVar5 = 0x10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-8859-9:1989";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb7;
        }
        lVar5 = 0xe;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "iso-2022-jp-1";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xc42d;
        }
        lVar5 = 0xe;
        bVar8 = false;
        pcVar6 = "iso-2022-jp-2";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar4 == *pcVar6;
          pcVar4 = pcVar4 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xc42e;
        }
      }
      else {
        bVar8 = pcVar4[1] == 'b';
        if ((bVar8) && (bVar8 = pcVar4[2] == 'm', bVar8)) {
          lVar5 = 7;
          pcVar6 = pcVar4;
          pcVar7 = "ibm037";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x25;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm437";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x1b5;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm500";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 500;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm737";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x2e1;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm775";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x307;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm850";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x352;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm852";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x354;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm855";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x357;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm857";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x359;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm00858";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x35a;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm860";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x35c;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm861";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x35d;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm863";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x35f;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm864";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x360;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm865";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x361;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm869";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x365;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm870";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x366;
          }
          lVar5 = 8;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm1026";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x402;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm01140";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x474;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm01141";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x475;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm01142";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x476;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm01143";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x477;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm01144";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x478;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm01145";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x479;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm01146";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x47a;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm01147";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x47b;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm01148";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x47c;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm01149";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x47d;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm273";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4f31;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm277";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4f35;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm278";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4f36;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm280";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4f38;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm284";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4f3c;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm285";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4f3d;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm290";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4f42;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm297";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4f49;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm420";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4fc4;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm423";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4fc7;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm424";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4fc8;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm871";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x5187;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm880";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x5190;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm905";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x51a9;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm00924";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x51bc;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm-thai";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x5166;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm01047";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x417;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm037";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x25;
          }
          lVar5 = 8;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm1026";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x402;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm367";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4e9f;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm437";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x1b5;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm500";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 500;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm737";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x2e1;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm775";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x307;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm819";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x6faf;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ibm862";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x35e;
          }
          lVar5 = 7;
          bVar8 = false;
          pcVar6 = "ibm866";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar4 == *pcVar6;
            pcVar4 = pcVar4 + 1;
            pcVar6 = pcVar6 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x362;
          }
        }
        else {
          lVar5 = 4;
          pcVar6 = "irv";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar4 == *pcVar6;
            pcVar4 = pcVar4 + 1;
            pcVar6 = pcVar6 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4e89;
          }
        }
      }
    }
    else if (cVar1 == 'u') {
      lVar5 = 9;
      bVar8 = true;
      pcVar6 = pcVar4;
      pcVar7 = "us-ascii";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4e9f;
      }
      lVar5 = 6;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "utf-8";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0xfde9;
      }
      lVar5 = 5;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "utf8";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0xfde9;
      }
      lVar5 = 7;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "utf-16";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4b0;
      }
      lVar5 = 6;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "utf16";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4b0;
      }
      lVar5 = 6;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ucs-2";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4b0;
      }
      lVar5 = 5;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ucs2";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4b0;
      }
      lVar5 = 8;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "unicode";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4b0;
      }
      lVar5 = 0xc;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "unicodefffe";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4b1;
      }
      lVar5 = 6;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "utf-7";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 65000;
      }
      lVar5 = 7;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "utf-32";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0xfded;
      }
      lVar5 = 9;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "utf-32be";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0xfdee;
      }
      lVar5 = 0x12;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "unicode-1-1-utf-7";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 65000;
      }
      lVar5 = 0x12;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "unicode-1-1-utf-8";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0xfde9;
      }
      lVar5 = 0x12;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "unicode-2-0-utf-7";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 65000;
      }
      lVar5 = 0x12;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "unicode-2-0-utf-8";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0xfde9;
      }
      lVar5 = 3;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "us";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4e9f;
      }
      lVar5 = 9;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "utf-16be";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4b1;
      }
      lVar5 = 9;
      bVar8 = false;
      pcVar6 = "utf-16le";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar4 == *pcVar6;
        pcVar4 = pcVar4 + 1;
        pcVar6 = pcVar6 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4b0;
      }
    }
    else if (cVar1 == 'w') {
      if ((pcVar4[1] == 'i') && (pcVar4[2] == 'n')) {
        lVar5 = 0xd;
        bVar8 = true;
        pcVar6 = pcVar4;
        pcVar7 = "windows-1250";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e2;
        }
        lVar5 = 0xd;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "windows-1251";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e3;
        }
        lVar5 = 0xd;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "windows-1252";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e4;
        }
        lVar5 = 0xd;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "windows-1253";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e5;
        }
        lVar5 = 0xd;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "windows-1254";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e6;
        }
        lVar5 = 0xd;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "windows-1255";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e7;
        }
        lVar5 = 0xd;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "windows-1256";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e8;
        }
        lVar5 = 0xd;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "windows-1257";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e9;
        }
        lVar5 = 0xd;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "windows-1258";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4ea;
        }
        lVar5 = 0xc;
        bVar8 = false;
        pcVar6 = "windows-874";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar4 == *pcVar6;
          pcVar4 = pcVar4 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x36a;
        }
      }
    }
    else if (cVar1 == 'x') {
      if (pcVar4[1] == '-') {
        if (pcVar4[2] == 'c') {
          lVar5 = 0xe;
          bVar8 = true;
          pcVar6 = pcVar4;
          pcVar7 = "x-chinese-cns";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 20000;
          }
          lVar5 = 10;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-cp20001";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4e21;
          }
          lVar5 = 0xf;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-chinese-eten";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4e22;
          }
          lVar5 = 10;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-cp20003";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4e23;
          }
          lVar5 = 10;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-cp20004";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4e24;
          }
          lVar5 = 10;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-cp20005";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4e25;
          }
          lVar5 = 10;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-cp20261";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4f25;
          }
          lVar5 = 10;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-cp20269";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4f2d;
          }
          lVar5 = 10;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-cp20936";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x51c8;
          }
          lVar5 = 10;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-cp20949";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x51d5;
          }
          lVar5 = 10;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-cp50227";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0xc433;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-cp1250";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4e2;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-cp1251";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4e3;
          }
          lVar5 = 10;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-cp21027";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x5223;
          }
          lVar5 = 10;
          bVar8 = false;
          pcVar6 = "x-cp50227";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar4 == *pcVar6;
            pcVar4 = pcVar4 + 1;
            pcVar6 = pcVar6 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0xc433;
          }
          goto LAB_14010c576;
        }
        if (pcVar4[2] == 'm') {
          lVar5 = 0xf;
          bVar8 = true;
          pcVar6 = pcVar4;
          pcVar7 = "x-mac-japanese";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x2711;
          }
          lVar5 = 0x12;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-mac-chinesetrad";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x2712;
          }
          lVar5 = 0xd;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-mac-korean";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x2713;
          }
          lVar5 = 0xd;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-mac-arabic";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x2714;
          }
          lVar5 = 0xd;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-mac-hebrew";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x2715;
          }
          lVar5 = 0xc;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-mac-greek";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x2716;
          }
          lVar5 = 0xf;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-mac-cyrillic";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x2717;
          }
          lVar5 = 0x12;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-mac-chinesesimp";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x2718;
          }
          lVar5 = 0xf;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-mac-romanian";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x271a;
          }
          lVar5 = 0x10;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-mac-ukrainian";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x2721;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-mac-thai";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x2725;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-mac-ce";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x272d;
          }
          lVar5 = 0x10;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-mac-icelandic";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x275f;
          }
          lVar5 = 0xe;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-mac-turkish";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x2761;
          }
          lVar5 = 0xf;
          bVar8 = false;
          pcVar6 = "x-mac-croatian";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar4 == *pcVar6;
            pcVar4 = pcVar4 + 1;
            pcVar6 = pcVar6 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x2762;
          }
          goto LAB_14010c576;
        }
        if (pcVar4[2] == 'i') {
          lVar5 = 6;
          bVar8 = true;
          pcVar6 = pcVar4;
          pcVar7 = "x-ia5";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4e89;
          }
          lVar5 = 0xd;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-ia5-german";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4e8a;
          }
          lVar5 = 0xe;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-ia5-swedish";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4e8b;
          }
          lVar5 = 0x10;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-ia5-norwegian";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4e8c;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-iscii-de";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0xdeaa;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-iscii-be";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0xdeab;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-iscii-ta";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0xdeac;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-iscii-te";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0xdead;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-iscii-as";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0xdeae;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-iscii-or";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0xdeaf;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-iscii-ka";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0xdeb0;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-iscii-ma";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0xdeb1;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "x-iscii-gu";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0xdeb2;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = "x-iscii-pa";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar4 == *pcVar6;
            pcVar4 = pcVar4 + 1;
            pcVar6 = pcVar6 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0xdeb3;
          }
          goto LAB_14010c576;
        }
      }
      bVar8 = false;
      lVar5 = 7;
      pcVar6 = pcVar4;
      pcVar7 = "x-ansi";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4e4;
      }
      lVar5 = 0x18;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "x-ebcdic-koreanextended";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x5161;
      }
      lVar5 = 0x1d;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "x-ebcdic-japaneseanduscanada";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0xc6f3;
      }
      lVar5 = 0x18;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "x-ebcdic-koreanextended";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x5161;
      }
      lVar5 = 6;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "x-euc";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0xcadc;
      }
      lVar5 = 9;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "x-euc-cn";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0xcae0;
      }
      lVar5 = 9;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "x-euc-jp";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0xcadc;
      }
      lVar5 = 9;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "x-europa";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x7149;
      }
      lVar5 = 0xb;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "x-ms-cp932";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x3a4;
      }
      lVar5 = 7;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "x-sjis";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x3a4;
      }
      lVar5 = 0x14;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "x-unicode-1-1-utf-7";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 65000;
      }
      lVar5 = 0x14;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "x-unicode-1-1-utf-8";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0xfde9;
      }
      lVar5 = 0x14;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "x-unicode-2-0-utf-7";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 65000;
      }
      lVar5 = 0x14;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "x-unicode-2-0-utf-8";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0xfde9;
      }
      lVar5 = 0xf;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "x-user-defined";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 50000;
      }
      lVar5 = 9;
      bVar8 = false;
      pcVar6 = "x-x-big5";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar4 == *pcVar6;
        pcVar4 = pcVar4 + 1;
        pcVar6 = pcVar6 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x3b6;
      }
    }
    else if (cVar1 == 'b') {
      lVar5 = 5;
      bVar8 = true;
      pcVar6 = pcVar4;
      pcVar7 = "big5";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x3b6;
      }
      lVar5 = 0xb;
      bVar8 = false;
      pcVar6 = "big5-hkscs";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar4 == *pcVar6;
        pcVar4 = pcVar4 + 1;
        pcVar6 = pcVar6 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x3b6;
      }
    }
    else if (cVar1 == 'c') {
      cVar1 = pcVar4[1];
      if (cVar1 == 'p') {
        lVar5 = 6;
        bVar8 = true;
        pcVar6 = pcVar4;
        pcVar7 = "cp866";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x362;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp875";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x36b;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp1025";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x5221;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp00858";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x35a;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp00924";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x51bc;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp01140";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x474;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp01141";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x475;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp01142";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x476;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp01143";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x477;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp01144";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x478;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp01145";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x479;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp01146";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x47a;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp01147";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x47b;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp01148";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x47c;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp01149";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x47d;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp037";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x25;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp1026";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x402;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp1256";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e8;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp273";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4f31;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp278";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4f36;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp280";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4f38;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp284";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4f3c;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp285";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4f3d;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp290";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4f42;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp297";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4f49;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp367";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e9f;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp420";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4fc4;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp423";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4fc7;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp424";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4fc8;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp437";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x1b5;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp500";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 500;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp50227";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xc433;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp819";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6faf;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp850";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x352;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp852";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x354;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp855";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x357;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp857";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x359;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp858";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x35a;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp860";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x35c;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp861";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x35d;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp862";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x35e;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp863";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x35f;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp864";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x360;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp865";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x361;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp869";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x365;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp870";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x366;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp871";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x5187;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp880";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x5190;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp905";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x51a9;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp930";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xc6f2;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp933";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xc6f5;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp935";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xc6f7;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cp937";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xc6f9;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = "cp939";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar4 == *pcVar6;
          pcVar4 = pcVar4 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xc6fb;
        }
      }
      else if (cVar1 == 's') {
        lVar5 = 0xc;
        bVar8 = true;
        pcVar6 = pcVar4;
        pcVar7 = "csiso2022jp";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xc42c;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csascii";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e9f;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csbig5";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3b6;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cseuckr";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xcaed;
        }
        lVar5 = 0x14;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cseucpkdfmtjapanese";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xcadc;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csgb2312";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3a8;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csgb231280";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3a8;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm037";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x25;
        }
        lVar5 = 10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm1026";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x402;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm273";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4f31;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm277";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4f35;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm278";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4f36;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm280";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4f38;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm284";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4f3c;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm285";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4f3d;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm290";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4f42;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm297";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4f49;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm420";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4fc4;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm423";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4fc7;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm424";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4fc8;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm500";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 500;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm870";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x366;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm871";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x5187;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm880";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x5190;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibm905";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x51a9;
        }
        lVar5 = 10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csibmthai";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x5166;
        }
        lVar5 = 0xc;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csiso2022kr";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xc431;
        }
        lVar5 = 0x10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csiso58gb231280";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3a8;
        }
        lVar5 = 0xc;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csisolatin1";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6faf;
        }
        lVar5 = 0xc;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csisolatin2";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb0;
        }
        lVar5 = 0xc;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csisolatin3";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb1;
        }
        lVar5 = 0xc;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csisolatin4";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb2;
        }
        lVar5 = 0xc;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csisolatin5";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb7;
        }
        lVar5 = 0xc;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csisolatin9";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fbd;
        }
        lVar5 = 0x11;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csisolatinarabic";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb4;
        }
        lVar5 = 0x13;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csisolatincyrillic";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb3;
        }
        lVar5 = 0x10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csisolatingreek";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb5;
        }
        lVar5 = 0x11;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csisolatinhebrew";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb6;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cskoi8r";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x5182;
        }
        lVar5 = 0xe;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csksc56011987";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3b5;
        }
        lVar5 = 0x11;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "cspc8codepage437";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x1b5;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csshiftjis";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3a4;
        }
        lVar5 = 0x10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "csunicode11utf7";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 65000;
        }
        lVar5 = 0xd;
        bVar8 = false;
        pcVar6 = "cswindows31j";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar4 == *pcVar6;
          pcVar4 = pcVar4 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3a4;
        }
      }
      else {
        bVar8 = cVar1 == 'c';
        if (bVar8) {
          lVar5 = 0xb;
          bVar8 = true;
          pcVar6 = pcVar4;
          pcVar7 = "ccsid00858";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x35a;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ccsid00924";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x51bc;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ccsid01140";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x474;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ccsid01141";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x475;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ccsid01142";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x476;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ccsid01143";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x477;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ccsid01144";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x478;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ccsid01145";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x479;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ccsid01146";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x47a;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ccsid01147";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x47b;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "ccsid01148";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x47c;
          }
          lVar5 = 0xb;
          bVar8 = false;
          pcVar6 = "ccsid01149";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar4 == *pcVar6;
            pcVar4 = pcVar4 + 1;
            pcVar6 = pcVar6 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x47d;
          }
        }
        else {
          lVar5 = 8;
          pcVar6 = pcVar4;
          pcVar7 = "chinese";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x3a8;
          }
          lVar5 = 8;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "cn-big5";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x3b6;
          }
          lVar5 = 6;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "cn-gb";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x3a8;
          }
          lVar5 = 9;
          bVar8 = false;
          pcVar6 = "cyrillic";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar4 == *pcVar6;
            pcVar4 = pcVar4 + 1;
            pcVar6 = pcVar6 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x6fb3;
          }
        }
      }
    }
    else if (cVar1 == 'd') {
      lVar5 = 8;
      bVar8 = true;
      pcVar6 = pcVar4;
      pcVar7 = "dos-720";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x2d0;
      }
      lVar5 = 8;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "dos-862";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x35e;
      }
      lVar5 = 10;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "din-66003";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4e8a;
      }
      lVar5 = 8;
      bVar8 = false;
      pcVar6 = "dos-874";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar4 == *pcVar6;
        pcVar4 = pcVar4 + 1;
        pcVar6 = pcVar6 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x36a;
      }
    }
    else if (cVar1 == 'e') {
      lVar5 = 7;
      bVar8 = true;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x25;
      }
      lVar5 = 7;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "euc-jp";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0xcadc;
      }
      lVar5 = 7;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "euc-cn";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0xcae0;
      }
      lVar5 = 7;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "euc-kr";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0xcaed;
      }
      lVar5 = 7;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "euc-tw";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0xcaee;
      }
      lVar5 = 0xe;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-ar1";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4fc4;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-be";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 500;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-ca";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x25;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-ch";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 500;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-dk";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4f35;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-es";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4f3c;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-fi";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4f36;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-fr";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4f49;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-gb";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4f3d;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-gr";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4fc7;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-he";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4fc8;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-is";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x5187;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-it";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4f38;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-nl";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x25;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-no";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4f35;
      }
      lVar5 = 0x10;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-roece";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x366;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-se";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4f36;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-tr";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x51a9;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-us";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x25;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-wt";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x25;
      }
      lVar5 = 0xd;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cp-yu";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x366;
      }
      lVar5 = 0x10;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-cyrillic";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x5190;
      }
      lVar5 = 0x13;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-de-273+euro";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x475;
      }
      lVar5 = 0x13;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-dk-277+euro";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x476;
      }
      lVar5 = 0x13;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-es-284+euro";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x479;
      }
      lVar5 = 0x13;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-fi-278+euro";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x477;
      }
      lVar5 = 0x13;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-fr-297+euro";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x47b;
      }
      lVar5 = 0x13;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-gb-285+euro";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x47a;
      }
      lVar5 = 0x13;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-is-871+euro";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x47d;
      }
      lVar5 = 0x13;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-it-280+euro";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x478;
      }
      lVar5 = 0xf;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-jp-kana";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x4f42;
      }
      lVar5 = 0x14;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-latin9--euro";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x51bc;
      }
      lVar5 = 0x13;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-no-277+euro";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x476;
      }
      lVar5 = 0x13;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-se-278+euro";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x477;
      }
      lVar5 = 0x12;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ebcdic-us-37+euro";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x474;
      }
      lVar5 = 9;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ecma-114";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x6fb4;
      }
      lVar5 = 9;
      bVar8 = false;
      pcVar6 = pcVar4;
      pcVar7 = "ecma-118";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x6fb5;
      }
      lVar5 = 9;
      bVar8 = false;
      pcVar6 = "elot-928";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar4 == *pcVar6;
        pcVar4 = pcVar4 + 1;
        pcVar6 = pcVar6 + 1;
      } while (bVar8);
      if (bVar8) {
        FUN_1400bceb0(local_40);
        return 0x6fb5;
      }
    }
    else if (cVar1 != 'f') {
      if (cVar1 == 'g') {
        lVar5 = 7;
        bVar8 = true;
        pcVar6 = pcVar4;
        pcVar7 = "gb2312";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3a8;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "gb18030";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3a8;
        }
        lVar5 = 0xd;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "gb18030-2000";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3a8;
        }
        lVar5 = 10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "gb2312-80";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3a8;
        }
        lVar5 = 4;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "gbk";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3a8;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "gb-2312-80";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3a8;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "german";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e8a;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "greek";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb5;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = "greek8";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar4 == *pcVar6;
          pcVar4 = pcVar4 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb5;
        }
      }
      else if (cVar1 == 'h') {
        lVar5 = 0xb;
        bVar8 = true;
        pcVar6 = pcVar4;
        pcVar7 = "hz-gb-2312";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0xcec8;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = "hebrew";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar4 == *pcVar6;
          pcVar4 = pcVar4 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb6;
        }
      }
      else if (cVar1 == 'a') {
        lVar5 = 9;
        bVar8 = true;
        pcVar6 = pcVar4;
        pcVar7 = "asmo-708";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x2c4;
        }
        lVar5 = 0xf;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "ansi-x3.4-1968";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e9f;
        }
        lVar5 = 0xf;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "ansi-x3.4-1986";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e9f;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "arabic";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb4;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "ascii";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e9f;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "asmo-449";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x2c5;
        }
        lVar5 = 10;
        bVar8 = false;
        pcVar6 = "asmo-449+";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar4 == *pcVar6;
          pcVar4 = pcVar4 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x2c5;
        }
      }
      else if (cVar1 == 'j') {
        lVar5 = 6;
        bVar8 = true;
        pcVar6 = "johab";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar4 == *pcVar6;
          pcVar4 = pcVar4 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x551;
        }
      }
      else if (cVar1 == 'k') {
        lVar5 = 0xf;
        bVar8 = true;
        pcVar6 = pcVar4;
        pcVar7 = "ks-c-5601-1987";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3b5;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "koi8-r";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x5182;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "koi8-u";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x556a;
        }
        lVar5 = 4;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "koi";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x5182;
        }
        lVar5 = 5;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "koi8";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x5182;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "koi8-ru";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x556a;
        }
        lVar5 = 6;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "koi8r";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x5182;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "korean";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3b5;
        }
        lVar5 = 10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "ks-c-5601";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3b5;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "ks-c5601";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3b5;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "ksc5601";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3b5;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "ksc-5601";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3b5;
        }
        lVar5 = 10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "ks-c-5601";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3b5;
        }
        lVar5 = 0xf;
        bVar8 = false;
        pcVar6 = "ks-c-5601-1989";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar4 == *pcVar6;
          pcVar4 = pcVar4 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3b5;
        }
      }
      else if (cVar1 == 'l') {
        lVar5 = 3;
        bVar8 = true;
        pcVar6 = pcVar4;
        pcVar7 = "l1";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6faf;
        }
        lVar5 = 3;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "l2";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb0;
        }
        lVar5 = 3;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "l3";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb1;
        }
        lVar5 = 3;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "l4";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb2;
        }
        lVar5 = 3;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "l5";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb7;
        }
        lVar5 = 3;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "l9";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fbd;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "latin1";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6faf;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "latin2";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb0;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "latin3";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb1;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "latin4";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb2;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "latin5";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb7;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "latin-1";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6faf;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "latin-2";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb0;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "latin-3";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb1;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "latin-4";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb2;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "latin-5";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb7;
        }
        lVar5 = 7;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "latin9";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fbd;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "latin-9";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fbd;
        }
        lVar5 = 8;
        bVar8 = false;
        pcVar6 = "logical";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar4 == *pcVar6;
          pcVar4 = pcVar4 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x6fb6;
        }
      }
      else if (cVar1 == 'm') {
        lVar5 = 10;
        bVar8 = true;
        pcVar6 = pcVar4;
        pcVar7 = "macintosh";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 10000;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "macroman";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 10000;
        }
        lVar5 = 0xc;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "macjapanese";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x2711;
        }
        lVar5 = 0xf;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "macchinesetrad";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x2712;
        }
        lVar5 = 10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "mackorean";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x2713;
        }
        lVar5 = 10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "macarabic";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x2714;
        }
        lVar5 = 10;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "machebrew";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x2715;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "macgreek";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x2716;
        }
        lVar5 = 0xc;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "maccyrillic";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x2717;
        }
        lVar5 = 0xf;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "macchinesesimp";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x2718;
        }
        lVar5 = 0x11;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "maccentraleurope";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x272d;
        }
        lVar5 = 0xd;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "macicelandic";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x275f;
        }
        lVar5 = 0xb;
        bVar8 = false;
        pcVar6 = pcVar4;
        pcVar7 = "macturkish";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x2761;
        }
        lVar5 = 9;
        bVar8 = false;
        pcVar6 = "ms-kanji";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar4 == *pcVar6;
          pcVar4 = pcVar4 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x3a4;
        }
      }
      else if (cVar1 == 'n') {
        lVar5 = 10;
        bVar8 = true;
        pcVar6 = pcVar4;
        pcVar7 = "norwegian";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar6 == *pcVar7;
          pcVar6 = pcVar6 + 1;
          pcVar7 = pcVar7 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e8c;
        }
        lVar5 = 10;
        bVar8 = false;
        pcVar6 = "ns-4551-1";
        do {
          if (lVar5 == 0) break;
          lVar5 = lVar5 + -1;
          bVar8 = *pcVar4 == *pcVar6;
          pcVar4 = pcVar4 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar8);
        if (bVar8) {
          FUN_1400bceb0(local_40);
          return 0x4e8c;
        }
      }
      else if ((((cVar1 != 'o') && (cVar1 != 'p')) && (cVar1 != 'q')) && (cVar1 != 'r')) {
        if (cVar1 == 's') {
          lVar5 = 10;
          bVar8 = true;
          pcVar6 = pcVar4;
          pcVar7 = "shift-jis";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x3a4;
          }
          lVar5 = 0xd;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "sen-850200-b";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4e8b;
          }
          lVar5 = 5;
          bVar8 = false;
          pcVar6 = pcVar4;
          pcVar7 = "sjis";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar6 == *pcVar7;
            pcVar6 = pcVar6 + 1;
            pcVar7 = pcVar7 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x3a4;
          }
          lVar5 = 8;
          bVar8 = false;
          pcVar6 = "swedish";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar4 == *pcVar6;
            pcVar4 = pcVar4 + 1;
            pcVar6 = pcVar6 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x4e8b;
          }
        }
        else if (cVar1 == 't') {
          lVar5 = 8;
          bVar8 = true;
          pcVar6 = "tis-620";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar4 == *pcVar6;
            pcVar4 = pcVar4 + 1;
            pcVar6 = pcVar6 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x36a;
          }
        }
        else if (cVar1 == 'v') {
          lVar5 = 7;
          bVar8 = true;
          pcVar6 = "visual";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar8 = *pcVar4 == *pcVar6;
            pcVar4 = pcVar4 + 1;
            pcVar6 = pcVar6 + 1;
          } while (bVar8);
          if (bVar8) {
            FUN_1400bceb0(local_40);
            return 0x6fb6;
          }
        }
      }
    }
  }
LAB_14010c576:
  FUN_1400bceb0(local_40);
  return 0;
}



bool FUN_14010c5a0(void)

{
  int iVar1;
  
  iVar1 = FUN_140108370();
  return iVar1 != 0;
}



ulonglong FUN_14010c5c0(byte *param_1,int param_2)

{
  byte *pbVar1;
  byte bVar2;
  byte bVar3;
  ulonglong in_RAX;
  uint7 uVar4;
  byte *pbVar5;
  
  pbVar5 = param_1 + param_2;
  if (param_2 != 1) {
    if (param_2 != 2) {
      if (param_2 != 3) {
        if (param_2 != 4) goto LAB_14010c62d;
        pbVar1 = pbVar5 + -1;
        in_RAX = 0;
        pbVar5 = pbVar5 + -1;
        if ((*pbVar1 < 0x80) || (0xbf < *pbVar1)) goto LAB_14010c62d;
      }
      pbVar1 = pbVar5 + -1;
      in_RAX = 0;
      pbVar5 = pbVar5 + -1;
      if ((*pbVar1 < 0x80) || (0xbf < *pbVar1)) goto LAB_14010c62d;
    }
    bVar2 = pbVar5[-1];
    if (0xbf < bVar2) goto LAB_14010c62d;
    bVar3 = *param_1;
    if (bVar3 == 0xe0) {
      if (bVar2 < 0xa0) goto LAB_14010c62d;
    }
    else if (bVar3 == 0xf0) {
      if (bVar2 < 0x90) goto LAB_14010c62d;
    }
    else {
      uVar4 = (uint7)(in_RAX >> 8);
      if (bVar3 == 0xf4) {
        if (0x8f < bVar2) {
          return (ulonglong)uVar4 << 8;
        }
      }
      else if (bVar2 < 0x80) {
        return (ulonglong)uVar4 << 8;
      }
    }
  }
  bVar2 = *param_1;
  in_RAX = 0;
  if ((bVar2 < 0x80) || (0xc1 < bVar2)) {
    return (ulonglong)(bVar2 < 0xf5);
  }
LAB_14010c62d:
  return in_RAX & 0xffffffffffffff00;
}



ulonglong FUN_14010c650(byte *param_1,uint param_2)

{
  char cVar1;
  ulonglong uVar2;
  
  if ((param_1 != (byte *)0x0) && (0 < (int)param_2)) {
    if ((ushort)param_2 < (ushort)(short)(char)(&DAT_140247c40)[*param_1]) {
      return (ulonglong)param_2;
    }
    uVar2 = (ulonglong)((ushort)(short)(char)(&DAT_140247c40)[*param_1] + 1);
    cVar1 = FUN_14010c5c0(param_1,uVar2);
    uVar2 = uVar2 & 0xffffffff;
    if (cVar1 == '\0') {
      uVar2 = 1;
    }
    return uVar2;
  }
  return 0;
}



undefined8 FUN_14010c6b0(undefined8 param_1,undefined8 param_2)

{
  byte bVar1;
  char cVar2;
  char cVar3;
  int iVar4;
  uint uVar5;
  longlong lVar6;
  byte *pbVar7;
  uint uVar8;
  uint local_res18 [4];
  
  iVar4 = FUN_1400b8b80();
  if ((iVar4 == 0) || (lVar6 = FUN_1400b8b90(param_1), lVar6 == 0)) {
    return 1;
  }
  pbVar7 = (byte *)FUN_1400b8b90(param_1);
  uVar5 = FUN_1400b8b80(param_1);
  do {
    if (uVar5 == 0) {
      return 1;
    }
    bVar1 = *pbVar7;
    iVar4 = 0;
    cVar2 = (&DAT_140247c40)[bVar1];
    local_res18[0] = 0;
    uVar8 = (int)cVar2 & 0xffff;
    if ((uVar5 < uVar8) || (cVar3 = FUN_14010c5c0(pbVar7,uVar8 + 1), cVar3 == '\0')) {
      return 0;
    }
    if (uVar8 == 0) {
LAB_14010c79f:
      if (uVar5 != 0) {
        bVar1 = *pbVar7;
        pbVar7 = pbVar7 + 1;
        iVar4 = iVar4 + (uint)bVar1;
        uVar5 = uVar5 - 1;
      }
    }
    else if (uVar8 == 1) {
LAB_14010c78c:
      if (uVar5 != 0) {
        bVar1 = *pbVar7;
        pbVar7 = pbVar7 + 1;
        iVar4 = (iVar4 + (uint)bVar1) * 0x40;
        uVar5 = uVar5 - 1;
        goto LAB_14010c79f;
      }
    }
    else if (uVar8 == 2) {
LAB_14010c779:
      if (uVar5 != 0) {
        bVar1 = *pbVar7;
        pbVar7 = pbVar7 + 1;
        iVar4 = (iVar4 + (uint)bVar1) * 0x40;
        uVar5 = uVar5 - 1;
        goto LAB_14010c78c;
      }
    }
    else if ((uVar8 == 3) && (uVar5 != 0)) {
      pbVar7 = pbVar7 + 1;
      iVar4 = (uint)bVar1 << 6;
      uVar5 = uVar5 - 1;
      goto LAB_14010c779;
    }
    local_res18[0] = iVar4 - *(int *)(&DAT_140247d40 + (ulonglong)((int)cVar2 & 0xffff) * 4);
    if (0x7fffffff < local_res18[0]) {
      local_res18[0] = 0xfffd;
    }
    FUN_1400b97e0(param_2,local_res18,4);
  } while( true );
}



undefined8 FUN_14010c820(undefined8 param_1,undefined8 param_2)

{
  byte bVar1;
  char cVar2;
  char cVar3;
  int iVar4;
  uint uVar5;
  longlong lVar6;
  byte *pbVar7;
  uint uVar8;
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  undefined1 local_res1b;
  undefined4 local_res20;
  
  iVar4 = FUN_1400b8b80();
  if ((iVar4 == 0) || (lVar6 = FUN_1400b8b90(param_1), lVar6 == 0)) {
    return 1;
  }
  pbVar7 = (byte *)FUN_1400b8b90(param_1);
  uVar5 = FUN_1400b8b80(param_1);
  do {
    if (uVar5 == 0) {
      return 1;
    }
    bVar1 = *pbVar7;
    iVar4 = 0;
    cVar2 = (&DAT_140247c40)[bVar1];
    uVar8 = (int)cVar2 & 0xffff;
    if ((uVar5 < uVar8) || (cVar3 = FUN_14010c5c0(pbVar7,uVar8 + 1), cVar3 == '\0')) {
      return 0;
    }
    if (uVar8 == 0) {
LAB_14010c91a:
      if (uVar5 != 0) {
        bVar1 = *pbVar7;
        pbVar7 = pbVar7 + 1;
        iVar4 = iVar4 + (uint)bVar1;
        uVar5 = uVar5 - 1;
      }
    }
    else if (uVar8 == 1) {
LAB_14010c907:
      if (uVar5 != 0) {
        bVar1 = *pbVar7;
        pbVar7 = pbVar7 + 1;
        iVar4 = (iVar4 + (uint)bVar1) * 0x40;
        uVar5 = uVar5 - 1;
        goto LAB_14010c91a;
      }
    }
    else if (uVar8 == 2) {
LAB_14010c8f4:
      if (uVar5 != 0) {
        bVar1 = *pbVar7;
        pbVar7 = pbVar7 + 1;
        iVar4 = (iVar4 + (uint)bVar1) * 0x40;
        uVar5 = uVar5 - 1;
        goto LAB_14010c907;
      }
    }
    else if ((uVar8 == 3) && (uVar5 != 0)) {
      pbVar7 = pbVar7 + 1;
      iVar4 = (uint)bVar1 << 6;
      uVar5 = uVar5 - 1;
      goto LAB_14010c8f4;
    }
    uVar8 = iVar4 - *(int *)(&DAT_140247d40 + (ulonglong)((int)cVar2 & 0xffff) * 4);
    if (0x7fffffff < uVar8) {
      uVar8 = 0xfffd;
    }
    local_res20._3_1_ = (undefined1)(uVar8 >> 0x18);
    local_res1b = (undefined1)uVar8;
    local_res18 = local_res20._3_1_;
    local_res20._2_1_ = (undefined1)(uVar8 >> 0x10);
    local_res19 = local_res20._2_1_;
    local_res20._1_1_ = (undefined1)(uVar8 >> 8);
    local_res1a = local_res20._1_1_;
    local_res20 = uVar8;
    FUN_1400b97e0(param_2,&local_res18,4);
  } while( true );
}



undefined8 FUN_14010c9c0(undefined8 param_1,undefined8 param_2)

{
  int iVar1;
  longlong lVar2;
  ulonglong uVar3;
  uint *puVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  byte local_res18;
  byte local_res19;
  byte local_res1a;
  byte local_res1b;
  
  iVar1 = FUN_1400b8b80();
  if (iVar1 != 0) {
    lVar2 = FUN_1400b8b90(param_1);
    if (lVar2 != 0) {
      uVar3 = FUN_1400b8b80(param_1);
      uVar3 = uVar3 >> 2 & 0x3fffffff;
      if ((int)uVar3 == 0) {
        return 0;
      }
      puVar4 = (uint *)FUN_1400b8b90(param_1);
      do {
        uVar5 = *puVar4;
        uVar6 = (int)uVar3 - 1;
        uVar3 = (ulonglong)uVar6;
        puVar4 = puVar4 + 1;
        if (uVar5 < 0x80) {
          uVar7 = 1;
        }
        else if (uVar5 < 0x800) {
          uVar7 = 2;
        }
        else {
          uVar7 = 3;
          if (0xffff < uVar5) {
            if (uVar5 < 0x200000) {
              uVar7 = 4;
            }
            else {
              uVar5 = 0xfffd;
              uVar7 = 2;
            }
          }
        }
        if (uVar7 == 1) {
LAB_14010cad8:
          local_res18 = (&DAT_140247d58)[uVar7] | (byte)uVar5;
        }
        else {
          if (uVar7 == 2) {
LAB_14010caca:
            local_res19 = (byte)uVar5 & 0x3f | 0x80;
            uVar5 = uVar5 >> 6;
            goto LAB_14010cad8;
          }
          if (uVar7 == 3) {
LAB_14010cabc:
            local_res1a = (byte)uVar5 & 0x3f | 0x80;
            uVar5 = uVar5 >> 6;
            goto LAB_14010caca;
          }
          if (uVar7 == 4) {
            local_res1b = (byte)uVar5 & 0x3f | 0x80;
            uVar5 = uVar5 >> 6;
            goto LAB_14010cabc;
          }
        }
        FUN_1400b97e0(param_2,&local_res18,uVar7);
        if (uVar6 == 0) {
          return 1;
        }
      } while( true );
    }
  }
  return 1;
}



void FUN_14010cb40(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 8) = param_2;
  return;
}



undefined8 * FUN_14010cb50(undefined8 *param_1)

{
  *(undefined1 *)(param_1 + 1) = 0;
  *param_1 = HashConvert::vftable;
  *(undefined4 *)((longlong)param_1 + 0xc) = 0;
  param_1[2] = 0;
  return param_1;
}



void FUN_14010cb70(longlong param_1)

{
  ulonglong uVar1;
  uint uVar2;
  ulonglong uVar3;
  
  uVar1 = 0;
  uVar3 = uVar1;
  if (0 < *(int *)(param_1 + 0xc)) {
    do {
      if (*(longlong *)(*(longlong *)(param_1 + 0x10) + uVar3) != 0) {
        operator_delete(*(void **)(*(longlong *)(param_1 + 0x10) + uVar3));
        *(undefined8 *)(uVar3 + *(longlong *)(param_1 + 0x10)) = 0;
      }
      uVar2 = (int)uVar1 + 1;
      uVar1 = (ulonglong)uVar2;
      uVar3 = uVar3 + 8;
    } while ((int)uVar2 < *(int *)(param_1 + 0xc));
  }
  if (*(void **)(param_1 + 0x10) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x10));
    *(undefined8 *)(param_1 + 0x10) = 0;
  }
  *(undefined4 *)(param_1 + 0xc) = 0;
  return;
}



void FUN_14010cbf0(longlong param_1,int param_2)

{
  undefined1 auVar1 [16];
  __uint64 _Var2;
  void *_Dst;
  
  FUN_14010cb70();
  auVar1._8_8_ = 0;
  auVar1._0_8_ = (longlong)param_2;
  _Var2 = SUB168(ZEXT816(8) * auVar1,0);
  if (SUB168(ZEXT816(8) * auVar1,8) != 0) {
    _Var2 = 0xffffffffffffffff;
  }
  _Dst = operator_new(_Var2);
  *(void **)(param_1 + 0x10) = _Dst;
  memset(_Dst,0,(longlong)param_2 * 8);
  *(int *)(param_1 + 0xc) = param_2;
  return;
}



void FUN_14010cc50(longlong param_1,byte *param_2,uint param_3,undefined8 param_4)

{
  byte bVar1;
  ulonglong uVar2;
  int iVar3;
  uint uVar4;
  void *pvVar5;
  byte *pbVar6;
  undefined4 local_res8;
  undefined8 uVar7;
  undefined1 local_50 [40];
  
  uVar7 = 0xfffffffffffffffe;
  if (*(uint *)(param_1 + 0xc) != 0) {
    local_res8 = (uint)*param_2;
    if (1 < (int)param_3) {
      local_res8._0_2_ = CONCAT11(param_2[1],*param_2);
      local_res8 = (uint)(ushort)local_res8;
    }
    if (2 < (int)param_3) {
      local_res8._0_3_ = CONCAT12(param_2[2],(ushort)local_res8);
      local_res8 = (uint)(uint3)local_res8;
    }
    if (3 < (int)param_3) {
      local_res8 = CONCAT13(param_2[3],(uint3)local_res8);
    }
    uVar2 = (ulonglong)local_res8 % (ulonglong)*(uint *)(param_1 + 0xc);
    if (*(longlong *)(*(longlong *)(param_1 + 0x10) + uVar2 * 8) != 0) {
      pbVar6 = *(byte **)(*(longlong *)(param_1 + 0x10) + uVar2 * 8);
      FUN_1400b8c40(local_50);
      bVar1 = *pbVar6;
      while (bVar1 != 0) {
        if ((bVar1 == param_3) &&
           (iVar3 = memcmp(pbVar6 + 1,param_2,(ulonglong)(uint)bVar1), iVar3 == 0)) {
          pbVar6 = pbVar6 + (ulonglong)bVar1 + 1 + (ulonglong)pbVar6[(ulonglong)bVar1 + 1] + 1;
        }
        else {
          FUN_1400b97e0(local_50,pbVar6,bVar1 + 1,param_4,uVar7);
          pbVar6 = pbVar6 + (int)(bVar1 + 1);
          FUN_1400b97e0(local_50,pbVar6,*pbVar6 + 1);
          pbVar6 = pbVar6 + (int)(*pbVar6 + 1);
        }
        bVar1 = *pbVar6;
      }
      operator_delete(*(void **)(*(longlong *)(param_1 + 0x10) + uVar2 * 8));
      *(undefined8 *)(*(longlong *)(param_1 + 0x10) + uVar2 * 8) = 0;
      iVar3 = FUN_1400b8b80(local_50);
      if (iVar3 != 0) {
        FUN_1400b9550(local_50,0);
        uVar4 = FUN_1400b8b80(local_50);
        pvVar5 = operator_new((ulonglong)uVar4);
        *(void **)(*(longlong *)(param_1 + 0x10) + uVar2 * 8) = pvVar5;
        uVar4 = FUN_1400b8b80(local_50);
        pvVar5 = (void *)FUN_1400b8b90(local_50);
        memcpy(*(void **)(*(longlong *)(param_1 + 0x10) + uVar2 * 8),pvVar5,(ulonglong)uVar4);
      }
      FUN_1400b92d0(local_50);
    }
  }
  return;
}



void FUN_14010ce00(longlong param_1,byte *param_2,int param_3,void *param_4,int param_5)

{
  byte bVar1;
  ulonglong uVar2;
  uint uVar3;
  undefined1 *puVar4;
  void *_Dst;
  int iVar5;
  byte *pbVar6;
  undefined4 local_res8;
  
  if (*(uint *)(param_1 + 0xc) != 0) {
    iVar5 = 0;
    local_res8 = (uint)*param_2;
    if (1 < param_3) {
      local_res8._0_2_ = CONCAT11(param_2[1],*param_2);
      local_res8 = (uint)(ushort)local_res8;
    }
    if (2 < param_3) {
      local_res8._0_3_ = CONCAT12(param_2[2],(ushort)local_res8);
      local_res8 = (uint)(uint3)local_res8;
    }
    if (3 < param_3) {
      local_res8 = CONCAT13(param_2[3],(uint3)local_res8);
    }
    uVar2 = (ulonglong)local_res8 % (ulonglong)*(uint *)(param_1 + 0xc);
    if (*(longlong *)(*(longlong *)(param_1 + 0x10) + uVar2 * 8) == 0) {
      puVar4 = operator_new((longlong)(param_3 + 3 + param_5));
      *(undefined1 **)(*(longlong *)(param_1 + 0x10) + uVar2 * 8) = puVar4;
    }
    else {
      pbVar6 = *(byte **)(*(longlong *)(param_1 + 0x10) + (longlong)(int)uVar2 * 8);
      if (pbVar6 != (byte *)0x0) {
        bVar1 = *pbVar6;
        while (bVar1 != 0) {
          uVar3 = (uint)pbVar6[(int)(bVar1 + 1)];
          iVar5 = iVar5 + (uint)bVar1 + 2 + uVar3;
          pbVar6 = pbVar6 + (int)(bVar1 + 1) + (int)(uVar3 + 1);
          bVar1 = *pbVar6;
        }
        iVar5 = iVar5 + 1;
      }
      _Dst = operator_new((longlong)(iVar5 + param_3 + 2 + param_5));
      memcpy(_Dst,*(void **)(*(longlong *)(param_1 + 0x10) + uVar2 * 8),(longlong)iVar5);
      operator_delete(*(void **)(*(longlong *)(param_1 + 0x10) + uVar2 * 8));
      *(void **)(*(longlong *)(param_1 + 0x10) + uVar2 * 8) = _Dst;
      puVar4 = (undefined1 *)((longlong)_Dst + (longlong)(iVar5 + -1));
    }
    *puVar4 = (char)param_3;
    memcpy(puVar4 + 1,param_2,(longlong)param_3);
    puVar4 = puVar4 + 1 + param_3;
    *puVar4 = (char)param_5;
    memcpy(puVar4 + 1,param_4,(longlong)param_5);
    puVar4[(longlong)param_5 + 1] = 0;
  }
  return;
}



void FUN_14010cf90(longlong param_1,longlong param_2)

{
  byte bVar1;
  byte bVar2;
  byte bVar3;
  ulonglong uVar4;
  uint uVar5;
  void *_Dst;
  byte *_Src;
  byte *pbVar6;
  byte *_Src_00;
  byte *pbVar7;
  ulonglong _Size;
  int iVar8;
  ulonglong _Size_00;
  ushort local_res18;
  undefined4 local_res20;
  
  local_res18 = 0;
  if (*(short *)(param_1 + 0xc) != 0) {
    do {
      if (*(longlong *)(*(longlong *)(param_1 + 0x10) + (ulonglong)local_res18 * 8) != 0) {
        pbVar7 = *(byte **)(*(longlong *)(param_1 + 0x10) + (ulonglong)local_res18 * 8);
        bVar1 = *pbVar7;
        while (bVar1 != 0) {
          _Src = pbVar7 + 1;
          _Size_00 = (ulonglong)bVar1;
          pbVar6 = _Src + _Size_00;
          bVar2 = *pbVar6;
          _Size = (ulonglong)bVar2;
          _Src_00 = pbVar6 + 1;
          pbVar7 = _Src_00 + _Size;
          if (*(uint *)(param_2 + 0xc) != 0) {
            iVar8 = 0;
            local_res20 = (uint)*_Src_00;
            if (1 < bVar2) {
              local_res20._0_2_ = CONCAT11(pbVar6[2],*_Src_00);
              local_res20 = (uint)(ushort)local_res20;
            }
            if (2 < bVar2) {
              local_res20._0_3_ = CONCAT12(pbVar6[3],(ushort)local_res20);
              local_res20 = (uint)(uint3)local_res20;
            }
            if (3 < bVar2) {
              local_res20 = CONCAT13(pbVar6[4],(uint3)local_res20);
            }
            uVar4 = (ulonglong)local_res20 % (ulonglong)*(uint *)(param_2 + 0xc);
            if (*(longlong *)(*(longlong *)(param_2 + 0x10) + uVar4 * 8) == 0) {
              pbVar6 = operator_new((longlong)(int)(bVar2 + 3 + (uint)bVar1));
              *(byte **)(*(longlong *)(param_2 + 0x10) + uVar4 * 8) = pbVar6;
            }
            else {
              pbVar6 = *(byte **)(*(longlong *)(param_2 + 0x10) + (longlong)(int)uVar4 * 8);
              if (pbVar6 != (byte *)0x0) {
                iVar8 = 0;
                bVar3 = *pbVar6;
                while (bVar3 != 0) {
                  uVar5 = (uint)pbVar6[(int)(bVar3 + 1)];
                  iVar8 = iVar8 + (uint)bVar3 + 2 + uVar5;
                  pbVar6 = pbVar6 + (int)(bVar3 + 1) + (int)(uVar5 + 1);
                  bVar3 = *pbVar6;
                }
                iVar8 = iVar8 + 1;
              }
              _Dst = operator_new((longlong)(int)(iVar8 + (uint)bVar2 + 2 + (uint)bVar1));
              memcpy(_Dst,*(void **)(*(longlong *)(param_2 + 0x10) + uVar4 * 8),(longlong)iVar8);
              operator_delete(*(void **)(*(longlong *)(param_2 + 0x10) + uVar4 * 8));
              *(void **)(*(longlong *)(param_2 + 0x10) + uVar4 * 8) = _Dst;
              pbVar6 = (byte *)((longlong)_Dst + (longlong)(iVar8 + -1));
            }
            *pbVar6 = bVar2;
            memcpy(pbVar6 + 1,_Src_00,_Size);
            pbVar6 = pbVar6 + 1 + _Size;
            *pbVar6 = bVar1;
            memcpy(pbVar6 + 1,_Src,_Size_00);
            pbVar6[_Size_00 + 1] = 0;
          }
          bVar1 = *pbVar7;
        }
      }
      local_res18 = local_res18 + 1;
    } while (local_res18 < *(ushort *)(param_1 + 0xc));
  }
  return;
}



void FUN_14010d220(longlong param_1,undefined1 *param_2,uint param_3,void *param_4,uint *param_5)

{
  byte bVar1;
  byte bVar2;
  ulonglong uVar3;
  uint *puVar4;
  int iVar5;
  size_t _Size;
  byte *_Buf1;
  byte *pbVar6;
  
  puVar4 = param_5;
  *param_5 = 0;
  if (*(uint *)(param_1 + 0xc) != 0) {
    param_5._1_1_ = 0;
    param_5._2_1_ = 0;
    param_5._3_1_ = 0;
    if (1 < (int)param_3) {
      param_5._1_1_ = param_2[1];
    }
    if (2 < (int)param_3) {
      param_5._2_1_ = param_2[2];
    }
    if (3 < (int)param_3) {
      param_5._3_1_ = param_2[3];
    }
    uVar3 = (ulonglong)
            CONCAT13(param_5._3_1_,CONCAT12(param_5._2_1_,CONCAT11(param_5._1_1_,*param_2))) %
            (ulonglong)*(uint *)(param_1 + 0xc);
    if (*(longlong *)(*(longlong *)(param_1 + 0x10) + uVar3 * 8) != 0) {
      pbVar6 = *(byte **)(*(longlong *)(param_1 + 0x10) + uVar3 * 8);
      bVar1 = *pbVar6;
      while (bVar1 != 0) {
        _Buf1 = pbVar6 + 1;
        if (bVar1 == param_3) {
          _Size = (size_t)(int)(uint)bVar1;
          iVar5 = memcmp(_Buf1,param_2,_Size);
          if (iVar5 == 0) {
            bVar2 = _Buf1[bVar1];
            memcpy(param_4,pbVar6 + (ulonglong)bVar1 + 2,(ulonglong)(uint)bVar2);
            *puVar4 = (uint)bVar2;
            return;
          }
        }
        else {
          _Size = (size_t)(int)(uint)bVar1;
        }
        pbVar6 = _Buf1 + _Size + (int)(_Buf1[_Size] + 1);
        bVar1 = *pbVar6;
      }
    }
  }
  return;
}



undefined8 * FUN_14010d330(undefined8 *param_1,uint param_2)

{
  *param_1 = HashConvert::vftable;
  FUN_14010cb70();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_14010d370(byte *param_1,int param_2,ushort *param_3)

{
  byte bVar1;
  byte bVar2;
  
  bVar1 = *param_1;
  if (bVar1 < 0x80) {
    *param_3 = (ushort)bVar1;
    return 1;
  }
  if (0xc1 < bVar1) {
    if (bVar1 < 0xe0) {
      if (param_2 < 2) {
        return 0xfffffffe;
      }
      if ((param_1[1] ^ 0x80) < 0x40) {
        *param_3 = (ushort)(bVar1 & 0x1f) << 6 | (ushort)(param_1[1] ^ 0x80);
        return 2;
      }
    }
    else if (bVar1 < 0xf0) {
      if (param_2 < 3) {
        return 0xfffffffe;
      }
      bVar2 = param_1[1] ^ 0x80;
      if (((bVar2 < 0x40) && ((param_1[2] ^ 0x80) < 0x40)) &&
         ((0xe0 < bVar1 || (0x9f < param_1[1])))) {
        *param_3 = ((ushort)bVar1 << 6 | (ushort)bVar2) << 6 | (ushort)(param_1[2] ^ 0x80);
        return 3;
      }
    }
  }
  return 0xffffffff;
}



undefined8 * FUN_14010d420(undefined8 *param_1)

{
  *param_1 = UnicodeLookup::vftable;
  memset(param_1 + 1,0,0x100);
  return param_1;
}



undefined8 * FUN_14010d450(undefined8 *param_1,byte param_2)

{
  *param_1 = UnicodeLookup::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14010d480(undefined8 param_1,undefined8 param_2)

{
  char cVar1;
  int iVar2;
  longlong lVar3;
  undefined8 uVar4;
  char *pcVar5;
  undefined2 *puVar6;
  
  puVar6 = &DAT_1403170f0;
  for (lVar3 = 0x80; lVar3 != 0; lVar3 = lVar3 + -1) {
    *puVar6 = 0xffff;
    puVar6 = puVar6 + 1;
  }
  uVar4 = CONCAT71((int7)((ulonglong)param_2 >> 8),1);
  memset(&DAT_1403172f0,(int)uVar4,0x80);
  memset(&DAT_1403171f0,(int)CONCAT71((int7)((ulonglong)uVar4 >> 8),1),0x80);
  pcVar5 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\'(),-./:?";
  lVar3 = 0x47;
  do {
    cVar1 = *pcVar5;
    pcVar5 = pcVar5 + 1;
    lVar3 = lVar3 + -1;
    (&DAT_1403171f0)[cVar1] = 0;
    (&DAT_1403172f0)[cVar1] = 0;
  } while (lVar3 != 0);
  pcVar5 = " \t\r\n";
  lVar3 = 4;
  do {
    cVar1 = *pcVar5;
    pcVar5 = pcVar5 + 1;
    lVar3 = lVar3 + -1;
    (&DAT_1403171f0)[cVar1] = 0;
    (&DAT_1403172f0)[cVar1] = 0;
  } while (lVar3 != 0);
  pcVar5 = "!\"#$%*;<=>@[]^`{|}";
  lVar3 = 0x12;
  do {
    cVar1 = *pcVar5;
    pcVar5 = pcVar5 + 1;
    lVar3 = lVar3 + -1;
    (&DAT_1403172f0)[cVar1] = 0;
  } while (lVar3 != 0);
  iVar2 = 0;
  pcVar5 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  do {
    cVar1 = *pcVar5;
    pcVar5 = pcVar5 + 1;
    (&DAT_1403170f0)[cVar1] = (short)iVar2;
    iVar2 = iVar2 + 1;
  } while (iVar2 < 0x40);
  s___AVUnicodeLookup___140309390[0x14] = '\0';
  return;
}



undefined8 FUN_14010d580(undefined8 param_1,undefined8 param_2)

{
  bool bVar1;
  bool bVar2;
  bool bVar3;
  bool bVar4;
  int iVar5;
  uint uVar6;
  longlong lVar7;
  ushort *puVar8;
  uint uVar9;
  uint uVar10;
  uint uVar11;
  ulonglong uVar12;
  ushort uVar13;
  ushort local_res20;
  ushort *local_48;
  
  lVar7 = FUN_1400b8b90();
  if ((lVar7 == 0) || (iVar5 = FUN_1400b8b80(param_1), iVar5 == 0)) {
    return 1;
  }
  bVar1 = false;
  uVar10 = 0;
  uVar11 = 0;
  puVar8 = (ushort *)FUN_1400b8b90(param_1);
  uVar6 = FUN_1400b8b80(param_1);
  uVar6 = uVar6 >> 1;
  if (uVar6 != 0) {
    if (*puVar8 == 0xfeff) {
      puVar8 = puVar8 + 1;
      uVar6 = uVar6 - 1;
      if (uVar6 == 0) {
        return 1;
      }
    }
    uVar13 = local_res20;
    local_48 = puVar8;
    if (s___AVUnicodeLookup___140309390[0x14] != '\0') {
      FUN_14010d480();
    }
LAB_14010d642:
    do {
      while( true ) {
        bVar2 = false;
        if (uVar6 != 0) break;
        bVar2 = true;
LAB_14010d6d0:
        bVar3 = false;
        bVar4 = false;
        if (bVar1) {
          iVar5 = ((int)uVar11 / 6 + ((int)uVar11 >> 0x1f) + 1 +
                  (int)(((longlong)(int)uVar11 / 6 + ((longlong)(int)uVar11 >> 0x3f) & 0xffffffffU)
                       >> 0x1f)) * 6 - uVar11;
          iVar5 = iVar5 + (iVar5 / 6 + (iVar5 >> 0x1f) +
                          (int)(((longlong)iVar5 / 6 + ((longlong)iVar5 >> 0x3f) & 0xffffffffU) >>
                               0x1f)) * -6;
          uVar9 = 0 << ((' ' - (char)iVar5) - (char)uVar11 & 0x1fU);
          uVar11 = uVar11 + iVar5;
          goto LAB_14010d728;
        }
LAB_14010d797:
        if (bVar2) {
          return 1;
        }
        FUN_1400b9550(param_2,(char)uVar13);
      }
      uVar13 = *puVar8;
      puVar8 = puVar8 + 1;
      uVar6 = uVar6 - 1;
      local_res20 = uVar13;
      local_48 = puVar8;
      if ((uVar13 < 0x80) && ((&DAT_1403171f0)[uVar13] == '\0')) goto LAB_14010d6d0;
      bVar4 = true;
      if (!bVar1) {
        FUN_1400b9550(param_2,0x2b);
        if (uVar13 == 0x2b) {
          FUN_1400b9550(param_2,0x2d);
          goto LAB_14010d642;
        }
        bVar1 = true;
      }
      bVar3 = true;
      uVar9 = (uint)uVar13 << (0x10U - (char)uVar11 & 0x1f);
      uVar11 = uVar11 + 0x10;
LAB_14010d728:
      uVar10 = uVar10 | uVar9;
      if (5 < (int)uVar11) {
        uVar12 = (ulonglong)uVar11 / 6;
        uVar11 = uVar11 + (int)uVar12 * -6;
        uVar9 = uVar10;
        do {
          uVar10 = uVar9 << 6;
          FUN_1400b9550(param_2,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
                                [uVar9 >> 0x1a]);
          uVar12 = uVar12 - 1;
          puVar8 = local_48;
          uVar13 = local_res20;
          uVar9 = uVar10;
          bVar3 = bVar4;
        } while (uVar12 != 0);
      }
      if (!bVar3) {
        FUN_1400b9550(param_2,0x2d);
        bVar1 = false;
        goto LAB_14010d797;
      }
    } while (!bVar2);
  }
  return 1;
}



undefined1 FUN_14010d7d0(undefined8 param_1,undefined8 param_2)

{
  byte bVar1;
  bool bVar2;
  bool bVar3;
  bool bVar4;
  bool bVar5;
  bool bVar6;
  undefined1 uVar7;
  int iVar8;
  longlong lVar9;
  char *pcVar10;
  uint uVar11;
  uint uVar12;
  ulonglong uVar13;
  ulonglong uVar14;
  ulonglong uVar15;
  undefined2 local_54 [2];
  uint local_50;
  
  uVar7 = 1;
  lVar9 = FUN_1400b8b90();
  if ((lVar9 == 0) || (iVar8 = FUN_1400b8b80(param_1), iVar8 == 0)) {
    return 1;
  }
  uVar13 = 0;
  uVar11 = 0;
  bVar3 = false;
  bVar4 = false;
  local_50 = 0;
  bVar2 = false;
  FUN_1400b9550(param_1,0x61);
  pcVar10 = (char *)FUN_1400b8b90(param_1);
  iVar8 = FUN_1400b8b80(param_1);
  if (s___AVUnicodeLookup___140309390[0x14] != '\0') {
    FUN_14010d480();
  }
  if (iVar8 == 0) goto LAB_14010d88c;
  do {
    uVar11 = (uint)*pcVar10;
    pcVar10 = pcVar10 + 1;
    iVar8 = iVar8 + -1;
LAB_14010d88c:
    if (bVar2) {
      if (((iVar8 == 0) || (0x7f < uVar11)) || ((short)(&DAT_1403170f0)[uVar11] < 0)) {
        bVar5 = true;
        bVar2 = false;
        bVar6 = true;
        if ((iVar8 == 0) || ((uVar11 != 0x2b && (uVar11 != 0x2d)))) {
          if (bVar4) {
            if ((iVar8 == 0) && ((uVar11 == 0x2b || (uVar11 == 0x2d)))) {
              uVar11 = 0;
            }
          }
          else {
            uVar7 = 0;
          }
        }
        else {
          uVar12 = (uint)*pcVar10;
          pcVar10 = pcVar10 + 1;
          iVar8 = iVar8 + -1;
          if ((bVar3) && (uVar11 == 0x2d)) {
            local_54[0] = 0x2b;
            FUN_1400b97e0(param_2,local_54,2);
            uVar11 = uVar12;
          }
          else {
            uVar11 = uVar12;
            if (!bVar4) {
              uVar7 = 0;
            }
          }
        }
      }
      else {
        bVar5 = false;
        bVar6 = false;
        bVar3 = false;
        uVar13 = (ulonglong)
                 ((uint)uVar13 |
                 ((int)(short)(&DAT_1403170f0)[uVar11] & 0x3fU) << (0x1aU - (char)local_50 & 0x1f));
        local_50 = local_50 + 6;
      }
      if (0xf < (int)local_50) {
        bVar4 = true;
        uVar15 = (ulonglong)(local_50 >> 4);
        local_50 = local_50 + (local_50 >> 4) * -0x10;
        uVar14 = uVar13;
        do {
          uVar13 = (ulonglong)(uint)((int)uVar14 << 0x10);
          local_54[0] = (undefined2)(uVar14 >> 0x10);
          FUN_1400b97e0(param_2,local_54,2);
          uVar15 = uVar15 - 1;
          uVar14 = uVar13;
          bVar5 = bVar6;
        } while (uVar15 != 0);
      }
      if (bVar5) {
        uVar12 = (uint)uVar13;
        bVar1 = (byte)local_50;
        local_50 = 0;
        uVar13 = (ulonglong)(uVar12 << (bVar1 & 0x1f));
        if (uVar12 >> (0x20 - bVar1 & 0x1f) != 0) {
          uVar7 = 0;
        }
      }
      if (!bVar2) goto LAB_14010da0c;
    }
    else {
LAB_14010da0c:
      if (uVar11 == 0x2b) {
        bVar2 = true;
        bVar4 = false;
        bVar3 = true;
      }
      else {
        if (0x7f < uVar11) {
          uVar7 = 0;
        }
        if (uVar11 != 0) {
          local_54[0] = (undefined2)uVar11;
          FUN_1400b97e0(param_2,local_54,2);
        }
      }
    }
    if (iVar8 == 0) {
      FUN_1400b8be0(param_1,1);
      FUN_1400b8be0(param_2,2);
      return uVar7;
    }
  } while( true );
}



undefined8 * FUN_14010dac0(undefined8 *param_1)

{
  *param_1 = Korean::vftable;
  return param_1;
}



void FUN_14010dad0(undefined8 *param_1)

{
  *param_1 = Korean::vftable;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14010dae0(undefined8 param_1,longlong param_2,int param_3,undefined8 param_4)

{
  char cVar1;
  char cVar2;
  bool bVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  int iVar8;
  int iVar9;
  undefined1 auStack_118 [32];
  char local_f8 [208];
  ulonglong local_28;
  
  if ((param_2 != 0) && (local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_118, param_3 != 0)) {
    iVar9 = 0;
    bVar3 = false;
    lVar5 = 0;
    lVar6 = 0;
    do {
      cVar1 = *(char *)(lVar6 + param_2);
      iVar8 = param_3 + -1;
      lVar7 = lVar6 + 1;
      if (cVar1 == '\x1b') {
        if ((((2 < iVar8) && (*(char *)(lVar7 + param_2) == '$')) &&
            (*(char *)(lVar6 + 2 + param_2) == ')')) && (*(char *)(lVar6 + 3 + param_2) == 'C')) {
          bVar3 = false;
          lVar7 = lVar6 + 4;
          iVar8 = param_3 + -4;
        }
      }
      else if (cVar1 == '\x0e') {
        bVar3 = true;
      }
      else if (cVar1 == '\x0f') {
        bVar3 = false;
      }
      else {
        if (bVar3) {
          if (iVar8 == 0) break;
          cVar2 = *(char *)(lVar7 + param_2);
          lVar4 = lVar5 + 1;
          local_f8[lVar5] = cVar1 + -0x80;
          iVar8 = param_3 + -2;
          lVar7 = lVar6 + 2;
          iVar9 = iVar9 + 1;
          if (lVar4 == 200) {
            FUN_1400b97e0(param_4,local_f8);
            iVar9 = 0;
            lVar4 = 0;
          }
          local_f8[lVar4] = cVar2 + -0x80;
          lVar5 = lVar4;
        }
        else {
          local_f8[lVar5] = cVar1;
        }
        lVar5 = lVar5 + 1;
        iVar9 = iVar9 + 1;
        if (lVar5 == 200) {
          FUN_1400b97e0(param_4,local_f8);
          iVar9 = 0;
          lVar5 = 0;
        }
      }
      param_3 = iVar8;
      lVar6 = lVar7;
    } while (param_3 != 0);
    if (iVar9 != 0) {
      FUN_1400b97e0(param_4,local_f8);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14010dc50(undefined8 param_1,byte *param_2,int param_3,undefined8 param_4)

{
  byte bVar1;
  byte bVar2;
  bool bVar3;
  longlong lVar4;
  int iVar5;
  byte *pbVar6;
  int iVar7;
  undefined1 auStack_128 [32];
  byte local_108 [208];
  ulonglong local_38;
  
  if ((param_2 != (byte *)0x0) && (local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_128, param_3 != 0))
  {
    bVar3 = false;
    iVar5 = 0;
    FUN_1400b9550(param_4,0x1b);
    FUN_1400b9550(param_4,0x24);
    FUN_1400b9550(param_4,0x29);
    FUN_1400b9550(param_4,0x43);
    do {
      bVar1 = *param_2;
      iVar7 = param_3 + -1;
      pbVar6 = param_2 + 1;
      if (bVar1 < 0x80) {
        if (bVar3) {
          lVar4 = (longlong)iVar5;
          iVar5 = iVar5 + 1;
          local_108[lVar4] = 0xf;
          if (iVar5 == 200) {
            FUN_1400b97e0(param_4,local_108,200);
            iVar5 = 0;
          }
          bVar3 = false;
        }
        local_108[iVar5] = bVar1;
      }
      else {
        if (iVar7 == 0) break;
        bVar2 = *pbVar6;
        pbVar6 = param_2 + 2;
        iVar7 = param_3 + -2;
        if (!bVar3) {
          lVar4 = (longlong)iVar5;
          iVar5 = iVar5 + 1;
          local_108[lVar4] = 0xe;
          if (iVar5 == 200) {
            FUN_1400b97e0(param_4,local_108,200);
            iVar5 = 0;
          }
          bVar3 = true;
        }
        lVar4 = (longlong)iVar5;
        iVar5 = iVar5 + 1;
        local_108[lVar4] = bVar1 + 0x80;
        if (iVar5 == 200) {
          FUN_1400b97e0(param_4,local_108,200);
          iVar5 = 0;
        }
        local_108[iVar5] = bVar2 + 0x80;
      }
      iVar5 = iVar5 + 1;
      if (iVar5 == 200) {
        FUN_1400b97e0(param_4,local_108,200);
        iVar5 = 0;
      }
      param_2 = pbVar6;
      param_3 = iVar7;
    } while (iVar7 != 0);
    if (iVar5 != 0) {
      FUN_1400b97e0(param_4,local_108,iVar5);
    }
  }
  return;
}



undefined8 * FUN_14010de00(undefined8 *param_1,byte param_2)

{
  *param_1 = Korean::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_14010de30(undefined8 *param_1)

{
  *param_1 = Japanese::vftable;
  return param_1;
}



void FUN_14010de40(undefined8 *param_1)

{
  *param_1 = Japanese::vftable;
  return;
}



undefined8
FUN_14010de50(undefined8 param_1,byte *param_2,int param_3,int *param_4,uint *param_5,int param_6)

{
  byte bVar1;
  int iVar2;
  int iVar3;
  uint uVar4;
  bool bVar5;
  bool bVar6;
  bool bVar7;
  bool bVar8;
  bool bVar9;
  undefined8 uVar10;
  
  if (param_3 == 0) {
    return 0;
  }
  bVar8 = false;
  bVar9 = false;
  iVar2 = *param_4;
  bVar6 = false;
  uVar10 = 0;
  *param_5 = 0;
  bVar5 = bVar6;
  if (param_6 == 5) {
    bVar1 = *param_2;
    bVar7 = true;
    uVar10 = 1;
    *param_5 = (uint)bVar1;
    if (bVar1 == 0xde) {
      iVar3 = *param_4;
      bVar5 = bVar7;
      if ((((0xb5 < iVar3) && (iVar3 < 0xc5)) || ((0xc9 < iVar3 && (iVar3 < 0xcf)))) ||
         (iVar3 == 0xb3)) goto LAB_14010df7c;
    }
    else if (((bVar1 == 0xdf) && (0xc9 < *param_4)) && (bVar8 = bVar7, *param_4 < 0xcf))
    goto LAB_14010df7c;
  }
  else {
    bVar8 = bVar9;
    if ((param_6 != 4) || (*param_2 != 0x8e)) goto LAB_14010df7c;
    if (param_3 == 1) {
      return 0;
    }
    bVar1 = param_2[1];
    uVar10 = 2;
    *param_5 = (uint)bVar1;
    if (bVar1 == 0xde) {
      iVar3 = *param_4;
      if ((((0xb5 < iVar3) && (iVar3 < 0xc5)) || ((0xc9 < iVar3 && (iVar3 < 0xcf)))) ||
         (iVar3 == 0xb3)) {
        bVar5 = true;
        goto LAB_14010df7c;
      }
    }
    else if (((bVar1 == 0xdf) && (0xc9 < *param_4)) && (*param_4 < 0xcf)) {
      bVar8 = true;
      goto LAB_14010df7c;
    }
  }
  uVar10 = 0;
  bVar5 = bVar6;
  bVar8 = bVar9;
LAB_14010df7c:
  if ((0xa0 < *param_4) && (*param_4 < 0xe0)) {
    *param_4 = *(int *)(&DAT_140308ec8 + (longlong)iVar2 * 8);
    *param_5 = *(uint *)(&DAT_140308ecc + (longlong)iVar2 * 8);
  }
  if (bVar5) {
    uVar4 = *param_5;
    if (((0x49 < (int)uVar4) && ((int)uVar4 < 0x68)) || ((0x6d < (int)uVar4 && ((int)uVar4 < 0x7b)))
       ) {
      *param_5 = uVar4 + 1;
      return uVar10;
    }
    if ((*param_4 == 0x83) && (uVar4 == 0x45)) {
      *param_5 = 0x94;
      return uVar10;
    }
  }
  else if (((bVar8) && (uVar4 = *param_5, 0x6d < (int)uVar4)) && ((int)uVar4 < 0x7b)) {
    *param_5 = uVar4 + 2;
  }
  return uVar10;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14010e030(undefined8 param_1,longlong param_2,int param_3,undefined8 param_4)

{
  bool bVar1;
  char cVar2;
  longlong lVar3;
  char cVar4;
  int iVar5;
  int iVar6;
  byte bVar7;
  byte bVar8;
  int iVar9;
  int iVar10;
  int iVar11;
  bool bVar12;
  undefined1 auStack_168 [32];
  int *local_148;
  undefined4 local_140;
  uint local_138;
  int local_134;
  longlong local_130;
  undefined8 local_128;
  byte local_118 [208];
  ulonglong local_48;
  
  if (param_2 == 0) {
    return;
  }
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_168;
  if (param_3 == 0) {
    return;
  }
  iVar11 = 0;
  bVar1 = false;
  iVar5 = 0;
  local_130 = param_2;
  local_128 = param_1;
  do {
    iVar9 = param_3 + -1;
    iVar10 = iVar11 + 1;
    bVar7 = *(byte *)(iVar11 + local_130);
    if (bVar7 == 0xfa) {
      if (iVar9 == 0) break;
      param_3 = param_3 + -2;
      iVar11 = iVar11 + 2;
      cVar4 = *(char *)(iVar10 + local_130);
      if ((byte)(cVar4 + 0xa4U) < 0x23) {
        bVar7 = 0x79;
        bVar8 = cVar4 - 0x3b;
      }
      else if ((byte)(cVar4 + 0x70U) < 0x2b) {
        bVar7 = 0x79;
        bVar8 = cVar4 - 0x3c;
      }
      else if ((byte)(cVar4 + 0x45U) < 0x42) {
        bVar7 = 0x7a;
        bVar8 = cVar4 + 0x66;
      }
      else {
        if ((byte)(cVar4 - 0x40U) < 10) {
          bVar8 = cVar4 + 0x31;
        }
        else {
          iVar10 = iVar11;
          iVar9 = param_3;
          if (2 < (byte)(cVar4 + 0xabU)) goto LAB_14010e5e6;
          bVar8 = cVar4 + 0x27;
        }
        bVar7 = 0x7c;
      }
      if (!bVar1) {
        iVar10 = iVar5 + 1;
        bVar1 = true;
        local_118[iVar5] = 0x1b;
        if (iVar10 == 200) {
          FUN_1400b97e0(param_4,local_118,200);
          iVar10 = 0;
        }
        iVar9 = iVar10 + 1;
        local_118[iVar10] = 0x24;
        if (iVar9 == 200) {
          FUN_1400b97e0(param_4,local_118,200);
          iVar9 = 0;
        }
        iVar5 = iVar9 + 1;
        local_118[iVar9] = 0x42;
        if (iVar5 == 200) {
          FUN_1400b97e0(param_4,local_118,200);
          iVar5 = 0;
        }
      }
LAB_14010e192:
      lVar3 = (longlong)iVar5;
      iVar5 = iVar5 + 1;
      local_118[lVar3] = bVar7;
      if (iVar5 == 200) {
        FUN_1400b97e0(param_4,local_118,200);
        iVar5 = 0;
      }
LAB_14010e1b6:
      local_118[iVar5] = bVar8;
LAB_14010e6de:
      iVar5 = iVar5 + 1;
      if (iVar5 == 200) {
        FUN_1400b97e0(param_4,local_118,200);
        iVar5 = 0;
      }
    }
    else {
      if (bVar7 == 0xfb) {
        if (iVar9 != 0) {
          param_3 = param_3 + -2;
          iVar11 = iVar11 + 2;
          cVar4 = *(char *)(iVar10 + local_130);
          if ((byte)(cVar4 - 0x40U) < 0x1c) {
            bVar7 = 0x7a;
            bVar8 = cVar4 + 0x23;
          }
          else if ((byte)(cVar4 + 0xa4U) < 0x23) {
            bVar7 = 0x7b;
            bVar8 = cVar4 - 0x3b;
          }
          else if ((byte)(cVar4 + 0x80U) < 0x3b) {
            bVar7 = 0x7b;
            bVar8 = cVar4 - 0x3c;
          }
          else {
            iVar10 = iVar11;
            iVar9 = param_3;
            if (0x41 < (byte)(cVar4 + 0x45U)) goto LAB_14010e5e6;
            bVar7 = 0x7c;
            bVar8 = cVar4 + 0x66;
          }
          if (!bVar1) {
            iVar10 = iVar5 + 1;
            bVar1 = true;
            local_118[iVar5] = 0x1b;
            if (iVar10 == 200) {
              FUN_1400b97e0(param_4,local_118,200);
              iVar10 = 0;
            }
            iVar9 = iVar10 + 1;
            local_118[iVar10] = 0x24;
            if (iVar9 == 200) {
              FUN_1400b97e0(param_4,local_118,200);
              iVar9 = 0;
            }
            iVar5 = iVar9 + 1;
            local_118[iVar9] = 0x42;
            if (iVar5 == 200) {
              FUN_1400b97e0(param_4,local_118,200);
              iVar5 = 0;
            }
          }
          lVar3 = (longlong)iVar5;
          iVar5 = iVar5 + 1;
          local_118[lVar3] = bVar7;
          if (iVar5 == 200) {
            FUN_1400b97e0(param_4,local_118,200);
            iVar5 = 0;
            local_118[0] = bVar8;
            goto LAB_14010e6de;
          }
          goto LAB_14010e1b6;
        }
        break;
      }
      if (bVar7 == 0xfc) {
        if (iVar9 != 0) {
          lVar3 = (longlong)iVar10;
          param_3 = param_3 + -2;
          iVar11 = iVar11 + 2;
          iVar10 = iVar11;
          iVar9 = param_3;
          if ((byte)(*(char *)(lVar3 + local_130) - 0x40U) < 0xc) {
            bVar8 = *(char *)(lVar3 + local_130) - 0x23;
            if (!bVar1) {
              iVar10 = iVar5 + 1;
              bVar1 = true;
              local_118[iVar5] = 0x1b;
              if (iVar10 == 200) {
                FUN_1400b97e0(param_4,local_118,200);
                iVar10 = 0;
              }
              iVar9 = iVar10 + 1;
              local_118[iVar10] = 0x24;
              if (iVar9 == 200) {
                FUN_1400b97e0(param_4,local_118,200);
                iVar9 = 0;
              }
              iVar5 = iVar9 + 1;
              local_118[iVar9] = 0x42;
              if (iVar5 == 200) {
                FUN_1400b97e0(param_4,local_118,200);
                iVar5 = 0;
              }
            }
            lVar3 = (longlong)iVar5;
            iVar5 = iVar5 + 1;
            local_118[lVar3] = 0x7c;
            if (iVar5 != 200) goto LAB_14010e1b6;
            FUN_1400b97e0(param_4,local_118,200);
            iVar5 = 0;
            local_118[0] = bVar8;
            goto LAB_14010e6de;
          }
LAB_14010e5e6:
          iVar11 = iVar10;
          param_3 = iVar9;
          if (!bVar1) {
LAB_14010e6d6:
            local_118[iVar5] = bVar7;
            goto LAB_14010e6de;
          }
          if (bVar7 < 0x81) goto LAB_14010e65e;
          if (iVar9 != 0) {
            param_3 = iVar9 + -1;
            bVar8 = *(byte *)(iVar10 + local_130);
            iVar11 = iVar10 + 1;
            bVar12 = bVar8 < 0x9f;
            cVar4 = -0x50;
            if (bVar7 < 0xa0) {
              cVar4 = 'p';
            }
            if (bVar12) {
              bVar8 = bVar8 - ((0x7f < bVar8) + '\x1f');
              bVar7 = (bVar7 - cVar4) * '\x02' - bVar12;
            }
            else {
              bVar8 = bVar8 + 0x82;
              bVar7 = (bVar7 - cVar4) * '\x02' - bVar12;
            }
            goto LAB_14010e192;
          }
        }
        break;
      }
      if ((bVar7 == 0xd) || (bVar7 == 10)) {
        iVar11 = iVar10;
        param_3 = iVar9;
        if (bVar1) {
LAB_14010e65e:
          iVar11 = iVar5 + 1;
          bVar1 = false;
          local_118[iVar5] = 0x1b;
          if (iVar11 == 200) {
            FUN_1400b97e0(param_4,local_118,200);
            iVar11 = 0;
          }
          iVar6 = iVar11 + 1;
          local_118[iVar11] = 0x28;
          if (iVar6 == 200) {
            FUN_1400b97e0(param_4,local_118,200);
            iVar6 = 0;
          }
          iVar5 = iVar6 + 1;
          local_118[iVar6] = 0x42;
          iVar11 = iVar10;
          param_3 = iVar9;
          if (iVar5 == 200) {
            FUN_1400b97e0(param_4,local_118,200);
            iVar5 = 0;
          }
        }
        goto LAB_14010e6d6;
      }
      if (((0x80 < bVar7) && (bVar7 < 0xa0)) || ((0xdf < bVar7 && (bVar7 < 0xf0)))) {
        if (iVar9 != 0) {
          param_3 = param_3 + -2;
          iVar11 = iVar11 + 2;
          bVar8 = *(byte *)(iVar10 + local_130);
          if ((byte)(bVar8 - 0x40) < 0xbd) {
            bVar12 = bVar8 < 0x9f;
            cVar4 = -0x50;
            if (bVar7 < 0xa0) {
              cVar4 = 'p';
            }
            if (bVar12) {
              cVar2 = (0x7f < bVar8) + '\x1f';
            }
            else {
              cVar2 = '~';
            }
            bVar8 = bVar8 - cVar2;
            bVar7 = (bVar7 - cVar4) * '\x02' - bVar12;
            if (!bVar1) {
              iVar10 = iVar5 + 1;
              bVar1 = true;
              local_118[iVar5] = 0x1b;
              if (iVar10 == 200) {
                FUN_1400b97e0(param_4,local_118,200);
                iVar10 = 0;
              }
              iVar9 = iVar10 + 1;
              local_118[iVar10] = 0x24;
              if (iVar9 == 200) {
                FUN_1400b97e0(param_4,local_118,200);
                iVar9 = 0;
              }
              iVar5 = iVar9 + 1;
              local_118[iVar9] = 0x42;
              if (iVar5 == 200) {
                FUN_1400b97e0(param_4,local_118,200);
                iVar5 = 0;
              }
            }
          }
          lVar3 = (longlong)iVar5;
          iVar5 = iVar5 + 1;
          local_118[lVar3] = bVar7;
          if (iVar5 != 200) goto LAB_14010e1b6;
          FUN_1400b97e0(param_4,local_118,200);
          iVar5 = 0;
          local_118[0] = bVar8;
          goto LAB_14010e6de;
        }
        break;
      }
      if ((bVar7 < 0xa1) || (0xdf < bVar7)) goto LAB_14010e5e6;
      local_138 = (uint)bVar7;
      local_148 = &local_134;
      local_140 = 5;
      local_134 = 0;
      iVar11 = FUN_14010de50(local_128,iVar10 + local_130,iVar9,&local_138);
      param_3 = iVar9 - iVar11;
      iVar11 = iVar10 + iVar11;
      if (!bVar1) {
        iVar10 = iVar5 + 1;
        bVar1 = true;
        local_118[iVar5] = 0x1b;
        if (iVar10 == 200) {
          FUN_1400b97e0(param_4,local_118,200);
          iVar10 = 0;
        }
        iVar9 = iVar10 + 1;
        local_118[iVar10] = 0x24;
        if (iVar9 == 200) {
          FUN_1400b97e0(param_4,local_118,200);
          iVar9 = 0;
        }
        iVar5 = iVar9 + 1;
        local_118[iVar9] = 0x42;
        if (iVar5 == 200) {
          FUN_1400b97e0(param_4,local_118,200);
          iVar5 = 0;
        }
      }
      lVar3 = (longlong)iVar5;
      iVar5 = iVar5 + 1;
      local_118[lVar3] = (byte)local_138;
      if (iVar5 == 200) {
        FUN_1400b97e0(param_4,local_118,200);
        iVar5 = 0;
      }
      if (local_134 != 0) {
        local_118[iVar5] = (byte)local_134;
        goto LAB_14010e6de;
      }
    }
  } while (param_3 != 0);
  if (bVar1) {
    iVar11 = iVar5 + 1;
    local_118[iVar5] = 0x1b;
    if (iVar11 == 200) {
      FUN_1400b97e0(param_4,local_118,200);
      iVar11 = 0;
    }
    iVar10 = iVar11 + 1;
    local_118[iVar11] = 0x28;
    if (iVar10 == 200) {
      FUN_1400b97e0(param_4,local_118,200);
      iVar10 = 0;
    }
    iVar5 = iVar10 + 1;
    local_118[iVar10] = 0x42;
    if (iVar5 == 200) goto LAB_14010e79e;
  }
  if (iVar5 == 0) {
    return;
  }
LAB_14010e79e:
  FUN_1400b97e0(param_4,local_118,iVar5);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x00014010e96e)

void FUN_14010e7d0(undefined8 param_1,byte *param_2,int param_3,undefined8 param_4)

{
  byte bVar1;
  bool bVar2;
  bool bVar3;
  longlong lVar4;
  longlong lVar5;
  byte bVar6;
  int iVar7;
  char cVar8;
  byte *pbVar9;
  int iVar10;
  char cVar11;
  uint uVar12;
  undefined1 auStack_138 [32];
  byte local_118 [208];
  ulonglong local_48;
  
  if ((param_2 != (byte *)0x0) && (local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_138, param_3 != 0))
  {
    bVar3 = false;
    bVar2 = false;
    iVar7 = 0;
    lVar4 = FUN_1400c27d0();
    do {
      bVar6 = *param_2;
      iVar10 = param_3 + -1;
      pbVar9 = param_2 + 1;
      if (bVar6 == 0x1b) {
        if (iVar10 == 0) break;
        bVar6 = *pbVar9;
        iVar10 = param_3 + -2;
        pbVar9 = param_2 + 2;
        if (bVar6 == 0x24) {
          if (iVar10 == 0) break;
          bVar6 = *pbVar9;
          pbVar9 = param_2 + 3;
          iVar10 = param_3 + -3;
          if ((bVar6 == 0x40) || (bVar6 == 0x42)) {
            bVar2 = true;
            bVar3 = false;
          }
        }
        else if (bVar6 == 0x28) {
          if (iVar10 == 0) break;
          bVar6 = *pbVar9;
          iVar10 = param_3 + -3;
          pbVar9 = param_2 + 3;
          if ((bVar6 == 0x42) || (bVar6 == 0x4a)) {
            bVar2 = false;
            bVar3 = false;
          }
          else if (bVar6 == 0x49) {
            bVar3 = true;
            bVar2 = false;
          }
        }
      }
      else {
        if ((bVar6 == 0xd) || (bVar6 == 10)) {
          if (bVar2) {
            bVar2 = false;
            bVar3 = false;
          }
          local_118[iVar7] = bVar6;
        }
        else if (bVar2) {
          if (iVar10 == 0) break;
          bVar1 = *pbVar9;
          iVar10 = param_3 + -2;
          pbVar9 = param_2 + 2;
          if (((byte)(bVar6 + 0x87) < 4) &&
             (uVar12 = (uint)(byte)(bVar6 + 0x87) * 0x5e + (bVar1 - 0x21 & 0xff), uVar12 < 0x1f7)) {
            lVar5 = (longlong)iVar7;
            uVar12 = uVar12 * 2;
            iVar7 = iVar7 + 1;
            local_118[lVar5] = *(byte *)((ulonglong)uVar12 + lVar4);
            if (iVar7 == 200) {
              FUN_1400b97e0(param_4,local_118,200);
              iVar7 = 0;
            }
            local_118[iVar7] = *(byte *)((ulonglong)(uVar12 + 1) + lVar4);
          }
          else {
            cVar11 = -0x50;
            if (bVar6 < 0x5f) {
              cVar11 = 'p';
            }
            if ((bVar6 & 1) == 0) {
              cVar8 = '~';
            }
            else {
              cVar8 = (0x5f < bVar1) + '\x1f';
            }
            lVar5 = (longlong)iVar7;
            iVar7 = iVar7 + 1;
            local_118[lVar5] = (char)((int)(bVar6 + 1) >> 1) + cVar11;
            if (iVar7 == 200) {
              FUN_1400b97e0(param_4,local_118,200);
              iVar7 = 0;
            }
            local_118[iVar7] = cVar8 + bVar1;
          }
        }
        else {
          if (bVar3) {
            bVar6 = bVar6 + 0x80;
          }
          local_118[iVar7] = bVar6;
        }
        iVar7 = iVar7 + 1;
        if (iVar7 == 200) {
          FUN_1400b97e0(param_4,local_118,200);
          iVar7 = 0;
        }
      }
      param_3 = iVar10;
      param_2 = pbVar9;
    } while (param_3 != 0);
    if (iVar7 != 0) {
      FUN_1400b97e0(param_4,local_118,iVar7);
    }
  }
  return;
}



undefined8 * FUN_14010ea70(undefined8 *param_1,byte param_2)

{
  *param_1 = Japanese::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 *
FUN_14010eaa0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  *param_1 = ErrorLog::vftable;
  FUN_1400d0a70(param_1 + 1);
  lVar1 = FUN_140139970();
  if (lVar1 != 0) {
    FUN_140139310(lVar1,"ChilkatLog",param_3,param_4,uVar2);
    FUN_1400d0c90(param_1 + 1,lVar1);
  }
  return param_1;
}



void FUN_14010eb20(longlong param_1)

{
  undefined8 *puVar1;
  longlong lVar2;
  
  param_1 = param_1 + 8;
  puVar1 = (undefined8 *)FUN_1400d0aa0(param_1,0);
  FUN_1400d0bf0(param_1);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  lVar2 = FUN_140139970();
  if (lVar2 != 0) {
    FUN_140139310(lVar2,"ChilkatLog");
    FUN_1400d0c90(param_1,lVar2);
  }
  return;
}



void FUN_14010eb90(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  
  *param_1 = ErrorLog::vftable;
  param_1 = param_1 + 1;
  puVar1 = (undefined8 *)FUN_1400d0aa0(param_1,0,param_3,param_4,0xfffffffffffffffe);
  FUN_1400d0bf0(param_1);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_1400d0e10(param_1);
  return;
}



void FUN_14010ec00(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = FUN_140139970();
  if (lVar1 != 0) {
    FUN_140139310(lVar1,param_2);
    lVar2 = FUN_1400d0ac0(param_1 + 8);
    if (lVar2 != 0) {
      FUN_140139250(lVar2,lVar1);
    }
    FUN_1400d0c90(param_1 + 8,lVar1);
  }
  return;
}



void FUN_14010ec70(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  
  param_1 = param_1 + 8;
  iVar1 = FUN_140139d70(param_1);
  if (1 < iVar1) {
    FUN_1400d0cd0(param_1);
  }
  iVar1 = FUN_140139d70(param_1);
  if (1 < iVar1) {
    lVar2 = FUN_1400d0ac0(param_1);
    if (lVar2 != 0) {
      FUN_140139a20(lVar2);
    }
  }
  return;
}



void FUN_14010ecc0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  
  lVar1 = FUN_140139970();
  if (lVar1 != 0) {
    FUN_1401393d0(lVar1,param_2);
    uVar2 = FUN_1400d0ac0(param_1 + 8);
    FUN_140139250(uVar2,lVar1);
  }
  return;
}



void FUN_14010ed20(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = FUN_140139970();
  if (lVar1 != 0) {
    FUN_140139440(lVar1,param_2);
    lVar2 = FUN_1400d0ac0(param_1 + 8);
    if (lVar2 != 0) {
      FUN_140139250(lVar2,lVar1);
    }
  }
  return;
}



void FUN_14010ed80(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = FUN_140139970();
  if (lVar1 != 0) {
    FUN_1401394b0(lVar1,param_2);
    lVar2 = FUN_1400d0ac0(param_1 + 8);
    if (lVar2 != 0) {
      FUN_140139250(lVar2,lVar1);
    }
  }
  return;
}



void FUN_14010ede0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = FUN_140139970();
  if (lVar1 != 0) {
    FUN_140139270(lVar1,param_2,param_3);
    lVar2 = FUN_1400d0ac0(param_1 + 8);
    if (lVar2 != 0) {
      FUN_140139250(lVar2,lVar1);
    }
  }
  return;
}



void FUN_14010ee50(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  lVar1 = FUN_1400d0aa0(param_1 + 8,0);
  if (lVar1 != 0) {
    FUN_140139a80(lVar1,param_2);
  }
  return;
}



void FUN_14010ee80(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  lVar1 = FUN_1400d0aa0(param_1 + 8,0);
  if (lVar1 != 0) {
    FUN_140139740(lVar1,param_2,0);
  }
  return;
}



void FUN_14010eeb0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  lVar1 = FUN_1400d0aa0(param_1 + 8,0);
  if (lVar1 != 0) {
    FUN_140139520(lVar1,param_2);
  }
  return;
}



undefined8 * FUN_14010eee0(undefined8 *param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  
  *param_1 = ErrorLog::vftable;
  puVar1 = (undefined8 *)FUN_1400d0aa0(param_1 + 1,0,param_3,param_4,0xfffffffffffffffe);
  FUN_1400d0bf0(param_1 + 1);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_1400d0e10(param_1 + 1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14010ef70(longlong param_1,longlong param_2,undefined8 param_3)

{
  uint uVar1;
  char cVar2;
  ulonglong uVar3;
  longlong lVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined1 auStack_108 [32];
  undefined8 local_e8;
  undefined1 local_e0 [56];
  undefined1 local_a8 [96];
  undefined1 local_48 [32];
  ulonglong local_28;
  
  local_e8 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  FUN_1400bbe30(param_3);
  if (param_2 != 0) {
    FUN_1400bcaa0(local_e0,param_2);
    FUN_1400f4fd0(local_a8);
    FUN_1400f5260(local_a8,local_e0,local_48);
    uVar3 = FUN_140133480(local_48,0x10);
    uVar1 = *(uint *)(param_1 + 8);
    FUN_1400f5000(local_a8);
    for (lVar4 = FUN_140139d60((longlong)(int)((uVar3 & 0xffffffff) % (ulonglong)uVar1) * 0x20 +
                               *(longlong *)(param_1 + 0x10)); lVar4 != 0;
        lVar4 = FUN_140139d60(lVar4)) {
      uVar5 = FUN_1401320e0(lVar4);
      uVar6 = FUN_1401068a0(uVar5);
      cVar2 = FUN_1400bdf70(local_e0,uVar6);
      if (cVar2 != '\0') {
        lVar4 = FUN_1400b8b90(uVar5);
        if (lVar4 != 0) {
          FUN_1400bda40(param_3,lVar4);
          FUN_1400bceb0(local_e0);
          return 1;
        }
        break;
      }
    }
    FUN_1400bceb0(local_e0);
  }
  return 0;
}



void FUN_14010f0b0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  *param_1 = XCert::vftable;
  FUN_1400b8b00(param_1 + 2);
  puVar1 = (undefined8 *)param_1[0xd];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,uVar2);
    param_1[0xd] = 0;
  }
  puVar1 = (undefined8 *)param_1[0xc];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[0xc] = 0;
  }
  FUN_1400b92d0(param_1 + 7);
  FUN_1400b92d0(param_1 + 2);
  FUN_1400d0ee0(param_1);
  return;
}



void FUN_14010f140(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  undefined8 *puVar1;
  
  puVar1 = *(undefined8 **)(param_1 + 0x68);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    *(undefined8 *)(param_1 + 0x68) = 0;
  }
  puVar1 = *(undefined8 **)(param_1 + 0x60);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    *(undefined8 *)(param_1 + 0x60) = 0;
  }
  FUN_1400b8b30(param_1 + 0x38);
  FUN_1400b97e0(param_1 + 0x38,param_2,param_3);
  return;
}



undefined8
FUN_14010f1c0(longlong param_1,undefined8 param_2,undefined8 param_3,longlong *param_4,char param_5)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined1 local_c8 [48];
  undefined8 local_98;
  undefined1 local_90 [48];
  undefined1 local_60 [40];
  undefined1 local_38 [48];
  
  local_98 = 0xfffffffffffffffe;
  FUN_1400b8b30(param_3);
  FUN_1400bcc20(local_c8);
  FUN_1400bc640(local_c8,"SubjectKeyId:");
  FUN_1400bc640(local_c8,param_2);
  if (param_5 != '\0') {
    lVar1 = *param_4;
    uVar5 = FUN_1400b8b90(local_c8);
    (**(code **)(lVar1 + 0x58))(param_4,"findPrivateKeyBySubjectId",uVar5);
  }
  FUN_1400bcc20(local_90);
  uVar5 = FUN_1400b8b90(local_c8);
  cVar2 = FUN_14010ef70(param_1 + 0x1d0,uVar5,local_90);
  if ((cVar2 != '\0') && (iVar3 = FUN_1400bbb10(local_90), iVar3 != 0)) {
    FUN_1400b8c40(local_60);
    uVar5 = FUN_1400b8b90(local_90);
    FUN_1400b9f10(local_60,uVar5,"base64");
    FUN_1400bcc20(local_38);
    FUN_1400bdc90(local_38,param_1 + 0x1e8);
    FUN_1400bd840(local_38);
    uVar4 = FUN_1400b8b80(local_60);
    uVar5 = FUN_1400b8b90(local_60);
    uVar6 = FUN_1400b8b90(local_38);
    FUN_140111b10(0x80,uVar6,uVar5,uVar4,param_3,param_4);
    if (param_5 != '\0') {
      (**(code **)(*param_4 + 0x30))(param_4,"Key found!");
    }
    FUN_1400bceb0(local_38);
    FUN_1400b92d0(local_60);
    FUN_1400bceb0(local_90);
    FUN_1400bceb0(local_c8);
    return 1;
  }
  if (param_5 != '\0') {
    (**(code **)(*param_4 + 0x28))(param_4,"Key not found in hash map. (using subjectKeyId)");
  }
  FUN_1400bceb0(local_90);
  FUN_1400bceb0(local_c8);
  return 0;
}



undefined8
FUN_14010f3d0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             longlong *param_5,char param_6)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined1 local_d8 [48];
  undefined1 local_a8 [48];
  undefined8 local_78;
  undefined1 local_70 [40];
  undefined1 local_48 [48];
  
  local_78 = 0xfffffffffffffffe;
  FUN_1400b8b30(param_4);
  FUN_1400bcc20(local_d8);
  FUN_1400bc640(local_d8,param_2);
  FUN_1400bc640(local_d8,&DAT_1402749ec);
  FUN_1400bc640(local_d8,param_3);
  if (param_6 != '\0') {
    lVar1 = *param_5;
    uVar5 = FUN_1400b8b90(local_d8);
    (**(code **)(lVar1 + 0x58))(param_5,"findPrivateKey",uVar5);
  }
  FUN_1400bcc20(local_a8);
  uVar5 = FUN_1400b8b90(local_d8);
  cVar2 = FUN_14010ef70(param_1 + 0x1d0,uVar5,local_a8);
  if (cVar2 == '\0') {
    cVar2 = FUN_1400bc7e0(local_d8,&DAT_1402422b4);
    if (cVar2 == '\0') goto LAB_14010f5c3;
    FUN_1400bcfa0(local_d8,&DAT_1402422b4,&DAT_14027a10a);
    uVar5 = FUN_1400b8b90(local_d8);
    cVar2 = FUN_14010ef70(param_1 + 0x1d0,uVar5,local_a8);
    if (cVar2 == '\0') goto LAB_14010f5c3;
  }
  iVar3 = FUN_1400bbb10(local_a8);
  if (iVar3 != 0) {
    FUN_1400b8c40(local_70);
    uVar5 = FUN_1400b8b90(local_a8);
    FUN_1400b9f10(local_70,uVar5,"base64");
    FUN_1400bcc20(local_48);
    FUN_1400bdc90(local_48,param_1 + 0x1e8);
    FUN_1400bd840(local_48);
    uVar4 = FUN_1400b8b80(local_70);
    uVar5 = FUN_1400b8b90(local_70);
    uVar6 = FUN_1400b8b90(local_48);
    FUN_140111b10(0x80,uVar6,uVar5,uVar4,param_4,param_5);
    if (param_6 != '\0') {
      (**(code **)(*param_5 + 0x30))(param_5,"Key found!");
    }
    FUN_1400bceb0(local_48);
    FUN_1400b92d0(local_70);
    FUN_1400bceb0(local_a8);
    FUN_1400bceb0(local_d8);
    return 1;
  }
LAB_14010f5c3:
  if (param_6 != '\0') {
    (**(code **)(*param_5 + 0x28))(param_5,"Key not found in hash map.");
  }
  FUN_1400bceb0(local_a8);
  FUN_1400bceb0(local_d8);
  return 0;
}



undefined1
FUN_14010f610(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             longlong *param_5,char param_6)

{
  longlong lVar1;
  char cVar2;
  undefined1 uVar3;
  undefined8 uVar4;
  undefined1 local_40 [56];
  
  FUN_1400bbe30(param_4);
  FUN_1400bcc20(local_40);
  FUN_1400bc640(local_40,param_2);
  FUN_1400bc640(local_40,&DAT_1402749ec);
  FUN_1400bc640(local_40,param_3);
  if (param_6 != '\0') {
    lVar1 = *param_5;
    uVar4 = FUN_1400b8b90(local_40);
    (**(code **)(lVar1 + 0x58))(param_5,"findCert",uVar4);
  }
  uVar4 = FUN_1400b8b90(local_40);
  cVar2 = FUN_14010ef70(param_1 + 0x1b8,uVar4,param_4);
  if (cVar2 == '\0') {
    cVar2 = FUN_1400bc7e0(local_40,&DAT_1402422b4);
    uVar3 = 0;
    if (cVar2 != '\0') {
      FUN_1400bcfa0(local_40,&DAT_1402422b4,&DAT_14027a10a);
      uVar4 = FUN_1400b8b90(local_40);
      uVar3 = FUN_14010ef70(param_1 + 0x1b8,uVar4,param_4);
    }
    FUN_1400bceb0(local_40);
  }
  else {
    FUN_1400bceb0(local_40);
    uVar3 = 1;
  }
  return uVar3;
}



undefined1
FUN_14010f750(longlong param_1,undefined8 param_2,undefined8 param_3,longlong *param_4,char param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  undefined8 uVar3;
  undefined1 local_40 [56];
  
  FUN_1400bbe30(param_3);
  FUN_1400bcc20(local_40);
  FUN_1400bc640(local_40,"SubjectKeyId:");
  FUN_1400bc640(local_40,param_2);
  if (param_5 != '\0') {
    lVar1 = *param_4;
    uVar3 = FUN_1400b8b90(local_40);
    (**(code **)(lVar1 + 0x58))(param_4,"findCertBySubjectKeyId",uVar3);
  }
  uVar3 = FUN_1400b8b90(local_40);
  uVar2 = FUN_14010ef70(param_1 + 0x1b8,uVar3,param_3);
  FUN_1400bceb0(local_40);
  return uVar2;
}



void FUN_14010f820(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  char *pcVar1;
  char *pcVar2;
  undefined8 uVar3;
  undefined1 local_1e0 [56];
  undefined1 local_1a8 [416];
  
  pcVar1 = (char *)FUN_1400b8b90(param_2);
  pcVar1 = strstr(pcVar1,"<compressedDer>");
  if (pcVar1 != (char *)0x0) {
    pcVar2 = strstr(pcVar1,"</compressedDer>");
    if (pcVar2 != (char *)0x0) {
      FUN_1400bcc20(local_1e0);
      FUN_1400bc8a0(local_1e0,pcVar1,((int)pcVar2 + 0x10) - (int)pcVar1);
      FUN_140118090(local_1a8);
      uVar3 = FUN_1400b8b90(local_1e0);
      FUN_1401195c0(local_1a8,uVar3,0);
      FUN_140139f80(local_1a8,param_3,1,0,0);
      FUN_140118160(local_1a8);
      FUN_1400bceb0(local_1e0);
    }
  }
  return;
}



ulonglong FUN_14010f910(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                       undefined8 param_5,undefined1 param_6)

{
  char cVar1;
  int iVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  undefined1 local_40 [56];
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400b8b30(param_4);
  FUN_1400bcc20(local_40);
  cVar1 = FUN_14010f610(param_1,param_2,param_3,local_40,param_5,param_6,uVar4);
  if (cVar1 == '\0') {
    uVar3 = FUN_1400bceb0(local_40);
    uVar3 = uVar3 & 0xffffffffffffff00;
  }
  else {
    FUN_14010f820(param_1,local_40,param_4);
    iVar2 = FUN_1400b8b80(param_4);
    FUN_1400bceb0(local_40);
    uVar3 = (ulonglong)(iVar2 != 0);
  }
  return uVar3;
}



ulonglong FUN_14010f9d0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                       undefined1 param_5)

{
  char cVar1;
  int iVar2;
  ulonglong uVar3;
  undefined1 local_40 [56];
  
  FUN_1400b8b30(param_3);
  FUN_1400bcc20(local_40);
  cVar1 = FUN_14010f750(param_1,param_2,local_40,param_4,param_5);
  if (cVar1 == '\0') {
    uVar3 = FUN_1400bceb0(local_40);
    uVar3 = uVar3 & 0xffffffffffffff00;
  }
  else {
    FUN_14010f820(param_1,local_40,param_3);
    iVar2 = FUN_1400b8b80(param_3);
    FUN_1400bceb0(local_40);
    uVar3 = (ulonglong)(iVar2 != 0);
  }
  return uVar3;
}



void * FUN_14010fa80(void *param_1,uint param_2)

{
  FUN_14010f0b0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_14010fab0(longlong param_1)

{
  int iVar1;
  undefined4 uVar2;
  undefined8 *puVar3;
  undefined8 uVar4;
  undefined1 local_30 [40];
  
  puVar3 = operator_new(0x70);
  if (puVar3 == (undefined8 *)0x0) {
    puVar3 = (undefined8 *)0x0;
  }
  else {
    FUN_1400d0eb0(puVar3);
    *puVar3 = XCert::vftable;
    FUN_1400b8c40(puVar3 + 2);
    FUN_1400b8c40(puVar3 + 7);
    puVar3[0xc] = 0;
    puVar3[0xd] = 0;
  }
  FUN_1400b8c40(local_30);
  FUN_1400b8b30(local_30);
  iVar1 = FUN_1400b8b80(param_1 + 0x38);
  if (iVar1 == 0) {
    if (*(longlong *)(param_1 + 0x60) == 0) {
      if (*(longlong *)(param_1 + 0x68) != 0) {
        FUN_1400ecf30(*(longlong *)(param_1 + 0x68),local_30,0);
      }
    }
    else {
      FUN_140119830(*(longlong *)(param_1 + 0x60),local_30);
    }
  }
  else {
    FUN_1400b9e90(local_30,param_1 + 0x38);
  }
  uVar2 = FUN_1400b8b80(local_30);
  uVar4 = FUN_1400b8b90(local_30);
  FUN_14010f140(puVar3,uVar4,uVar2);
  FUN_1400b8b30(puVar3 + 2);
  FUN_1400b9e90(puVar3 + 2,param_1 + 0x10);
  FUN_1400b92d0(local_30);
  return puVar3;
}



void FUN_14010fbe0(longlong param_1,longlong param_2)

{
  undefined8 uVar1;
  int iVar2;
  longlong lVar3;
  int iVar4;
  
  if (((param_1 != 0) && (param_2 != 0)) && (param_1 != param_2)) {
    FUN_1400d0d30(param_2);
    iVar2 = FUN_140139d70(param_1);
    iVar4 = 0;
    if (0 < iVar2) {
      do {
        lVar3 = FUN_1400d0aa0(param_1,iVar4);
        if (lVar3 != 0) {
          uVar1 = FUN_14010fab0(lVar3);
          FUN_1400d0c90(param_2,uVar1);
        }
        iVar4 = iVar4 + 1;
      } while (iVar4 < iVar2);
    }
  }
  return;
}



undefined1 FUN_14010fc60(longlong *param_1)

{
  if (DAT_1403173a0 != '\0') {
    return 0;
  }
  if ((DAT_140317398 == (HMODULE)0x0) &&
     (DAT_140317398 = LoadLibraryA("crypt32.dll"), DAT_140317398 == (HMODULE)0x0)) {
    DAT_1403173a0 = 1;
    FUN_1400cf640(param_1);
    (**(code **)(*param_1 + 0x28))(param_1,"Failed to load crypt32.dll");
    return 0;
  }
  return 1;
}



undefined1 FUN_14010fcd0(longlong *param_1)

{
  char cVar1;
  
  cVar1 = FUN_14010fc60();
  if (cVar1 == '\0') {
    return 0;
  }
  if ((DAT_140317390 == (FARPROC)0x0) &&
     (DAT_140317390 = GetProcAddress(DAT_140317398,"CryptAcquireCertificatePrivateKey"),
     DAT_140317390 == (FARPROC)0x0)) {
    FUN_1400cf640(param_1);
    (**(code **)(*param_1 + 0x28))
              (param_1,"Failed to find CryptAcquireCertificatePrivateKey function in crypt32.dll");
    return 0;
  }
  return 1;
}



void FUN_14010fd40(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  FUN_1400b8b00(param_1 + 0x10);
  FUN_1400b97e0(param_1 + 0x10,param_2,param_3);
  return;
}



void FUN_14010fd80(PCERT_NAME_BLOB param_1,DWORD param_2,undefined8 param_3)

{
  undefined1 auVar1 [16];
  DWORD DVar2;
  __uint64 _Var3;
  LPWSTR psz;
  
  FUN_1400b7180(param_3);
  DVar2 = CertNameToStrW(0x10001,param_1,param_2,(LPWSTR)0x0,0);
  if (1 < DVar2) {
    auVar1 = ZEXT816(2) * ZEXT416(DVar2 + 1);
    _Var3 = auVar1._0_8_;
    if (auVar1._8_8_ != 0) {
      _Var3 = 0xffffffffffffffff;
    }
    psz = operator_new(_Var3);
    psz[DVar2] = L'\0';
    DVar2 = CertNameToStrW(0x10001,param_1,param_2,psz,DVar2);
    if (1 < DVar2) {
      FUN_1400b7bf0(param_3,psz);
    }
    operator_delete(psz);
  }
  return;
}



void FUN_14010fe40(undefined8 *param_1)

{
  *param_1 = MsCertificate::vftable;
  if ((PCCERT_CONTEXT)param_1[1] != (PCCERT_CONTEXT)0x0) {
    CertFreeCertificateContext((PCCERT_CONTEXT)param_1[1]);
    param_1[1] = 0;
  }
  FUN_1400d0d30(param_1 + 0x5d);
  FUN_1400d0d30(param_1 + 0x58);
  FUN_1400b8b00(param_1 + 2);
  FUN_1400bceb0(param_1 + 0x6a);
  FUN_1400bceb0(param_1 + 100);
  FUN_1400d0e10(param_1 + 0x5d);
  FUN_1400d0e10(param_1 + 0x58);
  FUN_1400b7090(param_1 + 0x44);
  FUN_1400b7090(param_1 + 0x30);
  FUN_1400b7090(param_1 + 0x1c);
  FUN_1400b7090(param_1 + 7);
  FUN_1400b92d0(param_1 + 2);
  return;
}



void * FUN_14010ff30(void *param_1,uint param_2)

{
  FUN_14010fe40();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14010ff60(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  undefined8 local_18;
  undefined8 local_10;
  
  FUN_1400b7180(param_2);
  if ((param_1 != 0) && (lVar1 = *(longlong *)(param_1 + 0x18), lVar1 != 0)) {
    local_18 = *(undefined8 *)(lVar1 + 0x30);
    local_10 = *(undefined8 *)(lVar1 + 0x38);
    FUN_14010fd80(&local_18,3,param_2);
  }
  return;
}



undefined8 FUN_14010ffc0(longlong param_1,undefined8 param_2,longlong *param_3)

{
  int iVar1;
  longlong lVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    if (param_3 != (longlong *)0x0) {
      (**(code **)(*param_3 + 0x28))
                (param_3,"Failed to get DER encoded certificate: no cert context found");
    }
    return 0;
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + 8);
  iVar1 = *(int *)(*(longlong *)(param_1 + 8) + 0x10);
  if ((lVar2 != 0) && (iVar1 != 0)) {
    FUN_1400b8b30(param_2);
    FUN_1400b97e0(param_2,lVar2,iVar1);
    return 1;
  }
  if (param_3 != (longlong *)0x0) {
    (**(code **)(*param_3 + 0x28))
              (param_3,
               "Failed to get DER encoded certificate: no encoded data found within cert context");
  }
  return 0;
}



undefined8
FUN_140110060(longlong param_1,undefined8 param_2,char param_3,char param_4,longlong *param_5)

{
  BOOL BVar1;
  DWORD DVar2;
  undefined8 uVar3;
  undefined8 local_e8;
  undefined8 local_e0;
  ulonglong local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined1 local_a8 [160];
  
  local_b8 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 8) == 0) {
    (**(code **)(*param_5 + 0x28))(param_5,"No certificate context exists.");
    uVar3 = 0;
  }
  else {
    local_e8 = 0;
    local_e0 = 0;
    local_d8 = 0;
    local_d0 = 0;
    local_c8 = 0;
    local_c0 = 0;
    local_e8 = FUN_1400b7580(param_2);
    FUN_1400b6fd0(local_a8);
    FUN_1400b7b60(local_a8,"Microsoft Base Cryptographic Provider v1.0");
    local_e0 = FUN_1400b7580();
    local_d8 = CONCAT44(-(uint)(param_3 != '\0'),1) & 0x20ffffffff;
    local_c0 = CONCAT44(local_c0._4_4_,(param_4 != '\0') + 1);
    BVar1 = CertSetCertificateContextProperty(*(PCCERT_CONTEXT *)(param_1 + 8),2,0,&local_e8);
    if (BVar1 == 0) {
      DVar2 = GetLastError();
      FUN_1400cf710(param_5,DVar2);
      (**(code **)(*param_5 + 0x28))(param_5,"Failed to link private key.");
      FUN_1400cf5e0(param_5,"LastError",DVar2);
      FUN_1400b7090(local_a8);
      uVar3 = 0;
    }
    else {
      FUN_1400b7180(param_1 + 0x38);
      FUN_1400b73d0(param_1 + 0x38,param_2);
      *(char *)(param_1 + 0xd8) = param_3;
      *(char *)(param_1 + 0xd9) = param_4;
      FUN_1400b7090(local_a8);
      uVar3 = 1;
    }
  }
  return uVar3;
}



void FUN_1401101f0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  uint uVar1;
  undefined8 uVar2;
  undefined4 *pvStructInfo;
  longlong lVar3;
  undefined8 *puVar4;
  char *pcVar5;
  char *pcVar6;
  ulonglong uVar7;
  undefined1 uVar8;
  DWORD local_res8 [2];
  
  FUN_1400b8b30(param_2);
  FUN_1400b8b30(param_3);
  if (param_1 != 0) {
    uVar1 = *(uint *)(*(longlong *)(param_1 + 0x18) + 0xc0);
    puVar4 = *(undefined8 **)(*(longlong *)(param_1 + 0x18) + 200);
    if (0 < (int)uVar1) {
      uVar7 = (ulonglong)uVar1;
      do {
        local_res8[0] = 0;
        CryptDecodeObject(0x10001,(LPCSTR)*puVar4,(BYTE *)puVar4[3],*(DWORD *)(puVar4 + 2),0,
                          (void *)0x0,local_res8);
        uVar8 = local_res8[0] == 0;
        if (!(bool)uVar8) {
          pvStructInfo = operator_new((ulonglong)local_res8[0]);
          CryptDecodeObject(0x10001,(LPCSTR)*puVar4,(BYTE *)puVar4[3],*(DWORD *)(puVar4 + 2),0,
                            pvStructInfo,local_res8);
          lVar3 = 10;
          pcVar5 = (char *)*puVar4;
          pcVar6 = "2.5.29.35";
          do {
            if (lVar3 == 0) break;
            lVar3 = lVar3 + -1;
            uVar8 = *pcVar5 == *pcVar6;
            pcVar5 = pcVar5 + 1;
            pcVar6 = pcVar6 + 1;
          } while ((bool)uVar8);
          uVar2 = param_3;
          if ((bool)uVar8) {
joined_r0x000140110308:
            if (pvStructInfo != (undefined4 *)0x0) {
              FUN_1400b97e0(uVar2,*(undefined8 *)(pvStructInfo + 2),*pvStructInfo);
            }
          }
          else {
            lVar3 = 10;
            pcVar5 = (char *)*puVar4;
            pcVar6 = "2.5.29.14";
            do {
              if (lVar3 == 0) break;
              lVar3 = lVar3 + -1;
              uVar8 = *pcVar5 == *pcVar6;
              pcVar5 = pcVar5 + 1;
              pcVar6 = pcVar6 + 1;
            } while ((bool)uVar8);
            uVar2 = param_2;
            if ((bool)uVar8) goto joined_r0x000140110308;
          }
          operator_delete(pvStructInfo);
        }
        puVar4 = puVar4 + 4;
        uVar7 = uVar7 - 1;
      } while (uVar7 != 0);
    }
  }
  return;
}



void FUN_140110360(longlong param_1)

{
  byte bVar1;
  uint uVar2;
  int *pvStructInfo;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  char *pcVar6;
  char *pcVar7;
  char *pcVar8;
  undefined8 *puVar9;
  ulonglong uVar10;
  undefined1 uVar11;
  bool bVar12;
  DWORD local_res8 [2];
  
  lVar3 = *(longlong *)(*(longlong *)(param_1 + 8) + 0x18);
  uVar2 = *(uint *)(lVar3 + 0xc0);
  puVar9 = *(undefined8 **)(lVar3 + 200);
  if (0 < (int)uVar2) {
    uVar10 = (ulonglong)uVar2;
    do {
      local_res8[0] = 0;
      CryptDecodeObject(0x10001,(LPCSTR)*puVar9,(BYTE *)puVar9[3],*(DWORD *)(puVar9 + 2),0,
                        (void *)0x0,local_res8);
      uVar11 = local_res8[0] == 0;
      if (!(bool)uVar11) {
        pvStructInfo = operator_new((ulonglong)local_res8[0]);
        CryptDecodeObject(0x10001,(LPCSTR)*puVar9,(BYTE *)puVar9[3],*(DWORD *)(puVar9 + 2),0,
                          pvStructInfo,local_res8);
        pcVar7 = (char *)*puVar9;
        lVar3 = 10;
        pcVar6 = pcVar7;
        pcVar8 = "2.5.29.15";
        do {
          if (lVar3 == 0) break;
          lVar3 = lVar3 + -1;
          uVar11 = *pcVar6 == *pcVar8;
          pcVar6 = pcVar6 + 1;
          pcVar8 = pcVar8 + 1;
        } while ((bool)uVar11);
        if ((bool)uVar11) {
          bVar1 = *(byte *)(pvStructInfo + 6);
          if ((char)bVar1 < '\0') {
            *(undefined1 *)(param_1 + 0x310) = 1;
          }
          if ((bVar1 & 0x40) != 0) {
            *(undefined1 *)(param_1 + 0x311) = 1;
          }
          if ((bVar1 & 0x20) != 0) {
            *(undefined1 *)(param_1 + 0x312) = 1;
          }
          if ((bVar1 & 0x10) != 0) {
            *(undefined1 *)(param_1 + 0x313) = 1;
          }
          if ((bVar1 & 4) != 0) {
            *(undefined1 *)(param_1 + 0x314) = 1;
          }
          if ((bVar1 & 2) != 0) {
            *(undefined1 *)(param_1 + 0x315) = 1;
          }
        }
        else {
          lVar3 = 10;
          pcVar6 = pcVar7;
          pcVar8 = "2.5.29.17";
          do {
            if (lVar3 == 0) break;
            lVar3 = lVar3 + -1;
            uVar11 = *pcVar6 == *pcVar8;
            pcVar6 = pcVar6 + 1;
            pcVar8 = pcVar8 + 1;
          } while ((bool)uVar11);
          if ((bool)uVar11) {
            lVar5 = (longlong)*pvStructInfo;
            lVar3 = 0;
            if (0 < lVar5) {
              do {
                if (*(int *)(lVar3 + *(longlong *)(pvStructInfo + 2)) == 2) {
                  thunk_FUN_1400b7450(param_1 + 0x220,
                                      *(undefined8 *)(lVar3 + 8 + *(longlong *)(pvStructInfo + 2)));
                }
                lVar5 = lVar5 + -1;
                lVar3 = lVar3 + 0x18;
              } while (lVar5 != 0);
            }
          }
          else {
            lVar3 = 10;
            pcVar6 = "2.5.29.37";
            do {
              if (lVar3 == 0) break;
              lVar3 = lVar3 + -1;
              uVar11 = *pcVar7 == *pcVar6;
              pcVar7 = pcVar7 + 1;
              pcVar6 = pcVar6 + 1;
            } while ((bool)uVar11);
            if ((bool)uVar11) {
              *(undefined1 *)(param_1 + 0x316) = 1;
              lVar5 = (longlong)*pvStructInfo;
              bVar12 = lVar5 == 0;
              lVar3 = 0;
              if (0 < lVar5) {
                do {
                  lVar4 = 0x12;
                  pcVar7 = *(char **)(*(longlong *)(pvStructInfo + 2) + lVar3 * 8);
                  pcVar6 = pcVar7;
                  pcVar8 = "1.3.6.1.5.5.7.3.1";
                  do {
                    if (lVar4 == 0) break;
                    lVar4 = lVar4 + -1;
                    bVar12 = *pcVar6 == *pcVar8;
                    pcVar6 = pcVar6 + 1;
                    pcVar8 = pcVar8 + 1;
                  } while (bVar12);
                  if (bVar12) {
                    *(undefined1 *)(param_1 + 0x318) = 1;
                  }
                  else {
                    lVar4 = 0x12;
                    pcVar6 = pcVar7;
                    pcVar8 = "1.3.6.1.5.5.7.3.2";
                    do {
                      if (lVar4 == 0) break;
                      lVar4 = lVar4 + -1;
                      bVar12 = *pcVar6 == *pcVar8;
                      pcVar6 = pcVar6 + 1;
                      pcVar8 = pcVar8 + 1;
                    } while (bVar12);
                    if (bVar12) {
                      *(undefined1 *)(param_1 + 0x319) = 1;
                    }
                    else {
                      lVar4 = 0x12;
                      pcVar6 = pcVar7;
                      pcVar8 = "1.3.6.1.5.5.7.3.3";
                      do {
                        if (lVar4 == 0) break;
                        lVar4 = lVar4 + -1;
                        bVar12 = *pcVar6 == *pcVar8;
                        pcVar6 = pcVar6 + 1;
                        pcVar8 = pcVar8 + 1;
                      } while (bVar12);
                      if (bVar12) {
                        *(undefined1 *)(param_1 + 0x31a) = 1;
                      }
                      else {
                        lVar4 = 0x12;
                        pcVar6 = pcVar7;
                        pcVar8 = "1.3.6.1.5.5.7.3.4";
                        do {
                          if (lVar4 == 0) break;
                          lVar4 = lVar4 + -1;
                          bVar12 = *pcVar6 == *pcVar8;
                          pcVar6 = pcVar6 + 1;
                          pcVar8 = pcVar8 + 1;
                        } while (bVar12);
                        if (bVar12) {
                          *(undefined1 *)(param_1 + 0x317) = 1;
                        }
                        else {
                          lVar4 = 0x12;
                          pcVar6 = pcVar7;
                          pcVar8 = "1.3.6.1.5.5.7.3.5";
                          do {
                            if (lVar4 == 0) break;
                            lVar4 = lVar4 + -1;
                            bVar12 = *pcVar6 == *pcVar8;
                            pcVar6 = pcVar6 + 1;
                            pcVar8 = pcVar8 + 1;
                          } while (bVar12);
                          if (!bVar12) {
                            lVar4 = 0x12;
                            pcVar6 = pcVar7;
                            pcVar8 = "1.3.6.1.5.5.7.3.6";
                            do {
                              if (lVar4 == 0) break;
                              lVar4 = lVar4 + -1;
                              bVar12 = *pcVar6 == *pcVar8;
                              pcVar6 = pcVar6 + 1;
                              pcVar8 = pcVar8 + 1;
                            } while (bVar12);
                            if (!bVar12) {
                              lVar4 = 0x12;
                              pcVar6 = pcVar7;
                              pcVar8 = "1.3.6.1.5.5.7.3.7";
                              do {
                                if (lVar4 == 0) break;
                                lVar4 = lVar4 + -1;
                                bVar12 = *pcVar6 == *pcVar8;
                                pcVar6 = pcVar6 + 1;
                                pcVar8 = pcVar8 + 1;
                              } while (bVar12);
                              if (!bVar12) {
                                lVar4 = 0x12;
                                pcVar6 = "1.3.6.1.5.5.7.3.8";
                                do {
                                  if (lVar4 == 0) break;
                                  lVar4 = lVar4 + -1;
                                  bVar12 = *pcVar7 == *pcVar6;
                                  pcVar7 = pcVar7 + 1;
                                  pcVar6 = pcVar6 + 1;
                                } while (bVar12);
                                if (bVar12) {
                                  *(undefined1 *)(param_1 + 0x31b) = 1;
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                  lVar3 = lVar3 + 1;
                  bVar12 = lVar3 == lVar5;
                } while (lVar3 < lVar5);
              }
            }
          }
        }
        operator_delete(pvStructInfo);
      }
      puVar9 = puVar9 + 4;
      uVar10 = uVar10 - 1;
    } while (uVar10 != 0);
  }
  return;
}



void FUN_140110630(longlong param_1,undefined8 param_2)

{
  uint uVar1;
  ulonglong uVar2;
  char local_res8 [8];
  
  FUN_1400bbe30(param_2);
  if ((param_1 != 0) && (uVar1 = *(uint *)(*(longlong *)(param_1 + 0x18) + 8), 0 < (int)uVar1)) {
    uVar2 = (ulonglong)uVar1;
    do {
      sprintf(local_res8,"%02x");
      FUN_1400bc640(param_2,local_res8);
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return;
}



undefined8 FUN_1401106b0(longlong param_1,undefined4 param_2,longlong *param_3,undefined8 param_4)

{
  BOOL BVar1;
  undefined8 *pvData;
  undefined8 uVar2;
  DWORD local_res8 [2];
  undefined1 local_a8 [160];
  
  if (*(char *)(param_1 + 0x31d) == '\0') {
    if (*(char *)(param_1 + 0x31e) != '\0') {
      (**(code **)(*param_3 + 0x28))(param_3,"No key provider info is available.");
      FUN_1400cf520(param_3,"calledFrom",param_2);
      return 0;
    }
    (**(code **)(*param_3 + 0x30))
              (param_3,"Fetching key provider info...",param_3,param_4,0xfffffffffffffffe);
    FUN_1400cf520(param_3,"calledFrom",param_2);
    local_res8[0] = 0;
    BVar1 = CertGetCertificateContextProperty
                      (*(PCCERT_CONTEXT *)(param_1 + 8),2,(void *)0x0,local_res8);
    if (BVar1 == 0) {
      FUN_1400cf640(param_3);
      (**(code **)(*param_3 + 0x28))
                (param_3,"CertGetCertificateContextProperty - CERT_KEY_PROV_INFO_PROP_ID failed.");
      FUN_1400cf520(param_3,"calledFrom",param_2);
      *(undefined1 *)(param_1 + 0x31e) = 1;
      return 0;
    }
    pvData = operator_new((ulonglong)local_res8[0]);
    BVar1 = CertGetCertificateContextProperty(*(PCCERT_CONTEXT *)(param_1 + 8),2,pvData,local_res8);
    if (BVar1 == 0) {
      operator_delete(pvData);
      FUN_1400cf640(param_3);
      (**(code **)(*param_3 + 0x28))
                (param_3,
                 "CertGetCertificateContextProperty - CERT_KEY_PROV_INFO_PROP_ID (2) failed.");
      *(undefined1 *)(param_1 + 0x31e) = 1;
      return 0;
    }
    *(undefined1 *)(param_1 + 0x31d) = 1;
    FUN_1400b6fd0(local_a8);
    FUN_1400b7bf0(local_a8,*pvData);
    uVar2 = FUN_1400b7ce0(local_a8);
    FUN_1400bc640(param_1 + 800,uVar2);
    FUN_1400b7180(local_a8);
    FUN_1400b7bf0(local_a8,pvData[1]);
    uVar2 = FUN_1400b7ce0(local_a8);
    FUN_1400bc640(param_1 + 0x350,uVar2);
    *(undefined4 *)(param_1 + 0x380) = *(undefined4 *)(pvData + 2);
    *(byte *)(param_1 + 900) = (byte)(*(uint *)((longlong)pvData + 0x14) >> 5) & 1;
    *(byte *)(param_1 + 0x385) = (byte)(*(uint *)((longlong)pvData + 0x14) >> 6) & 1;
    *(byte *)(param_1 + 0x38c) = *(byte *)(pvData + 5) & 1;
    FUN_1400cf5e0(param_3,"dwKeySpec",*(undefined4 *)(pvData + 5));
    FUN_1400cf520(param_3,"forKeyExchange",*(undefined1 *)(param_1 + 0x38c));
    FUN_1400cf520(param_3,"forSignature",*(uint *)(pvData + 5) & 2);
    FUN_1400cf520(param_3,"silent",*(undefined1 *)(param_1 + 0x385));
    operator_delete(pvData);
    FUN_1400b7090(local_a8);
  }
  return 1;
}



bool FUN_140110910(longlong param_1,longlong param_2,longlong *param_3)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined8 *puVar6;
  int local_res8 [2];
  undefined1 local_res20 [8];
  HCRYPTPROV local_28 [2];
  
  iVar3 = FUN_1400b8b80(param_1 + 0x10);
  if (iVar3 != 0) {
    return true;
  }
  cVar2 = FUN_14010fcd0(param_3);
  if (cVar2 == '\0') {
    return false;
  }
  puVar6 = (undefined8 *)0x0;
  local_28[0] = 0;
  iVar3 = FUN_1400bbb10(param_2 + 8);
  if (iVar3 != 0) {
    lVar1 = *param_3;
    uVar4 = FUN_1400b8b90(param_2 + 8);
    (**(code **)(lVar1 + 0x58))(param_3,"cspProviderName",uVar4);
    uVar4 = FUN_1400b8b90(param_2 + 0x38);
    uVar5 = FUN_1400b8b90(param_2 + 8);
    puVar6 = (undefined8 *)FUN_1401328c0(uVar5,uVar4,0,param_3);
    if (puVar6 != (undefined8 *)0x0) {
      local_28[0] = FUN_1401320e0(puVar6);
    }
  }
  iVar3 = (*DAT_140317390)(*(undefined8 *)(param_1 + 8),4,0,local_28,local_res20,local_res8);
  if ((local_res8[0] != 0) && (local_28[0] != 0)) {
    CryptReleaseContext(local_28[0],0);
  }
  if (puVar6 != (undefined8 *)0x0) {
    (**(code **)*puVar6)(puVar6,1);
  }
  return iVar3 != 0;
}



undefined4 FUN_140110a40(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  
  cVar1 = FUN_14010fcd0(param_4);
  if (cVar1 != '\0') {
    iVar2 = (*DAT_140317390)(*(undefined8 *)(param_1 + 8),0,0,param_2,param_3,0);
    if (iVar2 != 0) {
      return 1;
    }
    FUN_1400cf640(param_4);
  }
  return 0;
}



void FUN_140110ac0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  undefined8 local_18;
  undefined8 local_10;
  
  lVar1 = *(longlong *)(param_1 + 8);
  FUN_1400b7180(param_2);
  if ((lVar1 != 0) && (lVar1 = *(longlong *)(lVar1 + 0x18), lVar1 != 0)) {
    local_18 = *(undefined8 *)(lVar1 + 0x50);
    local_10 = *(undefined8 *)(lVar1 + 0x58);
    FUN_14010fd80(&local_18,3,param_2);
  }
  return;
}



undefined1
FUN_140110b20(longlong param_1,char param_2,undefined8 param_3,undefined1 *param_4,longlong *param_5
             )

{
  undefined1 uVar1;
  int iVar2;
  undefined8 *puVar3;
  
  FUN_1400b8b30(param_3);
  *param_4 = 0;
  iVar2 = FUN_1400b8b80(param_1 + 0x10);
  if (iVar2 == 0) {
    if (*(longlong *)(param_1 + 8) == 0) {
      (**(code **)(*param_5 + 0x28))(param_5,"No certificate context");
      uVar1 = 0;
    }
    else {
      (**(code **)(*param_5 + 0x48))(param_5,"getKeyProviderInfo",1);
      uVar1 = FUN_1401106b0(param_1,1,param_5);
      (**(code **)(*param_5 + 0x50))(param_5);
      (**(code **)(*param_5 + 0x48))(param_5,"openCertKeyContainer",1);
      puVar3 = (undefined8 *)FUN_14013a160(param_1,param_5);
      if (puVar3 == (undefined8 *)0x0) {
        (**(code **)(*param_5 + 0x50))();
        (**(code **)(*param_5 + 0x28))(param_5,"Failed to open key container for certificate.");
        uVar1 = 0;
      }
      else {
        (**(code **)(*param_5 + 0x50))(param_5);
        if (param_2 == '\0') {
          (**(code **)(*param_5 + 0x48))(param_5,"ExportPrivateKeyToDER",1);
          uVar1 = FUN_14013a350(puVar3,*(undefined1 *)(param_1 + 0x38c),param_3,param_4,param_5);
          (**(code **)(*param_5 + 0x50))(param_5);
        }
        else {
          (**(code **)(*param_5 + 0x30))
                    (param_5,
                     "Skipping private key access to avoid chance of interactive security dialog from appearing..."
                    );
          *param_4 = 1;
        }
        (**(code **)*puVar3)(puVar3,1);
      }
    }
  }
  else {
    FUN_1400b9e90(param_3,param_1 + 0x10);
    uVar1 = 1;
  }
  return uVar1;
}



void FUN_140110ca0(longlong param_1)

{
  char cVar1;
  int iVar2;
  int iVar3;
  undefined8 uVar4;
  longlong lVar5;
  longlong lVar6;
  void *pvVar7;
  undefined8 uVar8;
  int iVar9;
  undefined1 local_c8 [40];
  undefined8 local_a0;
  undefined8 local_98;
  undefined1 local_90 [40];
  undefined1 local_68 [48];
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  lVar5 = *(longlong *)(param_1 + 8);
  if (((lVar5 != 0) && (FUN_1400b7180(param_1 + 0xe0), lVar5 != 0)) &&
     (lVar5 = *(longlong *)(lVar5 + 0x18), lVar5 != 0)) {
    local_a0 = *(undefined8 *)(lVar5 + 0x30);
    local_98 = *(undefined8 *)(lVar5 + 0x38);
    FUN_14010fd80(&local_a0,3,param_1 + 0xe0);
  }
  lVar5 = *(longlong *)(param_1 + 8);
  FUN_1400b7180(param_1 + 0x180);
  if (lVar5 != 0) {
    lVar5 = *(longlong *)(lVar5 + 0x18);
    if (lVar5 != 0) {
      local_a0 = *(undefined8 *)(lVar5 + 0x50);
      local_98 = *(undefined8 *)(lVar5 + 0x58);
      FUN_14010fd80(&local_a0,3,param_1 + 0x180);
    }
  }
  FUN_1400bcc20(local_68);
  uVar4 = FUN_1400b7ce0(param_1 + 0xe0);
  FUN_1400bc640(local_68,uVar4);
  FUN_1400d0a70(local_90);
  FUN_1400be7e0(local_68,local_90,0x2c,1,1);
  iVar2 = FUN_140139d70(local_90);
  iVar9 = 0;
  if (0 < iVar2) {
    do {
      FUN_1400d0a70(local_c8);
      uVar4 = FUN_1400d0aa0(local_90,iVar9);
      FUN_1400be7e0(uVar4,local_c8,0x3d,1,1);
      iVar3 = FUN_140139d70(local_c8);
      if (iVar3 == 2) {
        lVar5 = FUN_1400d0aa0(local_c8,0);
        lVar6 = FUN_1400d0aa0(local_c8,1);
        if ((lVar5 != 0) && (lVar6 != 0)) {
          FUN_1400bbc30(lVar5);
          FUN_1400bd7d0(lVar5);
          FUN_1400bbc30(lVar6);
          pvVar7 = operator_new(0x20);
          uVar4 = 0;
          if (pvVar7 != (void *)0x0) {
            uVar4 = FUN_1400b8b90(lVar6);
            uVar8 = FUN_1400b8b90(lVar5);
            uVar4 = FUN_140106810(pvVar7,uVar8,uVar4);
          }
          FUN_1400d0c90(param_1 + 0x2c0,uVar4);
        }
      }
      FUN_1400d0d30(local_c8);
      FUN_1400d0e10(local_c8);
      iVar9 = iVar9 + 1;
    } while (iVar9 < iVar2);
  }
  FUN_1400d0d30(local_90);
  FUN_1400bbe30(local_68);
  uVar4 = FUN_1400b7ce0(param_1 + 0x180);
  FUN_1400bc640(local_68,uVar4);
  FUN_1400be7e0(local_68,local_90,0x2c,1,1);
  iVar2 = FUN_140139d70(local_90);
  iVar9 = 0;
  if (0 < iVar2) {
    do {
      FUN_1400d0a70(local_c8);
      uVar4 = FUN_1400d0aa0(local_90,iVar9);
      FUN_1400be7e0(uVar4,local_c8,0x3d,1,1);
      iVar3 = FUN_140139d70(local_c8);
      if (iVar3 == 2) {
        lVar5 = FUN_1400d0aa0(local_c8,0);
        lVar6 = FUN_1400d0aa0(local_c8,1);
        if ((lVar5 != 0) && (lVar6 != 0)) {
          FUN_1400bbc30(lVar5);
          FUN_1400bd7d0(lVar5);
          FUN_1400bbc30(lVar6);
          pvVar7 = operator_new(0x20);
          uVar4 = 0;
          if (pvVar7 != (void *)0x0) {
            uVar4 = FUN_1400b8b90(lVar6);
            uVar8 = FUN_1400b8b90(lVar5);
            uVar4 = FUN_140106810(pvVar7,uVar8,uVar4);
          }
LAB_140111077:
          FUN_1400d0c90(param_1 + 0x2e8,uVar4);
        }
      }
      else {
        iVar3 = FUN_140139d70(local_c8);
        if (2 < iVar3) {
          lVar5 = FUN_1400d0aa0(local_c8,0);
          lVar6 = FUN_1400d0aa0(local_c8,1);
          if ((lVar5 != 0) && (lVar6 != 0)) {
            FUN_1400bbc30(lVar5);
            FUN_1400bd7d0(lVar5);
            cVar1 = FUN_1400bde10(lVar6," + OID");
            if (cVar1 != '\0') {
              FUN_1400bcfa0(lVar6," + OID",&DAT_140244e70);
              FUN_1400bbd50(lVar6,0x3d);
            }
            FUN_1400bbc30(lVar6);
            pvVar7 = operator_new(0x20);
            uVar4 = 0;
            if (pvVar7 != (void *)0x0) {
              uVar4 = FUN_1400b8b90(lVar6);
              uVar8 = FUN_1400b8b90(lVar5);
              uVar4 = FUN_140106810(pvVar7,uVar8,uVar4);
            }
            goto LAB_140111077;
          }
        }
      }
      FUN_1400d0d30(local_c8);
      FUN_1400d0e10(local_c8);
      iVar9 = iVar9 + 1;
    } while (iVar9 < iVar2);
  }
  FUN_1400d0d30(local_90);
  FUN_140110360(param_1);
  FUN_1400d0e10(local_90);
  FUN_1400bceb0(local_68);
  return;
}



undefined1 FUN_1401110f0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  
  FUN_1400bbe30(param_2);
  cVar1 = FUN_1401106b0(param_1,2,param_3);
  if (cVar1 == '\0') {
    return 0;
  }
  FUN_1400bda40(param_2,param_1 + 800);
  return 1;
}



undefined8 FUN_140111160(longlong param_1,undefined1 *param_2)

{
  undefined8 uVar1;
  
  *param_2 = 0;
  uVar1 = FUN_1401106b0(param_1,4);
  if ((char)uVar1 == '\0') {
    return uVar1;
  }
  *param_2 = *(undefined1 *)(param_1 + 900);
  return 1;
}



void FUN_1401111b0(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  char *pcVar3;
  undefined *puVar4;
  
  FUN_1401106b0(param_1,7,param_2);
  if (*(char *)(param_1 + 0x31d) != '\0') {
    (**(code **)(*param_2 + 0x48))(param_2,"CertKeyProvider",1);
    lVar1 = *param_2;
    uVar2 = FUN_1400b8b90(param_1 + 800);
    (**(code **)(lVar1 + 0x58))(param_2,"keyContainer",uVar2);
    FUN_1400cf5e0(param_2,"providerType",*(undefined4 *)(param_1 + 0x380));
    pcVar3 = "machine";
    if (*(char *)(param_1 + 900) == '\0') {
      pcVar3 = "user";
    }
    (**(code **)(*param_2 + 0x58))(param_2,"keyset",pcVar3);
    puVar4 = &DAT_1402487f8;
    if (*(char *)(param_1 + 0x385) == '\0') {
      puVar4 = &DAT_1402487f4;
    }
    (**(code **)(*param_2 + 0x58))(param_2,"silent",puVar4);
    pcVar3 = "key exchange";
    if (*(char *)(param_1 + 0x38c) == '\0') {
      pcVar3 = "signature";
    }
    (**(code **)(*param_2 + 0x58))(param_2,"keyUsage",pcVar3);
                    // WARNING: Could not recover jumptable at 0x0001401112b1. Too many branches
                    // WARNING: Treating indirect jump as call
    (**(code **)(*param_2 + 0x50))(param_2);
    return;
  }
                    // WARNING: Could not recover jumptable at 0x0001401112c6. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_2 + 0x30))(param_2,"MsCertificate key provider info not available.");
  return;
}



undefined1
FUN_1401112d0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined8 uVar2;
  undefined1 local_e8 [224];
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1400d3540(local_e8);
  uVar1 = FUN_140110910(param_1,local_e8,param_2,param_4,uVar2);
  FUN_1400d3480(local_e8);
  return uVar1;
}



bool FUN_140111330(longlong param_1,longlong param_2,longlong *param_3)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined8 *puVar6;
  bool bVar7;
  int local_res18 [2];
  undefined1 local_res20 [8];
  longlong local_68 [2];
  undefined1 local_58 [48];
  
  local_68[1] = 0xfffffffffffffffe;
  puVar6 = (undefined8 *)0x0;
  local_68[0] = 0;
  (**(code **)(*param_3 + 0x48))(param_3,"checkPrivateKey",1);
  cVar2 = FUN_14010fcd0(param_3);
  bVar7 = false;
  if (cVar2 != '\0') {
    iVar3 = FUN_1400bbb10(param_2 + 8);
    if (iVar3 != 0) {
      lVar1 = *param_3;
      uVar4 = FUN_1400b8b90(param_2 + 8);
      (**(code **)(lVar1 + 0x58))(param_3,"cspProviderName",uVar4);
      uVar4 = FUN_1400b8b90(param_2 + 0x38);
      uVar5 = FUN_1400b8b90(param_2 + 8);
      puVar6 = (undefined8 *)FUN_1401328c0(uVar5,uVar4,0,param_3);
      if (puVar6 != (undefined8 *)0x0) {
        local_68[0] = FUN_1401320e0(puVar6);
      }
    }
    iVar3 = (*DAT_140317390)(*(undefined8 *)(param_1 + 8),4,0,local_68,local_res20,local_res18);
    if (iVar3 == 0) {
      FUN_1400cf640(param_3);
      (**(code **)(*param_3 + 0x28))(param_3,"Cannot acquire private key via CryptoAPI");
    }
    else if ((local_res18[0] != 0) && (local_68[0] != 0)) {
      FUN_1400bcc20(local_58);
      FUN_1400bbe30(local_58);
      cVar2 = FUN_1401106b0(param_1,2,param_3);
      if (cVar2 != '\0') {
        FUN_1400bda40(local_58,param_1 + 800);
      }
      lVar1 = *param_3;
      uVar4 = FUN_1400b8b90(local_58);
      (**(code **)(lVar1 + 0x58))(param_3,"myKeyContainer",uVar4);
      FUN_1400bceb0(local_58);
    }
    if (puVar6 != (undefined8 *)0x0) {
      (**(code **)*puVar6)(puVar6,1);
    }
    (**(code **)(*param_3 + 0x50))(param_3);
    bVar7 = iVar3 != 0;
  }
  return bVar7;
}



undefined8 * FUN_1401114e0(undefined8 *param_1,undefined8 param_2,undefined8 param_3)

{
  *param_1 = MsCertificate::vftable;
  param_1[1] = param_2;
  FUN_1400b8c40(param_1 + 2);
  FUN_1400b6fd0(param_1 + 7);
  *(undefined1 *)((longlong)param_1 + 0xd9) = 0;
  FUN_1400b6fd0(param_1 + 0x1c);
  FUN_1400b6fd0(param_1 + 0x30);
  FUN_1400b6fd0(param_1 + 0x44);
  FUN_1400d0a70(param_1 + 0x58);
  FUN_1400d0a70(param_1 + 0x5d);
  param_1[0x62] = 0;
  *(undefined4 *)(param_1 + 99) = 0;
  *(undefined2 *)((longlong)param_1 + 0x31c) = 0;
  *(undefined1 *)((longlong)param_1 + 0x31e) = 0;
  FUN_1400bcc20(param_1 + 100);
  FUN_1400bcc20(param_1 + 0x6a);
  param_1[0x70] = 0;
  *(undefined4 *)(param_1 + 0x71) = 0;
  *(undefined1 *)((longlong)param_1 + 0x38c) = 1;
  FUN_140110ca0(param_1,param_3);
  return param_1;
}



undefined8 *
FUN_1401115e0(undefined8 *param_1,PCCERT_CONTEXT param_2,undefined8 param_3,undefined8 param_4)

{
  PCCERT_CONTEXT pCVar1;
  
  *param_1 = MsCertificate::vftable;
  param_1[1] = 0;
  FUN_1400b8c40(param_1 + 2);
  FUN_1400b6fd0(param_1 + 7);
  *(undefined1 *)((longlong)param_1 + 0xd9) = 0;
  FUN_1400b6fd0(param_1 + 0x1c);
  FUN_1400b6fd0(param_1 + 0x30);
  FUN_1400b6fd0(param_1 + 0x44);
  FUN_1400d0a70(param_1 + 0x58);
  FUN_1400d0a70(param_1 + 0x5d);
  param_1[0x62] = 0;
  *(undefined4 *)(param_1 + 99) = 0;
  *(undefined2 *)((longlong)param_1 + 0x31c) = 0;
  *(undefined1 *)((longlong)param_1 + 0x31e) = 0;
  FUN_1400bcc20(param_1 + 100);
  FUN_1400bcc20(param_1 + 0x6a);
  param_1[0x70] = 0;
  *(undefined4 *)(param_1 + 0x71) = 0;
  *(undefined1 *)((longlong)param_1 + 0x38c) = 1;
  pCVar1 = CertDuplicateCertificateContext(param_2);
  param_1[1] = pCVar1;
  FUN_140110ca0(param_1,param_4);
  return param_1;
}



undefined8 FUN_140111700(BYTE *param_1,DWORD param_2,longlong *param_3,undefined8 param_4)

{
  longlong lVar1;
  PCCERT_CONTEXT pCVar2;
  void *pvVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined1 local_40 [56];
  
  uVar5 = 0xfffffffffffffffe;
  pCVar2 = CertCreateCertificateContext(1,param_1,param_2);
  if (pCVar2 == (PCCERT_CONTEXT)0x0) {
    FUN_1400bcc20(local_40);
    FUN_1400bebc0(local_40);
    FUN_1400bbf40(local_40,"createFromBinary: ");
    lVar1 = *param_3;
    uVar5 = FUN_1400b8b90(local_40);
    (**(code **)(lVar1 + 0x28))(param_3,uVar5);
    FUN_1400bceb0(local_40);
    uVar4 = 0;
  }
  else {
    pvVar3 = operator_new(0x390);
    uVar4 = 0;
    if (pvVar3 != (void *)0x0) {
      uVar4 = FUN_1401114e0(pvVar3,pCVar2,param_3,param_4,uVar5);
    }
  }
  return uVar4;
}



longlong FUN_1401117b0(longlong param_1)

{
  int iVar1;
  undefined4 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  void *local_res8;
  undefined1 local_res10 [8];
  
  FUN_1400bebf0(local_res10);
  local_res8 = operator_new(0x390);
  if (local_res8 == (void *)0x0) {
    lVar3 = 0;
  }
  else {
    lVar3 = FUN_1401115e0(local_res8,*(undefined8 *)(param_1 + 8),0,local_res10);
  }
  if (lVar3 != 0) {
    iVar1 = FUN_1400b8b80(param_1 + 0x10);
    if (iVar1 != 0) {
      uVar2 = FUN_1400b8b80(param_1 + 0x10);
      uVar4 = FUN_1400b8b90(param_1 + 0x10);
      FUN_1400b8b00(lVar3 + 0x10);
      FUN_1400b97e0(lVar3 + 0x10,uVar4,uVar2);
    }
  }
  iVar1 = FUN_1400b8350(param_1 + 0x38);
  if (0 < iVar1) {
    FUN_1400bebf0(&local_res8);
    FUN_140110060(lVar3,param_1 + 0x38,*(undefined1 *)(param_1 + 0xd8),
                  *(undefined1 *)(param_1 + 0xd9),&local_res8);
    FUN_1400bec20(&local_res8);
  }
  FUN_1400bec20(local_res10);
  return lVar3;
}



undefined8
FUN_1401118c0(undefined4 param_1,longlong param_2,longlong param_3,int param_4,undefined8 param_5)

{
  undefined8 uVar1;
  void *pvVar2;
  undefined8 *puVar3;
  undefined1 local_48 [8];
  undefined8 local_40;
  void *local_38;
  undefined1 local_30 [40];
  
  local_40 = 0xfffffffffffffffe;
  if (param_4 == 0) {
    FUN_1400b8b30(param_5);
    uVar1 = 1;
  }
  else {
    if ((param_2 != 0) && (param_3 != 0)) {
      local_38 = operator_new(0x148);
      if (local_38 == (void *)0x0) {
        pvVar2 = (void *)0x0;
      }
      else {
        pvVar2 = (void *)FUN_1400e2820(local_38);
      }
      FUN_1400e34a0(pvVar2,param_1);
      FUN_1400e3580(pvVar2);
      FUN_1400e34f0(pvVar2,param_2);
      FUN_1400b8c40(local_30);
      FUN_1400b97e0(local_30,param_3,param_4);
      FUN_1400b9a00(local_30,0,0x10);
      FUN_1400bebf0(local_48);
      puVar3 = (undefined8 *)FUN_1400e49b0(pvVar2,local_30,local_48);
      if (pvVar2 != (void *)0x0) {
        FUN_1400e2870(pvVar2);
        operator_delete(pvVar2);
      }
      if (puVar3 != (undefined8 *)0x0) {
        FUN_1400ba380(param_5,puVar3);
        (**(code **)*puVar3)(puVar3,1);
        FUN_1400bec20(local_48);
        FUN_1400b92d0(local_30);
        return 1;
      }
      FUN_1400bec20(local_48);
      FUN_1400b92d0(local_30);
    }
    uVar1 = 0;
  }
  return uVar1;
}



void FUN_140111a30(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  int iVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 local_40 [16];
  undefined1 local_30 [40];
  
  uVar4 = 0xfffffffffffffffe;
  iVar1 = FUN_1400bbb10(param_2);
  if (iVar1 != 0) {
    FUN_1400b8c40(local_30);
    uVar2 = FUN_1400bbb10(param_2);
    uVar3 = FUN_1400b8b90(param_2);
    FUN_1401118c0(0x80,param_1,uVar3,uVar2,local_30,param_3,uVar4);
    FUN_1400f0d10(local_40);
    FUN_1400bbe30(param_2);
    uVar2 = FUN_1400b8b80(local_30);
    uVar4 = FUN_1400b8b90(local_30);
    FUN_1400f30f0(uVar4,uVar2,param_2);
    FUN_1400f0d30(local_40);
    FUN_1400b92d0(local_30);
  }
  return;
}



undefined8
FUN_140111b10(undefined4 param_1,longlong param_2,longlong param_3,int param_4,undefined8 param_5,
             undefined8 param_6)

{
  undefined8 uVar1;
  void *pvVar2;
  undefined8 *puVar3;
  undefined1 local_38 [48];
  
  if (param_4 == 0) {
    FUN_1400b8b30(param_5);
    uVar1 = 1;
  }
  else {
    if ((param_3 != 0) && (param_2 != 0)) {
      pvVar2 = operator_new(0x148);
      if (pvVar2 == (void *)0x0) {
        pvVar2 = (void *)0x0;
      }
      else {
        pvVar2 = (void *)FUN_1400e2820(pvVar2);
      }
      FUN_1400e34a0(pvVar2,param_1);
      FUN_1400e3580(pvVar2);
      FUN_1400e34f0(pvVar2,param_2);
      FUN_1400b8c40(local_38);
      FUN_1400ba310(local_38,param_3,param_4);
      puVar3 = (undefined8 *)FUN_1400e4fd0(pvVar2,local_38,param_6);
      FUN_1400b8c00(local_38);
      if (pvVar2 != (void *)0x0) {
        FUN_1400e2870(pvVar2);
        operator_delete(pvVar2);
      }
      if (puVar3 != (undefined8 *)0x0) {
        FUN_1400b9c60(puVar3,0,0x10,param_6);
        FUN_1400ba380(param_5,puVar3);
        (**(code **)*puVar3)(puVar3,1);
        FUN_1400b92d0(local_38);
        return 1;
      }
      FUN_1400b92d0(local_38);
    }
    uVar1 = 0;
  }
  return uVar1;
}



void FUN_140111c70(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  int iVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  void *pvVar4;
  undefined4 local_res20 [2];
  undefined1 local_50 [16];
  undefined1 local_40 [40];
  
  iVar1 = FUN_1400bbb10(param_2);
  if (iVar1 != 0) {
    FUN_1400f0d10(local_50);
    local_res20[0] = 0;
    uVar2 = FUN_1400bbb10(param_2);
    uVar3 = FUN_1400b8b90(param_2);
    pvVar4 = (void *)FUN_1400f1860(uVar3,uVar2,local_res20);
    if (pvVar4 != (void *)0x0) {
      FUN_1400b8c40(local_40);
      FUN_140111b10(0x80,param_1,pvVar4,local_res20[0],local_40,param_3);
      FUN_1400bbe30(param_2);
      uVar2 = FUN_1400b8b80(local_40);
      uVar3 = FUN_1400b8b90(local_40);
      FUN_1400bc8a0(param_2,uVar3,uVar2);
      operator_delete(pvVar4);
      FUN_1400b92d0(local_40);
    }
    FUN_1400f0d30(local_50);
  }
  return;
}



uint FUN_140111d80(uint param_1,uint param_2)

{
  uint uVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  
  uVar5 = 0;
  iVar2 = 0;
  do {
    uVar1 = param_2;
    if (iVar2 != 0) {
      uVar1 = param_1;
    }
    uVar5 = uVar5 ^ uVar1;
    uVar3 = (-(uint)((uVar5 & 0x80000000) != 0) & 0x14d ^ (uVar5 >> 0x18) * 2) & 0xff;
    uVar1 = -(uint)((uVar5 & 0x1000000) != 0) & 0xa6 ^ uVar5 >> 0x19 ^ uVar3;
    uVar3 = ((uVar1 << 8 ^ uVar3) << 8 ^ uVar1 ^ uVar5) << 8;
    uVar4 = uVar3 ^ uVar5 >> 0x18;
    uVar1 = (-(uint)((uVar4 & 0x80000000) != 0) & 0x14d ^ (uVar3 >> 0x18) * 2) & 0xff;
    uVar5 = -(uint)((uVar4 & 0x1000000) != 0) & 0xa6 ^ uVar3 >> 0x19 ^ uVar1;
    uVar4 = ((uVar5 << 8 ^ uVar1) << 8 ^ uVar5 ^ uVar4) << 8;
    uVar3 = uVar4 ^ uVar3 >> 0x18;
    uVar1 = (-(uint)((uVar3 & 0x80000000) != 0) & 0x14d ^ (uVar4 >> 0x18) * 2) & 0xff;
    uVar5 = -(uint)((uVar3 & 0x1000000) != 0) & 0xa6 ^ uVar4 >> 0x19 ^ uVar1;
    uVar3 = ((uVar5 << 8 ^ uVar1) << 8 ^ uVar5 ^ uVar3) << 8;
    uVar4 = uVar3 ^ uVar4 >> 0x18;
    uVar1 = (-(uint)((uVar4 & 0x80000000) != 0) & 0x14d ^ (uVar3 >> 0x18) * 2) & 0xff;
    iVar2 = iVar2 + 1;
    uVar5 = -(uint)((uVar4 & 0x1000000) != 0) & 0xa6 ^ uVar3 >> 0x19 ^ uVar1;
    uVar5 = ((uVar5 << 8 ^ uVar1) << 8 ^ uVar5 ^ uVar4) << 8 ^ uVar3 >> 0x18;
  } while (iVar2 < 2);
  return uVar5;
}



void FUN_140111f20(void)

{
  byte bVar1;
  byte bVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  byte bVar5;
  longlong lVar6;
  byte bVar7;
  byte bVar8;
  byte bVar9;
  byte bVar10;
  undefined4 local_res8;
  
  lVar6 = 0;
  do {
    bVar1 = (&DAT_140309650)[lVar6];
    bVar2 = (&DAT_140309750)[lVar6];
    bVar8 = -((bVar1 & 2) != 0) & 0xb4;
    bVar5 = -((bVar1 & 1) != 0) & 0x5a;
    bVar7 = bVar1 >> 2 ^ bVar5 ^ bVar8 ^ bVar1;
    bVar8 = (byte)(bVar1 >> 1 ^ bVar1) >> 1 ^ -((bVar1 & 1) != 0) & 0xb4U ^ bVar5 ^ bVar8 ^ bVar1;
    bVar9 = -((bVar2 & 2) != 0) & 0xb4;
    bVar5 = -((bVar2 & 1) != 0) & 0x5a;
    bVar10 = bVar2 >> 2 ^ bVar5 ^ bVar9 ^ bVar2;
    local_res8._0_2_ = CONCAT11(bVar10,bVar2);
    bVar5 = (byte)(bVar2 >> 1 ^ bVar2) >> 1 ^ -((bVar2 & 1) != 0) & 0xb4U ^ bVar5 ^ bVar9 ^ bVar2;
    local_res8._0_3_ = CONCAT12(bVar5,(undefined2)local_res8);
    local_res8 = CONCAT13(bVar5,(undefined3)local_res8);
    uVar3 = local_res8;
    local_res8._0_2_ = CONCAT11(bVar8,bVar8);
    local_res8._0_3_ = CONCAT12(bVar7,(undefined2)local_res8);
    local_res8 = CONCAT13(bVar1,(undefined3)local_res8);
    uVar4 = local_res8;
    (&DAT_1403173b0)[lVar6] = uVar3;
    local_res8._0_2_ = CONCAT11(bVar5,bVar10);
    local_res8._0_3_ = CONCAT12(bVar2,(undefined2)local_res8);
    local_res8 = CONCAT13(bVar5,(undefined3)local_res8);
    uVar3 = local_res8;
    (&DAT_1403177b0)[lVar6] = uVar4;
    bVar2 = (&DAT_140309651)[lVar6];
    local_res8._0_3_ = CONCAT12(bVar8,CONCAT11(bVar1,bVar7));
    local_res8 = CONCAT13(bVar7,(undefined3)local_res8);
    (&DAT_140317bb0)[lVar6] = uVar3;
    (&DAT_140317fb0)[lVar6] = local_res8;
    bVar1 = (&DAT_140309751)[lVar6];
    bVar8 = -((bVar2 & 2) != 0) & 0xb4;
    bVar5 = -((bVar2 & 1) != 0) & 0x5a;
    bVar7 = bVar2 >> 2 ^ bVar5 ^ bVar8 ^ bVar2;
    bVar8 = (byte)(bVar2 >> 1 ^ bVar2) >> 1 ^ -((bVar2 & 1) != 0) & 0xb4U ^ bVar5 ^ bVar8 ^ bVar2;
    bVar9 = -((bVar1 & 2) != 0) & 0xb4;
    bVar5 = -((bVar1 & 1) != 0) & 0x5a;
    bVar10 = bVar1 >> 2 ^ bVar5 ^ bVar9 ^ bVar1;
    local_res8._0_2_ = CONCAT11(bVar10,bVar1);
    bVar5 = (byte)(bVar1 >> 1 ^ bVar1) >> 1 ^ -((bVar1 & 1) != 0) & 0xb4U ^ bVar5 ^ bVar9 ^ bVar1;
    local_res8._0_3_ = CONCAT12(bVar5,(undefined2)local_res8);
    local_res8 = CONCAT13(bVar5,(undefined3)local_res8);
    uVar3 = local_res8;
    local_res8._0_2_ = CONCAT11(bVar8,bVar8);
    local_res8._0_3_ = CONCAT12(bVar7,(undefined2)local_res8);
    local_res8 = CONCAT13(bVar2,(undefined3)local_res8);
    uVar4 = local_res8;
    (&DAT_1403173b4)[lVar6] = uVar3;
    local_res8._0_2_ = CONCAT11(bVar5,bVar10);
    local_res8._0_3_ = CONCAT12(bVar1,(undefined2)local_res8);
    local_res8 = CONCAT13(bVar5,(undefined3)local_res8);
    (&DAT_1403177b4)[lVar6] = uVar4;
    bVar1 = (&DAT_140309652)[lVar6];
    (&DAT_140317bb4)[lVar6] = local_res8;
    local_res8._0_3_ = CONCAT12(bVar8,CONCAT11(bVar2,bVar7));
    local_res8 = CONCAT13(bVar7,(undefined3)local_res8);
    (&DAT_140317fb4)[lVar6] = local_res8;
    bVar2 = (&DAT_140309752)[lVar6];
    bVar8 = -((bVar1 & 2) != 0) & 0xb4;
    bVar5 = -((bVar1 & 1) != 0) & 0x5a;
    bVar7 = bVar1 >> 2 ^ bVar5 ^ bVar8 ^ bVar1;
    bVar8 = (byte)(bVar1 >> 1 ^ bVar1) >> 1 ^ -((bVar1 & 1) != 0) & 0xb4U ^ bVar5 ^ bVar8 ^ bVar1;
    bVar9 = -((bVar2 & 2) != 0) & 0xb4;
    bVar5 = -((bVar2 & 1) != 0) & 0x5a;
    bVar10 = bVar2 >> 2 ^ bVar5 ^ bVar9 ^ bVar2;
    local_res8._0_2_ = CONCAT11(bVar10,bVar2);
    bVar5 = (byte)(bVar2 >> 1 ^ bVar2) >> 1 ^ -((bVar2 & 1) != 0) & 0xb4U ^ bVar5 ^ bVar9 ^ bVar2;
    local_res8._0_3_ = CONCAT12(bVar5,(undefined2)local_res8);
    local_res8 = CONCAT13(bVar5,(undefined3)local_res8);
    (&DAT_1403173b8)[lVar6] = local_res8;
    local_res8._0_2_ = CONCAT11(bVar8,bVar8);
    local_res8._0_3_ = CONCAT12(bVar7,(undefined2)local_res8);
    local_res8 = CONCAT13(bVar1,(undefined3)local_res8);
    uVar3 = local_res8;
    local_res8._0_2_ = CONCAT11(bVar5,bVar10);
    (&DAT_1403177b8)[lVar6] = uVar3;
    local_res8._0_3_ = CONCAT12(bVar2,(undefined2)local_res8);
    local_res8 = CONCAT13(bVar5,(undefined3)local_res8);
    bVar2 = (&DAT_140309653)[lVar6];
    (&DAT_140317bb8)[lVar6] = local_res8;
    local_res8._0_3_ = CONCAT12(bVar8,CONCAT11(bVar1,bVar7));
    local_res8 = CONCAT13(bVar7,(undefined3)local_res8);
    (&DAT_140317fb8)[lVar6] = local_res8;
    bVar1 = (&DAT_140309753)[lVar6];
    bVar8 = -((bVar2 & 2) != 0) & 0xb4;
    bVar5 = -((bVar2 & 1) != 0) & 0x5a;
    bVar7 = bVar2 >> 2 ^ bVar5 ^ bVar8 ^ bVar2;
    bVar8 = (byte)(bVar2 >> 1 ^ bVar2) >> 1 ^ -((bVar2 & 1) != 0) & 0xb4U ^ bVar5 ^ bVar8 ^ bVar2;
    bVar9 = -((bVar1 & 2) != 0) & 0xb4;
    bVar5 = -((bVar1 & 1) != 0) & 0x5a;
    bVar10 = bVar1 >> 2 ^ bVar5 ^ bVar9 ^ bVar1;
    local_res8._0_2_ = CONCAT11(bVar10,bVar1);
    lVar6 = lVar6 + 4;
    bVar5 = (byte)(bVar1 >> 1 ^ bVar1) >> 1 ^ -((bVar1 & 1) != 0) & 0xb4U ^ bVar5 ^ bVar9 ^ bVar1;
    local_res8._0_3_ = CONCAT12(bVar5,(undefined2)local_res8);
    local_res8 = CONCAT13(bVar5,(undefined3)local_res8);
    uVar3 = local_res8;
    local_res8._0_2_ = CONCAT11(bVar8,bVar8);
    local_res8._0_3_ = CONCAT12(bVar7,(undefined2)local_res8);
    local_res8 = CONCAT13(bVar2,(undefined3)local_res8);
    uVar4 = local_res8;
    *(undefined4 *)(lVar6 * 4 + 0x1403173ac) = uVar3;
    local_res8._0_2_ = CONCAT11(bVar5,bVar10);
    local_res8._0_3_ = CONCAT12(bVar1,(undefined2)local_res8);
    local_res8 = CONCAT13(bVar5,(undefined3)local_res8);
    uVar3 = local_res8;
    *(undefined4 *)(lVar6 * 4 + 0x1403177ac) = uVar4;
    local_res8._0_2_ = CONCAT11(bVar2,bVar7);
    *(undefined4 *)(lVar6 * 4 + 0x140317bac) = uVar3;
    local_res8._0_3_ = CONCAT12(bVar8,(undefined2)local_res8);
    local_res8 = CONCAT13(bVar7,(undefined3)local_res8);
    *(undefined4 *)(lVar6 * 4 + 0x140317fac) = local_res8;
  } while (lVar6 < 0x100);
  DAT_140309850 = 0;
  return;
}



void FUN_140112420(uint *param_1,uint *param_2,byte param_3)

{
  uint uVar1;
  
  uVar1 = (uint)param_3 * 0x1010101;
  *param_1 = *param_2 ^ uVar1;
  param_1[1] = param_2[1] ^ uVar1;
  param_1[2] = param_2[2] ^ uVar1;
  param_1[3] = param_2[3] ^ uVar1;
  param_1[4] = param_2[4] ^ uVar1;
  param_1[5] = param_2[5] ^ uVar1;
  param_1[6] = param_2[6] ^ uVar1;
  param_1[7] = param_2[7] ^ uVar1;
  param_1[8] = param_2[8] ^ uVar1;
  param_1[9] = param_2[9] ^ uVar1;
  param_1[10] = param_2[10] ^ uVar1;
  param_1[0xb] = param_2[0xb] ^ uVar1;
  param_1[0xc] = param_2[0xc] ^ uVar1;
  param_1[0xd] = param_2[0xd] ^ uVar1;
  param_1[0xe] = param_2[0xe] ^ uVar1;
  param_1[0xf] = param_2[0xf] ^ uVar1;
  param_1[0x10] = param_2[0x10] ^ uVar1;
  param_1[0x11] = param_2[0x11] ^ uVar1;
  param_1[0x12] = param_2[0x12] ^ uVar1;
  param_1[0x13] = param_2[0x13] ^ uVar1;
  param_1[0x14] = param_2[0x14] ^ uVar1;
  param_1[0x15] = param_2[0x15] ^ uVar1;
  param_1[0x16] = param_2[0x16] ^ uVar1;
  param_1[0x17] = param_2[0x17] ^ uVar1;
  param_1[0x18] = param_2[0x18] ^ uVar1;
  param_1[0x19] = param_2[0x19] ^ uVar1;
  param_1[0x1a] = param_2[0x1a] ^ uVar1;
  param_1[0x1b] = param_2[0x1b] ^ uVar1;
  param_1[0x1c] = param_2[0x1c] ^ uVar1;
  param_1[0x1d] = param_2[0x1d] ^ uVar1;
  param_1[0x1e] = param_2[0x1e] ^ uVar1;
  param_1[0x1f] = param_2[0x1f] ^ uVar1;
  param_1[0x20] = param_2[0x20] ^ uVar1;
  param_1[0x21] = param_2[0x21] ^ uVar1;
  param_1[0x22] = param_2[0x22] ^ uVar1;
  param_1[0x23] = param_2[0x23] ^ uVar1;
  param_1[0x24] = param_2[0x24] ^ uVar1;
  param_1[0x25] = param_2[0x25] ^ uVar1;
  param_1[0x26] = param_2[0x26] ^ uVar1;
  param_1[0x27] = param_2[0x27] ^ uVar1;
  param_1[0x28] = param_2[0x28] ^ uVar1;
  param_1[0x29] = param_2[0x29] ^ uVar1;
  param_1[0x2a] = param_2[0x2a] ^ uVar1;
  param_1[0x2b] = param_2[0x2b] ^ uVar1;
  param_1[0x2c] = param_2[0x2c] ^ uVar1;
  param_1[0x2d] = param_2[0x2d] ^ uVar1;
  param_1[0x2e] = param_2[0x2e] ^ uVar1;
  param_1[0x2f] = param_2[0x2f] ^ uVar1;
  param_1[0x30] = param_2[0x30] ^ uVar1;
  param_1[0x31] = param_2[0x31] ^ uVar1;
  param_1[0x32] = param_2[0x32] ^ uVar1;
  param_1[0x33] = param_2[0x33] ^ uVar1;
  param_1[0x34] = param_2[0x34] ^ uVar1;
  param_1[0x35] = param_2[0x35] ^ uVar1;
  param_1[0x36] = param_2[0x36] ^ uVar1;
  param_1[0x37] = param_2[0x37] ^ uVar1;
  param_1[0x38] = param_2[0x38] ^ uVar1;
  param_1[0x39] = param_2[0x39] ^ uVar1;
  param_1[0x3a] = param_2[0x3a] ^ uVar1;
  param_1[0x3b] = param_2[0x3b] ^ uVar1;
  param_1[0x3c] = param_2[0x3c] ^ uVar1;
  param_1[0x3d] = param_2[0x3d] ^ uVar1;
  param_1[0x3e] = param_2[0x3e] ^ uVar1;
  param_1[0x3f] = param_2[0x3f] ^ uVar1;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140112730(char *param_1)

{
  undefined4 uVar1;
  uint uVar2;
  undefined4 uVar3;
  uint uVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  byte *pbVar8;
  ulonglong uVar9;
  uint *puVar10;
  ulonglong uVar11;
  char *pcVar12;
  char *pcVar13;
  undefined1 *puVar14;
  char *pcVar15;
  uint uVar16;
  uint uVar17;
  longlong lVar18;
  undefined1 auStack_2a8 [32];
  undefined4 local_288;
  int local_284;
  undefined8 local_280;
  char *local_270;
  byte local_268 [4];
  byte local_264;
  byte local_263;
  byte local_262;
  byte local_261;
  undefined1 local_260;
  undefined1 local_25f;
  undefined1 local_25e;
  undefined1 local_25d;
  undefined1 local_25c;
  undefined1 local_25b;
  undefined1 local_25a;
  undefined1 local_259;
  undefined8 local_258;
  byte local_250;
  byte local_24f;
  byte local_24e;
  byte local_24d;
  byte local_24c;
  byte local_24b;
  byte local_24a;
  byte local_249;
  byte local_248 [4];
  byte local_244;
  byte bStack_243;
  byte bStack_242;
  byte bStack_241;
  byte local_240;
  byte local_23f;
  byte local_23e;
  byte local_23d;
  byte local_23c;
  byte local_23b;
  byte local_23a;
  byte local_239;
  byte local_238 [512];
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_2a8;
  uVar7 = 0;
  local_270 = param_1;
  if (DAT_140309850 != 0) {
    FUN_140111f20();
  }
  local_284 = *(int *)(param_1 + 4);
  local_280 = CONCAT44(local_280._4_4_,*(int *)(param_1 + 0xc) * 2 + 8);
  uVar2 = (int)(local_284 + 0x3f + (local_284 + 0x3f >> 0x1f & 0x3fU)) >> 6;
  lVar18 = (longlong)(int)uVar2;
  local_258 = lVar18;
  if (0 < (int)uVar2) {
    pbVar8 = local_268 + (longlong)(int)(uVar2 - 1) * 4;
    pcVar15 = param_1 + 0x14;
    uVar9 = uVar7;
    do {
      uVar3 = *(undefined4 *)pcVar15;
      *(undefined4 *)((longlong)&local_258 + uVar9 * 4) = *(undefined4 *)(pcVar15 + -4);
      *(undefined4 *)(local_248 + uVar9 * 4) = uVar3;
      uVar3 = FUN_140111d80();
      uVar9 = uVar9 + 1;
      *(undefined4 *)(pbVar8 + (longlong)(param_1 + (0x30 - (longlong)local_268))) = uVar3;
      *(undefined4 *)pbVar8 = uVar3;
      pbVar8 = pbVar8 + -4;
      pcVar15 = pcVar15 + 8;
    } while ((longlong)uVar9 < lVar18);
  }
  if (0 < (int)local_280 / 2) {
    uVar6 = (ulonglong)(uint)((int)local_280 / 2);
    uVar2 = uVar2 & 3;
    puVar10 = (uint *)(param_1 + 0x44);
    uVar9 = uVar7;
    uVar5 = uVar7;
    uVar11 = uVar7;
    do {
      uVar16 = (uint)uVar11;
      local_288._1_1_ = (byte)(uVar9 >> 8);
      local_288._2_1_ = (byte)(uVar9 >> 0x10);
      local_288._3_1_ = (byte)(uVar9 >> 0x18);
      if (uVar2 == 0) {
        uVar5 = (ulonglong)((&DAT_140309750)[uVar9 & 0xff] ^ local_24c);
        local_288._1_1_ = (&DAT_140309650)[local_288._1_1_] ^ local_24b;
        local_288._2_1_ = (&DAT_140309650)[local_288._2_1_] ^ local_24a;
        local_288._3_1_ = (&DAT_140309750)[local_288._3_1_] ^ local_249;
LAB_1401128d7:
        local_288._0_1_ = (&DAT_140309750)[uVar5] ^ local_250;
        local_288._1_1_ = (&DAT_140309750)[local_288._1_1_] ^ local_24f;
        local_288._2_1_ = (&DAT_140309650)[local_288._2_1_] ^ local_24e;
        local_288._3_1_ = (&DAT_140309650)[local_288._3_1_] ^ local_24d;
LAB_140112911:
        uVar5 = (ulonglong)
                (uint)((&DAT_140317fb0)
                       [(&DAT_140309750)[(&DAT_140309750)[local_288._3_1_] ^ local_258._7_1_] ^
                        local_258._3_1_] ^
                       (&DAT_140317bb0)
                       [(&DAT_140309750)[(&DAT_140309650)[local_288._2_1_] ^ local_258._6_1_] ^
                        local_258._2_1_] ^
                       (&DAT_1403177b0)
                       [(&DAT_140309650)[(&DAT_140309750)[local_288._1_1_] ^ local_258._5_1_] ^
                        local_258._1_1_] ^
                      (&DAT_1403173b0)
                      [(&DAT_140309650)[(&DAT_140309650)[(byte)local_288] ^ local_258._4_1_] ^
                       (byte)local_258]);
      }
      else {
        if (uVar2 == 2) {
          local_288._0_1_ = (byte)uVar9;
          goto LAB_140112911;
        }
        if (uVar2 == 3) {
          uVar5 = uVar9 & 0xff;
          goto LAB_1401128d7;
        }
      }
      uVar4 = (int)uVar9 + 0x1010101;
      local_288._0_1_ = (byte)uVar4;
      local_288._1_1_ = (byte)(uVar4 >> 8);
      local_288._2_1_ = (byte)(uVar4 >> 0x10);
      local_288._3_1_ = (byte)(uVar4 >> 0x18);
      if (uVar2 == 0) {
        uVar11 = (ulonglong)((&DAT_140309750)[(byte)local_288] ^ local_23c);
        local_288._1_1_ = (&DAT_140309650)[local_288._1_1_] ^ local_23b;
        local_288._2_1_ = (&DAT_140309650)[local_288._2_1_] ^ local_23a;
        local_288._3_1_ = (&DAT_140309750)[local_288._3_1_] ^ local_239;
LAB_140112a4d:
        local_288._0_1_ = (&DAT_140309750)[uVar11] ^ local_240;
        local_288._1_1_ = (&DAT_140309750)[local_288._1_1_] ^ local_23f;
        local_288._2_1_ = (&DAT_140309650)[local_288._2_1_] ^ local_23e;
        local_288._3_1_ = (&DAT_140309650)[local_288._3_1_] ^ local_23d;
LAB_140112a87:
        uVar16 = (&DAT_140317fb0)
                 [(&DAT_140309750)[(&DAT_140309750)[local_288._3_1_] ^ bStack_241] ^ local_248[3]] ^
                 (&DAT_140317bb0)
                 [(&DAT_140309750)[(&DAT_140309650)[local_288._2_1_] ^ bStack_242] ^ local_248[2]] ^
                 (&DAT_1403177b0)
                 [(&DAT_140309650)[(&DAT_140309750)[local_288._1_1_] ^ bStack_243] ^ local_248[1]] ^
                 (&DAT_1403173b0)
                 [(&DAT_140309650)[(&DAT_140309650)[(byte)local_288] ^ local_244] ^ local_248[0]];
      }
      else {
        if (uVar2 == 2) goto LAB_140112a87;
        if (uVar2 == 3) {
          uVar11 = (ulonglong)(uVar4 & 0xff);
          goto LAB_140112a4d;
        }
      }
      uVar16 = uVar16 << 8 | uVar16 >> 0x18;
      uVar9 = (ulonglong)((int)uVar9 + 0x2020202);
      uVar17 = (int)uVar5 + uVar16 * 2;
      uVar11 = (ulonglong)uVar17;
      puVar10[-1] = uVar16 + (int)uVar5;
      uVar6 = uVar6 - 1;
      *puVar10 = uVar17 * 0x200 | uVar17 >> 0x17;
      puVar10 = puVar10 + 2;
    } while (uVar6 != 0);
    local_280 = 0;
    param_1 = local_270;
    local_288 = uVar4;
  }
  puVar14 = &DAT_140309650;
  if (local_284 == 0x80) {
    FUN_140112420(local_238,&DAT_140309650,local_264);
    uVar9 = uVar7;
    pcVar15 = param_1 + 0xe8;
    do {
      uVar5 = uVar9 + 2;
      *(undefined4 *)(pcVar15 + -8) = (&DAT_1403173b0)[puVar14[local_238[uVar9]] ^ local_268[0]];
      *(undefined4 *)pcVar15 = (&DAT_1403173b0)[puVar14[local_238[uVar9 + 1]] ^ local_268[0]];
      uVar9 = uVar5;
      pcVar15 = pcVar15 + 0x10;
    } while ((longlong)uVar5 < 0x100);
    FUN_140112420(local_238,&DAT_140309750,local_263);
    uVar9 = uVar7;
    pcVar15 = param_1 + 0xec;
    do {
      uVar5 = uVar9 + 2;
      *(undefined4 *)(pcVar15 + -8) = (&DAT_1403177b0)[puVar14[local_238[uVar9]] ^ local_268[1]];
      *(undefined4 *)pcVar15 = (&DAT_1403177b0)[puVar14[local_238[uVar9 + 1]] ^ local_268[1]];
      uVar9 = uVar5;
      pcVar15 = pcVar15 + 0x10;
    } while ((longlong)uVar5 < 0x100);
    FUN_140112420(local_238,puVar14,local_262);
    uVar9 = uVar7;
    pcVar15 = param_1 + 0x8e8;
    do {
      uVar5 = uVar9 + 2;
      *(undefined4 *)(pcVar15 + -8) =
           (&DAT_140317bb0)[puVar14[(ulonglong)local_238[uVar9] + 0x100] ^ local_268[2]];
      *(undefined4 *)pcVar15 =
           (&DAT_140317bb0)[puVar14[(ulonglong)local_238[uVar9 + 1] + 0x100] ^ local_268[2]];
      uVar9 = uVar5;
      pcVar15 = pcVar15 + 0x10;
    } while ((longlong)uVar5 < 0x100);
    FUN_140112420(local_238,&DAT_140309750,local_261);
    pcVar15 = param_1 + 0x8ec;
    do {
      uVar9 = uVar7 + 2;
      *(undefined4 *)(pcVar15 + -8) =
           (&DAT_140317fb0)[puVar14[(ulonglong)local_238[uVar7] + 0x100] ^ local_268[3]];
      *(undefined4 *)pcVar15 =
           (&DAT_140317fb0)[puVar14[(ulonglong)local_238[uVar7 + 1] + 0x100] ^ local_268[3]];
      pcVar15 = pcVar15 + 0x10;
      uVar7 = uVar9;
    } while ((longlong)uVar9 < 0x100);
  }
  else if (local_284 == 0xc0) {
    FUN_140112420(local_238,&DAT_140309750,local_260);
    uVar9 = uVar7;
    pcVar15 = param_1 + 0xe8;
    do {
      uVar5 = uVar9 + 2;
      *(undefined4 *)(pcVar15 + -8) =
           (&DAT_1403173b0)[puVar14[puVar14[local_238[uVar9]] ^ local_264] ^ local_268[0]];
      *(undefined4 *)pcVar15 =
           (&DAT_1403173b0)[puVar14[puVar14[local_238[uVar9 + 1]] ^ local_264] ^ local_268[0]];
      uVar9 = uVar5;
      pcVar15 = pcVar15 + 0x10;
    } while ((longlong)uVar5 < 0x100);
    FUN_140112420(local_238,&DAT_140309750,local_25f);
    uVar9 = uVar7;
    pcVar15 = param_1 + 0xec;
    do {
      uVar5 = uVar9 + 2;
      *(undefined4 *)(pcVar15 + -8) =
           (&DAT_1403177b0)
           [puVar14[puVar14[(ulonglong)local_238[uVar9] + 0x100] ^ local_263] ^ local_268[1]];
      *(undefined4 *)pcVar15 =
           (&DAT_1403177b0)
           [puVar14[puVar14[(ulonglong)local_238[uVar9 + 1] + 0x100] ^ local_263] ^ local_268[1]];
      uVar9 = uVar5;
      pcVar15 = pcVar15 + 0x10;
    } while ((longlong)uVar5 < 0x100);
    FUN_140112420(local_238,puVar14,local_25e);
    uVar9 = uVar7;
    pcVar15 = param_1 + 0x8e8;
    do {
      uVar5 = uVar9 + 2;
      *(undefined4 *)(pcVar15 + -8) =
           (&DAT_140317bb0)
           [puVar14[(ulonglong)(puVar14[local_238[uVar9]] ^ local_262) + 0x100] ^ local_268[2]];
      *(undefined4 *)pcVar15 =
           (&DAT_140317bb0)
           [puVar14[(ulonglong)(puVar14[local_238[uVar9 + 1]] ^ local_262) + 0x100] ^ local_268[2]];
      uVar9 = uVar5;
      pcVar15 = pcVar15 + 0x10;
    } while ((longlong)uVar5 < 0x100);
    FUN_140112420(local_238,puVar14,local_25d);
    pcVar15 = param_1 + 0x8ec;
    do {
      uVar9 = uVar7 + 2;
      *(undefined4 *)(pcVar15 + -8) =
           (&DAT_140317fb0)
           [puVar14[(ulonglong)(puVar14[(ulonglong)local_238[uVar7] + 0x100] ^ local_261) + 0x100] ^
            local_268[3]];
      *(undefined4 *)pcVar15 =
           (&DAT_140317fb0)
           [puVar14[(ulonglong)(puVar14[(ulonglong)local_238[uVar7 + 1] + 0x100] ^ local_261) +
                    0x100] ^ local_268[3]];
      pcVar15 = pcVar15 + 0x10;
      uVar7 = uVar9;
    } while ((longlong)uVar9 < 0x100);
  }
  else if (local_284 == 0x100) {
    FUN_140112420(local_238 + 0x100,&DAT_140309750,local_25c);
    uVar9 = uVar7;
    do {
      uVar5 = uVar9 + 2;
      local_238[uVar9] = puVar14[(ulonglong)local_238[uVar9 + 0x100] + 0x100];
      local_238[uVar9 + 1] = puVar14[(ulonglong)local_238[uVar9 + 0x101] + 0x100];
      uVar9 = uVar5;
    } while ((longlong)uVar5 < 0x100);
    FUN_140112420(local_238,local_238,local_260);
    uVar9 = uVar7;
    pcVar15 = param_1 + 0xe8;
    do {
      uVar5 = uVar9 + 2;
      *(undefined4 *)(pcVar15 + -8) =
           (&DAT_1403173b0)[puVar14[puVar14[local_238[uVar9]] ^ local_264] ^ local_268[0]];
      *(undefined4 *)pcVar15 =
           (&DAT_1403173b0)[puVar14[puVar14[local_238[uVar9 + 1]] ^ local_264] ^ local_268[0]];
      uVar9 = uVar5;
      pcVar15 = pcVar15 + 0x10;
    } while ((longlong)uVar5 < 0x100);
    FUN_140112420(local_238 + 0x100,puVar14,local_25b);
    uVar9 = uVar7;
    do {
      uVar5 = uVar9 + 2;
      local_238[uVar9] = puVar14[(ulonglong)local_238[uVar9 + 0x100] + 0x100];
      local_238[uVar9 + 1] = puVar14[(ulonglong)local_238[uVar9 + 0x101] + 0x100];
      uVar9 = uVar5;
    } while ((longlong)uVar5 < 0x100);
    FUN_140112420(local_238,local_238,local_25f);
    uVar9 = uVar7;
    pcVar15 = param_1 + 0xec;
    do {
      uVar5 = uVar9 + 2;
      *(undefined4 *)(pcVar15 + -8) =
           (&DAT_1403177b0)
           [puVar14[puVar14[(ulonglong)local_238[uVar9] + 0x100] ^ local_263] ^ local_268[1]];
      *(undefined4 *)pcVar15 =
           (&DAT_1403177b0)
           [puVar14[puVar14[(ulonglong)local_238[uVar9 + 1] + 0x100] ^ local_263] ^ local_268[1]];
      uVar9 = uVar5;
      pcVar15 = pcVar15 + 0x10;
    } while ((longlong)uVar5 < 0x100);
    FUN_140112420(local_238 + 0x100,puVar14,local_25a);
    uVar9 = uVar7;
    do {
      uVar5 = uVar9 + 2;
      local_238[uVar9] = puVar14[local_238[uVar9 + 0x100]];
      local_238[uVar9 + 1] = puVar14[local_238[uVar9 + 0x101]];
      uVar9 = uVar5;
    } while ((longlong)uVar5 < 0x100);
    FUN_140112420(local_238,local_238,local_25e);
    uVar9 = uVar7;
    pcVar15 = param_1 + 0x8e8;
    do {
      uVar5 = uVar9 + 2;
      *(undefined4 *)(pcVar15 + -8) =
           (&DAT_140317bb0)
           [puVar14[(ulonglong)(puVar14[local_238[uVar9]] ^ local_262) + 0x100] ^ local_268[2]];
      *(undefined4 *)pcVar15 =
           (&DAT_140317bb0)
           [puVar14[(ulonglong)(puVar14[local_238[uVar9 + 1]] ^ local_262) + 0x100] ^ local_268[2]];
      uVar9 = uVar5;
      pcVar15 = pcVar15 + 0x10;
    } while ((longlong)uVar5 < 0x100);
    FUN_140112420(local_238 + 0x100,&DAT_140309750,local_259);
    uVar9 = uVar7;
    do {
      uVar5 = uVar9 + 2;
      local_238[uVar9] = puVar14[local_238[uVar9 + 0x100]];
      local_238[uVar9 + 1] = puVar14[local_238[uVar9 + 0x101]];
      uVar9 = uVar5;
    } while ((longlong)uVar5 < 0x100);
    FUN_140112420(local_238,local_238,local_25d);
    pcVar15 = param_1 + 0x8ec;
    do {
      uVar9 = uVar7 + 2;
      *(undefined4 *)(pcVar15 + -8) =
           (&DAT_140317fb0)
           [puVar14[(ulonglong)(puVar14[(ulonglong)local_238[uVar7] + 0x100] ^ local_261) + 0x100] ^
            local_268[3]];
      *(undefined4 *)pcVar15 =
           (&DAT_140317fb0)
           [puVar14[(ulonglong)(puVar14[(ulonglong)local_238[uVar7 + 1] + 0x100] ^ local_261) +
                    0x100] ^ local_268[3]];
      pcVar15 = pcVar15 + 0x10;
      uVar7 = uVar9;
    } while ((longlong)uVar9 < 0x100);
  }
  if (*param_1 == '\0') {
    pcVar15 = param_1 + 0x60;
    pcVar12 = param_1 + (longlong)(*(int *)(param_1 + 0xc) * 2) * 4 + 0x58;
    if (pcVar15 < pcVar12) {
      do {
        uVar3 = *(undefined4 *)pcVar15;
        uVar1 = *(undefined4 *)(pcVar15 + 4);
        *(undefined4 *)pcVar15 = *(undefined4 *)pcVar12;
        pcVar13 = pcVar12 + -8;
        *(undefined4 *)(pcVar15 + 4) = *(undefined4 *)(pcVar12 + 4);
        *(undefined4 *)pcVar12 = uVar3;
        *(undefined4 *)(pcVar12 + 4) = uVar1;
        pcVar15 = pcVar15 + 8;
        pcVar12 = pcVar13;
      } while (pcVar15 < pcVar13);
    }
    *param_1 = '\0';
  }
  return 1;
}



void FUN_140113320(undefined1 *param_1,undefined1 param_2,int param_3)

{
  *param_1 = param_2;
  *(uint *)(param_1 + 4) = param_3 + 0x3fU & 0xffffffc0;
  *(undefined4 *)(param_1 + 0xc) =
       *(undefined4 *)
        (&DAT_140248a30 + (longlong)((int)(param_3 + -1 + (param_3 + -1 >> 0x1f & 0x3fU)) >> 6) * 4)
  ;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x28) = 0;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_140113360(char *param_1,int param_2,uint *param_3,longlong param_4,int param_5,
                 longlong param_6)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  uint uVar4;
  uint uVar5;
  uint *puVar6;
  uint uVar7;
  char *pcVar8;
  char *pcVar9;
  uint uVar10;
  char *pcVar11;
  uint uVar12;
  uint uVar13;
  uint uVar14;
  uint *puVar15;
  ulonglong uVar16;
  undefined1 auStack_128 [48];
  int local_f8;
  uint local_e8;
  uint local_e4;
  uint local_e0;
  uint local_dc;
  uint local_d8;
  uint local_d4;
  uint local_d0;
  uint local_cc;
  int local_c8;
  int local_c4;
  int local_c0;
  int local_bc;
  int local_b8;
  int local_b4;
  int local_b0;
  int local_ac;
  int local_a8;
  int local_a4;
  int local_a0;
  int local_9c;
  int local_98;
  int local_94;
  int local_90;
  int local_8c;
  int local_88;
  int local_84;
  int local_80;
  int local_7c;
  int local_78;
  int local_74;
  int local_70;
  int local_6c;
  int local_68;
  int local_64;
  int local_60;
  int local_5c;
  int local_58;
  int local_54;
  int local_50;
  int local_4c;
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_128;
  iVar1 = *(int *)(param_1 + 0xc);
  if (*param_1 != '\0') {
    pcVar11 = param_1 + 0x60;
    pcVar8 = param_1 + (longlong)(iVar1 * 2) * 4 + 0x58;
    if (pcVar11 < param_1 + (longlong)(iVar1 * 2) * 4 + 0x58) {
      do {
        uVar2 = *(undefined4 *)pcVar11;
        uVar3 = *(undefined4 *)(pcVar11 + 4);
        *(undefined4 *)pcVar11 = *(undefined4 *)pcVar8;
        pcVar9 = pcVar8 + -8;
        *(undefined4 *)(pcVar11 + 4) = *(undefined4 *)(pcVar8 + 4);
        *(undefined4 *)pcVar8 = uVar2;
        *(undefined4 *)(pcVar8 + 4) = uVar3;
        pcVar11 = pcVar11 + 8;
        pcVar8 = pcVar9;
      } while (pcVar11 < pcVar9);
    }
    *param_1 = '\0';
  }
  local_f8 = param_2;
  memcpy(&local_e8,param_1 + 0x40,(longlong)(iVar1 * 2 + 8) << 2);
  if (0 < param_5) {
    puVar15 = (uint *)(param_4 + 8);
    puVar6 = (uint *)(param_6 + 8);
    uVar16 = (ulonglong)((param_5 - 1U >> 7) + 1);
    do {
      uVar5 = puVar15[-2] ^ *param_3 ^ local_e8;
      uVar13 = puVar15[-1] ^ param_3[1] ^ local_e4;
      uVar10 = puVar15[1] ^ param_3[3] ^ local_dc;
      uVar7 = *(uint *)(param_1 + (ulonglong)(uVar5 >> 0x10 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar5 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar5 >> 8 & 0xff) * 8 + 0xe4) ^
              *(uint *)(param_1 + (ulonglong)(uVar5 & 0xff) * 8 + 0xe0);
      uVar4 = *(uint *)(param_1 + (ulonglong)(uVar13 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 & 0xff) * 8 + 0xe4);
      uVar12 = *puVar15 ^ param_3[2] ^ local_e0 ^ local_50 + uVar4 + uVar7;
      uVar10 = (uVar10 << 1 | (uint)((int)uVar10 < 0)) ^ local_4c + uVar4 * 2 + uVar7;
      uVar4 = uVar12 >> 1;
      uVar12 = uVar4 | (uint)((uVar12 & 1) != 0) << 0x1f;
      uVar7 = *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff0000) >> 0x10) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar12 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff00) >> 8) * 8 + 0xe4) ^
              *(uint *)(param_1 + (ulonglong)(uVar4 & 0xff) * 8 + 0xe0);
      uVar4 = *(uint *)(param_1 + (ulonglong)(uVar10 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 & 0xff) * 8 + 0xe4);
      uVar5 = uVar5 ^ local_58 + uVar4 + uVar7;
      uVar13 = (uVar13 << 1 | (uint)((int)uVar13 < 0)) ^ local_54 + uVar4 * 2 + uVar7;
      uVar4 = uVar5 >> 1;
      uVar5 = uVar4 | (uint)((uVar5 & 1) != 0) << 0x1f;
      uVar7 = *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff0000) >> 0x10) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar5 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff00) >> 8) * 8 + 0xe4) ^
              *(uint *)(param_1 + (ulonglong)(uVar4 & 0xff) * 8 + 0xe0);
      uVar4 = *(uint *)(param_1 + (ulonglong)(uVar13 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 & 0xff) * 8 + 0xe4);
      uVar12 = uVar12 ^ local_60 + uVar4 + uVar7;
      uVar10 = (uVar10 << 1 | (uint)((int)uVar10 < 0)) ^ local_5c + uVar4 * 2 + uVar7;
      uVar4 = uVar12 >> 1;
      uVar12 = uVar4 | (uint)((uVar12 & 1) != 0) << 0x1f;
      uVar7 = *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff0000) >> 0x10) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar12 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff00) >> 8) * 8 + 0xe4) ^
              *(uint *)(param_1 + (ulonglong)(uVar4 & 0xff) * 8 + 0xe0);
      uVar4 = *(uint *)(param_1 + (ulonglong)(uVar10 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 & 0xff) * 8 + 0xe4);
      uVar5 = uVar5 ^ local_68 + uVar4 + uVar7;
      uVar13 = (uVar13 << 1 | (uint)((int)uVar13 < 0)) ^ local_64 + uVar4 * 2 + uVar7;
      uVar4 = uVar5 >> 1;
      uVar5 = uVar4 | (uint)((uVar5 & 1) != 0) << 0x1f;
      uVar7 = *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff0000) >> 0x10) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar5 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff00) >> 8) * 8 + 0xe4) ^
              *(uint *)(param_1 + (ulonglong)(uVar4 & 0xff) * 8 + 0xe0);
      uVar4 = *(uint *)(param_1 + (ulonglong)(uVar13 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 & 0xff) * 8 + 0xe4);
      uVar12 = uVar12 ^ local_70 + uVar4 + uVar7;
      uVar10 = (uVar10 << 1 | (uint)((int)uVar10 < 0)) ^ local_6c + uVar4 * 2 + uVar7;
      uVar4 = uVar12 >> 1;
      uVar12 = uVar4 | (uint)((uVar12 & 1) != 0) << 0x1f;
      uVar7 = *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff0000) >> 0x10) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar12 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff00) >> 8) * 8 + 0xe4) ^
              *(uint *)(param_1 + (ulonglong)(uVar4 & 0xff) * 8 + 0xe0);
      uVar4 = *(uint *)(param_1 + (ulonglong)(uVar10 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 & 0xff) * 8 + 0xe4);
      uVar5 = uVar5 ^ local_78 + uVar4 + uVar7;
      uVar13 = (uVar13 << 1 | (uint)((int)uVar13 < 0)) ^ local_74 + uVar4 * 2 + uVar7;
      uVar4 = uVar5 >> 1;
      uVar5 = uVar4 | (uint)((uVar5 & 1) != 0) << 0x1f;
      uVar7 = *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff0000) >> 0x10) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar5 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff00) >> 8) * 8 + 0xe4) ^
              *(uint *)(param_1 + (ulonglong)(uVar4 & 0xff) * 8 + 0xe0);
      uVar4 = *(uint *)(param_1 + (ulonglong)(uVar13 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 & 0xff) * 8 + 0xe4);
      uVar12 = uVar12 ^ local_80 + uVar4 + uVar7;
      uVar10 = (uVar10 << 1 | (uint)((int)uVar10 < 0)) ^ local_7c + uVar4 * 2 + uVar7;
      uVar4 = uVar12 >> 1;
      uVar12 = uVar4 | (uint)((uVar12 & 1) != 0) << 0x1f;
      uVar7 = *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff0000) >> 0x10) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar12 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff00) >> 8) * 8 + 0xe4) ^
              *(uint *)(param_1 + (ulonglong)(uVar4 & 0xff) * 8 + 0xe0);
      uVar4 = *(uint *)(param_1 + (ulonglong)(uVar10 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 & 0xff) * 8 + 0xe4);
      uVar5 = uVar5 ^ local_88 + uVar4 + uVar7;
      uVar13 = (uVar13 << 1 | (uint)((int)uVar13 < 0)) ^ local_84 + uVar4 * 2 + uVar7;
      uVar4 = uVar5 >> 1;
      uVar5 = uVar4 | (uint)((uVar5 & 1) != 0) << 0x1f;
      uVar7 = *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff0000) >> 0x10) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar5 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff00) >> 8) * 8 + 0xe4) ^
              *(uint *)(param_1 + (ulonglong)(uVar4 & 0xff) * 8 + 0xe0);
      uVar4 = *(uint *)(param_1 + (ulonglong)(uVar13 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 & 0xff) * 8 + 0xe4);
      uVar12 = uVar12 ^ local_90 + uVar4 + uVar7;
      uVar10 = (uVar10 << 1 | (uint)((int)uVar10 < 0)) ^ local_8c + uVar4 * 2 + uVar7;
      uVar4 = uVar12 >> 1;
      uVar12 = uVar4 | (uint)((uVar12 & 1) != 0) << 0x1f;
      uVar7 = *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff0000) >> 0x10) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar12 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff00) >> 8) * 8 + 0xe4) ^
              *(uint *)(param_1 + (ulonglong)(uVar4 & 0xff) * 8 + 0xe0);
      uVar4 = *(uint *)(param_1 + (ulonglong)(uVar10 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 & 0xff) * 8 + 0xe4);
      uVar5 = uVar5 ^ local_98 + uVar4 + uVar7;
      uVar13 = (uVar13 << 1 | (uint)((int)uVar13 < 0)) ^ local_94 + uVar4 * 2 + uVar7;
      uVar4 = uVar5 >> 1;
      uVar5 = uVar4 | (uint)((uVar5 & 1) != 0) << 0x1f;
      uVar7 = *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff0000) >> 0x10) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar5 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff00) >> 8) * 8 + 0xe4) ^
              *(uint *)(param_1 + (ulonglong)(uVar4 & 0xff) * 8 + 0xe0);
      uVar4 = *(uint *)(param_1 + (ulonglong)(uVar13 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 & 0xff) * 8 + 0xe4);
      uVar12 = uVar12 ^ local_a0 + uVar4 + uVar7;
      uVar10 = (uVar10 << 1 | (uint)((int)uVar10 < 0)) ^ local_9c + uVar4 * 2 + uVar7;
      uVar4 = uVar12 >> 1;
      uVar12 = uVar4 | (uint)((uVar12 & 1) != 0) << 0x1f;
      uVar7 = *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff0000) >> 0x10) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar12 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff00) >> 8) * 8 + 0xe4) ^
              *(uint *)(param_1 + (ulonglong)(uVar4 & 0xff) * 8 + 0xe0);
      uVar4 = *(uint *)(param_1 + (ulonglong)(uVar10 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 & 0xff) * 8 + 0xe4);
      uVar5 = uVar5 ^ local_a8 + uVar4 + uVar7;
      uVar14 = (uVar13 << 1 | (uint)((int)uVar13 < 0)) ^ local_a4 + uVar4 * 2 + uVar7;
      uVar4 = uVar5 >> 1;
      uVar5 = uVar4 | (uint)((uVar5 & 1) != 0) << 0x1f;
      uVar7 = *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff0000) >> 0x10) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar5 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff00) >> 8) * 8 + 0xe4) ^
              *(uint *)(param_1 + (ulonglong)(uVar4 & 0xff) * 8 + 0xe0);
      uVar4 = *(uint *)(param_1 + (ulonglong)(uVar14 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar14 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(param_1 + (ulonglong)(uVar14 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar14 & 0xff) * 8 + 0xe4);
      uVar12 = uVar12 ^ local_b0 + uVar4 + uVar7;
      uVar10 = (uVar10 << 1 | (uint)((int)uVar10 < 0)) ^ local_ac + uVar4 * 2 + uVar7;
      uVar4 = uVar12 >> 1;
      uVar13 = uVar4 | (uint)((uVar12 & 1) != 0) << 0x1f;
      uVar7 = *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff0000) >> 0x10) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar13 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff00) >> 8) * 8 + 0xe4) ^
              *(uint *)(param_1 + (ulonglong)(uVar4 & 0xff) * 8 + 0xe0);
      uVar4 = *(uint *)(param_1 + (ulonglong)(uVar10 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar10 & 0xff) * 8 + 0xe4);
      uVar5 = uVar5 ^ local_b8 + uVar4 + uVar7;
      uVar14 = (uVar14 << 1 | (uint)((int)uVar14 < 0)) ^ local_b4 + uVar4 * 2 + uVar7;
      uVar4 = uVar5 >> 1;
      uVar7 = uVar4 | (uint)((uVar5 & 1) != 0) << 0x1f;
      uVar5 = *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff0000) >> 0x10) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar7 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff00) >> 8) * 8 + 0xe4) ^
              *(uint *)(param_1 + (ulonglong)(uVar4 & 0xff) * 8 + 0xe0);
      uVar4 = *(uint *)(param_1 + (ulonglong)(uVar14 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar14 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(param_1 + (ulonglong)(uVar14 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar14 & 0xff) * 8 + 0xe4);
      uVar13 = uVar13 ^ local_c0 + uVar4 + uVar5;
      uVar12 = (uVar10 << 1 | (uint)((int)uVar10 < 0)) ^ local_bc + uVar4 * 2 + uVar5;
      uVar4 = uVar13 >> 1;
      uVar5 = uVar4 | (uint)((uVar13 & 1) != 0) << 0x1f;
      uVar10 = *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff0000) >> 0x10) * 8 + 0x8e0) ^
               *(uint *)(param_1 + (ulonglong)(uVar5 >> 0x18) * 8 + 0x8e4) ^
               *(uint *)(param_1 + (ulonglong)((uVar4 & 0xff00) >> 8) * 8 + 0xe4) ^
               *(uint *)(param_1 + (ulonglong)(uVar4 & 0xff) * 8 + 0xe0);
      uVar4 = *(uint *)(param_1 + (ulonglong)(uVar12 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(param_1 + (ulonglong)(uVar12 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(param_1 + (ulonglong)(uVar12 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(param_1 + (ulonglong)(uVar12 & 0xff) * 8 + 0xe4);
      uVar7 = uVar7 ^ local_c8 + uVar4 + uVar10;
      uVar5 = local_d8 ^ uVar5;
      *(uint *)((param_6 - param_4) + -8 + (longlong)puVar15) = uVar5;
      puVar6[-1] = local_d4 ^ uVar12;
      *puVar6 = local_d0 ^ (uVar7 >> 1 | (uint)((uVar7 & 1) != 0) << 0x1f);
      puVar6[1] = local_cc ^ (uVar14 << 1 | (uint)((int)uVar14 < 0)) ^ local_c4 + uVar4 * 2 + uVar10
      ;
      if (local_f8 == 2) {
        *param_3 = uVar5;
        param_3[1] = puVar6[-1];
        param_3[2] = *puVar6;
        param_3[3] = puVar6[1];
      }
      puVar15 = puVar15 + 4;
      puVar6 = puVar6 + 4;
      uVar16 = uVar16 - 1;
    } while (uVar16 != 0);
  }
  return param_5;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_140113f20(char *param_1,int param_2,uint *param_3,longlong param_4,int param_5,
                 longlong param_6)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  uint uVar4;
  uint uVar5;
  uint *puVar6;
  uint *puVar7;
  uint uVar8;
  char *pcVar9;
  char *pcVar10;
  char *pcVar11;
  uint uVar12;
  uint uVar13;
  uint uVar14;
  uint uVar15;
  uint uVar16;
  ulonglong uVar17;
  undefined1 auStack_138 [48];
  char *local_108;
  int local_fc;
  uint local_e8;
  uint local_e4;
  uint local_e0;
  uint local_dc;
  uint local_d8;
  uint local_d4;
  uint local_d0;
  uint local_cc;
  int local_c8;
  int local_c4;
  int local_c0;
  int local_bc;
  int local_b8;
  int local_b4;
  int local_b0;
  int local_ac;
  int local_a8;
  int local_a4;
  int local_a0;
  int local_9c;
  int local_98;
  int local_94;
  int local_90;
  int local_8c;
  int local_88;
  int local_84;
  int local_80;
  int local_7c;
  int local_78;
  int local_74;
  int local_70;
  int local_6c;
  int local_68;
  int local_64;
  int local_60;
  int local_5c;
  int local_58;
  int local_54;
  int local_50;
  int local_4c;
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_138;
  iVar1 = *(int *)(param_1 + 0xc);
  if (*param_1 != '\x01') {
    pcVar11 = param_1 + 0x60;
    pcVar9 = param_1 + (longlong)(iVar1 * 2) * 4 + 0x58;
    if (pcVar11 < pcVar9) {
      do {
        uVar2 = *(undefined4 *)pcVar11;
        uVar3 = *(undefined4 *)(pcVar11 + 4);
        *(undefined4 *)pcVar11 = *(undefined4 *)pcVar9;
        pcVar10 = pcVar9 + -8;
        *(undefined4 *)(pcVar11 + 4) = *(undefined4 *)(pcVar9 + 4);
        *(undefined4 *)pcVar9 = uVar2;
        *(undefined4 *)(pcVar9 + 4) = uVar3;
        pcVar11 = pcVar11 + 8;
        pcVar9 = pcVar10;
      } while (pcVar11 < pcVar10);
    }
    *param_1 = '\x01';
  }
  local_108 = param_1;
  local_fc = param_2;
  memcpy(&local_e8,param_1 + 0x40,(longlong)(iVar1 * 2 + 8) << 2);
  if (0 < param_5) {
    puVar7 = (uint *)(param_4 + 8);
    uVar17 = (ulonglong)((param_5 - 1U >> 7) + 1);
    puVar6 = (uint *)(param_6 + 8);
    do {
      uVar4 = *(uint *)((param_4 - param_6) + -8 + (longlong)puVar6);
      uVar13 = puVar7[-1] ^ local_d4;
      uVar15 = uVar4 ^ local_d8;
      uVar8 = *(uint *)(local_108 + (ulonglong)(uVar15 >> 0x10 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 >> 8 & 0xff) * 8 + 0xe4) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 & 0xff) * 8 + 0xe0);
      uVar5 = *(uint *)(local_108 + (ulonglong)(uVar13 >> 8 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar13 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(local_108 + (ulonglong)(uVar13 >> 0x10 & 0xff) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar13 & 0xff) * 8 + 0xe4);
      uVar14 = ((local_d0 ^ *puVar7) << 1 | (uint)((int)(local_d0 ^ *puVar7) < 0)) ^
               local_50 + uVar5 + uVar8;
      uVar8 = local_4c + uVar5 * 2 + uVar8 ^ puVar7[1] ^ local_cc;
      uVar5 = uVar8 >> 1;
      uVar12 = uVar5 | (uint)((uVar8 & 1) != 0) << 0x1f;
      uVar8 = *(uint *)(local_108 + (ulonglong)(uVar14 >> 0x10 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar14 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar14 >> 8 & 0xff) * 8 + 0xe4) ^
              *(uint *)(local_108 + (ulonglong)(uVar14 & 0xff) * 8 + 0xe0);
      uVar5 = *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff00) >> 8) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar12 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff0000) >> 0x10) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar5 & 0xff) * 8 + 0xe4);
      uVar16 = (uVar15 << 1 | (uint)((int)uVar15 < 0)) ^ local_58 + uVar5 + uVar8;
      uVar13 = local_54 + uVar5 * 2 + uVar8 ^ uVar13;
      uVar5 = uVar13 >> 1;
      uVar13 = uVar5 | (uint)((uVar13 & 1) != 0) << 0x1f;
      uVar8 = *(uint *)(local_108 + (ulonglong)(uVar16 >> 0x10 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 >> 8 & 0xff) * 8 + 0xe4) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 & 0xff) * 8 + 0xe0);
      uVar5 = *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff00) >> 8) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar13 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff0000) >> 0x10) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar5 & 0xff) * 8 + 0xe4);
      uVar15 = (uVar14 << 1 | (uint)((int)uVar14 < 0)) ^ local_60 + uVar5 + uVar8;
      uVar12 = local_5c + uVar5 * 2 + uVar8 ^ uVar12;
      uVar5 = uVar12 >> 1;
      uVar12 = uVar5 | (uint)((uVar12 & 1) != 0) << 0x1f;
      uVar8 = *(uint *)(local_108 + (ulonglong)(uVar15 >> 0x10 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 >> 8 & 0xff) * 8 + 0xe4) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 & 0xff) * 8 + 0xe0);
      uVar5 = *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff00) >> 8) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar12 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff0000) >> 0x10) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar5 & 0xff) * 8 + 0xe4);
      uVar16 = (uVar16 << 1 | (uint)((int)uVar16 < 0)) ^ local_68 + uVar5 + uVar8;
      uVar13 = local_64 + uVar5 * 2 + uVar8 ^ uVar13;
      uVar5 = uVar13 >> 1;
      uVar14 = uVar5 | (uint)((uVar13 & 1) != 0) << 0x1f;
      uVar8 = *(uint *)(local_108 + (ulonglong)(uVar16 >> 0x10 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 >> 8 & 0xff) * 8 + 0xe4) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 & 0xff) * 8 + 0xe0);
      uVar5 = *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff00) >> 8) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar14 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff0000) >> 0x10) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar5 & 0xff) * 8 + 0xe4);
      uVar15 = (uVar15 << 1 | (uint)((int)uVar15 < 0)) ^ local_70 + uVar5 + uVar8;
      uVar12 = local_6c + uVar5 * 2 + uVar8 ^ uVar12;
      uVar5 = uVar12 >> 1;
      uVar13 = uVar5 | (uint)((uVar12 & 1) != 0) << 0x1f;
      uVar8 = *(uint *)(local_108 + (ulonglong)(uVar15 >> 0x10 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 >> 8 & 0xff) * 8 + 0xe4) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 & 0xff) * 8 + 0xe0);
      uVar5 = *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff00) >> 8) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar13 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff0000) >> 0x10) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar5 & 0xff) * 8 + 0xe4);
      uVar16 = (uVar16 << 1 | (uint)((int)uVar16 < 0)) ^ local_78 + uVar5 + uVar8;
      uVar14 = local_74 + uVar5 * 2 + uVar8 ^ uVar14;
      uVar5 = uVar14 >> 1;
      uVar12 = uVar5 | (uint)((uVar14 & 1) != 0) << 0x1f;
      uVar8 = *(uint *)(local_108 + (ulonglong)(uVar16 >> 0x10 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 >> 8 & 0xff) * 8 + 0xe4) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 & 0xff) * 8 + 0xe0);
      uVar5 = *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff00) >> 8) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar12 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff0000) >> 0x10) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar5 & 0xff) * 8 + 0xe4);
      uVar15 = (uVar15 << 1 | (uint)((int)uVar15 < 0)) ^ local_80 + uVar5 + uVar8;
      uVar13 = local_7c + uVar5 * 2 + uVar8 ^ uVar13;
      uVar5 = uVar13 >> 1;
      uVar14 = uVar5 | (uint)((uVar13 & 1) != 0) << 0x1f;
      uVar8 = *(uint *)(local_108 + (ulonglong)(uVar15 >> 0x10 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 >> 8 & 0xff) * 8 + 0xe4) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 & 0xff) * 8 + 0xe0);
      uVar5 = *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff00) >> 8) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar14 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff0000) >> 0x10) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar5 & 0xff) * 8 + 0xe4);
      uVar16 = (uVar16 << 1 | (uint)((int)uVar16 < 0)) ^ local_88 + uVar5 + uVar8;
      uVar12 = local_84 + uVar5 * 2 + uVar8 ^ uVar12;
      uVar5 = uVar12 >> 1;
      uVar13 = uVar5 | (uint)((uVar12 & 1) != 0) << 0x1f;
      uVar8 = *(uint *)(local_108 + (ulonglong)(uVar16 >> 0x10 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 >> 8 & 0xff) * 8 + 0xe4) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 & 0xff) * 8 + 0xe0);
      uVar5 = *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff00) >> 8) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar13 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff0000) >> 0x10) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar5 & 0xff) * 8 + 0xe4);
      uVar15 = (uVar15 << 1 | (uint)((int)uVar15 < 0)) ^ local_90 + uVar5 + uVar8;
      uVar14 = local_8c + uVar5 * 2 + uVar8 ^ uVar14;
      uVar5 = uVar14 >> 1;
      uVar12 = uVar5 | (uint)((uVar14 & 1) != 0) << 0x1f;
      uVar8 = *(uint *)(local_108 + (ulonglong)(uVar15 >> 0x10 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 >> 8 & 0xff) * 8 + 0xe4) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 & 0xff) * 8 + 0xe0);
      uVar5 = *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff00) >> 8) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar12 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff0000) >> 0x10) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar5 & 0xff) * 8 + 0xe4);
      uVar16 = (uVar16 << 1 | (uint)((int)uVar16 < 0)) ^ local_98 + uVar5 + uVar8;
      uVar13 = local_94 + uVar5 * 2 + uVar8 ^ uVar13;
      uVar5 = uVar13 >> 1;
      uVar14 = uVar5 | (uint)((uVar13 & 1) != 0) << 0x1f;
      uVar8 = *(uint *)(local_108 + (ulonglong)(uVar16 >> 0x10 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 >> 8 & 0xff) * 8 + 0xe4) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 & 0xff) * 8 + 0xe0);
      uVar5 = *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff00) >> 8) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar14 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff0000) >> 0x10) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar5 & 0xff) * 8 + 0xe4);
      uVar15 = (uVar15 << 1 | (uint)((int)uVar15 < 0)) ^ local_a0 + uVar5 + uVar8;
      uVar12 = local_9c + uVar5 * 2 + uVar8 ^ uVar12;
      uVar5 = uVar12 >> 1;
      uVar13 = uVar5 | (uint)((uVar12 & 1) != 0) << 0x1f;
      uVar8 = *(uint *)(local_108 + (ulonglong)(uVar15 >> 0x10 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 >> 8 & 0xff) * 8 + 0xe4) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 & 0xff) * 8 + 0xe0);
      uVar5 = *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff00) >> 8) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar13 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff0000) >> 0x10) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar5 & 0xff) * 8 + 0xe4);
      uVar16 = (uVar16 << 1 | (uint)((int)uVar16 < 0)) ^ local_a8 + uVar5 + uVar8;
      uVar14 = local_a4 + uVar5 * 2 + uVar8 ^ uVar14;
      uVar5 = uVar14 >> 1;
      uVar12 = uVar5 | (uint)((uVar14 & 1) != 0) << 0x1f;
      uVar8 = *(uint *)(local_108 + (ulonglong)(uVar16 >> 0x10 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 >> 8 & 0xff) * 8 + 0xe4) ^
              *(uint *)(local_108 + (ulonglong)(uVar16 & 0xff) * 8 + 0xe0);
      uVar5 = *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff00) >> 8) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar12 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff0000) >> 0x10) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar5 & 0xff) * 8 + 0xe4);
      uVar15 = (uVar15 << 1 | (uint)((int)uVar15 < 0)) ^ local_b0 + uVar5 + uVar8;
      uVar13 = local_ac + uVar5 * 2 + uVar8 ^ uVar13;
      uVar5 = uVar13 >> 1;
      uVar14 = uVar5 | (uint)((uVar13 & 1) != 0) << 0x1f;
      uVar8 = *(uint *)(local_108 + (ulonglong)(uVar15 >> 0x10 & 0xff) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 >> 0x18) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 >> 8 & 0xff) * 8 + 0xe4) ^
              *(uint *)(local_108 + (ulonglong)(uVar15 & 0xff) * 8 + 0xe0);
      uVar5 = *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff00) >> 8) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar14 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff0000) >> 0x10) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar5 & 0xff) * 8 + 0xe4);
      uVar16 = (uVar16 << 1 | (uint)((int)uVar16 < 0)) ^ local_b8 + uVar5 + uVar8;
      uVar12 = local_b4 + uVar5 * 2 + uVar8 ^ uVar12;
      uVar5 = uVar12 >> 1;
      uVar8 = uVar5 | (uint)((uVar12 & 1) != 0) << 0x1f;
      uVar13 = *(uint *)(local_108 + (ulonglong)(uVar16 >> 0x10 & 0xff) * 8 + 0x8e0) ^
               *(uint *)(local_108 + (ulonglong)(uVar16 >> 0x18) * 8 + 0x8e4) ^
               *(uint *)(local_108 + (ulonglong)(uVar16 >> 8 & 0xff) * 8 + 0xe4) ^
               *(uint *)(local_108 + (ulonglong)(uVar16 & 0xff) * 8 + 0xe0);
      uVar5 = *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff00) >> 8) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar8 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff0000) >> 0x10) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar5 & 0xff) * 8 + 0xe4);
      uVar15 = (uVar15 << 1 | (uint)((int)uVar15 < 0)) ^ local_c0 + uVar5 + uVar13;
      uVar14 = local_bc + uVar5 * 2 + uVar13 ^ uVar14;
      uVar5 = uVar14 >> 1;
      uVar12 = uVar5 | (uint)((uVar14 & 1) != 0) << 0x1f;
      uVar13 = *(uint *)(local_108 + (ulonglong)(uVar15 >> 0x10 & 0xff) * 8 + 0x8e0) ^
               *(uint *)(local_108 + (ulonglong)(uVar15 >> 0x18) * 8 + 0x8e4) ^
               *(uint *)(local_108 + (ulonglong)(uVar15 >> 8 & 0xff) * 8 + 0xe4) ^
               *(uint *)(local_108 + (ulonglong)(uVar15 & 0xff) * 8 + 0xe0);
      uVar5 = *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff00) >> 8) * 8 + 0x8e0) ^
              *(uint *)(local_108 + (ulonglong)(uVar12 >> 0x18) * 8 + 0xe0) ^
              *(uint *)(local_108 + (ulonglong)((uVar5 & 0xff0000) >> 0x10) * 8 + 0x8e4) ^
              *(uint *)(local_108 + (ulonglong)(uVar5 & 0xff) * 8 + 0xe4);
      uVar14 = (uVar16 << 1 | (uint)((int)uVar16 < 0)) ^ local_c8 + uVar5 + uVar13;
      uVar8 = local_c4 + uVar5 * 2 + uVar13 ^ uVar8;
      uVar5 = uVar8 >> 1 | (uint)((uVar8 & 1) != 0) << 0x1f;
      if (local_fc == 1) {
        puVar6[-2] = local_e8 ^ uVar15;
        puVar6[-1] = local_e4 ^ uVar12;
        *puVar6 = local_e0 ^ uVar14;
        puVar6[1] = local_dc ^ uVar5;
      }
      else {
        uVar8 = *param_3;
        *param_3 = uVar4;
        puVar6[-2] = uVar15 ^ local_e8 ^ uVar8;
        uVar4 = param_3[1];
        param_3[1] = puVar7[-1];
        puVar6[-1] = uVar12 ^ local_e4 ^ uVar4;
        uVar4 = param_3[2];
        param_3[2] = *puVar7;
        *puVar6 = uVar14 ^ local_e0 ^ uVar4;
        uVar4 = param_3[3];
        param_3[3] = puVar7[1];
        puVar6[1] = local_dc ^ uVar5 ^ uVar4;
      }
      puVar7 = puVar7 + 4;
      puVar6 = puVar6 + 4;
      uVar17 = uVar17 - 1;
    } while (uVar17 != 0);
  }
  return param_5;
}



undefined8 FUN_140114bc0(longlong param_1)

{
  undefined8 uVar1;
  
  if (*(longlong *)(param_1 + 0x28) == 0) {
    return 0;
  }
  uVar1 = FUN_1400d0aa0();
  return uVar1;
}



undefined8 * FUN_140114be0(undefined8 *param_1)

{
  FUN_1400d0eb0();
  *(undefined8 *)((longlong)param_1 + 0x14) = 0;
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  *(undefined4 *)((longlong)param_1 + 0x1c) = 0;
  *param_1 = Asn1::vftable;
  *(undefined2 *)(param_1 + 2) = 0x100;
  *(undefined1 *)((longlong)param_1 + 0x12) = 0;
  return param_1;
}



undefined1 FUN_140114c20(longlong param_1,longlong param_2)

{
  if (((*(char *)(param_1 + 0x11) == '\0') && (*(longlong *)(param_1 + 0x28) != 0)) &&
     (param_2 != 0)) {
    FUN_1400d0c90();
    return 1;
  }
  return 0;
}



void FUN_140114c50(longlong param_1)

{
  undefined8 *puVar1;
  
  puVar1 = *(undefined8 **)(param_1 + 0x20);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    *(undefined8 *)(param_1 + 0x20) = 0;
  }
  if (*(longlong *)(param_1 + 0x28) != 0) {
    FUN_1400d0d30();
    puVar1 = *(undefined8 **)(param_1 + 0x28);
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    *(undefined8 *)(param_1 + 0x28) = 0;
  }
  puVar1 = *(undefined8 **)(param_1 + 0x30);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    *(undefined8 *)(param_1 + 0x30) = 0;
  }
  *(undefined2 *)(param_1 + 0x10) = 0x100;
  *(undefined8 *)(param_1 + 0x14) = 0;
  *(undefined4 *)(param_1 + 0x1c) = 0;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_140114cd0(byte *param_1,uint param_2,undefined8 param_3,int param_4,char param_5,int *param_6,
             longlong param_7,longlong *param_8)

{
  byte bVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined8 uVar4;
  int iVar5;
  char *pcVar6;
  uint uVar7;
  size_t _Size;
  uint uVar8;
  ulonglong uVar9;
  int iVar10;
  bool bVar11;
  undefined1 auStack_e8 [32];
  char local_c8;
  uint *local_c0;
  longlong local_b8;
  longlong *local_b0;
  byte local_a8;
  char local_a7;
  longlong *local_a0;
  uint local_98;
  int local_94;
  uint local_90;
  void *local_88;
  longlong local_80;
  int local_78;
  int *local_70;
  uint local_68 [2];
  undefined8 local_60;
  uint local_58 [2];
  undefined8 local_50;
  char local_48 [32];
  ulonglong local_28;
  
  local_50 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_e8;
  local_70 = param_6;
  local_80 = param_7;
  local_a0 = param_8;
  *param_6 = 0;
  local_78 = param_4;
  local_60 = param_3;
  if (param_1 == (byte *)0x0) {
    lVar3 = *param_8;
    pcVar6 = "null reference passed to BER decoder";
  }
  else if (param_2 < 2) {
    lVar3 = *param_8;
    pcVar6 = "invalid length passed to BER decoder";
  }
  else {
    local_94 = 0;
    while( true ) {
      bVar1 = *param_1;
      if (local_80 != 0) {
        sprintf(local_48,"id[%x]\n");
        FUN_1400bc640(local_80);
      }
      plVar2 = local_a0;
      uVar8 = 0;
      if (bVar1 == 0) break;
      local_a8 = bVar1 >> 6;
      bVar11 = (bVar1 & 0x20) == 0;
      local_98 = (uint)bVar11;
      uVar7 = bVar1 & 0x1f;
      if (uVar7 == 0x1f) {
        param_1 = param_1 + 1;
        *local_70 = *local_70 + 1;
        iVar10 = *local_70;
        param_2 = param_2 - 1;
        local_90 = uVar7;
        if (param_2 == 0) {
          pcVar6 = "premature end of BER encoding (A)";
          goto LAB_1401152c1;
        }
        iVar5 = 0;
        bVar1 = *param_1;
        while ((char)bVar1 < '\0') {
          uVar8 = bVar1 & 0x7f | uVar8 << 7;
          param_1 = param_1 + 1;
          iVar10 = iVar10 + 1;
          *local_70 = iVar10;
          param_2 = param_2 - 1;
          if (param_2 == 0) {
            pcVar6 = "premature end of BER encoding (B)";
            goto LAB_1401152c1;
          }
          iVar5 = iVar5 + 1;
          if (3 < iVar5) {
            pcVar6 = "cannot parse BER tag > 4 octets";
            goto LAB_1401152c1;
          }
          bVar1 = *param_1;
        }
        uVar7 = *param_1 & 0x7f | uVar8 << 7;
      }
      _Size = 0;
      param_1 = param_1 + 1;
      *local_70 = *local_70 + 1;
      iVar10 = *local_70;
      iVar5 = param_2 - 1;
      local_90 = uVar7;
      if (iVar5 == 0) {
        pcVar6 = "premature end of BER encoding (C)";
        goto LAB_1401152c1;
      }
      local_a7 = '\0';
      bVar1 = *param_1;
      if (bVar1 == 0x80) {
        local_a7 = '\x01';
      }
      else if ((char)bVar1 < '\0') {
        if ((bVar1 & 0x7f) == 0) {
          pcVar6 = "Invalid length. Definite long-form is 0.";
          goto LAB_1401152c1;
        }
        if (4 < (bVar1 & 0x7f)) {
          (**(code **)(*local_a0 + 0x28))
                    (local_a0,"ASN.1 length cannot be more than 4 bytes in definite long-form.");
          (**(code **)(*plVar2 + 0x28))
                    (plVar2,
                     "This error typically occurs when trying to decode data that is not ASN.1");
          (**(code **)(*plVar2 + 0x28))
                    (plVar2,"A common cause is when decrypting ASN.1 data with an invalid password,"
                    );
          (**(code **)(*plVar2 + 0x28))
                    (plVar2,
                     "which results in garbage data. An attempt is made to decode the garbage bytes"
                    );
          (**(code **)(*plVar2 + 0x28))(plVar2,"as ASN.1, and this error occurs...");
          return 0;
        }
        uVar9 = _Size;
        if ((bVar1 & 0x7f) != 0) {
          do {
            param_1 = param_1 + 1;
            iVar10 = iVar10 + 1;
            *local_70 = iVar10;
            iVar5 = iVar5 + -1;
            if (iVar5 == 0) {
              pcVar6 = "premature end of BER encoding (D)";
              goto LAB_1401152c1;
            }
            _Size = (size_t)((int)_Size << 8 | (uint)*param_1);
            uVar8 = (int)uVar9 + 1;
            uVar9 = (ulonglong)uVar8;
          } while (uVar8 < (bVar1 & 0x7f));
        }
      }
      else {
        _Size = (size_t)bVar1;
      }
      uVar8 = (uint)_Size;
      if (local_80 != 0) {
        pcVar6 = "len=%d\n";
        if (!bVar11) {
          pcVar6 = "totalLen=%d\n";
        }
        sprintf(local_48,pcVar6);
        FUN_1400bc640(local_80,local_48);
      }
      plVar2 = local_a0;
      param_1 = param_1 + 1;
      *local_70 = *local_70 + 1;
      param_2 = iVar5 - 1;
      if (param_2 == 0) {
        if (uVar8 == 0) {
          local_88 = operator_new(0x38);
          lVar3 = 0;
          if (local_88 != (void *)0x0) {
            lVar3 = FUN_140114be0(local_88);
          }
          *(undefined4 *)(lVar3 + 0x18) = 0;
          *(byte *)(lVar3 + 0x10) = local_a8;
          *(char *)(lVar3 + 0x11) = (char)local_98;
          *(uint *)(lVar3 + 0x14) = uVar7;
          *(undefined1 *)(lVar3 + 0x12) = 0;
          FUN_1400d0c90(local_60,lVar3);
          return 1;
        }
        pcVar6 = "premature end of BER encoding (E)";
        goto LAB_1401152c1;
      }
      if (local_a7 == '\0') {
        if (param_2 < uVar8) {
          (**(code **)(*local_a0 + 0x28))(local_a0,"premature end of BER encoding (F2)");
          FUN_1400cf520(plVar2,"length",_Size);
          FUN_1400cf520(plVar2,"numBytesLeft",param_2);
          return 0;
        }
        local_88 = operator_new(0x38);
        if (local_88 == (void *)0x0) {
          lVar3 = 0;
        }
        else {
          lVar3 = FUN_140114be0(local_88);
        }
        *(uint *)(lVar3 + 0x18) = uVar8;
        *(byte *)(lVar3 + 0x10) = local_a8;
        *(char *)(lVar3 + 0x11) = (char)local_98;
        *(uint *)(lVar3 + 0x14) = local_90;
        *(undefined1 *)(lVar3 + 0x12) = 0;
        if (uVar8 != 0) {
          if ((char)local_98 == '\0') {
            local_88 = operator_new(0x28);
            if (param_5 == '\0') {
              uVar4 = 0;
              if (local_88 != (void *)0x0) {
                uVar4 = FUN_1400b8c40(local_88);
              }
              *(undefined8 *)(lVar3 + 0x30) = uVar4;
              goto LAB_140115033;
            }
            uVar4 = 0;
            if (local_88 != (void *)0x0) {
              uVar4 = FUN_1400d0a70(local_88);
            }
            *(undefined8 *)(lVar3 + 0x28) = uVar4;
            local_b0 = local_a0;
            local_b8 = local_80;
            local_c0 = local_58;
            local_c8 = '\x01';
            FUN_140114cd0(param_1,_Size,uVar4,0);
          }
          else if (uVar8 < 5) {
            memcpy((void *)(lVar3 + 0x1c),param_1,_Size);
          }
          else {
            local_88 = operator_new(0x28);
            uVar4 = 0;
            if (local_88 != (void *)0x0) {
              uVar4 = FUN_1400b8c40(local_88);
            }
            *(undefined8 *)(lVar3 + 0x20) = uVar4;
LAB_140115033:
            FUN_1400b97e0(uVar4,param_1);
          }
        }
        FUN_1400d0c90(local_60);
        *local_70 = *local_70 + uVar8;
      }
      else {
        local_88 = operator_new(0x38);
        if (local_88 == (void *)0x0) {
          lVar3 = 0;
        }
        else {
          lVar3 = FUN_140114be0(local_88);
        }
        *(uint *)(lVar3 + 0x18) = uVar8;
        *(byte *)(lVar3 + 0x10) = local_a8;
        *(char *)(lVar3 + 0x11) = (char)local_98;
        *(uint *)(lVar3 + 0x14) = local_90;
        *(undefined1 *)(lVar3 + 0x12) = 1;
        local_88 = operator_new(0x28);
        uVar4 = 0;
        if (local_88 != (void *)0x0) {
          uVar4 = FUN_1400d0a70(local_88);
        }
        *(undefined8 *)(lVar3 + 0x28) = uVar4;
        local_b0 = local_a0;
        local_b8 = local_80;
        local_c0 = local_68;
        local_c8 = param_5;
        FUN_140114cd0(param_1,param_2,uVar4,0);
        FUN_1400d0c90(local_60);
        _Size = (size_t)local_68[0];
        *local_70 = *local_70 + local_68[0];
        uVar8 = local_68[0];
      }
      param_2 = param_2 - uVar8;
      param_1 = param_1 + _Size;
      local_94 = local_94 + 1;
      if ((local_78 != 0) && (local_78 <= local_94)) {
        return 1;
      }
      if (param_2 < 2) {
        return 1;
      }
    }
    *local_70 = *local_70 + 1;
    if (param_2 == 1) {
      pcVar6 = "premature end of BER encoding (F1)";
    }
    else {
      if (param_1[1] == 0) {
        *local_70 = *local_70 + 1;
        return 1;
      }
      pcVar6 = "error in BER encoding: tag is zero but length is not.";
    }
LAB_1401152c1:
    lVar3 = *local_a0;
  }
  (**(code **)(lVar3 + 0x28))(local_a0,pcVar6);
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140115300(undefined8 param_1,ulonglong param_2,undefined8 param_3)

{
  undefined1 *puVar1;
  longlong lVar2;
  uint uVar3;
  uint uVar4;
  undefined1 *puVar5;
  undefined1 auStack_58 [32];
  undefined1 auStack_38 [32];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_58;
  uVar3 = (uint)param_2;
  if (uVar3 < 0x80) {
    FUN_1400b9550(param_3);
    return;
  }
  uVar4 = 0;
  while (uVar3 != 0) {
    lVar2 = (longlong)(int)uVar4;
    uVar4 = uVar4 + 1;
    auStack_38[lVar2] = (char)param_2;
    param_2 = param_2 >> 8 & 0xffffff;
    uVar3 = (uint)param_2;
  }
  FUN_1400b9550(param_3,uVar4 & 0xff | 0x80);
  if (0 < (int)uVar4) {
    puVar5 = auStack_38 + (int)uVar4;
    do {
      puVar1 = puVar5 + -1;
      puVar5 = puVar5 + -1;
      uVar4 = uVar4 - 1;
      FUN_1400b9550(param_3,*puVar1);
    } while (0 < (int)uVar4);
  }
  return;
}



bool FUN_1401153c0(longlong param_1)

{
  return *(int *)(param_1 + 0x14) == 0x10;
}



bool FUN_1401153d0(longlong param_1)

{
  return *(int *)(param_1 + 0x14) == 6;
}



bool FUN_1401153e0(longlong param_1,undefined8 param_2)

{
  byte bVar1;
  int iVar2;
  byte *pbVar3;
  int iVar4;
  uint uVar5;
  
  FUN_1400bbe30(param_2);
  if ((*(int *)(param_1 + 0x14) == 6) && (*(longlong *)(param_1 + 0x20) != 0)) {
    pbVar3 = (byte *)FUN_1400b8b90();
    iVar2 = FUN_1400b8b80(*(undefined8 *)(param_1 + 0x20));
    iVar4 = 0;
    uVar5 = 0;
    while (iVar2 != 0) {
      bVar1 = *pbVar3;
      iVar2 = iVar2 + -1;
      pbVar3 = pbVar3 + 1;
      uVar5 = bVar1 & 0x7f | uVar5 << 7;
      if ((bVar1 & 0x80) == 0) {
        if (iVar4 == 0) {
          FUN_1400be4a0(param_2,(int)uVar5 / 0x28);
          FUN_1400bbe50(param_2,0x2e);
          FUN_1400be4a0(param_2,(int)uVar5 % 0x28);
          iVar4 = 2;
        }
        else {
          FUN_1400bbe50(param_2,0x2e);
          FUN_1400be4a0(param_2,uVar5);
          iVar4 = iVar4 + 1;
        }
        uVar5 = 0;
      }
    }
    iVar2 = FUN_1400bbb10(param_2);
    return iVar2 != 0;
  }
  return false;
}



void FUN_1401154f0(longlong param_1,undefined8 param_2)

{
  uint uVar1;
  
  uVar1 = *(uint *)(param_1 + 0x18);
  if (uVar1 != 0) {
    if (uVar1 < 5) {
      if (uVar1 == 1) {
        FUN_1400b9550(param_2,*(undefined1 *)(param_1 + 0x1c));
        return;
      }
      param_1 = param_1 + 0x1c;
    }
    else {
      if (*(longlong *)(param_1 + 0x20) == 0) {
        return;
      }
      param_1 = FUN_1400b8b90();
      if (param_1 == 0) {
        return;
      }
    }
    FUN_1400b97e0(param_2,param_1,uVar1);
  }
  return;
}



void FUN_140115560(longlong param_1,undefined8 param_2)

{
  char *pcVar1;
  uint uVar2;
  
  FUN_1400b8b30(param_2);
  uVar2 = *(uint *)(param_1 + 0x18);
  if (uVar2 != 0) {
    if (uVar2 < 5) {
      if (uVar2 == 1) {
        FUN_1400b9550(param_2,*(undefined1 *)(param_1 + 0x1c));
        return;
      }
      pcVar1 = (char *)(param_1 + 0x1c);
      if (((*(char *)(param_1 + 0x1c) == '\0') && (2 < uVar2)) &&
         ((*pcVar1 == '\0' &&
          ((*(char *)(param_1 + 0x1d) == -1 && (0x7f < *(byte *)(param_1 + 0x1e))))))) {
        pcVar1 = (char *)(param_1 + 0x1d);
        uVar2 = uVar2 - 1;
      }
    }
    else {
      if (*(longlong *)(param_1 + 0x20) == 0) {
        return;
      }
      pcVar1 = (char *)FUN_1400b8b90();
      if (pcVar1 == (char *)0x0) {
        return;
      }
      if ((((2 < uVar2) && (*pcVar1 == '\0')) && (pcVar1[1] == -1)) && (0x7f < (byte)pcVar1[2])) {
        pcVar1 = pcVar1 + 1;
        uVar2 = uVar2 - 1;
      }
    }
    FUN_1400b97e0(param_2,pcVar1,uVar2);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_140115620(longlong param_1,undefined8 param_2,char param_3,longlong param_4,longlong *param_5)

{
  uint uVar1;
  undefined8 uVar2;
  char cVar3;
  int iVar4;
  undefined4 uVar5;
  int iVar6;
  undefined8 uVar7;
  longlong lVar8;
  undefined8 *puVar9;
  undefined8 *puVar10;
  longlong lVar11;
  byte *pbVar12;
  char *pcVar13;
  byte bVar14;
  uint uVar15;
  undefined8 *puVar16;
  undefined1 auStack_d8 [32];
  longlong *local_b8;
  char local_a8;
  char local_a7;
  int local_a4;
  longlong local_a0;
  undefined8 local_98;
  undefined8 *local_90;
  int local_88;
  int local_84;
  longlong *local_80;
  void *local_78;
  undefined8 *local_70;
  undefined8 *local_68;
  longlong local_60;
  undefined8 local_58;
  byte local_50 [32];
  ulonglong local_30;
  
  local_58 = 0xfffffffffffffffe;
  local_30 = DAT_1402f85a0 ^ (ulonglong)auStack_d8;
  local_80 = param_5;
  puVar16 = (undefined8 *)0x0;
  bVar14 = *(char *)(param_1 + 0x10) << 6;
  local_a7 = param_3;
  local_a0 = param_4;
  local_98 = param_2;
  local_60 = param_1;
  if (*(uint *)(param_1 + 0x14) < 0x1f) {
    if (*(char *)(param_1 + 0x11) == '\0') {
      bVar14 = bVar14 | 0x20;
    }
    FUN_1400b9550(param_2,bVar14 | *(byte *)(param_1 + 0x14));
    lVar11 = local_a0;
    if (local_a0 != 0) {
      sprintf((char *)local_50,"id[%x]\n");
      lVar11 = local_a0;
      FUN_1400bc640(local_a0,local_50);
    }
  }
  else {
    if (*(char *)(param_1 + 0x11) == '\0') {
      bVar14 = bVar14 | 0x20;
    }
    FUN_1400b9550(param_2,bVar14 | 0x1f);
    lVar11 = local_a0;
    if (local_a0 != 0) {
      sprintf((char *)local_50,"id[%x]\n");
      FUN_1400bc640(lVar11,local_50);
    }
    puVar9 = puVar16;
    if (*(uint *)(param_1 + 0x14) != 0) {
      pbVar12 = local_50;
      uVar15 = *(uint *)(param_1 + 0x14);
      do {
        *pbVar12 = (byte)uVar15 & 0x7f;
        puVar9 = (undefined8 *)(ulonglong)((int)puVar9 + 1);
        pbVar12 = pbVar12 + 1;
        uVar1 = uVar15 >> 7;
        uVar15 = uVar15 >> 7;
      } while (uVar1 != 0);
    }
    lVar8 = (longlong)(int)puVar9;
    while (param_2 = local_98, lVar11 = local_a0, (int)puVar9 != 0) {
      uVar15 = (int)puVar9 - 1;
      puVar9 = (undefined8 *)(ulonglong)uVar15;
      if (uVar15 == 0) {
        FUN_1400b9550(local_98,local_50[lVar8 + -1]);
        lVar11 = local_a0;
        break;
      }
      FUN_1400b9550(local_98,local_50[lVar8 + -1] | 0x80);
      lVar8 = lVar8 + -1;
    }
  }
  if (*(char *)(param_1 + 0x11) != '\0') {
    FUN_140115300(param_1,*(undefined4 *)(param_1 + 0x18),param_2);
    if (lVar11 != 0) {
      sprintf((char *)local_50,"len=%d\n");
      FUN_1400bc640(lVar11,local_50);
    }
    if (*(uint *)(param_1 + 0x18) < 5) {
      FUN_1400b97e0(param_2,param_1 + 0x1c);
      return 1;
    }
    if (*(longlong *)(param_1 + 0x20) == 0) {
      (**(code **)(*local_80 + 0x28))(local_80,"No content for primitive!");
      return 0;
    }
    iVar4 = FUN_1400b8b80();
    if (*(int *)(param_1 + 0x18) == iVar4) {
      uVar5 = FUN_1400b8b80(*(undefined8 *)(param_1 + 0x20));
      uVar7 = FUN_1400b8b90(*(undefined8 *)(param_1 + 0x20));
      FUN_1400b97e0(param_2,uVar7,uVar5);
      return 1;
    }
    (**(code **)(*local_80 + 0x28))(local_80,"Length disagreement");
    return 0;
  }
  local_a4 = 0;
  local_90 = (undefined8 *)0x0;
  local_70 = (undefined8 *)0x0;
  puVar9 = puVar16;
  if (*(longlong *)(param_1 + 0x30) == 0) {
    local_a8 = '\0';
    if (*(longlong *)(param_1 + 0x28) == 0) {
      lVar8 = FUN_1400d0db0();
      *(longlong *)(param_1 + 0x28) = lVar8;
      if (lVar8 == 0) {
        (**(code **)(*local_80 + 0x28))(local_80,"No constructed innert parts object.");
        return 0;
      }
    }
    local_78 = operator_new(0x28);
    if (local_78 == (void *)0x0) {
      local_90 = (undefined8 *)0x0;
    }
    else {
      local_90 = (undefined8 *)FUN_1400d0a70(local_78);
    }
    puVar10 = local_70;
    if ((lVar11 != 0) && (local_78 = operator_new(0x28), puVar10 = puVar16, local_78 != (void *)0x0)
       ) {
      puVar9 = (undefined8 *)FUN_1400d0a70(local_78);
      puVar10 = puVar9;
    }
    local_70 = puVar10;
    local_84 = FUN_140139d70(*(undefined8 *)(param_1 + 0x28));
    local_88 = 0;
    if (0 < local_84) {
      do {
        local_78 = operator_new(0x28);
        puVar10 = puVar16;
        if (local_78 != (void *)0x0) {
          puVar10 = (undefined8 *)FUN_1400b8c40(local_78);
        }
        local_78 = (void *)FUN_1400d0aa0(*(undefined8 *)(param_1 + 0x28),local_88);
        if (local_78 == (void *)0x0) {
          local_a8 = '\x01';
          if (puVar10 != (undefined8 *)0x0) {
            (**(code **)*puVar10)(puVar10,1);
          }
        }
        else {
          local_68 = (undefined8 *)0x0;
          if (puVar9 != (undefined8 *)0x0) {
            local_68 = (undefined8 *)FUN_1400be710();
          }
          local_b8 = local_80;
          cVar3 = FUN_140115620(local_78,puVar10,local_a7,local_68);
          if (cVar3 == '\0') {
            local_a8 = '\x01';
            if (local_68 != (undefined8 *)0x0) {
              (**(code **)*local_68)(local_68,1);
            }
            if (puVar10 != (undefined8 *)0x0) {
              (**(code **)*puVar10)(puVar10,1);
            }
          }
          else {
            FUN_1400d0c90(local_90,puVar10);
            if (puVar9 != (undefined8 *)0x0) {
              FUN_1400d0c90(puVar9,local_68);
            }
            iVar4 = FUN_1400b8b80(puVar10);
            local_a4 = local_a4 + iVar4;
          }
        }
        puVar10 = local_90;
        local_88 = local_88 + 1;
      } while (local_88 < local_84);
      if (local_a8 != '\0') {
        FUN_1400d0d30(local_90);
        if (puVar10 != (undefined8 *)0x0) {
          (**(code **)*puVar10)(puVar10,1);
        }
        if (puVar9 != (undefined8 *)0x0) {
          FUN_1400d0d30(puVar9);
          (**(code **)*puVar9)(puVar9,1);
        }
        return 0;
      }
    }
  }
  else {
    local_a4 = FUN_1400b8b80();
  }
  if ((*(char *)(param_1 + 0x12) == '\0') || (local_a7 == '\0')) {
    FUN_140115300(param_1,local_a4,local_98);
    lVar11 = local_a0;
    if (local_a0 == 0) goto LAB_140115ae1;
    sprintf((char *)local_50,"totalLen=%d\n");
    pcVar13 = (char *)local_50;
  }
  else {
    FUN_1400b9550(local_98,0x80);
    if (local_a0 == 0) goto LAB_140115ae1;
    pcVar13 = "indefinite_length\n";
    lVar11 = local_a0;
  }
  FUN_1400bc640(lVar11,pcVar13);
LAB_140115ae1:
  if ((puVar9 != (undefined8 *)0x0) && (iVar4 = FUN_140139d70(puVar9), lVar11 = local_a0, 0 < iVar4)
     ) {
    do {
      lVar8 = FUN_1400d0aa0(puVar9,puVar16);
      if (lVar8 != 0) {
        FUN_1400bda40(lVar11,lVar8);
      }
      uVar15 = (int)puVar16 + 1;
      puVar16 = (undefined8 *)(ulonglong)uVar15;
      param_1 = local_60;
    } while ((int)uVar15 < iVar4);
  }
  uVar7 = local_98;
  iVar4 = 0;
  if (*(longlong *)(param_1 + 0x30) == 0) {
    iVar6 = FUN_140139d70(local_90);
    puVar16 = local_90;
    uVar2 = local_98;
    uVar7 = local_98;
    if (0 < iVar6) {
      do {
        lVar11 = FUN_1400d0aa0(puVar16,iVar4);
        if (lVar11 != 0) {
          FUN_1400b9e90(uVar2,lVar11);
        }
        iVar4 = iVar4 + 1;
        uVar7 = local_98;
        param_1 = local_60;
        puVar9 = local_70;
      } while (iVar4 < iVar6);
    }
  }
  else {
    FUN_1400b9e90(local_98);
  }
  if ((*(char *)(param_1 + 0x12) != '\0') && (local_a7 != '\0')) {
    FUN_1400b95c0(uVar7,0,2);
  }
  puVar16 = local_90;
  if (local_90 != (undefined8 *)0x0) {
    FUN_1400d0d30(local_90);
    (**(code **)*puVar16)(puVar16,1);
  }
  if (puVar9 != (undefined8 *)0x0) {
    FUN_1400d0d30(puVar9);
    (**(code **)*puVar9)(puVar9,1);
  }
  return 1;
}



undefined8 * FUN_140115c10(char param_1)

{
  undefined8 *puVar1;
  
  puVar1 = operator_new(0x38);
  if (puVar1 != (undefined8 *)0x0) {
    FUN_1400d0eb0(puVar1);
    *puVar1 = Asn1::vftable;
    *(undefined2 *)(puVar1 + 2) = 0x100;
    *(undefined1 *)((longlong)puVar1 + 0x12) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x14) = 0;
    puVar1[4] = 0;
    puVar1[5] = 0;
    puVar1[6] = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0;
  }
  *(undefined1 *)((longlong)puVar1 + 0x11) = 1;
  *(undefined4 *)((longlong)puVar1 + 0x14) = 1;
  *(undefined4 *)(puVar1 + 3) = 1;
  if (param_1 != '\0') {
    *(undefined1 *)((longlong)puVar1 + 0x1c) = 0xff;
  }
  return puVar1;
}



int FUN_140115ca0(uint param_1,char *param_2)

{
  char cVar1;
  byte bVar2;
  longlong lVar3;
  int iVar4;
  uint uVar5;
  int iVar6;
  bool bVar7;
  undefined4 local_res8;
  
  bVar2 = 0;
  iVar6 = 0;
  local_res8 = param_1;
  cVar1 = FUN_140102de0();
  uVar5 = param_1;
  if (cVar1 != '\0') {
    uVar5 = param_1 << 0x18 | (int)param_1 >> 8 & 0xff00ff00U | (param_1 & 0xff00) << 8 |
            (int)param_1 >> 0x18 & 0xff00ffU;
    local_res8 = uVar5;
  }
  iVar4 = 4;
  lVar3 = 3;
  if ((int)param_1 < 0) {
    do {
      if (*(char *)((longlong)&local_res8 + lVar3) != -1) break;
      iVar4 = iVar4 + -1;
      lVar3 = lVar3 + -1;
    } while (-1 < lVar3);
  }
  else {
    do {
      if (*(char *)((longlong)&local_res8 + lVar3) != '\0') break;
      iVar4 = iVar4 + -1;
      lVar3 = lVar3 + -1;
    } while (-1 < lVar3);
  }
  if ((int)param_1 < 0) {
    if (iVar4 == 0) {
      bVar2 = 0xff;
    }
    else {
      bVar2 = *(byte *)((longlong)&local_res8 + (ulonglong)(iVar4 - 1));
    }
  }
  else if (iVar4 != 0) {
    bVar2 = *(byte *)((longlong)&local_res8 + (ulonglong)(iVar4 - 1));
  }
  bVar7 = (int)param_1 < 0;
  if (bVar7) {
    if (bVar2 < 0x80) {
      cVar1 = -1;
      goto LAB_140115d68;
    }
  }
  else if (0x7f < bVar2) {
    cVar1 = '\0';
LAB_140115d68:
    *param_2 = cVar1;
    param_2 = param_2 + 1;
    iVar6 = 1;
  }
  if (iVar4 == 0) {
    *param_2 = -bVar7;
    return iVar6 + 1;
  }
  cVar1 = (char)uVar5;
  if (bVar7) {
    if (-0x100 < (int)param_1) goto LAB_140115dc0;
    if (-0x10000 < (int)param_1) goto LAB_140115dcf;
    if (-0x1000000 < (int)param_1) goto LAB_140115de7;
    *param_2 = local_res8._3_1_;
    param_2[1] = local_res8._2_1_;
    param_2[2] = local_res8._1_1_;
  }
  else {
    if ((int)param_1 < 0x100) {
LAB_140115dc0:
      *param_2 = cVar1;
      return iVar6 + 1;
    }
    if ((int)param_1 < 0x10000) {
LAB_140115dcf:
      *param_2 = local_res8._1_1_;
      param_2[1] = cVar1;
      return iVar6 + 2;
    }
    if ((int)param_1 < 0x1000000) {
LAB_140115de7:
      *param_2 = local_res8._2_1_;
      param_2[1] = local_res8._1_1_;
      param_2[2] = cVar1;
      return iVar6 + 3;
    }
    *param_2 = local_res8._3_1_;
    param_2[1] = local_res8._2_1_;
    param_2[2] = local_res8._1_1_;
  }
  param_2[3] = cVar1;
  return iVar6 + 4;
}



undefined8 * FUN_140115e40(undefined4 param_1)

{
  undefined8 *puVar1;
  void *pvVar2;
  undefined8 uVar3;
  
  puVar1 = operator_new(0x38);
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    FUN_1400d0eb0(puVar1);
    *puVar1 = Asn1::vftable;
    *(undefined2 *)(puVar1 + 2) = 0x100;
    *(undefined1 *)((longlong)puVar1 + 0x12) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x14) = 0;
    puVar1[4] = 0;
    puVar1[5] = 0;
    puVar1[6] = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0;
  }
  uVar3 = 0;
  *(undefined2 *)(puVar1 + 2) = 2;
  *(undefined4 *)((longlong)puVar1 + 0x14) = param_1;
  *(undefined4 *)(puVar1 + 3) = 0;
  pvVar2 = operator_new(0x28);
  if (pvVar2 != (void *)0x0) {
    uVar3 = FUN_1400d0a70(pvVar2);
  }
  puVar1[5] = uVar3;
  return puVar1;
}



undefined8 * FUN_140115ef0(undefined4 param_1,undefined8 *param_2)

{
  uint uVar1;
  undefined8 *puVar2;
  void *pvVar3;
  
  puVar2 = operator_new(0x38);
  if (puVar2 == (undefined8 *)0x0) {
    puVar2 = (undefined8 *)0x0;
  }
  else {
    FUN_1400d0eb0(puVar2);
    *puVar2 = Asn1::vftable;
    *(undefined2 *)(puVar2 + 2) = 0x100;
    *(undefined1 *)((longlong)puVar2 + 0x12) = 0;
    *(undefined8 *)((longlong)puVar2 + 0x14) = 0;
    puVar2[4] = 0;
    puVar2[5] = 0;
    puVar2[6] = 0;
    *(undefined4 *)((longlong)puVar2 + 0x1c) = 0;
  }
  *(undefined2 *)(puVar2 + 2) = 0x102;
  *(undefined4 *)((longlong)puVar2 + 0x14) = param_1;
  if (param_2 == (undefined8 *)0x0) {
    pvVar3 = operator_new(0x28);
    if (pvVar3 == (void *)0x0) {
      param_2 = (undefined8 *)0x0;
    }
    else {
      param_2 = (undefined8 *)FUN_1400b8c40(pvVar3);
    }
  }
  uVar1 = FUN_1400b8b80(param_2);
  *(uint *)(puVar2 + 3) = uVar1;
  if (uVar1 < 5) {
    if (uVar1 != 0) {
      pvVar3 = (void *)FUN_1400b8b90(param_2);
      memcpy((void *)((longlong)puVar2 + 0x1c),pvVar3,(ulonglong)uVar1);
    }
    if (param_2 != (undefined8 *)0x0) {
      (**(code **)*param_2)(param_2,1);
    }
  }
  else {
    puVar2[4] = param_2;
  }
  return puVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_140115ff0(undefined4 param_1)

{
  uint uVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  undefined1 auStack_58 [32];
  undefined8 *local_38;
  undefined8 local_30;
  undefined1 local_28 [16];
  ulonglong local_18;
  
  local_30 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_58;
  puVar2 = operator_new(0x38);
  local_38 = puVar2;
  if (puVar2 == (undefined8 *)0x0) {
    puVar2 = (undefined8 *)0x0;
  }
  else {
    FUN_1400d0eb0(puVar2);
    *puVar2 = Asn1::vftable;
    *(undefined2 *)(puVar2 + 2) = 0x100;
    *(undefined1 *)((longlong)puVar2 + 0x12) = 0;
    *(undefined8 *)((longlong)puVar2 + 0x14) = 0;
    puVar2[4] = 0;
    puVar2[5] = 0;
    puVar2[6] = 0;
    *(undefined4 *)((longlong)puVar2 + 0x1c) = 0;
  }
  uVar3 = 0;
  *(undefined1 *)((longlong)puVar2 + 0x11) = 1;
  *(undefined4 *)((longlong)puVar2 + 0x14) = 2;
  uVar1 = FUN_140115ca0(param_1,local_28);
  *(uint *)(puVar2 + 3) = uVar1;
  if (uVar1 < 5) {
    if (uVar1 != 0) {
      memcpy((void *)((longlong)puVar2 + 0x1c),local_28,(ulonglong)uVar1);
    }
  }
  else {
    local_38 = operator_new(0x28);
    if (local_38 != (void *)0x0) {
      uVar3 = FUN_1400b8c40(local_38);
    }
    puVar2[4] = uVar3;
    FUN_1400b97e0(uVar3,local_28,*(undefined4 *)(puVar2 + 3));
  }
  return puVar2;
}



longlong FUN_140116100(byte *param_1,uint param_2)

{
  void *pvVar1;
  longlong lVar2;
  longlong lVar3;
  bool bVar4;
  
  if ((param_1 == (byte *)0x0) || (param_2 == 0)) {
    lVar2 = 0;
  }
  else {
    bVar4 = (*param_1 & 0x80) != 0;
    pvVar1 = operator_new(0x38);
    lVar3 = 0;
    lVar2 = lVar3;
    if (pvVar1 != (void *)0x0) {
      lVar2 = FUN_140114be0(pvVar1);
    }
    *(undefined1 *)(lVar2 + 0x11) = 1;
    *(undefined4 *)(lVar2 + 0x14) = 2;
    *(uint *)(lVar2 + 0x18) = bVar4 + param_2;
    if (bVar4 + param_2 < 5) {
      if (bVar4) {
        *(undefined1 *)(lVar2 + 0x1c) = 0;
        memcpy((void *)(lVar2 + 0x1d),param_1,(ulonglong)param_2);
      }
      else {
        memcpy((void *)(lVar2 + 0x1c),param_1,(ulonglong)param_2);
      }
    }
    else {
      pvVar1 = operator_new(0x28);
      if (pvVar1 != (void *)0x0) {
        lVar3 = FUN_1400b8c40(pvVar1);
      }
      *(longlong *)(lVar2 + 0x20) = lVar3;
      if (bVar4) {
        FUN_1400b9550(lVar3,0);
      }
      FUN_1400b97e0(*(undefined8 *)(lVar2 + 0x20),param_1,param_2);
    }
  }
  return lVar2;
}



undefined8 * FUN_140116200(void *param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  void *pvVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  puVar1 = operator_new(0x38);
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    FUN_1400d0eb0(puVar1);
    *puVar1 = Asn1::vftable;
    *(undefined2 *)(puVar1 + 2) = 0x100;
    *(undefined1 *)((longlong)puVar1 + 0x12) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x14) = 0;
    puVar1[4] = 0;
    puVar1[5] = 0;
    puVar1[6] = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0;
  }
  uVar3 = 0;
  *(undefined1 *)((longlong)puVar1 + 0x11) = 1;
  *(undefined4 *)((longlong)puVar1 + 0x14) = 4;
  *(uint *)(puVar1 + 3) = param_2;
  if (param_2 < 5) {
    if ((param_1 != (void *)0x0) && (param_2 != 0)) {
      memcpy((void *)((longlong)puVar1 + 0x1c),param_1,(ulonglong)param_2);
    }
  }
  else {
    pvVar2 = operator_new(0x28);
    if (pvVar2 != (void *)0x0) {
      uVar3 = FUN_1400b8c40(pvVar2);
    }
    puVar1[4] = uVar3;
    if (param_1 != (void *)0x0) {
      FUN_1400b97e0(uVar3,param_1,*(undefined4 *)(puVar1 + 3),param_4,uVar4);
    }
  }
  return puVar1;
}



undefined8 * FUN_1401162f0(void *param_1,uint param_2)

{
  undefined8 *puVar1;
  void *pvVar2;
  undefined8 uVar3;
  
  puVar1 = operator_new(0x38);
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    FUN_1400d0eb0(puVar1);
    *puVar1 = Asn1::vftable;
    *(undefined2 *)(puVar1 + 2) = 0x100;
    *(undefined1 *)((longlong)puVar1 + 0x12) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x14) = 0;
    puVar1[4] = 0;
    puVar1[5] = 0;
    puVar1[6] = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0;
  }
  uVar3 = 0;
  *(undefined1 *)((longlong)puVar1 + 0x11) = 1;
  *(undefined4 *)((longlong)puVar1 + 0x14) = 3;
  if (param_2 == 0) {
    *(undefined4 *)(puVar1 + 3) = 0;
  }
  else {
    *(uint *)(puVar1 + 3) = param_2 + 1;
    if (param_2 + 1 < 5) {
      if (param_1 != (void *)0x0) {
        memcpy((void *)((longlong)puVar1 + 0x1d),param_1,(ulonglong)param_2);
      }
      *(undefined1 *)((longlong)puVar1 + 0x1c) = 0;
    }
    else {
      pvVar2 = operator_new(0x28);
      if (pvVar2 != (void *)0x0) {
        uVar3 = FUN_1400b8c40(pvVar2);
      }
      puVar1[4] = uVar3;
      FUN_1400b9550(uVar3,0);
      if (param_1 != (void *)0x0) {
        FUN_1400b97e0(puVar1[4],param_1,param_2);
      }
    }
  }
  return puVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_140116400(undefined8 param_1)

{
  int iVar1;
  char *pcVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  longlong lVar5;
  longlong lVar6;
  ulonglong uVar7;
  uint uVar8;
  byte *pbVar10;
  undefined1 auStack_2c8 [32];
  int *local_2a8;
  int local_298;
  int local_294;
  char local_290;
  char local_28c;
  int local_288 [2];
  undefined1 local_280 [48];
  undefined8 local_250;
  undefined8 *local_248 [2];
  char local_238;
  byte local_237 [510];
  byte local_39;
  ulonglong local_38;
  ulonglong uVar9;
  
  local_250 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_2c8;
  FUN_1400bcaa0(local_280,param_1);
  FUN_1400bbc30(local_280);
  pcVar2 = (char *)FUN_1400b8b90(local_280);
  puVar3 = operator_new(0x38);
  local_248[0] = puVar3;
  if (puVar3 == (undefined8 *)0x0) {
    puVar3 = (undefined8 *)0x0;
  }
  else {
    FUN_1400d0eb0(puVar3);
    *puVar3 = Asn1::vftable;
    *(undefined2 *)(puVar3 + 2) = 0x100;
    *(undefined1 *)((longlong)puVar3 + 0x12) = 0;
    *(undefined8 *)((longlong)puVar3 + 0x14) = 0;
    puVar3[4] = 0;
    puVar3[5] = 0;
    puVar3[6] = 0;
    *(undefined4 *)((longlong)puVar3 + 0x1c) = 0;
  }
  uVar4 = 0;
  *(undefined1 *)((longlong)puVar3 + 0x11) = 1;
  *(undefined4 *)((longlong)puVar3 + 0x14) = 6;
  local_2a8 = local_288;
  iVar1 = sscanf(pcVar2,"%d.%d.%n");
  if (iVar1 == 2) {
    local_238 = local_290 * '(' + local_28c;
    pbVar10 = local_237;
    pcVar2 = pcVar2 + local_288[0];
    while (*pcVar2 != '\0') {
      sscanf(pcVar2,"%d%n");
      if (local_298 < 0x10000000) {
        if (local_298 < 0x200000) {
          if (local_298 < 0x4000) {
            lVar5 = 2;
            if (local_298 < 0x80) {
              lVar5 = 1;
            }
          }
          else {
            lVar5 = 3;
          }
        }
        else {
          lVar5 = 4;
        }
      }
      else {
        lVar5 = 5;
      }
      lVar6 = lVar5;
      if (lVar5 != 0) {
        do {
          *(byte *)((longlong)local_248 + lVar6 + -1) = (byte)local_298 & 0x7f;
          local_298 = local_298 >> 7;
          lVar6 = lVar6 + -1;
        } while (0 < lVar6);
      }
      iVar1 = (int)lVar5 + -1;
      uVar7 = uVar4;
      uVar9 = uVar4;
      if (0 < iVar1) {
        do {
          *pbVar10 = *(byte *)((longlong)local_248 + uVar7) | 0x80;
          pbVar10 = pbVar10 + 1;
          if (&local_39 < pbVar10) {
            (**(code **)*puVar3)(puVar3,1);
            FUN_1400bceb0(local_280);
            return (undefined8 *)0x0;
          }
          uVar8 = (int)uVar9 + 1;
          uVar9 = (ulonglong)uVar8;
          uVar7 = uVar7 + 1;
        } while ((int)uVar8 < iVar1);
      }
      *pbVar10 = *(byte *)((longlong)local_248 + uVar7);
      pbVar10 = pbVar10 + 1;
      if (&local_39 < pbVar10) {
        (**(code **)*puVar3)(puVar3,1);
        FUN_1400bceb0(local_280);
        return (undefined8 *)0x0;
      }
      pcVar2 = pcVar2 + local_294;
      if (*pcVar2 == '.') {
        pcVar2 = pcVar2 + 1;
      }
    }
    uVar8 = (int)pbVar10 - (int)&local_238;
    *(uint *)(puVar3 + 3) = uVar8;
    if (uVar8 < 5) {
      if (uVar8 != 0) {
        memcpy((void *)((longlong)puVar3 + 0x1c),&local_238,(ulonglong)uVar8);
      }
    }
    else {
      local_248[0] = operator_new(0x28);
      if (local_248[0] != (undefined8 *)0x0) {
        uVar4 = FUN_1400b8c40(local_248[0]);
      }
      puVar3[4] = uVar4;
      FUN_1400b97e0(uVar4,&local_238,*(undefined4 *)(puVar3 + 3));
    }
    FUN_1400bceb0(local_280);
  }
  else {
    (**(code **)*puVar3)(puVar3,1);
    FUN_1400bceb0(local_280);
    puVar3 = (undefined8 *)0x0;
  }
  return puVar3;
}



undefined8 * FUN_140116700(void)

{
  undefined8 *puVar1;
  
  puVar1 = operator_new(0x38);
  if (puVar1 != (undefined8 *)0x0) {
    FUN_1400d0eb0(puVar1);
    *puVar1 = Asn1::vftable;
    *(undefined2 *)(puVar1 + 2) = 0x100;
    *(undefined1 *)((longlong)puVar1 + 0x12) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x14) = 0;
    puVar1[4] = 0;
    puVar1[5] = 0;
    puVar1[6] = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0;
  }
  *(undefined1 *)((longlong)puVar1 + 0x11) = 1;
  *(undefined8 *)((longlong)puVar1 + 0x14) = 5;
  return puVar1;
}



undefined8 * FUN_140116780(void)

{
  undefined8 *puVar1;
  void *pvVar2;
  undefined8 uVar3;
  
  puVar1 = operator_new(0x38);
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    FUN_1400d0eb0(puVar1);
    *puVar1 = Asn1::vftable;
    *(undefined2 *)(puVar1 + 2) = 0x100;
    *(undefined1 *)((longlong)puVar1 + 0x12) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x14) = 0;
    puVar1[4] = 0;
    puVar1[5] = 0;
    puVar1[6] = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0;
  }
  uVar3 = 0;
  *(undefined1 *)((longlong)puVar1 + 0x11) = 0;
  *(undefined8 *)((longlong)puVar1 + 0x14) = 0x10;
  pvVar2 = operator_new(0x28);
  if (pvVar2 != (void *)0x0) {
    uVar3 = FUN_1400d0a70(pvVar2);
  }
  puVar1[5] = uVar3;
  return puVar1;
}



undefined8 * FUN_140116820(void)

{
  undefined8 *puVar1;
  void *pvVar2;
  undefined8 uVar3;
  
  puVar1 = operator_new(0x38);
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    FUN_1400d0eb0(puVar1);
    *puVar1 = Asn1::vftable;
    *(undefined2 *)(puVar1 + 2) = 0x100;
    *(undefined1 *)((longlong)puVar1 + 0x12) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x14) = 0;
    puVar1[4] = 0;
    puVar1[5] = 0;
    puVar1[6] = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0;
  }
  uVar3 = 0;
  *(undefined1 *)((longlong)puVar1 + 0x11) = 0;
  *(undefined8 *)((longlong)puVar1 + 0x14) = 0x11;
  pvVar2 = operator_new(0x28);
  if (pvVar2 != (void *)0x0) {
    uVar3 = FUN_1400d0a70(pvVar2);
  }
  puVar1[5] = uVar3;
  return puVar1;
}



undefined8 * FUN_1401168c0(char *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 *puVar2;
  void *pvVar3;
  undefined8 uVar4;
  uint uVar5;
  ulonglong uVar6;
  char *_Src;
  char *pcVar7;
  undefined8 uVar8;
  
  uVar8 = 0xfffffffffffffffe;
  _Src = "";
  if (param_1 != (char *)0x0) {
    _Src = param_1;
  }
  puVar2 = operator_new(0x38);
  if (puVar2 == (undefined8 *)0x0) {
    puVar2 = (undefined8 *)0x0;
  }
  else {
    FUN_1400d0eb0();
    *puVar2 = Asn1::vftable;
    *(undefined2 *)(puVar2 + 2) = 0x100;
    *(undefined1 *)((longlong)puVar2 + 0x12) = 0;
    *(undefined8 *)((longlong)puVar2 + 0x14) = 0;
    puVar2[4] = 0;
    puVar2[5] = 0;
    puVar2[6] = 0;
    *(undefined4 *)((longlong)puVar2 + 0x1c) = 0;
  }
  uVar4 = 0;
  *(undefined1 *)((longlong)puVar2 + 0x11) = 1;
  *(undefined4 *)((longlong)puVar2 + 0x14) = 0x16;
  uVar6 = 0xffffffffffffffff;
  pcVar7 = _Src;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    cVar1 = *pcVar7;
    pcVar7 = pcVar7 + 1;
  } while (cVar1 != '\0');
  uVar5 = (uint)(~uVar6 - 1);
  *(uint *)(puVar2 + 3) = uVar5;
  if (uVar5 < 5) {
    if (uVar5 != 0) {
      memcpy((void *)((longlong)puVar2 + 0x1c),_Src,~uVar6 - 1 & 0xffffffff);
    }
  }
  else {
    pvVar3 = operator_new(0x28);
    if (pvVar3 != (void *)0x0) {
      uVar4 = FUN_1400b8c40(pvVar3);
    }
    puVar2[4] = uVar4;
    FUN_1400b97e0(uVar4,_Src,*(undefined4 *)(puVar2 + 3),param_4,uVar8);
  }
  return puVar2;
}



undefined8 * FUN_1401169c0(char *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 *puVar2;
  void *pvVar3;
  undefined8 uVar4;
  uint uVar5;
  ulonglong uVar6;
  char *_Src;
  char *pcVar7;
  undefined8 uVar8;
  
  uVar8 = 0xfffffffffffffffe;
  _Src = "";
  if (param_1 != (char *)0x0) {
    _Src = param_1;
  }
  puVar2 = operator_new(0x38);
  if (puVar2 == (undefined8 *)0x0) {
    puVar2 = (undefined8 *)0x0;
  }
  else {
    FUN_1400d0eb0();
    *puVar2 = Asn1::vftable;
    *(undefined2 *)(puVar2 + 2) = 0x100;
    *(undefined1 *)((longlong)puVar2 + 0x12) = 0;
    *(undefined8 *)((longlong)puVar2 + 0x14) = 0;
    puVar2[4] = 0;
    puVar2[5] = 0;
    puVar2[6] = 0;
    *(undefined4 *)((longlong)puVar2 + 0x1c) = 0;
  }
  uVar4 = 0;
  *(undefined1 *)((longlong)puVar2 + 0x11) = 1;
  *(undefined4 *)((longlong)puVar2 + 0x14) = 0x14;
  uVar6 = 0xffffffffffffffff;
  pcVar7 = _Src;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    cVar1 = *pcVar7;
    pcVar7 = pcVar7 + 1;
  } while (cVar1 != '\0');
  uVar5 = (uint)(~uVar6 - 1);
  *(uint *)(puVar2 + 3) = uVar5;
  if (uVar5 < 5) {
    if (uVar5 != 0) {
      memcpy((void *)((longlong)puVar2 + 0x1c),_Src,~uVar6 - 1 & 0xffffffff);
    }
  }
  else {
    pvVar3 = operator_new(0x28);
    if (pvVar3 != (void *)0x0) {
      uVar4 = FUN_1400b8c40(pvVar3);
    }
    puVar2[4] = uVar4;
    FUN_1400b97e0(uVar4,_Src,*(undefined4 *)(puVar2 + 3),param_4,uVar8);
  }
  return puVar2;
}



undefined8 * FUN_140116ac0(char *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 *puVar2;
  void *pvVar3;
  undefined8 uVar4;
  uint uVar5;
  ulonglong uVar6;
  char *_Src;
  char *pcVar7;
  undefined8 uVar8;
  
  uVar8 = 0xfffffffffffffffe;
  _Src = "";
  if (param_1 != (char *)0x0) {
    _Src = param_1;
  }
  puVar2 = operator_new(0x38);
  if (puVar2 == (undefined8 *)0x0) {
    puVar2 = (undefined8 *)0x0;
  }
  else {
    FUN_1400d0eb0();
    *puVar2 = Asn1::vftable;
    *(undefined2 *)(puVar2 + 2) = 0x100;
    *(undefined1 *)((longlong)puVar2 + 0x12) = 0;
    *(undefined8 *)((longlong)puVar2 + 0x14) = 0;
    puVar2[4] = 0;
    puVar2[5] = 0;
    puVar2[6] = 0;
    *(undefined4 *)((longlong)puVar2 + 0x1c) = 0;
  }
  uVar4 = 0;
  *(undefined1 *)((longlong)puVar2 + 0x11) = 1;
  *(undefined4 *)((longlong)puVar2 + 0x14) = 0x13;
  uVar6 = 0xffffffffffffffff;
  pcVar7 = _Src;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    cVar1 = *pcVar7;
    pcVar7 = pcVar7 + 1;
  } while (cVar1 != '\0');
  uVar5 = (uint)(~uVar6 - 1);
  *(uint *)(puVar2 + 3) = uVar5;
  if (uVar5 < 5) {
    if (uVar5 != 0) {
      memcpy((void *)((longlong)puVar2 + 0x1c),_Src,~uVar6 - 1 & 0xffffffff);
    }
  }
  else {
    pvVar3 = operator_new(0x28);
    if (pvVar3 != (void *)0x0) {
      uVar4 = FUN_1400b8c40(pvVar3);
    }
    puVar2[4] = uVar4;
    FUN_1400b97e0(uVar4,_Src,*(undefined4 *)(puVar2 + 3),param_4,uVar8);
  }
  return puVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_140116bc0(void)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  undefined1 auStack_78 [32];
  ushort local_58;
  ushort local_56;
  ushort local_52;
  ushort local_50;
  ushort local_4e;
  ushort local_4c;
  undefined8 *local_40;
  undefined8 local_38;
  undefined1 local_30;
  undefined1 local_2f;
  undefined1 local_2e;
  undefined1 local_2d;
  undefined1 local_2c;
  undefined1 local_2b;
  undefined1 local_2a;
  undefined1 local_29;
  undefined1 local_28;
  undefined1 local_27;
  undefined1 local_26;
  undefined1 local_25;
  undefined1 local_24;
  ulonglong local_10;
  
  local_38 = 0xfffffffffffffffe;
  local_10 = DAT_1402f85a0 ^ (ulonglong)auStack_78;
  FUN_1400d04a0(&local_58);
  FUN_1400d0640(&local_58);
  local_30 = PTR_s_0123456789_140309878[(int)((((uint)local_58 % 100) / 10) % 10)];
  local_2f = PTR_s_0123456789_140309878[(int)(((uint)local_58 % 100) % 10)];
  local_2e = PTR_s_0123456789_140309878[(int)((local_56 / 10) % 10)];
  local_2d = PTR_s_0123456789_140309878[(int)((uint)local_56 % 10)];
  local_2c = PTR_s_0123456789_140309878[(int)((local_52 / 10) % 10)];
  local_2b = PTR_s_0123456789_140309878[(int)((uint)local_52 % 10)];
  local_2a = PTR_s_0123456789_140309878[(int)((local_50 / 10) % 10)];
  local_29 = PTR_s_0123456789_140309878[(int)((uint)local_50 % 10)];
  local_28 = PTR_s_0123456789_140309878[(int)((local_4e / 10) % 10)];
  local_27 = PTR_s_0123456789_140309878[(int)((uint)local_4e % 10)];
  local_26 = PTR_s_0123456789_140309878[(int)((local_4c / 10) % 10)];
  local_25 = PTR_s_0123456789_140309878[(int)((uint)local_4c % 10)];
  local_24 = 0x5a;
  puVar1 = operator_new(0x38);
  local_40 = puVar1;
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    FUN_1400d0eb0(puVar1);
    *puVar1 = Asn1::vftable;
    *(undefined2 *)(puVar1 + 2) = 0x100;
    *(undefined1 *)((longlong)puVar1 + 0x12) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x14) = 0;
    puVar1[4] = 0;
    puVar1[5] = 0;
    puVar1[6] = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0;
  }
  uVar2 = 0;
  *(undefined1 *)((longlong)puVar1 + 0x11) = 1;
  *(undefined4 *)((longlong)puVar1 + 0x14) = 0x17;
  *(undefined4 *)(puVar1 + 3) = 0xd;
  local_40 = operator_new(0x28);
  if (local_40 != (void *)0x0) {
    uVar2 = FUN_1400b8c40(local_40);
  }
  puVar1[4] = uVar2;
  FUN_1400b97e0(uVar2,&local_30,0xd);
  return puVar1;
}



longlong FUN_140116ec0(char *param_1)

{
  char cVar1;
  longlong lVar2;
  void *pvVar3;
  longlong lVar4;
  uint uVar5;
  ulonglong uVar6;
  char *pcVar7;
  
  if (param_1 != (char *)0x0) {
    uVar6 = 0xffffffffffffffff;
    pcVar7 = param_1;
    do {
      if (uVar6 == 0) break;
      uVar6 = uVar6 - 1;
      cVar1 = *pcVar7;
      pcVar7 = pcVar7 + 1;
    } while (cVar1 != '\0');
    uVar5 = (uint)(~uVar6 - 1);
    if (4 < uVar5) {
      pvVar3 = operator_new(0x38);
      lVar4 = 0;
      lVar2 = lVar4;
      if (pvVar3 != (void *)0x0) {
        lVar2 = FUN_140114be0(pvVar3);
      }
      *(undefined1 *)(lVar2 + 0x11) = 1;
      *(undefined4 *)(lVar2 + 0x14) = 0x17;
      *(uint *)(lVar2 + 0x18) = uVar5;
      pvVar3 = operator_new(0x28);
      if (pvVar3 != (void *)0x0) {
        lVar4 = FUN_1400b8c40(pvVar3);
      }
      *(longlong *)(lVar2 + 0x20) = lVar4;
      FUN_1400b97e0(lVar4,param_1,~uVar6 - 1 & 0xffffffff);
      return lVar2;
    }
  }
  lVar2 = FUN_140116bc0();
  return lVar2;
}



undefined8 * FUN_140116f90(char *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 *puVar2;
  void *pvVar3;
  undefined8 uVar4;
  uint uVar5;
  ulonglong uVar6;
  char *_Src;
  char *pcVar7;
  undefined8 uVar8;
  
  uVar8 = 0xfffffffffffffffe;
  _Src = "";
  if (param_1 != (char *)0x0) {
    _Src = param_1;
  }
  puVar2 = operator_new(0x38);
  if (puVar2 == (undefined8 *)0x0) {
    puVar2 = (undefined8 *)0x0;
  }
  else {
    FUN_1400d0eb0();
    *puVar2 = Asn1::vftable;
    *(undefined2 *)(puVar2 + 2) = 0x100;
    *(undefined1 *)((longlong)puVar2 + 0x12) = 0;
    *(undefined8 *)((longlong)puVar2 + 0x14) = 0;
    puVar2[4] = 0;
    puVar2[5] = 0;
    puVar2[6] = 0;
    *(undefined4 *)((longlong)puVar2 + 0x1c) = 0;
  }
  uVar4 = 0;
  *(undefined1 *)((longlong)puVar2 + 0x11) = 1;
  *(undefined4 *)((longlong)puVar2 + 0x14) = 0xc;
  uVar6 = 0xffffffffffffffff;
  pcVar7 = _Src;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    cVar1 = *pcVar7;
    pcVar7 = pcVar7 + 1;
  } while (cVar1 != '\0');
  uVar5 = (uint)(~uVar6 - 1);
  *(uint *)(puVar2 + 3) = uVar5;
  if (uVar5 < 5) {
    if (uVar5 != 0) {
      memcpy((void *)((longlong)puVar2 + 0x1c),_Src,~uVar6 - 1 & 0xffffffff);
    }
  }
  else {
    pvVar3 = operator_new(0x28);
    if (pvVar3 != (void *)0x0) {
      uVar4 = FUN_1400b8c40(pvVar3);
    }
    puVar2[4] = uVar4;
    FUN_1400b97e0(uVar4,_Src,*(undefined4 *)(puVar2 + 3),param_4,uVar8);
  }
  return puVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

longlong FUN_140117090(undefined8 param_1,undefined8 param_2)

{
  char cVar1;
  undefined4 uVar2;
  uint uVar3;
  longlong lVar4;
  undefined8 *puVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  int iVar8;
  undefined1 auStack_238 [32];
  undefined4 local_218;
  undefined1 *local_210;
  longlong local_208;
  int local_200;
  void *local_1f8;
  undefined8 local_1f0;
  undefined1 local_1e8 [40];
  undefined8 local_1c0;
  undefined1 local_1b8 [48];
  undefined1 local_188 [160];
  undefined1 local_e8 [192];
  ulonglong local_28;
  
  local_1c0 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_238;
  local_1f0 = param_2;
  cVar1 = FUN_140118300(param_1,"sequence");
  if (cVar1 == '\0') {
    cVar1 = FUN_140118300(param_1,&DAT_1402491c0);
    if (cVar1 == '\0') {
      cVar1 = FUN_140118300(param_1,&DAT_1402491b8);
      if (cVar1 == '\0') {
        cVar1 = FUN_140118300(param_1,&DAT_1402420c0);
        if (cVar1 == '\0') {
          cVar1 = FUN_140118300(param_1,&DAT_1402491b0);
          if (cVar1 == '\0') {
            cVar1 = FUN_140118300(param_1,"octets");
            if (cVar1 == '\0') {
              cVar1 = FUN_140118300(param_1,&DAT_140207ba0);
              if (cVar1 == '\0') {
                cVar1 = FUN_140118300(param_1,&DAT_1402491ac);
                if (cVar1 == '\0') {
                  cVar1 = FUN_140118300(param_1,&DAT_1402491a8);
                  if (cVar1 == '\0') {
                    cVar1 = FUN_140118300(param_1,"printable");
                    if (cVar1 == '\0') {
                      cVar1 = FUN_140118300(param_1,&DAT_1402420a0);
                      if (cVar1 == '\0') {
                        cVar1 = FUN_140118300(param_1,"utctime");
                        if (cVar1 == '\0') {
                          cVar1 = FUN_140118300(param_1,"contextSpecific");
                          if (cVar1 == '\0') {
                            cVar1 = FUN_140118300(param_1,&DAT_140249194);
                            if (cVar1 == '\0') {
                              cVar1 = FUN_140118300(param_1,"universal");
                              if ((cVar1 == '\0') ||
                                 (iVar8 = FUN_140118230(param_1,&DAT_1402491a4), iVar8 != 0x1e)) {
                                lVar4 = 0;
                              }
                              else {
                                FUN_1400b8c40(local_1b8);
                                uVar6 = FUN_140118400(param_1);
                                FUN_1400b9f10(local_1b8,uVar6,"base64");
                                FUN_1400c2840(local_e8);
                                FUN_1400b8c40(local_1e8);
                                uVar2 = FUN_1400b8b80(local_1b8);
                                uVar6 = FUN_1400b8b90(local_1b8);
                                local_210 = local_1e8;
                                local_218 = uVar2;
                                FUN_1400cded0(local_e8,0x4b1,0x4b0,uVar6);
                                FUN_1400b6fd0(local_188);
                                uVar3 = FUN_1400b8b80(local_1e8);
                                uVar6 = FUN_1400b8b90(local_1e8);
                                FUN_1400b7c50(local_188,uVar6,uVar3 >> 1);
                                uVar6 = FUN_1400b7ce0(local_188);
                                lVar4 = FUN_140116f90(uVar6);
                                FUN_1400b7090(local_188);
                                FUN_1400b92d0(local_1e8);
                                FUN_1400c2880(local_e8);
                                FUN_1400b92d0(local_1b8);
                              }
                            }
                            else {
                              lVar4 = FUN_140116820();
                              local_208 = lVar4;
                              local_200 = FUN_1401184f0(param_1);
                              iVar8 = 0;
                              if (0 < local_200) {
                                do {
                                  puVar5 = (undefined8 *)FUN_140119050(param_1,iVar8);
                                  lVar4 = local_208;
                                  if (puVar5 != (undefined8 *)0x0) {
                                    local_1f8 = (void *)FUN_140117090(puVar5,local_1f0);
                                    (**(code **)*puVar5)(puVar5,1);
                                    lVar4 = local_208;
                                    if (((local_1f8 != (void *)0x0) &&
                                        (*(char *)(local_208 + 0x11) == '\0')) &&
                                       (*(longlong *)(local_208 + 0x28) != 0)) {
                                      FUN_1400d0c90(*(longlong *)(local_208 + 0x28),local_1f8);
                                    }
                                  }
                                  iVar8 = iVar8 + 1;
                                } while (iVar8 < local_200);
                              }
                            }
                          }
                          else {
                            uVar2 = FUN_140118230(param_1,&DAT_1402491a4);
                            cVar1 = FUN_140118eb0(param_1,"constructed",&DAT_1402793fc);
                            if (cVar1 == '\0') {
                              local_1f8 = operator_new(0x28);
                              if (local_1f8 == (void *)0x0) {
                                uVar6 = 0;
                              }
                              else {
                                uVar6 = FUN_1400b8c40(local_1f8);
                              }
                              uVar7 = FUN_140118400(param_1);
                              FUN_1400b9f10(uVar6,uVar7,"base64");
                              lVar4 = FUN_140115ef0(uVar2,uVar6);
                            }
                            else {
                              lVar4 = FUN_140115e40(uVar2);
                              local_208 = lVar4;
                              local_200 = FUN_1401184f0(param_1);
                              iVar8 = 0;
                              if (0 < local_200) {
                                do {
                                  puVar5 = (undefined8 *)FUN_140119050(param_1,iVar8);
                                  lVar4 = local_208;
                                  if (puVar5 != (undefined8 *)0x0) {
                                    local_1f8 = (void *)FUN_140117090(puVar5,local_1f0);
                                    (**(code **)*puVar5)(puVar5,1);
                                    lVar4 = local_208;
                                    if (((local_1f8 != (void *)0x0) &&
                                        (*(char *)(local_208 + 0x11) == '\0')) &&
                                       (*(longlong *)(local_208 + 0x28) != 0)) {
                                      FUN_1400d0c90(*(longlong *)(local_208 + 0x28),local_1f8);
                                    }
                                  }
                                  iVar8 = iVar8 + 1;
                                } while (iVar8 < local_200);
                              }
                            }
                          }
                        }
                        else {
                          uVar6 = FUN_140118400();
                          lVar4 = FUN_140116ec0(uVar6);
                        }
                      }
                      else {
                        uVar6 = FUN_140118400();
                        lVar4 = FUN_140116f90(uVar6);
                      }
                    }
                    else {
                      uVar6 = FUN_140118400();
                      lVar4 = FUN_140116ac0(uVar6);
                    }
                  }
                  else {
                    uVar6 = FUN_140118400();
                    lVar4 = FUN_1401169c0(uVar6);
                  }
                }
                else {
                  uVar6 = FUN_140118400();
                  lVar4 = FUN_1401168c0(uVar6);
                }
              }
              else {
                uVar6 = FUN_140118400();
                lVar4 = FUN_140116400(uVar6);
              }
            }
            else {
              FUN_1400b8c40(local_1e8);
              uVar6 = FUN_140118400(param_1);
              FUN_1400b9f10(local_1e8,uVar6,"base64");
              uVar2 = FUN_1400b8b80(local_1e8);
              uVar6 = FUN_1400b8b90(local_1e8);
              lVar4 = FUN_140116200(uVar6,uVar2);
              FUN_1400b92d0(local_1e8);
            }
          }
          else {
            FUN_1400b8c40(local_1e8);
            uVar6 = FUN_140118400(param_1);
            FUN_1400b9f10(local_1e8,uVar6,"base64");
            uVar2 = FUN_1400b8b80(local_1e8);
            uVar6 = FUN_1400b8b90(local_1e8);
            lVar4 = FUN_1401162f0(uVar6,uVar2);
            FUN_1400b92d0(local_1e8);
          }
        }
        else {
          FUN_1400b8c40(local_1e8);
          uVar6 = FUN_140118400(param_1);
          FUN_1400b9f10(local_1e8,uVar6,&DAT_1402749dc);
          uVar2 = FUN_1400b8b80(local_1e8);
          uVar6 = FUN_1400b8b90(local_1e8);
          lVar4 = FUN_140116100(uVar6,uVar2,0x13ef,param_2);
          FUN_1400b92d0(local_1e8);
        }
      }
      else {
        iVar8 = FUN_140118210();
        lVar4 = FUN_140115c10(iVar8 != 0);
      }
    }
    else {
      lVar4 = FUN_140116700();
    }
  }
  else {
    lVar4 = FUN_140116780();
    local_208 = lVar4;
    local_200 = FUN_1401184f0(param_1);
    iVar8 = 0;
    if (0 < local_200) {
      do {
        puVar5 = (undefined8 *)FUN_140119050(param_1,iVar8);
        lVar4 = local_208;
        if (puVar5 != (undefined8 *)0x0) {
          local_1f8 = (void *)FUN_140117090(puVar5,local_1f0);
          (**(code **)*puVar5)(puVar5,1);
          lVar4 = local_208;
          if (((local_1f8 != (void *)0x0) && (*(char *)(local_208 + 0x11) == '\0')) &&
             (*(longlong *)(local_208 + 0x28) != 0)) {
            FUN_1400d0c90(*(longlong *)(local_208 + 0x28),local_1f8);
          }
        }
        iVar8 = iVar8 + 1;
      } while (iVar8 < local_200);
    }
  }
  return lVar4;
}



undefined8
FUN_1401176f0(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 uVar2;
  undefined1 local_48 [8];
  undefined8 local_40;
  undefined1 local_38 [48];
  
  local_40 = 0xfffffffffffffffe;
  FUN_1400d0a70(local_38);
  cVar1 = FUN_140114cd0(param_1,param_2,local_38,1,1,local_48,param_3,param_4);
  if (cVar1 == '\0') {
    FUN_1400d0e10(local_38);
    uVar2 = 0;
  }
  else {
    uVar2 = FUN_1400d0aa0(local_38,0);
    FUN_1400d0e10(local_38);
  }
  return uVar2;
}



ulonglong FUN_1401177a0(undefined8 param_1,undefined8 param_2)

{
  byte bVar1;
  int iVar2;
  undefined4 uVar3;
  ulonglong uVar4;
  undefined8 uVar5;
  undefined1 local_30 [40];
  
  FUN_1400b8c40(local_30);
  FUN_140115560(param_1,local_30);
  iVar2 = FUN_1400b8b80(local_30);
  if (iVar2 == 0) {
    uVar4 = FUN_1400b92d0(local_30);
    uVar4 = uVar4 & 0xffffffffffffff00;
  }
  else {
    uVar3 = FUN_1400b8b80(local_30);
    uVar5 = FUN_1400b8b90(local_30);
    bVar1 = FUN_14011e6e0(param_2,uVar5,uVar3);
    FUN_1400b92d0(local_30);
    uVar4 = (ulonglong)bVar1;
  }
  return uVar4;
}



undefined8 * FUN_140117830(undefined8 *param_1,uint param_2)

{
  *param_1 = Asn1::vftable;
  FUN_140114c50();
  FUN_1400d0ee0(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_140117880(undefined8 param_1,undefined8 param_2,byte param_3,int param_4,undefined8 param_5,
             int param_6,undefined8 param_7)

{
  undefined1 uVar1;
  undefined4 uVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  undefined4 uVar6;
  undefined8 uVar7;
  longlong lVar8;
  undefined8 *puVar9;
  longlong lVar10;
  void *pvVar11;
  undefined8 uVar12;
  undefined8 *_Src;
  undefined1 *puVar13;
  int iVar14;
  int iVar15;
  int iVar16;
  ulonglong uVar17;
  undefined8 *puVar18;
  int iVar19;
  int iVar20;
  undefined1 auStack_3a8 [32];
  int local_388;
  undefined4 local_384;
  int local_380;
  void *local_378;
  undefined8 local_370;
  undefined1 local_368 [40];
  undefined1 local_340 [40];
  undefined1 local_318 [32];
  undefined1 local_2f8 [32];
  undefined1 local_2d8 [40];
  undefined1 local_2b0 [40];
  undefined8 local_288;
  undefined1 local_280 [56];
  undefined1 local_248 [512];
  ulonglong local_48;
  
  local_288 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_3a8;
  local_370 = param_7;
  local_380 = param_4;
  FUN_1400b8b30(param_7);
  FUN_1400b8c40(local_368);
  iVar14 = 0;
  FUN_14011d870(local_2f8);
  FUN_14011d870(local_318);
  local_384 = FUN_1400c0890(param_5);
  FUN_1400bcaa0(local_280,param_5);
  cVar3 = FUN_1400bde50(local_280,&DAT_14023f500);
  iVar20 = 0x10;
  if (cVar3 != '\0') {
    iVar20 = 0x14;
  }
  FUN_1400b8c40(local_2d8);
  thunk_FUN_1400b7580(param_1);
  uVar7 = FUN_1400b82d0(param_1);
  FUN_1400b9e90(local_2d8,uVar7);
  lVar8 = FUN_1400b8b90(local_2d8);
  iVar4 = FUN_1400b8b80(local_2d8);
  if (0 < iVar4) {
    puVar13 = (undefined1 *)(lVar8 + 1);
    lVar8 = ((longlong)iVar4 - 1U >> 1) + 1;
    do {
      uVar1 = puVar13[-1];
      puVar13[-1] = *puVar13;
      *puVar13 = uVar1;
      puVar13 = puVar13 + 2;
      lVar8 = lVar8 + -1;
    } while (lVar8 != 0);
  }
  iVar4 = FUN_1400b8b80(param_2);
  iVar5 = FUN_1400b8b80(local_2d8);
  if (0x40 < iVar5) {
    iVar5 = 0x40;
  }
  iVar15 = (int)((iVar4 + 0x3f >> 0x1f & 0x3fU) + iVar4 + 0x3f) >> 6;
  iVar16 = iVar15 * 0x40;
  if (iVar5 != 0) {
    iVar14 = ((int)((iVar5 + 0x3f >> 0x1f & 0x3fU) + iVar5 + 0x3f) >> 6) << 6;
  }
  local_388 = iVar16 + iVar14;
  memset(local_248,(uint)param_3,0x40);
  puVar9 = operator_new((longlong)(iVar16 + 0x200 + iVar14));
  if (puVar9 == (undefined8 *)0x0) {
    FUN_1400b92d0(local_2d8);
    FUN_1400bceb0(local_280);
    FUN_14011d980(local_318);
    FUN_14011d980(local_2f8);
    FUN_1400b92d0(local_368);
    uVar7 = 0;
  }
  else {
    lVar8 = FUN_1400b8b90(param_2);
    lVar10 = FUN_1400b8b90(local_2d8);
    iVar19 = 0;
    puVar18 = puVar9;
    if (0 < iVar15 << 6) {
      do {
        *(undefined1 *)puVar18 = *(undefined1 *)(iVar19 % iVar4 + lVar8);
        puVar18 = (undefined8 *)((longlong)puVar18 + 1);
        iVar19 = iVar19 + 1;
      } while (iVar19 < iVar16);
    }
    iVar4 = 0;
    if (0 < iVar14) {
      do {
        *(undefined1 *)puVar18 = *(undefined1 *)(iVar4 % iVar5 + lVar10);
        puVar18 = (undefined8 *)((longlong)puVar18 + 1);
        iVar4 = iVar4 + 1;
      } while (iVar4 < iVar14);
    }
    FUN_1400b8c40(local_340);
    pvVar11 = operator_new(0x241);
    local_378 = pvVar11;
    if (pvVar11 == (void *)0x0) {
      FUN_1400b92d0(local_340);
      FUN_1400b92d0(local_2d8);
      FUN_1400bceb0(local_280);
      FUN_14011d980(local_318);
      FUN_14011d980(local_2f8);
      FUN_1400b92d0(local_368);
      uVar7 = 0;
    }
    else {
      FUN_1400b8c40(local_2b0);
      uVar7 = local_370;
      uVar2 = local_384;
      iVar14 = local_388;
      while( true ) {
        FUN_1400b8b30(local_340);
        FUN_1400b97e0(local_340,local_248,0x40);
        FUN_1400b97e0(local_340,puVar9,iVar14);
        FUN_1400b8b30(local_368);
        uVar6 = FUN_1400b8b80(local_340);
        uVar12 = FUN_1400b8b90(local_340);
        FUN_1400c0a70(uVar12,uVar6,uVar2);
        if (1 < local_380) {
          uVar17 = (ulonglong)(local_380 - 1);
          do {
            FUN_1400b8b30(local_340);
            FUN_1400b9e90(local_340,local_368);
            FUN_1400b8b30(local_368);
            uVar6 = FUN_1400b8b80(local_340);
            uVar12 = FUN_1400b8b90(local_340);
            FUN_1400c0a70(uVar12,uVar6,uVar2);
            uVar17 = uVar17 - 1;
            pvVar11 = local_378;
          } while (uVar17 != 0);
        }
        uVar12 = FUN_1400b8b90(local_368);
        if (param_6 <= iVar20) break;
        FUN_1400b97e0(uVar7,uVar12);
        param_6 = param_6 - iVar20;
        lVar8 = FUN_1400b8b90(local_368);
        iVar4 = 0;
        lVar10 = 0;
        do {
          *(undefined1 *)(lVar10 + (longlong)pvVar11) = *(undefined1 *)(iVar4 % iVar20 + lVar8);
          iVar4 = iVar4 + 1;
          lVar10 = lVar10 + 1;
        } while (lVar10 < 0x40);
        FUN_14011e6e0(local_318,pvVar11,0x40);
        FUN_14011def0(local_318,1,local_318);
        if (0 < iVar14) {
          uVar17 = (ulonglong)((iVar14 - 1U >> 6) + 1);
          puVar18 = puVar9;
          do {
            FUN_14011e6e0(local_2f8,puVar18,0x40);
            FUN_14011fe40(local_2f8,local_318,local_2f8);
            FUN_1400b8b30(local_2b0);
            FUN_140122fa0(local_2f8);
            iVar14 = FUN_1400b8b80(local_2b0);
            _Src = (undefined8 *)FUN_1400b8b90(local_2b0);
            if (iVar14 < 0x41) {
              if (0x3f < iVar14) {
                *puVar18 = *_Src;
                puVar18[1] = _Src[1];
                puVar18[2] = _Src[2];
                puVar18[3] = _Src[3];
                puVar18[4] = _Src[4];
                puVar18[5] = _Src[5];
                puVar18[6] = _Src[6];
                uVar7 = _Src[7];
                goto LAB_140117dbe;
              }
              memset(puVar18,0,(longlong)(0x40 - iVar14));
              memcpy((undefined1 *)((longlong)puVar18 + (0x40 - (longlong)iVar14)),_Src,
                     (longlong)iVar14);
            }
            else {
              *puVar18 = *(undefined8 *)((longlong)_Src + 1);
              puVar18[1] = *(undefined8 *)((longlong)_Src + 9);
              puVar18[2] = *(undefined8 *)((longlong)_Src + 0x11);
              puVar18[3] = *(undefined8 *)((longlong)_Src + 0x19);
              puVar18[4] = *(undefined8 *)((longlong)_Src + 0x21);
              puVar18[5] = *(undefined8 *)((longlong)_Src + 0x29);
              puVar18[6] = *(undefined8 *)((longlong)_Src + 0x31);
              uVar7 = *(undefined8 *)((longlong)_Src + 0x39);
LAB_140117dbe:
              puVar18[7] = uVar7;
            }
            puVar18 = puVar18 + 8;
            uVar17 = uVar17 - 1;
            pvVar11 = local_378;
            uVar7 = local_370;
            uVar2 = local_384;
            iVar14 = local_388;
          } while (uVar17 != 0);
        }
      }
      FUN_1400b97e0(uVar7,uVar12,param_6);
      operator_delete(puVar9);
      operator_delete(pvVar11);
      FUN_1400b92d0(local_2b0);
      FUN_1400b92d0(local_340);
      FUN_1400b92d0(local_2d8);
      FUN_1400bceb0(local_280);
      FUN_14011d980(local_318);
      FUN_14011d980(local_2f8);
      FUN_1400b92d0(local_368);
      uVar7 = 1;
    }
  }
  return uVar7;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_140117e70(undefined8 param_1,undefined8 param_2,undefined8 param_3,int param_4,
                       undefined8 param_5,undefined4 param_6,undefined8 param_7,undefined8 param_8,
                       longlong *param_9)

{
  char cVar1;
  byte bVar2;
  undefined4 uVar3;
  ulonglong uVar4;
  undefined1 auStack_de8 [32];
  undefined8 local_dc8;
  int local_dc0;
  undefined1 *local_db8;
  longlong *local_db0;
  undefined8 local_da8;
  undefined8 local_da0;
  undefined1 local_d98 [40];
  undefined8 local_d70;
  undefined1 local_d68 [48];
  undefined1 local_d38 [3296];
  ulonglong local_58;
  
  local_d70 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_de8;
  local_da8 = param_7;
  local_da0 = param_8;
  FUN_1400b8b30(param_8);
  FUN_1400b0310(local_d38);
  FUN_1400b3440(local_d38,param_3);
  FUN_1400b35e0(local_d38,param_4);
  FUN_1400b35d0(local_d38,param_4);
  FUN_1400b0210(local_d38,0);
  FUN_1400b0220(local_d38,0);
  uVar3 = FUN_1400b0230(local_d38);
  FUN_1400b8c40(local_d98);
  local_dc0 = (int)(param_4 + (param_4 >> 0x1f & 7U)) >> 3;
  local_db0 = param_9;
  local_db8 = local_d98;
  local_dc8 = param_2;
  cVar1 = FUN_140117880(param_1,param_5,1,param_6);
  if (cVar1 == '\0') {
    (**(code **)(*param_9 + 0x28))(param_9,"PKCS12 derive key failed.");
    FUN_1400b92d0(local_d98);
    uVar4 = FUN_1400b0680(local_d38);
    uVar4 = uVar4 & 0xffffffffffffff00;
  }
  else {
    FUN_1400b8c40(local_d68);
    local_db0 = param_9;
    local_db8 = local_d68;
    local_dc8 = param_2;
    local_dc0 = uVar3;
    cVar1 = FUN_140117880(param_1,param_5,2,param_6);
    if (cVar1 == '\0') {
      (**(code **)(*param_9 + 0x28))(param_9,"PKCS12 derive IV failed.");
      FUN_1400b92d0(local_d68);
      FUN_1400b92d0(local_d98);
      uVar4 = FUN_1400b0680(local_d38);
      uVar4 = uVar4 & 0xffffffffffffff00;
    }
    else {
      FUN_1400b0190(local_d38,local_d98);
      FUN_1400b35f0(local_d38,local_d68);
      bVar2 = FUN_1400b66d0(local_d38,local_da8,local_da0,param_9);
      FUN_1400b92d0(local_d68);
      FUN_1400b92d0(local_d98);
      FUN_1400b0680(local_d38);
      uVar4 = (ulonglong)bVar2;
    }
  }
  return uVar4;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_140118090(undefined8 *param_1)

{
  longlong lVar1;
  undefined1 auStack_78 [32];
  undefined8 *local_58;
  undefined8 local_50;
  char local_48 [56];
  ulonglong local_10;
  
  local_50 = 0xfffffffffffffffe;
  local_10 = DAT_1402f85a0 ^ (ulonglong)auStack_78;
  local_58 = param_1;
  FUN_1400afba0();
  FUN_1400d1210(param_1 + 0x2b);
  *param_1 = ClsXml::vftable;
  param_1[0x2b] = ClsXml::vftable;
  *(undefined1 *)(param_1 + 0x31) = 0;
  param_1[0x32] = 0;
  sprintf(local_48,"%d");
  lVar1 = FUN_14013c660("unnamed");
  param_1[0x32] = lVar1;
  if (lVar1 != 0) {
    FUN_14013ae10(lVar1);
  }
  return param_1;
}



void FUN_140118160(undefined8 *param_1)

{
  int iVar1;
  
  *param_1 = ClsXml::vftable;
  param_1[0x2b] = ClsXml::vftable;
  FUN_1400d1280(param_1 + 0x2b);
  if ((param_1[0x32] != 0) && (*(char *)(param_1[0x32] + 0x58) == -0x32)) {
    FUN_14013ae30();
    iVar1 = FUN_14013adf0(param_1[0x32]);
    if (iVar1 == 0) {
      FUN_14013ae70(param_1[0x32]);
    }
    param_1[0x32] = 0;
  }
  FUN_1400d1290(param_1 + 0x2b);
  FUN_1400d1240(param_1 + 0x2b);
  FUN_1400afc00(param_1);
  return;
}



undefined8 FUN_140118210(longlong param_1)

{
  undefined8 uVar1;
  
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    uVar1 = FUN_14013a560();
    return uVar1;
  }
  return 0;
}



undefined4 FUN_140118230(longlong param_1,undefined8 param_2)

{
  char cVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined1 local_70 [48];
  undefined1 local_40 [56];
  
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    FUN_1400bcc20(local_40);
    FUN_1400bcc20(local_70);
    FUN_1400bc640(local_70,param_2);
    FUN_1400bbc30(local_70);
    uVar3 = FUN_1400b8b90(local_70);
    cVar1 = FUN_14013abf0(*(undefined8 *)(param_1 + 400),uVar3,local_40);
    if (cVar1 != '\0') {
      uVar2 = FUN_1400bc3a0(local_40);
      FUN_1400bceb0(local_70);
      FUN_1400bceb0(local_40);
      return uVar2;
    }
    FUN_1400bceb0(local_70);
    FUN_1400bceb0(local_40);
  }
  return 0;
}



ulonglong FUN_140118300(longlong param_1,char *param_2)

{
  char cVar1;
  char cVar2;
  ulonglong in_RAX;
  undefined1 *puVar3;
  char *pcVar4;
  longlong lVar5;
  undefined1 *puVar6;
  
  if ((*(longlong *)(param_1 + 400) == 0) ||
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) != -0x32)) {
    return in_RAX & 0xffffffffffffff00;
  }
  pcVar4 = "";
  if (param_2 != (char *)0x0) {
    pcVar4 = param_2;
  }
  puVar3 = (undefined1 *)FUN_14013b950();
  puVar6 = &DAT_14027a10a;
  if (puVar3 != (undefined1 *)0x0) {
    puVar6 = puVar3;
  }
  lVar5 = (longlong)puVar6 - (longlong)pcVar4;
  do {
    cVar1 = *pcVar4;
    cVar2 = pcVar4[lVar5];
    if (cVar1 != cVar2) break;
    pcVar4 = pcVar4 + 1;
  } while (cVar2 != '\0');
  return (ulonglong)(cVar1 == cVar2);
}



ulonglong FUN_140118380(longlong param_1,char *param_2)

{
  char cVar1;
  char cVar2;
  ulonglong in_RAX;
  undefined1 *puVar3;
  char *pcVar4;
  longlong lVar5;
  undefined1 *puVar6;
  
  if ((*(longlong *)(param_1 + 400) == 0) ||
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) != -0x32)) {
    return in_RAX & 0xffffffffffffff00;
  }
  pcVar4 = "";
  if (param_2 != (char *)0x0) {
    pcVar4 = param_2;
  }
  puVar3 = (undefined1 *)FUN_14013a540();
  puVar6 = &DAT_14027a10a;
  if (puVar3 != (undefined1 *)0x0) {
    puVar6 = puVar3;
  }
  lVar5 = (longlong)puVar6 - (longlong)pcVar4;
  do {
    cVar1 = *pcVar4;
    cVar2 = pcVar4[lVar5];
    if (cVar1 != cVar2) break;
    pcVar4 = pcVar4 + 1;
  } while (cVar2 != '\0');
  return (ulonglong)(cVar1 == cVar2);
}



undefined1 * FUN_140118400(longlong param_1)

{
  undefined1 *puVar1;
  
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    FUN_1400d1280(param_1 + 0x158);
    puVar1 = (undefined1 *)FUN_14013a540(*(undefined8 *)(param_1 + 400));
    FUN_1400d1290(param_1 + 0x158);
    return puVar1;
  }
  return &DAT_14027a10a;
}



undefined8 FUN_140118470(longlong param_1)

{
  undefined8 uVar1;
  
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    uVar1 = FUN_14013a520();
    return uVar1;
  }
  return 0;
}



undefined1 FUN_140118490(longlong param_1,undefined8 param_2)

{
  undefined8 uVar1;
  char cVar2;
  
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    cVar2 = FUN_14013aad0();
    if (cVar2 != '\0') {
      uVar1 = FUN_14013a540(*(undefined8 *)(param_1 + 400));
      FUN_1400bdb00(param_2,uVar1);
    }
    return 1;
  }
  return 0;
}



undefined4 FUN_1401184f0(longlong param_1)

{
  undefined4 uVar1;
  
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    FUN_1400d1280(param_1 + 0x158);
    uVar1 = FUN_14013a4e0(*(undefined8 *)(param_1 + 400));
    FUN_1400d1290(param_1 + 0x158);
    return uVar1;
  }
  return 0;
}



undefined8 FUN_140118550(longlong param_1,undefined8 param_2,undefined1 param_3,undefined8 param_4)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  longlong local_48 [2];
  undefined1 local_38 [48];
  
  local_48[1] = 0xfffffffffffffffe;
  FUN_1400bcc20(local_38);
  FUN_1400bc640(local_38,param_2);
  FUN_1400bbc30(local_38);
  uVar3 = 0;
  local_48[0] = 0;
  uVar2 = FUN_1400b8b90(local_38);
  FUN_14013db80(uVar2,param_4,0,local_48,param_3);
  if (local_48[0] != 0) {
    if ((*(longlong *)(param_1 + 400) != 0) &&
       (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
      FUN_14013ae30();
      iVar1 = FUN_14013adf0(*(undefined8 *)(param_1 + 400));
      if (iVar1 == 0) {
        FUN_14013ae70(*(undefined8 *)(param_1 + 400));
      }
      *(undefined8 *)(param_1 + 400) = 0;
    }
    *(longlong *)(param_1 + 400) = local_48[0];
    FUN_14013ae10(local_48[0]);
    uVar3 = 1;
  }
  FUN_1400bceb0(local_38);
  return uVar3;
}



undefined1 FUN_140118650(longlong param_1,undefined8 param_2,undefined1 param_3)

{
  undefined1 uVar1;
  
  FUN_1400d1280(param_1 + 0x158);
  (**(code **)(*(longlong *)(param_1 + 0x10) + 0x40))(param_1 + 0x10);
  (**(code **)(*(longlong *)(param_1 + 0x10) + 0x48))(param_1 + 0x10,"LoadXmlFile",1);
  (**(code **)(*(longlong *)(param_1 + 0x10) + 0x58))(param_1 + 0x10,"filename",param_2);
  uVar1 = FUN_140118550(param_1,param_2,param_3,param_1 + 0x10);
  FUN_1400afe40(param_1,uVar1);
  (**(code **)(*(longlong *)(param_1 + 0x10) + 0x50))(param_1 + 0x10);
  FUN_1400d1290(param_1 + 0x158);
  return uVar1;
}



ulonglong FUN_140118710(longlong param_1,char *param_2,undefined8 param_3,longlong *param_4)

{
  char cVar1;
  int iVar2;
  ulonglong uVar3;
  char *pcVar4;
  longlong lVar5;
  char *pcVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  char *pcVar9;
  undefined8 uVar10;
  char *pcVar11;
  undefined1 *puVar12;
  longlong lVar13;
  byte bVar14;
  undefined1 local_1f8 [48];
  undefined1 local_1c8 [48];
  undefined1 local_198 [48];
  undefined1 local_168 [48];
  undefined1 local_138 [48];
  undefined1 local_108 [48];
  undefined1 local_d8 [48];
  undefined8 local_a8;
  undefined1 local_a0 [48];
  undefined1 local_70 [56];
  
  local_a8 = 0xfffffffffffffffe;
  uVar3 = FUN_1400b7180(param_3);
  lVar13 = *(longlong *)(param_1 + 400);
  if (((lVar13 == 0) || (*(char *)(lVar13 + 0x58) != -0x32)) || (param_2 == (char *)0x0)) {
    return uVar3 & 0xffffffffffffff00;
  }
  bVar14 = 1;
  FUN_1400bcc20(local_1f8);
  FUN_1400bcc20(local_1c8);
  FUN_1400bcc20(local_198);
  if (*param_2 == '\0') {
LAB_140118c95:
    cVar1 = *param_2;
    if (cVar1 != '\0') {
      if (cVar1 == '*') {
        uVar7 = FUN_14013a540(lVar13);
        FUN_1400b86c0(param_3,uVar7);
        bVar14 = 1;
      }
      else {
        if (cVar1 == '$') {
          bVar14 = 1;
          if ((lVar13 == 0) || (lVar5 = *(longlong *)(param_1 + 400), lVar13 == lVar5))
          goto LAB_140118db4;
          if (*(char *)(lVar13 + 0x58) == -0x32) {
            *(longlong *)(param_1 + 400) = lVar13;
            FUN_14013ae10(lVar13);
            FUN_14013ae30(lVar5);
            goto LAB_140118db4;
          }
        }
        else if (cVar1 == '(') {
          FUN_1400bcc20(local_a0);
          param_2 = param_2 + 1;
          pcVar4 = strchr(param_2,0x29);
          if (pcVar4 == (char *)0x0) {
            FUN_1400bc640(local_a0,param_2);
          }
          else {
            FUN_1400bc8a0(local_a0,param_2,(int)pcVar4 - (int)param_2);
          }
          FUN_1400bcc20(local_70);
          uVar7 = FUN_1400b8b90(local_a0);
          bVar14 = FUN_14013abf0(lVar13,uVar7,local_70);
          if (bVar14 != 0) {
            uVar7 = FUN_1400b8b90(local_70);
            FUN_1400b86c0(param_3,uVar7);
          }
          FUN_1400bceb0(local_70);
          puVar12 = local_a0;
LAB_140118daa:
          FUN_1400bceb0(puVar12);
          goto LAB_140118db4;
        }
LAB_140118db1:
        bVar14 = 0;
      }
    }
  }
  else {
    do {
      pcVar4 = strchr(param_2,0x7c);
      if (pcVar4 == (char *)0x0) goto LAB_140118c95;
      FUN_1400bbe30(local_1f8);
      FUN_1400bc8a0(local_1f8,param_2,(int)pcVar4 - (int)param_2);
      cVar1 = FUN_1400bdf70(local_1f8,&DAT_14020910c);
      if (cVar1 == '\0') {
        cVar1 = FUN_1400bc7e0(local_1f8,&DAT_14024942c);
        if (cVar1 != '\0') {
          lVar5 = FUN_1400b8b90();
          lVar5 = FUN_14013c130(lVar13,0,lVar5 + 3);
          goto LAB_140118ba2;
        }
        cVar1 = FUN_1400bc7e0(local_1f8,&DAT_140249428);
        if (cVar1 == '\0') {
          cVar1 = FUN_1400bc7e0(local_1f8,&DAT_140249424);
          if (cVar1 == '\0') {
            cVar1 = FUN_1400bc610(local_1f8,0x5b);
            if (cVar1 == '\0') {
              cVar1 = FUN_1400bc610(local_1f8,0x7b);
              if (cVar1 == '\0') {
                iVar2 = FUN_1400bbb10(local_1f8);
                if (iVar2 == 0) goto LAB_140118bcb;
                uVar7 = FUN_1400b8b90(local_1f8);
                goto LAB_140118b97;
              }
              pcVar9 = (char *)FUN_1400b8b90();
              pcVar6 = strchr(pcVar9,0x7b);
              pcVar11 = strchr(pcVar9,0x7d);
              if (pcVar11 != (char *)0x0) {
                FUN_1400bbe30(local_1c8);
                iVar2 = (int)(pcVar6 + 1);
                FUN_1400bc8a0(local_1c8,pcVar9,(iVar2 - (int)pcVar9) + -1);
                FUN_1400bdc90(local_1f8,local_1c8);
                FUN_1400bbe30(local_198);
                FUN_1400bc8a0(local_198,pcVar6 + 1,(int)pcVar11 - iVar2);
              }
              uVar7 = FUN_1400b8b90(local_198);
              lVar5 = FUN_14013ab20(lVar13,0,uVar7);
            }
            else {
              pcVar9 = (char *)FUN_1400b8b90();
              pcVar6 = strchr(pcVar9,0x5b);
              iVar2 = sscanf(pcVar6 + 1,"%d");
              if (iVar2 == 1) {
                FUN_1400bbe30(local_1c8);
                FUN_1400bc8a0(local_1c8,pcVar9,((int)(pcVar6 + 1) - (int)pcVar9) + -1);
                FUN_1400bdc90(local_1f8,local_1c8);
                FUN_1400bbc30(local_1f8);
              }
              iVar2 = FUN_1400bbb10(local_1f8);
              if (iVar2 == 0) {
                lVar5 = FUN_14013a500(lVar13,0);
              }
              else {
                uVar7 = FUN_1400b8b90(local_1f8);
LAB_140118b97:
                lVar5 = FUN_14013bbd0(lVar13,0,uVar7);
              }
            }
            goto LAB_140118ba2;
          }
          lVar5 = FUN_1400b8b90();
          pcVar9 = (char *)(lVar5 + 3);
          FUN_1400bcc20(local_108);
          FUN_1400bcc20(local_138);
          FUN_1400bcc20(local_d8);
          pcVar6 = strchr(pcVar9,0x2c);
          if (pcVar6 != (char *)0x0) {
            FUN_1400bc8a0(local_108,pcVar9,(int)pcVar6 - (int)pcVar9);
            pcVar6 = pcVar6 + 1;
            pcVar9 = strchr(pcVar6,0x2c);
            if (pcVar9 != (char *)0x0) {
              FUN_1400bc8a0(local_138,pcVar6,(int)pcVar9 - (int)pcVar6);
              FUN_1400bc640(local_d8,pcVar9 + 1);
              uVar7 = FUN_1400b8b90(local_d8);
              uVar8 = FUN_1400b8b90(local_138);
              uVar10 = FUN_1400b8b90(local_108);
              lVar5 = FUN_14013bf30(lVar13,0,uVar10,uVar8,uVar7);
              if (lVar5 == 0) {
                bVar14 = 0;
                FUN_1400bceb0(local_d8);
                FUN_1400bceb0(local_138);
                FUN_1400bceb0(local_108);
              }
              else {
                if (*(char *)(lVar5 + 0x58) == -0x32) {
                  FUN_14013ae10(lVar5);
                  FUN_14013ae30(lVar13);
                  FUN_1400bceb0(local_d8);
                  FUN_1400bceb0(local_138);
                  FUN_1400bceb0(local_108);
                  lVar13 = lVar5;
                  goto LAB_140118bcb;
                }
                bVar14 = 0;
                FUN_1400bceb0(local_d8);
                FUN_1400bceb0(local_138);
                FUN_1400bceb0(local_108);
              }
              break;
            }
          }
          lVar13 = *param_4;
          uVar7 = FUN_1400b8b90(local_1f8);
          (**(code **)(lVar13 + 0x58))(param_4,"InvalidCmd",uVar7);
          bVar14 = 0;
          FUN_1400bceb0(local_d8);
          FUN_1400bceb0(local_138);
          puVar12 = local_108;
          goto LAB_140118daa;
        }
        lVar5 = FUN_1400b8b90();
        pcVar9 = (char *)(lVar5 + 3);
        FUN_1400bbe30(local_198);
        FUN_1400bcc20(local_168);
        pcVar6 = strchr(pcVar9,0x2c);
        puVar12 = local_168;
        if (pcVar6 != (char *)0x0) {
          FUN_1400bc8a0(puVar12,pcVar9,(int)pcVar6 - (int)pcVar9);
          pcVar9 = pcVar6 + 1;
          puVar12 = local_198;
        }
        FUN_1400bc640(puVar12,pcVar9);
        uVar7 = FUN_1400b8b90(local_198);
        uVar8 = FUN_1400b8b90(local_168);
        lVar5 = FUN_14013c310(lVar13,0,uVar8,uVar7);
        if (lVar5 == 0) {
          bVar14 = 0;
          FUN_1400bceb0(local_168);
          break;
        }
        if (*(char *)(lVar5 + 0x58) != -0x32) {
          bVar14 = 0;
          FUN_1400bceb0(local_168);
          break;
        }
        FUN_14013ae10(lVar5);
        FUN_14013ae30(lVar13);
        FUN_1400bceb0(local_168);
        lVar13 = lVar5;
      }
      else {
        lVar5 = FUN_14013acd0(lVar13);
LAB_140118ba2:
        if ((lVar5 == 0) || (*(char *)(lVar5 + 0x58) != -0x32)) goto LAB_140118db1;
        FUN_14013ae10(lVar5);
        FUN_14013ae30(lVar13);
        lVar13 = lVar5;
      }
LAB_140118bcb:
      param_2 = pcVar4 + 1;
    } while (*param_2 != '\0');
  }
LAB_140118db4:
  FUN_1400bceb0(local_198);
  FUN_1400bceb0(local_1c8);
  FUN_1400bceb0(local_1f8);
  return (ulonglong)bVar14;
}



undefined8 FUN_140118e00(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    FUN_1400bbe30(param_2);
    FUN_1400d1280(param_1 + 0x158);
    if (*(longlong *)(param_1 + 400) != 0) {
      lVar1 = FUN_14013ace0();
      if (lVar1 == *(longlong *)(param_1 + 400)) {
        FUN_14013dd10(*(longlong *)(param_1 + 400),&DAT_1402083e0);
      }
      FUN_14013bca0(*(undefined8 *)(param_1 + 400),param_2,0,0,0);
    }
    FUN_1400d1290(param_1 + 0x158);
    return 1;
  }
  return 0;
}



ulonglong FUN_140118eb0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  byte bVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 local_40 [56];
  
  uVar4 = 0xfffffffffffffffe;
  uVar2 = *(ulonglong *)(param_1 + 400);
  if ((uVar2 == 0) || (*(char *)(uVar2 + 0x58) != -0x32)) {
    uVar2 = uVar2 & 0xffffffffffffff00;
  }
  else {
    FUN_1400bcc20(local_40);
    FUN_1400bc640(local_40,param_2);
    FUN_1400bbc30(local_40);
    uVar3 = FUN_1400b8b90(local_40);
    bVar1 = FUN_14013ab00(*(undefined8 *)(param_1 + 400),uVar3,param_3,param_4,uVar4);
    FUN_1400bceb0(local_40);
    uVar2 = (ulonglong)bVar1;
  }
  return uVar2;
}



longlong FUN_140118f50(undefined8 param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  void *pvVar2;
  longlong lVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  pvVar2 = operator_new(0x198);
  if (pvVar2 == (void *)0x0) {
    lVar3 = 0;
  }
  else {
    lVar3 = FUN_140118090(pvVar2);
  }
  if (lVar3 == 0) {
    lVar3 = 0;
  }
  else if ((param_2 != 0) && (*(char *)(param_2 + 0x58) == -0x32)) {
    puVar1 = *(undefined8 **)(lVar3 + 400);
    if ((puVar1 != (undefined8 *)0x0) && (*(char *)(puVar1 + 0xb) == -0x32)) {
      (**(code **)*puVar1)(puVar1,1,param_3,param_4,uVar4);
    }
    *(longlong *)(lVar3 + 400) = param_2;
    FUN_14013ae10(param_2);
  }
  return lVar3;
}



undefined1 FUN_140118fe0(longlong param_1)

{
  undefined8 uVar1;
  longlong lVar2;
  
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    lVar2 = FUN_14013a500();
    if ((lVar2 != 0) && (*(char *)(lVar2 + 0x58) == -0x32)) {
      uVar1 = *(undefined8 *)(param_1 + 400);
      *(longlong *)(param_1 + 400) = lVar2;
      FUN_14013ae10(lVar2);
      FUN_14013ae30(uVar1);
      return 1;
    }
  }
  return 0;
}



undefined8 FUN_140119050(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    FUN_1400d1280(param_1 + 0x158);
    uVar2 = 0;
    lVar1 = FUN_14013a500(*(undefined8 *)(param_1 + 400),param_2);
    if ((lVar1 != 0) && (*(char *)(lVar1 + 0x58) == -0x32)) {
      uVar2 = FUN_140118f50(param_1,lVar1,100);
    }
    FUN_1400d1290(param_1 + 0x158);
    return uVar2;
  }
  return 0;
}



void FUN_1401190f0(longlong param_1)

{
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    FUN_14013aea0();
  }
  return;
}



ulonglong FUN_140119110(longlong param_1,undefined8 param_2,char *param_3,undefined8 param_4)

{
  char cVar1;
  char cVar2;
  undefined8 uVar3;
  longlong lVar4;
  undefined1 *puVar5;
  ulonglong uVar6;
  char *pcVar7;
  undefined1 *puVar8;
  undefined8 uVar9;
  undefined1 local_40 [56];
  
  uVar9 = 0xfffffffffffffffe;
  uVar6 = *(ulonglong *)(param_1 + 400);
  if ((uVar6 != 0) && (*(char *)(uVar6 + 0x58) == -0x32)) {
    pcVar7 = "";
    if (param_3 != (char *)0x0) {
      pcVar7 = param_3;
    }
    FUN_1400bcc20(local_40);
    FUN_1400bc640(local_40,param_2);
    FUN_1400bbc30(local_40);
    uVar3 = FUN_1400b8b90(local_40);
    lVar4 = FUN_14013bad0(*(undefined8 *)(param_1 + 400),uVar3,0,param_4,uVar9);
    if ((lVar4 != 0) && (*(char *)(lVar4 + 0x58) == -0x32)) {
      puVar5 = (undefined1 *)FUN_14013a540(lVar4);
      puVar8 = &DAT_14027a10a;
      if (puVar5 != (undefined1 *)0x0) {
        puVar8 = puVar5;
      }
      lVar4 = (longlong)puVar8 - (longlong)pcVar7;
      do {
        cVar1 = *pcVar7;
        cVar2 = pcVar7[lVar4];
        if (cVar1 != cVar2) break;
        pcVar7 = pcVar7 + 1;
      } while (cVar2 != '\0');
      FUN_1400bceb0(local_40);
      return (ulonglong)(cVar1 == cVar2);
    }
    uVar6 = FUN_1400bceb0(local_40);
  }
  return uVar6 & 0xffffffffffffff00;
}



undefined8 FUN_140119210(longlong param_1)

{
  longlong lVar1;
  undefined8 uVar2;
  
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    FUN_1400d1280(param_1 + 0x158);
    lVar1 = *(longlong *)(param_1 + 400);
    uVar2 = 0;
    if ((lVar1 != 0) && (*(char *)(lVar1 + 0x58) == -0x32)) {
      uVar2 = FUN_140118f50(param_1,lVar1,0x6f);
    }
    FUN_1400d1290(param_1 + 0x158);
    return uVar2;
  }
  return 0;
}



undefined1 FUN_140119290(longlong param_1)

{
  undefined8 uVar1;
  longlong lVar2;
  
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    lVar2 = FUN_14013acd0();
    if ((lVar2 != 0) && (*(char *)(lVar2 + 0x58) == -0x32)) {
      uVar1 = *(undefined8 *)(param_1 + 400);
      *(longlong *)(param_1 + 400) = lVar2;
      FUN_14013ae10(lVar2);
      FUN_14013ae30(uVar1);
      return 1;
    }
  }
  return 0;
}



void FUN_140119300(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    lVar2 = FUN_14013ace0();
    lVar1 = *(longlong *)(param_1 + 400);
    if ((lVar2 != lVar1) && ((lVar2 != 0 && (*(char *)(lVar2 + 0x58) == -0x32)))) {
      *(longlong *)(param_1 + 400) = lVar2;
      FUN_14013ae10(lVar2);
      FUN_14013ae30(lVar1);
    }
  }
  return;
}



undefined8 FUN_140119360(longlong param_1)

{
  int iVar1;
  undefined8 uVar2;
  
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    FUN_1400d1280(param_1 + 0x158);
    if ((*(longlong *)(param_1 + 400) != 0) &&
       (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
      FUN_14013ae30();
      iVar1 = FUN_14013adf0(*(undefined8 *)(param_1 + 400));
      if (iVar1 == 0) {
        FUN_14013ae70(*(undefined8 *)(param_1 + 400));
      }
      *(undefined8 *)(param_1 + 400) = 0;
    }
    uVar2 = FUN_14013c660("unnamed");
    *(undefined8 *)(param_1 + 400) = uVar2;
    FUN_14013ae10(uVar2);
    FUN_1400d1290(param_1 + 0x158);
    return 1;
  }
  return 0;
}



undefined1 FUN_140119410(longlong param_1)

{
  undefined8 uVar1;
  longlong lVar2;
  
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    lVar2 = FUN_14013add0();
    if ((lVar2 != 0) && (*(char *)(lVar2 + 0x58) == -0x32)) {
      uVar1 = *(undefined8 *)(param_1 + 400);
      *(longlong *)(param_1 + 400) = lVar2;
      FUN_14013ae10(lVar2);
      FUN_14013ae30(uVar1);
      return 1;
    }
  }
  return 0;
}



undefined1 FUN_140119480(longlong param_1)

{
  undefined8 uVar1;
  longlong lVar2;
  
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    lVar2 = FUN_14013a580();
    if ((lVar2 != 0) && (*(char *)(lVar2 + 0x58) == -0x32)) {
      uVar1 = *(undefined8 *)(param_1 + 400);
      *(longlong *)(param_1 + 400) = lVar2;
      FUN_14013ae10(lVar2);
      FUN_14013ae30(uVar1);
      return 1;
    }
  }
  return 0;
}



undefined8 FUN_1401194f0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  longlong lVar1;
  undefined8 uVar2;
  
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    FUN_1400bbe30(param_3);
    lVar1 = FUN_14013bbd0(*(undefined8 *)(param_1 + 400),0,param_2);
    if ((lVar1 != 0) && (*(char *)(lVar1 + 0x58) == -0x32)) {
      uVar2 = FUN_14013a540(lVar1);
      FUN_1400bc640(param_3,uVar2);
      return 1;
    }
  }
  return 0;
}



void FUN_140119580(longlong param_1)

{
  FUN_140119590(param_1 + -0x158);
  return;
}



void * FUN_140119590(void *param_1,uint param_2)

{
  FUN_140118160();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined1 FUN_1401195c0(longlong param_1,char *param_2,undefined1 param_3)

{
  longlong *plVar1;
  char cVar2;
  undefined1 uVar3;
  int iVar4;
  char *pcVar5;
  undefined1 *puVar6;
  longlong local_res10;
  undefined1 local_80 [48];
  undefined1 local_50 [56];
  
  if (param_2 != (char *)0x0) {
    pcVar5 = strchr(param_2,0x3c);
    if (pcVar5 == (char *)0x0) {
      FUN_1400bcaa0(local_80,param_2);
      FUN_1400bbc30(local_80);
      iVar4 = FUN_1400bbb10(local_80);
      if (iVar4 < 100) {
        FUN_1400bd760(local_80);
        cVar2 = FUN_1400bc770(local_80,&DAT_140283d80);
        if (cVar2 != '\0') {
          uVar3 = FUN_140118650(param_1,param_2,param_3);
          puVar6 = local_80;
          goto LAB_140119757;
        }
      }
      FUN_1400bceb0(local_80);
    }
  }
  FUN_1400d1280(param_1 + 0x158);
  plVar1 = (longlong *)(param_1 + 0x10);
  (**(code **)(*plVar1 + 0x40))(plVar1);
  (**(code **)(*plVar1 + 0x48))(plVar1,"LoadXml",1);
  FUN_1400bcc20(local_50);
  FUN_1400bc640(local_50,param_2);
  local_res10 = 0;
  FUN_14013da50(local_50,plVar1,0,&local_res10,param_3);
  if (local_res10 == 0) {
    uVar3 = 0;
  }
  else {
    if ((*(longlong *)(param_1 + 400) != 0) &&
       (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
      FUN_14013ae30();
      iVar4 = FUN_14013adf0(*(undefined8 *)(param_1 + 400));
      if (iVar4 == 0) {
        FUN_14013ae70(*(undefined8 *)(param_1 + 400));
      }
      *(undefined8 *)(param_1 + 400) = 0;
    }
    *(longlong *)(param_1 + 400) = local_res10;
    FUN_14013ae10(local_res10);
    uVar3 = 1;
  }
  (**(code **)(*plVar1 + 0x50))(plVar1);
  FUN_1400d1290(param_1 + 0x158);
  puVar6 = local_50;
LAB_140119757:
  FUN_1400bceb0(puVar6);
  return uVar3;
}



undefined1 FUN_140119780(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined8 uVar2;
  
  FUN_1400d1280(param_1 + 0x158);
  (**(code **)(*(longlong *)(param_1 + 0x10) + 0x40))(param_1 + 0x10);
  (**(code **)(*(longlong *)(param_1 + 0x10) + 0x48))(param_1 + 0x10,"ChilkatPath",1);
  uVar2 = FUN_1400b7ce0(param_2);
  uVar1 = FUN_140118710(param_1,uVar2,param_3,param_1 + 0x10);
  (**(code **)(*(longlong *)(param_1 + 0x10) + 0x50))(param_1 + 0x10);
  FUN_1400d1290(param_1 + 0x158);
  return uVar1;
}



void FUN_140119830(longlong param_1,undefined8 param_2)

{
  FUN_1400b8b30(param_2);
  FUN_1400b9e90(param_2,param_1 + 0x40);
  return;
}



bool FUN_140119860(longlong param_1,undefined8 param_2,undefined8 param_3,undefined1 param_4)

{
  longlong lVar1;
  char cVar2;
  undefined8 *puVar3;
  longlong lVar4;
  bool bVar5;
  undefined8 uVar6;
  undefined1 local_50 [56];
  
  uVar6 = 0xfffffffffffffffe;
  FUN_1400d1280(param_1 + 0x10);
  lVar1 = param_1 + 0x40;
  FUN_1400b8b30(lVar1);
  FUN_1400b9e90(lVar1,param_2);
  FUN_1400bcc20(local_50);
  FUN_14011d520(lVar1,1,local_50,0,param_3,param_4,uVar6);
  lVar4 = param_1 + 0x68;
  uVar6 = FUN_1400b8b90(local_50);
  FUN_1401195c0(lVar4,uVar6,1);
  cVar2 = FUN_140118300(lVar4,"sequence");
  if ((cVar2 == '\0') ||
     (puVar3 = (undefined8 *)FUN_140119050(lVar4,0), puVar3 == (undefined8 *)0x0)) {
    bVar5 = false;
  }
  else {
    cVar2 = FUN_140118300(puVar3,"sequence");
    bVar5 = cVar2 != '\0';
    (**(code **)*puVar3)(puVar3,1);
    if (bVar5) goto LAB_140119957;
  }
  FUN_1400b8b30(lVar1);
  FUN_140119360(lVar4);
LAB_140119957:
  FUN_1400d1290(param_1 + 0x10);
  FUN_1400bceb0(local_50);
  return bVar5;
}



undefined1
FUN_140119990(longlong param_1,undefined8 param_2,undefined4 param_3,longlong *param_4,
             undefined1 param_5)

{
  undefined1 uVar1;
  char cVar2;
  undefined8 *puVar3;
  longlong lVar4;
  undefined8 uVar5;
  undefined1 local_1c0 [48];
  undefined1 local_190 [56];
  undefined1 local_158 [160];
  undefined1 local_b8 [160];
  
  uVar5 = 0xfffffffffffffffe;
  FUN_1400d1280(param_1 + 0x10);
  FUN_1400b8b30(param_1 + 0x40);
  FUN_1400b97e0(param_1 + 0x40,param_2,param_3);
  FUN_1400bcc20(local_1c0);
  uVar1 = FUN_14011d520(param_1 + 0x40,1,local_1c0,0,param_4,param_5,uVar5);
  lVar4 = param_1 + 0x68;
  uVar5 = FUN_1400b8b90(local_1c0);
  FUN_1401195c0(lVar4,uVar5,1);
  puVar3 = (undefined8 *)FUN_140119050(lVar4,0);
  if (puVar3 != (undefined8 *)0x0) {
    cVar2 = FUN_140118300(puVar3,&DAT_140207ba0);
    if (cVar2 == '\0') {
      (**(code **)*puVar3)(puVar3,1);
    }
    else {
      (**(code **)*puVar3)();
      FUN_1400b6fd0(local_158);
      FUN_1400b86c0(local_158,"contextSpecific|sequence|contextSpecific|sequence|$");
      FUN_1400b6fd0(local_b8);
      cVar2 = FUN_140119780(lVar4,local_158,local_b8);
      if (cVar2 != '\0') {
        (**(code **)(*param_4 + 0x30))(param_4,"Loading PKCS7 (p7b) certificate...");
        FUN_1400bcc20(local_190);
        FUN_140118e00(lVar4,local_190);
        FUN_140119360(lVar4);
        uVar5 = FUN_1400b8b90(local_190);
        FUN_1401195c0(lVar4,uVar5,0);
        FUN_1400bceb0(local_190);
      }
      FUN_1400b7090(local_b8);
      FUN_1400b7090(local_158);
    }
  }
  FUN_1400d1290(param_1 + 0x10);
  FUN_1400bceb0(local_1c0);
  return uVar1;
}



undefined8 * FUN_140119b70(undefined8 *param_1)

{
  FUN_1400d0eb0();
  FUN_1400d1210(param_1 + 2);
  *param_1 = ChilkatX509::vftable;
  param_1[2] = ChilkatX509::vftable;
  FUN_1400b8c40(param_1 + 8);
  FUN_140118090(param_1 + 0xd);
  return param_1;
}



void FUN_140119be0(undefined8 *param_1)

{
  *param_1 = ChilkatX509::vftable;
  param_1[2] = ChilkatX509::vftable;
  FUN_140118160(param_1 + 0xd);
  FUN_1400b92d0(param_1 + 8);
  FUN_1400d1240(param_1 + 2);
  FUN_1400d0ee0(param_1);
  return;
}



char FUN_140119c40(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  undefined8 uVar2;
  undefined1 local_a8 [160];
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1400d1280(param_1 + 0x10);
  FUN_1400b6fd0(local_a8);
  cVar1 = FUN_140118710(param_1 + 0x68,"sequence|int|*",local_a8,param_3,uVar2);
  if (cVar1 != '\0') {
    FUN_1400b87c0(local_a8);
    FUN_1400b8850(param_2,local_a8);
  }
  FUN_1400d1290(param_1 + 0x10);
  FUN_1400b7090(local_a8);
  return cVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

char FUN_140119cf0(longlong param_1,undefined8 param_2,undefined8 param_3,longlong *param_4)

{
  longlong lVar1;
  char cVar2;
  undefined4 uVar3;
  uint uVar4;
  undefined8 uVar5;
  undefined1 auStack_278 [32];
  undefined4 local_258;
  undefined1 *local_250;
  undefined1 local_248 [48];
  undefined1 local_218 [40];
  undefined1 local_1f0 [40];
  undefined8 local_1c8;
  undefined1 local_1b8 [160];
  undefined1 local_118 [192];
  ulonglong local_58;
  
  local_1c8 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_278;
  FUN_1400b7180(param_3);
  FUN_1400d1280(param_1 + 0x10);
  lVar1 = param_1 + 0x68;
  cVar2 = FUN_140118710(lVar1,"sequence|sequence[1]|$",param_3,param_4);
  if (cVar2 == '\0') {
    (**(code **)(*param_4 + 0x28))(param_4,"Cannot get certificate issuer value (1)");
    cVar2 = '\0';
  }
  else {
    FUN_1400bcc20(local_248);
    FUN_1400bc640(local_248,"/C/oid,");
    FUN_1400bc640(local_248,param_2);
    FUN_1400bc640(local_248,"|..|printable|*");
    uVar5 = FUN_1400b8b90(local_248);
    cVar2 = FUN_140118710(lVar1,uVar5,param_3,param_4);
    if (cVar2 == '\0') {
      FUN_1400bdb00(local_248,"/C/oid,");
      FUN_1400bc640(local_248,param_2);
      FUN_1400bc640(local_248,"|..|utf8|*");
      uVar5 = FUN_1400b8b90(local_248);
      cVar2 = FUN_140118710(lVar1,uVar5,param_3,param_4);
      if (cVar2 == '\0') {
        FUN_1400bdb00(local_248,"/C/oid,");
        FUN_1400bc640(local_248,param_2);
        FUN_1400bc640(local_248,"|..|ia5|*");
        uVar5 = FUN_1400b8b90(local_248);
        cVar2 = FUN_140118710(lVar1,uVar5,param_3,param_4);
        if (cVar2 == '\0') {
          FUN_1400bdb00(local_248,"/C/oid,");
          FUN_1400bc640(local_248,param_2);
          FUN_1400bc640(local_248,"|..|t61|*");
          uVar5 = FUN_1400b8b90(local_248);
          cVar2 = FUN_140118710(lVar1,uVar5,param_3,param_4);
          if (cVar2 == '\0') {
            FUN_1400b6fd0(local_1b8);
            FUN_1400bdb00(local_248,"/C/oid,");
            FUN_1400bc640(local_248,param_2);
            FUN_1400bc640(local_248,"|..|universal|*");
            uVar5 = FUN_1400b8b90(local_248);
            cVar2 = FUN_140118710(lVar1,uVar5,local_1b8,param_4);
            if (cVar2 != '\0') {
              FUN_1400b8c40(local_218);
              uVar5 = FUN_1400b7ce0(local_1b8);
              FUN_1400b9f10(local_218,uVar5,"base64");
              FUN_1400c2840(local_118);
              FUN_1400b8c40(local_1f0);
              uVar3 = FUN_1400b8b80(local_218);
              uVar5 = FUN_1400b8b90(local_218);
              local_250 = local_1f0;
              local_258 = uVar3;
              FUN_1400cded0(local_118,0x4b1,0x4b0,uVar5);
              uVar4 = FUN_1400b8b80(local_1f0);
              uVar5 = FUN_1400b8b90(local_1f0);
              FUN_1400b7c50(param_3,uVar5,uVar4 >> 1);
              FUN_1400b92d0(local_1f0);
              FUN_1400c2880(local_118);
              FUN_1400b92d0(local_218);
            }
            FUN_1400b7090(local_1b8);
          }
        }
      }
    }
    FUN_140119300(lVar1);
    FUN_1400bceb0(local_248);
  }
  FUN_1400d1290(param_1 + 0x10);
  return cVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14011a040(undefined8 param_1,char param_2,undefined8 param_3,longlong *param_4)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  char *pcVar5;
  undefined1 auStack_1d8 [32];
  undefined4 local_1b8;
  undefined1 *local_1b0;
  undefined1 local_1a8 [40];
  undefined8 local_180;
  undefined1 local_178 [48];
  undefined1 local_148 [48];
  undefined1 local_118 [48];
  undefined1 local_e8 [192];
  ulonglong local_28;
  
  local_180 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_1d8;
  cVar1 = FUN_140118300(param_1,&DAT_140249194);
  if (cVar1 == '\0') {
    (**(code **)(*param_4 + 0x28))(param_4,"DistinguishedName: Expected set.");
    uVar4 = 0;
  }
  else {
    iVar2 = FUN_1401184f0(param_1);
    if (iVar2 == 0) {
      (**(code **)(*param_4 + 0x28))(param_4,"DistinguishedName is empty.");
      uVar4 = 0;
    }
    else {
      FUN_140119410(param_1);
      cVar1 = FUN_140118300(param_1,"sequence");
      if (cVar1 == '\0') {
        (**(code **)(*param_4 + 0x28))(param_4,"DistinguishedName: Expected sequence.");
        uVar4 = 0;
      }
      else {
        FUN_140119410(param_1);
        cVar1 = FUN_140118300(param_1,&DAT_140207ba0);
        if (cVar1 == '\0') {
          (**(code **)(*param_4 + 0x28))(param_4,"DistinguishedName: Expected oid.");
          uVar4 = 0;
        }
        else {
          FUN_1400bcc20(local_148);
          pcVar5 = "X";
          if (param_2 != '\0') {
            cVar1 = FUN_140118380(param_1,"1.2.840.113549.1.9.1");
            if (cVar1 == '\0') {
              cVar1 = FUN_140118380(param_1,"2.5.4.3");
              if (cVar1 == '\0') {
                cVar1 = FUN_140118380(param_1,"2.5.4.11");
                if (cVar1 == '\0') {
                  cVar1 = FUN_140118380(param_1,"2.5.4.10");
                  if (cVar1 == '\0') {
                    cVar1 = FUN_140118380(param_1,"2.5.4.7");
                    if (cVar1 == '\0') {
                      cVar1 = FUN_140118380(param_1,"2.5.4.8");
                      if (cVar1 == '\0') {
                        cVar1 = FUN_140118380(param_1,"2.5.4.9");
                        if (cVar1 == '\0') {
                          cVar1 = FUN_140118380(param_1,"2.5.4.6");
                          if (cVar1 == '\0') {
                            cVar1 = FUN_140118380(param_1,"2.5.4.17");
                            if (cVar1 == '\0') {
                              cVar1 = FUN_140118380(param_1,"2.5.4.4");
                              if (cVar1 == '\0') {
                                cVar1 = FUN_140118380(param_1,"2.5.4.5");
                                if (cVar1 == '\0') {
                                  cVar1 = FUN_140118380(param_1,"2.5.4.12");
                                  if (cVar1 == '\0') {
                                    cVar1 = FUN_140118380(param_1,"2.5.4.13");
                                    if (cVar1 == '\0') {
                                      cVar1 = FUN_140118380(param_1,"2.5.4.14");
                                      if (cVar1 == '\0') {
                                        cVar1 = FUN_140118380(param_1,"2.5.4.15");
                                        if (cVar1 == '\0') {
                                          cVar1 = FUN_140118380(param_1,"2.5.4.16");
                                          if (cVar1 == '\0') {
                                            cVar1 = FUN_140118380(param_1,"2.5.4.18");
                                            if (cVar1 == '\0') {
                                              cVar1 = FUN_140118380(param_1,"2.5.4.19");
                                              if (cVar1 == '\0') {
                                                cVar1 = FUN_140118380(param_1,"2.5.4.20");
                                                if (cVar1 == '\0') {
                                                  cVar1 = FUN_140118380(param_1,"2.5.4.23");
                                                  if (cVar1 == '\0') {
                                                    cVar1 = FUN_140118380(param_1,
                                                  "0.9.2342.19200300.100.1.25");
                                                  if (cVar1 == '\0') {
                                                    FUN_1400bc640(local_148,&DAT_140249708);
                                                    uVar4 = FUN_140118400(param_1);
                                                    FUN_1400bc640(local_148,uVar4);
                                                    pcVar5 = (char *)FUN_1400b8b90(local_148);
                                                  }
                                                  else {
                                                    pcVar5 = "DC";
                                                  }
                                                  }
                                                  else {
                                                    pcVar5 = "FaxNumber";
                                                  }
                                                }
                                                else {
                                                  pcVar5 = "TelephoneNumber";
                                                }
                                              }
                                              else {
                                                pcVar5 = "PhysicalDeliveryOfficeName";
                                              }
                                            }
                                            else {
                                              pcVar5 = "PostOfficeBox";
                                            }
                                          }
                                          else {
                                            pcVar5 = "PostalAddress";
                                          }
                                        }
                                        else {
                                          pcVar5 = "BusinessCategory";
                                        }
                                      }
                                      else {
                                        pcVar5 = "SearchGuide";
                                      }
                                    }
                                    else {
                                      pcVar5 = "Description";
                                    }
                                  }
                                  else {
                                    pcVar5 = "Title";
                                  }
                                }
                                else {
                                  pcVar5 = "SN";
                                }
                              }
                              else {
                                pcVar5 = "Surname";
                              }
                            }
                            else {
                              pcVar5 = "PostalCode";
                            }
                          }
                          else {
                            pcVar5 = "C";
                          }
                        }
                        else {
                          pcVar5 = "STREET";
                        }
                      }
                      else {
                        pcVar5 = "ST";
                      }
                    }
                    else {
                      pcVar5 = "L";
                    }
                  }
                  else {
                    pcVar5 = "O";
                  }
                }
                else {
                  pcVar5 = "OU";
                }
              }
              else {
                pcVar5 = "CN";
              }
            }
            else {
              pcVar5 = "E";
            }
          }
          cVar1 = FUN_140119480(param_1);
          if (cVar1 != '\0') {
            iVar2 = FUN_1400b8350(param_3);
            if (iVar2 != 0) {
              FUN_1400b86c0(param_3,&DAT_140274aa0);
            }
            if (param_2 != '\0') {
              FUN_1400b86c0(param_3,pcVar5);
              FUN_1400b86c0(param_3,&DAT_140244e70);
            }
            FUN_1400bcc20(local_178);
            cVar1 = FUN_140118300(param_1,"universal");
            if (cVar1 == '\0') {
              FUN_140118490(param_1,local_178);
            }
            else {
              FUN_1400b8c40(local_1a8);
              uVar4 = FUN_140118400(param_1);
              FUN_1400b9f10(local_1a8,uVar4,"base64");
              FUN_1400c2840(local_e8);
              FUN_1400b8c40(local_118);
              uVar3 = FUN_1400b8b80(local_1a8);
              uVar4 = FUN_1400b8b90(local_1a8);
              local_1b0 = local_118;
              local_1b8 = uVar3;
              FUN_1400cded0(local_e8,0x4b1,0xfde9,uVar4);
              FUN_1400be440(local_178,local_118);
              FUN_1400b92d0(local_118);
              FUN_1400c2880(local_e8);
              FUN_1400b92d0(local_1a8);
            }
            cVar1 = FUN_1400bc610(local_178,0x2c);
            if (cVar1 != '\0') {
              FUN_1400b86c0(param_3,&DAT_14027b5c4);
            }
            uVar4 = FUN_1400b8b90(local_178);
            FUN_1400b86c0(param_3,uVar4);
            if (cVar1 != '\0') {
              FUN_1400b86c0(param_3,&DAT_14027b5c4);
            }
            FUN_1400bceb0(local_178);
          }
          FUN_140119290(param_1);
          FUN_140119290(param_1);
          FUN_1400bceb0(local_148);
          uVar4 = 1;
        }
      }
    }
  }
  return uVar4;
}



char FUN_14011a5e0(longlong param_1,char param_2,undefined1 param_3,undefined8 param_4,
                  longlong *param_5)

{
  longlong lVar1;
  char cVar2;
  char cVar3;
  int iVar4;
  char *pcVar5;
  
  FUN_1400b7180(param_4);
  FUN_1400d1280(param_1 + 0x10);
  (**(code **)(*param_5 + 0x48))(param_5,"dn_getDN",1);
  lVar1 = param_1 + 0x68;
  pcVar5 = "sequence|sequence[3]|$";
  if (param_2 == '\0') {
    pcVar5 = "sequence|sequence[1]|$";
  }
  cVar2 = FUN_140118710(lVar1,pcVar5,param_4,param_5);
  if (cVar2 != '\0') {
    iVar4 = FUN_1401184f0(lVar1);
    if (iVar4 != 0) {
      FUN_140119410(lVar1);
      do {
        FUN_14011a040(lVar1,param_3,param_4,param_5);
        cVar3 = FUN_140119480(lVar1);
      } while (cVar3 != '\0');
    }
    FUN_140119300(lVar1);
  }
  (**(code **)(*param_5 + 0x50))(param_5);
  FUN_1400d1290(param_1 + 0x10);
  return cVar2;
}



undefined8 FUN_14011a6d0(longlong param_1,char param_2,undefined8 param_3)

{
  longlong lVar1;
  char cVar2;
  undefined8 uVar3;
  char *pcVar4;
  undefined8 uVar5;
  undefined1 local_a8 [160];
  
  uVar5 = 0xfffffffffffffffe;
  uVar3 = 0;
  FUN_1400d1280(param_1 + 0x10);
  FUN_1400b6fd0(local_a8);
  lVar1 = param_1 + 0x68;
  pcVar4 = "sequence|sequence[3]|$";
  if (param_2 == '\0') {
    pcVar4 = "sequence|sequence[1]|$";
  }
  cVar2 = FUN_140118710(lVar1,pcVar4,local_a8,param_3,uVar5);
  if (cVar2 != '\0') {
    uVar3 = FUN_140117090(lVar1,param_3);
    FUN_140119300(lVar1);
  }
  FUN_1400d1290(param_1 + 0x10);
  FUN_1400b7090(local_a8);
  return uVar3;
}



char FUN_14011a790(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  char cVar2;
  char cVar3;
  undefined8 uVar4;
  undefined1 local_f8 [48];
  undefined8 local_c8;
  undefined1 local_b8 [160];
  
  local_c8 = 0xfffffffffffffffe;
  FUN_1400b8b30(param_3);
  FUN_1400d1280(param_1 + 0x10);
  FUN_1400b6fd0(local_b8);
  lVar1 = param_1 + 0x68;
  cVar2 = FUN_140118710(lVar1,"sequence|/A/contextSpecific,tag,3|sequence|$",local_b8,param_4);
  cVar3 = '\0';
  if (cVar2 != '\0') {
    FUN_1400bcc20(local_f8);
    FUN_1400bc640(local_f8,"/C/oid,");
    FUN_1400bc640(local_f8,param_2);
    FUN_1400bc640(local_f8,"|..|octets|*");
    uVar4 = FUN_1400b8b90(local_f8);
    cVar3 = FUN_140118710(lVar1,uVar4,local_b8,param_4);
    if (cVar3 != '\0') {
      uVar4 = FUN_1400b7ce0(local_b8);
      FUN_1400b9f10(param_3,uVar4,"base64");
    }
    FUN_140119300(lVar1);
    FUN_1400bceb0(local_f8);
  }
  FUN_1400d1290(param_1 + 0x10);
  FUN_1400b7090(local_b8);
  return cVar3;
}



char FUN_14011a8d0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  undefined8 uVar2;
  undefined1 local_a8 [160];
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1400d1280(param_1 + 0x10);
  FUN_1400b8b30(param_2);
  FUN_1400b6fd0(local_a8);
  cVar1 = FUN_140118710(param_1 + 0x68,"sequence|sequence[4]|bits|*",local_a8,param_3,uVar2);
  if (cVar1 != '\0') {
    uVar2 = FUN_1400b7ce0(local_a8);
    FUN_1400b9f10(param_2,uVar2,&DAT_1402749dc);
  }
  FUN_1400d1290(param_1 + 0x10);
  FUN_1400b7090(local_a8);
  return cVar1;
}



void FUN_14011a990(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_140119cf0(param_1,"2.5.4.6",param_2,param_3);
  return;
}



void FUN_14011a9b0(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_140119cf0(param_1,"2.5.4.8",param_2,param_3);
  return;
}



void FUN_14011a9d0(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_140119cf0(param_1,"2.5.4.7",param_2,param_3);
  return;
}



void FUN_14011a9f0(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_140119cf0(param_1,"2.5.4.10",param_2,param_3);
  return;
}



void FUN_14011aa10(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_140119cf0(param_1,"2.5.4.11",param_2,param_3);
  return;
}



void FUN_14011aa30(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_140119cf0(param_1,"2.5.4.3",param_2,param_3);
  return;
}



void FUN_14011aa50(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_140119cf0(param_1,"1.2.840.113549.1.9.1",param_2,param_3);
  return;
}



void FUN_14011aa70(longlong param_1)

{
  FUN_14011aa80(param_1 + -0x10);
  return;
}



undefined8 * FUN_14011aa80(undefined8 *param_1,uint param_2)

{
  *param_1 = ChilkatX509::vftable;
  param_1[2] = ChilkatX509::vftable;
  FUN_140118160(param_1 + 0xd);
  FUN_1400b92d0(param_1 + 8);
  FUN_1400d1240(param_1 + 2);
  FUN_1400d0ee0(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



ulonglong FUN_14011ab00(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  byte bVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  undefined1 local_220 [56];
  undefined1 local_1e8 [160];
  undefined1 local_148 [160];
  undefined1 local_a8 [160];
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1400b6fd0(local_148);
  FUN_1400d1280(param_1 + 0x10);
  FUN_1400b6fd0(local_1e8);
  cVar1 = FUN_140118710(param_1 + 0x68,"sequence|int|*",local_1e8,param_4,uVar4);
  if (cVar1 != '\0') {
    FUN_1400b87c0(local_1e8);
    FUN_1400b8850(local_148,local_1e8);
  }
  FUN_1400d1290(param_1 + 0x10);
  FUN_1400b7090(local_1e8);
  FUN_1400bcaa0(local_220,param_3);
  FUN_1400bc2c0(local_220);
  uVar4 = FUN_1400b8b90(local_220);
  cVar1 = FUN_1400b7f00(local_148,uVar4);
  if (cVar1 == '\0') {
    FUN_1400bceb0(local_220);
    uVar3 = FUN_1400b7090(local_148);
    uVar3 = uVar3 & 0xffffffffffffff00;
  }
  else {
    FUN_1400b6fd0(local_a8);
    FUN_140119cf0(param_1,"2.5.4.3",local_a8,param_4);
    bVar2 = FUN_1400b8930(local_a8,param_2);
    FUN_1400b7090(local_a8);
    FUN_1400bceb0(local_220);
    FUN_1400b7090(local_148);
    uVar3 = (ulonglong)bVar2;
  }
  return uVar3;
}



undefined1
FUN_14011ac80(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 param_5)

{
  char cVar1;
  undefined1 uVar2;
  undefined8 uVar3;
  undefined1 local_30 [40];
  
  uVar3 = 0xfffffffffffffffe;
  FUN_1400bbe30(param_3);
  FUN_1400b8c40(local_30);
  cVar1 = FUN_14011a790(param_1,param_2,local_30,param_4);
  uVar2 = 0;
  if (cVar1 != '\0') {
    uVar2 = FUN_14011d520(local_30,1,param_3,0,param_4,param_5,uVar3);
  }
  FUN_1400b92d0(local_30);
  return uVar2;
}



void FUN_14011ad30(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  longlong lVar3;
  int iVar4;
  char *pcVar5;
  undefined1 local_30 [24];
  
  cVar1 = *(char *)(param_1 + 0x11);
  if (cVar1 == '\0') {
    pcVar5 = "universal";
  }
  else if (cVar1 == '\x01') {
    pcVar5 = "application";
  }
  else {
    pcVar5 = "private";
    if (cVar1 != '\x03') {
      pcVar5 = "contextSpecific";
    }
  }
  FUN_1400bbe50(param_2,0x3c,param_3,param_4,0xfffffffffffffffe);
  FUN_1400bc640(param_2,pcVar5);
  FUN_1400bc640(param_2," tag=\"");
  FUN_1400be5a0(param_2,*(undefined4 *)(param_1 + 0x14));
  FUN_1400bc640(param_2,"\" constructed=\"");
  FUN_1400bbe50(param_2,(*(char *)(param_1 + 0x10) != '\0') + '0');
  FUN_1400bbe50(param_2,0x22);
  if (*(char *)(param_1 + 0x10) != '\0') {
    if (*(longlong *)(param_1 + 0x20) != 0) {
      FUN_1400bbe50(param_2,0x3e);
      iVar2 = FUN_140139d70(*(undefined8 *)(param_1 + 0x20));
      iVar4 = 0;
      if (0 < iVar2) {
        do {
          lVar3 = FUN_1400d0aa0(*(undefined8 *)(param_1 + 0x20),iVar4);
          if (lVar3 != 0) {
            FUN_14011b7b0(lVar3,param_2,param_3);
          }
          iVar4 = iVar4 + 1;
        } while (iVar4 < iVar2);
      }
      FUN_1400bc640(param_2,&DAT_14027b678);
      FUN_1400bc640(param_2,pcVar5);
      FUN_1400bbe50(param_2,0x3e);
      return;
    }
    if (*(char *)(param_1 + 0x10) != '\0') goto LAB_14011aedc;
  }
  if ((*(int *)(param_1 + 0x18) != 0) && (*(longlong *)(param_1 + 0x20) != 0)) {
    FUN_1400bbe50(param_2,0x3e);
    FUN_1400f0d10(local_30);
    FUN_1400f2c30(local_30,0x50);
    FUN_1400f0d40(local_30,*(undefined8 *)(param_1 + 0x20),*(undefined4 *)(param_1 + 0x18),param_2);
    FUN_1400bc640(param_2,&DAT_14027b678);
    FUN_1400bc640(param_2,pcVar5);
    FUN_1400bbe50(param_2,0x3e);
    FUN_1400f0d30(local_30);
    return;
  }
LAB_14011aedc:
  FUN_1400bc640(param_2,&DAT_14027b5a0);
  return;
}



undefined8 * FUN_14011af10(undefined8 *param_1)

{
  FUN_1400d0eb0();
  *(undefined8 *)((longlong)param_1 + 0x14) = 0;
  param_1[4] = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  *param_1 = AsnItem::vftable;
  return param_1;
}



void FUN_14011af50(undefined8 param_1,undefined8 param_2)

{
  char cVar1;
  
  cVar1 = FUN_1400bdf70(param_1,"1.2.840.113549.1.7.1");
  if (cVar1 != '\0') {
    FUN_1400bc640(param_2,"PKCS7 Data");
    return;
  }
  cVar1 = FUN_1400bdf70(param_1,"1.2.840.113549.1.7.2");
  if (cVar1 != '\0') {
    FUN_1400bc640(param_2,"PKCS7 SignedData");
    return;
  }
  cVar1 = FUN_1400bdf70(param_1,"1.2.840.113549.1.7.3");
  if (cVar1 != '\0') {
    FUN_1400bc640(param_2,"PKCS7 EnvelopedData");
    return;
  }
  cVar1 = FUN_1400bdf70(param_1,"1.2.840.113549.1.7.4");
  if (cVar1 != '\0') {
    FUN_1400bc640(param_2,"PKCS7 SignedAndEnvelopedData");
    return;
  }
  cVar1 = FUN_1400bdf70(param_1,"1.2.840.113549.1.7.5");
  if (cVar1 != '\0') {
    FUN_1400bc640(param_2,"PKCS7 DigestedData");
    return;
  }
  cVar1 = FUN_1400bdf70(param_1,"1.2.840.113549.1.7.6");
  if (cVar1 != '\0') {
    FUN_1400bc640(param_2,"PKCS7 EncryptedData");
    return;
  }
  cVar1 = FUN_1400bc7e0(param_1,"1.2.840.113549.1.9");
  if (cVar1 != '\0') {
    FUN_1400bc640(param_2,"PKCS9 Signature Attribute");
    return;
  }
  cVar1 = FUN_1400bdf70(param_1,"1.2.840.113549.1.12.1.1");
  if (cVar1 != '\0') {
    FUN_1400bc640(param_2,"PKCS12 KeyBag");
    return;
  }
  cVar1 = FUN_1400bdf70(param_1,"1.2.840.113549.1.12.1.2");
  if (cVar1 != '\0') {
    FUN_1400bc640(param_2,"PKCS12 Pkcs8ShroudedKeyBag");
    return;
  }
  cVar1 = FUN_1400bdf70(param_1,"1.2.840.113549.1.12.1.3");
  if (cVar1 != '\0') {
    FUN_1400bc640(param_2,"PKCS12 CertBag");
    return;
  }
  cVar1 = FUN_1400bdf70(param_1,"1.2.840.113549.1.12.1.4");
  if (cVar1 != '\0') {
    FUN_1400bc640(param_2,"PKCS12 SecretBag");
    return;
  }
  cVar1 = FUN_1400bdf70(param_1,"1.2.840.113549.1.12.1.5");
  if (cVar1 != '\0') {
    FUN_1400bc640(param_2,"PKCS12 CrlBag");
    return;
  }
  cVar1 = FUN_1400bdf70(param_1,"1.2.840.113549.1.12.1.6");
  if (cVar1 != '\0') {
    FUN_1400bc640(param_2,"PKCS12 SafeContentsBag");
  }
  return;
}



void FUN_14011b1a0(longlong param_1,undefined8 param_2)

{
  uint uVar1;
  longlong lVar2;
  
  if ((*(int *)(param_1 + 0x14) != 6) && (*(int *)(param_1 + 0x14) != 0xd)) {
    FUN_1400bc640(param_2,"NOT AN OID");
    return;
  }
  uVar1 = 0;
  if (*(int *)(param_1 + 0x18) != 0) {
    lVar2 = 0;
    do {
      if (uVar1 != 0) {
        FUN_1400bbe50(param_2,0x2e);
      }
      FUN_1400be5a0(param_2,*(undefined4 *)(*(longlong *)(param_1 + 0x20) + lVar2));
      uVar1 = uVar1 + 1;
      lVar2 = lVar2 + 4;
    } while (uVar1 < *(uint *)(param_1 + 0x18));
  }
  return;
}



void FUN_14011b230(longlong param_1)

{
  int iVar1;
  undefined8 *puVar2;
  void *pvVar3;
  
  if (*(char *)(param_1 + 0x10) == '\0') {
    if (*(char *)(param_1 + 0x11) == '\0') {
      iVar1 = *(int *)(param_1 + 0x14);
      if ((iVar1 == 1) || (iVar1 == 5)) goto LAB_14011b29f;
      if (iVar1 == 6) {
        pvVar3 = *(void **)(param_1 + 0x20);
      }
      else {
        pvVar3 = *(void **)(param_1 + 0x20);
        if (iVar1 != 0xc) goto LAB_14011b291;
      }
    }
    else {
      pvVar3 = *(void **)(param_1 + 0x20);
LAB_14011b291:
      if (pvVar3 == (void *)0x0) goto LAB_14011b29f;
    }
    operator_delete(pvVar3);
  }
  else {
    if (*(longlong *)(param_1 + 0x20) == 0) goto LAB_14011b29f;
    FUN_1400d0d30();
    puVar2 = *(undefined8 **)(param_1 + 0x20);
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
  }
  *(undefined8 *)(param_1 + 0x20) = 0;
LAB_14011b29f:
  *(undefined2 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x14) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  return;
}



void FUN_14011b2c0(char *param_1,uint param_2,undefined8 param_3)

{
  uint uVar1;
  uint uVar2;
  
  FUN_1400b8b30(param_3);
  uVar1 = 0;
  uVar2 = 0;
  if (0 < (int)param_2) {
    do {
      uVar1 = uVar1 | (uint)(*param_1 != '\0') << (7U - (char)(uVar2 & 7) & 0x1f);
      if ((uVar2 & 7) == 7) {
        FUN_1400b9550(param_3,uVar1);
        uVar1 = 0;
      }
      uVar2 = uVar2 + 1;
      param_1 = param_1 + 1;
    } while ((int)uVar2 < (int)param_2);
  }
  if ((param_2 & 7) != 0) {
    FUN_1400b9550(param_3,uVar1);
  }
  return;
}



void * FUN_14011b350(byte *param_1,int param_2,uint *param_3)

{
  void *pvVar1;
  void *pvVar2;
  uint uVar3;
  uint uVar4;
  void *pvVar5;
  
  if ((param_1 != (byte *)0x0) && (param_3 != (uint *)0x0)) {
    pvVar2 = (void *)0x0;
    *param_3 = 0;
    uVar3 = 0;
    if (param_2 != 0) {
      uVar3 = (param_2 * 8 + -8) - (*param_1 & 7);
    }
    pvVar1 = pvVar2;
    if (uVar3 != 0) {
      pvVar1 = operator_new((ulonglong)uVar3);
      if (uVar3 != 0) {
        param_1 = param_1 + (int)(uint)(param_2 != 0);
        pvVar5 = pvVar1;
        do {
          uVar4 = (uint)pvVar2 & 7;
          *(bool *)pvVar5 = (*param_1 & (byte)(1 << (7U - (char)uVar4 & 0x1f))) != 0;
          if (uVar4 == 7) {
            param_1 = param_1 + 1;
          }
          uVar4 = (uint)pvVar2 + 1;
          pvVar2 = (void *)(ulonglong)uVar4;
          pvVar5 = (void *)((longlong)pvVar5 + 1);
        } while (uVar4 < uVar3);
      }
    }
    *param_3 = uVar3;
    return pvVar1;
  }
  return (void *)0x0;
}



uint * FUN_14011b430(byte *param_1,int param_2,int *param_3)

{
  byte bVar1;
  undefined1 auVar2 [16];
  __uint64 _Var3;
  uint *puVar4;
  byte *pbVar5;
  uint uVar6;
  ulonglong uVar7;
  int iVar8;
  longlong lVar9;
  
  if ((param_1 != (byte *)0x0) && (param_3 != (int *)0x0)) {
    uVar7 = 0;
    *param_3 = 0;
    pbVar5 = param_1;
    iVar8 = param_2;
    while (iVar8 != 0) {
      bVar1 = *pbVar5;
      iVar8 = iVar8 + -1;
      pbVar5 = pbVar5 + 1;
      if ((bVar1 & 0x80) == 0) {
        if ((int)uVar7 == 0) {
          uVar7 = 2;
        }
        else {
          uVar7 = (ulonglong)((int)uVar7 + 1);
        }
      }
    }
    auVar2._8_8_ = 0;
    auVar2._0_8_ = uVar7;
    _Var3 = SUB168(ZEXT816(4) * auVar2,0);
    if (SUB168(ZEXT816(4) * auVar2,8) != 0) {
      _Var3 = 0xffffffffffffffff;
    }
    puVar4 = operator_new(_Var3);
    iVar8 = 0;
    uVar6 = 0;
    lVar9 = 0;
    while (param_2 != 0) {
      bVar1 = *param_1;
      param_2 = param_2 + -1;
      param_1 = param_1 + 1;
      uVar6 = bVar1 & 0x7f | uVar6 << 7;
      if ((bVar1 & 0x80) == 0) {
        if (iVar8 == 0) {
          iVar8 = 2;
          lVar9 = 2;
          *puVar4 = uVar6 / 0x28;
          puVar4[1] = uVar6 % 0x28;
        }
        else {
          puVar4[lVar9] = uVar6;
          iVar8 = iVar8 + 1;
          lVar9 = lVar9 + 1;
        }
        uVar6 = 0;
      }
    }
    *param_3 = iVar8;
    return puVar4;
  }
  return (uint *)0x0;
}



uint * FUN_14011b550(byte *param_1,int param_2,int *param_3)

{
  byte bVar1;
  undefined1 auVar2 [16];
  __uint64 _Var3;
  uint *puVar4;
  byte *pbVar5;
  uint *puVar6;
  uint uVar7;
  ulonglong uVar8;
  int iVar9;
  
  if ((param_1 != (byte *)0x0) && (param_3 != (int *)0x0)) {
    uVar8 = 0;
    *param_3 = 0;
    pbVar5 = param_1;
    iVar9 = param_2;
    while (iVar9 != 0) {
      bVar1 = *pbVar5;
      iVar9 = iVar9 + -1;
      pbVar5 = pbVar5 + 1;
      if ((bVar1 & 0x80) == 0) {
        if ((int)uVar8 == 0) {
          uVar8 = 2;
        }
        else {
          uVar8 = (ulonglong)((int)uVar8 + 1);
        }
      }
    }
    auVar2._8_8_ = 0;
    auVar2._0_8_ = uVar8;
    _Var3 = SUB168(ZEXT816(4) * auVar2,0);
    if (SUB168(ZEXT816(4) * auVar2,8) != 0) {
      _Var3 = 0xffffffffffffffff;
    }
    puVar4 = operator_new(_Var3);
    iVar9 = 0;
    uVar7 = 0;
    puVar6 = puVar4;
    while (param_2 != 0) {
      bVar1 = *param_1;
      param_2 = param_2 + -1;
      param_1 = param_1 + 1;
      uVar7 = bVar1 & 0x7f | uVar7 << 7;
      if ((bVar1 & 0x80) == 0) {
        *puVar6 = uVar7;
        puVar6 = puVar6 + 1;
        iVar9 = iVar9 + 1;
        uVar7 = 0;
      }
    }
    *param_3 = iVar9;
    return puVar4;
  }
  return (uint *)0x0;
}



undefined8 FUN_14011b640(longlong param_1,uint param_2,int *param_3,undefined8 param_4)

{
  uint uVar1;
  longlong lVar2;
  uint uVar3;
  int iVar4;
  ushort local_res8 [4];
  undefined8 uVar5;
  undefined1 local_40 [40];
  
  uVar5 = 0xfffffffffffffffe;
  uVar3 = 0;
  if ((param_1 != 0) && (param_3 != (int *)0x0)) {
    *param_3 = 0;
    FUN_1400b8c40(local_40);
    FUN_1400ba520(local_40,param_2);
    iVar4 = 0;
    lVar2 = 0;
    if (param_2 != 0) {
      do {
        local_res8[0] = (ushort)*(byte *)(lVar2 + param_1);
        uVar3 = uVar3 + 1;
        uVar1 = 0;
        if ((char)*(byte *)(lVar2 + param_1) < '\0') {
          do {
            if (4 < uVar1) goto LAB_14011b786;
            uVar1 = uVar1 + 1;
            local_res8[0] = (local_res8[0] & 0x7f) * 2;
          } while ((char)local_res8[0] < '\0');
          if (4 < uVar1) goto LAB_14011b786;
        }
        if (param_2 < (uVar1 - 1) + uVar3) goto LAB_14011b786;
        local_res8[0] = local_res8[0] >> ((byte)uVar1 & 0x1f);
        if (1 < uVar1) {
          uVar1 = uVar1 - 1;
        }
        while (lVar2 = lVar2 + 1, uVar1 != 0) {
          uVar1 = uVar1 - 1;
          if ((*(byte *)(lVar2 + param_1) & 0xc0) != 0x80) goto LAB_14011b786;
          local_res8[0] = (ushort)(*(byte *)(lVar2 + param_1) & 0x3f) | local_res8[0] << 6;
          uVar3 = uVar3 + 1;
        }
        iVar4 = iVar4 + 1;
        FUN_1400b97e0(local_40,local_res8,2,param_4,uVar5);
      } while (uVar3 < param_2);
    }
    *param_3 = iVar4;
    iVar4 = FUN_1400b8b80(local_40);
    if (iVar4 != 0) {
      uVar5 = FUN_1400b8c20(local_40);
      FUN_1400b92d0(local_40);
      return uVar5;
    }
LAB_14011b786:
    FUN_1400b92d0(local_40);
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14011b7b0(longlong param_1,undefined8 param_2,longlong param_3)

{
  int iVar1;
  undefined8 uVar2;
  uint uVar3;
  int iVar4;
  longlong lVar5;
  undefined1 auStack_158 [32];
  undefined8 local_138;
  undefined1 local_128 [160];
  void *local_88 [4];
  char local_68 [64];
  ulonglong local_28;
  
  local_138 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_158;
  if (*(char *)(param_1 + 0x11) == '\0') {
    iVar1 = *(int *)(param_1 + 0x14);
    if (iVar1 == 5) {
      FUN_1400bc640(param_2,"<null />");
      return;
    }
    if (iVar1 == 1) {
      if (*(char *)(param_1 + 0x20) != '\0') {
        FUN_1400bc640(param_2,"<bool>1</bool>");
        return;
      }
      FUN_1400bc640(param_2,"<bool>0</bool>");
      return;
    }
    if (iVar1 == 2) {
      FUN_1400bc640(param_2,"<int>");
      if (*(int *)(param_1 + 0x18) == 0) {
        FUN_1400bc640(param_2,&DAT_1402422b4);
      }
      else {
        FUN_1400bc2f0(param_2,*(undefined8 *)(param_1 + 0x20));
      }
      FUN_1400bc640(param_2,"</int>");
      return;
    }
    if (iVar1 == 3) {
      if (*(int *)(param_1 + 0x18) != 0) {
        FUN_1400b8c40(local_68);
        FUN_14011b2c0(*(undefined8 *)(param_1 + 0x20),*(undefined4 *)(param_1 + 0x18),local_68);
        sprintf((char *)local_88,"<bits n=\"%d\">");
        FUN_1400bc640(param_2,local_88);
        FUN_1400ba700(local_68,param_2);
        FUN_1400bc640(param_2,"</bits>");
        FUN_1400b92d0(local_68);
        return;
      }
      FUN_1400bc640(param_2,"<bits n=\"0\" />");
      return;
    }
    if (iVar1 == 4) {
      if ((param_3 != 0) && (0x100 < *(uint *)(param_1 + 0x18))) {
        local_88[0] = operator_new(0x28);
        if (local_88[0] == (void *)0x0) {
          uVar2 = 0;
        }
        else {
          uVar2 = FUN_1400b8c40(local_88[0]);
        }
        FUN_1400b97e0(uVar2,*(undefined8 *)(param_1 + 0x20),*(undefined4 *)(param_1 + 0x18));
        FUN_140139d70(param_3);
        sprintf(local_68,"<octets src=\"ext\">%d</octets>");
        FUN_1400d0c90(param_3,uVar2);
        FUN_1400bc640(param_2,local_68);
        return;
      }
      FUN_1400f0d10(local_88);
      FUN_1400f2c30(local_88,0x50);
      FUN_1400bc640(param_2,"<octets>");
      if ((*(int *)(param_1 + 0x18) != 0) && (*(longlong *)(param_1 + 0x20) != 0)) {
        FUN_1400f0d40(local_88,*(longlong *)(param_1 + 0x20),*(int *)(param_1 + 0x18),param_2);
      }
      FUN_1400bc640(param_2,"</octets>");
      FUN_1400f0d30(local_88);
      return;
    }
    if (iVar1 == 6) {
      FUN_1400bc640(param_2,"<oid>");
      if ((*(longlong *)(param_1 + 0x20) != 0) && (uVar3 = 0, *(int *)(param_1 + 0x18) != 0)) {
        lVar5 = 0;
        do {
          if (uVar3 != 0) {
            FUN_1400bbe50(param_2,0x2e);
          }
          FUN_1400be4a0(param_2,*(undefined4 *)(*(longlong *)(param_1 + 0x20) + lVar5));
          uVar3 = uVar3 + 1;
          lVar5 = lVar5 + 4;
        } while (uVar3 < *(uint *)(param_1 + 0x18));
      }
      FUN_1400bc640(param_2,"</oid>");
      return;
    }
    if (iVar1 == 0xd) {
      FUN_1400bc640(param_2,"<relativeOid>");
      if ((*(longlong *)(param_1 + 0x20) != 0) && (uVar3 = 0, *(int *)(param_1 + 0x18) != 0)) {
        lVar5 = 0;
        do {
          if (uVar3 != 0) {
            FUN_1400bbe50(param_2,0x2e);
          }
          FUN_1400be4a0(param_2,*(undefined4 *)(*(longlong *)(param_1 + 0x20) + lVar5));
          uVar3 = uVar3 + 1;
          lVar5 = lVar5 + 4;
        } while (uVar3 < *(uint *)(param_1 + 0x18));
      }
      FUN_1400bc640(param_2,"</relativeOid>");
      return;
    }
    if (iVar1 == 0x16) {
      FUN_1400bc640(param_2,"<ia5>");
      if ((*(int *)(param_1 + 0x18) != 0) && (*(longlong *)(param_1 + 0x20) != 0)) {
        FUN_1400bc8a0(param_2);
      }
      FUN_1400bc640(param_2,"</ia5>");
      return;
    }
    if (iVar1 == 0x14) {
      FUN_1400bc640(param_2,"<t61>");
      if ((*(int *)(param_1 + 0x18) != 0) && (*(longlong *)(param_1 + 0x20) != 0)) {
        FUN_1400b6fd0(local_128);
        FUN_1400b7ba0(local_128,*(undefined8 *)(param_1 + 0x20),*(undefined4 *)(param_1 + 0x18));
        uVar2 = FUN_1400b7ce0(local_128);
        FUN_1400bc640(param_2,uVar2);
        FUN_1400b7090(local_128);
      }
      FUN_1400bc640(param_2,&DAT_140249e2c);
      return;
    }
    if (iVar1 == 0x13) {
      FUN_1400bc640(param_2,"<printable>");
      if ((*(int *)(param_1 + 0x18) != 0) && (*(longlong *)(param_1 + 0x20) != 0)) {
        FUN_1400bc8a0(param_2);
      }
      FUN_1400bc640(param_2,"</printable>");
      return;
    }
    if (iVar1 == 0xc) {
      FUN_1400b6fd0(local_128);
      if ((*(int *)(param_1 + 0x18) != 0) && (*(longlong *)(param_1 + 0x20) != 0)) {
        FUN_1400b74d0(local_128);
      }
      FUN_1400bc640(param_2,"<utf8>");
      uVar2 = FUN_1400b7ce0(local_128);
      FUN_1400bc640(param_2,uVar2);
      FUN_1400bc640(param_2,"</utf8>");
      FUN_1400b7090(local_128);
      return;
    }
    if (iVar1 == 0x17) {
      FUN_1400bc640(param_2,"<utctime>");
      if ((*(int *)(param_1 + 0x18) != 0) && (*(longlong *)(param_1 + 0x20) != 0)) {
        FUN_1400bc8a0(param_2);
      }
      FUN_1400bc640(param_2,"</utctime>");
      return;
    }
    if (iVar1 == 0x10) {
      FUN_1400bc640(param_2,"<sequence>");
      if (*(longlong *)(param_1 + 0x20) != 0) {
        iVar1 = FUN_140139d70();
        local_88[0] = (void *)CONCAT44(local_88[0]._4_4_,iVar1);
        iVar4 = 0;
        if (0 < iVar1) {
          do {
            lVar5 = FUN_1400d0aa0(*(undefined8 *)(param_1 + 0x20),iVar4);
            if (lVar5 != 0) {
              FUN_14011b7b0(lVar5,param_2,param_3);
            }
            iVar4 = iVar4 + 1;
          } while (iVar4 < (int)local_88[0]);
        }
      }
      FUN_1400bc640(param_2,"</sequence>");
      return;
    }
    if (iVar1 == 0x11) {
      FUN_1400bc640(param_2,"<set>");
      if (*(longlong *)(param_1 + 0x20) != 0) {
        iVar1 = FUN_140139d70();
        local_88[0] = (void *)CONCAT44(local_88[0]._4_4_,iVar1);
        iVar4 = 0;
        if (0 < iVar1) {
          do {
            lVar5 = FUN_1400d0aa0(*(undefined8 *)(param_1 + 0x20),iVar4);
            if (lVar5 != 0) {
              FUN_14011b7b0(lVar5,param_2,param_3);
            }
            iVar4 = iVar4 + 1;
          } while (iVar4 < (int)local_88[0]);
        }
      }
      FUN_1400bc640(param_2,"</set>");
      return;
    }
  }
  FUN_14011ad30();
  return;
}



undefined8 * FUN_14011bda0(undefined8 *param_1,uint param_2)

{
  *param_1 = AsnItem::vftable;
  FUN_14011b230();
  FUN_1400d0ee0(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14011bdf0(longlong param_1,undefined1 param_2)

{
  FUN_14011b230();
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined2 *)(param_1 + 0x10) = 0;
  *(undefined1 *)(param_1 + 0x20) = param_2;
  return;
}



void FUN_14011be30(longlong param_1,void *param_2,uint param_3)

{
  void *_Dst;
  
  FUN_14011b230();
  *(undefined4 *)(param_1 + 0x14) = 2;
  *(undefined2 *)(param_1 + 0x10) = 0;
  if (param_3 != 0) {
    _Dst = operator_new((ulonglong)param_3);
    *(void **)(param_1 + 0x20) = _Dst;
    memcpy(_Dst,param_2,(ulonglong)param_3);
  }
  *(uint *)(param_1 + 0x18) = param_3;
  return;
}



void FUN_14011bea0(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  FUN_14011b230();
  *(undefined8 *)(param_1 + 0x20) = param_2;
  *(undefined4 *)(param_1 + 0x18) = param_3;
  *(undefined4 *)(param_1 + 0x14) = 3;
  *(undefined2 *)(param_1 + 0x10) = 0;
  return;
}



void FUN_14011bef0(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  FUN_14011b230();
  *(undefined8 *)(param_1 + 0x20) = param_2;
  *(undefined4 *)(param_1 + 0x18) = param_3;
  *(undefined4 *)(param_1 + 0x14) = 4;
  *(undefined2 *)(param_1 + 0x10) = 0;
  return;
}



void FUN_14011bf40(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  FUN_14011b230();
  *(undefined8 *)(param_1 + 0x20) = param_2;
  *(undefined4 *)(param_1 + 0x18) = param_3;
  *(undefined4 *)(param_1 + 0x14) = 6;
  *(undefined2 *)(param_1 + 0x10) = 0;
  return;
}



void FUN_14011bf90(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  FUN_14011b230();
  *(undefined8 *)(param_1 + 0x20) = param_2;
  *(undefined4 *)(param_1 + 0x18) = param_3;
  *(undefined4 *)(param_1 + 0x14) = 0xd;
  *(undefined2 *)(param_1 + 0x10) = 0;
  return;
}



void FUN_14011bfe0(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  FUN_14011b230();
  *(undefined8 *)(param_1 + 0x20) = param_2;
  *(undefined4 *)(param_1 + 0x18) = param_3;
  *(undefined4 *)(param_1 + 0x14) = 0xc;
  *(undefined2 *)(param_1 + 0x10) = 0;
  return;
}



void FUN_14011c030(longlong param_1,longlong param_2)

{
  void *pvVar1;
  undefined8 uVar2;
  
  FUN_14011b230();
  *(undefined2 *)(param_1 + 0x10) = 1;
  uVar2 = 0;
  *(undefined8 *)(param_1 + 0x14) = 0x10;
  *(longlong *)(param_1 + 0x20) = param_2;
  if (param_2 == 0) {
    pvVar1 = operator_new(0x28);
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400d0a70(pvVar1);
    }
    *(undefined8 *)(param_1 + 0x20) = uVar2;
  }
  return;
}



void FUN_14011c0a0(longlong param_1,longlong param_2)

{
  void *pvVar1;
  undefined8 uVar2;
  
  FUN_14011b230();
  *(undefined2 *)(param_1 + 0x10) = 1;
  uVar2 = 0;
  *(undefined8 *)(param_1 + 0x14) = 0x11;
  *(longlong *)(param_1 + 0x20) = param_2;
  if (param_2 == 0) {
    pvVar1 = operator_new(0x28);
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_1400d0a70(pvVar1);
    }
    *(undefined8 *)(param_1 + 0x20) = uVar2;
  }
  return;
}



void FUN_14011c110(longlong param_1,undefined4 param_2,undefined1 param_3,undefined1 param_4,
                  longlong param_5)

{
  void *pvVar1;
  
  FUN_14011b230();
  *(undefined4 *)(param_1 + 0x14) = param_2;
  *(undefined1 *)(param_1 + 0x11) = param_3;
  *(undefined1 *)(param_1 + 0x10) = param_4;
  if (param_5 == 0) {
    pvVar1 = operator_new(0x28);
    param_5 = 0;
    if (pvVar1 != (void *)0x0) {
      param_5 = FUN_1400d0a70(pvVar1);
    }
  }
  *(longlong *)(param_1 + 0x20) = param_5;
  return;
}



void FUN_14011c190(longlong param_1,undefined4 param_2,undefined1 param_3,void *param_4,uint param_5
                  )

{
  void *_Dst;
  
  FUN_14011b230();
  *(undefined1 *)(param_1 + 0x11) = param_3;
  *(undefined4 *)(param_1 + 0x14) = param_2;
  *(undefined1 *)(param_1 + 0x10) = 0;
  if ((param_5 != 0) && (param_4 != (void *)0x0)) {
    _Dst = operator_new((ulonglong)param_5);
    *(void **)(param_1 + 0x20) = _Dst;
    memcpy(_Dst,param_4,(ulonglong)param_5);
    *(uint *)(param_1 + 0x18) = param_5;
  }
  return;
}



void FUN_14011c200(longlong param_1,void *param_2,uint param_3)

{
  void *_Dst;
  
  _Dst = (void *)0x0;
  if (param_3 != 0) {
    if (param_2 == (void *)0x0) {
      return;
    }
    _Dst = operator_new((ulonglong)param_3);
    memcpy(_Dst,param_2,(ulonglong)param_3);
  }
  FUN_14011b230(param_1);
  *(void **)(param_1 + 0x20) = _Dst;
  *(uint *)(param_1 + 0x18) = param_3;
  *(undefined4 *)(param_1 + 0x14) = 4;
  *(undefined2 *)(param_1 + 0x10) = 0;
  return;
}



void FUN_14011c280(longlong param_1,void *param_2,uint param_3)

{
  void *_Dst;
  
  _Dst = (void *)0x0;
  if (param_3 != 0) {
    if (param_2 == (void *)0x0) {
      return;
    }
    _Dst = operator_new((ulonglong)param_3);
    memcpy(_Dst,param_2,(ulonglong)param_3);
  }
  FUN_14011b230(param_1);
  *(undefined4 *)(param_1 + 0x14) = 0x17;
  *(undefined2 *)(param_1 + 0x10) = 0;
  *(void **)(param_1 + 0x20) = _Dst;
  *(uint *)(param_1 + 0x18) = param_3;
  return;
}



void FUN_14011c300(longlong param_1,void *param_2,uint param_3)

{
  void *_Dst;
  
  _Dst = (void *)0x0;
  if (param_3 != 0) {
    if (param_2 == (void *)0x0) {
      return;
    }
    _Dst = operator_new((ulonglong)param_3);
    memcpy(_Dst,param_2,(ulonglong)param_3);
  }
  FUN_14011b230(param_1);
  *(undefined4 *)(param_1 + 0x14) = 0x16;
  *(undefined2 *)(param_1 + 0x10) = 0;
  *(void **)(param_1 + 0x20) = _Dst;
  *(uint *)(param_1 + 0x18) = param_3;
  return;
}



void FUN_14011c380(longlong param_1,void *param_2,uint param_3)

{
  void *_Dst;
  
  _Dst = (void *)0x0;
  if (param_3 != 0) {
    if (param_2 == (void *)0x0) {
      return;
    }
    _Dst = operator_new((ulonglong)param_3);
    memcpy(_Dst,param_2,(ulonglong)param_3);
  }
  FUN_14011b230(param_1);
  *(undefined4 *)(param_1 + 0x14) = 0x14;
  *(undefined2 *)(param_1 + 0x10) = 0;
  *(void **)(param_1 + 0x20) = _Dst;
  *(uint *)(param_1 + 0x18) = param_3;
  return;
}



void FUN_14011c400(longlong param_1,void *param_2,uint param_3)

{
  void *_Dst;
  
  _Dst = (void *)0x0;
  if (param_3 != 0) {
    if (param_2 == (void *)0x0) {
      return;
    }
    _Dst = operator_new((ulonglong)param_3);
    memcpy(_Dst,param_2,(ulonglong)param_3);
  }
  FUN_14011b230(param_1);
  *(undefined4 *)(param_1 + 0x14) = 0x13;
  *(undefined2 *)(param_1 + 0x10) = 0;
  *(void **)(param_1 + 0x20) = _Dst;
  *(uint *)(param_1 + 0x18) = param_3;
  return;
}



undefined8
FUN_14011c480(byte *param_1,int param_2,int param_3,char param_4,char *param_5,int *param_6,
             longlong *param_7,char param_8)

{
  byte bVar1;
  bool bVar2;
  char cVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  undefined8 uVar7;
  longlong lVar8;
  longlong lVar9;
  undefined8 *puVar10;
  undefined8 uVar11;
  byte bVar12;
  uint uVar13;
  byte *pbVar14;
  char *pcVar15;
  uint uVar16;
  int iVar17;
  int iVar18;
  uint uVar19;
  int iVar20;
  bool bVar21;
  byte *local_res8;
  int local_res10;
  undefined8 local_c0;
  uint local_b0 [2];
  undefined8 local_a8;
  void *local_a0;
  undefined1 local_98 [48];
  uint local_68 [2];
  undefined1 local_60 [48];
  undefined8 local_30;
  
  local_30 = 0xfffffffffffffffe;
  *param_6 = 0;
  if ((param_1 == (byte *)0x0) || (param_2 == 0)) {
    return 0;
  }
  pvVar6 = operator_new(0x28);
  local_res8 = param_1;
  local_res10 = param_2;
  if (pvVar6 == (void *)0x0) {
    local_c0 = 0;
  }
  else {
    local_c0 = FUN_1400d0a70(pvVar6);
  }
  do {
    iVar18 = 0;
    if (local_res8 == (byte *)0x0) {
      pcVar15 = "nothing to parse.";
LAB_14011d4ea:
      (**(code **)(*param_7 + 0x28))(param_7,pcVar15);
LAB_14011d4f3:
      (**(code **)(*param_7 + 0x28))(param_7,"Failed to parse ASN.1 header.");
      return local_c0;
    }
    bVar1 = *local_res8;
    if (bVar1 == 0) {
      if (local_res10 == 1) {
        pcVar15 = "premature end of ASN encoding (A)";
      }
      else {
        if (local_res8[1] == 0) {
          *param_6 = *param_6 + 2;
          return local_c0;
        }
        pcVar15 = "Error in BER encoding: tag is zero but length is not.";
      }
      goto LAB_14011d4ea;
    }
    bVar12 = bVar1 >> 6;
    bVar21 = (bVar1 & 0x20) != 0;
    local_a8 = (void *)CONCAT44(local_a8._4_4_,(uint)bVar21);
    uVar16 = bVar1 & 0x1f;
    pbVar14 = local_res8;
    iVar17 = local_res10;
    if (uVar16 == 0x1f) {
      uVar16 = 0;
      pbVar14 = local_res8 + 1;
      iVar17 = local_res10 + -1;
      if (iVar17 == 0) {
        pcVar15 = "premature end of BER encoding (A)";
        goto LAB_14011d4ea;
      }
      iVar20 = 0;
      bVar1 = *pbVar14;
      iVar18 = 1;
      while ((char)bVar1 < '\0') {
        uVar16 = bVar1 & 0x7f | uVar16 << 7;
        pbVar14 = pbVar14 + 1;
        iVar18 = iVar18 + 1;
        iVar17 = iVar17 + -1;
        if (iVar17 == 0) {
          pcVar15 = "premature end of BER encoding (B)";
          goto LAB_14011d4ea;
        }
        iVar20 = iVar20 + 1;
        if (3 < iVar20) {
          pcVar15 = "cannot parse BER tag > 4 octets";
          goto LAB_14011d4ea;
        }
        bVar1 = *pbVar14;
      }
      uVar16 = *pbVar14 & 0x7f | uVar16 << 7;
    }
    pbVar14 = pbVar14 + 1;
    iVar18 = iVar18 + 1;
    iVar17 = iVar17 + -1;
    if (iVar17 == 0) {
      pcVar15 = "premature end of BER encoding (C)";
      goto LAB_14011d4ea;
    }
    local_b0[0] = 0;
    bVar2 = false;
    bVar1 = *pbVar14;
    if (bVar1 == 0x80) {
      bVar2 = true;
    }
    else if ((char)bVar1 < '\0') {
      if ((bVar1 & 0x7f) == 0) {
        pcVar15 = "Invalid length. Definite long-form is 0.";
        goto LAB_14011d4ea;
      }
      if (4 < (bVar1 & 0x7f)) {
        (**(code **)(*param_7 + 0x28))
                  (param_7,"ASN.1 length should not be more than 4 bytes in definite long-form.");
        (**(code **)(*param_7 + 0x28))
                  (param_7,
                   "This error typically occurs when trying to decode data that is not ASN.1");
        (**(code **)(*param_7 + 0x28))
                  (param_7,"A common cause is when decrypting ASN.1 data with an invalid password,")
        ;
        (**(code **)(*param_7 + 0x28))
                  (param_7,
                   "which results in garbage data. An attempt is made to decode the garbage bytes");
        (**(code **)(*param_7 + 0x28))(param_7,"as ASN.1, and this error occurs...");
        goto LAB_14011d4f3;
      }
      local_b0[0] = 0;
      uVar13 = 0;
      if ((bVar1 & 0x7f) != 0) {
        do {
          pbVar14 = pbVar14 + 1;
          iVar18 = iVar18 + 1;
          iVar17 = iVar17 + -1;
          if (iVar17 == 0) {
            pcVar15 = "premature end of BER encoding (D)";
            goto LAB_14011d4ea;
          }
          local_b0[0] = local_b0[0] << 8 | (uint)*pbVar14;
          uVar13 = uVar13 + 1;
        } while (uVar13 < (bVar1 & 0x7f));
      }
    }
    else {
      local_b0[0] = (uint)bVar1;
    }
    uVar13 = local_b0[0];
    uVar19 = iVar18 + 1;
    if ((iVar17 == 1) && (local_b0[0] != 0)) {
      pcVar15 = "premature end of BER encoding (E)";
      goto LAB_14011d4ea;
    }
    local_res8 = local_res8 + uVar19;
    uVar4 = local_res10 - uVar19;
    *param_6 = *param_6 + uVar19;
    if (bVar21) {
      if (param_8 != '\0') {
        if (uVar16 == 0x10) {
          pcVar15 = "SEQUENCE";
        }
        else if (uVar16 == 0x11) {
          pcVar15 = "SET";
        }
        else {
          pcVar15 = "Constructed Octet String";
          if (uVar16 != 4) {
            pcVar15 = "Tag=Constructed";
          }
        }
        (**(code **)(*param_7 + 0x30))(param_7,pcVar15);
      }
      if (bVar2) {
        uVar13 = uVar4;
        if (param_8 != '\0') {
          (**(code **)(*param_7 + 0x30))(param_7,"Indefinite length...");
        }
      }
      else if (uVar4 < uVar13) {
        (**(code **)(*param_7 + 0x28))
                  (param_7,"ASN data length exceeds remaining number of bytes available.");
        FUN_1400cf520(param_7,&DAT_1402491a4,uVar16);
        FUN_1400cf520(param_7,"idClass",bVar12);
        FUN_1400cf520(param_7,"bConstructed",(ulonglong)local_a8 & 0xff);
        FUN_1400cf520(param_7,"headerLen",uVar19);
        FUN_1400cf520(param_7,"dataLen",uVar13);
        FUN_1400cf520(param_7,"inlen",uVar4);
        *param_5 = '\x01';
        return local_c0;
      }
      if (param_8 != '\0') {
        (**(code **)(*param_7 + 0x48))(param_7,"DecodeAsnConstructed",1);
      }
      local_68[0] = 0;
      cVar3 = param_8;
      if (uVar16 == 4) {
        if (param_8 != '\0') {
          (**(code **)(*param_7 + 0x30))(param_7,"Constructed Octet String..");
        }
        cVar3 = '\0';
      }
      puVar10 = (undefined8 *)
                FUN_14011c480(local_res8,uVar13,param_3 + 1,0,param_5,local_68,param_7,cVar3);
      if (param_8 != '\0') {
        (**(code **)(*param_7 + 0x50))(param_7);
      }
      if (*param_5 != '\0') {
        (**(code **)(*param_7 + 0x30))(param_7,"Abort ASN.1 processing...");
        FUN_1400cf520(param_7,"recursiveDepth",param_3);
      }
      uVar13 = local_68[0];
      if (uVar4 < local_68[0]) {
        local_res10 = 0;
      }
      else {
        local_res10 = uVar4 - local_68[0];
      }
      *param_6 = *param_6 + local_68[0];
      if (uVar16 == 4) {
        FUN_1400b8c40(local_60);
        if (puVar10 != (undefined8 *)0x0) {
          iVar18 = FUN_140139d70(puVar10);
          iVar17 = 0;
          if (0 < iVar18) {
            do {
              lVar8 = FUN_1400d0aa0(puVar10,iVar17);
              if (lVar8 != 0) {
                FUN_1400b97e0(local_60,*(undefined8 *)(lVar8 + 0x20),*(undefined4 *)(lVar8 + 0x18));
              }
              iVar17 = iVar17 + 1;
            } while (iVar17 < iVar18);
          }
          FUN_1400d0d30(puVar10);
          (**(code **)*puVar10)(puVar10,1);
        }
        uVar5 = FUN_1400b8b80(local_60);
        uVar7 = FUN_1400b8c20(local_60);
        local_a0 = operator_new(0x28);
        if (local_a0 == (void *)0x0) {
          uVar11 = 0;
        }
        else {
          uVar11 = FUN_14011af10(local_a0);
        }
        FUN_14011bef0(uVar11,uVar7,uVar5);
        FUN_1400d0c90(local_c0,uVar11);
        FUN_1400b92d0(local_60);
      }
      else {
        local_a0 = operator_new(0x28);
        uVar7 = 0;
        if (local_a0 != (void *)0x0) {
          uVar7 = FUN_14011af10(local_a0);
        }
        if (uVar16 == 0x30) {
          FUN_14011c030(uVar7,puVar10);
        }
        else if (uVar16 == 0x31) {
          FUN_14011c0a0(uVar7,puVar10);
        }
        else {
          FUN_14011c110(uVar7,uVar16,bVar12,1,puVar10);
        }
        FUN_1400d0c90(local_c0,uVar7);
      }
      if (param_4 != '\0') {
        return local_c0;
      }
      if (*param_5 != '\0') {
        return local_c0;
      }
    }
    else {
      if ((uVar16 == 0x10) || (uVar16 == 0x11)) {
        (**(code **)(*param_7 + 0x28))(param_7,"Found primitive SEQUENCE or SETOF in ASN.1!");
        uVar16 = 4;
      }
      if (bVar12 == 0) {
        if (uVar4 < uVar13) {
          (**(code **)(*param_7 + 0x28))
                    (param_7,"Data length exceeds remaining amount of ASN.1 data.");
          *param_5 = '\x01';
          return local_c0;
        }
        if (uVar16 == 1) {
          if (param_8 != '\0') {
            (**(code **)(*param_7 + 0x30))(param_7,"Boolean");
          }
          if (uVar13 != 1) {
            (**(code **)(*param_7 + 0x28))(param_7,"Invalid ASN.1 - cannot decode boolean.");
            return local_c0;
          }
          bVar1 = *local_res8;
          pvVar6 = operator_new(0x28);
          if (pvVar6 == (void *)0x0) {
            lVar8 = 0;
          }
          else {
            lVar8 = FUN_14011af10(pvVar6);
          }
          FUN_14011bdf0(lVar8,bVar1 == 0xff);
        }
        else if (uVar16 == 2) {
          if (param_8 != '\0') {
            (**(code **)(*param_7 + 0x30))(param_7,"Integer");
            FUN_1400cf340(param_7,"intBytes",local_res8);
          }
          if (uVar13 == 0) {
            (**(code **)(*param_7 + 0x28))(param_7,"Invalid ASN.1 - cannot decode integer.");
            return local_c0;
          }
          pvVar6 = operator_new(0x28);
          if (pvVar6 == (void *)0x0) {
            lVar8 = 0;
          }
          else {
            lVar8 = FUN_14011af10(pvVar6);
          }
          FUN_14011be30(lVar8,local_res8,uVar13);
        }
        else if (uVar16 == 3) {
          if (param_8 != '\0') {
            (**(code **)(*param_7 + 0x30))(param_7,"Bit String");
          }
          local_b0[0] = 0;
          lVar9 = FUN_14011b350(local_res8,uVar13,local_b0);
          if (lVar9 == 0) {
            (**(code **)(*param_7 + 0x28))(param_7,"Invalid ASN.1 - cannot decode bit string.");
            return local_c0;
          }
          local_a8 = operator_new(0x28);
          if (local_a8 == (void *)0x0) {
            lVar8 = 0;
          }
          else {
            lVar8 = FUN_14011af10(local_a8);
          }
          FUN_14011bea0(lVar8,lVar9,local_b0[0]);
        }
        else if (uVar16 == 4) {
          if (param_8 != '\0') {
            FUN_1400cf520(param_7,"OctetString",uVar13);
            FUN_1400bcc20(local_98);
            FUN_1400b8c40(local_60);
            if (0x50 < uVar13) {
              uVar13 = 0x50;
            }
            FUN_1400b97e0(local_60,local_res8,uVar13);
            FUN_1400ba800(local_60,&DAT_1402085ac,local_98);
            lVar8 = *param_7;
            uVar7 = FUN_1400b8b90(local_98);
            (**(code **)(lVar8 + 0x58))(param_7,"qp_string",uVar7);
            FUN_1400b92d0(local_60);
            FUN_1400bceb0(local_98);
            uVar13 = local_b0[0];
          }
          pvVar6 = operator_new(0x28);
          if (pvVar6 == (void *)0x0) {
            lVar8 = 0;
          }
          else {
            lVar8 = FUN_14011af10(pvVar6);
          }
          FUN_14011c200(lVar8,local_res8,uVar13);
        }
        else if (uVar16 == 5) {
          if (param_8 != '\0') {
            (**(code **)(*param_7 + 0x30))(param_7,&DAT_14024a2ec);
          }
          pvVar6 = operator_new(0x28);
          if (pvVar6 == (void *)0x0) {
            lVar8 = 0;
          }
          else {
            lVar8 = FUN_14011af10(pvVar6);
          }
          FUN_14011b230(lVar8);
          *(undefined4 *)(lVar8 + 0x14) = 5;
          *(undefined2 *)(lVar8 + 0x10) = 0;
        }
        else {
          if (uVar16 == 6) {
            local_a8 = (void *)((ulonglong)local_a8._4_4_ << 0x20);
            lVar8 = FUN_14011b430(local_res8,uVar13,&local_a8);
            if (lVar8 == 0) {
              (**(code **)(*param_7 + 0x28))(param_7,"Invalid ASN.1 - cannot decode OID.");
              return local_c0;
            }
            local_a0 = operator_new(0x28);
            if (local_a0 == (void *)0x0) {
              uVar7 = 0;
            }
            else {
              uVar7 = FUN_14011af10(local_a0);
            }
            FUN_14011bf40(uVar7,lVar8,(ulonglong)local_a8 & 0xffffffff);
            FUN_1400d0c90(local_c0,uVar7);
            if (param_8 != '\0') {
              FUN_1400bcc20(local_60);
              FUN_14011b1a0(uVar7,local_60);
              FUN_1400bcc20(local_98);
              FUN_14011af50(local_60,local_98);
              iVar18 = FUN_1400bbb10(local_98);
              if (iVar18 != 0) {
                FUN_1400bc640(local_60,&DAT_14024a2e8);
                FUN_1400bda40(local_60,local_98);
                FUN_1400bc640(local_60,&DAT_14024a2e4);
              }
              lVar8 = *param_7;
              uVar7 = FUN_1400b8b90(local_60);
              (**(code **)(lVar8 + 0x58))(param_7,&DAT_14024a2e0,uVar7);
              FUN_1400bceb0(local_98);
              FUN_1400bceb0(local_60);
              uVar13 = local_b0[0];
            }
            goto LAB_14011c6f0;
          }
          if (uVar16 == 0xc) {
            if (param_8 != '\0') {
              (**(code **)(*param_7 + 0x30))(param_7,"UTF-8 String");
              FUN_1400bcc20(local_98);
              FUN_1400b8c40(local_60);
              if (0x50 < uVar13) {
                uVar13 = 0x50;
              }
              FUN_1400b97e0(local_60,local_res8,uVar13);
              FUN_1400ba800(local_60,&DAT_1402085ac,local_98);
              lVar8 = *param_7;
              uVar7 = FUN_1400b8b90(local_98);
              (**(code **)(lVar8 + 0x58))(param_7,"qp_string",uVar7);
              FUN_1400b92d0(local_60);
              FUN_1400bceb0(local_98);
              uVar13 = local_b0[0];
            }
            local_a8 = (void *)((ulonglong)local_a8 & 0xffffffff00000000);
            lVar9 = FUN_14011b640(local_res8,uVar13,&local_a8);
            if (lVar9 == 0) {
              (**(code **)(*param_7 + 0x28))(param_7,"Invalid ASN.1 - cannot decode UTF-8 string.");
              return local_c0;
            }
            local_a0 = operator_new(0x28);
            if (local_a0 == (void *)0x0) {
              lVar8 = 0;
            }
            else {
              lVar8 = FUN_14011af10(local_a0);
            }
            FUN_14011bfe0(lVar8,lVar9,(ulonglong)local_a8 & 0xffffffff);
          }
          else if (uVar16 == 0x13) {
            if (param_8 != '\0') {
              (**(code **)(*param_7 + 0x30))(param_7,"Printable String");
              FUN_1400bcc20(local_98);
              FUN_1400bc8a0(local_98,local_res8,uVar13);
              uVar7 = FUN_1400b8b90(local_98);
              FUN_1400cf3d0(param_7,"qp_string",uVar7);
              FUN_1400bceb0(local_98);
            }
            local_a0 = operator_new(0x28);
            if (local_a0 == (void *)0x0) {
              lVar8 = 0;
            }
            else {
              lVar8 = FUN_14011af10(local_a0);
            }
            FUN_14011c400(lVar8,local_res8,uVar13);
          }
          else if (uVar16 == 0x16) {
            if (param_8 != '\0') {
              (**(code **)(*param_7 + 0x30))(param_7,"IA5 String");
              FUN_1400bcc20(local_98);
              FUN_1400bc8a0(local_98,local_res8,uVar13);
              uVar7 = FUN_1400b8b90(local_98);
              FUN_1400cf3d0(param_7,"qp_string",uVar7);
              FUN_1400bceb0(local_98);
            }
            local_a0 = operator_new(0x28);
            if (local_a0 == (void *)0x0) {
              lVar8 = 0;
            }
            else {
              lVar8 = FUN_14011af10(local_a0);
            }
            FUN_14011c300(lVar8,local_res8,uVar13);
          }
          else if (uVar16 == 0x14) {
            if (param_8 != '\0') {
              (**(code **)(*param_7 + 0x30))(param_7,"T61 String");
              FUN_1400bcc20(local_98);
              FUN_1400bc8a0(local_98,local_res8,uVar13);
              uVar7 = FUN_1400b8b90(local_98);
              FUN_1400cf3d0(param_7,"qp_string",uVar7);
              FUN_1400bceb0(local_98);
            }
            local_a0 = operator_new(0x28);
            if (local_a0 == (void *)0x0) {
              lVar8 = 0;
            }
            else {
              lVar8 = FUN_14011af10(local_a0);
            }
            FUN_14011c380(lVar8,local_res8,uVar13);
          }
          else if (uVar16 == 0x17) {
            if (param_8 != '\0') {
              (**(code **)(*param_7 + 0x30))(param_7,"UTC String");
              FUN_1400bcc20(local_98);
              FUN_1400bc8a0(local_98,local_res8,uVar13);
              uVar7 = FUN_1400b8b90(local_98);
              FUN_1400cf3d0(param_7,"qp_string",uVar7);
              FUN_1400bceb0(local_98);
            }
            local_a0 = operator_new(0x28);
            if (local_a0 == (void *)0x0) {
              lVar8 = 0;
            }
            else {
              lVar8 = FUN_14011af10(local_a0);
            }
            FUN_14011c280(lVar8,local_res8,uVar13);
          }
          else {
            if (uVar16 == 0xd) {
              local_a8 = (void *)((ulonglong)local_a8._4_4_ << 0x20);
              lVar8 = FUN_14011b550(local_res8,uVar13,&local_a8);
              if (lVar8 == 0) {
                (**(code **)(*param_7 + 0x28))
                          (param_7,"Invalid ASN.1 - cannot decode Relative OID.");
                return local_c0;
              }
              local_a0 = operator_new(0x28);
              if (local_a0 == (void *)0x0) {
                uVar7 = 0;
              }
              else {
                uVar7 = FUN_14011af10(local_a0);
              }
              FUN_14011bf90(uVar7,lVar8,(ulonglong)local_a8 & 0xffffffff);
              FUN_1400d0c90(local_c0,uVar7);
              if (param_8 != '\0') {
                FUN_1400bcc20(local_60);
                FUN_14011b1a0(uVar7,local_60);
                FUN_1400bcc20(local_98);
                FUN_14011af50(local_60,local_98);
                iVar18 = FUN_1400bbb10(local_98);
                if (iVar18 != 0) {
                  FUN_1400bc640(local_60,&DAT_14024a2e8);
                  FUN_1400bda40(local_60,local_98);
                  FUN_1400bc640(local_60,&DAT_14024a2e4);
                }
                lVar8 = *param_7;
                uVar7 = FUN_1400b8b90(local_60);
                (**(code **)(lVar8 + 0x58))(param_7,"RelativeOid",uVar7);
                FUN_1400bceb0(local_98);
                FUN_1400bceb0(local_60);
                uVar13 = local_b0[0];
              }
              goto LAB_14011c6f0;
            }
            if (param_8 != '\0') {
              (**(code **)(*param_7 + 0x30))(param_7,"Primitive Universal");
              FUN_1400cf5e0(param_7,&DAT_1402491a4,uVar16);
              FUN_1400cf520(param_7,"numBytes",uVar13);
              FUN_1400bcc20(local_98);
              FUN_1400b8c40(local_60);
              FUN_1400b97e0(local_60,local_res8,uVar13);
              FUN_1400ba800(local_60,&DAT_1402085ac,local_98);
              lVar8 = *param_7;
              uVar7 = FUN_1400b8b90(local_98);
              (**(code **)(lVar8 + 0x58))(param_7,"qp_string",uVar7);
              FUN_1400b92d0(local_60);
              FUN_1400bceb0(local_98);
              uVar13 = local_b0[0];
            }
            local_a0 = operator_new(0x28);
            lVar8 = 0;
            if (local_a0 != (void *)0x0) {
              lVar8 = FUN_14011af10(local_a0);
            }
            FUN_14011c190(lVar8,uVar16,0,local_res8,uVar13);
          }
        }
        FUN_1400d0c90(local_c0,lVar8);
      }
      else {
        pvVar6 = operator_new(0x28);
        uVar7 = 0;
        if (pvVar6 != (void *)0x0) {
          uVar7 = FUN_14011af10(pvVar6);
        }
        FUN_14011c190(uVar7,uVar16,bVar12,local_res8,uVar13);
        FUN_1400d0c90(local_c0,uVar7);
      }
LAB_14011c6f0:
      uVar16 = uVar4;
      if (uVar13 <= uVar4) {
        uVar16 = uVar13;
      }
      local_res10 = uVar4 - uVar16;
      *param_6 = *param_6 + uVar13;
    }
    local_res8 = local_res8 + uVar13;
    if (local_res10 == 0) {
      return local_c0;
    }
  } while( true );
}



undefined8
FUN_14011d520(undefined8 param_1,undefined1 param_2,undefined8 param_3,undefined8 param_4,
             longlong *param_5,undefined1 param_6)

{
  int iVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined1 local_38 [8];
  undefined8 local_30;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  FUN_1400bbe30(param_3);
  iVar1 = FUN_1400b8b80(param_1);
  FUN_1400bc530(param_3,iVar1 * 2,0x3f2);
  iVar1 = FUN_1400b8b80(param_1);
  if (iVar1 == 0) {
    (**(code **)(*param_5 + 0x28))
              (param_5,"Failed to decode DER -- number of bytes in DER is zero.");
  }
  else {
    puVar5 = (undefined8 *)0x0;
    local_30 = (void *)((ulonglong)local_30._4_4_ << 0x20);
    local_38[0] = 0;
    uVar2 = FUN_1400b8b80(param_1);
    uVar3 = FUN_1400b8b90(param_1);
    puVar4 = (undefined8 *)FUN_14011c480(uVar3,uVar2,1,param_2,local_38,&local_30,param_5,param_6);
    if (puVar4 != (undefined8 *)0x0) {
      iVar1 = FUN_140139d70(puVar4);
      if (iVar1 == 0) {
        (**(code **)(*param_5 + 0x28))(param_5,"DER contains no ASN.1 nodes.");
        (**(code **)*puVar4)(puVar4,1);
        return 0;
      }
      iVar1 = FUN_140139d70(puVar4);
      if (iVar1 < 2) {
        uVar3 = FUN_1400d0aa0(puVar4,0);
        FUN_14011b7b0(uVar3,param_3,param_4);
        FUN_1400d0d30(puVar4);
        (**(code **)*puVar4)(puVar4,1);
      }
      else {
        local_30 = operator_new(0x28);
        if (local_30 != (void *)0x0) {
          puVar5 = (undefined8 *)FUN_14011af10(local_30);
        }
        FUN_14011c030(puVar5,puVar4);
        FUN_14011b7b0(puVar5,param_3,param_4);
        if (puVar5 != (undefined8 *)0x0) {
          (**(code **)*puVar5)(puVar5,1);
        }
      }
      return 1;
    }
  }
  return 0;
}



undefined8 * FUN_14011d6d0(undefined8 *param_1,longlong param_2)

{
  undefined1 auVar1 [16];
  __uint64 _Var2;
  void *pvVar3;
  
  *param_1 = mp_int::vftable;
  if (*(int *)(param_2 + 0x14) != 0) {
    auVar1._8_8_ = 0;
    auVar1._0_8_ = (longlong)*(int *)(param_2 + 0x14);
    _Var2 = SUB168(ZEXT816(4) * auVar1,0);
    if (SUB168(ZEXT816(4) * auVar1,8) != 0) {
      _Var2 = 0xffffffffffffffff;
    }
    pvVar3 = operator_new(_Var2);
    param_1[1] = pvVar3;
    memcpy(pvVar3,*(void **)(param_2 + 8),(longlong)*(int *)(param_2 + 0x14) << 2);
    *(undefined4 *)((longlong)param_1 + 0x14) = *(undefined4 *)(param_2 + 0x14);
    *(undefined4 *)(param_1 + 3) = *(undefined4 *)(param_2 + 0x18);
    *(undefined4 *)(param_1 + 2) = *(undefined4 *)(param_2 + 0x10);
    return param_1;
  }
  pvVar3 = operator_new(0x80);
  param_1[1] = pvVar3;
  memset(pvVar3,0,0x80);
  *(undefined8 *)((longlong)param_1 + 0x14) = 0x20;
  *(undefined4 *)(param_1 + 2) = 0;
  return param_1;
}



longlong FUN_14011d790(longlong param_1,longlong param_2)

{
  undefined1 auVar1 [16];
  __uint64 _Var2;
  void *pvVar3;
  
  if (param_2 == param_1) {
    return param_1;
  }
  operator_delete(*(void **)(param_1 + 8));
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x14) = 0;
  *(undefined4 *)(param_1 + 0x10) = 0;
  if (*(int *)(param_2 + 0x14) != 0) {
    auVar1._8_8_ = 0;
    auVar1._0_8_ = (longlong)*(int *)(param_2 + 0x14);
    _Var2 = SUB168(ZEXT816(4) * auVar1,0);
    if (SUB168(ZEXT816(4) * auVar1,8) != 0) {
      _Var2 = 0xffffffffffffffff;
    }
    pvVar3 = operator_new(_Var2);
    *(void **)(param_1 + 8) = pvVar3;
    memcpy(pvVar3,*(void **)(param_2 + 8),(longlong)*(int *)(param_2 + 0x14) << 2);
    *(undefined4 *)(param_1 + 0x14) = *(undefined4 *)(param_2 + 0x14);
    *(undefined4 *)(param_1 + 0x18) = *(undefined4 *)(param_2 + 0x18);
    *(undefined4 *)(param_1 + 0x10) = *(undefined4 *)(param_2 + 0x10);
    return param_1;
  }
  pvVar3 = operator_new(0x80);
  *(void **)(param_1 + 8) = pvVar3;
  memset(pvVar3,0,0x80);
  *(undefined4 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x14) = 0x20;
  return param_1;
}



undefined8 * FUN_14011d870(undefined8 *param_1)

{
  void *_Dst;
  
  *param_1 = mp_int::vftable;
  _Dst = operator_new(0x80);
  param_1[1] = _Dst;
  memset(_Dst,0,0x80);
  *(undefined8 *)((longlong)param_1 + 0x14) = 0x20;
  *(undefined4 *)(param_1 + 2) = 0;
  return param_1;
}



void FUN_14011d8c0(longlong param_1,uint param_2)

{
  undefined1 auVar1 [16];
  __uint64 _Var2;
  void *_Dst;
  longlong lVar3;
  ulonglong uVar4;
  int iVar5;
  uint uVar6;
  
  if (*(int *)(param_1 + 0x14) < (int)param_2) {
    uVar6 = param_2 & 0x8000001f;
    if ((int)uVar6 < 0) {
      uVar6 = (uVar6 - 1 | 0xffffffe0) + 1;
    }
    iVar5 = param_2 + (0x40 - uVar6);
    uVar4 = (ulonglong)iVar5;
    auVar1._8_8_ = 0;
    auVar1._0_8_ = uVar4;
    _Var2 = SUB168(ZEXT816(4) * auVar1,0);
    if (SUB168(ZEXT816(4) * auVar1,8) != 0) {
      _Var2 = 0xffffffffffffffff;
    }
    _Dst = operator_new(_Var2);
    memcpy(_Dst,*(void **)(param_1 + 8),(longlong)*(int *)(param_1 + 0x14) << 2);
    lVar3 = (longlong)*(int *)(param_1 + 0x14);
    if (lVar3 < (longlong)uVar4) {
      memset((void *)((longlong)_Dst + lVar3 * 4),0,(uVar4 - lVar3) * 4);
    }
    *(int *)(param_1 + 0x14) = iVar5;
    operator_delete(*(void **)(param_1 + 8));
    *(void **)(param_1 + 8) = _Dst;
  }
  return;
}



void FUN_14011d980(undefined8 *param_1)

{
  *param_1 = mp_int::vftable;
  if (((void *)param_1[1] != (void *)0x0) && (*(int *)((longlong)param_1 + 0x14) != 0)) {
    memset((void *)param_1[1],0,(longlong)(*(int *)((longlong)param_1 + 0x14) << 2));
  }
  operator_delete((void *)param_1[1]);
  param_1[1] = 0;
  *(undefined8 *)((longlong)param_1 + 0x14) = 0;
  *(undefined4 *)(param_1 + 2) = 0;
  return;
}



undefined8 FUN_14011d9d0(longlong param_1,longlong param_2)

{
  int iVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  
  if (param_1 != param_2) {
    if (*(int *)(param_2 + 0x14) < *(int *)(param_1 + 0x10)) {
      FUN_14011d8c0(param_2);
    }
    puVar4 = *(undefined4 **)(param_1 + 8);
    puVar3 = *(undefined4 **)(param_2 + 8);
    iVar1 = 0;
    puVar2 = puVar3;
    if (0 < *(int *)(param_1 + 0x10)) {
      do {
        iVar1 = iVar1 + 1;
        puVar3 = puVar2 + 1;
        *puVar2 = *puVar4;
        puVar4 = puVar4 + 1;
        puVar2 = puVar3;
      } while (iVar1 < *(int *)(param_1 + 0x10));
    }
    if (iVar1 < *(int *)(param_2 + 0x10)) {
      do {
        *puVar3 = 0;
        iVar1 = iVar1 + 1;
        puVar3 = puVar3 + 1;
      } while (iVar1 < *(int *)(param_2 + 0x10));
    }
    *(undefined4 *)(param_2 + 0x10) = *(undefined4 *)(param_1 + 0x10);
    *(undefined4 *)(param_2 + 0x18) = *(undefined4 *)(param_1 + 0x18);
  }
  return 0;
}



void FUN_14011da60(undefined8 param_1,undefined8 param_2)

{
  void *pvVar1;
  undefined **local_30;
  void *local_28;
  undefined4 local_20;
  undefined8 local_1c;
  
  local_30 = mp_int::vftable;
  local_28 = operator_new(0x80);
  memset(local_28,0,0x80);
  local_20 = 0;
  local_1c = 0x20;
  FUN_14011d790(&local_30,param_1);
  FUN_14011d790(param_1,param_2);
  FUN_14011d790(param_2);
  pvVar1 = local_28;
  if ((local_28 != (void *)0x0) && ((int)local_1c != 0)) {
    memset(local_28,0,(longlong)((int)local_1c << 2));
  }
  operator_delete(pvVar1);
  return;
}



undefined8 FUN_14011db10(longlong param_1,longlong param_2)

{
  int iVar1;
  uint uVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  uint *puVar6;
  uint uVar7;
  
  if (*(int *)(param_2 + 0x14) < *(int *)(param_1 + 0x10)) {
    FUN_14011d8c0(param_2);
  }
  iVar4 = *(int *)(param_1 + 0x10);
  iVar1 = *(int *)(param_2 + 0x10);
  uVar5 = 0;
  *(int *)(param_2 + 0x10) = iVar4;
  puVar6 = (uint *)(*(longlong *)(param_1 + 8) + -4 + (longlong)iVar4 * 4);
  puVar3 = (uint *)(*(longlong *)(param_2 + 8) + -4 + (longlong)iVar4 * 4);
  while (iVar4 = iVar4 + -1, -1 < iVar4) {
    uVar2 = *puVar6;
    uVar7 = uVar5 << 0x1b;
    puVar6 = puVar6 + -1;
    uVar5 = uVar2 & 1;
    *puVar3 = uVar2 >> 1 | uVar7;
    puVar3 = puVar3 + -1;
  }
  iVar4 = *(int *)(param_2 + 0x10);
  if (iVar4 < iVar1) {
    memset((void *)(*(longlong *)(param_2 + 8) + (longlong)iVar4 * 4),0,
           (ulonglong)(uint)(iVar1 - iVar4) << 2);
  }
  iVar4 = *(int *)(param_2 + 0x10);
  *(undefined4 *)(param_2 + 0x18) = *(undefined4 *)(param_1 + 0x18);
  if (0 < iVar4) {
    do {
      if (*(int *)(*(longlong *)(param_2 + 8) + -4 + (longlong)*(int *)(param_2 + 0x10) * 4) != 0)
      break;
      iVar4 = *(int *)(param_2 + 0x10) + -1;
      *(int *)(param_2 + 0x10) = iVar4;
    } while (0 < iVar4);
    iVar4 = *(int *)(param_2 + 0x10);
  }
  if (iVar4 == 0) {
    *(undefined4 *)(param_2 + 0x18) = 0;
  }
  return 0;
}



undefined8 FUN_14011dbf0(longlong param_1,longlong param_2,undefined4 *param_3)

{
  size_t _Size;
  undefined1 auVar1 [16];
  undefined1 auVar2 [16];
  __uint64 _Var3;
  void *_Dst;
  void *pvVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  longlong lVar9;
  int iVar10;
  undefined4 uVar11;
  undefined **local_50;
  void *local_48;
  int local_40;
  int local_3c;
  undefined4 local_38;
  
  local_50 = mp_int::vftable;
  uVar8 = *(uint *)(param_1 + 0x10) & 0x8000001f;
  if ((int)uVar8 < 0) {
    uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;
  }
  iVar10 = *(uint *)(param_1 + 0x10) + (0x40 - uVar8);
  auVar1._8_8_ = 0;
  auVar1._0_8_ = (longlong)iVar10;
  _Var3 = SUB168(ZEXT816(4) * auVar1,0);
  if (SUB168(ZEXT816(4) * auVar1,8) != 0) {
    _Var3 = 0xffffffffffffffff;
  }
  _Dst = operator_new(_Var3);
  _Size = (longlong)iVar10 * 4;
  local_48 = _Dst;
  memset(_Dst,0,_Size);
  local_40 = *(int *)(param_1 + 0x10);
  uVar11 = *(undefined4 *)(param_1 + 0x18);
  uVar5 = 0;
  lVar9 = (longlong)(local_40 + -1);
  if (-1 < local_40 + -1) {
    do {
      uVar5 = (ulonglong)*(uint *)(*(longlong *)(param_1 + 8) + lVar9 * 4) | uVar5 << 0x1c;
      if (uVar5 < 3) {
        uVar6 = 0;
      }
      else {
        uVar6 = uVar5 * 0x5555555 >> 0x1c;
        uVar5 = uVar5 + uVar6 * -3;
        if (2 < uVar5) {
          uVar7 = uVar5 / 3;
          uVar5 = uVar5 % 3;
          uVar6 = uVar6 + uVar7;
        }
      }
      *(int *)((longlong)_Dst + lVar9 * 4) = (int)uVar6;
      lVar9 = lVar9 + -1;
    } while (-1 < lVar9);
  }
  if (param_3 != (undefined4 *)0x0) {
    *param_3 = (int)uVar5;
  }
  local_3c = iVar10;
  if (param_2 != 0) {
    while ((0 < local_40 && (*(int *)((longlong)_Dst + (longlong)local_40 * 4 + -4) == 0))) {
      local_40 = local_40 + -1;
    }
    if (local_40 == 0) {
      uVar11 = 0;
    }
    local_38 = uVar11;
    pvVar4 = operator_new(0x80);
    memset(pvVar4,0,0x80);
    operator_delete(pvVar4);
    if (iVar10 == 0) {
      pvVar4 = operator_new(0x80);
      memset(pvVar4,0,0x80);
      iVar10 = 0x20;
    }
    else {
      auVar2._8_8_ = 0;
      auVar2._0_8_ = (longlong)iVar10;
      _Var3 = SUB168(ZEXT816(4) * auVar2,0);
      if (SUB168(ZEXT816(4) * auVar2,8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      pvVar4 = operator_new(_Var3);
      memcpy(pvVar4,_Dst,_Size);
    }
    FUN_14011d790(&local_50,param_2);
    FUN_14011d790(param_2);
    if ((pvVar4 != (void *)0x0) && (iVar10 != 0)) {
      memset(pvVar4,0,(longlong)(iVar10 * 4));
    }
    operator_delete(pvVar4);
    _Dst = local_48;
  }
  if ((_Dst != (void *)0x0) && (local_3c != 0)) {
    memset(_Dst,0,(longlong)(local_3c * 4));
  }
  operator_delete(_Dst);
  return 0;
}



int FUN_14011deb0(longlong param_1)

{
  int iVar1;
  uint uVar2;
  
  if (*(int *)(param_1 + 0x10) != 0) {
    iVar1 = *(int *)(param_1 + 0x10) * 0x1c + -0x1c;
    for (uVar2 = *(uint *)(*(longlong *)(param_1 + 8) + -4 + (longlong)*(int *)(param_1 + 0x10) * 4)
        ; uVar2 != 0; uVar2 = uVar2 >> 1) {
      iVar1 = iVar1 + 1;
    }
    return iVar1;
  }
  return 0;
}



undefined4 FUN_14011def0(longlong param_1,uint param_2,longlong param_3)

{
  int iVar1;
  undefined4 uVar2;
  int iVar3;
  int iVar4;
  uint uVar5;
  uint *puVar6;
  uint *puVar7;
  int *piVar8;
  
  if (*(int *)(param_3 + 0x14) < *(int *)(param_1 + 0x10) + 1) {
    FUN_14011d8c0(param_3);
  }
  if ((*(int *)(param_1 + 0x18) != 1) ||
     ((*(int *)(param_1 + 0x10) < 2 && (**(uint **)(param_1 + 8) < param_2)))) {
    iVar3 = *(int *)(param_3 + 0x10);
    puVar6 = *(uint **)(param_3 + 8);
    *(undefined4 *)(param_3 + 0x18) = 0;
    piVar8 = *(int **)(param_1 + 8);
    iVar4 = 1;
    if (*(int *)(param_1 + 0x18) == 0) {
      iVar1 = *piVar8;
      puVar7 = puVar6 + 1;
      *puVar6 = param_2 + iVar1 & 0xfffffff;
      uVar5 = param_2 + iVar1 >> 0x1c;
      puVar6 = puVar7;
      if (1 < *(int *)(param_1 + 0x10)) {
        do {
          piVar8 = piVar8 + 1;
          iVar1 = *piVar8;
          iVar4 = iVar4 + 1;
          puVar7 = puVar6 + 1;
          *puVar6 = uVar5 + iVar1 & 0xfffffff;
          uVar5 = uVar5 + iVar1 >> 0x1c;
          puVar6 = puVar7;
        } while (iVar4 < *(int *)(param_1 + 0x10));
      }
      *puVar7 = uVar5;
      iVar4 = iVar4 + 1;
      *(int *)(param_3 + 0x10) = *(int *)(param_1 + 0x10) + 1;
      puVar6 = puVar7;
    }
    else {
      *(undefined4 *)(param_3 + 0x10) = 1;
      if (*(int *)(param_1 + 0x10) == 1) {
        param_2 = param_2 - **(int **)(param_1 + 8);
      }
      *puVar6 = param_2;
    }
    if (iVar4 < iVar3) {
      memset(puVar6 + 1,0,(ulonglong)(uint)(iVar3 - iVar4) << 2);
    }
    iVar3 = *(int *)(param_3 + 0x10);
    if (0 < iVar3) {
      do {
        if (*(int *)(*(longlong *)(param_3 + 8) + -4 + (longlong)*(int *)(param_3 + 0x10) * 4) != 0)
        break;
        iVar3 = *(int *)(param_3 + 0x10) + -1;
        *(int *)(param_3 + 0x10) = iVar3;
      } while (0 < iVar3);
      iVar3 = *(int *)(param_3 + 0x10);
    }
    if (iVar3 == 0) {
      *(undefined4 *)(param_3 + 0x18) = 0;
    }
    return 0;
  }
  *(undefined4 *)(param_1 + 0x18) = 0;
  uVar2 = FUN_14011e8b0(param_1,param_2,param_3);
  *(undefined4 *)(param_3 + 0x18) = 1;
  *(undefined4 *)(param_1 + 0x18) = 1;
  iVar3 = *(int *)(param_3 + 0x10);
  if (0 < iVar3) {
    do {
      if (*(int *)(*(longlong *)(param_3 + 8) + -4 + (longlong)*(int *)(param_3 + 0x10) * 4) != 0)
      break;
      iVar3 = *(int *)(param_3 + 0x10) + -1;
      *(int *)(param_3 + 0x10) = iVar3;
    } while (0 < iVar3);
    iVar3 = *(int *)(param_3 + 0x10);
  }
  if (iVar3 == 0) {
    *(undefined4 *)(param_3 + 0x18) = 0;
  }
  return uVar2;
}



undefined8 FUN_14011e090(longlong param_1,longlong param_2)

{
  int iVar1;
  uint uVar2;
  uint uVar3;
  int iVar4;
  uint *puVar5;
  longlong lVar6;
  
  iVar1 = *(int *)(param_1 + 0x10);
  if (*(int *)(param_2 + 0x10) < iVar1) {
    return 1;
  }
  if (iVar1 < *(int *)(param_2 + 0x10)) {
    return 0xffffffff;
  }
  puVar5 = (uint *)(*(longlong *)(param_1 + 8) + (longlong)(iVar1 + -1) * 4);
  iVar4 = 0;
  if (0 < iVar1) {
    lVar6 = (*(longlong *)(param_2 + 8) + (longlong)(iVar1 + -1) * 4) - (longlong)puVar5;
    do {
      uVar2 = *puVar5;
      uVar3 = *(uint *)(lVar6 + (longlong)puVar5);
      if (uVar2 >= uVar3 && uVar2 != uVar3) {
        return 1;
      }
      if (uVar2 < uVar3) {
        return 0xffffffff;
      }
      iVar4 = iVar4 + 1;
      puVar5 = puVar5 + -1;
    } while (iVar4 < iVar1);
  }
  return 0;
}



undefined8 FUN_14011e0f0(longlong param_1,int param_2)

{
  undefined4 *puVar1;
  int iVar2;
  
  puVar1 = *(undefined4 **)(param_1 + 8);
  *(undefined4 *)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x10) = 0;
  iVar2 = 0;
  if (0 < *(int *)(param_1 + 0x14)) {
    do {
      *puVar1 = 0;
      iVar2 = iVar2 + 1;
      puVar1 = puVar1 + 1;
    } while (iVar2 < *(int *)(param_1 + 0x14));
  }
  iVar2 = param_2 / 0x1c;
  FUN_14011d8c0(param_1,iVar2 + 1);
  *(int *)(param_1 + 0x10) = iVar2 + 1;
  *(int *)(*(longlong *)(param_1 + 8) + (longlong)iVar2 * 4) =
       1 << ((char)param_2 + (char)iVar2 * -0x1c & 0x1fU);
  return 0;
}



undefined8 FUN_14011e190(longlong param_1,uint param_2)

{
  int iVar1;
  undefined4 uVar2;
  ulonglong uVar3;
  undefined4 *puVar4;
  undefined4 *puVar5;
  
  if (0 < (int)param_2) {
    if (*(int *)(param_1 + 0x14) < (int)(*(int *)(param_1 + 0x10) + param_2)) {
      FUN_14011d8c0();
    }
    *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + param_2;
    iVar1 = *(int *)(param_1 + 0x10);
    puVar5 = (undefined4 *)
             (*(longlong *)(param_1 + 8) + -4 + ((longlong)iVar1 - (longlong)(int)param_2) * 4);
    if ((int)param_2 <= iVar1 + -1) {
      uVar3 = (ulonglong)(((iVar1 + -1) - param_2) + 1);
      puVar4 = (undefined4 *)(*(longlong *)(param_1 + 8) + -4 + (longlong)iVar1 * 4);
      do {
        uVar2 = *puVar5;
        puVar5 = puVar5 + -1;
        uVar3 = uVar3 - 1;
        *puVar4 = uVar2;
        puVar4 = puVar4 + -1;
      } while (uVar3 != 0);
    }
    if (0 < (int)param_2) {
      memset(*(void **)(param_1 + 8),0,(ulonglong)param_2 << 2);
    }
  }
  return 0;
}



undefined8 FUN_14011e220(longlong param_1,uint param_2,longlong param_3)

{
  uint *puVar1;
  undefined4 *puVar2;
  int iVar3;
  int iVar4;
  undefined4 *puVar5;
  undefined4 *puVar6;
  longlong lVar7;
  
  if ((int)param_2 < 1) {
    puVar2 = *(undefined4 **)(param_3 + 8);
    iVar3 = 0;
    *(undefined4 *)(param_3 + 0x18) = 0;
    *(undefined4 *)(param_3 + 0x10) = 0;
    if (0 < *(int *)(param_3 + 0x14)) {
      do {
        *puVar2 = 0;
        iVar3 = iVar3 + 1;
        puVar2 = puVar2 + 1;
      } while (iVar3 < *(int *)(param_3 + 0x14));
    }
  }
  else {
    iVar3 = *(int *)(param_1 + 0x10);
    if ((int)param_2 < iVar3 * 0x1c) {
      if (param_1 != param_3) {
        if (*(int *)(param_3 + 0x14) < iVar3) {
          FUN_14011d8c0(param_3);
        }
        puVar2 = *(undefined4 **)(param_1 + 8);
        puVar6 = *(undefined4 **)(param_3 + 8);
        iVar3 = 0;
        puVar5 = puVar6;
        if (0 < *(int *)(param_1 + 0x10)) {
          do {
            iVar3 = iVar3 + 1;
            puVar6 = puVar5 + 1;
            *puVar5 = *puVar2;
            puVar2 = puVar2 + 1;
            puVar5 = puVar6;
          } while (iVar3 < *(int *)(param_1 + 0x10));
        }
        if (iVar3 < *(int *)(param_3 + 0x10)) {
          do {
            *puVar6 = 0;
            iVar3 = iVar3 + 1;
            puVar6 = puVar6 + 1;
          } while (iVar3 < *(int *)(param_3 + 0x10));
        }
        *(undefined4 *)(param_3 + 0x10) = *(undefined4 *)(param_1 + 0x10);
        *(undefined4 *)(param_3 + 0x18) = *(undefined4 *)(param_1 + 0x18);
      }
      iVar3 = (int)param_2 / 0x1c;
      iVar4 = (uint)(param_2 != iVar3 * 0x1c) + iVar3;
      if (iVar4 < *(int *)(param_3 + 0x10)) {
        lVar7 = (longlong)iVar4 << 2;
        do {
          iVar4 = iVar4 + 1;
          *(undefined4 *)(lVar7 + *(longlong *)(param_3 + 8)) = 0;
          lVar7 = lVar7 + 4;
        } while (iVar4 < *(int *)(param_3 + 0x10));
      }
      puVar1 = (uint *)(*(longlong *)(param_3 + 8) + (longlong)iVar3 * 4);
      *puVar1 = *puVar1 & (1 << ((char)param_2 + (char)(param_2 / 0x1c) * -0x1c & 0x1fU)) - 1U;
      iVar3 = *(int *)(param_3 + 0x10);
      if (0 < iVar3) {
        do {
          if (*(int *)(*(longlong *)(param_3 + 8) + -4 + (longlong)*(int *)(param_3 + 0x10) * 4) !=
              0) break;
          iVar3 = *(int *)(param_3 + 0x10) + -1;
          *(int *)(param_3 + 0x10) = iVar3;
        } while (0 < iVar3);
        iVar3 = *(int *)(param_3 + 0x10);
      }
      if (iVar3 == 0) {
        *(undefined4 *)(param_3 + 0x18) = 0;
      }
    }
    else if (param_1 != param_3) {
      if (*(int *)(param_3 + 0x14) < iVar3) {
        FUN_14011d8c0(param_3);
      }
      puVar2 = *(undefined4 **)(param_1 + 8);
      puVar6 = *(undefined4 **)(param_3 + 8);
      iVar3 = 0;
      puVar5 = puVar6;
      if (0 < *(int *)(param_1 + 0x10)) {
        do {
          iVar3 = iVar3 + 1;
          puVar6 = puVar5 + 1;
          *puVar5 = *puVar2;
          puVar2 = puVar2 + 1;
          puVar5 = puVar6;
        } while (iVar3 < *(int *)(param_1 + 0x10));
      }
      if (iVar3 < *(int *)(param_3 + 0x10)) {
        do {
          *puVar6 = 0;
          iVar3 = iVar3 + 1;
          puVar6 = puVar6 + 1;
        } while (iVar3 < *(int *)(param_3 + 0x10));
      }
      *(undefined4 *)(param_3 + 0x10) = *(undefined4 *)(param_1 + 0x10);
      *(undefined4 *)(param_3 + 0x18) = *(undefined4 *)(param_1 + 0x18);
    }
  }
  return 0;
}



undefined8 FUN_14011e420(longlong param_1,longlong param_2)

{
  int iVar1;
  uint uVar2;
  uint *puVar3;
  uint *puVar4;
  uint *puVar5;
  int iVar6;
  uint uVar7;
  
  if (*(int *)(param_2 + 0x14) < *(int *)(param_1 + 0x10) + 1) {
    FUN_14011d8c0(param_2);
  }
  iVar1 = *(int *)(param_2 + 0x10);
  *(undefined4 *)(param_2 + 0x10) = *(undefined4 *)(param_1 + 0x10);
  puVar5 = *(uint **)(param_1 + 8);
  iVar6 = 0;
  puVar3 = *(uint **)(param_2 + 8);
  uVar7 = 0;
  if (0 < *(int *)(param_1 + 0x10)) {
    do {
      uVar2 = *puVar5;
      iVar6 = iVar6 + 1;
      puVar4 = puVar3 + 1;
      puVar5 = puVar5 + 1;
      *puVar3 = uVar2 * 2 & 0xfffffff | uVar7;
      puVar3 = puVar4;
      uVar7 = uVar2 >> 0x1b;
    } while (iVar6 < *(int *)(param_1 + 0x10));
    if (uVar2 >> 0x1b != 0) {
      *puVar4 = 1;
      *(int *)(param_2 + 0x10) = *(int *)(param_2 + 0x10) + 1;
    }
  }
  iVar6 = *(int *)(param_2 + 0x10);
  if (iVar6 < iVar1) {
    memset((void *)(*(longlong *)(param_2 + 8) + (longlong)iVar6 * 4),0,
           (ulonglong)(uint)(iVar1 - iVar6) << 2);
  }
  *(undefined4 *)(param_2 + 0x18) = *(undefined4 *)(param_1 + 0x18);
  return 0;
}



undefined8 FUN_14011e4d0(longlong param_1,int param_2,longlong param_3)

{
  undefined8 uVar1;
  byte bVar2;
  uint uVar3;
  uint uVar4;
  uint *puVar5;
  int iVar6;
  
  if ((param_1 == param_3) || (uVar1 = FUN_14011d9d0(param_1,param_3), (int)uVar1 == 0)) {
    if (*(int *)(param_3 + 0x14) < *(int *)(param_3 + 0x10) + 1 + param_2 / 0x1c) {
      FUN_14011d8c0(param_3);
    }
    if ((param_2 < 0x1c) || (uVar1 = FUN_14011e190(param_3,param_2 / 0x1c), (int)uVar1 == 0)) {
      if (param_2 % 0x1c != 0) {
        puVar5 = *(uint **)(param_3 + 8);
        bVar2 = (byte)(param_2 % 0x1c);
        uVar4 = 0;
        iVar6 = 0;
        if (0 < *(int *)(param_3 + 0x10)) {
          do {
            iVar6 = iVar6 + 1;
            uVar3 = *puVar5 >> (0x1c - bVar2 & 0x1f) & (1 << (bVar2 & 0x1f)) - 1U;
            *puVar5 = (*puVar5 << (bVar2 & 0x1f) | uVar4) & 0xfffffff;
            puVar5 = puVar5 + 1;
            uVar4 = uVar3;
          } while (iVar6 < *(int *)(param_3 + 0x10));
          if (uVar3 != 0) {
            *(uint *)(*(longlong *)(param_3 + 8) + (longlong)*(int *)(param_3 + 0x10) * 4) = uVar3;
            *(int *)(param_3 + 0x10) = *(int *)(param_3 + 0x10) + 1;
          }
        }
      }
      iVar6 = *(int *)(param_3 + 0x10);
      if (0 < iVar6) {
        do {
          if (*(int *)(*(longlong *)(param_3 + 8) + -4 + (longlong)*(int *)(param_3 + 0x10) * 4) !=
              0) break;
          iVar6 = *(int *)(param_3 + 0x10) + -1;
          *(int *)(param_3 + 0x10) = iVar6;
        } while (0 < iVar6);
        iVar6 = *(int *)(param_3 + 0x10);
      }
      if (iVar6 == 0) {
        *(undefined4 *)(param_3 + 0x18) = 0;
      }
      uVar1 = 0;
    }
  }
  return uVar1;
}



void FUN_14011e600(longlong param_1,uint param_2,longlong param_3)

{
  uint uVar1;
  int iVar2;
  ulonglong uVar3;
  int iVar4;
  uint *puVar5;
  uint *puVar6;
  uint *puVar7;
  
  if (*(int *)(param_3 + 0x14) < *(int *)(param_1 + 0x10) + 1) {
    FUN_14011d8c0(param_3);
  }
  iVar2 = *(int *)(param_3 + 0x10);
  puVar6 = *(uint **)(param_3 + 8);
  *(undefined4 *)(param_3 + 0x18) = *(undefined4 *)(param_1 + 0x18);
  puVar7 = *(uint **)(param_1 + 8);
  uVar1 = 0;
  uVar3 = 0;
  iVar4 = 0;
  puVar5 = puVar6;
  if (0 < *(int *)(param_1 + 0x10)) {
    do {
      uVar1 = *puVar7;
      iVar4 = iVar4 + 1;
      puVar7 = puVar7 + 1;
      puVar6 = puVar5 + 1;
      uVar3 = (ulonglong)uVar1 * (ulonglong)param_2 + (uVar3 & 0xffffffff);
      *puVar5 = (uint)uVar3 & 0xfffffff;
      uVar3 = uVar3 >> 0x1c;
      uVar1 = (uint)uVar3;
      puVar5 = puVar6;
    } while (iVar4 < *(int *)(param_1 + 0x10));
  }
  *puVar6 = uVar1;
  if (iVar4 + 1 < iVar2) {
    memset(puVar6 + 1,0,(ulonglong)(uint)(iVar2 - (iVar4 + 1)) << 2);
  }
  iVar2 = *(int *)(param_1 + 0x10) + 1;
  *(int *)(param_3 + 0x10) = iVar2;
  if (0 < iVar2) {
    do {
      if (*(int *)(*(longlong *)(param_3 + 8) + -4 + (longlong)*(int *)(param_3 + 0x10) * 4) != 0)
      break;
      iVar2 = *(int *)(param_3 + 0x10) + -1;
      *(int *)(param_3 + 0x10) = iVar2;
    } while (0 < iVar2);
  }
  if (*(int *)(param_3 + 0x10) == 0) {
    *(undefined4 *)(param_3 + 0x18) = 0;
  }
  return;
}



ulonglong FUN_14011e6e0(longlong param_1,byte *param_2,int param_3)

{
  byte bVar1;
  uint uVar2;
  ulonglong uVar3;
  int iVar4;
  undefined4 *puVar5;
  
  if (*(int *)(param_1 + 0x14) < 2) {
    FUN_14011d8c0(param_1,2);
  }
  puVar5 = *(undefined4 **)(param_1 + 8);
  iVar4 = 0;
  *(undefined4 *)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x10) = 0;
  if (0 < *(int *)(param_1 + 0x14)) {
    do {
      *puVar5 = 0;
      iVar4 = iVar4 + 1;
      puVar5 = puVar5 + 1;
    } while (iVar4 < *(int *)(param_1 + 0x14));
  }
  while (0 < param_3) {
    param_3 = param_3 + -1;
    uVar3 = FUN_14011e4d0(param_1,8,param_1);
    if ((int)uVar3 != 0) {
      return uVar3 & 0xffffffffffffff00;
    }
    bVar1 = *param_2;
    puVar5 = (undefined4 *)0x0;
    param_2 = param_2 + 1;
    **(uint **)(param_1 + 8) = **(uint **)(param_1 + 8) | (uint)bVar1;
    *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
  }
  iVar4 = *(int *)(param_1 + 0x10);
  if (0 < iVar4) {
    do {
      puVar5 = (undefined4 *)(longlong)*(int *)(param_1 + 0x10);
      if (*(int *)(*(longlong *)(param_1 + 8) + -4 + (longlong)puVar5 * 4) != 0) break;
      uVar2 = *(int *)(param_1 + 0x10) - 1;
      puVar5 = (undefined4 *)(ulonglong)uVar2;
      *(uint *)(param_1 + 0x10) = uVar2;
    } while (0 < (int)uVar2);
    iVar4 = *(int *)(param_1 + 0x10);
  }
  if (iVar4 == 0) {
    *(undefined4 *)(param_1 + 0x18) = 0;
  }
  return CONCAT71((int7)((ulonglong)puVar5 >> 8),1);
}



undefined8 FUN_14011e7a0(longlong param_1)

{
  int iVar1;
  uint uVar2;
  int iVar3;
  uint *puVar4;
  
  iVar1 = *(int *)(param_1 + 0x10);
  if (iVar1 == 0) {
    return 0;
  }
  if ((iVar1 != 1) && (1 < iVar1)) {
    iVar1 = *(int *)(param_1 + 0x10) * 0x1c + -0x1c;
    for (uVar2 = *(uint *)(*(longlong *)(param_1 + 8) + -4 + (longlong)*(int *)(param_1 + 0x10) * 4)
        ; uVar2 != 0; uVar2 = uVar2 >> 1) {
      iVar1 = iVar1 + 1;
    }
    iVar3 = 0x1c;
    uVar2 = 1;
    if (0x1c < iVar1) {
      puVar4 = (uint *)(*(longlong *)(param_1 + 8) + 4);
      do {
        if ((*puVar4 & uVar2) == 0) {
          return 0;
        }
        uVar2 = uVar2 * 2;
        if (0xfffffff < uVar2) {
          puVar4 = puVar4 + 1;
          uVar2 = 1;
        }
        iVar3 = iVar3 + 1;
      } while (iVar3 < iVar1);
    }
  }
  return 1;
}



void FUN_14011e810(longlong param_1,int param_2)

{
  undefined4 *puVar1;
  int iVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  
  if (0 < param_2) {
    iVar2 = 0;
    if (param_2 < *(int *)(param_1 + 0x10)) {
      puVar4 = *(undefined4 **)(param_1 + 8);
      puVar1 = puVar4 + param_2;
      puVar3 = puVar4;
      if (0 < *(int *)(param_1 + 0x10) - param_2) {
        do {
          iVar2 = iVar2 + 1;
          puVar4 = puVar3 + 1;
          *puVar3 = *puVar1;
          puVar1 = puVar1 + 1;
          puVar3 = puVar4;
        } while (iVar2 < *(int *)(param_1 + 0x10) - param_2);
      }
      if (iVar2 < *(int *)(param_1 + 0x10)) {
        do {
          *puVar4 = 0;
          iVar2 = iVar2 + 1;
          puVar4 = puVar4 + 1;
        } while (iVar2 < *(int *)(param_1 + 0x10));
      }
      *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) - param_2;
    }
    else {
      puVar1 = *(undefined4 **)(param_1 + 8);
      *(undefined4 *)(param_1 + 0x18) = 0;
      *(undefined4 *)(param_1 + 0x10) = 0;
      if (0 < *(int *)(param_1 + 0x14)) {
        do {
          *puVar1 = 0;
          iVar2 = iVar2 + 1;
          puVar1 = puVar1 + 1;
        } while (iVar2 < *(int *)(param_1 + 0x14));
        return;
      }
    }
  }
  return;
}



undefined4 FUN_14011e8b0(longlong param_1,uint param_2,longlong param_3)

{
  int iVar1;
  undefined4 uVar2;
  int iVar3;
  uint *puVar4;
  uint *_Dst;
  uint *puVar5;
  
  if (*(int *)(param_3 + 0x14) < *(int *)(param_1 + 0x10) + 1) {
    FUN_14011d8c0(param_3);
  }
  if (*(int *)(param_1 + 0x18) != 1) {
    iVar3 = *(int *)(param_1 + 0x10);
    iVar1 = *(int *)(param_3 + 0x10);
    puVar5 = *(uint **)(param_1 + 8);
    puVar4 = *(uint **)(param_3 + 8);
    if (((iVar3 == 1) && (*puVar5 <= param_2)) || (iVar3 == 0)) {
      if (iVar3 == 1) {
        param_2 = param_2 - *puVar5;
      }
      *puVar4 = param_2;
      iVar3 = 1;
      _Dst = puVar4 + 1;
      *(undefined4 *)(param_3 + 0x18) = 1;
      *(undefined4 *)(param_3 + 0x10) = 1;
    }
    else {
      *(undefined4 *)(param_3 + 0x18) = 0;
      iVar3 = 1;
      *(undefined4 *)(param_3 + 0x10) = *(undefined4 *)(param_1 + 0x10);
      _Dst = puVar4 + 1;
      param_2 = *puVar5 - param_2;
      *puVar4 = param_2 & 0xfffffff;
      puVar4 = _Dst;
      if (1 < *(int *)(param_1 + 0x10)) {
        do {
          puVar5 = puVar5 + 1;
          iVar3 = iVar3 + 1;
          _Dst = puVar4 + 1;
          param_2 = *puVar5 + ((int)param_2 >> 0x1f);
          *puVar4 = param_2 & 0xfffffff;
          puVar4 = _Dst;
        } while (iVar3 < *(int *)(param_1 + 0x10));
      }
    }
    if (iVar3 < iVar1) {
      memset(_Dst,0,(ulonglong)(uint)(iVar1 - iVar3) << 2);
    }
    iVar3 = *(int *)(param_3 + 0x10);
    if (0 < iVar3) {
      do {
        if (*(int *)(*(longlong *)(param_3 + 8) + -4 + (longlong)*(int *)(param_3 + 0x10) * 4) != 0)
        break;
        iVar3 = *(int *)(param_3 + 0x10) + -1;
        *(int *)(param_3 + 0x10) = iVar3;
      } while (0 < iVar3);
      iVar3 = *(int *)(param_3 + 0x10);
    }
    if (iVar3 == 0) {
      *(undefined4 *)(param_3 + 0x18) = 0;
    }
    return 0;
  }
  *(undefined4 *)(param_1 + 0x18) = 0;
  uVar2 = FUN_14011def0(param_1,param_2,param_3);
  *(undefined4 *)(param_3 + 0x18) = 1;
  *(undefined4 *)(param_1 + 0x18) = 1;
  iVar3 = *(int *)(param_3 + 0x10);
  if (0 < iVar3) {
    do {
      if (*(int *)(*(longlong *)(param_3 + 8) + -4 + (longlong)*(int *)(param_3 + 0x10) * 4) != 0)
      break;
      iVar3 = *(int *)(param_3 + 0x10) + -1;
      *(int *)(param_3 + 0x10) = iVar3;
    } while (0 < iVar3);
    iVar3 = *(int *)(param_3 + 0x10);
  }
  if (iVar3 == 0) {
    *(undefined4 *)(param_3 + 0x18) = 0;
  }
  return uVar2;
}



int FUN_14011ea30(longlong param_1)

{
  uint uVar1;
  uint uVar2;
  
  uVar1 = 0;
  if (*(int *)(param_1 + 0x10) != 0) {
    uVar1 = *(int *)(param_1 + 0x10) * 0x1c - 0x1c;
    for (uVar2 = *(uint *)(*(longlong *)(param_1 + 8) + -4 + (longlong)*(int *)(param_1 + 0x10) * 4)
        ; uVar2 != 0; uVar2 = uVar2 >> 1) {
      uVar1 = uVar1 + 1;
    }
  }
  return ((int)(uVar1 + ((int)uVar1 >> 0x1f & 7U)) >> 3) + (uint)((uVar1 & 7) != 0);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

undefined8 FUN_14011ea80(longlong param_1,longlong param_2,longlong param_3,int param_4)

{
  int iVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  uint uVar5;
  uint uVar6;
  int iVar7;
  int iVar8;
  ulonglong uVar9;
  void *_Dst;
  int iVar10;
  uint *puVar11;
  uint *puVar12;
  ulonglong uVar13;
  longlong lVar14;
  undefined1 auStack_868 [28];
  uint auStack_84c [513];
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_868;
  if (*(int *)(param_3 + 0x14) < param_4) {
    FUN_14011d8c0(param_3);
  }
  iVar2 = *(int *)(param_1 + 0x10);
  iVar7 = *(int *)(param_2 + 0x10) + iVar2;
  if (param_4 < iVar7) {
    iVar7 = param_4;
  }
  uVar13 = 0;
  iVar10 = 0;
  lVar14 = 0;
  if (0 < iVar7) {
    lVar3 = *(longlong *)(param_1 + 8);
    lVar4 = *(longlong *)(param_2 + 8);
    iVar1 = *(int *)(param_2 + 0x10) + -1;
    do {
      iVar8 = iVar10;
      if (iVar1 < iVar10) {
        iVar8 = iVar1;
      }
      puVar11 = (uint *)(lVar3 + (longlong)(iVar10 - iVar8) * 4);
      puVar12 = (uint *)(lVar4 + (longlong)iVar8 * 4);
      uVar5 = iVar2 - (iVar10 - iVar8);
      uVar6 = iVar8 + 1U;
      if ((int)uVar5 < (int)(iVar8 + 1U)) {
        uVar6 = uVar5;
      }
      uVar9 = (ulonglong)uVar6;
      if (0 < (int)uVar6) {
        do {
          uVar6 = *puVar12;
          uVar5 = *puVar11;
          puVar12 = puVar12 + -1;
          puVar11 = puVar11 + 1;
          uVar13 = uVar13 + (ulonglong)uVar6 * (ulonglong)uVar5;
          uVar9 = uVar9 - 1;
        } while (uVar9 != 0);
      }
      lVar14 = lVar14 + 1;
      iVar10 = iVar10 + 1;
      uVar6 = (uint)uVar13;
      uVar13 = uVar13 >> 0x1c;
      auStack_84c[lVar14] = uVar6 & 0xfffffff;
    } while (lVar14 < iVar7);
  }
  iVar2 = *(int *)(param_3 + 0x10);
  _Dst = *(void **)(param_3 + 8);
  uVar5 = iVar7 + 1;
  *(int *)(param_3 + 0x10) = iVar7;
  uVar6 = 0;
  if (0 < (int)uVar5) {
    memcpy(_Dst,auStack_84c + 1,(ulonglong)uVar5 << 2);
    _Dst = (void *)((longlong)_Dst + (ulonglong)uVar5 * 4);
    uVar6 = uVar5;
  }
  if ((int)uVar6 < iVar2) {
    memset(_Dst,0,(ulonglong)(iVar2 - uVar6) << 2);
  }
  iVar7 = *(int *)(param_3 + 0x10);
  if (0 < iVar7) {
    do {
      if (*(int *)(*(longlong *)(param_3 + 8) + -4 + (longlong)*(int *)(param_3 + 0x10) * 4) != 0)
      break;
      iVar7 = *(int *)(param_3 + 0x10) + -1;
      *(int *)(param_3 + 0x10) = iVar7;
    } while (0 < iVar7);
    iVar7 = *(int *)(param_3 + 0x10);
  }
  if (iVar7 == 0) {
    *(undefined4 *)(param_3 + 0x18) = 0;
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14011ec40(longlong param_1,longlong param_2,longlong param_3,int param_4)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  uint uVar4;
  uint uVar5;
  int iVar6;
  int iVar7;
  ulonglong uVar8;
  int iVar9;
  void *_Dst;
  uint *puVar10;
  uint *puVar11;
  ulonglong uVar12;
  longlong lVar13;
  longlong lVar14;
  longlong lVar15;
  undefined1 auStack_888 [32];
  int local_868;
  uint uStack_85c;
  undefined1 auStack_858 [2048];
  ulonglong local_58;
  
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_888;
  lVar15 = (longlong)param_4;
  if (*(int *)(param_3 + 0x14) < *(int *)(param_1 + 0x10) + *(int *)(param_2 + 0x10)) {
    FUN_14011d8c0(param_3);
  }
  iVar6 = *(int *)(param_1 + 0x10);
  uVar12 = 0;
  local_868 = iVar6 + *(int *)(param_2 + 0x10);
  lVar14 = (longlong)local_868;
  if (lVar15 < lVar14) {
    lVar2 = *(longlong *)(param_1 + 8);
    lVar3 = *(longlong *)(param_2 + 8);
    iVar1 = *(int *)(param_2 + 0x10) + -1;
    lVar13 = lVar15;
    iVar9 = param_4;
    do {
      iVar7 = iVar9;
      if (iVar1 < iVar9) {
        iVar7 = iVar1;
      }
      puVar10 = (uint *)(lVar2 + (longlong)(iVar9 - iVar7) * 4);
      puVar11 = (uint *)(lVar3 + (longlong)iVar7 * 4);
      uVar4 = iVar6 - (iVar9 - iVar7);
      uVar5 = iVar7 + 1U;
      if ((int)uVar4 < (int)(iVar7 + 1U)) {
        uVar5 = uVar4;
      }
      uVar8 = (ulonglong)uVar5;
      if (0 < (int)uVar5) {
        do {
          uVar5 = *puVar11;
          uVar4 = *puVar10;
          puVar11 = puVar11 + -1;
          puVar10 = puVar10 + 1;
          uVar12 = uVar12 + (ulonglong)uVar5 * (ulonglong)uVar4;
          uVar8 = uVar8 - 1;
        } while (uVar8 != 0);
      }
      lVar13 = lVar13 + 1;
      iVar9 = iVar9 + 1;
      uVar5 = (uint)uVar12;
      uVar12 = uVar12 >> 0x1c;
      (&uStack_85c)[lVar13] = uVar5 & 0xfffffff;
    } while (lVar13 < lVar14);
  }
  iVar6 = *(int *)(param_3 + 0x10);
  *(int *)(param_3 + 0x10) = local_868;
  _Dst = (void *)(*(longlong *)(param_3 + 8) + lVar15 * 4);
  if (lVar15 <= lVar14) {
    lVar14 = (lVar14 - lVar15) + 1;
    memcpy(_Dst,auStack_858 + lVar15 * 4,lVar14 * 4);
    param_4 = param_4 + (int)lVar14;
    _Dst = (void *)((longlong)_Dst + lVar14 * 4);
  }
  if (param_4 < iVar6) {
    memset(_Dst,0,(ulonglong)(uint)(iVar6 - param_4) << 2);
  }
  iVar6 = *(int *)(param_3 + 0x10);
  if (0 < iVar6) {
    do {
      if (*(int *)(*(longlong *)(param_3 + 8) + -4 + (longlong)*(int *)(param_3 + 0x10) * 4) != 0)
      break;
      iVar6 = *(int *)(param_3 + 0x10) + -1;
      *(int *)(param_3 + 0x10) = iVar6;
    } while (0 < iVar6);
    iVar6 = *(int *)(param_3 + 0x10);
  }
  if (iVar6 == 0) {
    *(undefined4 *)(param_3 + 0x18) = 0;
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14011ede0(longlong param_1,longlong param_2)

{
  uint uVar1;
  int iVar2;
  longlong lVar3;
  uint uVar4;
  int iVar5;
  int iVar6;
  uint *puVar7;
  uint *puVar8;
  uint uVar9;
  ulonglong uVar10;
  longlong lVar11;
  longlong lVar12;
  uint uVar13;
  longlong lVar14;
  ulonglong uVar15;
  uint uVar16;
  undefined1 auStack_878 [32];
  longlong local_858;
  uint auStack_84c [513];
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_878;
  iVar5 = *(int *)(param_1 + 0x10) * 2;
  local_858 = param_2;
  if (*(int *)(param_2 + 0x14) < iVar5) {
    FUN_14011d8c0(param_2);
  }
  lVar11 = (longlong)iVar5;
  uVar15 = 0;
  uVar13 = 0;
  lVar12 = 0;
  if (0 < lVar11) {
    iVar2 = *(int *)(param_1 + 0x10);
    lVar3 = *(longlong *)(param_1 + 8);
    uVar1 = iVar2 - 1;
    do {
      lVar14 = 0;
      uVar9 = uVar13;
      if ((int)uVar1 < (int)uVar13) {
        uVar9 = uVar1;
      }
      iVar6 = uVar13 - uVar9;
      puVar8 = (uint *)(lVar3 + (longlong)iVar6 * 4);
      puVar7 = (uint *)(lVar3 + (longlong)(int)uVar9 * 4);
      uVar4 = iVar2 - iVar6;
      uVar16 = uVar9 + 1;
      if ((int)uVar4 < (int)(uVar9 + 1)) {
        uVar16 = uVar4;
      }
      uVar9 = (int)((uVar9 - iVar6) + 1) >> 1;
      if ((int)uVar9 <= (int)uVar16) {
        uVar16 = uVar9;
      }
      if (0 < (int)uVar16) {
        uVar10 = (ulonglong)uVar16;
        do {
          uVar9 = *puVar7;
          uVar16 = *puVar8;
          puVar7 = puVar7 + -1;
          puVar8 = puVar8 + 1;
          lVar14 = lVar14 + (ulonglong)uVar9 * (ulonglong)uVar16;
          uVar10 = uVar10 - 1;
        } while (uVar10 != 0);
      }
      uVar10 = uVar15 + lVar14 * 2;
      if ((uVar13 & 1) == 0) {
        uVar15 = (ulonglong)*(uint *)(lVar3 + ((longlong)(int)uVar13 >> 1) * 4);
        uVar10 = uVar10 + uVar15 * uVar15;
      }
      lVar12 = lVar12 + 1;
      uVar13 = uVar13 + 1;
      uVar15 = uVar10 >> 0x1c;
      auStack_84c[lVar12] = (uint)uVar10 & 0xfffffff;
      param_2 = local_858;
    } while (lVar12 < lVar11);
  }
  iVar2 = *(int *)(param_2 + 0x10);
  puVar8 = *(uint **)(param_2 + 8);
  lVar12 = 0;
  *(int *)(param_2 + 0x10) = *(int *)(param_1 + 0x10) * 2;
  puVar7 = puVar8;
  iVar6 = 0;
  if (0 < lVar11) {
    do {
      lVar3 = lVar12 + 1;
      lVar12 = lVar12 + 1;
      puVar8 = puVar7 + 1;
      *puVar7 = auStack_84c[lVar3] & 0xfffffff;
      puVar7 = puVar8;
      iVar6 = iVar5;
    } while (lVar12 < lVar11);
  }
  if (iVar6 < iVar2) {
    memset(puVar8,0,(ulonglong)(uint)(iVar2 - iVar6) << 2);
  }
  iVar5 = *(int *)(param_2 + 0x10);
  if (0 < iVar5) {
    do {
      if (*(int *)(*(longlong *)(param_2 + 8) + -4 + (longlong)*(int *)(param_2 + 0x10) * 4) != 0)
      break;
      iVar5 = *(int *)(param_2 + 0x10) + -1;
      *(int *)(param_2 + 0x10) = iVar5;
    } while (0 < iVar5);
    iVar5 = *(int *)(param_2 + 0x10);
  }
  if (iVar5 == 0) {
    *(undefined4 *)(param_2 + 0x18) = 0;
  }
  return 0;
}



undefined8 FUN_14011efe0(longlong param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  uint uVar2;
  int iVar3;
  int *piVar4;
  uint uVar5;
  uint uVar6;
  int *piVar7;
  longlong lVar8;
  uint *puVar9;
  uint *puVar10;
  ulonglong uVar11;
  uint uVar12;
  longlong lVar13;
  
  uVar2 = *(uint *)(param_2 + 0x10);
  uVar12 = *(uint *)(param_1 + 0x10);
  lVar13 = param_2;
  uVar6 = uVar2;
  if ((int)uVar2 < (int)uVar12) {
    lVar13 = param_1;
    uVar6 = uVar12;
    uVar12 = uVar2;
  }
  if (*(int *)(param_3 + 0x14) < (int)(uVar6 + 1)) {
    FUN_14011d8c0(param_3);
  }
  iVar3 = *(int *)(param_3 + 0x10);
  puVar10 = *(uint **)(param_3 + 8);
  *(uint *)(param_3 + 0x10) = uVar6 + 1;
  piVar7 = *(int **)(param_2 + 8);
  uVar2 = 0;
  uVar5 = 0;
  if (0 < (int)uVar12) {
    uVar11 = (ulonglong)uVar12;
    piVar4 = *(int **)(param_1 + 8);
    puVar9 = puVar10;
    do {
      iVar1 = *piVar7;
      puVar10 = puVar9 + 1;
      piVar7 = piVar7 + 1;
      uVar2 = iVar1 + uVar2 + *piVar4;
      *puVar9 = uVar2 & 0xfffffff;
      uVar2 = uVar2 >> 0x1c;
      uVar11 = uVar11 - 1;
      piVar4 = piVar4 + 1;
      puVar9 = puVar10;
      uVar5 = uVar12;
    } while (uVar11 != 0);
  }
  if (uVar12 != uVar6) {
    lVar8 = (longlong)(int)uVar5;
    while (lVar8 < (int)uVar6) {
      lVar8 = lVar8 + 1;
      uVar2 = uVar2 + *(int *)(*(longlong *)(lVar13 + 8) + -4 + lVar8 * 4);
      *puVar10 = uVar2;
      *puVar10 = *puVar10 & 0xfffffff;
      uVar2 = uVar2 >> 0x1c;
      puVar10 = puVar10 + 1;
    }
  }
  *puVar10 = uVar2;
  if (*(int *)(param_3 + 0x10) < iVar3) {
    memset(puVar10 + 1,0,(ulonglong)(uint)(iVar3 - *(int *)(param_3 + 0x10)) << 2);
  }
  iVar3 = *(int *)(param_3 + 0x10);
  if (0 < iVar3) {
    do {
      if (*(int *)(*(longlong *)(param_3 + 8) + -4 + (longlong)*(int *)(param_3 + 0x10) * 4) != 0)
      break;
      iVar3 = *(int *)(param_3 + 0x10) + -1;
      *(int *)(param_3 + 0x10) = iVar3;
    } while (0 < iVar3);
    iVar3 = *(int *)(param_3 + 0x10);
  }
  if (iVar3 == 0) {
    *(undefined4 *)(param_3 + 0x18) = 0;
  }
  return 0;
}



undefined8 FUN_14011f140(longlong param_1,longlong param_2,undefined8 param_3,uint param_4)

{
  int iVar1;
  uint uVar2;
  undefined1 auVar3 [16];
  undefined1 auVar4 [16];
  uint uVar5;
  undefined8 uVar6;
  __uint64 _Var7;
  void *pvVar8;
  void *pvVar9;
  uint uVar10;
  ulonglong uVar11;
  uint *puVar12;
  uint *puVar13;
  longlong lVar14;
  int iVar15;
  ulonglong uVar16;
  uint uVar17;
  uint uVar18;
  ulonglong uVar19;
  int iVar20;
  undefined **local_70;
  void *local_68;
  uint local_60;
  int local_5c;
  undefined4 local_58;
  
  if ((int)param_4 < 0x200) {
    iVar20 = *(int *)(param_2 + 0x10);
    if (*(int *)(param_1 + 0x10) < *(int *)(param_2 + 0x10)) {
      iVar20 = *(int *)(param_1 + 0x10);
    }
    if (iVar20 < 0x100) {
      uVar6 = FUN_14011ea80();
      return uVar6;
    }
  }
  local_70 = mp_int::vftable;
  uVar5 = param_4 & 0x8000001f;
  if ((int)uVar5 < 0) {
    uVar5 = (uVar5 - 1 | 0xffffffe0) + 1;
  }
  iVar20 = (param_4 - uVar5) + 0x40;
  uVar19 = (ulonglong)iVar20;
  auVar3._8_8_ = 0;
  auVar3._0_8_ = uVar19;
  _Var7 = SUB168(ZEXT816(4) * auVar3,0);
  if (SUB168(ZEXT816(4) * auVar3,8) != 0) {
    _Var7 = 0xffffffffffffffff;
  }
  pvVar8 = operator_new(_Var7);
  local_68 = pvVar8;
  memset(pvVar8,0,uVar19 * 4);
  iVar15 = 0;
  lVar14 = 0;
  iVar1 = *(int *)(param_1 + 0x10);
  uVar5 = param_4;
  local_60 = param_4;
  if (0 < (longlong)iVar1) {
    do {
      uVar11 = 0;
      uVar18 = 0;
      uVar10 = uVar5;
      if ((int)*(uint *)(param_2 + 0x10) < (int)uVar5) {
        uVar10 = *(uint *)(param_2 + 0x10);
      }
      uVar2 = *(uint *)(*(longlong *)(param_1 + 8) + lVar14 * 4);
      puVar12 = (uint *)((longlong)pvVar8 + (longlong)iVar15 * 4);
      puVar13 = *(uint **)(param_2 + 8);
      uVar17 = 0;
      if (0 < (int)uVar10) {
        uVar16 = (ulonglong)uVar10;
        do {
          uVar11 = (ulonglong)*puVar13 * (ulonglong)uVar2 + (ulonglong)*puVar12 +
                   (uVar11 & 0xffffffff);
          puVar13 = puVar13 + 1;
          *puVar12 = (uint)uVar11 & 0xfffffff;
          puVar12 = puVar12 + 1;
          uVar11 = uVar11 >> 0x1c;
          uVar18 = (uint)uVar11;
          uVar16 = uVar16 - 1;
          uVar17 = uVar10;
        } while (uVar16 != 0);
      }
      if ((int)(uVar17 + iVar15) < (int)param_4) {
        *puVar12 = uVar18;
      }
      iVar15 = iVar15 + 1;
      lVar14 = lVar14 + 1;
      uVar5 = uVar5 - 1;
    } while (lVar14 < iVar1);
  }
  while ((0 < (int)local_60 && (*(int *)((longlong)pvVar8 + (longlong)(int)local_60 * 4 + -4) == 0))
        ) {
    local_60 = local_60 - 1;
  }
  local_58 = 0;
  local_5c = iVar20;
  pvVar9 = operator_new(0x80);
  memset(pvVar9,0,0x80);
  operator_delete(pvVar9);
  if (iVar20 == 0) {
    pvVar9 = operator_new(0x80);
    memset(pvVar9,0,0x80);
    iVar20 = 0x20;
  }
  else {
    auVar4._8_8_ = 0;
    auVar4._0_8_ = uVar19;
    _Var7 = SUB168(ZEXT816(4) * auVar4,0);
    if (SUB168(ZEXT816(4) * auVar4,8) != 0) {
      _Var7 = 0xffffffffffffffff;
    }
    pvVar9 = operator_new(_Var7);
    memcpy(pvVar9,pvVar8,uVar19 * 4);
  }
  FUN_14011d790(&local_70,param_3);
  FUN_14011d790(param_3);
  if ((pvVar9 != (void *)0x0) && (iVar20 != 0)) {
    memset(pvVar9,0,(longlong)(iVar20 * 4));
  }
  operator_delete(pvVar9);
  pvVar8 = local_68;
  if ((local_68 != (void *)0x0) && (local_5c != 0)) {
    memset(local_68,0,(longlong)(local_5c << 2));
  }
  operator_delete(pvVar8);
  return 0;
}



undefined8 FUN_14011f430(longlong param_1,longlong param_2,undefined8 param_3,int param_4)

{
  uint *puVar1;
  size_t _Size;
  int iVar2;
  uint uVar3;
  undefined1 auVar4 [16];
  undefined1 auVar5 [16];
  int iVar6;
  undefined8 uVar7;
  __uint64 _Var8;
  void *pvVar9;
  void *pvVar10;
  uint uVar11;
  ulonglong uVar12;
  uint *puVar13;
  int iVar14;
  ulonglong uVar15;
  int iVar16;
  longlong lVar17;
  uint *puVar18;
  undefined **local_60;
  void *local_58;
  int local_50;
  int local_4c;
  undefined4 local_48;
  
  uVar15 = (ulonglong)param_4;
  iVar16 = *(int *)(param_1 + 0x10);
  iVar6 = *(int *)(param_2 + 0x10);
  uVar3 = iVar6 + 1 + iVar16;
  if ((int)uVar3 < 0x200) {
    if (iVar16 < iVar6) {
      iVar6 = iVar16;
    }
    if (iVar6 < 0x100) {
      uVar7 = FUN_14011ec40();
      return uVar7;
    }
  }
  local_60 = mp_int::vftable;
  uVar11 = uVar3 & 0x8000001f;
  if ((int)uVar11 < 0) {
    uVar11 = (uVar11 - 1 | 0xffffffe0) + 1;
  }
  iVar16 = uVar3 + (0x40 - uVar11);
  auVar4._8_8_ = 0;
  auVar4._0_8_ = (longlong)iVar16;
  _Var8 = SUB168(ZEXT816(4) * auVar4,0);
  if (SUB168(ZEXT816(4) * auVar4,8) != 0) {
    _Var8 = 0xffffffffffffffff;
  }
  pvVar9 = operator_new(_Var8);
  _Size = (longlong)iVar16 * 4;
  local_58 = pvVar9;
  memset(pvVar9,0,_Size);
  iVar6 = *(int *)(param_1 + 0x10);
  iVar2 = *(int *)(param_2 + 0x10);
  local_50 = iVar2 + 1 + iVar6;
  lVar17 = 0;
  if (0 < iVar6) {
    puVar1 = (uint *)((longlong)pvVar9 + uVar15 * 4);
    do {
      uVar12 = 0;
      uVar11 = 0;
      uVar3 = *(uint *)(*(longlong *)(param_1 + 8) + lVar17 * 4);
      iVar14 = (int)uVar15;
      puVar18 = (uint *)(*(longlong *)(param_2 + 8) + (longlong)iVar14 * 4);
      puVar13 = puVar1;
      if (iVar14 < iVar2) {
        uVar15 = (ulonglong)(uint)(iVar2 - iVar14);
        do {
          uVar12 = (ulonglong)*puVar18 * (ulonglong)uVar3 + (ulonglong)*puVar13 +
                   (uVar12 & 0xffffffff);
          puVar18 = puVar18 + 1;
          *puVar13 = (uint)uVar12 & 0xfffffff;
          puVar13 = puVar13 + 1;
          uVar12 = uVar12 >> 0x1c;
          uVar11 = (uint)uVar12;
          uVar15 = uVar15 - 1;
        } while (uVar15 != 0);
      }
      *puVar13 = uVar11;
      uVar15 = (ulonglong)(iVar14 - 1);
      lVar17 = lVar17 + 1;
      pvVar9 = local_58;
    } while (lVar17 < iVar6);
  }
  while ((0 < local_50 && (*(int *)((longlong)pvVar9 + (longlong)local_50 * 4 + -4) == 0))) {
    local_50 = local_50 + -1;
  }
  local_48 = 0;
  local_4c = iVar16;
  pvVar10 = operator_new(0x80);
  memset(pvVar10,0,0x80);
  operator_delete(pvVar10);
  if (iVar16 == 0) {
    pvVar10 = operator_new(0x80);
    memset(pvVar10,0,0x80);
    iVar16 = 0x20;
  }
  else {
    auVar5._8_8_ = 0;
    auVar5._0_8_ = (longlong)iVar16;
    _Var8 = SUB168(ZEXT816(4) * auVar5,0);
    if (SUB168(ZEXT816(4) * auVar5,8) != 0) {
      _Var8 = 0xffffffffffffffff;
    }
    pvVar10 = operator_new(_Var8);
    memcpy(pvVar10,pvVar9,_Size);
  }
  FUN_14011d790(&local_60,param_3);
  FUN_14011d790(param_3);
  if ((pvVar10 != (void *)0x0) && (iVar16 != 0)) {
    memset(pvVar10,0,(longlong)(iVar16 * 4));
  }
  operator_delete(pvVar10);
  pvVar9 = local_58;
  if ((local_58 != (void *)0x0) && (local_4c != 0)) {
    memset(local_58,0,(longlong)(local_4c << 2));
  }
  operator_delete(pvVar9);
  return 0;
}



undefined8 FUN_14011f720(longlong param_1,undefined8 param_2)

{
  undefined1 auVar1 [16];
  undefined1 auVar2 [16];
  uint uVar3;
  uint uVar4;
  __uint64 _Var5;
  uint *_Dst;
  void *pvVar6;
  int iVar7;
  longlong lVar8;
  longlong lVar9;
  longlong lVar10;
  longlong lVar11;
  uint *puVar12;
  ulonglong uVar13;
  longlong lVar14;
  uint *puVar15;
  int iVar16;
  ulonglong uVar17;
  int iVar18;
  undefined **local_68;
  uint *local_60;
  uint local_58;
  int local_54;
  undefined4 local_50;
  
  iVar16 = *(int *)(param_1 + 0x10);
  lVar9 = (longlong)iVar16;
  uVar3 = iVar16 * 2 + 1;
  local_68 = mp_int::vftable;
  uVar4 = uVar3 & 0x8000001f;
  if ((int)uVar4 < 0) {
    uVar4 = (uVar4 - 1 | 0xffffffe0) + 1;
  }
  iVar18 = (uVar3 - uVar4) + 0x40;
  uVar17 = (ulonglong)iVar18;
  auVar1._8_8_ = 0;
  auVar1._0_8_ = uVar17;
  _Var5 = SUB168(ZEXT816(4) * auVar1,0);
  if (SUB168(ZEXT816(4) * auVar1,8) != 0) {
    _Var5 = 0xffffffffffffffff;
  }
  _Dst = operator_new(_Var5);
  local_60 = _Dst;
  memset(_Dst,0,uVar17 * 4);
  local_58 = uVar3;
  puVar12 = _Dst;
  if (0 < iVar16) {
    lVar10 = 1;
    lVar11 = 0;
    iVar16 = 1;
    lVar8 = lVar9;
    puVar15 = _Dst;
    do {
      uVar13 = (ulonglong)*(uint *)(lVar11 + *(longlong *)(param_1 + 8));
      uVar13 = uVar13 * uVar13 + (ulonglong)*puVar15;
      *puVar15 = (uint)uVar13 & 0xfffffff;
      uVar13 = uVar13 >> 0x1c;
      uVar3 = *(uint *)(lVar11 + *(longlong *)(param_1 + 8));
      puVar12 = _Dst + iVar16;
      if (lVar10 < lVar9) {
        lVar14 = lVar10;
        do {
          uVar13 = (ulonglong)*puVar12 +
                   (ulonglong)*(uint *)(*(longlong *)(param_1 + 8) + lVar14 * 4) * (ulonglong)uVar3
                   * 2 + (uVar13 & 0xffffffff);
          *puVar12 = (uint)uVar13 & 0xfffffff;
          puVar12 = puVar12 + 1;
          uVar13 = uVar13 >> 0x1c & 0xffffffff;
          lVar14 = lVar14 + 1;
        } while (lVar14 < lVar9);
      }
      iVar7 = (int)uVar13;
      while (iVar7 != 0) {
        uVar13 = (ulonglong)*puVar12 + (uVar13 & 0xffffffff);
        *puVar12 = (uint)uVar13 & 0xfffffff;
        puVar12 = puVar12 + 1;
        uVar13 = uVar13 >> 0x1c;
        iVar7 = (int)uVar13;
      }
      iVar16 = iVar16 + 2;
      puVar15 = puVar15 + 2;
      lVar11 = lVar11 + 4;
      lVar10 = lVar10 + 1;
      lVar8 = lVar8 + -1;
      puVar12 = local_60;
    } while (lVar8 != 0);
  }
  while ((0 < (int)local_58 && (puVar12[(longlong)(int)local_58 + -1] == 0))) {
    local_58 = local_58 - 1;
  }
  local_50 = 0;
  local_54 = iVar18;
  pvVar6 = operator_new(0x80);
  memset(pvVar6,0,0x80);
  operator_delete(pvVar6);
  if (iVar18 == 0) {
    pvVar6 = operator_new(0x80);
    memset(pvVar6,0,0x80);
    iVar18 = 0x20;
  }
  else {
    auVar2._8_8_ = 0;
    auVar2._0_8_ = uVar17;
    _Var5 = SUB168(ZEXT816(4) * auVar2,0);
    if (SUB168(ZEXT816(4) * auVar2,8) != 0) {
      _Var5 = 0xffffffffffffffff;
    }
    pvVar6 = operator_new(_Var5);
    memcpy(pvVar6,puVar12,uVar17 * 4);
  }
  FUN_14011d790(&local_68,param_2);
  FUN_14011d790(param_2);
  if ((pvVar6 != (void *)0x0) && (iVar18 != 0)) {
    memset(pvVar6,0,(longlong)(iVar18 * 4));
  }
  operator_delete(pvVar6);
  puVar12 = local_60;
  if ((local_60 != (uint *)0x0) && (local_54 != 0)) {
    memset(local_60,0,(longlong)(local_54 << 2));
  }
  operator_delete(puVar12);
  return 0;
}



undefined8 FUN_14011fa20(longlong param_1,longlong param_2,longlong param_3)

{
  uint uVar1;
  int iVar2;
  int iVar3;
  uint uVar4;
  int iVar5;
  uint *puVar6;
  uint *_Dst;
  ulonglong uVar7;
  uint uVar8;
  int *piVar9;
  longlong lVar10;
  int *piVar11;
  
  iVar5 = *(int *)(param_1 + 0x10);
  uVar1 = *(uint *)(param_2 + 0x10);
  uVar7 = (ulonglong)uVar1;
  if (*(int *)(param_3 + 0x14) < iVar5) {
    FUN_14011d8c0(param_3);
  }
  iVar2 = *(int *)(param_3 + 0x10);
  _Dst = *(uint **)(param_3 + 8);
  *(int *)(param_3 + 0x10) = iVar5;
  piVar9 = *(int **)(param_1 + 8);
  piVar11 = *(int **)(param_2 + 8);
  uVar4 = 0;
  puVar6 = _Dst;
  uVar8 = 0;
  if (0 < (int)uVar1) {
    do {
      iVar3 = *piVar9;
      _Dst = puVar6 + 1;
      piVar9 = piVar9 + 1;
      uVar4 = (iVar3 - uVar4) - *piVar11;
      *puVar6 = uVar4 & 0xfffffff;
      uVar4 = uVar4 >> 0x1f;
      uVar7 = uVar7 - 1;
      puVar6 = _Dst;
      piVar11 = piVar11 + 1;
      uVar8 = uVar1;
    } while (uVar7 != 0);
  }
  if ((int)uVar8 < iVar5) {
    lVar10 = (longlong)piVar9 - (longlong)_Dst;
    uVar7 = (ulonglong)(iVar5 - uVar8);
    puVar6 = _Dst;
    do {
      _Dst = puVar6 + 1;
      uVar4 = *(int *)(lVar10 + (longlong)puVar6) - uVar4;
      *puVar6 = uVar4;
      *puVar6 = *puVar6 & 0xfffffff;
      uVar4 = uVar4 >> 0x1f;
      uVar7 = uVar7 - 1;
      puVar6 = _Dst;
    } while (uVar7 != 0);
  }
  if (*(int *)(param_3 + 0x10) < iVar2) {
    memset(_Dst,0,(ulonglong)(uint)(iVar2 - *(int *)(param_3 + 0x10)) << 2);
  }
  iVar5 = *(int *)(param_3 + 0x10);
  if (0 < iVar5) {
    do {
      if (*(int *)(*(longlong *)(param_3 + 8) + -4 + (longlong)*(int *)(param_3 + 0x10) * 4) != 0)
      break;
      iVar5 = *(int *)(param_3 + 0x10) + -1;
      *(int *)(param_3 + 0x10) = iVar5;
    } while (0 < iVar5);
    iVar5 = *(int *)(param_3 + 0x10);
  }
  if (iVar5 == 0) {
    *(undefined4 *)(param_3 + 0x18) = 0;
  }
  return 0;
}



undefined8 * FUN_14011fb40(undefined8 *param_1,uint param_2)

{
  *param_1 = mp_int::vftable;
  if (((void *)param_1[1] != (void *)0x0) && (*(int *)((longlong)param_1 + 0x14) != 0)) {
    memset((void *)param_1[1],0,(longlong)(*(int *)((longlong)param_1 + 0x14) << 2));
  }
  operator_delete((void *)param_1[1]);
  param_1[1] = 0;
  *(undefined8 *)((longlong)param_1 + 0x14) = 0;
  *(undefined4 *)(param_1 + 2) = 0;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



int FUN_14011fbb0(undefined8 param_1,int param_2,longlong param_3,longlong param_4)

{
  uint uVar1;
  uint uVar2;
  int iVar3;
  void *pvVar4;
  byte bVar5;
  undefined4 *puVar6;
  int iVar7;
  uint *puVar8;
  undefined **local_40;
  void *local_38;
  undefined4 local_30;
  undefined8 local_2c;
  
  local_40 = mp_int::vftable;
  pvVar4 = operator_new(0x80);
  local_38 = pvVar4;
  memset(pvVar4,0,0x80);
  local_30 = 0;
  local_2c = 0x20;
  if (param_2 < 1) {
    iVar3 = FUN_14011d9d0(param_1);
    if (param_4 != 0) {
      *(undefined4 *)(param_4 + 0x18) = 0;
      *(undefined4 *)(param_4 + 0x10) = 0;
      puVar6 = *(undefined4 **)(param_4 + 8);
      iVar7 = 0;
      if (0 < *(int *)(param_4 + 0x14)) {
        do {
          *puVar6 = 0;
          puVar6 = puVar6 + 1;
          iVar7 = iVar7 + 1;
        } while (iVar7 < *(int *)(param_4 + 0x14));
      }
    }
    if (pvVar4 != (void *)0x0) {
      memset(pvVar4,0,0x80);
    }
    operator_delete(pvVar4);
  }
  else {
    iVar7 = 0x20;
    if (param_4 != 0) {
      iVar3 = FUN_14011e220(param_1,param_2,&local_40);
      pvVar4 = local_38;
      iVar7 = (int)local_2c;
      if (iVar3 != 0) {
        if ((local_38 != (void *)0x0) && ((int)local_2c != 0)) {
          memset(local_38,0,(longlong)((int)local_2c << 2));
        }
        operator_delete(pvVar4);
        return iVar3;
      }
    }
    iVar3 = FUN_14011d9d0(param_1);
    if (iVar3 == 0) {
      if (0x1b < param_2) {
        FUN_14011e810(param_3,param_2 / 0x1c);
      }
      if (param_2 % 0x1c != 0) {
        bVar5 = (byte)(param_2 % 0x1c);
        iVar3 = *(int *)(param_3 + 0x10) + -1;
        puVar8 = (uint *)(*(longlong *)(param_3 + 8) + (longlong)iVar3 * 4);
        uVar2 = 0;
        for (; -1 < iVar3; iVar3 = iVar3 + -1) {
          uVar1 = *puVar8;
          *puVar8 = uVar1 >> (bVar5 & 0x1f) | uVar2 << (0x1c - bVar5 & 0x1f);
          puVar8 = puVar8 + -1;
          uVar2 = uVar1 & (1 << (bVar5 & 0x1f)) - 1U;
        }
      }
      iVar3 = *(int *)(param_3 + 0x10);
      if (0 < iVar3) {
        do {
          if (*(int *)(*(longlong *)(param_3 + 8) + -4 + (longlong)*(int *)(param_3 + 0x10) * 4) !=
              0) break;
          iVar3 = *(int *)(param_3 + 0x10) + -1;
          *(int *)(param_3 + 0x10) = iVar3;
        } while (0 < iVar3);
        iVar3 = *(int *)(param_3 + 0x10);
      }
      if (iVar3 == 0) {
        *(undefined4 *)(param_3 + 0x18) = 0;
      }
      if (param_4 != 0) {
        FUN_14011da60(&local_40);
        pvVar4 = local_38;
        iVar7 = (int)local_2c;
      }
      if ((pvVar4 != (void *)0x0) && (iVar7 != 0)) {
        memset(pvVar4,0,(longlong)(iVar7 * 4));
      }
      operator_delete(pvVar4);
      iVar3 = 0;
    }
    else {
      if ((pvVar4 != (void *)0x0) && (iVar7 != 0)) {
        memset(pvVar4,0,(longlong)(iVar7 * 4));
      }
      operator_delete(pvVar4);
    }
  }
  return iVar3;
}



void FUN_14011fe40(longlong param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  int iVar5;
  uint *puVar6;
  longlong lVar7;
  
  iVar1 = *(int *)(param_1 + 0x18);
  if (iVar1 == *(int *)(param_2 + 0x18)) {
    *(int *)(param_3 + 0x18) = iVar1;
    FUN_14011efe0();
    return;
  }
  iVar2 = *(int *)(param_1 + 0x10);
  if (iVar2 <= *(int *)(param_2 + 0x10)) {
    if (iVar2 < *(int *)(param_2 + 0x10)) {
LAB_14011feee:
      *(int *)(param_3 + 0x18) = *(int *)(param_2 + 0x18);
      lVar7 = param_2;
      goto LAB_14011fed2;
    }
    puVar6 = (uint *)(*(longlong *)(param_1 + 8) + (longlong)(iVar2 + -1) * 4);
    iVar5 = 0;
    if (0 < iVar2) {
      lVar7 = (*(longlong *)(param_2 + 8) + (longlong)(iVar2 + -1) * 4) - (longlong)puVar6;
      do {
        uVar3 = *puVar6;
        uVar4 = *(uint *)(lVar7 + (longlong)puVar6);
        if (uVar3 >= uVar4 && uVar3 != uVar4) break;
        if (uVar3 < uVar4) goto LAB_14011feee;
        iVar5 = iVar5 + 1;
        puVar6 = puVar6 + -1;
      } while (iVar5 < iVar2);
    }
  }
  *(int *)(param_3 + 0x18) = iVar1;
  lVar7 = param_1;
  param_1 = param_2;
LAB_14011fed2:
  FUN_14011fa20(lVar7,param_1,param_3);
  return;
}



undefined8 FUN_14011ff00(longlong param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  iVar1 = *(int *)(param_1 + 0x18);
  if (iVar1 != *(int *)(param_2 + 0x18)) {
    uVar2 = 1;
    if (iVar1 == 1) {
      uVar2 = 0xffffffff;
    }
    return uVar2;
  }
  lVar3 = param_1;
  if (iVar1 == 1) {
    lVar3 = param_2;
    param_2 = param_1;
  }
  uVar2 = FUN_14011e090(lVar3,param_2);
  return uVar2;
}



undefined8 FUN_14011ff30(longlong param_1,longlong param_2,ulonglong param_3)

{
  uint uVar1;
  int iVar2;
  ulonglong uVar3;
  uint *puVar4;
  uint *puVar5;
  uint uVar6;
  uint *puVar8;
  ulonglong uVar9;
  ulonglong uVar7;
  
  uVar1 = *(uint *)(param_2 + 0x10);
  if (*(int *)(param_1 + 0x14) < (int)(uVar1 * 2)) {
    FUN_14011d8c0();
  }
  do {
    puVar5 = *(uint **)(param_1 + 8);
    puVar8 = puVar5 + (int)uVar1;
    puVar4 = puVar5;
    uVar7 = 0;
    uVar9 = (ulonglong)uVar1;
    uVar6 = 0;
    if (0 < (int)uVar1) {
      do {
        uVar6 = *puVar8;
        puVar5 = puVar4 + 1;
        puVar8 = puVar8 + 1;
        uVar3 = (ulonglong)uVar6 * (param_3 & 0xffffffff) + (ulonglong)*puVar4 +
                (uVar7 & 0xffffffff);
        uVar7 = uVar3 >> 0x1c;
        uVar6 = (uint)uVar7;
        uVar9 = uVar9 - 1;
        *puVar4 = (uint)uVar3 & 0xfffffff;
        puVar4 = puVar5;
      } while (uVar9 != 0);
    }
    *puVar5 = uVar6;
    iVar2 = uVar1 + 1;
    if ((int)(uVar1 + 1) < *(int *)(param_1 + 0x10)) {
      do {
        puVar5 = puVar5 + 1;
        *puVar5 = 0;
        iVar2 = iVar2 + 1;
      } while (iVar2 < *(int *)(param_1 + 0x10));
    }
    iVar2 = *(int *)(param_1 + 0x10);
    if (0 < iVar2) {
      do {
        if (*(int *)(*(longlong *)(param_1 + 8) + -4 + (longlong)*(int *)(param_1 + 0x10) * 4) != 0)
        break;
        iVar2 = *(int *)(param_1 + 0x10) + -1;
        *(int *)(param_1 + 0x10) = iVar2;
      } while (0 < iVar2);
      iVar2 = *(int *)(param_1 + 0x10);
    }
    if (iVar2 == 0) {
      *(undefined4 *)(param_1 + 0x18) = 0;
    }
    iVar2 = FUN_14011e090(param_1,param_2);
    if (iVar2 == -1) {
      return 0;
    }
    FUN_14011fa20(param_1,param_2,param_1);
  } while( true );
}



undefined8 FUN_140120060(longlong param_1,longlong param_2,longlong param_3)

{
  undefined1 auVar1 [16];
  undefined1 auVar2 [16];
  undefined1 auVar3 [16];
  undefined1 auVar4 [16];
  undefined1 auVar5 [16];
  undefined1 auVar6 [16];
  undefined1 auVar7 [16];
  int iVar8;
  uint uVar9;
  uint uVar10;
  __uint64 _Var11;
  uint uVar12;
  uint uVar13;
  undefined4 *puVar14;
  uint *puVar15;
  undefined ***pppuVar16;
  uint uVar17;
  uint uVar18;
  ulonglong uVar19;
  undefined ***pppuVar20;
  uint uVar21;
  uint uVar22;
  int *piVar23;
  undefined4 *puVar24;
  int *piVar25;
  uint *puVar26;
  longlong lVar27;
  uint *puVar28;
  bool bVar29;
  undefined **local_118;
  uint *local_110;
  int local_108;
  undefined8 local_104;
  undefined **local_f8;
  int *local_f0;
  uint local_e8;
  undefined8 local_e4;
  undefined **local_d8;
  int *local_d0;
  uint local_c8;
  undefined8 local_c4;
  undefined **local_b8;
  undefined4 *local_b0;
  uint local_a8;
  undefined8 local_a4;
  undefined **local_98;
  uint *local_90;
  uint local_88;
  uint local_84;
  uint local_80;
  undefined **local_78;
  undefined4 *local_70;
  int local_68;
  ulonglong local_64;
  undefined **local_58;
  uint *local_50;
  int local_48;
  ulonglong local_44;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  iVar8 = *(int *)(param_2 + 0x10);
  if (*(int *)(param_1 + 0x10) < *(int *)(param_2 + 0x10)) {
    iVar8 = *(int *)(param_1 + 0x10);
  }
  uVar21 = iVar8 >> 1;
  local_98 = mp_int::vftable;
  uVar12 = uVar21 & 0x8000001f;
  if ((int)uVar12 < 0) {
    uVar12 = (uVar12 - 1 | 0xffffffe0) + 1;
  }
  uVar12 = (uVar21 - uVar12) + 0x40;
  auVar1._8_8_ = 0;
  auVar1._0_8_ = (longlong)(int)uVar12;
  _Var11 = SUB168(ZEXT816(4) * auVar1,0);
  if (SUB168(ZEXT816(4) * auVar1,8) != 0) {
    _Var11 = 0xffffffffffffffff;
  }
  local_90 = operator_new(_Var11);
  memset(local_90,0,(longlong)(int)uVar12 * 4);
  local_88 = 0;
  local_80 = 0;
  uVar22 = *(int *)(param_1 + 0x10) - uVar21;
  local_58 = mp_int::vftable;
  uVar13 = uVar22 & 0x8000001f;
  if ((int)uVar13 < 0) {
    uVar13 = (uVar13 - 1 | 0xffffffe0) + 1;
  }
  uVar22 = uVar22 + (0x40 - uVar13);
  auVar2._8_8_ = 0;
  auVar2._0_8_ = (longlong)(int)uVar22;
  _Var11 = SUB168(ZEXT816(4) * auVar2,0);
  if (SUB168(ZEXT816(4) * auVar2,8) != 0) {
    _Var11 = 0xffffffffffffffff;
  }
  local_84 = uVar12;
  local_50 = operator_new(_Var11);
  memset(local_50,0,(longlong)(int)uVar22 * 4);
  local_48 = 0;
  local_44 = (ulonglong)uVar22;
  local_b8 = mp_int::vftable;
  auVar3._8_8_ = 0;
  auVar3._0_8_ = (longlong)(int)uVar12;
  _Var11 = SUB168(ZEXT816(4) * auVar3,0);
  if (SUB168(ZEXT816(4) * auVar3,8) != 0) {
    _Var11 = 0xffffffffffffffff;
  }
  local_b0 = operator_new(_Var11);
  memset(local_b0,0,(longlong)(int)uVar12 * 4);
  local_a8 = 0;
  uVar13 = 0;
  local_a4 = (ulonglong)uVar12;
  uVar22 = *(int *)(param_2 + 0x10) - uVar21;
  local_78 = mp_int::vftable;
  uVar12 = uVar22 & 0x8000001f;
  if ((int)uVar12 < 0) {
    uVar12 = (uVar12 - 1 | 0xffffffe0) + 1;
  }
  uVar22 = uVar22 + (0x40 - uVar12);
  auVar4._8_8_ = 0;
  auVar4._0_8_ = (longlong)(int)uVar22;
  _Var11 = SUB168(ZEXT816(4) * auVar4,0);
  if (SUB168(ZEXT816(4) * auVar4,8) != 0) {
    _Var11 = 0xffffffffffffffff;
  }
  local_70 = operator_new(_Var11);
  memset(local_70,0,(longlong)(int)uVar22 * 4);
  local_68 = 0;
  local_64 = (ulonglong)uVar22;
  uVar12 = uVar21 * 2;
  local_118 = mp_int::vftable;
  uVar22 = uVar12 & 0x8000001f;
  if ((int)uVar22 < 0) {
    uVar22 = (uVar22 - 1 | 0xffffffe0) + 1;
  }
  uVar22 = (uVar12 - uVar22) + 0x40;
  auVar5._8_8_ = 0;
  auVar5._0_8_ = (longlong)(int)uVar22;
  _Var11 = SUB168(ZEXT816(4) * auVar5,0);
  if (SUB168(ZEXT816(4) * auVar5,8) != 0) {
    _Var11 = 0xffffffffffffffff;
  }
  local_110 = operator_new(_Var11);
  memset(local_110,0,(longlong)(int)uVar22 * 4);
  local_108 = 0;
  local_104 = (ulonglong)uVar22;
  local_d8 = mp_int::vftable;
  auVar6._8_8_ = 0;
  auVar6._0_8_ = (longlong)(int)uVar22;
  _Var11 = SUB168(ZEXT816(4) * auVar6,0);
  if (SUB168(ZEXT816(4) * auVar6,8) != 0) {
    _Var11 = 0xffffffffffffffff;
  }
  local_d0 = operator_new(_Var11);
  memset(local_d0,0,(longlong)(int)uVar22 * 4);
  local_c8 = 0;
  local_c4 = (ulonglong)uVar22;
  local_f8 = mp_int::vftable;
  auVar7._8_8_ = 0;
  auVar7._0_8_ = (longlong)(int)uVar22;
  _Var11 = SUB168(ZEXT816(4) * auVar7,0);
  if (SUB168(ZEXT816(4) * auVar7,8) != 0) {
    _Var11 = 0xffffffffffffffff;
  }
  local_f0 = operator_new(_Var11);
  memset(local_f0,0,(longlong)(int)uVar22 * 4);
  local_e8 = 0;
  local_e4 = (ulonglong)uVar22;
  local_48 = *(int *)(param_1 + 0x10) - uVar21;
  local_68 = *(int *)(param_2 + 0x10) - uVar21;
  puVar15 = *(uint **)(param_1 + 8);
  puVar14 = *(undefined4 **)(param_2 + 8);
  if (0 < (int)uVar21) {
    uVar19 = (ulonglong)uVar21;
    puVar26 = local_90;
    puVar24 = local_b0;
    do {
      *puVar26 = *puVar15;
      puVar26 = puVar26 + 1;
      puVar15 = puVar15 + 1;
      *puVar24 = *puVar14;
      puVar24 = puVar24 + 1;
      puVar14 = puVar14 + 1;
      uVar19 = uVar19 - 1;
    } while (uVar19 != 0);
  }
  puVar26 = local_50;
  uVar22 = uVar21;
  if ((int)uVar21 < *(int *)(param_1 + 0x10)) {
    do {
      *puVar26 = *puVar15;
      puVar15 = puVar15 + 1;
      uVar22 = uVar22 + 1;
      puVar26 = puVar26 + 1;
    } while ((int)uVar22 < *(int *)(param_1 + 0x10));
  }
  puVar24 = local_70;
  uVar22 = uVar21;
  local_88 = uVar21;
  if ((int)uVar21 < *(int *)(param_2 + 0x10)) {
    do {
      *puVar24 = *puVar14;
      puVar24 = puVar24 + 1;
      puVar14 = puVar14 + 1;
      uVar22 = uVar22 + 1;
    } while ((int)uVar22 < *(int *)(param_2 + 0x10));
  }
  while ((0 < (int)local_88 && (local_90[(longlong)(int)local_88 + -1] == 0))) {
    local_88 = local_88 - 1;
  }
  local_a8 = uVar21;
  if (local_88 == 0) {
    local_80 = uVar13;
  }
  while ((0 < (int)local_a8 && (local_b0[(longlong)(int)local_a8 + -1] == 0))) {
    local_a8 = local_a8 - 1;
  }
  uVar22 = local_a4._4_4_;
  if (local_a8 == 0) {
    uVar22 = uVar13;
  }
  local_a4 = CONCAT44(uVar22,(int)local_a4);
  iVar8 = FUN_14012b7a0(&local_98,&local_b8,&local_d8);
  if (iVar8 != 0) {
    local_f8 = mp_int::vftable;
    if ((local_f0 != (int *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (int *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_d8 = mp_int::vftable;
    if ((local_d0 != (int *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (int *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (uint *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    local_110 = (uint *)0x0;
    local_104 = 0;
    local_108 = 0;
    local_78 = mp_int::vftable;
    if ((local_70 != (undefined4 *)0x0) && ((int)local_64 != 0)) {
      memset(local_70,0,(longlong)((int)local_64 << 2));
    }
    operator_delete(local_70);
    local_70 = (undefined4 *)0x0;
    local_64 = 0;
    local_68 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (undefined4 *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (undefined4 *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_58 = mp_int::vftable;
    if ((local_50 != (uint *)0x0) && ((int)local_44 != 0)) {
      memset(local_50,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(local_50);
    goto LAB_1401205cd;
  }
  iVar8 = FUN_14012b7a0(&local_58,&local_78,&local_f8);
  if (iVar8 != 0) {
    local_f8 = mp_int::vftable;
    if ((local_f0 != (int *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (int *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_d8 = mp_int::vftable;
    if ((local_d0 != (int *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (int *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (uint *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    local_110 = (uint *)0x0;
    local_104 = 0;
    local_108 = 0;
    local_78 = mp_int::vftable;
    if ((local_70 != (undefined4 *)0x0) && ((int)local_64 != 0)) {
      memset(local_70,0,(longlong)((int)local_64 << 2));
    }
    operator_delete(local_70);
    local_70 = (undefined4 *)0x0;
    local_64 = 0;
    local_68 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (undefined4 *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (undefined4 *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_58 = mp_int::vftable;
    if ((local_50 != (uint *)0x0) && ((int)local_44 != 0)) {
      memset(local_50,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(local_50);
    goto LAB_1401205cd;
  }
  iVar8 = FUN_14011efe0(&local_58,&local_98,&local_118);
  if (iVar8 != 0) {
    local_f8 = mp_int::vftable;
    if ((local_f0 != (int *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (int *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_d8 = mp_int::vftable;
    if ((local_d0 != (int *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (int *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (uint *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    local_110 = (uint *)0x0;
    local_104 = 0;
    local_108 = 0;
    local_78 = mp_int::vftable;
    if ((local_70 != (undefined4 *)0x0) && ((int)local_64 != 0)) {
      memset(local_70,0,(longlong)((int)local_64 << 2));
    }
    operator_delete(local_70);
    local_70 = (undefined4 *)0x0;
    local_64 = 0;
    local_68 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (undefined4 *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (undefined4 *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_58 = mp_int::vftable;
    if ((local_50 != (uint *)0x0) && ((int)local_44 != 0)) {
      memset(local_50,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(local_50);
    goto LAB_1401205cd;
  }
  iVar8 = FUN_14011efe0(&local_78,&local_b8,&local_98);
  if (iVar8 != 0) {
    local_f8 = mp_int::vftable;
    if ((local_f0 != (int *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (int *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_d8 = mp_int::vftable;
    if ((local_d0 != (int *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (int *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (uint *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    local_110 = (uint *)0x0;
    local_104 = 0;
    local_108 = 0;
    local_78 = mp_int::vftable;
    if ((local_70 != (undefined4 *)0x0) && ((int)local_64 != 0)) {
      memset(local_70,0,(longlong)((int)local_64 << 2));
    }
    operator_delete(local_70);
    local_70 = (undefined4 *)0x0;
    local_64 = 0;
    local_68 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (undefined4 *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (undefined4 *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_58 = mp_int::vftable;
    if ((local_50 != (uint *)0x0) && ((int)local_44 != 0)) {
      memset(local_50,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(local_50);
    goto LAB_1401205cd;
  }
  iVar8 = FUN_14012b7a0(&local_118,&local_98,&local_118);
  uVar18 = local_c8;
  uVar22 = local_e8;
  if (iVar8 != 0) {
    local_f8 = mp_int::vftable;
    if ((local_f0 != (int *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (int *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_d8 = mp_int::vftable;
    if ((local_d0 != (int *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (int *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (uint *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    local_110 = (uint *)0x0;
    local_104 = 0;
    local_108 = 0;
    local_78 = mp_int::vftable;
    if ((local_70 != (undefined4 *)0x0) && ((int)local_64 != 0)) {
      memset(local_70,0,(longlong)((int)local_64 << 2));
    }
    operator_delete(local_70);
    local_70 = (undefined4 *)0x0;
    local_64 = 0;
    local_68 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (undefined4 *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (undefined4 *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_58 = mp_int::vftable;
    if ((local_50 != (uint *)0x0) && ((int)local_44 != 0)) {
      memset(local_50,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(local_50);
    goto LAB_1401205cd;
  }
  if (local_c4._4_4_ == local_e4._4_4_) {
    local_80 = local_c4._4_4_;
    iVar8 = FUN_14011efe0(&local_d8,&local_f8,&local_98);
    if (iVar8 != 0) {
      local_f8 = mp_int::vftable;
      if ((local_f0 != (int *)0x0) && ((int)local_e4 != 0)) {
        memset(local_f0,0,(longlong)((int)local_e4 << 2));
      }
      operator_delete(local_f0);
      local_f0 = (int *)0x0;
      local_e4 = 0;
      local_e8 = 0;
      local_d8 = mp_int::vftable;
      if ((local_d0 != (int *)0x0) && ((int)local_c4 != 0)) {
        memset(local_d0,0,(longlong)((int)local_c4 << 2));
      }
      operator_delete(local_d0);
      local_d0 = (int *)0x0;
      local_c4 = 0;
      local_c8 = 0;
      local_118 = mp_int::vftable;
      if ((local_110 != (uint *)0x0) && ((int)local_104 != 0)) {
        memset(local_110,0,(longlong)((int)local_104 << 2));
      }
      operator_delete(local_110);
      local_110 = (uint *)0x0;
      local_104 = 0;
      local_108 = 0;
      local_78 = mp_int::vftable;
      if ((local_70 != (undefined4 *)0x0) && ((int)local_64 != 0)) {
        memset(local_70,0,(longlong)((int)local_64 << 2));
      }
      operator_delete(local_70);
      local_70 = (undefined4 *)0x0;
      local_64 = 0;
      local_68 = 0;
      local_b8 = mp_int::vftable;
      if ((local_b0 != (undefined4 *)0x0) && ((int)local_a4 != 0)) {
        memset(local_b0,0,(longlong)((int)local_a4 << 2));
      }
      operator_delete(local_b0);
      local_b0 = (undefined4 *)0x0;
      local_a4 = 0;
      local_a8 = 0;
      local_58 = mp_int::vftable;
      if ((local_50 != (uint *)0x0) && ((int)local_44 != 0)) {
        memset(local_50,0,(longlong)((int)local_44 << 2));
      }
      operator_delete(local_50);
      goto LAB_1401205cd;
    }
  }
  else {
    if ((int)local_e8 < (int)local_c8) {
LAB_140120ef0:
      local_80 = local_c4._4_4_;
      uVar19 = (ulonglong)local_e8;
      if ((int)local_84 < (int)local_c8) {
        FUN_14011d8c0(&local_98,local_c8);
      }
      uVar10 = local_88;
      local_88 = uVar18;
      puVar15 = local_90;
      piVar23 = local_d0;
      piVar25 = local_f0;
      uVar17 = uVar13;
      uVar9 = uVar13;
      if (0 < (int)uVar22) {
        do {
          uVar9 = (*piVar23 - uVar17) - *piVar25;
          piVar23 = piVar23 + 1;
          uVar17 = uVar9 >> 0x1f;
          *puVar15 = uVar9 & 0xfffffff;
          puVar15 = puVar15 + 1;
          uVar19 = uVar19 - 1;
          piVar25 = piVar25 + 1;
          uVar9 = uVar22;
        } while (uVar19 != 0);
      }
      if ((int)uVar9 < (int)uVar18) {
        lVar27 = (longlong)piVar23 - (longlong)puVar15;
        uVar19 = (ulonglong)(uVar18 - uVar9);
        do {
          uVar17 = *(int *)((longlong)puVar15 + lVar27) - uVar17;
          *puVar15 = uVar17;
          uVar17 = uVar17 >> 0x1f;
          *puVar15 = *puVar15 & 0xfffffff;
          puVar15 = puVar15 + 1;
          uVar19 = uVar19 - 1;
        } while (uVar19 != 0);
      }
      if ((int)uVar18 < (int)uVar10) {
        memset(puVar15,0,(ulonglong)(uVar10 - uVar18) << 2);
      }
      bVar29 = local_88 == 0;
      if (0 < (int)local_88) {
        do {
          if (local_90[(longlong)(int)local_88 + -1] != 0) break;
          local_88 = local_88 - 1;
        } while (0 < (int)local_88);
LAB_140120fd7:
        bVar29 = local_88 == 0;
      }
    }
    else {
      if ((int)local_e8 <= (int)local_c8) {
        puVar15 = (uint *)(local_d0 + (int)(local_c8 - 1));
        if (0 < (int)local_c8) {
          lVar27 = (longlong)(int)(local_c8 - 1) * 4 - (longlong)puVar15;
          uVar10 = uVar13;
          do {
            uVar17 = *(uint *)((longlong)puVar15 + (longlong)local_f0 + lVar27);
            uVar9 = *puVar15;
            if (uVar9 >= uVar17 && uVar9 != uVar17) break;
            if (uVar9 < uVar17) goto LAB_140120e03;
            uVar10 = uVar10 + 1;
            puVar15 = puVar15 + -1;
          } while ((int)uVar10 < (int)local_c8);
        }
        goto LAB_140120ef0;
      }
LAB_140120e03:
      local_80 = local_e4._4_4_;
      uVar19 = (ulonglong)local_c8;
      if ((int)local_84 < (int)local_e8) {
        FUN_14011d8c0(&local_98,local_e8);
      }
      uVar10 = local_88;
      local_88 = uVar22;
      puVar15 = local_90;
      piVar23 = local_f0;
      piVar25 = local_d0;
      uVar17 = uVar13;
      uVar9 = uVar13;
      if (0 < (int)uVar18) {
        do {
          uVar9 = (*piVar23 - uVar17) - *piVar25;
          piVar23 = piVar23 + 1;
          uVar17 = uVar9 >> 0x1f;
          *puVar15 = uVar9 & 0xfffffff;
          puVar15 = puVar15 + 1;
          uVar19 = uVar19 - 1;
          piVar25 = piVar25 + 1;
          uVar9 = uVar18;
        } while (uVar19 != 0);
      }
      if ((int)uVar9 < (int)uVar22) {
        lVar27 = (longlong)piVar23 - (longlong)puVar15;
        uVar19 = (ulonglong)(uVar22 - uVar9);
        do {
          uVar17 = *(int *)((longlong)puVar15 + lVar27) - uVar17;
          *puVar15 = uVar17;
          uVar17 = uVar17 >> 0x1f;
          *puVar15 = *puVar15 & 0xfffffff;
          puVar15 = puVar15 + 1;
          uVar19 = uVar19 - 1;
        } while (uVar19 != 0);
      }
      if ((int)uVar22 < (int)uVar10) {
        memset(puVar15,0,(ulonglong)(uVar10 - uVar22) << 2);
      }
      bVar29 = local_88 == 0;
      if (0 < (int)local_88) {
        do {
          if (local_90[(longlong)(int)local_88 + -1] != 0) break;
          local_88 = local_88 - 1;
        } while (0 < (int)local_88);
        goto LAB_140120fd7;
      }
    }
    if (bVar29) {
      local_80 = 0;
    }
  }
  uVar22 = local_88;
  iVar8 = local_108;
  if ((int)local_104 < local_108) {
    FUN_14011d8c0(&local_118,local_108);
  }
  puVar15 = local_110;
  puVar26 = local_110;
  uVar18 = uVar13;
  uVar10 = uVar13;
  if (0 < (int)uVar22) {
    uVar19 = (ulonglong)uVar22;
    puVar28 = local_90;
    do {
      uVar10 = (*puVar26 - *puVar28) - uVar18;
      puVar28 = puVar28 + 1;
      puVar26 = puVar26 + 1;
      uVar18 = uVar10 >> 0x1f;
      *puVar15 = uVar10 & 0xfffffff;
      puVar15 = puVar15 + 1;
      uVar19 = uVar19 - 1;
      uVar10 = uVar22;
    } while (uVar19 != 0);
  }
  if ((int)uVar10 < iVar8) {
    lVar27 = (longlong)puVar26 - (longlong)puVar15;
    uVar19 = (ulonglong)(iVar8 - uVar10);
    do {
      uVar18 = *(int *)((longlong)puVar15 + lVar27) - uVar18;
      *puVar15 = uVar18;
      uVar18 = uVar18 >> 0x1f;
      *puVar15 = *puVar15 & 0xfffffff;
      puVar15 = puVar15 + 1;
      uVar19 = uVar19 - 1;
    } while (uVar19 != 0);
  }
  if (iVar8 < local_108) {
    uVar22 = local_108 - iVar8;
    local_108 = iVar8;
    memset(puVar15,0,(ulonglong)uVar22 << 2);
    iVar8 = local_108;
  }
  while ((local_108 = iVar8, 0 < local_108 && (local_110[(longlong)local_108 + -1] == 0))) {
    iVar8 = local_108 + -1;
  }
  uVar22 = local_104._4_4_;
  if (local_108 == 0) {
    uVar22 = uVar13;
  }
  local_104 = CONCAT44(uVar22,(int)local_104);
  if (0 < (int)uVar21) {
    if ((int)local_104 < (int)(local_108 + uVar21)) {
      FUN_14011d8c0(&local_118);
    }
    local_108 = local_108 + uVar21;
    puVar15 = local_110 + (longlong)local_108 + -1;
    puVar26 = local_110 + ((longlong)local_108 - (longlong)(int)uVar21) + -1;
    if ((int)uVar21 <= local_108 + -1) {
      uVar19 = (ulonglong)(((local_108 + -1) - uVar21) + 1);
      do {
        *puVar15 = *puVar26;
        puVar15 = puVar15 + -1;
        puVar26 = puVar26 + -1;
        uVar19 = uVar19 - 1;
      } while (uVar19 != 0);
    }
    if (0 < (int)uVar21) {
      memset(local_110,0,(ulonglong)uVar21 << 2);
    }
  }
  if (0 < (int)uVar12) {
    if ((int)local_e4 < (int)(uVar12 + local_e8)) {
      FUN_14011d8c0(&local_f8);
    }
    local_e8 = local_e8 + uVar12;
    piVar23 = local_f0 + (longlong)(int)local_e8 + -1;
    piVar25 = local_f0 + ((longlong)(int)local_e8 - (longlong)(int)uVar12) + -1;
    if ((int)uVar12 <= (int)(local_e8 - 1)) {
      uVar19 = (ulonglong)((local_e8 - 1) + uVar21 * -2 + 1);
      do {
        *piVar23 = *piVar25;
        piVar23 = piVar23 + -1;
        piVar25 = piVar25 + -1;
        uVar19 = uVar19 - 1;
      } while (uVar19 != 0);
    }
    if (0 < (int)uVar12) {
      memset(local_f0,0,(ulonglong)uVar12 << 2);
    }
  }
  if (local_c4._4_4_ == local_104._4_4_) {
    local_104 = CONCAT44(local_c4._4_4_,(int)local_104);
    iVar8 = FUN_14011efe0(&local_d8,&local_118,&local_118);
  }
  else {
    if (local_108 < (int)local_c8) {
LAB_140121277:
      local_104 = CONCAT44(local_c4._4_4_,(int)local_104);
      pppuVar20 = &local_118;
      pppuVar16 = &local_d8;
    }
    else {
      if (local_108 <= (int)local_c8) {
        puVar15 = (uint *)(local_d0 + (int)(local_c8 - 1));
        if (0 < (int)local_c8) {
          lVar27 = (longlong)(int)(local_c8 - 1) * 4 - (longlong)puVar15;
          uVar12 = uVar13;
          do {
            uVar21 = *puVar15;
            uVar22 = *(uint *)((longlong)puVar15 + (longlong)local_110 + lVar27);
            if (uVar21 >= uVar22 && uVar21 != uVar22) break;
            if (uVar21 < uVar22) goto LAB_14012126b;
            uVar12 = uVar12 + 1;
            puVar15 = puVar15 + -1;
          } while ((int)uVar12 < (int)local_c8);
        }
        goto LAB_140121277;
      }
LAB_14012126b:
      pppuVar20 = &local_d8;
      pppuVar16 = &local_118;
    }
    iVar8 = FUN_14011fa20(pppuVar16,pppuVar20,&local_118);
  }
  if (iVar8 != 0) {
    local_f8 = mp_int::vftable;
    if ((local_f0 != (int *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (int *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_d8 = mp_int::vftable;
    if ((local_d0 != (int *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (int *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (uint *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    local_110 = (uint *)0x0;
    local_104 = 0;
    local_108 = 0;
    local_78 = mp_int::vftable;
    if ((local_70 != (undefined4 *)0x0) && ((int)local_64 != 0)) {
      memset(local_70,0,(longlong)((int)local_64 << 2));
    }
    operator_delete(local_70);
    local_70 = (undefined4 *)0x0;
    local_64 = 0;
    local_68 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (undefined4 *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (undefined4 *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_58 = mp_int::vftable;
    if ((local_50 != (uint *)0x0) && ((int)local_44 != 0)) {
      memset(local_50,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(local_50);
    goto LAB_1401205cd;
  }
  if (local_104._4_4_ == local_e4._4_4_) {
    *(uint *)(param_3 + 0x18) = local_104._4_4_;
    iVar8 = FUN_14011efe0(&local_118,&local_f8,param_3);
  }
  else {
    if ((int)local_e8 < local_108) {
LAB_14012148f:
      *(uint *)(param_3 + 0x18) = local_104._4_4_;
      pppuVar20 = &local_f8;
      pppuVar16 = &local_118;
    }
    else {
      if ((int)local_e8 <= local_108) {
        puVar15 = local_110 + (local_108 + -1);
        if (0 < local_108) {
          lVar27 = (longlong)(local_108 + -1) * 4 - (longlong)puVar15;
          do {
            uVar12 = *(uint *)((longlong)puVar15 + (longlong)local_f0 + lVar27);
            uVar21 = *puVar15;
            if (uVar21 >= uVar12 && uVar21 != uVar12) break;
            if (uVar21 < uVar12) goto LAB_14012147c;
            uVar13 = uVar13 + 1;
            puVar15 = puVar15 + -1;
          } while ((int)uVar13 < local_108);
        }
        goto LAB_14012148f;
      }
LAB_14012147c:
      *(uint *)(param_3 + 0x18) = local_e4._4_4_;
      pppuVar20 = &local_118;
      pppuVar16 = &local_f8;
    }
    iVar8 = FUN_14011fa20(pppuVar16,pppuVar20,param_3);
  }
  if (iVar8 == 0) {
    local_f8 = mp_int::vftable;
    if ((local_f0 != (int *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (int *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_d8 = mp_int::vftable;
    if ((local_d0 != (int *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (int *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (uint *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    local_110 = (uint *)0x0;
    local_104 = 0;
    local_108 = 0;
    local_78 = mp_int::vftable;
    if ((local_70 != (undefined4 *)0x0) && ((int)local_64 != 0)) {
      memset(local_70,0,(longlong)((int)local_64 << 2));
    }
    operator_delete(local_70);
    local_70 = (undefined4 *)0x0;
    local_64 = 0;
    local_68 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (undefined4 *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (undefined4 *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_58 = mp_int::vftable;
    if ((local_50 != (uint *)0x0) && ((int)local_44 != 0)) {
      memset(local_50,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(local_50);
    local_50 = (uint *)0x0;
    local_44 = 0;
    local_48 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (uint *)0x0) && (local_84 != 0)) {
      memset(local_90,0,(longlong)(int)(local_84 << 2));
    }
    operator_delete(local_90);
    return 0;
  }
  local_f8 = mp_int::vftable;
  if ((local_f0 != (int *)0x0) && ((int)local_e4 != 0)) {
    memset(local_f0,0,(longlong)((int)local_e4 << 2));
  }
  operator_delete(local_f0);
  local_f0 = (int *)0x0;
  local_e4 = 0;
  local_e8 = 0;
  local_d8 = mp_int::vftable;
  if ((local_d0 != (int *)0x0) && ((int)local_c4 != 0)) {
    memset(local_d0,0,(longlong)((int)local_c4 << 2));
  }
  operator_delete(local_d0);
  local_d0 = (int *)0x0;
  local_c4 = 0;
  local_c8 = 0;
  local_118 = mp_int::vftable;
  if ((local_110 != (uint *)0x0) && ((int)local_104 != 0)) {
    memset(local_110,0,(longlong)((int)local_104 << 2));
  }
  operator_delete(local_110);
  local_110 = (uint *)0x0;
  local_104 = 0;
  local_108 = 0;
  local_78 = mp_int::vftable;
  if ((local_70 != (undefined4 *)0x0) && ((int)local_64 != 0)) {
    memset(local_70,0,(longlong)((int)local_64 << 2));
  }
  operator_delete(local_70);
  local_70 = (undefined4 *)0x0;
  local_64 = 0;
  local_68 = 0;
  local_b8 = mp_int::vftable;
  if ((local_b0 != (undefined4 *)0x0) && ((int)local_a4 != 0)) {
    memset(local_b0,0,(longlong)((int)local_a4 << 2));
  }
  operator_delete(local_b0);
  local_b0 = (undefined4 *)0x0;
  local_a4 = 0;
  local_a8 = 0;
  local_58 = mp_int::vftable;
  if ((local_50 != (uint *)0x0) && ((int)local_44 != 0)) {
    memset(local_50,0,(longlong)((int)local_44 << 2));
  }
  operator_delete(local_50);
LAB_1401205cd:
  local_44 = 0;
  local_48 = 0;
  local_50 = (uint *)0x0;
  local_98 = mp_int::vftable;
  if ((local_90 != (uint *)0x0) && (local_84 != 0)) {
    memset(local_90,0,(longlong)(int)(local_84 << 2));
  }
  operator_delete(local_90);
  return 0xfffffffd;
}



undefined8 FUN_1401217d0(longlong param_1,undefined8 param_2)

{
  undefined1 auVar1 [16];
  undefined1 auVar2 [16];
  undefined1 auVar3 [16];
  undefined1 auVar4 [16];
  undefined1 auVar5 [16];
  undefined1 auVar6 [16];
  uint uVar7;
  int iVar8;
  undefined4 uVar9;
  __uint64 _Var10;
  int *piVar11;
  uint uVar12;
  undefined4 *puVar13;
  uint *puVar14;
  undefined ***pppuVar15;
  undefined4 *puVar16;
  undefined ***pppuVar17;
  uint uVar18;
  int iVar19;
  uint uVar20;
  ulonglong uVar21;
  uint *puVar22;
  longlong lVar23;
  int *piVar24;
  undefined **local_f8;
  uint *local_f0;
  int local_e8;
  undefined8 local_e4;
  undefined **local_d8;
  void *local_d0;
  int local_c8;
  ulonglong local_c4;
  undefined **local_b8;
  void *local_b0;
  int local_a8;
  undefined8 local_a4;
  undefined **local_98;
  undefined4 *local_90;
  int local_88;
  ulonglong local_84;
  undefined **local_78;
  undefined4 *local_70;
  uint local_68;
  int local_64;
  undefined4 local_60;
  undefined **local_58;
  int *local_50;
  uint local_48;
  int local_44;
  undefined4 local_40;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  uVar18 = *(int *)(param_1 + 0x10) >> 1;
  local_78 = mp_int::vftable;
  uVar7 = uVar18 & 0x8000001f;
  if ((int)uVar7 < 0) {
    uVar7 = (uVar7 - 1 | 0xffffffe0) + 1;
  }
  iVar19 = (uVar18 - uVar7) + 0x40;
  auVar1._8_8_ = 0;
  auVar1._0_8_ = (longlong)iVar19;
  _Var10 = SUB168(ZEXT816(4) * auVar1,0);
  if (SUB168(ZEXT816(4) * auVar1,8) != 0) {
    _Var10 = 0xffffffffffffffff;
  }
  local_70 = operator_new(_Var10);
  memset(local_70,0,(longlong)iVar19 * 4);
  local_68 = 0;
  local_60 = 0;
  uVar20 = *(int *)(param_1 + 0x10) - uVar18;
  local_98 = mp_int::vftable;
  uVar7 = uVar20 & 0x8000001f;
  if ((int)uVar7 < 0) {
    uVar7 = (uVar7 - 1 | 0xffffffe0) + 1;
  }
  uVar20 = uVar20 + (0x40 - uVar7);
  auVar2._8_8_ = 0;
  auVar2._0_8_ = (longlong)(int)uVar20;
  _Var10 = SUB168(ZEXT816(4) * auVar2,0);
  if (SUB168(ZEXT816(4) * auVar2,8) != 0) {
    _Var10 = 0xffffffffffffffff;
  }
  local_64 = iVar19;
  local_90 = operator_new(_Var10);
  memset(local_90,0,(longlong)(int)uVar20 * 4);
  local_88 = 0;
  local_84 = (ulonglong)uVar20;
  uVar7 = *(int *)(param_1 + 0x10) * 2;
  local_f8 = mp_int::vftable;
  uVar20 = uVar7 & 0x8000001f;
  if ((int)uVar20 < 0) {
    uVar20 = (uVar20 - 1 | 0xffffffe0) + 1;
  }
  uVar7 = uVar7 + (0x40 - uVar20);
  auVar3._8_8_ = 0;
  auVar3._0_8_ = (longlong)(int)uVar7;
  _Var10 = SUB168(ZEXT816(4) * auVar3,0);
  if (SUB168(ZEXT816(4) * auVar3,8) != 0) {
    _Var10 = 0xffffffffffffffff;
  }
  local_f0 = operator_new(_Var10);
  memset(local_f0,0,(longlong)(int)uVar7 * 4);
  local_e8 = 0;
  local_e4 = (ulonglong)uVar7;
  uVar7 = *(int *)(param_1 + 0x10) * 2;
  local_58 = mp_int::vftable;
  uVar20 = uVar7 & 0x8000001f;
  if ((int)uVar20 < 0) {
    uVar20 = (uVar20 - 1 | 0xffffffe0) + 1;
  }
  iVar19 = uVar7 + (0x40 - uVar20);
  auVar4._8_8_ = 0;
  auVar4._0_8_ = (longlong)iVar19;
  _Var10 = SUB168(ZEXT816(4) * auVar4,0);
  if (SUB168(ZEXT816(4) * auVar4,8) != 0) {
    _Var10 = 0xffffffffffffffff;
  }
  piVar11 = operator_new(_Var10);
  local_50 = piVar11;
  memset(piVar11,0,(longlong)iVar19 * 4);
  local_48 = 0;
  local_40 = 0;
  uVar7 = uVar18 * 2;
  local_b8 = mp_int::vftable;
  uVar20 = uVar7 & 0x8000001f;
  if ((int)uVar20 < 0) {
    uVar20 = (uVar20 - 1 | 0xffffffe0) + 1;
  }
  uVar20 = (uVar7 - uVar20) + 0x40;
  auVar5._8_8_ = 0;
  auVar5._0_8_ = (longlong)(int)uVar20;
  _Var10 = SUB168(ZEXT816(4) * auVar5,0);
  if (SUB168(ZEXT816(4) * auVar5,8) != 0) {
    _Var10 = 0xffffffffffffffff;
  }
  local_44 = iVar19;
  local_b0 = operator_new(_Var10);
  memset(local_b0,0,(longlong)(int)uVar20 * 4);
  local_a8 = 0;
  local_a4 = (ulonglong)uVar20;
  uVar20 = (*(int *)(param_1 + 0x10) - uVar18) * 2;
  local_d8 = mp_int::vftable;
  uVar12 = uVar20 & 0x8000001f;
  if ((int)uVar12 < 0) {
    uVar12 = (uVar12 - 1 | 0xffffffe0) + 1;
  }
  uVar20 = uVar20 + (0x40 - uVar12);
  auVar6._8_8_ = 0;
  auVar6._0_8_ = (longlong)(int)uVar20;
  _Var10 = SUB168(ZEXT816(4) * auVar6,0);
  if (SUB168(ZEXT816(4) * auVar6,8) != 0) {
    _Var10 = 0xffffffffffffffff;
  }
  local_d0 = operator_new(_Var10);
  memset(local_d0,0,(longlong)(int)uVar20 * 4);
  local_c8 = 0;
  local_c4 = (ulonglong)uVar20;
  puVar13 = *(undefined4 **)(param_1 + 8);
  if (0 < (int)uVar18) {
    uVar21 = (ulonglong)uVar18;
    puVar16 = local_70;
    do {
      *puVar16 = *puVar13;
      puVar16 = puVar16 + 1;
      puVar13 = puVar13 + 1;
      uVar21 = uVar21 - 1;
    } while (uVar21 != 0);
  }
  puVar16 = local_90;
  uVar20 = uVar18;
  if ((int)uVar18 < *(int *)(param_1 + 0x10)) {
    do {
      *puVar16 = *puVar13;
      puVar13 = puVar13 + 1;
      uVar20 = uVar20 + 1;
      puVar16 = puVar16 + 1;
    } while ((int)uVar20 < *(int *)(param_1 + 0x10));
  }
  local_88 = *(int *)(param_1 + 0x10) - uVar18;
  local_68 = uVar18;
  while ((0 < (int)local_68 && (local_70[(longlong)(int)local_68 + -1] == 0))) {
    local_68 = local_68 - 1;
  }
  if (local_68 == 0) {
    local_60 = 0;
  }
  iVar8 = FUN_14012bf90(&local_78);
  if (iVar8 != 0) {
    local_d8 = mp_int::vftable;
    if ((local_d0 != (void *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (void *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    if ((piVar11 != (int *)0x0) && (iVar19 != 0)) {
      memset(piVar11,0,(longlong)(iVar19 * 4));
    }
    operator_delete(piVar11);
    local_f8 = mp_int::vftable;
    if ((local_f0 != (uint *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (uint *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (undefined4 *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    goto LAB_140121c4c;
  }
  iVar8 = FUN_14012bf90(&local_98);
  if (iVar8 != 0) {
    local_d8 = mp_int::vftable;
    if ((local_d0 != (void *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (void *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    if ((piVar11 != (int *)0x0) && (iVar19 != 0)) {
      memset(piVar11,0,(longlong)(iVar19 * 4));
    }
    operator_delete(piVar11);
    local_f8 = mp_int::vftable;
    if ((local_f0 != (uint *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (uint *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (undefined4 *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    goto LAB_140121c4c;
  }
  iVar8 = FUN_14011efe0(&local_98,&local_78,&local_f8);
  if (iVar8 != 0) {
    local_d8 = mp_int::vftable;
    if ((local_d0 != (void *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (void *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    if ((piVar11 != (int *)0x0) && (iVar19 != 0)) {
      memset(piVar11,0,(longlong)(iVar19 * 4));
    }
    operator_delete(piVar11);
    local_f8 = mp_int::vftable;
    if ((local_f0 != (uint *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (uint *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (undefined4 *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    goto LAB_140121c4c;
  }
  iVar8 = FUN_14012bf90(&local_f8);
  if (iVar8 != 0) {
    local_d8 = mp_int::vftable;
    if ((local_d0 != (void *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (void *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    if ((piVar11 != (int *)0x0) && (iVar19 != 0)) {
      memset(piVar11,0,(longlong)(iVar19 * 4));
    }
    operator_delete(piVar11);
    local_f8 = mp_int::vftable;
    if ((local_f0 != (uint *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (uint *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (undefined4 *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    goto LAB_140121c4c;
  }
  iVar8 = FUN_14011efe0(&local_b8,&local_d8,&local_58);
  iVar19 = local_e8;
  if (iVar8 != 0) {
    local_d8 = mp_int::vftable;
    if ((local_d0 != (void *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (void *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    piVar11 = local_50;
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    if ((local_50 != (int *)0x0) && (local_44 != 0)) {
      memset(local_50,0,(longlong)(local_44 << 2));
    }
    operator_delete(piVar11);
    local_f8 = mp_int::vftable;
    if ((local_f0 != (uint *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (uint *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (undefined4 *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    goto LAB_140121c4c;
  }
  if ((int)local_e4 < local_e8) {
    FUN_14011d8c0(&local_f8,local_e8);
  }
  piVar11 = local_50;
  uVar12 = 0;
  puVar14 = local_f0;
  puVar22 = local_f0;
  uVar20 = 0;
  if (0 < (int)local_48) {
    uVar21 = (ulonglong)local_48;
    piVar24 = local_50;
    do {
      uVar20 = (*puVar22 - *piVar24) - uVar12;
      piVar24 = piVar24 + 1;
      puVar22 = puVar22 + 1;
      uVar12 = uVar20 >> 0x1f;
      *puVar14 = uVar20 & 0xfffffff;
      puVar14 = puVar14 + 1;
      uVar21 = uVar21 - 1;
      uVar20 = local_48;
    } while (uVar21 != 0);
  }
  if ((int)uVar20 < iVar19) {
    lVar23 = (longlong)puVar22 - (longlong)puVar14;
    uVar21 = (ulonglong)(iVar19 - uVar20);
    do {
      uVar12 = *(int *)(lVar23 + (longlong)puVar14) - uVar12;
      *puVar14 = uVar12;
      uVar12 = uVar12 >> 0x1f;
      *puVar14 = *puVar14 & 0xfffffff;
      puVar14 = puVar14 + 1;
      uVar21 = uVar21 - 1;
    } while (uVar21 != 0);
  }
  if (iVar19 < local_e8) {
    uVar20 = local_e8 - iVar19;
    local_e8 = iVar19;
    memset(puVar14,0,(ulonglong)uVar20 << 2);
    iVar19 = local_e8;
  }
  while ((local_e8 = iVar19, 0 < local_e8 && (local_f0[(longlong)local_e8 + -1] == 0))) {
    iVar19 = local_e8 + -1;
  }
  uVar9 = local_e4._4_4_;
  if (local_e8 == 0) {
    uVar9 = 0;
  }
  local_e4 = CONCAT44(uVar9,(int)local_e4);
  if (0 < (int)uVar18) {
    if ((int)local_e4 < (int)(local_e8 + uVar18)) {
      FUN_14011d8c0(&local_f8,local_e8 + uVar18);
    }
    local_e8 = local_e8 + uVar18;
    puVar14 = local_f0 + (longlong)local_e8 + -1;
    puVar22 = local_f0 + ((longlong)local_e8 - (longlong)(int)uVar18) + -1;
    if ((int)uVar18 <= local_e8 + -1) {
      uVar21 = (ulonglong)(((local_e8 + -1) - uVar18) + 1);
      do {
        *puVar14 = *puVar22;
        puVar14 = puVar14 + -1;
        puVar22 = puVar22 + -1;
        uVar21 = uVar21 - 1;
      } while (uVar21 != 0);
    }
    if (0 < (int)uVar18) {
      memset(local_f0,0,(ulonglong)uVar18 << 2);
    }
  }
  if (0 < (int)uVar7) {
    if ((int)local_c4 < (int)(uVar7 + local_c8)) {
      FUN_14011d8c0(&local_d8,uVar7 + local_c8);
    }
    local_c8 = local_c8 + uVar7;
    puVar13 = (undefined4 *)((longlong)local_d0 + (longlong)local_c8 * 4 + -4);
    puVar16 = (undefined4 *)
              ((longlong)local_d0 + ((longlong)local_c8 - (longlong)(int)uVar7) * 4 + -4);
    if ((int)uVar7 <= local_c8 + -1) {
      uVar21 = (ulonglong)(local_c8 + -1 + uVar18 * -2 + 1);
      do {
        *puVar13 = *puVar16;
        puVar13 = puVar13 + -1;
        puVar16 = puVar16 + -1;
        uVar21 = uVar21 - 1;
      } while (uVar21 != 0);
    }
    if (0 < (int)uVar7) {
      memset(local_d0,0,(ulonglong)uVar7 << 2);
    }
  }
  if (local_a4._4_4_ == local_e4._4_4_) {
    local_e4 = CONCAT44(local_a4._4_4_,(int)local_e4);
    iVar19 = FUN_14011efe0(&local_b8,&local_f8,&local_f8);
  }
  else {
    if (local_e8 < local_a8) {
LAB_1401223f6:
      local_e4 = CONCAT44(local_a4._4_4_,(int)local_e4);
      pppuVar17 = &local_f8;
      pppuVar15 = &local_b8;
    }
    else {
      if (local_e8 <= local_a8) {
        puVar14 = (uint *)((longlong)local_b0 + (longlong)(local_a8 + -1) * 4);
        iVar19 = 0;
        if (0 < local_a8) {
          lVar23 = (longlong)(local_a8 + -1) * 4 - (longlong)puVar14;
          do {
            uVar7 = *(uint *)((longlong)puVar14 + (longlong)local_f0 + lVar23);
            uVar18 = *puVar14;
            if (uVar18 >= uVar7 && uVar18 != uVar7) break;
            if (uVar18 < uVar7) goto LAB_1401223eb;
            iVar19 = iVar19 + 1;
            puVar14 = puVar14 + -1;
          } while (iVar19 < local_a8);
        }
        goto LAB_1401223f6;
      }
LAB_1401223eb:
      pppuVar17 = &local_b8;
      pppuVar15 = &local_f8;
    }
    iVar19 = FUN_14011fa20(pppuVar15,pppuVar17,&local_f8);
  }
  if (iVar19 == 0) {
    iVar19 = FUN_14011fe40(&local_f8,&local_d8,param_2);
    if (iVar19 == 0) {
      local_d8 = mp_int::vftable;
      if ((local_d0 != (void *)0x0) && ((int)local_c4 != 0)) {
        memset(local_d0,0,(longlong)((int)local_c4 << 2));
      }
      operator_delete(local_d0);
      local_d0 = (void *)0x0;
      local_c4 = 0;
      local_c8 = 0;
      local_b8 = mp_int::vftable;
      if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
        memset(local_b0,0,(longlong)((int)local_a4 << 2));
      }
      operator_delete(local_b0);
      local_b0 = (void *)0x0;
      local_a4 = 0;
      local_a8 = 0;
      if ((piVar11 != (int *)0x0) && (local_44 != 0)) {
        memset(piVar11,0,(longlong)(local_44 << 2));
      }
      operator_delete(piVar11);
      local_f8 = mp_int::vftable;
      if ((local_f0 != (uint *)0x0) && ((int)local_e4 != 0)) {
        memset(local_f0,0,(longlong)((int)local_e4 << 2));
      }
      operator_delete(local_f0);
      local_f0 = (uint *)0x0;
      local_e4 = 0;
      local_e8 = 0;
      local_98 = mp_int::vftable;
      if ((local_90 != (undefined4 *)0x0) && ((int)local_84 != 0)) {
        memset(local_90,0,(longlong)((int)local_84 << 2));
      }
      operator_delete(local_90);
      local_90 = (undefined4 *)0x0;
      local_84 = 0;
      local_88 = 0;
      local_78 = mp_int::vftable;
      if ((local_70 != (undefined4 *)0x0) && (local_64 != 0)) {
        memset(local_70,0,(longlong)(local_64 << 2));
      }
      operator_delete(local_70);
      return 0;
    }
    local_d8 = mp_int::vftable;
    if ((local_d0 != (void *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (void *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    if ((piVar11 != (int *)0x0) && (local_44 != 0)) {
      memset(piVar11,0,(longlong)(local_44 << 2));
    }
    operator_delete(piVar11);
    local_f8 = mp_int::vftable;
    if ((local_f0 != (uint *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (uint *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (undefined4 *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
  }
  else {
    local_d8 = mp_int::vftable;
    if ((local_d0 != (void *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (void *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    if ((piVar11 != (int *)0x0) && (local_44 != 0)) {
      memset(piVar11,0,(longlong)(local_44 << 2));
    }
    operator_delete(piVar11);
    local_f8 = mp_int::vftable;
    if ((local_f0 != (uint *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (uint *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (undefined4 *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
  }
LAB_140121c4c:
  local_78 = mp_int::vftable;
  local_84 = 0;
  local_88 = 0;
  local_90 = (undefined4 *)0x0;
  if ((local_70 != (undefined4 *)0x0) && (local_64 != 0)) {
    memset(local_70,0,(longlong)(local_64 << 2));
  }
  operator_delete(local_70);
  return 0xfffffffd;
}



undefined8 FUN_1401227e0(longlong param_1,longlong param_2)

{
  uint uVar1;
  int iVar2;
  undefined8 uVar3;
  undefined4 *puVar4;
  uint uVar5;
  uint *puVar6;
  uint *puVar7;
  int iVar8;
  uint *puVar9;
  int iVar10;
  
  iVar2 = *(int *)(param_2 + 0x10);
  if (iVar2 == 0) {
    iVar8 = 0;
  }
  else {
    iVar8 = *(int *)(param_2 + 0x10) * 0x1c + -0x1c;
    for (uVar5 = *(uint *)(*(longlong *)(param_2 + 8) + -4 + (longlong)*(int *)(param_2 + 0x10) * 4)
        ; uVar5 != 0; uVar5 = uVar5 >> 1) {
      iVar8 = iVar8 + 1;
    }
  }
  iVar8 = iVar8 % 0x1c;
  if (iVar2 < 2) {
    puVar4 = *(undefined4 **)(param_1 + 8);
    iVar2 = 0;
    *(undefined4 *)(param_1 + 0x18) = 0;
    *(undefined4 *)(param_1 + 0x10) = 0;
    if (0 < *(int *)(param_1 + 0x14)) {
      do {
        *puVar4 = 0;
        iVar2 = iVar2 + 1;
        puVar4 = puVar4 + 1;
      } while (iVar2 < *(int *)(param_1 + 0x14));
    }
    iVar8 = 1;
    **(undefined4 **)(param_1 + 8) = 1;
    *(uint *)(param_1 + 0x10) = (uint)(**(int **)(param_1 + 8) != 0);
  }
  else {
    uVar3 = FUN_14011e0f0(param_1,iVar2 * 0x1c + -0x1d + iVar8);
    if ((int)uVar3 != 0) {
      return uVar3;
    }
  }
  iVar8 = iVar8 + -1;
  while( true ) {
    if (0x1b < iVar8) {
      return 0;
    }
    if (*(int *)(param_1 + 0x14) < *(int *)(param_1 + 0x10) + 1) {
      FUN_14011d8c0(param_1);
    }
    iVar2 = *(int *)(param_1 + 0x10);
    puVar6 = *(uint **)(param_1 + 8);
    uVar5 = 0;
    iVar10 = 0;
    puVar9 = puVar6;
    if (0 < iVar2) {
      do {
        uVar1 = *puVar9;
        iVar10 = iVar10 + 1;
        puVar7 = puVar6 + 1;
        *puVar6 = uVar1 * 2 & 0xfffffff | uVar5;
        puVar6 = puVar7;
        puVar9 = puVar9 + 1;
        uVar5 = uVar1 >> 0x1b;
      } while (iVar10 < *(int *)(param_1 + 0x10));
      if (uVar1 >> 0x1b != 0) {
        *puVar7 = 1;
        *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
      }
    }
    iVar10 = *(int *)(param_1 + 0x10);
    if (iVar10 < iVar2) {
      memset((void *)(*(longlong *)(param_1 + 8) + (longlong)iVar10 * 4),0,
             (ulonglong)(uint)(iVar2 - iVar10) << 2);
    }
    iVar2 = FUN_14011e090(param_1,param_2);
    if ((iVar2 != -1) && (uVar3 = FUN_14011fa20(param_1,param_2,param_1), (int)uVar3 != 0)) break;
    iVar8 = iVar8 + 1;
  }
  return uVar3;
}



int FUN_140122980(undefined8 param_1,longlong param_2,uint param_3)

{
  undefined1 auVar1 [16];
  int iVar2;
  int iVar3;
  __uint64 _Var4;
  uint *puVar5;
  uint uVar6;
  uint uVar7;
  uint uVar8;
  uint uVar9;
  ulonglong uVar10;
  uint *puVar11;
  ulonglong uVar12;
  uint uVar13;
  int iVar14;
  longlong lVar15;
  undefined8 uVar16;
  undefined **local_60;
  uint *local_58;
  uint local_50;
  undefined8 local_4c;
  
  uVar16 = 0xfffffffffffffffe;
  local_60 = mp_int::vftable;
  local_58 = operator_new(0x80);
  memset(local_58,0,0x80);
  local_50 = 0;
  local_4c = 0x20;
  if (*(int *)(param_2 + 0x10) == 0) {
    iVar14 = 0;
  }
  else {
    iVar14 = *(int *)(param_2 + 0x10) * 0x1c + -0x1c;
    for (uVar7 = *(uint *)(*(longlong *)(param_2 + 8) + -4 + (longlong)*(int *)(param_2 + 0x10) * 4)
        ; uVar7 != 0; uVar7 = uVar7 >> 1) {
      iVar14 = iVar14 + 1;
    }
  }
  iVar2 = FUN_14011fbb0(param_1,iVar14,&local_60,param_1,uVar16);
  uVar7 = local_50;
  while (local_50 = uVar7, iVar2 == 0) {
    if (param_3 != 1) {
      uVar10 = (ulonglong)uVar7;
      uVar9 = uVar7 + 1;
      lVar15 = (longlong)(int)local_4c;
      if ((int)local_4c < (int)uVar9) {
        uVar6 = uVar9 & 0x8000001f;
        if ((int)uVar6 < 0) {
          uVar6 = (uVar6 - 1 | 0xffffffe0) + 1;
        }
        iVar2 = uVar9 + (0x40 - uVar6);
        uVar12 = (ulonglong)iVar2;
        auVar1._8_8_ = 0;
        auVar1._0_8_ = uVar12;
        _Var4 = SUB168(ZEXT816(4) * auVar1,0);
        if (SUB168(ZEXT816(4) * auVar1,8) != 0) {
          _Var4 = 0xffffffffffffffff;
        }
        puVar5 = operator_new(_Var4);
        memcpy(puVar5,local_58,lVar15 * 4);
        if (lVar15 < (longlong)uVar12) {
          memset(puVar5 + lVar15,0,(uVar12 - lVar15) * 4);
        }
        local_4c = CONCAT44(local_4c._4_4_,iVar2);
        operator_delete(local_58);
        local_58 = puVar5;
      }
      puVar5 = local_58;
      uVar13 = 0;
      uVar12 = 0;
      puVar11 = local_58;
      uVar6 = uVar13;
      uVar8 = uVar13;
      if (0 < (int)uVar7) {
        do {
          uVar12 = (ulonglong)*puVar11 * (ulonglong)param_3 + (uVar12 & 0xffffffff);
          *puVar11 = (uint)uVar12 & 0xfffffff;
          puVar11 = puVar11 + 1;
          uVar12 = uVar12 >> 0x1c;
          uVar6 = (uint)uVar12;
          uVar10 = uVar10 - 1;
          uVar8 = uVar7;
        } while (uVar10 != 0);
      }
      *puVar11 = uVar6;
      if ((int)(uVar8 + 1) < (int)uVar7) {
        memset(puVar11 + 1,0,(ulonglong)(uVar7 - (uVar8 + 1)) << 2);
      }
      while ((local_50 = uVar9, 0 < (int)local_50 && (puVar5[(longlong)(int)local_50 + -1] == 0))) {
        uVar9 = local_50 - 1;
      }
      uVar7 = local_4c._4_4_;
      if (local_50 == 0) {
        uVar7 = uVar13;
      }
      local_4c = CONCAT44(uVar7,(int)local_4c);
    }
    iVar2 = FUN_14011efe0(param_1,&local_60,param_1);
    if ((iVar2 != 0) || (iVar3 = FUN_14011e090(param_1), iVar3 == -1)) break;
    FUN_14011fa20(param_1,param_2,param_1);
    iVar2 = FUN_14011fbb0(param_1,iVar14,&local_60,param_1);
    uVar7 = local_50;
  }
  puVar5 = local_58;
  if ((local_58 != (uint *)0x0) && ((int)local_4c != 0)) {
    memset(local_58,0,(longlong)((int)local_4c << 2));
  }
  operator_delete(puVar5);
  return iVar2;
}



int FUN_140122c20(longlong param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  int iVar2;
  undefined4 *puVar3;
  uint uVar4;
  undefined8 uVar5;
  undefined **local_30;
  undefined4 *local_28;
  int local_20;
  int local_1c;
  undefined4 local_18;
  
  uVar5 = 0xfffffffffffffffe;
  local_30 = mp_int::vftable;
  puVar3 = operator_new(0x80);
  local_28 = puVar3;
  memset(puVar3,0,0x80);
  local_1c = 0x20;
  if (*(int *)(param_1 + 0x10) == 0) {
    iVar2 = 0;
  }
  else {
    iVar2 = *(int *)(param_1 + 0x10) * 0x1c + -0x1c;
    for (uVar4 = *(uint *)(*(longlong *)(param_1 + 8) + -4 + (longlong)*(int *)(param_1 + 0x10) * 4)
        ; uVar4 != 0; uVar4 = uVar4 >> 1) {
      iVar2 = iVar2 + 1;
    }
  }
  local_18 = 0;
  local_20 = 0;
  memset(puVar3,0,0x80);
  iVar1 = iVar2 / 0x1c;
  FUN_14011d8c0(&local_30,iVar1 + 1);
  local_28[iVar1] = 1 << ((char)iVar2 + (char)iVar1 * -0x1c & 0x1fU);
  local_20 = iVar1 + 1;
  iVar2 = FUN_14011fa20(&local_30,param_1,&local_30,param_4,uVar5);
  puVar3 = local_28;
  if (iVar2 == 0) {
    *param_2 = *local_28;
    if (local_1c != 0) {
      memset(local_28,0,(longlong)(local_1c << 2));
    }
    operator_delete(puVar3);
    iVar2 = 0;
  }
  else {
    if ((local_28 != (undefined4 *)0x0) && (local_1c != 0)) {
      memset(local_28,0,(longlong)(local_1c << 2));
    }
    operator_delete(puVar3);
  }
  return iVar2;
}



undefined4 FUN_140122da0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  undefined4 uVar2;
  void *pvVar3;
  uint uVar4;
  int iVar5;
  undefined8 uVar6;
  undefined **local_30;
  void *local_28;
  int local_20;
  int local_1c;
  undefined4 local_18;
  
  uVar6 = 0xfffffffffffffffe;
  local_30 = mp_int::vftable;
  pvVar3 = operator_new(0x80);
  local_28 = pvVar3;
  memset(pvVar3,0,0x80);
  local_1c = 0x20;
  if (*(int *)(param_1 + 0x10) == 0) {
    iVar5 = 0;
  }
  else {
    iVar5 = *(int *)(param_1 + 0x10) * 0x1c + -0x1c;
    for (uVar4 = *(uint *)(*(longlong *)(param_1 + 8) + -4 + (longlong)*(int *)(param_1 + 0x10) * 4)
        ; uVar4 != 0; uVar4 = uVar4 >> 1) {
      iVar5 = iVar5 + 1;
    }
  }
  local_18 = 0;
  local_20 = 0;
  memset(pvVar3,0,0x80);
  iVar1 = iVar5 / 0x1c;
  FUN_14011d8c0(&local_30,iVar1 + 1);
  pvVar3 = local_28;
  *(int *)((longlong)local_28 + (longlong)iVar1 * 4) =
       1 << ((char)iVar5 + (char)iVar1 * -0x1c & 0x1fU);
  local_20 = iVar1 + 1;
  uVar2 = FUN_14011fa20(&local_30,param_1,param_2,param_4,uVar6);
  if ((pvVar3 != (void *)0x0) && (local_1c != 0)) {
    memset(pvVar3,0,(longlong)(local_1c << 2));
  }
  operator_delete(pvVar3);
  return uVar2;
}



void FUN_140122ee0(longlong param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  int iVar5;
  uint *puVar6;
  longlong lVar7;
  
  iVar1 = *(int *)(param_1 + 0x18);
  if (iVar1 != *(int *)(param_2 + 0x18)) {
    *(int *)(param_3 + 0x18) = iVar1;
    FUN_14011efe0();
    return;
  }
  iVar2 = *(int *)(param_1 + 0x10);
  if (iVar2 <= *(int *)(param_2 + 0x10)) {
    iVar5 = 0;
    if (iVar2 < *(int *)(param_2 + 0x10)) {
LAB_140122f8d:
      *(uint *)(param_3 + 0x18) = (uint)(iVar1 == 0);
      lVar7 = param_2;
      goto LAB_140122f71;
    }
    puVar6 = (uint *)(*(longlong *)(param_1 + 8) + (longlong)(iVar2 + -1) * 4);
    if (0 < iVar2) {
      lVar7 = (*(longlong *)(param_2 + 8) + (longlong)(iVar2 + -1) * 4) - (longlong)puVar6;
      do {
        uVar3 = *puVar6;
        uVar4 = *(uint *)(lVar7 + (longlong)puVar6);
        if (uVar3 >= uVar4 && uVar3 != uVar4) break;
        if (uVar3 < uVar4) goto LAB_140122f8d;
        iVar5 = iVar5 + 1;
        puVar6 = puVar6 + -1;
      } while (iVar5 < iVar2);
    }
  }
  *(int *)(param_3 + 0x18) = iVar1;
  lVar7 = param_1;
  param_1 = param_2;
LAB_140122f71:
  FUN_14011fa20(lVar7,param_1,param_3);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140122fa0(undefined8 param_1,undefined8 param_2)

{
  undefined1 uVar1;
  uint uVar2;
  uint uVar3;
  void *_Dst;
  undefined1 *puVar4;
  uint *puVar5;
  longlong lVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  ulonglong uVar10;
  int iVar11;
  undefined1 *puVar12;
  ulonglong uVar13;
  undefined1 auStack_1b8 [32];
  uint local_198;
  undefined1 local_190 [8];
  undefined1 *local_188;
  int local_180;
  int local_17c;
  int local_178;
  undefined8 local_170;
  undefined1 local_168 [288];
  ulonglong local_48;
  
  local_170 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_1b8;
  FUN_14011d6d0(local_190);
  uVar2 = FUN_1400b8b80(param_2);
  iVar8 = 0;
  uVar10 = 0;
  local_198 = uVar2;
  if (local_180 != 0) {
    iVar7 = local_180;
    iVar9 = local_178;
    do {
      local_168[uVar10] = *local_188;
      uVar10 = uVar10 + 1;
      iVar8 = iVar8 + 1;
      if (uVar10 == 0x100) {
        FUN_1400b97e0(param_2,local_168,0x100);
        uVar10 = 0;
        iVar8 = 0;
      }
      _Dst = operator_new(0x80);
      memset(_Dst,0,0x80);
      iVar11 = iVar7 + -1;
      puVar5 = (uint *)(local_188 + (longlong)iVar11 * 4);
      uVar13 = 0;
      for (; -1 < iVar11; iVar11 = iVar11 + -1) {
        uVar2 = *puVar5;
        *puVar5 = uVar2 >> 8 | (int)uVar13 << 0x14;
        puVar5 = puVar5 + -1;
        uVar13 = (ulonglong)(uVar2 & 0xff);
      }
      while ((0 < iVar7 && (local_180 = iVar7, *(int *)(local_188 + (longlong)iVar7 * 4 + -4) == 0))
            ) {
        iVar7 = iVar7 + -1;
        local_180 = iVar7;
      }
      if (iVar7 == 0) {
        iVar9 = 0;
      }
      local_178 = iVar9;
      if (_Dst != (void *)0x0) {
        memset(_Dst,0,0x80);
      }
      operator_delete(_Dst);
      uVar2 = local_198;
    } while (iVar7 != 0);
    if (iVar8 != 0) {
      FUN_1400b97e0(param_2,local_168,iVar8);
    }
  }
  uVar3 = FUN_1400b8b80(param_2);
  if (uVar2 < uVar3) {
    puVar4 = (undefined1 *)FUN_1400b8ba0(param_2,uVar2);
    iVar8 = (uVar3 - uVar2) + -1;
    lVar6 = (longlong)iVar8;
    if (0 < iVar8) {
      puVar12 = puVar4;
      do {
        uVar1 = *puVar12;
        *puVar12 = puVar4[lVar6];
        puVar4[lVar6] = uVar1;
        puVar12 = puVar12 + 1;
        lVar6 = lVar6 + -1;
      } while ((longlong)puVar12 - (longlong)puVar4 < lVar6);
    }
  }
  if ((local_188 != (undefined1 *)0x0) && (local_17c != 0)) {
    memset(local_188,0,(longlong)(local_17c << 2));
  }
  operator_delete(local_188);
  return 1;
}



int FUN_1401231a0(undefined ***param_1,longlong param_2,undefined8 param_3)

{
  uint uVar1;
  longlong lVar2;
  int iVar3;
  uint uVar4;
  int iVar5;
  undefined4 *puVar6;
  void *pvVar7;
  int iVar8;
  uint *puVar9;
  undefined ***pppuVar10;
  undefined ***pppuVar11;
  undefined **ppuVar12;
  uint uVar13;
  uint *puVar14;
  uint uVar15;
  int iVar16;
  undefined **local_1e8;
  uint *local_1e0;
  int local_1d8;
  undefined8 local_1d4;
  undefined **local_1c8;
  uint *local_1c0;
  int local_1b8;
  undefined8 local_1b4;
  undefined **local_1a8;
  undefined4 *local_1a0;
  int local_198;
  undefined8 local_194;
  undefined **local_188;
  void *local_180;
  undefined4 local_178;
  undefined8 local_174;
  undefined **local_168;
  void *local_160;
  undefined4 local_158;
  undefined8 local_154;
  undefined **local_148;
  void *local_140;
  undefined4 local_138;
  undefined8 local_134;
  undefined **local_128;
  void *local_120;
  undefined4 local_118;
  undefined8 local_114;
  undefined **local_108;
  uint *local_100;
  int local_f8;
  undefined8 local_f4;
  undefined **local_e8;
  uint *local_e0;
  int local_d8;
  undefined8 local_d4;
  undefined **local_c8;
  void *local_c0;
  undefined4 local_b8;
  undefined8 local_b4;
  undefined **local_a8;
  void *local_a0;
  undefined4 local_98;
  undefined8 local_94;
  undefined **local_88;
  undefined4 *local_80;
  int local_78;
  undefined8 local_74;
  undefined **local_68;
  void *local_60;
  int local_58;
  undefined8 local_54;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  local_a8 = mp_int::vftable;
  local_a0 = operator_new(0x80);
  memset(local_a0,0,0x80);
  local_98 = 0;
  local_94 = 0x20;
  local_168 = mp_int::vftable;
  local_160 = operator_new(0x80);
  memset(local_160,0,0x80);
  local_158 = 0;
  local_154 = 0x20;
  local_188 = mp_int::vftable;
  local_180 = operator_new(0x80);
  memset(local_180,0,0x80);
  local_178 = 0;
  local_174 = 0x20;
  local_148 = mp_int::vftable;
  local_140 = operator_new(0x80);
  memset(local_140,0,0x80);
  local_138 = 0;
  local_134 = 0x20;
  local_c8 = mp_int::vftable;
  local_c0 = operator_new(0x80);
  memset(local_c0,0,0x80);
  local_b8 = 0;
  local_b4 = 0x20;
  local_1e8 = mp_int::vftable;
  local_1e0 = operator_new(0x80);
  memset(local_1e0,0,0x80);
  local_1d8 = 0;
  local_1d4 = 0x20;
  local_1c8 = mp_int::vftable;
  local_1c0 = operator_new(0x80);
  memset(local_1c0,0,0x80);
  local_1b8 = 0;
  local_1b4 = 0x20;
  local_108 = mp_int::vftable;
  local_100 = operator_new(0x80);
  memset(local_100,0,0x80);
  local_f8 = 0;
  local_f4 = 0x20;
  local_88 = mp_int::vftable;
  puVar6 = operator_new(0x80);
  local_80 = puVar6;
  memset(puVar6,0,0x80);
  local_78 = 0;
  local_74 = 0x20;
  local_1a8 = mp_int::vftable;
  local_1a0 = operator_new(0x80);
  memset(local_1a0,0,0x80);
  local_198 = 0;
  local_194 = 0x20;
  local_e8 = mp_int::vftable;
  local_e0 = operator_new(0x80);
  memset(local_e0,0,0x80);
  local_d8 = 0;
  local_d4 = 0x20;
  local_68 = mp_int::vftable;
  pvVar7 = operator_new(0x80);
  local_60 = pvVar7;
  memset(pvVar7,0,0x80);
  local_58 = 0;
  local_54 = 0x20;
  local_128 = mp_int::vftable;
  local_120 = operator_new(0x80);
  memset(local_120,0,0x80);
  local_118 = 0;
  local_114 = 0x20;
  iVar5 = *(int *)(param_2 + 0x10);
  if (*(int *)(param_1 + 2) < *(int *)(param_2 + 0x10)) {
    iVar5 = *(int *)(param_1 + 2);
  }
  iVar5 = iVar5 / 3;
  iVar16 = iVar5 * 0x1c;
  iVar3 = FUN_14011e220(param_1,iVar16,&local_108);
  if (iVar3 != 0) {
    local_128 = mp_int::vftable;
    if ((local_120 != (void *)0x0) && ((int)local_114 != 0)) {
      memset(local_120,0,(longlong)((int)local_114 << 2));
    }
    operator_delete(local_120);
    local_120 = (void *)0x0;
    local_114 = 0;
    local_118 = 0;
    if (pvVar7 != (void *)0x0) {
      memset(pvVar7,0,0x80);
    }
    operator_delete(pvVar7);
    local_e8 = mp_int::vftable;
    if ((local_e0 != (uint *)0x0) && ((int)local_d4 != 0)) {
      memset(local_e0,0,(longlong)((int)local_d4 << 2));
    }
    operator_delete(local_e0);
    local_e0 = (uint *)0x0;
    local_d4 = 0;
    local_d8 = 0;
    local_1a8 = mp_int::vftable;
    if ((local_1a0 != (undefined4 *)0x0) && ((int)local_194 != 0)) {
      memset(local_1a0,0,(longlong)((int)local_194 << 2));
    }
    operator_delete(local_1a0);
    local_1a0 = (undefined4 *)0x0;
    local_194 = 0;
    local_198 = 0;
    if (puVar6 != (undefined4 *)0x0) {
      memset(puVar6,0,0x80);
    }
    operator_delete(puVar6);
    local_108 = mp_int::vftable;
    if ((local_100 != (uint *)0x0) && ((int)local_f4 != 0)) {
      memset(local_100,0,(longlong)((int)local_f4 << 2));
    }
    operator_delete(local_100);
    local_100 = (uint *)0x0;
    local_f4 = 0;
    local_f8 = 0;
    local_1c8 = mp_int::vftable;
    if ((local_1c0 != (uint *)0x0) && ((int)local_1b4 != 0)) {
      memset(local_1c0,0,(longlong)((int)local_1b4 << 2));
    }
    operator_delete(local_1c0);
    local_1c0 = (uint *)0x0;
    local_1b4 = 0;
    local_1b8 = 0;
    local_1e8 = mp_int::vftable;
    if ((local_1e0 != (uint *)0x0) && ((int)local_1d4 != 0)) {
      memset(local_1e0,0,(longlong)((int)local_1d4 << 2));
    }
    operator_delete(local_1e0);
    local_1e0 = (uint *)0x0;
    local_1d4 = 0;
    local_1d8 = 0;
    local_c8 = mp_int::vftable;
    if ((local_c0 != (void *)0x0) && ((int)local_b4 != 0)) {
      memset(local_c0,0,(longlong)((int)local_b4 << 2));
    }
    operator_delete(local_c0);
    local_c0 = (void *)0x0;
    local_b4 = 0;
    local_b8 = 0;
    local_148 = mp_int::vftable;
    if ((local_140 != (void *)0x0) && ((int)local_134 != 0)) {
      memset(local_140,0,(longlong)((int)local_134 << 2));
    }
    operator_delete(local_140);
    local_140 = (void *)0x0;
    local_134 = 0;
    local_138 = 0;
    local_188 = mp_int::vftable;
    if ((local_180 != (void *)0x0) && ((int)local_174 != 0)) {
      memset(local_180,0,(longlong)((int)local_174 << 2));
    }
    operator_delete(local_180);
    local_180 = (void *)0x0;
    local_174 = 0;
    local_178 = 0;
    local_168 = mp_int::vftable;
    if ((local_160 != (void *)0x0) && ((int)local_154 != 0)) {
      memset(local_160,0,(longlong)((int)local_154 << 2));
    }
    operator_delete(local_160);
    local_160 = (void *)0x0;
    local_154 = 0;
    local_158 = 0;
    local_a8 = mp_int::vftable;
    if ((local_a0 != (void *)0x0) && ((int)local_94 != 0)) {
      memset(local_a0,0,(longlong)((int)local_94 << 2));
    }
    operator_delete(local_a0);
    return iVar3;
  }
  if (param_1 != &local_88) {
    iVar3 = 0;
    if (0x20 < *(int *)(param_1 + 2)) {
      FUN_14011d8c0();
      puVar6 = local_80;
      iVar3 = local_78;
    }
    ppuVar12 = param_1[1];
    iVar8 = 0;
    if (0 < *(int *)(param_1 + 2)) {
      do {
        *puVar6 = *(undefined4 *)ppuVar12;
        puVar6 = puVar6 + 1;
        ppuVar12 = (undefined **)((longlong)ppuVar12 + 4);
        iVar8 = iVar8 + 1;
      } while (iVar8 < *(int *)(param_1 + 2));
    }
    if (iVar8 < iVar3) {
      memset(puVar6,0,(ulonglong)(uint)(iVar3 - iVar8) << 2);
    }
    local_78 = *(int *)(param_1 + 2);
    local_74 = CONCAT44(*(undefined4 *)(param_1 + 3),(int)local_74);
  }
  FUN_14011e810(&local_88,iVar5);
  FUN_14011e220(&local_88,iVar16,&local_88);
  if (param_1 != &local_1a8) {
    if ((int)local_194 < *(int *)(param_1 + 2)) {
      FUN_14011d8c0(&local_1a8);
    }
    ppuVar12 = param_1[1];
    iVar3 = 0;
    puVar6 = local_1a0;
    if (0 < *(int *)(param_1 + 2)) {
      do {
        *puVar6 = *(undefined4 *)ppuVar12;
        puVar6 = puVar6 + 1;
        ppuVar12 = (undefined **)((longlong)ppuVar12 + 4);
        iVar3 = iVar3 + 1;
      } while (iVar3 < *(int *)(param_1 + 2));
    }
    for (; iVar3 < local_198; iVar3 = iVar3 + 1) {
      *puVar6 = 0;
      puVar6 = puVar6 + 1;
    }
    local_198 = *(int *)(param_1 + 2);
    local_194 = CONCAT44(*(undefined4 *)(param_1 + 3),(int)local_194);
  }
  iVar3 = iVar5 * 2;
  FUN_14011e810(&local_1a8,iVar3);
  iVar8 = FUN_14011e220(param_2,iVar16,&local_e8);
  if (iVar8 != 0) {
    local_128 = mp_int::vftable;
    if ((local_120 != (void *)0x0) && ((int)local_114 != 0)) {
      memset(local_120,0,(longlong)((int)local_114 << 2));
    }
    operator_delete(local_120);
    local_120 = (void *)0x0;
    local_114 = 0;
    local_118 = 0;
    if (pvVar7 != (void *)0x0) {
      memset(pvVar7,0,0x80);
    }
    operator_delete(pvVar7);
    local_e8 = mp_int::vftable;
    if ((local_e0 != (uint *)0x0) && ((int)local_d4 != 0)) {
      memset(local_e0,0,(longlong)((int)local_d4 << 2));
    }
    operator_delete(local_e0);
    local_e0 = (uint *)0x0;
    local_d4 = 0;
    local_d8 = 0;
    local_1a8 = mp_int::vftable;
    if ((local_1a0 != (undefined4 *)0x0) && ((int)local_194 != 0)) {
      memset(local_1a0,0,(longlong)((int)local_194 << 2));
    }
    operator_delete(local_1a0);
    puVar6 = local_80;
    local_1a0 = (undefined4 *)0x0;
    local_194 = 0;
    local_198 = 0;
    if ((local_80 != (undefined4 *)0x0) && ((int)local_74 != 0)) {
      memset(local_80,0,(longlong)((int)local_74 << 2));
    }
    operator_delete(puVar6);
    local_108 = mp_int::vftable;
    if ((local_100 != (uint *)0x0) && ((int)local_f4 != 0)) {
      memset(local_100,0,(longlong)((int)local_f4 << 2));
    }
    operator_delete(local_100);
    local_100 = (uint *)0x0;
    local_f4 = 0;
    local_f8 = 0;
    local_1c8 = mp_int::vftable;
    if ((local_1c0 != (uint *)0x0) && ((int)local_1b4 != 0)) {
      memset(local_1c0,0,(longlong)((int)local_1b4 << 2));
    }
    operator_delete(local_1c0);
    local_1c0 = (uint *)0x0;
    local_1b4 = 0;
    local_1b8 = 0;
    local_1e8 = mp_int::vftable;
    if ((local_1e0 != (uint *)0x0) && ((int)local_1d4 != 0)) {
      memset(local_1e0,0,(longlong)((int)local_1d4 << 2));
    }
    operator_delete(local_1e0);
    local_1e0 = (uint *)0x0;
    local_1d4 = 0;
    local_1d8 = 0;
    local_c8 = mp_int::vftable;
    if ((local_c0 != (void *)0x0) && ((int)local_b4 != 0)) {
      memset(local_c0,0,(longlong)((int)local_b4 << 2));
    }
    operator_delete(local_c0);
    local_c0 = (void *)0x0;
    local_b4 = 0;
    local_b8 = 0;
    local_148 = mp_int::vftable;
    if ((local_140 != (void *)0x0) && ((int)local_134 != 0)) {
      memset(local_140,0,(longlong)((int)local_134 << 2));
    }
    operator_delete(local_140);
    local_140 = (void *)0x0;
    local_134 = 0;
    local_138 = 0;
    local_188 = mp_int::vftable;
    if ((local_180 != (void *)0x0) && ((int)local_174 != 0)) {
      memset(local_180,0,(longlong)((int)local_174 << 2));
    }
    operator_delete(local_180);
    local_180 = (void *)0x0;
    local_174 = 0;
    local_178 = 0;
    local_168 = mp_int::vftable;
    if ((local_160 != (void *)0x0) && ((int)local_154 != 0)) {
      memset(local_160,0,(longlong)((int)local_154 << 2));
    }
    operator_delete(local_160);
    goto LAB_140123b0f;
  }
  iVar8 = FUN_14011d9d0(param_2);
  if (iVar8 != 0) {
    local_128 = mp_int::vftable;
    if ((local_120 != (void *)0x0) && ((int)local_114 != 0)) {
      memset(local_120,0,(longlong)((int)local_114 << 2));
    }
    operator_delete(local_120);
    pvVar7 = local_60;
    local_120 = (void *)0x0;
    local_114 = 0;
    local_118 = 0;
    if ((local_60 != (void *)0x0) && ((int)local_54 != 0)) {
      memset(local_60,0,(longlong)((int)local_54 << 2));
    }
    operator_delete(pvVar7);
    local_e8 = mp_int::vftable;
    if ((local_e0 != (uint *)0x0) && ((int)local_d4 != 0)) {
      memset(local_e0,0,(longlong)((int)local_d4 << 2));
    }
    operator_delete(local_e0);
    local_e0 = (uint *)0x0;
    local_d4 = 0;
    local_d8 = 0;
    local_1a8 = mp_int::vftable;
    if ((local_1a0 != (undefined4 *)0x0) && ((int)local_194 != 0)) {
      memset(local_1a0,0,(longlong)((int)local_194 << 2));
    }
    operator_delete(local_1a0);
    puVar6 = local_80;
    local_1a0 = (undefined4 *)0x0;
    local_194 = 0;
    local_198 = 0;
    if ((local_80 != (undefined4 *)0x0) && ((int)local_74 != 0)) {
      memset(local_80,0,(longlong)((int)local_74 << 2));
    }
    operator_delete(puVar6);
    local_108 = mp_int::vftable;
    if ((local_100 != (uint *)0x0) && ((int)local_f4 != 0)) {
      memset(local_100,0,(longlong)((int)local_f4 << 2));
    }
    operator_delete(local_100);
    local_100 = (uint *)0x0;
    local_f4 = 0;
    local_f8 = 0;
    local_1c8 = mp_int::vftable;
    if ((local_1c0 != (uint *)0x0) && ((int)local_1b4 != 0)) {
      memset(local_1c0,0,(longlong)((int)local_1b4 << 2));
    }
    operator_delete(local_1c0);
    local_1c0 = (uint *)0x0;
    local_1b4 = 0;
    local_1b8 = 0;
    local_1e8 = mp_int::vftable;
    if ((local_1e0 != (uint *)0x0) && ((int)local_1d4 != 0)) {
      memset(local_1e0,0,(longlong)((int)local_1d4 << 2));
    }
    operator_delete(local_1e0);
    local_1e0 = (uint *)0x0;
    local_1d4 = 0;
    local_1d8 = 0;
    local_c8 = mp_int::vftable;
    if ((local_c0 != (void *)0x0) && ((int)local_b4 != 0)) {
      memset(local_c0,0,(longlong)((int)local_b4 << 2));
    }
    operator_delete(local_c0);
    local_c0 = (void *)0x0;
    local_b4 = 0;
    local_b8 = 0;
    local_148 = mp_int::vftable;
    if ((local_140 != (void *)0x0) && ((int)local_134 != 0)) {
      memset(local_140,0,(longlong)((int)local_134 << 2));
    }
    operator_delete(local_140);
    local_140 = (void *)0x0;
    local_134 = 0;
    local_138 = 0;
    local_188 = mp_int::vftable;
    if ((local_180 != (void *)0x0) && ((int)local_174 != 0)) {
      memset(local_180,0,(longlong)((int)local_174 << 2));
    }
    operator_delete(local_180);
    local_180 = (void *)0x0;
    local_174 = 0;
    local_178 = 0;
    local_168 = mp_int::vftable;
    if ((local_160 != (void *)0x0) && ((int)local_154 != 0)) {
      memset(local_160,0,(longlong)((int)local_154 << 2));
    }
    operator_delete(local_160);
    goto LAB_140123b0f;
  }
  FUN_14011e810(&local_68,iVar5);
  FUN_14011e220(&local_68,iVar16,&local_68);
  iVar8 = FUN_14011d9d0(param_2);
  if (iVar8 != 0) {
    local_128 = mp_int::vftable;
    if ((local_120 != (void *)0x0) && ((int)local_114 != 0)) {
      memset(local_120,0,(longlong)((int)local_114 << 2));
    }
    operator_delete(local_120);
    pvVar7 = local_60;
    local_120 = (void *)0x0;
    local_114 = 0;
    local_118 = 0;
    if ((local_60 != (void *)0x0) && ((int)local_54 != 0)) {
      memset(local_60,0,(longlong)((int)local_54 << 2));
    }
    operator_delete(pvVar7);
    local_e8 = mp_int::vftable;
    if ((local_e0 != (uint *)0x0) && ((int)local_d4 != 0)) {
      memset(local_e0,0,(longlong)((int)local_d4 << 2));
    }
    operator_delete(local_e0);
    local_e0 = (uint *)0x0;
    local_d4 = 0;
    local_d8 = 0;
    local_1a8 = mp_int::vftable;
    if ((local_1a0 != (undefined4 *)0x0) && ((int)local_194 != 0)) {
      memset(local_1a0,0,(longlong)((int)local_194 << 2));
    }
    operator_delete(local_1a0);
    puVar6 = local_80;
    local_1a0 = (undefined4 *)0x0;
    local_194 = 0;
    local_198 = 0;
    if ((local_80 != (undefined4 *)0x0) && ((int)local_74 != 0)) {
      memset(local_80,0,(longlong)((int)local_74 << 2));
    }
    operator_delete(puVar6);
    local_108 = mp_int::vftable;
    if ((local_100 != (uint *)0x0) && ((int)local_f4 != 0)) {
      memset(local_100,0,(longlong)((int)local_f4 << 2));
    }
    operator_delete(local_100);
    local_100 = (uint *)0x0;
    local_f4 = 0;
    local_f8 = 0;
    local_1c8 = mp_int::vftable;
    if ((local_1c0 != (uint *)0x0) && ((int)local_1b4 != 0)) {
      memset(local_1c0,0,(longlong)((int)local_1b4 << 2));
    }
    operator_delete(local_1c0);
    local_1c0 = (uint *)0x0;
    local_1b4 = 0;
    local_1b8 = 0;
    local_1e8 = mp_int::vftable;
    if ((local_1e0 != (uint *)0x0) && ((int)local_1d4 != 0)) {
      memset(local_1e0,0,(longlong)((int)local_1d4 << 2));
    }
    operator_delete(local_1e0);
    local_1e0 = (uint *)0x0;
    local_1d4 = 0;
    local_1d8 = 0;
    local_c8 = mp_int::vftable;
    if ((local_c0 != (void *)0x0) && ((int)local_b4 != 0)) {
      memset(local_c0,0,(longlong)((int)local_b4 << 2));
    }
    operator_delete(local_c0);
    local_c0 = (void *)0x0;
    local_b4 = 0;
    local_b8 = 0;
    local_148 = mp_int::vftable;
    if ((local_140 != (void *)0x0) && ((int)local_134 != 0)) {
      memset(local_140,0,(longlong)((int)local_134 << 2));
    }
    operator_delete(local_140);
    local_140 = (void *)0x0;
    local_134 = 0;
    local_138 = 0;
    local_188 = mp_int::vftable;
    if ((local_180 != (void *)0x0) && ((int)local_174 != 0)) {
      memset(local_180,0,(longlong)((int)local_174 << 2));
    }
    operator_delete(local_180);
    local_180 = (void *)0x0;
    local_174 = 0;
    local_178 = 0;
    local_168 = mp_int::vftable;
    if ((local_160 != (void *)0x0) && ((int)local_154 != 0)) {
      memset(local_160,0,(longlong)((int)local_154 << 2));
    }
    operator_delete(local_160);
    goto LAB_140123b0f;
  }
  FUN_14011e810(&local_128,iVar3);
  iVar8 = FUN_14012b7a0(&local_108,&local_e8,&local_a8);
  if (iVar8 != 0) {
    local_128 = mp_int::vftable;
    if ((local_120 != (void *)0x0) && ((int)local_114 != 0)) {
      memset(local_120,0,(longlong)((int)local_114 << 2));
    }
    operator_delete(local_120);
    pvVar7 = local_60;
    local_120 = (void *)0x0;
    local_114 = 0;
    local_118 = 0;
    if ((local_60 != (void *)0x0) && ((int)local_54 != 0)) {
      memset(local_60,0,(longlong)((int)local_54 << 2));
    }
    operator_delete(pvVar7);
    local_e8 = mp_int::vftable;
    if ((local_e0 != (uint *)0x0) && ((int)local_d4 != 0)) {
      memset(local_e0,0,(longlong)((int)local_d4 << 2));
    }
    operator_delete(local_e0);
    local_e0 = (uint *)0x0;
    local_d4 = 0;
    local_d8 = 0;
    local_1a8 = mp_int::vftable;
    if ((local_1a0 != (undefined4 *)0x0) && ((int)local_194 != 0)) {
      memset(local_1a0,0,(longlong)((int)local_194 << 2));
    }
    operator_delete(local_1a0);
    puVar6 = local_80;
    local_1a0 = (undefined4 *)0x0;
    local_194 = 0;
    local_198 = 0;
    if ((local_80 != (undefined4 *)0x0) && ((int)local_74 != 0)) {
      memset(local_80,0,(longlong)((int)local_74 << 2));
    }
    operator_delete(puVar6);
    local_108 = mp_int::vftable;
    if ((local_100 != (uint *)0x0) && ((int)local_f4 != 0)) {
      memset(local_100,0,(longlong)((int)local_f4 << 2));
    }
    operator_delete(local_100);
    local_100 = (uint *)0x0;
    local_f4 = 0;
    local_f8 = 0;
    local_1c8 = mp_int::vftable;
    if ((local_1c0 != (uint *)0x0) && ((int)local_1b4 != 0)) {
      memset(local_1c0,0,(longlong)((int)local_1b4 << 2));
    }
    operator_delete(local_1c0);
    local_1c0 = (uint *)0x0;
    local_1b4 = 0;
    local_1b8 = 0;
    local_1e8 = mp_int::vftable;
    if ((local_1e0 != (uint *)0x0) && ((int)local_1d4 != 0)) {
      memset(local_1e0,0,(longlong)((int)local_1d4 << 2));
    }
    operator_delete(local_1e0);
    local_1e0 = (uint *)0x0;
    local_1d4 = 0;
    local_1d8 = 0;
    local_c8 = mp_int::vftable;
    if ((local_c0 != (void *)0x0) && ((int)local_b4 != 0)) {
      memset(local_c0,0,(longlong)((int)local_b4 << 2));
    }
    operator_delete(local_c0);
    local_c0 = (void *)0x0;
    local_b4 = 0;
    local_b8 = 0;
    local_148 = mp_int::vftable;
    if ((local_140 != (void *)0x0) && ((int)local_134 != 0)) {
      memset(local_140,0,(longlong)((int)local_134 << 2));
    }
    operator_delete(local_140);
    local_140 = (void *)0x0;
    local_134 = 0;
    local_138 = 0;
    local_188 = mp_int::vftable;
    if ((local_180 != (void *)0x0) && ((int)local_174 != 0)) {
      memset(local_180,0,(longlong)((int)local_174 << 2));
    }
    operator_delete(local_180);
    local_180 = (void *)0x0;
    local_174 = 0;
    local_178 = 0;
    local_168 = mp_int::vftable;
    if ((local_160 != (void *)0x0) && ((int)local_154 != 0)) {
      memset(local_160,0,(longlong)((int)local_154 << 2));
    }
    operator_delete(local_160);
    goto LAB_140123b0f;
  }
  iVar8 = FUN_14012b7a0(&local_1a8,&local_128,&local_c8);
  if (iVar8 != 0) {
    local_128 = mp_int::vftable;
    if ((local_120 != (void *)0x0) && ((int)local_114 != 0)) {
      memset(local_120,0,(longlong)((int)local_114 << 2));
    }
    operator_delete(local_120);
    pvVar7 = local_60;
    local_120 = (void *)0x0;
    local_114 = 0;
    local_118 = 0;
    if ((local_60 != (void *)0x0) && ((int)local_54 != 0)) {
      memset(local_60,0,(longlong)((int)local_54 << 2));
    }
    operator_delete(pvVar7);
    local_e8 = mp_int::vftable;
    if ((local_e0 != (uint *)0x0) && ((int)local_d4 != 0)) {
      memset(local_e0,0,(longlong)((int)local_d4 << 2));
    }
    operator_delete(local_e0);
    local_e0 = (uint *)0x0;
    local_d4 = 0;
    local_d8 = 0;
    local_1a8 = mp_int::vftable;
    if ((local_1a0 != (undefined4 *)0x0) && ((int)local_194 != 0)) {
      memset(local_1a0,0,(longlong)((int)local_194 << 2));
    }
    operator_delete(local_1a0);
    puVar6 = local_80;
    local_1a0 = (undefined4 *)0x0;
    local_194 = 0;
    local_198 = 0;
    if ((local_80 != (undefined4 *)0x0) && ((int)local_74 != 0)) {
      memset(local_80,0,(longlong)((int)local_74 << 2));
    }
    operator_delete(puVar6);
    local_108 = mp_int::vftable;
    if ((local_100 != (uint *)0x0) && ((int)local_f4 != 0)) {
      memset(local_100,0,(longlong)((int)local_f4 << 2));
    }
    operator_delete(local_100);
    local_100 = (uint *)0x0;
    local_f4 = 0;
    local_f8 = 0;
    local_1c8 = mp_int::vftable;
    if ((local_1c0 != (uint *)0x0) && ((int)local_1b4 != 0)) {
      memset(local_1c0,0,(longlong)((int)local_1b4 << 2));
    }
    operator_delete(local_1c0);
    local_1c0 = (uint *)0x0;
    local_1b4 = 0;
    local_1b8 = 0;
    local_1e8 = mp_int::vftable;
    if ((local_1e0 != (uint *)0x0) && ((int)local_1d4 != 0)) {
      memset(local_1e0,0,(longlong)((int)local_1d4 << 2));
    }
    operator_delete(local_1e0);
    local_1e0 = (uint *)0x0;
    local_1d4 = 0;
    local_1d8 = 0;
    local_c8 = mp_int::vftable;
    if ((local_c0 != (void *)0x0) && ((int)local_b4 != 0)) {
      memset(local_c0,0,(longlong)((int)local_b4 << 2));
    }
    operator_delete(local_c0);
    local_c0 = (void *)0x0;
    local_b4 = 0;
    local_b8 = 0;
    local_148 = mp_int::vftable;
    if ((local_140 != (void *)0x0) && ((int)local_134 != 0)) {
      memset(local_140,0,(longlong)((int)local_134 << 2));
    }
    operator_delete(local_140);
    local_140 = (void *)0x0;
    local_134 = 0;
    local_138 = 0;
    local_188 = mp_int::vftable;
    if ((local_180 != (void *)0x0) && ((int)local_174 != 0)) {
      memset(local_180,0,(longlong)((int)local_174 << 2));
    }
    operator_delete(local_180);
    local_180 = (void *)0x0;
    local_174 = 0;
    local_178 = 0;
    local_168 = mp_int::vftable;
    if ((local_160 != (void *)0x0) && ((int)local_154 != 0)) {
      memset(local_160,0,(longlong)((int)local_154 << 2));
    }
    operator_delete(local_160);
    goto LAB_140123b0f;
  }
  if ((int)local_1d4 < local_f8 + 1) {
    FUN_14011d8c0(&local_1e8);
  }
  iVar16 = local_1d8;
  local_1d8 = local_f8;
  uVar4 = 0;
  puVar9 = local_1e0;
  puVar14 = local_100;
  uVar13 = uVar4;
  uVar15 = uVar4;
  if (0 < local_f8) {
    do {
      uVar1 = *puVar14;
      *puVar9 = uVar1 * 2 & 0xfffffff | uVar13;
      puVar9 = puVar9 + 1;
      puVar14 = puVar14 + 1;
      uVar15 = uVar15 + 1;
      uVar13 = uVar1 >> 0x1b;
    } while ((int)uVar15 < local_f8);
    if (uVar1 >> 0x1b != 0) {
      *puVar9 = 1;
      local_1d8 = local_f8 + 1;
    }
  }
  if (local_1d8 < iVar16) {
    memset(local_1e0 + local_1d8,0,(ulonglong)(uint)(iVar16 - local_1d8) << 2);
  }
  puVar6 = local_80;
  if (local_f4._4_4_ == local_74._4_4_) {
    local_1d4 = CONCAT44(local_f4._4_4_,(int)local_1d4);
    iVar8 = FUN_14011efe0(&local_1e8,&local_88,&local_1e8);
    puVar6 = local_80;
  }
  else {
    if (local_78 < local_1d8) {
LAB_14012476d:
      pppuVar10 = &local_88;
      pppuVar11 = &local_1e8;
      iVar16 = local_f4._4_4_;
    }
    else {
      if (local_78 <= local_1d8) {
        puVar9 = local_1e0 + (local_1d8 + -1);
        if (0 < local_1d8) {
          lVar2 = (longlong)(local_1d8 + -1) * 4 - (longlong)puVar9;
          uVar13 = uVar4;
          do {
            uVar15 = *(uint *)((longlong)local_80 + lVar2 + (longlong)puVar9);
            uVar1 = *puVar9;
            if (uVar1 >= uVar15 && uVar1 != uVar15) break;
            if (uVar1 < uVar15) goto LAB_14012475b;
            uVar13 = uVar13 + 1;
            puVar9 = puVar9 + -1;
          } while ((int)uVar13 < local_1d8);
        }
        goto LAB_14012476d;
      }
LAB_14012475b:
      pppuVar10 = &local_1e8;
      pppuVar11 = &local_88;
      iVar16 = local_74._4_4_;
    }
    local_1d4 = CONCAT44(iVar16,(int)local_1d4);
    iVar8 = FUN_14011fa20(pppuVar11,pppuVar10,&local_1e8);
  }
  if (iVar8 != 0) {
    local_128 = mp_int::vftable;
    if ((local_120 != (void *)0x0) && ((int)local_114 != 0)) {
      memset(local_120,0,(longlong)((int)local_114 << 2));
    }
    operator_delete(local_120);
    pvVar7 = local_60;
    local_120 = (void *)0x0;
    local_114 = 0;
    local_118 = 0;
    if ((local_60 != (void *)0x0) && ((int)local_54 != 0)) {
      memset(local_60,0,(longlong)((int)local_54 << 2));
    }
    operator_delete(pvVar7);
    local_e8 = mp_int::vftable;
    if ((local_e0 != (uint *)0x0) && ((int)local_d4 != 0)) {
      memset(local_e0,0,(longlong)((int)local_d4 << 2));
    }
    operator_delete(local_e0);
    local_e0 = (uint *)0x0;
    local_d4 = 0;
    local_d8 = 0;
    local_1a8 = mp_int::vftable;
    if ((local_1a0 != (undefined4 *)0x0) && ((int)local_194 != 0)) {
      memset(local_1a0,0,(longlong)((int)local_194 << 2));
    }
    operator_delete(local_1a0);
    local_1a0 = (undefined4 *)0x0;
    local_194 = 0;
    local_198 = 0;
    if ((puVar6 != (undefined4 *)0x0) && ((int)local_74 != 0)) {
      memset(puVar6,0,(longlong)((int)local_74 << 2));
    }
    operator_delete(puVar6);
    local_108 = mp_int::vftable;
    if ((local_100 != (uint *)0x0) && ((int)local_f4 != 0)) {
      memset(local_100,0,(longlong)((int)local_f4 << 2));
    }
    operator_delete(local_100);
    local_100 = (uint *)0x0;
    local_f4 = 0;
    local_f8 = 0;
    local_1c8 = mp_int::vftable;
    if ((local_1c0 != (uint *)0x0) && ((int)local_1b4 != 0)) {
      memset(local_1c0,0,(longlong)((int)local_1b4 << 2));
    }
    operator_delete(local_1c0);
    local_1c0 = (uint *)0x0;
    local_1b4 = 0;
    local_1b8 = 0;
    local_1e8 = mp_int::vftable;
    if ((local_1e0 != (uint *)0x0) && ((int)local_1d4 != 0)) {
      memset(local_1e0,0,(longlong)((int)local_1d4 << 2));
    }
    operator_delete(local_1e0);
    local_1e0 = (uint *)0x0;
    local_1d4 = 0;
    local_1d8 = 0;
    local_c8 = mp_int::vftable;
    if ((local_c0 != (void *)0x0) && ((int)local_b4 != 0)) {
      memset(local_c0,0,(longlong)((int)local_b4 << 2));
    }
    operator_delete(local_c0);
    local_c0 = (void *)0x0;
    local_b4 = 0;
    local_b8 = 0;
    local_148 = mp_int::vftable;
    if ((local_140 != (void *)0x0) && ((int)local_134 != 0)) {
      memset(local_140,0,(longlong)((int)local_134 << 2));
    }
    operator_delete(local_140);
    local_140 = (void *)0x0;
    local_134 = 0;
    local_138 = 0;
    local_188 = mp_int::vftable;
    if ((local_180 != (void *)0x0) && ((int)local_174 != 0)) {
      memset(local_180,0,(longlong)((int)local_174 << 2));
    }
    operator_delete(local_180);
    local_180 = (void *)0x0;
    local_174 = 0;
    local_178 = 0;
    local_168 = mp_int::vftable;
    if ((local_160 != (void *)0x0) && ((int)local_154 != 0)) {
      memset(local_160,0,(longlong)((int)local_154 << 2));
    }
    operator_delete(local_160);
    goto LAB_140123b0f;
  }
  if ((int)local_1d4 < local_1d8 + 1) {
    FUN_14011d8c0(&local_1e8);
  }
  iVar16 = local_1d8;
  puVar9 = local_1e0;
  uVar13 = uVar4;
  uVar15 = uVar4;
  if (0 < local_1d8) {
    do {
      uVar1 = *puVar9;
      *puVar9 = uVar1 * 2 & 0xfffffff | uVar15;
      puVar9 = puVar9 + 1;
      uVar13 = uVar13 + 1;
      uVar15 = uVar1 >> 0x1b;
    } while ((int)uVar13 < local_1d8);
    if (uVar1 >> 0x1b != 0) {
      *puVar9 = 1;
      local_1d8 = local_1d8 + 1;
    }
  }
  if (local_1d8 < iVar16) {
    memset(local_1e0 + local_1d8,0,(ulonglong)(uint)(iVar16 - local_1d8) << 2);
  }
  if (local_1d4._4_4_ == local_194._4_4_) {
    iVar8 = FUN_14011efe0(&local_1e8,&local_1a8,&local_1e8);
  }
  else {
    if (local_198 < local_1d8) {
LAB_140124b4c:
      pppuVar11 = &local_1a8;
      pppuVar10 = &local_1e8;
    }
    else {
      if (local_198 <= local_1d8) {
        puVar9 = local_1e0 + (local_1d8 + -1);
        if (0 < local_1d8) {
          lVar2 = (longlong)(local_1d8 + -1) * 4 - (longlong)puVar9;
          uVar13 = uVar4;
          do {
            uVar15 = *(uint *)((longlong)puVar9 + (longlong)local_1a0 + lVar2);
            uVar1 = *puVar9;
            if (uVar1 >= uVar15 && uVar1 != uVar15) break;
            if (uVar1 < uVar15) goto LAB_140124b3b;
            uVar13 = uVar13 + 1;
            puVar9 = puVar9 + -1;
          } while ((int)uVar13 < local_1d8);
        }
        goto LAB_140124b4c;
      }
LAB_140124b3b:
      local_1d4 = CONCAT44(local_194._4_4_,(int)local_1d4);
      pppuVar11 = &local_1e8;
      pppuVar10 = &local_1a8;
    }
    iVar8 = FUN_14011fa20(pppuVar10,pppuVar11,&local_1e8);
  }
  if (iVar8 != 0) {
    local_128 = mp_int::vftable;
    if ((local_120 != (void *)0x0) && ((int)local_114 != 0)) {
      memset(local_120,0,(longlong)((int)local_114 << 2));
    }
    operator_delete(local_120);
    pvVar7 = local_60;
    local_120 = (void *)0x0;
    local_114 = 0;
    local_118 = 0;
    if ((local_60 != (void *)0x0) && ((int)local_54 != 0)) {
      memset(local_60,0,(longlong)((int)local_54 << 2));
    }
    operator_delete(pvVar7);
    local_e8 = mp_int::vftable;
    if ((local_e0 != (uint *)0x0) && ((int)local_d4 != 0)) {
      memset(local_e0,0,(longlong)((int)local_d4 << 2));
    }
    operator_delete(local_e0);
    local_e0 = (uint *)0x0;
    local_d4 = 0;
    local_d8 = 0;
    local_1a8 = mp_int::vftable;
    if ((local_1a0 != (undefined4 *)0x0) && ((int)local_194 != 0)) {
      memset(local_1a0,0,(longlong)((int)local_194 << 2));
    }
    operator_delete(local_1a0);
    local_1a0 = (undefined4 *)0x0;
    local_194 = 0;
    local_198 = 0;
    if ((puVar6 != (undefined4 *)0x0) && ((int)local_74 != 0)) {
      memset(puVar6,0,(longlong)((int)local_74 << 2));
    }
    operator_delete(puVar6);
    local_108 = mp_int::vftable;
    if ((local_100 != (uint *)0x0) && ((int)local_f4 != 0)) {
      memset(local_100,0,(longlong)((int)local_f4 << 2));
    }
    operator_delete(local_100);
    local_100 = (uint *)0x0;
    local_f4 = 0;
    local_f8 = 0;
    local_1c8 = mp_int::vftable;
    if ((local_1c0 != (uint *)0x0) && ((int)local_1b4 != 0)) {
      memset(local_1c0,0,(longlong)((int)local_1b4 << 2));
    }
    operator_delete(local_1c0);
    local_1c0 = (uint *)0x0;
    local_1b4 = 0;
    local_1b8 = 0;
    local_1e8 = mp_int::vftable;
    if ((local_1e0 != (uint *)0x0) && ((int)local_1d4 != 0)) {
      memset(local_1e0,0,(longlong)((int)local_1d4 << 2));
    }
    operator_delete(local_1e0);
    local_1e0 = (uint *)0x0;
    local_1d4 = 0;
    local_1d8 = 0;
    local_c8 = mp_int::vftable;
    if ((local_c0 != (void *)0x0) && ((int)local_b4 != 0)) {
      memset(local_c0,0,(longlong)((int)local_b4 << 2));
    }
    operator_delete(local_c0);
    local_c0 = (void *)0x0;
    local_b4 = 0;
    local_b8 = 0;
    local_148 = mp_int::vftable;
    if ((local_140 != (void *)0x0) && ((int)local_134 != 0)) {
      memset(local_140,0,(longlong)((int)local_134 << 2));
    }
    operator_delete(local_140);
    local_140 = (void *)0x0;
    local_134 = 0;
    local_138 = 0;
    local_188 = mp_int::vftable;
    if ((local_180 != (void *)0x0) && ((int)local_174 != 0)) {
      memset(local_180,0,(longlong)((int)local_174 << 2));
    }
    operator_delete(local_180);
    local_180 = (void *)0x0;
    local_174 = 0;
    local_178 = 0;
    local_168 = mp_int::vftable;
    if ((local_160 != (void *)0x0) && ((int)local_154 != 0)) {
      memset(local_160,0,(longlong)((int)local_154 << 2));
    }
    operator_delete(local_160);
LAB_140123b0f:
    local_154 = 0;
    local_158 = 0;
    local_160 = (void *)0x0;
    local_a8 = mp_int::vftable;
    if ((local_a0 != (void *)0x0) && ((int)local_94 != 0)) {
      memset(local_a0,0,(longlong)((int)local_94 << 2));
    }
    operator_delete(local_a0);
    return iVar8;
  }
  if ((int)local_1b4 < local_d8 + 1) {
    FUN_14011d8c0(&local_1c8);
  }
  iVar16 = local_1b8;
  local_1b8 = local_d8;
  puVar9 = local_1c0;
  puVar14 = local_e0;
  uVar13 = uVar4;
  uVar15 = uVar4;
  if (0 < local_d8) {
    do {
      uVar1 = *puVar14;
      *puVar9 = uVar1 * 2 & 0xfffffff | uVar15;
      puVar9 = puVar9 + 1;
      uVar13 = uVar13 + 1;
      puVar14 = puVar14 + 1;
      uVar15 = uVar1 >> 0x1b;
    } while ((int)uVar13 < local_d8);
    if (uVar1 >> 0x1b != 0) {
      *puVar9 = 1;
      local_1b8 = local_d8 + 1;
    }
  }
  if (local_1b8 < iVar16) {
    memset(local_1c0 + local_1b8,0,(ulonglong)(uint)(iVar16 - local_1b8) << 2);
  }
  if (local_d4._4_4_ == local_54._4_4_) {
    local_1b4 = CONCAT44(local_d4._4_4_,(int)local_1b4);
    iVar16 = FUN_14011efe0(&local_1c8,&local_68,&local_1c8);
    goto LAB_140124f59;
  }
  if (local_58 < local_1b8) {
LAB_140124f3e:
    pppuVar10 = &local_68;
    pppuVar11 = &local_1c8;
    iVar16 = local_d4._4_4_;
  }
  else {
    if (local_58 <= local_1b8) {
      puVar9 = local_1c0 + (local_1b8 + -1);
      if (0 < local_1b8) {
        lVar2 = (longlong)(local_1b8 + -1) * 4 - (longlong)puVar9;
        do {
          uVar13 = *(uint *)((longlong)local_60 + lVar2 + (longlong)puVar9);
          uVar15 = *puVar9;
          if (uVar15 >= uVar13 && uVar15 != uVar13) break;
          if (uVar15 < uVar13) goto LAB_140124f2c;
          uVar4 = uVar4 + 1;
          puVar9 = puVar9 + -1;
        } while ((int)uVar4 < local_1b8);
      }
      goto LAB_140124f3e;
    }
LAB_140124f2c:
    pppuVar10 = &local_1c8;
    pppuVar11 = &local_68;
    iVar16 = local_54._4_4_;
  }
  local_1b4 = CONCAT44(iVar16,(int)local_1b4);
  iVar16 = FUN_14011fa20(pppuVar11,pppuVar10,&local_1c8);
LAB_140124f59:
  if (iVar16 != 0) {
    local_128 = mp_int::vftable;
    if ((local_120 != (void *)0x0) && ((int)local_114 != 0)) {
      memset(local_120,0,(longlong)((int)local_114 << 2));
    }
    operator_delete(local_120);
    local_120 = (void *)0x0;
    local_114 = 0;
    local_118 = 0;
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011e420(&local_1c8,&local_1c8);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011fe40(&local_1c8,&local_128,&local_1c8);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14012b7a0(&local_1e8,&local_1c8,&local_168);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011e420(&local_1a8,&local_1e8);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011fe40(&local_1e8,&local_88,&local_1e8);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011e420(&local_1e8,&local_1e8);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011fe40(&local_1e8,&local_108,&local_1e8);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011e420(&local_128,&local_1c8);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011fe40(&local_1c8,&local_68,&local_1c8);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011e420(&local_1c8,&local_1c8);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011fe40(&local_1c8,&local_e8,&local_1c8);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14012b7a0(&local_1e8,&local_1c8,&local_148);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011fe40(&local_1a8,&local_88,&local_1e8);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011fe40(&local_1e8,&local_108,&local_1e8);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011fe40(&local_128,&local_68,&local_1c8);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011fe40(&local_1c8,&local_e8,&local_1c8);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14012b7a0(&local_1e8,&local_1c8,&local_188);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_140122ee0(&local_168,&local_c8,&local_168);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_140122ee0(&local_148,&local_a8,&local_148);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011db10(&local_168,&local_168);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011db10(&local_148,&local_148);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_140122ee0(&local_188,&local_a8,&local_188);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_140122ee0(&local_188,&local_c8,&local_188);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_140122ee0(&local_168,&local_188,&local_168);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_140122ee0(&local_148,&local_188,&local_148);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011e4d0(&local_a8,3,&local_1e8);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_140122ee0(&local_168,&local_1e8,&local_168);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011e4d0(&local_c8,3,&local_1e8);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_140122ee0(&local_148,&local_1e8,&local_148);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011e600(&local_188,3,&local_188);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_140122ee0(&local_188,&local_168,&local_188);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_140122ee0(&local_188,&local_148,&local_188);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_140122ee0(&local_168,&local_188,&local_168);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_140122ee0(&local_148,&local_188,&local_148);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011dbf0(&local_168,&local_168,0);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011dbf0(&local_148,&local_148,0);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar16 = FUN_14011e190(&local_168,iVar5);
  if (iVar16 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar16;
  }
  iVar3 = FUN_14011e190(&local_188,iVar3);
  if (iVar3 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar3;
  }
  iVar3 = FUN_14011e190(&local_148,iVar5 * 3);
  if (iVar3 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar3;
  }
  iVar5 = FUN_14011e190(&local_c8,iVar5 * 4);
  if (iVar5 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar5;
  }
  iVar5 = FUN_14011fe40(&local_a8,&local_168,param_3);
  if (iVar5 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar5;
  }
  iVar5 = FUN_14011fe40(&local_188,&local_148,&local_1e8);
  if (iVar5 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar5;
  }
  iVar5 = FUN_14011fe40(&local_c8,&local_1e8,&local_1e8);
  if (iVar5 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar5;
  }
  iVar5 = FUN_14011fe40(&local_1e8,param_3,param_3);
  if (iVar5 != 0) {
    FUN_14011d980(&local_128);
    FUN_14011d980(&local_68);
    FUN_14011d980(&local_e8);
    FUN_14011d980(&local_1a8);
    FUN_14011d980(&local_88);
    FUN_14011d980(&local_108);
    FUN_14011d980(&local_1c8);
    FUN_14011d980(&local_1e8);
    FUN_14011d980(&local_c8);
    FUN_14011d980(&local_148);
    FUN_14011d980(&local_188);
    FUN_14011d980(&local_168);
    FUN_14011d980(&local_a8);
    return iVar5;
  }
  FUN_14011d980(&local_128);
  FUN_14011d980(&local_68);
  FUN_14011d980(&local_e8);
  FUN_14011d980(&local_1a8);
  FUN_14011d980(&local_88);
  FUN_14011d980(&local_108);
  FUN_14011d980(&local_1c8);
  FUN_14011d980(&local_1e8);
  FUN_14011d980(&local_c8);
  FUN_14011d980(&local_148);
  FUN_14011d980(&local_188);
  FUN_14011d980(&local_168);
  FUN_14011d980(&local_a8);
  return 0;
}



int FUN_140126e70(undefined ***param_1,undefined8 param_2)

{
  uint uVar1;
  longlong lVar2;
  int iVar3;
  uint uVar4;
  int iVar5;
  undefined4 *puVar6;
  int iVar7;
  uint uVar8;
  uint *puVar9;
  undefined ***pppuVar10;
  undefined ***pppuVar11;
  undefined **ppuVar12;
  int iVar13;
  int iVar14;
  uint *puVar15;
  uint uVar16;
  undefined **local_158;
  uint *local_150;
  int local_148;
  undefined8 local_144;
  undefined **local_138;
  uint *local_130;
  int local_128;
  undefined8 local_124;
  undefined **local_118;
  void *local_110;
  int local_108;
  undefined8 local_104;
  undefined **local_f8;
  void *local_f0;
  int local_e8;
  undefined8 local_e4;
  undefined **local_d8;
  uint *local_d0;
  int local_c8;
  undefined8 local_c4;
  undefined **local_b8;
  void *local_b0;
  undefined4 local_a8;
  undefined8 local_a4;
  undefined **local_98;
  void *local_90;
  int local_88;
  undefined8 local_84;
  undefined **local_78;
  void *local_70;
  int local_68;
  undefined8 local_64;
  undefined **local_58;
  undefined4 *local_50;
  int local_48;
  undefined8 local_44;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  local_78 = mp_int::vftable;
  local_70 = operator_new(0x80);
  memset(local_70,0,0x80);
  local_68 = 0;
  local_64 = 0x20;
  local_118 = mp_int::vftable;
  local_110 = operator_new(0x80);
  memset(local_110,0,0x80);
  local_108 = 0;
  local_104 = 0x20;
  local_b8 = mp_int::vftable;
  local_b0 = operator_new(0x80);
  memset(local_b0,0,0x80);
  local_a8 = 0;
  local_a4 = 0x20;
  local_f8 = mp_int::vftable;
  local_f0 = operator_new(0x80);
  memset(local_f0,0,0x80);
  local_e8 = 0;
  local_e4 = 0x20;
  local_98 = mp_int::vftable;
  local_90 = operator_new(0x80);
  memset(local_90,0,0x80);
  local_88 = 0;
  local_84 = 0x20;
  local_158 = mp_int::vftable;
  local_150 = operator_new(0x80);
  memset(local_150,0,0x80);
  local_148 = 0;
  local_144 = 0x20;
  local_d8 = mp_int::vftable;
  local_d0 = operator_new(0x80);
  memset(local_d0,0,0x80);
  local_c8 = 0;
  local_c4 = 0x20;
  local_58 = mp_int::vftable;
  puVar6 = operator_new(0x80);
  local_50 = puVar6;
  memset(puVar6,0,0x80);
  local_48 = 0;
  local_44 = 0x20;
  local_138 = mp_int::vftable;
  local_130 = operator_new(0x80);
  memset(local_130,0,0x80);
  local_128 = 0;
  local_124 = 0x20;
  iVar5 = *(int *)(param_1 + 2) / 3;
  iVar3 = FUN_14011e220(param_1,iVar5 * 0x1c,&local_d8);
  if (iVar3 != 0) {
    local_138 = mp_int::vftable;
    if ((local_130 != (uint *)0x0) && ((int)local_124 != 0)) {
      memset(local_130,0,(longlong)((int)local_124 << 2));
    }
    operator_delete(local_130);
    local_130 = (uint *)0x0;
    local_124 = 0;
    local_128 = 0;
    if (puVar6 != (undefined4 *)0x0) {
      memset(puVar6,0,0x80);
    }
    operator_delete(puVar6);
    local_d8 = mp_int::vftable;
    if ((local_d0 != (uint *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (uint *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_158 = mp_int::vftable;
    if ((local_150 != (uint *)0x0) && ((int)local_144 != 0)) {
      memset(local_150,0,(longlong)((int)local_144 << 2));
    }
    operator_delete(local_150);
    local_150 = (uint *)0x0;
    local_144 = 0;
    local_148 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (void *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    local_90 = (void *)0x0;
    local_84 = 0;
    local_88 = 0;
    local_f8 = mp_int::vftable;
    if ((local_f0 != (void *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (void *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (void *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    goto LAB_14012723d;
  }
  if (param_1 != &local_58) {
    iVar3 = 0;
    if (0x20 < *(int *)(param_1 + 2)) {
      FUN_14011d8c0(&local_58);
      puVar6 = local_50;
      iVar3 = local_48;
    }
    ppuVar12 = param_1[1];
    iVar7 = 0;
    iVar13 = 0;
    if (0 < *(int *)(param_1 + 2)) {
      do {
        *puVar6 = *(undefined4 *)ppuVar12;
        puVar6 = puVar6 + 1;
        ppuVar12 = (undefined **)((longlong)ppuVar12 + 4);
        iVar7 = iVar13 + 1;
        iVar13 = iVar7;
      } while (iVar7 < *(int *)(param_1 + 2));
    }
    if (iVar7 < iVar3) {
      memset(puVar6,0,(ulonglong)(uint)(iVar3 - iVar7) << 2);
    }
    local_48 = *(int *)(param_1 + 2);
    local_44 = CONCAT44(*(undefined4 *)(param_1 + 3),(int)local_44);
  }
  uVar4 = 0;
  FUN_14011e810(&local_58,iVar5);
  FUN_14011e220(&local_58,iVar5 * 0x1c,&local_58);
  if (param_1 != &local_138) {
    if ((int)local_124 < *(int *)(param_1 + 2)) {
      FUN_14011d8c0(&local_138);
    }
    ppuVar12 = param_1[1];
    puVar9 = local_130;
    uVar8 = uVar4;
    if (0 < *(int *)(param_1 + 2)) {
      do {
        *puVar9 = *(uint *)ppuVar12;
        puVar9 = puVar9 + 1;
        ppuVar12 = (undefined **)((longlong)ppuVar12 + 4);
        uVar8 = uVar8 + 1;
      } while ((int)uVar8 < *(int *)(param_1 + 2));
    }
    for (; (int)uVar8 < local_128; uVar8 = uVar8 + 1) {
      *puVar9 = 0;
      puVar9 = puVar9 + 1;
    }
    local_128 = *(int *)(param_1 + 2);
    local_124 = CONCAT44(*(undefined4 *)(param_1 + 3),(int)local_124);
  }
  FUN_14011e810(&local_138,iVar5 * 2);
  iVar3 = FUN_14012bf90(&local_d8);
  if (iVar3 != 0) {
    local_138 = mp_int::vftable;
    if ((local_130 != (uint *)0x0) && ((int)local_124 != 0)) {
      memset(local_130,0,(longlong)((int)local_124 << 2));
    }
    operator_delete(local_130);
    puVar6 = local_50;
    local_130 = (uint *)0x0;
    local_124 = 0;
    local_128 = 0;
    if ((local_50 != (undefined4 *)0x0) && ((int)local_44 != 0)) {
      memset(local_50,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(puVar6);
    local_d8 = mp_int::vftable;
    if ((local_d0 != (uint *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (uint *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_158 = mp_int::vftable;
    if ((local_150 != (uint *)0x0) && ((int)local_144 != 0)) {
      memset(local_150,0,(longlong)((int)local_144 << 2));
    }
    operator_delete(local_150);
    local_150 = (uint *)0x0;
    local_144 = 0;
    local_148 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (void *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    local_90 = (void *)0x0;
    local_84 = 0;
    local_88 = 0;
    local_f8 = mp_int::vftable;
    if ((local_f0 != (void *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (void *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (void *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    goto LAB_140127570;
  }
  iVar3 = FUN_14012bf90(&local_138);
  if (iVar3 != 0) {
    local_138 = mp_int::vftable;
    if ((local_130 != (uint *)0x0) && ((int)local_124 != 0)) {
      memset(local_130,0,(longlong)((int)local_124 << 2));
    }
    operator_delete(local_130);
    puVar6 = local_50;
    local_130 = (uint *)0x0;
    local_124 = 0;
    local_128 = 0;
    if ((local_50 != (undefined4 *)0x0) && ((int)local_44 != 0)) {
      memset(local_50,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(puVar6);
    local_d8 = mp_int::vftable;
    if ((local_d0 != (uint *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (uint *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_158 = mp_int::vftable;
    if ((local_150 != (uint *)0x0) && ((int)local_144 != 0)) {
      memset(local_150,0,(longlong)((int)local_144 << 2));
    }
    operator_delete(local_150);
    local_150 = (uint *)0x0;
    local_144 = 0;
    local_148 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (void *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    local_90 = (void *)0x0;
    local_84 = 0;
    local_88 = 0;
    local_f8 = mp_int::vftable;
    if ((local_f0 != (void *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (void *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (void *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    goto LAB_140127570;
  }
  if ((int)local_144 < local_c8 + 1) {
    FUN_14011d8c0(&local_158);
  }
  iVar3 = local_148;
  local_148 = local_c8;
  puVar9 = local_150;
  puVar15 = local_d0;
  uVar8 = uVar4;
  uVar16 = uVar4;
  if (0 < local_c8) {
    do {
      uVar1 = *puVar15;
      *puVar9 = uVar1 * 2 & 0xfffffff | uVar16;
      puVar9 = puVar9 + 1;
      puVar15 = puVar15 + 1;
      uVar8 = uVar8 + 1;
      uVar16 = uVar1 >> 0x1b;
    } while ((int)uVar8 < local_c8);
    if (uVar1 >> 0x1b != 0) {
      *puVar9 = 1;
      local_148 = local_c8 + 1;
    }
  }
  if (local_148 < iVar3) {
    memset(local_150 + local_148,0,(ulonglong)(uint)(iVar3 - local_148) << 2);
  }
  iVar7 = local_48;
  puVar6 = local_50;
  iVar13 = local_44._4_4_;
  if (local_c4._4_4_ == local_44._4_4_) {
    local_144 = CONCAT44(local_c4._4_4_,(int)local_144);
    iVar3 = FUN_14011efe0(&local_158,&local_58,&local_158);
    puVar6 = local_50;
    iVar13 = local_44._4_4_;
    iVar7 = local_48;
  }
  else {
    if (local_48 < local_148) {
LAB_1401278cb:
      pppuVar11 = &local_58;
      pppuVar10 = &local_158;
      iVar3 = local_c4._4_4_;
    }
    else {
      if (local_48 <= local_148) {
        puVar9 = local_150 + (local_148 + -1);
        if (0 < local_148) {
          lVar2 = (longlong)(local_148 + -1) * 4 - (longlong)puVar9;
          do {
            uVar8 = *(uint *)((longlong)puVar9 + (longlong)local_50 + lVar2);
            if (uVar8 < *puVar9) break;
            if (*puVar9 < uVar8) goto LAB_1401278bc;
            uVar4 = uVar4 + 1;
            puVar9 = puVar9 + -1;
          } while ((int)uVar4 < local_148);
        }
        goto LAB_1401278cb;
      }
LAB_1401278bc:
      pppuVar11 = &local_158;
      pppuVar10 = &local_58;
      iVar3 = local_44._4_4_;
    }
    local_144 = CONCAT44(iVar3,(int)local_144);
    iVar3 = FUN_14011fa20(pppuVar10,pppuVar11,&local_158);
  }
  if (iVar3 != 0) {
    local_138 = mp_int::vftable;
    if ((local_130 != (uint *)0x0) && ((int)local_124 != 0)) {
      memset(local_130,0,(longlong)((int)local_124 << 2));
    }
    operator_delete(local_130);
    local_130 = (uint *)0x0;
    local_124 = 0;
    local_128 = 0;
    if ((puVar6 != (undefined4 *)0x0) && ((int)local_44 != 0)) {
      memset(puVar6,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(puVar6);
    local_d8 = mp_int::vftable;
    if ((local_d0 != (uint *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (uint *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_158 = mp_int::vftable;
    if ((local_150 != (uint *)0x0) && ((int)local_144 != 0)) {
      memset(local_150,0,(longlong)((int)local_144 << 2));
    }
    operator_delete(local_150);
    local_150 = (uint *)0x0;
    local_144 = 0;
    local_148 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (void *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    local_90 = (void *)0x0;
    local_84 = 0;
    local_88 = 0;
    local_f8 = mp_int::vftable;
    if ((local_f0 != (void *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (void *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (void *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    goto LAB_14012723d;
  }
  if ((int)local_144 < local_148 + 1) {
    FUN_14011d8c0(&local_158);
  }
  iVar3 = local_148;
  uVar4 = 0;
  iVar14 = 0;
  puVar9 = local_150;
  if (0 < local_148) {
    do {
      uVar8 = *puVar9;
      *puVar9 = uVar8 * 2 & 0xfffffff | uVar4;
      puVar9 = puVar9 + 1;
      iVar14 = iVar14 + 1;
      uVar4 = uVar8 >> 0x1b;
    } while (iVar14 < local_148);
    if (uVar8 >> 0x1b != 0) {
      *puVar9 = 1;
      local_148 = local_148 + 1;
    }
  }
  if (local_148 < iVar3) {
    memset(local_150 + local_148,0,(ulonglong)(uint)(iVar3 - local_148) << 2);
  }
  if (local_144._4_4_ == local_124._4_4_) {
    iVar3 = FUN_14011efe0(&local_158,&local_138,&local_158);
  }
  else {
    if (local_128 < local_148) {
LAB_140127bcc:
      pppuVar10 = &local_138;
      pppuVar11 = &local_158;
    }
    else {
      if (local_128 <= local_148) {
        puVar9 = local_150 + (local_148 + -1);
        iVar3 = 0;
        if (0 < local_148) {
          lVar2 = (longlong)(local_148 + -1) * 4 - (longlong)puVar9;
          do {
            uVar4 = *(uint *)((longlong)local_130 + lVar2 + (longlong)puVar9);
            uVar8 = *puVar9;
            if (uVar8 >= uVar4 && uVar8 != uVar4) break;
            if (uVar8 < uVar4) goto LAB_140127bbb;
            iVar3 = iVar3 + 1;
            puVar9 = puVar9 + -1;
          } while (iVar3 < local_148);
        }
        goto LAB_140127bcc;
      }
LAB_140127bbb:
      local_144 = CONCAT44(local_124._4_4_,(int)local_144);
      pppuVar10 = &local_158;
      pppuVar11 = &local_138;
    }
    iVar3 = FUN_14011fa20(pppuVar11,pppuVar10,&local_158);
  }
  if (iVar3 != 0) {
    local_138 = mp_int::vftable;
    if ((local_130 != (uint *)0x0) && ((int)local_124 != 0)) {
      memset(local_130,0,(longlong)((int)local_124 << 2));
    }
    operator_delete(local_130);
    local_130 = (uint *)0x0;
    local_124 = 0;
    local_128 = 0;
    if ((puVar6 != (undefined4 *)0x0) && ((int)local_44 != 0)) {
      memset(puVar6,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(puVar6);
    local_d8 = mp_int::vftable;
    if ((local_d0 != (uint *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (uint *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_158 = mp_int::vftable;
    if ((local_150 != (uint *)0x0) && ((int)local_144 != 0)) {
      memset(local_150,0,(longlong)((int)local_144 << 2));
    }
    operator_delete(local_150);
    local_150 = (uint *)0x0;
    local_144 = 0;
    local_148 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (void *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    local_90 = (void *)0x0;
    local_84 = 0;
    local_88 = 0;
    local_f8 = mp_int::vftable;
    if ((local_f0 != (void *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (void *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (void *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    goto LAB_14012723d;
  }
  iVar3 = FUN_14012bf90(&local_158);
  if (iVar3 != 0) {
    local_138 = mp_int::vftable;
    if ((local_130 != (uint *)0x0) && ((int)local_124 != 0)) {
      memset(local_130,0,(longlong)((int)local_124 << 2));
    }
    operator_delete(local_130);
    local_130 = (uint *)0x0;
    local_124 = 0;
    local_128 = 0;
    if ((puVar6 != (undefined4 *)0x0) && ((int)local_44 != 0)) {
      memset(puVar6,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(puVar6);
    local_d8 = mp_int::vftable;
    if ((local_d0 != (uint *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (uint *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_158 = mp_int::vftable;
    if ((local_150 != (uint *)0x0) && ((int)local_144 != 0)) {
      memset(local_150,0,(longlong)((int)local_144 << 2));
    }
    operator_delete(local_150);
    local_150 = (uint *)0x0;
    local_144 = 0;
    local_148 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (void *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    local_90 = (void *)0x0;
    local_84 = 0;
    local_88 = 0;
    local_f8 = mp_int::vftable;
    if ((local_f0 != (void *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (void *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (void *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    goto LAB_14012723d;
  }
  if ((int)local_144 < local_128 + 1) {
    FUN_14011d8c0(&local_158);
  }
  iVar3 = local_148;
  local_148 = local_128;
  uVar4 = 0;
  iVar14 = 0;
  puVar9 = local_150;
  puVar15 = local_130;
  if (0 < local_128) {
    do {
      uVar8 = *puVar15;
      *puVar9 = uVar8 * 2 & 0xfffffff | uVar4;
      puVar9 = puVar9 + 1;
      iVar14 = iVar14 + 1;
      puVar15 = puVar15 + 1;
      uVar4 = uVar8 >> 0x1b;
    } while (iVar14 < local_128);
    if (uVar8 >> 0x1b != 0) {
      *puVar9 = 1;
      local_148 = local_128 + 1;
    }
  }
  if (local_148 < iVar3) {
    memset(local_150 + local_148,0,(ulonglong)(uint)(iVar3 - local_148) << 2);
  }
  if (local_124._4_4_ == iVar13) {
    local_144 = CONCAT44(local_124._4_4_,(int)local_144);
    iVar3 = FUN_14011efe0(&local_158,&local_58,&local_158);
    puVar6 = local_50;
    iVar13 = local_44._4_4_;
    iVar7 = local_48;
  }
  else {
    if (iVar7 < local_148) {
LAB_1401280ba:
      pppuVar11 = &local_58;
      pppuVar10 = &local_158;
      iVar3 = local_124._4_4_;
    }
    else {
      if (iVar7 <= local_148) {
        puVar9 = local_150 + (local_148 + -1);
        iVar3 = 0;
        if (0 < local_148) {
          lVar2 = (longlong)(local_148 + -1) * 4 - (longlong)puVar9;
          do {
            uVar4 = *(uint *)((longlong)puVar9 + (longlong)puVar6 + lVar2);
            if (uVar4 < *puVar9) break;
            if (*puVar9 < uVar4) goto LAB_1401280ab;
            iVar3 = iVar3 + 1;
            puVar9 = puVar9 + -1;
          } while (iVar3 < local_148);
        }
        goto LAB_1401280ba;
      }
LAB_1401280ab:
      pppuVar11 = &local_158;
      pppuVar10 = &local_58;
      iVar3 = iVar13;
    }
    local_144 = CONCAT44(iVar3,(int)local_144);
    iVar3 = FUN_14011fa20(pppuVar10,pppuVar11,&local_158);
  }
  if (iVar3 != 0) {
    local_138 = mp_int::vftable;
    if ((local_130 != (uint *)0x0) && ((int)local_124 != 0)) {
      memset(local_130,0,(longlong)((int)local_124 << 2));
    }
    operator_delete(local_130);
    local_130 = (uint *)0x0;
    local_124 = 0;
    local_128 = 0;
    if ((puVar6 != (undefined4 *)0x0) && ((int)local_44 != 0)) {
      memset(puVar6,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(puVar6);
    local_d8 = mp_int::vftable;
    if ((local_d0 != (uint *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (uint *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_158 = mp_int::vftable;
    if ((local_150 != (uint *)0x0) && ((int)local_144 != 0)) {
      memset(local_150,0,(longlong)((int)local_144 << 2));
    }
    operator_delete(local_150);
    local_150 = (uint *)0x0;
    local_144 = 0;
    local_148 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (void *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    local_90 = (void *)0x0;
    local_84 = 0;
    local_88 = 0;
    local_f8 = mp_int::vftable;
    if ((local_f0 != (void *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (void *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (void *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    goto LAB_14012723d;
  }
  if ((int)local_144 < local_148 + 1) {
    FUN_14011d8c0(&local_158);
  }
  iVar3 = local_148;
  iVar14 = 0;
  puVar9 = local_150;
  uVar4 = 0;
  if (0 < local_148) {
    do {
      uVar8 = *puVar9;
      *puVar9 = uVar8 * 2 & 0xfffffff | uVar4;
      puVar9 = puVar9 + 1;
      iVar14 = iVar14 + 1;
      uVar4 = uVar8 >> 0x1b;
    } while (iVar14 < local_148);
    if (uVar8 >> 0x1b != 0) {
      *puVar9 = 1;
      local_148 = local_148 + 1;
    }
  }
  if (local_148 < iVar3) {
    memset(local_150 + local_148,0,(ulonglong)(uint)(iVar3 - local_148) << 2);
  }
  if (local_144._4_4_ == local_c4._4_4_) {
    iVar3 = FUN_14011efe0(&local_158,&local_d8,&local_158);
  }
  else {
    if (local_c8 < local_148) {
LAB_1401283ac:
      pppuVar11 = &local_d8;
      pppuVar10 = &local_158;
    }
    else {
      if (local_c8 <= local_148) {
        puVar9 = local_150 + (local_148 + -1);
        iVar3 = 0;
        if (0 < local_148) {
          lVar2 = (longlong)(local_148 + -1) * 4 - (longlong)puVar9;
          do {
            uVar4 = *(uint *)((longlong)puVar9 + (longlong)local_d0 + lVar2);
            uVar8 = *puVar9;
            if (uVar8 >= uVar4 && uVar8 != uVar4) break;
            if (uVar8 < uVar4) goto LAB_14012839c;
            iVar3 = iVar3 + 1;
            puVar9 = puVar9 + -1;
          } while (iVar3 < local_148);
        }
        goto LAB_1401283ac;
      }
LAB_14012839c:
      local_144 = CONCAT44(local_c4._4_4_,(int)local_144);
      pppuVar11 = &local_158;
      pppuVar10 = &local_d8;
    }
    iVar3 = FUN_14011fa20(pppuVar10,pppuVar11,&local_158);
  }
  if (iVar3 != 0) {
    local_138 = mp_int::vftable;
    if ((local_130 != (uint *)0x0) && ((int)local_124 != 0)) {
      memset(local_130,0,(longlong)((int)local_124 << 2));
    }
    operator_delete(local_130);
    local_130 = (uint *)0x0;
    local_124 = 0;
    local_128 = 0;
    if ((puVar6 != (undefined4 *)0x0) && ((int)local_44 != 0)) {
      memset(puVar6,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(puVar6);
    local_d8 = mp_int::vftable;
    if ((local_d0 != (uint *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (uint *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_158 = mp_int::vftable;
    if ((local_150 != (uint *)0x0) && ((int)local_144 != 0)) {
      memset(local_150,0,(longlong)((int)local_144 << 2));
    }
    operator_delete(local_150);
    local_150 = (uint *)0x0;
    local_144 = 0;
    local_148 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (void *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    local_90 = (void *)0x0;
    local_84 = 0;
    local_88 = 0;
    local_f8 = mp_int::vftable;
    if ((local_f0 != (void *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (void *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (void *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
LAB_14012723d:
    local_104 = 0;
    local_108 = 0;
    local_110 = (void *)0x0;
    local_78 = mp_int::vftable;
    if ((local_70 != (void *)0x0) && ((int)local_64 != 0)) {
      memset(local_70,0,(longlong)((int)local_64 << 2));
    }
    operator_delete(local_70);
    return iVar3;
  }
  iVar3 = FUN_14012bf90(&local_158);
  if (iVar3 != 0) {
    local_138 = mp_int::vftable;
    if ((local_130 != (uint *)0x0) && ((int)local_124 != 0)) {
      memset(local_130,0,(longlong)((int)local_124 << 2));
    }
    operator_delete(local_130);
    local_130 = (uint *)0x0;
    local_124 = 0;
    local_128 = 0;
    if ((puVar6 != (undefined4 *)0x0) && ((int)local_44 != 0)) {
      memset(puVar6,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(puVar6);
    local_d8 = mp_int::vftable;
    if ((local_d0 != (uint *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (uint *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_158 = mp_int::vftable;
    if ((local_150 != (uint *)0x0) && ((int)local_144 != 0)) {
      memset(local_150,0,(longlong)((int)local_144 << 2));
    }
    operator_delete(local_150);
    local_150 = (uint *)0x0;
    local_144 = 0;
    local_148 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (void *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    local_90 = (void *)0x0;
    local_84 = 0;
    local_88 = 0;
    local_f8 = mp_int::vftable;
    if ((local_f0 != (void *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (void *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (void *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    goto LAB_14012723d;
  }
  if (local_124._4_4_ == iVar13) {
    local_144 = CONCAT44(local_124._4_4_,(int)local_144);
    iVar3 = FUN_14011efe0(&local_138,&local_58,&local_158);
    puVar6 = local_50;
  }
  else {
    if (iVar7 < local_128) {
LAB_1401287da:
      pppuVar11 = &local_58;
      pppuVar10 = &local_138;
      iVar13 = local_124._4_4_;
    }
    else {
      if (iVar7 <= local_128) {
        puVar9 = local_130 + (local_128 + -1);
        iVar3 = 0;
        if (0 < local_128) {
          lVar2 = (longlong)(local_128 + -1) * 4 - (longlong)puVar9;
          do {
            uVar4 = *(uint *)((longlong)puVar9 + (longlong)puVar6 + lVar2);
            uVar8 = *puVar9;
            if (uVar8 >= uVar4 && uVar8 != uVar4) break;
            if (uVar8 < uVar4) goto LAB_1401287cb;
            iVar3 = iVar3 + 1;
            puVar9 = puVar9 + -1;
          } while (iVar3 < local_128);
        }
        goto LAB_1401287da;
      }
LAB_1401287cb:
      pppuVar11 = &local_138;
      pppuVar10 = &local_58;
    }
    local_144 = CONCAT44(iVar13,(int)local_144);
    iVar3 = FUN_14011fa20(pppuVar10,pppuVar11,&local_158);
  }
  if (iVar3 != 0) {
    local_138 = mp_int::vftable;
    if ((local_130 != (uint *)0x0) && ((int)local_124 != 0)) {
      memset(local_130,0,(longlong)((int)local_124 << 2));
    }
    operator_delete(local_130);
    local_130 = (uint *)0x0;
    local_124 = 0;
    local_128 = 0;
    if ((puVar6 != (undefined4 *)0x0) && ((int)local_44 != 0)) {
      memset(puVar6,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(puVar6);
    local_d8 = mp_int::vftable;
    if ((local_d0 != (uint *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (uint *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_158 = mp_int::vftable;
    if ((local_150 != (uint *)0x0) && ((int)local_144 != 0)) {
      memset(local_150,0,(longlong)((int)local_144 << 2));
    }
    operator_delete(local_150);
    local_150 = (uint *)0x0;
    local_144 = 0;
    local_148 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (void *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    local_90 = (void *)0x0;
    local_84 = 0;
    local_88 = 0;
    local_f8 = mp_int::vftable;
    if ((local_f0 != (void *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (void *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (void *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    goto LAB_140127570;
  }
  if (local_144._4_4_ == local_c4._4_4_) {
    iVar3 = FUN_14011efe0(&local_158,&local_d8,&local_158);
  }
  else {
    if (local_c8 < local_148) {
LAB_140128a3b:
      pppuVar11 = &local_d8;
      pppuVar10 = &local_158;
    }
    else {
      if (local_c8 <= local_148) {
        puVar9 = local_150 + (local_148 + -1);
        iVar3 = 0;
        if (0 < local_148) {
          lVar2 = (longlong)(local_148 + -1) * 4 - (longlong)puVar9;
          do {
            uVar4 = *(uint *)((longlong)puVar9 + (longlong)local_d0 + lVar2);
            uVar8 = *puVar9;
            if (uVar8 >= uVar4 && uVar8 != uVar4) break;
            if (uVar8 < uVar4) goto LAB_140128a2b;
            iVar3 = iVar3 + 1;
            puVar9 = puVar9 + -1;
          } while (iVar3 < local_148);
        }
        goto LAB_140128a3b;
      }
LAB_140128a2b:
      local_144 = CONCAT44(local_c4._4_4_,(int)local_144);
      pppuVar11 = &local_158;
      pppuVar10 = &local_d8;
    }
    iVar3 = FUN_14011fa20(pppuVar10,pppuVar11,&local_158);
  }
  if (iVar3 != 0) {
    local_138 = mp_int::vftable;
    if ((local_130 != (uint *)0x0) && ((int)local_124 != 0)) {
      memset(local_130,0,(longlong)((int)local_124 << 2));
    }
    operator_delete(local_130);
    local_130 = (uint *)0x0;
    local_124 = 0;
    local_128 = 0;
    if ((puVar6 != (undefined4 *)0x0) && ((int)local_44 != 0)) {
      memset(puVar6,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(puVar6);
    local_d8 = mp_int::vftable;
    if ((local_d0 != (uint *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (uint *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_158 = mp_int::vftable;
    if ((local_150 != (uint *)0x0) && ((int)local_144 != 0)) {
      memset(local_150,0,(longlong)((int)local_144 << 2));
    }
    operator_delete(local_150);
    local_150 = (uint *)0x0;
    local_144 = 0;
    local_148 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (void *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    local_90 = (void *)0x0;
    local_84 = 0;
    local_88 = 0;
    local_f8 = mp_int::vftable;
    if ((local_f0 != (void *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (void *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (void *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    goto LAB_140127570;
  }
  iVar3 = FUN_14012bf90(&local_158);
  if (iVar3 != 0) {
    local_138 = mp_int::vftable;
    if ((local_130 != (uint *)0x0) && ((int)local_124 != 0)) {
      memset(local_130,0,(longlong)((int)local_124 << 2));
    }
    operator_delete(local_130);
    local_130 = (uint *)0x0;
    local_124 = 0;
    local_128 = 0;
    if ((puVar6 != (undefined4 *)0x0) && ((int)local_44 != 0)) {
      memset(puVar6,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(puVar6);
    local_d8 = mp_int::vftable;
    if ((local_d0 != (uint *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (uint *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_158 = mp_int::vftable;
    if ((local_150 != (uint *)0x0) && ((int)local_144 != 0)) {
      memset(local_150,0,(longlong)((int)local_144 << 2));
    }
    operator_delete(local_150);
    local_150 = (uint *)0x0;
    local_144 = 0;
    local_148 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (void *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    local_90 = (void *)0x0;
    local_84 = 0;
    local_88 = 0;
    local_f8 = mp_int::vftable;
    if ((local_f0 != (void *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (void *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (void *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    goto LAB_140127570;
  }
  if (local_104._4_4_ == local_84._4_4_) {
    if (local_88 < local_108) {
LAB_140128e72:
      pppuVar11 = &local_98;
      pppuVar10 = &local_118;
    }
    else {
      if (local_88 <= local_108) {
        puVar9 = (uint *)((longlong)local_110 + (longlong)(local_108 + -1) * 4);
        iVar3 = 0;
        if (0 < local_108) {
          lVar2 = (longlong)(local_108 + -1) * 4 - (longlong)puVar9;
          do {
            uVar4 = *(uint *)((longlong)local_90 + lVar2 + (longlong)puVar9);
            uVar8 = *puVar9;
            if (uVar8 >= uVar4 && uVar8 != uVar4) break;
            if (uVar8 < uVar4) goto LAB_140128e5b;
            iVar3 = iVar3 + 1;
            puVar9 = puVar9 + -1;
          } while (iVar3 < local_108);
        }
        goto LAB_140128e72;
      }
LAB_140128e5b:
      local_104 = (ulonglong)CONCAT14(local_104._4_4_ == 0,(int)local_104);
      pppuVar11 = &local_118;
      pppuVar10 = &local_98;
    }
    iVar3 = FUN_14011fa20(pppuVar10,pppuVar11,&local_118);
  }
  else {
    iVar3 = FUN_14011efe0(&local_118,&local_98,&local_118);
  }
  if (iVar3 != 0) {
    local_138 = mp_int::vftable;
    if ((local_130 != (uint *)0x0) && ((int)local_124 != 0)) {
      memset(local_130,0,(longlong)((int)local_124 << 2));
    }
    operator_delete(local_130);
    local_130 = (uint *)0x0;
    local_124 = 0;
    local_128 = 0;
    if ((puVar6 != (undefined4 *)0x0) && ((int)local_44 != 0)) {
      memset(puVar6,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(puVar6);
    local_d8 = mp_int::vftable;
    if ((local_d0 != (uint *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (uint *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_158 = mp_int::vftable;
    if ((local_150 != (uint *)0x0) && ((int)local_144 != 0)) {
      memset(local_150,0,(longlong)((int)local_144 << 2));
    }
    operator_delete(local_150);
    local_150 = (uint *)0x0;
    local_144 = 0;
    local_148 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (void *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    local_90 = (void *)0x0;
    local_84 = 0;
    local_88 = 0;
    local_f8 = mp_int::vftable;
    if ((local_f0 != (void *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (void *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (void *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
    goto LAB_140127570;
  }
  if (local_e4._4_4_ == local_64._4_4_) {
    if (local_68 < local_e8) {
LAB_1401290d0:
      pppuVar11 = &local_f8;
      pppuVar10 = &local_78;
    }
    else {
      if (local_68 <= local_e8) {
        puVar9 = (uint *)((longlong)local_f0 + (longlong)(local_e8 + -1) * 4);
        iVar3 = 0;
        if (0 < local_e8) {
          lVar2 = (longlong)(local_e8 + -1) * 4 - (longlong)puVar9;
          do {
            uVar4 = *(uint *)((longlong)local_70 + lVar2 + (longlong)puVar9);
            uVar8 = *puVar9;
            if (uVar8 >= uVar4 && uVar8 != uVar4) break;
            if (uVar8 < uVar4) goto LAB_1401290bb;
            iVar3 = iVar3 + 1;
            puVar9 = puVar9 + -1;
          } while (iVar3 < local_e8);
        }
        goto LAB_1401290d0;
      }
LAB_1401290bb:
      local_e4 = (ulonglong)CONCAT14(local_e4._4_4_ == 0,(int)local_e4);
      pppuVar10 = &local_f8;
      pppuVar11 = &local_78;
    }
    iVar3 = FUN_14011fa20(pppuVar11,pppuVar10,&local_f8);
  }
  else {
    iVar3 = FUN_14011efe0(&local_f8,&local_78,&local_f8);
  }
  if (iVar3 == 0) {
    iVar3 = FUN_14011db10(&local_118);
    if (iVar3 == 0) {
      iVar3 = FUN_14011db10(&local_f8);
      if (iVar3 != 0) {
        local_138 = mp_int::vftable;
        if ((local_130 != (uint *)0x0) && ((int)local_124 != 0)) {
          memset(local_130,0,(longlong)((int)local_124 << 2));
        }
        operator_delete(local_130);
        local_130 = (uint *)0x0;
        local_124 = 0;
        local_128 = 0;
        if ((puVar6 != (undefined4 *)0x0) && ((int)local_44 != 0)) {
          memset(puVar6,0,(longlong)((int)local_44 << 2));
        }
        operator_delete(puVar6);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_140122ee0(&local_b8,&local_78,&local_b8);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_140122ee0(&local_b8,&local_98,&local_b8);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_140122ee0(&local_118,&local_b8,&local_118);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_140122ee0(&local_f8,&local_b8,&local_f8);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_14011e4d0(&local_78,3,&local_158);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_140122ee0(&local_118,&local_158,&local_118);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_14011e4d0(&local_98,3,&local_158);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_140122ee0(&local_f8,&local_158,&local_f8);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_14011e600(&local_b8,3,&local_b8);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_140122ee0(&local_b8,&local_118,&local_b8);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_140122ee0(&local_b8,&local_f8,&local_b8);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_140122ee0(&local_118,&local_b8,&local_118);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_140122ee0(&local_f8,&local_b8,&local_f8);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_14011dbf0(&local_118,&local_118,0);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_14011dbf0(&local_f8,&local_f8,0);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_14011e190(&local_118,iVar5);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_14011e190(&local_b8,iVar5 * 2);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar3 = FUN_14011e190(&local_f8,iVar5 * 3);
      if (iVar3 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar3;
      }
      iVar5 = FUN_14011e190(&local_98,iVar5 * 4);
      if (iVar5 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar5;
      }
      iVar5 = FUN_14011fe40(&local_78,&local_118,param_2);
      if (iVar5 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar5;
      }
      iVar5 = FUN_14011fe40(&local_b8,&local_f8,&local_158);
      if (iVar5 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar5;
      }
      iVar5 = FUN_14011fe40(&local_98,&local_158,&local_158);
      if (iVar5 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar5;
      }
      iVar5 = FUN_14011fe40(&local_158,param_2,param_2);
      if (iVar5 != 0) {
        FUN_14011d980(&local_138);
        FUN_14011d980(&local_58);
        FUN_14011d980(&local_d8);
        FUN_14011d980(&local_158);
        FUN_14011d980(&local_98);
        FUN_14011d980(&local_f8);
        FUN_14011d980(&local_b8);
        FUN_14011d980(&local_118);
        FUN_14011d980(&local_78);
        return iVar5;
      }
      FUN_14011d980(&local_138);
      FUN_14011d980(&local_58);
      FUN_14011d980(&local_d8);
      FUN_14011d980(&local_158);
      FUN_14011d980(&local_98);
      FUN_14011d980(&local_f8);
      FUN_14011d980(&local_b8);
      FUN_14011d980(&local_118);
      FUN_14011d980(&local_78);
      return 0;
    }
    local_138 = mp_int::vftable;
    if ((local_130 != (uint *)0x0) && ((int)local_124 != 0)) {
      memset(local_130,0,(longlong)((int)local_124 << 2));
    }
    operator_delete(local_130);
    local_130 = (uint *)0x0;
    local_124 = 0;
    local_128 = 0;
    if ((puVar6 != (undefined4 *)0x0) && ((int)local_44 != 0)) {
      memset(puVar6,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(puVar6);
    local_d8 = mp_int::vftable;
    if ((local_d0 != (uint *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (uint *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_158 = mp_int::vftable;
    if ((local_150 != (uint *)0x0) && ((int)local_144 != 0)) {
      memset(local_150,0,(longlong)((int)local_144 << 2));
    }
    operator_delete(local_150);
    local_150 = (uint *)0x0;
    local_144 = 0;
    local_148 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (void *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    local_90 = (void *)0x0;
    local_84 = 0;
    local_88 = 0;
    local_f8 = mp_int::vftable;
    if ((local_f0 != (void *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (void *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (void *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
  }
  else {
    local_138 = mp_int::vftable;
    if ((local_130 != (uint *)0x0) && ((int)local_124 != 0)) {
      memset(local_130,0,(longlong)((int)local_124 << 2));
    }
    operator_delete(local_130);
    local_130 = (uint *)0x0;
    local_124 = 0;
    local_128 = 0;
    if ((puVar6 != (undefined4 *)0x0) && ((int)local_44 != 0)) {
      memset(puVar6,0,(longlong)((int)local_44 << 2));
    }
    operator_delete(puVar6);
    local_d8 = mp_int::vftable;
    if ((local_d0 != (uint *)0x0) && ((int)local_c4 != 0)) {
      memset(local_d0,0,(longlong)((int)local_c4 << 2));
    }
    operator_delete(local_d0);
    local_d0 = (uint *)0x0;
    local_c4 = 0;
    local_c8 = 0;
    local_158 = mp_int::vftable;
    if ((local_150 != (uint *)0x0) && ((int)local_144 != 0)) {
      memset(local_150,0,(longlong)((int)local_144 << 2));
    }
    operator_delete(local_150);
    local_150 = (uint *)0x0;
    local_144 = 0;
    local_148 = 0;
    local_98 = mp_int::vftable;
    if ((local_90 != (void *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(local_90);
    local_90 = (void *)0x0;
    local_84 = 0;
    local_88 = 0;
    local_f8 = mp_int::vftable;
    if ((local_f0 != (void *)0x0) && ((int)local_e4 != 0)) {
      memset(local_f0,0,(longlong)((int)local_e4 << 2));
    }
    operator_delete(local_f0);
    local_f0 = (void *)0x0;
    local_e4 = 0;
    local_e8 = 0;
    local_b8 = mp_int::vftable;
    if ((local_b0 != (void *)0x0) && ((int)local_a4 != 0)) {
      memset(local_b0,0,(longlong)((int)local_a4 << 2));
    }
    operator_delete(local_b0);
    local_b0 = (void *)0x0;
    local_a4 = 0;
    local_a8 = 0;
    local_118 = mp_int::vftable;
    if ((local_110 != (void *)0x0) && ((int)local_104 != 0)) {
      memset(local_110,0,(longlong)((int)local_104 << 2));
    }
    operator_delete(local_110);
  }
LAB_140127570:
  local_104 = 0;
  local_108 = 0;
  local_110 = (void *)0x0;
  local_78 = mp_int::vftable;
  if ((local_70 != (void *)0x0) && ((int)local_64 != 0)) {
    memset(local_70,0,(longlong)((int)local_64 << 2));
  }
  operator_delete(local_70);
  return iVar3;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

undefined8 FUN_14012a0c0(longlong param_1,longlong param_2,int param_3)

{
  uint uVar1;
  ulonglong uVar2;
  int iVar3;
  undefined8 uVar4;
  int iVar5;
  ulonglong *puVar6;
  ulonglong *puVar7;
  ulonglong *puVar8;
  uint *puVar9;
  uint *puVar10;
  int iVar11;
  ulonglong uVar12;
  longlong lVar13;
  uint uVar14;
  ulonglong uVar15;
  int iVar16;
  undefined1 auStack_1078 [32];
  int local_1058;
  int local_1054;
  longlong local_1050;
  ulonglong local_1048 [512];
  ulonglong local_48;
  undefined8 uStack_40;
  
  uStack_40 = 0x14012a0da;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_1078;
  iVar3 = *(int *)(param_1 + 0x10);
  local_1058 = iVar3;
  local_1054 = param_3;
  local_1050 = param_1;
  if (*(int *)(param_1 + 0x14) < *(int *)(param_2 + 0x10) + 1) {
    FUN_14011d8c0();
  }
  puVar10 = *(uint **)(param_1 + 8);
  iVar11 = 0;
  puVar6 = local_1048;
  uVar14 = 0;
  if (0 < *(int *)(param_1 + 0x10)) {
    uVar14 = *(uint *)(param_1 + 0x10);
    uVar12 = (ulonglong)uVar14;
    puVar8 = puVar6;
    puVar9 = puVar10;
    do {
      uVar1 = *puVar9;
      puVar6 = puVar8 + 1;
      puVar9 = puVar9 + 1;
      uVar12 = uVar12 - 1;
      *puVar8 = (ulonglong)uVar1;
      puVar8 = puVar6;
    } while (uVar12 != 0);
  }
  uVar1 = *(uint *)(param_2 + 0x10);
  iVar5 = uVar1 * 2 + 1;
  if ((int)uVar14 < iVar5) {
    memset(puVar6,0,(ulonglong)(iVar5 - uVar14) << 3);
  }
  uVar14 = 0;
  if (0 < (int)uVar1) {
    puVar8 = local_1048;
    puVar6 = local_1048;
    uVar12 = (ulonglong)uVar1;
    do {
      puVar8 = puVar8 + 1;
      uVar2 = puVar8[-1];
      puVar9 = *(uint **)(param_2 + 8);
      if (0 < (int)uVar1) {
        uVar15 = (ulonglong)uVar1;
        puVar7 = puVar6;
        do {
          uVar14 = *puVar9;
          puVar9 = puVar9 + 1;
          *puVar7 = *puVar7 + (ulonglong)uVar14 * (ulonglong)((int)uVar2 * local_1054 & 0xfffffff);
          uVar15 = uVar15 - 1;
          puVar7 = puVar7 + 1;
        } while (uVar15 != 0);
      }
      puVar6 = puVar6 + 1;
      *puVar8 = *puVar8 + (puVar8[-1] >> 0x1c);
      uVar12 = uVar12 - 1;
      param_1 = local_1050;
      iVar3 = local_1058;
      uVar14 = uVar1;
    } while (uVar12 != 0);
  }
  iVar16 = uVar14 + 1;
  puVar6 = local_1048 + (int)uVar14;
  if (iVar16 <= iVar5) {
    uVar12 = (ulonglong)((iVar5 - iVar16) + 1);
    puVar8 = local_1048 + iVar16;
    do {
      uVar2 = *puVar6;
      puVar6 = puVar6 + 1;
      *puVar8 = *puVar8 + (uVar2 >> 0x1c);
      uVar12 = uVar12 - 1;
      puVar8 = puVar8 + 1;
    } while (uVar12 != 0);
  }
  puVar6 = local_1048 + (int)uVar1;
  iVar5 = 0;
  puVar9 = puVar10;
  if (0 < (int)(uVar1 + 1)) {
    do {
      uVar12 = *puVar6;
      iVar5 = iVar5 + 1;
      puVar10 = puVar9 + 1;
      puVar6 = puVar6 + 1;
      *puVar9 = (uint)uVar12 & 0xfffffff;
      puVar9 = puVar10;
    } while (iVar5 < *(int *)(param_2 + 0x10) + 1);
  }
  if (iVar5 < iVar3) {
    memset(puVar10,0,(ulonglong)(uint)(iVar3 - iVar5) << 2);
  }
  iVar3 = *(int *)(param_2 + 0x10) + 1;
  *(int *)(param_1 + 0x10) = iVar3;
  if (0 < iVar3) {
    do {
      if (*(int *)(*(longlong *)(param_1 + 8) + -4 + (longlong)*(int *)(param_1 + 0x10) * 4) != 0)
      break;
      iVar3 = *(int *)(param_1 + 0x10) + -1;
      *(int *)(param_1 + 0x10) = iVar3;
    } while (0 < iVar3);
  }
  if (*(int *)(param_1 + 0x10) == 0) {
    *(undefined4 *)(param_1 + 0x18) = 0;
  }
  iVar3 = *(int *)(param_1 + 0x10);
  if (iVar3 <= *(int *)(param_2 + 0x10)) {
    if (iVar3 < *(int *)(param_2 + 0x10)) {
      return 0;
    }
    puVar10 = (uint *)(*(longlong *)(param_1 + 8) + (longlong)(iVar3 + -1) * 4);
    if (0 < iVar3) {
      lVar13 = (*(longlong *)(param_2 + 8) + (longlong)(iVar3 + -1) * 4) - (longlong)puVar10;
      do {
        uVar14 = *(uint *)(lVar13 + (longlong)puVar10);
        uVar1 = *puVar10;
        if (uVar1 >= uVar14 && uVar1 != uVar14) break;
        if (uVar1 < uVar14) {
          return 0;
        }
        iVar11 = iVar11 + 1;
        puVar10 = puVar10 + -1;
      } while (iVar11 < iVar3);
    }
  }
  uVar4 = FUN_14011fa20(param_1,param_2,param_1);
  return uVar4;
}



undefined4 FUN_14012a330(longlong param_1,longlong param_2,longlong param_3,longlong param_4)

{
  int *piVar1;
  bool bVar2;
  undefined1 auVar3 [16];
  void *pvVar4;
  int iVar5;
  undefined4 uVar6;
  int iVar7;
  int iVar8;
  uint uVar9;
  int iVar10;
  __uint64 _Var11;
  void *pvVar12;
  uint *puVar13;
  undefined4 *puVar14;
  uint *puVar15;
  uint uVar16;
  int iVar17;
  ulonglong uVar18;
  undefined ***pppuVar19;
  undefined ***pppuVar20;
  int iVar21;
  ulonglong uVar22;
  uint uVar23;
  void *pvVar24;
  longlong lVar25;
  uint uVar26;
  undefined **local_138;
  void *local_130;
  int local_128;
  int local_124;
  uint local_120;
  longlong local_118;
  int local_110;
  undefined **local_108;
  uint *local_100;
  uint local_f8;
  undefined8 local_f4;
  longlong local_e8;
  int local_e0;
  undefined **local_d8;
  void *local_d0;
  uint local_c8;
  int local_c4;
  uint local_c0;
  int local_b8;
  uint *local_b0;
  int local_a8;
  int local_a4;
  undefined **local_a0;
  void *local_98;
  int local_90;
  int local_8c;
  undefined4 local_88;
  int local_80;
  uint local_7c;
  undefined **local_78;
  undefined4 *local_70;
  undefined4 local_68;
  undefined8 local_64;
  undefined8 local_58;
  
  local_58 = 0xfffffffffffffffe;
  iVar5 = *(int *)(param_2 + 0x10);
  if (iVar5 == 0) {
    return 0xfffffffd;
  }
  iVar7 = *(int *)(param_1 + 0x10);
  iVar10 = 0;
  if (iVar7 <= iVar5) {
    if (iVar7 < iVar5) {
LAB_14012a3cb:
      if (param_4 == 0) {
        uVar6 = 0;
      }
      else {
        uVar6 = FUN_14011d9d0(param_1,param_4);
      }
      if (param_3 != 0) {
        *(undefined4 *)(param_3 + 0x18) = 0;
        *(undefined4 *)(param_3 + 0x10) = 0;
        puVar14 = *(undefined4 **)(param_3 + 8);
        iVar5 = 0;
        if (0 < *(int *)(param_3 + 0x14)) {
          do {
            *puVar14 = 0;
            puVar14 = puVar14 + 1;
            iVar5 = iVar5 + 1;
          } while (iVar5 < *(int *)(param_3 + 0x14));
          return uVar6;
        }
        return uVar6;
      }
      return uVar6;
    }
    puVar13 = (uint *)(*(longlong *)(param_1 + 8) + (longlong)(iVar7 + -1) * 4);
    iVar5 = 0;
    if (0 < iVar7) {
      lVar25 = (*(longlong *)(param_2 + 8) + (longlong)(iVar7 + -1) * 4) - (longlong)puVar13;
      do {
        uVar16 = *(uint *)(lVar25 + (longlong)puVar13);
        if (uVar16 < *puVar13) break;
        if (*puVar13 < uVar16) goto LAB_14012a3cb;
        iVar5 = iVar5 + 1;
        puVar13 = puVar13 + -1;
      } while (iVar5 < iVar7);
    }
  }
  local_a0 = mp_int::vftable;
  uVar16 = iVar7 + 2U & 0x8000001f;
  if ((int)uVar16 < 0) {
    uVar16 = (uVar16 - 1 | 0xffffffe0) + 1;
  }
  iVar5 = iVar7 + 2U + (0x40 - uVar16);
  auVar3._8_8_ = 0;
  auVar3._0_8_ = (longlong)iVar5;
  _Var11 = SUB168(ZEXT816(4) * auVar3,0);
  if (SUB168(ZEXT816(4) * auVar3,8) != 0) {
    _Var11 = 0xffffffffffffffff;
  }
  pvVar12 = operator_new(_Var11);
  local_98 = pvVar12;
  memset(pvVar12,0,(longlong)iVar5 * 4);
  local_88 = 0;
  local_90 = *(int *)(param_1 + 0x10) + 2;
  local_8c = iVar5;
  local_80 = local_90;
  FUN_14011d6d0(&local_138,param_1);
  FUN_14011d6d0(&local_d8);
  local_108 = mp_int::vftable;
  puVar13 = operator_new(0x80);
  local_100 = puVar13;
  memset(puVar13,0,0x80);
  local_f8 = 0;
  local_f4 = 0x20;
  local_78 = mp_int::vftable;
  puVar14 = operator_new(0x80);
  local_70 = puVar14;
  memset(puVar14,0,0x80);
  pvVar24 = local_d0;
  local_68 = 0;
  local_64 = 0x20;
  local_7c = (uint)(*(int *)(param_1 + 0x18) != *(int *)(param_2 + 0x18));
  local_c0 = 0;
  local_120 = 0;
  uVar22 = (ulonglong)(int)local_c8;
  if (local_c8 == 0) {
    iVar7 = 0;
  }
  else {
    iVar7 = local_c8 * 0x1c + -0x1c;
    for (uVar16 = *(uint *)((longlong)local_d0 + uVar22 * 4 + -4); uVar16 != 0; uVar16 = uVar16 >> 1
        ) {
      iVar7 = iVar7 + 1;
    }
  }
  if (iVar7 % 0x1c < 0x1b) {
    iVar21 = 0x1b - iVar7 % 0x1c;
    local_a4 = iVar21;
    iVar7 = FUN_14011e4d0(&local_138,iVar21,&local_138);
    if (iVar7 != 0) {
      if (puVar14 != (undefined4 *)0x0) {
        memset(puVar14,0,0x80);
      }
      operator_delete(puVar14);
      if (puVar13 != (uint *)0x0) {
        memset(puVar13,0,0x80);
      }
      operator_delete(puVar13);
      if ((pvVar24 != (void *)0x0) && (local_c4 != 0)) {
        memset(pvVar24,0,(longlong)(local_c4 << 2));
      }
      operator_delete(pvVar24);
      if ((local_130 != (void *)0x0) && (local_124 != 0)) {
        memset(local_130,0,(longlong)(local_124 << 2));
      }
      operator_delete(local_130);
      if ((pvVar12 != (void *)0x0) && (iVar5 != 0)) {
        memset(pvVar12,0,(longlong)(iVar5 * 4));
      }
      operator_delete(pvVar12);
      return 0xfffffffd;
    }
    iVar7 = FUN_14011e4d0(&local_d8,iVar21,&local_d8);
    if (iVar7 != 0) {
      if (puVar14 != (undefined4 *)0x0) {
        memset(puVar14,0,0x80);
      }
      operator_delete(puVar14);
      if (puVar13 != (uint *)0x0) {
        memset(puVar13,0,0x80);
      }
      operator_delete(puVar13);
      if ((local_d0 != (void *)0x0) && (local_c4 != 0)) {
        memset(local_d0,0,(longlong)(local_c4 << 2));
      }
      operator_delete(local_d0);
      if ((local_130 != (void *)0x0) && (local_124 != 0)) {
        memset(local_130,0,(longlong)(local_124 << 2));
      }
      operator_delete(local_130);
      if ((pvVar12 != (void *)0x0) && (iVar5 != 0)) {
        memset(pvVar12,0,(longlong)(iVar5 * 4));
      }
      operator_delete(pvVar12);
      return 0xfffffffd;
    }
    uVar22 = (ulonglong)local_c8;
  }
  else {
    local_a4 = 0;
  }
  iVar7 = local_128;
  local_110 = local_128 + -1;
  uVar16 = (uint)uVar22;
  local_e0 = uVar16 - 1;
  uVar26 = local_110 - local_e0;
  pvVar24 = local_d0;
  uVar23 = local_c0;
  if (0 < (int)uVar26) {
    if (local_c4 < (int)(uVar26 + uVar16)) {
      FUN_14011d8c0(&local_d8);
      uVar16 = local_c8;
    }
    uVar23 = local_c0;
    pvVar24 = local_d0;
    local_c8 = uVar16 + uVar26;
    uVar22 = (ulonglong)local_c8;
    puVar14 = (undefined4 *)((longlong)local_d0 + (longlong)(int)local_c8 * 4 + -4);
    if ((int)uVar26 <= (int)(local_c8 - 1)) {
      lVar25 = (((longlong)(int)local_c8 - (longlong)(int)uVar26) * 4 + -4) - (longlong)puVar14;
      uVar18 = (ulonglong)(((local_c8 - 1) - uVar26) + 1);
      do {
        *puVar14 = *(undefined4 *)((longlong)puVar14 + (longlong)local_d0 + lVar25);
        puVar14 = puVar14 + -1;
        uVar18 = uVar18 - 1;
      } while (uVar18 != 0);
    }
    if (0 < (int)uVar26) {
      memset(local_d0,0,(ulonglong)uVar26 << 2);
    }
  }
  local_118 = (longlong)local_110;
  local_e8 = (longlong)local_e0;
LAB_14012a7f0:
  iVar21 = (int)uVar22;
  if (local_120 == uVar23) {
    iVar8 = iVar10;
    if (local_120 == 1) {
      if (iVar7 < iVar21) {
        iVar8 = 1;
      }
      else if (iVar21 < iVar7) {
        iVar8 = -1;
      }
      else {
        lVar25 = (longlong)(iVar21 + -1) * 4;
        puVar15 = (uint *)(lVar25 + (longlong)pvVar24);
        iVar17 = 0;
        if (0 < iVar21) {
          lVar25 = lVar25 - (longlong)puVar15;
          do {
            uVar16 = *(uint *)((longlong)puVar15 + lVar25 + (longlong)local_130);
            uVar26 = *puVar15;
            if (uVar26 >= uVar16 && uVar26 != uVar16) goto LAB_14012a86f;
            if (uVar26 < uVar16) goto LAB_14012a86a;
            iVar17 = iVar17 + 1;
            puVar15 = puVar15 + -1;
          } while (iVar17 < iVar21);
        }
      }
    }
    else if (iVar21 < iVar7) {
      iVar8 = 1;
    }
    else if (iVar7 < iVar21) {
      iVar8 = -1;
    }
    else {
      lVar25 = (longlong)(iVar7 + -1) * 4;
      puVar15 = (uint *)(lVar25 + (longlong)local_130);
      iVar17 = 0;
      if (0 < iVar7) {
        lVar25 = lVar25 - (longlong)puVar15;
        do {
          uVar16 = *puVar15;
          uVar26 = *(uint *)(lVar25 + (longlong)pvVar24 + (longlong)puVar15);
          if (uVar16 >= uVar26 && uVar16 != uVar26) goto LAB_14012a86f;
          if (uVar16 < uVar26) goto LAB_14012a86a;
          iVar17 = iVar17 + 1;
          puVar15 = puVar15 + -1;
        } while (iVar17 < iVar7);
      }
    }
    goto LAB_14012a8d5;
  }
  if (local_120 == 1) goto LAB_14012aa64;
  goto LAB_14012a8de;
LAB_14012a86f:
  iVar8 = 1;
  goto LAB_14012a8d5;
LAB_14012a86a:
  iVar8 = -1;
LAB_14012a8d5:
  if (iVar8 == -1) {
LAB_14012aa64:
    FUN_14011e810(&local_d8);
    iVar10 = local_e0 + 1;
    pvVar24 = local_d0;
    iVar21 = local_e0;
    local_b8 = iVar10;
    if (iVar10 <= local_110) goto LAB_14012aaa0;
    goto LAB_14012b33d;
  }
LAB_14012a8de:
  piVar1 = (int *)((longlong)local_98 + (local_118 - local_e8) * 4);
  *piVar1 = *piVar1 + 1;
  if (local_120 != uVar23) {
    iVar21 = FUN_14011efe0(&local_138,&local_d8,&local_138);
    uVar22 = (ulonglong)local_c8;
    pvVar24 = local_d0;
    uVar23 = local_c0;
    goto LAB_14012a986;
  }
  if (iVar21 < iVar7) {
LAB_14012a973:
    pppuVar20 = &local_d8;
    pppuVar19 = &local_138;
  }
  else {
    if (iVar21 <= iVar7) {
      lVar25 = (longlong)(iVar7 + -1) * 4;
      puVar15 = (uint *)(lVar25 + (longlong)local_130);
      iVar21 = 0;
      if (0 < iVar7) {
        lVar25 = lVar25 - (longlong)puVar15;
        do {
          uVar16 = *(uint *)((longlong)puVar15 + lVar25 + (longlong)pvVar24);
          uVar26 = *puVar15;
          if (uVar26 >= uVar16 && uVar26 != uVar16) break;
          if (uVar26 < uVar16) goto LAB_14012a95b;
          iVar21 = iVar21 + 1;
          puVar15 = puVar15 + -1;
        } while (iVar21 < iVar7);
      }
      goto LAB_14012a973;
    }
LAB_14012a95b:
    local_120 = (uint)(local_120 == 0);
    pppuVar20 = &local_138;
    pppuVar19 = &local_d8;
  }
  iVar21 = FUN_14011fa20(pppuVar19,pppuVar20,&local_138);
LAB_14012a986:
  puVar14 = local_70;
  iVar7 = local_128;
  if (iVar21 != 0) {
    if (local_70 != (undefined4 *)0x0) {
      memset(local_70,0,0x80);
    }
    operator_delete(puVar14);
    if (puVar13 != (uint *)0x0) {
      memset(puVar13,0,0x80);
    }
    operator_delete(puVar13);
    if ((pvVar24 != (void *)0x0) && (local_c4 != 0)) {
      memset(pvVar24,0,(longlong)(local_c4 << 2));
    }
    operator_delete(pvVar24);
    if ((local_130 != (void *)0x0) && (local_124 != 0)) {
      memset(local_130,0,(longlong)(local_124 << 2));
    }
    operator_delete(local_130);
    pvVar24 = local_98;
    if ((local_98 != (void *)0x0) && (iVar5 != 0)) {
      memset(local_98,0,(longlong)(iVar5 * 4));
    }
    operator_delete(pvVar24);
    return 0xfffffffd;
  }
  goto LAB_14012a7f0;
LAB_14012aaa0:
  pvVar4 = local_d0;
  pvVar12 = local_130;
  if (local_110 <= iVar7) {
    uVar16 = *(uint *)((longlong)local_d0 + local_e8 * 4);
    uVar23 = *(uint *)((longlong)local_130 + local_118 * 4);
    if (uVar23 == uVar16) {
      local_b0 = (uint *)((longlong)local_98 + (local_118 - local_e8) * 4 + -4);
      *local_b0 = 0xfffffff;
    }
    else {
      uVar22 = ((ulonglong)uVar23 << 0x1c |
               (ulonglong)*(uint *)((longlong)local_130 + local_118 * 4 + -4)) / (ulonglong)uVar16;
      if (0xfffffff < uVar22) {
        uVar22 = 0xfffffff;
      }
      local_b0 = (uint *)((longlong)local_98 + (local_118 - local_e8) * 4 + -4);
      *local_b0 = (uint)uVar22 & 0xfffffff;
    }
    *local_b0 = *local_b0 + 1 & 0xfffffff;
    local_a8 = iVar21 + -1;
    local_68 = 3;
    while( true ) {
      do {
        iVar7 = local_a8;
        uVar22 = local_f4;
        *local_b0 = *local_b0 - 1 & 0xfffffff;
        local_f4 = local_f4 & 0xffffffff;
        uVar18 = local_f4;
        local_f4._0_4_ = (int)uVar22;
        bVar2 = 0 < (int)local_f4;
        iVar10 = (int)local_f4;
        local_f4 = uVar18;
        if (bVar2) {
          memset(puVar13,0,(uVar22 & 0xffffffff) << 2);
          iVar10 = (int)local_f4;
        }
        uVar16 = 0;
        if (-1 < iVar7) {
          uVar16 = *(uint *)((longlong)pvVar4 + local_e8 * 4 + -4);
        }
        *puVar13 = uVar16;
        puVar13[1] = *(uint *)((longlong)pvVar4 + local_e8 * 4);
        local_f8 = 2;
        uVar16 = *local_b0;
        uVar6 = 0;
        if (iVar10 < 3) {
          FUN_14011d8c0(&local_108,3);
          puVar13 = local_100;
          uVar6 = local_f4._4_4_;
        }
        uVar23 = local_f8;
        uVar22 = 0;
        uVar9 = 0;
        puVar15 = puVar13;
        uVar26 = 0;
        if (0 < (int)local_f8) {
          uVar18 = (ulonglong)local_f8;
          do {
            uVar22 = (ulonglong)*puVar15 * (ulonglong)uVar16 + (uVar22 & 0xffffffff);
            *puVar15 = (uint)uVar22 & 0xfffffff;
            puVar15 = puVar15 + 1;
            uVar22 = uVar22 >> 0x1c;
            uVar9 = (uint)uVar22;
            uVar18 = uVar18 - 1;
            uVar26 = local_f8;
          } while (uVar18 != 0);
        }
        *puVar15 = uVar9;
        if ((int)(uVar26 + 1) < (int)local_f8) {
          memset(puVar15 + 1,0,(ulonglong)(local_f8 - (uVar26 + 1)) << 2);
        }
        puVar14 = local_70;
        local_f8 = uVar23 + 1;
        while ((0 < (int)local_f8 && (puVar13[(longlong)(int)local_f8 + -1] == 0))) {
          local_f8 = local_f8 - 1;
        }
        if (local_f8 == 0) {
          uVar6 = 0;
        }
        local_f4 = CONCAT44(uVar6,(int)local_f4);
        uVar6 = 0;
        if (-1 < local_110 + -2) {
          uVar6 = *(undefined4 *)((longlong)pvVar12 + local_118 * 4 + -8);
        }
        *local_70 = uVar6;
        uVar6 = 0;
        if (-1 < local_110 + -1) {
          uVar6 = *(undefined4 *)((longlong)pvVar12 + local_118 * 4 + -4);
        }
        local_70[1] = uVar6;
        local_70[2] = *(undefined4 *)((longlong)pvVar12 + local_118 * 4);
      } while (3 < (int)local_f8);
      if ((int)local_f8 < 3) break;
      puVar15 = puVar13 + (int)(local_f8 - 1);
      iVar7 = 0;
      if ((int)local_f8 < 1) break;
      lVar25 = (longlong)(int)(local_f8 - 1) * 4 - (longlong)puVar15;
      while (uVar16 = *(uint *)((longlong)puVar15 + lVar25 + (longlong)local_70), *puVar15 <= uVar16
            ) {
        if (*puVar15 < uVar16) goto LAB_14012acc8;
        iVar7 = iVar7 + 1;
        puVar15 = puVar15 + -1;
        if ((int)local_f8 <= iVar7) goto LAB_14012acc8;
      }
    }
LAB_14012acc8:
    iVar10 = FUN_14011e600(&local_d8,*local_b0,&local_108);
    iVar7 = local_128;
    if (iVar10 != 0) {
      memset(puVar14,0,0x80);
      operator_delete(puVar14);
      puVar13 = local_100;
      if ((local_100 != (uint *)0x0) && ((int)local_f4 != 0)) {
        memset(local_100,0,(longlong)((int)local_f4 << 2));
      }
      operator_delete(puVar13);
      if ((local_d0 != (void *)0x0) && (local_c4 != 0)) {
        memset(local_d0,0,(longlong)(local_c4 << 2));
      }
      operator_delete(local_d0);
      if ((pvVar12 != (void *)0x0) && (local_124 != 0)) {
        memset(pvVar12,0,(longlong)(local_124 << 2));
      }
      operator_delete(pvVar12);
      pvVar24 = local_98;
      if ((local_98 != (void *)0x0) && (iVar5 != 0)) {
        memset(local_98,0,(longlong)(iVar5 * 4));
      }
      operator_delete(pvVar24);
      return 0xfffffffd;
    }
    iVar10 = FUN_14011e190(&local_108);
    uVar16 = local_f8;
    puVar13 = local_100;
    if (iVar10 != 0) {
      memset(puVar14,0,0x80);
      operator_delete(puVar14);
      puVar13 = local_100;
      if ((local_100 != (uint *)0x0) && ((int)local_f4 != 0)) {
        memset(local_100,0,(longlong)((int)local_f4 << 2));
      }
      operator_delete(puVar13);
      if ((local_d0 != (void *)0x0) && (local_c4 != 0)) {
        memset(local_d0,0,(longlong)(local_c4 << 2));
      }
      operator_delete(local_d0);
      if ((pvVar12 != (void *)0x0) && (local_124 != 0)) {
        memset(pvVar12,0,(longlong)(local_124 << 2));
      }
      operator_delete(pvVar12);
      pvVar24 = local_98;
      if ((local_98 != (void *)0x0) && (iVar5 != 0)) {
        memset(local_98,0,(longlong)(iVar5 * 4));
      }
      operator_delete(pvVar24);
      return 0xfffffffd;
    }
    if (local_120 == local_f4._4_4_) {
      if ((int)local_f8 < iVar7) {
LAB_14012ad93:
        pppuVar19 = &local_108;
        pppuVar20 = &local_138;
      }
      else {
        if ((int)local_f8 <= iVar7) {
          puVar15 = (uint *)((longlong)pvVar12 + (longlong)(iVar7 + -1) * 4);
          iVar10 = 0;
          if (0 < iVar7) {
            lVar25 = (longlong)(iVar7 + -1) * 4 - (longlong)puVar15;
            do {
              uVar23 = *(uint *)((longlong)puVar15 + (longlong)local_100 + lVar25);
              uVar26 = *puVar15;
              if (uVar26 >= uVar23 && uVar26 != uVar23) break;
              if (uVar26 < uVar23) goto LAB_14012ad7a;
              iVar10 = iVar10 + 1;
              puVar15 = puVar15 + -1;
            } while (iVar10 < iVar7);
          }
          goto LAB_14012ad93;
        }
LAB_14012ad7a:
        local_120 = (uint)(local_120 == 0);
        pppuVar19 = &local_138;
        pppuVar20 = &local_108;
      }
      iVar7 = FUN_14011fa20(pppuVar20,pppuVar19,&local_138);
    }
    else {
      iVar7 = FUN_14011efe0(&local_138,&local_108,&local_138);
      puVar13 = local_100;
      uVar16 = local_f8;
    }
    uVar23 = local_c8;
    if (iVar7 != 0) {
      memset(puVar14,0,0x80);
      operator_delete(puVar14);
      if ((puVar13 != (uint *)0x0) && ((int)local_f4 != 0)) {
        memset(puVar13,0,(longlong)((int)local_f4 << 2));
      }
      operator_delete(puVar13);
      if ((local_d0 != (void *)0x0) && (local_c4 != 0)) {
        memset(local_d0,0,(longlong)(local_c4 << 2));
      }
      operator_delete(local_d0);
      if ((local_130 != (void *)0x0) && (local_124 != 0)) {
        memset(local_130,0,(longlong)(local_124 << 2));
      }
      operator_delete(local_130);
      pvVar24 = local_98;
      if ((local_98 != (void *)0x0) && (iVar5 != 0)) {
        memset(local_98,0,(longlong)(iVar5 * 4));
      }
      operator_delete(pvVar24);
      return 0xfffffffd;
    }
    pvVar24 = local_d0;
    iVar7 = local_128;
    iVar21 = local_e0;
    iVar10 = local_b8;
    if (local_120 == 1) {
      uVar22 = (ulonglong)local_c8;
      if ((int)local_f4 < (int)local_c8) {
        FUN_14011d8c0(&local_108);
        puVar13 = local_100;
        uVar16 = local_f8;
      }
      pvVar24 = local_d0;
      uVar26 = 0;
      if (0 < (int)uVar23) {
        lVar25 = (longlong)local_d0 - (longlong)puVar13;
        do {
          *puVar13 = *(uint *)((longlong)puVar13 + lVar25);
          puVar13 = puVar13 + 1;
          uVar22 = uVar22 - 1;
          uVar26 = uVar23;
        } while (uVar22 != 0);
      }
      if ((int)uVar26 < (int)uVar16) {
        memset(puVar13,0,(ulonglong)(uVar16 - uVar26) << 2);
      }
      local_f8 = uVar23;
      local_f4 = CONCAT44(local_c0,(int)local_f4);
      iVar7 = FUN_14011e190(&local_108);
      puVar14 = local_70;
      puVar13 = local_100;
      if (iVar7 != 0) {
        memset(local_70,0,0x80);
        operator_delete(puVar14);
        puVar13 = local_100;
        if ((local_100 != (uint *)0x0) && ((int)local_f4 != 0)) {
          memset(local_100,0,(longlong)((int)local_f4 << 2));
        }
        operator_delete(puVar13);
        if ((pvVar24 != (void *)0x0) && (local_c4 != 0)) {
          memset(pvVar24,0,(longlong)(local_c4 << 2));
        }
        operator_delete(pvVar24);
        if ((local_130 != (void *)0x0) && (local_124 != 0)) {
          memset(local_130,0,(longlong)(local_124 << 2));
        }
        operator_delete(local_130);
        pvVar24 = local_98;
        if ((local_98 != (void *)0x0) && (iVar5 != 0)) {
          memset(local_98,0,(longlong)(iVar5 * 4));
        }
        operator_delete(pvVar24);
        return 0xfffffffd;
      }
      if (local_f4._4_4_ == 1) {
        local_120 = local_f4._4_4_;
        iVar7 = FUN_14011efe0(&local_138,&local_108,&local_138);
        puVar13 = local_100;
      }
      else {
        if ((int)local_f8 < local_128) {
LAB_14012aedb:
          local_120 = 1;
          pppuVar19 = &local_108;
          pppuVar20 = &local_138;
        }
        else {
          if ((int)local_f8 <= local_128) {
            puVar15 = (uint *)((longlong)local_130 + (longlong)(local_128 + -1) * 4);
            iVar7 = 0;
            if (0 < local_128) {
              lVar25 = (longlong)(local_128 + -1) * 4 - (longlong)puVar15;
              do {
                uVar16 = *(uint *)((longlong)puVar15 + (longlong)local_100 + lVar25);
                uVar23 = *puVar15;
                if (uVar23 >= uVar16 && uVar23 != uVar16) break;
                if (uVar23 < uVar16) goto LAB_14012aeca;
                iVar7 = iVar7 + 1;
                puVar15 = puVar15 + -1;
              } while (iVar7 < local_128);
            }
            goto LAB_14012aedb;
          }
LAB_14012aeca:
          local_120 = local_f4._4_4_;
          pppuVar19 = &local_138;
          pppuVar20 = &local_108;
        }
        iVar7 = FUN_14011fa20(pppuVar20,pppuVar19,&local_138);
      }
      puVar14 = local_70;
      if (iVar7 != 0) {
        memset(local_70,0,0x80);
        operator_delete(puVar14);
        if ((puVar13 != (uint *)0x0) && ((int)local_f4 != 0)) {
          memset(puVar13,0,(longlong)((int)local_f4 << 2));
        }
        operator_delete(puVar13);
        if ((pvVar24 != (void *)0x0) && (local_c4 != 0)) {
          memset(pvVar24,0,(longlong)(local_c4 << 2));
        }
        operator_delete(pvVar24);
        if ((local_130 != (void *)0x0) && (local_124 != 0)) {
          memset(local_130,0,(longlong)(local_124 << 2));
        }
        operator_delete(local_130);
        pvVar24 = local_98;
        if ((local_98 != (void *)0x0) && (iVar5 != 0)) {
          memset(local_98,0,(longlong)(iVar5 * 4));
        }
        operator_delete(pvVar24);
        return 0xfffffffd;
      }
      *local_b0 = *local_b0 - 1 & 0xfffffff;
      iVar7 = local_128;
      iVar21 = local_e0;
      iVar10 = local_b8;
    }
  }
  local_110 = local_110 + -1;
  local_118 = local_118 + -1;
  if (local_110 < iVar10) {
LAB_14012b33d:
    if (iVar7 == 0) {
      local_120 = 0;
    }
    else {
      local_120 = *(undefined4 *)(param_1 + 0x18);
    }
    iVar7 = local_80;
    if (param_3 != 0) {
      while ((0 < iVar7 && (*(int *)((longlong)local_98 + (longlong)iVar7 * 4 + -4) == 0))) {
        local_90 = iVar7 + -1;
        iVar7 = local_90;
      }
      local_88 = 0;
      FUN_14011da60(&local_a0);
      *(uint *)(param_3 + 0x18) = local_7c;
      iVar5 = local_8c;
    }
    if (param_4 != 0) {
      FUN_14011fbb0(&local_138,local_a4,&local_138,0);
      FUN_14011da60(&local_138);
    }
    puVar14 = local_70;
    if (local_70 != (undefined4 *)0x0) {
      memset(local_70,0,0x80);
    }
    operator_delete(puVar14);
    if ((puVar13 != (uint *)0x0) && ((int)local_f4 != 0)) {
      memset(puVar13,0,(longlong)((int)local_f4 << 2));
    }
    operator_delete(puVar13);
    if ((pvVar24 != (void *)0x0) && (local_c4 != 0)) {
      memset(pvVar24,0,(longlong)(local_c4 << 2));
    }
    operator_delete(pvVar24);
    if ((local_130 != (void *)0x0) && (local_124 != 0)) {
      memset(local_130,0,(longlong)(local_124 << 2));
    }
    operator_delete(local_130);
    pvVar24 = local_98;
    if ((local_98 != (void *)0x0) && (iVar5 != 0)) {
      memset(local_98,0,(longlong)(iVar5 * 4));
    }
    operator_delete(pvVar24);
    return 0;
  }
  goto LAB_14012aaa0;
}



int FUN_14012b4b0(undefined8 param_1,longlong param_2,undefined8 param_3)

{
  void *pvVar1;
  int iVar2;
  int iVar3;
  undefined8 uVar4;
  undefined **local_30;
  void *local_28;
  undefined4 local_20;
  undefined8 local_1c;
  
  uVar4 = 0xfffffffffffffffe;
  local_30 = mp_int::vftable;
  local_28 = operator_new(0x80);
  memset(local_28,0,0x80);
  iVar3 = 0;
  local_20 = 0;
  local_1c = 0x20;
  iVar2 = FUN_14012a330(param_1,param_2,0,&local_30,uVar4);
  pvVar1 = local_28;
  if (iVar2 == 0) {
    if (local_1c._4_4_ == *(int *)(param_2 + 0x18)) {
      FUN_14011da60(&local_30);
    }
    else {
      iVar3 = FUN_14011fe40(param_2,&local_30,param_3);
    }
    pvVar1 = local_28;
    if ((local_28 != (void *)0x0) && ((int)local_1c != 0)) {
      memset(local_28,0,(longlong)((int)local_1c << 2));
    }
    operator_delete(pvVar1);
  }
  else {
    if ((local_28 != (void *)0x0) && ((int)local_1c != 0)) {
      memset(local_28,0,(longlong)((int)local_1c << 2));
    }
    operator_delete(pvVar1);
    iVar3 = iVar2;
  }
  return iVar3;
}



undefined8 FUN_14012b5e0(longlong param_1,longlong param_2,int param_3)

{
  int iVar1;
  uint uVar2;
  uint uVar3;
  undefined8 uVar4;
  ulonglong uVar5;
  uint *puVar6;
  uint *puVar7;
  uint *puVar8;
  int iVar9;
  int iVar10;
  int iVar11;
  longlong lVar12;
  
  iVar9 = *(int *)(param_2 + 0x10) * 2 + 1;
  if ((iVar9 < 0x200) && (*(int *)(param_2 + 0x10) < 0x100)) {
    uVar4 = FUN_14012a0c0();
    return uVar4;
  }
  if (*(int *)(param_1 + 0x14) < iVar9) {
    FUN_14011d8c0(param_1,iVar9);
  }
  *(int *)(param_1 + 0x10) = iVar9;
  iVar9 = *(int *)(param_2 + 0x10);
  iVar10 = 0;
  if (0 < iVar9) {
    lVar12 = 0;
    iVar11 = iVar10;
    do {
      puVar8 = *(uint **)(param_2 + 8);
      iVar1 = *(int *)(lVar12 + *(longlong *)(param_1 + 8));
      uVar5 = 0;
      if (0 < iVar9) {
        puVar6 = (uint *)(*(longlong *)(param_1 + 8) + (longlong)iVar11 * 4);
        iVar9 = iVar10;
        do {
          uVar3 = *puVar8;
          iVar9 = iVar9 + 1;
          puVar7 = puVar6 + 1;
          puVar8 = puVar8 + 1;
          uVar5 = (ulonglong)uVar3 * (ulonglong)(iVar1 * param_3 & 0xfffffff) + (uVar5 & 0xffffffff)
                  + (ulonglong)*puVar6;
          *puVar6 = (uint)uVar5 & 0xfffffff;
          uVar5 = uVar5 >> 0x1c;
          puVar6 = puVar7;
        } while (iVar9 < *(int *)(param_2 + 0x10));
        uVar3 = (uint)uVar5;
        while (uVar3 != 0) {
          *puVar7 = *puVar7 + (int)uVar5;
          uVar3 = *puVar7;
          *puVar7 = *puVar7 & 0xfffffff;
          uVar3 = uVar3 >> 0x1c;
          uVar5 = (ulonglong)uVar3;
          puVar7 = puVar7 + 1;
        }
      }
      iVar9 = *(int *)(param_2 + 0x10);
      iVar11 = iVar11 + 1;
      lVar12 = lVar12 + 4;
    } while (iVar11 < iVar9);
  }
  iVar9 = *(int *)(param_1 + 0x10);
  if (0 < iVar9) {
    do {
      if (*(int *)(*(longlong *)(param_1 + 8) + -4 + (longlong)*(int *)(param_1 + 0x10) * 4) != 0)
      break;
      iVar9 = *(int *)(param_1 + 0x10) + -1;
      *(int *)(param_1 + 0x10) = iVar9;
    } while (0 < iVar9);
    iVar9 = *(int *)(param_1 + 0x10);
  }
  if (iVar9 == 0) {
    *(undefined4 *)(param_1 + 0x18) = 0;
  }
  FUN_14011e810(param_1,*(undefined4 *)(param_2 + 0x10));
  iVar9 = *(int *)(param_1 + 0x10);
  if (iVar9 <= *(int *)(param_2 + 0x10)) {
    if (iVar9 < *(int *)(param_2 + 0x10)) {
      return 0;
    }
    puVar8 = (uint *)(*(longlong *)(param_1 + 8) + (longlong)(iVar9 + -1) * 4);
    if (0 < iVar9) {
      lVar12 = (*(longlong *)(param_2 + 8) + (longlong)(iVar9 + -1) * 4) - (longlong)puVar8;
      do {
        uVar3 = *puVar8;
        uVar2 = *(uint *)(lVar12 + (longlong)puVar8);
        if (uVar3 >= uVar2 && uVar3 != uVar2) break;
        if (uVar3 < uVar2) {
          return 0;
        }
        iVar10 = iVar10 + 1;
        puVar8 = puVar8 + -1;
      } while (iVar10 < iVar9);
    }
  }
  uVar4 = FUN_14011fa20(param_1,param_2,param_1);
  return uVar4;
}



void FUN_14012b7a0(longlong param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  uint uVar5;
  int iVar6;
  
  iVar1 = *(int *)(param_2 + 0x18);
  iVar6 = *(int *)(param_2 + 0x10);
  iVar2 = *(int *)(param_1 + 0x18);
  iVar3 = *(int *)(param_1 + 0x10);
  uVar5 = 0;
  iVar4 = iVar6;
  if (iVar3 < iVar6) {
    iVar4 = iVar3;
  }
  if (iVar4 < DAT_140309908) {
    iVar4 = iVar6;
    if (iVar3 < iVar6) {
      iVar4 = iVar3;
    }
    if (iVar4 < DAT_140309900) {
      iVar4 = iVar6 + 1 + iVar3;
      if (iVar4 < 0x200) {
        if (iVar3 < iVar6) {
          iVar6 = iVar3;
        }
        if (iVar6 < 0x101) {
          FUN_14011ea80(param_1,param_2,param_3,iVar4);
          goto LAB_14012b834;
        }
      }
      FUN_14011f140(param_1,param_2,param_3,iVar4);
    }
    else {
      FUN_140120060(param_1,param_2,param_3);
    }
  }
  else {
    FUN_1401231a0(param_1,param_2,param_3);
  }
LAB_14012b834:
  if (0 < *(int *)(param_3 + 0x10)) {
    uVar5 = (uint)(iVar2 != iVar1);
  }
  *(uint *)(param_3 + 0x18) = uVar5;
  return;
}



int FUN_14012b850(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  int iVar2;
  undefined **local_30;
  void *local_28;
  undefined4 local_20;
  undefined8 local_1c;
  
  local_30 = mp_int::vftable;
  local_28 = operator_new(0x80);
  memset(local_28,0,0x80);
  local_20 = 0;
  local_1c = 0x20;
  iVar2 = FUN_14012b7a0(param_1,param_2,&local_30);
  if (iVar2 == 0) {
    iVar2 = FUN_14012b4b0(&local_30,param_3,param_4);
  }
  pvVar1 = local_28;
  if ((local_28 != (void *)0x0) && ((int)local_1c != 0)) {
    memset(local_28,0,(longlong)((int)local_1c << 2));
  }
  operator_delete(pvVar1);
  return iVar2;
}



int FUN_14012b930(undefined ***param_1,longlong param_2,longlong param_3)

{
  uint uVar1;
  uint uVar2;
  bool bVar3;
  longlong lVar4;
  ulonglong uVar5;
  int iVar6;
  uint uVar7;
  int iVar8;
  int *piVar9;
  ulonglong uVar10;
  int *piVar11;
  uint uVar12;
  uint uVar13;
  uint uVar14;
  undefined **ppuVar15;
  uint uVar16;
  undefined8 uVar17;
  undefined **local_60;
  int *local_58;
  uint local_50;
  undefined8 local_4c;
  
  uVar17 = 0xfffffffffffffffe;
  local_60 = mp_int::vftable;
  piVar9 = operator_new(0x80);
  local_58 = piVar9;
  memset(piVar9,0,0x80);
  uVar16 = 0;
  local_50 = 0;
  uVar10 = 0x20;
  local_4c = 0x20;
  uVar2 = *(uint *)(param_2 + 0x10);
  uVar12 = 0;
  if (param_1 != &local_60) {
    if (0x20 < *(int *)(param_1 + 2)) {
      FUN_14011d8c0(&local_60);
      piVar9 = local_58;
    }
    ppuVar15 = param_1[1];
    piVar11 = piVar9;
    uVar12 = uVar16;
    if (0 < *(int *)(param_1 + 2)) {
      do {
        *piVar11 = *(int *)ppuVar15;
        piVar11 = piVar11 + 1;
        ppuVar15 = (undefined **)((longlong)ppuVar15 + 4);
        uVar12 = uVar12 + 1;
      } while ((int)uVar12 < *(int *)(param_1 + 2));
    }
    if ((int)uVar12 < (int)local_50) {
      memset(piVar11,0,(ulonglong)(local_50 - uVar12) << 2);
    }
    uVar10 = local_4c;
    local_50 = *(uint *)(param_1 + 2);
    uVar12 = *(uint *)(param_1 + 3);
    local_4c = CONCAT44(uVar12,(int)local_4c);
    uVar10 = uVar10 & 0xffffffff;
  }
  iVar6 = uVar2 - 1;
  uVar13 = local_50;
  uVar1 = local_50;
  if (0 < iVar6) {
    if (iVar6 < (int)local_50) {
      uVar13 = local_50 - iVar6;
      uVar14 = 0;
      if (0 < (int)uVar13) {
        uVar10 = (ulonglong)uVar13;
        do {
          *piVar9 = piVar9[iVar6];
          piVar9 = piVar9 + 1;
          uVar10 = uVar10 - 1;
          uVar14 = uVar13;
        } while (uVar10 != 0);
      }
      uVar1 = uVar13;
      if ((int)uVar14 < (int)local_50) {
        memset(piVar9,0,(ulonglong)(local_50 - uVar14) << 2);
      }
    }
    else {
      local_4c = local_4c & 0xffffffff;
      local_50 = 0;
      uVar12 = 0;
      uVar13 = uVar16;
      uVar1 = local_50;
      if (0 < (int)uVar10) {
        memset(piVar9,0,uVar10 << 2);
        uVar13 = 0;
        uVar1 = local_50;
      }
    }
  }
  local_50 = uVar1;
  if (uVar2 < 0x8000001) {
    iVar6 = FUN_14011f430(&local_60,param_3,&local_60,uVar2,uVar17);
    piVar9 = local_58;
    uVar10 = local_4c;
  }
  else {
    uVar1 = *(uint *)(param_3 + 0x18);
    uVar14 = *(uint *)(param_3 + 0x10);
    uVar7 = uVar14;
    if ((int)uVar13 < (int)uVar14) {
      uVar7 = uVar13;
    }
    if ((int)uVar7 < DAT_140309908) {
      uVar7 = uVar14;
      if ((int)uVar13 < (int)uVar14) {
        uVar7 = uVar13;
      }
      if ((int)uVar7 < DAT_140309900) {
        if ((int)(uVar14 + 1 + uVar13) < 0x200) {
          if ((int)uVar13 < (int)uVar14) {
            uVar14 = uVar13;
          }
          if ((int)uVar14 < 0x101) {
            iVar6 = FUN_14011ea80(&local_60,param_3,&local_60);
            goto LAB_14012bb2e;
          }
        }
        iVar6 = FUN_14011f140(&local_60,param_3,&local_60);
      }
      else {
        iVar6 = FUN_140120060(&local_60,param_3,&local_60);
      }
    }
    else {
      iVar6 = FUN_1401231a0(&local_60,param_3,&local_60);
    }
LAB_14012bb2e:
    uVar13 = uVar16;
    if (0 < (int)local_50) {
      uVar13 = (uint)(uVar12 != uVar1);
    }
    local_4c = CONCAT44(uVar13,(int)local_4c);
    piVar9 = local_58;
    uVar10 = local_4c;
  }
  local_58 = piVar9;
  local_4c = uVar10;
  if (iVar6 == 0) {
    uVar13 = uVar2 + 1;
    local_4c._0_4_ = (int)uVar10;
    iVar8 = (int)local_4c;
    uVar12 = local_50;
    if (0 < (int)uVar13) {
      if ((int)uVar13 < (int)local_50) {
        uVar12 = local_50 - uVar13;
        piVar11 = piVar9;
        if (0 < (int)uVar12) {
          uVar10 = (ulonglong)uVar12;
          do {
            *piVar11 = piVar11[(int)uVar13];
            piVar11 = piVar11 + 1;
            uVar10 = uVar10 - 1;
            uVar16 = uVar12;
          } while (uVar10 != 0);
        }
        if ((int)uVar16 < (int)local_50) {
          memset(piVar11,0,(ulonglong)(local_50 - uVar16) << 2);
        }
      }
      else {
        local_4c = uVar10 & 0xffffffff;
        local_50 = 0;
        uVar12 = local_50;
        if (0 < iVar8) {
          memset(piVar9,0,(uVar10 & 0xffffffff) << 2);
          uVar12 = local_50;
        }
      }
    }
    local_50 = uVar12;
    iVar6 = FUN_14011e220(param_1,(uVar2 + 1) * 0x1c,param_1);
    if (iVar6 != 0) goto LAB_14012bd4c;
    iVar6 = FUN_14011f140(&local_60,param_2,&local_60,uVar13);
    if ((iVar6 == 0) &&
       (iVar6 = FUN_140122ee0(param_1,&local_60,param_1), uVar10 = local_4c, piVar9 = local_58,
       iVar6 == 0)) {
      if (*(int *)(param_1 + 3) == 1) {
        local_4c = local_4c & 0xffffffff;
        uVar5 = local_4c;
        local_4c._0_4_ = (int)uVar10;
        iVar6 = (int)local_4c;
        bVar3 = 0 < (int)local_4c;
        local_4c = uVar5;
        if (bVar3) {
          memset(local_58,0,(uVar10 & 0xffffffff) << 2);
        }
        *piVar9 = 1;
        local_50 = (uint)(*piVar9 != 0);
        if (0 < (int)uVar13) {
          if (iVar6 < (int)(uVar13 + (*piVar9 != 0))) {
            FUN_14011d8c0(&local_60);
            piVar9 = local_58;
          }
          local_50 = local_50 + uVar13;
          piVar11 = piVar9 + (longlong)(int)local_50 + -1;
          if ((int)uVar13 <= (int)(local_50 - 1)) {
            lVar4 = (((longlong)(int)local_50 - (longlong)(int)uVar13) * 4 + -4) - (longlong)piVar11
            ;
            uVar10 = (ulonglong)(((local_50 - 1) - uVar13) + 1);
            do {
              *piVar11 = *(int *)((longlong)piVar9 + lVar4 + (longlong)piVar11);
              piVar11 = piVar11 + -1;
              uVar10 = uVar10 - 1;
            } while (uVar10 != 0);
          }
          if (0 < (int)uVar13) {
            memset(piVar9,0,(ulonglong)uVar13 << 2);
          }
        }
        iVar6 = FUN_14011fe40(param_1,&local_60,param_1);
        if (iVar6 != 0) goto LAB_14012bd44;
      }
      iVar8 = FUN_14011ff00(param_1);
      while ((iVar8 != -1 && (iVar6 = FUN_14011fa20(param_1,param_2,param_1), iVar6 == 0))) {
        iVar8 = FUN_14011ff00(param_1);
      }
    }
  }
LAB_14012bd44:
  piVar9 = local_58;
  iVar8 = (int)local_4c;
LAB_14012bd4c:
  if ((piVar9 != (int *)0x0) && (iVar8 != 0)) {
    memset(piVar9,0,(longlong)(iVar8 * 4));
  }
  operator_delete(piVar9);
  return iVar6;
}



int FUN_14012bd90(undefined8 param_1,longlong param_2,longlong param_3)

{
  void *pvVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  int iVar5;
  bool bVar6;
  undefined8 uVar7;
  undefined **local_40;
  void *local_38;
  int local_30;
  undefined8 local_2c;
  
  uVar7 = 0xfffffffffffffffe;
  local_40 = mp_int::vftable;
  local_38 = operator_new(0x80);
  memset(local_38,0,0x80);
  local_30 = 0;
  local_2c = 0x20;
  if (*(int *)(param_2 + 0x10) == 0) {
    iVar5 = 0;
  }
  else {
    iVar5 = *(int *)(param_2 + 0x10) * 0x1c + -0x1c;
    for (uVar3 = *(uint *)(*(longlong *)(param_2 + 8) + -4 + (longlong)*(int *)(param_2 + 0x10) * 4)
        ; uVar3 != 0; uVar3 = uVar3 >> 1) {
      iVar5 = iVar5 + 1;
    }
  }
  iVar2 = FUN_14011fbb0(param_1,iVar5,&local_40,param_1,uVar7);
  while (iVar2 == 0) {
    local_2c._4_4_ = (int)((ulonglong)local_2c >> 0x20);
    bVar6 = local_2c._4_4_ != *(int *)(param_3 + 0x18);
    iVar2 = *(int *)(param_3 + 0x10);
    iVar4 = iVar2;
    if (local_30 < iVar2) {
      iVar4 = local_30;
    }
    if (iVar4 < DAT_140309908) {
      iVar4 = iVar2;
      if (local_30 < iVar2) {
        iVar4 = local_30;
      }
      if (iVar4 < DAT_140309900) {
        if (iVar2 + 1 + local_30 < 0x200) {
          if (local_30 < iVar2) {
            iVar2 = local_30;
          }
          if (iVar2 < 0x101) {
            iVar2 = FUN_14011ea80(&local_40,param_3,&local_40);
            goto LAB_14012bede;
          }
        }
        iVar2 = FUN_14011f140(&local_40,param_3,&local_40);
      }
      else {
        iVar2 = FUN_140120060(&local_40,param_3,&local_40);
      }
    }
    else {
      iVar2 = FUN_1401231a0(&local_40,param_3,&local_40);
    }
LAB_14012bede:
    uVar3 = 0;
    if (0 < local_30) {
      uVar3 = (uint)bVar6;
    }
    local_2c = CONCAT44(uVar3,(int)local_2c);
    if (((iVar2 != 0) || (iVar2 = FUN_14011efe0(param_1,&local_40,param_1), iVar2 != 0)) ||
       (iVar4 = FUN_14011e090(param_1), iVar4 == -1)) break;
    FUN_14011fa20(param_1,param_2,param_1);
    iVar2 = FUN_14011fbb0(param_1,iVar5,&local_40,param_1);
  }
  pvVar1 = local_38;
  if ((local_38 != (void *)0x0) && ((int)local_2c != 0)) {
    memset(local_38,0,(longlong)((int)local_2c << 2));
  }
  operator_delete(pvVar1);
  return iVar2;
}



void FUN_14012bf90(longlong param_1,longlong param_2)

{
  int iVar1;
  
  iVar1 = *(int *)(param_1 + 0x10);
  if (DAT_14030990c <= iVar1) {
    FUN_140126e70();
    *(undefined4 *)(param_2 + 0x18) = 0;
    return;
  }
  if (DAT_140309904 <= iVar1) {
    FUN_1401217d0();
    *(undefined4 *)(param_2 + 0x18) = 0;
    return;
  }
  if ((iVar1 * 2 + 1 < 0x200) && (iVar1 < 0x80)) {
    FUN_14011ede0();
    *(undefined4 *)(param_2 + 0x18) = 0;
    return;
  }
  FUN_14011f720();
  *(undefined4 *)(param_2 + 0x18) = 0;
  return;
}



int FUN_14012c010(longlong param_1,undefined ***param_2,longlong param_3)

{
  uint uVar1;
  uint uVar2;
  undefined4 uVar3;
  int iVar4;
  void *pvVar5;
  byte *pbVar6;
  byte *pbVar7;
  uint *puVar8;
  undefined4 *puVar9;
  undefined ***pppuVar10;
  undefined ***pppuVar11;
  int iVar12;
  ulonglong uVar13;
  ulonglong uVar14;
  longlong lVar15;
  int iVar16;
  size_t _Size;
  undefined **ppuVar17;
  uint uVar18;
  uint uVar19;
  uint uVar20;
  byte *_Dst;
  bool bVar21;
  int local_res20;
  uint local_128;
  undefined **local_120;
  byte *local_118;
  uint local_110;
  undefined8 local_10c;
  undefined **local_100;
  uint *local_f8;
  uint local_f0;
  undefined8 local_ec;
  undefined **local_e0;
  byte *local_d8;
  uint local_d0;
  undefined8 local_cc;
  undefined **local_c0;
  byte *local_b8;
  int local_b0;
  undefined8 local_ac;
  int local_a0;
  undefined **local_98;
  undefined4 *local_90;
  uint local_88;
  undefined8 local_84;
  undefined **local_78;
  void *local_70;
  uint local_68;
  undefined8 local_64;
  undefined8 local_58;
  
  local_58 = 0xfffffffffffffffe;
  local_98 = mp_int::vftable;
  local_90 = operator_new(0x80);
  memset(local_90,0,0x80);
  iVar16 = 0;
  local_128 = 0;
  local_88 = 0;
  iVar4 = 0x20;
  local_84 = 0x20;
  local_78 = mp_int::vftable;
  pvVar5 = operator_new(0x80);
  local_70 = pvVar5;
  memset(pvVar5,0,0x80);
  local_68 = 0;
  local_64 = 0x20;
  local_e0 = mp_int::vftable;
  local_d8 = operator_new(0x80);
  memset(local_d8,0,0x80);
  local_d0 = 0;
  local_cc = 0x20;
  local_100 = mp_int::vftable;
  local_f8 = operator_new(0x80);
  memset(local_f8,0,0x80);
  local_f0 = 0;
  local_ec = 0x20;
  local_c0 = mp_int::vftable;
  pbVar6 = operator_new(0x80);
  local_b8 = pbVar6;
  memset(pbVar6,0,0x80);
  local_b0 = 0;
  local_ac = 0x20;
  local_120 = mp_int::vftable;
  pbVar7 = operator_new(0x80);
  local_118 = pbVar7;
  memset(pbVar7,0,0x80);
  local_110 = 0;
  local_10c = 0x20;
  if ((*(int *)(param_2 + 2) < 1) || (((ulonglong)*param_2[1] & 1) != 0)) {
    if (param_2 != &local_98) {
      if (*(int *)(param_2 + 2) < 0x21) {
        uVar18 = 0;
        iVar4 = 0x20;
      }
      else {
        FUN_14011d8c0(&local_98);
        uVar18 = local_88;
        iVar4 = (int)local_84;
      }
      ppuVar17 = param_2[1];
      iVar12 = 0;
      puVar9 = local_90;
      if (0 < *(int *)(param_2 + 2)) {
        do {
          *puVar9 = *(undefined4 *)ppuVar17;
          puVar9 = puVar9 + 1;
          ppuVar17 = (undefined **)((longlong)ppuVar17 + 4);
          iVar12 = iVar12 + 1;
        } while (iVar12 < *(int *)(param_2 + 2));
      }
      if (iVar12 < (int)uVar18) {
        memset(puVar9,0,(ulonglong)(uVar18 - iVar12) << 2);
      }
      local_128 = *(uint *)(param_2 + 2);
      local_84 = CONCAT44(*(undefined4 *)(param_2 + 3),(int)local_84);
      local_88 = local_128;
    }
    iVar12 = FUN_14012b4b0(param_1,param_2,&local_78);
    pbVar7 = local_118;
    if (iVar12 != 0) {
      if (local_118 != (byte *)0x0) {
        memset(local_118,0,0x80);
      }
      operator_delete(pbVar7);
      if (pbVar6 != (byte *)0x0) {
        memset(pbVar6,0,0x80);
      }
      operator_delete(pbVar6);
      puVar8 = local_f8;
      if (local_f8 != (uint *)0x0) {
        memset(local_f8,0,0x80);
      }
      operator_delete(puVar8);
      pbVar6 = local_d8;
      if (local_d8 != (byte *)0x0) {
        memset(local_d8,0,0x80);
      }
      operator_delete(pbVar6);
      pvVar5 = local_70;
      if ((local_70 != (void *)0x0) && ((int)local_64 != 0)) {
        memset(local_70,0,(longlong)((int)local_64 << 2));
      }
      operator_delete(pvVar5);
      puVar9 = local_90;
      if ((local_90 != (undefined4 *)0x0) && (iVar4 != 0)) {
        iVar4 = iVar4 * 4;
LAB_14012d4cb:
        puVar9 = local_90;
        memset(local_90,0,(longlong)iVar4);
      }
LAB_14012d4d8:
      operator_delete(puVar9);
      return iVar12;
    }
    uVar18 = 0;
    if (0x20 < (int)local_128) {
      FUN_14011d8c0(&local_e0);
      uVar18 = local_d0;
    }
    pbVar7 = local_d8;
    uVar19 = 0;
    if (0 < (int)local_128) {
      uVar13 = (ulonglong)local_128;
      do {
        *(undefined4 *)pbVar7 = *(undefined4 *)(pbVar7 + ((longlong)local_90 - (longlong)local_d8));
        pbVar7 = pbVar7 + 4;
        uVar13 = uVar13 - 1;
        uVar19 = local_128;
      } while (uVar13 != 0);
    }
    if ((int)uVar19 < (int)uVar18) {
      memset(pbVar7,0,(ulonglong)(uVar18 - uVar19) << 2);
    }
    uVar18 = local_68;
    local_a0 = local_84._4_4_;
    local_cc = CONCAT44(local_84._4_4_,(int)local_cc);
    uVar13 = (ulonglong)local_68;
    uVar19 = 0;
    local_d0 = local_128;
    if (0x20 < (int)local_68) {
      FUN_14011d8c0(&local_100);
      uVar19 = local_f0;
    }
    puVar8 = local_f8;
    uVar20 = 0;
    if (0 < (int)uVar18) {
      uVar14 = uVar13;
      do {
        *puVar8 = *(uint *)(((longlong)local_70 - (longlong)local_f8) + (longlong)puVar8);
        puVar8 = puVar8 + 1;
        uVar14 = uVar14 - 1;
        uVar20 = uVar18;
      } while (uVar14 != 0);
    }
    if ((int)uVar20 < (int)uVar19) {
      memset(puVar8,0,(ulonglong)(uVar19 - uVar20) << 2);
    }
    pbVar7 = local_118;
    local_f0 = uVar18;
    local_res20 = local_64._4_4_;
    local_ec = CONCAT44(local_64._4_4_,(int)local_ec);
    local_10c = local_10c & 0xffffffff;
    memset(local_118,0,0x80);
    pbVar7[0] = 1;
    pbVar7[1] = 0;
    pbVar7[2] = 0;
    pbVar7[3] = 0;
    local_110 = (uint)(*(int *)pbVar7 != 0);
    _Dst = local_d8;
    uVar19 = local_128;
    uVar18 = local_110;
LAB_14012c4c6:
    while ((0 < (int)uVar19 && ((*_Dst & 1) == 0))) {
      if ((int)local_cc < (int)uVar19) {
        FUN_14011d8c0(&local_e0,uVar19);
        _Dst = local_d8;
        local_a0 = local_cc._4_4_;
        uVar19 = local_d0;
      }
      puVar8 = (uint *)(_Dst + (longlong)(int)uVar19 * 4 + -4);
      uVar2 = 0;
      uVar20 = uVar19;
      while (uVar20 = uVar20 - 1, -1 < (int)uVar20) {
        uVar1 = *puVar8;
        *puVar8 = uVar1 >> 1 | uVar2 << 0x1b;
        puVar8 = puVar8 + -1;
        uVar2 = uVar1 & 1;
      }
      while ((0 < (int)uVar19 &&
             (local_d0 = uVar19, *(int *)(_Dst + (longlong)(int)uVar19 * 4 + -4) == 0))) {
        local_d0 = uVar19 - 1;
        uVar19 = local_d0;
      }
      if (uVar19 == 0) {
        local_a0 = 0;
      }
      local_cc = CONCAT44(local_a0,(int)local_cc);
      if ((0 < iVar16) && ((*pbVar6 & 1) != 0)) {
        if (local_ac._4_4_ == local_84._4_4_) {
          if ((int)local_128 < iVar16) {
LAB_14012c611:
            pppuVar11 = &local_98;
            pppuVar10 = &local_c0;
          }
          else {
            if ((int)local_128 <= iVar16) {
              lVar15 = (longlong)(iVar16 + -1) * 4;
              puVar8 = (uint *)(pbVar6 + lVar15);
              iVar4 = 0;
              if (0 < iVar16) {
                lVar15 = lVar15 - (longlong)puVar8;
                do {
                  uVar20 = *(uint *)((longlong)puVar8 + lVar15 + (longlong)local_90);
                  uVar2 = *puVar8;
                  if (uVar2 >= uVar20 && uVar2 != uVar20) break;
                  if (uVar2 < uVar20) goto LAB_14012c5fc;
                  iVar4 = iVar4 + 1;
                  puVar8 = puVar8 + -1;
                } while (iVar4 < iVar16);
              }
              goto LAB_14012c611;
            }
LAB_14012c5fc:
            local_ac = (ulonglong)CONCAT14(local_ac._4_4_ == 0,(int)local_ac);
            pppuVar11 = &local_c0;
            pppuVar10 = &local_98;
          }
          iVar12 = FUN_14011fa20(pppuVar10,pppuVar11,&local_c0);
        }
        else {
          iVar12 = FUN_14011efe0(&local_c0,&local_98,&local_c0);
          local_128 = local_88;
        }
        pbVar6 = local_b8;
        iVar16 = local_b0;
        if (iVar12 != 0) {
          if ((pbVar7 != (byte *)0x0) && ((int)local_10c != 0)) {
            memset(pbVar7,0,(longlong)((int)local_10c << 2));
          }
          operator_delete(pbVar7);
          pbVar6 = local_b8;
          if ((local_b8 != (byte *)0x0) && ((int)local_ac != 0)) {
            memset(local_b8,0,(longlong)((int)local_ac << 2));
          }
          operator_delete(pbVar6);
          puVar8 = local_f8;
          if ((local_f8 != (uint *)0x0) && ((int)local_ec != 0)) {
            memset(local_f8,0,(longlong)((int)local_ec << 2));
          }
          operator_delete(puVar8);
          if ((_Dst != (byte *)0x0) && ((int)local_cc != 0)) {
            memset(_Dst,0,(longlong)((int)local_cc << 2));
          }
          operator_delete(_Dst);
          pvVar5 = local_70;
          if ((local_70 != (void *)0x0) && ((int)local_64 != 0)) {
            memset(local_70,0,(longlong)((int)local_64 << 2));
          }
          operator_delete(pvVar5);
          goto LAB_14012cd00;
        }
      }
      if ((int)local_ac < iVar16) {
        FUN_14011d8c0(&local_c0,iVar16);
        pbVar6 = local_b8;
        iVar16 = local_b0;
      }
      puVar8 = (uint *)(pbVar6 + (longlong)iVar16 * 4 + -4);
      uVar20 = 0;
      iVar4 = iVar16;
      while (iVar4 = iVar4 + -1, -1 < iVar4) {
        uVar2 = *puVar8;
        *puVar8 = uVar20 << 0x1b | uVar2 >> 1;
        puVar8 = puVar8 + -1;
        uVar20 = uVar2 & 1;
      }
      while ((0 < iVar16 && (local_b0 = iVar16, *(int *)(pbVar6 + (longlong)iVar16 * 4 + -4) == 0)))
      {
        iVar16 = iVar16 + -1;
        local_b0 = iVar16;
      }
      if (iVar16 == 0) {
        local_ac = local_ac & 0xffffffff;
      }
    }
    while( true ) {
      iVar4 = (int)uVar13;
      if ((iVar4 < 1) || ((*local_f8 & 1) != 0)) break;
      if ((int)local_ec < iVar4) {
        FUN_14011d8c0(&local_100,uVar13);
        uVar13 = (ulonglong)local_f0;
        local_res20 = local_ec._4_4_;
      }
      iVar12 = (int)uVar13;
      puVar8 = local_f8 + (longlong)iVar12 + -1;
      uVar20 = 0;
      iVar4 = iVar12;
      while (iVar4 = iVar4 + -1, -1 < iVar4) {
        uVar2 = *puVar8;
        *puVar8 = uVar20 << 0x1b | uVar2 >> 1;
        puVar8 = puVar8 + -1;
        uVar20 = uVar2 & 1;
      }
      if (0 < iVar12) {
        do {
          if (local_f8[(longlong)(int)uVar13 + -1] != 0) break;
          local_f0 = (int)uVar13 - 1;
          uVar13 = (ulonglong)local_f0;
        } while (0 < (int)local_f0);
        iVar12 = (int)uVar13;
      }
      if (iVar12 == 0) {
        local_res20 = 0;
      }
      local_ec = CONCAT44(local_res20,(int)local_ec);
      if ((0 < (int)uVar18) && ((*pbVar7 & 1) != 0)) {
        if (local_10c._4_4_ == local_84._4_4_) {
          if ((int)local_128 < (int)uVar18) {
LAB_14012c813:
            pppuVar10 = &local_98;
            pppuVar11 = &local_120;
          }
          else {
            if ((int)local_128 <= (int)uVar18) {
              lVar15 = (longlong)(int)(uVar18 - 1) * 4;
              puVar8 = (uint *)(pbVar7 + lVar15);
              iVar4 = 0;
              if (0 < (int)uVar18) {
                lVar15 = lVar15 - (longlong)puVar8;
                do {
                  uVar20 = *(uint *)((longlong)puVar8 + lVar15 + (longlong)local_90);
                  uVar2 = *puVar8;
                  if (uVar2 >= uVar20 && uVar2 != uVar20) break;
                  if (uVar2 < uVar20) goto LAB_14012c7fc;
                  iVar4 = iVar4 + 1;
                  puVar8 = puVar8 + -1;
                } while (iVar4 < (int)uVar18);
              }
              goto LAB_14012c813;
            }
LAB_14012c7fc:
            local_10c = (ulonglong)CONCAT14(local_10c._4_4_ == 0,(int)local_10c);
            pppuVar10 = &local_120;
            pppuVar11 = &local_98;
          }
          iVar4 = FUN_14011fa20(pppuVar11,pppuVar10,&local_120);
        }
        else {
          iVar4 = FUN_14011efe0(&local_120,&local_98,&local_120);
          local_128 = local_88;
        }
        pbVar7 = local_118;
        uVar18 = local_110;
        if (iVar4 != 0) {
          if ((local_118 != (byte *)0x0) && ((int)local_10c != 0)) {
            memset(local_118,0,(longlong)((int)local_10c << 2));
          }
          operator_delete(pbVar7);
          if ((pbVar6 != (byte *)0x0) && ((int)local_ac != 0)) {
            memset(pbVar6,0,(longlong)((int)local_ac << 2));
          }
          operator_delete(pbVar6);
          puVar8 = local_f8;
          if ((local_f8 != (uint *)0x0) && ((int)local_ec != 0)) {
            memset(local_f8,0,(longlong)((int)local_ec << 2));
          }
          operator_delete(puVar8);
          if ((_Dst != (byte *)0x0) && ((int)local_cc != 0)) {
            memset(_Dst,0,(longlong)((int)local_cc << 2));
          }
          operator_delete(_Dst);
          pvVar5 = local_70;
          if ((local_70 != (void *)0x0) && ((int)local_64 != 0)) {
            memset(local_70,0,(longlong)((int)local_64 << 2));
          }
          operator_delete(pvVar5);
          goto LAB_14012cdf9;
        }
      }
      if ((int)local_10c < (int)uVar18) {
        FUN_14011d8c0(&local_120,uVar18);
        pbVar7 = local_118;
        uVar18 = local_110;
      }
      puVar8 = (uint *)(pbVar7 + (longlong)(int)uVar18 * 4 + -4);
      uVar2 = 0;
      uVar20 = uVar18;
      while (uVar20 = uVar20 - 1, -1 < (int)uVar20) {
        uVar1 = *puVar8;
        *puVar8 = uVar2 << 0x1b | uVar1 >> 1;
        puVar8 = puVar8 + -1;
        uVar2 = uVar1 & 1;
      }
      while ((0 < (int)uVar18 && (*(int *)(pbVar7 + (longlong)(int)uVar18 * 4 + -4) == 0))) {
        local_110 = uVar18 - 1;
        uVar18 = local_110;
      }
      if (uVar18 == 0) {
        local_10c = local_10c & 0xffffffff;
      }
    }
    if (local_a0 == local_res20) {
      if (local_a0 == 1) {
        if ((int)uVar19 < iVar4) {
          iVar12 = 1;
        }
        else {
          if ((int)uVar19 <= iVar4) {
            puVar8 = local_f8 + (iVar4 + -1);
            iVar12 = 0;
            if (0 < iVar4) {
              lVar15 = (longlong)(iVar4 + -1) * 4 - (longlong)puVar8;
              do {
                uVar20 = *(uint *)(_Dst + lVar15 + (longlong)puVar8);
                uVar2 = *puVar8;
                if (uVar2 >= uVar20 && uVar2 != uVar20) goto LAB_14012c923;
                if (uVar2 < uVar20) goto LAB_14012c91e;
                iVar12 = iVar12 + 1;
                puVar8 = puVar8 + -1;
              } while (iVar12 < iVar4);
            }
            goto LAB_14012c979;
          }
          iVar12 = -1;
        }
      }
      else if (iVar4 < (int)uVar19) {
        iVar12 = 1;
      }
      else if ((int)uVar19 < iVar4) {
        iVar12 = -1;
      }
      else {
        puVar8 = (uint *)(_Dst + (longlong)(int)(uVar19 - 1) * 4);
        iVar12 = 0;
        if (0 < (int)uVar19) {
          lVar15 = (longlong)(int)(uVar19 - 1) * 4 - (longlong)puVar8;
          do {
            uVar20 = *(uint *)((byte *)((longlong)local_f8 + lVar15) + (longlong)puVar8);
            uVar2 = *puVar8;
            if (uVar2 >= uVar20 && uVar2 != uVar20) goto LAB_14012c923;
            if (uVar2 < uVar20) goto LAB_14012c91e;
            iVar12 = iVar12 + 1;
            puVar8 = puVar8 + -1;
          } while (iVar12 < (int)uVar19);
        }
LAB_14012c979:
        iVar12 = 0;
      }
      goto LAB_14012c97e;
    }
    bVar21 = local_a0 == 1;
    goto LAB_14012c981;
  }
  if (pbVar7 != (byte *)0x0) {
    memset(pbVar7,0,0x80);
  }
  operator_delete(pbVar7);
  if (pbVar6 != (byte *)0x0) {
    memset(pbVar6,0,0x80);
  }
  operator_delete(pbVar6);
  puVar8 = local_f8;
  if (local_f8 != (uint *)0x0) {
    memset(local_f8,0,0x80);
  }
  operator_delete(puVar8);
  pbVar6 = local_d8;
  if (local_d8 != (byte *)0x0) {
    memset(local_d8,0,0x80);
  }
  operator_delete(pbVar6);
  if (pvVar5 != (void *)0x0) {
    memset(pvVar5,0,0x80);
  }
  operator_delete(pvVar5);
  puVar9 = local_90;
  if (local_90 == (undefined4 *)0x0) goto LAB_14012c22c;
  _Size = 0x80;
LAB_14012c222:
  puVar9 = local_90;
  memset(local_90,0,_Size);
LAB_14012c22c:
  operator_delete(puVar9);
  return -3;
LAB_14012c923:
  iVar12 = 1;
  goto LAB_14012c97e;
LAB_14012c91e:
  iVar12 = -1;
LAB_14012c97e:
  bVar21 = iVar12 == -1;
LAB_14012c981:
  if (bVar21) {
    if (local_res20 == local_a0) {
      if ((int)uVar19 < iVar4) {
LAB_14012cb54:
        pppuVar11 = &local_e0;
        pppuVar10 = &local_100;
      }
      else {
        if ((int)uVar19 <= iVar4) {
          puVar8 = local_f8 + (iVar4 + -1);
          iVar12 = 0;
          if (0 < iVar4) {
            lVar15 = (longlong)(iVar4 + -1) * 4 - (longlong)puVar8;
            do {
              uVar20 = *(uint *)(_Dst + lVar15 + (longlong)puVar8);
              uVar2 = *puVar8;
              if (uVar2 >= uVar20 && uVar2 != uVar20) break;
              if (uVar2 < uVar20) goto LAB_14012cb3d;
              iVar12 = iVar12 + 1;
              puVar8 = puVar8 + -1;
            } while (iVar12 < iVar4);
          }
          goto LAB_14012cb54;
        }
LAB_14012cb3d:
        local_ec = (ulonglong)CONCAT14(local_res20 == 0,(int)local_ec);
        pppuVar11 = &local_100;
        pppuVar10 = &local_e0;
      }
      iVar12 = FUN_14011fa20(pppuVar10,pppuVar11,&local_100);
    }
    else {
      iVar12 = FUN_14011efe0(&local_100,&local_e0,&local_100);
      local_a0 = local_cc._4_4_;
      uVar19 = local_d0;
    }
    if (iVar12 != 0) {
      if ((pbVar7 != (byte *)0x0) && ((int)local_10c != 0)) {
        memset(pbVar7,0,(longlong)((int)local_10c << 2));
      }
      operator_delete(pbVar7);
      if ((pbVar6 != (byte *)0x0) && ((int)local_ac != 0)) {
        memset(pbVar6,0,(longlong)((int)local_ac << 2));
      }
      operator_delete(pbVar6);
      puVar8 = local_f8;
      if ((local_f8 != (uint *)0x0) && ((int)local_ec != 0)) {
        memset(local_f8,0,(longlong)((int)local_ec << 2));
      }
      operator_delete(puVar8);
      pbVar6 = local_d8;
      if ((local_d8 != (byte *)0x0) && ((int)local_cc != 0)) {
        memset(local_d8,0,(longlong)((int)local_cc << 2));
      }
      operator_delete(pbVar6);
      pvVar5 = local_70;
      if ((local_70 != (void *)0x0) && ((int)local_64 != 0)) {
        memset(local_70,0,(longlong)((int)local_64 << 2));
      }
      operator_delete(pvVar5);
      puVar9 = local_90;
      if ((local_90 == (undefined4 *)0x0) || ((int)local_84 == 0)) goto LAB_14012d4d8;
      iVar4 = (int)local_84 << 2;
      goto LAB_14012d4cb;
    }
    if (local_10c._4_4_ == local_ac._4_4_) {
      if (iVar16 < (int)uVar18) {
LAB_14012cbf1:
        pppuVar10 = &local_c0;
        pppuVar11 = &local_120;
      }
      else {
        if (iVar16 <= (int)uVar18) {
          puVar8 = (uint *)(pbVar7 + (longlong)(int)(uVar18 - 1) * 4);
          iVar4 = 0;
          if (0 < (int)uVar18) {
            lVar15 = (longlong)(int)(uVar18 - 1) * 4 - (longlong)puVar8;
            do {
              uVar20 = *(uint *)(pbVar6 + lVar15 + (longlong)puVar8);
              uVar2 = *puVar8;
              if (uVar2 >= uVar20 && uVar2 != uVar20) break;
              if (uVar2 < uVar20) goto LAB_14012cbda;
              iVar4 = iVar4 + 1;
              puVar8 = puVar8 + -1;
            } while (iVar4 < (int)uVar18);
          }
          goto LAB_14012cbf1;
        }
LAB_14012cbda:
        local_10c = (ulonglong)CONCAT14(local_10c._4_4_ == 0,(int)local_10c);
        pppuVar10 = &local_120;
        pppuVar11 = &local_c0;
      }
      iVar4 = FUN_14011fa20(pppuVar11,pppuVar10,&local_120);
    }
    else {
      iVar4 = FUN_14011efe0(&local_120,&local_c0,&local_120);
      pbVar6 = local_b8;
      iVar16 = local_b0;
    }
    pbVar7 = local_118;
    if (iVar4 != 0) {
      if ((local_118 != (byte *)0x0) && ((int)local_10c != 0)) {
        memset(local_118,0,(longlong)((int)local_10c << 2));
      }
      operator_delete(pbVar7);
      if ((pbVar6 != (byte *)0x0) && ((int)local_ac != 0)) {
        memset(pbVar6,0,(longlong)((int)local_ac << 2));
      }
      operator_delete(pbVar6);
      puVar8 = local_f8;
      if ((local_f8 != (uint *)0x0) && ((int)local_ec != 0)) {
        memset(local_f8,0,(longlong)((int)local_ec << 2));
      }
      operator_delete(puVar8);
      pbVar6 = local_d8;
      if ((local_d8 != (byte *)0x0) && ((int)local_cc != 0)) {
        memset(local_d8,0,(longlong)((int)local_cc << 2));
      }
      operator_delete(pbVar6);
      pvVar5 = local_70;
      if ((local_70 != (void *)0x0) && ((int)local_64 != 0)) {
        memset(local_70,0,(longlong)((int)local_64 << 2));
      }
      operator_delete(pvVar5);
      goto LAB_14012cdf9;
    }
    local_res20 = local_ec._4_4_;
    uVar13 = (ulonglong)local_f0;
    iVar4 = local_10c._4_4_;
    uVar18 = local_110;
    goto LAB_14012cc22;
  }
  if (local_a0 == local_res20) {
    if (iVar4 < (int)uVar19) {
LAB_14012ca03:
      pppuVar11 = &local_100;
      pppuVar10 = &local_e0;
    }
    else {
      if (iVar4 <= (int)uVar19) {
        puVar8 = (uint *)(_Dst + (longlong)(int)(uVar19 - 1) * 4);
        iVar4 = 0;
        if (0 < (int)uVar19) {
          lVar15 = (longlong)(int)(uVar19 - 1) * 4 - (longlong)puVar8;
          do {
            uVar20 = *(uint *)((byte *)((longlong)local_f8 + lVar15) + (longlong)puVar8);
            uVar2 = *puVar8;
            if (uVar2 >= uVar20 && uVar2 != uVar20) break;
            if (uVar2 < uVar20) goto LAB_14012c9ec;
            iVar4 = iVar4 + 1;
            puVar8 = puVar8 + -1;
          } while (iVar4 < (int)uVar19);
        }
        goto LAB_14012ca03;
      }
LAB_14012c9ec:
      local_cc = (ulonglong)CONCAT14(local_a0 == 0,(int)local_cc);
      pppuVar11 = &local_e0;
      pppuVar10 = &local_100;
    }
    iVar4 = FUN_14011fa20(pppuVar10,pppuVar11,&local_e0);
  }
  else {
    iVar4 = FUN_14011efe0(&local_e0,&local_100,&local_e0);
    local_res20 = local_ec._4_4_;
    uVar13 = (ulonglong)local_f0;
  }
  if (iVar4 != 0) {
    if ((pbVar7 != (byte *)0x0) && ((int)local_10c != 0)) {
      memset(pbVar7,0,(longlong)((int)local_10c << 2));
    }
    operator_delete(pbVar7);
    if ((pbVar6 != (byte *)0x0) && ((int)local_ac != 0)) {
      memset(pbVar6,0,(longlong)((int)local_ac << 2));
    }
    operator_delete(pbVar6);
    puVar8 = local_f8;
    if ((local_f8 != (uint *)0x0) && ((int)local_ec != 0)) {
      memset(local_f8,0,(longlong)((int)local_ec << 2));
    }
    operator_delete(puVar8);
    pbVar6 = local_d8;
    if ((local_d8 != (byte *)0x0) && ((int)local_cc != 0)) {
      memset(local_d8,0,(longlong)((int)local_cc << 2));
    }
    operator_delete(pbVar6);
    pvVar5 = local_70;
    if ((local_70 != (void *)0x0) && ((int)local_64 != 0)) {
      memset(local_70,0,(longlong)((int)local_64 << 2));
    }
    operator_delete(pvVar5);
    puVar9 = local_90;
    if ((local_90 != (undefined4 *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(puVar9);
    return iVar4;
  }
  iVar4 = local_10c._4_4_;
  if (local_ac._4_4_ == local_10c._4_4_) {
    if ((int)uVar18 < iVar16) {
LAB_14012caa1:
      pppuVar11 = &local_120;
      pppuVar10 = &local_c0;
    }
    else {
      if ((int)uVar18 <= iVar16) {
        puVar8 = (uint *)(pbVar6 + (longlong)(iVar16 + -1) * 4);
        iVar12 = 0;
        if (0 < iVar16) {
          lVar15 = (longlong)(iVar16 + -1) * 4 - (longlong)puVar8;
          do {
            uVar19 = *(uint *)(pbVar7 + lVar15 + (longlong)puVar8);
            uVar20 = *puVar8;
            if (uVar20 >= uVar19 && uVar20 != uVar19) break;
            if (uVar20 < uVar19) goto LAB_14012ca8b;
            iVar12 = iVar12 + 1;
            puVar8 = puVar8 + -1;
          } while (iVar12 < iVar16);
        }
        goto LAB_14012caa1;
      }
LAB_14012ca8b:
      local_ac = (ulonglong)CONCAT14(local_ac._4_4_ == 0,(int)local_ac);
      pppuVar11 = &local_c0;
      pppuVar10 = &local_120;
    }
    iVar12 = FUN_14011fa20(pppuVar10,pppuVar11,&local_c0);
  }
  else {
    iVar12 = FUN_14011efe0(&local_c0,&local_120,&local_c0);
    pbVar7 = local_118;
    iVar4 = local_10c._4_4_;
    uVar18 = local_110;
  }
  if (iVar12 != 0) {
    if ((pbVar7 != (byte *)0x0) && ((int)local_10c != 0)) {
      memset(pbVar7,0,(longlong)((int)local_10c << 2));
    }
    operator_delete(pbVar7);
    pbVar6 = local_b8;
    if ((local_b8 != (byte *)0x0) && ((int)local_ac != 0)) {
      memset(local_b8,0,(longlong)((int)local_ac << 2));
    }
    operator_delete(pbVar6);
    puVar8 = local_f8;
    if ((local_f8 != (uint *)0x0) && ((int)local_ec != 0)) {
      memset(local_f8,0,(longlong)((int)local_ec << 2));
    }
    operator_delete(puVar8);
    pbVar6 = local_d8;
    if ((local_d8 != (byte *)0x0) && ((int)local_cc != 0)) {
      memset(local_d8,0,(longlong)((int)local_cc << 2));
    }
    operator_delete(pbVar6);
    pvVar5 = local_70;
    if ((local_70 != (void *)0x0) && ((int)local_64 != 0)) {
      memset(local_70,0,(longlong)((int)local_64 << 2));
    }
    operator_delete(pvVar5);
LAB_14012cd00:
    puVar9 = local_90;
    if ((local_90 != (undefined4 *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(puVar9);
    return iVar12;
  }
  local_a0 = local_cc._4_4_;
  pbVar6 = local_b8;
  iVar16 = local_b0;
  uVar19 = local_d0;
LAB_14012cc22:
  puVar8 = local_f8;
  pbVar7 = local_118;
  _Dst = local_d8;
  if (uVar19 == 0) goto LAB_14012cff5;
  goto LAB_14012c4c6;
LAB_14012cff5:
  if ((((local_res20 != 1) && ((int)uVar13 < 2)) && (*local_f8 < 2)) && (*local_f8 != 0)) {
    uVar3 = *(undefined4 *)(param_1 + 0x18);
    while( true ) {
      if (iVar4 != 1) {
        FUN_14011da60(&local_120);
        pbVar7 = local_118;
        *(undefined4 *)(param_3 + 0x18) = uVar3;
        if ((local_118 != (byte *)0x0) && ((int)local_10c != 0)) {
          memset(local_118,0,(longlong)((int)local_10c << 2));
        }
        operator_delete(pbVar7);
        if ((pbVar6 != (byte *)0x0) && ((int)local_ac != 0)) {
          memset(pbVar6,0,(longlong)((int)local_ac << 2));
        }
        operator_delete(pbVar6);
        if ((int)local_ec != 0) {
          memset(puVar8,0,(longlong)((int)local_ec << 2));
        }
        operator_delete(puVar8);
        pbVar6 = local_d8;
        if ((local_d8 != (byte *)0x0) && ((int)local_cc != 0)) {
          memset(local_d8,0,(longlong)((int)local_cc << 2));
        }
        operator_delete(pbVar6);
        pvVar5 = local_70;
        if ((local_70 != (void *)0x0) && ((int)local_64 != 0)) {
          memset(local_70,0,(longlong)((int)local_64 << 2));
        }
        operator_delete(pvVar5);
        puVar9 = local_90;
        if ((local_90 != (undefined4 *)0x0) && ((int)local_84 != 0)) {
          memset(local_90,0,(longlong)((int)local_84 << 2));
        }
        operator_delete(puVar9);
        return 0;
      }
      iVar4 = FUN_14011fe40(&local_120,param_2,&local_120);
      pbVar7 = local_118;
      if (iVar4 != 0) break;
      iVar4 = local_10c._4_4_;
    }
    if ((local_118 != (byte *)0x0) && ((int)local_10c != 0)) {
      memset(local_118,0,(longlong)((int)local_10c << 2));
    }
    operator_delete(pbVar7);
    if ((pbVar6 != (byte *)0x0) && ((int)local_ac != 0)) {
      memset(pbVar6,0,(longlong)((int)local_ac << 2));
    }
    operator_delete(pbVar6);
    if ((int)local_ec != 0) {
      memset(puVar8,0,(longlong)((int)local_ec << 2));
    }
    operator_delete(puVar8);
    pbVar6 = local_d8;
    if ((local_d8 != (byte *)0x0) && ((int)local_cc != 0)) {
      memset(local_d8,0,(longlong)((int)local_cc << 2));
    }
    operator_delete(pbVar6);
    pvVar5 = local_70;
    if ((local_70 != (void *)0x0) && ((int)local_64 != 0)) {
      memset(local_70,0,(longlong)((int)local_64 << 2));
    }
    operator_delete(pvVar5);
LAB_14012cdf9:
    puVar9 = local_90;
    if ((local_90 != (undefined4 *)0x0) && ((int)local_84 != 0)) {
      memset(local_90,0,(longlong)((int)local_84 << 2));
    }
    operator_delete(puVar9);
    return iVar4;
  }
  if ((local_118 != (byte *)0x0) && ((int)local_10c != 0)) {
    memset(local_118,0,(longlong)((int)local_10c << 2));
  }
  operator_delete(pbVar7);
  if ((pbVar6 != (byte *)0x0) && ((int)local_ac != 0)) {
    memset(pbVar6,0,(longlong)((int)local_ac << 2));
  }
  operator_delete(pbVar6);
  if ((puVar8 != (uint *)0x0) && ((int)local_ec != 0)) {
    memset(puVar8,0,(longlong)((int)local_ec << 2));
  }
  operator_delete(puVar8);
  pbVar6 = local_d8;
  if ((local_d8 != (byte *)0x0) && ((int)local_cc != 0)) {
    memset(local_d8,0,(longlong)((int)local_cc << 2));
  }
  operator_delete(pbVar6);
  pvVar5 = local_70;
  if ((local_70 != (void *)0x0) && ((int)local_64 != 0)) {
    memset(local_70,0,(longlong)((int)local_64 << 2));
  }
  operator_delete(pvVar5);
  puVar9 = local_90;
  if ((local_90 == (undefined4 *)0x0) || ((int)local_84 == 0)) goto LAB_14012c22c;
  _Size = (size_t)((int)local_84 << 2);
  goto LAB_14012c222;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_14012d500(undefined8 param_1,longlong param_2,longlong param_3,undefined8 param_4,
                 int param_5)

{
  undefined1 *puVar1;
  undefined1 auVar2 [16];
  ulonglong uVar3;
  longlong lVar4;
  undefined8 uVar5;
  undefined4 *puVar6;
  longlong lVar7;
  int *piVar8;
  void *pvVar9;
  __uint64 _Var10;
  longlong lVar11;
  int iVar12;
  uint uVar13;
  int iVar14;
  int iVar15;
  uint uVar16;
  uint uVar17;
  ulonglong uVar18;
  uint uVar19;
  int iVar20;
  uint uVar21;
  code *pcVar22;
  bool bVar23;
  undefined1 auStackY_2128 [32];
  undefined **local_20f8;
  int *local_20f0;
  uint local_20e8;
  undefined8 local_20e4;
  int local_20d8;
  undefined **local_20d0;
  undefined4 *local_20c8;
  int local_20c0;
  undefined8 local_20bc;
  longlong local_20b0;
  uint local_20a8;
  longlong local_20a0;
  longlong local_2098;
  undefined **local_2090;
  void *local_2088;
  uint local_2080;
  ulonglong local_207c;
  uint local_2070;
  undefined8 local_2068;
  undefined8 local_2060;
  undefined1 local_2058 [8];
  undefined8 uStack_2050;
  uint auStack_2048 [4];
  undefined1 local_2038 [8];
  undefined4 *local_2030;
  uint local_2028;
  uint local_2020;
  ulonglong local_58;
  undefined8 uStack_48;
  
  uStack_48 = 0x14012d51f;
  local_2060 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStackY_2128;
  local_20b0 = param_2;
  local_20a0 = param_3;
  local_2068 = param_4;
  _eh_vector_constructor_iterator_(local_2058,0x20,0x100,FUN_14011d870,FUN_14011d980);
  local_20f8 = mp_int::vftable;
  local_20f0 = operator_new(0x80);
  memset(local_20f0,0,0x80);
  local_20e8 = 0;
  local_20e4 = 0x20;
  local_20d0 = mp_int::vftable;
  local_20c8 = operator_new(0x80);
  memset(local_20c8,0,0x80);
  local_20c0 = 0;
  local_20bc = 0x20;
  if (*(int *)(param_2 + 0x10) == 0) {
LAB_14012d66c:
    uVar17 = 2;
  }
  else {
    iVar12 = *(int *)(param_2 + 0x10) * 0x1c + -0x1c;
    for (uVar17 = *(uint *)(*(longlong *)(param_2 + 8) + -4 + (longlong)*(int *)(param_2 + 0x10) * 4
                           ); uVar17 != 0; uVar17 = uVar17 >> 1) {
      iVar12 = iVar12 + 1;
    }
    if (iVar12 < 8) goto LAB_14012d66c;
    if (iVar12 < 0x25) {
      uVar17 = 3;
    }
    else if (iVar12 < 0x8d) {
      uVar17 = 4;
    }
    else if (iVar12 < 0x1c3) {
      uVar17 = 5;
    }
    else if (iVar12 < 0x518) {
      uVar17 = 6;
    }
    else {
      uVar17 = (0xdc9 < iVar12) + 7;
    }
  }
  if (param_5 == 0) {
    iVar14 = *(int *)(param_3 + 0x10) * 0x38;
    local_20bc = 0x20;
    local_20c0 = 0;
    iVar12 = 0;
    puVar6 = local_20c8;
    do {
      *puVar6 = 0;
      puVar6 = puVar6 + 1;
      iVar12 = iVar12 + 1;
    } while (iVar12 < 0x20);
    iVar12 = iVar14 / 0x1c;
    FUN_14011d8c0(&local_20d0,iVar12 + 1);
    local_20c8[iVar12] = 1 << ((char)iVar14 + (char)iVar12 * -0x1c & 0x1fU);
    local_20c0 = iVar12 + 1;
    iVar12 = FUN_14012a330(&local_20d0,param_3,&local_20d0);
    if (iVar12 != 0) goto LAB_14012deab;
    pcVar22 = FUN_14012b930;
  }
  else {
    iVar12 = FUN_140122da0(param_3);
    if (iVar12 != 0) goto LAB_14012deab;
    pcVar22 = FUN_14012bd90;
  }
  iVar12 = FUN_14012b4b0(param_1,param_3,local_2038);
  if (iVar12 == 0) {
    iVar14 = uVar17 - 1;
    iVar20 = 1 << ((byte)iVar14 & 0x1f);
    lVar7 = (longlong)iVar20;
    puVar1 = local_2058 + lVar7 * 0x20;
    if (local_2038 != puVar1) {
      if ((int)auStack_2048[lVar7 * 8 + 1] < (int)local_2028) {
        FUN_14011d8c0(puVar1,local_2028);
      }
      puVar6 = (undefined4 *)(&uStack_2050)[lVar7 * 4];
      iVar12 = 0;
      if (0 < (int)local_2028) {
        do {
          *puVar6 = *local_2030;
          puVar6 = puVar6 + 1;
          local_2030 = local_2030 + 1;
          iVar12 = iVar12 + 1;
        } while (iVar12 < (int)local_2028);
      }
      if (iVar12 < (int)auStack_2048[lVar7 * 8]) {
        do {
          *puVar6 = 0;
          puVar6 = puVar6 + 1;
          iVar12 = iVar12 + 1;
        } while (iVar12 < (int)auStack_2048[lVar7 * 8]);
      }
      auStack_2048[lVar7 * 8] = local_2028;
      auStack_2048[lVar7 * 8 + 2] = local_2020;
    }
    iVar15 = 0;
    if (0 < iVar14) {
      do {
        iVar12 = FUN_14012bf90(puVar1);
        if ((iVar12 != 0) || (iVar12 = (*pcVar22)(puVar1,local_20a0,&local_20d0), iVar12 != 0))
        goto LAB_14012deab;
        iVar15 = iVar15 + 1;
      } while (iVar15 < iVar14);
    }
    uVar21 = 1 << (sbyte)uVar17;
    local_2070 = uVar21;
    uVar18 = local_20e4;
    lVar7 = local_20a0;
    iVar14 = iVar20;
    while (iVar14 = iVar14 + 1, local_20a0 = lVar7, iVar14 < (int)uVar21) {
      local_20e4 = uVar18;
      iVar12 = FUN_14012b7a0(local_2058 + (longlong)iVar20 * 0x20,local_2038,
                             local_2058 + (longlong)iVar14 * 0x20);
      if ((iVar12 != 0) ||
         (iVar12 = (*pcVar22)(local_2058 + (longlong)iVar14 * 0x20,local_20a0,&local_20d0),
         iVar12 != 0)) goto LAB_14012deab;
      iVar20 = iVar20 + 1;
      uVar18 = local_20e4;
      lVar7 = local_20a0;
    }
    local_20e4 = uVar18 & 0xffffffff;
    uVar3 = local_20e4;
    iVar12 = 0;
    local_20e4._0_4_ = (int)uVar18;
    piVar8 = local_20f0;
    if (0 < (int)local_20e4) {
      do {
        *piVar8 = 0;
        piVar8 = piVar8 + 1;
        iVar12 = iVar12 + 1;
      } while (iVar12 < (int)local_20e4);
    }
    *local_20f0 = 1;
    local_20e8 = (uint)(*local_20f0 != 0);
    iVar14 = 0;
    local_20d8 = 1;
    uVar18 = 0;
    uVar19 = 0;
    uVar21 = 0;
    local_2098 = (longlong)(*(int *)(local_20b0 + 0x10) + -1);
    lVar11 = local_2098;
    uVar13 = (uint)(*local_20f0 != 0);
    local_20e4 = uVar3;
LAB_14012d915:
    lVar4 = local_20a0;
    local_20d8 = local_20d8 + -1;
    if (local_20d8 == 0) {
      if (lVar11 == -1) {
        if (((iVar14 != 2) || ((int)uVar19 < 1)) || (iVar14 = 0, (int)uVar19 < 1))
        goto LAB_14012dd70;
        goto LAB_14012dbf2;
      }
      uVar18 = (ulonglong)*(uint *)(*(longlong *)(local_20b0 + 8) + lVar11 * 4);
      lVar11 = lVar11 + -1;
      local_20d8 = 0x1c;
      local_2098 = lVar11;
    }
    uVar3 = uVar18 >> 0x1b;
    local_20a8 = (int)uVar18 * 2;
    uVar18 = (ulonglong)local_20a8;
    if (iVar14 == 0) goto code_r0x00014012d959;
    if ((iVar14 != 1) || ((uVar3 & 1) != 0)) goto LAB_14012da1c;
    if ((int)uVar13 < DAT_14030990c) {
      if ((int)uVar13 < DAT_140309904) {
        if (((int)(uVar13 * 2 + 1) < 0x200) && ((int)uVar13 < 0x80)) {
          iVar12 = FUN_14011ede0(&local_20f8);
        }
        else {
          iVar12 = FUN_14011f720(&local_20f8);
        }
      }
      else {
        iVar12 = FUN_1401217d0(&local_20f8);
      }
    }
    else {
      iVar12 = FUN_140126e70(&local_20f8);
    }
    local_20e4 = local_20e4 & 0xffffffff;
    if ((iVar12 == 0) && (iVar12 = (*pcVar22)(&local_20f8,lVar7,&local_20d0), iVar12 == 0))
    goto LAB_14012da06;
  }
LAB_14012deab:
  local_20d0 = mp_int::vftable;
  if ((local_20c8 != (undefined4 *)0x0) && ((int)local_20bc != 0)) {
    memset(local_20c8,0,(longlong)((int)local_20bc << 2));
  }
  operator_delete(local_20c8);
  local_20c8 = (undefined4 *)0x0;
  local_20bc = 0;
  local_20c0 = 0;
  local_20f8 = mp_int::vftable;
  if ((local_20f0 != (int *)0x0) && ((int)local_20e4 != 0)) {
    memset(local_20f0,0,(longlong)((int)local_20e4 << 2));
  }
  operator_delete(local_20f0);
  local_20f0 = (int *)0x0;
  local_20e4 = 0;
  local_20e8 = 0;
  _eh_vector_destructor_iterator_(local_2058,0x20,0x100,FUN_14011d980);
  return iVar12;
LAB_14012dbf2:
  do {
    if ((int)uVar13 < DAT_14030990c) {
      if ((int)uVar13 < DAT_140309904) {
        if (((int)(uVar13 * 2 + 1) < 0x200) && ((int)uVar13 < 0x80)) {
          iVar12 = FUN_14011ede0(&local_20f8);
        }
        else {
          iVar12 = FUN_14011f720(&local_20f8);
        }
      }
      else {
        iVar12 = FUN_1401217d0(&local_20f8);
      }
    }
    else {
      iVar12 = FUN_140126e70(&local_20f8);
    }
    local_20e4 = local_20e4 & 0xffffffff;
    if ((iVar12 != 0) || (iVar12 = (*pcVar22)(&local_20f8,lVar4,&local_20d0), iVar12 != 0))
    goto LAB_14012deab;
    uVar21 = uVar21 * 2;
    if ((local_2070 & uVar21) != 0) {
      bVar23 = local_20e4._4_4_ != local_2020;
      uVar17 = local_2028;
      if ((int)local_20e8 < (int)local_2028) {
        uVar17 = local_20e8;
      }
      if ((int)uVar17 < DAT_140309908) {
        uVar17 = local_2028;
        if ((int)local_20e8 < (int)local_2028) {
          uVar17 = local_20e8;
        }
        if ((int)uVar17 < DAT_140309900) {
          if ((int)(local_2028 + 1 + local_20e8) < 0x200) {
            uVar17 = local_2028;
            if ((int)local_20e8 < (int)local_2028) {
              uVar17 = local_20e8;
            }
            if ((int)uVar17 < 0x101) {
              iVar12 = FUN_14011ea80(&local_20f8,local_2038,&local_20f8);
              goto LAB_14012dd2f;
            }
          }
          iVar12 = FUN_14011f140(&local_20f8,local_2038,&local_20f8);
        }
        else {
          iVar12 = FUN_140120060(&local_20f8,local_2038,&local_20f8);
        }
      }
      else {
        iVar12 = FUN_1401231a0(&local_20f8,local_2038,&local_20f8);
      }
LAB_14012dd2f:
      uVar17 = 0;
      if (0 < (int)local_20e8) {
        uVar17 = (uint)bVar23;
      }
      local_20e4 = CONCAT44(uVar17,(int)local_20e4);
      if ((iVar12 != 0) || (iVar12 = (*pcVar22)(&local_20f8,lVar4,&local_20d0), iVar12 != 0))
      goto LAB_14012deab;
    }
    iVar14 = iVar14 + 1;
    uVar13 = local_20e8;
  } while (iVar14 < (int)uVar19);
LAB_14012dd70:
  local_2090 = mp_int::vftable;
  pvVar9 = operator_new(0x80);
  local_2088 = pvVar9;
  memset(pvVar9,0,0x80);
  local_2080 = 0;
  local_207c = 0x20;
  operator_delete(pvVar9);
  local_2088 = (void *)0x0;
  local_207c = 0;
  local_2080 = 0;
  if ((int)local_20e4 == 0) {
    pvVar9 = operator_new(0x80);
    local_2088 = pvVar9;
    memset(pvVar9,0,0x80);
    local_2080 = 0;
    iVar12 = 0x20;
    local_207c = 0x20;
  }
  else {
    auVar2._8_8_ = 0;
    auVar2._0_8_ = (longlong)(int)local_20e4;
    _Var10 = SUB168(ZEXT816(4) * auVar2,0);
    if (SUB168(ZEXT816(4) * auVar2,8) != 0) {
      _Var10 = 0xffffffffffffffff;
    }
    pvVar9 = operator_new(_Var10);
    local_2088 = pvVar9;
    memcpy(pvVar9,local_20f0,(longlong)(int)local_20e4 << 2);
    iVar12 = (int)local_20e4;
    local_207c = local_20e4;
    local_2080 = local_20e8;
  }
  uVar5 = local_2068;
  FUN_14011d790(&local_20f8,local_2068);
  FUN_14011d790(uVar5);
  if ((pvVar9 != (void *)0x0) && (iVar12 != 0)) {
    memset(pvVar9,0,(longlong)(iVar12 * 4));
  }
  operator_delete(pvVar9);
  iVar12 = 0;
  goto LAB_14012deab;
code_r0x00014012d959:
  if ((uVar3 & 1) == 0) goto LAB_14012d915;
LAB_14012da1c:
  uVar19 = uVar19 + 1;
  uVar21 = uVar21 | ((uint)uVar3 & 1) << ((sbyte)uVar17 - (char)uVar19 & 0x1fU);
  iVar14 = 2;
  lVar11 = local_2098;
  if (uVar19 != uVar17) goto LAB_14012d915;
  uVar19 = 0;
  uVar16 = uVar19;
  if (uVar17 != 0) {
    do {
      if ((int)uVar13 < DAT_14030990c) {
        if ((int)uVar13 < DAT_140309904) {
          if (((int)(uVar13 * 2 + 1) < 0x200) && ((int)uVar13 < 0x80)) {
            iVar12 = FUN_14011ede0(&local_20f8);
          }
          else {
            iVar12 = FUN_14011f720(&local_20f8);
          }
        }
        else {
          iVar12 = FUN_1401217d0(&local_20f8);
        }
      }
      else {
        iVar12 = FUN_140126e70(&local_20f8);
      }
      local_20e4 = local_20e4 & 0xffffffff;
      if ((iVar12 != 0) || (iVar12 = (*pcVar22)(&local_20f8,lVar7,&local_20d0), iVar12 != 0))
      goto LAB_14012deab;
      uVar16 = uVar16 + 1;
      uVar13 = local_20e8;
    } while ((int)uVar16 < (int)uVar17);
  }
  lVar11 = (longlong)(int)uVar21;
  puVar1 = local_2058 + lVar11 * 0x20;
  bVar23 = local_20e4._4_4_ != auStack_2048[lVar11 * 8 + 2];
  uVar21 = auStack_2048[lVar11 * 8];
  uVar16 = uVar21;
  if ((int)uVar13 < (int)uVar21) {
    uVar16 = uVar13;
  }
  if ((int)uVar16 < DAT_140309908) {
    uVar16 = uVar21;
    if ((int)uVar13 < (int)uVar21) {
      uVar16 = uVar13;
    }
    if ((int)uVar16 < DAT_140309900) {
      if ((int)(uVar21 + 1 + uVar13) < 0x200) {
        if ((int)uVar13 < (int)uVar21) {
          uVar21 = uVar13;
        }
        if ((int)uVar21 < 0x101) {
          iVar12 = FUN_14011ea80(&local_20f8,puVar1,&local_20f8);
          goto LAB_14012db94;
        }
      }
      iVar12 = FUN_14011f140(&local_20f8,puVar1,&local_20f8);
    }
    else {
      iVar12 = FUN_140120060(&local_20f8,puVar1,&local_20f8);
    }
  }
  else {
    iVar12 = FUN_1401231a0(&local_20f8,puVar1,&local_20f8);
  }
LAB_14012db94:
  uVar21 = uVar19;
  if (0 < (int)local_20e8) {
    uVar21 = (uint)bVar23;
  }
  local_20e4 = CONCAT44(uVar21,(int)local_20e4);
  if ((iVar12 != 0) || (iVar12 = (*pcVar22)(&local_20f8,lVar7,&local_20d0), iVar12 != 0))
  goto LAB_14012deab;
  uVar21 = 0;
  iVar14 = 1;
LAB_14012da06:
  uVar18 = (ulonglong)local_20a8;
  lVar11 = local_2098;
  uVar13 = local_20e8;
  goto LAB_14012d915;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_14012df80(undefined8 param_1,longlong param_2,longlong param_3,undefined8 param_4,
                 int param_5)

{
  undefined1 *puVar1;
  undefined1 auVar2 [16];
  ulonglong uVar3;
  ulonglong uVar4;
  uint uVar5;
  code *pcVar6;
  undefined8 uVar7;
  int iVar8;
  int *piVar9;
  longlong lVar10;
  longlong lVar11;
  void *pvVar12;
  __uint64 _Var13;
  int iVar14;
  uint uVar15;
  undefined4 *puVar16;
  int iVar17;
  uint uVar18;
  int iVar19;
  uint uVar20;
  int iVar21;
  bool bVar22;
  undefined1 auStackY_2108 [32];
  undefined **local_20d8;
  int *local_20d0;
  uint local_20c8;
  undefined8 local_20c4;
  uint local_20b8;
  uint local_20b4;
  code *local_20b0;
  longlong local_20a8;
  longlong local_20a0;
  undefined **local_2098;
  void *local_2090;
  uint local_2088;
  ulonglong local_2084;
  uint local_2078;
  undefined8 local_2070;
  undefined8 local_2068;
  undefined1 local_2058 [8];
  undefined8 uStack_2050;
  uint auStack_2048 [4];
  undefined1 local_2038 [8];
  undefined4 *local_2030;
  uint local_2028;
  uint local_2020;
  ulonglong local_58;
  undefined8 uStack_48;
  
  uStack_48 = 0x14012df9f;
  local_2068 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStackY_2108;
  local_20a8 = param_3;
  local_20a0 = param_2;
  local_2070 = param_4;
  _eh_vector_constructor_iterator_(local_2058,0x20,0x100,FUN_14011d870,FUN_14011d980);
  local_20d8 = mp_int::vftable;
  local_20d0 = operator_new(0x80);
  memset(local_20d0,0,0x80);
  local_20c8 = 0;
  iVar21 = 0x20;
  local_20c4 = 0x20;
  if (*(int *)(param_2 + 0x10) == 0) {
LAB_14012e0bc:
    iVar14 = 2;
  }
  else {
    iVar14 = *(int *)(param_2 + 0x10) * 0x1c + -0x1c;
    for (uVar18 = *(uint *)(*(longlong *)(param_2 + 8) + -4 + (longlong)*(int *)(param_2 + 0x10) * 4
                           ); uVar18 != 0; uVar18 = uVar18 >> 1) {
      iVar14 = iVar14 + 1;
    }
    if (iVar14 < 8) goto LAB_14012e0bc;
    if (iVar14 < 0x25) {
      iVar14 = 3;
    }
    else if (iVar14 < 0x8d) {
      iVar14 = 4;
    }
    else if (iVar14 < 0x1c3) {
      iVar14 = 5;
    }
    else if (iVar14 < 0x518) {
      iVar14 = 6;
    }
    else {
      iVar14 = (0xdc9 < iVar14) + 7;
    }
  }
  if (param_5 == 0) {
    uVar18 = **(uint **)(param_3 + 8);
    if ((uVar18 & 1) == 0) {
      iVar8 = -3;
      goto LAB_14012e983;
    }
    iVar21 = (uVar18 * 2 + 4 & 8) + uVar18;
    iVar21 = iVar21 * (2 - iVar21 * uVar18);
    iVar21 = iVar21 * (2 - iVar21 * uVar18);
    uVar18 = -(iVar21 * (2 - iVar21 * uVar18)) & 0xfffffff;
    if ((*(int *)(param_3 + 0x10) * 2 + 1 < 0x200) && (*(int *)(param_3 + 0x10) < 0x100)) {
      local_20b0 = FUN_14012a0c0;
    }
    else {
      local_20b0 = FUN_14012b5e0;
    }
    local_20b8 = uVar18;
    iVar8 = FUN_1401227e0(&local_20d8);
    if (iVar8 != 0) goto LAB_14012e977;
    iVar8 = FUN_14012b850(param_1,&local_20d8,param_3);
  }
  else {
    if (param_5 == 1) {
      local_20b0 = FUN_14011ff30;
      uVar18 = 0x10000000 - **(int **)(param_3 + 8);
    }
    else {
      iVar8 = FUN_140122c20();
      iVar21 = (int)local_20c4;
      if (iVar8 != 0) goto LAB_14012e983;
      local_20b0 = FUN_140122980;
      uVar18 = local_20b4;
    }
    uVar3 = local_20c4;
    local_20c4 = local_20c4 & 0xffffffff;
    uVar4 = local_20c4;
    iVar8 = 0;
    piVar9 = local_20d0;
    if (0 < iVar21) {
      do {
        *piVar9 = 0;
        iVar8 = iVar8 + 1;
        local_20c4._0_4_ = (int)uVar3;
        piVar9 = piVar9 + 1;
      } while (iVar8 < (int)local_20c4);
    }
    *local_20d0 = 1;
    local_20c8 = (uint)(*local_20d0 != 0);
    local_20c4 = uVar4;
    local_20b8 = uVar18;
    iVar8 = FUN_14012b4b0(param_1,param_3,local_2038);
  }
  if (iVar8 == 0) {
    iVar21 = iVar14 + -1;
    iVar19 = 1 << ((byte)iVar21 & 0x1f);
    lVar10 = (longlong)iVar19;
    puVar1 = local_2058 + lVar10 * 0x20;
    if (local_2038 != puVar1) {
      if ((int)auStack_2048[lVar10 * 8 + 1] < (int)local_2028) {
        FUN_14011d8c0(puVar1,local_2028);
      }
      puVar16 = (undefined4 *)(&uStack_2050)[lVar10 * 4];
      iVar8 = 0;
      if (0 < (int)local_2028) {
        do {
          *puVar16 = *local_2030;
          puVar16 = puVar16 + 1;
          local_2030 = local_2030 + 1;
          iVar8 = iVar8 + 1;
        } while (iVar8 < (int)local_2028);
      }
      if (iVar8 < (int)auStack_2048[lVar10 * 8]) {
        do {
          *puVar16 = 0;
          puVar16 = puVar16 + 1;
          iVar8 = iVar8 + 1;
        } while (iVar8 < (int)auStack_2048[lVar10 * 8]);
      }
      auStack_2048[lVar10 * 8] = local_2028;
      auStack_2048[lVar10 * 8 + 2] = local_2020;
    }
    iVar17 = 0;
    if (0 < iVar21) {
      do {
        iVar8 = FUN_14012bf90(puVar1);
        if ((iVar8 != 0) || (iVar8 = (*local_20b0)(puVar1,local_20a8,uVar18), iVar8 != 0))
        goto LAB_14012e977;
        iVar17 = iVar17 + 1;
      } while (iVar17 < iVar21);
    }
    uVar20 = 1 << (sbyte)iVar14;
    local_2078 = uVar20;
    iVar21 = iVar19;
    while (iVar21 = iVar21 + 1, iVar21 < (int)uVar20) {
      iVar8 = FUN_14012b7a0(local_2058 + (longlong)iVar19 * 0x20,local_2038,
                            local_2058 + (longlong)iVar21 * 0x20);
      if ((iVar8 != 0) ||
         (iVar8 = (*local_20b0)(local_2058 + (longlong)iVar21 * 0x20,local_20a8,uVar18), iVar8 != 0)
         ) goto LAB_14012e977;
      iVar19 = iVar19 + 1;
    }
    iVar21 = 0;
    local_20b4 = 1;
    uVar18 = 0;
    iVar19 = 0;
    uVar20 = 0;
    lVar10 = (longlong)(*(int *)(local_20a0 + 0x10) + -1);
    do {
      while( true ) {
        pcVar6 = local_20b0;
        uVar5 = local_20b8;
        local_20b4 = local_20b4 - 1;
        if (local_20b4 == 0) {
          if (lVar10 == -1) {
            if (((iVar21 != 2) || (iVar19 < 1)) || (iVar21 = 0, iVar19 < 1)) goto LAB_14012e81d;
            goto LAB_14012e6a0;
          }
          uVar18 = *(uint *)(*(longlong *)(local_20a0 + 8) + lVar10 * 4);
          lVar10 = lVar10 + -1;
          local_20b4 = 0x1c;
        }
        uVar15 = uVar18 >> 0x1b & 1;
        uVar18 = uVar18 * 2;
        if (iVar21 != 0) break;
        if (uVar15 != 0) {
LAB_14012e4b4:
          iVar19 = iVar19 + 1;
          uVar20 = uVar20 | uVar15 << ((sbyte)iVar14 - (char)iVar19 & 0x1fU);
          iVar21 = 2;
          if (iVar19 == iVar14) {
            iVar21 = 0;
            if (iVar14 != 0) {
              do {
                if ((int)local_20c8 < DAT_14030990c) {
                  if ((int)local_20c8 < DAT_140309904) {
                    if (((int)(local_20c8 * 2 + 1) < 0x200) && ((int)local_20c8 < 0x80)) {
                      iVar8 = FUN_14011ede0(&local_20d8);
                    }
                    else {
                      iVar8 = FUN_14011f720(&local_20d8);
                    }
                  }
                  else {
                    iVar8 = FUN_1401217d0(&local_20d8);
                  }
                }
                else {
                  iVar8 = FUN_140126e70(&local_20d8);
                }
                local_20c4 = local_20c4 & 0xffffffff;
                if ((iVar8 != 0) ||
                   (iVar8 = (*local_20b0)(&local_20d8,local_20a8,uVar5), iVar8 != 0))
                goto LAB_14012e977;
                iVar21 = iVar21 + 1;
              } while (iVar21 < iVar14);
            }
            lVar11 = (longlong)(int)uVar20;
            puVar1 = local_2058 + lVar11 * 0x20;
            bVar22 = local_20c4._4_4_ != auStack_2048[lVar11 * 8 + 2];
            uVar20 = auStack_2048[lVar11 * 8];
            uVar15 = uVar20;
            if ((int)local_20c8 < (int)uVar20) {
              uVar15 = local_20c8;
            }
            if ((int)uVar15 < DAT_140309908) {
              uVar15 = uVar20;
              if ((int)local_20c8 < (int)uVar20) {
                uVar15 = local_20c8;
              }
              if ((int)uVar15 < DAT_140309900) {
                if ((int)(uVar20 + 1 + local_20c8) < 0x200) {
                  if ((int)local_20c8 < (int)uVar20) {
                    uVar20 = local_20c8;
                  }
                  if ((int)uVar20 < 0x101) {
                    iVar8 = FUN_14011ea80(&local_20d8,puVar1,&local_20d8);
                    goto LAB_14012e633;
                  }
                }
                iVar8 = FUN_14011f140(&local_20d8,puVar1,&local_20d8);
              }
              else {
                iVar8 = FUN_140120060(&local_20d8,puVar1,&local_20d8);
              }
            }
            else {
              iVar8 = FUN_1401231a0(&local_20d8,puVar1,&local_20d8);
            }
LAB_14012e633:
            uVar20 = 0;
            if (0 < (int)local_20c8) {
              uVar20 = (uint)bVar22;
            }
            local_20c4 = CONCAT44(uVar20,(int)local_20c4);
            if ((iVar8 != 0) || (iVar8 = (*local_20b0)(&local_20d8,local_20a8,uVar5), iVar8 != 0))
            goto LAB_14012e977;
            iVar19 = 0;
            uVar20 = 0;
            iVar21 = 1;
          }
        }
      }
      if ((iVar21 != 1) || (uVar15 != 0)) goto LAB_14012e4b4;
      if ((int)local_20c8 < DAT_14030990c) {
        if ((int)local_20c8 < DAT_140309904) {
          if (((int)(local_20c8 * 2 + 1) < 0x200) && ((int)local_20c8 < 0x80)) {
            iVar8 = FUN_14011ede0(&local_20d8);
          }
          else {
            iVar8 = FUN_14011f720(&local_20d8);
          }
        }
        else {
          iVar8 = FUN_1401217d0(&local_20d8);
        }
      }
      else {
        iVar8 = FUN_140126e70(&local_20d8);
      }
      local_20c4 = local_20c4 & 0xffffffff;
    } while ((iVar8 == 0) && (iVar8 = (*local_20b0)(&local_20d8,local_20a8,local_20b8), iVar8 == 0))
    ;
  }
  goto LAB_14012e977;
LAB_14012e6a0:
  do {
    if ((int)local_20c8 < DAT_14030990c) {
      if ((int)local_20c8 < DAT_140309904) {
        if (((int)(local_20c8 * 2 + 1) < 0x200) && ((int)local_20c8 < 0x80)) {
          iVar8 = FUN_14011ede0(&local_20d8);
        }
        else {
          iVar8 = FUN_14011f720(&local_20d8);
        }
      }
      else {
        iVar8 = FUN_1401217d0(&local_20d8);
      }
    }
    else {
      iVar8 = FUN_140126e70(&local_20d8);
    }
    local_20c4 = local_20c4 & 0xffffffff;
    if ((iVar8 != 0) || (iVar8 = (*pcVar6)(&local_20d8,local_20a8,uVar5), iVar8 != 0))
    goto LAB_14012e977;
    uVar20 = uVar20 * 2;
    if ((local_2078 & uVar20) != 0) {
      bVar22 = local_20c4._4_4_ != local_2020;
      uVar18 = local_2028;
      if ((int)local_20c8 < (int)local_2028) {
        uVar18 = local_20c8;
      }
      if ((int)uVar18 < DAT_140309908) {
        uVar18 = local_2028;
        if ((int)local_20c8 < (int)local_2028) {
          uVar18 = local_20c8;
        }
        if ((int)uVar18 < DAT_140309900) {
          if ((int)(local_2028 + 1 + local_20c8) < 0x200) {
            uVar18 = local_2028;
            if ((int)local_20c8 < (int)local_2028) {
              uVar18 = local_20c8;
            }
            if ((int)uVar18 < 0x101) {
              iVar8 = FUN_14011ea80(&local_20d8,local_2038,&local_20d8);
              goto LAB_14012e7e1;
            }
          }
          iVar8 = FUN_14011f140(&local_20d8,local_2038,&local_20d8);
        }
        else {
          iVar8 = FUN_140120060(&local_20d8,local_2038,&local_20d8);
        }
      }
      else {
        iVar8 = FUN_1401231a0(&local_20d8,local_2038,&local_20d8);
      }
LAB_14012e7e1:
      uVar18 = 0;
      if (0 < (int)local_20c8) {
        uVar18 = (uint)bVar22;
      }
      local_20c4 = CONCAT44(uVar18,(int)local_20c4);
      if ((iVar8 != 0) || (iVar8 = (*pcVar6)(&local_20d8,local_20a8,uVar5), iVar8 != 0))
      goto LAB_14012e977;
    }
    iVar21 = iVar21 + 1;
  } while (iVar21 < iVar19);
LAB_14012e81d:
  if ((param_5 != 0) || (iVar8 = (*pcVar6)(&local_20d8,local_20a8,uVar5), iVar8 == 0)) {
    local_2098 = mp_int::vftable;
    pvVar12 = operator_new(0x80);
    local_2090 = pvVar12;
    memset(pvVar12,0,0x80);
    local_2088 = 0;
    local_2084 = 0x20;
    operator_delete(pvVar12);
    local_2090 = (void *)0x0;
    local_2084 = 0;
    local_2088 = 0;
    if ((int)local_20c4 == 0) {
      pvVar12 = operator_new(0x80);
      local_2090 = pvVar12;
      memset(pvVar12,0,0x80);
      local_2088 = 0;
      iVar21 = 0x20;
      local_2084 = 0x20;
    }
    else {
      auVar2._8_8_ = 0;
      auVar2._0_8_ = (longlong)(int)local_20c4;
      _Var13 = SUB168(ZEXT816(4) * auVar2,0);
      if (SUB168(ZEXT816(4) * auVar2,8) != 0) {
        _Var13 = 0xffffffffffffffff;
      }
      pvVar12 = operator_new(_Var13);
      local_2090 = pvVar12;
      memcpy(pvVar12,local_20d0,(longlong)(int)local_20c4 << 2);
      iVar21 = (int)local_20c4;
      local_2084 = local_20c4;
      local_2088 = local_20c8;
    }
    uVar7 = local_2070;
    FUN_14011d790(&local_20d8,local_2070);
    FUN_14011d790(uVar7);
    if ((pvVar12 != (void *)0x0) && (iVar21 != 0)) {
      memset(pvVar12,0,(longlong)(iVar21 * 4));
    }
    operator_delete(pvVar12);
    iVar8 = 0;
  }
LAB_14012e977:
  iVar21 = (int)local_20c4;
LAB_14012e983:
  local_20d8 = mp_int::vftable;
  if ((local_20d0 != (int *)0x0) && (iVar21 != 0)) {
    memset(local_20d0,0,(longlong)(iVar21 * 4));
  }
  operator_delete(local_20d0);
  local_20d0 = (int *)0x0;
  local_20c4 = 0;
  local_20c8 = 0;
  _eh_vector_destructor_iterator_(local_2058,0x20,0x100,FUN_14011d980);
  return iVar8;
}



int FUN_14012ea10(undefined8 param_1,undefined ***param_2)

{
  uint uVar1;
  uint uVar2;
  int iVar3;
  byte *_Dst;
  byte *_Dst_00;
  uint *puVar4;
  int iVar5;
  int iVar6;
  byte *pbVar7;
  undefined ***pppuVar8;
  undefined ***pppuVar9;
  ulonglong uVar10;
  longlong lVar11;
  int iVar12;
  uint uVar13;
  uint uVar14;
  uint uVar15;
  uint uVar16;
  ulonglong uVar17;
  int iVar18;
  bool bVar19;
  int local_res20;
  uint local_148;
  int local_144;
  undefined **local_140;
  byte *local_138;
  int local_130;
  undefined8 local_12c;
  undefined **local_120;
  byte *local_118;
  uint local_110;
  undefined8 local_10c;
  undefined **local_100;
  byte *local_f8;
  uint local_f0;
  undefined8 local_ec;
  undefined **local_e0;
  byte *local_d8;
  int local_d0;
  undefined8 local_cc;
  undefined **local_c0;
  byte *local_b8;
  uint local_b0;
  undefined8 local_ac;
  undefined **local_a0;
  uint *local_98;
  uint local_90;
  undefined8 local_8c;
  undefined **local_80;
  byte *local_78;
  uint local_70;
  undefined8 local_6c;
  undefined **local_60;
  byte *local_58;
  uint local_50;
  undefined8 local_4c;
  undefined8 local_40;
  
  local_40 = 0xfffffffffffffffe;
  local_60 = mp_int::vftable;
  _Dst = operator_new(0x80);
  local_58 = _Dst;
  memset(_Dst,0,0x80);
  iVar12 = 0;
  local_50 = 0;
  local_4c = 0x20;
  local_80 = mp_int::vftable;
  local_78 = operator_new(0x80);
  memset(local_78,0,0x80);
  local_70 = 0;
  local_6c = 0x20;
  local_100 = mp_int::vftable;
  local_f8 = operator_new(0x80);
  memset(local_f8,0,0x80);
  local_f0 = 0;
  local_ec = 0x20;
  local_a0 = mp_int::vftable;
  local_98 = operator_new(0x80);
  memset(local_98,0,0x80);
  local_90 = 0;
  local_8c = 0x20;
  local_120 = mp_int::vftable;
  _Dst_00 = operator_new(0x80);
  local_118 = _Dst_00;
  memset(_Dst_00,0,0x80);
  local_110 = 0;
  local_10c = 0x20;
  local_e0 = mp_int::vftable;
  local_d8 = operator_new(0x80);
  memset(local_d8,0,0x80);
  local_d0 = 0;
  local_cc = 0x20;
  local_140 = mp_int::vftable;
  local_138 = operator_new(0x80);
  memset(local_138,0,0x80);
  iVar5 = 0;
  local_130 = 0;
  local_12c = 0x20;
  local_c0 = mp_int::vftable;
  local_b8 = operator_new(0x80);
  memset(local_b8,0,0x80);
  pbVar7 = local_b8;
  local_b0 = 0;
  local_ac = 0x20;
  if ((*(int *)(param_2 + 3) == 1) || (*(int *)(param_2 + 2) == 0)) {
    if (local_b8 != (byte *)0x0) {
      memset(local_b8,0,0x80);
    }
    operator_delete(pbVar7);
    pbVar7 = local_138;
    if (local_138 != (byte *)0x0) {
      memset(local_138,0,0x80);
    }
    operator_delete(pbVar7);
    pbVar7 = local_d8;
    if (local_d8 != (byte *)0x0) {
      memset(local_d8,0,0x80);
    }
    operator_delete(pbVar7);
    if (_Dst_00 != (byte *)0x0) {
      memset(_Dst_00,0,0x80);
    }
    operator_delete(_Dst_00);
    puVar4 = local_98;
    if (local_98 != (uint *)0x0) {
      memset(local_98,0,0x80);
    }
    operator_delete(puVar4);
    pbVar7 = local_f8;
    if (local_f8 != (byte *)0x0) {
      memset(local_f8,0,0x80);
    }
    operator_delete(pbVar7);
    pbVar7 = local_78;
    if (local_78 != (byte *)0x0) {
      memset(local_78,0,0x80);
    }
    operator_delete(pbVar7);
    if (_Dst != (byte *)0x0) {
      memset(_Dst,0,0x80);
    }
    operator_delete(_Dst);
    return -3;
  }
  iVar3 = FUN_14012b4b0(param_1,param_2,&local_60);
  if ((iVar3 != 0) || (iVar3 = FUN_14011d9d0(param_2), uVar14 = local_50, iVar3 != 0))
  goto LAB_14012f8ff;
  uVar17 = (ulonglong)local_50;
  if (((int)local_50 < 1) ||
     ((((*local_58 & 1) != 0 || ((int)local_70 < 1)) || ((*local_78 & 1) != 0)))) {
    uVar13 = 0;
    if (0x20 < (int)local_50) {
      FUN_14011d8c0(&local_100);
      uVar13 = local_f0;
    }
    pbVar7 = local_f8;
    uVar16 = 0;
    if (0 < (int)uVar14) {
      uVar10 = uVar17;
      do {
        *(undefined4 *)pbVar7 = *(undefined4 *)(pbVar7 + ((longlong)local_58 - (longlong)local_f8));
        pbVar7 = pbVar7 + 4;
        uVar10 = uVar10 - 1;
        uVar16 = uVar14;
      } while (uVar10 != 0);
    }
    if ((int)uVar16 < (int)uVar13) {
      memset(pbVar7,0,(ulonglong)(uVar13 - uVar16) << 2);
    }
    uVar13 = local_70;
    local_f0 = uVar14;
    local_res20 = local_4c._4_4_;
    local_ec = CONCAT44(local_4c._4_4_,(int)local_ec);
    uVar10 = (ulonglong)local_70;
    uVar14 = 0;
    if (0x20 < (int)local_70) {
      FUN_14011d8c0(&local_a0);
      uVar14 = local_90;
    }
    puVar4 = local_98;
    uVar16 = 0;
    if (0 < (int)uVar13) {
      do {
        *puVar4 = *(uint *)(((longlong)local_78 - (longlong)local_98) + (longlong)puVar4);
        puVar4 = puVar4 + 1;
        uVar10 = uVar10 - 1;
        uVar16 = uVar13;
      } while (uVar10 != 0);
    }
    if ((int)uVar16 < (int)uVar14) {
      memset(puVar4,0,(ulonglong)(uVar14 - uVar16) << 2);
    }
    local_90 = uVar13;
    local_8c = CONCAT44(local_6c._4_4_,(int)local_8c);
    local_144 = 0;
    local_10c = local_10c & 0xffffffff;
    memset(_Dst_00,0,0x80);
    _Dst_00[0] = 1;
    _Dst_00[1] = 0;
    _Dst_00[2] = 0;
    _Dst_00[3] = 0;
    uVar14 = (uint)(*(int *)_Dst_00 != 0);
    local_110 = (uint)(*(int *)_Dst_00 != 0);
    local_ac = local_ac & 0xffffffff;
    memset(local_b8,0,0x80);
    local_b8[0] = 1;
    local_b8[1] = 0;
    local_b8[2] = 0;
    local_b8[3] = 0;
    local_148 = (uint)(*(int *)local_b8 != 0);
    uVar13 = (uint)(*(int *)local_b8 != 0);
    local_b0 = local_148;
LAB_14012ed80:
    do {
      iVar6 = (int)uVar17;
      if ((iVar6 < 1) || ((*local_f8 & 1) != 0)) {
        while ((0 < (int)local_90 && ((*local_98 & 1) == 0))) {
          iVar3 = FUN_14011db10(&local_a0);
          if (iVar3 != 0) goto LAB_14012f8ff;
          if (((0 < iVar5) && ((*local_138 & 1) != 0)) ||
             ((0 < (int)uVar13 && ((*local_b8 & 1) != 0)))) {
            if (local_12c._4_4_ == local_6c._4_4_) {
              iVar3 = FUN_14011efe0(&local_140,&local_80,&local_140);
            }
            else {
              if ((int)local_70 < iVar5) {
LAB_14012f17b:
                pppuVar9 = &local_80;
                pppuVar8 = &local_140;
              }
              else {
                if ((int)local_70 <= iVar5) {
                  lVar11 = (longlong)(iVar5 + -1) * 4;
                  puVar4 = (uint *)(local_138 + lVar11);
                  iVar3 = 0;
                  if (0 < iVar5) {
                    lVar11 = lVar11 - (longlong)puVar4;
                    do {
                      uVar16 = *(uint *)((longlong)puVar4 + (longlong)(local_78 + lVar11));
                      uVar2 = *puVar4;
                      if (uVar2 >= uVar16 && uVar2 != uVar16) break;
                      if (uVar2 < uVar16) goto LAB_14012f16b;
                      iVar3 = iVar3 + 1;
                      puVar4 = puVar4 + -1;
                    } while (iVar3 < iVar5);
                  }
                  goto LAB_14012f17b;
                }
LAB_14012f16b:
                local_12c = CONCAT44(local_6c._4_4_,(int)local_12c);
                pppuVar9 = &local_140;
                pppuVar8 = &local_80;
              }
              iVar3 = FUN_14011fa20(pppuVar8,pppuVar9,&local_140);
            }
            if (iVar3 != 0) goto LAB_14012f8ff;
            if (local_ac._4_4_ == local_4c._4_4_) {
              if ((int)local_50 < (int)uVar13) {
LAB_14012f220:
                pppuVar8 = &local_60;
                pppuVar9 = &local_c0;
              }
              else {
                if ((int)local_50 <= (int)uVar13) {
                  lVar11 = (longlong)(int)(uVar13 - 1) * 4;
                  puVar4 = (uint *)(local_b8 + lVar11);
                  iVar5 = 0;
                  if (0 < (int)uVar13) {
                    lVar11 = lVar11 - (longlong)puVar4;
                    do {
                      uVar16 = *(uint *)((longlong)puVar4 + (longlong)(local_58 + lVar11));
                      uVar2 = *puVar4;
                      if (uVar2 >= uVar16 && uVar2 != uVar16) break;
                      if (uVar2 < uVar16) goto LAB_14012f20b;
                      iVar5 = iVar5 + 1;
                      puVar4 = puVar4 + -1;
                    } while (iVar5 < (int)uVar13);
                  }
                  goto LAB_14012f220;
                }
LAB_14012f20b:
                local_ac = (ulonglong)CONCAT14(local_ac._4_4_ == 0,(int)local_ac);
                pppuVar8 = &local_c0;
                pppuVar9 = &local_60;
              }
              iVar3 = FUN_14011fa20(pppuVar9,pppuVar8,&local_c0);
            }
            else {
              iVar3 = FUN_14011efe0(&local_c0,&local_60,&local_c0);
            }
            if (iVar3 != 0) goto LAB_14012f8ff;
          }
          iVar3 = FUN_14011db10(&local_140);
          if ((iVar3 != 0) || (iVar3 = FUN_14011db10(&local_c0), iVar3 != 0)) goto LAB_14012f8ff;
          local_148 = local_b0;
          iVar5 = local_130;
          uVar13 = local_b0;
        }
        iVar18 = local_8c._4_4_;
        if (local_res20 == local_8c._4_4_) {
          if (local_res20 == 1) {
            if (iVar6 < (int)local_90) {
              iVar3 = 1;
            }
            else {
              if (iVar6 <= (int)local_90) {
                puVar4 = local_98 + (int)(local_90 - 1);
                iVar3 = 0;
                if (0 < (int)local_90) {
                  lVar11 = (longlong)(int)(local_90 - 1) * 4 - (longlong)puVar4;
                  do {
                    uVar13 = *puVar4;
                    uVar16 = *(uint *)((longlong)puVar4 + (longlong)(local_f8 + lVar11));
                    if (uVar13 >= uVar16 && uVar13 != uVar16) goto LAB_14012f2f1;
                    if (uVar13 < uVar16) goto LAB_14012f2ec;
                    iVar3 = iVar3 + 1;
                    puVar4 = puVar4 + -1;
                  } while (iVar3 < (int)local_90);
                }
                goto LAB_14012f349;
              }
              iVar3 = -1;
            }
          }
          else if ((int)local_90 < iVar6) {
            iVar3 = 1;
          }
          else if (iVar6 < (int)local_90) {
            iVar3 = -1;
          }
          else {
            puVar4 = (uint *)(local_f8 + (longlong)(iVar6 + -1) * 4);
            iVar3 = 0;
            if (0 < iVar6) {
              lVar11 = (longlong)(iVar6 + -1) * 4 - (longlong)puVar4;
              do {
                uVar13 = *(uint *)((longlong)puVar4 + (longlong)((longlong)local_98 + lVar11));
                uVar16 = *puVar4;
                if (uVar16 >= uVar13 && uVar16 != uVar13) goto LAB_14012f2f1;
                if (uVar16 < uVar13) goto LAB_14012f2ec;
                iVar3 = iVar3 + 1;
                puVar4 = puVar4 + -1;
              } while (iVar3 < iVar6);
            }
LAB_14012f349:
            iVar3 = 0;
          }
          goto LAB_14012f351;
        }
        bVar19 = local_res20 == 1;
        goto LAB_14012f354;
      }
      if ((int)local_ec < iVar6) {
        FUN_14011d8c0(&local_100,uVar17);
        uVar17 = (ulonglong)local_f0;
        local_res20 = local_ec._4_4_;
      }
      uVar15 = (uint)uVar17;
      puVar4 = (uint *)(local_f8 + (longlong)(int)uVar15 * 4 + -4);
      uVar2 = 0;
      uVar16 = uVar15;
      while (uVar16 = uVar16 - 1, -1 < (int)uVar16) {
        uVar1 = *puVar4;
        *puVar4 = uVar1 >> 1 | uVar2 << 0x1b;
        puVar4 = puVar4 + -1;
        uVar2 = uVar1 & 1;
      }
      if (0 < (int)uVar15) {
        do {
          if (*(int *)(local_f8 + (longlong)(int)uVar17 * 4 + -4) != 0) break;
          uVar16 = (int)uVar17 - 1;
          uVar17 = (ulonglong)uVar16;
        } while (0 < (int)uVar16);
        uVar15 = (uint)uVar17;
        local_f0 = uVar15;
      }
      if (uVar15 == 0) {
        local_res20 = 0;
      }
      local_ec = CONCAT44(local_res20,(int)local_ec);
      if (((0 < (int)uVar14) && ((*_Dst_00 & 1) != 0)) || ((0 < iVar12 && ((*local_d8 & 1) != 0))))
      {
        if (local_144 == local_6c._4_4_) {
          iVar3 = FUN_14011efe0(&local_120,&local_80,&local_120);
        }
        else {
          if ((int)local_70 < (int)uVar14) {
LAB_14012eecb:
            pppuVar9 = &local_80;
            pppuVar8 = &local_120;
          }
          else {
            if ((int)local_70 <= (int)uVar14) {
              lVar11 = (longlong)(int)(uVar14 - 1) * 4;
              puVar4 = (uint *)(_Dst_00 + lVar11);
              iVar3 = 0;
              if (0 < (int)uVar14) {
                lVar11 = lVar11 - (longlong)puVar4;
                do {
                  uVar16 = *puVar4;
                  uVar2 = *(uint *)((longlong)puVar4 + (longlong)(local_78 + lVar11));
                  if (uVar16 >= uVar2 && uVar16 != uVar2) break;
                  if (uVar16 < uVar2) goto LAB_14012eebb;
                  iVar3 = iVar3 + 1;
                  puVar4 = puVar4 + -1;
                } while (iVar3 < (int)uVar14);
              }
              goto LAB_14012eecb;
            }
LAB_14012eebb:
            local_10c = CONCAT44(local_6c._4_4_,(int)local_10c);
            pppuVar9 = &local_120;
            pppuVar8 = &local_80;
          }
          iVar3 = FUN_14011fa20(pppuVar8,pppuVar9,&local_120);
        }
        _Dst_00 = local_118;
        if (iVar3 != 0) goto LAB_14012f8ff;
        if (local_cc._4_4_ == local_4c._4_4_) {
          if ((int)local_50 < iVar12) {
LAB_14012ef63:
            pppuVar8 = &local_60;
            pppuVar9 = &local_e0;
          }
          else {
            if ((int)local_50 <= iVar12) {
              lVar11 = (longlong)(iVar12 + -1) * 4;
              puVar4 = (uint *)(local_d8 + lVar11);
              iVar3 = 0;
              if (0 < iVar12) {
                lVar11 = lVar11 - (longlong)puVar4;
                do {
                  uVar14 = *(uint *)((longlong)puVar4 + (longlong)(local_58 + lVar11));
                  uVar16 = *puVar4;
                  if (uVar16 >= uVar14 && uVar16 != uVar14) break;
                  if (uVar16 < uVar14) goto LAB_14012ef4e;
                  iVar3 = iVar3 + 1;
                  puVar4 = puVar4 + -1;
                } while (iVar3 < iVar12);
              }
              goto LAB_14012ef63;
            }
LAB_14012ef4e:
            local_cc = (ulonglong)CONCAT14(local_cc._4_4_ == 0,(int)local_cc);
            pppuVar8 = &local_e0;
            pppuVar9 = &local_60;
          }
          iVar3 = FUN_14011fa20(pppuVar9,pppuVar8,&local_e0);
        }
        else {
          iVar3 = FUN_14011efe0(&local_e0,&local_60,&local_e0);
        }
        _Dst_00 = local_118;
        if (iVar3 != 0) goto LAB_14012f8ff;
        iVar12 = local_d0;
        local_144 = local_10c._4_4_;
        uVar14 = local_110;
      }
      if ((int)local_10c < (int)uVar14) {
        FUN_14011d8c0(&local_120,uVar14);
        _Dst_00 = local_118;
        local_144 = local_10c._4_4_;
        uVar14 = local_110;
      }
      puVar4 = (uint *)(_Dst_00 + (longlong)(int)uVar14 * 4 + -4);
      uVar2 = 0;
      uVar16 = uVar14;
      while (uVar16 = uVar16 - 1, -1 < (int)uVar16) {
        uVar15 = *puVar4;
        *puVar4 = uVar2 << 0x1b | uVar15 >> 1;
        puVar4 = puVar4 + -1;
        uVar2 = uVar15 & 1;
      }
      while ((0 < (int)uVar14 && (*(int *)(_Dst_00 + (longlong)(int)uVar14 * 4 + -4) == 0))) {
        local_110 = uVar14 - 1;
        uVar14 = local_110;
      }
      if (uVar14 == 0) {
        local_144 = 0;
      }
      local_10c = CONCAT44(local_144,(int)local_10c);
      if ((int)local_cc < iVar12) {
        FUN_14011d8c0(&local_e0,iVar12);
        iVar12 = local_d0;
      }
      puVar4 = (uint *)(local_d8 + (longlong)iVar12 * 4 + -4);
      uVar16 = 0;
      iVar3 = iVar12;
      while (iVar3 = iVar3 + -1, -1 < iVar3) {
        uVar2 = *puVar4;
        *puVar4 = uVar16 << 0x1b | uVar2 >> 1;
        puVar4 = puVar4 + -1;
        uVar16 = uVar2 & 1;
      }
      while ((0 < iVar12 && (local_d0 = iVar12, *(int *)(local_d8 + (longlong)iVar12 * 4 + -4) == 0)
             )) {
        iVar12 = iVar12 + -1;
        local_d0 = iVar12;
      }
      if (iVar12 == 0) {
        local_cc = local_cc & 0xffffffff;
      }
    } while( true );
  }
LAB_14012f8fa:
  iVar3 = -3;
LAB_14012f8ff:
  pbVar7 = local_b8;
  if ((local_b8 != (byte *)0x0) && ((int)local_ac != 0)) {
    memset(local_b8,0,(longlong)((int)local_ac << 2));
  }
  operator_delete(pbVar7);
  pbVar7 = local_138;
  if ((local_138 != (byte *)0x0) && ((int)local_12c != 0)) {
    memset(local_138,0,(longlong)((int)local_12c << 2));
  }
  operator_delete(pbVar7);
  pbVar7 = local_d8;
  if ((local_d8 != (byte *)0x0) && ((int)local_cc != 0)) {
    memset(local_d8,0,(longlong)((int)local_cc << 2));
  }
  operator_delete(pbVar7);
  if ((_Dst_00 != (byte *)0x0) && ((int)local_10c != 0)) {
    memset(_Dst_00,0,(longlong)((int)local_10c << 2));
  }
  operator_delete(_Dst_00);
  puVar4 = local_98;
  if ((local_98 != (uint *)0x0) && ((int)local_8c != 0)) {
    memset(local_98,0,(longlong)((int)local_8c << 2));
  }
  operator_delete(puVar4);
  pbVar7 = local_f8;
  if ((local_f8 != (byte *)0x0) && ((int)local_ec != 0)) {
    memset(local_f8,0,(longlong)((int)local_ec << 2));
  }
  operator_delete(pbVar7);
  pbVar7 = local_78;
  if ((local_78 != (byte *)0x0) && ((int)local_6c != 0)) {
    memset(local_78,0,(longlong)((int)local_6c << 2));
  }
  operator_delete(pbVar7);
  pbVar7 = local_58;
  if ((local_58 != (byte *)0x0) && ((int)local_4c != 0)) {
    memset(local_58,0,(longlong)((int)local_4c << 2));
  }
  operator_delete(pbVar7);
  return iVar3;
LAB_14012f2f1:
  iVar3 = 1;
  goto LAB_14012f351;
LAB_14012f2ec:
  iVar3 = -1;
LAB_14012f351:
  bVar19 = iVar3 == -1;
LAB_14012f354:
  if (bVar19) {
    if (local_8c._4_4_ == local_res20) {
      if (iVar6 < (int)local_90) {
LAB_14012f5e1:
        pppuVar8 = &local_100;
        pppuVar9 = &local_a0;
      }
      else {
        if (iVar6 <= (int)local_90) {
          puVar4 = local_98 + (int)(local_90 - 1);
          iVar3 = 0;
          if (0 < (int)local_90) {
            lVar11 = (longlong)(int)(local_90 - 1) * 4 - (longlong)puVar4;
            do {
              uVar13 = *(uint *)((longlong)puVar4 + (longlong)(local_f8 + lVar11));
              uVar16 = *puVar4;
              if (uVar16 >= uVar13 && uVar16 != uVar13) break;
              if (uVar16 < uVar13) goto LAB_14012f5cb;
              iVar3 = iVar3 + 1;
              puVar4 = puVar4 + -1;
            } while (iVar3 < (int)local_90);
          }
          goto LAB_14012f5e1;
        }
LAB_14012f5cb:
        local_8c = (ulonglong)CONCAT14(local_8c._4_4_ == 0,(int)local_8c);
        pppuVar8 = &local_a0;
        pppuVar9 = &local_100;
      }
      iVar3 = FUN_14011fa20(pppuVar9,pppuVar8,&local_a0);
    }
    else {
      iVar3 = FUN_14011efe0(&local_a0,&local_100,&local_a0);
      local_res20 = local_ec._4_4_;
      uVar17 = (ulonglong)local_f0;
    }
    if (iVar3 != 0) goto LAB_14012f8ff;
    if (local_12c._4_4_ == local_144) {
      if (iVar5 <= (int)uVar14) {
        if (iVar5 < (int)uVar14) {
LAB_14012f67b:
          local_12c = (ulonglong)CONCAT14(local_12c._4_4_ == 0,(int)local_12c);
          iVar3 = FUN_14011fa20(&local_120,&local_140,&local_140);
          goto LAB_14012f6b8;
        }
        puVar4 = (uint *)(local_138 + (longlong)(iVar5 + -1) * 4);
        iVar3 = 0;
        if (0 < iVar5) {
          lVar11 = (longlong)(iVar5 + -1) * 4 - (longlong)puVar4;
          do {
            uVar13 = *(uint *)((longlong)puVar4 + (longlong)(_Dst_00 + lVar11));
            uVar16 = *puVar4;
            if (uVar16 >= uVar13 && uVar16 != uVar13) break;
            if (uVar16 < uVar13) goto LAB_14012f67b;
            iVar3 = iVar3 + 1;
            puVar4 = puVar4 + -1;
          } while (iVar3 < iVar5);
        }
      }
      iVar3 = FUN_14011fa20(&local_140,&local_120,&local_140);
    }
    else {
      iVar3 = FUN_14011efe0(&local_140,&local_120,&local_140);
      local_144 = local_10c._4_4_;
      _Dst_00 = local_118;
      uVar14 = local_110;
    }
LAB_14012f6b8:
    if (iVar3 != 0) goto LAB_14012f8ff;
    if (local_ac._4_4_ == local_cc._4_4_) {
      if (iVar12 < (int)local_148) {
LAB_14012f73f:
        pppuVar8 = &local_e0;
        pppuVar9 = &local_c0;
      }
      else {
        if (iVar12 <= (int)local_148) {
          puVar4 = (uint *)(local_b8 + (longlong)(int)(local_148 - 1) * 4);
          iVar5 = 0;
          if (0 < (int)local_148) {
            lVar11 = (longlong)(int)(local_148 - 1) * 4 - (longlong)puVar4;
            do {
              uVar13 = *puVar4;
              uVar16 = *(uint *)((longlong)puVar4 + (longlong)(local_d8 + lVar11));
              if (uVar13 >= uVar16 && uVar13 != uVar16) break;
              if (uVar13 < uVar16) goto LAB_14012f72a;
              iVar5 = iVar5 + 1;
              puVar4 = puVar4 + -1;
            } while (iVar5 < (int)local_148);
          }
          goto LAB_14012f73f;
        }
LAB_14012f72a:
        local_ac = (ulonglong)CONCAT14(local_ac._4_4_ == 0,(int)local_ac);
        pppuVar8 = &local_c0;
        pppuVar9 = &local_e0;
      }
      iVar3 = FUN_14011fa20(pppuVar9,pppuVar8,&local_c0);
    }
    else {
      iVar3 = FUN_14011efe0(&local_c0,&local_e0,&local_c0);
      iVar12 = local_d0;
    }
    if (iVar3 != 0) goto LAB_14012f8ff;
    local_148 = local_b0;
    iVar5 = local_130;
    iVar18 = local_8c._4_4_;
    goto LAB_14012f770;
  }
  if (local_res20 == local_8c._4_4_) {
    if (iVar6 <= (int)local_90) {
      if (iVar6 < (int)local_90) {
LAB_14012f3c1:
        local_ec = (ulonglong)CONCAT14(local_res20 == 0,(int)local_ec);
        iVar3 = FUN_14011fa20(&local_a0,&local_100,&local_100);
        goto LAB_14012f3fa;
      }
      puVar4 = (uint *)(local_f8 + (longlong)(iVar6 + -1) * 4);
      iVar3 = 0;
      if (0 < iVar6) {
        lVar11 = (longlong)(iVar6 + -1) * 4 - (longlong)puVar4;
        do {
          uVar13 = *(uint *)((longlong)puVar4 + (longlong)((longlong)local_98 + lVar11));
          uVar16 = *puVar4;
          if (uVar16 >= uVar13 && uVar16 != uVar13) break;
          if (uVar16 < uVar13) goto LAB_14012f3c1;
          iVar3 = iVar3 + 1;
          puVar4 = puVar4 + -1;
        } while (iVar3 < iVar6);
      }
    }
    iVar3 = FUN_14011fa20(&local_100,&local_a0,&local_100);
  }
  else {
    iVar3 = FUN_14011efe0(&local_100,&local_a0,&local_100);
    iVar18 = local_8c._4_4_;
  }
LAB_14012f3fa:
  iVar6 = 0;
  if (iVar3 != 0) goto LAB_14012f8ff;
  if (local_144 == local_12c._4_4_) {
    if (iVar5 < (int)uVar14) {
LAB_14012f483:
      pppuVar8 = &local_140;
      pppuVar9 = &local_120;
    }
    else {
      if (iVar5 <= (int)uVar14) {
        puVar4 = (uint *)(_Dst_00 + (longlong)(int)(uVar14 - 1) * 4);
        if (0 < (int)uVar14) {
          lVar11 = (longlong)(int)(uVar14 - 1) * 4 - (longlong)puVar4;
          iVar3 = iVar6;
          do {
            uVar13 = *(uint *)((longlong)puVar4 + (longlong)(local_138 + lVar11));
            uVar16 = *puVar4;
            if (uVar16 >= uVar13 && uVar16 != uVar13) break;
            if (uVar16 < uVar13) goto LAB_14012f46a;
            iVar3 = iVar3 + 1;
            puVar4 = puVar4 + -1;
          } while (iVar3 < (int)uVar14);
        }
        goto LAB_14012f483;
      }
LAB_14012f46a:
      local_10c = (ulonglong)CONCAT14(local_144 == 0,(int)local_10c);
      pppuVar8 = &local_120;
      pppuVar9 = &local_140;
    }
    iVar3 = FUN_14011fa20(pppuVar9,pppuVar8,&local_120);
  }
  else {
    iVar3 = FUN_14011efe0(&local_120,&local_140,&local_120);
    iVar5 = local_130;
  }
  _Dst_00 = local_118;
  if (iVar3 != 0) goto LAB_14012f8ff;
  if (local_cc._4_4_ == local_ac._4_4_) {
    if ((int)local_148 < iVar12) {
LAB_14012f523:
      pppuVar8 = &local_c0;
      pppuVar9 = &local_e0;
    }
    else {
      if ((int)local_148 <= iVar12) {
        puVar4 = (uint *)(local_d8 + (longlong)(iVar12 + -1) * 4);
        if (0 < iVar12) {
          lVar11 = (longlong)(iVar12 + -1) * 4 - (longlong)puVar4;
          do {
            uVar14 = *(uint *)((longlong)puVar4 + (longlong)(local_b8 + lVar11));
            uVar13 = *puVar4;
            if (uVar13 >= uVar14 && uVar13 != uVar14) break;
            if (uVar13 < uVar14) goto LAB_14012f50d;
            iVar6 = iVar6 + 1;
            puVar4 = puVar4 + -1;
          } while (iVar6 < iVar12);
        }
        goto LAB_14012f523;
      }
LAB_14012f50d:
      local_cc = (ulonglong)CONCAT14(local_cc._4_4_ == 0,(int)local_cc);
      pppuVar8 = &local_e0;
      pppuVar9 = &local_c0;
    }
    iVar3 = FUN_14011fa20(pppuVar9,pppuVar8,&local_e0);
  }
  else {
    iVar3 = FUN_14011efe0(&local_e0,&local_c0,&local_e0);
    local_148 = local_b0;
  }
  _Dst_00 = local_118;
  if (iVar3 != 0) goto LAB_14012f8ff;
  local_res20 = local_ec._4_4_;
  uVar17 = (ulonglong)local_f0;
  local_144 = local_10c._4_4_;
  iVar12 = local_d0;
  uVar14 = local_110;
LAB_14012f770:
  uVar13 = local_148;
  if ((int)uVar17 == 0) goto LAB_14012f78c;
  goto LAB_14012ed80;
LAB_14012f78c:
  if ((((iVar18 != 1) && ((int)local_90 < 2)) && (*local_98 < 2)) && (*local_98 != 0)) {
    do {
      if (local_12c._4_4_ != 1) goto LAB_14012f7f0;
      iVar3 = FUN_14011fe40(&local_140,param_2,&local_140);
    } while (iVar3 == 0);
    goto LAB_14012f8ff;
  }
  goto LAB_14012f8fa;
LAB_14012f7f0:
  iVar12 = *(int *)(param_2 + 2);
  if (local_130 <= iVar12) {
    if (local_130 < iVar12) {
LAB_14012f8e3:
      FUN_14011da60(&local_140);
      iVar3 = 0;
      goto LAB_14012f8ff;
    }
    puVar4 = (uint *)(local_138 + (longlong)(local_130 + -1) * 4);
    iVar5 = 0;
    if (0 < local_130) {
      lVar11 = (longlong)(local_130 + -1) * 4 - (longlong)puVar4;
      do {
        uVar14 = *(uint *)((longlong)puVar4 + (longlong)param_2[1] + lVar11);
        uVar13 = *puVar4;
        if (uVar13 >= uVar14 && uVar13 != uVar14) break;
        if (uVar13 < uVar14) goto LAB_14012f8e3;
        iVar5 = iVar5 + 1;
        puVar4 = puVar4 + -1;
      } while (iVar5 < local_130);
    }
  }
  iVar5 = 0;
  if (local_12c._4_4_ == *(int *)(param_2 + 3)) {
    if (iVar12 < local_130) {
LAB_14012f8c2:
      pppuVar9 = &local_140;
      pppuVar8 = param_2;
    }
    else {
      if (iVar12 <= local_130) {
        puVar4 = (uint *)(local_138 + (longlong)(local_130 + -1) * 4);
        if (0 < local_130) {
          lVar11 = (longlong)(local_130 + -1) * 4 - (longlong)puVar4;
          do {
            uVar14 = *(uint *)((longlong)puVar4 + (longlong)param_2[1] + lVar11);
            uVar13 = *puVar4;
            if (uVar13 >= uVar14 && uVar13 != uVar14) break;
            if (uVar13 < uVar14) goto LAB_14012f8ac;
            iVar5 = iVar5 + 1;
            puVar4 = puVar4 + -1;
          } while (iVar5 < local_130);
        }
        goto LAB_14012f8c2;
      }
LAB_14012f8ac:
      local_12c = (ulonglong)CONCAT14(local_12c._4_4_ == 0,(int)local_12c);
      pppuVar8 = &local_140;
      pppuVar9 = param_2;
    }
    iVar3 = FUN_14011fa20(pppuVar9,pppuVar8,&local_140);
  }
  else {
    iVar3 = FUN_14011efe0(&local_140,param_2,&local_140);
  }
  if (iVar3 != 0) goto LAB_14012f8ff;
  goto LAB_14012f7f0;
}



ulonglong FUN_14012fb80(undefined8 param_1,undefined ***param_2,longlong param_3,undefined8 param_4)

{
  uint uVar1;
  int *piVar2;
  int iVar3;
  ulonglong uVar4;
  int iVar5;
  undefined4 uVar6;
  undefined **local_60;
  void *local_58;
  undefined4 local_50;
  ulonglong local_4c;
  undefined **local_40;
  void *local_38;
  undefined4 local_30;
  undefined8 local_2c;
  
  if (*(int *)(param_3 + 0x18) == 1) {
    return 0xfffffffd;
  }
  if (*(int *)(param_2 + 3) == 1) {
    local_40 = mp_int::vftable;
    local_38 = operator_new(0x80);
    memset(local_38,0,0x80);
    local_30 = 0;
    local_2c = 0x20;
    local_60 = mp_int::vftable;
    local_58 = operator_new(0x80);
    memset(local_58,0,0x80);
    local_50 = 0;
    iVar5 = 0x20;
    local_4c = 0x20;
    if ((*(int *)(param_3 + 0x18) == 1) || (*(int *)(param_3 + 0x10) == 0)) {
      uVar4 = 0xfffffffd;
    }
    else {
      if ((*(int *)(param_3 + 0x10) < 1) || ((**(byte **)(param_3 + 8) & 1) == 0)) {
        uVar1 = FUN_14012ea10(param_1,param_3,&local_40);
      }
      else {
        uVar1 = FUN_14012c010(param_1,param_3,&local_40);
      }
      uVar4 = (ulonglong)uVar1;
      if (uVar1 == 0) {
        if (param_2 == &local_60) {
LAB_14012fce4:
          local_4c = local_4c & 0xffffffff;
          uVar1 = FUN_14012fb80(&local_40,&local_60,param_3,param_4);
          local_60 = mp_int::vftable;
          if ((local_58 != (void *)0x0) && ((int)local_4c != 0)) {
            memset(local_58,0,(longlong)((int)local_4c << 2));
          }
          operator_delete(local_58);
          local_58 = (void *)0x0;
          local_4c = 0;
          local_50 = 0;
          local_40 = mp_int::vftable;
          if ((local_38 != (void *)0x0) && ((int)local_2c != 0)) {
            memset(local_38,0,(longlong)((int)local_2c << 2));
          }
          operator_delete(local_38);
          return (ulonglong)uVar1;
        }
        uVar1 = FUN_14011d9d0();
        uVar4 = (ulonglong)uVar1;
        if (uVar1 == 0) goto LAB_14012fce4;
        local_60 = mp_int::vftable;
        if ((local_58 != (void *)0x0) && ((int)local_4c != 0)) {
          memset(local_58,0,(longlong)((int)local_4c << 2));
        }
        operator_delete(local_58);
        goto LAB_14012fda8;
      }
      iVar5 = (int)local_4c;
    }
    local_60 = mp_int::vftable;
    if ((local_58 != (void *)0x0) && (iVar5 != 0)) {
      memset(local_58,0,(longlong)(iVar5 << 2));
    }
    operator_delete(local_58);
LAB_14012fda8:
    local_4c = 0;
    local_50 = 0;
    local_58 = (void *)0x0;
    local_40 = mp_int::vftable;
    if ((local_38 != (void *)0x0) && ((int)local_2c != 0)) {
      memset(local_38,0,(longlong)((int)local_2c << 2));
    }
    operator_delete(local_38);
    return uVar4;
  }
  uVar1 = *(uint *)(param_3 + 0x10);
  uVar4 = (ulonglong)uVar1;
  if (uVar1 != 0) {
    if (uVar1 == 1) {
LAB_14012fe29:
      uVar6 = 1;
      goto LAB_14012fe32;
    }
    if (1 < (int)uVar1) {
      iVar5 = 0;
      if (0 < (int)uVar1) {
        piVar2 = *(int **)(param_3 + 8);
        do {
          if (*piVar2 == 0xfffffff) {
            iVar5 = iVar5 + 1;
          }
          piVar2 = piVar2 + 1;
          uVar4 = uVar4 - 1;
        } while (uVar4 != 0);
      }
      if ((int)uVar1 / 2 <= iVar5) goto LAB_14012fe29;
    }
  }
  if ((int)uVar1 < 2) {
LAB_14012fe75:
    iVar5 = FUN_14011e7a0(param_3);
    iVar5 = iVar5 * 2;
  }
  else {
    iVar5 = 1;
    iVar3 = 1;
    if (1 < (int)uVar1) {
      piVar2 = *(int **)(param_3 + 8);
      do {
        piVar2 = piVar2 + 1;
        if (*piVar2 != 0xfffffff) goto LAB_14012fe75;
        iVar3 = iVar3 + 1;
      } while (iVar3 < (int)uVar1);
    }
  }
  if (((0 < (int)uVar1) && ((**(byte **)(param_3 + 8) & 1) != 0)) || (iVar5 != 0)) {
    uVar4 = FUN_14012df80(param_1,param_2,param_3,param_4,iVar5);
    return uVar4;
  }
  uVar6 = 0;
LAB_14012fe32:
  uVar4 = FUN_14012d500(param_1,param_2,param_3,param_4,uVar6);
  return uVar4;
}



undefined8 * FUN_14012fed0(undefined8 *param_1,undefined8 param_2)

{
  undefined4 uVar1;
  
  FUN_1401043c0();
  *param_1 = OutputDataBuffer::vftable;
  param_1[1] = param_2;
  *(undefined4 *)(param_1 + 2) = 0;
  *(undefined1 *)((longlong)param_1 + 0x14) = 0;
  *(undefined4 *)(param_1 + 3) = 0;
  FUN_1400b6fd0(param_1 + 4);
  *(undefined1 *)(param_1 + 0x18) = 0;
  param_1[0x19] = 0;
  *(undefined1 *)(param_1 + 0x1a) = 0;
  if (param_1[1] != 0) {
    uVar1 = FUN_1400b8b80();
    *(undefined4 *)(param_1 + 2) = uVar1;
  }
  return param_1;
}



void FUN_14012ff50(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  
  *param_1 = OutputDataBuffer::vftable;
  param_1[1] = 0;
  plVar1 = (longlong *)param_1[0x19];
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x10))(plVar1,1,param_3,param_4,0xfffffffffffffffe);
    param_1[0x19] = 0;
  }
  FUN_1400b7090(param_1 + 4);
  FUN_1401043d0(param_1);
  return;
}



undefined8 FUN_14012ffc0(longlong param_1)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  if (*(longlong **)(param_1 + 200) != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x00014012ffdd. Too many branches
                    // WARNING: Treating indirect jump as call
    uVar2 = (**(code **)(**(longlong **)(param_1 + 200) + 0x18))();
    return uVar2;
  }
  if (*(longlong *)(param_1 + 8) == 0) {
    return 0;
  }
  uVar1 = FUN_1400b8b80();
  *(undefined4 *)(param_1 + 0x10) = uVar1;
  return 1;
}



undefined8 FUN_140130010(longlong param_1,undefined8 param_2)

{
  char cVar1;
  uint uVar2;
  uint uVar3;
  undefined8 uVar4;
  
  if (*(longlong **)(param_1 + 200) != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x000140130039. Too many branches
                    // WARNING: Treating indirect jump as call
    uVar4 = (**(code **)(**(longlong **)(param_1 + 200) + 0x20))();
    return uVar4;
  }
  if (*(char *)(param_1 + 0x14) == '\0') {
    cVar1 = FUN_140105960(param_2);
    if ((cVar1 == '\0') && (*(longlong *)(param_1 + 8) != 0)) {
      uVar2 = FUN_140105a60(param_2);
      *(uint *)(param_1 + 0x10) = uVar2;
      uVar3 = FUN_1400b8b80(*(undefined8 *)(param_1 + 8));
      if (uVar3 <= uVar2) {
        FUN_1400ba520(*(undefined8 *)(param_1 + 8),uVar2 + 1);
      }
      return 1;
    }
  }
  return 0;
}



undefined1 FUN_1401300a0(longlong param_1)

{
  return *(undefined1 *)(param_1 + 0x14);
}



ulonglong FUN_1401300b0(longlong param_1)

{
  ulonglong uVar1;
  
  if (*(longlong *)(param_1 + 200) != 0) {
                    // WARNING: Could not recover jumptable at 0x0001401300c4. Too many branches
                    // WARNING: Treating indirect jump as call
    uVar1 = (**(code **)(**(longlong **)(param_1 + 200) + 0x28))();
    return uVar1;
  }
  if (*(longlong *)(param_1 + 8) == 0) {
    return 0;
  }
  return (ulonglong)*(uint *)(param_1 + 0x10);
}



void FUN_1401300e0(undefined8 *param_1)

{
  (**(code **)*param_1)();
  return;
}



undefined8 FUN_140130110(longlong param_1)

{
  longlong *plVar1;
  undefined8 uVar2;
  
  plVar1 = *(longlong **)(param_1 + 200);
  if (plVar1 != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x00014013012a. Too many branches
                    // WARNING: Treating indirect jump as call
    uVar2 = (**(code **)(*plVar1 + 0x30))(plVar1);
    return uVar2;
  }
  *(undefined4 *)(param_1 + 0x10) = 0;
  if (*(longlong *)(param_1 + 8) != 0) {
    FUN_1400b8b30();
  }
  return 1;
}



void FUN_140130150(undefined8 param_1,undefined8 param_2)

{
  FUN_1400bdb00(param_2,"memory");
  return;
}



undefined1 FUN_140130160(longlong param_1)

{
  undefined1 uVar1;
  
  if (*(longlong *)(param_1 + 8) != 0) {
    uVar1 = FUN_1400ba520();
    return uVar1;
  }
  return 1;
}



void FUN_140130180(longlong param_1,undefined8 param_2)

{
  if (*(longlong *)(param_1 + 8) != 0) {
    FUN_1400b9e90(param_2);
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

ulonglong FUN_1401301a0(longlong param_1,void *param_2,int param_3,uint param_4,undefined8 param_5,
                       longlong *param_6)

{
  char cVar1;
  int iVar2;
  uint uVar3;
  undefined4 uVar4;
  uint uVar5;
  ulonglong uVar6;
  undefined8 uVar7;
  longlong lVar8;
  void *pvVar9;
  
  uVar6 = (ulonglong)param_4;
  _DAT_140316f4c = 0x78;
  if (((param_2 == (void *)0x0) || (param_3 == 0)) || (param_4 == 0)) {
    return 0;
  }
  if (*(longlong *)(param_1 + 200) != 0) {
    _DAT_140316f4c = 0x79;
    uVar6 = FUN_1401043f0(*(undefined8 *)(param_1 + 200),param_2,param_3,uVar6,param_5,param_6);
    return uVar6;
  }
  if (*(char *)(param_1 + 0x14) != '\0') {
    _DAT_140316f4c = 0x78;
    return 0;
  }
  if (*(longlong *)(param_1 + 8) == 0) {
    _DAT_140316f4c = 0x78;
    return 0;
  }
  _DAT_140316f4c = 0x7a;
  param_4 = param_3 * param_4;
  uVar5 = *(int *)(param_1 + 0x10) + 8 + param_4;
  if (((*(int *)(param_1 + 0x18) == 0) || (iVar2 = FUN_1400b8350(param_1 + 0x20), iVar2 == 0)) ||
     ((*(char *)(param_1 + 0xd0) != '\0' ||
      (_DAT_140316f4c = 0x7c, uVar5 <= *(uint *)(param_1 + 0x18))))) {
LAB_1401302e1:
    _DAT_140316f4c = 0x7b;
    uVar3 = FUN_1400bbb10(*(undefined8 *)(param_1 + 8));
    if (uVar3 < uVar5) {
      _DAT_140316f4c = 0x7f;
      iVar2 = uVar5 + (uVar5 >> 1);
      cVar1 = FUN_1400ba520(*(undefined8 *)(param_1 + 8),iVar2);
      if (cVar1 != '\0') goto LAB_14013041d;
      _DAT_140316f4c = 0x8a;
      (**(code **)(*param_6 + 0x28))(param_6,"Failed to allocate memory for output data buffer.");
      FUN_1400cf580(param_6,"ensureSz0",uVar5);
      FUN_1400cf580(param_6,"ensureSz",iVar2);
      FUN_1400cf580(param_6,"m_idx",*(undefined4 *)(param_1 + 0x10));
      FUN_1400cf580(param_6,&DAT_14024af08,param_3);
      FUN_1400cf580(param_6,"count",uVar6);
      goto LAB_140130397;
    }
LAB_14013041d:
    _DAT_140316f4c = 0x89;
    pvVar9 = (void *)FUN_1400b8ba0(*(undefined8 *)(param_1 + 8));
    _DAT_140316f4c = 0x80;
    if (pvVar9 == (void *)0x0) {
      if (param_4 != 0) {
        if (*(int *)(param_1 + 0x10) == 0) {
LAB_1401304d6:
          _DAT_140316f4c = 0x82;
          cVar1 = FUN_1400b97e0(*(undefined8 *)(param_1 + 8),param_2,param_4);
          if (cVar1 != '\0') goto LAB_1401304f7;
        }
        else {
          _DAT_140316f4c = 0x81;
          uVar5 = FUN_1400b8b80(*(undefined8 *)(param_1 + 8));
          if (*(uint *)(param_1 + 0x10) <= uVar5) goto LAB_1401304d6;
          iVar2 = FUN_1400b8b80(*(undefined8 *)(param_1 + 8));
          uVar5 = *(int *)(param_1 + 0x10) - iVar2;
          pvVar9 = operator_new((ulonglong)uVar5);
          if (pvVar9 != (void *)0x0) {
            memset(pvVar9,0,(ulonglong)uVar5);
            cVar1 = FUN_1400b97e0(*(undefined8 *)(param_1 + 8),pvVar9,uVar5);
            operator_delete(pvVar9);
            if (cVar1 != '\0') goto LAB_1401304d6;
          }
        }
LAB_140130397:
        *(undefined1 *)(param_1 + 0x14) = 1;
        goto LAB_14013039b;
      }
    }
    else if (param_4 != 0) {
      memcpy(pvVar9,param_2,(ulonglong)param_4);
    }
LAB_1401304f7:
    _DAT_140316f4c = 0x83;
    *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + param_4;
    uVar5 = *(uint *)(param_1 + 0x10);
    uVar3 = FUN_1400b8b80(*(undefined8 *)(param_1 + 8));
    if (uVar3 < uVar5) {
      FUN_1400b8c10(*(undefined8 *)(param_1 + 8),uVar5);
    }
    _DAT_140316f4c = 0x84;
  }
  else {
    (**(code **)(*param_6 + 0x30))(param_6,"Rerouting in-memory output to file because of size.");
    FUN_1400cf520(param_6,"rerouteSize",*(undefined4 *)(param_1 + 0x18));
    uVar7 = FUN_1400b7ce0(param_1 + 0x20);
    lVar8 = FUN_140104860(uVar7,param_6);
    *(longlong *)(param_1 + 200) = lVar8;
    if (lVar8 == 0) {
      *(undefined1 *)(param_1 + 0xd0) = 1;
      goto LAB_1401302e1;
    }
    uVar4 = FUN_1400b8b80(*(undefined8 *)(param_1 + 8));
    uVar7 = FUN_1400b8b90(*(undefined8 *)(param_1 + 8));
    iVar2 = FUN_140104440(*(undefined8 *)(param_1 + 200),uVar7,uVar4,1,param_6);
    if (iVar2 == 1) {
      FUN_1400b8b30(*(undefined8 *)(param_1 + 8));
      FUN_1400ba560(*(undefined8 *)(param_1 + 8));
      *(undefined1 *)(param_1 + 0xc0) = 1;
      uVar6 = FUN_1401043f0(*(undefined8 *)(param_1 + 200),param_2,param_3,uVar6,param_5,param_6);
      return uVar6;
    }
LAB_14013039b:
    uVar6 = 0;
  }
  return uVar6;
}



undefined8 * FUN_140130550(undefined8 *param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  
  *param_1 = OutputDataBuffer::vftable;
  param_1[1] = 0;
  plVar1 = (longlong *)param_1[0x19];
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x10))(plVar1,1,param_3,param_4,0xfffffffffffffffe);
    param_1[0x19] = 0;
  }
  FUN_1400b7090(param_1 + 4);
  FUN_1401043d0(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1401305d0(undefined8 *param_1)

{
  *param_1 = 0;
  FUN_14011d870(param_1 + 1);
  FUN_14011d870(param_1 + 5);
  FUN_14011d870(param_1 + 9);
  FUN_14011d870(param_1 + 0xd);
  FUN_14011d870(param_1 + 0x11);
  FUN_14011d870(param_1 + 0x15);
  FUN_14011d870(param_1 + 0x19);
  FUN_14011d870(param_1 + 0x1d);
  return param_1;
}



undefined8
FUN_140130650(longlong param_1,uint param_2,int param_3,longlong param_4,char param_5,
             undefined8 param_6,longlong *param_7)

{
  longlong lVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  undefined8 uVar5;
  undefined1 local_a8 [32];
  undefined1 local_88 [32];
  undefined1 local_68 [32];
  undefined1 local_48 [40];
  undefined8 local_20;
  
  local_20 = 0xfffffffffffffffe;
  if (param_3 == 1) {
    if (*(int *)(param_4 + 4) != 1) {
      (**(code **)(*param_7 + 0x28))(param_7,"Private key required, but not provided");
      return 0;
    }
  }
  else if (param_3 != 0) {
    (**(code **)(*param_7 + 0x28))(param_7,"Invalid public/private key choice");
    return 0;
  }
  FUN_14011d870(local_a8);
  if ((param_1 != 0) && (param_2 != 0)) {
    FUN_14011e6e0(local_a8,param_1,param_2);
  }
  FUN_14011d870(local_68);
  FUN_14011d870(local_88);
  lVar1 = param_4 + 0x48;
  iVar2 = FUN_14011ff00(lVar1,local_a8);
  if (iVar2 == -1) {
    (**(code **)(*param_7 + 0x28))(param_7,"Invalid RSA input value");
    FUN_14011d980(local_88);
    FUN_14011d980(local_68);
    FUN_14011d980(local_a8);
    return 0;
  }
  if (param_3 == 1) {
    iVar2 = FUN_14012fb80(local_a8,param_4 + 200,param_4 + 0x68,local_68);
    if (iVar2 != 0) {
      (**(code **)(*param_7 + 0x28))(param_7,"Modular exponentiation (1) failed");
      FUN_14011d980(local_88);
      FUN_14011d980(local_68);
      FUN_14011d980(local_a8);
      return 0;
    }
    iVar2 = FUN_14012fb80(local_a8,param_4 + 0xe8,param_4 + 0x88,local_88);
    if (iVar2 != 0) {
      (**(code **)(*param_7 + 0x28))(param_7,"Modular exponentiation (2) failed");
      FUN_14011d980(local_88);
      FUN_14011d980(local_68);
      FUN_14011d980(local_a8);
      return 0;
    }
    iVar2 = FUN_140122ee0(local_68,local_88,local_a8);
    if (iVar2 != 0) {
      (**(code **)(*param_7 + 0x28))(param_7,"Modular exponentiation (3) failed");
      FUN_14011d980(local_88);
      FUN_14011d980(local_68);
      FUN_14011d980(local_a8);
      return 0;
    }
    iVar2 = FUN_14012b850(local_a8,param_4 + 0xa8,param_4 + 0x68,local_a8);
    if (iVar2 != 0) {
      (**(code **)(*param_7 + 0x28))(param_7,"Modular exponentiation (4) failed");
      FUN_14011d980(local_88);
      FUN_14011d980(local_68);
      FUN_14011d980(local_a8);
      return 0;
    }
    iVar2 = FUN_14012b7a0(local_a8,param_4 + 0x88,local_a8);
    if (iVar2 != 0) {
      (**(code **)(*param_7 + 0x28))(param_7,"Modular exponentiation (5) failed");
      FUN_14011d980(local_88);
      FUN_14011d980(local_68);
      FUN_14011d980(local_a8);
      return 0;
    }
    iVar2 = FUN_14011fe40(local_a8,local_88,local_a8);
    if (iVar2 != 0) {
      (**(code **)(*param_7 + 0x28))(param_7,"Modular exponentiation (6) failed");
      FUN_14011d980(local_88);
      FUN_14011d980(local_68);
      FUN_14011d980(local_a8);
      return 0;
    }
  }
  else {
    iVar2 = FUN_14012fb80(local_a8,param_4 + 8,lVar1,local_a8);
    if (iVar2 != 0) {
      (**(code **)(*param_7 + 0x28))(param_7,"Modular exponentiation (A) failed");
      FUN_14011d980(local_88);
      FUN_14011d980(local_68);
      FUN_14011d980(local_a8);
      return 0;
    }
  }
  uVar3 = FUN_14011ea30(lVar1);
  uVar4 = FUN_14011ea30(local_a8);
  if (uVar3 < uVar4) {
    (**(code **)(*param_7 + 0x28))(param_7,"Modular exponentiation output size is invalid");
    FUN_14011d980(local_88);
    FUN_14011d980(local_68);
    FUN_14011d980(local_a8);
    uVar5 = 0;
  }
  else {
    FUN_1400b8c40(local_48);
    FUN_140122fa0(local_a8,local_48);
    if ((((param_5 != '\0') && (iVar2 = FUN_1400b8b80(local_48), iVar2 != 0)) &&
        (uVar3 = FUN_14011ea30(lVar1), param_2 == uVar3)) &&
       (uVar3 = FUN_1400b8b80(local_48), uVar3 < param_2)) {
      (**(code **)(*param_7 + 0x30))(param_7,"Zero-extending to match modulus byte length");
      iVar2 = FUN_1400b8b80(local_48);
      FUN_1400b95c0(param_6,0,param_2 - iVar2);
    }
    FUN_1400b9e90(param_6,local_48);
    FUN_1400b92d0(local_48);
    FUN_14011d980(local_88);
    FUN_14011d980(local_68);
    FUN_14011d980(local_a8);
    uVar5 = 1;
  }
  return uVar5;
}



ulonglong FUN_140130a90(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined4 param_4,
                       undefined4 param_5,int param_6,int *param_7,undefined4 param_8,char param_9,
                       undefined8 param_10,undefined8 param_11,char param_12,longlong *param_13)

{
  char cVar1;
  byte bVar2;
  int iVar3;
  int iVar4;
  undefined4 uVar5;
  DWORD DVar6;
  ulonglong uVar7;
  undefined8 uVar8;
  undefined8 in_stack_ffffffffffffff58;
  undefined8 in_stack_ffffffffffffff60;
  undefined4 uVar9;
  undefined1 local_80 [40];
  undefined1 local_58 [48];
  
  uVar5 = (undefined4)((ulonglong)in_stack_ffffffffffffff58 >> 0x20);
  uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffff60 >> 0x20);
  if ((param_6 != 1) && (param_6 != 2)) {
    param_6 = 1;
  }
  iVar3 = *param_7;
  if (iVar3 == 0) {
    iVar3 = FUN_14011deb0(param_7 + 0x12);
  }
  iVar4 = FUN_14011ea30(param_7 + 0x12);
  if (param_12 != '\0') {
    FUN_1400cf520(param_13,"modulus_bitlen",iVar3);
    FUN_1400cf520(param_13,"littleEndian",param_9);
  }
  FUN_1400b8c40(local_80);
  if (param_6 == 2) {
    if (param_12 != '\0') {
      (**(code **)(*param_13 + 0x58))(param_13,"padding",&DAT_14024b2d0);
    }
    cVar1 = FUN_14013e5a0(param_1,param_2,param_3,param_4,CONCAT44(uVar5,iVar3),
                          CONCAT44(uVar9,param_5),local_80,param_13);
    if (cVar1 == '\0') {
      uVar7 = FUN_1400b92d0(local_80);
      return uVar7 & 0xffffffffffffff00;
    }
  }
  else {
    if (param_12 != '\0') {
      (**(code **)(*param_13 + 0x58))(param_13,"padding","PKCS 1.5");
    }
    cVar1 = FUN_14013e0b0(param_1,param_2,2,iVar3,local_80,param_13);
    if (cVar1 == '\0') {
      uVar7 = FUN_1400b92d0(local_80);
      return uVar7 & 0xffffffffffffff00;
    }
  }
  if (param_12 != '\0') {
    uVar5 = FUN_1400b8b80(local_80);
    uVar8 = FUN_1400b8b90(local_80);
    FUN_1400cf340(param_13,"paddedData",uVar8,uVar5);
  }
  FUN_1400b8c40(local_58);
  DVar6 = GetTickCount();
  uVar5 = FUN_1400b8b80(local_80);
  uVar8 = FUN_1400b8b90(local_80);
  bVar2 = FUN_140130650(uVar8,uVar5,param_8,param_7,1,local_58,param_13);
  if (param_12 != '\0') {
    FUN_1400cf4a0(param_13,"exptmod",DVar6);
  }
  iVar3 = FUN_1400b8b80(local_58);
  if (iVar3 == iVar4) {
    if (param_9 == '\0') {
      FUN_1400b9870(local_58);
    }
    FUN_1400b9e90(param_11,local_58);
    FUN_1400b92d0(local_58);
    FUN_1400b92d0(local_80);
    uVar7 = (ulonglong)bVar2;
  }
  else {
    (**(code **)(*param_13 + 0x28))(param_13,"Output of RSA encryption not equal to modulus size.");
    FUN_1400cf520(param_13,"modulus_bytelen",iVar4);
    uVar5 = FUN_1400b8b80(local_80);
    FUN_1400cf520(param_13,"InLength",uVar5);
    uVar5 = FUN_1400b8b80(local_58);
    FUN_1400cf520(param_13,"OutputLength",uVar5);
    FUN_1400b92d0(local_58);
    uVar7 = FUN_1400b92d0(local_80);
    uVar7 = uVar7 & 0xffffffffffffff00;
  }
  return uVar7;
}



undefined8
FUN_140130da0(longlong param_1,int param_2,undefined8 param_3,undefined4 param_4,undefined4 param_5,
             int param_6,char param_7,uint *param_8,undefined4 param_9,char param_10,
             undefined8 param_11,undefined8 param_12,char param_13,longlong *param_14)

{
  longlong lVar1;
  char cVar2;
  uint uVar3;
  int iVar4;
  DWORD DVar5;
  undefined4 uVar6;
  uint uVar7;
  undefined4 uVar8;
  undefined8 uVar9;
  undefined1 local_res8 [8];
  ulonglong in_stack_fffffffffffffef8;
  undefined4 uVar10;
  undefined1 *puVar11;
  undefined1 local_e8 [40];
  undefined1 local_c0 [40];
  undefined1 local_98 [40];
  undefined8 local_70;
  undefined1 local_68 [48];
  
  local_70 = 0xfffffffffffffffe;
  FUN_1400b8c40(local_c0);
  if ((param_1 == 0) || (param_2 == 0)) {
    if (param_13 != '\0') {
      (**(code **)(*param_14 + 0x30))(param_14,"Nothing to RSA decrypt.");
    }
    goto LAB_1401312ac;
  }
  if ((param_6 != 1) && (param_6 != 2)) {
    (**(code **)(*param_14 + 0x28))(param_14,"Invalid padding selection.");
    FUN_1400cf520(param_14,"padding",param_6);
    FUN_1400b92d0(local_c0);
    return 0;
  }
  uVar3 = *param_8;
  if (uVar3 == 0) {
    uVar3 = FUN_14011deb0(param_8 + 0x12);
  }
  if (param_13 != '\0') {
    FUN_1400cf520(param_14,"modulus_bitlen",uVar3);
    FUN_1400cf520(param_14,"littleEndian",param_10);
  }
  iVar4 = FUN_14011ea30(param_8 + 0x12);
  if (param_2 == iVar4 + -2) {
    FUN_1400b9550(local_c0,0);
    FUN_1400b9550(local_c0,0);
    FUN_1400b97e0(local_c0,param_1,param_2);
    param_2 = param_2 + 2;
LAB_140130ef1:
    param_1 = FUN_1400b8b90(local_c0);
  }
  else if (param_2 == iVar4 + -1) {
    FUN_1400b9550(local_c0,0);
    FUN_1400b97e0(local_c0,param_1,param_2);
    param_2 = param_2 + 1;
    goto LAB_140130ef1;
  }
  if (iVar4 != param_2) {
    (**(code **)(*param_14 + 0x28))(param_14,"Input length not equal to modulus length");
    FUN_1400cf520(param_14,"ModulusLen",iVar4);
    FUN_1400cf520(param_14,"InputLen",param_2);
    FUN_1400b92d0(local_c0);
    return 0;
  }
  FUN_1400b8c40(local_98);
  if (param_10 == '\0') {
    (**(code **)(*param_14 + 0x30))(param_14,"Byte swapping from big-endian to little-endian");
    FUN_1400b97e0(local_98,param_1,param_2);
    FUN_1400b9870(local_98);
    param_1 = FUN_1400b8b90(local_98);
  }
  if (param_13 != '\0') {
    FUN_1400cf340(param_14,"encryptedData",param_1,param_2);
  }
  FUN_1400b8c40(local_e8);
  DVar5 = GetTickCount();
  puVar11 = local_e8;
  in_stack_fffffffffffffef8 = in_stack_fffffffffffffef8 & 0xffffffffffffff00;
  cVar2 = FUN_140130650(param_1,param_2,param_9,param_8,in_stack_fffffffffffffef8,puVar11,param_14);
  if (cVar2 == '\0') {
    FUN_1400b92d0(local_e8);
    FUN_1400b92d0(local_98);
    FUN_1400b92d0(local_c0);
    return 0;
  }
  if (param_13 != '\0') {
    FUN_1400cf4a0(param_14,"exptmod",DVar5);
    uVar6 = FUN_1400b8b80(local_e8);
    uVar9 = FUN_1400b8b90(local_e8);
    FUN_1400cf340(param_14,"exptmod_decoded",uVar9,uVar6);
    uVar6 = FUN_1400b8b80(local_e8);
    FUN_1400cf520(param_14,"exptmod_decoded_size",uVar6);
  }
  if (param_7 == '\0') {
    if (param_6 == 2) {
      if (param_13 != '\0') {
        (**(code **)(*param_14 + 0x58))(param_14,"padding",&DAT_14024b2d0);
      }
      local_res8[0] = 0;
      uVar7 = FUN_1400b8b80(local_e8);
      uVar10 = (undefined4)(in_stack_fffffffffffffef8 >> 0x20);
      uVar6 = (undefined4)((ulonglong)puVar11 >> 0x20);
      while (uVar7 < (uint)((uVar3 & 7) != 0) + (uVar3 >> 3)) {
        FUN_1400ba650(local_e8,local_res8,1);
        uVar7 = FUN_1400b8b80(local_e8);
        uVar10 = (undefined4)(in_stack_fffffffffffffef8 >> 0x20);
        uVar6 = (undefined4)((ulonglong)puVar11 >> 0x20);
      }
      uVar8 = FUN_1400b8b80(local_e8);
      uVar9 = FUN_1400b8b90(local_e8);
      cVar2 = FUN_14013e970(uVar9,uVar8,param_3,param_4,CONCAT44(uVar10,uVar3),
                            CONCAT44(uVar6,param_5),param_12,param_14);
      if (cVar2 == '\0') {
        (**(code **)(*param_14 + 0x28))(param_14,"OAEP decoding failed.");
        FUN_1400b92d0(local_e8);
        FUN_1400b92d0(local_98);
        FUN_1400b92d0(local_c0);
        return 0;
      }
    }
    else {
      if (param_13 != '\0') {
        (**(code **)(*param_14 + 0x58))(param_14,"padding","PKCS 1.5");
      }
      uVar6 = FUN_1400b8b80(local_e8);
      uVar9 = FUN_1400b8b90(local_e8);
      cVar2 = FUN_14013ed30(uVar9,uVar6,2,uVar3,param_12,local_res8,param_11,param_14);
      if (cVar2 == '\0') {
        FUN_1400bcc20(local_68);
        FUN_1400ba700(local_e8,local_68);
        lVar1 = *param_14;
        uVar9 = FUN_1400b8b90(local_68);
        (**(code **)(lVar1 + 0x58))(param_14,"Packet",uVar9);
        FUN_1400bceb0(local_68);
        FUN_1400b92d0(local_e8);
        FUN_1400b92d0(local_98);
        FUN_1400b92d0(local_c0);
        return 0;
      }
      if (param_13 != '\0') {
        uVar6 = FUN_1400b8b80(param_12);
        FUN_1400cf520(param_14,"sizeAfterPkcs15_decode",uVar6);
      }
    }
  }
  else {
    FUN_1400b9e90(param_12,local_e8);
  }
  FUN_1400b92d0(local_e8);
  FUN_1400b92d0(local_98);
LAB_1401312ac:
  FUN_1400b92d0(local_c0);
  return 1;
}



undefined8
FUN_1401312e0(longlong param_1,int param_2,int *param_3,undefined8 param_4,longlong *param_5)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  undefined1 local_res8 [8];
  undefined1 local_58 [8];
  undefined8 local_50;
  undefined1 local_48 [48];
  
  local_50 = 0xfffffffffffffffe;
  FUN_1400b8b30(param_4);
  (**(code **)(*param_5 + 0x48))(param_5,"UnsignRsa",1);
  if ((param_1 == 0) || (param_2 == 0)) {
    (**(code **)(*param_5 + 0x28))(param_5,"Null or zero-length input");
    (**(code **)(*param_5 + 0x50))(param_5);
  }
  else {
    iVar2 = *param_3;
    if (iVar2 == 0) {
      iVar2 = FUN_14011deb0(param_3 + 0x12);
    }
    FUN_1400b8c40(local_48);
    cVar1 = FUN_140130650(param_1,param_2,0,param_3,1,local_48,param_5);
    if (cVar1 == '\0') {
      (**(code **)(*param_5 + 0x28))(param_5,"exptmod failed.");
      (**(code **)(*param_5 + 0x50))(param_5);
      FUN_1400b92d0(local_48);
    }
    else {
      local_58[0] = 0;
      local_res8[0] = 0;
      uVar3 = FUN_1400b8b80(local_48);
      uVar4 = FUN_1400b8b90(local_48);
      cVar1 = FUN_14013ed30(uVar4,uVar3,1,iVar2,param_4,local_58,local_res8,param_5);
      if (cVar1 != '\0') {
        (**(code **)(*param_5 + 0x50))(param_5);
        FUN_1400b92d0(local_48);
        return 1;
      }
      (**(code **)(*param_5 + 0x28))(param_5,"Failed to PKCS 1.5 decode.");
      uVar3 = FUN_1400b8b80(local_48);
      uVar4 = FUN_1400b8b90(local_48);
      FUN_1400cf340(param_5,"exptmod_out",uVar4,uVar3);
      (**(code **)(*param_5 + 0x50))(param_5);
      FUN_1400b92d0(local_48);
    }
  }
  return 0;
}



ulonglong FUN_1401314b0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                       undefined1 param_5)

{
  char cVar1;
  byte bVar2;
  undefined4 uVar3;
  ulonglong uVar4;
  undefined8 uVar5;
  undefined1 local_138 [8];
  undefined8 local_130;
  undefined8 local_128;
  undefined1 local_120 [32];
  undefined1 local_100 [32];
  undefined1 local_e0 [32];
  undefined1 local_c0 [32];
  undefined1 local_a0 [32];
  undefined1 local_80 [32];
  undefined1 local_60 [32];
  undefined1 local_40 [40];
  
  local_130 = 0xfffffffffffffffe;
  local_128 = 0;
  FUN_14011d870(local_120);
  FUN_14011d870(local_100);
  FUN_14011d870(local_e0);
  FUN_14011d870(local_c0);
  FUN_14011d870(local_a0);
  FUN_14011d870(local_80);
  FUN_14011d870(local_60);
  FUN_14011d870(local_40);
  cVar1 = FUN_140131860(param_1,&local_128,param_4,param_5);
  if (cVar1 == '\0') {
    FUN_14011d980(local_40);
    FUN_14011d980(local_60);
    FUN_14011d980(local_80);
    FUN_14011d980(local_a0);
    FUN_14011d980(local_c0);
    FUN_14011d980(local_e0);
    FUN_14011d980(local_100);
    uVar4 = FUN_14011d980(local_120);
    uVar4 = uVar4 & 0xffffffffffffff00;
  }
  else {
    uVar3 = FUN_1400b8b80(param_2);
    uVar5 = FUN_1400b8b90(param_2);
    bVar2 = FUN_140130da0(uVar5,uVar3,0,0,1,1,0,&local_128,1,1,local_138,param_3,param_5,param_4);
    FUN_14011d980(local_40);
    FUN_14011d980(local_60);
    FUN_14011d980(local_80);
    FUN_14011d980(local_a0);
    FUN_14011d980(local_c0);
    FUN_14011d980(local_e0);
    FUN_14011d980(local_100);
    FUN_14011d980(local_120);
    uVar4 = (ulonglong)bVar2;
  }
  return uVar4;
}



ulonglong FUN_140131690(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                       undefined1 param_5)

{
  char cVar1;
  byte bVar2;
  undefined4 uVar3;
  ulonglong uVar4;
  undefined8 uVar5;
  undefined8 local_118;
  undefined1 local_110 [32];
  undefined1 local_f0 [32];
  undefined1 local_d0 [32];
  undefined1 local_b0 [32];
  undefined1 local_90 [32];
  undefined1 local_70 [32];
  undefined1 local_50 [32];
  undefined1 local_30 [40];
  
  local_118 = 0;
  FUN_14011d870(local_110);
  FUN_14011d870(local_f0);
  FUN_14011d870(local_d0);
  FUN_14011d870(local_b0);
  FUN_14011d870(local_90);
  FUN_14011d870(local_70);
  FUN_14011d870(local_50);
  FUN_14011d870(local_30);
  cVar1 = FUN_140131bc0(param_1,&local_118,param_4);
  if (cVar1 == '\0') {
    FUN_14011d980(local_30);
    FUN_14011d980(local_50);
    FUN_14011d980(local_70);
    FUN_14011d980(local_90);
    FUN_14011d980(local_b0);
    FUN_14011d980(local_d0);
    FUN_14011d980(local_f0);
    uVar4 = FUN_14011d980(local_110);
    uVar4 = uVar4 & 0xffffffffffffff00;
  }
  else {
    uVar3 = FUN_1400b8b80(param_2);
    uVar5 = FUN_1400b8b90(param_2);
    bVar2 = FUN_140130a90(uVar5,uVar3,0,0,1,1,&local_118,0,1,1,param_3,param_5,param_4);
    FUN_14011d980(local_30);
    FUN_14011d980(local_50);
    FUN_14011d980(local_70);
    FUN_14011d980(local_90);
    FUN_14011d980(local_b0);
    FUN_14011d980(local_d0);
    FUN_14011d980(local_f0);
    FUN_14011d980(local_110);
    uVar4 = (ulonglong)bVar2;
  }
  return uVar4;
}



undefined8 FUN_140131860(undefined8 param_1,longlong param_2,longlong *param_3,char param_4)

{
  char cVar1;
  undefined4 uVar2;
  int iVar3;
  undefined8 uVar4;
  undefined8 *puVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  longlong lVar9;
  longlong lVar10;
  longlong lVar11;
  longlong lVar12;
  
  uVar2 = FUN_1400b8b80();
  uVar4 = FUN_1400b8b90(param_1);
  puVar5 = (undefined8 *)FUN_1401176f0(uVar4,uVar2,0,param_3);
  if (puVar5 != (undefined8 *)0x0) {
    if (*(int *)((longlong)puVar5 + 0x14) == 0x10) {
      if (puVar5[5] == 0) {
        (**(code **)(*param_3 + 0x28))(param_3,"Invalid ASN.1 for RSA Private Key (6)");
        (**(code **)*puVar5)(puVar5,1);
        return 0;
      }
      iVar3 = FUN_140139d70();
      if (iVar3 < 9) {
        (**(code **)(*param_3 + 0x28))(param_3,"Invalid ASN.1 for RSA Private Key (2)");
        (**(code **)*puVar5)(puVar5,1);
        return 0;
      }
      lVar6 = FUN_1400d0aa0(puVar5[5],1);
      uVar4 = FUN_1400d0aa0(puVar5[5],2);
      lVar7 = FUN_1400d0aa0(puVar5[5],3);
      lVar8 = FUN_1400d0aa0(puVar5[5],4);
      lVar9 = FUN_1400d0aa0(puVar5[5],5);
      lVar10 = FUN_1400d0aa0(puVar5[5],6);
      lVar11 = FUN_1400d0aa0(puVar5[5],7);
      lVar12 = FUN_1400d0aa0(puVar5[5],8);
      if (param_4 != '\0') {
        FUN_1400cf520(param_3,"ModulusLen",*(undefined4 *)(lVar6 + 0x18));
        FUN_1400cf520(param_3,&DAT_14024b558,*(undefined4 *)(lVar7 + 0x18));
        FUN_1400cf520(param_3,&DAT_14024b550,*(undefined4 *)(lVar8 + 0x18));
        FUN_1400cf520(param_3,&DAT_14024b548,*(undefined4 *)(lVar9 + 0x18));
        FUN_1400cf520(param_3,"DPLen",*(undefined4 *)(lVar10 + 0x18));
        FUN_1400cf520(param_3,"DQLen",*(undefined4 *)(lVar11 + 0x18));
        FUN_1400cf520(param_3,"InvQLen",*(undefined4 *)(lVar12 + 0x18));
      }
      *(undefined4 *)(param_2 + 4) = 1;
      cVar1 = FUN_1401177a0(lVar6,param_2 + 0x48);
      if (cVar1 == '\0') {
        (**(code **)(*param_3 + 0x28))(param_3,"Failed to get RSA modulus from ASN.1");
      }
      cVar1 = FUN_1401177a0(uVar4,param_2 + 8);
      if (cVar1 == '\0') {
        (**(code **)(*param_3 + 0x28))(param_3,"Failed to get RSA exponent from ASN.1");
      }
      cVar1 = FUN_1401177a0(lVar8,param_2 + 0x68);
      if (cVar1 == '\0') {
        (**(code **)(*param_3 + 0x28))(param_3,"Failed to get RSA P from ASN.1");
      }
      cVar1 = FUN_1401177a0(lVar9,param_2 + 0x88);
      if (cVar1 == '\0') {
        (**(code **)(*param_3 + 0x28))(param_3,"Failed to get RSA Q from ASN.1");
      }
      cVar1 = FUN_1401177a0(lVar10,param_2 + 200);
      if (cVar1 == '\0') {
        (**(code **)(*param_3 + 0x28))(param_3,"Failed to get RSA DP from ASN.1");
      }
      cVar1 = FUN_1401177a0(lVar11,param_2 + 0xe8);
      if (cVar1 == '\0') {
        (**(code **)(*param_3 + 0x28))(param_3,"Failed to get RSA DQ from ASN.1");
      }
      cVar1 = FUN_1401177a0(lVar12,param_2 + 0xa8);
      if (cVar1 == '\0') {
        (**(code **)(*param_3 + 0x28))(param_3,"Failed to get RSA InverseQ from ASN.1");
      }
      cVar1 = FUN_1401177a0(lVar7,param_2 + 0x28);
      if (cVar1 == '\0') {
        (**(code **)(*param_3 + 0x28))(param_3,"Failed to get RSA D from ASN.1");
      }
      (**(code **)*puVar5)(puVar5,1);
      return 1;
    }
    (**(code **)(*param_3 + 0x28))(param_3,"Invalid ASN.1 for RSA Private Key (5)");
    (**(code **)*puVar5)(puVar5,1);
  }
  return 0;
}



ulonglong FUN_140131bc0(undefined8 param_1,longlong param_2,longlong *param_3)

{
  char cVar1;
  undefined4 uVar2;
  int iVar3;
  undefined8 uVar4;
  undefined8 *puVar5;
  ulonglong uVar6;
  undefined8 uVar7;
  
  uVar2 = FUN_1400b8b80();
  uVar4 = FUN_1400b8b90(param_1);
  puVar5 = (undefined8 *)FUN_1401176f0(uVar4,uVar2,0,param_3);
  uVar6 = 0;
  if (puVar5 != (undefined8 *)0x0) {
    if (*(int *)((longlong)puVar5 + 0x14) == 0x10) {
      if (puVar5[5] == 0) {
        (**(code **)(*param_3 + 0x28))(param_3,"Invalid ASN.1 for RSA Public Key.");
        uVar6 = (**(code **)*puVar5)(puVar5,1);
        return uVar6 & 0xffffffffffffff00;
      }
      iVar3 = FUN_140139d70();
      if (iVar3 < 2) {
        (**(code **)(*param_3 + 0x28))(param_3,"Invalid ASN.1 for RSA Public Key..");
        uVar6 = (**(code **)*puVar5)(puVar5,1);
        return uVar6 & 0xffffffffffffff00;
      }
      uVar4 = FUN_1400d0aa0(puVar5[5],0);
      uVar7 = FUN_1400d0aa0(puVar5[5],1);
      *(undefined4 *)(param_2 + 4) = 0;
      cVar1 = FUN_1401177a0(uVar4,param_2 + 0x48);
      if (cVar1 == '\0') {
        (**(code **)(*param_3 + 0x28))(param_3,"Failed to get RSA modulus from ASN.1");
      }
      uVar6 = (ulonglong)(cVar1 != '\0');
      cVar1 = FUN_1401177a0(uVar7,param_2 + 8);
      if (cVar1 == '\0') {
        (**(code **)(*param_3 + 0x28))(param_3,"Failed to get RSA exponent from ASN.1");
        uVar6 = 0;
      }
      (**(code **)*puVar5)(puVar5,1);
      return uVar6;
    }
    (**(code **)(*param_3 + 0x28))(param_3,"Invalid ASN.1 for RSA Public Key");
    uVar6 = (**(code **)*puVar5)(puVar5,1);
  }
  return uVar6 & 0xffffffffffffff00;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

undefined4 FUN_140131d50(char *param_1)

{
  char cVar1;
  char cVar2;
  int iVar3;
  char *pcVar4;
  longlong lVar5;
  DWORD dwIndex;
  char *pcVar6;
  bool bVar7;
  undefined1 auStackY_538 [32];
  DWORD local_508;
  DWORD local_504;
  undefined1 local_500 [48];
  undefined8 local_4d0;
  CHAR local_4c8 [1200];
  ulonglong local_18;
  
  local_4d0 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStackY_538;
  if (((param_1 != (char *)0x0) &&
      (iVar3 = _stricmp(param_1,"Microsoft Base Cryptographic Provider v1.0"), iVar3 != 0)) &&
     (iVar3 = _stricmp(param_1,"Microsoft Enhanced Cryptographic Provider v1.0"), iVar3 != 0)) {
    iVar3 = _stricmp(param_1,"Microsoft RSA SChannel Cryptographic Provider");
    if (iVar3 == 0) {
      return 0xc;
    }
    iVar3 = _stricmp(param_1,"Microsoft Strong Cryptographic Provider");
    if (iVar3 != 0) {
      iVar3 = _stricmp(param_1,"Microsoft RSA Signature Cryptographic Provider");
      if (iVar3 != 0) {
        iVar3 = _stricmp(param_1,"Microsoft Base DSS Cryptographic Provider");
        if (iVar3 == 0) {
          return 3;
        }
        iVar3 = _stricmp(param_1,"Microsoft Enhanced RSA and AES Cryptographic Provider");
        if (iVar3 == 0) {
          return 0x18;
        }
        iVar3 = _stricmp(param_1,"Microsoft DH SChannel Cryptographic Provider");
        if (iVar3 == 0) {
          return 0x12;
        }
        iVar3 = _stricmp(param_1,"Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider")
        ;
        if ((iVar3 == 0) ||
           (iVar3 = _stricmp(param_1,"Microsoft Base DSS and Diffie-Hellman Cryptographic Provider")
           , iVar3 == 0)) {
          return 0xd;
        }
        iVar3 = _stricmp(param_1,"Crypto-Pro GOST R 34.10-2001 Cryptographic Service Provider");
        if (iVar3 == 0) {
          return 0x4b;
        }
        iVar3 = _stricmp(param_1,"Crypto-Pro Cryptographic Service Provider");
        if (iVar3 != 0) {
          iVar3 = _stricmp(param_1,"Crypto-Pro GOST R 34.10-94 Cryptographic Service Provider");
          if (iVar3 == 0) {
            return 0x47;
          }
          lVar5 = 0x1e;
          bVar7 = false;
          pcVar4 = param_1;
          pcVar6 = "Gemplus GemSAFE Card CSP v1.0";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar7 = *pcVar4 == *pcVar6;
            pcVar4 = pcVar4 + 1;
            pcVar6 = pcVar6 + 1;
          } while (bVar7);
          if (bVar7) {
            return 1;
          }
          lVar5 = 0x25;
          bVar7 = false;
          pcVar4 = param_1;
          pcVar6 = "Infineon SICRYPT Base Smart Card CSP";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar7 = *pcVar4 == *pcVar6;
            pcVar4 = pcVar4 + 1;
            pcVar6 = pcVar6 + 1;
          } while (bVar7);
          if (bVar7) {
            return 1;
          }
          lVar5 = 0x2c;
          bVar7 = false;
          pcVar4 = param_1;
          pcVar6 = "Schlumberger Cryptographic Service Provider";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar7 = *pcVar4 == *pcVar6;
            pcVar4 = pcVar4 + 1;
            pcVar6 = pcVar6 + 1;
          } while (bVar7);
          if (bVar7) {
            return 1;
          }
          lVar5 = 0x42;
          bVar7 = false;
          pcVar4 = param_1;
          pcVar6 = "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar7 = *pcVar4 == *pcVar6;
            pcVar4 = pcVar4 + 1;
            pcVar6 = pcVar6 + 1;
          } while (bVar7);
          if (bVar7) {
            return 0x18;
          }
          lVar5 = 0x2f;
          bVar7 = false;
          pcVar4 = param_1;
          pcVar6 = "Microsoft Exchange Cryptographic Provider v1.0";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar7 = *pcVar4 == *pcVar6;
            pcVar4 = pcVar4 + 1;
            pcVar6 = pcVar6 + 1;
          } while (bVar7);
          if (bVar7) {
            return 5;
          }
          lVar5 = 1;
          bVar7 = false;
          pcVar4 = param_1;
          pcVar6 = "";
          do {
            if (lVar5 == 0) break;
            lVar5 = lVar5 + -1;
            bVar7 = *pcVar4 == *pcVar6;
            pcVar4 = pcVar4 + 1;
            pcVar6 = pcVar6 + 1;
          } while (bVar7);
          if (!bVar7) {
            dwIndex = 0;
            local_508 = 0x4b0;
            iVar3 = CryptEnumProvidersA(0,(DWORD *)0x0,0,&local_504,local_4c8,&local_508);
            while (iVar3 != 0) {
              pcVar4 = local_4c8;
              lVar5 = (longlong)param_1 - (longlong)pcVar4;
              do {
                cVar2 = *pcVar4;
                cVar1 = pcVar4[lVar5];
                if (cVar2 != cVar1) break;
                pcVar4 = pcVar4 + 1;
              } while (cVar1 != '\0');
              if (cVar2 == cVar1) {
                return local_504;
              }
              dwIndex = dwIndex + 1;
              local_508 = 0x4b0;
              iVar3 = CryptEnumProvidersA(dwIndex,(DWORD *)0x0,0,&local_504,local_4c8,&local_508);
            }
            FUN_1400bcaa0(local_500,param_1);
            FUN_1400bd760(local_500);
            cVar2 = FUN_1400bde10(local_500,"fortezza");
            if (cVar2 != '\0') {
              FUN_1400bceb0(local_500);
              return 4;
            }
            cVar2 = FUN_1400bde10(local_500,"schannel");
            if (cVar2 == '\0') {
              cVar2 = FUN_1400bde10(local_500,&DAT_1402749b8);
              if (cVar2 != '\0') {
                FUN_1400bceb0(local_500);
                return 0x18;
              }
              FUN_1400bceb0(local_500);
              return 1;
            }
            FUN_1400bceb0(local_500);
          }
          return 0xc;
        }
      }
      return 2;
    }
  }
  return 1;
}



undefined8 FUN_1401320e0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 8);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1401320f0(undefined8 *param_1,undefined8 param_2)

{
  BOOL BVar1;
  undefined1 auStackY_478 [32];
  DWORD local_448 [2];
  undefined8 local_440;
  undefined8 *local_438;
  BYTE local_428 [1024];
  ulonglong local_28;
  
  local_440 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStackY_478;
  *param_1 = CryptoSP::vftable;
  param_1[1] = param_2;
  local_438 = param_1;
  FUN_1400bcc20(param_1 + 2);
  FUN_1400bcc20(param_1 + 8);
  *(undefined8 *)((longlong)param_1 + 0x74) = 4;
  if (param_1[1] != 0) {
    local_448[0] = 0x400;
    BVar1 = CryptGetProvParam(param_1[1],6,local_428,local_448,0);
    if (BVar1 == 1) {
      FUN_1400bc640(param_1 + 2,local_428);
    }
    local_448[0] = 0x400;
    BVar1 = CryptGetProvParam(param_1[1],4,local_428,local_448,0);
    if (BVar1 == 1) {
      FUN_1400bc640(param_1 + 8,local_428);
    }
    local_448[0] = 4;
    CryptGetProvParam(param_1[1],3,(BYTE *)((longlong)param_1 + 0x74),local_448,0);
    local_448[0] = 4;
    CryptGetProvParam(param_1[1],5,(BYTE *)(param_1 + 0xf),local_448,0);
  }
  return param_1;
}



longlong FUN_140132260(char param_1,char param_2,longlong *param_3)

{
  uint uVar1;
  int iVar2;
  DWORD DVar3;
  longlong lVar4;
  char *pcVar5;
  longlong local_res18;
  void *local_res20;
  
  lVar4 = 0;
  uVar1 = 0;
  (**(code **)(*param_3 + 0x48))(param_3,"AcquireDefaultCSP",1);
  if (param_1 != '\0') {
    uVar1 = 0x20;
  }
  if (param_2 != '\0') {
    uVar1 = uVar1 | 0xf0000000;
  }
  local_res18 = 0;
  iVar2 = FUN_1400ce990(&local_res18,0,"Microsoft Enhanced Cryptographic Provider v1.0",1,uVar1);
  if (iVar2 != 0) goto LAB_140132399;
  DVar3 = GetLastError();
  if (DVar3 == 0x80090016) {
    iVar2 = FUN_1400ce990(&local_res18,0,"Microsoft Enhanced Cryptographic Provider v1.0",1,8);
    if (iVar2 != 0) goto LAB_140132399;
    DVar3 = GetLastError();
    pcVar5 = "errorCode2";
  }
  else if (DVar3 == 2) {
    iVar2 = FUN_1400ce990(&local_res18,0,"Microsoft Enhanced Cryptographic Provider v1.0",1,0x20);
    if (iVar2 != 0) goto LAB_140132399;
    DVar3 = GetLastError();
    if (DVar3 != 0x80090016) goto LAB_140132399;
    iVar2 = FUN_1400ce990(&local_res18,0,"Microsoft Enhanced Cryptographic Provider v1.0",1,0x28);
    if (iVar2 != 0) goto LAB_140132399;
    DVar3 = GetLastError();
    pcVar5 = "errorCode3";
  }
  else {
    pcVar5 = "errorCode";
  }
  FUN_1400cf5e0(param_3,pcVar5,DVar3);
LAB_140132399:
  if (local_res18 == 0) {
    (**(code **)(*param_3 + 0x28))(param_3,"Failed to acquire default crypographic context");
  }
  else {
    local_res20 = operator_new(0x80);
    if (local_res20 != (void *)0x0) {
      lVar4 = FUN_1401320f0(local_res20,local_res18);
    }
    *(undefined4 *)(lVar4 + 0x70) = 1;
    (**(code **)(*param_3 + 0x30))(param_3,"Success");
  }
  (**(code **)(*param_3 + 0x50))(param_3);
  return lVar4;
}



char * FUN_140132410(undefined8 param_1,undefined8 param_2,char param_3,char param_4,
                    longlong *param_5)

{
  longlong *plVar1;
  int iVar2;
  undefined4 uVar3;
  DWORD DVar4;
  char *pcVar5;
  char *pcVar6;
  void *pvVar7;
  char *pcVar8;
  uint uVar9;
  undefined1 local_88 [48];
  undefined1 local_58 [48];
  
  plVar1 = param_5;
  (**(code **)(*param_5 + 0x48))(param_5,"AcquireCSP",1);
  (**(code **)(*plVar1 + 0x58))(plVar1,"providerName",param_1);
  (**(code **)(*plVar1 + 0x58))(plVar1,"keyContainer",param_2);
  FUN_1400cf520(plVar1,"verifyContext",param_3);
  FUN_1400cf520(plVar1,"machineKeyset",param_4);
  FUN_1400bcaa0(local_58,param_1);
  FUN_1400bbc30(local_58);
  FUN_1400bcaa0(local_88,param_2);
  FUN_1400bbc30(local_88);
  pcVar8 = (char *)0x0;
  uVar9 = 0;
  iVar2 = FUN_1400bbb10(local_58);
  pcVar5 = pcVar8;
  if (iVar2 != 0) {
    pcVar5 = (char *)FUN_1400b8b90(local_58);
  }
  iVar2 = FUN_1400bbb10(local_88);
  pcVar6 = pcVar8;
  if (iVar2 != 0) {
    pcVar6 = (char *)FUN_1400b8b90(local_88);
  }
  param_5 = (longlong *)0x0;
  uVar3 = 1;
  if ((pcVar5 != (char *)0x0) && (*pcVar5 != '\0')) {
    uVar3 = FUN_140131d50(pcVar5);
  }
  FUN_1400cf5e0(plVar1,"providerType",uVar3);
  if (param_4 != '\0') {
    uVar9 = 0x20;
  }
  if (param_3 != '\0') {
    uVar9 = uVar9 | 0xf0000000;
    pcVar6 = pcVar8;
  }
  iVar2 = FUN_1400ce990(&param_5,pcVar6,pcVar5,uVar3,uVar9);
  if (iVar2 == 0) {
    DVar4 = GetLastError();
    FUN_1400cf640(plVar1);
    if ((DVar4 == 0x80090016) || (DVar4 == 0x80090019)) {
      (**(code **)(*plVar1 + 0x30))(plVar1,"Retry with new keyset...");
      iVar2 = FUN_1400ce990(&param_5,pcVar6,pcVar5,uVar3,uVar9 | 8);
      if (iVar2 != 0) {
        if (param_5 == (longlong *)0x0) {
          (**(code **)(*plVar1 + 0x28))(plVar1,"Failed.");
        }
        else {
          pvVar7 = operator_new(0x80);
          if (pvVar7 != (void *)0x0) {
            pcVar8 = (char *)FUN_1401320f0(pvVar7,param_5);
          }
          *(undefined4 *)(pcVar8 + 0x70) = uVar3;
          (**(code **)(*plVar1 + 0x30))(plVar1,"Success");
        }
        (**(code **)(*plVar1 + 0x50))(plVar1);
        FUN_1400bceb0(local_88);
        FUN_1400bceb0(local_58);
        return pcVar8;
      }
    }
    (**(code **)(*plVar1 + 0x28))(plVar1,"Failed");
    (**(code **)(*plVar1 + 0x50))(plVar1);
    FUN_1400bceb0(local_88);
    FUN_1400bceb0(local_58);
    pcVar8 = (char *)0x0;
  }
  else {
    if (param_5 == (longlong *)0x0) {
      (**(code **)(*plVar1 + 0x28))(plVar1,"Failed.");
    }
    else {
      pvVar7 = operator_new(0x80);
      if (pvVar7 != (void *)0x0) {
        pcVar8 = (char *)FUN_1401320f0(pvVar7,param_5);
      }
      *(undefined4 *)(pcVar8 + 0x70) = uVar3;
      (**(code **)(*plVar1 + 0x30))(plVar1,"Success");
    }
    (**(code **)(*plVar1 + 0x50))(plVar1);
    FUN_1400bceb0(local_88);
    FUN_1400bceb0(local_58);
  }
  return pcVar8;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140132730(longlong param_1)

{
  uint uVar1;
  undefined4 uVar2;
  BOOL BVar3;
  undefined8 uVar4;
  int iVar5;
  uint uVar6;
  undefined1 auStackY_5f8 [32];
  DWORD local_5c8 [2];
  void *local_5c0;
  undefined8 local_5b8;
  char local_5a8 [208];
  uint local_4d8;
  undefined4 local_4d4;
  uint local_4d0;
  char local_4cc [1188];
  ulonglong local_28;
  
  local_5b8 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStackY_5f8;
  iVar5 = 0;
  while( true ) {
    local_5c8[0] = 0x4b0;
    BVar3 = CryptGetProvParam(*(HCRYPTPROV *)(param_1 + 8),1,(BYTE *)&local_4d8,local_5c8,
                              (uint)(iVar5 == 0));
    uVar2 = local_4d4;
    uVar1 = local_4d8;
    if (BVar3 == 0) {
      GetLastError();
      return 0;
    }
    strncpy(local_5a8,local_4cc,(ulonglong)local_4d0);
    uVar6 = uVar1 & 0xe000;
    if ((uVar6 == 0x6000) || (uVar6 == 0x4000)) break;
    iVar5 = iVar5 + 1;
  }
  local_5c0 = operator_new(0x48);
  if (local_5c0 == (void *)0x0) {
    return 0;
  }
  uVar4 = FUN_1400d35e0(local_5c0,uVar1,uVar2,local_5a8);
  return uVar4;
}



undefined8 * FUN_140132850(undefined8 *param_1,uint param_2)

{
  *param_1 = CryptoSP::vftable;
  if (param_1[1] != 0) {
    CryptReleaseContext(param_1[1],0);
    param_1[1] = 0;
  }
  FUN_1400bceb0(param_1 + 8);
  FUN_1400bceb0(param_1 + 2);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1401328c0(undefined8 param_1,undefined8 param_2,undefined1 param_3,undefined8 param_4)

{
  longlong lVar1;
  
  lVar1 = FUN_140132410();
  if (lVar1 == 0) {
    FUN_140132410(param_1,param_2,param_3,1,param_4);
  }
  return;
}



undefined8 * FUN_140132920(undefined8 *param_1)

{
  FUN_1400d0eb0();
  *param_1 = CertStoreSpec::vftable;
  param_1[2] = 0;
  FUN_1400bcc20(param_1 + 3);
  return param_1;
}



void FUN_140132960(undefined8 *param_1)

{
  *param_1 = CertStoreSpec::vftable;
  FUN_1400bceb0(param_1 + 3);
  FUN_1400d0ee0(param_1);
  return;
}



void FUN_1401329a0(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x10) = 1;
  *(undefined4 *)(param_1 + 0x14) = 1;
  FUN_1400bbe30(param_1 + 0x18);
  return;
}



void FUN_1401329c0(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x10) = 2;
  *(undefined4 *)(param_1 + 0x14) = 2;
  FUN_1400bbe30(param_1 + 0x18);
  return;
}



void FUN_1401329e0(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x10) = 4;
  *(undefined4 *)(param_1 + 0x14) = 1;
  FUN_1400bdb00(param_1 + 0x18);
  return;
}



void FUN_140132a00(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x10) = 4;
  *(undefined4 *)(param_1 + 0x14) = 2;
  FUN_1400bdb00(param_1 + 0x18);
  return;
}



undefined8 * FUN_140132a20(undefined8 *param_1,uint param_2)

{
  *param_1 = CertStoreSpec::vftable;
  FUN_1400bceb0(param_1 + 3);
  FUN_1400d0ee0(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140132a80(HKEY param_1)

{
  if ((((param_1 != (HKEY)0xffffffff80000000) && (param_1 != (HKEY)0xffffffff80000001)) &&
      (param_1 != (HKEY)0xffffffff80000002)) && (param_1 != (HKEY)0xffffffff80000003)) {
    RegCloseKey(param_1);
  }
  return;
}



HKEY FUN_140132ac0(HKEY param_1,longlong param_2,char param_3)

{
  int iVar1;
  int iVar2;
  longlong lVar3;
  undefined8 uVar4;
  undefined4 uVar5;
  int iVar6;
  HKEY local_res10;
  ulonglong in_stack_ffffffffffffff68;
  undefined1 local_80 [40];
  undefined1 local_58 [48];
  
  if (param_2 != 0) {
    FUN_1400d0a70(local_80);
    FUN_1400bcc20(local_58);
    FUN_1400bc640(local_58,param_2);
    FUN_1400be7e0(local_58,local_80,0x2f,0,in_stack_ffffffffffffff68 & 0xffffffffffffff00);
    iVar1 = FUN_140139d70(local_80);
    if (iVar1 != 0) {
      iVar6 = 0;
      local_res10 = (HKEY)0x0;
      iVar1 = FUN_140139d70(local_80);
      if (0 < iVar1) {
        do {
          lVar3 = FUN_1400d0aa0(local_80,iVar6);
          if ((lVar3 != 0) && (iVar2 = FUN_1400bbb10(lVar3), 0 < iVar2)) {
            uVar5 = 0x20019;
            if ((iVar6 == iVar1 + -1) && (uVar5 = 0x20019, param_3 == '\0')) {
              uVar5 = 0x2001f;
            }
            uVar4 = FUN_1400b8b90(lVar3);
            iVar2 = FUN_1400ce8f0(param_1,uVar4,0,uVar5,&local_res10);
            if (iVar2 != 0) {
              if ((((param_1 != (HKEY)0xffffffff80000000) && (param_1 != (HKEY)0xffffffff80000001))
                  && (param_1 != (HKEY)0xffffffff80000002)) && (param_1 != (HKEY)0xffffffff80000003)
                 ) {
                RegCloseKey(param_1);
              }
              FUN_1400d0d30(local_80);
              FUN_1400bceb0(local_58);
              FUN_1400d0e10(local_80);
              return (HKEY)0x0;
            }
            if (((param_1 != (HKEY)0xffffffff80000000) && (param_1 != (HKEY)0xffffffff80000001)) &&
               ((param_1 != (HKEY)0xffffffff80000002 && (param_1 != (HKEY)0xffffffff80000003)))) {
              RegCloseKey(param_1);
            }
            param_1 = local_res10;
            local_res10 = (HKEY)0x0;
          }
          iVar6 = iVar6 + 1;
        } while (iVar6 < iVar1);
      }
      FUN_1400d0d30(local_80);
      FUN_1400bceb0(local_58);
      FUN_1400d0e10(local_80);
      return param_1;
    }
    FUN_1400bceb0(local_58);
    FUN_1400d0e10(local_80);
  }
  return (HKEY)0x0;
}



void FUN_140132ce0(undefined8 param_1,undefined1 param_2,undefined8 param_3)

{
  FUN_140132ac0(0xffffffff80000002,param_1,param_2,param_3);
  return;
}



void FUN_140132d00(undefined8 param_1,undefined1 param_2,undefined8 param_3)

{
  FUN_140132ac0(0xffffffff80000001,param_1,param_2,param_3);
  return;
}



int FUN_140132d20(HKEY param_1,LPCSTR param_2,BYTE *param_3)

{
  BYTE BVar1;
  LSTATUS LVar2;
  longlong lVar3;
  BYTE *pBVar4;
  
  if ((param_2 == (LPCSTR)0x0) || (param_3 == (BYTE *)0x0)) {
    return -1;
  }
  lVar3 = -1;
  pBVar4 = param_3;
  do {
    if (lVar3 == 0) break;
    lVar3 = lVar3 + -1;
    BVar1 = *pBVar4;
    pBVar4 = pBVar4 + 1;
  } while (BVar1 != '\0');
  LVar2 = RegSetValueExA(param_1,param_2,0,1,param_3,~(uint)lVar3);
  return -(uint)(LVar2 != 0);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140132d80(HKEY param_1,LPCSTR param_2,undefined8 param_3,longlong *param_4)

{
  longlong lVar1;
  LSTATUS LVar2;
  LPBYTE lpData;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 auStackY_b8 [32];
  DWORD local_88;
  DWORD local_84 [3];
  char local_78 [48];
  ulonglong local_48;
  
  local_84[1] = 0xfffffffe;
  local_84[2] = 0xffffffff;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStackY_b8;
  local_88 = 0;
  local_84[0] = 1;
  LVar2 = RegQueryValueExA(param_1,param_2,(LPDWORD)0x0,local_84,(LPBYTE)0x0,&local_88);
  uVar4 = 0;
  if (LVar2 != 0) {
    FUN_1400bcc20(local_78);
    FUN_1400bdef0(local_78,LVar2);
    lVar1 = *param_4;
    uVar4 = FUN_1400b8b90(local_78);
    (**(code **)(lVar1 + 0x58))(param_4,"RegistryQueryError",uVar4);
    (**(code **)(*param_4 + 0x58))(param_4,"ValueName",param_2);
    FUN_1400bceb0(local_78);
    return 0;
  }
  if (local_88 == 0) {
    return 0;
  }
  lpData = operator_new((ulonglong)local_88);
  if (lpData == (LPBYTE)0x0) {
    return 0;
  }
  LVar2 = RegQueryValueExA(param_1,param_2,(LPDWORD)0x0,local_84,lpData,&local_88);
  if (LVar2 != 0) {
    FUN_1400bcc20(local_78);
    FUN_1400bdef0(local_78,LVar2);
    lVar1 = *param_4;
    uVar3 = FUN_1400b8b90(local_78);
    (**(code **)(lVar1 + 0x58))(param_4,"RegistryQueryError2",uVar3);
    (**(code **)(*param_4 + 0x58))(param_4,"ValueName",param_2);
    FUN_1400bceb0(local_78);
    goto LAB_140132eea;
  }
  if (local_84[0] == 4) {
    if (local_88 == 4) {
      sprintf(local_78,"%u");
      FUN_1400bc640(param_3,local_78);
    }
    else {
LAB_140132e85:
      FUN_1400be290(param_3,lpData);
    }
  }
  else {
    if ((local_84[0] != 1) && (local_84[0] != 2)) goto LAB_140132e85;
    FUN_1400bc640(param_3,lpData);
  }
  uVar4 = 1;
LAB_140132eea:
  operator_delete(lpData);
  return uVar4;
}



void FUN_140132f70(undefined8 *param_1)

{
  *param_1 = ZipCRC::vftable;
  return;
}



undefined8 * FUN_140132f80(undefined8 *param_1,byte param_2)

{
  *param_1 = ZipCRC::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140132fb0(longlong param_1)

{
  *(undefined4 *)(param_1 + 8) = 0xffffffff;
  return;
}



void FUN_140132fc0(longlong param_1,byte *param_2,uint param_3)

{
  byte bVar1;
  uint uVar2;
  ulonglong uVar3;
  byte *pbVar4;
  
  if ((param_2 != (byte *)0x0) && (param_3 != 0)) {
    if (0xf < param_3) {
      uVar2 = *(uint *)(param_1 + 8);
      uVar3 = (ulonglong)(param_3 >> 4);
      pbVar4 = param_2;
      do {
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)*pbVar4) * 4) ^
                uVar2 >> 8;
        *(uint *)(param_1 + 8) = uVar2;
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)pbVar4[1]) * 4) ^
                uVar2 >> 8;
        *(uint *)(param_1 + 8) = uVar2;
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)pbVar4[2]) * 4) ^
                uVar2 >> 8;
        *(uint *)(param_1 + 8) = uVar2;
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)pbVar4[3]) * 4) ^
                uVar2 >> 8;
        *(uint *)(param_1 + 8) = uVar2;
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)pbVar4[4]) * 4) ^
                uVar2 >> 8;
        *(uint *)(param_1 + 8) = uVar2;
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)pbVar4[5]) * 4) ^
                uVar2 >> 8;
        *(uint *)(param_1 + 8) = uVar2;
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)pbVar4[6]) * 4) ^
                uVar2 >> 8;
        *(uint *)(param_1 + 8) = uVar2;
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)pbVar4[7]) * 4) ^
                uVar2 >> 8;
        *(uint *)(param_1 + 8) = uVar2;
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)pbVar4[8]) * 4) ^
                uVar2 >> 8;
        param_3 = param_3 - 0x10;
        *(uint *)(param_1 + 8) = uVar2;
        param_2 = pbVar4 + 0x10;
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)pbVar4[9]) * 4) ^
                uVar2 >> 8;
        *(uint *)(param_1 + 8) = uVar2;
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)pbVar4[10]) * 4) ^
                uVar2 >> 8;
        *(uint *)(param_1 + 8) = uVar2;
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)pbVar4[0xb]) * 4)
                ^ uVar2 >> 8;
        *(uint *)(param_1 + 8) = uVar2;
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)pbVar4[0xc]) * 4)
                ^ uVar2 >> 8;
        *(uint *)(param_1 + 8) = uVar2;
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)pbVar4[0xd]) * 4)
                ^ uVar2 >> 8;
        *(uint *)(param_1 + 8) = uVar2;
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)pbVar4[0xe]) * 4)
                ^ uVar2 >> 8;
        *(uint *)(param_1 + 8) = uVar2;
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)pbVar4[0xf]) * 4)
                ^ uVar2 >> 8;
        uVar3 = uVar3 - 1;
        *(uint *)(param_1 + 8) = uVar2;
        pbVar4 = param_2;
      } while (uVar3 != 0);
    }
    if (param_3 != 0) {
      uVar2 = *(uint *)(param_1 + 8);
      do {
        bVar1 = *param_2;
        param_2 = param_2 + 1;
        uVar2 = *(uint *)(DAT_1403183b8 + ((ulonglong)(uVar2 & 0xff) ^ (ulonglong)bVar1) * 4) ^
                uVar2 >> 8;
        param_3 = param_3 - 1;
        *(uint *)(param_1 + 8) = uVar2;
      } while (param_3 != 0);
    }
  }
  return;
}



void FUN_140133260(void)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  longlong lVar5;
  
  if (DAT_1403183b0 == '\0') {
    DAT_1403183b8 = operator_new(0x400);
    uVar4 = 0;
    lVar5 = 0;
    do {
      uVar3 = 0;
      uVar1 = 7;
      uVar2 = uVar4;
      do {
        if ((uVar2 & 1) != 0) {
          uVar3 = uVar3 | 1 << ((byte)uVar1 & 0x1f);
        }
        uVar1 = uVar1 - 1;
        uVar2 = uVar2 >> 1;
      } while (uVar1 < 0x80000000);
      *(uint *)(lVar5 + (longlong)DAT_1403183b8) = uVar3 << 0x18;
      *(uint *)(lVar5 + (longlong)DAT_1403183b8) =
           -(uint)((*(uint *)(lVar5 + (longlong)DAT_1403183b8) & 0x80000000) != 0) & 0x4c11db7 ^
           *(uint *)(lVar5 + (longlong)DAT_1403183b8) * 2;
      *(uint *)(lVar5 + (longlong)DAT_1403183b8) =
           -(uint)((*(uint *)(lVar5 + (longlong)DAT_1403183b8) & 0x80000000) != 0) & 0x4c11db7 ^
           *(uint *)(lVar5 + (longlong)DAT_1403183b8) * 2;
      *(uint *)(lVar5 + (longlong)DAT_1403183b8) =
           -(uint)((*(uint *)(lVar5 + (longlong)DAT_1403183b8) & 0x80000000) != 0) & 0x4c11db7 ^
           *(uint *)(lVar5 + (longlong)DAT_1403183b8) * 2;
      *(uint *)(lVar5 + (longlong)DAT_1403183b8) =
           -(uint)((*(uint *)(lVar5 + (longlong)DAT_1403183b8) & 0x80000000) != 0) & 0x4c11db7 ^
           *(uint *)(lVar5 + (longlong)DAT_1403183b8) * 2;
      *(uint *)(lVar5 + (longlong)DAT_1403183b8) =
           -(uint)((*(uint *)(lVar5 + (longlong)DAT_1403183b8) & 0x80000000) != 0) & 0x4c11db7 ^
           *(uint *)(lVar5 + (longlong)DAT_1403183b8) * 2;
      *(uint *)(lVar5 + (longlong)DAT_1403183b8) =
           -(uint)((*(uint *)(lVar5 + (longlong)DAT_1403183b8) & 0x80000000) != 0) & 0x4c11db7 ^
           *(uint *)(lVar5 + (longlong)DAT_1403183b8) * 2;
      *(uint *)(lVar5 + (longlong)DAT_1403183b8) =
           -(uint)((*(uint *)(lVar5 + (longlong)DAT_1403183b8) & 0x80000000) != 0) & 0x4c11db7 ^
           *(uint *)(lVar5 + (longlong)DAT_1403183b8) * 2;
      *(uint *)(lVar5 + (longlong)DAT_1403183b8) =
           -(uint)((*(uint *)(lVar5 + (longlong)DAT_1403183b8) & 0x80000000) != 0) & 0x4c11db7 ^
           *(uint *)(lVar5 + (longlong)DAT_1403183b8) * 2;
      uVar3 = 0;
      uVar2 = *(uint *)(lVar5 + (longlong)DAT_1403183b8);
      uVar1 = 0x1f;
      do {
        if ((uVar2 & 1) != 0) {
          uVar3 = uVar3 | 1 << ((byte)uVar1 & 0x1f);
        }
        uVar1 = uVar1 - 1;
        uVar2 = uVar2 >> 1;
      } while (uVar1 < 0x80000000);
      uVar4 = uVar4 + 1;
      *(uint *)(lVar5 + (longlong)DAT_1403183b8) = uVar3;
      lVar5 = lVar5 + 4;
    } while (uVar4 < 0x100);
    DAT_1403183b0 = '\x01';
  }
  return;
}



undefined8 * FUN_140133450(undefined8 *param_1)

{
  *param_1 = ZipCRC::vftable;
  FUN_140133260();
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

uint FUN_140133480(byte *param_1,int param_2,ushort *param_3)

{
  byte bVar1;
  longlong lVar2;
  int iVar3;
  ulonglong uVar4;
  int iVar5;
  int iVar6;
  uint uVar7;
  int iVar8;
  int iVar9;
  uint uVar10;
  int iVar11;
  int iVar12;
  undefined1 auStack_448 [32];
  int local_428 [4];
  int local_418;
  int local_414;
  int local_410;
  int aiStack_40c [249];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_448;
  if (param_2 == 0) {
    uVar7 = 0;
  }
  else {
    FUN_140133260();
    uVar4 = 0xffffffff;
    if (param_3 == (ushort *)0x0) {
      do {
        bVar1 = *param_1;
        param_1 = param_1 + 1;
        uVar7 = *(uint *)(DAT_1403183b8 + (uVar4 & 0xff ^ (ulonglong)bVar1) * 4) ^
                (uint)(uVar4 >> 8);
        uVar4 = (ulonglong)uVar7;
        param_2 = param_2 + -1;
      } while (param_2 != 0);
    }
    else {
      memset(local_428,0,0x400);
      do {
        bVar1 = *param_1;
        local_428[bVar1] = local_428[bVar1] + 1;
        param_1 = param_1 + 1;
        uVar7 = *(uint *)(DAT_1403183b8 + (uVar4 & 0xff ^ (ulonglong)bVar1) * 4) ^
                (uint)(uVar4 >> 8);
        uVar4 = (ulonglong)uVar7;
        param_2 = param_2 + -1;
      } while (param_2 != 0);
      iVar12 = 0;
      lVar2 = 7;
      iVar9 = 0;
      iVar6 = 0x7f;
      uVar10 = local_428[0] + local_428[1] + local_428[2] + local_428[3] + local_418 + local_414 +
               local_410;
      iVar3 = iVar12;
      iVar5 = iVar12;
      do {
        iVar3 = iVar3 + local_428[lVar2];
        iVar5 = iVar5 + local_428[lVar2 + 1];
        lVar2 = lVar2 + 2;
      } while (lVar2 < 0x7f);
      iVar11 = iVar9;
      if (lVar2 < 0x80) {
        iVar11 = local_428[lVar2];
        iVar6 = 0x80;
      }
      uVar4 = (ulonglong)iVar6;
      if (uVar4 < 0x100) {
        iVar6 = iVar9;
        iVar8 = iVar12;
        if (1 < (longlong)(0x100 - uVar4)) {
          do {
            iVar6 = iVar12 + local_428[uVar4];
            iVar9 = iVar8 + local_428[uVar4 + 1];
            uVar4 = uVar4 + 2;
            iVar12 = iVar6;
            iVar8 = iVar9;
          } while ((longlong)uVar4 < 0xff);
        }
        if ((longlong)uVar4 < 0x100) {
          uVar10 = uVar10 + local_428[uVar4];
        }
        uVar10 = uVar10 + iVar9 + iVar6;
      }
      *param_3 = (ushort)((uint)(iVar11 + iVar5 + iVar3) >> 2 < uVar10);
    }
    uVar7 = ~uVar7;
  }
  return uVar7;
}



void FUN_140133630(longlong *param_1)

{
  int *piVar1;
  int iVar2;
  longlong lVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  uint uVar10;
  byte bVar11;
  uint uVar12;
  undefined4 uVar13;
  ulonglong uVar14;
  int iVar15;
  int iVar16;
  int iVar17;
  byte *pbVar18;
  
  if (*(char *)((longlong)param_1 + 0x14) == '\0') {
    uVar10 = *(uint *)(param_1 + 0x18e);
    iVar2 = *(int *)(*param_1 + 0x20);
    bVar11 = *(byte *)((longlong)param_1 + 0xc);
    iVar8 = (int)param_1[2];
    iVar7 = *(int *)((longlong)param_1 + 0x444);
    uVar14 = (ulonglong)*(uint *)((longlong)param_1 + 0x3c);
    pbVar18 = *(byte **)(*param_1 + 0x18);
    lVar3 = param_1[0x18a];
    iVar9 = (int)param_1[0x1f4a] + 1;
    iVar16 = iVar2;
    uVar4 = *(uint *)(param_1 + 8);
LAB_140133955:
    uVar13 = (undefined4)uVar14;
    iVar15 = iVar7;
    uVar12 = uVar4;
    if (iVar8 < 1) goto LAB_140133998;
    while( true ) {
      iVar17 = 0;
      if (iVar16 == 0) goto LAB_140133a88;
      if (iVar8 == 1) break;
      *pbVar18 = bVar11;
      iVar8 = iVar8 + -1;
      pbVar18 = pbVar18 + 1;
      uVar10 = *(uint *)(&DAT_14030a1c0 + ((ulonglong)(uVar10 >> 0x18) ^ (ulonglong)bVar11) * 4) ^
               uVar10 << 8;
      iVar16 = iVar16 + -1;
    }
LAB_1401339c5:
    uVar12 = uVar4;
    iVar15 = iVar7;
    uVar13 = (undefined4)uVar14;
    if (iVar16 == 0) {
      iVar8 = 1;
      iVar17 = 0;
      goto LAB_140133a88;
    }
    *pbVar18 = bVar11;
    pbVar18 = pbVar18 + 1;
    uVar10 = *(uint *)(&DAT_14030a1c0 + ((ulonglong)(uVar10 >> 0x18) ^ (ulonglong)bVar11) * 4) ^
             uVar10 << 8;
    iVar16 = iVar16 + -1;
LAB_140133998:
    uVar13 = (undefined4)uVar14;
    if (iVar15 != iVar9) {
      iVar7 = iVar15 + 1;
      bVar11 = (byte)uVar12;
      uVar6 = *(uint *)(lVar3 + uVar14 * 4);
      uVar4 = uVar6 & 0xff;
      uVar14 = (ulonglong)(uVar6 >> 8);
      if ((uVar4 != uVar12) || (uVar4 = uVar12, iVar7 == iVar9)) goto LAB_1401339c5;
      uVar6 = *(uint *)(lVar3 + uVar14 * 4);
      iVar7 = iVar15 + 2;
      uVar5 = uVar6 & 0xff;
      uVar14 = (ulonglong)(uVar6 >> 8);
      iVar8 = 2;
      if ((iVar7 != iVar9) && (uVar4 = uVar5, uVar5 == uVar12)) {
        uVar4 = *(uint *)(lVar3 + uVar14 * 4);
        iVar7 = iVar15 + 3;
        uVar6 = uVar4 & 0xff;
        uVar14 = (ulonglong)(uVar4 >> 8);
        iVar8 = 3;
        uVar4 = uVar12;
        if ((iVar7 != iVar9) && (uVar4 = uVar6, uVar6 == uVar12)) {
          uVar4 = *(uint *)(lVar3 + uVar14 * 4);
          iVar8 = (uVar4 & 0xff) + 4;
          uVar4 = *(uint *)(lVar3 + (ulonglong)(uVar4 >> 8) * 4);
          uVar14 = (ulonglong)(uVar4 >> 8);
          iVar7 = iVar15 + 5;
          uVar4 = uVar4 & 0xff;
        }
      }
      goto LAB_140133955;
    }
    iVar8 = 0;
    iVar17 = iVar16;
LAB_140133a88:
    uVar4 = *(uint *)(*param_1 + 0x24);
    *(uint *)(*param_1 + 0x24) = (uVar4 - iVar17) + iVar2;
    if (*(uint *)(*param_1 + 0x24) < uVar4) {
      piVar1 = (int *)(*param_1 + 0x28);
      *piVar1 = *piVar1 + 1;
    }
    param_1[0x18a] = lVar3;
    *(uint *)(param_1 + 0x18e) = uVar10;
    *(byte *)((longlong)param_1 + 0xc) = bVar11;
    *(int *)(param_1 + 2) = iVar8;
    *(int *)((longlong)param_1 + 0x444) = iVar15;
    *(uint *)(param_1 + 8) = uVar12;
    *(undefined4 *)((longlong)param_1 + 0x3c) = uVar13;
    *(byte **)(*param_1 + 0x18) = pbVar18;
    *(int *)(*param_1 + 0x20) = iVar17;
  }
  else {
    while (*(int *)(*param_1 + 0x20) != 0) {
      if ((int)param_1[2] == 0) {
        iVar2 = *(int *)((longlong)param_1 + 0x444);
        iVar8 = (int)param_1[0x1f4a] + 1;
        if (iVar2 == iVar8) {
          return;
        }
        lVar3 = param_1[0x18a];
        *(undefined4 *)(param_1 + 2) = 1;
        *(char *)((longlong)param_1 + 0xc) = (char)param_1[8];
        uVar10 = *(uint *)(lVar3 + (ulonglong)*(uint *)((longlong)param_1 + 0x3c) * 4);
        *(uint *)((longlong)param_1 + 0x3c) = uVar10 >> 8;
        if ((int)param_1[3] == 0) {
          iVar7 = *(int *)((longlong)param_1 + 0x1c) + 1;
          *(undefined4 *)(param_1 + 3) = (&DAT_1403099c0)[*(int *)((longlong)param_1 + 0x1c)];
          if (iVar7 == 0x200) {
            iVar7 = 0;
          }
          *(int *)((longlong)param_1 + 0x1c) = iVar7;
        }
        *(int *)(param_1 + 3) = (int)param_1[3] + -1;
        *(int *)((longlong)param_1 + 0x444) = iVar2 + 1;
        if (iVar2 + 1 != iVar8) {
          uVar4 = *(uint *)(param_1 + 8);
          uVar10 = (uint)(byte)((byte)uVar10 ^ (int)param_1[3] == 1);
          if (uVar10 == uVar4) {
            *(undefined4 *)(param_1 + 2) = 2;
            uVar10 = *(uint *)(lVar3 + (ulonglong)*(uint *)((longlong)param_1 + 0x3c) * 4);
            *(uint *)((longlong)param_1 + 0x3c) = uVar10 >> 8;
            if ((int)param_1[3] == 0) {
              iVar7 = *(int *)((longlong)param_1 + 0x1c) + 1;
              *(undefined4 *)(param_1 + 3) = (&DAT_1403099c0)[*(int *)((longlong)param_1 + 0x1c)];
              if (iVar7 == 0x200) {
                iVar7 = 0;
              }
              *(int *)((longlong)param_1 + 0x1c) = iVar7;
            }
            *(int *)(param_1 + 3) = (int)param_1[3] + -1;
            *(int *)((longlong)param_1 + 0x444) = iVar2 + 2;
            if (iVar2 + 2 != iVar8) {
              uVar10 = (uint)(byte)((byte)uVar10 ^ (int)param_1[3] == 1);
              if (uVar10 == uVar4) {
                *(undefined4 *)(param_1 + 2) = 3;
                uVar10 = *(uint *)(lVar3 + (ulonglong)*(uint *)((longlong)param_1 + 0x3c) * 4);
                *(uint *)((longlong)param_1 + 0x3c) = uVar10 >> 8;
                if ((int)param_1[3] == 0) {
                  iVar7 = *(int *)((longlong)param_1 + 0x1c) + 1;
                  *(undefined4 *)(param_1 + 3) =
                       (&DAT_1403099c0)[*(int *)((longlong)param_1 + 0x1c)];
                  if (iVar7 == 0x200) {
                    iVar7 = 0;
                  }
                  *(int *)((longlong)param_1 + 0x1c) = iVar7;
                }
                *(int *)(param_1 + 3) = (int)param_1[3] + -1;
                *(int *)((longlong)param_1 + 0x444) = iVar2 + 3;
                if (iVar2 + 3 != iVar8) {
                  uVar10 = (uint)(byte)((byte)uVar10 ^ (int)param_1[3] == 1);
                  if (uVar10 == uVar4) {
                    uVar10 = *(uint *)(lVar3 + (ulonglong)*(uint *)((longlong)param_1 + 0x3c) * 4);
                    *(uint *)((longlong)param_1 + 0x3c) = uVar10 >> 8;
                    if ((int)param_1[3] == 0) {
                      iVar8 = *(int *)((longlong)param_1 + 0x1c) + 1;
                      *(undefined4 *)(param_1 + 3) =
                           (&DAT_1403099c0)[*(int *)((longlong)param_1 + 0x1c)];
                      if (iVar8 == 0x200) {
                        iVar8 = 0;
                      }
                      *(int *)((longlong)param_1 + 0x1c) = iVar8;
                    }
                    *(int *)(param_1 + 3) = (int)param_1[3] + -1;
                    *(int *)((longlong)param_1 + 0x444) = iVar2 + 4;
                    *(uint *)(param_1 + 2) = ((uint)((int)param_1[3] == 1) ^ uVar10 & 0xff) + 4;
                    uVar10 = *(uint *)(lVar3 + (ulonglong)*(uint *)((longlong)param_1 + 0x3c) * 4);
                    *(uint *)((longlong)param_1 + 0x3c) = uVar10;
                    *(uint *)((longlong)param_1 + 0x3c) = *(uint *)((longlong)param_1 + 0x3c) >> 8;
                    *(uint *)(param_1 + 8) = uVar10 & 0xff;
                    if ((int)param_1[3] == 0) {
                      iVar8 = *(int *)((longlong)param_1 + 0x1c) + 1;
                      *(undefined4 *)(param_1 + 3) =
                           (&DAT_1403099c0)[*(int *)((longlong)param_1 + 0x1c)];
                      if (iVar8 == 0x200) {
                        iVar8 = 0;
                      }
                      *(int *)((longlong)param_1 + 0x1c) = iVar8;
                    }
                    *(int *)(param_1 + 3) = (int)param_1[3] + -1;
                    *(uint *)(param_1 + 8) = *(uint *)(param_1 + 8) ^ (uint)((int)param_1[3] == 1);
                    *(int *)((longlong)param_1 + 0x444) = iVar2 + 5;
                  }
                  else {
                    *(uint *)(param_1 + 8) = uVar10;
                  }
                }
              }
              else {
                *(uint *)(param_1 + 8) = uVar10;
              }
            }
          }
          else {
            *(uint *)(param_1 + 8) = uVar10;
          }
        }
      }
      else {
        **(undefined1 **)(*param_1 + 0x18) = *(undefined1 *)((longlong)param_1 + 0xc);
        uVar10 = *(uint *)(&DAT_14030a1c0 +
                          ((ulonglong)(*(uint *)(param_1 + 0x18e) >> 0x18) ^
                          (ulonglong)*(byte *)((longlong)param_1 + 0xc)) * 4);
        *(int *)(param_1 + 2) = (int)param_1[2] + -1;
        *(uint *)(param_1 + 0x18e) = uVar10 ^ *(uint *)(param_1 + 0x18e) << 8;
        *(longlong *)(*param_1 + 0x18) = *(longlong *)(*param_1 + 0x18) + 1;
        *(int *)(*param_1 + 0x20) = *(int *)(*param_1 + 0x20) + -1;
        *(int *)(*param_1 + 0x24) = *(int *)(*param_1 + 0x24) + 1;
        if (*(int *)(*param_1 + 0x24) == 0) {
          piVar1 = (int *)(*param_1 + 0x28);
          *piVar1 = *piVar1 + 1;
        }
      }
    }
  }
  return;
}



int FUN_140133af0(undefined8 param_1,int param_2,longlong param_3)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  
  iVar3 = 0;
  iVar4 = 0x100;
  do {
    iVar2 = iVar4 + iVar3 >> 1;
    iVar1 = iVar2;
    if (*(int *)(param_3 + (longlong)iVar2 * 4) <= param_2) {
      iVar1 = iVar4;
      iVar3 = iVar2;
    }
    iVar4 = iVar1;
  } while (iVar4 - iVar3 != 1);
  return iVar3;
}



void FUN_140133b30(undefined8 param_1,longlong *param_2)

{
  int *piVar1;
  byte bVar2;
  ushort uVar3;
  int iVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  int iVar8;
  uint uVar9;
  uint uVar10;
  undefined4 uVar11;
  int iVar12;
  int iVar13;
  uint uVar14;
  uint uVar15;
  uint uVar16;
  uint uVar17;
  int iVar18;
  ulonglong uVar19;
  int iVar20;
  
  if (*(char *)((longlong)param_2 + 0x14) == '\0') {
LAB_140133f70:
    if (*(int *)(*param_2 + 0x20) != 0) {
      if ((int)param_2[2] == 0) {
        iVar4 = *(int *)((longlong)param_2 + 0x444);
        iVar20 = (int)param_2[0x1f4a] + 1;
        if (iVar4 == iVar20) {
          return;
        }
        uVar9 = *(uint *)((longlong)param_2 + 0x3c);
        *(undefined4 *)(param_2 + 2) = 1;
        *(char *)((longlong)param_2 + 0xc) = (char)param_2[8];
        uVar10 = 0;
        uVar16 = 0x100;
        do {
          uVar14 = (int)(uVar16 + uVar10) >> 1;
          uVar17 = uVar14;
          if (*(int *)((longlong)param_2 + (longlong)(int)uVar14 * 4 + 0x448) <= (int)uVar9) {
            uVar17 = uVar16;
            uVar10 = uVar14;
          }
          uVar16 = uVar17;
        } while (uVar16 - uVar10 != 1);
        lVar5 = param_2[0x18c];
        lVar6 = param_2[0x18b];
        *(uint *)((longlong)param_2 + 0x3c) =
             (*(byte *)((ulonglong)(uVar9 >> 1) + lVar5) >> (((byte)uVar9 & 1) << 2) & 0xf) << 0x10
             | (uint)*(ushort *)(lVar6 + (ulonglong)uVar9 * 2);
        *(int *)((longlong)param_2 + 0x444) = iVar4 + 1;
        if (iVar4 + 1 != iVar20) {
          uVar9 = *(uint *)(param_2 + 8);
          uVar10 = uVar10 & 0xff;
          if (uVar10 == uVar9) {
            uVar16 = *(uint *)((longlong)param_2 + 0x3c);
            *(undefined4 *)(param_2 + 2) = 2;
            uVar10 = 0;
            uVar17 = 0x100;
            do {
              uVar15 = (int)(uVar17 + uVar10) >> 1;
              uVar14 = uVar15;
              if (*(int *)((longlong)param_2 + (longlong)(int)uVar15 * 4 + 0x448) <= (int)uVar16) {
                uVar14 = uVar17;
                uVar10 = uVar15;
              }
              uVar17 = uVar14;
            } while (uVar17 - uVar10 != 1);
            bVar2 = *(byte *)((ulonglong)(uVar16 >> 1) + lVar5);
            uVar3 = *(ushort *)(lVar6 + (ulonglong)uVar16 * 2);
            *(int *)((longlong)param_2 + 0x444) = iVar4 + 2;
            *(uint *)((longlong)param_2 + 0x3c) =
                 (bVar2 >> (((byte)uVar16 & 1) << 2) & 0xf) << 0x10 | (uint)uVar3;
            if (iVar4 + 2 == iVar20) goto LAB_140133f70;
            uVar10 = uVar10 & 0xff;
            if (uVar10 == uVar9) {
              uVar16 = *(uint *)((longlong)param_2 + 0x3c);
              *(undefined4 *)(param_2 + 2) = 3;
              uVar10 = 0;
              uVar17 = 0x100;
              do {
                uVar15 = (int)(uVar17 + uVar10) >> 1;
                uVar14 = uVar15;
                if (*(int *)((longlong)param_2 + (longlong)(int)uVar15 * 4 + 0x448) <= (int)uVar16)
                {
                  uVar14 = uVar17;
                  uVar10 = uVar15;
                }
                uVar17 = uVar14;
              } while (uVar17 - uVar10 != 1);
              *(uint *)((longlong)param_2 + 0x3c) =
                   (*(byte *)((ulonglong)(uVar16 >> 1) + lVar5) >> (((byte)uVar16 & 1) << 2) & 0xf)
                   << 0x10 | (uint)*(ushort *)(lVar6 + (ulonglong)uVar16 * 2);
              *(int *)((longlong)param_2 + 0x444) = iVar4 + 3;
              if (iVar4 + 3 == iVar20) goto LAB_140133f70;
              uVar10 = uVar10 & 0xff;
              if (uVar10 == uVar9) {
                uVar19 = (ulonglong)*(uint *)((longlong)param_2 + 0x3c);
                uVar9 = FUN_140133af0(param_1,uVar19,param_2 + 0x89);
                uVar10 = (*(byte *)(((uVar19 & 0xffffffff) >> 1) + lVar5) >>
                          (((byte)uVar19 & 1) << 2) & 0xf) << 0x10 |
                         (uint)*(ushort *)(lVar6 + uVar19 * 2);
                uVar19 = (ulonglong)uVar10;
                *(uint *)((longlong)param_2 + 0x3c) = uVar10;
                *(int *)((longlong)param_2 + 0x444) = iVar4 + 4;
                *(uint *)(param_2 + 2) = (uVar9 & 0xff) + 4;
                uVar11 = FUN_140133af0(param_1,uVar19);
                *(undefined4 *)(param_2 + 8) = uVar11;
                bVar2 = *(byte *)(((uVar19 & 0xffffffff) >> 1) + lVar5);
                uVar3 = *(ushort *)(lVar6 + uVar19 * 2);
                *(int *)((longlong)param_2 + 0x444) = iVar4 + 5;
                *(uint *)((longlong)param_2 + 0x3c) =
                     (bVar2 >> (((byte)uVar19 & 1) << 2) & 0xf) << 0x10 | (uint)uVar3;
                goto LAB_140133f70;
              }
            }
          }
          *(uint *)(param_2 + 8) = uVar10;
        }
      }
      else {
        **(undefined1 **)(*param_2 + 0x18) = *(undefined1 *)((longlong)param_2 + 0xc);
        uVar9 = *(uint *)(&DAT_14030a1c0 +
                         ((ulonglong)(*(uint *)(param_2 + 0x18e) >> 0x18) ^
                         (ulonglong)*(byte *)((longlong)param_2 + 0xc)) * 4);
        *(int *)(param_2 + 2) = (int)param_2[2] + -1;
        *(uint *)(param_2 + 0x18e) = uVar9 ^ *(uint *)(param_2 + 0x18e) << 8;
        *(longlong *)(*param_2 + 0x18) = *(longlong *)(*param_2 + 0x18) + 1;
        *(int *)(*param_2 + 0x20) = *(int *)(*param_2 + 0x20) + -1;
        *(int *)(*param_2 + 0x24) = *(int *)(*param_2 + 0x24) + 1;
        if (*(int *)(*param_2 + 0x24) == 0) {
          piVar1 = (int *)(*param_2 + 0x28);
          *piVar1 = *piVar1 + 1;
        }
      }
      goto LAB_140133f70;
    }
  }
  else {
    while (*(int *)(*param_2 + 0x20) != 0) {
      if ((int)param_2[2] == 0) {
        iVar4 = *(int *)((longlong)param_2 + 0x444);
        iVar20 = (int)param_2[0x1f4a] + 1;
        if (iVar4 == iVar20) {
          return;
        }
        uVar9 = *(uint *)((longlong)param_2 + 0x3c);
        *(undefined4 *)(param_2 + 2) = 1;
        *(char *)((longlong)param_2 + 0xc) = (char)param_2[8];
        iVar18 = 0;
        iVar13 = 0x100;
        do {
          iVar12 = iVar13 + iVar18 >> 1;
          iVar8 = iVar12;
          if (*(int *)((longlong)param_2 + (longlong)iVar12 * 4 + 0x448) <= (int)uVar9) {
            iVar8 = iVar13;
            iVar18 = iVar12;
          }
          iVar13 = iVar8;
        } while (iVar13 - iVar18 != 1);
        lVar5 = param_2[0x18c];
        lVar6 = param_2[0x18b];
        *(uint *)((longlong)param_2 + 0x3c) =
             (*(byte *)((ulonglong)(uVar9 >> 1) + lVar5) >> (((byte)uVar9 & 1) << 2) & 0xf) << 0x10
             | (uint)*(ushort *)(lVar6 + (ulonglong)uVar9 * 2);
        if ((int)param_2[3] == 0) {
          iVar13 = *(int *)((longlong)param_2 + 0x1c) + 1;
          *(undefined4 *)(param_2 + 3) = (&DAT_1403099c0)[*(int *)((longlong)param_2 + 0x1c)];
          if (iVar13 == 0x200) {
            iVar13 = 0;
          }
          *(int *)((longlong)param_2 + 0x1c) = iVar13;
        }
        *(int *)(param_2 + 3) = (int)param_2[3] + -1;
        *(int *)((longlong)param_2 + 0x444) = iVar4 + 1;
        if (iVar4 + 1 != iVar20) {
          uVar9 = *(uint *)(param_2 + 8);
          uVar10 = (uint)(byte)((int)param_2[3] == 1 ^ (byte)iVar18);
          if (uVar10 == uVar9) {
            uVar10 = *(uint *)((longlong)param_2 + 0x3c);
            *(undefined4 *)(param_2 + 2) = 2;
            iVar18 = 0;
            iVar13 = 0x100;
            do {
              iVar12 = iVar13 + iVar18 >> 1;
              iVar8 = iVar12;
              if (*(int *)((longlong)param_2 + (longlong)iVar12 * 4 + 0x448) <= (int)uVar10) {
                iVar8 = iVar13;
                iVar18 = iVar12;
              }
              iVar13 = iVar8;
            } while (iVar13 - iVar18 != 1);
            *(uint *)((longlong)param_2 + 0x3c) =
                 (*(byte *)((ulonglong)(uVar10 >> 1) + lVar5) >> (((byte)uVar10 & 1) << 2) & 0xf) <<
                 0x10 | (uint)*(ushort *)(lVar6 + (ulonglong)uVar10 * 2);
            if ((int)param_2[3] == 0) {
              iVar13 = *(int *)((longlong)param_2 + 0x1c) + 1;
              *(undefined4 *)(param_2 + 3) = (&DAT_1403099c0)[*(int *)((longlong)param_2 + 0x1c)];
              if (iVar13 == 0x200) {
                iVar13 = 0;
              }
              *(int *)((longlong)param_2 + 0x1c) = iVar13;
            }
            *(int *)(param_2 + 3) = (int)param_2[3] + -1;
            *(int *)((longlong)param_2 + 0x444) = iVar4 + 2;
            if (iVar4 + 2 != iVar20) {
              uVar10 = (uint)(byte)((int)param_2[3] == 1 ^ (byte)iVar18);
              if (uVar10 == uVar9) {
                uVar10 = *(uint *)((longlong)param_2 + 0x3c);
                *(undefined4 *)(param_2 + 2) = 3;
                iVar18 = 0;
                iVar13 = 0x100;
                do {
                  iVar12 = iVar13 + iVar18 >> 1;
                  iVar8 = iVar12;
                  if (*(int *)((longlong)param_2 + (longlong)iVar12 * 4 + 0x448) <= (int)uVar10) {
                    iVar8 = iVar13;
                    iVar18 = iVar12;
                  }
                  iVar13 = iVar8;
                } while (iVar13 - iVar18 != 1);
                *(uint *)((longlong)param_2 + 0x3c) =
                     (*(byte *)((ulonglong)(uVar10 >> 1) + lVar5) >> (((byte)uVar10 & 1) << 2) & 0xf
                     ) << 0x10 | (uint)*(ushort *)(lVar6 + (ulonglong)uVar10 * 2);
                if ((int)param_2[3] == 0) {
                  iVar13 = *(int *)((longlong)param_2 + 0x1c) + 1;
                  *(undefined4 *)(param_2 + 3) =
                       (&DAT_1403099c0)[*(int *)((longlong)param_2 + 0x1c)];
                  if (iVar13 == 0x200) {
                    iVar13 = 0;
                  }
                  *(int *)((longlong)param_2 + 0x1c) = iVar13;
                }
                *(int *)(param_2 + 3) = (int)param_2[3] + -1;
                lVar7 = param_2[3];
                *(int *)((longlong)param_2 + 0x444) = iVar4 + 3;
                if (iVar4 + 3 != iVar20) {
                  uVar10 = (uint)(byte)((int)lVar7 == 1 ^ (byte)iVar18);
                  if (uVar10 == uVar9) {
                    uVar19 = (ulonglong)*(uint *)((longlong)param_2 + 0x3c);
                    uVar9 = FUN_140133af0(param_1,uVar19,param_2 + 0x89);
                    *(uint *)((longlong)param_2 + 0x3c) =
                         (*(byte *)(((uVar19 & 0xffffffff) >> 1) + lVar5) >>
                          (((byte)uVar19 & 1) << 2) & 0xf) << 0x10 |
                         (uint)*(ushort *)(lVar6 + uVar19 * 2);
                    if ((int)lVar7 == 0) {
                      iVar20 = *(int *)((longlong)param_2 + 0x1c) + 1;
                      *(undefined4 *)(param_2 + 3) =
                           (&DAT_1403099c0)[*(int *)((longlong)param_2 + 0x1c)];
                      if (iVar20 == 0x200) {
                        iVar20 = 0;
                      }
                      *(int *)((longlong)param_2 + 0x1c) = iVar20;
                    }
                    *(int *)(param_2 + 3) = (int)param_2[3] + -1;
                    lVar7 = param_2[3];
                    uVar19 = (ulonglong)*(uint *)((longlong)param_2 + 0x3c);
                    *(int *)((longlong)param_2 + 0x444) = iVar4 + 4;
                    *(uint *)(param_2 + 2) = ((uint)((int)lVar7 == 1) ^ uVar9 & 0xff) + 4;
                    uVar9 = FUN_140133af0(param_1,uVar19,param_2 + 0x89);
                    *(uint *)(param_2 + 8) = uVar9;
                    *(uint *)((longlong)param_2 + 0x3c) =
                         (*(byte *)(((uVar19 & 0xffffffff) >> 1) + lVar5) >>
                          (((byte)uVar19 & 1) << 2) & 0xf) << 0x10 |
                         (uint)*(ushort *)(lVar6 + uVar19 * 2);
                    if ((int)lVar7 == 0) {
                      iVar20 = *(int *)((longlong)param_2 + 0x1c) + 1;
                      *(undefined4 *)(param_2 + 3) =
                           (&DAT_1403099c0)[*(int *)((longlong)param_2 + 0x1c)];
                      if (iVar20 == 0x200) {
                        iVar20 = 0;
                      }
                      *(int *)((longlong)param_2 + 0x1c) = iVar20;
                    }
                    *(int *)(param_2 + 3) = (int)param_2[3] + -1;
                    *(uint *)(param_2 + 8) = (int)param_2[3] == 1 ^ uVar9;
                    *(int *)((longlong)param_2 + 0x444) = iVar4 + 5;
                  }
                  else {
                    *(uint *)(param_2 + 8) = uVar10;
                  }
                }
              }
              else {
                *(uint *)(param_2 + 8) = uVar10;
              }
            }
          }
          else {
            *(uint *)(param_2 + 8) = uVar10;
          }
        }
      }
      else {
        **(undefined1 **)(*param_2 + 0x18) = *(undefined1 *)((longlong)param_2 + 0xc);
        uVar9 = *(uint *)(&DAT_14030a1c0 +
                         ((ulonglong)(*(uint *)(param_2 + 0x18e) >> 0x18) ^
                         (ulonglong)*(byte *)((longlong)param_2 + 0xc)) * 4);
        *(int *)(param_2 + 2) = (int)param_2[2] + -1;
        *(uint *)(param_2 + 0x18e) = uVar9 ^ *(uint *)(param_2 + 0x18e) << 8;
        *(longlong *)(*param_2 + 0x18) = *(longlong *)(*param_2 + 0x18) + 1;
        *(int *)(*param_2 + 0x20) = *(int *)(*param_2 + 0x20) + -1;
        *(int *)(*param_2 + 0x24) = *(int *)(*param_2 + 0x24) + 1;
        if (*(int *)(*param_2 + 0x24) == 0) {
          piVar1 = (int *)(*param_2 + 0x28);
          *piVar1 = *piVar1 + 1;
        }
      }
    }
  }
  return;
}



undefined4 FUN_140134280(undefined8 param_1,longlong param_2)

{
  longlong *plVar1;
  
  if (param_2 == 0) {
    return 0xfffffffe;
  }
  plVar1 = *(longlong **)(param_2 + 0x30);
  if ((plVar1 != (longlong *)0x0) && (*plVar1 == param_2)) {
    if ((void *)plVar1[0x18a] != (void *)0x0) {
      operator_delete((void *)plVar1[0x18a]);
    }
    if ((void *)plVar1[0x18b] != (void *)0x0) {
      operator_delete((void *)plVar1[0x18b]);
    }
    if ((void *)plVar1[0x18c] != (void *)0x0) {
      operator_delete((void *)plVar1[0x18c]);
    }
    operator_delete(*(void **)(param_2 + 0x30));
    *(undefined8 *)(param_2 + 0x30) = 0;
    return 0;
  }
  return 0xfffffffe;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x00014013672b)

ulonglong FUN_140134310(undefined8 param_1,longlong *param_2)

{
  undefined1 uVar1;
  uint uVar2;
  undefined1 auVar3 [16];
  undefined1 auVar4 [16];
  undefined7 uVar5;
  int iVar6;
  __uint64 _Var7;
  void *pvVar8;
  byte bVar9;
  uint uVar10;
  uint uVar11;
  uint uVar12;
  int iVar13;
  int iVar14;
  byte *pbVar15;
  longlong lVar16;
  undefined1 *puVar17;
  longlong *plVar18;
  int *piVar19;
  uint *puVar20;
  uint *puVar21;
  char cVar22;
  char *pcVar23;
  ulonglong uVar24;
  ulonglong uVar25;
  int *piVar26;
  longlong lVar27;
  uint *puVar28;
  uint uVar29;
  int *piVar30;
  byte *pbVar31;
  ulonglong uVar32;
  ulonglong uVar33;
  longlong lVar34;
  uint uVar35;
  ulonglong uVar36;
  undefined1 *puVar37;
  uint uVar38;
  uint uVar39;
  int iVar40;
  undefined1 auStack_178 [32];
  longlong local_158;
  uint local_150;
  undefined4 local_148;
  uint local_140;
  uint local_138;
  int local_134;
  uint local_130;
  uint local_12c;
  uint local_128;
  uint local_124;
  longlong local_120;
  int local_118;
  undefined1 local_114;
  uint local_110;
  uint local_10c;
  int local_108;
  uint local_104;
  uint local_100;
  uint local_fc;
  ulonglong local_f8;
  uint local_f0;
  int local_ec;
  int local_e8;
  longlong local_e0;
  int local_d8;
  uint local_d4;
  ulonglong local_d0;
  longlong local_c8;
  int local_c0;
  uint local_bc;
  uint local_b8;
  int local_b4;
  uint local_b0;
  uint local_ac;
  uint local_a8;
  int local_a4;
  uint local_a0;
  int local_9c;
  int local_98;
  uint local_94;
  uint local_90;
  uint local_8c;
  uint local_88;
  uint local_84;
  uint local_80;
  int local_7c;
  uint local_78;
  undefined4 local_74;
  longlong local_70;
  longlong local_68;
  longlong local_60;
  longlong *local_58;
  undefined8 local_50;
  undefined8 local_48;
  int local_40 [2];
  ulonglong local_38;
  
  local_48 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_178;
  uVar33 = 0;
  uVar36 = 0;
  local_d0 = 0;
  if ((int)param_2[1] == 10) {
    *(undefined8 *)((longlong)param_2 + 0xfa24) = 0;
    *(undefined8 *)((longlong)param_2 + 0xfa2c) = 0;
    *(undefined8 *)((longlong)param_2 + 0xfa34) = 0;
    *(undefined8 *)((longlong)param_2 + 0xfa3c) = 0;
    *(undefined8 *)((longlong)param_2 + 0xfa44) = 0;
    *(undefined8 *)((longlong)param_2 + 0xfa4c) = 0;
    *(undefined8 *)((longlong)param_2 + 0xfa54) = 0;
    *(undefined8 *)((longlong)param_2 + 0xfa5c) = 0;
    *(undefined8 *)((longlong)param_2 + 0xfa64) = 0;
    *(undefined8 *)((longlong)param_2 + 0xfa6c) = 0;
    *(undefined4 *)((longlong)param_2 + 0xfa74) = 0;
    param_2[0x1f4f] = 0;
    param_2[0x1f50] = 0;
    param_2[0x1f51] = 0;
  }
  uVar35 = *(uint *)((longlong)param_2 + 0xfa24);
  uVar25 = (ulonglong)uVar35;
  local_110 = *(uint *)(param_2 + 0x1f45);
  local_10c = *(uint *)((longlong)param_2 + 0xfa2c);
  local_100 = *(uint *)(param_2 + 0x1f46);
  local_fc = *(uint *)((longlong)param_2 + 0xfa34);
  local_104 = *(uint *)(param_2 + 0x1f47);
  local_d8 = *(int *)((longlong)param_2 + 0xfa3c);
  uVar29 = *(uint *)(param_2 + 0x1f48);
  uVar38 = *(uint *)((longlong)param_2 + 0xfa44);
  local_134 = (int)param_2[0x1f49];
  local_ec = *(int *)((longlong)param_2 + 0xfa4c);
  uVar39 = *(uint *)(param_2 + 0x1f4a);
  iVar13 = *(int *)((longlong)param_2 + 0xfa54);
  local_e8 = (int)param_2[0x1f4b];
  local_128 = *(uint *)((longlong)param_2 + 0xfa5c);
  local_74 = (undefined4)param_2[0x1f4c];
  iVar40 = *(int *)((longlong)param_2 + 0xfa64);
  local_130 = *(uint *)(param_2 + 0x1f4d);
  local_124 = *(uint *)((longlong)param_2 + 0xfa6c);
  local_f0 = *(uint *)(param_2 + 0x1f4e);
  local_108 = *(int *)((longlong)param_2 + 0xfa74);
  local_40[0] = local_108;
  local_60 = param_2[0x1f4f];
  local_c8 = param_2[0x1f50];
  local_68 = param_2[0x1f51];
  local_120 = local_60;
  uVar32 = uVar33;
  local_118 = iVar13;
  local_138 = uVar39;
  local_12c = uVar29;
  local_f8 = uVar25;
  local_e0 = local_68;
  local_d4 = uVar38;
  local_c0 = iVar40;
  local_bc = local_104;
  local_b8 = local_f0;
  local_b4 = local_d8;
  local_b0 = uVar29;
  local_ac = local_130;
  local_a8 = local_124;
  local_a4 = local_ec;
  local_a0 = uVar38;
  local_9c = iVar13;
  local_98 = local_134;
  local_94 = local_128;
  local_90 = local_110;
  local_8c = uVar39;
  local_88 = local_10c;
  local_84 = uVar35;
  local_80 = local_100;
  local_7c = local_e8;
  local_78 = local_fc;
  local_70 = local_c8;
  local_58 = param_2;
  local_50 = param_1;
  uVar10 = local_128;
  switch((int)param_2[1]) {
  case 10:
    goto switchD_1401345b7_caseD_a;
  case 0xb:
    goto switchD_1401345b7_caseD_b;
  case 0xc:
    goto switchD_1401345b7_caseD_c;
  case 0xd:
    goto switchD_1401345b7_caseD_d;
  case 0xe:
    goto switchD_1401345b7_caseD_e;
  case 0xf:
    goto switchD_1401345b7_caseD_f;
  case 0x10:
    goto switchD_1401345b7_caseD_10;
  case 0x11:
    goto switchD_1401345b7_caseD_11;
  case 0x12:
    goto switchD_1401345b7_caseD_12;
  case 0x13:
    goto switchD_1401345b7_caseD_13;
  case 0x14:
    goto switchD_1401345b7_caseD_14;
  case 0x15:
    goto switchD_1401345b7_caseD_15;
  case 0x16:
    goto switchD_1401345b7_caseD_16;
  case 0x17:
    goto switchD_1401345b7_caseD_17;
  case 0x18:
    goto switchD_1401345b7_caseD_18;
  case 0x19:
    goto switchD_1401345b7_caseD_19;
  case 0x1a:
    goto switchD_1401345b7_caseD_1a;
  case 0x1b:
    goto switchD_1401345b7_caseD_1b;
  case 0x1c:
    goto switchD_1401345b7_caseD_1c;
  case 0x1d:
    goto LAB_14013525b;
  case 0x1e:
    goto LAB_140135376;
  case 0x1f:
    goto LAB_140135411;
  case 0x20:
    goto LAB_1401354ac;
  case 0x21:
    goto LAB_14013560e;
  case 0x22:
    goto LAB_1401356a4;
  case 0x23:
    goto LAB_14013570d;
  case 0x24:
    goto LAB_140135a23;
  case 0x25:
    goto LAB_140135aa9;
  case 0x26:
    goto LAB_140135dfa;
  case 0x27:
    goto LAB_140135e95;
  case 0x28:
    goto LAB_140135be8;
  case 0x29:
    goto LAB_140135c85;
  case 0x2a:
    goto switchD_1401345b7_caseD_2a;
  case 0x2b:
    goto switchD_1401345b7_caseD_2b;
  case 0x2c:
    goto switchD_1401345b7_caseD_2c;
  case 0x2d:
    goto switchD_1401345b7_caseD_2d;
  case 0x2e:
    goto switchD_1401345b7_caseD_2e;
  case 0x2f:
    goto switchD_1401345b7_caseD_2f;
  case 0x30:
    goto switchD_1401345b7_caseD_30;
  case 0x31:
    goto switchD_1401345b7_caseD_31;
  case 0x32:
    goto switchD_1401345b7_caseD_32;
  default:
    goto switchD_1401345b7_default;
  }
LAB_140135d24:
  local_134 = *(int *)(local_68 + lVar16 * 4);
  uVar33 = (ulonglong)local_138;
  while( true ) {
    uVar10 = (uint)uVar33;
    uVar35 = (uint)local_f8;
    uVar29 = local_12c;
    uVar39 = local_138;
    if (local_134 == local_d8) {
      if (((int)param_2[7] < 0) || ((int)uVar10 <= (int)param_2[7])) {
        uVar32 = 0xffffffe0;
      }
      else {
        uVar10 = (uint)local_d0;
        *(uint *)(param_2 + 2) = uVar10;
        *(undefined1 *)((longlong)param_2 + 0xc) = 0;
        *(undefined4 *)(param_2 + 0x18e) = 0xffffffff;
        *(undefined4 *)(param_2 + 1) = 2;
        puVar28 = (uint *)(param_2 + 0x89);
        *puVar28 = uVar10;
        piVar19 = (int *)((longlong)param_2 + 0x44c);
        piVar26 = (int *)((longlong)param_2 + 0x44);
        lVar34 = 0x40;
        lVar16 = 0x40;
        piVar30 = piVar19;
        do {
          *piVar30 = *piVar26;
          piVar30[1] = piVar26[1];
          piVar30[2] = piVar26[2];
          piVar30[3] = piVar26[3];
          piVar26 = piVar26 + 4;
          lVar16 = lVar16 + -1;
          piVar30 = piVar30 + 4;
        } while (lVar16 != 0);
        uVar12 = 0x100;
        lVar16 = 0x100;
        do {
          *piVar19 = *piVar19 + piVar19[-1];
          piVar19 = piVar19 + 1;
          lVar16 = lVar16 + -1;
        } while (lVar16 != 0);
        uVar5 = (undefined7)(local_d0 >> 8);
        uVar32 = local_d0;
        if (*(char *)((longlong)param_2 + 0x2c) == '\0') {
          uVar33 = local_d0 & 0xffffffff;
          uVar35 = uVar10;
          if (0 < (int)local_138) {
            do {
              uVar36 = (ulonglong)*(byte *)(local_d0 + param_2[0x18a]);
              puVar28 = (uint *)(param_2[0x18a] +
                                (longlong)*(int *)((longlong)param_2 + uVar36 * 4 + 0x448) * 4);
              *puVar28 = *puVar28 | (int)uVar33 << 8;
              piVar26 = (int *)((longlong)param_2 + uVar36 * 4 + 0x448);
              *piVar26 = *piVar26 + 1;
              uVar35 = (int)uVar33 + 1;
              uVar33 = (ulonglong)uVar35;
              local_d0 = local_d0 + 4;
            } while ((int)uVar35 < (int)local_138);
          }
          lVar16 = param_2[0x18a];
          uVar12 = *(uint *)(lVar16 + (longlong)(int)param_2[7] * 4) >> 8;
          *(uint *)((longlong)param_2 + 0x3c) = uVar12;
          *(uint *)((longlong)param_2 + 0x444) = uVar10;
          if (*(char *)((longlong)param_2 + 0x14) != '\0') {
            *(uint *)(param_2 + 3) = uVar10;
            *(uint *)((longlong)param_2 + 0x1c) = uVar10;
            uVar10 = *(uint *)(lVar16 + (ulonglong)uVar12 * 4);
            *(uint *)((longlong)param_2 + 0x3c) = uVar10;
            *(uint *)(param_2 + 8) = uVar10 & 0xff;
            *(uint *)((longlong)param_2 + 0x3c) = *(uint *)((longlong)param_2 + 0x3c) >> 8;
            *(undefined4 *)((longlong)param_2 + 0x444) = 1;
            *(undefined4 *)(param_2 + 3) = DAT_1403099c0;
            *(undefined4 *)((longlong)param_2 + 0x1c) = 1;
            *(int *)(param_2 + 3) = (int)param_2[3] + -1;
            *(uint *)(param_2 + 8) =
                 *(uint *)(param_2 + 8) ^ (uint)CONCAT71(uVar5,(int)param_2[3] == 1);
            iVar13 = local_118;
            goto switchD_1401345b7_default;
          }
          uVar10 = *(uint *)(lVar16 + (ulonglong)*(uint *)((longlong)param_2 + 0x3c) * 4);
          *(uint *)((longlong)param_2 + 0x3c) = uVar10;
          uVar10 = uVar10 & 0xff;
          *(uint *)((longlong)param_2 + 0x3c) = *(uint *)((longlong)param_2 + 0x3c) >> 8;
          *(undefined4 *)((longlong)param_2 + 0x444) = 1;
        }
        else {
          puVar20 = (uint *)((longlong)param_2 + 0x84c);
          do {
            *puVar20 = *puVar28;
            puVar20[1] = puVar28[1];
            puVar20[2] = puVar28[2];
            puVar21 = puVar20 + 4;
            puVar20[3] = puVar28[3];
            puVar28 = puVar28 + 4;
            lVar34 = lVar34 + -1;
            puVar20 = puVar21;
          } while (lVar34 != 0);
          *puVar21 = *puVar28;
          uVar36 = local_d0 & 0xffffffff;
          uVar33 = local_d0;
          if (0 < (int)local_138) {
            do {
              uVar25 = (ulonglong)*(byte *)(param_2[0x18b] + uVar33 * 2);
              *(undefined2 *)(param_2[0x18b] + uVar33 * 2) =
                   *(undefined2 *)((longlong)param_2 + uVar25 * 4 + 0x84c);
              lVar16 = param_2[0x18c];
              lVar34 = (longlong)uVar33 >> 1;
              if ((uVar36 & 1) == 0) {
                *(byte *)(lVar34 + lVar16) =
                     *(byte *)((longlong)param_2 + uVar25 * 4 + 0x84e) |
                     *(byte *)(lVar34 + lVar16) & 0xf0;
              }
              else {
                *(byte *)(lVar34 + lVar16) =
                     ((byte)(*(int *)((longlong)param_2 + uVar25 * 4 + 0x84c) >> 0xc) ^
                     *(byte *)(lVar34 + lVar16)) & 0xf ^
                     (byte)(*(int *)((longlong)param_2 + uVar25 * 4 + 0x84c) >> 0xc);
              }
              piVar26 = (int *)((longlong)param_2 + uVar25 * 4 + 0x84c);
              *piVar26 = *piVar26 + 1;
              uVar35 = (int)uVar36 + 1;
              uVar36 = (ulonglong)uVar35;
              uVar33 = uVar33 + 1;
            } while ((int)uVar35 < (int)local_138);
          }
          uVar33 = (ulonglong)(int)param_2[7];
          local_110 = (*(byte *)(((longlong)uVar33 >> 1) + param_2[0x18c]) >>
                       (((byte)(int)param_2[7] & 1) << 2) & 0xf) << 0x10 |
                      (uint)*(ushort *)(param_2[0x18b] + uVar33 * 2);
          do {
            uVar35 = local_110;
            lVar16 = (longlong)(int)uVar35;
            lVar34 = lVar16 >> 1;
            local_110 = (*(byte *)(param_2[0x18c] + lVar34) >> (((byte)uVar35 & 1) << 2) & 0xf) <<
                        0x10 | (uint)*(ushort *)(param_2[0x18b] + lVar16 * 2);
            *(short *)(param_2[0x18b] + lVar16 * 2) = (short)uVar33;
            lVar16 = param_2[0x18c];
            if ((uVar35 & 1) == 0) {
              *(byte *)(lVar16 + lVar34) =
                   (byte)(uVar33 >> 0x10) | *(byte *)(lVar16 + lVar34) & 0xf0;
            }
            else {
              bVar9 = (byte)((int)uVar33 >> 0xc);
              *(byte *)(lVar16 + lVar34) = (bVar9 ^ *(byte *)(lVar16 + lVar34)) & 0xf ^ bVar9;
            }
            uVar33 = (ulonglong)uVar35;
          } while (uVar35 != *(uint *)(param_2 + 7));
          uVar2 = *(uint *)(param_2 + 7);
          *(uint *)((longlong)param_2 + 0x3c) = uVar2;
          *(uint *)((longlong)param_2 + 0x444) = uVar10;
          if (*(char *)((longlong)param_2 + 0x14) == '\0') {
            do {
              uVar11 = (int)(uVar12 + uVar10) >> 1;
              if (*(int *)((longlong)param_2 + (longlong)(int)uVar11 * 4 + 0x448) <= (int)uVar2) {
                uVar10 = uVar11;
                uVar11 = uVar12;
              }
              uVar12 = uVar11;
            } while (uVar12 - uVar10 != 1);
            *(uint *)(param_2 + 8) = uVar10;
            *(uint *)((longlong)param_2 + 0x3c) =
                 (*(byte *)((ulonglong)(uVar2 >> 1) + param_2[0x18c]) >> (((byte)uVar2 & 1) << 2) &
                 0xf) << 0x10 | (uint)*(ushort *)(param_2[0x18b] + (ulonglong)uVar2 * 2);
            *(undefined4 *)((longlong)param_2 + 0x444) = 1;
            iVar13 = local_118;
            goto switchD_1401345b7_default;
          }
          *(uint *)(param_2 + 3) = uVar10;
          *(uint *)((longlong)param_2 + 0x1c) = uVar10;
          local_d0 = local_d0 & 0xffffffff;
          do {
            uVar10 = (int)(uVar12 + (int)local_d0) >> 1;
            if (*(int *)((longlong)param_2 + (longlong)(int)uVar10 * 4 + 0x448) <= (int)uVar2) {
              local_d0 = (ulonglong)uVar10;
              uVar10 = uVar12;
            }
            uVar12 = uVar10;
            uVar10 = (uint)local_d0;
          } while (uVar12 - uVar10 != 1);
          *(uint *)(param_2 + 8) = uVar10;
          *(uint *)((longlong)param_2 + 0x3c) =
               (*(byte *)((ulonglong)(uVar2 >> 1) + param_2[0x18c]) >> (((byte)uVar2 & 1) << 2) &
               0xf) << 0x10 | (uint)*(ushort *)(param_2[0x18b] + (ulonglong)uVar2 * 2);
          *(undefined4 *)((longlong)param_2 + 0x444) = 1;
          *(undefined4 *)(param_2 + 3) = DAT_1403099c0;
          *(undefined4 *)((longlong)param_2 + 0x1c) = 1;
          *(int *)(param_2 + 3) = (int)param_2[3] + -1;
          uVar10 = (uint)CONCAT71(uVar5,(int)param_2[3] == 1) ^ uVar10;
        }
        *(uint *)(param_2 + 8) = uVar10;
        iVar13 = local_118;
      }
      goto switchD_1401345b7_default;
    }
    if ((local_134 != 0) && (local_134 != 1)) break;
    iVar13 = -1;
    local_e8 = 1;
    do {
      if (local_134 == 0) {
        iVar13 = iVar13 + local_e8;
      }
      else if (local_134 == 1) {
        iVar13 = iVar13 + local_e8 * 2;
      }
      local_e8 = local_e8 * 2;
      if (uVar38 == 0) {
        local_12c = local_12c + 1;
        if ((int)local_104 <= (int)local_12c) {
          uVar38 = 0;
          uVar32 = 0xfffffff4;
          uVar29 = local_12c;
          uVar39 = local_138;
          uVar35 = (uint)local_f8;
          goto switchD_1401345b7_default;
        }
        uVar38 = 0x32;
        bVar9 = *(byte *)((longlong)(int)local_12c + 0x1ecc + (longlong)param_2);
        local_f0 = (uint)bVar9;
        local_108 = *(int *)((longlong)param_2 + (ulonglong)bVar9 * 4 + 0xfa0c);
        lVar16 = (ulonglong)bVar9 * 0x408;
        local_60 = lVar16 + 0xb17c + (longlong)param_2;
        local_68 = lVar16 + 0xe1dc + (longlong)param_2;
        local_c8 = lVar16 + 0xc9ac + (longlong)param_2;
        local_120 = local_60;
        local_e0 = local_68;
      }
      uVar38 = uVar38 - 1;
      iVar40 = local_108;
LAB_140135dfa:
      *(undefined4 *)(param_2 + 1) = 0x26;
      iVar14 = *(int *)((longlong)param_2 + 0x24);
      while (iVar14 < iVar40) {
        plVar18 = (longlong *)*param_2;
        uVar32 = local_d0;
        uVar29 = local_12c;
        uVar39 = local_138;
        uVar35 = (uint)local_f8;
        if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
        *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
        *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
        *plVar18 = *plVar18 + 1;
        *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
        *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
        if (*(int *)(*param_2 + 0xc) == 0) {
          piVar26 = (int *)(*param_2 + 0x10);
          *piVar26 = *piVar26 + 1;
        }
        iVar14 = *(int *)((longlong)param_2 + 0x24);
      }
      iVar14 = *(int *)((longlong)param_2 + 0x24) - iVar40;
      local_130 = *(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f) &
                  (1 << ((byte)iVar40 & 0x1f)) - 1U;
      *(int *)((longlong)param_2 + 0x24) = iVar14;
      local_d4 = uVar38;
      while( true ) {
        if (0x14 < iVar40) goto LAB_140136429;
        if ((int)local_130 <= *(int *)(local_60 + (longlong)iVar40 * 4)) break;
        iVar40 = iVar40 + 1;
LAB_140135e95:
        *(undefined4 *)(param_2 + 1) = 0x27;
        iVar14 = *(int *)((longlong)param_2 + 0x24);
        while (iVar14 < 1) {
          plVar18 = (longlong *)*param_2;
          uVar32 = local_d0;
          uVar29 = local_12c;
          uVar39 = local_138;
          uVar35 = (uint)local_f8;
          if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
          *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
          *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
          *plVar18 = *plVar18 + 1;
          *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
          *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
          if (*(int *)(*param_2 + 0xc) == 0) {
            piVar26 = (int *)(*param_2 + 0x10);
            *piVar26 = *piVar26 + 1;
          }
          iVar14 = *(int *)((longlong)param_2 + 0x24);
        }
        iVar14 = *(int *)((longlong)param_2 + 0x24) + -1;
        local_124 = *(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f) & 1;
        *(int *)((longlong)param_2 + 0x24) = iVar14;
        local_130 = local_130 * 2 | local_124;
      }
      iVar14 = *(int *)(local_c8 + (longlong)iVar40 * 4);
      iVar6 = local_130 - iVar14;
      if ((iVar6 < 0) || (0x101 < iVar6)) goto LAB_14013640d;
      local_134 = *(int *)(local_68 + ((longlong)(int)local_130 - (longlong)iVar14) * 4);
    } while ((local_134 == 0) || (local_134 == 1));
    iVar13 = iVar13 + 1;
    bVar9 = *(byte *)((ulonglong)
                      *(byte *)((longlong)*(int *)((longlong)param_2 + 0x1e8c) + 0xe8c +
                               (longlong)param_2) + 0xd8c + (longlong)param_2);
    piVar26 = (int *)((longlong)param_2 + (ulonglong)bVar9 * 4 + 0x44);
    *piVar26 = *piVar26 + iVar13;
    uVar36 = (ulonglong)(int)local_138;
    uVar33 = uVar36;
    uVar29 = local_12c;
    uVar35 = (uint)local_f8;
    if (*(char *)((longlong)param_2 + 0x2c) == '\0') {
      for (; local_118 = iVar13, 0 < iVar13; iVar13 = iVar13 + -1) {
        if ((longlong)local_ec <= (longlong)uVar36) {
          uVar32 = 0xffffffe2;
          uVar39 = local_138;
          goto switchD_1401345b7_default;
        }
        *(uint *)(param_2[0x18a] + uVar36 * 4) = (uint)bVar9;
        local_138 = (int)uVar33 + 1;
        uVar36 = uVar36 + 1;
        uVar33 = (ulonglong)local_138;
      }
    }
    else {
      for (; local_118 = iVar13, 0 < iVar13; iVar13 = iVar13 + -1) {
        if ((longlong)local_ec <= (longlong)uVar36) {
          uVar32 = 0xffffffe3;
          uVar39 = local_138;
          goto switchD_1401345b7_default;
        }
        *(ushort *)(param_2[0x18b] + uVar36 * 2) = (ushort)bVar9;
        local_138 = (int)uVar33 + 1;
        uVar36 = uVar36 + 1;
        uVar33 = (ulonglong)local_138;
      }
    }
  }
  if (local_ec <= (int)uVar10) {
    uVar32 = 0xffffffe1;
    goto switchD_1401345b7_default;
  }
  uVar29 = local_134 - 1;
  if (uVar29 < 0x10) {
    lVar16 = (longlong)*(int *)((longlong)param_2 + 0x1e8c);
    bVar9 = *(byte *)((ulonglong)(*(int *)((longlong)param_2 + 0x1e8c) + uVar29) + 0xe8c +
                     (longlong)param_2);
    if (3 < uVar29) {
      lVar34 = (longlong)param_2 + 0xe8b;
      puVar17 = (undefined1 *)(lVar34 + lVar16 + (longlong)(int)uVar29);
      uVar33 = (ulonglong)((local_134 - 5U >> 2) + 1);
      do {
        puVar17[(longlong)param_2 + (0xe8c - lVar34)] = *puVar17;
        *puVar17 = puVar17[(longlong)param_2 + (0xe8a - lVar34)];
        puVar17[(longlong)param_2 + (0xe8a - lVar34)] =
             puVar17[(longlong)param_2 + (0xe89 - lVar34)];
        puVar17[(longlong)param_2 + (0xe89 - lVar34)] =
             puVar17[(longlong)param_2 + (0xe88 - lVar34)];
        uVar29 = uVar29 - 4;
        puVar17 = puVar17 + -4;
        uVar33 = uVar33 - 1;
      } while (uVar33 != 0);
    }
    if (uVar29 != 0) {
      puVar17 = (undefined1 *)((longlong)param_2 + (longlong)(int)uVar29 + lVar16 + 0xe8c);
      do {
        *puVar17 = puVar17[-1];
        uVar29 = uVar29 - 1;
        puVar17 = puVar17 + -1;
      } while (uVar29 != 0);
    }
    *(byte *)((longlong)param_2 + lVar16 + 0xe8c) = bVar9;
    local_60 = local_120;
  }
  else {
    uVar33 = (ulonglong)(uVar29 >> 4);
    piVar26 = (int *)((longlong)param_2 + uVar33 * 4 + 0x1e8c);
    iVar13 = (uVar29 & 0xf) + *piVar26;
    pbVar31 = (byte *)((longlong)param_2 + (longlong)iVar13 + 0xe8c);
    bVar9 = *pbVar31;
    if (*piVar26 < iVar13) {
      do {
        *pbVar31 = pbVar31[-1];
        iVar13 = iVar13 + -1;
        pbVar31 = pbVar31 + -1;
      } while (*piVar26 < iVar13);
    }
    *piVar26 = *piVar26 + 1;
    if (uVar29 >> 4 != 0) {
      do {
        iVar13 = *piVar26;
        *piVar26 = iVar13 + -1;
        piVar26 = piVar26 + -1;
        *(undefined1 *)((longlong)(iVar13 + -1) + 0xe8c + (longlong)param_2) =
             *(undefined1 *)((longlong)*piVar26 + 0xe9b + (longlong)param_2);
        uVar29 = (int)uVar33 - 1;
        uVar33 = (ulonglong)uVar29;
      } while (0 < (int)uVar29);
    }
    *(int *)((longlong)param_2 + 0x1e8c) = *(int *)((longlong)param_2 + 0x1e8c) + -1;
    *(byte *)((longlong)*(int *)((longlong)param_2 + 0x1e8c) + 0xe8c + (longlong)param_2) = bVar9;
    if (*(int *)((longlong)param_2 + 0x1e8c) == 0) {
      lVar34 = 0xf;
      lVar16 = (longlong)param_2 + 0xe8b;
      iVar13 = 0x1000;
      plVar18 = param_2 + 0x3d9;
      puVar17 = (undefined1 *)((longlong)param_2 + 0x1e8a);
      do {
        lVar27 = 0xf;
        iVar13 = iVar13 + -0x10;
        puVar37 = puVar17 + -0x10;
        do {
          puVar17[(longlong)param_2 + (0xe8c - lVar16)] =
               *(undefined1 *)((longlong)param_2 + lVar27 + (longlong)(int)*plVar18 + 0xe8c);
          *puVar17 = *(undefined1 *)((longlong)param_2 + lVar27 + (longlong)(int)*plVar18 + 0xe8b);
          puVar17[(longlong)param_2 + (0xe8a - lVar16)] =
               *(undefined1 *)((longlong)param_2 + lVar27 + (longlong)(int)*plVar18 + 0xe8a);
          puVar17[(longlong)param_2 + (0xe89 - lVar16)] =
               *(undefined1 *)((longlong)param_2 + lVar27 + (longlong)(int)*plVar18 + 0xe89);
          puVar17 = puVar17 + -4;
          lVar27 = lVar27 + -4;
        } while (-1 < lVar27);
        *(int *)plVar18 = iVar13;
        plVar18 = (longlong *)((longlong)plVar18 + -4);
        lVar34 = lVar34 + -1;
        local_60 = local_120;
        puVar17 = puVar37;
        uVar10 = local_138;
      } while (-1 < lVar34);
    }
  }
  piVar26 = (int *)((longlong)param_2 +
                   (ulonglong)*(byte *)((ulonglong)bVar9 + 0xd8c + (longlong)param_2) * 4 + 0x44);
  *piVar26 = *piVar26 + 1;
  bVar9 = *(byte *)((ulonglong)bVar9 + 0xd8c + (longlong)param_2);
  if (*(char *)((longlong)param_2 + 0x2c) == '\0') {
    *(uint *)(param_2[0x18a] + (longlong)(int)uVar10 * 4) = (uint)bVar9;
  }
  else {
    *(ushort *)(param_2[0x18b] + (longlong)(int)uVar10 * 2) = (ushort)bVar9;
  }
  if (local_d4 == 0) {
    local_12c = local_12c + 1;
    if ((int)local_104 <= (int)local_12c) {
      uVar38 = 0;
      uVar32 = 0xfffffff4;
      iVar13 = local_118;
      uVar29 = local_12c;
      uVar39 = uVar10 + 1;
      goto switchD_1401345b7_default;
    }
    local_d4 = 0x32;
    bVar9 = *(byte *)((longlong)(int)local_12c + 0x1ecc + (longlong)param_2);
    local_f0 = (uint)bVar9;
    local_108 = *(int *)((longlong)param_2 + (ulonglong)bVar9 * 4 + 0xfa0c);
    lVar16 = (ulonglong)bVar9 * 0x408;
    local_60 = lVar16 + 0xb17c + (longlong)param_2;
    local_68 = lVar16 + 0xe1dc + (longlong)param_2;
    local_c8 = lVar16 + 0xc9ac + (longlong)param_2;
    local_120 = local_60;
    local_e0 = local_68;
  }
  uVar38 = local_d4 - 1;
  iVar40 = local_108;
  local_138 = uVar10 + 1;
LAB_140135be8:
  *(undefined4 *)(param_2 + 1) = 0x28;
  iVar14 = *(int *)((longlong)param_2 + 0x24);
  while (iVar13 = local_118, iVar14 < iVar40) {
    plVar18 = (longlong *)*param_2;
    uVar32 = local_d0;
    uVar29 = local_12c;
    uVar39 = local_138;
    uVar35 = (uint)local_f8;
    if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
    *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
    *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
    *plVar18 = *plVar18 + 1;
    *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
    *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
    if (*(int *)(*param_2 + 0xc) == 0) {
      piVar26 = (int *)(*param_2 + 0x10);
      *piVar26 = *piVar26 + 1;
    }
    iVar14 = *(int *)((longlong)param_2 + 0x24);
  }
  iVar14 = *(int *)((longlong)param_2 + 0x24) - iVar40;
  local_130 = *(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f) & (1 << ((byte)iVar40 & 0x1f)) - 1U;
  *(int *)((longlong)param_2 + 0x24) = iVar14;
  local_d4 = uVar38;
  while( true ) {
    if (0x14 < iVar40) goto LAB_140136429;
    if ((int)local_130 <= *(int *)(local_60 + (longlong)iVar40 * 4)) break;
    iVar40 = iVar40 + 1;
LAB_140135c85:
    *(undefined4 *)(param_2 + 1) = 0x29;
    iVar14 = *(int *)((longlong)param_2 + 0x24);
    while (iVar14 < 1) {
      plVar18 = (longlong *)*param_2;
      uVar32 = local_d0;
      uVar29 = local_12c;
      uVar39 = local_138;
      uVar35 = (uint)local_f8;
      if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
      *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
      *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
      *plVar18 = *plVar18 + 1;
      *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
      *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
      if (*(int *)(*param_2 + 0xc) == 0) {
        piVar26 = (int *)(*param_2 + 0x10);
        *piVar26 = *piVar26 + 1;
      }
      iVar14 = *(int *)((longlong)param_2 + 0x24);
    }
    iVar14 = *(int *)((longlong)param_2 + 0x24) + -1;
    local_124 = *(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f) & 1;
    *(int *)((longlong)param_2 + 0x24) = iVar14;
    local_130 = local_130 * 2 | local_124;
  }
  iVar14 = *(int *)(local_c8 + (longlong)iVar40 * 4);
  iVar6 = local_130 - iVar14;
  if ((iVar6 < 0) || (0x101 < iVar6)) goto LAB_14013640d;
  lVar16 = (longlong)(int)local_130 - (longlong)iVar14;
  goto LAB_140135d24;
LAB_140136429:
  uVar32 = 0xfffffff3;
  uVar29 = local_12c;
  uVar39 = local_138;
  uVar35 = (uint)local_f8;
  goto switchD_1401345b7_default;
LAB_14013640d:
  uVar32 = 0xfffffff2;
  uVar29 = local_12c;
  uVar39 = local_138;
  uVar35 = (uint)local_f8;
  goto switchD_1401345b7_default;
switchD_1401345b7_caseD_a:
  *(undefined4 *)(param_2 + 1) = 10;
  iVar14 = *(int *)((longlong)param_2 + 0x24);
  while (iVar14 < 8) {
    plVar18 = (longlong *)*param_2;
    if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
    *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
    *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
    *plVar18 = *plVar18 + 1;
    *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
    *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
    if (*(int *)(*param_2 + 0xc) == 0) {
      piVar26 = (int *)(*param_2 + 0x10);
      *piVar26 = *piVar26 + 1;
    }
    iVar14 = *(int *)((longlong)param_2 + 0x24);
  }
  iVar14 = *(int *)((longlong)param_2 + 0x24) + -8;
  *(int *)((longlong)param_2 + 0x24) = iVar14;
  if ((char)(*(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f)) != 'B') {
    uVar32 = 0xffffffce;
    goto switchD_1401345b7_default;
  }
switchD_1401345b7_caseD_b:
  *(undefined4 *)(param_2 + 1) = 0xb;
  iVar14 = *(int *)((longlong)param_2 + 0x24);
  while (iVar14 < 8) {
    plVar18 = (longlong *)*param_2;
    if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
    *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
    *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
    *plVar18 = *plVar18 + 1;
    *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
    *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
    if (*(int *)(*param_2 + 0xc) == 0) {
      piVar26 = (int *)(*param_2 + 0x10);
      *piVar26 = *piVar26 + 1;
    }
    iVar14 = *(int *)((longlong)param_2 + 0x24);
  }
  iVar14 = *(int *)((longlong)param_2 + 0x24) + -8;
  *(int *)((longlong)param_2 + 0x24) = iVar14;
  if ((char)(*(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f)) == 'Z') {
switchD_1401345b7_caseD_c:
    *(undefined4 *)(param_2 + 1) = 0xc;
    iVar14 = *(int *)((longlong)param_2 + 0x24);
    while (iVar14 < 8) {
      plVar18 = (longlong *)*param_2;
      if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
      *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
      *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
      *plVar18 = *plVar18 + 1;
      *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
      *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
      if (*(int *)(*param_2 + 0xc) == 0) {
        piVar26 = (int *)(*param_2 + 0x10);
        *piVar26 = *piVar26 + 1;
      }
      iVar14 = *(int *)((longlong)param_2 + 0x24);
    }
    iVar14 = *(int *)((longlong)param_2 + 0x24) + -8;
    *(int *)((longlong)param_2 + 0x24) = iVar14;
    if ((char)(*(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f)) == 'h') {
switchD_1401345b7_caseD_d:
      *(undefined4 *)(param_2 + 1) = 0xd;
      while (iVar14 = *(int *)((longlong)param_2 + 0x24), iVar14 < 8) {
        plVar18 = (longlong *)*param_2;
        if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
        *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
        *(int *)((longlong)param_2 + 0x24) = iVar14 + 8;
        *plVar18 = *plVar18 + 1;
        *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
        *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
        if (*(int *)(*param_2 + 0xc) == 0) {
          piVar26 = (int *)(*param_2 + 0x10);
          *piVar26 = *piVar26 + 1;
        }
      }
      uVar10 = *(uint *)(param_2 + 4) >> ((byte)(iVar14 + -8) & 0x1f) & 0xff;
      *(int *)((longlong)param_2 + 0x24) = iVar14 + -8;
      *(uint *)(param_2 + 5) = uVar10;
      if ((uVar10 < 0x31) || (0x39 < uVar10)) {
        uVar32 = 0xffffffcb;
      }
      else {
        *(uint *)(param_2 + 5) = uVar10 - 0x30;
        local_114 = 0;
        uVar25 = (ulonglong)(int)((uVar10 - 0x30) * 100000);
        if (*(char *)((longlong)param_2 + 0x2c) == '\0') {
          auVar4._8_8_ = 0;
          auVar4._0_8_ = uVar25;
          _Var7 = SUB168(ZEXT816(4) * auVar4,0);
          if (SUB168(ZEXT816(4) * auVar4,8) != 0) {
            _Var7 = 0xffffffffffffffff;
          }
          pvVar8 = operator_new(_Var7);
          param_2[0x18a] = (longlong)pvVar8;
          if (pvVar8 == (void *)0x0) {
            uVar32 = 0xfffffffd;
            iVar13 = local_118;
            uVar29 = local_12c;
            uVar39 = local_138;
            goto switchD_1401345b7_default;
          }
        }
        else {
          auVar3._8_8_ = 0;
          auVar3._0_8_ = uVar25;
          _Var7 = SUB168(ZEXT816(2) * auVar3,0);
          if (SUB168(ZEXT816(2) * auVar3,8) != 0) {
            _Var7 = 0xffffffffffffffff;
          }
          pvVar8 = operator_new(_Var7);
          param_2[0x18b] = (longlong)pvVar8;
          pvVar8 = operator_new((longlong)((int)param_2[5] * 100000 + 1 >> 1));
          param_2[0x18c] = (longlong)pvVar8;
          if ((param_2[0x18b] == 0) || (pvVar8 == (void *)0x0)) {
            uVar32 = 0xfffffffd;
            iVar13 = local_118;
            uVar29 = local_12c;
            uVar39 = local_138;
            goto switchD_1401345b7_default;
          }
        }
        local_114 = 1;
switchD_1401345b7_caseD_e:
        *(undefined4 *)(param_2 + 1) = 0xe;
        iVar14 = *(int *)((longlong)param_2 + 0x24);
        while (iVar13 = local_118, uVar29 = local_12c, uVar39 = local_138, iVar14 < 8) {
          plVar18 = (longlong *)*param_2;
          uVar32 = uVar36;
          if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
          *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
          *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
          *plVar18 = *plVar18 + 1;
          *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
          *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
          if (*(int *)(*param_2 + 0xc) == 0) {
            piVar26 = (int *)(*param_2 + 0x10);
            *piVar26 = *piVar26 + 1;
          }
          iVar14 = *(int *)((longlong)param_2 + 0x24);
        }
        iVar14 = *(int *)((longlong)param_2 + 0x24) + -8;
        *(int *)((longlong)param_2 + 0x24) = iVar14;
        cVar22 = (char)(*(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f));
        if (cVar22 == '\x17') {
switchD_1401345b7_caseD_2a:
          *(undefined4 *)(param_2 + 1) = 0x2a;
          iVar14 = *(int *)((longlong)param_2 + 0x24);
          while (iVar13 = local_118, uVar29 = local_12c, uVar39 = local_138, iVar14 < 8) {
            plVar18 = (longlong *)*param_2;
            uVar32 = uVar36;
            if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
            *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
            *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
            *plVar18 = *plVar18 + 1;
            *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
            *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
            if (*(int *)(*param_2 + 0xc) == 0) {
              piVar26 = (int *)(*param_2 + 0x10);
              *piVar26 = *piVar26 + 1;
            }
            iVar14 = *(int *)((longlong)param_2 + 0x24);
          }
          iVar14 = *(int *)((longlong)param_2 + 0x24) + -8;
          *(int *)((longlong)param_2 + 0x24) = iVar14;
          if ((char)(*(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f)) == 'r') {
switchD_1401345b7_caseD_2b:
            *(undefined4 *)(param_2 + 1) = 0x2b;
            iVar14 = *(int *)((longlong)param_2 + 0x24);
            while (iVar13 = local_118, uVar29 = local_12c, uVar39 = local_138, iVar14 < 8) {
              plVar18 = (longlong *)*param_2;
              uVar32 = uVar36;
              if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
              *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
              *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
              *plVar18 = *plVar18 + 1;
              *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
              *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
              if (*(int *)(*param_2 + 0xc) == 0) {
                piVar26 = (int *)(*param_2 + 0x10);
                *piVar26 = *piVar26 + 1;
              }
              iVar14 = *(int *)((longlong)param_2 + 0x24);
            }
            iVar14 = *(int *)((longlong)param_2 + 0x24) + -8;
            *(int *)((longlong)param_2 + 0x24) = iVar14;
            if ((char)(*(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f)) == 'E') {
switchD_1401345b7_caseD_2c:
              *(undefined4 *)(param_2 + 1) = 0x2c;
              iVar14 = *(int *)((longlong)param_2 + 0x24);
              while (iVar13 = local_118, uVar29 = local_12c, uVar39 = local_138, iVar14 < 8) {
                plVar18 = (longlong *)*param_2;
                uVar32 = uVar36;
                if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                *plVar18 = *plVar18 + 1;
                *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                if (*(int *)(*param_2 + 0xc) == 0) {
                  piVar26 = (int *)(*param_2 + 0x10);
                  *piVar26 = *piVar26 + 1;
                }
                iVar14 = *(int *)((longlong)param_2 + 0x24);
              }
              iVar14 = *(int *)((longlong)param_2 + 0x24) + -8;
              *(int *)((longlong)param_2 + 0x24) = iVar14;
              if ((char)(*(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f)) == '8') {
switchD_1401345b7_caseD_2d:
                *(undefined4 *)(param_2 + 1) = 0x2d;
                iVar14 = *(int *)((longlong)param_2 + 0x24);
                while (iVar13 = local_118, uVar29 = local_12c, uVar39 = local_138, iVar14 < 8) {
                  plVar18 = (longlong *)*param_2;
                  uVar32 = uVar36;
                  if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                  *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                  *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                  *plVar18 = *plVar18 + 1;
                  *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                  *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                  if (*(int *)(*param_2 + 0xc) == 0) {
                    piVar26 = (int *)(*param_2 + 0x10);
                    *piVar26 = *piVar26 + 1;
                  }
                  iVar14 = *(int *)((longlong)param_2 + 0x24);
                }
                iVar14 = *(int *)((longlong)param_2 + 0x24) + -8;
                *(int *)((longlong)param_2 + 0x24) = iVar14;
                if ((char)(*(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f)) == 'P') {
switchD_1401345b7_caseD_2e:
                  *(undefined4 *)(param_2 + 1) = 0x2e;
                  iVar14 = *(int *)((longlong)param_2 + 0x24);
                  while (iVar13 = local_118, uVar29 = local_12c, uVar39 = local_138, iVar14 < 8) {
                    plVar18 = (longlong *)*param_2;
                    uVar32 = uVar36;
                    if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                    *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                    *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                    *plVar18 = *plVar18 + 1;
                    *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                    *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                    if (*(int *)(*param_2 + 0xc) == 0) {
                      piVar26 = (int *)(*param_2 + 0x10);
                      *piVar26 = *piVar26 + 1;
                    }
                    iVar14 = *(int *)((longlong)param_2 + 0x24);
                  }
                  iVar14 = *(int *)((longlong)param_2 + 0x24) + -8;
                  *(int *)((longlong)param_2 + 0x24) = iVar14;
                  if ((char)(*(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f)) == -0x70) {
                    *(undefined4 *)((longlong)param_2 + 0xc6c) = 0;
switchD_1401345b7_caseD_2f:
                    *(undefined4 *)(param_2 + 1) = 0x2f;
                    iVar13 = *(int *)((longlong)param_2 + 0x24);
                    while (iVar13 < 8) {
                      plVar18 = (longlong *)*param_2;
                      uVar32 = uVar36;
                      iVar13 = local_118;
                      uVar29 = local_12c;
                      uVar39 = local_138;
                      if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                      *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                      *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                      *plVar18 = *plVar18 + 1;
                      *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                      *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                      if (*(int *)(*param_2 + 0xc) == 0) {
                        piVar26 = (int *)(*param_2 + 0x10);
                        *piVar26 = *piVar26 + 1;
                      }
                      iVar13 = *(int *)((longlong)param_2 + 0x24);
                    }
                    iVar13 = *(int *)((longlong)param_2 + 0x24) + -8;
                    *(int *)((longlong)param_2 + 0x24) = iVar13;
                    *(uint *)((longlong)param_2 + 0xc6c) =
                         *(int *)((longlong)param_2 + 0xc6c) << 8 |
                         *(uint *)(param_2 + 4) >> ((byte)iVar13 & 0x1f) & 0xff;
switchD_1401345b7_caseD_30:
                    *(undefined4 *)(param_2 + 1) = 0x30;
                    iVar13 = *(int *)((longlong)param_2 + 0x24);
                    while (iVar13 < 8) {
                      plVar18 = (longlong *)*param_2;
                      uVar32 = uVar33;
                      iVar13 = local_118;
                      uVar29 = local_12c;
                      uVar39 = local_138;
                      if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                      *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                      *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                      *plVar18 = *plVar18 + 1;
                      *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                      *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                      if (*(int *)(*param_2 + 0xc) == 0) {
                        piVar26 = (int *)(*param_2 + 0x10);
                        *piVar26 = *piVar26 + 1;
                      }
                      iVar13 = *(int *)((longlong)param_2 + 0x24);
                    }
                    iVar13 = *(int *)((longlong)param_2 + 0x24) + -8;
                    *(int *)((longlong)param_2 + 0x24) = iVar13;
                    *(uint *)((longlong)param_2 + 0xc6c) =
                         *(int *)((longlong)param_2 + 0xc6c) << 8 |
                         *(uint *)(param_2 + 4) >> ((byte)iVar13 & 0x1f) & 0xff;
switchD_1401345b7_caseD_31:
                    *(undefined4 *)(param_2 + 1) = 0x31;
                    iVar13 = *(int *)((longlong)param_2 + 0x24);
                    while (iVar13 < 8) {
                      plVar18 = (longlong *)*param_2;
                      uVar32 = uVar33;
                      iVar13 = local_118;
                      uVar29 = local_12c;
                      uVar39 = local_138;
                      if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                      *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                      *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                      *plVar18 = *plVar18 + 1;
                      *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                      *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                      if (*(int *)(*param_2 + 0xc) == 0) {
                        piVar26 = (int *)(*param_2 + 0x10);
                        *piVar26 = *piVar26 + 1;
                      }
                      iVar13 = *(int *)((longlong)param_2 + 0x24);
                    }
                    iVar13 = *(int *)((longlong)param_2 + 0x24) + -8;
                    *(int *)((longlong)param_2 + 0x24) = iVar13;
                    *(uint *)((longlong)param_2 + 0xc6c) =
                         *(int *)((longlong)param_2 + 0xc6c) << 8 |
                         *(uint *)(param_2 + 4) >> ((byte)iVar13 & 0x1f) & 0xff;
switchD_1401345b7_caseD_32:
                    *(undefined4 *)(param_2 + 1) = 0x32;
                    iVar14 = *(int *)((longlong)param_2 + 0x24);
                    while (iVar13 = local_118, uVar29 = local_12c, uVar39 = local_138, iVar14 < 8) {
                      plVar18 = (longlong *)*param_2;
                      uVar32 = uVar33;
                      if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                      *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                      *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                      *plVar18 = *plVar18 + 1;
                      *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                      *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                      if (*(int *)(*param_2 + 0xc) == 0) {
                        piVar26 = (int *)(*param_2 + 0x10);
                        *piVar26 = *piVar26 + 1;
                      }
                      iVar14 = *(int *)((longlong)param_2 + 0x24);
                    }
                    iVar14 = *(int *)((longlong)param_2 + 0x24) + -8;
                    *(int *)((longlong)param_2 + 0x24) = iVar14;
                    *(uint *)((longlong)param_2 + 0xc6c) =
                         *(int *)((longlong)param_2 + 0xc6c) << 8 |
                         *(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f) & 0xff;
                    *(undefined4 *)(param_2 + 1) = 1;
                    uVar32 = 4;
                  }
                  else {
                    uVar32 = 0xffffffdb;
                  }
                }
                else {
                  uVar32 = 0xffffffdc;
                }
              }
              else {
                uVar32 = 0xffffffdd;
              }
            }
            else {
              uVar32 = 0xffffffde;
            }
          }
          else {
            uVar32 = 0xffffffdf;
          }
        }
        else if (cVar22 == '1') {
switchD_1401345b7_caseD_f:
          *(undefined4 *)(param_2 + 1) = 0xf;
          iVar14 = *(int *)((longlong)param_2 + 0x24);
          while (iVar13 = local_118, uVar29 = local_12c, uVar39 = local_138, iVar14 < 8) {
            plVar18 = (longlong *)*param_2;
            uVar32 = uVar36;
            if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
            *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
            *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
            *plVar18 = *plVar18 + 1;
            *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
            *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
            if (*(int *)(*param_2 + 0xc) == 0) {
              piVar26 = (int *)(*param_2 + 0x10);
              *piVar26 = *piVar26 + 1;
            }
            iVar14 = *(int *)((longlong)param_2 + 0x24);
          }
          iVar14 = *(int *)((longlong)param_2 + 0x24) + -8;
          *(int *)((longlong)param_2 + 0x24) = iVar14;
          if ((char)(*(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f)) == 'A') {
switchD_1401345b7_caseD_10:
            *(undefined4 *)(param_2 + 1) = 0x10;
            iVar14 = *(int *)((longlong)param_2 + 0x24);
            while (iVar13 = local_118, uVar29 = local_12c, uVar39 = local_138, iVar14 < 8) {
              plVar18 = (longlong *)*param_2;
              uVar32 = uVar36;
              if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
              *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
              *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
              *plVar18 = *plVar18 + 1;
              *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
              *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
              if (*(int *)(*param_2 + 0xc) == 0) {
                piVar26 = (int *)(*param_2 + 0x10);
                *piVar26 = *piVar26 + 1;
              }
              iVar14 = *(int *)((longlong)param_2 + 0x24);
            }
            iVar14 = *(int *)((longlong)param_2 + 0x24) + -8;
            *(int *)((longlong)param_2 + 0x24) = iVar14;
            if ((char)(*(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f)) == 'Y') {
switchD_1401345b7_caseD_11:
              *(undefined4 *)(param_2 + 1) = 0x11;
              iVar14 = *(int *)((longlong)param_2 + 0x24);
              while (iVar13 = local_118, uVar29 = local_12c, uVar39 = local_138, iVar14 < 8) {
                plVar18 = (longlong *)*param_2;
                uVar32 = uVar36;
                if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                *plVar18 = *plVar18 + 1;
                *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                if (*(int *)(*param_2 + 0xc) == 0) {
                  piVar26 = (int *)(*param_2 + 0x10);
                  *piVar26 = *piVar26 + 1;
                }
                iVar14 = *(int *)((longlong)param_2 + 0x24);
              }
              iVar14 = *(int *)((longlong)param_2 + 0x24) + -8;
              *(int *)((longlong)param_2 + 0x24) = iVar14;
              if ((char)(*(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f)) == '&') {
switchD_1401345b7_caseD_12:
                *(undefined4 *)(param_2 + 1) = 0x12;
                iVar14 = *(int *)((longlong)param_2 + 0x24);
                while (iVar13 = local_118, uVar29 = local_12c, uVar39 = local_138, iVar14 < 8) {
                  plVar18 = (longlong *)*param_2;
                  uVar32 = uVar36;
                  if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                  *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                  *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                  *plVar18 = *plVar18 + 1;
                  *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                  *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                  if (*(int *)(*param_2 + 0xc) == 0) {
                    piVar26 = (int *)(*param_2 + 0x10);
                    *piVar26 = *piVar26 + 1;
                  }
                  iVar14 = *(int *)((longlong)param_2 + 0x24);
                }
                iVar14 = *(int *)((longlong)param_2 + 0x24) + -8;
                *(int *)((longlong)param_2 + 0x24) = iVar14;
                if ((char)(*(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f)) == 'S') {
switchD_1401345b7_caseD_13:
                  *(undefined4 *)(param_2 + 1) = 0x13;
                  iVar14 = *(int *)((longlong)param_2 + 0x24);
                  while (iVar13 = local_118, uVar29 = local_12c, uVar39 = local_138, iVar14 < 8) {
                    plVar18 = (longlong *)*param_2;
                    uVar32 = uVar36;
                    if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                    *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                    *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                    *plVar18 = *plVar18 + 1;
                    *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                    *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                    if (*(int *)(*param_2 + 0xc) == 0) {
                      piVar26 = (int *)(*param_2 + 0x10);
                      *piVar26 = *piVar26 + 1;
                    }
                    iVar14 = *(int *)((longlong)param_2 + 0x24);
                  }
                  iVar14 = *(int *)((longlong)param_2 + 0x24) + -8;
                  *(int *)((longlong)param_2 + 0x24) = iVar14;
                  if ((char)(*(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f)) == 'Y') {
                    *(int *)(param_2 + 6) = (int)param_2[6] + 1;
                    *(undefined4 *)(param_2 + 0x18d) = 0;
switchD_1401345b7_caseD_14:
                    *(undefined4 *)(param_2 + 1) = 0x14;
                    iVar13 = *(int *)((longlong)param_2 + 0x24);
                    while (iVar13 < 8) {
                      plVar18 = (longlong *)*param_2;
                      uVar32 = uVar36;
                      iVar13 = local_118;
                      uVar29 = local_12c;
                      uVar39 = local_138;
                      if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                      *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                      *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                      *plVar18 = *plVar18 + 1;
                      *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                      *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                      if (*(int *)(*param_2 + 0xc) == 0) {
                        piVar26 = (int *)(*param_2 + 0x10);
                        *piVar26 = *piVar26 + 1;
                      }
                      iVar13 = *(int *)((longlong)param_2 + 0x24);
                    }
                    iVar13 = *(int *)((longlong)param_2 + 0x24) + -8;
                    *(int *)((longlong)param_2 + 0x24) = iVar13;
                    *(uint *)(param_2 + 0x18d) =
                         (int)param_2[0x18d] << 8 |
                         *(uint *)(param_2 + 4) >> ((byte)iVar13 & 0x1f) & 0xff;
switchD_1401345b7_caseD_15:
                    *(undefined4 *)(param_2 + 1) = 0x15;
                    iVar13 = *(int *)((longlong)param_2 + 0x24);
                    while (iVar13 < 8) {
                      plVar18 = (longlong *)*param_2;
                      uVar32 = uVar36;
                      iVar13 = local_118;
                      uVar29 = local_12c;
                      uVar39 = local_138;
                      if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                      *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                      *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                      *plVar18 = *plVar18 + 1;
                      *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                      *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                      if (*(int *)(*param_2 + 0xc) == 0) {
                        piVar26 = (int *)(*param_2 + 0x10);
                        *piVar26 = *piVar26 + 1;
                      }
                      iVar13 = *(int *)((longlong)param_2 + 0x24);
                    }
                    iVar13 = *(int *)((longlong)param_2 + 0x24) + -8;
                    *(int *)((longlong)param_2 + 0x24) = iVar13;
                    *(uint *)(param_2 + 0x18d) =
                         (int)param_2[0x18d] << 8 |
                         *(uint *)(param_2 + 4) >> ((byte)iVar13 & 0x1f) & 0xff;
switchD_1401345b7_caseD_16:
                    *(undefined4 *)(param_2 + 1) = 0x16;
                    iVar13 = *(int *)((longlong)param_2 + 0x24);
                    while (iVar13 < 8) {
                      plVar18 = (longlong *)*param_2;
                      uVar32 = uVar36;
                      iVar13 = local_118;
                      uVar29 = local_12c;
                      uVar39 = local_138;
                      if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                      *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                      *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                      *plVar18 = *plVar18 + 1;
                      *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                      *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                      if (*(int *)(*param_2 + 0xc) == 0) {
                        piVar26 = (int *)(*param_2 + 0x10);
                        *piVar26 = *piVar26 + 1;
                      }
                      iVar13 = *(int *)((longlong)param_2 + 0x24);
                    }
                    iVar13 = *(int *)((longlong)param_2 + 0x24) + -8;
                    *(int *)((longlong)param_2 + 0x24) = iVar13;
                    *(uint *)(param_2 + 0x18d) =
                         (int)param_2[0x18d] << 8 |
                         *(uint *)(param_2 + 4) >> ((byte)iVar13 & 0x1f) & 0xff;
switchD_1401345b7_caseD_17:
                    *(undefined4 *)(param_2 + 1) = 0x17;
                    iVar13 = *(int *)((longlong)param_2 + 0x24);
                    while (iVar13 < 8) {
                      plVar18 = (longlong *)*param_2;
                      uVar32 = uVar36;
                      iVar13 = local_118;
                      uVar29 = local_12c;
                      uVar39 = local_138;
                      if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                      *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                      *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                      *plVar18 = *plVar18 + 1;
                      *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                      *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                      if (*(int *)(*param_2 + 0xc) == 0) {
                        piVar26 = (int *)(*param_2 + 0x10);
                        *piVar26 = *piVar26 + 1;
                      }
                      iVar13 = *(int *)((longlong)param_2 + 0x24);
                    }
                    iVar13 = *(int *)((longlong)param_2 + 0x24) + -8;
                    *(int *)((longlong)param_2 + 0x24) = iVar13;
                    *(uint *)(param_2 + 0x18d) =
                         (int)param_2[0x18d] << 8 |
                         *(uint *)(param_2 + 4) >> ((byte)iVar13 & 0x1f) & 0xff;
switchD_1401345b7_caseD_18:
                    *(undefined4 *)(param_2 + 1) = 0x18;
                    iVar13 = *(int *)((longlong)param_2 + 0x24);
                    while (iVar13 < 1) {
                      plVar18 = (longlong *)*param_2;
                      uVar32 = uVar36;
                      iVar13 = local_118;
                      uVar29 = local_12c;
                      uVar39 = local_138;
                      if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                      *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                      *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                      *plVar18 = *plVar18 + 1;
                      *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                      *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                      if (*(int *)(*param_2 + 0xc) == 0) {
                        piVar26 = (int *)(*param_2 + 0x10);
                        *piVar26 = *piVar26 + 1;
                      }
                      iVar13 = *(int *)((longlong)param_2 + 0x24);
                    }
                    iVar13 = *(int *)((longlong)param_2 + 0x24) + -1;
                    *(int *)((longlong)param_2 + 0x24) = iVar13;
                    *(byte *)((longlong)param_2 + 0x14) =
                         (byte)(*(uint *)(param_2 + 4) >> ((byte)iVar13 & 0x1f)) & 1;
                    *(undefined4 *)(param_2 + 7) = 0;
switchD_1401345b7_caseD_19:
                    *(undefined4 *)(param_2 + 1) = 0x19;
                    iVar13 = *(int *)((longlong)param_2 + 0x24);
                    while (iVar13 < 8) {
                      plVar18 = (longlong *)*param_2;
                      uVar32 = uVar36;
                      iVar13 = local_118;
                      uVar29 = local_12c;
                      uVar39 = local_138;
                      if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                      *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                      *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                      *plVar18 = *plVar18 + 1;
                      *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                      *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                      if (*(int *)(*param_2 + 0xc) == 0) {
                        piVar26 = (int *)(*param_2 + 0x10);
                        *piVar26 = *piVar26 + 1;
                      }
                      iVar13 = *(int *)((longlong)param_2 + 0x24);
                    }
                    iVar13 = *(int *)((longlong)param_2 + 0x24) + -8;
                    *(int *)((longlong)param_2 + 0x24) = iVar13;
                    *(uint *)(param_2 + 7) =
                         (int)param_2[7] << 8 |
                         *(uint *)(param_2 + 4) >> ((byte)iVar13 & 0x1f) & 0xff;
switchD_1401345b7_caseD_1a:
                    *(undefined4 *)(param_2 + 1) = 0x1a;
                    iVar13 = *(int *)((longlong)param_2 + 0x24);
                    while (iVar13 < 8) {
                      plVar18 = (longlong *)*param_2;
                      uVar32 = uVar36;
                      iVar13 = local_118;
                      uVar29 = local_12c;
                      uVar39 = local_138;
                      if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                      *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                      *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                      *plVar18 = *plVar18 + 1;
                      *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                      *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                      if (*(int *)(*param_2 + 0xc) == 0) {
                        piVar26 = (int *)(*param_2 + 0x10);
                        *piVar26 = *piVar26 + 1;
                      }
                      iVar13 = *(int *)((longlong)param_2 + 0x24);
                    }
                    iVar13 = *(int *)((longlong)param_2 + 0x24) + -8;
                    *(int *)((longlong)param_2 + 0x24) = iVar13;
                    *(uint *)(param_2 + 7) =
                         (int)param_2[7] << 8 |
                         *(uint *)(param_2 + 4) >> ((byte)iVar13 & 0x1f) & 0xff;
switchD_1401345b7_caseD_1b:
                    *(undefined4 *)(param_2 + 1) = 0x1b;
                    iVar14 = *(int *)((longlong)param_2 + 0x24);
                    while (iVar13 = local_118, uVar29 = local_12c, uVar39 = local_138, iVar14 < 8) {
                      plVar18 = (longlong *)*param_2;
                      uVar32 = uVar36;
                      if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                      *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                      *(int *)((longlong)param_2 + 0x24) = *(int *)((longlong)param_2 + 0x24) + 8;
                      *plVar18 = *plVar18 + 1;
                      *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                      *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                      if (*(int *)(*param_2 + 0xc) == 0) {
                        piVar26 = (int *)(*param_2 + 0x10);
                        *piVar26 = *piVar26 + 1;
                      }
                      iVar14 = *(int *)((longlong)param_2 + 0x24);
                    }
                    iVar14 = *(int *)((longlong)param_2 + 0x24) + -8;
                    *(int *)((longlong)param_2 + 0x24) = iVar14;
                    uVar10 = (int)param_2[7] << 8 |
                             *(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f) & 0xff;
                    *(uint *)(param_2 + 7) = uVar10;
                    if ((int)uVar10 < 0) {
                      uVar32 = 0xffffffea;
                    }
                    else {
                      uVar25 = uVar33;
                      if ((int)param_2[5] * 100000 + 10 < (int)uVar10) {
                        uVar32 = 0xffffffe9;
                      }
                      else {
                        while (uVar35 = (uint)uVar25, (int)uVar35 < 0x10) {
switchD_1401345b7_caseD_1c:
                          *(undefined4 *)(param_2 + 1) = 0x1c;
                          iVar14 = *(int *)((longlong)param_2 + 0x24);
                          while (iVar14 < 1) {
                            plVar18 = (longlong *)*param_2;
                            uVar32 = uVar36;
                            uVar29 = local_12c;
                            uVar39 = local_138;
                            if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                            *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                            *(int *)((longlong)param_2 + 0x24) =
                                 *(int *)((longlong)param_2 + 0x24) + 8;
                            *plVar18 = *plVar18 + 1;
                            *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                            *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                            if (*(int *)(*param_2 + 0xc) == 0) {
                              piVar26 = (int *)(*param_2 + 0x10);
                              *piVar26 = *piVar26 + 1;
                            }
                            iVar14 = *(int *)((longlong)param_2 + 0x24);
                          }
                          iVar14 = *(int *)((longlong)param_2 + 0x24) + -1;
                          *(int *)((longlong)param_2 + 0x24) = iVar14;
                          if (((byte)(*(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f)) & 1) == 1) {
                            *(undefined1 *)((longlong)(int)uVar35 + 0xd7c + (longlong)param_2) = 1;
                          }
                          else {
                            *(undefined1 *)((longlong)(int)uVar35 + 0xd7c + (longlong)param_2) = 0;
                          }
                          uVar25 = (ulonglong)(uVar35 + 1);
                        }
                        memset((void *)((longlong)param_2 + 0xc7c),0,0x100);
                        uVar25 = uVar33;
                        while (uVar35 = (uint)uVar25, (int)uVar35 < 0x10) {
                          uVar29 = 0;
                          if (*(char *)((longlong)(int)uVar35 + 0xd7c + (longlong)param_2) != '\0')
                          {
                            while (uVar35 = (uint)uVar25, local_110 = uVar29, (int)uVar29 < 0x10) {
LAB_14013525b:
                              uVar35 = (uint)uVar25;
                              *(undefined4 *)(param_2 + 1) = 0x1d;
                              iVar13 = *(int *)((longlong)param_2 + 0x24);
                              while (iVar13 < 1) {
                                plVar18 = (longlong *)*param_2;
                                uVar32 = uVar36;
                                iVar13 = local_118;
                                uVar29 = local_12c;
                                uVar39 = local_138;
                                if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                                *(uint *)(param_2 + 4) =
                                     (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                                *(int *)((longlong)param_2 + 0x24) =
                                     *(int *)((longlong)param_2 + 0x24) + 8;
                                *plVar18 = *plVar18 + 1;
                                *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                                *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                                if (*(int *)(*param_2 + 0xc) == 0) {
                                  piVar26 = (int *)(*param_2 + 0x10);
                                  *piVar26 = *piVar26 + 1;
                                }
                                iVar13 = *(int *)((longlong)param_2 + 0x24);
                              }
                              iVar13 = *(int *)((longlong)param_2 + 0x24) + -1;
                              *(int *)((longlong)param_2 + 0x24) = iVar13;
                              if (((byte)(*(uint *)(param_2 + 4) >> ((byte)iVar13 & 0x1f)) & 1) == 1
                                 ) {
                                *(undefined1 *)
                                 ((longlong)param_2 +
                                 (longlong)(int)local_110 + 0xc7c + (longlong)(int)uVar35 * 0x10) =
                                     1;
                              }
                              uVar29 = local_110 + 1;
                            }
                          }
                          uVar25 = (ulonglong)(uVar35 + 1);
                        }
                        *(undefined4 *)(param_2 + 399) = 0;
                        pcVar23 = (char *)((longlong)param_2 + 0xc7c);
                        uVar25 = uVar33;
                        do {
                          if (*pcVar23 != '\0') {
                            *(char *)((longlong)(int)param_2[399] + 0xd8c + (longlong)param_2) =
                                 (char)uVar25;
                            *(int *)(param_2 + 399) = (int)param_2[399] + 1;
                          }
                          uVar29 = (int)uVar25 + 1;
                          uVar25 = (ulonglong)uVar29;
                          pcVar23 = pcVar23 + 1;
                        } while ((int)uVar29 < 0x100);
                        if ((int)param_2[399] == 0) {
                          uVar32 = 0xffffffe8;
                          iVar13 = local_118;
                          uVar29 = local_12c;
                          uVar39 = local_138;
                        }
                        else {
                          local_100 = (int)param_2[399] + 2;
LAB_140135376:
                          *(undefined4 *)(param_2 + 1) = 0x1e;
                          iVar14 = *(int *)((longlong)param_2 + 0x24);
                          while (iVar13 = local_118, uVar29 = local_12c, uVar39 = local_138,
                                iVar14 < 3) {
                            plVar18 = (longlong *)*param_2;
                            uVar32 = uVar36;
                            if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                            *(uint *)(param_2 + 4) = (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                            *(int *)((longlong)param_2 + 0x24) =
                                 *(int *)((longlong)param_2 + 0x24) + 8;
                            *plVar18 = *plVar18 + 1;
                            *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                            *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                            if (*(int *)(*param_2 + 0xc) == 0) {
                              piVar26 = (int *)(*param_2 + 0x10);
                              *piVar26 = *piVar26 + 1;
                            }
                            iVar14 = *(int *)((longlong)param_2 + 0x24);
                          }
                          iVar14 = *(int *)((longlong)param_2 + 0x24) + -3;
                          local_fc = *(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f) & 7;
                          *(int *)((longlong)param_2 + 0x24) = iVar14;
                          if ((local_fc < 2) || (6 < local_fc)) {
                            uVar32 = 0xffffffe7;
                          }
                          else {
LAB_140135411:
                            *(undefined4 *)(param_2 + 1) = 0x1f;
                            iVar14 = *(int *)((longlong)param_2 + 0x24);
                            while (iVar13 = local_118, uVar29 = local_12c, uVar39 = local_138,
                                  iVar14 < 0xf) {
                              plVar18 = (longlong *)*param_2;
                              uVar32 = uVar36;
                              if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                              *(uint *)(param_2 + 4) =
                                   (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                              *(int *)((longlong)param_2 + 0x24) =
                                   *(int *)((longlong)param_2 + 0x24) + 8;
                              *plVar18 = *plVar18 + 1;
                              *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                              *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                              if (*(int *)(*param_2 + 0xc) == 0) {
                                piVar26 = (int *)(*param_2 + 0x10);
                                *piVar26 = *piVar26 + 1;
                              }
                              iVar14 = *(int *)((longlong)param_2 + 0x24);
                            }
                            iVar14 = *(int *)((longlong)param_2 + 0x24) + -0xf;
                            local_104 = *(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f) & 0x7fff;
                            *(int *)((longlong)param_2 + 0x24) = iVar14;
                            uVar25 = uVar33;
                            if (local_104 == 0) {
                              uVar32 = 0xffffffe6;
                            }
                            else {
                              while ((int)uVar25 < (int)local_104) {
                                local_110 = 0;
LAB_1401354ac:
                                while( true ) {
                                  uVar35 = (uint)uVar25;
                                  *(undefined4 *)(param_2 + 1) = 0x20;
                                  iVar14 = *(int *)((longlong)param_2 + 0x24);
                                  while (uVar29 = local_12c, uVar39 = local_138, iVar14 < 1) {
                                    plVar18 = (longlong *)*param_2;
                                    uVar32 = uVar36;
                                    if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                                    *(uint *)(param_2 + 4) =
                                         (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                                    *(int *)((longlong)param_2 + 0x24) =
                                         *(int *)((longlong)param_2 + 0x24) + 8;
                                    *plVar18 = *plVar18 + 1;
                                    *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                                    *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                                    if (*(int *)(*param_2 + 0xc) == 0) {
                                      piVar26 = (int *)(*param_2 + 0x10);
                                      *piVar26 = *piVar26 + 1;
                                    }
                                    iVar14 = *(int *)((longlong)param_2 + 0x24);
                                  }
                                  iVar14 = *(int *)((longlong)param_2 + 0x24) + -1;
                                  *(int *)((longlong)param_2 + 0x24) = iVar14;
                                  if ((*(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f) & 1) == 0)
                                  break;
                                  local_110 = local_110 + 1;
                                  if ((int)local_fc <= (int)local_110) {
                                    uVar32 = 0xffffffe5;
                                    goto switchD_1401345b7_default;
                                  }
                                }
                                *(char *)((longlong)(int)uVar35 + 0x651e + (longlong)param_2) =
                                     (char)local_110;
                                uVar25 = (ulonglong)(uVar35 + 1);
                              }
                              uVar36 = 0;
                              if (0 < (int)local_fc) {
                                do {
                                  *(char *)((longlong)local_40 + uVar36) = (char)uVar36;
                                  bVar9 = (char)uVar36 + 1;
                                  uVar36 = (ulonglong)bVar9;
                                } while ((int)(uint)bVar9 < (int)local_fc);
                              }
                              uVar36 = uVar33;
                              uVar25 = uVar33;
                              if (0 < (int)local_104) {
                                puVar17 = (undefined1 *)((longlong)param_2 + 0x1ecc);
                                uVar25 = (ulonglong)local_104;
                                uVar32 = (ulonglong)local_104;
                                do {
                                  bVar9 = puVar17[0x4652];
                                  uVar24 = (ulonglong)bVar9;
                                  puVar37 = (undefined1 *)((longlong)local_40 + uVar24);
                                  uVar1 = *puVar37;
                                  while (bVar9 != 0) {
                                    *puVar37 = puVar37[-1];
                                    puVar37 = puVar37 + -1;
                                    bVar9 = (char)uVar24 - 1;
                                    uVar24 = (ulonglong)bVar9;
                                  }
                                  uVar35 = (uint)local_40[0] >> 8;
                                  local_40[0] = CONCAT31((int3)uVar35,uVar1);
                                  *puVar17 = uVar1;
                                  puVar17 = puVar17 + 1;
                                  uVar32 = uVar32 - 1;
                                } while (uVar32 != 0);
                              }
                              while( true ) {
                                uVar24 = local_d0;
                                uVar35 = (uint)uVar25;
                                local_10c = (uint)uVar36;
                                if ((int)local_fc <= (int)local_10c) break;
LAB_14013560e:
                                *(undefined4 *)(param_2 + 1) = 0x21;
                                iVar13 = *(int *)((longlong)param_2 + 0x24);
                                while (iVar13 < 5) {
                                  plVar18 = (longlong *)*param_2;
                                  uVar32 = uVar33;
                                  iVar13 = local_118;
                                  uVar29 = local_12c;
                                  uVar39 = local_138;
                                  if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                                  *(uint *)(param_2 + 4) =
                                       (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                                  *(int *)((longlong)param_2 + 0x24) =
                                       *(int *)((longlong)param_2 + 0x24) + 8;
                                  *plVar18 = *plVar18 + 1;
                                  *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                                  *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                                  if (*(int *)(*param_2 + 0xc) == 0) {
                                    piVar26 = (int *)(*param_2 + 0x10);
                                    *piVar26 = *piVar26 + 1;
                                  }
                                  iVar13 = *(int *)((longlong)param_2 + 0x24);
                                }
                                iVar13 = *(int *)((longlong)param_2 + 0x24) + -5;
                                uVar10 = *(uint *)(param_2 + 4) >> ((byte)iVar13 & 0x1f) & 0x1f;
                                *(int *)((longlong)param_2 + 0x24) = iVar13;
                                uVar36 = (ulonglong)local_10c;
                                uVar25 = 0;
                                local_128 = uVar10;
                                while ((int)uVar25 < (int)local_100) {
                                  while( true ) {
                                    uVar35 = (uint)uVar25;
                                    if (((int)uVar10 < 1) || (0x14 < (int)uVar10)) {
                                      uVar32 = 0xffffffe4;
                                      iVar13 = local_118;
                                      uVar29 = local_12c;
                                      uVar39 = local_138;
                                      goto switchD_1401345b7_default;
                                    }
LAB_1401356a4:
                                    uVar35 = (uint)uVar25;
                                    *(undefined4 *)(param_2 + 1) = 0x22;
                                    iVar13 = *(int *)((longlong)param_2 + 0x24);
                                    while (iVar13 < 1) {
                                      plVar18 = (longlong *)*param_2;
                                      uVar32 = uVar33;
                                      iVar13 = local_118;
                                      uVar29 = local_12c;
                                      uVar39 = local_138;
                                      if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                                      *(uint *)(param_2 + 4) =
                                           (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                                      *(int *)((longlong)param_2 + 0x24) =
                                           *(int *)((longlong)param_2 + 0x24) + 8;
                                      *plVar18 = *plVar18 + 1;
                                      *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                                      *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                                      if (*(int *)(*param_2 + 0xc) == 0) {
                                        piVar26 = (int *)(*param_2 + 0x10);
                                        *piVar26 = *piVar26 + 1;
                                      }
                                      iVar13 = *(int *)((longlong)param_2 + 0x24);
                                    }
                                    iVar13 = *(int *)((longlong)param_2 + 0x24) + -1;
                                    *(int *)((longlong)param_2 + 0x24) = iVar13;
                                    if ((*(uint *)(param_2 + 4) >> ((byte)iVar13 & 0x1f) & 1) == 0)
                                    break;
LAB_14013570d:
                                    uVar35 = (uint)uVar25;
                                    *(undefined4 *)(param_2 + 1) = 0x23;
                                    iVar13 = *(int *)((longlong)param_2 + 0x24);
                                    while (iVar13 < 1) {
                                      plVar18 = (longlong *)*param_2;
                                      uVar32 = uVar33;
                                      iVar13 = local_118;
                                      uVar29 = local_12c;
                                      uVar39 = local_138;
                                      if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                                      *(uint *)(param_2 + 4) =
                                           (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                                      *(int *)((longlong)param_2 + 0x24) =
                                           *(int *)((longlong)param_2 + 0x24) + 8;
                                      *plVar18 = *plVar18 + 1;
                                      *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                                      *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                                      if (*(int *)(*param_2 + 0xc) == 0) {
                                        piVar26 = (int *)(*param_2 + 0x10);
                                        *piVar26 = *piVar26 + 1;
                                      }
                                      iVar13 = *(int *)((longlong)param_2 + 0x24);
                                    }
                                    iVar13 = *(int *)((longlong)param_2 + 0x24) + -1;
                                    *(int *)((longlong)param_2 + 0x24) = iVar13;
                                    if ((*(uint *)(param_2 + 4) >> ((byte)iVar13 & 0x1f) & 1) == 0)
                                    {
                                      uVar10 = uVar10 + 1;
                                      local_128 = uVar10;
                                    }
                                    else {
                                      uVar10 = uVar10 - 1;
                                      local_128 = uVar10;
                                    }
                                  }
                                  uVar36 = (ulonglong)(int)local_10c;
                                  *(char *)((longlong)param_2 +
                                           (longlong)(int)uVar35 + 0xab70 + uVar36 * 0x102) =
                                       (char)uVar10;
                                  uVar25 = (ulonglong)(uVar35 + 1);
                                }
                                uVar36 = (ulonglong)((int)uVar36 + 1);
                              }
                              local_10c = 0;
                              lVar16 = (longlong)(int)local_fc;
                              uVar32 = uVar33;
                              if (0 < (int)local_fc) {
                                puVar28 = (uint *)((longlong)param_2 + 0xfa0c);
                                pbVar31 = (byte *)(param_2 + 0x156e);
                                do {
                                  uVar35 = 0x20;
                                  uVar36 = uVar24 & 0xffffffff;
                                  local_148 = (undefined4)uVar24;
                                  if (0 < (int)local_100) {
                                    uVar25 = (ulonglong)local_100;
                                    pbVar15 = pbVar31;
                                    do {
                                      uVar29 = (uint)*pbVar15;
                                      if ((int)uVar36 < (int)(uint)*pbVar15) {
                                        uVar36 = (ulonglong)uVar29;
                                      }
                                      local_148 = (undefined4)uVar36;
                                      if (uVar29 < uVar35) {
                                        uVar35 = uVar29;
                                      }
                                      pbVar15 = pbVar15 + 1;
                                      uVar25 = uVar25 - 1;
                                    } while (uVar25 != 0);
                                  }
                                  lVar34 = (longlong)(int)uVar33 * 0x408;
                                  local_158 = (longlong)(int)uVar33 * 0x102 + 0xab70 +
                                              (longlong)param_2;
                                  local_140 = local_100;
                                  local_150 = uVar35;
                                  FUN_14013ede0(param_1,lVar34 + 0xb17c + (longlong)param_2,
                                                lVar34 + 0xc9ac + (longlong)param_2,
                                                lVar34 + 0xe1dc + (longlong)param_2);
                                  *puVar28 = uVar35;
                                  local_10c = local_10c + 1;
                                  uVar33 = (ulonglong)local_10c;
                                  puVar28 = puVar28 + 1;
                                  pbVar31 = pbVar31 + 0x102;
                                  lVar16 = lVar16 + -1;
                                  uVar32 = local_d0;
                                  iVar40 = local_c0;
                                } while (lVar16 != 0);
                              }
                              local_d8 = (int)param_2[399] + 1;
                              local_ec = (int)param_2[5] * 100000;
                              uVar38 = (uint)uVar32;
                              memset((void *)((longlong)param_2 + 0x44),0,0x400);
                              local_f8 = 0x100;
                              lVar16 = 0xfff;
                              iVar13 = 0xf;
                              iVar14 = 0x1000;
                              plVar18 = param_2 + 0x3d9;
                              do {
                                iVar6 = 0xf;
                                iVar14 = iVar14 + -0x10;
                                do {
                                  *(char *)((longlong)param_2 + lVar16 + 0xe8c) =
                                       (char)iVar13 * '\x10' + (char)iVar6;
                                  lVar16 = lVar16 + -1;
                                  iVar6 = iVar6 + -1;
                                } while (-1 < iVar6);
                                *(int *)plVar18 = iVar14;
                                plVar18 = (longlong *)((longlong)plVar18 + -4);
                                iVar13 = iVar13 + -1;
                              } while (-1 < iVar13);
                              uVar29 = uVar38;
                              uVar39 = uVar38;
                              if ((int)local_104 < 1) {
                                uVar32 = 0xfffffff4;
                                iVar13 = local_118;
                                uVar35 = 0x100;
                              }
                              else {
                                bVar9 = *(byte *)((longlong)param_2 + 0x1ecc);
                                local_f0 = (uint)bVar9;
                                iVar40 = *(int *)((longlong)param_2 + (ulonglong)bVar9 * 4 + 0xfa0c)
                                ;
                                lVar16 = (ulonglong)bVar9 * 0x408;
                                local_60 = lVar16 + 0xb17c + (longlong)param_2;
                                local_e0 = lVar16 + 0xe1dc + (longlong)param_2;
                                local_c8 = lVar16 + 0xc9ac + (longlong)param_2;
                                local_d4 = 0x31;
                                local_108 = iVar40;
LAB_140135a23:
                                *(undefined4 *)(param_2 + 1) = 0x24;
                                iVar14 = *(int *)((longlong)param_2 + 0x24);
                                while (local_120 = local_60, uVar38 = local_d4, iVar13 = local_118,
                                      iVar14 < iVar40) {
                                  plVar18 = (longlong *)*param_2;
                                  uVar35 = (uint)local_f8;
                                  if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                                  *(uint *)(param_2 + 4) =
                                       (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                                  *(int *)((longlong)param_2 + 0x24) =
                                       *(int *)((longlong)param_2 + 0x24) + 8;
                                  *plVar18 = *plVar18 + 1;
                                  *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                                  *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                                  if (*(int *)(*param_2 + 0xc) == 0) {
                                    piVar26 = (int *)(*param_2 + 0x10);
                                    *piVar26 = *piVar26 + 1;
                                  }
                                  iVar14 = *(int *)((longlong)param_2 + 0x24);
                                }
                                iVar14 = *(int *)((longlong)param_2 + 0x24) - iVar40;
                                local_130 = *(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f) &
                                            (1 << ((byte)iVar40 & 0x1f)) - 1U;
                                *(int *)((longlong)param_2 + 0x24) = iVar14;
                                uVar25 = local_f8;
                                local_138 = uVar39;
                                local_12c = uVar29;
                                while (uVar35 = (uint)uVar25, iVar40 < 0x15) {
                                  if ((int)local_130 <= *(int *)(local_60 + (longlong)iVar40 * 4)) {
                                    iVar14 = *(int *)(local_c8 + (longlong)iVar40 * 4);
                                    iVar6 = local_130 - iVar14;
                                    if ((iVar6 < 0) || (0x101 < iVar6)) {
                                      uVar32 = 0xfffffff2;
                                      goto switchD_1401345b7_default;
                                    }
                                    lVar16 = (longlong)(int)local_130 - (longlong)iVar14;
                                    local_68 = local_e0;
                                    goto LAB_140135d24;
                                  }
                                  iVar40 = iVar40 + 1;
LAB_140135aa9:
                                  *(undefined4 *)(param_2 + 1) = 0x25;
                                  iVar14 = *(int *)((longlong)param_2 + 0x24);
                                  while (iVar14 < 1) {
                                    plVar18 = (longlong *)*param_2;
                                    uVar35 = (uint)uVar25;
                                    if ((int)plVar18[1] == 0) goto switchD_1401345b7_default;
                                    *(uint *)(param_2 + 4) =
                                         (int)param_2[4] << 8 | (uint)*(byte *)*plVar18;
                                    *(int *)((longlong)param_2 + 0x24) =
                                         *(int *)((longlong)param_2 + 0x24) + 8;
                                    *plVar18 = *plVar18 + 1;
                                    *(int *)(*param_2 + 8) = *(int *)(*param_2 + 8) + -1;
                                    *(int *)(*param_2 + 0xc) = *(int *)(*param_2 + 0xc) + 1;
                                    if (*(int *)(*param_2 + 0xc) == 0) {
                                      piVar26 = (int *)(*param_2 + 0x10);
                                      *piVar26 = *piVar26 + 1;
                                    }
                                    iVar14 = *(int *)((longlong)param_2 + 0x24);
                                  }
                                  iVar14 = *(int *)((longlong)param_2 + 0x24) + -1;
                                  local_124 = *(uint *)(param_2 + 4) >> ((byte)iVar14 & 0x1f) & 1;
                                  *(int *)((longlong)param_2 + 0x24) = iVar14;
                                  local_130 = local_130 * 2 | local_124;
                                }
                                uVar32 = 0xfffffff3;
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                  else {
                    uVar32 = 0xffffffeb;
                  }
                }
                else {
                  uVar32 = 0xffffffec;
                }
              }
              else {
                uVar32 = 0xffffffee;
              }
            }
            else {
              uVar32 = 0xffffffef;
            }
          }
          else {
            uVar32 = 0xfffffff0;
          }
        }
        else {
          uVar32 = 0xfffffff1;
        }
      }
    }
    else {
      uVar32 = 0xffffffcc;
    }
  }
  else {
    uVar32 = 0xffffffcd;
  }
switchD_1401345b7_default:
  *(uint *)((longlong)param_2 + 0xfa24) = uVar35;
  *(uint *)(param_2 + 0x1f45) = local_110;
  *(uint *)((longlong)param_2 + 0xfa2c) = local_10c;
  *(uint *)(param_2 + 0x1f46) = local_100;
  *(uint *)((longlong)param_2 + 0xfa34) = local_fc;
  *(uint *)(param_2 + 0x1f47) = local_104;
  *(int *)((longlong)param_2 + 0xfa3c) = local_d8;
  *(uint *)(param_2 + 0x1f48) = uVar29;
  *(uint *)((longlong)param_2 + 0xfa44) = uVar38;
  *(int *)(param_2 + 0x1f49) = local_134;
  *(int *)((longlong)param_2 + 0xfa4c) = local_ec;
  *(uint *)(param_2 + 0x1f4a) = uVar39;
  *(int *)((longlong)param_2 + 0xfa54) = iVar13;
  *(int *)(param_2 + 0x1f4b) = local_e8;
  *(uint *)((longlong)param_2 + 0xfa5c) = local_128;
  *(undefined4 *)(param_2 + 0x1f4c) = local_74;
  *(int *)((longlong)param_2 + 0xfa64) = iVar40;
  *(uint *)(param_2 + 0x1f4d) = local_130;
  *(uint *)((longlong)param_2 + 0xfa6c) = local_124;
  *(uint *)(param_2 + 0x1f4e) = local_f0;
  *(int *)((longlong)param_2 + 0xfa74) = local_108;
  param_2[0x1f4f] = local_120;
  param_2[0x1f50] = local_c8;
  param_2[0x1f51] = local_e0;
  return uVar32 & 0xffffffff;
}



int FUN_140136f40(undefined8 param_1,longlong param_2)

{
  longlong *plVar1;
  int iVar2;
  int iVar3;
  uint uVar4;
  
  if (param_2 == 0) {
    return -2;
  }
  plVar1 = *(longlong **)(param_2 + 0x30);
  if ((plVar1 == (longlong *)0x0) || (*plVar1 != param_2)) {
    return -2;
  }
  iVar3 = (int)plVar1[1];
  iVar2 = iVar3;
  do {
    if (iVar2 == 1) {
      return -1;
    }
    if (iVar3 == 2) {
      if (*(char *)((longlong)plVar1 + 0x2c) == '\0') {
        FUN_140133630(plVar1);
      }
      else {
        FUN_140133b30(param_1,plVar1);
      }
      if ((*(int *)((longlong)plVar1 + 0x444) != (int)plVar1[0x1f4a] + 1) || ((int)plVar1[2] != 0))
      {
        return 0;
      }
      uVar4 = ~*(uint *)(plVar1 + 0x18e);
      *(uint *)(plVar1 + 0x18e) = uVar4;
      if (uVar4 != *(uint *)(plVar1 + 0x18d)) {
        return -10;
      }
      *(undefined4 *)(plVar1 + 1) = 0xe;
      *(uint *)((longlong)plVar1 + 0xc74) =
           (*(int *)((longlong)plVar1 + 0xc74) << 1 | (uint)(*(int *)((longlong)plVar1 + 0xc74) < 0)
           ) ^ uVar4;
LAB_140136ff0:
      iVar2 = FUN_140134310(param_1,plVar1);
      if (iVar2 == 4) {
        iVar2 = 4;
        if (*(int *)((longlong)plVar1 + 0xc74) != *(int *)((longlong)plVar1 + 0xc6c)) {
          iVar2 = -0xb;
        }
        return iVar2;
      }
      iVar3 = (int)plVar1[1];
      if (iVar3 != 2) {
        return iVar2;
      }
    }
    else if (9 < iVar3) goto LAB_140136ff0;
    iVar2 = (int)plVar1[1];
  } while( true );
}



undefined8
FUN_140137080(undefined8 param_1,longlong param_2,int *param_3,longlong param_4,undefined4 param_5)

{
  int iVar1;
  longlong local_58;
  undefined4 local_50;
  undefined4 uStack_4c;
  undefined4 local_48;
  longlong local_40;
  int local_38;
  undefined4 uStack_34;
  undefined4 local_30;
  longlong *local_28;
  
  local_58 = 0;
  local_50 = 0;
  uStack_4c = 0;
  local_48 = 0;
  local_40 = 0;
  local_38 = 0;
  uStack_34 = 0;
  local_30 = 0;
  local_28 = (longlong *)0x0;
  if (((param_2 != 0) && (param_3 != (int *)0x0)) && (param_4 != 0)) {
    local_28 = operator_new(0xfa90);
    if (local_28 != (longlong *)0x0) {
      *local_28 = (longlong)&local_58;
      *(undefined4 *)(local_28 + 1) = 10;
      local_28[4] = 0;
      *(undefined4 *)((longlong)local_28 + 0xc74) = 0;
      uStack_4c = 0;
      local_48 = 0;
      uStack_34 = 0;
      local_30 = 0;
      *(undefined1 *)((longlong)local_28 + 0x2c) = 0;
      local_28[0x18c] = 0;
      local_28[0x18b] = 0;
      local_28[0x18a] = 0;
      local_28[6] = 0;
      local_50 = param_5;
      local_38 = *param_3;
      local_58 = param_4;
      local_40 = param_2;
      iVar1 = FUN_140136f40(param_1,&local_58);
      if (iVar1 != 0) {
        if (iVar1 == 4) {
          *param_3 = *param_3 - local_38;
          FUN_140134280(param_1,&local_58);
          return 1;
        }
        *param_3 = 0;
      }
      FUN_140134280(param_1,&local_58);
    }
  }
  return 0;
}



undefined8 FUN_1401371a0(HCRYPTKEY param_1,undefined8 param_2,undefined1 *param_3,longlong *param_4)

{
  longlong *plVar1;
  BOOL BVar2;
  DWORD DVar3;
  undefined4 uVar4;
  BYTE *pBVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  undefined8 uVar9;
  undefined8 uVar10;
  undefined8 *puVar11;
  char *pcVar12;
  BYTE *pBVar13;
  uint uVar14;
  undefined1 local_res8 [8];
  undefined8 local_res10;
  DWORD local_res18 [2];
  longlong *local_res20;
  undefined1 local_a8 [40];
  undefined8 local_80;
  undefined8 local_78;
  undefined8 local_70;
  BYTE *local_68;
  BYTE *local_60;
  undefined8 local_58;
  undefined8 local_50;
  
  local_50 = 0xfffffffffffffffe;
  *param_3 = 0;
  local_res10 = param_2;
  local_res20 = param_4;
  FUN_1400b8b30();
  if (param_1 == 0) {
    (**(code **)(*param_4 + 0x28))(param_4,"No key");
    uVar6 = 0;
  }
  else {
    local_res18[0] = 0;
    BVar2 = CryptExportKey(param_1,0,7,0,(BYTE *)0x0,local_res18);
    if (BVar2 == 0) {
      DVar3 = GetLastError();
      if (DVar3 == 0x8009000b) {
        (**(code **)(*param_4 + 0x28))
                  (param_4,
                   "(warning) Cannot access private key because when installed, it was not marked as exportable."
                  );
        (**(code **)(*param_4 + 0x28))
                  (param_4,"(optional) Re-install the certificate and private key from a PFX.");
        (**(code **)(*param_4 + 0x28))
                  (param_4,"(optional) Make sure to mark the key as exportable.");
        *param_3 = 1;
        uVar6 = 0;
      }
      else {
        if (DVar3 == 0x57) {
          *param_3 = 1;
          FUN_1400cf640(param_4);
          pcVar12 = "(warning) Cannot export private key blob (10)";
        }
        else {
          FUN_1400cf640(param_4);
          pcVar12 = "Failed to access private key blob (7)";
        }
        (**(code **)(*param_4 + 0x28))(param_4,pcVar12);
        uVar6 = 0;
      }
    }
    else {
      pBVar5 = operator_new((ulonglong)local_res18[0]);
      local_60 = pBVar5;
      BVar2 = CryptExportKey(param_1,0,7,0,pBVar5,local_res18);
      if (BVar2 == 0) {
        FUN_1400cf640(param_4);
        (**(code **)(*param_4 + 0x28))(param_4,"Failed to access private key blob (8)");
        operator_delete(pBVar5);
        uVar6 = 0;
      }
      else {
        pBVar13 = pBVar5 + 0x14;
        local_res8[0] = 0;
        local_58 = FUN_140116100(local_res8,1,0xef0,param_4);
        FUN_1400b8c40(local_a8);
        FUN_1400b97e0(local_a8,pBVar13,*(uint *)(pBVar5 + 0xc) >> 3);
        FUN_1400b8cd0(local_a8);
        uVar4 = FUN_1400b8b80(local_a8);
        uVar6 = FUN_1400b8b90(local_a8);
        local_80 = FUN_140116100(uVar6,uVar4,0xef1,param_4);
        local_78 = FUN_140116100(pBVar5 + 0x10,3,0xef2,param_4);
        uVar14 = *(uint *)(pBVar5 + 0xc) >> 4;
        pBVar13 = pBVar13 + (*(uint *)(pBVar5 + 0xc) >> 3);
        FUN_1400b8b30(local_a8);
        FUN_1400b97e0(local_a8,pBVar13,uVar14);
        FUN_1400b8cd0(local_a8);
        uVar4 = FUN_1400b8b80(local_a8);
        uVar6 = FUN_1400b8b90(local_a8);
        local_70 = FUN_140116100(uVar6,uVar4,0xef6,param_4);
        pBVar13 = pBVar13 + uVar14;
        FUN_1400b8b30(local_a8);
        FUN_1400b97e0(local_a8,pBVar13,uVar14);
        FUN_1400b8cd0(local_a8);
        uVar4 = FUN_1400b8b80(local_a8);
        uVar6 = FUN_1400b8b90(local_a8);
        uVar6 = FUN_140116100(uVar6,uVar4,0xef7,param_4);
        pBVar13 = pBVar13 + uVar14;
        FUN_1400b8b30(local_a8);
        FUN_1400b97e0(local_a8,pBVar13,uVar14);
        FUN_1400b8cd0(local_a8);
        uVar4 = FUN_1400b8b80(local_a8);
        uVar7 = FUN_1400b8b90(local_a8);
        uVar7 = FUN_140116100(uVar7,uVar4,0xef8,param_4);
        pBVar13 = pBVar13 + uVar14;
        FUN_1400b8b30(local_a8);
        FUN_1400b97e0(local_a8,pBVar13,uVar14);
        FUN_1400b8cd0(local_a8);
        uVar4 = FUN_1400b8b80(local_a8);
        uVar8 = FUN_1400b8b90(local_a8);
        uVar8 = FUN_140116100(uVar8,uVar4,0xef9,param_4);
        local_68 = pBVar13 + uVar14;
        FUN_1400b8b30(local_a8);
        FUN_1400b97e0(local_a8,pBVar13 + uVar14,uVar14);
        FUN_1400b8cd0(local_a8);
        uVar4 = FUN_1400b8b80(local_a8);
        uVar9 = FUN_1400b8b90(local_a8);
        uVar9 = FUN_140116100(uVar9,uVar4,0xefa,local_res20);
        pBVar5 = local_68 + uVar14;
        FUN_1400b8b30(local_a8);
        FUN_1400b97e0(local_a8,pBVar5,uVar14 * 2);
        FUN_1400b8cd0(local_a8);
        uVar4 = FUN_1400b8b80(local_a8);
        uVar10 = FUN_1400b8b90(local_a8);
        plVar1 = local_res20;
        uVar10 = FUN_140116100(uVar10,uVar4,0xefb,local_res20);
        operator_delete(local_60);
        puVar11 = (undefined8 *)FUN_140116780();
        FUN_140114c20(puVar11,local_58);
        FUN_140114c20(puVar11,local_80);
        FUN_140114c20(puVar11,local_78);
        FUN_140114c20(puVar11,uVar10);
        FUN_140114c20(puVar11,local_70);
        FUN_140114c20(puVar11,uVar6);
        FUN_140114c20(puVar11,uVar7);
        FUN_140114c20(puVar11,uVar8);
        FUN_140114c20(puVar11,uVar9);
        FUN_140115620(puVar11,local_res10,0,0,plVar1);
        if (puVar11 != (undefined8 *)0x0) {
          (**(code **)*puVar11)(puVar11,1);
        }
        FUN_1400b92d0(local_a8);
        uVar6 = 1;
      }
    }
  }
  return uVar6;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

ulonglong FUN_140137650(void)

{
  uint uVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  longlong lVar4;
  undefined4 *puVar5;
  undefined1 auStack_4f8 [32];
  undefined *local_4d8;
  undefined *local_4d0;
  longlong *local_4c8;
  undefined4 *local_4c0;
  undefined4 local_4b8;
  undefined4 local_4b4;
  longlong local_4b0;
  undefined8 local_4a8 [2];
  undefined8 local_498 [72];
  undefined8 local_258 [56];
  undefined4 local_98 [24];
  undefined8 local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined8 local_20;
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_4f8;
  if (DAT_1403183c0 != 0) {
    return 0;
  }
  lVar4 = 9;
  puVar2 = local_498;
  do {
    *puVar2 = 0x800000008;
    puVar2[1] = 0x800000008;
    puVar2[2] = 0x800000008;
    lVar4 = lVar4 + -1;
    puVar2[3] = 0x800000008;
    puVar2[4] = 0x800000008;
    puVar2[5] = 0x800000008;
    puVar2[6] = 0x800000008;
    puVar2[7] = 0x800000008;
    puVar2 = puVar2 + 8;
  } while (lVar4 != 0);
  lVar4 = 7;
  puVar2 = local_258;
  do {
    *puVar2 = 0x900000009;
    puVar2[1] = 0x900000009;
    puVar2[2] = 0x900000009;
    lVar4 = lVar4 + -1;
    puVar2[3] = 0x900000009;
    puVar2[4] = 0x900000009;
    puVar2[5] = 0x900000009;
    puVar2[6] = 0x900000009;
    puVar2[7] = 0x900000009;
    puVar2 = puVar2 + 8;
  } while (lVar4 != 0);
  local_4b8 = 7;
  puVar5 = local_98;
  for (lVar4 = 0x18; lVar4 != 0; lVar4 = lVar4 + -1) {
    *puVar5 = 7;
    puVar5 = puVar5 + 1;
  }
  local_4c0 = &local_4b8;
  local_38 = 0x800000008;
  local_4c8 = &local_4b0;
  local_30 = 0x800000008;
  local_28 = 0x800000008;
  local_4d0 = &DAT_14024bf30;
  local_20 = 0x800000008;
  local_4d8 = &DAT_14024bef0;
  uVar3 = FUN_14013ef90(99000,local_498,0x120);
  if ((int)uVar3 == 0) {
    local_4b4 = 5;
    puVar2 = local_498;
    for (lVar4 = 0x1e; lVar4 != 0; lVar4 = lVar4 + -1) {
      *(undefined4 *)puVar2 = 5;
      puVar2 = (undefined8 *)((longlong)puVar2 + 4);
    }
    local_4c0 = &local_4b4;
    local_4c8 = local_4a8;
    local_4d0 = &DAT_14024bfb0;
    local_4d8 = &DAT_14024bf70;
    uVar1 = FUN_14013ef90(0x182b9,local_498,0x1e);
    uVar3 = (ulonglong)uVar1;
    if ((int)uVar1 < 2) {
      DAT_1403183c0 = local_4b0;
      _DAT_1403183c8 = local_4a8[0];
      DAT_1403183d0 = local_4b8;
      DAT_1403183d4 = local_4b4;
      uVar3 = 0;
    }
    else {
      FUN_14013ef50(local_4b0);
    }
  }
  return uVar3;
}



undefined8 * FUN_140137860(undefined8 *param_1)

{
  *param_1 = InflateState2::vftable;
  FUN_14013f4c0(param_1 + 0x10bb);
  *(undefined1 *)((longlong)param_1 + 0x862c) = 0;
  *(undefined1 *)(param_1 + 0x1010) = 0;
  *(undefined4 *)(param_1 + 0x10c5) = 0x8000;
  *(undefined8 *)((longlong)param_1 + 0x8054) = 0;
  param_1[6] = 0;
  param_1[0x1009] = 0;
  *(undefined4 *)((longlong)param_1 + 0xc) = 0;
  memset(param_1 + 8,0,0x8004);
  *(undefined8 *)((longlong)param_1 + 0x805c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x8064) = 0;
  *(undefined4 *)((longlong)param_1 + 0x806c) = 0;
  param_1[0x100e] = 0;
  param_1[0x100f] = 0;
  *(undefined8 *)((longlong)param_1 + 0x8084) = 0;
  *(undefined8 *)((longlong)param_1 + 0x808c) = 0;
  *(undefined4 *)((longlong)param_1 + 0x8094) = 0;
  param_1[0x10b3] = 0;
  param_1[0x10b4] = 0;
  param_1[0x10b5] = 0;
  param_1[0x10b6] = 0;
  param_1[0x10b7] = 0;
  param_1[0x10b8] = 0;
  param_1[0x10b9] = 0;
  *(undefined4 *)(param_1 + 0x10ba) = 0;
  memset(param_1 + 0x1013,0,0x500);
  if (DAT_1403183c0 == 0) {
    FUN_140137650();
  }
  param_1[7] = 0;
  *(undefined4 *)(param_1 + 1) = 0xffffffff;
  *(undefined4 *)(param_1 + 2) = 0;
  *(undefined4 *)(param_1 + 0x100a) = 0xabcdabcd;
  param_1[3] = 0;
  param_1[4] = 0;
  *(undefined4 *)(param_1 + 5) = 0;
  return param_1;
}



void FUN_1401379a0(undefined8 *param_1)

{
  *param_1 = InflateState2::vftable;
  param_1[0x10b6] = 0;
  FUN_14013ef50(param_1[0x100e]);
  param_1[0x100e] = 0;
  if (*(char *)(param_1 + 0x1010) == '\0') {
    FUN_14013ef50(param_1[0x100f]);
  }
  param_1[0x100f] = 0;
  *(undefined1 *)(param_1 + 0x1010) = 0;
  FUN_14013f810(param_1 + 0x10bb);
  return;
}



undefined8 FUN_140137a20(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 8) = 0xffffffff;
  *(undefined4 *)(param_1 + 0x28) = 0;
  *(undefined8 *)(param_1 + 0x8048) = 0;
  FUN_14013f6e0(param_1 + 0x85d8);
  *(undefined4 *)(param_1 + 0x8628) = param_2;
  return 1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8
FUN_140137a70(longlong param_1,longlong param_2,int param_3,char param_4,undefined8 param_5,
             undefined1 *param_6,undefined8 param_7,undefined4 *param_8,int param_9)

{
  longlong *plVar1;
  void *_Dst;
  int *piVar2;
  ushort uVar3;
  uint uVar4;
  undefined4 *puVar5;
  char cVar6;
  undefined4 uVar7;
  int iVar8;
  int iVar9;
  longlong lVar10;
  byte bVar11;
  uint uVar12;
  byte *pbVar13;
  char *pcVar14;
  uint uVar15;
  uint uVar16;
  
  puVar5 = param_8;
  *param_8 = 0;
  *param_6 = 0;
  uVar16 = *(int *)(param_1 + 0x8628) - 1;
  if ((param_4 == '\0') && ((param_2 == 0 || (param_3 == 0)))) {
    *param_8 = 1000;
    return 1;
  }
  FUN_14013fbd0(param_1 + 0x85d8);
  *(undefined1 *)(param_1 + 0x862c) = 0;
  iVar9 = param_9;
  do {
    if ((*(int *)(param_1 + 8) == -1) && (*(int *)(param_1 + 0x10) != 0)) {
      *param_6 = 1;
      break;
    }
    if (((param_4 == '\0') && (iVar9 != 0)) &&
       (cVar6 = FUN_14013f640(param_1 + 0x85d8,iVar9), cVar6 == '\0')) {
      *puVar5 = 0x3e9;
      return 1;
    }
    iVar8 = *(int *)(param_1 + 8);
    *(int *)(param_1 + 0x85c4) = iVar8;
    if (iVar8 == -1) {
      if (*(uint **)(param_1 + 0x8618) == (uint *)0x0) {
        *puVar5 = 0x13ac;
        return 1;
      }
      *(uint *)(param_1 + 0x85c8) =
           **(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f) & 1;
      cVar6 = FUN_14013f8b0(param_1 + 0x85d8,1);
      if (cVar6 == '\0') {
        if (iVar9 != 0) {
          *puVar5 = 1;
          return 0;
        }
        uVar15 = *(uint *)(param_1 + 0x38);
        uVar12 = *(uint *)(param_1 + 0x3c);
        if ((uVar12 < uVar15) || (*(uint *)(param_1 + 0x8628) <= uVar15)) {
          iVar9 = FUN_140104440(param_5,(ulonglong)uVar12 + 0x40 + param_1,uVar15 - uVar12,1,param_7
                               );
          if (iVar9 != 1) goto LAB_140138e2d;
          *(uint *)(param_1 + 0x38) = *(uint *)(param_1 + 0x38) & uVar16;
          *(undefined4 *)(param_1 + 0x3c) = *(undefined4 *)(param_1 + 0x38);
        }
        *puVar5 = 0x7d8;
        return 1;
      }
      *(uint *)(param_1 + 0x85cc) =
           **(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f) & 3;
      cVar6 = FUN_14013f8b0(param_1 + 0x85d8,2);
      if (cVar6 == '\0') {
        *puVar5 = 2;
        return 0;
      }
      if (2 < *(uint *)(param_1 + 0x85cc)) {
        *puVar5 = 3;
        return 0;
      }
      *(uint *)(param_1 + 8) = *(uint *)(param_1 + 0x85cc);
      *(undefined4 *)(param_1 + 0x10) = *(undefined4 *)(param_1 + 0x85c8);
    }
    else if (iVar8 == 0) {
      uVar15 = 8 - (*(uint *)(param_1 + 0x8620) & 7);
      *(uint *)(param_1 + 0x8054) = uVar15;
      if ((uVar15 < 8) && (cVar6 = FUN_14013f8b0(param_1 + 0x85d8), cVar6 == '\0')) {
        *puVar5 = 4;
        return 0;
      }
      *(uint *)(param_1 + 0x8054) =
           **(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f) &
           0xffff;
      cVar6 = FUN_14013f8b0(param_1 + 0x85d8,0x10);
      if (cVar6 == '\0') {
        *puVar5 = 5;
        return 0;
      }
      uVar15 = **(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f);
      *(uint *)(param_1 + 0x8058) = uVar15;
      if (*(uint *)(param_1 + 0x8054) != (~uVar15 & 0xffff)) {
        *puVar5 = 6;
        return 0;
      }
      cVar6 = FUN_14013f8b0(param_1 + 0x85d8,0x10);
      if (cVar6 == '\0') {
        *puVar5 = 7;
        return 0;
      }
      *(int *)(param_1 + 0xc) = *(int *)(param_1 + 0x8054);
      if (*(int *)(param_1 + 0x8054) == 0) {
        *(undefined4 *)(param_1 + 8) = 0xffffffff;
      }
      else {
        *(int *)(param_1 + 8) = *(int *)(param_1 + 8) + 10;
      }
    }
    else if (iVar8 == 1) {
      *(undefined4 *)(param_1 + 8) = 0xb;
    }
    else if (iVar8 == 2) {
      plVar1 = (longlong *)(param_1 + 0x8070);
      *plVar1 = 0;
      *(uint *)(param_1 + 0x8090) =
           (**(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f) & 0x1f
           ) + 0x101;
      cVar6 = FUN_14013f8b0(param_1 + 0x85d8,5);
      if (cVar6 == '\0') {
        *puVar5 = 8;
        return 0;
      }
      *(uint *)(param_1 + 0x8094) =
           (**(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f) & 0x1f
           ) + 1;
      cVar6 = FUN_14013f8b0(param_1 + 0x85d8,5);
      if (cVar6 == '\0') {
        *puVar5 = 9;
        return 0;
      }
      *(uint *)(param_1 + 0x808c) =
           (**(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f) & 0xf)
           + 4;
      cVar6 = FUN_14013f8b0(param_1 + 0x85d8);
      if (cVar6 == '\0') {
        *puVar5 = 10;
        return 0;
      }
      if ((0x120 < *(uint *)(param_1 + 0x8090)) || (0x20 < *(uint *)(param_1 + 0x8094))) {
        *puVar5 = 0xb;
        return 0;
      }
      _Dst = (void *)(param_1 + 0x8098);
      memset(_Dst,0,0x4c);
      *(undefined4 *)(param_1 + 0x8060) = 0;
      if (*(int *)(param_1 + 0x808c) != 0) {
        do {
          *(uint *)(param_1 + 0x8098 +
                   (ulonglong)*(uint *)(&DAT_14024bea0 + (ulonglong)*(uint *)(param_1 + 0x8060) * 4)
                   * 4) =
               **(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f) & 7
          ;
          cVar6 = FUN_14013f8b0(param_1 + 0x85d8,3);
          if (cVar6 == '\0') {
            *puVar5 = 0xc;
            return 0;
          }
          *(int *)(param_1 + 0x8060) = *(int *)(param_1 + 0x8060) + 1;
        } while (*(uint *)(param_1 + 0x8060) < *(uint *)(param_1 + 0x808c));
      }
      piVar2 = (int *)(param_1 + 0x8084);
      *piVar2 = 7;
      iVar9 = FUN_14013ef90(0x182c0,_Dst,0x13,0x13,0,0,plVar1,piVar2);
      *(int *)(param_1 + 0x805c) = iVar9;
      if (iVar9 != 0) {
        if (iVar9 == 1) {
          FUN_14013ef50(*(undefined8 *)(param_1 + 0x8070));
          *(undefined8 *)(param_1 + 0x8070) = 0;
        }
        *puVar5 = 0xd;
        return 0;
      }
      if (DAT_1403183e8 != '\0') {
        *(undefined1 *)(param_1 + 0x862c) = 1;
        *puVar5 = 0xe;
        return 0;
      }
      iVar9 = *(int *)(param_1 + 0x8094) + *(int *)(param_1 + 0x8090);
      *(int *)(param_1 + 0x806c) = iVar9;
      *(uint *)(param_1 + 0x8068) = (uint)*(ushort *)(&DAT_14024bff0 + (longlong)*piVar2 * 2);
      *(undefined4 *)(param_1 + 0x8064) = 0;
      *(undefined4 *)(param_1 + 0x805c) = 0;
      if (iVar9 != 0) {
        do {
          uVar15 = **(uint **)(param_1 + 0x8618);
          *(undefined1 *)(param_1 + 0x8080) = 1;
          uVar15 = uVar15 >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f) &
                   *(uint *)(param_1 + 0x8068);
          *(uint *)(param_1 + 0x85d0) = uVar15;
          lVar10 = (ulonglong)uVar15 * 0x10 + *plVar1;
          *(longlong *)(param_1 + 0x8078) = lVar10;
          *(uint *)(param_1 + 0x8060) = (uint)*(byte *)(lVar10 + 1);
          cVar6 = FUN_14013f8b0(param_1 + 0x85d8);
          if (cVar6 == '\0') {
            *puVar5 = 0xf;
            return 0;
          }
          uVar3 = *(ushort *)(*(longlong *)(param_1 + 0x8078) + 8);
          uVar15 = (uint)uVar3;
          *(uint *)(param_1 + 0x8598) = uVar15;
          uVar12 = (uint)uVar3;
          if (uVar15 < 0x10) {
            *(uint *)(param_1 + 0x8064) = uVar12;
            *(uint *)(param_1 + 0x8098 + (longlong)*(int *)(param_1 + 0x805c) * 4) = uVar12;
            *(int *)(param_1 + 0x805c) = *(int *)(param_1 + 0x805c) + 1;
          }
          else {
            uVar4 = **(uint **)(param_1 + 0x8618);
            if (uVar15 == 0x10) {
              *(uint *)(param_1 + 0x859c) =
                   (uVar4 >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f) & 3) + 3;
              cVar6 = FUN_14013f8b0(param_1 + 0x85d8,2);
              if (cVar6 == '\0') {
                *puVar5 = 0x10;
                return 0;
              }
              iVar9 = *(int *)(param_1 + 0x859c);
              if (*(uint *)(param_1 + 0x806c) < (uint)(iVar9 + *(int *)(param_1 + 0x805c))) {
                *puVar5 = 0x11;
                return 0;
              }
              while (iVar9 != 0) {
                *(int *)(param_1 + 0x859c) = *(int *)(param_1 + 0x859c) + -1;
                *(undefined4 *)(param_1 + 0x8098 + (longlong)*(int *)(param_1 + 0x805c) * 4) =
                     *(undefined4 *)(param_1 + 0x8064);
                *(int *)(param_1 + 0x805c) = *(int *)(param_1 + 0x805c) + 1;
                iVar9 = *(int *)(param_1 + 0x859c);
              }
              *(int *)(param_1 + 0x859c) = *(int *)(param_1 + 0x859c) + -1;
            }
            else {
              bVar11 = (byte)*(undefined4 *)(param_1 + 0x8620);
              if (uVar12 == 0x11) {
                *(uint *)(param_1 + 0x85a0) = (uVar4 >> (bVar11 & 0x1f) & 7) + 3;
                cVar6 = FUN_14013f8b0(param_1 + 0x85d8,3);
                if (cVar6 == '\0') {
                  *puVar5 = 0x12;
                  return 0;
                }
                iVar9 = *(int *)(param_1 + 0x85a0);
                if (*(uint *)(param_1 + 0x806c) < (uint)(iVar9 + *(int *)(param_1 + 0x805c))) {
                  *puVar5 = 0x13;
                  return 0;
                }
                while (iVar9 != 0) {
                  *(int *)(param_1 + 0x85a0) = *(int *)(param_1 + 0x85a0) + -1;
                  *(undefined4 *)(param_1 + 0x8098 + (longlong)*(int *)(param_1 + 0x805c) * 4) = 0;
                  *(int *)(param_1 + 0x805c) = *(int *)(param_1 + 0x805c) + 1;
                  iVar9 = *(int *)(param_1 + 0x85a0);
                }
              }
              else {
                *(uint *)(param_1 + 0x85a0) = (uVar4 >> (bVar11 & 0x1f) & 0x7f) + 0xb;
                cVar6 = FUN_14013f8b0(param_1 + 0x85d8,7);
                if (cVar6 == '\0') {
                  *puVar5 = 0x14;
                  return 0;
                }
                iVar9 = *(int *)(param_1 + 0x85a0);
                if (*(uint *)(param_1 + 0x806c) < (uint)(iVar9 + *(int *)(param_1 + 0x805c))) {
                  *puVar5 = 0x15;
                  return 0;
                }
                while (iVar9 != 0) {
                  *(int *)(param_1 + 0x85a0) = *(int *)(param_1 + 0x85a0) + -1;
                  *(undefined4 *)(param_1 + 0x8098 + (longlong)*(int *)(param_1 + 0x805c) * 4) = 0;
                  *(int *)(param_1 + 0x805c) = *(int *)(param_1 + 0x805c) + 1;
                  iVar9 = *(int *)(param_1 + 0x85a0);
                }
              }
              *(int *)(param_1 + 0x85a0) = *(int *)(param_1 + 0x85a0) + -1;
              *(undefined4 *)(param_1 + 0x8064) = 0;
            }
          }
        } while (*(uint *)(param_1 + 0x805c) < *(uint *)(param_1 + 0x806c));
      }
      FUN_14013ef50(*plVar1);
      *plVar1 = 0;
      *piVar2 = 9;
      iVar9 = FUN_14013ef90(0x182c1,_Dst,*(undefined4 *)(param_1 + 0x8090),0x101,&DAT_14024bef0,
                            &DAT_14024bf30,plVar1,piVar2);
      *(int *)(param_1 + 0x805c) = iVar9;
      if (iVar9 != 0) {
        if (iVar9 == 1) {
          FUN_14013ef50(*(undefined8 *)(param_1 + 0x8070));
          *(undefined8 *)(param_1 + 0x8070) = 0;
        }
        *puVar5 = 0x16;
        return 0;
      }
      *(undefined4 *)(param_1 + 0x8088) = 6;
      uVar7 = FUN_14013ef90(0x182c2,param_1 + 0x8098 + (ulonglong)*(uint *)(param_1 + 0x8090) * 4,
                            *(undefined4 *)(param_1 + 0x8094),0,&DAT_14024bf70,&DAT_14024bfb0,
                            param_1 + 0x8078,(undefined4 *)(param_1 + 0x8088));
      *(int *)(param_1 + 8) = *(int *)(param_1 + 8) + 10;
      *(undefined4 *)(param_1 + 0x805c) = uVar7;
      *(undefined1 *)(param_1 + 0x8080) = 0;
      iVar9 = param_9;
    }
    else if (iVar8 == 10) {
      if (0xfff < *(uint *)(param_1 + 0xc)) {
        param_8._0_4_ = 0;
        cVar6 = FUN_14013f5a0(param_1 + 0x85d8,*(uint *)(param_1 + 0xc),&param_8);
        if (cVar6 == '\0') {
          *puVar5 = 0x3ea;
          return 1;
        }
      }
      iVar8 = *(int *)(param_1 + 0xc);
      while (iVar8 != 0) {
        *(char *)((ulonglong)*(uint *)(param_1 + 0x38) + 0x40 + param_1) =
             (char)(**(uint **)(param_1 + 0x8618) >>
                   ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f));
        *(int *)(param_1 + 0x38) = *(int *)(param_1 + 0x38) + 1;
        cVar6 = FUN_14013f8b0(param_1 + 0x85d8,8);
        if (cVar6 == '\0') {
          *puVar5 = 0x17;
          return 0;
        }
        if (*(uint *)(param_1 + 0x8628) <= *(uint *)(param_1 + 0x38)) {
          iVar8 = FUN_140104440(param_5,(ulonglong)*(uint *)(param_1 + 0x3c) + 0x40 + param_1,
                                *(uint *)(param_1 + 0x38) - *(uint *)(param_1 + 0x3c),1,param_7);
          if (iVar8 != 1) {
            *puVar5 = 0x18;
            return 0;
          }
          *(uint *)(param_1 + 0x38) = *(uint *)(param_1 + 0x38) & uVar16;
          *(undefined4 *)(param_1 + 0x3c) = *(undefined4 *)(param_1 + 0x38);
        }
        *(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + -1;
        iVar8 = *(int *)(param_1 + 0xc);
      }
LAB_14013829b:
      *(undefined4 *)(param_1 + 8) = 0xffffffff;
    }
    else if (iVar8 == 0xb) {
      *(uint *)(param_1 + 0x85b8) = (uint)*(ushort *)(&DAT_14024bff0 + (longlong)DAT_1403183d0 * 2);
      uVar3 = *(ushort *)(&DAT_14024bff0 + (longlong)DAT_1403183d4 * 2);
      *(undefined4 *)(param_1 + 8) = 0x6e;
      *(uint *)(param_1 + 0x85bc) = (uint)uVar3;
    }
    else if (iVar8 == 0x6e) {
      bVar11 = (byte)*(undefined4 *)(param_1 + 0x8620);
      uVar15 = **(uint **)(param_1 + 0x8618) >> (bVar11 & 0x1f) & *(uint *)(param_1 + 0x85b8);
      *(uint *)(param_1 + 0x85c0) = uVar15;
      pcVar14 = (char *)(DAT_1403183c0 + (ulonglong)uVar15 * 0x10);
      *(char **)(param_1 + 0x85b0) = pcVar14;
      if (*pcVar14 == '\x10') {
        cVar6 = FUN_14013f8b0(param_1 + 0x85d8,pcVar14[1]);
        if (cVar6 == '\0') {
          *puVar5 = 0x19;
          return 0;
        }
        *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x38) + 0x40 + param_1) =
             *(undefined1 *)(*(longlong *)(param_1 + 0x85b0) + 8);
        *(int *)(param_1 + 0x38) = *(int *)(param_1 + 0x38) + 1;
        if (*(int *)(param_1 + 0x38) == *(int *)(param_1 + 0x8628)) {
          iVar8 = FUN_140104440(param_5,(ulonglong)*(uint *)(param_1 + 0x3c) + 0x40 + param_1,
                                *(int *)(param_1 + 0x38) - *(uint *)(param_1 + 0x3c),1,param_7);
          if (iVar8 != 1) {
            *puVar5 = 0x1a;
            return 0;
          }
          *(undefined8 *)(param_1 + 0x38) = 0;
        }
      }
      else {
        uVar15 = **(uint **)(param_1 + 0x8618) >> (bVar11 & 0x1f) & *(uint *)(param_1 + 0x85b8);
        *(uint *)(param_1 + 0x85c0) = uVar15;
        pbVar13 = (byte *)((ulonglong)uVar15 * 0x10 + DAT_1403183c0);
        *(byte **)(param_1 + 0x85b0) = pbVar13;
        uVar15 = (uint)*pbVar13;
        *(uint *)(param_1 + 0x85a4) = uVar15;
        while (0x10 < uVar15) {
          if (*(int *)(param_1 + 0x85a4) == 99) {
            *puVar5 = 0x1b;
            return 0;
          }
          cVar6 = FUN_14013f8b0(param_1 + 0x85d8,
                                *(undefined1 *)(*(longlong *)(param_1 + 0x85b0) + 1));
          if (cVar6 == '\0') {
            *puVar5 = 0x1c;
            return 0;
          }
          *(int *)(param_1 + 0x85a4) = *(int *)(param_1 + 0x85a4) + -0x10;
          uVar15 = **(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f)
                   & (uint)*(ushort *)(&DAT_14024bff0 + (ulonglong)*(uint *)(param_1 + 0x85a4) * 2);
          *(uint *)(param_1 + 0x85c0) = uVar15;
          pbVar13 = (byte *)(*(longlong *)(*(longlong *)(param_1 + 0x85b0) + 8) +
                            (ulonglong)uVar15 * 0x10);
          *(byte **)(param_1 + 0x85b0) = pbVar13;
          uVar15 = (uint)*pbVar13;
          *(uint *)(param_1 + 0x85a4) = uVar15;
        }
        cVar6 = FUN_14013f8b0(param_1 + 0x85d8,*(undefined1 *)(*(longlong *)(param_1 + 0x85b0) + 1))
        ;
        if (cVar6 == '\0') {
          *puVar5 = 0x1d;
          return 0;
        }
        uVar15 = *(uint *)(param_1 + 0x85a4);
        if (uVar15 == 0x10) {
          *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x38) + 0x40 + param_1) =
               *(undefined1 *)(*(longlong *)(param_1 + 0x85b0) + 8);
          *(int *)(param_1 + 0x38) = *(int *)(param_1 + 0x38) + 1;
          if (*(int *)(param_1 + 0x38) == *(int *)(param_1 + 0x8628)) {
            iVar8 = FUN_140104440(param_5,(ulonglong)*(uint *)(param_1 + 0x3c) + 0x40 + param_1,
                                  *(int *)(param_1 + 0x38) - *(uint *)(param_1 + 0x3c),1,param_7);
            if (iVar8 != 1) {
              *puVar5 = 0x1e;
              return 0;
            }
            *(undefined8 *)(param_1 + 0x38) = 0;
          }
        }
        else {
          if (uVar15 == 0xf) goto LAB_14013829b;
          if (uVar15 == 0) {
            *(uint *)(param_1 + 0x85a8) = (uint)*(ushort *)(*(longlong *)(param_1 + 0x85b0) + 8);
          }
          else {
            *(uint *)(param_1 + 0x85a8) =
                 ((uint)*(ushort *)(&DAT_14024bff0 + (ulonglong)uVar15 * 2) &
                 **(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f))
                 + (uint)*(ushort *)(*(longlong *)(param_1 + 0x85b0) + 8);
            cVar6 = FUN_14013f8b0(param_1 + 0x85d8,*(undefined4 *)(param_1 + 0x85a4));
            if (cVar6 == '\0') {
              *puVar5 = 0x1f;
              return 0;
            }
          }
          uVar15 = **(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f)
                   & *(uint *)(param_1 + 0x85bc);
          *(uint *)(param_1 + 0x85c0) = uVar15;
          pbVar13 = (byte *)((ulonglong)uVar15 * 0x10 + _DAT_1403183c8);
          *(byte **)(param_1 + 0x85b0) = pbVar13;
          uVar15 = (uint)*pbVar13;
          *(uint *)(param_1 + 0x85a4) = uVar15;
          while (0x10 < uVar15) {
            if (*(int *)(param_1 + 0x85a4) == 99) {
              *puVar5 = 0x20;
              return 0;
            }
            cVar6 = FUN_14013f8b0(param_1 + 0x85d8,
                                  *(undefined1 *)(*(longlong *)(param_1 + 0x85b0) + 1));
            if (cVar6 == '\0') {
              *puVar5 = 0x25;
              return 0;
            }
            *(int *)(param_1 + 0x85a4) = *(int *)(param_1 + 0x85a4) + -0x10;
            uVar15 = **(uint **)(param_1 + 0x8618) >>
                     ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f) &
                     (uint)*(ushort *)(&DAT_14024bff0 + (ulonglong)*(uint *)(param_1 + 0x85a4) * 2);
            *(uint *)(param_1 + 0x85c0) = uVar15;
            pbVar13 = (byte *)(*(longlong *)(*(longlong *)(param_1 + 0x85b0) + 8) +
                              (ulonglong)uVar15 * 0x10);
            *(byte **)(param_1 + 0x85b0) = pbVar13;
            uVar15 = (uint)*pbVar13;
            *(uint *)(param_1 + 0x85a4) = uVar15;
          }
          cVar6 = FUN_14013f8b0(param_1 + 0x85d8,
                                *(undefined1 *)(*(longlong *)(param_1 + 0x85b0) + 1));
          if (cVar6 == '\0') {
            *puVar5 = 0x21;
            return 0;
          }
          uVar15 = (uint)*(ushort *)(&DAT_14024bff0 + (ulonglong)*(uint *)(param_1 + 0x85a4) * 2) &
                   **(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f)
          ;
          *(uint *)(param_1 + 0x85c0) = uVar15;
          *(uint *)(param_1 + 0x85ac) =
               (*(int *)(param_1 + 0x38) - (uint)*(ushort *)(*(longlong *)(param_1 + 0x85b0) + 8)) -
               uVar15;
          cVar6 = FUN_14013f8b0(param_1 + 0x85d8,*(undefined4 *)(param_1 + 0x85a4));
          if (cVar6 == '\0') {
            *puVar5 = 0x22;
            return 0;
          }
          do {
            *(uint *)(param_1 + 0x85ac) = *(uint *)(param_1 + 0x85ac) & uVar16;
            uVar15 = *(uint *)(param_1 + 0x38);
            if (*(uint *)(param_1 + 0x38) < *(uint *)(param_1 + 0x85ac)) {
              uVar15 = *(uint *)(param_1 + 0x85ac);
            }
            uVar12 = *(uint *)(param_1 + 0x85a8);
            uVar15 = *(int *)(param_1 + 0x8628) - uVar15;
            if (uVar12 < uVar15) {
              uVar15 = uVar12;
            }
            *(uint *)(param_1 + 0x85a4) = uVar15;
            *(uint *)(param_1 + 0x85a8) = uVar12 - uVar15;
            do {
              *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x38) + 0x40 + param_1) =
                   *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x85ac) + 0x40 + param_1);
              *(int *)(param_1 + 0x38) = *(int *)(param_1 + 0x38) + 1;
              *(int *)(param_1 + 0x85ac) = *(int *)(param_1 + 0x85ac) + 1;
              piVar2 = (int *)(param_1 + 0x85a4);
              *piVar2 = *piVar2 + -1;
            } while (*piVar2 != 0);
            if (*(uint *)(param_1 + 0x8628) <= *(uint *)(param_1 + 0x38)) {
              iVar8 = FUN_140104440(param_5,(ulonglong)*(uint *)(param_1 + 0x3c) + 0x40 + param_1,
                                    *(uint *)(param_1 + 0x38) - *(uint *)(param_1 + 0x3c),1,param_7)
              ;
              if (iVar8 != 1) {
                *puVar5 = 0x23;
                return 0;
              }
              *(uint *)(param_1 + 0x38) = *(uint *)(param_1 + 0x38) & uVar16;
              *(undefined4 *)(param_1 + 0x3c) = *(undefined4 *)(param_1 + 0x38);
            }
          } while (*(int *)(param_1 + 0x85a8) != 0);
        }
      }
    }
    else if (iVar8 == 0xc) {
      *(uint *)(param_1 + 0x85b8) =
           (uint)*(ushort *)(&DAT_14024bff0 + (longlong)*(int *)(param_1 + 0x8084) * 2);
      uVar3 = *(ushort *)(&DAT_14024bff0 + (longlong)*(int *)(param_1 + 0x8088) * 2);
      *(undefined4 *)(param_1 + 8) = 0x78;
      *(uint *)(param_1 + 0x85bc) = (uint)uVar3;
    }
    else if (iVar8 == 0x79) {
      cVar6 = FUN_14013f8b0(param_1 + 0x85d8,*(undefined1 *)(*(longlong *)(param_1 + 0x85b0) + 1));
      if (cVar6 == '\0') {
        *puVar5 = 0x26;
        return 0;
      }
      *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x38) + 0x40 + param_1) =
           *(undefined1 *)(*(longlong *)(param_1 + 0x85b0) + 8);
      *(int *)(param_1 + 0x38) = *(int *)(param_1 + 0x38) + 1;
      if (*(int *)(param_1 + 0x38) == *(int *)(param_1 + 0x8628)) {
        iVar8 = FUN_140104440(param_5,(ulonglong)*(uint *)(param_1 + 0x3c) + 0x40 + param_1,
                              *(int *)(param_1 + 0x38) - *(uint *)(param_1 + 0x3c),1,param_7);
        if (iVar8 != 1) {
          *puVar5 = 0x27;
          return 0;
        }
        *(undefined8 *)(param_1 + 0x38) = 0;
      }
LAB_140138893:
      *(undefined4 *)(param_1 + 8) = 0x78;
    }
    else if (iVar8 == 0x7b) {
      if (*(int *)(param_1 + 0x85a4) == 99) {
        *puVar5 = 0x28;
        return 0;
      }
      cVar6 = FUN_14013f8b0(param_1 + 0x85d8,*(undefined1 *)(*(longlong *)(param_1 + 0x85b0) + 1));
      if (cVar6 == '\0') {
        *puVar5 = 0x29;
        return 0;
      }
      *(int *)(param_1 + 0x85a4) = *(int *)(param_1 + 0x85a4) + -0x10;
      uVar15 = (uint)*(ushort *)(&DAT_14024bff0 + (ulonglong)*(uint *)(param_1 + 0x85a4) * 2) &
               **(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f);
      *(uint *)(param_1 + 0x85c0) = uVar15;
      pbVar13 = (byte *)(*(longlong *)(*(longlong *)(param_1 + 0x85b0) + 8) +
                        (ulonglong)uVar15 * 0x10);
      *(byte **)(param_1 + 0x85b0) = pbVar13;
      uVar15 = (uint)*pbVar13;
      *(uint *)(param_1 + 0x85a4) = uVar15;
      if (uVar15 < 0x11) {
        *(undefined4 *)(param_1 + 8) = 0x7c;
      }
    }
    else if (iVar8 == 0x7d) {
      *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x38) + 0x40 + param_1) =
           *(undefined1 *)(*(longlong *)(param_1 + 0x85b0) + 8);
      *(int *)(param_1 + 0x38) = *(int *)(param_1 + 0x38) + 1;
      if (*(int *)(param_1 + 0x38) != *(int *)(param_1 + 0x8628)) goto LAB_140138893;
      iVar8 = FUN_140104440(param_5,(ulonglong)*(uint *)(param_1 + 0x3c) + 0x40 + param_1,
                            *(int *)(param_1 + 0x38) - *(uint *)(param_1 + 0x3c),1,param_7);
      if (iVar8 != 1) {
        *puVar5 = 0x2a;
        return 0;
      }
      *(undefined4 *)(param_1 + 8) = 0x78;
      *(undefined8 *)(param_1 + 0x38) = 0;
    }
    else if (iVar8 == 0x80) {
      if (*(int *)(param_1 + 0x85a4) == 99) {
        *puVar5 = 0x2b;
        return 0;
      }
      cVar6 = FUN_14013f8b0(param_1 + 0x85d8,*(undefined1 *)(*(longlong *)(param_1 + 0x85b0) + 1));
      if (cVar6 == '\0') {
        *puVar5 = 0x2c;
        return 0;
      }
      *(int *)(param_1 + 0x85a4) = *(int *)(param_1 + 0x85a4) + -0x10;
      uVar15 = (uint)*(ushort *)(&DAT_14024bff0 + (ulonglong)*(uint *)(param_1 + 0x85a4) * 2) &
               **(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f);
      *(uint *)(param_1 + 0x85c0) = uVar15;
      pbVar13 = (byte *)(*(longlong *)(*(longlong *)(param_1 + 0x85b0) + 8) +
                        (ulonglong)uVar15 * 0x10);
      *(byte **)(param_1 + 0x85b0) = pbVar13;
      uVar15 = (uint)*pbVar13;
      *(uint *)(param_1 + 0x85a4) = uVar15;
      if (uVar15 < 0x11) {
        *(undefined4 *)(param_1 + 8) = 0x81;
      }
    }
    else if (iVar8 == 0x82) {
      *(uint *)(param_1 + 0x85ac) = *(uint *)(param_1 + 0x85ac) & uVar16;
      uVar15 = *(uint *)(param_1 + 0x38);
      if (*(uint *)(param_1 + 0x38) < *(uint *)(param_1 + 0x85ac)) {
        uVar15 = *(uint *)(param_1 + 0x85ac);
      }
      uVar12 = *(uint *)(param_1 + 0x85a8);
      uVar15 = *(int *)(param_1 + 0x8628) - uVar15;
      if (uVar12 < uVar15) {
        uVar15 = uVar12;
      }
      *(uint *)(param_1 + 0x85a4) = uVar15;
      *(uint *)(param_1 + 0x85a8) = uVar12 - uVar15;
      do {
        *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x38) + 0x40 + param_1) =
             *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x85ac) + 0x40 + param_1);
        *(int *)(param_1 + 0x38) = *(int *)(param_1 + 0x38) + 1;
        *(int *)(param_1 + 0x85ac) = *(int *)(param_1 + 0x85ac) + 1;
        piVar2 = (int *)(param_1 + 0x85a4);
        *piVar2 = *piVar2 + -1;
      } while (*piVar2 != 0);
      if (*(uint *)(param_1 + 0x8628) <= *(uint *)(param_1 + 0x38)) {
        iVar8 = FUN_140104440(param_5,(ulonglong)*(uint *)(param_1 + 0x3c) + 0x40 + param_1,
                              *(uint *)(param_1 + 0x38) - *(uint *)(param_1 + 0x3c),1,param_7);
        if (iVar8 != 1) {
          *puVar5 = 0x2d;
          return 0;
        }
        *(uint *)(param_1 + 0x38) = *(uint *)(param_1 + 0x38) & uVar16;
        *(undefined4 *)(param_1 + 0x3c) = *(undefined4 *)(param_1 + 0x38);
      }
      if (*(int *)(param_1 + 0x85a8) == 0) {
        *(undefined4 *)(param_1 + 8) = 0x78;
      }
    }
    else if (iVar8 == 0x81) {
      cVar6 = FUN_14013f8b0(param_1 + 0x85d8,*(undefined1 *)(*(longlong *)(param_1 + 0x85b0) + 1));
      if (cVar6 == '\0') {
        *puVar5 = 0x2e;
        return 0;
      }
      uVar15 = **(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f) &
               (uint)*(ushort *)(&DAT_14024bff0 + (ulonglong)*(uint *)(param_1 + 0x85a4) * 2);
      *(uint *)(param_1 + 0x85c0) = uVar15;
      *(uint *)(param_1 + 0x85ac) =
           (*(int *)(param_1 + 0x38) - (uint)*(ushort *)(*(longlong *)(param_1 + 0x85b0) + 8)) -
           uVar15;
      cVar6 = FUN_14013f8b0(param_1 + 0x85d8,*(undefined4 *)(param_1 + 0x85a4));
      if (cVar6 == '\0') {
        *puVar5 = 0x2f;
        return 0;
      }
      *(undefined4 *)(param_1 + 8) = 0x82;
    }
    else if (iVar8 == 0x7f) {
      *(uint *)(param_1 + 8) = (*(uint *)(param_1 + 0x85a4) < 0x11) + 0x80;
    }
    else if (iVar8 == 0x7e) {
      if (*(uint *)(param_1 + 0x85a4) == 0) {
        *(uint *)(param_1 + 0x85a8) = (uint)*(ushort *)(*(longlong *)(param_1 + 0x85b0) + 8);
      }
      else {
        *(uint *)(param_1 + 0x85a8) =
             (**(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f) &
             (uint)*(ushort *)(&DAT_14024bff0 + (ulonglong)*(uint *)(param_1 + 0x85a4) * 2)) +
             (uint)*(ushort *)(*(longlong *)(param_1 + 0x85b0) + 8);
        cVar6 = FUN_14013f8b0(param_1 + 0x85d8,*(undefined4 *)(param_1 + 0x85a4));
        if (cVar6 == '\0') {
          *puVar5 = 0x30;
          return 0;
        }
      }
      uVar15 = **(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f) &
               *(uint *)(param_1 + 0x85bc);
      *(uint *)(param_1 + 0x85c0) = uVar15;
      pbVar13 = (byte *)((ulonglong)uVar15 * 0x10 + *(longlong *)(param_1 + 0x8078));
      *(byte **)(param_1 + 0x85b0) = pbVar13;
      bVar11 = *pbVar13;
      *(undefined4 *)(param_1 + 8) = 0x7f;
      *(uint *)(param_1 + 0x85a4) = (uint)bVar11;
    }
    else if (iVar8 == 0x7c) {
      cVar6 = FUN_14013f8b0(param_1 + 0x85d8,*(undefined1 *)(*(longlong *)(param_1 + 0x85b0) + 1));
      if (cVar6 == '\0') {
        *puVar5 = 0x31;
        return 0;
      }
      if (*(int *)(param_1 + 0x85a4) == 0x10) {
        *(undefined4 *)(param_1 + 8) = 0x7d;
      }
      else {
        if (*(int *)(param_1 + 0x85a4) == 0xf) {
          FUN_14013ef50();
          *(undefined8 *)(param_1 + 0x8070) = 0;
          if (*(char *)(param_1 + 0x8080) == '\0') {
            FUN_14013ef50();
          }
          *(undefined8 *)(param_1 + 0x8078) = 0;
          *(undefined1 *)(param_1 + 0x8080) = 0;
          goto LAB_14013829b;
        }
        *(undefined4 *)(param_1 + 8) = 0x7e;
      }
    }
    else if (iVar8 == 0x7a) {
      uVar15 = **(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f) &
               *(uint *)(param_1 + 0x85b8);
      *(uint *)(param_1 + 0x85c0) = uVar15;
      pbVar13 = (byte *)((ulonglong)uVar15 * 0x10 + *(longlong *)(param_1 + 0x8070));
      *(byte **)(param_1 + 0x85b0) = pbVar13;
      uVar15 = (uint)*pbVar13;
      *(uint *)(param_1 + 0x85a4) = uVar15;
      *(uint *)(param_1 + 8) = (uVar15 < 0x11) + 0x7b;
    }
    else {
      if (iVar8 != 0x78) {
        *puVar5 = 0x32;
        return 0;
      }
      uVar15 = **(uint **)(param_1 + 0x8618) >> ((byte)*(undefined4 *)(param_1 + 0x8620) & 0x1f) &
               *(uint *)(param_1 + 0x85b8);
      *(uint *)(param_1 + 0x85c0) = uVar15;
      pcVar14 = (char *)((ulonglong)uVar15 * 0x10 + *(longlong *)(param_1 + 0x8070));
      *(char **)(param_1 + 0x85b0) = pcVar14;
      *(uint *)(param_1 + 8) = (*pcVar14 != '\x10') + 0x79;
    }
  } while ((*(int *)(param_1 + 8) != *(int *)(param_1 + 0x85c4)) || (100 < *(int *)(param_1 + 8)));
  uVar15 = *(uint *)(param_1 + 0x38);
  uVar12 = *(uint *)(param_1 + 0x3c);
  if ((uVar12 < uVar15) || (*(uint *)(param_1 + 0x8628) <= uVar15)) {
    iVar9 = FUN_140104440(param_5,(ulonglong)uVar12 + 0x40 + param_1,uVar15 - uVar12,1,param_7);
    if (iVar9 != 1) {
LAB_140138e2d:
      *puVar5 = 0x34;
      return 0;
    }
    *(uint *)(param_1 + 0x38) = *(uint *)(param_1 + 0x38) & uVar16;
    *(undefined4 *)(param_1 + 0x3c) = *(undefined4 *)(param_1 + 0x38);
  }
  *puVar5 = 2000;
  return 1;
}



void * FUN_1401390f0(void *param_1,uint param_2)

{
  FUN_1401379a0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140139120(undefined8 param_1,undefined8 param_2,undefined1 param_3,undefined8 param_4,
                  undefined8 param_5,undefined8 param_6,undefined8 param_7)

{
  undefined8 uVar1;
  undefined4 uVar2;
  
  uVar2 = FUN_1400b8b80(param_2);
  uVar1 = FUN_1400b8b90(param_2);
  FUN_140137a70(param_1,uVar1,uVar2,param_3,param_4,param_5,param_6,param_7,0x1000);
  return;
}



void FUN_1401391c0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  
  *param_1 = LogEntry2::vftable;
  puVar1 = (undefined8 *)param_1[4];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,0xfffffffffffffffe);
    param_1[4] = 0;
  }
  puVar1 = (undefined8 *)param_1[5];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[5] = 0;
  }
  if (param_1[2] != 0) {
    FUN_1400d0d30();
    puVar1 = (undefined8 *)param_1[2];
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    param_1[2] = 0;
  }
  FUN_1400d0ee0(param_1);
  return;
}



void FUN_140139250(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_1400d0c90();
  }
  return;
}



undefined8 FUN_140139270(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  puVar1 = *(undefined8 **)(param_1 + 0x20);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    *(undefined8 *)(param_1 + 0x20) = 0;
  }
  uVar2 = FUN_1400bcbb0(param_2);
  puVar1 = *(undefined8 **)(param_1 + 0x28);
  *(undefined8 *)(param_1 + 0x20) = uVar2;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    *(undefined8 *)(param_1 + 0x28) = 0;
  }
  lVar3 = FUN_1400bcbb0(param_3);
  *(undefined1 *)(param_1 + 0x18) = 0x54;
  *(longlong *)(param_1 + 0x28) = lVar3;
  if ((lVar3 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) {
    return 1;
  }
  return 0;
}



undefined8 FUN_140139310(longlong param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_1400d0d30();
    puVar1 = *(undefined8 **)(param_1 + 0x10);
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    *(undefined8 *)(param_1 + 0x10) = 0;
  }
  uVar2 = FUN_1400d0db0();
  puVar1 = *(undefined8 **)(param_1 + 0x20);
  *(undefined8 *)(param_1 + 0x10) = uVar2;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    *(undefined8 *)(param_1 + 0x20) = 0;
  }
  uVar2 = FUN_1400bcbb0(param_2);
  puVar1 = *(undefined8 **)(param_1 + 0x28);
  *(undefined8 *)(param_1 + 0x20) = uVar2;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    *(undefined8 *)(param_1 + 0x28) = 0;
  }
  *(undefined1 *)(param_1 + 0x18) = 0x43;
  if ((*(longlong *)(param_1 + 0x20) != 0) && (*(longlong *)(param_1 + 0x10) != 0)) {
    return 1;
  }
  return 0;
}



bool FUN_1401393d0(longlong param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  longlong lVar2;
  
  puVar1 = *(undefined8 **)(param_1 + 0x20);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    *(undefined8 *)(param_1 + 0x20) = 0;
  }
  puVar1 = *(undefined8 **)(param_1 + 0x28);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    *(undefined8 *)(param_1 + 0x28) = 0;
  }
  lVar2 = FUN_1400bcbb0(param_2);
  *(undefined1 *)(param_1 + 0x18) = 0x45;
  *(longlong *)(param_1 + 0x28) = lVar2;
  return lVar2 != 0;
}



bool FUN_140139440(longlong param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  longlong lVar2;
  
  puVar1 = *(undefined8 **)(param_1 + 0x20);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    *(undefined8 *)(param_1 + 0x20) = 0;
  }
  puVar1 = *(undefined8 **)(param_1 + 0x28);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    *(undefined8 *)(param_1 + 0x28) = 0;
  }
  lVar2 = FUN_1400bcbb0(param_2);
  *(undefined1 *)(param_1 + 0x18) = 0x58;
  *(longlong *)(param_1 + 0x28) = lVar2;
  return lVar2 != 0;
}



bool FUN_1401394b0(longlong param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  longlong lVar2;
  
  puVar1 = *(undefined8 **)(param_1 + 0x20);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    *(undefined8 *)(param_1 + 0x20) = 0;
  }
  puVar1 = *(undefined8 **)(param_1 + 0x28);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    *(undefined8 *)(param_1 + 0x28) = 0;
  }
  lVar2 = FUN_1400bcbb0(param_2);
  *(undefined1 *)(param_1 + 0x18) = 0x49;
  *(longlong *)(param_1 + 0x28) = lVar2;
  return lVar2 != 0;
}



void FUN_140139520(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  longlong lVar3;
  int iVar4;
  undefined8 uVar5;
  undefined1 local_40 [56];
  
  uVar5 = 0xfffffffffffffffe;
  cVar1 = *(char *)(param_1 + 0x18);
  if (cVar1 == 'E') {
    if (*(longlong *)(param_1 + 0x28) != 0) {
      FUN_1400bccc0(local_40);
      FUN_1400bd6e0(local_40);
      FUN_1400bda40(param_2,local_40,param_3,param_4,uVar5);
      FUN_1400bc640(param_2,"<br>\r\n");
      FUN_1400bceb0(local_40);
    }
  }
  else if (cVar1 == 'I') {
    if (*(longlong *)(param_1 + 0x28) != 0) {
      FUN_1400bccc0(local_40);
      FUN_1400bd6e0(local_40);
      FUN_1400bda40(param_2,local_40);
      FUN_1400bc640(param_2,"<br>\r\n");
      FUN_1400bceb0(local_40);
    }
  }
  else if (cVar1 == 'X') {
    if (*(longlong *)(param_1 + 0x28) != 0) {
      FUN_1400bccc0(local_40);
      FUN_1400bd6e0(local_40);
      FUN_1400bda40(param_2,local_40);
      FUN_1400bc640(param_2,"<br>\r\n");
      FUN_1400bceb0(local_40);
    }
  }
  else if (cVar1 == 'T') {
    if ((*(longlong *)(param_1 + 0x28) != 0) && (*(longlong *)(param_1 + 0x20) != 0)) {
      FUN_1400bccc0(local_40);
      FUN_1400bda40(param_2,*(undefined8 *)(param_1 + 0x20));
      FUN_1400bc640(param_2,&DAT_140246168);
      FUN_1400bd6e0(local_40);
      FUN_1400bda40(param_2,local_40);
      FUN_1400bc640(param_2,"<br>\r\n");
      FUN_1400bceb0(local_40);
    }
  }
  else if ((*(longlong *)(param_1 + 0x10) != 0) && (*(longlong *)(param_1 + 0x20) != 0)) {
    FUN_1400bda40(param_2);
    FUN_1400bc640(param_2,":<blockquote>\r\n");
    iVar2 = FUN_140139d70(*(undefined8 *)(param_1 + 0x10));
    iVar4 = 0;
    if (0 < iVar2) {
      do {
        lVar3 = FUN_1400d0aa0(*(undefined8 *)(param_1 + 0x10),iVar4);
        if (lVar3 != 0) {
          FUN_140139520(lVar3,param_2);
        }
        iVar4 = iVar4 + 1;
      } while (iVar4 < iVar2);
    }
    FUN_1400bc640(param_2,"</blockquote>\r\n");
  }
  return;
}



void FUN_140139740(longlong param_1,undefined8 param_2,int param_3)

{
  char cVar1;
  int iVar2;
  longlong lVar3;
  undefined8 uVar4;
  int iVar5;
  
  cVar1 = *(char *)(param_1 + 0x18);
  if (((cVar1 == 'E') || (cVar1 == 'I')) || (cVar1 == 'X')) {
    if (*(longlong *)(param_1 + 0x28) == 0) {
      return;
    }
    if (param_3 != 0) {
      FUN_1400be1c0(param_2,0x20,param_3 * 2);
    }
    uVar4 = *(undefined8 *)(param_1 + 0x28);
  }
  else if (cVar1 == 'T') {
    if (*(longlong *)(param_1 + 0x28) == 0) {
      return;
    }
    if (*(longlong *)(param_1 + 0x20) == 0) {
      return;
    }
    if (param_3 != 0) {
      FUN_1400be1c0(param_2,0x20,param_3 * 2);
    }
    FUN_1400bda40(param_2,*(undefined8 *)(param_1 + 0x20));
    FUN_1400bc640(param_2,&DAT_140246168);
    uVar4 = *(undefined8 *)(param_1 + 0x28);
  }
  else {
    if (*(longlong *)(param_1 + 0x10) == 0) {
      return;
    }
    if (*(longlong *)(param_1 + 0x20) == 0) {
      return;
    }
    if (param_3 != 0) {
      FUN_1400be1c0(param_2,0x20,param_3 * 2);
    }
    FUN_1400bda40(param_2,*(undefined8 *)(param_1 + 0x20));
    FUN_1400bc640(param_2,&DAT_14024c124);
    iVar2 = FUN_140139d70(*(undefined8 *)(param_1 + 0x10));
    iVar5 = 0;
    if (0 < iVar2) {
      do {
        lVar3 = FUN_1400d0aa0(*(undefined8 *)(param_1 + 0x10),iVar5);
        if (lVar3 != 0) {
          FUN_140139740(lVar3,param_2,param_3 + 1);
        }
        iVar5 = iVar5 + 1;
      } while (iVar5 < iVar2);
    }
    if (param_3 != 0) {
      FUN_1400be1c0(param_2,0x20,param_3 * 2);
    }
    FUN_1400bc640(param_2,&DAT_14024c120);
    uVar4 = *(undefined8 *)(param_1 + 0x20);
  }
  FUN_1400bda40(param_2,uVar4);
  FUN_1400bc640(param_2,&DAT_140208d34);
  return;
}



bool FUN_1401398c0(undefined8 param_1,char *param_2)

{
  char *pcVar1;
  
  if (param_2 == (char *)0x0) {
    return false;
  }
  pcVar1 = strstr(param_2,"<![CDATA[");
  if ((pcVar1 != (char *)0x0) && (pcVar1 = strstr(param_2,"]]>"), pcVar1 != (char *)0x0)) {
    return false;
  }
  pcVar1 = strchr(param_2,10);
  if ((((pcVar1 == (char *)0x0) && (pcVar1 = strchr(param_2,9), pcVar1 == (char *)0x0)) &&
      (pcVar1 = strchr(param_2,0x26), pcVar1 == (char *)0x0)) &&
     (pcVar1 = strchr(param_2,0x3e), pcVar1 == (char *)0x0)) {
    pcVar1 = strchr(param_2,0x3c);
    return pcVar1 != (char *)0x0;
  }
  return true;
}



undefined8 * FUN_140139970(void)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  puVar2 = (undefined8 *)0x0;
  puVar1 = operator_new(0x30);
  if (puVar1 != (undefined8 *)0x0) {
    FUN_1400d0eb0(puVar1);
    *puVar1 = LogEntry2::vftable;
    puVar1[2] = 0;
    *(undefined1 *)(puVar1 + 3) = 0x49;
    puVar1[4] = 0;
    puVar1[5] = 0;
    puVar2 = puVar1;
  }
  return puVar2;
}



void * FUN_1401399f0(void *param_1,uint param_2)

{
  FUN_1401391c0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140139a20(longlong param_1)

{
  int iVar1;
  undefined8 *puVar2;
  
  if ((((*(longlong *)(param_1 + 0x10) != 0) &&
       (puVar2 = (undefined8 *)FUN_1400d0ac0(), puVar2 != (undefined8 *)0x0)) &&
      (*(char *)(puVar2 + 3) == 'C')) && ((puVar2[2] == 0 || (iVar1 = FUN_140139d70(), iVar1 == 0)))
     ) {
    FUN_1400d0cd0(*(undefined8 *)(param_1 + 0x10));
    (**(code **)*puVar2)(puVar2,1);
  }
  return;
}



void FUN_140139a80(longlong param_1,undefined8 param_2)

{
  char cVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  int iVar5;
  
  cVar1 = *(char *)(param_1 + 0x18);
  if (cVar1 == 'E') {
    if (*(longlong *)(param_1 + 0x28) != 0) {
      FUN_1400bc640(param_2,"<error>");
      uVar3 = FUN_1400b8b90(*(undefined8 *)(param_1 + 0x28));
      cVar1 = FUN_1401398c0(param_1,uVar3);
      if (cVar1 != '\0') {
        FUN_1400bc640(param_2,&DAT_14027b680);
      }
      FUN_1400bda40(param_2,*(undefined8 *)(param_1 + 0x28));
      if (cVar1 != '\0') {
        FUN_1400bc640(param_2,&DAT_14027b68c);
      }
      FUN_1400bc640(param_2,"</error>\r\n");
      return;
    }
  }
  else if (cVar1 == 'I') {
    if (*(longlong *)(param_1 + 0x28) != 0) {
      FUN_1400bc640(param_2,"<info>");
      uVar3 = FUN_1400b8b90(*(undefined8 *)(param_1 + 0x28));
      cVar1 = FUN_1401398c0(param_1,uVar3);
      if (cVar1 != '\0') {
        FUN_1400bc640(param_2,&DAT_14027b680);
      }
      FUN_1400bda40(param_2,*(undefined8 *)(param_1 + 0x28));
      if (cVar1 != '\0') {
        FUN_1400bc640(param_2,&DAT_14027b68c);
      }
      FUN_1400bc640(param_2,"</info>\r\n");
      return;
    }
  }
  else if (cVar1 == 'X') {
    if (*(longlong *)(param_1 + 0x28) != 0) {
      FUN_1400bda40(param_2);
      FUN_1400bc640(param_2,&DAT_140208d34);
      return;
    }
  }
  else if (cVar1 == 'T') {
    if ((*(longlong *)(param_1 + 0x28) != 0) && (*(longlong *)(param_1 + 0x20) != 0)) {
      FUN_1400bbe50(param_2,0x3c);
      FUN_1400bda40(param_2,*(undefined8 *)(param_1 + 0x20));
      FUN_1400bc640(param_2,&DAT_14027b5a4);
      uVar3 = FUN_1400b8b90(*(undefined8 *)(param_1 + 0x28));
      cVar1 = FUN_1401398c0(param_1,uVar3);
      if (cVar1 != '\0') {
        FUN_1400bc640(param_2,&DAT_14027b680);
      }
      FUN_1400bda40(param_2,*(undefined8 *)(param_1 + 0x28));
      if (cVar1 != '\0') {
        FUN_1400bc640(param_2,&DAT_14027b68c);
      }
      FUN_1400bc640(param_2,&DAT_14027b678);
      FUN_1400bda40(param_2,*(undefined8 *)(param_1 + 0x20));
      FUN_1400bc640(param_2,&DAT_14024c150);
      return;
    }
  }
  else if ((*(longlong *)(param_1 + 0x10) != 0) && (*(longlong *)(param_1 + 0x20) != 0)) {
    FUN_1400bbe50(param_2,0x3c);
    FUN_1400bda40(param_2,*(undefined8 *)(param_1 + 0x20));
    FUN_1400bc640(param_2,&DAT_14024c150);
    iVar2 = FUN_140139d70(*(undefined8 *)(param_1 + 0x10));
    iVar5 = 0;
    if (0 < iVar2) {
      do {
        lVar4 = FUN_1400d0aa0(*(undefined8 *)(param_1 + 0x10),iVar5);
        if (lVar4 != 0) {
          FUN_140139a80(lVar4,param_2);
        }
        iVar5 = iVar5 + 1;
      } while (iVar5 < iVar2);
    }
    FUN_1400bc640(param_2,&DAT_14027b678);
    FUN_1400bda40(param_2,*(undefined8 *)(param_1 + 0x20));
    FUN_1400bc640(param_2,&DAT_14024c150);
  }
  return;
}



undefined8 FUN_140139d60(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x10);
}



undefined4 FUN_140139d70(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x10);
}



undefined8 * FUN_140139d80(undefined8 *param_1,int param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  __uint64 _Var2;
  void *pvVar3;
  
  *param_1 = ExtIntArray::vftable;
  *(undefined4 *)(param_1 + 1) = param_3;
  *(undefined4 *)(param_1 + 2) = 0;
  if (param_2 < 1) {
    param_2 = 2;
  }
  *(int *)((longlong)param_1 + 0xc) = param_2;
  auVar1._8_8_ = 0;
  auVar1._0_8_ = (longlong)param_2;
  _Var2 = SUB168(ZEXT816(4) * auVar1,0);
  if (SUB168(ZEXT816(4) * auVar1,8) != 0) {
    _Var2 = 0xffffffffffffffff;
  }
  pvVar3 = operator_new(_Var2);
  param_1[3] = pvVar3;
  return param_1;
}



undefined4 FUN_140139de0(longlong param_1,int param_2)

{
  if ((-1 < param_2) && (param_2 < *(int *)(param_1 + 0x10))) {
    return *(undefined4 *)(*(longlong *)(param_1 + 0x18) + (longlong)param_2 * 4);
  }
  return 0;
}



void FUN_140139e00(longlong param_1)

{
  undefined1 auVar1 [16];
  int iVar2;
  __uint64 _Var3;
  void *_Dst;
  
  *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
  if (*(int *)(param_1 + 0xc) < *(int *)(param_1 + 0x10)) {
    iVar2 = *(int *)(param_1 + 0xc) + *(int *)(param_1 + 8);
    *(int *)(param_1 + 0xc) = iVar2;
    auVar1._8_8_ = 0;
    auVar1._0_8_ = (longlong)iVar2;
    _Var3 = SUB168(ZEXT816(4) * auVar1,0);
    if (SUB168(ZEXT816(4) * auVar1,8) != 0) {
      _Var3 = 0xffffffffffffffff;
    }
    _Dst = operator_new(_Var3);
    if (*(int *)(param_1 + 0x10) != 0) {
      memcpy(_Dst,*(void **)(param_1 + 0x18),(longlong)(*(int *)(param_1 + 0x10) + -1) << 2);
    }
    if (*(void **)(param_1 + 0x18) != (void *)0x0) {
      operator_delete(*(void **)(param_1 + 0x18));
      *(undefined8 *)(param_1 + 0x18) = 0;
    }
    *(void **)(param_1 + 0x18) = _Dst;
    if (*(int *)(param_1 + 8) < 500000) {
      iVar2 = *(int *)(param_1 + 0xc);
      if (500000 < iVar2) {
        iVar2 = 500000;
      }
      *(int *)(param_1 + 8) = iVar2;
    }
  }
  return;
}



void FUN_140139ea0(longlong param_1,int param_2)

{
  int iVar1;
  
  if (-1 < param_2) {
    iVar1 = *(int *)(param_1 + 0x10);
    if (param_2 < iVar1) {
      if (param_2 == iVar1 + -1) {
        *(int *)(param_1 + 0x10) = iVar1 + -1;
        return;
      }
      memmove((void *)(*(longlong *)(param_1 + 0x18) + (longlong)param_2 * 4),
              (void *)(*(longlong *)(param_1 + 0x18) + (longlong)(param_2 + 1) * 4),
              (longlong)((iVar1 - param_2) + -1) << 2);
      *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + -1;
    }
  }
  return;
}



void FUN_140139f00(longlong param_1,undefined4 param_2)

{
  FUN_140139e00();
  *(undefined4 *)(*(longlong *)(param_1 + 0x18) + -4 + (longlong)*(int *)(param_1 + 0x10) * 4) =
       param_2;
  return;
}



undefined8 * FUN_140139f30(undefined8 *param_1,uint param_2)

{
  *param_1 = ExtIntArray::vftable;
  operator_delete((void *)param_1[3]);
  param_1[3] = 0;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



BADSPACEBASE *
FUN_140139f80(longlong param_1,undefined8 param_2,char param_3,char param_4,undefined8 param_5)

{
  longlong *plVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined1 local_128 [40];
  undefined1 local_100 [16];
  undefined8 local_f0;
  undefined1 local_e8 [48];
  undefined1 local_b8 [160];
  
  local_f0 = 0xfffffffffffffffe;
  if ((*(longlong *)(param_1 + 400) != 0) &&
     (*(char *)(*(longlong *)(param_1 + 400) + 0x58) == -0x32)) {
    cVar2 = FUN_14013aad0();
    if (cVar2 != '\0') {
      plVar1 = (longlong *)(param_1 + 0x10);
      (**(code **)(*plVar1 + 0x40))(plVar1);
      (**(code **)(*plVar1 + 0x48))(plVar1,"GetBinaryContent",1);
      lVar5 = FUN_14013acc0(*(undefined8 *)(param_1 + 400));
      FUN_1400b8b30(param_2);
      if ((lVar5 != 0) && (iVar3 = FUN_1400bbb10(lVar5), iVar3 != 0)) {
        FUN_1400f0d10(local_100);
        uVar4 = FUN_1400bbb10(lVar5);
        uVar6 = FUN_1400b8b90(lVar5);
        FUN_1400f3110(local_100,uVar6,uVar4,param_2);
        if (param_4 != '\0') {
          FUN_1400b8c40(local_128);
          FUN_14013de50(local_b8);
          FUN_14013de30(local_b8,param_5);
          FUN_14013df60(local_b8,param_2,local_128);
          FUN_1400b94d0(param_2,local_128);
          FUN_14013df10(local_b8);
          FUN_1400b92d0(local_128);
        }
        if (param_3 != '\0') {
          FUN_1401041a0(local_e8);
          FUN_1400b8c40(local_128);
          FUN_140104260(local_e8,param_2,local_128,plVar1,0);
          FUN_1400b94d0(param_2,local_128);
          FUN_1400b92d0(local_128);
          FUN_1401041f0(local_e8);
        }
        FUN_1400f0d30(local_100);
      }
      (**(code **)(*plVar1 + 0x50))(plVar1);
    }
    register0x00000020 = (BADSPACEBASE *)0x1;
  }
  return register0x00000020;
}



undefined8 *
FUN_14013a160(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 *puVar2;
  undefined1 local_res10 [8];
  undefined8 *local_res18;
  
  (**(code **)(*param_2 + 0x48))(param_2,"openCertKeyContainer",1,param_4,0xfffffffffffffffe);
  puVar2 = operator_new(0x58);
  local_res18 = puVar2;
  if (puVar2 != (undefined8 *)0x0) {
    *puVar2 = KeyContainer::vftable;
    puVar2[1] = 0;
    puVar2[2] = 0;
    puVar2[3] = 0;
    FUN_1400bcc20(puVar2 + 4);
    *(undefined2 *)(puVar2 + 10) = 0;
  }
  cVar1 = FUN_140110a40(param_1,puVar2 + 3,local_res10,param_2);
  if (cVar1 == '\0') {
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    (**(code **)(*param_2 + 0x50))(param_2);
    puVar2 = (undefined8 *)0x0;
  }
  else {
    *(undefined1 *)((longlong)puVar2 + 0x51) = 1;
    FUN_140111160(param_1,puVar2 + 10,param_2);
    FUN_1401110f0(param_1,puVar2 + 4,param_2);
    (**(code **)(*param_2 + 0x50))(param_2);
  }
  return puVar2;
}



bool FUN_14013a250(longlong param_1,longlong *param_2)

{
  BOOL BVar1;
  
  if (*(HCRYPTKEY *)(param_1 + 8) != 0) {
    CryptDestroyKey(*(HCRYPTKEY *)(param_1 + 8));
    *(undefined8 *)(param_1 + 8) = 0;
  }
  BVar1 = CryptGetUserKey(*(HCRYPTPROV *)(param_1 + 0x18),1,(HCRYPTKEY *)(param_1 + 8));
  if (BVar1 == 0) {
    FUN_1400cf640(param_2);
    (**(code **)(*param_2 + 0x28))(param_2,"CryptGetUserKey(AT_KEYEXCHANGE) failed.");
  }
  return BVar1 != 0;
}



bool FUN_14013a2d0(longlong param_1,longlong *param_2)

{
  BOOL BVar1;
  
  if (*(HCRYPTKEY *)(param_1 + 0x10) != 0) {
    CryptDestroyKey(*(HCRYPTKEY *)(param_1 + 0x10));
    *(undefined8 *)(param_1 + 0x10) = 0;
  }
  BVar1 = CryptGetUserKey(*(HCRYPTPROV *)(param_1 + 0x18),2,(HCRYPTKEY *)(param_1 + 0x10));
  if (BVar1 == 0) {
    FUN_1400cf640(param_2);
    (**(code **)(*param_2 + 0x28))(param_2,"CryptGetUserKey(AT_SIGNATURE) failed.");
  }
  return BVar1 != 0;
}



ulonglong FUN_14013a350(longlong param_1,char param_2,undefined8 param_3,undefined8 param_4,
                       longlong *param_5)

{
  char cVar1;
  byte bVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  char *pcVar5;
  undefined1 local_40 [56];
  
  FUN_1400b8b30(param_3);
  (**(code **)(*param_5 + 0x48))(param_5,"GetPrivateKeyToDER",1);
  FUN_1400cf520(param_5,"bExchangeKey",param_2);
  if (param_2 == '\0') {
    cVar1 = FUN_14013a2d0(param_1,param_5);
    if (cVar1 != '\0') goto LAB_14013a3f8;
    pcVar5 = "Failed to access private key (2)";
  }
  else {
    cVar1 = FUN_14013a250();
    if (cVar1 != '\0') {
LAB_14013a3f8:
      FUN_1400bcc20(local_40);
      if (param_2 == '\0') {
        uVar4 = *(undefined8 *)(param_1 + 0x10);
      }
      else {
        uVar4 = *(undefined8 *)(param_1 + 8);
      }
      bVar2 = FUN_1401371a0(uVar4,param_3,param_4,param_5);
      if (bVar2 == 0) {
        (**(code **)(*param_5 + 0x28))(param_5,"(warning) Cannot export private key.");
      }
      (**(code **)(*param_5 + 0x50))(param_5);
      FUN_1400bceb0(local_40);
      return (ulonglong)bVar2;
    }
    pcVar5 = "Failed to access private key (1)";
  }
  (**(code **)(*param_5 + 0x28))(param_5,pcVar5);
  uVar3 = (**(code **)(*param_5 + 0x50))(param_5);
  return uVar3 & 0xffffffffffffff00;
}



undefined8 * FUN_14013a470(undefined8 *param_1,uint param_2)

{
  *param_1 = KeyContainer::vftable;
  if (param_1[2] != 0) {
    CryptDestroyKey(param_1[2]);
    param_1[2] = 0;
  }
  if (param_1[1] != 0) {
    CryptDestroyKey(param_1[1]);
    param_1[1] = 0;
  }
  FUN_1400bceb0(param_1 + 4);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_14013a4e0(longlong param_1)

{
  undefined8 uVar1;
  
  if (*(longlong *)(param_1 + 0x38) == 0) {
    return 0;
  }
  uVar1 = FUN_140139d70();
  return uVar1;
}



undefined8 FUN_14013a500(longlong param_1)

{
  undefined8 uVar1;
  
  if (*(longlong *)(param_1 + 0x38) == 0) {
    return 0;
  }
  uVar1 = FUN_1400d0aa0();
  return uVar1;
}



undefined8 FUN_14013a520(longlong param_1)

{
  undefined8 uVar1;
  
  if (*(longlong *)(param_1 + 0x28) == 0) {
    return 0;
  }
  uVar1 = FUN_1400bbb10();
  return uVar1;
}



undefined1 * FUN_14013a540(longlong param_1)

{
  undefined1 *puVar1;
  
  if (*(longlong *)(param_1 + 0x28) == 0) {
    return &DAT_14027a10a;
  }
  puVar1 = (undefined1 *)FUN_1400b8b90();
  return puVar1;
}



undefined8 FUN_14013a560(longlong param_1)

{
  undefined8 uVar1;
  
  if (*(longlong *)(param_1 + 0x28) == 0) {
    return 0;
  }
  uVar1 = FUN_1400bc3a0();
  return uVar1;
}



undefined8 FUN_14013a580(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x48);
}



undefined8 * FUN_14013a590(undefined8 *param_1)

{
  FUN_1400d0eb0();
  *param_1 = TreeInfo::vftable;
  *(undefined1 *)(param_1 + 2) = 0xce;
  param_1[3] = 0;
  param_1[4] = 0;
  FUN_1400d0a70(param_1 + 5);
  param_1[10] = 0;
  param_1[0xb] = 0;
  *(undefined4 *)((longlong)param_1 + 100) = 0;
  *(undefined4 *)(param_1 + 0xc) = s___AVKeyContainer___14030a648._20_4_;
  s___AVKeyContainer___14030a648._20_4_ = s___AVKeyContainer___14030a648._20_4_ + 1;
  return param_1;
}



void FUN_14013a600(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  undefined8 *puVar2;
  int iVar3;
  
  *param_1 = TreeInfo::vftable;
  *(undefined1 *)(param_1 + 2) = 0x31;
  puVar2 = (undefined8 *)param_1[0xb];
  if (puVar2 != (undefined8 *)0x0) {
    (**(code **)*puVar2)(puVar2,1,param_3,param_4,0xfffffffffffffffe);
  }
  iVar3 = 0;
  param_1[0xb] = 0;
  puVar2 = (undefined8 *)param_1[10];
  if (puVar2 != (undefined8 *)0x0) {
    (**(code **)*puVar2)(puVar2,1);
  }
  param_1[10] = 0;
  puVar2 = (undefined8 *)param_1[4];
  if ((puVar2 != (undefined8 *)0x0) && (*(char *)(puVar2 + 0xb) == -0x32)) {
    (**(code **)*puVar2)(puVar2,1);
  }
  param_1[4] = 0;
  iVar1 = FUN_140139d70(param_1 + 5);
  if (0 < iVar1) {
    do {
      puVar2 = (undefined8 *)FUN_1400d0aa0(param_1 + 5,iVar3);
      if ((puVar2 != (undefined8 *)0x0) && (*(char *)(puVar2 + 0xb) == -0x32)) {
        (**(code **)*puVar2)(puVar2,1);
      }
      iVar3 = iVar3 + 1;
    } while (iVar3 < iVar1);
  }
  FUN_1400d0e10(param_1 + 5);
  FUN_1400d0ee0(param_1);
  return;
}



undefined4 FUN_14013a6e0(longlong param_1,undefined8 param_2,int param_3)

{
  longlong lVar1;
  int iVar2;
  char *pcVar3;
  
  lVar1 = *(longlong *)(param_1 + 0x18);
  pcVar3 = "nothing";
  if ((lVar1 != 0) && (iVar2 = FUN_1400bbb10(lVar1), iVar2 != 0)) {
    pcVar3 = (char *)FUN_1400b8b90(lVar1);
  }
  if (param_3 < 0x33) {
    if (param_3 == 0) goto LAB_14013a76e;
  }
  else {
    param_3 = 0x32;
  }
  FUN_1400be1c0(param_2,0x20,param_3);
  FUN_1400be1c0(param_2,0x20,param_3);
  FUN_1400be1c0(param_2,0x20,param_3);
  FUN_1400be1c0(param_2,0x20,param_3);
LAB_14013a76e:
  FUN_1400bbe50(param_2,0x3c);
  FUN_1400bc640(param_2,pcVar3);
  if ((*(longlong *)(param_1 + 0x20) != 0) && (iVar2 = FUN_140140350(), iVar2 != 0)) {
    FUN_140140380(*(undefined8 *)(param_1 + 0x20),param_2);
  }
  if (((*(longlong *)(param_1 + 0x28) == 0) || (iVar2 = FUN_1400bbb10(), iVar2 == 0)) &&
     (*(longlong *)(param_1 + 0x38) == 0)) {
    FUN_1400bc640(param_2," />\r\n");
    return 1;
  }
  FUN_1400bbe50(param_2,0x3e);
  return 0;
}



void FUN_14013a800(longlong param_1,undefined8 param_2,int param_3)

{
  longlong lVar1;
  int iVar2;
  char *pcVar3;
  
  lVar1 = *(longlong *)(param_1 + 0x18);
  pcVar3 = "nothing";
  if (lVar1 != 0) {
    iVar2 = FUN_1400bbb10(lVar1);
    if (iVar2 != 0) {
      pcVar3 = (char *)FUN_1400b8b90(lVar1);
    }
  }
  if (param_3 < 0x33) {
    if (param_3 == 0) goto LAB_14013a885;
  }
  else {
    param_3 = 0x32;
  }
  FUN_1400be1c0(param_2,0x20,param_3);
  FUN_1400be1c0(param_2,0x20,param_3);
  FUN_1400be1c0(param_2,0x20,param_3);
  FUN_1400be1c0(param_2,0x20,param_3);
LAB_14013a885:
  FUN_1400bbe50(param_2,0x3c);
  FUN_1400bbe50(param_2,0x2f);
  FUN_1400bc640(param_2,pcVar3);
  FUN_1400bbe50(param_2,0x3e);
  FUN_1400bbe50(param_2,0xd);
  FUN_1400bbe50(param_2,10);
  return;
}



undefined8 FUN_14013a8e0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  int iVar4;
  char *pcVar5;
  undefined8 uVar6;
  undefined1 local_40 [56];
  
  uVar6 = 0xfffffffffffffffe;
  if ((*(longlong *)(param_1 + 0x28) == 0) || (iVar2 = FUN_1400bbb10(), iVar2 == 0)) {
    return 0;
  }
  if (*(char *)(param_1 + 0x34) == '\0') {
    pcVar3 = (char *)FUN_1400b8b90(*(undefined8 *)(param_1 + 0x28));
    cVar1 = *pcVar3;
    pcVar5 = pcVar3;
    if (cVar1 != '\0') {
      do {
        iVar4 = (int)pcVar5;
        iVar2 = (int)pcVar3;
        if (cVar1 == '<') {
          if (pcVar3 < pcVar5) {
            FUN_1400bc8a0(param_2,pcVar3,iVar4 - iVar2,param_4,uVar6);
          }
          pcVar3 = "&lt;";
LAB_14013aa83:
          FUN_1400bc640(param_2,pcVar3);
          pcVar3 = pcVar5 + 1;
        }
        else {
          if (cVar1 == '>') {
            if (pcVar3 < pcVar5) {
              FUN_1400bc8a0(param_2,pcVar3,iVar4 - iVar2,param_4,uVar6);
            }
            pcVar3 = "&gt;";
            goto LAB_14013aa83;
          }
          if (cVar1 == '\"') {
            if (pcVar3 < pcVar5) {
              FUN_1400bc8a0(param_2,pcVar3,iVar4 - iVar2,param_4,uVar6);
            }
            pcVar3 = "&quot;";
            goto LAB_14013aa83;
          }
          if (cVar1 == '\'') {
            if (pcVar3 < pcVar5) {
              FUN_1400bc8a0(param_2,pcVar3,iVar4 - iVar2,param_4,uVar6);
            }
            pcVar3 = "&apos;";
            goto LAB_14013aa83;
          }
          if (cVar1 == '&') {
            if (pcVar3 < pcVar5) {
              FUN_1400bc8a0(param_2,pcVar3,iVar4 - iVar2,param_4,uVar6);
            }
            pcVar3 = "&amp;";
            goto LAB_14013aa83;
          }
        }
        if (*pcVar5 == '\0') break;
        pcVar5 = pcVar5 + 1;
        cVar1 = *pcVar5;
      } while (cVar1 != '\0');
      if (pcVar3 < pcVar5) {
        FUN_1400bc8a0(param_2,pcVar3,(int)pcVar5 - (int)pcVar3,param_4,uVar6);
      }
    }
  }
  else {
    FUN_1400bc640(param_2,&DAT_14027b680);
    cVar1 = FUN_1400bde50(*(undefined8 *)(param_1 + 0x28),&DAT_14027b68c);
    if (cVar1 == '\0') {
      uVar6 = FUN_1400b8b90(*(undefined8 *)(param_1 + 0x28));
      FUN_1400bc640(param_2,uVar6);
    }
    else {
      FUN_1400bcc20(local_40);
      FUN_1400bda40(local_40,*(undefined8 *)(param_1 + 0x28));
      FUN_1400bd110(local_40,&DAT_14027b680,&DAT_14027a10a);
      FUN_1400bd110(local_40,&DAT_14027b68c,&DAT_14027a10a);
      FUN_1400bda40(param_2,local_40);
      FUN_1400bceb0(local_40);
    }
    FUN_1400bc640(param_2,&DAT_14027b68c);
  }
  return 1;
}



bool FUN_14013aad0(longlong param_1)

{
  int iVar1;
  
  if (*(longlong *)(param_1 + 0x28) == 0) {
    return false;
  }
  iVar1 = FUN_1400bbb10();
  return iVar1 != 0;
}



undefined1 FUN_14013ab00(longlong param_1)

{
  undefined1 uVar1;
  
  if (*(longlong *)(param_1 + 0x20) == 0) {
    return 0;
  }
  uVar1 = FUN_14013ffd0();
  return uVar1;
}



longlong FUN_14013ab20(longlong param_1,int param_2,longlong param_3)

{
  char cVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  char *pcVar5;
  int iVar6;
  int iVar7;
  longlong lVar8;
  
  if ((param_3 == 0) || (*(longlong *)(param_1 + 0x38) == 0)) {
    return 0;
  }
  iVar7 = 0;
  iVar3 = FUN_140139d70();
  iVar6 = 0;
  if (0 < iVar3) {
    do {
      lVar4 = FUN_1400d0aa0(*(undefined8 *)(param_1 + 0x38),iVar6);
      if (*(longlong *)(lVar4 + 0x28) == 0) {
        pcVar5 = "";
LAB_14013ab9b:
        lVar8 = param_3 - (longlong)pcVar5;
        do {
          cVar1 = *pcVar5;
          cVar2 = pcVar5[lVar8];
          if (cVar1 != cVar2) break;
          pcVar5 = pcVar5 + 1;
        } while (cVar2 != '\0');
        if (cVar1 == cVar2) {
          if (iVar7 == param_2) {
            return lVar4;
          }
          iVar7 = iVar7 + 1;
        }
      }
      else {
        pcVar5 = (char *)FUN_1400b8b90();
        if (pcVar5 != (char *)0x0) goto LAB_14013ab9b;
      }
      iVar6 = iVar6 + 1;
    } while (iVar6 < iVar3);
  }
  return 0;
}



undefined1 FUN_14013abf0(longlong param_1)

{
  undefined1 uVar1;
  
  if (*(longlong *)(param_1 + 0x20) == 0) {
    return 0;
  }
  uVar1 = FUN_14013fdb0();
  return uVar1;
}



void FUN_14013ac10(longlong param_1,undefined8 param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  
  iVar1 = FUN_140139d70(*(longlong *)(param_1 + 0x10) + 0x28);
  iVar3 = 0;
  if (0 < iVar1) {
    do {
      lVar2 = FUN_1400d0aa0(*(longlong *)(param_1 + 0x10) + 0x28,iVar3);
      if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x20) != 0)) {
        FUN_1400bc640(param_2,"<?xml-stylesheet");
        FUN_140140380(*(undefined8 *)(lVar2 + 0x20),param_2);
        FUN_1400bc640(param_2," ?>\r\n");
      }
      iVar3 = iVar3 + 1;
    } while (iVar3 < iVar1);
  }
  return;
}



undefined8 FUN_14013acc0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x28);
}



undefined8 FUN_14013acd0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x40);
}



undefined8 FUN_14013ace0(longlong param_1)

{
  return *(undefined8 *)(*(longlong *)(param_1 + 0x10) + 0x18);
}



void FUN_14013acf0(longlong param_1,char *param_2,undefined8 param_3)

{
  char cVar1;
  void *pvVar2;
  undefined8 uVar3;
  undefined1 local_40 [56];
  
  if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
    FUN_1400bcaa0(local_40);
    FUN_1400bdd70(local_40);
    cVar1 = *param_2;
    if ((('/' < cVar1) && (cVar1 < ':')) || ((cVar1 == '-' || (cVar1 == '.')))) {
      FUN_1400bbf40(local_40,&DAT_140279390);
    }
    if (*(longlong *)(param_1 + 0x20) == 0) {
      pvVar2 = operator_new(0x18);
      uVar3 = 0;
      if (pvVar2 != (void *)0x0) {
        uVar3 = FUN_14013fd90(pvVar2);
      }
      *(undefined8 *)(param_1 + 0x20) = uVar3;
    }
    uVar3 = FUN_1400b8b90(local_40);
    FUN_140140710(*(undefined8 *)(param_1 + 0x20),uVar3,param_3);
    FUN_1400bceb0(local_40);
  }
  return;
}



undefined8 FUN_14013add0(longlong param_1)

{
  undefined8 uVar1;
  
  if (*(longlong *)(param_1 + 0x38) == 0) {
    return 0;
  }
  uVar1 = FUN_1400d0aa0(*(longlong *)(param_1 + 0x38),0);
  return uVar1;
}



undefined4 FUN_14013adf0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x10);
  if ((lVar1 != 0) && (*(char *)(lVar1 + 0x10) == -0x32)) {
    return *(undefined4 *)(lVar1 + 100);
  }
  return 0;
}



undefined1 FUN_14013ae10(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x10);
  if ((lVar1 != 0) && (*(char *)(lVar1 + 0x10) == -0x32)) {
    *(int *)(lVar1 + 100) = *(int *)(lVar1 + 100) + 1;
    *(int *)(param_1 + 0x30) = *(int *)(param_1 + 0x30) + 1;
    return 1;
  }
  *(int *)(param_1 + 0x30) = *(int *)(param_1 + 0x30) + 1;
  return 0;
}



undefined8 FUN_14013ae30(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  lVar2 = *(longlong *)(param_1 + 0x10);
  uVar3 = 1;
  if (lVar2 != 0) {
    if ((*(char *)(lVar2 + 0x10) == -0x32) && (0 < *(int *)(lVar2 + 100))) {
      *(int *)(lVar2 + 100) = *(int *)(lVar2 + 100) + -1;
    }
    else {
      uVar3 = 0;
    }
  }
  iVar1 = *(int *)(param_1 + 0x30);
  if (iVar1 == 0) {
    uVar3 = 0;
  }
  if (0 < iVar1) {
    *(int *)(param_1 + 0x30) = iVar1 + -1;
  }
  return uVar3;
}



void FUN_14013ae70(longlong param_1)

{
  undefined8 *puVar1;
  
  if (((*(longlong *)(param_1 + 0x10) != 0) &&
      (puVar1 = *(undefined8 **)(*(longlong *)(param_1 + 0x10) + 0x18), puVar1 != (undefined8 *)0x0)
      ) && (*(char *)(puVar1 + 0xb) == -0x32)) {
    (**(code **)*puVar1)(puVar1,1);
  }
  return;
}



void FUN_14013aea0(undefined8 param_1,undefined8 param_2,longlong param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  longlong lVar4;
  longlong lVar5;
  undefined8 uVar6;
  int iVar7;
  undefined1 *puVar8;
  undefined1 local_40 [24];
  undefined1 local_28 [32];
  
  FUN_1401408d0(local_40);
  FUN_1401408d0(local_28);
  FUN_1401408f0(local_40,param_1);
  cVar1 = FUN_140140960(local_40);
  do {
    if (cVar1 == '\0') {
      FUN_1401409c0(local_28);
      FUN_1401409c0(local_40);
      return;
    }
    lVar4 = FUN_140140970(local_40);
    if (*(longlong *)(lVar4 + 0x28) == 0) {
      puVar8 = &DAT_14027a10a;
LAB_14013af2c:
      if ((((*(longlong *)(lVar4 + 0x28) == 0) || (iVar2 = FUN_1400bbb10(), iVar2 < 8)) &&
          (param_3 != 0)) &&
         ((*(longlong *)(lVar4 + 0x20) != 0 &&
          (cVar1 = FUN_14013ffd0(*(longlong *)(lVar4 + 0x20),&DAT_140242790,&DAT_140242794),
          cVar1 != '\0')))) {
        if (*(longlong *)(lVar4 + 0x28) == 0) {
          uVar3 = 0;
        }
        else {
          uVar3 = FUN_1400bc3a0();
        }
        lVar5 = FUN_1400d0aa0(param_3,uVar3);
        if (lVar5 != 0) {
          FUN_1400b9e90(param_2,lVar5);
        }
      }
      else {
        FUN_1400b9f10(param_2,puVar8,"base64");
      }
    }
    else {
      puVar8 = (undefined1 *)FUN_1400b8b90();
      if (puVar8 != (undefined1 *)0x0) goto LAB_14013af2c;
    }
    if ((*(longlong *)(lVar4 + 0x38) != 0) && (iVar2 = FUN_140139d70(), iVar2 != 0)) {
      FUN_1401408f0(local_28,lVar4);
    }
    cVar1 = FUN_140140960(local_40);
    if ((cVar1 == '\0') && (lVar4 = FUN_140140970(local_28), lVar4 != 0)) {
      if (*(longlong *)(lVar4 + 0x38) == 0) {
        iVar2 = 0;
      }
      else {
        iVar2 = FUN_140139d70();
      }
      iVar7 = 0;
      if (0 < iVar2) {
        do {
          if (*(longlong *)(lVar4 + 0x38) == 0) {
            uVar6 = 0;
          }
          else {
            uVar6 = FUN_1400d0aa0(*(longlong *)(lVar4 + 0x38),iVar7);
          }
          FUN_1401408f0(local_40,uVar6);
          iVar7 = iVar7 + 1;
        } while (iVar7 < iVar2);
      }
    }
    cVar1 = FUN_140140960(local_40);
  } while( true );
}



void FUN_14013b070(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  undefined8 uVar4;
  undefined1 local_30 [40];
  
  uVar4 = 0xfffffffffffffffe;
  if ((*(longlong *)(param_1 + 0x38) == 0) || (iVar1 = FUN_140139d70(), iVar1 == 0)) {
    *(undefined8 *)(param_1 + 0x10) = param_2;
  }
  else {
    FUN_1400d0a70(local_30);
    FUN_1400d0c90(local_30,param_1,param_3,param_4,uVar4);
    iVar1 = FUN_140139d70(local_30);
    while (iVar1 != 0) {
      lVar2 = FUN_1400d0cd0(local_30);
      *(undefined8 *)(lVar2 + 0x10) = param_2;
      if (*(longlong *)(lVar2 + 0x38) == 0) {
        iVar1 = 0;
      }
      else {
        iVar1 = FUN_140139d70();
      }
      iVar3 = 0;
      if (0 < iVar1) {
        do {
          if (*(longlong *)(lVar2 + 0x38) == 0) {
            uVar4 = 0;
          }
          else {
            uVar4 = FUN_1400d0aa0(*(longlong *)(lVar2 + 0x38),iVar3);
          }
          FUN_1400d0c90(local_30,uVar4);
          iVar3 = iVar3 + 1;
        } while (iVar3 < iVar1);
      }
      iVar1 = FUN_140139d70(local_30);
    }
    FUN_1400d0e10(local_30);
  }
  return;
}



void FUN_14013b160(longlong param_1,undefined1 *param_2)

{
  undefined8 uVar1;
  undefined1 *puVar2;
  
  if (*(longlong *)(param_1 + 0x18) == 0) {
    if (param_2 == (undefined1 *)0x0) {
      return;
    }
    uVar1 = FUN_1400bcbb0(param_2);
    *(undefined8 *)(param_1 + 0x18) = uVar1;
  }
  else {
    puVar2 = &DAT_14027a10a;
    if (param_2 != (undefined1 *)0x0) {
      puVar2 = param_2;
    }
    FUN_1400bdb00(*(longlong *)(param_1 + 0x18),puVar2);
    FUN_1400bc9f0(*(undefined8 *)(param_1 + 0x18));
  }
  if (*(longlong *)(param_1 + 0x18) != 0) {
    FUN_1400bdd70();
  }
  return;
}



void FUN_14013b1c0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  char cVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  int iVar5;
  bool bVar6;
  undefined1 local_70 [48];
  undefined1 local_40 [56];
  
  FUN_1400bcc20(local_40);
  FUN_1400bcc20(local_70);
  lVar1 = *(longlong *)(param_1 + 0x38);
  while( true ) {
    cVar2 = *(char *)(*(int *)(param_1 + 0x40) + lVar1);
    if ((((cVar2 != ' ') && (cVar2 != '\t')) && (cVar2 != '\r')) && (cVar2 != '\n')) break;
    *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
  }
  cVar2 = *(char *)(*(int *)(param_1 + 0x40) + lVar1);
  do {
    if ((cVar2 == '>') || (*(char *)(*(int *)(param_1 + 0x40) + lVar1) == '\0')) {
      *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
      FUN_1400bceb0(local_70);
      FUN_1400bceb0(local_40);
      return;
    }
    FUN_1400bbe30(local_40);
    FUN_1400bbe30(local_70);
    FUN_1401063e0(param_1," \t\r\n=?>",local_40);
    FUN_1400bbce0(local_40,0x22,0);
    lVar1 = *(longlong *)(param_1 + 0x38);
    while( true ) {
      cVar2 = *(char *)(*(int *)(param_1 + 0x40) + lVar1);
      if (((cVar2 != ' ') && (cVar2 != '\t')) && ((cVar2 != '\r' && (cVar2 != '\n')))) break;
      *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
    }
    iVar5 = *(int *)(param_1 + 0x40);
    if (*(char *)(iVar5 + lVar1) == '=') {
      do {
        do {
          iVar5 = iVar5 + 1;
          *(int *)(param_1 + 0x40) = iVar5;
          cVar2 = *(char *)(iVar5 + lVar1);
        } while (cVar2 == ' ');
      } while (((cVar2 == '\t') || (cVar2 == '\r')) || (cVar2 == '\n'));
      bVar6 = *(char *)(*(int *)(param_1 + 0x40) + lVar1) == '\"';
      if (bVar6) {
        *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
      }
      if (*(char *)(*(int *)(param_1 + 0x40) + lVar1) == '\'') {
        *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
LAB_14013b315:
        FUN_140106550(param_1,"\"\'\r\n\n",local_70);
      }
      else {
        if (bVar6) goto LAB_14013b315;
        FUN_1401064e0(param_1," \t\"\'\r\n\n",local_70);
      }
      FUN_1400bbce0(local_70,0x22,0);
      cVar2 = FUN_1400bc610(local_70,0x26);
      if (cVar2 != '\0') {
        FUN_1400bd110(local_70,&DAT_14027ba68,&DAT_14027b674);
        FUN_1400bd110(local_70,&DAT_14027ba60,&DAT_14027b5a4);
        FUN_1400bd110(local_70,"&apos;",&DAT_14027b5d4);
        FUN_1400bd110(local_70,"&quot;",&DAT_14027b5c4);
        FUN_1400bd110(local_70,"&amp;",&DAT_140208d30);
      }
      if (*(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38)) == '\"') {
        *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
      }
      if (*(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38)) == '\'') {
        *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
      }
    }
    uVar3 = FUN_1400b8b90(local_70);
    uVar4 = FUN_1400b8b90(local_40);
    FUN_14013acf0(param_2,uVar4,uVar3);
    lVar1 = *(longlong *)(param_1 + 0x38);
    while( true ) {
      cVar2 = *(char *)(*(int *)(param_1 + 0x40) + lVar1);
      if (((cVar2 != ' ') && (cVar2 != '\t')) && ((cVar2 != '\r' && (cVar2 != '\n')))) break;
      *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
    }
    iVar5 = *(int *)(param_1 + 0x40);
    if (*(char *)(iVar5 + lVar1) == '?') {
      do {
        do {
          iVar5 = iVar5 + 1;
          *(int *)(param_1 + 0x40) = iVar5;
          cVar2 = *(char *)(iVar5 + lVar1);
        } while (cVar2 == ' ');
      } while (((cVar2 == '\t') || (cVar2 == '\r')) || (cVar2 == '\n'));
    }
    cVar2 = *(char *)(*(int *)(param_1 + 0x40) + lVar1);
  } while( true );
}



void FUN_14013b4d0(longlong param_1,char *param_2)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  puVar1 = *(undefined8 **)(*(longlong *)(param_1 + 0x10) + 0x58);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    *(undefined8 *)(*(longlong *)(param_1 + 0x10) + 0x58) = 0;
  }
  if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
    uVar2 = FUN_1400bcbb0(param_2);
    *(undefined8 *)(*(longlong *)(param_1 + 0x10) + 0x58) = uVar2;
  }
  return;
}



void FUN_14013b530(longlong param_1,char *param_2)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  puVar1 = *(undefined8 **)(*(longlong *)(param_1 + 0x10) + 0x50);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    *(undefined8 *)(*(longlong *)(param_1 + 0x10) + 0x50) = 0;
  }
  if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
    uVar2 = FUN_1400bcbb0(param_2);
    *(undefined8 *)(*(longlong *)(param_1 + 0x10) + 0x50) = uVar2;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14013b590(undefined8 param_1)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  char *pcVar4;
  longlong lVar5;
  undefined8 uVar6;
  char *pcVar7;
  undefined8 uVar8;
  undefined1 auStack_198 [32];
  undefined4 local_178;
  undefined1 *local_170;
  undefined1 local_168 [40];
  undefined1 local_140 [48];
  undefined1 local_110 [48];
  undefined8 local_e0;
  undefined1 local_d8 [192];
  ulonglong local_18;
  
  local_e0 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_198;
  pcVar4 = (char *)FUN_1400b8b90();
  if (pcVar4 == (char *)0x0) {
    return 0;
  }
  cVar1 = *pcVar4;
  if ((cVar1 == -1) && (pcVar4[1] == -2)) {
    FUN_1400c2840(local_d8);
    FUN_1400b8c40(local_168);
    local_178 = FUN_1400b8b80(param_1);
    local_170 = local_168;
    FUN_1400cded0(local_d8,0x4b0,0xfde9,pcVar4);
    FUN_1400b8b30(param_1);
    FUN_1400b94d0(param_1,local_168);
    FUN_1400b92d0(local_168);
    FUN_1400c2880(local_d8);
    return 1;
  }
  if ((cVar1 == -2) && (pcVar4[1] == -1)) {
    FUN_1400c2840(local_d8);
    FUN_1400b8c40(local_168);
    local_178 = FUN_1400b8b80(param_1);
    local_170 = local_168;
    FUN_1400cded0(local_d8,0x4b1,0xfde9,pcVar4);
    FUN_1400b8b30(param_1);
    FUN_1400b94d0(param_1,local_168);
    FUN_1400b92d0(local_168);
    FUN_1400c2880(local_d8);
    return 1;
  }
  if (((cVar1 == -0x11) && (pcVar4[1] == -0x45)) && (pcVar4[2] == -0x41)) {
    FUN_1400b9cb0(param_1,3);
    return 1;
  }
  FUN_1400b9550(param_1,0);
  lVar5 = FUN_1400b8b90(param_1);
  if (lVar5 == 0) {
    return 0;
  }
  uVar6 = FUN_1400b8b90(param_1);
  pcVar4 = (char *)FUN_1400d0f20(uVar6,&DAT_14027ba88);
  if ((pcVar4 == (char *)0x0) || (pcVar7 = strchr(pcVar4,0x3e), pcVar7 == (char *)0x0)) {
    FUN_1400b8be0(param_1,1);
    return 1;
  }
  FUN_1400bcc20(local_140);
  FUN_1400bc8a0(local_140,pcVar4,(int)pcVar7 - (int)pcVar4);
  FUN_1400bdd00(local_140,0x20);
  FUN_1400bd760(local_140);
  pcVar4 = (char *)FUN_1400b8b90(local_140);
  pcVar7 = strstr(pcVar4,"encoding=\"");
  if ((pcVar7 == (char *)0x0) && (pcVar7 = strstr(pcVar4,"encoding=\'"), pcVar7 == (char *)0x0)) {
    FUN_1400b8be0(param_1,1);
  }
  else {
    FUN_1400b8be0(param_1,1);
    pcVar7 = pcVar7 + 10;
    pcVar4 = strchr(pcVar7,0x22);
    if ((pcVar4 != (char *)0x0) || (pcVar4 = strchr(pcVar7,0x27), pcVar4 != (char *)0x0)) {
      FUN_1400bcc20(local_110);
      FUN_1400bc8a0(local_110,pcVar7,(int)pcVar4 - (int)pcVar7);
      iVar2 = FUN_1400bbb10(local_110);
      if (iVar2 != 0) {
        uVar6 = FUN_1400b8b90(local_110);
        cVar1 = FUN_14010c5a0(uVar6);
        if (cVar1 != '\0') {
          cVar1 = FUN_1400be010(local_110,&DAT_1402083e0);
          if (cVar1 != '\0') {
            FUN_1400bceb0(local_110);
            goto LAB_14013b90f;
          }
          FUN_1400c2840(local_d8);
          FUN_1400b8c40(local_168);
          uVar3 = FUN_1400b8b80(param_1);
          uVar6 = FUN_1400b8b90(param_1);
          uVar8 = FUN_1400b8b90(local_110);
          local_170 = local_168;
          local_178 = uVar3;
          FUN_1400ce6b0(local_d8,uVar8,0xfde9,uVar6);
          FUN_1400b8b30(param_1);
          FUN_1400b94d0(param_1,local_168);
          FUN_1400b92d0(local_168);
          FUN_1400c2880(local_d8);
        }
      }
      FUN_1400bceb0(local_110);
    }
  }
LAB_14013b90f:
  FUN_1400bceb0(local_140);
  return 1;
}



undefined1 * FUN_14013b950(longlong param_1)

{
  undefined1 *puVar1;
  
  if (*(longlong *)(param_1 + 0x18) == 0) {
    return &DAT_14027a10a;
  }
  puVar1 = (undefined1 *)FUN_1400b8b90();
  return puVar1;
}



void * FUN_14013b970(void *param_1,uint param_2)

{
  FUN_14013a600();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14013b9a0(undefined8 *param_1)

{
  char cVar1;
  int iVar2;
  undefined8 *puVar3;
  int iVar4;
  
  *param_1 = TreeNode::vftable;
  *(undefined1 *)(param_1 + 0xb) = 0x31;
  iVar4 = 0;
  if (param_1[3] != 0) {
    cVar1 = FUN_1400bbb30();
    if (cVar1 != '\0') {
      puVar3 = (undefined8 *)param_1[3];
      if (puVar3 != (undefined8 *)0x0) {
        (**(code **)*puVar3)(puVar3,1);
      }
      param_1[3] = 0;
    }
  }
  puVar3 = (undefined8 *)param_1[5];
  if (puVar3 != (undefined8 *)0x0) {
    (**(code **)*puVar3)(puVar3,1);
    param_1[5] = 0;
  }
  puVar3 = (undefined8 *)param_1[4];
  if (puVar3 != (undefined8 *)0x0) {
    (**(code **)*puVar3)(puVar3,1);
    param_1[4] = 0;
  }
  if (param_1[7] != 0) {
    iVar2 = FUN_140139d70();
    if (0 < iVar2) {
      do {
        puVar3 = (undefined8 *)FUN_1400d0aa0(param_1[7],iVar4);
        if ((puVar3 != (undefined8 *)0x0) && (*(char *)(puVar3 + 0xb) == -0x32)) {
          (**(code **)*puVar3)(puVar3,1);
        }
        iVar4 = iVar4 + 1;
      } while (iVar4 < iVar2);
    }
    puVar3 = (undefined8 *)param_1[7];
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    param_1[7] = 0;
  }
  param_1[8] = 0;
  *(undefined4 *)(param_1 + 6) = 0;
  param_1[9] = 0;
  param_1[10] = 0;
  puVar3 = (undefined8 *)param_1[2];
  if ((puVar3 != (undefined8 *)0x0) && ((undefined8 *)puVar3[3] == param_1)) {
    if (*(char *)(puVar3 + 2) == -0x32) {
      (**(code **)*puVar3)(puVar3,1);
    }
    param_1[2] = 0;
  }
  FUN_1400d0ee0(param_1);
  return;
}



longlong FUN_14013bad0(longlong param_1,longlong param_2,longlong param_3)

{
  char cVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  char *pcVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  int iVar8;
  longlong lVar9;
  
  if (*(longlong *)(param_1 + 0x38) == 0) {
    return 0;
  }
  iVar3 = FUN_140139d70();
  iVar8 = 0;
  if (0 < iVar3) {
    do {
      lVar4 = FUN_1400d0aa0(*(undefined8 *)(param_1 + 0x38),iVar8);
      if (*(longlong *)(lVar4 + 0x18) == 0) {
        pcVar5 = "";
      }
      else {
        pcVar5 = (char *)FUN_1400b8b90();
      }
      lVar9 = param_2 - (longlong)pcVar5;
      do {
        cVar2 = *pcVar5;
        cVar1 = pcVar5[lVar9];
        if (cVar2 != cVar1) break;
        pcVar5 = pcVar5 + 1;
      } while (cVar1 != '\0');
      if (cVar2 == cVar1) {
        if (param_3 == 0) {
          return lVar4;
        }
        if (*(longlong *)(lVar4 + 0x20) != 0) {
          uVar6 = FUN_14013b950(param_3);
          uVar7 = FUN_1401068a0(param_3);
          cVar2 = FUN_14013ffd0(*(undefined8 *)(lVar4 + 0x20),uVar7,uVar6);
          if (cVar2 != '\0') {
            return lVar4;
          }
        }
      }
      iVar8 = iVar8 + 1;
    } while (iVar8 < iVar3);
  }
  return 0;
}



longlong FUN_14013bbd0(longlong param_1,int param_2,longlong param_3)

{
  char cVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  char *pcVar5;
  int iVar6;
  int iVar7;
  longlong lVar8;
  
  if (*(longlong *)(param_1 + 0x38) == 0) {
    return 0;
  }
  iVar7 = 0;
  iVar3 = FUN_140139d70();
  iVar6 = 0;
  if (0 < iVar3) {
    do {
      lVar4 = FUN_1400d0aa0(*(undefined8 *)(param_1 + 0x38),iVar6);
      if (*(longlong *)(lVar4 + 0x18) == 0) {
        pcVar5 = "";
      }
      else {
        pcVar5 = (char *)FUN_1400b8b90();
      }
      lVar8 = param_3 - (longlong)pcVar5;
      do {
        cVar1 = *pcVar5;
        cVar2 = pcVar5[lVar8];
        if (cVar1 != cVar2) break;
        pcVar5 = pcVar5 + 1;
      } while (cVar2 != '\0');
      if (cVar1 == cVar2) {
        if (iVar7 == param_2) {
          return lVar4;
        }
        iVar7 = iVar7 + 1;
      }
      iVar6 = iVar6 + 1;
    } while (iVar6 < iVar3);
  }
  return 0;
}



void FUN_14013bca0(longlong param_1,undefined8 param_2,int param_3,int param_4,char param_5)

{
  longlong lVar1;
  bool bVar2;
  char cVar3;
  int iVar4;
  undefined8 uVar5;
  int iVar6;
  undefined1 local_50 [56];
  
  lVar1 = *(longlong *)(param_1 + 0x10);
  if ((lVar1 != 0) && (*(char *)(lVar1 + 0x10) == -0x32)) {
    bVar2 = true;
    if (*(longlong *)(lVar1 + 0x18) == param_1) {
      bVar2 = true;
      if ((param_5 == '\0') && (*(longlong *)(lVar1 + 0x20) != 0)) {
        FUN_1400bc640(param_2,&DAT_14027ba88);
        if (*(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x10) + 0x20) + 0x20) != 0) {
          FUN_1400bcc20(local_50);
          if ((((*(longlong *)(param_1 + 0x10) != 0) &&
               (lVar1 = *(longlong *)(*(longlong *)(param_1 + 0x10) + 0x20), lVar1 != 0)) &&
              (lVar1 = *(longlong *)(lVar1 + 0x20), lVar1 != 0)) &&
             (cVar3 = FUN_14013fdb0(lVar1,"standalone",local_50), cVar3 != '\0')) {
            lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x10) + 0x20) + 0x20);
            if (lVar1 != 0) {
              FUN_1401405d0(lVar1,"standalone");
            }
            uVar5 = FUN_1400b8b90(local_50);
            FUN_14013acf0(*(undefined8 *)(*(longlong *)(param_1 + 0x10) + 0x20),"standalone",uVar5);
          }
          FUN_140140380(*(undefined8 *)(*(longlong *)(*(longlong *)(param_1 + 0x10) + 0x20) + 0x20),
                        param_2);
          FUN_1400bceb0(local_50);
        }
        FUN_1400bc640(param_2," ?>\r\n");
        bVar2 = false;
      }
      FUN_14013ac10(param_1,param_2);
      if ((*(longlong *)(*(longlong *)(param_1 + 0x10) + 0x58) != 0) &&
         (iVar4 = FUN_1400bbb10(), iVar4 != 0)) {
        uVar5 = FUN_1400b8b90(*(undefined8 *)(*(longlong *)(param_1 + 0x10) + 0x58));
        FUN_1400bc640(param_2,uVar5);
        FUN_1400bbe50(param_2,0xd);
        FUN_1400bbe50(param_2,10);
        bVar2 = false;
      }
      if ((*(longlong *)(*(longlong *)(param_1 + 0x10) + 0x50) != 0) &&
         (iVar4 = FUN_1400bbb10(), iVar4 != 0)) {
        uVar5 = FUN_1400b8b90(*(undefined8 *)(*(longlong *)(param_1 + 0x10) + 0x50));
        FUN_1400bc640(param_2,uVar5);
        FUN_1400bbe50(param_2,0xd);
        FUN_1400bbe50(param_2,10);
        bVar2 = false;
      }
    }
    if ((param_3 == 0) && (bVar2)) {
      FUN_1400bc640(param_2,&DAT_140208d34);
    }
    cVar3 = FUN_14013a6e0(param_1,param_2,param_4);
    if (cVar3 == '\0') {
      FUN_14013a8e0(param_1,param_2);
      if (*(longlong *)(param_1 + 0x38) != 0) {
        iVar4 = FUN_140139d70();
        iVar6 = 0;
        if (0 < iVar4) {
          do {
            uVar5 = FUN_1400d0aa0(*(undefined8 *)(param_1 + 0x38),iVar6);
            FUN_14013bca0(uVar5,param_2,iVar6,param_4 + 1,0);
            iVar6 = iVar6 + 1;
          } while (iVar6 < iVar4);
        }
      }
      if ((*(longlong *)(param_1 + 0x38) == 0) && (cVar3 = FUN_1400bdcd0(param_2), cVar3 != '\n')) {
        param_4 = 0;
      }
      FUN_14013a800(param_1,param_2,param_4);
    }
  }
  return;
}



longlong FUN_14013bf30(undefined8 param_1,longlong param_2,char *param_3,undefined8 param_4,
                      undefined8 param_5)

{
  char cVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  char *pcVar5;
  undefined8 uVar6;
  int iVar7;
  longlong lVar8;
  bool bVar9;
  undefined1 local_60 [24];
  undefined1 local_48 [32];
  
  FUN_1401408d0(local_60);
  FUN_1401408d0(local_48);
  FUN_1401408f0(local_60,param_1);
  bVar9 = param_2 == 0;
  cVar2 = FUN_140140960(local_60);
  do {
    if (cVar2 == '\0') {
      FUN_1401409c0(local_48);
      FUN_1401409c0(local_60);
      return 0;
    }
    lVar4 = FUN_140140970(local_60);
    if (bVar9) {
      if (*(longlong *)(lVar4 + 0x18) == 0) {
        pcVar5 = "";
      }
      else {
        pcVar5 = (char *)FUN_1400b8b90();
      }
      if (*pcVar5 == *param_3) {
        if (*(longlong *)(lVar4 + 0x18) == 0) {
          pcVar5 = "";
        }
        else {
          pcVar5 = (char *)FUN_1400b8b90();
        }
        lVar8 = (longlong)param_3 - (longlong)pcVar5;
        do {
          cVar2 = *pcVar5;
          cVar1 = pcVar5[lVar8];
          if (cVar2 != cVar1) break;
          pcVar5 = pcVar5 + 1;
        } while (cVar1 != '\0');
        if (((cVar2 == cVar1) && (*(longlong *)(lVar4 + 0x20) != 0)) &&
           (cVar2 = FUN_140140150(*(longlong *)(lVar4 + 0x20),param_4,param_5), cVar2 != '\0')) {
          FUN_1401409c0(local_48);
          FUN_1401409c0(local_60);
          return lVar4;
        }
      }
    }
    else if (lVar4 == param_2) {
      bVar9 = true;
    }
    if ((*(longlong *)(lVar4 + 0x38) != 0) && (iVar3 = FUN_140139d70(), iVar3 != 0)) {
      FUN_1401408f0(local_48,lVar4);
    }
    cVar2 = FUN_140140960(local_60);
    if ((cVar2 == '\0') && (lVar4 = FUN_140140970(local_48), lVar4 != 0)) {
      if (*(longlong *)(lVar4 + 0x38) == 0) {
        iVar3 = 0;
      }
      else {
        iVar3 = FUN_140139d70();
      }
      iVar7 = 0;
      if (0 < iVar3) {
        do {
          if (*(longlong *)(lVar4 + 0x38) == 0) {
            uVar6 = 0;
          }
          else {
            uVar6 = FUN_1400d0aa0(*(longlong *)(lVar4 + 0x38),iVar7);
          }
          FUN_1401408f0(local_60,uVar6);
          iVar7 = iVar7 + 1;
        } while (iVar7 < iVar3);
      }
    }
    cVar2 = FUN_140140960(local_60);
  } while( true );
}



longlong FUN_14013c130(undefined8 param_1,longlong param_2,char *param_3)

{
  char cVar1;
  bool bVar2;
  char cVar3;
  int iVar4;
  longlong lVar5;
  char *pcVar6;
  undefined8 uVar7;
  int iVar8;
  longlong lVar9;
  undefined1 local_50 [24];
  undefined1 local_38 [32];
  
  FUN_1401408d0(local_50);
  FUN_1401408d0(local_38);
  FUN_1401408f0(local_50,param_1);
  bVar2 = false;
  if (param_2 == 0) {
    bVar2 = true;
  }
  do {
    cVar3 = FUN_140140960(local_50);
    if (cVar3 == '\0') {
      FUN_1401409c0(local_38);
      FUN_1401409c0(local_50);
      return 0;
    }
    lVar5 = FUN_140140970(local_50);
    if (bVar2) {
      if (*(longlong *)(lVar5 + 0x18) == 0) {
        pcVar6 = "";
      }
      else {
        pcVar6 = (char *)FUN_1400b8b90();
      }
      if (*pcVar6 == *param_3) {
        if (*(longlong *)(lVar5 + 0x18) == 0) {
          pcVar6 = "";
        }
        else {
          pcVar6 = (char *)FUN_1400b8b90();
        }
        lVar9 = (longlong)param_3 - (longlong)pcVar6;
        do {
          cVar3 = *pcVar6;
          cVar1 = pcVar6[lVar9];
          if (cVar3 != cVar1) break;
          pcVar6 = pcVar6 + 1;
        } while (cVar1 != '\0');
        if (cVar3 == cVar1) {
          FUN_1401409c0(local_38);
          FUN_1401409c0(local_50);
          return lVar5;
        }
      }
    }
    else if (lVar5 == param_2) {
      bVar2 = true;
    }
    if ((*(longlong *)(lVar5 + 0x38) != 0) && (iVar4 = FUN_140139d70(), iVar4 != 0)) {
      FUN_1401408f0(local_38,lVar5);
    }
    cVar3 = FUN_140140960(local_50);
    if ((cVar3 == '\0') && (lVar5 = FUN_140140970(local_38), lVar5 != 0)) {
      if (*(longlong *)(lVar5 + 0x38) == 0) {
        iVar4 = 0;
      }
      else {
        iVar4 = FUN_140139d70();
      }
      iVar8 = 0;
      if (0 < iVar4) {
        do {
          if (*(longlong *)(lVar5 + 0x38) == 0) {
            uVar7 = 0;
          }
          else {
            uVar7 = FUN_1400d0aa0(*(longlong *)(lVar5 + 0x38),iVar8);
          }
          FUN_1401408f0(local_50,uVar7);
          iVar8 = iVar8 + 1;
        } while (iVar8 < iVar4);
      }
    }
  } while( true );
}



longlong FUN_14013c310(undefined8 param_1,longlong param_2,char *param_3,undefined8 param_4)

{
  char cVar1;
  bool bVar2;
  char cVar3;
  int iVar4;
  longlong lVar5;
  char *pcVar6;
  undefined1 *puVar7;
  undefined8 uVar8;
  int iVar9;
  longlong lVar10;
  undefined1 local_60 [24];
  undefined1 local_48 [32];
  
  if (param_3 != (char *)0x0) {
    FUN_1401408d0(local_60);
    FUN_1401408d0(local_48);
    FUN_1401408f0(local_60,param_1);
    bVar2 = false;
    if (param_2 == 0) {
      bVar2 = true;
    }
    while (cVar3 = FUN_140140960(local_60), cVar3 != '\0') {
      lVar5 = FUN_140140970(local_60);
      if (bVar2) {
        if (*(longlong *)(lVar5 + 0x18) == 0) {
          pcVar6 = "";
        }
        else {
          pcVar6 = (char *)FUN_1400b8b90();
        }
        if (*pcVar6 == *param_3) {
          lVar10 = (longlong)param_3 - (longlong)pcVar6;
          do {
            cVar3 = *pcVar6;
            cVar1 = pcVar6[lVar10];
            if (cVar3 != cVar1) break;
            pcVar6 = pcVar6 + 1;
          } while (cVar1 != '\0');
          if (cVar3 == cVar1) {
            if (*(longlong *)(lVar5 + 0x28) == 0) {
              puVar7 = &DAT_14027a10a;
            }
            else {
              puVar7 = (undefined1 *)FUN_1400b8b90();
            }
            cVar3 = FUN_1400d11b0(puVar7,param_4,1);
            if (cVar3 != '\0') {
              FUN_1401409c0(local_48);
              FUN_1401409c0(local_60);
              return lVar5;
            }
          }
        }
      }
      else if (lVar5 == param_2) {
        bVar2 = true;
      }
      if ((*(longlong *)(lVar5 + 0x38) != 0) && (iVar4 = FUN_140139d70(), iVar4 != 0)) {
        FUN_1401408f0(local_48,lVar5);
      }
      cVar3 = FUN_140140960(local_60);
      if ((cVar3 == '\0') && (lVar5 = FUN_140140970(local_48), lVar5 != 0)) {
        if (*(longlong *)(lVar5 + 0x38) == 0) {
          iVar4 = 0;
        }
        else {
          iVar4 = FUN_140139d70();
        }
        iVar9 = 0;
        if (0 < iVar4) {
          do {
            if (*(longlong *)(lVar5 + 0x38) == 0) {
              uVar8 = 0;
            }
            else {
              uVar8 = FUN_1400d0aa0(*(longlong *)(lVar5 + 0x38),iVar9);
            }
            FUN_1401408f0(local_60,uVar8);
            iVar9 = iVar9 + 1;
          } while (iVar9 < iVar4);
        }
      }
    }
    FUN_1401409c0(local_48);
    FUN_1401409c0(local_60);
  }
  return 0;
}



undefined8 FUN_14013c510(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined8 *puVar2;
  int iVar3;
  void *pvVar4;
  undefined8 uVar5;
  longlong lVar6;
  int iVar7;
  
  if ((*(longlong *)(param_2 + 0x40) == 0) || (*(longlong *)(param_2 + 0x40) == param_1)) {
    iVar7 = 0;
    puVar2 = *(undefined8 **)(param_2 + 0x10);
    if (puVar2 != (undefined8 *)0x0) {
      iVar7 = *(int *)((longlong)puVar2 + 100);
    }
    if (puVar2 != *(undefined8 **)(param_1 + 0x10)) {
      if (puVar2 != (undefined8 *)0x0) {
        if (*(char *)(puVar2 + 2) == -0x32) {
          (**(code **)*puVar2)(puVar2,1,param_3,param_4,0xfffffffffffffffe);
        }
        *(undefined8 *)(param_2 + 0x10) = 0;
      }
      *(undefined8 *)(param_2 + 0x10) = *(undefined8 *)(param_1 + 0x10);
      if (*(longlong *)(param_1 + 0x38) == 0) {
        if (*(longlong *)(param_1 + 0x50) == 0) {
          pvVar4 = operator_new(0x28);
          uVar5 = 0;
          if (pvVar4 != (void *)0x0) {
            uVar5 = FUN_1400d09e0(pvVar4,5,5);
          }
        }
        else {
          if ((*(longlong *)(*(longlong *)(param_1 + 0x50) + 0x38) == 0) ||
             (iVar3 = FUN_140139d70(), iVar3 == 0)) {
            iVar3 = 5;
          }
          pvVar4 = operator_new(0x28);
          uVar5 = 0;
          if (pvVar4 != (void *)0x0) {
            uVar5 = FUN_1400d09e0(pvVar4,iVar3,5);
          }
        }
        *(undefined8 *)(param_1 + 0x38) = uVar5;
      }
      lVar6 = FUN_1400d0ac0(*(undefined8 *)(param_1 + 0x38));
      if (lVar6 != 0) {
        *(longlong *)(lVar6 + 0x48) = param_2;
      }
      *(longlong *)(param_2 + 0x50) = lVar6;
      *(undefined8 *)(param_2 + 0x48) = 0;
      FUN_1400d0c90(*(undefined8 *)(param_1 + 0x38),param_2);
      *(longlong *)(param_2 + 0x40) = param_1;
      FUN_14013b070(param_2,*(undefined8 *)(param_1 + 0x10));
      piVar1 = (int *)(*(longlong *)(param_1 + 0x10) + 100);
      *piVar1 = *piVar1 + iVar7;
      return 1;
    }
  }
  return 0;
}



undefined8 * FUN_14013c660(char *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  void *pvVar2;
  longlong lVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  puVar1 = operator_new(0x60);
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    FUN_1400d0eb0(puVar1);
    *puVar1 = TreeNode::vftable;
    puVar1[2] = 0;
    puVar1[3] = 0;
    puVar1[4] = 0;
    puVar1[5] = 0;
    *(undefined4 *)(puVar1 + 6) = 0;
    *(undefined1 *)((longlong)puVar1 + 0x34) = 0;
    puVar1[7] = 0;
    puVar1[8] = 0;
    puVar1[9] = 0;
    puVar1[10] = 0;
    *(undefined1 *)(puVar1 + 0xb) = 0xce;
    if ((param_1 != (char *)0x0) && (*param_1 != '\0')) {
      FUN_14013b160(puVar1,param_1,param_3,param_4,uVar4);
    }
  }
  lVar3 = 0;
  pvVar2 = operator_new(0x68);
  if (pvVar2 != (void *)0x0) {
    lVar3 = FUN_14013a590(pvVar2);
  }
  puVar1[2] = lVar3;
  *(undefined8 **)(lVar3 + 0x18) = puVar1;
  return puVar1;
}



undefined8 * FUN_14013c730(longlong param_1,char *param_2)

{
  undefined8 *puVar1;
  
  if (param_1 == 0) {
    puVar1 = (undefined8 *)FUN_14013c660(param_2);
  }
  else {
    puVar1 = operator_new(0x60);
    if (puVar1 != (undefined8 *)0x0) {
      FUN_1400d0eb0(puVar1);
      *puVar1 = TreeNode::vftable;
      puVar1[2] = 0;
      puVar1[3] = 0;
      puVar1[4] = 0;
      puVar1[5] = 0;
      *(undefined4 *)(puVar1 + 6) = 0;
      *(undefined1 *)((longlong)puVar1 + 0x34) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      *(undefined1 *)(puVar1 + 0xb) = 0xce;
      if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
        FUN_14013b160(puVar1,param_2);
      }
    }
    FUN_14013c510(param_1,puVar1,0x3ec);
  }
  return puVar1;
}



void * FUN_14013c800(void *param_1,uint param_2)

{
  FUN_14013b9a0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8
FUN_14013c830(longlong param_1,longlong *param_2,longlong param_3,undefined8 *param_4,char param_5)

{
  char cVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  int iVar5;
  longlong lVar6;
  undefined8 uVar7;
  undefined8 *puVar8;
  undefined1 *puVar9;
  undefined8 *puVar10;
  undefined8 uVar11;
  undefined *puVar12;
  uint uVar13;
  char *pcVar14;
  char *pcVar16;
  longlong *plVar17;
  undefined8 *puVar18;
  bool bVar19;
  void *local_res10;
  longlong local_res18;
  undefined8 *local_res20;
  longlong local_1d0;
  longlong *local_1c8;
  undefined1 local_1c0 [40];
  undefined1 local_198 [48];
  undefined1 local_168 [48];
  undefined1 local_138 [48];
  undefined1 local_108 [48];
  undefined1 local_d8 [48];
  undefined1 local_a8 [48];
  undefined8 local_78;
  undefined1 local_70 [56];
  undefined8 *puVar15;
  
  local_78 = 0xfffffffffffffffe;
  local_res18 = param_3;
  local_res20 = param_4;
  FUN_1400bebf0(&local_1d0);
  plVar17 = &local_1d0;
  if (param_2 != (longlong *)0x0) {
    plVar17 = param_2;
  }
  local_1c8 = plVar17;
  if (param_4 == (undefined8 *)0x0) {
    FUN_1400bec20(&local_1d0);
    uVar7 = 0;
  }
  else {
    *param_4 = 0;
    FUN_1400bcc20(local_168);
    FUN_1400bcc20(local_138);
    FUN_1400bcc20(local_198);
    FUN_1400bce20(local_70,10000);
    puVar10 = (undefined8 *)0x0;
    puVar15 = (undefined8 *)0x0;
    puVar8 = (undefined8 *)0x0;
    FUN_1400d0a70(local_1c0);
    FUN_1400bce20(local_d8,2000);
    FUN_1400bce20(local_108,2000);
    if (param_3 != 0) {
      iVar3 = FUN_1400bbb10(param_1 + 8);
      if (iVar3 < 1) {
        param_3 = 0;
        local_res18 = 0;
      }
      else {
        uVar4 = FUN_1400bbb10(param_1 + 8);
        FUN_140103380(param_3,uVar4);
      }
    }
    FUN_1400bcc20(local_a8);
    if (*(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38)) != '\0') {
      do {
        if (puVar10 == (undefined8 *)0x0) {
          _DAT_140316f08 = 0x45b;
          while( true ) {
            iVar3 = *(int *)(param_1 + 0x40);
            cVar2 = *(char *)((longlong)iVar3 + *(longlong *)(param_1 + 0x38));
            if ((((cVar2 != ' ') && (cVar2 != '\t')) && (cVar2 != '\r')) && (cVar2 != '\n')) break;
            *(int *)(param_1 + 0x40) = iVar3 + 1;
          }
          cVar2 = *(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
          if (cVar2 == '\0') break;
          if (cVar2 != '<') {
            FUN_140106380(param_1,CONCAT71((int7)(int3)((uint)iVar3 >> 8),0x3c));
          }
          if (*(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38)) == '<')
          {
            *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
          }
        }
        else {
          if (param_5 == '\0') {
            _DAT_140316f08 = 0x44f;
            FUN_1400bbe30(local_a8);
            iVar3 = 0;
            uVar7 = FUN_1400bbb20(param_1 + 8,*(undefined4 *)(param_1 + 0x40));
            while( true ) {
              cVar2 = *(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
              if (((cVar2 != ' ') && (cVar2 != '\t')) && ((cVar2 != '\r' && (cVar2 != '\n'))))
              break;
              *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
              iVar3 = iVar3 + 1;
            }
            if (iVar3 != 0) {
              FUN_1400bc8a0(local_a8,uVar7,iVar3);
            }
          }
          else {
            while( true ) {
              cVar2 = *(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
              if (((cVar2 != ' ') && (cVar2 != '\t')) && ((cVar2 != '\r' && (cVar2 != '\n'))))
              break;
              *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
            }
          }
          _DAT_140316f08 = 0x450;
          iVar3 = strncmp((char *)((longlong)*(int *)(param_1 + 0x40) +
                                  *(longlong *)(param_1 + 0x38)),"<![CDATA[",9);
          if (iVar3 != 0) {
            _DAT_140316f08 = 0x454;
            pcVar16 = (char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
            if (*pcVar16 != '<') {
              FUN_140106380(param_1,0x3c);
            }
            pcVar14 = (char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
            if (*pcVar14 == '<') {
              *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
            }
            if (pcVar16 < pcVar14) {
              pcVar14 = pcVar14 + -1;
            }
            if (param_5 != '\0') {
              for (; (pcVar16 < pcVar14 &&
                     ((((cVar2 = *pcVar14, cVar2 == ' ' || (cVar2 == '\t')) || (cVar2 == '\r')) ||
                      (cVar2 == '\n')))); pcVar14 = pcVar14 + -1) {
              }
            }
            if (pcVar14 == pcVar16) {
              if (*pcVar16 != '<') {
                iVar3 = 1;
LAB_14013caeb:
                if (puVar10[5] == 0) {
                  _DAT_140316f08 = 0x459;
                  if (param_5 == '\0') {
                    lVar6 = FUN_1400be710();
                    puVar10[5] = lVar6;
                    if (lVar6 != 0) {
                      FUN_1400bda40(lVar6,local_a8);
                      FUN_1400bc8a0(puVar10[5],pcVar16,iVar3);
                    }
                  }
                  else {
                    local_res10 = operator_new(0x30);
                    uVar7 = 0;
                    if (local_res10 != (void *)0x0) {
                      uVar7 = FUN_1400bcd60(local_res10,pcVar16,iVar3,0x14);
                    }
                    puVar10[5] = uVar7;
                  }
                  lVar6 = puVar10[5];
                  if (lVar6 == 0) goto LAB_14013cc33;
                }
                else {
                  _DAT_140316f08 = 0x458;
                  if (param_5 == '\0') {
                    FUN_1400bda40(puVar10[5],local_a8);
                  }
                  iVar5 = FUN_1400bbb10(puVar10[5]);
                  if (iVar5 != 0) {
                    FUN_1400bbe50(puVar10[5],0x20);
                  }
                  FUN_1400bc8a0(puVar10[5],pcVar16,iVar3);
                  lVar6 = puVar10[5];
                }
                cVar2 = FUN_1400bc610(lVar6,0x26);
                if (cVar2 != '\0') {
                  FUN_1400bd110(puVar10[5],&DAT_14027ba68,&DAT_14027b674);
                  FUN_1400bd110(puVar10[5],"&apos;",&DAT_14027b5d4);
                  FUN_1400bd110(puVar10[5],&DAT_14027ba60,&DAT_14027b5a4);
                  FUN_1400bd110(puVar10[5],"&quot;",&DAT_14027b5c4);
                  FUN_1400bd110(puVar10[5],"&amp;",&DAT_140208d30);
                }
              }
            }
            else {
              iVar3 = ((int)pcVar14 - (int)pcVar16) + 1;
              if (iVar3 != 0) goto LAB_14013caeb;
            }
LAB_14013cc33:
            _DAT_140316f08 = 0x45a;
            iVar3 = strncmp((char *)((longlong)*(int *)(param_1 + 0x40) +
                                    *(longlong *)(param_1 + 0x38)),"![CDATA[",8);
            if (iVar3 != 0) goto LAB_14013cdde;
            *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + -1;
          }
          do {
            _DAT_140316f08 = 0x451;
            *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 9;
            if (puVar10[5] == 0) {
              uVar7 = FUN_1400be770(0x78);
              puVar10[5] = uVar7;
            }
            lVar6 = puVar10[5];
            if (lVar6 == 0) {
              FUN_1400bceb0(local_a8);
              FUN_1400bceb0(local_108);
              FUN_1400bceb0(local_d8);
              FUN_1400d0e10(local_1c0);
              FUN_1400bceb0(local_70);
              FUN_1400bceb0(local_198);
              FUN_1400bceb0(local_138);
              FUN_1400bceb0(local_168);
              FUN_1400bec20(&local_1d0);
              return 0;
            }
            FUN_140106620(param_1,0x5d,lVar6);
            pcVar16 = (char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
            cVar2 = *pcVar16;
            while ((cVar2 != '\0' &&
                   ((_DAT_140316f08 = 0x452, pcVar16[1] != ']' || (pcVar16[2] != '>'))))) {
              FUN_1400bbe50(lVar6,0x5d);
              *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
              FUN_140106620(param_1,0x5d,lVar6);
              pcVar16 = (char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38))
              ;
              cVar2 = *pcVar16;
            }
            _DAT_140316f08 = 0x452;
            *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 3;
            *(undefined1 *)((longlong)puVar10 + 0x34) = 1;
            if (*(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38)) != '<'
               ) {
              FUN_140106380(param_1,0x3c);
            }
            if (*(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38)) != '<'
               ) goto LAB_14013cdde;
            _DAT_140316f08 = 0x453;
            iVar3 = strncmp((char *)((longlong)*(int *)(param_1 + 0x40) +
                                    *(longlong *)(param_1 + 0x38)),"<![CDATA[",9);
          } while (iVar3 == 0);
          *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
        }
LAB_14013cdde:
        lVar6 = *(longlong *)(param_1 + 0x38);
        cVar2 = *(char *)(*(int *)(param_1 + 0x40) + lVar6);
        while( true ) {
          cVar1 = *(char *)(*(int *)(param_1 + 0x40) + lVar6);
          if (((cVar1 != ' ') && (cVar1 != '\t')) && ((cVar1 != '\r' && (cVar1 != '\n')))) break;
          *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
        }
        if (*(char *)(*(int *)(param_1 + 0x40) + lVar6) == '\0') break;
        if (cVar2 == '!') {
          _DAT_140316f08 = 0x45d;
          iVar3 = _strnicmp((char *)((longlong)*(int *)(param_1 + 0x40) +
                                    *(longlong *)(param_1 + 0x38)),"!--",3);
          if (iVar3 == 0) {
            cVar2 = FUN_140106760(param_1,&DAT_14027b698);
            if (cVar2 == '\0') {
              if (plVar17 != (longlong *)0x0) {
                (**(code **)(*plVar17 + 0x28))(plVar17,"Unclosed comment");
              }
              break;
            }
          }
          else {
            iVar3 = _strnicmp((char *)((longlong)*(int *)(param_1 + 0x40) +
                                      *(longlong *)(param_1 + 0x38)),"!DOCTYPE",8);
            if (iVar3 == 0) {
              _DAT_140316f08 = 0x45e;
              FUN_1400bbe50(local_d8,0x3c);
              cVar2 = FUN_140106670(param_1,0x3c,0x3e,1,local_d8);
              if ((cVar2 == '\0') && (plVar17 != (longlong *)0x0)) {
                (**(code **)(*plVar17 + 0x28))(plVar17,"Failed to parse DTD");
              }
              FUN_1400bc640(local_d8,&DAT_14027a10c);
            }
            else {
              _DAT_140316f08 = 0x45f;
              if (*(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38)) !=
                  '>') {
                FUN_140106380(param_1,0x3e);
              }
              if (*(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38)) ==
                  '>') {
                *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
              }
            }
          }
        }
        else if (cVar2 == '?') {
          _DAT_140316f08 = 0x460;
          *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
          iVar3 = _strnicmp((char *)((longlong)*(int *)(param_1 + 0x40) +
                                    *(longlong *)(param_1 + 0x38)),"xml ",4);
          if (iVar3 == 0) {
            FUN_1400bbe30(local_168);
            FUN_1401063e0(param_1,&DAT_14024c620,local_168);
            while( true ) {
              cVar2 = *(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
              if (((cVar2 != ' ') && (cVar2 != '\t')) && ((cVar2 != '\r' && (cVar2 != '\n'))))
              break;
              *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
            }
            if (*(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38)) == '/'
               ) {
              *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
            }
            if ((puVar8 != (undefined8 *)0x0) &&
               (_DAT_140316f08 = 0x461, *(char *)(puVar8 + 0xb) == -0x32)) {
              (**(code **)*puVar8)(puVar8,1);
            }
            _DAT_140316f08 = 0x462;
            uVar7 = FUN_1400b8b90(local_168);
            puVar8 = (undefined8 *)FUN_14013c660(uVar7);
            _DAT_140316f08 = 0x463;
            FUN_14013b1c0(param_1,puVar8,plVar17);
          }
          else {
            iVar3 = _strnicmp((char *)((longlong)*(int *)(param_1 + 0x40) +
                                      *(longlong *)(param_1 + 0x38)),"xml-stylesheet ",0xe);
            if (iVar3 == 0) {
              _DAT_140316f08 = 0x464;
              FUN_1400bbe30(local_168);
              FUN_1401063e0(param_1,&DAT_14024c620,local_168);
              while( true ) {
                cVar2 = *(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38)
                                 );
                if ((((cVar2 != ' ') && (cVar2 != '\t')) && (cVar2 != '\r')) && (cVar2 != '\n'))
                break;
                *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
              }
              if (*(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38)) ==
                  '/') {
                *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
              }
              _DAT_140316f08 = 0x465;
              uVar7 = FUN_1400b8b90(local_168);
              uVar7 = FUN_14013c660(uVar7);
              FUN_1400d0c90(local_1c0,uVar7);
              _DAT_140316f08 = 0x466;
              FUN_14013b1c0(param_1,uVar7,plVar17);
            }
            else {
              _DAT_140316f08 = 0x467;
              FUN_1400bbe50(local_108,0x3c);
              FUN_1401066f0(param_1,&DAT_14027b668,local_108);
              FUN_1400bc640(local_108,&DAT_14027a10c);
            }
          }
        }
        else {
          puVar18 = puVar15;
          if (cVar2 == '/') {
            _DAT_140316f08 = 0x468;
            if (local_res18 != 0) {
              _DAT_140316f08 = 0x46a;
              local_res10 = (void *)((ulonglong)local_res10 & 0xffffffffffffff00);
              FUN_140103370(local_res18,*(undefined4 *)(param_1 + 0x40),&local_res10);
            }
            cVar2 = FUN_1401063b0(param_1,0x3e,0x3c);
            if (cVar2 == '\0') {
              _DAT_140316f08 = 0x46c;
              if (plVar17 != (longlong *)0x0) {
                (**(code **)(*plVar17 + 0x28))(plVar17,"Error in closing tag");
                if (puVar10 == (undefined8 *)0x0) goto LAB_14013d782;
                if (puVar10[3] == 0) {
                  puVar9 = &DAT_14027a10a;
                }
                else {
                  puVar9 = (undefined1 *)FUN_1400b8b90();
                }
                (**(code **)(*plVar17 + 0x58))(plVar17,"error_tag",puVar9);
              }
            }
            else {
              *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
            }
            if (puVar10 != (undefined8 *)0x0) {
              if (puVar10[8] == 0) {
                _DAT_140316f08 = 0x46e;
                *(undefined8 **)(puVar10[2] + 0x20) = puVar8;
                lVar6 = puVar10[2];
                iVar3 = FUN_140139d70(local_1c0);
                iVar5 = 0;
                if (0 < iVar3) {
                  do {
                    uVar7 = FUN_1400d0aa0(local_1c0,iVar5);
                    FUN_1400d0c90(lVar6 + 0x28,uVar7);
                    iVar5 = iVar5 + 1;
                  } while (iVar5 < iVar3);
                }
                FUN_1400d0bf0(local_1c0);
                uVar7 = FUN_1400b8b90(local_d8);
                FUN_14013b4d0(puVar10,uVar7);
                uVar7 = FUN_1400b8b90(local_108);
                FUN_14013b530(puVar10,uVar7);
                puVar8 = (undefined8 *)0x0;
                puVar18 = puVar10;
                if ((puVar15 != (undefined8 *)0x0) && (*(char *)(puVar15 + 0xb) == -0x32)) {
                  _DAT_140316f08 = 0x470;
                  (**(code **)*puVar15)(puVar15,1);
                }
              }
LAB_14013d779:
              puVar10 = (undefined8 *)puVar10[8];
              plVar17 = local_1c8;
              puVar15 = puVar18;
            }
          }
          else {
            _DAT_140316f08 = 0x472;
            FUN_1400bbe30(local_168);
            FUN_1401064e0(param_1," \t\r\n/>>",local_168);
            if (*(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38)) ==
                '\0') break;
            FUN_1400bdd00(local_168,0x3c);
            while( true ) {
              cVar2 = *(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
              if ((((cVar2 != ' ') && (cVar2 != '\t')) && (cVar2 != '\r')) && (cVar2 != '\n'))
              break;
              *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
            }
            bVar19 = *(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38))
                     == '/';
            if (bVar19) {
              *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
            }
            if (puVar10 == (undefined8 *)0x0) {
              _DAT_140316f08 = 0x476;
              uVar7 = FUN_1400b8b90(local_168);
              puVar10 = (undefined8 *)FUN_14013c660(uVar7);
            }
            else {
              _DAT_140316f08 = 0x475;
              uVar7 = FUN_1400b8b90(local_168);
              puVar10 = (undefined8 *)FUN_14013c730(puVar10,uVar7);
            }
            while( true ) {
              cVar2 = *(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
              if (((cVar2 != ' ') && (cVar2 != '\t')) && ((cVar2 != '\r' && (cVar2 != '\n'))))
              break;
              *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
            }
            _DAT_140316f08 = 0x477;
            lVar6 = *(longlong *)(param_1 + 0x38);
            cVar2 = *(char *)(*(int *)(param_1 + 0x40) + lVar6);
            while ((cVar2 != '>' && (*(char *)(*(int *)(param_1 + 0x40) + lVar6) != '\0'))) {
              FUN_1400bbe30(local_138);
              FUN_1400bbe30(local_198);
              _DAT_140316f08 = 0x478;
              FUN_1401064e0(param_1," \t\r\n=/>",local_138);
              FUN_1400bbce0(local_138,0x22,0);
              FUN_1400bbce0(local_138,0x27,0);
              FUN_1400bdd00(local_138,0x3c);
              lVar6 = *(longlong *)(param_1 + 0x38);
              while( true ) {
                cVar2 = *(char *)(*(int *)(param_1 + 0x40) + lVar6);
                if ((((cVar2 != ' ') && (cVar2 != '\t')) && (cVar2 != '\r')) && (cVar2 != '\n'))
                break;
                *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
              }
              iVar3 = *(int *)(param_1 + 0x40);
              if (*(char *)(iVar3 + lVar6) == '=') {
                do {
                  do {
                    iVar3 = iVar3 + 1;
                    *(int *)(param_1 + 0x40) = iVar3;
                    cVar2 = *(char *)(iVar3 + lVar6);
                  } while (cVar2 == ' ');
                } while (((cVar2 == '\t') || (cVar2 == '\r')) || (cVar2 == '\n'));
                _DAT_140316f08 = 0x479;
                cVar2 = *(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38)
                                 );
                if ((cVar2 == '\"') || (cVar2 == '\'')) {
                  *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
                }
                if (cVar2 == '\"') {
                  puVar12 = &DAT_140247fe0;
                }
                else {
                  puVar12 = &DAT_1402456f0;
                  if (cVar2 != '\'') {
                    puVar12 = &DAT_14024c664;
                  }
                }
                FUN_1401065c0(param_1,puVar12,local_198);
                _DAT_140316f08 = 0x47a;
                cVar2 = FUN_1400bc610(local_198,0x26);
                if (cVar2 != '\0') {
                  FUN_1400bd110(local_198,&DAT_14027ba68,&DAT_14027b674);
                  FUN_1400bd110(local_198,&DAT_14027ba60,&DAT_14027b5a4);
                  FUN_1400bd110(local_198,"&quot;",&DAT_14027b5c4);
                  FUN_1400bd110(local_198,"&apos;",&DAT_14027b5d4);
                  FUN_1400bd110(local_198,"&amp;",&DAT_140208d30);
                }
                cVar2 = *(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38)
                                 );
                if ((cVar2 == '\"') || (cVar2 == '\'')) {
                  *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
                }
              }
              _DAT_140316f08 = 0x47b;
              iVar3 = FUN_1400bbb10(local_138);
              if (iVar3 != 0) {
                uVar7 = FUN_1400b8b90(local_198);
                uVar11 = FUN_1400b8b90(local_138);
                FUN_14013acf0(puVar10,uVar11,uVar7);
              }
              lVar6 = *(longlong *)(param_1 + 0x38);
              while( true ) {
                cVar2 = *(char *)(*(int *)(param_1 + 0x40) + lVar6);
                if ((((cVar2 != ' ') && (cVar2 != '\t')) && (cVar2 != '\r')) && (cVar2 != '\n'))
                break;
                *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
              }
              iVar3 = *(int *)(param_1 + 0x40);
              if (*(char *)(iVar3 + lVar6) == '/') {
                bVar19 = true;
                do {
                  do {
                    iVar3 = iVar3 + 1;
                    *(int *)(param_1 + 0x40) = iVar3;
                    cVar2 = *(char *)(iVar3 + lVar6);
                  } while (cVar2 == ' ');
                } while (((cVar2 == '\t') || (cVar2 == '\r')) || (cVar2 == '\n'));
              }
              cVar2 = *(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38));
            }
            if (*(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38)) !=
                '\0') {
              *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
            }
            if (bVar19) {
              if (puVar10[8] == 0) {
                _DAT_140316f08 = 0x47e;
                *(undefined8 **)(puVar10[2] + 0x20) = puVar8;
                lVar6 = puVar10[2];
                iVar3 = FUN_140139d70(local_1c0);
                iVar5 = 0;
                if (0 < iVar3) {
                  do {
                    uVar7 = FUN_1400d0aa0(local_1c0,iVar5);
                    FUN_1400d0c90(lVar6 + 0x28,uVar7);
                    iVar5 = iVar5 + 1;
                  } while (iVar5 < iVar3);
                }
                FUN_1400d0bf0(local_1c0);
                uVar7 = FUN_1400b8b90(local_d8);
                FUN_14013b4d0(puVar10,uVar7);
                uVar7 = FUN_1400b8b90(local_108);
                FUN_14013b530(puVar10,uVar7);
                puVar8 = (undefined8 *)0x0;
                puVar18 = puVar10;
                if ((puVar15 != (undefined8 *)0x0) && (*(char *)(puVar15 + 0xb) == -0x32)) {
                  _DAT_140316f08 = 0x480;
                  (**(code **)*puVar15)(puVar15,1);
                }
              }
              goto LAB_14013d779;
            }
          }
        }
LAB_14013d782:
      } while (*(char *)((longlong)*(int *)(param_1 + 0x40) + *(longlong *)(param_1 + 0x38)) != '\0'
              );
      if (puVar15 == (undefined8 *)0x0) {
        for (; param_3 = local_res18, puVar10 != (undefined8 *)0x0;
            puVar10 = (undefined8 *)puVar10[8]) {
          if (puVar10[8] == 0) {
            _DAT_140316f08 = 0x485;
            *(undefined8 **)(puVar10[2] + 0x20) = puVar8;
            lVar6 = puVar10[2];
            iVar3 = FUN_140139d70(local_1c0);
            puVar8 = (undefined8 *)0x0;
            puVar15 = puVar8;
            if (0 < iVar3) {
              do {
                uVar7 = FUN_1400d0aa0(local_1c0,puVar15);
                FUN_1400d0c90(lVar6 + 0x28,uVar7);
                uVar13 = (int)puVar15 + 1;
                puVar15 = (undefined8 *)(ulonglong)uVar13;
              } while ((int)uVar13 < iVar3);
            }
            FUN_1400d0bf0(local_1c0);
            pcVar16 = (char *)FUN_1400b8b90(local_d8);
            puVar15 = *(undefined8 **)(puVar10[2] + 0x58);
            if (puVar15 != (undefined8 *)0x0) {
              (**(code **)*puVar15)(puVar15,1);
              *(undefined8 *)(puVar10[2] + 0x58) = 0;
            }
            if ((pcVar16 != (char *)0x0) && (*pcVar16 != '\0')) {
              uVar7 = FUN_1400bcbb0(pcVar16);
              *(undefined8 *)(puVar10[2] + 0x58) = uVar7;
            }
            pcVar16 = (char *)FUN_1400b8b90(local_108);
            puVar15 = *(undefined8 **)(puVar10[2] + 0x50);
            if (puVar15 != (undefined8 *)0x0) {
              (**(code **)*puVar15)(puVar15,1);
              *(undefined8 *)(puVar10[2] + 0x50) = 0;
            }
            puVar15 = puVar10;
            if ((pcVar16 != (char *)0x0) && (*pcVar16 != '\0')) {
              uVar7 = FUN_1400bcbb0(pcVar16);
              *(undefined8 *)(puVar10[2] + 0x50) = uVar7;
            }
          }
        }
      }
      else {
        param_3 = local_res18;
        if (((puVar10 != (undefined8 *)0x0) && (puVar15 != puVar10)) &&
           (*(char *)(puVar10 + 0xb) == -0x32)) {
          _DAT_140316f08 = 0x487;
          (**(code **)*puVar10)(puVar10,1);
          param_3 = local_res18;
        }
      }
    }
    if (param_3 != 0) {
      _DAT_140316f08 = 0x488;
      FUN_1401033a0(param_3,0x70);
    }
    *local_res20 = puVar15;
    if ((puVar8 != (undefined8 *)0x0) && (*(char *)(puVar8 + 0xb) == -0x32)) {
      _DAT_140316f08 = 0x48b;
      (**(code **)*puVar8)(puVar8,1);
    }
    _DAT_140316f08 = 0x48c;
    FUN_1400bceb0(local_a8);
    FUN_1400bceb0(local_108);
    FUN_1400bceb0(local_d8);
    FUN_1400d0e10(local_1c0);
    FUN_1400bceb0(local_70);
    FUN_1400bceb0(local_198);
    FUN_1400bceb0(local_138);
    FUN_1400bceb0(local_168);
    FUN_1400bec20(&local_1d0);
    uVar7 = 1;
  }
  return uVar7;
}



undefined1
FUN_14013da50(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 param_5)

{
  undefined1 uVar1;
  undefined8 uVar2;
  undefined1 local_58 [80];
  
  FUN_140106270(local_58);
  uVar2 = FUN_1400b8b90(param_1);
  FUN_1401064a0(local_58,uVar2);
  uVar1 = FUN_14013c830(local_58,param_2,param_3,param_4,param_5);
  FUN_140106360(local_58);
  return uVar1;
}



void FUN_14013daf0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 0x10) != 0) {
    if (*(longlong *)(*(longlong *)(param_1 + 0x10) + 0x20) == 0) {
      uVar2 = FUN_14013c660(&DAT_14024c718);
      *(undefined8 *)(*(longlong *)(param_1 + 0x10) + 0x20) = uVar2;
      FUN_14013acf0(*(undefined8 *)(*(longlong *)(param_1 + 0x10) + 0x20),"version",&DAT_140283d6c);
    }
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x10) + 0x20) + 0x20);
    if (lVar1 != 0) {
      FUN_1401405d0(lVar1,"encoding");
    }
    FUN_14013acf0(*(undefined8 *)(*(longlong *)(param_1 + 0x10) + 0x20),"encoding",param_2);
  }
  return;
}



ulonglong FUN_14013db80(undefined8 param_1,undefined8 param_2,undefined8 param_3,longlong *param_4,
                       undefined1 param_5)

{
  longlong lVar1;
  longlong lVar2;
  char cVar3;
  byte bVar4;
  ulonglong uVar5;
  undefined1 local_b8 [40];
  undefined1 local_90 [48];
  undefined8 local_60;
  undefined1 local_58 [80];
  
  local_60 = 0xfffffffffffffffe;
  FUN_1400b8c40(local_b8);
  cVar3 = FUN_1400ba410(local_b8,param_1,param_2);
  if ((cVar3 != '\0') && (cVar3 = FUN_14013b590(local_b8,param_2), cVar3 != '\0')) {
    FUN_1401062d0(local_58,local_b8);
    bVar4 = FUN_14013c830(local_58,param_2,param_3,param_4,param_5);
    if ((bVar4 != 0) && (lVar1 = *param_4, lVar1 != 0)) {
      FUN_1400bcc20(local_90);
      if (*(longlong *)(lVar1 + 0x10) != 0) {
        lVar2 = *(longlong *)(*(longlong *)(lVar1 + 0x10) + 0x20);
        if ((lVar2 == 0) || (lVar2 = *(longlong *)(lVar2 + 0x20), lVar2 == 0)) {
          cVar3 = '\0';
        }
        else {
          cVar3 = FUN_14013fdb0(lVar2,"encoding",local_90);
        }
        if ((cVar3 != '\0') &&
           (((cVar3 = FUN_1400be010(local_90,&DAT_14024649c), cVar3 != '\0' ||
             (cVar3 = FUN_1400be010(local_90,&DAT_1402479d4), cVar3 != '\0')) ||
            (cVar3 = FUN_1400be010(local_90,"unicode"), cVar3 != '\0')))) {
          FUN_14013daf0(lVar1,&DAT_1402083e0);
        }
      }
      FUN_1400bceb0(local_90);
    }
    FUN_140106360(local_58);
    FUN_1400b92d0(local_b8);
    return (ulonglong)bVar4;
  }
  uVar5 = FUN_1400b92d0(local_b8);
  return uVar5 & 0xffffffffffffff00;
}



void FUN_14013dd10(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  char cVar2;
  undefined8 uVar3;
  undefined1 local_40 [56];
  
  uVar3 = 0xfffffffffffffffe;
  FUN_1400bcc20(local_40);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    lVar1 = *(longlong *)(*(longlong *)(param_1 + 0x10) + 0x20);
    if ((lVar1 == 0) || (lVar1 = *(longlong *)(lVar1 + 0x20), lVar1 == 0)) {
      cVar2 = '\0';
    }
    else {
      cVar2 = FUN_14013fdb0(lVar1,"encoding",local_40,param_4,uVar3);
    }
    if (cVar2 != '\0') goto LAB_14013dd75;
  }
  FUN_14013daf0(param_1,param_2);
LAB_14013dd75:
  FUN_1400bceb0(local_40);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14013dd90(longlong param_1)

{
  int iVar1;
  undefined8 uVar2;
  undefined1 auStack_198 [32];
  undefined8 local_178;
  undefined1 local_168 [336];
  ulonglong local_18;
  
  local_178 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_198;
  iVar1 = FUN_1400bbb10(param_1 + 8);
  if (iVar1 != 0) {
    FUN_1400e2820(local_168);
    uVar2 = FUN_1400b8b90(param_1 + 8);
    FUN_1400e34f0(local_168,uVar2);
    FUN_1400e3530(local_168,param_1 + 0x38);
    FUN_1400e2870(local_168);
  }
  return;
}



void FUN_14013de30(longlong param_1)

{
  FUN_1400bdb00(param_1 + 8);
  FUN_14013dd90(param_1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_14013de50(undefined8 *param_1)

{
  undefined1 auStack_58 [32];
  undefined8 *local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined8 local_20;
  ulonglong local_18;
  
  local_30 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_58;
  *param_1 = AesCrypt::vftable;
  local_38 = param_1;
  FUN_1400bcc20(param_1 + 1);
  FUN_1400b8c40(param_1 + 7);
  FUN_1400b8c40(param_1 + 0xc);
  param_1[0x11] = 0x80;
  *(undefined4 *)(param_1 + 0x12) = 0;
  local_28 = 0;
  local_20 = 0;
  FUN_1400b97e0(param_1 + 0xc,&local_28,0x10);
  FUN_1400b97e0(param_1 + 7,&local_28,0x10);
  return param_1;
}



void FUN_14013df10(undefined8 *param_1)

{
  *param_1 = AesCrypt::vftable;
  FUN_1400b92d0(param_1 + 0xc);
  FUN_1400b92d0(param_1 + 7);
  FUN_1400bceb0(param_1 + 1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14013df60(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  undefined8 uVar1;
  undefined1 auStack_1a8 [32];
  undefined1 local_188 [8];
  undefined8 local_180;
  undefined1 local_178 [336];
  ulonglong local_28;
  
  local_180 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_1a8;
  FUN_1400e2820(local_178);
  FUN_1400e34a0(local_178,*(undefined4 *)(param_1 + 0x88));
  if (*(int *)(param_1 + 0x90) == 0) {
    FUN_1400e3580();
  }
  else {
    FUN_1400e3570(local_178);
  }
  FUN_1400e3560(local_178,*(undefined4 *)(param_1 + 0x8c));
  FUN_1400e3500(local_178,param_1 + 0x38);
  uVar1 = FUN_1400b8b90(param_1 + 0x60);
  FUN_1400e2800(local_178,uVar1);
  FUN_1400bebf0(local_188);
  FUN_1400e51d0(local_178,param_2,param_3,local_188);
  FUN_1400bec20(local_188);
  FUN_1400e2870(local_178);
  return;
}



undefined8 * FUN_14013e050(undefined8 *param_1,uint param_2)

{
  *param_1 = AesCrypt::vftable;
  FUN_1400b92d0(param_1 + 0xc);
  FUN_1400b92d0(param_1 + 7);
  FUN_1400bceb0(param_1 + 1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8
FUN_14013e0b0(undefined8 param_1,int param_2,int param_3,uint param_4,undefined8 param_5,
             longlong *param_6)

{
  undefined8 uVar1;
  ulonglong uVar2;
  uint uVar3;
  undefined1 local_res10;
  undefined1 local_res11;
  
  FUN_1400b8b30(param_5);
  uVar3 = (uint)((param_4 & 7) != 0) + (param_4 >> 3);
  if (uVar3 < param_2 + 0xbU) {
    (**(code **)(*param_6 + 0x28))(param_6,"PKCS v1.5 message length too large");
    FUN_1400cf520(param_6,"MessageLen",param_2);
    FUN_1400cf520(param_6,"ModulusLen",uVar3);
    uVar1 = 0;
  }
  else {
    local_res10 = 0;
    local_res11 = (char)param_3;
    FUN_1400b97e0(param_5,&local_res10,2);
    uVar3 = (uVar3 - param_2) - 3;
    if (param_3 == 2) {
      FUN_1400c0720(uVar3,param_5);
    }
    else if (uVar3 != 0) {
      uVar2 = (ulonglong)uVar3;
      do {
        FUN_1400b9550(param_5,0xff);
        uVar2 = uVar2 - 1;
      } while (uVar2 != 0);
    }
    FUN_1400b9550(param_5,0);
    FUN_1400b97e0(param_5,param_1,param_2);
    uVar1 = 1;
  }
  return uVar1;
}



undefined8
FUN_14013e1c0(char *param_1,uint param_2,int param_3,ulonglong param_4,undefined8 param_5,
             undefined1 *param_6,undefined1 *param_7,longlong *param_8)

{
  char *pcVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  ulonglong uVar5;
  bool bVar6;
  
  *param_6 = 0;
  *param_7 = 0;
  if ((param_1 == (char *)0x0) || (param_2 == 0)) {
    (**(code **)(*param_8 + 0x28))(param_8,"PKCS v1.5 decode NULL input.");
    return 0;
  }
  uVar5 = 0;
  uVar4 = (uint)((param_4 & 7) != 0) + ((uint)(param_4 >> 3) & 0x1fffffff);
  if ((uVar4 < param_2) || (uVar4 < 0xb)) {
    (**(code **)(*param_8 + 0x28))(param_8,"Invalid PKCS v1.5 decode length");
    FUN_1400cf520(param_8,"MessageLen",param_2);
    FUN_1400cf520(param_8,"ModulusLen",uVar4);
    return 0;
  }
  bVar6 = *param_1 != '\0';
  if (bVar6) {
    param_1 = param_1 + -1;
  }
  uVar2 = 2;
  if (param_3 == 2) {
    if (2 < uVar4) {
      pcVar1 = param_1 + 2;
      do {
        if (*pcVar1 == '\0') break;
        uVar2 = uVar2 + 1;
        pcVar1 = pcVar1 + 1;
      } while (uVar2 < uVar4);
    }
    uVar3 = uVar2 - 2;
    if ((uVar4 <= uVar2 + 1) || (uVar3 < 8)) {
      (**(code **)(*param_8 + 0x28))(param_8,"Invalid PKCS v1.5 PS length");
      FUN_1400cf520(param_8,"ps_len",uVar3);
      return 0;
    }
  }
  else {
    if (2 < uVar4 - 1) {
      pcVar1 = param_1 + 2;
      do {
        if (*pcVar1 != -1) break;
        uVar2 = uVar2 + 1;
        pcVar1 = pcVar1 + 1;
      } while (uVar2 < uVar4 - 1);
    }
    if (param_1[uVar2] != '\0') {
      pcVar1 = "Invalid PKCS v1.5 PS separator";
      goto LAB_14013e2c2;
    }
    uVar3 = uVar2 - 2;
  }
  if (6 < uVar3) {
    if ((param_3 == 1) && (uVar3 != 0)) {
      pcVar1 = param_1 + 2;
      do {
        if (*pcVar1 != -1) {
          (**(code **)(*param_8 + 0x28))(param_8,"Invalid PCKS7 padding byte.");
          FUN_1400cf5e0(param_8,"byteValue",param_1[uVar5 + 2]);
          FUN_1400cf520(param_8,&DAT_14024c8cc,uVar5);
          goto LAB_14013e395;
        }
        uVar4 = (int)uVar5 + 1;
        uVar5 = (ulonglong)uVar4;
        pcVar1 = pcVar1 + 1;
      } while (uVar4 < uVar3);
    }
    if (bVar6) {
      param_2 = param_2 + 1;
    }
    FUN_1400b97e0(param_5,param_1 + (uVar3 + 3),(param_2 - uVar3) + -3);
    *param_6 = 1;
    return 1;
  }
  pcVar1 = "ps_len is too short for PKCS1.5 padding.";
LAB_14013e2c2:
  (**(code **)(*param_8 + 0x28))(param_8,pcVar1);
  param_1 = param_1 + bVar6;
LAB_14013e395:
  FUN_1400cf340(param_8,"PkcsData",param_1,param_2);
  return 0;
}



undefined8
FUN_14013e410(uint param_1,undefined4 param_2,void *param_3,uint param_4,uint param_5,
             undefined8 param_6,longlong *param_7)

{
  uint uVar1;
  void *_Dst;
  undefined8 uVar2;
  char *pcVar3;
  ulonglong _Size;
  int iVar4;
  undefined1 local_50 [40];
  
  _Size = (ulonglong)param_4;
  FUN_1400b8b30(param_6);
  if (((param_3 == (void *)0x0) || (param_4 == 0)) || (param_5 == 0)) {
    (**(code **)(*param_7 + 0x28))(param_7,"NULL input param in Mask Generation Function");
    pcVar3 = "MgfError";
  }
  else {
    iVar4 = 0;
    _Dst = operator_new((ulonglong)(param_4 + 0x20));
    if (_Dst != (void *)0x0) {
      memcpy(_Dst,param_3,_Size);
      FUN_1400b8c40(local_50);
      for (; param_5 != 0; param_5 = param_5 - uVar1) {
        *(char *)(_Size + (longlong)_Dst) = (char)((uint)iVar4 >> 0x18);
        *(char *)(_Size + 1 + (longlong)_Dst) = (char)((uint)iVar4 >> 0x10);
        *(char *)(_Size + 2 + (longlong)_Dst) = (char)((uint)iVar4 >> 8);
        *(char *)(_Size + 3 + (longlong)_Dst) = (char)iVar4;
        iVar4 = iVar4 + 1;
        FUN_1400b8b30(local_50);
        FUN_1400c0a70(_Dst,param_4 + 4,param_2,local_50);
        uVar1 = FUN_1400b8b80(local_50);
        if (param_5 < uVar1) {
          uVar1 = param_5;
        }
        uVar2 = FUN_1400b8b90(local_50);
        FUN_1400b97e0(param_6,uVar2,uVar1);
      }
      operator_delete(_Dst);
      FUN_1400b92d0(local_50);
      return 1;
    }
    (**(code **)(*param_7 + 0x28))(param_7,"Memory error");
    pcVar3 = "SeedLen";
    param_1 = param_4;
  }
  FUN_1400cf520(param_7,pcVar3,param_1);
  return 0;
}



undefined8
FUN_14013e5a0(longlong param_1,uint param_2,undefined1 *param_3,int param_4,uint param_5,
             undefined4 param_6,undefined8 param_7,longlong *param_8)

{
  int iVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  int iVar4;
  uint uVar5;
  ulonglong uVar6;
  int iVar7;
  undefined1 local_168 [8];
  undefined1 local_160 [40];
  undefined1 local_138 [40];
  undefined1 local_110 [40];
  undefined1 local_e8 [40];
  undefined1 local_c0 [40];
  undefined1 local_98 [40];
  undefined8 local_70;
  undefined1 local_68 [48];
  
  local_70 = 0xfffffffffffffffe;
  FUN_1400b8b30(param_7);
  if (param_1 == 0) {
    (**(code **)(*param_8 + 0x28))(param_8,"null input to OAEP encoder");
    uVar3 = 0;
  }
  else {
    iVar1 = FUN_1400c0a30(param_6);
    iVar7 = (uint)((param_5 & 7) != 0) + (param_5 >> 3);
    if ((uint)(iVar1 * 2) < iVar7 - 2U) {
      iVar4 = iVar7 + iVar1 * -2;
      if (iVar4 - 2U < param_2) {
        (**(code **)(*param_8 + 0x28))(param_8,"Message length too large for OAEP");
        FUN_1400cf520(param_8,"EncodedLen",iVar7);
        FUN_1400cf520(param_8,"HashLen",iVar1);
        FUN_1400cf520(param_8,"MessageLen",param_2);
        uVar3 = 0;
      }
      else {
        FUN_1400b8c40(local_e8);
        if ((param_3 == (undefined1 *)0x0) || (param_4 == 0)) {
          param_4 = 0;
          param_3 = local_168;
        }
        FUN_1400c0a70(param_3,param_4,param_6,local_e8);
        FUN_1400b8c40(local_160);
        FUN_1400b9e90(local_160,local_e8);
        uVar5 = (iVar4 - param_2) - 2;
        uVar6 = (ulonglong)uVar5;
        if (uVar5 != 0) {
          do {
            FUN_1400b9550(local_160,0);
            uVar6 = uVar6 - 1;
          } while (uVar6 != 0);
        }
        FUN_1400b9550(local_160,1);
        FUN_1400b97e0(local_160,param_1,param_2);
        FUN_1400b8c40(local_138);
        FUN_1400c0600(iVar1,local_138);
        FUN_1400b8c40(local_68);
        uVar2 = FUN_1400b8b80(local_138);
        uVar3 = FUN_1400b8b90(local_138);
        FUN_14013e410(100,param_6,uVar3,uVar2,(iVar7 - iVar1) + -1,local_68,param_8);
        FUN_1400b8c40(local_110);
        FUN_1400ba730(local_110,local_160,local_68);
        FUN_1400b8c40(local_98);
        uVar2 = FUN_1400b8b80(local_110);
        uVar3 = FUN_1400b8b90(local_110);
        FUN_14013e410(0x65,param_6,uVar3,uVar2,iVar1,local_98,param_8);
        FUN_1400b8c40(local_c0);
        FUN_1400ba730(local_c0,local_138,local_98);
        FUN_1400b9550(param_7,0);
        FUN_1400b9e90(param_7,local_c0);
        FUN_1400b9e90(param_7,local_110);
        iVar1 = FUN_1400b8b80(param_7);
        if (iVar1 == iVar7) {
          FUN_1400b92d0(local_c0);
          FUN_1400b92d0(local_98);
          FUN_1400b92d0(local_110);
          FUN_1400b92d0(local_68);
          FUN_1400b92d0(local_138);
          FUN_1400b92d0(local_160);
          FUN_1400b92d0(local_e8);
          uVar3 = 1;
        }
        else {
          (**(code **)(*param_8 + 0x28))(param_8,"OAEP encoding output size error");
          uVar2 = FUN_1400b8b80(param_7);
          FUN_1400cf520(param_8,"OutputSize",uVar2);
          FUN_1400cf520(param_8,"ExpectedSize",iVar7);
          FUN_1400b8b30(param_7);
          FUN_1400b92d0(local_c0);
          FUN_1400b92d0(local_98);
          FUN_1400b92d0(local_110);
          FUN_1400b92d0(local_68);
          FUN_1400b92d0(local_138);
          FUN_1400b92d0(local_160);
          FUN_1400b92d0(local_e8);
          uVar3 = 0;
        }
      }
    }
    else {
      (**(code **)(*param_8 + 0x28))
                (param_8,"Encoded message size too small given hash size in OAEP");
      FUN_1400cf520(param_8,"EncodedLen",iVar7);
      FUN_1400cf520(param_8,"HashLen",iVar1);
      uVar3 = 0;
    }
  }
  return uVar3;
}



undefined8
FUN_14013e970(char *param_1,int param_2,undefined4 *param_3,int param_4,uint param_5,
             undefined4 param_6,undefined8 param_7,longlong *param_8)

{
  undefined4 uVar1;
  longlong *plVar2;
  uint uVar3;
  int iVar4;
  undefined8 uVar5;
  void *_Buf2;
  void *_Buf1;
  longlong lVar6;
  uint uVar7;
  ulonglong uVar8;
  char *pcVar9;
  int iVar10;
  uint uVar11;
  undefined1 local_148 [40];
  undefined1 local_120 [40];
  undefined1 local_f8 [40];
  undefined1 local_d0 [40];
  undefined1 local_a8 [40];
  undefined1 local_80 [40];
  undefined1 local_58 [40];
  undefined8 local_30;
  
  uVar1 = param_6;
  local_30 = 0xfffffffffffffffe;
  iVar10 = (uint)((param_5 & 7) != 0) + (param_5 >> 3);
  uVar3 = FUN_1400c0a30(param_6);
  plVar2 = param_8;
  if ((uVar3 * 2 < iVar10 - 2U) && (param_2 == iVar10)) {
    if (*param_1 == '\0') {
      FUN_1400b8c40(local_58);
      FUN_1400b97e0(local_58,param_1 + 1,uVar3);
      FUN_1400b8c40(local_148);
      uVar11 = (iVar10 - uVar3) - 1;
      FUN_1400b97e0(local_148,param_1 + (uVar3 + 1),uVar11);
      FUN_1400b8c40(local_80);
      uVar5 = FUN_1400b8b90(local_148);
      plVar2 = param_8;
      FUN_14013e410(0x68,uVar1,uVar5,uVar11,uVar3,local_80,param_8);
      FUN_1400b8c40(local_a8);
      FUN_1400ba730(local_a8,local_58,local_80);
      FUN_1400b8c40(local_d0);
      uVar5 = FUN_1400b8b90(local_a8);
      FUN_14013e410(0x69,uVar1,uVar5,uVar3,uVar11,local_d0,plVar2);
      FUN_1400b8c40(local_f8);
      FUN_1400ba730(local_f8,local_148,local_d0);
      FUN_1400b8c40(local_120);
      if ((param_3 == (undefined4 *)0x0) || (param_4 == 0)) {
        param_4 = 0;
        param_3 = &param_5;
      }
      FUN_1400c0a70(param_3,param_4,uVar1,local_120);
      _Buf2 = (void *)FUN_1400b8b90(local_120);
      _Buf1 = (void *)FUN_1400b8b90(local_f8);
      iVar4 = memcmp(_Buf1,_Buf2,(ulonglong)uVar3);
      if (iVar4 == 0) {
        lVar6 = FUN_1400b8b90(local_f8);
        uVar8 = (ulonglong)uVar3;
        if (uVar3 < uVar11) {
          pcVar9 = (char *)((int)uVar3 + lVar6);
          do {
            if (*pcVar9 != '\0') break;
            uVar7 = (int)uVar8 + 1;
            uVar8 = (ulonglong)uVar7;
            pcVar9 = pcVar9 + 1;
          } while (uVar7 < uVar11);
        }
        uVar7 = (uint)uVar8;
        if ((uVar7 != uVar11) && (*(char *)(uVar8 + lVar6) == '\x01')) {
          iVar10 = ((iVar10 - uVar7) - uVar3) + -2;
          if (iVar10 != 0) {
            FUN_1400b97e0(param_7,(ulonglong)(uVar7 + 1) + lVar6,iVar10);
          }
          FUN_1400b92d0(local_120);
          FUN_1400b92d0(local_f8);
          FUN_1400b92d0(local_d0);
          FUN_1400b92d0(local_a8);
          FUN_1400b92d0(local_80);
          FUN_1400b92d0(local_148);
          FUN_1400b92d0(local_58);
          return 1;
        }
        (**(code **)(*plVar2 + 0x28))(plVar2,"0x01 byte not found in OAEP padding");
        FUN_1400b92d0(local_120);
        FUN_1400b92d0(local_f8);
        FUN_1400b92d0(local_d0);
        FUN_1400b92d0(local_a8);
        FUN_1400b92d0(local_80);
        FUN_1400b92d0(local_148);
        FUN_1400b92d0(local_58);
      }
      else {
        (**(code **)(*plVar2 + 0x28))(plVar2,"OAEP padding hash mismatch");
        FUN_1400b92d0(local_120);
        FUN_1400b92d0(local_f8);
        FUN_1400b92d0(local_d0);
        FUN_1400b92d0(local_a8);
        FUN_1400b92d0(local_80);
        FUN_1400b92d0(local_148);
        FUN_1400b92d0(local_58);
      }
    }
    else {
      (**(code **)(*param_8 + 0x28))(param_8,"No leading zero byte for OAEP decoding.");
    }
  }
  else {
    (**(code **)(*param_8 + 0x28))(param_8,"Invalid OAEP hash / message size");
    FUN_1400cf520(plVar2,"MessageLen",param_2);
    FUN_1400cf520(plVar2,"HashLen",uVar3);
    FUN_1400cf520(plVar2,"ModulusLen",iVar10);
  }
  return 0;
}



undefined1
FUN_14013ed30(undefined8 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7,longlong *param_8)

{
  undefined1 uVar1;
  
  (**(code **)(*param_8 + 0x48))(param_8,"Pkcs1_5_decode",1);
  uVar1 = FUN_14013e1c0(param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8);
  (**(code **)(*param_8 + 0x50))(param_8);
  return uVar1;
}



void FUN_14013ede0(undefined8 param_1,void *param_2,int *param_3,longlong param_4,byte *param_5,
                  uint param_6,int param_7,int param_8)

{
  byte bVar1;
  int iVar2;
  int *piVar3;
  int *piVar4;
  byte *pbVar5;
  longlong lVar6;
  int iVar7;
  longlong lVar8;
  uint uVar9;
  longlong lVar10;
  longlong lVar11;
  
  lVar11 = (longlong)(int)param_6;
  lVar10 = (longlong)param_7;
  lVar6 = (longlong)param_8;
  iVar7 = 0;
  lVar8 = 0;
  for (uVar9 = param_6; (int)uVar9 <= param_7; uVar9 = uVar9 + 1) {
    iVar2 = 0;
    pbVar5 = param_5;
    if (0 < param_8) {
      do {
        if (*pbVar5 == uVar9) {
          *(int *)(param_4 + lVar8 * 4) = iVar2;
          lVar8 = lVar8 + 1;
        }
        iVar2 = iVar2 + 1;
        pbVar5 = pbVar5 + 1;
      } while (iVar2 < param_8);
    }
  }
  memset(param_3,0,0x5c);
  if (0 < param_8) {
    do {
      bVar1 = *param_5;
      param_5 = param_5 + 1;
      param_3[(ulonglong)bVar1 + 1] = param_3[(ulonglong)bVar1 + 1] + 1;
      lVar6 = lVar6 + -1;
    } while (lVar6 != 0);
  }
  lVar8 = 0xb;
  piVar4 = param_3;
  do {
    piVar3 = piVar4 + 2;
    piVar4[1] = piVar4[1] + *piVar4;
    *piVar3 = *piVar3 + piVar4[1];
    lVar8 = lVar8 + -1;
    piVar4 = piVar3;
  } while (lVar8 != 0);
  memset(param_2,0,0x5c);
  if (lVar11 <= lVar10) {
    lVar8 = (lVar10 - lVar11) + 1;
    piVar4 = param_3 + lVar11;
    do {
      iVar2 = iVar7 + (piVar4[1] - *piVar4);
      iVar7 = iVar2 * 2;
      lVar8 = lVar8 + -1;
      *(int *)((longlong)param_2 + (-4 - (longlong)param_3) + (longlong)(piVar4 + 1)) = iVar2 + -1;
      piVar4 = piVar4 + 1;
    } while (lVar8 != 0);
  }
  lVar8 = (longlong)(int)(param_6 + 1);
  if (lVar8 <= lVar10) {
    lVar6 = (lVar10 - lVar8) + 1;
    piVar4 = param_3 + lVar8;
    do {
      lVar6 = lVar6 + -1;
      *piVar4 = (*(int *)((longlong)param_2 + (-4 - (longlong)param_3) + (longlong)piVar4) * 2 + 2)
                - *piVar4;
      piVar4 = piVar4 + 1;
    } while (lVar6 != 0);
  }
  return;
}



undefined8 FUN_14013ef50(longlong param_1)

{
  longlong lVar1;
  
  while (param_1 != 0) {
    lVar1 = *(longlong *)(param_1 + -8);
    operator_delete((void *)(param_1 + -0x10));
    param_1 = lVar1;
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_14013ef90(undefined8 param_1,uint *param_2,uint param_3,uint param_4,longlong param_5,
             longlong param_6,ulonglong *param_7,uint *param_8)

{
  uint *puVar1;
  undefined1 auVar2 [16];
  undefined2 uVar3;
  uint *puVar4;
  undefined8 uVar5;
  __uint64 _Var6;
  void *pvVar7;
  ulonglong *puVar8;
  uint uVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  uint uVar13;
  uint uVar14;
  uint uVar15;
  int iVar16;
  ulonglong uVar17;
  ulonglong uVar18;
  ulonglong uVar19;
  longlong lVar20;
  longlong lVar21;
  byte bVar22;
  uint uVar23;
  uint uVar24;
  undefined1 auStack_6b8 [32];
  uint local_698;
  uint local_694;
  uint local_690;
  char local_688;
  char cStack_687;
  undefined6 uStack_686;
  ulonglong local_680;
  int local_678;
  uint *local_670;
  uint local_668;
  uint local_664;
  int local_660;
  ulonglong *local_658;
  uint *local_650;
  uint *local_648;
  uint *local_640;
  ulonglong local_638 [16];
  uint local_5b8 [20];
  uint local_568 [20];
  uint local_518 [20];
  uint local_4c8 [288];
  ulonglong local_48;
  ulonglong uVar12;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_6b8;
  local_658 = param_7;
  local_650 = param_8;
  DAT_1403183e8 = 0;
  local_668 = param_3;
  local_664 = param_4;
  memset(local_5b8,0,0x44);
  memset(local_568,0,0x44);
  memset(local_518,0,0x44);
  memset(local_638,0,0x80);
  memset(local_4c8,0,0x480);
  puVar4 = param_2;
  uVar13 = param_3;
  if (param_3 < 0x101) {
    uVar24 = 0x10;
  }
  else {
    uVar24 = param_2[0x100];
  }
  do {
    puVar1 = local_5b8 + *puVar4;
    *puVar1 = *puVar1 + 1;
    uVar13 = uVar13 - 1;
    puVar4 = puVar4 + 1;
  } while (uVar13 != 0);
  if (local_5b8[0] == param_3) {
    uVar5 = 0;
    *param_7 = 0;
    *param_8 = 0;
  }
  else {
    uVar10 = 1;
    do {
      if (local_5b8[uVar10] != 0) break;
      uVar13 = (int)uVar10 + 1;
      uVar10 = (ulonglong)uVar13;
    } while (uVar13 < 0x11);
    local_698 = (uint)uVar10;
    uVar14 = 0x10;
    uVar13 = *param_8;
    if (*param_8 < local_698) {
      uVar13 = local_698;
    }
    *param_8 = uVar13;
    puVar4 = local_5b8 + 0x10;
    do {
      if (*puVar4 != 0) break;
      puVar4 = puVar4 + -1;
      uVar14 = uVar14 - 1;
    } while (uVar14 != 0);
    uVar13 = *param_8;
    if (uVar14 < *param_8) {
      uVar13 = uVar14;
    }
    local_660 = 1 << ((byte)uVar10 & 0x1f);
    *param_8 = uVar13;
    uVar11 = uVar10;
    uVar13 = local_698;
    while (uVar13 < uVar14) {
      local_660 = local_660 - local_5b8[uVar11];
      if (local_660 < 0) goto LAB_14013f109;
      uVar13 = (int)uVar11 + 1;
      uVar11 = (ulonglong)uVar13;
      local_660 = local_660 * 2;
    }
    uVar13 = local_5b8[uVar14];
    local_660 = local_660 - uVar13;
    if (local_660 < 0) {
LAB_14013f109:
      uVar5 = 2;
    }
    else {
      uVar19 = 0;
      local_5b8[uVar14] = uVar13 + local_660;
      local_568[1] = 0;
      uVar11 = uVar19;
      uVar12 = uVar19;
      uVar13 = uVar14;
      while (uVar13 = uVar13 - 1, uVar17 = uVar19, uVar13 != 0) {
        uVar9 = (int)uVar12 + *(int *)((longlong)local_5b8 + uVar11 + 4);
        uVar12 = (ulonglong)uVar9;
        *(uint *)((longlong)local_568 + uVar11 + 8) = uVar9;
        uVar11 = uVar11 + 4;
      }
      do {
        uVar13 = *param_2;
        param_2 = param_2 + 1;
        if (uVar13 != 0) {
          uVar9 = local_568[uVar13];
          local_4c8[uVar9] = (uint)uVar17;
          local_568[uVar13] = uVar9 + 1;
        }
        uVar13 = (uint)uVar17 + 1;
        uVar17 = (ulonglong)uVar13;
      } while (uVar13 < param_3);
      puVar4 = local_4c8;
      local_568[0] = 0;
      local_518[0] = 0;
      local_638[0] = 0;
      local_678 = -1;
      lVar20 = -1;
      uVar11 = uVar19;
      uVar12 = uVar19;
      uVar17 = uVar19;
      local_690 = uVar14;
      local_670 = puVar4;
      if ((int)local_698 <= (int)uVar14) {
        do {
          iVar16 = (int)uVar10;
          local_640 = local_5b8 + iVar16;
          local_694 = *local_640;
          if (local_694 != 0) {
            local_648 = local_4c8 + local_668;
            do {
              local_694 = local_694 - 1;
              uVar9 = local_518[lVar20 + 1] + (int)uVar19;
              uVar13 = (uint)uVar12;
              lVar21 = lVar20;
              if ((int)uVar9 < (int)uVar10) {
                do {
                  local_678 = local_678 + 1;
                  lVar20 = lVar21 + 1;
                  uVar19 = (ulonglong)uVar9;
                  uVar23 = uVar14 - uVar9;
                  if (*local_650 < uVar14 - uVar9) {
                    uVar23 = *local_650;
                  }
                  uVar14 = (int)uVar10 - uVar9;
                  uVar15 = 1 << ((byte)uVar14 & 0x1f);
                  if (local_694 + 1 < uVar15) {
                    iVar16 = uVar15 + (-1 - local_694);
                    puVar4 = local_640;
                    while (uVar14 = uVar14 + 1, uVar14 < uVar23) {
                      puVar1 = puVar4 + 1;
                      puVar4 = puVar4 + 1;
                      if ((uint)(iVar16 * 2) <= *puVar1) break;
                      iVar16 = iVar16 * 2 - *puVar1;
                    }
                  }
                  if ((uVar24 < uVar9 + uVar14) && (uVar9 < uVar24)) {
                    uVar14 = uVar24 - uVar9;
                  }
                  uVar23 = 1 << ((byte)uVar14 & 0x1f);
                  uVar17 = (ulonglong)uVar23;
                  local_518[lVar21 + 2] = uVar14;
                  auVar2 = ZEXT816(0x10) * ZEXT416(uVar23 + 1);
                  _Var6 = auVar2._0_8_;
                  if (auVar2._8_8_ != 0) {
                    _Var6 = 0xffffffffffffffff;
                  }
                  pvVar7 = operator_new(_Var6);
                  uVar11 = (longlong)pvVar7 + 0x10;
                  puVar8 = (ulonglong *)((longlong)pvVar7 + 8);
                  *local_658 = uVar11;
                  *puVar8 = 0;
                  local_638[lVar20] = uVar11;
                  if (lVar20 != 0) {
                    cStack_687 = (char)local_518[lVar20];
                    local_688 = (byte)uVar14 + 0x10;
                    uVar18 = ((1 << ((byte)uVar9 & 0x1f)) - 1 & uVar12) >>
                             ((byte)uVar9 - (char)local_518[lVar20] & 0x3f);
                    uVar10 = local_638[lVar21];
                    local_568[lVar20] = uVar13;
                    *(ulonglong *)(uVar10 + uVar18 * 0x10) =
                         CONCAT62(uStack_686,CONCAT11(cStack_687,local_688));
                    *(ulonglong *)(uVar10 + 8 + uVar18 * 0x10) = uVar11;
                    local_680 = uVar11;
                  }
                  uVar10 = (ulonglong)local_698;
                  uVar9 = local_518[lVar21 + 2] + uVar9;
                  puVar4 = local_670;
                  lVar21 = lVar20;
                  local_658 = puVar8;
                  uVar14 = local_690;
                } while ((int)uVar9 < (int)local_698);
              }
              bVar22 = (byte)uVar19;
              cStack_687 = (char)uVar10 - bVar22;
              if (puVar4 < local_648) {
                uVar14 = *puVar4;
                if (uVar14 < local_664) {
                  local_688 = (uVar14 < 0x100) + '\x0f';
                  uVar3 = (undefined2)*puVar4;
                }
                else {
                  if ((param_6 == 0) || (param_5 == 0)) {
                    DAT_1403183e8 = 1;
                    return 0;
                  }
                  local_688 = *(char *)(param_6 + (ulonglong)(uVar14 - local_664) * 2);
                  uVar3 = *(undefined2 *)(param_5 + (ulonglong)(uVar14 - local_664) * 2);
                }
                local_670 = puVar4 + 1;
                local_680 = CONCAT62(local_680._2_6_,uVar3);
              }
              else {
                local_688 = 'c';
              }
              uVar14 = uVar13 >> (bVar22 & 0x1f);
              if (uVar14 < (uint)uVar17) {
                do {
                  uVar18 = (ulonglong)uVar14;
                  uVar14 = uVar14 + (1 << ((char)uVar10 - bVar22 & 0x1f));
                  *(ulonglong *)(uVar11 + uVar18 * 0x10) =
                       CONCAT62(uStack_686,CONCAT11(cStack_687,local_688));
                  *(ulonglong *)(uVar11 + 8 + uVar18 * 0x10) = local_680;
                } while (uVar14 < (uint)uVar17);
                uVar10 = (ulonglong)local_698;
              }
              iVar16 = (int)uVar10;
              uVar9 = 1 << ((char)uVar10 - 1U & 0x1f);
              uVar14 = uVar13 & uVar9;
              while (uVar14 != 0) {
                uVar13 = (uint)uVar12 ^ uVar9;
                uVar12 = (ulonglong)uVar13;
                uVar9 = uVar9 >> 1;
                uVar14 = uVar13 & uVar9;
              }
              uVar13 = uVar13 ^ uVar9;
              uVar12 = (ulonglong)uVar13;
              if (((1 << (bVar22 & 0x1f)) - 1U & uVar13) != local_568[lVar20]) {
                do {
                  uVar14 = (int)uVar19 - local_518[lVar20];
                  uVar19 = (ulonglong)uVar14;
                  lVar20 = lVar20 + -1;
                  local_678 = local_678 + -1;
                } while (((1 << ((byte)uVar14 & 0x1f)) - 1U & uVar13) != local_568[lVar20]);
              }
              puVar4 = local_670;
              uVar14 = local_690;
            } while (local_694 != 0);
          }
          local_698 = iVar16 + 1;
          uVar10 = (ulonglong)local_698;
        } while ((int)local_698 <= (int)uVar14);
      }
      uVar5 = 1;
      *local_650 = local_518[1];
      if ((local_660 == 0) || (uVar14 == 1)) {
        uVar5 = 0;
      }
    }
  }
  return uVar5;
}



undefined8 * FUN_14013f4c0(undefined8 *param_1)

{
  undefined1 auVar1 [16];
  undefined1 auVar2 [16];
  __uint64 _Var3;
  void *pvVar4;
  
  *param_1 = CircBuf::vftable;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 0;
  *(undefined4 *)((longlong)param_1 + 0x34) = 0;
  param_1[7] = 0;
  param_1[8] = 0;
  *(undefined4 *)(param_1 + 9) = 0;
  *(undefined4 *)(param_1 + 1) = 400;
  _Var3 = SUB168(ZEXT816(4) * ZEXT816(400),0);
  if (SUB168(ZEXT816(4) * ZEXT816(400),8) != 0) {
    _Var3 = 0xffffffffffffffff;
  }
  pvVar4 = operator_new(_Var3);
  param_1[2] = pvVar4;
  auVar1._8_8_ = 0;
  auVar1._0_8_ = (longlong)*(int *)(param_1 + 1);
  _Var3 = SUB168(ZEXT816(4) * auVar1,0);
  if (SUB168(ZEXT816(4) * auVar1,8) != 0) {
    _Var3 = 0xffffffffffffffff;
  }
  pvVar4 = operator_new(_Var3);
  param_1[3] = pvVar4;
  auVar2._8_8_ = 0;
  auVar2._0_8_ = (longlong)*(int *)(param_1 + 1);
  _Var3 = SUB168(ZEXT816(8) * auVar2,0);
  if (SUB168(ZEXT816(8) * auVar2,8) != 0) {
    _Var3 = 0xffffffffffffffff;
  }
  pvVar4 = operator_new(_Var3);
  param_1[4] = pvVar4;
  memset((void *)param_1[2],0,(longlong)*(int *)(param_1 + 1) << 2);
  memset((void *)param_1[3],0,(longlong)*(int *)(param_1 + 1) << 2);
  memset((void *)param_1[4],0,(longlong)*(int *)(param_1 + 1) << 3);
  return param_1;
}



ulonglong FUN_14013f5a0(longlong param_1,uint param_2,uint *param_3)

{
  int iVar1;
  uint uVar2;
  ulonglong in_RAX;
  uint uVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  
  uVar5 = 0;
  *param_3 = 0;
  iVar1 = *(int *)(param_1 + 0x2c);
  if (*(int *)(param_1 + 0x34) != iVar1) {
    uVar3 = *(int *)(*(longlong *)(param_1 + 0x18) + (longlong)iVar1 * 4) - *(int *)(param_1 + 0x30)
    ;
    if ((uVar3 != 0) && (7 < *(uint *)(param_1 + 0x48))) {
      uVar3 = uVar3 - 1;
    }
    in_RAX = (longlong)iVar1;
    if (param_2 <= uVar3) {
LAB_14013f5e4:
      return CONCAT71((int7)(in_RAX >> 8),1);
    }
    in_RAX = (ulonglong)(iVar1 + 1U);
    if (iVar1 + 1U == *(uint *)(param_1 + 8)) {
      in_RAX = uVar5;
    }
    iVar1 = (int)in_RAX;
    uVar4 = (ulonglong)iVar1;
    while (iVar1 != *(int *)(param_1 + 0x34)) {
      uVar3 = uVar3 + *(int *)(*(longlong *)(param_1 + 0x18) + uVar4 * 4);
      if (param_2 <= uVar3) goto LAB_14013f5e4;
      uVar2 = (int)in_RAX + 1;
      in_RAX = (ulonglong)uVar2;
      uVar4 = uVar4 + 1;
      if (uVar2 == *(uint *)(param_1 + 8)) {
        in_RAX = uVar5;
        uVar4 = uVar5;
      }
      iVar1 = (int)in_RAX;
    }
    *param_3 = uVar3;
  }
  return in_RAX & 0xffffffffffffff00;
}



ulonglong FUN_14013f640(longlong param_1,uint param_2)

{
  int iVar1;
  uint uVar2;
  ulonglong in_RAX;
  ulonglong uVar3;
  uint uVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  
  iVar1 = *(int *)(param_1 + 0x2c);
  if (*(int *)(param_1 + 0x34) == iVar1) {
    return in_RAX & 0xffffffffffffff00;
  }
  uVar4 = *(int *)(*(longlong *)(param_1 + 0x18) + (longlong)iVar1 * 4) - *(int *)(param_1 + 0x30);
  if ((uVar4 != 0) && (7 < *(uint *)(param_1 + 0x48))) {
    uVar4 = uVar4 - 1;
  }
  if (uVar4 < param_2) {
    uVar6 = 0;
    uVar3 = (ulonglong)(iVar1 + 1U);
    if (iVar1 + 1U == *(uint *)(param_1 + 8)) {
      uVar3 = uVar6;
    }
    iVar1 = (int)uVar3;
    uVar5 = (ulonglong)iVar1;
    while( true ) {
      if (iVar1 == *(int *)(param_1 + 0x34)) {
        return uVar3 & 0xffffffffffffff00;
      }
      uVar4 = uVar4 + *(int *)(*(longlong *)(param_1 + 0x18) + uVar5 * 4);
      if (param_2 <= uVar4) break;
      uVar2 = (int)uVar3 + 1;
      uVar3 = (ulonglong)uVar2;
      uVar5 = uVar5 + 1;
      if (uVar2 == *(uint *)(param_1 + 8)) {
        uVar3 = uVar6;
        uVar5 = uVar6;
      }
      iVar1 = (int)uVar3;
    }
    return CONCAT71((int7)(uVar3 >> 8),1);
  }
  return CONCAT71((int7)(int3)((uint)iVar1 >> 8),1);
}



void FUN_14013f6e0(longlong param_1)

{
  undefined1 auVar1 [16];
  undefined1 auVar2 [16];
  __uint64 _Var3;
  void *pvVar4;
  ulonglong uVar5;
  uint uVar6;
  ulonglong uVar7;
  
  uVar5 = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined4 *)(param_1 + 0x48) = 0;
  uVar7 = uVar5;
  if (0 < *(int *)(param_1 + 8)) {
    do {
      operator_delete(*(void **)(*(longlong *)(param_1 + 0x20) + uVar5));
      uVar6 = (int)uVar7 + 1;
      uVar5 = uVar5 + 8;
      uVar7 = (ulonglong)uVar6;
    } while ((int)uVar6 < *(int *)(param_1 + 8));
  }
  operator_delete(*(void **)(param_1 + 0x10));
  operator_delete(*(void **)(param_1 + 0x18));
  operator_delete(*(void **)(param_1 + 0x20));
  *(undefined4 *)(param_1 + 8) = 400;
  *(undefined8 *)(param_1 + 0x18) = 0;
  _Var3 = SUB168(ZEXT816(4) * ZEXT816(400),0);
  if (SUB168(ZEXT816(4) * ZEXT816(400),8) != 0) {
    _Var3 = 0xffffffffffffffff;
  }
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x2c) = 0;
  *(undefined4 *)(param_1 + 0x34) = 0;
  pvVar4 = operator_new(_Var3);
  *(void **)(param_1 + 0x10) = pvVar4;
  auVar1._8_8_ = 0;
  auVar1._0_8_ = (longlong)*(int *)(param_1 + 8);
  _Var3 = SUB168(ZEXT816(4) * auVar1,0);
  if (SUB168(ZEXT816(4) * auVar1,8) != 0) {
    _Var3 = 0xffffffffffffffff;
  }
  pvVar4 = operator_new(_Var3);
  *(void **)(param_1 + 0x18) = pvVar4;
  auVar2._8_8_ = 0;
  auVar2._0_8_ = (longlong)*(int *)(param_1 + 8);
  _Var3 = SUB168(ZEXT816(8) * auVar2,0);
  if (SUB168(ZEXT816(8) * auVar2,8) != 0) {
    _Var3 = 0xffffffffffffffff;
  }
  pvVar4 = operator_new(_Var3);
  *(void **)(param_1 + 0x20) = pvVar4;
  memset(*(void **)(param_1 + 0x10),0,(longlong)*(int *)(param_1 + 8) << 2);
  memset(*(void **)(param_1 + 0x18),0,(longlong)*(int *)(param_1 + 8) << 2);
  memset(*(void **)(param_1 + 0x20),0,(longlong)*(int *)(param_1 + 8) << 3);
  return;
}



void FUN_14013f810(undefined8 *param_1)

{
  ulonglong uVar1;
  uint uVar2;
  ulonglong uVar3;
  
  uVar1 = 0;
  *param_1 = CircBuf::vftable;
  param_1[7] = 0;
  param_1[8] = 0;
  *(undefined4 *)(param_1 + 9) = 0;
  uVar3 = uVar1;
  if (0 < *(int *)(param_1 + 1)) {
    do {
      operator_delete(*(void **)(uVar3 + param_1[4]));
      uVar2 = (int)uVar1 + 1;
      uVar1 = (ulonglong)uVar2;
      uVar3 = uVar3 + 8;
    } while ((int)uVar2 < *(int *)(param_1 + 1));
  }
  operator_delete((void *)param_1[2]);
  operator_delete((void *)param_1[3]);
  operator_delete((void *)param_1[4]);
  param_1[3] = 0;
  param_1[2] = 0;
  param_1[4] = 0;
  *(undefined4 *)(param_1 + 1) = 0;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 0;
  *(undefined4 *)((longlong)param_1 + 0x34) = 0;
  return;
}



ulonglong FUN_14013f8b0(longlong param_1,int param_2)

{
  byte *pbVar1;
  int iVar2;
  uint uVar3;
  longlong lVar4;
  byte *pbVar5;
  byte bVar6;
  undefined1 *puVar7;
  byte *pbVar8;
  uint uVar9;
  byte bVar10;
  int iVar11;
  longlong lVar12;
  
  iVar11 = *(int *)(param_1 + 0x2c);
  lVar12 = (longlong)iVar11;
  if (*(int *)(param_1 + 0x34) == iVar11) {
    puVar7 = (undefined1 *)(param_1 + 0x28);
    *(undefined2 *)(param_1 + 0x29) = 0;
    *(undefined1 *)(param_1 + 0x2b) = 0;
    *puVar7 = 0;
    *(undefined1 **)(param_1 + 0x38) = puVar7;
    *(undefined1 **)(param_1 + 0x40) = puVar7;
  }
  else {
    *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + param_2;
    uVar9 = *(uint *)(param_1 + 0x48);
    puVar7 = (undefined1 *)(ulonglong)uVar9;
    if (0xf < uVar9) {
      iVar2 = *(int *)(param_1 + 0x30);
      *(uint *)(param_1 + 0x48) = uVar9 & 0xf;
      lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x20) + lVar12 * 8);
      uVar9 = *(int *)(*(longlong *)(param_1 + 0x18) + lVar12 * 4) - iVar2;
      if (5 < uVar9) {
        iVar2 = iVar2 + 2;
        *(int *)(param_1 + 0x30) = iVar2;
        *(longlong *)(param_1 + 0x38) = iVar2 + lVar4;
        *(longlong *)(param_1 + 0x40) = iVar2 + lVar4;
        return CONCAT71((int7)(int3)((uint)iVar2 >> 8),1);
      }
      bVar10 = 0;
      iVar11 = iVar11 + 1;
      if (iVar11 == *(int *)(param_1 + 8)) {
        iVar11 = 0;
      }
      pbVar5 = *(byte **)(*(longlong *)(param_1 + 0x20) + (longlong)iVar11 * 8);
      uVar3 = *(uint *)(*(longlong *)(param_1 + 0x18) + (longlong)iVar11 * 4);
      if (uVar9 == 5) {
        puVar7 = (undefined1 *)(param_1 + 0x28);
        lVar12 = (longlong)(iVar2 + 2);
        *(int *)(param_1 + 0x30) = iVar2 + 2;
        *puVar7 = *(undefined1 *)(lVar12 + lVar4);
        *(undefined1 *)(param_1 + 0x29) = *(undefined1 *)(lVar12 + 1 + lVar4);
        pbVar8 = (byte *)0x0;
        *(undefined1 *)(param_1 + 0x2a) = *(undefined1 *)(lVar12 + 2 + lVar4);
        if (uVar3 != 0) {
          bVar10 = *pbVar5;
        }
        *(byte *)(param_1 + 0x2b) = bVar10;
        *(undefined1 **)(param_1 + 0x38) = puVar7;
        *(undefined1 **)(param_1 + 0x40) = puVar7;
      }
      else if (uVar9 == 4) {
        iVar2 = iVar2 + 2;
        puVar7 = (undefined1 *)(param_1 + 0x28);
        *(int *)(param_1 + 0x30) = iVar2;
        *puVar7 = *(undefined1 *)(iVar2 + lVar4);
        *(undefined1 *)(param_1 + 0x29) = *(undefined1 *)((longlong)iVar2 + 1 + lVar4);
        if (uVar3 == 0) {
          pbVar8 = (byte *)0x0;
        }
        else {
          pbVar8 = (byte *)(ulonglong)*pbVar5;
        }
        *(char *)(param_1 + 0x2a) = (char)pbVar8;
        if (1 < uVar3) {
          bVar10 = pbVar5[1];
        }
        *(byte *)(param_1 + 0x2b) = bVar10;
        *(undefined1 **)(param_1 + 0x38) = puVar7;
        *(undefined1 **)(param_1 + 0x40) = puVar7;
      }
      else if (uVar9 == 3) {
        puVar7 = (undefined1 *)(param_1 + 0x28);
        *(int *)(param_1 + 0x30) = iVar2 + 2;
        *puVar7 = *(undefined1 *)((iVar2 + 2) + lVar4);
        bVar6 = bVar10;
        if (uVar3 != 0) {
          bVar6 = *pbVar5;
        }
        *(byte *)(param_1 + 0x29) = bVar6;
        if (uVar3 < 2) {
          pbVar8 = (byte *)0x0;
        }
        else {
          pbVar8 = (byte *)(ulonglong)pbVar5[1];
        }
        *(char *)(param_1 + 0x2a) = (char)pbVar8;
        if (2 < uVar3) {
          bVar10 = pbVar5[2];
        }
        *(byte *)(param_1 + 0x2b) = bVar10;
        *(undefined1 **)(param_1 + 0x38) = puVar7;
        *(undefined1 **)(param_1 + 0x40) = puVar7;
      }
      else {
        if (uVar9 == 2) {
          bVar6 = bVar10;
          if (uVar3 != 0) {
            bVar6 = *pbVar5;
          }
          pbVar1 = (byte *)(param_1 + 0x28);
          *pbVar1 = bVar6;
          bVar6 = bVar10;
          if (1 < uVar3) {
            bVar6 = pbVar5[1];
          }
          *(byte *)(param_1 + 0x29) = bVar6;
          if (2 < uVar3) {
            bVar10 = pbVar5[2];
          }
          *(byte *)(param_1 + 0x2a) = bVar10;
          if (uVar3 < 4) {
            pbVar8 = (byte *)0x0;
          }
          else {
            pbVar8 = (byte *)(ulonglong)pbVar5[3];
          }
          *(char *)(param_1 + 0x2b) = (char)pbVar8;
          *(byte **)(param_1 + 0x38) = pbVar1;
          *(byte **)(param_1 + 0x40) = pbVar1;
          *(undefined4 *)(param_1 + 0x30) = 0;
        }
        else {
          if (uVar9 != 1) {
            return (ulonglong)(uint7)(int7)(int3)((uint)iVar11 >> 8) << 8;
          }
          bVar6 = bVar10;
          if (1 < uVar3) {
            bVar6 = pbVar5[1];
          }
          pbVar8 = (byte *)(param_1 + 0x28);
          *pbVar8 = bVar6;
          bVar6 = bVar10;
          if (2 < uVar3) {
            bVar6 = pbVar5[2];
          }
          *(byte *)(param_1 + 0x29) = bVar6;
          bVar6 = bVar10;
          if (3 < uVar3) {
            bVar6 = pbVar5[3];
          }
          *(byte *)(param_1 + 0x2a) = bVar6;
          if (4 < uVar3) {
            bVar10 = pbVar5[4];
          }
          *(byte *)(param_1 + 0x2b) = bVar10;
          *(byte **)(param_1 + 0x38) = pbVar8;
          *(byte **)(param_1 + 0x40) = pbVar8;
          *(undefined4 *)(param_1 + 0x30) = 1;
        }
        *(int *)(param_1 + 0x2c) = iVar11;
      }
      return CONCAT71((int7)((ulonglong)pbVar8 >> 8),1);
    }
    if ((uVar9 < 9) ||
       (puVar7 = *(undefined1 **)(param_1 + 0x18),
       1 < (uint)(*(int *)(puVar7 + lVar12 * 4) - *(int *)(param_1 + 0x30)))) {
      return CONCAT71((int7)((ulonglong)puVar7 >> 8),1);
    }
  }
  return (ulonglong)puVar7 & 0xffffffffffffff00;
}



void FUN_14013fb60(longlong param_1,int param_2)

{
  undefined4 *puVar1;
  uint uVar2;
  undefined8 uVar3;
  undefined4 *puVar4;
  ulonglong uVar5;
  longlong lVar6;
  
  if (*(longlong *)(param_1 + 0x38) == 0) {
    lVar6 = (longlong)param_2;
    *(undefined4 *)(param_1 + 0x30) = 0;
    *(undefined4 *)(param_1 + 0x48) = 0;
    uVar2 = *(uint *)(*(longlong *)(param_1 + 0x18) + lVar6 * 4);
    uVar5 = (ulonglong)uVar2;
    if (3 < uVar2) {
      uVar3 = *(undefined8 *)(*(longlong *)(param_1 + 0x20) + lVar6 * 8);
      *(undefined8 *)(param_1 + 0x38) = uVar3;
      *(undefined8 *)(param_1 + 0x40) = uVar3;
      return;
    }
    puVar1 = (undefined4 *)(param_1 + 0x28);
    *puVar1 = 0;
    lVar6 = *(longlong *)(*(longlong *)(param_1 + 0x20) + lVar6 * 8);
    if (uVar2 != 0) {
      puVar4 = puVar1;
      do {
        uVar5 = uVar5 - 1;
        *(undefined1 *)puVar4 = *(undefined1 *)((lVar6 - param_1) + -0x28 + (longlong)puVar4);
        puVar4 = (undefined4 *)((longlong)puVar4 + 1);
      } while (uVar5 != 0);
    }
    *(undefined4 **)(param_1 + 0x38) = puVar1;
    *(undefined4 **)(param_1 + 0x40) = puVar1;
  }
  return;
}



undefined8 FUN_14013fbd0(longlong param_1,void *param_2,uint param_3)

{
  undefined1 *puVar1;
  ulonglong uVar2;
  void *pvVar3;
  int iVar4;
  longlong lVar5;
  uint uVar6;
  uint uVar7;
  undefined1 local_res10;
  undefined1 local_res11;
  undefined1 local_res12;
  
  if ((param_2 != (void *)0x0) && (param_3 != 0)) {
    iVar4 = *(int *)(param_1 + 0x34);
    lVar5 = (longlong)iVar4;
    uVar7 = *(uint *)(*(longlong *)(param_1 + 0x18) + lVar5 * 4);
    uVar6 = 0;
    if (uVar7 != 0) {
      puVar1 = *(undefined1 **)(*(longlong *)(param_1 + 0x20) + lVar5 * 8);
      local_res10 = *puVar1;
      local_res11 = puVar1[1];
      local_res12 = puVar1[2];
      uVar6 = uVar7;
    }
    uVar7 = *(uint *)(*(longlong *)(param_1 + 0x10) + lVar5 * 4);
    if ((uVar7 != 0) && (uVar7 < param_3 + 8)) {
      uVar2 = *(ulonglong *)(*(longlong *)(param_1 + 0x20) + lVar5 * 8);
      if ((uVar2 <= *(ulonglong *)(param_1 + 0x38)) &&
         (*(ulonglong *)(param_1 + 0x38) < uVar2 + uVar7)) {
        *(undefined8 *)(param_1 + 0x38) = 0;
        *(undefined8 *)(param_1 + 0x40) = 0;
        *(undefined4 *)(param_1 + 0x48) = 0;
      }
      operator_delete(*(void **)(*(longlong *)(param_1 + 0x20) + lVar5 * 8));
      *(undefined8 *)(*(longlong *)(param_1 + 0x20) + lVar5 * 8) = 0;
      *(undefined4 *)(*(longlong *)(param_1 + 0x10) + lVar5 * 4) = 0;
    }
    if (*(int *)(*(longlong *)(param_1 + 0x10) + lVar5 * 4) == 0) {
      uVar7 = uVar6 + 8 + param_3;
      pvVar3 = operator_new((ulonglong)uVar7);
      *(void **)(*(longlong *)(param_1 + 0x20) + lVar5 * 8) = pvVar3;
      if (*(longlong *)(*(longlong *)(param_1 + 0x20) + lVar5 * 8) == 0) {
        return 0;
      }
      *(uint *)(*(longlong *)(param_1 + 0x10) + lVar5 * 4) = uVar7;
    }
    *(uint *)(*(longlong *)(param_1 + 0x18) + lVar5 * 4) = uVar6 + param_3;
    pvVar3 = *(void **)(*(longlong *)(param_1 + 0x20) + lVar5 * 8);
    if (uVar6 != 0) {
      memcpy(pvVar3,&local_res10,(ulonglong)uVar6);
    }
    memcpy((void *)((ulonglong)uVar6 + (longlong)pvVar3),param_2,(ulonglong)param_3);
    FUN_14013fb60(param_1,iVar4);
    if (3 < *(uint *)(*(longlong *)(param_1 + 0x18) + lVar5 * 4)) {
      iVar4 = iVar4 + 1;
      if (iVar4 == *(int *)(param_1 + 8)) {
        iVar4 = 0;
      }
      *(int *)(param_1 + 0x34) = iVar4;
    }
    return 1;
  }
  return 1;
}



void * FUN_14013fd60(void *param_1,uint param_2)

{
  FUN_14013f810();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_14013fd90(undefined8 *param_1)

{
  *param_1 = AttributeSet::vftable;
  param_1[1] = 0;
  param_1[2] = 0;
  return param_1;
}



undefined8 FUN_14013fdb0(longlong param_1,char *param_2,undefined8 param_3)

{
  char cVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  char *pcVar5;
  undefined8 uVar6;
  uint uVar7;
  longlong lVar8;
  uint uVar9;
  uint uVar10;
  
  FUN_1400bbe30(param_3);
  if (((param_2 == (char *)0x0) || (*param_2 == '\0')) || (*(longlong *)(param_1 + 8) == 0)) {
    return 0;
  }
  iVar2 = FUN_140139d70();
  lVar8 = -1;
  uVar9 = 0;
  pcVar5 = param_2;
  do {
    if (lVar8 == 0) break;
    lVar8 = lVar8 + -1;
    cVar1 = *pcVar5;
    pcVar5 = pcVar5 + 1;
  } while (cVar1 != '\0');
  uVar10 = uVar9;
  if (0 < iVar2) {
    do {
      iVar3 = FUN_140139de0(*(undefined8 *)(param_1 + 8),uVar9);
      if (iVar3 == ~(uint)lVar8 - 1) {
        uVar7 = uVar9 & 0x80000001;
        if ((int)uVar7 < 0) {
          uVar7 = (uVar7 - 1 | 0xfffffffe) + 1;
        }
        if (uVar7 == 0) {
          pcVar5 = (char *)FUN_1400bbb20(*(undefined8 *)(param_1 + 0x10),uVar10);
          iVar4 = strncmp(pcVar5,param_2,(longlong)iVar3);
          if (iVar4 == 0) {
            iVar2 = FUN_140139de0(*(undefined8 *)(param_1 + 8),uVar9 + 1);
            if (iVar2 != 0) {
              uVar6 = FUN_1400bbb20(*(undefined8 *)(param_1 + 0x10),iVar3 + uVar10);
              FUN_1400bc8a0(param_3,uVar6,iVar2);
            }
            return 1;
          }
        }
      }
      uVar9 = uVar9 + 1;
      uVar10 = uVar10 + iVar3;
    } while ((int)uVar9 < iVar2);
  }
  return 0;
}



ulonglong FUN_14013fee0(longlong param_1,char *param_2)

{
  char cVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  ulonglong in_RAX;
  ulonglong uVar5;
  char *pcVar6;
  undefined4 extraout_var;
  uint uVar7;
  longlong lVar8;
  uint uVar9;
  int iVar10;
  
  if (((param_2 == (char *)0x0) || (*param_2 == '\0')) || (*(longlong *)(param_1 + 8) == 0)) {
    return in_RAX & 0xffffffffffffff00;
  }
  iVar2 = FUN_140139d70();
  lVar8 = -1;
  iVar10 = 0;
  uVar5 = 0;
  pcVar6 = param_2;
  do {
    if (lVar8 == 0) break;
    lVar8 = lVar8 + -1;
    cVar1 = *pcVar6;
    pcVar6 = pcVar6 + 1;
  } while (cVar1 != '\0');
  uVar9 = 0;
  if (0 < iVar2) {
    do {
      uVar5 = FUN_140139de0(*(undefined8 *)(param_1 + 8),uVar9);
      iVar3 = (int)uVar5;
      if (iVar3 == ~(uint)lVar8 - 1) {
        uVar7 = uVar9 & 0x80000001;
        if ((int)uVar7 < 0) {
          uVar7 = (uVar7 - 1 | 0xfffffffe) + 1;
        }
        if (uVar7 == 0) {
          pcVar6 = (char *)FUN_1400bbb20(*(undefined8 *)(param_1 + 0x10),iVar10);
          iVar4 = strncmp(pcVar6,param_2,(longlong)iVar3);
          uVar5 = CONCAT44(extraout_var,iVar4);
          if (iVar4 == 0) {
            return CONCAT71((int7)(uVar5 >> 8),1);
          }
        }
      }
      uVar9 = uVar9 + 1;
      iVar10 = iVar10 + iVar3;
    } while ((int)uVar9 < iVar2);
  }
  return uVar5 & 0xffffffffffffff00;
}



bool FUN_14013ffd0(longlong param_1,char *param_2,char *param_3)

{
  char cVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  char *pcVar5;
  uint uVar6;
  longlong lVar7;
  ulonglong uVar8;
  uint uVar9;
  uint uVar10;
  char *_Str2;
  
  if ((param_2 == (char *)0x0) || (*param_2 == '\0')) {
    return false;
  }
  _Str2 = "";
  if (param_3 != (char *)0x0) {
    _Str2 = param_3;
  }
  if (*(longlong *)(param_1 + 8) == 0) {
    return false;
  }
  iVar2 = FUN_140139d70();
  lVar7 = -1;
  uVar9 = 0;
  pcVar5 = param_2;
  do {
    if (lVar7 == 0) break;
    lVar7 = lVar7 + -1;
    cVar1 = *pcVar5;
    pcVar5 = pcVar5 + 1;
  } while (cVar1 != '\0');
  cVar1 = *_Str2;
  uVar10 = uVar9;
  if (0 < iVar2) {
    do {
      iVar3 = FUN_140139de0(*(undefined8 *)(param_1 + 8),uVar9);
      if (iVar3 == ~(uint)lVar7 - 1) {
        uVar6 = uVar9 & 0x80000001;
        if ((int)uVar6 < 0) {
          uVar6 = (uVar6 - 1 | 0xfffffffe) + 1;
        }
        if (uVar6 == 0) {
          pcVar5 = (char *)FUN_1400bbb20(*(undefined8 *)(param_1 + 0x10),uVar10);
          iVar4 = strncmp(pcVar5,param_2,(longlong)iVar3);
          if (iVar4 == 0) {
            uVar6 = FUN_140139de0(*(undefined8 *)(param_1 + 8),uVar9 + 1);
            if ((uVar6 == 0) && (cVar1 == '\0')) {
              return true;
            }
            pcVar5 = (char *)FUN_1400bbb20(*(undefined8 *)(param_1 + 0x10),iVar3 + uVar10);
            iVar4 = strncmp(pcVar5,_Str2,(ulonglong)uVar6);
            if (iVar4 == 0) {
              uVar8 = 0xffffffffffffffff;
              goto code_r0x00014014013c;
            }
          }
        }
      }
      uVar9 = uVar9 + 1;
      uVar10 = uVar10 + iVar3;
    } while ((int)uVar9 < iVar2);
  }
  return false;
  while( true ) {
    uVar8 = uVar8 - 1;
    cVar1 = *_Str2;
    _Str2 = _Str2 + 1;
    if (cVar1 == '\0') break;
code_r0x00014014013c:
    if (uVar8 == 0) break;
  }
  return (ulonglong)uVar6 == ~uVar8 - 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140140150(longlong param_1,char *param_2,char *param_3)

{
  char cVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  char *pcVar5;
  void *_Src;
  undefined8 uVar6;
  uint uVar7;
  ulonglong uVar8;
  longlong lVar9;
  uint uVar10;
  uint uVar11;
  char *pcVar12;
  undefined1 auStack_2b8 [32];
  char local_298;
  longlong local_290;
  undefined8 local_288;
  undefined1 local_280 [56];
  undefined1 local_248 [512];
  ulonglong local_48;
  
  local_288 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_2b8;
  if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
    pcVar12 = "";
    if (param_3 != (char *)0x0) {
      pcVar12 = param_3;
    }
    if (*(longlong *)(param_1 + 8) != 0) {
      iVar2 = FUN_140139d70();
      uVar10 = 0;
      uVar8 = 0xffffffffffffffff;
      pcVar5 = param_2;
      do {
        if (uVar8 == 0) break;
        uVar8 = uVar8 - 1;
        cVar1 = *pcVar5;
        pcVar5 = pcVar5 + 1;
      } while (cVar1 != '\0');
      lVar9 = ~uVar8 - 1;
      local_298 = *pcVar12 == '\0';
      local_290 = lVar9;
      uVar11 = uVar10;
      if (0 < iVar2) {
        do {
          iVar3 = FUN_140139de0(*(undefined8 *)(param_1 + 8),uVar10);
          if (iVar3 == (int)lVar9) {
            uVar7 = uVar10 & 0x80000001;
            if ((int)uVar7 < 0) {
              uVar7 = (uVar7 - 1 | 0xfffffffe) + 1;
            }
            if (uVar7 == 0) {
              pcVar5 = (char *)FUN_1400bbb20(*(undefined8 *)(param_1 + 0x10),uVar11);
              iVar4 = strncmp(pcVar5,param_2,(longlong)iVar3);
              lVar9 = local_290;
              if (iVar4 == 0) {
                iVar4 = FUN_140139de0(*(undefined8 *)(param_1 + 8),uVar10 + 1);
                if (iVar4 == 0) {
                  if (local_298 != '\0') {
                    return 1;
                  }
                }
                else if (499 < iVar4) {
                  FUN_1400bce20(local_280,iVar4 + 1);
                  uVar6 = FUN_1400bbb20(*(undefined8 *)(param_1 + 0x10),iVar3 + uVar11);
                  FUN_1400bc8a0(local_280,uVar6,iVar4);
                  uVar6 = FUN_1400b8b90(local_280);
                  cVar1 = FUN_1400d11b0(uVar6,pcVar12,1);
                  if (cVar1 != '\0') {
                    FUN_1400bceb0(local_280);
                    return 1;
                  }
                  FUN_1400bceb0(local_280);
                  lVar9 = local_290;
                  goto LAB_1401402f9;
                }
                _Src = (void *)FUN_1400bbb20(*(undefined8 *)(param_1 + 0x10),iVar3 + uVar11);
                memcpy(local_248,_Src,(longlong)iVar4);
                local_248[iVar4] = 0;
                cVar1 = FUN_1400d11b0(local_248,pcVar12,1);
                lVar9 = local_290;
                if (cVar1 != '\0') {
                  return 1;
                }
              }
            }
          }
LAB_1401402f9:
          uVar11 = uVar11 + iVar3;
          uVar10 = uVar10 + 1;
        } while ((int)uVar10 < iVar2);
      }
    }
  }
  return 0;
}



int FUN_140140350(longlong param_1)

{
  int iVar1;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    return 0;
  }
  iVar1 = FUN_140139d70();
  return iVar1 / 2;
}



void FUN_140140380(longlong param_1,undefined8 param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  undefined8 uVar4;
  char *pcVar5;
  char cVar6;
  uint uVar7;
  int iVar8;
  
  if (*(longlong *)(param_1 + 8) != 0) {
    iVar1 = FUN_140139d70();
    iVar8 = 0;
    uVar7 = 0;
    if (0 < iVar1) {
      do {
        iVar2 = FUN_140139de0(*(undefined8 *)(param_1 + 8),uVar7);
        if ((uVar7 & 1) == 0) {
          FUN_1400bbe50(param_2,0x20);
          uVar4 = FUN_1400bbb20(*(undefined8 *)(param_1 + 0x10),iVar8);
          FUN_1400bc8a0(param_2,uVar4,iVar2);
          FUN_1400bbe50(param_2,0x3d);
          FUN_1400bbe50(param_2,0x22);
          iVar3 = FUN_140139de0(*(undefined8 *)(param_1 + 8),uVar7 + 1);
          pcVar5 = (char *)FUN_1400bbb20(*(undefined8 *)(param_1 + 0x10),iVar2 + iVar8);
          cVar6 = *pcVar5;
          for (; (cVar6 != '\0' && (iVar3 != 0)); iVar3 = iVar3 + -1) {
            if (cVar6 == '\"') {
              FUN_1400bc640(param_2,"&quot;");
            }
            else if (cVar6 == '&') {
              if (((iVar3 < 2) || (pcVar5[1] != '#')) || (iVar3 < 3)) {
                FUN_1400bc640(param_2,"&amp;");
              }
              else {
                if ((byte)(pcVar5[2] - 0x30U) < 10) {
                  cVar6 = '&';
                }
                else {
                  if (pcVar5[2] != 'x') {
                    FUN_1400bc640(param_2,"&amp;");
                    goto LAB_14014050d;
                  }
                  cVar6 = '&';
                }
LAB_140140508:
                FUN_1400bbe50(param_2,cVar6);
              }
            }
            else if (cVar6 == '>') {
              FUN_1400bc640(param_2,&DAT_14027ba60);
            }
            else if (cVar6 == '<') {
              FUN_1400bc640(param_2,&DAT_14027ba68);
            }
            else {
              if (cVar6 != '\'') goto LAB_140140508;
              FUN_1400bc640(param_2,"&apos;");
            }
LAB_14014050d:
            cVar6 = pcVar5[1];
            pcVar5 = pcVar5 + 1;
          }
          FUN_1400bbe50(param_2,0x22);
        }
        uVar7 = uVar7 + 1;
        iVar8 = iVar8 + iVar2;
      } while ((int)uVar7 < iVar1);
    }
  }
  return;
}



undefined8 * FUN_140140560(undefined8 *param_1,uint param_2)

{
  undefined8 *puVar1;
  
  *param_1 = AttributeSet::vftable;
  puVar1 = (undefined8 *)param_1[2];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[2] = 0;
  }
  puVar1 = (undefined8 *)param_1[1];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
    param_1[1] = 0;
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1401405d0(longlong param_1,char *param_2)

{
  char cVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  char *pcVar5;
  uint uVar6;
  longlong lVar7;
  uint uVar8;
  int iVar9;
  int local_res10;
  
  local_res10 = 0;
LAB_140140600:
  if (param_2 == (char *)0x0) {
    return;
  }
  if (*param_2 == '\0') {
    return;
  }
  if (*(longlong *)(param_1 + 8) == 0) {
    return;
  }
  iVar2 = FUN_140139d70();
  lVar7 = -1;
  iVar9 = 0;
  pcVar5 = param_2;
  do {
    if (lVar7 == 0) break;
    lVar7 = lVar7 + -1;
    cVar1 = *pcVar5;
    pcVar5 = pcVar5 + 1;
  } while (cVar1 != '\0');
  uVar8 = 0;
  if (iVar2 < 1) {
    return;
  }
  do {
    iVar3 = FUN_140139de0(*(undefined8 *)(param_1 + 8),uVar8);
    if (iVar3 == ~(uint)lVar7 - 1) {
      uVar6 = uVar8 & 0x80000001;
      if ((int)uVar6 < 0) {
        uVar6 = (uVar6 - 1 | 0xfffffffe) + 1;
      }
      if (uVar6 == 0) {
        pcVar5 = (char *)FUN_1400bbb20(*(undefined8 *)(param_1 + 0x10),iVar9);
        iVar4 = strncmp(pcVar5,param_2,(longlong)iVar3);
        if (iVar4 == 0) break;
      }
    }
    uVar8 = uVar8 + 1;
    iVar9 = iVar9 + iVar3;
    if (iVar2 <= (int)uVar8) {
      return;
    }
  } while( true );
  iVar2 = FUN_140139de0(*(undefined8 *)(param_1 + 8),uVar8 + 1);
  FUN_1400bde90(*(undefined8 *)(param_1 + 0x10),iVar9,iVar2 + iVar3);
  FUN_140139ea0(*(undefined8 *)(param_1 + 8),uVar8 + 1);
  FUN_140139ea0(*(undefined8 *)(param_1 + 8),uVar8);
  local_res10 = local_res10 + 1;
  if (100 < local_res10) {
    return;
  }
  goto LAB_140140600;
}



void FUN_140140710(longlong param_1,char *param_2,char *param_3)

{
  ulonglong uVar1;
  char cVar2;
  void *pvVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 uVar6;
  ulonglong uVar7;
  char *pcVar8;
  char *pcVar9;
  
  if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
    pcVar9 = "";
    if (param_3 != (char *)0x0) {
      pcVar9 = param_3;
    }
    puVar5 = (undefined8 *)0x0;
    puVar4 = puVar5;
    if (DAT_140318ce9 != '\0') {
      pvVar3 = operator_new(0xa0);
      if (pvVar3 != (void *)0x0) {
        puVar4 = (undefined8 *)FUN_1400b6fd0();
      }
      if (puVar4 != (undefined8 *)0x0) {
        FUN_1400b7b60(puVar4,param_2);
        FUN_1400b8130(puVar4);
        param_2 = (char *)FUN_1400b7950();
      }
    }
    if ((DAT_140318cea != '\0') && (cVar2 = FUN_14013fee0(param_1,param_2), cVar2 != '\0')) {
      FUN_1401405d0(param_1,param_2);
    }
    if (*(longlong *)(param_1 + 8) == 0) {
      pvVar3 = operator_new(0x20);
      if (pvVar3 != (void *)0x0) {
        puVar5 = (undefined8 *)FUN_140139d80(pvVar3,6,0xf);
      }
      *(undefined8 **)(param_1 + 8) = puVar5;
    }
    if (*(longlong *)(param_1 + 0x10) == 0) {
      uVar6 = FUN_1400be770();
      *(undefined8 *)(param_1 + 0x10) = uVar6;
    }
    uVar7 = 0xffffffffffffffff;
    pcVar8 = param_2;
    do {
      if (uVar7 == 0) break;
      uVar7 = uVar7 - 1;
      cVar2 = *pcVar8;
      pcVar8 = pcVar8 + 1;
    } while (cVar2 != '\0');
    FUN_140139f00(*(undefined8 *)(param_1 + 8),(int)~uVar7 + -1);
    FUN_1400bc8a0(*(undefined8 *)(param_1 + 0x10),param_2,~uVar7 - 1 & 0xffffffff);
    uVar7 = 0xffffffffffffffff;
    pcVar8 = pcVar9;
    do {
      if (uVar7 == 0) break;
      uVar7 = uVar7 - 1;
      cVar2 = *pcVar8;
      pcVar8 = pcVar8 + 1;
    } while (cVar2 != '\0');
    uVar1 = ~uVar7 - 1;
    FUN_140139f00(*(undefined8 *)(param_1 + 8),(int)~uVar7 + -1);
    if ((int)uVar1 != 0) {
      FUN_1400bc8a0(*(undefined8 *)(param_1 + 0x10),pcVar9,uVar1 & 0xffffffff);
    }
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
  }
  return;
}



void * FUN_1401408a0(void *param_1,uint param_2)

{
  FUN_140140aa0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1401408d0(undefined8 *param_1)

{
  *param_1 = _ckQueue::vftable;
  param_1[1] = 0;
  param_1[2] = 0;
  return param_1;
}



void FUN_1401408f0(longlong param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  
  puVar1 = operator_new(0x18);
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = param_2;
    puVar1[2] = 0;
    *puVar1 = QueuedObject::vftable;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    *(undefined8 **)(param_1 + 8) = puVar1;
    *(undefined8 **)(param_1 + 0x10) = puVar1;
    return;
  }
  *(undefined8 **)(*(longlong *)(param_1 + 0x10) + 0x10) = puVar1;
  *(undefined8 **)(param_1 + 0x10) = puVar1;
  return;
}



bool FUN_140140960(longlong param_1)

{
  return *(longlong *)(param_1 + 8) != 0;
}



undefined8 FUN_140140970(longlong param_1)

{
  undefined8 *puVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  puVar1 = *(undefined8 **)(param_1 + 8);
  if (puVar1 != (undefined8 *)0x0) {
    lVar2 = puVar1[2];
    *(longlong *)(param_1 + 8) = lVar2;
    if (lVar2 == 0) {
      *(undefined8 *)(param_1 + 0x10) = 0;
    }
  }
  if (puVar1 != (undefined8 *)0x0) {
    uVar3 = puVar1[1];
    (**(code **)*puVar1)(puVar1,1);
    return uVar3;
  }
  return 0;
}



void FUN_1401409c0(undefined8 *param_1)

{
  longlong lVar1;
  undefined8 *puVar2;
  
  lVar1 = param_1[1];
  *param_1 = _ckQueue::vftable;
  while (lVar1 != 0) {
    puVar2 = (undefined8 *)param_1[1];
    if ((puVar2 != (undefined8 *)0x0) && (lVar1 = puVar2[2], param_1[1] = lVar1, lVar1 == 0)) {
      param_1[2] = 0;
    }
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    lVar1 = param_1[1];
  }
  return;
}



undefined8 * FUN_140140a20(undefined8 *param_1,uint param_2)

{
  longlong lVar1;
  undefined8 *puVar2;
  
  lVar1 = param_1[1];
  *param_1 = _ckQueue::vftable;
  while (lVar1 != 0) {
    puVar2 = (undefined8 *)param_1[1];
    if ((puVar2 != (undefined8 *)0x0) && (lVar1 = puVar2[2], param_1[1] = lVar1, lVar1 == 0)) {
      param_1[2] = 0;
    }
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    lVar1 = param_1[1];
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140140aa0(undefined8 *param_1)

{
  *param_1 = QueuedObject::vftable;
  return;
}



void FUN_140140ab0(longlong param_1)

{
  undefined1 local_58 [88];
  
  if ((*(int *)(param_1 + 0x2c) == 0) &&
     ((*(int *)(param_1 + 0x28) < 2 || (4 < *(int *)(param_1 + 0x28))))) {
    FUN_1400a2320(local_58,L"RMI messaging cannot have Engine level priority!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  return;
}



undefined1 * FUN_140140af0(undefined1 *param_1)

{
  undefined4 uVar1;
  
  param_1[0x30] = 1;
  param_1[0x40] = 1;
  *param_1 = 0;
  *(undefined4 *)(param_1 + 0x28) = 3;
  *(undefined4 *)(param_1 + 0x2c) = 1;
  *(undefined8 *)(param_1 + 4) = 0;
  *(undefined8 *)(param_1 + 0x10) = DAT_1402f8138;
  uVar1 = DAT_1402f8148;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined4 *)(param_1 + 0x18) = uVar1;
  *(undefined8 *)(param_1 + 0x38) = 0;
  param_1[0x41] = 1;
  *(undefined8 *)(param_1 + 0x48) = 0;
  param_1[0x50] = 0;
  *(undefined8 *)(param_1 + 0x54) = 0;
  return param_1;
}



void FUN_140140b40(undefined8 *param_1)

{
  *param_1 = Proud::INetCoreEvent::vftable;
  return;
}



undefined8 FUN_140140b50(undefined8 param_1,uint param_2)

{
  FUN_140140df0();
  if ((param_2 & 1) != 0) {
    FUN_140140dd0(param_1);
  }
  return param_1;
}



undefined8 * FUN_140140b80(undefined8 *param_1)

{
  FUN_1400a3440();
  *param_1 = PTR_DAT_1402f8010;
  *(undefined4 *)((longlong)param_1 + 0xc) = 0;
  *(undefined4 *)(param_1 + 2) = 0;
  *(undefined4 *)((longlong)param_1 + 0x14) = 0;
  *(undefined4 *)(param_1 + 3) = 0;
  param_1[5] = 0;
  param_1[4] = Proud::ByteArray::vftable;
  param_1[6] = 0;
  param_1[7] = 0;
  param_1[8] = 0;
  param_1[9] = 0;
  *(undefined2 *)(param_1 + 1) = 0;
  return param_1;
}



undefined8 *
FUN_140140bf0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  FUN_1400a3440();
  *param_1 = PTR_DAT_1402f8010;
  FUN_1400a3440();
  param_1[1] = PTR_DAT_1402f8010;
  param_1[3] = Proud::CFastArray<int,0>::vftable;
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  *(undefined4 *)((longlong)param_1 + 0x44) = 0;
  *(undefined4 *)(param_1 + 9) = 0;
  *(undefined4 *)((longlong)param_1 + 0x4c) = 0;
  *(undefined4 *)(param_1 + 10) = 0;
  param_1[0x11] = Proud::CFastArray<int,0>::vftable;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  param_1[0x14] = 0;
  param_1[0x15] = 0;
  *(undefined8 *)((longlong)param_1 + 0x5c) = 0x80;
  *(undefined4 *)(param_1 + 2) = 0;
  *(undefined4 *)(param_1 + 8) = 0;
  *(undefined8 *)((longlong)param_1 + 0x54) = 0;
  *(undefined2 *)((longlong)param_1 + 0x65) = 0x100;
  *(undefined1 *)((longlong)param_1 + 100) = 0;
  *(undefined1 *)((longlong)param_1 + 0x67) = DAT_1402f8145;
  *(undefined1 *)(param_1 + 0xd) = 0;
  *(undefined4 *)((longlong)param_1 + 0x6c) = 0;
  param_1[0xe] = 0;
  *(undefined1 *)(param_1 + 0xf) = 1;
  *(undefined8 *)((longlong)param_1 + 0x7c) = 0;
  *(undefined2 *)((longlong)param_1 + 0x84) = 0;
  param_1[0x16] = 0;
  FUN_140021fb0(param_1 + 0x11,0,0,param_4,uVar1);
  return param_1;
}



void FUN_140140ce0(void)

{
  HANDLE hProcess;
  
  MessageBoxW((HWND)0x0,L"Library and header files version mismatch!",L"ProudNet",0x10);
  hProcess = GetCurrentProcess();
                    // WARNING: Could not recover jumptable at 0x000140140d12. Too many branches
                    // WARNING: Treating indirect jump as call
  TerminateProcess(hProcess,1);
  return;
}



undefined8 * FUN_140140d20(void)

{
  bool bVar1;
  char cVar2;
  undefined8 uVar3;
  undefined1 local_20 [24];
  
  bVar1 = false;
  cVar2 = FUN_1400a1cc0(&DAT_140318e80);
  if (cVar2 != '\0') {
    if (DAT_14030ae80 == '\0') {
      bVar1 = false;
    }
    else {
      bVar1 = true;
      FUN_1400a1c30(&DAT_140318e80);
    }
  }
  if ((DAT_140318e78 & 1) == 0) {
    DAT_140318e78 = DAT_140318e78 | 1;
    uVar3 = FUN_1400a6440(local_20);
    DAT_140318e70 = FUN_1400a63b0(uVar3);
    atexit(FUN_1402029e0);
  }
  DAT_14030ae80 = 0;
  if (bVar1) {
    FUN_1400d1290(&DAT_140318e80);
  }
  return &DAT_140318e70;
}



void FUN_140140dd0(undefined8 param_1)

{
  undefined8 *puVar1;
  
  puVar1 = (undefined8 *)FUN_140140d20();
                    // WARNING: Could not recover jumptable at 0x000140140dec. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)*puVar1 + 0x10))((longlong *)*puVar1,param_1);
  return;
}



void FUN_140140df0(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x000140140e17. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



wchar_t * FUN_140140e30(undefined4 param_1)

{
  switch(param_1) {
  case 1:
    return L"의도되지 않은 상황이 발생했습니다.";
  case 2:
    return L"이미 연결되어 있었습니다.";
  case 3:
    return L"TCP 연결이 실패했습니다.";
  case 4:
    return L"잘못된 세션 암호 키입니다.";
  case 5:
    return L"암호화가 실패했습니다.";
  case 6:
    return L"복호화 실패 혹은 해커에 의한 조작된 데이터입니다.";
  case 7:
    return L"서버와의 연결 시도가 타임 아웃하였습니다.";
  case 8:
    return L"서버와 프로토콜 버전이 맞지 않습니다.";
  case 9:
    return L"서버에서 연결을 거부했습니다.";
  case 10:
    return L"서버와의 연결이 성공했습니다.";
  case 0xb:
    return L"상대측 호스트가 연결을 끊었습니다.";
  case 0xc:
    return L"로컬 호스트에서 능동적으로 연결을 끊었습니다.";
  case 0xd:
    return L"위험한 호출 파라메터가 있습니다.";
  case 0xe:
    return L"알 수 없는 인터넷 주소입니다.";
  case 0xf:
    return L"서버가 준비되지 않았습니다.";
  case 0x10:
    return 
    L"서버 소켓의 listen을 시작할 수 없습니다. TCP 또는 UDP 소켓이 이미 사용중인 포트인지 확인하십시오."
    ;
  case 0x11:
    return L"이미 개체가 존재합니다.";
  case 0x12:
    return L"접근이 거부되었습니다.";
  case 0x13:
    return L"잘못된 session Guid입니다.";
  case 0x14:
    return L"잘못된 credential입니다.";
  case 0x15:
    return L"잘못된 hero name입니다.";
  case 0x16:
    return L"로딩 과정이 unlock 후 lock 한 후 꼬임이 발생했습니다.";
  case 0x17:
    return L"출력 파라메터 AdjustedGamerIDNotFilled가 채워지지 않았습니다.";
  case 0x18:
    return L"플레이어 캐릭터가 존재하지 않습니다.";
  case 0x19:
    return L"UnitTestFailed";
  case 0x1a:
    return L"peer-to-peer UDP 통신이 막혔습니다.";
  case 0x1b:
    return L"P2P reliable UDP가 실패했습니다.";
  case 0x1c:
    return L"클라이언트-서버 UDP 통신이 막혔습니다.";
  case 0x1d:
    return L"더 이상 같이 소속된 P2P 그룹이 없습니다.";
  case 0x1e:
    return L"사용자의 요청에 의한 실패입니다.";
  case 0x1f:
    return 
    L"잘못된 패킷 형식입니다. 상대측 호스트가 해킹되었거나 버그일 수 있습니다."
    ;
  case 0x20:
    return 
    L"너무 큰 크기의 메시징이 시도되었습니다. 기술지원부에 문의하십시오."
    ;
  case 0x21:
    return L"Unreliable 메세지는 암호화할 수 없습니다.";
  case 0x22:
    return L"존재하지 않는 값입니다.";
  case 0x23:
    return L"타임 아웃입니다.";
  case 0x24:
    return L"로드된 데이터를 찾을 수 없습니다.";
  case 0x25:
    return 
    L"송신 queue가 너무 많이 쌓여 있습니다. 송신량을 조절하는 것을 권장합니다."
    ;
  case 0x26:
    return L"Heartbeat가 너무 늦게 호출되고 있습니다.기아화를 의심하세요.";
  case 0x27:
    return L"메시지 압축을 푸는데 실패 하였습니다.";
  default:
    return L"<none>";
  }
}



wchar_t * FUN_140141030(undefined4 param_1)

{
  switch(param_1) {
  case 1:
    return L"Unexpected Error.";
  case 2:
    return L"Already connected.";
  case 3:
    return L"TCP connection failure.";
  case 4:
    return L"Invalid session key.";
  case 5:
    return L"Encryption failed.";
  case 6:
    return L"Decryption failed or hack suspected.";
  case 7:
    return L"Connect to server timed out.";
  case 8:
    return L"Mispatched protocol between hosts.";
  case 9:
    return L"Server denied connection attempt.";
  case 10:
    return L"Connecting to server successful.";
  case 0xb:
    return L"Remote host disconnected.";
  case 0xc:
    return L"Local host disconnected.";
  case 0xd:
    return L"Dangerous parameters are detected.";
  case 0xe:
    return L"Unknown Internet address.";
  case 0xf:
    return L"Server is not ready.";
  case 0x10:
    return 
    L"Server socket listen failure. Make sure that the TCP or UDP listening port is not already in use."
    ;
  case 0x11:
    return L"Object already exists.";
  case 0x12:
    return L"Permission denied.";
  case 0x13:
    return L"Bad session Guid.";
  case 0x14:
    return L"Invalid credential.";
  case 0x15:
    return L"Invalid player character name.";
  case 0x16:
    return L"Corruption occurred while unlocked loading and locking.";
  case 0x17:
    return L"Output parameter AdjustedGamerIDNotFilled is not filled.";
  case 0x18:
    return L"No Player Character(Hero) Found.";
  case 0x19:
    return L"UnitTestFailed";
  case 0x1a:
    return L"peer-to-peer UDP comm is blocked.";
  case 0x1b:
    return L"P2P reliable UDP failed.";
  case 0x1c:
    return L"Client-server UDP comm is blocked.";
  case 0x1d:
    return L"No common P2P group exists anymore.";
  case 0x1e:
    return L"By user request.";
  case 0x1f:
    return L"Invalid packet format. Remote host is hacked or has a bug.";
  case 0x20:
    return L"Too large message is detected. Contact technical supports.";
  case 0x21:
    return L"An unreliable message cannot be encrypted.";
  case 0x22:
    return L"Not exist value.";
  case 0x23:
    return L"Working is timeout.";
  case 0x24:
    return L"Can not found loaddata.";
  case 0x25:
    return L"SendQueue has Accumulated too much.";
  case 0x26:
    return L"Heartbeat Call in too slow.Suspected starvation";
  case 0x27:
    return L"Message uncompress fail.";
  default:
    return L"<none>";
  }
}



wchar_t * FUN_140141230(undefined4 param_1)

{
  switch(param_1) {
  case 1:
    return L"发生了以外的情况.";
  case 2:
    return L"已连接.";
  case 3:
    return L"TCP/IP 连接失败.";
  case 4:
    return L"session key不正确.";
  case 5:
    return L"暗号化失败.";
  case 6:
    return L"符号化失败或被操作的数据.";
  case 7:
    return L"服务器连接超时.";
  case 8:
    return L"跟服务器的版本不同 需要上级.";
  case 9:
    return L"被据否了服务器连接.";
  case 10:
    return L"服务器连接成功.";
  case 0xb:
    return L"Remote host disconnected.";
  case 0xc:
    return L"Local host disconnected.";
  case 0xd:
    return L"Dangerous parameters are detected.";
  case 0xe:
    return L"在网上没有地址.";
  case 0xf:
    return L"服务器还没准备.";
  case 0x10:
    return 
    L"Server socket listen failure. Make sure that the TCP or UDP listening port is not already in use."
    ;
  case 0x11:
    return L"个体已存在.";
  case 0x12:
    return L"访问被拒绝.";
  case 0x13:
    return L"session Guid不正确.";
  case 0x14:
    return L"credential不正确.";
  case 0x15:
    return L"hero name不正确.";
  case 0x16:
    return L"加载过程unlock后与lock后发生隔阂.";
  case 0x17:
    return L"Output parameter AdjustedGamerIDNotFilled is not filled.";
  case 0x18:
    return L"No Player Character(Hero) Found.";
  case 0x19:
    return L"UnitTestFailed";
  case 0x1a:
    return L"peer-to-peer UDP comm is blocked.";
  case 0x1b:
    return L"P2P reliable UDP failed.";
  case 0x1c:
    return L"Client-server UDP comm is blocked.";
  case 0x1d:
    return L"No common P2P group exists anymore.";
  case 0x1e:
    return L"By user request.";
  case 0x1f:
    return L"Invalid packet format. Remote host is hacked or has a bug.";
  case 0x20:
    return L"Too large message is detected. Contact technical supports.";
  case 0x21:
    return L"An unreliable message cannot be encrypted.";
  case 0x22:
    return L"Not exist value.";
  case 0x23:
    return L"Working is timeout.";
  case 0x24:
    return L"Can not found loaddata.";
  case 0x25:
    return L"SendQueue has Accumulated too much.";
  case 0x26:
    return L"Heartbeat Call in too slow.Suspected starvation";
  case 0x27:
    return L"Message uncompress fail.";
  default:
    return L"<none>";
  }
}



void FUN_140141430(undefined4 param_1)

{
  int *piVar1;
  
  piVar1 = (int *)thunk_FUN_1400a2d20();
  if (*piVar1 == 0x52) {
    FUN_140140e30(param_1);
    return;
  }
  if (*piVar1 != 0x56) {
    FUN_140141030();
    return;
  }
  FUN_140141230(param_1);
  return;
}



undefined8 * FUN_140141470(undefined8 *param_1)

{
  FUN_1400a3440();
  param_1[2] = PTR_DAT_1402f8010;
  param_1[3] = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 4) = 0;
  *(undefined2 *)((longlong)param_1 + 0x24) = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  param_1[8] = 0;
  param_1[9] = 0;
  param_1[5] = Proud::ByteArray::vftable;
  FUN_1400a3440();
  param_1[0xb] = PTR_DAT_1402f8010;
  *param_1 = 0;
  param_1[1] = 0;
  *(undefined4 *)(param_1 + 4) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_1 + 0x24) = DAT_1402f83d4;
  *(undefined4 *)(param_1 + 10) = 0;
  return param_1;
}



longlong FUN_140141510(longlong param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  
  iVar1 = *(int *)(param_2 + 0x18);
  if (-1 < iVar1) {
    FUN_14003cda0(param_1,iVar1);
    uVar2 = 0;
    uVar3 = uVar2;
    if (*(int *)(param_2 + 0x18) != 0) {
      uVar3 = *(undefined8 *)(param_2 + 0x10);
    }
    if (*(int *)(param_1 + 0x18) != 0) {
      uVar2 = *(undefined8 *)(param_1 + 0x10);
    }
    FUN_1400224d0(uVar2,uVar3,(longlong)iVar1);
    return param_1;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



// WARNING: Removing unreachable block (ram,0x000140141666)
// WARNING: Removing unreachable block (ram,0x000140141674)

void FUN_140141570(ulonglong *param_1,ulonglong *param_2)

{
  longlong *plVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  uVar3 = *param_2;
  uVar4 = *param_1;
  if (uVar4 != uVar3) {
    uVar2 = uVar4;
    if (uVar3 < uVar4) {
      uVar2 = uVar3;
      uVar3 = uVar4;
    }
    if (uVar2 != 0) {
      FUN_1400a1c30(uVar2);
    }
    if (uVar3 != 0) {
      FUN_1400a1c30(uVar3);
    }
    if (*param_2 != 0) {
      plVar1 = (longlong *)(*param_2 + 0x40);
      *plVar1 = *plVar1 + 1;
    }
    uVar4 = 0;
    if (*param_1 != 0) {
      plVar1 = (longlong *)(*param_1 + 0x40);
      *plVar1 = *plVar1 + -1;
      if (*(longlong *)(*param_1 + 0x40) == 0) {
        uVar4 = *param_1;
      }
    }
    *param_1 = *param_2;
    if (uVar2 != 0) {
      FUN_1400d1290(uVar2);
    }
    if (uVar3 != 0) {
      FUN_1400d1290(uVar3);
    }
    if (uVar4 != 0) {
      FUN_14008c910(uVar4);
    }
  }
  return;
}



longlong *
FUN_1401416a0(longlong *param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4,
             longlong param_5)

{
  int iVar1;
  longlong lVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  undefined4 *puVar5;
  
  puVar5 = (undefined4 *)0x0;
  lVar2 = FUN_1400a34c0(0x60);
  puVar3 = puVar5;
  if (lVar2 != 0) {
    puVar3 = (undefined4 *)FUN_140141470(lVar2);
  }
  FUN_14008ca00(param_1,puVar3);
  puVar3 = puVar5;
  if (*param_1 != 0) {
    puVar3 = *(undefined4 **)(*param_1 + 0x38);
  }
  *puVar3 = param_2;
  puVar3 = puVar5;
  if (*param_1 != 0) {
    puVar3 = *(undefined4 **)(*param_1 + 0x38);
  }
  puVar3[3] = param_3;
  puVar3 = puVar5;
  if (*param_1 != 0) {
    puVar3 = *(undefined4 **)(*param_1 + 0x38);
  }
  FUN_140003100(puVar3 + 4,param_4);
  puVar3 = puVar5;
  if (*param_1 != 0) {
    puVar3 = *(undefined4 **)(*param_1 + 0x38);
  }
  iVar1 = *(int *)(param_5 + 0x18);
  if (-1 < iVar1) {
    FUN_14003cda0(puVar3 + 10,iVar1);
    puVar4 = puVar5;
    if (*(int *)(param_5 + 0x18) != 0) {
      puVar4 = *(undefined4 **)(param_5 + 0x10);
    }
    if (puVar3[0x10] != 0) {
      puVar5 = *(undefined4 **)(puVar3 + 0xe);
    }
    FUN_1400224d0(puVar5,puVar4,(longlong)iVar1);
    return param_1;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



undefined8 * FUN_1401417c0(int *param_1,undefined8 *param_2)

{
  undefined *puVar1;
  int iVar2;
  int *piVar3;
  undefined8 uVar4;
  longlong *plVar5;
  undefined *puVar6;
  undefined *local_res18;
  undefined *local_res20;
  undefined *local_d8;
  undefined *local_d0;
  undefined *local_c8;
  longlong local_c0;
  longlong local_b8;
  undefined *local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined1 local_98;
  undefined8 local_90;
  undefined1 local_88;
  undefined8 local_80;
  undefined1 local_78;
  undefined8 local_70;
  undefined1 local_68;
  undefined8 local_60;
  undefined1 local_58;
  undefined8 local_50;
  undefined1 local_48;
  
  local_a8 = 0xfffffffffffffffe;
  FUN_1400a3440();
  *param_2 = PTR_DAT_1402f8010;
  iVar2 = *param_1;
  piVar3 = (int *)thunk_FUN_1400a2d20();
  if (*piVar3 == 0x52) {
    uVar4 = FUN_140140e30(iVar2);
  }
  else if (*piVar3 == 0x56) {
    uVar4 = FUN_140141230(iVar2);
  }
  else {
    uVar4 = FUN_140141030();
  }
  FUN_14003c600(param_2,L"Error=%s",uVar4);
  if ((*param_1 != param_1[1]) && (param_1[1] != 0)) {
    FUN_1400a3440();
    local_res18 = PTR_DAT_1402f8010;
    iVar2 = param_1[1];
    piVar3 = (int *)thunk_FUN_1400a2d20();
    if (*piVar3 == 0x52) {
      uVar4 = FUN_140140e30(iVar2);
    }
    else if (*piVar3 == 0x56) {
      uVar4 = FUN_140141230(iVar2);
    }
    else {
      uVar4 = FUN_140141030();
    }
    FUN_14003c600(&local_res18,L", Detail=%s",uVar4);
    FUN_14003c400(param_2,&local_res18);
    puVar6 = local_res18;
    if (((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_res18 + -8, puVar1 != (undefined *)0x0)) {
      uVar4 = FUN_1400a3440();
      local_60 = uVar4;
      FUN_1400a1c30(uVar4);
      local_58 = 1;
      piVar3 = (int *)(puVar6 + -4);
      *piVar3 = *piVar3 + -1;
      if (*piVar3 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar4);
    }
  }
  if (param_1[2] != 0) {
    FUN_1400a3440();
    local_res20 = PTR_DAT_1402f8010;
    FUN_14003c600(&local_res20,L", SocketError=%d",param_1[2]);
    FUN_14003c400(param_2,&local_res20);
    puVar6 = local_res20;
    if (((local_res20 != (undefined *)0x0) && (local_res20 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_res20 + -8, puVar1 != (undefined *)0x0)) {
      uVar4 = FUN_1400a3440();
      local_80 = uVar4;
      FUN_1400a1c30(uVar4);
      local_78 = 1;
      piVar3 = (int *)(puVar6 + -4);
      *piVar3 = *piVar3 + -1;
      if (*piVar3 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar4);
    }
  }
  if (param_1[3] != 0) {
    FUN_1400a3440();
    local_d0 = PTR_DAT_1402f8010;
    FUN_14003c600(&local_d0,L", HostID=%d",param_1[3]);
    FUN_14003c400(param_2,&local_d0);
    if ((param_1[8] != -1) && (param_1[8] != 0)) {
      FUN_1400a3440();
      local_c8 = PTR_DAT_1402f8010;
      plVar5 = (longlong *)(*(code *)**(undefined8 **)(param_1 + 6))(param_1 + 6,&local_b0);
      puVar6 = (undefined *)*plVar5;
      if ((undefined *)*plVar5 == (undefined *)0x0) {
        puVar6 = PTR_DAT_1402f8010;
      }
      FUN_14003c600(&local_c8,L", remoteAddr=%s",puVar6);
      if (((local_b0 != (undefined *)0x0) && (local_b0 != PTR_DAT_1402f8010)) &&
         (local_b0 + -8 != (undefined *)0x0)) {
        uVar4 = FUN_1400a3440();
        local_a0 = uVar4;
        FUN_1400a1c30(uVar4);
        local_98 = 1;
        piVar3 = (int *)(local_b0 + -4);
        *piVar3 = *piVar3 + -1;
        if (*piVar3 == 0) {
          FUN_1400a3530(local_b0 + -8);
        }
        FUN_1400d1290(uVar4);
      }
      FUN_14003c400(param_2,&local_c8);
      puVar6 = local_c8;
      if (((local_c8 != (undefined *)0x0) && (local_c8 != PTR_DAT_1402f8010)) &&
         (puVar1 = local_c8 + -8, puVar1 != (undefined *)0x0)) {
        uVar4 = FUN_1400a3440();
        local_90 = uVar4;
        FUN_1400a1c30(uVar4);
        local_88 = 1;
        piVar3 = (int *)(puVar6 + -4);
        *piVar3 = *piVar3 + -1;
        if (*piVar3 == 0) {
          FUN_1400a3530(puVar1);
        }
        FUN_1400d1290(uVar4);
      }
    }
    puVar6 = local_d0;
    if (((local_d0 != (undefined *)0x0) && (local_d0 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_d0 + -8, puVar1 != (undefined *)0x0)) {
      uVar4 = FUN_1400a3440();
      local_70 = uVar4;
      FUN_1400a1c30(uVar4);
      local_68 = 1;
      piVar3 = (int *)(puVar6 + -4);
      *piVar3 = *piVar3 + -1;
      if (*piVar3 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar4);
    }
  }
  puVar6 = *(undefined **)(param_1 + 4);
  if (((puVar6 != (undefined *)0x0) && (puVar6 != PTR_DAT_1402f8010)) && (0 < *(int *)(puVar6 + -8))
     ) {
    FUN_1400a3210(&local_c0);
    FUN_14003c890(param_2,&DAT_14027c73c);
    FUN_14003c890(param_2,local_c0);
    LOCK();
    piVar3 = (int *)(local_c0 + -8);
    iVar2 = *piVar3;
    *piVar3 = *piVar3 + -1;
    UNLOCK();
    if (iVar2 + -1 < 1) {
      (**(code **)(**(longlong **)(local_c0 + -0x18) + 8))();
    }
  }
  if (param_1[0x14] != 0) {
    FUN_1400a3440();
    local_d8 = PTR_DAT_1402f8010;
    FUN_14003c600(&local_d8,L", HRESULT = %d",param_1[0x14]);
    FUN_14003c400(param_2,&local_d8);
    puVar6 = local_d8;
    if (((local_d8 != (undefined *)0x0) && (local_d8 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_d8 + -8, puVar1 != (undefined *)0x0)) {
      uVar4 = FUN_1400a3440();
      local_50 = uVar4;
      FUN_1400a1c30(uVar4);
      local_48 = 1;
      piVar3 = (int *)(puVar6 + -4);
      *piVar3 = *piVar3 + -1;
      if (*piVar3 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar4);
    }
  }
  puVar6 = *(undefined **)(param_1 + 0x16);
  if (((puVar6 != (undefined *)0x0) && (puVar6 != PTR_DAT_1402f8010)) && (0 < *(int *)(puVar6 + -8))
     ) {
    FUN_1400a3210(&local_b8);
    FUN_14003c890(param_2,&DAT_14027c73c);
    FUN_14003c890(param_2,local_b8);
    LOCK();
    piVar3 = (int *)(local_b8 + -8);
    iVar2 = *piVar3;
    *piVar3 = *piVar3 + -1;
    UNLOCK();
    if (iVar2 + -1 < 1) {
      (**(code **)(**(longlong **)(local_b8 + -0x18) + 8))();
    }
  }
  return param_2;
}



void FUN_140141c40(undefined8 *param_1)

{
  *param_1 = Proud::IRmiHost::vftable;
  return;
}



void FUN_140141c50(undefined8 *param_1)

{
  *param_1 = Proud::ICompletionContext::vftable;
  return;
}



undefined8 * FUN_140141c60(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::ICompletionContext::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140141c90(undefined8 *param_1)

{
  *param_1 = Proud::ICompletionPortEventSink::vftable;
  return;
}



undefined8 * FUN_140141ca0(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::ICompletionPortEventSink::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140141cd0(undefined8 *param_1)

{
  *param_1 = Proud::ISendDest_S::vftable;
  return;
}



undefined8 * FUN_140141ce0(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::ISendDest_S::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140141d10(undefined8 *param_1)

{
  *param_1 = Proud::IUserTaskQueueOwner::vftable;
  return;
}



undefined8 * FUN_140141d20(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::IUserTaskQueueOwner::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140141d50(undefined8 *param_1)

{
  *param_1 = Proud::IVizAgentDg::vftable;
  return;
}



undefined8 * FUN_140141d60(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::IVizAgentDg::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_140141d90(void)

{
  return 0xfbf4;
}



longlong FUN_140141da0(longlong param_1)

{
  return param_1 + 0x128;
}



undefined8 FUN_140141db0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x758);
}



void FUN_140141dc0(longlong param_1)

{
  FUN_140140df0(param_1 + 0x3d0);
  return;
}



undefined8 FUN_140141dd0(void)

{
  return 64000;
}



undefined8 FUN_140141de0(void)

{
  return 0xfa14;
}



undefined1 FUN_140141df0(longlong param_1)

{
  return *(undefined1 *)(param_1 + 0x380);
}



void FUN_140141e00(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 0x380) = param_2;
  return;
}



void FUN_140141e10(longlong param_1)

{
  FUN_1400ad790(param_1 + 0x6b8);
  return;
}



void FUN_140141e20(longlong param_1,int param_2)

{
  undefined1 local_58 [88];
  
  if (param_2 == 3) {
    FUN_1400a2320(local_58,L"Not supported value yet!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  *(int *)(param_1 + 0x180) = param_2;
  return;
}



void FUN_140141e60(longlong param_1,double param_2)

{
  if ((0.0 < param_2) && (param_2 < 1.0)) {
    *(double *)(param_1 + 0x1750) = param_2;
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_140141e90(longlong *param_1,int param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140141ea3. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0x178))(param_1,(double)param_2 / 1000.0);
  return;
}



undefined4 FUN_140141eb0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x178);
}



void FUN_140141ec0(longlong param_1,undefined8 param_2)

{
  char cVar1;
  undefined1 local_58 [80];
  
  cVar1 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x90))();
  if (cVar1 != '\0') {
    FUN_1400a2320(local_58,PTR_u_Already_async_callback_may_occur_14030bd58);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  *(undefined8 *)(param_1 + 0x6b0) = param_2;
  return;
}



undefined4 FUN_140141f20(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x22c);
}



void FUN_140141f30(longlong param_1,int param_2)

{
  int iVar1;
  int iVar2;
  
  iVar1 = DAT_1402f8190;
  if (param_2 < DAT_1402f8190) {
    iVar1 = param_2;
  }
  iVar2 = 0;
  if (0 < iVar1) {
    iVar2 = iVar1;
  }
  *(int *)(param_1 + 0x194) = iVar2;
  return;
}



undefined1 FUN_140141f50(longlong param_1)

{
  return *(undefined1 *)(param_1 + 0x198);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140141f60(undefined8 param_1)

{
  undefined1 auStack_c8 [32];
  undefined8 local_a8;
  undefined1 local_98 [120];
  undefined8 local_20;
  ulonglong local_18;
  
  local_a8 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_c8;
  FUN_14018a1d0(local_98);
  local_20 = param_1;
  FUN_140169430(local_98);
  FUN_14018a210(local_98);
  return;
}



void FUN_140141fd0(longlong param_1,int param_2,longlong param_3,longlong param_4)

{
  int *piVar1;
  ulonglong uVar2;
  longlong lVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  int *piVar6;
  ulonglong uVar7;
  
  uVar2 = 0;
  piVar6 = (int *)(param_1 + 0x10);
  piVar1 = piVar6;
  uVar5 = uVar2;
  uVar7 = uVar2;
  do {
    if (*piVar1 == param_2) {
      lVar3 = (longlong)(int)uVar5;
      *(undefined4 *)(param_1 + 0x30 + lVar3 * 0x30) = *(undefined4 *)(param_3 + 8);
      *(undefined2 *)(param_1 + 0x34 + lVar3 * 0x30) = *(undefined2 *)(param_3 + 0xc);
      *(undefined4 *)(param_1 + 0x20 + lVar3 * 0x30) = *(undefined4 *)(param_4 + 8);
      *(undefined2 *)(param_1 + 0x24 + lVar3 * 0x30) = *(undefined2 *)(param_4 + 0xc);
      return;
    }
    uVar7 = uVar7 + 1;
    uVar5 = (ulonglong)((int)uVar5 + 1);
    piVar1 = piVar1 + 0xc;
    uVar4 = uVar2;
  } while ((longlong)uVar7 < 2);
  do {
    if (*piVar6 == 0) {
      lVar3 = (longlong)(int)uVar4;
      *(undefined4 *)(param_1 + 0x30 + lVar3 * 0x30) = *(undefined4 *)(param_3 + 8);
      *(undefined2 *)(param_1 + 0x34 + lVar3 * 0x30) = *(undefined2 *)(param_3 + 0xc);
      *(undefined4 *)(param_1 + 0x20 + lVar3 * 0x30) = *(undefined4 *)(param_4 + 8);
      *(undefined2 *)(param_1 + 0x24 + lVar3 * 0x30) = *(undefined2 *)(param_4 + 0xc);
      *(int *)(param_1 + 0x10 + lVar3 * 0x30) = param_2;
      return;
    }
    uVar2 = uVar2 + 1;
    piVar6 = piVar6 + 0xc;
    uVar4 = (ulonglong)((int)uVar4 + 1);
  } while ((longlong)uVar2 < 2);
  return;
}



undefined8 * FUN_1401420b0(longlong param_1,undefined8 *param_2,int param_3)

{
  int *piVar1;
  ulonglong uVar2;
  int iVar3;
  ulonglong uVar4;
  
  uVar2 = 0;
  piVar1 = (int *)(param_1 + 0x10);
  uVar4 = uVar2;
  do {
    iVar3 = (int)uVar4;
    if (*piVar1 == param_3) {
      *param_2 = Proud::AddrPort::vftable;
      *(undefined4 *)(param_2 + 1) = *(undefined4 *)(param_1 + 0x30 + (longlong)iVar3 * 0x30);
      *(undefined2 *)((longlong)param_2 + 0xc) =
           *(undefined2 *)(param_1 + 0x34 + (longlong)iVar3 * 0x30);
      return param_2;
    }
    uVar2 = uVar2 + 1;
    uVar4 = (ulonglong)(iVar3 + 1);
    piVar1 = piVar1 + 0xc;
  } while ((longlong)uVar2 < 2);
  *param_2 = Proud::AddrPort::vftable;
  *(undefined4 *)(param_2 + 1) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1402f83d4;
  return param_2;
}



undefined8 * FUN_140142130(longlong param_1,undefined8 *param_2,int param_3)

{
  int *piVar1;
  ulonglong uVar2;
  int iVar3;
  ulonglong uVar4;
  
  uVar2 = 0;
  piVar1 = (int *)(param_1 + 0x70);
  uVar4 = uVar2;
  do {
    iVar3 = (int)uVar4;
    if (*piVar1 == param_3) {
      *param_2 = Proud::AddrPort::vftable;
      *(undefined4 *)(param_2 + 1) = *(undefined4 *)(param_1 + 0x80 + (longlong)iVar3 * 0x48);
      *(undefined2 *)((longlong)param_2 + 0xc) =
           *(undefined2 *)(param_1 + 0x84 + (longlong)iVar3 * 0x48);
      return param_2;
    }
    uVar2 = uVar2 + 1;
    uVar4 = (ulonglong)(iVar3 + 1);
    piVar1 = piVar1 + 0x12;
  } while ((longlong)uVar2 < 2);
  *param_2 = Proud::AddrPort::vftable;
  *(undefined4 *)(param_2 + 1) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1402f83d4;
  return param_2;
}



undefined8 * FUN_1401421b0(longlong param_1,undefined8 *param_2,int param_3)

{
  int *piVar1;
  ulonglong uVar2;
  int iVar3;
  ulonglong uVar4;
  
  uVar2 = 0;
  piVar1 = (int *)(param_1 + 0x10);
  uVar4 = uVar2;
  do {
    iVar3 = (int)uVar4;
    if (*piVar1 == param_3) {
      *param_2 = Proud::AddrPort::vftable;
      *(undefined4 *)(param_2 + 1) = *(undefined4 *)(param_1 + 0x20 + (longlong)iVar3 * 0x30);
      *(undefined2 *)((longlong)param_2 + 0xc) =
           *(undefined2 *)(param_1 + 0x24 + (longlong)iVar3 * 0x30);
      return param_2;
    }
    uVar2 = uVar2 + 1;
    uVar4 = (ulonglong)(iVar3 + 1);
    piVar1 = piVar1 + 0xc;
  } while ((longlong)uVar2 < 2);
  *param_2 = Proud::AddrPort::vftable;
  *(undefined4 *)(param_2 + 1) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1402f83d4;
  return param_2;
}



int FUN_140142230(longlong param_1)

{
  int iVar1;
  short *psVar2;
  longlong lVar3;
  
  iVar1 = 0;
  lVar3 = 2;
  psVar2 = (short *)(param_1 + 0x24);
  do {
    if ((*(int *)(psVar2 + -2) != DAT_1402f83d0) || (*psVar2 != DAT_1402f83d4)) {
      iVar1 = iVar1 + 1;
    }
    psVar2 = psVar2 + 0x18;
    lVar3 = lVar3 + -1;
  } while (lVar3 != 0);
  return iVar1;
}



void FUN_140142270(longlong param_1)

{
  FUN_140140df0(param_1 + 0x148);
  FUN_140140df0(param_1 + 0x120);
  return;
}



undefined1 FUN_1401422b0(longlong param_1)

{
  return *(undefined1 *)(param_1 + 8);
}



void FUN_1401422c0(longlong param_1,int param_2,longlong param_3,longlong param_4)

{
  undefined4 uVar1;
  ulonglong uVar2;
  longlong lVar3;
  int *piVar4;
  ulonglong uVar5;
  undefined2 uVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  longlong lVar9;
  ulonglong uVar10;
  int *piVar11;
  
  uVar5 = 0;
  piVar11 = (int *)(param_1 + 0x70);
  piVar4 = piVar11;
  uVar7 = uVar5;
  uVar10 = uVar5;
  do {
    if (*piVar4 == param_2) {
      piVar11 = (int *)(param_1 + 0x10);
      piVar4 = piVar11;
      uVar7 = uVar5;
      uVar2 = uVar5;
      goto LAB_140142430;
    }
    uVar7 = uVar7 + 1;
    uVar10 = (ulonglong)((int)uVar10 + 1);
    piVar4 = piVar4 + 0x12;
    uVar2 = uVar5;
    uVar8 = uVar5;
  } while ((longlong)uVar7 < 2);
  while (*piVar11 != 0) {
    uVar2 = uVar2 + 1;
    piVar11 = piVar11 + 0x12;
    uVar8 = (ulonglong)((int)uVar8 + 1);
    if (1 < (longlong)uVar2) {
      return;
    }
  }
  lVar3 = (longlong)(int)uVar8;
  piVar11 = (int *)(param_1 + 0x10);
  *(int *)(param_1 + 0x70 + lVar3 * 0x48) = param_2;
  piVar4 = piVar11;
  uVar7 = uVar5;
  uVar10 = uVar5;
  do {
    if (*piVar4 == param_2) {
      lVar9 = (longlong)(int)uVar10 * 0x30;
      uVar1 = *(undefined4 *)(lVar9 + 0x30 + param_1);
      uVar6 = *(undefined2 *)(lVar9 + 0x34 + param_1);
      break;
    }
    uVar7 = uVar7 + 1;
    uVar10 = (ulonglong)((int)uVar10 + 1);
    piVar4 = piVar4 + 0xc;
    uVar1 = DAT_1402f83d0;
    uVar6 = DAT_1402f83d4;
  } while ((longlong)uVar7 < 2);
  *(undefined4 *)(param_1 + 0x80 + lVar3 * 0x48) = uVar1;
  *(undefined2 *)(param_1 + 0x84 + lVar3 * 0x48) = uVar6;
  uVar7 = uVar5;
  do {
    if (*piVar11 == param_2) {
      lVar9 = (longlong)(int)uVar7 * 0x30;
      uVar1 = *(undefined4 *)(lVar9 + 0x20 + param_1);
      uVar6 = *(undefined2 *)(lVar9 + 0x24 + param_1);
      break;
    }
    uVar5 = uVar5 + 1;
    uVar7 = (ulonglong)((int)uVar7 + 1);
    piVar11 = piVar11 + 0xc;
    uVar1 = DAT_1402f83d0;
    uVar6 = DAT_1402f83d4;
  } while ((longlong)uVar5 < 2);
  *(undefined4 *)(param_1 + 0x90 + lVar3 * 0x48) = uVar1;
  *(undefined2 *)(param_1 + 0x94 + lVar3 * 0x48) = uVar6;
  *(undefined4 *)(param_1 + 0xa0 + lVar3 * 0x48) = *(undefined4 *)(param_3 + 8);
  *(undefined2 *)(param_1 + 0xa4 + lVar3 * 0x48) = *(undefined2 *)(param_3 + 0xc);
  *(undefined4 *)(param_1 + 0xb0 + lVar3 * 0x48) = *(undefined4 *)(param_4 + 8);
  *(undefined2 *)(param_1 + 0xb4 + lVar3 * 0x48) = *(undefined2 *)(param_4 + 0xc);
  return;
  while( true ) {
    uVar7 = uVar7 + 1;
    uVar2 = (ulonglong)((int)uVar2 + 1);
    piVar4 = piVar4 + 0xc;
    uVar1 = DAT_1402f83d0;
    uVar6 = DAT_1402f83d4;
    if (1 < (longlong)uVar7) break;
LAB_140142430:
    if (*piVar4 == param_2) {
      lVar3 = (longlong)(int)uVar2 * 0x30;
      uVar1 = *(undefined4 *)(lVar3 + 0x30 + param_1);
      uVar6 = *(undefined2 *)(lVar3 + 0x34 + param_1);
      break;
    }
  }
  lVar3 = (longlong)(int)uVar10;
  *(undefined4 *)(param_1 + 0x80 + lVar3 * 0x48) = uVar1;
  *(undefined2 *)(param_1 + 0x84 + lVar3 * 0x48) = uVar6;
  uVar7 = uVar5;
  do {
    if (*piVar11 == param_2) {
      lVar9 = (longlong)(int)uVar7 * 0x30;
      uVar1 = *(undefined4 *)(lVar9 + 0x20 + param_1);
      uVar6 = *(undefined2 *)(lVar9 + 0x24 + param_1);
      break;
    }
    uVar5 = uVar5 + 1;
    uVar7 = (ulonglong)((int)uVar7 + 1);
    piVar11 = piVar11 + 0xc;
    uVar1 = DAT_1402f83d0;
    uVar6 = DAT_1402f83d4;
  } while ((longlong)uVar5 < 2);
  *(undefined4 *)(param_1 + 0x90 + lVar3 * 0x48) = uVar1;
  *(undefined2 *)(param_1 + 0x94 + lVar3 * 0x48) = uVar6;
  *(undefined4 *)(param_1 + 0xa0 + lVar3 * 0x48) = *(undefined4 *)(param_3 + 8);
  *(undefined2 *)(param_1 + 0xa4 + lVar3 * 0x48) = *(undefined2 *)(param_3 + 0xc);
  *(undefined4 *)(param_1 + 0xb0 + lVar3 * 0x48) = *(undefined4 *)(param_4 + 8);
  *(undefined2 *)(param_1 + 0xb4 + lVar3 * 0x48) = *(undefined2 *)(param_4 + 0xc);
  return;
}



undefined8 * FUN_140142520(longlong param_1,undefined8 *param_2,int param_3)

{
  int *piVar1;
  ulonglong uVar2;
  int iVar3;
  ulonglong uVar4;
  
  uVar2 = 0;
  piVar1 = (int *)(param_1 + 0x70);
  uVar4 = uVar2;
  do {
    iVar3 = (int)uVar4;
    if (*piVar1 == param_3) {
      *param_2 = Proud::AddrPort::vftable;
      *(undefined4 *)(param_2 + 1) = *(undefined4 *)(param_1 + 0xa0 + (longlong)iVar3 * 0x48);
      *(undefined2 *)((longlong)param_2 + 0xc) =
           *(undefined2 *)(param_1 + 0xa4 + (longlong)iVar3 * 0x48);
      return param_2;
    }
    uVar2 = uVar2 + 1;
    uVar4 = (ulonglong)(iVar3 + 1);
    piVar1 = piVar1 + 0x12;
  } while ((longlong)uVar2 < 2);
  *param_2 = Proud::AddrPort::vftable;
  *(undefined4 *)(param_2 + 1) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1402f83d4;
  return param_2;
}



undefined8 * FUN_1401425a0(longlong param_1,undefined8 *param_2,int param_3)

{
  int *piVar1;
  ulonglong uVar2;
  int iVar3;
  ulonglong uVar4;
  
  uVar2 = 0;
  piVar1 = (int *)(param_1 + 0x70);
  uVar4 = uVar2;
  do {
    iVar3 = (int)uVar4;
    if (*piVar1 == param_3) {
      *param_2 = Proud::AddrPort::vftable;
      *(undefined4 *)(param_2 + 1) = *(undefined4 *)(param_1 + 0xb0 + (longlong)iVar3 * 0x48);
      *(undefined2 *)((longlong)param_2 + 0xc) =
           *(undefined2 *)(param_1 + 0xb4 + (longlong)iVar3 * 0x48);
      return param_2;
    }
    uVar2 = uVar2 + 1;
    uVar4 = (ulonglong)(iVar3 + 1);
    piVar1 = piVar1 + 0x12;
  } while ((longlong)uVar2 < 2);
  *param_2 = Proud::AddrPort::vftable;
  *(undefined4 *)(param_2 + 1) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1402f83d4;
  return param_2;
}



undefined8 * FUN_140142620(undefined8 *param_1)

{
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[6] = 0;
  param_1[5] = 0;
  return param_1;
}



undefined1 * FUN_140142650(undefined1 *param_1)

{
  *param_1 = 1;
  return param_1;
}



void FUN_140142660(longlong *param_1)

{
  undefined8 *puVar1;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  return;
}



void FUN_140142680(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if (*(longlong **)(param_2 + 0x120) != param_1) {
    FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                  L"Proud::CListNode<class Proud::CRemoteClient_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  lVar1 = *(longlong *)(param_2 + 0x118);
  lVar2 = *(longlong *)(param_2 + 0x110);
  if (lVar1 != 0) {
    *(longlong *)(lVar1 + 0x110) = lVar2;
  }
  if (lVar2 != 0) {
    *(longlong *)(lVar2 + 0x118) = lVar1;
  }
  if (lVar1 == 0) {
    if (param_1[1] != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::CRemoteClient_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if (*param_1 != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::CRemoteClient_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    *param_1 = lVar1;
  }
  *(undefined8 *)(param_2 + 0x110) = 0;
  *(undefined8 *)(param_2 + 0x118) = 0;
  *(undefined8 *)(param_2 + 0x120) = 0;
  *(int *)(param_1 + 2) = (int)param_1[2] + -1;
  return;
}



int FUN_140142770(longlong param_1,int param_2)

{
  uint uVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  
  iVar4 = *(int *)(param_1 + 0x24);
  if (iVar4 == 0) {
    iVar2 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
    iVar4 = 0x400;
    if (iVar2 < 0x400) {
      iVar4 = iVar2;
    }
    iVar2 = 4;
    if (4 < iVar4) {
      iVar2 = iVar4;
    }
    iVar4 = iVar2 + param_2;
    if (iVar2 + param_2 < *(int *)(param_1 + 0x20)) {
      iVar4 = *(int *)(param_1 + 0x20);
    }
    return iVar4;
  }
  if (iVar4 != 1) {
    if (iVar4 != 2) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (param_2 < *(int *)(param_1 + 0x20)) {
      param_2 = *(int *)(param_1 + 0x20);
    }
    return param_2;
  }
  uVar1 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
  uVar3 = 0x10;
  if (0x10 < (int)uVar1) {
    uVar3 = uVar1;
  }
  if (uVar3 < 3) {
    uVar3 = 2;
  }
  iVar4 = uVar3 + param_2;
  if ((int)(uVar3 + param_2) < *(int *)(param_1 + 0x20)) {
    iVar4 = *(int *)(param_1 + 0x20);
  }
  return iVar4;
}



void FUN_140142810(undefined8 *param_1,longlong param_2,longlong param_3)

{
  undefined8 *puVar1;
  
  if (0 < param_3) {
    param_2 = param_2 - (longlong)param_1;
    do {
      puVar1 = param_1 + 4;
      param_3 = param_3 + -1;
      *param_1 = *(undefined8 *)(param_2 + (longlong)param_1);
      param_1[1] = *(undefined8 *)(param_2 + -0x18 + (longlong)puVar1);
      param_1[2] = *(undefined8 *)(param_2 + -0x10 + (longlong)puVar1);
      param_1[3] = *(undefined8 *)(param_2 + -8 + (longlong)puVar1);
      param_1 = puVar1;
    } while (param_3 != 0);
  }
  return;
}



uint FUN_140142850(longlong param_1,longlong param_2)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_2;
  if (param_2 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / *(float *)(param_1 + 0x2c);
  lVar2 = 0;
  if ((9.223372e+18 < fVar6) && (fVar6 = fVar6 - 9.223372e+18, fVar6 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  uVar5 = (uint)((longlong)fVar6 + lVar2);
  if (0xffffffff < (ulonglong)((longlong)fVar6 + lVar2)) {
    uVar5 = 0xffffffff;
  }
  iVar4 = 0;
  if (0x11 < uVar5) {
    puVar3 = &DAT_14024ea30;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_14024ea30)[iVar4];
  if ((&DAT_14024ea30)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



void FUN_1401428d0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if (*(longlong **)(param_2 + 0xa0) != param_1) {
    FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                  L"Proud::CListNode<class Proud::CUdpSocket_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  lVar1 = *(longlong *)(param_2 + 0x98);
  lVar2 = *(longlong *)(param_2 + 0x90);
  if (lVar1 != 0) {
    *(longlong *)(lVar1 + 0x90) = lVar2;
  }
  if (lVar2 != 0) {
    *(longlong *)(lVar2 + 0x98) = lVar1;
  }
  if (lVar1 == 0) {
    if (param_1[1] != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::CUdpSocket_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if (*param_1 != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::CUdpSocket_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    *param_1 = lVar1;
  }
  *(undefined8 *)(param_2 + 0x90) = 0;
  *(undefined8 *)(param_2 + 0x98) = 0;
  *(undefined8 *)(param_2 + 0xa0) = 0;
  *(int *)(param_1 + 2) = (int)param_1[2] + -1;
  return;
}



int FUN_1401429c0(longlong param_1,int param_2)

{
  uint uVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  
  iVar4 = *(int *)(param_1 + 0x24);
  if (iVar4 == 0) {
    iVar2 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
    iVar4 = 0x400;
    if (iVar2 < 0x400) {
      iVar4 = iVar2;
    }
    iVar2 = 4;
    if (4 < iVar4) {
      iVar2 = iVar4;
    }
    iVar4 = iVar2 + param_2;
    if (iVar2 + param_2 < *(int *)(param_1 + 0x20)) {
      iVar4 = *(int *)(param_1 + 0x20);
    }
    return iVar4;
  }
  if (iVar4 != 1) {
    if (iVar4 != 2) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (param_2 < *(int *)(param_1 + 0x20)) {
      param_2 = *(int *)(param_1 + 0x20);
    }
    return param_2;
  }
  uVar1 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
  uVar3 = 0x10;
  if (0x10 < (int)uVar1) {
    uVar3 = uVar1;
  }
  if (uVar3 < 0x11) {
    uVar3 = 0x10;
  }
  iVar4 = uVar3 + param_2;
  if ((int)(uVar3 + param_2) < *(int *)(param_1 + 0x20)) {
    iVar4 = *(int *)(param_1 + 0x20);
  }
  return iVar4;
}



int FUN_140142a60(longlong param_1,int param_2)

{
  uint uVar1;
  int iVar2;
  int iVar3;
  uint uVar4;
  
  iVar3 = *(int *)(param_1 + 0x24);
  if (iVar3 == 0) {
    iVar2 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
    iVar3 = 0x400;
    if (iVar2 < 0x400) {
      iVar3 = iVar2;
    }
    iVar2 = 4;
    if (4 < iVar3) {
      iVar2 = iVar3;
    }
    iVar3 = iVar2 + param_2;
    if (iVar2 + param_2 < *(int *)(param_1 + 0x20)) {
      iVar3 = *(int *)(param_1 + 0x20);
    }
    return iVar3;
  }
  if (iVar3 != 1) {
    if (iVar3 != 2) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (param_2 < *(int *)(param_1 + 0x20)) {
      param_2 = *(int *)(param_1 + 0x20);
    }
    return param_2;
  }
  uVar1 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
  uVar4 = 0x10;
  if (0x10 < (int)uVar1) {
    uVar4 = uVar1;
  }
  if (uVar4 < 5) {
    uVar4 = 4;
  }
  iVar3 = uVar4 + param_2;
  if ((int)(uVar4 + param_2) < *(int *)(param_1 + 0x20)) {
    iVar3 = *(int *)(param_1 + 0x20);
  }
  return iVar3;
}



undefined8 FUN_140142b00(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  cVar1 = FUN_140185490(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 8) = local_res8[0];
  }
  cVar1 = FUN_140185490(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0xc) = (undefined2)local_res8[0];
  }
  return param_1;
}



undefined1 FUN_140142b60(longlong param_1)

{
  char cVar1;
  
  cVar1 = FUN_1401964b0();
  if ((cVar1 != '\0') && ((*(char *)(param_1 + 0x3f8) != '\0' || (*(int *)(param_1 + 1000) != 0))))
  {
    return 1;
  }
  return 0;
}



ulonglong FUN_140142ba0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  uVar3 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  uVar4 = uVar2;
  FUN_1400a1c30(uVar2);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
              (param_1 + -0xa8,L"Proud::CNetServerImpl::GetP2PGroupCount",
               *(longlong *)(param_1 + -0xa8),param_4,uVar3,uVar4,1);
  }
  uVar1 = *(ulonglong *)(param_1 + 0x378);
  FUN_1400d1290(uVar2);
  return uVar1 & 0xffffffff;
}



ulonglong FUN_140142c30(longlong param_1)

{
  ulonglong in_RAX;
  ulonglong uVar1;
  
  if (*(longlong *)(param_1 + 0x3e0) == 0) {
    return in_RAX & 0xffffffffffffff00;
  }
  uVar1 = FUN_140189a20();
  return uVar1;
}



undefined8 * FUN_140142c60(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::IRmiHost::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void * FUN_140142c90(void *param_1,uint param_2)

{
  FUN_14018a150();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



bool FUN_140142cc0(longlong param_1)

{
  return *(longlong *)(param_1 + 0x3f8) == 0;
}



ulonglong FUN_140142cd0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  uVar3 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  uVar4 = uVar2;
  FUN_1400a1c30(uVar2);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
              (param_1 + -0xa8,L"Proud::CNetServerImpl::GetClientCount",
               *(longlong *)(param_1 + -0xa8),param_4,uVar3,uVar4,1);
  }
  uVar1 = *(ulonglong *)(param_1 + 0xbf0);
  FUN_1400d1290(uVar2);
  return uVar1 & 0xffffffff;
}



void FUN_140142d60(longlong param_1,int param_2)

{
  int iVar1;
  undefined8 uVar2;
  
  if (param_2 < 0x81) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  uVar2 = FUN_1400a3610();
  FUN_1400a1c30(uVar2);
  iVar1 = param_2;
  if (param_2 < DAT_1402f8140) {
    iVar1 = DAT_1402f8140;
  }
  DAT_1402f8140 = iVar1;
  FUN_1400d1290(uVar2);
  *(int *)(param_1 + 0x184) = param_2;
  return;
}



void FUN_140142dd0(longlong param_1,double param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 in_RDX;
  
  if ((1.0 <= param_2) || (*(longlong *)(param_1 + 0x6b0) == 0)) {
    if ((240.0 < param_2) && (*(longlong *)(param_1 + 0x6b0) != 0)) {
      FUN_1400a2b50(L"Too long timeout value. It may take a lot of time to detect lost connection.",
                    in_RDX,param_3,param_4,0xfffffffffffffffe);
    }
    uVar1 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
    FUN_1400a1c30(uVar1);
    if (DAT_140313fcf != '\0') {
      (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
                (param_1 + -0xa8,L"Proud::CNetServerImpl::SetDefaultTimeoutTimeSec");
    }
    FUN_1401872f0(param_1 + -0xa8,param_2);
    *(double *)(param_1 + 0x188) = param_2;
    FUN_1400d1290(uVar1);
  }
  else {
    FUN_1400a2b50(L"Too short timeout value. It may cause unfair disconnection.",in_RDX,param_3,
                  param_4,0xfffffffffffffffe);
  }
  return;
}



undefined8 FUN_140142ec0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  
  uVar2 = 0xfffffffffffffffe;
  uVar1 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  uVar3 = uVar1;
  FUN_1400a1c30(uVar1);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
              (param_1 + -0xa8,L"Proud::CNetServerImpl::SetDirectP2PStartCondition",
               *(longlong *)(param_1 + -0xa8),param_4,uVar2,uVar3,1);
  }
  if (1 < param_2) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(int *)(param_1 + 400) = param_2;
  FUN_1400d1290(uVar1);
  return 1;
}



undefined8 * FUN_140142f60(longlong param_1,undefined8 *param_2)

{
  if ((*(longlong **)(param_1 + 0x6a0) != (longlong *)0x0) &&
     (**(longlong **)(param_1 + 0x6a0) != 0)) {
    FUN_1400a7e50();
    return param_2;
  }
  *param_2 = Proud::AddrPort::vftable;
  *(undefined4 *)(param_2 + 1) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1402f83d4;
  return param_2;
}



undefined1 FUN_140142fc0(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  
  uVar4 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))();
  uVar5 = uVar3;
  FUN_1400a1c30(uVar3);
  lVar1 = *(longlong *)(param_1 + 0x78);
  uVar2 = (**(code **)(lVar1 + 0x18))
                    ((longlong *)(param_1 + 0x78),param_2,lVar1,param_4,uVar4,uVar5,1);
  FUN_1400d1290(uVar3);
  return uVar2;
}



bool FUN_140143030(longlong param_1)

{
  return *(longlong *)(param_1 + 0x3e0) != 0;
}



void FUN_140143040(longlong param_1,undefined1 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 local_50 [72];
  
  uVar3 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  uVar4 = uVar2;
  FUN_1400a1c30(uVar2);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
              (param_1 + -0xa8,L"Proud::CNetServerImpl::AllowEmptyP2PGroup",
               *(longlong *)(param_1 + -0xa8),param_4,uVar3,uVar4,1);
  }
  cVar1 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x90))(param_1 + -0xa8);
  if (cVar1 != '\0') {
    FUN_1400a2320(local_50,L"Cannot set AllowEmptyP2PGroup after the server has started.");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
  }
  *(undefined1 *)(param_1 + 0x1758) = param_2;
  FUN_1400d1290(uVar2);
  return;
}



void FUN_140143120(longlong param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  void *pvVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 0x58) == 0) {
    pvVar1 = operator_new(0xd0);
    uVar2 = 0;
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_14019a1d0(pvVar1,param_1 + 0x118,param_2,param_3,param_4);
    }
    *(undefined8 *)(param_1 + 0x58) = uVar2;
  }
  return;
}



bool FUN_1401431a0(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  uVar3 = 0xfffffffffffffffe;
  uVar1 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  uVar4 = uVar1;
  FUN_1400a1c30(uVar1);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
              (param_1 + -0xa8,L"Proud::CNetServerImpl::SetHostTag",*(longlong *)(param_1 + -0xa8),
               param_4,uVar3,uVar4,1);
  }
  lVar2 = (**(code **)(*(longlong *)(param_1 + 0x78) + 0x10))((longlong *)(param_1 + 0x78),param_2);
  if (lVar2 != 0) {
    *(undefined8 *)(lVar2 + 0x28) = param_3;
    FUN_1400d1290(uVar1);
  }
  else {
    FUN_1400d1290(uVar1);
  }
  return lVar2 != 0;
}



ulonglong FUN_140143260(longlong param_1,int param_2)

{
  undefined2 uVar1;
  undefined2 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  int *piVar5;
  longlong lVar6;
  int *piVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  
  uVar8 = 0;
  piVar5 = (int *)(param_1 + 0x70);
  uVar9 = uVar8;
  uVar10 = uVar8;
  do {
    if (*piVar5 == param_2) {
      lVar6 = (longlong)(int)uVar10;
      uVar3 = *(undefined4 *)(param_1 + 0x90 + lVar6 * 0x48);
      uVar1 = *(undefined2 *)(param_1 + 0x94 + lVar6 * 0x48);
      uVar4 = *(undefined4 *)(param_1 + 0x80 + lVar6 * 0x48);
      uVar2 = *(undefined2 *)(param_1 + 0x84 + lVar6 * 0x48);
      piVar5 = (int *)(param_1 + 0x10);
      piVar7 = piVar5;
      uVar9 = uVar8;
      uVar10 = uVar8;
      do {
        if (*piVar7 == param_2) {
          lVar6 = (longlong)(int)uVar10;
          *(undefined4 *)(param_1 + 0x30 + lVar6 * 0x30) = uVar4;
          *(undefined2 *)(param_1 + 0x34 + lVar6 * 0x30) = uVar2;
          *(undefined2 *)(param_1 + 0x24 + lVar6 * 0x30) = uVar1;
          *(undefined4 *)(param_1 + 0x20 + lVar6 * 0x30) = uVar3;
          return CONCAT71((int7)(int3)(uVar10 >> 8),1);
        }
        uVar9 = uVar9 + 1;
        uVar10 = (ulonglong)((int)uVar10 + 1);
        piVar7 = piVar7 + 0xc;
        uVar11 = uVar8;
      } while ((longlong)uVar9 < 2);
      do {
        if (*piVar5 == 0) {
          lVar6 = (longlong)(int)uVar11;
          *(undefined4 *)(param_1 + 0x30 + lVar6 * 0x30) = uVar4;
          *(undefined2 *)(param_1 + 0x34 + lVar6 * 0x30) = uVar2;
          *(undefined2 *)(param_1 + 0x24 + lVar6 * 0x30) = uVar1;
          *(undefined4 *)(param_1 + 0x20 + lVar6 * 0x30) = uVar3;
          *(int *)(param_1 + 0x10 + lVar6 * 0x30) = param_2;
          return CONCAT71((int7)(int3)(uVar11 >> 8),1);
        }
        uVar8 = uVar8 + 1;
        piVar5 = piVar5 + 0xc;
        uVar11 = (ulonglong)((int)uVar11 + 1);
      } while ((longlong)uVar8 < 2);
      return CONCAT71((int7)(uVar8 >> 8),1);
    }
    uVar9 = uVar9 + 1;
    uVar10 = (ulonglong)((int)uVar10 + 1);
    piVar5 = piVar5 + 0x12;
  } while ((longlong)uVar9 < 2);
  return (ulonglong)piVar5 & 0xffffffffffffff00;
}



void FUN_140143380(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x0001401433a7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



void FUN_1401433c0(longlong param_1,int param_2)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  int iVar4;
  undefined8 uVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  int iVar8;
  longlong lVar9;
  undefined1 local_58 [80];
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar4 = FUN_14018a400();
      plVar2 = *(longlong **)(param_1 + 8);
      lVar9 = (longlong)iVar4;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar2 == (longlong *)0x0) {
          uVar5 = FUN_1400a34c0(lVar9 << 6);
          *(undefined8 *)(param_1 + 0x10) = uVar5;
        }
        else {
          uVar5 = (**(code **)(*plVar2 + 8))(plVar2,lVar9 << 6);
          *(undefined8 *)(param_1 + 0x10) = uVar5;
        }
      }
      else {
        lVar3 = *(longlong *)(param_1 + 0x10);
        if (plVar2 == (longlong *)0x0) {
          puVar6 = (undefined8 *)FUN_1400a34c0(lVar9 << 6);
        }
        else {
          puVar6 = (undefined8 *)(**(code **)(*plVar2 + 8))();
        }
        iVar1 = *(int *)(param_1 + 0x18);
        iVar8 = 0;
        if (0 < iVar1) {
          lVar9 = lVar3 - (longlong)puVar6;
          puVar7 = puVar6;
          do {
            if (puVar7 != (undefined8 *)0x0) {
              *puVar7 = *(undefined8 *)(lVar9 + (longlong)puVar7);
              puVar7[1] = *(undefined8 *)(lVar9 + 8 + (longlong)puVar7);
              puVar7[2] = *(undefined8 *)(lVar9 + 0x10 + (longlong)puVar7);
              puVar7[3] = *(undefined8 *)(lVar9 + 0x18 + (longlong)puVar7);
              puVar7[4] = *(undefined8 *)(lVar9 + 0x20 + (longlong)puVar7);
              puVar7[5] = *(undefined8 *)(lVar9 + 0x28 + (longlong)puVar7);
              puVar7[6] = *(undefined8 *)(lVar9 + 0x30 + (longlong)puVar7);
              puVar7[7] = *(undefined8 *)(lVar9 + 0x38 + (longlong)puVar7);
            }
            iVar8 = iVar8 + 1;
            puVar7 = puVar7 + 8;
          } while (iVar8 < iVar1);
        }
        if (puVar6 == (undefined8 *)0x0) {
          FUN_1400a2320(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
        }
        plVar2 = *(longlong **)(param_1 + 8);
        if (plVar2 == (longlong *)0x0) {
          FUN_1400a3530(lVar3);
        }
        else {
          (**(code **)(*plVar2 + 0x18))(plVar2,lVar3);
        }
        *(undefined8 **)(param_1 + 0x10) = puVar6;
      }
      *(int *)(param_1 + 0x1c) = iVar4;
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_140143550(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_1400acbf0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_140143580(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x0001401435a7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



void FUN_1401435c0(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_14018f890(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_1401435f0(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x000140143617. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



void FUN_140143630(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<int,1>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x000140143657. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



void FUN_140143670(longlong param_1,int param_2)

{
  int iVar1;
  longlong *plVar2;
  int iVar3;
  longlong lVar4;
  int iVar5;
  undefined1 local_58 [80];
  
  iVar1 = *(int *)(param_1 + 0x1c);
  iVar3 = iVar1;
  if (iVar1 < param_2) {
    iVar3 = param_2;
  }
  iVar5 = *(int *)(param_1 + 0x20);
  if ((*(int *)(param_1 + 0x20) <= iVar3) && (iVar5 = param_2, param_2 <= iVar1)) {
    iVar5 = iVar1;
  }
  if (iVar1 < iVar5) {
    plVar2 = *(longlong **)(param_1 + 8);
    if (iVar1 == 0) {
      if (plVar2 == (longlong *)0x0) {
        lVar4 = FUN_1400a34c0((longlong)iVar5 << 2);
      }
      else {
        lVar4 = (**(code **)(*plVar2 + 8))(plVar2,(longlong)iVar5 << 2);
      }
    }
    else {
      if (plVar2 == (longlong *)0x0) {
        lVar4 = FUN_1400a34f0(*(undefined8 *)(param_1 + 0x10),(longlong)iVar5 << 2);
      }
      else {
        lVar4 = (**(code **)(*plVar2 + 0x10))
                          (plVar2,*(undefined8 *)(param_1 + 0x10),(longlong)iVar5 << 2);
      }
      if (lVar4 == 0) {
        FUN_1400a2320(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
    }
    *(longlong *)(param_1 + 0x10) = lVar4;
    *(int *)(param_1 + 0x1c) = iVar5;
  }
  return;
}



void FUN_140143730(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_140195650(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_140143760(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x000140143787. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



undefined8 * FUN_1401437a0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_140143800(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_140143860(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1401438c0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<int,1>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_140143920(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140143980(longlong param_1,int param_2)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  undefined1 local_58 [80];
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar2 = FUN_1401429c0();
      plVar1 = *(longlong **)(param_1 + 8);
      lVar3 = (longlong)iVar2;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_1400a34c0(lVar3 << 2);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 8))(plVar1,lVar3 << 2);
        }
      }
      else {
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_1400a34f0(*(undefined8 *)(param_1 + 0x10),lVar3 << 2);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 0x10))(plVar1,*(undefined8 *)(param_1 + 0x10),lVar3 << 2);
        }
        if (lVar3 == 0) {
          FUN_1400a2320(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
        }
      }
      *(longlong *)(param_1 + 0x10) = lVar3;
      *(int *)(param_1 + 0x1c) = iVar2;
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_140143a50(longlong param_1,int param_2,int param_3)

{
  undefined8 *puVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  
  if ((-1 < param_2) && (-1 < param_3)) {
    iVar2 = *(int *)(param_1 + 0x18) - param_2;
    if (iVar2 <= param_3) {
      param_3 = iVar2;
    }
    if (0 < iVar2 - param_3) {
      lVar6 = (longlong)(iVar2 - param_3);
      lVar5 = (longlong)param_2 * 0x18;
      do {
        lVar3 = FUN_1401b2160(param_1);
        lVar3 = lVar3 + (longlong)param_3 * 0x18;
        lVar4 = FUN_1401b2160(param_1);
        *(undefined8 *)(lVar4 + lVar5) = *(undefined8 *)(lVar3 + lVar5);
        puVar1 = (undefined8 *)(lVar3 + 8 + lVar5);
        lVar5 = lVar5 + 0x18;
        lVar6 = lVar6 + -1;
        *(undefined8 *)(lVar4 + -0x10 + lVar5) = *puVar1;
        *(undefined8 *)(lVar4 + -8 + lVar5) = *(undefined8 *)(lVar3 + -8 + lVar5);
      } while (lVar6 != 0);
    }
    FUN_140143f20(param_1,*(int *)(param_1 + 0x18) - param_3);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_140143b10(undefined8 *param_1,longlong param_2,longlong param_3)

{
  ulonglong uVar1;
  undefined8 *puVar2;
  longlong lVar3;
  void *pvVar4;
  int iVar5;
  undefined8 *puVar6;
  longlong lVar7;
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (-1 < param_3) {
    param_1[3] = param_3;
  }
  if (param_2 == 0) {
    if ((100 < (ulonglong)param_1[2]) && ((void *)*param_1 != (void *)0x0)) {
      operator_delete__((void *)*param_1);
      *param_1 = 0;
    }
    param_1[1] = 0;
    param_1[2] = 100;
    return;
  }
  uVar1 = param_1[2];
  if ((longlong)uVar1 < param_2) {
    lVar3 = param_1[3];
    if (lVar3 == 0) {
      lVar3 = (longlong)(param_1[1] + (ulonglong)((uint)((longlong)param_1[1] >> 0x3f) & 7)) >> 3;
      if (lVar3 < 4) {
        lVar3 = 4;
      }
      else if (0x400 < lVar3) {
        lVar3 = 0x400;
      }
    }
    lVar7 = param_2;
    if (param_2 < (longlong)(lVar3 + uVar1)) {
      lVar7 = lVar3 + uVar1;
    }
    if (lVar7 < (longlong)uVar1) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    pvVar4 = operator_new(lVar7 << 5);
    puVar2 = param_1 + 4;
    if (100 < (ulonglong)param_1[2]) {
      puVar2 = (undefined8 *)*param_1;
    }
    FUN_140142810(pvVar4,puVar2,param_1[1]);
    memset((void *)(param_1[1] * 0x20 + (longlong)pvVar4),0,(param_2 - param_1[1]) * 0x20);
    iVar5 = 0;
    lVar3 = param_2 - param_1[1];
    if (0 < lVar3) {
      puVar6 = (undefined8 *)((longlong)pvVar4 + param_1[1] * 0x20 + 0x18);
      do {
        if (puVar6 + -3 != (undefined8 *)0x0) {
          *(undefined4 *)(puVar6 + -3) = 0;
          puVar6[-2] = 0;
          *puVar6 = 0;
          puVar6[-1] = 0;
        }
        iVar5 = iVar5 + 1;
        puVar6 = puVar6 + 4;
      } while (iVar5 < lVar3);
    }
    if (100 < (ulonglong)param_1[2]) {
      operator_delete__(puVar2);
    }
    *param_1 = pvVar4;
    param_1[2] = lVar7;
  }
  else {
    puVar2 = param_1 + 4;
    if (100 < uVar1) {
      puVar2 = (undefined8 *)*param_1;
    }
    lVar3 = param_1[1];
    if (lVar3 < param_2) {
      iVar5 = 0;
      if (0 < param_2 - lVar3) {
        puVar2 = puVar2 + lVar3 * 4 + 3;
        do {
          if (puVar2 + -3 != (undefined8 *)0x0) {
            *(undefined4 *)(puVar2 + -3) = 0;
            puVar2[-2] = 0;
            *puVar2 = 0;
            puVar2[-1] = 0;
          }
          iVar5 = iVar5 + 1;
          puVar2 = puVar2 + 4;
        } while ((longlong)iVar5 < param_2 - lVar3);
        param_1[1] = param_2;
        return;
      }
    }
  }
  param_1[1] = param_2;
  return;
}



void FUN_140143d00(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  undefined1 local_58 [88];
  
  lVar1 = *param_1;
  while( true ) {
    if (lVar1 == 0) {
      return;
    }
    lVar1 = *param_1;
    if (*(longlong **)(lVar1 + 0x120) != param_1) break;
    lVar2 = *(longlong *)(lVar1 + 0x118);
    lVar3 = *(longlong *)(lVar1 + 0x110);
    if (lVar2 != 0) {
      *(longlong *)(lVar2 + 0x110) = lVar3;
    }
    if (lVar3 != 0) {
      *(longlong *)(lVar3 + 0x118) = lVar2;
    }
    if (lVar2 == 0) {
      if (param_1[1] != lVar1) {
        FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                      L"Proud::CListNode<class Proud::CRemoteClient_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      param_1[1] = lVar3;
    }
    if (lVar3 == 0) {
      if (*param_1 != lVar1) {
        FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                      L"Proud::CListNode<class Proud::CRemoteClient_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      *param_1 = lVar2;
    }
    *(undefined8 *)(lVar1 + 0x110) = 0;
    *(undefined8 *)(lVar1 + 0x118) = 0;
    *(undefined8 *)(lVar1 + 0x120) = 0;
    *(int *)(param_1 + 2) = (int)param_1[2] + -1;
    lVar1 = *param_1;
  }
  FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                L"Proud::CListNode<class Proud::CRemoteClient_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_140143e10(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  undefined1 local_58 [88];
  
  lVar1 = *param_1;
  while( true ) {
    if (lVar1 == 0) {
      return;
    }
    lVar1 = *param_1;
    if (*(longlong **)(lVar1 + 0xa0) != param_1) break;
    lVar2 = *(longlong *)(lVar1 + 0x98);
    lVar3 = *(longlong *)(lVar1 + 0x90);
    if (lVar2 != 0) {
      *(longlong *)(lVar2 + 0x90) = lVar3;
    }
    if (lVar3 != 0) {
      *(longlong *)(lVar3 + 0x98) = lVar2;
    }
    if (lVar2 == 0) {
      if (param_1[1] != lVar1) {
        FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                      L"Proud::CListNode<class Proud::CUdpSocket_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      param_1[1] = lVar3;
    }
    if (lVar3 == 0) {
      if (*param_1 != lVar1) {
        FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                      L"Proud::CListNode<class Proud::CUdpSocket_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      *param_1 = lVar2;
    }
    *(undefined8 *)(lVar1 + 0x90) = 0;
    *(undefined8 *)(lVar1 + 0x98) = 0;
    *(undefined8 *)(lVar1 + 0xa0) = 0;
    *(int *)(param_1 + 2) = (int)param_1[2] + -1;
    lVar1 = *param_1;
  }
  FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                L"Proud::CListNode<class Proud::CUdpSocket_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_140143f20(longlong param_1,int param_2)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  int iVar4;
  undefined8 uVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  int iVar8;
  longlong lVar9;
  undefined1 local_58 [80];
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar4 = FUN_140142770();
      plVar2 = *(longlong **)(param_1 + 8);
      lVar9 = (longlong)iVar4;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar2 == (longlong *)0x0) {
          uVar5 = FUN_1400a34c0(lVar9 * 0x18);
          *(undefined8 *)(param_1 + 0x10) = uVar5;
        }
        else {
          uVar5 = (**(code **)(*plVar2 + 8))(plVar2,lVar9 * 0x18);
          *(undefined8 *)(param_1 + 0x10) = uVar5;
        }
      }
      else {
        lVar3 = *(longlong *)(param_1 + 0x10);
        if (plVar2 == (longlong *)0x0) {
          puVar6 = (undefined8 *)FUN_1400a34c0(lVar9 * 0x18);
        }
        else {
          puVar6 = (undefined8 *)(**(code **)(*plVar2 + 8))();
        }
        iVar1 = *(int *)(param_1 + 0x18);
        iVar8 = 0;
        if (0 < iVar1) {
          lVar9 = lVar3 - (longlong)puVar6;
          puVar7 = puVar6;
          do {
            if (puVar7 != (undefined8 *)0x0) {
              *puVar7 = *(undefined8 *)(lVar9 + (longlong)puVar7);
              puVar7[1] = *(undefined8 *)(lVar9 + 8 + (longlong)puVar7);
              puVar7[2] = *(undefined8 *)(lVar9 + 0x10 + (longlong)puVar7);
            }
            iVar8 = iVar8 + 1;
            puVar7 = puVar7 + 3;
          } while (iVar8 < iVar1);
        }
        if (puVar6 == (undefined8 *)0x0) {
          FUN_1400a2320(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
        }
        plVar2 = *(longlong **)(param_1 + 8);
        if (plVar2 == (longlong *)0x0) {
          FUN_1400a3530(lVar3);
        }
        else {
          (**(code **)(*plVar2 + 0x18))(plVar2,lVar3);
        }
        *(undefined8 **)(param_1 + 0x10) = puVar6;
      }
      *(int *)(param_1 + 0x1c) = iVar4;
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_140144090(longlong param_1,int param_2)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  int iVar4;
  undefined8 *puVar5;
  undefined4 *puVar6;
  longlong lVar7;
  int iVar8;
  int iVar9;
  undefined1 local_58 [80];
  
  lVar7 = (longlong)param_2;
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  iVar8 = *(int *)(param_1 + 0x18);
  if (param_2 != iVar8) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar8 = FUN_140142a60(param_1);
      plVar1 = *(longlong **)(param_1 + 8);
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          puVar5 = (undefined8 *)FUN_1400a34c0((longlong)iVar8 << 4);
        }
        else {
          puVar5 = (undefined8 *)(**(code **)(*plVar1 + 8))();
        }
        *(undefined8 **)(param_1 + 0x10) = puVar5;
        if (0 < param_2) {
          do {
            if (puVar5 != (undefined8 *)0x0) {
              *puVar5 = Proud::AddrPort::vftable;
              *(undefined4 *)(puVar5 + 1) = 0;
              *(undefined2 *)((longlong)puVar5 + 0xc) = 0;
            }
            puVar5 = puVar5 + 2;
            lVar7 = lVar7 + -1;
          } while (lVar7 != 0);
        }
      }
      else {
        lVar7 = *(longlong *)(param_1 + 0x10);
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_1400a34c0((longlong)iVar8 << 4);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 8))();
        }
        iVar2 = *(int *)(param_1 + 0x18);
        iVar4 = 0;
        if (0 < iVar2) {
          puVar6 = (undefined4 *)(lVar3 + 8);
          iVar9 = iVar4;
          do {
            if ((undefined8 *)(puVar6 + -2) != (undefined8 *)0x0) {
              *(undefined ***)(puVar6 + -2) = Proud::AddrPort::vftable;
              *puVar6 = *(undefined4 *)((lVar7 - lVar3) + (longlong)puVar6);
              *(undefined2 *)(puVar6 + 1) = *(undefined2 *)((lVar7 - lVar3) + 4 + (longlong)puVar6);
            }
            iVar9 = iVar9 + 1;
            puVar6 = puVar6 + 4;
          } while (iVar9 < iVar2);
        }
        iVar2 = param_2 - *(int *)(param_1 + 0x18);
        puVar5 = (undefined8 *)((longlong)*(int *)(param_1 + 0x18) * 0x10 + lVar3);
        if (0 < iVar2) {
          do {
            if (puVar5 != (undefined8 *)0x0) {
              *puVar5 = Proud::AddrPort::vftable;
              *(undefined4 *)(puVar5 + 1) = 0;
              *(undefined2 *)((longlong)puVar5 + 0xc) = 0;
            }
            iVar4 = iVar4 + 1;
            puVar5 = puVar5 + 2;
          } while (iVar4 < iVar2);
        }
        if (lVar3 == 0) {
          FUN_1400a2320(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
        }
        plVar1 = *(longlong **)(param_1 + 8);
        if (plVar1 == (longlong *)0x0) {
          FUN_1400a3530(lVar7);
        }
        else {
          (**(code **)(*plVar1 + 0x18))(plVar1,lVar7);
        }
        *(longlong *)(param_1 + 0x10) = lVar3;
      }
      *(int *)(param_1 + 0x1c) = iVar8;
    }
    else if ((iVar8 - param_2 < 1) && (iVar2 = param_2 - iVar8, 0 < iVar2)) {
      puVar5 = (undefined8 *)((longlong)iVar8 * 0x10 + *(longlong *)(param_1 + 0x10));
      iVar8 = 0;
      if (0 < iVar2) {
        do {
          if (puVar5 != (undefined8 *)0x0) {
            *puVar5 = Proud::AddrPort::vftable;
            *(undefined4 *)(puVar5 + 1) = 0;
            *(undefined2 *)((longlong)puVar5 + 0xc) = 0;
          }
          iVar8 = iVar8 + 1;
          puVar5 = puVar5 + 2;
        } while (iVar8 < iVar2);
      }
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_1401442d0(undefined8 *param_1,longlong param_2,longlong param_3)

{
  longlong lVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  longlong lVar4;
  undefined8 *puVar5;
  longlong lVar6;
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (-1 < param_3) {
    param_1[3] = param_3;
  }
  if (param_2 == 0) {
    if ((100 < (ulonglong)param_1[2]) && ((void *)*param_1 != (void *)0x0)) {
      operator_delete__((void *)*param_1);
      *param_1 = 0;
    }
    param_1[2] = 100;
    param_1[1] = 0;
    return;
  }
  lVar4 = param_1[2];
  if (param_2 <= lVar4) {
    param_1[1] = param_2;
    return;
  }
  lVar1 = param_1[3];
  if (lVar1 == 0) {
    lVar1 = (longlong)(param_1[1] + (ulonglong)((uint)((longlong)param_1[1] >> 0x3f) & 7)) >> 3;
    if (lVar1 < 4) {
      lVar1 = 4;
    }
    else if (0x400 < lVar1) {
      lVar1 = 0x400;
    }
  }
  lVar6 = param_2;
  if (param_2 < lVar1 + lVar4) {
    lVar6 = lVar1 + lVar4;
  }
  if (lVar6 < lVar4) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  puVar2 = operator_new(lVar6 * 4);
  puVar5 = param_1 + 4;
  if (100 < (ulonglong)param_1[2]) {
    puVar5 = (undefined8 *)*param_1;
  }
  lVar4 = param_1[1];
  if (0 < lVar4) {
    puVar3 = puVar2;
    do {
      lVar4 = lVar4 + -1;
      *puVar3 = *(undefined4 *)(((longlong)puVar5 - (longlong)puVar2) + (longlong)puVar3);
      puVar3 = puVar3 + 1;
    } while (lVar4 != 0);
  }
  memset(puVar2 + param_1[1],0,(param_2 - param_1[1]) * 4);
  if (100 < (ulonglong)param_1[2]) {
    operator_delete__(puVar5);
  }
  *param_1 = puVar2;
  param_1[2] = lVar6;
  param_1[1] = param_2;
  return;
}



void FUN_140144430(char *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  undefined1 local_58 [88];
  
  if (*param_1 != '\0') {
    iVar4 = 0;
    if ((*(longlong *)(param_1 + 0x20) != 0) && (*(longlong *)(param_1 + 8) == 0)) {
      FUN_1400a2320(local_58,L"CFastMap consistency error #0!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    lVar1 = *(longlong *)(param_1 + 0x10);
    lVar3 = lVar1;
    while (lVar3 != 0) {
      lVar2 = *(longlong *)(lVar3 + 0x18);
      if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x20) != lVar3)) {
        FUN_1400a2320(local_58,L"CFastMap consistency error #1!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      if ((lVar3 == lVar1) && (*(longlong *)(lVar3 + 0x20) != 0)) {
        FUN_1400a2320(local_58,L"CFastMap consistency error #2!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      if ((lVar3 == *(longlong *)(param_1 + 0x18)) && (lVar2 != 0)) {
        FUN_1400a2320(local_58,L"CFastMap consistency error #3!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      iVar4 = iVar4 + 1;
      lVar3 = lVar2;
    }
    if (iVar4 != *(int *)(param_1 + 0x20)) {
      for (; lVar1 != 0; lVar1 = *(longlong *)(lVar1 + 0x18)) {
      }
      FUN_1400a2320(local_58,L"CFastMap consistency error #4!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
  }
  return;
}



undefined8 FUN_140144560(longlong param_1,uint param_2,char param_3)

{
  void *_Dst;
  ulonglong uVar1;
  longlong lVar2;
  longlong lVar3;
  size_t _Size;
  float fVar4;
  float fVar5;
  
  if (*(longlong *)(param_1 + 8) != 0) {
    FUN_1400a3530();
    *(undefined8 *)(param_1 + 8) = 0;
  }
  if (param_3 != '\0') {
    _Size = (ulonglong)param_2 << 3;
    _Dst = (void *)FUN_1400a34c0(_Size);
    *(void **)(param_1 + 8) = _Dst;
    if (_Dst == (void *)0x0) {
      return 0;
    }
    memset(_Dst,0,_Size);
  }
  lVar2 = 0;
  *(uint *)(param_1 + 0x28) = param_2;
  fVar4 = (float)param_2;
  fVar5 = fVar4 * *(float *)(param_1 + 0x34);
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar4 = fVar4 * *(float *)(param_1 + 0x30);
  lVar3 = 0;
  *(longlong *)(param_1 + 0x38) = (longlong)fVar5 + lVar2;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  uVar1 = (longlong)fVar4 + lVar3;
  if ((ulonglong)((longlong)fVar4 + lVar3) < 0x11) {
    uVar1 = 0;
  }
  *(ulonglong *)(param_1 + 0x40) = uVar1;
  return CONCAT71((int7)(uVar1 >> 8),1);
}



void FUN_140144650(longlong param_1,int param_2,longlong param_3,int param_4)

{
  undefined8 *puVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  
  lVar8 = (longlong)param_4;
  lVar6 = (longlong)param_2;
  if (((-1 < param_4) && (-1 < param_2)) && (param_2 <= *(int *)(param_1 + 0x18))) {
    iVar4 = *(int *)(param_1 + 0x18);
    FUN_140143f20(param_1,iVar4 + param_4);
    iVar4 = iVar4 - param_2;
    if ((0 < iVar4) && (iVar4 = iVar4 + -1, lVar7 = (longlong)iVar4, -1 < iVar4)) {
      lVar5 = (lVar8 + lVar6 + lVar7) * 0x18;
      do {
        lVar2 = FUN_1401b2160(param_1);
        lVar2 = lVar8 * -0x18 + lVar2;
        lVar3 = FUN_1401b2160(param_1);
        *(undefined8 *)(lVar3 + lVar5) = *(undefined8 *)(lVar2 + lVar5);
        puVar1 = (undefined8 *)(lVar2 + 8 + lVar5);
        lVar5 = lVar5 + -0x18;
        lVar7 = lVar7 + -1;
        *(undefined8 *)(lVar3 + 0x20 + lVar5) = *puVar1;
        *(undefined8 *)(lVar3 + 0x28 + lVar5) = *(undefined8 *)(lVar2 + 0x28 + lVar5);
      } while (-1 < lVar7);
    }
    if (0 < param_4) {
      lVar7 = lVar6 * 0x18;
      param_3 = param_3 + lVar6 * -0x18;
      do {
        lVar6 = FUN_1401b2160(param_1);
        puVar1 = (undefined8 *)(param_3 + lVar7);
        lVar7 = lVar7 + 0x18;
        lVar8 = lVar8 + -1;
        *(undefined8 *)(lVar6 + -0x18 + lVar7) = *puVar1;
        *(undefined8 *)(lVar6 + -0x10 + lVar7) = *(undefined8 *)(param_3 + -0x10 + lVar7);
        *(undefined8 *)(lVar6 + -8 + lVar7) = *(undefined8 *)(param_3 + -8 + lVar7);
      } while (lVar8 != 0);
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_140144770(longlong param_1,int param_2,longlong param_3,int param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined2 *puVar3;
  undefined2 *puVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  
  lVar7 = (longlong)param_4;
  if (((-1 < param_4) && (-1 < param_2)) && (param_2 <= *(int *)(param_1 + 0x18))) {
    iVar5 = *(int *)(param_1 + 0x18);
    FUN_140144090(param_1,iVar5 + param_4);
    iVar5 = iVar5 - param_2;
    if ((0 < iVar5) && (iVar5 = iVar5 + -1, lVar8 = (longlong)iVar5, -1 < iVar5)) {
      lVar6 = (lVar8 + param_2 + lVar7) * 0x10;
      do {
        lVar1 = FUN_1401b2160(param_1);
        lVar1 = lVar1 + lVar7 * -0x10;
        lVar2 = FUN_1401b2160(param_1);
        *(undefined4 *)(lVar2 + 8 + lVar6) = *(undefined4 *)(lVar1 + 8 + lVar6);
        puVar3 = (undefined2 *)(lVar1 + 0xc + lVar6);
        lVar6 = lVar6 + -0x10;
        lVar8 = lVar8 + -1;
        *(undefined2 *)(lVar2 + 0x1c + lVar6) = *puVar3;
      } while (-1 < lVar8);
    }
    if (0 < lVar7) {
      puVar3 = (undefined2 *)(param_3 + 0xc);
      do {
        lVar8 = FUN_1401b2160(param_1);
        puVar4 = puVar3 + 8;
        lVar8 = lVar8 + ((longlong)param_2 * 0x10 - param_3) + -0xc;
        lVar7 = lVar7 + -1;
        *(undefined4 *)(lVar8 + -8 + (longlong)puVar4) = *(undefined4 *)(puVar3 + -2);
        *(undefined2 *)(lVar8 + -4 + (longlong)puVar4) = *puVar3;
        puVar3 = puVar4;
      } while (lVar7 != 0);
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_140144880(longlong param_1,uint param_2)

{
  ulonglong uVar1;
  undefined8 uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  void *_Dst;
  longlong lVar5;
  longlong lVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  int iVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  float fVar12;
  float fVar13;
  
  if (param_2 == 0) {
    param_2 = FUN_140142850();
  }
  if (param_2 != *(uint *)(param_1 + 0x28)) {
    if (*(longlong *)(param_1 + 8) == 0) {
      lVar5 = 0;
      *(uint *)(param_1 + 0x28) = param_2;
      fVar13 = (float)param_2 * *(float *)(param_1 + 0x34);
      if ((9.223372e+18 < fVar13) && (fVar13 = fVar13 - 9.223372e+18, fVar13 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      fVar12 = (float)param_2 * *(float *)(param_1 + 0x30);
      lVar6 = 0;
      *(longlong *)(param_1 + 0x38) = (longlong)fVar13 + lVar5;
      if ((9.223372e+18 < fVar12) && (fVar12 = fVar12 - 9.223372e+18, fVar12 < 9.223372e+18)) {
        lVar6 = -0x8000000000000000;
      }
      *(longlong *)(param_1 + 0x40) = (longlong)fVar12 + lVar6;
      if ((ulonglong)((longlong)fVar12 + lVar6) < 0x11) {
        *(undefined8 *)(param_1 + 0x40) = 0;
        return;
      }
    }
    else {
      _Dst = (void *)FUN_1400a34c0((ulonglong)param_2 << 3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x8007000e);
      }
      memset(_Dst,0,(ulonglong)param_2 << 3);
      uVar7 = 0;
      uVar4 = *(ulonglong *)(param_1 + 0x10);
      uVar10 = uVar7;
      uVar11 = uVar7;
      while (uVar4 != 0) {
        uVar1 = *(ulonglong *)(uVar4 + 8);
        uVar3 = (ulonglong)*(uint *)(uVar4 + 0x18) % (ulonglong)param_2;
        lVar5 = *(longlong *)((longlong)_Dst + uVar3 * 8);
        iVar9 = (int)uVar10;
        if (iVar9 == 0) {
          *(undefined8 *)(uVar4 + 0x10) = 0;
          *(undefined8 *)(uVar4 + 8) = 0;
          uVar10 = 1;
          uVar7 = uVar4;
          uVar11 = uVar4;
        }
        else if (lVar5 == 0) {
          *(undefined8 *)(uVar4 + 0x10) = 0;
          *(ulonglong *)(uVar4 + 8) = uVar7;
          if (uVar7 != 0) {
            *(ulonglong *)(uVar7 + 0x10) = uVar4;
          }
          uVar10 = (ulonglong)(iVar9 + 1);
          uVar7 = uVar4;
        }
        else {
          uVar8 = uVar4;
          if (*(longlong *)(lVar5 + 0x10) != 0) {
            *(ulonglong *)(*(longlong *)(lVar5 + 0x10) + 8) = uVar4;
            uVar8 = uVar7;
          }
          uVar2 = *(undefined8 *)(lVar5 + 0x10);
          *(longlong *)(uVar4 + 8) = lVar5;
          uVar10 = (ulonglong)(iVar9 + 1);
          *(undefined8 *)(uVar4 + 0x10) = uVar2;
          *(ulonglong *)(lVar5 + 0x10) = uVar4;
          uVar7 = uVar8;
        }
        *(ulonglong *)((longlong)_Dst + uVar3 * 8) = uVar4;
        uVar4 = uVar1;
      }
      FUN_1400a3530(*(undefined8 *)(param_1 + 8));
      *(void **)(param_1 + 8) = _Dst;
      *(uint *)(param_1 + 0x28) = param_2;
      *(ulonglong *)(param_1 + 0x10) = uVar7;
      *(ulonglong *)(param_1 + 0x18) = uVar11;
      FUN_140193d80(param_1);
      lVar5 = 0;
      fVar13 = (float)*(uint *)(param_1 + 0x28) * *(float *)(param_1 + 0x34);
      if ((9.223372e+18 < fVar13) && (fVar13 = fVar13 - 9.223372e+18, fVar13 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      fVar12 = (float)*(uint *)(param_1 + 0x28) * *(float *)(param_1 + 0x30);
      lVar6 = 0;
      *(longlong *)(param_1 + 0x38) = (longlong)fVar13 + lVar5;
      if ((9.223372e+18 < fVar12) && (fVar12 = fVar12 - 9.223372e+18, fVar12 < 9.223372e+18)) {
        lVar6 = -0x8000000000000000;
      }
      *(longlong *)(param_1 + 0x40) = (longlong)fVar12 + lVar6;
      if ((ulonglong)((longlong)fVar12 + lVar6) < 0x11) {
        *(undefined8 *)(param_1 + 0x40) = 0;
      }
    }
  }
  return;
}



void FUN_140144ad0(longlong param_1,uint param_2)

{
  ulonglong uVar1;
  undefined8 uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  void *_Dst;
  longlong lVar5;
  longlong lVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  int iVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  float fVar12;
  float fVar13;
  
  if (param_2 == 0) {
    param_2 = FUN_140142850();
  }
  if (param_2 != *(uint *)(param_1 + 0x28)) {
    if (*(longlong *)(param_1 + 8) == 0) {
      lVar5 = 0;
      *(uint *)(param_1 + 0x28) = param_2;
      fVar13 = (float)param_2 * *(float *)(param_1 + 0x34);
      if ((9.223372e+18 < fVar13) && (fVar13 = fVar13 - 9.223372e+18, fVar13 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      fVar12 = (float)param_2 * *(float *)(param_1 + 0x30);
      lVar6 = 0;
      *(longlong *)(param_1 + 0x38) = (longlong)fVar13 + lVar5;
      if ((9.223372e+18 < fVar12) && (fVar12 = fVar12 - 9.223372e+18, fVar12 < 9.223372e+18)) {
        lVar6 = -0x8000000000000000;
      }
      *(longlong *)(param_1 + 0x40) = (longlong)fVar12 + lVar6;
      if ((ulonglong)((longlong)fVar12 + lVar6) < 0x11) {
        *(undefined8 *)(param_1 + 0x40) = 0;
        return;
      }
    }
    else {
      _Dst = (void *)FUN_1400a34c0((ulonglong)param_2 << 3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x8007000e);
      }
      memset(_Dst,0,(ulonglong)param_2 << 3);
      uVar7 = 0;
      uVar4 = *(ulonglong *)(param_1 + 0x10);
      uVar10 = uVar7;
      uVar11 = uVar7;
      while (uVar4 != 0) {
        uVar1 = *(ulonglong *)(uVar4 + 0x18);
        uVar3 = (ulonglong)*(uint *)(uVar4 + 0x28) % (ulonglong)param_2;
        lVar5 = *(longlong *)((longlong)_Dst + uVar3 * 8);
        iVar9 = (int)uVar10;
        if (iVar9 == 0) {
          *(undefined8 *)(uVar4 + 0x20) = 0;
          *(undefined8 *)(uVar4 + 0x18) = 0;
          uVar10 = 1;
          uVar7 = uVar4;
          uVar11 = uVar4;
        }
        else if (lVar5 == 0) {
          *(undefined8 *)(uVar4 + 0x20) = 0;
          *(ulonglong *)(uVar4 + 0x18) = uVar7;
          if (uVar7 != 0) {
            *(ulonglong *)(uVar7 + 0x20) = uVar4;
          }
          uVar10 = (ulonglong)(iVar9 + 1);
          uVar7 = uVar4;
        }
        else {
          uVar8 = uVar4;
          if (*(longlong *)(lVar5 + 0x20) != 0) {
            *(ulonglong *)(*(longlong *)(lVar5 + 0x20) + 0x18) = uVar4;
            uVar8 = uVar7;
          }
          uVar2 = *(undefined8 *)(lVar5 + 0x20);
          *(longlong *)(uVar4 + 0x18) = lVar5;
          uVar10 = (ulonglong)(iVar9 + 1);
          *(undefined8 *)(uVar4 + 0x20) = uVar2;
          *(ulonglong *)(lVar5 + 0x20) = uVar4;
          uVar7 = uVar8;
        }
        *(ulonglong *)((longlong)_Dst + uVar3 * 8) = uVar4;
        uVar4 = uVar1;
      }
      FUN_1400a3530(*(undefined8 *)(param_1 + 8));
      *(void **)(param_1 + 8) = _Dst;
      *(uint *)(param_1 + 0x28) = param_2;
      *(ulonglong *)(param_1 + 0x10) = uVar7;
      *(ulonglong *)(param_1 + 0x18) = uVar11;
      FUN_140144430(param_1);
      lVar5 = 0;
      fVar13 = (float)*(uint *)(param_1 + 0x28) * *(float *)(param_1 + 0x34);
      if ((9.223372e+18 < fVar13) && (fVar13 = fVar13 - 9.223372e+18, fVar13 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      fVar12 = (float)*(uint *)(param_1 + 0x28) * *(float *)(param_1 + 0x30);
      lVar6 = 0;
      *(longlong *)(param_1 + 0x38) = (longlong)fVar13 + lVar5;
      if ((9.223372e+18 < fVar12) && (fVar12 = fVar12 - 9.223372e+18, fVar12 < 9.223372e+18)) {
        lVar6 = -0x8000000000000000;
      }
      *(longlong *)(param_1 + 0x40) = (longlong)fVar12 + lVar6;
      if ((ulonglong)((longlong)fVar12 + lVar6) < 0x11) {
        *(undefined8 *)(param_1 + 0x40) = 0;
      }
    }
  }
  return;
}



void FUN_140144d20(longlong param_1,int param_2)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  int iVar4;
  undefined8 uVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  int iVar8;
  longlong lVar9;
  undefined1 local_58 [80];
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar4 = FUN_140142a60();
      plVar2 = *(longlong **)(param_1 + 8);
      lVar9 = (longlong)iVar4;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar2 == (longlong *)0x0) {
          uVar5 = FUN_1400a34c0(lVar9 << 4);
          *(undefined8 *)(param_1 + 0x10) = uVar5;
        }
        else {
          uVar5 = (**(code **)(*plVar2 + 8))(plVar2,lVar9 << 4);
          *(undefined8 *)(param_1 + 0x10) = uVar5;
        }
      }
      else {
        lVar3 = *(longlong *)(param_1 + 0x10);
        if (plVar2 == (longlong *)0x0) {
          puVar6 = (undefined8 *)FUN_1400a34c0(lVar9 << 4);
        }
        else {
          puVar6 = (undefined8 *)(**(code **)(*plVar2 + 8))();
        }
        iVar1 = *(int *)(param_1 + 0x18);
        iVar8 = 0;
        if (0 < iVar1) {
          puVar7 = puVar6;
          do {
            if (puVar7 != (undefined8 *)0x0) {
              *puVar7 = *(undefined8 *)((lVar3 - (longlong)puVar6) + (longlong)puVar7);
              puVar7[1] = *(undefined8 *)((lVar3 - (longlong)puVar6) + 8 + (longlong)puVar7);
            }
            iVar8 = iVar8 + 1;
            puVar7 = puVar7 + 2;
          } while (iVar8 < iVar1);
        }
        if (puVar6 == (undefined8 *)0x0) {
          FUN_1400a2320(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
        }
        plVar2 = *(longlong **)(param_1 + 8);
        if (plVar2 == (longlong *)0x0) {
          FUN_1400a3530(lVar3);
        }
        else {
          (**(code **)(*plVar2 + 0x18))(plVar2,lVar3);
        }
        *(undefined8 **)(param_1 + 0x10) = puVar6;
      }
      *(int *)(param_1 + 0x1c) = iVar4;
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_140144e80(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x000140144ea7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



void * FUN_140144ec0(undefined8 param_1,ulonglong param_2)

{
  void *pvVar1;
  char *local_res10 [3];
  undefined **local_28 [5];
  
  if (param_2 == 0) {
    return (void *)0x0;
  }
  if ((param_2 < 0x2000000000000000) && (pvVar1 = operator_new(param_2 * 8), pvVar1 != (void *)0x0))
  {
    return pvVar1;
  }
  local_res10[0] = (char *)0x0;
  std::exception::exception((exception *)local_28,local_res10);
  local_28[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_28,(ThrowInfo *)&DAT_1402f47a8);
}



void FUN_140144f30(longlong param_1,ulonglong param_2,int param_3)

{
  int iVar1;
  undefined4 uVar2;
  ulonglong uVar3;
  ulonglong uVar5;
  uint uVar6;
  ulonglong uVar8;
  ulonglong uVar9;
  longlong lVar10;
  uint local_res10;
  ulonglong local_res20;
  ulonglong local_28;
  ulonglong uVar4;
  int iVar7;
  
  local_res10 = (uint)param_2;
  uVar5 = (ulonglong)param_3;
  local_res20 = (ulonglong)(int)local_res10;
  local_28 = uVar5;
  if (param_3 < (int)local_res10) {
    do {
      uVar8 = param_2 & 0xffffffff;
      lVar10 = (longlong)(int)uVar5;
      uVar3 = local_res20;
      while( true ) {
        iVar1 = *(int *)(param_1 + local_28 * 4);
        iVar7 = *(int *)(param_1 + lVar10 * 4);
        while ((iVar7 < iVar1 && (lVar10 < (longlong)uVar3))) {
          lVar10 = lVar10 + 1;
          iVar7 = *(int *)(param_1 + lVar10 * 4);
        }
        do {
          uVar9 = uVar8;
          uVar4 = uVar3;
          uVar3 = uVar4 - 1;
          iVar7 = (int)uVar9;
          uVar6 = iVar7 - 1;
          uVar8 = (ulonglong)uVar6;
        } while (iVar1 < *(int *)(param_1 + uVar3 * 4));
        if ((longlong)uVar3 <= lVar10) break;
        uVar2 = *(undefined4 *)(param_1 + lVar10 * 4);
        *(undefined4 *)(param_1 + lVar10 * 4) = *(undefined4 *)(param_1 + uVar3 * 4);
        *(undefined4 *)(param_1 + uVar3 * 4) = uVar2;
      }
      *(undefined4 *)(param_1 + local_28 * 4) = *(undefined4 *)(param_1 + uVar3 * 4);
      *(int *)(param_1 + uVar3 * 4) = iVar1;
      if ((int)(((int)param_2 - uVar6) + -1) < (int)(uVar6 - (int)uVar5)) {
        FUN_140144f30(param_1,iVar7 + -2,uVar5 & 0xffffffff);
        uVar5 = uVar9;
        local_28 = uVar4;
      }
      else {
        FUN_140144f30(param_1,param_2,uVar9);
        local_res10 = iVar7 - 2;
        local_res20 = uVar4 - 2;
      }
      param_2 = (ulonglong)local_res10;
    } while ((int)uVar5 < (int)local_res10);
  }
  return;
}



undefined4 FUN_140145040(longlong *param_1)

{
  if (*param_1 != 0) {
    return *(undefined4 *)(*param_1 + 0x18);
  }
  if (param_1[1] != 0) {
    return (int)param_1[2];
  }
                    // WARNING: Subroutine does not return
  FUN_14019a830();
}



longlong FUN_140145070(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = param_1[1];
  if (lVar1 == 0) {
    lVar1 = *param_1;
    if (lVar1 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    if (*(int *)(lVar1 + 0x18) != 0) {
      return *(longlong *)(lVar1 + 0x10);
    }
    lVar1 = 0;
  }
  return lVar1;
}



undefined4 FUN_1401450b0(longlong param_1)

{
  if (*(longlong *)(param_1 + 8) != 0) {
    return *(undefined4 *)(*(longlong *)(param_1 + 8) + 0x18);
  }
  if (*(longlong *)(param_1 + 0x10) != 0) {
    return *(undefined4 *)(param_1 + 0x18);
  }
                    // WARNING: Subroutine does not return
  FUN_14019a830();
}



undefined8 FUN_1401450e0(longlong param_1,longlong param_2)

{
  ulonglong uVar1;
  longlong lVar2;
  
  uVar1 = (ulonglong)((uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8)) %
          (ulonglong)*(uint *)(param_1 + 0x3b0);
  if (*(longlong *)(param_1 + 0x390) != 0) {
    for (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x390) + uVar1 * 8);
        (lVar2 != 0 && ((uint)uVar1 == *(uint *)(lVar2 + 0x28) % *(uint *)(param_1 + 0x3b0)));
        lVar2 = *(longlong *)(lVar2 + 0x18)) {
      if ((*(uint *)(lVar2 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar2 + 0xc) == *(ushort *)(param_2 + 0xc))) {
        return *(undefined8 *)(lVar2 + 0x10);
      }
    }
  }
  return 0;
}



undefined8 FUN_140145140(longlong param_1,longlong param_2)

{
  ulonglong uVar1;
  longlong lVar2;
  
  uVar1 = (ulonglong)((uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8)) %
          (ulonglong)*(uint *)(param_1 + 0x1710);
  if (*(longlong *)(param_1 + 0x16f0) != 0) {
    for (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x16f0) + uVar1 * 8);
        (lVar2 != 0 && ((uint)uVar1 == *(uint *)(lVar2 + 0x28) % *(uint *)(param_1 + 0x1710)));
        lVar2 = *(longlong *)(lVar2 + 0x18)) {
      if ((*(uint *)(lVar2 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar2 + 0xc) == *(ushort *)(param_2 + 0xc))) goto LAB_140145198;
    }
  }
  lVar2 = 0;
LAB_140145198:
  if (lVar2 != 0) {
    return *(undefined8 *)(lVar2 + 0x10);
  }
  return 0;
}



undefined8 * FUN_1401451b0(undefined8 *param_1,undefined8 param_2,undefined1 param_3)

{
  undefined2 *puVar1;
  undefined8 *puVar2;
  int iVar3;
  
  param_1[3] = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 4) = 0;
  *(undefined2 *)((longlong)param_1 + 0x24) = 0;
  param_1[5] = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 6) = 0;
  *(undefined2 *)((longlong)param_1 + 0x34) = 0;
  *(undefined4 *)(param_1 + 2) = 0;
  *(undefined1 *)(param_1 + 7) = 0;
  *(undefined4 *)(param_1 + 4) = DAT_1402f83d0;
  puVar2 = param_1 + 0xe;
  *(undefined2 *)((longlong)param_1 + 0x24) = DAT_1402f83d4;
  *(undefined4 *)(param_1 + 6) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_1 + 0x34) = DAT_1402f83d4;
  param_1[9] = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 10) = 0;
  *(undefined2 *)((longlong)param_1 + 0x54) = 0;
  param_1[0xb] = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 0xc) = 0;
  *(undefined2 *)((longlong)param_1 + 100) = 0;
  *(undefined4 *)(param_1 + 8) = 0;
  *(undefined1 *)(param_1 + 0xd) = 0;
  iVar3 = 1;
  *(undefined4 *)(param_1 + 10) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_1 + 0x54) = DAT_1402f83d4;
  *(undefined4 *)(param_1 + 0xc) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_1 + 100) = DAT_1402f83d4;
  puVar1 = (undefined2 *)((longlong)param_1 + 0x84);
  do {
    *(undefined ***)(puVar1 + -6) = Proud::AddrPort::vftable;
    *(undefined4 *)(puVar1 + -2) = 0;
    *puVar1 = 0;
    *(undefined ***)(puVar1 + 2) = Proud::AddrPort::vftable;
    *(undefined4 *)(puVar1 + 6) = 0;
    puVar1[8] = 0;
    *(undefined ***)(puVar1 + 10) = Proud::AddrPort::vftable;
    *(undefined4 *)(puVar1 + 0xe) = 0;
    puVar1[0x10] = 0;
    *(undefined ***)(puVar1 + 0x12) = Proud::AddrPort::vftable;
    *(undefined4 *)(puVar1 + 0x16) = 0;
    puVar1[0x18] = 0;
    *(undefined4 *)puVar2 = 0;
    *(undefined4 *)(puVar1 + -2) = DAT_1402f83d0;
    puVar2 = puVar2 + 9;
    iVar3 = iVar3 + -1;
    *puVar1 = DAT_1402f83d4;
    *(undefined4 *)(puVar1 + 6) = DAT_1402f83d0;
    puVar1[8] = DAT_1402f83d4;
    *(undefined4 *)(puVar1 + 0xe) = DAT_1402f83d0;
    puVar1[0x10] = DAT_1402f83d4;
    *(undefined4 *)(puVar1 + 0x16) = DAT_1402f83d0;
    puVar1[0x18] = DAT_1402f83d4;
    puVar1 = puVar1 + 0x24;
  } while (-1 < iVar3);
  param_1[0x25] = 0;
  param_1[0x26] = 0;
  param_1[0x27] = 0;
  param_1[0x28] = 0;
  param_1[0x24] = Proud::ByteArray::vftable;
  param_1[0x2a] = 0;
  param_1[0x2b] = 0;
  param_1[0x2c] = 0;
  param_1[0x2d] = 0;
  param_1[0x29] = Proud::ByteArray::vftable;
  *(undefined4 *)((longlong)param_1 + 0x174) = 0;
  *(undefined4 *)(param_1 + 0x2f) = 0;
  *(undefined4 *)((longlong)param_1 + 0x17c) = 0;
  *(undefined4 *)(param_1 + 0x30) = 0;
  *(undefined1 *)(param_1 + 0x22) = 0;
  *(undefined4 *)((longlong)param_1 + 0x114) = 0;
  param_1[0x31] = 0;
  param_1[0x32] = 0;
  param_1[0x33] = 0;
  *(undefined1 *)(param_1 + 0x34) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1a4) = 0;
  *param_1 = param_2;
  *(undefined1 *)(param_1 + 1) = 1;
  *(undefined1 *)(param_1 + 0x23) = param_3;
  return param_1;
}



void FUN_1401453c0(longlong *param_1)

{
  if (*param_1 != 0) {
    if (*(int *)((longlong)param_1 + 0xc) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(param_1 + 1) = 0;
  }
  return;
}



void thunk_FUN_140143d00(void)

{
  FUN_140143d00();
  return;
}



void thunk_FUN_140143e10(void)

{
  FUN_140143e10();
  return;
}



undefined4 * FUN_140145410(longlong *param_1,longlong param_2,undefined4 param_3)

{
  undefined4 *puVar1;
  longlong lVar2;
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_1[1] <= param_2) {
    FUN_1401442d0(param_1,param_2 + 1,0xffffffffffffffff);
  }
  if (param_2 < param_1[1]) {
    if ((ulonglong)param_1[2] < 0x65) {
      puVar1 = (undefined4 *)((longlong)param_1 + param_2 * 4 + 0x20);
      *puVar1 = param_3;
      return puVar1;
    }
    lVar2 = *param_1;
    *(undefined4 *)(lVar2 + param_2 * 4) = param_3;
    return (undefined4 *)(lVar2 + param_2 * 4);
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_140145490(longlong param_1,int param_2,undefined8 param_3,int param_4)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  
  lVar2 = (longlong)param_2;
  if (((-1 < param_4) && (-1 < param_2)) && (param_2 <= *(int *)(param_1 + 0x18))) {
    iVar4 = *(int *)(param_1 + 0x18);
    FUN_140143980(param_1,iVar4 + param_4);
    iVar4 = iVar4 - param_2;
    lVar1 = 0;
    if (0 < iVar4) {
      lVar3 = lVar1;
      if (*(int *)(param_1 + 0x18) != 0) {
        lVar3 = *(longlong *)(param_1 + 0x10);
      }
      memmove((void *)(lVar3 + (lVar2 + param_4) * 4),(void *)(lVar3 + lVar2 * 4),
              (longlong)iVar4 << 2);
    }
    if (*(int *)(param_1 + 0x18) != 0) {
      lVar1 = *(longlong *)(param_1 + 0x10);
    }
    FUN_1400224d0(lVar1 + lVar2 * 4,param_3,(longlong)param_4 << 2);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_140145550(longlong param_1,longlong param_2,char param_3)

{
  undefined4 uVar1;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if (*(longlong **)(param_1 + 0x50) == (longlong *)0x0) {
    FUN_1400a3530(param_2);
  }
  else {
    (**(code **)(**(longlong **)(param_1 + 0x50) + 0x18))();
  }
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
  if (((param_3 != '\0') && (*(ulonglong *)(param_1 + 0x20) < *(ulonglong *)(param_1 + 0x40))) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar1 = FUN_140142850(param_1);
    FUN_1401b2490(param_1,uVar1);
  }
  return;
}



void FUN_1401455c0(longlong param_1,longlong param_2,undefined1 param_3)

{
  uint uVar1;
  ulonglong uVar2;
  uint uVar3;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  uVar1 = *(uint *)(param_1 + 0x28);
  uVar2 = (ulonglong)*(uint *)(param_2 + 0x20) % (ulonglong)uVar1;
  if (*(longlong *)(param_1 + 0x20) == 1) {
    *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    *(undefined8 *)(param_1 + 0x10) = 0;
    *(undefined8 *)(param_1 + 0x18) = 0;
  }
  else {
    uVar3 = (uint)uVar2;
    if (((*(longlong *)(param_2 + 0x18) == 0) ||
        (*(uint *)(*(longlong *)(param_2 + 0x18) + 0x20) % uVar1 != uVar3)) &&
       ((*(longlong *)(param_2 + 0x10) == 0 ||
        (*(uint *)(*(longlong *)(param_2 + 0x10) + 0x20) % uVar1 != uVar3)))) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    }
    else if (param_2 == *(longlong *)(*(longlong *)(param_1 + 8) + (longlong)(int)uVar3 * 8)) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = *(undefined8 *)(param_2 + 0x10);
    }
    if (param_2 == *(longlong *)(param_1 + 0x10)) {
      *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(param_2 + 0x10);
      *(undefined8 *)(param_2 + 0x18) = 0;
    }
    if (param_2 == *(longlong *)(param_1 + 0x18)) {
      *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
      *(undefined8 *)(param_2 + 0x10) = 0;
    }
    if (*(longlong *)(param_2 + 0x18) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x18) + 0x10) = *(undefined8 *)(param_2 + 0x10);
    }
    if (*(longlong *)(param_2 + 0x10) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x10) + 0x18) = *(undefined8 *)(param_2 + 0x18);
    }
  }
  FUN_140145550(param_1,param_2,param_3);
  FUN_1401b2030(param_1);
  return;
}



void FUN_1401456c0(longlong param_1,longlong param_2,char param_3)

{
  undefined4 uVar1;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if (*(longlong **)(param_1 + 0x50) == (longlong *)0x0) {
    FUN_1400a3530(param_2);
  }
  else {
    (**(code **)(**(longlong **)(param_1 + 0x50) + 0x18))();
  }
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
  if (((param_3 != '\0') && (*(ulonglong *)(param_1 + 0x20) < *(ulonglong *)(param_1 + 0x40))) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar1 = FUN_140142850(param_1);
    FUN_140144ad0(param_1,uVar1);
  }
  return;
}



undefined1 FUN_140145730(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined1 uVar2;
  ulonglong local_res18 [2];
  
  cVar1 = FUN_140185b30(param_1,local_res18);
  if (cVar1 == '\0') {
    return 0;
  }
  if ((-1 < (int)local_res18[0]) && ((int)local_res18[0] <= DAT_1402f8140)) {
    FUN_14003cda0(param_2,local_res18[0] & 0xffffffff);
    if (*(int *)(param_2 + 0x18) == 0) {
      uVar2 = FUN_140185490(param_1,0,local_res18[0] & 0xffffffff);
      return uVar2;
    }
    uVar2 = FUN_140185490(param_1,*(undefined8 *)(param_2 + 0x10),local_res18[0] & 0xffffffff);
    return uVar2;
  }
  return 0;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401457d0(longlong *param_1)

{
  longlong lVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  longlong *plVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  undefined4 *puVar7;
  int *piVar8;
  undefined1 *puVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  undefined4 *puVar12;
  ulonglong uVar13;
  undefined1 auStack_38 [32];
  ulonglong local_18 [2];
  
  puVar9 = auStack_38;
  local_18[0] = DAT_1402f85a0 ^ (ulonglong)local_18;
  if ((ulonglong)param_1[2] < 0x65) {
    plVar4 = param_1 + 4;
  }
  else {
    plVar4 = (longlong *)*param_1;
  }
  FUN_140144f30(plVar4,(int)param_1[1],0);
  uVar5 = param_1[1] * 4 + 0x10;
  if (uVar5 < 0x401) {
    lVar1 = param_1[1] * 4;
    uVar5 = lVar1 + 0x1f;
    if (uVar5 <= lVar1 + 0x10U) {
      uVar5 = 0xffffffffffffff0;
    }
    lVar1 = -(uVar5 & 0xfffffffffffffff0);
    puVar9 = auStack_38 + lVar1;
    puVar3 = (undefined4 *)((longlong)local_18 + lVar1);
    puVar12 = (undefined4 *)0x0;
    if (puVar3 == (undefined4 *)0x0) goto LAB_140145880;
    *puVar3 = 0xcccc;
    puVar9 = auStack_38 + lVar1;
  }
  else {
    puVar3 = malloc(uVar5);
    puVar12 = (undefined4 *)0x0;
    if (puVar3 == (undefined4 *)0x0) goto LAB_140145880;
    *puVar3 = 0xdddd;
    puVar9 = auStack_38;
  }
  puVar12 = puVar3 + 4;
LAB_140145880:
  uVar5 = param_1[1];
  uVar13 = 0;
  uVar6 = uVar13;
  uVar10 = uVar13;
  uVar11 = uVar13;
  if (uVar5 != 0) {
    do {
      if (uVar10 == 0) {
LAB_1401458c7:
        if (((longlong)uVar6 < 0) || (param_1[1] <= (longlong)uVar6)) {
                    // WARNING: Subroutine does not return
          *(undefined **)(puVar9 + -8) = &UNK_140145944;
          FUN_1400a26d0();
        }
        if ((ulonglong)param_1[2] < 0x65) {
          puVar3 = (undefined4 *)((longlong)param_1 + uVar6 * 4 + 0x20);
        }
        else {
          puVar3 = (undefined4 *)(*param_1 + uVar6 * 4);
        }
        uVar11 = uVar10 + 1;
        puVar12[uVar10] = *puVar3;
      }
      else {
        if (((longlong)uVar6 < 0) || (param_1[1] <= (longlong)uVar6)) {
                    // WARNING: Subroutine does not return
          *(undefined **)(puVar9 + -8) = &UNK_14014593e;
          FUN_1400a26d0();
        }
        if ((ulonglong)param_1[2] < 0x65) {
          piVar8 = (int *)((longlong)param_1 + uVar6 * 4 + 0x20);
        }
        else {
          piVar8 = (int *)(*param_1 + uVar6 * 4);
        }
        uVar11 = uVar10;
        if (*piVar8 != puVar12[uVar10 - 1]) goto LAB_1401458c7;
      }
      uVar6 = uVar6 + 1;
      uVar10 = uVar11;
    } while (uVar6 < uVar5);
  }
  *(undefined8 *)(puVar9 + -8) = 0x140145907;
  FUN_1401442d0(param_1,uVar11,0xffffffffffffffff);
  if (0 < (longlong)uVar11) {
    puVar3 = puVar12;
    do {
      if (((longlong)uVar13 < 0) || (param_1[1] <= (longlong)uVar13)) {
                    // WARNING: Subroutine does not return
        *(undefined **)(puVar9 + -8) = &UNK_14014599b;
        FUN_1400a26d0();
      }
      if ((ulonglong)param_1[2] < 0x65) {
        lVar1 = (longlong)param_1 + (0x20 - (longlong)puVar12);
      }
      else {
        lVar1 = *param_1 - (longlong)puVar12;
      }
      puVar7 = (undefined4 *)(lVar1 + (longlong)puVar3);
      uVar2 = *puVar3;
      uVar13 = uVar13 + 1;
      puVar3 = puVar3 + 1;
      *puVar7 = uVar2;
    } while ((longlong)uVar13 < (longlong)uVar11);
  }
  if ((puVar12 != (undefined4 *)0x0) && (puVar12[-4] == 0xdddd)) {
    *(undefined8 *)(puVar9 + -8) = 0x140145974;
    free(puVar12 + -4);
  }
  *(undefined8 *)(puVar9 + -8) = 0x140145980;
  return;
}



void FUN_1401459a0(longlong param_1,uint param_2,uint param_3)

{
  double dVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  longlong *plVar5;
  longlong lVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  uint uVar9;
  ulonglong uVar11;
  ulonglong uVar12;
  longlong lVar13;
  uint local_res10;
  uint local_res18;
  ulonglong local_res20;
  ulonglong local_28;
  uint uVar10;
  
  uVar12 = (ulonglong)(int)param_3;
  uVar8 = (ulonglong)(int)param_2;
  local_res10 = param_2;
  local_res18 = param_3;
  local_res20 = uVar8;
  local_28 = uVar12;
  if ((int)param_3 < (int)param_2) {
    do {
      uVar8 = uVar8 & 0xffffffff;
      lVar13 = (longlong)(int)uVar12;
      uVar12 = local_res20;
      while( true ) {
        dVar1 = *(double *)(*(longlong *)(param_1 + local_28 * 0x18) + 0x188);
        plVar5 = (longlong *)(param_1 + lVar13 * 0x18);
        for (; (*(double *)(*plVar5 + 0x188) <= dVar1 && dVar1 != *(double *)(*plVar5 + 0x188) &&
               (lVar13 < (longlong)uVar12)); lVar13 = lVar13 + 1) {
          plVar5 = plVar5 + 3;
        }
        lVar6 = param_1 + uVar12 * 0x18;
        do {
          uVar11 = uVar8;
          uVar7 = uVar12;
          plVar5 = (longlong *)(lVar6 + -0x18);
          lVar6 = lVar6 + -0x18;
          uVar10 = (uint)uVar11;
          uVar9 = uVar10 - 1;
          uVar8 = (ulonglong)uVar9;
          uVar12 = uVar7 - 1;
        } while (dVar1 < *(double *)(*plVar5 + 0x188));
        if ((longlong)uVar12 <= lVar13) break;
        uVar2 = *(undefined8 *)(param_1 + lVar13 * 0x18);
        uVar3 = *(undefined8 *)(param_1 + 8 + lVar13 * 0x18);
        uVar4 = *(undefined8 *)(param_1 + 0x10 + lVar13 * 0x18);
        *(undefined8 *)(param_1 + lVar13 * 0x18) = *(undefined8 *)(param_1 + uVar12 * 0x18);
        *(undefined8 *)(param_1 + 8 + lVar13 * 0x18) = *(undefined8 *)(param_1 + 8 + uVar12 * 0x18);
        *(undefined8 *)(param_1 + 0x10 + lVar13 * 0x18) =
             *(undefined8 *)(param_1 + 0x10 + uVar12 * 0x18);
        *(undefined8 *)(param_1 + uVar12 * 0x18) = uVar2;
        *(undefined8 *)(param_1 + 8 + uVar12 * 0x18) = uVar3;
        *(undefined8 *)(param_1 + 0x10 + uVar12 * 0x18) = uVar4;
      }
      uVar2 = *(undefined8 *)(param_1 + local_28 * 0x18);
      uVar3 = *(undefined8 *)(param_1 + 8 + local_28 * 0x18);
      uVar4 = *(undefined8 *)(param_1 + 0x10 + local_28 * 0x18);
      *(undefined8 *)(param_1 + local_28 * 0x18) = *(undefined8 *)(param_1 + uVar12 * 0x18);
      *(undefined8 *)(param_1 + 8 + local_28 * 0x18) = *(undefined8 *)(param_1 + 8 + uVar12 * 0x18);
      *(undefined8 *)(param_1 + 0x10 + local_28 * 0x18) =
           *(undefined8 *)(param_1 + 0x10 + uVar12 * 0x18);
      *(undefined8 *)(param_1 + uVar12 * 0x18) = uVar2;
      *(undefined8 *)(param_1 + 8 + uVar12 * 0x18) = uVar3;
      *(undefined8 *)(param_1 + 0x10 + uVar12 * 0x18) = uVar4;
      if ((int)((local_res10 - uVar9) + -1) < (int)(uVar9 - local_res18)) {
        FUN_1401459a0(param_1,uVar10 - 2,local_res18);
        local_res18 = uVar10;
        local_28 = uVar7;
      }
      else {
        FUN_1401459a0(param_1,local_res10,uVar11);
        local_res10 = uVar10 - 2;
        local_res20 = uVar7 - 2;
      }
      uVar12 = (ulonglong)local_res18;
      uVar8 = (ulonglong)local_res10;
    } while ((int)local_res18 < (int)local_res10);
  }
  return;
}



void FUN_140145b60(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 local_50 [80];
  
  if (*(longlong *)(param_1 + 0xc80) == 0) {
    FUN_1400a2320(local_50,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50,param_3,param_4,
                  0xfffffffffffffffe);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
  }
  if (*(int *)(param_1 + 0xc8c) < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined4 *)(param_1 + 0xc88) = 0;
  if (*(longlong *)(param_1 + 0xc80) != 0) {
    if (*(int *)(param_1 + 0xc8c) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(param_1 + 0xc88) = 0;
  }
  return;
}



void FUN_140145be0(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  undefined4 uStack_5c;
  undefined1 local_58 [88];
  
  lVar2 = *(longlong *)(param_1 + 0xc80);
  if (lVar2 == 0) {
    FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar1 = *(int *)(param_1 + 0xc88);
  if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  iVar3 = iVar1 + 1;
  if ((-1 < iVar3) && (iVar3 <= *(int *)(param_1 + 0xc8c))) {
    *(int *)(param_1 + 0xc88) = iVar3;
    *(undefined8 *)(lVar2 + (longlong)iVar1 * 0x10) = param_2;
    *(ulonglong *)(lVar2 + 8 + (longlong)iVar1 * 0x10) = CONCAT44(uStack_5c,param_3);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_140145c70(longlong param_1,longlong param_2)

{
  longlong lVar1;
  int iVar2;
  int iVar3;
  longlong lVar4;
  int iVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  undefined1 local_58 [80];
  
  if (*(longlong *)(param_2 + 0xc80) == 0) {
    FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar2 = *(int *)(param_2 + 0xc88);
  if (*(longlong *)(param_1 + 0xc80) == 0) {
    FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar3 = *(int *)(param_1 + 0xc88);
  iVar5 = iVar3 + iVar2;
  if (*(longlong *)(param_1 + 0xc80) == 0) {
    FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  if ((-1 < iVar5) && (iVar5 <= *(int *)(param_1 + 0xc8c))) {
    *(int *)(param_1 + 0xc88) = iVar5;
    if (*(longlong *)(param_1 + 0xc80) == 0) {
      FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    if (*(longlong *)(param_2 + 0xc80) == 0) {
      FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    uVar6 = 0;
    if (0 < iVar2) {
      lVar1 = *(longlong *)(param_1 + 0xc80) + (longlong)iVar3 * 0x10;
      uVar7 = uVar6;
      uVar8 = uVar6;
      do {
        lVar4 = *(longlong *)(param_2 + 0xc80);
        if (lVar4 == 0) {
          FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
        }
        if (((longlong)uVar7 < 0) || (*(int *)(param_2 + 0xc88) <= (int)uVar6)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        uVar7 = uVar7 + 1;
        uVar9 = uVar8 + 0x10;
        *(undefined8 *)(lVar1 + -0x10 + uVar9) = *(undefined8 *)(uVar8 + lVar4);
        uVar6 = (ulonglong)((int)uVar6 + 1);
        *(undefined8 *)(lVar1 + -8 + uVar9) = *(undefined8 *)(uVar8 + 8 + lVar4);
        uVar8 = uVar9;
      } while ((longlong)uVar7 < (longlong)iVar2);
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_140145e20(longlong param_1)

{
  FUN_14019a730(param_1 + 8);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    if (*(int *)(param_1 + 0x1c) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(param_1 + 0x18) = 0;
  }
  return;
}



void FUN_140145e70(longlong param_1,undefined8 param_2,longlong *param_3,undefined8 param_4)

{
  undefined *puVar1;
  
  if (*(longlong *)(param_1 + 0x1790) != 0) {
    puVar1 = (undefined *)*param_3;
    if ((undefined *)*param_3 == (undefined *)0x0) {
      puVar1 = PTR_DAT_1402f8010;
    }
    FUN_1401946b0(*(longlong *)(param_1 + 0x1790),0,puVar1,param_4,0xfffffffffffffffe);
  }
  FUN_1400031d0(param_3);
  return;
}



undefined4 FUN_140145ec0(longlong param_1,longlong param_2)

{
  ushort uVar1;
  uint uVar2;
  longlong lVar3;
  ulonglong uVar4;
  char cVar5;
  
  if ((*(int *)(param_2 + 8) == 0) || (cVar5 = FUN_1400a64d0(param_2), cVar5 != '\0')) {
    uVar1 = *(ushort *)(param_2 + 0xc);
    uVar2 = *(uint *)(param_2 + 8);
    uVar4 = (ulonglong)(uVar1 ^ uVar2) % (ulonglong)*(uint *)(param_1 + 0x3b0);
    if (*(longlong *)(param_1 + 0x390) != 0) {
      lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x390) + uVar4 * 8);
      while( true ) {
        if ((lVar3 == 0) || ((uint)uVar4 != *(uint *)(lVar3 + 0x28) % *(uint *)(param_1 + 0x3b0)))
        goto LAB_140145f43;
        if ((*(uint *)(lVar3 + 8) == uVar2) && (*(ushort *)(lVar3 + 0xc) == uVar1)) break;
        lVar3 = *(longlong *)(lVar3 + 0x18);
      }
      if (*(longlong *)(lVar3 + 0x10) != 0) {
        return *(undefined4 *)(*(longlong *)(lVar3 + 0x10) + 0x6f8);
      }
    }
LAB_140145f43:
    uVar4 = (ulonglong)(uVar1 ^ uVar2) % (ulonglong)*(uint *)(param_1 + 0x718);
    if (*(longlong *)(param_1 + 0x6f8) != 0) {
      for (lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x6f8) + uVar4 * 8);
          (lVar3 != 0 && ((uint)uVar4 == *(uint *)(lVar3 + 0x28) % *(uint *)(param_1 + 0x718)));
          lVar3 = *(longlong *)(lVar3 + 0x18)) {
        if ((*(uint *)(lVar3 + 8) == uVar2) && (*(ushort *)(lVar3 + 0xc) == uVar1)) {
          return 1;
        }
      }
    }
  }
  return 0;
}



void FUN_140145fd0(longlong param_1)

{
  FUN_1400031d0(param_1 + 8);
  return;
}



undefined8 * FUN_140145fe0(undefined8 *param_1,longlong param_2)

{
  undefined4 uVar1;
  int iVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (DAT_14030ae60 != 5) {
    FUN_140140ce0();
  }
  uVar4 = 0;
  param_1[1] = *(undefined8 *)(param_2 + 8);
  uVar1 = *(undefined4 *)(param_2 + 0x24);
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  *(undefined4 *)((longlong)param_1 + 0x24) = uVar1;
  iVar2 = *(int *)(param_2 + 0x18);
  if (-1 < iVar2) {
    FUN_14003cda0(param_1,iVar2);
    uVar3 = uVar4;
    if (*(int *)(param_2 + 0x18) != 0) {
      uVar3 = *(undefined8 *)(param_2 + 0x10);
    }
    if (*(int *)(param_1 + 3) != 0) {
      uVar4 = param_1[2];
    }
    FUN_1400224d0(uVar4,uVar3,(longlong)iVar2);
    return param_1;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



longlong * FUN_140146080(longlong *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  if (param_2 == 0) {
    *param_1 = 0;
  }
  else {
    lVar2 = FUN_1400a34c0(0x48);
    if (lVar2 != 0) {
      uVar1 = FUN_1401692e0();
      FUN_1400a1b50(lVar2,uVar1,1,param_4,uVar3);
    }
    *param_1 = lVar2;
    FUN_1400a1c30(lVar2);
    *(undefined8 *)(*param_1 + 0x40) = 1;
    *(longlong *)(*param_1 + 0x38) = param_2;
    FUN_1400d1290(lVar2);
  }
  return param_1;
}



void FUN_140146120(longlong *param_1,undefined4 *param_2,longlong param_3)

{
  longlong lVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  longlong lVar5;
  
  if (param_3 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_1401442d0(param_1,param_3,0xffffffffffffffff);
  lVar5 = 0;
  if (0 < param_3) {
    puVar4 = param_2;
    do {
      if ((lVar5 < 0) || (param_1[1] <= lVar5)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if ((ulonglong)param_1[2] < 0x65) {
        lVar1 = (longlong)param_1 + (0x20 - (longlong)param_2);
      }
      else {
        lVar1 = *param_1 - (longlong)param_2;
      }
      puVar3 = (undefined4 *)(lVar1 + (longlong)puVar4);
      uVar2 = *puVar4;
      lVar5 = lVar5 + 1;
      puVar4 = puVar4 + 1;
      *puVar3 = uVar2;
    } while (lVar5 < param_3);
  }
  return;
}



void FUN_1401461b0(longlong param_1,longlong param_2,undefined1 param_3)

{
  uint uVar1;
  ulonglong uVar2;
  uint uVar3;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  uVar1 = *(uint *)(param_1 + 0x28);
  uVar2 = (ulonglong)*(uint *)(param_2 + 0x28) % (ulonglong)uVar1;
  if (*(longlong *)(param_1 + 0x20) == 1) {
    *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    *(undefined8 *)(param_1 + 0x10) = 0;
    *(undefined8 *)(param_1 + 0x18) = 0;
  }
  else {
    uVar3 = (uint)uVar2;
    if (((*(longlong *)(param_2 + 0x20) == 0) ||
        (*(uint *)(*(longlong *)(param_2 + 0x20) + 0x28) % uVar1 != uVar3)) &&
       ((*(longlong *)(param_2 + 0x18) == 0 ||
        (*(uint *)(*(longlong *)(param_2 + 0x18) + 0x28) % uVar1 != uVar3)))) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    }
    else if (param_2 == *(longlong *)(*(longlong *)(param_1 + 8) + (longlong)(int)uVar3 * 8)) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = *(undefined8 *)(param_2 + 0x18);
    }
    if (param_2 == *(longlong *)(param_1 + 0x10)) {
      *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(param_2 + 0x18);
      *(undefined8 *)(param_2 + 0x20) = 0;
    }
    if (param_2 == *(longlong *)(param_1 + 0x18)) {
      *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x20);
      *(undefined8 *)(param_2 + 0x18) = 0;
    }
    if (*(longlong *)(param_2 + 0x20) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x20) + 0x18) = *(undefined8 *)(param_2 + 0x18);
    }
    if (*(longlong *)(param_2 + 0x18) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x18) + 0x20) = *(undefined8 *)(param_2 + 0x20);
    }
  }
  FUN_1401456c0(param_1,param_2,param_3);
  FUN_140144430(param_1);
  return;
}



void FUN_1401462b0(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_140140df0((longlong)pvVar1 + 0x148);
    FUN_140140df0((longlong)pvVar1 + 0x120);
    operator_delete(pvVar1);
  }
  FUN_1400a3530(param_1);
  return;
}



void FUN_140146310(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x38);
  if (pvVar1 != (void *)0x0) {
    FUN_140195cc0(pvVar1);
    operator_delete(pvVar1);
  }
  FUN_1400a1cd0(param_1);
  FUN_1400a3530(param_1);
  return;
}



undefined4 * FUN_140146360(longlong param_1,undefined4 *param_2,uint param_3,undefined4 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined4 uVar4;
  undefined4 *puVar5;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    puVar5 = (undefined4 *)FUN_1400a34c0(0x20);
  }
  else {
    puVar5 = (undefined4 *)(**(code **)(*plVar1 + 8))(plVar1,0x20);
  }
  if (puVar5 != (undefined4 *)0x0) {
    uVar4 = *param_2;
    puVar5[6] = param_4;
    *puVar5 = uVar4;
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8);
  FUN_140193d80(param_1);
  if (*(longlong *)(param_1 + 0x20) == 0) {
    *(undefined4 **)(param_1 + 0x10) = puVar5;
    *(undefined4 **)(param_1 + 0x18) = puVar5;
    *(undefined8 *)(puVar5 + 4) = 0;
    *(undefined8 *)(puVar5 + 2) = 0;
  }
  else {
    FUN_140193d80(param_1);
    FUN_140193d80(param_1);
    if (lVar2 == 0) {
      lVar2 = *(longlong *)(param_1 + 0x10);
      *(undefined8 *)(puVar5 + 4) = 0;
      *(longlong *)(puVar5 + 2) = lVar2;
      if (lVar2 != 0) {
        *(undefined4 **)(lVar2 + 0x10) = puVar5;
      }
      *(undefined4 **)(param_1 + 0x10) = puVar5;
    }
    else {
      if (*(longlong *)(lVar2 + 0x10) == 0) {
        *(undefined4 **)(param_1 + 0x10) = puVar5;
      }
      else {
        *(undefined4 **)(*(longlong *)(lVar2 + 0x10) + 8) = puVar5;
      }
      uVar3 = *(undefined8 *)(lVar2 + 0x10);
      *(longlong *)(puVar5 + 2) = lVar2;
      *(undefined8 *)(puVar5 + 4) = uVar3;
      *(undefined4 **)(lVar2 + 0x10) = puVar5;
    }
  }
  *(undefined4 **)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8) = puVar5;
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  FUN_140193d80(param_1);
  FUN_140193d80(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar4 = FUN_140142850(param_1);
    FUN_140144880(param_1,uVar4);
  }
  FUN_140193d80(param_1);
  return puVar5;
}



undefined4 * FUN_1401464a0(longlong param_1,undefined4 *param_2,uint param_3,undefined4 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined4 uVar4;
  undefined4 *puVar5;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    puVar5 = (undefined4 *)FUN_1400a34c0(0x30);
  }
  else {
    puVar5 = (undefined4 *)(**(code **)(*plVar1 + 8))(plVar1,0x30);
  }
  if (puVar5 != (undefined4 *)0x0) {
    uVar4 = *param_2;
    puVar5[10] = param_4;
    *puVar5 = uVar4;
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8);
  FUN_140144430(param_1);
  if (*(longlong *)(param_1 + 0x20) == 0) {
    *(undefined4 **)(param_1 + 0x10) = puVar5;
    *(undefined4 **)(param_1 + 0x18) = puVar5;
    *(undefined8 *)(puVar5 + 8) = 0;
    *(undefined8 *)(puVar5 + 6) = 0;
  }
  else {
    FUN_140144430(param_1);
    FUN_140144430(param_1);
    if (lVar2 == 0) {
      lVar2 = *(longlong *)(param_1 + 0x10);
      *(undefined8 *)(puVar5 + 8) = 0;
      *(longlong *)(puVar5 + 6) = lVar2;
      if (lVar2 != 0) {
        *(undefined4 **)(lVar2 + 0x20) = puVar5;
      }
      *(undefined4 **)(param_1 + 0x10) = puVar5;
    }
    else {
      if (*(longlong *)(lVar2 + 0x20) == 0) {
        *(undefined4 **)(param_1 + 0x10) = puVar5;
      }
      else {
        *(undefined4 **)(*(longlong *)(lVar2 + 0x20) + 0x18) = puVar5;
      }
      uVar3 = *(undefined8 *)(lVar2 + 0x20);
      *(longlong *)(puVar5 + 6) = lVar2;
      *(undefined8 *)(puVar5 + 8) = uVar3;
      *(undefined4 **)(lVar2 + 0x20) = puVar5;
    }
  }
  *(undefined4 **)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8) = puVar5;
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  FUN_140144430(param_1);
  FUN_140144430(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar4 = FUN_140142850(param_1);
    FUN_140144ad0(param_1,uVar4);
  }
  FUN_140144430(param_1);
  return puVar5;
}



undefined8 * FUN_1401465e0(longlong param_1,undefined8 *param_2,uint param_3,undefined4 param_4)

{
  longlong *plVar1;
  undefined8 uVar2;
  longlong lVar3;
  undefined4 uVar4;
  undefined8 *puVar5;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    puVar5 = (undefined8 *)FUN_1400a34c0(0x28);
  }
  else {
    puVar5 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,0x28);
  }
  if (puVar5 != (undefined8 *)0x0) {
    uVar2 = *param_2;
    *(undefined4 *)(puVar5 + 4) = param_4;
    *puVar5 = uVar2;
  }
  lVar3 = *(longlong *)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8);
  FUN_1401b2030(param_1);
  if (*(longlong *)(param_1 + 0x20) == 0) {
    *(undefined8 **)(param_1 + 0x10) = puVar5;
    *(undefined8 **)(param_1 + 0x18) = puVar5;
    puVar5[3] = 0;
    puVar5[2] = 0;
  }
  else {
    FUN_1401b2030(param_1);
    FUN_1401b2030(param_1);
    if (lVar3 == 0) {
      lVar3 = *(longlong *)(param_1 + 0x10);
      puVar5[3] = 0;
      puVar5[2] = lVar3;
      if (lVar3 != 0) {
        *(undefined8 **)(lVar3 + 0x18) = puVar5;
      }
      *(undefined8 **)(param_1 + 0x10) = puVar5;
    }
    else {
      if (*(longlong *)(lVar3 + 0x18) == 0) {
        *(undefined8 **)(param_1 + 0x10) = puVar5;
      }
      else {
        *(undefined8 **)(*(longlong *)(lVar3 + 0x18) + 0x10) = puVar5;
      }
      uVar2 = *(undefined8 *)(lVar3 + 0x18);
      puVar5[2] = lVar3;
      puVar5[3] = uVar2;
      *(undefined8 **)(lVar3 + 0x18) = puVar5;
    }
  }
  *(undefined8 **)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8) = puVar5;
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  FUN_1401b2030(param_1);
  FUN_1401b2030(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar4 = FUN_140142850(param_1);
    FUN_1401b2490(param_1,uVar4);
  }
  FUN_1401b2030(param_1);
  return puVar5;
}



void FUN_140146720(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar2 = *(longlong *)(param_1 + 0x20);
  lVar1 = lVar2;
  while (lVar1 != 0) {
    if (lVar2 != 0) {
      lVar2 = lVar2 + -1;
      *(longlong *)(param_1 + 0x20) = lVar2;
      if (lVar2 == 0) {
        *(undefined8 *)(param_1 + 0x18) = 0;
      }
    }
    lVar1 = *(longlong *)(param_1 + 0x20);
  }
  lVar2 = *(longlong *)(param_1 + 0x10);
  while (lVar2 != 0) {
    lVar2 = lVar2 + -1;
    if (*(longlong *)(*(longlong *)(param_1 + 8) + lVar2 * 8) != 0) {
      operator_delete(*(void **)(*(longlong *)(param_1 + 8) + lVar2 * 8));
    }
  }
  if (*(void **)(param_1 + 8) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 8));
  }
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  return;
}



undefined8 * FUN_1401467b0(undefined8 *param_1,undefined8 *param_2)

{
  undefined8 uVar1;
  longlong lVar2;
  longlong lVar3;
  
  uVar1 = *param_1;
  lVar2 = param_1[4];
  param_2[1] = 0;
  lVar3 = param_1[3];
  *param_2 = uVar1;
  param_2[2] = lVar2 + lVar3;
  return param_2;
}



void FUN_1401467d0(longlong param_1,ulonglong param_2)

{
  longlong lVar1;
  size_t sVar2;
  code *pcVar3;
  ulonglong uVar4;
  void *_Dst;
  void *pvVar5;
  void *pvVar6;
  ulonglong uVar7;
  
  uVar7 = *(ulonglong *)(param_1 + 0x10);
  if (0xfffffffffffffff - uVar7 < param_2) {
    std::_Xlength_error("deque<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  uVar4 = uVar7 >> 1;
  if (uVar4 < 8) {
    uVar4 = 8;
  }
  if ((param_2 < uVar4) && (uVar7 <= 0xfffffffffffffff - uVar4)) {
    param_2 = uVar4;
  }
  uVar4 = *(ulonglong *)(param_1 + 0x18) >> 2;
  _Dst = (void *)FUN_140144ec0(param_1 + 0x29,uVar7 + param_2);
  lVar1 = uVar4 * 8;
  pvVar5 = (void *)(lVar1 + *(longlong *)(param_1 + 8));
  uVar7 = (*(longlong *)(param_1 + 0x10) * 8 - (longlong)pvVar5) + *(longlong *)(param_1 + 8) &
          0xfffffffffffffff8;
  pvVar5 = memmove((void *)(lVar1 + (longlong)_Dst),pvVar5,uVar7);
  pvVar5 = (void *)((longlong)pvVar5 + uVar7);
  if (param_2 < uVar4) {
    memmove(pvVar5,*(void **)(param_1 + 8),param_2 * 8);
    pvVar5 = (void *)(param_2 * 8 + *(longlong *)(param_1 + 8));
    sVar2 = ((lVar1 - (longlong)pvVar5) + *(longlong *)(param_1 + 8) >> 3) * 8;
    pvVar5 = memmove(_Dst,pvVar5,sVar2);
    pvVar5 = (void *)((longlong)pvVar5 + sVar2);
    uVar4 = param_2;
  }
  else {
    sVar2 = (lVar1 >> 3) * 8;
    pvVar6 = memmove(pvVar5,*(void **)(param_1 + 8),sVar2);
    pvVar5 = _Dst;
    if (param_2 - uVar4 != 0) {
      memset((void *)((longlong)pvVar6 + sVar2),0,(param_2 - uVar4) * 8);
    }
  }
  if (uVar4 != 0) {
    memset(pvVar5,0,uVar4 << 3);
  }
  if (*(void **)(param_1 + 8) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 8));
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + param_2;
  *(void **)(param_1 + 8) = _Dst;
  return;
}



longlong FUN_140146970(longlong param_1,longlong param_2)

{
  undefined4 uVar1;
  longlong lVar2;
  longlong lVar3;
  undefined1 local_58 [80];
  
  *(undefined4 *)(param_1 + 0xc8c) = 200;
  lVar3 = 0;
  *(undefined4 *)(param_1 + 0xc88) = 0;
  *(longlong *)(param_1 + 0xc80) = param_1;
  lVar2 = *(longlong *)(param_2 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_2 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    uVar1 = *(undefined4 *)(param_2 + 0x18);
  }
  else {
    uVar1 = *(undefined4 *)(lVar2 + 0x18);
  }
  if (*(longlong *)(param_2 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830(param_1,param_2,uVar1,0,0xfffffffffffffffe);
    }
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar3 = *(longlong *)(lVar2 + 0x10);
    }
  }
  else {
    lVar3 = *(longlong *)(param_2 + 0x10);
    if (lVar3 == 0) {
      FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
  }
  FUN_140145be0(param_1,lVar3);
  return param_1;
}



undefined8 FUN_140146a30(longlong param_1,uint param_2,longlong param_3)

{
  undefined4 uVar1;
  int iVar2;
  uint *puVar3;
  ulonglong uVar4;
  undefined8 uVar5;
  longlong lVar6;
  longlong lVar7;
  int iVar8;
  longlong lVar9;
  undefined4 *puVar10;
  
  FUN_140143980(param_3);
  uVar5 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_1400a1c30(uVar5);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))(param_1 + -0xa8);
  }
  uVar4 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xbf8);
  if (*(longlong *)(param_1 + 0xbd8) != 0) {
    for (puVar3 = *(uint **)(*(longlong *)(param_1 + 0xbd8) + uVar4 * 8);
        (puVar3 != (uint *)0x0 && ((uint)uVar4 == puVar3[8] % *(uint *)(param_1 + 0xbf8)));
        puVar3 = *(uint **)(puVar3 + 4)) {
      if (*puVar3 == param_2) {
        if (*(longlong *)(*(longlong *)(puVar3 + 2) + 0x68) == 0) {
          puVar10 = (undefined4 *)0x0;
        }
        else {
          puVar10 = *(undefined4 **)(*(longlong *)(puVar3 + 2) + 0x58);
        }
        while( true ) {
          if (puVar10 == (undefined4 *)0x0) {
            FUN_1400d1290(uVar5);
            return 1;
          }
          uVar1 = *puVar10;
          iVar2 = *(int *)(param_3 + 0x18);
          lVar9 = (longlong)iVar2;
          if (iVar2 < 0) break;
          iVar8 = *(int *)(param_3 + 0x18);
          FUN_140143980(param_3,iVar8 + 1);
          iVar8 = iVar8 - iVar2;
          if (0 < iVar8) {
            if (*(int *)(param_3 + 0x18) == 0) {
              lVar7 = 0;
              lVar6 = 0;
            }
            else {
              lVar7 = *(longlong *)(param_3 + 0x10);
              lVar6 = *(longlong *)(param_3 + 0x10);
            }
            memmove((void *)(lVar6 + 4 + lVar9 * 4),(void *)(lVar7 + lVar9 * 4),(longlong)iVar8 << 2
                   );
          }
          if (*(int *)(param_3 + 0x18) == 0) {
            lVar7 = 0;
          }
          else {
            lVar7 = *(longlong *)(param_3 + 0x10);
          }
          *(undefined4 *)(lVar7 + lVar9 * 4) = uVar1;
          puVar10 = *(undefined4 **)(puVar10 + 4);
        }
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
    }
  }
  FUN_1400d1290(uVar5);
  return 0;
}



void FUN_140146bc0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong lVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  
  uVar6 = 0xfffffffffffffffe;
  plVar1 = (longlong *)(param_1 + -0xa8);
  uVar3 = (**(code **)(*plVar1 + 0x58))(plVar1);
  uVar5 = uVar3;
  FUN_1400a1c30(uVar3);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*plVar1 + 200))
              (plVar1,L"Proud::CNetServerImpl::CloseEveryConnection",*plVar1,param_4,uVar6,uVar5,1);
  }
  if (*(longlong *)(param_1 + 0xbf0) == 0) {
    lVar4 = 0;
  }
  else {
    lVar4 = *(longlong *)(param_1 + 0xbe0);
  }
  for (; lVar4 != 0; lVar4 = *(longlong *)(lVar4 + 0x10)) {
    lVar2 = *(longlong *)(lVar4 + 8);
    if ((*(longlong *)(lVar2 + 0x228) == 0) && (*(double *)(lVar2 + 0x758) == 0.0)) {
      uVar5 = (**(code **)(*(longlong *)(param_1 + 0x70) + 8))();
      *(undefined8 *)(lVar2 + 0x758) = uVar5;
      (**(code **)(*(longlong *)(param_1 + 0x400) + 0x100))
                ((longlong *)(param_1 + 0x400),*(undefined4 *)(lVar2 + 0x6f8),&DAT_140318cf0);
    }
  }
  FUN_1400d1290(uVar3);
  return;
}



longlong FUN_140146cc0(longlong param_1,uint param_2)

{
  longlong lVar1;
  ulonglong uVar2;
  uint *puVar3;
  
  uVar2 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xca0);
  if ((*(longlong *)(param_1 + 0xc80) != 0) &&
     (puVar3 = *(uint **)(*(longlong *)(param_1 + 0xc80) + uVar2 * 8), puVar3 != (uint *)0x0)) {
    while ((uint)uVar2 == puVar3[8] % *(uint *)(param_1 + 0xca0)) {
      if (*puVar3 == param_2) {
        lVar1 = *(longlong *)(puVar3 + 2);
        if (lVar1 == 0) {
          return 0;
        }
        if (*(longlong *)(lVar1 + 0x228) != 0) {
          return 0;
        }
        return lVar1;
      }
      puVar3 = *(uint **)(puVar3 + 4);
      if (puVar3 == (uint *)0x0) {
        return 0;
      }
    }
  }
  return 0;
}



undefined8 FUN_140146d30(longlong param_1,uint param_2)

{
  undefined8 uVar1;
  longlong lVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  uint *puVar5;
  
  uVar4 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_1400a1c30(uVar4);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))(param_1 + -0xa8);
  }
  uVar3 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xbf8);
  if ((*(longlong *)(param_1 + 0xbd8) != 0) &&
     (puVar5 = *(uint **)(*(longlong *)(param_1 + 0xbd8) + uVar3 * 8), puVar5 != (uint *)0x0)) {
    while ((uint)uVar3 == puVar5[8] % *(uint *)(param_1 + 0xbf8)) {
      if (*puVar5 == param_2) {
        lVar2 = *(longlong *)(puVar5 + 2);
        if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x228) == 0)) {
          uVar1 = *(undefined8 *)(lVar2 + 0x1c0);
          FUN_1400d1290(uVar4);
          return uVar1;
        }
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar4);
  return 0xbff0000000000000;
}



undefined8 FUN_140146e40(longlong param_1,uint param_2)

{
  undefined8 uVar1;
  longlong lVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  uint *puVar5;
  
  uVar4 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_1400a1c30(uVar4);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))(param_1 + -0xa8);
  }
  uVar3 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xbf8);
  if ((*(longlong *)(param_1 + 0xbd8) != 0) &&
     (puVar5 = *(uint **)(*(longlong *)(param_1 + 0xbd8) + uVar3 * 8), puVar5 != (uint *)0x0)) {
    while ((uint)uVar3 == puVar5[8] % *(uint *)(param_1 + 0xbf8)) {
      if (*puVar5 == param_2) {
        lVar2 = *(longlong *)(puVar5 + 2);
        if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x228) == 0)) {
          uVar1 = *(undefined8 *)(lVar2 + 0x1c8);
          FUN_1400d1290(uVar4);
          return uVar1;
        }
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar4);
  return 0xbff0000000000000;
}



int FUN_140146f50(longlong param_1,longlong param_2,int param_3)

{
  undefined8 uVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  
  uVar1 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_1400a1c30(uVar1);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))(param_1 + -0xa8);
  }
  iVar3 = 0;
  if (*(longlong *)(param_1 + 0xbf0) == 0) {
    lVar2 = 0;
  }
  else {
    lVar2 = *(longlong *)(param_1 + 0xbe0);
  }
  lVar4 = 0;
  if (0 < param_3) {
    do {
      if (lVar2 == 0) break;
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      *(undefined4 *)(param_2 + lVar4 * 4) = *(undefined4 *)(*(longlong *)(lVar2 + 8) + 0x6f8);
      iVar3 = iVar3 + 1;
      lVar4 = lVar4 + 1;
      if (lVar2 != 0) {
        lVar2 = *(longlong *)(lVar2 + 0x10);
      }
    } while (lVar4 < param_3);
  }
  FUN_1400d1290(uVar1);
  return iVar3;
}



undefined8 FUN_140147050(longlong param_1,uint param_2,undefined8 param_3)

{
  uint uVar1;
  uint *puVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined1 uVar7;
  
  uVar5 = 0xfffffffffffffffe;
  uVar4 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  uVar6 = uVar4;
  FUN_1400a1c30(uVar4);
  uVar7 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))(param_1 + -0xa8);
  }
  uVar1 = *(uint *)(param_1 + 0xbf8);
  uVar3 = (ulonglong)param_2 % (ulonglong)uVar1;
  if (*(longlong *)(param_1 + 0xbd8) != 0) {
    puVar2 = *(uint **)(*(longlong *)(param_1 + 0xbd8) + uVar3 * 8);
    while( true ) {
      if ((puVar2 == (uint *)0x0) || ((uint)uVar3 != puVar2[8] % uVar1)) goto LAB_14014712a;
      if (*puVar2 == param_2) break;
      puVar2 = *(uint **)(puVar2 + 4);
    }
    if (*(longlong *)(puVar2 + 2) != 0) {
      FUN_14019af80(*(longlong *)(puVar2 + 2),param_3,uVar3,(ulonglong)uVar1,uVar5,uVar6,uVar7);
      FUN_1400d1290(uVar4);
      return 1;
    }
  }
LAB_14014712a:
  FUN_1400d1290(uVar4);
  return 0;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x00014014763b)
// WARNING: Removing unreachable block (ram,0x0001401474df)
// WARNING: Removing unreachable block (ram,0x00014014779b)

void FUN_140147150(longlong *param_1)

{
  ulonglong uVar1;
  code *pcVar2;
  undefined8 uVar3;
  longlong lVar4;
  undefined8 uVar5;
  longlong lVar6;
  ulonglong uVar7;
  undefined4 *puVar8;
  longlong *plVar9;
  longlong lVar10;
  undefined1 *puVar11;
  undefined1 *puVar12;
  undefined1 *puVar13;
  undefined1 *puVar14;
  int iVar15;
  longlong lVar16;
  undefined8 *puVar17;
  longlong *plVar18;
  undefined8 uVar19;
  undefined1 auStack_a8 [32];
  undefined8 local_88;
  char local_80;
  longlong *local_78;
  undefined8 local_70;
  undefined1 local_68;
  longlong local_60;
  longlong local_58;
  undefined8 local_50;
  ulonglong local_48;
  
  puVar11 = auStack_a8;
  puVar14 = auStack_a8;
  local_50 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)&local_88;
  uVar5 = (**(code **)(*param_1 + 0x58))();
  local_70 = uVar5;
  FUN_1400a1c30(uVar5);
  local_68 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::TcpAndUdp_DoForLongInterval");
  }
  lVar6 = (longlong)(int)param_1[0xdc];
  puVar17 = (undefined8 *)0x0;
  if (0 < (int)param_1[0xdc]) {
    uVar1 = lVar6 * 8 + 0x10;
    if (uVar1 < 0x401) {
      uVar7 = lVar6 * 8 + 0x1f;
      if (uVar7 <= uVar1) {
        uVar7 = 0xffffffffffffff0;
      }
      lVar10 = -(uVar7 & 0xfffffffffffffff0);
      puVar11 = auStack_a8 + lVar10;
      puVar8 = (undefined4 *)((longlong)&local_88 + lVar10);
      puVar17 = (undefined8 *)0x0;
      puVar14 = auStack_a8 + lVar10;
      if (puVar8 != (undefined4 *)0x0) {
        *puVar8 = 0xcccc;
LAB_14014723e:
        puVar17 = (undefined8 *)(puVar8 + 4);
        puVar14 = puVar11;
      }
    }
    else {
      puVar8 = malloc(uVar1);
      puVar17 = (undefined8 *)0x0;
      puVar14 = auStack_a8;
      if (puVar8 != (undefined4 *)0x0) {
        *puVar8 = 0xdddd;
        goto LAB_14014723e;
      }
    }
    iVar15 = 0;
    lVar10 = 0;
    uVar5 = local_70;
    if (0 < lVar6) {
      do {
        if ((lVar10 < 0) || ((int)param_1[0xdc] <= iVar15)) {
                    // WARNING: Subroutine does not return
          *(undefined **)(puVar14 + -8) = &UNK_14014728f;
          FUN_1400a2700();
        }
        plVar18 = *(longlong **)(param_1[0xdb] + lVar10 * 8);
        lVar16 = 0;
        if (plVar18 != (longlong *)0x0) {
          lVar16 = *plVar18;
        }
        *(undefined8 *)(puVar14 + -8) = 0x14014727a;
        FUN_1401a1450(lVar16 + 0x40);
        puVar17[lVar10] = lVar16;
        iVar15 = iVar15 + 1;
        lVar10 = lVar10 + 1;
        uVar5 = local_70;
      } while (lVar10 < lVar6);
    }
  }
  local_58 = param_1[0x193];
  plVar18 = (longlong *)0x0;
  if (0 < (int)local_58) {
    lVar10 = (longlong)(int)local_58 * 8;
    uVar1 = lVar10 + 0x10;
    if (uVar1 < 0x401) {
      uVar7 = lVar10 + 0x1f;
      if (uVar7 <= uVar1) {
        uVar7 = 0xffffffffffffff0;
      }
      *(undefined8 *)(puVar14 + -8) = 0x1401472dc;
      lVar10 = -(uVar7 & 0xfffffffffffffff0);
      puVar12 = puVar14 + lVar10;
      puVar8 = (undefined4 *)(puVar14 + lVar10 + 0x20);
      plVar18 = (longlong *)0x0;
      puVar14 = puVar14 + lVar10;
      if (puVar8 != (undefined4 *)0x0) {
        *puVar8 = 0xcccc;
        puVar14 = puVar12;
LAB_140147306:
        plVar18 = (longlong *)(puVar8 + 4);
      }
    }
    else {
      *(undefined8 *)(puVar14 + -8) = 0x1401472f8;
      puVar8 = malloc(uVar1);
      plVar18 = (longlong *)0x0;
      if (puVar8 != (undefined4 *)0x0) {
        *puVar8 = 0xdddd;
        goto LAB_140147306;
      }
    }
    plVar9 = plVar18;
    if (param_1[0x193] == 0) {
      lVar10 = 0;
    }
    else {
      lVar10 = param_1[0x191];
    }
    for (; uVar5 = local_70, lVar10 != 0; lVar10 = *(longlong *)(lVar10 + 0x10)) {
      lVar16 = *(longlong *)(lVar10 + 8);
      *(undefined8 *)(puVar14 + -8) = 0x140147337;
      FUN_1401a1450(lVar16 + 0xc0);
      *plVar9 = lVar16;
      plVar9 = plVar9 + 1;
    }
  }
  local_60 = param_1[0x2e1];
  local_78 = (longlong *)0x0;
  if ((int)local_60 < 1) goto LAB_140147406;
  lVar10 = (longlong)(int)local_60 * 8;
  uVar1 = lVar10 + 0x10;
  if (uVar1 < 0x401) {
    uVar7 = lVar10 + 0x1f;
    if (uVar7 <= uVar1) {
      uVar7 = 0xffffffffffffff0;
    }
    *(undefined8 *)(puVar14 + -8) = 0x140147391;
    lVar10 = -(uVar7 & 0xfffffffffffffff0);
    puVar13 = puVar14 + lVar10;
    plVar9 = (longlong *)(puVar14 + lVar10 + 0x20);
    puVar14 = puVar14 + lVar10;
    local_78 = plVar9;
    if (plVar9 != (longlong *)0x0) {
      *(undefined4 *)plVar9 = 0xcccc;
      puVar14 = puVar13;
LAB_1401473bf:
      local_78 = plVar9 + 2;
    }
  }
  else {
    *(undefined8 *)(puVar14 + -8) = 0x1401473b0;
    plVar9 = malloc(uVar1);
    local_78 = plVar9;
    if (plVar9 != (longlong *)0x0) {
      *(undefined4 *)plVar9 = 0xdddd;
      goto LAB_1401473bf;
    }
  }
  plVar9 = local_78;
  if (param_1[0x2e1] == 0) {
    lVar10 = 0;
  }
  else {
    lVar10 = param_1[0x2df];
  }
  for (; uVar5 = local_70, lVar10 != 0; lVar10 = *(longlong *)(lVar10 + 0x18)) {
    lVar16 = *(longlong *)(lVar10 + 0x10);
    *(undefined8 *)(puVar14 + -8) = 0x1401473f5;
    FUN_1401a1450(lVar16 + 0xc0);
    *plVar9 = lVar16;
    plVar9 = plVar9 + 1;
  }
LAB_140147406:
  pcVar2 = *(code **)(param_1[0x23] + 8);
  *(undefined8 *)(puVar14 + -8) = 0x140147413;
  uVar19 = (*pcVar2)();
  *(undefined8 *)(puVar14 + -8) = 0x14014741f;
  FUN_1400d1290(uVar5);
  local_68 = 0;
  if (puVar17 != (undefined8 *)0x0) {
    while ((0 < lVar6 && (lVar10 = 0, 0 < lVar6))) {
      do {
        lVar16 = puVar17[lVar10];
        pcVar2 = *(code **)(*(longlong *)(lVar16 + 0x88) + 0x10);
        *(undefined8 *)(puVar14 + -8) = 0x140147451;
        uVar5 = (*pcVar2)();
        local_80 = 0;
        local_88 = uVar5;
        if (lVar10 == 0) {
          local_80 = 1;
          *(undefined8 *)(puVar14 + -8) = 0x1401474ab;
          FUN_1400a1c30(uVar5);
          *(undefined8 *)(puVar14 + -8) = 0x1401474b7;
          FUN_1401a1740(lVar16,uVar19);
          *(undefined8 *)(puVar14 + -8) = 0x1401474bf;
          FUN_1400d1290(uVar5);
          local_80 = '\0';
          *(undefined8 *)(puVar14 + -8) = 0x1401474cf;
          FUN_1401a1460(lVar16 + 0x40);
          *puVar17 = puVar17[lVar6 + -1];
LAB_1401474d7:
          lVar6 = lVar6 + -1;
        }
        else {
          *(undefined8 *)(puVar14 + -8) = 0x140147469;
          local_80 = FUN_1400a1c80();
          if (local_80 != '\0') {
            *(undefined8 *)(puVar14 + -8) = 0x14014747f;
            FUN_1401a1740(lVar16,uVar19);
            *(undefined8 *)(puVar14 + -8) = 0x140147487;
            FUN_1400d1290(uVar5);
            local_80 = '\0';
            *(undefined8 *)(puVar14 + -8) = 0x140147497;
            FUN_1401a1460(lVar16 + 0x40);
            puVar17[lVar10] = puVar17[lVar6 + -1];
            goto LAB_1401474d7;
          }
        }
        lVar10 = lVar10 + 1;
      } while (lVar10 < lVar6);
    }
    if (*(int *)(puVar17 + -2) == 0xdddd) {
      *(undefined8 *)(puVar14 + -8) = 0x140147512;
      free(puVar17 + -2);
    }
  }
  if (plVar18 != (longlong *)0x0) {
    lVar6 = (longlong)(int)local_58;
    while ((0 < lVar6 && (lVar10 = 0, 0 < lVar6))) {
      do {
        lVar16 = plVar18[lVar10];
        pcVar2 = *(code **)(*(longlong *)(lVar16 + 0x108) + 0x10);
        *(undefined8 *)(puVar14 + -8) = 0x140147552;
        uVar5 = (*pcVar2)();
        local_80 = 0;
        local_88 = uVar5;
        if (lVar10 == 0) {
          local_80 = 1;
          *(undefined8 *)(puVar14 + -8) = 0x1401475dc;
          FUN_1400a1c30(uVar5);
          uVar3 = *(undefined8 *)(lVar16 + 0x748);
          *(undefined8 *)(puVar14 + -8) = 0x1401475ed;
          FUN_1401a0ed0(uVar3,uVar19);
          if ((*(longlong **)(lVar16 + 0x760) != (longlong *)0x0) &&
             (lVar4 = **(longlong **)(lVar16 + 0x760), lVar4 != 0)) {
            uVar3 = *(undefined8 *)(lVar4 + 0x168);
            *(undefined8 *)(puVar14 + -8) = 0x140147612;
            FUN_14019e800(uVar3,uVar19);
          }
          *(undefined8 *)(puVar14 + -8) = 0x14014761a;
          FUN_1400d1290(uVar5);
          local_80 = '\0';
          *(undefined8 *)(puVar14 + -8) = 0x14014762c;
          FUN_1401a1460(lVar16 + 0xc0);
          *plVar18 = plVar18[lVar6 + -1];
LAB_140147634:
          lVar6 = lVar6 + -1;
        }
        else {
          *(undefined8 *)(puVar14 + -8) = 0x14014756a;
          local_80 = FUN_1400a1c80();
          if (local_80 != '\0') {
            uVar3 = *(undefined8 *)(lVar16 + 0x748);
            *(undefined8 *)(puVar14 + -8) = 0x140147589;
            FUN_1401a0ed0(uVar3,uVar19);
            if ((*(longlong **)(lVar16 + 0x760) != (longlong *)0x0) &&
               (lVar4 = **(longlong **)(lVar16 + 0x760), lVar4 != 0)) {
              uVar3 = *(undefined8 *)(lVar4 + 0x168);
              *(undefined8 *)(puVar14 + -8) = 0x1401475ae;
              FUN_14019e800(uVar3,uVar19);
            }
            *(undefined8 *)(puVar14 + -8) = 0x1401475b6;
            FUN_1400d1290(uVar5);
            local_80 = '\0';
            *(undefined8 *)(puVar14 + -8) = 0x1401475c8;
            FUN_1401a1460(lVar16 + 0xc0);
            plVar18[lVar10] = plVar18[lVar6 + -1];
            goto LAB_140147634;
          }
        }
        lVar10 = lVar10 + 1;
      } while (lVar10 < lVar6);
    }
    if ((int)plVar18[-2] == 0xdddd) {
      *(undefined8 *)(puVar14 + -8) = 0x14014766e;
      free(plVar18 + -2);
    }
  }
  plVar18 = local_78;
  if (local_78 != (longlong *)0x0) {
    lVar6 = (longlong)(int)local_60;
    while ((0 < lVar6 && (lVar10 = 0, 0 < lVar6))) {
      do {
        lVar16 = plVar18[lVar10];
        pcVar2 = *(code **)(*(longlong *)(lVar16 + 0x108) + 0x10);
        *(undefined8 *)(puVar14 + -8) = 0x1401476b2;
        uVar5 = (*pcVar2)();
        local_80 = 0;
        local_88 = uVar5;
        if (lVar10 == 0) {
          local_80 = 1;
          *(undefined8 *)(puVar14 + -8) = 0x14014773c;
          FUN_1400a1c30(uVar5);
          uVar3 = *(undefined8 *)(lVar16 + 0x748);
          *(undefined8 *)(puVar14 + -8) = 0x14014774d;
          FUN_1401a0ed0(uVar3,uVar19);
          if ((*(longlong **)(lVar16 + 0x760) != (longlong *)0x0) &&
             (lVar4 = **(longlong **)(lVar16 + 0x760), lVar4 != 0)) {
            uVar3 = *(undefined8 *)(lVar4 + 0x168);
            *(undefined8 *)(puVar14 + -8) = 0x140147772;
            FUN_14019e800(uVar3,uVar19);
          }
          *(undefined8 *)(puVar14 + -8) = 0x14014777a;
          FUN_1400d1290(uVar5);
          local_80 = '\0';
          *(undefined8 *)(puVar14 + -8) = 0x14014778c;
          FUN_1401a1460(lVar16 + 0xc0);
          *plVar18 = plVar18[lVar6 + -1];
LAB_140147794:
          lVar6 = lVar6 + -1;
        }
        else {
          *(undefined8 *)(puVar14 + -8) = 0x1401476ca;
          local_80 = FUN_1400a1c80();
          if (local_80 != '\0') {
            uVar3 = *(undefined8 *)(lVar16 + 0x748);
            *(undefined8 *)(puVar14 + -8) = 0x1401476e9;
            FUN_1401a0ed0(uVar3,uVar19);
            if ((*(longlong **)(lVar16 + 0x760) != (longlong *)0x0) &&
               (lVar4 = **(longlong **)(lVar16 + 0x760), lVar4 != 0)) {
              uVar3 = *(undefined8 *)(lVar4 + 0x168);
              *(undefined8 *)(puVar14 + -8) = 0x14014770e;
              FUN_14019e800(uVar3,uVar19);
            }
            *(undefined8 *)(puVar14 + -8) = 0x140147716;
            FUN_1400d1290(uVar5);
            local_80 = '\0';
            *(undefined8 *)(puVar14 + -8) = 0x140147728;
            FUN_1401a1460(lVar16 + 0xc0);
            plVar18[lVar10] = plVar18[lVar6 + -1];
            goto LAB_140147794;
          }
        }
        lVar10 = lVar10 + 1;
      } while (lVar10 < lVar6);
    }
    if ((int)plVar18[-2] == 0xdddd) {
      *(undefined8 *)(puVar14 + -8) = 0x1401477ce;
      free(plVar18 + -2);
    }
  }
  *(undefined8 *)(puVar14 + -8) = 0x1401477db;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x0001401479b2)
// WARNING: Removing unreachable block (ram,0x0001401479b9)
// WARNING: Removing unreachable block (ram,0x0001401479c5)
// WARNING: Removing unreachable block (ram,0x0001401479d2)
// WARNING: Removing unreachable block (ram,0x0001401479ca)
// WARNING: Removing unreachable block (ram,0x0001401479d9)
// WARNING: Removing unreachable block (ram,0x0001401479ea)

undefined1
FUN_140147810(longlong *param_1,longlong *param_2,undefined4 param_3,longlong param_4,int param_5,
             undefined4 *param_6,undefined4 param_7,undefined8 param_8)

{
  int *piVar1;
  undefined *puVar2;
  undefined1 uVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  longlong lVar8;
  undefined *puVar9;
  longlong lVar10;
  uint uVar11;
  longlong lVar12;
  undefined1 auStack_178 [32];
  undefined8 local_158;
  undefined8 local_150;
  undefined1 local_148;
  longlong *local_140;
  longlong *local_138;
  undefined8 local_130;
  undefined8 local_128;
  undefined1 local_120;
  undefined *local_118;
  undefined1 local_110 [8];
  undefined4 local_108;
  undefined **local_100;
  longlong *local_f8;
  ulonglong local_f0;
  int local_e8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined **local_90;
  longlong *local_88;
  longlong local_80;
  ulonglong local_58;
  
  local_130 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_178;
  local_158 = param_8;
  local_140 = param_1;
  local_138 = param_2;
  FUN_140140bf0(&local_118);
  if (local_118 == (undefined *)0x0) {
    local_118 = PTR_DAT_1402f8010;
  }
  if ((undefined *)*param_2 != local_118) {
    uVar4 = FUN_1400a3440();
    local_128 = uVar4;
    FUN_1400a1c30(uVar4);
    puVar2 = local_118;
    local_120 = 1;
    if (((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1402f8010)) &&
       (puVar9 = local_118 + -8, puVar9 != (undefined *)0x0)) {
      uVar5 = FUN_1400a3440();
      local_150 = uVar5;
      FUN_1400a1c30(uVar5);
      local_148 = 1;
      piVar1 = (int *)(puVar2 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar9);
      }
      FUN_1400d1290(uVar5);
    }
    local_118 = (undefined *)*param_2;
    if (((local_118 != PTR_DAT_1402f8010) && (local_118 != (undefined *)0x0)) &&
       (local_118 != (undefined *)0x8)) {
      *(int *)(local_118 + -4) = *(int *)(local_118 + -4) + 1;
    }
    FUN_1400d1290(uVar4);
  }
  local_108 = param_3;
  if (param_4 == 0) {
    uVar7 = 0;
    if (0 < param_5) {
      do {
        lVar12 = (longlong)local_e8;
        if (local_e8 < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        FUN_140021fb0(&local_100,local_e8 + 1);
        uVar6 = local_f0;
        if (local_e8 == 0) {
          uVar6 = 0;
        }
        *(undefined4 *)(uVar6 + lVar12 * 4) = 0;
        uVar11 = (int)uVar7 + 1;
        uVar7 = (ulonglong)uVar11;
      } while ((int)uVar11 < param_5);
    }
  }
  else {
    lVar12 = (longlong)param_5;
    if (param_5 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (param_5 != 0) {
      lVar10 = (longlong)local_e8;
      FUN_140021fb0(&local_100,local_e8 + param_5);
      if (0 < param_5) {
        lVar8 = lVar10 * 4;
        do {
          uVar7 = local_f0;
          if (local_e8 == 0) {
            uVar7 = 0;
          }
          *(undefined4 *)(lVar8 + uVar7) = *(undefined4 *)(param_4 + lVar10 * -4 + lVar8);
          lVar8 = lVar8 + 4;
          lVar12 = lVar12 + -1;
        } while (lVar12 != 0);
      }
    }
  }
  local_d4 = *param_6;
  local_d0 = param_6[1];
  local_cc = param_6[2];
  local_c8 = param_6[3];
  local_c4 = param_7;
  uVar3 = (**(code **)(*local_140 + 0x138))(local_140,&local_118,local_158);
  local_90 = Proud::CFastArray<int,0>::vftable;
  if (local_80 != 0) {
    if (local_88 == (longlong *)0x0) {
      FUN_1400a3530(local_80);
    }
    else {
      (**(code **)(*local_88 + 0x18))();
    }
  }
  local_100 = Proud::CFastArray<int,0>::vftable;
  if (local_f0 != 0) {
    if (local_f8 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*local_f8 + 0x18))(local_f8,local_f0);
    }
  }
  FUN_1400031d0(local_110);
  puVar2 = local_118;
  if (((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1402f8010)) &&
     (puVar9 = local_118 + -8, puVar9 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    local_150 = uVar4;
    FUN_1400a1c30(uVar4);
    local_148 = 1;
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar9);
    }
    FUN_1400d1290(uVar4);
  }
  local_118 = PTR_DAT_1402f8010;
  FUN_1400031d0(param_2);
  return uVar3;
}



void FUN_140147b40(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  undefined4 *puVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  uVar1 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  uVar2 = uVar1;
  FUN_1400a1c30(uVar1);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
              (param_1 + -0xa8,L"Proud::CNetServerImpl::EnableLog",*(longlong *)(param_1 + -0xa8),
               param_4,uVar4,uVar2,1);
  }
  if (*(longlong *)(param_1 + 0x1748) == 0) {
    uVar2 = FUN_1401957a0(param_2);
    *(undefined8 *)(param_1 + 0x1748) = uVar2;
    if (*(longlong *)(param_1 + 0xbf0) == 0) {
      puVar3 = (undefined4 *)0x0;
    }
    else {
      puVar3 = *(undefined4 **)(param_1 + 0xbe0);
    }
    for (; puVar3 != (undefined4 *)0x0; puVar3 = *(undefined4 **)(puVar3 + 4)) {
      if (*(longlong *)(*(longlong *)(puVar3 + 2) + 0x228) == 0) {
        (**(code **)(*(longlong *)(param_1 + 0x400) + 0xb0))
                  ((longlong *)(param_1 + 0x400),*puVar3,&DAT_140318cf0);
      }
    }
  }
  FUN_1400d1290(uVar1);
  return;
}



void FUN_140147c30(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  undefined8 uVar2;
  undefined4 *puVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  
  uVar4 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  uVar5 = uVar2;
  FUN_1400a1c30(uVar2);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
              (param_1 + -0xa8,L"Proud::CNetServerImpl::DisableLog",*(longlong *)(param_1 + -0xa8),
               param_4,uVar4,uVar5,1);
  }
  pvVar1 = *(void **)(param_1 + 0x1748);
  if (pvVar1 != (void *)0x0) {
    FUN_140195650(pvVar1);
    operator_delete(pvVar1);
  }
  puVar3 = (undefined4 *)0x0;
  *(undefined8 *)(param_1 + 0x1748) = 0;
  if (*(longlong *)(param_1 + 0xbf0) != 0) {
    puVar3 = *(undefined4 **)(param_1 + 0xbe0);
  }
  for (; puVar3 != (undefined4 *)0x0; puVar3 = *(undefined4 **)(puVar3 + 4)) {
    if (*(longlong *)(*(longlong *)(puVar3 + 2) + 0x228) == 0) {
      (**(code **)(*(longlong *)(param_1 + 0x400) + 0xc0))
                ((longlong *)(param_1 + 0x400),*puVar3,&DAT_140318cf0);
    }
  }
  FUN_1400d1290(uVar2);
  return;
}



void FUN_140147d20(longlong param_1,undefined8 *param_2)

{
  undefined8 uVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined8 local_20;
  undefined8 local_18;
  undefined4 local_10;
  
  uVar1 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_1400a1c30(uVar1);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
              (param_1 + -0xa8,L"Proud::CNetServerImpl::GetStats");
  }
  lVar4 = 0;
  local_20 = 0;
  local_58 = 0;
  local_60 = 0;
  local_48 = 0;
  local_50 = 0;
  local_28 = 0;
  local_30 = 0;
  local_38 = 0;
  local_40 = 0;
  local_18 = 0;
  local_10 = 0;
  memcpy(param_2,&local_60,0x58);
  *param_2 = *(undefined8 *)(param_1 + 0x458);
  param_2[1] = *(undefined8 *)(param_1 + 0x498);
  param_2[2] = *(undefined8 *)(param_1 + 0x4d8);
  param_2[3] = *(undefined8 *)(param_1 + 0x518);
  param_2[6] = *(undefined8 *)(param_1 + 0x558);
  param_2[7] = *(undefined8 *)(param_1 + 0x598);
  param_2[4] = *(undefined8 *)(param_1 + 0x618);
  param_2[5] = *(undefined8 *)(param_1 + 0x5d8);
  *(int *)(param_2 + 9) = (int)*(undefined8 *)(param_1 + 0xbf0);
  *(undefined4 *)((longlong)param_2 + 0x4c) = 0;
  *(undefined4 *)(param_2 + 10) = *(undefined4 *)(param_1 + 0x638);
  lVar2 = lVar4;
  if (*(longlong *)(param_1 + 0xbf0) != 0) {
    lVar2 = *(longlong *)(param_1 + 0xbe0);
  }
  for (; lVar2 != 0; lVar2 = *(longlong *)(lVar2 + 0x10)) {
    if (*(char *)(*(longlong *)(lVar2 + 8) + 0x700) != '\0') {
      *(int *)((longlong)param_2 + 0x4c) = *(int *)((longlong)param_2 + 0x4c) + 1;
    }
  }
  lVar2 = lVar4;
  if (*(longlong *)(param_1 + 0x250) != 0) {
    lVar2 = *(longlong *)(param_1 + 0x240);
  }
  for (; lVar2 != 0; lVar2 = *(longlong *)(lVar2 + 0x10)) {
    lVar3 = lVar4;
    if (*(longlong **)(lVar2 + 8) != (longlong *)0x0) {
      lVar3 = **(longlong **)(lVar2 + 8);
    }
    if ((*(char *)(lVar3 + 0x110) != '\0') &&
       (*(int *)(param_2 + 8) = *(int *)(param_2 + 8) + 1, *(char *)(lVar3 + 8) == '\0')) {
      *(int *)((longlong)param_2 + 0x44) = *(int *)((longlong)param_2 + 0x44) + 1;
    }
  }
  FUN_1400d1290(uVar1);
  return;
}



void FUN_140147ee0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined8 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  int iVar5;
  longlong lVar6;
  undefined1 local_60 [16];
  undefined1 local_50 [72];
  
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_1400a1c30(uVar2);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
              (param_1 + -0xa8,L"Proud::CNetServerImpl::GetUdpListenerLocalAddrs");
  }
  if (*(int *)(param_1 + 0x179c) == 1) {
    FUN_140144090(param_2,0);
    iVar5 = 0;
    lVar6 = 0;
    if (0 < *(int *)(param_1 + 0x638)) {
      do {
        if ((lVar6 < 0) || (*(int *)(param_1 + 0x638) <= iVar5)) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x630) + lVar6 * 8);
        lVar3 = 0;
        if (plVar1 != (longlong *)0x0) {
          lVar3 = *plVar1;
        }
        if ((*(longlong **)(lVar3 + 0x150) != (longlong *)0x0) &&
           (**(longlong **)(lVar3 + 0x150) != 0)) {
          if (*(int *)(param_1 + 0x638) <= iVar5) {
                    // WARNING: Subroutine does not return
            FUN_1400a2700();
          }
          plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x630) + lVar6 * 8);
          lVar3 = 0;
          if (plVar1 != (longlong *)0x0) {
            lVar3 = *plVar1;
          }
          uVar4 = 0;
          if (*(undefined8 **)(lVar3 + 0x150) != (undefined8 *)0x0) {
            uVar4 = **(undefined8 **)(lVar3 + 0x150);
          }
          uVar4 = FUN_1400a7e50(uVar4,local_60);
          FUN_140144770(param_2,*(undefined4 *)(param_2 + 0x18),uVar4,1);
        }
        iVar5 = iVar5 + 1;
        lVar6 = lVar6 + 1;
      } while (iVar5 < *(int *)(param_1 + 0x638));
    }
    FUN_1400d1290(uVar2);
    return;
  }
  FUN_1400a2320(local_50,
                L"Cannot call GetUdpListenerLocalAddrs unless ServerUdpAssignMode_Static is used!");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_140148060(longlong param_1,undefined8 *param_2,longlong *param_3)

{
  uint uVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  longlong lVar4;
  uint *puVar5;
  undefined **ppuVar6;
  undefined4 *puVar7;
  longlong lVar8;
  longlong lVar9;
  
  FUN_140143b10(param_2,param_3[1],0xffffffffffffffff);
  lVar4 = param_3[1];
  lVar9 = 0;
  if (0 < lVar4) {
    lVar8 = 0;
    do {
      if ((lVar9 < 0) || (lVar4 <= lVar9)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if ((ulonglong)param_3[2] < 0x65) {
        puVar7 = (undefined4 *)((longlong)param_3 + lVar9 * 4 + 0x20);
      }
      else {
        puVar7 = (undefined4 *)(*param_3 + lVar9 * 4);
      }
      if ((longlong)param_2[1] <= lVar9) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if ((ulonglong)param_2[2] < 0x65) {
        puVar2 = param_2 + 4;
      }
      else {
        puVar2 = (undefined8 *)*param_2;
      }
      *(undefined4 *)((longlong)puVar2 + lVar8) = *puVar7;
      if (param_3[1] <= lVar9) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if ((ulonglong)param_3[2] < 0x65) {
        puVar5 = (uint *)((longlong)param_3 + lVar9 * 4 + 0x20);
      }
      else {
        puVar5 = (uint *)(*param_3 + lVar9 * 4);
      }
      uVar1 = *puVar5;
      if (uVar1 == 1) {
        if (param_1 == 0) {
LAB_140148190:
          ppuVar6 = (undefined **)0x0;
        }
        else {
          ppuVar6 = (undefined **)(param_1 + 0x70);
        }
      }
      else {
        if (uVar1 != 0) {
          uVar3 = (ulonglong)uVar1 % (ulonglong)*(uint *)(param_1 + 0xca0);
          if ((*(longlong *)(param_1 + 0xc80) != 0) &&
             (puVar5 = *(uint **)(*(longlong *)(param_1 + 0xc80) + uVar3 * 8), puVar5 != (uint *)0x0
             )) {
            while ((uint)uVar3 == puVar5[8] % *(uint *)(param_1 + 0xca0)) {
              if (*puVar5 == uVar1) {
                ppuVar6 = *(undefined ***)(puVar5 + 2);
                if ((ppuVar6 != (undefined **)0x0) && (ppuVar6[0x45] == (undefined *)0x0))
                goto LAB_140148192;
                break;
              }
              puVar5 = *(uint **)(puVar5 + 4);
              if (puVar5 == (uint *)0x0) break;
            }
          }
          goto LAB_140148190;
        }
        ppuVar6 = &PTR_vftable_14030c240;
      }
LAB_140148192:
      if ((longlong)param_2[1] <= lVar9) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if ((ulonglong)param_2[2] < 0x65) {
        puVar2 = param_2 + 4;
      }
      else {
        puVar2 = (undefined8 *)*param_2;
      }
      *(undefined ***)((longlong)puVar2 + lVar8 + 8) = ppuVar6;
      lVar4 = param_3[1];
      lVar9 = lVar9 + 1;
      lVar8 = lVar8 + 0x20;
    } while (lVar9 < lVar4);
  }
  return;
}



// WARNING: Type propagation algorithm not settling

bool FUN_140148200(longlong *param_1,uint param_2,undefined2 *param_3)

{
  longlong lVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  uint *puVar4;
  
  uVar3 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(uVar3);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1);
  }
  uVar2 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x194);
  if ((param_1[400] != 0) && (puVar4 = *(uint **)(param_1[400] + uVar2 * 8), puVar4 != (uint *)0x0))
  {
    while ((uint)uVar2 == puVar4[8] % *(uint *)(param_1 + 0x194)) {
      if (*puVar4 == param_2) {
        lVar1 = *(longlong *)(puVar4 + 2);
        if ((lVar1 != 0) && (*(longlong *)(lVar1 + 0x228) == 0)) {
          *param_3 = *(undefined2 *)(lVar1 + 0x68a);
          *(short *)(lVar1 + 0x68a) = *(short *)(lVar1 + 0x68a) + 1;
          FUN_1400d1290(uVar3);
          return true;
        }
        break;
      }
      puVar4 = *(uint **)(puVar4 + 4);
      if (puVar4 == (uint *)0x0) break;
    }
  }
  if (param_2 != 1) {
    FUN_1400d1290(uVar3);
  }
  else {
    *param_3 = (short)param_1[0x188];
    *(short *)(param_1 + 0x188) = (short)param_1[0x188] + 1;
    FUN_1400d1290(uVar3);
  }
  return param_2 == 1;
}



void FUN_140148320(longlong *param_1,uint param_2)

{
  longlong lVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  uint *puVar4;
  
  uVar3 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(uVar3);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1);
  }
  uVar2 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x194);
  if ((param_1[400] != 0) && (puVar4 = *(uint **)(param_1[400] + uVar2 * 8), puVar4 != (uint *)0x0))
  {
    while ((uint)uVar2 == puVar4[8] % *(uint *)(param_1 + 0x194)) {
      if (*puVar4 == param_2) {
        lVar1 = *(longlong *)(puVar4 + 2);
        if ((lVar1 != 0) && (*(longlong *)(lVar1 + 0x228) == 0)) {
          *(short *)(lVar1 + 0x68a) = *(short *)(lVar1 + 0x68a) + -1;
          goto LAB_1401483ee;
        }
        break;
      }
      puVar4 = *(uint **)(puVar4 + 4);
      if (puVar4 == (uint *)0x0) break;
    }
  }
  if (param_2 == 1) {
    *(short *)(param_1 + 0x188) = (short)param_1[0x188] + -1;
  }
LAB_1401483ee:
  FUN_1400d1290(uVar3);
  return;
}



// WARNING: Type propagation algorithm not settling

bool FUN_140148410(longlong *param_1,uint param_2,undefined2 *param_3)

{
  longlong lVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  uint *puVar4;
  
  uVar3 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(uVar3);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1);
  }
  uVar2 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x194);
  if ((param_1[400] != 0) && (puVar4 = *(uint **)(param_1[400] + uVar2 * 8), puVar4 != (uint *)0x0))
  {
    while ((uint)uVar2 == puVar4[8] % *(uint *)(param_1 + 0x194)) {
      if (*puVar4 == param_2) {
        lVar1 = *(longlong *)(puVar4 + 2);
        if ((lVar1 != 0) && (*(longlong *)(lVar1 + 0x228) == 0)) {
          *param_3 = *(undefined2 *)(lVar1 + 0x68c);
          FUN_1400d1290(uVar3);
          return true;
        }
        break;
      }
      puVar4 = *(uint **)(puVar4 + 4);
      if (puVar4 == (uint *)0x0) break;
    }
  }
  if (param_2 != 1) {
    FUN_1400d1290(uVar3);
  }
  else {
    *param_3 = *(undefined2 *)((longlong)param_1 + 0xc42);
    FUN_1400d1290(uVar3);
  }
  return param_2 == 1;
}



// WARNING: Type propagation algorithm not settling

bool FUN_140148530(longlong *param_1,uint param_2)

{
  longlong lVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  uint *puVar4;
  
  uVar3 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(uVar3);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1);
  }
  uVar2 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x194);
  if ((param_1[400] != 0) && (puVar4 = *(uint **)(param_1[400] + uVar2 * 8), puVar4 != (uint *)0x0))
  {
    while ((uint)uVar2 == puVar4[8] % *(uint *)(param_1 + 0x194)) {
      if (*puVar4 == param_2) {
        lVar1 = *(longlong *)(puVar4 + 2);
        if ((lVar1 != 0) && (*(longlong *)(lVar1 + 0x228) == 0)) {
          *(short *)(lVar1 + 0x68c) = *(short *)(lVar1 + 0x68c) + 1;
          FUN_1400d1290(uVar3);
          return true;
        }
        break;
      }
      puVar4 = *(uint **)(puVar4 + 4);
      if (puVar4 == (uint *)0x0) break;
    }
  }
  if (param_2 != 1) {
    FUN_1400d1290(uVar3);
  }
  else {
    *(short *)((longlong)param_1 + 0xc42) = *(short *)((longlong)param_1 + 0xc42) + 1;
    FUN_1400d1290(uVar3);
  }
  return param_2 == 1;
}



undefined8 FUN_140148630(longlong param_1,uint param_2)

{
  ulonglong uVar1;
  undefined8 uVar2;
  uint *puVar3;
  
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_1400a1c30(uVar2);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))(param_1 + -0xa8);
  }
  uVar1 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xbf8);
  if ((*(longlong *)(param_1 + 0xbd8) != 0) &&
     (puVar3 = *(uint **)(*(longlong *)(param_1 + 0xbd8) + uVar1 * 8), puVar3 != (uint *)0x0)) {
    while ((uint)uVar1 == puVar3[8] % *(uint *)(param_1 + 0xbf8)) {
      if (*puVar3 == param_2) {
        if ((*(longlong *)(puVar3 + 2) != 0) &&
           (*(longlong *)(*(longlong *)(puVar3 + 2) + 0x228) == 0)) {
          FUN_1400d1290(uVar2);
          return 1;
        }
        break;
      }
      puVar3 = *(uint **)(puVar3 + 4);
      if (puVar3 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar2);
  return 0;
}



undefined8 FUN_140148730(longlong param_1,uint param_2,char param_3)

{
  longlong lVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  undefined1 *puVar4;
  uint *puVar5;
  undefined1 local_res10 [8];
  undefined8 uVar6;
  undefined8 uVar7;
  undefined1 uVar8;
  
  uVar6 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  uVar7 = uVar3;
  FUN_1400a1c30(uVar3);
  uVar8 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))(param_1 + -0xa8);
  }
  uVar2 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xbf8);
  if ((*(longlong *)(param_1 + 0xbd8) != 0) &&
     (puVar5 = *(uint **)(*(longlong *)(param_1 + 0xbd8) + uVar2 * 8), puVar5 != (uint *)0x0)) {
    while ((uint)uVar2 == puVar5[8] % *(uint *)(param_1 + 0xbf8)) {
      if (*puVar5 == param_2) {
        lVar1 = *(longlong *)(puVar5 + 2);
        if ((lVar1 != 0) && (*(longlong *)(lVar1 + 0x228) == 0)) {
          if (param_3 == '\0') {
            if (*(longlong *)(lVar1 + 0x750) == 0) goto LAB_1401488ae;
            if (*(void **)(lVar1 + 0x750) != (void *)0x0) {
              operator_delete(*(void **)(lVar1 + 0x750));
            }
            *(undefined8 *)(lVar1 + 0x750) = 0;
            local_res10[0] = 0;
          }
          else {
            if (*(longlong *)(lVar1 + 0x750) != 0) goto LAB_1401488ae;
            puVar4 = operator_new(0x20);
            if (puVar4 != (undefined1 *)0x0) {
              *(undefined8 *)(puVar4 + 0x18) = 0x3fe2e147ae147ae1;
              *(undefined8 *)(puVar4 + 0x10) = 0;
              *(undefined8 *)(puVar4 + 8) = 0;
              *puVar4 = 0;
            }
            *(undefined1 **)(lVar1 + 0x750) = puVar4;
            local_res10[0] = 1;
          }
          (**(code **)(*(longlong *)(param_1 + 0x400) + 0xe0))
                    ((longlong *)(param_1 + 0x400),(ulonglong)param_2,&DAT_140318cf0,local_res10,
                     uVar6,uVar7,uVar8);
LAB_1401488ae:
          FUN_1400d1290(uVar3);
          return 1;
        }
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar3);
  return 0;
}



void FUN_1401488e0(longlong param_1,uint param_2,int param_3)

{
  longlong lVar1;
  ulonglong uVar2;
  int iVar3;
  undefined8 uVar4;
  uint *puVar5;
  
  uVar4 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_1400a1c30(uVar4);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))(param_1 + -0xa8);
  }
  uVar2 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xbf8);
  if ((*(longlong *)(param_1 + 0xbd8) != 0) &&
     (puVar5 = *(uint **)(*(longlong *)(param_1 + 0xbd8) + uVar2 * 8), puVar5 != (uint *)0x0)) {
    while ((uint)uVar2 == puVar5[8] % *(uint *)(param_1 + 0xbf8)) {
      if (*puVar5 == param_2) {
        lVar1 = *(longlong *)(puVar5 + 2);
        if ((lVar1 != 0) && (*(longlong *)(lVar1 + 0x228) == 0)) {
          iVar3 = 0;
          if (0 < param_3) {
            iVar3 = param_3;
          }
          *(double *)(lVar1 + 0x1a8) = (double)iVar3;
        }
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar4);
  return;
}



undefined4 FUN_1401489f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  int *piVar2;
  undefined **local_40;
  longlong *local_38;
  int *local_30;
  undefined8 local_28;
  undefined8 local_20;
  
  local_40 = Proud::CFastArray<>::vftable;
  local_38 = (longlong *)0x0;
  local_30 = (int *)0x0;
  local_28 = 0;
  local_20 = 0;
  if ((int)param_4 != 0) {
    FUN_140021fb0(&local_40,1,param_3,param_4,0xfffffffffffffffe);
    piVar2 = local_30;
    if ((int)local_28 == 0) {
      piVar2 = (int *)0x0;
    }
    *piVar2 = (int)param_4;
  }
  uVar1 = (**(code **)(*param_1 + 0x1d0))(param_1,param_2,param_3,&local_40);
  local_40 = Proud::CFastArray<>::vftable;
  if (local_30 != (int *)0x0) {
    if (local_38 == (longlong *)0x0) {
      FUN_1400a3530(local_30);
    }
    else {
      (**(code **)(*local_38 + 0x18))(local_38,local_30);
    }
  }
  return uVar1;
}



void FUN_140148ad0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined8 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  int iVar5;
  longlong lVar6;
  undefined1 local_60 [16];
  undefined1 local_50 [72];
  
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_1400a1c30(uVar2);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
              (param_1 + -0xa8,L"Proud::CNetServerImpl::GetUdpSocketAddrList");
  }
  if (*(int *)(param_1 + 0x179c) == 1) {
    FUN_140144090(param_2,0);
    iVar5 = 0;
    lVar6 = 0;
    if (0 < *(int *)(param_1 + 0x638)) {
      do {
        if ((lVar6 < 0) || (*(int *)(param_1 + 0x638) <= iVar5)) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x630) + lVar6 * 8);
        lVar3 = 0;
        if (plVar1 != (longlong *)0x0) {
          lVar3 = *plVar1;
        }
        uVar4 = 0;
        if (*(undefined8 **)(lVar3 + 0x150) != (undefined8 *)0x0) {
          uVar4 = **(undefined8 **)(lVar3 + 0x150);
        }
        uVar4 = FUN_1400a7e50(uVar4,local_60);
        FUN_140144770(param_2,*(undefined4 *)(param_2 + 0x18),uVar4,1);
        iVar5 = iVar5 + 1;
        lVar6 = lVar6 + 1;
      } while (iVar5 < *(int *)(param_1 + 0x638));
    }
    FUN_1400d1290(uVar2);
    return;
  }
  FUN_1400a2320(local_50,
                L"Cannot call GetUdpSocketAddrList unless ServerUdpAssignMode_Static is used!");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
}



ulonglong FUN_140148c20(longlong param_1,ulonglong param_2)

{
  uint uVar1;
  ulonglong *puVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  uVar1 = *(uint *)(param_1 + 0x2a8);
  uVar4 = (param_2 & 0xffffffff) / (ulonglong)uVar1;
  uVar3 = (param_2 & 0xffffffff) % (ulonglong)uVar1;
  if (*(longlong *)(param_1 + 0x288) != 0) {
    puVar2 = *(ulonglong **)(*(longlong *)(param_1 + 0x288) + uVar3 * 8);
    uVar4 = uVar3;
    while ((puVar2 != (ulonglong *)0x0 &&
           (uVar4 = (ulonglong)(uint)puVar2[4] / (ulonglong)uVar1,
           (uint)uVar3 == (uint)puVar2[4] % uVar1))) {
      if (*puVar2 == param_2) {
        return CONCAT71((int7)(uVar4 >> 8),1);
      }
      puVar2 = (ulonglong *)puVar2[2];
    }
  }
  return uVar4 & 0xffffffffffffff00;
}



longlong FUN_140148c80(longlong param_1,uint param_2)

{
  longlong *plVar1;
  uint *puVar2;
  ulonglong uVar3;
  
  plVar1 = (longlong *)(param_1 + -0x120);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*plVar1 + 200))(plVar1);
  }
  if (param_2 == 1) {
    if (plVar1 != (longlong *)0x0) {
      return param_1 + -0xa8;
    }
  }
  else {
    uVar3 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xb80);
    if (*(longlong *)(param_1 + 0xb60) != 0) {
      puVar2 = *(uint **)(*(longlong *)(param_1 + 0xb60) + uVar3 * 8);
      while( true ) {
        if (puVar2 == (uint *)0x0) {
          return 0;
        }
        if ((uint)uVar3 != puVar2[8] % *(uint *)(param_1 + 0xb80)) {
          return 0;
        }
        if (*puVar2 == param_2) break;
        puVar2 = *(uint **)(puVar2 + 4);
      }
      if (*(longlong *)(puVar2 + 2) != 0) {
        return *(longlong *)(puVar2 + 2) + 8;
      }
    }
  }
  return 0;
}



void FUN_140148d50(void)

{
  FUN_140193eb0();
  return;
}



void FUN_140148d70(longlong *param_1)

{
  if (*param_1 != 0) {
    *(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1;
    if (*(longlong *)(*param_1 + 8) == 0) {
      FUN_1401462b0(*param_1);
    }
  }
  return;
}



longlong * FUN_140148db0(longlong *param_1,longlong *param_2,longlong param_3)

{
  longlong lVar1;
  
  if (param_3 != 0) {
    FUN_1400a3710(param_3);
    param_1[1] = (longlong)param_2;
    lVar1 = (**(code **)(*param_2 + 8))(param_2,0x10);
    *param_1 = lVar1;
    *(undefined8 *)(lVar1 + 8) = 1;
    *(longlong *)*param_1 = param_3;
    return param_1;
  }
  param_1[1] = (longlong)param_2;
  *param_1 = 0;
  return param_1;
}



void FUN_140148e30(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    FUN_1400a1c30(lVar1);
    *(longlong *)(*param_1 + 0x40) = *(longlong *)(*param_1 + 0x40) + -1;
    if (*(longlong *)(*param_1 + 0x40) == 0) {
      FUN_1400d1290(lVar1);
      FUN_140146310(*param_1);
    }
    else {
      FUN_1400d1290(lVar1);
    }
  }
  return;
}



void FUN_140148eb0(void)

{
  FUN_14019d190();
  return;
}



undefined8 FUN_140148ed0(longlong param_1,longlong param_2,undefined1 param_3)

{
  longlong lVar1;
  ulonglong uVar2;
  
  uVar2 = (ulonglong)((uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8)) %
          (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (lVar1 = *(longlong *)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (lVar1 != 0 && ((uint)uVar2 == *(uint *)(lVar1 + 0x28) % *(uint *)(param_1 + 0x28)));
        lVar1 = *(longlong *)(lVar1 + 0x18)) {
      if ((*(uint *)(lVar1 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar1 + 0xc) == *(ushort *)(param_2 + 0xc))) {
        FUN_1401461b0(param_1,lVar1,param_3);
        return 1;
      }
    }
  }
  return 0;
}



void FUN_140148f60(void)

{
  FUN_1401a4bc0();
  return;
}



void FUN_140148f80(longlong param_1,longlong *param_2)

{
  undefined8 *puVar1;
  longlong *plVar2;
  
  puVar1 = (undefined8 *)*param_2;
  plVar2 = *(longlong **)(param_1 + 8);
  *puVar1 = Proud::CFastArray<>::vftable;
  if (puVar1[2] != 0) {
    if ((longlong *)puVar1[1] == (longlong *)0x0) {
      FUN_1400a3530(puVar1[2]);
    }
    else {
      (**(code **)(*(longlong *)puVar1[1] + 0x18))();
    }
  }
  (**(code **)(*plVar2 + 0x18))(plVar2,puVar1);
                    // WARNING: Could not recover jumptable at 0x000140148ff8. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(**(longlong **)(param_1 + 8) + 0x18))(*(longlong **)(param_1 + 8),param_2);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001401490f6)
// WARNING: Removing unreachable block (ram,0x000140149104)

void FUN_140149000(ulonglong *param_1,ulonglong *param_2)

{
  longlong *plVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  uVar3 = *param_2;
  uVar4 = *param_1;
  if (uVar4 != uVar3) {
    uVar2 = uVar4;
    if (uVar3 < uVar4) {
      uVar2 = uVar3;
      uVar3 = uVar4;
    }
    if (uVar2 != 0) {
      FUN_1400a1c30(uVar2);
    }
    if (uVar3 != 0) {
      FUN_1400a1c30(uVar3);
    }
    if (*param_2 != 0) {
      plVar1 = (longlong *)(*param_2 + 0x40);
      *plVar1 = *plVar1 + 1;
    }
    uVar4 = 0;
    if (*param_1 != 0) {
      plVar1 = (longlong *)(*param_1 + 0x40);
      *plVar1 = *plVar1 + -1;
      if (*(longlong *)(*param_1 + 0x40) == 0) {
        uVar4 = *param_1;
      }
    }
    *param_1 = *param_2;
    if (uVar2 != 0) {
      FUN_1400d1290(uVar2);
    }
    if (uVar3 != 0) {
      FUN_1400d1290(uVar3);
    }
    if (uVar4 != 0) {
      FUN_140146310(uVar4);
    }
  }
  return;
}



undefined8 FUN_140149130(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_140144560(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  FUN_140193d80(param_1);
  uVar2 = FUN_140146360(param_1,param_2,param_3,param_4);
  FUN_140193d80(param_1);
  return uVar2;
}



undefined8 * FUN_1401491b0(undefined8 *param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_1400a3440();
  *param_1 = PTR_DAT_1402f8010;
  FUN_140003100(param_1,param_2);
  FUN_14003c400(param_1,param_3);
  return param_1;
}



void FUN_140149220(longlong param_1,uint param_2,uint param_3)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  uint uVar9;
  longlong *plVar11;
  longlong lVar12;
  double dVar13;
  double dVar14;
  uint local_res10;
  uint local_res18;
  ulonglong local_res20;
  ulonglong local_28;
  uint uVar10;
  
  uVar7 = (ulonglong)(int)param_3;
  local_28 = (ulonglong)(int)param_2;
  local_res10 = param_2;
  local_res18 = param_3;
  local_res20 = uVar7;
  if ((int)param_3 < (int)param_2) {
    do {
      lVar12 = (longlong)(int)uVar7;
      uVar7 = local_28;
      uVar9 = local_res10;
      while( true ) {
        plVar11 = (longlong *)(param_1 + 8 + lVar12 * 0x18);
        while( true ) {
          lVar1 = *plVar11;
          lVar2 = plVar11[-1];
          if ((*(int *)(lVar1 + 0x78) < 1) || (**(int **)(lVar1 + 0x70) != *(int *)(lVar2 + 0x6f8)))
          {
            dVar14 = *(double *)(lVar2 + 0x1b0);
          }
          else {
            dVar14 = DAT_1402f8198 + *(double *)(lVar2 + 0x1b0);
          }
          lVar2 = *(longlong *)(param_1 + local_res20 * 0x18);
          if ((*(int *)(lVar1 + 0x78) < 1) || (**(int **)(lVar1 + 0x70) != *(int *)(lVar2 + 0x6f8)))
          {
            dVar13 = *(double *)(lVar2 + 0x1b0);
          }
          else {
            dVar13 = DAT_1402f8198 + *(double *)(lVar2 + 0x1b0);
          }
          if ((dVar14 <= dVar13) || ((longlong)uVar7 <= lVar12)) break;
          lVar12 = lVar12 + 1;
          plVar11 = plVar11 + 3;
        }
        lVar1 = *(longlong *)(param_1 + local_res20 * 0x18);
        lVar2 = *(longlong *)(param_1 + 8 + local_res20 * 0x18);
        plVar11 = (longlong *)(param_1 + uVar7 * 0x18);
        do {
          uVar10 = uVar9;
          uVar8 = uVar7;
          uVar9 = uVar10 - 1;
          uVar7 = uVar8 - 1;
          plVar11 = plVar11 + -3;
          if ((*(int *)(lVar2 + 0x78) < 1) || (**(int **)(lVar2 + 0x70) != *(int *)(lVar1 + 0x6f8)))
          {
            dVar14 = *(double *)(lVar1 + 0x1b0);
          }
          else {
            dVar14 = DAT_1402f8198 + *(double *)(lVar1 + 0x1b0);
          }
          lVar3 = *plVar11;
          if ((*(int *)(lVar2 + 0x78) < 1) || (**(int **)(lVar2 + 0x70) != *(int *)(lVar3 + 0x6f8)))
          {
            dVar13 = *(double *)(lVar3 + 0x1b0);
          }
          else {
            dVar13 = DAT_1402f8198 + *(double *)(lVar3 + 0x1b0);
          }
        } while (dVar13 < dVar14);
        if ((longlong)uVar7 <= lVar12) break;
        uVar4 = *(undefined8 *)(param_1 + lVar12 * 0x18);
        uVar5 = *(undefined8 *)(param_1 + 8 + lVar12 * 0x18);
        uVar6 = *(undefined8 *)(param_1 + 0x10 + lVar12 * 0x18);
        *(undefined8 *)(param_1 + lVar12 * 0x18) = *(undefined8 *)(param_1 + uVar7 * 0x18);
        *(undefined8 *)(param_1 + 8 + lVar12 * 0x18) = *(undefined8 *)(param_1 + 8 + uVar7 * 0x18);
        *(undefined8 *)(param_1 + 0x10 + lVar12 * 0x18) =
             *(undefined8 *)(param_1 + 0x10 + uVar7 * 0x18);
        *(undefined8 *)(param_1 + uVar7 * 0x18) = uVar4;
        *(undefined8 *)(param_1 + 8 + uVar7 * 0x18) = uVar5;
        *(undefined8 *)(param_1 + 0x10 + uVar7 * 0x18) = uVar6;
      }
      uVar4 = *(undefined8 *)(param_1 + local_res20 * 0x18);
      uVar5 = *(undefined8 *)(param_1 + 8 + local_res20 * 0x18);
      uVar6 = *(undefined8 *)(param_1 + 0x10 + local_res20 * 0x18);
      *(undefined8 *)(param_1 + local_res20 * 0x18) = *(undefined8 *)(param_1 + uVar7 * 0x18);
      *(undefined8 *)(param_1 + 8 + local_res20 * 0x18) =
           *(undefined8 *)(param_1 + 8 + uVar7 * 0x18);
      *(undefined8 *)(param_1 + 0x10 + local_res20 * 0x18) =
           *(undefined8 *)(param_1 + 0x10 + uVar7 * 0x18);
      *(undefined8 *)(param_1 + uVar7 * 0x18) = uVar4;
      *(undefined8 *)(param_1 + 8 + uVar7 * 0x18) = uVar5;
      *(undefined8 *)(param_1 + 0x10 + uVar7 * 0x18) = uVar6;
      if ((int)((local_res10 - uVar9) + -1) < (int)(uVar9 - local_res18)) {
        FUN_140149220(param_1,uVar10 - 2);
        local_res18 = uVar10;
        local_res20 = uVar8;
      }
      else {
        FUN_140149220(param_1,local_res10,uVar10);
        local_res10 = uVar10 - 2;
        local_28 = uVar8 - 2;
      }
      uVar7 = (ulonglong)local_res18;
    } while ((int)local_res18 < (int)local_res10);
  }
  return;
}



void FUN_1401494b0(longlong *param_1,longlong param_2,longlong param_3)

{
  undefined8 *puVar1;
  uint uVar2;
  longlong *plVar4;
  longlong *plVar5;
  longlong *plVar3;
  
  if (0 < param_3) {
    plVar5 = (longlong *)0x0;
    param_2 = param_2 - (longlong)param_1;
    plVar3 = plVar5;
    do {
      if (param_1 != (longlong *)0x0) {
        *param_1 = 0;
        if (*(longlong *)((longlong)param_1 + param_2) != 0) {
          *(longlong *)(*(longlong *)((longlong)param_1 + param_2) + 8) =
               *(longlong *)(*(longlong *)((longlong)param_1 + param_2) + 8) + 1;
          plVar4 = plVar5;
          if ((*param_1 != 0) &&
             (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
             *(longlong *)(*param_1 + 8) == 0)) {
            plVar4 = (longlong *)*param_1;
          }
          *param_1 = *(longlong *)((longlong)param_1 + param_2);
          if (plVar4 != (longlong *)0x0) {
            puVar1 = (undefined8 *)*plVar4;
            if (puVar1 != (undefined8 *)0x0) {
              (**(code **)*puVar1)(puVar1,1);
            }
            FUN_1400a3530(plVar4);
          }
        }
      }
      uVar2 = (int)plVar3 + 1;
      plVar3 = (longlong *)(ulonglong)uVar2;
      param_1 = param_1 + 1;
    } while ((int)uVar2 < param_3);
  }
  return;
}



void FUN_140149590(longlong *param_1)

{
  undefined8 *puVar1;
  void *pvVar2;
  
  if (*param_1 != 0) {
    *(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1;
    if (*(longlong *)(*param_1 + 8) == 0) {
      puVar1 = (undefined8 *)*param_1;
      pvVar2 = (void *)*puVar1;
      if (pvVar2 != (void *)0x0) {
        FUN_1400aaa90(pvVar2);
        operator_delete(pvVar2);
      }
      FUN_1400a3530(puVar1);
    }
  }
  return;
}



void FUN_140149600(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  
  *(undefined ***)(param_1 + 200) = Proud::CFastArray<>::vftable;
  if (*(longlong *)(param_1 + 0xd8) != 0) {
    plVar1 = *(longlong **)(param_1 + 0xd0);
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar1 + 0x18))
                (plVar1,*(longlong *)(param_1 + 0xd8),plVar1,param_4,0xfffffffffffffffe);
    }
  }
  *(undefined ***)(param_1 + 0x60) = Proud::CFastArray<>::vftable;
  if (*(longlong *)(param_1 + 0x70) != 0) {
    plVar1 = *(longlong **)(param_1 + 0x68);
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,*(longlong *)(param_1 + 0x70));
    }
  }
  FUN_140148f60(param_1 + 8);
  return;
}



void FUN_140149690(_Container_base12 *param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  longlong lVar3;
  void *pvVar4;
  ulonglong uVar5;
  char *local_res8;
  undefined **local_28 [4];
  
  std::_Container_base12::_Orphan_all(param_1);
  if ((((char)*(longlong *)(param_1 + 0x20) + (char)param_1[0x18] & 3U) == 0) &&
     (*(ulonglong *)(param_1 + 0x10) <= *(longlong *)(param_1 + 0x20) + 4U >> 2)) {
    FUN_1401467d0(param_1,1);
  }
  lVar2 = *(longlong *)(param_1 + 0x18);
  lVar3 = *(longlong *)(param_1 + 0x20);
  uVar5 = (ulonglong)(lVar2 + lVar3) >> 2;
  if (*(ulonglong *)(param_1 + 0x10) <= uVar5) {
    uVar5 = uVar5 - *(ulonglong *)(param_1 + 0x10);
  }
  if (*(longlong *)(*(longlong *)(param_1 + 8) + uVar5 * 8) == 0) {
    pvVar4 = operator_new(0x10);
    if (pvVar4 == (void *)0x0) {
      local_res8 = (char *)0x0;
      std::exception::exception((exception *)local_28,&local_res8);
      local_28[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_28,(ThrowInfo *)&DAT_1402f47a8);
    }
    *(void **)(*(longlong *)(param_1 + 8) + uVar5 * 8) = pvVar4;
  }
  puVar1 = (undefined4 *)
           (*(longlong *)(*(longlong *)(param_1 + 8) + uVar5 * 8) +
           (ulonglong)((uint)(lVar2 + lVar3) & 3) * 4);
  if (puVar1 != (undefined4 *)0x0) {
    *puVar1 = *param_2;
  }
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  return;
}



undefined8 * FUN_140149780(longlong *param_1,undefined8 *param_2,longlong param_3)

{
  undefined8 *puVar1;
  longlong lVar2;
  longlong *plVar3;
  
  plVar3 = (longlong *)0x0;
  if (((longlong *)*param_1 != (longlong *)0x0) &&
     (puVar1 = *(undefined8 **)*param_1, plVar3 = (longlong *)0x0, puVar1 != (undefined8 *)0x0)) {
    plVar3 = (longlong *)*puVar1;
  }
  lVar2 = param_1[2];
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = lVar2 - param_3;
  if ((plVar3 != (longlong *)0x0) && ((undefined8 *)*plVar3 != (undefined8 *)0x0)) {
    *param_2 = *(undefined8 *)*plVar3;
  }
  return param_2;
}



void FUN_1401497d0(undefined8 param_1,undefined8 *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined8 uVar2;
  undefined *local_res10 [3];
  
  uVar2 = (**(code **)*param_2)(param_2,local_res10,param_2,param_4,0xfffffffffffffffe);
  FUN_14003c400(param_1,uVar2);
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1402f8010)) &&
     (local_res10[0] + -8 != (undefined *)0x0)) {
    uVar2 = FUN_1400a3440();
    FUN_1400a1c30(uVar2);
    piVar1 = (int *)(local_res10[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res10[0] + -8);
    }
    FUN_1400d1290(uVar2);
  }
  return;
}



undefined8 FUN_140149860(longlong *param_1,int *param_2,undefined8 param_3)

{
  int *piVar1;
  int iVar2;
  undefined *puVar3;
  undefined8 **ppuVar4;
  char cVar5;
  undefined4 uVar6;
  DWORD DVar7;
  DWORD DVar8;
  undefined **ppuVar9;
  undefined **ppuVar10;
  undefined8 uVar11;
  undefined1 uVar12;
  undefined8 ****ppppuVar13;
  int iVar14;
  undefined8 ***pppuVar15;
  undefined8 ****ppppuVar16;
  undefined8 ***local_res10 [2];
  undefined8 ***local_res20;
  undefined8 **local_358;
  undefined8 ***local_350;
  undefined **local_348;
  undefined *local_340;
  undefined8 local_338;
  undefined8 local_330;
  undefined8 local_328;
  undefined8 local_320;
  undefined *local_318;
  int local_310;
  undefined8 local_308;
  int local_300;
  undefined **local_2f8;
  undefined4 local_2f0;
  undefined2 local_2ec;
  undefined **local_2e8;
  undefined4 local_2e0;
  undefined2 local_2dc;
  undefined4 local_2d8 [2];
  undefined **local_2d0;
  undefined4 local_2c8;
  undefined2 local_2c4;
  undefined1 local_2b8 [4];
  int local_2b4;
  undefined8 local_280;
  undefined8 ***local_258;
  undefined8 **local_250;
  undefined8 ***local_248;
  undefined **local_240;
  undefined4 local_238;
  undefined2 local_234;
  undefined8 ***local_230;
  undefined8 **local_228;
  undefined8 **local_220;
  undefined8 **local_218;
  undefined4 local_210 [2];
  undefined8 **local_208;
  undefined *local_200;
  undefined8 **local_1f8;
  undefined *local_1f0;
  undefined8 **local_1e8;
  undefined8 **local_1e0;
  undefined8 **local_1d8;
  undefined8 **local_1d0;
  undefined8 **local_1c8;
  undefined8 **local_1c0;
  undefined8 **local_1b8;
  undefined4 local_1b0;
  undefined4 local_1ac;
  undefined *local_1a8;
  undefined4 local_1a0 [2];
  undefined8 **local_198;
  undefined4 local_190 [2];
  undefined8 **local_188;
  undefined4 local_180;
  undefined4 local_17c;
  undefined4 local_178 [2];
  undefined *local_170;
  undefined4 local_168 [2];
  undefined8 **local_160;
  undefined4 local_158 [2];
  undefined *local_150;
  undefined *local_148;
  undefined *local_140;
  undefined *local_138;
  undefined1 local_130 [8];
  undefined1 local_128 [8];
  undefined1 local_120 [8];
  undefined1 local_118 [8];
  undefined1 local_110 [8];
  undefined1 local_108 [8];
  undefined1 local_100 [8];
  undefined1 local_f8 [8];
  undefined1 local_f0 [8];
  undefined1 local_e8 [8];
  undefined1 local_e0 [8];
  undefined1 local_d8 [8];
  undefined1 local_d0 [8];
  undefined1 local_c8 [8];
  undefined1 local_c0 [8];
  undefined1 local_b8 [8];
  undefined1 local_b0 [8];
  undefined1 local_a8 [8];
  undefined1 local_a0 [8];
  undefined1 local_98 [8];
  undefined1 local_90 [8];
  undefined1 local_88 [8];
  undefined1 local_80 [8];
  undefined1 local_78 [8];
  undefined1 local_70 [8];
  undefined1 local_68 [8];
  undefined8 local_60;
  undefined1 local_58 [8];
  undefined1 local_50 [8];
  undefined1 local_48 [8];
  undefined1 local_40 [8];
  
  local_60 = 0xfffffffffffffffe;
  iVar2 = param_2[10];
  if (iVar2 == 0) {
    FUN_140169430(param_1,0);
  }
  iVar14 = *param_2;
  cVar5 = FUN_140185e40(param_2,local_168);
  if (cVar5 == '\0') {
switchD_1401498f3_default:
    FUN_140185160(param_2,(int)((iVar14 >> 0x1f & 7U) + iVar14) >> 3);
    uVar11 = 0;
  }
  else {
    local_280 = param_3;
    switch(local_168[0]) {
    case 0xfa01:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      cVar5 = FUN_140185490(param_2,&local_res20,4);
      if (cVar5 != '\0') {
        local_res10[0] = (undefined8 ***)CONCAT44(local_res10[0]._4_4_,local_res20._0_4_);
      }
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030ae88);
      DVar7 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa01,PTR_DAT_14030ae88,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_res20 = (undefined8 ***)PTR_DAT_1402f8010;
        FUN_1401a29e0(&local_res20,local_res10);
        FUN_14003c890(&local_res20,&DAT_14027c73c);
        iVar14 = 0;
        if (((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
           (local_res20 != (undefined8 ***)PTR_DAT_1402f8010)) {
          iVar14 = *(int *)(local_res20 + -1);
        }
        local_358 = (undefined8 **)FUN_14003c0c0(&local_res20,&local_148,iVar14 + -2);
        if ((undefined8 ****)local_res20 == (undefined8 ****)0x0) {
          local_res20 = (undefined8 ***)PTR_DAT_1402f8010;
        }
        if ((undefined8 ***)*local_358 != local_res20) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_2f8 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          pppuVar15 = local_res20;
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          if ((((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
              (local_res20 != (undefined8 ***)PTR_DAT_1402f8010)) &&
             (ppppuVar13 = (undefined8 ****)(local_res20 + -1), ppppuVar13 != (undefined8 ****)0x0))
          {
            ppuVar10 = (undefined **)FUN_1400a3440();
            local_2d0 = ppuVar10;
            FUN_1400a1c30(ppuVar10);
            local_2c8 = CONCAT31(local_2c8._1_3_,1);
            piVar1 = (int *)((longlong)pppuVar15 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(ppppuVar13);
            }
            FUN_1400d1290(ppuVar10);
          }
          local_res20 = (undefined8 ***)*local_358;
          if (((local_res20 != (undefined8 ***)PTR_DAT_1402f8010) &&
              ((undefined8 ****)local_res20 != (undefined8 ****)0x0)) &&
             ((undefined8 ****)local_res20 != (undefined8 ****)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_1400d1290(ppuVar9);
        }
        if (((local_148 != (undefined *)0x0) && (local_148 != PTR_DAT_1402f8010)) &&
           (local_148 + -8 != (undefined *)0x0)) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_2f8 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          piVar1 = (int *)(local_148 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_148 + -8);
          }
          FUN_1400d1290(ppuVar9);
        }
        local_350 = &local_230;
        local_148 = PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_230 = (undefined8 ***)PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_230 = (undefined8 ****)0x0;
        }
        if (local_res20 != (undefined8 ***)PTR_DAT_1402f8010) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_2f8 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          FUN_1400031d0(&local_230);
          local_230 = local_res20;
          if (((local_res20 != (undefined8 ***)PTR_DAT_1402f8010) &&
              ((undefined8 ****)local_res20 != (undefined8 ****)0x0)) &&
             ((undefined8 ****)local_res20 != (undefined8 ****)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_1400d1290(ppuVar9);
        }
        puVar3 = PTR_DAT_14030ae88;
        FUN_1400a3440();
        local_170 = PTR_DAT_1402f8010;
        uVar6 = FUN_1400a32c0(puVar3);
        uVar11 = FUN_140002f20(&local_170,uVar6);
        FUN_1400a32f0(uVar11,puVar3,uVar6);
        FUN_140003000(&local_170);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa01,&local_170,&local_230);
        ppppuVar13 = (undefined8 ****)local_res20;
        if ((undefined8 ****)local_res20 == (undefined8 ****)0x0) {
          ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa01,PTR_DAT_14030ae88,ppppuVar13);
        pppuVar15 = local_res20;
        if ((((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
            (local_res20 != (undefined8 ***)PTR_DAT_1402f8010)) &&
           (ppppuVar13 = (undefined8 ****)(local_res20 + -1), ppppuVar13 != (undefined8 ****)0x0)) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_2f8 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          piVar1 = (int *)((longlong)pppuVar15 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(ppppuVar13);
          }
          FUN_1400d1290(ppuVar9);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa01);
        local_318 = PTR_DAT_14030ae88;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0x38))(param_1,iVar2,local_2b8,local_res10);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030ae88);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa01);
        local_340 = PTR_DAT_14030ae88;
LAB_14014d335:
        local_338 = CONCAT44(local_338._4_4_,iVar2);
        local_330 = param_3;
        DVar8 = GetTickCount();
        local_328 = CONCAT44(local_328._4_4_,DVar8 - DVar7);
        (**(code **)(*param_1 + 0x18))(param_1,&local_348);
      }
      break;
    case 0xfa02:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_140185f20(param_2,&local_res20);
      cVar5 = FUN_140185490(param_2,&local_358,4);
      uVar6 = local_res10[0]._0_4_;
      if (cVar5 != '\0') {
        uVar6 = local_358._0_4_;
      }
      local_res10[0] = (undefined8 ***)CONCAT44(local_res10[0]._4_4_,uVar6);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030ae90);
      DVar7 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa02,PTR_DAT_14030ae90,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_358 = (undefined8 **)PTR_DAT_1402f8010;
        local_158[0] = local_res20._0_4_;
        FUN_1401a28c0(&local_358,local_158);
        FUN_14003c890(&local_358,&DAT_14027c73c);
        uVar11 = FUN_140141430((ulonglong)local_res10[0] & 0xffffffff);
        FUN_14003c890(&local_358,uVar11);
        FUN_14003c890(&local_358,&DAT_14027c73c);
        iVar14 = 0;
        if (((undefined8 ***)local_358 != (undefined8 ***)0x0) &&
           (local_358 != (undefined8 **)PTR_DAT_1402f8010)) {
          iVar14 = *(int *)(local_358 + -1);
        }
        local_2e8 = (undefined **)FUN_14003c0c0(&local_358,&local_140,iVar14 + -2);
        if ((undefined8 ***)local_358 == (undefined8 ***)0x0) {
          local_358 = (undefined8 **)PTR_DAT_1402f8010;
        }
        if ((undefined8 **)*local_2e8 != local_358) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_2f8 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          ppuVar4 = local_358;
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          if ((((undefined8 ***)local_358 != (undefined8 ***)0x0) &&
              (local_358 != (undefined8 **)PTR_DAT_1402f8010)) &&
             (pppuVar15 = (undefined8 ***)(local_358 + -1), pppuVar15 != (undefined8 ***)0x0)) {
            ppuVar10 = (undefined **)FUN_1400a3440();
            local_2d0 = ppuVar10;
            FUN_1400a1c30(ppuVar10);
            local_2c8 = CONCAT31(local_2c8._1_3_,1);
            piVar1 = (int *)((longlong)ppuVar4 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(pppuVar15);
            }
            FUN_1400d1290(ppuVar10);
          }
          local_358 = (undefined8 **)*local_2e8;
          if (((local_358 != (undefined8 **)PTR_DAT_1402f8010) &&
              ((undefined8 ***)local_358 != (undefined8 ***)0x0)) &&
             ((undefined8 ***)local_358 != (undefined8 ***)0x8)) {
            *(int *)((longlong)local_358 + -4) = *(int *)((longlong)local_358 + -4) + 1;
          }
          FUN_1400d1290(ppuVar9);
        }
        if (((local_140 != (undefined *)0x0) && (local_140 != PTR_DAT_1402f8010)) &&
           (local_140 + -8 != (undefined *)0x0)) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_2f8 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          piVar1 = (int *)(local_140 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_140 + -8);
          }
          FUN_1400d1290(ppuVar9);
        }
        local_350 = &local_250;
        local_140 = PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_250 = (undefined8 **)PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_250 = (undefined8 ***)0x0;
        }
        if (local_358 != (undefined8 **)PTR_DAT_1402f8010) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_2f8 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          FUN_1400031d0(&local_250);
          local_250 = local_358;
          if (((local_358 != (undefined8 **)PTR_DAT_1402f8010) &&
              ((undefined8 ***)local_358 != (undefined8 ***)0x0)) &&
             ((undefined8 ***)local_358 != (undefined8 ***)0x8)) {
            *(int *)((longlong)local_358 + -4) = *(int *)((longlong)local_358 + -4) + 1;
          }
          FUN_1400d1290(ppuVar9);
        }
        puVar3 = PTR_DAT_14030ae90;
        FUN_1400a3440();
        local_200 = PTR_DAT_1402f8010;
        uVar6 = FUN_1400a32c0(puVar3);
        uVar11 = FUN_140002f20(&local_200,uVar6);
        FUN_1400a32f0(uVar11,puVar3,uVar6);
        FUN_140003000(&local_200);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa02,&local_200,&local_250);
        pppuVar15 = (undefined8 ***)local_358;
        if ((undefined8 ***)local_358 == (undefined8 ***)0x0) {
          pppuVar15 = (undefined8 ***)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa02,PTR_DAT_14030ae90,pppuVar15);
        ppuVar4 = local_358;
        if ((((undefined8 ***)local_358 != (undefined8 ***)0x0) &&
            (local_358 != (undefined8 **)PTR_DAT_1402f8010)) &&
           (pppuVar15 = (undefined8 ***)(local_358 + -1), pppuVar15 != (undefined8 ***)0x0)) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_2f8 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          piVar1 = (int *)((longlong)ppuVar4 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(pppuVar15);
          }
          FUN_1400d1290(ppuVar9);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa02);
        local_318 = PTR_DAT_14030ae90;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0x40))(param_1,iVar2,local_2b8,&local_res20,local_res10);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030ae90);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa02);
        local_340 = PTR_DAT_14030ae90;
        goto LAB_14014d335;
      }
      break;
    case 0xfa03:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030ae98);
      DVar7 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa03,PTR_DAT_14030ae98,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
        local_res10[0] = (undefined8 ***)PTR_DAT_1402f8010;
        local_res20 = (undefined8 ***)FUN_14003c0c0(local_res10,&local_150,0xfffffffe);
        if (ppppuVar13 == (undefined8 ****)0x0) {
          ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
        }
        local_res10[0] = ppppuVar13;
        if ((undefined8 ****)*local_res20 != ppppuVar13) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_2f8 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          if (((ppppuVar13 != (undefined8 ****)0x0) &&
              (ppppuVar13 != (undefined8 ****)PTR_DAT_1402f8010)) &&
             (ppppuVar13 + -1 != (undefined8 ****)0x0)) {
            ppuVar10 = (undefined **)FUN_1400a3440();
            local_2d0 = ppuVar10;
            FUN_1400a1c30(ppuVar10);
            local_2c8 = CONCAT31(local_2c8._1_3_,1);
            piVar1 = (int *)((longlong)ppppuVar13 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(ppppuVar13 + -1);
            }
            FUN_1400d1290(ppuVar10);
          }
          ppppuVar13 = (undefined8 ****)*local_res20;
          if (((ppppuVar13 != (undefined8 ****)PTR_DAT_1402f8010) &&
              (ppppuVar13 != (undefined8 ****)0x0)) && (ppppuVar13 != (undefined8 ****)0x8)) {
            *(int *)((longlong)ppppuVar13 + -4) = *(int *)((longlong)ppppuVar13 + -4) + 1;
          }
          local_res10[0] = ppppuVar13;
          FUN_1400d1290(ppuVar9);
        }
        if (((local_150 != (undefined *)0x0) && (local_150 != PTR_DAT_1402f8010)) &&
           (local_150 + -8 != (undefined *)0x0)) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_2f8 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          piVar1 = (int *)(local_150 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_150 + -8);
          }
          FUN_1400d1290(ppuVar9);
        }
        local_res20 = &local_248;
        local_150 = PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_248 = (undefined8 ***)PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_248 = (undefined8 ****)0x0;
        }
        if (ppppuVar13 != (undefined8 ****)PTR_DAT_1402f8010) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_2f8 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          FUN_1400031d0(&local_248);
          if (((ppppuVar13 != (undefined8 ****)PTR_DAT_1402f8010) &&
              (ppppuVar13 != (undefined8 ****)0x0)) && (ppppuVar13 != (undefined8 ****)0x8)) {
            *(int *)((longlong)ppppuVar13 + -4) = *(int *)((longlong)ppppuVar13 + -4) + 1;
          }
          local_248 = ppppuVar13;
          FUN_1400d1290(ppuVar9);
        }
        puVar3 = PTR_DAT_14030ae98;
        FUN_1400a3440();
        local_1a8 = PTR_DAT_1402f8010;
        uVar6 = FUN_1400a32c0(puVar3);
        uVar11 = FUN_140002f20(&local_1a8,uVar6);
        FUN_1400a32f0(uVar11,puVar3,uVar6);
        FUN_140003000(&local_1a8);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa03,&local_1a8,&local_248);
        ppppuVar16 = ppppuVar13;
        if (ppppuVar13 == (undefined8 ****)0x0) {
          ppppuVar16 = (undefined8 ****)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa03,PTR_DAT_14030ae98,ppppuVar16);
        if (((ppppuVar13 != (undefined8 ****)0x0) &&
            (ppppuVar13 != (undefined8 ****)PTR_DAT_1402f8010)) &&
           (ppppuVar13 + -1 != (undefined8 ****)0x0)) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_2f8 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          piVar1 = (int *)((longlong)ppppuVar13 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(ppppuVar13 + -1);
          }
          FUN_1400d1290(ppuVar9);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa03);
        local_318 = PTR_DAT_14030ae98;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0x48))(param_1,iVar2,local_2b8);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030ae98);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa03);
        local_340 = PTR_DAT_14030ae98;
        goto LAB_14014d335;
      }
      break;
    case 0xfa04:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_140185f20(param_2,&local_358);
      FUN_140185f20(param_2,&local_2e8);
      cVar5 = FUN_140185490(param_2,&local_res20,4);
      if (cVar5 != '\0') {
        local_2d8[0] = local_res20._0_4_;
      }
      cVar5 = FUN_140185490(param_2,&local_res20,1);
      uVar12 = (byte)local_res10[0];
      if (cVar5 != '\0') {
        uVar12 = local_res20._0_1_;
      }
      local_res10[0] = (undefined8 ***)CONCAT71(local_res10[0]._1_7_,uVar12);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030aea0);
      DVar7 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa04,PTR_DAT_14030aea0,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_res20 = (undefined8 ***)PTR_DAT_1402f8010;
        local_1b0 = local_358._0_4_;
        FUN_1401a28c0(&local_res20,&local_1b0);
        FUN_14003c890(&local_res20,&DAT_14027c73c);
        local_210[0] = local_2e8._0_4_;
        FUN_1401a28c0(&local_res20,local_210);
        FUN_14003c890(&local_res20,&DAT_14027c73c);
        FUN_1401a2920(&local_res20,local_2d8);
        FUN_14003c890(&local_res20,&DAT_14027c73c);
        FUN_1401a2720(&local_res20,local_res10);
        FUN_14003c890(&local_res20,&DAT_14027c73c);
        iVar14 = 0;
        if (((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
           (local_res20 != (undefined8 ***)PTR_DAT_1402f8010)) {
          iVar14 = *(int *)(local_res20 + -1);
        }
        local_350 = (undefined8 ***)FUN_14003c0c0(&local_res20,&local_138,iVar14 + -2);
        if ((undefined8 ****)local_res20 == (undefined8 ****)0x0) {
          local_res20 = (undefined8 ***)PTR_DAT_1402f8010;
        }
        if ((undefined8 ***)*local_350 != local_res20) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_2f8 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          pppuVar15 = local_res20;
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          if ((((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
              (local_res20 != (undefined8 ***)PTR_DAT_1402f8010)) &&
             (ppppuVar13 = (undefined8 ****)(local_res20 + -1), ppppuVar13 != (undefined8 ****)0x0))
          {
            ppuVar10 = (undefined **)FUN_1400a3440();
            local_2d0 = ppuVar10;
            FUN_1400a1c30(ppuVar10);
            local_2c8 = CONCAT31(local_2c8._1_3_,1);
            piVar1 = (int *)((longlong)pppuVar15 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(ppppuVar13);
            }
            FUN_1400d1290(ppuVar10);
          }
          local_res20 = (undefined8 ***)*local_350;
          if (((local_res20 != (undefined8 ***)PTR_DAT_1402f8010) &&
              ((undefined8 ****)local_res20 != (undefined8 ****)0x0)) &&
             ((undefined8 ****)local_res20 != (undefined8 ****)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_1400d1290(ppuVar9);
        }
        if (((local_138 != (undefined *)0x0) && (local_138 != PTR_DAT_1402f8010)) &&
           (local_138 + -8 != (undefined *)0x0)) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_2f8 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          piVar1 = (int *)(local_138 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_138 + -8);
          }
          FUN_1400d1290(ppuVar9);
        }
        local_350 = &local_258;
        local_138 = PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_258 = (undefined8 ***)PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_258 = (undefined8 ****)0x0;
        }
        if (local_res20 != (undefined8 ***)PTR_DAT_1402f8010) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_2f8 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          FUN_1400031d0(&local_258);
          local_258 = local_res20;
          if (((local_res20 != (undefined8 ***)PTR_DAT_1402f8010) &&
              ((undefined8 ****)local_res20 != (undefined8 ****)0x0)) &&
             ((undefined8 ****)local_res20 != (undefined8 ****)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_1400d1290(ppuVar9);
        }
        puVar3 = PTR_DAT_14030aea0;
        FUN_1400a3440();
        local_1f0 = PTR_DAT_1402f8010;
        uVar6 = FUN_1400a32c0(puVar3);
        uVar11 = FUN_140002f20(&local_1f0,uVar6);
        FUN_1400a32f0(uVar11,puVar3,uVar6);
        FUN_140003000(&local_1f0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa04,&local_1f0,&local_258);
        ppppuVar13 = (undefined8 ****)local_res20;
        if ((undefined8 ****)local_res20 == (undefined8 ****)0x0) {
          ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa04,PTR_DAT_14030aea0,ppppuVar13);
        pppuVar15 = local_res20;
        if ((((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
            (local_res20 != (undefined8 ***)PTR_DAT_1402f8010)) &&
           (ppppuVar13 = (undefined8 ****)(local_res20 + -1), ppppuVar13 != (undefined8 ****)0x0)) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_2f8 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          piVar1 = (int *)((longlong)pppuVar15 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(ppppuVar13);
          }
          FUN_1400d1290(ppuVar9);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa04);
        local_318 = PTR_DAT_14030aea0;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0x50))
                        (param_1,iVar2,local_2b8,&local_358,&local_2e8,local_2d8,local_res10);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030aea0);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa04);
        local_340 = PTR_DAT_14030aea0;
        goto LAB_14014d335;
      }
      break;
    case 0xfa05:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_140185f20(param_2,&local_358);
      FUN_140185f20(param_2,&local_res20);
      local_2f8 = Proud::AddrPort::vftable;
      DVar7 = 0;
      local_2f0 = 0;
      local_2ec = 0;
      cVar5 = FUN_140185490(param_2,local_res10,4);
      if (cVar5 != '\0') {
        local_2f0 = local_res10[0]._0_4_;
      }
      cVar5 = FUN_140185490(param_2,local_res10,2);
      if (cVar5 != '\0') {
        local_2ec = local_res10[0]._0_2_;
      }
      local_2d0 = Proud::AddrPort::vftable;
      local_2c8 = 0;
      local_2c4 = 0;
      cVar5 = FUN_140185490(param_2,local_res10,4);
      if (cVar5 != '\0') {
        local_2c8 = local_res10[0]._0_4_;
      }
      cVar5 = FUN_140185490(param_2,local_res10,2);
      if (cVar5 != '\0') {
        local_2c4 = local_res10[0]._0_2_;
      }
      local_240 = Proud::AddrPort::vftable;
      local_238 = 0;
      local_234 = 0;
      cVar5 = FUN_140185490(param_2,local_res10,4);
      if (cVar5 != '\0') {
        local_238 = local_res10[0]._0_4_;
      }
      cVar5 = FUN_140185490(param_2,local_res10,2);
      if (cVar5 != '\0') {
        local_234 = local_res10[0]._0_2_;
      }
      local_2e8 = Proud::AddrPort::vftable;
      local_2e0 = 0;
      local_2dc = 0;
      cVar5 = FUN_140185490(param_2,local_res10,4);
      if (cVar5 != '\0') {
        local_2e0 = local_res10[0]._0_4_;
      }
      cVar5 = FUN_140185490(param_2,local_res10,2);
      if (cVar5 != '\0') {
        local_2dc = local_res10[0]._0_2_;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030aea8);
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa05,PTR_DAT_14030aea8,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_res10[0] = (undefined8 ***)PTR_DAT_1402f8010;
        local_17c = local_358._0_4_;
        FUN_1401a28c0(local_res10,&local_17c);
        FUN_14003c890(local_res10,&DAT_14027c73c);
        local_1ac = local_res20._0_4_;
        FUN_1401a28c0(local_res10,&local_1ac);
        FUN_14003c890(local_res10,&DAT_14027c73c);
        uVar11 = (*(code *)*local_2f8)(&local_2f8,&local_350);
        FUN_14003c400(local_res10,uVar11);
        pppuVar15 = local_350;
        if ((((undefined8 ****)local_350 != (undefined8 ****)0x0) &&
            (local_350 != (undefined8 ***)PTR_DAT_1402f8010)) &&
           (ppppuVar13 = (undefined8 ****)(local_350 + -1), ppppuVar13 != (undefined8 ****)0x0)) {
          uVar11 = FUN_1400a3440();
          local_320 = uVar11;
          FUN_1400a1c30(uVar11);
          local_318 = (undefined *)CONCAT71(local_318._1_7_,1);
          piVar1 = (int *)((longlong)pppuVar15 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(ppppuVar13);
          }
          FUN_1400d1290(uVar11);
        }
        FUN_14003c890(local_res10,&DAT_14027c73c);
        uVar11 = (*(code *)*local_2d0)(&local_2d0,&local_350);
        FUN_14003c400(local_res10,uVar11);
        pppuVar15 = local_350;
        if ((((undefined8 ****)local_350 != (undefined8 ****)0x0) &&
            (local_350 != (undefined8 ***)PTR_DAT_1402f8010)) &&
           (ppppuVar13 = (undefined8 ****)(local_350 + -1), ppppuVar13 != (undefined8 ****)0x0)) {
          uVar11 = FUN_1400a3440();
          local_320 = uVar11;
          FUN_1400a1c30(uVar11);
          local_318 = (undefined *)CONCAT71(local_318._1_7_,1);
          piVar1 = (int *)((longlong)pppuVar15 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(ppppuVar13);
          }
          FUN_1400d1290(uVar11);
        }
        FUN_14003c890(local_res10,&DAT_14027c73c);
        uVar11 = (*(code *)*local_240)(&local_240,&local_350);
        FUN_14003c400(local_res10,uVar11);
        pppuVar15 = local_350;
        if ((((undefined8 ****)local_350 != (undefined8 ****)0x0) &&
            (local_350 != (undefined8 ***)PTR_DAT_1402f8010)) &&
           (ppppuVar13 = (undefined8 ****)(local_350 + -1), ppppuVar13 != (undefined8 ****)0x0)) {
          uVar11 = FUN_1400a3440();
          local_320 = uVar11;
          FUN_1400a1c30(uVar11);
          local_318 = (undefined *)CONCAT71(local_318._1_7_,1);
          piVar1 = (int *)((longlong)pppuVar15 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(ppppuVar13);
          }
          FUN_1400d1290(uVar11);
        }
        FUN_14003c890(local_res10,&DAT_14027c73c);
        uVar11 = (*(code *)*local_2e8)(&local_2e8,&local_350);
        FUN_14003c400(local_res10,uVar11);
        if ((((undefined8 ****)local_350 != (undefined8 ****)0x0) &&
            (local_350 != (undefined8 ***)PTR_DAT_1402f8010)) &&
           ((undefined8 ****)(local_350 + -1) != (undefined8 ****)0x0)) {
          uVar11 = FUN_1400a3440();
          local_320 = uVar11;
          FUN_1400a1c30(uVar11);
          local_318 = (undefined *)CONCAT71(local_318._1_7_,1);
          piVar1 = (int *)((longlong)local_350 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_350 + -1);
          }
          FUN_1400d1290(uVar11);
        }
        FUN_14003c890(local_res10,&DAT_14027c73c);
        iVar14 = 0;
        if (((undefined8 ****)local_res10[0] != (undefined8 ****)0x0) &&
           (local_res10[0] != (undefined8 ***)PTR_DAT_1402f8010)) {
          iVar14 = *(int *)(local_res10[0] + -1);
        }
        uVar11 = FUN_14003c0c0(local_res10,local_d0,iVar14 + -2);
        FUN_140003100(local_res10,uVar11);
        FUN_1400031d0(local_d0);
        local_350 = &local_228;
        FUN_1400a3440();
        local_228 = (undefined8 **)PTR_DAT_1402f8010;
        FUN_140003100(&local_228,local_res10);
        uVar11 = FUN_140003080(local_90,PTR_DAT_14030aea8,0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa05,uVar11,&local_228);
        ppppuVar13 = (undefined8 ****)local_res10[0];
        if ((undefined8 ****)local_res10[0] == (undefined8 ****)0x0) {
          ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa05,PTR_DAT_14030aea8,ppppuVar13);
        FUN_1400031d0(local_res10);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa05);
        local_318 = PTR_DAT_14030aea8;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0x58))
                        (param_1,iVar2,local_2b8,&local_358,&local_res20,&local_2f8,&local_2d0,
                         &local_240,&local_2e8);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030aea8);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa05);
        local_340 = PTR_DAT_14030aea8;
        goto LAB_14014d335;
      }
      break;
    case 0xfa06:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      DVar8 = 0;
      DVar7 = 0;
      local_340 = (undefined *)0x0;
      local_338 = 0;
      local_330 = 0;
      local_328 = 0;
      local_348 = Proud::ByteArray::vftable;
      FUN_140145730(param_2,&local_348);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030aeb0);
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa06,PTR_DAT_14030aeb0,&DAT_14027d1a0);
          goto LAB_14014b207;
        }
      }
      else {
        DVar7 = DVar8;
        if ((char)param_1[3] == '\0') {
          FUN_1400a3440();
          local_res10[0] = (undefined8 ***)PTR_DAT_1402f8010;
          FUN_1401a2bc0(local_res10,&local_348);
          FUN_14003c890(local_res10,&DAT_14027c73c);
          iVar14 = 0;
          if (((undefined8 ****)local_res10[0] != (undefined8 ****)0x0) &&
             (local_res10[0] != (undefined8 ***)PTR_DAT_1402f8010)) {
            iVar14 = *(int *)(local_res10[0] + -1);
          }
          uVar11 = FUN_14003c0c0(local_res10,local_c0,iVar14 + -2);
          FUN_140003100(local_res10,uVar11);
          FUN_1400031d0(local_c0);
          local_res20 = &local_1e0;
          FUN_1400a3440();
          local_1e0 = (undefined8 **)PTR_DAT_1402f8010;
          FUN_140003100(&local_1e0,local_res10);
          uVar11 = FUN_140003080(local_80,PTR_DAT_14030aeb0,0);
          (**(code **)(*param_1 + 0x28))(param_1,0xfa06,uVar11,&local_1e0);
          ppppuVar13 = (undefined8 ****)local_res10[0];
          if ((undefined8 ****)local_res10[0] == (undefined8 ****)0x0) {
            ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
          }
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa06,PTR_DAT_14030aeb0,ppppuVar13);
          FUN_1400031d0(local_res10);
LAB_14014b207:
          DVar7 = DVar8;
          if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
            local_320 = CONCAT44(local_320._4_4_,0xfa06);
            local_318 = PTR_DAT_14030aeb0;
            local_310 = iVar2;
            local_308 = param_3;
            (**(code **)(*param_1 + 0x20))(param_1,&local_320);
            DVar7 = GetTickCount();
          }
        }
      }
      cVar5 = (**(code **)(*param_1 + 0x60))(param_1,iVar2,local_2b8,&local_348);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030aeb0);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa06);
        local_318 = PTR_DAT_14030aeb0;
        local_310 = iVar2;
        local_308 = param_3;
        DVar8 = GetTickCount();
        local_300 = DVar8 - DVar7;
        (**(code **)(*param_1 + 0x18))(param_1,&local_320);
      }
      FUN_140140df0(&local_348);
      break;
    case 0xfa07:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030aeb8);
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa07,PTR_DAT_14030aeb8,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_res10[0] = (undefined8 ***)PTR_DAT_1402f8010;
        uVar11 = FUN_14003c0c0(local_res10,local_c8,0xfffffffe);
        FUN_140003100(local_res10,uVar11);
        FUN_1400031d0(local_c8);
        local_res20 = &local_198;
        FUN_1400a3440();
        local_198 = (undefined8 **)PTR_DAT_1402f8010;
        FUN_140003100(&local_198,local_res10);
        uVar11 = FUN_140003080(local_70,PTR_DAT_14030aeb8,0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa07,uVar11,&local_198);
        ppppuVar13 = (undefined8 ****)local_res10[0];
        if ((undefined8 ****)local_res10[0] == (undefined8 ****)0x0) {
          ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa07,PTR_DAT_14030aeb8,ppppuVar13);
        FUN_1400031d0(local_res10);
      }
      DVar7 = 0;
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa07);
        local_318 = PTR_DAT_14030aeb8;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0x68))(param_1,iVar2,local_2b8);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030aeb8);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa07);
        local_340 = PTR_DAT_14030aeb8;
        goto LAB_14014d335;
      }
      break;
    case 0xfa08:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_140185490(param_2,local_res10,1);
      local_res20 = (undefined8 ***)CONCAT44(local_res20._4_4_,(uint)(byte)local_res10[0]);
      FUN_1400a3440();
      local_358 = (undefined8 **)PTR_DAT_1402f8010;
      thunk_FUN_1401865d0(param_2,&local_358);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030aec0);
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa08,PTR_DAT_14030aec0,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_res10[0] = (undefined8 ***)PTR_DAT_1402f8010;
        uVar11 = FUN_1401a24e0((ulonglong)local_res20 & 0xffffffff);
        FUN_14003c890(local_res10,uVar11);
        FUN_14003c890(local_res10,&DAT_14027c73c);
        FUN_1401a2b80(local_res10,&local_358);
        FUN_14003c890(local_res10,&DAT_14027c73c);
        iVar14 = 0;
        if (((undefined8 ****)local_res10[0] != (undefined8 ****)0x0) &&
           (local_res10[0] != (undefined8 ***)PTR_DAT_1402f8010)) {
          iVar14 = *(int *)(local_res10[0] + -1);
        }
        uVar11 = FUN_14003c0c0(local_res10,local_110,iVar14 + -2);
        FUN_140003100(local_res10,uVar11);
        FUN_1400031d0(local_110);
        local_350 = &local_1d0;
        FUN_1400a3440();
        local_1d0 = (undefined8 **)PTR_DAT_1402f8010;
        FUN_140003100(&local_1d0,local_res10);
        uVar11 = FUN_140003080(local_b8,PTR_DAT_14030aec0,0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa08,uVar11,&local_1d0);
        ppppuVar13 = (undefined8 ****)local_res10[0];
        if ((undefined8 ****)local_res10[0] == (undefined8 ****)0x0) {
          ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa08,PTR_DAT_14030aec0,ppppuVar13);
        FUN_1400031d0(local_res10);
      }
      DVar7 = 0;
      if (((char)param_1[3] == '\0') && (DVar7 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa08);
        local_318 = PTR_DAT_14030aec0;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0x70))(param_1,iVar2,local_2b8,&local_res20,&local_358);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030aec0);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa08);
        local_340 = PTR_DAT_14030aec0;
        local_338 = CONCAT44(local_338._4_4_,iVar2);
        local_330 = param_3;
        DVar8 = GetTickCount();
        local_328 = CONCAT44(local_328._4_4_,DVar8 - DVar7);
        (**(code **)(*param_1 + 0x18))(param_1,&local_348);
      }
      FUN_1400031d0(&local_358);
      break;
    case 0xfa09:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      cVar5 = FUN_140185490(param_2,&local_res20,4);
      uVar6 = local_res10[0]._0_4_;
      if (cVar5 != '\0') {
        uVar6 = local_res20._0_4_;
      }
      local_res10[0] = (undefined8 ***)CONCAT44(local_res10[0]._4_4_,uVar6);
      FUN_1400a3440();
      local_358 = (undefined8 **)PTR_DAT_1402f8010;
      thunk_FUN_1401865d0(param_2,&local_358);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030aec8);
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa09,PTR_DAT_14030aec8,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_res20 = (undefined8 ***)PTR_DAT_1402f8010;
        FUN_1401a28c0(&local_res20,local_res10);
        FUN_14003c890(&local_res20,&DAT_14027c73c);
        FUN_1401a2b80(&local_res20,&local_358);
        FUN_14003c890(&local_res20,&DAT_14027c73c);
        iVar14 = 0;
        if (((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
           (local_res20 != (undefined8 ***)PTR_DAT_1402f8010)) {
          iVar14 = *(int *)(local_res20 + -1);
        }
        uVar11 = FUN_14003c0c0(&local_res20,local_100,iVar14 + -2);
        FUN_140003100(&local_res20,uVar11);
        FUN_1400031d0(local_100);
        local_350 = &local_160;
        FUN_1400a3440();
        local_160 = (undefined8 **)PTR_DAT_1402f8010;
        FUN_140003100(&local_160,&local_res20);
        uVar11 = FUN_140003080(local_50,PTR_DAT_14030aec8,0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa09,uVar11,&local_160);
        ppppuVar13 = (undefined8 ****)local_res20;
        if ((undefined8 ****)local_res20 == (undefined8 ****)0x0) {
          ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa09,PTR_DAT_14030aec8,ppppuVar13);
        FUN_1400031d0(&local_res20);
      }
      DVar7 = 0;
      if (((char)param_1[3] == '\0') && (DVar7 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa09);
        local_318 = PTR_DAT_14030aec8;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0x78))(param_1,iVar2,local_2b8,local_res10,&local_358);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030aec8);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa09);
        local_340 = PTR_DAT_14030aec8;
        local_338 = CONCAT44(local_338._4_4_,iVar2);
        local_330 = param_3;
        DVar8 = GetTickCount();
        local_328 = CONCAT44(local_328._4_4_,DVar8 - DVar7);
        (**(code **)(*param_1 + 0x18))(param_1,&local_348);
      }
      FUN_1400031d0(&local_358);
      break;
    case 0xfa0a:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_1400a3440();
      local_res20 = (undefined8 ***)PTR_DAT_1402f8010;
      thunk_FUN_1401865d0(param_2,&local_res20);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030aed0);
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa0a,PTR_DAT_14030aed0,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_res10[0] = (undefined8 ***)PTR_DAT_1402f8010;
        FUN_1401a2b80(local_res10,&local_res20);
        FUN_14003c890(local_res10,&DAT_14027c73c);
        iVar14 = 0;
        if (((undefined8 ****)local_res10[0] != (undefined8 ****)0x0) &&
           (local_res10[0] != (undefined8 ***)PTR_DAT_1402f8010)) {
          iVar14 = *(int *)(local_res10[0] + -1);
        }
        uVar11 = FUN_14003c0c0(local_res10,local_f0,iVar14 + -2);
        FUN_140003100(local_res10,uVar11);
        FUN_1400031d0(local_f0);
        local_350 = &local_1c0;
        FUN_1400a3440();
        local_1c0 = (undefined8 **)PTR_DAT_1402f8010;
        FUN_140003100(&local_1c0,local_res10);
        uVar11 = FUN_140003080(local_40,PTR_DAT_14030aed0,0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa0a,uVar11,&local_1c0);
        ppppuVar13 = (undefined8 ****)local_res10[0];
        if ((undefined8 ****)local_res10[0] == (undefined8 ****)0x0) {
          ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa0a,PTR_DAT_14030aed0,ppppuVar13);
        FUN_1400031d0(local_res10);
      }
      DVar7 = 0;
      if (((char)param_1[3] == '\0') && (DVar7 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa0a);
        local_318 = PTR_DAT_14030aed0;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0x80))(param_1,iVar2,local_2b8,&local_res20);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030aed0);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa0a);
        local_340 = PTR_DAT_14030aed0;
        local_338 = CONCAT44(local_338._4_4_,iVar2);
        local_330 = param_3;
        DVar8 = GetTickCount();
        local_328 = CONCAT44(local_328._4_4_,DVar8 - DVar7);
        (**(code **)(*param_1 + 0x18))(param_1,&local_348);
      }
      FUN_1400031d0(&local_res20);
      break;
    case 0xfa0b:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_140185f20(param_2,local_res10);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030aed8);
      DVar7 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa0b,PTR_DAT_14030aed8,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_res20 = (undefined8 ***)PTR_DAT_1402f8010;
        local_1a0[0] = local_res10[0]._0_4_;
        FUN_1401a28c0(&local_res20,local_1a0);
        FUN_14003c890(&local_res20,&DAT_14027c73c);
        iVar14 = 0;
        if (((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
           (local_res20 != (undefined8 ***)PTR_DAT_1402f8010)) {
          iVar14 = *(int *)(local_res20 + -1);
        }
        uVar11 = FUN_14003c0c0(&local_res20,local_e0,iVar14 + -2);
        FUN_140003100(&local_res20,uVar11);
        FUN_1400031d0(local_e0);
        local_350 = &local_188;
        FUN_1400a3440();
        local_188 = (undefined8 **)PTR_DAT_1402f8010;
        FUN_140003100(&local_188,&local_res20);
        uVar11 = FUN_140003080(local_a8,PTR_DAT_14030aed8,0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa0b,uVar11,&local_188);
        ppppuVar13 = (undefined8 ****)local_res20;
        if ((undefined8 ****)local_res20 == (undefined8 ****)0x0) {
          ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa0b,PTR_DAT_14030aed8,ppppuVar13);
        FUN_1400031d0(&local_res20);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa0b);
        local_318 = PTR_DAT_14030aed8;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0x88))(param_1,iVar2,local_2b8,local_res10);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030aed8);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa0b);
        local_340 = PTR_DAT_14030aed8;
        goto LAB_14014d335;
      }
      break;
    case 0xfa0c:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_140185f20(param_2,local_res10);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030aee0);
      DVar7 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa0c,PTR_DAT_14030aee0,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_res20 = (undefined8 ***)PTR_DAT_1402f8010;
        local_190[0] = local_res10[0]._0_4_;
        FUN_1401a28c0(&local_res20,local_190);
        FUN_14003c890(&local_res20,&DAT_14027c73c);
        iVar14 = 0;
        if (((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
           (local_res20 != (undefined8 ***)PTR_DAT_1402f8010)) {
          iVar14 = *(int *)(local_res20 + -1);
        }
        uVar11 = FUN_14003c0c0(&local_res20,local_d8,iVar14 + -2);
        FUN_140003100(&local_res20,uVar11);
        FUN_1400031d0(local_d8);
        local_350 = &local_220;
        FUN_1400a3440();
        local_220 = (undefined8 **)PTR_DAT_1402f8010;
        FUN_140003100(&local_220,&local_res20);
        uVar11 = FUN_140003080(local_58,PTR_DAT_14030aee0,0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa0c,uVar11,&local_220);
        ppppuVar13 = (undefined8 ****)local_res20;
        if ((undefined8 ****)local_res20 == (undefined8 ****)0x0) {
          ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa0c,PTR_DAT_14030aee0,ppppuVar13);
        FUN_1400031d0(&local_res20);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa0c);
        local_318 = PTR_DAT_14030aee0;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0x90))(param_1,iVar2,local_2b8,local_res10);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030aee0);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa0c);
        local_340 = PTR_DAT_14030aee0;
        goto LAB_14014d335;
      }
      break;
    case 0xfa0d:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_1400a3440();
      local_res20 = (undefined8 ***)PTR_DAT_1402f8010;
      thunk_FUN_1401865d0(param_2,&local_res20);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030aee8);
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa0d,PTR_DAT_14030aee8,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_res10[0] = (undefined8 ***)PTR_DAT_1402f8010;
        FUN_1401a2b80(local_res10,&local_res20);
        FUN_14003c890(local_res10,&DAT_14027c73c);
        iVar14 = 0;
        if (((undefined8 ****)local_res10[0] != (undefined8 ****)0x0) &&
           (local_res10[0] != (undefined8 ***)PTR_DAT_1402f8010)) {
          iVar14 = *(int *)(local_res10[0] + -1);
        }
        uVar11 = FUN_14003c0c0(local_res10,local_118,iVar14 + -2);
        FUN_140003100(local_res10,uVar11);
        FUN_1400031d0(local_118);
        local_350 = &local_218;
        FUN_1400a3440();
        local_218 = (undefined8 **)PTR_DAT_1402f8010;
        FUN_140003100(&local_218,local_res10);
        uVar11 = FUN_140003080(local_98,PTR_DAT_14030aee8,0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa0d,uVar11,&local_218);
        ppppuVar13 = (undefined8 ****)local_res10[0];
        if ((undefined8 ****)local_res10[0] == (undefined8 ****)0x0) {
          ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa0d,PTR_DAT_14030aee8,ppppuVar13);
        FUN_1400031d0(local_res10);
      }
      DVar7 = 0;
      if (((char)param_1[3] == '\0') && (DVar7 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa0d);
        local_318 = PTR_DAT_14030aee8;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0x98))(param_1,iVar2,local_2b8,&local_res20);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030aee8);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa0d);
        local_340 = PTR_DAT_14030aee8;
        local_338 = CONCAT44(local_338._4_4_,iVar2);
        local_330 = param_3;
        DVar8 = GetTickCount();
        local_328 = CONCAT44(local_328._4_4_,DVar8 - DVar7);
        (**(code **)(*param_1 + 0x18))(param_1,&local_348);
      }
      FUN_1400031d0(&local_res20);
      break;
    case 0xfa0e:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      cVar5 = FUN_140185490(param_2,local_res10,8);
      if (cVar5 != '\0') {
        local_res20 = local_res10[0];
      }
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030aef0);
      DVar7 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa0e,PTR_DAT_14030aef0,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_res10[0] = (undefined8 ***)PTR_DAT_1402f8010;
        FUN_1401a2a50(local_res10,&local_res20);
        FUN_14003c890(local_res10,&DAT_14027c73c);
        iVar14 = 0;
        if (((undefined8 ****)local_res10[0] != (undefined8 ****)0x0) &&
           (local_res10[0] != (undefined8 ***)PTR_DAT_1402f8010)) {
          iVar14 = *(int *)(local_res10[0] + -1);
        }
        uVar11 = FUN_14003c0c0(local_res10,local_e8,iVar14 + -2);
        FUN_140003100(local_res10,uVar11);
        FUN_1400031d0(local_e8);
        local_350 = &local_208;
        FUN_1400a3440();
        local_208 = (undefined8 **)PTR_DAT_1402f8010;
        FUN_140003100(&local_208,local_res10);
        uVar11 = FUN_140003080(local_68,PTR_DAT_14030aef0,0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa0e,uVar11,&local_208);
        ppppuVar13 = (undefined8 ****)local_res10[0];
        if ((undefined8 ****)local_res10[0] == (undefined8 ****)0x0) {
          ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa0e,PTR_DAT_14030aef0,ppppuVar13);
        FUN_1400031d0(local_res10);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa0e);
        local_318 = PTR_DAT_14030aef0;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0xa0))(param_1,iVar2,local_2b8,&local_res20);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030aef0);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa0e);
        local_340 = PTR_DAT_14030aef0;
        goto LAB_14014d335;
      }
      break;
    case 0xfa0f:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_140185f20(param_2,&local_res20);
      cVar5 = FUN_140185490(param_2,&local_358,4);
      uVar6 = local_res10[0]._0_4_;
      if (cVar5 != '\0') {
        uVar6 = local_358._0_4_;
      }
      local_res10[0] = (undefined8 ***)CONCAT44(local_res10[0]._4_4_,uVar6);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030aef8);
      DVar7 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa0f,PTR_DAT_14030aef8,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_358 = (undefined8 **)PTR_DAT_1402f8010;
        local_180 = local_res20._0_4_;
        FUN_1401a28c0(&local_358,&local_180);
        FUN_14003c890(&local_358,&DAT_14027c73c);
        FUN_1401a2920(&local_358,local_res10);
        FUN_14003c890(&local_358,&DAT_14027c73c);
        iVar14 = 0;
        if (((undefined8 ***)local_358 != (undefined8 ***)0x0) &&
           (local_358 != (undefined8 **)PTR_DAT_1402f8010)) {
          iVar14 = *(int *)(local_358 + -1);
        }
        uVar11 = FUN_14003c0c0(&local_358,local_108,iVar14 + -2);
        FUN_140003100(&local_358,uVar11);
        FUN_1400031d0(local_108);
        local_350 = &local_1f8;
        FUN_1400a3440();
        local_1f8 = (undefined8 **)PTR_DAT_1402f8010;
        FUN_140003100(&local_1f8,&local_358);
        uVar11 = FUN_140003080(local_88,PTR_DAT_14030aef8,0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa0f,uVar11,&local_1f8);
        pppuVar15 = (undefined8 ***)local_358;
        if ((undefined8 ***)local_358 == (undefined8 ***)0x0) {
          pppuVar15 = (undefined8 ***)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa0f,PTR_DAT_14030aef8,pppuVar15);
        FUN_1400031d0(&local_358);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa0f);
        local_318 = PTR_DAT_14030aef8;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0xa8))(param_1,iVar2,local_2b8,&local_res20,local_res10);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030aef8);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa0f);
        local_340 = PTR_DAT_14030aef8;
        goto LAB_14014d335;
      }
      break;
    case 0xfa10:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030af00);
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa10,PTR_DAT_14030af00,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_res10[0] = (undefined8 ***)PTR_DAT_1402f8010;
        uVar11 = FUN_14003c0c0(local_res10,local_130,0xfffffffe);
        FUN_140003100(local_res10,uVar11);
        FUN_1400031d0(local_130);
        local_res20 = &local_1e8;
        FUN_1400a3440();
        local_1e8 = (undefined8 **)PTR_DAT_1402f8010;
        FUN_140003100(&local_1e8,local_res10);
        uVar11 = FUN_140003080(local_48,PTR_DAT_14030af00,0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa10,uVar11,&local_1e8);
        ppppuVar13 = (undefined8 ****)local_res10[0];
        if ((undefined8 ****)local_res10[0] == (undefined8 ****)0x0) {
          ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa10,PTR_DAT_14030af00,ppppuVar13);
        FUN_1400031d0(local_res10);
      }
      DVar7 = 0;
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa10);
        local_318 = PTR_DAT_14030af00;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0xb0))(param_1,iVar2,local_2b8);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030af00);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa10);
        local_340 = PTR_DAT_14030af00;
        goto LAB_14014d335;
      }
      break;
    case 0xfa11:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      cVar5 = FUN_140185490(param_2,&local_res20,1);
      uVar12 = (byte)local_res10[0];
      if (cVar5 != '\0') {
        uVar12 = local_res20._0_1_;
      }
      local_res10[0] = (undefined8 ***)CONCAT71(local_res10[0]._1_7_,uVar12);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030af08);
      DVar7 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa11,PTR_DAT_14030af08,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_res20 = (undefined8 ***)PTR_DAT_1402f8010;
        FUN_1401a2720(&local_res20,local_res10);
        FUN_14003c890(&local_res20,&DAT_14027c73c);
        iVar14 = 0;
        if (((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
           (local_res20 != (undefined8 ***)PTR_DAT_1402f8010)) {
          iVar14 = *(int *)(local_res20 + -1);
        }
        uVar11 = FUN_14003c0c0(&local_res20,local_f8,iVar14 + -2);
        FUN_140003100(&local_res20,uVar11);
        FUN_1400031d0(local_f8);
        local_350 = &local_1d8;
        FUN_1400a3440();
        local_1d8 = (undefined8 **)PTR_DAT_1402f8010;
        FUN_140003100(&local_1d8,&local_res20);
        uVar11 = FUN_140003080(local_78,PTR_DAT_14030af08,0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa11,uVar11,&local_1d8);
        ppppuVar13 = (undefined8 ****)local_res20;
        if ((undefined8 ****)local_res20 == (undefined8 ****)0x0) {
          ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa11,PTR_DAT_14030af08,ppppuVar13);
        FUN_1400031d0(&local_res20);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa11);
        local_318 = PTR_DAT_14030af08;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0xb8))(param_1,iVar2,local_2b8,local_res10);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030af08);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa11);
        local_340 = PTR_DAT_14030af08;
        goto LAB_14014d335;
      }
      break;
    case 0xfa12:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_140185f20(param_2,&local_358);
      cVar5 = FUN_140185490(param_2,&local_2e8,4);
      uVar6 = local_res20._0_4_;
      if (cVar5 != '\0') {
        uVar6 = local_2e8._0_4_;
      }
      local_res20 = (undefined8 ***)CONCAT44(local_res20._4_4_,uVar6);
      cVar5 = FUN_140185490(param_2,local_2d8,4);
      uVar6 = local_res10[0]._0_4_;
      if (cVar5 != '\0') {
        uVar6 = local_2d8[0];
      }
      local_res10[0] = (undefined8 ***)CONCAT44(local_res10[0]._4_4_,uVar6);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030af10);
      DVar7 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa12,PTR_DAT_14030af10,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_2e8 = (undefined **)PTR_DAT_1402f8010;
        local_178[0] = local_358._0_4_;
        FUN_1401a28c0(&local_2e8,local_178);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2920(&local_2e8,&local_res20);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        FUN_1401a2920(&local_2e8,local_res10);
        FUN_14003c890(&local_2e8,&DAT_14027c73c);
        iVar14 = 0;
        if ((local_2e8 != (undefined **)0x0) && (local_2e8 != (undefined **)PTR_DAT_1402f8010)) {
          iVar14 = *(int *)(local_2e8 + -1);
        }
        uVar11 = FUN_14003c0c0(&local_2e8,local_128,iVar14 + -2);
        FUN_140003100(&local_2e8,uVar11);
        FUN_1400031d0(local_128);
        local_350 = &local_1c8;
        FUN_1400a3440();
        local_1c8 = (undefined8 **)PTR_DAT_1402f8010;
        FUN_140003100(&local_1c8,&local_2e8);
        uVar11 = FUN_140003080(local_b0,PTR_DAT_14030af10,0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa12,uVar11,&local_1c8);
        ppuVar9 = local_2e8;
        if (local_2e8 == (undefined **)0x0) {
          ppuVar9 = (undefined **)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa12,PTR_DAT_14030af10,ppuVar9);
        FUN_1400031d0(&local_2e8);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa12);
        local_318 = PTR_DAT_14030af10;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 0xc0))
                        (param_1,iVar2,local_2b8,&local_358,&local_res20,local_res10);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030af10);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa12);
        local_340 = PTR_DAT_14030af10;
        goto LAB_14014d335;
      }
      break;
    case 0xfa13:
      FUN_140140af0(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      cVar5 = FUN_140185490(param_2,&local_res20,4);
      uVar6 = local_res10[0]._0_4_;
      if (cVar5 != '\0') {
        uVar6 = local_res20._0_4_;
      }
      local_res10[0] = (undefined8 ***)CONCAT44(local_res10[0]._4_4_,uVar6);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030af18);
      DVar7 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa13,PTR_DAT_14030af18,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_res20 = (undefined8 ***)PTR_DAT_1402f8010;
        FUN_1401a2920(&local_res20,local_res10);
        FUN_14003c890(&local_res20,&DAT_14027c73c);
        iVar14 = 0;
        if (((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
           (local_res20 != (undefined8 ***)PTR_DAT_1402f8010)) {
          iVar14 = *(int *)(local_res20 + -1);
        }
        uVar11 = FUN_14003c0c0(&local_res20,local_120,iVar14 + -2);
        FUN_140003100(&local_res20,uVar11);
        FUN_1400031d0(local_120);
        local_350 = &local_1b8;
        FUN_1400a3440();
        local_1b8 = (undefined8 **)PTR_DAT_1402f8010;
        FUN_140003100(&local_1b8,&local_res20);
        uVar11 = FUN_140003080(local_a0,PTR_DAT_14030af18,0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa13,uVar11,&local_1b8);
        ppppuVar13 = (undefined8 ****)local_res20;
        if ((undefined8 ****)local_res20 == (undefined8 ****)0x0) {
          ppppuVar13 = (undefined8 ****)PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa13,PTR_DAT_14030af18,ppppuVar13);
        FUN_1400031d0(&local_res20);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa13);
        local_318 = PTR_DAT_14030af18;
        local_310 = iVar2;
        local_308 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_320);
        DVar7 = GetTickCount();
      }
      cVar5 = (**(code **)(*param_1 + 200))(param_1,iVar2,local_2b8,local_res10);
      if (cVar5 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030af18);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfa13);
        local_340 = PTR_DAT_14030af18;
        goto LAB_14014d335;
      }
      break;
    default:
      goto switchD_1401498f3_default;
    }
    uVar11 = 1;
  }
  return uVar11;
}



undefined1
FUN_14014d3e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined1 *param_5,longlong param_6,longlong param_7,longlong param_8,longlong param_9
             )

{
  undefined2 uVar1;
  undefined1 uVar2;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbf7);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14003c9e0(local_30,*param_5);
  uVar1 = *(undefined2 *)(param_6 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_6 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_7 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_7 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_8 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_8 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_9 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_9 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030af30,0xfbf7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar2;
}



undefined1
FUN_14014d570(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined1 *param_6,longlong param_7,longlong param_8,
             longlong param_9,longlong param_10)

{
  undefined2 uVar1;
  undefined1 uVar2;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbf7);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14003c9e0(local_30,*param_6);
  uVar1 = *(undefined2 *)(param_7 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_7 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_8 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_8 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_9 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_9 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_10 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_10 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030af30,0xfbf7);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar2;
}



undefined1
FUN_14014d710(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             longlong param_5,longlong param_6)

{
  undefined2 uVar1;
  undefined1 uVar2;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbf8);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = *(undefined2 *)(param_5 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_5 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_6 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_6 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030af38,0xfbf8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar2;
}



undefined1
FUN_14014d840(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,longlong param_6,longlong param_7)

{
  undefined2 uVar1;
  undefined1 uVar2;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbf8);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = *(undefined2 *)(param_6 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_6 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_7 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_7 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030af38,0xfbf8);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar2;
}



undefined1
FUN_14014d980(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbf9);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030af40,0xfbf9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14014da70(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbf9);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030af40,0xfbf9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14014db70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbfa);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030af48,0xfbfa);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14014dc60(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbfa);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030af48,0xfbfa);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14014dd60(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,longlong param_6,longlong param_7,longlong param_8,longlong param_9
             )

{
  undefined2 uVar1;
  undefined1 uVar2;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbfb);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = *(undefined2 *)(param_6 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_6 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_7 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_7 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_8 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_8 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_9 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_9 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030af50,0xfbfb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar2;
}



undefined1
FUN_14014def0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,longlong param_7,longlong param_8,
             longlong param_9,longlong param_10)

{
  undefined2 uVar1;
  undefined1 uVar2;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbfb);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = *(undefined2 *)(param_7 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_7 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_8 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_8 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_9 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_9 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_10 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_10 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030af50,0xfbfb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar2;
}



undefined1 FUN_14014e090(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbfc);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030af58,0xfbfc);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14014e150(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbfc);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030af58,0xfbfc);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14014e220(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbfd);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030af60,0xfbfd);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14014e2e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbfd);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030af60,0xfbfd);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14014e3b0(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbfe);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030af68,0xfbfe);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14014e470(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbfe);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030af68,0xfbfe);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14014e540(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbff);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030af70,0xfbff);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14014e600(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfbff);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030af70,0xfbff);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14014e6d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfc00);
  FUN_14003c9e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030af78,0xfc00);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14014e7b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined1 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfc00);
  FUN_14003c9e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030af78,0xfc00);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14014e890(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfc01);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030af80,0xfc01);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14014e950(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfc01);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030af80,0xfc01);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14014ea20(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfc02);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030af88,0xfc02);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14014eae0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfc02);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030af88,0xfc02);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14014ebb0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfc03);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030af90,0xfc03);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14014ec90(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfc03);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030af90,0xfc03);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14014ed70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfc04);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030af98,0xfc04);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14014ee50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfc04);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030af98,0xfc04);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14014ef30(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfc05);
  FUN_14003c9e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030afa0,0xfc05);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14014f010(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined1 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfc05);
  FUN_14003c9e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030afa0,0xfc05);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_14014f0f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfc06);
  FUN_1401a25c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030afa8,0xfc06);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14014f1d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfc06);
  FUN_1401a25c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030afa8,0xfc06);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14014f2b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfc07);
  FUN_14003c9e0(local_30,*param_4);
  FUN_1401a25c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030afb0,0xfc07);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14014f3a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined1 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfc07);
  FUN_14003c9e0(local_30,*param_5);
  FUN_1401a25c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030afb0,0xfc07);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined8 FUN_14014f490(longlong param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  uint uVar1;
  longlong lVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  uint *puVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined1 uVar8;
  
  uVar6 = 0xfffffffffffffffe;
  uVar4 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  uVar7 = uVar4;
  FUN_1400a1c30(uVar4);
  uVar8 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))();
  }
  uVar1 = *(uint *)(*(longlong *)(param_1 + 0x20) + 0xca0);
  uVar3 = (ulonglong)param_2 % (ulonglong)uVar1;
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x20) + 0xc80);
  if ((lVar2 != 0) && (puVar5 = *(uint **)(lVar2 + uVar3 * 8), puVar5 != (uint *)0x0)) {
    while ((uint)uVar3 == puVar5[8] % uVar1) {
      if (*puVar5 == param_2) {
        lVar2 = *(longlong *)(puVar5 + 2);
        if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x228) == 0)) {
          FUN_140003100(lVar2 + 0x1f0,param_4,uVar3,(ulonglong)uVar1,uVar6,uVar7,uVar8);
        }
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar4);
  return 1;
}



undefined8 FUN_14014f580(longlong param_1,uint param_2,undefined8 param_3,undefined8 *param_4)

{
  uint uVar1;
  longlong lVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  uint *puVar5;
  
  uVar4 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar4);
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))();
  }
  uVar1 = *(uint *)(*(longlong *)(param_1 + 0x20) + 0xca0);
  uVar3 = (ulonglong)param_2 % (ulonglong)uVar1;
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x20) + 0xc80);
  if ((lVar2 != 0) && (puVar5 = *(uint **)(lVar2 + uVar3 * 8), puVar5 != (uint *)0x0)) {
    while ((uint)uVar3 == puVar5[8] % uVar1) {
      if (*puVar5 == param_2) {
        lVar2 = *(longlong *)(puVar5 + 2);
        if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x228) == 0)) {
          *(undefined8 *)(lVar2 + 400) = *param_4;
        }
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar4);
  return 1;
}



undefined8
FUN_14014f670(longlong param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             longlong *param_5)

{
  int *piVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined *puVar4;
  undefined *puVar5;
  undefined *local_res8;
  undefined8 uVar6;
  
  uVar6 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  uVar3 = uVar2;
  FUN_1400a1c30(uVar2);
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))
              (*(longlong **)(param_1 + 0x20),L"Proud::CNetServerImpl::C2SStub::NotifyLog");
  }
  if (*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x17f0) != 0) {
    FUN_1400a3440();
    local_res8 = PTR_DAT_1402f8010;
    puVar5 = (undefined *)*param_5;
    if ((undefined *)*param_5 == (undefined *)0x0) {
      puVar5 = PTR_DAT_1402f8010;
    }
    FUN_14003c600(&local_res8,L"[Client %d] %s",param_2,puVar5,uVar6,uVar3);
    puVar5 = local_res8;
    puVar4 = local_res8;
    if (local_res8 == (undefined *)0x0) {
      puVar4 = PTR_DAT_1402f8010;
    }
    FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x17f0),*param_4,puVar4);
    if (((puVar5 != (undefined *)0x0) && (puVar5 != PTR_DAT_1402f8010)) &&
       (puVar5 + -8 != (undefined *)0x0)) {
      uVar3 = FUN_1400a3440();
      FUN_1400a1c30(uVar3);
      piVar1 = (int *)(puVar5 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar5 + -8);
      }
      FUN_1400d1290(uVar3);
    }
  }
  FUN_1400d1290(uVar2);
  return 1;
}



undefined8
FUN_14014f7b0(longlong param_1,undefined4 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  int *piVar1;
  undefined *puVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  longlong lVar5;
  longlong *plVar6;
  undefined8 *puVar7;
  undefined *puVar8;
  undefined *local_res8;
  undefined *local_res20;
  undefined *local_118;
  undefined *local_110;
  undefined *local_108;
  undefined8 local_100;
  undefined1 local_f8;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined4 local_98;
  undefined8 local_88;
  undefined1 local_80;
  undefined8 local_78;
  undefined1 local_70;
  undefined8 local_68;
  undefined1 local_60;
  undefined8 local_58;
  undefined1 local_50;
  undefined8 local_48;
  undefined1 local_40;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  local_100 = uVar3;
  FUN_1400a1c30(uVar3);
  local_f8 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))
              (*(longlong **)(param_1 + 0x20),
               L"Proud::CNetServerImpl::C2SStub::NotifyLogHolepunchFreqFail");
  }
  local_a8 = 0;
  local_e0 = 0;
  local_e8 = 0;
  local_d0 = 0;
  local_d8 = 0;
  local_b0 = 0;
  local_b8 = 0;
  local_c0 = 0;
  local_c8 = 0;
  local_a0 = 0;
  local_98 = 0;
  plVar6 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0xa8);
  (**(code **)(*plVar6 + 0xb0))(plVar6,&local_e8);
  if (*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x17f0) != 0) {
    FUN_1400a3440();
    local_res8 = PTR_DAT_1402f8010;
    FUN_14003c600(&local_res8,L"[Client %d] Pair=%d/%d##CCU=%d##",param_2,local_a8._4_4_,
                  (undefined4)local_a8,(undefined4)local_a0);
    plVar6 = (longlong *)FUN_1401491b0(&local_108,&local_res8,param_5);
    puVar8 = (undefined *)*plVar6;
    if ((undefined *)*plVar6 == (undefined *)0x0) {
      puVar8 = PTR_DAT_1402f8010;
    }
    FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x17f0),2,puVar8);
    if (((local_108 != (undefined *)0x0) && (local_108 != PTR_DAT_1402f8010)) &&
       (local_108 + -8 != (undefined *)0x0)) {
      uVar4 = FUN_1400a3440();
      local_88 = uVar4;
      FUN_1400a1c30(uVar4);
      local_80 = 1;
      piVar1 = (int *)(local_108 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(local_108 + -8);
      }
      FUN_1400d1290(uVar4);
    }
    puVar8 = local_res8;
    if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1402f8010)) &&
       (puVar2 = local_res8 + -8, puVar2 != (undefined *)0x0)) {
      uVar4 = FUN_1400a3440();
      local_68 = uVar4;
      FUN_1400a1c30(uVar4);
      local_60 = 1;
      piVar1 = (int *)(puVar8 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar2);
      }
      FUN_1400d1290(uVar4);
    }
  }
  if ((*(int *)(*(longlong *)(param_1 + 0x20) + 0x1804) < *param_4) &&
     (lVar5 = FUN_140146cc0(*(longlong *)(param_1 + 0x20),param_2), lVar5 != 0)) {
    FUN_1400a3440();
    local_res20 = PTR_DAT_1402f8010;
    puVar7 = (undefined8 *)(*(longlong *)(lVar5 + 0x748) + 0x128);
    plVar6 = (longlong *)(**(code **)*puVar7)(puVar7,&local_110);
    puVar8 = (undefined *)*plVar6;
    if ((undefined *)*plVar6 == (undefined *)0x0) {
      puVar8 = PTR_DAT_1402f8010;
    }
    FUN_14003c600(&local_res20,L"[Client %d %s] Pair=%d/%d##CCU=%d",param_2,puVar8,local_a8._4_4_,
                  (undefined4)local_a8,(undefined4)local_a0);
    if (((local_110 != (undefined *)0x0) && (local_110 != PTR_DAT_1402f8010)) &&
       (local_110 + -8 != (undefined *)0x0)) {
      uVar3 = FUN_1400a3440();
      local_48 = uVar3;
      FUN_1400a1c30(uVar3);
      local_40 = 1;
      piVar1 = (int *)(local_110 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(local_110 + -8);
      }
      FUN_1400d1290(uVar3);
    }
    *(int *)(*(longlong *)(param_1 + 0x20) + 0x1804) = *param_4;
    uVar3 = FUN_1401491b0(&local_118,&local_res20,param_5);
    FUN_140003100(*(longlong *)(param_1 + 0x20) + 0x1808,uVar3);
    if (((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1402f8010)) &&
       (local_118 + -8 != (undefined *)0x0)) {
      uVar3 = FUN_1400a3440();
      local_78 = uVar3;
      FUN_1400a1c30(uVar3);
      local_70 = 1;
      piVar1 = (int *)(local_118 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(local_118 + -8);
      }
      FUN_1400d1290(uVar3);
    }
    puVar8 = local_res20;
    LOCK();
    *(undefined4 *)(*(longlong *)(param_1 + 0x20) + 0x1840) = 1;
    UNLOCK();
    uVar3 = local_100;
    if (((local_res20 != (undefined *)0x0) && (local_res20 != PTR_DAT_1402f8010)) &&
       (puVar2 = local_res20 + -8, puVar2 != (undefined *)0x0)) {
      uVar3 = FUN_1400a3440();
      local_58 = uVar3;
      FUN_1400a1c30(uVar3);
      local_50 = 1;
      piVar1 = (int *)(puVar8 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar2);
      }
      FUN_1400d1290(uVar3);
      uVar3 = local_100;
    }
  }
  FUN_1400d1290(uVar3);
  return 1;
}



undefined8 FUN_14014fb50(longlong param_1,ulonglong param_2,undefined8 param_3,float *param_4)

{
  uint uVar1;
  longlong lVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  int *piVar5;
  longlong *plVar6;
  undefined8 uVar7;
  
  uVar4 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))
                    (*(longlong **)(param_1 + 0x20),param_2,param_3,param_4,0xfffffffffffffffe);
  FUN_1400a1c30(uVar4);
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))();
  }
  uVar1 = *(uint *)(*(longlong *)(param_1 + 0x20) + 0xca0);
  uVar3 = (param_2 & 0xffffffff) % (ulonglong)uVar1;
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x20) + 0xc80);
  if ((lVar2 != 0) && (piVar5 = *(int **)(lVar2 + uVar3 * 8), piVar5 != (int *)0x0)) {
    while ((uint)uVar3 == (uint)piVar5[8] % uVar1) {
      if (*piVar5 == (int)param_2) {
        lVar2 = *(longlong *)(piVar5 + 2);
        if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x228) == 0)) {
          uVar7 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x118) + 8))();
          *(undefined8 *)(lVar2 + 0x180) = uVar7;
          *(double *)(lVar2 + 0x1e0) = (double)*param_4;
          plVar6 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
          (**(code **)(*plVar6 + 0xa0))(plVar6,param_2 & 0xffffffff,&DAT_140318cf0);
        }
        break;
      }
      piVar5 = *(int **)(piVar5 + 4);
      if (piVar5 == (int *)0x0) break;
    }
  }
  FUN_1400d1290(uVar4);
  return 1;
}



undefined8 FUN_14014fc90(longlong param_1,uint param_2,undefined8 param_3,longlong param_4)

{
  uint uVar1;
  int iVar2;
  longlong lVar3;
  ulonglong uVar4;
  undefined8 uVar5;
  uint *puVar6;
  longlong *plVar7;
  undefined8 uVar8;
  undefined8 uVar9;
  undefined1 uVar10;
  
  uVar9 = 0xfffffffffffffffe;
  uVar5 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  uVar8 = uVar5;
  FUN_1400a1c30(uVar5);
  uVar10 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))();
  }
  uVar1 = *(uint *)(*(longlong *)(param_1 + 0x20) + 0xca0);
  uVar4 = (ulonglong)param_2 % (ulonglong)uVar1;
  lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x20) + 0xc80);
  if ((lVar3 != 0) && (puVar6 = *(uint **)(lVar3 + uVar4 * 8), puVar6 != (uint *)0x0)) {
    while ((uint)uVar4 == puVar6[8] % uVar1) {
      if (*puVar6 == param_2) {
        lVar3 = *(longlong *)(puVar6 + 2);
        if ((lVar3 != 0) && (*(longlong *)(lVar3 + 0x228) == 0)) {
          iVar2 = *(int *)(param_4 + 0x18);
          if (iVar2 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          FUN_14003cda0(lVar3 + 0x1f8,iVar2,uVar4,(ulonglong)uVar1,uVar9,uVar8,uVar10);
          uVar9 = 0;
          uVar8 = uVar9;
          if (*(int *)(param_4 + 0x18) != 0) {
            uVar8 = *(undefined8 *)(param_4 + 0x10);
          }
          if (*(int *)(lVar3 + 0x210) != 0) {
            uVar9 = *(undefined8 *)(lVar3 + 0x208);
          }
          FUN_1400224d0(uVar9,uVar8,(longlong)iVar2);
          plVar7 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
          (**(code **)(*plVar7 + 0xf0))(plVar7,(ulonglong)param_2,&DAT_140318cf0);
        }
        break;
      }
      puVar6 = *(uint **)(puVar6 + 4);
      if (puVar6 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar5);
  return 1;
}



undefined8 FUN_14014fdf0(longlong param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  uint uVar1;
  longlong lVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  uint *puVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined1 uVar8;
  
  uVar6 = 0xfffffffffffffffe;
  uVar4 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  uVar7 = uVar4;
  FUN_1400a1c30(uVar4);
  uVar8 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))();
  }
  uVar1 = *(uint *)(*(longlong *)(param_1 + 0x20) + 0xca0);
  uVar3 = (ulonglong)param_2 % (ulonglong)uVar1;
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x20) + 0xc80);
  if ((lVar2 != 0) && (puVar5 = *(uint **)(lVar2 + uVar3 * 8), puVar5 != (uint *)0x0)) {
    while ((uint)uVar3 == puVar5[8] % uVar1) {
      if (*puVar5 == param_2) {
        lVar2 = *(longlong *)(puVar5 + 2);
        if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x228) == 0)) {
          FUN_140003100(lVar2 + 0x1f0,param_4,uVar3,(ulonglong)uVar1,uVar6,uVar7,uVar8);
        }
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar4);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x00014014ffef)

undefined8
FUN_14014fee0(longlong param_1,ulonglong param_2,undefined8 param_3,int *param_4,uint *param_5)

{
  undefined8 uVar1;
  longlong lVar2;
  longlong *plVar3;
  int *piVar4;
  longlong lVar5;
  
  uVar1 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))
                    (*(longlong **)(param_1 + 0x20),param_2,param_3,param_4,0xfffffffffffffffe);
  FUN_1400a1c30(uVar1);
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))
              (*(longlong **)(param_1 + 0x20),L"Proud::CNetServerImpl::C2SStub::ReportP2PPeerPing");
  }
  lVar2 = FUN_140146cc0(*(undefined8 *)(param_1 + 0x20),param_2 & 0xffffffff);
  if (lVar2 != 0) {
    if (*(longlong *)(lVar2 + 0x6c0) == 0) {
      plVar3 = (longlong *)0x0;
    }
    else {
      plVar3 = *(longlong **)(lVar2 + 0x6b0);
    }
    for (; plVar3 != (longlong *)0x0; plVar3 = (longlong *)plVar3[2]) {
      if ((longlong *)*plVar3 == (longlong *)0x0) {
        lVar2 = 0;
      }
      else {
        lVar2 = *(longlong *)*plVar3;
      }
      lVar5 = 0;
      piVar4 = (int *)(lVar2 + 0x10);
      do {
        if (*piVar4 == *param_4) {
          *(double *)(lVar2 + 0x188) = (double)*param_5 / 1000.0;
          break;
        }
        lVar5 = lVar5 + 1;
        piVar4 = piVar4 + 0xc;
      } while (lVar5 < 2);
    }
  }
  FUN_1400d1290(uVar1);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x0001401501a2)

undefined8
FUN_140150020(longlong param_1,uint param_2,undefined8 param_3,int *param_4,int *param_5,
             int *param_6)

{
  uint uVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  longlong *plVar4;
  int *piVar5;
  uint *puVar6;
  longlong lVar7;
  longlong lVar8;
  
  uVar3 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar3);
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))();
  }
  uVar1 = *(uint *)(*(longlong *)(param_1 + 0x20) + 0xca0);
  uVar2 = (ulonglong)param_2 % (ulonglong)uVar1;
  lVar8 = *(longlong *)(*(longlong *)(param_1 + 0x20) + 0xc80);
  if ((lVar8 != 0) && (puVar6 = *(uint **)(lVar8 + uVar2 * 8), puVar6 != (uint *)0x0)) {
    while ((uint)uVar2 == puVar6[8] % uVar1) {
      if (*puVar6 == param_2) {
        lVar8 = *(longlong *)(puVar6 + 2);
        if (((lVar8 != 0) && (*(longlong *)(lVar8 + 0x228) == 0)) && (*param_4 != 0)) {
          *(int *)(lVar8 + 0x1d4) = *(int *)(lVar8 + 0x1d4) + *param_5;
          *(int *)(lVar8 + 0x1d0) = *(int *)(lVar8 + 0x1d0) + *param_6;
          if (*(longlong *)(lVar8 + 0x6c0) == 0) {
            plVar4 = (longlong *)0x0;
          }
          else {
            plVar4 = *(longlong **)(lVar8 + 0x6b0);
          }
          for (; plVar4 != (longlong *)0x0; plVar4 = (longlong *)plVar4[2]) {
            if ((longlong *)*plVar4 == (longlong *)0x0) {
              lVar8 = 0;
            }
            else {
              lVar8 = *(longlong *)*plVar4;
            }
            lVar7 = 0;
            piVar5 = (int *)(lVar8 + 0x10);
            do {
              if (*piVar5 == *param_4) {
                *(int *)(lVar8 + 0x1a8) = *param_5;
                *(int *)(lVar8 + 0x1a4) = *param_6;
                break;
              }
              lVar7 = lVar7 + 1;
              piVar5 = piVar5 + 0xc;
            } while (lVar7 < 2);
          }
        }
        break;
      }
      puVar6 = *(uint **)(puVar6 + 4);
      if (puVar6 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar3);
  return 1;
}



undefined8 FUN_1401501d0(longlong param_1,uint param_2,undefined8 param_3,undefined4 *param_4)

{
  uint uVar1;
  longlong lVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  uint *puVar5;
  
  uVar4 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar4);
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))();
  }
  uVar1 = *(uint *)(*(longlong *)(param_1 + 0x20) + 0xca0);
  uVar3 = (ulonglong)param_2 % (ulonglong)uVar1;
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x20) + 0xc80);
  if ((lVar2 != 0) && (puVar5 = *(uint **)(lVar2 + uVar3 * 8), puVar5 != (uint *)0x0)) {
    while ((uint)uVar3 == puVar5[8] % uVar1) {
      if (*puVar5 == param_2) {
        lVar2 = *(longlong *)(puVar5 + 2);
        if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x228) == 0)) {
          *(undefined4 *)(lVar2 + 0x1d8) = *param_4;
        }
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar4);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Removing unreachable block (ram,0x000140150720)

void FUN_1401502c0(longlong *param_1)

{
  ulonglong _Size;
  undefined4 uVar1;
  longlong lVar2;
  code *pcVar3;
  undefined8 uVar4;
  double dVar5;
  undefined8 uVar6;
  ulonglong uVar7;
  undefined4 *puVar8;
  longlong lVar9;
  undefined1 *puVar10;
  undefined1 *puVar11;
  longlong lVar12;
  longlong lVar13;
  undefined8 *puVar14;
  undefined1 auStack_dd8 [32];
  undefined4 local_db8 [2];
  longlong local_db0;
  longlong local_da8;
  undefined4 local_da0;
  int local_d9c;
  undefined8 local_d90;
  char local_d88;
  longlong *local_d80;
  undefined8 local_d78;
  undefined1 local_d70;
  undefined8 local_d68;
  undefined1 local_d60;
  undefined8 local_d58;
  undefined4 uStack_d50;
  undefined4 uStack_d4c;
  undefined8 local_d48;
  undefined1 local_d40;
  undefined8 local_d38;
  undefined4 uStack_d30;
  undefined4 uStack_d2c;
  undefined8 local_d28;
  undefined1 local_d20 [72];
  undefined4 local_cd8;
  undefined4 uStack_cd4;
  undefined4 uStack_cd0;
  undefined4 uStack_ccc;
  undefined4 *local_58;
  undefined4 local_50;
  int local_4c;
  ulonglong local_48;
  
  puVar10 = auStack_dd8;
  puVar11 = auStack_dd8;
  local_d28 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)local_db8;
  uVar6 = (**(code **)(*param_1 + 0x58))();
  local_d48 = uVar6;
  FUN_1400a1c30(uVar6);
  local_d40 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::PurgeTooOldUnmatureClient");
  }
  if ((int)param_1[0x2e1] < 1) {
    FUN_1400d1290(uVar6);
    goto LAB_1401507d8;
  }
  lVar13 = (longlong)(int)param_1[0x2e1] * 8;
  _Size = lVar13 + 0x10;
  if (_Size < 0x401) {
    uVar7 = lVar13 + 0x1f;
    if (uVar7 <= _Size) {
      uVar7 = 0xffffffffffffff0;
    }
    lVar13 = -(uVar7 & 0xfffffffffffffff0);
    puVar10 = auStack_dd8 + lVar13;
    puVar8 = (undefined4 *)((longlong)local_db8 + lVar13);
    puVar14 = (undefined8 *)0x0;
    puVar11 = auStack_dd8 + lVar13;
    if (puVar8 != (undefined4 *)0x0) {
      *puVar8 = 0xcccc;
LAB_1401503b8:
      puVar14 = (undefined8 *)(puVar8 + 4);
      puVar11 = puVar10;
    }
  }
  else {
    puVar8 = malloc(_Size);
    puVar14 = (undefined8 *)0x0;
    puVar11 = auStack_dd8;
    if (puVar8 != (undefined4 *)0x0) {
      *puVar8 = 0xdddd;
      goto LAB_1401503b8;
    }
  }
  *(undefined8 *)(puVar11 + -8) = 0x1401503c8;
  dVar5 = (double)FUN_1400ad790(param_1 + 0xec);
  lVar12 = 0;
  lVar13 = lVar12;
  if (param_1[0x2e1] != 0) {
    lVar13 = param_1[0x2df];
  }
  for (; lVar13 != 0; lVar13 = *(longlong *)(lVar13 + 0x18)) {
    lVar2 = *(longlong *)(lVar13 + 0x10);
    if ((DAT_140314008 < dVar5 - *(double *)(lVar2 + 0x690)) && (*(char *)(lVar2 + 0x698) == '\0'))
    {
      *(undefined8 *)(puVar11 + -8) = 0x14015041c;
      FUN_1401a1450(lVar2 + 0xc0);
      puVar14[lVar12] = lVar2;
      lVar12 = lVar12 + 1;
    }
  }
  *(undefined8 *)(puVar11 + -8) = 0x140150434;
  FUN_1400d1290(uVar6);
  local_d40 = 0;
  while ((0 < lVar12 && (lVar13 = 0, 0 < lVar12))) {
    do {
      lVar2 = puVar14[lVar13];
      pcVar3 = *(code **)(*(longlong *)(lVar2 + 0x108) + 0x10);
      *(undefined8 *)(puVar11 + -8) = 0x140150462;
      uVar6 = (*pcVar3)();
      local_d88 = 0;
      local_d90 = uVar6;
      if (lVar13 == 0) {
        local_d88 = 1;
        *(undefined8 *)(puVar11 + -8) = 0x1401505dd;
        FUN_1400a1c30(uVar6);
        *(undefined8 *)(puVar11 + -8) = 0x1401505e6;
        FUN_140185560(local_db8);
        *(undefined8 *)(puVar11 + -8) = 0x1401505f0;
        FUN_140185030(local_db8);
        *(undefined8 *)(puVar11 + -8) = 0x1401505fe;
        FUN_1401856c0(local_db8,0x800);
        *(undefined8 *)(puVar11 + -8) = 0x140150609;
        FUN_1401856c0(local_db8,0);
        *(undefined8 *)(puVar11 + -8) = 0x140150615;
        FUN_14003c9e0(local_db8,3);
        local_4c = 200;
        local_50 = 0;
        local_58 = &local_cd8;
        if (local_db0 == 0) {
          uVar1 = local_da0;
          if (local_da8 == 0) {
                    // WARNING: Subroutine does not return
            *(undefined8 *)(puVar11 + -8) = 0x1401507bf;
            FUN_14019a830();
          }
        }
        else {
          uVar1 = *(undefined4 *)(local_db0 + 0x18);
        }
        lVar9 = local_da8;
        if (local_da8 == 0) {
          if (local_db0 == 0) {
                    // WARNING: Subroutine does not return
            *(undefined **)(puVar11 + -8) = &UNK_1401507b9;
            FUN_14019a830();
          }
          lVar9 = 0;
          if (*(int *)(local_db0 + 0x18) != 0) {
            lVar9 = *(longlong *)(local_db0 + 0x10);
          }
        }
        local_50 = 1;
        local_d38._0_4_ = (undefined4)lVar9;
        local_d38._4_4_ = (undefined4)((ulonglong)lVar9 >> 0x20);
        local_cd8 = (undefined4)local_d38;
        uStack_cd4 = local_d38._4_4_;
        uStack_ccc = uStack_d2c;
        local_d68 = 0;
        local_d60 = 1;
        uVar4 = *(undefined8 *)(lVar2 + 0x748);
        local_d38 = lVar9;
        uStack_d30 = uVar1;
        uStack_cd0 = uVar1;
        *(undefined8 *)(puVar11 + -8) = 0x1401506b0;
        FUN_1401a12a0(uVar4,&local_cd8);
        if (local_58 == (undefined4 *)0x0) {
          *(undefined8 *)(puVar11 + -8) = 0x1401507a0;
          FUN_1400a2320(local_d20,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
          *(undefined8 *)(puVar11 + -8) = 0x1401507b3;
          _CxxThrowException(local_d20,(ThrowInfo *)&DAT_1402f4860);
        }
        if (local_4c < 0) {
                    // WARNING: Subroutine does not return
          *(undefined **)(puVar11 + -8) = &UNK_14015078c;
          FUN_1400a26d0();
        }
        *(undefined1 *)(lVar2 + 0x698) = 1;
        *(undefined8 *)(puVar11 + -8) = 0x1401506dd;
        FUN_1400d1290(uVar6);
        local_d88 = '\0';
        *(undefined8 *)(puVar11 + -8) = 0x1401506ef;
        FUN_1401a1460(lVar2 + 0xc0);
        *puVar14 = puVar14[lVar12 + -1];
        lVar12 = lVar12 + -1;
        local_d80 = &local_db0;
        *(undefined8 *)(puVar11 + -8) = 0x14015070e;
        FUN_14019a730(&local_db0);
        if ((local_da8 != 0) && (local_d9c < 0)) {
                    // WARNING: Subroutine does not return
          *(undefined8 *)(puVar11 + -8) = 0x140150786;
          FUN_1400a26d0();
        }
      }
      else {
        *(undefined8 *)(puVar11 + -8) = 0x14015047e;
        local_d88 = FUN_1400a1c80();
        if (local_d88 != '\0') {
          *(undefined8 *)(puVar11 + -8) = 0x140150495;
          FUN_140185560(local_db8);
          *(undefined8 *)(puVar11 + -8) = 0x14015049f;
          FUN_140185030(local_db8);
          *(undefined8 *)(puVar11 + -8) = 0x1401504ad;
          FUN_1401856c0(local_db8,0x800);
          *(undefined8 *)(puVar11 + -8) = 0x1401504b8;
          FUN_1401856c0(local_db8,0);
          *(undefined8 *)(puVar11 + -8) = 0x1401504c4;
          FUN_14003c9e0(local_db8,3);
          local_4c = 200;
          local_50 = 0;
          local_58 = &local_cd8;
          if (local_db0 == 0) {
            uVar1 = local_da0;
            if (local_da8 == 0) {
                    // WARNING: Subroutine does not return
              *(undefined8 *)(puVar11 + -8) = 0x140150780;
              FUN_14019a830();
            }
          }
          else {
            uVar1 = *(undefined4 *)(local_db0 + 0x18);
          }
          lVar9 = local_da8;
          if (local_da8 == 0) {
            if (local_db0 == 0) {
                    // WARNING: Subroutine does not return
              *(undefined **)(puVar11 + -8) = &UNK_14015077a;
              FUN_14019a830();
            }
            lVar9 = 0;
            if (*(int *)(local_db0 + 0x18) != 0) {
              lVar9 = *(longlong *)(local_db0 + 0x10);
            }
          }
          local_50 = 1;
          local_d58._0_4_ = (undefined4)lVar9;
          local_d58._4_4_ = (undefined4)((ulonglong)lVar9 >> 0x20);
          local_cd8 = (undefined4)local_d58;
          uStack_cd4 = local_d58._4_4_;
          uStack_ccc = uStack_d4c;
          local_d78 = 0;
          local_d70 = 1;
          uVar4 = *(undefined8 *)(lVar2 + 0x748);
          local_d58 = lVar9;
          uStack_d50 = uVar1;
          uStack_cd0 = uVar1;
          *(undefined8 *)(puVar11 + -8) = 0x14015055a;
          FUN_1401a12a0(uVar4,&local_cd8);
          if (local_58 == (undefined4 *)0x0) {
            *(undefined8 *)(puVar11 + -8) = 0x140150761;
            FUN_1400a2320(local_d20,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
            *(undefined8 *)(puVar11 + -8) = 0x140150774;
            _CxxThrowException(local_d20,(ThrowInfo *)&DAT_1402f4860);
          }
          if (local_4c < 0) {
                    // WARNING: Subroutine does not return
            *(undefined **)(puVar11 + -8) = &UNK_14015074d;
            FUN_1400a26d0();
          }
          *(undefined1 *)(lVar2 + 0x698) = 1;
          *(undefined8 *)(puVar11 + -8) = 0x140150587;
          FUN_1400d1290(uVar6);
          local_d88 = '\0';
          *(undefined8 *)(puVar11 + -8) = 0x140150599;
          FUN_1401a1460(lVar2 + 0xc0);
          puVar14[lVar13] = puVar14[lVar12 + -1];
          lVar12 = lVar12 + -1;
          local_d80 = &local_db0;
          *(undefined8 *)(puVar11 + -8) = 0x1401505b9;
          FUN_14019a730(&local_db0);
          if ((local_da8 != 0) && (local_d9c < 0)) {
                    // WARNING: Subroutine does not return
            *(undefined8 *)(puVar11 + -8) = 0x140150747;
            FUN_1400a26d0();
          }
        }
      }
      lVar13 = lVar13 + 1;
    } while (lVar13 < lVar12);
  }
  if ((puVar14 != (undefined8 *)0x0) && (*(int *)(puVar14 + -2) == 0xdddd)) {
    *(undefined8 *)(puVar11 + -8) = 0x1401507d7;
    free(puVar14 + -2);
  }
LAB_1401507d8:
  *(undefined8 *)(puVar11 + -8) = 0x1401507e7;
  return;
}



longlong * FUN_140150820(longlong *param_1,uint param_2,undefined8 param_3)

{
  ulonglong uVar1;
  char cVar2;
  undefined8 uVar3;
  longlong *plVar4;
  uint *puVar5;
  longlong *plVar6;
  wchar_t *pwVar7;
  undefined8 uVar8;
  undefined8 uVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(*param_1 + 0x58))();
  uVar9 = uVar3;
  FUN_1400a1c30(uVar3);
  uVar10 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1);
  }
  uVar1 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x194);
  plVar6 = (longlong *)0x0;
  if ((param_1[400] != 0) && (puVar5 = *(uint **)(param_1[400] + uVar1 * 8), puVar5 != (uint *)0x0))
  {
    while ((uint)uVar1 == puVar5[8] % *(uint *)(param_1 + 0x194)) {
      if (*puVar5 == param_2) {
        plVar4 = *(longlong **)(puVar5 + 2);
        if ((plVar4 != (longlong *)0x0) && (plVar4[0x45] == 0)) goto LAB_1401508e1;
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  plVar4 = plVar6;
LAB_1401508e1:
  if (plVar4 == (longlong *)0x0) {
    if (param_2 == 1) {
      plVar6 = param_1 + 0x108;
      goto LAB_1401508fb;
    }
  }
  else {
    plVar6 = plVar4 + 0x51;
LAB_1401508fb:
    if (plVar6 != (longlong *)0x0) {
      cVar2 = FUN_1401964b0(plVar6);
      if ((cVar2 == '\0') || (((char)plVar6[0x7f] == '\0' && ((int)plVar6[0x7d] == 0)))) {
        FUN_14003c600(param_3,L"key not exists");
        FUN_1400d1290(uVar3);
        return (longlong *)0x0;
      }
      goto LAB_140150962;
    }
  }
  pwVar7 = L"not NULL";
  if (plVar4 == (longlong *)0x0) {
    pwVar7 = L"NULL";
  }
  FUN_14003c600(param_3,L"%d remote rc is %s in netserver!",param_2,pwVar7,uVar8,uVar9,uVar10);
LAB_140150962:
  FUN_1400d1290(uVar3);
  return plVar6;
}



undefined8 FUN_140150990(longlong param_1,uint param_2)

{
  int *piVar1;
  longlong *plVar2;
  longlong lVar3;
  ulonglong uVar4;
  undefined *puVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  uint *puVar8;
  undefined *puVar9;
  undefined *local_res8;
  
  plVar2 = (longlong *)(param_1 + -0xa8);
  uVar6 = (**(code **)(*plVar2 + 0x58))(plVar2);
  FUN_1400a1c30(uVar6);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*plVar2 + 200))(plVar2);
  }
  uVar4 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xbf8);
  if ((*(longlong *)(param_1 + 0xbd8) != 0) &&
     (puVar8 = *(uint **)(*(longlong *)(param_1 + 0xbd8) + uVar4 * 8), puVar8 != (uint *)0x0)) {
    while ((uint)uVar4 == puVar8[8] % *(uint *)(param_1 + 0xbf8)) {
      if (*puVar8 == param_2) {
        lVar3 = *(longlong *)(puVar8 + 2);
        if ((lVar3 != 0) && (*(longlong *)(lVar3 + 0x228) == 0)) {
          if (*(longlong *)(param_1 + 0x1748) != 0) {
            FUN_1400a3440();
            local_res8 = PTR_DAT_1402f8010;
            FUN_14003c600(&local_res8,&DAT_140251360,param_2);
            puVar5 = local_res8;
            puVar9 = local_res8;
            if (local_res8 == (undefined *)0x0) {
              puVar9 = PTR_DAT_1402f8010;
            }
            FUN_1401946b0(*(undefined8 *)(param_1 + 0x1748),0,puVar9);
            if (((puVar5 != (undefined *)0x0) && (puVar5 != PTR_DAT_1402f8010)) &&
               (puVar5 + -8 != (undefined *)0x0)) {
              uVar7 = FUN_1400a3440();
              FUN_1400a1c30(uVar7);
              piVar1 = (int *)(puVar5 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(puVar5 + -8);
              }
              FUN_1400d1290(uVar7);
            }
          }
          if (*(double *)(lVar3 + 0x758) == 0.0) {
            uVar7 = (**(code **)(*(longlong *)(param_1 + 0x70) + 8))();
            *(undefined8 *)(lVar3 + 0x758) = uVar7;
            (**(code **)(*(longlong *)(param_1 + 0x400) + 0x100))
                      ((longlong *)(param_1 + 0x400),*(undefined4 *)(lVar3 + 0x6f8),&DAT_140318cf0);
          }
          FUN_1400d1290(uVar6);
          return 1;
        }
        break;
      }
      puVar8 = *(uint **)(puVar8 + 4);
      if (puVar8 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar6);
  return 0;
}



double FUN_140150b80(longlong param_1,uint param_2,int param_3)

{
  double dVar1;
  double dVar2;
  longlong lVar3;
  ulonglong uVar4;
  undefined8 uVar5;
  longlong *plVar6;
  int *piVar7;
  uint *puVar8;
  longlong lVar9;
  longlong lVar10;
  
  uVar5 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_1400a1c30(uVar5);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))(param_1 + -0xa8);
  }
  uVar4 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xbf8);
  if ((*(longlong *)(param_1 + 0xbd8) != 0) &&
     (puVar8 = *(uint **)(*(longlong *)(param_1 + 0xbd8) + uVar4 * 8), puVar8 != (uint *)0x0)) {
    while ((uint)uVar4 == puVar8[8] % *(uint *)(param_1 + 0xbf8)) {
      if (*puVar8 == param_2) {
        lVar3 = *(longlong *)(puVar8 + 2);
        if ((lVar3 != 0) && (*(longlong *)(lVar3 + 0x228) == 0)) {
          if (*(longlong *)(lVar3 + 0x6c0) == 0) {
            plVar6 = (longlong *)0x0;
          }
          else {
            plVar6 = *(longlong **)(lVar3 + 0x6b0);
          }
          for (; plVar6 != (longlong *)0x0; plVar6 = (longlong *)plVar6[2]) {
            if (plVar6 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000c6c0(0x80004005);
            }
            if ((longlong *)*plVar6 == (longlong *)0x0) {
              lVar10 = 0;
            }
            else {
              lVar10 = *(longlong *)*plVar6;
            }
            lVar9 = 0;
            piVar7 = (int *)(lVar10 + 0x10);
            do {
              if (*piVar7 == param_3) {
                if (*(char *)(lVar10 + 8) != '\0') {
                  lVar9 = *(longlong *)(lVar10 + 0x100);
                  if (lVar9 == lVar3) {
                    lVar9 = *(longlong *)(lVar10 + 0x108);
                  }
                  dVar1 = *(double *)(lVar3 + 0x1c8);
                  dVar2 = *(double *)(lVar9 + 0x1c8);
                  FUN_1400d1290(uVar5);
                  return dVar1 + dVar2;
                }
                dVar1 = *(double *)(lVar10 + 0x188);
                FUN_1400d1290(uVar5);
                return dVar1;
              }
              lVar9 = lVar9 + 1;
              piVar7 = piVar7 + 0xc;
            } while (lVar9 < 2);
          }
        }
        break;
      }
      puVar8 = *(uint **)(puVar8 + 4);
      if (puVar8 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar5);
  return 0.0;
}



undefined8 * FUN_140150d80(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  int iVar2;
  
  iVar2 = FUN_1400ad5c0(param_1 + 0xcd0,*(int *)(param_1 + 0x6e0) + -1);
  if ((-1 < iVar2) && (iVar2 < *(int *)(param_1 + 0x6e0))) {
    lVar1 = *(longlong *)(param_1 + 0x6d8);
    *param_2 = 0;
    FUN_14016b650(param_2,lVar1 + (longlong)iVar2 * 8);
    return param_2;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a2700();
}



void thunk_FUN_140148f60(void)

{
  FUN_140148f60();
  return;
}



void thunk_FUN_140148eb0(void)

{
  FUN_140148eb0();
  return;
}



// WARNING: Removing unreachable block (ram,0x00014015106d)
// WARNING: Removing unreachable block (ram,0x000140150fda)

undefined8 FUN_140150e10(longlong param_1,uint param_2,uint param_3,undefined8 *param_4)

{
  uint uVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong *plVar4;
  uint *puVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong *plVar8;
  longlong *plVar9;
  longlong *plVar10;
  longlong *plVar11;
  
  uVar3 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_1400a1c30(uVar3);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))(param_1 + -0xa8);
  }
  plVar11 = (longlong *)0x0;
  param_4[1] = 0;
  *param_4 = 0;
  uVar1 = *(uint *)(param_1 + 0xbf8);
  lVar2 = *(longlong *)(param_1 + 0xbd8);
  if ((lVar2 != 0) &&
     (puVar5 = *(uint **)(lVar2 + ((ulonglong)param_2 % (ulonglong)uVar1) * 8),
     puVar5 != (uint *)0x0)) {
    while ((uint)((ulonglong)param_2 % (ulonglong)uVar1) == puVar5[8] % uVar1) {
      if (*puVar5 == param_2) {
        plVar9 = *(longlong **)(puVar5 + 2);
        if ((plVar9 != (longlong *)0x0) && (plVar9[0x45] == 0)) goto LAB_140150ef1;
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  plVar9 = plVar11;
LAB_140150ef1:
  if ((lVar2 != 0) &&
     (puVar5 = *(uint **)(lVar2 + ((ulonglong)param_3 % (ulonglong)uVar1) * 8),
     puVar5 != (uint *)0x0)) {
    while ((uint)((ulonglong)param_3 % (ulonglong)uVar1) == puVar5[8] % uVar1) {
      if (*puVar5 == param_3) {
        plVar8 = *(longlong **)(puVar5 + 2);
        if ((plVar8 != (longlong *)0x0) && (plVar8[0x45] == 0)) goto LAB_140150f41;
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  plVar8 = plVar11;
LAB_140150f41:
  if ((plVar9 == (longlong *)0x0) || (plVar8 == (longlong *)0x0)) {
    FUN_1400d1290(uVar3);
    uVar3 = 0;
  }
  else {
    plVar10 = plVar11;
    if (plVar9[0xd8] != 0) {
      plVar10 = (longlong *)plVar9[0xd6];
    }
    for (; plVar10 != (longlong *)0x0; plVar10 = (longlong *)plVar10[2]) {
      plVar4 = plVar11;
      if ((undefined8 *)*plVar10 != (undefined8 *)0x0) {
        plVar4 = *(longlong **)*plVar10;
      }
      plVar7 = plVar4 + 2;
      plVar6 = plVar11;
      do {
        if ((int)*plVar7 == (int)plVar8[0xdf]) {
          *(undefined4 *)((longlong)param_4 + 4) = *(undefined4 *)((longlong)plVar4 + 0x1a4);
          *(int *)param_4 = (int)plVar4[0x35];
          break;
        }
        plVar6 = (longlong *)((longlong)plVar6 + 1);
        plVar7 = plVar7 + 6;
      } while ((longlong)plVar6 < 2);
    }
    plVar10 = plVar11;
    if (plVar8[0xd8] != 0) {
      plVar10 = (longlong *)plVar8[0xd6];
    }
    for (; plVar10 != (longlong *)0x0; plVar10 = (longlong *)plVar10[2]) {
      plVar8 = plVar11;
      if ((undefined8 *)*plVar10 != (undefined8 *)0x0) {
        plVar8 = *(longlong **)*plVar10;
      }
      plVar4 = plVar8 + 2;
      plVar7 = plVar11;
      do {
        if ((int)*plVar4 == (int)plVar9[0xdf]) {
          *(undefined4 *)((longlong)param_4 + 0xc) = *(undefined4 *)((longlong)plVar8 + 0x1a4);
          *(int *)(param_4 + 1) = (int)plVar8[0x35];
          break;
        }
        plVar7 = (longlong *)((longlong)plVar7 + 1);
        plVar4 = plVar4 + 6;
      } while ((longlong)plVar7 < 2);
    }
    FUN_1400d1290(uVar3);
    uVar3 = 1;
  }
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

longlong * FUN_1401510b0(longlong param_1,longlong *param_2)

{
  int *piVar1;
  char cVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined *puVar5;
  undefined1 auStack_128 [32];
  undefined4 local_108;
  undefined4 uStack_104;
  undefined *local_100;
  undefined2 local_f8;
  undefined8 local_f0;
  undefined1 local_e8;
  undefined8 local_e0;
  undefined1 local_d8 [16];
  undefined1 local_c8 [16];
  undefined1 *local_b8;
  undefined1 local_b0 [136];
  ulonglong local_28;
  
  local_e0 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_128;
  local_108 = 0;
  plVar4 = *(longlong **)(param_1 + 0x6a0);
  if ((plVar4 == (longlong *)0x0) || (*plVar4 == 0)) {
    FUN_1400a3440();
    *param_2 = (longlong)PTR_DAT_1402f8008;
    FUN_1400223a0(param_2,&DAT_140314250);
    *(undefined2 *)(param_2 + 1) = DAT_140314258;
  }
  else {
    uVar3 = FUN_1400a7e50(*plVar4,local_d8);
    FUN_1400a7310(&local_100,uVar3);
    uVar3 = FUN_1400a7ad0(local_c8);
    plVar4 = (longlong *)FUN_1400a7220(uVar3,&local_108);
    puVar5 = (undefined *)*plVar4;
    if ((undefined *)*plVar4 == (undefined *)0x0) {
      puVar5 = PTR_DAT_1402f8008;
    }
    FUN_1400a7540(&local_100,puVar5);
    puVar5 = (undefined *)CONCAT44(uStack_104,local_108);
    if (((puVar5 != (undefined *)0x0) && (puVar5 != PTR_DAT_1402f8008)) &&
       (puVar5 + -8 != (undefined *)0x0)) {
      uVar3 = FUN_1400a3440();
      local_f0 = uVar3;
      FUN_1400a1c30(uVar3);
      local_e8 = 1;
      piVar1 = (int *)(puVar5 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar5 + -8);
      }
      FUN_1400d1290(uVar3);
    }
    puVar5 = *(undefined **)(param_1 + 0x170);
    if (*(undefined **)(param_1 + 0x170) == (undefined *)0x0) {
      puVar5 = PTR_DAT_1402f8008;
    }
    FUN_1400a7540(&local_100,puVar5);
    puVar5 = *(undefined **)(param_1 + 0x168);
    if (*(undefined **)(param_1 + 0x168) == (undefined *)0x0) {
      puVar5 = PTR_DAT_1402f8008;
    }
    FUN_1400a7540(&local_100,puVar5);
    cVar2 = FUN_1400a7960(&local_100);
    if (cVar2 == '\0') {
      plVar4 = (longlong *)FUN_1400a7580(&local_108);
      puVar5 = (undefined *)*plVar4;
      if ((undefined *)*plVar4 == (undefined *)0x0) {
        puVar5 = PTR_DAT_1402f8010;
      }
      local_b8 = local_b0;
      FUN_1400a1e40(&local_b8,puVar5,3);
      FUN_1400a2120(&local_100,local_b8);
      if (local_b8 != local_b0) {
        free(local_b8);
      }
      puVar5 = (undefined *)CONCAT44(uStack_104,local_108);
      if (((puVar5 != (undefined *)0x0) && (puVar5 != PTR_DAT_1402f8010)) &&
         (puVar5 + -8 != (undefined *)0x0)) {
        uVar3 = FUN_1400a3440();
        local_f0 = uVar3;
        FUN_1400a1c30(uVar3);
        local_e8 = 1;
        piVar1 = (int *)(puVar5 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar5 + -8);
        }
        FUN_1400d1290(uVar3);
      }
    }
    FUN_1400a3440();
    puVar5 = PTR_DAT_1402f8008;
    *param_2 = (longlong)PTR_DAT_1402f8008;
    if (puVar5 == (undefined *)0x0) {
      *param_2 = (longlong)PTR_DAT_1402f8008;
    }
    if (local_100 != (undefined *)*param_2) {
      uVar3 = FUN_1400a3440();
      local_f0 = uVar3;
      FUN_1400a1c30(uVar3);
      local_e8 = 1;
      FUN_14000c2a0(param_2);
      *param_2 = (longlong)local_100;
      if (((local_100 != PTR_DAT_1402f8008) && (local_100 != (undefined *)0x0)) &&
         (local_100 != (undefined *)0x8)) {
        *(int *)(local_100 + -4) = *(int *)(local_100 + -4) + 1;
      }
      FUN_1400d1290(uVar3);
    }
    *(undefined2 *)(param_2 + 1) = local_f8;
    if (((local_100 != (undefined *)0x0) && (local_100 != PTR_DAT_1402f8008)) &&
       (local_100 + -8 != (undefined *)0x0)) {
      uVar3 = FUN_1400a3440();
      local_f0 = uVar3;
      FUN_1400a1c30(uVar3);
      local_e8 = 1;
      piVar1 = (int *)(local_100 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(local_100 + -8);
      }
      FUN_1400d1290(uVar3);
    }
  }
  return param_2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401513b0(undefined8 param_1,longlong *param_2,double param_3)

{
  undefined4 uVar1;
  undefined8 uVar2;
  longlong lVar3;
  undefined1 auStack_d78 [32];
  undefined8 local_d58;
  undefined8 uStack_d50;
  undefined1 local_d48;
  undefined4 local_d44;
  undefined1 local_d40;
  undefined1 local_d3f;
  undefined1 local_d38 [8];
  longlong local_d30;
  longlong local_d28;
  undefined4 local_d20;
  int local_d1c;
  undefined8 local_d10;
  undefined1 local_d08;
  undefined8 local_d00;
  undefined1 local_cf8 [80];
  undefined4 local_ca8;
  uint uStack_ca4;
  undefined4 uStack_ca0;
  undefined4 uStack_c9c;
  undefined4 *local_28;
  undefined4 local_20;
  int local_1c;
  ulonglong local_18;
  
  local_d00 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_d78;
  if (((DAT_1402f80f8 * 1.5 < param_3 - (double)param_2[0x37]) &&
      (param_3 - (double)param_2[0x33] < DAT_1402f80f8)) &&
     (DAT_1402f80f8 < param_3 - (double)param_2[0x34])) {
    param_2[0x34] = (longlong)param_3;
    FUN_140185560(local_d38);
    FUN_140185030(local_d38);
    FUN_14003c9e0(local_d38,0x1d);
    uVar2 = (**(code **)(param_2[0x21] + 0x10))();
    local_d10 = uVar2;
    FUN_1400a1c30(uVar2);
    local_d08 = 1;
    local_1c = 200;
    local_20 = 0;
    local_28 = &local_ca8;
    if (local_d30 == 0) {
      if (local_d28 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
    }
    else {
      local_d20 = *(undefined4 *)(local_d30 + 0x18);
    }
    lVar3 = local_d28;
    if (local_d28 == 0) {
      if (local_d30 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      lVar3 = 0;
      if (*(int *)(local_d30 + 0x18) != 0) {
        lVar3 = *(longlong *)(local_d30 + 0x10);
      }
    }
    local_20 = 1;
    local_d58._0_4_ = (undefined4)lVar3;
    local_d58._4_4_ = (uint)((ulonglong)lVar3 >> 0x20);
    local_ca8 = (undefined4)local_d58;
    uStack_ca4 = local_d58._4_4_;
    uStack_c9c = uStack_d50._4_4_;
    local_d58 = (longlong *)((ulonglong)local_d58._4_4_ << 0x20);
    uStack_d50 = 0;
    local_d48 = 1;
    local_d44 = 0xffffffff;
    local_d40 = 1;
    local_d3f = DAT_1402f81cc;
    uStack_ca0 = local_d20;
    uVar1 = (**(code **)(*param_2 + 0x10))(param_2);
    FUN_1401a2c20(param_2 + 0xe0,uVar1,&local_ca8,&local_d58);
    if (local_28 == (undefined4 *)0x0) {
      FUN_1400a2320(local_cf8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_cf8,(ThrowInfo *)&DAT_1402f4860);
    }
    if (local_1c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_1400d1290(uVar2);
    local_d58 = &local_d30;
    FUN_14019a730(&local_d30);
    if ((local_d28 != 0) && (local_d1c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
  }
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401515f0(longlong param_1,undefined4 *param_2)

{
  undefined4 uVar1;
  longlong lVar2;
  undefined1 uVar3;
  char cVar4;
  undefined4 *puVar5;
  longlong lVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  undefined1 *puVar9;
  undefined1 *puVar10;
  int iVar11;
  ulonglong uVar12;
  longlong *plVar13;
  ulonglong uVar14;
  longlong *plVar15;
  double dVar16;
  undefined8 uVar17;
  double dVar18;
  undefined1 auStack_d8 [32];
  undefined4 local_b8;
  longlong local_a8;
  longlong local_a0;
  double local_98;
  ulonglong local_90;
  undefined4 *local_88;
  longlong *local_80;
  undefined8 local_60;
  ulonglong local_58;
  
  puVar10 = auStack_d8;
  puVar9 = auStack_d8;
  local_60 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)&local_a8;
  dVar16 = (double)(**(code **)(*(longlong *)(param_1 + 0x118) + 8))();
  local_98 = dVar16;
  if ((*(longlong *)(param_2 + 10) == 0) || (*(char *)(param_2 + 0x22) == '\0')) {
    FUN_1401433c0(param_2 + 0x18,0);
    goto LAB_140151bae;
  }
  local_88 = param_2 + 2;
  uVar12 = 0;
  uVar7 = uVar12;
  if (*(longlong *)(param_2 + 10) != 0) {
    uVar7 = *(ulonglong *)(param_2 + 6);
  }
  while (uVar14 = uVar7, local_90 = uVar14, uVar14 != 0) {
    if (uVar14 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    local_80 = *(longlong **)(uVar14 + 8);
    local_a0 = 0;
    local_b8 = 0;
    lVar6 = __RTDynamicCast(*(undefined8 *)(uVar14 + 0x10),0,
                            &Proud::CP2PGroupMemberBase_S::RTTI_Type_Descriptor,
                            &Proud::CRemoteClient_S::RTTI_Type_Descriptor);
    local_a0 = lVar6;
    if ((lVar6 != 0) &&
       ((((*(double *)(lVar6 + 0x1b0) == 0.0 || ((int)param_2[0x1e] < 1)) ||
         (**(int **)(param_2 + 0x1c) != *(int *)(lVar6 + 0x6f8))) ||
        (*(char *)(lVar6 + 0x700) == '\0')))) {
      *(undefined8 *)(lVar6 + 0x1b0) = 0;
      if (*(char *)(lVar6 + 0x700) != '\0') {
        *(double *)(lVar6 + 0x1b0) = *(double *)(param_2 + 0x24) + 0.0;
      }
      cVar4 = FUN_14019a8e0(lVar6);
      if (cVar4 == '\0') {
        *(double *)(lVar6 + 0x1b0) = *(double *)(param_2 + 0x26) + *(double *)(lVar6 + 0x1b0);
      }
      dVar18 = *(double *)(lVar6 + 0x1b0) - *(double *)(lVar6 + 0x1c8) * *(double *)(param_2 + 0x28)
      ;
      *(double *)(lVar6 + 0x1b0) = dVar18;
      *(double *)(lVar6 + 0x1b0) = *(double *)(lVar6 + 0x1e0) * *(double *)(param_2 + 0x2e) + dVar18
      ;
      dVar18 = (double)FUN_14019b650(lVar6);
      if (0.0 <= dVar18) {
        dVar18 = (double)FUN_14019b650(lVar6);
      }
      else {
        dVar18 = 0.0;
      }
      dVar18 = *(double *)(lVar6 + 0x1b0) - dVar18 * *(double *)(param_2 + 0x2a);
      *(double *)(lVar6 + 0x1b0) = dVar18;
      *(double *)(lVar6 + 0x1b0) =
           *(double *)(lVar6 + 400) * *(double *)(param_2 + 0x2c) * 10485760.0 + dVar18;
      if ((0.0 < *(double *)(param_2 + 0x30)) &&
         (dVar16 - (double)local_80 < *(double *)(param_2 + 0x30))) {
        *(undefined8 *)(lVar6 + 0x1b0) = 0xc65c662460d49e87;
      }
    }
    uVar7 = uVar12;
    if (uVar14 != 0) {
      uVar7 = *(ulonglong *)(uVar14 + 0x18);
    }
  }
  lVar6 = *(longlong *)(param_2 + 10);
  if (lVar6 * 0x18 + 0x10U < 0x401) {
    uVar7 = lVar6 * 0x18 + 0x1f;
    if (uVar7 <= lVar6 * 0x18 + 0x10U) {
      uVar7 = 0xffffffffffffff0;
    }
    lVar6 = -(uVar7 & 0xfffffffffffffff0);
    puVar9 = auStack_d8 + lVar6;
    puVar5 = (undefined4 *)((longlong)&local_a8 + lVar6);
    plVar13 = (longlong *)0x0;
    puVar10 = auStack_d8 + lVar6;
    if (puVar5 != (undefined4 *)0x0) {
      *puVar5 = 0xcccc;
LAB_140151727:
      plVar13 = (longlong *)(puVar5 + 4);
      puVar10 = puVar9;
    }
  }
  else {
    puVar5 = malloc(lVar6 * 0x18 + 0x10);
    plVar13 = (longlong *)0x0;
    puVar10 = auStack_d8;
    if (puVar5 != (undefined4 *)0x0) {
      *puVar5 = 0xdddd;
      goto LAB_140151727;
    }
  }
  local_a8._0_4_ = 0;
  local_88 = param_2 + 2;
  uVar7 = uVar12;
  uVar14 = uVar12;
  local_80 = plVar13;
  if (*(longlong *)(param_2 + 10) != 0) {
    uVar7 = *(ulonglong *)(param_2 + 6);
  }
  while (uVar8 = uVar7, iVar11 = (int)uVar14, local_90 = uVar8, uVar8 != 0) {
    local_a0 = 0;
    if (uVar8 == 0) {
                    // WARNING: Subroutine does not return
      *(undefined8 *)(puVar10 + -8) = 0x140151931;
      FUN_14000c6c0(0x80004005);
    }
    *(undefined4 *)(puVar10 + 0x20) = 0;
    uVar17 = *(undefined8 *)(uVar8 + 0x10);
    *(undefined8 *)(puVar10 + -8) = 0x14015194e;
    local_a0 = __RTDynamicCast(uVar17,0,&Proud::CP2PGroupMemberBase_S::RTTI_Type_Descriptor,
                               &Proud::CRemoteClient_S::RTTI_Type_Descriptor);
    if (local_a0 != 0) {
      lVar6 = (longlong)iVar11;
      plVar13[lVar6 * 3] = local_a0;
      plVar13[lVar6 * 3 + 1] = (longlong)param_2;
      if (uVar8 == 0) {
                    // WARNING: Subroutine does not return
        *(undefined **)(puVar10 + -8) = &UNK_14015199d;
        FUN_14000c6c0(0x80004005);
      }
      plVar13[lVar6 * 3 + 2] = (longlong)(dVar16 - *(double *)(uVar8 + 8));
      local_a8._0_4_ = iVar11 + 1;
      uVar14 = (ulonglong)(uint)local_a8;
    }
    uVar7 = uVar12;
    if (uVar8 != 0) {
      uVar7 = *(ulonglong *)(uVar8 + 0x18);
    }
  }
  *(undefined8 *)(puVar10 + -8) = 0x140151775;
  FUN_140149220(plVar13,uVar14,0);
  *(undefined8 *)(puVar10 + -8) = 0x140151781;
  FUN_1401433c0(param_2 + 0x18,uVar14);
  local_a8 = 0;
  local_98 = (double)(longlong)iVar11;
  uVar7 = uVar12;
  plVar15 = plVar13;
  if (0 < iVar11) {
    do {
      if ((local_a8 < 0) || (iVar11 = (int)uVar12, (int)param_2[0x1e] <= iVar11)) {
                    // WARNING: Subroutine does not return
        *(undefined **)(puVar10 + -8) = &UNK_1401518f2;
        FUN_1400a2700();
      }
      *(undefined4 *)(uVar7 + *(longlong *)(param_2 + 0x1c)) = *(undefined4 *)(*plVar15 + 0x6f8);
      if ((int)param_2[0x1e] <= iVar11) {
                    // WARNING: Subroutine does not return
        *(undefined **)(puVar10 + -8) = &UNK_1401518ec;
        FUN_1400a2700();
      }
      *(undefined8 *)(*(longlong *)(param_2 + 0x1c) + 8 + uVar7) = *(undefined8 *)(*plVar15 + 0x1b0)
      ;
      if ((int)param_2[0x1e] <= iVar11) {
                    // WARNING: Subroutine does not return
        *(undefined **)(puVar10 + -8) = &UNK_1401518e6;
        FUN_1400a2700();
      }
      *(undefined1 *)(*(longlong *)(param_2 + 0x1c) + 0x10 + uVar7) =
           *(undefined1 *)(*plVar15 + 0x700);
      if ((int)param_2[0x1e] <= iVar11) {
                    // WARNING: Subroutine does not return
        *(undefined **)(puVar10 + -8) = &UNK_1401518e0;
        FUN_1400a2700();
      }
      lVar6 = *(longlong *)(param_2 + 0x1c);
      lVar2 = *plVar15;
      *(undefined8 *)(puVar10 + -8) = 0x140151814;
      uVar3 = FUN_14019a8e0(lVar2);
      *(undefined1 *)(uVar7 + 0x11 + lVar6) = uVar3;
      if ((int)param_2[0x1e] <= iVar11) {
                    // WARNING: Subroutine does not return
        *(undefined **)(puVar10 + -8) = &UNK_1401518da;
        FUN_1400a2700();
      }
      *(undefined8 *)(*(longlong *)(param_2 + 0x1c) + 0x18 + uVar7) =
           *(undefined8 *)(*plVar15 + 0x1c8);
      if ((int)param_2[0x1e] <= iVar11) {
                    // WARNING: Subroutine does not return
        *(undefined **)(puVar10 + -8) = &UNK_1401518d4;
        FUN_1400a2700();
      }
      lVar6 = *(longlong *)(param_2 + 0x1c);
      uVar1 = *param_2;
      lVar2 = *plVar15;
      *(undefined8 *)(puVar10 + -8) = 0x140151850;
      uVar17 = FUN_14019b650(lVar2,uVar1);
      *(undefined8 *)(uVar7 + 0x20 + lVar6) = uVar17;
      if ((int)param_2[0x1e] <= iVar11) {
                    // WARNING: Subroutine does not return
        *(undefined **)(puVar10 + -8) = &UNK_1401518ce;
        FUN_1400a2700();
      }
      *(undefined8 *)(*(longlong *)(param_2 + 0x1c) + 0x28 + uVar7) =
           *(undefined8 *)(*plVar15 + 400);
      if ((int)param_2[0x1e] <= iVar11) {
                    // WARNING: Subroutine does not return
        *(undefined **)(puVar10 + -8) = &UNK_1401518c8;
        FUN_1400a2700();
      }
      *(longlong *)(*(longlong *)(param_2 + 0x1c) + 0x30 + uVar7) = plVar15[2];
      if ((int)param_2[0x1e] <= iVar11) {
                    // WARNING: Subroutine does not return
        *(undefined **)(puVar10 + -8) = &UNK_1401518c2;
        FUN_1400a2700();
      }
      *(undefined8 *)(*(longlong *)(param_2 + 0x1c) + 0x38 + uVar7) =
           *(undefined8 *)(*plVar15 + 0x1e0);
      uVar12 = (ulonglong)(iVar11 + 1);
      local_a8 = local_a8 + 1;
      uVar7 = uVar7 + 0x40;
      plVar15 = plVar15 + 3;
    } while (local_a8 < (longlong)local_98);
  }
  if ((plVar13 != (longlong *)0x0) && ((int)plVar13[-2] == 0xdddd)) {
    *(undefined8 *)(puVar10 + -8) = 0x140151912;
    free(plVar13 + -2);
  }
LAB_140151bae:
  *(undefined8 *)(puVar10 + -8) = 0x140151bba;
  return;
}



void FUN_140151bf0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  if (*(longlong *)(param_2 + 0x68) == 0) {
    lVar1 = 0;
  }
  else {
    lVar1 = *(longlong *)(param_2 + 0x58);
  }
  while (lVar1 != 0) {
    if (*(undefined8 **)(lVar1 + 8) == (undefined8 *)0x0) {
      FUN_1401515f0(param_1,0);
      lVar1 = *(longlong *)(lVar1 + 0x10);
    }
    else {
      FUN_1401515f0(param_1,**(undefined8 **)(lVar1 + 8));
      lVar1 = *(longlong *)(lVar1 + 0x10);
    }
  }
  return;
}



void FUN_140151c50(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  uVar1 = (**(code **)(*param_1 + 0x58))();
  uVar2 = uVar1;
  FUN_1400a1c30(uVar1);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))
              (param_1,L"Proud::CNetServerImpl::ElectSuperPeer",*param_1,param_4,uVar4,uVar2,1);
  }
  if (param_1[0x84] == 0) {
    lVar3 = 0;
  }
  else {
    lVar3 = param_1[0x82];
  }
  for (; lVar3 != 0; lVar3 = *(longlong *)(lVar3 + 0x10)) {
    if (*(undefined8 **)(lVar3 + 8) == (undefined8 *)0x0) {
      uVar2 = 0;
    }
    else {
      uVar2 = **(undefined8 **)(lVar3 + 8);
    }
    FUN_1401515f0(param_1,uVar2);
  }
  FUN_1400d1290(uVar1);
  return;
}



void FUN_140151d00(longlong param_1)

{
  undefined *puVar1;
  undefined8 uVar2;
  undefined *local_res8;
  
  puVar1 = *(undefined **)(param_1 + 0x1808);
  if (((puVar1 != (undefined *)0x0) && (puVar1 != PTR_DAT_1402f8010)) &&
     (*(int *)(puVar1 + -8) != 0)) {
    FUN_1400a3440();
    local_res8 = PTR_DAT_1402f8010;
    FUN_140003100(&local_res8,param_1 + 0x1808);
    FUN_1400a6370(&local_res8);
  }
  uVar2 = (**(code **)(*(longlong *)(param_1 + 0x118) + 8))();
  *(undefined4 *)(param_1 + 0x1804) = 0;
  *(undefined8 *)(param_1 + 0x1810) = uVar2;
  FUN_14001f680(param_1 + 0x1808,&DAT_14027d1a0);
  LOCK();
  *(undefined4 *)(param_1 + 0x1840) = 0;
  UNLOCK();
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140151da0(longlong param_1,longlong param_2,undefined8 *param_3)

{
  longlong lVar1;
  longlong lVar2;
  double dVar3;
  longlong local_res20;
  
  dVar3 = (double)(**(code **)(*(longlong *)(param_1 + 0x118) + 8))();
  lVar1 = 0;
  if (*(longlong *)(param_2 + 0x28) != 0) {
    lVar1 = *(longlong *)(param_2 + 0x18);
  }
  while( true ) {
    lVar2 = lVar1;
    if (lVar2 == 0) {
      *(undefined8 *)(param_2 + 0x90) = *param_3;
      *(undefined8 *)(param_2 + 0x98) = param_3[1];
      *(undefined8 *)(param_2 + 0xa0) = param_3[2];
      *(undefined8 *)(param_2 + 0xa8) = param_3[3];
      *(undefined8 *)(param_2 + 0xb0) = param_3[4];
      *(undefined8 *)(param_2 + 0xb8) = param_3[5];
      *(undefined8 *)(param_2 + 0xc0) = param_3[6];
      *(undefined1 *)(param_2 + 0x88) = 1;
      if ((*(int *)(param_2 + 0x78) == 0) && (*(longlong *)(param_2 + 0x28) != 0)) {
        FUN_1401515f0(param_1,param_2);
      }
      return;
    }
    local_res20 = 0;
    if (lVar2 == 0) break;
    lVar1 = __RTDynamicCast(*(undefined8 *)(lVar2 + 0x10),0,
                            &Proud::CP2PGroupMemberBase_S::RTTI_Type_Descriptor,
                            &Proud::CRemoteClient_S::RTTI_Type_Descriptor,0);
    if (((lVar1 != 0) && (*(double *)(lVar1 + 0x188) == 0.0)) ||
       (local_res20 = lVar1, _DAT_1402f8158 < dVar3 - *(double *)(lVar1 + 0x188))) {
      *(double *)(lVar1 + 0x188) = dVar3;
      local_res20._1_7_ = (uint7)((ulonglong)lVar1 >> 8);
      local_res20 = CONCAT71(local_res20._1_7_,1);
      if ((double)param_3[4] <= 0.0) {
        local_res20 = (ulonglong)local_res20._1_7_ << 8;
      }
      (**(code **)(*(longlong *)(param_1 + 0x4a8) + 0x130))
                ((longlong *)(param_1 + 0x4a8),*(undefined4 *)(lVar1 + 0x6f8),&DAT_140318cf0,
                 &local_res20);
    }
    lVar1 = 0;
    if (lVar2 != 0) {
      lVar1 = *(longlong *)(lVar2 + 0x18);
    }
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



void FUN_140151fd0(longlong param_1,undefined8 *param_2,int param_3,undefined4 *param_4)

{
  undefined8 *_Dst;
  longlong lVar1;
  longlong *plVar2;
  ulonglong uVar3;
  size_t _Size;
  ulonglong uVar4;
  undefined4 local_60;
  undefined4 local_5c;
  undefined *local_58;
  undefined4 local_50;
  undefined4 local_4c;
  undefined **local_48;
  longlong *local_40;
  undefined8 *local_38;
  undefined8 local_30;
  undefined8 local_28;
  
  if (*(longlong *)(param_1 + 0x58) != 0) {
    local_48 = Proud::CFastArray<>::vftable;
    local_40 = (longlong *)0x0;
    local_38 = (undefined8 *)0x0;
    local_30 = 0;
    local_28 = 0;
    FUN_140021fb0(&local_48,param_3);
    _Dst = local_38;
    if ((int)local_30 == 0) {
      _Dst = (undefined8 *)0x0;
    }
    _Size = (longlong)param_3 << 2;
    if (_Size < 0x21) {
      uVar3 = (ulonglong)((uint)_Size & 7);
      for (uVar4 = _Size >> 3; uVar4 != 0; uVar4 = uVar4 - 1) {
        *_Dst = *param_2;
        _Dst = _Dst + 1;
        param_2 = param_2 + 1;
      }
      if (uVar3 != 0) {
        lVar1 = (longlong)_Dst - (longlong)param_2;
        do {
          *(undefined1 *)(lVar1 + (longlong)param_2) = *(undefined1 *)param_2;
          param_2 = (undefined8 *)((longlong)param_2 + 1);
          uVar3 = uVar3 - 1;
        } while (uVar3 != 0);
      }
    }
    else {
      memcpy(_Dst,param_2,_Size);
    }
    FUN_1400a3440();
    local_58 = PTR_DAT_1402f8010;
    local_60 = *param_4;
    local_5c = param_4[1];
    FUN_14001f680(&local_58,*(undefined8 *)(param_4 + 2));
    local_50 = param_4[4];
    local_4c = param_4[5];
    plVar2 = (longlong *)(*(longlong *)(param_1 + 0x58) + 0x68);
    (**(code **)(*plVar2 + 0x40))(plVar2,1,&DAT_140318cf0,&local_48,&local_60);
    FUN_1400031d0(&local_58);
    local_48 = Proud::CFastArray<>::vftable;
    if (local_38 != (undefined8 *)0x0) {
      if (local_40 == (longlong *)0x0) {
        FUN_1400a3530(local_38);
      }
      else {
        (**(code **)(*local_40 + 0x18))();
      }
    }
  }
  return;
}



void FUN_140152150(longlong param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4)

{
  uint uVar1;
  uint uVar2;
  uint *puVar3;
  undefined8 uVar4;
  longlong *plVar5;
  uint *puVar6;
  uint uVar7;
  uint uVar8;
  uint uVar9;
  undefined4 local_res8 [2];
  undefined4 local_res10 [2];
  uint *local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined1 local_30;
  
  local_40 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x58) == 0) {
    return;
  }
  local_res8[0] = param_3;
  local_res10[0] = param_2;
  FUN_1400a3440();
  local_48 = (uint *)PTR_DAT_1402f8010;
  uVar1 = FUN_1400a32c0(param_4);
  uVar9 = 0;
  uVar7 = 0;
  if ((local_48 != (uint *)0x0) && (uVar7 = 0, local_48 != (uint *)PTR_DAT_1402f8010)) {
    uVar7 = local_48[-2];
  }
  uVar2 = uVar1;
  if ((((int)uVar1 <= (int)uVar7) && (uVar2 = uVar9, local_48 != (uint *)0x0)) &&
     (local_48 != (uint *)PTR_DAT_1402f8010)) {
    uVar2 = local_48[-2];
  }
  uVar7 = 1;
  if (1 < (int)uVar2) {
    uVar7 = uVar2;
  }
  uVar2 = uVar9;
  if ((local_48 != (uint *)0x0) && (local_48 != (uint *)PTR_DAT_1402f8010)) {
    uVar2 = local_48[-2];
  }
  uVar8 = 0;
  if ((int)uVar2 < (int)uVar7) {
    if (local_48 == (uint *)0x0) {
      local_48 = (uint *)PTR_DAT_1402f8010;
    }
    if ((int)uVar7 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar7 == 0) {
      FUN_1400031d0(&local_48);
    }
    else {
      uVar2 = uVar9;
      if ((local_48 != (uint *)0x0) && (local_48 != (uint *)PTR_DAT_1402f8010)) {
        uVar2 = local_48[-2];
      }
      if (uVar7 != uVar2) {
        puVar3 = (uint *)FUN_1400a34c0((longlong)(int)uVar7 * 2 + 10);
        if (puVar3 != (uint *)0x0) {
          *puVar3 = 0;
          puVar3[1] = 1;
        }
        *puVar3 = uVar7;
        uVar2 = uVar8;
        if ((local_48 != (uint *)0x0) && (local_48 != (uint *)PTR_DAT_1402f8010)) {
          uVar2 = local_48[-2];
        }
        puVar6 = (uint *)PTR_DAT_1402f8010;
        if ((int)uVar7 < (int)uVar2) {
LAB_140152280:
          if (local_48 != (uint *)0x0) {
            puVar6 = local_48;
          }
        }
        else {
          uVar7 = uVar9;
          if (local_48 != (uint *)0x0) {
            if (local_48 != (uint *)PTR_DAT_1402f8010) {
              uVar7 = local_48[-2];
            }
            goto LAB_140152280;
          }
        }
        FUN_1400a32f0(puVar3 + 2,puVar6,uVar7);
        FUN_1400031d0(&local_48);
        local_48 = puVar3 + 2;
      }
    }
  }
  FUN_140002e30(&local_48);
  puVar3 = local_48;
  if (local_48 == (uint *)0x0) {
    puVar3 = (uint *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar3,param_4,uVar1);
  puVar3 = local_48;
  if (local_48 == (uint *)0x0) {
    puVar3 = (uint *)PTR_DAT_1402f8010;
  }
  uVar1 = FUN_1400a32c0(puVar3);
  uVar7 = 0;
  if (0 < (int)uVar1) {
    uVar7 = uVar1;
  }
  uVar1 = uVar8;
  if ((local_48 != (uint *)0x0) && (local_48 != (uint *)PTR_DAT_1402f8010)) {
    uVar1 = local_48[-2];
  }
  if (((int)uVar1 <= (int)uVar7) && (uVar7 = uVar8, local_48 != (uint *)0x0)) {
    if (local_48 == (uint *)PTR_DAT_1402f8010) goto LAB_140152337;
    uVar7 = local_48[-2];
  }
  if (((local_48 != (uint *)PTR_DAT_1402f8010) && (local_48 != (uint *)0x0)) &&
     (local_48 + -2 != (uint *)0x0)) {
    local_48[-2] = uVar7;
    *(undefined2 *)((longlong)local_48 + (longlong)(int)uVar7 * 2) = 0;
  }
LAB_140152337:
  plVar5 = (longlong *)(*(longlong *)(param_1 + 0x58) + 0x68);
  (**(code **)(*plVar5 + 0x50))(plVar5,1,&DAT_140318cf0,local_res10,&local_48,local_res8);
  puVar3 = local_48;
  if (((local_48 != (uint *)0x0) && (local_48 != (uint *)PTR_DAT_1402f8010)) &&
     (puVar6 = local_48 + -2, puVar6 != (uint *)0x0)) {
    uVar4 = FUN_1400a3440();
    local_38 = uVar4;
    FUN_1400a1c30(uVar4);
    local_30 = 1;
    puVar3 = puVar3 + -1;
    *puVar3 = *puVar3 - 1;
    if (*puVar3 == 0) {
      FUN_1400a3530(puVar6);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



void FUN_1401523e0(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  undefined4 uVar2;
  longlong lVar3;
  undefined8 *puVar4;
  longlong *plVar5;
  undefined8 uVar6;
  undefined8 *puVar7;
  longlong lVar8;
  longlong lVar9;
  longlong lVar10;
  longlong lVar11;
  longlong lVar12;
  int iVar13;
  longlong lVar14;
  int iVar15;
  undefined8 uVar16;
  undefined4 uStack_3c;
  
  uVar16 = 0xfffffffffffffffe;
  uVar6 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_1400a1c30(uVar6);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
              (param_1 + -0xa8,L"Proud::CNetServerImpl::GetUserWorkerThreadInfo",
               *(longlong *)(param_1 + -0xa8),param_4,uVar16,uVar6,1);
  }
  lVar3 = *(longlong *)(param_1 + 0x338);
  iVar15 = 0;
  iVar1 = *(int *)(lVar3 + 0x78);
  lVar11 = 0;
  if (0 < iVar1) {
    do {
      if ((lVar11 < 0) || (iVar1 <= iVar15)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      puVar4 = *(undefined8 **)(*(longlong *)(lVar3 + 0x70) + lVar11 * 8);
      puVar7 = (undefined8 *)0x0;
      if (puVar4 != (undefined8 *)0x0) {
        puVar7 = (undefined8 *)*puVar4;
      }
      uVar16 = *puVar7;
      if (iVar1 <= iVar15) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      plVar5 = *(longlong **)(*(longlong *)(lVar3 + 0x70) + lVar11 * 8);
      if (plVar5 == (longlong *)0x0) {
        lVar10 = 0;
      }
      else {
        lVar10 = *plVar5;
      }
      uVar2 = *(undefined4 *)(lVar10 + 8);
      iVar1 = *(int *)(param_2 + 0x18);
      lVar10 = (longlong)iVar1;
      if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      iVar13 = *(int *)(param_2 + 0x18);
      FUN_140144d20(param_2,iVar13 + 1);
      iVar13 = iVar13 - iVar1;
      if ((0 < iVar13) && (iVar13 = iVar13 + -1, lVar12 = (longlong)iVar13, -1 < iVar13)) {
        lVar14 = (lVar12 + 1 + lVar10) * 0x10;
        do {
          lVar8 = FUN_1401b2160(param_2);
          lVar9 = FUN_1401b2160(param_2);
          *(undefined8 *)(lVar9 + lVar14) = *(undefined8 *)(lVar8 + -0x10 + lVar14);
          *(undefined8 *)(lVar9 + 8 + lVar14) = *(undefined8 *)(lVar8 + -8 + lVar14);
          lVar14 = lVar14 + -0x10;
          lVar12 = lVar12 + -1;
        } while (-1 < lVar12);
      }
      lVar12 = FUN_1401b2160(param_2);
      *(ulonglong *)(lVar12 + lVar10 * 0x10) = CONCAT44(uStack_3c,uVar2);
      *(undefined8 *)(lVar12 + 8 + lVar10 * 0x10) = uVar16;
      iVar15 = iVar15 + 1;
      lVar11 = lVar11 + 1;
      iVar1 = *(int *)(lVar3 + 0x78);
    } while (iVar15 < iVar1);
  }
  FUN_1400d1290(uVar6);
  return;
}



void FUN_1401525a0(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  undefined4 uVar2;
  longlong lVar3;
  undefined8 *puVar4;
  longlong *plVar5;
  undefined8 uVar6;
  undefined8 *puVar7;
  longlong lVar8;
  longlong lVar9;
  longlong lVar10;
  longlong lVar11;
  longlong lVar12;
  int iVar13;
  longlong lVar14;
  int iVar15;
  undefined8 uVar16;
  undefined4 uStack_3c;
  
  uVar16 = 0xfffffffffffffffe;
  uVar6 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_1400a1c30(uVar6);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
              (param_1 + -0xa8,L"Proud::CNetServerImpl::GetNetWorkerThreadInfo",
               *(longlong *)(param_1 + -0xa8),param_4,uVar16,uVar6,1);
  }
  lVar3 = *(longlong *)(param_1 + 0x338);
  iVar15 = 0;
  iVar1 = *(int *)(lVar3 + 0x50);
  lVar11 = 0;
  if (0 < iVar1) {
    do {
      if ((lVar11 < 0) || (iVar1 <= iVar15)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      puVar4 = *(undefined8 **)(*(longlong *)(lVar3 + 0x48) + lVar11 * 8);
      puVar7 = (undefined8 *)0x0;
      if (puVar4 != (undefined8 *)0x0) {
        puVar7 = (undefined8 *)*puVar4;
      }
      uVar16 = *puVar7;
      if (iVar1 <= iVar15) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      plVar5 = *(longlong **)(*(longlong *)(lVar3 + 0x48) + lVar11 * 8);
      if (plVar5 == (longlong *)0x0) {
        lVar10 = 0;
      }
      else {
        lVar10 = *plVar5;
      }
      uVar2 = *(undefined4 *)(lVar10 + 8);
      iVar1 = *(int *)(param_2 + 0x18);
      lVar10 = (longlong)iVar1;
      if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      iVar13 = *(int *)(param_2 + 0x18);
      FUN_140144d20(param_2,iVar13 + 1);
      iVar13 = iVar13 - iVar1;
      if ((0 < iVar13) && (iVar13 = iVar13 + -1, lVar12 = (longlong)iVar13, -1 < iVar13)) {
        lVar14 = (lVar12 + 1 + lVar10) * 0x10;
        do {
          lVar8 = FUN_1401b2160(param_2);
          lVar9 = FUN_1401b2160(param_2);
          *(undefined8 *)(lVar9 + lVar14) = *(undefined8 *)(lVar8 + -0x10 + lVar14);
          *(undefined8 *)(lVar9 + 8 + lVar14) = *(undefined8 *)(lVar8 + -8 + lVar14);
          lVar14 = lVar14 + -0x10;
          lVar12 = lVar12 + -1;
        } while (-1 < lVar12);
      }
      lVar12 = FUN_1401b2160(param_2);
      *(ulonglong *)(lVar12 + lVar10 * 0x10) = CONCAT44(uStack_3c,uVar2);
      *(undefined8 *)(lVar12 + 8 + lVar10 * 0x10) = uVar16;
      iVar15 = iVar15 + 1;
      lVar11 = lVar11 + 1;
      iVar1 = *(int *)(lVar3 + 0x50);
    } while (iVar15 < iVar1);
  }
  FUN_1400d1290(uVar6);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140152760(undefined8 param_1,longlong param_2)

{
  bool bVar1;
  undefined4 *puVar2;
  undefined8 uVar3;
  longlong lVar4;
  undefined1 auStack_d68 [32];
  undefined1 local_d48 [8];
  longlong local_d40;
  longlong local_d38;
  undefined4 local_d30;
  int local_d2c;
  undefined8 local_d20;
  undefined1 local_d18 [80];
  undefined8 local_cc8;
  undefined4 uStack_cc0;
  undefined4 uStack_cbc;
  undefined8 local_cb8;
  undefined1 local_cb0;
  undefined4 local_ca8;
  undefined4 uStack_ca4;
  undefined4 uStack_ca0;
  undefined4 uStack_c9c;
  undefined4 *local_28;
  undefined4 local_20;
  int local_1c;
  ulonglong local_18;
  
  local_d20 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_d68;
  local_cc8 = (longlong *)0x0;
  uStack_cc0 = 0;
  uStack_cbc = 0;
  if ((*(longlong *)(param_2 + 0x728) == 0) && (*(longlong *)(param_2 + 0x730) == 0)) {
    bVar1 = false;
  }
  else {
    bVar1 = true;
  }
  if (!bVar1) {
    puVar2 = (undefined4 *)FUN_1400aabf0(&local_cb8);
    *(undefined4 *)(param_2 + 0x728) = *puVar2;
    *(undefined4 *)(param_2 + 0x72c) = puVar2[1];
    *(undefined4 *)(param_2 + 0x730) = puVar2[2];
    *(undefined4 *)(param_2 + 0x734) = puVar2[3];
    FUN_140185560(local_d48);
    FUN_140185030(local_d48);
    FUN_1401856c0(local_d48,0x800);
    FUN_1401856c0(local_d48,0);
    FUN_14003c9e0(local_d48,0xb);
    local_cc8 = *(longlong **)(param_2 + 0x728);
    uStack_cc0 = *(undefined4 *)(param_2 + 0x730);
    uStack_cbc = *(undefined4 *)(param_2 + 0x734);
    FUN_14003cba0(local_d48,&local_cc8);
    uVar3 = (**(code **)(*(longlong *)(param_2 + 0x108) + 0x10))();
    local_cb8 = uVar3;
    FUN_1400a1c30(uVar3);
    local_cb0 = 1;
    local_1c = 200;
    local_20 = 0;
    local_28 = &local_ca8;
    if (local_d40 == 0) {
      if (local_d38 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
    }
    else {
      local_d30 = *(undefined4 *)(local_d40 + 0x18);
    }
    lVar4 = local_d38;
    if (local_d38 == 0) {
      if (local_d40 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      if (*(int *)(local_d40 + 0x18) != 0) {
        lVar4 = *(longlong *)(local_d40 + 0x10);
      }
    }
    local_20 = 1;
    local_cc8._0_4_ = (undefined4)lVar4;
    local_cc8._4_4_ = (undefined4)((ulonglong)lVar4 >> 0x20);
    local_ca8 = (undefined4)local_cc8;
    uStack_ca4 = local_cc8._4_4_;
    uStack_c9c = uStack_cbc;
    local_cc8 = (longlong *)0x0;
    uStack_cc0 = CONCAT31((int3)((uint)local_d30 >> 8),1);
    uStack_ca0 = local_d30;
    FUN_1401a12a0(*(undefined8 *)(param_2 + 0x748),&local_ca8,&local_cc8);
    if (local_28 == (undefined4 *)0x0) {
      FUN_1400a2320(local_d18,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_d18,(ThrowInfo *)&DAT_1402f4860);
    }
    if (local_1c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_1400d1290(uVar3);
    local_cc8 = &local_d40;
    FUN_14019a730(&local_d40);
    if ((local_d38 != 0) && (local_d2c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140152a1b)
// WARNING: Removing unreachable block (ram,0x000140152a24)
// WARNING: Removing unreachable block (ram,0x000140152a42)
// WARNING: Removing unreachable block (ram,0x000140152a4b)

undefined1 * FUN_1401529c0(undefined1 *param_1)

{
  *param_1 = 0;
  *(undefined4 *)(param_1 + 0x28) = 0x11;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined4 *)(param_1 + 0x48) = 0;
  *(undefined4 *)(param_1 + 0x2c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x30) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x34) = 0x40100000;
  *(undefined8 *)(param_1 + 0x38) = 0x26;
  *(undefined8 *)(param_1 + 0x40) = 0;
  return param_1;
}



void FUN_140152a70(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  int iVar2;
  longlong *plVar3;
  undefined *puVar4;
  char cVar5;
  longlong *plVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined *puVar10;
  longlong lVar11;
  int iVar12;
  undefined *local_res8;
  undefined8 local_res10;
  undefined8 uVar13;
  
  uVar13 = 0xfffffffffffffffe;
  local_res10 = param_2;
  if (*(longlong *)(param_1 + 0x1760) == 0) {
    plVar6 = (longlong *)0x0;
  }
  else {
    plVar6 = *(longlong **)(param_1 + 0x1750);
  }
  for (; uVar8 = local_res10, plVar6 != (longlong *)0x0; plVar6 = (longlong *)plVar6[2]) {
    if (plVar6 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    lVar11 = *plVar6;
    uVar7 = (**(code **)(*(longlong *)(lVar11 + 0x108) + 0x10))();
    cVar5 = FUN_1400a1d50(uVar7);
    if (cVar5 == '\x01') {
      FUN_1400a3440();
      local_res8 = PTR_DAT_1402f8010;
      FUN_14003c600(&local_res8,L"RemoteClient DeadLock - %s",uVar8,param_4,uVar13);
      puVar4 = local_res8;
      puVar10 = local_res8;
      if (local_res8 == (undefined *)0x0) {
        puVar10 = PTR_DAT_1402f8010;
      }
      FUN_1400a2b50(puVar10);
      uVar8 = local_res10;
      if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1402f8010)) &&
         (puVar4 + -8 != (undefined *)0x0)) {
        uVar8 = FUN_1400a3440();
        FUN_1400a1c30(uVar8);
        piVar1 = (int *)(puVar4 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar4 + -8);
        }
        FUN_1400d1290(uVar8);
        uVar8 = local_res10;
      }
    }
    if (((*(int *)(param_1 + 0x1844) == 0) &&
        (plVar3 = *(longlong **)(lVar11 + 0x760), plVar3 != (longlong *)0x0)) &&
       (lVar11 = *plVar3, lVar11 != 0)) {
      uVar7 = (**(code **)(*(longlong *)(lVar11 + 0x88) + 0x10))();
      cVar5 = FUN_1400a1d50(uVar7);
      if (cVar5 == '\x01') {
        FUN_1400a3440();
        local_res8 = PTR_DAT_1402f8010;
        FUN_14003c600(&local_res8,L"UDPSocket DeadLock - %s",uVar8);
        puVar4 = local_res8;
        puVar10 = local_res8;
        if (local_res8 == (undefined *)0x0) {
          puVar10 = PTR_DAT_1402f8010;
        }
        FUN_1400a2b50(puVar10);
        if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1402f8010)) &&
           (puVar4 + -8 != (undefined *)0x0)) {
          uVar8 = FUN_1400a3440();
          FUN_1400a1c30(uVar8);
          piVar1 = (int *)(puVar4 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(puVar4 + -8);
          }
          FUN_1400d1290(uVar8);
        }
      }
    }
  }
  uVar13 = local_res10;
  if (*(int *)(param_1 + 0x1844) == 1) {
    iVar12 = 0;
    lVar11 = 0;
    iVar2 = *(int *)(param_1 + 0x6e0);
    if (0 < (longlong)iVar2) {
      do {
        if ((lVar11 < 0) || (*(int *)(param_1 + 0x6e0) <= iVar12)) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        plVar6 = *(longlong **)(*(longlong *)(param_1 + 0x6d8) + lVar11 * 8);
        lVar9 = 0;
        if (plVar6 != (longlong *)0x0) {
          lVar9 = *plVar6;
        }
        uVar8 = (**(code **)(*(longlong *)(lVar9 + 0x88) + 0x10))();
        cVar5 = FUN_1400a1d50(uVar8);
        if (cVar5 == '\x01') {
          FUN_1400a3440();
          local_res8 = PTR_DAT_1402f8010;
          FUN_14003c600(&local_res8,L"UDPSocket DeadLock - %s",uVar13);
          puVar4 = local_res8;
          puVar10 = local_res8;
          if (local_res8 == (undefined *)0x0) {
            puVar10 = PTR_DAT_1402f8010;
          }
          FUN_1400a2b50(puVar10);
          uVar13 = local_res10;
          if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1402f8010)) &&
             (puVar4 + -8 != (undefined *)0x0)) {
            uVar13 = FUN_1400a3440();
            FUN_1400a1c30(uVar13);
            piVar1 = (int *)(puVar4 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(puVar4 + -8);
            }
            FUN_1400d1290(uVar13);
            uVar13 = local_res10;
          }
        }
        iVar12 = iVar12 + 1;
        lVar11 = lVar11 + 1;
      } while (lVar11 < iVar2);
    }
  }
  cVar5 = FUN_1400a1d50(param_1 + 0x798);
  if (cVar5 == '\x01') {
    FUN_1400a3440();
    local_res8 = PTR_DAT_1402f8010;
    FUN_14003c600(&local_res8,L"NetServer tcpIssueQueueCS DeadLock!! - %s",uVar13);
    puVar4 = local_res8;
    puVar10 = local_res8;
    if (local_res8 == (undefined *)0x0) {
      puVar10 = PTR_DAT_1402f8010;
    }
    FUN_1400a2b50(puVar10);
    if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1402f8010)) &&
       (puVar4 + -8 != (undefined *)0x0)) {
      uVar13 = FUN_1400a3440();
      FUN_1400a1c30(uVar13);
      piVar1 = (int *)(puVar4 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar4 + -8);
      }
      FUN_1400d1290(uVar13);
    }
  }
  cVar5 = FUN_1400a1d50(param_1 + 2000);
  if (cVar5 == '\x01') {
    FUN_1400a3440();
    local_res8 = PTR_DAT_1402f8010;
    FUN_14003c600(&local_res8,L"NetServer udpIssueQueueCS DeadLock!! - %s",local_res10);
    puVar4 = local_res8;
    puVar10 = local_res8;
    if (local_res8 == (undefined *)0x0) {
      puVar10 = PTR_DAT_1402f8010;
    }
    FUN_1400a2b50(puVar10);
    if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1402f8010)) &&
       (puVar4 + -8 != (undefined *)0x0)) {
      uVar13 = FUN_1400a3440();
      FUN_1400a1c30(uVar13);
      piVar1 = (int *)(puVar4 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar4 + -8);
      }
      FUN_1400d1290(uVar13);
    }
  }
  return;
}



longlong * FUN_140152ec0(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  
  lVar1 = *param_2;
  if (lVar1 != *param_1) {
    if (lVar1 != 0) {
      *(longlong *)(*param_2 + 8) = *(longlong *)(lVar1 + 8) + 1;
    }
    lVar1 = 0;
    if ((*param_1 != 0) &&
       (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
       *(longlong *)(*param_1 + 8) == 0)) {
      lVar1 = *param_1;
    }
    *param_1 = *param_2;
    if (lVar1 != 0) {
      FUN_1401462b0(lVar1);
    }
  }
  return param_1;
}



void FUN_140152f30(longlong *param_1)

{
  longlong *plVar1;
  
  if (*param_1 != 0) {
    plVar1 = (longlong *)(*param_1 + 8);
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      FUN_140148f80(param_1,*param_1);
    }
  }
  return;
}



void FUN_140152f50(undefined8 *param_1)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_1401b3620(param_1[2],(longlong)*(int *)(param_1 + 3));
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x000140152f97. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
      return;
    }
    FUN_1400a3530();
  }
  return;
}



undefined8 * FUN_140152fb0(undefined8 *param_1,uint param_2)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_1401b3620(param_1[2],(longlong)*(int *)(param_1 + 3));
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140153020(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 uVar2;
  undefined8 *puVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  longlong lVar7;
  longlong lVar8;
  undefined1 local_a0 [152];
  
  lVar7 = (longlong)param_2;
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  iVar5 = *(int *)(param_1 + 0x18);
  if (param_2 != iVar5) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar5 = FUN_1401a7da0(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
      lVar8 = (longlong)iVar5;
      plVar1 = *(longlong **)(param_1 + 8);
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          puVar3 = (undefined8 *)FUN_1400a34c0(lVar8 << 3);
        }
        else {
          puVar3 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,lVar8 << 3);
        }
        *(undefined8 **)(param_1 + 0x10) = puVar3;
        if (0 < param_2) {
          do {
            if (puVar3 != (undefined8 *)0x0) {
              *puVar3 = 0;
            }
            puVar3 = puVar3 + 1;
            lVar7 = lVar7 + -1;
          } while (lVar7 != 0);
        }
      }
      else {
        uVar2 = *(undefined8 *)(param_1 + 0x10);
        if (plVar1 == (longlong *)0x0) {
          lVar7 = FUN_1400a34c0(lVar8 << 3);
        }
        else {
          lVar7 = (**(code **)(*plVar1 + 8))(plVar1,lVar8 << 3);
        }
        FUN_1401494b0(lVar7,uVar2);
        iVar4 = param_2 - *(int *)(param_1 + 0x18);
        puVar3 = (undefined8 *)(lVar7 + (longlong)*(int *)(param_1 + 0x18) * 8);
        iVar6 = 0;
        if (0 < iVar4) {
          do {
            if (puVar3 != (undefined8 *)0x0) {
              *puVar3 = 0;
            }
            iVar6 = iVar6 + 1;
            puVar3 = puVar3 + 1;
          } while (iVar6 < iVar4);
        }
        if (lVar7 == 0) {
          FUN_1400a2320(local_a0,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1402f4860);
        }
        FUN_1401b3620(uVar2,(longlong)*(int *)(param_1 + 0x18));
        plVar1 = *(longlong **)(param_1 + 8);
        if (plVar1 == (longlong *)0x0) {
          FUN_1400a3530(uVar2);
        }
        else {
          (**(code **)(*plVar1 + 0x18))(plVar1,uVar2);
        }
        *(longlong *)(param_1 + 0x10) = lVar7;
      }
      *(int *)(param_1 + 0x1c) = iVar5;
    }
    else if (iVar5 - param_2 < 1) {
      iVar4 = param_2 - iVar5;
      if (0 < iVar4) {
        puVar3 = (undefined8 *)(*(longlong *)(param_1 + 0x10) + (longlong)iVar5 * 8);
        iVar5 = 0;
        if (0 < iVar4) {
          do {
            if (puVar3 != (undefined8 *)0x0) {
              *puVar3 = 0;
            }
            iVar5 = iVar5 + 1;
            puVar3 = puVar3 + 1;
          } while (iVar5 < iVar4);
        }
      }
    }
    else {
      FUN_1401b3620(*(longlong *)(param_1 + 0x10) + lVar7 * 8,(longlong)(iVar5 - param_2));
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_140153210(_Container_base12 *param_1)

{
  FUN_140146720();
  std::_Container_base12::_Orphan_all(param_1);
  operator_delete(*(void **)param_1);
  *(undefined8 *)param_1 = 0;
                    // WARNING: Could not recover jumptable at 0x00014015324c. Too many branches
                    // WARNING: Treating indirect jump as call
  std::_Container_base12::~_Container_base12(param_1);
  return;
}



void thunk_FUN_140148d50(void)

{
  FUN_140148d50();
  return;
}



longlong * FUN_140153270(longlong *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  longlong lVar2;
  longlong lVar3;
  undefined1 local_50 [72];
  
  lVar3 = 0;
  puVar1 = (undefined8 *)
           (**(code **)(*param_2 + 8))(param_2,0x30,param_3,param_4,0xfffffffffffffffe);
  if (puVar1 != (undefined8 *)0x0) {
    *puVar1 = Proud::CFastArray<>::vftable;
    puVar1[1] = 0;
    puVar1[2] = 0;
    puVar1[3] = 0;
    *(undefined4 *)(puVar1 + 4) = 0;
    *(undefined4 *)((longlong)puVar1 + 0x24) = 1;
  }
  FUN_140148db0(param_1,param_2,puVar1);
  lVar2 = lVar3;
  if ((longlong *)*param_1 != (longlong *)0x0) {
    lVar2 = *(longlong *)*param_1;
  }
  *(longlong **)(lVar2 + 0x28) = param_2;
  if ((longlong *)*param_1 != (longlong *)0x0) {
    lVar3 = *(longlong *)*param_1;
  }
  if (*(int *)(lVar3 + 0x1c) < 1) {
    *(longlong **)(lVar3 + 8) = param_2;
    return param_1;
  }
  FUN_1400a2320(local_50,PTR_u_Collection_object_can_use_fast_h_1402f81d0);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_140153350(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong *plVar2;
  
  plVar2 = (longlong *)(param_1 + 0x20);
  if (*plVar2 != 0) {
    plVar1 = (longlong *)(*plVar2 + 8);
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      FUN_140148f80(plVar2,*plVar2,param_3,param_4,0xfffffffffffffffe);
    }
  }
  FUN_14019a730(param_1 + 8);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    if (*(int *)(param_1 + 0x1c) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(param_1 + 0x18) = 0;
  }
  return;
}



undefined1
FUN_1401533c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,longlong param_6,undefined4 *param_7,longlong param_8,
             longlong param_9,undefined4 *param_10,undefined8 *param_11,undefined1 *param_12,
             undefined2 *param_13)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  longlong lVar7;
  undefined4 local_res10 [2];
  undefined1 local_48 [4];
  undefined4 local_44;
  longlong local_40;
  longlong local_38;
  int local_30;
  int local_2c;
  
  local_res10[0] = param_2;
  FUN_140185560(local_48);
  FUN_140185030(local_48);
  FUN_14003d020(local_48,0xfbf5);
  FUN_14007c6e0(local_48,*param_4);
  FUN_14007c6e0(local_48,*param_5);
  iVar1 = *(int *)(param_6 + 0x18);
  FUN_140186930(local_48,(longlong)iVar1);
  lVar7 = 0;
  lVar6 = lVar7;
  if (*(int *)(param_6 + 0x18) != 0) {
    lVar6 = *(longlong *)(param_6 + 0x10);
  }
  if (iVar1 != 0) {
    local_44 = 0;
    if (local_40 == 0) {
      if (local_38 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar6);
      }
LAB_140153472:
      FUN_14003cc90(&local_38,lVar6,iVar1);
    }
    else {
      if (local_38 != 0) goto LAB_140153472;
      if (local_40 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar6);
      }
      FUN_14003ce60(local_40,lVar6,iVar1);
    }
    FUN_14003ced0(local_48);
  }
  FUN_14007c6e0(local_48,*param_7);
  iVar1 = *(int *)(param_8 + 0x18);
  FUN_140186930(local_48,(longlong)iVar1);
  lVar6 = lVar7;
  if (*(int *)(param_8 + 0x18) != 0) {
    lVar6 = *(longlong *)(param_8 + 0x10);
  }
  if (iVar1 != 0) {
    local_44 = 0;
    if (local_40 == 0) {
      if (local_38 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar6);
      }
LAB_1401534ef:
      FUN_14003cc90(&local_38,lVar6,iVar1);
    }
    else {
      if (local_38 != 0) goto LAB_1401534ef;
      if (local_40 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar6);
      }
      FUN_14003ce60(local_40,lVar6,iVar1);
    }
    FUN_14003ced0(local_48);
  }
  iVar1 = *(int *)(param_9 + 0x18);
  FUN_140186930(local_48,(longlong)iVar1);
  lVar6 = lVar7;
  if (*(int *)(param_9 + 0x18) != 0) {
    lVar6 = *(longlong *)(param_9 + 0x10);
  }
  if (iVar1 != 0) {
    local_44 = 0;
    if (local_40 == 0) {
      if (local_38 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar6);
      }
LAB_14015355d:
      FUN_14003cc90(&local_38,lVar6,iVar1);
    }
    else {
      if (local_38 != 0) goto LAB_14015355d;
      if (local_40 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar6);
      }
      FUN_14003ce60(local_40,lVar6,iVar1);
    }
    FUN_14003ced0(local_48);
  }
  FUN_14007c6e0(local_48,*param_10);
  uVar3 = *param_11;
  uVar4 = param_11[1];
  uVar2 = param_11[1];
  local_44 = 0;
  if (local_40 == 0) {
    if (local_38 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_38 == 0) {
    if (local_40 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_40 + 0x18);
    FUN_14003cda0(local_40,iVar1 + 0x10);
    if (*(int *)(local_40 + 0x18) != 0) {
      lVar7 = *(longlong *)(local_40 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar7) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar7) = uVar4;
    goto LAB_140153629;
  }
  lVar6 = (longlong)local_30;
  local_30 = local_30 + 0x10;
  if ((local_30 < 0) || (local_2c < local_30)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_38 + lVar6) = *param_11;
  ((undefined8 *)(local_38 + lVar6))[1] = uVar2;
LAB_140153629:
  FUN_14003ced0(local_48);
  FUN_14003c9e0(local_48,*param_12);
  FUN_14003d020(local_48,*param_13);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_48,PTR_DAT_14030af20,0xfbf5);
  FUN_14019a730(&local_40);
  if ((local_38 != 0) && (local_2c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1
FUN_1401536e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,longlong param_7,undefined4 *param_8,
             longlong param_9,longlong param_10,undefined4 *param_11,undefined8 *param_12,
             undefined1 *param_13,undefined2 *param_14)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  longlong lVar7;
  undefined1 local_58 [4];
  undefined4 local_54;
  longlong local_50;
  longlong local_48;
  int local_40;
  int local_3c;
  
  FUN_140185560(local_58);
  FUN_140185030(local_58);
  FUN_14003d020(local_58,0xfbf5);
  FUN_14007c6e0(local_58,*param_5);
  FUN_14007c6e0(local_58,*param_6);
  iVar1 = *(int *)(param_7 + 0x18);
  FUN_140186930(local_58,(longlong)iVar1);
  lVar7 = 0;
  lVar6 = lVar7;
  if (*(int *)(param_7 + 0x18) != 0) {
    lVar6 = *(longlong *)(param_7 + 0x10);
  }
  if (iVar1 != 0) {
    local_54 = 0;
    if (local_50 == 0) {
      if (local_48 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar6);
      }
LAB_14015379b:
      FUN_14003cc90(&local_48,lVar6,iVar1);
    }
    else {
      if (local_48 != 0) goto LAB_14015379b;
      if (local_50 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar6);
      }
      FUN_14003ce60(local_50,lVar6,iVar1);
    }
    FUN_14003ced0(local_58);
  }
  FUN_14007c6e0(local_58,*param_8);
  iVar1 = *(int *)(param_9 + 0x18);
  FUN_140186930(local_58,(longlong)iVar1);
  lVar6 = lVar7;
  if (*(int *)(param_9 + 0x18) != 0) {
    lVar6 = *(longlong *)(param_9 + 0x10);
  }
  if (iVar1 != 0) {
    local_54 = 0;
    if (local_50 == 0) {
      if (local_48 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar6);
      }
LAB_140153818:
      FUN_14003cc90(&local_48,lVar6,iVar1);
    }
    else {
      if (local_48 != 0) goto LAB_140153818;
      if (local_50 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar6);
      }
      FUN_14003ce60(local_50,lVar6,iVar1);
    }
    FUN_14003ced0(local_58);
  }
  iVar1 = *(int *)(param_10 + 0x18);
  FUN_140186930(local_58,(longlong)iVar1);
  lVar6 = lVar7;
  if (*(int *)(param_10 + 0x18) != 0) {
    lVar6 = *(longlong *)(param_10 + 0x10);
  }
  if (iVar1 != 0) {
    local_54 = 0;
    if (local_50 == 0) {
      if (local_48 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar6);
      }
LAB_140153886:
      FUN_14003cc90(&local_48,lVar6,iVar1);
    }
    else {
      if (local_48 != 0) goto LAB_140153886;
      if (local_50 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar6);
      }
      FUN_14003ce60(local_50,lVar6,iVar1);
    }
    FUN_14003ced0(local_58);
  }
  FUN_14007c6e0(local_58,*param_11);
  uVar3 = *param_12;
  uVar4 = param_12[1];
  uVar2 = param_12[1];
  local_54 = 0;
  if (local_50 == 0) {
    if (local_48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_50 + 0x18);
    FUN_14003cda0(local_50,iVar1 + 0x10);
    if (*(int *)(local_50 + 0x18) != 0) {
      lVar7 = *(longlong *)(local_50 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar7) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar7) = uVar4;
    goto LAB_140153958;
  }
  lVar6 = (longlong)local_40;
  local_40 = local_40 + 0x10;
  if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_48 + lVar6) = *param_12;
  ((undefined8 *)(local_48 + lVar6))[1] = uVar2;
LAB_140153958:
  FUN_14003ced0(local_58);
  FUN_14003c9e0(local_58,*param_13);
  FUN_14003d020(local_58,*param_14);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_58,PTR_DAT_14030af20,0xfbf5);
  FUN_14019a730(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1
FUN_140153a10(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,longlong param_6,undefined4 *param_7,undefined4 *param_8,
             undefined8 *param_9,undefined1 *param_10,undefined2 *param_11)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  longlong lVar7;
  undefined4 local_res10 [2];
  undefined1 local_48 [4];
  undefined4 local_44;
  longlong local_40;
  longlong local_38;
  int local_30;
  int local_2c;
  
  local_res10[0] = param_2;
  FUN_140185560(local_48);
  FUN_140185030(local_48);
  FUN_14003d020(local_48,0xfbf6);
  FUN_14007c6e0(local_48,*param_4);
  FUN_14007c6e0(local_48,*param_5);
  iVar1 = *(int *)(param_6 + 0x18);
  FUN_140186930(local_48,(longlong)iVar1);
  lVar7 = 0;
  lVar6 = lVar7;
  if (*(int *)(param_6 + 0x18) != 0) {
    lVar6 = *(longlong *)(param_6 + 0x10);
  }
  if (iVar1 != 0) {
    local_44 = 0;
    if (local_40 == 0) {
      if (local_38 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar6);
      }
LAB_140153ac2:
      FUN_14003cc90(&local_38,lVar6,iVar1);
    }
    else {
      if (local_38 != 0) goto LAB_140153ac2;
      if (local_40 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar6);
      }
      FUN_14003ce60(local_40,lVar6,iVar1);
    }
    FUN_14003ced0(local_48);
  }
  FUN_14007c6e0(local_48,*param_7);
  FUN_14007c6e0(local_48,*param_8);
  uVar3 = *param_9;
  uVar4 = param_9[1];
  uVar2 = param_9[1];
  local_44 = 0;
  if (local_40 == 0) {
    if (local_38 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_38 == 0) {
    if (local_40 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_40 + 0x18);
    FUN_14003cda0(local_40,iVar1 + 0x10);
    if (*(int *)(local_40 + 0x18) != 0) {
      lVar7 = *(longlong *)(local_40 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar7) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar7) = uVar4;
    goto LAB_140153b9e;
  }
  lVar6 = (longlong)local_30;
  local_30 = local_30 + 0x10;
  if ((local_30 < 0) || (local_2c < local_30)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_38 + lVar6) = *param_9;
  ((undefined8 *)(local_38 + lVar6))[1] = uVar2;
LAB_140153b9e:
  FUN_14003ced0(local_48);
  FUN_14003c9e0(local_48,*param_10);
  FUN_14003d020(local_48,*param_11);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_48,PTR_DAT_14030af28,0xfbf6);
  FUN_14019a730(&local_40);
  if ((local_38 != 0) && (local_2c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined1
FUN_140153c50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,longlong param_7,undefined4 *param_8,
             undefined4 *param_9,undefined8 *param_10,undefined1 *param_11,undefined2 *param_12)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 uVar5;
  longlong lVar6;
  longlong lVar7;
  undefined1 local_58 [4];
  undefined4 local_54;
  longlong local_50;
  longlong local_48;
  int local_40;
  int local_3c;
  
  FUN_140185560(local_58);
  FUN_140185030(local_58);
  FUN_14003d020(local_58,0xfbf6);
  FUN_14007c6e0(local_58,*param_5);
  FUN_14007c6e0(local_58,*param_6);
  iVar1 = *(int *)(param_7 + 0x18);
  FUN_140186930(local_58,(longlong)iVar1);
  lVar7 = 0;
  lVar6 = lVar7;
  if (*(int *)(param_7 + 0x18) != 0) {
    lVar6 = *(longlong *)(param_7 + 0x10);
  }
  if (iVar1 != 0) {
    local_54 = 0;
    if (local_50 == 0) {
      if (local_48 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar6);
      }
LAB_140153d0b:
      FUN_14003cc90(&local_48,lVar6,iVar1);
    }
    else {
      if (local_48 != 0) goto LAB_140153d0b;
      if (local_50 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar6);
      }
      FUN_14003ce60(local_50,lVar6,iVar1);
    }
    FUN_14003ced0(local_58);
  }
  FUN_14007c6e0(local_58,*param_8);
  FUN_14007c6e0(local_58,*param_9);
  uVar3 = *param_10;
  uVar4 = param_10[1];
  uVar2 = param_10[1];
  local_54 = 0;
  if (local_50 == 0) {
    if (local_48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_50 + 0x18);
    FUN_14003cda0(local_50,iVar1 + 0x10);
    if (*(int *)(local_50 + 0x18) != 0) {
      lVar7 = *(longlong *)(local_50 + 0x10);
    }
    *(undefined8 *)(iVar1 + lVar7) = uVar3;
    *(undefined8 *)((longlong)iVar1 + 8 + lVar7) = uVar4;
    goto LAB_140153de7;
  }
  lVar6 = (longlong)local_40;
  local_40 = local_40 + 0x10;
  if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_48 + lVar6) = *param_10;
  ((undefined8 *)(local_48 + lVar6))[1] = uVar2;
LAB_140153de7:
  FUN_14003ced0(local_58);
  FUN_14003c9e0(local_58,*param_11);
  FUN_14003d020(local_58,*param_12);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_58,PTR_DAT_14030af28,0xfbf6);
  FUN_14019a730(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar5;
}



undefined8 FUN_140153ea0(longlong param_1,uint param_2,undefined8 param_3,char *param_4)

{
  int *piVar1;
  uint uVar2;
  longlong lVar3;
  undefined *puVar4;
  undefined8 uVar5;
  ulonglong uVar6;
  undefined8 uVar7;
  uint *puVar8;
  undefined *puVar9;
  undefined *local_res8;
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined1 local_30;
  undefined8 local_28;
  undefined1 local_20;
  
  local_40 = 0xfffffffffffffffe;
  uVar5 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  local_38 = uVar5;
  FUN_1400a1c30(uVar5);
  local_30 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))();
  }
  uVar2 = *(uint *)(*(longlong *)(param_1 + 0x20) + 0xca0);
  uVar6 = (ulonglong)param_2 % (ulonglong)uVar2;
  lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x20) + 0xc80);
  if ((lVar3 != 0) && (puVar8 = *(uint **)(lVar3 + uVar6 * 8), puVar8 != (uint *)0x0)) {
    while ((uint)uVar6 == puVar8[8] % uVar2) {
      if (*puVar8 == param_2) {
        lVar3 = *(longlong *)(puVar8 + 2);
        if ((lVar3 != 0) && (*(longlong *)(lVar3 + 0x228) == 0)) {
          *(undefined1 *)(lVar3 + 0x701) = 0;
          if (*param_4 == '\0') {
            if (*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x17f0) != 0) {
              FUN_1400a3440();
              local_res8 = PTR_DAT_1402f8010;
              uVar6 = 0;
              if (*(longlong *)(lVar3 + 0x740) != 0) {
                uVar6 = *(ulonglong *)(*(longlong *)(lVar3 + 0x740) + 8);
                uVar5 = local_38;
              }
              FUN_14003c600(&local_res8,&DAT_140251b10,*(undefined4 *)(lVar3 + 0x6f8),
                            uVar6 & 0xffffffff);
              puVar4 = local_res8;
              puVar9 = local_res8;
              if (local_res8 == (undefined *)0x0) {
                puVar9 = PTR_DAT_1402f8010;
              }
              FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x17f0),0,puVar9);
              if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1402f8010)) &&
                 (puVar4 + -8 != (undefined *)0x0)) {
                uVar7 = FUN_1400a3440();
                local_28 = uVar7;
                FUN_1400a1c30(uVar7);
                local_20 = 1;
                piVar1 = (int *)(puVar4 + -4);
                *piVar1 = *piVar1 + -1;
                if (*piVar1 == 0) {
                  FUN_1400a3530(puVar4 + -8);
                }
                FUN_1400d1290(uVar7);
              }
            }
            *(undefined1 *)(lVar3 + 0x700) = 0;
            *(undefined1 *)(lVar3 + 0x702) = 1;
            local_48 = 0;
            FUN_14016b650(lVar3 + 0x740,&local_48);
          }
          else {
            FUN_140152760(*(undefined8 *)(param_1 + 0x20),lVar3);
          }
        }
        break;
      }
      puVar8 = *(uint **)(puVar8 + 4);
      if (puVar8 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar5);
  return 1;
}



void FUN_1401540b0(longlong param_1,longlong param_2)

{
  longlong lVar1;
  uint *puVar2;
  longlong *plVar3;
  ulonglong uVar4;
  undefined8 uVar5;
  
  uVar4 = (ulonglong)((uint)*(ushort *)(param_2 + 0x714) ^ *(uint *)(param_2 + 0x710)) %
          (ulonglong)*(uint *)(param_1 + 0x3b0);
  if (*(longlong *)(param_1 + 0x390) != 0) {
    lVar1 = *(longlong *)(*(longlong *)(param_1 + 0x390) + uVar4 * 8);
    while( true ) {
      if ((lVar1 == 0) || ((uint)uVar4 != *(uint *)(lVar1 + 0x28) % *(uint *)(param_1 + 0x3b0)))
      goto LAB_140154148;
      if ((*(uint *)(lVar1 + 8) == *(uint *)(param_2 + 0x710)) &&
         (*(ushort *)(lVar1 + 0xc) == *(ushort *)(param_2 + 0x714))) break;
      lVar1 = *(longlong *)(lVar1 + 0x18);
    }
    FUN_1401461b0(param_1 + 0x388,lVar1,0);
  }
LAB_140154148:
  if (*(longlong *)(param_2 + 0x120) != 0) {
    FUN_140142680(*(longlong *)(param_2 + 0x120),param_2);
  }
  if (*(longlong *)(*(longlong *)(param_2 + 0x748) + 0x110) != 0) {
    FUN_1400a88b0();
  }
  if ((*(longlong **)(param_2 + 0x740) != (longlong *)0x0) &&
     (**(longlong **)(param_2 + 0x740) != 0)) {
    FUN_1401a2cf0(param_2 + 0x700);
  }
  FUN_140148ed0(param_1 + 0x16e8,*(longlong *)(param_2 + 0x748) + 0x128,0);
  uVar4 = (ulonglong)*(uint *)(param_2 + 0x6f8) % (ulonglong)*(uint *)(param_1 + 0xca0);
  if (*(longlong *)(param_1 + 0xc80) != 0) {
    puVar2 = *(uint **)(*(longlong *)(param_1 + 0xc80) + uVar4 * 8);
    while( true ) {
      if ((puVar2 == (uint *)0x0) || ((uint)uVar4 != puVar2[8] % *(uint *)(param_1 + 0xca0)))
      goto LAB_140154210;
      if (*puVar2 == *(uint *)(param_2 + 0x6f8)) break;
      puVar2 = *(uint **)(puVar2 + 4);
    }
    FUN_1401455c0(param_1 + 0xc78,puVar2,0);
  }
LAB_140154210:
  plVar3 = *(longlong **)(param_1 + 0x478);
  lVar1 = *plVar3;
  uVar5 = (**(code **)(*(longlong *)(param_1 + 0x118) + 8))();
  (**(code **)(lVar1 + 0x10))(plVar3,uVar5,*(undefined4 *)(param_2 + 0x6f8));
  FUN_140148ed0(param_1 + 0x388,param_2 + 0x708,0);
  return;
}



void FUN_140154270(longlong param_1,longlong param_2)

{
  int *piVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  longlong lVar5;
  undefined *puVar6;
  undefined *puVar7;
  undefined *local_res10;
  undefined *local_res18;
  
  if (*(char *)(param_2 + 0x700) != '\0') {
    *(undefined1 *)(param_2 + 0x700) = 0;
    if (*(longlong *)(param_2 + 0x68) == 0) {
      lVar5 = 0;
    }
    else {
      lVar5 = *(longlong *)(param_2 + 0x58);
    }
    for (; lVar5 != 0; lVar5 = *(longlong *)(lVar5 + 0x10)) {
      if (*(undefined8 **)(lVar5 + 8) == (undefined8 *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = **(undefined8 **)(lVar5 + 8);
      }
      FUN_1401515f0(param_1,uVar3);
    }
    if (*(longlong *)(param_1 + 0x17f0) != 0) {
      FUN_1400a3440();
      local_res10 = PTR_DAT_1402f8010;
      puVar4 = (undefined8 *)(*(longlong *)(param_2 + 0x748) + 0x128);
      plVar2 = (longlong *)(**(code **)*puVar4)(puVar4,&local_res18);
      puVar7 = (undefined *)*plVar2;
      if ((undefined *)*plVar2 == (undefined *)0x0) {
        puVar7 = PTR_DAT_1402f8010;
      }
      FUN_14003c600(&local_res10,&DAT_140251c20,*(undefined4 *)(param_2 + 0x6f8),puVar7);
      if (((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1402f8010)) &&
         (local_res18 + -8 != (undefined *)0x0)) {
        uVar3 = FUN_1400a3440();
        FUN_1400a1c30(uVar3);
        piVar1 = (int *)(local_res18 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_res18 + -8);
        }
        FUN_1400d1290(uVar3);
      }
      puVar7 = local_res10;
      puVar6 = local_res10;
      if (local_res10 == (undefined *)0x0) {
        puVar6 = PTR_DAT_1402f8010;
      }
      FUN_1401946b0(*(undefined8 *)(param_1 + 0x17f0),1,puVar6);
      if (((puVar7 != (undefined *)0x0) && (puVar7 != PTR_DAT_1402f8010)) &&
         (puVar7 + -8 != (undefined *)0x0)) {
        uVar3 = FUN_1400a3440();
        FUN_1400a1c30(uVar3);
        piVar1 = (int *)(puVar7 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar7 + -8);
        }
        FUN_1400d1290(uVar3);
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140154400(undefined8 param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  undefined8 uVar2;
  longlong lVar3;
  undefined1 auStack_d78 [32];
  undefined1 local_d58 [4];
  undefined4 local_d54;
  longlong local_d50;
  longlong local_d48;
  undefined4 local_d40;
  int local_d3c;
  undefined8 local_d30;
  undefined1 uStack_d28;
  undefined3 uStack_d27;
  undefined4 uStack_d24;
  undefined8 local_d20;
  undefined1 local_d18;
  undefined8 local_d10;
  undefined1 local_d08 [80];
  undefined4 local_cb8;
  undefined4 uStack_cb4;
  undefined4 uStack_cb0;
  undefined4 uStack_cac;
  undefined4 *local_38;
  undefined4 local_30;
  int local_2c;
  ulonglong local_28;
  
  local_d10 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_d78;
  FUN_140185560(local_d58);
  FUN_140185030(local_d58);
  FUN_1401856c0(local_d58,0x800);
  FUN_1401856c0(local_d58,0);
  FUN_14003c9e0(local_d58,9);
  iVar1 = *(int *)(param_3 + 0x18);
  FUN_140186930(local_d58,(longlong)iVar1);
  if (*(int *)(param_3 + 0x18) == 0) {
    uVar2 = 0;
  }
  else {
    uVar2 = *(undefined8 *)(param_3 + 0x10);
  }
  if (iVar1 == 0) goto LAB_1401544f0;
  local_d54 = 0;
  if (local_d50 == 0) {
    if (local_d48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830(0,uVar2);
    }
LAB_1401544c2:
    FUN_14003cc90(&local_d48,uVar2,iVar1);
  }
  else {
    if (local_d48 != 0) goto LAB_1401544c2;
    if (local_d50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830(0,uVar2);
    }
    FUN_14003ce60(local_d50,uVar2,iVar1);
  }
  FUN_14003ced0(local_d58);
LAB_1401544f0:
  uVar2 = (**(code **)(*(longlong *)(param_2 + 0x108) + 0x10))();
  local_d20 = uVar2;
  FUN_1400a1c30(uVar2);
  local_d18 = 1;
  local_2c = 200;
  local_30 = 0;
  local_38 = &local_cb8;
  if (local_d50 == 0) {
    if (local_d48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else {
    local_d40 = *(undefined4 *)(local_d50 + 0x18);
  }
  lVar3 = local_d48;
  if (local_d48 == 0) {
    if (local_d50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    if (*(int *)(local_d50 + 0x18) != 0) {
      lVar3 = *(longlong *)(local_d50 + 0x10);
    }
  }
  local_30 = 1;
  local_d30._0_4_ = (undefined4)lVar3;
  local_d30._4_4_ = (undefined4)((ulonglong)lVar3 >> 0x20);
  local_cb8 = (undefined4)local_d30;
  uStack_cb4 = local_d30._4_4_;
  uStack_cac = uStack_d24;
  local_d30 = (longlong *)0x0;
  _uStack_d28 = CONCAT31((int3)((uint)local_d40 >> 8),1);
  uStack_cb0 = local_d40;
  FUN_1401a12a0(*(undefined8 *)(param_2 + 0x748),&local_cb8,&local_d30);
  if (local_38 == (undefined4 *)0x0) {
    FUN_1400a2320(local_d08,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_d08,(ThrowInfo *)&DAT_1402f4860);
  }
  if (local_2c < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_1400d1290(uVar2);
  local_d30 = &local_d50;
  FUN_14019a730(&local_d50);
  if ((local_d48 != 0) && (local_d3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



void FUN_140154650(longlong param_1)

{
  double dVar1;
  
  if (0 < *(int *)(param_1 + 0x1840)) {
    dVar1 = (double)(**(code **)(*(longlong *)(param_1 + 0x118) + 8))();
    if (30.0 < dVar1 - *(double *)(param_1 + 0x1810)) {
      FUN_140151d00(param_1);
    }
  }
  return;
}



undefined8 * FUN_140154690(undefined8 *param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  int iVar3;
  void *pvVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  longlong local_res10;
  
  LOCK();
  bVar7 = DAT_140318ec0 == 0;
  if (bVar7) {
    DAT_140318ec0 = 1;
  }
  UNLOCK();
  if (bVar7) {
    pvVar4 = operator_new(0xc0);
    if (pvVar4 == (void *)0x0) {
      lVar5 = 0;
    }
    else {
      lVar5 = FUN_140195f60(pvVar4);
    }
    if (lVar5 == 0) {
      lVar6 = 0;
      local_res10 = 0;
    }
    else {
      lVar6 = FUN_1400a34c0(0x48);
      if (lVar6 != 0) {
        local_res10 = lVar6;
        uVar2 = FUN_1401692e0();
        FUN_1400a1b50(lVar6,uVar2,1);
      }
      local_res10 = lVar6;
      FUN_1400a1c30(lVar6);
      *(undefined8 *)(lVar6 + 0x40) = 1;
      *(longlong *)(lVar6 + 0x38) = lVar5;
      FUN_1400d1290(lVar6);
    }
    FUN_140149000(&DAT_140318ec8,&local_res10);
    if (lVar6 != 0) {
      FUN_1400a1c30(lVar6);
      plVar1 = (longlong *)(lVar6 + 0x40);
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_1400d1290(lVar6);
        FUN_140146310(lVar6);
      }
      else {
        FUN_1400d1290(lVar6);
      }
    }
    LOCK();
    UNLOCK();
    DAT_140318ec0 = 2;
  }
  else {
    LOCK();
    iVar3 = DAT_140318ec0;
    if (DAT_140318ec0 == 9999) {
      DAT_140318ec0 = 999;
      iVar3 = 9999;
    }
    UNLOCK();
    while (iVar3 != 2) {
      Sleep(5);
      LOCK();
      iVar3 = DAT_140318ec0;
      if (DAT_140318ec0 == 9999) {
        DAT_140318ec0 = 999;
        iVar3 = 9999;
      }
      UNLOCK();
    }
  }
  *param_1 = 0;
  FUN_140149000(param_1,&DAT_140318ec8);
  return param_1;
}



void FUN_140154820(longlong param_1,longlong param_2,char param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  undefined4 uVar3;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if ((*(longlong *)(param_2 + 0x10) != 0) &&
     (*(longlong *)(*(longlong *)(param_2 + 0x10) + 8) =
           *(longlong *)(*(longlong *)(param_2 + 0x10) + 8) + -1,
     *(longlong *)(*(longlong *)(param_2 + 0x10) + 8) == 0)) {
    plVar1 = *(longlong **)(param_2 + 0x10);
    puVar2 = (undefined8 *)*plVar1;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    FUN_1400a3530(plVar1);
  }
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    FUN_1400a3530(param_2);
  }
  else {
    (**(code **)(*plVar1 + 0x18))(plVar1,param_2);
  }
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
  if (((param_3 != '\0') && (*(ulonglong *)(param_1 + 0x20) < *(ulonglong *)(param_1 + 0x40))) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_140142850(param_1);
    FUN_140144ad0(param_1,uVar3);
  }
  return;
}



undefined8 * FUN_1401548f0(longlong param_1,longlong param_2,uint param_3,undefined4 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined4 uVar3;
  undefined8 *puVar4;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    puVar4 = (undefined8 *)FUN_1400a34c0(0x30);
  }
  else {
    puVar4 = (undefined8 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x30,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar4 != (undefined8 *)0x0) {
    *puVar4 = Proud::AddrPort::vftable;
    *(undefined4 *)(puVar4 + 1) = *(undefined4 *)(param_2 + 8);
    *(undefined2 *)((longlong)puVar4 + 0xc) = *(undefined2 *)(param_2 + 0xc);
    puVar4[2] = 0;
    *(undefined4 *)(puVar4 + 5) = param_4;
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8);
  FUN_140144430(param_1);
  if (*(longlong *)(param_1 + 0x20) == 0) {
    *(undefined8 **)(param_1 + 0x10) = puVar4;
    *(undefined8 **)(param_1 + 0x18) = puVar4;
    puVar4[4] = 0;
    puVar4[3] = 0;
  }
  else {
    FUN_140144430(param_1);
    FUN_140144430(param_1);
    if (lVar2 == 0) {
      lVar2 = *(longlong *)(param_1 + 0x10);
      puVar4[4] = 0;
      puVar4[3] = lVar2;
      if (lVar2 != 0) {
        *(undefined8 **)(lVar2 + 0x20) = puVar4;
      }
      *(undefined8 **)(param_1 + 0x10) = puVar4;
    }
    else {
      if (*(longlong *)(lVar2 + 0x20) == 0) {
        *(undefined8 **)(param_1 + 0x10) = puVar4;
      }
      else {
        *(undefined8 **)(*(longlong *)(lVar2 + 0x20) + 0x18) = puVar4;
      }
      puVar4[4] = *(undefined8 *)(lVar2 + 0x20);
      puVar4[3] = lVar2;
      *(undefined8 **)(lVar2 + 0x20) = puVar4;
    }
  }
  *(undefined8 **)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8) = puVar4;
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  FUN_140144430(param_1);
  FUN_140144430(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_140142850(param_1);
    FUN_140144ad0(param_1,uVar3);
  }
  FUN_140144430(param_1);
  return puVar4;
}



void FUN_140154a50(longlong *param_1,longlong param_2)

{
  undefined8 *puVar1;
  void *pvVar2;
  int iVar3;
  
  if (0 < param_2) {
    iVar3 = 0;
    do {
      if ((*param_1 != 0) &&
         (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
         *(longlong *)(*param_1 + 8) == 0)) {
        puVar1 = (undefined8 *)*param_1;
        pvVar2 = (void *)*puVar1;
        if (pvVar2 != (void *)0x0) {
          FUN_1400aaa90(pvVar2);
          operator_delete(pvVar2);
        }
        FUN_1400a3530(puVar1);
      }
      iVar3 = iVar3 + 1;
      param_1 = param_1 + 1;
    } while (iVar3 < param_2);
  }
  return;
}



longlong * FUN_140154af0(longlong *param_1,longlong *param_2,undefined4 param_3)

{
  longlong lVar1;
  
  lVar1 = 0;
  *param_1 = 0;
  if (*param_2 != 0) {
    *(longlong *)(*param_2 + 8) = *(longlong *)(*param_2 + 8) + 1;
    if ((*param_1 != 0) &&
       (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
       *(longlong *)(*param_1 + 8) == 0)) {
      lVar1 = *param_1;
    }
    *param_1 = *param_2;
    if (lVar1 != 0) {
      FUN_1401462b0(lVar1);
    }
    *(undefined4 *)(param_1 + 4) = param_3;
    return param_1;
  }
  *(undefined4 *)(param_1 + 4) = param_3;
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x000140155217)
// WARNING: Removing unreachable block (ram,0x00014015521f)
// WARNING: Removing unreachable block (ram,0x000140155223)
// WARNING: Removing unreachable block (ram,0x00014015522d)

void FUN_140154b80(longlong param_1,int param_2,int param_3)

{
  double *pdVar1;
  int *piVar2;
  double dVar3;
  int iVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  longlong *plVar8;
  longlong lVar9;
  void *pvVar10;
  ulonglong uVar11;
  int iVar12;
  longlong lVar13;
  ulonglong uVar14;
  int iVar15;
  longlong lVar16;
  longlong lVar17;
  int local_res10 [2];
  int local_res18 [2];
  char *local_res20;
  longlong *local_138;
  void *local_130;
  ulonglong local_128;
  longlong local_120;
  longlong local_118;
  longlong *local_108;
  undefined **local_100 [3];
  undefined **local_e8 [3];
  undefined1 local_d0 [8];
  undefined8 local_c8;
  undefined8 local_c0;
  undefined **local_b8 [3];
  undefined8 local_a0;
  undefined **local_98 [3];
  undefined **local_80 [3];
  undefined1 local_68 [24];
  undefined1 local_50 [24];
  
  local_a0 = 0xfffffffffffffffe;
  if (1 < param_2 - param_3) {
    std::_Container_base12::_Container_base12((_Container_base12 *)&local_138);
    local_138 = operator_new(0x10);
    if (local_138 == (longlong *)0x0) {
      local_108 = local_138;
      std::exception::exception((exception *)local_e8,(char **)&local_108);
      local_e8[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_e8,(ThrowInfo *)&DAT_1402f47a8);
    }
    *local_138 = 0;
    local_138[1] = 0;
    *local_138 = (longlong)&local_138;
    local_130 = (void *)0x0;
    local_128 = 0;
    local_120 = 0;
    local_118 = 0;
    local_res18[0] = param_2 + -1;
    local_res10[0] = param_3;
    FUN_140149690(&local_138,local_res10);
    FUN_140149690(&local_138,local_res18);
    lVar13 = local_118;
    while (lVar16 = 0, uVar11 = local_128, lVar13 != 0) {
      uVar7 = FUN_1401467b0(&local_138,local_d0);
      plVar8 = (longlong *)FUN_140149780(uVar7,local_68,1);
      lVar17 = lVar16;
      if ((longlong *)*plVar8 != (longlong *)0x0) {
        lVar17 = *(longlong *)*plVar8;
      }
      uVar11 = (ulonglong)plVar8[2] >> 2;
      if (*(ulonglong *)(lVar17 + 0x10) <= uVar11) {
        uVar11 = uVar11 - *(ulonglong *)(lVar17 + 0x10);
      }
      local_res10[0] =
           *(int *)(*(longlong *)(*(longlong *)(lVar17 + 8) + uVar11 * 8) +
                   (ulonglong)((uint)plVar8[2] & 3) * 4);
      if ((lVar13 != 0) && (lVar13 = lVar13 + -1, local_118 = lVar13, lVar13 == 0)) {
        local_120 = lVar16;
      }
      uVar7 = FUN_1401467b0(&local_138,local_68);
      plVar8 = (longlong *)FUN_140149780(uVar7,local_50,1);
      lVar17 = lVar16;
      if ((longlong *)*plVar8 != (longlong *)0x0) {
        lVar17 = *(longlong *)*plVar8;
      }
      uVar11 = (ulonglong)plVar8[2] >> 2;
      if (*(ulonglong *)(lVar17 + 0x10) <= uVar11) {
        uVar11 = uVar11 - *(ulonglong *)(lVar17 + 0x10);
      }
      iVar4 = *(int *)(*(longlong *)(*(longlong *)(lVar17 + 8) + uVar11 * 8) +
                      (ulonglong)((uint)plVar8[2] & 3) * 4);
      lVar17 = (longlong)iVar4;
      if ((lVar13 != 0) && (lVar13 = lVar13 + -1, local_118 = lVar13, lVar13 == 0)) {
        local_120 = lVar16;
      }
      iVar15 = iVar4 + 1;
      lVar16 = *(longlong *)(param_1 + lVar17 * 0x18);
      local_c8 = *(undefined8 *)(param_1 + 8 + lVar17 * 0x18);
      local_c0 = *(undefined8 *)(param_1 + 0x10 + lVar17 * 0x18);
      if (iVar15 <= local_res10[0]) {
        iVar12 = local_res10[0];
        if ((iVar15 < local_res10[0]) && (lVar13 = local_118, iVar15 <= local_res10[0])) {
          do {
            dVar3 = *(double *)(lVar16 + 0x188);
            while (*(double *)(*(longlong *)(param_1 + (longlong)iVar15 * 0x18) + 0x188) <= dVar3) {
              iVar15 = iVar15 + 1;
              lVar13 = local_118;
              if (iVar12 < iVar15) goto LAB_140154e08;
            }
            while( true ) {
              lVar13 = local_118;
              if (iVar12 < iVar15) goto LAB_140154e08;
              if (*(double *)(*(longlong *)(param_1 + (longlong)iVar12 * 0x18) + 0x188) < dVar3)
              break;
              iVar12 = iVar12 + -1;
            }
            if (iVar12 < iVar15) break;
            lVar13 = (longlong)iVar12;
            lVar9 = (longlong)iVar15;
            uVar7 = *(undefined8 *)(param_1 + lVar9 * 0x18);
            uVar6 = *(undefined8 *)(param_1 + 8 + lVar9 * 0x18);
            uVar5 = *(undefined8 *)(param_1 + 0x10 + lVar9 * 0x18);
            *(undefined8 *)(param_1 + lVar9 * 0x18) = *(undefined8 *)(param_1 + lVar13 * 0x18);
            *(undefined8 *)(param_1 + 8 + lVar9 * 0x18) =
                 *(undefined8 *)(param_1 + 8 + lVar13 * 0x18);
            *(undefined8 *)(param_1 + 0x10 + lVar9 * 0x18) =
                 *(undefined8 *)(param_1 + 0x10 + lVar13 * 0x18);
            *(undefined8 *)(param_1 + lVar13 * 0x18) = uVar7;
            *(undefined8 *)(param_1 + 8 + lVar13 * 0x18) = uVar6;
            *(undefined8 *)(param_1 + 0x10 + lVar13 * 0x18) = uVar5;
            lVar13 = local_118;
          } while (iVar15 < iVar12);
        }
LAB_140154e08:
        if (iVar4 <= iVar12) {
          lVar9 = (longlong)iVar12;
          lVar16 = *(longlong *)(param_1 + lVar17 * 0x18);
          dVar3 = *(double *)(lVar16 + 0x188);
          pdVar1 = (double *)(*(longlong *)(param_1 + lVar9 * 0x18) + 0x188);
          if (*pdVar1 <= dVar3 && dVar3 != *pdVar1) {
            uVar7 = *(undefined8 *)(param_1 + 8 + lVar17 * 0x18);
            uVar6 = *(undefined8 *)(param_1 + 0x10 + lVar17 * 0x18);
            *(undefined8 *)(param_1 + lVar17 * 0x18) = *(undefined8 *)(param_1 + lVar9 * 0x18);
            *(undefined8 *)(param_1 + 8 + lVar17 * 0x18) =
                 *(undefined8 *)(param_1 + 8 + lVar9 * 0x18);
            *(undefined8 *)(param_1 + 0x10 + lVar17 * 0x18) =
                 *(undefined8 *)(param_1 + 0x10 + lVar9 * 0x18);
            *(longlong *)(param_1 + lVar9 * 0x18) = lVar16;
            *(undefined8 *)(param_1 + 8 + lVar9 * 0x18) = uVar7;
            *(undefined8 *)(param_1 + 0x10 + lVar9 * 0x18) = uVar6;
            lVar13 = local_118;
          }
          if (iVar4 < iVar12) {
            std::_Container_base12::_Orphan_all((_Container_base12 *)&local_138);
            if ((((int)local_120 + (int)local_118 & 3U) == 0) && (local_128 <= local_118 + 4U >> 2))
            {
              FUN_1401467d0(&local_138,1);
            }
            uVar11 = local_118 + local_120;
            uVar14 = uVar11 >> 2;
            if (local_128 <= uVar14) {
              uVar14 = uVar14 - local_128;
            }
            if (*(longlong *)((longlong)local_130 + uVar14 * 8) == 0) {
              pvVar10 = operator_new(0x10);
              if (pvVar10 == (void *)0x0) {
                local_res20 = (char *)0x0;
                std::exception::exception((exception *)local_98,&local_res20);
                local_98[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_98,(ThrowInfo *)&DAT_1402f47a8);
              }
              *(void **)((longlong)local_130 + uVar14 * 8) = pvVar10;
            }
            piVar2 = (int *)(*(longlong *)((longlong)local_130 + uVar14 * 8) +
                            (ulonglong)((uint)uVar11 & 3) * 4);
            if (piVar2 != (int *)0x0) {
              *piVar2 = iVar4;
            }
            local_118 = local_118 + 1;
            std::_Container_base12::_Orphan_all((_Container_base12 *)&local_138);
            if ((((char)local_118 + (char)local_120 & 3U) == 0) &&
               (local_128 <= local_118 + 4U >> 2)) {
              FUN_1401467d0(&local_138,1);
            }
            uVar11 = local_118 + local_120;
            uVar14 = uVar11 >> 2;
            if (local_128 <= uVar14) {
              uVar14 = uVar14 - local_128;
            }
            if (*(longlong *)((longlong)local_130 + uVar14 * 8) == 0) {
              local_res20 = operator_new(0x10);
              if (local_res20 == (char *)0x0) {
                std::exception::exception((exception *)local_80,&local_res20);
                local_80[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_80,(ThrowInfo *)&DAT_1402f47a8);
              }
              *(char **)((longlong)local_130 + uVar14 * 8) = local_res20;
            }
            piVar2 = (int *)(*(longlong *)((longlong)local_130 + uVar14 * 8) +
                            (ulonglong)((uint)uVar11 & 3) * 4);
            if (piVar2 != (int *)0x0) {
              *piVar2 = iVar12 + -1;
            }
            lVar13 = local_118 + 1;
            local_118 = lVar13;
          }
        }
        iVar4 = local_res10[0];
        if (iVar12 < local_res10[0]) {
          std::_Container_base12::_Orphan_all((_Container_base12 *)&local_138);
          if ((((int)local_120 + (int)local_118 & 3U) == 0) && (local_128 <= local_118 + 4U >> 2)) {
            FUN_1401467d0(&local_138,1);
          }
          uVar11 = local_118 + local_120;
          uVar14 = uVar11 >> 2;
          if (local_128 <= uVar14) {
            uVar14 = uVar14 - local_128;
          }
          if (*(longlong *)((longlong)local_130 + uVar14 * 8) == 0) {
            pvVar10 = operator_new(0x10);
            if (pvVar10 == (void *)0x0) {
              local_res20 = (char *)0x0;
              std::exception::exception((exception *)local_b8,&local_res20);
              local_b8[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
              _CxxThrowException(local_b8,(ThrowInfo *)&DAT_1402f47a8);
            }
            *(void **)((longlong)local_130 + uVar14 * 8) = pvVar10;
          }
          piVar2 = (int *)(*(longlong *)((longlong)local_130 + uVar14 * 8) +
                          (ulonglong)((uint)uVar11 & 3) * 4);
          if (piVar2 != (int *)0x0) {
            *piVar2 = iVar12 + 1;
          }
          local_118 = local_118 + 1;
          std::_Container_base12::_Orphan_all((_Container_base12 *)&local_138);
          if ((((char)local_118 + (char)local_120 & 3U) == 0) && (local_128 <= local_118 + 4U >> 2))
          {
            FUN_1401467d0(&local_138,1);
          }
          uVar11 = local_118 + local_120;
          uVar14 = uVar11 >> 2;
          if (local_128 <= uVar14) {
            uVar14 = uVar14 - local_128;
          }
          if (*(longlong *)((longlong)local_130 + uVar14 * 8) == 0) {
            pvVar10 = operator_new(0x10);
            if (pvVar10 == (void *)0x0) {
              local_res20 = (char *)0x0;
              std::exception::exception((exception *)local_100,&local_res20);
              local_100[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
              _CxxThrowException(local_100,(ThrowInfo *)&DAT_1402f47a8);
            }
            *(void **)((longlong)local_130 + uVar14 * 8) = pvVar10;
          }
          piVar2 = (int *)(*(longlong *)((longlong)local_130 + uVar14 * 8) +
                          (ulonglong)((uint)uVar11 & 3) * 4);
          if (piVar2 != (int *)0x0) {
            *piVar2 = iVar4;
          }
          lVar13 = local_118 + 1;
          local_118 = lVar13;
        }
      }
    }
    while (uVar11 != 0) {
      uVar11 = uVar11 - 1;
      if (*(longlong *)((longlong)local_130 + uVar11 * 8) != 0) {
        operator_delete(*(void **)((longlong)local_130 + uVar11 * 8));
      }
    }
    if (local_130 != (void *)0x0) {
      operator_delete(local_130);
    }
    local_128 = 0;
    local_130 = (void *)0x0;
    std::_Container_base12::_Orphan_all((_Container_base12 *)&local_138);
    operator_delete(local_138);
    local_138 = (longlong *)0x0;
    std::_Container_base12::~_Container_base12((_Container_base12 *)&local_138);
  }
  return;
}



undefined8 FUN_1401552f0(longlong param_1,uint param_2)

{
  longlong lVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  uint *puVar4;
  
  uVar3 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar3);
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))();
  }
  lVar1 = *(longlong *)(param_1 + 0x20);
  uVar2 = (ulonglong)param_2 % (ulonglong)*(uint *)(lVar1 + 0xca0);
  if ((*(longlong *)(lVar1 + 0xc80) != 0) &&
     (puVar4 = *(uint **)(*(longlong *)(lVar1 + 0xc80) + uVar2 * 8), puVar4 != (uint *)0x0)) {
    while ((uint)uVar2 == puVar4[8] % *(uint *)(lVar1 + 0xca0)) {
      if (*puVar4 == param_2) {
        if ((*(longlong *)(puVar4 + 2) != 0) &&
           (*(longlong *)(*(longlong *)(puVar4 + 2) + 0x228) == 0)) {
          FUN_140154270(lVar1);
        }
        break;
      }
      puVar4 = *(uint **)(puVar4 + 4);
      if (puVar4 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar3);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x00014015547e)

longlong * FUN_1401553e0(longlong param_1,longlong *param_2,uint param_3,uint param_4)

{
  longlong *plVar1;
  ulonglong uVar2;
  uint *puVar3;
  longlong lVar4;
  uint uVar5;
  longlong local_res8;
  
  lVar4 = 0;
  local_res8 = 0;
  uVar5 = param_3;
  if ((int)param_4 < (int)param_3) {
    uVar5 = param_4;
    param_4 = param_3;
  }
  uVar2 = (ulonglong)(uVar5 << 0x10 ^ param_4) % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    puVar3 = *(uint **)(*(longlong *)(param_1 + 8) + uVar2 * 8);
    while( true ) {
      if ((puVar3 == (uint *)0x0) || ((uint)uVar2 != puVar3[8] % *(uint *)(param_1 + 0x28)))
      goto LAB_140155513;
      if ((*puVar3 == uVar5) && (puVar3[1] == param_4)) break;
      puVar3 = *(uint **)(puVar3 + 4);
    }
    if (puVar3 != (uint *)0x0) {
      if (*(longlong *)(puVar3 + 2) != 0) {
        *(longlong *)(*(longlong *)(puVar3 + 2) + 8) =
             *(longlong *)(*(longlong *)(puVar3 + 2) + 8) + 1;
        local_res8 = *(longlong *)(puVar3 + 2);
      }
      *param_2 = 0;
      if (local_res8 != 0) {
        *(longlong *)(local_res8 + 8) = *(longlong *)(local_res8 + 8) + 1;
        if ((*param_2 != 0) &&
           (*(longlong *)(*param_2 + 8) = *(longlong *)(*param_2 + 8) + -1,
           *(longlong *)(*param_2 + 8) == 0)) {
          lVar4 = *param_2;
        }
        *param_2 = local_res8;
        if (lVar4 != 0) {
          FUN_1401462b0(lVar4);
        }
      }
      if (local_res8 == 0) {
        return param_2;
      }
      plVar1 = (longlong *)(local_res8 + 8);
      *plVar1 = *plVar1 + -1;
      if (*plVar1 != 0) {
        return param_2;
      }
      FUN_1401462b0(local_res8);
      return param_2;
    }
  }
LAB_140155513:
  *param_2 = 0;
  return param_2;
}



void FUN_140155530(undefined8 *param_1)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_140154a50(param_1[2],(longlong)*(int *)(param_1 + 3));
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x000140155577. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
      return;
    }
    FUN_1400a3530();
  }
  return;
}



undefined8 * FUN_140155590(undefined8 *param_1,uint param_2)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_140154a50(param_1[2],(longlong)*(int *)(param_1 + 3));
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140155600(longlong param_1)

{
  longlong *plVar1;
  undefined8 *puVar2;
  uint uVar3;
  ulonglong uVar4;
  longlong lVar5;
  longlong lVar6;
  float fVar7;
  float fVar8;
  
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
  FUN_140144430();
  lVar5 = *(longlong *)(param_1 + 0x10);
  while (lVar5 != 0) {
    lVar6 = *(longlong *)(lVar5 + 0x18);
    if ((*(longlong *)(lVar5 + 0x10) != 0) &&
       (*(longlong *)(*(longlong *)(lVar5 + 0x10) + 8) =
             *(longlong *)(*(longlong *)(lVar5 + 0x10) + 8) + -1,
       *(longlong *)(*(longlong *)(lVar5 + 0x10) + 8) == 0)) {
      plVar1 = *(longlong **)(lVar5 + 0x10);
      puVar2 = (undefined8 *)*plVar1;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      FUN_1400a3530(plVar1);
    }
    plVar1 = *(longlong **)(param_1 + 0x50);
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530(lVar5);
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar5);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar5 = lVar6;
  }
  FUN_1400a3530(*(undefined8 *)(param_1 + 8));
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  FUN_140144430(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar3 = FUN_140142850(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_1400a3530();
      *(undefined8 *)(param_1 + 8) = 0;
    }
    lVar5 = 0;
    *(uint *)(param_1 + 0x28) = uVar3;
    fVar8 = (float)uVar3 * *(float *)(param_1 + 0x34);
    if ((9.223372e+18 < fVar8) && (fVar8 = fVar8 - 9.223372e+18, fVar8 < 9.223372e+18)) {
      lVar5 = -0x8000000000000000;
    }
    fVar7 = (float)uVar3 * *(float *)(param_1 + 0x30);
    lVar6 = 0;
    *(longlong *)(param_1 + 0x38) = (longlong)fVar8 + lVar5;
    if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
      lVar6 = -0x8000000000000000;
    }
    uVar4 = (longlong)fVar7 + lVar6;
    if ((ulonglong)((longlong)fVar7 + lVar6) < 0x11) {
      uVar4 = 0;
    }
    *(ulonglong *)(param_1 + 0x40) = uVar4;
  }
  FUN_140144430(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



void FUN_140155780(longlong param_1,longlong param_2,char param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if ((*(longlong *)(param_2 + 8) != 0) &&
     (*(longlong *)(*(longlong *)(param_2 + 8) + 8) =
           *(longlong *)(*(longlong *)(param_2 + 8) + 8) + -1,
     *(longlong *)(*(longlong *)(param_2 + 8) + 8) == 0)) {
    FUN_1401462b0(*(undefined8 *)(param_2 + 8));
  }
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    FUN_1400a3530(param_2);
  }
  else {
    (**(code **)(*plVar1 + 0x18))(plVar1,param_2);
  }
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
  if (((param_3 != '\0') && (*(ulonglong *)(param_1 + 0x20) < *(ulonglong *)(param_1 + 0x40))) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar2 = FUN_140142850(param_1);
    FUN_1401b2490(param_1,uVar2);
  }
  return;
}



void FUN_140155830(longlong param_1,longlong param_2,undefined1 param_3)

{
  uint uVar1;
  ulonglong uVar2;
  uint uVar3;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  uVar1 = *(uint *)(param_1 + 0x28);
  uVar2 = (ulonglong)*(uint *)(param_2 + 0x20) % (ulonglong)uVar1;
  if (*(longlong *)(param_1 + 0x20) == 1) {
    *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    *(undefined8 *)(param_1 + 0x10) = 0;
    *(undefined8 *)(param_1 + 0x18) = 0;
  }
  else {
    uVar3 = (uint)uVar2;
    if (((*(longlong *)(param_2 + 0x18) == 0) ||
        (*(uint *)(*(longlong *)(param_2 + 0x18) + 0x20) % uVar1 != uVar3)) &&
       ((*(longlong *)(param_2 + 0x10) == 0 ||
        (*(uint *)(*(longlong *)(param_2 + 0x10) + 0x20) % uVar1 != uVar3)))) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    }
    else if (param_2 == *(longlong *)(*(longlong *)(param_1 + 8) + (longlong)(int)uVar3 * 8)) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = *(undefined8 *)(param_2 + 0x10);
    }
    if (param_2 == *(longlong *)(param_1 + 0x10)) {
      *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(param_2 + 0x10);
      *(undefined8 *)(param_2 + 0x18) = 0;
    }
    if (param_2 == *(longlong *)(param_1 + 0x18)) {
      *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
      *(undefined8 *)(param_2 + 0x10) = 0;
    }
    if (*(longlong *)(param_2 + 0x18) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x18) + 0x10) = *(undefined8 *)(param_2 + 0x10);
    }
    if (*(longlong *)(param_2 + 0x10) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x10) + 0x18) = *(undefined8 *)(param_2 + 0x18);
    }
  }
  FUN_140155780(param_1,param_2,param_3);
  FUN_1401b2030(param_1);
  return;
}



undefined8 FUN_140155930(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_140144560(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  FUN_140144430(param_1);
  uVar2 = FUN_1401548f0(param_1,param_2,param_3,param_4);
  FUN_140144430(param_1);
  return uVar2;
}



undefined8 * FUN_1401559b0(longlong param_1,undefined8 *param_2,uint param_3,undefined4 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined4 uVar3;
  undefined8 *puVar4;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    puVar4 = (undefined8 *)FUN_1400a34c0(0x28);
  }
  else {
    puVar4 = (undefined8 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x28,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar4 != (undefined8 *)0x0) {
    *puVar4 = *param_2;
    puVar4[1] = 0;
    *(undefined4 *)(puVar4 + 4) = param_4;
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8);
  FUN_1401b2030(param_1);
  if (*(longlong *)(param_1 + 0x20) == 0) {
    *(undefined8 **)(param_1 + 0x10) = puVar4;
    *(undefined8 **)(param_1 + 0x18) = puVar4;
    puVar4[3] = 0;
    puVar4[2] = 0;
  }
  else {
    FUN_1401b2030(param_1);
    FUN_1401b2030(param_1);
    if (lVar2 == 0) {
      lVar2 = *(longlong *)(param_1 + 0x10);
      puVar4[3] = 0;
      puVar4[2] = lVar2;
      if (lVar2 != 0) {
        *(undefined8 **)(lVar2 + 0x18) = puVar4;
      }
      *(undefined8 **)(param_1 + 0x10) = puVar4;
    }
    else {
      if (*(longlong *)(lVar2 + 0x18) == 0) {
        *(undefined8 **)(param_1 + 0x10) = puVar4;
      }
      else {
        *(undefined8 **)(*(longlong *)(lVar2 + 0x18) + 0x10) = puVar4;
      }
      puVar4[3] = *(undefined8 *)(lVar2 + 0x18);
      puVar4[2] = lVar2;
      *(undefined8 **)(lVar2 + 0x18) = puVar4;
    }
  }
  *(undefined8 **)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8) = puVar4;
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  FUN_1401b2030(param_1);
  FUN_1401b2030(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_140142850(param_1);
    FUN_1401b2490(param_1,uVar3);
  }
  FUN_1401b2030(param_1);
  return puVar4;
}



void FUN_140155b00(longlong param_1,longlong *param_2,char param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  
  if (param_2 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if ((*param_2 != 0) &&
     (*(longlong *)(*param_2 + 8) = *(longlong *)(*param_2 + 8) + -1,
     *(longlong *)(*param_2 + 8) == 0)) {
    FUN_1401462b0(*param_2);
  }
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    FUN_1400a3530(param_2);
  }
  else {
    (**(code **)(*plVar1 + 0x18))(plVar1,param_2);
  }
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
  if (((param_3 != '\0') && (*(ulonglong *)(param_1 + 0x20) < *(ulonglong *)(param_1 + 0x40))) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar2 = FUN_140142850(param_1);
    FUN_1401b2490(param_1,uVar2);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140156193)
// WARNING: Removing unreachable block (ram,0x00014015619b)
// WARNING: Removing unreachable block (ram,0x00014015619f)
// WARNING: Removing unreachable block (ram,0x0001401561a9)

void FUN_140155bb0(longlong param_1,int param_2,int param_3)

{
  int *piVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  longlong *plVar6;
  void *pvVar7;
  ulonglong uVar8;
  int iVar9;
  longlong lVar10;
  ulonglong uVar11;
  int iVar12;
  longlong lVar13;
  longlong lVar14;
  int iVar15;
  int local_res10 [2];
  int local_res18 [2];
  char *local_res20;
  longlong *local_128;
  void *local_120;
  ulonglong local_118;
  longlong local_110;
  longlong local_108;
  longlong *local_f8;
  undefined **local_f0 [3];
  undefined **local_d8 [3];
  undefined **local_c0 [3];
  undefined8 local_a8;
  undefined **local_a0 [3];
  undefined **local_88 [3];
  undefined1 local_70 [24];
  undefined1 local_58 [32];
  
  local_a8 = 0xfffffffffffffffe;
  if (1 < param_2 - param_3) {
    std::_Container_base12::_Container_base12((_Container_base12 *)&local_128);
    local_128 = operator_new(0x10);
    if (local_128 == (longlong *)0x0) {
      local_f8 = local_128;
      std::exception::exception((exception *)local_d8,(char **)&local_f8);
      local_d8[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_d8,(ThrowInfo *)&DAT_1402f47a8);
    }
    *local_128 = 0;
    local_128[1] = 0;
    *local_128 = (longlong)&local_128;
    local_120 = (void *)0x0;
    local_118 = 0;
    local_110 = 0;
    local_108 = 0;
    local_res18[0] = param_2 + -1;
    local_res10[0] = param_3;
    FUN_140149690(&local_128,local_res10);
    FUN_140149690(&local_128,local_res18);
    lVar10 = local_108;
    while (lVar14 = 0, uVar8 = local_118, lVar10 != 0) {
      uVar5 = FUN_1401467b0(&local_128,local_70);
      plVar6 = (longlong *)FUN_140149780(uVar5,local_58,1);
      lVar13 = lVar14;
      if ((longlong *)*plVar6 != (longlong *)0x0) {
        lVar13 = *(longlong *)*plVar6;
      }
      uVar8 = (ulonglong)plVar6[2] >> 2;
      if (*(ulonglong *)(lVar13 + 0x10) <= uVar8) {
        uVar8 = uVar8 - *(ulonglong *)(lVar13 + 0x10);
      }
      iVar15 = *(int *)(*(longlong *)(*(longlong *)(lVar13 + 8) + uVar8 * 8) +
                       (ulonglong)((uint)plVar6[2] & 3) * 4);
      if ((lVar10 != 0) && (lVar10 = lVar10 + -1, local_108 = lVar10, lVar10 == 0)) {
        local_110 = lVar14;
      }
      local_res10[0] = iVar15;
      uVar5 = FUN_1401467b0(&local_128,local_58);
      plVar6 = (longlong *)FUN_140149780(uVar5,local_70,1);
      lVar13 = lVar14;
      if ((longlong *)*plVar6 != (longlong *)0x0) {
        lVar13 = *(longlong *)*plVar6;
      }
      uVar8 = (ulonglong)plVar6[2] >> 2;
      if (*(ulonglong *)(lVar13 + 0x10) <= uVar8) {
        uVar8 = uVar8 - *(ulonglong *)(lVar13 + 0x10);
      }
      iVar2 = *(int *)(*(longlong *)(*(longlong *)(lVar13 + 8) + uVar8 * 8) +
                      (ulonglong)((uint)plVar6[2] & 3) * 4);
      lVar13 = (longlong)iVar2;
      if ((lVar10 != 0) && (lVar10 = lVar10 + -1, local_108 = lVar10, lVar10 == 0)) {
        local_110 = lVar14;
      }
      iVar12 = iVar2 + 1;
      iVar3 = *(int *)(param_1 + lVar13 * 4);
      if (iVar12 <= iVar15) {
        iVar9 = iVar15;
        if ((iVar12 < iVar15) && (lVar10 = local_108, iVar12 <= iVar15)) {
LAB_140155d77:
          do {
            if (iVar3 < *(int *)(param_1 + (longlong)iVar12 * 4)) {
              if (iVar9 < iVar12) break;
              do {
                if (*(int *)(param_1 + (longlong)iVar9 * 4) < iVar3) {
                  if (iVar9 < iVar12) goto LAB_140155dc5;
                  uVar4 = *(undefined4 *)(param_1 + (longlong)iVar12 * 4);
                  *(undefined4 *)(param_1 + (longlong)iVar12 * 4) =
                       *(undefined4 *)(param_1 + (longlong)iVar9 * 4);
                  *(undefined4 *)(param_1 + (longlong)iVar9 * 4) = uVar4;
                  break;
                }
                iVar9 = iVar9 + -1;
              } while (iVar12 <= iVar9);
            }
            else {
              iVar12 = iVar12 + 1;
              if (iVar12 <= iVar9) goto LAB_140155d77;
            }
          } while (iVar12 < iVar9);
        }
LAB_140155dc5:
        if (iVar2 <= iVar9) {
          iVar3 = *(int *)(param_1 + (longlong)iVar9 * 4);
          if (iVar3 < *(int *)(param_1 + lVar13 * 4)) {
            uVar4 = *(undefined4 *)(param_1 + lVar13 * 4);
            *(int *)(param_1 + lVar13 * 4) = iVar3;
            *(undefined4 *)(param_1 + (longlong)iVar9 * 4) = uVar4;
            lVar10 = local_108;
          }
          if (iVar2 < iVar9) {
            std::_Container_base12::_Orphan_all((_Container_base12 *)&local_128);
            if ((((int)local_110 + (int)local_108 & 3U) == 0) && (local_118 <= local_108 + 4U >> 2))
            {
              FUN_1401467d0(&local_128,1);
            }
            uVar8 = local_108 + local_110;
            uVar11 = uVar8 >> 2;
            if (local_118 <= uVar11) {
              uVar11 = uVar11 - local_118;
            }
            if (*(longlong *)((longlong)local_120 + uVar11 * 8) == 0) {
              pvVar7 = operator_new(0x10);
              if (pvVar7 == (void *)0x0) {
                local_res20 = (char *)0x0;
                std::exception::exception((exception *)local_a0,&local_res20);
                local_a0[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1402f47a8);
              }
              *(void **)((longlong)local_120 + uVar11 * 8) = pvVar7;
            }
            piVar1 = (int *)(*(longlong *)((longlong)local_120 + uVar11 * 8) +
                            (ulonglong)((uint)uVar8 & 3) * 4);
            if (piVar1 != (int *)0x0) {
              *piVar1 = iVar2;
            }
            local_108 = local_108 + 1;
            std::_Container_base12::_Orphan_all((_Container_base12 *)&local_128);
            if ((((char)local_108 + (char)local_110 & 3U) == 0) &&
               (local_118 <= local_108 + 4U >> 2)) {
              FUN_1401467d0(&local_128,1);
            }
            uVar8 = local_108 + local_110;
            uVar11 = uVar8 >> 2;
            if (local_118 <= uVar11) {
              uVar11 = uVar11 - local_118;
            }
            if (*(longlong *)((longlong)local_120 + uVar11 * 8) == 0) {
              local_res20 = operator_new(0x10);
              if (local_res20 == (char *)0x0) {
                std::exception::exception((exception *)local_c0,&local_res20);
                local_c0[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_c0,(ThrowInfo *)&DAT_1402f47a8);
              }
              *(char **)((longlong)local_120 + uVar11 * 8) = local_res20;
            }
            piVar1 = (int *)(*(longlong *)((longlong)local_120 + uVar11 * 8) +
                            (ulonglong)((uint)uVar8 & 3) * 4);
            if (piVar1 != (int *)0x0) {
              *piVar1 = iVar9 + -1;
            }
            lVar10 = local_108 + 1;
            iVar15 = local_res10[0];
            local_108 = lVar10;
          }
        }
        if (iVar9 < iVar15) {
          std::_Container_base12::_Orphan_all((_Container_base12 *)&local_128);
          if ((((int)local_110 + (int)local_108 & 3U) == 0) && (local_118 <= local_108 + 4U >> 2)) {
            FUN_1401467d0(&local_128,1);
          }
          uVar8 = local_108 + local_110;
          uVar11 = uVar8 >> 2;
          if (local_118 <= uVar11) {
            uVar11 = uVar11 - local_118;
          }
          if (*(longlong *)((longlong)local_120 + uVar11 * 8) == 0) {
            pvVar7 = operator_new(0x10);
            if (pvVar7 == (void *)0x0) {
              local_res20 = (char *)0x0;
              std::exception::exception((exception *)local_f0,&local_res20);
              local_f0[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
              _CxxThrowException(local_f0,(ThrowInfo *)&DAT_1402f47a8);
            }
            *(void **)((longlong)local_120 + uVar11 * 8) = pvVar7;
          }
          piVar1 = (int *)(*(longlong *)((longlong)local_120 + uVar11 * 8) +
                          (ulonglong)((uint)uVar8 & 3) * 4);
          if (piVar1 != (int *)0x0) {
            *piVar1 = iVar9 + 1;
          }
          local_108 = local_108 + 1;
          std::_Container_base12::_Orphan_all((_Container_base12 *)&local_128);
          if ((((char)local_108 + (char)local_110 & 3U) == 0) && (local_118 <= local_108 + 4U >> 2))
          {
            FUN_1401467d0(&local_128,1);
          }
          uVar8 = local_108 + local_110;
          uVar11 = uVar8 >> 2;
          if (local_118 <= uVar11) {
            uVar11 = uVar11 - local_118;
          }
          if (*(longlong *)((longlong)local_120 + uVar11 * 8) == 0) {
            pvVar7 = operator_new(0x10);
            if (pvVar7 == (void *)0x0) {
              local_res20 = (char *)0x0;
              std::exception::exception((exception *)local_88,&local_res20);
              local_88[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
              _CxxThrowException(local_88,(ThrowInfo *)&DAT_1402f47a8);
            }
            *(void **)((longlong)local_120 + uVar11 * 8) = pvVar7;
          }
          piVar1 = (int *)(*(longlong *)((longlong)local_120 + uVar11 * 8) +
                          (ulonglong)((uint)uVar8 & 3) * 4);
          if (piVar1 != (int *)0x0) {
            *piVar1 = iVar15;
          }
          lVar10 = local_108 + 1;
          local_108 = lVar10;
        }
      }
    }
    while (uVar8 != 0) {
      uVar8 = uVar8 - 1;
      if (*(longlong *)((longlong)local_120 + uVar8 * 8) != 0) {
        operator_delete(*(void **)((longlong)local_120 + uVar8 * 8));
      }
    }
    if (local_120 != (void *)0x0) {
      operator_delete(local_120);
    }
    local_118 = 0;
    local_120 = (void *)0x0;
    std::_Container_base12::_Orphan_all((_Container_base12 *)&local_128);
    operator_delete(local_128);
    local_128 = (longlong *)0x0;
    std::_Container_base12::~_Container_base12((_Container_base12 *)&local_128);
  }
  return;
}



undefined8
FUN_140156270(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined8 *param_6,undefined8 *param_7,undefined8 *param_8,
             undefined8 *param_9)

{
  int *piVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong *plVar4;
  longlong *plVar5;
  longlong *plVar6;
  undefined *puVar7;
  undefined *puVar8;
  undefined *puVar9;
  undefined *puVar10;
  undefined8 uVar11;
  longlong *local_res8;
  longlong local_108;
  undefined *local_100;
  undefined *local_f8;
  undefined *local_f0;
  undefined *local_e8;
  undefined *local_e0;
  undefined **local_d8;
  undefined4 local_d0;
  undefined2 local_cc;
  undefined **local_c8;
  undefined4 local_c0;
  undefined2 local_bc;
  undefined **local_b8;
  undefined4 local_b0;
  undefined2 local_ac;
  undefined **local_a8;
  undefined4 local_a0;
  undefined2 local_9c;
  undefined8 local_98;
  undefined1 local_90;
  undefined8 local_88;
  undefined1 local_80;
  undefined8 local_78;
  undefined1 local_70;
  undefined8 local_68;
  undefined1 local_60;
  undefined8 local_58;
  undefined1 local_50;
  undefined8 local_48;
  undefined1 local_40;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  local_48 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(local_48);
  local_40 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))
              (*(longlong **)(param_1 + 0x20),
               L"Proud::CNetServerImpl::C2SStub::NotifyP2PHolepunchSuccess");
  }
  local_res8 = (longlong *)0x0;
  plVar3 = (longlong *)
           FUN_1401553e0(*(longlong *)(param_1 + 0x20) + 0x2d8,&local_108,*param_4,*param_5);
  if (*plVar3 != 0) {
    *(longlong *)(*plVar3 + 8) = *(longlong *)(*plVar3 + 8) + 1;
    local_res8 = (longlong *)*plVar3;
  }
  if ((local_108 != 0) &&
     (*(longlong *)(local_108 + 8) = *(longlong *)(local_108 + 8) + -1,
     *(longlong *)(local_108 + 8) == 0)) {
    FUN_1401462b0(local_108);
  }
  if (((local_res8 != (longlong *)0x0) && (lVar2 = *local_res8, lVar2 != 0)) &&
     (*(char *)(lVar2 + 8) == '\x01')) {
    if (*(char *)(lVar2 + 8) != '\0') {
      *(undefined1 *)(lVar2 + 8) = 0;
    }
    lVar2 = *local_res8;
    uVar11 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x118) + 8))();
    *(undefined8 *)(lVar2 + 0x198) = uVar11;
    local_b8 = Proud::AddrPort::vftable;
    local_b0 = *(undefined4 *)(param_9 + 1);
    local_ac = *(undefined2 *)((longlong)param_9 + 0xc);
    local_d8 = Proud::AddrPort::vftable;
    local_d0 = *(undefined4 *)(param_6 + 1);
    local_cc = *(undefined2 *)((longlong)param_6 + 0xc);
    FUN_1401422c0(*local_res8,*param_4,&local_d8,&local_b8);
    local_c8 = Proud::AddrPort::vftable;
    local_c0 = *(undefined4 *)(param_7 + 1);
    local_bc = *(undefined2 *)((longlong)param_7 + 0xc);
    local_a8 = Proud::AddrPort::vftable;
    local_a0 = *(undefined4 *)(param_8 + 1);
    local_9c = *(undefined2 *)((longlong)param_8 + 0xc);
    FUN_1401422c0(*local_res8,*param_5,&local_a8,&local_c8);
    plVar3 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
    (**(code **)(*plVar3 + 0x90))
              (plVar3,*param_4,&DAT_140318cf0,param_4,param_5,param_6,param_7,param_8,param_9);
    plVar3 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
    (**(code **)(*plVar3 + 0x90))
              (plVar3,*param_5,&DAT_140318cf0,param_4,param_5,param_6,param_7,param_8,param_9);
    if (*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x17f0) != 0) {
      FUN_1400a3440();
      local_100 = PTR_DAT_1402f8010;
      plVar3 = (longlong *)(**(code **)*param_9)(param_9,&local_e0);
      plVar4 = (longlong *)(**(code **)*param_8)(param_8,&local_f0);
      plVar5 = (longlong *)(**(code **)*param_7)(param_7,&local_e8);
      plVar6 = (longlong *)(**(code **)*param_6)(param_6,&local_f8);
      puVar10 = (undefined *)*plVar3;
      if ((undefined *)*plVar3 == (undefined *)0x0) {
        puVar10 = PTR_DAT_1402f8010;
      }
      puVar9 = (undefined *)*plVar4;
      if ((undefined *)*plVar4 == (undefined *)0x0) {
        puVar9 = PTR_DAT_1402f8010;
      }
      puVar8 = (undefined *)*plVar5;
      if ((undefined *)*plVar5 == (undefined *)0x0) {
        puVar8 = PTR_DAT_1402f8010;
      }
      puVar7 = (undefined *)*plVar6;
      if ((undefined *)*plVar6 == (undefined *)0x0) {
        puVar7 = PTR_DAT_1402f8010;
      }
      FUN_14003c600(&local_100,&DAT_140251ed0,*param_4,*param_5,puVar7,puVar8,puVar9,puVar10);
      if (((local_f8 != (undefined *)0x0) && (local_f8 != PTR_DAT_1402f8010)) &&
         (local_f8 + -8 != (undefined *)0x0)) {
        uVar11 = FUN_1400a3440();
        local_98 = uVar11;
        FUN_1400a1c30(uVar11);
        local_90 = 1;
        piVar1 = (int *)(local_f8 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_f8 + -8);
        }
        FUN_1400d1290(uVar11);
        local_90 = 0;
      }
      local_f8 = PTR_DAT_1402f8010;
      if (((local_e8 != (undefined *)0x0) && (local_e8 != PTR_DAT_1402f8010)) &&
         (local_e8 + -8 != (undefined *)0x0)) {
        uVar11 = FUN_1400a3440();
        local_68 = uVar11;
        FUN_1400a1c30(uVar11);
        local_60 = 1;
        piVar1 = (int *)(local_e8 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_e8 + -8);
        }
        FUN_1400d1290(uVar11);
        local_60 = 0;
      }
      local_e8 = PTR_DAT_1402f8010;
      if (((local_f0 != (undefined *)0x0) && (local_f0 != PTR_DAT_1402f8010)) &&
         (local_f0 + -8 != (undefined *)0x0)) {
        uVar11 = FUN_1400a3440();
        local_88 = uVar11;
        FUN_1400a1c30(uVar11);
        local_80 = 1;
        piVar1 = (int *)(local_f0 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_f0 + -8);
        }
        FUN_1400d1290(uVar11);
        local_80 = 0;
      }
      local_f0 = PTR_DAT_1402f8010;
      if (((local_e0 != (undefined *)0x0) && (local_e0 != PTR_DAT_1402f8010)) &&
         (local_e0 + -8 != (undefined *)0x0)) {
        uVar11 = FUN_1400a3440();
        local_78 = uVar11;
        FUN_1400a1c30(uVar11);
        local_70 = 1;
        piVar1 = (int *)(local_e0 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_e0 + -8);
        }
        FUN_1400d1290(uVar11);
        local_70 = 0;
      }
      puVar10 = local_100;
      puVar9 = local_100;
      if (local_100 == (undefined *)0x0) {
        puVar9 = PTR_DAT_1402f8010;
      }
      local_e0 = PTR_DAT_1402f8010;
      FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x17f0),1,puVar9);
      if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1402f8010)) &&
         (puVar10 + -8 != (undefined *)0x0)) {
        uVar11 = FUN_1400a3440();
        local_58 = uVar11;
        FUN_1400a1c30(uVar11);
        local_50 = 1;
        piVar1 = (int *)(puVar10 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar10 + -8);
        }
        FUN_1400d1290(uVar11);
        local_50 = 0;
      }
      local_100 = PTR_DAT_1402f8010;
    }
  }
  if (local_res8 != (longlong *)0x0) {
    plVar3 = local_res8 + 1;
    *plVar3 = *plVar3 + -1;
    if (*plVar3 == 0) {
      FUN_1401462b0(local_res8);
    }
  }
  FUN_1400d1290(local_48);
  return 1;
}



undefined8
FUN_1401567a0(longlong param_1,undefined4 param_2,undefined8 param_3,uint *param_4,int *param_5)

{
  int *piVar1;
  longlong lVar2;
  ulonglong uVar3;
  undefined4 uVar4;
  undefined2 uVar5;
  undefined *puVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  uint *puVar9;
  longlong *plVar10;
  longlong lVar11;
  undefined *puVar12;
  longlong *local_res8;
  undefined4 local_res10 [2];
  undefined *local_res20;
  
  local_res10[0] = param_2;
  uVar7 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar7);
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))();
  }
  lVar2 = *(longlong *)(param_1 + 0x20);
  uVar3 = (ulonglong)*param_4 % (ulonglong)*(uint *)(lVar2 + 0xca0);
  if ((*(longlong *)(lVar2 + 0xc80) != 0) &&
     (puVar9 = *(uint **)(*(longlong *)(lVar2 + 0xc80) + uVar3 * 8), puVar9 != (uint *)0x0)) {
    while ((uint)uVar3 == puVar9[8] % *(uint *)(lVar2 + 0xca0)) {
      if (*puVar9 == *param_4) {
        if ((*(longlong *)(puVar9 + 2) != 0) &&
           (*(longlong *)(*(longlong *)(puVar9 + 2) + 0x228) == 0)) {
          FUN_1401553e0(lVar2 + 0x2d8,&local_res8,local_res10[0]);
          if ((local_res8 != (longlong *)0x0) &&
             ((lVar2 = *local_res8, lVar2 != 0 && (*(char *)(lVar2 + 8) == '\0')))) {
            lVar11 = 0;
            if (*param_5 != 0x1d) {
              *(undefined8 *)(lVar2 + 0x198) = 0;
            }
            uVar5 = DAT_1402f83d4;
            uVar4 = DAT_1402f83d0;
            if (local_res8 != (longlong *)0x0) {
              lVar11 = *local_res8;
            }
            if (*(char *)(lVar11 + 8) != '\x01') {
              *(undefined4 *)(lVar11 + 0x10) = 0;
              *(undefined4 *)(lVar11 + 0x20) = uVar4;
              *(undefined2 *)(lVar11 + 0x24) = uVar5;
              *(undefined4 *)(lVar11 + 0x30) = uVar4;
              *(undefined2 *)(lVar11 + 0x34) = uVar5;
              *(undefined1 *)(lVar11 + 0x38) = 0;
              uVar5 = DAT_1402f83d4;
              uVar4 = DAT_1402f83d0;
              *(undefined4 *)(lVar11 + 0x40) = 0;
              *(undefined4 *)(lVar11 + 0x50) = uVar4;
              *(undefined2 *)(lVar11 + 0x54) = uVar5;
              *(undefined4 *)(lVar11 + 0x60) = uVar4;
              *(undefined2 *)(lVar11 + 100) = uVar5;
              *(undefined1 *)(lVar11 + 0x68) = 0;
              *(undefined1 *)(lVar11 + 8) = 1;
            }
            plVar10 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
            (**(code **)(*plVar10 + 0x70))(plVar10,*param_4,&DAT_140318cf0,local_res10,param_5);
            if (*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x17f0) != 0) {
              FUN_1400a3440();
              local_res20 = PTR_DAT_1402f8010;
              FUN_14003c600(&local_res20,&DAT_140252050,local_res10[0],*param_4);
              puVar6 = local_res20;
              puVar12 = local_res20;
              if (local_res20 == (undefined *)0x0) {
                puVar12 = PTR_DAT_1402f8010;
              }
              FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x17f0),1,puVar12);
              if (((puVar6 != (undefined *)0x0) && (puVar6 != PTR_DAT_1402f8010)) &&
                 (puVar6 + -8 != (undefined *)0x0)) {
                uVar8 = FUN_1400a3440();
                FUN_1400a1c30(uVar8);
                piVar1 = (int *)(puVar6 + -4);
                *piVar1 = *piVar1 + -1;
                if (*piVar1 == 0) {
                  FUN_1400a3530(puVar6 + -8);
                }
                FUN_1400d1290(uVar8);
              }
              local_res20 = PTR_DAT_1402f8010;
            }
          }
          if ((local_res8 != (longlong *)0x0) &&
             (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
            FUN_1401462b0(local_res8);
          }
        }
        break;
      }
      puVar9 = *(uint **)(puVar9 + 4);
      if (puVar9 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar7);
  return 1;
}



undefined8 FUN_140156a70(longlong param_1,undefined4 param_2,undefined8 param_3,uint *param_4)

{
  int *piVar1;
  uint uVar2;
  longlong lVar3;
  ulonglong uVar4;
  undefined4 uVar5;
  undefined2 uVar6;
  undefined *puVar7;
  undefined8 uVar8;
  uint *puVar9;
  longlong *plVar10;
  undefined *puVar11;
  longlong *local_res8;
  undefined4 local_res10 [2];
  undefined *local_res20;
  undefined8 uVar12;
  undefined8 uVar13;
  undefined1 uVar14;
  
  uVar12 = 0xfffffffffffffffe;
  local_res10[0] = param_2;
  uVar8 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  uVar13 = uVar8;
  FUN_1400a1c30(uVar8);
  uVar14 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))();
  }
  uVar2 = *param_4;
  lVar3 = *(longlong *)(param_1 + 0x20);
  uVar4 = (ulonglong)uVar2 % (ulonglong)*(uint *)(lVar3 + 0xca0);
  if ((*(longlong *)(lVar3 + 0xc80) != 0) &&
     (puVar9 = *(uint **)(*(longlong *)(lVar3 + 0xc80) + uVar4 * 8), puVar9 != (uint *)0x0)) {
    while ((uint)uVar4 == puVar9[8] % *(uint *)(lVar3 + 0xca0)) {
      if (*puVar9 == uVar2) {
        if ((*(longlong *)(puVar9 + 2) != 0) &&
           (*(longlong *)(*(longlong *)(puVar9 + 2) + 0x228) == 0)) {
          FUN_1401553e0(lVar3 + 0x2d8,&local_res8,local_res10[0],(ulonglong)uVar2,uVar12,uVar13,
                        uVar14);
          uVar6 = DAT_1402f83d4;
          uVar5 = DAT_1402f83d0;
          if ((local_res8 != (longlong *)0x0) && (lVar3 = *local_res8, lVar3 != 0)) {
            if (*(char *)(lVar3 + 8) != '\x01') {
              *(undefined4 *)(lVar3 + 0x10) = 0;
              *(undefined4 *)(lVar3 + 0x20) = uVar5;
              *(undefined2 *)(lVar3 + 0x24) = uVar6;
              *(undefined4 *)(lVar3 + 0x30) = uVar5;
              *(undefined2 *)(lVar3 + 0x34) = uVar6;
              *(undefined1 *)(lVar3 + 0x38) = 0;
              uVar6 = DAT_1402f83d4;
              uVar5 = DAT_1402f83d0;
              *(undefined4 *)(lVar3 + 0x40) = 0;
              *(undefined4 *)(lVar3 + 0x50) = uVar5;
              *(undefined2 *)(lVar3 + 0x54) = uVar6;
              *(undefined4 *)(lVar3 + 0x60) = uVar5;
              *(undefined2 *)(lVar3 + 100) = uVar6;
              *(undefined1 *)(lVar3 + 0x68) = 0;
              *(undefined1 *)(lVar3 + 8) = 1;
            }
            plVar10 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
            (**(code **)(*plVar10 + 0x110))(plVar10,*param_4,&DAT_140318cf0,local_res10);
            plVar10 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
            (**(code **)(*plVar10 + 0x110))(plVar10,local_res10[0],&DAT_140318cf0,param_4);
            if (*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x17f0) != 0) {
              FUN_1400a3440();
              local_res20 = PTR_DAT_1402f8010;
              FUN_14003c600(&local_res20,&DAT_140252150,local_res10[0],*param_4);
              puVar7 = local_res20;
              puVar11 = local_res20;
              if (local_res20 == (undefined *)0x0) {
                puVar11 = PTR_DAT_1402f8010;
              }
              FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x17f0),1,puVar11);
              if (((puVar7 != (undefined *)0x0) && (puVar7 != PTR_DAT_1402f8010)) &&
                 (puVar7 + -8 != (undefined *)0x0)) {
                uVar12 = FUN_1400a3440();
                FUN_1400a1c30(uVar12);
                piVar1 = (int *)(puVar7 + -4);
                *piVar1 = *piVar1 + -1;
                if (*piVar1 == 0) {
                  FUN_1400a3530(puVar7 + -8);
                }
                FUN_1400d1290(uVar12);
              }
              local_res20 = PTR_DAT_1402f8010;
            }
          }
          if ((local_res8 != (longlong *)0x0) &&
             (local_res8[1] = local_res8[1] + -1, uVar8 = uVar13, local_res8[1] == 0)) {
            FUN_1401462b0(local_res8);
          }
        }
        break;
      }
      puVar9 = *(uint **)(puVar9 + 4);
      if (puVar9 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar8);
  return 1;
}



void FUN_140156d30(longlong param_1,longlong *param_2,undefined8 param_3,double param_4)

{
  int *piVar1;
  int iVar2;
  void *pvVar3;
  undefined8 uVar4;
  uint uVar5;
  undefined8 *puVar6;
  longlong *plVar7;
  ulonglong uVar8;
  longlong lVar9;
  undefined8 uVar10;
  longlong lVar11;
  longlong lVar12;
  longlong *plVar13;
  int iVar14;
  ulonglong uVar15;
  uint uVar16;
  uint uVar17;
  int iVar18;
  int iVar19;
  longlong lVar20;
  ulonglong uVar21;
  longlong lVar22;
  undefined8 in_R9;
  int iVar23;
  int iVar24;
  longlong lVar25;
  longlong lVar26;
  bool bVar27;
  bool bVar28;
  undefined8 *local_e0;
  longlong local_d8;
  longlong local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  void *local_98;
  undefined1 local_90 [88];
  
  if ((int)param_3 == 0) {
    return;
  }
  local_a0 = 0xfffffffffffffffe;
  uVar16 = 0;
  lVar9 = param_1 + 0x17a0;
  FUN_140143f20(lVar9,0,param_3,in_R9,0);
  lVar25 = param_2[1];
  iVar24 = 0;
  lVar26 = lVar25;
  local_d8 = lVar25;
  if (0 < (int)lVar25) {
    do {
      if ((iVar24 < 0) || (param_2[1] <= (longlong)iVar24)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      iVar19 = iVar24;
      if (iVar24 < (int)lVar25) {
        do {
          lVar20 = (longlong)iVar24;
          if (iVar24 == iVar19) {
LAB_140156e68:
            bVar27 = false;
          }
          else {
            if ((iVar19 < 0) || (param_2[1] <= (longlong)iVar19)) {
                    // WARNING: Subroutine does not return
              FUN_1400a26d0();
            }
            if (param_2[1] <= lVar20) {
                    // WARNING: Subroutine does not return
              FUN_1400a26d0();
            }
            if ((ulonglong)param_2[2] < 0x65) {
              plVar7 = param_2 + (lVar20 + 1) * 4;
            }
            else {
              plVar7 = (longlong *)(lVar20 * 0x20 + *param_2);
            }
            plVar7 = (longlong *)FUN_1401553e0(param_1 + 0x2d8,&local_e0,(int)*plVar7);
            uVar16 = uVar16 | 1;
            if ((longlong *)*plVar7 == (longlong *)0x0) {
              lVar26 = 0;
              goto LAB_140156e68;
            }
            lVar26 = *(longlong *)*plVar7;
            if (lVar26 == 0) goto LAB_140156e68;
            bVar27 = true;
          }
          puVar6 = local_e0;
          if ((uVar16 & 1) != 0) {
            uVar17 = 0;
            uVar16 = 0;
            if ((local_e0 != (undefined8 *)0x0) &&
               (local_e0[1] = local_e0[1] + -1, local_e0[1] == 0)) {
              pvVar3 = (void *)*local_e0;
              local_98 = pvVar3;
              if (pvVar3 != (void *)0x0) {
                FUN_140140df0((longlong)pvVar3 + 0x148);
                FUN_140140df0((longlong)pvVar3 + 0x120);
                operator_delete(pvVar3);
              }
              FUN_1400a3530(puVar6);
              lVar25 = local_d8;
              uVar16 = uVar17;
            }
          }
          if (((bVar27) && (*(char *)(lVar26 + 8) == '\0')) &&
             (*(double *)(lVar26 + 0x188) <= param_4 && param_4 != *(double *)(lVar26 + 0x188))) {
            local_c8 = CONCAT44(iVar19,iVar24);
            local_d0 = lVar26;
            FUN_140144650(lVar9,*(undefined4 *)(param_1 + 0x17b8),&local_d0,1);
            uVar8 = 0;
            iVar18 = *(int *)(param_1 + 0x17b8);
            uVar15 = uVar8;
            uVar21 = uVar8;
            if (0 < (longlong)iVar18) {
              do {
                if (((longlong)uVar21 < 0) ||
                   (iVar14 = (int)uVar15, *(int *)(param_1 + 0x17b8) <= iVar14)) {
                    // WARNING: Subroutine does not return
                  FUN_1400a2700();
                }
                lVar20 = *(longlong *)(param_1 + 0x17b0);
                if (*(int *)(uVar8 + 8 + lVar20) == iVar24) {
                  piVar1 = (int *)(uVar8 + 0x10 + lVar20);
                  *piVar1 = *piVar1 + 1;
                }
                else if (*(int *)(uVar8 + 0xc + lVar20) == iVar24) {
                  piVar1 = (int *)(uVar8 + 0x14 + lVar20);
                  *piVar1 = *piVar1 + 1;
                }
                if (*(int *)(param_1 + 0x17b8) <= iVar14) {
                    // WARNING: Subroutine does not return
                  FUN_1400a2700();
                }
                lVar20 = *(longlong *)(param_1 + 0x17b0);
                if (*(int *)(uVar8 + 8 + lVar20) == iVar19) {
                  piVar1 = (int *)(uVar8 + 0x10 + lVar20);
                  *piVar1 = *piVar1 + 1;
                }
                else if (*(int *)(uVar8 + 0xc + lVar20) == iVar19) {
                  piVar1 = (int *)(uVar8 + 0x14 + lVar20);
                  *piVar1 = *piVar1 + 1;
                }
                uVar21 = uVar21 + 1;
                uVar8 = uVar8 + 0x18;
                uVar15 = (ulonglong)(iVar14 + 1);
              } while ((longlong)uVar21 < (longlong)iVar18);
            }
            local_d0 = 0;
            local_c8 = 0;
            local_c0 = 0;
          }
          iVar19 = iVar19 + 1;
        } while (iVar19 < (int)lVar25);
      }
      iVar24 = iVar24 + 1;
    } while (iVar24 < (int)lVar25);
  }
  uVar10 = 0;
  if (*(int *)(param_1 + 0x17b8) != 0) {
    uVar10 = *(undefined8 *)(param_1 + 0x17b0);
  }
  if (*(int *)(param_1 + 0x17b8) < 0x65) {
    FUN_1401459a0(uVar10);
  }
  else {
    FUN_140154b80();
  }
  FUN_140143980(param_1 + 0x17c8);
  iVar24 = 0;
  lVar25 = 0;
  if (0 < *(int *)(param_1 + 0x17b8)) {
    lVar26 = 0;
    do {
      if ((lVar25 < 0) || (*(int *)(param_1 + 0x17b8) <= iVar24)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      lVar20 = *(longlong *)(param_1 + 0x17b0);
      local_b8 = *(undefined8 *)(lVar26 + lVar20);
      uVar10 = *(undefined8 *)(lVar26 + 8 + lVar20);
      uVar4 = *(undefined8 *)(lVar26 + 0x10 + lVar20);
      iVar19 = *(int *)(param_1 + 0x17e0);
      lVar20 = (longlong)iVar19;
      local_b0._4_4_ = (int)((ulonglong)uVar10 >> 0x20);
      iVar18 = local_b0._4_4_;
      for (iVar14 = 0; local_b0 = uVar10, local_a8 = uVar4, iVar14 != iVar19; iVar14 = iVar14 + 1) {
        if ((iVar14 < 0) || (*(int *)(param_1 + 0x17e0) <= iVar14)) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        iVar23 = *(int *)(*(longlong *)(param_1 + 0x17d8) + (longlong)iVar14 * 4);
        if ((iVar23 == (int)uVar10) || (iVar23 == local_b0._4_4_)) goto LAB_14015718f;
      }
      local_a8._4_4_ = (int)((ulonglong)uVar4 >> 0x20);
      if ((int)uVar4 < local_a8._4_4_) {
        if (iVar19 < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        iVar14 = *(int *)(param_1 + 0x17e0);
        FUN_140143980();
        iVar14 = iVar14 - iVar19;
        if (0 < iVar14) {
          if (*(int *)(param_1 + 0x17e0) == 0) {
            lVar22 = 0;
            lVar12 = 0;
          }
          else {
            lVar22 = *(longlong *)(param_1 + 0x17d8);
            lVar12 = *(longlong *)(param_1 + 0x17d8);
          }
          memmove((void *)(lVar12 + 4 + lVar20 * 4),(void *)(lVar22 + lVar20 * 4),
                  (longlong)iVar14 << 2);
        }
        if (*(int *)(param_1 + 0x17e0) == 0) {
          lVar22 = 0;
        }
        else {
          lVar22 = *(longlong *)(param_1 + 0x17d8);
        }
        *(int *)(lVar22 + lVar20 * 4) = iVar18;
        uVar10 = local_b0;
      }
      else {
        if (iVar19 < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        iVar18 = *(int *)(param_1 + 0x17e0);
        FUN_140143980(param_1 + 0x17c8);
        iVar18 = iVar18 - iVar19;
        if (0 < iVar18) {
          if (*(int *)(param_1 + 0x17e0) == 0) {
            lVar22 = 0;
            lVar12 = 0;
          }
          else {
            lVar22 = *(longlong *)(param_1 + 0x17d8);
            lVar12 = *(longlong *)(param_1 + 0x17d8);
          }
          memmove((void *)(lVar12 + 4 + lVar20 * 4),(void *)(lVar22 + lVar20 * 4),
                  (longlong)iVar18 << 2);
        }
        if (*(int *)(param_1 + 0x17e0) == 0) {
          lVar22 = 0;
        }
        else {
          lVar22 = *(longlong *)(param_1 + 0x17d8);
        }
        *(undefined4 *)(lVar22 + lVar20 * 4) = (undefined4)local_b0;
        uVar10 = local_b0;
      }
LAB_14015718f:
      local_b0 = uVar10;
      iVar24 = iVar24 + 1;
      lVar25 = lVar25 + 1;
      lVar26 = lVar26 + 0x18;
    } while (iVar24 < *(int *)(param_1 + 0x17b8));
  }
  iVar19 = 0;
  lVar25 = 0;
  iVar24 = *(int *)(param_1 + 0x17e0);
  if (0 < (longlong)iVar24) {
    do {
      if ((lVar25 < 0) || (*(int *)(param_1 + 0x17e0) <= iVar19)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      iVar18 = *(int *)(*(longlong *)(param_1 + 0x17d8) + lVar25 * 4);
      lVar26 = (longlong)iVar18;
      if ((iVar18 < 0) || (param_2[1] <= lVar26)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if ((ulonglong)param_2[2] < 0x65) {
        plVar7 = param_2 + (lVar26 + 1) * 4;
      }
      else {
        plVar7 = (longlong *)(lVar26 * 0x20 + *param_2);
      }
      if ((plVar7[2] == 0) && (plVar7[3] == 0)) {
        lVar20 = 0;
        iVar23 = 0;
        lVar26 = 0;
        iVar14 = *(int *)(param_1 + 0x17b8);
        if (0 < (longlong)iVar14) {
          lVar22 = 0;
          do {
            if ((int)param_3 <= lVar20) break;
            if ((lVar26 < 0) || (*(int *)(param_1 + 0x17b8) <= iVar23)) {
                    // WARNING: Subroutine does not return
              FUN_1400a2700();
            }
            lVar12 = *(longlong *)(param_1 + 0x17b0);
            iVar2 = *(int *)(lVar12 + 8 + lVar22);
            lVar11 = (longlong)iVar2;
            if (iVar18 == iVar2) {
              lVar12 = (longlong)*(int *)(lVar12 + 0xc + lVar22);
              if ((lVar12 < 0) || (param_2[1] <= lVar12)) {
                    // WARNING: Subroutine does not return
                FUN_1400a26d0();
              }
              if ((ulonglong)param_2[2] < 0x65) {
                plVar13 = param_2 + (lVar12 + 1) * 4;
              }
              else {
                plVar13 = (longlong *)(lVar12 * 0x20 + *param_2);
              }
              if ((plVar13[2] == 0) && (plVar13[3] == 0)) {
LAB_14015732d:
                plVar7[3] = (longlong)plVar13;
                plVar13[2] = (longlong)plVar7;
                lVar20 = lVar20 + 1;
                plVar7 = (longlong *)plVar7[3];
              }
            }
            else if (iVar18 == *(int *)(lVar12 + 0xc + lVar22)) {
              if ((lVar11 < 0) || (param_2[1] <= lVar11)) {
                    // WARNING: Subroutine does not return
                FUN_1400a26d0();
              }
              if ((ulonglong)param_2[2] < 0x65) {
                plVar13 = param_2 + (lVar11 + 1) * 4;
              }
              else {
                plVar13 = (longlong *)(lVar11 * 0x20 + *param_2);
              }
              if ((plVar13[2] == 0) && (plVar13[3] == 0)) {
                plVar7[2] = 0;
                goto LAB_14015732d;
              }
            }
            iVar23 = iVar23 + 1;
            lVar26 = lVar26 + 1;
            lVar22 = lVar22 + 0x18;
          } while (lVar26 < iVar14);
        }
      }
      iVar19 = iVar19 + 1;
      lVar25 = lVar25 + 1;
    } while (lVar25 < iVar24);
  }
  FUN_140143f20(lVar9,0);
  iVar24 = *(int *)(param_1 + 0x17e0);
  if (iVar24 == 0) {
    return;
  }
  if (-1 < *(int *)(param_1 + 0x17e4)) goto LAB_140157491;
  iVar19 = *(int *)(param_1 + 0x17ec);
  if (iVar19 == 0) {
    uVar17 = (int)(iVar24 + (iVar24 >> 0x1f & 7U)) >> 3;
    uVar16 = 0x400;
    if ((int)uVar17 < 0x400) {
      uVar16 = uVar17;
    }
    uVar17 = 4;
    if (4 < (int)uVar16) {
      uVar17 = uVar16;
    }
LAB_140157405:
    uVar16 = *(uint *)(param_1 + 0x17e8);
    bVar28 = SBORROW4(uVar16,uVar17);
    uVar5 = uVar16 - uVar17;
    bVar27 = uVar16 == uVar17;
  }
  else {
    if (iVar19 == 1) {
      uVar16 = (int)(iVar24 + (iVar24 >> 0x1f & 7U)) >> 3;
      uVar17 = 0x10;
      if (0x10 < (int)uVar16) {
        uVar17 = uVar16;
      }
      if (uVar17 < 0x11) {
        uVar17 = 0x10;
      }
      goto LAB_140157405;
    }
    if (iVar19 != 2) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    uVar16 = *(uint *)(param_1 + 0x17e8);
    uVar17 = 0;
    bVar28 = false;
    bVar27 = uVar16 == 0;
    uVar5 = uVar16;
  }
  if (!bVar27 && bVar28 == (int)uVar5 < 0) {
    uVar17 = uVar16;
  }
  plVar7 = *(longlong **)(param_1 + 0x17d0);
  if (*(int *)(param_1 + 0x17e4) == 0) {
    if (plVar7 == (longlong *)0x0) {
      lVar9 = FUN_1400a34c0((longlong)(int)uVar17 << 2);
    }
    else {
      lVar9 = (**(code **)(*plVar7 + 8))(plVar7,(longlong)(int)uVar17 << 2);
    }
  }
  else {
    if (plVar7 == (longlong *)0x0) {
      lVar9 = FUN_1400a34f0(*(undefined8 *)(param_1 + 0x17d8),(longlong)(int)uVar17 << 2);
    }
    else {
      lVar9 = (**(code **)(*plVar7 + 0x10))
                        (plVar7,*(undefined8 *)(param_1 + 0x17d8),(longlong)(int)uVar17 << 2);
    }
    if (lVar9 == 0) {
      FUN_1400a2320(local_90,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_90,(ThrowInfo *)&DAT_1402f4860);
    }
  }
  *(longlong *)(param_1 + 0x17d8) = lVar9;
  *(uint *)(param_1 + 0x17e4) = uVar17;
LAB_140157491:
  *(undefined4 *)(param_1 + 0x17e0) = 0;
  return;
}



void FUN_1401574c0(longlong param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined *puVar5;
  undefined *puVar6;
  undefined *local_res8;
  longlong *local_res10;
  undefined *local_res18 [2];
  undefined8 uVar7;
  
  uVar7 = 0xfffffffffffffffe;
  local_res10 = param_2;
  FUN_1400a3440();
  local_res8 = PTR_DAT_1402f8010;
  uVar4 = 0;
  uVar3 = uVar4;
  if (*param_2 != 0) {
    uVar3 = *(undefined8 *)(*param_2 + 0x38);
  }
  plVar2 = (longlong *)FUN_1401417c0(uVar3,local_res18);
  puVar5 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar5 = PTR_DAT_1402f8010;
  }
  FUN_14003c600(&local_res8,L"WARNING: %s",puVar5,param_4,uVar7);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1402f8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res18[0] + -8);
    }
    FUN_1400d1290(uVar3);
  }
  puVar5 = local_res8;
  if (*(longlong *)(param_1 + 0x17f0) != 0) {
    puVar6 = local_res8;
    if (local_res8 == (undefined *)0x0) {
      puVar6 = PTR_DAT_1402f8010;
    }
    FUN_1401946b0(*(longlong *)(param_1 + 0x17f0),0,puVar6);
  }
  if (*(longlong *)(param_1 + 0x758) != 0) {
    if (*param_2 != 0) {
      uVar4 = *(undefined8 *)(*param_2 + 0x38);
    }
    (**(code **)(**(longlong **)(param_1 + 0x758) + 0x10))(*(longlong **)(param_1 + 0x758),uVar4);
  }
  if (((puVar5 != (undefined *)0x0) && (puVar5 != PTR_DAT_1402f8010)) &&
     (puVar5 + -8 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    FUN_1400a1c30(uVar4);
    piVar1 = (int *)(puVar5 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar5 + -8);
    }
    FUN_1400d1290(uVar4);
  }
  FUN_14008c980(param_2);
  return;
}



void FUN_140157630(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1401a2fe0(param_1 + 5);
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_140154a50(param_1[2],(longlong)*(int *)(param_1 + 3));
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2],plVar1,param_4,uVar2);
    }
  }
  return;
}



void FUN_1401576a0(longlong *param_1,longlong param_2,undefined8 param_3)

{
  ulonglong uVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  undefined8 uVar5;
  uint *puVar6;
  undefined8 uVar7;
  longlong lVar8;
  uint *puVar9;
  uint uVar10;
  uint uVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  uint *local_res8;
  undefined1 local_res10 [8];
  undefined **local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  
  uVar5 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(uVar5);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1);
  }
  uVar1 = (ulonglong)((uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8)) %
          (ulonglong)*(uint *)(param_1 + 0x76);
  uVar12 = 0;
  uVar13 = uVar12;
  if (param_1[0x72] != 0) {
    lVar8 = *(longlong *)(param_1[0x72] + uVar1 * 8);
    while( true ) {
      if ((lVar8 == 0) || ((uint)uVar1 != *(uint *)(lVar8 + 0x28) % *(uint *)(param_1 + 0x76)))
      goto LAB_140157763;
      if ((*(uint *)(lVar8 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar8 + 0xc) == *(ushort *)(param_2 + 0xc))) break;
      lVar8 = *(longlong *)(lVar8 + 0x18);
    }
    uVar13 = *(ulonglong *)(lVar8 + 0x10);
  }
LAB_140157763:
  FUN_1400a3440();
  local_res8 = (uint *)PTR_DAT_1402f8010;
  uVar2 = FUN_1400a32c0(param_3);
  uVar10 = 0;
  if ((local_res8 != (uint *)0x0) && (uVar12 = 0, local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar12 = (ulonglong)local_res8[-2];
  }
  uVar4 = uVar2;
  if ((((int)uVar2 <= (int)uVar12) && (uVar4 = uVar10, local_res8 != (uint *)0x0)) &&
     (local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar4 = local_res8[-2];
  }
  uVar11 = 1;
  if (1 < (int)uVar4) {
    uVar11 = uVar4;
  }
  uVar3 = 0;
  uVar4 = uVar3;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar4 = local_res8[-2];
  }
  if ((int)uVar4 < (int)uVar11) {
    if (local_res8 == (uint *)0x0) {
      local_res8 = (uint *)PTR_DAT_1402f8010;
    }
    if ((int)uVar11 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar11 == 0) {
      FUN_1400031d0(&local_res8);
    }
    else {
      uVar4 = uVar3;
      if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
        uVar4 = local_res8[-2];
      }
      if (uVar11 != uVar4) {
        puVar6 = (uint *)FUN_1400a34c0((longlong)(int)uVar11 * 2 + 10);
        if (puVar6 != (uint *)0x0) {
          *puVar6 = 0;
          puVar6[1] = 1;
        }
        *puVar6 = uVar11;
        if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
          uVar3 = local_res8[-2];
        }
        puVar9 = (uint *)PTR_DAT_1402f8010;
        if ((int)uVar11 < (int)uVar3) {
LAB_140157854:
          if (local_res8 != (uint *)0x0) {
            puVar9 = local_res8;
          }
        }
        else {
          uVar11 = uVar10;
          if (local_res8 != (uint *)0x0) {
            if (local_res8 != (uint *)PTR_DAT_1402f8010) {
              uVar11 = local_res8[-2];
            }
            goto LAB_140157854;
          }
        }
        FUN_1400a32f0(puVar6 + 2,puVar9,uVar11);
        FUN_1400031d0(&local_res8);
        local_res8 = puVar6 + 2;
      }
    }
  }
  uVar10 = 0;
  FUN_140002e30(&local_res8);
  puVar6 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar6,param_3,uVar2);
  puVar6 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1402f8010;
  }
  uVar4 = FUN_1400a32c0(puVar6);
  uVar11 = 0;
  uVar2 = uVar10;
  if (0 < (int)uVar4) {
    uVar2 = uVar4;
  }
  uVar4 = uVar11;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar4 = local_res8[-2];
  }
  if (((int)uVar4 <= (int)uVar2) && (uVar2 = uVar11, local_res8 != (uint *)0x0)) {
    if (local_res8 == (uint *)PTR_DAT_1402f8010) goto LAB_140157902;
    uVar2 = local_res8[-2];
  }
  if (((local_res8 != (uint *)PTR_DAT_1402f8010) && (local_res8 != (uint *)0x0)) &&
     (local_res8 + -2 != (uint *)0x0)) {
    local_res8[-2] = uVar2;
    *(undefined2 *)((longlong)local_res8 + (longlong)(int)uVar2 * 2) = 0;
  }
LAB_140157902:
  if (uVar13 != 0) {
    uVar10 = *(uint *)(uVar13 + 0x6f8);
  }
  local_58 = 0;
  local_50 = 0;
  local_48 = 0;
  local_40 = 0;
  local_60 = Proud::ByteArray::vftable;
  uVar7 = FUN_1401416a0(local_res10,0x1f,uVar10,&local_res8,&local_60);
  (**(code **)(*param_1 + 0x88))(param_1,uVar7);
  FUN_140140df0(&local_60);
  puVar6 = local_res8;
  if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) &&
     (puVar9 = local_res8 + -2, puVar9 != (uint *)0x0)) {
    uVar7 = FUN_1400a3440();
    FUN_1400a1c30(uVar7);
    puVar6 = puVar6 + -1;
    *puVar6 = *puVar6 - 1;
    if (*puVar6 == 0) {
      FUN_1400a3530(puVar9);
    }
    FUN_1400d1290(uVar7);
  }
  FUN_1400d1290(uVar5);
  return;
}



longlong FUN_1401579e0(longlong param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong *local_res8;
  longlong local_28 [4];
  
  local_28[1] = 0xfffffffffffffffe;
  local_res8 = (longlong *)0x0;
  plVar1 = (longlong *)FUN_1401553e0(param_1 + 0x230,local_28,param_2,param_3);
  if (*plVar1 != 0) {
    *(longlong *)(*plVar1 + 8) = *(longlong *)(*plVar1 + 8) + 1;
    local_res8 = (longlong *)*plVar1;
  }
  if ((local_28[0] != 0) &&
     (*(longlong *)(local_28[0] + 8) = *(longlong *)(local_28[0] + 8) + -1,
     *(longlong *)(local_28[0] + 8) == 0)) {
    local_28[0] = FUN_1401462b0(local_28[0]);
  }
  if ((local_res8 != (longlong *)0x0) && (local_28[0] = *local_res8, local_28[0] != 0)) {
    *(undefined8 *)(local_28[0] + 0x188) = param_4;
  }
  if (local_res8 != (longlong *)0x0) {
    plVar1 = local_res8 + 1;
    *plVar1 = *plVar1 + -1;
    local_28[0] = local_res8[1];
    if (*plVar1 == 0) {
      local_28[0] = FUN_1401462b0(local_res8);
    }
  }
  return local_28[0];
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140157aa0(longlong *param_1,longlong *param_2)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  longlong *plVar4;
  undefined *puVar5;
  int iVar6;
  undefined4 uVar7;
  undefined8 uVar8;
  undefined **ppuVar9;
  double dVar10;
  undefined *local_res8;
  undefined1 local_res10 [8];
  undefined **local_60;
  undefined4 local_58;
  undefined2 local_54;
  undefined **local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_30;
  
  iVar3 = *(int *)(param_2[0xe9] + 0x7c);
  plVar4 = (longlong *)param_2[0xe8];
  iVar6 = 0;
  if (((plVar4 != (longlong *)0x0) && (iVar6 = 0, *plVar4 != 0)) && ((char)param_2[0xe0] != '\0')) {
    local_60 = Proud::AddrPort::vftable;
    local_58 = (undefined4)param_2[0xe2];
    local_54 = *(undefined2 *)((longlong)param_2 + 0x714);
    iVar6 = FUN_14019cd60(*(undefined8 *)(*plVar4 + 0x168),&local_60);
  }
  *(int *)(param_2 + 0x3d) = iVar6 + iVar3;
  dVar10 = (double)(**(code **)(param_1[0x23] + 8))();
  if ((double)param_2[0x44] == 0.0) {
    if (DAT_1402f8194 < (int)param_2[0x3d]) {
      param_2[0x44] = (longlong)dVar10;
    }
  }
  else if (DAT_1402f8194 < (int)param_2[0x3d]) {
    if (_DAT_1402f81b0 < dVar10 - (double)param_2[0x44]) {
      FUN_1400a3440();
      local_res8 = PTR_DAT_1402f8010;
      FUN_14003c600(&local_res8,L"sendQueue %dBytes",(int)param_2[0x3d]);
      local_48 = 0;
      local_40 = 0;
      local_38 = 0;
      local_30 = 0;
      local_50 = Proud::ByteArray::vftable;
      uVar7 = (**(code **)(*param_2 + 0x10))(param_2);
      uVar8 = FUN_1401416a0(local_res10,0x25,uVar7,&local_res8,&local_50);
      (**(code **)(*param_1 + 0x88))(param_1,uVar8);
      FUN_140140df0(&local_50);
      puVar5 = local_res8;
      param_2[0x44] = (longlong)dVar10;
      if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1402f8010)) &&
         (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
        ppuVar9 = (undefined **)FUN_1400a3440();
        local_60 = ppuVar9;
        FUN_1400a1c30(ppuVar9);
        local_58 = CONCAT31(local_58._1_3_,1);
        piVar2 = (int *)(puVar5 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(puVar1);
        }
        FUN_1400d1290(ppuVar9);
      }
    }
  }
  else {
    param_2[0x44] = 0;
  }
  return;
}



void FUN_140157cb0(void)

{
  FUN_140155600();
  return;
}



void FUN_140157cd0(longlong param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 *puVar2;
  void *pvVar3;
  longlong *plVar4;
  uint uVar5;
  ulonglong uVar6;
  longlong lVar7;
  float fVar8;
  
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
  FUN_1401b2030(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  lVar7 = *(longlong *)(param_1 + 0x10);
  while (lVar7 != 0) {
    lVar1 = *(longlong *)(lVar7 + 0x10);
    if ((*(longlong *)(lVar7 + 8) != 0) &&
       (*(longlong *)(*(longlong *)(lVar7 + 8) + 8) =
             *(longlong *)(*(longlong *)(lVar7 + 8) + 8) + -1,
       *(longlong *)(*(longlong *)(lVar7 + 8) + 8) == 0)) {
      puVar2 = *(undefined8 **)(lVar7 + 8);
      pvVar3 = (void *)*puVar2;
      if (pvVar3 != (void *)0x0) {
        FUN_140140df0((longlong)pvVar3 + 0x148);
        FUN_140140df0((longlong)pvVar3 + 0x120);
        operator_delete(pvVar3);
      }
      FUN_1400a3530(puVar2);
    }
    plVar4 = *(longlong **)(param_1 + 0x50);
    if (plVar4 == (longlong *)0x0) {
      FUN_1400a3530(lVar7);
    }
    else {
      (**(code **)(*plVar4 + 0x18))(plVar4,lVar7);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar7 = lVar1;
  }
  FUN_1400a3530(*(undefined8 *)(param_1 + 8));
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  FUN_1401b2030(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar5 = FUN_140142850(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_1400a3530();
      *(undefined8 *)(param_1 + 8) = 0;
    }
    *(uint *)(param_1 + 0x28) = uVar5;
    fVar8 = (float)uVar5 * *(float *)(param_1 + 0x34);
    lVar7 = 0;
    if ((9.223372e+18 < fVar8) && (fVar8 = fVar8 - 9.223372e+18, fVar8 < 9.223372e+18)) {
      lVar7 = -0x8000000000000000;
    }
    *(longlong *)(param_1 + 0x38) = (longlong)fVar8 + lVar7;
    fVar8 = (float)uVar5 * *(float *)(param_1 + 0x30);
    lVar7 = 0;
    if ((9.223372e+18 < fVar8) && (fVar8 = fVar8 - 9.223372e+18, fVar8 < 9.223372e+18)) {
      lVar7 = -0x8000000000000000;
    }
    uVar6 = (longlong)fVar8 + lVar7;
    if ((ulonglong)((longlong)fVar8 + lVar7) < 0x11) {
      uVar6 = 0;
    }
    *(ulonglong *)(param_1 + 0x40) = uVar6;
  }
  FUN_1401b2030(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



longlong FUN_140157e80(longlong param_1,longlong param_2)

{
  ulonglong uVar1;
  longlong lVar2;
  uint uVar3;
  
  uVar3 = (uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8);
  uVar1 = (ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + uVar1 * 8);
        (lVar2 != 0 && ((uint)uVar1 == *(uint *)(lVar2 + 0x28) % *(uint *)(param_1 + 0x28)));
        lVar2 = *(longlong *)(lVar2 + 0x18)) {
      if ((*(uint *)(lVar2 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar2 + 0xc) == *(ushort *)(param_2 + 0xc))) {
        return lVar2 + 0x10;
      }
    }
  }
  lVar2 = FUN_140155930(param_1,param_2,uVar1,uVar3);
  return lVar2 + 0x10;
}



undefined8 FUN_140157f30(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_140144560(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  FUN_1401b2030(param_1);
  uVar2 = FUN_1401559b0(param_1,param_2,param_3,param_4);
  FUN_1401b2030(param_1);
  return uVar2;
}



longlong FUN_140157fb0(longlong param_1,undefined8 param_2,ulonglong param_3,undefined4 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined4 uVar3;
  longlong lVar4;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    lVar4 = FUN_1400a34c0(0x28);
  }
  else {
    lVar4 = (**(code **)(*plVar1 + 8))(plVar1,0x28,param_3,param_4,0xfffffffffffffffe);
  }
  if (lVar4 != 0) {
    FUN_140154af0(lVar4,param_2,param_4);
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + (param_3 & 0xffffffff) * 8);
  FUN_1401b2030(param_1);
  if (*(longlong *)(param_1 + 0x20) == 0) {
    *(longlong *)(param_1 + 0x10) = lVar4;
    *(longlong *)(param_1 + 0x18) = lVar4;
    *(undefined8 *)(lVar4 + 0x18) = 0;
    *(undefined8 *)(lVar4 + 0x10) = 0;
  }
  else {
    FUN_1401b2030(param_1);
    FUN_1401b2030(param_1);
    if (lVar2 == 0) {
      lVar2 = *(longlong *)(param_1 + 0x10);
      *(undefined8 *)(lVar4 + 0x18) = 0;
      *(longlong *)(lVar4 + 0x10) = lVar2;
      if (lVar2 != 0) {
        *(longlong *)(lVar2 + 0x18) = lVar4;
      }
      *(longlong *)(param_1 + 0x10) = lVar4;
    }
    else {
      if (*(longlong *)(lVar2 + 0x18) == 0) {
        *(longlong *)(param_1 + 0x10) = lVar4;
      }
      else {
        *(longlong *)(*(longlong *)(lVar2 + 0x18) + 0x10) = lVar4;
      }
      *(undefined8 *)(lVar4 + 0x18) = *(undefined8 *)(lVar2 + 0x18);
      *(longlong *)(lVar4 + 0x10) = lVar2;
      *(longlong *)(lVar2 + 0x18) = lVar4;
    }
  }
  *(longlong *)(*(longlong *)(param_1 + 8) + (param_3 & 0xffffffff) * 8) = lVar4;
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  FUN_1401b2030(param_1);
  FUN_1401b2030(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_140142850(param_1);
    FUN_1401b2490(param_1,uVar3);
  }
  FUN_1401b2030(param_1);
  return lVar4;
}



void FUN_140158100(longlong param_1,longlong param_2,undefined1 param_3)

{
  uint uVar1;
  ulonglong uVar2;
  uint uVar3;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  uVar1 = *(uint *)(param_1 + 0x28);
  uVar2 = (ulonglong)*(uint *)(param_2 + 0x20) % (ulonglong)uVar1;
  if (*(longlong *)(param_1 + 0x20) == 1) {
    *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    *(undefined8 *)(param_1 + 0x10) = 0;
    *(undefined8 *)(param_1 + 0x18) = 0;
  }
  else {
    uVar3 = (uint)uVar2;
    if (((*(longlong *)(param_2 + 0x18) == 0) ||
        (*(uint *)(*(longlong *)(param_2 + 0x18) + 0x20) % uVar1 != uVar3)) &&
       ((*(longlong *)(param_2 + 0x10) == 0 ||
        (*(uint *)(*(longlong *)(param_2 + 0x10) + 0x20) % uVar1 != uVar3)))) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    }
    else if (param_2 == *(longlong *)(*(longlong *)(param_1 + 8) + (longlong)(int)uVar3 * 8)) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = *(undefined8 *)(param_2 + 0x10);
    }
    if (param_2 == *(longlong *)(param_1 + 0x10)) {
      *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(param_2 + 0x10);
      *(undefined8 *)(param_2 + 0x18) = 0;
    }
    if (param_2 == *(longlong *)(param_1 + 0x18)) {
      *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
      *(undefined8 *)(param_2 + 0x10) = 0;
    }
    if (*(longlong *)(param_2 + 0x18) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x18) + 0x10) = *(undefined8 *)(param_2 + 0x10);
    }
    if (*(longlong *)(param_2 + 0x10) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x10) + 0x18) = *(undefined8 *)(param_2 + 0x18);
    }
  }
  FUN_140155b00(param_1,param_2,param_3);
  FUN_1401b2030(param_1);
  return;
}



undefined8 FUN_140158200(longlong param_1,undefined4 param_2,undefined8 param_3)

{
  ulonglong *puVar1;
  longlong lVar2;
  ulonglong *puVar3;
  char cVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  ulonglong uVar8;
  uint *puVar9;
  undefined8 uVar10;
  undefined *puVar11;
  uint *puVar12;
  uint uVar13;
  uint uVar14;
  ulonglong uVar15;
  uint *local_res8;
  longlong local_res20;
  ulonglong *local_98;
  undefined8 local_90;
  longlong local_88;
  undefined1 local_80;
  undefined8 local_78;
  undefined1 local_70;
  undefined **local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  
  local_90 = 0xfffffffffffffffe;
  local_res8 = (uint *)FUN_1400a34c0(0x400);
  uVar15 = 0;
  uVar14 = 0;
  uVar8 = uVar15;
  if (local_res8 != (uint *)0x0) {
    uVar8 = param_1 + 0x60;
    if (param_1 == 0) {
      uVar8 = uVar15;
    }
    uVar8 = FUN_1400a8db0(local_res8,0,uVar8);
  }
  if (uVar8 == 0) {
    local_98 = (ulonglong *)0x0;
  }
  else {
    local_98 = (ulonglong *)FUN_1400a34c0(0x10);
    local_98[1] = 1;
    *local_98 = uVar8;
  }
  puVar1 = local_98;
  FUN_1400a5190(param_1 + 0x748,&local_98);
  puVar3 = local_98;
  if (puVar1 != (ulonglong *)0x0) {
    puVar1 = puVar1 + 1;
    *puVar1 = *puVar1 - 1;
    if (*puVar1 == 0) {
      uVar8 = *local_98;
      if (uVar8 != 0) {
        FUN_1400a8cc0(uVar8);
        FUN_1400a3530(uVar8);
      }
      FUN_1400a3530(puVar3);
    }
  }
  uVar8 = uVar15;
  if (*(ulonglong **)(param_1 + 0x748) != (ulonglong *)0x0) {
    uVar8 = **(ulonglong **)(param_1 + 0x748);
  }
  *(undefined1 *)(uVar8 + 0x314) = 1;
  puVar11 = *(undefined **)(param_1 + 0x218);
  if (*(undefined **)(param_1 + 0x218) == (undefined *)0x0) {
    puVar11 = PTR_DAT_1402f8008;
  }
  uVar8 = uVar15;
  if (*(ulonglong **)(param_1 + 0x748) != (ulonglong *)0x0) {
    uVar8 = **(ulonglong **)(param_1 + 0x748);
  }
  cVar4 = FUN_1400aa3f0(uVar8,puVar11,param_2);
  if (cVar4 != '\0') {
    uVar8 = uVar15;
    if (*(ulonglong **)(param_1 + 0x748) != (ulonglong *)0x0) {
      uVar8 = **(ulonglong **)(param_1 + 0x748);
    }
    FUN_1400a9dc0(uVar8);
    uVar8 = uVar15;
    if (*(ulonglong **)(param_1 + 0x748) != (ulonglong *)0x0) {
      uVar8 = **(ulonglong **)(param_1 + 0x748);
    }
    FUN_1400a7fb0(uVar8,param_1 + 0xb0);
    if (*(ulonglong **)(param_1 + 0x748) != (ulonglong *)0x0) {
      uVar15 = **(ulonglong **)(param_1 + 0x748);
    }
    FUN_1400ace20(*(undefined8 *)(param_1 + 0x790),uVar15);
    return 1;
  }
  FUN_1400a3440();
  local_res8 = (uint *)PTR_DAT_1402f8010;
  uVar5 = FUN_1400a32c0(&DAT_14027d1a0);
  if ((local_res8 != (uint *)0x0) && (uVar15 = 0, local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar15 = (ulonglong)local_res8[-2];
  }
  uVar6 = 0;
  uVar7 = uVar5;
  if ((((int)uVar5 <= (int)uVar15) && (uVar7 = uVar14, local_res8 != (uint *)0x0)) &&
     (uVar7 = uVar6, local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar7 = local_res8[-2];
  }
  uVar13 = 1;
  if (1 < (int)uVar7) {
    uVar13 = uVar7;
  }
  uVar7 = uVar6;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar7 = local_res8[-2];
  }
  if ((int)uVar7 < (int)uVar13) {
    if (local_res8 == (uint *)0x0) {
      local_res8 = (uint *)PTR_DAT_1402f8010;
    }
    if ((int)uVar13 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar13 == 0) {
      FUN_1400031d0(&local_res8);
    }
    else {
      uVar7 = uVar14;
      if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
        uVar7 = local_res8[-2];
      }
      if (uVar13 != uVar7) {
        puVar9 = (uint *)FUN_1400a34c0((longlong)(int)uVar13 * 2 + 10);
        if (puVar9 != (uint *)0x0) {
          *puVar9 = 0;
          puVar9[1] = 1;
        }
        *puVar9 = uVar13;
        uVar7 = uVar14;
        if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
          uVar7 = local_res8[-2];
        }
        puVar12 = (uint *)PTR_DAT_1402f8010;
        if ((int)uVar13 < (int)uVar7) {
LAB_14015841d:
          if (local_res8 != (uint *)0x0) {
            puVar12 = local_res8;
          }
        }
        else {
          uVar13 = uVar14;
          if (local_res8 != (uint *)0x0) {
            if (local_res8 != (uint *)PTR_DAT_1402f8010) {
              uVar13 = local_res8[-2];
            }
            goto LAB_14015841d;
          }
        }
        FUN_1400a32f0(puVar9 + 2,puVar12,uVar13);
        FUN_1400031d0(&local_res8);
        local_res8 = puVar9 + 2;
      }
    }
  }
  FUN_140002e30(&local_res8);
  puVar9 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar9 = (uint *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar9,&DAT_14027d1a0,uVar5);
  puVar9 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar9 = (uint *)PTR_DAT_1402f8010;
  }
  uVar5 = FUN_1400a32c0(puVar9);
  uVar14 = 0;
  if (0 < (int)uVar5) {
    uVar14 = uVar5;
  }
  uVar5 = uVar6;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar5 = local_res8[-2];
  }
  if (((int)uVar5 <= (int)uVar14) && (uVar14 = uVar6, local_res8 != (uint *)0x0)) {
    if (local_res8 == (uint *)PTR_DAT_1402f8010) goto LAB_1401584cd;
    uVar14 = local_res8[-2];
  }
  if (((local_res8 != (uint *)PTR_DAT_1402f8010) && (local_res8 != (uint *)0x0)) &&
     (local_res8 + -2 != (uint *)0x0)) {
    local_res8[-2] = uVar14;
    *(undefined2 *)((longlong)local_res8 + (longlong)(int)uVar14 * 2) = 0;
  }
LAB_1401584cd:
  local_60 = 0;
  local_58 = 0;
  local_50 = 0;
  local_48 = 0;
  local_68 = Proud::ByteArray::vftable;
  uVar10 = FUN_1401416a0(&local_res20,0x10,1,&local_res8,&local_68);
  FUN_140141570(param_3,uVar10);
  lVar2 = local_res20;
  if (local_res20 != 0) {
    local_88 = local_res20;
    FUN_1400a1c30(local_res20);
    local_80 = 1;
    *(longlong *)(local_res20 + 0x40) = *(longlong *)(local_res20 + 0x40) + -1;
    if (*(longlong *)(local_res20 + 0x40) == 0) {
      FUN_1400d1290(lVar2);
      local_80 = 0;
      FUN_14008c910(local_res20);
    }
    else {
      FUN_1400d1290(lVar2);
    }
  }
  FUN_140140df0(&local_68);
  puVar9 = local_res8;
  if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) &&
     (puVar12 = local_res8 + -2, puVar12 != (uint *)0x0)) {
    uVar10 = FUN_1400a3440();
    local_78 = uVar10;
    FUN_1400a1c30(uVar10);
    local_70 = 1;
    puVar9 = puVar9 + -1;
    *puVar9 = *puVar9 - 1;
    if (*puVar9 == 0) {
      FUN_1400a3530(puVar12);
    }
    FUN_1400d1290(uVar10);
  }
  return 0;
}



void FUN_140158650(longlong param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined *puVar4;
  undefined *local_res8;
  longlong *local_res10;
  
  local_res10 = param_2;
  if (*(longlong *)(param_1 + 0x17f0) != 0) {
    if (*param_2 == 0) {
      uVar3 = 0;
    }
    else {
      uVar3 = *(undefined8 *)(*param_2 + 0x38);
    }
    plVar2 = (longlong *)FUN_1401417c0(uVar3,&local_res8,param_3,param_4,0xfffffffffffffffe);
    puVar4 = (undefined *)*plVar2;
    if ((undefined *)*plVar2 == (undefined *)0x0) {
      puVar4 = PTR_DAT_1402f8010;
    }
    FUN_1401946b0(*(undefined8 *)(param_1 + 0x17f0),0,puVar4);
    if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1402f8010)) &&
       (local_res8 + -8 != (undefined *)0x0)) {
      uVar3 = FUN_1400a3440();
      FUN_1400a1c30(uVar3);
      piVar1 = (int *)(local_res8 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(local_res8 + -8);
      }
      FUN_1400d1290(uVar3);
    }
  }
  local_res8 = (undefined *)0x0;
  FUN_140141570(&local_res8,param_2);
  FUN_140188230(param_1,&local_res8);
  FUN_14008c980(param_2);
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140158740(undefined8 param_1)

{
  undefined1 auStack_1138 [56];
  undefined **local_1100;
  longlong *local_10f8;
  longlong local_10f0;
  int local_10e8;
  undefined1 local_10d8 [4192];
  undefined8 local_78;
  ulonglong local_40;
  undefined8 local_10;
  
  local_10 = 0xfffffffffffffffe;
  local_40 = DAT_1402f85a0 ^ (ulonglong)auStack_1138;
  FUN_1401a35f0(&local_1100);
  local_78 = param_1;
  FUN_1401a3660(&local_1100);
  FUN_1401a2fe0(local_10d8);
  local_1100 = Proud::CFastArray<>::vftable;
  if (0 < local_10e8) {
    FUN_140154a50(local_10f0,(longlong)local_10e8);
  }
  if (local_10f0 != 0) {
    if (local_10f8 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*local_10f8 + 0x18))(local_10f8,local_10f0);
    }
  }
  return;
}



void FUN_140158810(void)

{
  FUN_140157cd0();
  return;
}



undefined8 FUN_140158830(longlong param_1,longlong param_2,undefined8 param_3)

{
  longlong lVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  
  uVar2 = (ulonglong)((uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8)) %
          (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (lVar1 = *(longlong *)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (lVar1 != 0 && ((uint)uVar2 == *(uint *)(lVar1 + 0x28) % *(uint *)(param_1 + 0x28)));
        lVar1 = *(longlong *)(lVar1 + 0x18)) {
      if ((*(uint *)(lVar1 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar1 + 0xc) == *(ushort *)(param_2 + 0xc))) {
        return 0;
      }
    }
  }
  uVar3 = FUN_140157e80(param_1,param_2);
  FUN_14016b650(uVar3,param_3);
  return 1;
}



void FUN_1401588e0(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *param_2;
  if (lVar1 != *param_1) {
    if (lVar1 != 0) {
      *(longlong *)(*param_2 + 8) = *(longlong *)(lVar1 + 8) + 1;
    }
    plVar2 = (longlong *)0x0;
    if ((*param_1 != 0) &&
       (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
       *(longlong *)(*param_1 + 8) == 0)) {
      plVar2 = (longlong *)*param_1;
    }
    *param_1 = *param_2;
    if (plVar2 != (longlong *)0x0) {
      lVar1 = *plVar2;
      if (lVar1 != 0) {
        FUN_140149600(lVar1);
        FUN_1400a3530(lVar1);
      }
      FUN_1400a3530(plVar2);
    }
  }
  return;
}



int * FUN_140158970(longlong param_1,int *param_2)

{
  int *piVar1;
  ulonglong uVar2;
  longlong lVar3;
  uint uVar4;
  
  uVar4 = *param_2 << 0x10 ^ param_2[1];
  uVar2 = (ulonglong)uVar4 % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (piVar1 = *(int **)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (piVar1 != (int *)0x0 && ((uint)uVar2 == (uint)piVar1[8] % *(uint *)(param_1 + 0x28)));
        piVar1 = *(int **)(piVar1 + 4)) {
      if ((*piVar1 == *param_2) && (piVar1[1] == param_2[1])) {
        return piVar1 + 2;
      }
    }
  }
  lVar3 = FUN_140157f30(param_1,param_2,uVar2,uVar4);
  return (int *)(lVar3 + 8);
}



undefined8 FUN_140158a20(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_140144560(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  FUN_1401b2030(param_1);
  uVar2 = FUN_140157fb0(param_1,param_2,param_3,param_4);
  FUN_1401b2030(param_1);
  return uVar2;
}



void FUN_140158aa0(longlong param_1)

{
  longlong *plVar1;
  longlong lVar2;
  
  if (*(longlong *)(param_1 + 8) != 0) {
    *(longlong *)(*(longlong *)(param_1 + 8) + 8) =
         *(longlong *)(*(longlong *)(param_1 + 8) + 8) + -1;
    if (*(longlong *)(*(longlong *)(param_1 + 8) + 8) == 0) {
      plVar1 = *(longlong **)(param_1 + 8);
      lVar2 = *plVar1;
      if (lVar2 != 0) {
        FUN_140149600(lVar2);
        FUN_1400a3530(lVar2);
      }
      FUN_1400a3530(plVar1);
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140158bd3)
// WARNING: Removing unreachable block (ram,0x000140158bda)
// WARNING: Removing unreachable block (ram,0x000140158be6)
// WARNING: Removing unreachable block (ram,0x000140158c10)
// WARNING: Removing unreachable block (ram,0x000140158c30)

undefined8
FUN_140158b10(longlong *param_1,int param_2,undefined8 *param_3,longlong param_4,undefined8 param_5)

{
  undefined4 uVar1;
  int iVar2;
  undefined *puVar3;
  undefined8 *puVar4;
  longlong *plVar5;
  char cVar6;
  uint uVar7;
  uint uVar8;
  undefined8 uVar9;
  undefined4 *puVar10;
  longlong lVar11;
  longlong *plVar12;
  longlong lVar13;
  longlong lVar14;
  uint *puVar15;
  uint *puVar16;
  int iVar17;
  uint uVar18;
  uint uVar19;
  longlong lVar20;
  int local_res10;
  uint *local_158;
  longlong *local_150;
  longlong local_148;
  longlong local_140;
  longlong *local_138;
  longlong *local_130;
  undefined1 local_128 [8];
  undefined8 local_120;
  undefined1 local_118;
  longlong local_110;
  undefined1 local_108;
  undefined4 local_100;
  int local_fc;
  undefined **local_f8;
  undefined8 local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  longlong local_d0;
  undefined1 local_c8;
  undefined8 local_c0;
  undefined1 local_b8;
  undefined8 local_b0;
  undefined1 local_a8 [16];
  undefined1 local_98 [88];
  
  local_b0 = 0xfffffffffffffffe;
  uVar9 = (**(code **)(*param_1 + 0x58))();
  local_120 = uVar9;
  FUN_1400a1c30(uVar9);
  local_118 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::CreateAndInitUdpSockets");
  }
  if (param_2 == 0) {
    FUN_14008c7d0(param_3,param_1 + 0x309);
    FUN_1400d1290(uVar9);
  }
  else {
    if (*(int *)(param_3 + 3) == 0) {
      local_fc = *(int *)(param_3 + 3);
      FUN_140021fb0(param_3,1);
      puVar10 = (undefined4 *)FUN_14008c850(param_3);
      *puVar10 = 0;
    }
    local_138 = param_1 + 0xd9;
    FUN_140153020(local_138,0);
    local_130 = param_1 + 0xde;
    FUN_140155600(local_130);
    local_res10 = 0;
    local_148 = 0;
    if (0 < *(int *)(param_3 + 3)) {
      do {
        lVar13 = local_148;
        local_150 = (longlong *)FUN_1400a34c0(0x180);
        if (local_150 == (longlong *)0x0) {
          lVar11 = 0;
        }
        else {
          lVar11 = FUN_1401a21a0(local_150,param_1);
        }
        if (lVar11 == 0) {
          plVar12 = (longlong *)0x0;
        }
        else {
          plVar12 = (longlong *)FUN_1400a34c0(0x10);
          plVar12[1] = 1;
          *plVar12 = lVar11;
        }
        lVar11 = 0;
        local_150 = plVar12;
        if ((lVar13 < 0) || (*(int *)(param_3 + 3) <= local_res10)) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        uVar1 = *(undefined4 *)(param_3[2] + lVar13 * 4);
        puVar3 = (undefined *)param_1[0x43];
        local_100 = uVar1;
        if (((puVar3 == (undefined *)0x0) || (puVar3 == PTR_DAT_1402f8008)) ||
           (*(int *)(puVar3 + -8) == 0)) {
          lVar20 = lVar11;
          if (plVar12 != (longlong *)0x0) {
            lVar20 = *plVar12;
          }
          lVar14 = lVar11;
          if (*(longlong **)(lVar20 + 0x150) != (longlong *)0x0) {
            lVar14 = **(longlong **)(lVar20 + 0x150);
          }
          cVar6 = FUN_1400aa3a0(lVar14,uVar1);
        }
        else {
          lVar20 = lVar11;
          if (plVar12 != (longlong *)0x0) {
            lVar20 = *plVar12;
          }
          lVar14 = lVar11;
          if (*(longlong **)(lVar20 + 0x150) != (longlong *)0x0) {
            lVar14 = **(longlong **)(lVar20 + 0x150);
          }
          cVar6 = FUN_1400aa3f0(lVar14,puVar3,uVar1);
        }
        if (cVar6 == '\0') {
          if (*(char *)((longlong)param_1 + 0x255) == '\0') {
            FUN_1400a3440();
            local_158 = (uint *)PTR_DAT_1402f8010;
            uVar7 = FUN_1400a32c0(&DAT_14027d1a0);
            uVar18 = 0;
            uVar19 = 0;
            if ((local_158 != (uint *)0x0) && (local_158 != (uint *)PTR_DAT_1402f8010)) {
              uVar19 = local_158[-2];
            }
            uVar8 = uVar7;
            if ((((int)uVar7 <= (int)uVar19) && (uVar8 = uVar18, local_158 != (uint *)0x0)) &&
               (local_158 != (uint *)PTR_DAT_1402f8010)) {
              uVar8 = local_158[-2];
            }
            uVar19 = 1;
            if (1 < (int)uVar8) {
              uVar19 = uVar8;
            }
            uVar8 = uVar18;
            if ((local_158 != (uint *)0x0) && (local_158 != (uint *)PTR_DAT_1402f8010)) {
              uVar8 = local_158[-2];
            }
            if ((int)uVar8 < (int)uVar19) {
              if (local_158 == (uint *)0x0) {
                local_158 = (uint *)PTR_DAT_1402f8010;
              }
              if ((int)uVar19 < 0) {
                    // WARNING: Subroutine does not return
                FUN_1400a26d0();
              }
              if (uVar19 == 0) {
                FUN_1400031d0(&local_158);
              }
              else {
                uVar8 = uVar18;
                if ((local_158 != (uint *)0x0) && (local_158 != (uint *)PTR_DAT_1402f8010)) {
                  uVar8 = local_158[-2];
                }
                if (uVar19 != uVar8) {
                  puVar15 = (uint *)FUN_1400a34c0((longlong)(int)uVar19 * 2 + 10);
                  if (puVar15 != (uint *)0x0) {
                    *puVar15 = 0;
                    puVar15[1] = 1;
                  }
                  *puVar15 = uVar19;
                  uVar8 = uVar18;
                  if ((local_158 != (uint *)0x0) && (local_158 != (uint *)PTR_DAT_1402f8010)) {
                    uVar8 = local_158[-2];
                  }
                  puVar16 = (uint *)PTR_DAT_1402f8010;
                  if ((int)uVar19 < (int)uVar8) {
LAB_1401591d3:
                    if (local_158 != (uint *)0x0) {
                      puVar16 = local_158;
                    }
                  }
                  else {
                    uVar19 = uVar18;
                    if (local_158 != (uint *)0x0) {
                      if (local_158 != (uint *)PTR_DAT_1402f8010) {
                        uVar19 = local_158[-2];
                      }
                      goto LAB_1401591d3;
                    }
                  }
                  FUN_1400a32f0(puVar15 + 2,puVar16,uVar19);
                  FUN_1400031d0(&local_158);
                  local_158 = puVar15 + 2;
                }
              }
            }
            FUN_140002e30(&local_158);
            puVar15 = local_158;
            if (local_158 == (uint *)0x0) {
              puVar15 = (uint *)PTR_DAT_1402f8010;
            }
            FUN_1400a32f0(puVar15,&DAT_14027d1a0,uVar7);
            puVar15 = local_158;
            if (local_158 == (uint *)0x0) {
              puVar15 = (uint *)PTR_DAT_1402f8010;
            }
            uVar7 = FUN_1400a32c0(puVar15);
            uVar18 = 0;
            uVar19 = 0;
            if (0 < (int)uVar7) {
              uVar19 = uVar7;
            }
            uVar7 = uVar18;
            if ((local_158 != (uint *)0x0) && (local_158 != (uint *)PTR_DAT_1402f8010)) {
              uVar7 = local_158[-2];
            }
            if (((int)uVar7 <= (int)uVar19) && (uVar19 = uVar18, local_158 != (uint *)0x0)) {
              if (local_158 == (uint *)PTR_DAT_1402f8010) goto LAB_140159290;
              uVar19 = local_158[-2];
            }
            if (((local_158 != (uint *)PTR_DAT_1402f8010) && (local_158 != (uint *)0x0)) &&
               (local_158 + -2 != (uint *)0x0)) {
              local_158[-2] = uVar19;
              *(undefined2 *)((longlong)local_158 + (longlong)(int)uVar19 * 2) = 0;
            }
LAB_140159290:
            local_f0 = 0;
            local_e8 = 0;
            local_e0 = 0;
            local_d8 = 0;
            local_f8 = Proud::ByteArray::vftable;
            uVar9 = FUN_1401416a0(&local_140,0x10,1,&local_158,&local_f8);
            FUN_140141570(param_5,uVar9);
            lVar13 = local_140;
            if (local_140 != 0) {
              local_110 = local_140;
              FUN_1400a1c30(local_140);
              local_108 = 1;
              *(longlong *)(local_140 + 0x40) = *(longlong *)(local_140 + 0x40) + -1;
              if (*(longlong *)(local_140 + 0x40) == 0) {
                FUN_1400d1290(lVar13);
                local_108 = 0;
                FUN_14008c910(local_140);
              }
              else {
                FUN_1400d1290(lVar13);
                local_108 = 0;
              }
            }
            FUN_140140df0(&local_f8);
            puVar15 = local_158;
            if (((local_158 != (uint *)0x0) && (local_158 != (uint *)PTR_DAT_1402f8010)) &&
               (puVar16 = local_158 + -2, puVar16 != (uint *)0x0)) {
              uVar9 = FUN_1400a3440();
              local_c0 = uVar9;
              FUN_1400a1c30(uVar9);
              local_b8 = 1;
              puVar15 = puVar15 + -1;
              *puVar15 = *puVar15 - 1;
              if (*puVar15 == 0) {
                FUN_1400a3530(puVar16);
              }
              FUN_1400d1290(uVar9);
              local_b8 = 0;
            }
            local_158 = (uint *)PTR_DAT_1402f8010;
            FUN_140153020(local_138,0);
            FUN_140155600(local_130);
            plVar5 = local_150;
            if (plVar12 != (longlong *)0x0) {
              plVar12 = plVar12 + 1;
              *plVar12 = *plVar12 + -1;
              if (*plVar12 == 0) {
                puVar4 = (undefined8 *)*local_150;
                if (puVar4 != (undefined8 *)0x0) {
                  (**(code **)*puVar4)(puVar4,1);
                }
                FUN_1400a3530(plVar5);
              }
            }
            FUN_1400d1290(local_120);
            *param_3 = Proud::CFastArray<int,0>::vftable;
            if (param_3[2] != 0) {
              if ((longlong *)param_3[1] == (longlong *)0x0) {
                FUN_1400a3530(param_3[2]);
              }
              else {
                (**(code **)(*(longlong *)param_3[1] + 0x18))();
              }
            }
            return 0;
          }
          iVar2 = *(int *)(param_4 + 0x18);
          if (iVar2 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          iVar17 = *(int *)(param_4 + 0x18);
          FUN_140021fb0(param_4,iVar17 + 1);
          iVar17 = iVar17 - iVar2;
          if ((0 < iVar17) && (iVar17 = iVar17 + -1, lVar11 = (longlong)iVar17, -1 < iVar17)) {
            lVar20 = (iVar2 + lVar11) * 4 + 4;
            do {
              lVar13 = FUN_14008c850(param_4);
              lVar14 = FUN_14008c850(param_4);
              *(undefined4 *)(lVar14 + lVar20) = *(undefined4 *)(lVar13 + -4 + lVar20);
              lVar20 = lVar20 + -4;
              lVar11 = lVar11 + -1;
              lVar13 = local_148;
            } while (-1 < lVar11);
          }
          lVar11 = FUN_14008c850(param_4);
          plVar5 = local_150;
          *(undefined4 *)(lVar11 + (longlong)iVar2 * 4) = uVar1;
          if (plVar12 != (longlong *)0x0) {
            plVar12 = plVar12 + 1;
            *plVar12 = *plVar12 + -1;
            if (*plVar12 == 0) {
              puVar4 = (undefined8 *)*local_150;
              if (puVar4 != (undefined8 *)0x0) {
                (**(code **)*puVar4)(puVar4,1);
              }
              FUN_1400a3530(plVar5);
            }
          }
        }
        else {
          lVar13 = lVar11;
          if (plVar12 != (longlong *)0x0) {
            lVar13 = *plVar12;
          }
          lVar20 = lVar11;
          if (*(longlong **)(lVar13 + 0x150) != (longlong *)0x0) {
            lVar20 = **(longlong **)(lVar13 + 0x150);
          }
          if (plVar12 != (longlong *)0x0) {
            lVar11 = *plVar12;
          }
          lVar13 = FUN_1400a7e50(lVar20,local_a8);
          *(undefined4 *)(lVar11 + 0x160) = *(undefined4 *)(lVar13 + 8);
          *(undefined2 *)(lVar11 + 0x164) = *(undefined2 *)(lVar13 + 0xc);
          if (plVar12 == (longlong *)0x0) {
            lVar13 = 0;
          }
          else {
            lVar13 = *plVar12;
          }
          if (*(short *)(lVar13 + 0x164) == 0) {
LAB_14015942d:
            FUN_1400a2320(local_98,L"m_cachedLocalAddr has an unexpected value!");
                    // WARNING: Subroutine does not return
            _CxxThrowException(local_98,(ThrowInfo *)&DAT_1402f4860);
          }
          if (plVar12 == (longlong *)0x0) {
            lVar13 = 0;
          }
          else {
            lVar13 = *plVar12;
          }
          if (*(short *)(lVar13 + 0x164) == -1) goto LAB_14015942d;
          iVar2 = (int)local_138[3];
          if (iVar2 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          lVar13 = local_138[3];
          FUN_140153020(local_138,(int)lVar13 + 1);
          plVar5 = local_138;
          iVar17 = (int)lVar13 - iVar2;
          if ((0 < iVar17) && (iVar17 = iVar17 + -1, -1 < iVar17)) {
            lVar13 = (longlong)(iVar17 + iVar2 + 1) << 3;
            lVar11 = (longlong)(iVar17 + iVar2) << 3;
            do {
              lVar20 = FUN_1401b2160(plVar5);
              lVar14 = FUN_1401b2160(plVar5);
              FUN_14016b650(lVar13 + lVar14,lVar11 + lVar20);
              lVar11 = lVar11 + -8;
              lVar13 = lVar13 + -8;
              iVar17 = iVar17 + -1;
            } while (-1 < iVar17);
          }
          lVar13 = FUN_1401b2160(local_138);
          FUN_14016b650(lVar13 + (longlong)iVar2 * 8,&local_150);
          lVar13 = 0;
          lVar11 = lVar13;
          if (plVar12 != (longlong *)0x0) {
            lVar11 = *plVar12;
          }
          FUN_140158830(local_130,lVar11 + 0x158,&local_150);
          lVar11 = lVar13;
          if (plVar12 != (longlong *)0x0) {
            lVar11 = *plVar12;
          }
          lVar20 = lVar13;
          if (*(longlong **)(lVar11 + 0x150) != (longlong *)0x0) {
            lVar20 = **(longlong **)(lVar11 + 0x150);
          }
          FUN_1400a7fb0(lVar20,lVar11);
          lVar11 = lVar13;
          if (plVar12 != (longlong *)0x0) {
            lVar11 = *plVar12;
          }
          lVar20 = lVar13;
          if (*(longlong **)(lVar11 + 0x150) != (longlong *)0x0) {
            lVar20 = **(longlong **)(lVar11 + 0x150);
          }
          FUN_1400ace20(param_1[0xf1],lVar20);
          lVar11 = lVar13;
          if (plVar12 != (longlong *)0x0) {
            lVar11 = *plVar12;
          }
          lVar20 = lVar13;
          if (*(longlong **)(lVar11 + 0x150) != (longlong *)0x0) {
            lVar20 = **(longlong **)(lVar11 + 0x150);
          }
          FUN_1401a3ac0(lVar20);
          if ((plVar12 == (longlong *)0x0) || (lVar11 = *plVar12 + 0x40, *plVar12 == 0)) {
            lVar11 = lVar13;
          }
          FUN_1401a1470(local_128,lVar11);
          lVar11 = lVar13;
          if (plVar12 != (longlong *)0x0) {
            lVar11 = *plVar12;
          }
          lVar11 = lVar11 + 0xa8;
          local_d0 = lVar11;
          FUN_1400a1c30(lVar11);
          local_c8 = 1;
          if (plVar12 != (longlong *)0x0) {
            lVar13 = *plVar12;
          }
          FUN_1401a16d0(lVar13);
          FUN_1400d1290(lVar11);
          local_c8 = 0;
          FUN_1401a1480(local_128);
          plVar5 = local_150;
          lVar13 = local_148;
          if (plVar12 != (longlong *)0x0) {
            plVar12 = plVar12 + 1;
            *plVar12 = *plVar12 + -1;
            if (*plVar12 == 0) {
              puVar4 = (undefined8 *)*local_150;
              if (puVar4 != (undefined8 *)0x0) {
                (**(code **)*puVar4)(puVar4,1);
              }
              FUN_1400a3530(plVar5);
              lVar13 = local_148;
            }
          }
        }
        local_res10 = local_res10 + 1;
        local_148 = lVar13 + 1;
        uVar9 = local_120;
      } while (local_res10 < *(int *)(param_3 + 3));
    }
    FUN_1400d1290(uVar9);
  }
  *param_3 = Proud::CFastArray<int,0>::vftable;
  if (param_3[2] != 0) {
    if ((longlong *)param_3[1] == (longlong *)0x0) {
      FUN_1400a3530(param_3[2]);
    }
    else {
      (**(code **)(*(longlong *)param_3[1] + 0x18))();
    }
  }
  return 1;
}



void FUN_1401594a0(longlong *param_1)

{
  longlong lVar1;
  
  if (*param_1 != 0) {
    *(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1;
    if (*(longlong *)(*param_1 + 8) == 0) {
      param_1 = (longlong *)*param_1;
      lVar1 = *param_1;
      if (lVar1 != 0) {
        FUN_140149600(lVar1);
        FUN_1400a3530(lVar1);
      }
      FUN_1400a3530(param_1);
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014015957a)
// WARNING: Removing unreachable block (ram,0x000140159583)
// WARNING: Removing unreachable block (ram,0x0001401595a1)
// WARNING: Removing unreachable block (ram,0x0001401595aa)

undefined1 * FUN_140159510(undefined1 *param_1)

{
  *param_1 = 0;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x28) = 0x11;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined4 *)(param_1 + 0x48) = 0;
  *(undefined4 *)(param_1 + 0x2c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x30) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x34) = 0x40100000;
  *(undefined8 *)(param_1 + 0x38) = 0x26;
  *(undefined8 *)(param_1 + 0x40) = 0;
  param_1[0x58] = 0;
  *(undefined8 *)(param_1 + 0xa8) = 0;
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined4 *)(param_1 + 0x80) = 0x11;
  *(undefined8 *)(param_1 + 0x78) = 0;
  *(undefined4 *)(param_1 + 0xa0) = 0;
  *(undefined4 *)(param_1 + 0x84) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x88) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x8c) = 0x40100000;
  *(undefined8 *)(param_1 + 0x90) = 0x26;
  *(undefined8 *)(param_1 + 0x98) = 0;
  return param_1;
}



void FUN_140159630(longlong param_1)

{
  FUN_140158810(param_1 + 0x58);
  FUN_140158810(param_1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140159660(longlong *param_1,longlong *param_2)

{
  int iVar1;
  undefined8 *puVar2;
  undefined *puVar3;
  char cVar4;
  undefined2 uVar5;
  uint uVar6;
  uint uVar7;
  uint uVar8;
  undefined4 uVar9;
  longlong *plVar10;
  longlong *plVar11;
  uint *puVar12;
  undefined8 uVar13;
  longlong lVar14;
  longlong lVar15;
  longlong *plVar16;
  longlong *plVar17;
  uint *puVar18;
  uint uVar19;
  int iVar20;
  longlong lVar21;
  longlong lVar22;
  uint uVar23;
  undefined1 auStack_e68 [32];
  undefined ***local_e48;
  undefined4 *local_e40;
  longlong *local_e38;
  uint *local_e30;
  uint local_e28;
  uint local_e24;
  longlong *local_e18;
  longlong *local_e10;
  undefined8 local_e08;
  undefined4 uStack_e00;
  undefined4 uStack_dfc;
  longlong local_df8;
  undefined1 local_df0 [8];
  longlong local_de8;
  longlong *local_de0;
  undefined4 local_dd8;
  int local_dd4;
  undefined **local_dc8;
  undefined4 local_dc0;
  undefined2 local_dbc;
  undefined1 local_db8 [8];
  undefined **local_db0;
  undefined8 local_da8;
  undefined8 local_da0;
  undefined8 local_d98;
  undefined8 local_d90;
  undefined4 local_d88 [2];
  undefined8 local_d80;
  undefined1 local_d78;
  undefined4 local_d74;
  undefined1 local_d70;
  undefined1 local_d6f;
  longlong *local_d68;
  undefined1 local_d60;
  undefined8 local_d58;
  undefined1 local_d50;
  undefined8 local_d48;
  undefined1 local_d40 [8];
  undefined1 local_d38 [16];
  undefined1 local_d28 [80];
  undefined4 local_cd8;
  undefined4 uStack_cd4;
  undefined4 uStack_cd0;
  undefined4 uStack_ccc;
  undefined4 *local_58;
  undefined4 local_50;
  int local_4c;
  ulonglong local_48;
  
  local_d48 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_e68;
  if (((longlong *)param_2[0xe8] != (longlong *)0x0) && (*(longlong *)param_2[0xe8] != 0)) {
    return 1;
  }
  if (*(char *)((longlong)param_2 + 0x702) != '\0') {
    return 0;
  }
  plVar17 = (longlong *)0x0;
  uVar23 = 0;
  local_e38 = (longlong *)0x0;
  local_e08 = param_1;
  if (*(int *)((longlong)param_1 + 0x1844) != 0) {
    plVar10 = (longlong *)FUN_140150d80(param_1,&local_e10);
    if (*plVar10 != 0) {
      *(longlong *)(*plVar10 + 8) = *(longlong *)(*plVar10 + 8) + 1;
      plVar17 = (longlong *)*plVar10;
      local_e38 = plVar17;
    }
    if ((local_e10 != (longlong *)0x0) &&
       (local_e10[1] = local_e10[1] + -1, plVar17 = local_e38, local_e10[1] == 0)) {
      puVar2 = (undefined8 *)*local_e10;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      FUN_1400a3530();
      plVar17 = local_e38;
    }
    goto LAB_140159d6d;
  }
  local_df8 = FUN_1400a34c0(0x180);
  plVar10 = plVar17;
  if (local_df8 != 0) {
    plVar10 = (longlong *)FUN_1401a21a0(local_df8,param_1);
  }
  if (plVar10 == (longlong *)0x0) {
    local_e18 = (longlong *)0x0;
  }
  else {
    local_e18 = (longlong *)FUN_1400a34c0(0x10);
    local_e18[1] = 1;
    *local_e18 = (longlong)plVar10;
  }
  plVar11 = local_e18;
  plVar10 = plVar17;
  if (local_e18 != (longlong *)0x0) {
    local_e18[1] = local_e18[1] + 1;
    local_e38 = local_e18;
    plVar16 = local_e18 + 1;
    *plVar16 = *plVar16 + -1;
    plVar10 = local_e18;
    if (*plVar16 == 0) {
      puVar2 = (undefined8 *)*local_e18;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      FUN_1400a3530(plVar11);
      plVar10 = local_e38;
    }
  }
  if ((int)param_1[0x30c] < 1) {
    local_e28 = 0;
    local_e24 = 0;
  }
  else {
    iVar1 = (int)param_1[0x30c];
    if (iVar1 == 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    uVar6 = *(uint *)(param_1[0x30b] + -4 + (longlong)iVar1 * 4);
    local_e28 = uVar6;
    FUN_140021fb0(param_1 + 0x309,iVar1 + -1);
    local_e24 = uVar6;
  }
  uVar6 = local_e24;
  puVar3 = (undefined *)param_1[0x43];
  if (((puVar3 == (undefined *)0x0) || (puVar3 == PTR_DAT_1402f8008)) ||
     (*(int *)(puVar3 + -8) == 0)) {
    plVar11 = plVar17;
    if (plVar10 != (longlong *)0x0) {
      plVar11 = (longlong *)*plVar10;
    }
    plVar16 = plVar17;
    if ((undefined8 *)plVar11[0x2a] != (undefined8 *)0x0) {
      plVar16 = *(longlong **)plVar11[0x2a];
    }
    cVar4 = FUN_1400aa3a0(plVar16,local_e24);
  }
  else {
    plVar11 = plVar17;
    if (plVar10 != (longlong *)0x0) {
      plVar11 = (longlong *)*plVar10;
    }
    plVar16 = plVar17;
    if ((undefined8 *)plVar11[0x2a] != (undefined8 *)0x0) {
      plVar16 = *(longlong **)plVar11[0x2a];
    }
    cVar4 = FUN_1400aa3f0(plVar16,puVar3,local_e24);
  }
  if (cVar4 == '\0') {
    if ((int)uVar6 < 1) goto LAB_140159cc8;
    FUN_1400a3440();
    local_e30 = (uint *)PTR_DAT_1402f8010;
    uVar6 = FUN_1400a32c0(
                         L"All UDP port numbers specified at Server Start are deleted! An arbitary port number is assigned instead."
                         );
    if ((local_e30 != (uint *)0x0) &&
       (plVar17 = (longlong *)0x0, local_e30 != (uint *)PTR_DAT_1402f8010)) {
      plVar17 = (longlong *)(ulonglong)local_e30[-2];
    }
    uVar7 = uVar6;
    if ((((int)uVar6 <= (int)plVar17) && (uVar7 = uVar23, local_e30 != (uint *)0x0)) &&
       (local_e30 != (uint *)PTR_DAT_1402f8010)) {
      uVar7 = local_e30[-2];
    }
    uVar19 = 1;
    if (1 < (int)uVar7) {
      uVar19 = uVar7;
    }
    uVar8 = 0;
    uVar7 = uVar8;
    if ((local_e30 != (uint *)0x0) && (local_e30 != (uint *)PTR_DAT_1402f8010)) {
      uVar7 = local_e30[-2];
    }
    if ((int)uVar7 < (int)uVar19) {
      if (local_e30 == (uint *)0x0) {
        local_e30 = (uint *)PTR_DAT_1402f8010;
      }
      if ((int)uVar19 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if (uVar19 == 0) {
        FUN_1400031d0(&local_e30);
      }
      else {
        uVar7 = uVar8;
        if ((local_e30 != (uint *)0x0) && (local_e30 != (uint *)PTR_DAT_1402f8010)) {
          uVar7 = local_e30[-2];
        }
        if (uVar19 != uVar7) {
          puVar12 = (uint *)FUN_1400a34c0((longlong)(int)uVar19 * 2 + 10);
          if (puVar12 != (uint *)0x0) {
            *puVar12 = 0;
            puVar12[1] = 1;
          }
          *puVar12 = uVar19;
          uVar7 = uVar8;
          if ((local_e30 != (uint *)0x0) && (local_e30 != (uint *)PTR_DAT_1402f8010)) {
            uVar7 = local_e30[-2];
          }
          puVar18 = (uint *)PTR_DAT_1402f8010;
          if ((int)uVar19 < (int)uVar7) {
LAB_140159954:
            if (local_e30 != (uint *)0x0) {
              puVar18 = local_e30;
            }
          }
          else {
            uVar19 = uVar23;
            if (local_e30 != (uint *)0x0) {
              if (local_e30 != (uint *)PTR_DAT_1402f8010) {
                uVar19 = local_e30[-2];
              }
              goto LAB_140159954;
            }
          }
          FUN_1400a32f0(puVar12 + 2,puVar18,uVar19);
          FUN_1400031d0(&local_e30);
          local_e30 = puVar12 + 2;
        }
      }
    }
    FUN_140002e30(&local_e30);
    puVar12 = local_e30;
    if (local_e30 == (uint *)0x0) {
      puVar12 = (uint *)PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar12,
                  L"All UDP port numbers specified at Server Start are deleted! An arbitary port number is assigned instead."
                  ,uVar6);
    puVar12 = local_e30;
    if (local_e30 == (uint *)0x0) {
      puVar12 = (uint *)PTR_DAT_1402f8010;
    }
    uVar6 = FUN_1400a32c0(puVar12);
    uVar23 = 0;
    if (0 < (int)uVar6) {
      uVar23 = uVar6;
    }
    uVar6 = uVar8;
    if ((local_e30 != (uint *)0x0) && (local_e30 != (uint *)PTR_DAT_1402f8010)) {
      uVar6 = local_e30[-2];
    }
    if (((int)uVar23 < (int)uVar6) || (uVar23 = uVar8, local_e30 == (uint *)0x0)) {
LAB_1401599f3:
      if (((local_e30 != (uint *)PTR_DAT_1402f8010) && (local_e30 != (uint *)0x0)) &&
         (local_e30 + -2 != (uint *)0x0)) {
        local_e30[-2] = uVar23;
        *(undefined2 *)((longlong)local_e30 + (longlong)(int)uVar23 * 2) = 0;
      }
    }
    else if (local_e30 != (uint *)PTR_DAT_1402f8010) {
      uVar23 = local_e30[-2];
      goto LAB_1401599f3;
    }
    local_da8 = 0;
    local_da0 = 0;
    local_d98 = 0;
    local_d90 = 0;
    local_db0 = Proud::ByteArray::vftable;
    local_e48 = &local_db0;
    uVar13 = FUN_1401416a0(local_d40,0x11,(int)param_2[0xdf],&local_e30);
    (**(code **)(*param_1 + 0x88))(param_1,uVar13);
    FUN_140140df0(&local_db0);
    puVar12 = local_e30;
    if (((local_e30 != (uint *)0x0) && (local_e30 != (uint *)PTR_DAT_1402f8010)) &&
       (puVar18 = local_e30 + -2, puVar18 != (uint *)0x0)) {
      uVar13 = FUN_1400a3440();
      local_d58 = uVar13;
      FUN_1400a1c30(uVar13);
      local_d50 = 1;
      puVar12 = puVar12 + -1;
      *puVar12 = *puVar12 - 1;
      if (*puVar12 == 0) {
        FUN_1400a3530(puVar18);
      }
      FUN_1400d1290(uVar13);
      local_d50 = 0;
    }
    local_e30 = (uint *)PTR_DAT_1402f8010;
    plVar17 = param_1 + 0x309;
    iVar1 = (int)param_1[0x30c];
    if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    lVar22 = param_1[0x30c];
    FUN_140021fb0(plVar17,(int)lVar22 + 1);
    iVar20 = (int)lVar22 - iVar1;
    if ((0 < iVar20) && (iVar20 = iVar20 + -1, lVar22 = (longlong)iVar20, -1 < iVar20)) {
      lVar21 = (iVar1 + lVar22) * 4 + 4;
      do {
        lVar15 = FUN_14008c850(plVar17);
        lVar14 = FUN_14008c850(plVar17);
        *(undefined4 *)(lVar14 + lVar21) = *(undefined4 *)(lVar15 + -4 + lVar21);
        lVar21 = lVar21 + -4;
        lVar22 = lVar22 + -1;
      } while (-1 < lVar22);
    }
    lVar22 = FUN_14008c850(plVar17);
    param_1 = local_e08;
    *(uint *)(lVar22 + (longlong)iVar1 * 4) = local_e28;
    lVar22 = 0;
    local_e24 = 0;
    puVar3 = (undefined *)local_e08[0x43];
    if (((puVar3 == (undefined *)0x0) || (puVar3 == PTR_DAT_1402f8008)) ||
       (*(int *)(puVar3 + -8) == 0)) {
      lVar21 = lVar22;
      if (plVar10 != (longlong *)0x0) {
        lVar21 = *plVar10;
      }
      if (*(longlong **)(lVar21 + 0x150) != (longlong *)0x0) {
        lVar22 = **(longlong **)(lVar21 + 0x150);
      }
      cVar4 = FUN_1400aa3a0(lVar22,0);
    }
    else {
      lVar21 = lVar22;
      if (plVar10 != (longlong *)0x0) {
        lVar21 = *plVar10;
      }
      if (*(longlong **)(lVar21 + 0x150) != (longlong *)0x0) {
        lVar22 = **(longlong **)(lVar21 + 0x150);
      }
      cVar4 = FUN_1400aa3f0(lVar22,puVar3,0);
    }
    if (cVar4 == '\0') {
LAB_140159cc8:
      plVar17 = local_e38;
      *(undefined1 *)((longlong)param_2 + 0x702) = 1;
      if (plVar10 != (longlong *)0x0) {
        plVar10 = plVar10 + 1;
        *plVar10 = *plVar10 + -1;
        if (*plVar10 == 0) {
          puVar2 = (undefined8 *)*local_e38;
          if (puVar2 != (undefined8 *)0x0) {
            (**(code **)*puVar2)(puVar2,1);
          }
          FUN_1400a3530(plVar17);
        }
      }
      return 0;
    }
    uVar23 = 0;
  }
  else {
    uVar23 = 0;
    if (0 < (int)uVar6) {
      uVar23 = uVar6;
    }
  }
  lVar22 = 0;
  lVar21 = lVar22;
  if (plVar10 != (longlong *)0x0) {
    lVar21 = *plVar10;
  }
  lVar15 = lVar22;
  if (*(longlong **)(lVar21 + 0x150) != (longlong *)0x0) {
    lVar15 = **(longlong **)(lVar21 + 0x150);
  }
  lVar21 = lVar22;
  if (plVar10 != (longlong *)0x0) {
    lVar21 = *plVar10;
  }
  lVar15 = FUN_1400a7e50(lVar15,local_d38);
  *(undefined4 *)(lVar21 + 0x160) = *(undefined4 *)(lVar15 + 8);
  *(undefined2 *)(lVar21 + 0x164) = *(undefined2 *)(lVar15 + 0xc);
  lVar21 = lVar22;
  if (plVar10 != (longlong *)0x0) {
    lVar21 = *plVar10;
  }
  FUN_140158830(param_1 + 0xde,lVar21 + 0x158,&local_e38);
  lVar21 = lVar22;
  if (plVar10 != (longlong *)0x0) {
    lVar21 = *plVar10;
  }
  lVar15 = lVar22;
  if (*(longlong **)(lVar21 + 0x150) != (longlong *)0x0) {
    lVar15 = **(longlong **)(lVar21 + 0x150);
  }
  FUN_1400a7fb0(lVar15,lVar21);
  lVar21 = lVar22;
  if (plVar10 != (longlong *)0x0) {
    lVar21 = *plVar10;
  }
  if (*(longlong **)(lVar21 + 0x150) != (longlong *)0x0) {
    lVar22 = **(longlong **)(lVar21 + 0x150);
  }
  FUN_1400ace20(param_1[0xf1],lVar22);
  FUN_1401a3ac0();
  plVar17 = plVar10;
LAB_140159d6d:
  plVar10 = (longlong *)0x0;
  if (plVar17 != (longlong *)param_2[0xe8]) {
    if (plVar17 != (longlong *)0x0) {
      plVar17[1] = plVar17[1] + 1;
      plVar17 = local_e38;
    }
    plVar11 = plVar10;
    if ((param_2[0xe8] != 0) &&
       (*(longlong *)(param_2[0xe8] + 8) = *(longlong *)(param_2[0xe8] + 8) + -1,
       plVar17 = local_e38, *(longlong *)(param_2[0xe8] + 8) == 0)) {
      plVar11 = (longlong *)param_2[0xe8];
    }
    param_2[0xe8] = (longlong)plVar17;
    if (plVar11 != (longlong *)0x0) {
      puVar2 = (undefined8 *)*plVar11;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      FUN_1400a3530();
    }
  }
  if (*(int *)((longlong)param_1 + 0x1844) == 0) {
    if (plVar17 != (longlong *)param_2[0xec]) {
      if (plVar17 != (longlong *)0x0) {
        plVar17[1] = plVar17[1] + 1;
        plVar17 = local_e38;
      }
      plVar11 = plVar10;
      if ((param_2[0xec] != 0) &&
         (*(longlong *)(param_2[0xec] + 8) = *(longlong *)(param_2[0xec] + 8) + -1,
         plVar17 = local_e38, *(longlong *)(param_2[0xec] + 8) == 0)) {
        plVar11 = (longlong *)param_2[0xec];
      }
      param_2[0xec] = (longlong)plVar17;
      if (plVar11 != (longlong *)0x0) {
        puVar2 = (undefined8 *)*plVar11;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        FUN_1400a3530(plVar11);
      }
    }
    *(uint *)(param_2 + 0xed) = uVar23;
    if (((longlong *)param_2[0xec] == (longlong *)0x0) ||
       (lVar22 = *(longlong *)param_2[0xec], plVar11 = (longlong *)(lVar22 + 0x40), lVar22 == 0)) {
      plVar11 = plVar10;
    }
    FUN_1401a1470(&local_df8,plVar11);
    plVar11 = plVar10;
    if ((undefined8 *)param_2[0xec] != (undefined8 *)0x0) {
      plVar11 = *(longlong **)param_2[0xec];
    }
    plVar11 = plVar11 + 0x15;
    local_d68 = plVar11;
    FUN_1400a1c30(plVar11);
    local_d60 = 1;
    plVar16 = plVar10;
    if ((longlong *)param_2[0xec] != (longlong *)0x0) {
      plVar16 = *(longlong **)param_2[0xec];
    }
    FUN_1401a16d0(plVar16);
    FUN_1400d1290(plVar11);
    local_d60 = 0;
    FUN_1401a1480();
  }
  local_d70 = 0;
  local_d6f = DAT_1402f81cc;
  local_d78 = 0;
  local_d88[0] = 0;
  local_d80 = 0;
  local_d74 = 0xffffffff;
  if ((char)param_1[0x4d] == '\0') {
    local_d74 = 0;
  }
  FUN_140185560(local_df0);
  FUN_140185030(local_df0);
  FUN_14003c9e0(local_df0,0x2d);
  if (((longlong *)param_2[0xe8] == (longlong *)0x0) ||
     (lVar22 = *(longlong *)param_2[0xe8], plVar11 = (longlong *)(lVar22 + 0x40), lVar22 == 0)) {
    plVar11 = plVar10;
  }
  FUN_1401a1470(local_db8,plVar11);
  local_4c = 200;
  local_50 = 0;
  local_58 = &local_cd8;
  if (local_de8 == 0) {
    uStack_e00 = local_dd8;
    if (local_de0 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else {
    uStack_e00 = *(undefined4 *)(local_de8 + 0x18);
  }
  plVar11 = local_de0;
  if (local_de0 == (longlong *)0x0) {
    if (local_de8 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    plVar11 = plVar10;
    if (*(int *)(local_de8 + 0x18) != 0) {
      plVar11 = *(longlong **)(local_de8 + 0x10);
    }
  }
  local_50 = 1;
  local_e08._0_4_ = SUB84(plVar11,0);
  local_e08._4_4_ = (undefined4)((ulonglong)plVar11 >> 0x20);
  local_cd8 = (undefined4)local_e08;
  uStack_cd4 = local_e08._4_4_;
  uStack_ccc = uStack_dfc;
  local_dc8 = Proud::AddrPort::vftable;
  local_dc0 = *(undefined4 *)(param_2[0xe9] + 0x130);
  local_dbc = *(undefined2 *)(param_2[0xe9] + 0x134);
  if ((longlong *)param_2[0xe8] != (longlong *)0x0) {
    plVar10 = *(longlong **)param_2[0xe8];
  }
  local_e08 = plVar11;
  uStack_cd0 = uStack_e00;
  uVar5 = FUN_14019c290(1);
  uVar9 = (**(code **)(*param_2 + 0x10))(param_2);
  local_e40 = local_d88;
  local_e48 = (undefined ***)&local_cd8;
  FUN_1401a18d0(plVar10,uVar9,uVar5,&local_dc8);
  if (local_58 != (undefined4 *)0x0) {
    if (local_4c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_50 = 0;
    FUN_1401a1480(local_db8);
    local_e08 = &local_de8;
    FUN_14019a730(&local_de8);
    plVar10 = local_e38;
    if (local_de0 != (longlong *)0x0) {
      if (local_dd4 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_dd8 = 0;
    }
    if (plVar17 != (longlong *)0x0) {
      plVar17 = plVar17 + 1;
      *plVar17 = *plVar17 + -1;
      if (*plVar17 == 0) {
        puVar2 = (undefined8 *)*local_e38;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        FUN_1400a3530(plVar10);
      }
    }
    return 1;
  }
  FUN_1400a2320(local_d28,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_d28,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_14015a140(longlong param_1,longlong param_2)

{
  int *piVar1;
  char cVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined *local_30 [2];
  undefined8 local_20;
  undefined1 local_18;
  
  uVar4 = 0xfffffffffffffffe;
  if ((((*(longlong **)(param_2 + 0x740) == (longlong *)0x0) ||
       (**(longlong **)(param_2 + 0x740) == 0)) && (*(char *)(param_2 + 0x701) == '\0')) &&
     (*(int *)(param_1 + 0x228) == 0)) {
    cVar2 = FUN_140159660();
    if (cVar2 != '\0') {
      if (*(undefined8 **)(param_2 + 0x740) == (undefined8 *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = **(undefined8 **)(param_2 + 0x740);
      }
      FUN_1401a1af0(uVar3,local_30,param_2);
      (**(code **)(*(longlong *)(param_1 + 0x4a8) + 0x140))
                ((longlong *)(param_1 + 0x4a8),*(undefined4 *)(param_2 + 0x6f8),&DAT_140318cf0,
                 local_30,uVar4);
      *(undefined1 *)(param_2 + 0x701) = 1;
      if (((local_30[0] != (undefined *)0x0) && (local_30[0] != PTR_DAT_1402f8008)) &&
         (local_30[0] + -8 != (undefined *)0x0)) {
        uVar4 = FUN_1400a3440();
        local_20 = uVar4;
        FUN_1400a1c30(uVar4);
        local_18 = 1;
        piVar1 = (int *)(local_30[0] + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_30[0] + -8);
        }
        FUN_1400d1290(uVar4);
      }
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014015a3bd)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_14015a240(longlong param_1,double param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  void *pvVar2;
  longlong lVar3;
  longlong lVar4;
  longlong *local_res8;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x78) == 0) {
    lVar4 = 0;
  }
  else {
    lVar4 = *(longlong *)(param_1 + 0x68);
  }
  while( true ) {
    if (lVar4 == 0) {
      return;
    }
    if (lVar4 == 0) break;
    local_res8 = (longlong *)0x0;
    if (*(longlong *)(lVar4 + 8) != 0) {
      *(longlong *)(*(longlong *)(lVar4 + 8) + 8) = *(longlong *)(*(longlong *)(lVar4 + 8) + 8) + 1;
      local_res8 = *(longlong **)(lVar4 + 8);
    }
    if (local_res8 == (longlong *)0x0) {
      lVar3 = 0;
    }
    else {
      lVar3 = *local_res8;
    }
    if (param_2 - *(double *)(lVar3 + 400) <= _DAT_1402f80d0) {
      if (lVar4 != 0) {
        lVar4 = *(longlong *)(lVar4 + 0x10);
      }
    }
    else {
      if (lVar4 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      lVar3 = *(longlong *)(lVar4 + 0x10);
      FUN_140155830(param_1 + 0x58,lVar4,0,param_4,uVar5);
      lVar4 = lVar3;
    }
    if (local_res8 != (longlong *)0x0) {
      plVar1 = local_res8 + 1;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        pvVar2 = (void *)*local_res8;
        if (pvVar2 != (void *)0x0) {
          FUN_140140df0((longlong)pvVar2 + 0x148);
          FUN_140140df0((longlong)pvVar2 + 0x120);
          operator_delete(pvVar2);
        }
        FUN_1400a3530(local_res8);
      }
    }
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



// WARNING: Removing unreachable block (ram,0x00014015a4cd)
// WARNING: Removing unreachable block (ram,0x00014015a496)

longlong * FUN_14015a3f0(longlong param_1,longlong *param_2,uint param_3,uint param_4,char param_5)

{
  longlong *plVar1;
  ulonglong uVar2;
  uint *puVar3;
  uint *puVar4;
  uint *puVar5;
  uint uVar6;
  longlong local_res8;
  
  puVar3 = (uint *)0x0;
  local_res8 = 0;
  uVar6 = param_4;
  if ((int)param_4 < (int)param_3) {
    uVar6 = param_3;
    param_3 = param_4;
  }
  uVar2 = (ulonglong)(param_3 << 0x10 ^ uVar6) % (ulonglong)*(uint *)(param_1 + 0x80);
  puVar5 = puVar3;
  if ((*(longlong *)(param_1 + 0x60) != 0) &&
     (puVar4 = *(uint **)(*(longlong *)(param_1 + 0x60) + uVar2 * 8), puVar4 != (uint *)0x0)) {
    while (puVar5 = puVar3, (uint)uVar2 == puVar4[8] % *(uint *)(param_1 + 0x80)) {
      if (((*puVar4 == param_3) && (puVar5 = puVar4, puVar4[1] == uVar6)) ||
         (puVar4 = *(uint **)(puVar4 + 4), puVar5 = puVar3, puVar4 == (uint *)0x0)) break;
    }
  }
  if (puVar5 == (uint *)0x0) {
    *param_2 = 0;
  }
  else {
    if (*(longlong *)(puVar5 + 2) != 0) {
      *(longlong *)(*(longlong *)(puVar5 + 2) + 8) =
           *(longlong *)(*(longlong *)(puVar5 + 2) + 8) + 1;
      local_res8 = *(longlong *)(puVar5 + 2);
    }
    if (param_5 != '\0') {
      FUN_140155830(param_1 + 0x58,puVar5,0,puVar5,0xfffffffffffffffe);
    }
    *param_2 = 0;
    if (local_res8 != 0) {
      *(longlong *)(local_res8 + 8) = *(longlong *)(local_res8 + 8) + 1;
      if ((*param_2 != 0) &&
         (*(longlong *)(*param_2 + 8) = *(longlong *)(*param_2 + 8) + -1,
         *(longlong *)(*param_2 + 8) == 0)) {
        puVar3 = (uint *)*param_2;
      }
      *param_2 = local_res8;
      if (puVar3 != (uint *)0x0) {
        FUN_1401462b0(puVar3);
      }
    }
    if (local_res8 != 0) {
      plVar1 = (longlong *)(local_res8 + 8);
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_1401462b0(local_res8);
      }
    }
  }
  return param_2;
}



undefined8 FUN_14015a570(longlong param_1,int *param_2,undefined8 param_3)

{
  int *piVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  
  uVar2 = (ulonglong)(uint)(*param_2 << 0x10 ^ param_2[1]) % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (piVar1 = *(int **)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (piVar1 != (int *)0x0 && ((uint)uVar2 == (uint)piVar1[8] % *(uint *)(param_1 + 0x28)));
        piVar1 = *(int **)(piVar1 + 4)) {
      if ((*piVar1 == *param_2) && (piVar1[1] == param_2[1])) {
        return 0;
      }
    }
  }
  uVar3 = FUN_140158970(param_1,param_2);
  FUN_140152ec0(uVar3,param_3);
  return 1;
}



longlong * FUN_14015a620(longlong param_1,longlong *param_2)

{
  ulonglong *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  longlong lVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  
  puVar1 = (ulonglong *)*param_2;
  if (puVar1 == (ulonglong *)0x0) {
    uVar6 = 0;
  }
  else {
    uVar6 = *puVar1;
  }
  uVar6 = (uVar6 & 0xffffffff) % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (plVar2 = *(longlong **)(*(longlong *)(param_1 + 8) + uVar6 * 8);
        (plVar2 != (longlong *)0x0 &&
        ((uint)uVar6 == *(uint *)(plVar2 + 4) % *(uint *)(param_1 + 0x28)));
        plVar2 = (longlong *)plVar2[2]) {
      if ((ulonglong *)*plVar2 == (ulonglong *)0x0) {
        uVar5 = 0;
      }
      else {
        uVar5 = *(ulonglong *)*plVar2;
      }
      if (puVar1 == (ulonglong *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = *puVar1;
      }
      if (uVar5 == uVar3) {
        return plVar2 + 1;
      }
    }
  }
  lVar4 = FUN_140158a20(param_1,param_2,uVar6);
  return (longlong *)(lVar4 + 8);
}



void FUN_14015a6d0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x38);
  if (lVar1 != 0) {
    FUN_1400031d0(lVar1 + 0x98);
    FUN_140148d50(lVar1 + 0x38);
    FUN_1400a3530(lVar1);
  }
  FUN_1400a1cd0(param_1);
  FUN_1400a3530(param_1);
  return;
}



void FUN_14015a740(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x38);
  if (lVar1 != 0) {
    FUN_140148d50(lVar1 + 0x28);
    FUN_1400a3530(lVar1);
  }
  FUN_1400a1cd0(param_1);
  FUN_1400a3530(param_1);
  return;
}



void FUN_14015a790(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x38);
  if (lVar1 != 0) {
    FUN_140148d50(lVar1 + 8);
    FUN_1400a3530(lVar1);
  }
  FUN_1400a1cd0(param_1);
  FUN_1400a3530(param_1);
  return;
}



// WARNING: Removing unreachable block (ram,0x00014015a8d6)
// WARNING: Removing unreachable block (ram,0x00014015a8e4)

void FUN_14015a7e0(ulonglong *param_1,ulonglong *param_2)

{
  longlong *plVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  uVar3 = *param_2;
  uVar4 = *param_1;
  if (uVar4 != uVar3) {
    uVar2 = uVar4;
    if (uVar3 < uVar4) {
      uVar2 = uVar3;
      uVar3 = uVar4;
    }
    if (uVar2 != 0) {
      FUN_1400a1c30(uVar2);
    }
    if (uVar3 != 0) {
      FUN_1400a1c30(uVar3);
    }
    if (*param_2 != 0) {
      plVar1 = (longlong *)(*param_2 + 0x40);
      *plVar1 = *plVar1 + 1;
    }
    uVar4 = 0;
    if (*param_1 != 0) {
      plVar1 = (longlong *)(*param_1 + 0x40);
      *plVar1 = *plVar1 + -1;
      if (*(longlong *)(*param_1 + 0x40) == 0) {
        uVar4 = *param_1;
      }
    }
    *param_1 = *param_2;
    if (uVar2 != 0) {
      FUN_1400d1290(uVar2);
    }
    if (uVar3 != 0) {
      FUN_1400d1290(uVar3);
    }
    if (uVar4 != 0) {
      FUN_14015a790(uVar4);
    }
  }
  return;
}



undefined8 FUN_14015a910(longlong param_1,undefined8 param_2,undefined8 param_3,uint *param_4)

{
  int *piVar1;
  longlong lVar2;
  ulonglong uVar3;
  undefined *puVar4;
  undefined8 uVar5;
  longlong *plVar6;
  undefined8 uVar7;
  uint *puVar8;
  longlong lVar9;
  undefined *puVar10;
  double dVar11;
  longlong local_res8;
  undefined4 local_res10 [2];
  undefined *local_res20;
  
  local_res10[0] = (undefined4)param_2;
  uVar5 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))
                    (*(longlong **)(param_1 + 0x20),param_2,param_3,param_4,0xfffffffffffffffe);
  FUN_1400a1c30(uVar5);
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))();
  }
  lVar9 = *(longlong *)(param_1 + 0x20);
  uVar3 = (ulonglong)*param_4 % (ulonglong)*(uint *)(lVar9 + 0xca0);
  if ((*(longlong *)(lVar9 + 0xc80) != 0) &&
     (puVar8 = *(uint **)(*(longlong *)(lVar9 + 0xc80) + uVar3 * 8), puVar8 != (uint *)0x0)) {
    while ((uint)uVar3 == puVar8[8] % *(uint *)(lVar9 + 0xca0)) {
      if (*puVar8 == *param_4) {
        if ((*(longlong *)(puVar8 + 2) != 0) &&
           (*(longlong *)(*(longlong *)(puVar8 + 2) + 0x228) == 0)) {
          plVar6 = (longlong *)FUN_1401553e0(lVar9 + 0x2d8,&local_res8,local_res10[0]);
          lVar9 = 0;
          if ((longlong *)*plVar6 != (longlong *)0x0) {
            lVar9 = *(longlong *)*plVar6;
          }
          if ((local_res8 != 0) &&
             (*(longlong *)(local_res8 + 8) = *(longlong *)(local_res8 + 8) + -1,
             *(longlong *)(local_res8 + 8) == 0)) {
            FUN_1401462b0(local_res8);
          }
          if (lVar9 != 0) {
            lVar2 = *(longlong *)(*(longlong *)(lVar9 + 0x100) + 0x6c0);
            dVar11 = (double)lVar2;
            if (lVar2 < 0) {
              dVar11 = dVar11 + 1.8446744073709552e+19;
            }
            if (dVar11 < *(double *)(*(longlong *)(lVar9 + 0x100) + 0x1a8)) {
              lVar2 = *(longlong *)(*(longlong *)(lVar9 + 0x108) + 0x6c0);
              dVar11 = (double)lVar2;
              if (lVar2 < 0) {
                dVar11 = dVar11 + 1.8446744073709552e+19;
              }
              if (dVar11 < *(double *)(*(longlong *)(lVar9 + 0x108) + 0x1a8)) {
                FUN_14015a140(*(undefined8 *)(param_1 + 0x20));
                FUN_14015a140(*(undefined8 *)(param_1 + 0x20),*(undefined8 *)(lVar9 + 0x108));
                plVar6 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
                (**(code **)(*plVar6 + 0x120))(plVar6,*param_4,&DAT_140318cf0,local_res10);
                plVar6 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
                (**(code **)(*plVar6 + 0x120))(plVar6,local_res10[0],&DAT_140318cf0,param_4);
                *(undefined1 *)(lVar9 + 0x110) = 1;
                if (*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x17f0) != 0) {
                  FUN_1400a3440();
                  local_res20 = PTR_DAT_1402f8010;
                  FUN_14003c600(&local_res20,&DAT_140252950,local_res10[0],*param_4);
                  puVar4 = local_res20;
                  puVar10 = local_res20;
                  if (local_res20 == (undefined *)0x0) {
                    puVar10 = PTR_DAT_1402f8010;
                  }
                  FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x17f0),1,puVar10);
                  if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1402f8010)) &&
                     (puVar4 + -8 != (undefined *)0x0)) {
                    uVar7 = FUN_1400a3440();
                    FUN_1400a1c30(uVar7);
                    piVar1 = (int *)(puVar4 + -4);
                    *piVar1 = *piVar1 + -1;
                    if (*piVar1 == 0) {
                      FUN_1400a3530(puVar4 + -8);
                    }
                    FUN_1400d1290(uVar7);
                  }
                }
              }
            }
          }
        }
        break;
      }
      puVar8 = *(uint **)(puVar8 + 4);
      if (puVar8 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar5);
  return 1;
}



undefined8 FUN_14015abf0(longlong param_1,uint param_2)

{
  int *piVar1;
  longlong lVar2;
  longlong lVar3;
  ulonglong uVar4;
  undefined *puVar5;
  undefined8 uVar6;
  longlong *plVar7;
  undefined8 uVar8;
  undefined *puVar9;
  uint *puVar10;
  undefined *puVar11;
  char local_res10 [8];
  undefined *local_80;
  undefined2 local_78;
  undefined8 local_70;
  undefined1 local_68;
  undefined8 local_60;
  undefined1 local_58;
  undefined8 local_50;
  undefined1 local_48;
  undefined *local_40;
  undefined1 local_38;
  
  uVar6 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  local_70 = uVar6;
  FUN_1400a1c30(uVar6);
  local_68 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))();
  }
  lVar2 = *(longlong *)(param_1 + 0x20);
  uVar4 = (ulonglong)param_2 % (ulonglong)*(uint *)(lVar2 + 0xca0);
  if ((*(longlong *)(lVar2 + 0xc80) != 0) &&
     (puVar10 = *(uint **)(*(longlong *)(lVar2 + 0xc80) + uVar4 * 8), puVar10 != (uint *)0x0)) {
    while ((uint)uVar4 == puVar10[8] % *(uint *)(lVar2 + 0xca0)) {
      if (*puVar10 == param_2) {
        lVar3 = *(longlong *)(puVar10 + 2);
        if ((lVar3 != 0) && (*(longlong *)(lVar3 + 0x228) == 0)) {
          local_res10[0] = FUN_140159660(lVar2,lVar3);
          FUN_1400a3440();
          local_80 = PTR_DAT_1402f8008;
          if (local_res10[0] != '\0') {
            if (*(undefined8 **)(lVar3 + 0x740) == (undefined8 *)0x0) {
              uVar8 = 0;
            }
            else {
              uVar8 = **(undefined8 **)(lVar3 + 0x740);
            }
            plVar7 = (longlong *)FUN_1401a1af0(uVar8,&local_40,lVar3);
            if (local_80 == (undefined *)0x0) {
              local_80 = PTR_DAT_1402f8008;
            }
            if ((undefined *)*plVar7 != local_80) {
              uVar6 = FUN_1400a3440();
              local_60 = uVar6;
              FUN_1400a1c30(uVar6);
              puVar5 = local_80;
              local_58 = 1;
              if (((local_80 != (undefined *)0x0) && (local_80 != PTR_DAT_1402f8008)) &&
                 (puVar11 = local_80 + -8, puVar11 != (undefined *)0x0)) {
                uVar8 = FUN_1400a3440();
                local_50 = uVar8;
                FUN_1400a1c30(uVar8);
                local_48 = 1;
                piVar1 = (int *)(puVar5 + -4);
                *piVar1 = *piVar1 + -1;
                if (*piVar1 == 0) {
                  FUN_1400a3530(puVar11);
                }
                FUN_1400d1290(uVar8);
              }
              local_80 = (undefined *)*plVar7;
              if (((local_80 != PTR_DAT_1402f8008) && (local_80 != (undefined *)0x0)) &&
                 (local_80 != (undefined *)0x8)) {
                *(int *)(local_80 + -4) = *(int *)(local_80 + -4) + 1;
              }
              FUN_1400d1290(uVar6);
              uVar6 = local_70;
            }
            puVar5 = local_40;
            local_78 = (undefined2)plVar7[1];
            if (((local_40 != (undefined *)0x0) && (local_40 != PTR_DAT_1402f8008)) &&
               (puVar11 = local_40 + -8, puVar11 != (undefined *)0x0)) {
              uVar8 = FUN_1400a3440();
              local_50 = uVar8;
              FUN_1400a1c30(uVar8);
              local_48 = 1;
              piVar1 = (int *)(puVar5 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(puVar11);
              }
              FUN_1400d1290(uVar8);
            }
          }
          plVar7 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
          (**(code **)(*plVar7 + 0x150))
                    (plVar7,(ulonglong)param_2,&DAT_140318cf0,local_res10,&local_80);
          if (local_res10[0] != '\0') {
            FUN_140152760(*(undefined8 *)(param_1 + 0x20),lVar3);
          }
          puVar5 = local_80;
          if (((local_80 != (undefined *)0x0) && (local_80 != PTR_DAT_1402f8008)) &&
             (puVar11 = local_80 + -8, puVar11 != (undefined *)0x0)) {
            puVar9 = (undefined *)FUN_1400a3440();
            local_40 = puVar9;
            FUN_1400a1c30(puVar9);
            local_38 = 1;
            piVar1 = (int *)(puVar5 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(puVar11);
            }
            FUN_1400d1290(puVar9);
          }
        }
        break;
      }
      puVar10 = *(uint **)(puVar10 + 4);
      if (puVar10 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar6);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14015aed0(longlong param_1,longlong *param_2,undefined ***param_3)

{
  int *piVar1;
  void *pvVar2;
  bool bVar3;
  bool bVar4;
  undefined ***pppuVar5;
  int iVar6;
  char cVar7;
  int iVar8;
  uint uVar9;
  uint uVar10;
  uint uVar11;
  undefined4 uVar12;
  uint *puVar13;
  undefined8 uVar14;
  longlong *plVar15;
  undefined4 *puVar16;
  undefined4 *puVar17;
  undefined4 *puVar18;
  uint uVar19;
  undefined *puVar20;
  undefined4 *puVar21;
  ulonglong uVar22;
  longlong lVar23;
  uint *puVar24;
  uint uVar25;
  longlong lVar26;
  double dVar27;
  undefined1 auStack_488 [32];
  undefined ***local_468;
  uint *local_458;
  undefined ***local_450;
  undefined4 *local_448;
  char *local_440;
  undefined4 *local_438;
  undefined **local_430;
  longlong *local_428;
  longlong local_420;
  ulonglong local_418;
  undefined8 local_410;
  undefined *local_408;
  undefined **local_400;
  undefined8 local_3f8;
  undefined4 *local_3f0;
  undefined8 local_3e8;
  undefined8 local_3e0;
  undefined **local_3d8;
  longlong *local_3d0;
  undefined4 *local_3c8;
  ulonglong local_3c0;
  undefined4 local_3b8;
  undefined4 local_3b4;
  undefined **local_3b0;
  undefined8 local_3a8;
  undefined4 *local_3a0;
  undefined8 local_398;
  undefined8 local_390;
  undefined **local_388;
  longlong local_380;
  undefined4 *local_378;
  undefined8 local_370;
  undefined4 local_368;
  undefined4 local_364;
  void *local_360;
  char *local_358;
  undefined **local_350;
  undefined8 local_348;
  undefined8 local_340;
  undefined8 local_338;
  undefined8 local_330;
  undefined8 local_328;
  undefined1 local_320;
  undefined8 local_318;
  undefined1 local_310;
  undefined8 local_308;
  undefined1 local_300;
  undefined8 local_2f8;
  undefined1 local_2f0;
  undefined8 local_2e8;
  longlong local_2e0;
  undefined1 local_2d8;
  exception local_2d0 [24];
  exception local_2b8 [24];
  undefined1 local_2a0 [72];
  undefined1 local_258 [72];
  undefined1 local_210 [72];
  undefined1 local_1c8 [72];
  undefined1 local_180 [24];
  undefined1 *local_168;
  undefined1 local_160 [136];
  undefined1 *local_d8;
  undefined1 local_d0 [136];
  ulonglong local_48;
  
  local_2e8 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_488;
  local_2e0 = param_1 + 0xb8;
  local_450 = param_3;
  FUN_1400a1c30(local_2e0);
  local_2d8 = 1;
  if ((*(longlong **)(param_1 + 0x6a0) != (longlong *)0x0) &&
     (**(longlong **)(param_1 + 0x6a0) != 0)) goto LAB_14015bd01;
  iVar8 = *(int *)((longlong)param_2 + 0x54);
  if (iVar8 == 0) {
    iVar8 = FUN_1400a2990();
    *(int *)((longlong)param_2 + 0x54) = iVar8;
  }
  if (iVar8 < 0) {
    FUN_1400a2320(local_210,L"Invalid thread count");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_210,(ThrowInfo *)&DAT_1402f4860);
  }
  bVar4 = false;
  bVar3 = false;
  puVar17 = (undefined4 *)0x0;
  uVar11 = 0;
  puVar18 = puVar17;
  puVar16 = puVar17;
  if (0 < (int)param_2[6]) {
    do {
      if (((longlong)puVar18 < 0) || ((int)param_2[6] <= (int)puVar16)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      if (*(int *)(param_2[5] + (longlong)puVar18 * 4) == 0) {
        bVar3 = true;
      }
      else {
        bVar4 = true;
      }
      uVar19 = (int)puVar16 + 1;
      puVar16 = (undefined4 *)(ulonglong)uVar19;
      puVar18 = (undefined4 *)((longlong)puVar18 + 1);
    } while ((int)uVar19 < (int)param_2[6]);
    if ((bVar3) && (bVar4)) {
      FUN_1400a2320(local_258,
                    L"Cannot assign non-zero UDP port number with zero UDP port number! All non-zero or all zero must be guaranteed!"
                   );
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_258,(ThrowInfo *)&DAT_1402f4860);
    }
  }
  iVar8 = *(int *)((longlong)param_2 + 0x5c);
  if (((iVar8 != 0x80) && (iVar8 != 0xc0)) && (iVar8 != 0x100)) {
    FUN_1400a2320(local_1c8,L"Invalid key length!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_1c8,(ThrowInfo *)&DAT_1402f4860);
  }
  local_3d8 = Proud::CFastArray<int,0>::vftable;
  if (DAT_14030ae60 != 5) {
    FUN_140140ce0();
  }
  local_3d0 = (longlong *)param_2[4];
  local_3b4 = *(undefined4 *)((longlong)param_2 + 0x3c);
  local_3c8 = (undefined4 *)0x0;
  local_3c0 = 0;
  local_3b8 = 0;
  iVar8 = (int)param_2[6];
  lVar26 = (longlong)iVar8;
  if (iVar8 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_140021fb0(&local_3d8,iVar8);
  puVar18 = local_3c8;
  iVar6 = (int)local_3c0;
  puVar16 = local_3c8;
  if ((int)local_3c0 == 0) {
    puVar16 = puVar17;
  }
  puVar21 = puVar17;
  if ((int)param_2[6] != 0) {
    puVar21 = (undefined4 *)param_2[5];
  }
  if (0 < iVar8) {
    lVar23 = (longlong)puVar21 - (longlong)puVar16;
    do {
      *puVar16 = *(undefined4 *)(lVar23 + (longlong)puVar16);
      puVar16 = puVar16 + 1;
      lVar26 = lVar26 + -1;
    } while (lVar26 != 0);
  }
  puVar16 = local_3c8;
  if ((int)local_3c0 == 0) {
    puVar16 = puVar17;
  }
  FUN_140155bb0(puVar16,local_3c0 & 0xffffffff,0);
  puVar16 = puVar17;
  puVar21 = puVar17;
  if (0 < iVar6 + -1) {
    do {
      if (((longlong)puVar16 < 0) || (iVar6 <= (int)puVar21)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      if ((longlong)puVar16 + 1 < 0) {
LAB_14015b14c:
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      uVar19 = (int)puVar21 + 1;
      puVar21 = (undefined4 *)(ulonglong)uVar19;
      if (iVar6 <= (int)uVar19) goto LAB_14015b14c;
      if ((puVar18[(longlong)puVar16] == puVar18[(longlong)puVar16 + 1]) &&
         (puVar18[(longlong)puVar16] != 0)) {
        FUN_1400a2320(local_2a0,L"Cannot add duplicated UDP port number!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_2a0,(ThrowInfo *)&DAT_1402f4860);
      }
      puVar16 = (undefined4 *)((longlong)puVar16 + 1);
    } while ((int)uVar19 < iVar6 + -1);
  }
  local_430 = Proud::CFastArray<>::vftable;
  local_428 = (longlong *)0x0;
  local_420 = 0;
  local_418 = 0;
  local_410 = 0;
  FUN_1400a7b00(&local_430);
  if ((1 < (int)local_418) &&
     (((puVar20 = (undefined *)param_2[1], puVar20 == (undefined *)0x0 ||
       (puVar20 == PTR_DAT_1402f8010)) || (*(int *)(puVar20 + -8) == 0)))) {
    FUN_1400a3440();
    local_458 = (uint *)PTR_DAT_1402f8010;
    uVar19 = FUN_1400a32c0(
                          L"Server has multiple network devices, however, no device is specified for listening. Is it your intention?"
                          );
    puVar16 = puVar17;
    if ((local_458 != (uint *)0x0) &&
       (puVar16 = (undefined4 *)0x0, local_458 != (uint *)PTR_DAT_1402f8010)) {
      puVar16 = (undefined4 *)(ulonglong)local_458[-2];
    }
    uVar9 = uVar19;
    if ((((int)uVar19 <= (int)puVar16) && (uVar9 = uVar11, local_458 != (uint *)0x0)) &&
       (local_458 != (uint *)PTR_DAT_1402f8010)) {
      uVar9 = local_458[-2];
    }
    uVar25 = 1;
    if (1 < (int)uVar9) {
      uVar25 = uVar9;
    }
    uVar10 = 0;
    uVar9 = uVar10;
    if ((local_458 != (uint *)0x0) && (local_458 != (uint *)PTR_DAT_1402f8010)) {
      uVar9 = local_458[-2];
    }
    if ((int)uVar9 < (int)uVar25) {
      if (local_458 == (uint *)0x0) {
        local_458 = (uint *)PTR_DAT_1402f8010;
      }
      if ((int)uVar25 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if (uVar25 == 0) {
        FUN_1400031d0(&local_458);
      }
      else {
        uVar9 = uVar10;
        if ((local_458 != (uint *)0x0) && (local_458 != (uint *)PTR_DAT_1402f8010)) {
          uVar9 = local_458[-2];
        }
        if (uVar25 != uVar9) {
          puVar13 = (uint *)FUN_1400a34c0((longlong)(int)uVar25 * 2 + 10);
          if (puVar13 != (uint *)0x0) {
            *puVar13 = 0;
            puVar13[1] = 1;
          }
          *puVar13 = uVar25;
          uVar9 = uVar10;
          if ((local_458 != (uint *)0x0) && (local_458 != (uint *)PTR_DAT_1402f8010)) {
            uVar9 = local_458[-2];
          }
          puVar24 = (uint *)PTR_DAT_1402f8010;
          if ((int)uVar25 < (int)uVar9) {
LAB_14015b2b1:
            if (local_458 != (uint *)0x0) {
              puVar24 = local_458;
            }
          }
          else {
            uVar25 = uVar11;
            if (local_458 != (uint *)0x0) {
              if (local_458 != (uint *)PTR_DAT_1402f8010) {
                uVar25 = local_458[-2];
              }
              goto LAB_14015b2b1;
            }
          }
          FUN_1400a32f0(puVar13 + 2,puVar24,uVar25);
          FUN_1400031d0(&local_458);
          local_458 = puVar13 + 2;
        }
      }
    }
    FUN_140002e30(&local_458);
    puVar13 = local_458;
    if (local_458 == (uint *)0x0) {
      puVar13 = (uint *)PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar13,
                  L"Server has multiple network devices, however, no device is specified for listening. Is it your intention?"
                  ,uVar19);
    puVar13 = local_458;
    if (local_458 == (uint *)0x0) {
      puVar13 = (uint *)PTR_DAT_1402f8010;
    }
    uVar19 = FUN_1400a32c0(puVar13);
    uVar11 = 0;
    if (0 < (int)uVar19) {
      uVar11 = uVar19;
    }
    uVar19 = uVar10;
    if ((local_458 != (uint *)0x0) && (local_458 != (uint *)PTR_DAT_1402f8010)) {
      uVar19 = local_458[-2];
    }
    if (((int)uVar11 < (int)uVar19) || (uVar11 = uVar10, local_458 == (uint *)0x0)) {
LAB_14015b354:
      if (((local_458 != (uint *)PTR_DAT_1402f8010) && (local_458 != (uint *)0x0)) &&
         (local_458 + -2 != (uint *)0x0)) {
        local_458[-2] = uVar11;
        *(undefined2 *)((longlong)local_458 + (longlong)(int)uVar11 * 2) = 0;
      }
    }
    else if (local_458 != (uint *)PTR_DAT_1402f8010) {
      uVar11 = local_458[-2];
      goto LAB_14015b354;
    }
    local_348 = 0;
    local_340 = 0;
    local_338 = 0;
    local_330 = 0;
    local_350 = Proud::ByteArray::vftable;
    local_468 = &local_350;
    uVar14 = FUN_1401416a0(&local_360,1,0,&local_458);
    FUN_1401574c0(param_1 + -0xa8,uVar14);
    FUN_140140df0(&local_350);
    puVar13 = local_458;
    if (((local_458 != (uint *)0x0) && (local_458 != (uint *)PTR_DAT_1402f8010)) &&
       (puVar24 = local_458 + -2, puVar24 != (uint *)0x0)) {
      uVar14 = FUN_1400a3440();
      local_2f8 = uVar14;
      FUN_1400a1c30(uVar14);
      local_2f0 = 1;
      puVar13 = puVar13 + -1;
      *puVar13 = *puVar13 - 1;
      if (*puVar13 == 0) {
        FUN_1400a3530(puVar24);
      }
      FUN_1400d1290(uVar14);
      local_2f0 = 0;
    }
    local_458 = (uint *)PTR_DAT_1402f8010;
    FUN_1400a3440();
    local_438 = (undefined4 *)PTR_DAT_1402f8010;
    plVar15 = (longlong *)FUN_1400a3170(&local_408);
    puVar20 = (undefined *)*plVar15;
    if ((undefined *)*plVar15 == (undefined *)0x0) {
      puVar20 = PTR_DAT_1402f8010;
    }
    FUN_14003c600(&local_438,L"No NIC binding though multiple NIC detected##Process=%s",puVar20);
    if (((local_408 != (undefined *)0x0) && (local_408 != PTR_DAT_1402f8010)) &&
       (local_408 + -8 != (undefined *)0x0)) {
      uVar14 = FUN_1400a3440();
      local_318 = uVar14;
      FUN_1400a1c30(uVar14);
      local_310 = 1;
      piVar1 = (int *)(local_408 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(local_408 + -8);
      }
      FUN_1400d1290(uVar14);
      local_310 = 0;
    }
    local_408 = PTR_DAT_1402f8010;
    FUN_1400a3440();
    puVar16 = local_438;
    local_448 = (undefined4 *)PTR_DAT_1402f8010;
    if (PTR_DAT_1402f8010 == (undefined *)0x0) {
      local_448 = puVar17;
    }
    if (local_438 != (undefined4 *)PTR_DAT_1402f8010) {
      uVar14 = FUN_1400a3440();
      local_308 = uVar14;
      FUN_1400a1c30(uVar14);
      local_300 = 1;
      FUN_1400031d0(&local_448);
      local_448 = puVar16;
      if (((puVar16 != (undefined4 *)PTR_DAT_1402f8010) && (puVar16 != (undefined4 *)0x0)) &&
         (puVar16 != (undefined4 *)0x8)) {
        puVar16[-1] = puVar16[-1] + 1;
      }
      FUN_1400d1290(uVar14);
      local_300 = 0;
    }
    FUN_1400a6370(&local_448);
    if (((puVar16 != (undefined4 *)0x0) && (puVar16 != (undefined4 *)PTR_DAT_1402f8010)) &&
       (puVar16 + -2 != (undefined4 *)0x0)) {
      uVar14 = FUN_1400a3440();
      local_328 = uVar14;
      FUN_1400a1c30(uVar14);
      local_320 = 1;
      piVar1 = puVar16 + -1;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar16 + -2);
      }
      FUN_1400d1290(uVar14);
      local_320 = 0;
    }
    local_438 = (undefined4 *)PTR_DAT_1402f8010;
  }
  dVar27 = (double)param_2[0x16];
  if ((double)param_2[0x16] <= 0.0) {
    dVar27 = DAT_1402f81a0;
  }
  *(double *)(param_1 + 0x778) = dVar27;
  *(undefined1 *)(param_1 + 0x1a4) = *(undefined1 *)((longlong)param_2 + 0x65);
  *(undefined1 *)(param_1 + 0x1a5) = *(undefined1 *)((longlong)param_2 + 100);
  *(undefined1 *)(param_1 + 0x1a6) = *(undefined1 *)((longlong)param_2 + 0x67);
  *(char *)(param_1 + 0x198) = (char)param_2[0xf];
  *(char *)(param_1 + 0x1c0) = (char)param_2[0xd];
  iVar8 = *(int *)((longlong)param_2 + 0x5c);
  *(int *)(param_1 + 0x19c) = iVar8;
  if (((iVar8 != 0x80) && (iVar8 != 0xc0)) && (iVar8 != 0x100)) {
    local_358 = 
    "CStartServerParameter::m_encryptedMessageKeyLength Incorrect key length, only 128,192,256";
    std::exception::exception(local_2d0,&local_358);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_2d0,(ThrowInfo *)&DAT_1402f4710);
  }
  iVar8 = (int)param_2[0xc];
  *(int *)(param_1 + 0x1a0) = iVar8;
  if ((((iVar8 != 0) && (iVar8 != 0x200)) && (iVar8 != 0x400)) && (iVar8 != 0x800)) {
    local_440 = 
    "CStartServerParameter::m_fastEncryptedMessageKeyLength Incorrect key lengt, MaxSize is 2048, MinSize is 8"
    ;
    std::exception::exception(local_2b8,&local_440);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_2b8,(ThrowInfo *)&DAT_1402f4710);
  }
  *(int *)(param_1 + 0x1a8) = (int)param_2[0x10];
  *(undefined1 *)(param_1 + 0x1ac) = *(undefined1 *)((longlong)param_2 + 0x84);
  *(undefined1 *)(param_1 + 0x1ad) = *(undefined1 *)((longlong)param_2 + 0x85);
  FUN_1401a6160(param_1 + 0xba0,param_1 + 0xba8);
  local_3a8 = 0;
  local_3a0 = (undefined4 *)0x0;
  local_398 = 0;
  local_390 = 0;
  local_3b0 = Proud::ByteArray::vftable;
  FUN_1401a6030(&local_3b0,*(undefined4 *)(param_1 + 0x19c));
  puVar16 = local_3a0;
  if ((int)local_398 == 0) {
    puVar16 = puVar17;
  }
  FUN_140195fe0(param_1 + 0x798,puVar16,*(uint *)(param_1 + 0x19c) >> 3,0x10);
  local_3f8 = 0;
  local_3f0 = (undefined4 *)0x0;
  local_3e8 = 0;
  local_3e0 = 0;
  local_400 = Proud::ByteArray::vftable;
  FUN_1401a6030(&local_400,*(undefined4 *)(param_1 + 0x1a0));
  puVar16 = local_3f0;
  if ((int)local_3e8 == 0) {
    puVar16 = puVar17;
  }
  FUN_1401a5720(param_1 + 0xb68,puVar16,*(uint *)(param_1 + 0x1a0) >> 3);
  *(undefined4 *)(param_1 + 0xb98) = 0;
  local_440 = operator_new(0xa8);
  puVar16 = puVar17;
  if (local_440 != (char *)0x0) {
    puVar16 = (undefined4 *)(param_1 + -0x40);
    if (param_1 == 0xa8) {
      puVar16 = puVar17;
    }
    puVar16 = (undefined4 *)FUN_1400aca10(local_440,puVar16,1);
  }
  *(undefined4 **)(param_1 + 0x6e0) = puVar16;
  local_440 = operator_new(0xa8);
  puVar16 = puVar17;
  if (local_440 != (char *)0x0) {
    puVar16 = (undefined4 *)(param_1 + -0x40);
    if (param_1 == 0xa8) {
      puVar16 = puVar17;
    }
    puVar16 = (undefined4 *)FUN_1400aca10(local_440,puVar16,1);
  }
  *(undefined4 **)(param_1 + 0x6e8) = puVar16;
  FUN_1400ad700(param_1 + 0x6b8);
  uVar14 = FUN_1400ad790(param_1 + 0x6b8);
  *(undefined8 *)(param_1 + 0x158) = uVar14;
  *(undefined8 *)(param_1 + 0x118) = 0;
  puVar16 = (undefined4 *)FUN_1400aab20(local_180);
  *(undefined4 *)(param_1 + 0x1c4) = *puVar16;
  *(undefined4 *)(param_1 + 0x1c8) = puVar16[1];
  *(undefined4 *)(param_1 + 0x1cc) = puVar16[2];
  *(undefined4 *)(param_1 + 0x1d0) = puVar16[3];
  *(int *)(param_1 + 0x179c) = (int)param_2[8];
  *(undefined4 *)(param_1 + 0x340) = *(undefined4 *)((longlong)param_2 + 0x44);
  *(int *)(param_1 + 0x344) = (int)param_2[9];
  *(undefined4 *)(param_1 + 0x348) = *(undefined4 *)((longlong)param_2 + 0x4c);
  *(int *)(param_1 + 0x34c) = (int)param_2[10];
  puVar20 = (undefined *)*param_2;
  if ((undefined *)*param_2 == (undefined *)0x0) {
    puVar20 = PTR_DAT_1402f8010;
  }
  local_168 = local_160;
  FUN_1400a1e40(&local_168,puVar20,3);
  FUN_1400a2120(param_1 + 0x168,local_168);
  if (local_168 != local_160) {
    free(local_168);
  }
  puVar20 = (undefined *)param_2[1];
  if ((undefined *)param_2[1] == (undefined *)0x0) {
    puVar20 = PTR_DAT_1402f8010;
  }
  local_d8 = local_d0;
  FUN_1400a1e40(&local_d8,puVar20,3);
  FUN_1400a2120(param_1 + 0x170,local_d8);
  if (local_d8 != local_d0) {
    free(local_d8);
  }
  *(undefined4 *)(param_1 + 0x1b0) = *(undefined4 *)((longlong)param_2 + 0x6c);
  *(longlong *)(param_1 + 0x1b8) = param_2[0xe];
  local_388 = Proud::CFastArray<int,0>::vftable;
  if (DAT_14030ae60 != 5) {
    FUN_140140ce0();
  }
  local_380 = param_2[4];
  local_364 = *(undefined4 *)((longlong)param_2 + 0x3c);
  local_378 = (undefined4 *)0x0;
  local_370 = 0;
  local_368 = 0;
  iVar8 = (int)param_2[6];
  lVar26 = (longlong)iVar8;
  if (iVar8 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_140021fb0(&local_388,iVar8);
  pppuVar5 = local_450;
  puVar16 = local_378;
  if ((int)local_370 == 0) {
    puVar16 = puVar17;
  }
  puVar21 = puVar17;
  if ((int)param_2[6] != 0) {
    puVar21 = (undefined4 *)param_2[5];
  }
  if (0 < iVar8) {
    lVar23 = (longlong)puVar21 - (longlong)puVar16;
    do {
      *puVar16 = *(undefined4 *)(lVar23 + (longlong)puVar16);
      puVar16 = puVar16 + 1;
      lVar26 = lVar26 + -1;
    } while (lVar26 != 0);
  }
  local_468 = local_450;
  cVar7 = FUN_140158b10(param_1 + -0xa8,(int)param_2[8],&local_388,param_2 + 0x11);
  if ((cVar7 != '\0') &&
     (cVar7 = FUN_140158200(param_1 + -0xa8,(int)param_2[2],pppuVar5), cVar7 != '\0')) {
    puVar16 = puVar17;
    if (*(int *)((longlong)param_2 + 0x7c) == 0) {
      local_450 = operator_new(0x10);
      if (local_450 != (void *)0x0) {
        puVar16 = (undefined4 *)FUN_1401a4a20(local_450);
      }
    }
    else {
      local_450 = operator_new(0x90);
      if (local_450 != (void *)0x0) {
        puVar16 = (undefined4 *)FUN_1401a4fb0(local_450,DAT_1402f81a8);
      }
    }
    *(undefined4 **)(param_1 + 0x3d0) = puVar16;
    *(undefined4 *)(param_1 + 0x175c) = 0;
    FUN_14001f680(param_1 + 0x1760,&DAT_14027d1a0);
    *(undefined8 *)(param_1 + 0x1768) = 0;
    *(undefined4 *)(param_1 + 0x1798) = 0;
    uVar11 = *(uint *)(param_2 + 0xb);
    iVar8 = FUN_1400a2990();
    if (iVar8 <= (int)uVar11) {
      uVar11 = FUN_1400a2990();
    }
    puVar16 = puVar17;
    if (0 < (int)uVar11) {
      puVar16 = (undefined4 *)(ulonglong)uVar11;
    }
    *(int *)(param_2 + 0xb) = (int)puVar16;
    if ((int)puVar16 == 0) {
      uVar12 = FUN_1400a2990();
      *(undefined4 *)(param_2 + 0xb) = uVar12;
    }
    local_360 = operator_new(0x280);
    if (local_360 != (void *)0x0) {
      puVar17 = (undefined4 *)FUN_14018f6f0(local_360,param_1 + -0xa8);
    }
    *(undefined4 **)(param_1 + 0x338) = puVar17;
    FUN_1401937b0(puVar17,*(undefined4 *)((longlong)param_2 + 0x54),(int)param_2[0xb]);
    Sleep(100);
    FUN_140140df0(&local_400);
    FUN_140140df0(&local_3b0);
    local_430 = Proud::CFastArray<>::vftable;
    if (0 < (int)local_418) {
      uVar22 = local_418 & 0xffffffff;
      lVar26 = local_420;
      do {
        FUN_14000c2a0(lVar26);
        lVar26 = lVar26 + 8;
        uVar22 = uVar22 - 1;
      } while (uVar22 != 0);
    }
    if (local_420 != 0) {
      if (local_428 == (longlong *)0x0) {
        FUN_1400a3530();
      }
      else {
        (**(code **)(*local_428 + 0x18))(local_428,local_420);
      }
    }
    if (puVar18 != (undefined4 *)0x0) {
      if (local_3d0 == (longlong *)0x0) {
        FUN_1400a3530(puVar18);
      }
      else {
        (**(code **)(*local_3d0 + 0x18))(local_3d0,puVar18);
      }
    }
    FUN_1400d1290(param_1 + 0xb8);
    return 1;
  }
  FUN_1400ad750(param_1 + 0x6b8);
  pvVar2 = *(void **)(param_1 + 0x6e0);
  if (pvVar2 != (void *)0x0) {
    FUN_1400acbf0(pvVar2);
    operator_delete(pvVar2);
  }
  *(undefined8 *)(param_1 + 0x6e0) = 0;
  pvVar2 = *(void **)(param_1 + 0x6e8);
  if (pvVar2 != (void *)0x0) {
    FUN_1400acbf0(pvVar2);
    operator_delete(pvVar2);
  }
  *(undefined8 *)(param_1 + 0x6e8) = 0;
  *(undefined4 *)(param_1 + 0x1c4) = 0;
  *(undefined4 *)(param_1 + 0x1c8) = 0;
  *(undefined4 *)(param_1 + 0x1cc) = 0;
  *(undefined4 *)(param_1 + 0x1d0) = 0;
  FUN_140140df0(&local_400);
  FUN_140140df0(&local_3b0);
  local_430 = Proud::CFastArray<>::vftable;
  if (0 < (int)local_418) {
    uVar22 = local_418 & 0xffffffff;
    lVar26 = local_420;
    do {
      FUN_14000c2a0(lVar26);
      lVar26 = lVar26 + 8;
      uVar22 = uVar22 - 1;
    } while (uVar22 != 0);
  }
  if (local_420 != 0) {
    if (local_428 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*local_428 + 0x18))(local_428,local_420);
    }
  }
  if (puVar18 != (undefined4 *)0x0) {
    if (local_3d0 == (longlong *)0x0) {
      FUN_1400a3530(puVar18);
    }
    else {
      (**(code **)(*local_3d0 + 0x18))(local_3d0,puVar18);
    }
  }
LAB_14015bd01:
  FUN_1400d1290(param_1 + 0xb8);
  return 0;
}



void FUN_14015bd40(undefined8 param_1,longlong param_2,longlong param_3,longlong *param_4)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  int local_res10;
  int local_res14;
  longlong *local_res20;
  
  local_res10 = *(int *)(param_2 + 0x6f8);
  iVar1 = *(int *)(param_3 + 0x6f8);
  lVar4 = param_2;
  local_res14 = iVar1;
  if (iVar1 < local_res10) {
    lVar4 = param_3;
    param_3 = param_2;
    local_res14 = local_res10;
    local_res10 = iVar1;
  }
  lVar2 = 0;
  lVar3 = lVar2;
  if ((longlong *)*param_4 != (longlong *)0x0) {
    lVar3 = *(longlong *)*param_4;
  }
  *(longlong *)(lVar3 + 0x100) = lVar4;
  if ((longlong *)*param_4 != (longlong *)0x0) {
    lVar2 = *(longlong *)*param_4;
  }
  *(longlong *)(lVar2 + 0x108) = param_3;
  local_res20 = param_4;
  FUN_14015a570(param_1,&local_res10,param_4,local_res10,0xfffffffffffffffe);
  if ((*param_4 != 0) &&
     (*(longlong *)(*param_4 + 8) = *(longlong *)(*param_4 + 8) + -1,
     *(longlong *)(*param_4 + 8) == 0)) {
    FUN_1401462b0(*param_4);
  }
  return;
}



void FUN_14015be00(longlong param_1,longlong param_2,longlong param_3,longlong *param_4)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  int local_res8;
  int local_resc;
  longlong *local_res20;
  
  local_res8 = *(int *)(param_2 + 0x6f8);
  iVar1 = *(int *)(param_3 + 0x6f8);
  lVar4 = param_2;
  local_resc = iVar1;
  if (iVar1 < local_res8) {
    lVar4 = param_3;
    param_3 = param_2;
    local_resc = local_res8;
    local_res8 = iVar1;
  }
  lVar2 = 0;
  lVar3 = lVar2;
  if ((longlong *)*param_4 != (longlong *)0x0) {
    lVar3 = *(longlong *)*param_4;
  }
  *(longlong *)(lVar3 + 0x100) = lVar4;
  if ((longlong *)*param_4 != (longlong *)0x0) {
    lVar2 = *(longlong *)*param_4;
  }
  *(longlong *)(lVar2 + 0x108) = param_3;
  local_res20 = param_4;
  FUN_14015a570(param_1 + 0x58,&local_res8,param_4,local_res8,0xfffffffffffffffe);
  if ((*param_4 != 0) &&
     (*(longlong *)(*param_4 + 8) = *(longlong *)(*param_4 + 8) + -1,
     *(longlong *)(*param_4 + 8) == 0)) {
    FUN_1401462b0(*param_4);
  }
  return;
}



void FUN_14015bec0(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    FUN_1400a1c30(lVar1);
    *(longlong *)(*param_1 + 0x40) = *(longlong *)(*param_1 + 0x40) + -1;
    if (*(longlong *)(*param_1 + 0x40) == 0) {
      FUN_1400d1290(lVar1);
      FUN_14015a6d0(*param_1);
    }
    else {
      FUN_1400d1290(lVar1);
    }
  }
  return;
}



void FUN_14015bf40(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    FUN_1400a1c30(lVar1);
    *(longlong *)(*param_1 + 0x40) = *(longlong *)(*param_1 + 0x40) + -1;
    if (*(longlong *)(*param_1 + 0x40) == 0) {
      FUN_1400d1290(lVar1);
      FUN_14015a740(*param_1);
    }
    else {
      FUN_1400d1290(lVar1);
    }
  }
  return;
}



void FUN_14015bfc0(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    FUN_1400a1c30(lVar1);
    *(longlong *)(*param_1 + 0x40) = *(longlong *)(*param_1 + 0x40) + -1;
    if (*(longlong *)(*param_1 + 0x40) == 0) {
      FUN_1400d1290(lVar1);
      FUN_14015a790(*param_1);
    }
    else {
      FUN_1400d1290(lVar1);
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014015c136)
// WARNING: Removing unreachable block (ram,0x00014015c144)

void FUN_14015c040(ulonglong *param_1,ulonglong *param_2)

{
  longlong *plVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  uVar3 = *param_2;
  uVar4 = *param_1;
  if (uVar4 != uVar3) {
    uVar2 = uVar4;
    if (uVar3 < uVar4) {
      uVar2 = uVar3;
      uVar3 = uVar4;
    }
    if (uVar2 != 0) {
      FUN_1400a1c30(uVar2);
    }
    if (uVar3 != 0) {
      FUN_1400a1c30(uVar3);
    }
    if (*param_2 != 0) {
      plVar1 = (longlong *)(*param_2 + 0x40);
      *plVar1 = *plVar1 + 1;
    }
    uVar4 = 0;
    if (*param_1 != 0) {
      plVar1 = (longlong *)(*param_1 + 0x40);
      *plVar1 = *plVar1 + -1;
      if (*(longlong *)(*param_1 + 0x40) == 0) {
        uVar4 = *param_1;
      }
    }
    *param_1 = *param_2;
    if (uVar2 != 0) {
      FUN_1400d1290(uVar2);
    }
    if (uVar3 != 0) {
      FUN_1400d1290(uVar3);
    }
    if (uVar4 != 0) {
      FUN_14015a6d0(uVar4);
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014015c266)
// WARNING: Removing unreachable block (ram,0x00014015c274)

void FUN_14015c170(ulonglong *param_1,ulonglong *param_2)

{
  longlong *plVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  uVar3 = *param_2;
  uVar4 = *param_1;
  if (uVar4 != uVar3) {
    uVar2 = uVar4;
    if (uVar3 < uVar4) {
      uVar2 = uVar3;
      uVar3 = uVar4;
    }
    if (uVar2 != 0) {
      FUN_1400a1c30(uVar2);
    }
    if (uVar3 != 0) {
      FUN_1400a1c30(uVar3);
    }
    if (*param_2 != 0) {
      plVar1 = (longlong *)(*param_2 + 0x40);
      *plVar1 = *plVar1 + 1;
    }
    uVar4 = 0;
    if (*param_1 != 0) {
      plVar1 = (longlong *)(*param_1 + 0x40);
      *plVar1 = *plVar1 + -1;
      if (*(longlong *)(*param_1 + 0x40) == 0) {
        uVar4 = *param_1;
      }
    }
    *param_1 = *param_2;
    if (uVar2 != 0) {
      FUN_1400d1290(uVar2);
    }
    if (uVar3 != 0) {
      FUN_1400d1290(uVar3);
    }
    if (uVar4 != 0) {
      FUN_14015a740(uVar4);
    }
  }
  return;
}



longlong FUN_14015c2a0(longlong param_1)

{
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined ***)(param_1 + 0x28) = Proud::ByteArray::vftable;
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 0x80) = 0;
  *(undefined8 *)(param_1 + 0x88) = 0;
  *(undefined8 *)(param_1 + 0x90) = 0;
  *(undefined8 *)(param_1 + 0x98) = 0;
  *(undefined ***)(param_1 + 0x78) = Proud::ByteArray::vftable;
  *(undefined ***)(param_1 + 0xa8) = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 0xb0) = 0;
  *(undefined2 *)(param_1 + 0xb4) = 0;
  *(undefined8 *)(param_1 + 200) = 0;
  *(undefined8 *)(param_1 + 0xd0) = 0;
  *(undefined8 *)(param_1 + 0xd8) = 0;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined ***)(param_1 + 0xc0) = Proud::ByteArray::vftable;
  return param_1;
}



void FUN_14015c350(longlong param_1)

{
  FUN_140140df0(param_1 + 0xc0);
  FUN_140140df0(param_1 + 0x78);
  FUN_14019a730(param_1 + 0x50);
  if (*(longlong *)(param_1 + 0x58) != 0) {
    if (*(int *)(param_1 + 100) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(param_1 + 0x60) = 0;
  }
  FUN_140140df0(param_1 + 0x28);
  FUN_14015bf40(param_1 + 0x20);
  FUN_14015bec0(param_1 + 0x18);
  FUN_14008c980(param_1 + 8);
  return;
}



undefined4 * FUN_14015c3e0(undefined4 *param_1,undefined8 param_2,undefined4 param_3,char param_4)

{
  longlong lVar1;
  int iVar2;
  int iVar3;
  void *pvVar4;
  undefined1 local_50 [72];
  
  FUN_140185590(param_1 + 2);
  FUN_14015c2a0(param_1 + 0xc);
  if (param_4 != '\0') {
    if (*(longlong *)(param_1 + 4) == 0) {
      if (*(longlong *)(param_1 + 6) == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      iVar2 = param_1[8];
    }
    else {
      iVar2 = *(int *)(*(longlong *)(param_1 + 4) + 0x18);
    }
    if (1 < iVar2) {
      if (*(longlong *)(param_1 + 6) == 0) {
        lVar1 = *(longlong *)(param_1 + 4);
        if (lVar1 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        iVar2 = *(int *)(lVar1 + 0x18);
        iVar3 = 1;
        if (iVar2 < 2) {
          iVar3 = iVar2;
        }
        if (0 < iVar2 - iVar3) {
          pvVar4 = (void *)0x0;
          if (iVar2 != 0) {
            pvVar4 = *(void **)(lVar1 + 0x10);
          }
          memmove(pvVar4,(void *)((longlong)iVar3 + (longlong)pvVar4),(longlong)(iVar2 - iVar3));
        }
        FUN_14003cda0(lVar1,*(int *)(lVar1 + 0x18) - iVar3);
      }
      else {
        pvVar4 = *(void **)(param_1 + 6);
        if (pvVar4 == (void *)0x0) {
          FUN_1400a2320(local_50,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
        }
        iVar2 = param_1[8];
        iVar3 = 1;
        if (iVar2 < 2) {
          iVar3 = iVar2;
        }
        memmove(pvVar4,(void *)((longlong)iVar3 + (longlong)pvVar4),(longlong)(iVar2 - iVar3));
        if (*(longlong *)(param_1 + 6) == 0) {
          FUN_1400a2320(local_50,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
        }
        iVar3 = param_1[8] - iVar3;
        if ((iVar3 < 0) || ((int)param_1[9] < iVar3)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        param_1[8] = iVar3;
      }
    }
  }
  *param_1 = param_3;
  return param_1;
}



void FUN_14015c560(longlong param_1)

{
  FUN_14015c350(param_1 + 0x30);
  FUN_14019a730(param_1 + 0x10);
  if (*(longlong *)(param_1 + 0x18) != 0) {
    if (*(int *)(param_1 + 0x24) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(param_1 + 0x20) = 0;
  }
  return;
}



undefined8 * FUN_14015c5c0(longlong param_1,undefined8 *param_2,uint param_3)

{
  uint *puVar1;
  ulonglong uVar2;
  
  *param_2 = 0;
  uVar2 = (ulonglong)param_3 % (ulonglong)*(uint *)(param_1 + 0x428);
  if (*(longlong *)(param_1 + 0x408) != 0) {
    puVar1 = *(uint **)(*(longlong *)(param_1 + 0x408) + uVar2 * 8);
    while( true ) {
      if (puVar1 == (uint *)0x0) {
        return param_2;
      }
      if ((uint)uVar2 != puVar1[8] % *(uint *)(param_1 + 0x428)) {
        return param_2;
      }
      if (*puVar1 == param_3) break;
      puVar1 = *(uint **)(puVar1 + 4);
    }
    FUN_1401588e0(param_2,puVar1 + 2,param_3,uVar2,0xfffffffffffffffe);
  }
  return param_2;
}



undefined8 FUN_14015c650(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong *local_res8;
  undefined8 uVar4;
  undefined1 uVar5;
  
  uVar4 = 0xfffffffffffffffe;
  plVar1 = (longlong *)(param_1 + -0xa8);
  uVar3 = (**(code **)(*plVar1 + 0x58))(plVar1);
  FUN_1400a1c30(uVar3);
  uVar5 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*plVar1 + 200))(plVar1,L"Proud::CNetServerImpl::GetP2PGroupInfo");
  }
  FUN_14015c5c0(plVar1,&local_res8,param_2,param_4,uVar4,uVar3,uVar5);
  if ((local_res8 == (longlong *)0x0) || (*local_res8 == 0)) {
    if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0))
    {
      lVar2 = *local_res8;
      if (lVar2 != 0) {
        FUN_140149600(lVar2);
        FUN_1400a3530(lVar2);
      }
      FUN_1400a3530(local_res8);
    }
    FUN_1400d1290(uVar3);
    uVar3 = 0;
  }
  else {
    FUN_1401a6b60(*local_res8,param_3);
    if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0))
    {
      lVar2 = *local_res8;
      if (lVar2 != 0) {
        FUN_140149600(lVar2);
        FUN_1400a3530(lVar2);
      }
      FUN_1400a3530(local_res8);
    }
    FUN_1400d1290(uVar3);
    uVar3 = 1;
  }
  return uVar3;
}



longlong * FUN_14015c790(undefined8 param_1,int param_2,longlong *param_3)

{
  undefined4 uVar1;
  longlong lVar2;
  undefined8 *puVar3;
  longlong lVar4;
  undefined4 *puVar5;
  undefined4 *puVar6;
  longlong *local_res20;
  
  puVar3 = (undefined8 *)FUN_14015c5c0(param_1,&local_res20,param_2);
  puVar5 = (undefined4 *)0x0;
  puVar6 = puVar5;
  if ((undefined8 *)*puVar3 != (undefined8 *)0x0) {
    puVar6 = *(undefined4 **)*puVar3;
  }
  if ((local_res20 != (longlong *)0x0) &&
     (local_res20[1] = local_res20[1] + -1, local_res20[1] == 0)) {
    lVar4 = *local_res20;
    if (lVar4 != 0) {
      FUN_140149600(lVar4);
      FUN_1400a3530(lVar4);
    }
    local_res20 = (longlong *)FUN_1400a3530(local_res20);
  }
  if (puVar6 == (undefined4 *)0x0) {
    if ((param_2 != 1) && (lVar4 = FUN_140146cc0(param_1,param_2), lVar4 == 0)) {
      return (longlong *)0x0;
    }
    local_res20 = (longlong *)FUN_140145410(param_3,param_3[1],param_2);
  }
  else {
    if (*(longlong *)(puVar6 + 10) != 0) {
      puVar5 = *(undefined4 **)(puVar6 + 6);
    }
    while (puVar5 != (undefined4 *)0x0) {
      lVar4 = param_3[1];
      uVar1 = *puVar5;
      if (lVar4 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      FUN_1401442d0(param_3,lVar4 + 1,0xffffffffffffffff);
      if (param_3[1] <= lVar4) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if ((ulonglong)param_3[2] < 0x65) {
        local_res20 = (longlong *)((longlong)param_3 + lVar4 * 4 + 0x20);
        *(undefined4 *)local_res20 = uVar1;
        puVar5 = *(undefined4 **)(puVar5 + 6);
      }
      else {
        lVar2 = *param_3;
        *(undefined4 *)(lVar2 + lVar4 * 4) = uVar1;
        puVar5 = *(undefined4 **)(puVar5 + 6);
        local_res20 = (longlong *)(lVar2 + lVar4 * 4);
      }
    }
  }
  return local_res20;
}



// WARNING: Removing unreachable block (ram,0x00014015cd8b)
// WARNING: Removing unreachable block (ram,0x00014015cd92)
// WARNING: Removing unreachable block (ram,0x00014015cda0)
// WARNING: Removing unreachable block (ram,0x00014015cdad)
// WARNING: Removing unreachable block (ram,0x00014015cda5)
// WARNING: Removing unreachable block (ram,0x00014015cdb3)
// WARNING: Removing unreachable block (ram,0x00014015cdc5)
// WARNING: Removing unreachable block (ram,0x00014015ca2a)

undefined8 FUN_14015c8b0(longlong param_1,uint param_2,int *param_3)

{
  longlong lVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  uint uVar4;
  int iVar5;
  undefined8 uVar6;
  longlong *plVar7;
  longlong *plVar8;
  undefined8 *puVar9;
  longlong *plVar10;
  longlong *plVar11;
  uint uVar12;
  longlong lVar13;
  uint *puVar14;
  longlong *plVar15;
  longlong *plVar16;
  longlong *plVar17;
  longlong *plVar18;
  double dVar19;
  double dVar20;
  double dVar21;
  longlong *local_res8;
  undefined **local_90;
  longlong *local_88;
  longlong *local_80;
  ulonglong local_78;
  int local_70;
  undefined4 local_6c;
  longlong *local_68;
  longlong lStack_60;
  longlong *local_58;
  longlong lStack_50;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  uVar6 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_1400a1c30(uVar6);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))(param_1 + -0xa8);
  }
  uVar3 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xbf8);
  if ((*(longlong *)(param_1 + 0xbd8) != 0) &&
     (puVar14 = *(uint **)(*(longlong *)(param_1 + 0xbd8) + uVar3 * 8), puVar14 != (uint *)0x0)) {
    while ((uint)uVar3 == puVar14[8] % *(uint *)(param_1 + 0xbf8)) {
      if (*puVar14 == param_2) {
        lVar1 = *(longlong *)(puVar14 + 2);
        if ((lVar1 != 0) && (*(longlong *)(lVar1 + 0x228) == 0)) {
          plVar8 = (longlong *)0x0;
          param_3[0] = 0;
          param_3[1] = 0;
          param_3[3] = *(int *)(lVar1 + 0x1d0);
          param_3[2] = *(int *)(lVar1 + 0x1d4);
          plVar7 = plVar8;
          if (*(longlong *)(lVar1 + 0x6c0) != 0) {
            plVar7 = *(longlong **)(lVar1 + 0x6b0);
          }
          for (; plVar7 != (longlong *)0x0; plVar7 = (longlong *)plVar7[2]) {
            plVar15 = plVar8;
            if ((undefined8 *)*plVar7 != (undefined8 *)0x0) {
              plVar15 = *(longlong **)*plVar7;
            }
            if ((char)plVar15[0x22] != '\0') {
              *param_3 = *param_3 + 1;
              plVar15 = plVar8;
              if ((undefined8 *)*plVar7 != (undefined8 *)0x0) {
                plVar15 = *(longlong **)*plVar7;
              }
              if ((char)plVar15[1] == '\0') {
                param_3[1] = param_3[1] + 1;
              }
            }
          }
          FUN_1400d1290(uVar6);
          return 1;
        }
        break;
      }
      puVar14 = *(uint **)(puVar14 + 4);
      if (puVar14 == (uint *)0x0) break;
    }
  }
  plVar8 = (longlong *)FUN_14015c5c0(param_1 + -0xa8,&local_res8,param_2);
  plVar15 = (longlong *)0x0;
  plVar7 = plVar15;
  if ((undefined8 *)*plVar8 != (undefined8 *)0x0) {
    plVar7 = *(longlong **)*plVar8;
  }
  if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
    lVar1 = *local_res8;
    if (lVar1 != 0) {
      FUN_140149600(lVar1);
      FUN_1400a3530(lVar1);
    }
    FUN_1400a3530(local_res8);
  }
  if (plVar7 == (longlong *)0x0) {
    FUN_1400d1290(uVar6);
    uVar6 = 0;
  }
  else {
    param_3[0] = 0;
    param_3[1] = 0;
    param_3[2] = 0;
    param_3[3] = 0;
    local_90 = Proud::CFastArray<>::vftable;
    local_88 = (longlong *)0x0;
    local_6c = 0;
    local_80 = (longlong *)0x0;
    local_78 = 0;
    lVar1 = plVar7[5];
    dVar19 = (double)lVar1;
    if (lVar1 < 0) {
      dVar19 = dVar19 + 1.8446744073709552e+19;
    }
    uVar4 = 2;
    uVar12 = 2;
    dVar20 = 1.0;
    dVar21 = 1.0;
    while( true ) {
      if ((uVar12 & 1) != 0) {
        dVar21 = dVar21 * dVar19;
      }
      uVar12 = uVar12 >> 1;
      if (uVar12 == 0) break;
      dVar19 = dVar19 * dVar19;
    }
    if (1.0 < dVar21 * 0.5) {
      dVar19 = (double)lVar1;
      if (lVar1 < 0) {
        dVar19 = dVar19 + 1.8446744073709552e+19;
      }
      while( true ) {
        if ((uVar4 & 1) != 0) {
          dVar20 = dVar20 * dVar19;
        }
        uVar4 = uVar4 >> 1;
        if (uVar4 == 0) break;
        dVar19 = dVar19 * dVar19;
      }
      dVar20 = dVar20 * 0.5;
    }
    local_70 = 0;
    if (0 < (int)dVar20) {
      local_70 = (int)dVar20;
    }
    plVar8 = plVar15;
    plVar10 = plVar15;
    plVar17 = plVar15;
    if (lVar1 != 0) {
      plVar8 = (longlong *)plVar7[3];
      plVar10 = (longlong *)0x0;
    }
    for (; plVar8 != (longlong *)0x0; plVar8 = (longlong *)plVar8[3]) {
      iVar5 = (*(code *)**(undefined8 **)plVar8[2])();
      if (((iVar5 != 1) && (lVar1 = plVar8[2], lVar1 != 0)) && (lVar1 != 0x40)) {
        param_3[3] = param_3[3] + *(int *)(lVar1 + 400);
        param_3[2] = param_3[2] + *(int *)(lVar1 + 0x194);
        lVar13 = lVar1 + 0x660;
        plVar18 = plVar15;
        local_68 = plVar15;
        lStack_60 = lVar13;
        local_58 = plVar15;
        lStack_50 = lVar13;
        if (*(longlong *)(lVar1 + 0x680) != 0) {
          plVar18 = *(longlong **)(lVar1 + 0x670);
          local_68 = plVar18;
          local_58 = plVar18;
        }
LAB_14015cc00:
        if (plVar18 != (longlong *)0x0) {
          puVar2 = (undefined8 *)*plVar18;
          plVar11 = plVar15;
          if (puVar2 != (undefined8 *)0x0) {
            plVar11 = (longlong *)*puVar2;
          }
          uVar12 = *(uint *)(plVar7 + 6);
          uVar3 = (ulonglong)*(uint *)(plVar11[0x20] + 0x6f8) % (ulonglong)uVar12;
          lVar1 = plVar7[2];
          if ((lVar1 != 0) && (puVar14 = *(uint **)(lVar1 + uVar3 * 8), puVar14 != (uint *)0x0)) {
            while ((uint)uVar3 == puVar14[10] % uVar12) {
              if (*puVar14 == *(uint *)(plVar11[0x20] + 0x6f8)) {
                if (puVar14 != (uint *)0x0) {
                  plVar11 = plVar15;
                  if (puVar2 != (undefined8 *)0x0) {
                    plVar11 = (longlong *)*puVar2;
                  }
                  uVar3 = (ulonglong)*(uint *)(plVar11[0x21] + 0x6f8) % (ulonglong)uVar12;
                  puVar14 = *(uint **)(lVar1 + uVar3 * 8);
                  if (puVar14 != (uint *)0x0) goto LAB_14015ccb4;
                }
                break;
              }
              puVar14 = *(uint **)(puVar14 + 6);
              if (puVar14 == (uint *)0x0) break;
            }
          }
          goto LAB_14015cde4;
        }
        if (lStack_50 != lVar13) {
                    // WARNING: Subroutine does not return
          FUN_14000c6c0(0x80004005);
        }
      }
    }
    if (plVar17 != (longlong *)0x0) {
      if (local_88 == (longlong *)0x0) {
        FUN_1400a3530(plVar17);
      }
      else {
        (**(code **)(*local_88 + 0x18))(local_88,plVar17);
      }
    }
    FUN_1400d1290(uVar6);
    uVar6 = 1;
  }
  return uVar6;
  while( true ) {
    if (*puVar14 == *(uint *)(plVar11[0x21] + 0x6f8)) {
      if (puVar14 != (uint *)0x0) {
        plVar11 = plVar15;
        if (puVar2 != (undefined8 *)0x0) {
          plVar11 = (longlong *)*puVar2;
        }
        iVar5 = (int)plVar10;
        if (iVar5 < 1) goto LAB_14015cd1b;
        puVar9 = (undefined8 *)FUN_1401b2160(&local_90);
        plVar16 = plVar15;
        goto LAB_14015cd00;
      }
      break;
    }
    puVar14 = *(uint **)(puVar14 + 6);
    if (puVar14 == (uint *)0x0) break;
LAB_14015ccb4:
    if ((uint)uVar3 != puVar14[10] % uVar12) break;
  }
  goto LAB_14015cde4;
  while( true ) {
    uVar12 = (int)plVar16 + 1;
    plVar16 = (longlong *)(ulonglong)uVar12;
    puVar9 = puVar9 + 1;
    if (iVar5 <= (int)uVar12) break;
LAB_14015cd00:
    if (plVar11 == (longlong *)*puVar9) {
      if ((int)plVar16 != -1) goto LAB_14015cde4;
      break;
    }
  }
LAB_14015cd1b:
  plVar10 = plVar15;
  if (puVar2 != (undefined8 *)0x0) {
    plVar10 = (longlong *)*puVar2;
  }
  if ((char)plVar10[0x22] != '\0') {
    *param_3 = *param_3 + 1;
    plVar10 = plVar15;
    if ((undefined8 *)*plVar18 != (undefined8 *)0x0) {
      plVar10 = *(longlong **)*plVar18;
    }
    if ((char)plVar10[1] == '\0') {
      param_3[1] = param_3[1] + 1;
    }
  }
  plVar17 = plVar15;
  if ((longlong *)*plVar18 != (longlong *)0x0) {
    plVar17 = *(longlong **)*plVar18;
  }
  if (iVar5 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_140195930(&local_90);
  plVar10 = (longlong *)(local_78 & 0xffffffff);
  plVar11 = local_80;
  if ((int)local_78 == 0) {
    plVar11 = plVar15;
  }
  plVar11[iVar5] = (longlong)plVar17;
  plVar17 = local_80;
LAB_14015cde4:
  plVar18 = (longlong *)plVar18[2];
  goto LAB_14015cc00;
}



void FUN_14015ce70(undefined8 param_1,uint param_2,int *param_3,undefined8 param_4)

{
  ulonglong uVar1;
  
  if (0 < (int)param_2) {
    uVar1 = (ulonglong)param_2;
    do {
      if (*param_3 != 0) {
        FUN_14015c790(param_1,*param_3,param_4);
      }
      param_3 = param_3 + 1;
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0);
  }
  FUN_1401457d0(param_4);
  return;
}



undefined4 FUN_14015ced0(longlong param_1,undefined4 param_2,undefined8 param_3,longlong param_4)

{
  longlong *plVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  longlong *plVar6;
  longlong lVar7;
  longlong lVar8;
  int iVar9;
  longlong lVar10;
  int iVar11;
  longlong lVar12;
  longlong *local_res8;
  
  plVar1 = (longlong *)(param_1 + -0xa8);
  uVar5 = (**(code **)(*plVar1 + 0x58))(plVar1);
  FUN_1400a1c30(uVar5);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*plVar1 + 200))(plVar1,L"Proud::CNetServerImpl::GetMostSuitableSuperPeerInGroup");
  }
  plVar6 = (longlong *)FUN_14015c5c0(plVar1,&local_res8,param_2);
  if ((longlong *)*plVar6 == (longlong *)0x0) {
    lVar12 = 0;
  }
  else {
    lVar12 = *(longlong *)*plVar6;
  }
  if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
    lVar8 = *local_res8;
    if (lVar8 != 0) {
      FUN_140149600(lVar8);
      FUN_1400a3530(lVar8);
    }
    FUN_1400a3530(local_res8);
  }
  if (lVar12 != 0) {
    FUN_140151da0(plVar1);
    iVar11 = 0;
    iVar2 = *(int *)(lVar12 + 0x78);
    lVar8 = 0;
    if (0 < iVar2) {
      lVar10 = 0;
      do {
        if ((lVar8 < 0) || (iVar2 <= iVar11)) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        iVar9 = 0;
        lVar7 = 0;
        iVar3 = *(int *)(param_4 + 0x18);
        if (iVar3 < 1) {
LAB_14015d02b:
          if ((-1 < iVar11) && (iVar11 < iVar2)) {
            uVar4 = *(undefined4 *)((longlong)iVar11 * 0x40 + *(longlong *)(lVar12 + 0x70));
            FUN_1400d1290(uVar5);
            return uVar4;
          }
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        while( true ) {
          if ((lVar7 < 0) || (iVar3 <= iVar9)) {
                    // WARNING: Subroutine does not return
            FUN_1400a2700();
          }
          if (*(int *)(*(longlong *)(param_4 + 0x10) + lVar7 * 4) ==
              *(int *)(lVar10 + *(longlong *)(lVar12 + 0x70))) break;
          iVar9 = iVar9 + 1;
          lVar7 = lVar7 + 1;
          if (iVar3 <= iVar9) goto LAB_14015d02b;
        }
        iVar11 = iVar11 + 1;
        lVar8 = lVar8 + 1;
        lVar10 = lVar10 + 0x40;
      } while (iVar11 < iVar2);
    }
  }
  FUN_1400d1290(uVar5);
  return 0;
}



bool FUN_14015d080(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong *local_res8;
  
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0x120) + 200))(param_1 + -0x120);
  }
  if (param_2 == 1) {
    return true;
  }
  uVar3 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xb80);
  if (*(longlong *)(param_1 + 0xb60) != 0) {
    puVar1 = *(uint **)(*(longlong *)(param_1 + 0xb60) + uVar3 * 8);
    while( true ) {
      if ((puVar1 == (uint *)0x0) || ((uint)uVar3 != puVar1[8] % *(uint *)(param_1 + 0xb80)))
      goto LAB_14015d123;
      if (*puVar1 == param_2) break;
      puVar1 = *(uint **)(puVar1 + 4);
    }
    if (*(longlong *)(puVar1 + 2) != 0) {
      return true;
    }
  }
LAB_14015d123:
  plVar4 = (longlong *)FUN_14015c5c0(param_1 + -0x120,&local_res8,param_2);
  lVar5 = 0;
  if ((longlong *)*plVar4 != (longlong *)0x0) {
    lVar5 = *(longlong *)*plVar4;
  }
  if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
    lVar2 = *local_res8;
    if (lVar2 != 0) {
      FUN_140149600(lVar2);
      FUN_1400a3530(lVar2);
    }
    FUN_1400a3530(local_res8);
  }
  return lVar5 != 0;
}



int FUN_14015d1a0(longlong param_1,undefined4 param_2,undefined8 *param_3,int param_4,
                 undefined8 param_5,longlong param_6)

{
  int iVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong *plVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  int iVar8;
  longlong lVar9;
  int iVar10;
  longlong lVar11;
  longlong lVar12;
  int local_res8;
  undefined8 *local_res18;
  longlong *local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined1 local_40;
  
  local_50 = 0xfffffffffffffffe;
  plVar4 = (longlong *)(param_1 + -0xa8);
  uVar3 = (**(code **)(*plVar4 + 0x58))(plVar4);
  local_48 = uVar3;
  FUN_1400a1c30(uVar3);
  local_40 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*plVar4 + 200))
              (plVar4,L"Proud::CNetServerImpl::GetSuitableSuperPeerRankListInGroup");
  }
  plVar4 = (longlong *)FUN_14015c5c0(plVar4,&local_58,param_2);
  if ((longlong *)*plVar4 == (longlong *)0x0) {
    lVar11 = 0;
  }
  else {
    lVar11 = *(longlong *)*plVar4;
  }
  if ((local_58 != (longlong *)0x0) &&
     (local_58[1] = local_58[1] + -1, uVar3 = local_48, local_58[1] == 0)) {
    lVar7 = *local_58;
    if (lVar7 != 0) {
      FUN_140149600(lVar7);
      FUN_1400a3530(lVar7);
    }
    FUN_1400a3530(local_58);
    uVar3 = local_48;
  }
  if (lVar11 == 0) {
    FUN_1400d1290(uVar3);
    local_res8 = 0;
  }
  else {
    FUN_140151da0();
    iVar5 = 0;
    local_res8 = 0;
    iVar10 = 0;
    lVar7 = 0;
    lVar12 = 0;
    if (0 < *(int *)(lVar11 + 0x78)) {
      lVar9 = 0;
      local_res18 = param_3;
      do {
        if (lVar12 < param_4) {
          if ((lVar7 < 0) || (*(int *)(lVar11 + 0x78) <= iVar10)) {
                    // WARNING: Subroutine does not return
            FUN_1400a2700();
          }
          lVar2 = *(longlong *)(lVar11 + 0x70);
          iVar8 = 0;
          lVar6 = 0;
          iVar1 = *(int *)(param_6 + 0x18);
          if (0 < iVar1) {
            do {
              if ((lVar6 < 0) || (iVar1 <= iVar8)) {
                    // WARNING: Subroutine does not return
                FUN_1400a2700();
              }
              iVar5 = local_res8;
              if (*(int *)(*(longlong *)(param_6 + 0x10) + lVar6 * 4) == *(int *)(lVar2 + lVar9))
              goto LAB_14015d3a0;
              iVar8 = iVar8 + 1;
              lVar6 = lVar6 + 1;
            } while (iVar8 < iVar1);
          }
          if (*(int *)(lVar11 + 0x78) <= iVar10) {
                    // WARNING: Subroutine does not return
            FUN_1400a2700();
          }
          *local_res18 = *(undefined8 *)(lVar2 + lVar9);
          local_res18[1] = *(undefined8 *)(lVar2 + 8 + lVar9);
          local_res18[2] = *(undefined8 *)(lVar2 + 0x10 + lVar9);
          local_res18[3] = *(undefined8 *)(lVar2 + 0x18 + lVar9);
          local_res18[4] = *(undefined8 *)(lVar2 + 0x20 + lVar9);
          local_res18[5] = *(undefined8 *)(lVar2 + 0x28 + lVar9);
          local_res18[6] = *(undefined8 *)(lVar2 + 0x30 + lVar9);
          local_res18[7] = *(undefined8 *)(lVar2 + 0x38 + lVar9);
          local_res8 = iVar5 + 1;
          lVar12 = lVar12 + 1;
          local_res18 = local_res18 + 8;
          iVar5 = local_res8;
        }
LAB_14015d3a0:
        iVar10 = iVar10 + 1;
        lVar7 = lVar7 + 1;
        lVar9 = lVar9 + 0x40;
      } while (iVar10 < *(int *)(lVar11 + 0x78));
    }
    FUN_1400d1290(uVar3);
  }
  return local_res8;
}



// WARNING: Removing unreachable block (ram,0x00014015d7d3)
// WARNING: Removing unreachable block (ram,0x00014015d7ef)

void FUN_14015d400(longlong param_1,longlong param_2)

{
  ulonglong *puVar1;
  longlong *plVar2;
  void *pvVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  longlong lVar6;
  ulonglong uVar7;
  longlong lVar8;
  ulonglong *local_res8;
  longlong *local_res18;
  undefined8 uVar9;
  
  uVar9 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x20) == 0) {
    lVar8 = 0;
  }
  else {
    lVar8 = *(longlong *)(param_1 + 0x10);
  }
  while (lVar8 != 0) {
    if (lVar8 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    local_res8 = (ulonglong *)0x0;
    if (*(longlong *)(lVar8 + 8) != 0) {
      *(longlong *)(*(longlong *)(lVar8 + 8) + 8) = *(longlong *)(*(longlong *)(lVar8 + 8) + 8) + 1;
      local_res8 = *(ulonglong **)(lVar8 + 8);
    }
    if (local_res8 == (ulonglong *)0x0) {
      uVar4 = 0;
    }
    else {
      uVar4 = *local_res8;
    }
    if (*(longlong *)(uVar4 + 0x100) == param_2) {
LAB_14015d4c1:
      if (local_res8 == (ulonglong *)0x0) {
        uVar4 = 0;
      }
      else {
        uVar4 = *local_res8;
      }
      lVar6 = *(longlong *)(uVar4 + 0x100);
      if (local_res8 == (ulonglong *)0x0) {
        uVar4 = 0;
      }
      else {
        uVar4 = *local_res8;
      }
      uVar4 = (uVar4 & 0xffffffff) % (ulonglong)*(uint *)(lVar6 + 0x6c8);
      if (*(longlong *)(lVar6 + 0x6a8) != 0) {
        plVar2 = *(longlong **)(*(longlong *)(lVar6 + 0x6a8) + uVar4 * 8);
        while( true ) {
          if ((plVar2 == (longlong *)0x0) ||
             ((uint)uVar4 != *(uint *)(plVar2 + 4) % *(uint *)(lVar6 + 0x6c8))) goto LAB_14015d55a;
          if ((ulonglong *)*plVar2 == (ulonglong *)0x0) {
            uVar7 = 0;
          }
          else {
            uVar7 = *(ulonglong *)*plVar2;
          }
          if (local_res8 == (ulonglong *)0x0) {
            uVar5 = 0;
          }
          else {
            uVar5 = *local_res8;
          }
          if (uVar7 == uVar5) break;
          plVar2 = (longlong *)plVar2[2];
        }
        FUN_140158100(lVar6 + 0x6a0,plVar2,0,lVar6,uVar9);
      }
LAB_14015d55a:
      if (local_res8 == (ulonglong *)0x0) {
        uVar4 = 0;
      }
      else {
        uVar4 = *local_res8;
      }
      lVar6 = *(longlong *)(uVar4 + 0x108);
      if (local_res8 == (ulonglong *)0x0) {
        uVar4 = 0;
      }
      else {
        uVar4 = *local_res8;
      }
      uVar4 = (uVar4 & 0xffffffff) % (ulonglong)*(uint *)(lVar6 + 0x6c8);
      if (*(longlong *)(lVar6 + 0x6a8) != 0) {
        plVar2 = *(longlong **)(*(longlong *)(lVar6 + 0x6a8) + uVar4 * 8);
        while( true ) {
          if ((plVar2 == (longlong *)0x0) ||
             ((uint)uVar4 != *(uint *)(plVar2 + 4) % *(uint *)(lVar6 + 0x6c8))) goto LAB_14015d5ea;
          if ((ulonglong *)*plVar2 == (ulonglong *)0x0) {
            uVar7 = 0;
          }
          else {
            uVar7 = *(ulonglong *)*plVar2;
          }
          if (local_res8 == (ulonglong *)0x0) {
            uVar5 = 0;
          }
          else {
            uVar5 = *local_res8;
          }
          if (uVar7 == uVar5) break;
          plVar2 = (longlong *)plVar2[2];
        }
        FUN_140158100(lVar6 + 0x6a0,plVar2,0,lVar6,uVar9);
      }
LAB_14015d5ea:
      if (lVar8 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      lVar6 = *(longlong *)(lVar8 + 0x10);
      FUN_140155830(param_1,lVar8,0);
      lVar8 = lVar6;
    }
    else {
      if (local_res8 == (ulonglong *)0x0) {
        uVar4 = 0;
      }
      else {
        uVar4 = *local_res8;
      }
      if (*(longlong *)(uVar4 + 0x108) == param_2) goto LAB_14015d4c1;
      if (lVar8 != 0) {
        lVar8 = *(longlong *)(lVar8 + 0x10);
      }
    }
    if (local_res8 != (ulonglong *)0x0) {
      puVar1 = local_res8 + 1;
      *puVar1 = *puVar1 - 1;
      if (*puVar1 == 0) {
        pvVar3 = (void *)*local_res8;
        if (pvVar3 != (void *)0x0) {
          FUN_140140df0((longlong)pvVar3 + 0x148);
          FUN_140140df0((longlong)pvVar3 + 0x120);
          operator_delete(pvVar3);
        }
        FUN_1400a3530(local_res8);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x78) == 0) {
    lVar8 = 0;
  }
  else {
    lVar8 = *(longlong *)(param_1 + 0x68);
  }
  do {
    if (lVar8 == 0) {
      return;
    }
    if (lVar8 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    local_res18 = (longlong *)0x0;
    if (*(longlong *)(lVar8 + 8) != 0) {
      *(longlong *)(*(longlong *)(lVar8 + 8) + 8) = *(longlong *)(*(longlong *)(lVar8 + 8) + 8) + 1;
      local_res18 = *(longlong **)(lVar8 + 8);
    }
    if (local_res18 == (longlong *)0x0) {
      lVar6 = 0;
    }
    else {
      lVar6 = *local_res18;
    }
    if (*(longlong *)(lVar6 + 0x100) == param_2) {
code_r0x00014015d736:
      if (lVar8 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      lVar6 = *(longlong *)(lVar8 + 0x10);
      FUN_140155830(param_1 + 0x58,lVar8,0);
      lVar8 = lVar6;
    }
    else {
      if (local_res18 == (longlong *)0x0) {
        lVar6 = 0;
      }
      else {
        lVar6 = *local_res18;
      }
      if (*(longlong *)(lVar6 + 0x108) == param_2) goto code_r0x00014015d736;
      if (lVar8 != 0) {
        lVar8 = *(longlong *)(lVar8 + 0x10);
      }
    }
    if (local_res18 != (longlong *)0x0) {
      plVar2 = local_res18 + 1;
      *plVar2 = *plVar2 + -1;
      if (*plVar2 == 0) {
        pvVar3 = (void *)*local_res18;
        if (pvVar3 != (void *)0x0) {
          FUN_140140df0((longlong)pvVar3 + 0x148);
          FUN_140140df0((longlong)pvVar3 + 0x120);
          operator_delete(pvVar3);
        }
        FUN_1400a3530(local_res18);
      }
    }
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x00014015db70)
// WARNING: Removing unreachable block (ram,0x00014015db4f)
// WARNING: Removing unreachable block (ram,0x00014015db5e)
// WARNING: Removing unreachable block (ram,0x00014015d8c8)

undefined8 * FUN_14015d810(longlong param_1,longlong param_2,longlong param_3,longlong param_4)

{
  int *piVar1;
  longlong *plVar2;
  uint uVar3;
  longlong lVar4;
  ulonglong uVar5;
  undefined4 uVar6;
  undefined2 uVar7;
  undefined *puVar8;
  undefined8 *puVar9;
  undefined8 *puVar10;
  undefined8 *puVar11;
  undefined8 *puVar12;
  uint *puVar13;
  undefined8 *puVar14;
  ulonglong uVar15;
  undefined *puVar16;
  uint uVar17;
  uint uVar18;
  undefined8 *local_res8;
  undefined *local_res20;
  undefined8 *puVar19;
  undefined8 uVar20;
  
  uVar20 = 0xfffffffffffffffe;
  puVar14 = (undefined8 *)0x0;
  puVar11 = (undefined8 *)0x0;
  puVar19 = (undefined8 *)0x0;
  uVar3 = *(uint *)(param_4 + 0x6f8);
  uVar18 = *(uint *)(param_3 + 0x6f8);
  uVar17 = uVar3;
  if ((int)uVar3 < (int)uVar18) {
    uVar17 = uVar18;
    uVar18 = uVar3;
  }
  uVar15 = (ulonglong)*(uint *)(param_1 + 0x28);
  uVar5 = (ulonglong)(uVar18 << 0x10 ^ uVar17);
  puVar10 = (undefined8 *)(uVar5 / uVar15);
  uVar5 = uVar5 % uVar15;
  puVar12 = puVar14;
  if (*(longlong *)(param_1 + 8) != 0) {
    puVar13 = *(uint **)(*(longlong *)(param_1 + 8) + uVar5 * 8);
    while( true ) {
      puVar12 = puVar11;
      if ((puVar13 == (uint *)0x0) ||
         (puVar10 = (undefined8 *)(puVar13[8] / uVar15),
         (uint)uVar5 != puVar13[8] % *(uint *)(param_1 + 0x28))) goto LAB_14015dc77;
      if ((*puVar13 == uVar18) && (puVar13[1] == uVar17)) break;
      puVar13 = *(uint **)(puVar13 + 4);
    }
    if (puVar13 != (uint *)0x0) {
      puVar11 = puVar14;
      puVar12 = puVar19;
      if (*(longlong *)(puVar13 + 2) != 0) {
        *(longlong *)(*(longlong *)(puVar13 + 2) + 8) =
             *(longlong *)(*(longlong *)(puVar13 + 2) + 8) + 1;
        puVar12 = *(undefined8 **)(puVar13 + 2);
        if (puVar12 != (undefined8 *)0x0) {
          puVar11 = (undefined8 *)*puVar12;
        }
      }
      *(int *)((longlong)puVar11 + 0x114) = *(int *)((longlong)puVar11 + 0x114) + -1;
      puVar10 = puVar14;
      if (puVar12 != (undefined8 *)0x0) {
        puVar10 = (undefined8 *)*puVar12;
      }
      puVar19 = puVar12;
      if (*(int *)((longlong)puVar10 + 0x114) == 0) {
        puVar11 = puVar14;
        if (puVar12 != (undefined8 *)0x0) {
          puVar11 = (undefined8 *)*puVar12;
        }
        lVar4 = puVar11[0x20];
        puVar11 = puVar14;
        if (puVar12 != (undefined8 *)0x0) {
          puVar11 = (undefined8 *)*puVar12;
        }
        uVar5 = ((ulonglong)puVar11 & 0xffffffff) % (ulonglong)*(uint *)(lVar4 + 0x6c8);
        if (*(longlong *)(lVar4 + 0x6a8) == 0) goto LAB_14015d9bc;
        puVar11 = *(undefined8 **)(*(longlong *)(lVar4 + 0x6a8) + uVar5 * 8);
        goto joined_r0x00014015d963;
      }
    }
  }
  goto LAB_14015dc77;
joined_r0x00014015d963:
  if ((puVar11 == (undefined8 *)0x0) ||
     ((uint)uVar5 != *(uint *)(puVar11 + 4) % *(uint *)(lVar4 + 0x6c8))) goto LAB_14015d9bc;
  puVar10 = puVar14;
  if ((undefined8 *)*puVar11 != (undefined8 *)0x0) {
    puVar10 = *(undefined8 **)*puVar11;
  }
  puVar9 = puVar14;
  if (puVar12 != (undefined8 *)0x0) {
    puVar9 = (undefined8 *)*puVar12;
  }
  if (puVar10 != puVar9) {
    puVar11 = (undefined8 *)puVar11[2];
    goto joined_r0x00014015d963;
  }
  FUN_140158100(lVar4 + 0x6a0,puVar11,0,lVar4,puVar12,0xfffffffffffffffe);
LAB_14015d9bc:
  puVar11 = puVar14;
  if (puVar12 != (undefined8 *)0x0) {
    puVar11 = (undefined8 *)*puVar12;
  }
  lVar4 = puVar11[0x21];
  puVar11 = puVar14;
  if (puVar12 != (undefined8 *)0x0) {
    puVar11 = (undefined8 *)*puVar12;
  }
  uVar5 = ((ulonglong)puVar11 & 0xffffffff) % (ulonglong)*(uint *)(lVar4 + 0x6c8);
  if (*(longlong *)(lVar4 + 0x6a8) != 0) {
    puVar11 = *(undefined8 **)(*(longlong *)(lVar4 + 0x6a8) + uVar5 * 8);
    while( true ) {
      if ((puVar11 == (undefined8 *)0x0) ||
         ((uint)uVar5 != *(uint *)(puVar11 + 4) % *(uint *)(lVar4 + 0x6c8))) goto LAB_14015da4d;
      puVar10 = puVar14;
      if ((undefined8 *)*puVar11 != (undefined8 *)0x0) {
        puVar10 = *(undefined8 **)*puVar11;
      }
      puVar9 = puVar14;
      if (puVar12 != (undefined8 *)0x0) {
        puVar9 = (undefined8 *)*puVar12;
      }
      if (puVar10 == puVar9) break;
      puVar11 = (undefined8 *)puVar11[2];
    }
    FUN_140158100(lVar4 + 0x6a0,puVar11,0,lVar4,puVar19,uVar20);
  }
LAB_14015da4d:
  puVar11 = puVar14;
  if (puVar12 != (undefined8 *)0x0) {
    puVar11 = (undefined8 *)*puVar12;
  }
  if (((((double)puVar11[0x33] != 0.0) && (*(int *)(puVar11 + 0xe) != 0)) &&
      (*(int *)(puVar11 + 0x17) != 0)) && (*(int *)(puVar11 + 0xe) != *(int *)(puVar11 + 0x17))) {
    puVar11 = puVar14;
    if (puVar12 != (undefined8 *)0x0) {
      puVar11 = (undefined8 *)*puVar12;
    }
    uVar20 = (**(code **)(*(longlong *)(param_2 + 0x118) + 8))();
    puVar11[0x32] = uVar20;
    uVar7 = DAT_1402f83d4;
    uVar6 = DAT_1402f83d0;
    puVar11 = puVar14;
    if (puVar12 != (undefined8 *)0x0) {
      puVar11 = (undefined8 *)*puVar12;
    }
    if (*(char *)(puVar11 + 1) != '\x01') {
      *(undefined4 *)(puVar11 + 2) = 0;
      *(undefined4 *)(puVar11 + 4) = uVar6;
      *(undefined2 *)((longlong)puVar11 + 0x24) = uVar7;
      *(undefined4 *)(puVar11 + 6) = uVar6;
      *(undefined2 *)((longlong)puVar11 + 0x34) = uVar7;
      *(undefined1 *)(puVar11 + 7) = 0;
      uVar7 = DAT_1402f83d4;
      uVar6 = DAT_1402f83d0;
      *(undefined4 *)(puVar11 + 8) = 0;
      *(undefined4 *)(puVar11 + 10) = uVar6;
      *(undefined2 *)((longlong)puVar11 + 0x54) = uVar7;
      *(undefined4 *)(puVar11 + 0xc) = uVar6;
      *(undefined2 *)((longlong)puVar11 + 100) = uVar7;
      *(undefined1 *)(puVar11 + 0xd) = 0;
      *(undefined1 *)(puVar11 + 1) = 1;
    }
    local_res8 = (undefined8 *)0x0;
    if (puVar12 != (undefined8 *)0x0) {
      puVar12[1] = puVar12[1] + 1;
      puVar14 = (undefined8 *)*puVar19;
      puVar12 = puVar19;
      local_res8 = puVar19;
    }
    FUN_14015be00(param_1,puVar14[0x20],puVar14[0x21],&local_res8);
  }
  if (puVar13 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  puVar10 = (undefined8 *)FUN_140155830(param_1,puVar13,0);
  if (*(longlong *)(param_2 + 0x17f0) != 0) {
    FUN_1400a3440();
    local_res20 = PTR_DAT_1402f8010;
    FUN_14003c600(&local_res20,&DAT_140253400,*(undefined4 *)(param_3 + 0x6f8),
                  *(undefined4 *)(param_4 + 0x6f8));
    puVar8 = local_res20;
    puVar16 = local_res20;
    if (local_res20 == (undefined *)0x0) {
      puVar16 = PTR_DAT_1402f8010;
    }
    FUN_1401946b0(*(undefined8 *)(param_2 + 0x17f0),1,puVar16);
    if (((puVar8 != (undefined *)0x0) && (puVar8 != PTR_DAT_1402f8010)) &&
       (puVar8 + -8 != (undefined *)0x0)) {
      uVar20 = FUN_1400a3440();
      FUN_1400a1c30(uVar20);
      piVar1 = (int *)(puVar8 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar8 + -8);
      }
      FUN_1400d1290(uVar20);
    }
    local_res20 = PTR_DAT_1402f8010;
    puVar10 = (undefined8 *)PTR_DAT_1402f8010;
  }
LAB_14015dc77:
  if (puVar12 != (undefined8 *)0x0) {
    plVar2 = puVar12 + 1;
    *plVar2 = *plVar2 + -1;
    puVar10 = (undefined8 *)puVar12[1];
    if (*plVar2 == 0) {
      puVar10 = (undefined8 *)FUN_1401462b0(puVar19);
    }
  }
  return puVar10;
}



void FUN_14015dcb0(longlong param_1,longlong param_2,char param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  FUN_140158aa0(param_2);
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    FUN_1400a3530(param_2);
  }
  else {
    (**(code **)(*plVar1 + 0x18))(plVar1,param_2);
  }
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
  if (((param_3 != '\0') && (*(ulonglong *)(param_1 + 0x20) < *(ulonglong *)(param_1 + 0x40))) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar2 = FUN_140142850(param_1);
    FUN_1401b2490(param_1,uVar2);
  }
  return;
}



void FUN_14015dd40(longlong param_1,longlong param_2,undefined1 param_3)

{
  uint uVar1;
  ulonglong uVar2;
  uint uVar3;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  uVar1 = *(uint *)(param_1 + 0x28);
  uVar2 = (ulonglong)*(uint *)(param_2 + 0x20) % (ulonglong)uVar1;
  if (*(longlong *)(param_1 + 0x20) == 1) {
    *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    *(undefined8 *)(param_1 + 0x10) = 0;
    *(undefined8 *)(param_1 + 0x18) = 0;
  }
  else {
    uVar3 = (uint)uVar2;
    if (((*(longlong *)(param_2 + 0x18) == 0) ||
        (*(uint *)(*(longlong *)(param_2 + 0x18) + 0x20) % uVar1 != uVar3)) &&
       ((*(longlong *)(param_2 + 0x10) == 0 ||
        (*(uint *)(*(longlong *)(param_2 + 0x10) + 0x20) % uVar1 != uVar3)))) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    }
    else if (param_2 == *(longlong *)(*(longlong *)(param_1 + 8) + (longlong)(int)uVar3 * 8)) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = *(undefined8 *)(param_2 + 0x10);
    }
    if (param_2 == *(longlong *)(param_1 + 0x10)) {
      *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(param_2 + 0x10);
      *(undefined8 *)(param_2 + 0x18) = 0;
    }
    if (param_2 == *(longlong *)(param_1 + 0x18)) {
      *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
      *(undefined8 *)(param_2 + 0x10) = 0;
    }
    if (*(longlong *)(param_2 + 0x18) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x18) + 0x10) = *(undefined8 *)(param_2 + 0x10);
    }
    if (*(longlong *)(param_2 + 0x10) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x10) + 0x18) = *(undefined8 *)(param_2 + 0x18);
    }
  }
  FUN_14015dcb0(param_1,param_2,param_3);
  FUN_1401b2030(param_1);
  return;
}



undefined4 *
FUN_14015de40(undefined4 *param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  
  *param_1 = *param_2;
  *(undefined8 *)(param_1 + 2) = 0;
  FUN_140141570(param_1 + 2,param_2 + 2,param_3,param_4,0xfffffffffffffffe);
  param_1[4] = param_2[4];
  *(undefined8 *)(param_1 + 6) = 0;
  FUN_14015c040(param_1 + 6,param_2 + 6);
  *(undefined8 *)(param_1 + 8) = 0;
  FUN_14015c170(param_1 + 8,param_2 + 8);
  FUN_140145fe0(param_1 + 10,param_2 + 10);
  *(undefined ***)(param_1 + 10) = Proud::ByteArray::vftable;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x16) = 0;
  if (*(longlong *)(param_2 + 0x14) == 0) {
    *(undefined8 *)(param_1 + 0x14) = 0;
    param_1[0x19] = param_2[0x19];
    *(undefined8 *)(param_1 + 0x16) = *(undefined8 *)(param_2 + 0x16);
    param_1[0x18] = param_2[0x18];
  }
  else {
    plVar1 = (longlong *)(*(longlong *)(param_2 + 0x14) + 0x28);
    *plVar1 = *plVar1 + 1;
    *(undefined8 *)(param_1 + 0x14) = *(undefined8 *)(param_2 + 0x14);
  }
  param_1[0x1a] = param_2[0x1a];
  param_1[0x1b] = param_2[0x1b];
  param_1[0x1c] = param_2[0x1c];
  FUN_140145fe0(param_1 + 0x1e,param_2 + 0x1e);
  *(undefined ***)(param_1 + 0x1e) = Proud::ByteArray::vftable;
  param_1[0x28] = param_2[0x28];
  *(undefined ***)(param_1 + 0x2a) = Proud::AddrPort::vftable;
  param_1[0x2c] = param_2[0x2c];
  *(undefined2 *)(param_1 + 0x2d) = *(undefined2 *)(param_2 + 0x2d);
  param_1[0x2e] = param_2[0x2e];
  FUN_140145fe0(param_1 + 0x30,param_2 + 0x30);
  *(undefined ***)(param_1 + 0x30) = Proud::ByteArray::vftable;
  return param_1;
}



void FUN_14015df90(longlong param_1,longlong param_2,undefined4 param_3,undefined4 param_4,
                  longlong param_5)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  undefined8 uVar5;
  longlong *plVar6;
  longlong lVar7;
  undefined4 *puVar8;
  undefined4 *local_res8;
  longlong lVar9;
  undefined4 local_128 [2];
  longlong local_120 [2];
  undefined8 local_110;
  undefined8 local_108;
  undefined **local_100;
  undefined8 local_f8;
  undefined4 *local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined4 local_b8;
  undefined **local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined **local_80;
  undefined4 local_78;
  undefined2 local_74;
  undefined **local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  if ((*(longlong *)(param_1 + 0x758) != 0) && (*(int *)(param_2 + 0x6f8) != 0)) {
    puVar8 = (undefined4 *)0x0;
    local_120[0] = 0;
    local_110 = 0;
    local_108 = 0;
    local_f8 = 0;
    local_f0 = (undefined4 *)0x0;
    local_e8 = 0;
    local_e0 = 0;
    local_100 = Proud::ByteArray::vftable;
    local_c8 = 0;
    local_d0 = 0;
    local_d8 = 0;
    local_a8 = 0;
    local_a0 = 0;
    local_98 = 0;
    local_90 = 0;
    local_b0 = Proud::ByteArray::vftable;
    local_80 = Proud::AddrPort::vftable;
    local_78 = 0;
    local_74 = 0;
    local_60 = 0;
    local_58 = 0;
    local_50 = 0;
    local_48 = 0;
    local_68 = Proud::ByteArray::vftable;
    local_res8 = (undefined4 *)FUN_1400a34c0(0x60);
    puVar3 = puVar8;
    if (local_res8 != (undefined4 *)0x0) {
      puVar3 = (undefined4 *)FUN_140141470(local_res8);
    }
    if (puVar3 == (undefined4 *)0x0) {
      local_res8 = (undefined4 *)0x0;
      puVar4 = puVar8;
    }
    else {
      puVar4 = (undefined4 *)FUN_1400a34c0(0x48);
      if (puVar4 != (undefined4 *)0x0) {
        local_res8 = puVar4;
        uVar2 = FUN_1401692e0();
        FUN_1400a1b50(puVar4,uVar2,1);
      }
      local_res8 = puVar4;
      FUN_1400a1c30(puVar4);
      *(undefined8 *)(puVar4 + 0x10) = 1;
      *(undefined4 **)(puVar4 + 0xe) = puVar3;
      FUN_1400d1290(puVar4);
    }
    FUN_140141570(local_120,&local_res8);
    if (puVar4 != (undefined4 *)0x0) {
      FUN_1400a1c30(puVar4);
      plVar6 = (longlong *)(puVar4 + 0x10);
      *plVar6 = *plVar6 + -1;
      if (*plVar6 == 0) {
        FUN_1400d1290(puVar4);
        FUN_14008c910(puVar4);
      }
      else {
        FUN_1400d1290(puVar4);
      }
    }
    puVar3 = puVar8;
    if (local_120[0] != 0) {
      puVar3 = *(undefined4 **)(local_120[0] + 0x38);
    }
    *puVar3 = param_3;
    puVar3 = puVar8;
    if (local_120[0] != 0) {
      puVar3 = *(undefined4 **)(local_120[0] + 0x38);
    }
    puVar3[1] = param_4;
    uVar5 = FUN_14019b890(param_2,&local_res8);
    FUN_14015c040(&local_110,uVar5);
    puVar3 = local_res8;
    if (local_res8 != (undefined4 *)0x0) {
      FUN_1400a1c30(local_res8);
      *(longlong *)(local_res8 + 0x10) = *(longlong *)(local_res8 + 0x10) + -1;
      if (*(longlong *)(local_res8 + 0x10) == 0) {
        FUN_1400d1290(puVar3);
        FUN_14015a6d0(local_res8);
      }
      else {
        FUN_1400d1290(puVar3);
      }
    }
    local_128[0] = 6;
    iVar1 = *(int *)(param_5 + 0x18);
    if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_14003cda0(&local_100,iVar1);
    puVar3 = puVar8;
    if (*(int *)(param_5 + 0x18) != 0) {
      puVar3 = *(undefined4 **)(param_5 + 0x10);
    }
    puVar4 = local_f0;
    if ((int)local_e8 == 0) {
      puVar4 = puVar8;
    }
    FUN_1400224d0(puVar4,puVar3,(longlong)iVar1);
    local_b8 = *(undefined4 *)(param_2 + 0x6f8);
    FUN_14019c0f0(param_2,local_128);
    FUN_14015c350(local_128);
  }
  if (*(longlong *)(param_1 + 0x58) != 0) {
    lVar7 = *(longlong *)(param_1 + 0x58) + 0x98;
    lVar9 = lVar7;
    FUN_1400a1c30(lVar7);
    plVar6 = (longlong *)(*(longlong *)(param_1 + 0x58) + 0x68);
    (**(code **)(*plVar6 + 0xb0))(plVar6,1,&DAT_140318cf0,param_2 + 0x6f8,lVar9,1);
    FUN_1400d1290(lVar7);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14015e2b0(longlong param_1,longlong param_2,longlong param_3)

{
  uint uVar1;
  int iVar2;
  ulonglong uVar3;
  char cVar4;
  uint uVar5;
  uint *puVar6;
  longlong *plVar7;
  undefined8 uVar8;
  longlong lVar9;
  longlong *plVar10;
  undefined1 auStack_ea8 [32];
  undefined8 local_e88;
  undefined1 uStack_e80;
  undefined3 uStack_e7f;
  undefined4 uStack_e7c;
  longlong *local_e78;
  undefined4 uStack_e70;
  undefined4 uStack_e6c;
  undefined1 local_e68 [4];
  undefined4 local_e64;
  longlong local_e60;
  longlong local_e58;
  undefined4 local_e50;
  int local_e4c;
  undefined4 local_e18 [2];
  undefined8 local_e10 [2];
  undefined8 local_e00;
  undefined8 local_df8;
  undefined **local_df0;
  undefined8 local_de8;
  undefined8 local_de0;
  undefined8 local_dd8;
  undefined8 local_dd0;
  undefined8 local_dc8;
  longlong local_dc0;
  ulonglong local_db8;
  undefined4 local_da8;
  undefined **local_da0;
  undefined8 local_d98;
  undefined8 local_d90;
  undefined8 local_d88;
  undefined8 local_d80;
  undefined **local_d70;
  undefined4 local_d68;
  undefined2 local_d64;
  undefined **local_d58;
  undefined8 local_d50;
  undefined8 local_d48;
  undefined8 local_d40;
  undefined8 local_d38;
  undefined8 local_d28;
  undefined1 local_d20 [72];
  undefined4 local_cd8;
  undefined4 uStack_cd4;
  undefined4 uStack_cd0;
  undefined4 uStack_ccc;
  undefined4 *local_58;
  undefined4 local_50;
  int local_4c;
  ulonglong local_48;
  
  local_d28 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_ea8;
  if (param_2 == 0) {
    FUN_1400a2320(local_e68,L"Unexpected at candidate remote client removal!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_e68,(ThrowInfo *)&DAT_1402f4860);
  }
  plVar7 = *(longlong **)(param_1 + 0x478);
  lVar9 = *plVar7;
  uVar8 = (**(code **)(*(longlong *)(param_1 + 0x118) + 8))();
  uVar5 = (**(code **)(lVar9 + 8))(plVar7,uVar8);
  local_e88 = (longlong *)CONCAT44(local_e88._4_4_,uVar5);
  *(uint *)(param_2 + 0x6f8) = uVar5;
  FUN_140148ed0(param_1 + 0x16e8,*(longlong *)(param_2 + 0x748) + 0x128,0);
  uVar1 = *(uint *)(param_1 + 0xca0);
  uVar3 = (ulonglong)uVar5 % (ulonglong)uVar1;
  lVar9 = *(longlong *)(param_1 + 0xc80);
  if (lVar9 == 0) {
LAB_14015e3de:
    cVar4 = FUN_140144560(param_1 + 0xc78,(ulonglong)uVar1,CONCAT71((int7)((ulonglong)lVar9 >> 8),1)
                         );
    if (cVar4 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  else {
    for (puVar6 = *(uint **)(lVar9 + uVar3 * 8);
        (puVar6 != (uint *)0x0 && ((uint)uVar3 == puVar6[8] % uVar1));
        puVar6 = *(uint **)(puVar6 + 4)) {
      if (*puVar6 == uVar5) goto LAB_14015e435;
    }
    if (lVar9 == 0) goto LAB_14015e3de;
    for (puVar6 = *(uint **)(lVar9 + uVar3 * 8);
        (puVar6 != (uint *)0x0 && ((uint)uVar3 == puVar6[8] % uVar1));
        puVar6 = *(uint **)(puVar6 + 4)) {
      if (*puVar6 == uVar5) goto LAB_14015e431;
    }
    if (lVar9 == 0) goto LAB_14015e3de;
  }
  FUN_1401b2030(param_1 + 0xc78);
  puVar6 = (uint *)FUN_14019d2c0(param_1 + 0xc78,&local_e88,uVar3,uVar5);
  FUN_1401b2030(param_1 + 0xc78);
LAB_14015e431:
  *(longlong *)(puVar6 + 2) = param_2;
LAB_14015e435:
  FUN_140185560(local_e68);
  FUN_140185030(local_e68);
  FUN_1401856c0(local_e68,0x800);
  FUN_1401856c0(local_e68,0);
  FUN_14003c9e0(local_e68,10);
  FUN_14007c6e0(local_e68,(ulonglong)uVar5);
  local_e78 = *(longlong **)(param_1 + 0x26c);
  uStack_e70 = *(undefined4 *)(param_1 + 0x274);
  uStack_e6c = *(undefined4 *)(param_1 + 0x278);
  FUN_14003cba0(local_e68,&local_e78);
  iVar2 = *(int *)(param_3 + 0x18);
  FUN_140186930(local_e68,(longlong)iVar2);
  lVar9 = 0;
  if (*(int *)(param_3 + 0x18) != 0) {
    lVar9 = *(longlong *)(param_3 + 0x10);
  }
  if (iVar2 == 0) goto LAB_14015e50d;
  local_e64 = 0;
  if (local_e60 == 0) {
    if (local_e58 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830(0,lVar9);
    }
LAB_14015e4df:
    FUN_14003cc90(&local_e58,lVar9,iVar2);
  }
  else {
    if (local_e58 != 0) goto LAB_14015e4df;
    if (local_e60 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830(0,lVar9);
    }
    FUN_14003ce60(local_e60,lVar9,iVar2);
  }
  FUN_14003ced0(local_e68);
LAB_14015e50d:
  FUN_140186160(local_e68,*(longlong *)(param_2 + 0x748) + 0x128);
  plVar7 = (longlong *)(**(code **)(*(longlong *)(param_2 + 0x108) + 0x10))();
  local_e78 = plVar7;
  FUN_1400a1c30(plVar7);
  uStack_e70._0_1_ = 1;
  local_4c = 200;
  local_50 = 0;
  local_58 = &local_cd8;
  if (local_e60 == 0) {
    if (local_e58 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else {
    local_e50 = *(undefined4 *)(local_e60 + 0x18);
  }
  lVar9 = local_e58;
  if (local_e58 == 0) {
    if (local_e60 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    lVar9 = 0;
    if (*(int *)(local_e60 + 0x18) != 0) {
      lVar9 = *(longlong *)(local_e60 + 0x10);
    }
  }
  local_50 = 1;
  local_e88._0_4_ = (undefined4)lVar9;
  local_e88._4_4_ = (undefined4)((ulonglong)lVar9 >> 0x20);
  local_cd8 = (undefined4)local_e88;
  uStack_cd4 = local_e88._4_4_;
  uStack_ccc = uStack_e7c;
  local_e88 = (longlong *)0x0;
  _uStack_e80 = CONCAT31((int3)((uint)local_e50 >> 8),1);
  uStack_cd0 = local_e50;
  FUN_1401a12a0(*(undefined8 *)(param_2 + 0x748),&local_cd8,&local_e88);
  if (local_58 == (undefined4 *)0x0) {
    FUN_1400a2320(local_d20,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_d20,(ThrowInfo *)&DAT_1402f4860);
  }
  if (local_4c < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_1400d1290(plVar7);
  local_e88 = &local_e60;
  FUN_14019a730(&local_e60);
  if ((local_e58 != 0) && (local_e4c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  local_e10[0] = 0;
  local_e00 = 0;
  local_df8 = 0;
  local_de8 = 0;
  local_de0 = 0;
  local_dd8 = 0;
  local_dd0 = 0;
  local_df0 = Proud::ByteArray::vftable;
  local_db8 = 0;
  local_dc0 = 0;
  local_dc8 = 0;
  local_d98 = 0;
  local_d90 = 0;
  local_d88 = 0;
  local_d80 = 0;
  local_da0 = Proud::ByteArray::vftable;
  local_d70 = Proud::AddrPort::vftable;
  local_d68 = 0;
  local_d64 = 0;
  local_d50 = 0;
  local_d48 = 0;
  local_d40 = 0;
  local_d38 = 0;
  local_d58 = Proud::ByteArray::vftable;
  local_e18[0] = 5;
  uVar8 = FUN_14019b890(param_2,&local_e88);
  FUN_14015c040(&local_e00,uVar8);
  plVar7 = local_e88;
  if (local_e88 != (longlong *)0x0) {
    local_e78 = local_e88;
    FUN_1400a1c30(local_e88);
    uStack_e70._0_1_ = 1;
    local_e88[8] = local_e88[8] + -1;
    if (local_e88[8] == 0) {
      FUN_1400d1290(plVar7);
      uStack_e70._0_1_ = 0;
      FUN_14015a6d0(local_e88);
    }
    else {
      FUN_1400d1290(plVar7);
    }
  }
  local_da8 = *(undefined4 *)(param_2 + 0x6f8);
  FUN_14019c0f0(param_2,local_e18);
  FUN_140140df0(&local_d58);
  FUN_140140df0(&local_da0);
  local_e88 = &local_dc8;
  FUN_14019a730(&local_dc8);
  if (local_dc0 != 0) {
    if ((longlong)local_db8 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_db8 = local_db8 & 0xffffffff00000000;
  }
  FUN_140140df0(&local_df0);
  FUN_14015bf40(&local_df8);
  FUN_14015bec0(&local_e00);
  FUN_14008c980(local_e10);
  if (*(longlong *)(param_1 + 0x58) != 0) {
    plVar10 = (longlong *)(*(longlong *)(param_1 + 0x58) + 0x98);
    local_e78 = plVar10;
    FUN_1400a1c30(plVar10);
    uStack_e70 = CONCAT31(uStack_e70._1_3_,1);
    plVar7 = (longlong *)(*(longlong *)(param_1 + 0x58) + 0x68);
    (**(code **)(*plVar7 + 0xa0))(plVar7,1,&DAT_140318cf0,param_2 + 0x6f8);
    FUN_1400d1290(plVar10);
  }
  return;
}



void FUN_14015e850(longlong *param_1,undefined4 *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined4 *puVar3;
  undefined *puVar4;
  char cVar5;
  undefined **ppuVar6;
  undefined8 uVar7;
  longlong lVar8;
  undefined4 *puVar9;
  undefined8 uVar10;
  undefined *local_res18;
  undefined1 local_res20 [8];
  undefined **local_188;
  uint local_180;
  undefined2 local_17c;
  undefined **local_178;
  undefined8 local_170;
  undefined8 local_168;
  undefined8 local_160;
  undefined8 local_158;
  undefined **local_128;
  undefined8 local_120;
  undefined8 local_118;
  undefined8 local_110;
  undefined8 local_108;
  undefined **local_100;
  undefined4 local_f8;
  undefined2 local_f4;
  undefined **local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined **local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined8 local_a8;
  undefined **local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined1 local_70;
  undefined1 local_60 [16];
  undefined1 local_50 [8];
  undefined8 local_48;
  undefined1 local_38 [16];
  
  local_48 = 0xfffffffffffffffe;
  if (param_1[0xeb] != 0) {
    switch(*param_2) {
    case 4:
      local_120 = 0;
      local_118 = 0;
      local_110 = 0;
      local_108 = 0;
      local_128 = Proud::ByteArray::vftable;
      local_100 = Proud::AddrPort::vftable;
      local_f8 = param_2[0x2c];
      local_f4 = *(undefined2 *)(param_2 + 0x2d);
      cVar5 = (**(code **)(*(longlong *)param_1[0xeb] + 0x48))
                        ((longlong *)param_1[0xeb],&local_100,param_2 + 0x30,&local_128);
      uVar7 = (**(code **)(*param_1 + 0x58))(param_1);
      local_70 = 0;
      local_78 = uVar7;
      FUN_1400a1c30(uVar7);
      local_70 = 1;
      if (DAT_140313fcf != '\0') {
        (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::ProcessOneLocalEvent");
      }
      local_188 = Proud::AddrPort::vftable;
      local_180 = param_2[0x2c];
      local_17c = *(undefined2 *)(param_2 + 0x2d);
      lVar8 = FUN_140145140(param_1,&local_188);
      if (lVar8 != 0) {
        if (cVar5 == '\0') {
          FUN_140154400(param_1,lVar8,&local_128);
        }
        else {
          FUN_14015e2b0();
        }
      }
      FUN_1400d1290(uVar7);
      FUN_140140df0(&local_128);
      break;
    case 5:
      uVar7 = 0;
      if (*(longlong *)(param_2 + 6) != 0) {
        uVar7 = *(undefined8 *)(*(longlong *)(param_2 + 6) + 0x38);
      }
      (**(code **)(*(longlong *)param_1[0xeb] + 0x38))((longlong *)param_1[0xeb],uVar7);
      break;
    case 6:
      uVar7 = 0;
      uVar10 = uVar7;
      if (*(longlong *)(param_2 + 2) != 0) {
        uVar10 = *(undefined8 *)(*(longlong *)(param_2 + 2) + 0x38);
      }
      if (*(longlong *)(param_2 + 6) != 0) {
        uVar7 = *(undefined8 *)(*(longlong *)(param_2 + 6) + 0x38);
      }
      (**(code **)(*(longlong *)param_1[0xeb] + 0x40))
                ((longlong *)param_1[0xeb],uVar7,uVar10,param_2 + 10);
      break;
    case 7:
      puVar9 = (undefined4 *)0x0;
      if (*(longlong *)(param_2 + 2) != 0) {
        puVar9 = *(undefined4 **)(*(longlong *)(param_2 + 2) + 0x38);
      }
      (**(code **)(*(longlong *)param_1[0xeb] + 0x50))
                ((longlong *)param_1[0xeb],param_2[0x1a],param_2[0x1b],*puVar9);
      break;
    case 0xf:
      (**(code **)(*(longlong *)param_1[0xeb] + 0x68))
                ((longlong *)param_1[0xeb],param_2[0x1c],param_2[4]);
      break;
    case 0x10:
      local_e8 = 0;
      local_e0 = 0;
      local_d8 = 0;
      local_d0 = 0;
      local_f0 = Proud::ByteArray::vftable;
      FUN_1400a3440();
      local_res18 = PTR_DAT_1402f8010;
      uVar7 = FUN_1401416a0(local_res20,0x10,1,&local_res18,&local_f0);
      (**(code **)(*param_1 + 0x38))(param_1,uVar7);
      puVar4 = local_res18;
      if (((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1402f8010)) &&
         (puVar1 = local_res18 + -8, puVar1 != (undefined *)0x0)) {
        ppuVar6 = (undefined **)FUN_1400a3440();
        local_180 = local_180 & 0xffffff00;
        local_188 = ppuVar6;
        FUN_1400a1c30(ppuVar6);
        local_180 = CONCAT31(local_180._1_3_,1);
        piVar2 = (int *)(puVar4 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(puVar1);
        }
        FUN_1400d1290(ppuVar6);
      }
      local_res18 = PTR_DAT_1402f8010;
      FUN_140140df0(&local_f0);
      break;
    case 0x11:
      (**(code **)(*(longlong *)param_1[0xeb] + 0x70))((longlong *)param_1[0xeb],param_2[0x1c]);
      break;
    case 0x13:
      lVar8 = 0;
      local_98 = 0;
      local_90 = 0;
      local_88 = 0;
      local_80 = 0;
      local_a0 = Proud::ByteArray::vftable;
      if (*(longlong *)(param_2 + 2) != 0) {
        lVar8 = *(longlong *)(*(longlong *)(param_2 + 2) + 0x38);
      }
      uVar7 = FUN_1401416a0(local_60,0x19,1,lVar8 + 0x10,&local_a0);
      (**(code **)(*param_1 + 0x38))(param_1,uVar7);
      FUN_140140df0(&local_a0);
      break;
    case 0x14:
      puVar9 = (undefined4 *)0x0;
      local_c0 = 0;
      local_b8 = 0;
      local_b0 = 0;
      local_a8 = 0;
      local_c8 = Proud::ByteArray::vftable;
      lVar8 = *(longlong *)(param_2 + 2);
      puVar3 = puVar9;
      if (lVar8 != 0) {
        puVar9 = *(undefined4 **)(lVar8 + 0x38);
        puVar3 = *(undefined4 **)(lVar8 + 0x38);
      }
      uVar7 = FUN_1401416a0(local_50,*puVar9,param_2[0x1c],puVar3 + 4,&local_c8);
      (**(code **)(*param_1 + 0x38))(param_1,uVar7);
      FUN_140140df0(&local_c8);
      break;
    case 0x15:
      puVar9 = (undefined4 *)0x0;
      local_170 = 0;
      local_168 = 0;
      local_160 = 0;
      local_158 = 0;
      local_178 = Proud::ByteArray::vftable;
      lVar8 = *(longlong *)(param_2 + 2);
      puVar3 = puVar9;
      if (lVar8 != 0) {
        puVar9 = *(undefined4 **)(lVar8 + 0x38);
        puVar3 = *(undefined4 **)(lVar8 + 0x38);
      }
      uVar7 = FUN_1401416a0(local_38,*puVar9,param_2[0x1c],puVar3 + 4,&local_178);
      FUN_1401574c0(param_1,uVar7);
      FUN_140140df0(&local_178);
    }
  }
  return;
}



undefined4 * FUN_14015ed70(longlong param_1,undefined4 *param_2,uint param_3,undefined4 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined4 uVar3;
  undefined4 *puVar4;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    puVar4 = (undefined4 *)FUN_1400a34c0(0x28);
  }
  else {
    puVar4 = (undefined4 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x28,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar4 != (undefined4 *)0x0) {
    *puVar4 = *param_2;
    *(undefined8 *)(puVar4 + 2) = 0;
    puVar4[8] = param_4;
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8);
  FUN_1401b2030(param_1);
  if (*(longlong *)(param_1 + 0x20) == 0) {
    *(undefined4 **)(param_1 + 0x10) = puVar4;
    *(undefined4 **)(param_1 + 0x18) = puVar4;
    *(undefined8 *)(puVar4 + 6) = 0;
    *(undefined8 *)(puVar4 + 4) = 0;
  }
  else {
    FUN_1401b2030(param_1);
    FUN_1401b2030(param_1);
    if (lVar2 == 0) {
      lVar2 = *(longlong *)(param_1 + 0x10);
      *(undefined8 *)(puVar4 + 6) = 0;
      *(longlong *)(puVar4 + 4) = lVar2;
      if (lVar2 != 0) {
        *(undefined4 **)(lVar2 + 0x18) = puVar4;
      }
      *(undefined4 **)(param_1 + 0x10) = puVar4;
    }
    else {
      if (*(longlong *)(lVar2 + 0x18) == 0) {
        *(undefined4 **)(param_1 + 0x10) = puVar4;
      }
      else {
        *(undefined4 **)(*(longlong *)(lVar2 + 0x18) + 0x10) = puVar4;
      }
      *(undefined8 *)(puVar4 + 6) = *(undefined8 *)(lVar2 + 0x18);
      *(longlong *)(puVar4 + 4) = lVar2;
      *(undefined4 **)(lVar2 + 0x18) = puVar4;
    }
  }
  *(undefined4 **)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8) = puVar4;
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  FUN_1401b2030(param_1);
  FUN_1401b2030(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_140142850(param_1);
    FUN_1401b2490(param_1,uVar3);
  }
  FUN_1401b2030(param_1);
  return puVar4;
}



void FUN_14015eec0(longlong param_1)

{
  longlong *plVar1;
  longlong lVar2;
  uint uVar3;
  ulonglong uVar4;
  longlong lVar5;
  longlong lVar6;
  float fVar7;
  float fVar8;
  
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
  FUN_1401b2030();
  lVar5 = *(longlong *)(param_1 + 0x10);
  while (lVar5 != 0) {
    lVar6 = *(longlong *)(lVar5 + 0x10);
    if ((*(longlong *)(lVar5 + 8) != 0) &&
       (*(longlong *)(*(longlong *)(lVar5 + 8) + 8) =
             *(longlong *)(*(longlong *)(lVar5 + 8) + 8) + -1,
       *(longlong *)(*(longlong *)(lVar5 + 8) + 8) == 0)) {
      plVar1 = *(longlong **)(lVar5 + 8);
      lVar2 = *plVar1;
      if (lVar2 != 0) {
        FUN_140149600(lVar2);
        FUN_1400a3530(lVar2);
      }
      FUN_1400a3530(plVar1);
    }
    plVar1 = *(longlong **)(param_1 + 0x50);
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530(lVar5);
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar5);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar5 = lVar6;
  }
  FUN_1400a3530(*(undefined8 *)(param_1 + 8));
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  FUN_1401b2030(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar3 = FUN_140142850(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_1400a3530();
      *(undefined8 *)(param_1 + 8) = 0;
    }
    lVar5 = 0;
    *(uint *)(param_1 + 0x28) = uVar3;
    fVar8 = (float)uVar3 * *(float *)(param_1 + 0x34);
    if ((9.223372e+18 < fVar8) && (fVar8 = fVar8 - 9.223372e+18, fVar8 < 9.223372e+18)) {
      lVar5 = -0x8000000000000000;
    }
    fVar7 = (float)uVar3 * *(float *)(param_1 + 0x30);
    lVar6 = 0;
    *(longlong *)(param_1 + 0x38) = (longlong)fVar8 + lVar5;
    if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
      lVar6 = -0x8000000000000000;
    }
    uVar4 = (longlong)fVar7 + lVar6;
    if ((ulonglong)((longlong)fVar7 + lVar6) < 0x11) {
      uVar4 = 0;
    }
    *(ulonglong *)(param_1 + 0x40) = uVar4;
  }
  FUN_1401b2030(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



void FUN_14015f050(longlong *param_1,longlong param_2)

{
  longlong *plVar1;
  
  FUN_14015c350(param_2 + 0x40);
  FUN_14019a730(param_2 + 0x20);
  if (*(longlong *)(param_2 + 0x28) != 0) {
    if (*(int *)(param_2 + 0x34) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(param_2 + 0x30) = 0;
  }
  plVar1 = (longlong *)*param_1;
  if (plVar1 == (longlong *)0x0) {
    FUN_1400a3530(param_2);
  }
  else {
    (**(code **)(*plVar1 + 0x10))(plVar1,param_2);
  }
  param_1[3] = param_1[3] + -1;
  return;
}



undefined4 * FUN_14015f0c0(longlong param_1,undefined4 *param_2,uint param_3,undefined4 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined4 uVar3;
  undefined4 *puVar4;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    puVar4 = (undefined4 *)FUN_1400a34c0(0x28);
  }
  else {
    puVar4 = (undefined4 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x28,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar4 != (undefined4 *)0x0) {
    *puVar4 = *param_2;
    *(undefined8 *)(puVar4 + 2) = 0;
    puVar4[8] = param_4;
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8);
  FUN_1401b2030(param_1);
  if (*(longlong *)(param_1 + 0x20) == 0) {
    *(undefined4 **)(param_1 + 0x10) = puVar4;
    *(undefined4 **)(param_1 + 0x18) = puVar4;
    *(undefined8 *)(puVar4 + 6) = 0;
    *(undefined8 *)(puVar4 + 4) = 0;
  }
  else {
    FUN_1401b2030(param_1);
    FUN_1401b2030(param_1);
    if (lVar2 == 0) {
      lVar2 = *(longlong *)(param_1 + 0x10);
      *(undefined8 *)(puVar4 + 6) = 0;
      *(longlong *)(puVar4 + 4) = lVar2;
      if (lVar2 != 0) {
        *(undefined4 **)(lVar2 + 0x18) = puVar4;
      }
      *(undefined4 **)(param_1 + 0x10) = puVar4;
    }
    else {
      if (*(longlong *)(lVar2 + 0x18) == 0) {
        *(undefined4 **)(param_1 + 0x10) = puVar4;
      }
      else {
        *(undefined4 **)(*(longlong *)(lVar2 + 0x18) + 0x10) = puVar4;
      }
      *(undefined8 *)(puVar4 + 6) = *(undefined8 *)(lVar2 + 0x18);
      *(longlong *)(puVar4 + 4) = lVar2;
      *(undefined4 **)(lVar2 + 0x18) = puVar4;
    }
  }
  *(undefined4 **)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8) = puVar4;
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  FUN_1401b2030(param_1);
  FUN_1401b2030(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_140142850(param_1);
    FUN_1401b2490(param_1,uVar3);
  }
  FUN_1401b2030(param_1);
  return puVar4;
}



void FUN_14015f210(void)

{
  FUN_14015eec0();
  return;
}



undefined4 *
FUN_14015f230(longlong param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  
  plVar1 = *(longlong **)(param_1 + 8);
  if (plVar1 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  *param_2 = (int)plVar1[2];
  FUN_140185590(param_2 + 2,plVar1 + 3,param_3,param_4,0xfffffffffffffffe);
  FUN_14015de40(param_2 + 0xc,plVar1 + 8);
  lVar2 = *plVar1;
  *(longlong *)(param_1 + 8) = lVar2;
  if (lVar2 == 0) {
    *(undefined8 *)(param_1 + 0x10) = 0;
  }
  else {
    *(undefined8 *)(lVar2 + 8) = 0;
  }
  FUN_14015f050(param_1,plVar1);
  return param_2;
}



void FUN_14015f2e0(longlong param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  uint uVar7;
  ulonglong uVar8;
  longlong lVar9;
  float fVar10;
  
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
  FUN_1401b2030(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  lVar9 = *(longlong *)(param_1 + 0x10);
  while (lVar9 != 0) {
    lVar2 = *(longlong *)(lVar9 + 0x10);
    lVar3 = *(longlong *)(lVar9 + 8);
    if (lVar3 != 0) {
      FUN_1400a1c30(lVar3);
      bVar6 = true;
      plVar1 = (longlong *)(*(longlong *)(lVar9 + 8) + 0x40);
      *plVar1 = *plVar1 + -1;
      if (*(longlong *)(*(longlong *)(lVar9 + 8) + 0x40) == 0) {
        FUN_1400d1290(lVar3);
        bVar6 = false;
        lVar4 = *(longlong *)(lVar9 + 8);
        lVar5 = *(longlong *)(lVar4 + 0x38);
        if (lVar5 != 0) {
          FUN_140148d50(lVar5 + 8);
          FUN_1400a3530(lVar5);
        }
        FUN_1400a1cd0(lVar4);
        FUN_1400a3530(lVar4);
      }
      if (bVar6) {
        FUN_1400d1290(lVar3);
      }
    }
    plVar1 = *(longlong **)(param_1 + 0x50);
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530(lVar9);
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar9);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar9 = lVar2;
  }
  FUN_1400a3530(*(undefined8 *)(param_1 + 8));
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  FUN_1401b2030(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar7 = FUN_140142850(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_1400a3530();
      *(undefined8 *)(param_1 + 8) = 0;
    }
    *(uint *)(param_1 + 0x28) = uVar7;
    fVar10 = (float)uVar7 * *(float *)(param_1 + 0x34);
    lVar9 = 0;
    if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
      lVar9 = -0x8000000000000000;
    }
    *(longlong *)(param_1 + 0x38) = (longlong)fVar10 + lVar9;
    fVar10 = (float)uVar7 * *(float *)(param_1 + 0x30);
    lVar9 = 0;
    if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
      lVar9 = -0x8000000000000000;
    }
    uVar8 = (longlong)fVar10 + lVar9;
    if ((ulonglong)((longlong)fVar10 + lVar9) < 0x11) {
      uVar8 = 0;
    }
    *(ulonglong *)(param_1 + 0x40) = uVar8;
  }
  FUN_1401b2030(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



void FUN_14015f4c0(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  
  lVar1 = param_1[3];
  while( true ) {
    if (lVar1 == 0) {
      param_1[1] = 0;
      param_1[2] = 0;
      return;
    }
    plVar2 = (longlong *)param_1[1];
    if (plVar2 == (longlong *)0x0) break;
    param_1[1] = *plVar2;
    FUN_14015c350(plVar2 + 8);
    FUN_14019a730(plVar2 + 4);
    if (plVar2[5] != 0) {
      if (*(int *)((longlong)plVar2 + 0x34) < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      *(undefined4 *)(plVar2 + 6) = 0;
    }
    plVar3 = (longlong *)*param_1;
    if (plVar3 == (longlong *)0x0) {
      FUN_1400a3530(plVar2);
    }
    else {
      (**(code **)(*plVar3 + 0x10))(plVar3,plVar2);
    }
    param_1[3] = param_1[3] + -1;
    lVar1 = param_1[3];
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



undefined8 *
FUN_14015f570(longlong *param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  
  plVar1 = (longlong *)*param_1;
  if (plVar1 == (longlong *)0x0) {
    puVar2 = (undefined8 *)FUN_1400a34c0(0x128);
  }
  else {
    puVar2 = (undefined8 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x128,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar2 != (undefined8 *)0x0) {
    *(undefined4 *)(puVar2 + 2) = *param_2;
    FUN_140185590(puVar2 + 3,param_2 + 2);
    FUN_14015de40(puVar2 + 8,param_2 + 0xc);
  }
  puVar2[1] = param_3;
  *puVar2 = param_4;
  param_1[3] = param_1[3] + 1;
  return puVar2;
}



undefined8 FUN_14015f620(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_140144560(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  FUN_1401b2030(param_1);
  uVar2 = FUN_14015f0c0(param_1,param_2,param_3,param_4);
  FUN_1401b2030(param_1);
  return uVar2;
}



void FUN_14015f6a0(undefined8 *param_1)

{
  *param_1 = Proud::CP2PGroupMemberBase_S::vftable;
  FUN_14015f210();
  return;
}



undefined8 * FUN_14015f6c0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CP2PGroupMemberBase_S::vftable;
  FUN_14015f210();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x00014015f766)
// WARNING: Removing unreachable block (ram,0x00014015f76f)
// WARNING: Removing unreachable block (ram,0x00014015f78d)
// WARNING: Removing unreachable block (ram,0x00014015f796)

undefined8 * FUN_14015f700(undefined8 *param_1)

{
  *param_1 = Proud::CP2PGroupMemberBase_S::vftable;
  *(undefined1 *)(param_1 + 1) = 0;
  param_1[0xb] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  *(undefined4 *)(param_1 + 6) = 0x11;
  param_1[5] = 0;
  *(undefined4 *)(param_1 + 10) = 0;
  *(undefined4 *)((longlong)param_1 + 0x34) = 0x3f400000;
  *(undefined4 *)(param_1 + 7) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x3c) = 0x40100000;
  param_1[8] = 0x26;
  param_1[9] = 0;
  return param_1;
}



undefined8 FUN_14015f7c0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined1 local_120 [16];
  undefined1 local_110 [8];
  longlong local_108;
  int local_fc;
  undefined1 local_f0 [232];
  
  if (*(longlong *)(param_1 + 0x3f8) == 0) {
    uVar1 = 0;
  }
  else {
    uVar1 = FUN_14015f230(param_1 + 0x3e0,local_120,param_3,param_4,0xfffffffffffffffe);
    FUN_1401a6f30(param_2,uVar1,1);
    FUN_14015c350(local_f0);
    FUN_14019a730(local_110);
    if ((local_108 != 0) && (local_fc < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    uVar1 = 1;
  }
  return uVar1;
}



void FUN_14015f850(longlong *param_1)

{
  undefined8 *puVar1;
  
  FUN_14015f4c0();
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_14015f880(longlong *param_1,undefined8 param_2,ulonglong *param_3,undefined8 param_4,
             undefined4 param_5)

{
  longlong lVar1;
  ulonglong uVar2;
  double dVar3;
  longlong *plVar4;
  code *pcVar5;
  undefined1 *puVar6;
  void *pvVar7;
  undefined4 uVar8;
  int iVar9;
  ulonglong uVar10;
  longlong *plVar11;
  undefined8 uVar12;
  longlong lVar13;
  ulonglong *puVar14;
  int *piVar15;
  int *piVar16;
  undefined8 uVar17;
  longlong lVar18;
  uint uVar19;
  undefined1 *puVar20;
  undefined1 *puVar21;
  undefined8 *puVar22;
  int iVar23;
  int iVar24;
  int iVar25;
  int iVar26;
  undefined4 uVar27;
  undefined1 auStack_2aa8 [32];
  int local_2a88 [2];
  undefined8 *local_2a80;
  undefined1 local_2a78 [8];
  ulonglong local_2a70;
  longlong *local_2a68;
  int local_2a60;
  int local_2a5c;
  undefined8 local_2a50;
  undefined8 local_2a48;
  int iStack_2a40;
  undefined4 uStack_2a3c;
  longlong *local_2a38;
  ulonglong *local_2a30;
  longlong local_2a28;
  undefined1 local_2a20;
  int local_2a1c;
  undefined1 local_2a18;
  undefined1 local_2a17;
  int local_2a10;
  undefined8 local_2a08;
  undefined1 local_2a00;
  undefined8 local_29f8;
  undefined1 local_29f0;
  undefined8 local_29e8;
  undefined1 local_29e0;
  undefined8 local_29d8;
  undefined1 local_29d0 [72];
  void *local_2988;
  longlong local_2980;
  ulonglong local_2978;
  longlong local_2970;
  int local_2968 [4];
  undefined1 local_2958 [384];
  void *local_27d8;
  undefined8 local_27d0;
  ulonglong local_27c8;
  undefined8 local_27c0;
  undefined1 *local_2628;
  longlong local_2620;
  ulonglong local_2618;
  undefined8 local_2610;
  undefined1 local_2608 [3200];
  undefined1 local_1988 [3200];
  undefined1 *local_d08;
  undefined4 local_d00;
  int local_cfc;
  undefined4 local_cf8;
  undefined4 uStack_cf4;
  int iStack_cf0;
  undefined4 uStack_cec;
  undefined4 *local_78;
  undefined4 local_70;
  int local_6c;
  ulonglong local_68;
  undefined8 uStack_48;
  
  uStack_48 = 0x14015f897;
  puVar21 = auStack_2aa8;
  local_29d8 = 0xfffffffffffffffe;
  local_68 = DAT_1402f85a0 ^ (ulonglong)local_2a88;
  local_2a50 = param_2;
  local_2a48 = param_3;
  local_2a08 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(local_2a08);
  local_2a00 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::Send_BroadcastLayer");
  }
  iVar9 = 0;
  iVar24 = 0;
  if (0 < *(int *)((longlong)param_3 + 4)) {
    iVar24 = *(int *)((longlong)param_3 + 4);
  }
  dVar3 = (double)param_3[1];
  uVar8 = SUB84(dVar3,0);
  uVar27 = (int)((ulonglong)dVar3 >> 0x20);
  if (dVar3 <= 0.0) {
    uVar8 = 0;
    uVar27 = 0;
  }
  local_27d8 = (void *)0x0;
  local_27c0 = 0;
  local_27d0 = 0;
  local_27c8 = 100;
  (**(code **)(*param_1 + 0x50))(param_1,param_5,param_4,&local_27d8);
  local_2628 = (undefined1 *)0x0;
  local_2610 = 0;
  local_2620 = 0;
  local_2618 = 100;
  FUN_140148060(param_1,&local_2628,&local_27d8);
  iVar25 = (int)local_2620;
  lVar13 = (longlong)iVar25 * 8;
  uVar2 = lVar13 + 0x10;
  if (uVar2 < 0x401) {
    uVar10 = lVar13 + 0x1f;
    if (uVar10 <= uVar2) {
      uVar10 = 0xffffffffffffff0;
    }
    lVar13 = -(uVar10 & 0xfffffffffffffff0);
    puVar21 = auStack_2aa8 + lVar13;
    local_2a80 = (undefined8 *)((longlong)local_2a88 + lVar13);
    if (local_2a80 != (undefined8 *)0x0) {
      *(undefined4 *)local_2a80 = 0xcccc;
      puVar21 = auStack_2aa8 + lVar13;
LAB_14015fa08:
      local_2a80 = local_2a80 + 2;
    }
  }
  else {
    local_2a80 = malloc(uVar2);
    if (local_2a80 != (undefined8 *)0x0) {
      *(undefined4 *)local_2a80 = 0xdddd;
      puVar21 = auStack_2aa8;
      goto LAB_14015fa08;
    }
  }
  lVar13 = (longlong)iVar25 * 8;
  uVar2 = lVar13 + 0x10;
  if (uVar2 < 0x401) {
    uVar10 = lVar13 + 0x1f;
    if (uVar10 <= uVar2) {
      uVar10 = 0xffffffffffffff0;
    }
    *(undefined8 *)(puVar21 + -8) = 0x14015fa36;
    lVar13 = -(uVar10 & 0xfffffffffffffff0);
    puVar20 = puVar21 + lVar13;
    plVar11 = (longlong *)(puVar21 + lVar13 + 0x20);
    puVar21 = puVar21 + lVar13;
    local_2a38 = plVar11;
    if (plVar11 == (longlong *)0x0) goto LAB_14015fa6f;
    *(undefined4 *)plVar11 = 0xcccc;
    puVar21 = puVar20;
  }
  else {
    *(undefined8 *)(puVar21 + -8) = 0x14015fa55;
    plVar11 = malloc(uVar2);
    local_2a38 = plVar11;
    if (plVar11 == (longlong *)0x0) goto LAB_14015fa6f;
    *(undefined4 *)plVar11 = 0xdddd;
  }
  local_2a38 = plVar11 + 2;
LAB_14015fa6f:
  plVar11 = local_2a38;
  local_2a10 = 0;
  iVar23 = 0;
  local_2a88[0] = 0;
  if ((int)*param_3 == 1) {
    puVar22 = local_2a80;
    if (iVar25 < 1) {
      iVar24 = 0;
      iVar9 = 0;
    }
    else {
      do {
        if ((iVar23 < 0) || (local_2620 <= iVar23)) {
                    // WARNING: Subroutine does not return
          *(undefined **)(puVar21 + -8) = &UNK_14015fc19;
          FUN_1400a26d0();
        }
        puVar6 = local_2628;
        if (local_2618 < 0x65) {
          puVar6 = local_2608;
        }
        plVar11 = *(longlong **)(puVar6 + (longlong)iVar23 * 0x20 + 8);
        if ((plVar11 == param_1 + 0xe) && (*(char *)((longlong)param_3 + 0x2d) != '\0')) {
          *(undefined8 *)(puVar21 + -8) = 0x14015faee;
          FUN_140185560(local_2a78);
          uVar12 = local_2a50;
          *(undefined8 *)(puVar21 + -8) = 0x14015fafc;
          FUN_1401a7270(uVar12,local_2a78);
          *(undefined8 *)(puVar21 + -8) = 0x14015fb05;
          uVar8 = FUN_1401a6d30(local_2a78);
          *(undefined8 *)(puVar21 + -8) = 0x14015fb1b;
          uVar12 = FUN_14015c3e0(&local_2988,local_2a78,uVar8,1);
          lVar13 = param_1[0x8d];
          *(undefined8 *)(puVar21 + -8) = 0x14015fb37;
          lVar13 = FUN_14015f570(param_1 + 0x8b,uVar12,lVar13,0);
          if ((longlong *)param_1[0x8d] == (longlong *)0x0) {
            param_1[0x8c] = lVar13;
          }
          else {
            *(longlong *)param_1[0x8d] = lVar13;
          }
          param_1[0x8d] = lVar13;
          *(undefined8 *)(puVar21 + -8) = 0x14015fb65;
          FUN_14015c350(local_2958);
          local_2a48 = &local_2978;
          *(undefined8 *)(puVar21 + -8) = 0x14015fb7d;
          FUN_14019a730(&local_2978);
          if ((local_2970 != 0) && (local_2968[1] < 0)) {
                    // WARNING: Subroutine does not return
            *(undefined8 *)(puVar21 + -8) = 0x14015fc05;
            FUN_1400a26d0();
          }
          lVar13 = param_1[0x7c];
          *(undefined8 *)(puVar21 + -8) = 0x14015fbaa;
          FUN_1401a76f0(lVar13 + 0x160,param_1 + 0xf);
          local_2a48 = &local_2a70;
          *(undefined8 *)(puVar21 + -8) = 0x14015fbbc;
          FUN_14019a730(&local_2a70);
          if (((ulonglong *)local_2a68 != (ulonglong *)0x0) && (local_2a5c < 0)) {
                    // WARNING: Subroutine does not return
            *(undefined **)(puVar21 + -8) = &UNK_14015fc0b;
            FUN_1400a26d0();
          }
        }
        else if (plVar11 != (longlong *)0x0) {
          *(undefined8 *)(puVar21 + -8) = 0x14015fbd9;
          lVar13 = FUN_1401a7680(plVar11);
          if (lVar13 != 0) {
            *(undefined8 *)(puVar21 + -8) = 0x14015fbea;
            FUN_1401a1450(plVar11 + 0x18);
            *puVar22 = plVar11;
            iVar9 = iVar9 + 1;
            puVar22 = puVar22 + 1;
          }
        }
        iVar23 = iVar23 + 1;
        iVar24 = local_2a88[0];
      } while (iVar23 < iVar25);
    }
  }
  else {
    *(undefined8 *)(puVar21 + -8) = 0x14015fc30;
    FUN_140156d30(param_1,&local_2628,iVar24,CONCAT44(uVar27,uVar8));
    iVar25 = 0;
    iVar26 = (int)local_2620;
    param_3 = local_2a48;
    iVar24 = iVar23;
    if (0 < iVar26) {
      do {
        lVar13 = (longlong)iVar25;
        if ((iVar25 < 0) || (local_2620 <= lVar13)) {
                    // WARNING: Subroutine does not return
          *(undefined **)(puVar21 + -8) = &UNK_14015fe2c;
          FUN_1400a26d0();
        }
        puVar6 = local_2628;
        if (local_2618 < 0x65) {
          puVar6 = local_2608;
        }
        plVar4 = *(longlong **)(puVar6 + lVar13 * 0x20 + 8);
        if ((plVar4 == param_1 + 0xe) && (*(char *)((longlong)local_2a48 + 0x2d) != '\0')) {
          *(undefined8 *)(puVar21 + -8) = 0x14015fcb8;
          FUN_140185560(local_2a78);
          uVar12 = local_2a50;
          *(undefined8 *)(puVar21 + -8) = 0x14015fcc6;
          FUN_1401a7270(uVar12,local_2a78);
          *(undefined8 *)(puVar21 + -8) = 0x14015fccf;
          uVar8 = FUN_1401a6d30(local_2a78);
          *(undefined8 *)(puVar21 + -8) = 0x14015fce5;
          uVar12 = FUN_14015c3e0(&local_2988,local_2a78,uVar8,1);
          lVar13 = param_1[0x8d];
          *(undefined8 *)(puVar21 + -8) = 0x14015fd01;
          lVar13 = FUN_14015f570(param_1 + 0x8b,uVar12,lVar13,0);
          if ((longlong *)param_1[0x8d] == (longlong *)0x0) {
            param_1[0x8c] = lVar13;
          }
          else {
            *(longlong *)param_1[0x8d] = lVar13;
          }
          param_1[0x8d] = lVar13;
          *(undefined8 *)(puVar21 + -8) = 0x14015fd2f;
          FUN_14015c350(local_2958);
          local_2a30 = &local_2978;
          *(undefined8 *)(puVar21 + -8) = 0x14015fd47;
          FUN_14019a730(&local_2978);
          if ((local_2970 != 0) && (local_2968[1] < 0)) {
                    // WARNING: Subroutine does not return
            *(undefined8 *)(puVar21 + -8) = 0x14015fe14;
            FUN_1400a26d0();
          }
          lVar13 = param_1[0x7c];
          *(undefined8 *)(puVar21 + -8) = 0x14015fd78;
          FUN_1401a76f0(lVar13 + 0x160,param_1 + 0xf);
          local_2a30 = &local_2a70;
          *(undefined8 *)(puVar21 + -8) = 0x14015fd8a;
          FUN_14019a730(&local_2a70);
          if (((ulonglong *)local_2a68 != (ulonglong *)0x0) && (local_2a5c < 0)) {
                    // WARNING: Subroutine does not return
            *(undefined **)(puVar21 + -8) = &UNK_14015fe1a;
            FUN_1400a26d0();
          }
        }
        else if (plVar4 != (longlong *)0x0) {
          *(undefined8 *)(puVar21 + -8) = 0x14015fdab;
          lVar18 = FUN_1401a7680(plVar4);
          if (lVar18 != 0) {
            *(undefined8 *)(puVar21 + -8) = 0x14015fdbb;
            FUN_14015a140(param_1,plVar4);
            *(undefined8 *)(puVar21 + -8) = 0x14015fdc7;
            FUN_1401a1450(plVar4 + 0x18);
            if (local_2620 <= lVar13) {
                    // WARNING: Subroutine does not return
              *(undefined **)(puVar21 + -8) = &UNK_14015fe20;
              FUN_1400a26d0();
            }
            puVar6 = local_2628;
            if (local_2618 < 0x65) {
              puVar6 = local_2608;
            }
            *plVar11 = (longlong)(puVar6 + lVar13 * 0x20);
            local_2a88[0] = local_2a88[0] + 1;
            plVar11 = plVar11 + 1;
          }
        }
        iVar25 = iVar25 + 1;
        param_3 = local_2a48;
        iVar24 = local_2a88[0];
        iVar9 = local_2a10;
      } while (iVar25 < iVar26);
    }
  }
  uVar12 = local_2a08;
  lVar13 = 0;
  *(undefined8 *)(puVar21 + -8) = 0x14015fe43;
  FUN_1400d1290(uVar12);
  local_2a00 = 0;
  if ((int)*param_3 == 1) {
    if (0 < iVar9) {
      do {
        lVar18 = local_2a80[lVar13];
        pcVar5 = *(code **)(*(longlong *)(lVar18 + 0x108) + 0x10);
        *(undefined8 *)(puVar21 + -8) = 0x14015fe75;
        puVar14 = (ulonglong *)(*pcVar5)();
        local_2a48 = puVar14;
        *(undefined8 *)(puVar21 + -8) = 0x14015fe84;
        FUN_1400a1c30(puVar14);
        uVar17 = local_2a50;
        iStack_2a40._0_1_ = 1;
        local_2a30 = (ulonglong *)0x0;
        local_2a28 = CONCAT71(local_2a28._1_7_,1);
        uVar12 = *(undefined8 *)(lVar18 + 0x748);
        *(undefined8 *)(puVar21 + -8) = 0x14015fea8;
        FUN_1401a12a0(uVar12,uVar17,&local_2a30);
        *(undefined8 *)(puVar21 + -8) = 0x14015feb0;
        FUN_1400d1290(puVar14);
        iStack_2a40 = (uint)iStack_2a40._1_3_ << 8;
        *(undefined8 *)(puVar21 + -8) = 0x14015fec0;
        FUN_1401a1460(lVar18 + 0xc0);
        lVar13 = lVar13 + 1;
      } while (lVar13 < iVar9);
    }
  }
  else if (0 < iVar24) {
    do {
      piVar16 = (int *)local_2a38[lVar13];
      plVar11 = *(longlong **)(piVar16 + 2);
      if (*(longlong *)(piVar16 + 4) == 0) {
        if (*(longlong *)(piVar16 + 6) == 0) {
          pcVar5 = *(code **)(plVar11[0x21] + 0x10);
          *(undefined8 *)(puVar21 + -8) = 0x140160201;
          uVar17 = (*pcVar5)();
          local_29f8 = uVar17;
          *(undefined8 *)(puVar21 + -8) = 0x140160213;
          FUN_1400a1c30(uVar17);
          local_29f0 = 1;
          local_2a30 = (ulonglong *)CONCAT44(local_2a30._4_4_,(int)param_3[4]);
          local_2a28 = param_3[3];
          local_2a20 = *(undefined1 *)((longlong)param_3 + 0x2d);
          local_2a1c = (int)param_3[6];
          local_2a18 = *(undefined1 *)((longlong)param_3 + 0x41);
          local_2a17 = (undefined1)param_3[8];
          pcVar5 = *(code **)(*plVar11 + 0x10);
          *(undefined8 *)(puVar21 + -8) = 0x140160252;
          uVar8 = (*pcVar5)(plVar11);
          uVar12 = local_2a50;
          *(undefined8 *)(puVar21 + -8) = 0x140160268;
          FUN_1401a2c20(plVar11 + 0xe0,uVar8,uVar12,&local_2a30);
          *(undefined8 *)(puVar21 + -8) = 0x140160270;
          FUN_1400d1290(uVar17);
          local_29f0 = 0;
        }
        else {
          *(undefined8 *)(puVar21 + -8) = 0x14015ff0b;
          FUN_140185560(local_2a78);
          *(undefined8 *)(puVar21 + -8) = 0x14015ff15;
          FUN_140185030(local_2a78);
          *(undefined8 *)(puVar21 + -8) = 0x14015ff20;
          FUN_14003c9e0(local_2a78,0x22);
          uVar2 = param_3[4];
          *(undefined8 *)(puVar21 + -8) = 0x14015ff2e;
          FUN_14003c9e0(local_2a78,(char)uVar2);
          uVar2 = param_3[3];
          *(undefined8 *)(puVar21 + -8) = 0x14015ff3b;
          FUN_140186930(local_2a78,uVar2);
          local_2988 = (void *)0x0;
          local_2970 = 0;
          local_2980 = 0;
          local_2978 = 100;
          do {
            lVar18 = local_2980;
            iVar9 = *piVar16;
            if (local_2980 < 0) {
                    // WARNING: Subroutine does not return
              *(undefined8 *)(puVar21 + -8) = 0x140160311;
              FUN_1400a26d0();
            }
            lVar1 = local_2980 + 1;
            *(undefined8 *)(puVar21 + -8) = 0x14015ff7f;
            FUN_1401442d0(&local_2988,lVar1,0xffffffffffffffff);
            if (local_2980 <= lVar18) {
                    // WARNING: Subroutine does not return
              *(undefined **)(puVar21 + -8) = &UNK_14016030b;
              FUN_1400a26d0();
            }
            if (local_2978 < 0x65) {
              piVar15 = local_2968 + lVar18;
            }
            else {
              piVar15 = (int *)((longlong)local_2988 + lVar18 * 4);
            }
            *piVar15 = iVar9;
            piVar16 = *(int **)(piVar16 + 6);
          } while (piVar16 != (int *)0x0);
          lVar18 = (longlong)(int)local_2980;
          *(undefined8 *)(puVar21 + -8) = 0x14015ffcf;
          FUN_140186930(local_2a78,lVar18);
          if (0 < local_2980) {
            lVar18 = 0;
            puVar14 = (ulonglong *)0x0;
            do {
              if ((lVar18 < 0) || (local_2980 <= lVar18)) {
                    // WARNING: Subroutine does not return
                *(undefined8 *)(puVar21 + -8) = 0x140160299;
                FUN_1400a26d0();
              }
              if (local_2978 < 0x65) {
                piVar16 = local_2968 + lVar18;
              }
              else {
                piVar16 = (int *)((longlong)local_2988 + lVar18 * 4);
              }
              iVar9 = *piVar16;
              *(undefined8 *)(puVar21 + -8) = 0x14016001d;
              FUN_14007c6e0(local_2a78,iVar9);
              uVar19 = (int)puVar14 + 1;
              puVar14 = (ulonglong *)(ulonglong)uVar19;
              lVar18 = (longlong)(int)uVar19;
            } while (lVar18 < local_2980);
          }
          uVar12 = local_2a50;
          *(undefined8 *)(puVar21 + -8) = 0x14016003a;
          iVar9 = FUN_1401a7030(uVar12);
          *(undefined8 *)(puVar21 + -8) = 0x140160046;
          FUN_140186930(local_2a78,(longlong)iVar9);
          local_cfc = 200;
          local_d00 = 0;
          local_d08 = local_1988;
          local_6c = 200;
          local_70 = 0;
          local_78 = &local_cf8;
          if (local_2a70 == 0) {
            iVar9 = local_2a60;
            if ((ulonglong *)local_2a68 == (ulonglong *)0x0) {
                    // WARNING: Subroutine does not return
              *(undefined8 *)(puVar21 + -8) = 0x140160305;
              FUN_14019a830();
            }
          }
          else {
            iVar9 = *(int *)(local_2a70 + 0x18);
          }
          puVar14 = (ulonglong *)local_2a68;
          if ((ulonglong *)local_2a68 == (ulonglong *)0x0) {
            if (local_2a70 == 0) {
                    // WARNING: Subroutine does not return
              *(undefined **)(puVar21 + -8) = &UNK_1401602ff;
              FUN_14019a830();
            }
            puVar14 = (ulonglong *)0x0;
            if (*(int *)(local_2a70 + 0x18) != 0) {
              puVar14 = *(ulonglong **)(local_2a70 + 0x10);
            }
          }
          local_70 = 1;
          local_2a48._0_4_ = SUB84(puVar14,0);
          local_2a48._4_4_ = (undefined4)((ulonglong)puVar14 >> 0x20);
          local_cf8 = (undefined4)local_2a48;
          uStack_cf4 = local_2a48._4_4_;
          uStack_cec = uStack_2a3c;
          local_2a48 = puVar14;
          iStack_2a40 = iVar9;
          *(undefined8 *)(puVar21 + -8) = 0x1401600e9;
          iStack_cf0 = iVar9;
          FUN_140145c70(local_1988,&local_cf8);
          if (local_78 == (undefined4 *)0x0) {
            *(undefined8 *)(puVar21 + -8) = 0x1401602e6;
            FUN_1400a2320(local_29d0,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
            *(undefined8 *)(puVar21 + -8) = 0x1401602f9;
            _CxxThrowException(local_29d0,(ThrowInfo *)&DAT_1402f4860);
          }
          if (local_6c < 0) {
                    // WARNING: Subroutine does not return
            *(undefined **)(puVar21 + -8) = &UNK_1401602d2;
            FUN_1400a26d0();
          }
          *(undefined8 *)(puVar21 + -8) = 0x140160114;
          FUN_140145c70(local_1988,uVar12);
          pcVar5 = *(code **)(plVar11[0x21] + 0x10);
          *(undefined8 *)(puVar21 + -8) = 0x140160121;
          uVar12 = (*pcVar5)();
          local_29e8 = uVar12;
          *(undefined8 *)(puVar21 + -8) = 0x140160133;
          FUN_1400a1c30(uVar12);
          local_29e0 = 1;
          local_2a30 = (ulonglong *)CONCAT44(local_2a30._4_4_,(int)param_3[4]);
          local_2a28 = param_3[3];
          local_2a20 = *(undefined1 *)((longlong)param_3 + 0x2d);
          local_2a1c = (int)param_3[6];
          local_2a18 = *(undefined1 *)((longlong)param_3 + 0x41);
          local_2a17 = (undefined1)param_3[8];
          *(undefined8 *)(puVar21 + -8) = 0x140160181;
          FUN_1401a2c20(plVar11 + 0xe0,0,local_1988,&local_2a30);
          *(undefined8 *)(puVar21 + -8) = 0x140160189;
          FUN_1400d1290(uVar12);
          pvVar7 = local_2988;
          local_29e0 = 0;
          if (local_d08 == (undefined1 *)0x0) {
            *(undefined8 *)(puVar21 + -8) = 0x1401602b9;
            FUN_1400a2320(local_29d0,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
            *(undefined8 *)(puVar21 + -8) = 0x1401602cc;
            _CxxThrowException(local_29d0,(ThrowInfo *)&DAT_1402f4860);
          }
          if (local_cfc < 0) {
                    // WARNING: Subroutine does not return
            *(undefined **)(puVar21 + -8) = &UNK_1401602a5;
            FUN_1400a26d0();
          }
          local_d00 = 0;
          if (100 < local_2978) {
            *(undefined8 *)(puVar21 + -8) = 0x1401601c7;
            operator_delete__(pvVar7);
          }
          local_2a30 = &local_2a70;
          *(undefined8 *)(puVar21 + -8) = 0x1401601d9;
          FUN_14019a730(&local_2a70);
          if (((ulonglong *)local_2a68 != (ulonglong *)0x0) && (local_2a5c < 0)) {
                    // WARNING: Subroutine does not return
            *(undefined8 *)(puVar21 + -8) = 0x14016029f;
            FUN_1400a26d0();
          }
        }
      }
      *(undefined8 *)(puVar21 + -8) = 0x140160283;
      FUN_1401a1460(plVar11 + 0x18);
      lVar13 = lVar13 + 1;
    } while (lVar13 < iVar24);
  }
  if ((local_2a80 != (undefined8 *)0x0) && (piVar16 = (int *)(local_2a80 + -2), *piVar16 == 0xdddd))
  {
    *(undefined8 *)(puVar21 + -8) = 0x14016032d;
    free(piVar16);
  }
  if ((local_2a38 != (longlong *)0x0) && (plVar11 = local_2a38 + -2, (int)*plVar11 == 0xdddd)) {
    *(undefined8 *)(puVar21 + -8) = 0x140160348;
    free(plVar11);
  }
  puVar6 = local_2628;
  if (100 < local_2618) {
    *(undefined8 *)(puVar21 + -8) = 0x14016035f;
    operator_delete__(puVar6);
  }
  pvVar7 = local_27d8;
  if (100 < local_27c8) {
    *(undefined8 *)(puVar21 + -8) = 0x140160376;
    operator_delete__(pvVar7);
  }
  *(undefined8 *)(puVar21 + -8) = 0x140160388;
  return 1;
}



// WARNING: Removing unreachable block (ram,0x0001401605c2)
// WARNING: Removing unreachable block (ram,0x0001401605cb)
// WARNING: Removing unreachable block (ram,0x0001401605ec)
// WARNING: Removing unreachable block (ram,0x0001401605f5)

undefined8 *
FUN_1401603b0(undefined8 *param_1,undefined8 param_2,undefined1 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  undefined8 *local_res10;
  
  FUN_1401876b0(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  param_1[0xc] = Proud::IFastSocketDelegate::vftable;
  param_1[0xd] = Proud::ICompletionPortEventSink::vftable;
  param_1[0xe] = Proud::ISendDest_S::vftable;
  FUN_1401a7990(param_1 + 0xf);
  param_1[0x15] = Proud::CNetServer::vftable;
  param_1[0x16] = Proud::ICompletionContext::vftable;
  FUN_14015f700(param_1 + 0x17);
  *param_1 = Proud::CNetServerImpl::vftable;
  param_1[0xc] = Proud::CNetServerImpl::vftable;
  param_1[0xd] = Proud::CNetServerImpl::vftable;
  param_1[0xe] = Proud::CNetServerImpl::vftable;
  param_1[0xf] = Proud::CNetServerImpl::vftable;
  param_1[0x15] = Proud::CNetServerImpl::vftable;
  param_1[0x16] = Proud::CNetServerImpl::vftable;
  param_1[0x17] = Proud::CNetServerImpl::vftable;
  param_1[0x23] = Proud::CNetServerImpl::vftable;
  param_1[0x24] = Proud::CNetServerImpl::vftable;
  uVar3 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0x25,uVar3,1);
  uVar3 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0x2c,uVar3,1);
  param_1[0x41] = 0;
  FUN_1400a3440();
  param_1[0x42] = PTR_DAT_1402f8008;
  FUN_1400a3440();
  param_1[0x43] = PTR_DAT_1402f8008;
  FUN_1401a7a10(param_1 + 0x45);
  *(undefined4 *)((longlong)param_1 + 0x26c) = 0;
  *(undefined4 *)(param_1 + 0x4e) = 0;
  *(undefined4 *)((longlong)param_1 + 0x274) = 0;
  *(undefined4 *)(param_1 + 0x4f) = 0;
  *(undefined1 *)(param_1 + 0x50) = 0;
  param_1[0x5a] = 0;
  param_1[0x51] = 0;
  param_1[0x52] = 0;
  param_1[0x53] = 0;
  *(undefined4 *)(param_1 + 0x55) = 0x11;
  param_1[0x54] = 0;
  *(undefined4 *)(param_1 + 0x59) = 0;
  *(undefined4 *)((longlong)param_1 + 0x2ac) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x56) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x2b4) = 0x40100000;
  param_1[0x57] = 0x26;
  param_1[0x58] = 4;
  param_1[0x58] = 0;
  FUN_140159510(param_1 + 0x5b);
  FUN_1401529c0(param_1 + 0x71);
  param_1[0x7c] = 0;
  *(undefined4 *)(param_1 + 0x7d) = 0;
  *(undefined4 *)((longlong)param_1 + 0x3ec) = 0;
  *(undefined4 *)(param_1 + 0x7e) = 0;
  *(undefined4 *)((longlong)param_1 + 0x3f4) = 0;
  *(undefined1 *)(param_1 + 0x80) = 0;
  param_1[0x8a] = 0;
  param_1[0x81] = 0;
  param_1[0x82] = 0;
  param_1[0x83] = 0;
  *(undefined4 *)(param_1 + 0x85) = 0x11;
  param_1[0x84] = 0;
  *(undefined4 *)(param_1 + 0x89) = 0;
  *(undefined4 *)((longlong)param_1 + 0x42c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x86) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x434) = 0x40100000;
  param_1[0x87] = 0x26;
  param_1[0x88] = 4;
  param_1[0x88] = 0;
  param_1[0x8b] = 0;
  param_1[0x8e] = 0;
  param_1[0x8c] = 0;
  param_1[0x8d] = 0;
  param_1[0x8f] = 0;
  FUN_14018a120(param_1 + 0x90);
  param_1[0x90] = Proud::CNetServerImpl::C2SStub::vftable;
  puVar1 = param_1 + 0x95;
  local_res10 = puVar1;
  FUN_140186ea0(puVar1);
  *puVar1 = ProudS2C::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x4bc) != 1) {
    FUN_1400a2b50(PTR_u_PIDL_compiler_is_incompatible_to_14030bd40);
  }
  *puVar1 = Proud::CNetServerImpl::Proxy::vftable;
  param_1[0xd9] = Proud::CFastArray<>::vftable;
  param_1[0xda] = 0;
  param_1[0xdb] = 0;
  param_1[0xdc] = 0;
  param_1[0xdd] = 0;
  *(undefined1 *)(param_1 + 0xde) = 0;
  param_1[0xe8] = 0;
  param_1[0xdf] = 0;
  param_1[0xe0] = 0;
  param_1[0xe1] = 0;
  *(undefined4 *)(param_1 + 0xe3) = 0x11;
  param_1[0xe2] = 0;
  *(undefined4 *)(param_1 + 0xe7) = 0;
  *(undefined4 *)((longlong)param_1 + 0x71c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0xe4) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x724) = 0x40100000;
  param_1[0xe5] = 0x26;
  param_1[0xe6] = 0;
  param_1[0xe9] = 0;
  param_1[0xea] = 0;
  FUN_1400ad6b0(param_1 + 0xec);
  param_1[0xf1] = 0;
  param_1[0xf2] = 0;
  uVar3 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0xf3,uVar3,1);
  uVar3 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0xfa,uVar3,1);
  param_1[0x101] = 0;
  param_1[0x102] = 0;
  *(undefined4 *)(param_1 + 0x103) = 0;
  param_1[0x105] = 0;
  param_1[0x106] = 0;
  *(undefined4 *)(param_1 + 0x107) = 0;
  *(undefined4 *)(param_1 + 0x180) = 0;
  param_1[0x183] = 0;
  param_1[0x184] = 0;
  param_1[0x185] = 0;
  param_1[0x186] = 0;
  param_1[0x182] = Proud::ByteArray::vftable;
  *(undefined1 *)(param_1 + 0x187) = 0;
  FUN_1401a5ef0();
  param_1[0x18b] = 0;
  param_1[0x18c] = 0;
  param_1[0x18d] = 0;
  param_1[0x18e] = 0;
  param_1[0x18a] = Proud::ByteArray::vftable;
  *(undefined1 *)(param_1 + 399) = 0;
  param_1[0x199] = 0;
  param_1[400] = 0;
  param_1[0x191] = 0;
  param_1[0x192] = 0;
  *(undefined4 *)(param_1 + 0x194) = 0x11;
  param_1[0x193] = 0;
  *(undefined4 *)(param_1 + 0x198) = 0;
  *(undefined4 *)((longlong)param_1 + 0xca4) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x195) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0xcac) = 0x40100000;
  param_1[0x196] = 0x26;
  param_1[0x197] = 4;
  param_1[0x197] = 0;
  puVar2 = param_1 + 0x19a;
  local_res10 = puVar2;
  FUN_1400acf50(puVar2);
  FUN_1400ad070(puVar2);
  FUN_1401529c0(param_1 + 0x2dd);
  FUN_1401529c0(param_1 + 0x2e8);
  param_1[0x2f4] = Proud::CFastArray<>::vftable;
  param_1[0x2f5] = 0;
  param_1[0x2f6] = 0;
  param_1[0x2f7] = 0;
  param_1[0x2f8] = 0;
  param_1[0x2f9] = Proud::CFastArray<int,1>::vftable;
  param_1[0x2fa] = 0;
  param_1[0x2fb] = 0;
  param_1[0x2fc] = 0;
  param_1[0x2fd] = 0;
  param_1[0x2fe] = 0;
  FUN_1400a3440();
  param_1[0x301] = PTR_DAT_1402f8010;
  param_1[0x309] = Proud::CFastArray<int,0>::vftable;
  param_1[0x30a] = 0;
  param_1[0x30b] = 0;
  param_1[0x30c] = 0;
  param_1[0x30d] = 0;
  uVar4 = FUN_140154690(&local_res10);
  FUN_140149000(param_1 + 0xea,uVar4);
  puVar2 = local_res10;
  if (local_res10 != (undefined8 *)0x0) {
    FUN_1400a1c30(local_res10);
    local_res10[8] = local_res10[8] + -1;
    if (local_res10[8] == 0) {
      FUN_1400d1290(puVar2);
      FUN_140146310(local_res10);
    }
    else {
      FUN_1400d1290(puVar2);
    }
  }
  *(undefined4 *)(param_1 + 0x44) = DAT_1402f8110;
  FUN_1400a2c40();
  param_1[0xeb] = 0;
  FUN_1400ad700(param_1 + 0xec);
  FUN_140187b00(param_1,puVar1);
  FUN_140187d00(param_1,param_1 + 0x90);
  param_1[0x94] = param_1;
  *(undefined1 *)(param_1 + 0x7f) = 0;
  param_1[0x2ff] = 0x3ff0000000000000;
  FUN_14016a780(param_1 + 0x8b);
  *(undefined1 *)(param_1 + 0x300) = 1;
  *(undefined1 *)(param_1 + 0x97) = 1;
  *(undefined1 *)(param_1 + 0x93) = 1;
  FUN_140143670(param_1 + 0x2f9,100);
  *(undefined4 *)(param_1 + 0x2f3) = 0;
  *(undefined4 *)(param_1 + 0x4b) = 0;
  param_1[0x4c] = 0;
  param_1[0xa0] = 0;
  param_1[0xa8] = 0;
  param_1[0xb0] = 0;
  param_1[0xb8] = 0;
  param_1[0xc0] = 0;
  param_1[200] = 0;
  param_1[0xd0] = 0;
  param_1[0xd8] = 0;
  return param_1;
}



undefined8 FUN_140160bd0(longlong param_1)

{
  undefined8 uVar1;
  
  if (*(double *)(param_1 + 0xe8) != 0.0) {
    return *(undefined8 *)(param_1 + 0xe8);
  }
  uVar1 = FUN_1400ad790(param_1 + 0x648);
  *(undefined8 *)(param_1 + 0xe8) = uVar1;
  return *(undefined8 *)(param_1 + 0xe8);
}



undefined8 FUN_140160c20(void)

{
  return 1;
}



void thunk_FUN_1401877b0(longlong *param_1,longlong param_2)

{
  char cVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  int iVar5;
  longlong lVar6;
  longlong *plVar7;
  longlong lVar8;
  int iVar9;
  undefined1 auStack_68 [80];
  
  cVar1 = (**(code **)(*param_1 + 0x90))();
  if (cVar1 != '\0') {
    FUN_1400a2320(auStack_68,PTR_u_Already_async_callback_may_occur_14030bd58);
                    // WARNING: Subroutine does not return
    _CxxThrowException(auStack_68,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar5 = 0;
  lVar6 = 0;
  if (0 < (int)param_1[4]) {
    plVar7 = param_1 + 1;
    while( true ) {
      if ((lVar6 < 0) || ((int)param_1[4] <= iVar5)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      if (*(longlong *)(param_1[3] + lVar6 * 8) == param_2) break;
      iVar5 = iVar5 + 1;
      lVar6 = lVar6 + 1;
      if ((int)param_1[4] <= iVar5) {
        return;
      }
    }
    if (iVar5 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    iVar2 = (int)param_1[4] - iVar5;
    iVar9 = 1;
    if (iVar2 < 2) {
      iVar9 = iVar2;
    }
    iVar5 = ((int)param_1[4] - iVar9) - iVar5;
    if (0 < iVar5) {
      lVar8 = (longlong)iVar5;
      lVar6 = lVar6 * 8;
      do {
        lVar3 = FUN_1401b2160(plVar7);
        lVar4 = FUN_1401b2160(plVar7);
        *(undefined8 *)(lVar4 + lVar6) = *(undefined8 *)((longlong)iVar9 * 8 + lVar3 + lVar6);
        lVar6 = lVar6 + 8;
        lVar8 = lVar8 + -1;
      } while (lVar8 != 0);
    }
    FUN_140195930(plVar7,(int)param_1[4] - iVar9);
    *(undefined8 *)(param_2 + 8) = 0;
  }
  return;
}



void FUN_140160c40(longlong param_1)

{
  FUN_140187ec0(param_1 + -0xa8);
  return;
}



longlong FUN_140160c70(longlong param_1)

{
  return param_1 + -0x118;
}



void FUN_140160c80(longlong param_1)

{
  thunk_FUN_140187910(param_1 + -0xa8);
  return;
}



void FUN_140160c90(longlong param_1)

{
  FUN_140169180(param_1 + -0x120);
  return;
}



void FUN_140160ca0(longlong param_1)

{
  thunk_FUN_140169430(param_1 + -0xa8);
  return;
}



void FUN_140160cb0(longlong param_1)

{
  FUN_140169180(param_1 + -0x68);
  return;
}



void FUN_140160cc0(longlong param_1)

{
  FUN_140160c20(param_1 + -0xa8);
  return;
}



void FUN_140160cd0(longlong param_1)

{
  FUN_140169180(param_1 + -0xa8);
  return;
}



void FUN_140160ce0(longlong param_1)

{
  thunk_FUN_140187d00(param_1 + -0xa8);
  return;
}



void FUN_140160cf0(longlong param_1)

{
  FUN_140160c20(param_1 + -8);
  return;
}



void FUN_140160d00(longlong param_1)

{
  FUN_140169180(param_1 + -0x70);
  return;
}



void FUN_140160d10(longlong param_1)

{
  FUN_140160c20(param_1 + -0x48);
  return;
}



void FUN_140160d20(longlong param_1)

{
  FUN_140169180(param_1 + -0xb0);
  return;
}



void FUN_140160d30(longlong param_1)

{
  FUN_140141da0(param_1 + -0x120);
  return;
}



void FUN_140160d40(longlong param_1)

{
  FUN_140141da0(param_1 + -0xa8);
  return;
}



void FUN_140160d50(longlong param_1)

{
  thunk_FUN_1401877b0(param_1 + -0xa8);
  return;
}



void FUN_140160d60(longlong param_1)

{
  FUN_140169180(param_1 + -0x78);
  return;
}



void FUN_140160d70(longlong param_1)

{
  FUN_140169180(param_1 + -0xb8);
  return;
}



void FUN_140160d80(longlong param_1)

{
  thunk_FUN_140187570(param_1 + -0xa8);
  return;
}



void FUN_140160d90(longlong param_1)

{
  thunk_FUN_140187b00(param_1 + -0xa8);
  return;
}



void FUN_140160da0(longlong param_1)

{
  FUN_140169180(param_1 + -0x118);
  return;
}



void FUN_140160db0(longlong param_1)

{
  FUN_140169180(param_1 + -0x60);
  return;
}



void FUN_140160dc0(longlong param_1)

{
  FUN_140142c30(param_1 + -0xa8);
  return;
}



void FUN_140160dd0(longlong param_1)

{
  FUN_140143120(param_1 + -0xa8);
  return;
}



void FUN_140160de0(longlong param_1)

{
  FUN_140152150(param_1 + -0xa8);
  return;
}



void FUN_140160df0(longlong param_1)

{
  FUN_140151fd0(param_1 + -0xa8);
  return;
}



void FUN_140160e00(longlong param_1)

{
  FUN_140158650(param_1 + -0xa8);
  return;
}



void FUN_140160e10(longlong param_1)

{
  FUN_14015ce70(param_1 + -0xa8);
  return;
}



void FUN_140160e20(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  undefined1 local_128 [8];
  undefined1 local_120 [8];
  longlong local_118;
  int local_10c;
  undefined1 local_100 [232];
  
  uVar3 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x3e0) != 0) {
    FUN_140185560(local_128);
    FUN_14015de40(local_100,param_2,param_3,param_4,uVar3);
    uVar3 = *(undefined8 *)(param_1 + 0x468);
    plVar1 = *(longlong **)(param_1 + 0x458);
    if (plVar1 == (longlong *)0x0) {
      puVar2 = (undefined8 *)FUN_1400a34c0(0x128);
    }
    else {
      puVar2 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,0x128);
    }
    if (puVar2 != (undefined8 *)0x0) {
      *(undefined4 *)(puVar2 + 2) = 0;
      FUN_140185590(puVar2 + 3,local_128);
      FUN_14015de40(puVar2 + 8,local_100);
    }
    puVar2[1] = uVar3;
    *puVar2 = 0;
    *(longlong *)(param_1 + 0x470) = *(longlong *)(param_1 + 0x470) + 1;
    if (*(undefined8 **)(param_1 + 0x468) == (undefined8 *)0x0) {
      *(undefined8 **)(param_1 + 0x460) = puVar2;
    }
    else {
      **(undefined8 **)(param_1 + 0x468) = puVar2;
    }
    *(undefined8 **)(param_1 + 0x468) = puVar2;
    FUN_14015c350(local_100);
    FUN_14019a730(local_120);
    if ((local_118 != 0) && (local_10c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_1401a76f0(*(longlong *)(param_1 + 0x3e0) + 0x160,param_1 + 0x78);
  }
  return;
}



void FUN_140160f80(undefined8 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  undefined8 *puVar1;
  int *piVar2;
  undefined8 *puVar3;
  undefined8 uVar4;
  longlong lVar5;
  longlong local_158;
  undefined8 *local_150;
  longlong local_148;
  undefined1 local_140;
  undefined **local_138;
  undefined8 local_130;
  undefined8 local_128;
  undefined8 local_120;
  undefined8 local_118;
  undefined4 local_108 [2];
  undefined8 local_100 [2];
  undefined8 local_f0;
  undefined8 local_e8;
  undefined **local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  longlong local_b0;
  ulonglong local_a8;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined **local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 local_70;
  undefined **local_60;
  undefined4 local_58;
  undefined2 local_54;
  undefined **local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined8 local_18;
  
  local_18 = 0xfffffffffffffffe;
  local_100[0] = 0;
  local_f0 = 0;
  local_e8 = 0;
  local_d8 = 0;
  local_d0 = 0;
  local_c8 = 0;
  local_c0 = 0;
  local_e0 = Proud::ByteArray::vftable;
  local_a8 = 0;
  local_b0 = 0;
  local_b8 = 0;
  local_88 = 0;
  local_80 = 0;
  local_78 = 0;
  local_70 = 0;
  local_90 = Proud::ByteArray::vftable;
  local_60 = Proud::AddrPort::vftable;
  local_58 = 0;
  local_54 = 0;
  local_40 = 0;
  local_38 = 0;
  local_30 = 0;
  local_28 = 0;
  local_48 = Proud::ByteArray::vftable;
  local_108[0] = 7;
  local_130 = 0;
  local_128 = 0;
  local_120 = 0;
  local_118 = 0;
  local_138 = Proud::ByteArray::vftable;
  local_a0 = param_2;
  local_9c = param_3;
  local_98 = param_3;
  FUN_1400a3440();
  local_150 = (undefined8 *)PTR_DAT_1402f8010;
  uVar4 = FUN_1401416a0(&local_158,param_4,0,&local_150,&local_138);
  FUN_140141570(local_100,uVar4);
  lVar5 = local_158;
  if (local_158 != 0) {
    local_148 = local_158;
    FUN_1400a1c30(local_158);
    local_140 = 1;
    *(longlong *)(local_158 + 0x40) = *(longlong *)(local_158 + 0x40) + -1;
    if (*(longlong *)(local_158 + 0x40) == 0) {
      FUN_1400d1290(lVar5);
      local_140 = 0;
      FUN_14008c910(local_158);
    }
    else {
      FUN_1400d1290(lVar5);
    }
  }
  puVar3 = local_150;
  if (((local_150 != (undefined8 *)0x0) && (local_150 != (undefined8 *)PTR_DAT_1402f8010)) &&
     (puVar1 = local_150 + -1, puVar1 != (undefined8 *)0x0)) {
    lVar5 = FUN_1400a3440();
    local_148 = lVar5;
    FUN_1400a1c30(lVar5);
    local_140 = 1;
    piVar2 = (int *)((longlong)puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(lVar5);
  }
  local_150 = (undefined8 *)PTR_DAT_1402f8010;
  FUN_140140df0(&local_138);
  FUN_140160e20(param_1,local_108);
  FUN_140140df0(&local_48);
  FUN_140140df0(&local_90);
  local_150 = &local_b8;
  FUN_14019a730(&local_b8);
  if (local_b0 != 0) {
    if ((longlong)local_a8 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_a8 = local_a8 & 0xffffffff00000000;
  }
  FUN_140140df0(&local_e0);
  FUN_14015bf40(&local_e8);
  FUN_14015bec0(&local_f0);
  FUN_14008c980(local_100);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140161298)
// WARNING: Removing unreachable block (ram,0x0001401612a1)
// WARNING: Removing unreachable block (ram,0x0001401612bf)
// WARNING: Removing unreachable block (ram,0x0001401612c8)
// WARNING: Removing unreachable block (ram,0x000140161355)
// WARNING: Removing unreachable block (ram,0x00014016135c)
// WARNING: Removing unreachable block (ram,0x000140161364)
// WARNING: Removing unreachable block (ram,0x000140161371)
// WARNING: Removing unreachable block (ram,0x000140161369)
// WARNING: Removing unreachable block (ram,0x000140161377)
// WARNING: Removing unreachable block (ram,0x000140161388)
// WARNING: Removing unreachable block (ram,0x00014016158a)

void FUN_1401611d0(undefined8 param_1,undefined4 *param_2,uint param_3,undefined4 param_4)

{
  uint *puVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  ulonglong uVar5;
  longlong *plVar6;
  char cVar7;
  uint *puVar8;
  longlong lVar9;
  longlong lVar10;
  int iVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  undefined4 *puVar14;
  uint uVar15;
  ulonglong uVar16;
  undefined4 *puVar17;
  ulonglong uVar18;
  undefined4 *puVar19;
  undefined **local_e8;
  longlong *local_e0;
  ulonglong local_d8;
  ulonglong local_d0;
  undefined8 local_c8;
  undefined1 local_b8 [8];
  longlong local_b0;
  undefined4 *local_a8;
  undefined8 local_a0;
  longlong local_98;
  uint local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined8 local_80;
  undefined8 local_78;
  undefined4 local_70;
  undefined8 local_68;
  undefined8 local_58;
  
  local_58 = 0xfffffffffffffffe;
  local_e8 = Proud::CFastArray<int,0>::vftable;
  uVar12 = 0;
  iVar11 = 0;
  local_e0 = (longlong *)0x0;
  local_d8 = 0;
  local_d0 = 0;
  local_c8 = 0;
  local_b8[0] = 0;
  local_68 = 0;
  local_b0 = 0;
  local_a8 = (undefined4 *)0x0;
  local_a0 = 0;
  local_90 = 0x11;
  local_98 = 0;
  local_70 = 0;
  local_8c = 0x3f400000;
  local_88 = 0x3e800000;
  local_84 = 0x40100000;
  local_80 = 0x26;
  local_78 = 0;
  iVar2 = param_2[0x38];
  uVar18 = uVar12;
  plVar6 = local_e0;
  do {
    iVar2 = iVar2 + -1;
    local_e0 = plVar6;
    if (iVar2 < 0) {
      uVar13 = 0;
      puVar19 = (undefined4 *)0x0;
      uVar12 = uVar13;
      if (0 < iVar11) {
        do {
          if (((longlong)uVar13 < 0) || (iVar11 <= (int)uVar12)) {
                    // WARNING: Subroutine does not return
            FUN_1400a2700();
          }
          iVar2 = *(int *)(uVar18 + uVar13 * 4);
          lVar10 = (longlong)iVar2;
          iVar3 = param_2[0x38];
          lVar9 = (longlong)iVar3;
          if ((iVar2 < 0) || (iVar3 <= iVar2)) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          if (iVar2 < iVar3 + -1) {
            puVar14 = puVar19;
            puVar17 = puVar19;
            if (iVar3 != 0) {
              puVar14 = *(undefined4 **)(param_2 + 0x36);
              puVar17 = *(undefined4 **)(param_2 + 0x36);
            }
            *(undefined8 *)(puVar17 + lVar10 * 6) = *(undefined8 *)(puVar14 + lVar9 * 6 + -6);
            *(undefined8 *)(puVar17 + lVar10 * 6 + 2) = *(undefined8 *)(puVar14 + lVar9 * 6 + -4);
            *(undefined8 *)(puVar17 + lVar10 * 6 + 4) = *(undefined8 *)(puVar14 + lVar9 * 6 + -2);
          }
          FUN_140143f20(param_2 + 0x32,iVar3 + -1);
          uVar15 = (int)uVar12 + 1;
          uVar13 = uVar13 + 1;
          uVar12 = (ulonglong)uVar15;
        } while ((int)uVar15 < iVar11);
      }
      puVar14 = local_a8;
      if (local_98 == 0) {
        puVar14 = puVar19;
      }
      for (; puVar14 != (undefined4 *)0x0; puVar14 = *(undefined4 **)(puVar14 + 2)) {
        uVar4 = *puVar14;
        cVar7 = FUN_1401a68d0(param_2 + 0x32,uVar4);
        if (cVar7 == '\0') {
          FUN_140160f80(param_1,*param_2,uVar4,param_4);
        }
      }
      FUN_140148d50(local_b8);
      if (uVar18 != 0) {
        if (plVar6 == (longlong *)0x0) {
          FUN_1400a3530(uVar18);
        }
        else {
          (**(code **)(*plVar6 + 0x18))(plVar6,uVar18);
        }
      }
      return;
    }
    if ((iVar2 < 0) || ((int)param_2[0x38] <= iVar2)) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    puVar1 = (uint *)(*(longlong *)(param_2 + 0x36) + (longlong)iVar2 * 0x18);
    if ((*puVar1 == param_3) || (puVar1[1] == param_3)) {
      iVar11 = (int)uVar12;
      if (iVar11 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      FUN_140021fb0(&local_e8);
      uVar18 = local_d8;
      uVar12 = local_d0 & 0xffffffff;
      uVar13 = local_d8;
      if ((int)local_d0 == 0) {
        uVar13 = 0;
      }
      *(int *)(uVar13 + (longlong)iVar11 * 4) = iVar2;
      uVar15 = *puVar1;
      uVar16 = (ulonglong)local_90;
      uVar13 = (ulonglong)uVar15 % uVar16;
      if (local_b0 != 0) {
        for (puVar8 = *(uint **)(local_b0 + uVar13 * 8);
            (puVar8 != (uint *)0x0 && ((uint)uVar13 == puVar8[6] % local_90));
            puVar8 = *(uint **)(puVar8 + 2)) {
          if (*puVar8 == uVar15) goto LAB_140161456;
        }
      }
      uVar5 = (ulonglong)uVar15 % uVar16;
      if (local_b0 == 0) {
        cVar7 = FUN_140144560(local_b8,uVar16,CONCAT71((int7)(uVar13 >> 8),1));
        if (cVar7 == '\0') {
                    // WARNING: Subroutine does not return
          FUN_14000c6c0(0x8007000e);
        }
      }
      else {
        for (puVar8 = *(uint **)(local_b0 + uVar5 * 8);
            (puVar8 != (uint *)0x0 && ((uint)uVar5 == puVar8[6] % local_90));
            puVar8 = *(uint **)(puVar8 + 2)) {
          if (*puVar8 == uVar15) goto LAB_140161448;
        }
      }
      FUN_140193d80(local_b8);
      puVar8 = (uint *)FUN_140146360(local_b8,puVar1,uVar5,uVar15);
      FUN_140193d80(local_b8);
LAB_140161448:
      *(undefined1 *)(puVar8 + 1) = 0;
    }
LAB_140161456:
    iVar11 = (int)uVar12;
    plVar6 = local_e0;
  } while( true );
}



longlong FUN_1401615e0(void)

{
  void *pvVar1;
  longlong lVar2;
  
  pvVar1 = operator_new(0x1880);
  lVar2 = 0;
  if (pvVar1 != (void *)0x0) {
    lVar2 = FUN_1401603b0(pvVar1);
  }
  if (lVar2 != 0) {
    lVar2 = lVar2 + 0xa8;
  }
  return lVar2;
}



undefined8
FUN_140161620(ulonglong param_1,uint param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,char *param_7)

{
  undefined4 uVar1;
  longlong lVar2;
  undefined2 uVar3;
  char cVar4;
  int iVar5;
  uint *puVar6;
  char *pcVar7;
  undefined8 uVar8;
  undefined8 uVar9;
  undefined8 uVar10;
  undefined8 uVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  longlong *plVar14;
  ulonglong uVar15;
  longlong lVar16;
  ulonglong *puVar17;
  ulonglong uVar18;
  double dVar19;
  ulonglong local_res8;
  uint local_res10 [2];
  ulonglong *local_188;
  undefined1 local_180;
  undefined1 local_17f;
  undefined1 local_17e [6];
  ulonglong *local_178;
  ulonglong local_170;
  ulonglong local_168 [2];
  undefined8 local_158;
  undefined1 local_150;
  ulonglong local_148 [2];
  undefined4 local_138;
  undefined **local_130;
  undefined4 local_128;
  undefined2 local_124;
  undefined **local_120;
  undefined4 local_118;
  undefined2 local_114;
  undefined1 local_110;
  undefined4 local_108;
  undefined **local_100;
  undefined4 local_f8;
  undefined2 local_f4;
  undefined **local_f0;
  undefined4 local_e8;
  undefined2 local_e4;
  undefined1 local_e0;
  undefined4 local_d8;
  undefined **local_d0;
  undefined4 local_c8;
  undefined2 local_c4;
  undefined **local_c0;
  undefined4 local_b8;
  undefined2 local_b4;
  undefined1 local_b0;
  undefined8 local_a8;
  undefined1 local_a0 [16];
  undefined1 local_90 [16];
  undefined1 local_80 [16];
  undefined1 local_70 [16];
  undefined1 local_60 [16];
  undefined1 local_50 [24];
  
  local_a8 = 0xfffffffffffffffe;
  local_res8 = param_1;
  local_res10[0] = param_2;
  local_158 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(local_158);
  local_150 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))
              (*(longlong **)(param_1 + 0x20),
               L"Proud::CNetServerImpl::C2SStub::P2PGroup_MemberJoin_Ack");
  }
  FUN_14015c5c0(*(undefined8 *)(param_1 + 0x20),&local_178,*param_4);
  uVar18 = 0;
  if (((local_178 != (ulonglong *)0x0) && (*local_178 != 0)) &&
     (cVar4 = FUN_1401a6940(*local_178 + 200,local_res10[0],*param_5,*param_6), cVar4 == '\x01')) {
    uVar12 = uVar18;
    if (local_178 != (ulonglong *)0x0) {
      uVar12 = *local_178;
    }
    cVar4 = FUN_1401a6850(uVar12 + 200,*param_5,*param_6);
    if (cVar4 == '\0') {
      FUN_140160f80(*(undefined8 *)(param_1 + 0x20),*param_4,*param_5,0);
    }
  }
  FUN_1401553e0(*(longlong *)(param_1 + 0x20) + 0x2d8,&local_188,local_res10[0],*param_5);
  if ((local_188 == (ulonglong *)0x0) || (uVar12 = *local_188, uVar12 == 0)) {
    if ((local_188 != (ulonglong *)0x0) && (local_188[1] = local_188[1] - 1, local_188[1] == 0)) {
      FUN_1401462b0(local_188);
    }
    if ((local_178 != (ulonglong *)0x0) && (local_178[1] = local_178[1] - 1, local_178[1] == 0)) {
      uVar18 = *local_178;
      if (uVar18 != 0) {
        FUN_140149600(uVar18);
        FUN_1400a3530(uVar18);
      }
      FUN_1400a3530(local_178);
    }
    goto LAB_140161cd6;
  }
  if (*(char *)(uVar12 + 0x1a0) != '\0') {
    puVar6 = (uint *)(uVar12 + 0x10);
    uVar13 = uVar18;
    uVar15 = uVar18;
    do {
      if (*puVar6 == local_res10[0]) {
        *(undefined1 *)(uVar12 + 0x38 + (longlong)(int)uVar15 * 0x30) = 1;
        break;
      }
      uVar15 = (ulonglong)((int)uVar15 + 1);
      uVar13 = uVar13 + 1;
      puVar6 = puVar6 + 0xc;
    } while ((longlong)uVar13 < 2);
    uVar13 = (ulonglong)local_res10[0];
    uVar12 = uVar18;
    if (local_188 != (ulonglong *)0x0) {
      uVar12 = *local_188;
    }
    dVar19 = 0.0;
    if ((*(double *)(uVar12 + 400) != 0.0) && (*param_7 != '\0')) {
      uVar12 = uVar18;
      if (local_188 != (ulonglong *)0x0) {
        uVar12 = *local_188;
      }
      FUN_140143260(uVar12,uVar13);
      uVar13 = (ulonglong)local_res10[0];
    }
    uVar12 = uVar18;
    if (local_188 != (ulonglong *)0x0) {
      uVar12 = *local_188;
    }
    pcVar7 = (char *)(uVar12 + 0x38);
    lVar16 = 2;
    uVar12 = uVar18;
    do {
      if (*pcVar7 != '\0') {
        uVar12 = (ulonglong)((int)uVar12 + 1);
      }
      pcVar7 = pcVar7 + 0x30;
      lVar16 = lVar16 + -1;
    } while (lVar16 != 0);
    if ((int)uVar12 == 2) {
      uVar12 = uVar18;
      if (local_188 != (ulonglong *)0x0) {
        uVar12 = *local_188;
      }
      if (*(double *)(uVar12 + 400) == dVar19) {
LAB_140161a15:
        local_res8 = local_res8 & 0xffffffffffffff00;
        plVar14 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
        (**(code **)(*plVar14 + 0x50))
                  (plVar14,uVar13 & 0xffffffff,&DAT_140318cf0,param_5,&local_res8,
                   &PTR_vftable_1402f83c8,&PTR_vftable_1402f83c8,&PTR_vftable_1402f83c8,
                   &PTR_vftable_1402f83c8);
        local_17f = 0;
        plVar14 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
        (**(code **)(*plVar14 + 0x50))
                  (plVar14,*param_5,&DAT_140318cf0,local_res10,&local_17f,&PTR_vftable_1402f83c8,
                   &PTR_vftable_1402f83c8,&PTR_vftable_1402f83c8,&PTR_vftable_1402f83c8);
        uVar3 = DAT_1402f83d4;
        uVar1 = DAT_1402f83d0;
        uVar12 = uVar18;
        if (local_188 != (ulonglong *)0x0) {
          uVar12 = *local_188;
        }
        if (*(char *)(uVar12 + 8) != '\x01') {
          *(undefined4 *)(uVar12 + 0x10) = 0;
          *(undefined4 *)(uVar12 + 0x20) = uVar1;
          *(undefined2 *)(uVar12 + 0x24) = uVar3;
          *(undefined4 *)(uVar12 + 0x30) = uVar1;
          *(undefined2 *)(uVar12 + 0x34) = uVar3;
          *(undefined1 *)(uVar12 + 0x38) = 0;
          uVar3 = DAT_1402f83d4;
          uVar1 = DAT_1402f83d0;
          local_d0 = Proud::AddrPort::vftable;
          local_c0 = Proud::AddrPort::vftable;
          local_d8 = 0;
          local_b0 = 0;
          local_c8 = DAT_1402f83d0;
          local_c4 = DAT_1402f83d4;
          local_b8 = DAT_1402f83d0;
          local_b4 = DAT_1402f83d4;
          *(undefined4 *)(uVar12 + 0x40) = 0;
          *(undefined4 *)(uVar12 + 0x50) = uVar1;
          *(undefined2 *)(uVar12 + 0x54) = uVar3;
          *(undefined4 *)(uVar12 + 0x60) = uVar1;
          *(undefined2 *)(uVar12 + 100) = uVar3;
          *(undefined1 *)(uVar12 + 0x68) = 0;
          *(undefined1 *)(uVar12 + 8) = 1;
        }
        uVar3 = DAT_1402f83d4;
        uVar1 = DAT_1402f83d0;
        uVar12 = uVar18;
        if (local_188 != (ulonglong *)0x0) {
          uVar12 = *local_188;
        }
        local_100 = Proud::AddrPort::vftable;
        local_f0 = Proud::AddrPort::vftable;
        local_108 = 0;
        local_e0 = 0;
        local_f8 = DAT_1402f83d0;
        local_f4 = DAT_1402f83d4;
        local_e8 = DAT_1402f83d0;
        local_e4 = DAT_1402f83d4;
        *(undefined4 *)(uVar12 + 0x10) = 0;
        *(undefined4 *)(uVar12 + 0x20) = uVar1;
        *(undefined2 *)(uVar12 + 0x24) = uVar3;
        *(undefined4 *)(uVar12 + 0x30) = uVar1;
        *(undefined2 *)(uVar12 + 0x34) = uVar3;
        *(undefined1 *)(uVar12 + 0x38) = 0;
        uVar3 = DAT_1402f83d4;
        uVar1 = DAT_1402f83d0;
        local_130 = Proud::AddrPort::vftable;
        local_120 = Proud::AddrPort::vftable;
        local_138 = 0;
        local_110 = 0;
        local_128 = DAT_1402f83d0;
        local_124 = DAT_1402f83d4;
        local_118 = DAT_1402f83d0;
        local_114 = DAT_1402f83d4;
        *(undefined4 *)(uVar12 + 0x40) = 0;
        *(undefined4 *)(uVar12 + 0x50) = uVar1;
        *(undefined2 *)(uVar12 + 0x54) = uVar3;
        *(undefined4 *)(uVar12 + 0x60) = uVar1;
        *(undefined2 *)(uVar12 + 100) = uVar3;
        *(undefined1 *)(uVar12 + 0x68) = 0;
        uVar12 = uVar18;
        if (local_188 != (ulonglong *)0x0) {
          uVar12 = *local_188;
        }
        *(undefined8 *)(uVar12 + 0x198) = 0;
      }
      else {
        uVar12 = uVar18;
        if (local_188 != (ulonglong *)0x0) {
          uVar12 = *local_188;
        }
        puVar17 = local_188;
        iVar5 = FUN_140142230(uVar12);
        if (iVar5 != 2) goto LAB_140161a15;
        local_180 = 1;
        if (puVar17 == (ulonglong *)0x0) {
          local_148[0] = 0;
        }
        else {
          local_148[0] = *puVar17;
        }
        uVar1 = *param_5;
        lVar16 = *(longlong *)(param_1 + 0x20);
        lVar2 = *(longlong *)(lVar16 + 0x4a8);
        local_170 = local_148[0];
        local_168[0] = local_148[0];
        uVar8 = FUN_1401425a0(local_148[0],local_50,local_res10[0]);
        uVar9 = FUN_140142520(local_148[0],local_90);
        uVar10 = FUN_1401421b0(local_170,local_148,uVar1);
        uVar11 = FUN_1401420b0(local_168[0],local_70);
        (**(code **)(lVar2 + 0x50))
                  (lVar16 + 0x4a8,local_res10[0],&DAT_140318cf0,param_5,&local_180,uVar11,uVar10,
                   uVar9,uVar8);
        local_17e[0] = 1;
        if (local_188 == (ulonglong *)0x0) {
          local_168[0] = 0;
        }
        else {
          local_168[0] = *local_188;
        }
        uVar12 = local_168[0];
        uVar1 = *param_5;
        lVar16 = *(longlong *)(local_res8 + 0x20);
        lVar2 = *(longlong *)(lVar16 + 0x4a8);
        local_170 = local_168[0];
        uVar8 = FUN_1401425a0(local_168[0],local_a0,uVar1);
        uVar9 = FUN_140142520(uVar12,local_80);
        uVar10 = FUN_1401421b0(local_168[0],local_60,local_res10[0]);
        uVar11 = FUN_1401420b0(local_170,local_168);
        (**(code **)(lVar2 + 0x50))
                  (lVar16 + 0x4a8,uVar1,&DAT_140318cf0,local_res10,local_17e,uVar11,uVar10,uVar9,
                   uVar8);
        uVar12 = uVar18;
        if (local_188 != (ulonglong *)0x0) {
          uVar12 = *local_188;
        }
        if (*(char *)(uVar12 + 8) != '\0') {
          *(undefined1 *)(uVar12 + 8) = 0;
        }
      }
      uVar12 = uVar18;
      if (local_188 != (ulonglong *)0x0) {
        uVar12 = *local_188;
      }
      *(undefined8 *)(uVar12 + 400) = 0;
      if (local_188 != (ulonglong *)0x0) {
        uVar18 = *local_188;
      }
      *(undefined1 *)(uVar18 + 0x1a0) = 0;
    }
  }
  if ((local_188 != (ulonglong *)0x0) && (local_188[1] = local_188[1] - 1, local_188[1] == 0)) {
    FUN_1401462b0(local_188);
  }
  if ((local_178 != (ulonglong *)0x0) && (local_178[1] = local_178[1] - 1, local_178[1] == 0)) {
    uVar18 = *local_178;
    if (uVar18 != 0) {
      FUN_140149600(uVar18);
      FUN_1400a3530(uVar18);
    }
    FUN_1400a3530(local_178);
  }
LAB_140161cd6:
  FUN_1400d1290(local_158);
  return 1;
}



void FUN_140161d00(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  uint uVar2;
  uint uVar3;
  longlong lVar4;
  ulonglong uVar5;
  bool bVar6;
  longlong lVar7;
  longlong *plVar8;
  undefined8 uVar9;
  uint *puVar10;
  longlong lVar11;
  uint *puVar12;
  longlong lVar13;
  longlong local_res8 [2];
  longlong *local_res18;
  longlong local_res20;
  
  FUN_14015f2e0(param_2);
  uVar9 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_1400a1c30(uVar9);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
              (param_1 + -0xa8,L"Proud::CNetServerImpl::GetP2PGroups");
  }
  if (*(longlong *)(param_1 + 0x378) == 0) {
    lVar13 = 0;
  }
  else {
    lVar13 = *(longlong *)(param_1 + 0x368);
  }
  do {
    if (lVar13 == 0) {
      FUN_1400d1290(uVar9);
      return;
    }
    if (lVar13 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    local_res18 = (longlong *)0x0;
    if (*(longlong *)(lVar13 + 8) != 0) {
      *(longlong *)(*(longlong *)(lVar13 + 8) + 8) =
           *(longlong *)(*(longlong *)(lVar13 + 8) + 8) + 1;
      local_res18 = *(longlong **)(lVar13 + 8);
    }
    plVar1 = local_res18;
    if (local_res18 == (longlong *)0x0) {
      lVar11 = 0;
    }
    else {
      lVar11 = *local_res18;
    }
    FUN_1401a6cb0(lVar11);
    if (local_res8[0] == 0) {
      puVar12 = (uint *)0x0;
    }
    else {
      puVar12 = *(uint **)(local_res8[0] + 0x38);
    }
    uVar2 = *puVar12;
    uVar3 = *(uint *)(param_2 + 0x28);
    uVar5 = (ulonglong)uVar2 % (ulonglong)uVar3;
    lVar11 = *(longlong *)(param_2 + 8);
    if (lVar11 != 0) {
      for (puVar10 = *(uint **)(lVar11 + uVar5 * 8);
          (puVar10 != (uint *)0x0 && ((uint)uVar5 == puVar10[8] % uVar3));
          puVar10 = *(uint **)(puVar10 + 4)) {
        if (*puVar10 == uVar2) goto LAB_140161ea2;
      }
    }
    uVar5 = (ulonglong)uVar2 % (ulonglong)uVar3;
    if (lVar11 != 0) {
      for (puVar10 = *(uint **)(lVar11 + uVar5 * 8);
          (puVar10 != (uint *)0x0 && ((uint)uVar5 == puVar10[8] % uVar3));
          puVar10 = *(uint **)(puVar10 + 4)) {
        if (*puVar10 == uVar2) goto LAB_140161e89;
      }
    }
    puVar10 = (uint *)FUN_14015f620(param_2,puVar12);
LAB_140161e89:
    FUN_14015a7e0(puVar10 + 2,local_res8);
LAB_140161ea2:
    lVar11 = local_res8[0];
    if (local_res8[0] != 0) {
      FUN_1400a1c30(local_res8[0]);
      bVar6 = true;
      *(longlong *)(local_res8[0] + 0x40) = *(longlong *)(local_res8[0] + 0x40) + -1;
      if (*(longlong *)(local_res8[0] + 0x40) == 0) {
        FUN_1400d1290(lVar11);
        lVar7 = local_res8[0];
        bVar6 = false;
        local_res20 = local_res8[0];
        lVar4 = *(longlong *)(local_res8[0] + 0x38);
        if (lVar4 != 0) {
          FUN_140148d50(lVar4 + 8);
          FUN_1400a3530(lVar4);
        }
        FUN_1400a1cd0(lVar7);
        FUN_1400a3530(lVar7);
      }
      if (bVar6) {
        FUN_1400d1290(lVar11);
      }
    }
    plVar8 = local_res18;
    if (plVar1 != (longlong *)0x0) {
      plVar1 = plVar1 + 1;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        lVar11 = *local_res18;
        if (lVar11 != 0) {
          FUN_140149600(lVar11);
          FUN_1400a3530(lVar11);
        }
        FUN_1400a3530(plVar8);
      }
    }
    if (lVar13 != 0) {
      lVar13 = *(longlong *)(lVar13 + 0x10);
    }
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x00014016226d)

void FUN_140161fb0(longlong *param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  int iVar3;
  char cVar4;
  undefined8 uVar5;
  undefined4 *puVar6;
  undefined4 *puVar7;
  longlong lVar8;
  longlong lVar9;
  undefined4 *puVar10;
  int iVar11;
  undefined4 *puVar12;
  undefined4 *puVar13;
  int iVar14;
  undefined4 *puVar15;
  longlong lVar16;
  longlong lVar17;
  double dVar18;
  longlong *local_res18;
  
  uVar5 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(uVar5);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::PurgeTooOldAddMemberAckItem");
  }
  dVar18 = (double)FUN_1400ad790(param_1 + 0xec);
  puVar12 = (undefined4 *)0x0;
  puVar13 = puVar12;
  if (param_1[0x84] != 0) {
    puVar13 = (undefined4 *)param_1[0x82];
  }
  do {
    if (puVar13 == (undefined4 *)0x0) {
LAB_140162278:
      FUN_1400d1290(uVar5);
      return;
    }
    local_res18 = (longlong *)0x0;
    puVar7 = puVar12;
    puVar10 = puVar12;
    puVar15 = puVar12;
    if (*(longlong *)(puVar13 + 2) != 0) {
      *(longlong *)(*(longlong *)(puVar13 + 2) + 8) =
           *(longlong *)(*(longlong *)(puVar13 + 2) + 8) + 1;
      local_res18 = *(longlong **)(puVar13 + 2);
    }
    while( true ) {
      puVar6 = puVar12;
      if (local_res18 != (longlong *)0x0) {
        puVar6 = (undefined4 *)*local_res18;
      }
      iVar14 = (int)puVar7;
      if ((int)puVar6[0x38] <= iVar14) break;
      puVar7 = puVar12;
      if (local_res18 != (longlong *)0x0) {
        puVar7 = (undefined4 *)*local_res18;
      }
      if (((longlong)puVar10 < 0) || ((int)puVar7[0x38] <= iVar14)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      if (DAT_1402f80a8 <
          dVar18 - *(double *)((longlong)puVar15 + *(longlong *)(puVar7 + 0x36) + 0x10)) {
        uVar2 = *(undefined4 *)((longlong)puVar15 + *(longlong *)(puVar7 + 0x36));
        puVar13 = puVar12;
        if (local_res18 != (longlong *)0x0) {
          puVar13 = (undefined4 *)*local_res18;
        }
        puVar7 = puVar13 + 0x32;
        iVar11 = 1;
        if (iVar14 < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        iVar3 = puVar13[0x38];
        if (iVar3 - iVar14 < 2) {
          iVar11 = iVar3 - iVar14;
        }
        iVar14 = (iVar3 - iVar11) - iVar14;
        if (0 < iVar14) {
          lVar17 = (longlong)iVar14;
          lVar16 = (longlong)puVar10 * 0x18;
          do {
            lVar8 = FUN_1401b2160(puVar7);
            lVar8 = lVar8 + (longlong)iVar11 * 0x18;
            lVar9 = FUN_1401b2160(puVar7);
            *(undefined8 *)(lVar9 + lVar16) = *(undefined8 *)(lVar8 + lVar16);
            *(undefined8 *)(lVar9 + 8 + lVar16) = *(undefined8 *)(lVar8 + 8 + lVar16);
            *(undefined8 *)(lVar9 + 0x10 + lVar16) = *(undefined8 *)(lVar8 + 0x10 + lVar16);
            lVar16 = lVar16 + 0x18;
            lVar17 = lVar17 + -1;
          } while (lVar17 != 0);
        }
        FUN_140143f20(puVar7,puVar13[0x38] - iVar11);
        puVar13 = puVar12;
        if (local_res18 != (longlong *)0x0) {
          puVar13 = (undefined4 *)*local_res18;
        }
        cVar4 = FUN_1401a68d0(puVar13 + 0x32,uVar2);
        if (cVar4 == '\0') {
          if (local_res18 != (longlong *)0x0) {
            puVar12 = (undefined4 *)*local_res18;
          }
          FUN_140160f80(param_1,*puVar12,uVar2,7);
        }
        if (local_res18 != (longlong *)0x0) {
          plVar1 = local_res18 + 1;
          *plVar1 = *plVar1 + -1;
          if (*plVar1 == 0) {
            lVar16 = *local_res18;
            if (lVar16 != 0) {
              FUN_140149600(lVar16);
              FUN_1400a3530(lVar16);
            }
            FUN_1400a3530(local_res18);
          }
        }
        goto LAB_140162278;
      }
      puVar7 = (undefined4 *)(ulonglong)(iVar14 + 1);
      puVar10 = (undefined4 *)((longlong)puVar10 + 1);
      puVar15 = puVar15 + 6;
    }
    if (local_res18 != (longlong *)0x0) {
      plVar1 = local_res18 + 1;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        lVar16 = *local_res18;
        if (lVar16 != 0) {
          FUN_140149600(lVar16);
          FUN_1400a3530(lVar16);
        }
        FUN_1400a3530(local_res18);
      }
    }
    if (puVar13 == (undefined4 *)0x0) {
      puVar13 = (undefined4 *)0x0;
    }
    else {
      puVar13 = *(undefined4 **)(puVar13 + 4);
    }
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x000140162f21)
// WARNING: Removing unreachable block (ram,0x000140162f34)
// WARNING: Removing unreachable block (ram,0x000140162f52)
// WARNING: Type propagation algorithm not settling

undefined8
FUN_1401622a0(longlong param_1,uint param_2,uint param_3,undefined8 param_4,undefined4 param_5)

{
  int *piVar1;
  uint uVar2;
  undefined4 uVar3;
  undefined8 *puVar4;
  ulonglong uVar5;
  undefined2 uVar6;
  undefined8 *puVar7;
  char cVar8;
  int iVar9;
  undefined4 uVar10;
  undefined4 uVar11;
  uint *puVar12;
  longlong *plVar13;
  longlong *plVar14;
  longlong *plVar15;
  void *pvVar16;
  undefined4 *puVar17;
  undefined1 *puVar18;
  undefined8 uVar19;
  double dVar20;
  longlong *plVar21;
  undefined8 *puVar22;
  undefined8 *puVar23;
  longlong lVar24;
  undefined ***pppuVar25;
  undefined ***pppuVar26;
  undefined *puVar27;
  undefined *puVar28;
  longlong *plVar29;
  uint uVar30;
  double dVar31;
  undefined1 auStack_708 [32];
  uint *local_6e8;
  undefined8 local_6e0;
  undefined4 *local_6d8;
  undefined ***local_6d0;
  undefined ***local_6c8;
  longlong *local_6c0;
  undefined4 *local_6b8;
  longlong *local_6b0;
  undefined2 *local_6a8;
  uint local_698;
  char local_694;
  char local_693;
  undefined4 local_690;
  uint local_68c;
  longlong *local_688;
  longlong *local_680;
  uint local_678 [2];
  undefined4 local_670 [2];
  longlong local_668;
  undefined8 *local_660;
  undefined8 *local_658;
  undefined ***local_650;
  undefined8 local_648;
  longlong *local_640;
  undefined4 local_638 [2];
  longlong *local_630;
  undefined4 local_628 [2];
  longlong *local_620;
  undefined4 local_618;
  undefined4 local_614;
  longlong *local_610;
  undefined ***local_608;
  undefined *local_5f8;
  undefined *local_5f0;
  uint local_5e8 [2];
  longlong local_5e0;
  longlong local_5d8;
  uint local_5d0 [2];
  undefined *local_5c8;
  undefined4 *local_5c0;
  longlong local_5b8;
  longlong *local_5b0;
  undefined **local_5a8;
  undefined8 local_5a0;
  longlong *local_598;
  undefined8 local_590;
  undefined4 local_588;
  undefined4 local_584;
  undefined **local_580;
  undefined8 local_578;
  longlong *local_570;
  undefined8 local_568;
  undefined4 local_560;
  undefined4 local_55c;
  undefined **local_558;
  undefined8 local_550;
  longlong *local_548;
  undefined8 local_540;
  undefined4 local_538;
  undefined4 local_534;
  undefined **local_530;
  undefined8 local_528;
  longlong *local_520;
  undefined8 local_518;
  undefined4 local_510;
  undefined4 local_50c;
  double local_508;
  undefined1 local_500;
  longlong *local_4f8;
  longlong *local_4f0;
  double local_4e8;
  undefined8 local_4e0;
  undefined **local_4d8;
  undefined8 local_4d0;
  undefined8 local_4c8;
  undefined8 local_4c0;
  undefined8 local_4b8;
  undefined **local_4b0;
  undefined8 local_4a8;
  undefined8 local_4a0;
  undefined8 local_498;
  undefined8 local_490;
  undefined **local_488;
  undefined8 local_480;
  undefined8 local_478;
  undefined8 local_470;
  undefined8 local_468;
  undefined **local_460;
  undefined8 local_458;
  undefined8 local_450;
  undefined8 local_448;
  undefined8 local_440;
  undefined **local_438;
  undefined8 local_430;
  undefined8 local_428;
  undefined8 local_420;
  undefined8 local_418;
  undefined **local_410;
  undefined8 local_408;
  undefined8 local_400;
  undefined8 local_3f8;
  undefined8 local_3f0;
  undefined8 local_3e8;
  undefined1 local_3e0;
  undefined8 local_3d8;
  undefined1 local_3d0;
  undefined4 local_3b8;
  undefined **local_3b0;
  undefined4 local_3a8;
  undefined2 local_3a4;
  undefined **local_3a0;
  undefined4 local_398;
  undefined2 local_394;
  undefined1 local_390;
  undefined4 local_388;
  undefined **local_380;
  undefined4 local_378;
  undefined2 local_374;
  undefined **local_370;
  undefined4 local_368;
  undefined2 local_364;
  undefined1 local_360;
  undefined4 local_358;
  undefined **local_350;
  undefined4 local_348;
  undefined2 local_344;
  undefined **local_340;
  undefined4 local_338;
  undefined2 local_334;
  undefined1 local_330;
  undefined8 local_320;
  undefined1 local_318 [16];
  undefined1 local_308 [288];
  undefined4 local_1e8;
  undefined4 local_1e4;
  undefined4 local_1e0;
  undefined4 local_1dc;
  undefined4 local_1d8;
  undefined4 local_1d4;
  undefined4 local_1d0;
  undefined4 local_1cc;
  undefined4 local_1c8;
  undefined4 local_1c4;
  undefined4 local_1c0;
  undefined4 local_1bc;
  undefined4 local_1b8;
  undefined4 local_1b4;
  undefined4 local_1b0;
  undefined4 local_1ac;
  undefined4 local_1a8;
  uint local_1a4;
  undefined4 local_1a0;
  double local_198;
  uint local_190;
  undefined4 local_18c;
  undefined4 local_188;
  double local_180;
  undefined1 local_178 [288];
  ulonglong local_58;
  
  local_320 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_708;
  plVar29 = (longlong *)0x0;
  local_698 = 0;
  local_68c = param_2;
  local_678[0] = param_3;
  local_668 = param_1;
  local_648 = param_4;
  local_5b8 = param_1;
  local_4e0 = param_4;
  FUN_14015c5c0();
  if ((local_688 == (longlong *)0x0) || (*local_688 == 0)) {
    if ((local_688 != (longlong *)0x0) && (local_688[1] = local_688[1] + -1, local_688[1] == 0)) {
      lVar24 = *local_688;
      if (lVar24 != 0) {
        FUN_140149600(lVar24);
        FUN_1400a3530(lVar24);
      }
      FUN_1400a3530(local_688);
    }
LAB_140163f6b:
    FUN_140140df0(param_4);
    return 0;
  }
  local_670[0] = param_5;
  uVar30 = *(uint *)(*local_688 + 0x30);
  uVar5 = (ulonglong)local_68c % (ulonglong)uVar30;
  lVar24 = *(longlong *)(*local_688 + 0x10);
  if (lVar24 != 0) {
    for (puVar12 = *(uint **)(lVar24 + uVar5 * 8);
        (puVar12 != (uint *)0x0 && ((uint)uVar5 == puVar12[10] % uVar30));
        puVar12 = *(uint **)(puVar12 + 6)) {
      if (*puVar12 == local_68c) {
        FUN_140160f80(param_1,local_678[0],(ulonglong)local_68c,0x11);
        if ((local_688 != (longlong *)0x0) && (local_688[1] = local_688[1] + -1, local_688[1] == 0))
        {
          lVar24 = *local_688;
          if (lVar24 != 0) {
            FUN_140149600(lVar24);
            FUN_1400a3530(lVar24);
          }
          FUN_1400a3530(local_688);
        }
        FUN_140140df0(param_4);
        return 1;
      }
    }
  }
  if ((*(char *)(param_1 + 0x24c) == '\0') || (local_68c != 1)) {
    plVar21 = local_688;
    lVar24 = FUN_140146cc0(param_1,local_68c);
    if ((lVar24 == 0) ||
       ((puVar23 = (undefined8 *)(lVar24 + 0x40), local_658 = puVar23, puVar23 == (undefined8 *)0x0
        || (cVar8 = FUN_140148c20(param_1), cVar8 != '\0')))) {
      plVar21[1] = plVar21[1] + -1;
      if (local_688[1] == 0) {
        lVar24 = *local_688;
        if (lVar24 != 0) {
          FUN_140149600(lVar24);
          FUN_1400a3530(lVar24);
        }
        FUN_1400a3530(local_688);
      }
      goto LAB_140163f6b;
    }
  }
  else {
    puVar23 = (undefined8 *)(param_1 + 0xb8);
    local_658 = puVar23;
  }
  dVar31 = (double)FUN_1400ad790(param_1 + 0x760);
  uVar30 = local_68c;
  local_693 = '\0';
  plVar21 = plVar29;
  if (local_688 != (longlong *)0x0) {
    plVar21 = (longlong *)*local_688;
  }
  plVar13 = plVar21 + 1;
  uVar2 = *(uint *)(plVar21 + 6);
  uVar5 = (ulonglong)local_68c % (ulonglong)uVar2;
  lVar24 = plVar21[2];
  local_508 = dVar31;
  local_4e8 = dVar31;
  if (lVar24 != 0) {
    for (puVar12 = *(uint **)(lVar24 + uVar5 * 8);
        (puVar12 != (uint *)0x0 && ((uint)uVar5 == puVar12[10] % uVar2));
        puVar12 = *(uint **)(puVar12 + 6)) {
      if (*puVar12 == local_68c) goto LAB_140162583;
    }
    if (lVar24 != 0) {
      for (puVar12 = *(uint **)(lVar24 + uVar5 * 8);
          (puVar12 != (uint *)0x0 && ((uint)uVar5 == puVar12[10] % uVar2));
          puVar12 = *(uint **)(puVar12 + 6)) {
        if (*puVar12 == local_68c) goto LAB_14016256b;
      }
    }
  }
  if ((lVar24 == 0) && (cVar8 = FUN_140144560(plVar13,(ulonglong)uVar2,1), cVar8 == '\0')) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x8007000e);
  }
  FUN_140144430(plVar13);
  puVar12 = (uint *)FUN_1401464a0(plVar13,&local_68c,uVar5,uVar30);
  FUN_140144430(plVar13);
LAB_14016256b:
  *(double *)(puVar12 + 2) = local_508;
  *(undefined8 **)(puVar12 + 4) = puVar23;
LAB_140162583:
  local_630 = (longlong *)0x0;
  plVar21 = plVar29;
  if (local_688 != (longlong *)0x0) {
    local_688[1] = local_688[1] + 1;
    local_630 = local_688;
    plVar21 = (longlong *)(ulonglong)local_698;
  }
  uVar30 = *(uint *)(puVar23 + 6);
  uVar5 = (ulonglong)local_678[0] % (ulonglong)uVar30;
  lVar24 = puVar23[2];
  if (lVar24 != 0) {
    for (puVar12 = *(uint **)(lVar24 + uVar5 * 8);
        (puVar12 != (uint *)0x0 && ((uint)uVar5 == puVar12[8] % uVar30));
        puVar12 = *(uint **)(puVar12 + 4)) {
      if (*puVar12 == local_678[0]) goto LAB_140162704;
    }
    if (lVar24 != 0) {
      for (puVar12 = *(uint **)(lVar24 + uVar5 * 8);
          (puVar12 != (uint *)0x0 && ((uint)uVar5 == puVar12[8] % uVar30));
          puVar12 = *(uint **)(puVar12 + 4)) {
        if (*puVar12 == local_678[0]) goto LAB_14016267e;
      }
      if (lVar24 != 0) goto LAB_140162645;
    }
  }
  cVar8 = FUN_140144560(puVar23 + 1,(ulonglong)uVar30,1);
  if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x8007000e);
  }
LAB_140162645:
  FUN_1401b2030(puVar23 + 1);
  puVar12 = (uint *)FUN_14015ed70(puVar23 + 1,local_678,uVar5,local_678[0]);
  FUN_1401b2030(puVar23 + 1);
LAB_14016267e:
  if (local_630 != *(longlong **)(puVar12 + 2)) {
    if (local_630 != (longlong *)0x0) {
      local_630[1] = local_630[1] + 1;
      plVar21 = (longlong *)(ulonglong)local_698;
    }
    plVar13 = plVar29;
    if (*(longlong *)(puVar12 + 2) != 0) {
      *(longlong *)(*(longlong *)(puVar12 + 2) + 8) =
           *(longlong *)(*(longlong *)(puVar12 + 2) + 8) + -1;
      plVar21 = (longlong *)(ulonglong)local_698;
      if (*(longlong *)(*(longlong *)(puVar12 + 2) + 8) == 0) {
        plVar13 = *(longlong **)(puVar12 + 2);
      }
    }
    *(longlong **)(puVar12 + 2) = local_630;
    if (plVar13 != (longlong *)0x0) {
      lVar24 = *plVar13;
      if (lVar24 != 0) {
        FUN_140149600(lVar24);
        FUN_1400a3530(lVar24);
      }
      FUN_1400a3530(plVar13);
    }
  }
LAB_140162704:
  plVar13 = plVar29;
  if (local_688 != (longlong *)0x0) {
    plVar13 = (longlong *)*local_688;
  }
  local_5b0 = plVar13 + 1;
  local_4f8 = plVar29;
  local_4f0 = local_5b0;
  if (plVar13[5] != 0) {
    local_4f8 = (longlong *)plVar13[3];
  }
  do {
    plVar13 = plVar29;
    if (local_688 != (longlong *)0x0) {
      plVar13 = (longlong *)*local_688;
    }
    local_620 = local_4f8;
    if ((local_4f8 == (longlong *)0x0) && (local_5b0 == plVar13 + 1)) {
      if (local_688 != (longlong *)0x0) {
        plVar29 = (longlong *)*local_688;
      }
      FUN_1401515f0(param_1,plVar29);
      if (local_693 == '\0') {
        FUN_140160f80(param_1,local_678[0],1);
      }
      plVar29 = local_630;
      if (local_630 != (longlong *)0x0) {
        plVar21 = local_630 + 1;
        *plVar21 = *plVar21 + -1;
        if (*plVar21 == 0) {
          lVar24 = *local_630;
          if (lVar24 != 0) {
            FUN_140149600(lVar24);
            FUN_1400a3530(lVar24);
          }
          FUN_1400a3530(plVar29);
        }
      }
      if ((local_688 != (longlong *)0x0) && (local_688[1] = local_688[1] + -1, local_688[1] == 0)) {
        lVar24 = *local_688;
        if (lVar24 != 0) {
          FUN_140149600(lVar24);
          FUN_1400a3530(lVar24);
        }
        FUN_1400a3530(local_688);
      }
      FUN_140140df0(local_648);
      return 1;
    }
    if (local_4f8 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    puVar23 = (undefined8 *)local_4f8[2];
    local_660 = puVar23;
    if (puVar23 != (undefined8 *)(param_1 + 0xb8)) {
      local_190 = local_68c;
      local_18c = (**(code **)*puVar23)(puVar23);
      local_188 = local_670[0];
      plVar13 = plVar29;
      if (local_688 != (longlong *)0x0) {
        plVar13 = (longlong *)*local_688;
      }
      local_180 = dVar31;
      FUN_140144650(plVar13 + 0x19,(int)plVar13[0x1c],&local_190,1);
      local_693 = '\x01';
    }
    if ((local_658 != (undefined8 *)(param_1 + 0xb8)) && (local_658 != puVar23)) {
      local_1a8 = (**(code **)*puVar23)(puVar23);
      local_1a4 = local_68c;
      local_1a0 = local_670[0];
      plVar13 = plVar29;
      if (local_688 != (longlong *)0x0) {
        plVar13 = (longlong *)*local_688;
      }
      local_198 = dVar31;
      FUN_140144650(plVar13 + 0x19,(int)plVar13[0x1c],&local_1a8,1);
      local_693 = '\x01';
    }
    local_694 = '\0';
    local_690._0_2_ = 0;
    local_680 = (longlong *)0x0;
    iVar9 = (**(code **)*puVar23)(puVar23);
    plVar13 = plVar29;
    cVar8 = '\0';
    if ((iVar9 != 1) && (iVar9 = (**(code **)*local_658)(), puVar7 = local_658, iVar9 != 1)) {
      pppuVar26 = (undefined ***)(local_658 + -8);
      lVar24 = local_668 + 0x2d8;
      local_650 = (undefined ***)(puVar23 + -8);
      local_608 = pppuVar26;
      plVar14 = (longlong *)
                FUN_1401553e0(lVar24,&local_5e0,*(undefined4 *)(puVar23 + 0xd7),
                              *(undefined4 *)(local_658 + 0xd7));
      if (*plVar14 != 0) {
        *(longlong *)(*plVar14 + 8) = *(longlong *)(*plVar14 + 8) + 1;
        plVar13 = (longlong *)*plVar14;
        plVar21 = (longlong *)(ulonglong)local_698;
        local_680 = plVar13;
      }
      if (local_5e0 != 0) {
        *(longlong *)(local_5e0 + 8) = *(longlong *)(local_5e0 + 8) + -1;
        if (*(longlong *)(local_5e0 + 8) == 0) {
          FUN_1401462b0(local_5e0);
        }
        plVar21 = (longlong *)(ulonglong)local_698;
        plVar13 = local_680;
      }
      if ((plVar13 == (longlong *)0x0) || (*plVar13 == 0)) {
        local_6e8 = (uint *)CONCAT71(local_6e8._1_7_,1);
        plVar15 = (longlong *)
                  FUN_14015a3f0(lVar24,&local_5d8,*(undefined4 *)(puVar23 + 0xd7),
                                *(undefined4 *)(puVar7 + 0xd7));
        plVar14 = (longlong *)*plVar15;
        if (plVar14 != plVar13) {
          if (plVar14 != (longlong *)0x0) {
            *(longlong *)(*plVar15 + 8) = plVar14[1] + 1;
            plVar21 = (longlong *)(ulonglong)local_698;
            plVar13 = local_680;
          }
          plVar14 = plVar29;
          if (plVar13 != (longlong *)0x0) {
            plVar13 = plVar13 + 1;
            *plVar13 = *plVar13 + -1;
            if (*plVar13 == 0) {
              plVar14 = local_680;
            }
            plVar21 = (longlong *)(ulonglong)local_698;
          }
          plVar13 = (longlong *)*plVar15;
          local_680 = plVar13;
          if (plVar14 != (longlong *)0x0) {
            FUN_1401462b0();
          }
        }
        if (local_5d8 != 0) {
          *(longlong *)(local_5d8 + 8) = *(longlong *)(local_5d8 + 8) + -1;
          if (*(longlong *)(local_5d8 + 8) == 0) {
            FUN_1401462b0(local_5d8);
          }
          plVar21 = (longlong *)(ulonglong)local_698;
          plVar13 = local_680;
        }
        if (((plVar13 == (longlong *)0x0) || (*plVar13 == 0)) ||
           (DAT_1402f80e0 < dVar31 - *(double *)(*plVar13 + 400))) {
          pvVar16 = operator_new(0x1b0);
          if ((pvVar16 == (void *)0x0) ||
             (lVar24 = FUN_1401451b0(pvVar16,local_668,
                                     *(int *)(puVar23 + 0xd7) == *(int *)(puVar7 + 0xd7)),
             lVar24 == 0)) {
            local_610 = (longlong *)0x0;
          }
          else {
            local_610 = (longlong *)FUN_1400a34c0(0x10);
            local_610[1] = 1;
            *local_610 = lVar24;
          }
          plVar14 = local_610;
          if (local_610 != plVar13) {
            if (local_610 != (longlong *)0x0) {
              local_610[1] = local_610[1] + 1;
              plVar21 = (longlong *)(ulonglong)local_698;
              plVar13 = local_680;
            }
            plVar15 = plVar29;
            if (plVar13 != (longlong *)0x0) {
              plVar13 = plVar13 + 1;
              *plVar13 = *plVar13 + -1;
              if (*plVar13 == 0) {
                plVar15 = local_680;
              }
              plVar21 = (longlong *)(ulonglong)local_698;
            }
            plVar13 = plVar14;
            local_680 = local_610;
            if (plVar15 != (longlong *)0x0) {
              FUN_1401462b0();
            }
          }
          if (plVar14 != (longlong *)0x0) {
            plVar14 = plVar14 + 1;
            *plVar14 = *plVar14 + -1;
            if (*plVar14 == 0) {
              FUN_1401462b0(local_610);
            }
            plVar21 = (longlong *)(ulonglong)local_698;
            plVar13 = local_680;
          }
          lVar24 = local_668;
          uVar6 = DAT_1402f83d4;
          uVar11 = DAT_1402f83d0;
          plVar14 = plVar29;
          if (plVar13 != (longlong *)0x0) {
            plVar14 = (longlong *)*plVar13;
          }
          if ((char)plVar14[1] != '\x01') {
            *(undefined4 *)(plVar14 + 2) = 0;
            *(undefined4 *)(plVar14 + 4) = uVar11;
            *(undefined2 *)((longlong)plVar14 + 0x24) = uVar6;
            *(undefined4 *)(plVar14 + 6) = uVar11;
            *(undefined2 *)((longlong)plVar14 + 0x34) = uVar6;
            *(undefined1 *)(plVar14 + 7) = 0;
            uVar6 = DAT_1402f83d4;
            uVar11 = DAT_1402f83d0;
            local_350 = Proud::AddrPort::vftable;
            local_340 = Proud::AddrPort::vftable;
            local_358 = 0;
            local_330 = 0;
            local_348 = DAT_1402f83d0;
            local_344 = DAT_1402f83d4;
            local_338 = DAT_1402f83d0;
            local_334 = DAT_1402f83d4;
            *(undefined4 *)(plVar14 + 8) = 0;
            *(undefined4 *)(plVar14 + 10) = uVar11;
            *(undefined2 *)((longlong)plVar14 + 0x54) = uVar6;
            *(undefined4 *)(plVar14 + 0xc) = uVar11;
            *(undefined2 *)((longlong)plVar14 + 100) = uVar6;
            *(undefined1 *)(plVar14 + 0xd) = 0;
            *(undefined1 *)(plVar14 + 1) = 1;
          }
          if (*(char *)(local_668 + 0x24d) == '\0') {
            local_4a8 = 0;
            local_4a0 = 0;
            local_498 = 0;
            local_490 = 0;
            local_4b0 = Proud::ByteArray::vftable;
            plVar14 = plVar29;
            if (plVar13 != (longlong *)0x0) {
              plVar14 = (longlong *)*plVar13;
            }
            FUN_140141510(plVar14 + 0x24,&local_4b0);
            FUN_140140df0(&local_4b0);
            local_480 = 0;
            local_478 = 0;
            local_470 = 0;
            local_468 = 0;
            local_488 = Proud::ByteArray::vftable;
            plVar14 = plVar29;
            if (plVar13 != (longlong *)0x0) {
              plVar14 = (longlong *)*plVar13;
            }
            FUN_140141510(plVar14 + 0x29,&local_488);
            FUN_140140df0(&local_488);
          }
          else {
            plVar14 = plVar29;
            if (plVar13 != (longlong *)0x0) {
              plVar14 = (longlong *)*plVar13;
            }
            FUN_1401a6030(plVar14 + 0x24,*(undefined4 *)(local_668 + 0x244));
            plVar14 = plVar29;
            if (plVar13 != (longlong *)0x0) {
              plVar14 = (longlong *)*plVar13;
            }
            FUN_1401a6030(plVar14 + 0x29,*(undefined4 *)(lVar24 + 0x248));
          }
          plVar14 = plVar29;
          if (plVar13 != (longlong *)0x0) {
            plVar14 = (longlong *)*plVar13;
          }
          uVar11 = FUN_1401a7a80(lVar24 + 0xcd0);
          *(undefined4 *)(plVar14 + 0x2e) = uVar11;
          plVar14 = plVar29;
          if (plVar13 != (longlong *)0x0) {
            plVar14 = (longlong *)*plVar13;
          }
          puVar17 = (undefined4 *)FUN_1400ad610(lVar24 + 0xcd0,local_178);
          *(undefined4 *)((longlong)plVar14 + 0x174) = *puVar17;
          *(undefined4 *)(plVar14 + 0x2f) = puVar17[1];
          *(undefined4 *)((longlong)plVar14 + 0x17c) = puVar17[2];
          *(undefined4 *)(plVar14 + 0x30) = puVar17[3];
          puVar22 = local_660;
        }
        else {
          local_694 = '\x01';
          puVar22 = puVar23;
        }
        cVar8 = local_694;
        plVar14 = plVar29;
        if (plVar13 != (longlong *)0x0) {
          plVar14 = (longlong *)*plVar13;
        }
        *(undefined4 *)((longlong)plVar14 + 0x114) = 1;
        local_640 = (longlong *)0x0;
        if (plVar13 != (longlong *)0x0) {
          plVar13[1] = plVar13[1] + 1;
          local_640 = local_680;
          plVar21 = (longlong *)(ulonglong)local_698;
        }
        plVar13 = local_640;
        FUN_14015bd40(local_668 + 0x2d8,puVar23 + -8,pppuVar26,&local_640);
        uVar6 = DAT_1402f83d4;
        uVar11 = DAT_1402f83d0;
        plVar14 = plVar29;
        if (plVar13 != (longlong *)0x0) {
          plVar14 = (longlong *)*plVar13;
        }
        uVar10 = *(undefined4 *)(puVar7 + 0xd7);
        uVar3 = *(undefined4 *)(puVar23 + 0xd7);
        local_380 = Proud::AddrPort::vftable;
        local_370 = Proud::AddrPort::vftable;
        local_388 = 0;
        local_360 = 0;
        local_378 = DAT_1402f83d0;
        local_374 = DAT_1402f83d4;
        local_368 = DAT_1402f83d0;
        local_364 = DAT_1402f83d4;
        *(undefined4 *)(plVar14 + 4) = DAT_1402f83d0;
        *(undefined2 *)((longlong)plVar14 + 0x24) = uVar6;
        *(undefined4 *)(plVar14 + 6) = uVar11;
        *(undefined2 *)((longlong)plVar14 + 0x34) = uVar6;
        *(undefined1 *)(plVar14 + 7) = 0;
        *(undefined1 *)(plVar14 + 7) = 0;
        *(undefined4 *)(plVar14 + 2) = uVar3;
        uVar6 = DAT_1402f83d4;
        uVar11 = DAT_1402f83d0;
        local_3b0 = Proud::AddrPort::vftable;
        local_3a0 = Proud::AddrPort::vftable;
        local_3b8 = 0;
        local_390 = 0;
        local_3a8 = DAT_1402f83d0;
        local_3a4 = DAT_1402f83d4;
        local_398 = DAT_1402f83d0;
        local_394 = DAT_1402f83d4;
        *(undefined4 *)(plVar14 + 10) = DAT_1402f83d0;
        *(undefined2 *)((longlong)plVar14 + 0x54) = uVar6;
        *(undefined4 *)(plVar14 + 0xc) = uVar11;
        *(undefined2 *)((longlong)plVar14 + 100) = uVar6;
        *(undefined1 *)(plVar14 + 0xd) = 0;
        *(undefined1 *)(plVar14 + 0xd) = 0;
        *(undefined4 *)(plVar14 + 8) = uVar10;
        *(undefined1 *)(plVar14 + 0x34) = 1;
        plVar14 = plVar29;
        if (plVar13 != (longlong *)0x0) {
          plVar14 = (longlong *)*plVar13;
        }
        uVar5 = ((ulonglong)plVar14 & 0xffffffff) % (ulonglong)*(uint *)(puVar23 + 0xd1);
        if (puVar23[0xcd] != 0) {
          for (puVar4 = *(undefined8 **)(puVar23[0xcd] + uVar5 * 8);
              (puVar4 != (undefined8 *)0x0 &&
              ((uint)uVar5 == *(uint *)(puVar4 + 4) % *(uint *)(puVar23 + 0xd1)));
              puVar4 = (undefined8 *)puVar4[2]) {
            plVar14 = plVar29;
            if ((undefined8 *)*puVar4 != (undefined8 *)0x0) {
              plVar14 = *(longlong **)*puVar4;
            }
            plVar15 = plVar29;
            if (plVar13 != (longlong *)0x0) {
              plVar15 = (longlong *)*plVar13;
            }
            if (plVar14 == plVar15) goto LAB_140163102;
          }
        }
        puVar18 = (undefined1 *)FUN_14015a620(puVar23 + 0xcc);
        *puVar18 = 0;
LAB_140163102:
        plVar14 = plVar29;
        if (plVar13 != (longlong *)0x0) {
          plVar14 = (longlong *)*plVar13;
        }
        uVar5 = ((ulonglong)plVar14 & 0xffffffff) % (ulonglong)*(uint *)(puVar7 + 0xd1);
        if (puVar7[0xcd] != 0) {
          for (puVar23 = *(undefined8 **)(puVar7[0xcd] + uVar5 * 8);
              (puVar23 != (undefined8 *)0x0 &&
              ((uint)uVar5 == *(uint *)(puVar23 + 4) % *(uint *)(puVar7 + 0xd1)));
              puVar23 = (undefined8 *)puVar23[2]) {
            plVar14 = plVar29;
            if ((undefined8 *)*puVar23 != (undefined8 *)0x0) {
              plVar14 = *(longlong **)*puVar23;
            }
            plVar15 = plVar29;
            if (plVar13 != (longlong *)0x0) {
              plVar15 = (longlong *)*plVar13;
            }
            if (plVar14 == plVar15) goto LAB_140163182;
          }
        }
        puVar18 = (undefined1 *)FUN_14015a620(puVar7 + 0xcc,&local_680);
        *puVar18 = 0;
LAB_140163182:
        param_1 = local_668;
        puVar23 = puVar22;
        if (*(longlong *)(local_668 + 0x17f0) != 0) {
          FUN_1400a3440();
          local_5f8 = PTR_DAT_1402f8010;
          uVar11 = (**(code **)*local_658)();
          uVar10 = (**(code **)*puVar22)(puVar22);
          FUN_14003c600(&local_5f8,&DAT_140253f60,uVar10,uVar11);
          puVar28 = local_5f8;
          puVar27 = local_5f8;
          if (local_5f8 == (undefined *)0x0) {
            puVar27 = PTR_DAT_1402f8010;
          }
          FUN_1401946b0(*(undefined8 *)(param_1 + 0x17f0),1,puVar27);
          if (((puVar28 != (undefined *)0x0) && (puVar28 != PTR_DAT_1402f8010)) &&
             (puVar28 + -8 != (undefined *)0x0)) {
            uVar19 = FUN_1400a3440();
            local_3e8 = uVar19;
            FUN_1400a1c30(uVar19);
            local_3e0 = 1;
            piVar1 = (int *)(puVar28 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(puVar28 + -8);
            }
            FUN_1400d1290(uVar19);
            local_3e0 = 0;
            puVar23 = local_660;
          }
          local_5f8 = PTR_DAT_1402f8010;
          cVar8 = local_694;
        }
      }
      else {
        piVar1 = (int *)(*plVar13 + 0x114);
        *piVar1 = *piVar1 + 1;
        param_1 = local_668;
        cVar8 = local_694;
      }
    }
    if (puVar23 != (undefined8 *)(param_1 + 0xb8)) {
      if (((cVar8 != '\0') && (plVar13 != (longlong *)0x0)) && (*plVar13 != 0)) {
        lVar24 = *plVar13;
        uVar11 = (**(code **)*puVar23)(puVar23);
        lVar24 = FUN_140142130(lVar24,local_318,uVar11);
        local_690._0_2_ = *(undefined2 *)(lVar24 + 0xc);
      }
      if (*(char *)(param_1 + 0x24d) == '\0') {
        if ((plVar13 == (longlong *)0x0) || (*plVar13 == 0)) {
          local_1c8 = 0;
          local_1c4 = 0;
          local_1c0 = 0;
          local_1bc = 0;
          local_650 = (undefined ***)&local_1c8;
        }
        else {
          local_650 = (undefined ***)(*plVar13 + 0x174);
        }
        if ((plVar13 == (longlong *)0x0) || (*plVar13 == 0)) {
          local_618 = 0;
        }
        else {
          local_618 = *(undefined4 *)(*plVar13 + 0x170);
        }
        plVar14 = plVar29;
        if (local_688 != (longlong *)0x0) {
          plVar14 = (longlong *)*local_688;
        }
        lVar24 = *(longlong *)(param_1 + 0x4a8);
        uVar11 = (**(code **)*local_660)();
        local_6b8 = &local_690;
        local_6c8 = local_650;
        local_6d0 = (undefined ***)&local_618;
        local_6d8 = local_670;
        local_6e0 = local_648;
        local_6e8 = &local_68c;
        local_6c0 = plVar14 + 0x1e;
        (**(code **)(lVar24 + 0x40))((longlong *)(param_1 + 0x4a8),uVar11,&DAT_140318cf0,plVar14);
        puVar23 = local_660;
        param_1 = local_668;
      }
      else {
        if ((plVar13 == (longlong *)0x0) || (*plVar13 == 0)) {
          local_1d8 = 0;
          local_1d4 = 0;
          local_1d0 = 0;
          local_1cc = 0;
          local_5c0 = &local_1d8;
        }
        else {
          local_5c0 = (undefined4 *)(*plVar13 + 0x174);
        }
        if ((plVar13 == (longlong *)0x0) || (*plVar13 == 0)) {
          local_638[0] = 0;
        }
        else {
          local_638[0] = *(undefined4 *)(*plVar13 + 0x170);
        }
        if ((plVar13 == (longlong *)0x0) || (lVar24 = *plVar13, lVar24 == 0)) {
          local_408 = 0;
          local_400 = 0;
          local_3f8 = 0;
          local_3f0 = 0;
          local_410 = Proud::ByteArray::vftable;
          local_608 = &local_410;
          uVar30 = (uint)plVar21 | 2;
        }
        else {
          local_530 = Proud::CFastArray<>::vftable;
          if (DAT_14030ae60 != 5) {
            FUN_140140ce0();
          }
          local_528 = *(undefined8 *)(lVar24 + 0x150);
          local_50c = *(undefined4 *)(lVar24 + 0x16c);
          local_520 = (longlong *)0x0;
          local_518 = 0;
          local_510 = 0;
          iVar9 = *(int *)(lVar24 + 0x160);
          if (iVar9 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          FUN_14003cda0(&local_530,iVar9);
          plVar14 = plVar29;
          if (*(int *)(lVar24 + 0x160) != 0) {
            plVar14 = *(longlong **)(lVar24 + 0x158);
          }
          plVar15 = local_520;
          if ((int)local_518 == 0) {
            plVar15 = plVar29;
          }
          FUN_1400224d0(plVar15,plVar14,(longlong)iVar9);
          local_530 = Proud::ByteArray::vftable;
          local_608 = &local_530;
          uVar30 = (uint)plVar21 | 1;
        }
        if ((plVar13 == (longlong *)0x0) || (lVar24 = *plVar13, lVar24 == 0)) {
          local_458 = 0;
          local_450 = 0;
          local_448 = 0;
          local_440 = 0;
          local_460 = Proud::ByteArray::vftable;
          local_650 = &local_460;
          uVar30 = uVar30 | 8;
        }
        else {
          local_580 = Proud::CFastArray<>::vftable;
          local_698 = uVar30;
          if (DAT_14030ae60 != 5) {
            FUN_140140ce0();
          }
          local_578 = *(undefined8 *)(lVar24 + 0x128);
          local_55c = *(undefined4 *)(lVar24 + 0x144);
          local_570 = (longlong *)0x0;
          local_568 = 0;
          local_560 = 0;
          iVar9 = *(int *)(lVar24 + 0x138);
          if (iVar9 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          FUN_14003cda0(&local_580,iVar9);
          plVar21 = plVar29;
          if (*(int *)(lVar24 + 0x138) != 0) {
            plVar21 = *(longlong **)(lVar24 + 0x130);
          }
          plVar14 = local_570;
          if ((int)local_568 == 0) {
            plVar14 = plVar29;
          }
          FUN_1400224d0(plVar14,plVar21,(longlong)iVar9);
          local_580 = Proud::ByteArray::vftable;
          local_650 = &local_580;
          uVar30 = uVar30 | 4;
        }
        plVar21 = plVar29;
        if (local_688 != (longlong *)0x0) {
          plVar21 = (longlong *)*local_688;
        }
        lVar24 = *(longlong *)(param_1 + 0x4a8);
        local_698 = uVar30;
        uVar11 = (**(code **)*local_660)();
        local_6a8 = (undefined2 *)&local_690;
        local_6b8 = local_5c0;
        local_6c0 = (longlong *)local_638;
        local_6c8 = local_608;
        local_6d0 = local_650;
        local_6d8 = local_670;
        local_6e0 = local_648;
        local_6e8 = &local_68c;
        local_6b0 = plVar21 + 0x1e;
        (**(code **)(lVar24 + 0x30))((longlong *)(param_1 + 0x4a8),uVar11,&DAT_140318db0,plVar21);
        if ((uVar30 & 8) != 0) {
          uVar30 = uVar30 & 0xfffffff7;
          local_698 = uVar30;
          FUN_140140df0(&local_460);
        }
        if ((uVar30 & 4) != 0) {
          uVar30 = uVar30 & 0xfffffffb;
          local_698 = uVar30;
          FUN_140140df0(&local_580);
        }
        if ((uVar30 & 2) != 0) {
          uVar30 = uVar30 & 0xfffffffd;
          local_698 = uVar30;
          FUN_140140df0(&local_410);
        }
        plVar21 = (longlong *)(ulonglong)uVar30;
        puVar23 = local_660;
        param_1 = local_668;
        if ((uVar30 & 1) != 0) {
          local_698 = uVar30 & 0xfffffffe;
          plVar21 = (longlong *)(ulonglong)local_698;
          FUN_140140df0(&local_530);
          puVar23 = local_660;
          param_1 = local_668;
        }
      }
    }
    if ((puVar23 != local_658) && (local_68c != 1)) {
      if ((local_694 != '\0') && ((plVar13 != (longlong *)0x0 && (*plVar13 != 0)))) {
        lVar24 = FUN_140142130(*plVar13,local_308);
        local_690._0_2_ = *(undefined2 *)(lVar24 + 0xc);
      }
      if (*(char *)(param_1 + 0x24d) == '\0') {
        if ((plVar13 == (longlong *)0x0) || (*plVar13 == 0)) {
          local_1e8 = 0;
          local_1e4 = 0;
          local_1e0 = 0;
          local_1dc = 0;
          pppuVar26 = (undefined ***)&local_1e8;
        }
        else {
          pppuVar26 = (undefined ***)(*plVar13 + 0x174);
        }
        if ((plVar13 == (longlong *)0x0) || (*plVar13 == 0)) {
          local_628[0] = 0;
        }
        else {
          local_628[0] = *(undefined4 *)(*plVar13 + 0x170);
        }
        local_5e8[0] = (**(code **)*puVar23)(puVar23);
        plVar14 = plVar29;
        if (local_688 != (longlong *)0x0) {
          plVar14 = (longlong *)*local_688;
        }
        local_6c0 = plVar14 + 0x1e;
        local_6b8 = &local_690;
        local_6d0 = (undefined ***)local_628;
        local_6d8 = local_670;
        local_6e0 = local_648;
        local_6e8 = local_5e8;
        local_6c8 = pppuVar26;
        (**(code **)(*(longlong *)(param_1 + 0x4a8) + 0x40))
                  ((longlong *)(param_1 + 0x4a8),local_68c,&DAT_140318cf0,plVar14);
      }
      else {
        if ((plVar13 == (longlong *)0x0) || (*plVar13 == 0)) {
          local_1b8 = 0;
          local_1b4 = 0;
          local_1b0 = 0;
          local_1ac = 0;
          puVar17 = &local_1b8;
        }
        else {
          puVar17 = (undefined4 *)(*plVar13 + 0x174);
        }
        if ((plVar13 == (longlong *)0x0) || (*plVar13 == 0)) {
          local_614 = 0;
        }
        else {
          local_614 = *(undefined4 *)(*plVar13 + 0x170);
        }
        if ((plVar13 == (longlong *)0x0) || (lVar24 = *plVar13, lVar24 == 0)) {
          local_4d0 = 0;
          local_4c8 = 0;
          local_4c0 = 0;
          local_4b8 = 0;
          local_4d8 = Proud::ByteArray::vftable;
          pppuVar26 = &local_4d8;
          uVar30 = (uint)plVar21 | 0x20;
        }
        else {
          local_558 = Proud::CFastArray<>::vftable;
          if (DAT_14030ae60 != 5) {
            FUN_140140ce0();
          }
          local_550 = *(undefined8 *)(lVar24 + 0x150);
          local_534 = *(undefined4 *)(lVar24 + 0x16c);
          local_548 = (longlong *)0x0;
          local_540 = 0;
          local_538 = 0;
          iVar9 = *(int *)(lVar24 + 0x160);
          if (iVar9 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          FUN_14003cda0(&local_558,iVar9);
          plVar14 = plVar29;
          if (*(int *)(lVar24 + 0x160) != 0) {
            plVar14 = *(longlong **)(lVar24 + 0x158);
          }
          plVar15 = local_548;
          if ((int)local_540 == 0) {
            plVar15 = plVar29;
          }
          FUN_1400224d0(plVar15,plVar14,(longlong)iVar9);
          local_558 = Proud::ByteArray::vftable;
          pppuVar26 = &local_558;
          uVar30 = (uint)plVar21 | 0x10;
        }
        if ((plVar13 == (longlong *)0x0) || (lVar24 = *plVar13, lVar24 == 0)) {
          local_430 = 0;
          local_428 = 0;
          local_420 = 0;
          local_418 = 0;
          local_438 = Proud::ByteArray::vftable;
          pppuVar25 = &local_438;
          uVar30 = uVar30 | 0x80;
        }
        else {
          local_5a8 = Proud::CFastArray<>::vftable;
          local_698 = uVar30;
          if (DAT_14030ae60 != 5) {
            FUN_140140ce0();
          }
          local_5a0 = *(undefined8 *)(lVar24 + 0x128);
          local_584 = *(undefined4 *)(lVar24 + 0x144);
          local_598 = (longlong *)0x0;
          local_590 = 0;
          local_588 = 0;
          iVar9 = *(int *)(lVar24 + 0x138);
          if (iVar9 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          FUN_14003cda0(&local_5a8,iVar9);
          plVar21 = plVar29;
          if (*(int *)(lVar24 + 0x138) != 0) {
            plVar21 = *(longlong **)(lVar24 + 0x130);
          }
          plVar14 = local_598;
          if ((int)local_590 == 0) {
            plVar14 = plVar29;
          }
          FUN_1400224d0(plVar14,plVar21,(longlong)iVar9);
          local_5a8 = Proud::ByteArray::vftable;
          pppuVar25 = &local_5a8;
          uVar30 = uVar30 | 0x40;
        }
        local_698 = uVar30;
        local_5d0[0] = (**(code **)*local_660)();
        plVar21 = plVar29;
        if (local_688 != (longlong *)0x0) {
          plVar21 = (longlong *)*local_688;
        }
        local_6b0 = plVar21 + 0x1e;
        local_6a8 = (undefined2 *)&local_690;
        local_6c0 = (longlong *)&local_614;
        local_6d8 = local_670;
        local_6e0 = local_648;
        local_6e8 = local_5d0;
        local_6d0 = pppuVar25;
        local_6c8 = pppuVar26;
        local_6b8 = puVar17;
        (**(code **)(*(longlong *)(local_668 + 0x4a8) + 0x30))
                  ((longlong *)(local_668 + 0x4a8),local_68c,&DAT_140318db0,plVar21);
        if ((char)uVar30 < '\0') {
          uVar30 = uVar30 & 0xffffff7f;
          local_698 = uVar30;
          FUN_140140df0(&local_438);
        }
        if ((uVar30 & 0x40) != 0) {
          uVar30 = uVar30 & 0xffffffbf;
          local_698 = uVar30;
          FUN_140140df0(&local_5a8);
        }
        if ((uVar30 & 0x20) != 0) {
          uVar30 = uVar30 & 0xffffffdf;
          local_698 = uVar30;
          FUN_140140df0(&local_4d8);
        }
        if ((uVar30 & 0x10) != 0) {
          uVar30 = uVar30 & 0xffffffef;
          local_698 = uVar30;
          FUN_140140df0(&local_558);
        }
        plVar21 = (longlong *)(ulonglong)uVar30;
        param_1 = local_668;
      }
    }
    if (((*(longlong *)(param_1 + 0x17f0) != 0) && (plVar13 != (longlong *)0x0)) && (*plVar13 != 0))
    {
      FUN_1400a3440();
      local_5f0 = PTR_DAT_1402f8010;
      plVar14 = (longlong *)FUN_1400aad20(*plVar13 + 0x174,&local_5c8);
      puVar28 = (undefined *)*plVar14;
      if ((undefined *)*plVar14 == (undefined *)0x0) {
        puVar28 = PTR_DAT_1402f8010;
      }
      FUN_14003c600(&local_5f0,&DAT_140253f28,puVar28);
      puVar28 = local_5c8;
      if (((local_5c8 != (undefined *)0x0) && (local_5c8 != PTR_DAT_1402f8010)) &&
         (puVar27 = local_5c8 + -8, puVar27 != (undefined *)0x0)) {
        uVar19 = FUN_1400a3440();
        local_3d8 = uVar19;
        FUN_1400a1c30(uVar19);
        local_3d0 = 1;
        piVar1 = (int *)(puVar28 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar27);
        }
        FUN_1400d1290(uVar19);
        local_3d0 = 0;
      }
      puVar28 = local_5f0;
      puVar27 = local_5f0;
      if (local_5f0 == (undefined *)0x0) {
        puVar27 = PTR_DAT_1402f8010;
      }
      local_5c8 = PTR_DAT_1402f8010;
      FUN_1401946b0(*(undefined8 *)(param_1 + 0x17f0),1,puVar27);
      if (((puVar28 != (undefined *)0x0) && (puVar28 != PTR_DAT_1402f8010)) &&
         (puVar28 + -8 != (undefined *)0x0)) {
        dVar20 = (double)FUN_1400a3440();
        local_508 = dVar20;
        FUN_1400a1c30(dVar20);
        local_500 = 1;
        piVar1 = (int *)(puVar28 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar28 + -8);
        }
        FUN_1400d1290(dVar20);
        local_500 = 0;
      }
      local_5f0 = PTR_DAT_1402f8010;
    }
    if (plVar13 != (longlong *)0x0) {
      plVar13 = plVar13 + 1;
      *plVar13 = *plVar13 + -1;
      if (*plVar13 == 0) {
        FUN_1401462b0(local_680);
      }
      plVar21 = (longlong *)(ulonglong)local_698;
    }
    local_4f8 = plVar29;
    if (local_620 != (longlong *)0x0) {
      local_4f8 = (longlong *)local_620[3];
    }
  } while( true );
}



undefined1 FUN_140163fa0(longlong param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined4 uVar2;
  undefined1 uVar3;
  undefined8 uVar4;
  undefined **local_40 [5];
  
  plVar1 = (longlong *)(param_1 + -0xa8);
  uVar4 = (**(code **)(*plVar1 + 0x58))(plVar1);
  FUN_1400a1c30(uVar4);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*plVar1 + 200))(plVar1,L"Proud::CNetServerImpl::JoinP2PGroup");
  }
  *(int *)(param_1 + 0x16f0) = *(int *)(param_1 + 0x16f0) + 1;
  uVar2 = *(undefined4 *)(param_1 + 0x16f0);
  FUN_140145fe0(local_40,param_4);
  local_40[0] = Proud::ByteArray::vftable;
  uVar3 = FUN_1401622a0(plVar1,param_2,param_3,local_40,uVar2);
  FUN_1400d1290(uVar4);
  FUN_140140df0(param_4);
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140164080(longlong *param_1,longlong param_2,undefined8 param_3,undefined4 param_4)

{
  longlong *plVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  longlong lVar6;
  undefined1 auStack_2b8 [32];
  undefined8 *local_298;
  undefined8 *local_290;
  undefined1 local_288;
  undefined4 local_278 [2];
  longlong local_270;
  undefined4 local_268;
  undefined8 local_260;
  undefined8 local_258;
  undefined **local_250;
  undefined8 local_248;
  undefined8 local_240;
  undefined8 local_238;
  undefined8 local_230;
  undefined8 local_228;
  longlong local_220;
  ulonglong local_218;
  undefined4 local_208;
  undefined **local_200;
  undefined8 local_1f8;
  undefined8 local_1f0;
  undefined8 local_1e8;
  undefined8 local_1e0;
  undefined **local_1d0;
  undefined4 local_1c8;
  undefined2 local_1c4;
  undefined **local_1b8;
  undefined8 local_1b0;
  undefined8 local_1a8;
  undefined8 local_1a0;
  undefined8 local_198;
  undefined8 local_188;
  undefined1 local_180;
  undefined8 local_178;
  undefined1 *local_168;
  undefined1 local_160 [264];
  ulonglong local_58;
  
  local_178 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_2b8;
  uVar3 = (**(code **)(*param_1 + 0x58))();
  local_188 = uVar3;
  FUN_1400a1c30(uVar3);
  local_180 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::EnqueueHackSuspectEvent");
  }
  if (param_1[0xeb] != 0) {
    puVar5 = (undefined8 *)0x0;
    local_270 = 0;
    local_260 = 0;
    local_258 = 0;
    local_248 = 0;
    local_240 = 0;
    local_238 = 0;
    local_230 = 0;
    local_250 = Proud::ByteArray::vftable;
    local_218 = 0;
    local_220 = 0;
    local_228 = 0;
    local_1f8 = 0;
    local_1f0 = 0;
    local_1e8 = 0;
    local_1e0 = 0;
    local_200 = Proud::ByteArray::vftable;
    local_1d0 = Proud::AddrPort::vftable;
    local_1c8 = 0;
    local_1c4 = 0;
    local_1b0 = 0;
    local_1a8 = 0;
    local_1a0 = 0;
    local_198 = 0;
    local_1b8 = Proud::ByteArray::vftable;
    local_298 = (undefined8 *)FUN_1400a34c0(0x60);
    puVar4 = puVar5;
    if (local_298 != (undefined8 *)0x0) {
      puVar4 = (undefined8 *)FUN_140141470(local_298);
    }
    if (puVar4 == (undefined8 *)0x0) {
      local_298 = (undefined8 *)0x0;
    }
    else {
      puVar5 = (undefined8 *)FUN_1400a34c0(0x48);
      local_290 = puVar5;
      if (puVar5 != (undefined8 *)0x0) {
        local_298 = puVar5;
        uVar2 = FUN_1401692e0();
        FUN_1400a1b50(puVar5,uVar2,1);
      }
      local_298 = puVar5;
      FUN_1400a1c30(puVar5);
      puVar5[8] = 1;
      puVar5[7] = puVar4;
      FUN_1400d1290(puVar5);
    }
    FUN_140141570(&local_270,&local_298);
    if (puVar5 != (undefined8 *)0x0) {
      local_290 = puVar5;
      FUN_1400a1c30(puVar5);
      local_288 = 1;
      plVar1 = puVar5 + 8;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_1400d1290(puVar5);
        local_288 = 0;
        FUN_14008c910(puVar5);
      }
      else {
        FUN_1400d1290(puVar5);
      }
    }
    if (param_2 == 0) {
      local_208 = 0;
    }
    else {
      local_208 = *(undefined4 *)(param_2 + 0x6f8);
    }
    local_278[0] = 0xf;
    local_168 = local_160;
    local_268 = param_4;
    FUN_14008a6c0(&local_168,param_3,3);
    lVar6 = 0;
    if (local_270 != 0) {
      lVar6 = *(longlong *)(local_270 + 0x38);
    }
    FUN_14001f680(lVar6 + 0x10,local_168);
    if (local_168 != local_160) {
      free(local_168);
    }
    FUN_140160e20(param_1,local_278);
    FUN_140140df0(&local_1b8);
    FUN_140140df0(&local_200);
    local_290 = &local_228;
    FUN_14019a730(&local_228);
    if (local_220 != 0) {
      if ((longlong)local_218 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_218 = local_218 & 0xffffffff00000000;
    }
    FUN_140140df0(&local_250);
    FUN_14015bf40(&local_258);
    FUN_14015bec0(&local_260);
    FUN_14008c980(&local_270);
  }
  FUN_1400d1290(uVar3);
  return;
}



void FUN_140164370(longlong *param_1,undefined4 param_2)

{
  undefined8 uVar1;
  undefined4 local_128 [2];
  undefined8 local_120 [2];
  undefined8 local_110;
  undefined8 local_108;
  undefined **local_100;
  undefined8 local_f8;
  undefined8 local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  longlong local_d0;
  ulonglong local_c8;
  undefined4 local_b8;
  undefined **local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined **local_80;
  undefined4 local_78;
  undefined2 local_74;
  undefined **local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_38;
  undefined1 local_30;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  uVar1 = (**(code **)(*param_1 + 0x58))();
  local_38 = uVar1;
  FUN_1400a1c30(uVar1);
  local_30 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::EnqueueP2PGroupRemoveEvent");
  }
  if (param_1[0xeb] != 0) {
    local_120[0] = 0;
    local_110 = 0;
    local_108 = 0;
    local_f8 = 0;
    local_f0 = 0;
    local_e8 = 0;
    local_e0 = 0;
    local_100 = Proud::ByteArray::vftable;
    local_c8 = 0;
    local_d0 = 0;
    local_d8 = 0;
    local_a8 = 0;
    local_a0 = 0;
    local_98 = 0;
    local_90 = 0;
    local_b0 = Proud::ByteArray::vftable;
    local_80 = Proud::AddrPort::vftable;
    local_78 = 0;
    local_74 = 0;
    local_60 = 0;
    local_58 = 0;
    local_50 = 0;
    local_48 = 0;
    local_68 = Proud::ByteArray::vftable;
    local_128[0] = 0x11;
    local_b8 = param_2;
    FUN_140160e20(param_1,local_128);
    FUN_140140df0(&local_68);
    FUN_140140df0(&local_b0);
    FUN_14019a730(&local_d8);
    if (local_d0 != 0) {
      if ((longlong)local_c8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_c8 = local_c8 & 0xffffffff00000000;
    }
    FUN_140140df0(&local_100);
    FUN_14015bf40(&local_108);
    FUN_14015bec0(&local_110);
    FUN_14008c980(local_120);
  }
  FUN_1400d1290(uVar1);
  return;
}



void FUN_140164500(longlong *param_1,undefined8 param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 *local_res8;
  undefined8 local_res10;
  undefined8 *local_res18;
  undefined4 local_158 [2];
  longlong local_150 [2];
  undefined8 local_140;
  undefined8 local_138;
  undefined **local_130;
  undefined8 local_128;
  undefined8 local_120;
  undefined8 local_118;
  undefined8 local_110;
  undefined8 local_108;
  longlong local_100;
  ulonglong local_f8;
  undefined **local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined **local_b0;
  undefined4 local_a8;
  undefined2 local_a4;
  undefined **local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 *local_68;
  undefined1 local_60;
  undefined8 local_58;
  undefined1 local_50;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  local_res10 = param_2;
  uVar3 = (**(code **)(*param_1 + 0x58))();
  local_58 = uVar3;
  FUN_1400a1c30(uVar3);
  local_50 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::EnqueueUnitTestFailEvent");
  }
  if (param_1[0xeb] != 0) {
    puVar6 = (undefined8 *)0x0;
    local_150[0] = 0;
    local_140 = 0;
    local_138 = 0;
    local_128 = 0;
    local_120 = 0;
    local_118 = 0;
    local_110 = 0;
    local_130 = Proud::ByteArray::vftable;
    local_f8 = 0;
    local_100 = 0;
    local_108 = 0;
    local_d8 = 0;
    local_d0 = 0;
    local_c8 = 0;
    local_c0 = 0;
    local_e0 = Proud::ByteArray::vftable;
    local_b0 = Proud::AddrPort::vftable;
    local_a8 = 0;
    local_a4 = 0;
    local_90 = 0;
    local_88 = 0;
    local_80 = 0;
    local_78 = 0;
    local_98 = Proud::ByteArray::vftable;
    local_res8 = (undefined8 *)FUN_1400a34c0(0x60);
    puVar4 = puVar6;
    if (local_res8 != (undefined8 *)0x0) {
      puVar4 = (undefined8 *)FUN_140141470(local_res8);
    }
    if (puVar4 == (undefined8 *)0x0) {
      local_res8 = (undefined8 *)0x0;
      puVar5 = puVar6;
    }
    else {
      puVar5 = (undefined8 *)FUN_1400a34c0(0x48);
      local_res18 = puVar5;
      if (puVar5 != (undefined8 *)0x0) {
        local_res8 = puVar5;
        uVar2 = FUN_1401692e0();
        FUN_1400a1b50(puVar5,uVar2,1);
      }
      local_res8 = puVar5;
      FUN_1400a1c30(puVar5);
      puVar5[8] = 1;
      puVar5[7] = puVar4;
      FUN_1400d1290(puVar5);
    }
    FUN_140141570(local_150,&local_res8);
    if (puVar5 != (undefined8 *)0x0) {
      local_68 = puVar5;
      FUN_1400a1c30(puVar5);
      local_60 = 1;
      plVar1 = puVar5 + 8;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_1400d1290(puVar5);
        local_60 = 0;
        FUN_14008c910(puVar5);
      }
      else {
        FUN_1400d1290(puVar5);
      }
    }
    local_158[0] = 0x13;
    if (local_150[0] != 0) {
      puVar6 = *(undefined8 **)(local_150[0] + 0x38);
    }
    FUN_140003100(puVar6 + 2,param_2);
    FUN_140160e20(param_1,local_158);
    FUN_140140df0(&local_98);
    FUN_140140df0(&local_e0);
    local_res8 = &local_108;
    FUN_14019a730(&local_108);
    if (local_100 != 0) {
      if ((longlong)local_f8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_f8 = local_f8 & 0xffffffff00000000;
    }
    FUN_140140df0(&local_130);
    FUN_14015bf40(&local_138);
    FUN_14015bec0(&local_140);
    FUN_14008c980(local_150);
  }
  FUN_1400d1290(uVar3);
  FUN_1400031d0(param_2);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140164907)
// WARNING: Removing unreachable block (ram,0x000140164913)
// WARNING: Removing unreachable block (ram,0x000140164920)
// WARNING: Removing unreachable block (ram,0x000140164918)
// WARNING: Removing unreachable block (ram,0x000140164926)
// WARNING: Removing unreachable block (ram,0x000140164937)
// WARNING: Removing unreachable block (ram,0x000140164896)
// WARNING: Removing unreachable block (ram,0x0001401648a2)
// WARNING: Removing unreachable block (ram,0x0001401648ae)
// WARNING: Removing unreachable block (ram,0x0001401648a6)
// WARNING: Removing unreachable block (ram,0x0001401648b4)
// WARNING: Removing unreachable block (ram,0x0001401648c5)
// WARNING: Removing unreachable block (ram,0x00014016482b)
// WARNING: Removing unreachable block (ram,0x000140164837)
// WARNING: Removing unreachable block (ram,0x000140164843)
// WARNING: Removing unreachable block (ram,0x00014016483b)
// WARNING: Removing unreachable block (ram,0x000140164849)
// WARNING: Removing unreachable block (ram,0x00014016485a)
// WARNING: Removing unreachable block (ram,0x000140164824)
// WARNING: Removing unreachable block (ram,0x00014016488f)
// WARNING: Removing unreachable block (ram,0x000140164900)
// WARNING: Removing unreachable block (ram,0x0001401649b9)
// WARNING: Removing unreachable block (ram,0x0001401649c0)
// WARNING: Removing unreachable block (ram,0x0001401649d0)
// WARNING: Removing unreachable block (ram,0x0001401649dc)
// WARNING: Removing unreachable block (ram,0x0001401649d4)
// WARNING: Removing unreachable block (ram,0x0001401649e2)
// WARNING: Removing unreachable block (ram,0x0001401649f3)

void FUN_140164790(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int *piVar4;
  int *piVar5;
  undefined *puVar6;
  int iVar7;
  longlong lVar8;
  longlong lVar9;
  int iVar10;
  int *piVar11;
  undefined *local_res10;
  undefined **local_90;
  longlong *local_88;
  int *local_80;
  undefined8 local_78;
  undefined8 local_70;
  undefined **local_68;
  longlong *local_60;
  longlong local_58;
  uint local_50;
  undefined8 local_4c;
  undefined4 local_44;
  
  local_90 = Proud::CFastArray<int,0>::vftable;
  piVar5 = (int *)0x0;
  local_88 = (longlong *)0x0;
  local_80 = (int *)0x0;
  local_78 = 0;
  local_70 = 0;
  FUN_140021fb0(&local_90,1,param_3,param_4,0xfffffffffffffffe);
  lVar8 = (longlong)(int)local_78;
  piVar11 = local_80;
  if ((int)local_78 == 0) {
    piVar11 = piVar5;
  }
  *piVar11 = 5;
  if ((int)local_78 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_140021fb0(&local_90,(int)local_78 + 1);
  lVar9 = (longlong)(int)local_78;
  piVar11 = local_80;
  if ((int)local_78 == 0) {
    piVar11 = piVar5;
  }
  piVar11[lVar8] = 1;
  if ((int)local_78 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_140021fb0(&local_90,(int)local_78 + 1);
  lVar8 = (longlong)(int)local_78;
  piVar11 = local_80;
  if ((int)local_78 == 0) {
    piVar11 = piVar5;
  }
  piVar11[lVar9] = 2;
  if ((int)local_78 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_140021fb0(&local_90,(int)local_78 + 1);
  piVar11 = local_80;
  iVar7 = (int)local_78;
  piVar4 = local_80;
  if ((int)local_78 == 0) {
    piVar4 = piVar5;
  }
  piVar4[lVar8] = 4;
  local_68 = Proud::CFastArray<int,0>::vftable;
  local_60 = (longlong *)0x0;
  local_44 = 0;
  local_58 = 0;
  local_50 = 0;
  local_4c = 0;
  piVar4 = piVar5;
  while( true ) {
    lVar8 = local_58;
    iVar10 = (int)piVar4;
    iVar1 = (int)piVar5;
    if (iVar10 == iVar7) break;
    if ((iVar10 < 0) || (iVar7 <= iVar10)) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    iVar2 = piVar11[iVar10];
    if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_140021fb0(&local_68,iVar1 + 1);
    piVar5 = (int *)(ulonglong)local_50;
    lVar8 = local_58;
    if (local_50 == 0) {
      lVar8 = 0;
    }
    *(int *)(lVar8 + (longlong)iVar1 * 4) = iVar2;
    piVar4 = (int *)(ulonglong)(iVar10 + 1);
  }
  if (iVar7 == iVar1) {
    piVar5 = piVar11;
    if (iVar7 == 0) {
      piVar5 = (int *)0x0;
    }
    lVar9 = local_58;
    if (iVar1 == 0) {
      lVar9 = 0;
    }
    iVar7 = 0;
    if (0 < iVar1) {
      lVar9 = lVar9 - (longlong)piVar5;
      do {
        if (*piVar5 != *(int *)(lVar9 + (longlong)piVar5)) goto LAB_140164a6a;
        iVar7 = iVar7 + 1;
        piVar5 = piVar5 + 1;
      } while (iVar7 < iVar1);
    }
    goto LAB_140164b7d;
  }
LAB_140164a6a:
  FUN_1400a3440();
  local_res10 = PTR_DAT_1402f8010;
  iVar1 = FUN_1400a32c0(L"CFastArray iterator failed!");
  iVar10 = 0;
  iVar7 = iVar10;
  if ((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1402f8010)) {
    iVar7 = *(int *)(local_res10 + -8);
  }
  iVar3 = 0;
  iVar2 = iVar1;
  if (((iVar1 <= iVar7) && (iVar2 = iVar3, local_res10 != (undefined *)0x0)) &&
     (local_res10 != PTR_DAT_1402f8010)) {
    iVar2 = *(int *)(local_res10 + -8);
  }
  iVar7 = 1;
  if (1 < iVar2) {
    iVar7 = iVar2;
  }
  if ((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1402f8010)) {
    iVar3 = *(int *)(local_res10 + -8);
  }
  if (iVar3 < iVar7) {
    FUN_140002d50(&local_res10,iVar7);
  }
  FUN_140002e30(&local_res10);
  puVar6 = local_res10;
  if (local_res10 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar6,L"CFastArray iterator failed!",iVar1);
  puVar6 = local_res10;
  if (local_res10 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8010;
  }
  iVar1 = FUN_1400a32c0(puVar6);
  iVar7 = 0;
  if (0 < iVar1) {
    iVar7 = iVar1;
  }
  iVar1 = iVar10;
  if ((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1402f8010)) {
    iVar1 = *(int *)(local_res10 + -8);
  }
  if ((iVar7 < iVar1) || (iVar7 = iVar10, local_res10 == (undefined *)0x0)) {
LAB_140164b51:
    if (((local_res10 != PTR_DAT_1402f8010) && (local_res10 != (undefined *)0x0)) &&
       ((int *)(local_res10 + -8) != (int *)0x0)) {
      *(int *)(local_res10 + -8) = iVar7;
      *(undefined2 *)(local_res10 + (longlong)iVar7 * 2) = 0;
    }
  }
  else if (local_res10 != PTR_DAT_1402f8010) {
    iVar7 = *(int *)(local_res10 + -8);
    goto LAB_140164b51;
  }
  FUN_140164500(param_1,&local_res10);
LAB_140164b7d:
  if (lVar8 != 0) {
    if (local_60 == (longlong *)0x0) {
      FUN_1400a3530(lVar8);
    }
    else {
      (**(code **)(*local_60 + 0x18))(local_60,lVar8);
    }
  }
  if (piVar11 != (int *)0x0) {
    if (local_88 == (longlong *)0x0) {
      FUN_1400a3530(piVar11);
    }
    else {
      (**(code **)(*local_88 + 0x18))(local_88,piVar11);
    }
  }
  return;
}



void FUN_140164bf0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  int iVar4;
  undefined4 uVar5;
  uint *puVar6;
  uint *puVar7;
  uint *local_res10;
  uint *local_res18;
  undefined *local_res20;
  undefined8 uVar8;
  undefined1 local_50 [8];
  undefined1 local_48 [8];
  longlong local_40;
  undefined4 local_38;
  int local_34;
  
  uVar8 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10 = (uint *)PTR_DAT_1402f8008;
  uVar1 = FUN_1400a3360();
  if (local_res10 == (uint *)0x0) {
    uVar3 = 0;
  }
  else if (local_res10 == (uint *)PTR_DAT_1402f8008) {
    uVar3 = 0;
  }
  else {
    uVar3 = local_res10[-2];
  }
  uVar2 = uVar1;
  if ((int)uVar1 <= (int)uVar3) {
    if (local_res10 == (uint *)0x0) {
      uVar2 = 0;
    }
    else if (local_res10 == (uint *)PTR_DAT_1402f8008) {
      uVar2 = 0;
    }
    else {
      uVar2 = local_res10[-2];
    }
  }
  uVar3 = 1;
  if (1 < (int)uVar2) {
    uVar3 = uVar2;
  }
  if (local_res10 == (uint *)0x0) {
    uVar2 = 0;
  }
  else if (local_res10 == (uint *)PTR_DAT_1402f8008) {
    uVar2 = 0;
  }
  else {
    uVar2 = local_res10[-2];
  }
  if ((int)uVar3 <= (int)uVar2) goto LAB_140164d4a;
  if (local_res10 == (uint *)0x0) {
    local_res10 = (uint *)PTR_DAT_1402f8008;
  }
  if ((int)uVar3 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (uVar3 == 0) {
    FUN_14000c2a0(&local_res10);
    goto LAB_140164d4a;
  }
  if (local_res10 == (uint *)0x0) {
    uVar2 = 0;
  }
  else if (local_res10 == (uint *)PTR_DAT_1402f8008) {
    uVar2 = 0;
  }
  else {
    uVar2 = local_res10[-2];
  }
  if (uVar3 == uVar2) goto LAB_140164d4a;
  puVar6 = (uint *)FUN_1400a34c0((longlong)(int)uVar3 + 9);
  if (puVar6 != (uint *)0x0) {
    *puVar6 = 0;
    puVar6[1] = 1;
  }
  *puVar6 = uVar3;
  if (local_res10 == (uint *)0x0) {
    uVar2 = 0;
  }
  else if (local_res10 == (uint *)PTR_DAT_1402f8008) {
    uVar2 = 0;
  }
  else {
    uVar2 = local_res10[-2];
  }
  puVar7 = (uint *)PTR_DAT_1402f8008;
  if ((int)uVar3 < (int)uVar2) {
LAB_140164d26:
    if (local_res10 != (uint *)0x0) {
      puVar7 = local_res10;
    }
  }
  else {
    if (local_res10 != (uint *)0x0) {
      if (local_res10 == (uint *)PTR_DAT_1402f8008) {
        uVar3 = 0;
      }
      else {
        uVar3 = local_res10[-2];
      }
      goto LAB_140164d26;
    }
    uVar3 = 0;
  }
  FUN_1400a3390(puVar6 + 2,puVar7,uVar3,param_4,uVar8);
  FUN_14000c2a0(&local_res10);
  local_res10 = puVar6 + 2;
LAB_140164d4a:
  FUN_14000c330(&local_res10);
  puVar6 = local_res10;
  if (local_res10 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar6,&DAT_1402542a8,uVar1,param_4,uVar8);
  uVar3 = FUN_1400a3360();
  uVar1 = 0;
  if (0 < (int)uVar3) {
    uVar1 = uVar3;
  }
  if (local_res10 == (uint *)0x0) {
    uVar3 = 0;
  }
  else if (local_res10 == (uint *)PTR_DAT_1402f8008) {
    uVar3 = 0;
  }
  else {
    uVar3 = local_res10[-2];
  }
  if ((int)uVar3 <= (int)uVar1) {
    if (local_res10 == (uint *)0x0) {
      uVar1 = 0;
    }
    else if (local_res10 == (uint *)PTR_DAT_1402f8008) {
      uVar1 = 0;
    }
    else {
      uVar1 = local_res10[-2];
    }
  }
  if (((local_res10 != (uint *)PTR_DAT_1402f8008) && (local_res10 != (uint *)0x0)) &&
     (puVar6 = local_res10 + -2, puVar6 != (uint *)0x0)) {
    *puVar6 = uVar1;
    *(undefined1 *)((longlong)(int)uVar1 + 8 + (longlong)puVar6) = 0;
  }
  FUN_1400a3440();
  local_res18 = (uint *)PTR_DAT_1402f8008;
  FUN_140185560(local_50);
  FUN_140185030(local_50);
  FUN_140186cf0(local_50,&local_res10);
  FUN_140185160(local_50,0);
  thunk_FUN_140186270(local_50,&local_res18);
  puVar6 = local_res10;
  if (local_res10 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1402f8008;
  }
  if (puVar6 != local_res18) {
    puVar6 = local_res18;
    if (local_res18 == (uint *)0x0) {
      puVar6 = (uint *)PTR_DAT_1402f8008;
    }
    puVar7 = local_res10;
    if (local_res10 == (uint *)0x0) {
      puVar7 = (uint *)PTR_DAT_1402f8008;
    }
    iVar4 = FUN_1400a33c0(puVar7,puVar6);
    if (iVar4 != 0) {
      FUN_1400a3440();
      local_res20 = PTR_DAT_1402f8010;
      uVar5 = FUN_1400a32c0(L"Proud.StringA serialization failed!");
      uVar8 = FUN_140002f20(&local_res20,uVar5);
      FUN_1400a32f0(uVar8,L"Proud.StringA serialization failed!",uVar5);
      FUN_140003000(&local_res20);
      FUN_140164500(param_1,&local_res20);
    }
  }
  local_res20 = local_48;
  FUN_14019a730(local_48);
  puVar6 = local_res18;
  if (local_40 != 0) {
    if (local_34 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_38 = 0;
  }
  if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1402f8008)) &&
     (puVar7 = local_res18 + -2, puVar7 != (uint *)0x0)) {
    uVar8 = FUN_1400a3440();
    FUN_1400a1c30(uVar8);
    puVar6 = puVar6 + -1;
    *puVar6 = *puVar6 - 1;
    if (*puVar6 == 0) {
      FUN_1400a3530(puVar7);
    }
    FUN_1400d1290(uVar8);
  }
  puVar6 = local_res10;
  if (((local_res10 != (uint *)0x0) && (local_res10 != (uint *)PTR_DAT_1402f8008)) &&
     (puVar7 = local_res10 + -2, puVar7 != (uint *)0x0)) {
    local_res18 = (uint *)PTR_DAT_1402f8008;
    uVar8 = FUN_1400a3440();
    FUN_1400a1c30(uVar8);
    puVar6 = puVar6 + -1;
    *puVar6 = *puVar6 - 1;
    if (*puVar6 == 0) {
      FUN_1400a3530(puVar7);
    }
    FUN_1400d1290(uVar8);
  }
  return;
}



void FUN_140164f90(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  int iVar4;
  undefined4 uVar5;
  uint *puVar6;
  uint *puVar7;
  uint *local_res10;
  uint *local_res18;
  undefined *local_res20;
  undefined8 uVar8;
  undefined1 local_50 [8];
  undefined1 local_48 [8];
  longlong local_40;
  undefined4 local_38;
  int local_34;
  
  uVar8 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_res10 = (uint *)PTR_DAT_1402f8008;
  uVar1 = FUN_1400a3360();
  if (local_res10 == (uint *)0x0) {
    uVar3 = 0;
  }
  else if (local_res10 == (uint *)PTR_DAT_1402f8008) {
    uVar3 = 0;
  }
  else {
    uVar3 = local_res10[-2];
  }
  uVar2 = uVar1;
  if ((int)uVar1 <= (int)uVar3) {
    if (local_res10 == (uint *)0x0) {
      uVar2 = 0;
    }
    else if (local_res10 == (uint *)PTR_DAT_1402f8008) {
      uVar2 = 0;
    }
    else {
      uVar2 = local_res10[-2];
    }
  }
  uVar3 = 1;
  if (1 < (int)uVar2) {
    uVar3 = uVar2;
  }
  if (local_res10 == (uint *)0x0) {
    uVar2 = 0;
  }
  else if (local_res10 == (uint *)PTR_DAT_1402f8008) {
    uVar2 = 0;
  }
  else {
    uVar2 = local_res10[-2];
  }
  if ((int)uVar3 <= (int)uVar2) goto LAB_1401650ea;
  if (local_res10 == (uint *)0x0) {
    local_res10 = (uint *)PTR_DAT_1402f8008;
  }
  if ((int)uVar3 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (uVar3 == 0) {
    FUN_14000c2a0(&local_res10);
    goto LAB_1401650ea;
  }
  if (local_res10 == (uint *)0x0) {
    uVar2 = 0;
  }
  else if (local_res10 == (uint *)PTR_DAT_1402f8008) {
    uVar2 = 0;
  }
  else {
    uVar2 = local_res10[-2];
  }
  if (uVar3 == uVar2) goto LAB_1401650ea;
  puVar6 = (uint *)FUN_1400a34c0((longlong)(int)uVar3 + 9);
  if (puVar6 != (uint *)0x0) {
    *puVar6 = 0;
    puVar6[1] = 1;
  }
  *puVar6 = uVar3;
  if (local_res10 == (uint *)0x0) {
    uVar2 = 0;
  }
  else if (local_res10 == (uint *)PTR_DAT_1402f8008) {
    uVar2 = 0;
  }
  else {
    uVar2 = local_res10[-2];
  }
  puVar7 = (uint *)PTR_DAT_1402f8008;
  if ((int)uVar3 < (int)uVar2) {
LAB_1401650c6:
    if (local_res10 != (uint *)0x0) {
      puVar7 = local_res10;
    }
  }
  else {
    if (local_res10 != (uint *)0x0) {
      if (local_res10 == (uint *)PTR_DAT_1402f8008) {
        uVar3 = 0;
      }
      else {
        uVar3 = local_res10[-2];
      }
      goto LAB_1401650c6;
    }
    uVar3 = 0;
  }
  FUN_1400a3390(puVar6 + 2,puVar7,uVar3,param_4,uVar8);
  FUN_14000c2a0(&local_res10);
  local_res10 = puVar6 + 2;
LAB_1401650ea:
  FUN_14000c330(&local_res10);
  puVar6 = local_res10;
  if (local_res10 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar6,&DAT_1402542a8,uVar1,param_4,uVar8);
  uVar3 = FUN_1400a3360();
  uVar1 = 0;
  if (0 < (int)uVar3) {
    uVar1 = uVar3;
  }
  if (local_res10 == (uint *)0x0) {
    uVar3 = 0;
  }
  else if (local_res10 == (uint *)PTR_DAT_1402f8008) {
    uVar3 = 0;
  }
  else {
    uVar3 = local_res10[-2];
  }
  if ((int)uVar3 <= (int)uVar1) {
    if (local_res10 == (uint *)0x0) {
      uVar1 = 0;
    }
    else if (local_res10 == (uint *)PTR_DAT_1402f8008) {
      uVar1 = 0;
    }
    else {
      uVar1 = local_res10[-2];
    }
  }
  if (((local_res10 != (uint *)PTR_DAT_1402f8008) && (local_res10 != (uint *)0x0)) &&
     (puVar6 = local_res10 + -2, puVar6 != (uint *)0x0)) {
    *puVar6 = uVar1;
    *(undefined1 *)((longlong)(int)uVar1 + 8 + (longlong)puVar6) = 0;
  }
  FUN_1400a3440();
  local_res18 = (uint *)PTR_DAT_1402f8008;
  FUN_140185560(local_50);
  FUN_140185030(local_50);
  FUN_140186cf0(local_50,&local_res10);
  FUN_140185160(local_50,0);
  thunk_FUN_140186270(local_50,&local_res18);
  puVar6 = local_res10;
  if (local_res10 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1402f8008;
  }
  if (puVar6 != local_res18) {
    puVar6 = local_res18;
    if (local_res18 == (uint *)0x0) {
      puVar6 = (uint *)PTR_DAT_1402f8008;
    }
    puVar7 = local_res10;
    if (local_res10 == (uint *)0x0) {
      puVar7 = (uint *)PTR_DAT_1402f8008;
    }
    iVar4 = FUN_1400a33c0(puVar7,puVar6);
    if (iVar4 != 0) {
      FUN_1400a3440();
      local_res20 = PTR_DAT_1402f8010;
      uVar5 = FUN_1400a32c0(L"Proud.String serialization failed!");
      uVar8 = FUN_140002f20(&local_res20,uVar5);
      FUN_1400a32f0(uVar8,L"Proud.String serialization failed!",uVar5);
      FUN_140003000(&local_res20);
      FUN_140164500(param_1,&local_res20);
    }
  }
  local_res20 = local_48;
  FUN_14019a730(local_48);
  puVar6 = local_res18;
  if (local_40 != 0) {
    if (local_34 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_38 = 0;
  }
  if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1402f8008)) &&
     (puVar7 = local_res18 + -2, puVar7 != (uint *)0x0)) {
    uVar8 = FUN_1400a3440();
    FUN_1400a1c30(uVar8);
    puVar6 = puVar6 + -1;
    *puVar6 = *puVar6 - 1;
    if (*puVar6 == 0) {
      FUN_1400a3530(puVar7);
    }
    FUN_1400d1290(uVar8);
  }
  puVar6 = local_res10;
  if (((local_res10 != (uint *)0x0) && (local_res10 != (uint *)PTR_DAT_1402f8008)) &&
     (puVar7 = local_res10 + -2, puVar7 != (uint *)0x0)) {
    local_res18 = (uint *)PTR_DAT_1402f8008;
    uVar8 = FUN_1400a3440();
    FUN_1400a1c30(uVar8);
    puVar6 = puVar6 + -1;
    *puVar6 = *puVar6 - 1;
    if (*puVar6 == 0) {
      FUN_1400a3530(puVar7);
    }
    FUN_1400d1290(uVar8);
  }
  return;
}



void FUN_140165330(undefined8 param_1)

{
  undefined4 uVar1;
  undefined8 uVar2;
  undefined *local_res10;
  undefined1 local_38 [8];
  char local_30;
  char local_2f;
  char local_2e;
  undefined1 local_28 [8];
  char local_20;
  char local_1f;
  char local_1e;
  undefined1 local_18 [8];
  char local_10;
  char local_f;
  char local_e;
  
  FUN_1400a3440();
  local_res10 = PTR_DAT_1402f8008;
  uVar1 = FUN_1400a3360("1.2.3.4");
  uVar2 = FUN_14000c420(&local_res10,uVar1);
  FUN_1400a3390(uVar2,"1.2.3.4",uVar1);
  FUN_14000c510(&local_res10);
  FUN_1400a6800(local_28,&local_res10,1);
  FUN_1400a3440();
  local_res10 = PTR_DAT_1402f8008;
  uVar1 = FUN_1400a3360("1.2.3.5");
  uVar2 = FUN_14000c420(&local_res10,uVar1);
  FUN_1400a3390(uVar2,"1.2.3.5",uVar1);
  FUN_14000c510(&local_res10);
  FUN_1400a6800(local_38,&local_res10,1);
  FUN_1400a3440();
  local_res10 = PTR_DAT_1402f8008;
  uVar1 = FUN_1400a3360("5.6.7.8");
  uVar2 = FUN_14000c420(&local_res10,uVar1);
  FUN_1400a3390(uVar2,"5.6.7.8",uVar1);
  FUN_14000c510(&local_res10);
  FUN_1400a6800(local_18,&local_res10,1);
  if (((local_30 != local_20) || (local_2f != local_1f)) || (local_2e != local_1e)) {
    FUN_1400a3440();
    local_res10 = PTR_DAT_1402f8010;
    uVar1 = FUN_1400a32c0(L"AddrPort.IsSameLan fail!");
    uVar2 = FUN_140002f20(&local_res10,uVar1);
    FUN_1400a32f0(uVar2,L"AddrPort.IsSameLan fail!",uVar1);
    FUN_140003000(&local_res10);
    FUN_140164500(param_1,&local_res10);
  }
  if (((local_10 == local_30) && (local_f == local_2f)) && (local_e == local_2e)) {
    FUN_1400a3440();
    local_res10 = PTR_DAT_1402f8010;
    uVar1 = FUN_1400a32c0(L"AddrPort.IsSameLan fail!");
    uVar2 = FUN_140002f20(&local_res10,uVar1);
    FUN_1400a32f0(uVar2,L"AddrPort.IsSameLan fail!",uVar1);
    FUN_140003000(&local_res10);
    FUN_140164500(param_1,&local_res10);
  }
  return;
}



void FUN_140165530(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  undefined8 *local_res8;
  longlong *local_res10;
  undefined8 *local_res18;
  undefined4 local_158 [2];
  longlong local_150 [2];
  undefined8 local_140;
  undefined8 local_138;
  undefined **local_130;
  undefined8 local_128;
  undefined8 local_120;
  undefined8 local_118;
  undefined8 local_110;
  undefined8 local_108;
  longlong local_100;
  ulonglong local_f8;
  undefined4 local_e8;
  undefined **local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined **local_b0;
  undefined4 local_a8;
  undefined2 local_a4;
  undefined **local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 *local_68;
  undefined1 local_60;
  undefined8 local_58;
  undefined1 local_50;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  local_res10 = param_2;
  uVar4 = (**(code **)(*param_1 + 0x58))();
  local_58 = uVar4;
  FUN_1400a1c30(uVar4);
  local_50 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::EnqueError");
  }
  if (param_1[0xeb] != 0) {
    puVar7 = (undefined8 *)0x0;
    local_150[0] = 0;
    local_140 = 0;
    local_138 = 0;
    local_128 = 0;
    local_120 = 0;
    local_118 = 0;
    local_110 = 0;
    local_130 = Proud::ByteArray::vftable;
    local_f8 = 0;
    local_100 = 0;
    local_108 = 0;
    local_d8 = 0;
    local_d0 = 0;
    local_c8 = 0;
    local_c0 = 0;
    local_e0 = Proud::ByteArray::vftable;
    local_b0 = Proud::AddrPort::vftable;
    local_a8 = 0;
    local_a4 = 0;
    local_90 = 0;
    local_88 = 0;
    local_80 = 0;
    local_78 = 0;
    local_98 = Proud::ByteArray::vftable;
    local_res8 = (undefined8 *)FUN_1400a34c0(0x60);
    puVar5 = puVar7;
    if (local_res8 != (undefined8 *)0x0) {
      puVar5 = (undefined8 *)FUN_140141470(local_res8);
    }
    if (puVar5 == (undefined8 *)0x0) {
      local_res8 = (undefined8 *)0x0;
      puVar6 = puVar7;
    }
    else {
      puVar6 = (undefined8 *)FUN_1400a34c0(0x48);
      local_res18 = puVar6;
      if (puVar6 != (undefined8 *)0x0) {
        local_res8 = puVar6;
        uVar3 = FUN_1401692e0();
        FUN_1400a1b50(puVar6,uVar3,1);
      }
      local_res8 = puVar6;
      FUN_1400a1c30(puVar6);
      puVar6[8] = 1;
      puVar6[7] = puVar5;
      FUN_1400d1290(puVar6);
    }
    FUN_140141570(local_150,&local_res8);
    if (puVar6 != (undefined8 *)0x0) {
      local_68 = puVar6;
      FUN_1400a1c30(puVar6);
      local_60 = 1;
      plVar1 = puVar6 + 8;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_1400d1290(puVar6);
        local_60 = 0;
        FUN_14008c910(puVar6);
      }
      else {
        FUN_1400d1290(puVar6);
      }
    }
    local_158[0] = 0x14;
    puVar5 = puVar7;
    if (*param_2 != 0) {
      puVar5 = *(undefined8 **)(*param_2 + 0x38);
    }
    puVar6 = puVar7;
    if (local_150[0] != 0) {
      puVar6 = *(undefined8 **)(local_150[0] + 0x38);
    }
    *(undefined4 *)puVar6 = *(undefined4 *)puVar5;
    puVar5 = puVar7;
    if (*param_2 != 0) {
      puVar5 = *(undefined8 **)(*param_2 + 0x38);
    }
    puVar6 = puVar7;
    if (local_150[0] != 0) {
      puVar6 = *(undefined8 **)(local_150[0] + 0x38);
    }
    FUN_140003100(puVar6 + 2,puVar5 + 2);
    lVar2 = *param_2;
    puVar5 = puVar7;
    if (lVar2 != 0) {
      puVar5 = *(undefined8 **)(lVar2 + 0x38);
    }
    local_e8 = *(undefined4 *)((longlong)puVar5 + 0xc);
    if (lVar2 != 0) {
      puVar7 = *(undefined8 **)(lVar2 + 0x38);
    }
    local_a8 = *(undefined4 *)(puVar7 + 4);
    local_a4 = *(undefined2 *)((longlong)puVar7 + 0x24);
    FUN_140160e20(param_1,local_158);
    FUN_140140df0(&local_98);
    FUN_140140df0(&local_e0);
    local_res8 = &local_108;
    FUN_14019a730(&local_108);
    if (local_100 != 0) {
      if ((longlong)local_f8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_f8 = local_f8 & 0xffffffff00000000;
    }
    FUN_140140df0(&local_130);
    FUN_14015bf40(&local_138);
    FUN_14015bec0(&local_140);
    FUN_14008c980(local_150);
  }
  FUN_1400d1290(uVar4);
  FUN_14008c980(param_2);
  return;
}



void FUN_140165830(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  undefined8 *local_res8;
  longlong *local_res10;
  undefined8 *local_res18;
  undefined4 local_158 [2];
  longlong local_150 [2];
  undefined8 local_140;
  undefined8 local_138;
  undefined **local_130;
  undefined8 local_128;
  undefined8 local_120;
  undefined8 local_118;
  undefined8 local_110;
  undefined8 local_108;
  longlong local_100;
  ulonglong local_f8;
  undefined4 local_e8;
  undefined **local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined **local_b0;
  undefined4 local_a8;
  undefined2 local_a4;
  undefined **local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 *local_68;
  undefined1 local_60;
  undefined8 local_58;
  undefined1 local_50;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  local_res10 = param_2;
  uVar4 = (**(code **)(*param_1 + 0x58))();
  local_58 = uVar4;
  FUN_1400a1c30(uVar4);
  local_50 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::EnqueWarning");
  }
  if (param_1[0xeb] != 0) {
    puVar7 = (undefined8 *)0x0;
    local_150[0] = 0;
    local_140 = 0;
    local_138 = 0;
    local_128 = 0;
    local_120 = 0;
    local_118 = 0;
    local_110 = 0;
    local_130 = Proud::ByteArray::vftable;
    local_f8 = 0;
    local_100 = 0;
    local_108 = 0;
    local_d8 = 0;
    local_d0 = 0;
    local_c8 = 0;
    local_c0 = 0;
    local_e0 = Proud::ByteArray::vftable;
    local_b0 = Proud::AddrPort::vftable;
    local_a8 = 0;
    local_a4 = 0;
    local_90 = 0;
    local_88 = 0;
    local_80 = 0;
    local_78 = 0;
    local_98 = Proud::ByteArray::vftable;
    local_res8 = (undefined8 *)FUN_1400a34c0(0x60);
    puVar5 = puVar7;
    if (local_res8 != (undefined8 *)0x0) {
      puVar5 = (undefined8 *)FUN_140141470(local_res8);
    }
    if (puVar5 == (undefined8 *)0x0) {
      local_res8 = (undefined8 *)0x0;
      puVar6 = puVar7;
    }
    else {
      puVar6 = (undefined8 *)FUN_1400a34c0(0x48);
      local_res18 = puVar6;
      if (puVar6 != (undefined8 *)0x0) {
        local_res8 = puVar6;
        uVar3 = FUN_1401692e0();
        FUN_1400a1b50(puVar6,uVar3,1);
      }
      local_res8 = puVar6;
      FUN_1400a1c30(puVar6);
      puVar6[8] = 1;
      puVar6[7] = puVar5;
      FUN_1400d1290(puVar6);
    }
    FUN_140141570(local_150,&local_res8);
    if (puVar6 != (undefined8 *)0x0) {
      local_68 = puVar6;
      FUN_1400a1c30(puVar6);
      local_60 = 1;
      plVar1 = puVar6 + 8;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_1400d1290(puVar6);
        local_60 = 0;
        FUN_14008c910(puVar6);
      }
      else {
        FUN_1400d1290(puVar6);
      }
    }
    local_158[0] = 0x15;
    puVar5 = puVar7;
    if (*param_2 != 0) {
      puVar5 = *(undefined8 **)(*param_2 + 0x38);
    }
    puVar6 = puVar7;
    if (local_150[0] != 0) {
      puVar6 = *(undefined8 **)(local_150[0] + 0x38);
    }
    *(undefined4 *)puVar6 = *(undefined4 *)puVar5;
    puVar5 = puVar7;
    if (*param_2 != 0) {
      puVar5 = *(undefined8 **)(*param_2 + 0x38);
    }
    puVar6 = puVar7;
    if (local_150[0] != 0) {
      puVar6 = *(undefined8 **)(local_150[0] + 0x38);
    }
    FUN_140003100(puVar6 + 2,puVar5 + 2);
    lVar2 = *param_2;
    puVar5 = puVar7;
    if (lVar2 != 0) {
      puVar5 = *(undefined8 **)(lVar2 + 0x38);
    }
    local_e8 = *(undefined4 *)((longlong)puVar5 + 0xc);
    if (lVar2 != 0) {
      puVar7 = *(undefined8 **)(lVar2 + 0x38);
    }
    local_a8 = *(undefined4 *)(puVar7 + 4);
    local_a4 = *(undefined2 *)((longlong)puVar7 + 0x24);
    FUN_140160e20(param_1,local_158);
    FUN_140140df0(&local_98);
    FUN_140140df0(&local_e0);
    local_res8 = &local_108;
    FUN_14019a730(&local_108);
    if (local_100 != 0) {
      if ((longlong)local_f8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_f8 = local_f8 & 0xffffffff00000000;
    }
    FUN_140140df0(&local_130);
    FUN_14015bf40(&local_138);
    FUN_14015bec0(&local_140);
    FUN_14008c980(local_150);
  }
  FUN_1400d1290(uVar4);
  FUN_14008c980(param_2);
  return;
}



void FUN_140165b30(longlong param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined4 local_118 [2];
  undefined8 local_110 [2];
  undefined8 local_100;
  undefined8 local_f8;
  undefined **local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  longlong local_c0;
  ulonglong local_b8;
  undefined **local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined **local_70;
  undefined4 local_68;
  undefined2 local_64;
  undefined **local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x758) != 0) {
    local_110[0] = 0;
    local_100 = 0;
    local_f8 = 0;
    local_e8 = 0;
    local_e0 = 0;
    local_d8 = 0;
    local_d0 = 0;
    local_f0 = Proud::ByteArray::vftable;
    local_b8 = 0;
    local_c0 = 0;
    local_c8 = 0;
    local_98 = 0;
    local_90 = 0;
    local_88 = 0;
    local_80 = 0;
    local_a0 = Proud::ByteArray::vftable;
    local_70 = Proud::AddrPort::vftable;
    local_50 = 0;
    local_48 = 0;
    local_40 = 0;
    local_38 = 0;
    local_58 = Proud::ByteArray::vftable;
    local_118[0] = 4;
    local_68 = *(undefined4 *)(param_2 + 8);
    local_64 = *(undefined2 *)(param_2 + 0xc);
    iVar1 = *(int *)(param_3 + 0x18);
    if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_14003cda0(&local_58,iVar1);
    uVar3 = 0;
    if (*(int *)(param_3 + 0x18) != 0) {
      uVar3 = *(undefined8 *)(param_3 + 0x10);
    }
    uVar2 = local_48;
    if ((int)local_40 == 0) {
      uVar2 = 0;
    }
    FUN_1400224d0(uVar2,uVar3,(longlong)iVar1);
    FUN_140160e20(param_1,local_118);
    FUN_140140df0(&local_58);
    FUN_140140df0(&local_a0);
    FUN_14019a730(&local_c8);
    if (local_c0 != 0) {
      if ((longlong)local_b8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_b8 = local_b8 & 0xffffffff00000000;
    }
    FUN_140140df0(&local_f0);
    FUN_14015bf40(&local_f8);
    FUN_14015bec0(&local_100);
    FUN_14008c980(local_110);
  }
  return;
}



undefined8 FUN_140165cd0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined4 *puVar6;
  undefined8 uVar7;
  longlong *local_res8;
  
  uVar4 = (**(code **)(param_1[-0x15] + 0x58))
                    (param_1 + -0x15,param_2,param_3,param_4,0xfffffffffffffffe);
  FUN_1400a1c30(uVar4);
  if (DAT_140313fcf != '\0') {
    (**(code **)(param_1[-0x15] + 200))(param_1 + -0x15,L"Proud::CNetServerImpl::DestroyP2PGroup");
  }
  FUN_14015c5c0(param_1 + -0x15,&local_res8,param_2 & 0xffffffff);
  if ((local_res8 == (longlong *)0x0) || (*local_res8 == 0)) {
    if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0))
    {
      lVar5 = *local_res8;
      if (lVar5 != 0) {
        FUN_140149600(lVar5);
        FUN_1400a3530(lVar5);
      }
      FUN_1400a3530(local_res8);
    }
    FUN_1400d1290(uVar4);
    uVar4 = 0;
  }
  else {
    while( true ) {
      if (local_res8 == (longlong *)0x0) {
        lVar5 = 0;
      }
      else {
        lVar5 = *local_res8;
      }
      if (*(longlong *)(lVar5 + 0x28) == 0) break;
      if (local_res8 == (longlong *)0x0) {
        puVar6 = (undefined4 *)0x0;
      }
      else {
        puVar6 = (undefined4 *)*local_res8;
      }
      if ((*(longlong *)(puVar6 + 10) == 0) || (*(undefined4 **)(puVar6 + 6) == (undefined4 *)0x0))
      {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      (**(code **)(*param_1 + 0x128))(param_1,**(undefined4 **)(puVar6 + 6),*puVar6);
    }
    uVar3 = (param_2 & 0xffffffff) % (ulonglong)*(uint *)(param_1 + 0x70);
    if (param_1[0x6c] != 0) {
      piVar1 = *(int **)(param_1[0x6c] + uVar3 * 8);
      while( true ) {
        if ((piVar1 == (int *)0x0) || ((uint)uVar3 != (uint)piVar1[8] % *(uint *)(param_1 + 0x70)))
        goto LAB_140165e54;
        if (*piVar1 == (int)param_2) break;
        piVar1 = *(int **)(piVar1 + 4);
      }
      FUN_14015dd40(param_1 + 0x6b,piVar1,0);
      plVar2 = (longlong *)param_1[0x7a];
      lVar5 = *plVar2;
      uVar7 = (**(code **)(param_1[0xe] + 8))();
      (**(code **)(lVar5 + 0x10))(plVar2,uVar7,param_2 & 0xffffffff);
      FUN_140164370(param_1 + -0x15,param_2 & 0xffffffff);
    }
LAB_140165e54:
    if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0))
    {
      lVar5 = *local_res8;
      if (lVar5 != 0) {
        FUN_140149600(lVar5);
        FUN_1400a3530(lVar5);
      }
      FUN_1400a3530(local_res8);
    }
    FUN_1400d1290(uVar4);
    uVar4 = 1;
  }
  return uVar4;
}



undefined8 FUN_140165f00(longlong param_1,uint param_2,uint param_3)

{
  longlong *plVar1;
  longlong lVar2;
  ulonglong uVar3;
  int iVar4;
  undefined8 uVar5;
  longlong lVar6;
  uint *puVar7;
  uint *puVar8;
  uint *puVar9;
  uint *puVar10;
  uint *puVar11;
  uint uVar12;
  uint uVar13;
  longlong *plVar14;
  undefined8 uVar15;
  longlong *local_res8;
  uint local_res10 [2];
  uint local_res18 [2];
  
  plVar1 = (longlong *)(param_1 + -0xa8);
  local_res10[0] = param_2;
  local_res18[0] = param_3;
  uVar5 = (**(code **)(*plVar1 + 0x58))(plVar1);
  FUN_1400a1c30(uVar5);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*plVar1 + 200))(plVar1,L"Proud::CNetServerImpl::LeaveP2PGroup");
  }
  FUN_14015c5c0(plVar1,&local_res8,local_res18[0]);
  uVar12 = local_res10[0];
  if ((local_res8 == (longlong *)0x0) || (lVar2 = *local_res8, lVar2 == 0)) {
    if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0))
    {
      lVar2 = *local_res8;
      if (lVar2 != 0) {
        FUN_140149600(lVar2);
        FUN_1400a3530(lVar2);
      }
      FUN_1400a3530(local_res8);
    }
  }
  else {
    uVar3 = (ulonglong)local_res10[0] % (ulonglong)*(uint *)(lVar2 + 0x30);
    if ((*(longlong *)(lVar2 + 0x10) != 0) &&
       (puVar11 = *(uint **)(*(longlong *)(lVar2 + 0x10) + uVar3 * 8), puVar11 != (uint *)0x0)) {
      while( true ) {
        if ((uint)uVar3 != puVar11[10] % *(uint *)(lVar2 + 0x30)) goto LAB_1401663a6;
        if (*puVar11 == local_res10[0]) break;
        puVar11 = *(uint **)(puVar11 + 6);
        if (puVar11 == (uint *)0x0) goto LAB_1401663a6;
      }
      puVar11 = (uint *)0x0;
      plVar14 = local_res8;
      if (local_res10[0] == 1) {
        puVar10 = puVar11;
        if (plVar1 != (longlong *)0x0) {
          puVar10 = (uint *)(param_1 + 0x10);
        }
      }
      else {
        lVar6 = FUN_140146cc0(plVar1);
        if ((lVar6 == 0) ||
           (puVar10 = (uint *)(lVar6 + 0x40), (uint *)(lVar6 + 0x40) == (uint *)0x0)) {
          plVar14[1] = plVar14[1] + -1;
          if (local_res8[1] == 0) {
            lVar2 = *local_res8;
            if (lVar2 != 0) {
              FUN_140149600(lVar2);
              FUN_1400a3530(lVar2);
            }
            FUN_1400a3530(local_res8);
          }
          goto LAB_140166419;
        }
      }
      puVar9 = puVar11;
      if (*(longlong *)(lVar2 + 0x28) != 0) {
        puVar9 = *(uint **)(lVar2 + 0x18);
      }
      while( true ) {
        puVar7 = puVar11;
        if (plVar14 != (longlong *)0x0) {
          puVar7 = (uint *)*plVar14;
        }
        if (puVar9 == (uint *)0x0) break;
        if (*puVar9 != 1) {
          (**(code **)(*(longlong *)(param_1 + 0x400) + 0x80))
                    ((longlong *)(param_1 + 0x400),*puVar9,&DAT_140318cf0,local_res10,local_res18);
          plVar14 = local_res8;
          uVar12 = local_res10[0];
        }
        if ((uVar12 != 1) && (uVar12 != *puVar9)) {
          (**(code **)(*(longlong *)(param_1 + 0x400) + 0x80))
                    ((longlong *)(param_1 + 0x400),uVar12,&DAT_140318cf0,puVar9,local_res18);
          plVar14 = local_res8;
          uVar12 = local_res10[0];
        }
        puVar9 = *(uint **)(puVar9 + 6);
      }
      if ((uint *)(lVar2 + 8) != puVar7 + 2) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      uVar13 = 1;
      if (uVar12 != 1) {
        puVar9 = puVar11;
        if (plVar14 != (longlong *)0x0) {
          puVar9 = (uint *)*plVar14;
        }
        puVar7 = puVar11;
        if (*(longlong *)(puVar9 + 10) != 0) {
          puVar7 = *(uint **)(puVar9 + 6);
        }
        while( true ) {
          puVar8 = puVar11;
          if (plVar14 != (longlong *)0x0) {
            puVar8 = (uint *)*plVar14;
          }
          if (puVar7 == (uint *)0x0) break;
          iVar4 = (**(code **)**(undefined8 **)(puVar7 + 4))();
          if ((iVar4 != 1) && (iVar4 = (*(code *)**(undefined8 **)puVar10)(puVar10), iVar4 != 1)) {
            puVar8 = (uint *)(*(longlong *)(puVar7 + 4) + -0x40);
            if (*(longlong *)(puVar7 + 4) == 0) {
              puVar8 = puVar11;
            }
            FUN_14015d810(param_1 + 0x230,plVar1,puVar10 + -0x10,puVar8);
          }
          puVar7 = *(uint **)(puVar7 + 6);
          plVar14 = local_res8;
        }
        uVar13 = local_res10[0];
        if (puVar9 + 2 != puVar8 + 2) {
                    // WARNING: Subroutine does not return
          FUN_14000c6c0(0x80004005);
        }
      }
      puVar9 = puVar11;
      if (plVar14 != (longlong *)0x0) {
        puVar9 = (uint *)*plVar14;
      }
      uVar3 = (ulonglong)uVar13 % (ulonglong)puVar9[0xc];
      if (*(longlong *)(puVar9 + 4) != 0) {
        puVar7 = *(uint **)(*(longlong *)(puVar9 + 4) + uVar3 * 8);
        while( true ) {
          if ((puVar7 == (uint *)0x0) || ((uint)uVar3 != puVar7[10] % puVar9[0xc]))
          goto LAB_1401661d1;
          if (*puVar7 == uVar13) break;
          puVar7 = *(uint **)(puVar7 + 6);
        }
        FUN_1401461b0(puVar9 + 2,puVar7,0);
        plVar14 = local_res8;
        uVar13 = local_res10[0];
      }
LAB_1401661d1:
      uVar3 = (ulonglong)local_res18[0] % (ulonglong)puVar10[0xc];
      if (*(longlong *)(puVar10 + 4) != 0) {
        puVar9 = *(uint **)(*(longlong *)(puVar10 + 4) + uVar3 * 8);
        while( true ) {
          if ((puVar9 == (uint *)0x0) || ((uint)uVar3 != puVar9[8] % puVar10[0xc]))
          goto LAB_140166234;
          if (*puVar9 == local_res18[0]) break;
          puVar9 = *(uint **)(puVar9 + 4);
        }
        FUN_14015dd40(puVar10 + 2,puVar9,0);
        plVar14 = local_res8;
        uVar13 = local_res10[0];
      }
LAB_140166234:
      puVar10 = puVar11;
      if (plVar14 != (longlong *)0x0) {
        puVar10 = (uint *)*plVar14;
      }
      FUN_1401611d0(plVar1,puVar10,uVar13,0x1e);
      puVar10 = puVar11;
      if (local_res8 != (longlong *)0x0) {
        puVar10 = (uint *)*local_res8;
      }
      if ((*(longlong *)(puVar10 + 10) == 0) && (*(char *)(param_1 + 0x1758) == '\0')) {
        if (local_res8 != (longlong *)0x0) {
          puVar11 = (uint *)*local_res8;
        }
        uVar12 = *puVar11;
        uVar3 = (ulonglong)uVar12 % (ulonglong)*(uint *)(param_1 + 0x380);
        if (*(longlong *)(param_1 + 0x360) != 0) {
          puVar11 = *(uint **)(*(longlong *)(param_1 + 0x360) + uVar3 * 8);
          while( true ) {
            if ((puVar11 == (uint *)0x0) || ((uint)uVar3 != puVar11[8] % *(uint *)(param_1 + 0x380))
               ) goto LAB_140166323;
            if (*puVar11 == uVar12) break;
            puVar11 = *(uint **)(puVar11 + 4);
          }
          FUN_14015dd40(param_1 + 0x358,puVar11,0);
          plVar14 = *(longlong **)(param_1 + 0x3d0);
          lVar2 = *plVar14;
          uVar15 = (**(code **)(*(longlong *)(param_1 + 0x70) + 8))();
          (**(code **)(lVar2 + 0x10))(plVar14,uVar15,uVar12);
          FUN_140164370(plVar1,uVar12);
        }
      }
      else {
        if (local_res8 != (longlong *)0x0) {
          puVar11 = (uint *)*local_res8;
        }
        FUN_1401515f0(plVar1,puVar11);
      }
LAB_140166323:
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
        lVar2 = *local_res8;
        if (lVar2 != 0) {
          FUN_140149600(lVar2);
          FUN_1400a3530(lVar2);
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar5);
      return 1;
    }
LAB_1401663a6:
    local_res8[1] = local_res8[1] + -1;
    if (local_res8[1] == 0) {
      lVar2 = *local_res8;
      if (lVar2 != 0) {
        FUN_140149600(lVar2);
        FUN_1400a3530(lVar2);
      }
      FUN_1400a3530(local_res8);
    }
  }
LAB_140166419:
  FUN_1400d1290(uVar5);
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

uint FUN_140166440(longlong param_1,undefined8 param_2,int param_3,undefined8 param_4,
                  undefined1 *param_5)

{
  longlong *plVar1;
  char cVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  undefined ***pppuVar7;
  longlong lVar8;
  undefined8 uVar9;
  uint *puVar10;
  longlong *plVar11;
  int *piVar12;
  longlong lVar13;
  void *pvVar14;
  longlong *plVar15;
  uint *puVar16;
  uint uVar17;
  int iVar18;
  uint *puVar19;
  ulonglong uVar20;
  undefined1 auStack_2e8 [32];
  undefined ***local_2c8;
  uint *local_2b8;
  longlong *local_2b0;
  undefined ***local_2a8;
  longlong local_2a0;
  undefined8 local_298;
  undefined ***local_290;
  undefined1 local_288;
  undefined **local_280;
  undefined8 local_278;
  undefined8 local_270;
  undefined8 local_268;
  undefined8 local_260;
  undefined8 local_258;
  undefined1 local_250;
  undefined8 local_248;
  undefined8 local_240;
  undefined1 local_238 [8];
  undefined **local_230 [5];
  void *local_208;
  longlong local_200;
  ulonglong local_1f8;
  undefined8 local_1f0;
  int local_1e8 [100];
  ulonglong local_58;
  
  local_240 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_2e8;
  plVar1 = (longlong *)(param_1 + -0xa8);
  local_2a0 = param_1;
  local_298 = param_4;
  local_248 = param_4;
  pppuVar7 = (undefined ***)(**(code **)(*plVar1 + 0x58))(plVar1);
  local_2a8 = pppuVar7;
  local_290 = pppuVar7;
  FUN_1400a1c30(pppuVar7);
  local_288 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*plVar1 + 200))(plVar1);
  }
  if ((param_3 < 0) || (*(longlong *)(param_1 + 0x3d0) == 0)) {
    FUN_1400d1290(pppuVar7);
  }
  else {
    if ((*(char *)(param_1 + 0x1758) != '\0') || (param_3 != 0)) {
      puVar16 = (uint *)0x0;
      local_208 = (void *)0x0;
      local_1f0 = 0;
      local_200 = 0;
      local_1f8 = 100;
      uVar6 = 0;
      if (0 < param_3) {
        FUN_140146120(&local_208,param_2,(longlong)param_3);
        FUN_1401457d0(&local_208);
        local_2b0 = (longlong *)local_200;
        pvVar14 = local_208;
        uVar20 = local_1f8;
        puVar10 = puVar16;
        if (0 < (int)local_200) {
          do {
            iVar18 = (int)puVar10;
            lVar8 = (longlong)iVar18;
            if ((iVar18 < 0) || (local_200 <= lVar8)) {
                    // WARNING: Subroutine does not return
              FUN_1400a26d0();
            }
            piVar12 = local_1e8 + lVar8;
            if (100 < uVar20) {
              piVar12 = (int *)((longlong)pvVar14 + lVar8 * 4);
            }
            if (*piVar12 != 1) {
              lVar8 = FUN_140146cc0(plVar1);
              if (lVar8 == 0) {
                if (100 < uVar20) {
                  operator_delete__(pvVar14);
                }
                FUN_1400d1290(local_2a8);
                param_4 = local_298;
                goto LAB_140166b3d;
              }
              cVar2 = FUN_1401964b0(lVar8 + 0x288);
              if ((cVar2 != '\0') &&
                 ((pvVar14 = local_208, uVar20 = local_1f8, *(char *)(lVar8 + 0x680) != '\0' ||
                  (*(int *)(lVar8 + 0x670) != 0)))) goto LAB_14016684d;
              FUN_1400a3440();
              local_2b8 = (uint *)PTR_DAT_1402f8010;
              uVar3 = FUN_1400a32c0(&DAT_1402545f0);
              puVar10 = puVar16;
              if ((local_2b8 != (uint *)0x0) &&
                 (puVar10 = (uint *)0x0, local_2b8 != (uint *)PTR_DAT_1402f8010)) {
                puVar10 = (uint *)(ulonglong)local_2b8[-2];
              }
              uVar4 = 0;
              uVar5 = uVar3;
              if ((((int)uVar3 <= (int)puVar10) && (uVar5 = uVar6, local_2b8 != (uint *)0x0)) &&
                 (uVar5 = uVar4, local_2b8 != (uint *)PTR_DAT_1402f8010)) {
                uVar5 = local_2b8[-2];
              }
              uVar17 = 1;
              if (1 < (int)uVar5) {
                uVar17 = uVar5;
              }
              uVar5 = uVar4;
              if ((local_2b8 != (uint *)0x0) && (local_2b8 != (uint *)PTR_DAT_1402f8010)) {
                uVar5 = local_2b8[-2];
              }
              if ((int)uVar5 < (int)uVar17) {
                if (local_2b8 == (uint *)0x0) {
                  local_2b8 = (uint *)PTR_DAT_1402f8010;
                }
                if ((int)uVar17 < 0) {
                    // WARNING: Subroutine does not return
                  FUN_1400a26d0();
                }
                if (uVar17 == 0) {
                  FUN_1400031d0(&local_2b8);
                }
                else {
                  uVar5 = uVar6;
                  if ((local_2b8 != (uint *)0x0) && (local_2b8 != (uint *)PTR_DAT_1402f8010)) {
                    uVar5 = local_2b8[-2];
                  }
                  if (uVar17 != uVar5) {
                    puVar10 = (uint *)FUN_1400a34c0((longlong)(int)uVar17 * 2 + 10);
                    if (puVar10 != (uint *)0x0) {
                      *puVar10 = 0;
                      puVar10[1] = 1;
                    }
                    *puVar10 = uVar17;
                    uVar5 = uVar6;
                    if ((local_2b8 != (uint *)0x0) && (local_2b8 != (uint *)PTR_DAT_1402f8010)) {
                      uVar5 = local_2b8[-2];
                    }
                    puVar19 = (uint *)PTR_DAT_1402f8010;
                    if ((int)uVar17 < (int)uVar5) {
LAB_1401666d4:
                      if (local_2b8 != (uint *)0x0) {
                        puVar19 = local_2b8;
                      }
                    }
                    else {
                      uVar17 = uVar6;
                      if (local_2b8 != (uint *)0x0) {
                        if (local_2b8 != (uint *)PTR_DAT_1402f8010) {
                          uVar17 = local_2b8[-2];
                        }
                        goto LAB_1401666d4;
                      }
                    }
                    FUN_1400a32f0(puVar10 + 2,puVar19,uVar17);
                    FUN_1400031d0(&local_2b8);
                    local_2b8 = puVar10 + 2;
                  }
                }
              }
              FUN_140002e30(&local_2b8);
              puVar10 = local_2b8;
              if (local_2b8 == (uint *)0x0) {
                puVar10 = (uint *)PTR_DAT_1402f8010;
              }
              FUN_1400a32f0(puVar10,&DAT_1402545f0,uVar3);
              puVar10 = local_2b8;
              if (local_2b8 == (uint *)0x0) {
                puVar10 = (uint *)PTR_DAT_1402f8010;
              }
              uVar5 = FUN_1400a32c0(puVar10);
              uVar3 = 0;
              if (0 < (int)uVar5) {
                uVar3 = uVar5;
              }
              uVar5 = uVar4;
              if ((local_2b8 != (uint *)0x0) && (local_2b8 != (uint *)PTR_DAT_1402f8010)) {
                uVar5 = local_2b8[-2];
              }
              if (((int)uVar3 < (int)uVar5) || (uVar3 = uVar4, local_2b8 == (uint *)0x0)) {
LAB_140166770:
                if (((local_2b8 != (uint *)PTR_DAT_1402f8010) && (local_2b8 != (uint *)0x0)) &&
                   (local_2b8 + -2 != (uint *)0x0)) {
                  local_2b8[-2] = uVar3;
                  *(undefined2 *)((longlong)local_2b8 + (longlong)(int)uVar3 * 2) = 0;
                }
              }
              else if (local_2b8 != (uint *)PTR_DAT_1402f8010) {
                uVar3 = local_2b8[-2];
                goto LAB_140166770;
              }
              local_278 = 0;
              local_270 = 0;
              local_268 = 0;
              local_260 = 0;
              local_280 = Proud::ByteArray::vftable;
              local_2c8 = &local_280;
              FUN_1401416a0(local_238,1,*(undefined4 *)(lVar8 + 0x6f8),&local_2b8);
              (**(code **)(*plVar1 + 0x80))(plVar1);
              FUN_140140df0(&local_280);
              puVar10 = local_2b8;
              if (((local_2b8 != (uint *)0x0) && (local_2b8 != (uint *)PTR_DAT_1402f8010)) &&
                 (puVar19 = local_2b8 + -2, puVar19 != (uint *)0x0)) {
                uVar9 = FUN_1400a3440();
                local_258 = uVar9;
                FUN_1400a1c30(uVar9);
                local_250 = 1;
                puVar10 = puVar10 + -1;
                *puVar10 = *puVar10 - 1;
                if (*puVar10 == 0) {
                  FUN_1400a3530(puVar19);
                }
                FUN_1400d1290(uVar9);
                local_250 = 0;
              }
              local_2b8 = (uint *)PTR_DAT_1402f8010;
              pvVar14 = local_208;
              uVar20 = local_1f8;
            }
LAB_14016684d:
            puVar10 = (uint *)(ulonglong)(iVar18 + 1U);
            param_1 = local_2a0;
          } while ((int)(iVar18 + 1U) < (int)local_2b0);
        }
        param_3 = (int)local_2b0;
      }
      local_2b0 = (longlong *)FUN_1400a34c0(0xf8);
      puVar10 = puVar16;
      if (local_2b0 != (longlong *)0x0) {
        puVar10 = (uint *)FUN_1401a69c0(local_2b0);
      }
      if (puVar10 == (uint *)0x0) {
        local_2b0 = (longlong *)0x0;
      }
      else {
        local_2b0 = (longlong *)FUN_1400a34c0(0x10);
        local_2b0[1] = 1;
        *local_2b0 = (longlong)puVar10;
      }
      plVar15 = local_2b0;
      plVar11 = *(longlong **)(param_1 + 0x3d0);
      puVar10 = puVar16;
      if (local_2b0 != (longlong *)0x0) {
        puVar10 = (uint *)*local_2b0;
      }
      lVar8 = *plVar11;
      uVar9 = (**(code **)(*(longlong *)(local_2a0 + 0x70) + 8))();
      uVar6 = (**(code **)(lVar8 + 8))(plVar11,uVar9);
      lVar8 = local_2a0;
      *puVar10 = uVar6;
      puVar10 = puVar16;
      if (plVar15 != (longlong *)0x0) {
        puVar10 = (uint *)*plVar15;
      }
      uVar20 = (ulonglong)*puVar10 % (ulonglong)*(uint *)(local_2a0 + 0x380);
      if (*(longlong *)(local_2a0 + 0x360) != 0) {
        for (puVar19 = *(uint **)(*(longlong *)(local_2a0 + 0x360) + uVar20 * 8);
            (puVar19 != (uint *)0x0 && ((uint)uVar20 == puVar19[8] % *(uint *)(local_2a0 + 0x380)));
            puVar19 = *(uint **)(puVar19 + 4)) {
          pppuVar7 = local_2a8;
          if (*puVar19 == *puVar10) goto LAB_140166a18;
        }
      }
      plVar11 = (longlong *)FUN_14017a620(local_2a0 + 0x358,puVar10);
      pppuVar7 = local_2a8;
      if (plVar15 != (longlong *)*plVar11) {
        if (plVar15 != (longlong *)0x0) {
          plVar15[1] = plVar15[1] + 1;
          plVar15 = local_2b0;
          pppuVar7 = local_290;
        }
        puVar10 = puVar16;
        if ((*plVar11 != 0) &&
           (*(longlong *)(*plVar11 + 8) = *(longlong *)(*plVar11 + 8) + -1, plVar15 = local_2b0,
           pppuVar7 = local_290, *(longlong *)(*plVar11 + 8) == 0)) {
          puVar10 = (uint *)*plVar11;
        }
        *plVar11 = (longlong)plVar15;
        if (puVar10 != (uint *)0x0) {
          lVar8 = *(longlong *)puVar10;
          if (lVar8 != 0) {
            FUN_140149600(lVar8);
            FUN_1400a3530(lVar8);
          }
          FUN_1400a3530(puVar10);
          lVar8 = local_2a0;
        }
      }
LAB_140166a18:
      puVar10 = puVar16;
      if (plVar15 != (longlong *)0x0) {
        puVar10 = (uint *)*plVar15;
      }
      *(undefined1 *)(puVar10 + 0x3c) = *param_5;
      *(int *)(lVar8 + 0x16f0) = *(int *)(lVar8 + 0x16f0) + 1;
      if (0 < param_3) {
        local_2a8 = local_230;
        puVar10 = puVar16;
        do {
          FUN_140145fe0(local_230,local_298);
          local_230[0] = Proud::ByteArray::vftable;
          puVar19 = puVar16;
          if (plVar15 != (longlong *)0x0) {
            puVar19 = (uint *)*plVar15;
          }
          iVar18 = (int)puVar10;
          lVar13 = (longlong)iVar18;
          if ((iVar18 < 0) || (local_200 <= lVar13)) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          if (local_1f8 < 0x65) {
            piVar12 = local_1e8 + lVar13;
          }
          else {
            piVar12 = (int *)((longlong)local_208 + lVar13 * 4);
          }
          local_2c8 = (undefined ***)CONCAT44(local_2c8._4_4_,*(undefined4 *)(lVar8 + 0x16f0));
          FUN_1401622a0(plVar1,*piVar12,*puVar19,local_230);
          puVar10 = (uint *)(ulonglong)(iVar18 + 1U);
        } while ((int)(iVar18 + 1U) < param_3);
      }
      plVar1 = local_2b0;
      if (plVar15 != (longlong *)0x0) {
        puVar16 = (uint *)*plVar15;
      }
      uVar6 = *puVar16;
      if (plVar15 != (longlong *)0x0) {
        plVar15 = plVar15 + 1;
        *plVar15 = *plVar15 + -1;
        pppuVar7 = local_290;
        if (*plVar15 == 0) {
          lVar8 = *local_2b0;
          if (lVar8 != 0) {
            FUN_140149600(lVar8);
            FUN_1400a3530(lVar8);
          }
          FUN_1400a3530(plVar1);
          pppuVar7 = local_290;
        }
      }
      if (100 < local_1f8) {
        operator_delete__(local_208);
      }
      FUN_1400d1290(pppuVar7);
      FUN_140140df0(local_298);
      return uVar6;
    }
    FUN_1400d1290(pppuVar7);
  }
LAB_140166b3d:
  FUN_140140df0(param_4);
  return 0;
}



ulonglong FUN_140166b70(longlong param_1,ulonglong param_2,undefined4 param_3,undefined4 param_4,
                       longlong param_5,undefined8 param_6,undefined4 param_7)

{
  int iVar1;
  uint uVar2;
  void *pvVar3;
  longlong lVar4;
  longlong *plVar5;
  char cVar6;
  undefined4 *puVar7;
  ulonglong *puVar8;
  undefined4 *puVar9;
  longlong lVar10;
  longlong lVar11;
  uint *puVar12;
  ulonglong uVar13;
  int *piVar14;
  undefined4 *puVar15;
  ulonglong uVar16;
  undefined8 uVar17;
  ulonglong local_res10;
  longlong *local_78;
  undefined **local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  
  puVar15 = (undefined4 *)0x0;
  local_res10 = param_2;
  if (*(longlong *)(param_2 + 0x228) == 0) {
    pvVar3 = *(void **)(param_2 + 0x228);
    if (pvVar3 != (void *)0x0) {
      FUN_140140df0((longlong)pvVar3 + 8);
      operator_delete(pvVar3);
    }
    *(undefined8 *)(param_2 + 0x228) = 0;
    puVar7 = operator_new(0x40);
    puVar9 = puVar15;
    if (puVar7 != (undefined4 *)0x0) {
      *(undefined8 *)(puVar7 + 4) = 0;
      *(undefined8 *)(puVar7 + 6) = 0;
      *(undefined8 *)(puVar7 + 8) = 0;
      *(undefined8 *)(puVar7 + 10) = 0;
      *(undefined ***)(puVar7 + 2) = Proud::ByteArray::vftable;
      *puVar7 = 0;
      puVar7[0xe] = 0;
      *(undefined8 *)(puVar7 + 0xc) = 0;
      puVar9 = puVar7;
    }
    *(undefined4 **)(param_2 + 0x228) = puVar9;
    *puVar9 = param_3;
    *(undefined4 *)(*(longlong *)(param_2 + 0x228) + 4) = param_4;
    lVar4 = *(longlong *)(param_2 + 0x228);
    iVar1 = *(int *)(param_5 + 0x18);
    if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_14003cda0(lVar4 + 8,iVar1);
    puVar9 = puVar15;
    if (*(int *)(param_5 + 0x18) != 0) {
      puVar9 = *(undefined4 **)(param_5 + 0x10);
    }
    puVar7 = puVar15;
    if (*(int *)(lVar4 + 0x20) != 0) {
      puVar7 = *(undefined4 **)(lVar4 + 0x18);
    }
    FUN_1400224d0(puVar7,puVar9,(longlong)iVar1);
    *(undefined4 *)(*(longlong *)(param_2 + 0x228) + 0x38) = param_7;
    if (*(longlong *)(param_1 + 0x17f0) != 0) {
      FUN_140194940(*(longlong *)(param_1 + 0x17f0),L"Issuedispose %dclient in %s",
                    *(undefined4 *)(param_2 + 0x6f8),param_6);
    }
  }
  uVar2 = *(uint *)(param_1 + 0x2a8);
  uVar13 = (param_2 & 0xffffffff) % (ulonglong)uVar2;
  if (*(longlong *)(param_1 + 0x288) != 0) {
    puVar8 = *(ulonglong **)(*(longlong *)(param_1 + 0x288) + uVar13 * 8);
    while ((puVar8 != (ulonglong *)0x0 && ((uint)uVar13 == (uint)puVar8[4] % uVar2))) {
      if (*puVar8 == param_2) {
        return (ulonglong)(uint)puVar8[4] / (ulonglong)uVar2;
      }
      puVar8 = (ulonglong *)puVar8[2];
    }
  }
  if (*(longlong *)(param_2 + 0x228) == 0) {
    local_60 = 0;
    local_58 = 0;
    local_50 = 0;
    local_48 = 0;
    local_68 = Proud::ByteArray::vftable;
    FUN_14015df90(param_1,param_2,0xc,7,&local_68,0);
    FUN_140140df0(&local_68);
  }
  else {
    puVar9 = *(undefined4 **)(param_2 + 0x228);
    FUN_14015df90(param_1,param_2,*puVar9,puVar9[1],puVar9 + 2,puVar9[0xe]);
  }
  uVar16 = (**(code **)(*(longlong *)(param_1 + 0x118) + 8))();
  uVar2 = *(uint *)(param_1 + 0x2a8);
  uVar13 = (param_2 & 0xffffffff) % (ulonglong)uVar2;
  lVar4 = *(longlong *)(param_1 + 0x288);
  if (lVar4 != 0) {
    puVar8 = *(ulonglong **)(lVar4 + uVar13 * 8);
    while ((puVar8 != (ulonglong *)0x0 && ((uint)uVar13 == (uint)puVar8[4] % uVar2))) {
      if (*puVar8 == param_2) goto LAB_140166e6a;
      puVar8 = (ulonglong *)puVar8[2];
    }
    if (lVar4 != 0) {
      puVar8 = *(ulonglong **)(lVar4 + uVar13 * 8);
      while ((puVar8 != (ulonglong *)0x0 && ((uint)uVar13 == (uint)puVar8[4] % uVar2))) {
        if (*puVar8 == param_2) goto LAB_140166e65;
        puVar8 = (ulonglong *)puVar8[2];
      }
      if (lVar4 != 0) goto LAB_140166e30;
    }
  }
  cVar6 = FUN_140144560(param_1 + 0x280,(ulonglong)uVar2,CONCAT71((int7)((ulonglong)lVar4 >> 8),1));
  if (cVar6 == '\0') {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x8007000e);
  }
LAB_140166e30:
  FUN_1401b2030(param_1 + 0x280);
  puVar8 = (ulonglong *)FUN_1401465e0(param_1 + 0x280,&local_res10,uVar13,param_2 & 0xffffffff);
  FUN_1401b2030(param_1 + 0x280);
LAB_140166e65:
  puVar8[1] = uVar16;
LAB_140166e6a:
  FUN_1400a88b0(*(undefined8 *)(*(longlong *)(param_2 + 0x748) + 0x110));
  plVar5 = *(longlong **)(param_2 + 0x760);
  if ((plVar5 != (longlong *)0x0) && (*plVar5 != 0)) {
    puVar9 = puVar15;
    if (plVar5 != (longlong *)0x0) {
      puVar9 = (undefined4 *)*plVar5;
    }
    puVar7 = puVar15;
    if (*(undefined8 **)(puVar9 + 0x54) != (undefined8 *)0x0) {
      puVar7 = (undefined4 *)**(undefined8 **)(puVar9 + 0x54);
    }
    FUN_1400a88b0(puVar7);
  }
  (**(code **)(*(longlong *)(param_2 + 0xa0) + 0x40))();
  lVar4 = param_2 + 0x48;
  if (*(longlong *)(param_2 + 0x68) != 0) {
    puVar15 = *(undefined4 **)(param_2 + 0x58);
  }
  do {
    if (puVar15 == (undefined4 *)0x0) {
      FUN_14015eec0(lVar4);
      uVar13 = FUN_14015d400(param_1 + 0x2d8,param_2);
      return uVar13;
    }
    if (puVar15 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    local_78 = (longlong *)0x0;
    if (*(longlong *)(puVar15 + 2) != 0) {
      *(longlong *)(*(longlong *)(puVar15 + 2) + 8) =
           *(longlong *)(*(longlong *)(puVar15 + 2) + 8) + 1;
      local_78 = *(longlong **)(puVar15 + 2);
      param_2 = local_res10;
    }
    if (local_78 == (longlong *)0x0) {
      lVar10 = 0;
    }
    else {
      lVar10 = *local_78;
    }
    FUN_1401611d0(param_1,lVar10,*(undefined4 *)(param_2 + 0x6f8),0xb);
    if (local_78 == (longlong *)0x0) {
      lVar10 = 0;
    }
    else {
      lVar10 = *local_78;
    }
    if (*(longlong *)(lVar10 + 0x28) == 0) {
      piVar14 = (int *)0x0;
    }
    else {
      piVar14 = *(int **)(lVar10 + 0x18);
    }
    while( true ) {
      if (local_78 == (longlong *)0x0) {
        lVar11 = 0;
      }
      else {
        lVar11 = *local_78;
      }
      if (piVar14 == (int *)0x0) break;
      if (*piVar14 != 1) {
        if (local_78 == (longlong *)0x0) {
          lVar11 = 0;
        }
        else {
          lVar11 = *local_78;
        }
        (**(code **)(*(longlong *)(param_1 + 0x4a8) + 0x80))
                  ((longlong *)(param_1 + 0x4a8),*piVar14,&DAT_140318cf0,param_2 + 0x6f8,lVar11);
      }
      piVar14 = *(int **)(piVar14 + 6);
    }
    if (lVar10 + 8 != lVar11 + 8) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    if (local_78 == (longlong *)0x0) {
      lVar10 = 0;
    }
    else {
      lVar10 = *local_78;
    }
    uVar13 = (ulonglong)*(uint *)(param_2 + 0x6f8) % (ulonglong)*(uint *)(lVar10 + 0x30);
    if (*(longlong *)(lVar10 + 0x10) != 0) {
      puVar12 = *(uint **)(*(longlong *)(lVar10 + 0x10) + uVar13 * 8);
      while( true ) {
        if ((puVar12 == (uint *)0x0) || ((uint)uVar13 != puVar12[10] % *(uint *)(lVar10 + 0x30)))
        goto LAB_14016702b;
        if (*puVar12 == *(uint *)(param_2 + 0x6f8)) break;
        puVar12 = *(uint **)(puVar12 + 6);
      }
      FUN_1401461b0(lVar10 + 8,puVar12,0);
    }
LAB_14016702b:
    if (local_78 == (longlong *)0x0) {
      lVar10 = 0;
    }
    else {
      lVar10 = *local_78;
    }
    if ((*(longlong *)(lVar10 + 0x28) == 0) && (*(char *)(param_1 + 0x1800) == '\0')) {
      if (local_78 == (longlong *)0x0) {
        puVar12 = (uint *)0x0;
      }
      else {
        puVar12 = (uint *)*local_78;
      }
      uVar2 = *puVar12;
      uVar13 = (ulonglong)uVar2 % (ulonglong)*(uint *)(param_1 + 0x428);
      if (*(longlong *)(param_1 + 0x408) != 0) {
        puVar12 = *(uint **)(*(longlong *)(param_1 + 0x408) + uVar13 * 8);
        while( true ) {
          if ((puVar12 == (uint *)0x0) || ((uint)uVar13 != puVar12[8] % *(uint *)(param_1 + 0x428)))
          goto LAB_140167102;
          if (*puVar12 == uVar2) break;
          puVar12 = *(uint **)(puVar12 + 4);
        }
        FUN_14015dd40(param_1 + 0x400,puVar12,0);
        plVar5 = *(longlong **)(param_1 + 0x478);
        lVar10 = *plVar5;
        uVar17 = (**(code **)(*(longlong *)(param_1 + 0x118) + 8))();
        (**(code **)(lVar10 + 0x10))(plVar5,uVar17,uVar2);
        FUN_140164370(param_1,uVar2);
      }
    }
    else {
      if (local_78 == (longlong *)0x0) {
        lVar10 = 0;
      }
      else {
        lVar10 = *local_78;
      }
      FUN_1401515f0(param_1,lVar10);
    }
LAB_140167102:
    if (local_78 == (longlong *)0x0) {
      lVar10 = 0;
    }
    else {
      lVar10 = *local_78;
    }
    FUN_140021a40(param_2 + 0x240,*(undefined4 *)(param_2 + 600),lVar10,1);
    if (local_78 != (longlong *)0x0) {
      plVar5 = local_78 + 1;
      *plVar5 = *plVar5 + -1;
      param_2 = local_res10;
      if (*plVar5 == 0) {
        lVar10 = *local_78;
        if (lVar10 != 0) {
          FUN_140149600(lVar10);
          FUN_1400a3530(lVar10);
        }
        FUN_1400a3530(local_78);
        param_2 = local_res10;
      }
    }
    if (puVar15 != (undefined4 *)0x0) {
      puVar15 = *(undefined4 **)(puVar15 + 4);
    }
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x0001401673c0)

void FUN_1401671d0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined4 *puVar6;
  longlong lVar7;
  longlong *local_res8;
  
  uVar4 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))
                    (param_1 + -0xa8,param_2,param_3,param_4,0xfffffffffffffffe);
  FUN_1400a1c30(uVar4);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
              (param_1 + -0xa8,L"Proud::CNetServerImpl::DestroyEmptyP2PGroups");
  }
  if (*(longlong *)(param_1 + 0x378) == 0) {
    lVar7 = 0;
  }
  else {
    lVar7 = *(longlong *)(param_1 + 0x368);
  }
  while( true ) {
    if (lVar7 == 0) {
      FUN_1400d1290(uVar4);
      return;
    }
    if (lVar7 == 0) break;
    local_res8 = (longlong *)0x0;
    if (*(longlong *)(lVar7 + 8) != 0) {
      *(longlong *)(*(longlong *)(lVar7 + 8) + 8) = *(longlong *)(*(longlong *)(lVar7 + 8) + 8) + 1;
      local_res8 = *(longlong **)(lVar7 + 8);
    }
    if (local_res8 == (longlong *)0x0) {
      lVar5 = 0;
    }
    else {
      lVar5 = *local_res8;
    }
    if (*(longlong *)(lVar5 + 0x28) == 0) {
      if (local_res8 == (longlong *)0x0) {
        puVar6 = (undefined4 *)0x0;
      }
      else {
        puVar6 = (undefined4 *)*local_res8;
      }
      uVar1 = *puVar6;
      if (lVar7 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      lVar5 = *(longlong *)(lVar7 + 0x10);
      FUN_14015dd40(param_1 + 0x358,lVar7,0);
      plVar2 = *(longlong **)(param_1 + 0x3d0);
      lVar7 = *plVar2;
      uVar3 = (**(code **)(*(longlong *)(param_1 + 0x70) + 8))();
      (**(code **)(lVar7 + 0x10))(plVar2,uVar3);
      FUN_140164370(param_1 + -0xa8,uVar1);
      lVar7 = lVar5;
    }
    else if (lVar7 != 0) {
      lVar7 = *(longlong *)(lVar7 + 0x10);
    }
    if (local_res8 != (longlong *)0x0) {
      plVar2 = local_res8 + 1;
      *plVar2 = *plVar2 + -1;
      if (*plVar2 == 0) {
        lVar5 = *local_res8;
        if (lVar5 != 0) {
          FUN_140149600(lVar5);
          FUN_1400a3530(lVar5);
        }
        FUN_1400a3530(local_res8);
      }
    }
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



// WARNING: Removing unreachable block (ram,0x000140167551)
// WARNING: Removing unreachable block (ram,0x00014016755d)
// WARNING: Removing unreachable block (ram,0x000140167555)
// WARNING: Removing unreachable block (ram,0x000140167563)
// WARNING: Removing unreachable block (ram,0x0001401674f3)
// WARNING: Removing unreachable block (ram,0x0001401674ff)
// WARNING: Removing unreachable block (ram,0x0001401674f7)
// WARNING: Removing unreachable block (ram,0x000140167505)
// WARNING: Removing unreachable block (ram,0x0001401675b1)
// WARNING: Removing unreachable block (ram,0x0001401675bd)
// WARNING: Removing unreachable block (ram,0x0001401675b6)
// WARNING: Removing unreachable block (ram,0x0001401675c3)

void FUN_1401673f0(longlong *param_1)

{
  longlong *plVar1;
  undefined8 *puVar2;
  undefined4 uVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined8 uVar7;
  longlong *plVar8;
  undefined8 *puVar9;
  int *piVar10;
  int *_Buf1;
  longlong *plVar11;
  int *piVar12;
  int *_Buf2;
  uint uVar13;
  longlong lVar14;
  longlong lVar16;
  longlong *plVar17;
  longlong *plVar18;
  longlong *plVar19;
  int *piVar20;
  int iVar21;
  longlong *local_res10;
  longlong *local_res18;
  longlong *local_168;
  longlong *local_160;
  undefined **local_158;
  longlong *local_150;
  int *local_148;
  undefined8 local_140;
  undefined8 local_138;
  undefined8 local_130;
  undefined8 local_128;
  longlong local_120;
  ulonglong local_118;
  longlong *local_110;
  longlong *local_108;
  undefined4 local_fc;
  undefined8 local_f8;
  undefined8 local_f0;
  longlong local_e8;
  ulonglong local_e0;
  longlong *local_d8;
  longlong *local_d0;
  undefined4 local_c4;
  undefined **local_c0;
  longlong *local_b8;
  int *local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined1 local_98 [8];
  undefined1 local_90 [8];
  longlong local_88;
  undefined4 local_80;
  int local_7c;
  undefined8 local_70;
  undefined1 local_68;
  undefined8 local_60;
  undefined1 local_58 [32];
  longlong *plVar15;
  
  local_60 = 0xfffffffffffffffe;
  local_70 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(local_70);
  local_68 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::TestReliableUdpFrame");
  }
  uVar7 = FUN_1400a6440(local_58);
  plVar8 = (longlong *)FUN_1400a3590(0x800,uVar7);
  piVar20 = (int *)0x0;
  local_150 = (longlong *)0x0;
  local_148 = (int *)0x0;
  local_140 = 0;
  local_138 = 0;
  local_158 = Proud::CUncompressedFrameNumberArray::vftable;
  local_res18 = plVar8;
  if (plVar8 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  local_150 = plVar8;
  FUN_140143980(&local_158,1);
  lVar14 = (longlong)(int)local_140;
  piVar12 = local_148;
  if ((int)local_140 == 0) {
    piVar12 = piVar20;
  }
  *piVar12 = 5;
  if ((int)local_140 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_140143980(&local_158,(int)local_140 + 1);
  lVar16 = (longlong)(int)local_140;
  piVar12 = local_148;
  if ((int)local_140 == 0) {
    piVar12 = piVar20;
  }
  piVar12[lVar14] = 1;
  if ((int)local_140 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_140143980(&local_158,(int)local_140 + 1);
  lVar14 = (longlong)(int)local_140;
  piVar12 = local_148;
  if ((int)local_140 == 0) {
    piVar12 = piVar20;
  }
  piVar12[lVar16] = 2;
  if ((int)local_140 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_140143980(&local_158,(int)local_140 + 1);
  piVar20 = local_148;
  iVar4 = (int)local_140;
  lVar16 = (longlong)(int)local_140;
  piVar12 = local_148;
  if ((int)local_140 == 0) {
    piVar12 = (int *)0x0;
  }
  piVar12[lVar14] = 4;
  piVar12 = local_148;
  if ((int)local_140 == 0) {
    piVar12 = (int *)0x0;
  }
  FUN_140144f30(piVar12,4);
  if (iVar4 < 1) {
                    // WARNING: Subroutine does not return
    FUN_1400a2700();
  }
  if (*piVar20 == 1) {
    if (iVar4 < 2) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    if (piVar20[1] != 2) goto LAB_140167647;
    if (iVar4 < 3) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    if (piVar20[2] != 4) goto LAB_140167647;
    if (iVar4 < 4) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    if (piVar20[3] != 5) goto LAB_140167647;
  }
  else {
LAB_140167647:
    FUN_1400a3440();
    local_res10 = (longlong *)PTR_DAT_1402f8010;
    uVar3 = FUN_1400a32c0(L"Proud.QuickSort() failed!");
    uVar7 = FUN_140002f20(&local_res10,uVar3);
    FUN_1400a32f0(uVar7,L"Proud.QuickSort() failed!",uVar3);
    FUN_140003000(&local_res10);
    FUN_140164500(param_1,&local_res10);
  }
  plVar17 = (longlong *)0x0;
  local_118 = 0;
  local_120 = 0;
  local_128 = 0;
  local_110 = (longlong *)0x0;
  local_130 = 0;
  local_fc = 0;
  local_108 = plVar8;
  puVar9 = (undefined8 *)FUN_140153270(&local_168,plVar8);
  plVar1 = local_110;
  plVar11 = (longlong *)*puVar9;
  if (plVar11 != (longlong *)0x0) {
    plVar11[1] = plVar11[1] + 1;
    plVar17 = plVar11;
  }
  if (local_110 != (longlong *)0x0) {
    plVar11 = local_110 + 1;
    *plVar11 = *plVar11 + -1;
    if (*plVar11 == 0) {
      puVar2 = (undefined8 *)*local_110;
      local_res10 = local_108;
      *puVar2 = Proud::CFastArray<>::vftable;
      if (puVar2[2] != 0) {
        if ((longlong *)puVar2[1] == (longlong *)0x0) {
          FUN_1400a3530(puVar2[2]);
        }
        else {
          (**(code **)(*(longlong *)puVar2[1] + 0x18))();
        }
      }
      (**(code **)(*local_res10 + 0x18))(local_res10,puVar2);
      (**(code **)(*local_108 + 0x18))(local_108,plVar1);
    }
  }
  plVar1 = local_160;
  plVar11 = local_168;
  plVar18 = (longlong *)0x0;
  local_108 = (longlong *)puVar9[1];
  plVar15 = plVar18;
  plVar19 = plVar18;
  local_110 = plVar17;
  if (local_168 != (longlong *)0x0) {
    plVar17 = local_168 + 1;
    *plVar17 = *plVar17 + -1;
    if (*plVar17 == 0) {
      puVar9 = (undefined8 *)*local_168;
      *puVar9 = Proud::CFastArray<>::vftable;
      if (puVar9[2] != 0) {
        if ((longlong *)puVar9[1] == (longlong *)0x0) {
          FUN_1400a3530(puVar9[2]);
        }
        else {
          (**(code **)(*(longlong *)puVar9[1] + 0x18))();
        }
      }
      (**(code **)(*plVar1 + 0x18))(plVar1,puVar9);
      (**(code **)(*local_160 + 0x18))(local_160,plVar11);
    }
  }
  do {
    if (((longlong)plVar19 < 0) || (iVar4 <= (int)plVar15)) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    plVar11 = plVar18;
    if (local_110 != (longlong *)0x0) {
      plVar11 = (longlong *)*local_110;
    }
    FUN_1401a8260(plVar11,piVar20[(longlong)plVar19]);
    uVar13 = (int)plVar15 + 1;
    plVar15 = (longlong *)(ulonglong)uVar13;
    plVar19 = (longlong *)((longlong)plVar19 + 1);
  } while ((int)uVar13 < iVar4);
  FUN_140185560(local_98);
  FUN_140185030(local_98);
  plVar11 = plVar18;
  if (local_110 != (longlong *)0x0) {
    plVar11 = (longlong *)*local_110;
  }
  FUN_1401a84d0(plVar11,local_98);
  FUN_140185160(local_98,0);
  local_e0 = 0;
  local_e8 = 0;
  local_f0 = 0;
  local_d8 = (longlong *)0x0;
  local_f8 = 0;
  local_c4 = 0;
  local_d0 = plVar8;
  local_res10 = (longlong *)FUN_140153270(&local_168,plVar8);
  plVar17 = local_d0;
  plVar1 = local_d8;
  plVar11 = (longlong *)*local_res10;
  if (plVar11 != (longlong *)0x0) {
    plVar11[1] = plVar11[1] + 1;
    plVar18 = plVar11;
  }
  if (local_d8 != (longlong *)0x0) {
    plVar11 = local_d8 + 1;
    *plVar11 = *plVar11 + -1;
    if (*plVar11 == 0) {
      puVar9 = (undefined8 *)*local_d8;
      *puVar9 = Proud::CFastArray<>::vftable;
      if (puVar9[2] != 0) {
        if ((longlong *)puVar9[1] == (longlong *)0x0) {
          FUN_1400a3530(puVar9[2]);
        }
        else {
          (**(code **)(*(longlong *)puVar9[1] + 0x18))();
        }
      }
      (**(code **)(*plVar17 + 0x18))(plVar17,puVar9);
      (**(code **)(*local_d0 + 0x18))(local_d0,plVar1);
    }
  }
  plVar11 = local_160;
  piVar12 = (int *)0x0;
  local_d0 = (longlong *)local_res10[1];
  local_d8 = plVar18;
  if (local_168 != (longlong *)0x0) {
    plVar1 = local_168 + 1;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      puVar9 = (undefined8 *)*local_168;
      *puVar9 = Proud::CFastArray<>::vftable;
      if (puVar9[2] != 0) {
        if ((longlong *)puVar9[1] == (longlong *)0x0) {
          FUN_1400a3530(puVar9[2]);
        }
        else {
          (**(code **)(*(longlong *)puVar9[1] + 0x18))();
        }
      }
      (**(code **)(*plVar11 + 0x18))(plVar11,puVar9);
      (**(code **)(*local_160 + 0x18))(local_160,local_168);
    }
  }
  piVar10 = piVar12;
  if (local_d8 != (longlong *)0x0) {
    piVar10 = (int *)*local_d8;
  }
  FUN_1401a8020(piVar10,local_98);
  local_b0 = (int *)0x0;
  local_a8 = 0;
  local_a0 = 0;
  local_c0 = Proud::CUncompressedFrameNumberArray::vftable;
  piVar10 = piVar12;
  if (local_d8 != (longlong *)0x0) {
    piVar10 = (int *)*local_d8;
  }
  local_b8 = plVar8;
  FUN_1401a83b0(piVar10,&local_c0);
  piVar10 = local_b0;
  iVar21 = 0;
  if (iVar4 == (int)local_a8) {
    _Buf1 = piVar20;
    if (iVar4 == 0) {
      _Buf1 = piVar12;
    }
    _Buf2 = local_b0;
    if ((int)local_a8 == 0) {
      _Buf2 = piVar12;
    }
    iVar4 = memcmp(_Buf1,_Buf2,lVar16 << 2);
    if (iVar4 == 0) goto LAB_140167b2a;
  }
  FUN_1400a3440();
  local_res10 = (longlong *)PTR_DAT_1402f8010;
  iVar5 = FUN_1400a32c0(L"FrameNumberList pack/unpack failed!");
  iVar4 = iVar21;
  if ((local_res10 != (longlong *)0x0) && (local_res10 != (longlong *)PTR_DAT_1402f8010)) {
    iVar4 = (int)local_res10[-1];
  }
  iVar6 = iVar5;
  if (((iVar5 <= iVar4) && (iVar6 = iVar21, local_res10 != (longlong *)0x0)) &&
     (local_res10 != (longlong *)PTR_DAT_1402f8010)) {
    iVar6 = (int)local_res10[-1];
  }
  iVar4 = 1;
  if (1 < iVar6) {
    iVar4 = iVar6;
  }
  iVar6 = 0;
  iVar21 = iVar6;
  if ((local_res10 != (longlong *)0x0) && (local_res10 != (longlong *)PTR_DAT_1402f8010)) {
    iVar21 = (int)local_res10[-1];
  }
  if (iVar21 < iVar4) {
    FUN_140002d50(&local_res10);
  }
  FUN_140002e30(&local_res10);
  plVar11 = local_res10;
  if (local_res10 == (longlong *)0x0) {
    plVar11 = (longlong *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(plVar11,L"FrameNumberList pack/unpack failed!",iVar5);
  plVar11 = local_res10;
  if (local_res10 == (longlong *)0x0) {
    plVar11 = (longlong *)PTR_DAT_1402f8010;
  }
  uVar13 = FUN_1400a32c0(plVar11);
  if (0 < (int)uVar13) {
    piVar12 = (int *)(ulonglong)uVar13;
  }
  iVar4 = iVar6;
  if ((local_res10 != (longlong *)0x0) && (local_res10 != (longlong *)PTR_DAT_1402f8010)) {
    iVar4 = (int)local_res10[-1];
  }
  iVar21 = (int)piVar12;
  if (((int)piVar12 < iVar4) || (iVar21 = iVar6, local_res10 == (longlong *)0x0)) {
LAB_140167af5:
    if (((local_res10 != (longlong *)PTR_DAT_1402f8010) && (local_res10 != (longlong *)0x0)) &&
       (local_res10 + -1 != (longlong *)0x0)) {
      *(int *)(local_res10 + -1) = iVar21;
      *(undefined2 *)((longlong)local_res10 + (longlong)iVar21 * 2) = 0;
    }
  }
  else if (local_res10 != (longlong *)PTR_DAT_1402f8010) {
    iVar21 = (int)local_res10[-1];
    goto LAB_140167af5;
  }
  FUN_140164500(param_1,&local_res10);
  piVar10 = local_b0;
LAB_140167b2a:
  local_c0 = Proud::CFastArray<>::vftable;
  if (piVar10 != (int *)0x0) {
    if (local_b8 == (longlong *)0x0) {
      FUN_1400a3530(piVar10);
    }
    else {
      (**(code **)(*local_b8 + 0x18))(local_b8,piVar10);
    }
  }
  if (local_d8 != (longlong *)0x0) {
    plVar11 = local_d8 + 1;
    *plVar11 = *plVar11 + -1;
    if (*plVar11 == 0) {
      FUN_140148f80(&local_d8,local_d8);
    }
  }
  FUN_14019a730(&local_f0);
  if (local_e8 != 0) {
    if ((longlong)local_e0 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_e0 = local_e0 & 0xffffffff00000000;
  }
  FUN_14019a730(local_90);
  if (local_88 != 0) {
    if (local_7c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_80 = 0;
  }
  if (local_110 != (longlong *)0x0) {
    plVar11 = local_110 + 1;
    *plVar11 = *plVar11 + -1;
    if (*plVar11 == 0) {
      FUN_140148f80(&local_110,local_110);
    }
  }
  FUN_14019a730(&local_128);
  if (local_120 != 0) {
    if ((longlong)local_118 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_118 = local_118 & 0xffffffff00000000;
  }
  if (local_150 == (longlong *)0x0) {
    FUN_1400a3530(piVar20);
  }
  else {
    (**(code **)(*local_150 + 0x18))(local_150,piVar20);
  }
  (**(code **)*plVar8)(plVar8,1);
  FUN_1400d1290(local_70);
  return;
}



void FUN_140167c90(longlong param_1,longlong param_2)

{
  double dVar1;
  undefined **local_30;
  undefined8 local_28;
  undefined8 local_20;
  undefined8 local_18;
  undefined8 local_10;
  
  if (0.0 < *(double *)(param_2 + 0x758)) {
    dVar1 = (double)(**(code **)(*(longlong *)(param_1 + 0x118) + 8))();
    if (5.0 < dVar1 - *(double *)(param_2 + 0x758)) {
      *(undefined8 *)(param_2 + 0x758) = 0;
      local_28 = 0;
      local_20 = 0;
      local_18 = 0;
      local_10 = 0;
      local_30 = Proud::ByteArray::vftable;
      FUN_140166b70(param_1,param_2,0xc,7,&local_30,
                    L"Proud::CNetServerImpl::HardDisconnect_AutoPruneGoesTooLongClient",0);
      FUN_140140df0(&local_30);
    }
  }
  return;
}



undefined8 FUN_140167d60(longlong param_1,uint param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  uint *puVar5;
  
  uVar4 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar4);
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))();
  }
  lVar1 = *(longlong *)(param_1 + 0x20);
  uVar3 = (ulonglong)param_2 % (ulonglong)*(uint *)(lVar1 + 0xca0);
  if ((*(longlong *)(lVar1 + 0xc80) != 0) &&
     (puVar5 = *(uint **)(*(longlong *)(lVar1 + 0xc80) + uVar3 * 8), puVar5 != (uint *)0x0)) {
    while ((uint)uVar3 == puVar5[8] % *(uint *)(lVar1 + 0xca0)) {
      if (*puVar5 == param_2) {
        lVar2 = *(longlong *)(puVar5 + 2);
        if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x228) == 0)) {
          FUN_140166b70(lVar1,lVar2,0xb,3,lVar2 + 0x1f8,
                        L"Proud::CNetServerImpl::C2SStub::ShutdownTcpHandshake",0);
        }
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  FUN_1400d1290(uVar4);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x000140168069)
// WARNING: Removing unreachable block (ram,0x0001401680fd)

void FUN_140167e70(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 *puVar3;
  void *pvVar4;
  char cVar5;
  undefined8 uVar6;
  longlong lVar7;
  longlong *plVar8;
  longlong lVar9;
  int iVar10;
  ulonglong uVar11;
  uint uVar12;
  ulonglong uVar13;
  longlong *local_res8;
  undefined4 local_148;
  undefined4 uStack_144;
  undefined **local_f8;
  undefined8 local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined **local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined4 local_a8;
  undefined4 uStack_a4;
  undefined8 uStack_a0;
  undefined8 local_98;
  undefined1 local_90;
  undefined8 local_88;
  undefined1 local_80 [72];
  
  local_88 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0xb8;
  FUN_1400a1c30(lVar1);
  uStack_a0 = CONCAT44(uStack_a0._4_4_,(undefined4)uStack_a0);
  if ((*(longlong **)(param_1 + 0x6a0) != (longlong *)0x0) &&
     (uStack_a0 = CONCAT44(uStack_a0._4_4_,(undefined4)uStack_a0),
     **(longlong **)(param_1 + 0x6a0) != 0)) {
    uVar6 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
    FUN_1400a1c30(uVar6);
    if (DAT_140313fcf != '\0') {
      (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
                (param_1 + -0xa8,L"Proud::CNetServerImpl::Stop");
    }
    if ((*(longlong *)(param_1 + 0x338) != 0) && (cVar5 = FUN_14018b500(), cVar5 != '\0')) {
      FUN_1400d1290(lVar1);
      FUN_1400d1290(uVar6);
      FUN_1400a2320(local_80,L"Call Stop in UserWorker");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_80,(ThrowInfo *)&DAT_1402f4860);
    }
    FUN_1400d1290(uVar6);
    if ((*(longlong **)(param_1 + 0x6a0) != (longlong *)0x0) &&
       (**(longlong **)(param_1 + 0x6a0) != 0)) {
      FUN_1400a88b0();
    }
    uVar6 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
    FUN_1400a1c30(uVar6);
    if (DAT_140313fcf != '\0') {
      (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
                (param_1 + -0xa8,L"Proud::CNetServerImpl::Stop");
    }
    lVar9 = 0;
    if (*(longlong *)(param_1 + 0x1660) != 0) {
      lVar9 = *(longlong *)(param_1 + 0x1650);
    }
    while (lVar7 = lVar9, lVar7 != 0) {
      local_c8 = 0;
      local_c0 = 0;
      local_b8 = 0;
      local_b0 = 0;
      local_d0 = Proud::ByteArray::vftable;
      FUN_140166b70(param_1 + -0xa8);
      FUN_140140df0(&local_d0);
      lVar9 = 0;
      if (lVar7 != 0) {
        lVar9 = *(longlong *)(lVar7 + 0x18);
      }
    }
    lVar9 = 0;
    if (*(longlong *)(param_1 + 0xbf0) != 0) {
      lVar9 = *(longlong *)(param_1 + 0xbe0);
    }
    while (lVar7 = lVar9, uVar11 = 0, lVar7 != 0) {
      local_f0 = 0;
      local_e8 = 0;
      local_e0 = 0;
      local_d8 = 0;
      local_f8 = Proud::ByteArray::vftable;
      FUN_140166b70(param_1 + -0xa8);
      FUN_140140df0(&local_f8);
      lVar9 = 0;
      if (lVar7 != 0) {
        lVar9 = *(longlong *)(lVar7 + 0x10);
      }
    }
    uVar13 = uVar11;
    if (0 < *(int *)(param_1 + 0x638)) {
      do {
        lVar9 = 0;
        if (((longlong)uVar11 < 0) || (*(int *)(param_1 + 0x638) <= (int)uVar13)) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        lVar7 = *(longlong *)(param_1 + 0x630);
        local_res8 = (longlong *)0x0;
        lVar2 = *(longlong *)(lVar7 + uVar11 * 8);
        if (lVar2 != 0) {
          *(longlong *)(*(longlong *)(lVar7 + uVar11 * 8) + 8) = *(longlong *)(lVar2 + 8) + 1;
          local_res8 = *(longlong **)(lVar7 + uVar11 * 8);
        }
        lVar7 = lVar9;
        if (local_res8 != (longlong *)0x0) {
          lVar7 = *local_res8;
        }
        if (*(longlong **)(lVar7 + 0x150) != (longlong *)0x0) {
          lVar9 = **(longlong **)(lVar7 + 0x150);
        }
        FUN_1400a88b0(lVar9);
        if (local_res8 != (longlong *)0x0) {
          plVar8 = local_res8 + 1;
          *plVar8 = *plVar8 + -1;
          if (*plVar8 == 0) {
            puVar3 = (undefined8 *)*local_res8;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            FUN_1400a3530(local_res8);
          }
        }
        uVar12 = (int)uVar13 + 1;
        uVar11 = uVar11 + 1;
        uVar13 = (ulonglong)uVar12;
      } while ((int)uVar12 < *(int *)(param_1 + 0x638));
    }
    FUN_1400d1290(uVar6);
    iVar10 = 0;
    do {
      uVar6 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
      FUN_1400a1c30(uVar6);
      if (DAT_140313fcf != '\0') {
        (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
                  (param_1 + -0xa8,L"Proud::CNetServerImpl::Stop");
      }
      if (((*(longlong *)(param_1 + 0xbf0) == 0) && (*(longlong *)(param_1 + 0x1660) == 0)) &&
         (*(longlong *)(param_1 + 0x1f8) == 0)) {
        FUN_1400d1290(uVar6);
        break;
      }
      FUN_1400d1290(uVar6);
      Sleep(100);
      iVar10 = iVar10 + 1;
    } while (iVar10 < 10000);
    pvVar4 = *(void **)(param_1 + 0x338);
    if (pvVar4 != (void *)0x0) {
      FUN_14018f890(pvVar4);
      operator_delete(pvVar4);
    }
    plVar8 = (longlong *)0x0;
    *(undefined8 *)(param_1 + 0x338) = 0;
    uVar6 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
    FUN_1400a1c30(uVar6);
    if (DAT_140313fcf != '\0') {
      (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
                (param_1 + -0xa8,L"Proud::CNetServerImpl::Stop");
    }
    pvVar4 = *(void **)(param_1 + 0x6e0);
    if (pvVar4 != (void *)0x0) {
      FUN_1400acbf0(pvVar4);
      operator_delete(pvVar4);
    }
    *(undefined8 *)(param_1 + 0x6e0) = 0;
    pvVar4 = *(void **)(param_1 + 0x6e8);
    if (pvVar4 != (void *)0x0) {
      FUN_1400acbf0(pvVar4);
      operator_delete(pvVar4);
    }
    *(undefined8 *)(param_1 + 0x6e8) = 0;
    FUN_1400ad750(param_1 + 0x6b8);
    if (*(longlong *)(param_1 + 0x6a0) != 0) {
      *(longlong *)(*(longlong *)(param_1 + 0x6a0) + 8) =
           *(longlong *)(*(longlong *)(param_1 + 0x6a0) + 8) + -1;
      if (*(longlong *)(*(longlong *)(param_1 + 0x6a0) + 8) == 0) {
        plVar8 = *(longlong **)(param_1 + 0x6a0);
      }
      *(undefined8 *)(param_1 + 0x6a0) = 0;
      if (plVar8 != (longlong *)0x0) {
        lVar9 = *plVar8;
        if (lVar9 != 0) {
          FUN_1400a8cc0(lVar9);
          FUN_1400a3530(lVar9);
        }
        FUN_1400a3530(plVar8);
      }
    }
    lVar9 = *(longlong *)(param_1 + 0xbf0);
    while (lVar9 != 0) {
      lVar9 = 0;
      if (*(longlong *)(param_1 + 0xbf0) != 0) {
        lVar9 = *(longlong *)(param_1 + 0xbe0);
      }
      if (lVar9 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      FUN_1401540b0(param_1 + -0xa8,*(undefined8 *)(lVar9 + 8));
      lVar9 = *(longlong *)(param_1 + 0xbf0);
    }
    FUN_14019d190(param_1 + 0xbd0);
    lVar9 = *(longlong *)(param_1 + 0x1660);
    while (lVar9 != 0) {
      if (*(longlong *)(param_1 + 0x1650) == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      FUN_1401540b0(param_1 + -0xa8,*(undefined8 *)(*(longlong *)(param_1 + 0x1650) + 0x10));
      lVar9 = *(longlong *)(param_1 + 0x1660);
    }
    FUN_1401a4bc0(param_1 + 0x1640);
    lVar9 = param_1 + 0x1698;
    if (*(longlong *)(param_1 + 0x16b8) == 0) {
      plVar8 = (longlong *)0x0;
    }
    else {
      plVar8 = *(longlong **)(param_1 + 0x16a8);
    }
    local_148 = SUB84(plVar8,0);
    uStack_144 = (undefined4)((ulonglong)plVar8 >> 0x20);
    local_a8 = local_148;
    uStack_a4 = uStack_144;
    uStack_a0 = lVar9;
    for (; plVar8 != (longlong *)0x0; plVar8 = (longlong *)plVar8[2]) {
      if ((longlong *)*plVar8 != (longlong *)0x0) {
        (**(code **)(*(longlong *)*plVar8 + 8))();
      }
    }
    if (uStack_a0 != lVar9) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    FUN_14019d190(lVar9);
    FUN_14015eec0(param_1 + 0x358);
    FUN_140153020(param_1 + 0x620,0);
    FUN_140155600(param_1 + 0x648);
    FUN_1400d1290(uVar6);
    uVar6 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
    local_98 = uVar6;
    FUN_1400a1c30(uVar6);
    local_90 = 1;
    if (DAT_140313fcf != '\0') {
      (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
                (param_1 + -0xa8,L"Proud::CNetServerImpl::Stop");
    }
    FUN_14015f4c0(param_1 + 0x3b0);
    FUN_14019d190(param_1 + 0xbd0);
    FUN_140157cd0(param_1 + 0x230);
    FUN_140157cd0(param_1 + 0x288);
    FUN_1401a4bc0(param_1 + 0x1640);
    puVar3 = *(undefined8 **)(param_1 + 0x3d0);
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    *(undefined8 *)(param_1 + 0x3d0) = 0;
    puVar3 = *(undefined8 **)(param_1 + -0x50);
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    *(undefined8 *)(param_1 + -0x50) = 0;
    FUN_1400d1290(uVar6);
  }
  FUN_1400d1290(lVar1);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140168979)
// WARNING: Removing unreachable block (ram,0x00014016896e)

void FUN_140168610(longlong *param_1)

{
  longlong *plVar1;
  ulonglong uVar2;
  bool bVar3;
  bool bVar4;
  bool bVar5;
  bool bVar6;
  char cVar7;
  int iVar8;
  int iVar9;
  undefined8 uVar10;
  undefined8 uVar11;
  longlong lVar12;
  ulonglong *puVar13;
  ulonglong *puVar14;
  longlong local_b0;
  
  uVar10 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(uVar10);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::DisposeIssuedRemoteClients");
  }
  if (param_1[0x54] == 0) {
    puVar13 = (ulonglong *)0x0;
  }
  else {
    puVar13 = (ulonglong *)param_1[0x52];
  }
  do {
    if (puVar13 == (ulonglong *)0x0) {
      FUN_1400d1290(uVar10);
      return;
    }
    if (puVar13 == (ulonglong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    plVar1 = (longlong *)*puVar13;
    FUN_140167c90(param_1,plVar1);
    uVar11 = (**(code **)(plVar1[0x21] + 0x10))();
    FUN_1400a1c30(uVar11);
    local_b0 = 0;
    bVar6 = false;
    if (((longlong *)plVar1[0xe8] != (longlong *)0x0) &&
       (lVar12 = *(longlong *)plVar1[0xe8], lVar12 != 0)) {
      local_b0 = lVar12 + 0xa8;
      FUN_1400a1c30();
      bVar6 = true;
    }
    FUN_1400a1c30();
    FUN_1400a1c30();
    iVar8 = FUN_1401a1440(plVar1 + 0x18);
    if ((*(char *)(plVar1[0xe9] + 0x40) == '\0') && (*(char *)plVar1[0xe9] == '\0')) {
      bVar3 = true;
    }
    else {
      bVar3 = false;
    }
    if (((longlong *)plVar1[0xec] == (longlong *)0x0) ||
       (lVar12 = *(longlong *)plVar1[0xec], lVar12 == 0)) {
LAB_1401687e5:
      bVar4 = true;
    }
    else {
      if (*(char *)(lVar12 + 0x140) == '\0') {
        if ((longlong *)plVar1[0xec] == (longlong *)0x0) {
          lVar12 = 0;
        }
        else {
          lVar12 = *(longlong *)plVar1[0xec];
        }
        if (*(char *)(lVar12 + 0x100) == '\0') {
          if ((longlong *)plVar1[0xec] == (longlong *)0x0) {
            lVar12 = 0;
          }
          else {
            lVar12 = *(longlong *)plVar1[0xec];
          }
          iVar9 = FUN_1401a1440(lVar12 + 0x40);
          if (iVar9 == 0) goto LAB_1401687e5;
        }
      }
      bVar4 = false;
    }
    if (((plVar1[4] == 0) && (cVar7 = (**(code **)(plVar1[1] + 0x18))(), cVar7 == '\0')) &&
       (plVar1[0x24] == 0)) {
      bVar5 = false;
    }
    else {
      bVar5 = true;
    }
    FUN_1400d1290(uVar11);
    if (((iVar8 != 0) || (!bVar3)) || ((!bVar4 || (bVar5)))) {
      puVar14 = (ulonglong *)puVar13[2];
    }
    else {
      FUN_1401540b0(param_1,plVar1);
      puVar14 = (ulonglong *)puVar13[2];
      FUN_1401455c0(param_1 + 0x50,puVar13,0);
      uVar2 = ((ulonglong)plVar1 & 0xffffffff) % (ulonglong)*(uint *)(param_1 + 0x2ed);
      if (param_1[0x2e9] != 0) {
        puVar13 = *(ulonglong **)(param_1[0x2e9] + uVar2 * 8);
        while( true ) {
          if ((puVar13 == (ulonglong *)0x0) ||
             ((uint)uVar2 != (uint)puVar13[4] % *(uint *)(param_1 + 0x2ed))) goto LAB_1401688ef;
          if ((longlong *)*puVar13 == plVar1) break;
          puVar13 = (ulonglong *)puVar13[2];
        }
        FUN_1401455c0(param_1 + 0x2e8,puVar13,0);
      }
LAB_1401688ef:
      if (bVar6) {
        FUN_1400d1290(local_b0);
        bVar6 = false;
      }
      (**(code **)(*plVar1 + 8))(plVar1,1);
    }
    FUN_1400d1290(param_1 + 0xfa);
    FUN_1400d1290(param_1 + 0xf3);
    puVar13 = puVar14;
    if (bVar6) {
      FUN_1400d1290(local_b0);
    }
  } while( true );
}



void FUN_1401689b0(longlong *param_1)

{
  longlong *plVar1;
  void *pvVar2;
  longlong *plVar3;
  longlong lVar4;
  undefined8 *puVar5;
  
  *param_1 = (longlong)Proud::CNetServerImpl::vftable;
  param_1[0xc] = (longlong)Proud::CNetServerImpl::vftable;
  param_1[0xd] = (longlong)Proud::CNetServerImpl::vftable;
  param_1[0xe] = (longlong)Proud::CNetServerImpl::vftable;
  param_1[0xf] = (longlong)Proud::CNetServerImpl::vftable;
  param_1[0x15] = (longlong)Proud::CNetServerImpl::vftable;
  param_1[0x16] = (longlong)Proud::CNetServerImpl::vftable;
  param_1[0x17] = (longlong)Proud::CNetServerImpl::vftable;
  param_1[0x23] = (longlong)Proud::CNetServerImpl::vftable;
  param_1[0x24] = (longlong)Proud::CNetServerImpl::vftable;
  FUN_140167e70(param_1 + 0x15);
  plVar1 = param_1 + 0x25;
  FUN_1400a1c30(plVar1);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::~CNetServerImpl");
  }
  FUN_140187a60(param_1);
  FUN_1400d1290(plVar1);
  param_1[0x309] = (longlong)Proud::CFastArray<int,0>::vftable;
  if (param_1[0x30b] != 0) {
    if ((longlong *)param_1[0x30a] == (longlong *)0x0) {
      FUN_1400a3530(param_1[0x30b]);
    }
    else {
      (**(code **)(*(longlong *)param_1[0x30a] + 0x18))();
    }
  }
  FUN_1400031d0(param_1 + 0x301);
  pvVar2 = (void *)param_1[0x2fe];
  if (pvVar2 != (void *)0x0) {
    FUN_140195650(pvVar2);
    operator_delete(pvVar2);
  }
  param_1[0x2f9] = (longlong)Proud::CFastArray<int,1>::vftable;
  if (param_1[0x2fb] != 0) {
    plVar3 = (longlong *)param_1[0x2fa];
    if (plVar3 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar3 + 0x18))(plVar3,param_1[0x2fb]);
    }
  }
  param_1[0x2f4] = (longlong)Proud::CFastArray<>::vftable;
  if (param_1[0x2f6] != 0) {
    plVar3 = (longlong *)param_1[0x2f5];
    if (plVar3 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar3 + 0x18))(plVar3,param_1[0x2f6]);
    }
  }
  FUN_140148eb0(param_1 + 0x2e8);
  FUN_140148f60(param_1 + 0x2dd);
  FUN_1400acf90(param_1 + 0x19a);
  FUN_140148eb0(param_1 + 399);
  FUN_140140df0(param_1 + 0x18a);
  FUN_1401a5f40(param_1 + 0x189);
  FUN_140140df0(param_1 + 0x182);
  FUN_140143e10(param_1 + 0x105);
  FUN_140143d00(param_1 + 0x101);
  FUN_1400a1cd0(param_1 + 0xfa);
  FUN_1400a1cd0(param_1 + 0xf3);
  pvVar2 = (void *)param_1[0xf2];
  if (pvVar2 != (void *)0x0) {
    FUN_1400acbf0(pvVar2);
    operator_delete(pvVar2);
  }
  pvVar2 = (void *)param_1[0xf1];
  if (pvVar2 != (void *)0x0) {
    FUN_1400acbf0(pvVar2);
    operator_delete(pvVar2);
  }
  FUN_140148e30(param_1 + 0xea);
  if ((param_1[0xe9] != 0) &&
     (*(longlong *)(param_1[0xe9] + 8) = *(longlong *)(param_1[0xe9] + 8) + -1,
     *(longlong *)(param_1[0xe9] + 8) == 0)) {
    plVar3 = (longlong *)param_1[0xe9];
    lVar4 = *plVar3;
    if (lVar4 != 0) {
      FUN_1400a8cc0(lVar4);
      FUN_1400a3530(lVar4);
    }
    FUN_1400a3530(plVar3);
  }
  FUN_140157cb0(param_1 + 0xde);
  param_1[0xd9] = (longlong)Proud::CFastArray<>::vftable;
  if (0 < (int)param_1[0xdc]) {
    FUN_1401b3620(param_1[0xdb],(longlong)(int)param_1[0xdc]);
  }
  if (param_1[0xdb] != 0) {
    plVar3 = (longlong *)param_1[0xda];
    if (plVar3 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar3 + 0x18))(plVar3,param_1[0xdb]);
    }
  }
  FUN_140186ed0(param_1 + 0x95);
  FUN_14018a150(param_1 + 0x90);
  puVar5 = (undefined8 *)param_1[0x8f];
  if (puVar5 != (undefined8 *)0x0) {
    (**(code **)*puVar5)(puVar5,1);
  }
  FUN_14015f4c0(param_1 + 0x8b);
  puVar5 = (undefined8 *)param_1[0x8b];
  if (puVar5 != (undefined8 *)0x0) {
    (**(code **)*puVar5)(puVar5,1);
  }
  FUN_14015f210(param_1 + 0x80);
  pvVar2 = (void *)param_1[0x7c];
  if (pvVar2 != (void *)0x0) {
    FUN_14018f890(pvVar2);
    operator_delete(pvVar2);
  }
  FUN_140148f60(param_1 + 0x71);
  FUN_140158810(param_1 + 0x66);
  FUN_140158810(param_1 + 0x5b);
  FUN_140148eb0(param_1 + 0x50);
  FUN_14000c2a0(param_1 + 0x43);
  FUN_14000c2a0(param_1 + 0x42);
  FUN_1400a1cd0(param_1 + 0x2c);
  FUN_1400a1cd0(plVar1);
  param_1[0x24] = (longlong)Proud::IUserTaskQueueOwner::vftable;
  param_1[0x23] = (longlong)Proud::IVizAgentDg::vftable;
  param_1[0x17] = (longlong)Proud::CP2PGroupMemberBase_S::vftable;
  FUN_14015f210(param_1 + 0x18);
  param_1[0x16] = (longlong)Proud::ICompletionContext::vftable;
  param_1[0x15] = (longlong)Proud::IRmiHost::vftable;
  FUN_1401a7910(param_1 + 0xf);
  param_1[0xe] = (longlong)Proud::ISendDest_S::vftable;
  param_1[0xd] = (longlong)Proud::ICompletionPortEventSink::vftable;
  param_1[0xc] = (longlong)Proud::IFastSocketDelegate::vftable;
  FUN_140187700(param_1);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001401690ed)

void FUN_140168e90(longlong *param_1)

{
  int *piVar1;
  longlong *plVar2;
  undefined *puVar3;
  longlong lVar4;
  undefined4 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  longlong lVar8;
  undefined *puVar9;
  double dVar10;
  undefined *local_res8;
  undefined **local_70;
  undefined8 local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  
  uVar6 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(uVar6);
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::HeartBeat_PerClient");
  }
  dVar10 = (double)(**(code **)(param_1[0x23] + 8))();
  lVar4 = 0;
  if (param_1[0x193] != 0) {
    lVar4 = param_1[0x191];
  }
  while (lVar8 = lVar4, lVar8 != 0) {
    plVar2 = *(longlong **)(lVar8 + 8);
    if (dVar10 - (double)plVar2[0x30] < (double)param_1[0x46] ||
        dVar10 - (double)plVar2[0x30] == (double)param_1[0x46]) {
      FUN_140167c90(param_1,plVar2);
      if (((char)plVar2[0xe0] != '\0') && (DAT_1402f80f8 * 10.0 < dVar10 - (double)plVar2[0x33])) {
        (**(code **)(param_1[0x95] + 0xd0))(param_1 + 0x95,(int)plVar2[0xdf],&DAT_140318cf0);
      }
      FUN_1401513b0(param_1,plVar2,dVar10);
      FUN_140157aa0(param_1,plVar2);
    }
    else {
      if (param_1[0x2fe] != 0) {
        FUN_1400a3440();
        local_res8 = PTR_DAT_1402f8010;
        uVar5 = (**(code **)(*plVar2 + 0x10))(plVar2);
        FUN_14003c600(&local_res8,&DAT_1402546f0,uVar5);
        puVar3 = local_res8;
        puVar9 = local_res8;
        if (local_res8 == (undefined *)0x0) {
          puVar9 = PTR_DAT_1402f8010;
        }
        FUN_1401946b0(param_1[0x2fe],0,puVar9);
        if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1402f8010)) &&
           (puVar3 + -8 != (undefined *)0x0)) {
          uVar7 = FUN_1400a3440();
          FUN_1400a1c30(uVar7);
          piVar1 = (int *)(puVar3 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(puVar3 + -8);
          }
          FUN_1400d1290(uVar7);
        }
      }
      local_68 = 0;
      local_60 = 0;
      local_58 = 0;
      local_50 = 0;
      local_70 = Proud::ByteArray::vftable;
      FUN_140166b70(param_1,plVar2,0xb,7,&local_70,L"Proud::CNetServerImpl::HeartBeat_PerClient",0);
      FUN_140140df0(&local_70);
    }
    lVar4 = 0;
    if (lVar8 != 0) {
      lVar4 = *(longlong *)(lVar8 + 0x10);
    }
  }
  FUN_1400d1290(uVar6);
  return;
}



void FUN_140169130(undefined8 param_1)

{
  FUN_140165330();
  FUN_1401673f0(param_1);
  FUN_140164790(param_1);
  FUN_140164bf0(param_1);
  FUN_140164f90(param_1);
  FUN_140158740(param_1);
  FUN_140141f60(param_1);
  return;
}



void * FUN_140169180(void *param_1,uint param_2)

{
  FUN_1401689b0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



DWORD FUN_1401691b0(void)

{
  DWORD DVar1;
  
  DVar1 = GetLastError();
  if (0 < (int)DVar1) {
    DVar1 = DVar1 & 0xffff | 0x80070000;
  }
  return DVar1;
}



HANDLE FUN_1401691d0(longlong *param_1,LPCWSTR param_2,uint param_3,uint param_4,
                    LPSECURITY_ATTRIBUTES param_5,DWORD param_6,DWORD param_7,undefined8 param_8)

{
  HMODULE hModule;
  FARPROC pFVar1;
  HANDLE pvVar2;
  
  if (*param_1 == 0) {
    if ((int)param_1[1] != 0) {
      pvVar2 = CreateFileW(param_2,param_3,param_4,param_5,param_6,param_7,(HANDLE)0x0);
      return pvVar2;
    }
  }
  else {
    hModule = GetModuleHandleW(L"kernel32.dll");
    if ((hModule != (HMODULE)0x0) &&
       (pFVar1 = GetProcAddress(hModule,"CreateFileTransactedW"), pFVar1 != (FARPROC)0x0)) {
      pvVar2 = (HANDLE)(*pFVar1)(param_2,(ulonglong)param_3,(ulonglong)param_4,param_5,param_6,
                                 param_7,param_8,*param_1,0,0);
      return pvVar2;
    }
  }
  return (HANDLE)0xffffffffffffffff;
}



void FUN_1401692d0(undefined8 *param_1)

{
  *param_1 = Proud::ISendDest_C::vftable;
  return;
}



undefined8 FUN_1401692e0(void)

{
  return 0;
}



undefined8 * FUN_1401692f0(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::ISendDest_C::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140169320(undefined8 *param_1)

{
  *param_1 = Proud::IP2PGroupMember::vftable;
  return;
}



undefined8 * FUN_140169330(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::IP2PGroupMember::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140169360(undefined8 *param_1)

{
  *param_1 = Proud::IUdpPacketFragBoardDg::vftable;
  return;
}



undefined8 * FUN_140169370(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::IUdpPacketFragBoardDg::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1401693a0(undefined8 *param_1)

{
  *param_1 = Proud::IUdpPacketDefragBoardDg::vftable;
  return;
}



undefined8 * FUN_1401693b0(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::IUdpPacketDefragBoardDg::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1401693e0(undefined8 *param_1)

{
  *param_1 = Proud::CP2PConnectionTrialContext::StateBase::vftable;
  return;
}



undefined8 FUN_1401693f0(void)

{
  return 65000;
}



undefined8 FUN_140169400(void)

{
  return 0xfded;
}



void FUN_140169410(undefined8 *param_1)

{
  param_1[2] = 0;
  param_1[1] = Proud::IP2PGroupMember::vftable;
  *param_1 = Proud::ISendDest_C::vftable;
  return;
}



void FUN_140169430(void)

{
  return;
}



void thunk_FUN_140187b00(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  char cVar2;
  short sVar3;
  ushort uVar4;
  ushort uVar5;
  int iVar6;
  ushort uVar7;
  ushort uVar8;
  ushort uVar9;
  int iVar10;
  longlong lVar11;
  longlong *plStackX_10;
  undefined1 auStack_78 [80];
  
  plStackX_10 = param_2;
  cVar2 = (**(code **)(*param_1 + 0x90))();
  if (cVar2 != '\0') {
    FUN_1400a2320(auStack_78,PTR_u_Already_async_callback_may_occur_14030bd58);
                    // WARNING: Subroutine does not return
    _CxxThrowException(auStack_78,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar10 = 0;
  lVar11 = 0;
  if (0 < (int)param_1[4]) {
    do {
      if ((lVar11 < 0) || ((int)param_1[4] <= iVar10)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      plVar1 = *(longlong **)(param_1[3] + lVar11 * 8);
      iVar6 = (**(code **)*plVar1)(plVar1);
      if (0xfff9 < iVar6) {
LAB_140187ccb:
        FUN_1400a2320(auStack_78,PTR_u_Wrong_RMI_ID_is_found__RMI_ID_sh_14030bd50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(auStack_78,(ThrowInfo *)&DAT_1402f4860);
      }
      iVar6 = (**(code **)(*plVar1 + 8))(plVar1);
      if (iVar6 < 1) goto LAB_140187ccb;
      sVar3 = (**(code **)(*param_2 + 8))(param_2);
      uVar7 = sVar3 + 1;
      uVar4 = (**(code **)*param_2)(param_2);
      sVar3 = (**(code **)(*plVar1 + 8))(plVar1);
      uVar8 = sVar3 + 1;
      uVar5 = (**(code **)*plVar1)(plVar1);
      uVar9 = uVar8;
      if (uVar8 < uVar5) {
        uVar9 = uVar5;
        uVar5 = uVar8;
      }
      uVar8 = uVar7;
      if (uVar7 < uVar4) {
        uVar8 = uVar4;
        uVar4 = uVar7;
      }
      if (uVar5 < uVar4) {
LAB_140187c24:
        if ((uVar8 <= uVar9) || ((uVar4 <= uVar9 && (uVar9 <= uVar8)))) goto LAB_140187ca8;
        if (uVar4 <= uVar5) goto LAB_140187c39;
      }
      else {
        if (uVar9 <= uVar8) goto LAB_140187ca8;
        if (uVar5 <= uVar4) goto LAB_140187c24;
LAB_140187c39:
        if ((uVar5 <= uVar8) && (uVar8 <= uVar9)) {
LAB_140187ca8:
          FUN_1400a2320(auStack_78,PTR_u_Duplicated_RMI_ID_is_found__Revi_14030bd48);
                    // WARNING: Subroutine does not return
          _CxxThrowException(auStack_78,(ThrowInfo *)&DAT_1402f4860);
        }
      }
      iVar10 = iVar10 + 1;
      lVar11 = lVar11 + 1;
    } while (iVar10 < (int)param_1[4]);
  }
  param_2[1] = (longlong)param_1;
  FUN_140187480(param_1 + 1,(int)param_1[4],&plStackX_10,1);
  return;
}



void thunk_FUN_140187d00(longlong param_1,longlong *param_2)

{
  longlong *plVar1;
  short sVar2;
  ushort uVar3;
  ushort uVar4;
  longlong lVar5;
  longlong lVar6;
  int iVar7;
  ushort uVar8;
  ushort uVar9;
  ushort uVar10;
  longlong lVar11;
  int iVar12;
  longlong lVar13;
  undefined1 auStack_78 [80];
  
  iVar12 = 0;
  lVar13 = 0;
  if (0 < *(int *)(param_1 + 0x48)) {
    do {
      if ((lVar13 < 0) || (*(int *)(param_1 + 0x48) <= iVar12)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x40) + lVar13 * 8);
      sVar2 = (**(code **)(*param_2 + 8))(param_2);
      uVar10 = sVar2 + 1;
      uVar3 = (**(code **)*param_2)(param_2);
      sVar2 = (**(code **)(*plVar1 + 8))(plVar1);
      uVar8 = sVar2 + 1;
      uVar4 = (**(code **)*plVar1)(plVar1);
      uVar9 = uVar8;
      if (uVar8 < uVar4) {
        uVar9 = uVar4;
        uVar4 = uVar8;
      }
      uVar8 = uVar10;
      if (uVar10 < uVar3) {
        uVar8 = uVar3;
        uVar3 = uVar10;
      }
      if (uVar4 < uVar3) {
LAB_140187dad:
        if ((uVar8 <= uVar9) || ((uVar3 <= uVar9 && (uVar9 <= uVar8)))) goto LAB_140187e82;
        if (uVar3 <= uVar4) goto LAB_140187dca;
      }
      else {
        if (uVar9 <= uVar8) goto LAB_140187e82;
        if (uVar4 <= uVar3) goto LAB_140187dad;
LAB_140187dca:
        if ((uVar4 <= uVar8) && (uVar8 <= uVar9)) {
LAB_140187e82:
          FUN_1400a2320(auStack_78,PTR_u_Duplicated_RMI_ID_is_found__Revi_14030bd48);
                    // WARNING: Subroutine does not return
          _CxxThrowException(auStack_78,(ThrowInfo *)&DAT_1402f4860);
        }
      }
      iVar12 = iVar12 + 1;
      lVar13 = lVar13 + 1;
    } while (iVar12 < *(int *)(param_1 + 0x48));
  }
  param_2[2] = param_1;
  iVar12 = *(int *)(param_1 + 0x48);
  if (-1 < iVar12) {
    iVar7 = *(int *)(param_1 + 0x48);
    FUN_140195930(param_1 + 0x30,iVar7 + 1);
    iVar7 = iVar7 - iVar12;
    if ((0 < iVar7) && (iVar7 = iVar7 + -1, lVar13 = (longlong)iVar7, -1 < iVar7)) {
      lVar11 = (lVar13 + iVar12) * 8 + 8;
      do {
        lVar5 = FUN_1401b2160(param_1 + 0x30);
        lVar6 = FUN_1401b2160(param_1 + 0x30);
        *(undefined8 *)(lVar6 + lVar11) = *(undefined8 *)(lVar5 + -8 + lVar11);
        lVar11 = lVar11 + -8;
        lVar13 = lVar13 + -1;
      } while (-1 < lVar13);
    }
    lVar13 = FUN_1401b2160(param_1 + 0x30);
    *(longlong **)(lVar13 + (longlong)iVar12 * 8) = param_2;
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void thunk_FUN_140186ed0(void)

{
  FUN_140186ed0();
  return;
}



undefined8 FUN_140169470(void)

{
  return 0xfc08;
}



undefined8 FUN_140169480(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x1580);
}



void FUN_140169490(longlong param_1,double param_2)

{
  undefined1 local_58 [88];
  
  if (param_2 <= 0.0) {
    FUN_1400a2320(local_58,L"Invalid parameter!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  *(double *)(param_1 + 0x1728) = param_2;
  return;
}



undefined4 FUN_1401694d0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x628);
}



void FUN_1401694e0(longlong param_1,undefined8 param_2)

{
  char cVar1;
  undefined1 local_58 [80];
  
  cVar1 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x90))(param_1 + -0x70);
  if (cVar1 != '\0') {
    FUN_1400a2320(local_58,PTR_u_Already_async_callback_may_occur_14030bd58);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  (**(code **)(*(longlong *)(param_1 + 8) + 0x18))(param_1 + 8);
  *(undefined8 *)(param_1 + 0x1510) = param_2;
  return;
}



undefined4 FUN_140169550(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x6a4);
}



undefined4 FUN_140169560(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x624);
}



void FUN_140169570(longlong param_1,undefined2 *param_2)

{
  *param_2 = *(undefined2 *)(param_1 + 0x1858);
  *(undefined1 *)(param_2 + 1) = *(undefined1 *)(param_1 + 0x185a);
  return;
}



void FUN_140169590(longlong param_1,undefined8 *param_2)

{
  *(undefined8 *)(param_1 + 0x1800) = *param_2;
  return;
}



void FUN_1401695a0(longlong param_1,undefined8 *param_2)

{
  *param_2 = *(undefined8 *)(param_1 + 0x1870);
  return;
}



undefined8 FUN_1401695b0(longlong *param_1)

{
  if ((undefined8 *)*param_1 != (undefined8 *)0x0) {
    return *(undefined8 *)*param_1;
  }
  return 0;
}



void FUN_1401695c0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if (*(longlong **)(param_2 + 0xb0) != param_1) {
    FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                  L"Proud::CListNode<class Proud::CNetClientImpl>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  lVar1 = *(longlong *)(param_2 + 0xa8);
  lVar2 = *(longlong *)(param_2 + 0xa0);
  if (lVar1 != 0) {
    *(longlong *)(lVar1 + 0xa0) = lVar2;
  }
  if (lVar2 != 0) {
    *(longlong *)(lVar2 + 0xa8) = lVar1;
  }
  if (lVar1 == 0) {
    if (param_1[1] != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::CNetClientImpl>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if (*param_1 != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::CNetClientImpl>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    *param_1 = lVar1;
  }
  *(undefined8 *)(param_2 + 0xa0) = 0;
  *(undefined8 *)(param_2 + 0xa8) = 0;
  *(undefined8 *)(param_2 + 0xb0) = 0;
  *(int *)(param_1 + 2) = (int)param_1[2] + -1;
  return;
}



int FUN_1401696b0(longlong param_1,int param_2)

{
  int iVar1;
  int iVar2;
  
  iVar2 = *(int *)(param_1 + 0x24);
  if (iVar2 == 0) {
    iVar1 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
    iVar2 = 0x400;
    if (iVar1 < 0x400) {
      iVar2 = iVar1;
    }
    iVar1 = 4;
    if (4 < iVar2) {
      iVar1 = iVar2;
    }
    iVar2 = iVar1 + param_2;
    if (iVar1 + param_2 < *(int *)(param_1 + 0x20)) {
      iVar2 = *(int *)(param_1 + 0x20);
    }
    return iVar2;
  }
  if (iVar2 == 1) {
    iVar1 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
    iVar2 = 0x10;
    if (0x10 < iVar1) {
      iVar2 = iVar1;
    }
    iVar1 = iVar2 + param_2;
    if (iVar2 + param_2 < *(int *)(param_1 + 0x20)) {
      iVar1 = *(int *)(param_1 + 0x20);
    }
    return iVar1;
  }
  if (iVar2 == 2) {
    if (param_2 < *(int *)(param_1 + 0x20)) {
      param_2 = *(int *)(param_1 + 0x20);
    }
    return param_2;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_140169750(undefined8 *param_1)

{
  if ((HANDLE)*param_1 != (HANDLE)0x0) {
    CloseHandle((HANDLE)*param_1);
    *param_1 = 0;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_140169780(undefined8 *param_1)

{
  undefined4 *puVar1;
  undefined1 auStack_58 [32];
  undefined8 *local_38;
  undefined8 local_30;
  undefined1 local_28 [16];
  ulonglong local_18;
  
  local_30 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_58;
  *param_1 = Proud::CP2PConnectionTrialContext::PeerHolepunchState::vftable;
  *(undefined4 *)(param_1 + 4) = 0;
  *(undefined4 *)((longlong)param_1 + 0x24) = 0;
  *(undefined4 *)(param_1 + 5) = 0;
  *(undefined4 *)((longlong)param_1 + 0x2c) = 0;
  *(undefined2 *)((longlong)param_1 + 0x34) = 0x3ff;
  *(undefined4 *)(param_1 + 6) = DAT_1402f80e8;
  *(undefined4 *)(param_1 + 1) = 1;
  param_1[2] = 0;
  param_1[3] = 0;
  local_38 = param_1;
  puVar1 = (undefined4 *)FUN_1400aabf0(local_28);
  *(undefined4 *)(param_1 + 4) = *puVar1;
  *(undefined4 *)((longlong)param_1 + 0x24) = puVar1[1];
  *(undefined4 *)(param_1 + 5) = puVar1[2];
  *(undefined4 *)((longlong)param_1 + 0x2c) = puVar1[3];
  return param_1;
}



void * FUN_140169830(void *param_1,uint param_2)

{
  FUN_140186ed0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140169860(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014016986c. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 8) + 0x68) + 0x10))
            (*(longlong *)(param_1 + 8) + 0x68);
  return;
}



undefined8 * FUN_140169870(undefined8 *param_1,byte param_2)

{
  param_1[2] = 0;
  param_1[1] = Proud::IP2PGroupMember::vftable;
  *param_1 = Proud::ISendDest_C::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1401698b0(longlong param_1)

{
  FUN_140169870(param_1 + -8);
  return;
}



undefined8 FUN_1401698c0(longlong param_1)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar1);
  FUN_1400d1290(uVar1);
  return 1;
}



undefined8 FUN_1401698f0(longlong param_1)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar1);
  *(undefined1 *)(*(longlong *)(param_1 + 0x20) + 0x1790) = 1;
  FUN_1400d1290(uVar1);
  return 1;
}



undefined8 FUN_140169940(longlong param_1)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar1);
  *(undefined1 *)(*(longlong *)(param_1 + 0x20) + 0x1790) = 0;
  FUN_1400d1290(uVar1);
  return 1;
}



void thunk_FUN_14018a150(void)

{
  FUN_14018a150();
  return;
}



void FUN_1401699a0(longlong param_1)

{
  if (*(undefined8 **)(param_1 + 0x1570) != (undefined8 *)0x0) {
    FUN_1401b19c0(**(undefined8 **)(param_1 + 0x1570),0);
    return;
  }
  FUN_1401b19c0(0,0);
  return;
}



undefined8 FUN_1401699c0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  undefined1 uVar9;
  
  uVar7 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))
                    (*(longlong **)(param_1 + 0x20),param_2,param_3,param_4,0xfffffffffffffffe);
  uVar8 = uVar2;
  FUN_1400a1c30(uVar2);
  uVar9 = 1;
  lVar1 = *(longlong *)(param_1 + 0x20);
  plVar4 = *(longlong **)(lVar1 + 0x5d0);
  if ((plVar4 != (longlong *)0x0) && (*plVar4 != 0)) {
    lVar5 = 0;
    lVar3 = lVar5;
    if (plVar4 != (longlong *)0x0) {
      lVar3 = *plVar4;
    }
    if (0.0 < *(double *)(lVar3 + 0xd0)) {
      lVar3 = lVar5;
      if (plVar4 != (longlong *)0x0) {
        lVar3 = *plVar4;
      }
      if (*(double *)(lVar3 + 0xd8) != 0.0) {
        if (*(longlong **)(lVar1 + 0x5d0) != (longlong *)0x0) {
          lVar5 = **(longlong **)(lVar1 + 0x5d0);
        }
        uVar6 = (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x1c0))();
        *(undefined8 *)(lVar5 + 0xd0) = uVar6;
      }
    }
  }
  plVar4 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x1818);
  (**(code **)(*plVar4 + 0x90))(plVar4,1,&DAT_140318cf0,param_4,uVar7,uVar8,uVar9);
  FUN_1400d1290(uVar2);
  return 1;
}



undefined8 FUN_140169ac0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined1 *param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar2);
  lVar1 = *(longlong *)(*(longlong *)(param_1 + 0x20) + 0x5d8);
  uVar3 = 0;
  if (lVar1 != 0) {
    uVar3 = *(undefined8 *)(lVar1 + 0x38);
  }
  FUN_1401ab790(uVar3,*param_4);
  FUN_1400d1290(uVar2);
  return 1;
}



undefined8 FUN_140169b40(longlong param_1,undefined8 param_2,undefined8 param_3,char *param_4)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar1);
  if (*param_4 == '\0') {
    *(double *)(*(longlong *)(param_1 + 0x20) + 0x1890) = DAT_1402f8078;
  }
  else if (*(double *)(*(longlong *)(param_1 + 0x20) + 0x1890) == DAT_1402f8078) {
    *(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x1890) = 0;
  }
  FUN_1400d1290(uVar1);
  return 1;
}



double FUN_140169bd0(longlong param_1)

{
  double dVar1;
  undefined8 uVar2;
  double dVar3;
  
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))();
  FUN_1400a1c30(uVar2);
  dVar3 = (double)FUN_1400ad790(param_1 + 0x15b0);
  dVar1 = *(double *)(param_1 + 0x480);
  FUN_1400d1290(uVar2);
  return dVar3 - dVar1;
}



void FUN_140169c40(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x568) != 0) {
    FUN_1401a8ef0(*(undefined8 *)(*(longlong *)(param_1 + 0x568) + 0x38));
    return;
  }
  FUN_1401a8ef0();
  return;
}



undefined8 FUN_140169c60(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x5d8) != 0) {
    return *(undefined8 *)(*(longlong *)(*(longlong *)(param_1 + 0x5d8) + 0x38) + 0x100);
  }
  return uRam0000000000000100;
}



ulonglong FUN_140169c90(longlong param_1)

{
  longlong *plVar1;
  ulonglong uVar2;
  
  plVar1 = *(longlong **)(param_1 + 0x5d0);
  if ((plVar1 != (longlong *)0x0) && (*plVar1 != 0)) {
    uVar2 = FUN_140189a20();
    return uVar2;
  }
  return (ulonglong)plVar1 & 0xffffffffffffff00;
}



undefined4 FUN_140169cc0(longlong *param_1)

{
  longlong lVar1;
  undefined8 uVar2;
  
  uVar2 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(uVar2);
  lVar1 = param_1[0x2af];
  FUN_1400d1290(uVar2);
  return (int)lVar1;
}



undefined8 FUN_140169d00(longlong param_1,undefined1 *param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined1 uVar3;
  
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))();
  FUN_1400a1c30();
  if ((*(longlong **)(param_1 + 0x1500) == (longlong *)0x0) ||
     (lVar1 = **(longlong **)(param_1 + 0x1500), lVar1 == 0)) {
    uVar3 = 0;
  }
  else {
    uVar3 = *(undefined1 *)(lVar1 + 0x80);
  }
  *param_2 = uVar3;
  if ((*(longlong **)(param_1 + 0x560) == (longlong *)0x0) ||
     (lVar1 = **(longlong **)(param_1 + 0x560), lVar1 == 0)) goto switchD_140169d99_default;
  switch(*(undefined4 *)(lVar1 + 0x100)) {
  case 0:
    FUN_1400d1290(uVar2);
    uVar2 = 1;
    break;
  case 1:
    FUN_1400d1290(uVar2);
    uVar2 = 1;
    break;
  case 2:
    FUN_1400d1290(uVar2);
    uVar2 = 2;
    break;
  case 3:
    FUN_1400d1290(uVar2);
    uVar2 = 2;
    break;
  case 4:
    FUN_1400d1290(uVar2);
    uVar2 = 3;
    break;
  case 5:
  default:
switchD_140169d99_default:
    FUN_1400d1290(uVar2);
    uVar2 = 0;
  }
  return uVar2;
}



longlong FUN_140169e30(longlong param_1)

{
  longlong lVar1;
  
  if ((*(longlong **)(param_1 + 0x1520) != (longlong *)0x0) &&
     (lVar1 = **(longlong **)(param_1 + 0x1520), lVar1 != 0)) {
    return lVar1 + -0x40;
  }
  return 0;
}



longlong FUN_140169e50(longlong param_1)

{
  longlong lVar1;
  
  if ((*(longlong **)(param_1 + 0x15d8) != (longlong *)0x0) &&
     (lVar1 = **(longlong **)(param_1 + 0x15d8), lVar1 != 0)) {
    return lVar1 + -0x40;
  }
  return 0;
}



void FUN_140169e70(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  double dVar3;
  undefined8 uVar4;
  
  if ((*(longlong **)(param_1 + 0x1570) != (longlong *)0x0) &&
     (lVar1 = **(longlong **)(param_1 + 0x1570), lVar1 != 0)) {
    dVar3 = (double)(**(code **)(*(longlong *)(param_1 + 0x70) + 0x1c0))(param_1 + 0x70);
    lVar2 = 0;
    dVar3 = dVar3 - *(double *)(lVar1 + 0x180);
    if (0.0 < dVar3) {
      lVar1 = lVar2;
      if (*(longlong **)(param_1 + 0x1570) != (longlong *)0x0) {
        lVar1 = **(longlong **)(param_1 + 0x1570);
      }
      *(double *)(lVar1 + 0x200) = dVar3;
    }
    lVar1 = lVar2;
    if (*(longlong **)(param_1 + 0x1570) != (longlong *)0x0) {
      lVar1 = **(longlong **)(param_1 + 0x1570);
    }
    uVar4 = (**(code **)(*(longlong *)(param_1 + 0x70) + 0x1c0))(param_1 + 0x70);
    *(undefined8 *)(lVar1 + 0x180) = uVar4;
    if (*(longlong **)(param_1 + 0x1570) != (longlong *)0x0) {
      lVar2 = **(longlong **)(param_1 + 0x1570);
    }
    *(int *)(lVar2 + 0x1c0) = *(int *)(lVar2 + 0x1c0) + 1;
  }
  return;
}



undefined8 * FUN_140169f40(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  
  if (((*(longlong **)(param_1 + 0x1520) != (longlong *)0x0) &&
      (lVar1 = **(longlong **)(param_1 + 0x1520), lVar1 != 0)) && (lVar1 != 0x40)) {
    if (lVar1 != 0) {
      lVar1 = lVar1 + -0x40;
    }
    *param_2 = Proud::AddrPort::vftable;
    *(undefined4 *)(param_2 + 1) = *(undefined4 *)(lVar1 + 0x130);
    *(undefined2 *)((longlong)param_2 + 0xc) = *(undefined2 *)(lVar1 + 0x134);
    return param_2;
  }
  *param_2 = Proud::AddrPort::vftable;
  *(undefined4 *)(param_2 + 1) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1402f83d4;
  return param_2;
}



longlong FUN_140169fb0(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x5d8) != 0) {
    return *(longlong *)(*(longlong *)(param_1 + 0x5d8) + 0x38) + 0x10;
  }
  return 0x10;
}



undefined8 FUN_140169fd0(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  undefined8 uVar5;
  
  lVar4 = 0;
  lVar2 = lVar4;
  if (*(longlong *)(param_1 + 0x568) != 0) {
    lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x568) + 0x38);
  }
  lVar2 = lVar2 + 0x10;
  FUN_1400a1c30(lVar2);
  lVar1 = *(longlong *)(param_1 + 0x568);
  lVar3 = lVar4;
  if (lVar1 != 0) {
    lVar3 = *(longlong *)(lVar1 + 0x38);
  }
  if ((*(longlong **)(lVar3 + 0x290) == (longlong *)0x0) || (**(longlong **)(lVar3 + 0x290) == 0)) {
    FUN_1400d1290(lVar2);
    uVar5 = 0;
  }
  else {
    lVar3 = lVar4;
    if (lVar1 != 0) {
      lVar3 = *(longlong *)(lVar1 + 0x38);
    }
    if (*(longlong **)(lVar3 + 0x290) != (longlong *)0x0) {
      lVar4 = **(longlong **)(lVar3 + 0x290);
    }
    uVar5 = *(undefined8 *)(lVar4 + 0x40);
    FUN_1400d1290(lVar2);
  }
  return uVar5;
}



longlong FUN_14016a090(longlong param_1)

{
  longlong *plVar1;
  uint7 uVar2;
  
  plVar1 = *(longlong **)(param_1 + 0x5d0);
  uVar2 = (uint7)((ulonglong)plVar1 >> 8);
  if ((plVar1 != (longlong *)0x0) && (*plVar1 != 0)) {
    return CONCAT71(uVar2,1);
  }
  return (ulonglong)uVar2 << 8;
}



undefined8 * FUN_14016a0b0(longlong param_1,undefined8 *param_2)

{
  longlong *plVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))((longlong *)(param_1 + -0x70));
  FUN_1400a1c30(uVar2);
  plVar1 = *(longlong **)(param_1 + 0x1568);
  if ((((plVar1 == (longlong *)0x0) || (*plVar1 == 0)) || (plVar1 == (longlong *)0x0)) ||
     ((*plVar1 == 0 || (*plVar1 == 0x40)))) {
    *param_2 = Proud::AddrPort::vftable;
    *(undefined4 *)(param_2 + 1) = DAT_1402f83d0;
    *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1402f83d4;
  }
  else {
    if (((plVar1 == (longlong *)0x0) || (*plVar1 == 0)) ||
       ((plVar1 == (longlong *)0x0 || (*plVar1 == 0)))) {
      lVar3 = 0;
    }
    else {
      lVar3 = *plVar1 + -0x40;
    }
    *param_2 = Proud::AddrPort::vftable;
    *(undefined4 *)(param_2 + 1) = *(undefined4 *)(lVar3 + 0x108);
    *(undefined2 *)((longlong)param_2 + 0xc) = *(undefined2 *)(lVar3 + 0x10c);
  }
  FUN_1400d1290(uVar2);
  return param_2;
}



void FUN_14016a190(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  void *pvVar2;
  longlong lVar3;
  longlong lVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined1 uVar7;
  
  uVar5 = 0xfffffffffffffffe;
  uVar1 = (**(code **)(*param_1 + 0x58))();
  uVar6 = uVar1;
  FUN_1400a1c30(uVar1);
  uVar7 = 1;
  lVar4 = 0;
  lVar3 = lVar4;
  if (param_1[0xbb] != 0) {
    lVar3 = *(longlong *)(param_1[0xbb] + 0x38);
  }
  if ((*(longlong *)(lVar3 + 0x2b0) == 0) && (*(char *)((longlong)param_1 + 0x6c6) != '\0')) {
    pvVar2 = operator_new(0x130);
    lVar3 = lVar4;
    if (pvVar2 != (void *)0x0) {
      if (param_1[0xbb] != 0) {
        lVar3 = *(longlong *)(param_1[0xbb] + 0x38);
      }
      lVar3 = FUN_1401b5cf0(pvVar2,lVar3,param_3,param_4,uVar5,uVar6,uVar7);
    }
    if (param_1[0xbb] != 0) {
      lVar4 = *(longlong *)(param_1[0xbb] + 0x38);
    }
    *(longlong *)(lVar4 + 0x2b0) = lVar3;
  }
  FUN_1400d1290(uVar1);
  return;
}



undefined4 * FUN_14016a260(undefined4 *param_1,undefined4 *param_2)

{
  longlong *plVar1;
  
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  if (*(longlong *)(param_2 + 2) == *(longlong *)(param_1 + 2)) {
    param_1[7] = param_2[7];
    *(undefined8 *)(param_1 + 4) = *(undefined8 *)(param_2 + 4);
    param_1[6] = param_2[6];
  }
  else {
    FUN_14019a730(param_1 + 2);
    if (*(longlong *)(param_2 + 2) != 0) {
      plVar1 = (longlong *)(*(longlong *)(param_2 + 2) + 0x28);
      *plVar1 = *plVar1 + 1;
      *(undefined8 *)(param_1 + 2) = *(undefined8 *)(param_2 + 2);
    }
  }
  *(undefined1 *)(param_1 + 8) = *(undefined1 *)(param_2 + 8);
  return param_1;
}



void FUN_14016a2e0(longlong param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  void *pvVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 0x58) == 0) {
    pvVar1 = operator_new(0xd0);
    uVar2 = 0;
    if (pvVar1 != (void *)0x0) {
      uVar2 = FUN_14019a1d0(pvVar1,param_1 + 0x98,param_2,param_3,param_4);
    }
    *(undefined8 *)(param_1 + 0x58) = uVar2;
  }
  return;
}



void FUN_14016a360(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  if ((*(longlong **)(param_1 + 0x1520) == (longlong *)0x0) ||
     (**(longlong **)(param_1 + 0x1520) == 0)) {
    lVar2 = 0;
    lVar1 = lVar2;
    if (*(longlong **)(param_1 + 0x1570) != (longlong *)0x0) {
      lVar1 = **(longlong **)(param_1 + 0x1570);
    }
    if (((*(char *)(lVar1 + 0x40) == '\0') && (*(int *)(param_1 + 0x6a0) < 2)) &&
       (*(char *)(param_1 + 0x1528) == '\0')) {
      (**(code **)(*(longlong *)(param_1 + 0x1818) + 0x120))
                ((longlong *)(param_1 + 0x1818),1,&DAT_140318cf0);
      if (*(longlong **)(param_1 + 0x1570) != (longlong *)0x0) {
        lVar2 = **(longlong **)(param_1 + 0x1570);
      }
      *(undefined1 *)(lVar2 + 0x40) = 1;
    }
  }
  return;
}



void FUN_14016a3f0(longlong param_1,undefined4 *param_2)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  puVar2 = (undefined8 *)0x0;
  puVar1 = puVar2;
  if (*(longlong *)(param_1 + 0x568) != 0) {
    puVar1 = *(undefined8 **)(*(longlong *)(param_1 + 0x568) + 0x38);
  }
  if ((undefined8 *)puVar1[0xf] != (undefined8 *)0x0) {
    puVar2 = *(undefined8 **)puVar1[0xf];
  }
  *(undefined8 *)(param_2 + 2) = *puVar2;
  if (*(longlong *)(param_1 + 0x568) == 0) {
    *param_2 = uRam0000000000000284;
    return;
  }
  *param_2 = *(undefined4 *)(*(longlong *)(*(longlong *)(param_1 + 0x568) + 0x38) + 0x284);
  return;
}



void FUN_14016a450(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x560) != 0) {
    FUN_1400ace20(*(undefined8 *)(*(longlong *)(*(longlong *)(param_1 + 0x560) + 0x38) + 0x2b8));
    return;
  }
  FUN_1400ace20(uRam00000000000002b8);
  return;
}



undefined8 * FUN_14016a480(longlong param_1,undefined8 *param_2)

{
  longlong *plVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))((longlong *)(param_1 + -0x70));
  FUN_1400a1c30(uVar2);
  plVar1 = *(longlong **)(param_1 + 0x1568);
  if ((((plVar1 == (longlong *)0x0) || (*plVar1 == 0)) || (plVar1 == (longlong *)0x0)) ||
     ((*plVar1 == 0 || (*plVar1 == 0x40)))) {
    *param_2 = Proud::AddrPort::vftable;
    *(undefined4 *)(param_2 + 1) = DAT_1402f83d0;
    *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1402f83d4;
  }
  else {
    if (((plVar1 == (longlong *)0x0) || (*plVar1 == 0)) ||
       ((plVar1 == (longlong *)0x0 || (*plVar1 == 0)))) {
      lVar3 = 0;
    }
    else {
      lVar3 = *plVar1 + -0x40;
    }
    *param_2 = Proud::AddrPort::vftable;
    *(undefined4 *)(param_2 + 1) = *(undefined4 *)(lVar3 + 0x118);
    *(undefined2 *)((longlong)param_2 + 0xc) = *(undefined2 *)(lVar3 + 0x11c);
  }
  FUN_1400d1290(uVar2);
  return param_2;
}



undefined8 * FUN_14016a560(longlong param_1,undefined8 *param_2)

{
  longlong *plVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))((longlong *)(param_1 + -0x70));
  FUN_1400a1c30(uVar2);
  plVar1 = *(longlong **)(param_1 + 0x14b0);
  if ((((plVar1 == (longlong *)0x0) || (*plVar1 == 0)) || (plVar1 == (longlong *)0x0)) ||
     ((*plVar1 == 0 || (*plVar1 == 0x40)))) {
    *param_2 = Proud::AddrPort::vftable;
    *(undefined4 *)(param_2 + 1) = DAT_1402f83d0;
    *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1402f83d4;
  }
  else {
    if (((plVar1 == (longlong *)0x0) || (*plVar1 == 0)) ||
       ((plVar1 == (longlong *)0x0 || (*plVar1 == 0)))) {
      lVar3 = 0;
    }
    else {
      lVar3 = *plVar1 + -0x40;
    }
    *param_2 = Proud::AddrPort::vftable;
    *(undefined4 *)(param_2 + 1) = *(undefined4 *)(lVar3 + 0x130);
    *(undefined2 *)((longlong)param_2 + 0xc) = *(undefined2 *)(lVar3 + 0x134);
  }
  FUN_1400d1290(uVar2);
  return param_2;
}



void FUN_14016a640(longlong *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong lVar4;
  undefined8 uVar5;
  undefined1 local_res8 [8];
  undefined8 uVar6;
  undefined1 uVar7;
  
  uVar6 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(param_1[-0xe] + 0x58))();
  FUN_1400a1c30(uVar2);
  uVar7 = 1;
  lVar4 = 0;
  lVar3 = lVar4;
  if ((longlong *)param_1[0xac] != (longlong *)0x0) {
    lVar3 = *(longlong *)param_1[0xac];
  }
  *(bool *)param_2 = lVar3 == 0;
  lVar3 = lVar4;
  if (param_1[0xad] != 0) {
    lVar3 = *(longlong *)(param_1[0xad] + 0x38);
  }
  *(undefined1 *)(param_2 + 1) = *(undefined1 *)(lVar3 + 0x28c);
  *(int *)(param_2 + 8) = (int)param_1[0xa2];
  *(int *)(param_2 + 0x10) = (int)param_1[0x2b1];
  *(int *)(param_2 + 0x28) = (int)param_1[0x2c0];
  *(int *)(param_2 + 4) = (int)param_1[0xaa];
  uVar5 = (**(code **)(*param_1 + 0x1c0))(param_1);
  *(undefined8 *)(param_2 + 0x20) = uVar5;
  *(longlong *)(param_2 + 0x18) = param_1[0x30a];
  *(undefined4 *)(param_2 + 0x2c) = 0;
  if (*(char *)(param_2 + 1) == '\0') {
    if (param_1[0xad] != 0) {
      lVar4 = *(longlong *)(param_1[0xad] + 0x38);
    }
    *(undefined4 *)(param_2 + 0x2c) = *(undefined4 *)(lVar4 + 0x284);
  }
  local_res8[0] = 0;
  uVar1 = (**(code **)(*param_1 + 0x108))(param_1,local_res8,param_3,param_4,uVar6,uVar2,uVar7);
  *(undefined4 *)(param_2 + 0xc) = uVar1;
  FUN_1400d1290(uVar2);
  return;
}



void FUN_14016a750(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_1401695c0(*(longlong *)(param_1 + 0x10),param_1 + -0xa0);
  }
  return;
}



void FUN_14016a780(longlong *param_1)

{
  longlong lVar1;
  undefined1 local_68 [8];
  undefined1 local_60;
  undefined4 local_5c;
  undefined1 local_50 [72];
  
  if (param_1[3] != 0) {
    FUN_1400a2320(local_50,PTR_u_Collection_object_can_use_fast_h_1402f81d0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
  }
  if (*param_1 == 0) {
    FUN_1400a6440(local_68);
    local_5c = 0;
    local_60 = 0;
    lVar1 = FUN_1400a63b0(local_68);
    *param_1 = lVar1;
  }
  return;
}



void FUN_14016a7f0(undefined8 *param_1)

{
  if (100 < (ulonglong)param_1[2]) {
    operator_delete__((void *)*param_1);
  }
  return;
}



undefined8 * FUN_14016a810(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_14016a870(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_14016a8d0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14016a930(undefined8 *param_1,longlong param_2,longlong param_3)

{
  longlong lVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  longlong lVar4;
  undefined8 *puVar5;
  longlong lVar6;
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (-1 < param_3) {
    param_1[3] = param_3;
  }
  if (param_2 == 0) {
    if ((100 < (ulonglong)param_1[2]) && ((void *)*param_1 != (void *)0x0)) {
      operator_delete__((void *)*param_1);
      *param_1 = 0;
    }
    param_1[2] = 100;
    param_1[1] = 0;
    return;
  }
  lVar4 = param_1[2];
  if (param_2 <= lVar4) {
    param_1[1] = param_2;
    return;
  }
  lVar1 = param_1[3];
  if (lVar1 == 0) {
    lVar1 = (longlong)(param_1[1] + (ulonglong)((uint)((longlong)param_1[1] >> 0x3f) & 7)) >> 3;
    if (lVar1 < 4) {
      lVar1 = 4;
    }
    else if (0x400 < lVar1) {
      lVar1 = 0x400;
    }
  }
  lVar6 = param_2;
  if (param_2 < lVar1 + lVar4) {
    lVar6 = lVar1 + lVar4;
  }
  if (lVar6 < lVar4) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  puVar2 = operator_new(lVar6 * 8);
  puVar5 = param_1 + 4;
  if (100 < (ulonglong)param_1[2]) {
    puVar5 = (undefined8 *)*param_1;
  }
  lVar4 = param_1[1];
  if (0 < lVar4) {
    puVar3 = puVar2;
    do {
      lVar4 = lVar4 + -1;
      *puVar3 = *(undefined8 *)(((longlong)puVar5 - (longlong)puVar2) + (longlong)puVar3);
      puVar3 = puVar3 + 1;
    } while (lVar4 != 0);
  }
  memset(puVar2 + param_1[1],0,(param_2 - param_1[1]) * 8);
  if (100 < (ulonglong)param_1[2]) {
    operator_delete__(puVar5);
  }
  *param_1 = puVar2;
  param_1[2] = lVar6;
  param_1[1] = param_2;
  return;
}



longlong FUN_14016aa90(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x10);
  if (lVar1 == 0) {
    lVar1 = *(longlong *)(param_1 + 8);
    if (lVar1 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    if (*(int *)(lVar1 + 0x18) != 0) {
      return *(longlong *)(lVar1 + 0x10);
    }
    lVar1 = 0;
  }
  return lVar1;
}



void FUN_14016aad0(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined **local_30;
  undefined8 local_28;
  undefined8 local_20;
  undefined8 local_18;
  undefined8 local_10;
  
  local_28 = 0;
  local_20 = 0;
  local_18 = 0;
  local_10 = 0;
  local_30 = Proud::ByteArray::vftable;
  (**(code **)(*param_1 + 0x80))(param_1,DAT_1402f8130,&local_30,param_4,0xfffffffffffffffe);
  FUN_140140df0(&local_30);
  return;
}



void FUN_14016ab30(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x00014016ab57. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



void FUN_14016ab70(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x00014016ab97. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



void FUN_14016abb0(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x00014016abd7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



undefined8 *
FUN_14016abf0(longlong param_1,undefined8 *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong lVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  
  uVar5 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))(param_1 + -0x70);
  uVar6 = uVar2;
  FUN_1400a1c30();
  plVar1 = *(longlong **)(param_1 + 0x1568);
  if ((plVar1 == (longlong *)0x0) || (*plVar1 == 0)) {
    *param_2 = Proud::AddrPort::vftable;
    *(undefined4 *)(param_2 + 1) = DAT_1402f83d0;
    *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1402f83d4;
  }
  else {
    lVar4 = 0;
    lVar3 = lVar4;
    if ((((plVar1 != (longlong *)0x0) && (*plVar1 != 0)) && (plVar1 != (longlong *)0x0)) &&
       (*plVar1 != 0)) {
      lVar3 = *plVar1 + -0x40;
    }
    if (*(longlong **)(lVar3 + 0x128) != (longlong *)0x0) {
      lVar4 = **(longlong **)(lVar3 + 0x128);
    }
    FUN_1400a7ef0(lVar4,param_2,param_3,param_4,uVar5,uVar6,1);
  }
  FUN_1400d1290(uVar2);
  return param_2;
}



ulonglong FUN_14016acc0(longlong *param_1,undefined1 *param_2)

{
  longlong lVar1;
  longlong *plVar2;
  ulonglong uVar3;
  longlong *plVar4;
  longlong *plVar5;
  short sVar6;
  int iVar7;
  short sVar8;
  int iVar9;
  undefined1 local_res8 [8];
  
  local_res8[0] = 0;
  uVar3 = (**(code **)(*param_1 + 0x108))(param_1,local_res8);
  if ((int)uVar3 == 2) {
    plVar4 = (longlong *)param_1[0x296];
    plVar5 = (longlong *)0x0;
    iVar7 = DAT_1402f83d0;
    sVar6 = DAT_1402f83d4;
    if ((((((plVar4 != (longlong *)0x0) && (*plVar4 != 0)) && (plVar4 != (longlong *)0x0)) &&
         ((*plVar4 != 0 && (*plVar4 != 0x40)))) &&
        ((plVar4 = (longlong *)param_1[0x296], iVar7 = iRam0000000000000140,
         sVar6 = sRam0000000000000144, plVar4 != (longlong *)0x0 &&
         ((*plVar4 != 0 && (plVar4 != (longlong *)0x0)))))) && (lVar1 = *plVar4, lVar1 != 0)) {
      iVar7 = *(int *)(lVar1 + 0x100);
      sVar6 = *(short *)(lVar1 + 0x104);
    }
    plVar4 = (longlong *)param_1[0x296];
    iVar9 = DAT_1402f83d0;
    sVar8 = DAT_1402f83d4;
    if (((plVar4 != (longlong *)0x0) && (*plVar4 != 0)) && (plVar4 != (longlong *)0x0)) {
      lVar1 = *plVar4;
      plVar4 = (longlong *)0x0;
      if ((lVar1 != 0) && (plVar4 = (longlong *)0x0, lVar1 != 0x40)) {
        plVar2 = (longlong *)param_1[0x296];
        plVar4 = plVar5;
        if (((plVar2 != (longlong *)0x0) && ((*plVar2 != 0 && (plVar2 != (longlong *)0x0)))) &&
           (*plVar2 != 0)) {
          plVar4 = (longlong *)(*plVar2 + -0x40);
        }
        iVar9 = (int)plVar4[0x26];
        sVar8 = *(short *)((longlong)plVar4 + 0x134);
      }
    }
    if ((iVar9 != iVar7) || (sVar8 != sVar6)) {
      plVar5 = (longlong *)0x1;
    }
    *param_2 = (char)plVar5;
    return CONCAT71((int7)((ulonglong)plVar4 >> 8),1);
  }
  return uVar3 & 0xffffffffffffff00;
}



void FUN_14016adf0(longlong *param_1,longlong *param_2)

{
  int iVar1;
  undefined1 local_98 [72];
  undefined1 local_50 [80];
  
  iVar1 = (int)param_1[1];
  if (*(int *)((longlong)param_2 + 0xc) < iVar1) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (*param_1 == 0) {
    FUN_1400a2320(local_50,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
  }
  if (*param_2 == 0) {
    FUN_1400a2320(local_98,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_98,(ThrowInfo *)&DAT_1402f4860);
  }
  if ((-1 < iVar1) && (iVar1 <= *(int *)((longlong)param_2 + 0xc))) {
    *(int *)(param_2 + 1) = iVar1;
    if (*param_1 == 0) {
      FUN_1400a2320(local_98,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_98,(ThrowInfo *)&DAT_1402f4860);
    }
    FUN_1400224d0(*param_2,*param_1,(longlong)(int)param_1[1] << 4);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



longlong * FUN_14016aec0(longlong *param_1,longlong param_2,longlong param_3)

{
  longlong lVar1;
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_1[1] <= param_2) {
    FUN_14016a930(param_1,param_2 + 1,0xffffffffffffffff);
  }
  if (param_2 < param_1[1]) {
    if ((ulonglong)param_1[2] < 0x65) {
      param_1[param_2 + 4] = param_3;
      return param_1 + param_2 + 4;
    }
    lVar1 = *param_1;
    *(longlong *)(lVar1 + param_2 * 8) = param_3;
    return (longlong *)(lVar1 + param_2 * 8);
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_14016af40(longlong param_1,ulonglong param_2,int param_3)

{
  ulonglong uVar1;
  undefined8 uVar2;
  ulonglong uVar3;
  ulonglong uVar5;
  uint uVar6;
  ulonglong uVar8;
  ulonglong uVar9;
  longlong lVar10;
  uint local_res10;
  ulonglong local_res20;
  ulonglong local_28;
  ulonglong uVar4;
  int iVar7;
  
  local_res10 = (uint)param_2;
  uVar5 = (ulonglong)param_3;
  local_res20 = (ulonglong)(int)local_res10;
  local_28 = uVar5;
  if (param_3 < (int)local_res10) {
    do {
      uVar8 = param_2 & 0xffffffff;
      lVar10 = (longlong)(int)uVar5;
      uVar3 = local_res20;
      while( true ) {
        uVar1 = *(ulonglong *)(param_1 + local_28 * 8);
        uVar4 = *(ulonglong *)(param_1 + lVar10 * 8);
        while ((uVar4 < uVar1 && (lVar10 < (longlong)uVar3))) {
          lVar10 = lVar10 + 1;
          uVar4 = *(ulonglong *)(param_1 + lVar10 * 8);
        }
        do {
          uVar9 = uVar8;
          uVar4 = uVar3;
          uVar3 = uVar4 - 1;
          iVar7 = (int)uVar9;
          uVar6 = iVar7 - 1;
          uVar8 = (ulonglong)uVar6;
        } while (uVar1 < *(ulonglong *)(param_1 + uVar3 * 8));
        if ((longlong)uVar3 <= lVar10) break;
        uVar2 = *(undefined8 *)(param_1 + lVar10 * 8);
        *(undefined8 *)(param_1 + lVar10 * 8) = *(undefined8 *)(param_1 + uVar3 * 8);
        *(undefined8 *)(param_1 + uVar3 * 8) = uVar2;
      }
      *(undefined8 *)(param_1 + local_28 * 8) = *(undefined8 *)(param_1 + uVar3 * 8);
      *(ulonglong *)(param_1 + uVar3 * 8) = uVar1;
      if ((int)(((int)param_2 - uVar6) + -1) < (int)(uVar6 - (int)uVar5)) {
        FUN_14016af40(param_1,iVar7 + -2,uVar5 & 0xffffffff);
        uVar5 = uVar9;
        local_28 = uVar4;
      }
      else {
        FUN_14016af40(param_1,param_2,uVar9);
        local_res10 = iVar7 - 2;
        local_res20 = uVar4 - 2;
      }
      param_2 = (ulonglong)local_res10;
    } while ((int)uVar5 < (int)local_res10);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14016b050(longlong param_1,undefined4 param_2,int param_3,undefined8 param_4,
                  undefined8 param_5)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined1 auStack_68 [32];
  undefined8 local_48;
  undefined1 local_40;
  undefined8 local_38;
  undefined8 local_30;
  ulonglong local_28;
  
  local_38 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_68;
  local_30 = param_4;
  if (param_3 == 1) {
    lVar2 = 0;
    local_48 = 0;
    local_40 = 1;
    if ((*(longlong **)(param_1 + 0x15d8) != (longlong *)0x0) &&
       (lVar1 = **(longlong **)(param_1 + 0x15d8), lVar1 != 0)) {
      lVar2 = lVar1 + -0x40;
    }
    FUN_1401b82c0(lVar2,param_4,&local_48);
  }
  else {
    FUN_14016a360();
    uVar3 = 0;
    if (*(undefined8 **)(param_1 + 0x1570) != (undefined8 *)0x0) {
      uVar3 = **(undefined8 **)(param_1 + 0x1570);
    }
    FUN_1401b1a40(uVar3,param_2,param_4,param_5);
  }
  FUN_140145b60(param_4);
  return;
}



void thunk_FUN_1400031d0(void)

{
  FUN_1400031d0();
  return;
}



undefined8 * FUN_14016b120(undefined8 param_1,undefined8 *param_2)

{
  FUN_1400a3440();
  *param_2 = PTR_DAT_1402f8010;
  return param_2;
}



undefined8 * FUN_14016b150(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *(longlong *)(param_1 + 0x568);
  lVar3 = 0;
  lVar2 = lVar3;
  if (lVar1 != 0) {
    lVar2 = *(longlong *)(lVar1 + 0x38);
  }
  if (*(longlong *)(lVar2 + 0x2b0) == 0) {
    FUN_1400a3440();
    *param_2 = PTR_DAT_1402f8010;
    return param_2;
  }
  if (lVar1 != 0) {
    lVar3 = *(longlong *)(lVar1 + 0x38);
  }
  FUN_1401b3010(*(undefined8 *)(lVar3 + 0x2b0));
  return param_2;
}



void FUN_14016b1c0(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 *puVar3;
  bool bVar4;
  undefined8 uVar5;
  longlong lVar6;
  
  uVar5 = 0xfffffffffffffffe;
  lVar1 = *param_1;
  if (lVar1 != 0) {
    lVar6 = lVar1;
    FUN_1400a1c30(lVar1);
    bVar4 = true;
    *(longlong *)(*param_1 + 0x40) = *(longlong *)(*param_1 + 0x40) + -1;
    if (*(longlong *)(*param_1 + 0x40) == 0) {
      FUN_1400d1290(lVar1);
      bVar4 = false;
      lVar2 = *param_1;
      puVar3 = *(undefined8 **)(lVar2 + 0x38);
      if (puVar3 != (undefined8 *)0x0) {
        (**(code **)*puVar3)(puVar3,1,param_3,param_4,uVar5,lVar6,0);
      }
      FUN_1400a1cd0(lVar2);
      FUN_1400a3530(lVar2);
    }
    if (bVar4) {
      FUN_1400d1290(lVar1);
    }
  }
  return;
}



void FUN_14016b270(longlong *param_1)

{
  undefined8 *puVar1;
  
  if ((*param_1 != 0) &&
     (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
     *(longlong *)(*param_1 + 8) == 0)) {
    puVar1 = (undefined8 *)*param_1;
    operator_delete((void *)*puVar1);
    FUN_1400a3530(puVar1);
  }
  return;
}



longlong * FUN_14016b2c0(longlong *param_1)

{
  wint_t *pwVar1;
  undefined *puVar2;
  int iVar3;
  wint_t *pwVar4;
  wint_t *pwVar5;
  int iVar6;
  int iVar7;
  undefined *_Dst;
  
  pwVar4 = (wint_t *)*param_1;
  if ((wint_t *)*param_1 == (wint_t *)0x0) {
    pwVar4 = (wint_t *)PTR_DAT_1402f8010;
  }
  iVar3 = iswspace(*pwVar4);
  while (iVar3 != 0) {
    pwVar4 = (wint_t *)FUN_1400a3340(pwVar4);
    iVar3 = iswspace(*pwVar4);
  }
  pwVar1 = (wint_t *)*param_1;
  pwVar5 = pwVar1;
  if (pwVar1 == (wint_t *)0x0) {
    pwVar5 = (wint_t *)PTR_DAT_1402f8010;
  }
  if (pwVar4 == pwVar5) {
    return param_1;
  }
  pwVar5 = pwVar1;
  if (pwVar1 == (wint_t *)0x0) {
    pwVar5 = (wint_t *)PTR_DAT_1402f8010;
  }
  iVar6 = 0;
  iVar3 = 0;
  if (pwVar1 != (wint_t *)0x0) {
    if (pwVar1 != (wint_t *)PTR_DAT_1402f8010) {
      iVar3 = *(int *)(pwVar1 + -4);
    }
    if (pwVar1 != (wint_t *)0x0) {
      iVar7 = 0;
      if (pwVar1 != (wint_t *)PTR_DAT_1402f8010) {
        iVar7 = *(int *)(pwVar1 + -4);
      }
      goto LAB_14016b35c;
    }
  }
  iVar7 = 0;
LAB_14016b35c:
  if (((iVar3 <= iVar7) && (iVar3 = iVar6, pwVar1 != (wint_t *)0x0)) &&
     (iVar3 = 0, pwVar1 != (wint_t *)PTR_DAT_1402f8010)) {
    iVar3 = *(int *)(pwVar1 + -4);
  }
  iVar7 = 1;
  if (1 < iVar3) {
    iVar7 = iVar3;
  }
  iVar3 = 0;
  if ((pwVar1 != (wint_t *)0x0) && (iVar3 = 0, pwVar1 != (wint_t *)PTR_DAT_1402f8010)) {
    iVar3 = *(int *)(pwVar1 + -4);
  }
  if (iVar3 < iVar7) {
    FUN_140002d50(param_1,iVar7);
  }
  FUN_140002e30(param_1);
  puVar2 = (undefined *)*param_1;
  iVar3 = (int)((longlong)pwVar4 - (longlong)pwVar5 >> 1);
  _Dst = puVar2;
  if (puVar2 == (undefined *)0x0) {
    _Dst = PTR_DAT_1402f8010;
  }
  iVar7 = 0;
  if ((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8010)) {
    iVar7 = *(int *)(puVar2 + -8);
  }
  iVar7 = iVar7 - iVar3;
  if (puVar2 == (undefined *)0x0) {
    iVar6 = 0;
  }
  else if (puVar2 != PTR_DAT_1402f8010) {
    iVar6 = *(int *)(puVar2 + -8);
  }
  memmove_s(_Dst,(longlong)(iVar6 + 1) * 2,_Dst + (longlong)iVar3 * 2,(longlong)(iVar7 + 1) * 2);
  puVar2 = (undefined *)*param_1;
  iVar3 = 0;
  iVar6 = 0;
  if (0 < iVar7) {
    iVar6 = iVar7;
  }
  if ((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8010)) {
    iVar3 = *(int *)(puVar2 + -8);
  }
  if ((iVar3 <= iVar6) && (iVar6 = 0, puVar2 != (undefined *)0x0)) {
    if (puVar2 == PTR_DAT_1402f8010) {
      return param_1;
    }
    iVar6 = *(int *)(puVar2 + -8);
  }
  if (((puVar2 != PTR_DAT_1402f8010) && (puVar2 != (undefined *)0x0)) &&
     ((int *)(puVar2 + -8) != (int *)0x0)) {
    *(int *)(puVar2 + -8) = iVar6;
    *(undefined2 *)(puVar2 + (longlong)iVar6 * 2) = 0;
  }
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x00014016b59d)
// WARNING: Removing unreachable block (ram,0x00014016b5ab)

void FUN_14016b480(ulonglong *param_1,ulonglong *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  undefined8 uVar6;
  ulonglong uVar7;
  undefined1 uVar8;
  ulonglong uVar9;
  undefined1 uVar10;
  
  uVar6 = 0xfffffffffffffffe;
  uVar4 = *param_2;
  uVar7 = *param_1;
  if (uVar7 != uVar4) {
    uVar3 = uVar7;
    if (uVar4 < uVar7) {
      uVar3 = uVar4;
      uVar4 = uVar7;
    }
    uVar8 = 0;
    uVar10 = 0;
    uVar7 = uVar3;
    uVar9 = uVar4;
    if (uVar3 != 0) {
      uVar8 = 1;
      FUN_1400a1c30(uVar3);
    }
    if (uVar4 != 0) {
      uVar10 = 1;
      FUN_1400a1c30(uVar4);
    }
    if (*param_2 != 0) {
      plVar1 = (longlong *)(*param_2 + 0x40);
      *plVar1 = *plVar1 + 1;
    }
    uVar5 = 0;
    if (*param_1 != 0) {
      plVar1 = (longlong *)(*param_1 + 0x40);
      *plVar1 = *plVar1 + -1;
      if (*(longlong *)(*param_1 + 0x40) == 0) {
        uVar5 = *param_1;
      }
    }
    *param_1 = *param_2;
    if (uVar3 != 0) {
      FUN_1400d1290(uVar3);
      uVar8 = 0;
    }
    if (uVar4 != 0) {
      FUN_1400d1290(uVar4);
      uVar10 = 0;
    }
    if (uVar5 != 0) {
      puVar2 = *(undefined8 **)(uVar5 + 0x38);
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1,param_3,param_4,uVar6,uVar7,uVar8,uVar9,uVar10);
      }
      FUN_1400a1cd0(uVar5);
      FUN_1400a3530(uVar5);
    }
  }
  return;
}



void FUN_14016b5d0(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  undefined8 *puVar2;
  
  lVar1 = *param_2;
  if (lVar1 != *param_1) {
    if (lVar1 != 0) {
      *(longlong *)(*param_2 + 8) = *(longlong *)(lVar1 + 8) + 1;
    }
    puVar2 = (undefined8 *)0x0;
    if ((*param_1 != 0) &&
       (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
       *(longlong *)(*param_1 + 8) == 0)) {
      puVar2 = (undefined8 *)*param_1;
    }
    *param_1 = *param_2;
    if (puVar2 != (undefined8 *)0x0) {
      operator_delete((void *)*puVar2);
      FUN_1400a3530(puVar2);
    }
  }
  return;
}



void FUN_14016b650(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  undefined8 *puVar2;
  longlong *plVar3;
  
  lVar1 = *param_2;
  if (lVar1 != *param_1) {
    if (lVar1 != 0) {
      *(longlong *)(*param_2 + 8) = *(longlong *)(lVar1 + 8) + 1;
    }
    plVar3 = (longlong *)0x0;
    if ((*param_1 != 0) &&
       (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
       *(longlong *)(*param_1 + 8) == 0)) {
      plVar3 = (longlong *)*param_1;
    }
    *param_1 = *param_2;
    if (plVar3 != (longlong *)0x0) {
      puVar2 = (undefined8 *)*plVar3;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      FUN_1400a3530(plVar3);
    }
  }
  return;
}



void FUN_14016b6d0(longlong *param_1,int param_2)

{
  undefined *puVar1;
  int iVar2;
  int iVar3;
  
  FUN_140002f20();
  puVar1 = (undefined *)*param_1;
  iVar2 = 0;
  if (0 < param_2) {
    iVar2 = param_2;
  }
  iVar3 = 0;
  if ((puVar1 != (undefined *)0x0) && (iVar3 = 0, puVar1 != PTR_DAT_1402f8010)) {
    iVar3 = *(int *)(puVar1 + -8);
  }
  if ((iVar3 <= iVar2) && (iVar2 = 0, puVar1 != (undefined *)0x0)) {
    if (puVar1 == PTR_DAT_1402f8010) {
      return;
    }
    iVar2 = *(int *)(puVar1 + -8);
  }
  if (((puVar1 != PTR_DAT_1402f8010) && (puVar1 != (undefined *)0x0)) &&
     ((int *)(puVar1 + -8) != (int *)0x0)) {
    *(int *)(puVar1 + -8) = iVar2;
    *(undefined2 *)(puVar1 + (longlong)iVar2 * 2) = 0;
  }
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14016b750(longlong *param_1)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined4 *puVar3;
  longlong *plVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  undefined8 *puVar7;
  undefined8 *puVar8;
  undefined1 *puVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  undefined8 *puVar12;
  ulonglong uVar13;
  undefined1 auStack_38 [32];
  ulonglong local_18 [2];
  
  puVar9 = auStack_38;
  local_18[0] = DAT_1402f85a0 ^ (ulonglong)local_18;
  if ((ulonglong)param_1[2] < 0x65) {
    plVar4 = param_1 + 4;
  }
  else {
    plVar4 = (longlong *)*param_1;
  }
  FUN_14016af40(plVar4,(int)param_1[1],0);
  uVar5 = param_1[1] * 8 + 0x10;
  if (uVar5 < 0x401) {
    lVar1 = param_1[1] * 8;
    uVar5 = lVar1 + 0x1f;
    if (uVar5 <= lVar1 + 0x10U) {
      uVar5 = 0xffffffffffffff0;
    }
    lVar1 = -(uVar5 & 0xfffffffffffffff0);
    puVar9 = auStack_38 + lVar1;
    puVar3 = (undefined4 *)((longlong)local_18 + lVar1);
    puVar12 = (undefined8 *)0x0;
    if (puVar3 == (undefined4 *)0x0) goto LAB_14016b800;
    *puVar3 = 0xcccc;
    puVar9 = auStack_38 + lVar1;
  }
  else {
    puVar3 = malloc(uVar5);
    puVar12 = (undefined8 *)0x0;
    if (puVar3 == (undefined4 *)0x0) goto LAB_14016b800;
    *puVar3 = 0xdddd;
    puVar9 = auStack_38;
  }
  puVar12 = (undefined8 *)(puVar3 + 4);
LAB_14016b800:
  uVar5 = param_1[1];
  uVar13 = 0;
  uVar6 = uVar13;
  uVar10 = uVar13;
  uVar11 = uVar13;
  if (uVar5 != 0) {
    do {
      if (uVar10 == 0) {
LAB_14016b849:
        if (((longlong)uVar6 < 0) || (param_1[1] <= (longlong)uVar6)) {
                    // WARNING: Subroutine does not return
          *(undefined **)(puVar9 + -8) = &UNK_14016b8c4;
          FUN_1400a26d0();
        }
        if ((ulonglong)param_1[2] < 0x65) {
          plVar4 = param_1 + uVar6 + 4;
        }
        else {
          plVar4 = (longlong *)(*param_1 + uVar6 * 8);
        }
        uVar11 = uVar10 + 1;
        puVar12[uVar10] = *plVar4;
      }
      else {
        if (((longlong)uVar6 < 0) || (param_1[1] <= (longlong)uVar6)) {
                    // WARNING: Subroutine does not return
          *(undefined **)(puVar9 + -8) = &UNK_14016b8be;
          FUN_1400a26d0();
        }
        if ((ulonglong)param_1[2] < 0x65) {
          plVar4 = param_1 + uVar6 + 4;
        }
        else {
          plVar4 = (longlong *)(*param_1 + uVar6 * 8);
        }
        uVar11 = uVar10;
        if (*plVar4 != puVar12[uVar10 - 1]) goto LAB_14016b849;
      }
      uVar6 = uVar6 + 1;
      uVar10 = uVar11;
    } while (uVar6 < uVar5);
  }
  *(undefined8 *)(puVar9 + -8) = 0x14016b88b;
  FUN_14016a930(param_1,uVar11,0xffffffffffffffff);
  if (0 < (longlong)uVar11) {
    puVar8 = puVar12;
    do {
      if (((longlong)uVar13 < 0) || (param_1[1] <= (longlong)uVar13)) {
                    // WARNING: Subroutine does not return
        *(undefined **)(puVar9 + -8) = &UNK_14016b91d;
        FUN_1400a26d0();
      }
      if ((ulonglong)param_1[2] < 0x65) {
        lVar1 = (longlong)param_1 + (0x20 - (longlong)puVar12);
      }
      else {
        lVar1 = *param_1 - (longlong)puVar12;
      }
      puVar7 = (undefined8 *)(lVar1 + (longlong)puVar8);
      uVar2 = *puVar8;
      uVar13 = uVar13 + 1;
      puVar8 = puVar8 + 1;
      *puVar7 = uVar2;
    } while ((longlong)uVar13 < (longlong)uVar11);
  }
  if ((puVar12 != (undefined8 *)0x0) && (*(int *)(puVar12 + -2) == 0xdddd)) {
    *(undefined8 *)(puVar9 + -8) = 0x14016b8f6;
    free(puVar12 + -2);
  }
  *(undefined8 *)(puVar9 + -8) = 0x14016b902;
  return;
}



void FUN_14016b920(longlong param_1,longlong param_2)

{
  undefined2 *puVar1;
  int iVar2;
  
  if (0 < param_2) {
    iVar2 = 0;
    puVar1 = (undefined2 *)(param_1 + 0x3c);
    do {
      if (puVar1 != (undefined2 *)0x3c) {
        FUN_140185560();
        *(undefined ***)(puVar1 + -6) = Proud::AddrPort::vftable;
        *(undefined4 *)(puVar1 + -2) = 0;
        *puVar1 = 0;
        *(undefined1 *)(puVar1 + 2) = 0;
        *(undefined4 *)(puVar1 + -10) = 0;
        *(undefined4 *)(puVar1 + -2) = DAT_1402f83d0;
        *puVar1 = DAT_1402f83d4;
      }
      iVar2 = iVar2 + 1;
      puVar1 = puVar1 + 0x24;
    } while (iVar2 < param_2);
  }
  return;
}



void FUN_14016b9c0(longlong param_1,longlong param_2,longlong param_3)

{
  undefined4 *puVar1;
  int iVar2;
  
  if (0 < param_3) {
    iVar2 = 0;
    puVar1 = (undefined4 *)(param_1 + 0x38);
    param_2 = param_2 - param_1;
    do {
      if (puVar1 + -0xe != (undefined4 *)0x0) {
        FUN_140185590(puVar1 + -0xe,(longlong)puVar1 + param_2 + -0x38);
        puVar1[-4] = *(undefined4 *)((longlong)puVar1 + param_2 + -0x10);
        *(undefined ***)(puVar1 + -2) = Proud::AddrPort::vftable;
        *puVar1 = *(undefined4 *)((longlong)puVar1 + param_2);
        *(undefined2 *)(puVar1 + 1) = *(undefined2 *)((longlong)puVar1 + param_2 + 4);
        *(undefined1 *)(puVar1 + 2) = *(undefined1 *)((longlong)puVar1 + param_2 + 8);
      }
      iVar2 = iVar2 + 1;
      puVar1 = puVar1 + 0x12;
    } while (iVar2 < param_3);
  }
  return;
}



longlong FUN_14016ba60(longlong param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  
  FUN_140003100();
  *(undefined2 *)(param_1 + 8) = *(undefined2 *)(param_2 + 8);
  *(undefined4 *)(param_1 + 0xc) = *(undefined4 *)(param_2 + 0xc);
  *(undefined4 *)(param_1 + 0x10) = *(undefined4 *)(param_2 + 0x10);
  *(undefined4 *)(param_1 + 0x14) = *(undefined4 *)(param_2 + 0x14);
  *(undefined4 *)(param_1 + 0x18) = *(undefined4 *)(param_2 + 0x18);
  iVar1 = *(int *)(param_2 + 0x38);
  if (-1 < iVar1) {
    FUN_14003cda0(param_1 + 0x20,iVar1);
    uVar2 = 0;
    uVar3 = uVar2;
    if (*(int *)(param_2 + 0x38) != 0) {
      uVar3 = *(undefined8 *)(param_2 + 0x30);
    }
    if (*(int *)(param_1 + 0x38) != 0) {
      uVar2 = *(undefined8 *)(param_1 + 0x30);
    }
    FUN_1400224d0(uVar2,uVar3,(longlong)iVar1);
    *(undefined8 *)(param_1 + 0x48) = *(undefined8 *)(param_2 + 0x48);
    return param_1;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_14016bb00(longlong param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong lVar4;
  ulonglong uVar5;
  longlong lVar6;
  int iVar7;
  longlong lVar8;
  
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))();
  FUN_1400a1c30(uVar2);
  FUN_140143980(param_2,0);
  if (*(longlong *)(param_1 + 0x590) == 0) {
    lVar6 = 0;
  }
  else {
    lVar6 = *(longlong *)(param_1 + 0x580);
  }
  while( true ) {
    if (lVar6 == 0) {
      FUN_1400d1290(uVar2);
      return;
    }
    iVar1 = *(int *)(param_2 + 0x18);
    lVar8 = (longlong)iVar1;
    if (iVar1 < 0) break;
    iVar7 = *(int *)(param_2 + 0x18);
    FUN_140143980(param_2,iVar7 + 1);
    iVar7 = iVar7 - iVar1;
    if (0 < iVar7) {
      if (*(int *)(param_2 + 0x18) == 0) {
        lVar4 = 0;
        lVar3 = 0;
      }
      else {
        lVar4 = *(longlong *)(param_2 + 0x10);
        lVar3 = *(longlong *)(param_2 + 0x10);
      }
      memmove((void *)(lVar3 + 4 + lVar8 * 4),(void *)(lVar4 + lVar8 * 4),(longlong)iVar7 << 2);
    }
    if (*(int *)(param_2 + 0x18) == 0) {
      lVar4 = 0;
    }
    else {
      lVar4 = *(longlong *)(param_2 + 0x10);
    }
    uVar5 = 0;
    do {
      *(undefined1 *)(uVar5 + lVar4 + lVar8 * 4) = *(undefined1 *)(uVar5 + lVar6);
      uVar5 = uVar5 + 1;
    } while (uVar5 < 4);
    lVar6 = *(longlong *)(lVar6 + 0x10);
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_14016bc30(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong lVar4;
  double dVar5;
  undefined8 uVar6;
  undefined1 uVar7;
  
  uVar6 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(uVar2);
  uVar7 = 1;
  dVar5 = (double)(**(code **)(param_1[0xe] + 0x1c0))();
  lVar4 = 0;
  if (param_1[0xbb] != 0) {
    lVar4 = *(longlong *)(param_1[0xbb] + 0x38);
  }
  FUN_1401bd070(param_1 + 0x2ef,*(undefined8 *)(lVar4 + 0x100),param_3,param_4,uVar6,uVar2,uVar7);
  if ((char)param_1[0x2f1] != '\0') {
    if (((longlong *)param_1[0x2a4] != (longlong *)0x0) &&
       (lVar4 = *(longlong *)param_1[0x2a4], lVar4 != 0)) {
      FUN_1401bc610(lVar4 + -0x40,dVar5);
      if (param_1[0x2ce] == 0) {
        lVar4 = 0;
      }
      else {
        lVar4 = param_1[0x2cc];
      }
      for (; lVar4 != 0; lVar4 = *(longlong *)(lVar4 + 0x10)) {
        lVar3 = 0;
        if (*(longlong **)(lVar4 + 8) != (longlong *)0x0) {
          lVar3 = **(longlong **)(lVar4 + 8);
        }
        if (*(char *)(lVar3 + 0x684) == '\0') {
          if ((*(longlong **)(lVar3 + 0x18) != (longlong *)0x0) &&
             (**(longlong **)(lVar3 + 0x18) != 0)) {
            uVar6 = FUN_1401b8a70(lVar3);
            FUN_1401bc610(uVar6,dVar5);
          }
          uVar1 = FUN_1401b8ba0(lVar3 + 0x668);
          *(undefined4 *)(lVar3 + 0x58) = uVar1;
        }
      }
    }
    if ((((longlong *)param_1[699] != (longlong *)0x0) &&
        (lVar4 = *(longlong *)param_1[699], lVar4 != 0)) && (lVar4 != 0x40)) {
      if (lVar4 != 0) {
        lVar4 = lVar4 + -0x40;
      }
      FUN_1401b7fa0(lVar4,dVar5);
    }
  }
  if (DAT_1402f8058 < dVar5 - (double)param_1[0x1a]) {
    if (((longlong *)param_1[0x2a4] != (longlong *)0x0) &&
       (lVar4 = *(longlong *)param_1[0x2a4], lVar4 != 0)) {
      FUN_14019d4e0(*(undefined8 *)(lVar4 + 200),dVar5);
    }
    if (param_1[0x2ce] == 0) {
      lVar4 = 0;
    }
    else {
      lVar4 = param_1[0x2cc];
    }
    for (; lVar4 != 0; lVar4 = *(longlong *)(lVar4 + 0x10)) {
      lVar3 = 0;
      if (*(longlong **)(lVar4 + 8) != (longlong *)0x0) {
        lVar3 = **(longlong **)(lVar4 + 8);
      }
      if (((*(char *)(lVar3 + 0x684) == '\0') && (*(longlong **)(lVar3 + 0x18) != (longlong *)0x0))
         && (**(longlong **)(lVar3 + 0x18) != 0)) {
        lVar3 = FUN_1401b8a70();
        FUN_14019d4e0(*(undefined8 *)(lVar3 + 0x108),dVar5);
      }
    }
    param_1[0x1a] = (longlong)dVar5;
  }
  FUN_1400d1290(uVar2);
  return;
}



undefined8 * FUN_14016be20(longlong param_1,undefined8 *param_2)

{
  undefined8 uVar1;
  longlong lVar2;
  
  lVar2 = 0;
  uVar1 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))();
  FUN_1400a1c30(uVar1);
  if (*(longlong *)(param_1 + 0x1600) != 0) {
    lVar2 = *(longlong *)(param_1 + 0x15f0);
  }
  for (; lVar2 != 0; lVar2 = *(longlong *)(lVar2 + 0x10)) {
  }
  FUN_1400a3440();
  *param_2 = PTR_DAT_1402f8010;
  FUN_1400d1290(uVar1);
  return param_2;
}



void FUN_14016beb0(longlong param_1,undefined8 *param_2)

{
  undefined8 uVar1;
  longlong lVar2;
  undefined1 uVar3;
  longlong lVar4;
  
  uVar1 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))();
  FUN_1400a1c30(uVar1);
  *param_2 = *(undefined8 *)(param_1 + 0x5e8);
  param_2[1] = *(undefined8 *)(param_1 + 0x5f0);
  param_2[2] = *(undefined8 *)(param_1 + 0x5f8);
  param_2[3] = *(undefined8 *)(param_1 + 0x600);
  param_2[4] = *(undefined8 *)(param_1 + 0x608);
  param_2[5] = *(undefined8 *)(param_1 + 0x610);
  param_2[6] = *(undefined8 *)(param_1 + 0x618);
  param_2[7] = *(undefined8 *)(param_1 + 0x620);
  *(int *)(param_2 + 6) = (int)*(undefined8 *)(param_1 + 0x1600);
  if ((*(longlong **)(param_1 + 0x1500) == (longlong *)0x0) ||
     (lVar2 = **(longlong **)(param_1 + 0x1500), lVar2 == 0)) {
    uVar3 = 0;
  }
  else {
    uVar3 = *(undefined1 *)(lVar2 + 0x80);
  }
  *(undefined1 *)((longlong)param_2 + 0x34) = uVar3;
  *(undefined4 *)(param_1 + 0x620) = 0;
  if (*(longlong *)(param_1 + 0x1600) == 0) {
    lVar2 = 0;
  }
  else {
    lVar2 = *(longlong *)(param_1 + 0x15f0);
  }
  for (; lVar2 != 0; lVar2 = *(longlong *)(lVar2 + 0x10)) {
    lVar4 = 0;
    if (*(longlong **)(lVar2 + 8) != (longlong *)0x0) {
      lVar4 = **(longlong **)(lVar2 + 8);
    }
    if (*(char *)(lVar4 + 0x608) == '\0') {
      *(int *)(param_1 + 0x620) = *(int *)(param_1 + 0x620) + 1;
    }
  }
  FUN_1400d1290(uVar1);
  return;
}



void FUN_14016bfd0(longlong param_1,longlong param_2)

{
  undefined4 uVar1;
  undefined4 uVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  int iVar6;
  longlong lVar7;
  longlong lVar8;
  int iVar9;
  longlong lVar10;
  longlong lVar11;
  
  FUN_140195930(param_2,0);
  iVar3 = *(int *)(param_1 + 0x18);
  iVar9 = 0;
  lVar10 = 0;
  if (0 < iVar3) {
    lVar11 = 0;
    do {
      if ((lVar10 < 0) || (iVar3 <= iVar9)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      iVar3 = *(int *)(param_2 + 0x18);
      uVar1 = *(undefined4 *)(lVar11 + 8 + *(longlong *)(param_1 + 0x10));
      uVar2 = *(undefined4 *)(*(longlong *)(lVar11 + *(longlong *)(param_1 + 0x10)) + 0x56c);
      if (iVar3 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      iVar6 = *(int *)(param_2 + 0x18);
      FUN_140195930(param_2,iVar6 + 1);
      iVar6 = iVar6 - iVar3;
      if ((0 < iVar6) && (iVar6 = iVar6 + -1, lVar8 = (longlong)iVar6, -1 < iVar6)) {
        lVar7 = (lVar8 + iVar3) * 8 + 8;
        do {
          lVar4 = FUN_1401b2160(param_2);
          lVar5 = FUN_1401b2160(param_2);
          *(undefined8 *)(lVar5 + lVar7) = *(undefined8 *)(lVar4 + -8 + lVar7);
          lVar7 = lVar7 + -8;
          lVar8 = lVar8 + -1;
        } while (-1 < lVar8);
      }
      lVar8 = FUN_1401b2160(param_2);
      *(ulonglong *)(lVar8 + (longlong)iVar3 * 8) = CONCAT44(uVar1,uVar2);
      iVar3 = *(int *)(param_1 + 0x18);
      iVar9 = iVar9 + 1;
      lVar10 = lVar10 + 1;
      lVar11 = lVar11 + 0x10;
    } while (iVar9 < iVar3);
  }
  return;
}



void FUN_14016c100(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  if (*(longlong *)(param_1 + 0x1670) == 0) {
    lVar1 = 0;
  }
  else {
    lVar1 = *(longlong *)(param_1 + 0x1660);
  }
  while (lVar1 != 0) {
    if (*(undefined8 **)(lVar1 + 8) == (undefined8 *)0x0) {
      FUN_1401bac10(0,1,param_2);
      lVar1 = *(longlong *)(lVar1 + 0x10);
    }
    else {
      FUN_1401bac10(**(undefined8 **)(lVar1 + 8),1,param_2);
      lVar1 = *(longlong *)(lVar1 + 0x10);
    }
  }
  return;
}



void FUN_14016c160(longlong *param_1)

{
  undefined8 uVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong lVar4;
  
  uVar1 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(uVar1);
  if ((((longlong *)param_1[699] != (longlong *)0x0) &&
      (lVar3 = *(longlong *)param_1[699], lVar3 != 0)) && (lVar3 != 0x40)) {
    if (lVar3 != 0) {
      lVar3 = lVar3 + -0x40;
    }
    FUN_1401b8140(lVar3);
  }
  if ((((longlong *)param_1[0x2a4] != (longlong *)0x0) &&
      (lVar3 = *(longlong *)param_1[0x2a4], lVar3 != 0)) && (lVar3 != 0x40)) {
    if (lVar3 != 0) {
      lVar3 = lVar3 + -0x40;
    }
    FUN_1401bc360(lVar3);
  }
  if (param_1[0x2ce] == 0) {
    lVar3 = 0;
  }
  else {
    lVar3 = param_1[0x2cc];
  }
  for (; lVar3 != 0; lVar3 = *(longlong *)(lVar3 + 0x10)) {
    lVar4 = 0;
    if (*(longlong **)(lVar3 + 8) != (longlong *)0x0) {
      lVar4 = **(longlong **)(lVar3 + 8);
    }
    if (((*(char *)(lVar4 + 0x684) == '\0') && (*(longlong **)(lVar4 + 0x18) != (longlong *)0x0)) &&
       (**(longlong **)(lVar4 + 0x18) != 0)) {
      uVar2 = FUN_1401b8a70();
      FUN_1401bc360(uVar2);
    }
  }
  FUN_1400d1290(uVar1);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_14016c250(longlong param_1)

{
  int *piVar1;
  longlong lVar2;
  double dVar3;
  undefined8 uVar4;
  undefined4 local_res8 [2];
  
  if ((*(char *)(param_1 + 0x6cc) != '\0') &&
     (dVar3 = (double)(**(code **)(*(longlong *)(param_1 + 0x70) + 0x1c0))(param_1 + 0x70),
     _DAT_1402f8168 < dVar3 - *(double *)(param_1 + 0x638))) {
    if (*(longlong *)(param_1 + 0x1670) == 0) {
      piVar1 = (int *)0x0;
    }
    else {
      piVar1 = *(int **)(param_1 + 0x1660);
    }
    for (; piVar1 != (int *)0x0; piVar1 = *(int **)(piVar1 + 4)) {
      uVar4 = (**(code **)(*(longlong *)(param_1 + 0x70) + 0x1c0))(param_1 + 0x70);
      *(undefined8 *)(param_1 + 0x638) = uVar4;
      if (piVar1 == (int *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      if (*(int *)(param_1 + 0x1578) < *piVar1) {
        lVar2 = 0;
        if (*(longlong **)(piVar1 + 2) != (longlong *)0x0) {
          lVar2 = **(longlong **)(piVar1 + 2);
        }
        if ((*(char *)(lVar2 + 0x684) == '\0') && (*(char *)(lVar2 + 0x608) == '\0')) {
          if ((*(double *)(lVar2 + 0x50) <= 0.0) ||
             ((*(double *)(lVar2 + 0x60) <= 0.0 ||
              (dVar3 = *(double *)(lVar2 + 0x60) + *(double *)(param_1 + 0x4f8),
              *(double *)(lVar2 + 0x50) <= dVar3)))) {
            dVar3 = *(double *)(lVar2 + 0x50);
          }
          local_res8[0] = (undefined4)(longlong)(dVar3 * 1000.0);
          (**(code **)(*(longlong *)(param_1 + 0x1818) + 0x110))
                    ((longlong *)(param_1 + 0x1818),1,&DAT_140318cf0,lVar2 + 0x56c,local_res8);
        }
      }
    }
  }
  return;
}



void FUN_14016c3b0(longlong *param_1)

{
  undefined8 uVar1;
  longlong lVar2;
  double dVar3;
  longlong lVar4;
  undefined4 local_res8 [2];
  undefined8 uVar5;
  undefined8 uVar6;
  undefined1 uVar7;
  
  uVar5 = 0xfffffffffffffffe;
  uVar1 = (**(code **)(*param_1 + 0x58))();
  uVar6 = uVar1;
  FUN_1400a1c30(uVar1);
  uVar7 = 1;
  if (((int)param_1[0x2af] != 0) && (0.0 < (double)param_1[0xa2])) {
    dVar3 = (double)(**(code **)(param_1[0xe] + 0x1c0))(param_1 + 0xe);
    if (DAT_1402f8100 < dVar3 - (double)param_1[0xa2]) {
      lVar4 = (**(code **)(param_1[0xe] + 0x1c0))(param_1 + 0xe);
      param_1[0xa2] = lVar4;
      local_res8[0] = (undefined4)param_1[0xa1];
      (**(code **)(param_1[0x303] + 0x150))
                (param_1 + 0x303,1,&DAT_140318cf0,local_res8,uVar5,uVar6,uVar7);
      if (param_1[0x2ce] == 0) {
        lVar4 = 0;
      }
      else {
        lVar4 = param_1[0x2cc];
      }
      for (; lVar4 != 0; lVar4 = *(longlong *)(lVar4 + 0x10)) {
        lVar2 = 0;
        if (*(longlong **)(lVar4 + 8) != (longlong *)0x0) {
          lVar2 = **(longlong **)(lVar4 + 8);
        }
        if (*(char *)(lVar2 + 0x684) == '\0') {
          (**(code **)(param_1[0x2fa] + 0x40))
                    (param_1 + 0x2fa,*(undefined4 *)(lVar2 + 0x56c),&DAT_140318cf0,lVar2 + 0x48);
        }
      }
    }
  }
  FUN_1400d1290(uVar1);
  return;
}



undefined4 FUN_14016c4e0(longlong param_1,longlong param_2)

{
  char cVar1;
  short sVar2;
  longlong lVar3;
  int iVar4;
  longlong lVar5;
  
  (**(code **)(*(longlong *)(param_1 + 0x78) + 0x10))(param_1 + 0x78);
  if ((*(int *)(param_2 + 8) == 0) || (cVar1 = FUN_1400a64d0(param_2), cVar1 != '\0')) {
    if ((*(longlong **)(param_1 + 0x1570) != (longlong *)0x0) &&
       ((lVar3 = **(longlong **)(param_1 + 0x1570), lVar3 != 0 &&
        (cVar1 = FUN_1400a64d0(lVar3 + 200), cVar1 != '\0')))) {
      lVar3 = 0;
      if (*(longlong **)(param_1 + 0x1570) != (longlong *)0x0) {
        lVar3 = **(longlong **)(param_1 + 0x1570);
      }
      if ((*(int *)(lVar3 + 0xd0) == *(int *)(param_2 + 8)) &&
         (*(short *)(lVar3 + 0xd4) == *(short *)(param_2 + 0xc))) {
        return 1;
      }
    }
    iVar4 = DAT_1402f83d0;
    sVar2 = DAT_1402f83d4;
    if ((((*(longlong **)(param_1 + 0x1520) != (longlong *)0x0) &&
         (lVar3 = **(longlong **)(param_1 + 0x1520), lVar3 != 0)) && (lVar3 != 0x40)) &&
       (iVar4 = iRam0000000000000140, sVar2 = sRam0000000000000144, lVar3 != 0)) {
      iVar4 = *(int *)(lVar3 + 0x100);
      sVar2 = *(short *)(lVar3 + 0x104);
    }
    if ((iVar4 == *(int *)(param_2 + 8)) && (sVar2 == *(short *)(param_2 + 0xc))) {
      return *(undefined4 *)(param_1 + 0x1578);
    }
    if (*(longlong *)(param_1 + 0x1670) == 0) {
      lVar3 = 0;
    }
    else {
      lVar3 = *(longlong *)(param_1 + 0x1660);
    }
    for (; lVar3 != 0; lVar3 = *(longlong *)(lVar3 + 0x10)) {
      lVar5 = 0;
      if (*(longlong **)(lVar3 + 8) != (longlong *)0x0) {
        lVar5 = **(longlong **)(lVar3 + 8);
      }
      if ((*(int *)(lVar5 + 0x5a8) == *(int *)(param_2 + 8)) &&
         (*(short *)(lVar5 + 0x5ac) == *(short *)(param_2 + 0xc))) {
        return *(undefined4 *)(lVar5 + 0x56c);
      }
    }
  }
  return 0;
}



void FUN_14016c640(longlong *param_1)

{
  undefined8 *puVar1;
  void *pvVar2;
  
  if (*param_1 != 0) {
    *(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1;
    if (*(longlong *)(*param_1 + 8) == 0) {
      puVar1 = (undefined8 *)*param_1;
      pvVar2 = (void *)*puVar1;
      if (pvVar2 != (void *)0x0) {
        FUN_1401aa050(pvVar2);
        operator_delete(pvVar2);
      }
      FUN_1400a3530(puVar1);
    }
  }
  return;
}



longlong * FUN_14016c6b0(longlong *param_1)

{
  wint_t _C;
  int iVar1;
  wint_t *pwVar2;
  undefined *puVar3;
  wint_t *pwVar4;
  
  pwVar2 = (wint_t *)*param_1;
  if ((wint_t *)*param_1 == (wint_t *)0x0) {
    pwVar2 = (wint_t *)PTR_DAT_1402f8010;
  }
  pwVar4 = (wint_t *)0x0;
  _C = *pwVar2;
  if (_C != 0) {
    do {
      iVar1 = iswspace(_C);
      if (iVar1 == 0) {
        pwVar4 = (wint_t *)0x0;
      }
      else if (pwVar4 == (wint_t *)0x0) {
        pwVar4 = pwVar2;
      }
      pwVar2 = (wint_t *)FUN_1400a3340(pwVar2);
      _C = *pwVar2;
    } while (_C != 0);
    if (pwVar4 != (wint_t *)0x0) {
      puVar3 = (undefined *)*param_1;
      if ((undefined *)*param_1 == (undefined *)0x0) {
        puVar3 = PTR_DAT_1402f8010;
      }
      FUN_14016b6d0(param_1,(longlong)pwVar4 - (longlong)puVar3 >> 1 & 0xffffffff);
    }
  }
  return param_1;
}



void FUN_14016c750(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  void *pvVar2;
  undefined8 *puVar3;
  
  lVar1 = *param_2;
  if (lVar1 != *param_1) {
    if (lVar1 != 0) {
      *(longlong *)(*param_2 + 8) = *(longlong *)(lVar1 + 8) + 1;
    }
    puVar3 = (undefined8 *)0x0;
    if ((*param_1 != 0) &&
       (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
       *(longlong *)(*param_1 + 8) == 0)) {
      puVar3 = (undefined8 *)*param_1;
    }
    *param_1 = *param_2;
    if (puVar3 != (undefined8 *)0x0) {
      pvVar2 = (void *)*puVar3;
      if (pvVar2 != (void *)0x0) {
        FUN_1401aa050(pvVar2);
        operator_delete(pvVar2);
      }
      FUN_1400a3530(puVar3);
    }
  }
  return;
}



void FUN_14016c7e0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined8 uVar2;
  undefined *local_res18 [2];
  
  uVar2 = FUN_1400a73d0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  FUN_14003c400(param_1,uVar2);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1402f8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar2 = FUN_1400a3440();
    FUN_1400a1c30(uVar2);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res18[0] + -8);
    }
    FUN_1400d1290(uVar2);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014016c8cc)
// WARNING: Removing unreachable block (ram,0x00014016c8d5)
// WARNING: Removing unreachable block (ram,0x00014016c8f3)
// WARNING: Removing unreachable block (ram,0x00014016c8fc)

undefined4 * FUN_14016c870(undefined4 *param_1)

{
  *(undefined1 *)(param_1 + 2) = 0;
  param_1[0xc] = 0x11;
  *(undefined8 *)(param_1 + 0x16) = 0;
  *(undefined8 *)(param_1 + 4) = 0;
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 10) = 0;
  param_1[0x14] = 0;
  param_1[0xd] = 0x3f400000;
  param_1[0xe] = 0x3e800000;
  param_1[0xf] = 0x40100000;
  *(undefined8 *)(param_1 + 0x10) = 0x26;
  *(undefined8 *)(param_1 + 0x12) = 0;
  *param_1 = 0;
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

undefined8 FUN_14016c920(longlong *param_1,int *param_2,undefined8 param_3)

{
  int *piVar1;
  int iVar2;
  undefined *puVar3;
  char cVar4;
  undefined4 uVar5;
  DWORD DVar6;
  DWORD DVar7;
  undefined *******pppppppuVar8;
  undefined **ppuVar9;
  undefined ******ppppppuVar10;
  undefined ******ppppppuVar11;
  undefined8 uVar12;
  undefined2 uVar13;
  undefined ******ppppppuVar14;
  int iVar15;
  undefined ******ppppppuVar16;
  undefined1 auStack_4b8 [32];
  undefined ********local_498;
  undefined *******local_490;
  undefined ***local_488;
  undefined ********local_480;
  undefined *******local_478;
  undefined ********local_470;
  undefined *******local_468;
  undefined1 *local_460;
  undefined2 *local_458;
  undefined *******local_448;
  undefined ********local_440;
  undefined ********local_438;
  undefined2 local_430 [4];
  undefined ******local_428;
  undefined ******local_420;
  undefined8 local_418;
  int local_410;
  undefined8 local_408;
  undefined **local_400;
  undefined *local_3f8;
  undefined ******local_3f0;
  undefined8 local_3e8;
  undefined8 local_3e0;
  undefined4 local_3d8 [2];
  undefined ********local_3d0;
  undefined8 local_3c8;
  int local_3c0;
  undefined8 local_3b8;
  undefined1 local_3a8 [4];
  int local_3a4;
  undefined8 local_370;
  undefined **local_348;
  undefined8 local_340;
  int local_338;
  undefined8 local_330;
  undefined4 local_328 [2];
  undefined ******local_320;
  undefined ******local_318;
  undefined *****local_310;
  undefined *****local_308;
  undefined *****local_300;
  undefined4 local_2f8 [2];
  undefined *****local_2f0;
  undefined4 local_2e8 [2];
  undefined *****local_2e0;
  undefined4 local_2d8 [2];
  undefined *****local_2d0;
  undefined4 local_2c8 [2];
  undefined *****local_2c0;
  undefined4 local_2b8 [2];
  undefined *****local_2b0;
  undefined *local_2a8;
  undefined *****local_2a0;
  undefined *****local_298;
  undefined *****local_290;
  undefined4 local_288 [2];
  undefined *****local_280;
  undefined4 local_278 [2];
  undefined *****local_270;
  undefined4 local_268 [2];
  undefined *****local_260;
  undefined *local_258;
  undefined *****local_250;
  undefined *****local_248;
  undefined4 local_240;
  undefined4 local_23c;
  undefined4 local_238 [2];
  undefined *****local_230;
  undefined4 local_228;
  undefined4 local_224;
  undefined4 local_220;
  undefined4 local_21c;
  undefined **local_218;
  undefined *local_210;
  undefined ******local_208;
  undefined8 local_200;
  undefined8 local_1f8;
  undefined *local_1f0;
  undefined *local_1e8;
  undefined **local_1e0;
  undefined8 local_1d8;
  undefined ******local_1d0;
  undefined8 local_1c8;
  undefined8 local_1c0;
  undefined1 local_1b8 [8];
  undefined1 local_1b0 [8];
  undefined1 local_1a8 [8];
  undefined1 local_1a0 [8];
  undefined1 local_198 [8];
  undefined1 local_190 [8];
  undefined1 local_188 [8];
  undefined1 local_180 [8];
  undefined1 local_178 [8];
  undefined1 local_170 [8];
  undefined1 local_168 [8];
  undefined1 local_160 [8];
  undefined1 local_158 [8];
  undefined1 local_150 [8];
  undefined1 local_148 [8];
  undefined1 local_140 [8];
  undefined1 local_138 [8];
  undefined1 local_130 [8];
  undefined1 local_128 [8];
  undefined1 local_120 [8];
  undefined1 local_118 [8];
  undefined1 local_110 [8];
  undefined1 local_108 [8];
  undefined1 local_100 [8];
  undefined1 local_f8 [8];
  undefined1 local_f0 [8];
  undefined1 local_e8 [8];
  undefined1 local_e0 [8];
  undefined1 local_d8 [8];
  undefined1 local_d0 [8];
  undefined1 local_c8 [8];
  undefined8 local_c0;
  undefined1 local_b8 [8];
  undefined1 local_b0 [8];
  undefined1 local_a8 [16];
  undefined *******local_98;
  undefined8 uStack_90;
  int local_88;
  undefined8 local_80;
  undefined *******local_78;
  undefined8 uStack_70;
  int local_68;
  undefined8 local_60;
  int local_58;
  ulonglong local_48;
  
  local_c0 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_4b8;
  iVar2 = param_2[10];
  if (iVar2 == 0) {
    FUN_140169430(param_1,0);
  }
  iVar15 = *param_2;
  cVar4 = FUN_140185e40(param_2,local_2c8);
  if (cVar4 == '\0') {
switchD_14016c9c4_default:
    FUN_140185160(param_2,(int)((iVar15 >> 0x1f & 7U) + iVar15) >> 3);
    return 0;
  }
  local_370 = param_3;
  switch(local_2c8[0]) {
  case 0xfbf5:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140185f20(param_2,&local_440);
    FUN_140185f20(param_2,&local_438);
    ppppppuVar10 = (undefined ******)0x0;
    ppppppuVar16 = (undefined ******)0x0;
    local_3f8 = (undefined *)0x0;
    local_3f0 = (undefined ******)0x0;
    local_3e8 = 0;
    local_3e0 = 0;
    local_400 = Proud::ByteArray::vftable;
    cVar4 = FUN_140185b30(param_2,&local_420);
    ppppppuVar11 = local_420;
    if (((cVar4 != '\0') && (-1 < (int)local_420)) && ((int)local_420 <= DAT_1402f8140)) {
      FUN_14003cda0(&local_400,(ulonglong)local_420 & 0xffffffff);
      ppppppuVar14 = local_3f0;
      if ((int)local_3e8 == 0) {
        ppppppuVar14 = ppppppuVar10;
      }
      FUN_140185490(param_2,ppppppuVar14,(ulonglong)ppppppuVar11 & 0xffffffff);
    }
    cVar4 = FUN_140185490(param_2,&local_420,4);
    if (cVar4 != '\0') {
      local_3d8[0] = local_420._0_4_;
    }
    local_210 = (undefined *)0x0;
    local_208 = (undefined ******)0x0;
    local_200 = 0;
    local_1f8 = 0;
    local_218 = Proud::ByteArray::vftable;
    cVar4 = FUN_140185b30(param_2,&local_420);
    ppppppuVar11 = local_420;
    if (((cVar4 != '\0') && (-1 < (int)local_420)) && ((int)local_420 <= DAT_1402f8140)) {
      FUN_14003cda0(&local_218,(ulonglong)local_420 & 0xffffffff);
      ppppppuVar14 = local_208;
      if ((int)local_200 == 0) {
        ppppppuVar14 = ppppppuVar10;
      }
      FUN_140185490(param_2,ppppppuVar14,(ulonglong)ppppppuVar11 & 0xffffffff);
    }
    local_1d8 = 0;
    local_1d0 = (undefined ******)0x0;
    local_1c8 = 0;
    local_1c0 = 0;
    local_1e0 = Proud::ByteArray::vftable;
    cVar4 = FUN_140185b30(param_2,&local_420);
    ppppppuVar11 = local_420;
    if (((cVar4 != '\0') && (-1 < (int)local_420)) && ((int)local_420 <= DAT_1402f8140)) {
      FUN_14003cda0(&local_1e0,(ulonglong)local_420 & 0xffffffff);
      ppppppuVar14 = local_1d0;
      if ((int)local_1c8 == 0) {
        ppppppuVar14 = ppppppuVar10;
      }
      FUN_140185490(param_2,ppppppuVar14,(ulonglong)ppppppuVar11 & 0xffffffff);
    }
    cVar4 = FUN_140185490(param_2,&local_420,4);
    uVar5 = 0;
    if (cVar4 != '\0') {
      uVar5 = local_420._0_4_;
    }
    local_3d0 = (undefined ********)CONCAT44(local_3d0._4_4_,uVar5);
    local_98 = (undefined *******)0x0;
    uStack_90 = (undefined *)0x0;
    local_78 = (undefined *******)0x0;
    uStack_70 = (undefined *)0x0;
    cVar4 = FUN_140185490(param_2,&local_78,0x10);
    if (cVar4 != '\0') {
      local_98 = local_78;
      uStack_90 = uStack_70;
    }
    cVar4 = FUN_140185490(param_2,&local_420,1);
    if (cVar4 != '\0') {
      local_448._0_1_ = local_420._0_1_;
    }
    cVar4 = FUN_140185490(param_2,&local_420,2);
    if (cVar4 != '\0') {
      local_430[0] = local_420._0_2_;
    }
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b618);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] != '\0') goto LAB_14016d0ba;
      local_498 = (undefined ********)&DAT_14027d1a0;
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbf5,PTR_DAT_14030b618);
    }
    else {
      ppppppuVar16 = ppppppuVar10;
      if ((char)param_1[3] != '\0') goto LAB_14016d0ba;
      FUN_1400a3440();
      local_420 = (undefined ******)PTR_DAT_1402f8010;
      local_2b8[0] = local_440._0_4_;
      FUN_1401a28c0(&local_420,local_2b8);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      local_240 = local_438._0_4_;
      FUN_1401a28c0(&local_420,&local_240);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      FUN_1401a2bc0(&local_420,&local_400);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      FUN_1401a2920(&local_420,local_3d8);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      FUN_1401a2bc0(&local_420,&local_218);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      FUN_1401a2bc0(&local_420,&local_1e0);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      local_238[0] = local_3d0._0_4_;
      FUN_1401a28c0(&local_420,local_238);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      FUN_1401a2bd0(&local_420,&local_98);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      FUN_1401a2720(&local_420,&local_448);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      FUN_1401a2860(&local_420,local_430);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      iVar15 = 0;
      if ((local_420 != (undefined ******)0x0) && (local_420 != (undefined ******)PTR_DAT_1402f8010)
         ) {
        iVar15 = *(int *)(local_420 + -1);
      }
      local_428 = (undefined ******)FUN_14003c0c0(&local_420,&local_1f0,iVar15 + -2);
      if (local_420 == (undefined ******)0x0) {
        local_420 = (undefined ******)PTR_DAT_1402f8010;
      }
      if ((undefined ******)*local_428 != local_420) {
        pppppppuVar8 = (undefined *******)FUN_1400a3440();
        local_78 = pppppppuVar8;
        FUN_1400a1c30(pppppppuVar8);
        ppppppuVar11 = local_420;
        uStack_70 = (undefined *)CONCAT71(uStack_70._1_7_,1);
        if (((local_420 != (undefined ******)0x0) &&
            (local_420 != (undefined ******)PTR_DAT_1402f8010)) &&
           (ppppppuVar16 = local_420 + -1, ppppppuVar16 != (undefined ******)0x0)) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_348 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          local_340 = (undefined *)CONCAT71(local_340._1_7_,1);
          piVar1 = (int *)((longlong)ppppppuVar11 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(ppppppuVar16);
          }
          FUN_1400d1290(ppuVar9);
        }
        local_420 = (undefined ******)*local_428;
        if (((local_420 != (undefined ******)PTR_DAT_1402f8010) &&
            (local_420 != (undefined ******)0x0)) && (local_420 != (undefined ******)0x8)) {
          *(int *)((longlong)local_420 + -4) = *(int *)((longlong)local_420 + -4) + 1;
        }
        FUN_1400d1290(pppppppuVar8);
      }
      if (((local_1f0 != (undefined *)0x0) && (local_1f0 != PTR_DAT_1402f8010)) &&
         (local_1f0 + -8 != (undefined *)0x0)) {
        pppppppuVar8 = (undefined *******)FUN_1400a3440();
        local_78 = pppppppuVar8;
        FUN_1400a1c30(pppppppuVar8);
        uStack_70 = (undefined *)CONCAT71(uStack_70._1_7_,1);
        piVar1 = (int *)(local_1f0 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_1f0 + -8);
        }
        FUN_1400d1290(pppppppuVar8);
      }
      local_428 = (undefined ******)&local_318;
      local_1f0 = PTR_DAT_1402f8010;
      FUN_1400a3440();
      local_318 = (undefined ******)PTR_DAT_1402f8010;
      if (PTR_DAT_1402f8010 == (undefined *)0x0) {
        local_318 = ppppppuVar10;
      }
      if (local_420 != (undefined ******)PTR_DAT_1402f8010) {
        pppppppuVar8 = (undefined *******)FUN_1400a3440();
        local_78 = pppppppuVar8;
        FUN_1400a1c30(pppppppuVar8);
        uStack_70 = (undefined *)CONCAT71(uStack_70._1_7_,1);
        FUN_1400031d0(&local_318);
        local_318 = local_420;
        if (((local_420 != (undefined ******)PTR_DAT_1402f8010) &&
            (local_420 != (undefined ******)0x0)) && (local_420 != (undefined ******)0x8)) {
          *(int *)((longlong)local_420 + -4) = *(int *)((longlong)local_420 + -4) + 1;
        }
        FUN_1400d1290(pppppppuVar8);
      }
      puVar3 = PTR_DAT_14030b618;
      FUN_1400a3440();
      local_258 = PTR_DAT_1402f8010;
      uVar5 = FUN_1400a32c0(puVar3);
      uVar12 = FUN_140002f20(&local_258,uVar5);
      FUN_1400a32f0(uVar12,puVar3,uVar5);
      FUN_140003000(&local_258);
      (**(code **)(*param_1 + 0x28))(param_1,0xfbf5,&local_258,&local_318);
      local_498 = (undefined ********)local_420;
      if (local_420 == (undefined ******)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbf5,PTR_DAT_14030b618);
      ppppppuVar11 = local_420;
      if (((local_420 != (undefined ******)0x0) &&
          (local_420 != (undefined ******)PTR_DAT_1402f8010)) &&
         (ppppppuVar16 = local_420 + -1, ppppppuVar16 != (undefined ******)0x0)) {
        pppppppuVar8 = (undefined *******)FUN_1400a3440();
        local_78 = pppppppuVar8;
        FUN_1400a1c30(pppppppuVar8);
        uStack_70 = (undefined *)CONCAT71(uStack_70._1_7_,1);
        piVar1 = (int *)((longlong)ppppppuVar11 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(ppppppuVar16);
        }
        FUN_1400d1290(pppppppuVar8);
      }
    }
    ppppppuVar16 = ppppppuVar10;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_78 = (undefined *******)CONCAT44(local_78._4_4_,0xfbf5);
      uStack_70 = PTR_DAT_14030b618;
      local_68 = iVar2;
      local_60 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_78);
      DVar6 = GetTickCount();
      ppppppuVar16 = (undefined ******)(ulonglong)DVar6;
    }
LAB_14016d0ba:
    local_458 = local_430;
    local_460 = (undefined1 *)&local_448;
    local_468 = (undefined *******)&local_98;
    local_470 = (undefined ********)&local_3d0;
    local_478 = (undefined *******)&local_1e0;
    local_480 = (undefined ********)&local_218;
    local_488 = (undefined ***)local_3d8;
    local_490 = (undefined *******)&local_400;
    local_498 = (undefined ********)&local_438;
    cVar4 = (**(code **)(*param_1 + 0x38))(param_1,iVar2,local_3a8,&local_440);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b618);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_78 = (undefined *******)CONCAT44(local_78._4_4_,0xfbf5);
      uStack_70 = PTR_DAT_14030b618;
      local_68 = iVar2;
      local_60 = param_3;
      DVar6 = GetTickCount();
      local_58 = DVar6 - (int)ppppppuVar16;
      (**(code **)(*param_1 + 0x18))(param_1,&local_78);
    }
    FUN_140140df0(&local_1e0);
    FUN_140140df0(&local_218);
    FUN_140140df0(&local_400);
    return 1;
  case 0xfbf6:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140185f20(param_2,&local_3d0);
    FUN_140185f20(param_2,&local_438);
    ppppppuVar10 = (undefined ******)0x0;
    ppppppuVar16 = (undefined ******)0x0;
    local_3f8 = (undefined *)0x0;
    local_3f0 = (undefined ******)0x0;
    local_3e8 = 0;
    local_3e0 = 0;
    local_400 = Proud::ByteArray::vftable;
    cVar4 = FUN_140185b30(param_2,&local_428);
    ppppppuVar11 = local_428;
    if (((cVar4 != '\0') && (-1 < (int)local_428)) && ((int)local_428 <= DAT_1402f8140)) {
      FUN_14003cda0(&local_400,(ulonglong)local_428 & 0xffffffff);
      ppppppuVar14 = local_3f0;
      if ((int)local_3e8 == 0) {
        ppppppuVar14 = ppppppuVar10;
      }
      FUN_140185490(param_2,ppppppuVar14,(ulonglong)ppppppuVar11 & 0xffffffff);
    }
    cVar4 = FUN_140185490(param_2,&local_420,4);
    if (cVar4 != '\0') {
      local_3d8[0] = local_420._0_4_;
    }
    cVar4 = FUN_140185490(param_2,&local_420,4);
    uVar5 = 0;
    if (cVar4 != '\0') {
      uVar5 = local_420._0_4_;
    }
    local_440 = (undefined ********)CONCAT44(local_440._4_4_,uVar5);
    local_98 = (undefined *******)0x0;
    uStack_90 = (undefined *)0x0;
    local_78 = (undefined *******)0x0;
    uStack_70 = (undefined *)0x0;
    cVar4 = FUN_140185490(param_2,&local_78,0x10);
    if (cVar4 != '\0') {
      local_98 = local_78;
      uStack_90 = uStack_70;
    }
    cVar4 = FUN_140185490(param_2,&local_420,1);
    if (cVar4 != '\0') {
      local_448._0_1_ = local_420._0_1_;
    }
    cVar4 = FUN_140185490(param_2,&local_420,2);
    if (cVar4 != '\0') {
      local_430[0] = local_420._0_2_;
    }
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b620);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] != '\0') goto LAB_14016d78c;
      local_498 = (undefined ********)&DAT_14027d1a0;
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbf6,PTR_DAT_14030b620);
    }
    else {
      ppppppuVar16 = ppppppuVar10;
      if ((char)param_1[3] != '\0') goto LAB_14016d78c;
      FUN_1400a3440();
      local_420 = (undefined ******)PTR_DAT_1402f8010;
      local_228 = local_3d0._0_4_;
      FUN_1401a28c0(&local_420,&local_228);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      local_220 = local_438._0_4_;
      FUN_1401a28c0(&local_420,&local_220);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      FUN_1401a2bc0(&local_420,&local_400);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      FUN_1401a2920(&local_420,local_3d8);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      local_288[0] = local_440._0_4_;
      FUN_1401a28c0(&local_420,local_288);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      FUN_1401a2bd0(&local_420,&local_98);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      FUN_1401a2720(&local_420,&local_448);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      FUN_1401a2860(&local_420,local_430);
      FUN_14003c890(&local_420,&DAT_14027c73c);
      iVar15 = 0;
      if ((local_420 != (undefined ******)0x0) && (local_420 != (undefined ******)PTR_DAT_1402f8010)
         ) {
        iVar15 = *(int *)(local_420 + -1);
      }
      local_428 = (undefined ******)FUN_14003c0c0(&local_420,&local_1e8,iVar15 + -2);
      if (local_420 == (undefined ******)0x0) {
        local_420 = (undefined ******)PTR_DAT_1402f8010;
      }
      if ((undefined ******)*local_428 != local_420) {
        pppppppuVar8 = (undefined *******)FUN_1400a3440();
        local_78 = pppppppuVar8;
        FUN_1400a1c30(pppppppuVar8);
        ppppppuVar11 = local_420;
        uStack_70 = (undefined *)CONCAT71(uStack_70._1_7_,1);
        if (((local_420 != (undefined ******)0x0) &&
            (local_420 != (undefined ******)PTR_DAT_1402f8010)) &&
           (ppppppuVar16 = local_420 + -1, ppppppuVar16 != (undefined ******)0x0)) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_348 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          local_340 = (undefined *)CONCAT71(local_340._1_7_,1);
          piVar1 = (int *)((longlong)ppppppuVar11 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(ppppppuVar16);
          }
          FUN_1400d1290(ppuVar9);
        }
        local_420 = (undefined ******)*local_428;
        if (((local_420 != (undefined ******)PTR_DAT_1402f8010) &&
            (local_420 != (undefined ******)0x0)) && (local_420 != (undefined ******)0x8)) {
          *(int *)((longlong)local_420 + -4) = *(int *)((longlong)local_420 + -4) + 1;
        }
        FUN_1400d1290(pppppppuVar8);
      }
      if (((local_1e8 != (undefined *)0x0) && (local_1e8 != PTR_DAT_1402f8010)) &&
         (local_1e8 + -8 != (undefined *)0x0)) {
        pppppppuVar8 = (undefined *******)FUN_1400a3440();
        local_78 = pppppppuVar8;
        FUN_1400a1c30(pppppppuVar8);
        uStack_70 = (undefined *)CONCAT71(uStack_70._1_7_,1);
        piVar1 = (int *)(local_1e8 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_1e8 + -8);
        }
        FUN_1400d1290(pppppppuVar8);
      }
      local_428 = (undefined ******)&local_320;
      local_1e8 = PTR_DAT_1402f8010;
      FUN_1400a3440();
      local_320 = (undefined ******)PTR_DAT_1402f8010;
      if (PTR_DAT_1402f8010 == (undefined *)0x0) {
        local_320 = ppppppuVar10;
      }
      if (local_420 != (undefined ******)PTR_DAT_1402f8010) {
        pppppppuVar8 = (undefined *******)FUN_1400a3440();
        local_78 = pppppppuVar8;
        FUN_1400a1c30(pppppppuVar8);
        uStack_70 = (undefined *)CONCAT71(uStack_70._1_7_,1);
        FUN_1400031d0(&local_320);
        local_320 = local_420;
        if (((local_420 != (undefined ******)PTR_DAT_1402f8010) &&
            (local_420 != (undefined ******)0x0)) && (local_420 != (undefined ******)0x8)) {
          *(int *)((longlong)local_420 + -4) = *(int *)((longlong)local_420 + -4) + 1;
        }
        FUN_1400d1290(pppppppuVar8);
      }
      puVar3 = PTR_DAT_14030b620;
      FUN_1400a3440();
      local_2a8 = PTR_DAT_1402f8010;
      uVar5 = FUN_1400a32c0(puVar3);
      uVar12 = FUN_140002f20(&local_2a8,uVar5);
      FUN_1400a32f0(uVar12,puVar3,uVar5);
      FUN_140003000(&local_2a8);
      (**(code **)(*param_1 + 0x28))(param_1,0xfbf6,&local_2a8,&local_320);
      local_498 = (undefined ********)local_420;
      if (local_420 == (undefined ******)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbf6,PTR_DAT_14030b620);
      ppppppuVar11 = local_420;
      if (((local_420 != (undefined ******)0x0) &&
          (local_420 != (undefined ******)PTR_DAT_1402f8010)) &&
         (ppppppuVar16 = local_420 + -1, ppppppuVar16 != (undefined ******)0x0)) {
        pppppppuVar8 = (undefined *******)FUN_1400a3440();
        local_78 = pppppppuVar8;
        FUN_1400a1c30(pppppppuVar8);
        uStack_70 = (undefined *)CONCAT71(uStack_70._1_7_,1);
        piVar1 = (int *)((longlong)ppppppuVar11 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(ppppppuVar16);
        }
        FUN_1400d1290(pppppppuVar8);
      }
    }
    ppppppuVar16 = ppppppuVar10;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_78 = (undefined *******)CONCAT44(local_78._4_4_,0xfbf6);
      uStack_70 = PTR_DAT_14030b620;
      local_68 = iVar2;
      local_60 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_78);
      DVar6 = GetTickCount();
      ppppppuVar16 = (undefined ******)(ulonglong)DVar6;
    }
LAB_14016d78c:
    local_468 = (undefined *******)local_430;
    local_470 = &local_448;
    local_478 = (undefined *******)&local_98;
    local_480 = (undefined ********)&local_440;
    local_488 = (undefined ***)local_3d8;
    local_490 = (undefined *******)&local_400;
    local_498 = (undefined ********)&local_438;
    cVar4 = (**(code **)(*param_1 + 0x40))(param_1,iVar2,local_3a8,&local_3d0);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b620);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_218 = (undefined **)CONCAT44(local_218._4_4_,0xfbf6);
      local_210 = PTR_DAT_14030b620;
      local_208 = (undefined ******)CONCAT44(local_208._4_4_,iVar2);
      local_200 = param_3;
      DVar6 = GetTickCount();
      local_1f8 = CONCAT44(local_1f8._4_4_,DVar6 - (int)ppppppuVar16);
      (**(code **)(*param_1 + 0x18))(param_1,&local_218);
    }
    FUN_140140df0(&local_400);
    return 1;
  case 0xfbf7:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140185f20(param_2,&local_440);
    cVar4 = FUN_140185490(param_2,&local_420,1);
    if (cVar4 != '\0') {
      local_448._0_1_ = local_420._0_1_;
    }
    local_78 = (undefined *******)Proud::AddrPort::vftable;
    uStack_70 = (undefined *)((ulonglong)uStack_70._6_2_ << 0x30);
    cVar4 = FUN_140185490(param_2,&local_438,4);
    uVar5 = (undefined4)uStack_70;
    if (cVar4 != '\0') {
      uVar5 = local_438._0_4_;
    }
    uStack_70 = (undefined *)CONCAT44(uStack_70._4_4_,uVar5);
    cVar4 = FUN_140185490(param_2,local_430,2);
    uVar13 = uStack_70._4_2_;
    if (cVar4 != '\0') {
      uVar13 = local_430[0];
    }
    uStack_70._0_6_ = CONCAT24(uVar13,(undefined4)uStack_70);
    local_348 = Proud::AddrPort::vftable;
    local_340 = (undefined *)((ulonglong)local_340._6_2_ << 0x30);
    cVar4 = FUN_140185490(param_2,&local_438,4);
    uVar5 = (undefined4)local_340;
    if (cVar4 != '\0') {
      uVar5 = local_438._0_4_;
    }
    local_340 = (undefined *)CONCAT44(local_340._4_4_,uVar5);
    cVar4 = FUN_140185490(param_2,local_430,2);
    uVar13 = local_340._4_2_;
    if (cVar4 != '\0') {
      uVar13 = local_430[0];
    }
    local_340._0_6_ = CONCAT24(uVar13,(undefined4)local_340);
    local_3d0 = (undefined ********)Proud::AddrPort::vftable;
    local_3c8 = (undefined *)((ulonglong)local_3c8._6_2_ << 0x30);
    cVar4 = FUN_140185490(param_2,&local_438,4);
    uVar5 = (undefined4)local_3c8;
    if (cVar4 != '\0') {
      uVar5 = local_438._0_4_;
    }
    local_3c8 = (undefined *)CONCAT44(local_3c8._4_4_,uVar5);
    cVar4 = FUN_140185490(param_2,local_430,2);
    uVar13 = local_3c8._4_2_;
    if (cVar4 != '\0') {
      uVar13 = local_430[0];
    }
    local_3c8._0_6_ = CONCAT24(uVar13,(undefined4)local_3c8);
    local_98 = (undefined *******)Proud::AddrPort::vftable;
    uStack_90 = (undefined *)((ulonglong)uStack_90._6_2_ << 0x30);
    cVar4 = FUN_140185490(param_2,&local_438,4);
    uVar5 = (undefined4)uStack_90;
    if (cVar4 != '\0') {
      uVar5 = local_438._0_4_;
    }
    uStack_90 = (undefined *)CONCAT44(uStack_90._4_4_,uVar5);
    cVar4 = FUN_140185490(param_2,local_430,2);
    uVar13 = uStack_90._4_2_;
    if (cVar4 != '\0') {
      uVar13 = local_430[0];
    }
    uStack_90._0_6_ = CONCAT24(uVar13,(undefined4)uStack_90);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b628);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbf7,PTR_DAT_14030b628);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_438 = (undefined ********)PTR_DAT_1402f8010;
      local_224 = local_440._0_4_;
      FUN_1401a28c0(&local_438,&local_224);
      FUN_14003c890(&local_438,&DAT_14027c73c);
      FUN_1401a2720(&local_438,&local_448);
      FUN_14003c890(&local_438,&DAT_14027c73c);
      uVar12 = (*(code *)*local_78)(&local_78,&local_428);
      FUN_14003c400(&local_438,uVar12);
      ppppppuVar11 = local_428;
      if (((local_428 != (undefined ******)0x0) &&
          (local_428 != (undefined ******)PTR_DAT_1402f8010)) &&
         (ppppppuVar16 = local_428 + -1, ppppppuVar16 != (undefined ******)0x0)) {
        ppppppuVar10 = (undefined ******)FUN_1400a3440();
        local_420 = ppppppuVar10;
        FUN_1400a1c30(ppppppuVar10);
        local_418 = (undefined *)CONCAT71(local_418._1_7_,1);
        piVar1 = (int *)((longlong)ppppppuVar11 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(ppppppuVar16);
        }
        FUN_1400d1290(ppppppuVar10);
      }
      FUN_14003c890(&local_438,&DAT_14027c73c);
      uVar12 = (*(code *)*local_348)(&local_348,&local_428);
      FUN_14003c400(&local_438,uVar12);
      ppppppuVar11 = local_428;
      if (((local_428 != (undefined ******)0x0) &&
          (local_428 != (undefined ******)PTR_DAT_1402f8010)) &&
         (ppppppuVar16 = local_428 + -1, ppppppuVar16 != (undefined ******)0x0)) {
        ppppppuVar10 = (undefined ******)FUN_1400a3440();
        local_420 = ppppppuVar10;
        FUN_1400a1c30(ppppppuVar10);
        local_418 = (undefined *)CONCAT71(local_418._1_7_,1);
        piVar1 = (int *)((longlong)ppppppuVar11 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(ppppppuVar16);
        }
        FUN_1400d1290(ppppppuVar10);
      }
      FUN_14003c890(&local_438,&DAT_14027c73c);
      uVar12 = (*(code *)*local_3d0)(&local_3d0,&local_428);
      FUN_14003c400(&local_438,uVar12);
      if (((local_428 != (undefined ******)0x0) &&
          (local_428 != (undefined ******)PTR_DAT_1402f8010)) &&
         (local_428 + -1 != (undefined ******)0x0)) {
        ppppppuVar11 = (undefined ******)FUN_1400a3440();
        local_420 = ppppppuVar11;
        FUN_1400a1c30(ppppppuVar11);
        local_418 = (undefined *)CONCAT71(local_418._1_7_,1);
        piVar1 = (int *)((longlong)local_428 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_428 + -1);
        }
        FUN_1400d1290(ppppppuVar11);
      }
      FUN_14003c890(&local_438,&DAT_14027c73c);
      FUN_1401497d0(&local_438,&local_98);
      FUN_14003c890(&local_438,&DAT_14027c73c);
      iVar15 = 0;
      if ((local_438 != (undefined ********)0x0) &&
         (iVar15 = 0, local_438 != (undefined ********)PTR_DAT_1402f8010)) {
        iVar15 = *(int *)(local_438 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_438,local_148,iVar15 + -2);
      FUN_140003100(&local_438,uVar12);
      FUN_1400031d0(local_148);
      local_428 = &local_230;
      FUN_1400a3440();
      local_230 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_230,&local_438);
      uVar12 = FUN_140003080(local_f8,PTR_DAT_14030b628,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfbf7,uVar12,&local_230);
      local_498 = local_438;
      if (local_438 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbf7,PTR_DAT_14030b628);
      FUN_1400031d0(&local_438);
    }
    DVar6 = 0;
    if (((char)param_1[3] == '\0') && (DVar6 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_420 = (undefined ******)CONCAT44(local_420._4_4_,0xfbf7);
      local_418 = PTR_DAT_14030b628;
      local_410 = iVar2;
      local_408 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_420);
      DVar6 = GetTickCount();
    }
    local_478 = (undefined *******)&local_98;
    local_480 = (undefined ********)&local_3d0;
    local_488 = &local_348;
    local_490 = (undefined *******)&local_78;
    local_498 = &local_448;
    cVar4 = (**(code **)(*param_1 + 0x48))(param_1,iVar2,local_3a8,&local_440);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b628);
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfbf7);
    local_3f8 = PTR_DAT_14030b628;
    break;
  case 0xfbf8:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140185f20(param_2,&local_440);
    local_78 = (undefined *******)Proud::AddrPort::vftable;
    DVar6 = 0;
    uStack_70 = (undefined *)((ulonglong)uStack_70._6_2_ << 0x30);
    FUN_140142b00(param_2,&local_78);
    local_98 = (undefined *******)Proud::AddrPort::vftable;
    uStack_90 = (undefined *)((ulonglong)uStack_90._6_2_ << 0x30);
    FUN_140142b00(param_2,&local_98);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b630);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbf8,PTR_DAT_14030b630);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_438 = (undefined ********)PTR_DAT_1402f8010;
      local_21c = local_440._0_4_;
      FUN_1401a28c0(&local_438,&local_21c);
      FUN_14003c890(&local_438,&DAT_14027c73c);
      FUN_1401497d0(&local_438,&local_78);
      FUN_14003c890(&local_438,&DAT_14027c73c);
      FUN_1401497d0(&local_438,&local_98);
      FUN_14003c890(&local_438,&DAT_14027c73c);
      iVar15 = 0;
      if ((local_438 != (undefined ********)0x0) &&
         (local_438 != (undefined ********)PTR_DAT_1402f8010)) {
        iVar15 = *(int *)(local_438 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_438,local_138,iVar15 + -2);
      FUN_140003100(&local_438,uVar12);
      FUN_1400031d0(local_138);
      local_428 = &local_298;
      FUN_1400a3440();
      local_298 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_298,&local_438);
      uVar12 = FUN_140003080(local_b8,PTR_DAT_14030b630,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfbf8,uVar12,&local_298);
      local_498 = local_438;
      if (local_438 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbf8,PTR_DAT_14030b630);
      FUN_1400031d0(&local_438);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_348 = (undefined **)CONCAT44(local_348._4_4_,0xfbf8);
      local_340 = PTR_DAT_14030b630;
      local_338 = iVar2;
      local_330 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_348);
      DVar6 = GetTickCount();
    }
    local_490 = (undefined *******)&local_98;
    local_498 = &local_78;
    cVar4 = (**(code **)(*param_1 + 0x50))(param_1,iVar2,local_3a8,&local_440);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b630);
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfbf8);
    local_3f8 = PTR_DAT_14030b630;
    break;
  case 0xfbf9:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140185f20(param_2,&local_438);
    cVar4 = FUN_140185490(param_2,&local_3d0,4);
    uVar5 = local_328[0];
    if (cVar4 != '\0') {
      uVar5 = local_3d0._0_4_;
    }
    local_440 = (undefined ********)CONCAT44(local_440._4_4_,uVar5);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b638);
    DVar6 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbf9,PTR_DAT_14030b638);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_3d0 = (undefined ********)PTR_DAT_1402f8010;
      local_2f8[0] = local_438._0_4_;
      FUN_1401a28c0(&local_3d0,local_2f8);
      FUN_14003c890(&local_3d0,&DAT_14027c73c);
      uVar12 = FUN_140141430((ulonglong)local_440 & 0xffffffff);
      FUN_14003c890(&local_3d0,uVar12);
      FUN_14003c890(&local_3d0,&DAT_14027c73c);
      iVar15 = 0;
      if ((local_3d0 != (undefined ********)0x0) &&
         (local_3d0 != (undefined ********)PTR_DAT_1402f8010)) {
        iVar15 = *(int *)(local_3d0 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_3d0,local_140,iVar15 + -2);
      FUN_140003100(&local_3d0,uVar12);
      FUN_1400031d0(local_140);
      local_428 = &local_248;
      FUN_1400a3440();
      local_248 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_248,&local_3d0);
      uVar12 = FUN_140003080(local_a8,PTR_DAT_14030b638,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfbf9,uVar12,&local_248);
      local_498 = local_3d0;
      if (local_3d0 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbf9,PTR_DAT_14030b638);
      FUN_1400031d0(&local_3d0);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_98 = (undefined *******)CONCAT44(local_98._4_4_,0xfbf9);
      uStack_90 = PTR_DAT_14030b638;
      local_88 = iVar2;
      local_80 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_98);
      DVar6 = GetTickCount();
    }
    local_498 = (undefined ********)&local_440;
    cVar4 = (**(code **)(*param_1 + 0x58))(param_1,iVar2,local_3a8,&local_438);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b638);
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfbf9);
    local_3f8 = PTR_DAT_14030b638;
    break;
  case 0xfbfa:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140185f20(param_2,&local_438);
    FUN_140185f20(param_2,&local_440);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b640);
    DVar6 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbfa,PTR_DAT_14030b640);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_3d0 = (undefined ********)PTR_DAT_1402f8010;
      local_278[0] = local_438._0_4_;
      FUN_1401a28c0(&local_3d0,local_278);
      FUN_14003c890(&local_3d0,&DAT_14027c73c);
      local_2e8[0] = local_440._0_4_;
      FUN_1401a28c0(&local_3d0,local_2e8);
      FUN_14003c890(&local_3d0,&DAT_14027c73c);
      iVar15 = 0;
      if ((local_3d0 != (undefined ********)0x0) &&
         (local_3d0 != (undefined ********)PTR_DAT_1402f8010)) {
        iVar15 = *(int *)(local_3d0 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_3d0,local_178,iVar15 + -2);
      FUN_140003100(&local_3d0,uVar12);
      FUN_1400031d0(local_178);
      local_428 = &local_310;
      FUN_1400a3440();
      local_310 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_310,&local_3d0);
      uVar12 = FUN_140003080(local_b0,PTR_DAT_14030b640,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfbfa,uVar12,&local_310);
      local_498 = local_3d0;
      if (local_3d0 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbfa,PTR_DAT_14030b640);
      FUN_1400031d0(&local_3d0);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_98 = (undefined *******)CONCAT44(local_98._4_4_,0xfbfa);
      uStack_90 = PTR_DAT_14030b640;
      local_88 = iVar2;
      local_80 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_98);
      DVar6 = GetTickCount();
    }
    local_498 = (undefined ********)&local_440;
    cVar4 = (**(code **)(*param_1 + 0x60))(param_1,iVar2,local_3a8,&local_438);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b640);
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfbfa);
    local_3f8 = PTR_DAT_14030b640;
    break;
  case 0xfbfb:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140185f20(param_2,&local_438);
    FUN_140185f20(param_2,&local_440);
    local_420 = (undefined ******)Proud::AddrPort::vftable;
    DVar6 = 0;
    local_418 = (undefined *)((ulonglong)local_418._6_2_ << 0x30);
    FUN_140142b00(param_2,&local_420);
    local_348 = Proud::AddrPort::vftable;
    local_340 = (undefined *)((ulonglong)local_340._6_2_ << 0x30);
    FUN_140142b00(param_2,&local_348);
    local_78 = (undefined *******)Proud::AddrPort::vftable;
    uStack_70 = (undefined *)((ulonglong)uStack_70._6_2_ << 0x30);
    FUN_140142b00(param_2,&local_78);
    local_98 = (undefined *******)Proud::AddrPort::vftable;
    uStack_90 = (undefined *)((ulonglong)uStack_90._6_2_ << 0x30);
    FUN_140142b00(param_2,&local_98);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b648);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbfb,PTR_DAT_14030b648);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_3d0 = (undefined ********)PTR_DAT_1402f8010;
      local_23c = local_438._0_4_;
      FUN_1401a28c0(&local_3d0,&local_23c);
      FUN_14003c890(&local_3d0,&DAT_14027c73c);
      local_2d8[0] = local_440._0_4_;
      FUN_1401a28c0(&local_3d0,local_2d8);
      FUN_14003c890(&local_3d0,&DAT_14027c73c);
      FUN_1401497d0(&local_3d0,&local_420);
      FUN_14003c890(&local_3d0,&DAT_14027c73c);
      FUN_1401497d0(&local_3d0,&local_348);
      FUN_14003c890(&local_3d0,&DAT_14027c73c);
      FUN_1401497d0(&local_3d0,&local_78);
      FUN_14003c890(&local_3d0,&DAT_14027c73c);
      FUN_1401497d0(&local_3d0,&local_98);
      FUN_14003c890(&local_3d0,&DAT_14027c73c);
      iVar15 = 0;
      if ((local_3d0 != (undefined ********)0x0) &&
         (local_3d0 != (undefined ********)PTR_DAT_1402f8010)) {
        iVar15 = *(int *)(local_3d0 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_3d0,local_168,iVar15 + -2);
      FUN_140003100(&local_3d0,uVar12);
      FUN_1400031d0(local_168);
      local_428 = &local_308;
      FUN_1400a3440();
      local_308 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_308,&local_3d0);
      uVar12 = FUN_140003080(local_130,PTR_DAT_14030b648,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfbfb,uVar12,&local_308);
      local_498 = local_3d0;
      if (local_3d0 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbfb,PTR_DAT_14030b648);
      FUN_1400031d0(&local_3d0);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_3d0 = (undefined ********)CONCAT44(local_3d0._4_4_,0xfbfb);
      local_3c8 = PTR_DAT_14030b648;
      local_3c0 = iVar2;
      local_3b8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_3d0);
      DVar6 = GetTickCount();
    }
    local_478 = (undefined *******)&local_98;
    local_480 = &local_78;
    local_488 = &local_348;
    local_490 = &local_420;
    local_498 = (undefined ********)&local_440;
    cVar4 = (**(code **)(*param_1 + 0x68))(param_1,iVar2,local_3a8,&local_438);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b648);
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfbfb);
    local_3f8 = PTR_DAT_14030b648;
    break;
  case 0xfbfc:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b650);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbfc,PTR_DAT_14030b650);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_440 = (undefined ********)PTR_DAT_1402f8010;
      uVar12 = FUN_14003c0c0(&local_440,local_158,0xfffffffe);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_158);
      local_428 = &local_300;
      FUN_1400a3440();
      local_300 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_300,&local_440);
      uVar12 = FUN_140003080(local_120,PTR_DAT_14030b650,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfbfc,uVar12,&local_300);
      local_498 = local_440;
      if (local_440 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbfc,PTR_DAT_14030b650);
      FUN_1400031d0(&local_440);
    }
    DVar6 = 0;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_98 = (undefined *******)CONCAT44(local_98._4_4_,0xfbfc);
      uStack_90 = PTR_DAT_14030b650;
      local_88 = iVar2;
      local_80 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_98);
      DVar6 = GetTickCount();
    }
    cVar4 = (**(code **)(*param_1 + 0x70))(param_1,iVar2,local_3a8);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b650);
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfbfc);
    local_3f8 = PTR_DAT_14030b650;
    break;
  case 0xfbfd:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b658);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbfd,PTR_DAT_14030b658);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_440 = (undefined ********)PTR_DAT_1402f8010;
      uVar12 = FUN_14003c0c0(&local_440,local_170,0xfffffffe);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_170);
      local_428 = &local_2f0;
      FUN_1400a3440();
      local_2f0 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_2f0,&local_440);
      uVar12 = FUN_140003080(local_d8,PTR_DAT_14030b658,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfbfd,uVar12,&local_2f0);
      local_498 = local_440;
      if (local_440 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbfd,PTR_DAT_14030b658);
      FUN_1400031d0(&local_440);
    }
    DVar6 = 0;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_98 = (undefined *******)CONCAT44(local_98._4_4_,0xfbfd);
      uStack_90 = PTR_DAT_14030b658;
      local_88 = iVar2;
      local_80 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_98);
      DVar6 = GetTickCount();
    }
    cVar4 = (**(code **)(*param_1 + 0x78))(param_1,iVar2,local_3a8);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b658);
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfbfd);
    local_3f8 = PTR_DAT_14030b658;
    break;
  case 0xfbfe:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b660);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbfe,PTR_DAT_14030b660);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_440 = (undefined ********)PTR_DAT_1402f8010;
      uVar12 = FUN_14003c0c0(&local_440,local_1a0,0xfffffffe);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_1a0);
      local_428 = &local_2e0;
      FUN_1400a3440();
      local_2e0 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_2e0,&local_440);
      uVar12 = FUN_140003080(local_110,PTR_DAT_14030b660,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfbfe,uVar12,&local_2e0);
      local_498 = local_440;
      if (local_440 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbfe,PTR_DAT_14030b660);
      FUN_1400031d0(&local_440);
    }
    DVar6 = 0;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_98 = (undefined *******)CONCAT44(local_98._4_4_,0xfbfe);
      uStack_90 = PTR_DAT_14030b660;
      local_88 = iVar2;
      local_80 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_98);
      DVar6 = GetTickCount();
    }
    cVar4 = (**(code **)(*param_1 + 0x80))(param_1,iVar2,local_3a8);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b660);
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfbfe);
    local_3f8 = PTR_DAT_14030b660;
    break;
  case 0xfbff:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b668);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbff,PTR_DAT_14030b668);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_440 = (undefined ********)PTR_DAT_1402f8010;
      uVar12 = FUN_14003c0c0(&local_440,local_150,0xfffffffe);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_150);
      local_428 = &local_2d0;
      FUN_1400a3440();
      local_2d0 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_2d0,&local_440);
      uVar12 = FUN_140003080(local_d0,PTR_DAT_14030b668,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfbff,uVar12,&local_2d0);
      local_498 = local_440;
      if (local_440 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbff,PTR_DAT_14030b668);
      FUN_1400031d0(&local_440);
    }
    DVar6 = 0;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_98 = (undefined *******)CONCAT44(local_98._4_4_,0xfbff);
      uStack_90 = PTR_DAT_14030b668;
      local_88 = iVar2;
      local_80 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_98);
      DVar6 = GetTickCount();
    }
    cVar4 = (**(code **)(*param_1 + 0x88))(param_1,iVar2,local_3a8);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b668);
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfbff);
    local_3f8 = PTR_DAT_14030b668;
    break;
  case 0xfc00:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    cVar4 = FUN_140185490(param_2,&local_420,1);
    if (cVar4 != '\0') {
      local_448._0_1_ = local_420._0_1_;
    }
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b670);
    DVar6 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfc00,PTR_DAT_14030b670);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_440 = (undefined ********)PTR_DAT_1402f8010;
      FUN_1401a2720(&local_440,&local_448);
      FUN_14003c890(&local_440,&DAT_14027c73c);
      iVar15 = 0;
      if ((local_440 != (undefined ********)0x0) &&
         (local_440 != (undefined ********)PTR_DAT_1402f8010)) {
        iVar15 = *(int *)(local_440 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_440,local_190,iVar15 + -2);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_190);
      local_428 = &local_2c0;
      FUN_1400a3440();
      local_2c0 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_2c0,&local_440);
      uVar12 = FUN_140003080(local_100,PTR_DAT_14030b670,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfc00,uVar12,&local_2c0);
      local_498 = local_440;
      if (local_440 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfc00,PTR_DAT_14030b670);
      FUN_1400031d0(&local_440);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_98 = (undefined *******)CONCAT44(local_98._4_4_,0xfc00);
      uStack_90 = PTR_DAT_14030b670;
      local_88 = iVar2;
      local_80 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_98);
      DVar6 = GetTickCount();
    }
    cVar4 = (**(code **)(*param_1 + 0x90))(param_1,iVar2,local_3a8,&local_448);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b670);
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfc00);
    local_3f8 = PTR_DAT_14030b670;
    break;
  case 0xfc01:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b678);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfc01,PTR_DAT_14030b678);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_440 = (undefined ********)PTR_DAT_1402f8010;
      uVar12 = FUN_14003c0c0(&local_440,local_160,0xfffffffe);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_160);
      local_428 = &local_2b0;
      FUN_1400a3440();
      local_2b0 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_2b0,&local_440);
      uVar12 = FUN_140003080(local_c8,PTR_DAT_14030b678,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfc01,uVar12,&local_2b0);
      local_498 = local_440;
      if (local_440 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfc01,PTR_DAT_14030b678);
      FUN_1400031d0(&local_440);
    }
    DVar6 = 0;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_98 = (undefined *******)CONCAT44(local_98._4_4_,0xfc01);
      uStack_90 = PTR_DAT_14030b678;
      local_88 = iVar2;
      local_80 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_98);
      DVar6 = GetTickCount();
    }
    cVar4 = (**(code **)(*param_1 + 0x98))(param_1,iVar2,local_3a8);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b678);
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfc01);
    local_3f8 = PTR_DAT_14030b678;
    break;
  case 0xfc02:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b680);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfc02,PTR_DAT_14030b680);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_440 = (undefined ********)PTR_DAT_1402f8010;
      uVar12 = FUN_14003c0c0(&local_440,local_180,0xfffffffe);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_180);
      local_428 = &local_2a0;
      FUN_1400a3440();
      local_2a0 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_2a0,&local_440);
      uVar12 = FUN_140003080(local_f0,PTR_DAT_14030b680,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfc02,uVar12,&local_2a0);
      local_498 = local_440;
      if (local_440 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfc02,PTR_DAT_14030b680);
      FUN_1400031d0(&local_440);
    }
    DVar6 = 0;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_98 = (undefined *******)CONCAT44(local_98._4_4_,0xfc02);
      uStack_90 = PTR_DAT_14030b680;
      local_88 = iVar2;
      local_80 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_98);
      DVar6 = GetTickCount();
    }
    cVar4 = (**(code **)(*param_1 + 0xa0))(param_1,iVar2,local_3a8);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b680);
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfc02);
    local_3f8 = PTR_DAT_14030b680;
    break;
  case 0xfc03:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140185f20(param_2,&local_440);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b688);
    DVar6 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfc03,PTR_DAT_14030b688);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_438 = (undefined ********)PTR_DAT_1402f8010;
      local_268[0] = local_440._0_4_;
      FUN_1401a28c0(&local_438,local_268);
      FUN_14003c890(&local_438,&DAT_14027c73c);
      iVar15 = 0;
      if ((local_438 != (undefined ********)0x0) &&
         (local_438 != (undefined ********)PTR_DAT_1402f8010)) {
        iVar15 = *(int *)(local_438 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_438,local_1b8,iVar15 + -2);
      FUN_140003100(&local_438,uVar12);
      FUN_1400031d0(local_1b8);
      local_428 = &local_290;
      FUN_1400a3440();
      local_290 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_290,&local_438);
      uVar12 = FUN_140003080(local_e8,PTR_DAT_14030b688,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfc03,uVar12,&local_290);
      local_498 = local_438;
      if (local_438 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfc03,PTR_DAT_14030b688);
      FUN_1400031d0(&local_438);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_98 = (undefined *******)CONCAT44(local_98._4_4_,0xfc03);
      uStack_90 = PTR_DAT_14030b688;
      local_88 = iVar2;
      local_80 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_98);
      DVar6 = GetTickCount();
    }
    cVar4 = (**(code **)(*param_1 + 0xa8))(param_1,iVar2,local_3a8,&local_440);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b688);
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfc03);
    local_3f8 = PTR_DAT_14030b688;
    break;
  case 0xfc04:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140185f20(param_2,&local_440);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b690);
    DVar6 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfc04,PTR_DAT_14030b690);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_438 = (undefined ********)PTR_DAT_1402f8010;
      local_328[0] = local_440._0_4_;
      FUN_1401a28c0(&local_438,local_328);
      FUN_14003c890(&local_438,&DAT_14027c73c);
      iVar15 = 0;
      if ((local_438 != (undefined ********)0x0) &&
         (local_438 != (undefined ********)PTR_DAT_1402f8010)) {
        iVar15 = *(int *)(local_438 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_438,local_1b0,iVar15 + -2);
      FUN_140003100(&local_438,uVar12);
      FUN_1400031d0(local_1b0);
      local_428 = &local_280;
      FUN_1400a3440();
      local_280 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_280,&local_438);
      uVar12 = FUN_140003080(local_e0,PTR_DAT_14030b690,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfc04,uVar12,&local_280);
      local_498 = local_438;
      if (local_438 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfc04,PTR_DAT_14030b690);
      FUN_1400031d0(&local_438);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_98 = (undefined *******)CONCAT44(local_98._4_4_,0xfc04);
      uStack_90 = PTR_DAT_14030b690;
      local_88 = iVar2;
      local_80 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_98);
      DVar6 = GetTickCount();
    }
    cVar4 = (**(code **)(*param_1 + 0xb0))(param_1,iVar2,local_3a8,&local_440);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b690);
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfc04);
    local_3f8 = PTR_DAT_14030b690;
    break;
  case 0xfc05:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    cVar4 = FUN_140185490(param_2,&local_420,1);
    if (cVar4 != '\0') {
      local_448._0_1_ = local_420._0_1_;
    }
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b698);
    DVar6 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfc05,PTR_DAT_14030b698);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_440 = (undefined ********)PTR_DAT_1402f8010;
      FUN_1401a2720(&local_440,&local_448);
      FUN_14003c890(&local_440,&DAT_14027c73c);
      iVar15 = 0;
      if ((local_440 != (undefined ********)0x0) &&
         (local_440 != (undefined ********)PTR_DAT_1402f8010)) {
        iVar15 = *(int *)(local_440 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_440,local_1a8,iVar15 + -2);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_1a8);
      local_428 = &local_270;
      FUN_1400a3440();
      local_270 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_270,&local_440);
      uVar12 = FUN_140003080(local_128,PTR_DAT_14030b698,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfc05,uVar12,&local_270);
      local_498 = local_440;
      if (local_440 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfc05,PTR_DAT_14030b698);
      FUN_1400031d0(&local_440);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_98 = (undefined *******)CONCAT44(local_98._4_4_,0xfc05);
      uStack_90 = PTR_DAT_14030b698;
      local_88 = iVar2;
      local_80 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_98);
      DVar6 = GetTickCount();
    }
    cVar4 = (**(code **)(*param_1 + 0xb8))(param_1,iVar2,local_3a8,&local_448);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b698);
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfc05);
    local_3f8 = PTR_DAT_14030b698;
    break;
  case 0xfc06:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_1400a3440();
    local_98 = (undefined *******)PTR_DAT_1402f8008;
    FUN_1401a2550(param_2,&local_98);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b6a0);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfc06,PTR_DAT_14030b6a0);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_440 = (undefined ********)PTR_DAT_1402f8010;
      FUN_14016c7e0(&local_440,&local_98);
      FUN_14003c890(&local_440,&DAT_14027c73c);
      iVar15 = 0;
      if ((local_440 != (undefined ********)0x0) &&
         (local_440 != (undefined ********)PTR_DAT_1402f8010)) {
        iVar15 = *(int *)(local_440 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_440,local_198,iVar15 + -2);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_198);
      local_428 = &local_260;
      FUN_1400a3440();
      local_260 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_260,&local_440);
      uVar12 = FUN_140003080(local_118,PTR_DAT_14030b6a0,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfc06,uVar12,&local_260);
      local_498 = local_440;
      if (local_440 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfc06,PTR_DAT_14030b6a0);
      FUN_1400031d0(&local_440);
    }
    DVar6 = 0;
    if (((char)param_1[3] == '\0') && (DVar6 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_78 = (undefined *******)CONCAT44(local_78._4_4_,0xfc06);
      uStack_70 = PTR_DAT_14030b6a0;
      local_68 = iVar2;
      local_60 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_78);
      DVar6 = GetTickCount();
    }
    cVar4 = (**(code **)(*param_1 + 0xc0))(param_1,iVar2,local_3a8,&local_98);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b6a0);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfc06);
      local_3f8 = PTR_DAT_14030b6a0;
      local_3f0 = (undefined ******)CONCAT44(local_3f0._4_4_,iVar2);
      local_3e8 = param_3;
      DVar7 = GetTickCount();
      local_3e0 = CONCAT44(local_3e0._4_4_,DVar7 - DVar6);
      (**(code **)(*param_1 + 0x18))(param_1,&local_400);
    }
    goto LAB_1401702f7;
  case 0xfc07:
    FUN_140140af0(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    cVar4 = FUN_140185490(param_2,&local_420,1);
    if (cVar4 != '\0') {
      local_448._0_1_ = local_420._0_1_;
    }
    FUN_1400a3440();
    local_98 = (undefined *******)PTR_DAT_1402f8008;
    FUN_1401a2550(param_2,&local_98);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_14030b6a8);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_14027d1a0;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfc07,PTR_DAT_14030b6a8);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_1400a3440();
      local_440 = (undefined ********)PTR_DAT_1402f8010;
      FUN_1401a2720(&local_440,&local_448);
      FUN_14003c890(&local_440,&DAT_14027c73c);
      FUN_14016c7e0(&local_440,&local_98);
      FUN_14003c890(&local_440,&DAT_14027c73c);
      iVar15 = 0;
      if ((local_440 != (undefined ********)0x0) &&
         (local_440 != (undefined ********)PTR_DAT_1402f8010)) {
        iVar15 = *(int *)(local_440 + -1);
      }
      uVar12 = FUN_14003c0c0(&local_440,local_188,iVar15 + -2);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_188);
      local_428 = &local_250;
      FUN_1400a3440();
      local_250 = (undefined *****)PTR_DAT_1402f8010;
      FUN_140003100(&local_250,&local_440);
      uVar12 = FUN_140003080(local_108,PTR_DAT_14030b6a8,0);
      (**(code **)(*param_1 + 0x28))(param_1,0xfc07,uVar12,&local_250);
      local_498 = local_440;
      if (local_440 == (undefined ********)0x0) {
        local_498 = (undefined ********)PTR_DAT_1402f8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfc07,PTR_DAT_14030b6a8);
      FUN_1400031d0(&local_440);
    }
    DVar6 = 0;
    if (((char)param_1[3] == '\0') && (DVar6 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_78 = (undefined *******)CONCAT44(local_78._4_4_,0xfc07);
      uStack_70 = PTR_DAT_14030b6a8;
      local_68 = iVar2;
      local_60 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_78);
      DVar6 = GetTickCount();
    }
    local_498 = &local_98;
    cVar4 = (**(code **)(*param_1 + 200))(param_1,iVar2,local_3a8,&local_448);
    if (cVar4 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b6a8);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_400 = (undefined **)CONCAT44(local_400._4_4_,0xfc07);
      local_3f8 = PTR_DAT_14030b6a8;
      local_3f0 = (undefined ******)CONCAT44(local_3f0._4_4_,iVar2);
      local_3e8 = param_3;
      DVar7 = GetTickCount();
      local_3e0 = CONCAT44(local_3e0._4_4_,DVar7 - DVar6);
      (**(code **)(*param_1 + 0x18))(param_1,&local_400);
    }
LAB_1401702f7:
    FUN_14000c2a0(&local_98);
    return 1;
  default:
    goto switchD_14016c9c4_default;
  }
  local_3f0 = (undefined ******)CONCAT44(local_3f0._4_4_,iVar2);
  local_3e8 = param_3;
  DVar7 = GetTickCount();
  local_3e0 = CONCAT44(local_3e0._4_4_,DVar7 - DVar6);
  (**(code **)(*param_1 + 0x18))(param_1,&local_400);
  return 1;
}



undefined8 FUN_140170390(longlong *param_1,int *param_2,undefined8 param_3)

{
  int *piVar1;
  int iVar2;
  char cVar3;
  undefined4 uVar4;
  DWORD DVar5;
  DWORD DVar6;
  longlong *plVar7;
  undefined **ppuVar8;
  undefined8 uVar9;
  undefined *puVar10;
  int iVar11;
  undefined *puVar12;
  undefined *local_res10;
  undefined8 local_res18;
  int local_res20 [2];
  undefined *local_168;
  undefined8 local_160;
  undefined *local_158;
  int local_150;
  undefined8 local_148;
  int local_140;
  undefined **local_138;
  undefined1 local_130;
  undefined *local_128;
  undefined *local_120;
  undefined *local_118;
  undefined *local_110;
  undefined *local_108;
  undefined *local_100;
  undefined *local_f8;
  undefined *local_f0;
  undefined *local_e8;
  undefined *local_e0;
  undefined *local_d8;
  undefined *local_d0;
  undefined *local_c8;
  undefined *local_c0;
  undefined *local_b8 [2];
  undefined1 local_a8 [4];
  int local_a4;
  undefined8 local_70;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  iVar2 = param_2[10];
  local_res18 = param_3;
  if (iVar2 == 0) {
    FUN_140169430(param_1,0);
  }
  iVar11 = *param_2;
  cVar3 = FUN_140185e40(param_2,local_res20);
  if (cVar3 != '\0') {
    local_70 = param_3;
    if (local_res20[0] == 0xfde9) {
      FUN_140140af0(local_a8);
      local_a4 = param_2[10];
      local_a8[0] = (undefined1)param_2[0x10];
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030b6b0);
      DVar5 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfde9,PTR_DAT_14030b6b0,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        puVar10 = PTR_DAT_1402f8010;
        local_res10 = PTR_DAT_1402f8010;
        plVar7 = (longlong *)FUN_14003c0c0(&local_res10,&local_c8,0xfffffffe);
        if (puVar10 == (undefined *)0x0) {
          puVar10 = PTR_DAT_1402f8010;
        }
        local_res10 = puVar10;
        if ((undefined *)*plVar7 != puVar10) {
          uVar9 = FUN_1400a3440();
          local_160 = uVar9;
          FUN_1400a1c30(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1402f8010)) &&
             (puVar10 + -8 != (undefined *)0x0)) {
            ppuVar8 = (undefined **)FUN_1400a3440();
            local_138 = ppuVar8;
            FUN_1400a1c30(ppuVar8);
            local_130 = 1;
            piVar1 = (int *)(puVar10 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(puVar10 + -8);
            }
            FUN_1400d1290(ppuVar8);
          }
          puVar10 = (undefined *)*plVar7;
          if (((puVar10 != PTR_DAT_1402f8010) && (puVar10 != (undefined *)0x0)) &&
             (puVar10 != (undefined *)0x8)) {
            *(int *)(puVar10 + -4) = *(int *)(puVar10 + -4) + 1;
          }
          local_res10 = puVar10;
          FUN_1400d1290(uVar9);
        }
        if (((local_c8 != (undefined *)0x0) && (local_c8 != PTR_DAT_1402f8010)) &&
           (local_c8 + -8 != (undefined *)0x0)) {
          uVar9 = FUN_1400a3440();
          local_160 = uVar9;
          FUN_1400a1c30(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          piVar1 = (int *)(local_c8 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_c8 + -8);
          }
          FUN_1400d1290(uVar9);
        }
        local_138 = &local_120;
        local_c8 = PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_120 = PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_120 = (undefined *)0x0;
        }
        if (puVar10 != PTR_DAT_1402f8010) {
          uVar9 = FUN_1400a3440();
          local_160 = uVar9;
          FUN_1400a1c30(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          FUN_1400031d0(&local_120);
          if (((puVar10 != PTR_DAT_1402f8010) && (puVar10 != (undefined *)0x0)) &&
             (puVar10 != (undefined *)0x8)) {
            *(int *)(puVar10 + -4) = *(int *)(puVar10 + -4) + 1;
          }
          local_120 = puVar10;
          FUN_1400d1290(uVar9);
        }
        puVar12 = PTR_DAT_14030b6b0;
        FUN_1400a3440();
        local_f0 = PTR_DAT_1402f8010;
        uVar4 = FUN_1400a32c0(puVar12);
        uVar9 = FUN_140002f20(&local_f0,uVar4);
        FUN_1400a32f0(uVar9,puVar12,uVar4);
        FUN_140003000(&local_f0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfde9,&local_f0,&local_120);
        puVar12 = puVar10;
        if (puVar10 == (undefined *)0x0) {
          puVar12 = PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfde9,PTR_DAT_14030b6b0,puVar12);
        param_3 = local_res18;
        if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1402f8010)) &&
           (puVar10 + -8 != (undefined *)0x0)) {
          uVar9 = FUN_1400a3440();
          local_160 = uVar9;
          FUN_1400a1c30(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          piVar1 = (int *)(puVar10 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(puVar10 + -8);
          }
          FUN_1400d1290(uVar9);
          param_3 = local_res18;
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_160 = CONCAT44(local_160._4_4_,0xfde9);
        local_158 = PTR_DAT_14030b6b0;
        local_150 = iVar2;
        local_148 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_160);
        DVar5 = GetTickCount();
      }
      cVar3 = (**(code **)(*param_1 + 0x38))(param_1,iVar2,local_a8);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b6b0);
      }
      if ((char)param_1[3] != '\0') {
        return 1;
      }
      if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
        return 1;
      }
      local_160 = CONCAT44(local_160._4_4_,0xfde9);
      local_158 = PTR_DAT_14030b6b0;
    }
    else if (local_res20[0] == 0xfdea) {
      FUN_140140af0(local_a8);
      local_a4 = param_2[10];
      local_a8[0] = (undefined1)param_2[0x10];
      cVar3 = FUN_140185490(param_2,&local_168,4);
      uVar4 = local_res10._0_4_;
      if (cVar3 != '\0') {
        uVar4 = local_168._0_4_;
      }
      local_res10 = (undefined *)CONCAT44(local_res10._4_4_,uVar4);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030b6b8);
      DVar5 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfdea,PTR_DAT_14030b6b8,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_168 = PTR_DAT_1402f8010;
        FUN_1401a2920(&local_168,&local_res10);
        FUN_14003c890(&local_168,&DAT_14027c73c);
        iVar11 = 0;
        if ((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1402f8010)) {
          iVar11 = *(int *)(local_168 + -8);
        }
        plVar7 = (longlong *)FUN_14003c0c0(&local_168,&local_d0,iVar11 + -2);
        if (local_168 == (undefined *)0x0) {
          local_168 = PTR_DAT_1402f8010;
        }
        if ((undefined *)*plVar7 != local_168) {
          uVar9 = FUN_1400a3440();
          local_160 = uVar9;
          FUN_1400a1c30(uVar9);
          puVar10 = local_168;
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1402f8010)) &&
             (puVar12 = local_168 + -8, puVar12 != (undefined *)0x0)) {
            ppuVar8 = (undefined **)FUN_1400a3440();
            local_138 = ppuVar8;
            FUN_1400a1c30(ppuVar8);
            local_130 = 1;
            piVar1 = (int *)(puVar10 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(puVar12);
            }
            FUN_1400d1290(ppuVar8);
          }
          local_168 = (undefined *)*plVar7;
          if (((local_168 != PTR_DAT_1402f8010) && (local_168 != (undefined *)0x0)) &&
             (local_168 != (undefined *)0x8)) {
            *(int *)(local_168 + -4) = *(int *)(local_168 + -4) + 1;
          }
          FUN_1400d1290(uVar9);
        }
        if (((local_d0 != (undefined *)0x0) && (local_d0 != PTR_DAT_1402f8010)) &&
           (local_d0 + -8 != (undefined *)0x0)) {
          uVar9 = FUN_1400a3440();
          local_160 = uVar9;
          FUN_1400a1c30(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          piVar1 = (int *)(local_d0 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_d0 + -8);
          }
          FUN_1400d1290(uVar9);
        }
        local_138 = &local_118;
        local_d0 = PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_118 = PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_118 = (undefined *)0x0;
        }
        if (local_168 != PTR_DAT_1402f8010) {
          uVar9 = FUN_1400a3440();
          local_160 = uVar9;
          FUN_1400a1c30(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          FUN_1400031d0(&local_118);
          local_118 = local_168;
          if (((local_168 != PTR_DAT_1402f8010) && (local_168 != (undefined *)0x0)) &&
             (local_168 != (undefined *)0x8)) {
            *(int *)(local_168 + -4) = *(int *)(local_168 + -4) + 1;
          }
          FUN_1400d1290(uVar9);
        }
        puVar10 = PTR_DAT_14030b6b8;
        FUN_1400a3440();
        local_e8 = PTR_DAT_1402f8010;
        uVar4 = FUN_1400a32c0(puVar10);
        uVar9 = FUN_140002f20(&local_e8,uVar4);
        FUN_1400a32f0(uVar9,puVar10,uVar4);
        FUN_140003000(&local_e8);
        (**(code **)(*param_1 + 0x28))(param_1,0xfdea,&local_e8,&local_118);
        puVar10 = local_168;
        if (local_168 == (undefined *)0x0) {
          puVar10 = PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfdea,PTR_DAT_14030b6b8,puVar10);
        puVar10 = local_168;
        param_3 = local_res18;
        if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1402f8010)) &&
           (puVar12 = local_168 + -8, puVar12 != (undefined *)0x0)) {
          uVar9 = FUN_1400a3440();
          local_160 = uVar9;
          FUN_1400a1c30(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          piVar1 = (int *)(puVar10 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(puVar12);
          }
          FUN_1400d1290(uVar9);
          param_3 = local_res18;
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_160 = CONCAT44(local_160._4_4_,0xfdea);
        local_158 = PTR_DAT_14030b6b8;
        local_150 = iVar2;
        local_148 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_160);
        DVar5 = GetTickCount();
      }
      cVar3 = (**(code **)(*param_1 + 0x40))(param_1,iVar2,local_a8,&local_res10);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b6b8);
      }
      if ((char)param_1[3] != '\0') {
        return 1;
      }
      if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
        return 1;
      }
      local_160 = CONCAT44(local_160._4_4_,0xfdea);
      local_158 = PTR_DAT_14030b6b8;
    }
    else if (local_res20[0] == 0xfdeb) {
      FUN_140140af0(local_a8);
      local_a4 = param_2[10];
      local_a8[0] = (undefined1)param_2[0x10];
      cVar3 = FUN_140185490(param_2,&local_110,8);
      if (cVar3 != '\0') {
        local_128 = local_110;
      }
      cVar3 = FUN_140185490(param_2,&local_168,4);
      if (cVar3 != '\0') {
        local_res10 = (undefined *)CONCAT44(local_res10._4_4_,local_168._0_4_);
      }
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030b6c0);
      DVar5 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfdeb,PTR_DAT_14030b6c0,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_168 = PTR_DAT_1402f8010;
        FUN_1401a2a50(&local_168,&local_128);
        FUN_14003c890(&local_168,&DAT_14027c73c);
        FUN_1401a29e0(&local_168,&local_res10);
        FUN_14003c890(&local_168,&DAT_14027c73c);
        iVar11 = 0;
        if ((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1402f8010)) {
          iVar11 = *(int *)(local_168 + -8);
        }
        plVar7 = (longlong *)FUN_14003c0c0(&local_168,&local_c0,iVar11 + -2);
        if (local_168 == (undefined *)0x0) {
          local_168 = PTR_DAT_1402f8010;
        }
        if ((undefined *)*plVar7 != local_168) {
          uVar9 = FUN_1400a3440();
          local_160 = uVar9;
          FUN_1400a1c30(uVar9);
          puVar10 = local_168;
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1402f8010)) &&
             (puVar12 = local_168 + -8, puVar12 != (undefined *)0x0)) {
            ppuVar8 = (undefined **)FUN_1400a3440();
            local_138 = ppuVar8;
            FUN_1400a1c30(ppuVar8);
            local_130 = 1;
            piVar1 = (int *)(puVar10 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(puVar12);
            }
            FUN_1400d1290(ppuVar8);
          }
          local_168 = (undefined *)*plVar7;
          if (((local_168 != PTR_DAT_1402f8010) && (local_168 != (undefined *)0x0)) &&
             (local_168 != (undefined *)0x8)) {
            *(int *)(local_168 + -4) = *(int *)(local_168 + -4) + 1;
          }
          FUN_1400d1290(uVar9);
        }
        if (((local_c0 != (undefined *)0x0) && (local_c0 != PTR_DAT_1402f8010)) &&
           (local_c0 + -8 != (undefined *)0x0)) {
          uVar9 = FUN_1400a3440();
          local_160 = uVar9;
          FUN_1400a1c30(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          piVar1 = (int *)(local_c0 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_c0 + -8);
          }
          FUN_1400d1290(uVar9);
        }
        local_138 = &local_108;
        local_c0 = PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_108 = PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_108 = (undefined *)0x0;
        }
        if (local_168 != PTR_DAT_1402f8010) {
          uVar9 = FUN_1400a3440();
          local_160 = uVar9;
          FUN_1400a1c30(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          FUN_1400031d0(&local_108);
          local_108 = local_168;
          if (((local_168 != PTR_DAT_1402f8010) && (local_168 != (undefined *)0x0)) &&
             (local_168 != (undefined *)0x8)) {
            *(int *)(local_168 + -4) = *(int *)(local_168 + -4) + 1;
          }
          FUN_1400d1290(uVar9);
        }
        puVar10 = PTR_DAT_14030b6c0;
        FUN_1400a3440();
        local_f8 = PTR_DAT_1402f8010;
        uVar4 = FUN_1400a32c0(puVar10);
        uVar9 = FUN_140002f20(&local_f8,uVar4);
        FUN_1400a32f0(uVar9,puVar10,uVar4);
        FUN_140003000(&local_f8);
        (**(code **)(*param_1 + 0x28))(param_1,0xfdeb,&local_f8,&local_108);
        puVar10 = local_168;
        if (local_168 == (undefined *)0x0) {
          puVar10 = PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfdeb,PTR_DAT_14030b6c0,puVar10);
        puVar10 = local_168;
        param_3 = local_res18;
        if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1402f8010)) &&
           (puVar12 = local_168 + -8, puVar12 != (undefined *)0x0)) {
          uVar9 = FUN_1400a3440();
          local_160 = uVar9;
          FUN_1400a1c30(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          piVar1 = (int *)(puVar10 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(puVar12);
          }
          FUN_1400d1290(uVar9);
          param_3 = local_res18;
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_160 = CONCAT44(local_160._4_4_,0xfdeb);
        local_158 = PTR_DAT_14030b6c0;
        local_150 = iVar2;
        local_148 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_160);
        DVar5 = GetTickCount();
      }
      cVar3 = (**(code **)(*param_1 + 0x48))(param_1,iVar2,local_a8,&local_128,&local_res10);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b6c0);
      }
      if ((char)param_1[3] != '\0') {
        return 1;
      }
      if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
        return 1;
      }
      local_160 = CONCAT44(local_160._4_4_,0xfdeb);
      local_158 = PTR_DAT_14030b6c0;
    }
    else {
      if (local_res20[0] != 0xfdec) goto LAB_140171510;
      FUN_140140af0(local_a8);
      local_a4 = param_2[10];
      local_a8[0] = (undefined1)param_2[0x10];
      cVar3 = FUN_140185490(param_2,&local_168,8);
      if (cVar3 != '\0') {
        local_128 = local_168;
      }
      cVar3 = FUN_140185490(param_2,&local_168,8);
      if (cVar3 != '\0') {
        local_110 = local_168;
      }
      cVar3 = FUN_140185490(param_2,&local_168,8);
      if (cVar3 != '\0') {
        local_b8[0] = local_168;
      }
      cVar3 = FUN_140185490(param_2,&local_168,4);
      if (cVar3 != '\0') {
        local_res10 = (undefined *)CONCAT44(local_res10._4_4_,local_168._0_4_);
      }
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_14030b6c8);
      DVar5 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfdec,PTR_DAT_14030b6c8,&DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_168 = PTR_DAT_1402f8010;
        FUN_1401a2a50(&local_168,&local_128);
        FUN_14003c890(&local_168,&DAT_14027c73c);
        FUN_1401a2a50(&local_168,&local_110);
        FUN_14003c890(&local_168,&DAT_14027c73c);
        FUN_1401a2a50(&local_168,local_b8);
        FUN_14003c890(&local_168,&DAT_14027c73c);
        FUN_1401a29e0(&local_168,&local_res10);
        FUN_14003c890(&local_168,&DAT_14027c73c);
        iVar11 = 0;
        if ((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1402f8010)) {
          iVar11 = *(int *)(local_168 + -8);
        }
        plVar7 = (longlong *)FUN_14003c0c0(&local_168,&local_d8,iVar11 + -2);
        if (local_168 == (undefined *)0x0) {
          local_168 = PTR_DAT_1402f8010;
        }
        if ((undefined *)*plVar7 != local_168) {
          ppuVar8 = (undefined **)FUN_1400a3440();
          local_138 = ppuVar8;
          FUN_1400a1c30(ppuVar8);
          puVar10 = local_168;
          local_130 = 1;
          if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1402f8010)) &&
             (puVar12 = local_168 + -8, puVar12 != (undefined *)0x0)) {
            uVar9 = FUN_1400a3440();
            local_160 = uVar9;
            FUN_1400a1c30(uVar9);
            local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
            piVar1 = (int *)(puVar10 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(puVar12);
            }
            FUN_1400d1290(uVar9);
          }
          local_168 = (undefined *)*plVar7;
          if (((local_168 != PTR_DAT_1402f8010) && (local_168 != (undefined *)0x0)) &&
             (local_168 != (undefined *)0x8)) {
            *(int *)(local_168 + -4) = *(int *)(local_168 + -4) + 1;
          }
          FUN_1400d1290(ppuVar8);
        }
        if (((local_d8 != (undefined *)0x0) && (local_d8 != PTR_DAT_1402f8010)) &&
           (local_d8 + -8 != (undefined *)0x0)) {
          uVar9 = FUN_1400a3440();
          local_160 = uVar9;
          FUN_1400a1c30(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          piVar1 = (int *)(local_d8 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_d8 + -8);
          }
          FUN_1400d1290(uVar9);
        }
        local_138 = &local_100;
        local_d8 = PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_100 = PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_100 = (undefined *)0x0;
        }
        if (local_168 != PTR_DAT_1402f8010) {
          uVar9 = FUN_1400a3440();
          local_160 = uVar9;
          FUN_1400a1c30(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          FUN_1400031d0(&local_100);
          local_100 = local_168;
          if (((local_168 != PTR_DAT_1402f8010) && (local_168 != (undefined *)0x0)) &&
             (local_168 != (undefined *)0x8)) {
            *(int *)(local_168 + -4) = *(int *)(local_168 + -4) + 1;
          }
          FUN_1400d1290(uVar9);
        }
        puVar10 = PTR_DAT_14030b6c8;
        FUN_1400a3440();
        local_e0 = PTR_DAT_1402f8010;
        uVar4 = FUN_1400a32c0(puVar10);
        uVar9 = FUN_140002f20(&local_e0,uVar4);
        FUN_1400a32f0(uVar9,puVar10,uVar4);
        FUN_140003000(&local_e0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfdec,&local_e0,&local_100);
        puVar10 = local_168;
        if (local_168 == (undefined *)0x0) {
          puVar10 = PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfdec,PTR_DAT_14030b6c8,puVar10);
        puVar10 = local_168;
        param_3 = local_res18;
        if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1402f8010)) &&
           (puVar12 = local_168 + -8, puVar12 != (undefined *)0x0)) {
          uVar9 = FUN_1400a3440();
          local_160 = uVar9;
          FUN_1400a1c30(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          piVar1 = (int *)(puVar10 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(puVar12);
          }
          FUN_1400d1290(uVar9);
          param_3 = local_res18;
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_160 = CONCAT44(local_160._4_4_,0xfdec);
        local_158 = PTR_DAT_14030b6c8;
        local_150 = iVar2;
        local_148 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_160);
        DVar5 = GetTickCount();
      }
      cVar3 = (**(code **)(*param_1 + 0x50))
                        (param_1,iVar2,local_a8,&local_128,&local_110,local_b8,&local_res10);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],PTR_DAT_14030b6c8);
      }
      if ((char)param_1[3] != '\0') {
        return 1;
      }
      if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
        return 1;
      }
      local_160 = CONCAT44(local_160._4_4_,0xfdec);
      local_158 = PTR_DAT_14030b6c8;
    }
    local_150 = iVar2;
    local_148 = param_3;
    DVar6 = GetTickCount();
    local_140 = DVar6 - DVar5;
    (**(code **)(*param_1 + 0x18))(param_1,&local_160);
    return 1;
  }
LAB_140171510:
  FUN_140185160(param_2,(int)((iVar11 >> 0x1f & 7U) + iVar11) >> 3);
  return 0;
}



undefined1
FUN_140171540(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa01);
  FUN_14007c7c0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b6d0,0xfa01);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140171620(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa01);
  FUN_14007c7c0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b6d0,0xfa01);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140171700(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa02);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b6d8,0xfa02);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1401717f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa02);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b6d8,0xfa02);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_1401718f0(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa03);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b6e0,0xfa03);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_1401719b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa03);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b6e0,0xfa03);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140171a80(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined1 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa04);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14003c9e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b6e8,0xfa04);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140171ba0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined1 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa04);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  FUN_14003c9e0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b6e8,0xfa04);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140171cc0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,longlong param_6,longlong param_7,longlong param_8,longlong param_9
             )

{
  undefined2 uVar1;
  undefined1 uVar2;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa05);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = *(undefined2 *)(param_6 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_6 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_7 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_7 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_8 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_8 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_9 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_9 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b6f0,0xfa05);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar2;
}



undefined1
FUN_140171e50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,longlong param_7,longlong param_8,
             longlong param_9,longlong param_10)

{
  undefined2 uVar1;
  undefined1 uVar2;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa05);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = *(undefined2 *)(param_7 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_7 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_8 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_8 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_9 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_9 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_10 + 0xc);
  FUN_14007c6e0(local_30,*(undefined4 *)(param_10 + 8));
  FUN_14003d020(local_30,uVar1);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b6f0,0xfa05);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar2;
}



undefined1 FUN_140171ff0(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa07);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b700,0xfa07);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_1401720b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa07);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b700,0xfa07);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140172180(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa08);
  FUN_14003c9e0(local_30,*param_4);
  FUN_140186d90(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b708,0xfa08);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140172270(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined1 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa08);
  FUN_14003c9e0(local_30,*param_5);
  FUN_140186d90(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b708,0xfa08);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140172360(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa09);
  FUN_14007c6e0(local_30,*param_4);
  FUN_140186d90(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b710,0xfa09);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140172450(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa09);
  FUN_14007c6e0(local_30,*param_5);
  FUN_140186d90(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b710,0xfa09);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140172540(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa0a);
  FUN_140186d90(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b718,0xfa0a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140172620(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa0a);
  FUN_140186d90(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b718,0xfa0a);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140172700(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa0b);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b720,0xfa0b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1401727e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa0b);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b720,0xfa0b);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1401728c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa0c);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b728,0xfa0c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1401729a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa0c);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b728,0xfa0c);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140172a80(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa0d);
  FUN_140186d90(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b730,0xfa0d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140172b60(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa0d);
  FUN_140186d90(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b730,0xfa0d);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140172c40(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa0e);
  FUN_14007c8a0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b738,0xfa0e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140172d20(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa0e);
  FUN_14007c8a0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b738,0xfa0e);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140172e00(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa0f);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b740,0xfa0f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140172ef0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa0f);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b740,0xfa0f);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140172ff0(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b748,0xfa10);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_1401730b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b748,0xfa10);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140173180(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa11);
  FUN_14003c9e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b750,0xfa11);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140173260(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined1 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa11);
  FUN_14003c9e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b750,0xfa11);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140173340(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa12);
  FUN_14007c6e0(local_30,*param_4);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b758,0xfa12);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140173440(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa12);
  FUN_14007c6e0(local_30,*param_5);
  FUN_14007c6e0(local_30,*param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b758,0xfa12);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140173550(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa13);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b760,0xfa13);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140173630(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfa13);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b760,0xfa13);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140173710(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfde9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b768,0xfde9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_1401737d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfde9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b768,0xfde9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1401738a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfdea);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b770,0xfdea);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140173980(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfdea);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b770,0xfdea);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140173a60(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfdeb);
  FUN_14007c8a0(local_30,*param_4);
  FUN_14007c7c0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b778,0xfdeb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140173b50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfdeb);
  FUN_14007c8a0(local_30,*param_5);
  FUN_14007c7c0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b778,0xfdeb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140173c50(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4,
             undefined8 *param_5,undefined8 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfdec);
  FUN_14007c8a0(local_30,*param_4);
  FUN_14007c8a0(local_30,*param_5);
  FUN_14007c8a0(local_30,*param_6);
  FUN_14007c7c0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_14030b780,0xfdec);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140173d70(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *param_5,undefined8 *param_6,undefined8 *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0xfdec);
  FUN_14007c8a0(local_30,*param_5);
  FUN_14007c8a0(local_30,*param_6);
  FUN_14007c8a0(local_30,*param_7);
  FUN_14007c7c0(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_14030b780,0xfdec);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined8 * FUN_140173ea0(longlong param_1,undefined8 *param_2,longlong param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  longlong lVar4;
  longlong *local_res8;
  
  if (*(longlong *)(param_1 + 0x1670) == 0) {
    lVar4 = 0;
  }
  else {
    lVar4 = *(longlong *)(param_1 + 0x1660);
  }
  do {
    if (lVar4 == 0) {
      *param_2 = 0;
      return param_2;
    }
    if (lVar4 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    local_res8 = (longlong *)0x0;
    if (*(longlong *)(lVar4 + 8) != 0) {
      *(longlong *)(*(longlong *)(lVar4 + 8) + 8) = *(longlong *)(*(longlong *)(lVar4 + 8) + 8) + 1;
      local_res8 = *(longlong **)(lVar4 + 8);
    }
    if (local_res8 == (longlong *)0x0) {
      lVar3 = 0;
    }
    else {
      lVar3 = *local_res8;
    }
    if (*(char *)(lVar3 + 0x684) == '\0') {
      if (local_res8 == (longlong *)0x0) {
        lVar3 = 0;
      }
      else {
        lVar3 = *local_res8;
      }
      if ((*(int *)(lVar3 + 0x5a8) == *(int *)(param_3 + 8)) &&
         (*(short *)(lVar3 + 0x5ac) == *(short *)(param_3 + 0xc))) {
        *param_2 = 0;
        if (local_res8 == (longlong *)0x0) {
          return param_2;
        }
        local_res8[1] = local_res8[1] + 1;
        *param_2 = local_res8;
        plVar1 = local_res8 + 1;
        *plVar1 = *plVar1 + -1;
        if (*plVar1 != 0) {
          return param_2;
        }
        puVar2 = (undefined8 *)*local_res8;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        FUN_1400a3530(local_res8);
        return param_2;
      }
    }
    if (local_res8 != (longlong *)0x0) {
      plVar1 = local_res8 + 1;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        if ((undefined8 *)*local_res8 != (undefined8 *)0x0) {
          (*(code *)**(undefined8 **)*local_res8)();
        }
        FUN_1400a3530(local_res8);
      }
    }
    if (lVar4 != 0) {
      lVar4 = *(longlong *)(lVar4 + 0x10);
    }
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140174010(longlong param_1)

{
  double dVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  undefined1 auStack_d78 [32];
  undefined8 local_d58;
  undefined4 uStack_d50;
  undefined4 uStack_d4c;
  undefined1 local_d48 [8];
  longlong local_d40;
  longlong local_d38;
  undefined4 local_d30;
  int local_d2c;
  undefined4 local_d20 [2];
  undefined8 local_d18;
  undefined1 local_d10;
  undefined4 local_d0c;
  undefined1 local_d08;
  undefined1 local_d07;
  undefined8 local_d00;
  undefined1 local_cf8 [80];
  undefined4 local_ca8;
  undefined4 uStack_ca4;
  undefined4 uStack_ca0;
  undefined4 uStack_c9c;
  undefined4 *local_28;
  undefined4 local_20;
  int local_1c;
  ulonglong local_18;
  
  local_d00 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_d78;
  if (*(int *)(param_1 + 0x1578) == 0) {
    FUN_140169e70();
  }
  else {
    dVar1 = (double)(**(code **)(*(longlong *)(param_1 + 0x70) + 0x1c0))(param_1 + 0x70);
    lVar5 = 0;
    if (DAT_1402f80f8 / *(double *)(param_1 + 0x1798) < dVar1 - *(double *)(param_1 + 0x5c8)) {
      *(int *)(param_1 + 0x4ec) = *(int *)(param_1 + 0x4ec) + 1;
      uVar2 = (**(code **)(*(longlong *)(param_1 + 0x70) + 0x1c0))(param_1 + 0x70);
      *(undefined8 *)(param_1 + 0x5c8) = uVar2;
      FUN_140185560(local_d48);
      FUN_140185030(local_d48);
      FUN_1401856c0(local_d48,0x800);
      FUN_1401856c0(local_d48,0);
      FUN_14003c9e0(local_d48,0x1a);
      uVar2 = (**(code **)(*(longlong *)(param_1 + 0x70) + 0x1c0))(param_1 + 0x70);
      FUN_14007c8a0(local_d48,uVar2);
      FUN_14007c8a0(local_d48,*(undefined8 *)(param_1 + 0x4f8));
      local_1c = 200;
      local_20 = 0;
      local_28 = &local_ca8;
      if (local_d40 == 0) {
        if (local_d38 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
      }
      else {
        local_d30 = *(undefined4 *)(local_d40 + 0x18);
      }
      lVar3 = local_d38;
      if (local_d38 == 0) {
        if (local_d40 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        lVar3 = lVar5;
        if (*(int *)(local_d40 + 0x18) != 0) {
          lVar3 = *(longlong *)(local_d40 + 0x10);
        }
      }
      local_20 = 1;
      local_d58._0_4_ = (undefined4)lVar3;
      local_d58._4_4_ = (undefined4)((ulonglong)lVar3 >> 0x20);
      local_ca8 = (undefined4)local_d58;
      uStack_ca4 = local_d58._4_4_;
      uStack_c9c = uStack_d4c;
      local_d20[0] = 0;
      local_d18 = 0;
      local_d10 = 1;
      local_d0c = 0xffffffff;
      local_d08 = 1;
      local_d07 = DAT_1402f81cc;
      lVar4 = lVar5;
      if (*(longlong **)(param_1 + 0x1570) != (longlong *)0x0) {
        lVar4 = **(longlong **)(param_1 + 0x1570);
      }
      local_d58 = (longlong *)lVar3;
      uStack_d50 = local_d30;
      uStack_ca0 = local_d30;
      FUN_1401b1a40(lVar4,1,&local_ca8,local_d20);
      if (local_28 == (undefined4 *)0x0) {
        FUN_1400a2320(local_cf8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_cf8,(ThrowInfo *)&DAT_1402f4860);
      }
      if (local_1c < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_d58 = &local_d40;
      FUN_14019a730(&local_d40);
      if ((local_d38 != 0) && (local_d2c < 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
    }
    FUN_1401bd0b0(param_1 + 0xb8,DAT_1402f80f8 * 10.0 * 2.0 * 0.3);
    if (*(longlong *)(param_1 + 0x5d8) != 0) {
      lVar5 = *(longlong *)(*(longlong *)(param_1 + 0x5d8) + 0x38);
    }
    FUN_1401bd070(param_1 + 0xb8,*(undefined8 *)(lVar5 + 0x100));
    if (*(char *)(param_1 + 200) != '\0') {
      local_d58 = (longlong *)CONCAT44(local_d58._4_4_,(float)*(double *)(param_1 + 0x1870));
      (**(code **)(*(longlong *)(param_1 + 0x1818) + 0x30))
                ((longlong *)(param_1 + 0x1818),1,&DAT_140318cf0,&local_d58);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140174300(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  double dVar3;
  undefined1 auStack_d78 [32];
  undefined1 local_d58 [8];
  longlong local_d50;
  longlong local_d48;
  undefined4 local_d40;
  int local_d3c;
  undefined8 local_d30;
  undefined4 uStack_d28;
  undefined4 uStack_d24;
  undefined4 local_d20 [2];
  undefined8 local_d18;
  undefined1 local_d10;
  undefined4 local_d0c;
  undefined1 local_d08;
  undefined1 local_d07;
  undefined8 local_d00;
  undefined1 local_cf8 [80];
  undefined4 local_ca8;
  undefined4 uStack_ca4;
  undefined4 uStack_ca0;
  undefined4 uStack_c9c;
  undefined4 *local_28;
  undefined4 local_20;
  int local_1c;
  ulonglong local_18;
  
  local_d00 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_d78;
  if ((*(int *)(param_1 + 0x1578) != 0) && (*(double *)(param_1 + 0x1890) != DAT_1402f8078)) {
    lVar2 = 0;
    lVar1 = lVar2;
    if (*(longlong *)(param_1 + 0x5d8) != 0) {
      lVar1 = *(longlong *)(*(longlong *)(param_1 + 0x5d8) + 0x38);
    }
    dVar3 = *(double *)(param_1 + 0x1890) - *(double *)(lVar1 + 0x100);
    *(double *)(param_1 + 0x1890) = dVar3;
    if (dVar3 <= 0.0) {
      *(undefined8 *)(param_1 + 0x1890) = 0x3fe2e147ae147ae1;
      *(double *)(param_1 + 0x1890) = 0.59 / *(double *)(param_1 + 0x1798);
      FUN_140185560(local_d58);
      FUN_140185030(local_d58);
      FUN_1401856c0(local_d58,0x800);
      FUN_1401856c0(local_d58,0);
      FUN_14003c9e0(local_d58,0x1b);
      local_1c = 200;
      local_20 = 0;
      local_28 = &local_ca8;
      if (local_d50 == 0) {
        if (local_d48 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
      }
      else {
        local_d40 = *(undefined4 *)(local_d50 + 0x18);
      }
      lVar1 = local_d48;
      if (local_d48 == 0) {
        if (local_d50 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        lVar1 = lVar2;
        if (*(int *)(local_d50 + 0x18) != 0) {
          lVar1 = *(longlong *)(local_d50 + 0x10);
        }
      }
      local_20 = 1;
      local_d30._0_4_ = (undefined4)lVar1;
      local_d30._4_4_ = (undefined4)((ulonglong)lVar1 >> 0x20);
      local_ca8 = (undefined4)local_d30;
      uStack_ca4 = local_d30._4_4_;
      uStack_c9c = uStack_d24;
      local_d20[0] = 0;
      local_d18 = 0;
      local_d10 = 1;
      local_d0c = 0xffffffff;
      local_d08 = 1;
      local_d07 = DAT_1402f81cc;
      if (*(longlong **)(param_1 + 0x1570) != (longlong *)0x0) {
        lVar2 = **(longlong **)(param_1 + 0x1570);
      }
      local_d30 = (longlong *)lVar1;
      uStack_d28 = local_d40;
      uStack_ca0 = local_d40;
      FUN_1401b1a40(lVar2,1,&local_ca8,local_d20);
      if (local_28 == (undefined4 *)0x0) {
        FUN_1400a2320(local_cf8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_cf8,(ThrowInfo *)&DAT_1402f4860);
      }
      if (local_1c < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_d30 = &local_d50;
      FUN_14019a730(&local_d50);
      if ((local_d48 != 0) && (local_d3c < 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x0001401748e1)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140174560(longlong param_1)

{
  double dVar1;
  undefined4 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  double dVar8;
  undefined1 auStack_d98 [32];
  undefined1 local_d78 [8];
  longlong local_d70;
  longlong local_d68;
  undefined4 local_d60;
  int local_d5c;
  undefined4 local_d50 [2];
  undefined8 local_d48;
  undefined1 local_d40;
  undefined4 local_d3c;
  undefined1 local_d38;
  undefined1 local_d37;
  undefined8 local_d30;
  undefined4 uStack_d28;
  undefined4 uStack_d24;
  longlong *local_d20;
  undefined8 local_d18;
  undefined1 local_d10 [72];
  undefined4 local_cc8;
  undefined4 uStack_cc4;
  undefined4 uStack_cc0;
  undefined4 uStack_cbc;
  undefined4 *local_48;
  undefined4 local_40;
  int local_3c;
  ulonglong local_38;
  
  local_d18 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_d98;
  (**(code **)(*(longlong *)(param_1 + 0x78) + 0x10))();
  lVar7 = 0;
  lVar3 = lVar7;
  if (*(longlong *)(param_1 + 0x1670) != 0) {
    lVar3 = *(longlong *)(param_1 + 0x1660);
  }
  do {
    lVar6 = lVar3;
    if (lVar6 == 0) {
      return;
    }
    if ((((*(longlong **)(lVar6 + 8) != (longlong *)0x0) &&
         (lVar3 = **(longlong **)(lVar6 + 8), lVar3 != 0)) && (*(char *)(lVar3 + 0x684) == '\0')) &&
       (*(int *)(lVar3 + 0x56c) != 1)) {
      lVar5 = lVar7;
      if (*(longlong *)(param_1 + 0x5d8) != 0) {
        lVar5 = *(longlong *)(*(longlong *)(param_1 + 0x5d8) + 0x38);
      }
      dVar8 = *(double *)(lVar3 + 0x148) - *(double *)(lVar5 + 0x100);
      *(double *)(lVar3 + 0x148) = dVar8;
      if (dVar8 <= 0.0) {
        *(undefined8 *)(lVar3 + 0x148) = DAT_1402f80f0;
        uVar4 = (**(code **)(*(longlong *)(param_1 + 0x70) + 0x1c0))(param_1 + 0x70);
        *(undefined8 *)(lVar3 + 0x80) = uVar4;
        if (*(char *)(lVar3 + 0x608) == '\0') {
          FUN_140185560(local_d78);
          FUN_140185030(local_d78);
          FUN_1401856c0(local_d78,0x800);
          FUN_1401856c0(local_d78,0);
          FUN_14003c9e0(local_d78,0x20);
          uVar4 = FUN_1400ad790(param_1 + 0x1620);
          FUN_14007c8a0(local_d78,uVar4);
          local_3c = 200;
          local_40 = 0;
          local_48 = &local_cc8;
          if (local_d70 == 0) {
            uVar2 = local_d60;
            if (local_d68 == 0) {
                    // WARNING: Subroutine does not return
              FUN_14019a830();
            }
          }
          else {
            uVar2 = *(undefined4 *)(local_d70 + 0x18);
          }
          lVar5 = local_d68;
          if (local_d68 == 0) {
            if (local_d70 == 0) {
                    // WARNING: Subroutine does not return
              FUN_14019a830();
            }
            lVar5 = lVar7;
            if (*(int *)(local_d70 + 0x18) != 0) {
              lVar5 = *(longlong *)(local_d70 + 0x10);
            }
          }
          local_40 = 1;
          local_d30._0_4_ = (undefined4)lVar5;
          local_d30._4_4_ = (undefined4)((ulonglong)lVar5 >> 0x20);
          local_cc8 = (undefined4)local_d30;
          uStack_cc4 = local_d30._4_4_;
          uStack_cbc = uStack_d24;
          local_d50[0] = 0;
          local_d48 = 0;
          local_d40 = 1;
          local_d3c = 0xffffffff;
          local_d38 = 1;
          local_d37 = DAT_1402f81cc;
          local_d30 = lVar5;
          uStack_d28 = uVar2;
          uStack_cc0 = uVar2;
          FUN_1401b8a90(lVar3 + 0x668,&local_cc8,local_d50);
          if (local_48 == (undefined4 *)0x0) {
            FUN_1400a2320(local_d10,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
            _CxxThrowException(local_d10,(ThrowInfo *)&DAT_1402f4860);
          }
          if (local_3c < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          local_40 = 0;
          local_d20 = &local_d70;
          FUN_14019a730(&local_d70);
          if (local_d68 != 0) {
            if (local_d5c < 0) {
                    // WARNING: Subroutine does not return
              FUN_1400a26d0();
            }
            local_d60 = 0;
          }
        }
        else {
          dVar8 = (double)(**(code **)(*(longlong *)(param_1 + 0x70) + 0x1c0))(param_1 + 0x70);
          dVar8 = dVar8 - *(double *)(lVar3 + 0xc0);
          if (0.0 < dVar8) {
            *(double *)(lVar3 + 0x140) = dVar8;
          }
          uVar4 = (**(code **)(*(longlong *)(param_1 + 0x70) + 0x1c0))(param_1 + 0x70);
          *(undefined8 *)(lVar3 + 0xc0) = uVar4;
          *(int *)(lVar3 + 0x100) = *(int *)(lVar3 + 0x100) + 1;
          *(undefined8 *)(lVar3 + 0x150) = 0;
          dVar8 = *(double *)(param_1 + 0x4f8) + *(double *)(lVar3 + 0x60);
          *(double *)(lVar3 + 0x158) = dVar8;
          if (*(char *)(lVar3 + 0x618) != '\0') {
            *(undefined8 *)(lVar3 + 0x50) = 0;
            *(undefined1 *)(lVar3 + 0x618) = 0;
          }
          dVar1 = *(double *)(lVar3 + 0x50);
          if (dVar1 <= 0.0) {
            *(undefined8 *)(lVar3 + 0x50) = *(undefined8 *)(lVar3 + 0x158);
          }
          else {
            *(double *)(lVar3 + 0x50) = (dVar8 - dVar1) * _DAT_1402f8108 + dVar1;
          }
        }
      }
    }
    lVar3 = lVar7;
    if (lVar6 != 0) {
      lVar3 = *(longlong *)(lVar6 + 0x10);
    }
  } while( true );
}



void FUN_140174920(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  char cVar2;
  undefined2 uVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  longlong lVar6;
  longlong lVar7;
  undefined8 uVar8;
  undefined **local_90;
  undefined4 local_88;
  undefined2 local_84;
  undefined8 local_80;
  undefined1 local_78;
  undefined4 local_70 [2];
  undefined8 local_68;
  undefined1 local_60;
  undefined4 local_5c;
  undefined1 local_58;
  undefined1 local_57;
  undefined1 local_50 [8];
  undefined1 local_48 [8];
  longlong local_40;
  int local_34;
  
  uVar5 = (**(code **)(*(longlong *)(param_1 + -0x90) + 0x58))(param_1 + -0x90);
  local_80 = uVar5;
  FUN_1400a1c30(uVar5);
  local_78 = 1;
  plVar1 = *(longlong **)(param_1 + 0x1490);
  if ((((plVar1 != (longlong *)0x0) && (*plVar1 != 0)) && (plVar1 != (longlong *)0x0)) &&
     ((*plVar1 != 0 && (*plVar1 != 0x40)))) {
    lVar7 = 0;
    lVar6 = lVar7;
    if (((plVar1 != (longlong *)0x0) && ((*plVar1 != 0 && (plVar1 != (longlong *)0x0)))) &&
       (*plVar1 != 0)) {
      lVar6 = *plVar1 + -0x40;
    }
    cVar2 = (**(code **)(*(longlong *)(lVar6 + 0x40) + 0x10))();
    if (cVar2 == '\0') {
      FUN_140185560(local_50);
      FUN_140185030(local_50);
      FUN_1401856c0(local_50,0x800);
      FUN_1401856c0(local_50,0);
      FUN_14003c9e0(local_50,0x27);
      local_70[0] = 1;
      local_68 = 0;
      local_60 = 1;
      local_5c = 0xffffffff;
      local_58 = 1;
      local_57 = DAT_1402f81cc;
      local_90 = Proud::AddrPort::vftable;
      local_88 = *(undefined4 *)(param_2 + 8);
      local_84 = *(undefined2 *)(param_2 + 0xc);
      plVar1 = *(longlong **)(param_1 + 0x1490);
      if ((((plVar1 != (longlong *)0x0) && (*plVar1 != 0)) && (plVar1 != (longlong *)0x0)) &&
         (lVar7 = 0, *plVar1 != 0)) {
        lVar7 = *plVar1 + -0x40;
      }
      uVar8 = (**(code **)(*(longlong *)(param_1 + -0x20) + 0x1c0))();
      uVar4 = (**(code **)(*(longlong *)(param_1 + -0x90) + 0x30))(param_1 + -0x90);
      uVar3 = FUN_14019c290(uVar4,1);
      FUN_1401bc9b0(lVar7,1,uVar3,&local_90,local_50,uVar8,local_70);
      FUN_14019a730(local_48);
      if ((local_40 != 0) && (local_34 < 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
    }
  }
  FUN_1400d1290(uVar5);
  return;
}



undefined8 FUN_140174b30(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  undefined8 *puVar3;
  longlong *plVar4;
  char cVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  longlong *local_res10;
  undefined8 local_res18 [2];
  undefined8 uVar9;
  undefined **local_38;
  int local_30;
  undefined2 local_2c;
  
  uVar9 = 0xfffffffffffffffe;
  if (*(char *)(param_1 + 0x1528) == '\0') {
    if ((*(longlong **)(param_1 + 0x1520) == (longlong *)0x0) ||
       (**(longlong **)(param_1 + 0x1520) == 0)) {
      local_res10 = operator_new(0x1c0);
      if (local_res10 == (longlong *)0x0) {
        lVar6 = 0;
      }
      else {
        lVar6 = FUN_1401bcab0(local_res10,param_1,0,param_4,uVar9);
      }
      lVar8 = 0;
      if ((lVar6 == 0) || (lVar6 + 0x40 == 0)) {
        local_res10 = (longlong *)0x0;
      }
      else {
        local_res10 = (longlong *)FUN_1400a34c0(0x10);
        local_res10[1] = 1;
        *local_res10 = lVar6 + 0x40;
      }
      plVar1 = local_res10;
      FUN_14016b650(param_1 + 0x1520,&local_res10);
      plVar4 = local_res10;
      if (plVar1 != (longlong *)0x0) {
        plVar1 = plVar1 + 1;
        *plVar1 = *plVar1 + -1;
        if (*plVar1 == 0) {
          puVar3 = (undefined8 *)*local_res10;
          if (puVar3 != (undefined8 *)0x0) {
            (**(code **)*puVar3)(puVar3,1);
          }
          FUN_1400a3530(plVar4);
        }
      }
      lVar6 = lVar8;
      if ((*(longlong **)(param_1 + 0x15d8) != (longlong *)0x0) &&
         (lVar7 = **(longlong **)(param_1 + 0x15d8), lVar7 != 0)) {
        lVar6 = lVar7 + -0x40;
      }
      iVar2 = *(int *)(lVar6 + 0x118);
      if ((iVar2 == 0) || (iVar2 == -1)) {
        FUN_1400a2b50(&DAT_140256390);
      }
      local_38 = Proud::AddrPort::vftable;
      local_2c = 0;
      if ((*(longlong **)(param_1 + 0x1520) == (longlong *)0x0) ||
         (lVar6 = **(longlong **)(param_1 + 0x1520), lVar7 = lVar6 + -0x40, lVar6 == 0)) {
        lVar7 = lVar8;
      }
      local_30 = iVar2;
      cVar5 = FUN_1401bce90(lVar7,&local_38);
      if (cVar5 == '\0') {
        local_res18[0] = 0;
        FUN_14016b650(param_1 + 0x1520,local_res18);
        *(undefined1 *)(param_1 + 0x1528) = 1;
        return 0;
      }
      if ((*(longlong **)(param_1 + 0x1520) != (longlong *)0x0) &&
         (lVar6 = **(longlong **)(param_1 + 0x1520), lVar6 != 0)) {
        lVar8 = lVar6 + -0x40;
      }
      FUN_1401bc490(lVar8);
    }
    uVar9 = 1;
  }
  else {
    uVar9 = 0;
  }
  return uVar9;
}



undefined8 * FUN_140174ce0(undefined8 *param_1)

{
  undefined4 uVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  bool bVar5;
  longlong local_res10;
  
  LOCK();
  bVar5 = DAT_140318f00 == 0;
  if (bVar5) {
    DAT_140318f00 = 1;
  }
  UNLOCK();
  if (bVar5) {
    lVar3 = FUN_1400a34c0(0x2c0);
    if (lVar3 == 0) {
      lVar3 = 0;
    }
    else {
      lVar3 = FUN_1401b1670(lVar3);
    }
    if (lVar3 == 0) {
      local_res10 = 0;
    }
    else {
      lVar4 = FUN_1400a34c0(0x48);
      if (lVar4 != 0) {
        local_res10 = lVar4;
        uVar1 = FUN_1401692e0();
        FUN_1400a1b50(lVar4,uVar1,1);
      }
      local_res10 = lVar4;
      FUN_1400a1c30(lVar4);
      *(undefined8 *)(lVar4 + 0x40) = 1;
      *(longlong *)(lVar4 + 0x38) = lVar3;
      FUN_1400d1290(lVar4);
    }
    FUN_14016b480(&DAT_140318f08,&local_res10);
    FUN_14016b1c0(&local_res10);
    LOCK();
    UNLOCK();
    DAT_140318f00 = 2;
  }
  else {
    LOCK();
    iVar2 = DAT_140318f00;
    if (DAT_140318f00 == 9999) {
      DAT_140318f00 = 999;
      iVar2 = 9999;
    }
    UNLOCK();
    while (iVar2 != 2) {
      Sleep(5);
      LOCK();
      iVar2 = DAT_140318f00;
      if (DAT_140318f00 == 9999) {
        DAT_140318f00 = 999;
        iVar2 = 9999;
      }
      UNLOCK();
    }
  }
  *param_1 = 0;
  FUN_14016b480(param_1,&DAT_140318f08);
  return param_1;
}



void FUN_140174e40(longlong param_1,int param_2)

{
  longlong *plVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  undefined1 local_58 [80];
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  iVar2 = *(int *)(param_1 + 0x18);
  if (param_2 != iVar2) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar2 = FUN_1401696b0(param_1,param_2);
      plVar1 = *(longlong **)(param_1 + 8);
      lVar4 = (longlong)iVar2;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          uVar3 = FUN_1400a34c0(lVar4 * 0x48);
        }
        else {
          uVar3 = (**(code **)(*plVar1 + 8))(plVar1,lVar4 * 0x48);
        }
        *(undefined8 *)(param_1 + 0x10) = uVar3;
        FUN_14016b920(uVar3,(longlong)param_2);
      }
      else {
        uVar3 = *(undefined8 *)(param_1 + 0x10);
        if (plVar1 == (longlong *)0x0) {
          lVar4 = FUN_1400a34c0(lVar4 * 0x48);
        }
        else {
          lVar4 = (**(code **)(*plVar1 + 8))(plVar1,lVar4 * 0x48);
        }
        FUN_14016b9c0(lVar4,uVar3,(longlong)*(int *)(param_1 + 0x18));
        FUN_14016b920(lVar4 + (longlong)*(int *)(param_1 + 0x18) * 0x48,
                      (longlong)(param_2 - *(int *)(param_1 + 0x18)));
        if (lVar4 == 0) {
          FUN_1400a2320(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
        }
        FUN_14018b8a0(uVar3,(longlong)*(int *)(param_1 + 0x18));
        plVar1 = *(longlong **)(param_1 + 8);
        if (plVar1 == (longlong *)0x0) {
          FUN_1400a3530(uVar3);
        }
        else {
          (**(code **)(*plVar1 + 0x18))(plVar1,uVar3);
        }
        *(longlong *)(param_1 + 0x10) = lVar4;
      }
      *(int *)(param_1 + 0x1c) = iVar2;
    }
    else if (iVar2 - param_2 < 1) {
      if (0 < param_2 - iVar2) {
        FUN_14016b920(*(longlong *)(param_1 + 0x10) + (longlong)iVar2 * 0x48,
                      (longlong)(param_2 - iVar2));
      }
    }
    else {
      FUN_14018b8a0(*(longlong *)(param_1 + 0x10) + (longlong)param_2 * 0x48,
                    (longlong)(iVar2 - param_2));
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



uint * FUN_140174ff0(longlong param_1,uint *param_2)

{
  uint *puVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  uVar2 = (ulonglong)*param_2 % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (puVar1 != (uint *)0x0 && ((uint)uVar2 == puVar1[8] % *(uint *)(param_1 + 0x28)));
        puVar1 = *(uint **)(puVar1 + 4)) {
      if (*puVar1 == *param_2) {
        return puVar1 + 2;
      }
    }
  }
  lVar3 = FUN_14019e060(param_1,param_2,uVar2);
  return (uint *)(lVar3 + 8);
}



void FUN_140175060(longlong *param_1,longlong param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  
  if (*(longlong *)(param_2 + 0x10) != 0) {
    *(longlong *)(*(longlong *)(param_2 + 0x10) + 8) =
         *(longlong *)(*(longlong *)(param_2 + 0x10) + 8) + -1;
    if (*(longlong *)(*(longlong *)(param_2 + 0x10) + 8) == 0) {
      plVar1 = *(longlong **)(param_2 + 0x10);
      puVar2 = (undefined8 *)*plVar1;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      FUN_1400a3530(plVar1);
    }
  }
  plVar1 = (longlong *)*param_1;
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x10))(plVar1,param_2);
    param_1[3] = param_1[3] + -1;
    return;
  }
  FUN_1400a3530(param_2);
  param_1[3] = param_1[3] + -1;
  return;
}



void FUN_140175100(longlong *param_1,longlong param_2)

{
  longlong *plVar1;
  
  FUN_14019a730(param_2 + 0x18);
  if (*(longlong *)(param_2 + 0x20) != 0) {
    if (*(int *)(param_2 + 0x2c) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(param_2 + 0x28) = 0;
  }
  plVar1 = (longlong *)*param_1;
  if (plVar1 == (longlong *)0x0) {
    FUN_1400a3530(param_2);
  }
  else {
    (**(code **)(*plVar1 + 0x10))(plVar1,param_2);
  }
  param_1[3] = param_1[3] + -1;
  return;
}



undefined1 FUN_140175170(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong param_4)

{
  int iVar1;
  undefined1 uVar2;
  undefined8 uVar3;
  undefined4 local_res10 [4];
  longlong *local_res20;
  undefined1 local_40 [4];
  undefined4 local_3c;
  longlong local_38;
  longlong local_30;
  int local_24;
  
  local_res10[0] = param_2;
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0xfa06);
  iVar1 = *(int *)(param_4 + 0x18);
  FUN_140186930(local_40,(longlong)iVar1);
  if (*(int *)(param_4 + 0x18) == 0) {
    uVar3 = 0;
  }
  else {
    uVar3 = *(undefined8 *)(param_4 + 0x10);
  }
  if (iVar1 == 0) goto LAB_140175231;
  local_3c = 0;
  if (local_38 == 0) {
    if (local_30 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830(0,uVar3);
    }
LAB_140175203:
    FUN_14003cc90(&local_30,uVar3,iVar1);
  }
  else {
    if (local_30 != 0) goto LAB_140175203;
    if (local_38 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830(0,uVar3);
    }
    FUN_14003ce60(local_38,uVar3,iVar1);
  }
  FUN_14003ced0(local_40);
LAB_140175231:
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,PTR_DAT_14030b6f8,0xfa06);
  local_res20 = &local_38;
  FUN_14019a730(&local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar2;
}



undefined1
FUN_1401752b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             longlong param_5)

{
  int iVar1;
  undefined1 uVar2;
  undefined8 uVar3;
  undefined1 local_40 [4];
  undefined4 local_3c;
  longlong local_38;
  longlong local_30;
  int local_24;
  
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0xfa06);
  iVar1 = *(int *)(param_5 + 0x18);
  FUN_140186930(local_40,(longlong)iVar1);
  if (*(int *)(param_5 + 0x18) == 0) {
    uVar3 = 0;
  }
  else {
    uVar3 = *(undefined8 *)(param_5 + 0x10);
  }
  if (iVar1 == 0) goto LAB_140175380;
  local_3c = 0;
  if (local_38 == 0) {
    if (local_30 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830(0,uVar3);
    }
LAB_140175352:
    FUN_14003cc90(&local_30,uVar3,iVar1);
  }
  else {
    if (local_30 != 0) goto LAB_140175352;
    if (local_38 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830(0,uVar3);
    }
    FUN_14003ce60(local_38,uVar3,iVar1);
  }
  FUN_14003ced0(local_40);
LAB_140175380:
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,PTR_DAT_14030b6f8,0xfa06);
  FUN_14019a730(&local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar2;
}



undefined8 FUN_140175400(longlong param_1,undefined8 param_2,undefined8 param_3,longlong *param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined *puVar5;
  char local_res8 [8];
  undefined8 uVar6;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  undefined4 local_20;
  undefined2 local_1c;
  undefined8 local_18;
  undefined1 local_10;
  
  uVar6 = 0xfffffffffffffffe;
  uVar1 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  local_18 = uVar1;
  FUN_1400a1c30(uVar1);
  local_10 = 1;
  local_res8[0] = FUN_140174b30(*(undefined8 *)(param_1 + 0x20));
  if (local_res8[0] != '\0') {
    FUN_14016a190(*(undefined8 *)(param_1 + 0x20));
    puVar5 = (undefined *)*param_4;
    if ((undefined *)*param_4 == (undefined *)0x0) {
      puVar5 = PTR_DAT_1402f8008;
    }
    uVar2 = FUN_1400ab7b0(local_30,puVar5);
    FUN_1400a6800(local_28,uVar2,(short)param_4[1]);
    plVar4 = *(longlong **)(*(longlong *)(param_1 + 0x20) + 0x1570);
    lVar3 = 0;
    if (plVar4 != (longlong *)0x0) {
      lVar3 = *plVar4;
    }
    *(undefined4 *)(lVar3 + 0xd0) = local_20;
    *(undefined2 *)(lVar3 + 0xd4) = local_1c;
  }
  plVar4 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x1818);
  (**(code **)(*plVar4 + 0x130))(plVar4,1,&DAT_140318cf0,local_res8,uVar6);
  FUN_1400d1290(uVar1);
  return 1;
}



undefined8
FUN_1401754f0(longlong param_1,undefined8 param_2,undefined8 param_3,char *param_4,longlong *param_5
             )

{
  longlong *plVar1;
  char cVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined *puVar6;
  longlong lVar7;
  undefined1 local_res8 [8];
  undefined1 local_30 [8];
  undefined4 local_28;
  undefined2 local_24;
  undefined8 local_20;
  undefined1 local_18;
  
  uVar3 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  local_20 = uVar3;
  FUN_1400a1c30(uVar3);
  local_18 = 1;
  lVar7 = 0;
  if ((*param_4 != '\0') && (cVar2 = FUN_140174b30(*(undefined8 *)(param_1 + 0x20)), cVar2 != '\0'))
  {
    FUN_14016a190(*(undefined8 *)(param_1 + 0x20));
    puVar6 = (undefined *)*param_5;
    if ((undefined *)*param_5 == (undefined *)0x0) {
      puVar6 = PTR_DAT_1402f8008;
    }
    uVar4 = FUN_1400ab7b0(local_res8,puVar6);
    FUN_1400a6800(local_30,uVar4,(short)param_5[1]);
    plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x20) + 0x1570);
    lVar5 = lVar7;
    if (plVar1 != (longlong *)0x0) {
      lVar5 = *plVar1;
    }
    *(undefined4 *)(lVar5 + 0xd0) = local_28;
    *(undefined2 *)(lVar5 + 0xd4) = local_24;
  }
  plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x20) + 0x1570);
  if (plVar1 != (longlong *)0x0) {
    lVar7 = *plVar1;
  }
  *(undefined1 *)(lVar7 + 0x40) = 0;
  FUN_1400d1290(uVar3);
  return 1;
}



undefined8 * FUN_1401755f0(longlong *param_1,undefined8 *param_2,uint param_3)

{
  uint uVar1;
  uint *puVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  
  uVar5 = 0xfffffffffffffffe;
  uVar4 = (**(code **)(*param_1 + 0x58))();
  uVar6 = uVar4;
  FUN_1400a1c30(uVar4);
  *param_2 = 0;
  uVar1 = *(uint *)(param_1 + 0x2cf);
  uVar3 = (ulonglong)param_3 % (ulonglong)uVar1;
  if (param_1[0x2cb] != 0) {
    puVar2 = *(uint **)(param_1[0x2cb] + uVar3 * 8);
    while( true ) {
      if ((puVar2 == (uint *)0x0) || ((uint)uVar3 != puVar2[8] % uVar1)) goto LAB_140175698;
      if (*puVar2 == param_3) break;
      puVar2 = *(uint **)(puVar2 + 4);
    }
    FUN_14016b650(param_2,puVar2 + 2,uVar3,(ulonglong)uVar1,uVar5,uVar6,1);
  }
LAB_140175698:
  FUN_1401b2030(param_1 + 0x2ca);
  FUN_1400d1290(uVar4);
  return param_2;
}



longlong * FUN_1401756c0(longlong *param_1,int param_2,undefined8 param_3)

{
  undefined8 *puVar1;
  char cVar2;
  undefined8 uVar3;
  longlong *plVar4;
  longlong *plVar5;
  wchar_t *pwVar6;
  longlong *local_res8;
  undefined8 uVar7;
  undefined1 uVar8;
  
  uVar7 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(uVar3);
  uVar8 = 1;
  FUN_1401755f0(param_1,&local_res8,param_2);
  plVar4 = (longlong *)0x0;
  if ((local_res8 == (longlong *)0x0) || (*local_res8 == 0)) {
    if ((int)param_1[0x2af] == param_2) {
      plVar5 = param_1 + 0x1b;
      goto LAB_14017574f;
    }
    plVar5 = plVar4;
    if (param_2 == 1) {
      plVar5 = param_1 + 0xe1;
      goto LAB_14017574f;
    }
  }
  else {
    plVar5 = (longlong *)(*local_res8 + 0x168);
LAB_14017574f:
    if (plVar5 != (longlong *)0x0) {
      cVar2 = FUN_1401964b0(plVar5);
      if ((cVar2 == '\0') || (((char)plVar5[0x7f] == '\0' && ((int)plVar5[0x7d] == 0)))) {
        FUN_14003c600(param_3,L"key not exists!");
        if ((local_res8 != (longlong *)0x0) &&
           (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
          puVar1 = (undefined8 *)*local_res8;
          if (puVar1 != (undefined8 *)0x0) {
            (**(code **)*puVar1)(puVar1,1);
          }
          FUN_1400a3530(local_res8);
        }
        FUN_1400d1290(uVar3);
        return (longlong *)0x0;
      }
      goto LAB_140175808;
    }
  }
  if (local_res8 != (longlong *)0x0) {
    plVar4 = (longlong *)*local_res8;
  }
  pwVar6 = L"not NULL";
  if (plVar4 == (longlong *)0x0) {
    pwVar6 = L"NULL";
  }
  FUN_14003c600(param_3,L"%d remote rp is %s in netclient!",param_2,pwVar6,uVar7,uVar3,uVar8);
LAB_140175808:
  if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
    puVar1 = (undefined8 *)*local_res8;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    FUN_1400a3530(local_res8);
  }
  FUN_1400d1290(uVar3);
  return plVar5;
}



undefined8 FUN_140175870(longlong param_1,uint param_2,undefined8 param_3)

{
  longlong *plVar1;
  uint *puVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  undefined8 uVar5;
  longlong lVar6;
  longlong *local_res8;
  
  uVar5 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))();
  FUN_1400a1c30(uVar5);
  lVar6 = 0;
  local_res8 = (longlong *)0x0;
  uVar4 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x1608);
  if (*(longlong *)(param_1 + 0x15e8) != 0) {
    for (puVar2 = *(uint **)(*(longlong *)(param_1 + 0x15e8) + uVar4 * 8);
        (puVar2 != (uint *)0x0 && ((uint)uVar4 == puVar2[8] % *(uint *)(param_1 + 0x1608)));
        puVar2 = *(uint **)(puVar2 + 4)) {
      if (*puVar2 == param_2) {
        if (*(longlong *)(puVar2 + 2) != 0) {
          *(longlong *)(*(longlong *)(puVar2 + 2) + 8) =
               *(longlong *)(*(longlong *)(puVar2 + 2) + 8) + 1;
          local_res8 = *(longlong **)(puVar2 + 2);
        }
        FUN_1401b2030(param_1 + 0x15e0);
        if (local_res8 != (longlong *)0x0) {
          lVar6 = *local_res8;
        }
        FUN_1401bb340(lVar6,param_3);
        if (local_res8 != (longlong *)0x0) {
          plVar1 = local_res8 + 1;
          *plVar1 = *plVar1 + -1;
          if (*plVar1 == 0) {
            puVar3 = (undefined8 *)*local_res8;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            FUN_1400a3530(local_res8);
          }
        }
        FUN_1400d1290(uVar5);
        return 1;
      }
    }
  }
  FUN_1401b2030(param_1 + 0x15e0);
  FUN_1400d1290(uVar5);
  return 0;
}



double FUN_1401759d0(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  longlong lVar3;
  double dVar4;
  double dVar5;
  longlong *local_res8;
  undefined8 uVar6;
  undefined1 uVar7;
  
  uVar6 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))(param_1 + -0x70);
  FUN_1400a1c30(uVar2);
  uVar7 = 1;
  dVar4 = (double)FUN_1400ad790(param_1 + 0x15b0);
  FUN_1401755f0(param_1 + -0x70,&local_res8,param_2,param_4,uVar6,uVar2,uVar7);
  if ((local_res8 == (longlong *)0x0) || (*local_res8 == 0)) {
    dVar4 = dVar4 - *(double *)(param_1 + 0x480);
    if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0))
    {
      puVar1 = (undefined8 *)*local_res8;
      if (puVar1 != (undefined8 *)0x0) {
        (**(code **)*puVar1)(puVar1,1);
      }
      FUN_1400a3530(local_res8);
    }
  }
  else {
    *(undefined1 *)(*local_res8 + 0x21) = 1;
    if (local_res8 == (longlong *)0x0) {
      lVar3 = 0;
    }
    else {
      lVar3 = *local_res8;
    }
    dVar5 = (double)(**(code **)(*(longlong *)(lVar3 + 8) + 0x10))();
    dVar4 = dVar4 - dVar5;
    if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0))
    {
      puVar1 = (undefined8 *)*local_res8;
      if (puVar1 != (undefined8 *)0x0) {
        (**(code **)*puVar1)(puVar1,1);
      }
      FUN_1400a3530(local_res8);
    }
  }
  FUN_1400d1290(uVar2);
  return dVar4;
}



undefined8 FUN_140175b10(longlong *param_1,int param_2,undefined2 *param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  longlong *local_res8;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(uVar2);
  if ((((longlong *)param_1[699] != (longlong *)0x0) && (*(longlong *)param_1[699] != 0)) &&
     ((int)param_1[0x2af] != 0)) {
    FUN_1401755f0(param_1,&local_res8,param_2,param_4,uVar3,uVar2,1);
    if ((local_res8 != (longlong *)0x0) && (*local_res8 != 0)) {
      *param_3 = *(undefined2 *)(*local_res8 + 0x568);
      *(short *)(*local_res8 + 0x568) = *(short *)(*local_res8 + 0x568) + 1;
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
        puVar1 = (undefined8 *)*local_res8;
        if (puVar1 != (undefined8 *)0x0) {
          (**(code **)*puVar1)(puVar1,1);
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar2);
      return 1;
    }
    if ((int)param_1[0x2af] == param_2) {
      *param_3 = (short)param_1[0x9b];
      *(short *)(param_1 + 0x9b) = (short)param_1[0x9b] + 1;
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
        puVar1 = (undefined8 *)*local_res8;
        if (puVar1 != (undefined8 *)0x0) {
          (**(code **)*puVar1)(puVar1,1);
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar2);
      return 1;
    }
    if (param_2 == 1) {
      *param_3 = (short)param_1[0xe0];
      *(short *)(param_1 + 0xe0) = (short)param_1[0xe0] + 1;
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
        puVar1 = (undefined8 *)*local_res8;
        if (puVar1 != (undefined8 *)0x0) {
          (**(code **)*puVar1)(puVar1,1);
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar2);
      return 1;
    }
    if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0))
    {
      puVar1 = (undefined8 *)*local_res8;
      if (puVar1 != (undefined8 *)0x0) {
        (**(code **)*puVar1)(puVar1,1);
      }
      FUN_1400a3530(local_res8);
    }
  }
  FUN_1400d1290(uVar2);
  return 0;
}



void FUN_140175d10(longlong *param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  short *psVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  longlong *local_res8;
  undefined8 uVar4;
  undefined8 uVar5;
  
  uVar4 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(*param_1 + 0x58))();
  uVar5 = uVar3;
  FUN_1400a1c30(uVar3);
  if ((((longlong *)param_1[699] != (longlong *)0x0) && (*(longlong *)param_1[699] != 0)) &&
     ((int)param_1[0x2af] != 0)) {
    FUN_1401755f0(param_1,&local_res8,param_2,param_4,uVar4,uVar5,1);
    if ((local_res8 == (longlong *)0x0) || (*local_res8 == 0)) {
      if ((int)param_1[0x2af] == param_2) {
        *(short *)(param_1 + 0x9b) = (short)param_1[0x9b] + -1;
      }
      else if (param_2 == 1) {
        *(short *)(param_1 + 0xe0) = (short)param_1[0xe0] + -1;
      }
    }
    else {
      psVar1 = (short *)(*local_res8 + 0x568);
      *psVar1 = *psVar1 + -1;
    }
    if ((local_res8 != (longlong *)0x0) &&
       (local_res8[1] = local_res8[1] + -1, uVar3 = uVar5, local_res8[1] == 0)) {
      puVar2 = (undefined8 *)*local_res8;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
        uVar3 = uVar5;
      }
      FUN_1400a3530(local_res8);
    }
  }
  FUN_1400d1290(uVar3);
  return;
}



undefined8 FUN_140175e30(longlong *param_1,int param_2,undefined2 *param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  longlong *local_res8;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(uVar2);
  FUN_1401755f0(param_1,&local_res8,param_2,param_4,uVar3,uVar2,1);
  if ((local_res8 == (longlong *)0x0) || (*local_res8 == 0)) {
    if ((int)param_1[0x2af] == param_2) {
      *param_3 = *(undefined2 *)((longlong)param_1 + 0x4da);
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
        puVar1 = (undefined8 *)*local_res8;
        if (puVar1 != (undefined8 *)0x0) {
          (**(code **)*puVar1)(puVar1,1);
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar2);
      uVar2 = 1;
    }
    else if (param_2 == 1) {
      *param_3 = *(undefined2 *)((longlong)param_1 + 0x702);
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
        puVar1 = (undefined8 *)*local_res8;
        if (puVar1 != (undefined8 *)0x0) {
          (**(code **)*puVar1)(puVar1,1);
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar2);
      uVar2 = 1;
    }
    else {
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
        puVar1 = (undefined8 *)*local_res8;
        if (puVar1 != (undefined8 *)0x0) {
          (**(code **)*puVar1)(puVar1,1);
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar2);
      uVar2 = 0;
    }
  }
  else {
    *param_3 = *(undefined2 *)(*local_res8 + 0x56a);
    local_res8[1] = local_res8[1] + -1;
    if (local_res8[1] == 0) {
      puVar1 = (undefined8 *)*local_res8;
      if (puVar1 != (undefined8 *)0x0) {
        (**(code **)*puVar1)(puVar1,1);
      }
      FUN_1400a3530(local_res8);
    }
    FUN_1400d1290(uVar2);
    uVar2 = 1;
  }
  return uVar2;
}



undefined8 FUN_140175fe0(longlong *param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  short *psVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  longlong *local_res8;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(uVar3);
  FUN_1401755f0(param_1,&local_res8,param_2,param_4,uVar4,uVar3,1);
  if ((local_res8 == (longlong *)0x0) || (*local_res8 == 0)) {
    if ((int)param_1[0x2af] == param_2) {
      *(short *)((longlong)param_1 + 0x4da) = *(short *)((longlong)param_1 + 0x4da) + 1;
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
        puVar2 = (undefined8 *)*local_res8;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar3);
      uVar3 = 1;
    }
    else if (param_2 == 1) {
      *(short *)((longlong)param_1 + 0x702) = *(short *)((longlong)param_1 + 0x702) + 1;
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
        puVar2 = (undefined8 *)*local_res8;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar3);
      uVar3 = 1;
    }
    else {
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
        puVar2 = (undefined8 *)*local_res8;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar3);
      uVar3 = 0;
    }
  }
  else {
    psVar1 = (short *)(*local_res8 + 0x56a);
    *psVar1 = *psVar1 + 1;
    if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0))
    {
      puVar2 = (undefined8 *)*local_res8;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      FUN_1400a3530(local_res8);
    }
    FUN_1400d1290(uVar3);
    uVar3 = 1;
  }
  return uVar3;
}



undefined8 *
FUN_140176180(longlong param_1,undefined8 *param_2,undefined4 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong *local_res8;
  undefined8 uVar5;
  undefined8 uVar6;
  
  uVar5 = 0xfffffffffffffffe;
  plVar3 = (longlong *)(param_1 + -0x70);
  uVar2 = (**(code **)(*plVar3 + 0x58))(plVar3);
  uVar6 = uVar2;
  FUN_1400a1c30(uVar2);
  plVar3 = (longlong *)FUN_1401755f0(plVar3,&local_res8,param_3,param_4,uVar5,uVar6,1);
  lVar4 = 0;
  if ((longlong *)*plVar3 != (longlong *)0x0) {
    lVar4 = *(longlong *)*plVar3;
  }
  if ((local_res8 != (longlong *)0x0) &&
     (local_res8[1] = local_res8[1] + -1, uVar2 = uVar6, local_res8[1] == 0)) {
    puVar1 = (undefined8 *)*local_res8;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
      uVar2 = uVar6;
    }
    FUN_1400a3530(local_res8);
  }
  if (((lVar4 == 0) || (*(longlong **)(lVar4 + 0x18) == (longlong *)0x0)) ||
     (**(longlong **)(lVar4 + 0x18) == 0)) {
    *param_2 = Proud::AddrPort::vftable;
    *(undefined4 *)(param_2 + 1) = DAT_1402f83d0;
    *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1402f83d4;
  }
  else {
    lVar4 = FUN_1401b8a70(lVar4);
    *param_2 = Proud::AddrPort::vftable;
    *(undefined4 *)(param_2 + 1) = *(undefined4 *)(lVar4 + 0x130);
    *(undefined2 *)((longlong)param_2 + 0xc) = *(undefined2 *)(lVar4 + 0x134);
  }
  FUN_1400d1290(uVar2);
  return param_2;
}



undefined8 FUN_1401762a0(longlong param_1,uint param_2,undefined8 param_3)

{
  longlong *plVar1;
  uint uVar2;
  uint *puVar3;
  undefined8 *puVar4;
  ulonglong uVar5;
  undefined8 uVar6;
  longlong lVar7;
  longlong lVar8;
  longlong *local_res8;
  undefined8 uVar9;
  
  uVar9 = 0xfffffffffffffffe;
  uVar6 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))();
  FUN_1400a1c30(uVar6);
  lVar8 = 0;
  local_res8 = (longlong *)0x0;
  uVar2 = *(uint *)(param_1 + 0x1608);
  uVar5 = (ulonglong)param_2 % (ulonglong)uVar2;
  if (*(longlong *)(param_1 + 0x15e8) != 0) {
    puVar3 = *(uint **)(*(longlong *)(param_1 + 0x15e8) + uVar5 * 8);
    while( true ) {
      if ((puVar3 == (uint *)0x0) || ((uint)uVar5 != puVar3[8] % uVar2)) goto LAB_1401763d1;
      if (*puVar3 == param_2) break;
      puVar3 = *(uint **)(puVar3 + 4);
    }
    lVar7 = lVar8;
    if (*(longlong *)(puVar3 + 2) != 0) {
      *(longlong *)(*(longlong *)(puVar3 + 2) + 8) =
           *(longlong *)(*(longlong *)(puVar3 + 2) + 8) + 1;
      local_res8 = *(longlong **)(puVar3 + 2);
      if (local_res8 != (longlong *)0x0) {
        lVar7 = *local_res8;
      }
    }
    if (*(longlong *)(lVar7 + 0x640) != 0) {
      if (local_res8 != (longlong *)0x0) {
        lVar8 = *local_res8;
      }
      FUN_1401bd1d0(*(undefined8 *)(lVar8 + 0x640),param_3,puVar3,(ulonglong)uVar2,uVar9,uVar6,1);
      if (local_res8 != (longlong *)0x0) {
        plVar1 = local_res8 + 1;
        *plVar1 = *plVar1 + -1;
        if (*plVar1 == 0) {
          puVar4 = (undefined8 *)*local_res8;
          if (puVar4 != (undefined8 *)0x0) {
            (**(code **)*puVar4)(puVar4,1);
          }
          FUN_1400a3530(local_res8);
        }
      }
      FUN_1400d1290(uVar6);
      return 1;
    }
  }
LAB_1401763d1:
  if (local_res8 != (longlong *)0x0) {
    plVar1 = local_res8 + 1;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      puVar4 = (undefined8 *)*local_res8;
      if (puVar4 != (undefined8 *)0x0) {
        (**(code **)*puVar4)(puVar4,1);
      }
      FUN_1400a3530(local_res8);
    }
  }
  FUN_1400d1290(uVar6);
  return 0;
}



bool FUN_140176430(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong *local_res8;
  undefined8 uVar5;
  undefined8 uVar6;
  
  uVar5 = 0xfffffffffffffffe;
  plVar3 = (longlong *)(param_1 + -0x70);
  uVar2 = (**(code **)(*plVar3 + 0x58))(plVar3);
  uVar6 = uVar2;
  FUN_1400a1c30(uVar2);
  plVar3 = (longlong *)FUN_1401755f0(plVar3,&local_res8,param_2,param_4,uVar5,uVar6,1);
  lVar4 = 0;
  if ((longlong *)*plVar3 != (longlong *)0x0) {
    lVar4 = *(longlong *)*plVar3;
  }
  if ((local_res8 != (longlong *)0x0) &&
     (local_res8[1] = local_res8[1] + -1, uVar2 = uVar6, local_res8[1] == 0)) {
    puVar1 = (undefined8 *)*local_res8;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
      uVar2 = uVar6;
    }
    FUN_1400a3530(local_res8);
  }
  if (lVar4 == 0) {
    FUN_1400d1290(uVar2);
  }
  else {
    *(undefined1 *)(lVar4 + 0x20) = 1;
    FUN_1400d1290(uVar2);
  }
  return lVar4 != 0;
}



ulonglong FUN_140176500(longlong param_1,int param_2,longlong param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  char cVar2;
  undefined8 uVar3;
  longlong *plVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong *local_res8;
  undefined8 uVar7;
  undefined8 uVar8;
  
  uVar7 = 0xfffffffffffffffe;
  plVar4 = (longlong *)(param_1 + -0x70);
  uVar3 = (**(code **)(*plVar4 + 0x58))(plVar4);
  uVar8 = uVar3;
  FUN_1400a1c30(uVar3);
  if (param_2 != 1) {
    plVar4 = (longlong *)FUN_1401755f0(plVar4,&local_res8,param_2,param_4,uVar7,uVar8,1);
    lVar6 = 0;
    if ((longlong *)*plVar4 != (longlong *)0x0) {
      lVar6 = *(longlong *)*plVar4;
    }
    if ((local_res8 != (longlong *)0x0) &&
       (local_res8[1] = local_res8[1] + -1, uVar3 = uVar8, local_res8[1] == 0)) {
      puVar1 = (undefined8 *)*local_res8;
      if (puVar1 != (undefined8 *)0x0) {
        (**(code **)*puVar1)(puVar1,1);
        uVar3 = uVar8;
      }
      FUN_1400a3530(local_res8);
    }
    if (lVar6 != 0) {
      *(undefined1 *)(lVar6 + 0x21) = 1;
      FUN_1401b8d30(lVar6,param_3);
      cVar2 = FUN_1400a64d0(param_3);
      if (((cVar2 == '\0') || (cVar2 = FUN_1400a64d0(param_3 + 0x10), cVar2 == '\0')) ||
         (cVar2 = FUN_1400a64d0(param_3 + 0x20), cVar2 == '\0')) {
        uVar5 = 0;
      }
      else {
        uVar5 = 1;
      }
      FUN_1400d1290(uVar3);
      return uVar5;
    }
  }
  uVar5 = FUN_1400d1290(uVar3);
  return uVar5 & 0xffffffffffffff00;
}



ulonglong FUN_140176620(longlong param_1,int param_2,longlong param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  char cVar2;
  undefined8 uVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong lVar6;
  ulonglong uVar7;
  longlong lVar8;
  longlong lVar9;
  longlong *local_res8;
  undefined8 uVar10;
  undefined8 uVar11;
  
  uVar10 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))(param_1 + -0x70);
  uVar11 = uVar3;
  FUN_1400a1c30(uVar3);
  if (param_2 != 1) {
    plVar4 = (longlong *)FUN_1401755f0(param_1 + -0x70,&local_res8,param_2,param_4,uVar10,uVar11,1);
    lVar8 = 0;
    lVar9 = lVar8;
    if ((longlong *)*plVar4 != (longlong *)0x0) {
      lVar9 = *(longlong *)*plVar4;
    }
    if ((local_res8 != (longlong *)0x0) &&
       (local_res8[1] = local_res8[1] + -1, uVar3 = uVar11, local_res8[1] == 0)) {
      puVar1 = (undefined8 *)*local_res8;
      if (puVar1 != (undefined8 *)0x0) {
        (**(code **)*puVar1)(puVar1,1);
        uVar3 = uVar11;
      }
      FUN_1400a3530(local_res8);
    }
    if (lVar9 != 0) {
      FUN_1401b8d30(lVar9,param_3);
      cVar2 = FUN_1400a64d0(param_3);
      if (((cVar2 == '\0') || (cVar2 = FUN_1400a64d0(param_3 + 0x10), cVar2 == '\0')) ||
         (cVar2 = FUN_1400a64d0(param_3 + 0x20), cVar2 == '\0')) {
        uVar7 = 0;
      }
      else {
        uVar7 = 1;
      }
      if ((*(longlong **)(lVar9 + 0x18) != (longlong *)0x0) && (**(longlong **)(lVar9 + 0x18) != 0))
      {
        lVar5 = FUN_1401b8a70(lVar9);
        lVar6 = lVar8;
        if (*(longlong **)(lVar5 + 0x100) != (longlong *)0x0) {
          lVar6 = **(longlong **)(lVar5 + 0x100);
        }
        cVar2 = FUN_1400a8b50(lVar6);
        if (cVar2 == '\0') {
          (**(code **)(*(longlong *)(param_1 + 8) + 0x10))();
          lVar6 = FUN_1401b8a70(lVar9);
          if (*(longlong **)(lVar6 + 0x100) != (longlong *)0x0) {
            lVar8 = **(longlong **)(lVar6 + 0x100);
          }
          FUN_1400a88b0(lVar8);
          FUN_1401bac10(lVar9,1,0x1e);
        }
      }
      FUN_1400d1290(uVar3);
      return uVar7;
    }
  }
  uVar7 = FUN_1400d1290(uVar3);
  return uVar7 & 0xffffffffffffff00;
}



undefined8 * FUN_1401767b0(longlong param_1,undefined8 *param_2)

{
  int *piVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined *puVar4;
  undefined *local_res18 [2];
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_30;
  undefined4 local_28;
  undefined1 local_24;
  undefined4 local_20;
  
  local_24 = 0;
  local_28 = 0;
  local_20 = 0;
  local_58 = 0;
  local_50 = 0;
  local_30 = 0;
  local_38 = 0;
  local_40 = 0;
  local_48 = 0;
  plVar2 = (longlong *)(param_1 + 0x70);
  (**(code **)(*plVar2 + 0xc0))(plVar2,&local_58);
  FUN_1400a3440();
  *param_2 = PTR_DAT_1402f8010;
  plVar2 = (longlong *)(**(code **)(*plVar2 + 0xb0))(plVar2,local_res18);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1402f8010;
  }
  FUN_14003c600(param_2,L"TotalSend=%I64d TotalRecv=%I64d PeerCount=%d/%d NAT Name=%s",local_40,
                local_30,local_20,local_28,puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1402f8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_1400a3440();
    FUN_1400a1c30(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_res18[0] + -8);
    }
    FUN_1400d1290(uVar3);
  }
  return param_2;
}



void FUN_1401768e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  longlong *local_res8;
  undefined8 uVar4;
  undefined8 uVar5;
  
  uVar4 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(*param_1 + 0x58))();
  uVar5 = uVar3;
  FUN_1400a1c30(uVar3);
  FUN_1401755f0(param_1,&local_res8,param_2,param_4,uVar4,uVar5,1);
  if (local_res8 != (longlong *)0x0) {
    if (*local_res8 != 0) {
      piVar1 = (int *)(*local_res8 + 0x680);
      *piVar1 = *piVar1 + -1;
    }
    if ((local_res8 != (longlong *)0x0) &&
       (local_res8[1] = local_res8[1] + -1, uVar3 = uVar5, local_res8[1] == 0)) {
      puVar2 = (undefined8 *)*local_res8;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
        uVar3 = uVar5;
      }
      FUN_1400a3530(local_res8);
    }
  }
  FUN_1400d1290(uVar3);
  return;
}



undefined4 FUN_1401769a0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  longlong *local_res8;
  undefined8 uVar4;
  undefined8 uVar5;
  
  uVar4 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))(param_1 + -0x70);
  uVar5 = uVar3;
  FUN_1400a1c30(uVar3);
  if (param_2 == 1) {
    *(undefined8 *)(param_1 + 0x14f8) = param_3;
    FUN_1400d1290(uVar3);
    uVar2 = 1;
  }
  else if (param_2 == *(int *)(param_1 + 0x1508)) {
    *(undefined8 *)(param_1 + 0x17f8) = param_3;
    FUN_1400d1290(uVar3);
    uVar2 = 1;
  }
  else {
    FUN_1401755f0(param_1 + -0x70,&local_res8,param_2,param_4,uVar4,uVar5,1);
    if ((local_res8 == (longlong *)0x0) || (*local_res8 == 0)) {
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, uVar3 = uVar5, local_res8[1] == 0)) {
        puVar1 = (undefined8 *)*local_res8;
        if (puVar1 != (undefined8 *)0x0) {
          (**(code **)*puVar1)(puVar1,1);
          uVar3 = uVar5;
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar3);
      uVar2 = 0;
    }
    else {
      *(undefined8 *)(*local_res8 + 0x678) = param_3;
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, uVar3 = uVar5, local_res8[1] == 0)) {
        puVar1 = (undefined8 *)*local_res8;
        if (puVar1 != (undefined8 *)0x0) {
          (**(code **)*puVar1)(puVar1,1);
          uVar3 = uVar5;
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar3);
      uVar2 = 1;
    }
  }
  return uVar2;
}



longlong FUN_140176af0(longlong *param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong *local_res8;
  undefined8 uVar4;
  undefined8 uVar5;
  
  uVar4 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(*param_1 + 0x58))();
  uVar5 = uVar2;
  FUN_1400a1c30(uVar2);
  if (param_2 == 1) {
    lVar3 = param_1[0x2ad];
    FUN_1400d1290(uVar2);
  }
  else if (param_2 == (int)param_1[0x2af]) {
    lVar3 = param_1[0x30d];
    FUN_1400d1290(uVar2);
  }
  else {
    FUN_1401755f0(param_1,&local_res8,param_2,param_4,uVar4,uVar5,1);
    if ((local_res8 == (longlong *)0x0) || (*local_res8 == 0)) {
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, uVar2 = uVar5, local_res8[1] == 0)) {
        puVar1 = (undefined8 *)*local_res8;
        if (puVar1 != (undefined8 *)0x0) {
          (**(code **)*puVar1)(puVar1,1);
          uVar2 = uVar5;
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar2);
      lVar3 = 0;
    }
    else {
      lVar3 = *(longlong *)(*local_res8 + 0x678);
      local_res8[1] = local_res8[1] + -1;
      if (local_res8[1] == 0) {
        puVar1 = (undefined8 *)*local_res8;
        if (puVar1 != (undefined8 *)0x0) {
          (**(code **)*puVar1)(puVar1,1);
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar5);
    }
  }
  return lVar3;
}



undefined8 FUN_140176c30(longlong param_1,uint *param_2,undefined8 *param_3)

{
  uint *puVar1;
  ulonglong uVar2;
  undefined8 *puVar3;
  
  uVar2 = (ulonglong)*param_2 % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (puVar1 != (uint *)0x0 && ((uint)uVar2 == puVar1[8] % *(uint *)(param_1 + 0x28)));
        puVar1 = *(uint **)(puVar1 + 4)) {
      if (*puVar1 == *param_2) {
        return 0;
      }
    }
  }
  puVar3 = (undefined8 *)FUN_140174ff0(param_1,param_2);
  *puVar3 = *param_3;
  return 1;
}



void FUN_140176cc0(longlong *param_1)

{
  undefined8 *puVar1;
  void *pvVar2;
  undefined8 *puVar3;
  
  if ((*param_1 != 0) &&
     (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
     *(longlong *)(*param_1 + 8) == 0)) {
    puVar1 = (undefined8 *)*param_1;
    pvVar2 = (void *)*puVar1;
    if (pvVar2 != (void *)0x0) {
      puVar3 = *(undefined8 **)((longlong)pvVar2 + 0x10);
      if (puVar3 != (undefined8 *)0x0) {
        (**(code **)*puVar3)(puVar3,1);
      }
      operator_delete(pvVar2);
    }
    FUN_1400a3530(puVar1);
  }
  return;
}



undefined8 * FUN_140176d30(longlong *param_1,undefined8 *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  longlong *plVar3;
  
  plVar1 = (longlong *)param_1[1];
  if (plVar1 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  FUN_1400a3440();
  *param_2 = PTR_DAT_1402f8010;
  FUN_140003100(param_2,plVar1 + 2);
  *(int *)(param_2 + 1) = (int)plVar1[3];
  param_2[2] = plVar1[4];
  lVar2 = *plVar1;
  param_1[1] = lVar2;
  if (lVar2 == 0) {
    param_1[2] = 0;
  }
  else {
    *(undefined8 *)(lVar2 + 8) = 0;
  }
  FUN_1400031d0(plVar1 + 2);
  plVar3 = (longlong *)*param_1;
  if (plVar3 == (longlong *)0x0) {
    FUN_1400a3530(plVar1);
  }
  else {
    (**(code **)(*plVar3 + 0x10))(plVar3,plVar1);
  }
  param_1[3] = param_1[3] + -1;
  return param_2;
}



void FUN_140176e00(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  void *pvVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  
  lVar1 = *param_2;
  if (lVar1 != *param_1) {
    if (lVar1 != 0) {
      *(longlong *)(*param_2 + 8) = *(longlong *)(lVar1 + 8) + 1;
    }
    puVar4 = (undefined8 *)0x0;
    if ((*param_1 != 0) &&
       (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
       *(longlong *)(*param_1 + 8) == 0)) {
      puVar4 = (undefined8 *)*param_1;
    }
    *param_1 = *param_2;
    if (puVar4 != (undefined8 *)0x0) {
      pvVar2 = (void *)*puVar4;
      if (pvVar2 != (void *)0x0) {
        puVar3 = *(undefined8 **)((longlong)pvVar2 + 0x10);
        if (puVar3 != (undefined8 *)0x0) {
          (**(code **)*puVar3)(puVar3,1);
        }
        operator_delete(pvVar2);
      }
      FUN_1400a3530(puVar4);
    }
  }
  return;
}



void FUN_140176ea0(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined8 *puVar4;
  
  lVar1 = param_1[3];
  while( true ) {
    if (lVar1 == 0) {
      param_1[1] = 0;
      param_1[2] = 0;
      return;
    }
    plVar2 = (longlong *)param_1[1];
    if (plVar2 == (longlong *)0x0) break;
    param_1[1] = *plVar2;
    if ((plVar2[2] != 0) &&
       (*(longlong *)(plVar2[2] + 8) = *(longlong *)(plVar2[2] + 8) + -1,
       *(longlong *)(plVar2[2] + 8) == 0)) {
      plVar3 = (longlong *)plVar2[2];
      puVar4 = (undefined8 *)*plVar3;
      if (puVar4 != (undefined8 *)0x0) {
        (**(code **)*puVar4)(puVar4,1);
      }
      FUN_1400a3530(plVar3);
    }
    plVar3 = (longlong *)*param_1;
    if (plVar3 == (longlong *)0x0) {
      FUN_1400a3530(plVar2);
    }
    else {
      (**(code **)(*plVar3 + 0x10))(plVar3,plVar2);
    }
    param_1[3] = param_1[3] + -1;
    lVar1 = param_1[3];
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



longlong FUN_140176f70(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  
  if (param_2 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  lVar1 = *param_2;
  if (param_2 == *(longlong **)(param_1 + 8)) {
    *(longlong *)(param_1 + 8) = lVar1;
  }
  else {
    *(longlong *)param_2[1] = lVar1;
  }
  if (param_2 == *(longlong **)(param_1 + 0x10)) {
    *(longlong *)(param_1 + 0x10) = param_2[1];
  }
  else {
    *(longlong *)(*param_2 + 8) = param_2[1];
  }
  FUN_140175060(param_1,param_2);
  return lVar1;
}



undefined8 *
FUN_140176fe0(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  
  plVar1 = (longlong *)*param_1;
  if (plVar1 == (longlong *)0x0) {
    puVar2 = (undefined8 *)FUN_1400a34c0(0x18);
  }
  else {
    puVar2 = (undefined8 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x18,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar2 != (undefined8 *)0x0) {
    puVar2[2] = 0;
    FUN_14016b650(puVar2 + 2,param_2);
  }
  puVar2[1] = param_3;
  *puVar2 = param_4;
  param_1[3] = param_1[3] + 1;
  return puVar2;
}



void FUN_140177070(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  
  lVar1 = param_1[3];
  while( true ) {
    if (lVar1 == 0) {
      param_1[1] = 0;
      param_1[2] = 0;
      return;
    }
    plVar2 = (longlong *)param_1[1];
    if (plVar2 == (longlong *)0x0) break;
    param_1[1] = *plVar2;
    FUN_14019a730(plVar2 + 3);
    if (plVar2[4] != 0) {
      if (*(int *)((longlong)plVar2 + 0x2c) < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      *(undefined4 *)(plVar2 + 5) = 0;
    }
    plVar3 = (longlong *)*param_1;
    if (plVar3 == (longlong *)0x0) {
      FUN_1400a3530(plVar2);
    }
    else {
      (**(code **)(*plVar3 + 0x10))(plVar3,plVar2);
    }
    param_1[3] = param_1[3] + -1;
    lVar1 = param_1[3];
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



void FUN_140177110(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  
  lVar1 = param_1[3];
  while( true ) {
    if (lVar1 == 0) {
      param_1[1] = 0;
      param_1[2] = 0;
      return;
    }
    plVar2 = (longlong *)param_1[1];
    if (plVar2 == (longlong *)0x0) break;
    param_1[1] = *plVar2;
    FUN_1400031d0(plVar2 + 2);
    plVar3 = (longlong *)*param_1;
    if (plVar3 == (longlong *)0x0) {
      FUN_1400a3530(plVar2);
    }
    else {
      (**(code **)(*plVar3 + 0x10))(plVar3,plVar2);
    }
    param_1[3] = param_1[3] + -1;
    lVar1 = param_1[3];
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



void FUN_140177190(longlong param_1,longlong param_2,char param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  undefined4 uVar3;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if ((*(longlong *)(param_2 + 8) != 0) &&
     (*(longlong *)(*(longlong *)(param_2 + 8) + 8) =
           *(longlong *)(*(longlong *)(param_2 + 8) + 8) + -1,
     *(longlong *)(*(longlong *)(param_2 + 8) + 8) == 0)) {
    plVar1 = *(longlong **)(param_2 + 8);
    puVar2 = (undefined8 *)*plVar1;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    FUN_1400a3530(plVar1);
  }
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    FUN_1400a3530(param_2);
  }
  else {
    (**(code **)(*plVar1 + 0x18))(plVar1,param_2);
  }
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
  if (((param_3 != '\0') && (*(ulonglong *)(param_1 + 0x20) < *(ulonglong *)(param_1 + 0x40))) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_140142850(param_1);
    FUN_1401b2490(param_1,uVar3);
  }
  return;
}



void FUN_140177260(longlong param_1,longlong param_2,undefined1 param_3)

{
  uint uVar1;
  ulonglong uVar2;
  uint uVar3;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  uVar1 = *(uint *)(param_1 + 0x28);
  uVar2 = (ulonglong)*(uint *)(param_2 + 0x20) % (ulonglong)uVar1;
  if (*(longlong *)(param_1 + 0x20) == 1) {
    *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    *(undefined8 *)(param_1 + 0x10) = 0;
    *(undefined8 *)(param_1 + 0x18) = 0;
  }
  else {
    uVar3 = (uint)uVar2;
    if (((*(longlong *)(param_2 + 0x18) == 0) ||
        (*(uint *)(*(longlong *)(param_2 + 0x18) + 0x20) % uVar1 != uVar3)) &&
       ((*(longlong *)(param_2 + 0x10) == 0 ||
        (*(uint *)(*(longlong *)(param_2 + 0x10) + 0x20) % uVar1 != uVar3)))) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    }
    else if (param_2 == *(longlong *)(*(longlong *)(param_1 + 8) + (longlong)(int)uVar3 * 8)) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = *(undefined8 *)(param_2 + 0x10);
    }
    if (param_2 == *(longlong *)(param_1 + 0x10)) {
      *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(param_2 + 0x10);
      *(undefined8 *)(param_2 + 0x18) = 0;
    }
    if (param_2 == *(longlong *)(param_1 + 0x18)) {
      *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
      *(undefined8 *)(param_2 + 0x10) = 0;
    }
    if (*(longlong *)(param_2 + 0x18) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x18) + 0x10) = *(undefined8 *)(param_2 + 0x10);
    }
    if (*(longlong *)(param_2 + 0x10) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x10) + 0x18) = *(undefined8 *)(param_2 + 0x18);
    }
  }
  FUN_140177190(param_1,param_2,param_3);
  FUN_1401b2030(param_1);
  return;
}



undefined2 * FUN_140177360(longlong param_1,undefined2 *param_2,uint param_3,undefined4 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined4 uVar3;
  undefined2 *puVar4;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    puVar4 = (undefined2 *)FUN_1400a34c0(0x28);
  }
  else {
    puVar4 = (undefined2 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x28,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar4 != (undefined2 *)0x0) {
    *puVar4 = *param_2;
    *(undefined8 *)(puVar4 + 4) = 0;
    *(undefined4 *)(puVar4 + 0x10) = param_4;
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8);
  FUN_1401b2030(param_1);
  if (*(longlong *)(param_1 + 0x20) == 0) {
    *(undefined2 **)(param_1 + 0x10) = puVar4;
    *(undefined2 **)(param_1 + 0x18) = puVar4;
    *(undefined8 *)(puVar4 + 0xc) = 0;
    *(undefined8 *)(puVar4 + 8) = 0;
  }
  else {
    FUN_1401b2030(param_1);
    FUN_1401b2030(param_1);
    if (lVar2 == 0) {
      lVar2 = *(longlong *)(param_1 + 0x10);
      *(undefined8 *)(puVar4 + 0xc) = 0;
      *(longlong *)(puVar4 + 8) = lVar2;
      if (lVar2 != 0) {
        *(undefined2 **)(lVar2 + 0x18) = puVar4;
      }
      *(undefined2 **)(param_1 + 0x10) = puVar4;
    }
    else {
      if (*(longlong *)(lVar2 + 0x18) == 0) {
        *(undefined2 **)(param_1 + 0x10) = puVar4;
      }
      else {
        *(undefined2 **)(*(longlong *)(lVar2 + 0x18) + 0x10) = puVar4;
      }
      *(undefined8 *)(puVar4 + 0xc) = *(undefined8 *)(lVar2 + 0x18);
      *(longlong *)(puVar4 + 8) = lVar2;
      *(undefined2 **)(lVar2 + 0x18) = puVar4;
    }
  }
  *(undefined2 **)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8) = puVar4;
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  FUN_1401b2030(param_1);
  FUN_1401b2030(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_140142850(param_1);
    FUN_1401b2490(param_1,uVar3);
  }
  FUN_1401b2030(param_1);
  return puVar4;
}



undefined8
FUN_1401774b0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
             longlong param_5,longlong param_6)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  longlong *plVar3;
  void *pvVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  longlong *local_res8;
  
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar2);
  plVar3 = (longlong *)FUN_1401755f0(*(undefined8 *)(param_1 + 0x20),&local_res8,*param_4);
  lVar7 = 0;
  lVar6 = lVar7;
  if ((longlong *)*plVar3 != (longlong *)0x0) {
    lVar6 = *(longlong *)*plVar3;
  }
  if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
    puVar1 = (undefined8 *)*local_res8;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    FUN_1400a3530(local_res8);
  }
  if ((((lVar6 != 0) && (*(char *)(lVar6 + 0x684) == '\0')) &&
      (*(longlong **)(lVar6 + 0x28) != (longlong *)0x0)) && (**(longlong **)(lVar6 + 0x28) != 0)) {
    *(undefined4 *)(lVar6 + 0x578) = *(undefined4 *)(param_6 + 8);
    *(undefined2 *)(lVar6 + 0x57c) = *(undefined2 *)(param_6 + 0xc);
    *(undefined4 *)(lVar6 + 0x588) = *(undefined4 *)(param_5 + 8);
    *(undefined2 *)(lVar6 + 0x58c) = *(undefined2 *)(param_5 + 0xc);
    plVar3 = *(longlong **)(lVar6 + 0x28);
    lVar5 = lVar7;
    if (plVar3 != (longlong *)0x0) {
      lVar5 = *plVar3;
    }
    if (*(longlong *)(lVar5 + 0x10) != 0) {
      lVar5 = lVar7;
      if (plVar3 != (longlong *)0x0) {
        lVar5 = *plVar3;
      }
      if (*(int *)(*(longlong *)(lVar5 + 0x10) + 8) == 1) goto LAB_140177651;
    }
    lVar5 = lVar7;
    if (plVar3 != (longlong *)0x0) {
      lVar5 = *plVar3;
    }
    puVar1 = *(undefined8 **)(lVar5 + 0x10);
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    *(undefined8 *)(lVar5 + 0x10) = 0;
    pvVar4 = operator_new(0x38);
    lVar5 = lVar7;
    if (pvVar4 != (void *)0x0) {
      lVar5 = FUN_140169780(pvVar4);
    }
    *(undefined2 *)(lVar5 + 0x34) = *(undefined2 *)(param_6 + 0xc);
    if (*(longlong **)(lVar6 + 0x28) != (longlong *)0x0) {
      lVar7 = **(longlong **)(lVar6 + 0x28);
    }
    *(longlong *)(lVar7 + 0x10) = lVar5;
  }
LAB_140177651:
  FUN_1400d1290(uVar2);
  return 1;
}



undefined8
FUN_140177670(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong *local_res8;
  
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar2);
  plVar3 = (longlong *)FUN_1401755f0(*(undefined8 *)(param_1 + 0x20),&local_res8,*param_4);
  lVar4 = 0;
  if ((longlong *)*plVar3 != (longlong *)0x0) {
    lVar4 = *(longlong *)*plVar3;
  }
  if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
    puVar1 = (undefined8 *)*local_res8;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    FUN_1400a3530(local_res8);
  }
  if (((lVar4 != 0) && (*(char *)(lVar4 + 0x684) == '\0')) && (*(char *)(lVar4 + 0x608) == '\0')) {
    FUN_1401bac10(lVar4,0,*param_5);
  }
  FUN_1400d1290(uVar2);
  return 1;
}



undefined8 FUN_140177750(longlong param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong *local_res8;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined1 uVar7;
  
  uVar5 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  uVar6 = uVar2;
  FUN_1400a1c30(uVar2);
  uVar7 = 1;
  plVar3 = (longlong *)FUN_1401755f0(*(undefined8 *)(param_1 + 0x20),&local_res8,param_2);
  lVar4 = 0;
  if ((longlong *)*plVar3 != (longlong *)0x0) {
    lVar4 = *(longlong *)*plVar3;
  }
  if ((local_res8 != (longlong *)0x0) &&
     (local_res8[1] = local_res8[1] + -1, uVar2 = uVar6, local_res8[1] == 0)) {
    puVar1 = (undefined8 *)*local_res8;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
      uVar2 = uVar6;
    }
    FUN_1400a3530(local_res8);
    uVar6 = uVar2;
  }
  if ((lVar4 != 0) && (*(char *)(lVar4 + 0x684) == '\0')) {
    *(undefined4 *)(lVar4 + 0x44) = *param_4;
    plVar3 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x1818);
    (**(code **)(*plVar3 + 0x140))
              (plVar3,1,&DAT_140318cf0,lVar4 + 0x56c,lVar4 + 0x40,(undefined4 *)(lVar4 + 0x44),uVar5
               ,uVar6,uVar7);
  }
  FUN_1400d1290(uVar2);
  return 1;
}



undefined8
FUN_140177860(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             float *param_5)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  longlong *plVar3;
  longlong lVar4;
  float local_res8 [2];
  longlong *local_48;
  double local_40;
  undefined8 local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined1 local_20;
  
  local_30 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  local_28 = uVar2;
  FUN_1400a1c30(uVar2);
  local_20 = 1;
  plVar3 = (longlong *)FUN_1401755f0(*(undefined8 *)(param_1 + 0x20),&local_48,param_2);
  lVar4 = 0;
  if ((longlong *)*plVar3 != (longlong *)0x0) {
    lVar4 = *(longlong *)*plVar3;
  }
  if ((local_48 != (longlong *)0x0) &&
     (local_48[1] = local_48[1] + -1, uVar2 = local_28, local_48[1] == 0)) {
    puVar1 = (undefined8 *)*local_48;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    FUN_1400a3530(local_48);
    uVar2 = local_28;
  }
  if ((lVar4 != 0) && (*(char *)(lVar4 + 0x684) == '\0')) {
    *(double *)(lVar4 + 0x160) = (double)*param_5;
    local_40 = 0.0;
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0xd8))(*(longlong **)(param_1 + 0x20),&local_40);
    local_res8[0] = (float)local_40;
    local_38 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x70) + 0xf8))();
    plVar3 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x17d0);
    (**(code **)(*plVar3 + 0x60))
              (plVar3,param_2,&DAT_140318cf0,param_4,&local_38,*(longlong *)(param_1 + 0x20) + 0x4f8
               ,local_res8);
  }
  FUN_1400d1290(uVar2);
  return 1;
}



undefined8
FUN_1401779d0(longlong param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4,
             double *param_5,double *param_6,float *param_7)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  longlong *plVar3;
  longlong lVar4;
  double dVar5;
  longlong *local_res8;
  
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))
                    (*(longlong **)(param_1 + 0x20),param_2,param_3,param_4,0xfffffffffffffffe);
  FUN_1400a1c30(uVar2);
  plVar3 = (longlong *)
           FUN_1401755f0(*(undefined8 *)(param_1 + 0x20),&local_res8,param_2 & 0xffffffff);
  lVar4 = 0;
  if ((longlong *)*plVar3 != (longlong *)0x0) {
    lVar4 = *(longlong *)*plVar3;
  }
  if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
    puVar1 = (undefined8 *)*local_res8;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    FUN_1400a3530(local_res8);
  }
  if ((lVar4 != 0) && (*(char *)(lVar4 + 0x684) == '\0')) {
    dVar5 = *param_6;
    if (dVar5 <= 0.0) {
      dVar5 = 0.0;
    }
    *(double *)(lVar4 + 0x60) = dVar5;
    *(double *)(lVar4 + 0x160) = (double)*param_7;
    dVar5 = (double)FUN_1400ad790(*(longlong *)(param_1 + 0x20) + 0x1620);
    *(double *)(lVar4 + 0x150) = dVar5 - (*(double *)(lVar4 + 0x50) + *param_5);
  }
  FUN_1400d1290(uVar2);
  return 1;
}



undefined ** FUN_140177af0(longlong *param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  undefined **ppuVar3;
  longlong *local_res8;
  undefined8 uVar4;
  undefined8 uVar5;
  
  uVar4 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(*param_1 + 0x58))();
  uVar5 = uVar2;
  FUN_1400a1c30(uVar2);
  if (param_2 == 1) {
    FUN_1400d1290(uVar2);
    ppuVar3 = (undefined **)(param_1 + 0x2aa);
  }
  else if (param_2 == 0) {
    FUN_1400d1290(uVar2);
    ppuVar3 = &PTR_vftable_14030c770;
  }
  else if (param_2 == (int)param_1[0x2af]) {
    FUN_1400d1290(uVar2);
    ppuVar3 = (undefined **)(param_1 + 0xc);
  }
  else {
    FUN_1401755f0(param_1,&local_res8,param_2,param_4,uVar4,uVar5,1);
    if (((local_res8 == (longlong *)0x0) ||
        (ppuVar3 = (undefined **)*local_res8, ppuVar3 == (undefined **)0x0)) ||
       (*(char *)((longlong)ppuVar3 + 0x684) != '\0')) {
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, uVar2 = uVar5, local_res8[1] == 0)) {
        puVar1 = (undefined8 *)*local_res8;
        if (puVar1 != (undefined8 *)0x0) {
          (**(code **)*puVar1)(puVar1,1);
          uVar2 = uVar5;
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar2);
      ppuVar3 = (undefined **)0x0;
    }
    else {
      local_res8[1] = local_res8[1] + -1;
      if (local_res8[1] == 0) {
        puVar1 = (undefined8 *)*local_res8;
        if (puVar1 != (undefined8 *)0x0) {
          (**(code **)*puVar1)(puVar1,1);
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar5);
    }
  }
  return ppuVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140177c40(longlong param_1,undefined4 param_2,wchar_t *param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  int iVar3;
  int *piVar4;
  undefined8 *puVar5;
  undefined8 uVar6;
  __time64_t _Var7;
  undefined *puVar8;
  undefined *puVar9;
  int *piVar10;
  int iVar11;
  undefined *puVar12;
  int iVar13;
  undefined8 local_res20;
  undefined1 auStack_918 [32];
  int **local_8f8;
  int *local_8e8;
  undefined4 local_8e0;
  undefined4 local_8dc;
  undefined *local_8d8;
  undefined1 local_8d0;
  undefined8 local_8c0;
  undefined1 local_8b8;
  undefined8 *local_8b0;
  undefined8 *local_8a8;
  undefined1 local_8a0;
  int *local_898;
  undefined4 local_890;
  __time64_t local_888;
  undefined8 local_880;
  wchar_t local_878 [1040];
  ulonglong local_58;
  
  local_880 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_918;
  local_res20 = param_4;
  local_8e0 = param_2;
  FUN_1400a3440();
  local_8e8 = (int *)PTR_DAT_1402f8010;
  if (param_3 == (wchar_t *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80070057);
  }
  iVar2 = vswprintf_s(local_878,0x400,param_3,(va_list)&local_res20);
  iVar13 = 0;
  iVar11 = 0;
  if ((local_8e8 != (int *)0x0) && (iVar11 = 0, local_8e8 != (int *)PTR_DAT_1402f8010)) {
    iVar11 = local_8e8[-2];
  }
  iVar3 = iVar2;
  if (((iVar2 <= iVar11) && (iVar3 = iVar13, local_8e8 != (int *)0x0)) &&
     (local_8e8 != (int *)PTR_DAT_1402f8010)) {
    iVar3 = local_8e8[-2];
  }
  iVar11 = 1;
  if (1 < iVar3) {
    iVar11 = iVar3;
  }
  iVar3 = iVar13;
  if ((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1402f8010)) {
    iVar3 = local_8e8[-2];
  }
  if (iVar3 < iVar11) {
    if (local_8e8 == (int *)0x0) {
      local_8e8 = (int *)PTR_DAT_1402f8010;
    }
    if (iVar11 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (iVar11 == 0) {
      FUN_1400031d0(&local_8e8);
    }
    else {
      iVar3 = iVar13;
      if ((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1402f8010)) {
        iVar3 = local_8e8[-2];
      }
      if (iVar11 != iVar3) {
        piVar4 = (int *)FUN_1400a34c0((longlong)iVar11 * 2 + 10);
        if (piVar4 != (int *)0x0) {
          *piVar4 = 0;
          piVar4[1] = 1;
        }
        *piVar4 = iVar11;
        iVar3 = iVar13;
        if ((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1402f8010)) {
          iVar3 = local_8e8[-2];
        }
        piVar10 = (int *)PTR_DAT_1402f8010;
        if (iVar11 < iVar3) {
LAB_140177da6:
          if (local_8e8 != (int *)0x0) {
            piVar10 = local_8e8;
          }
        }
        else {
          iVar11 = iVar13;
          if (local_8e8 != (int *)0x0) {
            if (local_8e8 != (int *)PTR_DAT_1402f8010) {
              iVar11 = local_8e8[-2];
            }
            goto LAB_140177da6;
          }
        }
        FUN_1400a32f0(piVar4 + 2,piVar10,iVar11);
        FUN_1400031d0(&local_8e8);
        local_8e8 = piVar4 + 2;
      }
    }
  }
  FUN_140002e30(&local_8e8);
  piVar4 = local_8e8;
  if (local_8e8 == (int *)0x0) {
    piVar4 = (int *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(piVar4,local_878,iVar2);
  piVar4 = local_8e8;
  if (local_8e8 == (int *)0x0) {
    piVar4 = (int *)PTR_DAT_1402f8010;
  }
  iVar2 = FUN_1400a32c0(piVar4);
  iVar11 = 0;
  if (0 < iVar2) {
    iVar11 = iVar2;
  }
  iVar2 = iVar13;
  if ((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1402f8010)) {
    iVar2 = local_8e8[-2];
  }
  if ((iVar2 <= iVar11) && (iVar11 = iVar13, local_8e8 != (int *)0x0)) {
    if (local_8e8 == (int *)PTR_DAT_1402f8010) goto LAB_140177e68;
    iVar11 = local_8e8[-2];
  }
  if (((local_8e8 != (int *)PTR_DAT_1402f8010) && (local_8e8 != (int *)0x0)) &&
     (local_8e8 + -2 != (int *)0x0)) {
    local_8e8[-2] = iVar11;
    *(undefined2 *)((longlong)local_8e8 + (longlong)iVar11 * 2) = 0;
  }
LAB_140177e68:
  if (*(char *)(param_1 + 0x1790) != '\0') {
    local_8f8 = &local_8e8;
    (**(code **)(*(longlong *)(param_1 + 0x1818) + 0xa0))
              ((longlong *)(param_1 + 0x1818),1,&DAT_140318cf0,&local_8e0);
  }
  if (*(int *)(param_1 + 0x6c8) != 0) {
    (**(code **)(*(longlong *)(param_1 + 0x78) + 0x10))();
    FUN_1400a3440();
    puVar8 = PTR_DAT_1402f8010;
    local_8dc = local_8e0;
    local_890 = local_8e0;
    local_898 = (int *)PTR_DAT_1402f8010;
    piVar4 = (int *)PTR_DAT_1402f8010;
    if (local_8e8 != (int *)PTR_DAT_1402f8010) {
      puVar5 = (undefined8 *)FUN_1400a3440();
      local_8a8 = puVar5;
      FUN_1400a1c30(puVar5);
      local_8a0 = 1;
      if (((puVar8 != (undefined *)0x0) && (puVar8 != PTR_DAT_1402f8010)) &&
         (puVar8 + -8 != (undefined *)0x0)) {
        uVar6 = FUN_1400a3440();
        local_8c0 = uVar6;
        FUN_1400a1c30(uVar6);
        local_8b8 = 1;
        piVar4 = (int *)(puVar8 + -4);
        *piVar4 = *piVar4 + -1;
        if (*piVar4 == 0) {
          FUN_1400a3530(puVar8 + -8);
        }
        FUN_1400d1290(uVar6);
      }
      piVar4 = local_8e8;
      local_898 = local_8e8;
      if (((local_8e8 != (int *)PTR_DAT_1402f8010) && (local_8e8 != (int *)0x0)) &&
         (local_8e8 != (int *)0x8)) {
        local_8e8[-1] = local_8e8[-1] + 1;
      }
      FUN_1400d1290(puVar5);
    }
    _Var7 = _time64((__time64_t *)0x0);
    uVar6 = *(undefined8 *)(param_1 + 0x17c0);
    plVar1 = *(longlong **)(param_1 + 0x17b0);
    local_8c0 = uVar6;
    local_888 = _Var7;
    if (plVar1 == (longlong *)0x0) {
      puVar5 = (undefined8 *)FUN_1400a34c0(0x28);
    }
    else {
      puVar5 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,0x28);
    }
    local_8b0 = puVar5;
    local_8a8 = puVar5;
    if (puVar5 != (undefined8 *)0x0) {
      FUN_1400a3440();
      puVar8 = PTR_DAT_1402f8010;
      puVar5[2] = PTR_DAT_1402f8010;
      if (puVar8 == (undefined *)0x0) {
        puVar5[2] = PTR_DAT_1402f8010;
      }
      if (piVar4 != (int *)puVar5[2]) {
        puVar8 = (undefined *)FUN_1400a3440();
        local_8d8 = puVar8;
        FUN_1400a1c30(puVar8);
        local_8d0 = 1;
        FUN_1400031d0(puVar5 + 2);
        puVar5[2] = piVar4;
        if (((piVar4 != (int *)PTR_DAT_1402f8010) && (piVar4 != (int *)0x0)) &&
           (piVar4 != (int *)0x8)) {
          piVar4[-1] = piVar4[-1] + 1;
        }
        FUN_1400d1290(puVar8);
        uVar6 = local_8c0;
      }
      *(undefined4 *)(puVar5 + 3) = local_8dc;
      puVar5[4] = _Var7;
    }
    puVar5[1] = uVar6;
    *puVar5 = 0;
    *(longlong *)(param_1 + 0x17c8) = *(longlong *)(param_1 + 0x17c8) + 1;
    if (*(undefined8 **)(param_1 + 0x17c0) == (undefined8 *)0x0) {
      *(undefined8 **)(param_1 + 0x17b8) = puVar5;
    }
    else {
      **(undefined8 **)(param_1 + 0x17c0) = puVar5;
    }
    *(undefined8 **)(param_1 + 0x17c0) = puVar5;
    if ((((ulonglong)*(uint *)(param_1 + 0x6c8) < *(ulonglong *)(param_1 + 0x17c8)) &&
        (FUN_140176d30(param_1 + 0x17b0,&local_8d8), puVar8 = local_8d8,
        local_8d8 != (undefined *)0x0)) &&
       ((local_8d8 != PTR_DAT_1402f8010 && (puVar12 = local_8d8 + -8, puVar12 != (undefined *)0x0)))
       ) {
      puVar9 = (undefined *)FUN_1400a3440();
      local_8d8 = puVar9;
      FUN_1400a1c30(puVar9);
      local_8d0 = 1;
      piVar10 = (int *)(puVar8 + -4);
      *piVar10 = *piVar10 + -1;
      if (*piVar10 == 0) {
        FUN_1400a3530(puVar12);
      }
      FUN_1400d1290(puVar9);
    }
    if (((piVar4 != (int *)0x0) && (piVar4 != (int *)PTR_DAT_1402f8010)) &&
       (piVar4 + -2 != (int *)0x0)) {
      puVar8 = (undefined *)FUN_1400a3440();
      local_8d8 = puVar8;
      FUN_1400a1c30(puVar8);
      local_8d0 = 1;
      piVar10 = piVar4 + -1;
      *piVar10 = *piVar10 + -1;
      if (*piVar10 == 0) {
        FUN_1400a3530(piVar4 + -2);
      }
      FUN_1400d1290(puVar8);
    }
  }
  piVar4 = local_8e8;
  if (((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1402f8010)) &&
     (piVar10 = local_8e8 + -2, piVar10 != (int *)0x0)) {
    puVar8 = (undefined *)FUN_1400a3440();
    local_8d8 = puVar8;
    FUN_1400a1c30(puVar8);
    local_8d0 = 1;
    piVar4 = piVar4 + -1;
    *piVar4 = *piVar4 + -1;
    if (*piVar4 == 0) {
      FUN_1400a3530(piVar10);
    }
    FUN_1400d1290(puVar8);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140178190(longlong param_1,undefined4 param_2,wchar_t *param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  int iVar3;
  int *piVar4;
  undefined8 *puVar5;
  undefined8 uVar6;
  __time64_t _Var7;
  undefined *puVar8;
  undefined *puVar9;
  int *piVar10;
  int iVar11;
  undefined *puVar12;
  int iVar13;
  undefined8 local_res20;
  undefined1 auStack_918 [32];
  int **local_8f8;
  int *local_8e8;
  undefined4 local_8e0 [2];
  undefined *local_8d8;
  undefined1 local_8d0;
  undefined8 local_8c0;
  undefined1 local_8b8;
  undefined8 *local_8b0;
  undefined8 *local_8a8;
  undefined1 local_8a0;
  int *local_898;
  undefined4 local_890;
  __time64_t local_888;
  undefined8 local_880;
  wchar_t local_878 [1040];
  ulonglong local_58;
  
  local_880 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_918;
  local_res20 = param_4;
  local_8e0[0] = param_2;
  FUN_1400a3440();
  local_8e8 = (int *)PTR_DAT_1402f8010;
  if (param_3 == (wchar_t *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80070057);
  }
  iVar2 = vswprintf_s(local_878,0x400,param_3,(va_list)&local_res20);
  iVar13 = 0;
  iVar11 = 0;
  if ((local_8e8 != (int *)0x0) && (iVar11 = 0, local_8e8 != (int *)PTR_DAT_1402f8010)) {
    iVar11 = local_8e8[-2];
  }
  iVar3 = iVar2;
  if (((iVar2 <= iVar11) && (iVar3 = iVar13, local_8e8 != (int *)0x0)) &&
     (local_8e8 != (int *)PTR_DAT_1402f8010)) {
    iVar3 = local_8e8[-2];
  }
  iVar11 = 1;
  if (1 < iVar3) {
    iVar11 = iVar3;
  }
  iVar3 = iVar13;
  if ((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1402f8010)) {
    iVar3 = local_8e8[-2];
  }
  if (iVar3 < iVar11) {
    if (local_8e8 == (int *)0x0) {
      local_8e8 = (int *)PTR_DAT_1402f8010;
    }
    if (iVar11 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (iVar11 == 0) {
      FUN_1400031d0(&local_8e8);
    }
    else {
      iVar3 = iVar13;
      if ((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1402f8010)) {
        iVar3 = local_8e8[-2];
      }
      if (iVar11 != iVar3) {
        piVar4 = (int *)FUN_1400a34c0((longlong)iVar11 * 2 + 10);
        if (piVar4 != (int *)0x0) {
          *piVar4 = 0;
          piVar4[1] = 1;
        }
        *piVar4 = iVar11;
        iVar3 = iVar13;
        if ((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1402f8010)) {
          iVar3 = local_8e8[-2];
        }
        piVar10 = (int *)PTR_DAT_1402f8010;
        if (iVar11 < iVar3) {
LAB_1401782f6:
          if (local_8e8 != (int *)0x0) {
            piVar10 = local_8e8;
          }
        }
        else {
          iVar11 = iVar13;
          if (local_8e8 != (int *)0x0) {
            if (local_8e8 != (int *)PTR_DAT_1402f8010) {
              iVar11 = local_8e8[-2];
            }
            goto LAB_1401782f6;
          }
        }
        FUN_1400a32f0(piVar4 + 2,piVar10,iVar11);
        FUN_1400031d0(&local_8e8);
        local_8e8 = piVar4 + 2;
      }
    }
  }
  FUN_140002e30(&local_8e8);
  piVar4 = local_8e8;
  if (local_8e8 == (int *)0x0) {
    piVar4 = (int *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(piVar4,local_878,iVar2);
  piVar4 = local_8e8;
  if (local_8e8 == (int *)0x0) {
    piVar4 = (int *)PTR_DAT_1402f8010;
  }
  iVar2 = FUN_1400a32c0(piVar4);
  iVar11 = 0;
  if (0 < iVar2) {
    iVar11 = iVar2;
  }
  iVar2 = iVar13;
  if ((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1402f8010)) {
    iVar2 = local_8e8[-2];
  }
  if ((iVar2 <= iVar11) && (iVar11 = iVar13, local_8e8 != (int *)0x0)) {
    if (local_8e8 == (int *)PTR_DAT_1402f8010) goto LAB_1401783b8;
    iVar11 = local_8e8[-2];
  }
  if (((local_8e8 != (int *)PTR_DAT_1402f8010) && (local_8e8 != (int *)0x0)) &&
     (local_8e8 + -2 != (int *)0x0)) {
    local_8e8[-2] = iVar11;
    *(undefined2 *)((longlong)local_8e8 + (longlong)iVar11 * 2) = 0;
  }
LAB_1401783b8:
  if (*(char *)(param_1 + 0x1790) != '\0') {
    local_8f8 = &local_8e8;
    (**(code **)(*(longlong *)(param_1 + 0x1818) + 0xb0))
              ((longlong *)(param_1 + 0x1818),1,&DAT_140318cf0,local_8e0);
  }
  if (*(int *)(param_1 + 0x6c8) != 0) {
    (**(code **)(*(longlong *)(param_1 + 0x78) + 0x10))();
    FUN_1400a3440();
    puVar8 = PTR_DAT_1402f8010;
    local_890 = 2;
    local_898 = (int *)PTR_DAT_1402f8010;
    piVar4 = (int *)PTR_DAT_1402f8010;
    if (local_8e8 != (int *)PTR_DAT_1402f8010) {
      puVar5 = (undefined8 *)FUN_1400a3440();
      local_8a8 = puVar5;
      FUN_1400a1c30(puVar5);
      local_8a0 = 1;
      if (((puVar8 != (undefined *)0x0) && (puVar8 != PTR_DAT_1402f8010)) &&
         (puVar8 + -8 != (undefined *)0x0)) {
        uVar6 = FUN_1400a3440();
        local_8c0 = uVar6;
        FUN_1400a1c30(uVar6);
        local_8b8 = 1;
        piVar4 = (int *)(puVar8 + -4);
        *piVar4 = *piVar4 + -1;
        if (*piVar4 == 0) {
          FUN_1400a3530(puVar8 + -8);
        }
        FUN_1400d1290(uVar6);
      }
      piVar4 = local_8e8;
      local_898 = local_8e8;
      if (((local_8e8 != (int *)PTR_DAT_1402f8010) && (local_8e8 != (int *)0x0)) &&
         (local_8e8 != (int *)0x8)) {
        local_8e8[-1] = local_8e8[-1] + 1;
      }
      FUN_1400d1290(puVar5);
    }
    _Var7 = _time64((__time64_t *)0x0);
    uVar6 = *(undefined8 *)(param_1 + 0x17c0);
    plVar1 = *(longlong **)(param_1 + 0x17b0);
    local_8c0 = uVar6;
    local_888 = _Var7;
    if (plVar1 == (longlong *)0x0) {
      puVar5 = (undefined8 *)FUN_1400a34c0(0x28);
    }
    else {
      puVar5 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,0x28);
    }
    local_8b0 = puVar5;
    local_8a8 = puVar5;
    if (puVar5 != (undefined8 *)0x0) {
      FUN_1400a3440();
      puVar8 = PTR_DAT_1402f8010;
      puVar5[2] = PTR_DAT_1402f8010;
      if (puVar8 == (undefined *)0x0) {
        puVar5[2] = PTR_DAT_1402f8010;
      }
      if (piVar4 != (int *)puVar5[2]) {
        puVar8 = (undefined *)FUN_1400a3440();
        local_8d8 = puVar8;
        FUN_1400a1c30(puVar8);
        local_8d0 = 1;
        FUN_1400031d0(puVar5 + 2);
        puVar5[2] = piVar4;
        if (((piVar4 != (int *)PTR_DAT_1402f8010) && (piVar4 != (int *)0x0)) &&
           (piVar4 != (int *)0x8)) {
          piVar4[-1] = piVar4[-1] + 1;
        }
        FUN_1400d1290(puVar8);
        uVar6 = local_8c0;
      }
      *(undefined4 *)(puVar5 + 3) = 2;
      puVar5[4] = _Var7;
    }
    puVar5[1] = uVar6;
    *puVar5 = 0;
    *(longlong *)(param_1 + 0x17c8) = *(longlong *)(param_1 + 0x17c8) + 1;
    if (*(undefined8 **)(param_1 + 0x17c0) == (undefined8 *)0x0) {
      *(undefined8 **)(param_1 + 0x17b8) = puVar5;
    }
    else {
      **(undefined8 **)(param_1 + 0x17c0) = puVar5;
    }
    *(undefined8 **)(param_1 + 0x17c0) = puVar5;
    if ((((ulonglong)*(uint *)(param_1 + 0x6c8) < *(ulonglong *)(param_1 + 0x17c8)) &&
        (FUN_140176d30(param_1 + 0x17b0,&local_8d8), puVar8 = local_8d8,
        local_8d8 != (undefined *)0x0)) &&
       ((local_8d8 != PTR_DAT_1402f8010 && (puVar12 = local_8d8 + -8, puVar12 != (undefined *)0x0)))
       ) {
      puVar9 = (undefined *)FUN_1400a3440();
      local_8d8 = puVar9;
      FUN_1400a1c30(puVar9);
      local_8d0 = 1;
      piVar10 = (int *)(puVar8 + -4);
      *piVar10 = *piVar10 + -1;
      if (*piVar10 == 0) {
        FUN_1400a3530(puVar12);
      }
      FUN_1400d1290(puVar9);
    }
    if (((piVar4 != (int *)0x0) && (piVar4 != (int *)PTR_DAT_1402f8010)) &&
       (piVar4 + -2 != (int *)0x0)) {
      puVar8 = (undefined *)FUN_1400a3440();
      local_8d8 = puVar8;
      FUN_1400a1c30(puVar8);
      local_8d0 = 1;
      piVar10 = piVar4 + -1;
      *piVar10 = *piVar10 + -1;
      if (*piVar10 == 0) {
        FUN_1400a3530(piVar4 + -2);
      }
      FUN_1400d1290(puVar8);
    }
  }
  piVar4 = local_8e8;
  if (((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1402f8010)) &&
     (piVar10 = local_8e8 + -2, piVar10 != (int *)0x0)) {
    puVar8 = (undefined *)FUN_1400a3440();
    local_8d8 = puVar8;
    FUN_1400a1c30(puVar8);
    local_8d0 = 1;
    piVar4 = piVar4 + -1;
    *piVar4 = *piVar4 + -1;
    if (*piVar4 == 0) {
      FUN_1400a3530(piVar10);
    }
    FUN_1400d1290(puVar8);
  }
  return;
}



undefined8 FUN_1401786e0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined8 *puVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong *plVar4;
  longlong lVar5;
  undefined8 uVar6;
  longlong *local_res8;
  
  uVar3 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar3);
  plVar4 = (longlong *)FUN_1401755f0(*(undefined8 *)(param_1 + 0x20),&local_res8,*param_4);
  lVar5 = 0;
  if ((longlong *)*plVar4 != (longlong *)0x0) {
    lVar5 = *(longlong *)*plVar4;
  }
  if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
    puVar1 = (undefined8 *)*local_res8;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    FUN_1400a3530(local_res8);
  }
  if (lVar5 != 0) {
    FUN_1401b88f0(lVar5,1);
    *(undefined4 *)(lVar5 + 0x61c) = 0;
    uVar6 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x70) + 0x1c0))();
    *(undefined8 *)(lVar5 + 0x620) = uVar6;
    *(undefined1 *)(lVar5 + 0x20) = 0;
    FUN_1401bab20(lVar5);
    lVar2 = *(longlong *)(param_1 + 0x20);
    if ((*(char *)(lVar2 + 0x1790) != '\0') || (*(int *)(lVar2 + 0x6c8) != 0)) {
      FUN_140177c40(lVar2,1,&DAT_140256b10,*(undefined4 *)(lVar5 + 0x56c));
    }
  }
  FUN_1400d1290(uVar3);
  return 1;
}



undefined8 FUN_140178810(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined8 *puVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong *local_res8;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined1 uVar8;
  
  uVar6 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  uVar7 = uVar3;
  FUN_1400a1c30(uVar3);
  uVar8 = 1;
  plVar4 = (longlong *)FUN_1401755f0(*(undefined8 *)(param_1 + 0x20),&local_res8,*param_4);
  lVar5 = 0;
  if ((longlong *)*plVar4 != (longlong *)0x0) {
    lVar5 = *(longlong *)*plVar4;
  }
  if ((local_res8 != (longlong *)0x0) &&
     (local_res8[1] = local_res8[1] + -1, uVar3 = uVar7, local_res8[1] == 0)) {
    puVar1 = (undefined8 *)*local_res8;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
      uVar3 = uVar7;
    }
    FUN_1400a3530(local_res8);
    uVar7 = uVar3;
  }
  if ((lVar5 != 0) &&
     ((*(longlong **)(lVar5 + 0x18) == (longlong *)0x0 || (**(longlong **)(lVar5 + 0x18) == 0)))) {
    *(undefined1 *)(lVar5 + 0x23) = 1;
    lVar2 = *(longlong *)(param_1 + 0x20);
    if ((*(char *)(lVar2 + 0x1790) != '\0') || (*(int *)(lVar2 + 0x6c8) != 0)) {
      FUN_140177c40(lVar2,1,&DAT_140256b88,*(undefined4 *)(lVar5 + 0x56c),uVar6,uVar7,uVar8);
    }
  }
  FUN_1400d1290(uVar3);
  return 1;
}



void FUN_140178910(longlong param_1,undefined8 param_2,longlong *param_3)

{
  undefined8 uVar1;
  undefined *puVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  uVar3 = 0xfffffffffffffffe;
  uVar1 = (**(code **)(*(longlong *)(param_1 + -0x78) + 0x58))(param_1 + -0x78);
  uVar4 = uVar1;
  FUN_1400a1c30(uVar1);
  if ((*(char *)(param_1 + 0x1718) != '\0') || (*(int *)(param_1 + 0x650) != 0)) {
    puVar2 = (undefined *)*param_3;
    if ((undefined *)*param_3 == (undefined *)0x0) {
      puVar2 = PTR_DAT_1402f8010;
    }
    FUN_140177c40(param_1 + -0x78,0,L"Socket Warning: %s",puVar2,uVar3,uVar4,1);
  }
  FUN_1400d1290(uVar1);
  FUN_1400031d0(param_3);
  return;
}



void FUN_1401789b0(longlong *param_1)

{
  undefined8 *puVar1;
  
  FUN_140176ea0();
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  return;
}



void FUN_1401789e0(longlong *param_1)

{
  undefined8 *puVar1;
  
  FUN_140177110();
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  return;
}



void FUN_140178a10(longlong param_1)

{
  longlong *plVar1;
  undefined8 *puVar2;
  uint uVar3;
  ulonglong uVar4;
  longlong lVar5;
  longlong lVar6;
  float fVar7;
  float fVar8;
  
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
  FUN_1401b2030();
  lVar5 = *(longlong *)(param_1 + 0x10);
  while (lVar5 != 0) {
    lVar6 = *(longlong *)(lVar5 + 0x10);
    if ((*(longlong *)(lVar5 + 8) != 0) &&
       (*(longlong *)(*(longlong *)(lVar5 + 8) + 8) =
             *(longlong *)(*(longlong *)(lVar5 + 8) + 8) + -1,
       *(longlong *)(*(longlong *)(lVar5 + 8) + 8) == 0)) {
      plVar1 = *(longlong **)(lVar5 + 8);
      puVar2 = (undefined8 *)*plVar1;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      FUN_1400a3530(plVar1);
    }
    plVar1 = *(longlong **)(param_1 + 0x50);
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530(lVar5);
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar5);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar5 = lVar6;
  }
  FUN_1400a3530(*(undefined8 *)(param_1 + 8));
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  FUN_1401b2030(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar3 = FUN_140142850(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_1400a3530();
      *(undefined8 *)(param_1 + 8) = 0;
    }
    lVar5 = 0;
    *(uint *)(param_1 + 0x28) = uVar3;
    fVar8 = (float)uVar3 * *(float *)(param_1 + 0x34);
    if ((9.223372e+18 < fVar8) && (fVar8 = fVar8 - 9.223372e+18, fVar8 < 9.223372e+18)) {
      lVar5 = -0x8000000000000000;
    }
    fVar7 = (float)uVar3 * *(float *)(param_1 + 0x30);
    lVar6 = 0;
    *(longlong *)(param_1 + 0x38) = (longlong)fVar8 + lVar5;
    if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
      lVar6 = -0x8000000000000000;
    }
    uVar4 = (longlong)fVar7 + lVar6;
    if ((ulonglong)((longlong)fVar7 + lVar6) < 0x11) {
      uVar4 = 0;
    }
    *(ulonglong *)(param_1 + 0x40) = uVar4;
  }
  FUN_1401b2030(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



undefined8 FUN_140178b90(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_140144560(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  FUN_1401b2030(param_1);
  uVar2 = FUN_14015ed70(param_1,param_2,param_3,param_4);
  FUN_1401b2030(param_1);
  return uVar2;
}



undefined8 FUN_140178c10(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_140144560(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  FUN_1401b2030(param_1);
  uVar2 = FUN_140177360(param_1,param_2,param_3,param_4);
  FUN_1401b2030(param_1);
  return uVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140178c90(__time64_t *param_1,undefined8 param_2,wchar_t *param_3)

{
  errno_t eVar1;
  size_t sVar2;
  wchar_t *pwVar3;
  undefined1 auStack_178 [32];
  undefined4 local_158;
  tm local_150;
  wchar_t local_128 [128];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_178;
  local_158 = 0;
  if (param_3 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)0x0;
  }
  else {
    eVar1 = _localtime64_s(&local_150,param_1);
    if (eVar1 != 0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80070057);
    }
    sVar2 = wcsftime(local_128,0x80,param_3,&local_150);
    if (sVar2 == 0) {
      local_128[0] = L'\0';
    }
    pwVar3 = local_128;
  }
  FUN_1400a3210(param_2,pwVar3);
  return param_2;
}



undefined8 FUN_140178d30(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong *local_res8;
  undefined8 local_res20;
  undefined8 uVar5;
  undefined8 uVar6;
  
  uVar5 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  uVar6 = uVar2;
  FUN_1400a1c30(uVar2);
  plVar3 = (longlong *)
           FUN_1401755f0(*(undefined8 *)(param_1 + 0x20),&local_res8,param_2,param_4,uVar5,uVar6,1);
  lVar4 = 0;
  if ((longlong *)*plVar3 != (longlong *)0x0) {
    lVar4 = *(longlong *)*plVar3;
  }
  if ((local_res8 != (longlong *)0x0) &&
     (local_res8[1] = local_res8[1] + -1, uVar2 = uVar6, local_res8[1] == 0)) {
    puVar1 = (undefined8 *)*local_res8;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
      uVar2 = uVar6;
    }
    FUN_1400a3530(local_res8);
  }
  if ((lVar4 != 0) && (*(char *)(lVar4 + 0x684) == '\0')) {
    local_res20 = 0;
    FUN_140176e00(lVar4 + 0x28,&local_res20);
  }
  FUN_1400d1290(uVar2);
  return 1;
}



void FUN_140178e10(longlong *param_1)

{
  undefined8 *puVar1;
  
  FUN_140177070();
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  return;
}



void FUN_140178e40(longlong *param_1,undefined8 param_2,undefined4 param_3,longlong param_4,
                  int *param_5,undefined4 *param_6)

{
  undefined8 *puVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int *piVar7;
  undefined8 uVar8;
  longlong *plVar9;
  longlong lVar10;
  int *piVar11;
  longlong lVar12;
  longlong lVar13;
  longlong lVar14;
  int iVar15;
  int iVar16;
  ulonglong uVar17;
  ulonglong uVar18;
  double dVar19;
  longlong *local_res10;
  undefined **local_c8;
  undefined4 local_c0;
  undefined2 local_bc;
  undefined **local_b8;
  undefined8 local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined4 local_88;
  longlong local_80;
  undefined4 local_78;
  undefined4 local_74;
  undefined1 local_68 [8];
  undefined8 local_60;
  undefined8 local_58;
  undefined1 local_50;
  
  lVar3 = (longlong)param_5;
  local_60 = 0xfffffffffffffffe;
  FUN_140174e40(param_5,0);
  uVar17 = (ulonglong)*(int *)(lVar3 + 0x18);
  FUN_1401a3a00(&local_90);
  local_80 = lVar3;
  lVar14 = 0;
  local_78 = 0;
  local_74 = *(undefined4 *)((longlong)param_1 + 0x6a4);
  local_90 = param_2;
  local_88 = param_3;
  iVar4 = FUN_1401a4390(&local_90,param_6);
  if (-1 < iVar4) {
    local_c8 = Proud::AddrPort::vftable;
    local_c0 = *(undefined4 *)(param_4 + 8);
    local_bc = *(undefined2 *)(param_4 + 0xc);
    plVar9 = (longlong *)FUN_140173ea0(param_1,&local_res10,&local_c8);
    lVar13 = lVar14;
    if ((longlong *)*plVar9 != (longlong *)0x0) {
      lVar13 = *(longlong *)*plVar9;
    }
    if ((local_res10 != (longlong *)0x0) &&
       (local_res10[1] = local_res10[1] + -1, local_res10[1] == 0)) {
      puVar1 = (undefined8 *)*local_res10;
      if (puVar1 != (undefined8 *)0x0) {
        (**(code **)*puVar1)(puVar1,1);
      }
      FUN_1400a3530(local_res10);
    }
    if (iVar4 < 1) {
      return;
    }
    lVar12 = uVar17 * 0x48;
    uVar18 = uVar17;
    do {
      lVar10 = 0;
      if (((longlong)(uVar17 + lVar14) < 0) || (*(int *)(lVar3 + 0x18) <= (int)uVar18)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      lVar2 = *(longlong *)(lVar3 + 0x10);
      *(undefined4 *)(lVar12 + 0x38 + lVar2) = *(undefined4 *)(param_4 + 8);
      *(undefined2 *)(lVar12 + 0x3c + lVar2) = *(undefined2 *)(param_4 + 0xc);
      if (lVar13 == 0) {
        if ((longlong *)param_1[0x2ae] != (longlong *)0x0) {
          lVar10 = *(longlong *)param_1[0x2ae];
        }
        if ((*(int *)(param_4 + 8) == *(int *)(lVar10 + 0xd0)) &&
           (*(short *)(param_4 + 0xc) == *(short *)(lVar10 + 0xd4))) {
          *(undefined4 *)(lVar12 + 0x28 + lVar2) = 1;
          FUN_140169e70(param_1);
        }
        else {
          *(undefined4 *)(lVar12 + 0x28 + lVar2) = 0;
        }
      }
      else {
        *(undefined4 *)(lVar12 + 0x28 + lVar2) = *(undefined4 *)(lVar13 + 0x56c);
        dVar19 = (double)(**(code **)(param_1[0xe] + 0x1c0))(param_1 + 0xe);
        dVar19 = dVar19 - *(double *)(lVar13 + 0xc0);
        if (0.0 < dVar19) {
          *(double *)(lVar13 + 0x140) = dVar19;
        }
        uVar8 = (**(code **)(param_1[0xe] + 0x1c0))(param_1 + 0xe);
        *(undefined8 *)(lVar13 + 0xc0) = uVar8;
        *(int *)(lVar13 + 0x100) = *(int *)(lVar13 + 0x100) + 1;
      }
      uVar18 = (ulonglong)((int)uVar18 + 1);
      lVar14 = lVar14 + 1;
      lVar12 = lVar12 + 0x48;
    } while (lVar14 < iVar4);
    return;
  }
  FUN_1400a3440();
  param_5 = (int *)PTR_DAT_1402f8010;
  iVar5 = FUN_1400a32c0(L"ExtractMessageFromUdpRecvQueue : addedCount < 0");
  iVar16 = 0;
  iVar4 = 0;
  if ((param_5 != (int *)0x0) && (iVar4 = 0, param_5 != (int *)PTR_DAT_1402f8010)) {
    iVar4 = param_5[-2];
  }
  iVar6 = iVar5;
  if (((iVar5 <= iVar4) && (iVar6 = iVar16, param_5 != (int *)0x0)) &&
     (param_5 != (int *)PTR_DAT_1402f8010)) {
    iVar6 = param_5[-2];
  }
  iVar4 = 1;
  if (1 < iVar6) {
    iVar4 = iVar6;
  }
  iVar6 = iVar16;
  if ((param_5 != (int *)0x0) && (param_5 != (int *)PTR_DAT_1402f8010)) {
    iVar6 = param_5[-2];
  }
  iVar15 = 0;
  if (iVar6 < iVar4) {
    if (param_5 == (int *)0x0) {
      param_5 = (int *)PTR_DAT_1402f8010;
    }
    if (iVar4 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (iVar4 == 0) {
      FUN_1400031d0(&param_5);
    }
    else {
      iVar6 = iVar16;
      if ((param_5 != (int *)0x0) && (param_5 != (int *)PTR_DAT_1402f8010)) {
        iVar6 = param_5[-2];
      }
      if (iVar4 != iVar6) {
        piVar7 = (int *)FUN_1400a34c0((longlong)iVar4 * 2 + 10);
        if (piVar7 != (int *)0x0) {
          *piVar7 = 0;
          piVar7[1] = 1;
        }
        *piVar7 = iVar4;
        iVar6 = iVar15;
        if ((param_5 != (int *)0x0) && (param_5 != (int *)PTR_DAT_1402f8010)) {
          iVar6 = param_5[-2];
        }
        piVar11 = (int *)PTR_DAT_1402f8010;
        if (iVar4 < iVar6) {
LAB_140178fc2:
          if (param_5 != (int *)0x0) {
            piVar11 = param_5;
          }
        }
        else {
          iVar4 = iVar16;
          if (param_5 != (int *)0x0) {
            if (param_5 != (int *)PTR_DAT_1402f8010) {
              iVar4 = param_5[-2];
            }
            goto LAB_140178fc2;
          }
        }
        FUN_1400a32f0(piVar7 + 2,piVar11,iVar4);
        FUN_1400031d0(&param_5);
        param_5 = piVar7 + 2;
      }
    }
  }
  FUN_140002e30(&param_5);
  piVar7 = param_5;
  if (param_5 == (int *)0x0) {
    piVar7 = (int *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(piVar7,L"ExtractMessageFromUdpRecvQueue : addedCount < 0",iVar5);
  piVar7 = param_5;
  if (param_5 == (int *)0x0) {
    piVar7 = (int *)PTR_DAT_1402f8010;
  }
  iVar5 = FUN_1400a32c0(piVar7);
  iVar4 = 0;
  if (0 < iVar5) {
    iVar4 = iVar5;
  }
  iVar5 = iVar15;
  if ((param_5 != (int *)0x0) && (param_5 != (int *)PTR_DAT_1402f8010)) {
    iVar5 = param_5[-2];
  }
  if ((iVar5 <= iVar4) && (iVar4 = iVar15, param_5 != (int *)0x0)) {
    if (param_5 == (int *)PTR_DAT_1402f8010) goto LAB_14017907a;
    iVar4 = param_5[-2];
  }
  if (((param_5 != (int *)PTR_DAT_1402f8010) && (param_5 != (int *)0x0)) &&
     (param_5 + -2 != (int *)0x0)) {
    param_5[-2] = iVar4;
    *(undefined2 *)((longlong)param_5 + (longlong)iVar4 * 2) = 0;
  }
LAB_14017907a:
  local_b0 = 0;
  local_a8 = 0;
  local_a0 = 0;
  local_98 = 0;
  local_b8 = Proud::ByteArray::vftable;
  uVar8 = FUN_1401416a0(local_68,*param_6,(int)param_1[0x2af],&param_5,&local_b8);
  (**(code **)(*param_1 + 0x88))(param_1,uVar8);
  FUN_140140df0(&local_b8);
  piVar7 = param_5;
  if (((param_5 != (int *)0x0) && (param_5 != (int *)PTR_DAT_1402f8010)) &&
     (piVar11 = param_5 + -2, piVar11 != (int *)0x0)) {
    uVar8 = FUN_1400a3440();
    local_58 = uVar8;
    FUN_1400a1c30(uVar8);
    local_50 = 1;
    piVar7 = piVar7 + -1;
    *piVar7 = *piVar7 + -1;
    if (*piVar7 == 0) {
      FUN_1400a3530(piVar11);
    }
    FUN_1400d1290(uVar8);
  }
  return;
}



void FUN_1401792f0(longlong *param_1,undefined8 param_2)

{
  longlong lVar1;
  ulonglong *puVar2;
  int iVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  uint *puVar7;
  undefined8 uVar8;
  ulonglong uVar9;
  uint *puVar10;
  uint uVar11;
  ulonglong uVar12;
  uint uVar13;
  undefined4 local_res8 [2];
  uint *local_res18;
  undefined1 local_res20 [8];
  undefined **local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_30;
  
  FUN_140174e40(param_2,0);
  (**(code **)(param_1[0xf] + 0x10))();
  uVar12 = 0;
  if (((longlong *)param_1[699] == (longlong *)0x0) ||
     (lVar1 = *(longlong *)param_1[699], uVar9 = lVar1 - 0x40, lVar1 == 0)) {
    uVar9 = uVar12;
  }
  iVar3 = FUN_1401a4970(uVar9 + 0x130,param_2,1,*(undefined4 *)((longlong)param_1 + 0x6a4),
                        local_res8);
  if (-1 < iVar3) {
    return;
  }
  FUN_1400a3440();
  local_res18 = (uint *)PTR_DAT_1402f8010;
  uVar4 = FUN_1400a32c0(L"Received stream from TCP server became inconsistent!");
  uVar6 = 0;
  uVar9 = uVar12;
  if ((local_res18 != (uint *)0x0) && (uVar9 = 0, local_res18 != (uint *)PTR_DAT_1402f8010)) {
    uVar9 = (ulonglong)local_res18[-2];
  }
  uVar5 = uVar4;
  if ((((int)uVar4 <= (int)uVar9) && (uVar5 = uVar6, local_res18 != (uint *)0x0)) &&
     (local_res18 != (uint *)PTR_DAT_1402f8010)) {
    uVar5 = local_res18[-2];
  }
  uVar11 = 1;
  if (1 < (int)uVar5) {
    uVar11 = uVar5;
  }
  uVar5 = uVar6;
  if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1402f8010)) {
    uVar5 = local_res18[-2];
  }
  uVar13 = 0;
  if ((int)uVar5 < (int)uVar11) {
    if (local_res18 == (uint *)0x0) {
      local_res18 = (uint *)PTR_DAT_1402f8010;
    }
    if ((int)uVar11 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar11 == 0) {
      FUN_1400031d0(&local_res18);
    }
    else {
      uVar5 = uVar6;
      if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1402f8010)) {
        uVar5 = local_res18[-2];
      }
      if (uVar11 != uVar5) {
        puVar7 = (uint *)FUN_1400a34c0((longlong)(int)uVar11 * 2 + 10);
        if (puVar7 != (uint *)0x0) {
          *puVar7 = 0;
          puVar7[1] = 1;
        }
        *puVar7 = uVar11;
        uVar5 = uVar13;
        if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1402f8010)) {
          uVar5 = local_res18[-2];
        }
        puVar10 = (uint *)PTR_DAT_1402f8010;
        if ((int)uVar11 < (int)uVar5) {
LAB_14017946b:
          if (local_res18 != (uint *)0x0) {
            puVar10 = local_res18;
          }
        }
        else {
          uVar11 = uVar6;
          if (local_res18 != (uint *)0x0) {
            if (local_res18 != (uint *)PTR_DAT_1402f8010) {
              uVar11 = local_res18[-2];
            }
            goto LAB_14017946b;
          }
        }
        FUN_1400a32f0(puVar7 + 2,puVar10,uVar11);
        FUN_1400031d0(&local_res18);
        local_res18 = puVar7 + 2;
      }
    }
  }
  FUN_140002e30(&local_res18);
  puVar7 = local_res18;
  if (local_res18 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar7,L"Received stream from TCP server became inconsistent!",uVar4);
  puVar7 = local_res18;
  if (local_res18 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1402f8010;
  }
  uVar6 = FUN_1400a32c0(puVar7);
  uVar4 = 0;
  if (0 < (int)uVar6) {
    uVar4 = uVar6;
  }
  uVar6 = uVar13;
  if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1402f8010)) {
    uVar6 = local_res18[-2];
  }
  if (((int)uVar6 <= (int)uVar4) && (uVar4 = uVar13, local_res18 != (uint *)0x0)) {
    if (local_res18 == (uint *)PTR_DAT_1402f8010) goto LAB_14017951b;
    uVar4 = local_res18[-2];
  }
  if (((local_res18 != (uint *)PTR_DAT_1402f8010) && (local_res18 != (uint *)0x0)) &&
     (local_res18 + -2 != (uint *)0x0)) {
    local_res18[-2] = uVar4;
    *(undefined2 *)((longlong)local_res18 + (longlong)(int)uVar4 * 2) = 0;
  }
LAB_14017951b:
  local_48 = 0;
  local_40 = 0;
  local_38 = 0;
  local_30 = 0;
  local_50 = Proud::ByteArray::vftable;
  uVar8 = FUN_1401416a0(local_res20,local_res8[0],1,&local_res18,&local_50);
  (**(code **)(*param_1 + 0x80))(param_1,uVar8);
  FUN_140140df0(&local_50);
  puVar7 = local_res18;
  if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1402f8010)) &&
     (puVar10 = local_res18 + -2, puVar10 != (uint *)0x0)) {
    uVar8 = FUN_1400a3440();
    FUN_1400a1c30(uVar8);
    puVar7 = puVar7 + -1;
    *puVar7 = *puVar7 - 1;
    if (*puVar7 == 0) {
      FUN_1400a3530(puVar10);
    }
    FUN_1400d1290(uVar8);
  }
  if ((((longlong *)param_1[699] != (longlong *)0x0) &&
      (lVar1 = *(longlong *)param_1[699], lVar1 != 0)) &&
     ((puVar2 = *(ulonglong **)(lVar1 + 0xe8), puVar2 != (ulonglong *)0x0 && (*puVar2 != 0)))) {
    if (puVar2 != (ulonglong *)0x0) {
      uVar12 = *puVar2;
    }
    FUN_1400a88b0(uVar12);
  }
  return;
}



void FUN_140179610(longlong *param_1)

{
  int *piVar1;
  int iVar2;
  undefined8 uVar3;
  undefined2 uVar4;
  undefined4 uVar5;
  undefined **ppuVar6;
  undefined8 *puVar7;
  longlong lVar8;
  longlong lVar9;
  longlong *local_res8;
  undefined **local_88;
  undefined4 uStack_80;
  undefined2 uStack_7c;
  undefined2 uStack_7a;
  undefined4 local_78 [2];
  undefined8 local_70;
  undefined1 local_68;
  undefined4 local_64;
  undefined1 local_60;
  undefined1 local_5f;
  undefined1 local_58 [4];
  undefined4 local_54;
  longlong local_50;
  longlong local_48;
  int local_40;
  int local_3c;
  
  FUN_140185560(local_58);
  FUN_140185030(local_58);
  FUN_1401856c0(local_58,0x800);
  FUN_1401856c0(local_58,0);
  FUN_14003c9e0(local_58,0xc);
  lVar9 = 0;
  lVar8 = lVar9;
  if ((longlong *)param_1[0x2ae] != (longlong *)0x0) {
    lVar8 = *(longlong *)param_1[0x2ae];
  }
  local_88 = *(undefined ***)(lVar8 + 8);
  uStack_80 = *(undefined4 *)(lVar8 + 0x10);
  uStack_7c = (undefined2)*(undefined4 *)(lVar8 + 0x14);
  uStack_7a = (undefined2)((uint)*(undefined4 *)(lVar8 + 0x14) >> 0x10);
  local_54 = 0;
  if (local_50 == 0) {
    if (local_48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar2 = *(int *)(local_50 + 0x18);
    FUN_14003cda0(local_50,iVar2 + 0x10);
    lVar8 = lVar9;
    if (*(int *)(local_50 + 0x18) != 0) {
      lVar8 = *(longlong *)(local_50 + 0x10);
    }
    puVar7 = (undefined8 *)(lVar8 + iVar2);
    goto LAB_1401796f8;
  }
  lVar8 = (longlong)local_40;
  local_40 = local_40 + 0x10;
  if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  puVar7 = (undefined8 *)(local_48 + lVar8);
LAB_1401796f8:
  *puVar7 = local_88;
  puVar7[1] = CONCAT26(uStack_7a,CONCAT24(uStack_7c,uStack_80));
  FUN_14003ced0(local_58);
  if (((char)param_1[0x2f2] != '\0') || ((int)param_1[0xd9] != 0)) {
    lVar8 = lVar9;
    if ((longlong *)param_1[0x2ae] != (longlong *)0x0) {
      lVar8 = *(longlong *)param_1[0x2ae];
    }
    (*(code *)**(undefined8 **)(lVar8 + 200))((undefined8 *)(lVar8 + 200),&local_res8);
    FUN_140177c40(param_1,1,L"Sending ServerHolepunch: %s",local_res8);
    if (((local_res8 != (longlong *)0x0) && (local_res8 != (longlong *)PTR_DAT_1402f8010)) &&
       (local_res8 + -1 != (longlong *)0x0)) {
      ppuVar6 = (undefined **)FUN_1400a3440();
      local_88 = ppuVar6;
      FUN_1400a1c30(ppuVar6);
      uStack_80 = CONCAT31(uStack_80._1_3_,1);
      piVar1 = (int *)((longlong)local_res8 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(local_res8 + -1);
      }
      FUN_1400d1290(ppuVar6);
    }
  }
  local_78[0] = 5;
  local_70 = 0;
  local_68 = 1;
  local_64 = 0xffffffff;
  local_60 = 1;
  local_5f = DAT_1402f81cc;
  lVar8 = lVar9;
  if ((longlong *)param_1[0x2ae] != (longlong *)0x0) {
    lVar8 = *(longlong *)param_1[0x2ae];
  }
  local_88 = Proud::AddrPort::vftable;
  uStack_80 = *(undefined4 *)(lVar8 + 0xd0);
  uStack_7c = *(undefined2 *)(lVar8 + 0xd4);
  if (((longlong *)param_1[0x2a4] != (longlong *)0x0) &&
     (lVar8 = *(longlong *)param_1[0x2a4], lVar8 != 0)) {
    lVar9 = lVar8 + -0x40;
  }
  uVar3 = (**(code **)(param_1[0xe] + 0x1c0))();
  uVar5 = (**(code **)(*param_1 + 0x30))(param_1);
  uVar4 = FUN_14019c290(uVar5,1);
  FUN_1401bc9b0(lVar9,1,uVar4,&local_88,local_58,uVar3,local_78);
  local_res8 = &local_50;
  FUN_14019a730(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



void FUN_1401798c0(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  char cVar2;
  undefined8 uVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  
  uVar3 = (**(code **)(*param_1 + 0x58))(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  FUN_1400a1c30(uVar3);
  if ((((((int)param_1[0xd4] != 2) && ((longlong *)param_1[0x2a4] != (longlong *)0x0)) &&
       (plVar1 = *(longlong **)param_1[0x2a4], plVar1 != (longlong *)0x0)) &&
      ((cVar2 = (**(code **)(*plVar1 + 0x10))(), cVar2 == '\0' &&
       ((longlong *)param_1[0x2ae] != (longlong *)0x0)))) &&
     ((lVar4 = *(longlong *)param_1[0x2ae], lVar4 != 0 &&
      ((*(char *)(lVar4 + 0x80) != '\x01' && ((int)param_1[0x2af] != 0)))))) {
    plVar1 = (longlong *)param_1[0x2ae];
    lVar4 = 0;
    lVar6 = lVar4;
    if (plVar1 != (longlong *)0x0) {
      lVar6 = *plVar1;
    }
    if (*(int *)(lVar6 + 0xd0) != 0) {
      lVar6 = lVar4;
      if (plVar1 != (longlong *)0x0) {
        lVar6 = *plVar1;
      }
      if (*(int *)(lVar6 + 0xd0) != -1) {
        lVar6 = lVar4;
        if (plVar1 != (longlong *)0x0) {
          lVar6 = *plVar1;
        }
        if (*(double *)(lVar6 + 0x100) != DAT_1402f8078) {
          lVar6 = lVar4;
          if ((longlong *)param_1[0x2ae] != (longlong *)0x0) {
            lVar6 = *(longlong *)param_1[0x2ae];
          }
          lVar5 = lVar4;
          if (param_1[0xbb] != 0) {
            lVar5 = *(longlong *)(param_1[0xbb] + 0x38);
          }
          *(double *)(lVar6 + 0x100) = *(double *)(lVar6 + 0x100) - *(double *)(lVar5 + 0x100);
          lVar6 = lVar4;
          if ((longlong *)param_1[0x2ae] != (longlong *)0x0) {
            lVar6 = *(longlong *)param_1[0x2ae];
          }
          if (*(double *)(lVar6 + 0x100) < 0.0) {
            if ((longlong *)param_1[0x2ae] != (longlong *)0x0) {
              lVar4 = *(longlong *)param_1[0x2ae];
            }
            *(undefined8 *)(lVar4 + 0x100) = DAT_1402f8080;
            FUN_140179610(param_1);
          }
        }
      }
    }
  }
  FUN_1400d1290(uVar3);
  return;
}



void FUN_140179a90(longlong param_1,longlong param_2,undefined8 param_3)

{
  longlong *plVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  uint uVar4;
  uint uVar5;
  undefined8 uVar6;
  uint *puVar7;
  undefined8 uVar8;
  uint *puVar9;
  uint uVar10;
  uint uVar11;
  uint uVar12;
  uint uVar13;
  uint *local_res8;
  longlong *local_res10;
  undefined1 local_res20 [8];
  undefined **local_90;
  undefined4 local_88;
  undefined2 local_84;
  undefined8 local_80;
  undefined1 local_78;
  undefined8 local_70;
  undefined1 local_68;
  undefined **local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  
  plVar2 = (longlong *)(param_1 + -0x88);
  uVar6 = (**(code **)(*plVar2 + 0x58))(plVar2);
  local_80 = uVar6;
  FUN_1400a1c30(uVar6);
  local_78 = 1;
  local_90 = Proud::AddrPort::vftable;
  local_88 = *(undefined4 *)(param_2 + 8);
  local_84 = *(undefined2 *)(param_2 + 0xc);
  FUN_140173ea0(plVar2,&local_res10,&local_90);
  FUN_1400a3440();
  local_res8 = (uint *)PTR_DAT_1402f8010;
  uVar4 = FUN_1400a32c0(param_3);
  uVar12 = 0;
  uVar13 = 0;
  uVar10 = uVar12;
  if ((local_res8 != (uint *)0x0) && (uVar10 = 0, local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar10 = local_res8[-2];
  }
  uVar5 = uVar4;
  if ((((int)uVar4 <= (int)uVar10) && (uVar5 = uVar13, local_res8 != (uint *)0x0)) &&
     (local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar5 = local_res8[-2];
  }
  uVar10 = 1;
  if (1 < (int)uVar5) {
    uVar10 = uVar5;
  }
  uVar5 = uVar13;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar5 = local_res8[-2];
  }
  uVar11 = 0;
  if ((int)uVar5 < (int)uVar10) {
    if (local_res8 == (uint *)0x0) {
      local_res8 = (uint *)PTR_DAT_1402f8010;
    }
    if ((int)uVar10 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar10 == 0) {
      FUN_1400031d0(&local_res8);
    }
    else {
      uVar5 = uVar13;
      if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
        uVar5 = local_res8[-2];
      }
      if (uVar10 != uVar5) {
        puVar7 = (uint *)FUN_1400a34c0((longlong)(int)uVar10 * 2 + 10);
        if (puVar7 != (uint *)0x0) {
          *puVar7 = 0;
          puVar7[1] = 1;
        }
        *puVar7 = uVar10;
        uVar5 = uVar11;
        if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
          uVar5 = local_res8[-2];
        }
        puVar9 = (uint *)PTR_DAT_1402f8010;
        if ((int)uVar10 < (int)uVar5) {
LAB_140179c03:
          if (local_res8 != (uint *)0x0) {
            puVar9 = local_res8;
          }
        }
        else {
          uVar10 = uVar13;
          if (local_res8 != (uint *)0x0) {
            if (local_res8 != (uint *)PTR_DAT_1402f8010) {
              uVar10 = local_res8[-2];
            }
            goto LAB_140179c03;
          }
        }
        FUN_1400a32f0(puVar7 + 2,puVar9,uVar10);
        FUN_1400031d0(&local_res8);
        local_res8 = puVar7 + 2;
      }
    }
  }
  FUN_140002e30(&local_res8);
  puVar7 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar7,param_3,uVar4);
  puVar7 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1402f8010;
  }
  uVar4 = FUN_1400a32c0(puVar7);
  plVar1 = local_res10;
  uVar10 = 0;
  if (0 < (int)uVar4) {
    uVar10 = uVar4;
  }
  uVar4 = uVar11;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar4 = local_res8[-2];
  }
  if (((int)uVar4 <= (int)uVar10) && (uVar10 = uVar11, local_res8 != (uint *)0x0)) {
    if (local_res8 == (uint *)PTR_DAT_1402f8010) goto LAB_140179cb3;
    uVar10 = local_res8[-2];
  }
  if (((local_res8 != (uint *)PTR_DAT_1402f8010) && (local_res8 != (uint *)0x0)) &&
     (local_res8 + -2 != (uint *)0x0)) {
    local_res8[-2] = uVar10;
    *(undefined2 *)((longlong)local_res8 + (longlong)(int)uVar10 * 2) = 0;
  }
LAB_140179cb3:
  if ((local_res10 != (longlong *)0x0) && (*local_res10 != 0)) {
    uVar12 = *(uint *)(*local_res10 + 0x56c);
  }
  local_58 = 0;
  local_50 = 0;
  local_48 = 0;
  local_40 = 0;
  local_60 = Proud::ByteArray::vftable;
  uVar8 = FUN_1401416a0(local_res20,0x1f,uVar12,&local_res8,&local_60);
  (**(code **)(*plVar2 + 0x88))(plVar2,uVar8);
  FUN_140140df0(&local_60);
  puVar7 = local_res8;
  if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) &&
     (puVar9 = local_res8 + -2, puVar9 != (uint *)0x0)) {
    uVar8 = FUN_1400a3440();
    local_70 = uVar8;
    FUN_1400a1c30(uVar8);
    local_68 = 1;
    puVar7 = puVar7 + -1;
    *puVar7 = *puVar7 - 1;
    if (*puVar7 == 0) {
      FUN_1400a3530(puVar9);
    }
    FUN_1400d1290(uVar8);
    local_68 = 0;
  }
  local_res8 = (uint *)PTR_DAT_1402f8010;
  if (plVar1 != (longlong *)0x0) {
    plVar1 = plVar1 + 1;
    *plVar1 = *plVar1 + -1;
    uVar6 = local_80;
    if (*plVar1 == 0) {
      puVar3 = (undefined8 *)*local_res10;
      if (puVar3 != (undefined8 *)0x0) {
        (**(code **)*puVar3)(puVar3,1);
      }
      FUN_1400a3530(local_res10);
      uVar6 = local_80;
    }
  }
  FUN_1400d1290(uVar6);
  return;
}



// WARNING: Removing unreachable block (ram,0x00014017a1dc)
// WARNING: Removing unreachable block (ram,0x00014017a1eb)
// WARNING: Removing unreachable block (ram,0x00014017a1f0)
// WARNING: Removing unreachable block (ram,0x00014017a22e)
// WARNING: Removing unreachable block (ram,0x00014017a200)
// WARNING: Removing unreachable block (ram,0x00014017a21f)
// WARNING: Removing unreachable block (ram,0x00014017a211)
// WARNING: Removing unreachable block (ram,0x00014017a227)
// WARNING: Removing unreachable block (ram,0x00014017a22c)

undefined8 FUN_140179dd0(undefined8 *param_1,LPCWSTR param_2)

{
  int *piVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  int iVar6;
  DWORD DVar7;
  BOOL BVar8;
  longlong lVar9;
  undefined8 *puVar10;
  undefined8 uVar11;
  HANDLE hFile;
  undefined8 uVar12;
  undefined *puVar13;
  undefined8 *puVar14;
  undefined8 *puVar15;
  undefined *puVar16;
  undefined *puVar17;
  HANDLE pvVar18;
  undefined8 *local_res8;
  LPCWSTR local_res10;
  undefined2 local_res18 [4];
  undefined8 *local_res20;
  undefined *local_118;
  undefined8 *local_110;
  undefined8 *local_108;
  undefined8 *local_100;
  undefined8 *local_f8;
  HANDLE local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined1 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  longlong local_c0;
  undefined *local_b8;
  undefined4 local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined1 local_98;
  undefined8 local_90;
  undefined1 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined1 local_70;
  undefined *local_68 [5];
  
  local_80 = 0xfffffffffffffffe;
  local_res8 = param_1;
  local_res10 = param_2;
  local_e0 = (**(code **)(param_1[-0xe] + 0x58))();
  FUN_1400a1c30(local_e0);
  puVar4 = local_res8;
  local_d8 = 1;
  puVar14 = (undefined8 *)0x0;
  local_110 = (undefined8 *)0x0;
  local_f8 = (undefined8 *)0x0;
  local_108 = (undefined8 *)0x0;
  local_100 = (undefined8 *)0x0;
  lVar9 = param_1[0x2eb];
  puVar2 = puVar14;
  puVar3 = puVar14;
  puVar10 = local_110;
  while (local_110 = puVar10, lVar9 != 0) {
    lVar9 = FUN_140176d30(param_1 + 0x2e8,local_68);
    puVar10 = (undefined8 *)FUN_1400a34c0(0x28);
    local_res8 = puVar10;
    local_res20 = puVar10;
    if (puVar10 != (undefined8 *)0x0) {
      FUN_1400a3440();
      puVar10[2] = PTR_DAT_1402f8010;
      FUN_140003100(puVar10 + 2,lVar9);
      *(undefined4 *)(puVar10 + 3) = *(undefined4 *)(lVar9 + 8);
      puVar10[4] = *(undefined8 *)(lVar9 + 0x10);
    }
    puVar16 = local_68[0];
    puVar10[1] = puVar2;
    *puVar10 = 0;
    puVar14 = (undefined8 *)((longlong)puVar14 + 1);
    puVar15 = puVar10;
    puVar5 = puVar10;
    if (puVar2 != (undefined8 *)0x0) {
      *puVar2 = puVar10;
      puVar15 = puVar3;
      puVar5 = local_108;
    }
    local_108 = puVar5;
    local_100 = puVar10;
    local_f8 = puVar14;
    if (((local_68[0] != (undefined *)0x0) && (local_68[0] != PTR_DAT_1402f8010)) &&
       (puVar13 = local_68[0] + -8, puVar13 != (undefined *)0x0)) {
      uVar11 = FUN_1400a3440();
      local_90 = uVar11;
      FUN_1400a1c30(uVar11);
      local_88 = 1;
      piVar1 = (int *)(puVar16 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar13);
      }
      FUN_1400d1290(uVar11);
      local_88 = 0;
    }
    puVar2 = puVar10;
    puVar3 = puVar15;
    param_1 = puVar4;
    puVar10 = local_110;
    lVar9 = puVar4[0x2eb];
  }
  FUN_1400d1290(local_e0);
  local_d8 = 0;
  local_f0 = (HANDLE)0x0;
  local_e8 = 0;
  hFile = CreateFileW(local_res10,0x40000000,1,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,(HANDLE)0x0);
  pvVar18 = hFile;
  if ((hFile == (HANDLE)0xffffffffffffffff) &&
     (iVar6 = FUN_1401691b0(), hFile = (HANDLE)0x0, pvVar18 = local_f0, iVar6 < 0)) {
    for (; puVar14 != (undefined8 *)0x0; puVar14 = (undefined8 *)((longlong)puVar14 + -1)) {
      if (puVar3 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      puVar2 = (undefined8 *)*puVar3;
      FUN_1400031d0(puVar3 + 2);
      FUN_1400a3530(puVar3);
      puVar3 = puVar2;
    }
    uVar11 = 0;
  }
  else {
    local_f0 = pvVar18;
    local_d0 = 0;
    DVar7 = SetFilePointer(hFile,0,(PLONG)((longlong)&local_d0 + 4),0);
    if (DVar7 == 0xffffffff) {
      FUN_1401691b0();
    }
    local_res18[0] = 0xfeff;
    BVar8 = WriteFile(hFile,local_res18,2,(LPDWORD)&local_res8,(LPOVERLAPPED)0x0);
    if (BVar8 == 0) {
      FUN_1401691b0();
    }
    FUN_1400a3440();
    local_118 = PTR_DAT_1402f8010;
    puVar16 = PTR_DAT_1402f8010;
    while (puVar14 != (undefined8 *)0x0) {
      FUN_140176d30(&local_110,&local_b8);
      local_c8 = local_a8;
      puVar14 = (undefined8 *)FUN_140178c90(&local_c8,&local_c0,&DAT_140256e88);
      puVar16 = local_b8;
      if (local_b8 == (undefined *)0x0) {
        puVar16 = PTR_DAT_1402f8010;
      }
      uVar11 = *puVar14;
      uVar12 = FUN_1401a24e0(local_b0);
      FUN_14003c600(&local_118,L"[%s] [%s] %s\r\n",uVar12,uVar11,puVar16);
      LOCK();
      piVar1 = (int *)(local_c0 + -8);
      iVar6 = *piVar1;
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (iVar6 + -1 < 1) {
        (**(code **)(**(longlong **)(local_c0 + -0x18) + 8))();
      }
      hFile = local_f0;
      puVar16 = local_118;
      iVar6 = 0;
      puVar13 = PTR_DAT_1402f8010;
      if (local_118 != (undefined *)0x0) {
        pvVar18 = (HANDLE)0x0;
        if (local_118 != PTR_DAT_1402f8010) {
          pvVar18 = (HANDLE)(ulonglong)*(uint *)(local_118 + -8);
        }
        iVar6 = (int)pvVar18;
        puVar13 = local_118;
      }
      BVar8 = WriteFile(local_f0,puVar13,iVar6 * 2,(LPDWORD)&local_res20,(LPOVERLAPPED)0x0);
      if (BVar8 == 0) {
        FUN_1401691b0();
      }
      puVar13 = local_b8;
      puVar10 = local_110;
      puVar14 = local_f8;
      if (((local_b8 != (undefined *)0x0) && (local_b8 != PTR_DAT_1402f8010)) &&
         (puVar17 = local_b8 + -8, puVar17 != (undefined *)0x0)) {
        uVar11 = FUN_1400a3440();
        local_a0 = uVar11;
        FUN_1400a1c30(uVar11);
        local_98 = 1;
        piVar1 = (int *)(puVar13 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar17);
        }
        FUN_1400d1290(uVar11);
        local_98 = 0;
        puVar10 = local_110;
        puVar14 = local_f8;
      }
    }
    if (hFile != (HANDLE)0x0) {
      CloseHandle(hFile);
      local_f0 = (HANDLE)0x0;
    }
    if (((puVar16 != (undefined *)0x0) && (puVar16 != PTR_DAT_1402f8010)) &&
       (puVar16 + -8 != (undefined *)0x0)) {
      uVar11 = FUN_1400a3440();
      local_78 = uVar11;
      FUN_1400a1c30(uVar11);
      local_70 = 1;
      piVar1 = (int *)(puVar16 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar16 + -8);
      }
      FUN_1400d1290(uVar11);
    }
    if (puVar10 != (undefined8 *)0x0) {
      (**(code **)*puVar10)(puVar10,1);
    }
    uVar11 = 1;
  }
  return uVar11;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_14017a270(longlong *param_1)

{
  undefined *puVar1;
  int *piVar2;
  longlong *plVar3;
  undefined *puVar4;
  int iVar5;
  undefined8 uVar6;
  undefined **ppuVar7;
  longlong lVar8;
  longlong lVar9;
  longlong lVar10;
  int iVar11;
  double dVar12;
  undefined *local_res8;
  undefined1 local_res10 [8];
  undefined **local_50;
  undefined4 local_48;
  undefined2 local_44;
  undefined **local_40;
  undefined8 local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined8 local_20;
  
  dVar12 = (double)(**(code **)(param_1[0xe] + 0x1c0))();
  if (((((longlong *)param_1[699] != (longlong *)0x0) &&
       (lVar9 = *(longlong *)param_1[699], lVar9 != 0)) && (lVar9 != 0x40)) &&
     (_DAT_1402f81b8 < dVar12 - (double)param_1[0x2f4])) {
    lVar10 = 0;
    lVar8 = lVar10;
    if (lVar9 != 0) {
      lVar8 = lVar9 + -0x40;
    }
    iVar11 = *(int *)(lVar8 + 0x1a4);
    plVar3 = (longlong *)param_1[0x2a4];
    if (((plVar3 != (longlong *)0x0) && (*plVar3 != 0)) && (*plVar3 != 0x40)) {
      lVar9 = lVar10;
      if ((longlong *)param_1[0x2ae] != (longlong *)0x0) {
        lVar9 = *(longlong *)param_1[0x2ae];
      }
      local_50 = Proud::AddrPort::vftable;
      local_48 = *(undefined4 *)(lVar9 + 0xd0);
      local_44 = *(undefined2 *)(lVar9 + 0xd4);
      if (*plVar3 != 0) {
        lVar10 = *plVar3 + -0x40;
      }
      iVar5 = FUN_14019cd60(*(undefined8 *)(lVar10 + 0x108),&local_50);
      iVar11 = iVar11 + iVar5;
    }
    if ((double)param_1[0x2f5] == 0.0) {
      if (DAT_1402f8194 < iVar11) {
        param_1[0x2f5] = (longlong)dVar12;
      }
    }
    else if (DAT_1402f8194 < iVar11) {
      if (_DAT_1402f81b0 < dVar12 - (double)param_1[0x2f5]) {
        param_1[0x2f5] = (longlong)dVar12;
        FUN_1400a3440();
        local_res8 = PTR_DAT_1402f8010;
        FUN_14003c600(&local_res8,L"%d bytes in send queue",iVar11);
        local_38 = 0;
        local_30 = 0;
        local_28 = 0;
        local_20 = 0;
        local_40 = Proud::ByteArray::vftable;
        uVar6 = FUN_1401416a0(local_res10,0x25,1,&local_res8,&local_40);
        (**(code **)(*param_1 + 0x88))(param_1,uVar6);
        FUN_140140df0(&local_40);
        puVar4 = local_res8;
        if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1402f8010)) &&
           (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
          ppuVar7 = (undefined **)FUN_1400a3440();
          local_50 = ppuVar7;
          FUN_1400a1c30(ppuVar7);
          local_48 = CONCAT31(local_48._1_3_,1);
          piVar2 = (int *)(puVar4 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_1400a3530(puVar1);
          }
          FUN_1400d1290(ppuVar7);
        }
      }
    }
    else {
      param_1[0x2f5] = 0;
    }
    param_1[0x2f4] = (longlong)dVar12;
  }
  return;
}



void FUN_14017a4d0(longlong param_1,longlong *param_2)

{
  undefined8 *puVar1;
  longlong *plVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  if ((undefined8 *)*param_2 == (undefined8 *)0x0) {
    plVar2 = (longlong *)0x0;
  }
  else {
    plVar2 = *(longlong **)*param_2;
  }
  (**(code **)(*plVar2 + 8))();
  uVar3 = FUN_140176fe0(param_1 + 0x1700,param_2,*(undefined8 *)(param_1 + 0x1710),0,uVar3);
  if (*(undefined8 **)(param_1 + 0x1710) == (undefined8 *)0x0) {
    *(undefined8 *)(param_1 + 0x1708) = uVar3;
  }
  else {
    **(undefined8 **)(param_1 + 0x1710) = uVar3;
  }
  *(undefined8 *)(param_1 + 0x1710) = uVar3;
  if ((*param_2 != 0) &&
     (*(longlong *)(*param_2 + 8) = *(longlong *)(*param_2 + 8) + -1,
     *(longlong *)(*param_2 + 8) == 0)) {
    param_2 = (longlong *)*param_2;
    puVar1 = (undefined8 *)*param_2;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    FUN_1400a3530(param_2);
  }
  return;
}



undefined8 FUN_14017a590(longlong param_1,uint *param_2)

{
  uint *puVar1;
  ulonglong uVar2;
  
  uVar2 = (ulonglong)*param_2 % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (puVar1 != (uint *)0x0 && ((uint)uVar2 == puVar1[8] % *(uint *)(param_1 + 0x28)));
        puVar1 = *(uint **)(puVar1 + 4)) {
      if (*puVar1 == *param_2) {
        FUN_140177260(param_1,puVar1);
        return 1;
      }
    }
  }
  return 0;
}



void FUN_14017a600(void)

{
  FUN_140178a10();
  return;
}



uint * FUN_14017a620(longlong param_1,uint *param_2)

{
  uint *puVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  uVar2 = (ulonglong)*param_2 % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (puVar1 != (uint *)0x0 && ((uint)uVar2 == puVar1[8] % *(uint *)(param_1 + 0x28)));
        puVar1 = *(uint **)(puVar1 + 4)) {
      if (*puVar1 == *param_2) {
        return puVar1 + 2;
      }
    }
  }
  lVar3 = FUN_140178b90(param_1,param_2,uVar2);
  return (uint *)(lVar3 + 8);
}



ushort * FUN_14017a690(longlong param_1,ushort *param_2)

{
  ushort *puVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  uVar2 = (ulonglong)*param_2 % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (puVar1 = *(ushort **)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (puVar1 != (ushort *)0x0 &&
        ((uint)uVar2 == *(uint *)(puVar1 + 0x10) % *(uint *)(param_1 + 0x28)));
        puVar1 = *(ushort **)(puVar1 + 8)) {
      if (*puVar1 == *param_2) {
        return puVar1 + 4;
      }
    }
  }
  lVar3 = FUN_140178c10(param_1,param_2,uVar2);
  return (ushort *)(lVar3 + 8);
}



// WARNING: Removing unreachable block (ram,0x00014017abad)
// WARNING: Removing unreachable block (ram,0x00014017ab86)
// WARNING: Removing unreachable block (ram,0x00014017a7e9)
// WARNING: Removing unreachable block (ram,0x00014017a7f8)
// WARNING: Removing unreachable block (ram,0x00014017a87e)
// WARNING: Removing unreachable block (ram,0x00014017ab7b)
// WARNING: Removing unreachable block (ram,0x00014017a80a)
// WARNING: Removing unreachable block (ram,0x00014017a812)
// WARNING: Removing unreachable block (ram,0x00014017a81c)
// WARNING: Removing unreachable block (ram,0x00014017ab8c)
// WARNING: Removing unreachable block (ram,0x00014017a873)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_14017a700(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  uint *puVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  double dVar4;
  longlong *plVar5;
  char cVar6;
  uint uVar7;
  undefined8 uVar8;
  longlong *plVar9;
  longlong *plVar10;
  longlong *plVar11;
  longlong *plVar12;
  longlong local_res8;
  longlong *local_res10;
  longlong *local_res18;
  
  uVar8 = (**(code **)(*param_1 + 0x58))(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  FUN_1400a1c30(uVar8);
  dVar4 = (double)(**(code **)(param_1[0xe] + 0x1c0))();
  plVar12 = (longlong *)0x0;
  plVar10 = plVar12;
  if (param_1[0x2e8] != 0) {
    plVar10 = (longlong *)param_1[0x2e6];
  }
  while (plVar10 != (longlong *)0x0) {
    plVar11 = (longlong *)plVar10[1];
    plVar9 = plVar12;
    if ((plVar11 != (longlong *)0x0) && (*plVar11 != 0)) {
      plVar9 = (longlong *)(*plVar11 + -0x40);
    }
    if (dVar4 - (double)plVar9[0x29] <= DAT_1402f80e0 + 10.0) {
      plVar10 = (longlong *)plVar10[2];
    }
    else {
      local_res8 = 0;
      if (plVar11 != (longlong *)0x0) {
        *(longlong *)(plVar10[1] + 8) = plVar11[1] + 1;
        local_res8 = plVar10[1];
      }
      FUN_14017a4d0(param_1,&local_res8);
      plVar11 = (longlong *)plVar10[2];
      FUN_140177260(param_1 + 0x2e4,plVar10,0);
      plVar10 = plVar11;
    }
  }
  plVar10 = plVar12;
  if (param_1[0x2d9] != 0) {
    plVar10 = (longlong *)param_1[0x2d7];
  }
  while (plVar10 != (longlong *)0x0) {
    if (plVar10 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    local_res18 = (longlong *)0x0;
    if (plVar10[1] != 0) {
      *(longlong *)(plVar10[1] + 8) = *(longlong *)(plVar10[1] + 8) + 1;
      local_res18 = (longlong *)plVar10[1];
    }
    plVar11 = local_res18;
    plVar9 = plVar12;
    if (local_res18 != (longlong *)0x0) {
      plVar9 = (longlong *)*local_res18;
    }
    if ((int)plVar9[0xd0] == 0) {
      if (plVar10 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      plVar9 = (longlong *)plVar10[2];
      FUN_140177260(param_1 + 0x2d5,plVar10,0);
      plVar10 = plVar12;
      if (plVar11 != (longlong *)0x0) {
        plVar10 = (longlong *)*plVar11;
      }
      uVar7 = (**(code **)(*plVar10 + 8))();
      uVar3 = (ulonglong)uVar7 % (ulonglong)*(uint *)(param_1 + 0x2cf);
      if (param_1[0x2cb] != 0) {
        puVar1 = *(uint **)(param_1[0x2cb] + uVar3 * 8);
        while( true ) {
          if ((puVar1 == (uint *)0x0) || ((uint)uVar3 != puVar1[8] % *(uint *)(param_1 + 0x2cf)))
          goto LAB_14017a9ce;
          if (*puVar1 == uVar7) break;
          puVar1 = *(uint **)(puVar1 + 4);
        }
        FUN_140177260(param_1 + 0x2ca,puVar1,0);
      }
    }
    else {
      plVar9 = plVar12;
      if (plVar10 != (longlong *)0x0) {
        plVar9 = (longlong *)plVar10[2];
      }
    }
LAB_14017a9ce:
    plVar5 = local_res18;
    plVar10 = plVar9;
    if (plVar11 != (longlong *)0x0) {
      plVar11 = plVar11 + 1;
      *plVar11 = *plVar11 + -1;
      if (*plVar11 == 0) {
        puVar2 = (undefined8 *)*local_res18;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        FUN_1400a3530(plVar5);
      }
    }
  }
  plVar10 = (longlong *)param_1[0x2e1];
  do {
    if (plVar10 == (longlong *)0x0) {
      FUN_1400d1290(uVar8);
      return;
    }
    if (plVar10 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    local_res10 = (longlong *)0x0;
    if (plVar10[2] != 0) {
      *(longlong *)(plVar10[2] + 8) = *(longlong *)(plVar10[2] + 8) + 1;
      local_res10 = (longlong *)plVar10[2];
    }
    plVar11 = local_res10;
    plVar9 = plVar12;
    if (local_res10 != (longlong *)0x0) {
      plVar9 = (longlong *)*local_res10;
    }
    cVar6 = (**(code **)(*plVar9 + 0x10))();
    if (cVar6 == '\0') {
LAB_14017ab2a:
      plVar9 = (longlong *)*plVar10;
    }
    else {
      plVar9 = plVar12;
      if (plVar11 != (longlong *)0x0) {
        plVar9 = (longlong *)*plVar11;
      }
      plVar11 = local_res10;
      if ((char)plVar9[0x10] != '\0') goto LAB_14017ab2a;
      plVar9 = plVar12;
      if (local_res10 != (longlong *)0x0) {
        plVar9 = (longlong *)*local_res10;
      }
      if ((char)plVar9[8] != '\0') goto LAB_14017ab2a;
      plVar9 = (longlong *)*plVar10;
      if (plVar10 == (longlong *)param_1[0x2e1]) {
        param_1[0x2e1] = (longlong)plVar9;
      }
      else {
        *(longlong **)plVar10[1] = plVar9;
      }
      if (plVar10 == (longlong *)param_1[0x2e2]) {
        param_1[0x2e2] = plVar10[1];
      }
      else {
        *(longlong *)(*plVar10 + 8) = plVar10[1];
      }
      FUN_140175060(param_1 + 0x2e0,plVar10);
      plVar11 = local_res10;
    }
    plVar5 = local_res10;
    plVar10 = plVar9;
    if (plVar11 != (longlong *)0x0) {
      plVar11 = plVar11 + 1;
      *plVar11 = *plVar11 + -1;
      if (*plVar11 == 0) {
        puVar2 = (undefined8 *)*local_res10;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        FUN_1400a3530(plVar5);
      }
    }
  } while( true );
}



void FUN_14017abe0(longlong *param_1,int *param_2,byte *param_3,byte *param_4,int *param_5,
                  int *param_6)

{
  char cVar1;
  byte bVar2;
  int iVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  int *piVar7;
  longlong *plVar8;
  int iVar9;
  undefined4 *puVar10;
  undefined8 uVar11;
  undefined4 *puVar12;
  undefined4 *puVar13;
  int *piVar14;
  int iVar15;
  int iVar16;
  int iVar17;
  ulonglong local_res10;
  byte *local_res18;
  byte *local_res20;
  undefined8 in_stack_fffffffffffffdd8;
  undefined4 uVar18;
  int *local_218;
  int *local_210;
  int local_208;
  undefined8 local_200;
  int local_1f8;
  undefined8 local_1e8;
  undefined8 local_1e0;
  undefined8 local_1d8;
  undefined8 local_1d0;
  undefined8 local_1c8;
  undefined8 local_1b0;
  longlong local_188;
  undefined1 local_180;
  int *local_178;
  undefined8 local_170;
  undefined1 local_168 [8];
  undefined1 local_160 [8];
  undefined1 local_158 [8];
  undefined **local_150;
  undefined8 local_148;
  undefined8 local_140;
  undefined8 local_138;
  undefined8 local_130;
  undefined **local_128;
  undefined8 local_120;
  undefined8 local_118;
  undefined8 local_110;
  undefined8 local_108;
  undefined **local_100;
  undefined8 local_f8;
  undefined8 local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_c8;
  
  uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffdd8 >> 0x20);
  local_c8 = 0xfffffffffffffffe;
  iVar15 = *param_2;
  local_res18 = param_3;
  local_res20 = param_4;
  if (iVar15 != 0) {
    if (iVar15 == 1) {
      piVar7 = param_2 + 2;
      local_1f8 = (int)(*piVar7 + (*piVar7 >> 0x1f & 7U)) >> 3;
      local_res10 = local_res10 & 0xffffffffffffff00;
      local_218 = piVar7;
      local_188 = FUN_140176af0(param_1,param_2[0xc]);
      (**(code **)(param_1[0xf] + 0x18))();
      iVar15 = 0;
      local_200 = (int *)((ulonglong)local_200._4_4_ << 0x20);
      local_178 = piVar7;
      cVar1 = FUN_140185e40(piVar7,&local_200);
      if (cVar1 != '\0') {
        for (; local_208 = iVar15, iVar15 < (int)param_1[9]; iVar15 = iVar15 + 1) {
          if ((iVar15 < 0) || ((int)param_1[9] <= iVar15)) {
                    // WARNING: Subroutine does not return
            FUN_1400a2700();
          }
          plVar8 = *(longlong **)(param_1[8] + (longlong)iVar15 * 8);
          FUN_140185160(local_178,local_1f8);
          *(undefined2 *)(plVar8 + 1) = 0;
          bVar2 = (**(code **)(*plVar8 + 0x10))(plVar8,piVar7,local_188);
          local_res10 = CONCAT71(local_res10._1_7_,(byte)local_res10 | bVar2);
          *param_3 = *param_3 | *(byte *)(plVar8 + 1);
          *param_4 = *param_4 | *(byte *)((longlong)plVar8 + 9);
          if (((bVar2 != 0) && (plVar8 != param_1 + 0x307)) && (plVar8 != param_1 + 0x2fe)) {
            *param_5 = *param_5 + 1;
          }
        }
        if ((byte)local_res10 != '\0') {
          return;
        }
      }
      FUN_140185160(local_178,local_1f8);
      if (param_1[0x2b0] == 0) {
        return;
      }
      *param_6 = *param_6 + 1;
      (**(code **)(*(longlong *)param_1[0x2b0] + 0x28))
                ((longlong *)param_1[0x2b0],(ulonglong)local_200 & 0xffffffff);
      return;
    }
    if (iVar15 != 2) {
      return;
    }
    piVar7 = param_2 + 2;
    local_218 = piVar7;
    uVar4 = FUN_140176af0(param_1,param_2[0xc]);
    (**(code **)(param_1[0xf] + 0x18))();
    if (param_1[0x2b0] == 0) {
      return;
    }
    cVar1 = FUN_140185b30(piVar7,&local_res10);
    if (cVar1 != '\0') {
      iVar15 = *piVar7;
      iVar3 = FUN_1401450b0(piVar7);
      if ((int)local_res10 == iVar3 - ((int)((iVar15 >> 0x1f & 7U) + iVar15) >> 3)) {
        *(undefined1 *)(param_1[0x2b0] + 8) = 0;
        *(undefined1 *)(param_1[0x2b0] + 9) = 0;
        FUN_140140af0(&local_1e8);
        local_1e8 = (undefined **)CONCAT44(param_2[0xc],(undefined4)local_1e8);
        local_1e8 = (undefined **)CONCAT71(local_1e8._1_7_,(char)param_2[0x12]);
        iVar15 = *piVar7;
        local_1b0 = uVar4;
        lVar5 = FUN_14016aa90(piVar7);
        (**(code **)(*(longlong *)param_1[0x2b0] + 0x30))
                  ((longlong *)param_1[0x2b0],param_2[0xc],&local_1e8,
                   lVar5 + ((int)(iVar15 + (iVar15 >> 0x1f & 7U)) >> 3),
                   CONCAT44(uVar18,(int)local_res10));
        *param_3 = *param_3 | *(byte *)(param_1[0x2b0] + 8);
        *param_4 = *param_4 | *(byte *)(param_1[0x2b0] + 9);
        *param_5 = *param_5 + 1;
        return;
      }
    }
    local_188 = FUN_1400a34c0(0x60);
    if (local_188 == 0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_140141470(local_188);
    }
    puVar10 = (undefined4 *)0x0;
    FUN_14008ca00(&local_res10,uVar4);
    puVar12 = puVar10;
    if (local_res10 != 0) {
      puVar12 = *(undefined4 **)(local_res10 + 0x38);
    }
    *puVar12 = 0x1f;
    if (local_res10 != 0) {
      puVar10 = *(undefined4 **)(local_res10 + 0x38);
    }
    FUN_14001f680(puVar10 + 4,L"Invalid payload size in User Message!");
    local_170 = 0;
    FUN_140141570(&local_170,&local_res10);
    (**(code **)(*param_1 + 0x80))(param_1,&local_170);
    FUN_14008c980(&local_res10);
    return;
  }
  (**(code **)(param_1[0xf] + 0x18))();
  if (param_1[0x2b0] == 0) {
    return;
  }
  local_200 = param_2 + 0x14;
  *(undefined1 *)(param_1[0x2b0] + 8) = 0;
  *(undefined1 *)(param_1[0x2b0] + 9) = 0;
  switch(*local_200) {
  case 1:
    iVar15 = FUN_140145040(param_2 + 0x28);
    uVar6 = FUN_140145070(param_2 + 0x28);
    local_1e8 = Proud::CFastArray<>::vftable;
    uVar4 = 0;
    local_1e0 = 0;
    local_1d8 = 0;
    local_1d0 = 0;
    local_1c8 = 0;
    if (iVar15 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_14003cda0(&local_1e8,iVar15);
    uVar11 = local_1d8;
    if ((int)local_1d0 == 0) {
      uVar11 = uVar4;
    }
    FUN_1400224d0(uVar11,uVar6,(longlong)iVar15);
    local_1e8 = Proud::ByteArray::vftable;
    local_res10 = FUN_1400a34c0(0x60);
    uVar6 = uVar4;
    if (local_res10 != 0) {
      uVar6 = FUN_140141470(local_res10);
    }
    plVar8 = (longlong *)FUN_14008ca00(local_158,uVar6);
    if (*plVar8 != 0) {
      uVar4 = *(undefined8 *)(*plVar8 + 0x38);
    }
    (**(code **)(*(longlong *)param_1[0x2b0] + 0x38))((longlong *)param_1[0x2b0],uVar4,&local_1e8);
    FUN_14008c980(local_158);
    FUN_140140df0(&local_1e8);
    break;
  case 2:
    FUN_1400a3440();
    local_210 = (int *)PTR_DAT_1402f8010;
    iVar3 = FUN_1400a32c0(&DAT_14027d1a0);
    local_res10 = CONCAT44(local_res10._4_4_,iVar3);
    puVar10 = (undefined4 *)0x0;
    iVar16 = 0;
    iVar15 = iVar16;
    if ((local_210 != (int *)0x0) && (local_210 != (int *)PTR_DAT_1402f8010)) {
      iVar15 = local_210[-2];
    }
    iVar17 = 0;
    iVar9 = iVar3;
    if (((iVar3 <= iVar15) && (iVar9 = iVar17, local_210 != (int *)0x0)) &&
       (local_210 != (int *)PTR_DAT_1402f8010)) {
      iVar9 = local_210[-2];
    }
    iVar15 = 1;
    if (1 < iVar9) {
      iVar15 = iVar9;
    }
    puVar12 = puVar10;
    if ((local_210 != (int *)0x0) &&
       (puVar12 = (undefined4 *)0x0, local_210 != (int *)PTR_DAT_1402f8010)) {
      puVar12 = (undefined4 *)(ulonglong)(uint)local_210[-2];
    }
    if ((int)puVar12 < iVar15) {
      if (local_210 == (int *)0x0) {
        local_210 = (int *)PTR_DAT_1402f8010;
      }
      if (iVar15 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if (iVar15 == 0) {
        FUN_1400031d0(&local_210);
      }
      else {
        iVar9 = iVar17;
        if ((local_210 != (int *)0x0) && (local_210 != (int *)PTR_DAT_1402f8010)) {
          iVar9 = local_210[-2];
        }
        if (iVar15 != iVar9) {
          piVar7 = (int *)FUN_1400a34c0((longlong)iVar15 * 2 + 10);
          if (piVar7 != (int *)0x0) {
            *piVar7 = 0;
            piVar7[1] = 1;
          }
          *piVar7 = iVar15;
          iVar3 = iVar17;
          if ((local_210 != (int *)0x0) && (local_210 != (int *)PTR_DAT_1402f8010)) {
            iVar3 = local_210[-2];
          }
          piVar14 = (int *)PTR_DAT_1402f8010;
          if (iVar15 < iVar3) {
LAB_14017b1d4:
            if (local_210 != (int *)0x0) {
              piVar14 = local_210;
            }
          }
          else {
            iVar15 = iVar16;
            if (local_210 != (int *)0x0) {
              if (local_210 != (int *)PTR_DAT_1402f8010) {
                iVar15 = local_210[-2];
              }
              goto LAB_14017b1d4;
            }
          }
          FUN_1400a32f0(piVar7 + 2,piVar14,iVar15);
          FUN_1400031d0(&local_210);
          local_210 = piVar7 + 2;
          iVar3 = (int)local_res10;
        }
      }
    }
    FUN_140002e30(&local_210);
    piVar7 = local_210;
    if (local_210 == (int *)0x0) {
      piVar7 = (int *)PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(piVar7,&DAT_14027d1a0,iVar3);
    piVar7 = local_210;
    if (local_210 == (int *)0x0) {
      piVar7 = (int *)PTR_DAT_1402f8010;
    }
    iVar3 = FUN_1400a32c0(piVar7);
    iVar15 = 0;
    if (0 < iVar3) {
      iVar15 = iVar3;
    }
    if ((local_210 != (int *)0x0) && (local_210 != (int *)PTR_DAT_1402f8010)) {
      iVar17 = local_210[-2];
    }
    if ((iVar15 < iVar17) || (iVar15 = iVar16, local_210 == (int *)0x0)) {
LAB_14017b278:
      if (((local_210 != (int *)PTR_DAT_1402f8010) && (local_210 != (int *)0x0)) &&
         (local_210 + -2 != (int *)0x0)) {
        local_210[-2] = iVar15;
        *(undefined2 *)((longlong)local_210 + (longlong)iVar15 * 2) = 0;
      }
    }
    else if (local_210 != (int *)PTR_DAT_1402f8010) {
      iVar15 = local_210[-2];
      goto LAB_14017b278;
    }
    local_120 = 0;
    local_118 = 0;
    local_110 = 0;
    local_108 = 0;
    local_128 = Proud::ByteArray::vftable;
    puVar12 = puVar10;
    if (*(longlong *)(param_2 + 0x16) != 0) {
      puVar12 = *(undefined4 **)(*(longlong *)(param_2 + 0x16) + 0x38);
    }
    FUN_1401416a0(&local_218,*puVar12,1,&local_210,&local_128);
    FUN_140140df0(&local_128);
    piVar7 = local_210;
    if (((local_210 != (int *)0x0) && (local_210 != (int *)PTR_DAT_1402f8010)) &&
       (piVar14 = local_210 + -2, piVar14 != (int *)0x0)) {
      uVar4 = FUN_1400a3440();
      local_180 = 0;
      local_188 = uVar4;
      FUN_1400a1c30(uVar4);
      local_180 = 1;
      piVar7 = piVar7 + -1;
      *piVar7 = *piVar7 + -1;
      if (*piVar7 == 0) {
        FUN_1400a3530(piVar14);
      }
      FUN_1400d1290(uVar4);
      param_3 = local_res18;
    }
    local_210 = (int *)PTR_DAT_1402f8010;
    puVar12 = puVar10;
    if (local_218 != (int *)0x0) {
      puVar12 = *(undefined4 **)(local_218 + 0xe);
    }
    puVar12[8] = param_2[0x40];
    *(short *)(puVar12 + 9) = (short)param_2[0x41];
    puVar12 = puVar10;
    if (local_218 != (int *)0x0) {
      puVar12 = *(undefined4 **)(local_218 + 0xe);
    }
    puVar12[2] = param_2[0x42];
    local_1e0 = 0;
    local_1d8 = 0;
    local_1d0 = 0;
    local_1c8 = 0;
    local_1e8 = Proud::ByteArray::vftable;
    if (*(longlong *)(param_2 + 0x28) != 0) {
      iVar15 = *(int *)(*(longlong *)(param_2 + 0x28) + 0x18);
LAB_14017b44b:
      if (iVar15 < 1) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    if (*(longlong *)(param_2 + 0x2a) != 0) {
      if (*(longlong *)(param_2 + 0x2a) == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      iVar15 = param_2[0x2c];
      goto LAB_14017b44b;
    }
    if (local_218 != (int *)0x0) {
      puVar10 = *(undefined4 **)(local_218 + 0xe);
    }
    (**(code **)(*(longlong *)param_1[0x2b0] + 0x38))((longlong *)param_1[0x2b0],puVar10,&local_1e8)
    ;
    FUN_140140df0(&local_1e8);
    FUN_14008c980(&local_218);
    break;
  case 3:
    uVar4 = 0;
    if (*(longlong *)(param_2 + 0x16) != 0) {
      uVar4 = *(undefined8 *)(*(longlong *)(param_2 + 0x16) + 0x38);
    }
    (**(code **)(*(longlong *)param_1[0x2b0] + 0x40))((longlong *)param_1[0x2b0],uVar4);
    break;
  default:
    goto switchD_14017afcb_caseD_4;
  case 8:
    (**(code **)(*(longlong *)param_1[0x2b0] + 0x48))
              ((longlong *)param_1[0x2b0],param_2[0x2f],param_2[0x2e],param_2[0x3c],param_2 + 0x32);
    break;
  case 9:
    (**(code **)(*(longlong *)param_1[0x2b0] + 0x50))
              ((longlong *)param_1[0x2b0],param_2[0x2f],param_2[0x2e],param_2[0x3c]);
    FUN_1401768e0(param_1,param_2[0x2f]);
    break;
  case 10:
    (**(code **)(*(longlong *)param_1[0x2b0] + 0x58))((longlong *)param_1[0x2b0],param_2[0x30],0);
    break;
  case 0xb:
    puVar10 = (undefined4 *)0x0;
    if (*(longlong *)(param_2 + 0x16) != 0) {
      puVar10 = *(undefined4 **)(*(longlong *)(param_2 + 0x16) + 0x38);
    }
    (**(code **)(*(longlong *)param_1[0x2b0] + 0x58))
              ((longlong *)param_1[0x2b0],param_2[0x30],*puVar10);
    break;
  case 0xd:
    if (param_1[0x2b0] != 0) {
      puVar10 = (undefined4 *)0x0;
      if (*(longlong *)(param_2 + 0x16) != 0) {
        puVar10 = *(undefined4 **)(*(longlong *)(param_2 + 0x16) + 0x38);
      }
      (**(code **)(*(longlong *)param_1[0x2b0] + 0x60))((longlong *)param_1[0x2b0],*puVar10);
    }
    break;
  case 0xe:
    (**(code **)(*(longlong *)param_1[0x2b0] + 0x68))();
    break;
  case 0x14:
    puVar10 = (undefined4 *)0x0;
    local_f8 = 0;
    local_f0 = 0;
    local_e8 = 0;
    local_e0 = 0;
    local_100 = Proud::ByteArray::vftable;
    lVar5 = *(longlong *)(param_2 + 0x16);
    puVar13 = puVar10;
    puVar12 = puVar10;
    if (lVar5 != 0) {
      puVar13 = *(undefined4 **)(lVar5 + 0x38);
      puVar12 = *(undefined4 **)(lVar5 + 0x38);
    }
    plVar8 = (longlong *)FUN_1401416a0(local_160,*puVar13,param_2[0x30],puVar12 + 4,&local_100);
    if (*plVar8 != 0) {
      puVar10 = *(undefined4 **)(*plVar8 + 0x38);
    }
    (**(code **)(*(longlong *)param_1[0x2b0] + 8))((longlong *)param_1[0x2b0],puVar10);
    FUN_14008c980(local_160);
    FUN_140140df0(&local_100);
    break;
  case 0x15:
    puVar10 = (undefined4 *)0x0;
    local_148 = 0;
    local_140 = 0;
    local_138 = 0;
    local_130 = 0;
    local_150 = Proud::ByteArray::vftable;
    lVar5 = *(longlong *)(param_2 + 0x16);
    puVar13 = puVar10;
    puVar12 = puVar10;
    if (lVar5 != 0) {
      puVar13 = *(undefined4 **)(lVar5 + 0x38);
      puVar12 = *(undefined4 **)(lVar5 + 0x38);
    }
    plVar8 = (longlong *)FUN_1401416a0(local_168,*puVar13,param_2[0x30],puVar12 + 4,&local_150);
    if (*plVar8 != 0) {
      puVar10 = *(undefined4 **)(*plVar8 + 0x38);
    }
    (**(code **)(*(longlong *)param_1[0x2b0] + 0x10))((longlong *)param_1[0x2b0],puVar10);
    FUN_14008c980(local_168);
    FUN_140140df0(&local_150);
  }
  *param_3 = *(byte *)(param_1[0x2b0] + 8);
  *param_4 = *(byte *)(param_1[0x2b0] + 9);
  *param_6 = *param_6 + 1;
switchD_14017afcb_caseD_4:
  return;
}



// WARNING: Removing unreachable block (ram,0x00014017b849)
// WARNING: Removing unreachable block (ram,0x00014017b7c3)
// WARNING: Removing unreachable block (ram,0x00014017b7d3)
// WARNING: Removing unreachable block (ram,0x00014017b854)
// WARNING: Removing unreachable block (ram,0x00014017b7e7)
// WARNING: Removing unreachable block (ram,0x00014017b7ef)
// WARNING: Removing unreachable block (ram,0x00014017b7f9)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_14017b740(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 local_res8;
  longlong lVar3;
  
  lVar2 = 0;
  if (*(longlong *)(param_1 + 0x1740) != 0) {
    lVar2 = *(longlong *)(param_1 + 0x1730);
  }
  while (lVar2 != 0) {
    local_res8 = 0;
    if (*(longlong *)(lVar2 + 8) != 0) {
      *(longlong *)(*(longlong *)(lVar2 + 8) + 8) = *(longlong *)(*(longlong *)(lVar2 + 8) + 8) + 1;
      local_res8 = *(undefined8 *)(lVar2 + 8);
    }
    lVar3 = lVar2;
    FUN_14017a4d0(param_1,&local_res8);
    lVar1 = *(longlong *)(lVar2 + 0x10);
    FUN_140177260(param_1 + 0x1720,lVar2,0,param_4,lVar3);
    lVar2 = lVar1;
  }
  FUN_140178a10(param_1 + 0x1720);
  return;
}



void FUN_14017b890(longlong param_1)

{
  FUN_140178a10(param_1 + 0x16a8);
  return;
}



undefined8 FUN_14017b8a0(longlong param_1,uint *param_2,undefined8 param_3)

{
  uint *puVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  
  uVar2 = (ulonglong)*param_2 % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (puVar1 != (uint *)0x0 && ((uint)uVar2 == puVar1[8] % *(uint *)(param_1 + 0x28)));
        puVar1 = *(uint **)(puVar1 + 4)) {
      if (*puVar1 == *param_2) {
        return 0;
      }
    }
  }
  uVar3 = FUN_14017a620(param_1,param_2);
  FUN_14016b650(uVar3,param_3);
  return 1;
}



undefined8 FUN_14017b930(longlong param_1,ushort *param_2,undefined8 param_3)

{
  ushort *puVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  
  uVar2 = (ulonglong)*param_2 % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (puVar1 = *(ushort **)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (puVar1 != (ushort *)0x0 &&
        ((uint)uVar2 == *(uint *)(puVar1 + 0x10) % *(uint *)(param_1 + 0x28)));
        puVar1 = *(ushort **)(puVar1 + 8)) {
      if (*puVar1 == *param_2) {
        return 0;
      }
    }
  }
  uVar3 = FUN_14017a690(param_1,param_2);
  FUN_14016b650(uVar3,param_3);
  return 1;
}



void FUN_14017b9c0(longlong *param_1)

{
  undefined8 *puVar1;
  void *pvVar2;
  
  if (*param_1 != 0) {
    *(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1;
    if (*(longlong *)(*param_1 + 8) == 0) {
      puVar1 = (undefined8 *)*param_1;
      pvVar2 = (void *)*puVar1;
      if (pvVar2 != (void *)0x0) {
        FUN_140148eb0((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_1400a3530(puVar1);
    }
  }
  return;
}



void FUN_14017ba30(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  void *pvVar2;
  undefined8 *puVar3;
  
  lVar1 = *param_2;
  if (lVar1 != *param_1) {
    if (lVar1 != 0) {
      *(longlong *)(*param_2 + 8) = *(longlong *)(lVar1 + 8) + 1;
    }
    puVar3 = (undefined8 *)0x0;
    if ((*param_1 != 0) &&
       (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
       *(longlong *)(*param_1 + 8) == 0)) {
      puVar3 = (undefined8 *)*param_1;
    }
    *param_1 = *param_2;
    if (puVar3 != (undefined8 *)0x0) {
      pvVar2 = (void *)*puVar3;
      if (pvVar2 != (void *)0x0) {
        FUN_140148eb0((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_1400a3530(puVar3);
    }
  }
  return;
}



void FUN_14017bac0(longlong param_1)

{
  undefined8 *puVar1;
  void *pvVar2;
  
  if (*(longlong *)(param_1 + 8) != 0) {
    *(longlong *)(*(longlong *)(param_1 + 8) + 8) =
         *(longlong *)(*(longlong *)(param_1 + 8) + 8) + -1;
    if (*(longlong *)(*(longlong *)(param_1 + 8) + 8) == 0) {
      puVar1 = *(undefined8 **)(param_1 + 8);
      pvVar2 = (void *)*puVar1;
      if (pvVar2 != (void *)0x0) {
        FUN_140148eb0((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_1400a3530(puVar1);
    }
  }
  return;
}



void FUN_14017bb30(longlong param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  if (((longlong *)*param_2 == (longlong *)0x0) || (lVar2 = *(longlong *)*param_2, lVar2 == 0)) {
    lVar2 = 0;
  }
  else {
    lVar2 = lVar2 + -0x40;
  }
  FUN_14017b930(param_1 + 0x1720,lVar2 + 0x134,param_2,param_4,0xfffffffffffffffe);
  *(undefined8 *)(lVar2 + 0x120) = 0;
  uVar3 = (**(code **)(*(longlong *)(param_1 + 0x70) + 0x1c0))();
  *(undefined8 *)(lVar2 + 0x148) = uVar3;
  FUN_1401bc650(lVar2);
  if ((*param_2 != 0) &&
     (*(longlong *)(*param_2 + 8) = *(longlong *)(*param_2 + 8) + -1,
     *(longlong *)(*param_2 + 8) == 0)) {
    param_2 = (longlong *)*param_2;
    puVar1 = (undefined8 *)*param_2;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    FUN_1400a3530(param_2);
  }
  return;
}



ulonglong FUN_14017bc00(longlong param_1,ulonglong *param_2)

{
  uint uVar1;
  uint uVar2;
  longlong *plVar3;
  uint *puVar4;
  undefined8 *puVar5;
  ulonglong uVar6;
  longlong lVar7;
  ulonglong uVar8;
  longlong lVar9;
  undefined8 local_res8;
  ulonglong *local_res10;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined8 uVar10;
  
  uVar10 = 0xfffffffffffffffe;
  local_res10 = param_2;
  (**(code **)(*(longlong *)(param_1 + 0x78) + 0x10))();
  plVar3 = (longlong *)*param_2;
  lVar9 = 0;
  lVar7 = lVar9;
  if (plVar3 != (longlong *)0x0) {
    lVar7 = *plVar3;
  }
  if ((*(longlong **)(lVar7 + 0x18) != (longlong *)0x0) && (**(longlong **)(lVar7 + 0x18) != 0)) {
    lVar7 = lVar9;
    if (plVar3 != (longlong *)0x0) {
      lVar7 = *plVar3;
    }
    if (*(char *)(lVar7 + 0x608) == '\0') {
      lVar7 = lVar9;
      if (plVar3 != (longlong *)0x0) {
        lVar7 = *plVar3;
      }
      local_res18 = 0;
      FUN_14016b650(&local_res18,lVar7 + 0x18);
      FUN_14017bb30(param_1,&local_res18);
    }
    else {
      lVar7 = lVar9;
      if (plVar3 != (longlong *)0x0) {
        lVar7 = *plVar3;
      }
      local_res8 = 0;
      FUN_14016b650(&local_res8,lVar7 + 0x18);
      FUN_14017a4d0(param_1,&local_res8);
    }
    local_res20 = 0;
    lVar7 = lVar9;
    if ((longlong *)*param_2 != (longlong *)0x0) {
      lVar7 = *(longlong *)*param_2;
    }
    FUN_14016b650(lVar7 + 0x18);
  }
  lVar7 = lVar9;
  if ((longlong *)*param_2 != (longlong *)0x0) {
    lVar7 = *(longlong *)*param_2;
  }
  *(undefined8 *)(lVar7 + 0x670) = 0;
  if ((longlong *)*param_2 != (longlong *)0x0) {
    lVar9 = *(longlong *)*param_2;
  }
  uVar1 = *(uint *)(lVar9 + 0x56c);
  uVar2 = *(uint *)(param_1 + 0x1678);
  uVar8 = (ulonglong)uVar1 / (ulonglong)uVar2;
  uVar6 = (ulonglong)uVar1 % (ulonglong)uVar2;
  if (*(longlong *)(param_1 + 0x1658) != 0) {
    puVar4 = *(uint **)(*(longlong *)(param_1 + 0x1658) + uVar6 * 8);
    while( true ) {
      if ((puVar4 == (uint *)0x0) ||
         (uVar8 = (ulonglong)puVar4[8] / (ulonglong)uVar2, (uint)uVar6 != puVar4[8] % uVar2))
      goto LAB_14017bd62;
      if (*puVar4 == uVar1) break;
      puVar4 = *(uint **)(puVar4 + 4);
    }
    uVar8 = FUN_140177260(param_1 + 0x1650,puVar4,0,uVar6,uVar10);
  }
LAB_14017bd62:
  if (*param_2 != 0) {
    *(longlong *)(*param_2 + 8) = *(longlong *)(*param_2 + 8) + -1;
    uVar8 = *param_2;
    if (*(longlong *)(uVar8 + 8) == 0) {
      plVar3 = (longlong *)*param_2;
      puVar5 = (undefined8 *)*plVar3;
      if (puVar5 != (undefined8 *)0x0) {
        (**(code **)*puVar5)(puVar5,1);
      }
      uVar8 = FUN_1400a3530(plVar3);
    }
  }
  return uVar8;
}



void FUN_14017bdb0(longlong param_1,longlong *param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  longlong lVar4;
  undefined8 local_res8;
  longlong *local_res10;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined8 local_28;
  undefined8 local_20;
  
  local_20 = 0xfffffffffffffffe;
  local_res10 = param_2;
  (**(code **)(*(longlong *)(param_1 + 0x78) + 0x10))();
  plVar1 = (longlong *)*param_2;
  lVar4 = 0;
  lVar3 = lVar4;
  if (plVar1 != (longlong *)0x0) {
    lVar3 = *plVar1;
  }
  if (*(char *)(lVar3 + 0x684) == '\0') {
    lVar3 = lVar4;
    if (plVar1 != (longlong *)0x0) {
      lVar3 = *plVar1;
    }
    if (*(longlong *)(lVar3 + 0x670) == param_1) {
      lVar3 = lVar4;
      if (plVar1 != (longlong *)0x0) {
        lVar3 = *plVar1;
      }
      if ((*(longlong **)(lVar3 + 0x18) != (longlong *)0x0) && (**(longlong **)(lVar3 + 0x18) != 0))
      {
        lVar3 = lVar4;
        if (plVar1 != (longlong *)0x0) {
          lVar3 = *plVar1;
        }
        if (*(char *)(lVar3 + 0x608) == '\0') {
          lVar3 = lVar4;
          if (plVar1 != (longlong *)0x0) {
            lVar3 = *plVar1;
          }
          local_res18 = 0;
          FUN_14016b650(&local_res18,lVar3 + 0x18);
          FUN_14017bb30(param_1,&local_res18);
        }
        else {
          lVar3 = lVar4;
          if (plVar1 != (longlong *)0x0) {
            lVar3 = *plVar1;
          }
          local_res8 = 0;
          FUN_14016b650(&local_res8,lVar3 + 0x18);
          FUN_14017a4d0(param_1,&local_res8);
        }
        local_res20 = 0;
        lVar3 = lVar4;
        if ((longlong *)*param_2 != (longlong *)0x0) {
          lVar3 = *(longlong *)*param_2;
        }
        FUN_14016b650(lVar3 + 0x18,&local_res20);
      }
      lVar3 = lVar4;
      if ((longlong *)*param_2 != (longlong *)0x0) {
        lVar3 = *(longlong *)*param_2;
      }
      *(undefined8 *)(lVar3 + 0x670) = 0;
      lVar3 = lVar4;
      if ((longlong *)*param_2 != (longlong *)0x0) {
        lVar3 = *(longlong *)*param_2;
      }
      *(undefined1 *)(lVar3 + 0x684) = 1;
      local_28 = 0;
      lVar3 = lVar4;
      if ((longlong *)*param_2 != (longlong *)0x0) {
        lVar3 = *(longlong *)*param_2;
      }
      FUN_140176e00(lVar3 + 0x28,&local_28);
      if ((longlong *)*param_2 != (longlong *)0x0) {
        lVar4 = *(longlong *)*param_2;
      }
      FUN_14017b8a0(param_1 + 0x16a8,lVar4 + 0x56c,param_2);
    }
    if (*param_2 == 0) {
      return;
    }
    lVar4 = *(longlong *)(*param_2 + 8);
  }
  else {
    if (plVar1 == (longlong *)0x0) {
      return;
    }
    lVar4 = plVar1[1];
  }
  *(longlong *)(*param_2 + 8) = lVar4 + -1;
  if (*(longlong *)(*param_2 + 8) == 0) {
    param_2 = (longlong *)*param_2;
    puVar2 = (undefined8 *)*param_2;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    FUN_1400a3530(param_2);
  }
  return;
}



undefined8 * FUN_14017bf90(longlong *param_1,undefined8 *param_2,uint param_3)

{
  uint uVar1;
  uint *puVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  
  uVar5 = 0xfffffffffffffffe;
  uVar4 = (**(code **)(*param_1 + 0x58))();
  uVar6 = uVar4;
  FUN_1400a1c30(uVar4);
  *param_2 = 0;
  uVar1 = *(uint *)(param_1 + 0xc1);
  uVar3 = (ulonglong)param_3 % (ulonglong)uVar1;
  if (param_1[0xbd] != 0) {
    puVar2 = *(uint **)(param_1[0xbd] + uVar3 * 8);
    while( true ) {
      if ((puVar2 == (uint *)0x0) || ((uint)uVar3 != puVar2[8] % uVar1)) goto LAB_14017c039;
      if (*puVar2 == param_3) break;
      puVar2 = *(uint **)(puVar2 + 4);
    }
    FUN_14017ba30(param_2,puVar2 + 2,uVar3,(ulonglong)uVar1,uVar5,uVar6,1);
  }
LAB_14017c039:
  FUN_1400d1290(uVar4);
  return param_2;
}



undefined8 FUN_14017c060(longlong param_1,undefined4 param_2,longlong *param_3,undefined8 param_4)

{
  longlong lVar1;
  void *pvVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong lVar5;
  undefined4 *puVar6;
  longlong *local_res8;
  undefined8 uVar7;
  
  uVar7 = 0xfffffffffffffffe;
  (**(code **)(*(longlong *)(param_1 + 0x78) + 0x10))();
  FUN_14017bf90(param_1,&local_res8,param_2,param_4,uVar7);
  if ((local_res8 == (longlong *)0x0) || (lVar1 = *local_res8, lVar1 == 0)) {
    uVar7 = FUN_140177af0(param_1,param_2);
    FUN_14016aec0(param_3,param_3[1],uVar7);
  }
  else {
    if (*(longlong *)(lVar1 + 0x28) == 0) {
      puVar6 = (undefined4 *)0x0;
    }
    else {
      puVar6 = *(undefined4 **)(lVar1 + 0x18);
    }
    while( true ) {
      if (local_res8 == (longlong *)0x0) {
        lVar5 = 0;
      }
      else {
        lVar5 = *local_res8;
      }
      if (puVar6 == (undefined4 *)0x0) break;
      lVar3 = FUN_140177af0(param_1,*puVar6);
      lVar5 = param_3[1];
      if (lVar5 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      FUN_14016a930(param_3,lVar5 + 1,0xffffffffffffffff);
      if (param_3[1] <= lVar5) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if ((ulonglong)param_3[2] < 0x65) {
        plVar4 = param_3 + lVar5 + 4;
      }
      else {
        plVar4 = (longlong *)(*param_3 + lVar5 * 8);
      }
      *plVar4 = lVar3;
      puVar6 = *(undefined4 **)(puVar6 + 4);
    }
    if (lVar1 + 8 != lVar5 + 8) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
  }
  if (local_res8 != (longlong *)0x0) {
    local_res8[1] = local_res8[1] + -1;
    if (local_res8[1] == 0) {
      pvVar2 = (void *)*local_res8;
      if (pvVar2 != (void *)0x0) {
        FUN_140148eb0((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_1400a3530(local_res8);
    }
  }
  return 1;
}



void FUN_14017c1d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  void *pvVar2;
  undefined8 uVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *local_res8;
  undefined8 uVar7;
  undefined1 uVar8;
  
  uVar7 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(param_1[-0xe] + 0x58))(param_1 + -0xe);
  FUN_1400a1c30(uVar3);
  uVar8 = 1;
  (**(code **)(*param_1 + 0x100))(param_1);
  FUN_14017bf90(param_1 + -0xe,&local_res8,param_2,param_4,uVar7,uVar3,uVar8);
  if ((local_res8 == (longlong *)0x0) || (lVar1 = *local_res8, lVar1 == 0)) {
    (**(code **)(*param_1 + 0xf8))(param_1);
    if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0))
    {
      pvVar2 = (void *)*local_res8;
      if (pvVar2 != (void *)0x0) {
        FUN_140148eb0((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_1400a3530(local_res8);
    }
    FUN_1400d1290(uVar3);
  }
  else {
    plVar4 = local_res8;
    if (*(longlong *)(lVar1 + 0x28) == 0) {
      lVar6 = 0;
    }
    else {
      lVar6 = *(longlong *)(lVar1 + 0x18);
    }
    while( true ) {
      if (plVar4 == (longlong *)0x0) {
        lVar5 = 0;
      }
      else {
        lVar5 = *plVar4;
      }
      if (lVar6 == 0) break;
      if (*(longlong **)(lVar6 + 8) != (longlong *)0x0) {
        (**(code **)(**(longlong **)(lVar6 + 8) + 0x10))();
        plVar4 = local_res8;
      }
      lVar6 = *(longlong *)(lVar6 + 0x10);
    }
    if (lVar1 + 8 != lVar5 + 8) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    FUN_1400ad790(param_1 + 0x2b6);
    if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0))
    {
      pvVar2 = (void *)*local_res8;
      if (pvVar2 != (void *)0x0) {
        FUN_140148eb0((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_1400a3530(local_res8);
    }
    FUN_1400d1290(uVar3);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014017c62b)
// WARNING: Removing unreachable block (ram,0x00014017c63e)
// WARNING: Removing unreachable block (ram,0x00014017c54d)
// WARNING: Removing unreachable block (ram,0x00014017c657)
// WARNING: Removing unreachable block (ram,0x00014017c65f)
// WARNING: Removing unreachable block (ram,0x00014017c669)

longlong FUN_14017c3b0(longlong param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  void *pvVar3;
  undefined8 *puVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  longlong lVar9;
  longlong lVar10;
  longlong lVar11;
  longlong lVar12;
  undefined4 local_res8 [2];
  longlong *local_res10;
  longlong local_res18;
  longlong *local_res20;
  
  local_res10 = param_2;
  (**(code **)(*(longlong *)(param_1 + 0x78) + 0x10))();
  lVar10 = 0;
  lVar11 = lVar10;
  if (*(longlong *)(param_1 + 0x600) != 0) {
    lVar11 = *(longlong *)(param_1 + 0x5f0);
  }
  do {
    if (lVar11 == 0) {
      lVar11 = lVar10;
      if ((longlong *)*param_2 != (longlong *)0x0) {
        lVar11 = *(longlong *)*param_2;
      }
      FUN_1401b88f0(lVar11,1);
      local_res8[0] = 0x1d;
      lVar11 = lVar10;
      if ((longlong *)*param_2 != (longlong *)0x0) {
        lVar11 = *(longlong *)*param_2;
      }
      (**(code **)(*(longlong *)(param_1 + 0x1818) + 0x40))
                ((longlong *)(param_1 + 0x1818),1,&DAT_140318cf0,lVar11 + 0x56c,local_res8);
      if ((*(char *)(param_1 + 0x1790) != '\0') || (*(int *)(param_1 + 0x6c8) != 0)) {
        if ((longlong *)*param_2 != (longlong *)0x0) {
          lVar10 = *(longlong *)*param_2;
        }
        FUN_140177c40(param_1,1,&DAT_140257150,*(undefined4 *)(param_1 + 0x1578),
                      *(undefined4 *)(lVar10 + 0x56c));
      }
      local_res18 = 0;
      if (*param_2 != 0) {
        *(longlong *)(*param_2 + 8) = *(longlong *)(*param_2 + 8) + 1;
        local_res18 = *param_2;
      }
      FUN_14017bdb0(param_1,&local_res18);
      lVar9 = FUN_1401b2030(param_1 + 0x1650);
LAB_14017c68e:
      if (*param_2 != 0) {
        *(longlong *)(*param_2 + 8) = *(longlong *)(*param_2 + 8) + -1;
        lVar9 = *param_2;
        if (*(longlong *)(lVar9 + 8) == 0) {
          param_2 = (longlong *)*param_2;
          puVar4 = (undefined8 *)*param_2;
          if (puVar4 != (undefined8 *)0x0) {
            (**(code **)*puVar4)(puVar4,1);
          }
          lVar9 = FUN_1400a3530(param_2);
        }
      }
      return lVar9;
    }
    local_res20 = (longlong *)0x0;
    if (*(longlong *)(lVar11 + 8) != 0) {
      *(longlong *)(*(longlong *)(lVar11 + 8) + 8) =
           *(longlong *)(*(longlong *)(lVar11 + 8) + 8) + 1;
      local_res20 = *(longlong **)(lVar11 + 8);
    }
    plVar1 = local_res20;
    lVar6 = lVar10;
    if (local_res20 != (longlong *)0x0) {
      lVar6 = *local_res20;
    }
    lVar9 = lVar10;
    if (*(longlong *)(lVar6 + 0x28) != 0) {
      lVar9 = *(longlong *)(lVar6 + 0x18);
    }
    lVar7 = FUN_1401695b0(&local_res20);
    while ((lVar12 = lVar9, plVar5 = local_res20, lVar12 != 0 || (lVar6 + 8 != lVar7 + 8))) {
      if (lVar12 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      lVar8 = FUN_1401695b0(param_2);
      plVar5 = local_res20;
      lVar9 = lVar10;
      if (lVar8 != 0) {
        lVar9 = lVar8 + 8;
      }
      if (*(longlong *)(lVar12 + 8) == lVar9) {
        if (plVar1 != (longlong *)0x0) {
          plVar2 = plVar1 + 1;
          *plVar2 = *plVar2 + -1;
          lVar9 = plVar1[1];
          if (*plVar2 == 0) {
            pvVar3 = (void *)*local_res20;
            if (pvVar3 != (void *)0x0) {
              FUN_140148eb0((longlong)pvVar3 + 8);
              operator_delete(pvVar3);
            }
            lVar9 = FUN_1400a3530(plVar5);
          }
        }
        goto LAB_14017c68e;
      }
      lVar9 = lVar10;
      if (lVar12 != 0) {
        lVar9 = *(longlong *)(lVar12 + 0x10);
      }
    }
    if (plVar1 != (longlong *)0x0) {
      plVar1 = plVar1 + 1;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        pvVar3 = (void *)*local_res20;
        if (pvVar3 != (void *)0x0) {
          FUN_140148eb0((longlong)pvVar3 + 8);
          operator_delete(pvVar3);
        }
        FUN_1400a3530(plVar5);
      }
    }
    if (lVar11 == 0) {
      lVar11 = 0;
    }
    else {
      lVar11 = *(longlong *)(lVar11 + 0x10);
    }
  } while( true );
}



void FUN_14017c6e0(longlong param_1,undefined4 param_2,longlong param_3,undefined8 param_4)

{
  undefined4 uVar1;
  int iVar2;
  longlong lVar3;
  void *pvVar4;
  undefined8 uVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  int iVar9;
  undefined4 *puVar10;
  longlong *local_res20;
  
  FUN_140143980(param_3,0,param_3,param_4,0xfffffffffffffffe);
  uVar5 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))(param_1 + -0x70);
  FUN_1400a1c30(uVar5);
  FUN_14017bf90(param_1 + -0x70,&local_res20,param_2);
  if ((local_res20 != (longlong *)0x0) && (lVar3 = *local_res20, lVar3 != 0)) {
    if (*(longlong *)(lVar3 + 0x28) == 0) {
      puVar10 = (undefined4 *)0x0;
    }
    else {
      puVar10 = *(undefined4 **)(lVar3 + 0x18);
    }
    while( true ) {
      if (local_res20 == (longlong *)0x0) {
        lVar8 = 0;
      }
      else {
        lVar8 = *local_res20;
      }
      if (puVar10 == (undefined4 *)0x0) break;
      uVar1 = *puVar10;
      iVar2 = *(int *)(param_3 + 0x18);
      lVar8 = (longlong)iVar2;
      if (iVar2 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      iVar9 = *(int *)(param_3 + 0x18);
      FUN_140143980(param_3,iVar9 + 1);
      iVar9 = iVar9 - iVar2;
      if (0 < iVar9) {
        if (*(int *)(param_3 + 0x18) == 0) {
          lVar7 = 0;
          lVar6 = 0;
        }
        else {
          lVar7 = *(longlong *)(param_3 + 0x10);
          lVar6 = *(longlong *)(param_3 + 0x10);
        }
        memmove((void *)(lVar6 + 4 + lVar8 * 4),(void *)(lVar7 + lVar8 * 4),(longlong)iVar9 << 2);
      }
      if (*(int *)(param_3 + 0x18) == 0) {
        lVar7 = 0;
      }
      else {
        lVar7 = *(longlong *)(param_3 + 0x10);
      }
      *(undefined4 *)(lVar7 + lVar8 * 4) = uVar1;
      puVar10 = *(undefined4 **)(puVar10 + 4);
    }
    if (lVar3 + 8 != lVar8 + 8) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
  }
  if ((local_res20 != (longlong *)0x0) &&
     (local_res20[1] = local_res20[1] + -1, local_res20[1] == 0)) {
    pvVar4 = (void *)*local_res20;
    if (pvVar4 != (void *)0x0) {
      FUN_140148eb0((longlong)pvVar4 + 8);
      operator_delete(pvVar4);
    }
    FUN_1400a3530(local_res20);
  }
  FUN_1400d1290(uVar5);
  return;
}



double FUN_14017c890(longlong *param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  void *pvVar2;
  double dVar3;
  undefined8 uVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  undefined4 *puVar8;
  double dVar9;
  double dVar10;
  longlong *local_res8;
  longlong *local_res18;
  undefined8 uVar11;
  undefined8 uVar12;
  
  uVar11 = 0xfffffffffffffffe;
  uVar4 = (**(code **)(param_1[-0xe] + 0x58))(param_1 + -0xe);
  uVar12 = uVar4;
  FUN_1400a1c30(uVar4);
  if (param_2 == 1) {
    dVar10 = (double)param_1[0x92];
    FUN_1400d1290(uVar4);
  }
  else {
    plVar5 = (longlong *)FUN_1401755f0(param_1 + -0xe,&local_res18,param_2,param_4,uVar11,uVar12,1);
    lVar7 = 0;
    if ((longlong *)*plVar5 != (longlong *)0x0) {
      lVar7 = *(longlong *)*plVar5;
    }
    if ((local_res18 != (longlong *)0x0) &&
       (local_res18[1] = local_res18[1] + -1, local_res18[1] == 0)) {
      puVar1 = (undefined8 *)*local_res18;
      if (puVar1 != (undefined8 *)0x0) {
        (**(code **)*puVar1)(puVar1,1);
      }
      FUN_1400a3530(local_res18);
    }
    if (lVar7 == 0) {
      FUN_14017bf90(param_1 + -0xe,&local_res8,param_2);
      if ((local_res8 != (longlong *)0x0) && (lVar7 = *local_res8, lVar7 != 0)) {
        dVar10 = 0.0;
        dVar3 = dVar10;
        if (*(longlong *)(lVar7 + 0x28) == 0) {
          puVar8 = (undefined4 *)0x0;
        }
        else {
          puVar8 = *(undefined4 **)(lVar7 + 0x18);
        }
        while( true ) {
          if (local_res8 == (longlong *)0x0) {
            lVar6 = 0;
          }
          else {
            lVar6 = *local_res8;
          }
          if (puVar8 == (undefined4 *)0x0) break;
          dVar9 = (double)(**(code **)(*param_1 + 0x120))(param_1,*puVar8);
          if (0.0 <= dVar9) {
            dVar3 = dVar3 + 1.0;
            dVar10 = dVar10 + dVar9;
          }
          puVar8 = *(undefined4 **)(puVar8 + 4);
        }
        if (lVar7 + 8 != lVar6 + 8) {
                    // WARNING: Subroutine does not return
          FUN_14000c6c0(0x80004005);
        }
        if (0.0 < dVar3) {
          if ((local_res8 != (longlong *)0x0) &&
             (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
            pvVar2 = (void *)*local_res8;
            if (pvVar2 != (void *)0x0) {
              FUN_140148eb0((longlong)pvVar2 + 8);
              operator_delete(pvVar2);
            }
            FUN_1400a3530(local_res8);
          }
          FUN_1400d1290(uVar12);
          return dVar10 / dVar3;
        }
      }
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
        pvVar2 = (void *)*local_res8;
        if (pvVar2 != (void *)0x0) {
          FUN_140148eb0((longlong)pvVar2 + 8);
          operator_delete(pvVar2);
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar12);
      dVar10 = -1.0;
    }
    else {
      *(undefined1 *)(lVar7 + 0x21) = 1;
      dVar10 = *(double *)(lVar7 + 0x158);
      FUN_1400d1290(uVar12);
    }
  }
  return dVar10;
}



double FUN_14017cb30(longlong *param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  void *pvVar2;
  double dVar3;
  undefined8 uVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  undefined4 *puVar8;
  double dVar9;
  double dVar10;
  longlong *local_res8;
  longlong *local_res18;
  undefined8 uVar11;
  undefined8 uVar12;
  
  uVar11 = 0xfffffffffffffffe;
  uVar4 = (**(code **)(param_1[-0xe] + 0x58))(param_1 + -0xe);
  uVar12 = uVar4;
  FUN_1400a1c30(uVar4);
  if (param_2 == 1) {
    dVar10 = (double)param_1[0x91];
    FUN_1400d1290(uVar4);
  }
  else {
    plVar5 = (longlong *)FUN_1401755f0(param_1 + -0xe,&local_res18,param_2,param_4,uVar11,uVar12,1);
    lVar7 = 0;
    if ((longlong *)*plVar5 != (longlong *)0x0) {
      lVar7 = *(longlong *)*plVar5;
    }
    if ((local_res18 != (longlong *)0x0) &&
       (local_res18[1] = local_res18[1] + -1, local_res18[1] == 0)) {
      puVar1 = (undefined8 *)*local_res18;
      if (puVar1 != (undefined8 *)0x0) {
        (**(code **)*puVar1)(puVar1,1);
      }
      FUN_1400a3530(local_res18);
    }
    if (lVar7 == 0) {
      FUN_14017bf90(param_1 + -0xe,&local_res8,param_2);
      if ((local_res8 != (longlong *)0x0) && (lVar7 = *local_res8, lVar7 != 0)) {
        dVar10 = 0.0;
        dVar3 = dVar10;
        if (*(longlong *)(lVar7 + 0x28) == 0) {
          puVar8 = (undefined4 *)0x0;
        }
        else {
          puVar8 = *(undefined4 **)(lVar7 + 0x18);
        }
        while( true ) {
          if (local_res8 == (longlong *)0x0) {
            lVar6 = 0;
          }
          else {
            lVar6 = *local_res8;
          }
          if (puVar8 == (undefined4 *)0x0) break;
          dVar9 = (double)(**(code **)(*param_1 + 0x128))(param_1,*puVar8);
          if (0.0 <= dVar9) {
            dVar3 = dVar3 + 1.0;
            dVar10 = dVar10 + dVar9;
          }
          puVar8 = *(undefined4 **)(puVar8 + 4);
        }
        if (lVar7 + 8 != lVar6 + 8) {
                    // WARNING: Subroutine does not return
          FUN_14000c6c0(0x80004005);
        }
        if (0.0 < dVar3) {
          if ((local_res8 != (longlong *)0x0) &&
             (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
            pvVar2 = (void *)*local_res8;
            if (pvVar2 != (void *)0x0) {
              FUN_140148eb0((longlong)pvVar2 + 8);
              operator_delete(pvVar2);
            }
            FUN_1400a3530(local_res8);
          }
          FUN_1400d1290(uVar12);
          return dVar10 / dVar3;
        }
      }
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
        pvVar2 = (void *)*local_res8;
        if (pvVar2 != (void *)0x0) {
          FUN_140148eb0((longlong)pvVar2 + 8);
          operator_delete(pvVar2);
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar12);
      dVar10 = -1.0;
    }
    else {
      *(undefined1 *)(lVar7 + 0x21) = 1;
      dVar10 = *(double *)(lVar7 + 0x50);
      FUN_1400d1290(uVar12);
    }
  }
  return dVar10;
}



void FUN_14017cdd0(longlong param_1,longlong param_2,char param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  FUN_14017bac0(param_2);
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    FUN_1400a3530(param_2);
  }
  else {
    (**(code **)(*plVar1 + 0x18))(plVar1,param_2);
  }
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
  if (((param_3 != '\0') && (*(ulonglong *)(param_1 + 0x20) < *(ulonglong *)(param_1 + 0x40))) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar2 = FUN_140142850(param_1);
    FUN_1401b2490(param_1,uVar2);
  }
  return;
}



void FUN_14017ce60(longlong param_1,longlong param_2,undefined1 param_3)

{
  uint uVar1;
  ulonglong uVar2;
  uint uVar3;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  uVar1 = *(uint *)(param_1 + 0x28);
  uVar2 = (ulonglong)*(uint *)(param_2 + 0x20) % (ulonglong)uVar1;
  if (*(longlong *)(param_1 + 0x20) == 1) {
    *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    *(undefined8 *)(param_1 + 0x10) = 0;
    *(undefined8 *)(param_1 + 0x18) = 0;
  }
  else {
    uVar3 = (uint)uVar2;
    if (((*(longlong *)(param_2 + 0x18) == 0) ||
        (*(uint *)(*(longlong *)(param_2 + 0x18) + 0x20) % uVar1 != uVar3)) &&
       ((*(longlong *)(param_2 + 0x10) == 0 ||
        (*(uint *)(*(longlong *)(param_2 + 0x10) + 0x20) % uVar1 != uVar3)))) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    }
    else if (param_2 == *(longlong *)(*(longlong *)(param_1 + 8) + (longlong)(int)uVar3 * 8)) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = *(undefined8 *)(param_2 + 0x10);
    }
    if (param_2 == *(longlong *)(param_1 + 0x10)) {
      *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(param_2 + 0x10);
      *(undefined8 *)(param_2 + 0x18) = 0;
    }
    if (param_2 == *(longlong *)(param_1 + 0x18)) {
      *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
      *(undefined8 *)(param_2 + 0x10) = 0;
    }
    if (*(longlong *)(param_2 + 0x18) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x18) + 0x10) = *(undefined8 *)(param_2 + 0x10);
    }
    if (*(longlong *)(param_2 + 0x10) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x10) + 0x18) = *(undefined8 *)(param_2 + 0x18);
    }
  }
  FUN_14017cdd0(param_1,param_2,param_3);
  FUN_1401b2030(param_1);
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x00014017d6a0)
// WARNING: Removing unreachable block (ram,0x00014017d6ac)
// WARNING: Removing unreachable block (ram,0x00014017d6a4)
// WARNING: Removing unreachable block (ram,0x00014017d6b2)
// WARNING: Removing unreachable block (ram,0x00014017d537)
// WARNING: Removing unreachable block (ram,0x00014017d53e)
// WARNING: Removing unreachable block (ram,0x00014017d556)
// WARNING: Removing unreachable block (ram,0x00014017d562)
// WARNING: Removing unreachable block (ram,0x00014017d55a)
// WARNING: Removing unreachable block (ram,0x00014017d568)
// WARNING: Removing unreachable block (ram,0x00014017d584)
// WARNING: Removing unreachable block (ram,0x00014017d480)
// WARNING: Removing unreachable block (ram,0x00014017d487)
// WARNING: Removing unreachable block (ram,0x00014017d4a0)
// WARNING: Removing unreachable block (ram,0x00014017d4ac)
// WARNING: Removing unreachable block (ram,0x00014017d4a4)
// WARNING: Removing unreachable block (ram,0x00014017d4b2)
// WARNING: Removing unreachable block (ram,0x00014017d4ce)

undefined8 FUN_14017cf60(longlong *param_1,longlong param_2,int *param_3,int *param_4,uint param_5)

{
  undefined *puVar1;
  undefined4 uVar2;
  uint uVar3;
  int iVar4;
  uint uVar5;
  uint uVar6;
  undefined8 *puVar7;
  longlong lVar8;
  longlong *plVar9;
  longlong *plVar10;
  longlong *plVar11;
  uint *puVar12;
  undefined8 uVar13;
  longlong lVar14;
  longlong *plVar15;
  uint *puVar16;
  int iVar17;
  uint uVar18;
  ulonglong uVar19;
  longlong *plVar20;
  uint uVar21;
  longlong *plVar22;
  undefined1 auStack_2c38 [32];
  undefined ***local_2c18;
  undefined8 local_2c08;
  undefined **local_2c00;
  longlong *local_2bf8;
  longlong *local_2bf0;
  ulonglong local_2be8;
  undefined8 local_2be0;
  undefined8 local_2bd8;
  undefined4 uStack_2bd0;
  undefined4 uStack_2bcc;
  undefined1 local_2bc8 [4];
  undefined4 local_2bc4;
  longlong *local_2bc0;
  longlong *local_2bb8;
  undefined4 local_2bb0;
  int local_2bac;
  longlong local_2ba0;
  int local_2b98 [2];
  undefined8 local_2b90;
  undefined1 local_2b88;
  int local_2b84;
  undefined1 local_2b80;
  undefined1 local_2b7f;
  longlong local_2b78;
  undefined8 local_2b70;
  longlong *local_2b68;
  undefined **local_2b60;
  longlong *local_2b58;
  longlong *local_2b50;
  uint local_2b48;
  undefined8 local_2b44;
  undefined4 local_2b3c;
  int *local_2b38;
  undefined8 local_2b30;
  undefined4 local_2b28;
  undefined4 uStack_2b24;
  undefined8 local_2b20;
  char local_2b18;
  longlong local_2b10;
  longlong *local_2b08;
  undefined8 *local_2b00;
  longlong local_2af0;
  undefined8 local_2ae0;
  undefined1 local_2ad8 [72];
  undefined1 local_2a90 [72];
  undefined1 local_2a48 [80];
  undefined1 local_29f8 [8];
  longlong *local_29f0;
  longlong local_29e8;
  undefined4 local_29e0;
  int local_29dc;
  undefined1 local_29d0 [136];
  void *local_2948;
  longlong local_2940;
  ulonglong local_2938;
  undefined8 local_2930;
  undefined8 auStack_2928 [100];
  undefined4 local_2608;
  undefined4 uStack_2604;
  undefined4 uStack_2600;
  undefined4 uStack_25fc;
  undefined4 *local_1988;
  undefined4 local_1980;
  int local_197c;
  undefined1 local_1978 [3200];
  undefined1 *local_cf8;
  undefined4 local_cf0;
  int local_cec;
  longlong *local_ce8 [400];
  longlong **local_68;
  undefined4 local_60;
  undefined4 local_5c;
  ulonglong local_58;
  
  local_2ae0 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_2c38;
  plVar15 = (longlong *)0x0;
  local_2b78 = 0;
  local_2ba0 = param_2;
  local_2b68 = param_1;
  local_2b38 = param_3;
  local_2b10 = param_2;
  local_2b08 = param_1;
  local_2b20 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(local_2b20);
  puVar1 = PTR_u_Cannot_send_messages_unless_conn_14030b788;
  local_2b18 = '\x01';
  uVar21 = 0;
  if ((((longlong *)param_1[699] != (longlong *)0x0) && (*(longlong *)param_1[699] != 0)) &&
     ((int)param_1[0x2af] != 0)) {
    local_2948 = (void *)0x0;
    local_2930 = 0;
    local_2940 = 0;
    local_2938 = 100;
    if (0 < (int)param_5) {
      uVar19 = (ulonglong)param_5;
      do {
        if (*param_4 != 0) {
          FUN_14017c060(param_1,*param_4,&local_2948);
        }
        param_4 = param_4 + 1;
        uVar19 = uVar19 - 1;
      } while (uVar19 != 0);
    }
    FUN_14016b750(&local_2948);
    local_2b58 = (longlong *)0x0;
    local_2b3c = 0;
    local_2b50 = (longlong *)0x0;
    local_2b48 = 0;
    local_2b44 = 0;
    local_2b60 = Proud::CNetClientImpl::BypassDestList_C::vftable;
    local_2b70 = (longlong *)((ulonglong)local_2b70._4_4_ << 0x20);
    plVar9 = plVar15;
    plVar10 = plVar15;
    plVar22 = plVar15;
    while( true ) {
      iVar4 = (int)plVar9;
      local_2c08 = (uint *)CONCAT44(local_2c08._4_4_,iVar4);
      lVar14 = (longlong)iVar4;
      iVar17 = (int)plVar10;
      if (local_2940 <= lVar14) break;
      if (iVar4 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if (local_2938 < 0x65) {
        puVar7 = auStack_2928 + lVar14;
      }
      else {
        puVar7 = (undefined8 *)((longlong)local_2948 + lVar14 * 8);
      }
      plVar9 = (longlong *)*puVar7;
      plVar11 = param_1 + 0xc;
      if (param_1 == (longlong *)0x0) {
        plVar11 = plVar15;
      }
      if ((plVar9 == plVar11) && (*(char *)((longlong)param_3 + 0x2d) != '\0')) {
        FUN_140185560(&local_2c00);
        FUN_1401a7270(local_2ba0,&local_2c00);
        lVar14 = param_1[0x2a8];
        plVar11 = (longlong *)local_2b68[0x2a6];
        if (plVar11 == (longlong *)0x0) {
          puVar7 = (undefined8 *)FUN_1400a34c0(0x38);
        }
        else {
          puVar7 = (undefined8 *)(**(code **)(*plVar11 + 8))(plVar11,0x38);
        }
        local_2b00 = puVar7;
        if (puVar7 != (undefined8 *)0x0) {
          local_2bd8 = (longlong **)puVar7;
          FUN_140185590(puVar7 + 2,&local_2c00);
        }
        param_1 = local_2b68;
        puVar7[1] = lVar14;
        *puVar7 = 0;
        local_2b68[0x2a9] = local_2b68[0x2a9] + 1;
        if ((undefined8 *)local_2b68[0x2a8] == (undefined8 *)0x0) {
          local_2b68[0x2a7] = (longlong)puVar7;
        }
        else {
          *(undefined8 *)local_2b68[0x2a8] = puVar7;
        }
        local_2b68[0x2a8] = (longlong)puVar7;
        local_2bd8 = &local_2bf8;
        FUN_14019a730(&local_2bf8);
        if ((local_2bf0 != (longlong *)0x0) && ((longlong)local_2be8 < 0)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
      }
      param_2 = local_2ba0;
      if (plVar9 == param_1 + 0x2aa) {
        local_2b98[0] = param_3[8];
        local_2b90 = *(undefined8 *)(param_3 + 6);
        local_2b88 = *(undefined1 *)((longlong)param_3 + 0x2d);
        local_2b84 = param_3[0xc];
        local_2b80 = *(undefined1 *)((longlong)param_3 + 0x41);
        local_2b7f = (undefined1)param_3[0x10];
        local_2bd8 = local_ce8;
        local_5c = 200;
        local_60 = 0;
        local_68 = local_ce8;
        FUN_14016adf0(local_2ba0 + 0xc80,&local_68);
        local_2c18 = (undefined ***)local_2b98;
        FUN_14016b050(param_1,1,*param_3,local_ce8);
      }
      else if (plVar9 != (longlong *)0x0) {
        local_2c18 = (undefined ***)((ulonglong)local_2c18 & 0xffffffff00000000);
        lVar14 = __RTDynamicCast(plVar9,0,&Proud::ISendDest_C::RTTI_Type_Descriptor,
                                 &Proud::CRemotePeer_C::RTTI_Type_Descriptor);
        param_2 = local_2ba0;
        local_2b78 = lVar14;
        if (lVar14 != 0) {
          if ((((*(char *)(lVar14 + 0x608) != '\0') || (param_3[4] <= (int)local_2b70)) ||
              (*(double *)(lVar14 + 0x50) <= 0.0)) ||
             ((*(double *)(lVar14 + 0x60) <= 0.0 ||
              ((*(double *)(lVar14 + 0x60) + (double)param_1[0x9f]) / *(double *)(lVar14 + 0x50) <
               *(double *)(param_3 + 0xe))))) {
            if (*param_3 == 1) {
              FUN_1401bea80(*(longlong *)(lVar14 + 0x640) + 8,1);
              uVar2 = FUN_1401bd3e0(lVar14 + 0x638);
              local_2af0 = CONCAT44(local_2af0._4_4_,uVar2);
              if (iVar17 < 0) {
                    // WARNING: Subroutine does not return
                FUN_1400a26d0();
              }
              FUN_140144d20(&local_2b60);
              plVar9 = local_2b50;
              if (local_2b48 == 0) {
                plVar9 = plVar15;
              }
              plVar9[(longlong)iVar17 * 2] = lVar14;
              lVar8 = local_2af0;
LAB_14017d5b5:
              plVar10 = (longlong *)(ulonglong)local_2b48;
              plVar9[(longlong)iVar17 * 2 + 1] = lVar8;
              plVar22 = local_2b50;
            }
            else if (*(char *)((longlong)param_3 + 0x2e) != '\0') {
              local_2b28 = 0;
              if (iVar17 < 0) {
                    // WARNING: Subroutine does not return
                FUN_1400a26d0();
              }
              FUN_140144d20(&local_2b60);
              plVar9 = local_2b50;
              if (local_2b48 == 0) {
                plVar9 = plVar15;
              }
              plVar9[(longlong)iVar17 * 2] = lVar14;
              lVar8 = CONCAT44(uStack_2b24,local_2b28);
              goto LAB_14017d5b5;
            }
            if ((char)param_3[0xb] != '\0') {
              *(undefined1 *)(lVar14 + 0x21) = 1;
            }
          }
          else {
            local_2b70 = (longlong *)CONCAT44(local_2b70._4_4_,(int)local_2b70 + 1);
            if (*(char *)((longlong)param_3 + 0x41) == '\0') {
              *(int *)(lVar14 + 0x40) = *(int *)(lVar14 + 0x40) + 1;
            }
            if (*param_3 == 1) {
              FUN_1401bd440(lVar14 + 0x638);
            }
            else {
              local_2b98[0] = param_3[8];
              local_2b90 = *(undefined8 *)(param_3 + 6);
              local_2b88 = *(undefined1 *)((longlong)param_3 + 0x2d);
              local_2b84 = param_3[0xc];
              local_2b80 = *(undefined1 *)((longlong)param_3 + 0x41);
              local_2b7f = (undefined1)param_3[0x10];
              FUN_1401b8a90(lVar14 + 0x668,local_2ba0,local_2b98);
            }
          }
        }
      }
      plVar9 = (longlong *)(ulonglong)((int)local_2c08 + 1);
    }
    if (iVar17 < 1) goto LAB_14017de6b;
    if (*param_3 != 0) {
      local_5c = 200;
      local_60 = 0;
      local_68 = local_ce8;
      FUN_140185560(local_29f8);
      FUN_1401851e0(local_29f8,local_29d0,0x80);
      FUN_1401a3f60(param_2,local_ce8,local_29f8);
      local_2bf8 = (longlong *)0x0;
      local_2bf0 = (longlong *)0x0;
      local_2be8 = 0;
      local_2be0 = 0;
      local_2c00 = Proud::BypassDestList::vftable;
      FUN_14016bfd0(&local_2b60,&local_2c00);
      local_cec = 200;
      local_cf0 = 0;
      local_cf8 = local_1978;
      FUN_140185560(local_2bc8);
      FUN_140185030(local_2bc8);
      FUN_14003c9e0(local_2bc8,0x14);
      FUN_140186c50(local_2bc8,&local_2c00);
      FUN_140184fb0(&local_2b30,local_2bc8);
      iVar4 = FUN_1401a7030(local_ce8);
      FUN_140186930(local_2bc8,(longlong)iVar4);
      local_197c = 200;
      local_1980 = 0;
      local_1988 = &local_2608;
      if (local_2bc0 == (longlong *)0x0) {
        uStack_2bd0 = local_2bb0;
        if (local_2bb8 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
      }
      else {
        uStack_2bd0 = (int)local_2bc0[3];
      }
      plVar9 = local_2bb8;
      if (local_2bb8 == (longlong *)0x0) {
        if (local_2bc0 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        plVar9 = plVar15;
        if ((int)local_2bc0[3] != 0) {
          plVar9 = (longlong *)local_2bc0[2];
        }
      }
      local_1980 = 1;
      local_2bd8._0_4_ = SUB84(plVar9,0);
      local_2bd8._4_4_ = (undefined4)((ulonglong)plVar9 >> 0x20);
      local_2608 = (undefined4)local_2bd8;
      uStack_2604 = local_2bd8._4_4_;
      uStack_25fc = uStack_2bcc;
      local_2bd8 = (longlong **)plVar9;
      uStack_2600 = uStack_2bd0;
      FUN_140145c70(local_1978,&local_2608);
      if (local_1988 == (undefined4 *)0x0) {
        FUN_1400a2320(local_2ad8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_2ad8,(ThrowInfo *)&DAT_1402f4860);
      }
      if (local_197c < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      FUN_140145c70(local_1978,local_ce8);
      local_2b98[0] = param_3[8];
      local_2b90 = *(undefined8 *)(param_3 + 6);
      local_2b88 = *(undefined1 *)((longlong)param_3 + 0x2d);
      local_2b84 = param_3[0xc];
      local_2b7f = (undefined1)param_3[0x10];
      local_2b80 = 1;
      local_2bd8 = (longlong **)&local_2608;
      local_197c = 200;
      local_1980 = 0;
      local_1988 = &local_2608;
      FUN_14016adf0(&local_cf8,&local_1988);
      local_2c18 = (undefined ***)local_2b98;
      FUN_14016b050(param_1,0,1,&local_2608);
      FUN_140184fd0(&local_2b30);
      local_2bd8 = &local_2bc0;
      FUN_14019a730(&local_2bc0);
      if (local_2bb8 != (longlong *)0x0) {
        if (local_2bac < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        local_2bb0 = 0;
      }
      FUN_140145b60(local_1978);
      local_2c00 = Proud::CFastArray<>::vftable;
      if (local_2bf0 != (longlong *)0x0) {
        if (local_2bf8 == (longlong *)0x0) {
          FUN_1400a3530();
        }
        else {
          (**(code **)(*local_2bf8 + 0x18))(local_2bf8,local_2bf0);
        }
      }
      local_2bd8 = &local_29f0;
      FUN_14019a730(&local_29f0);
      if (local_29e8 != 0) {
        if (local_29dc < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        local_29e0 = 0;
      }
      FUN_140145b60(local_ce8);
      goto LAB_14017de6b;
    }
    local_2bf8 = (longlong *)0x0;
    local_2bf0 = (longlong *)0x0;
    local_2be8 = 0;
    local_2be0 = 0;
    local_2c00 = Proud::HostIDArray::vftable;
    local_2c08 = (uint *)((ulonglong)local_2c08._4_4_ << 0x20);
    local_2b78 = 0;
    plVar10 = plVar15;
    plVar11 = plVar22;
    plVar20 = plVar15;
    plVar9 = plVar15;
    if (0 < iVar17) {
      do {
        local_2b70 = plVar11;
        if ((local_2b78 < 0) || (iVar17 <= (int)plVar10)) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        local_2af0 = plVar11[1];
        local_2b38 = (int *)(*plVar11 + 0x56c);
        iVar4 = (int)plVar20;
        if (iVar4 < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        FUN_140143980(&local_2c00,iVar4 + 1);
        plVar9 = local_2bf0;
        uVar21 = (uint)local_2be8;
        plVar20 = (longlong *)(local_2be8 & 0xffffffff);
        plVar10 = local_2bf0;
        if ((uint)local_2be8 == 0) {
          plVar10 = plVar15;
        }
        FUN_1400224d0((longlong)plVar10 + (longlong)iVar4 * 4,local_2b38,4);
        uVar3 = (int)local_2c08 + 1;
        local_2c08 = (uint *)CONCAT44(local_2c08._4_4_,uVar3);
        local_2b78 = local_2b78 + 1;
        local_2b70 = local_2b70 + 2;
        plVar10 = (longlong *)(ulonglong)uVar3;
        plVar11 = local_2b70;
      } while ((int)uVar3 < iVar17);
    }
    plVar10 = local_2bf8;
    FUN_140185560(local_2bc8);
    FUN_140185030(local_2bc8);
    FUN_14003c9e0(local_2bc8,0x15);
    FUN_14003c9e0(local_2bc8,(char)param_3[8]);
    FUN_140186930(local_2bc8,*(undefined8 *)(param_3 + 6));
    FUN_140186930(local_2bc8,(longlong)(int)uVar21);
    plVar11 = plVar9;
    if (uVar21 == 0) {
      plVar11 = plVar15;
    }
    if ((uVar21 & 0x3fffffff) != 0) {
      local_2bc4 = 0;
      if (local_2bc0 == (longlong *)0x0) {
        if (local_2bb8 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830(0,plVar11);
        }
LAB_14017d7be:
        FUN_14003cc90(&local_2bb8);
      }
      else {
        if (local_2bb8 != (longlong *)0x0) goto LAB_14017d7be;
        if (local_2bc0 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830(0,plVar11);
        }
        FUN_14003ce60();
      }
      FUN_14003ced0(local_2bc8);
    }
    FUN_140184fb0(&local_2b30,local_2bc8);
    lVar14 = local_2ba0;
    iVar4 = FUN_1401a7030(local_2ba0);
    FUN_140186930(local_2bc8,(longlong)iVar4);
    local_cec = 200;
    local_cf0 = 0;
    local_cf8 = local_1978;
    local_197c = 200;
    local_1980 = 0;
    local_1988 = &local_2608;
    if (local_2bc0 == (longlong *)0x0) {
      uStack_2bd0 = local_2bb0;
      if (local_2bb8 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
    }
    else {
      uStack_2bd0 = (int)local_2bc0[3];
    }
    plVar11 = local_2bb8;
    if (local_2bb8 == (longlong *)0x0) {
      if (local_2bc0 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      plVar11 = plVar15;
      if ((int)local_2bc0[3] != 0) {
        plVar11 = (longlong *)local_2bc0[2];
      }
    }
    local_1980 = 1;
    local_2bd8._0_4_ = SUB84(plVar11,0);
    local_2bd8._4_4_ = (undefined4)((ulonglong)plVar11 >> 0x20);
    local_2608 = (undefined4)local_2bd8;
    uStack_2604 = local_2bd8._4_4_;
    uStack_25fc = uStack_2bcc;
    local_2bd8 = (longlong **)plVar11;
    uStack_2600 = uStack_2bd0;
    FUN_140145c70(local_1978,&local_2608);
    if (local_1988 == (undefined4 *)0x0) {
      FUN_1400a2320(local_2a90,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_2a90,(ThrowInfo *)&DAT_1402f4860);
    }
    if (local_197c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_140145c70(local_1978,lVar14);
    local_2b98[0] = param_3[8];
    local_2b90 = *(undefined8 *)(param_3 + 6);
    local_2b88 = *(undefined1 *)((longlong)param_3 + 0x2d);
    local_2b84 = param_3[0xc];
    local_2b7f = (undefined1)param_3[0x10];
    local_2b80 = 1;
    local_2bd8 = (longlong **)&local_2608;
    local_197c = 200;
    local_1980 = 0;
    local_1988 = &local_2608;
    FUN_14016adf0(&local_cf8,&local_1988);
    plVar11 = local_2b68;
    local_2bd8 = (longlong **)&local_2608;
    FUN_14016a360(local_2b68);
    if ((undefined8 *)plVar11[0x2ae] != (undefined8 *)0x0) {
      plVar15 = *(longlong **)plVar11[0x2ae];
    }
    FUN_1401b1a40(plVar15,0,&local_2608,local_2b98);
    FUN_140145b60(&local_2608);
    if (local_cf8 == (undefined1 *)0x0) {
      FUN_1400a2320(local_2a48,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_2a48,(ThrowInfo *)&DAT_1402f4860);
    }
    if (local_cec < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_cf0 = 0;
    FUN_140184fd0(&local_2b30);
    local_2bd8 = &local_2bc0;
    FUN_14019a730(&local_2bc0);
    if (local_2bb8 != (longlong *)0x0) {
      if (local_2bac < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_2bb0 = 0;
    }
    if (plVar9 != (longlong *)0x0) {
      if (plVar10 == (longlong *)0x0) {
        FUN_1400a3530(plVar9);
      }
      else {
        (**(code **)(*plVar10 + 0x18))(plVar10,plVar9);
      }
    }
LAB_14017de6b:
    if (plVar22 != (longlong *)0x0) {
      if (local_2b58 == (longlong *)0x0) {
        FUN_1400a3530(plVar22);
      }
      else {
        (**(code **)(*local_2b58 + 0x18))(local_2b58,plVar22);
      }
    }
    if (100 < local_2938) {
      operator_delete__(local_2948);
    }
    if (local_2b18 != '\0') {
      FUN_1400d1290(local_2b20);
    }
    return 1;
  }
  FUN_1400a3440();
  local_2c08 = (uint *)PTR_DAT_1402f8010;
  uVar3 = FUN_1400a32c0(puVar1);
  if ((local_2c08 != (uint *)0x0) &&
     (plVar15 = (longlong *)0x0, local_2c08 != (uint *)PTR_DAT_1402f8010)) {
    plVar15 = (longlong *)(ulonglong)local_2c08[-2];
  }
  uVar5 = 0;
  uVar6 = uVar3;
  if ((((int)uVar3 <= (int)plVar15) && (uVar6 = uVar5, local_2c08 != (uint *)0x0)) &&
     (local_2c08 != (uint *)PTR_DAT_1402f8010)) {
    uVar6 = local_2c08[-2];
  }
  uVar18 = 1;
  if (1 < (int)uVar6) {
    uVar18 = uVar6;
  }
  uVar6 = uVar5;
  if ((local_2c08 != (uint *)0x0) && (local_2c08 != (uint *)PTR_DAT_1402f8010)) {
    uVar6 = local_2c08[-2];
  }
  if ((int)uVar6 < (int)uVar18) {
    if (local_2c08 == (uint *)0x0) {
      local_2c08 = (uint *)PTR_DAT_1402f8010;
    }
    if ((int)uVar18 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar18 == 0) {
      FUN_1400031d0(&local_2c08);
    }
    else {
      uVar6 = uVar5;
      if ((local_2c08 != (uint *)0x0) && (local_2c08 != (uint *)PTR_DAT_1402f8010)) {
        uVar6 = local_2c08[-2];
      }
      if (uVar18 != uVar6) {
        puVar12 = (uint *)FUN_1400a34c0((longlong)(int)uVar18 * 2 + 10);
        if (puVar12 != (uint *)0x0) {
          *puVar12 = 0;
          puVar12[1] = 1;
        }
        *puVar12 = uVar18;
        uVar6 = uVar5;
        if ((local_2c08 != (uint *)0x0) && (local_2c08 != (uint *)PTR_DAT_1402f8010)) {
          uVar6 = local_2c08[-2];
        }
        puVar16 = (uint *)PTR_DAT_1402f8010;
        if ((int)uVar18 < (int)uVar6) {
LAB_14017dfc5:
          if (local_2c08 != (uint *)0x0) {
            puVar16 = local_2c08;
          }
        }
        else {
          uVar18 = uVar21;
          if (local_2c08 != (uint *)0x0) {
            if (local_2c08 != (uint *)PTR_DAT_1402f8010) {
              uVar18 = local_2c08[-2];
            }
            goto LAB_14017dfc5;
          }
        }
        FUN_1400a32f0(puVar12 + 2,puVar16,uVar18);
        FUN_1400031d0(&local_2c08);
        local_2c08 = puVar12 + 2;
      }
    }
  }
  FUN_140002e30(&local_2c08);
  puVar12 = local_2c08;
  if (local_2c08 == (uint *)0x0) {
    puVar12 = (uint *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar12,puVar1,uVar3);
  puVar12 = local_2c08;
  if (local_2c08 == (uint *)0x0) {
    puVar12 = (uint *)PTR_DAT_1402f8010;
  }
  uVar3 = FUN_1400a32c0(puVar12);
  uVar21 = 0;
  if (0 < (int)uVar3) {
    uVar21 = uVar3;
  }
  uVar3 = uVar5;
  if ((local_2c08 != (uint *)0x0) && (local_2c08 != (uint *)PTR_DAT_1402f8010)) {
    uVar3 = local_2c08[-2];
  }
  if (((int)uVar3 <= (int)uVar21) && (uVar21 = uVar5, local_2c08 != (uint *)0x0)) {
    if (local_2c08 == (uint *)PTR_DAT_1402f8010) goto LAB_14017e07a;
    uVar21 = local_2c08[-2];
  }
  if (((local_2c08 != (uint *)PTR_DAT_1402f8010) && (local_2c08 != (uint *)0x0)) &&
     (local_2c08 + -2 != (uint *)0x0)) {
    local_2c08[-2] = uVar21;
    *(undefined2 *)((longlong)local_2c08 + (longlong)(int)uVar21 * 2) = 0;
  }
LAB_14017e07a:
  local_2bf8 = (longlong *)0x0;
  local_2bf0 = (longlong *)0x0;
  local_2be8 = 0;
  local_2be0 = 0;
  local_2c00 = Proud::ByteArray::vftable;
  local_2c18 = &local_2c00;
  uVar13 = FUN_1401416a0(&local_2bd8,0x12,0,&local_2c08);
  (**(code **)(*param_1 + 0x80))(param_1,uVar13);
  FUN_140140df0(&local_2c00);
  puVar12 = local_2c08;
  if (((local_2c08 != (uint *)0x0) && (local_2c08 != (uint *)PTR_DAT_1402f8010)) &&
     (puVar16 = local_2c08 + -2, puVar16 != (uint *)0x0)) {
    uVar13 = FUN_1400a3440();
    local_2b30 = uVar13;
    FUN_1400a1c30(uVar13);
    local_2b28 = CONCAT31(local_2b28._1_3_,1);
    puVar12 = puVar12 + -1;
    *puVar12 = *puVar12 - 1;
    if (*puVar12 == 0) {
      FUN_1400a3530(puVar16);
    }
    FUN_1400d1290(uVar13);
  }
  FUN_1400d1290(local_2b20);
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14017e170(longlong *param_1,uint param_2,int *param_3,longlong *param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  undefined4 *puVar3;
  ulonglong uVar4;
  longlong *plVar5;
  uint uVar6;
  ulonglong uVar7;
  undefined1 auStack_3b8 [32];
  undefined8 local_398;
  undefined1 local_390;
  undefined8 local_388;
  void *local_378;
  longlong local_370;
  ulonglong local_368;
  undefined8 local_360;
  longlong local_358 [100];
  ulonglong local_38;
  
  local_388 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_3b8;
  uVar7 = (ulonglong)param_2;
  uVar2 = (**(code **)(*param_1 + 0x58))();
  local_398 = uVar2;
  FUN_1400a1c30(uVar2);
  local_390 = 1;
  uVar4 = 0;
  local_378 = (void *)0x0;
  local_360 = 0;
  local_370 = 0;
  local_368 = 100;
  if (0 < (int)param_2) {
    do {
      if (*param_3 != 0) {
        FUN_14017c060(param_1,*param_3,&local_378);
      }
      param_3 = param_3 + 1;
      uVar7 = uVar7 - 1;
    } while (uVar7 != 0);
  }
  FUN_14016b750(&local_378);
  FUN_1401442d0(param_4,local_370,0xffffffffffffffff);
  uVar7 = uVar4;
  if (0 < local_370) {
    do {
      if (((longlong)uVar4 < 0) || (local_370 <= (longlong)uVar4)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if (local_368 < 0x65) {
        plVar5 = local_358 + uVar4;
      }
      else {
        plVar5 = (longlong *)((longlong)local_378 + uVar4 * 8);
      }
      plVar5 = (longlong *)*plVar5;
      if (plVar5 == (longlong *)0x0) {
        if (param_4[1] <= (longlong)uVar4) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        if ((ulonglong)param_4[2] < 0x65) {
          puVar3 = (undefined4 *)((longlong)param_4 + uVar4 * 4 + 0x20);
        }
        else {
          puVar3 = (undefined4 *)(*param_4 + uVar4 * 4);
        }
        *puVar3 = 0;
      }
      else {
        if (param_4[1] <= (longlong)uVar4) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        if ((ulonglong)param_4[2] < 0x65) {
          puVar3 = (undefined4 *)((longlong)param_4 + uVar4 * 4 + 0x20);
        }
        else {
          puVar3 = (undefined4 *)(*param_4 + uVar4 * 4);
        }
        uVar1 = (**(code **)(*plVar5 + 8))(plVar5);
        *puVar3 = uVar1;
      }
      uVar6 = (int)uVar7 + 1;
      uVar7 = (ulonglong)uVar6;
      uVar4 = (ulonglong)(int)uVar6;
    } while ((longlong)uVar4 < local_370);
  }
  if (100 < local_368) {
    operator_delete__(local_378);
  }
  FUN_1400d1290(uVar2);
  return;
}



void FUN_14017e320(longlong param_1)

{
  FUN_14015c350(param_1 + 0x50);
  FUN_14019a730(param_1 + 0x10);
  if (*(longlong *)(param_1 + 0x18) != 0) {
    if (*(int *)(param_1 + 0x24) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(param_1 + 0x20) = 0;
  }
  return;
}



void FUN_14017e380(longlong param_1)

{
  undefined8 *puVar1;
  void *pvVar2;
  longlong *plVar3;
  uint uVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong lVar7;
  float fVar8;
  float fVar9;
  
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
  FUN_1401b2030();
  lVar6 = *(longlong *)(param_1 + 0x10);
  while (lVar6 != 0) {
    lVar7 = *(longlong *)(lVar6 + 0x10);
    if ((*(longlong *)(lVar6 + 8) != 0) &&
       (*(longlong *)(*(longlong *)(lVar6 + 8) + 8) =
             *(longlong *)(*(longlong *)(lVar6 + 8) + 8) + -1,
       *(longlong *)(*(longlong *)(lVar6 + 8) + 8) == 0)) {
      puVar1 = *(undefined8 **)(lVar6 + 8);
      pvVar2 = (void *)*puVar1;
      if (pvVar2 != (void *)0x0) {
        FUN_140148eb0((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_1400a3530(puVar1);
    }
    plVar3 = *(longlong **)(param_1 + 0x50);
    if (plVar3 == (longlong *)0x0) {
      FUN_1400a3530(lVar6);
    }
    else {
      (**(code **)(*plVar3 + 0x18))(plVar3,lVar6);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar6 = lVar7;
  }
  FUN_1400a3530(*(undefined8 *)(param_1 + 8));
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  FUN_1401b2030(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar4 = FUN_140142850(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_1400a3530();
      *(undefined8 *)(param_1 + 8) = 0;
    }
    lVar6 = 0;
    *(uint *)(param_1 + 0x28) = uVar4;
    fVar9 = (float)uVar4 * *(float *)(param_1 + 0x34);
    if ((9.223372e+18 < fVar9) && (fVar9 = fVar9 - 9.223372e+18, fVar9 < 9.223372e+18)) {
      lVar6 = -0x8000000000000000;
    }
    fVar8 = (float)uVar4 * *(float *)(param_1 + 0x30);
    lVar7 = 0;
    *(longlong *)(param_1 + 0x38) = (longlong)fVar9 + lVar6;
    if ((9.223372e+18 < fVar8) && (fVar8 = fVar8 - 9.223372e+18, fVar8 < 9.223372e+18)) {
      lVar7 = -0x8000000000000000;
    }
    uVar5 = (longlong)fVar8 + lVar7;
    if ((ulonglong)((longlong)fVar8 + lVar7) < 0x11) {
      uVar5 = 0;
    }
    *(ulonglong *)(param_1 + 0x40) = uVar5;
  }
  FUN_1401b2030(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



undefined4 * FUN_14017e510(undefined4 *param_1,undefined4 *param_2)

{
  longlong *plVar1;
  int iVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  
  *param_1 = *param_2;
  FUN_140141570(param_1 + 2,param_2 + 2);
  param_1[4] = param_2[4];
  FUN_14015c040(param_1 + 6,param_2 + 6);
  FUN_14015c170(param_1 + 8,param_2 + 8);
  iVar2 = param_2[0x10];
  if (iVar2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_14003cda0(param_1 + 10,iVar2);
  uVar5 = 0;
  uVar4 = uVar5;
  if (param_2[0x10] != 0) {
    uVar4 = *(undefined8 *)(param_2 + 0xe);
  }
  uVar3 = uVar5;
  if (param_1[0x10] != 0) {
    uVar3 = *(undefined8 *)(param_1 + 0xe);
  }
  FUN_1400224d0(uVar3,uVar4,(longlong)iVar2);
  if (*(longlong *)(param_2 + 0x14) == *(longlong *)(param_1 + 0x14)) {
    param_1[0x19] = param_2[0x19];
    *(undefined8 *)(param_1 + 0x16) = *(undefined8 *)(param_2 + 0x16);
    param_1[0x18] = param_2[0x18];
  }
  else {
    FUN_14019a730(param_1 + 0x14);
    if (*(longlong *)(param_2 + 0x14) != 0) {
      plVar1 = (longlong *)(*(longlong *)(param_2 + 0x14) + 0x28);
      *plVar1 = *plVar1 + 1;
      *(undefined8 *)(param_1 + 0x14) = *(undefined8 *)(param_2 + 0x14);
    }
  }
  param_1[0x1a] = param_2[0x1a];
  param_1[0x1b] = param_2[0x1b];
  param_1[0x1c] = param_2[0x1c];
  iVar2 = param_2[0x24];
  if (-1 < iVar2) {
    FUN_14003cda0(param_1 + 0x1e,iVar2);
    uVar4 = uVar5;
    if (param_2[0x24] != 0) {
      uVar4 = *(undefined8 *)(param_2 + 0x22);
    }
    uVar3 = uVar5;
    if (param_1[0x24] != 0) {
      uVar3 = *(undefined8 *)(param_1 + 0x22);
    }
    FUN_1400224d0(uVar3,uVar4,(longlong)iVar2);
    param_1[0x28] = param_2[0x28];
    param_1[0x2c] = param_2[0x2c];
    *(undefined2 *)(param_1 + 0x2d) = *(undefined2 *)(param_2 + 0x2d);
    param_1[0x2e] = param_2[0x2e];
    iVar2 = param_2[0x36];
    if (-1 < iVar2) {
      FUN_14003cda0(param_1 + 0x30,iVar2);
      uVar4 = uVar5;
      if (param_2[0x36] != 0) {
        uVar4 = *(undefined8 *)(param_2 + 0x34);
      }
      if (param_1[0x36] != 0) {
        uVar5 = *(undefined8 *)(param_1 + 0x34);
      }
      FUN_1400224d0(uVar5,uVar4,(longlong)iVar2);
      return param_1;
    }
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_14017e6e0(void)

{
  FUN_14017e380();
  return;
}



undefined4 *
FUN_14017e700(undefined4 *param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  *param_1 = *param_2;
  FUN_140185590(param_1 + 2,param_2 + 2,param_3,param_4,0xfffffffffffffffe);
  param_1[0xc] = param_2[0xc];
  *(undefined ***)(param_1 + 0xe) = Proud::AddrPort::vftable;
  param_1[0x10] = param_2[0x10];
  *(undefined2 *)(param_1 + 0x11) = *(undefined2 *)(param_2 + 0x11);
  *(undefined1 *)(param_1 + 0x12) = *(undefined1 *)(param_2 + 0x12);
  FUN_14015de40(param_1 + 0x14,param_2 + 0x14);
  return param_1;
}



undefined4 * FUN_14017e790(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  FUN_14016a260(param_1 + 2,param_2 + 2);
  param_1[0xc] = param_2[0xc];
  param_1[0x10] = param_2[0x10];
  *(undefined2 *)(param_1 + 0x11) = *(undefined2 *)(param_2 + 0x11);
  *(undefined1 *)(param_1 + 0x12) = *(undefined1 *)(param_2 + 0x12);
  FUN_14017e510(param_1 + 0x14,param_2 + 0x14);
  return param_1;
}



undefined8 FUN_14017e800(longlong param_1,uint *param_2,undefined8 param_3)

{
  uint *puVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  
  uVar2 = (ulonglong)*param_2 % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (puVar1 != (uint *)0x0 && ((uint)uVar2 == puVar1[8] % *(uint *)(param_1 + 0x28)));
        puVar1 = *(uint **)(puVar1 + 4)) {
      if (*puVar1 == *param_2) {
        return 0;
      }
    }
  }
  uVar3 = FUN_14017a620(param_1,param_2);
  FUN_14017ba30(uVar3,param_3);
  return 1;
}



void FUN_14017e890(longlong *param_1,longlong param_2)

{
  longlong *plVar1;
  
  FUN_14015c350(param_2 + 0x60);
  FUN_14019a730(param_2 + 0x20);
  if (*(longlong *)(param_2 + 0x28) != 0) {
    if (*(int *)(param_2 + 0x34) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(param_2 + 0x30) = 0;
  }
  plVar1 = (longlong *)*param_1;
  if (plVar1 == (longlong *)0x0) {
    FUN_1400a3530(param_2);
  }
  else {
    (**(code **)(*plVar1 + 0x10))(plVar1,param_2);
  }
  param_1[3] = param_1[3] + -1;
  return;
}



longlong * FUN_14017e900(longlong *param_1,longlong *param_2,uint param_3)

{
  uint uVar1;
  ulonglong uVar2;
  char cVar3;
  undefined8 uVar4;
  uint *puVar5;
  longlong lVar6;
  uint *puVar7;
  ulonglong uVar8;
  longlong *plVar9;
  uint local_res18 [2];
  void *local_res20;
  undefined8 uVar10;
  undefined8 uVar11;
  undefined1 uVar12;
  
  uVar10 = 0xfffffffffffffffe;
  puVar7 = (uint *)0x0;
  local_res18[0] = param_3;
  uVar4 = (**(code **)(*param_1 + 0x58))();
  uVar11 = uVar4;
  FUN_1400a1c30(uVar4);
  uVar12 = 1;
  local_res20 = operator_new(0x60);
  puVar5 = puVar7;
  if (local_res20 != (void *)0x0) {
    puVar5 = (uint *)FUN_14016c870(local_res20);
  }
  if (puVar5 == (uint *)0x0) {
    *param_2 = 0;
  }
  else {
    lVar6 = FUN_1400a34c0(0x10);
    *param_2 = lVar6;
    *(undefined8 *)(lVar6 + 8) = 1;
    *(uint **)*param_2 = puVar5;
  }
  if ((longlong *)*param_2 != (longlong *)0x0) {
    puVar7 = *(uint **)*param_2;
  }
  *puVar7 = param_3;
  plVar9 = param_1 + 0xbc;
  uVar1 = *(uint *)(param_1 + 0xc1);
  uVar8 = (ulonglong)uVar1;
  uVar2 = (ulonglong)param_3 % uVar8;
  lVar6 = param_1[0xbd];
  if (lVar6 != 0) {
    for (puVar7 = *(uint **)(lVar6 + uVar2 * 8);
        (puVar7 != (uint *)0x0 && ((uint)uVar2 == puVar7[8] % uVar1));
        puVar7 = *(uint **)(puVar7 + 4)) {
      if (*puVar7 == param_3) goto LAB_14017ea81;
    }
    if (lVar6 != 0) {
      for (puVar7 = *(uint **)(lVar6 + uVar2 * 8);
          (puVar7 != (uint *)0x0 && ((uint)uVar2 == puVar7[8] % uVar1));
          puVar7 = *(uint **)(puVar7 + 4)) {
        if (*puVar7 == param_3) goto LAB_14017ea74;
      }
      if (lVar6 != 0) goto LAB_14017ea4b;
    }
  }
  cVar3 = FUN_140144560(plVar9,uVar8,CONCAT71((int7)((ulonglong)lVar6 >> 8),1),uVar8,uVar10,uVar11,
                        uVar12);
  if (cVar3 == '\0') {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x8007000e);
  }
LAB_14017ea4b:
  FUN_1401b2030(plVar9);
  puVar7 = (uint *)FUN_14015ed70(plVar9,local_res18,uVar2,param_3);
  FUN_1401b2030(plVar9);
LAB_14017ea74:
  FUN_14017ba30(puVar7 + 2,param_2);
LAB_14017ea81:
  FUN_1400d1290(uVar4);
  return param_2;
}



undefined8 FUN_14017eaa0(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  longlong lVar2;
  
  plVar1 = *(longlong **)(param_1 + 8);
  if (plVar1 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  FUN_14017e700(param_2,plVar1 + 2);
  lVar2 = *plVar1;
  *(longlong *)(param_1 + 8) = lVar2;
  if (lVar2 == 0) {
    *(undefined8 *)(param_1 + 0x10) = 0;
  }
  else {
    *(undefined8 *)(lVar2 + 8) = 0;
  }
  FUN_14017e890(param_1,plVar1);
  return param_2;
}



void FUN_14017eb20(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  
  lVar1 = param_1[3];
  while( true ) {
    if (lVar1 == 0) {
      param_1[1] = 0;
      param_1[2] = 0;
      return;
    }
    plVar2 = (longlong *)param_1[1];
    if (plVar2 == (longlong *)0x0) break;
    param_1[1] = *plVar2;
    FUN_14015c350(plVar2 + 0xc);
    FUN_14019a730(plVar2 + 4);
    if (plVar2[5] != 0) {
      if (*(int *)((longlong)plVar2 + 0x34) < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      *(undefined4 *)(plVar2 + 6) = 0;
    }
    plVar3 = (longlong *)*param_1;
    if (plVar3 == (longlong *)0x0) {
      FUN_1400a3530(plVar2);
    }
    else {
      (**(code **)(*plVar3 + 0x10))(plVar3,plVar2);
    }
    param_1[3] = param_1[3] + -1;
    lVar1 = param_1[3];
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



undefined8 *
FUN_14017ebd0(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  
  plVar1 = (longlong *)*param_1;
  if (plVar1 == (longlong *)0x0) {
    puVar2 = (undefined8 *)FUN_1400a34c0(0x148);
  }
  else {
    puVar2 = (undefined8 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x148,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar2 != (undefined8 *)0x0) {
    FUN_14017e700(puVar2 + 2,param_2);
  }
  puVar2[1] = param_3;
  *puVar2 = param_4;
  param_1[3] = param_1[3] + 1;
  return puVar2;
}



undefined8 FUN_14017ec60(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined1 local_140 [16];
  undefined1 local_130 [8];
  longlong local_128;
  int local_11c;
  undefined1 local_f0 [232];
  
  uVar3 = 0xfffffffffffffffe;
  uVar1 = (**(code **)(*param_1 + 0x58))();
  uVar2 = uVar1;
  FUN_1400a1c30(uVar1);
  if (param_1[0x2bf] == 0) {
    FUN_1400d1290(uVar1);
    uVar2 = 0;
  }
  else {
    uVar2 = FUN_14017eaa0(param_1 + 700,local_140,param_3,param_4,uVar2,1,uVar3);
    FUN_14017e790(param_2,uVar2);
    FUN_14015c350(local_f0);
    FUN_14019a730(local_130);
    if ((local_128 != 0) && (local_11c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_1400d1290(uVar1);
    uVar2 = 1;
  }
  return uVar2;
}



void FUN_14017ed30(longlong *param_1)

{
  undefined8 *puVar1;
  
  FUN_14017eb20();
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  return;
}



undefined8 FUN_14017ed60(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 *puVar3;
  void *pvVar4;
  undefined8 *puVar5;
  char cVar6;
  int iVar7;
  undefined8 uVar8;
  longlong *plVar9;
  longlong *plVar10;
  longlong *plVar11;
  undefined *puVar12;
  double dVar13;
  longlong lVar14;
  undefined1 local_res8 [8];
  longlong *local_res18;
  longlong *local_res20;
  undefined8 *local_1c8;
  undefined8 *local_1c0;
  longlong *local_1b8;
  longlong *local_1b0;
  longlong *local_1a8;
  undefined *local_1a0;
  undefined *local_198;
  undefined8 local_190;
  undefined1 local_188;
  undefined8 local_180;
  undefined1 local_178;
  undefined8 local_170;
  undefined1 local_168;
  undefined8 local_160;
  undefined1 local_158;
  undefined8 local_150;
  undefined1 local_148;
  longlong *local_140;
  undefined1 local_138;
  undefined8 local_130;
  undefined1 local_128;
  undefined8 local_120;
  undefined1 local_118;
  undefined8 local_110;
  undefined4 local_d8;
  uint uStack_d4;
  undefined4 local_d0;
  uint uStack_cc;
  undefined1 local_c8 [72];
  undefined1 local_80 [72];
  
  local_110 = 0xfffffffffffffffe;
  local_140 = param_1 + 0x95;
  FUN_1400a1c30();
  local_138 = 1;
  plVar10 = param_1 + 1;
  (**(code **)(*plVar10 + 0x18))(plVar10);
  LOCK();
  *(int *)(param_1 + 0xaa) = (int)param_1[0xaa] + 1;
  UNLOCK();
  plVar1 = param_1 + -0xe;
  local_160 = (**(code **)(*plVar1 + 0x58))(plVar1);
  FUN_1400a1c30(local_160);
  local_158 = 1;
  local_res8[0] = 0;
  iVar7 = (**(code **)(*param_1 + 0x108))(param_1,local_res8);
  if (iVar7 != 0) {
    uVar8 = FUN_1401a2510(iVar7);
    FUN_1400a2320(local_c8,
                  L"Wrong state(%s)! Disconnect() or GetServerConnectionState() may be required.",
                  uVar8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_c8,(ThrowInfo *)&DAT_1402f4860);
  }
  plVar11 = (longlong *)0x0;
  if (((longlong *)param_1[0xac] != (longlong *)0x0) && (*(longlong *)param_1[0xac] != 0)) {
    FUN_1400a3440();
    local_res20 = (longlong *)PTR_DAT_1402f8010;
    plVar9 = (longlong *)FUN_1400a3170(&local_1a0);
    puVar12 = (undefined *)*plVar9;
    if ((undefined *)*plVar9 == (undefined *)0x0) {
      puVar12 = PTR_DAT_1402f8010;
    }
    FUN_14003c600(&local_res20,L"Unstability in Connect #3! Process=%s",puVar12);
    if (((local_1a0 != (undefined *)0x0) && (local_1a0 != PTR_DAT_1402f8010)) &&
       (local_1a0 + -8 != (undefined *)0x0)) {
      uVar8 = FUN_1400a3440();
      local_170 = uVar8;
      FUN_1400a1c30(uVar8);
      local_168 = 1;
      piVar2 = (int *)(local_1a0 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(local_1a0 + -8);
      }
      FUN_1400d1290(uVar8);
      local_168 = 0;
    }
    local_1a0 = PTR_DAT_1402f8010;
    FUN_1400a3440();
    plVar9 = local_res20;
    local_res18 = (longlong *)PTR_DAT_1402f8010;
    if (PTR_DAT_1402f8010 == (undefined *)0x0) {
      local_res18 = plVar11;
    }
    if (local_res20 != (longlong *)PTR_DAT_1402f8010) {
      uVar8 = FUN_1400a3440();
      local_190 = uVar8;
      FUN_1400a1c30(uVar8);
      local_188 = 1;
      FUN_1400031d0(&local_res18);
      local_res18 = plVar9;
      if (((plVar9 != (longlong *)PTR_DAT_1402f8010) && (plVar9 != (longlong *)0x0)) &&
         (plVar9 != (longlong *)0x8)) {
        *(int *)((longlong)plVar9 + -4) = *(int *)((longlong)plVar9 + -4) + 1;
      }
      FUN_1400d1290(uVar8);
      local_188 = 0;
    }
    FUN_1400a6370(&local_res18);
    if (((plVar9 != (longlong *)0x0) && (plVar9 != (longlong *)PTR_DAT_1402f8010)) &&
       (plVar9 + -1 != (longlong *)0x0)) {
      uVar8 = FUN_1400a3440();
      local_150 = uVar8;
      FUN_1400a1c30(uVar8);
      local_148 = 1;
      piVar2 = (int *)((longlong)plVar9 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(plVar9 + -1);
      }
      FUN_1400d1290(uVar8);
      local_148 = 0;
    }
    local_res20 = (longlong *)PTR_DAT_1402f8010;
  }
  if ((((longlong *)param_1[0x296] != (longlong *)0x0) && (*(longlong *)param_1[0x296] != 0)) ||
     (((longlong *)param_1[0x2a0] != (longlong *)0x0 && (*(longlong *)param_1[0x2a0] != 0)))) {
    FUN_1400a3440();
    local_1a8 = (longlong *)PTR_DAT_1402f8010;
    plVar9 = (longlong *)FUN_1400a3170(&local_198);
    puVar12 = (undefined *)*plVar9;
    if ((undefined *)*plVar9 == (undefined *)0x0) {
      puVar12 = PTR_DAT_1402f8010;
    }
    FUN_14003c600(&local_1a8,L"Unstability in Connect #1! Process=%s",puVar12);
    if (((local_198 != (undefined *)0x0) && (local_198 != PTR_DAT_1402f8010)) &&
       (local_198 + -8 != (undefined *)0x0)) {
      uVar8 = FUN_1400a3440();
      local_120 = uVar8;
      FUN_1400a1c30(uVar8);
      local_118 = 1;
      piVar2 = (int *)(local_198 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(local_198 + -8);
      }
      FUN_1400d1290(uVar8);
      local_118 = 0;
    }
    local_198 = PTR_DAT_1402f8010;
    FUN_1400a3440();
    plVar9 = local_1a8;
    local_1b0 = (longlong *)PTR_DAT_1402f8010;
    if (PTR_DAT_1402f8010 == (undefined *)0x0) {
      local_1b0 = plVar11;
    }
    if (local_1a8 != (longlong *)PTR_DAT_1402f8010) {
      uVar8 = FUN_1400a3440();
      local_130 = uVar8;
      FUN_1400a1c30(uVar8);
      local_128 = 1;
      FUN_1400031d0(&local_1b0);
      local_1b0 = plVar9;
      if (((plVar9 != (longlong *)PTR_DAT_1402f8010) && (plVar9 != (longlong *)0x0)) &&
         (plVar9 != (longlong *)0x8)) {
        *(int *)((longlong)plVar9 + -4) = *(int *)((longlong)plVar9 + -4) + 1;
      }
      FUN_1400d1290(uVar8);
      local_128 = 0;
    }
    FUN_1400a6370(&local_1b0);
    if (((plVar9 != (longlong *)0x0) && (plVar9 != (longlong *)PTR_DAT_1402f8010)) &&
       (plVar9 + -1 != (longlong *)0x0)) {
      uVar8 = FUN_1400a3440();
      local_180 = uVar8;
      FUN_1400a1c30(uVar8);
      local_178 = 1;
      piVar2 = (int *)((longlong)plVar9 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(plVar9 + -1);
      }
      FUN_1400d1290(uVar8);
      local_178 = 0;
    }
    local_1a8 = (longlong *)PTR_DAT_1402f8010;
  }
  puVar12 = (undefined *)*param_2;
  if ((undefined *)*param_2 == (undefined *)0x0) {
    puVar12 = PTR_DAT_1402f8010;
  }
  iVar7 = FUN_1400a3300(puVar12,L"0.0.0.0");
  if (((iVar7 != 0) && ((short)param_2[1] != 0)) && ((short)param_2[1] != -1)) {
    puVar12 = (undefined *)*param_2;
    if ((undefined *)*param_2 == (undefined *)0x0) {
      puVar12 = PTR_DAT_1402f8010;
    }
    iVar7 = FUN_1400a3300(puVar12,L"255.255.255.255");
    if (iVar7 != 0) {
      dVar13 = (double)param_2[9];
      if ((double)param_2[9] <= 0.0) {
        dVar13 = DAT_1402f81a0;
      }
      param_1[0x2fe] = (longlong)dVar13;
      FUN_1401bd0e0(param_1 + 0x2e1);
      FUN_1401bd0b0(param_1 + 0x301,param_1[0x2fe]);
      FUN_1401bd0e0(param_1 + 0x301);
      FUN_1401bd0e0(param_1 + 9);
      FUN_14017eb20(param_1 + 0x2ae);
      FUN_14017eb20(param_1 + 0x2b2);
      lVar14 = (**(code **)(*param_1 + 0x1c0))(param_1);
      param_1[0x30a] = lVar14;
      *(undefined1 *)(param_1 + 0xbc) = 0;
      lVar14 = FUN_1400a35f0();
      param_1[0xba] = lVar14;
      param_1[0xbb] = DAT_1402f8090;
      cVar6 = FUN_1400ad850(param_1 + 0x2b6);
      if (cVar6 == '\0') {
        FUN_1400ad750(param_1 + 0x2b6);
      }
      FUN_1400ad700(param_1 + 0x2b6);
      uStack_d4 = uStack_d4 & 0xffffff00;
      local_d8 = 0;
      local_d0 = 0;
      param_1[0xbd] = 0;
      param_1[0xbe] = 0;
      param_1[0xbf] = 0;
      param_1[0xc0] = 0;
      param_1[0xc1] = 0;
      param_1[0xc2] = 0;
      param_1[0xc3] = (ulonglong)uStack_d4 << 0x20;
      param_1[0xc4] = (ulonglong)uStack_cc << 0x20;
      lVar14 = (**(code **)(*param_1 + 0x1c0))(param_1);
      param_1[699] = lVar14;
      *(undefined4 *)(param_1 + 0xd2) = 0;
      param_1[0xab] = 0;
      *(undefined4 *)((longlong)param_1 + 0x47c) = 0;
      param_1[0x90] = 0;
      param_1[0x91] = 0;
      param_1[0x92] = 0;
      *(undefined4 *)(param_1 + 0x2a1) = 0;
      param_1[0x304] = 0;
      *(undefined4 *)(param_1 + 0x8d) = 0;
      local_1b8 = operator_new(0x200);
      plVar9 = plVar11;
      if (local_1b8 != (longlong *)0x0) {
        if (plVar1 != (longlong *)0x0) {
          plVar9 = plVar10;
        }
        plVar9 = (longlong *)FUN_1401b8520(local_1b8,plVar9);
      }
      if ((plVar9 == (longlong *)0x0) || (plVar9 + 8 == (longlong *)0x0)) {
        local_1b8 = (longlong *)0x0;
      }
      else {
        local_1b8 = (longlong *)FUN_1400a34c0(0x10);
        local_1b8[1] = 1;
        *local_1b8 = (longlong)(plVar9 + 8);
      }
      plVar10 = local_1b8;
      FUN_14016b650(param_1 + 0x2ad,&local_1b8);
      plVar9 = local_1b8;
      if (plVar10 != (longlong *)0x0) {
        plVar10 = plVar10 + 1;
        *plVar10 = *plVar10 + -1;
        if (*plVar10 == 0) {
          puVar3 = (undefined8 *)*local_1b8;
          if (puVar3 != (undefined8 *)0x0) {
            (**(code **)*puVar3)(puVar3,1);
          }
          FUN_1400a3530(plVar9);
        }
      }
      *(undefined1 *)(param_1 + 0x8f) = 0;
      FUN_14016ba60(param_1 + 0x2a3,param_2);
      uVar8 = FUN_14016c6b0(param_1 + 0x2a3);
      uVar8 = FUN_14016b2c0(uVar8);
      FUN_140003100(param_1 + 0x2a3,uVar8);
      puVar12 = (undefined *)param_1[0x2a3];
      if (((puVar12 == (undefined *)0x0) || (puVar12 == PTR_DAT_1402f8010)) ||
         (*(int *)(puVar12 + -8) == 0)) {
        FUN_14001f680(param_1 + 0x2a3,L"localhost");
      }
      local_1c8 = operator_new(0x240);
      plVar10 = plVar11;
      if (local_1c8 != (undefined8 *)0x0) {
        plVar10 = (longlong *)FUN_1401b18f0(local_1c8,plVar1);
      }
      if (plVar10 == (longlong *)0x0) {
        local_1c8 = (undefined8 *)0x0;
      }
      else {
        local_1c8 = (undefined8 *)FUN_1400a34c0(0x10);
        local_1c8[1] = 1;
        *local_1c8 = plVar10;
      }
      puVar3 = local_1c8;
      FUN_14016b5d0(param_1 + 0x2a0,&local_1c8);
      puVar5 = local_1c8;
      if (puVar3 != (undefined8 *)0x0) {
        plVar10 = puVar3 + 1;
        *plVar10 = *plVar10 + -1;
        if (*plVar10 == 0) {
          operator_delete((void *)*local_1c8);
          FUN_1400a3530(puVar5);
        }
      }
      local_1c0 = operator_new(0x140);
      if (local_1c0 != (undefined8 *)0x0) {
        plVar11 = (longlong *)FUN_1401a9310(local_1c0,plVar1);
      }
      if (plVar11 == (longlong *)0x0) {
        local_1c0 = (undefined8 *)0x0;
      }
      else {
        local_1c0 = (undefined8 *)FUN_1400a34c0(0x10);
        local_1c0[1] = 1;
        *local_1c0 = plVar11;
      }
      puVar3 = local_1c0;
      FUN_14016c750(param_1 + 0xac,&local_1c0);
      puVar5 = local_1c0;
      if (puVar3 != (undefined8 *)0x0) {
        plVar10 = puVar3 + 1;
        *plVar10 = *plVar10 + -1;
        if (*plVar10 == 0) {
          pvVar4 = (void *)*local_1c0;
          if (pvVar4 != (void *)0x0) {
            FUN_1401aa050(pvVar4);
            operator_delete(pvVar4);
          }
          FUN_1400a3530(puVar5);
        }
      }
      FUN_1400d1290(local_160);
      FUN_1400d1290(local_140);
      return 1;
    }
  }
  uVar8 = FUN_140141430(0xe);
  FUN_1400a2320(local_80,uVar8);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_80,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_14017f5a0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  void *pvVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined8 local_res10;
  undefined8 local_res18;
  undefined8 *local_res20;
  undefined **local_70;
  undefined8 local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  
  *param_1 = Proud::CNetClientImpl::vftable;
  param_1[0xc] = Proud::CNetClientImpl::vftable;
  param_1[0xd] = Proud::CNetClientImpl::vftable;
  plVar4 = param_1 + 0xe;
  *plVar4 = (longlong)Proud::CNetClientImpl::vftable;
  param_1[0xf] = Proud::CNetClientImpl::vftable;
  param_1[0x11] = Proud::CNetClientImpl::vftable;
  param_1[0x12] = Proud::CNetClientImpl::vftable;
  param_1[0x13] = Proud::CNetClientImpl::vftable;
  lVar3 = 0;
  local_68 = 0;
  local_60 = 0;
  local_58 = 0;
  local_50 = 0;
  local_70 = Proud::ByteArray::vftable;
  (**(code **)(*plVar4 + 0x80))(plVar4,DAT_1402f8130,&local_70,param_4,0xfffffffffffffffe);
  FUN_140140df0(&local_70);
  FUN_140187a60(param_1);
  if (param_1[0xbb] != 0) {
    lVar3 = *(longlong *)(param_1[0xbb] + 0x38);
  }
  FUN_1400a1c30(lVar3 + 0x10);
  FUN_14017e380(param_1 + 0xbc);
  local_res10 = 0;
  FUN_14016b5d0(param_1 + 0x2ae,&local_res10);
  FUN_14017eb20(param_1 + 700);
  FUN_14017eb20(param_1 + 0x2c0);
  FUN_140176ea0(param_1 + 0x2e0);
  FUN_140177070(param_1 + 0x2a6);
  FUN_140177070(param_1 + 0xdc);
  FUN_140178a10(param_1 + 0x2ca);
  local_res18 = 0;
  FUN_14016b650(param_1 + 0x2a4,&local_res18);
  if (param_1[0x16] != 0) {
    FUN_1401695c0(param_1[0x16],param_1);
  }
  FUN_1400d1290(lVar3 + 0x10);
  puVar1 = (undefined8 *)param_1[0xb];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  param_1[0xb] = 0;
  FUN_14018a150(param_1 + 0x307);
  FUN_140186ed0(param_1 + 0x303);
  FUN_14018a150(param_1 + 0x2fe);
  FUN_140186ed0(param_1 + 0x2fa);
  FUN_140177110(param_1 + 0x2f6);
  puVar1 = (undefined8 *)param_1[0x2f6];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_14017a600(param_1 + 0x2e4);
  FUN_140176ea0(param_1 + 0x2e0);
  puVar1 = (undefined8 *)param_1[0x2e0];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_14017a600(param_1 + 0x2d5);
  FUN_14017a600(param_1 + 0x2ca);
  FUN_14017eb20(param_1 + 0x2c0);
  puVar1 = (undefined8 *)param_1[0x2c0];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_14017eb20(param_1 + 700);
  puVar1 = (undefined8 *)param_1[700];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  if ((param_1[699] != 0) &&
     (*(longlong *)(param_1[699] + 8) = *(longlong *)(param_1[699] + 8) + -1,
     *(longlong *)(param_1[699] + 8) == 0)) {
    plVar4 = (longlong *)param_1[699];
    puVar1 = (undefined8 *)*plVar4;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    FUN_1400a3530(plVar4);
  }
  local_res20 = param_1 + 0x2b1;
  FUN_140140df0(param_1 + 0x2b5);
  FUN_1400031d0(param_1 + 0x2b1);
  if ((param_1[0x2ae] != 0) &&
     (*(longlong *)(param_1[0x2ae] + 8) = *(longlong *)(param_1[0x2ae] + 8) + -1,
     *(longlong *)(param_1[0x2ae] + 8) == 0)) {
    puVar1 = (undefined8 *)param_1[0x2ae];
    operator_delete((void *)*puVar1);
    FUN_1400a3530(puVar1);
  }
  param_1[0x2ac] = 0;
  param_1[0x2ab] = Proud::IP2PGroupMember::vftable;
  param_1[0x2aa] = Proud::ISendDest_C::vftable;
  FUN_140177070(param_1 + 0x2a6);
  puVar1 = (undefined8 *)param_1[0x2a6];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  if ((param_1[0x2a4] != 0) &&
     (*(longlong *)(param_1[0x2a4] + 8) = *(longlong *)(param_1[0x2a4] + 8) + -1,
     *(longlong *)(param_1[0x2a4] + 8) == 0)) {
    plVar4 = (longlong *)param_1[0x2a4];
    puVar1 = (undefined8 *)*plVar4;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    FUN_1400a3530(plVar4);
  }
  FUN_1400acf90(param_1 + 0x161);
  FUN_140140df0(param_1 + 0x15b);
  FUN_140177070(param_1 + 0xdc);
  puVar1 = (undefined8 *)param_1[0xdc];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_14017e6e0(param_1 + 0xbc);
  FUN_14016b1c0(param_1 + 0xbb);
  if ((param_1[0xba] != 0) &&
     (*(longlong *)(param_1[0xba] + 8) = *(longlong *)(param_1[0xba] + 8) + -1,
     *(longlong *)(param_1[0xba] + 8) == 0)) {
    puVar1 = (undefined8 *)param_1[0xba];
    pvVar2 = (void *)*puVar1;
    if (pvVar2 != (void *)0x0) {
      FUN_1401aa050(pvVar2);
      operator_delete(pvVar2);
    }
    FUN_1400a3530(puVar1);
  }
  FUN_1400a1cd0(param_1 + 0xa3);
  puVar1 = (undefined8 *)param_1[0x9c];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_140140df0(param_1 + 0x95);
  param_1[0x13] = Proud::IVizAgentDg::vftable;
  if (param_1[0x16] != 0) {
    FUN_1401695c0(param_1[0x16],param_1);
  }
  param_1[0x12] = Proud::IUdpPacketFragBoardDg::vftable;
  param_1[0x11] = Proud::IUdpPacketDefragBoardDg::vftable;
  param_1[0xf] = Proud::IFastSocketDelegate::vftable;
  param_1[0xe] = Proud::IRmiHost::vftable;
  param_1[0xd] = Proud::IP2PGroupMember::vftable;
  param_1[0xc] = Proud::ISendDest_C::vftable;
  FUN_140187700(param_1);
  return;
}



undefined8 FUN_14017faf0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x480);
}



undefined4 FUN_14017fb00(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x1518);
}



undefined8 FUN_14017fb10(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x488);
}



void thunk_FUN_140187910(longlong param_1,longlong param_2)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  int iVar8;
  
  iVar5 = 0;
  lVar6 = 0;
  if (0 < *(int *)(param_1 + 0x48)) {
    lVar1 = param_1 + 0x30;
    while( true ) {
      if ((lVar6 < 0) || (*(int *)(param_1 + 0x48) <= iVar5)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      if (*(longlong *)(*(longlong *)(param_1 + 0x40) + lVar6 * 8) == param_2) break;
      iVar5 = iVar5 + 1;
      lVar6 = lVar6 + 1;
      if (*(int *)(param_1 + 0x48) <= iVar5) {
        return;
      }
    }
    if (iVar5 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    iVar2 = *(int *)(param_1 + 0x48) - iVar5;
    iVar8 = 1;
    if (iVar2 < 2) {
      iVar8 = iVar2;
    }
    iVar5 = (*(int *)(param_1 + 0x48) - iVar8) - iVar5;
    if (0 < iVar5) {
      lVar7 = (longlong)iVar5;
      lVar6 = lVar6 * 8;
      do {
        lVar3 = FUN_1401b2160(lVar1);
        lVar4 = FUN_1401b2160(lVar1);
        *(undefined8 *)(lVar4 + lVar6) = *(undefined8 *)((longlong)iVar8 * 8 + lVar3 + lVar6);
        lVar6 = lVar6 + 8;
        lVar7 = lVar7 + -1;
      } while (lVar7 != 0);
    }
    FUN_140195930(lVar1,*(int *)(param_1 + 0x48) - iVar8);
    *(undefined8 *)(param_2 + 0x10) = 0;
  }
  return;
}



void thunk_FUN_140169430(void)

{
  return;
}



void thunk_FUN_140187570(undefined8 param_1,longlong param_2)

{
  if ((*(longlong *)(param_2 + 8) == 0) && (*(longlong *)(param_2 + 0x10) == 0)) {
                    // WARNING: Subroutine does not return
    FUN_14019a830(param_1,param_2,param_2);
  }
  return;
}



void FUN_14017fb50(longlong param_1)

{
  FUN_140187ec0(param_1 + -0x70);
  return;
}



longlong FUN_14017fb80(longlong param_1)

{
  return param_1 + -0x98;
}



void FUN_14017fb90(longlong param_1)

{
  FUN_140182b00(param_1 + -0x90);
  return;
}



void FUN_14017fba0(longlong param_1)

{
  thunk_FUN_140187d00(param_1 + -0x70);
  return;
}



void FUN_14017fbb0(longlong param_1)

{
  FUN_140169550(param_1 + -0x88);
  return;
}



void FUN_14017fbc0(longlong param_1)

{
  FUN_140182b00(param_1 + -0x78);
  return;
}



void FUN_14017fbd0(longlong param_1)

{
  FUN_140182b00(param_1 + -0x98);
  return;
}



void FUN_14017fbe0(longlong param_1)

{
  thunk_FUN_1401877b0(param_1 + -0x70);
  return;
}



void FUN_14017fbf0(longlong param_1)

{
  FUN_140169550(param_1 + -0x70);
  return;
}



void FUN_14017fc00(longlong param_1)

{
  FUN_140182b00(param_1 + -0x60);
  return;
}



void FUN_14017fc10(longlong param_1)

{
  thunk_FUN_140187570(param_1 + -0x70);
  return;
}



void FUN_14017fc20(longlong param_1)

{
  thunk_FUN_140187b00(param_1 + -0x70);
  return;
}



void FUN_14017fc30(longlong param_1)

{
  FUN_140182b00(param_1 + -0x68);
  return;
}



void FUN_14017fc40(longlong param_1)

{
  FUN_140182b00(param_1 + -0x88);
  return;
}



void FUN_14017fc50(longlong param_1)

{
  thunk_FUN_140187910(param_1 + -0x70);
  return;
}



void FUN_14017fc60(longlong param_1)

{
  thunk_FUN_140169430(param_1 + -0x70);
  return;
}



void FUN_14017fc70(longlong param_1)

{
  FUN_14017fb00(param_1 + -8);
  return;
}



void FUN_14017fc80(longlong param_1)

{
  FUN_140182b00(param_1 + -0x70);
  return;
}



undefined8 FUN_14017fc90(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x458);
}



undefined8 FUN_14017fca0(longlong param_1)

{
  if (*(undefined8 **)(param_1 + 0x558) != (undefined8 *)0x0) {
    return **(undefined8 **)(param_1 + 0x558);
  }
  return 0;
}



void FUN_14017fcc0(longlong param_1)

{
  FUN_140169c40(param_1 + -0x18);
  return;
}



void FUN_14017fcd0(longlong param_1)

{
  FUN_140169fb0(param_1 + -0x70);
  return;
}



void FUN_14017fce0(longlong param_1)

{
  FUN_140169c40(param_1 + -0x20);
  return;
}



void FUN_14017fcf0(longlong param_1)

{
  FUN_140169cc0(param_1 + -0x88);
  return;
}



void FUN_14017fd00(longlong param_1)

{
  FUN_140169c40(param_1 + -8);
  return;
}



void FUN_14017fd10(longlong param_1)

{
  FUN_140169c40(param_1 + -0x28);
  return;
}



void FUN_14017fd20(longlong param_1)

{
  FUN_140169c90(param_1 + -0x70);
  return;
}



void FUN_14017fd30(longlong param_1)

{
  FUN_14016a2e0(param_1 + -0x70);
  return;
}



void FUN_14017fd40(longlong param_1)

{
  FUN_140169cc0(param_1 + -0x70);
  return;
}



void FUN_14017fd50(longlong param_1)

{
  FUN_140152150(param_1 + -0x70);
  return;
}



void FUN_14017fd60(longlong param_1)

{
  FUN_140151fd0(param_1 + -0x70);
  return;
}



void FUN_14017fd70(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 local_res18 [2];
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  local_res18[0] = 0;
  FUN_140141570(local_res18);
  FUN_140188230(param_1,local_res18,param_3,param_4,uVar1);
  FUN_14008c980(param_2);
  return;
}



void FUN_14017fdd0(longlong param_1)

{
  FUN_14017fd70(param_1 + -0x70);
  return;
}



void FUN_14017fde0(longlong param_1)

{
  FUN_14017e170(param_1 + -0x70);
  return;
}



void FUN_14017fdf0(longlong *param_1,undefined8 param_2)

{
  undefined8 uVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined1 uVar4;
  undefined8 uVar5;
  undefined4 local_140 [2];
  undefined1 local_138 [8];
  undefined1 local_130 [8];
  longlong local_128;
  int local_11c;
  undefined4 local_110;
  undefined **local_108;
  undefined4 local_100;
  undefined2 local_fc;
  undefined1 local_f8;
  undefined1 local_f0 [232];
  
  uVar5 = 0xfffffffffffffffe;
  uVar1 = (**(code **)(*param_1 + 0x58))();
  uVar3 = uVar1;
  FUN_1400a1c30(uVar1);
  uVar4 = 1;
  local_140[0] = 0;
  FUN_140185560(local_138);
  local_108 = Proud::AddrPort::vftable;
  local_f8 = 0;
  local_110 = 0;
  local_100 = DAT_1402f83d0;
  local_fc = DAT_1402f83d4;
  FUN_14015de40(local_f0,param_2);
  lVar2 = FUN_14017ebd0(param_1 + 700,local_140,param_1[0x2be],0,uVar3,uVar4,uVar5);
  if ((longlong *)param_1[0x2be] == (longlong *)0x0) {
    param_1[0x2bd] = lVar2;
  }
  else {
    *(longlong *)param_1[0x2be] = lVar2;
  }
  param_1[0x2be] = lVar2;
  FUN_14015c350(local_f0);
  FUN_14019a730(local_130);
  if ((local_128 != 0) && (local_11c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_1400d1290(uVar1);
  return;
}



void FUN_14017ff20(undefined8 param_1,longlong *param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  undefined4 local_118 [2];
  undefined8 local_110 [2];
  undefined8 local_100;
  undefined8 local_f8;
  undefined **local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  longlong local_c0;
  ulonglong local_b8;
  undefined4 local_a8;
  undefined **local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined **local_70;
  undefined4 local_68;
  undefined2 local_64;
  undefined **local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  lVar3 = 0;
  local_110[0] = 0;
  local_100 = 0;
  local_f8 = 0;
  local_e8 = 0;
  local_e0 = 0;
  local_d8 = 0;
  local_d0 = 0;
  local_f0 = Proud::ByteArray::vftable;
  local_b8 = 0;
  local_c0 = 0;
  local_c8 = 0;
  local_98 = 0;
  local_90 = 0;
  local_88 = 0;
  local_80 = 0;
  local_a0 = Proud::ByteArray::vftable;
  local_70 = Proud::AddrPort::vftable;
  local_68 = 0;
  local_64 = 0;
  local_50 = 0;
  local_48 = 0;
  local_40 = 0;
  local_38 = 0;
  local_58 = Proud::ByteArray::vftable;
  local_118[0] = 0x14;
  FUN_140141570(local_110);
  lVar1 = *param_2;
  lVar2 = lVar3;
  if (lVar1 != 0) {
    lVar2 = *(longlong *)(lVar1 + 0x38);
  }
  local_a8 = *(undefined4 *)(lVar2 + 0xc);
  if (lVar1 != 0) {
    lVar3 = *(longlong *)(lVar1 + 0x38);
  }
  local_68 = *(undefined4 *)(lVar3 + 0x20);
  local_64 = *(undefined2 *)(lVar3 + 0x24);
  FUN_14017fdf0(param_1,local_118);
  FUN_140140df0(&local_58);
  FUN_140140df0(&local_a0);
  FUN_14019a730(&local_c8);
  if (local_c0 != 0) {
    if ((longlong)local_b8 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_b8 = local_b8 & 0xffffffff00000000;
  }
  FUN_140140df0(&local_f0);
  FUN_14015bf40(&local_f8);
  FUN_14015bec0(&local_100);
  FUN_14008c980(local_110);
  FUN_14008c980(param_2);
  return;
}



void FUN_1401800a0(undefined8 param_1,longlong *param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  undefined4 local_118 [2];
  undefined8 local_110 [2];
  undefined8 local_100;
  undefined8 local_f8;
  undefined **local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  longlong local_c0;
  ulonglong local_b8;
  undefined4 local_a8;
  undefined **local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined **local_70;
  undefined4 local_68;
  undefined2 local_64;
  undefined **local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  lVar3 = 0;
  local_110[0] = 0;
  local_100 = 0;
  local_f8 = 0;
  local_e8 = 0;
  local_e0 = 0;
  local_d8 = 0;
  local_d0 = 0;
  local_f0 = Proud::ByteArray::vftable;
  local_b8 = 0;
  local_c0 = 0;
  local_c8 = 0;
  local_98 = 0;
  local_90 = 0;
  local_88 = 0;
  local_80 = 0;
  local_a0 = Proud::ByteArray::vftable;
  local_70 = Proud::AddrPort::vftable;
  local_68 = 0;
  local_64 = 0;
  local_50 = 0;
  local_48 = 0;
  local_40 = 0;
  local_38 = 0;
  local_58 = Proud::ByteArray::vftable;
  local_118[0] = 0x15;
  FUN_140141570(local_110);
  lVar1 = *param_2;
  lVar2 = lVar3;
  if (lVar1 != 0) {
    lVar2 = *(longlong *)(lVar1 + 0x38);
  }
  local_a8 = *(undefined4 *)(lVar2 + 0xc);
  if (lVar1 != 0) {
    lVar3 = *(longlong *)(lVar1 + 0x38);
  }
  local_68 = *(undefined4 *)(lVar3 + 0x20);
  local_64 = *(undefined2 *)(lVar3 + 0x24);
  FUN_14017fdf0(param_1,local_118);
  FUN_140140df0(&local_58);
  FUN_140140df0(&local_a0);
  FUN_14019a730(&local_c8);
  if (local_c0 != 0) {
    if ((longlong)local_b8 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_b8 = local_b8 & 0xffffffff00000000;
  }
  FUN_140140df0(&local_f0);
  FUN_14015bf40(&local_f8);
  FUN_14015bec0(&local_100);
  FUN_14008c980(local_110);
  FUN_14008c980(param_2);
  return;
}



void FUN_140180220(longlong *param_1,longlong param_2)

{
  undefined8 uVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  uVar3 = 0xfffffffffffffffe;
  uVar1 = (**(code **)(*param_1 + 0x58))();
  uVar4 = uVar1;
  FUN_1400a1c30(uVar1);
  lVar2 = FUN_14017ebd0(param_1 + 0x2c0,param_2,param_1[0x2c2],0,uVar3,uVar4,1);
  if ((longlong *)param_1[0x2c2] == (longlong *)0x0) {
    param_1[0x2c1] = lVar2;
  }
  else {
    *(longlong *)param_1[0x2c2] = lVar2;
  }
  param_1[0x2c2] = lVar2;
  FUN_140185160(param_2 + 8,0);
  FUN_1400d1290(uVar1);
  return;
}



void FUN_1401802c0(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  bool bVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined4 *puVar7;
  undefined8 *puVar8;
  undefined1 local_188 [16];
  undefined1 local_178 [8];
  longlong local_170;
  int local_164;
  longlong local_130;
  longlong local_120;
  longlong local_118;
  undefined1 local_110 [40];
  undefined1 local_e8 [8];
  longlong local_e0;
  undefined4 local_d8;
  int local_d4;
  undefined1 local_c0 [72];
  undefined1 local_78 [56];
  
  uVar6 = (**(code **)(*param_1 + 0x58))();
  FUN_1400a1c30(uVar6);
  lVar1 = param_1[0x2c3];
  while( true ) {
    if (lVar1 == 0) {
      FUN_1400d1290(uVar6);
      return;
    }
    puVar7 = (undefined4 *)FUN_14017eaa0(param_1 + 0x2c0,local_188);
    lVar1 = param_1[0x2be];
    plVar2 = (longlong *)param_1[700];
    if (plVar2 == (longlong *)0x0) {
      puVar8 = (undefined8 *)FUN_1400a34c0(0x148);
    }
    else {
      puVar8 = (undefined8 *)(**(code **)(*plVar2 + 8))(plVar2,0x148);
    }
    if (puVar8 != (undefined8 *)0x0) {
      *(undefined4 *)(puVar8 + 2) = *puVar7;
      FUN_140185590(puVar8 + 3,puVar7 + 2);
      *(undefined4 *)(puVar8 + 8) = puVar7[0xc];
      puVar8[9] = Proud::AddrPort::vftable;
      *(undefined4 *)(puVar8 + 10) = puVar7[0x10];
      *(undefined2 *)((longlong)puVar8 + 0x54) = *(undefined2 *)(puVar7 + 0x11);
      *(undefined1 *)(puVar8 + 0xb) = *(undefined1 *)(puVar7 + 0x12);
      FUN_14015de40(puVar8 + 0xc,puVar7 + 0x14);
    }
    puVar8[1] = lVar1;
    *puVar8 = 0;
    param_1[0x2bf] = param_1[0x2bf] + 1;
    if ((undefined8 *)param_1[0x2be] == (undefined8 *)0x0) {
      param_1[0x2bd] = (longlong)puVar8;
    }
    else {
      *(undefined8 *)param_1[0x2be] = puVar8;
    }
    param_1[0x2be] = (longlong)puVar8;
    FUN_140140df0(local_78);
    FUN_140140df0(local_c0);
    FUN_14019a730(local_e8);
    if (local_e0 != 0) {
      if (local_d4 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_d8 = 0;
    }
    FUN_140140df0(local_110);
    lVar1 = local_118;
    if (local_118 != 0) {
      FUN_1400a1c30(local_118);
      bVar4 = true;
      *(longlong *)(local_118 + 0x40) = *(longlong *)(local_118 + 0x40) + -1;
      if (*(longlong *)(local_118 + 0x40) == 0) {
        FUN_1400d1290(lVar1);
        lVar5 = local_118;
        bVar4 = false;
        lVar3 = *(longlong *)(local_118 + 0x38);
        if (lVar3 != 0) {
          FUN_140148d50(lVar3 + 0x28);
          FUN_1400a3530(lVar3);
        }
        FUN_1400a1cd0(lVar5);
        FUN_1400a3530(lVar5);
      }
      if (bVar4) {
        FUN_1400d1290(lVar1);
      }
    }
    lVar1 = local_120;
    if (local_120 != 0) {
      FUN_1400a1c30(local_120);
      bVar4 = true;
      *(longlong *)(local_120 + 0x40) = *(longlong *)(local_120 + 0x40) + -1;
      if (*(longlong *)(local_120 + 0x40) == 0) {
        FUN_1400d1290(lVar1);
        lVar5 = local_120;
        bVar4 = false;
        lVar3 = *(longlong *)(local_120 + 0x38);
        if (lVar3 != 0) {
          FUN_1400031d0(lVar3 + 0x98);
          FUN_140148d50(lVar3 + 0x38);
          FUN_1400a3530(lVar3);
        }
        FUN_1400a1cd0(lVar5);
        FUN_1400a3530(lVar5);
      }
      if (bVar4) {
        FUN_1400d1290(lVar1);
      }
    }
    lVar1 = local_130;
    if (local_130 != 0) {
      FUN_1400a1c30(local_130);
      bVar4 = true;
      *(longlong *)(local_130 + 0x40) = *(longlong *)(local_130 + 0x40) + -1;
      if (*(longlong *)(local_130 + 0x40) == 0) {
        FUN_1400d1290(lVar1);
        lVar5 = local_130;
        bVar4 = false;
        lVar3 = *(longlong *)(local_130 + 0x38);
        if (lVar3 != 0) {
          FUN_1400031d0(lVar3 + 0x58);
          FUN_140140df0(lVar3 + 0x28);
          FUN_1400031d0(lVar3 + 0x10);
          FUN_1400a3530(lVar3);
        }
        FUN_1400a1cd0(lVar5);
        FUN_1400a3530(lVar5);
      }
      if (bVar4) {
        FUN_1400d1290(lVar1);
      }
    }
    FUN_14019a730(local_178);
    if ((local_170 != 0) && (local_164 < 0)) break;
    lVar1 = param_1[0x2c3];
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x0001401809b8)
// WARNING: Removing unreachable block (ram,0x0001401808b9)
// WARNING: Removing unreachable block (ram,0x0001401808c9)
// WARNING: Removing unreachable block (ram,0x0001401809c3)
// WARNING: Removing unreachable block (ram,0x0001401808dd)
// WARNING: Removing unreachable block (ram,0x0001401808e5)
// WARNING: Removing unreachable block (ram,0x0001401808ef)
// WARNING: Removing unreachable block (ram,0x0001401809ad)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140180680(longlong param_1,char param_2)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  longlong *plVar4;
  undefined8 *puVar5;
  longlong lVar6;
  longlong lVar7;
  undefined8 uVar8;
  undefined1 auStack_1a8 [40];
  longlong local_180;
  longlong *local_178;
  undefined8 local_170;
  undefined8 local_168;
  undefined8 local_160;
  undefined8 local_158;
  undefined8 local_150;
  undefined8 local_148;
  undefined1 local_140;
  undefined8 local_138;
  undefined4 local_100;
  uint uStack_fc;
  undefined4 local_f8;
  uint uStack_f4;
  undefined1 local_f0 [24];
  undefined1 local_d8 [24];
  undefined1 local_c0 [56];
  undefined *local_88 [4];
  undefined1 local_68 [48];
  ulonglong local_38;
  
  local_138 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_1a8;
  (**(code **)(*(longlong *)(param_1 + 0x78) + 0x10))();
  lVar7 = 0;
  local_158 = 0;
  FUN_14016b5d0(param_1 + 0x1570,&local_158);
  if ((*(longlong **)(param_1 + 0x15d8) != (longlong *)0x0) &&
     (lVar6 = **(longlong **)(param_1 + 0x15d8), lVar6 != 0)) {
    if (*(char *)(lVar6 + 0x40) == '\0') {
      lVar6 = lVar7;
      if (*(longlong **)(param_1 + 0x15d8) != (longlong *)0x0) {
        lVar6 = **(longlong **)(param_1 + 0x15d8);
      }
      if (*(char *)(lVar6 + 0x80) == '\0') goto LAB_14018075b;
    }
    local_170 = 0;
    FUN_14016b650(&local_170,param_1 + 0x15d8);
    lVar6 = lVar7;
    if (*(longlong *)(param_1 + 0x5d8) != 0) {
      lVar6 = *(longlong *)(*(longlong *)(param_1 + 0x5d8) + 0x38);
    }
    FUN_1401ae3a0(lVar6,&local_170);
  }
LAB_14018075b:
  if ((*(longlong **)(param_1 + 0x1520) != (longlong *)0x0) &&
     (lVar6 = **(longlong **)(param_1 + 0x1520), lVar6 != 0)) {
    if (*(char *)(lVar6 + 0x40) == '\0') {
      lVar6 = lVar7;
      if (*(longlong **)(param_1 + 0x1520) != (longlong *)0x0) {
        lVar6 = **(longlong **)(param_1 + 0x1520);
      }
      if (*(char *)(lVar6 + 0x80) == '\0') goto LAB_1401807cf;
    }
    local_168 = 0;
    FUN_14016b650(&local_168,param_1 + 0x1520);
    lVar6 = lVar7;
    if (*(longlong *)(param_1 + 0x5d8) != 0) {
      lVar6 = *(longlong *)(*(longlong *)(param_1 + 0x5d8) + 0x38);
    }
    FUN_1401ae3a0(lVar6,&local_168);
  }
LAB_1401807cf:
  local_150 = 0;
  FUN_14016b650(param_1 + 0x15d8,&local_150);
  local_160 = 0;
  FUN_14016b650(param_1 + 0x1520,&local_160);
  FUN_14017b740(param_1);
  plVar3 = *(longlong **)(param_1 + 0x1708);
  do {
    if (plVar3 == (longlong *)0x0) {
      FUN_140176ea0(param_1 + 0x1700);
      if (param_2 != '\0') {
        FUN_14017eb20(param_1 + 0x15e0);
      }
      FUN_1401964c0(param_1 + 0xd8);
      FUN_14003cda0(param_1 + 0x4a8,0);
      *(undefined4 *)(param_1 + 0x4d8) = 0;
      *(undefined1 *)(param_1 + 0x4e8) = 0;
      *(undefined4 *)(param_1 + 0x4ec) = 0;
      *(undefined8 *)(param_1 + 0x4f0) = 0;
      *(undefined8 *)(param_1 + 0x4f8) = 0;
      *(undefined8 *)(param_1 + 0x500) = 0;
      *(undefined8 *)(param_1 + 0x5c8) = 0;
      FUN_14017e380(param_1 + 0x5e0);
      uVar8 = FUN_1400a35f0();
      *(undefined8 *)(param_1 + 0x640) = uVar8;
      *(undefined8 *)(param_1 + 0x648) = DAT_1402f8090;
      *(undefined8 *)(param_1 + 0x510) = DAT_1402f8100;
      *(undefined1 *)(param_1 + 0x650) = 0;
      uStack_fc = uStack_fc & 0xffffff00;
      local_100 = 0;
      local_f8 = 0;
      *(undefined8 *)(param_1 + 0x658) = 0;
      *(undefined8 *)(param_1 + 0x660) = 0;
      *(undefined8 *)(param_1 + 0x668) = 0;
      *(undefined8 *)(param_1 + 0x670) = 0;
      *(undefined8 *)(param_1 + 0x678) = 0;
      *(undefined8 *)(param_1 + 0x680) = 0;
      *(ulonglong *)(param_1 + 0x688) = (ulonglong)uStack_fc << 0x20;
      *(ulonglong *)(param_1 + 0x690) = (ulonglong)uStack_f4 << 0x20;
      *(undefined4 *)(param_1 + 0x698) = DAT_1402f8110;
      puVar5 = (undefined8 *)FUN_1401a7a10(local_c0);
      *(undefined8 *)(param_1 + 0x6a0) = *puVar5;
      *(undefined8 *)(param_1 + 0x6a8) = puVar5[1];
      *(undefined8 *)(param_1 + 0x6b0) = puVar5[2];
      *(undefined8 *)(param_1 + 0x6b8) = puVar5[3];
      *(undefined8 *)(param_1 + 0x6c0) = puVar5[4];
      *(undefined8 *)(param_1 + 0x6c8) = puVar5[5];
      *(undefined4 *)(param_1 + 0x6d0) = 0;
      *(undefined4 *)(param_1 + 0x6d4) = 0;
      *(undefined4 *)(param_1 + 0x6d8) = 0;
      *(undefined4 *)(param_1 + 0x6dc) = 0;
      FUN_140177070(param_1 + 0x6e0);
      *(undefined4 *)(param_1 + 0x700) = 0;
      *(undefined1 *)(param_1 + 0x1528) = 0;
      FUN_140177070(param_1 + 0x1530);
      *(undefined4 *)(param_1 + 0x1578) = 0;
      uVar8 = FUN_140140b80(local_88);
      FUN_14016ba60(param_1 + 0x1588,uVar8);
      FUN_140140df0(local_68);
      if (((local_88[0] != (undefined *)0x0) && (local_88[0] != PTR_DAT_1402f8010)) &&
         (local_88[0] + -8 != (undefined *)0x0)) {
        uVar8 = FUN_1400a3440();
        local_148 = uVar8;
        FUN_1400a1c30(uVar8);
        local_140 = 1;
        piVar2 = (int *)(local_88[0] + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(local_88[0] + -8);
        }
        FUN_1400d1290(uVar8);
        local_140 = 0;
      }
      local_88[0] = PTR_DAT_1402f8010;
      FUN_14017eb20(param_1 + 0x1600);
      FUN_1400ad750(param_1 + 0x1620);
      *(undefined8 *)(param_1 + 0x1648) = 0;
      FUN_140178a10(param_1 + 0x1650);
      FUN_140178a10(param_1 + 0x16a8);
      puVar5 = (undefined8 *)FUN_1401bd100(local_f0,DAT_1402f8180);
      *(undefined8 *)(param_1 + 0x1778) = *puVar5;
      *(undefined8 *)(param_1 + 0x1780) = puVar5[1];
      *(undefined8 *)(param_1 + 0x1788) = puVar5[2];
      puVar5 = (undefined8 *)FUN_1401bd100(local_d8,DAT_1402f81a0);
      *(undefined8 *)(param_1 + 0x1878) = *puVar5;
      *(undefined8 *)(param_1 + 0x1880) = puVar5[1];
      *(undefined8 *)(param_1 + 0x1888) = puVar5[2];
      *(undefined8 *)(param_1 + 0x1798) = 0x3ff0000000000000;
      *(undefined8 *)(param_1 + 0x1890) = 0;
      *(undefined8 *)(param_1 + 0x18c0) = 0;
      *(undefined2 *)(param_1 + 0x18c8) = 0;
      *(undefined1 *)(param_1 + 0x18ca) = 0;
      *(undefined8 *)(param_1 + 0x1870) = 0;
      *(undefined8 *)(param_1 + 0x17a0) = 0;
      *(undefined8 *)(param_1 + 0x17a8) = 0;
      *(undefined8 *)(param_1 + 0xd0) = 0;
      return;
    }
    local_178 = (longlong *)0x0;
    if (plVar3[2] != 0) {
      *(longlong *)(plVar3[2] + 8) = *(longlong *)(plVar3[2] + 8) + 1;
      local_178 = (longlong *)plVar3[2];
    }
    lVar6 = lVar7;
    if (local_178 != (longlong *)0x0) {
      lVar6 = *local_178;
    }
    if (*(char *)(lVar6 + 0x40) == '\0') {
      lVar6 = lVar7;
      if (local_178 != (longlong *)0x0) {
        lVar6 = *local_178;
      }
      if (*(char *)(lVar6 + 0x80) != '\0') goto code_r0x00014018088f;
    }
    else {
code_r0x00014018088f:
      local_180 = 0;
      if (plVar3[2] != 0) {
        *(longlong *)(plVar3[2] + 8) = *(longlong *)(plVar3[2] + 8) + 1;
        local_180 = plVar3[2];
      }
      lVar6 = lVar7;
      if (*(longlong *)(param_1 + 0x5d8) != 0) {
        lVar6 = *(longlong *)(*(longlong *)(param_1 + 0x5d8) + 0x38);
      }
      FUN_1401ae3a0(lVar6,&local_180);
    }
    if (plVar3 == *(longlong **)(param_1 + 0x1708)) {
      *(longlong *)(param_1 + 0x1708) = *plVar3;
    }
    else {
      *(longlong *)plVar3[1] = *plVar3;
    }
    if (plVar3 == *(longlong **)(param_1 + 0x1710)) {
      *(longlong *)(param_1 + 0x1710) = plVar3[1];
    }
    else {
      *(longlong *)(*plVar3 + 8) = plVar3[1];
    }
    FUN_140175060(param_1 + 0x1700);
    plVar4 = local_178;
    if (local_178 != (longlong *)0x0) {
      plVar1 = local_178 + 1;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        if ((undefined8 *)*local_178 != (undefined8 *)0x0) {
          (*(code *)**(undefined8 **)*local_178)();
        }
        FUN_1400a3530(plVar4);
      }
    }
  } while( true );
}



void FUN_140180d60(longlong param_1,undefined4 *param_2,int *param_3,longlong param_4,
                  undefined8 param_5,undefined4 *param_6,undefined4 *param_7,longlong param_8,
                  longlong param_9,char *param_10,short *param_11)

{
  int iVar1;
  longlong lVar2;
  void *pvVar3;
  undefined8 *puVar4;
  longlong *plVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong *plVar8;
  undefined1 local_res8 [8];
  longlong *local_168;
  longlong *local_160;
  longlong *local_158;
  undefined8 *local_150;
  longlong local_148;
  longlong local_140;
  longlong local_138 [2];
  undefined4 local_128 [2];
  undefined8 local_120;
  undefined8 local_110;
  undefined8 local_108;
  undefined **local_100;
  undefined8 local_f8;
  undefined8 local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined4 local_c0;
  int local_bc;
  int local_b8;
  undefined **local_b0;
  undefined8 local_a8;
  longlong *local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined4 local_88;
  undefined **local_80;
  undefined4 local_78;
  undefined2 local_74;
  undefined **local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  (**(code **)(*(longlong *)(param_1 + 0x78) + 0x10))();
  if (((*(longlong **)(param_1 + 0x5d0) != (longlong *)0x0) &&
      (lVar2 = **(longlong **)(param_1 + 0x5d0), lVar2 != 0)) && (*(int *)(lVar2 + 0x100) == 3)) {
    FUN_14017bf90(param_1,&local_160,*param_2);
    plVar8 = (longlong *)0x0;
    if ((local_160 == (longlong *)0x0) || (*local_160 == 0)) {
      plVar5 = (longlong *)FUN_14017e900(param_1,&local_150,*param_2);
      plVar6 = (longlong *)*plVar5;
      if (plVar6 != local_160) {
        if (plVar6 != (longlong *)0x0) {
          *(longlong *)(*plVar5 + 8) = plVar6[1] + 1;
        }
        plVar6 = plVar8;
        if ((local_160 != (longlong *)0x0) && (local_160[1] = local_160[1] + -1, local_160[1] == 0))
        {
          plVar6 = local_160;
        }
        local_160 = (longlong *)*plVar5;
        if (plVar6 != (longlong *)0x0) {
          pvVar3 = (void *)*plVar6;
          if (pvVar3 != (void *)0x0) {
            FUN_140148eb0((longlong)pvVar3 + 8);
            operator_delete(pvVar3);
          }
          FUN_1400a3530(plVar6);
        }
      }
      if ((local_150 != (undefined8 *)0x0) && (local_150[1] = local_150[1] + -1, local_150[1] == 0))
      {
        pvVar3 = (void *)*local_150;
        if (pvVar3 != (void *)0x0) {
          FUN_140148eb0((longlong)pvVar3 + 8);
          operator_delete(pvVar3);
        }
        FUN_1400a3530(local_150);
      }
    }
    local_res8[0] = 0;
    if (*param_3 == 1) {
      if (param_1 == -0x1550) {
        local_140 = 0;
      }
      else {
        local_140 = param_1 + 0x1558;
      }
      plVar6 = plVar8;
      if (local_160 != (longlong *)0x0) {
        plVar6 = (longlong *)*local_160;
      }
      FUN_140176c30(plVar6 + 1,param_3,&local_140);
    }
    else {
      FUN_1401755f0(param_1,&local_168);
      plVar6 = plVar8;
      if (*(int *)(param_1 + 0x1578) == *param_3) {
        local_138[0] = param_1 + 0x68;
        if (local_160 != (longlong *)0x0) {
          plVar6 = (longlong *)*local_160;
        }
        plVar5 = local_138;
      }
      else {
        if ((local_168 == (longlong *)0x0) || (lVar2 = *local_168, lVar2 == 0)) {
          local_158 = operator_new(0x6c0);
          plVar5 = plVar8;
          if (local_158 != (void *)0x0) {
            plVar5 = (longlong *)FUN_1401bc0f0(local_158,param_1);
          }
          if (plVar5 == (longlong *)0x0) {
            local_158 = (longlong *)0x0;
          }
          else {
            local_158 = (longlong *)FUN_1400a34c0(0x10);
            local_158[1] = 1;
            *local_158 = (longlong)plVar5;
          }
          plVar5 = local_158;
          if (local_158 != local_168) {
            if (local_158 != (longlong *)0x0) {
              local_158[1] = local_158[1] + 1;
            }
            plVar7 = plVar8;
            if ((local_168 != (longlong *)0x0) &&
               (local_168[1] = local_168[1] + -1, local_168[1] == 0)) {
              plVar7 = local_168;
            }
            local_168 = local_158;
            if (plVar7 != (longlong *)0x0) {
              puVar4 = (undefined8 *)*plVar7;
              if (puVar4 != (undefined8 *)0x0) {
                (**(code **)*puVar4)(puVar4,1);
              }
              FUN_1400a3530(plVar7);
            }
          }
          plVar7 = local_158;
          if (plVar5 != (longlong *)0x0) {
            plVar5 = plVar5 + 1;
            *plVar5 = *plVar5 + -1;
            if (*plVar5 == 0) {
              puVar4 = (undefined8 *)*local_158;
              if (puVar4 != (undefined8 *)0x0) {
                (**(code **)*puVar4)(puVar4,1);
              }
              FUN_1400a3530(plVar7);
            }
          }
          plVar5 = plVar8;
          if (local_168 != (longlong *)0x0) {
            plVar5 = (longlong *)*local_168;
          }
          *(int *)((longlong)plVar5 + 0x56c) = *param_3;
          plVar5 = plVar8;
          if (local_168 != (longlong *)0x0) {
            plVar5 = (longlong *)*local_168;
          }
          *(undefined4 *)(plVar5 + 6) = *param_7;
          *(undefined4 *)((longlong)plVar5 + 0x34) = param_7[1];
          *(undefined4 *)(plVar5 + 7) = param_7[2];
          *(undefined4 *)((longlong)plVar5 + 0x3c) = param_7[3];
          plVar5 = plVar8;
          if (local_168 != (longlong *)0x0) {
            plVar5 = (longlong *)*local_168;
          }
          *(char *)((longlong)plVar5 + 0x25) = *param_10;
          plVar5 = plVar8;
          if (local_168 != (longlong *)0x0) {
            plVar5 = (longlong *)*local_168;
          }
          FUN_14017b8a0(param_1 + 0x1650,(longlong)plVar5 + 0x56c,&local_168);
          FUN_1401b2030(param_1 + 0x1650);
          plVar5 = plVar8;
          if (local_168 != (longlong *)0x0) {
            plVar5 = (longlong *)*local_168;
          }
          FUN_1401b88f0(plVar5,1);
          if (*(int *)(param_8 + 0x18) == 0) {
            plVar5 = plVar8;
            if (local_168 != (longlong *)0x0) {
              plVar5 = (longlong *)*local_168;
            }
            FUN_1401964c0(plVar5 + 0x2d);
          }
          else {
            plVar5 = plVar8;
            if (local_168 != (longlong *)0x0) {
              plVar5 = (longlong *)*local_168;
            }
            FUN_140195fe0(plVar5 + 0x2d,*(undefined8 *)(param_8 + 0x10),
                          *(uint *)(param_1 + 0x6bc) >> 3,0x10);
          }
          if (*(int *)(param_9 + 0x18) == 0) {
            plVar5 = plVar8;
            if (local_168 != (longlong *)0x0) {
              plVar5 = (longlong *)*local_168;
            }
            *(undefined1 *)(plVar5 + 0xac) = 1;
          }
          else {
            plVar5 = plVar8;
            if (local_168 != (longlong *)0x0) {
              plVar5 = (longlong *)*local_168;
            }
            FUN_1401a5720(plVar5 + 0xa7,*(undefined8 *)(param_9 + 0x10),
                          *(uint *)(param_1 + 0x6c0) >> 3);
          }
          plVar5 = plVar8;
          if (local_168 != (longlong *)0x0) {
            plVar5 = (longlong *)*local_168;
          }
          FUN_1401be150(plVar5 + 199,*param_6);
          if ((*param_11 != 0) && (*param_10 != '\0')) {
            plVar5 = plVar8;
            if (local_168 != (longlong *)0x0) {
              plVar5 = (longlong *)*local_168;
            }
            local_res8[0] = FUN_1401bb930(plVar5);
          }
        }
        else if (*(char *)(lVar2 + 0x684) != '\0') {
          FUN_1401ba950(lVar2,param_1);
          plVar5 = plVar8;
          if (local_168 != (longlong *)0x0) {
            plVar5 = (longlong *)*local_168;
          }
          *(int *)((longlong)plVar5 + 0x56c) = *param_3;
          plVar5 = plVar8;
          if (local_168 != (longlong *)0x0) {
            plVar5 = (longlong *)*local_168;
          }
          *(undefined4 *)(plVar5 + 6) = *param_7;
          *(undefined4 *)((longlong)plVar5 + 0x34) = param_7[1];
          *(undefined4 *)(plVar5 + 7) = param_7[2];
          *(undefined4 *)((longlong)plVar5 + 0x3c) = param_7[3];
          plVar7 = plVar8;
          if (local_168 != (longlong *)0x0) {
            plVar7 = (longlong *)*local_168;
          }
          *(char *)((longlong)plVar7 + 0x25) = *param_10;
          plVar7 = plVar8;
          if (local_168 != (longlong *)0x0) {
            plVar7 = (longlong *)*local_168;
          }
          FUN_1401b88f0(plVar7,CONCAT71((int7)((ulonglong)plVar5 >> 8),1));
          if (*(int *)(param_8 + 0x18) == 0) {
            plVar5 = plVar8;
            if (local_168 != (longlong *)0x0) {
              plVar5 = (longlong *)*local_168;
            }
            FUN_1401964c0(plVar5 + 0x2d);
            FUN_14003cda0(plVar5 + 0xa7,0);
          }
          else {
            plVar5 = plVar8;
            if (local_168 != (longlong *)0x0) {
              plVar5 = (longlong *)*local_168;
            }
            FUN_140195fe0(plVar5 + 0x2d,*(undefined8 *)(param_8 + 0x10),
                          *(uint *)(param_1 + 0x6bc) >> 3,0x10);
          }
          if (*(int *)(param_9 + 0x18) == 0) {
            plVar5 = plVar8;
            if (local_168 != (longlong *)0x0) {
              plVar5 = (longlong *)*local_168;
            }
            *(undefined1 *)(plVar5 + 0xac) = 1;
          }
          else {
            plVar5 = plVar8;
            if (local_168 != (longlong *)0x0) {
              plVar5 = (longlong *)*local_168;
            }
            FUN_1401a5720(plVar5 + 0xa7,*(undefined8 *)(param_9 + 0x10),
                          *(uint *)(param_1 + 0x6c0) >> 3);
          }
          plVar5 = plVar8;
          if (local_168 != (longlong *)0x0) {
            plVar5 = (longlong *)*local_168;
          }
          FUN_1401be150(plVar5 + 199,*param_6);
          if ((*param_11 != 0) && (*param_10 != '\0')) {
            plVar5 = plVar8;
            if (local_168 != (longlong *)0x0) {
              plVar5 = (longlong *)*local_168;
            }
            local_res8[0] = FUN_1401bb930(plVar5);
          }
          plVar5 = plVar8;
          if (local_168 != (longlong *)0x0) {
            plVar5 = (longlong *)*local_168;
          }
          *(undefined1 *)((longlong)plVar5 + 0x684) = 0;
          FUN_14017a590(param_1 + 0x16a8,param_3,0);
        }
        plVar5 = plVar8;
        if (local_160 != (longlong *)0x0) {
          plVar5 = (longlong *)*local_160;
        }
        plVar7 = plVar8;
        if (local_168 != (longlong *)0x0) {
          plVar7 = (longlong *)*local_168;
        }
        FUN_14017e800(plVar7 + 0xb6,plVar5,&local_160);
        if ((local_168 == (longlong *)0x0) || (*local_168 == 0)) {
          local_148 = 0;
        }
        else {
          local_148 = *local_168 + 8;
        }
        if (local_160 != (longlong *)0x0) {
          plVar6 = (longlong *)*local_160;
        }
        plVar5 = &local_148;
      }
      FUN_140176c30(plVar6 + 1,param_3,plVar5);
      plVar6 = local_168;
      if ((local_168 != (longlong *)0x0) && (local_168[1] = local_168[1] + -1, local_168[1] == 0)) {
        puVar4 = (undefined8 *)*local_168;
        if (puVar4 != (undefined8 *)0x0) {
          (**(code **)*puVar4)(puVar4,1);
        }
        FUN_1400a3530(plVar6);
      }
    }
    (**(code **)(*(longlong *)(param_1 + 0x1818) + 0x60))
              ((longlong *)(param_1 + 0x1818),1,&DAT_140318cf0,param_2,param_3,param_5,local_res8);
    local_120 = 0;
    local_110 = 0;
    local_108 = 0;
    local_f8 = 0;
    local_f0 = 0;
    local_e8 = 0;
    local_e0 = 0;
    local_100 = Proud::ByteArray::vftable;
    local_c8 = 0;
    local_d0 = 0;
    local_d8 = 0;
    local_a8 = 0;
    local_a0 = (longlong *)0x0;
    local_98 = 0;
    local_90 = 0;
    local_b0 = Proud::ByteArray::vftable;
    local_80 = Proud::AddrPort::vftable;
    local_78 = 0;
    local_74 = 0;
    local_60 = 0;
    local_58 = 0;
    local_50 = 0;
    local_48 = 0;
    local_68 = Proud::ByteArray::vftable;
    local_128[0] = 8;
    local_c0 = *param_2;
    local_bc = *param_3;
    plVar6 = plVar8;
    if (local_160 != (longlong *)0x0) {
      plVar6 = (longlong *)*local_160;
    }
    local_88 = (undefined4)plVar6[5];
    iVar1 = *(int *)(param_4 + 0x18);
    local_b8 = local_bc;
    if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_14003cda0(&local_b0,iVar1);
    plVar6 = plVar8;
    if (*(int *)(param_4 + 0x18) != 0) {
      plVar6 = *(longlong **)(param_4 + 0x10);
    }
    plVar5 = local_a0;
    if ((int)local_98 == 0) {
      plVar5 = plVar8;
    }
    FUN_1400224d0(plVar5,plVar6,(longlong)iVar1);
    FUN_14017fdf0(param_1,local_128);
    FUN_14015c350(local_128);
    plVar8 = local_160;
    if ((local_160 != (longlong *)0x0) && (local_160[1] = local_160[1] + -1, local_160[1] == 0)) {
      pvVar3 = (void *)*local_160;
      if (pvVar3 != (void *)0x0) {
        FUN_140148eb0((longlong)pvVar3 + 8);
        operator_delete(pvVar3);
      }
      FUN_1400a3530(plVar8);
    }
  }
  return;
}



undefined8
FUN_140181650(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined8 param_10,undefined8 param_11,undefined8 param_12,
             undefined8 param_13)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar1);
  FUN_140180d60(*(undefined8 *)(param_1 + 0x20),param_4,param_5,param_6,param_7,param_10,param_11,
                param_8,param_9,param_12,param_13);
  FUN_1400d1290(uVar1);
  return 1;
}



undefined8
FUN_140181730(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8,
             undefined8 param_9,undefined8 param_10,undefined8 param_11)

{
  undefined8 uVar1;
  undefined **local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined **local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined8 local_20;
  undefined8 local_18;
  
  uVar1 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30();
  local_30 = 0;
  local_28 = 0;
  local_20 = 0;
  local_18 = 0;
  local_38 = Proud::ByteArray::vftable;
  local_58 = 0;
  local_50 = 0;
  local_48 = 0;
  local_40 = 0;
  local_60 = Proud::ByteArray::vftable;
  FUN_140180d60(*(undefined8 *)(param_1 + 0x20),param_4,param_5,param_6,param_7,param_8,param_9,
                &local_60,&local_38,param_10,param_11);
  FUN_140140df0(&local_60);
  FUN_140140df0(&local_38);
  FUN_1400d1290(uVar1);
  return 1;
}



undefined8
FUN_140181880(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,int *param_5,
             longlong param_6,longlong param_7,longlong param_8,longlong param_9)

{
  int iVar1;
  undefined4 uVar2;
  undefined8 *puVar3;
  undefined8 uVar4;
  longlong *plVar5;
  longlong lVar6;
  int iVar7;
  undefined4 uVar8;
  undefined2 uVar9;
  undefined4 uVar10;
  undefined2 uVar11;
  undefined4 local_138 [2];
  undefined8 local_130;
  undefined8 local_120;
  undefined8 local_118;
  undefined **local_110;
  undefined8 local_108;
  undefined8 local_100;
  undefined8 local_f8;
  undefined8 local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  int local_c8;
  undefined **local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined **local_90;
  undefined4 local_88;
  undefined2 local_84;
  undefined **local_78;
  undefined8 local_70;
  undefined8 local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  iVar7 = *param_4;
  iVar1 = *param_5;
  uVar2 = *(undefined4 *)(param_6 + 8);
  param_5._0_2_ = *(undefined2 *)(param_6 + 0xc);
  uVar8 = *(undefined4 *)(param_7 + 8);
  uVar9 = *(undefined2 *)(param_7 + 0xc);
  uVar10 = *(undefined4 *)(param_8 + 8);
  uVar11 = *(undefined2 *)(param_8 + 0xc);
  param_7._0_4_ = *(undefined4 *)(param_9 + 8);
  param_6 = CONCAT62(param_6._2_6_,*(undefined2 *)(param_9 + 0xc));
  uVar4 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar4);
  if (*(int *)(*(longlong *)(param_1 + 0x20) + 0x1578) != iVar1) {
    iVar7 = iVar1;
    uVar8 = (undefined4)param_7;
    uVar9 = (undefined2)param_6;
    uVar10 = uVar2;
    uVar11 = param_5._0_2_;
  }
  plVar5 = (longlong *)FUN_1401755f0(*(longlong *)(param_1 + 0x20),&param_5,iVar7);
  lVar6 = 0;
  if ((longlong *)*plVar5 != (longlong *)0x0) {
    lVar6 = *(longlong *)*plVar5;
  }
  if ((CONCAT62(param_5._2_6_,param_5._0_2_) != 0) &&
     (plVar5 = (longlong *)(CONCAT62(param_5._2_6_,param_5._0_2_) + 8), *plVar5 = *plVar5 + -1,
     *(longlong *)(CONCAT62(param_5._2_6_,param_5._0_2_) + 8) == 0)) {
    plVar5 = (longlong *)CONCAT62(param_5._2_6_,param_5._0_2_);
    puVar3 = (undefined8 *)*plVar5;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    FUN_1400a3530(plVar5);
  }
  if ((lVar6 != 0) && (*(char *)(lVar6 + 0x684) == '\0')) {
    *(undefined4 *)(lVar6 + 0x598) = uVar10;
    *(undefined2 *)(lVar6 + 0x59c) = uVar11;
    *(undefined4 *)(lVar6 + 0x5a8) = uVar8;
    *(undefined2 *)(lVar6 + 0x5ac) = uVar9;
    FUN_1401b88f0(lVar6,0);
    param_6 = 0;
    FUN_140176e00(lVar6 + 0x28,&param_6);
    local_130 = 0;
    local_120 = 0;
    local_118 = 0;
    local_108 = 0;
    local_100 = 0;
    local_f8 = 0;
    local_f0 = 0;
    local_110 = Proud::ByteArray::vftable;
    local_d8 = 0;
    local_e0 = 0;
    local_e8 = 0;
    local_b8 = 0;
    local_b0 = 0;
    local_a8 = 0;
    local_a0 = 0;
    local_c0 = Proud::ByteArray::vftable;
    local_90 = Proud::AddrPort::vftable;
    local_88 = 0;
    local_84 = 0;
    local_70 = 0;
    local_68 = 0;
    local_60 = 0;
    local_58 = 0;
    local_78 = Proud::ByteArray::vftable;
    local_138[0] = 10;
    local_c8 = iVar7;
    FUN_14017fdf0(*(undefined8 *)(param_1 + 0x20),local_138);
    FUN_14015c350(local_138);
  }
  FUN_1400d1290(uVar4);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x000140181cb2)
// WARNING: Removing unreachable block (ram,0x000140181cc4)
// WARNING: Removing unreachable block (ram,0x000140181cdf)
// WARNING: Removing unreachable block (ram,0x000140181ce7)
// WARNING: Removing unreachable block (ram,0x000140181cf1)

undefined8
FUN_140181af0(longlong param_1,undefined8 param_2,undefined8 param_3,uint *param_4,uint *param_5)

{
  uint *puVar1;
  longlong lVar2;
  void *pvVar3;
  undefined8 *puVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong *local_res8;
  longlong *local_res20;
  undefined4 local_138 [2];
  undefined8 local_130 [2];
  undefined8 local_120;
  undefined8 local_118;
  undefined **local_110;
  undefined8 local_108;
  undefined8 local_100;
  undefined8 local_f8;
  undefined8 local_f0;
  undefined8 local_e8;
  longlong local_e0;
  ulonglong local_d8;
  uint local_d0;
  uint local_cc;
  uint local_c8;
  undefined **local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined4 local_98;
  undefined **local_90;
  undefined4 local_88;
  undefined2 local_84;
  undefined **local_78;
  undefined8 local_70;
  undefined8 local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_48;
  undefined1 local_40;
  undefined8 *local_38;
  undefined8 local_30;
  
  local_30 = 0xfffffffffffffffe;
  local_48 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(local_48);
  local_40 = 1;
  lVar6 = *(longlong *)(param_1 + 0x20);
  if ((*(char *)(lVar6 + 0x1790) != '\0') || (*(int *)(lVar6 + 0x6c8) != 0)) {
    FUN_140177c40(lVar6,1,&DAT_140257bb0,*(undefined4 *)(lVar6 + 0x1578),*param_4,*param_5);
  }
  FUN_1401755f0(*(undefined8 *)(param_1 + 0x20),&local_res20,*param_4);
  FUN_14017bf90(*(undefined8 *)(param_1 + 0x20),&local_res8,*param_5);
  if ((local_res8 != (longlong *)0x0) && (lVar6 = *local_res8, lVar6 != 0)) {
    uVar5 = (ulonglong)*param_4 % (ulonglong)*(uint *)(lVar6 + 0x30);
    if (*(longlong *)(lVar6 + 0x10) != 0) {
      puVar1 = *(uint **)(*(longlong *)(lVar6 + 0x10) + uVar5 * 8);
      while( true ) {
        if ((puVar1 == (uint *)0x0) || ((uint)uVar5 != puVar1[8] % *(uint *)(lVar6 + 0x30)))
        goto LAB_140181c0f;
        if (*puVar1 == *param_4) break;
        puVar1 = *(uint **)(puVar1 + 4);
      }
      FUN_1401455c0(lVar6 + 8,puVar1,0);
    }
  }
LAB_140181c0f:
  lVar6 = 0;
  if ((local_res20 != (longlong *)0x0) && (lVar2 = *local_res20, lVar2 != 0)) {
    uVar5 = (ulonglong)*param_5 % (ulonglong)*(uint *)(lVar2 + 0x5d8);
    if (*(longlong *)(lVar2 + 0x5b8) != 0) {
      puVar1 = *(uint **)(*(longlong *)(lVar2 + 0x5b8) + uVar5 * 8);
      while( true ) {
        if ((puVar1 == (uint *)0x0) || ((uint)uVar5 != puVar1[8] % *(uint *)(lVar2 + 0x5d8)))
        goto LAB_140181c93;
        if (*puVar1 == *param_5) break;
        puVar1 = *(uint **)(puVar1 + 4);
      }
      FUN_14017ce60(lVar2 + 0x5b0,puVar1,0);
    }
LAB_140181c93:
    if (local_res20 != (longlong *)0x0) {
      local_res20[1] = local_res20[1] + 1;
    }
    FUN_14017c3b0(*(undefined8 *)(param_1 + 0x20));
    if (local_res20 != (longlong *)0x0) {
      lVar6 = *local_res20;
    }
    *(int *)(lVar6 + 0x680) = *(int *)(lVar6 + 0x680) + 1;
  }
  lVar6 = *(longlong *)(param_1 + 0x20);
  if (*param_4 == *(uint *)(lVar6 + 0x1578)) {
    uVar5 = (ulonglong)*param_5 % (ulonglong)*(uint *)(lVar6 + 0x608);
    if (*(longlong *)(lVar6 + 0x5e8) != 0) {
      puVar1 = *(uint **)(*(longlong *)(lVar6 + 0x5e8) + uVar5 * 8);
      while( true ) {
        if ((puVar1 == (uint *)0x0) || ((uint)uVar5 != puVar1[8] % *(uint *)(lVar6 + 0x608)))
        goto LAB_140181d90;
        if (*puVar1 == *param_5) break;
        puVar1 = *(uint **)(puVar1 + 4);
      }
      FUN_14017ce60(lVar6 + 0x5e0,puVar1,0);
    }
  }
LAB_140181d90:
  local_130[0] = 0;
  local_120 = 0;
  local_118 = 0;
  local_108 = 0;
  local_100 = 0;
  local_f8 = 0;
  local_f0 = 0;
  local_110 = Proud::ByteArray::vftable;
  local_d8 = 0;
  local_e0 = 0;
  local_e8 = 0;
  local_b8 = 0;
  local_b0 = 0;
  local_a8 = 0;
  local_a0 = 0;
  local_c0 = Proud::ByteArray::vftable;
  local_90 = Proud::AddrPort::vftable;
  local_88 = 0;
  local_84 = 0;
  local_70 = 0;
  local_68 = 0;
  local_60 = 0;
  local_58 = 0;
  local_78 = Proud::ByteArray::vftable;
  local_138[0] = 9;
  local_cc = *param_4;
  local_d0 = *param_5;
  if ((local_res8 == (longlong *)0x0) || (*local_res8 == 0)) {
    local_98 = 0;
  }
  else {
    local_98 = (undefined4)*(undefined8 *)(*local_res8 + 0x28);
  }
  local_c8 = local_cc;
  FUN_14017fdf0(*(undefined8 *)(param_1 + 0x20),local_138);
  FUN_140140df0(&local_78);
  FUN_140140df0(&local_c0);
  local_38 = &local_e8;
  FUN_14019a730(&local_e8);
  if (local_e0 != 0) {
    if ((longlong)local_d8 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_d8 = local_d8 & 0xffffffff00000000;
  }
  FUN_140140df0(&local_110);
  FUN_14015bf40(&local_118);
  FUN_14015bec0(&local_120);
  FUN_14008c980(local_130);
  if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
    pvVar3 = (void *)*local_res8;
    if (pvVar3 != (void *)0x0) {
      FUN_140148eb0((longlong)pvVar3 + 8);
      operator_delete(pvVar3);
    }
    FUN_1400a3530(local_res8);
  }
  if ((local_res20 != (longlong *)0x0) &&
     (local_res20[1] = local_res20[1] + -1, local_res20[1] == 0)) {
    puVar4 = (undefined8 *)*local_res20;
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
    FUN_1400a3530(local_res20);
  }
  FUN_1400d1290(local_48);
  return 1;
}



undefined8
FUN_140181f60(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
             char *param_5,longlong param_6,longlong param_7,longlong param_8,longlong param_9)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  longlong lVar4;
  longlong lVar5;
  longlong *local_res8;
  undefined8 local_148;
  undefined8 local_140;
  undefined8 local_138;
  undefined8 local_130;
  undefined1 local_128;
  undefined4 local_118 [2];
  undefined8 local_110;
  undefined8 local_100;
  undefined8 local_f8;
  undefined **local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined4 local_a8;
  undefined **local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined **local_70;
  undefined4 local_68;
  undefined2 local_64;
  undefined **local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  local_130 = uVar2;
  FUN_1400a1c30(uVar2);
  local_128 = 1;
  FUN_1401755f0(*(undefined8 *)(param_1 + 0x20),&local_res8,*param_4);
  if (((local_res8 != (longlong *)0x0) && (lVar5 = *local_res8, lVar5 != 0)) &&
     (*(char *)(lVar5 + 0x684) == '\0')) {
    *(undefined1 *)(lVar5 + 0x24) = 1;
    lVar5 = 0;
    if (*param_5 == '\0') {
      lVar4 = lVar5;
      if (local_res8 != (longlong *)0x0) {
        lVar4 = *local_res8;
      }
      FUN_1401b8a30(lVar4);
      lVar4 = lVar5;
      if (local_res8 != (longlong *)0x0) {
        lVar4 = *local_res8;
      }
      if ((*(longlong **)(lVar4 + 0x18) != (longlong *)0x0) && (**(longlong **)(lVar4 + 0x18) != 0))
      {
        lVar4 = lVar5;
        if (local_res8 != (longlong *)0x0) {
          lVar4 = *local_res8;
        }
        local_148 = 0;
        FUN_14016b650(&local_148,lVar4 + 0x18);
        FUN_14017a4d0(*(undefined8 *)(param_1 + 0x20),&local_148);
        local_140 = 0;
        lVar4 = lVar5;
        if (local_res8 != (longlong *)0x0) {
          lVar4 = *local_res8;
        }
        FUN_14016b650(lVar4 + 0x18,&local_140);
      }
      if (local_res8 != (longlong *)0x0) {
        lVar5 = *local_res8;
      }
      FUN_1401b88f0(lVar5,1);
    }
    else {
      lVar4 = lVar5;
      if (local_res8 != (longlong *)0x0) {
        lVar4 = *local_res8;
      }
      *(undefined4 *)(lVar4 + 0x578) = *(undefined4 *)(param_7 + 8);
      *(undefined2 *)(lVar4 + 0x57c) = *(undefined2 *)(param_7 + 0xc);
      lVar4 = lVar5;
      if (local_res8 != (longlong *)0x0) {
        lVar4 = *local_res8;
      }
      *(undefined4 *)(lVar4 + 0x588) = *(undefined4 *)(param_6 + 8);
      *(undefined2 *)(lVar4 + 0x58c) = *(undefined2 *)(param_6 + 0xc);
      lVar4 = lVar5;
      if (local_res8 != (longlong *)0x0) {
        lVar4 = *local_res8;
      }
      *(undefined4 *)(lVar4 + 0x598) = *(undefined4 *)(param_8 + 8);
      *(undefined2 *)(lVar4 + 0x59c) = *(undefined2 *)(param_8 + 0xc);
      lVar4 = lVar5;
      if (local_res8 != (longlong *)0x0) {
        lVar4 = *local_res8;
      }
      *(undefined4 *)(lVar4 + 0x5a8) = *(undefined4 *)(param_9 + 8);
      *(undefined2 *)(lVar4 + 0x5ac) = *(undefined2 *)(param_9 + 0xc);
      lVar4 = lVar5;
      if (local_res8 != (longlong *)0x0) {
        lVar4 = *local_res8;
      }
      FUN_1401b88f0(lVar4,0);
      local_138 = 0;
      lVar4 = lVar5;
      if (local_res8 != (longlong *)0x0) {
        lVar4 = *local_res8;
      }
      FUN_140176e00(lVar4 + 0x28,&local_138);
      if (local_res8 != (longlong *)0x0) {
        lVar5 = *local_res8;
      }
      uVar3 = FUN_1401b8a70(lVar5);
      FUN_1401bc490(uVar3);
      local_110 = 0;
      local_100 = 0;
      local_f8 = 0;
      local_e8 = 0;
      local_e0 = 0;
      local_d8 = 0;
      local_d0 = 0;
      local_f0 = Proud::ByteArray::vftable;
      local_b8 = 0;
      local_c0 = 0;
      local_c8 = 0;
      local_98 = 0;
      local_90 = 0;
      local_88 = 0;
      local_80 = 0;
      local_a0 = Proud::ByteArray::vftable;
      local_70 = Proud::AddrPort::vftable;
      local_68 = 0;
      local_64 = 0;
      local_50 = 0;
      local_48 = 0;
      local_40 = 0;
      local_38 = 0;
      local_58 = Proud::ByteArray::vftable;
      local_118[0] = 10;
      local_a8 = *param_4;
      FUN_14017fdf0(*(undefined8 *)(param_1 + 0x20),local_118);
      FUN_14015c350(local_118);
    }
  }
  if ((local_res8 != (longlong *)0x0) &&
     (local_res8[1] = local_res8[1] + -1, uVar2 = local_130, local_res8[1] == 0)) {
    puVar1 = (undefined8 *)*local_res8;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    FUN_1400a3530(local_res8);
    uVar2 = local_130;
  }
  FUN_1400d1290(uVar2);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x00014018244c)
// WARNING: Removing unreachable block (ram,0x000140182455)
// WARNING: Removing unreachable block (ram,0x000140182476)
// WARNING: Removing unreachable block (ram,0x00014018247f)

undefined8 *
FUN_1401822a0(undefined8 *param_1,undefined8 param_2,undefined1 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  bool bVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined4 uVar7;
  undefined8 uVar8;
  longlong lVar9;
  longlong lVar10;
  double dVar11;
  undefined8 *local_res10;
  undefined8 *local_res18;
  undefined8 local_50;
  undefined4 local_44;
  longlong local_40;
  
  FUN_1401876b0(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  lVar10 = 0;
  param_1[0x10] = 0;
  param_1[0x14] = 0;
  param_1[0x15] = 0;
  param_1[0x16] = 0;
  *param_1 = Proud::CNetClientImpl::vftable;
  param_1[0xc] = Proud::CNetClientImpl::vftable;
  param_1[0xd] = Proud::CNetClientImpl::vftable;
  param_1[0xe] = Proud::CNetClientImpl::vftable;
  param_1[0xf] = Proud::CNetClientImpl::vftable;
  param_1[0x11] = Proud::CNetClientImpl::vftable;
  param_1[0x12] = Proud::CNetClientImpl::vftable;
  param_1[0x13] = Proud::CNetClientImpl::vftable;
  FUN_1401bd100(param_1 + 0x17,DAT_1402f80f8 * 10.0 * 2.0);
  *(undefined4 *)(param_1 + 0x93) = 0;
  param_1[0x96] = 0;
  param_1[0x97] = 0;
  param_1[0x98] = 0;
  param_1[0x99] = 0;
  param_1[0x95] = Proud::ByteArray::vftable;
  *(undefined1 *)(param_1 + 0x9a) = 0;
  param_1[0x9c] = 0;
  uVar7 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0xa3,uVar7,1);
  param_1[0xba] = 0;
  param_1[0xbb] = 0;
  *(undefined1 *)(param_1 + 0xbc) = 0;
  param_1[0xc6] = 0;
  param_1[0xbd] = 0;
  param_1[0xbe] = 0;
  param_1[0xbf] = 0;
  *(undefined4 *)(param_1 + 0xc1) = 0x11;
  param_1[0xc0] = 0;
  *(undefined4 *)(param_1 + 0xc5) = 0;
  *(undefined4 *)((longlong)param_1 + 0x60c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0xc2) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x614) = 0x40100000;
  param_1[0xc3] = 0x26;
  param_1[0xc4] = 4;
  param_1[0xc4] = 0;
  param_1[199] = 0;
  *(undefined1 *)((longlong)param_1 + 0x68c) = 0;
  *(undefined4 *)(param_1 + 0xd1) = 0;
  *(undefined4 *)(param_1 + 0xd2) = 0;
  param_1[0xcb] = 0;
  param_1[0xcc] = 0;
  param_1[0xd0] = 0;
  param_1[0xcf] = 0;
  param_1[0xce] = 0;
  param_1[0xcd] = 0;
  FUN_1401a7a10(param_1 + 0xd4);
  *(undefined4 *)(param_1 + 0xda) = 0;
  *(undefined4 *)((longlong)param_1 + 0x6d4) = 0;
  *(undefined4 *)(param_1 + 0xdb) = 0;
  *(undefined4 *)((longlong)param_1 + 0x6dc) = 0;
  param_1[0xdc] = 0;
  param_1[0xdf] = 0;
  param_1[0xdd] = 0;
  param_1[0xde] = 0;
  *(undefined4 *)(param_1 + 0x159) = 0;
  param_1[0x15c] = 0;
  param_1[0x15d] = 0;
  param_1[0x15e] = 0;
  param_1[0x15f] = 0;
  param_1[0x15b] = Proud::ByteArray::vftable;
  *(undefined1 *)(param_1 + 0x160) = 0;
  puVar1 = param_1 + 0x161;
  local_res10 = puVar1;
  FUN_1400acf50(puVar1);
  FUN_1400ad070(puVar1);
  param_1[0x2a4] = 0;
  *(undefined1 *)(param_1 + 0x2a5) = 0;
  param_1[0x2a6] = 0;
  param_1[0x2a9] = 0;
  param_1[0x2a7] = 0;
  param_1[0x2a8] = 0;
  param_1[0x2aa] = Proud::CNetClientImpl::ServerAsSendDest::vftable;
  param_1[0x2ab] = Proud::CNetClientImpl::ServerAsSendDest::vftable;
  param_1[0x2ac] = param_1;
  param_1[0x2ad] = 0;
  param_1[0x2ae] = 0;
  FUN_140140b80(param_1 + 0x2b1);
  param_1[699] = 0;
  param_1[700] = 0;
  param_1[0x2bf] = 0;
  param_1[0x2bd] = 0;
  param_1[0x2be] = 0;
  param_1[0x2c0] = 0;
  param_1[0x2c3] = 0;
  param_1[0x2c1] = 0;
  param_1[0x2c2] = 0;
  FUN_1400ad6b0(param_1 + 0x2c4);
  *(undefined1 *)(param_1 + 0x2ca) = 0;
  param_1[0x2d4] = 0;
  param_1[0x2cb] = 0;
  param_1[0x2cc] = 0;
  param_1[0x2cd] = 0;
  *(undefined4 *)(param_1 + 0x2cf) = 0x11;
  param_1[0x2ce] = 0;
  *(undefined4 *)(param_1 + 0x2d3) = 0;
  *(undefined4 *)((longlong)param_1 + 0x167c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x2d0) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x1684) = 0x40100000;
  param_1[0x2d1] = 0x26;
  param_1[0x2d2] = 4;
  param_1[0x2d2] = 0;
  *(undefined1 *)(param_1 + 0x2d5) = 0;
  param_1[0x2df] = 0;
  param_1[0x2d6] = 0;
  param_1[0x2d7] = 0;
  param_1[0x2d8] = 0;
  *(undefined4 *)(param_1 + 0x2da) = 0x11;
  param_1[0x2d9] = 0;
  *(undefined4 *)(param_1 + 0x2de) = 0;
  *(undefined4 *)((longlong)param_1 + 0x16d4) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x2db) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x16dc) = 0x40100000;
  param_1[0x2dc] = 0x26;
  param_1[0x2dd] = 0;
  param_1[0x2e0] = 0;
  param_1[0x2e3] = 0;
  param_1[0x2e1] = 0;
  param_1[0x2e2] = 0;
  *(undefined1 *)(param_1 + 0x2e4) = 0;
  param_1[0x2ee] = 0;
  param_1[0x2e5] = 0;
  param_1[0x2e6] = 0;
  param_1[0x2e7] = 0;
  *(undefined4 *)(param_1 + 0x2e9) = 0x11;
  param_1[0x2e8] = 0;
  *(undefined4 *)(param_1 + 0x2ed) = 0;
  *(undefined4 *)((longlong)param_1 + 0x174c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x2ea) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x1754) = 0x40100000;
  param_1[0x2eb] = 0x26;
  param_1[0x2ec] = 0;
  FUN_1401bd100(param_1 + 0x2ef,DAT_1402f8180);
  param_1[0x2f4] = 0;
  param_1[0x2f5] = 0;
  param_1[0x2f6] = 0;
  param_1[0x2f9] = 0;
  param_1[0x2f7] = 0;
  param_1[0x2f8] = 0;
  puVar1 = param_1 + 0x2fa;
  local_res10 = puVar1;
  FUN_140186ea0(puVar1);
  *puVar1 = ProudC2C::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x17e4) != 1) {
    FUN_1400a2b50(PTR_u_PIDL_compiler_is_incompatible_to_14030bd40);
  }
  *puVar1 = Proud::CNetClientImpl::C2CProxy::vftable;
  FUN_14018a120(param_1 + 0x2fe);
  param_1[0x2fe] = Proud::CNetClientImpl::C2CStub::vftable;
  puVar2 = param_1 + 0x303;
  local_res10 = puVar2;
  FUN_140186ea0(puVar2);
  *puVar2 = ProudC2S::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x182c) != 1) {
    FUN_1400a2b50(PTR_u_PIDL_compiler_is_incompatible_to_14030bd40);
  }
  *puVar2 = Proud::CNetClientImpl::C2SProxy::vftable;
  FUN_14018a120(param_1 + 0x307);
  param_1[0x307] = Proud::CNetClientImpl::S2CStub::vftable;
  param_1[0x30d] = 0;
  param_1[0x30e] = 0;
  FUN_1401bd100(param_1 + 0x30f,DAT_1402f81a0);
  *(undefined2 *)(param_1 + 0x319) = 0;
  *(undefined1 *)((longlong)param_1 + 0x18ca) = 0;
  param_1[0x30c] = DAT_1402f81a0;
  uVar8 = FUN_140174ce0(&local_res10);
  FUN_14016b480(param_1 + 0xbb,uVar8);
  puVar5 = local_res10;
  if (local_res10 != (undefined8 *)0x0) {
    FUN_1400a1c30(local_res10);
    bVar4 = true;
    local_res10[8] = local_res10[8] + -1;
    if (local_res10[8] == 0) {
      FUN_1400d1290(puVar5);
      puVar6 = local_res10;
      bVar4 = false;
      local_res18 = local_res10;
      puVar3 = (undefined8 *)local_res10[7];
      if (puVar3 != (undefined8 *)0x0) {
        (**(code **)*puVar3)(puVar3,1);
      }
      FUN_1400a1cd0(puVar6);
      FUN_1400a3530(puVar6);
    }
    if (bVar4) {
      FUN_1400d1290(puVar5);
    }
  }
  FUN_1400a2c40();
  *(undefined1 *)(param_1 + 0xca) = 0;
  *(undefined4 *)(param_1 + 0xd3) = DAT_1402f8110;
  param_1[0x2b0] = 0;
  param_1[0x2c9] = 0;
  *(undefined4 *)(param_1 + 0x2af) = 0;
  *(undefined4 *)(param_1 + 0xb8) = 0;
  *(undefined4 *)(param_1 + 0xb0) = 0;
  *(undefined4 *)(param_1 + 0xa1) = 0;
  lVar9 = lVar10;
  if (param_1[0xbb] != 0) {
    lVar9 = *(longlong *)(param_1[0xbb] + 0x38);
  }
  dVar11 = (double)FUN_1401a8ef0(lVar9);
  param_1[0xa2] = dVar11 + DAT_1402f8100;
  FUN_140187b00(param_1,puVar1);
  FUN_140187b00(param_1,puVar2);
  FUN_140187d00(param_1,param_1 + 0x307);
  FUN_140187d00(param_1,param_1 + 0x2fe);
  *(undefined1 *)(param_1 + 0x2fc) = 1;
  *(undefined1 *)(param_1 + 0x305) = 1;
  *(undefined1 *)(param_1 + 0x30a) = 1;
  *(undefined1 *)(param_1 + 0x301) = 1;
  param_1[0x302] = param_1;
  param_1[0x30b] = param_1;
  *(undefined1 *)(param_1 + 0x2f2) = 0;
  param_1[0x2f3] = 0x3ff0000000000000;
  FUN_1400a6440(&local_50);
  local_50 = 0;
  local_44 = 0;
  if (param_1[0xbb] != 0) {
    lVar10 = *(longlong *)(param_1[0xbb] + 0x38);
  }
  local_40 = lVar10 + 0x10;
  uVar8 = FUN_1400a3590(0x800,&local_50);
  param_1[0x9c] = uVar8;
  FUN_14016a780(param_1 + 0xdc);
  FUN_14016a780(param_1 + 700);
  FUN_14016a780(param_1 + 0x2c0);
  FUN_14016a780(param_1 + 0x2a6);
  return param_1;
}



void * FUN_140182b00(void *param_1,uint param_2)

{
  FUN_14017f5a0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140182b30(longlong *param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined4 *puVar6;
  longlong lVar7;
  undefined8 *local_res8;
  undefined8 *local_158;
  undefined1 local_150;
  undefined4 local_148 [2];
  longlong local_140 [2];
  undefined8 local_130;
  undefined8 local_128;
  undefined **local_120;
  undefined8 local_118;
  undefined8 local_110;
  undefined8 local_108;
  undefined8 local_100;
  undefined8 local_f8;
  longlong local_f0;
  ulonglong local_e8;
  undefined4 local_d8;
  undefined **local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined **local_a0;
  undefined4 local_98;
  undefined2 local_94;
  undefined **local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 local_70;
  undefined8 local_68;
  undefined8 local_58;
  undefined1 local_50;
  longlong local_48;
  undefined1 local_40;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(*param_1 + 0x58))();
  local_58 = uVar3;
  FUN_1400a1c30(uVar3);
  local_50 = 1;
  if ((char)param_1[0x9d] == '\0') {
    puVar5 = (undefined8 *)0x0;
    local_140[0] = 0;
    local_130 = 0;
    local_128 = 0;
    local_118 = 0;
    local_110 = 0;
    local_108 = 0;
    local_100 = 0;
    local_120 = Proud::ByteArray::vftable;
    local_e8 = 0;
    local_f0 = 0;
    local_f8 = 0;
    local_c8 = 0;
    local_c0 = 0;
    local_b8 = 0;
    local_b0 = 0;
    local_d0 = Proud::ByteArray::vftable;
    local_a0 = Proud::AddrPort::vftable;
    local_98 = 0;
    local_94 = 0;
    local_80 = 0;
    local_78 = 0;
    local_70 = 0;
    local_68 = 0;
    local_88 = Proud::ByteArray::vftable;
    local_res8 = (undefined8 *)FUN_1400a34c0(0x60);
    puVar4 = puVar5;
    if (local_res8 != (undefined8 *)0x0) {
      puVar4 = (undefined8 *)FUN_140141470(local_res8);
    }
    if (puVar4 == (undefined8 *)0x0) {
      local_res8 = (undefined8 *)0x0;
    }
    else {
      puVar5 = (undefined8 *)FUN_1400a34c0(0x48);
      local_158 = puVar5;
      if (puVar5 != (undefined8 *)0x0) {
        local_res8 = puVar5;
        uVar2 = FUN_1401692e0();
        FUN_1400a1b50(puVar5,uVar2,1);
      }
      local_res8 = puVar5;
      FUN_1400a1c30(puVar5);
      puVar5[8] = 1;
      puVar5[7] = puVar4;
      FUN_1400d1290(puVar5);
    }
    FUN_140141570(local_140,&local_res8);
    if (puVar5 != (undefined8 *)0x0) {
      local_158 = puVar5;
      FUN_1400a1c30();
      local_150 = 1;
      plVar1 = puVar5 + 8;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_1400d1290(puVar5);
        local_150 = 0;
        FUN_14008c910();
      }
      else {
        FUN_1400d1290();
      }
    }
    local_148[0] = 3;
    if (local_140[0] == 0) {
      puVar6 = (undefined4 *)0x0;
    }
    else {
      puVar6 = *(undefined4 **)(local_140[0] + 0x38);
    }
    *puVar6 = param_2;
    lVar7 = 0;
    if (local_140[0] != 0) {
      lVar7 = *(longlong *)(local_140[0] + 0x38);
    }
    *(undefined4 *)(lVar7 + 4) = param_3;
    if (local_140[0] == 0) {
      lVar7 = 0;
    }
    else {
      lVar7 = *(longlong *)(local_140[0] + 0x38);
    }
    FUN_140003100(lVar7 + 0x10,param_4);
    local_d8 = 1;
    FUN_14017fdf0(param_1,local_148);
    *(undefined1 *)(param_1 + 0x9d) = 1;
    if (param_1[0xb] != 0) {
      lVar7 = param_1[0xb] + 0x98;
      local_48 = lVar7;
      FUN_1400a1c30(lVar7);
      local_40 = 1;
      local_res8 = (undefined8 *)((ulonglong)local_res8 & 0xffffffffffffff00);
      uVar2 = (**(code **)(param_1[0xe] + 0x108))(param_1 + 0xe,&local_res8);
      local_158 = (undefined8 *)CONCAT44(local_158._4_4_,uVar2);
      (**(code **)(*(longlong *)(param_1[0xb] + 0x68) + 0x60))
                ((longlong *)(param_1[0xb] + 0x68),1,&DAT_140318cf0,&local_158);
      FUN_1400d1290(lVar7);
    }
    FUN_140140df0(&local_88);
    FUN_140140df0(&local_d0);
    local_res8 = &local_f8;
    FUN_14019a730(&local_f8);
    if (local_f0 != 0) {
      if ((longlong)local_e8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_e8 = local_e8 & 0xffffffff00000000;
    }
    FUN_140140df0(&local_120);
    FUN_14015bf40(&local_128);
    FUN_14015bec0(&local_130);
    FUN_14008c980(local_140);
  }
  FUN_1400d1290(uVar3);
  return;
}



void FUN_140182e50(longlong *param_1,undefined4 param_2,longlong *param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  longlong lVar6;
  undefined8 *puVar7;
  undefined8 *local_res8;
  undefined8 *local_158;
  undefined1 local_150;
  undefined4 local_148 [2];
  longlong local_140 [2];
  undefined8 local_130;
  undefined8 local_128;
  undefined **local_120;
  undefined8 local_118;
  undefined8 local_110;
  undefined8 local_108;
  undefined8 local_100;
  undefined8 local_f8;
  longlong local_f0;
  ulonglong local_e8;
  undefined4 local_d8;
  undefined **local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined **local_a0;
  undefined4 local_98;
  undefined2 local_94;
  undefined4 local_90;
  undefined **local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 local_70;
  undefined8 local_68;
  undefined8 local_58;
  undefined1 local_50;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(*param_1 + 0x58))();
  local_58 = uVar3;
  FUN_1400a1c30(uVar3);
  local_50 = 1;
  if ((char)param_1[0x9d] == '\0') {
    puVar7 = (undefined8 *)0x0;
    local_140[0] = 0;
    local_130 = 0;
    local_128 = 0;
    local_118 = 0;
    local_110 = 0;
    local_108 = 0;
    local_100 = 0;
    local_120 = Proud::ByteArray::vftable;
    local_e8 = 0;
    local_f0 = 0;
    local_f8 = 0;
    local_c8 = 0;
    local_c0 = 0;
    local_b8 = 0;
    local_b0 = 0;
    local_d0 = Proud::ByteArray::vftable;
    local_a0 = Proud::AddrPort::vftable;
    local_98 = 0;
    local_94 = 0;
    local_80 = 0;
    local_78 = 0;
    local_70 = 0;
    local_68 = 0;
    local_88 = Proud::ByteArray::vftable;
    local_res8 = (undefined8 *)FUN_1400a34c0(0x60);
    puVar4 = puVar7;
    if (local_res8 != (undefined8 *)0x0) {
      puVar4 = (undefined8 *)FUN_140141470(local_res8);
    }
    if (puVar4 == (undefined8 *)0x0) {
      local_res8 = (undefined8 *)0x0;
      puVar5 = puVar7;
    }
    else {
      puVar5 = (undefined8 *)FUN_1400a34c0(0x48);
      if (puVar5 != (undefined8 *)0x0) {
        local_res8 = puVar5;
        uVar2 = FUN_1401692e0();
        FUN_1400a1b50(puVar5,uVar2,1);
      }
      local_res8 = puVar5;
      FUN_1400a1c30(puVar5);
      puVar5[8] = 1;
      puVar5[7] = puVar4;
      FUN_1400d1290(puVar5);
    }
    FUN_140141570(local_140,&local_res8);
    if (puVar5 != (undefined8 *)0x0) {
      local_158 = puVar5;
      FUN_1400a1c30(puVar5);
      local_150 = 1;
      plVar1 = puVar5 + 8;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_1400d1290(puVar5);
        local_150 = 0;
        FUN_14008c910(puVar5);
      }
      else {
        FUN_1400d1290(puVar5);
      }
    }
    local_148[0] = 2;
    puVar4 = puVar7;
    if (local_140[0] != 0) {
      puVar4 = *(undefined8 **)(local_140[0] + 0x38);
    }
    *(undefined4 *)puVar4 = param_2;
    puVar4 = puVar7;
    if (*param_3 != 0) {
      puVar4 = *(undefined8 **)(*param_3 + 0x38);
    }
    if (local_140[0] != 0) {
      puVar7 = *(undefined8 **)(local_140[0] + 0x38);
    }
    FUN_140003100(puVar7 + 2,puVar4 + 2);
    local_d8 = 1;
    FUN_1400a3440();
    local_res8 = (undefined8 *)PTR_DAT_1402f8010;
    FUN_140003100(&local_res8,param_1 + 0x2b1);
    lVar6 = FUN_1400a6870(&local_158,&local_res8,(short)param_1[0x2b2]);
    local_98 = *(undefined4 *)(lVar6 + 8);
    local_94 = *(undefined2 *)(lVar6 + 0xc);
    local_90 = 0;
    FUN_14017fdf0(param_1,local_148);
    *(undefined1 *)(param_1 + 0x9d) = 1;
    FUN_140140df0(&local_88);
    FUN_140140df0(&local_d0);
    local_res8 = &local_f8;
    FUN_14019a730(&local_f8);
    if (local_f0 != 0) {
      if ((longlong)local_e8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_e8 = local_e8 & 0xffffffff00000000;
    }
    FUN_140140df0(&local_120);
    FUN_14015bf40(&local_128);
    FUN_14015bec0(&local_130);
    FUN_14008c980(local_140);
  }
  FUN_1400d1290(uVar3);
  FUN_14008c980(param_3);
  return;
}



void FUN_140183170(longlong *param_1,undefined4 param_2,undefined4 param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  longlong lVar6;
  undefined8 *puVar7;
  undefined8 *local_res8;
  undefined8 *local_158;
  undefined1 local_150;
  undefined4 local_148 [2];
  longlong local_140 [2];
  undefined8 local_130;
  undefined8 local_128;
  undefined **local_120;
  undefined8 local_118;
  undefined8 local_110;
  undefined8 local_108;
  undefined8 local_100;
  undefined8 local_f8;
  longlong local_f0;
  ulonglong local_e8;
  undefined4 local_d8;
  undefined **local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined **local_a0;
  undefined4 local_98;
  undefined2 local_94;
  undefined4 local_90;
  undefined **local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 local_70;
  undefined8 local_68;
  undefined8 local_58;
  undefined1 local_50;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(*param_1 + 0x58))();
  local_58 = uVar3;
  FUN_1400a1c30(uVar3);
  local_50 = 1;
  if ((char)param_1[0x9d] == '\0') {
    puVar7 = (undefined8 *)0x0;
    local_140[0] = 0;
    local_130 = 0;
    local_128 = 0;
    local_118 = 0;
    local_110 = 0;
    local_108 = 0;
    local_100 = 0;
    local_120 = Proud::ByteArray::vftable;
    local_e8 = 0;
    local_f0 = 0;
    local_f8 = 0;
    local_c8 = 0;
    local_c0 = 0;
    local_b8 = 0;
    local_b0 = 0;
    local_d0 = Proud::ByteArray::vftable;
    local_a0 = Proud::AddrPort::vftable;
    local_98 = 0;
    local_94 = 0;
    local_80 = 0;
    local_78 = 0;
    local_70 = 0;
    local_68 = 0;
    local_88 = Proud::ByteArray::vftable;
    local_res8 = (undefined8 *)FUN_1400a34c0(0x60);
    puVar4 = puVar7;
    if (local_res8 != (undefined8 *)0x0) {
      puVar4 = (undefined8 *)FUN_140141470(local_res8);
    }
    if (puVar4 == (undefined8 *)0x0) {
      local_res8 = (undefined8 *)0x0;
      puVar5 = puVar7;
    }
    else {
      puVar5 = (undefined8 *)FUN_1400a34c0(0x48);
      if (puVar5 != (undefined8 *)0x0) {
        local_res8 = puVar5;
        uVar2 = FUN_1401692e0();
        FUN_1400a1b50(puVar5,uVar2,1);
      }
      local_res8 = puVar5;
      FUN_1400a1c30(puVar5);
      puVar5[8] = 1;
      puVar5[7] = puVar4;
      FUN_1400d1290(puVar5);
    }
    FUN_140141570(local_140,&local_res8);
    if (puVar5 != (undefined8 *)0x0) {
      local_158 = puVar5;
      FUN_1400a1c30(puVar5);
      local_150 = 1;
      plVar1 = puVar5 + 8;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_1400d1290(puVar5);
        local_150 = 0;
        FUN_14008c910(puVar5);
      }
      else {
        FUN_1400d1290(puVar5);
      }
    }
    local_148[0] = 2;
    if (local_140[0] != 0) {
      puVar7 = *(undefined8 **)(local_140[0] + 0x38);
    }
    *(undefined4 *)puVar7 = param_2;
    local_d8 = 1;
    FUN_1400a3440();
    local_res8 = (undefined8 *)PTR_DAT_1402f8010;
    FUN_140003100(&local_res8,param_1 + 0x2b1);
    lVar6 = FUN_1400a6870(&local_158,&local_res8,(short)param_1[0x2b2]);
    local_98 = *(undefined4 *)(lVar6 + 8);
    local_94 = *(undefined2 *)(lVar6 + 0xc);
    local_90 = param_3;
    FUN_14017fdf0(param_1,local_148);
    *(undefined1 *)(param_1 + 0x9d) = 1;
    FUN_140140df0(&local_88);
    FUN_140140df0(&local_d0);
    local_res8 = &local_f8;
    FUN_14019a730(&local_f8);
    if (local_f0 != 0) {
      if ((longlong)local_e8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_e8 = local_e8 & 0xffffffff00000000;
    }
    FUN_140140df0(&local_120);
    FUN_14015bf40(&local_128);
    FUN_14015bec0(&local_130);
    FUN_14008c980(local_140);
  }
  FUN_1400d1290(uVar3);
  return;
}



undefined8 FUN_140183450(longlong param_1)

{
  ulonglong *puVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  undefined8 uVar5;
  ulonglong uVar6;
  uint *puVar7;
  undefined8 uVar8;
  uint uVar9;
  uint *puVar10;
  uint *puVar11;
  uint uVar12;
  ulonglong uVar13;
  uint *local_res8;
  
  uVar5 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar5);
  puVar1 = *(ulonglong **)(*(longlong *)(param_1 + 0x20) + 0x5d0);
  if ((puVar1 == (ulonglong *)0x0) || (*puVar1 == 0)) goto LAB_1401836e9;
  uVar13 = 0;
  uVar6 = uVar13;
  if (puVar1 != (ulonglong *)0x0) {
    uVar6 = *puVar1;
  }
  if (3 < *(int *)(uVar6 + 0x100)) goto LAB_1401836e9;
  FUN_1400a3440();
  puVar11 = (uint *)PTR_DAT_1402f8010;
  local_res8 = (uint *)PTR_DAT_1402f8010;
  uVar2 = FUN_1400a32c0(L"Autoprune");
  uVar4 = 0;
  uVar6 = uVar13;
  if ((puVar11 != (uint *)0x0) && (uVar6 = 0, puVar11 != (uint *)PTR_DAT_1402f8010)) {
    uVar6 = (ulonglong)*(uint *)((longlong)puVar11 + -8);
  }
  uVar3 = uVar2;
  if ((((int)uVar2 <= (int)uVar6) && (uVar3 = uVar4, puVar11 != (uint *)0x0)) &&
     (puVar11 != (uint *)PTR_DAT_1402f8010)) {
    uVar3 = *(uint *)((longlong)puVar11 + -8);
  }
  uVar12 = 1;
  if (1 < (int)uVar3) {
    uVar12 = uVar3;
  }
  uVar3 = uVar4;
  if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1402f8010)) {
    uVar3 = *(uint *)((longlong)puVar11 + -8);
  }
  uVar9 = 0;
  if ((int)uVar3 < (int)uVar12) {
    if (puVar11 == (uint *)0x0) {
      puVar11 = (uint *)PTR_DAT_1402f8010;
    }
    local_res8 = puVar11;
    if ((int)uVar12 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar12 == 0) {
      FUN_1400031d0(&local_res8);
    }
    else {
      uVar3 = uVar4;
      if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1402f8010)) {
        uVar3 = puVar11[-2];
      }
      if (uVar12 != uVar3) {
        puVar7 = (uint *)FUN_1400a34c0((longlong)(int)uVar12 * 2 + 10);
        if (puVar7 != (uint *)0x0) {
          *puVar7 = 0;
          puVar7[1] = 1;
        }
        *puVar7 = uVar12;
        uVar3 = uVar9;
        if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1402f8010)) {
          uVar3 = puVar11[-2];
        }
        puVar10 = (uint *)PTR_DAT_1402f8010;
        if ((int)uVar12 < (int)uVar3) {
LAB_1401835b4:
          if (puVar11 != (uint *)0x0) {
            puVar10 = puVar11;
          }
        }
        else {
          uVar12 = uVar4;
          if (puVar11 != (uint *)0x0) {
            if (puVar11 != (uint *)PTR_DAT_1402f8010) {
              uVar12 = puVar11[-2];
            }
            goto LAB_1401835b4;
          }
        }
        FUN_1400a32f0(puVar7 + 2,puVar10,uVar12);
        FUN_1400031d0(&local_res8);
        local_res8 = puVar7 + 2;
      }
    }
  }
  FUN_140002e30(&local_res8);
  puVar11 = local_res8;
  puVar7 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar7,L"Autoprune",uVar2);
  puVar7 = puVar11;
  if (puVar11 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1402f8010;
  }
  uVar4 = FUN_1400a32c0(puVar7);
  uVar2 = 0;
  if (0 < (int)uVar4) {
    uVar2 = uVar4;
  }
  uVar4 = uVar9;
  if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1402f8010)) {
    uVar4 = puVar11[-2];
  }
  if (((int)uVar2 < (int)uVar4) || (uVar2 = uVar9, puVar11 == (uint *)0x0)) {
LAB_140183649:
    if (((puVar11 != (uint *)PTR_DAT_1402f8010) && (puVar11 != (uint *)0x0)) &&
       (puVar11 + -2 != (uint *)0x0)) {
      puVar11[-2] = uVar2;
      *(undefined2 *)((longlong)puVar11 + (longlong)(int)uVar2 * 2) = 0;
    }
  }
  else if (puVar11 != (uint *)PTR_DAT_1402f8010) {
    uVar2 = puVar11[-2];
    goto LAB_140183649;
  }
  FUN_140182b30(*(undefined8 *)(param_1 + 0x20),0xb,3,&local_res8);
  if (((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1402f8010)) &&
     (puVar11 + -2 != (uint *)0x0)) {
    uVar8 = FUN_1400a3440();
    FUN_1400a1c30(uVar8);
    puVar7 = puVar11 + -1;
    *puVar7 = *puVar7 - 1;
    if (*puVar7 == 0) {
      FUN_1400a3530(puVar11 + -2);
    }
    FUN_1400d1290(uVar8);
  }
  puVar1 = *(ulonglong **)(*(longlong *)(param_1 + 0x20) + 0x5d0);
  if (puVar1 != (ulonglong *)0x0) {
    uVar13 = *puVar1;
  }
  FUN_1401a8930(uVar13,4);
LAB_1401836e9:
  FUN_1400d1290(uVar5);
  return 1;
}



void FUN_140183710(longlong *param_1,double param_2,undefined8 param_3)

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  undefined8 *puVar4;
  double dVar5;
  bool bVar6;
  DWORD DVar7;
  DWORD DVar8;
  undefined8 uVar9;
  undefined *puVar10;
  longlong *plVar11;
  undefined8 uVar12;
  char cVar13;
  undefined *puVar14;
  undefined *puVar15;
  undefined *local_res10;
  undefined8 local_res18;
  undefined *local_res20;
  undefined *local_168;
  undefined8 local_160;
  char local_158;
  longlong *local_150;
  undefined1 local_148;
  undefined *local_140;
  undefined *local_138;
  undefined *local_130;
  undefined *local_128;
  undefined *local_120;
  undefined *local_118;
  undefined8 local_110;
  undefined1 local_108;
  undefined8 local_100;
  undefined1 local_f8;
  undefined8 local_f0;
  undefined1 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined1 local_d0;
  undefined8 local_c8;
  undefined1 local_c0;
  undefined8 local_b8;
  undefined1 local_b0;
  undefined8 local_a8;
  undefined1 local_a0;
  undefined8 local_98;
  undefined1 local_90;
  undefined *local_88;
  undefined1 local_80;
  undefined8 local_78;
  undefined1 local_70;
  
  local_e0 = 0xfffffffffffffffe;
  local_150 = param_1 + 0x95;
  local_res18 = param_3;
  FUN_1400a1c30();
  local_148 = 1;
  (**(code **)(param_1[1] + 0x18))();
  bVar6 = false;
  puVar15 = (undefined *)0x0;
  puVar14 = puVar15;
  if (param_1[0xad] != 0) {
    puVar14 = *(undefined **)(param_1[0xad] + 0x38);
  }
  FUN_1400a1c30(puVar14 + 0x10);
  puVar10 = puVar15;
  if (param_1[0xad] != 0) {
    puVar10 = *(undefined **)(param_1[0xad] + 0x38);
  }
  *(int *)(puVar10 + 0x288) = *(int *)(puVar10 + 0x288) + 1;
  LOCK();
  *(int *)(param_1 + 0xa2) = (int)param_1[0xa2] + 1;
  UNLOCK();
  FUN_1400d1290(puVar14 + 0x10);
  DVar7 = GetTickCount();
  dVar5 = param_2 * 2.0 * 1000.0;
  if (dVar5 <= 100000.0) {
    dVar5 = 100000.0;
  }
  if (((char)param_1[0x2e4] != '\0') || ((int)param_1[0xcb] != 0)) {
    puVar14 = puVar15;
    if (param_1[0xad] != 0) {
      puVar14 = *(undefined **)(param_1[0xad] + 0x38);
    }
    puVar14 = puVar14 + 0x10;
    local_88 = puVar14;
    FUN_1400a1c30(puVar14);
    local_80 = 1;
    FUN_140177c40(param_1 + -0xe,0,&DAT_140257f00,(int)param_1[0x2a1]);
    FUN_1400d1290(puVar14);
  }
  plVar1 = param_1 + -0xe;
  puVar14 = puVar15;
  do {
    uVar9 = (**(code **)(*plVar1 + 0x58))(plVar1);
    local_160 = uVar9;
    FUN_1400a1c30(uVar9);
    local_158 = '\x01';
    if (((longlong *)param_1[0xac] == (longlong *)0x0) ||
       (lVar3 = *(longlong *)param_1[0xac], lVar3 == 0)) {
      if ((((longlong *)param_1[0x2a0] != (longlong *)0x0) && (*(longlong *)param_1[0x2a0] != 0)) ||
         (((longlong *)param_1[0x296] != (longlong *)0x0 && (*(longlong *)param_1[0x296] != 0)))) {
        FUN_1400a3440();
        local_140 = PTR_DAT_1402f8010;
        plVar11 = (longlong *)FUN_1400a3170(&local_118);
        puVar14 = (undefined *)*plVar11;
        if ((undefined *)*plVar11 == (undefined *)0x0) {
          puVar14 = PTR_DAT_1402f8010;
        }
        FUN_14003c600(&local_140,L"Unstability in Disconnect #1! Process=%s",puVar14);
        if (((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1402f8010)) &&
           (local_118 + -8 != (undefined *)0x0)) {
          uVar12 = FUN_1400a3440();
          local_b8 = uVar12;
          FUN_1400a1c30(uVar12);
          local_b0 = 1;
          piVar2 = (int *)(local_118 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_1400a3530(local_118 + -8);
          }
          FUN_1400d1290(uVar12);
        }
        FUN_1400a3440();
        puVar14 = local_140;
        local_168 = PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_168 = puVar15;
        }
        if (local_140 != PTR_DAT_1402f8010) {
          uVar12 = FUN_1400a3440();
          local_98 = uVar12;
          FUN_1400a1c30(uVar12);
          local_90 = 1;
          FUN_1400031d0(&local_168);
          local_168 = puVar14;
          if (((puVar14 != PTR_DAT_1402f8010) && (puVar14 != (undefined *)0x0)) &&
             (puVar14 != (undefined *)0x8)) {
            *(int *)(puVar14 + -4) = *(int *)(puVar14 + -4) + 1;
          }
          FUN_1400d1290(uVar12);
        }
        FUN_1400a6370(&local_168);
        if (((puVar14 != (undefined *)0x0) && (puVar14 != PTR_DAT_1402f8010)) &&
           (puVar14 + -8 != (undefined *)0x0)) {
          uVar12 = FUN_1400a3440();
          local_78 = uVar12;
          FUN_1400a1c30(uVar12);
          local_70 = 1;
          piVar2 = (int *)(puVar14 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_1400a3530(puVar14 + -8);
          }
          FUN_1400d1290(uVar12);
        }
      }
      FUN_140180680(plVar1,1);
      FUN_1400d1290(uVar9);
LAB_140183efd:
      FUN_1400d1290(local_150);
      return;
    }
    if ((*(int *)(lVar3 + 0x100) == 5) && (param_1[0x2d5] == 0)) {
      FUN_140180680(plVar1,1);
      FUN_1400d1290(local_160);
      goto LAB_140183efd;
    }
    if (DAT_1403142d0 != '\0') {
      FUN_140180680(plVar1,1);
      FUN_1400d1290(local_160);
      goto LAB_140183efd;
    }
    puVar10 = puVar15;
    if (param_1[0xad] != 0) {
      puVar10 = *(undefined **)(param_1[0xad] + 0x38);
    }
    if (*(longlong *)(puVar10 + 0x2b8) == 0) {
      puVar14 = puVar15;
      if ((undefined8 *)param_1[0xac] != (undefined8 *)0x0) {
        puVar14 = *(undefined **)param_1[0xac];
      }
      FUN_1401a8930(puVar14,5);
      FUN_1400a3440();
      local_138 = PTR_DAT_1402f8010;
      plVar11 = (longlong *)FUN_1400a3170(&local_128);
      puVar14 = (undefined *)*plVar11;
      if ((undefined *)*plVar11 == (undefined *)0x0) {
        puVar14 = PTR_DAT_1402f8010;
      }
      FUN_14003c600(&local_138,L"Unstability in Disconnect #2! Process=%s",puVar14);
      if (((local_128 != (undefined *)0x0) && (local_128 != PTR_DAT_1402f8010)) &&
         (local_128 + -8 != (undefined *)0x0)) {
        uVar9 = FUN_1400a3440();
        local_100 = uVar9;
        FUN_1400a1c30(uVar9);
        local_f8 = 1;
        piVar2 = (int *)(local_128 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(local_128 + -8);
        }
        FUN_1400d1290(uVar9);
      }
      FUN_1400a3440();
      puVar14 = local_138;
      local_res20 = PTR_DAT_1402f8010;
      if (PTR_DAT_1402f8010 == (undefined *)0x0) {
        local_res20 = puVar15;
      }
      if (local_138 != PTR_DAT_1402f8010) {
        uVar9 = FUN_1400a3440();
        local_f0 = uVar9;
        FUN_1400a1c30(uVar9);
        local_e8 = 1;
        FUN_1400031d0(&local_res20);
        local_res20 = puVar14;
        if (((puVar14 != PTR_DAT_1402f8010) && (puVar14 != (undefined *)0x0)) &&
           (puVar14 != (undefined *)0x8)) {
          *(int *)(puVar14 + -4) = *(int *)(puVar14 + -4) + 1;
        }
        FUN_1400d1290(uVar9);
      }
      FUN_1400a6370(&local_res20);
      if (((puVar14 != (undefined *)0x0) && (puVar14 != PTR_DAT_1402f8010)) &&
         (puVar14 + -8 != (undefined *)0x0)) {
        uVar9 = FUN_1400a3440();
        local_d8 = uVar9;
        FUN_1400a1c30(uVar9);
        local_d0 = 1;
        piVar2 = (int *)(puVar14 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(puVar14 + -8);
        }
        FUN_1400d1290(uVar9);
      }
      FUN_140180680(plVar1,1);
      FUN_1400d1290(local_160);
      goto LAB_140183efd;
    }
    DVar8 = GetTickCount();
    if (dVar5 < (double)(DVar8 - DVar7)) {
      FUN_1400a3440();
      local_130 = PTR_DAT_1402f8010;
      plVar11 = (longlong *)FUN_1400a3170(&local_120);
      puVar14 = (undefined *)*plVar11;
      if ((undefined *)*plVar11 == (undefined *)0x0) {
        puVar14 = PTR_DAT_1402f8010;
      }
      puVar10 = puVar15;
      if ((undefined8 *)param_1[0xac] != (undefined8 *)0x0) {
        puVar10 = *(undefined **)param_1[0xac];
      }
      FUN_14003c600(&local_130,
                    L"CNetClient.Disconnect seems to be freezed ## State=%d##GarbageCount=%d##Process=%s"
                    ,*(undefined4 *)(puVar10 + 0x100),param_1[0x2d5],puVar14);
      if (((local_120 != (undefined *)0x0) && (local_120 != PTR_DAT_1402f8010)) &&
         (local_120 + -8 != (undefined *)0x0)) {
        uVar9 = FUN_1400a3440();
        local_110 = uVar9;
        FUN_1400a1c30(uVar9);
        local_108 = 1;
        piVar2 = (int *)(local_120 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(local_120 + -8);
        }
        FUN_1400d1290(uVar9);
      }
      FUN_1400a3440();
      puVar14 = local_130;
      local_res10 = PTR_DAT_1402f8010;
      if (PTR_DAT_1402f8010 == (undefined *)0x0) {
        local_res10 = puVar15;
      }
      if (local_130 != PTR_DAT_1402f8010) {
        uVar9 = FUN_1400a3440();
        local_a8 = uVar9;
        FUN_1400a1c30(uVar9);
        local_a0 = 1;
        FUN_1400031d0(&local_res10);
        local_res10 = puVar14;
        if (((puVar14 != PTR_DAT_1402f8010) && (puVar14 != (undefined *)0x0)) &&
           (puVar14 != (undefined *)0x8)) {
          *(int *)(puVar14 + -4) = *(int *)(puVar14 + -4) + 1;
        }
        FUN_1400d1290(uVar9);
      }
      FUN_1400a6370(&local_res10);
      if ((undefined8 *)param_1[0xac] != (undefined8 *)0x0) {
        puVar15 = *(undefined **)param_1[0xac];
      }
      FUN_1401a8930(puVar15,5);
      FUN_140180680(plVar1,1);
      if (((puVar14 != (undefined *)0x0) && (puVar14 != PTR_DAT_1402f8010)) &&
         (puVar14 + -8 != (undefined *)0x0)) {
        uVar9 = FUN_1400a3440();
        local_c8 = uVar9;
        FUN_1400a1c30(uVar9);
        local_c0 = 1;
        piVar2 = (int *)(puVar14 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(puVar14 + -8);
        }
        FUN_1400d1290(uVar9);
      }
      FUN_1400d1290(local_160);
      goto LAB_140183efd;
    }
    if (!bVar6) {
      bVar6 = true;
      puVar10 = puVar15;
      if (param_1[0xad] != 0) {
        puVar10 = *(undefined **)(param_1[0xad] + 0x38);
      }
      FUN_1400a1d50(puVar10 + 0x10);
      puVar10 = puVar15;
      if ((undefined8 *)param_1[0xac] != (undefined8 *)0x0) {
        puVar10 = *(undefined **)param_1[0xac];
      }
      puVar4 = (undefined8 *)param_1[0xac];
      if (*(int *)(puVar10 + 0x100) == 3) {
        puVar10 = puVar15;
        if (puVar4 != (undefined8 *)0x0) {
          puVar10 = (undefined *)*puVar4;
        }
        uVar9 = (**(code **)(*param_1 + 0x1c0))(param_1);
        *(undefined8 *)(puVar10 + 0xd0) = uVar9;
        puVar10 = puVar15;
        if ((undefined8 *)param_1[0xac] != (undefined8 *)0x0) {
          puVar10 = *(undefined **)param_1[0xac];
        }
        *(double *)(puVar10 + 0xd8) = param_2;
        (**(code **)(param_1[0x2f5] + 0x80))(param_1 + 0x2f5,1,&DAT_140318cf0,local_res18);
      }
      else {
        puVar10 = puVar15;
        if (puVar4 != (undefined8 *)0x0) {
          puVar10 = (undefined *)*puVar4;
        }
        if (*(int *)(puVar10 + 0x100) < 3) {
          puVar10 = puVar15;
          if ((undefined8 *)param_1[0xac] != (undefined8 *)0x0) {
            puVar10 = *(undefined **)param_1[0xac];
          }
          FUN_1401a8930(puVar10,4);
        }
      }
    }
    uVar9 = local_160;
    cVar13 = local_158;
    if (0 < (int)puVar14) {
      FUN_1400d1290(local_160);
      Sleep(10);
      cVar13 = '\0';
    }
    puVar14 = (undefined *)(ulonglong)((int)puVar14 + 1);
    if (cVar13 != '\0') {
      FUN_1400d1290(uVar9);
    }
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140183f30(longlong *param_1,undefined4 *param_2)

{
  char cVar1;
  undefined8 uVar2;
  undefined1 auStack_1b8 [32];
  undefined4 *local_198;
  undefined4 *local_190;
  char local_188;
  char local_187 [3];
  undefined4 local_184;
  undefined4 local_180 [2];
  undefined8 local_178;
  undefined1 local_168 [312];
  undefined8 local_30;
  ulonglong local_18;
  
  local_178 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_1b8;
  (**(code **)(param_1[0xf] + 0x18))();
  local_184 = 0;
  local_180[0] = 0;
  uVar2 = (**(code **)(*param_1 + 0x58))(param_1);
  FUN_1401a6f60(local_168,uVar2);
  cVar1 = FUN_14017ec60(param_1,local_30);
  while (cVar1 != '\0') {
    local_187[0] = '\0';
    local_188 = '\0';
    local_190 = local_180;
    local_198 = &local_184;
    FUN_14017abe0(param_1,local_30,local_187,&local_188);
    if (local_188 != '\0') {
      FUN_140180220(param_1,local_30);
    }
    if (local_187[0] != '\0') break;
    FUN_1401a6fa0(local_168);
    uVar2 = (**(code **)(*param_1 + 0x58))(param_1);
    FUN_1401a6f60(local_168,uVar2);
    cVar1 = FUN_14017ec60(param_1,local_30);
  }
  FUN_1401a6fa0(local_168);
  if (param_2 != (undefined4 *)0x0) {
    *param_2 = local_184;
    param_2[1] = local_180[0];
  }
  return;
}



void FUN_140184080(longlong param_1,undefined4 param_2)

{
  int *piVar1;
  double dVar2;
  undefined8 *puVar3;
  char cVar4;
  undefined4 uVar5;
  uint uVar6;
  uint uVar7;
  uint uVar8;
  uint uVar9;
  int iVar10;
  undefined4 *puVar11;
  undefined4 *puVar12;
  longlong *plVar13;
  uint *puVar14;
  undefined8 uVar15;
  longlong *plVar16;
  longlong lVar17;
  uint *puVar18;
  longlong lVar19;
  uint *puVar20;
  longlong lVar21;
  uint uVar22;
  longlong lVar23;
  longlong lVar24;
  longlong lVar25;
  int iVar26;
  undefined *puVar27;
  undefined *puVar28;
  undefined *puVar29;
  undefined4 *puVar30;
  double dVar31;
  double dVar32;
  undefined8 *local_res8;
  undefined4 local_res10;
  uint *local_res18;
  undefined4 *local_res20;
  undefined **local_228;
  undefined4 local_220;
  undefined2 local_21c;
  undefined *local_218;
  undefined *local_210;
  undefined *local_208;
  undefined *local_200;
  undefined4 *local_1f8;
  undefined1 local_1f0;
  undefined *local_1e8;
  undefined *local_1e0;
  undefined4 local_1d8 [2];
  longlong local_1d0 [2];
  undefined8 local_1c0;
  undefined8 local_1b8;
  undefined **local_1b0;
  undefined8 local_1a8;
  undefined8 local_1a0;
  undefined8 local_198;
  undefined8 local_190;
  undefined8 local_188;
  longlong local_180;
  ulonglong local_178;
  undefined4 local_168;
  undefined **local_160;
  undefined8 local_158;
  undefined8 local_150;
  undefined8 local_148;
  undefined8 local_140;
  undefined **local_130;
  undefined4 local_128;
  undefined2 local_124;
  undefined **local_118;
  undefined8 local_110;
  undefined8 local_108;
  undefined8 local_100;
  undefined8 local_f8;
  undefined8 local_e8;
  undefined1 local_e0;
  undefined8 local_d8;
  undefined1 local_d0;
  undefined8 local_c8;
  undefined1 local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined1 local_a8;
  undefined8 local_a0;
  undefined1 local_98;
  undefined8 local_90;
  undefined1 local_88;
  undefined8 local_80;
  undefined1 local_78;
  undefined4 *local_70;
  
  local_b8 = 0xfffffffffffffffe;
  puVar30 = (undefined4 *)0x0;
  uVar8 = 0;
  puVar11 = puVar30;
  if (*(undefined8 **)(param_1 + 0x1570) != (undefined8 *)0x0) {
    puVar11 = (undefined4 *)**(undefined8 **)(param_1 + 0x1570);
  }
  if (*(char *)(puVar11 + 0x20) != '\x01') {
    return;
  }
  puVar11 = puVar30;
  if (*(undefined8 **)(param_1 + 0x1570) != (undefined8 *)0x0) {
    puVar11 = (undefined4 *)**(undefined8 **)(param_1 + 0x1570);
  }
  local_res10 = param_2;
  FUN_1401b19c0(puVar11,0);
  local_1d0[0] = 0;
  local_1c0 = 0;
  local_1b8 = 0;
  local_1a8 = 0;
  local_1a0 = 0;
  local_198 = 0;
  local_190 = 0;
  local_1b0 = Proud::ByteArray::vftable;
  local_178 = 0;
  local_180 = 0;
  local_188 = 0;
  local_158 = 0;
  local_150 = 0;
  local_148 = 0;
  local_140 = 0;
  local_160 = Proud::ByteArray::vftable;
  local_130 = Proud::AddrPort::vftable;
  local_128 = 0;
  local_124 = 0;
  local_110 = 0;
  local_108 = 0;
  local_100 = 0;
  local_f8 = 0;
  local_118 = Proud::ByteArray::vftable;
  local_res20 = (undefined4 *)FUN_1400a34c0(0x60);
  puVar11 = puVar30;
  if (local_res20 != (undefined4 *)0x0) {
    puVar11 = (undefined4 *)FUN_140141470(local_res20);
  }
  if (puVar11 == (undefined4 *)0x0) {
    local_res20 = (undefined4 *)0x0;
    puVar12 = puVar30;
  }
  else {
    puVar12 = (undefined4 *)FUN_1400a34c0(0x48);
    local_70 = puVar12;
    if (puVar12 != (undefined4 *)0x0) {
      local_res20 = puVar12;
      uVar5 = FUN_1401692e0();
      FUN_1400a1b50(puVar12,uVar5,1);
    }
    local_res20 = puVar12;
    FUN_1400a1c30(puVar12);
    *(undefined8 *)(puVar12 + 0x10) = 1;
    *(undefined4 **)(puVar12 + 0xe) = puVar11;
    FUN_1400d1290(puVar12);
  }
  FUN_140141570(local_1d0,&local_res20);
  if (puVar12 != (undefined4 *)0x0) {
    local_1f8 = puVar12;
    FUN_1400a1c30(puVar12);
    local_1f0 = 1;
    plVar16 = (longlong *)(puVar12 + 0x10);
    *plVar16 = *plVar16 + -1;
    if (*plVar16 == 0) {
      FUN_1400d1290(puVar12);
      local_1f0 = 0;
      FUN_14008c910(puVar12);
    }
    else {
      FUN_1400d1290(puVar12);
      local_1f0 = 0;
    }
  }
  local_1d8[0] = 0xd;
  puVar11 = puVar30;
  if (local_1d0[0] != 0) {
    puVar11 = *(undefined4 **)(local_1d0[0] + 0x38);
  }
  *puVar11 = 0x1c;
  local_168 = 1;
  FUN_14017fdf0(param_1,local_1d8);
  puVar11 = puVar30;
  if (*(undefined8 **)(param_1 + 0x1570) != (undefined8 *)0x0) {
    puVar11 = (undefined4 *)**(undefined8 **)(param_1 + 0x1570);
  }
  puVar3 = *(undefined8 **)(param_1 + 0x1570);
  if ((int)puVar11[0x50] < DAT_1402f8088) {
    puVar11 = puVar30;
    if (puVar3 != (undefined8 *)0x0) {
      puVar11 = (undefined4 *)*puVar3;
    }
    *(undefined8 *)(puVar11 + 0x40) = DAT_140314010;
    puVar11 = puVar30;
    if (*(undefined8 **)(param_1 + 0x1570) != (undefined8 *)0x0) {
      puVar11 = (undefined4 *)**(undefined8 **)(param_1 + 0x1570);
    }
    puVar11[0x50] = puVar11[0x50] + 1;
  }
  else {
    puVar11 = puVar30;
    if (puVar3 != (undefined8 *)0x0) {
      puVar11 = (undefined4 *)*puVar3;
    }
    *(undefined8 *)(puVar11 + 0x40) = DAT_1402f8078;
  }
  if ((*(char *)(param_1 + 0x1790) == '\0') && (*(int *)(param_1 + 0x6c8) == 0)) goto LAB_1401849d2;
  FUN_1401767b0(param_1,&local_210);
  puVar11 = puVar30;
  if (*(undefined8 **)(param_1 + 0x1570) != (undefined8 *)0x0) {
    puVar11 = (undefined4 *)**(undefined8 **)(param_1 + 0x1570);
  }
  plVar16 = (longlong *)(param_1 + 0x70);
  dVar31 = (double)(**(code **)(*plVar16 + 0x1c0))(plVar16);
  dVar2 = *(double *)(puVar11 + 0x30);
  dVar32 = 0.0;
  if (((*(longlong **)(param_1 + 0x1520) != (longlong *)0x0) &&
      (lVar21 = **(longlong **)(param_1 + 0x1520), dVar32 = 0.0, lVar21 != 0)) &&
     (dVar32 = 0.0, lVar21 != 0x40)) {
    puVar11 = (undefined4 *)(lVar21 + -0x40);
    if (lVar21 == 0) {
      puVar11 = puVar30;
    }
    dVar32 = (double)(**(code **)(*plVar16 + 0x1c0))(plVar16);
    dVar32 = dVar32 - *(double *)(puVar11 + 0x60);
  }
  if (((*(longlong **)(param_1 + 0x1520) == (longlong *)0x0) ||
      (lVar21 = **(longlong **)(param_1 + 0x1520), lVar21 == 0)) || (lVar21 == 0x40)) {
    local_220 = DAT_1402f83d0;
    local_21c = DAT_1402f83d4;
  }
  else {
    puVar11 = puVar30;
    if (lVar21 != 0) {
      puVar11 = (undefined4 *)(lVar21 + -0x40);
    }
    local_220 = puVar11[0x4c];
    local_21c = *(undefined2 *)(puVar11 + 0x4d);
  }
  local_228 = Proud::AddrPort::vftable;
  plVar13 = (longlong *)FUN_1400a6f50(&local_228,&local_200);
  puVar27 = (undefined *)*plVar13;
  if ((undefined *)*plVar13 == (undefined *)0x0) {
    puVar27 = PTR_DAT_1402f8010;
  }
  FUN_1400a3440();
  puVar20 = (uint *)PTR_DAT_1402f8010;
  local_res18 = (uint *)PTR_DAT_1402f8010;
  uVar6 = FUN_1400a32c0(puVar27);
  puVar11 = puVar30;
  if ((puVar20 != (uint *)0x0) &&
     (puVar11 = (undefined4 *)0x0, puVar20 != (uint *)PTR_DAT_1402f8010)) {
    puVar11 = (undefined4 *)(ulonglong)*(uint *)((longlong)puVar20 + -8);
  }
  uVar9 = 0;
  uVar7 = uVar6;
  if ((((int)uVar6 <= (int)puVar11) && (uVar7 = uVar8, puVar20 != (uint *)0x0)) &&
     (uVar7 = uVar9, puVar20 != (uint *)PTR_DAT_1402f8010)) {
    uVar7 = *(uint *)((longlong)puVar20 + -8);
  }
  uVar22 = 1;
  if (1 < (int)uVar7) {
    uVar22 = uVar7;
  }
  uVar7 = uVar9;
  if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1402f8010)) {
    uVar7 = *(uint *)((longlong)puVar20 + -8);
  }
  if ((int)uVar7 < (int)uVar22) {
    if (puVar20 == (uint *)0x0) {
      puVar20 = (uint *)PTR_DAT_1402f8010;
    }
    local_res18 = puVar20;
    if ((int)uVar22 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar22 == 0) {
      FUN_1400031d0(&local_res18);
    }
    else {
      uVar7 = uVar9;
      if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1402f8010)) {
        uVar7 = puVar20[-2];
      }
      if (uVar22 != uVar7) {
        puVar14 = (uint *)FUN_1400a34c0((longlong)(int)uVar22 * 2 + 10);
        if (puVar14 != (uint *)0x0) {
          *puVar14 = 0;
          puVar14[1] = 1;
        }
        *puVar14 = uVar22;
        uVar7 = uVar9;
        if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1402f8010)) {
          uVar7 = puVar20[-2];
        }
        puVar18 = (uint *)PTR_DAT_1402f8010;
        if ((int)uVar22 < (int)uVar7) {
LAB_14018451a:
          if (puVar20 != (uint *)0x0) {
            puVar18 = puVar20;
          }
        }
        else {
          uVar22 = uVar8;
          if (puVar20 != (uint *)0x0) {
            if (puVar20 != (uint *)PTR_DAT_1402f8010) {
              uVar22 = puVar20[-2];
            }
            goto LAB_14018451a;
          }
        }
        FUN_1400a32f0(puVar14 + 2,puVar18,uVar22);
        FUN_1400031d0(&local_res18);
        local_res18 = puVar14 + 2;
      }
    }
  }
  FUN_140002e30(&local_res18);
  puVar20 = local_res18;
  puVar14 = local_res18;
  if (local_res18 == (uint *)0x0) {
    puVar14 = (uint *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar14,puVar27,uVar6);
  puVar14 = puVar20;
  if (puVar20 == (uint *)0x0) {
    puVar14 = (uint *)PTR_DAT_1402f8010;
  }
  uVar8 = FUN_1400a32c0(puVar14);
  puVar11 = puVar30;
  if (0 < (int)uVar8) {
    puVar11 = (undefined4 *)(ulonglong)uVar8;
  }
  if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1402f8010)) {
    uVar9 = puVar20[-2];
  }
  if (((int)puVar11 < (int)uVar9) || (puVar11 = puVar30, puVar20 == (uint *)0x0)) {
LAB_1401845b6:
    if (((puVar20 != (uint *)PTR_DAT_1402f8010) && (puVar20 != (uint *)0x0)) &&
       (puVar20 + -2 != (uint *)0x0)) {
      puVar20[-2] = (uint)puVar11;
      *(undefined2 *)((longlong)puVar20 + (longlong)(int)(uint)puVar11 * 2) = 0;
    }
  }
  else if (puVar20 != (uint *)PTR_DAT_1402f8010) {
    puVar11 = (undefined4 *)(ulonglong)puVar20[-2];
    goto LAB_1401845b6;
  }
  if (((local_200 != (undefined *)0x0) && (local_200 != PTR_DAT_1402f8010)) &&
     (local_200 + -8 != (undefined *)0x0)) {
    uVar15 = FUN_1400a3440();
    local_a0 = uVar15;
    FUN_1400a1c30(uVar15);
    local_98 = 1;
    piVar1 = (int *)(local_200 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_200 + -8);
    }
    FUN_1400d1290(uVar15);
  }
  if (puVar20 == (uint *)0x0) {
    puVar20 = (uint *)PTR_DAT_1402f8010;
  }
  puVar27 = local_210;
  if (local_210 == (undefined *)0x0) {
    puVar27 = PTR_DAT_1402f8010;
  }
  local_res8 = (undefined8 *)((ulonglong)local_res8 & 0xffffffffffffff00);
  local_200 = PTR_DAT_1402f8010;
  cVar4 = (**(code **)(*plVar16 + 0x158))(plVar16,&local_res8);
  iVar26 = 1;
  if (cVar4 != '\0') {
    iVar26 = 1;
    if ((char)local_res8 == '\0') {
      iVar26 = 2;
    }
  }
  plVar16 = (longlong *)(**(code **)(*plVar16 + 0xb0))(plVar16,&local_1e8);
  puVar28 = (undefined *)*plVar16;
  if (puVar28 == (undefined *)0x0) {
    iVar10 = 0;
  }
  else if (puVar28 == PTR_DAT_1402f8010) {
    iVar10 = 0;
  }
  else {
    iVar10 = *(int *)(puVar28 + -8);
  }
  if (((local_1e8 != (undefined *)0x0) && (local_1e8 != PTR_DAT_1402f8010)) &&
     (local_1e8 + -8 != (undefined *)0x0)) {
    uVar15 = FUN_1400a3440();
    local_e8 = uVar15;
    FUN_1400a1c30(uVar15);
    local_e0 = 1;
    piVar1 = (int *)(local_1e8 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_1e8 + -8);
    }
    FUN_1400d1290(uVar15);
  }
  if (iVar10 != 0) {
    iVar26 = iVar26 + 1;
  }
  FUN_1400a3440();
  local_218 = PTR_DAT_1402f8010;
  plVar16 = (longlong *)FUN_1400a3170(&local_1e0);
  plVar13 = (longlong *)(**(code **)(*(longlong *)(param_1 + 0x70) + 0xb0))();
  puVar28 = (undefined *)*plVar16;
  if ((undefined *)*plVar16 == (undefined *)0x0) {
    puVar28 = PTR_DAT_1402f8010;
  }
  puVar29 = (undefined *)*plVar13;
  if ((undefined *)*plVar13 == (undefined *)0x0) {
    puVar29 = PTR_DAT_1402f8010;
  }
  plVar16 = *(longlong **)(param_1 + 0x1570);
  if (plVar16 == (longlong *)0x0) {
    lVar21 = 0;
    lVar25 = 0;
    lVar24 = 0;
  }
  else {
    lVar21 = *plVar16;
    lVar25 = *plVar16;
    lVar24 = *plVar16;
  }
  lVar17 = *(longlong *)(param_1 + 0x5d8);
  if (lVar17 == 0) {
    lVar23 = 0;
    lVar19 = 0;
    lVar17 = 0;
  }
  else {
    lVar23 = *(longlong *)(lVar17 + 0x38);
    lVar19 = *(longlong *)(lVar17 + 0x38);
    lVar17 = *(longlong *)(lVar17 + 0x38);
  }
  FUN_14003c600(&local_218,
                L"(first chance) to-server UDP punch lost##Reason:%d##CliInstCount=%d##RecentElapTime=%3.3f##DisconnedCount=%d##recv count=%d##last ok recv interval=%3.3f##Recurred:%d##LocalIP:%s##UDP kept time:%3.3f##Time diff since RecvIssue:%3.3f##NAT name=%s##%s##Process=%s"
                ,local_res10,*(undefined4 *)(lVar17 + 0x2a8),*(undefined8 *)(lVar19 + 0x180),
                *(undefined4 *)(lVar23 + 0x288),*(undefined4 *)(lVar24 + 0x1c0),
                *(undefined8 *)(lVar25 + 0x200),*(undefined4 *)(lVar21 + 0x140),puVar20,
                dVar31 - dVar2,dVar32,puVar29,puVar27,puVar28);
  if (((local_208 != (undefined *)0x0) && (local_208 != PTR_DAT_1402f8010)) &&
     (local_208 + -8 != (undefined *)0x0)) {
    uVar15 = FUN_1400a3440();
    local_80 = uVar15;
    FUN_1400a1c30(uVar15);
    local_78 = 1;
    piVar1 = (int *)(local_208 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_208 + -8);
    }
    FUN_1400d1290(uVar15);
  }
  local_208 = PTR_DAT_1402f8010;
  if (((local_1e0 != (undefined *)0x0) && (local_1e0 != PTR_DAT_1402f8010)) &&
     (local_1e0 + -8 != (undefined *)0x0)) {
    uVar15 = FUN_1400a3440();
    local_d8 = uVar15;
    FUN_1400a1c30(uVar15);
    local_d0 = 1;
    piVar1 = (int *)(local_1e0 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_1e0 + -8);
    }
    FUN_1400d1290(uVar15);
  }
  puVar27 = local_218;
  FUN_140178190(param_1,iVar26,&DAT_140271f08,local_218);
  if (((puVar27 != (undefined *)0x0) && (puVar27 != PTR_DAT_1402f8010)) &&
     (puVar27 + -8 != (undefined *)0x0)) {
    uVar15 = FUN_1400a3440();
    local_c8 = uVar15;
    FUN_1400a1c30(uVar15);
    local_c0 = 1;
    piVar1 = (int *)(puVar27 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar27 + -8);
    }
    FUN_1400d1290(uVar15);
  }
  puVar20 = local_res18;
  if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1402f8010)) &&
     (puVar14 = local_res18 + -2, puVar14 != (uint *)0x0)) {
    uVar15 = FUN_1400a3440();
    local_b0 = uVar15;
    FUN_1400a1c30(uVar15);
    local_a8 = 1;
    puVar20 = puVar20 + -1;
    *puVar20 = *puVar20 - 1;
    if (*puVar20 == 0) {
      FUN_1400a3530(puVar14);
    }
    FUN_1400d1290(uVar15);
  }
  if (((local_210 != (undefined *)0x0) && (local_210 != PTR_DAT_1402f8010)) &&
     (local_210 + -8 != (undefined *)0x0)) {
    uVar15 = FUN_1400a3440();
    local_90 = uVar15;
    FUN_1400a1c30(uVar15);
    local_88 = 1;
    piVar1 = (int *)(local_210 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(local_210 + -8);
    }
    FUN_1400d1290(uVar15);
  }
LAB_1401849d2:
  (**(code **)(*(longlong *)(param_1 + 0x1818) + 0x50))
            ((longlong *)(param_1 + 0x1818),1,&DAT_140318cf0);
  FUN_140140df0(&local_118);
  FUN_140140df0(&local_160);
  local_res8 = &local_188;
  FUN_14019a730(&local_188);
  if (local_180 != 0) {
    if ((longlong)local_178 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_178 = local_178 & 0xffffffff00000000;
  }
  FUN_140140df0(&local_1b0);
  FUN_14015bf40(&local_1b8);
  FUN_14015bec0(&local_1c0);
  FUN_14008c980(local_1d0);
  return;
}



void FUN_140184a80(longlong *param_1,undefined8 param_2)

{
  char cVar1;
  longlong lVar2;
  
  if (((double)param_1[699] != -1.0) && (cVar1 = FUN_1400ad850(param_1 + 0x2b6), cVar1 == '\0')) {
    lVar2 = (**(code **)(*param_1 + 0x1c0))(param_1);
    param_1[699] = lVar2;
  }
  FUN_1401802c0(param_1 + -0xe);
  FUN_140183f30(param_1 + -0xe,param_2);
  return;
}



void FUN_140184af0(undefined8 param_1,undefined4 param_2,undefined4 param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 *local_res20;
  undefined4 local_128 [2];
  longlong local_120 [2];
  undefined8 local_110;
  undefined8 local_108;
  undefined **local_100;
  undefined8 local_f8;
  undefined8 local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  longlong local_d0;
  ulonglong local_c8;
  undefined4 local_b8;
  undefined **local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined **local_80;
  undefined4 local_78;
  undefined2 local_74;
  undefined **local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  puVar5 = (undefined8 *)0x0;
  local_120[0] = 0;
  local_110 = 0;
  local_108 = 0;
  local_f8 = 0;
  local_f0 = 0;
  local_e8 = 0;
  local_e0 = 0;
  local_100 = Proud::ByteArray::vftable;
  local_c8 = 0;
  local_d0 = 0;
  local_d8 = 0;
  local_a8 = 0;
  local_a0 = 0;
  local_98 = 0;
  local_90 = 0;
  local_b0 = Proud::ByteArray::vftable;
  local_80 = Proud::AddrPort::vftable;
  local_78 = 0;
  local_74 = 0;
  local_60 = 0;
  local_58 = 0;
  local_50 = 0;
  local_48 = 0;
  local_68 = Proud::ByteArray::vftable;
  local_res20 = (undefined8 *)FUN_1400a34c0(0x60);
  puVar3 = puVar5;
  if (local_res20 != (undefined8 *)0x0) {
    puVar3 = (undefined8 *)FUN_140141470(local_res20);
  }
  if (puVar3 == (undefined8 *)0x0) {
    local_res20 = (undefined8 *)0x0;
    puVar4 = puVar5;
  }
  else {
    puVar4 = (undefined8 *)FUN_1400a34c0(0x48);
    if (puVar4 != (undefined8 *)0x0) {
      local_res20 = puVar4;
      uVar2 = FUN_1401692e0();
      FUN_1400a1b50(puVar4,uVar2,1);
    }
    local_res20 = puVar4;
    FUN_1400a1c30(puVar4);
    puVar4[8] = 1;
    puVar4[7] = puVar3;
    FUN_1400d1290(puVar4);
  }
  FUN_140141570(local_120,&local_res20);
  if (puVar4 != (undefined8 *)0x0) {
    FUN_1400a1c30(puVar4);
    plVar1 = puVar4 + 8;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      FUN_1400d1290(puVar4);
      FUN_14008c910(puVar4);
    }
    else {
      FUN_1400d1290(puVar4);
    }
  }
  local_128[0] = 0xb;
  if (local_120[0] != 0) {
    puVar5 = *(undefined8 **)(local_120[0] + 0x38);
  }
  *(undefined4 *)puVar5 = param_3;
  local_b8 = param_2;
  FUN_14017fdf0(param_1,local_128);
  FUN_140140df0(&local_68);
  FUN_140140df0(&local_b0);
  local_res20 = &local_d8;
  FUN_14019a730(&local_d8);
  if (local_d0 != 0) {
    if ((longlong)local_c8 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_c8 = local_c8 & 0xffffffff00000000;
  }
  FUN_140140df0(&local_100);
  FUN_14015bf40(&local_108);
  FUN_14015bec0(&local_110);
  FUN_14008c980(local_120);
  return;
}



longlong FUN_140184d20(void)

{
  void *pvVar1;
  longlong lVar2;
  
  pvVar1 = operator_new(0x1900);
  lVar2 = 0;
  if (pvVar1 != (void *)0x0) {
    lVar2 = FUN_1401822a0(pvVar1);
  }
  if (lVar2 != 0) {
    lVar2 = lVar2 + 0x70;
  }
  return lVar2;
}



void FUN_140184d60(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  double dVar3;
  
  dVar3 = (double)(**(code **)(*(longlong *)(param_1 + 0x70) + 0x1c0))(param_1 + 0x70);
  lVar2 = 0;
  lVar1 = lVar2;
  if (*(longlong **)(param_1 + 0x1570) != (longlong *)0x0) {
    lVar1 = **(longlong **)(param_1 + 0x1570);
  }
  if (*(char *)(lVar1 + 0x80) != '\0') {
    if (*(longlong **)(param_1 + 0x1570) != (longlong *)0x0) {
      lVar2 = **(longlong **)(param_1 + 0x1570);
    }
    if (DAT_1402f80f8 * 10.0 < dVar3 - *(double *)(lVar2 + 0x180)) {
      FUN_140184080(param_1,0x1c);
    }
  }
  return;
}



void FUN_140184de0(longlong *param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined8 uVar5;
  longlong lVar6;
  undefined1 local_res8 [8];
  
  local_res8[0] = 0;
  iVar1 = (**(code **)(*param_1 + 0x108))(param_1,local_res8,param_3,param_4,0xfffffffffffffffe);
  if (iVar1 == 2) {
    uVar2 = (**(code **)(param_1[-0xe] + 0x58))(param_1 + -0xe);
    FUN_1400a1c30(uVar2);
    if (param_2 == 1) {
      FUN_14016c100(param_1 + -0xe,0x1e);
    }
    else if (param_2 == 2) {
      FUN_140184080(param_1 + -0xe,0x1e);
    }
    else if (param_2 == 3) {
      (**(code **)(param_1[1] + 0x10))();
      plVar4 = (longlong *)param_1[0x296];
      if ((((plVar4 != (longlong *)0x0) && (*plVar4 != 0)) && (plVar4 != (longlong *)0x0)) &&
         ((*plVar4 != 0 && (*plVar4 != 0x40)))) {
        plVar4 = (longlong *)param_1[0x296];
        if (((plVar4 == (longlong *)0x0) || ((*plVar4 == 0 || (plVar4 == (longlong *)0x0)))) ||
           (*plVar4 == 0)) {
          lVar3 = 0;
        }
        else {
          lVar3 = *plVar4 + -0x40;
        }
        uVar5 = 0;
        if (*(undefined8 **)(lVar3 + 0x100) != (undefined8 *)0x0) {
          uVar5 = **(undefined8 **)(lVar3 + 0x100);
        }
        FUN_1400a88b0(uVar5);
      }
      if (param_1[0x2c0] == 0) {
        lVar3 = 0;
      }
      else {
        lVar3 = param_1[0x2be];
      }
      for (; lVar3 != 0; lVar3 = *(longlong *)(lVar3 + 0x10)) {
        lVar6 = 0;
        if (*(longlong **)(lVar3 + 8) != (longlong *)0x0) {
          lVar6 = **(longlong **)(lVar3 + 8);
        }
        if ((*(longlong **)(lVar6 + 0x18) != (longlong *)0x0) &&
           (**(longlong **)(lVar6 + 0x18) != 0)) {
          plVar4 = (longlong *)FUN_1401b8a70();
          (**(code **)(*plVar4 + 0x10))(plVar4);
        }
      }
    }
    FUN_1400d1290(uVar2);
  }
  return;
}



undefined8 FUN_140184f50(longlong param_1)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_1400a1c30(uVar1);
  FUN_140184d60(*(undefined8 *)(param_1 + 0x20));
  FUN_1400d1290(uVar1);
  return 1;
}



longlong * FUN_140184fb0(longlong *param_1,longlong param_2)

{
  *param_1 = param_2;
  *(undefined1 *)(param_1 + 1) = *(undefined1 *)(param_2 + 0x20);
  *(undefined1 *)(param_2 + 0x20) = 0;
  return param_1;
}



void FUN_140184fd0(longlong *param_1)

{
  *(char *)(*param_1 + 0x20) = (char)param_1[1];
  return;
}



void FUN_140184fe0(longlong *param_1)

{
  longlong lVar1;
  undefined1 local_58 [80];
  
  if (param_1[1] != 0) {
    FUN_1400a2320(local_58,PTR_u_Cannot_use_internal_buffer_becau_14030c160);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  if (*param_1 == 0) {
    lVar1 = FUN_14019a770();
    *param_1 = lVar1;
    *(undefined8 *)(lVar1 + 0x28) = 1;
  }
  return;
}



void FUN_140185030(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  undefined1 local_58 [80];
  
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_1400a2320(local_58,PTR_u_Cannot_use_internal_buffer_becau_14030c160);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  if (*(longlong *)(param_1 + 8) == 0) {
    lVar2 = FUN_14019a770();
    *(longlong *)(param_1 + 8) = lVar2;
    *(undefined8 *)(lVar2 + 0x28) = 1;
  }
  if (*(longlong *)(param_1 + 8) != 0) {
    *(undefined4 *)(*(longlong *)(param_1 + 8) + 0x24) = 1;
  }
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 != 0) {
    iVar1 = *(int *)(lVar2 + 0x20);
    if (iVar1 < 0x80) {
      iVar1 = 0x80;
    }
    *(int *)(lVar2 + 0x20) = iVar1;
  }
  return;
}



void FUN_1401850b0(undefined8 *param_1)

{
  *param_1 = 0;
  FUN_14019a730(param_1 + 1);
  param_1[3] = 0;
  param_1[2] = 0;
  return;
}



void FUN_1401850e0(longlong *param_1,longlong param_2,int param_3)

{
  undefined1 local_58 [88];
  
  if (*param_1 != 0) {
    FUN_1400a2320(local_58,PTR_u_Cannot_use_external_buffer_becau_14030c158);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  if (param_1[1] != 0) {
    FUN_1400a2320(local_58,PTR_u_Cannot_use_internal_buffer_becau_14030c160);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  if ((param_2 != 0) && (param_3 != 0)) {
    *(int *)((longlong)param_1 + 0x14) = param_3;
    *(undefined4 *)(param_1 + 2) = 0;
    param_1[1] = param_2;
  }
  return;
}



void FUN_140185160(int *param_1,int param_2)

{
  int iVar1;
  longlong lVar2;
  undefined1 local_50 [80];
  
  lVar2 = *(longlong *)(param_1 + 2);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 4) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = param_1[6];
  }
  else {
    iVar1 = *(int *)(lVar2 + 0x18);
  }
  if (iVar1 < param_2) {
    if (lVar2 == 0) {
      if (*(longlong *)(param_1 + 4) == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      iVar1 = param_1[6];
    }
    else {
      iVar1 = *(int *)(lVar2 + 0x18);
    }
    FUN_1400a2320(local_50,&DAT_1402582f0,iVar1,param_2);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
  }
  *param_1 = param_2 * 8;
  return;
}



void FUN_1401851e0(longlong param_1,undefined8 param_2,int param_3)

{
  undefined1 local_58 [88];
  
  if (DAT_1402f8140 < param_3) {
    FUN_1400a2320(local_58,L"UseExternalBuffer failed due to too large capacity");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  FUN_1401850e0(param_1 + 8);
  return;
}



undefined8 FUN_140185220(int *param_1,undefined8 param_2,int param_3)

{
  int iVar1;
  uint uVar2;
  longlong lVar3;
  uint uVar4;
  int iVar5;
  undefined1 local_58 [80];
  
  lVar3 = *(longlong *)(param_1 + 2);
  if ((lVar3 == 0) && (*(longlong *)(param_1 + 4) == 0)) {
    FUN_1400a2320(local_58,L"Cannot read from Null pointer message!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  uVar4 = *param_1 >> 0x1f & 7;
  uVar2 = *param_1 + uVar4;
  iVar5 = (int)uVar2 >> 3;
  if ((uVar2 & 7) != uVar4) {
    FUN_1400a2320(local_58,L"Read offset is not byte aligned!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  if (lVar3 == 0) {
    if (*(longlong *)(param_1 + 4) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = param_1[6];
  }
  else {
    iVar1 = *(int *)(lVar3 + 0x18);
  }
  if (iVar1 < iVar5 + param_3) {
    return 0;
  }
  if (*(longlong *)(param_1 + 4) == 0) {
    if (lVar3 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    if (*(int *)(lVar3 + 0x18) == 0) {
      lVar3 = 0;
    }
    else {
      lVar3 = *(longlong *)(lVar3 + 0x10);
    }
  }
  else {
    lVar3 = *(longlong *)(param_1 + 4);
    if (lVar3 == 0) {
      FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
  }
  FUN_1400224d0(param_2,iVar5 + lVar3,(longlong)param_3);
  *param_1 = *param_1 + param_3 * 8;
  return 1;
}



undefined4 FUN_140185350(int *param_1,int param_2)

{
  longlong lVar1;
  uint uVar2;
  uint uVar3;
  int iVar4;
  undefined1 local_58 [88];
  
  lVar1 = *(longlong *)(param_1 + 2);
  if ((lVar1 == 0) && (*(longlong *)(param_1 + 4) == 0)) {
    FUN_1400a2320(local_58,L"Cannot read from Null pointer message!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  uVar3 = *param_1 >> 0x1f & 7;
  uVar2 = *param_1 + uVar3;
  iVar4 = (int)uVar2 >> 3;
  if ((uVar2 & 7) != uVar3) {
    FUN_1400a2320(local_58,L"Read offset is not byte aligned!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  if (lVar1 != 0) {
    iVar4 = iVar4 + param_2;
    return CONCAT31((int3)((uint)iVar4 >> 8),iVar4 <= *(int *)(lVar1 + 0x18));
  }
  if (*(longlong *)(param_1 + 4) != 0) {
    iVar4 = iVar4 + param_2;
    return CONCAT31((int3)((uint)iVar4 >> 8),iVar4 <= param_1[6]);
  }
                    // WARNING: Subroutine does not return
  FUN_14019a830();
}



void FUN_140185400(int *param_1)

{
  int iVar1;
  char cVar2;
  char local_res8 [32];
  undefined1 local_58 [80];
  
  if ((char)param_1[8] != '\0') {
    cVar2 = FUN_140185220(param_1,local_res8,1);
    if ((cVar2 == '\0') || (local_res8[0] != -2)) {
      if (*(longlong *)(param_1 + 2) == 0) {
        if (*(longlong *)(param_1 + 4) == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        iVar1 = param_1[6];
      }
      else {
        iVar1 = *(int *)(*(longlong *)(param_1 + 2) + 0x18);
      }
      FUN_1400a2320(local_58,L"CMessage: Test splitter failure(reading=%d,length=%d)",
                    (int)((*param_1 >> 0x1f & 7U) + *param_1) >> 3,iVar1);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
  }
  return;
}



undefined1 FUN_140185490(uint *param_1,undefined8 param_2,int param_3)

{
  char cVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  
  if (param_3 != 0) {
    uVar4 = (int)*param_1 >> 0x1f & 7;
    uVar2 = *param_1 + uVar4;
    uVar3 = uVar2 & 0xfffffff8;
    *param_1 = uVar3;
    if (0 < (int)((uVar2 & 7) - uVar4)) {
      *param_1 = uVar3 + 8;
    }
    cVar1 = FUN_140185220(param_1,param_2);
    if (cVar1 == '\0') {
      return 0;
    }
    FUN_140185400(param_1);
  }
  return 1;
}



undefined1 FUN_1401854f0(uint *param_1,int param_2)

{
  uint uVar1;
  char cVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  
  if (param_2 == 0) {
    return 1;
  }
  uVar1 = *param_1;
  uVar5 = (int)uVar1 >> 0x1f & 7;
  uVar3 = uVar1 + uVar5;
  uVar4 = uVar3 & 0xfffffff8;
  *param_1 = uVar4;
  if (0 < (int)((uVar3 & 7) - uVar5)) {
    *param_1 = uVar4 + 8;
  }
  cVar2 = FUN_140185350(param_1,param_2);
  if (cVar2 == '\0') {
    *param_1 = uVar1;
    return 0;
  }
  FUN_140185400(param_1);
  *param_1 = uVar1;
  return 1;
}



undefined4 * FUN_140185560(undefined4 *param_1)

{
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined8 *)(param_1 + 4) = 0;
  *(undefined8 *)(param_1 + 2) = 0;
  *param_1 = 0;
  param_1[1] = 0;
  *(undefined1 *)(param_1 + 8) = 0;
  return param_1;
}



undefined4 * FUN_140185590(undefined4 *param_1,undefined4 *param_2)

{
  longlong *plVar1;
  
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined8 *)(param_1 + 4) = 0;
  *(undefined8 *)(param_1 + 2) = 0;
  *param_1 = *param_2;
  *(undefined1 *)(param_1 + 8) = *(undefined1 *)(param_2 + 8);
  param_1[1] = param_2[1];
  if (*(longlong *)(param_2 + 2) == *(longlong *)(param_1 + 2)) {
    param_1[7] = param_2[7];
    *(undefined8 *)(param_1 + 4) = *(undefined8 *)(param_2 + 4);
    param_1[6] = param_2[6];
  }
  else {
    FUN_14019a730(param_1 + 2);
    if (*(longlong *)(param_2 + 2) != 0) {
      plVar1 = (longlong *)(*(longlong *)(param_2 + 2) + 0x28);
      *plVar1 = *plVar1 + 1;
      *(undefined8 *)(param_1 + 2) = *(undefined8 *)(param_2 + 2);
    }
  }
  return param_1;
}



void FUN_140185630(undefined4 *param_1,longlong *param_2)

{
  longlong *plVar1;
  
  if (*param_2 == *(longlong *)(param_1 + 2)) {
    param_1[7] = *(undefined4 *)((longlong)param_2 + 0x14);
    *(longlong *)(param_1 + 4) = param_2[1];
    param_1[6] = (int)param_2[2];
  }
  else {
    FUN_14019a730(param_1 + 2);
    if (*param_2 != 0) {
      plVar1 = (longlong *)(*param_2 + 0x28);
      *plVar1 = *plVar1 + 1;
      *(longlong *)(param_1 + 2) = *param_2;
    }
  }
  *param_1 = 0;
  FUN_14019a730(param_2);
  if (param_2[1] != 0) {
    if (*(int *)((longlong)param_2 + 0x14) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(param_2 + 2) = 0;
  }
  return;
}



void FUN_1401856c0(int *param_1,undefined8 param_2)

{
  longlong lVar1;
  int iVar2;
  
  iVar2 = (int)param_2;
  if (iVar2 * 8 < *param_1) {
    *param_1 = iVar2 * 8;
  }
  if (-1 < iVar2) {
    if (*(longlong *)(param_1 + 4) != 0) {
      if (param_1[7] < iVar2) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      param_1[6] = iVar2;
      return;
    }
    lVar1 = *(longlong *)(param_1 + 2);
    if (iVar2 < 1) {
      if (lVar1 == 0) {
        return;
      }
      param_2 = 0;
    }
    else if (lVar1 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    FUN_14003cda0(lVar1,param_2);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



longlong FUN_140185720(int *param_1,int param_2)

{
  longlong lVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  undefined1 local_58 [80];
  
  FUN_140185400();
  lVar1 = *(longlong *)(param_1 + 2);
  if ((lVar1 == 0) && (*(longlong *)(param_1 + 4) == 0)) {
    FUN_1400a2320(local_58,&DAT_140258500);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar3 = *param_1;
  if (lVar1 == 0) {
    if (*(longlong *)(param_1 + 4) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar4 = param_1[6];
  }
  else {
    iVar4 = *(int *)(lVar1 + 0x18);
  }
  iVar2 = ((int)(iVar3 + (iVar3 >> 0x1f & 7U)) >> 3) + param_2;
  if (iVar4 < iVar2) {
    return (ulonglong)(uint3)((uint)iVar2 >> 8) << 8;
  }
  iVar3 = iVar3 + param_2 * 8;
  *param_1 = iVar3;
  return CONCAT71((uint7)(uint3)((uint)iVar3 >> 8),1);
}



undefined8 FUN_1401857c0(int *param_1,int *param_2,int param_3)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  undefined1 local_58 [80];
  
  lVar2 = *(longlong *)(param_1 + 2);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 4) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar3 = param_1[6];
  }
  else {
    iVar3 = *(int *)(lVar2 + 0x18);
  }
  iVar1 = (int)(*param_1 + (*param_1 >> 0x1f & 7U)) >> 3;
  if (iVar3 < iVar1 + param_3) {
    return 0;
  }
  if (*(longlong *)(param_1 + 4) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    if (*(int *)(lVar2 + 0x18) == 0) {
      lVar2 = 0;
    }
    else {
      lVar2 = *(longlong *)(lVar2 + 0x10);
    }
  }
  else {
    lVar2 = *(longlong *)(param_1 + 4);
    if (lVar2 == 0) {
      FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
  }
  if (DAT_1402f8140 < param_3) {
    FUN_1400a2320(local_58,L"UseExternalBuffer failed due to too large capacity");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  FUN_1401850e0(param_2 + 2,iVar1 + lVar2,param_3);
  if (param_3 * 8 < *param_2) {
    *param_2 = param_3 * 8;
  }
  if (param_3 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (*(longlong *)(param_2 + 4) == 0) {
    lVar2 = *(longlong *)(param_2 + 2);
    if (param_3 < 1) {
      if (lVar2 == 0) goto LAB_140185903;
      iVar3 = 0;
    }
    else {
      iVar3 = param_3;
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
    }
    FUN_14003cda0(lVar2,iVar3);
  }
  else {
    if (param_2[7] < param_3) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    param_2[6] = param_3;
  }
LAB_140185903:
  FUN_140185720(param_1,param_3);
  return 1;
}



void FUN_140185940(longlong param_1,longlong param_2)

{
  int iVar1;
  int iVar2;
  undefined8 uVar3;
  int iVar4;
  longlong lVar5;
  longlong lVar6;
  int iVar7;
  longlong lVar8;
  undefined1 local_b8 [72];
  undefined1 local_70 [72];
  
  lVar5 = *(longlong *)(param_2 + 0xc80);
  iVar7 = 0;
  lVar8 = 0;
  if (lVar5 != 0) {
    lVar6 = 0;
    do {
      if (*(int *)(param_2 + 0xc88) <= iVar7) {
        return;
      }
      if (lVar5 == 0) {
        FUN_1400a2320(local_b8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_b8,(ThrowInfo *)&DAT_1402f4860);
      }
      if (lVar8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      uVar3 = *(undefined8 *)(lVar5 + lVar6);
      iVar1 = *(int *)(lVar5 + 8 + lVar6);
      if (*(longlong *)(param_1 + 0x10) == 0) {
        lVar5 = *(longlong *)(param_1 + 8);
        if (lVar5 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        if (iVar1 != 0) {
          iVar2 = *(int *)(lVar5 + 0x18);
          FUN_14003cda0(lVar5,iVar2 + iVar1);
          if (*(int *)(lVar5 + 0x18) == 0) {
            lVar5 = 0;
          }
          else {
            lVar5 = *(longlong *)(lVar5 + 0x10);
          }
          lVar5 = lVar5 + iVar2;
          goto LAB_140185a2f;
        }
      }
      else {
        if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        if (iVar1 != 0) {
          if (*(longlong *)(param_1 + 0x10) == 0) {
            FUN_1400a2320(local_70,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
            _CxxThrowException(local_70,(ThrowInfo *)&DAT_1402f4860);
          }
          iVar2 = *(int *)(param_1 + 0x18);
          iVar4 = iVar2 + iVar1;
          if ((iVar4 < 0) || (*(int *)(param_1 + 0x1c) < iVar4)) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          *(int *)(param_1 + 0x18) = iVar4;
          lVar5 = (longlong)iVar2 + *(longlong *)(param_1 + 0x10);
LAB_140185a2f:
          FUN_1400224d0(lVar5,uVar3,(longlong)iVar1);
        }
      }
      lVar5 = *(longlong *)(param_2 + 0xc80);
      iVar7 = iVar7 + 1;
      lVar8 = lVar8 + 1;
      lVar6 = lVar6 + 0x10;
    } while (lVar5 != 0);
  }
  FUN_1400a2320(local_b8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_b8,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_140185b00(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_14003cc90(param_1 + 0x10);
    return;
  }
  if (*(longlong *)(param_1 + 8) != 0) {
    FUN_14003ce60();
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14019a830();
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140185b30(int *param_1,undefined8 *param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined1 auStack_158 [32];
  undefined1 local_138 [144];
  undefined1 local_a8 [120];
  undefined8 local_30;
  int local_28;
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_158;
  lVar5 = *(longlong *)(param_1 + 2);
  if (lVar5 == 0) {
    if (*(longlong *)(param_1 + 4) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = param_1[6];
  }
  else {
    iVar1 = *(int *)(lVar5 + 0x18);
  }
  iVar2 = (int)(*param_1 + (*param_1 >> 0x1f & 7U)) >> 3;
  if (*(longlong *)(param_1 + 4) == 0) {
    if (lVar5 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    if (*(int *)(lVar5 + 0x18) == 0) {
      lVar5 = 0;
    }
    else {
      lVar5 = *(longlong *)(lVar5 + 0x10);
    }
  }
  else {
    lVar5 = *(longlong *)(param_1 + 4);
    if (lVar5 == 0) {
      FUN_1400a2320(local_138,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_138,(ThrowInfo *)&DAT_1402f4860);
    }
  }
  uVar4 = FUN_1401bf010(local_a8,iVar2 + lVar5,iVar1 - iVar2);
  if ((char)uVar4 != '\0') {
    *param_2 = local_30;
    FUN_140185400(param_1);
    lVar5 = *(longlong *)(param_1 + 2);
    if ((lVar5 == 0) && (*(longlong *)(param_1 + 4) == 0)) {
      FUN_1400a2320(local_138,&DAT_140258500);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_138,(ThrowInfo *)&DAT_1402f4860);
    }
    iVar1 = *param_1;
    if (lVar5 == 0) {
      if (*(longlong *)(param_1 + 4) == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      iVar2 = param_1[6];
    }
    else {
      iVar2 = *(int *)(lVar5 + 0x18);
    }
    iVar3 = ((int)(iVar1 + (iVar1 >> 0x1f & 7U)) >> 3) + local_28;
    if (iVar3 <= iVar2) {
      iVar3 = iVar1 + local_28 * 8;
      *param_1 = iVar3;
    }
    uVar4 = CONCAT71((uint7)(uint3)((uint)iVar3 >> 8),1);
  }
  return uVar4;
}



void FUN_140185ca0(undefined8 *param_1)

{
  FUN_14000c510(*param_1);
  return;
}



void FUN_140185cb0(undefined8 *param_1)

{
  FUN_140003000(*param_1);
  return;
}



undefined8 FUN_140185cc0(uint *param_1,uint *param_2)

{
  char cVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  byte local_res8 [8];
  
  *param_2 = 6;
  uVar3 = (int)*param_1 >> 0x1f & 7;
  uVar2 = *param_1 + uVar3;
  uVar4 = uVar2 & 0xfffffff8;
  *param_1 = uVar4;
  if (0 < (int)((uVar2 & 7) - uVar3)) {
    *param_1 = uVar4 + 8;
  }
  cVar1 = FUN_140185220(param_1,local_res8,1);
  if (cVar1 != '\0') {
    FUN_140185400(param_1);
    *param_2 = (uint)local_res8[0];
    return 1;
  }
  return 0;
}



undefined8 FUN_140185d40(uint *param_1,uint *param_2)

{
  char cVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  byte local_res8 [8];
  
  *param_2 = 2;
  uVar3 = (int)*param_1 >> 0x1f & 7;
  uVar2 = *param_1 + uVar3;
  uVar4 = uVar2 & 0xfffffff8;
  *param_1 = uVar4;
  if (0 < (int)((uVar2 & 7) - uVar3)) {
    *param_1 = uVar4 + 8;
  }
  cVar1 = FUN_140185220(param_1,local_res8,1);
  if (cVar1 != '\0') {
    FUN_140185400(param_1);
    *param_2 = (uint)local_res8[0];
    return 1;
  }
  return 0;
}



undefined8 FUN_140185dc0(uint *param_1,uint *param_2)

{
  char cVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  byte local_res8 [8];
  
  *param_2 = 0;
  uVar3 = (int)*param_1 >> 0x1f & 7;
  uVar2 = *param_1 + uVar3;
  uVar4 = uVar2 & 0xfffffff8;
  *param_1 = uVar4;
  if (0 < (int)((uVar2 & 7) - uVar3)) {
    *param_1 = uVar4 + 8;
  }
  cVar1 = FUN_140185220(param_1,local_res8,1);
  if (cVar1 != '\0') {
    FUN_140185400(param_1);
    *param_2 = (uint)local_res8[0];
    return 1;
  }
  return 0;
}



undefined8 FUN_140185e40(uint *param_1,uint *param_2)

{
  char cVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  ushort local_res8 [4];
  
  *param_2 = 0;
  uVar3 = (int)*param_1 >> 0x1f & 7;
  uVar2 = *param_1 + uVar3;
  uVar4 = uVar2 & 0xfffffff8;
  *param_1 = uVar4;
  if (0 < (int)((uVar2 & 7) - uVar3)) {
    *param_1 = uVar4 + 8;
  }
  cVar1 = FUN_140185220(param_1,local_res8,2);
  if (cVar1 != '\0') {
    FUN_140185400(param_1);
    *param_2 = (uint)local_res8[0];
    return 1;
  }
  return 0;
}



ulonglong FUN_140185ec0(undefined8 param_1,longlong param_2)

{
  ulonglong uVar1;
  
  *(undefined4 *)(param_2 + 8) = DAT_1402f83d0;
  *(undefined2 *)(param_2 + 0xc) = DAT_1402f83d4;
  uVar1 = FUN_14003c6f0();
  if ((char)uVar1 == '\x01') {
    uVar1 = FUN_14003c670(param_1,(undefined2 *)(param_2 + 0xc));
    if ((char)uVar1 == '\x01') {
      return uVar1;
    }
  }
  return uVar1 & 0xffffffffffffff00;
}



undefined8 FUN_140185f20(uint *param_1,undefined4 *param_2)

{
  char cVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  undefined4 local_res8 [2];
  
  *param_2 = 0;
  uVar3 = (int)*param_1 >> 0x1f & 7;
  uVar2 = *param_1 + uVar3;
  uVar4 = uVar2 & 0xfffffff8;
  *param_1 = uVar4;
  if (0 < (int)((uVar2 & 7) - uVar3)) {
    *param_1 = uVar4 + 8;
  }
  cVar1 = FUN_140185220(param_1,local_res8,4);
  if (cVar1 != '\0') {
    FUN_140185400(param_1);
    *param_2 = local_res8[0];
    return 1;
  }
  return 0;
}



undefined1 FUN_140185fa0(undefined8 param_1,longlong param_2)

{
  char cVar1;
  
  cVar1 = FUN_140185dc0();
  if (cVar1 != '\0') {
    cVar1 = FUN_14003c6f0(param_1,param_2 + 4);
    if (cVar1 != '\0') {
      cVar1 = FUN_14007c3b0(param_1,param_2 + 8);
      if (cVar1 != '\0') {
        cVar1 = FUN_140185d40(param_1,param_2 + 0x10);
        if (cVar1 != '\0') {
          cVar1 = FUN_14003c6f0(param_1,param_2 + 0x14);
          if (cVar1 != '\0') {
            cVar1 = FUN_14003c6b0(param_1,param_2 + 0x18);
            if (cVar1 != '\0') {
              cVar1 = FUN_14003c6f0(param_1,param_2 + 0x1c);
              if (cVar1 != '\0') {
                cVar1 = FUN_14003c6f0(param_1,param_2 + 0x20);
                if (cVar1 != '\0') {
                  cVar1 = FUN_14003c6b0(param_1,param_2 + 0x24);
                  if (cVar1 != '\0') {
                    cVar1 = FUN_14003c6b0(param_1,param_2 + 0x25);
                    if (cVar1 != '\0') {
                      cVar1 = FUN_14003c6b0(param_1,param_2 + 0x26);
                      if (cVar1 != '\0') {
                        cVar1 = FUN_14003c6b0(param_1,param_2 + 0x27);
                        if (cVar1 != '\0') {
                          cVar1 = FUN_14003c6f0(param_1,param_2 + 0x28);
                          if (cVar1 != '\0') {
                            cVar1 = FUN_14003c6b0(param_1,param_2 + 0x2c);
                            if (cVar1 != '\0') {
                              cVar1 = FUN_14003c6b0(param_1,param_2 + 0x2d);
                              if (cVar1 != '\0') {
                                return 1;
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  return 0;
}



undefined1 FUN_1401860d0(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined1 uVar2;
  undefined8 uVar3;
  int iVar4;
  ulonglong local_res18 [2];
  
  cVar1 = FUN_140185b30(param_1,local_res18);
  if (cVar1 == '\0') {
    return 0;
  }
  iVar4 = (int)local_res18[0];
  if ((-1 < iVar4) && (iVar4 <= DAT_1402f8140)) {
    FUN_140195930(param_2,local_res18[0] & 0xffffffff);
    if (*(int *)(param_2 + 0x18) == 0) {
      uVar3 = 0;
    }
    else {
      uVar3 = *(undefined8 *)(param_2 + 0x10);
    }
    uVar2 = FUN_140185490(param_1,uVar3,iVar4 * 8);
    return uVar2;
  }
  return 0;
}



void FUN_140186160(undefined8 param_1,longlong param_2)

{
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 8));
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 0xc));
  return;
}



undefined1 thunk_FUN_1401860d0(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined1 uVar2;
  undefined8 uVar3;
  int iVar4;
  ulonglong auStackX_18 [2];
  
  cVar1 = FUN_140185b30(param_1,auStackX_18);
  if (cVar1 == '\0') {
    return 0;
  }
  iVar4 = (int)auStackX_18[0];
  if ((-1 < iVar4) && (iVar4 <= DAT_1402f8140)) {
    FUN_140195930(param_2,auStackX_18[0] & 0xffffffff);
    if (*(int *)(param_2 + 0x18) == 0) {
      uVar3 = 0;
    }
    else {
      uVar3 = *(undefined8 *)(param_2 + 0x10);
    }
    uVar2 = FUN_140185490(param_1,uVar3,iVar4 * 8);
    return uVar2;
  }
  return 0;
}



void FUN_1401861a0(undefined8 param_1,undefined1 *param_2)

{
  FUN_14003c9e0(param_1,*param_2);
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 4));
  FUN_14007c8a0(param_1,*(undefined8 *)(param_2 + 8));
  FUN_14003c9e0(param_1,param_2[0x10]);
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x14));
  FUN_14003c9e0(param_1,param_2[0x18]);
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x1c));
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x20));
  FUN_14003c9e0(param_1,param_2[0x24]);
  FUN_14003c9e0(param_1,param_2[0x25]);
  FUN_14003c9e0(param_1,param_2[0x26]);
  FUN_14003c9e0(param_1,param_2[0x27]);
  FUN_14007c6e0(param_1,*(undefined4 *)(param_2 + 0x28));
  FUN_14003c9e0(param_1,param_2[0x2c]);
  FUN_14003c9e0(param_1,param_2[0x2d]);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 FUN_140186270(uint *param_1,int *param_2)

{
  char cVar1;
  undefined1 uVar2;
  uint uVar3;
  int iVar4;
  int *piVar5;
  undefined8 uVar6;
  uint uVar7;
  uint uVar8;
  int *piVar9;
  int iVar10;
  int iVar11;
  undefined1 auStack_118 [32];
  char local_f8 [8];
  int *local_f0;
  undefined1 *local_e8;
  int **local_e0;
  int *local_d8;
  undefined8 local_d0;
  undefined1 *local_c8;
  undefined1 local_c0 [136];
  ulonglong local_38;
  
  local_d0 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_118;
  uVar8 = (int)*param_1 >> 0x1f & 7;
  uVar3 = *param_1 + uVar8;
  uVar7 = uVar3 & 0xfffffff8;
  *param_1 = uVar7;
  if (0 < (int)((uVar3 & 7) - uVar8)) {
    *param_1 = uVar7 + 8;
  }
  cVar1 = FUN_140185220(param_1,local_f8,1);
  if (cVar1 == '\0') {
    return 0;
  }
  FUN_140185400(param_1);
  cVar1 = FUN_140185b30(param_1,&local_f0);
  piVar5 = local_f0;
  if (cVar1 == '\0') {
    return 0;
  }
  iVar10 = (int)local_f0;
  if ((iVar10 < 0) || (0x100000 < iVar10)) {
    FUN_1400a2320(&local_c8,L"CMessage.ReadString failed! length=%d",
                  (ulonglong)local_f0 & 0xffffffff);
                    // WARNING: Subroutine does not return
    _CxxThrowException(&local_c8,(ThrowInfo *)&DAT_1402f4860);
  }
  if (local_f8[0] == '\x01') {
    local_f0 = param_2;
    local_e8 = (undefined1 *)FUN_14000c420(param_2,iVar10 + 1);
    *local_e8 = 0;
    local_e8[iVar10] = 0;
    uVar2 = FUN_140185490(param_1,local_e8,(ulonglong)piVar5 & 0xffffffff);
    FUN_14000c510(param_2);
    return uVar2;
  }
  FUN_1400a3440();
  local_f0 = (int *)PTR_DAT_1402f8010;
  iVar4 = iVar10 + 1;
  local_e0 = &local_f0;
  if (iVar4 < 1) {
    iVar4 = 0;
  }
  iVar11 = 1;
  if (1 < iVar4) {
    iVar11 = iVar4;
  }
  if (iVar11 < 1) goto LAB_140186433;
  local_f0 = (int *)PTR_DAT_1402f8010;
  if (iVar11 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (iVar11 == 0) {
    FUN_1400031d0(&local_f0);
    goto LAB_140186433;
  }
  piVar5 = (int *)FUN_1400a34c0((longlong)iVar11 * 2 + 10);
  if (piVar5 != (int *)0x0) {
    *piVar5 = 0;
    piVar5[1] = 1;
  }
  *piVar5 = iVar11;
  iVar4 = 0;
  if ((local_f0 != (int *)0x0) && (iVar4 = 0, local_f0 != (int *)PTR_DAT_1402f8010)) {
    iVar4 = local_f0[-2];
  }
  piVar9 = (int *)PTR_DAT_1402f8010;
  if (iVar11 < iVar4) {
LAB_14018640d:
    if (local_f0 != (int *)0x0) {
      piVar9 = local_f0;
    }
  }
  else {
    iVar11 = 0;
    if (local_f0 != (int *)0x0) {
      if (local_f0 != (int *)PTR_DAT_1402f8010) {
        iVar11 = local_f0[-2];
      }
      goto LAB_14018640d;
    }
  }
  FUN_1400a32f0(piVar5 + 2,piVar9,iVar11);
  FUN_1400031d0(&local_f0);
  local_f0 = piVar5 + 2;
LAB_140186433:
  FUN_140002e30(&local_f0);
  local_d8 = local_f0;
  if (local_f0 == (int *)0x0) {
    local_d8 = (int *)PTR_DAT_1402f8010;
  }
  *(undefined2 *)local_d8 = 0;
  *(undefined2 *)((longlong)local_d8 + (longlong)iVar10 * 2) = 0;
  cVar1 = FUN_140185490(param_1,local_d8,iVar10 * 2);
  if (cVar1 == '\0') {
    FUN_140003000(&local_f0);
    piVar5 = local_f0;
    if (((local_f0 != (int *)0x0) && (local_f0 != (int *)PTR_DAT_1402f8010)) &&
       (piVar9 = local_f0 + -2, piVar9 != (int *)0x0)) {
      uVar6 = FUN_1400a3440();
      local_e0 = (int **)uVar6;
      FUN_1400a1c30(uVar6);
      local_d8 = (int *)CONCAT71(local_d8._1_7_,1);
      piVar5 = piVar5 + -1;
      *piVar5 = *piVar5 + -1;
      if (*piVar5 == 0) {
        FUN_1400a3530(piVar9);
      }
      FUN_1400d1290(uVar6);
    }
    return 0;
  }
  FUN_140003000(&local_f0);
  piVar5 = local_f0;
  if (local_f0 == (int *)0x0) {
    piVar5 = (int *)PTR_DAT_1402f8010;
  }
  local_c8 = local_c0;
  FUN_1400a1e40(&local_c8,piVar5,3);
  FUN_1400a2120(param_2,local_c8);
  if (local_c8 != local_c0) {
    free(local_c8);
  }
  piVar5 = local_f0;
  if (((local_f0 != (int *)0x0) && (local_f0 != (int *)PTR_DAT_1402f8010)) &&
     (piVar9 = local_f0 + -2, piVar9 != (int *)0x0)) {
    uVar6 = FUN_1400a3440();
    local_e0 = (int **)uVar6;
    FUN_1400a1c30(uVar6);
    local_d8 = (int *)CONCAT71(local_d8._1_7_,1);
    piVar5 = piVar5 + -1;
    *piVar5 = *piVar5 + -1;
    if (*piVar5 == 0) {
      FUN_1400a3530(piVar9);
    }
    FUN_1400d1290(uVar6);
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 FUN_1401865d0(uint *param_1,int *param_2)

{
  char cVar1;
  undefined1 uVar2;
  uint uVar3;
  int iVar4;
  int *piVar5;
  undefined8 uVar6;
  uint uVar7;
  uint uVar8;
  int *piVar9;
  int *piVar10;
  int iVar11;
  int iVar12;
  undefined1 auStack_1e8 [32];
  char local_1c8 [8];
  int *local_1c0;
  undefined2 *local_1b8;
  int **local_1b0;
  int *local_1a8;
  undefined8 local_1a0;
  undefined1 local_198 [80];
  undefined1 *local_148;
  undefined1 local_140 [264];
  ulonglong local_38;
  
  local_1a0 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_1e8;
  uVar8 = (int)*param_1 >> 0x1f & 7;
  uVar3 = *param_1 + uVar8;
  uVar7 = uVar3 & 0xfffffff8;
  *param_1 = uVar7;
  if (0 < (int)((uVar3 & 7) - uVar8)) {
    *param_1 = uVar7 + 8;
  }
  cVar1 = FUN_140185220(param_1,local_1c8,1);
  if (cVar1 == '\0') {
    return 0;
  }
  FUN_140185400(param_1);
  cVar1 = FUN_140185b30(param_1,&local_1c0);
  piVar10 = local_1c0;
  if (cVar1 == '\0') {
    return 0;
  }
  iVar11 = (int)local_1c0;
  if ((iVar11 < 0) || (0x100000 < iVar11)) {
    FUN_1400a2320(local_198,L"CMessage.ReadString failed! length=%d",
                  (ulonglong)local_1c0 & 0xffffffff);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_198,(ThrowInfo *)&DAT_1402f4860);
  }
  if (local_1c8[0] == '\x02') {
    local_1c0 = param_2;
    local_1b8 = (undefined2 *)FUN_140002f20(param_2,iVar11 + 1);
    *local_1b8 = 0;
    local_1b8[iVar11] = 0;
    uVar2 = FUN_140185490(param_1,local_1b8,iVar11 * 2);
    FUN_140003000(param_2);
    return uVar2;
  }
  FUN_1400a3440();
  local_1c0 = (int *)PTR_DAT_1402f8008;
  iVar4 = iVar11 + 1;
  local_1b0 = &local_1c0;
  if (iVar4 < 1) {
    iVar4 = 0;
  }
  iVar12 = 1;
  if (1 < iVar4) {
    iVar12 = iVar4;
  }
  if (iVar12 < 1) goto LAB_140186796;
  local_1c0 = (int *)PTR_DAT_1402f8008;
  if (iVar12 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (iVar12 == 0) {
    FUN_14000c2a0(&local_1c0);
    goto LAB_140186796;
  }
  piVar5 = (int *)FUN_1400a34c0((longlong)iVar12 + 9);
  if (piVar5 != (int *)0x0) {
    *piVar5 = 0;
    piVar5[1] = 1;
  }
  *piVar5 = iVar12;
  iVar4 = 0;
  if ((local_1c0 != (int *)0x0) && (iVar4 = 0, local_1c0 != (int *)PTR_DAT_1402f8008)) {
    iVar4 = local_1c0[-2];
  }
  piVar9 = (int *)PTR_DAT_1402f8008;
  if (iVar12 < iVar4) {
LAB_140186770:
    if (local_1c0 != (int *)0x0) {
      piVar9 = local_1c0;
    }
  }
  else {
    iVar12 = 0;
    if (local_1c0 != (int *)0x0) {
      if (local_1c0 != (int *)PTR_DAT_1402f8008) {
        iVar12 = local_1c0[-2];
      }
      goto LAB_140186770;
    }
  }
  FUN_1400a3390(piVar5 + 2,piVar9,iVar12);
  FUN_14000c2a0(&local_1c0);
  local_1c0 = piVar5 + 2;
LAB_140186796:
  FUN_14000c330(&local_1c0);
  local_1a8 = local_1c0;
  if (local_1c0 == (int *)0x0) {
    local_1a8 = (int *)PTR_DAT_1402f8008;
  }
  *(undefined1 *)local_1a8 = 0;
  *(undefined1 *)((longlong)iVar11 + (longlong)local_1a8) = 0;
  cVar1 = FUN_140185490(param_1,local_1a8,(ulonglong)piVar10 & 0xffffffff);
  if (cVar1 == '\0') {
    FUN_14000c510(&local_1c0);
    piVar10 = local_1c0;
    if (((local_1c0 != (int *)0x0) && (local_1c0 != (int *)PTR_DAT_1402f8008)) &&
       (piVar5 = local_1c0 + -2, piVar5 != (int *)0x0)) {
      uVar6 = FUN_1400a3440();
      local_1b0 = (int **)uVar6;
      FUN_1400a1c30(uVar6);
      local_1a8 = (int *)CONCAT71(local_1a8._1_7_,1);
      piVar10 = piVar10 + -1;
      *piVar10 = *piVar10 + -1;
      if (*piVar10 == 0) {
        FUN_1400a3530(piVar5);
      }
      FUN_1400d1290(uVar6);
    }
    return 0;
  }
  FUN_14000c510(&local_1c0);
  piVar10 = local_1c0;
  if (local_1c0 == (int *)0x0) {
    piVar10 = (int *)PTR_DAT_1402f8008;
  }
  local_148 = local_140;
  FUN_14008a6c0(&local_148,piVar10,3);
  FUN_14001f680(param_2,local_148);
  if (local_148 != local_140) {
    free(local_148);
  }
  piVar10 = local_1c0;
  if (((local_1c0 != (int *)0x0) && (local_1c0 != (int *)PTR_DAT_1402f8008)) &&
     (piVar5 = local_1c0 + -2, piVar5 != (int *)0x0)) {
    uVar6 = FUN_1400a3440();
    local_1b0 = (int **)uVar6;
    FUN_1400a1c30(uVar6);
    local_1a8 = (int *)CONCAT71(local_1a8._1_7_,1);
    piVar10 = piVar10 + -1;
    *piVar10 = *piVar10 + -1;
    if (*piVar10 == 0) {
      FUN_1400a3530(piVar5);
    }
    FUN_1400d1290(uVar6);
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140186930(longlong param_1)

{
  undefined1 uVar1;
  int iVar2;
  longlong lVar3;
  undefined8 uVar4;
  int iVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  ulonglong uVar8;
  longlong lVar9;
  ulonglong uVar10;
  undefined8 *_Dst;
  undefined1 auStack_128 [32];
  undefined1 local_108 [80];
  undefined1 local_b8 [12];
  undefined8 local_ac [12];
  uint local_48;
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_128;
  FUN_1401bef80(local_b8);
  uVar10 = (ulonglong)(int)local_48;
  if (local_48 == 0) {
    return;
  }
  lVar9 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  lVar3 = *(longlong *)(param_1 + 8);
  if (lVar3 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
LAB_14018699d:
    if ((int)local_48 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (*(longlong *)(param_1 + 0x10) == 0) {
      FUN_1400a2320(local_108,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_108,(ThrowInfo *)&DAT_1402f4860);
    }
    iVar2 = *(int *)(param_1 + 0x18);
    iVar5 = iVar2 + local_48;
    if ((iVar5 < 0) || (*(int *)(param_1 + 0x1c) < iVar5)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(int *)(param_1 + 0x18) = iVar5;
    _Dst = (undefined8 *)(*(longlong *)(param_1 + 0x10) + (longlong)iVar2);
    if (uVar10 < 0x21) {
      puVar6 = local_ac;
      uVar8 = (ulonglong)(local_48 & 7);
      for (uVar10 = uVar10 >> 3; uVar10 != 0; uVar10 = uVar10 - 1) {
        uVar4 = *puVar6;
        puVar6 = puVar6 + 1;
        *_Dst = uVar4;
        _Dst = _Dst + 1;
      }
      if (uVar8 != 0) {
        puVar7 = puVar6;
        do {
          uVar1 = *(undefined1 *)puVar7;
          puVar7 = (undefined8 *)((longlong)puVar7 + 1);
          uVar8 = uVar8 - 1;
          *(undefined1 *)((longlong)_Dst + (-1 - (longlong)puVar6) + (longlong)puVar7) = uVar1;
        } while (uVar8 != 0);
      }
      goto LAB_140186aef;
    }
  }
  else {
    if (*(longlong *)(param_1 + 0x10) != 0) goto LAB_14018699d;
    if (lVar3 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    if ((int)local_48 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    iVar2 = *(int *)(lVar3 + 0x18);
    FUN_14003cda0(lVar3,iVar2 + local_48);
    if (*(int *)(lVar3 + 0x18) != 0) {
      lVar9 = *(longlong *)(lVar3 + 0x10);
    }
    _Dst = (undefined8 *)(lVar9 + iVar2);
    if (uVar10 < 0x21) {
      puVar6 = local_ac;
      uVar8 = (ulonglong)(local_48 & 7);
      for (uVar10 = uVar10 >> 3; uVar10 != 0; uVar10 = uVar10 - 1) {
        uVar4 = *puVar6;
        puVar6 = puVar6 + 1;
        *_Dst = uVar4;
        _Dst = _Dst + 1;
      }
      if (uVar8 != 0) {
        puVar7 = puVar6;
        do {
          uVar1 = *(undefined1 *)puVar7;
          puVar7 = (undefined8 *)((longlong)puVar7 + 1);
          uVar8 = uVar8 - 1;
          *(undefined1 *)((longlong)_Dst + (-1 - (longlong)puVar6) + (longlong)puVar7) = uVar1;
        } while (uVar8 != 0);
      }
      goto LAB_140186aef;
    }
  }
  memcpy(_Dst,local_ac,uVar10);
LAB_140186aef:
  FUN_14003ced0(param_1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 thunk_FUN_140186270(uint *param_1,int *param_2)

{
  char cVar1;
  undefined1 uVar2;
  uint uVar3;
  int iVar4;
  int *piVar5;
  undefined8 uVar6;
  uint uVar7;
  uint uVar8;
  int *piVar9;
  int iVar10;
  int iVar11;
  undefined1 auStack_118 [32];
  char acStack_f8 [8];
  int *piStack_f0;
  undefined1 *puStack_e8;
  int **ppiStack_e0;
  int *piStack_d8;
  undefined8 uStack_d0;
  undefined1 *puStack_c8;
  undefined1 auStack_c0 [136];
  ulonglong uStack_38;
  
  uStack_d0 = 0xfffffffffffffffe;
  uStack_38 = DAT_1402f85a0 ^ (ulonglong)auStack_118;
  uVar8 = (int)*param_1 >> 0x1f & 7;
  uVar3 = *param_1 + uVar8;
  uVar7 = uVar3 & 0xfffffff8;
  *param_1 = uVar7;
  if (0 < (int)((uVar3 & 7) - uVar8)) {
    *param_1 = uVar7 + 8;
  }
  cVar1 = FUN_140185220(param_1,acStack_f8,1);
  if (cVar1 == '\0') {
    return 0;
  }
  FUN_140185400(param_1);
  cVar1 = FUN_140185b30(param_1,&piStack_f0);
  piVar5 = piStack_f0;
  if (cVar1 == '\0') {
    return 0;
  }
  iVar10 = (int)piStack_f0;
  if ((iVar10 < 0) || (0x100000 < iVar10)) {
    FUN_1400a2320(&puStack_c8,L"CMessage.ReadString failed! length=%d",
                  (ulonglong)piStack_f0 & 0xffffffff);
                    // WARNING: Subroutine does not return
    _CxxThrowException(&puStack_c8,(ThrowInfo *)&DAT_1402f4860);
  }
  if (acStack_f8[0] == '\x01') {
    piStack_f0 = param_2;
    puStack_e8 = (undefined1 *)FUN_14000c420(param_2,iVar10 + 1);
    *puStack_e8 = 0;
    puStack_e8[iVar10] = 0;
    uVar2 = FUN_140185490(param_1,puStack_e8,(ulonglong)piVar5 & 0xffffffff);
    FUN_14000c510(param_2);
    return uVar2;
  }
  FUN_1400a3440();
  piStack_f0 = (int *)PTR_DAT_1402f8010;
  iVar4 = iVar10 + 1;
  ppiStack_e0 = &piStack_f0;
  if (iVar4 < 1) {
    iVar4 = 0;
  }
  iVar11 = 1;
  if (1 < iVar4) {
    iVar11 = iVar4;
  }
  if (iVar11 < 1) goto LAB_140186433;
  piStack_f0 = (int *)PTR_DAT_1402f8010;
  if (iVar11 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (iVar11 == 0) {
    FUN_1400031d0(&piStack_f0);
    goto LAB_140186433;
  }
  piVar5 = (int *)FUN_1400a34c0((longlong)iVar11 * 2 + 10);
  if (piVar5 != (int *)0x0) {
    *piVar5 = 0;
    piVar5[1] = 1;
  }
  *piVar5 = iVar11;
  iVar4 = 0;
  if ((piStack_f0 != (int *)0x0) && (iVar4 = 0, piStack_f0 != (int *)PTR_DAT_1402f8010)) {
    iVar4 = piStack_f0[-2];
  }
  piVar9 = (int *)PTR_DAT_1402f8010;
  if (iVar11 < iVar4) {
LAB_14018640d:
    if (piStack_f0 != (int *)0x0) {
      piVar9 = piStack_f0;
    }
  }
  else {
    iVar11 = 0;
    if (piStack_f0 != (int *)0x0) {
      if (piStack_f0 != (int *)PTR_DAT_1402f8010) {
        iVar11 = piStack_f0[-2];
      }
      goto LAB_14018640d;
    }
  }
  FUN_1400a32f0(piVar5 + 2,piVar9,iVar11);
  FUN_1400031d0(&piStack_f0);
  piStack_f0 = piVar5 + 2;
LAB_140186433:
  FUN_140002e30(&piStack_f0);
  piStack_d8 = piStack_f0;
  if (piStack_f0 == (int *)0x0) {
    piStack_d8 = (int *)PTR_DAT_1402f8010;
  }
  *(undefined2 *)piStack_d8 = 0;
  *(undefined2 *)((longlong)piStack_d8 + (longlong)iVar10 * 2) = 0;
  cVar1 = FUN_140185490(param_1,piStack_d8,iVar10 * 2);
  if (cVar1 == '\0') {
    FUN_140003000(&piStack_f0);
    piVar5 = piStack_f0;
    if (((piStack_f0 != (int *)0x0) && (piStack_f0 != (int *)PTR_DAT_1402f8010)) &&
       (piVar9 = piStack_f0 + -2, piVar9 != (int *)0x0)) {
      uVar6 = FUN_1400a3440();
      ppiStack_e0 = (int **)uVar6;
      FUN_1400a1c30(uVar6);
      piStack_d8 = (int *)CONCAT71(piStack_d8._1_7_,1);
      piVar5 = piVar5 + -1;
      *piVar5 = *piVar5 + -1;
      if (*piVar5 == 0) {
        FUN_1400a3530(piVar9);
      }
      FUN_1400d1290(uVar6);
    }
    return 0;
  }
  FUN_140003000(&piStack_f0);
  piVar5 = piStack_f0;
  if (piStack_f0 == (int *)0x0) {
    piVar5 = (int *)PTR_DAT_1402f8010;
  }
  puStack_c8 = auStack_c0;
  FUN_1400a1e40(&puStack_c8,piVar5,3);
  FUN_1400a2120(param_2,puStack_c8);
  if (puStack_c8 != auStack_c0) {
    free(puStack_c8);
  }
  piVar5 = piStack_f0;
  if (((piStack_f0 != (int *)0x0) && (piStack_f0 != (int *)PTR_DAT_1402f8010)) &&
     (piVar9 = piStack_f0 + -2, piVar9 != (int *)0x0)) {
    uVar6 = FUN_1400a3440();
    ppiStack_e0 = (int **)uVar6;
    FUN_1400a1c30(uVar6);
    piStack_d8 = (int *)CONCAT71(piStack_d8._1_7_,1);
    piVar5 = piVar5 + -1;
    *piVar5 = *piVar5 + -1;
    if (*piVar5 == 0) {
      FUN_1400a3530(piVar9);
    }
    FUN_1400d1290(uVar6);
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 thunk_FUN_1401865d0(uint *param_1,int *param_2)

{
  char cVar1;
  undefined1 uVar2;
  uint uVar3;
  int iVar4;
  int *piVar5;
  undefined8 uVar6;
  uint uVar7;
  uint uVar8;
  int *piVar9;
  int *piVar10;
  int iVar11;
  int iVar12;
  undefined1 auStack_1e8 [32];
  char acStack_1c8 [8];
  int *piStack_1c0;
  undefined2 *puStack_1b8;
  int **ppiStack_1b0;
  int *piStack_1a8;
  undefined8 uStack_1a0;
  undefined1 auStack_198 [80];
  undefined1 *puStack_148;
  undefined1 auStack_140 [264];
  ulonglong uStack_38;
  
  uStack_1a0 = 0xfffffffffffffffe;
  uStack_38 = DAT_1402f85a0 ^ (ulonglong)auStack_1e8;
  uVar8 = (int)*param_1 >> 0x1f & 7;
  uVar3 = *param_1 + uVar8;
  uVar7 = uVar3 & 0xfffffff8;
  *param_1 = uVar7;
  if (0 < (int)((uVar3 & 7) - uVar8)) {
    *param_1 = uVar7 + 8;
  }
  cVar1 = FUN_140185220(param_1,acStack_1c8,1);
  if (cVar1 == '\0') {
    return 0;
  }
  FUN_140185400(param_1);
  cVar1 = FUN_140185b30(param_1,&piStack_1c0);
  piVar10 = piStack_1c0;
  if (cVar1 == '\0') {
    return 0;
  }
  iVar11 = (int)piStack_1c0;
  if ((iVar11 < 0) || (0x100000 < iVar11)) {
    FUN_1400a2320(auStack_198,L"CMessage.ReadString failed! length=%d",
                  (ulonglong)piStack_1c0 & 0xffffffff);
                    // WARNING: Subroutine does not return
    _CxxThrowException(auStack_198,(ThrowInfo *)&DAT_1402f4860);
  }
  if (acStack_1c8[0] == '\x02') {
    piStack_1c0 = param_2;
    puStack_1b8 = (undefined2 *)FUN_140002f20(param_2,iVar11 + 1);
    *puStack_1b8 = 0;
    puStack_1b8[iVar11] = 0;
    uVar2 = FUN_140185490(param_1,puStack_1b8,iVar11 * 2);
    FUN_140003000(param_2);
    return uVar2;
  }
  FUN_1400a3440();
  piStack_1c0 = (int *)PTR_DAT_1402f8008;
  iVar4 = iVar11 + 1;
  ppiStack_1b0 = &piStack_1c0;
  if (iVar4 < 1) {
    iVar4 = 0;
  }
  iVar12 = 1;
  if (1 < iVar4) {
    iVar12 = iVar4;
  }
  if (iVar12 < 1) goto LAB_140186796;
  piStack_1c0 = (int *)PTR_DAT_1402f8008;
  if (iVar12 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (iVar12 == 0) {
    FUN_14000c2a0(&piStack_1c0);
    goto LAB_140186796;
  }
  piVar5 = (int *)FUN_1400a34c0((longlong)iVar12 + 9);
  if (piVar5 != (int *)0x0) {
    *piVar5 = 0;
    piVar5[1] = 1;
  }
  *piVar5 = iVar12;
  iVar4 = 0;
  if ((piStack_1c0 != (int *)0x0) && (iVar4 = 0, piStack_1c0 != (int *)PTR_DAT_1402f8008)) {
    iVar4 = piStack_1c0[-2];
  }
  piVar9 = (int *)PTR_DAT_1402f8008;
  if (iVar12 < iVar4) {
LAB_140186770:
    if (piStack_1c0 != (int *)0x0) {
      piVar9 = piStack_1c0;
    }
  }
  else {
    iVar12 = 0;
    if (piStack_1c0 != (int *)0x0) {
      if (piStack_1c0 != (int *)PTR_DAT_1402f8008) {
        iVar12 = piStack_1c0[-2];
      }
      goto LAB_140186770;
    }
  }
  FUN_1400a3390(piVar5 + 2,piVar9,iVar12);
  FUN_14000c2a0(&piStack_1c0);
  piStack_1c0 = piVar5 + 2;
LAB_140186796:
  FUN_14000c330(&piStack_1c0);
  piStack_1a8 = piStack_1c0;
  if (piStack_1c0 == (int *)0x0) {
    piStack_1a8 = (int *)PTR_DAT_1402f8008;
  }
  *(undefined1 *)piStack_1a8 = 0;
  *(undefined1 *)((longlong)iVar11 + (longlong)piStack_1a8) = 0;
  cVar1 = FUN_140185490(param_1,piStack_1a8,(ulonglong)piVar10 & 0xffffffff);
  if (cVar1 == '\0') {
    FUN_14000c510(&piStack_1c0);
    piVar10 = piStack_1c0;
    if (((piStack_1c0 != (int *)0x0) && (piStack_1c0 != (int *)PTR_DAT_1402f8008)) &&
       (piVar5 = piStack_1c0 + -2, piVar5 != (int *)0x0)) {
      uVar6 = FUN_1400a3440();
      ppiStack_1b0 = (int **)uVar6;
      FUN_1400a1c30(uVar6);
      piStack_1a8 = (int *)CONCAT71(piStack_1a8._1_7_,1);
      piVar10 = piVar10 + -1;
      *piVar10 = *piVar10 + -1;
      if (*piVar10 == 0) {
        FUN_1400a3530(piVar5);
      }
      FUN_1400d1290(uVar6);
    }
    return 0;
  }
  FUN_14000c510(&piStack_1c0);
  piVar10 = piStack_1c0;
  if (piStack_1c0 == (int *)0x0) {
    piVar10 = (int *)PTR_DAT_1402f8008;
  }
  puStack_148 = auStack_140;
  FUN_14008a6c0(&puStack_148,piVar10,3);
  FUN_14001f680(param_2,puStack_148);
  if (puStack_148 != auStack_140) {
    free(puStack_148);
  }
  piVar10 = piStack_1c0;
  if (((piStack_1c0 != (int *)0x0) && (piStack_1c0 != (int *)PTR_DAT_1402f8008)) &&
     (piVar5 = piStack_1c0 + -2, piVar5 != (int *)0x0)) {
    uVar6 = FUN_1400a3440();
    ppiStack_1b0 = (int **)uVar6;
    FUN_1400a1c30(uVar6);
    piStack_1a8 = (int *)CONCAT71(piStack_1a8._1_7_,1);
    piVar10 = piVar10 + -1;
    *piVar10 = *piVar10 + -1;
    if (*piVar10 == 0) {
      FUN_1400a3530(piVar5);
    }
    FUN_1400d1290(uVar6);
  }
  return 1;
}



void FUN_140186b50(undefined8 param_1,undefined8 param_2,uint param_3)

{
  undefined1 local_58 [80];
  
  if (param_3 < 0x100001) {
    FUN_14003c9e0(param_1,1);
    FUN_140186930(param_1,(longlong)(int)param_3);
    FUN_14003cfb0(param_1,param_2,param_3);
    return;
  }
  FUN_1400a2320(local_58,L"CMessage.WriteString failed! length=%d",param_3);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_140186bd0(undefined8 param_1,undefined8 param_2,uint param_3)

{
  undefined1 local_58 [80];
  
  if (param_3 < 0x100001) {
    FUN_14003c9e0(param_1,2);
    FUN_140186930(param_1,(longlong)(int)param_3);
    FUN_14003cfb0(param_1,param_2,param_3 * 2);
    return;
  }
  FUN_1400a2320(local_58,L"CMessage.WriteString failed! length=%d",param_3);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_140186c50(undefined8 param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  
  iVar1 = *(int *)(param_2 + 0x18);
  FUN_140186930(param_1,(longlong)iVar1);
  if (*(int *)(param_2 + 0x18) == 0) {
    uVar2 = 0;
  }
  else {
    uVar2 = *(undefined8 *)(param_2 + 0x10);
  }
  FUN_14003cfb0(param_1,uVar2,iVar1 * 8);
  return;
}



undefined1 FUN_140186ca0(undefined8 param_1,longlong param_2)

{
  char cVar1;
  
  cVar1 = FUN_140186270();
  if (cVar1 != '\0') {
    cVar1 = FUN_14003c670(param_1,param_2 + 8);
    if (cVar1 != '\0') {
      return 1;
    }
  }
  return 0;
}



void FUN_140186cf0(undefined8 param_1,longlong *param_2)

{
  undefined *puVar1;
  undefined *puVar2;
  
  puVar1 = (undefined *)*param_2;
  if ((puVar1 != (undefined *)0x0) && (puVar1 != PTR_DAT_1402f8008)) {
    puVar2 = puVar1;
    if (puVar1 == (undefined *)0x0) {
      puVar2 = PTR_DAT_1402f8008;
    }
    FUN_140186b50(param_1,puVar2,*(undefined4 *)(puVar1 + -8));
    return;
  }
  if (puVar1 == (undefined *)0x0) {
    puVar1 = PTR_DAT_1402f8008;
  }
  FUN_140186b50(param_1,puVar1,0);
  return;
}



void FUN_140186d30(undefined8 param_1,char *param_2)

{
  char cVar1;
  ulonglong uVar2;
  char *pcVar3;
  undefined1 local_58 [80];
  
  uVar2 = 0xffffffffffffffff;
  pcVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    cVar1 = *pcVar3;
    pcVar3 = pcVar3 + 1;
  } while (cVar1 != '\0');
  uVar2 = ~uVar2 - 1;
  if (0x7fffffff < uVar2) {
    FUN_1400a2320(local_58,L"WriteString failed! length=%I64d",uVar2);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  FUN_140186b50(param_1,param_2,uVar2 & 0xffffffff);
  return;
}



void FUN_140186d90(undefined8 param_1,longlong *param_2)

{
  undefined *puVar1;
  undefined *puVar2;
  
  puVar1 = (undefined *)*param_2;
  if ((puVar1 != (undefined *)0x0) && (puVar1 != PTR_DAT_1402f8010)) {
    puVar2 = puVar1;
    if (puVar1 == (undefined *)0x0) {
      puVar2 = PTR_DAT_1402f8010;
    }
    FUN_140186bd0(param_1,puVar2,*(undefined4 *)(puVar1 + -8));
    return;
  }
  if (puVar1 == (undefined *)0x0) {
    puVar1 = PTR_DAT_1402f8010;
  }
  FUN_140186bd0(param_1,puVar1,0);
  return;
}



void FUN_140186dd0(undefined8 param_1,short *param_2)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  undefined1 local_58 [80];
  
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  uVar2 = ~uVar2 - 1;
  if (0x7fffffff < uVar2) {
    FUN_1400a2320(local_58,L"WriteString failed! length=%I64d",uVar2);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  FUN_140186bd0(param_1,param_2,uVar2 & 0xffffffff);
  return;
}



void FUN_140186e30(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  undefined4 uVar2;
  
  puVar1 = (undefined *)*param_2;
  if ((puVar1 == (undefined *)0x0) || (puVar1 == PTR_DAT_1402f8008)) {
    uVar2 = 0;
  }
  else {
    uVar2 = *(undefined4 *)(puVar1 + -8);
  }
  if (puVar1 == (undefined *)0x0) {
    puVar1 = PTR_DAT_1402f8008;
  }
  FUN_140186b50(param_1,puVar1,uVar2,param_4,0xfffffffffffffffe);
  FUN_14003d020(param_1,(short)param_2[1]);
  FUN_14000c2a0(param_2);
  return;
}



undefined8 * FUN_140186ea0(undefined8 *param_1)

{
  *(undefined4 *)((longlong)param_1 + 0x14) = 1;
  param_1[1] = 0;
  *param_1 = Proud::IRmiProxy::vftable;
  *(undefined1 *)(param_1 + 2) = 0;
  *(undefined1 *)(param_1 + 3) = 1;
  return param_1;
}



void FUN_140186ed0(undefined8 *param_1)

{
  *param_1 = Proud::IRmiProxy::vftable;
  if (param_1[1] != 0) {
    FUN_1400a2b50(
                 L"RMI Proxy which is still in use by ProudNet core cannot be destroyed! Destroy CNetClient or CNetServer instance first."
                 );
  }
  return;
}



undefined8 * FUN_140186f00(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::IRmiProxy::vftable;
  if (param_1[1] != 0) {
    FUN_1400a2b50(
                 L"RMI Proxy which is still in use by ProudNet core cannot be destroyed! Destroy CNetClient or CNetServer instance first."
                 );
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_140186f50(longlong *param_1,longlong param_2,int param_3,longlong param_4,
                       undefined8 param_5,undefined8 param_6,undefined4 param_7)

{
  byte bVar1;
  undefined4 uVar2;
  ulonglong uVar3;
  longlong lVar4;
  undefined1 auStack_1ac8 [32];
  longlong local_1aa8;
  undefined8 local_1a98;
  undefined8 uStack_1a90;
  undefined4 local_1a88;
  undefined4 local_1a84;
  undefined4 local_1a80;
  undefined4 local_1a7c;
  undefined8 local_1a78;
  undefined4 local_1a70;
  undefined8 local_1a68;
  undefined4 local_1a60;
  undefined4 local_1a5c;
  undefined4 local_1a58;
  undefined1 local_1a54;
  undefined1 local_1a53;
  undefined1 local_1a52;
  undefined4 local_1a50;
  undefined8 local_1a48;
  undefined1 local_1a40;
  undefined1 local_1a3f;
  undefined8 local_1a38;
  undefined1 local_1a28 [8];
  longlong local_1a20;
  longlong local_1a18;
  undefined4 local_1a10;
  int local_1a0c;
  undefined1 local_1a00 [136];
  undefined4 local_1978;
  undefined4 uStack_1974;
  undefined4 uStack_1970;
  undefined4 uStack_196c;
  undefined4 *local_cf8;
  undefined4 local_cf0;
  int local_cec;
  undefined1 local_ce8 [3200];
  undefined1 *local_68;
  undefined4 local_60;
  int local_5c;
  ulonglong local_58;
  undefined8 uStack_48;
  
  uStack_48 = 0x140186f6f;
  local_1a38 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_1ac8;
  if (param_1[1] == 0) {
    uVar3 = FUN_1400a2b50(L"ProudNet RMI Proxy is not attached yet!");
    uVar3 = uVar3 & 0xffffffffffffff00;
  }
  else {
    FUN_140140ab0(param_4);
    FUN_140185560(local_1a28);
    FUN_1401851e0(local_1a28,local_1a00);
    FUN_14003c9e0(local_1a28,1);
    local_5c = 200;
    local_60 = 0;
    local_68 = local_ce8;
    local_cec = 200;
    local_cf0 = 0;
    local_cf8 = &local_1978;
    if (local_1a20 == 0) {
      if (local_1a18 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
    }
    else {
      local_1a10 = *(undefined4 *)(local_1a20 + 0x18);
    }
    lVar4 = local_1a18;
    if (local_1a18 == 0) {
      if (local_1a20 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      lVar4 = 0;
      if (*(int *)(local_1a20 + 0x18) != 0) {
        lVar4 = *(longlong *)(local_1a20 + 0x10);
      }
    }
    uStack_1a90 = CONCAT44(uStack_1a90._4_4_,local_1a10);
    local_cf0 = 1;
    local_1a98._0_4_ = (undefined4)lVar4;
    local_1a98._4_4_ = (undefined4)((ulonglong)lVar4 >> 0x20);
    local_1978 = (undefined4)local_1a98;
    uStack_1974 = local_1a98._4_4_;
    uStack_196c = uStack_1a90._4_4_;
    local_1a98 = (longlong *)lVar4;
    uStack_1970 = local_1a10;
    FUN_140145c70(local_ce8,&local_1978);
    if (local_cf8 == (undefined4 *)0x0) {
      FUN_1400a2320(&local_1a80,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(&local_1a80,(ThrowInfo *)&DAT_1402f4860);
    }
    if (local_cec < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_140146970(&local_1978,param_5);
    FUN_140145c70(local_ce8,&local_1978);
    if (local_cf8 == (undefined4 *)0x0) {
      FUN_1400a2320(&local_1a80,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(&local_1a80,(ThrowInfo *)&DAT_1402f4860);
    }
    if (local_cec < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_1a80 = *(undefined4 *)(param_4 + 0x2c);
    local_1a7c = *(undefined4 *)(param_4 + 8);
    local_1a78 = *(undefined8 *)(param_4 + 0x10);
    local_1a70 = *(undefined4 *)(param_4 + 0x18);
    local_1a68 = *(undefined8 *)(param_4 + 0x20);
    local_1a60 = *(undefined4 *)(param_4 + 0x28);
    local_1a53 = *(undefined1 *)(param_4 + 0x30);
    local_1a54 = *(undefined1 *)(param_4 + 0x40);
    local_1a52 = *(undefined1 *)(param_4 + 0x41);
    local_1a5c = *(undefined4 *)(param_4 + 0x54);
    local_1a50 = 0xffffffff;
    local_1a48 = *(undefined8 *)(param_4 + 0x48);
    local_1a3f = *(undefined1 *)(param_4 + 0x50);
    local_1a40 = DAT_1402f81cc;
    local_1a58 = *(undefined4 *)(param_4 + 0x58);
    local_1aa8 = CONCAT44(local_1aa8._4_4_,param_3);
    bVar1 = (**(code **)(*(longlong *)param_1[1] + 0x28))
                      ((longlong *)param_1[1],local_ce8,&local_1a80,param_2);
    if ((char)param_1[2] == '\0') {
      uVar2 = FUN_1401a7030(local_ce8);
      local_1a98 = (longlong *)CONCAT44(param_7,uVar2);
      uStack_1a90 = param_6;
      local_1a88 = *(undefined4 *)(param_4 + 0x54);
      local_1a84 = *(undefined4 *)(param_4 + 0x58);
      if (((char)param_1[3] != '\0') && (lVar4 = 0, 0 < param_3)) {
        do {
          (**(code **)(*param_1 + 0x10))
                    (param_1,*(undefined4 *)(param_2 + lVar4 * 4),&local_1a98,param_4);
          lVar4 = lVar4 + 1;
        } while (lVar4 < param_3);
      }
      local_1aa8 = param_4;
      (**(code **)(*(longlong *)param_1[1] + 0x68))
                ((longlong *)param_1[1],param_2,param_3,&local_1a98);
    }
    if (local_68 == (undefined1 *)0x0) {
      FUN_1400a2320(&local_1a80,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(&local_1a80,(ThrowInfo *)&DAT_1402f4860);
    }
    if (local_5c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_60 = 0;
    local_1a98 = &local_1a20;
    FUN_14019a730(&local_1a20);
    if ((local_1a18 != 0) && (local_1a0c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    uVar3 = (ulonglong)bVar1;
  }
  return uVar3;
}



void FUN_1401872f0(undefined8 param_1,double param_2)

{
  undefined1 local_58 [88];
  
  if (param_2 < DAT_1402f80f8 * 10.0 * 2.0) {
    FUN_1400a2320(local_58,L"No ping timeout value is too small!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  return;
}



void FUN_140187340(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x000140187367. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



void FUN_140187380(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x0001401873a7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



undefined8 * FUN_1401873c0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_140187420(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140187480(longlong param_1,int param_2,longlong param_3,int param_4)

{
  undefined8 *puVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  
  lVar8 = (longlong)param_4;
  lVar6 = (longlong)param_2;
  if (((-1 < param_4) && (-1 < param_2)) && (param_2 <= *(int *)(param_1 + 0x18))) {
    iVar4 = *(int *)(param_1 + 0x18);
    FUN_140195930(param_1,iVar4 + param_4);
    iVar4 = iVar4 - param_2;
    if ((0 < iVar4) && (iVar4 = iVar4 + -1, lVar5 = (longlong)iVar4, -1 < iVar4)) {
      lVar7 = (lVar8 + lVar6 + lVar5) * 8;
      do {
        lVar2 = FUN_1401b2160(param_1);
        lVar3 = FUN_1401b2160(param_1);
        *(undefined8 *)(lVar3 + lVar7) = *(undefined8 *)(lVar2 + lVar8 * -8 + lVar7);
        lVar7 = lVar7 + -8;
        lVar5 = lVar5 + -1;
      } while (-1 < lVar5);
    }
    if (0 < param_4) {
      lVar5 = lVar6 * 8;
      do {
        lVar7 = FUN_1401b2160(param_1);
        puVar1 = (undefined8 *)(lVar5 + param_3 + lVar6 * -8);
        lVar5 = lVar5 + 8;
        lVar8 = lVar8 + -1;
        *(undefined8 *)(lVar7 + -8 + lVar5) = *puVar1;
      } while (lVar8 != 0);
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_140187570(undefined8 param_1,longlong param_2)

{
  if ((*(longlong *)(param_2 + 8) == 0) && (*(longlong *)(param_2 + 0x10) == 0)) {
                    // WARNING: Subroutine does not return
    FUN_14019a830(param_1,param_2,param_2);
  }
  return;
}



undefined8 FUN_1401875a0(longlong *param_1,int *param_2,longlong param_3)

{
  int iVar1;
  longlong lVar2;
  char cVar3;
  int iVar4;
  longlong lVar5;
  int iVar6;
  longlong lVar7;
  int local_res10 [4];
  ulonglong local_res20;
  undefined4 local_28 [4];
  
  iVar1 = *param_2;
  cVar3 = FUN_140185b30(param_2,local_28);
  if (cVar3 != '\0') {
    cVar3 = FUN_140185b30(param_2,&local_res20);
    if (cVar3 != '\0') {
      iVar4 = (**(code **)(*param_1 + 0xd0))(param_1);
      iVar6 = (int)local_res20;
      if (iVar6 <= iVar4) {
        local_res10[0] = iVar6;
        FUN_140185030(param_3);
        FUN_1401856c0(param_3,local_res20 & 0xffffffff);
        lVar7 = *(longlong *)(param_2 + 4);
        if (lVar7 == 0) {
          lVar5 = *(longlong *)(param_2 + 2);
          if (lVar5 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14019a830();
          }
          if (*(int *)(lVar5 + 0x18) != 0) {
            lVar7 = *(longlong *)(lVar5 + 0x10);
          }
        }
        lVar5 = *(longlong *)(param_3 + 0x10);
        if (lVar5 == 0) {
          lVar2 = *(longlong *)(param_3 + 8);
          if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14019a830();
          }
          if (*(int *)(lVar2 + 0x18) != 0) {
            lVar5 = *(longlong *)(lVar2 + 0x10);
          }
        }
        iVar4 = FUN_1401bf1b0(lVar5,local_res10,
                              lVar7 + ((int)(*param_2 + (*param_2 >> 0x1f & 7U)) >> 3),local_28[0]);
        if ((iVar4 == 0) && (local_res10[0] == iVar6)) {
          return 1;
        }
      }
    }
  }
  FUN_140185160(param_2,(int)((iVar1 >> 0x1f & 7U) + iVar1) >> 3);
  return 0;
}



undefined8 * FUN_1401876b0(undefined8 *param_1)

{
  *param_1 = Proud::CNetCoreImpl::vftable;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[1] = Proud::CFastArray<>::vftable;
  param_1[7] = 0;
  param_1[6] = Proud::CFastArray<>::vftable;
  param_1[8] = 0;
  param_1[9] = 0;
  param_1[10] = 0;
  param_1[0xb] = 0;
  return param_1;
}



void FUN_140187700(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  longlong *plVar2;
  
  *param_1 = Proud::CNetCoreImpl::vftable;
  puVar1 = (undefined8 *)param_1[0xb];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,0xfffffffffffffffe);
  }
  param_1[6] = Proud::CFastArray<>::vftable;
  if (param_1[8] != 0) {
    plVar2 = (longlong *)param_1[7];
    if (plVar2 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar2 + 0x18))(plVar2,param_1[8]);
    }
  }
  param_1[1] = Proud::CFastArray<>::vftable;
  if (param_1[3] != 0) {
    plVar2 = (longlong *)param_1[2];
    if (plVar2 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar2 + 0x18))(plVar2,param_1[3]);
    }
  }
  *param_1 = Proud::IRmiHost::vftable;
  return;
}



void FUN_1401877b0(longlong *param_1,longlong param_2)

{
  char cVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  int iVar5;
  longlong lVar6;
  longlong *plVar7;
  longlong lVar8;
  int iVar9;
  undefined1 local_68 [80];
  
  cVar1 = (**(code **)(*param_1 + 0x90))();
  if (cVar1 != '\0') {
    FUN_1400a2320(local_68,PTR_u_Already_async_callback_may_occur_14030bd58);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_68,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar5 = 0;
  lVar6 = 0;
  if (0 < (int)param_1[4]) {
    plVar7 = param_1 + 1;
    while( true ) {
      if ((lVar6 < 0) || ((int)param_1[4] <= iVar5)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      if (*(longlong *)(param_1[3] + lVar6 * 8) == param_2) break;
      iVar5 = iVar5 + 1;
      lVar6 = lVar6 + 1;
      if ((int)param_1[4] <= iVar5) {
        return;
      }
    }
    if (iVar5 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    iVar2 = (int)param_1[4] - iVar5;
    iVar9 = 1;
    if (iVar2 < 2) {
      iVar9 = iVar2;
    }
    iVar5 = ((int)param_1[4] - iVar9) - iVar5;
    if (0 < iVar5) {
      lVar8 = (longlong)iVar5;
      lVar6 = lVar6 * 8;
      do {
        lVar3 = FUN_1401b2160(plVar7);
        lVar4 = FUN_1401b2160(plVar7);
        *(undefined8 *)(lVar4 + lVar6) = *(undefined8 *)((longlong)iVar9 * 8 + lVar3 + lVar6);
        lVar6 = lVar6 + 8;
        lVar8 = lVar8 + -1;
      } while (lVar8 != 0);
    }
    FUN_140195930(plVar7,(int)param_1[4] - iVar9);
    *(undefined8 *)(param_2 + 8) = 0;
  }
  return;
}



void FUN_140187910(longlong param_1,longlong param_2)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  int iVar8;
  
  iVar5 = 0;
  lVar6 = 0;
  if (0 < *(int *)(param_1 + 0x48)) {
    lVar1 = param_1 + 0x30;
    while( true ) {
      if ((lVar6 < 0) || (*(int *)(param_1 + 0x48) <= iVar5)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      if (*(longlong *)(*(longlong *)(param_1 + 0x40) + lVar6 * 8) == param_2) break;
      iVar5 = iVar5 + 1;
      lVar6 = lVar6 + 1;
      if (*(int *)(param_1 + 0x48) <= iVar5) {
        return;
      }
    }
    if (iVar5 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    iVar2 = *(int *)(param_1 + 0x48) - iVar5;
    iVar8 = 1;
    if (iVar2 < 2) {
      iVar8 = iVar2;
    }
    iVar5 = (*(int *)(param_1 + 0x48) - iVar8) - iVar5;
    if (0 < iVar5) {
      lVar7 = (longlong)iVar5;
      lVar6 = lVar6 * 8;
      do {
        lVar3 = FUN_1401b2160(lVar1);
        lVar4 = FUN_1401b2160(lVar1);
        *(undefined8 *)(lVar4 + lVar6) = *(undefined8 *)((longlong)iVar8 * 8 + lVar3 + lVar6);
        lVar6 = lVar6 + 8;
        lVar7 = lVar7 + -1;
      } while (lVar7 != 0);
    }
    FUN_140195930(lVar1,*(int *)(param_1 + 0x48) - iVar8);
    *(undefined8 *)(param_2 + 0x10) = 0;
  }
  return;
}



void * FUN_140187a30(void *param_1,uint param_2)

{
  FUN_140187700();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140187a60(longlong param_1)

{
  uint uVar1;
  ulonglong uVar3;
  ulonglong uVar4;
  ulonglong uVar2;
  
  uVar3 = 0;
  uVar2 = uVar3;
  uVar4 = uVar3;
  if (0 < *(int *)(param_1 + 0x20)) {
    do {
      if (((longlong)uVar4 < 0) || (*(int *)(param_1 + 0x20) <= (int)uVar2)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      uVar1 = (int)uVar2 + 1;
      uVar2 = (ulonglong)uVar1;
      uVar4 = uVar4 + 1;
      *(undefined8 *)(*(longlong *)(*(longlong *)(param_1 + 0x18) + -8 + uVar4 * 8) + 8) = 0;
    } while ((int)uVar1 < *(int *)(param_1 + 0x20));
  }
  FUN_140195930(param_1 + 8,0);
  uVar2 = uVar3;
  if (0 < *(int *)(param_1 + 0x48)) {
    do {
      if (((longlong)uVar3 < 0) || (*(int *)(param_1 + 0x48) <= (int)uVar2)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      uVar1 = (int)uVar2 + 1;
      uVar2 = (ulonglong)uVar1;
      uVar3 = uVar3 + 1;
      *(undefined8 *)(*(longlong *)(*(longlong *)(param_1 + 0x40) + -8 + uVar3 * 8) + 0x10) = 0;
    } while ((int)uVar1 < *(int *)(param_1 + 0x48));
  }
  FUN_140195930(param_1 + 0x30,0);
  return;
}



void FUN_140187b00(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  char cVar2;
  short sVar3;
  ushort uVar4;
  ushort uVar5;
  int iVar6;
  ushort uVar7;
  ushort uVar8;
  ushort uVar9;
  int iVar10;
  longlong lVar11;
  longlong *local_res10;
  undefined1 local_78 [80];
  
  local_res10 = param_2;
  cVar2 = (**(code **)(*param_1 + 0x90))();
  if (cVar2 != '\0') {
    FUN_1400a2320(local_78,PTR_u_Already_async_callback_may_occur_14030bd58);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_78,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar10 = 0;
  lVar11 = 0;
  if (0 < (int)param_1[4]) {
    do {
      if ((lVar11 < 0) || ((int)param_1[4] <= iVar10)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      plVar1 = *(longlong **)(param_1[3] + lVar11 * 8);
      iVar6 = (**(code **)*plVar1)(plVar1);
      if (0xfff9 < iVar6) {
LAB_140187ccb:
        FUN_1400a2320(local_78,PTR_u_Wrong_RMI_ID_is_found__RMI_ID_sh_14030bd50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_78,(ThrowInfo *)&DAT_1402f4860);
      }
      iVar6 = (**(code **)(*plVar1 + 8))(plVar1);
      if (iVar6 < 1) goto LAB_140187ccb;
      sVar3 = (**(code **)(*param_2 + 8))(param_2);
      uVar7 = sVar3 + 1;
      uVar4 = (**(code **)*param_2)(param_2);
      sVar3 = (**(code **)(*plVar1 + 8))(plVar1);
      uVar8 = sVar3 + 1;
      uVar5 = (**(code **)*plVar1)(plVar1);
      uVar9 = uVar8;
      if (uVar8 < uVar5) {
        uVar9 = uVar5;
        uVar5 = uVar8;
      }
      uVar8 = uVar7;
      if (uVar7 < uVar4) {
        uVar8 = uVar4;
        uVar4 = uVar7;
      }
      if (uVar5 < uVar4) {
LAB_140187c24:
        if ((uVar8 <= uVar9) || ((uVar4 <= uVar9 && (uVar9 <= uVar8)))) goto LAB_140187ca8;
        if (uVar4 <= uVar5) goto LAB_140187c39;
      }
      else {
        if (uVar9 <= uVar8) goto LAB_140187ca8;
        if (uVar5 <= uVar4) goto LAB_140187c24;
LAB_140187c39:
        if ((uVar5 <= uVar8) && (uVar8 <= uVar9)) {
LAB_140187ca8:
          FUN_1400a2320(local_78,PTR_u_Duplicated_RMI_ID_is_found__Revi_14030bd48);
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_78,(ThrowInfo *)&DAT_1402f4860);
        }
      }
      iVar10 = iVar10 + 1;
      lVar11 = lVar11 + 1;
    } while (iVar10 < (int)param_1[4]);
  }
  param_2[1] = (longlong)param_1;
  FUN_140187480(param_1 + 1,(int)param_1[4],&local_res10,1);
  return;
}



void FUN_140187d00(longlong param_1,longlong *param_2)

{
  longlong *plVar1;
  short sVar2;
  ushort uVar3;
  ushort uVar4;
  longlong lVar5;
  longlong lVar6;
  int iVar7;
  ushort uVar8;
  ushort uVar9;
  ushort uVar10;
  longlong lVar11;
  int iVar12;
  longlong lVar13;
  undefined1 local_78 [80];
  
  iVar12 = 0;
  lVar13 = 0;
  if (0 < *(int *)(param_1 + 0x48)) {
    do {
      if ((lVar13 < 0) || (*(int *)(param_1 + 0x48) <= iVar12)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x40) + lVar13 * 8);
      sVar2 = (**(code **)(*param_2 + 8))(param_2);
      uVar10 = sVar2 + 1;
      uVar3 = (**(code **)*param_2)(param_2);
      sVar2 = (**(code **)(*plVar1 + 8))(plVar1);
      uVar8 = sVar2 + 1;
      uVar4 = (**(code **)*plVar1)(plVar1);
      uVar9 = uVar8;
      if (uVar8 < uVar4) {
        uVar9 = uVar4;
        uVar4 = uVar8;
      }
      uVar8 = uVar10;
      if (uVar10 < uVar3) {
        uVar8 = uVar3;
        uVar3 = uVar10;
      }
      if (uVar4 < uVar3) {
LAB_140187dad:
        if ((uVar8 <= uVar9) || ((uVar3 <= uVar9 && (uVar9 <= uVar8)))) goto LAB_140187e82;
        if (uVar3 <= uVar4) goto LAB_140187dca;
      }
      else {
        if (uVar9 <= uVar8) goto LAB_140187e82;
        if (uVar4 <= uVar3) goto LAB_140187dad;
LAB_140187dca:
        if ((uVar4 <= uVar8) && (uVar8 <= uVar9)) {
LAB_140187e82:
          FUN_1400a2320(local_78,PTR_u_Duplicated_RMI_ID_is_found__Revi_14030bd48);
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_78,(ThrowInfo *)&DAT_1402f4860);
        }
      }
      iVar12 = iVar12 + 1;
      lVar13 = lVar13 + 1;
    } while (iVar12 < *(int *)(param_1 + 0x48));
  }
  param_2[2] = param_1;
  iVar12 = *(int *)(param_1 + 0x48);
  if (-1 < iVar12) {
    iVar7 = *(int *)(param_1 + 0x48);
    FUN_140195930(param_1 + 0x30,iVar7 + 1);
    iVar7 = iVar7 - iVar12;
    if ((0 < iVar7) && (iVar7 = iVar7 + -1, lVar13 = (longlong)iVar7, -1 < iVar7)) {
      lVar11 = (lVar13 + iVar12) * 8 + 8;
      do {
        lVar5 = FUN_1401b2160(param_1 + 0x30);
        lVar6 = FUN_1401b2160(param_1 + 0x30);
        *(undefined8 *)(lVar6 + lVar11) = *(undefined8 *)(lVar5 + -8 + lVar11);
        lVar11 = lVar11 + -8;
        lVar13 = lVar13 + -1;
      } while (-1 < lVar13);
    }
    lVar13 = FUN_1401b2160(param_1 + 0x30);
    *(longlong **)(lVar13 + (longlong)iVar12 * 8) = param_2;
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1
FUN_140187ec0(longlong *param_1,undefined8 param_2,undefined4 param_3,longlong param_4,
             undefined8 param_5,int param_6)

{
  undefined1 uVar1;
  int iVar2;
  longlong lVar3;
  undefined1 auStack_1ad8 [32];
  longlong local_1ab8;
  undefined8 local_1aa8;
  int iStack_1aa0;
  undefined4 uStack_1a9c;
  undefined4 local_1a98;
  undefined4 local_1a94;
  undefined8 local_1a90;
  undefined4 local_1a88;
  undefined8 local_1a80;
  undefined4 local_1a78;
  undefined4 local_1a74;
  undefined4 local_1a70;
  undefined1 local_1a6c;
  undefined1 local_1a6b;
  undefined1 local_1a6a;
  undefined4 local_1a68;
  undefined8 local_1a60;
  undefined1 local_1a58;
  undefined1 local_1a57;
  undefined4 local_1a50;
  undefined4 local_1a4c;
  wchar_t *local_1a48;
  undefined4 local_1a40;
  undefined4 local_1a3c;
  undefined8 local_1a38;
  undefined1 local_1a28 [8];
  longlong local_1a20;
  longlong local_1a18;
  undefined4 local_1a10;
  int local_1a0c;
  undefined1 local_1a00 [136];
  undefined1 local_1978 [3200];
  undefined1 *local_cf8;
  int local_cf0;
  int local_cec;
  undefined4 local_ce8;
  undefined4 uStack_ce4;
  undefined4 uStack_ce0;
  undefined4 uStack_cdc;
  undefined4 *local_68;
  undefined4 local_60;
  int local_5c;
  ulonglong local_58;
  undefined8 uStack_48;
  
  uStack_48 = 0x140187edf;
  local_1a38 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_1ad8;
  FUN_140140ab0(param_4);
  FUN_140185560(local_1a28);
  FUN_1401851e0(local_1a28,local_1a00,0x80);
  FUN_14003c9e0(local_1a28,2);
  FUN_140186930(local_1a28,(longlong)param_6);
  local_cec = 200;
  local_cf0 = 0;
  local_cf8 = local_1978;
  local_5c = 200;
  local_60 = 0;
  local_68 = &local_ce8;
  if (local_1a20 == 0) {
    if (local_1a18 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else {
    local_1a10 = *(undefined4 *)(local_1a20 + 0x18);
  }
  lVar3 = local_1a18;
  if (local_1a18 == 0) {
    if (local_1a20 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    lVar3 = 0;
    if (*(int *)(local_1a20 + 0x18) != 0) {
      lVar3 = *(longlong *)(local_1a20 + 0x10);
    }
  }
  local_60 = 1;
  local_1aa8._0_4_ = (undefined4)lVar3;
  local_1aa8._4_4_ = (undefined4)((ulonglong)lVar3 >> 0x20);
  local_ce8 = (undefined4)local_1aa8;
  uStack_ce4 = local_1aa8._4_4_;
  uStack_cdc = uStack_1a9c;
  local_1aa8 = (longlong *)lVar3;
  iStack_1aa0 = local_1a10;
  uStack_ce0 = local_1a10;
  FUN_140145c70(local_1978,&local_ce8);
  if (local_68 == (undefined4 *)0x0) {
    FUN_1400a2320(&local_1a98,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(&local_1a98,(ThrowInfo *)&DAT_1402f4860);
  }
  if (local_5c < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  iStack_1aa0 = param_6;
  if (local_cf8 == (undefined1 *)0x0) {
    FUN_1400a2320(&local_1a98,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(&local_1a98,(ThrowInfo *)&DAT_1402f4860);
  }
  if (local_cf0 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  iVar2 = local_cf0 + 1;
  if ((iVar2 < 0) || (local_cec < iVar2)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined8 *)(local_cf8 + (longlong)local_cf0 * 0x10) = param_5;
  *(ulonglong *)(local_cf8 + (longlong)local_cf0 * 0x10 + 8) = CONCAT44(uStack_1a9c,param_6);
  local_1a98 = *(undefined4 *)(param_4 + 0x2c);
  local_1a94 = *(undefined4 *)(param_4 + 8);
  local_1a90 = *(undefined8 *)(param_4 + 0x10);
  local_1a88 = *(undefined4 *)(param_4 + 0x18);
  local_1a80 = *(undefined8 *)(param_4 + 0x20);
  local_1a78 = *(undefined4 *)(param_4 + 0x28);
  local_1a6b = *(undefined1 *)(param_4 + 0x30);
  local_1a6c = *(undefined1 *)(param_4 + 0x40);
  local_1a6a = *(undefined1 *)(param_4 + 0x41);
  local_1a74 = *(undefined4 *)(param_4 + 0x54);
  local_1a68 = 0xffffffff;
  local_1a60 = *(undefined8 *)(param_4 + 0x48);
  local_1a57 = *(undefined1 *)(param_4 + 0x50);
  local_1a58 = DAT_1402f81cc;
  local_1a70 = *(undefined4 *)(param_4 + 0x58);
  local_1ab8 = CONCAT44(local_1ab8._4_4_,param_3);
  local_cf0 = iVar2;
  uVar1 = (**(code **)(*param_1 + 0x28))(param_1,local_1978,&local_1a98,param_2);
  local_1a50 = FUN_1401a7030(local_1978);
  local_1a4c = 0;
  local_1a48 = L"<User Defined Message>";
  local_1a40 = *(undefined4 *)(param_4 + 0x54);
  local_1a3c = *(undefined4 *)(param_4 + 0x58);
  local_1ab8 = param_4;
  (**(code **)(*param_1 + 0x68))(param_1,param_2,param_3,&local_1a50);
  if (local_cf8 == (undefined1 *)0x0) {
    FUN_1400a2320(&local_1a98,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(&local_1a98,(ThrowInfo *)&DAT_1402f4860);
  }
  if (-1 < local_cec) {
    local_cf0 = 0;
    local_1aa8 = &local_1a20;
    FUN_14019a730(&local_1a20);
    if ((local_1a18 != 0) && (local_1a0c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    return uVar1;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_140188230(longlong *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  lVar1 = (**(code **)(*param_1 + 0x98))();
  if (lVar1 != 0) {
    plVar2 = (longlong *)(**(code **)(*param_1 + 0x98))(param_1);
    uVar3 = 0;
    if (*param_2 != 0) {
      uVar3 = *(undefined8 *)(*param_2 + 0x38);
    }
    (**(code **)(*plVar2 + 8))(plVar2,uVar3,param_3,param_4,uVar4);
  }
  FUN_14008c980(param_2);
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_140188290(longlong *param_1,undefined8 param_2,int *param_3,undefined8 param_4,
                       undefined4 param_5)

{
  undefined *puVar1;
  undefined4 uVar2;
  byte bVar3;
  char cVar4;
  int iVar5;
  uint uVar6;
  uint uVar7;
  uint uVar8;
  undefined8 uVar9;
  int *piVar10;
  uint *puVar11;
  undefined8 uVar12;
  undefined *extraout_RAX;
  undefined *puVar13;
  ulonglong uVar14;
  longlong lVar15;
  uint *puVar16;
  uint uVar17;
  uint uVar18;
  int iVar19;
  undefined1 auStack_1d58 [32];
  undefined ***local_1d38;
  uint *local_1d28;
  int local_1d20;
  uint *local_1d18;
  undefined8 local_1d10;
  undefined2 local_1d08 [4];
  undefined *local_1d00;
  undefined **local_1cf8;
  undefined8 local_1cf0;
  undefined8 local_1ce8;
  undefined8 local_1ce0;
  undefined8 local_1cd8;
  undefined8 local_1cb0;
  undefined8 local_1ca8;
  undefined1 local_1ca0;
  undefined1 local_1c98 [8];
  undefined1 local_1c90 [8];
  longlong local_1c88;
  undefined4 local_1c80;
  int local_1c7c;
  undefined1 *local_1c70;
  undefined1 local_1c68 [8];
  longlong local_1c60;
  longlong local_1c58;
  int local_1c50;
  int local_1c4c;
  undefined8 local_1c40;
  undefined1 local_1c38;
  undefined8 local_1c30;
  undefined1 local_1c28;
  undefined8 local_1c20;
  undefined1 local_1c18;
  undefined8 local_1c10;
  undefined4 uStack_1c08;
  undefined4 uStack_1c04;
  undefined8 local_1c00;
  int iStack_1bf8;
  undefined4 uStack_1bf4;
  undefined1 local_1bf0 [8];
  undefined1 local_1be8 [8];
  undefined8 local_1be0;
  undefined1 local_1bd8 [8];
  longlong local_1bd0;
  longlong local_1bc8;
  undefined4 local_1bc0;
  int local_1bbc;
  undefined1 local_1bb0 [136];
  void *local_1b28;
  longlong local_1b20;
  ulonglong local_1b18;
  undefined8 local_1b10;
  int local_1b08 [100];
  undefined4 local_1978;
  undefined4 uStack_1974;
  int iStack_1970;
  undefined4 uStack_196c;
  undefined4 *local_cf8;
  undefined4 local_cf0;
  int local_cec;
  undefined1 local_ce8 [3200];
  undefined1 *local_68;
  undefined4 local_60;
  int local_5c;
  ulonglong local_58;
  undefined8 uStack_48;
  
  uStack_48 = 0x1401882af;
  local_1be0 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_1d58;
  bVar3 = 0;
  local_1cb0 = param_2;
  if ((param_3[9] == 0) || (*param_3 == 2)) {
    local_1d38 = (undefined ***)CONCAT44(local_1d38._4_4_,param_5);
    uVar14 = (**(code **)(*param_1 + 0x78))();
  }
  else {
    uVar9 = (**(code **)(*param_1 + 0x58))();
    local_1c40 = uVar9;
    FUN_1400a1c30(uVar9);
    local_1c38 = 1;
    if (DAT_140313fcf != '\0') {
      (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetCoreImpl::Send_SecureLayer");
    }
    local_1b28 = (void *)0x0;
    local_1b10 = 0;
    local_1b20 = 0;
    local_1b18 = 100;
    (**(code **)(*param_1 + 0x50))(param_1,param_5,param_4,&local_1b28);
    FUN_1400d1290(uVar9);
    local_1c38 = 0;
    FUN_1400a3440();
    local_1d00 = PTR_DAT_1402f8010;
    iVar19 = 0;
    local_1d10 = (longlong *)((ulonglong)local_1d10._4_4_ << 0x20);
    if (0 < local_1b20) {
      lVar15 = 0;
      do {
        if ((lVar15 < 0) || (local_1b20 <= lVar15)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        if (local_1b18 < 0x65) {
          piVar10 = local_1b08 + lVar15;
        }
        else {
          piVar10 = (int *)((longlong)local_1b28 + lVar15 * 4);
        }
        local_1d20 = *piVar10;
        iVar5 = (**(code **)(*param_1 + 0x30))(param_1);
        if (iVar5 == local_1d20) {
          local_1d38 = (undefined ***)CONCAT44(local_1d38._4_4_,1);
          bVar3 = (**(code **)(*param_1 + 0x78))(param_1,param_2,param_3);
        }
        else {
          lVar15 = (**(code **)(*param_1 + 0xc0))(param_1,local_1d20,&local_1d00);
          if (lVar15 == 0) {
            uVar9 = (**(code **)(*param_1 + 0x58))(param_1);
            local_1ca8 = uVar9;
            FUN_1400a1c30(uVar9);
            local_1ca0 = 1;
            if (DAT_140313fcf != '\0') {
              (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetCoreImpl::Send_SecureLayer");
            }
            if (((local_1d00 == (undefined *)0x0) || (local_1d00 == PTR_DAT_1402f8010)) ||
               (*(int *)(local_1d00 + -8) < 1)) {
              FUN_1400a3440();
              local_1d28 = (uint *)PTR_DAT_1402f8010;
              uVar6 = FUN_1400a32c0(
                                   L"CStartServerParameter.m_enableP2PEncryptedMessaging=false. P2P Messaging can not encrypted!!"
                                   );
              uVar17 = 0;
              uVar18 = 0;
              if ((local_1d28 != (uint *)0x0) &&
                 (uVar18 = 0, local_1d28 != (uint *)PTR_DAT_1402f8010)) {
                uVar18 = local_1d28[-2];
              }
              uVar7 = uVar6;
              if ((((int)uVar6 <= (int)uVar18) && (uVar7 = uVar17, local_1d28 != (uint *)0x0)) &&
                 (local_1d28 != (uint *)PTR_DAT_1402f8010)) {
                uVar7 = local_1d28[-2];
              }
              uVar18 = 1;
              if (1 < (int)uVar7) {
                uVar18 = uVar7;
              }
              uVar8 = 0;
              uVar7 = uVar8;
              if ((local_1d28 != (uint *)0x0) && (local_1d28 != (uint *)PTR_DAT_1402f8010)) {
                uVar7 = local_1d28[-2];
              }
              if ((int)uVar7 < (int)uVar18) {
                if (local_1d28 == (uint *)0x0) {
                  local_1d28 = (uint *)PTR_DAT_1402f8010;
                }
                if ((int)uVar18 < 0) {
                    // WARNING: Subroutine does not return
                  FUN_1400a26d0();
                }
                if (uVar18 == 0) {
                  FUN_1400031d0(&local_1d28);
                }
                else {
                  uVar7 = uVar8;
                  if ((local_1d28 != (uint *)0x0) && (local_1d28 != (uint *)PTR_DAT_1402f8010)) {
                    uVar7 = local_1d28[-2];
                  }
                  if (uVar18 != uVar7) {
                    puVar11 = (uint *)FUN_1400a34c0((longlong)(int)uVar18 * 2 + 10);
                    if (puVar11 != (uint *)0x0) {
                      *puVar11 = 0;
                      puVar11[1] = 1;
                    }
                    *puVar11 = uVar18;
                    if ((local_1d28 != (uint *)0x0) && (local_1d28 != (uint *)PTR_DAT_1402f8010)) {
                      uVar8 = local_1d28[-2];
                    }
                    puVar16 = (uint *)PTR_DAT_1402f8010;
                    if ((int)uVar18 < (int)uVar8) {
LAB_140188be7:
                      if (local_1d28 != (uint *)0x0) {
                        puVar16 = local_1d28;
                      }
                    }
                    else {
                      uVar18 = uVar17;
                      if (local_1d28 != (uint *)0x0) {
                        if (local_1d28 != (uint *)PTR_DAT_1402f8010) {
                          uVar18 = local_1d28[-2];
                        }
                        goto LAB_140188be7;
                      }
                    }
                    FUN_1400a32f0(puVar11 + 2,puVar16,uVar18);
                    FUN_1400031d0(&local_1d28);
                    local_1d28 = puVar11 + 2;
                  }
                }
              }
              FUN_140002e30(&local_1d28);
              puVar11 = local_1d28;
              if (local_1d28 == (uint *)0x0) {
                puVar11 = (uint *)PTR_DAT_1402f8010;
              }
              FUN_1400a32f0(puVar11,
                            L"CStartServerParameter.m_enableP2PEncryptedMessaging=false. P2P Messaging can not encrypted!!"
                            ,uVar6);
              puVar11 = local_1d28;
              if (local_1d28 == (uint *)0x0) {
                puVar11 = (uint *)PTR_DAT_1402f8010;
              }
              uVar6 = FUN_1400a32c0(puVar11);
              uVar17 = 0;
              uVar18 = 0;
              if (0 < (int)uVar6) {
                uVar18 = uVar6;
              }
              uVar6 = uVar17;
              if ((local_1d28 != (uint *)0x0) && (local_1d28 != (uint *)PTR_DAT_1402f8010)) {
                uVar6 = local_1d28[-2];
              }
              if (((int)uVar18 < (int)uVar6) || (uVar18 = uVar17, local_1d28 == (uint *)0x0)) {
LAB_140188c85:
                if (((local_1d28 != (uint *)PTR_DAT_1402f8010) && (local_1d28 != (uint *)0x0)) &&
                   (local_1d28 + -2 != (uint *)0x0)) {
                  local_1d28[-2] = uVar18;
                  *(undefined2 *)((longlong)local_1d28 + (longlong)(int)uVar18 * 2) = 0;
                }
              }
              else if (local_1d28 != (uint *)PTR_DAT_1402f8010) {
                uVar18 = local_1d28[-2];
                goto LAB_140188c85;
              }
              local_1cf0 = 0;
              local_1ce8 = 0;
              local_1ce0 = 0;
              local_1cd8 = 0;
              local_1cf8 = Proud::ByteArray::vftable;
              local_1d38 = &local_1cf8;
              uVar12 = FUN_1401416a0(&local_1c70,5,local_1d20,&local_1d28);
              (**(code **)(*param_1 + 0x80))(param_1,uVar12);
              FUN_140140df0(&local_1cf8);
              FUN_1400031d0(&local_1d28);
              param_2 = local_1cb0;
              iVar19 = (int)local_1d10;
            }
            else {
              local_1cf0 = 0;
              local_1ce8 = 0;
              local_1ce0 = 0;
              local_1cd8 = 0;
              local_1cf8 = Proud::ByteArray::vftable;
              local_1d38 = &local_1cf8;
              uVar12 = FUN_1401416a0(local_1be8,5,local_1d20,&local_1d00);
              (**(code **)(*param_1 + 0x80))(param_1,uVar12);
              FUN_140140df0(&local_1cf8);
            }
            FUN_1400d1290(uVar9);
            local_1ca0 = 0;
          }
          else {
            uVar9 = (**(code **)(*param_1 + 0x58))();
            local_1c20 = uVar9;
            FUN_1400a1c30(uVar9);
            local_1c18 = 1;
            if (DAT_140313fcf != '\0') {
              (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetCoreImpl::Send_SecureLayer");
            }
            FUN_140185560(local_1c98);
            FUN_140185030(local_1c98);
            if (*param_3 == 1) {
              cVar4 = (**(code **)(*param_1 + 0xa0))(param_1,local_1d20,local_1d08);
              if (cVar4 == '\0') {
                FUN_1400a3440();
                local_1d28 = (uint *)PTR_DAT_1402f8010;
                uVar6 = FUN_1400a32c0(&DAT_140258d60);
                uVar17 = 0;
                uVar18 = 0;
                if ((local_1d28 != (uint *)0x0) &&
                   (uVar18 = 0, local_1d28 != (uint *)PTR_DAT_1402f8010)) {
                  uVar18 = local_1d28[-2];
                }
                uVar7 = uVar6;
                if ((((int)uVar6 <= (int)uVar18) && (uVar7 = uVar17, local_1d28 != (uint *)0x0)) &&
                   (local_1d28 != (uint *)PTR_DAT_1402f8010)) {
                  uVar7 = local_1d28[-2];
                }
                uVar18 = 1;
                if (1 < (int)uVar7) {
                  uVar18 = uVar7;
                }
                uVar7 = uVar17;
                if ((local_1d28 != (uint *)0x0) && (local_1d28 != (uint *)PTR_DAT_1402f8010)) {
                  uVar7 = local_1d28[-2];
                }
                uVar8 = 0;
                if ((int)uVar7 < (int)uVar18) {
                  if (local_1d28 == (uint *)0x0) {
                    local_1d28 = (uint *)PTR_DAT_1402f8010;
                  }
                  if ((int)uVar18 < 0) {
                    // WARNING: Subroutine does not return
                    FUN_1400a26d0();
                  }
                  if (uVar18 == 0) {
                    FUN_1400031d0(&local_1d28);
                  }
                  else {
                    uVar7 = uVar17;
                    if ((local_1d28 != (uint *)0x0) && (local_1d28 != (uint *)PTR_DAT_1402f8010)) {
                      uVar7 = local_1d28[-2];
                    }
                    if (uVar18 != uVar7) {
                      puVar11 = (uint *)FUN_1400a34c0((longlong)(int)uVar18 * 2 + 10);
                      if (puVar11 != (uint *)0x0) {
                        *puVar11 = 0;
                        puVar11[1] = 1;
                      }
                      *puVar11 = uVar18;
                      uVar7 = uVar8;
                      if ((local_1d28 != (uint *)0x0) && (local_1d28 != (uint *)PTR_DAT_1402f8010))
                      {
                        uVar7 = local_1d28[-2];
                      }
                      puVar16 = (uint *)PTR_DAT_1402f8010;
                      if ((int)uVar18 < (int)uVar7) {
LAB_140188e3d:
                        if (local_1d28 != (uint *)0x0) {
                          puVar16 = local_1d28;
                        }
                      }
                      else {
                        uVar18 = uVar17;
                        if (local_1d28 != (uint *)0x0) {
                          if (local_1d28 != (uint *)PTR_DAT_1402f8010) {
                            uVar18 = local_1d28[-2];
                          }
                          goto LAB_140188e3d;
                        }
                      }
                      FUN_1400a32f0(puVar11 + 2,puVar16,uVar18);
                      FUN_1400031d0(&local_1d28);
                      local_1d28 = puVar11 + 2;
                    }
                  }
                }
                FUN_140002e30(&local_1d28);
                puVar11 = local_1d28;
                if (local_1d28 == (uint *)0x0) {
                  puVar11 = (uint *)PTR_DAT_1402f8010;
                }
                FUN_1400a32f0(puVar11,&DAT_140258d60,uVar6);
                puVar11 = local_1d28;
                if (local_1d28 == (uint *)0x0) {
                  puVar11 = (uint *)PTR_DAT_1402f8010;
                }
                uVar6 = FUN_1400a32c0(puVar11);
                uVar18 = 0;
                if (0 < (int)uVar6) {
                  uVar18 = uVar6;
                }
                uVar6 = uVar8;
                if ((local_1d28 != (uint *)0x0) && (local_1d28 != (uint *)PTR_DAT_1402f8010)) {
                  uVar6 = local_1d28[-2];
                }
                if (((int)uVar6 <= (int)uVar18) && (uVar18 = uVar8, local_1d28 != (uint *)0x0)) {
                  if (local_1d28 == (uint *)PTR_DAT_1402f8010) goto LAB_140188ef7;
                  uVar18 = local_1d28[-2];
                }
                if (((local_1d28 != (uint *)PTR_DAT_1402f8010) && (local_1d28 != (uint *)0x0)) &&
                   (local_1d28 + -2 != (uint *)0x0)) {
                  local_1d28[-2] = uVar18;
                  *(undefined2 *)((longlong)local_1d28 + (longlong)(int)uVar18 * 2) = 0;
                }
LAB_140188ef7:
                local_1cf0 = 0;
                local_1ce8 = 0;
                local_1ce0 = 0;
                local_1cd8 = 0;
                local_1cf8 = Proud::ByteArray::vftable;
                local_1d38 = &local_1cf8;
                uVar12 = FUN_1401416a0(&local_1c70,5,local_1d20,&local_1d28);
                (**(code **)(*param_1 + 0x80))(param_1,uVar12);
                FUN_140140df0(&local_1cf8);
                puVar11 = local_1d28;
                if (((local_1d28 != (uint *)0x0) && (local_1d28 != (uint *)PTR_DAT_1402f8010)) &&
                   (puVar16 = local_1d28 + -2, puVar16 != (uint *)0x0)) {
                  uVar12 = FUN_1400a3440();
                  local_1ca8 = uVar12;
                  FUN_1400a1c30(uVar12);
                  local_1ca0 = 1;
                  puVar11 = puVar11 + -1;
                  *puVar11 = *puVar11 - 1;
                  if (*puVar11 == 0) {
                    FUN_1400a3530(puVar16);
                  }
                  FUN_1400d1290(uVar12);
                }
                local_1c70 = local_1c90;
                FUN_14019a730(local_1c90);
                if (local_1c88 != 0) {
                  if (local_1c7c < 0) {
                    // WARNING: Subroutine does not return
                    FUN_1400a26d0();
                  }
                  local_1c80 = 0;
                }
                FUN_1400d1290(uVar9);
                puVar13 = local_1d00;
                if (((local_1d00 != (undefined *)0x0) && (local_1d00 != PTR_DAT_1402f8010)) &&
                   (puVar1 = local_1d00 + -8, puVar1 != (undefined *)0x0)) {
                  uVar9 = FUN_1400a3440();
                  local_1ca8 = uVar9;
                  FUN_1400a1c30(uVar9);
                  local_1ca0 = 1;
                  piVar10 = (int *)(puVar13 + -4);
                  *piVar10 = *piVar10 + -1;
                  if (*piVar10 == 0) {
                    FUN_1400a3530(puVar1);
                  }
                  FUN_1400d1290(uVar9);
                }
                local_1d00 = PTR_DAT_1402f8010;
                puVar13 = PTR_DAT_1402f8010;
                if (100 < local_1b18) {
                  operator_delete__(local_1b28);
                  puVar13 = extraout_RAX;
                }
                return (ulonglong)puVar13 & 0xffffffffffffff00;
              }
              FUN_14003d020(local_1c98,local_1d08[0]);
            }
            FUN_140185940(local_1c98,param_2);
            FUN_140185560(local_1c68);
            FUN_140185030(local_1c68);
            if (param_3[9] == 1) {
              cVar4 = FUN_1401981f0(local_1c98,local_1c68,lVar15);
            }
            else {
              cVar4 = FUN_1401a5870(local_1c98,local_1c68,lVar15 + 0x3d0,0);
            }
            if (cVar4 == '\0') {
              FUN_1400a3440();
              local_1d18 = (uint *)PTR_DAT_1402f8010;
              uVar6 = FUN_1400a32c0(L"Encrypt Error");
              uVar17 = 0;
              uVar18 = 0;
              if ((local_1d18 != (uint *)0x0) &&
                 (uVar18 = 0, local_1d18 != (uint *)PTR_DAT_1402f8010)) {
                uVar18 = local_1d18[-2];
              }
              uVar7 = uVar6;
              if ((((int)uVar6 <= (int)uVar18) && (uVar7 = uVar17, local_1d18 != (uint *)0x0)) &&
                 (local_1d18 != (uint *)PTR_DAT_1402f8010)) {
                uVar7 = local_1d18[-2];
              }
              uVar18 = 1;
              if (1 < (int)uVar7) {
                uVar18 = uVar7;
              }
              uVar8 = 0;
              uVar7 = uVar8;
              if ((local_1d18 != (uint *)0x0) && (local_1d18 != (uint *)PTR_DAT_1402f8010)) {
                uVar7 = local_1d18[-2];
              }
              if ((int)uVar7 < (int)uVar18) {
                if (local_1d18 == (uint *)0x0) {
                  local_1d18 = (uint *)PTR_DAT_1402f8010;
                }
                if ((int)uVar18 < 0) {
                    // WARNING: Subroutine does not return
                  FUN_1400a26d0();
                }
                if (uVar18 == 0) {
                  FUN_1400031d0(&local_1d18);
                }
                else {
                  uVar7 = uVar8;
                  if ((local_1d18 != (uint *)0x0) && (local_1d18 != (uint *)PTR_DAT_1402f8010)) {
                    uVar7 = local_1d18[-2];
                  }
                  if (uVar18 != uVar7) {
                    puVar11 = (uint *)FUN_1400a34c0((longlong)(int)uVar18 * 2 + 10);
                    if (puVar11 != (uint *)0x0) {
                      *puVar11 = 0;
                      puVar11[1] = 1;
                    }
                    *puVar11 = uVar18;
                    if ((local_1d18 != (uint *)0x0) && (local_1d18 != (uint *)PTR_DAT_1402f8010)) {
                      uVar8 = local_1d18[-2];
                    }
                    puVar16 = (uint *)PTR_DAT_1402f8010;
                    if ((int)uVar18 < (int)uVar8) {
LAB_14018884c:
                      if (local_1d18 != (uint *)0x0) {
                        puVar16 = local_1d18;
                      }
                    }
                    else {
                      uVar18 = uVar17;
                      if (local_1d18 != (uint *)0x0) {
                        if (local_1d18 != (uint *)PTR_DAT_1402f8010) {
                          uVar18 = local_1d18[-2];
                        }
                        goto LAB_14018884c;
                      }
                    }
                    FUN_1400a32f0(puVar11 + 2,puVar16,uVar18);
                    FUN_1400031d0(&local_1d18);
                    local_1d18 = puVar11 + 2;
                  }
                }
              }
              FUN_140002e30(&local_1d18);
              puVar11 = local_1d18;
              if (local_1d18 == (uint *)0x0) {
                puVar11 = (uint *)PTR_DAT_1402f8010;
              }
              FUN_1400a32f0(puVar11,L"Encrypt Error",uVar6);
              puVar11 = local_1d18;
              if (local_1d18 == (uint *)0x0) {
                puVar11 = (uint *)PTR_DAT_1402f8010;
              }
              uVar6 = FUN_1400a32c0(puVar11);
              uVar17 = 0;
              uVar18 = 0;
              if (0 < (int)uVar6) {
                uVar18 = uVar6;
              }
              uVar6 = uVar17;
              if ((local_1d18 != (uint *)0x0) && (local_1d18 != (uint *)PTR_DAT_1402f8010)) {
                uVar6 = local_1d18[-2];
              }
              if (((int)uVar18 < (int)uVar6) || (uVar18 = uVar17, local_1d18 == (uint *)0x0)) {
LAB_1401888ea:
                if (((local_1d18 != (uint *)PTR_DAT_1402f8010) && (local_1d18 != (uint *)0x0)) &&
                   (local_1d18 + -2 != (uint *)0x0)) {
                  local_1d18[-2] = uVar18;
                  *(undefined2 *)((longlong)local_1d18 + (longlong)(int)uVar18 * 2) = 0;
                }
              }
              else if (local_1d18 != (uint *)PTR_DAT_1402f8010) {
                uVar18 = local_1d18[-2];
                goto LAB_1401888ea;
              }
              local_1cf0 = 0;
              local_1ce8 = 0;
              local_1ce0 = 0;
              local_1cd8 = 0;
              local_1cf8 = Proud::ByteArray::vftable;
              local_1d38 = &local_1cf8;
              uVar12 = FUN_1401416a0(local_1bf0,5,local_1d20);
              (**(code **)(*param_1 + 0x80))(param_1,uVar12);
              FUN_140140df0(&local_1cf8);
              puVar11 = local_1d18;
              if (((local_1d18 != (uint *)0x0) && (local_1d18 != (uint *)PTR_DAT_1402f8010)) &&
                 (puVar16 = local_1d18 + -2, puVar16 != (uint *)0x0)) {
                uVar12 = FUN_1400a3440();
                local_1c30 = uVar12;
                FUN_1400a1c30(uVar12);
                local_1c28 = 1;
                puVar11 = puVar11 + -1;
                *puVar11 = *puVar11 - 1;
                if (*puVar11 == 0) {
                  FUN_1400a3530(puVar16);
                }
                FUN_1400d1290(uVar12);
                local_1c28 = 0;
              }
              local_1d18 = (uint *)PTR_DAT_1402f8010;
              if (*param_3 == 1) {
                (**(code **)(*param_1 + 0xa8))(param_1,local_1d20);
              }
              param_2 = local_1cb0;
              iVar19 = (int)local_1d10;
            }
            else {
              FUN_140185560(local_1bd8);
              FUN_1401851e0(local_1bd8,local_1bb0,0x80);
              uVar12 = 0x24;
              if (*param_3 != 1) {
                uVar12 = 0x25;
              }
              FUN_14003c9e0(local_1bd8,uVar12);
              FUN_14003c9e0(local_1bd8,(char)param_3[9]);
              if (local_1c60 == 0) {
                iVar5 = local_1c50;
                if (local_1c58 == 0) {
                    // WARNING: Subroutine does not return
                  FUN_14019a830();
                }
              }
              else {
                iVar5 = *(int *)(local_1c60 + 0x18);
              }
              FUN_140186930(local_1bd8,(longlong)iVar5);
              local_5c = 200;
              local_60 = 0;
              local_68 = local_ce8;
              local_cec = 200;
              local_cf0 = 0;
              local_cf8 = &local_1978;
              if (local_1bd0 == 0) {
                uVar2 = local_1bc0;
                if (local_1bc8 == 0) {
                    // WARNING: Subroutine does not return
                  FUN_14019a830();
                }
              }
              else {
                uVar2 = *(undefined4 *)(local_1bd0 + 0x18);
              }
              lVar15 = local_1bc8;
              if (local_1bc8 == 0) {
                if (local_1bd0 == 0) {
                    // WARNING: Subroutine does not return
                  FUN_14019a830();
                }
                lVar15 = 0;
                if (*(int *)(local_1bd0 + 0x18) != 0) {
                  lVar15 = *(longlong *)(local_1bd0 + 0x10);
                }
              }
              local_cf0 = 1;
              local_1c10._0_4_ = (undefined4)lVar15;
              local_1c10._4_4_ = (undefined4)((ulonglong)lVar15 >> 0x20);
              local_1978 = (undefined4)local_1c10;
              uStack_1974 = local_1c10._4_4_;
              uStack_196c = uStack_1c04;
              local_1c10 = lVar15;
              uStack_1c08 = uVar2;
              iStack_1970 = uVar2;
              FUN_140145c70(local_ce8,&local_1978);
              if (local_cf8 == (undefined4 *)0x0) {
                FUN_1400a2320(&local_1cf8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
                _CxxThrowException(&local_1cf8,(ThrowInfo *)&DAT_1402f4860);
              }
              if (local_cec < 0) {
                    // WARNING: Subroutine does not return
                FUN_1400a26d0();
              }
              local_cec = 200;
              local_cf0 = 0;
              local_cf8 = &local_1978;
              if (local_1c60 == 0) {
                iVar5 = local_1c50;
                if (local_1c58 == 0) {
                    // WARNING: Subroutine does not return
                  FUN_14019a830();
                }
              }
              else {
                iVar5 = *(int *)(local_1c60 + 0x18);
              }
              lVar15 = local_1c58;
              if (local_1c58 == 0) {
                if (local_1c60 == 0) {
                    // WARNING: Subroutine does not return
                  FUN_14019a830();
                }
                lVar15 = 0;
                if (*(int *)(local_1c60 + 0x18) != 0) {
                  lVar15 = *(longlong *)(local_1c60 + 0x10);
                }
              }
              local_cf0 = 1;
              local_1c00._0_4_ = (undefined4)lVar15;
              local_1c00._4_4_ = (undefined4)((ulonglong)lVar15 >> 0x20);
              local_1978 = (undefined4)local_1c00;
              uStack_1974 = local_1c00._4_4_;
              uStack_196c = uStack_1bf4;
              local_1c00 = lVar15;
              iStack_1bf8 = iVar5;
              iStack_1970 = iVar5;
              FUN_140145c70(local_ce8,&local_1978);
              if (local_cf8 == (undefined4 *)0x0) {
                FUN_1400a2320(&local_1cf8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
                _CxxThrowException(&local_1cf8,(ThrowInfo *)&DAT_1402f4860);
              }
              if (local_cec < 0) {
                    // WARNING: Subroutine does not return
                FUN_1400a26d0();
              }
              local_1d38 = (undefined ***)CONCAT44(local_1d38._4_4_,1);
              bVar3 = (**(code **)(*param_1 + 0x78))(param_1,local_ce8,param_3);
              if (local_68 == (undefined1 *)0x0) {
                FUN_1400a2320(&local_1cf8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
                _CxxThrowException(&local_1cf8,(ThrowInfo *)&DAT_1402f4860);
              }
              if (local_5c < 0) {
                    // WARNING: Subroutine does not return
                FUN_1400a26d0();
              }
              local_60 = 0;
              local_1d10 = &local_1bd0;
              FUN_14019a730(&local_1bd0);
              if ((local_1bc8 != 0) && (local_1bbc < 0)) {
                    // WARNING: Subroutine does not return
                FUN_1400a26d0();
              }
            }
            local_1d10 = &local_1c60;
            FUN_14019a730(&local_1c60);
            if (local_1c58 != 0) {
              if (local_1c4c < 0) {
                    // WARNING: Subroutine does not return
                FUN_1400a26d0();
              }
              local_1c50 = 0;
            }
            local_1d10 = (longlong *)local_1c90;
            FUN_14019a730(local_1c90);
            if (local_1c88 != 0) {
              if (local_1c7c < 0) {
                    // WARNING: Subroutine does not return
                FUN_1400a26d0();
              }
              local_1c80 = 0;
            }
            FUN_1400d1290(uVar9);
            local_1c18 = 0;
          }
        }
        iVar19 = iVar19 + 1;
        local_1d10 = (longlong *)CONCAT44(local_1d10._4_4_,iVar19);
        lVar15 = (longlong)iVar19;
      } while (lVar15 < local_1b20);
    }
    FUN_1400031d0(&local_1d00);
    if (100 < local_1b18) {
      operator_delete__(local_1b28);
    }
    uVar14 = (ulonglong)bVar3;
  }
  return uVar14;
}



undefined8 FUN_140189170(longlong *param_1,int param_2,int *param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  char cVar4;
  int iVar5;
  uint uVar6;
  uint uVar7;
  longlong lVar8;
  undefined8 uVar9;
  uint *puVar10;
  undefined8 uVar11;
  uint *puVar12;
  uint uVar13;
  uint uVar14;
  uint uVar15;
  short local_res18 [4];
  undefined8 local_res20;
  uint *local_b8;
  undefined *local_b0;
  undefined8 local_a8;
  undefined1 local_a0;
  short local_98 [4];
  undefined **local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 local_70;
  int local_68;
  int local_64;
  undefined8 local_60;
  undefined1 local_58;
  undefined1 local_50 [8];
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  iVar5 = (int)(*param_3 + (*param_3 >> 0x1f & 7U)) >> 3;
  local_res20 = param_4;
  local_68 = iVar5;
  cVar4 = FUN_140185dc0(param_3,&local_64);
  if ((cVar4 == '\0') || (cVar4 = FUN_140185b30(param_3,local_res18), cVar4 == '\0')) {
    FUN_140185160(param_3,iVar5);
    return 0;
  }
  FUN_1400a3440();
  local_b0 = PTR_DAT_1402f8010;
  lVar8 = (**(code **)(*param_1 + 0xc0))(param_1,param_3[10],&local_b0);
  if (((lVar8 == 0) || (local_64 == 0)) || (local_64 == 3)) goto LAB_1401898f5;
  if (local_64 == 1) {
    cVar4 = FUN_140197c40(param_3,param_4,lVar8,(int)((*param_3 >> 0x1f & 7U) + *param_3) >> 3);
LAB_14018926e:
    if (cVar4 == '\0') {
LAB_1401898f5:
      uVar9 = (**(code **)(*param_1 + 0x58))(param_1);
      local_a8 = uVar9;
      FUN_1400a1c30(uVar9);
      local_a0 = 1;
      if (DAT_140313fcf != '\0') {
        (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetCoreImpl::ProcessMessage_Encrypted");
      }
      FUN_14003c890(&local_b0,L" decrypt failed");
      local_88 = 0;
      local_80 = 0;
      local_78 = 0;
      local_70 = 0;
      local_90 = Proud::ByteArray::vftable;
      uVar11 = FUN_1401416a0(local_res18,6,param_3[10],&local_b0,&local_90);
      (**(code **)(*param_1 + 0x80))(param_1,uVar11);
      FUN_140140df0(&local_90);
      FUN_140185160(param_3,iVar5);
      FUN_1400d1290(uVar9);
      puVar3 = local_b0;
      if (local_b0 == (undefined *)0x0) {
        return 0;
      }
      if (local_b0 == PTR_DAT_1402f8010) {
        return 0;
      }
      puVar1 = local_b0 + -8;
      if (puVar1 == (undefined *)0x0) {
        return 0;
      }
      uVar9 = FUN_1400a3440();
      local_a8 = uVar9;
      FUN_1400a1c30(uVar9);
      local_a0 = 1;
      piVar2 = (int *)(puVar3 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar9);
      return 0;
    }
  }
  else if (local_64 == 2) {
    cVar4 = FUN_1401a5b50(param_3,param_4,lVar8 + 0x3d0,
                          (int)((*param_3 >> 0x1f & 7U) + *param_3) >> 3);
    goto LAB_14018926e;
  }
  if (param_2 != 0x24) {
LAB_1401898a5:
    puVar3 = local_b0;
    if (((local_b0 != (undefined *)0x0) && (local_b0 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_b0 + -8, puVar1 != (undefined *)0x0)) {
      uVar9 = FUN_1400a3440();
      local_a8 = uVar9;
      FUN_1400a1c30(uVar9);
      local_a0 = 1;
      piVar2 = (int *)(puVar3 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar9);
    }
    return 1;
  }
  cVar4 = FUN_140185490(param_4,local_98,2);
  if (cVar4 != '\0') {
    cVar4 = (**(code **)(*param_1 + 0xb0))(param_1,param_3[10],local_res18);
    lVar8 = *param_1;
    if (cVar4 == '\0') {
      uVar9 = (**(code **)(lVar8 + 0x58))();
      local_a8 = uVar9;
      FUN_1400a1c30(uVar9);
      local_a0 = 1;
      if (DAT_140313fcf != '\0') {
        (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetCoreImpl::ProcessMessage_Encrypted");
      }
      FUN_1400a3440();
      local_b8 = (uint *)PTR_DAT_1402f8010;
      FUN_14003c600(&local_b8,L"GetExpectedDecryptCount failed!!");
      local_88 = 0;
      local_80 = 0;
      local_78 = 0;
      local_70 = 0;
      local_90 = Proud::ByteArray::vftable;
      uVar11 = FUN_1401416a0(local_50,6,param_3[10],&local_b8,&local_90);
      (**(code **)(*param_1 + 0x80))(param_1,uVar11);
      FUN_140140df0(&local_90);
      FUN_140185160(param_4,iVar5);
      puVar10 = local_b8;
      if (((local_b8 != (uint *)0x0) && (local_b8 != (uint *)PTR_DAT_1402f8010)) &&
         (puVar12 = local_b8 + -2, puVar12 != (uint *)0x0)) {
        uVar11 = FUN_1400a3440();
        local_60 = uVar11;
        FUN_1400a1c30(uVar11);
        local_58 = 1;
        puVar10 = puVar10 + -1;
        *puVar10 = *puVar10 - 1;
        if (*puVar10 == 0) {
          FUN_1400a3530(puVar12);
        }
        FUN_1400d1290(uVar11);
      }
      local_b8 = (uint *)PTR_DAT_1402f8010;
      FUN_1400d1290(uVar9);
      puVar3 = local_b0;
      if (local_b0 == (undefined *)0x0) {
        return 0;
      }
      if (local_b0 == PTR_DAT_1402f8010) {
        return 0;
      }
      puVar1 = local_b0 + -8;
      if (puVar1 == (undefined *)0x0) {
        return 0;
      }
      uVar9 = FUN_1400a3440();
      local_a8 = uVar9;
      FUN_1400a1c30(uVar9);
      local_a0 = 1;
      piVar2 = (int *)(puVar3 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar9);
      return 0;
    }
    if (local_98[0] != local_res18[0]) {
      uVar9 = (**(code **)(lVar8 + 0x58))();
      local_a8 = uVar9;
      FUN_1400a1c30(uVar9);
      local_a0 = 1;
      if (DAT_140313fcf != '\0') {
        (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetCoreImpl::ProcessMessage_Encrypted");
      }
      FUN_1400a3440();
      local_b8 = (uint *)PTR_DAT_1402f8010;
      FUN_14003c600(&local_b8,L"decryptCount1(%d) != decryptCount2(%d)",local_98[0],local_res18[0]);
      local_88 = 0;
      local_80 = 0;
      local_78 = 0;
      local_70 = 0;
      local_90 = Proud::ByteArray::vftable;
      uVar11 = FUN_1401416a0(local_50,6,param_3[10],&local_b8,&local_90);
      (**(code **)(*param_1 + 0x80))(param_1,uVar11);
      FUN_140140df0(&local_90);
      FUN_140185160(param_4,iVar5);
      puVar10 = local_b8;
      if (((local_b8 != (uint *)0x0) && (local_b8 != (uint *)PTR_DAT_1402f8010)) &&
         (puVar12 = local_b8 + -2, puVar12 != (uint *)0x0)) {
        uVar11 = FUN_1400a3440();
        local_60 = uVar11;
        FUN_1400a1c30(uVar11);
        local_58 = 1;
        puVar10 = puVar10 + -1;
        *puVar10 = *puVar10 - 1;
        if (*puVar10 == 0) {
          FUN_1400a3530(puVar12);
        }
        FUN_1400d1290(uVar11);
      }
      local_b8 = (uint *)PTR_DAT_1402f8010;
      FUN_1400d1290(uVar9);
      puVar3 = local_b0;
      if (local_b0 == (undefined *)0x0) {
        return 0;
      }
      if (local_b0 == PTR_DAT_1402f8010) {
        return 0;
      }
      puVar1 = local_b0 + -8;
      if (puVar1 == (undefined *)0x0) {
        return 0;
      }
      uVar9 = FUN_1400a3440();
      local_a8 = uVar9;
      FUN_1400a1c30(uVar9);
      local_a0 = 1;
      piVar2 = (int *)(puVar3 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar9);
      return 0;
    }
    (**(code **)(lVar8 + 0xb8))(param_1,param_3[10]);
    goto LAB_1401898a5;
  }
  uVar9 = (**(code **)(*param_1 + 0x58))();
  local_60 = uVar9;
  FUN_1400a1c30(uVar9);
  local_58 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetCoreImpl::ProcessMessage_Encrypted");
  }
  FUN_1400a3440();
  local_b8 = (uint *)PTR_DAT_1402f8010;
  uVar6 = FUN_1400a32c0(L"decryptCount1 read failed!!");
  uVar13 = 0;
  uVar15 = 0;
  if ((local_b8 != (uint *)0x0) && (uVar15 = 0, local_b8 != (uint *)PTR_DAT_1402f8010)) {
    uVar15 = local_b8[-2];
  }
  uVar7 = uVar6;
  if ((((int)uVar6 <= (int)uVar15) && (uVar7 = uVar13, local_b8 != (uint *)0x0)) &&
     (local_b8 != (uint *)PTR_DAT_1402f8010)) {
    uVar7 = local_b8[-2];
  }
  uVar15 = 1;
  if (1 < (int)uVar7) {
    uVar15 = uVar7;
  }
  uVar7 = uVar13;
  if ((local_b8 != (uint *)0x0) && (local_b8 != (uint *)PTR_DAT_1402f8010)) {
    uVar7 = local_b8[-2];
  }
  uVar14 = 0;
  if ((int)uVar7 < (int)uVar15) {
    if (local_b8 == (uint *)0x0) {
      local_b8 = (uint *)PTR_DAT_1402f8010;
    }
    if ((int)uVar15 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar15 == 0) {
      FUN_1400031d0(&local_b8);
    }
    else {
      uVar7 = uVar13;
      if ((local_b8 != (uint *)0x0) && (local_b8 != (uint *)PTR_DAT_1402f8010)) {
        uVar7 = local_b8[-2];
      }
      if (uVar15 != uVar7) {
        puVar10 = (uint *)FUN_1400a34c0((longlong)(int)uVar15 * 2 + 10);
        if (puVar10 != (uint *)0x0) {
          *puVar10 = 0;
          puVar10[1] = 1;
        }
        *puVar10 = uVar15;
        uVar7 = uVar14;
        if ((local_b8 != (uint *)0x0) && (local_b8 != (uint *)PTR_DAT_1402f8010)) {
          uVar7 = local_b8[-2];
        }
        puVar12 = (uint *)PTR_DAT_1402f8010;
        if ((int)uVar15 < (int)uVar7) {
LAB_1401893d5:
          if (local_b8 != (uint *)0x0) {
            puVar12 = local_b8;
          }
        }
        else {
          uVar15 = uVar13;
          if (local_b8 != (uint *)0x0) {
            if (local_b8 != (uint *)PTR_DAT_1402f8010) {
              uVar15 = local_b8[-2];
            }
            goto LAB_1401893d5;
          }
        }
        FUN_1400a32f0(puVar10 + 2,puVar12,uVar15);
        FUN_1400031d0(&local_b8);
        local_b8 = puVar10 + 2;
      }
    }
  }
  FUN_140002e30(&local_b8);
  puVar10 = local_b8;
  if (local_b8 == (uint *)0x0) {
    puVar10 = (uint *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar10,L"decryptCount1 read failed!!",uVar6);
  puVar10 = local_b8;
  if (local_b8 == (uint *)0x0) {
    puVar10 = (uint *)PTR_DAT_1402f8010;
  }
  uVar6 = FUN_1400a32c0(puVar10);
  uVar15 = 0;
  if (0 < (int)uVar6) {
    uVar15 = uVar6;
  }
  uVar6 = uVar14;
  if ((local_b8 != (uint *)0x0) && (local_b8 != (uint *)PTR_DAT_1402f8010)) {
    uVar6 = local_b8[-2];
  }
  if (((int)uVar6 <= (int)uVar15) && (uVar15 = uVar14, local_b8 != (uint *)0x0)) {
    if (local_b8 == (uint *)PTR_DAT_1402f8010) goto LAB_140189485;
    uVar15 = local_b8[-2];
  }
  if (((local_b8 != (uint *)PTR_DAT_1402f8010) && (local_b8 != (uint *)0x0)) &&
     (local_b8 + -2 != (uint *)0x0)) {
    local_b8[-2] = uVar15;
    *(undefined2 *)((longlong)local_b8 + (longlong)(int)uVar15 * 2) = 0;
  }
LAB_140189485:
  local_88 = 0;
  local_80 = 0;
  local_78 = 0;
  local_70 = 0;
  local_90 = Proud::ByteArray::vftable;
  uVar11 = FUN_1401416a0(local_50,6,param_3[10],&local_b8,&local_90);
  (**(code **)(*param_1 + 0x80))(param_1,uVar11);
  FUN_140140df0(&local_90);
  puVar10 = local_b8;
  if (((local_b8 != (uint *)0x0) && (local_b8 != (uint *)PTR_DAT_1402f8010)) &&
     (puVar12 = local_b8 + -2, puVar12 != (uint *)0x0)) {
    uVar11 = FUN_1400a3440();
    local_a8 = uVar11;
    FUN_1400a1c30(uVar11);
    local_a0 = 1;
    puVar10 = puVar10 + -1;
    *puVar10 = *puVar10 - 1;
    if (*puVar10 == 0) {
      FUN_1400a3530(puVar12);
    }
    FUN_1400d1290(uVar11);
  }
  FUN_140185160(local_res20,local_68);
  FUN_1400d1290(uVar9);
  puVar3 = local_b0;
  if (((local_b0 != (undefined *)0x0) && (local_b0 != PTR_DAT_1402f8010)) &&
     (puVar1 = local_b0 + -8, puVar1 != (undefined *)0x0)) {
    uVar9 = FUN_1400a3440();
    local_a8 = uVar9;
    FUN_1400a1c30(uVar9);
    local_a0 = 1;
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar9);
  }
  return 0;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_140189a20(longlong *param_1,undefined8 param_2,longlong param_3,undefined4 *param_4,
                       undefined4 param_5)

{
  int *piVar1;
  undefined *puVar2;
  byte bVar3;
  int iVar4;
  uint uVar5;
  uint uVar6;
  uint *puVar7;
  undefined8 uVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  uint *puVar11;
  undefined4 uVar12;
  uint uVar13;
  ulonglong uVar14;
  undefined *puVar15;
  undefined1 auStack_1b18 [32];
  undefined ***local_1af8;
  uint *local_1ae8;
  longlong *local_1ae0;
  int local_1ad8 [2];
  undefined1 local_1ad0 [8];
  longlong local_1ac8;
  ulonglong local_1ac0;
  int local_1ab8;
  int local_1ab4;
  undefined1 local_1aa8 [8];
  longlong local_1aa0;
  ulonglong local_1a98;
  undefined4 local_1a90;
  int local_1a8c;
  undefined4 *local_1a80;
  longlong local_1a78;
  undefined *local_1a70;
  undefined8 local_1a68;
  undefined1 local_1a60;
  undefined **local_1a58;
  undefined8 local_1a50;
  undefined8 local_1a48;
  undefined8 local_1a40;
  undefined8 local_1a38;
  undefined8 local_1a30;
  undefined1 local_1a28 [8];
  longlong local_1a20;
  longlong local_1a18;
  undefined4 local_1a10;
  int local_1a0c;
  undefined1 local_1a00 [136];
  undefined1 local_1978 [3200];
  undefined1 *local_cf8;
  undefined4 local_cf0;
  undefined4 local_cec;
  undefined1 local_ce8 [3216];
  ulonglong local_58;
  undefined8 uStack_48;
  
  uStack_48 = 0x140189a3f;
  local_1a30 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_1b18;
  local_1a80 = param_4;
  local_1a78 = param_3;
  if ((*(int *)(param_3 + 0x28) == 0) || (iVar4 = FUN_1401a7030(param_2), iVar4 < 0x33))
  goto LAB_14018a0d6;
  FUN_140185560(local_1aa8);
  FUN_140185030(local_1aa8);
  FUN_140185940(local_1aa8,param_2);
  if (local_1aa0 == 0) {
    uVar12 = local_1a90;
    if (local_1a98 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else {
    uVar12 = *(undefined4 *)(local_1aa0 + 0x18);
  }
  FUN_140185560(local_1ad0);
  FUN_140185030(local_1ad0);
  FUN_1401856c0(local_1ad0,uVar12);
  local_1ad8[0] = FUN_1401bf280(uVar12);
  uVar9 = 0;
  uVar14 = local_1a98;
  if (local_1a98 == 0) {
    if (local_1aa0 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    uVar14 = uVar9;
    if (*(int *)(local_1aa0 + 0x18) != 0) {
      uVar14 = *(ulonglong *)(local_1aa0 + 0x10);
    }
  }
  uVar10 = local_1ac0;
  if (local_1ac0 == 0) {
    if (local_1ac8 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    uVar10 = uVar9;
    if (*(int *)(local_1ac8 + 0x18) != 0) {
      uVar10 = *(ulonglong *)(local_1ac8 + 0x10);
    }
  }
  iVar4 = FUN_1401bf0f0(uVar10,local_1ad8,uVar14,uVar12);
  if (iVar4 == 0) {
    uVar5 = FUN_1401a7030(param_2);
    if (local_1ad8[0] + 9U < uVar5) {
      FUN_1401856c0(local_1ad0);
      FUN_140185560(local_1a28);
      FUN_1401851e0(local_1a28,local_1a00,0x80);
      FUN_14003c9e0(local_1a28,0x26);
      if (local_1ac8 == 0) {
        iVar4 = local_1ab8;
        if (local_1ac0 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
      }
      else {
        iVar4 = *(int *)(local_1ac8 + 0x18);
      }
      FUN_140186930(local_1a28,(longlong)iVar4);
      iVar4 = FUN_1401a7030(param_2);
      FUN_140186930(local_1a28,(longlong)iVar4);
      local_cec = 200;
      local_cf0 = 0;
      local_cf8 = local_1978;
      FUN_140146970(local_ce8,local_1a28);
      FUN_140145c70(local_1978,local_ce8);
      FUN_140145b60(local_ce8);
      FUN_140146970(local_ce8,local_1ad0);
      FUN_140145c70(local_1978,local_ce8);
      FUN_140145b60(local_ce8);
      local_1af8 = (undefined ***)CONCAT44(local_1af8._4_4_,param_5);
      bVar3 = FUN_140188290(param_1,local_1978,local_1a78,param_4);
      FUN_140145b60(local_1978);
      local_1ae0 = &local_1a20;
      FUN_14019a730(&local_1a20);
      if (local_1a18 != 0) {
        if (local_1a0c < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        local_1a10 = 0;
      }
      local_1ae0 = &local_1ac8;
      FUN_14019a730(&local_1ac8);
      if (local_1ac0 != 0) {
        if (local_1ab4 < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        local_1ab8 = 0;
      }
      local_1ae0 = &local_1aa0;
      FUN_14019a730(&local_1aa0);
      if ((local_1a98 != 0) && (local_1a8c < 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      return (ulonglong)bVar3;
    }
    local_1ae0 = &local_1ac8;
    FUN_14019a730(&local_1ac8);
    if (local_1ac0 != 0) {
      if (local_1ab4 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_1ab8 = 0;
    }
    local_1ae0 = &local_1aa0;
    FUN_14019a730(&local_1aa0);
    if ((local_1a98 != 0) && (local_1a8c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    goto LAB_14018a0d6;
  }
  FUN_1400a3440();
  local_1a70 = PTR_DAT_1402f8010;
  FUN_14003c600(&local_1a70,L"Packet compression failed! Error code=%d",iVar4);
  puVar2 = local_1a70;
  puVar15 = local_1a70;
  if (local_1a70 == (undefined *)0x0) {
    puVar15 = PTR_DAT_1402f8010;
  }
  FUN_1400a3440();
  local_1ae8 = (uint *)PTR_DAT_1402f8010;
  uVar5 = FUN_1400a32c0(puVar15);
  if ((local_1ae8 != (uint *)0x0) && (uVar9 = 0, local_1ae8 != (uint *)PTR_DAT_1402f8010)) {
    uVar9 = (ulonglong)local_1ae8[-2];
  }
  uVar6 = uVar5;
  if ((((int)uVar5 <= (int)uVar9) && (uVar6 = 0, local_1ae8 != (uint *)0x0)) &&
     (uVar6 = 0, local_1ae8 != (uint *)PTR_DAT_1402f8010)) {
    uVar6 = local_1ae8[-2];
  }
  uVar13 = 1;
  if (1 < (int)uVar6) {
    uVar13 = uVar6;
  }
  if (local_1ae8 == (uint *)0x0) {
    uVar6 = 0;
  }
  else if (local_1ae8 == (uint *)PTR_DAT_1402f8010) {
    uVar6 = 0;
  }
  else {
    uVar6 = local_1ae8[-2];
  }
  if ((int)uVar6 < (int)uVar13) {
    if (local_1ae8 == (uint *)0x0) {
      local_1ae8 = (uint *)PTR_DAT_1402f8010;
    }
    if ((int)uVar13 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar13 == 0) {
      FUN_1400031d0(&local_1ae8);
    }
    else {
      if (local_1ae8 == (uint *)0x0) {
        uVar6 = 0;
      }
      else if (local_1ae8 == (uint *)PTR_DAT_1402f8010) {
        uVar6 = 0;
      }
      else {
        uVar6 = local_1ae8[-2];
      }
      if (uVar13 != uVar6) {
        puVar7 = (uint *)FUN_1400a34c0((longlong)(int)uVar13 * 2 + 10);
        if (puVar7 != (uint *)0x0) {
          *puVar7 = 0;
          puVar7[1] = 1;
        }
        *puVar7 = uVar13;
        if (local_1ae8 == (uint *)0x0) {
          uVar6 = 0;
        }
        else if (local_1ae8 == (uint *)PTR_DAT_1402f8010) {
          uVar6 = 0;
        }
        else {
          uVar6 = local_1ae8[-2];
        }
        puVar11 = (uint *)PTR_DAT_1402f8010;
        if ((int)uVar13 < (int)uVar6) {
LAB_140189ca5:
          if (local_1ae8 != (uint *)0x0) {
            puVar11 = local_1ae8;
          }
        }
        else {
          if (local_1ae8 != (uint *)0x0) {
            if (local_1ae8 == (uint *)PTR_DAT_1402f8010) {
              uVar13 = 0;
            }
            else {
              uVar13 = local_1ae8[-2];
            }
            goto LAB_140189ca5;
          }
          uVar13 = 0;
        }
        FUN_1400a32f0(puVar7 + 2,puVar11,uVar13);
        FUN_1400031d0(&local_1ae8);
        param_4 = local_1a80;
        local_1ae8 = puVar7 + 2;
      }
    }
  }
  FUN_140002e30(&local_1ae8);
  puVar7 = local_1ae8;
  if (local_1ae8 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar7,puVar15,uVar5);
  puVar7 = local_1ae8;
  if (local_1ae8 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1402f8010;
  }
  uVar6 = FUN_1400a32c0(puVar7);
  uVar13 = 0;
  uVar5 = 0;
  if (0 < (int)uVar6) {
    uVar5 = uVar6;
  }
  uVar6 = uVar13;
  if ((local_1ae8 != (uint *)0x0) && (local_1ae8 != (uint *)PTR_DAT_1402f8010)) {
    uVar6 = local_1ae8[-2];
  }
  if (((int)uVar5 < (int)uVar6) || (uVar5 = uVar13, local_1ae8 == (uint *)0x0)) {
LAB_140189d40:
    if (((local_1ae8 != (uint *)PTR_DAT_1402f8010) && (local_1ae8 != (uint *)0x0)) &&
       (local_1ae8 + -2 != (uint *)0x0)) {
      local_1ae8[-2] = uVar5;
      *(undefined2 *)((longlong)local_1ae8 + (longlong)(int)uVar5 * 2) = 0;
    }
  }
  else if (local_1ae8 != (uint *)PTR_DAT_1402f8010) {
    uVar5 = local_1ae8[-2];
    goto LAB_140189d40;
  }
  local_1a50 = 0;
  local_1a48 = 0;
  local_1a40 = 0;
  local_1a38 = 0;
  local_1a58 = Proud::ByteArray::vftable;
  local_1af8 = &local_1a58;
  uVar8 = FUN_1401416a0(&local_1ae0,0x27,*param_4,&local_1ae8);
  (**(code **)(*param_1 + 0x80))(param_1,uVar8);
  FUN_140140df0(&local_1a58);
  puVar7 = local_1ae8;
  if (((local_1ae8 != (uint *)0x0) && (local_1ae8 != (uint *)PTR_DAT_1402f8010)) &&
     (puVar11 = local_1ae8 + -2, puVar11 != (uint *)0x0)) {
    uVar8 = FUN_1400a3440();
    local_1a68 = uVar8;
    FUN_1400a1c30(uVar8);
    local_1a60 = 1;
    puVar7 = puVar7 + -1;
    *puVar7 = *puVar7 - 1;
    if (*puVar7 == 0) {
      FUN_1400a3530(puVar11);
    }
    FUN_1400d1290(uVar8);
  }
  if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8010)) &&
     (puVar2 + -8 != (undefined *)0x0)) {
    uVar8 = FUN_1400a3440();
    local_1a68 = uVar8;
    FUN_1400a1c30(uVar8);
    local_1a60 = 1;
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2 + -8);
    }
    FUN_1400d1290(uVar8);
  }
  local_1ae0 = &local_1ac8;
  FUN_14019a730(&local_1ac8);
  if (local_1ac0 != 0) {
    if (local_1ab4 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_1ab8 = 0;
  }
  local_1ae0 = &local_1aa0;
  FUN_14019a730(&local_1aa0);
  param_4 = local_1a80;
  if ((local_1a98 != 0) && (local_1a8c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
LAB_14018a0d6:
  local_1af8 = (undefined ***)CONCAT44(local_1af8._4_4_,param_5);
  uVar9 = FUN_140188290(param_1,param_2,local_1a78,param_4);
  return uVar9;
}



undefined8 * FUN_14018a120(undefined8 *param_1)

{
  *(undefined2 *)(param_1 + 1) = 0;
  param_1[2] = 0;
  *param_1 = Proud::IRmiStub::vftable;
  *(undefined2 *)(param_1 + 3) = 0;
  *(undefined1 *)((longlong)param_1 + 0x1a) = 0;
  return param_1;
}



void FUN_14018a150(undefined8 *param_1)

{
  *param_1 = Proud::IRmiStub::vftable;
  if (param_1[2] != 0) {
    FUN_1400a2b50(
                 L"RMI Stub which is still in use by ProudNet core cannot be destroyed! Destroy CNetClient or CNetServer instance first."
                 );
  }
  return;
}



undefined8 * FUN_14018a180(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::IRmiStub::vftable;
  if (param_1[2] != 0) {
    FUN_1400a2b50(
                 L"RMI Stub which is still in use by ProudNet core cannot be destroyed! Destroy CNetClient or CNetServer instance first."
                 );
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_14018a1d0(undefined8 *param_1)

{
  *param_1 = Proud::CTestUdpConnReset::vftable;
  param_1[1] = 0;
  memset(param_1 + 2,0,100);
  return param_1;
}



void FUN_14018a210(undefined8 *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  
  *param_1 = Proud::CTestUdpConnReset::vftable;
  if (param_1[1] != 0) {
    *(longlong *)(param_1[1] + 8) = *(longlong *)(param_1[1] + 8) + -1;
    if (*(longlong *)(param_1[1] + 8) == 0) {
      plVar1 = (longlong *)param_1[1];
      lVar2 = *plVar1;
      if (lVar2 != 0) {
        FUN_1400a8cc0(lVar2);
        FUN_1400a3530(lVar2);
      }
      FUN_1400a3530(plVar1);
    }
  }
  *param_1 = Proud::IFastSocketDelegate::vftable;
  return;
}



void * FUN_14018a2a0(void *param_1,uint param_2)

{
  FUN_14018a210();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14018a2d0(undefined8 *param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014018a2d3. Too many branches
                    // WARNING: Treating indirect jump as call
  CloseHandle((HANDLE)*param_1);
  return;
}



void thunk_FUN_1400a3530(LPVOID param_1)

{
  HANDLE hHeap;
  
  hHeap = GetProcessHeap();
                    // WARNING: Could not recover jumptable at 0x0001400a354c. Too many branches
                    // WARNING: Treating indirect jump as call
  HeapFree(hHeap,0,param_1);
  return;
}



void FUN_14018a2f0(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    FUN_1400a8cc0(lVar1);
    FUN_1400a3530(lVar1);
  }
  return;
}



void FUN_14018a320(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if ((longlong *)param_2[2] != param_1) {
    FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                  L"Proud::CListNode<class Proud::ITaskSubject::CNode>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  plVar1 = (longlong *)param_2[1];
  lVar2 = *param_2;
  if (plVar1 != (longlong *)0x0) {
    *plVar1 = lVar2;
  }
  if (lVar2 != 0) {
    *(longlong **)(lVar2 + 8) = plVar1;
  }
  if (plVar1 == (longlong *)0x0) {
    if ((longlong *)param_1[1] != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::ITaskSubject::CNode>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if ((longlong *)*param_1 != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::ITaskSubject::CNode>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    *param_1 = (longlong)plVar1;
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  *(int *)(param_1 + 2) = (int)param_1[2] + -1;
  return;
}



int FUN_14018a400(longlong param_1,int param_2)

{
  uint uVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  
  iVar4 = *(int *)(param_1 + 0x24);
  if (iVar4 == 0) {
    iVar2 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
    iVar4 = 0x400;
    if (iVar2 < 0x400) {
      iVar4 = iVar2;
    }
    iVar2 = 4;
    if (4 < iVar4) {
      iVar2 = iVar4;
    }
    iVar4 = iVar2 + param_2;
    if (iVar2 + param_2 < *(int *)(param_1 + 0x20)) {
      iVar4 = *(int *)(param_1 + 0x20);
    }
    return iVar4;
  }
  if (iVar4 != 1) {
    if (iVar4 != 2) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (param_2 < *(int *)(param_1 + 0x20)) {
      param_2 = *(int *)(param_1 + 0x20);
    }
    return param_2;
  }
  uVar1 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
  uVar3 = 0x10;
  if (0x10 < (int)uVar1) {
    uVar3 = uVar1;
  }
  if (uVar3 < 2) {
    uVar3 = 1;
  }
  iVar4 = uVar3 + param_2;
  if ((int)(uVar3 + param_2) < *(int *)(param_1 + 0x20)) {
    iVar4 = *(int *)(param_1 + 0x20);
  }
  return iVar4;
}



int FUN_14018a4a0(longlong param_1,int param_2)

{
  uint uVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  
  iVar4 = *(int *)(param_1 + 0x24);
  if (iVar4 == 0) {
    iVar2 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
    iVar4 = 0x400;
    if (iVar2 < 0x400) {
      iVar4 = iVar2;
    }
    iVar2 = 4;
    if (4 < iVar4) {
      iVar2 = iVar4;
    }
    iVar4 = iVar2 + param_2;
    if (iVar2 + param_2 < *(int *)(param_1 + 0x20)) {
      iVar4 = *(int *)(param_1 + 0x20);
    }
    return iVar4;
  }
  if (iVar4 != 1) {
    if (iVar4 != 2) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (param_2 < *(int *)(param_1 + 0x20)) {
      param_2 = *(int *)(param_1 + 0x20);
    }
    return param_2;
  }
  uVar1 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
  uVar3 = 0x10;
  if (0x10 < (int)uVar1) {
    uVar3 = uVar1;
  }
  if (uVar3 < 0x41) {
    uVar3 = 0x40;
  }
  iVar4 = uVar3 + param_2;
  if ((int)(uVar3 + param_2) < *(int *)(param_1 + 0x20)) {
    iVar4 = *(int *)(param_1 + 0x20);
  }
  return iVar4;
}



void FUN_14018a540(longlong param_1,longlong param_2)

{
  undefined2 *puVar1;
  int iVar2;
  
  iVar2 = 0;
  if (0 < param_2) {
    puVar1 = (undefined2 *)(param_1 + 0x34);
    do {
      if ((undefined8 *)(puVar1 + -0x1a) != (undefined8 *)0x0) {
        *(undefined ***)(puVar1 + -6) = Proud::AddrPort::vftable;
        *(undefined4 *)(puVar1 + -2) = 0;
        *puVar1 = 0;
        *(undefined8 *)(puVar1 + -0x1a) = 0;
        *(undefined8 *)(puVar1 + -0xe) = 0;
        *(undefined8 *)(puVar1 + -0x16) = 0;
        *(undefined4 *)(puVar1 + -0x12) = 5;
        *(undefined4 *)(puVar1 + -10) = 0;
        *(undefined4 *)(puVar1 + -2) = DAT_1402f83d0;
        *puVar1 = DAT_1402f83d4;
      }
      iVar2 = iVar2 + 1;
      puVar1 = puVar1 + 0x1c;
    } while (iVar2 < param_2);
  }
  return;
}



void FUN_14018a5b0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  FUN_1401bd070(param_1 + 0x188,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0),param_3,
                param_4,0xfffffffffffffffe);
  if (*(char *)(param_1 + 0x198) == '\x01') {
    FUN_1401502c0(*(undefined8 *)(param_1 + 0x148));
  }
  FUN_1401bd070(param_1 + 0x1a0,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0));
  if (*(char *)(param_1 + 0x1b0) == '\x01') {
    FUN_140161fb0(*(undefined8 *)(param_1 + 0x148));
  }
  FUN_1401bd070(param_1 + 0x1b8,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0));
  if (*(char *)(param_1 + 0x1c8) == '\x01') {
    FUN_140168610(*(undefined8 *)(param_1 + 0x148));
  }
  FUN_1401bd070(param_1 + 0x1d0,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0));
  if (*(char *)(param_1 + 0x1e0) == '\x01') {
    FUN_140151c50(*(undefined8 *)(param_1 + 0x148));
  }
  FUN_1401bd070(param_1 + 0xa0,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0));
  if (*(char *)(param_1 + 0xb0) == '\x01') {
    FUN_140147150(*(undefined8 *)(param_1 + 0x148));
  }
  FUN_1401bd070(param_1 + 0xb8,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0));
  if (*(char *)(param_1 + 200) == '\x01') {
    FUN_140168e90(*(undefined8 *)(param_1 + 0x148));
  }
  FUN_1401bd070(param_1 + 0x248,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0));
  if (*(char *)(param_1 + 600) == '\x01') {
    uVar1 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    FUN_1400a1c30(uVar1);
    if (DAT_140313fcf != '\0') {
      (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                (*(longlong **)(param_1 + 0x148),L"Proud::CNetThreads_S::Heartbeat_One");
    }
    uVar2 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x118) + 8))();
    FUN_14015a240(*(longlong *)(param_1 + 0x148) + 0x2d8,uVar2);
    FUN_1400d1290(uVar1);
  }
  if (*(int *)(*(longlong *)(param_1 + 0x148) + 600) != 0) {
    FUN_1401bd070(param_1 + 0x1e8,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0));
    if (*(char *)(param_1 + 0x1f8) == '\x01') {
      LOCK();
      *(undefined4 *)(param_1 + 0x200) = 1;
      UNLOCK();
    }
  }
  FUN_140154650(*(undefined8 *)(param_1 + 0x148));
  return;
}



void FUN_14018a7d0(longlong param_1,longlong param_2,longlong param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 local_res10 [8];
  
  if (param_3 == 0) {
    lVar1 = 0;
  }
  else {
    lVar1 = param_3 + 0x40;
  }
  FUN_1401a1470(local_res10,lVar1,param_3,param_4,0xfffffffffffffffe);
  FUN_1400a1c30(param_3 + 0xa8);
  if ((*(longlong **)(param_3 + 0x150) != (longlong *)0x0) &&
     (**(longlong **)(param_3 + 0x150) != 0)) {
    FUN_1400aa370();
  }
  if (0 < *(int *)(param_2 + 8)) {
    *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x6c0) =
         *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x6c0) + 1;
    *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x680) =
         *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x680) + (longlong)*(int *)(param_2 + 8);
  }
  *(undefined1 *)(param_3 + 0x100) = 0;
  FUN_1401a15a0(param_3);
  FUN_1400d1290(param_3 + 0xa8);
  FUN_1401a1480(local_res10);
  return;
}



void FUN_14018a8d0(longlong param_1,undefined8 param_2,longlong param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  uVar3 = 0xfffffffffffffffe;
  FUN_140169430(param_3 + 0xc0);
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  uVar4 = uVar2;
  FUN_1400a1c30(uVar2);
  if (DAT_140313fcf != '\0') {
    lVar1 = **(longlong **)(param_1 + 0x148);
    (**(code **)(lVar1 + 200))
              (*(longlong **)(param_1 + 0x148),
               L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_SpeedHackDetectorPing",lVar1,
               param_4,uVar3,uVar4,1);
  }
  FUN_14019a9c0(param_3);
  FUN_1400d1290(uVar2);
  return;
}



void FUN_14018a960(longlong param_1,undefined8 param_2,longlong param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  undefined8 local_res18;
  undefined1 local_res20 [8];
  undefined **local_50;
  undefined4 local_48;
  undefined2 local_44;
  undefined8 local_40;
  undefined1 local_38;
  longlong local_30;
  undefined1 local_28;
  
  if ((param_3 != 0) &&
     (cVar1 = FUN_140185490(param_2,&local_res18,8,param_4,0xfffffffffffffffe), cVar1 != '\0')) {
    uVar2 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    local_40 = uVar2;
    FUN_1400a1c30(uVar2);
    local_38 = 1;
    if (DAT_140313fcf != '\0') {
      (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                (*(longlong **)(param_1 + 0x148),
                 L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_ReplyReceiveSpeedAtReceiverSide_NoBypass"
                );
    }
    lVar5 = 0;
    if ((*(longlong **)(param_3 + 0x740) == (longlong *)0x0) ||
       (lVar3 = **(longlong **)(param_3 + 0x740), lVar4 = lVar3 + 0x40, lVar3 == 0)) {
      lVar4 = lVar5;
    }
    FUN_1401a1470(local_res20,lVar4);
    lVar3 = lVar5;
    if (*(longlong **)(param_3 + 0x740) != (longlong *)0x0) {
      lVar3 = **(longlong **)(param_3 + 0x740);
    }
    lVar3 = lVar3 + 0xa8;
    local_30 = lVar3;
    FUN_1400a1c30(lVar3);
    local_28 = 1;
    local_50 = Proud::AddrPort::vftable;
    local_48 = *(undefined4 *)(param_3 + 0x710);
    local_44 = *(undefined2 *)(param_3 + 0x714);
    if (*(longlong **)(param_3 + 0x740) != (longlong *)0x0) {
      lVar5 = **(longlong **)(param_3 + 0x740);
    }
    FUN_14019cd00(*(undefined8 *)(lVar5 + 0x168),&local_50,local_res18);
    FUN_1400d1290(lVar3);
    FUN_1401a1480(local_res20);
    FUN_1400d1290(uVar2);
  }
  return;
}



void FUN_14018aac0(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x00014018aae7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



void FUN_14018ab00(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x00014018ab27. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



undefined8 * FUN_14018ab40(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_14018aba0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14018ac00(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined1 local_58 [88];
  
  lVar1 = *param_1;
  while( true ) {
    if (lVar1 == 0) {
      return;
    }
    plVar2 = (longlong *)*param_1;
    if ((longlong *)plVar2[2] != param_1) break;
    plVar3 = (longlong *)plVar2[1];
    lVar1 = *plVar2;
    if (plVar3 != (longlong *)0x0) {
      *plVar3 = lVar1;
    }
    if (lVar1 != 0) {
      *(longlong **)(lVar1 + 8) = plVar3;
    }
    if (plVar3 == (longlong *)0x0) {
      if ((longlong *)param_1[1] != plVar2) {
        FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                      L"Proud::CListNode<class Proud::ITaskSubject::CNode>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      param_1[1] = lVar1;
    }
    if (lVar1 == 0) {
      if ((longlong *)*param_1 != plVar2) {
        FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                      L"Proud::CListNode<class Proud::ITaskSubject::CNode>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      *param_1 = (longlong)plVar3;
    }
    *plVar2 = 0;
    plVar2[1] = 0;
    plVar2[2] = 0;
    *(int *)(param_1 + 2) = (int)param_1[2] + -1;
    lVar1 = *param_1;
  }
  FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                L"Proud::CListNode<class Proud::ITaskSubject::CNode>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_14018acf0(longlong param_1,int param_2)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  undefined1 local_58 [80];
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar2 = FUN_14018a4a0();
      plVar1 = *(longlong **)(param_1 + 8);
      lVar3 = (longlong)iVar2;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_1400a34c0(lVar3);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 8))(plVar1,lVar3);
        }
      }
      else {
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_1400a34f0(*(undefined8 *)(param_1 + 0x10),lVar3);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 0x10))(plVar1,*(undefined8 *)(param_1 + 0x10),lVar3);
        }
        if (lVar3 == 0) {
          FUN_1400a2320(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
        }
      }
      *(longlong *)(param_1 + 0x10) = lVar3;
      *(int *)(param_1 + 0x1c) = iVar2;
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_14018adb0(longlong param_1,longlong param_2,longlong param_3)

{
  undefined4 *puVar1;
  int iVar2;
  
  iVar2 = 0;
  if (0 < param_3) {
    puVar1 = (undefined4 *)(param_1 + 0x30);
    param_2 = param_2 - param_1;
    do {
      if ((undefined8 *)(puVar1 + -0xc) != (undefined8 *)0x0) {
        *(undefined8 *)(puVar1 + -0xc) = *(undefined8 *)(param_2 + -0x30 + (longlong)puVar1);
        puVar1[-10] = *(undefined4 *)(param_2 + -0x28 + (longlong)puVar1);
        puVar1[-9] = *(undefined4 *)(param_2 + -0x24 + (longlong)puVar1);
        puVar1[-8] = *(undefined4 *)(param_2 + -0x20 + (longlong)puVar1);
        *(undefined8 *)(puVar1 + -6) = *(undefined8 *)(param_2 + -0x18 + (longlong)puVar1);
        puVar1[-4] = *(undefined4 *)(param_2 + -0x10 + (longlong)puVar1);
        *(undefined ***)(puVar1 + -2) = Proud::AddrPort::vftable;
        *puVar1 = *(undefined4 *)(param_2 + (longlong)puVar1);
        *(undefined2 *)(puVar1 + 1) = *(undefined2 *)(param_2 + 4 + (longlong)puVar1);
      }
      iVar2 = iVar2 + 1;
      puVar1 = puVar1 + 0xe;
    } while (iVar2 < param_3);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014018b16a)

void FUN_14018ae30(longlong param_1,longlong param_2)

{
  char cVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong lVar4;
  longlong lVar5;
  int iVar6;
  longlong *plVar7;
  longlong lVar8;
  longlong *plVar9;
  int iVar10;
  
  lVar5 = *(longlong *)(param_1 + 0x148) + 0x798;
  FUN_1400a1c30(lVar5);
  lVar8 = *(longlong *)(param_1 + 0x148) + 2000;
  FUN_1400a1c30(lVar8);
  iVar6 = 0;
  iVar10 = *(int *)(*(longlong *)(param_1 + 0x148) + 0x818) +
           *(int *)(*(longlong *)(param_1 + 0x148) + 0x838);
  FUN_140195930(param_2,iVar10);
  if (*(int *)(param_2 + 0x18) == 0) {
    plVar9 = (longlong *)0x0;
  }
  else {
    plVar9 = *(longlong **)(param_2 + 0x10);
  }
  lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x828);
  plVar7 = plVar9;
  while (lVar4 != 0) {
    FUN_1401a1450(lVar4 + 0x40);
    if (lVar4 == 0) {
      lVar2 = 0;
    }
    else {
      lVar2 = lVar4 + 0x88;
    }
    *plVar7 = lVar2;
    if (*(longlong *)(lVar4 + 0xa0) != 0) {
      FUN_1401428d0(*(longlong *)(lVar4 + 0xa0),lVar4);
    }
    iVar6 = iVar6 + 1;
    plVar7 = plVar7 + 1;
    lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x828);
  }
  lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x808);
  if (lVar4 != 0) {
    plVar7 = plVar9 + iVar6;
    do {
      FUN_1401a1450(lVar4 + 0xc0);
      if (lVar4 == 0) {
        lVar2 = 0;
      }
      else {
        lVar2 = lVar4 + 0x108;
      }
      *plVar7 = lVar2;
      if (*(longlong *)(lVar4 + 0x120) != 0) {
        FUN_140142680(*(longlong *)(lVar4 + 0x120),lVar4);
      }
      plVar7 = plVar7 + 1;
      lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x808);
    } while (lVar4 != 0);
  }
  FUN_1400d1290(lVar8);
  FUN_1400d1290(lVar5);
  lVar5 = (longlong)iVar10;
  if (0 < iVar10) {
    do {
      lVar8 = 0;
      if (lVar5 < 1) {
        return;
      }
      do {
        plVar7 = (longlong *)plVar9[lVar8];
        uVar3 = (**(code **)(*plVar7 + 0x10))(plVar7);
        if (lVar8 == 0) {
          FUN_1400a1c30(uVar3);
          iVar6 = (**(code **)(*plVar7 + 8))(plVar7);
          FUN_1400d1290(uVar3);
          if (iVar6 != 0) {
            uVar3 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
            FUN_1400a1c30(uVar3);
            if (DAT_140313fcf != '\0') {
              (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                        (*(longlong **)(param_1 + 0x148),
                         L"Proud::CNetThreads_S::NetworkerThread_EveryRemote_IssueSendOnNeed");
            }
            (**(code **)(*plVar7 + 0x20))
                      (plVar7,L"Proud::CNetThreads_S::NetworkerThread_EveryRemote_IssueSendOnNeed",
                       iVar6);
            FUN_1400d1290(uVar3);
          }
          (**(code **)(*plVar7 + 0x18))(plVar7);
          *plVar9 = plVar9[lVar5 + -1];
LAB_14018b162:
          lVar5 = lVar5 + -1;
        }
        else {
          cVar1 = FUN_1400a1c80();
          if (cVar1 != '\0') {
            iVar6 = (**(code **)(*plVar7 + 8))(plVar7);
            FUN_1400d1290(uVar3);
            if (iVar6 != 0) {
              uVar3 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
              FUN_1400a1c30(uVar3);
              if (DAT_140313fcf != '\0') {
                (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                          (*(longlong **)(param_1 + 0x148),
                           L"Proud::CNetThreads_S::NetworkerThread_EveryRemote_IssueSendOnNeed");
              }
              (**(code **)(*plVar7 + 0x20))
                        (plVar7,L"Proud::CNetThreads_S::NetworkerThread_EveryRemote_IssueSendOnNeed"
                         ,iVar6);
              FUN_1400d1290(uVar3);
            }
            (**(code **)(*plVar7 + 0x18))(plVar7);
            plVar9[lVar8] = plVar9[lVar5 + -1];
            goto LAB_14018b162;
          }
        }
        lVar8 = lVar8 + 1;
      } while (lVar8 < lVar5);
    } while (0 < lVar5);
  }
  return;
}



void thunk_FUN_14018ac00(void)

{
  FUN_14018ac00();
  return;
}



void FUN_14018b1d0(longlong param_1,int param_2)

{
  longlong *plVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  undefined1 local_58 [80];
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  iVar2 = *(int *)(param_1 + 0x18);
  if (param_2 != iVar2) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar2 = FUN_14018a400(param_1,param_2);
      plVar1 = *(longlong **)(param_1 + 8);
      lVar4 = (longlong)iVar2;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          uVar3 = FUN_1400a34c0(lVar4 * 0x38);
        }
        else {
          uVar3 = (**(code **)(*plVar1 + 8))(plVar1,lVar4 * 0x38);
        }
        *(undefined8 *)(param_1 + 0x10) = uVar3;
        FUN_14018a540(uVar3,(longlong)param_2);
      }
      else {
        uVar3 = *(undefined8 *)(param_1 + 0x10);
        if (plVar1 == (longlong *)0x0) {
          lVar4 = FUN_1400a34c0(lVar4 * 0x38);
        }
        else {
          lVar4 = (**(code **)(*plVar1 + 8))(plVar1,lVar4 * 0x38);
        }
        FUN_14018adb0(lVar4,uVar3,(longlong)*(int *)(param_1 + 0x18));
        FUN_14018a540((longlong)*(int *)(param_1 + 0x18) * 0x38 + lVar4,
                      (longlong)(param_2 - *(int *)(param_1 + 0x18)));
        if (lVar4 == 0) {
          FUN_1400a2320(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
        }
        plVar1 = *(longlong **)(param_1 + 8);
        if (plVar1 == (longlong *)0x0) {
          FUN_1400a3530(uVar3);
        }
        else {
          (**(code **)(*plVar1 + 0x18))(plVar1,uVar3);
        }
        *(longlong *)(param_1 + 0x10) = lVar4;
      }
      *(int *)(param_1 + 0x1c) = iVar2;
    }
    else if ((iVar2 - param_2 < 1) && (0 < param_2 - iVar2)) {
      FUN_14018a540((longlong)iVar2 * 0x38 + *(longlong *)(param_1 + 0x10),
                    (longlong)(param_2 - iVar2));
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_14018b360(longlong param_1)

{
  CloseHandle(*(HANDLE *)(param_1 + 0x20));
  FUN_14018ac00(param_1 + 8);
  return;
}



void FUN_14018b390(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  char cVar2;
  byte bVar3;
  int iVar4;
  int iVar5;
  byte local_res20;
  undefined4 local_a0 [2];
  int *local_98;
  int local_90;
  undefined8 local_20;
  
  local_20 = 0xfffffffffffffffe;
  local_98 = (int *)(param_2 + 8);
  iVar4 = (int)(*local_98 + (*local_98 >> 0x1f & 7U)) >> 3;
  if (iVar4 != 0) {
    FUN_140164080(*(undefined8 *)(param_1 + 0x148),0,
                  "Proud::CNetThreads_S::UserWorkerThread_FinalReceiveRmi",2);
  }
  local_res20 = 0;
  iVar5 = 0;
  local_a0[0] = 0;
  cVar2 = FUN_140185e40(local_98,local_a0);
  if (cVar2 != '\0') {
    local_90 = *(int *)(*(longlong *)(param_1 + 0x148) + 0x48);
    for (; iVar5 < local_90; iVar5 = iVar5 + 1) {
      if ((iVar5 < 0) || (*(int *)(*(longlong *)(param_1 + 0x148) + 0x48) <= iVar5)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      plVar1 = *(longlong **)
                (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x40) + (longlong)iVar5 * 8);
      FUN_140185160(local_98,iVar4);
      bVar3 = (**(code **)(*plVar1 + 0x10))(plVar1,param_2 + 8);
      local_res20 = local_res20 | bVar3;
    }
    if (local_res20 == 0) {
      FUN_140185160(local_98,iVar4);
      if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x758) != 0) {
        plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x148) + 0x758);
        (**(code **)(*plVar1 + 0x28))(plVar1,local_a0[0]);
      }
    }
    FUN_1401a7860(param_1 + 0x160,*(undefined4 *)(param_2 + 0x30),0);
  }
  return;
}



undefined8 FUN_14018b500(longlong param_1)

{
  int iVar1;
  longlong *plVar2;
  DWORD DVar3;
  longlong lVar4;
  int iVar5;
  longlong lVar6;
  
  FUN_1400a1c30();
  if (*(int *)(param_1 + 0x78) != 0) {
    DVar3 = GetCurrentThreadId();
    iVar5 = 0;
    iVar1 = *(int *)(param_1 + 0x78);
    lVar6 = 0;
    if (0 < iVar1) {
      do {
        if ((lVar6 < 0) || (iVar1 <= iVar5)) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        plVar2 = *(longlong **)(*(longlong *)(param_1 + 0x70) + lVar6 * 8);
        lVar4 = 0;
        if (plVar2 != (longlong *)0x0) {
          lVar4 = *plVar2;
        }
        if (*(DWORD *)(lVar4 + 8) == DVar3) {
          FUN_1400d1290(param_1);
          return 1;
        }
        iVar5 = iVar5 + 1;
        lVar6 = lVar6 + 1;
      } while (iVar5 < iVar1);
    }
  }
  FUN_1400d1290(param_1);
  return 0;
}



undefined8 * FUN_14018b590(longlong param_1,longlong param_2,uint param_3,undefined4 param_4)

{
  undefined2 uVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined8 uVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  
  plVar2 = *(longlong **)(param_1 + 0x50);
  if (plVar2 == (longlong *)0x0) {
    puVar6 = (undefined8 *)FUN_1400a34c0(0x30);
  }
  else {
    puVar6 = (undefined8 *)(**(code **)(*plVar2 + 8))(plVar2,0x30);
  }
  if (puVar6 != (undefined8 *)0x0) {
    *puVar6 = Proud::AddrPort::vftable;
    *(undefined4 *)(puVar6 + 1) = *(undefined4 *)(param_2 + 8);
    uVar1 = *(undefined2 *)(param_2 + 0xc);
    *(undefined4 *)(puVar6 + 5) = param_4;
    *(undefined2 *)((longlong)puVar6 + 0xc) = uVar1;
  }
  lVar3 = *(longlong *)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8);
  FUN_140144430(param_1);
  if (*(longlong *)(param_1 + 0x20) == 0) {
    *(undefined8 **)(param_1 + 0x10) = puVar6;
    *(undefined8 **)(param_1 + 0x18) = puVar6;
    puVar6[4] = 0;
    puVar6[3] = 0;
  }
  else {
    FUN_140144430(param_1);
    FUN_140144430(param_1);
    if (lVar3 == 0) {
      lVar3 = *(longlong *)(param_1 + 0x10);
      puVar6[4] = 0;
      puVar6[3] = lVar3;
      if (lVar3 != 0) {
        *(undefined8 **)(lVar3 + 0x20) = puVar6;
      }
      *(undefined8 **)(param_1 + 0x10) = puVar6;
    }
    else {
      if (*(longlong *)(lVar3 + 0x20) == 0) {
        *(undefined8 **)(param_1 + 0x10) = puVar6;
      }
      else {
        *(undefined8 **)(*(longlong *)(lVar3 + 0x20) + 0x18) = puVar6;
      }
      uVar4 = *(undefined8 *)(lVar3 + 0x20);
      puVar6[3] = lVar3;
      puVar6[4] = uVar4;
      *(undefined8 **)(lVar3 + 0x20) = puVar6;
    }
  }
  *(undefined8 **)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8) = puVar6;
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  FUN_140144430(param_1);
  FUN_140144430(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar5 = FUN_140142850(param_1);
    FUN_140144ad0(param_1,uVar5);
  }
  FUN_140144430(param_1);
  return puVar6;
}



void FUN_14018b6e0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  undefined *puVar3;
  
  uVar2 = 0xfffffffffffffffe;
  puVar3 = &DAT_140319128;
  FUN_1400a1c30(&DAT_140319128);
  *(undefined4 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 0x58) = 0;
  FUN_14018acf0(param_1,0,param_3,param_4,uVar2,puVar3,1);
  FUN_14003cda0(param_1 + 0x28,0);
  puVar1 = DAT_140319120;
  if ((*(short *)(param_1 + -8) == 0x1de6) && (*(longlong *)(param_1 + 0x60) == 0)) {
    *(undefined8 *)(param_1 + 0x60) = *DAT_140319120;
    *puVar1 = (short *)(param_1 + -8);
    FUN_1400d1290(&DAT_140319128);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_14018b770(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_14018b6e0();
  }
  return;
}



void FUN_14018b790(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  void *pvVar2;
  undefined8 *puVar3;
  
  lVar1 = *param_2;
  if (lVar1 != *param_1) {
    if (lVar1 != 0) {
      *(longlong *)(*param_2 + 8) = *(longlong *)(lVar1 + 8) + 1;
    }
    puVar3 = (undefined8 *)0x0;
    if ((*param_1 != 0) &&
       (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
       *(longlong *)(*param_1 + 8) == 0)) {
      puVar3 = (undefined8 *)*param_1;
    }
    *param_1 = *param_2;
    if (puVar3 != (undefined8 *)0x0) {
      pvVar2 = (void *)*puVar3;
      if (pvVar2 != (void *)0x0) {
        FUN_1400aaa90(pvVar2);
        operator_delete(pvVar2);
      }
      FUN_1400a3530(puVar3);
    }
  }
  return;
}



undefined8 FUN_14018b820(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_140144560(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  FUN_140144430(param_1);
  uVar2 = FUN_14018b590(param_1,param_2,param_3,param_4);
  FUN_140144430(param_1);
  return uVar2;
}



void FUN_14018b8a0(longlong param_1,longlong param_2)

{
  undefined4 *puVar1;
  int iVar2;
  
  if (0 < param_2) {
    iVar2 = 0;
    puVar1 = (undefined4 *)(param_1 + 0x18);
    do {
      FUN_14019a730(puVar1 + -4);
      if (*(longlong *)(puVar1 + -2) != 0) {
        if ((int)puVar1[1] < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        *puVar1 = 0;
      }
      iVar2 = iVar2 + 1;
      puVar1 = puVar1 + 0x12;
    } while (iVar2 < param_2);
  }
  return;
}



void FUN_14018b910(longlong param_1)

{
  int *piVar1;
  char cVar2;
  undefined *puVar3;
  HANDLE hThread;
  __time64_t _Var4;
  undefined *puVar5;
  undefined8 uVar6;
  undefined1 local_res8 [8];
  undefined *local_res10;
  
  hThread = GetCurrentThread();
  SetThreadPriorityBoost(hThread,0);
  FUN_1401c10a0(local_res8);
  cVar2 = *(char *)(param_1 + 0x140);
  while (cVar2 == '\0') {
    FUN_1401c1440(param_1 + 0x150,100);
    uVar6 = FUN_1400ad7f0(*(longlong *)(param_1 + 0x148) + 0x760);
    *(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0) = uVar6;
    uVar6 = FUN_1400ad790(*(longlong *)(param_1 + 0x148) + 0x760);
    *(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x200) = uVar6;
    _Var4 = _time64((__time64_t *)0x0);
    *(__time64_t *)(*(longlong *)(param_1 + 0x148) + 0x208) = _Var4;
    FUN_14018a5b0(param_1);
    cVar2 = *(char *)(param_1 + 0x140);
  }
  FUN_140151d00(*(undefined8 *)(param_1 + 0x148));
  if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0) {
    FUN_1400a3440();
    local_res10 = PTR_DAT_1402f8010;
    FUN_14003c600(&local_res10,&DAT_140259740,L"Proud::CNetThreads_S::Heartbeat_Main");
    puVar3 = local_res10;
    puVar5 = local_res10;
    if (local_res10 == (undefined *)0x0) {
      puVar5 = PTR_DAT_1402f8010;
    }
    FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),0,puVar5);
    if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1402f8010)) &&
       (puVar3 + -8 != (undefined *)0x0)) {
      uVar6 = FUN_1400a3440();
      FUN_1400a1c30(uVar6);
      piVar1 = (int *)(puVar3 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar3 + -8);
      }
      FUN_1400d1290(uVar6);
    }
  }
  FUN_1401c10d0(local_res8);
  return;
}



void FUN_14018baa0(longlong param_1,longlong param_2,longlong param_3)

{
  int *piVar1;
  bool bVar2;
  undefined *puVar3;
  int iVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined *puVar7;
  longlong lVar8;
  undefined *local_res10;
  undefined1 local_res18 [16];
  undefined8 in_stack_ffffffffffffff10;
  undefined4 uVar9;
  undefined **local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined8 local_a8;
  undefined **local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined1 local_70;
  undefined8 local_68;
  undefined1 local_60;
  undefined8 local_58;
  undefined1 local_50;
  undefined8 local_48;
  
  uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffff10 >> 0x20);
  local_48 = 0xfffffffffffffffe;
  lVar8 = param_3 + 0xc0;
  if (param_3 == 0) {
    lVar8 = 0;
  }
  FUN_1401a1470(local_res18,lVar8);
  uVar5 = (**(code **)(*(longlong *)(param_3 + 0x108) + 0x10))();
  FUN_1400a1c30(uVar5);
  bVar2 = true;
  **(undefined1 **)(param_3 + 0x748) = 0;
  if (*(int *)(param_2 + 8) < 0) {
    FUN_1400d1290(uVar5);
    bVar2 = false;
    FUN_1400a3440();
    local_res10 = PTR_DAT_1402f8010;
    FUN_14003c600(&local_res10,L"%s:%d",
                  L"Proud::CNetThreads_S::NetWorkerThread_TcpSendCompletionCase",
                  *(undefined4 *)(param_2 + 0xc));
    local_68 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    FUN_1400a1c30(local_68);
    local_60 = 1;
    if (DAT_140313fcf != '\0') {
      (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                (*(longlong **)(param_1 + 0x148),
                 L"Proud::CNetThreads_S::NetWorkerThread_TcpSendCompletionCase");
    }
    puVar3 = local_res10;
    local_98 = 0;
    local_90 = 0;
    local_88 = 0;
    local_80 = 0;
    local_a0 = Proud::ByteArray::vftable;
    puVar7 = local_res10;
    if (local_res10 == (undefined *)0x0) {
      puVar7 = PTR_DAT_1402f8010;
    }
    FUN_140166b70(*(undefined8 *)(param_1 + 0x148),param_3,0xb,3,&local_a0,puVar7,
                  *(undefined4 *)(param_2 + 0xc));
    FUN_140140df0(&local_a0);
    FUN_1400d1290(local_68);
    if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1402f8010)) &&
       (puVar3 + -8 != (undefined *)0x0)) {
      uVar6 = FUN_1400a3440();
      local_58 = uVar6;
      FUN_1400a1c30(uVar6);
      local_50 = 1;
      piVar1 = (int *)(puVar3 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar3 + -8);
      }
      FUN_1400d1290(uVar6);
    }
  }
  else {
    FUN_1401a3e60(*(longlong *)(param_3 + 0x748) + 0x48);
    iVar4 = FUN_1401a1120(*(undefined8 *)(param_3 + 0x748));
    if (iVar4 != 0) {
      FUN_1400d1290(uVar5);
      bVar2 = false;
      uVar6 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
      local_78 = uVar6;
      FUN_1400a1c30(uVar6);
      local_70 = 1;
      if (DAT_140313fcf != '\0') {
        (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                  (*(longlong **)(param_1 + 0x148),
                   L"Proud::CNetThreads_S::NetWorkerThread_TcpSendCompletionCase");
      }
      local_c0 = 0;
      local_b8 = 0;
      local_b0 = 0;
      local_a8 = 0;
      local_c8 = Proud::ByteArray::vftable;
      (**(code **)(*(longlong *)(param_3 + 0xa0) + 0x38))
                (param_3 + 0xa0,0xb,3,&local_c8,
                 L"Proud::CNetThreads_S::NetWorkerThread_TcpSendCompletionCase",
                 CONCAT44(uVar9,iVar4));
      FUN_140140df0(&local_c8);
      (**(code **)(*(longlong *)(param_3 + 0xa0) + 0x40))
                (param_3 + 0xa0,L"Proud::CNetThreads_S::NetWorkerThread_TcpSendCompletionCase");
      FUN_1400d1290(uVar6);
      local_70 = 0;
    }
    *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x580) =
         *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x580) + 1;
    *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x5c0) =
         *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x5c0) + (longlong)*(int *)(param_2 + 8);
  }
  if (bVar2) {
    FUN_1400d1290(uVar5);
  }
  FUN_1401a1480(local_res18);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14018bdc0(longlong param_1,undefined8 param_2,longlong param_3)

{
  int *piVar1;
  undefined **ppuVar2;
  ulonglong uVar3;
  undefined **ppuVar4;
  char cVar5;
  int iVar6;
  undefined8 uVar7;
  undefined *puVar8;
  undefined8 uVar9;
  longlong *plVar10;
  longlong *plVar11;
  undefined *puVar12;
  bool bVar13;
  undefined1 auStack_da8 [32];
  undefined *local_d88;
  undefined **local_d78;
  undefined4 local_d70;
  undefined2 local_d6c;
  undefined **local_d68;
  undefined4 local_d60;
  undefined2 local_d5c;
  undefined8 local_d58;
  undefined1 local_d50;
  undefined *local_d48;
  undefined *local_d40;
  undefined1 local_d38;
  undefined1 local_d30 [8];
  undefined *local_d28;
  longlong local_d20;
  int local_d14;
  undefined8 local_d08;
  undefined8 local_d00;
  undefined1 local_cf8;
  undefined **local_ce8;
  undefined4 uStack_ce0;
  undefined2 uStack_cdc;
  undefined2 uStack_cda;
  undefined1 local_cd8 [3216];
  ulonglong local_48;
  
  local_d08 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_da8;
  FUN_140169430(param_3 + 0xc0);
  local_d68 = Proud::AddrPort::vftable;
  local_d60 = 0;
  local_d5c = 0;
  local_d78 = Proud::AddrPort::vftable;
  local_d70 = 0;
  local_d6c = 0;
  local_ce8 = (undefined **)0x0;
  uStack_ce0 = 0;
  uStack_cdc = 0;
  uStack_cda = 0;
  cVar5 = FUN_140185490(param_2,&local_ce8,0x10);
  if (cVar5 == '\0') {
    return;
  }
  cVar5 = FUN_140185ec0(param_2,&local_d68);
  if (cVar5 != '\0') {
    cVar5 = FUN_140185ec0(param_2,&local_d78);
    if (cVar5 == '\0') {
      return;
    }
    uVar7 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    local_d00 = uVar7;
    FUN_1400a1c30(uVar7);
    local_cf8 = 1;
    if (DAT_140313fcf != '\0') {
      (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                (*(longlong **)(param_1 + 0x148),
                 L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_NotifyHolepunchSuccess");
    }
    bVar13 = *(undefined ***)(param_3 + 0x728) < local_ce8;
    if ((*(undefined ***)(param_3 + 0x728) == local_ce8) &&
       (uVar3 = CONCAT26(uStack_cda,CONCAT24(uStack_cdc,uStack_ce0)),
       bVar13 = *(ulonglong *)(param_3 + 0x730) < uVar3, *(ulonglong *)(param_3 + 0x730) == uVar3))
    {
      iVar6 = 0;
    }
    else {
      iVar6 = (1 - (uint)bVar13) - (uint)(bVar13 != 0);
    }
    if ((iVar6 == 0) && (*(char *)(param_3 + 0x700) == '\0')) {
      *(undefined1 *)(param_3 + 0x700) = 1;
      uVar9 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x118) + 8))();
      *(undefined8 *)(param_3 + 0x198) = uVar9;
      uVar9 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x118) + 8))();
      *(undefined8 *)(param_3 + 0x1b8) = uVar9;
      local_ce8 = Proud::AddrPort::vftable;
      uStack_ce0 = local_d70;
      uStack_cdc = local_d6c;
      FUN_1401a2ee0(param_3 + 0x700,&local_ce8);
      *(undefined4 *)(param_3 + 0x720) = local_d60;
      *(undefined2 *)(param_3 + 0x724) = local_d5c;
      FUN_140151bf0(*(undefined8 *)(param_1 + 0x148),param_3);
      FUN_140185560(local_d30);
      FUN_140185030(local_d30);
      FUN_1401856c0(local_d30,0x800);
      FUN_1401856c0(local_d30,0);
      FUN_14003c9e0(local_d30,0xf);
      local_ce8 = *(undefined ***)(param_3 + 0x728);
      uStack_ce0 = *(undefined4 *)(param_3 + 0x730);
      uStack_cdc = (undefined2)*(undefined4 *)(param_3 + 0x734);
      uStack_cda = (undefined2)((uint)*(undefined4 *)(param_3 + 0x734) >> 0x10);
      FUN_14003cba0(local_d30,&local_ce8);
      puVar8 = (undefined *)(**(code **)(*(longlong *)(param_3 + 0x108) + 0x10))();
      local_d40 = puVar8;
      FUN_1400a1c30(puVar8);
      local_d38 = 1;
      uVar9 = FUN_140146970(local_cd8,local_d30);
      local_ce8 = (undefined **)0x0;
      uStack_ce0 = CONCAT31(uStack_ce0._1_3_,1);
      FUN_1401a12a0(*(undefined8 *)(param_3 + 0x748),uVar9,&local_ce8);
      FUN_140145b60(local_cd8);
      FUN_1400d1290(puVar8);
      if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0) {
        FUN_1400a3440();
        local_d40 = PTR_DAT_1402f8010;
        plVar10 = (longlong *)FUN_1400a6f50(&local_d78,&local_ce8);
        plVar11 = (longlong *)FUN_1400a6f50(&local_d68,&local_d48);
        local_d88 = (undefined *)*plVar10;
        if ((undefined *)*plVar10 == (undefined *)0x0) {
          local_d88 = PTR_DAT_1402f8010;
        }
        puVar8 = (undefined *)*plVar11;
        if ((undefined *)*plVar11 == (undefined *)0x0) {
          puVar8 = PTR_DAT_1402f8010;
        }
        FUN_14003c600(&local_d40,&DAT_140259890,*(undefined4 *)(param_3 + 0x6f8),puVar8);
        if (((local_d48 != (undefined *)0x0) && (local_d48 != PTR_DAT_1402f8010)) &&
           (local_d48 + -8 != (undefined *)0x0)) {
          uVar9 = FUN_1400a3440();
          local_d58 = uVar9;
          FUN_1400a1c30(uVar9);
          local_d50 = 1;
          piVar1 = (int *)(local_d48 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_d48 + -8);
          }
          FUN_1400d1290(uVar9);
        }
        ppuVar4 = local_ce8;
        local_d48 = PTR_DAT_1402f8010;
        if (((local_ce8 != (undefined **)0x0) && (local_ce8 != (undefined **)PTR_DAT_1402f8010)) &&
           (ppuVar2 = local_ce8 + -1, ppuVar2 != (undefined **)0x0)) {
          uVar9 = FUN_1400a3440();
          local_d58 = uVar9;
          FUN_1400a1c30(uVar9);
          local_d50 = 1;
          piVar1 = (int *)((longlong)ppuVar4 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(ppuVar2);
          }
          FUN_1400d1290(uVar9);
        }
        puVar8 = local_d40;
        puVar12 = local_d40;
        if (local_d40 == (undefined *)0x0) {
          puVar12 = PTR_DAT_1402f8010;
        }
        FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),1,puVar12);
        if (((puVar8 != (undefined *)0x0) && (puVar8 != PTR_DAT_1402f8010)) &&
           (puVar8 + -8 != (undefined *)0x0)) {
          uVar9 = FUN_1400a3440();
          local_d58 = uVar9;
          FUN_1400a1c30(uVar9);
          local_d50 = 1;
          piVar1 = (int *)(puVar8 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(puVar8 + -8);
          }
          FUN_1400d1290(uVar9);
        }
      }
      local_ce8 = &local_d28;
      FUN_14019a730(&local_d28);
      if ((local_d20 != 0) && (local_d14 < 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
    }
    FUN_1400d1290(uVar7);
    return;
  }
  return;
}



void FUN_14018c240(longlong param_1,undefined8 param_2,longlong param_3)

{
  int *piVar1;
  void *pvVar2;
  longlong lVar3;
  char cVar4;
  int iVar5;
  int iVar6;
  undefined8 uVar7;
  longlong lVar8;
  longlong *plVar9;
  undefined8 uVar10;
  undefined8 uVar11;
  undefined8 *puVar12;
  undefined8 *puVar13;
  longlong *plVar14;
  undefined *puVar15;
  longlong lVar16;
  undefined *puVar17;
  undefined4 local_res18 [2];
  undefined8 *local_res20;
  undefined4 uVar18;
  undefined *local_138;
  undefined **local_130;
  undefined4 local_128;
  undefined2 local_124;
  undefined *local_120;
  undefined **local_118;
  undefined4 local_110;
  undefined2 local_10c;
  undefined **local_108;
  undefined4 local_100;
  undefined2 local_fc;
  undefined8 local_f8;
  undefined1 local_f0;
  undefined *local_e8;
  undefined **local_e0;
  undefined4 local_d8;
  undefined2 local_d4;
  undefined8 local_d0;
  undefined1 local_c8;
  undefined8 local_c0;
  undefined1 local_b8;
  undefined8 local_b0;
  undefined1 local_a8;
  undefined8 local_a0;
  undefined1 local_98 [16];
  undefined1 local_88 [16];
  undefined1 local_78 [16];
  undefined1 local_68 [16];
  undefined1 local_58 [16];
  undefined1 local_48 [16];
  
  local_a0 = 0xfffffffffffffffe;
  FUN_140169430(param_3 + 0xc0);
  local_118 = Proud::AddrPort::vftable;
  lVar16 = 0;
  local_110 = 0;
  local_10c = 0;
  local_130 = Proud::AddrPort::vftable;
  local_128 = 0;
  local_124 = 0;
  cVar4 = FUN_140185ec0(param_2,&local_118);
  if (((cVar4 != '\0') && (cVar4 = FUN_140185ec0(param_2,&local_130), cVar4 != '\0')) &&
     (cVar4 = FUN_140185f20(param_2,local_res18), cVar4 != '\0')) {
    uVar7 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    local_f8 = uVar7;
    FUN_1400a1c30(uVar7);
    local_f0 = 1;
    if (DAT_140313fcf != '\0') {
      (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                (*(longlong **)(param_1 + 0x148),
                 L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_PeerUdp_NotifyHolepunchSuccess"
                );
    }
    lVar8 = FUN_140146cc0(*(undefined8 *)(param_1 + 0x148),local_res18[0]);
    if (lVar8 != 0) {
      plVar9 = (longlong *)
               FUN_1401553e0(*(longlong *)(param_1 + 0x148) + 0x2d8,&local_res20,local_res18[0],
                             *(undefined4 *)(param_3 + 0x6f8));
      if ((longlong *)*plVar9 != (longlong *)0x0) {
        lVar16 = *(longlong *)*plVar9;
      }
      if ((local_res20 != (undefined8 *)0x0) &&
         (local_res20[1] = local_res20[1] + -1, uVar7 = local_f8, local_res20[1] == 0)) {
        pvVar2 = (void *)*local_res20;
        if (pvVar2 != (void *)0x0) {
          FUN_140142270(pvVar2);
          operator_delete(pvVar2);
        }
        FUN_1400a3530(local_res20);
        uVar7 = local_f8;
      }
      if (((lVar16 != 0) && (*(char *)(lVar16 + 0x1a0) == '\0')) &&
         (cVar4 = FUN_1401422b0(lVar16), cVar4 != '\0')) {
        iVar5 = FUN_140142230(lVar16);
        local_e0 = Proud::AddrPort::vftable;
        local_d8 = local_128;
        local_d4 = local_124;
        local_108 = Proud::AddrPort::vftable;
        local_100 = local_110;
        local_fc = local_10c;
        FUN_140141fd0(lVar16,*(undefined4 *)(param_3 + 0x6f8),&local_108,&local_e0);
        iVar6 = FUN_140142230(lVar16);
        if ((iVar6 == 2) && (iVar5 == 1)) {
          lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x4a8);
          uVar10 = FUN_1401421b0(lVar16,local_78,*(undefined4 *)(lVar8 + 0x6f8));
          uVar11 = FUN_1401420b0(lVar16,local_98,*(undefined4 *)(lVar8 + 0x6f8));
          (**(code **)(lVar3 + 0x60))
                    (*(longlong *)(param_1 + 0x148) + 0x4a8,*(undefined4 *)(param_3 + 0x6f8),
                     &DAT_140318cf0,lVar8 + 0x6f8,uVar11,uVar10);
          lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x4a8);
          uVar10 = FUN_1401421b0(lVar16,local_58,*(undefined4 *)(param_3 + 0x6f8));
          uVar11 = FUN_1401420b0(lVar16,local_88,*(undefined4 *)(param_3 + 0x6f8));
          (**(code **)(lVar3 + 0x60))
                    (*(longlong *)(param_1 + 0x148) + 0x4a8,*(undefined4 *)(lVar8 + 0x6f8),
                     &DAT_140318cf0,param_3 + 0x6f8,uVar11,uVar10);
          uVar18 = (undefined4)((ulonglong)uVar11 >> 0x20);
          if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0) {
            FUN_1400a3440();
            local_138 = PTR_DAT_1402f8010;
            puVar12 = (undefined8 *)FUN_1401421b0(lVar16,local_68,*(undefined4 *)(lVar8 + 0x6f8));
            puVar13 = (undefined8 *)FUN_1401421b0(lVar16,local_48,*(undefined4 *)(param_3 + 0x6f8));
            plVar9 = (longlong *)(**(code **)*puVar12)(puVar12,&local_e8);
            plVar14 = (longlong *)(**(code **)*puVar13)(puVar13,&local_120);
            puVar17 = (undefined *)*plVar9;
            if ((undefined *)*plVar9 == (undefined *)0x0) {
              puVar17 = PTR_DAT_1402f8010;
            }
            puVar15 = (undefined *)*plVar14;
            if ((undefined *)*plVar14 == (undefined *)0x0) {
              puVar15 = PTR_DAT_1402f8010;
            }
            FUN_14003c600(&local_138,&DAT_1402599f0,*(undefined4 *)(param_3 + 0x6f8),
                          *(undefined4 *)(lVar8 + 0x6f8),
                          CONCAT44(uVar18,*(undefined4 *)(param_3 + 0x6f8)),puVar15,
                          *(undefined4 *)(lVar8 + 0x6f8),puVar17);
            if (((local_120 != (undefined *)0x0) && (local_120 != PTR_DAT_1402f8010)) &&
               (local_120 + -8 != (undefined *)0x0)) {
              uVar10 = FUN_1400a3440();
              local_b0 = uVar10;
              FUN_1400a1c30(uVar10);
              local_a8 = 1;
              piVar1 = (int *)(local_120 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(local_120 + -8);
              }
              FUN_1400d1290(uVar10);
            }
            local_120 = PTR_DAT_1402f8010;
            if (((local_e8 != (undefined *)0x0) && (local_e8 != PTR_DAT_1402f8010)) &&
               (local_e8 + -8 != (undefined *)0x0)) {
              uVar10 = FUN_1400a3440();
              local_c0 = uVar10;
              FUN_1400a1c30(uVar10);
              local_b8 = 1;
              piVar1 = (int *)(local_e8 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(local_e8 + -8);
              }
              FUN_1400d1290(uVar10);
            }
            puVar17 = local_138;
            puVar15 = local_138;
            if (local_138 == (undefined *)0x0) {
              puVar15 = PTR_DAT_1402f8010;
            }
            FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),1,puVar15);
            if (((puVar17 != (undefined *)0x0) && (puVar17 != PTR_DAT_1402f8010)) &&
               (puVar17 + -8 != (undefined *)0x0)) {
              uVar10 = FUN_1400a3440();
              local_d0 = uVar10;
              FUN_1400a1c30(uVar10);
              local_c8 = 1;
              piVar1 = (int *)(puVar17 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(puVar17 + -8);
              }
              FUN_1400d1290(uVar10);
            }
          }
        }
      }
    }
    FUN_1400d1290(uVar7);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14018c720(longlong param_1,undefined8 param_2,longlong param_3,longlong param_4)

{
  undefined **ppuVar1;
  int *piVar2;
  undefined **ppuVar3;
  char cVar4;
  undefined2 uVar5;
  undefined8 uVar6;
  longlong *plVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined *puVar10;
  undefined *puVar11;
  undefined1 auStack_db8 [32];
  undefined4 *local_d98;
  undefined8 *local_d90;
  undefined *local_d88;
  undefined1 local_d80 [8];
  longlong local_d78;
  longlong local_d70;
  undefined4 local_d68;
  int local_d64;
  undefined8 local_d58;
  undefined8 local_d50;
  undefined1 local_d48;
  undefined4 local_d44;
  undefined1 local_d40;
  undefined1 local_d3f;
  undefined8 local_d38;
  undefined1 local_d30;
  undefined8 local_d28;
  undefined1 local_d20 [72];
  undefined8 local_cd8;
  undefined8 uStack_cd0;
  undefined4 local_cc8;
  undefined4 uStack_cc4;
  undefined4 uStack_cc0;
  undefined4 uStack_cbc;
  undefined4 *local_48;
  undefined4 local_40;
  int local_3c;
  ulonglong local_38;
  
  local_d28 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_db8;
  FUN_140169430(param_4 + 0x40);
  local_cd8 = (undefined **)0x0;
  uStack_cd0 = 0;
  cVar4 = FUN_140185490(param_2,&local_cd8);
  if (cVar4 != '\0') {
    FUN_140185560(local_d80);
    FUN_140185030(local_d80);
    FUN_1401856c0(local_d80,0x800);
    FUN_1401856c0(local_d80,0);
    FUN_14003c9e0(local_d80,0xd);
    FUN_14003cba0(local_d80,&local_cd8);
    FUN_140186160(local_d80,param_3);
    local_3c = 200;
    local_40 = 0;
    local_48 = &local_cc8;
    if (local_d78 == 0) {
      if (local_d70 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
    }
    else {
      local_d68 = *(undefined4 *)(local_d78 + 0x18);
    }
    lVar9 = local_d70;
    if (local_d70 == 0) {
      if (local_d78 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      lVar9 = 0;
      if (*(int *)(local_d78 + 0x18) != 0) {
        lVar9 = *(longlong *)(local_d78 + 0x10);
      }
    }
    local_40 = 1;
    local_cd8._0_4_ = (undefined4)lVar9;
    local_cd8._4_4_ = (undefined4)((ulonglong)lVar9 >> 0x20);
    local_cc8 = (undefined4)local_cd8;
    uStack_cc4 = local_cd8._4_4_;
    uStack_cbc = uStack_cd0._4_4_;
    local_d58 = CONCAT44(local_d58._4_4_,5);
    local_d50 = 0;
    local_d48 = 1;
    local_d44 = 0xffffffff;
    local_d40 = 1;
    local_d3f = DAT_1402f81cc;
    local_cd8 = Proud::AddrPort::vftable;
    uStack_cd0 = CONCAT26(uStack_cd0._6_2_,*(undefined6 *)(param_3 + 8));
    uStack_cc0 = local_d68;
    uVar5 = FUN_14019c290(1);
    local_d90 = &local_d58;
    local_d98 = &local_cc8;
    FUN_1401a18d0(param_4,0,uVar5,&local_cd8);
    if (local_48 == (undefined4 *)0x0) {
      FUN_1400a2320(local_d20,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_d20,(ThrowInfo *)&DAT_1402f4860);
    }
    if (local_3c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    uVar6 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    local_d38 = uVar6;
    FUN_1400a1c30(uVar6);
    local_d30 = 1;
    if (DAT_140313fcf != '\0') {
      (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                (*(longlong **)(param_1 + 0x148),
                 L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_ServerHolepunch");
    }
    if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0) {
      FUN_1400a3440();
      local_d88 = PTR_DAT_1402f8010;
      plVar7 = (longlong *)FUN_1400a6f50(param_3,&local_cd8);
      puVar10 = (undefined *)*plVar7;
      if ((undefined *)*plVar7 == (undefined *)0x0) {
        puVar10 = PTR_DAT_1402f8010;
      }
      FUN_14003c600(&local_d88,L"MessageType_ServerHolepunch from %s",puVar10);
      ppuVar3 = local_cd8;
      if (((local_cd8 != (undefined **)0x0) && (local_cd8 != (undefined **)PTR_DAT_1402f8010)) &&
         (ppuVar1 = local_cd8 + -1, ppuVar1 != (undefined **)0x0)) {
        uVar8 = FUN_1400a3440();
        local_d58 = uVar8;
        FUN_1400a1c30(uVar8);
        local_d50 = CONCAT71(local_d50._1_7_,1);
        piVar2 = (int *)((longlong)ppuVar3 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(ppuVar1);
        }
        FUN_1400d1290(uVar8);
      }
      puVar10 = local_d88;
      puVar11 = local_d88;
      if (local_d88 == (undefined *)0x0) {
        puVar11 = PTR_DAT_1402f8010;
      }
      FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),1,puVar11);
      if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1402f8010)) &&
         (puVar10 + -8 != (undefined *)0x0)) {
        uVar8 = FUN_1400a3440();
        local_d58 = uVar8;
        FUN_1400a1c30(uVar8);
        local_d50 = CONCAT71(local_d50._1_7_,1);
        piVar2 = (int *)(puVar10 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(puVar10 + -8);
        }
        FUN_1400d1290(uVar8);
      }
    }
    FUN_1400d1290(uVar6);
    local_cd8 = (undefined **)&local_d78;
    FUN_14019a730(&local_d78);
    if ((local_d70 != 0) && (local_d64 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14018cac0(longlong param_1,undefined8 param_2,longlong param_3,longlong param_4)

{
  undefined **ppuVar1;
  int *piVar2;
  undefined **ppuVar3;
  char cVar4;
  undefined2 uVar5;
  longlong lVar6;
  undefined8 uVar7;
  longlong *plVar8;
  undefined8 uVar9;
  undefined *puVar10;
  undefined *puVar11;
  undefined1 auStack_dc8 [32];
  undefined4 *local_da8;
  undefined8 *local_da0;
  undefined4 local_d98 [2];
  undefined *local_d90;
  undefined1 local_d88 [8];
  longlong local_d80;
  longlong local_d78;
  undefined4 local_d70;
  int local_d6c;
  undefined8 local_d60;
  undefined8 local_d58;
  undefined1 local_d50;
  undefined4 local_d4c;
  undefined1 local_d48;
  undefined1 local_d47;
  undefined8 local_d40;
  undefined1 local_d38;
  undefined8 local_d30;
  undefined1 local_d28 [80];
  undefined8 local_cd8;
  undefined8 uStack_cd0;
  undefined4 local_cc8;
  undefined4 uStack_cc4;
  undefined4 uStack_cc0;
  undefined4 uStack_cbc;
  undefined4 *local_48;
  undefined4 local_40;
  int local_3c;
  ulonglong local_38;
  
  local_d30 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_dc8;
  FUN_140169430(param_4 + 0x40);
  local_cd8 = (undefined **)0x0;
  uStack_cd0 = 0;
  cVar4 = FUN_140185490(param_2,&local_cd8);
  if ((cVar4 != '\0') && (cVar4 = FUN_140185f20(param_2,local_d98), cVar4 != '\0')) {
    FUN_140185560(local_d88);
    FUN_140185030(local_d88);
    FUN_1401856c0(local_d88,0x800);
    FUN_1401856c0(local_d88,0);
    FUN_14003c9e0(local_d88,0x11);
    FUN_14003cba0(local_d88,&local_cd8);
    FUN_140186160(local_d88,param_3);
    FUN_14007c6e0(local_d88,local_d98[0]);
    local_3c = 200;
    local_40 = 0;
    local_48 = &local_cc8;
    if (local_d80 == 0) {
      if (local_d78 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
    }
    else {
      local_d70 = *(undefined4 *)(local_d80 + 0x18);
    }
    lVar6 = local_d78;
    if (local_d78 == 0) {
      if (local_d80 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      lVar6 = 0;
      if (*(int *)(local_d80 + 0x18) != 0) {
        lVar6 = *(longlong *)(local_d80 + 0x10);
      }
    }
    local_40 = 1;
    local_cd8._0_4_ = (undefined4)lVar6;
    local_cd8._4_4_ = (undefined4)((ulonglong)lVar6 >> 0x20);
    local_cc8 = (undefined4)local_cd8;
    uStack_cc4 = local_cd8._4_4_;
    uStack_cbc = uStack_cd0._4_4_;
    local_d60 = CONCAT44(local_d60._4_4_,5);
    local_d58 = 0;
    local_d50 = 1;
    local_d4c = 0xffffffff;
    local_d48 = 1;
    local_d47 = DAT_1402f81cc;
    local_cd8 = Proud::AddrPort::vftable;
    uStack_cd0 = CONCAT26(uStack_cd0._6_2_,*(undefined6 *)(param_3 + 8));
    uStack_cc0 = local_d70;
    uVar5 = FUN_14019c290(1);
    local_da0 = &local_d60;
    local_da8 = &local_cc8;
    FUN_1401a18d0(param_4,0,uVar5,&local_cd8);
    if (local_48 == (undefined4 *)0x0) {
      FUN_1400a2320(local_d28,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_d28,(ThrowInfo *)&DAT_1402f4860);
    }
    if (local_3c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    uVar7 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    local_d40 = uVar7;
    FUN_1400a1c30(uVar7);
    local_d38 = 1;
    if (DAT_140313fcf != '\0') {
      (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                (*(longlong **)(param_1 + 0x148),
                 L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_PeerUdp_ServerHolepunch");
    }
    if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0) {
      FUN_1400a3440();
      local_d90 = PTR_DAT_1402f8010;
      plVar8 = (longlong *)FUN_1400a6f50(param_3,&local_cd8);
      puVar10 = (undefined *)*plVar8;
      if ((undefined *)*plVar8 == (undefined *)0x0) {
        puVar10 = PTR_DAT_1402f8010;
      }
      FUN_14003c600(&local_d90,L"MessageType_PeerUdp_ServerHolepunch from %s",puVar10);
      ppuVar3 = local_cd8;
      if (((local_cd8 != (undefined **)0x0) && (local_cd8 != (undefined **)PTR_DAT_1402f8010)) &&
         (ppuVar1 = local_cd8 + -1, ppuVar1 != (undefined **)0x0)) {
        uVar9 = FUN_1400a3440();
        local_d60 = uVar9;
        FUN_1400a1c30(uVar9);
        local_d58 = CONCAT71(local_d58._1_7_,1);
        piVar2 = (int *)((longlong)ppuVar3 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(ppuVar1);
        }
        FUN_1400d1290(uVar9);
      }
      puVar10 = local_d90;
      puVar11 = local_d90;
      if (local_d90 == (undefined *)0x0) {
        puVar11 = PTR_DAT_1402f8010;
      }
      FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),1,puVar11);
      if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1402f8010)) &&
         (puVar10 + -8 != (undefined *)0x0)) {
        uVar9 = FUN_1400a3440();
        local_d60 = uVar9;
        FUN_1400a1c30(uVar9);
        local_d58 = CONCAT71(local_d58._1_7_,1);
        piVar2 = (int *)(puVar10 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(puVar10 + -8);
        }
        FUN_1400d1290(uVar9);
      }
    }
    FUN_1400d1290(uVar7);
    local_cd8 = (undefined **)&local_d80;
    FUN_14019a730(&local_d80);
    if ((local_d78 != 0) && (local_d6c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
  }
  return;
}



void FUN_14018ce80(undefined8 param_1)

{
  DWORD DVar1;
  
  DVar1 = GetCurrentThreadId();
  FUN_1400aaed0(DVar1,"PNSrv Heartbeat");
  FUN_14018b910(param_1);
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x00014018d55c)

void FUN_14018ceb0(longlong param_1,int *param_2,longlong *param_3)

{
  int iVar1;
  undefined4 uVar2;
  longlong *plVar3;
  undefined8 uVar4;
  code *pcVar5;
  char cVar6;
  int iVar7;
  longlong lVar8;
  ulonglong uVar9;
  undefined4 *puVar10;
  undefined8 uVar11;
  longlong lVar12;
  longlong lVar13;
  ulonglong uVar14;
  undefined1 *puVar15;
  undefined1 *puVar16;
  undefined1 *puVar17;
  int iVar18;
  undefined8 *puVar19;
  longlong lVar20;
  undefined8 *puVar21;
  ulonglong uVar22;
  undefined1 auStack_1b88 [32];
  int local_1b68 [2];
  longlong *local_1b60;
  longlong *local_1b58;
  undefined **local_1b50;
  longlong *local_1b48;
  longlong local_1b40;
  undefined8 local_1b38;
  undefined8 local_1b30;
  undefined4 local_1b28;
  undefined1 local_1b20 [8];
  longlong local_1b18;
  longlong local_1b10;
  undefined4 local_1b08;
  int local_1b04;
  undefined8 local_1af8;
  char local_1af0;
  undefined4 local_1ae8;
  undefined4 uStack_1ae4;
  undefined4 local_1ad8;
  undefined4 uStack_1ad4;
  undefined8 local_1ad0;
  undefined1 local_1ac8;
  undefined8 local_1ac0;
  undefined1 local_1ab8;
  undefined8 local_1ab0;
  undefined4 uStack_1aa8;
  undefined4 uStack_1aa4;
  undefined8 local_1aa0;
  undefined1 local_1a98;
  undefined8 local_1a90;
  undefined4 uStack_1a88;
  undefined4 uStack_1a84;
  undefined8 local_1a80;
  undefined1 local_1a78 [88];
  undefined8 local_1a20;
  undefined1 local_1a18 [8];
  longlong local_1a10;
  longlong local_1a08;
  undefined4 local_1a00;
  int local_19fc;
  undefined1 local_19f0 [136];
  undefined4 local_1968;
  undefined4 uStack_1964;
  undefined4 uStack_1960;
  undefined4 uStack_195c;
  undefined4 *local_ce8;
  undefined4 local_ce0;
  int local_cdc;
  undefined1 local_cd8 [3200];
  undefined1 *local_58;
  undefined4 local_50;
  int local_4c;
  ulonglong local_48;
  undefined8 uStack_40;
  
  uStack_40 = 0x14018cec6;
  puVar15 = auStack_1b88;
  puVar17 = auStack_1b88;
  local_1a80 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)local_1b68;
  uVar14 = 0;
  local_1b48 = (longlong *)0x0;
  local_1b40 = 0;
  local_1b38 = 0;
  local_1b30 = 0;
  local_1b50 = Proud::BypassDestList::vftable;
  cVar6 = thunk_FUN_1401860d0(param_2,&local_1b50);
  puVar16 = auStack_1b88;
  if ((cVar6 == '\0') ||
     (cVar6 = FUN_140185b30(param_2,&local_1b58), plVar3 = local_1b58, puVar16 = auStack_1b88,
     cVar6 == '\0')) {
LAB_14018d6ab:
    lVar8 = local_1b40;
    plVar3 = local_1b48;
    local_1b50 = Proud::CFastArray<>::vftable;
    if (local_1b40 == 0) goto LAB_14018d6db;
    puVar17 = puVar16;
    if (local_1b48 != (longlong *)0x0) {
      pcVar5 = *(code **)(*local_1b48 + 0x18);
      *(undefined8 *)(puVar16 + -8) = 0x14018d6d4;
      (*pcVar5)(plVar3,lVar8);
      goto LAB_14018d6db;
    }
  }
  else {
    iVar18 = (int)local_1b58;
    if ((-1 < iVar18) && (iVar18 < DAT_1402f8140)) {
      iVar1 = *param_2;
      iVar7 = FUN_1401450b0(param_2);
      if (((int)((iVar1 >> 0x1f & 7U) + iVar1) >> 3) + iVar18 != iVar7) {
        FUN_140164080(*(undefined8 *)(param_1 + 0x148),param_3,
                      "msg.GetReadOffset() + payloadLength == msg.GetLength()",2);
      }
      FUN_140185560(local_1b20);
      cVar6 = FUN_1401857c0(param_2,local_1b20,(ulonglong)plVar3 & 0xffffffff);
      if (cVar6 == '\0') {
        FUN_140164080(*(undefined8 *)(param_1 + 0x148),param_3,&DAT_140279374,2);
        local_1b58 = &local_1b18;
        FUN_14019a730(&local_1b18);
        puVar16 = auStack_1b88;
        if (local_1b10 != 0) {
          if (local_1b04 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          local_1b08 = 0;
          puVar16 = auStack_1b88;
        }
      }
      else {
        lVar8 = (longlong)(int)local_1b38;
        local_1b60 = (longlong *)CONCAT44(local_1b60._4_4_,(int)local_1b38);
        if ((int)local_1b38 < 1) {
          local_1b58 = &local_1b18;
          FUN_14019a730(&local_1b18);
          puVar16 = auStack_1b88;
          if (local_1b10 != 0) {
            if (local_1b04 < 0) {
                    // WARNING: Subroutine does not return
              FUN_1400a26d0();
            }
            local_1b08 = 0;
            puVar16 = auStack_1b88;
          }
        }
        else {
          lVar12 = lVar8 * 0x18;
          uVar22 = lVar12 + 0x10;
          if (uVar22 < 0x401) {
            uVar9 = lVar12 + 0x1f;
            if (uVar9 <= uVar22) {
              uVar9 = 0xffffffffffffff0;
            }
            lVar12 = -(uVar9 & 0xfffffffffffffff0);
            puVar15 = auStack_1b88 + lVar12;
            puVar10 = (undefined4 *)((longlong)local_1b68 + lVar12);
            puVar21 = (undefined8 *)0x0;
            if (puVar10 != (undefined4 *)0x0) {
              *puVar10 = 0xcccc;
              puVar15 = auStack_1b88 + lVar12;
LAB_14018d08b:
              puVar21 = (undefined8 *)(puVar10 + 4);
            }
          }
          else {
            puVar10 = malloc(uVar22);
            puVar21 = (undefined8 *)0x0;
            if (puVar10 != (undefined4 *)0x0) {
              *puVar10 = 0xdddd;
              puVar15 = auStack_1b88;
              goto LAB_14018d08b;
            }
          }
          pcVar5 = *(code **)(**(longlong **)(param_1 + 0x148) + 0x58);
          *(undefined8 *)(puVar15 + -8) = 0x14018d09c;
          uVar11 = (*pcVar5)();
          local_1ad0 = uVar11;
          *(undefined8 *)(puVar15 + -8) = 0x14018d0ab;
          FUN_1400a1c30(uVar11);
          local_1ac8 = 1;
          plVar3 = *(longlong **)(param_1 + 0x148);
          if (DAT_140313fcf != '\0') {
            pcVar5 = *(code **)(*plVar3 + 200);
            *(undefined8 *)(puVar15 + -8) = 0x14018d0d3;
            (*pcVar5)(plVar3,L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_ReliableRelay1")
            ;
          }
          pcVar5 = *(code **)(*param_3 + 0x10);
          *(undefined8 *)(puVar15 + -8) = 0x14018d0dd;
          local_1b28 = (*pcVar5)(param_3);
          local_1b68[0] = 0;
          puVar19 = puVar21;
          uVar22 = uVar14;
          if (0 < lVar8) {
            do {
              lVar8 = local_1b40;
              if ((longlong)uVar14 < 0) {
LAB_14018d17e:
                    // WARNING: Subroutine does not return
                *(undefined **)(puVar15 + -8) = &UNK_14018d183;
                FUN_1400a2700();
              }
              if ((int)local_1b38 <= (int)uVar22) goto LAB_14018d17e;
              uVar2 = *(undefined4 *)(local_1b40 + uVar14 * 8);
              uVar11 = *(undefined8 *)(param_1 + 0x148);
              *(undefined8 *)(puVar15 + -8) = 0x14018d11f;
              lVar12 = FUN_140146cc0(uVar11,uVar2);
              if (lVar12 != 0) {
                *(undefined8 *)(puVar15 + -8) = 0x14018d133;
                FUN_1401a1450(lVar12 + 0xc0);
                local_1ae8 = *(undefined4 *)(lVar8 + 4 + uVar14 * 8);
                local_1ad8 = *(undefined4 *)(lVar8 + uVar14 * 8);
                *puVar19 = CONCAT44(uStack_1ae4,local_1ae8);
                puVar19[1] = lVar12;
                puVar19[2] = CONCAT44(uStack_1ad4,local_1ad8);
                local_1b68[0] = local_1b68[0] + 1;
                puVar19 = puVar19 + 3;
              }
              uVar14 = uVar14 + 1;
              uVar22 = (ulonglong)((int)uVar22 + 1);
            } while ((longlong)uVar14 < (longlong)(int)local_1b60);
          }
          uVar11 = local_1ad0;
          iVar18 = local_1b68[0];
          *(undefined8 *)(puVar15 + -8) = 0x14018d190;
          FUN_1400d1290(uVar11);
          local_1ac8 = 0;
          lVar8 = (longlong)iVar18;
          while ((0 < lVar8 && (lVar12 = 0, 0 < lVar8))) {
            lVar20 = lVar8 * 0x18 + -0x18;
            do {
              uVar14 = puVar21[lVar12 * 3];
              local_1b60 = (longlong *)puVar21[lVar12 * 3 + 1];
              local_1a20 = puVar21[lVar12 * 3 + 2];
              pcVar5 = *(code **)(*(longlong *)(puVar21[lVar12 * 3 + 1] + 0x108) + 0x10);
              *(undefined8 *)(puVar15 + -8) = 0x14018d1eb;
              uVar11 = (*pcVar5)();
              local_1af0 = 0;
              local_1af8 = uVar11;
              *(undefined8 *)(puVar15 + -8) = 0x14018d202;
              FUN_140185560(local_1a18);
              *(undefined8 *)(puVar15 + -8) = 0x14018d21c;
              FUN_1401851e0(local_1a18,local_19f0,0x80);
              *(undefined8 *)(puVar15 + -8) = 0x14018d22b;
              FUN_14003c9e0(local_1a18,0x17);
              uVar2 = local_1b28;
              *(undefined8 *)(puVar15 + -8) = 0x14018d23a;
              FUN_14007c6e0(local_1a18,uVar2);
              *(undefined8 *)(puVar15 + -8) = 0x14018d248;
              FUN_14007c6e0(local_1a18,uVar14 & 0xffffffff);
              *(undefined8 *)(puVar15 + -8) = 0x14018d25b;
              FUN_140184fb0(&local_1ae8,local_1a18);
              lVar13 = (longlong)(int)local_1b58;
              *(undefined8 *)(puVar15 + -8) = 0x14018d26c;
              FUN_140186930(local_1a18,lVar13);
              local_4c = 200;
              local_50 = 0;
              local_58 = local_cd8;
              local_cdc = 200;
              local_ce0 = 0;
              local_ce8 = &local_1968;
              if (local_1a10 == 0) {
                uVar2 = local_1a00;
                if (local_1a08 == 0) {
                    // WARNING: Subroutine does not return
                  *(undefined8 *)(puVar15 + -8) = 0x14018d61d;
                  FUN_14019a830();
                }
              }
              else {
                uVar2 = *(undefined4 *)(local_1a10 + 0x18);
              }
              lVar13 = local_1a08;
              if (local_1a08 == 0) {
                if (local_1a10 == 0) {
                    // WARNING: Subroutine does not return
                  *(undefined **)(puVar15 + -8) = &UNK_14018d617;
                  FUN_14019a830();
                }
                lVar13 = 0;
                if (*(int *)(local_1a10 + 0x18) != 0) {
                  lVar13 = *(longlong *)(local_1a10 + 0x10);
                }
              }
              local_ce0 = 1;
              local_1ab0._0_4_ = (undefined4)lVar13;
              local_1ab0._4_4_ = (undefined4)((ulonglong)lVar13 >> 0x20);
              local_1968 = (undefined4)local_1ab0;
              uStack_1964 = local_1ab0._4_4_;
              uStack_195c = uStack_1aa4;
              local_1ab0 = lVar13;
              uStack_1aa8 = uVar2;
              uStack_1960 = uVar2;
              *(undefined8 *)(puVar15 + -8) = 0x14018d323;
              FUN_140145c70(local_cd8,&local_1968);
              if (local_ce8 == (undefined4 *)0x0) {
                *(undefined8 *)(puVar15 + -8) = 0x14018d5fe;
                FUN_1400a2320(local_1a78,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
                *(undefined8 *)(puVar15 + -8) = 0x14018d611;
                _CxxThrowException(local_1a78,(ThrowInfo *)&DAT_1402f4860);
              }
              if (local_cdc < 0) {
                    // WARNING: Subroutine does not return
                *(undefined **)(puVar15 + -8) = &UNK_14018d5ea;
                FUN_1400a26d0();
              }
              local_cdc = 200;
              local_ce0 = 0;
              local_ce8 = &local_1968;
              if (local_1b18 == 0) {
                uVar2 = local_1b08;
                if (local_1b10 == 0) {
                    // WARNING: Subroutine does not return
                  *(undefined8 *)(puVar15 + -8) = 0x14018d5e4;
                  FUN_14019a830();
                }
              }
              else {
                uVar2 = *(undefined4 *)(local_1b18 + 0x18);
              }
              lVar13 = local_1b10;
              if (local_1b10 == 0) {
                if (local_1b18 == 0) {
                    // WARNING: Subroutine does not return
                  *(undefined **)(puVar15 + -8) = &UNK_14018d5de;
                  FUN_14019a830();
                }
                lVar13 = 0;
                if (*(int *)(local_1b18 + 0x18) != 0) {
                  lVar13 = *(longlong *)(local_1b18 + 0x10);
                }
              }
              local_ce0 = 1;
              local_1a90._0_4_ = (undefined4)lVar13;
              local_1a90._4_4_ = (undefined4)((ulonglong)lVar13 >> 0x20);
              local_1968 = (undefined4)local_1a90;
              uStack_1964 = local_1a90._4_4_;
              uStack_195c = uStack_1a84;
              local_1a90 = lVar13;
              uStack_1a88 = uVar2;
              uStack_1960 = uVar2;
              *(undefined8 *)(puVar15 + -8) = 0x14018d3cd;
              FUN_140145c70(local_cd8,&local_1968);
              if (local_ce8 == (undefined4 *)0x0) {
                *(undefined8 *)(puVar15 + -8) = 0x14018d5c5;
                FUN_1400a2320(local_1a78,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
                *(undefined8 *)(puVar15 + -8) = 0x14018d5d8;
                _CxxThrowException(local_1a78,(ThrowInfo *)&DAT_1402f4860);
              }
              if (local_cdc < 0) {
                    // WARNING: Subroutine does not return
                *(undefined **)(puVar15 + -8) = &UNK_14018d5b1;
                FUN_1400a26d0();
              }
              if (lVar12 == 0) {
                local_1af0 = 1;
                *(undefined8 *)(puVar15 + -8) = 0x14018d485;
                FUN_1400a1c30(uVar11);
                plVar3 = local_1b60;
                local_1aa0 = 0;
                local_1a98 = 1;
                uVar4 = *(undefined8 *)((longlong)local_1b60 + 0x748);
                *(undefined8 *)(puVar15 + -8) = 0x14018d4b1;
                FUN_1401a12a0(uVar4,local_cd8,&local_1aa0);
                *(undefined8 *)(puVar15 + -8) = 0x14018d4b9;
                FUN_1400d1290(uVar11);
                local_1af0 = '\0';
                *(undefined8 *)(puVar15 + -8) = 0x14018d4ca;
                FUN_1401a1460((longlong)plVar3 + 0xc0);
                puVar21[1] = 0;
                *puVar21 = *(undefined8 *)(lVar20 + (longlong)puVar21);
                puVar21[1] = *(undefined8 *)(lVar20 + 8 + (longlong)puVar21);
                puVar21[2] = *(undefined8 *)(lVar20 + 0x10 + (longlong)puVar21);
LAB_14018d4eb:
                local_1b68[0] = local_1b68[0] + -1;
                lVar8 = lVar8 + -1;
                lVar20 = lVar20 + -0x18;
              }
              else {
                *(undefined8 *)(puVar15 + -8) = 0x14018d3fa;
                local_1af0 = FUN_1400a1c80();
                if (local_1af0 != '\0') {
                  local_1ac0 = 0;
                  local_1ab8 = 1;
                  uVar4 = *(undefined8 *)((longlong)local_1b60 + 0x748);
                  *(undefined8 *)(puVar15 + -8) = 0x14018d438;
                  FUN_1401a12a0(uVar4,local_cd8,&local_1ac0);
                  *(undefined8 *)(puVar15 + -8) = 0x14018d440;
                  FUN_1400d1290(uVar11);
                  local_1af0 = '\0';
                  lVar13 = (longlong)local_1b60 + 0xc0;
                  *(undefined8 *)(puVar15 + -8) = 0x14018d455;
                  FUN_1401a1460(lVar13);
                  puVar21[lVar12 * 3 + 1] = 0;
                  puVar21[lVar12 * 3] = *(undefined8 *)(lVar20 + (longlong)puVar21);
                  puVar21[lVar12 * 3 + 1] = *(undefined8 *)(lVar20 + 8 + (longlong)puVar21);
                  puVar21[lVar12 * 3 + 2] = *(undefined8 *)(lVar20 + 0x10 + (longlong)puVar21);
                  goto LAB_14018d4eb;
                }
              }
              if (local_58 == (undefined1 *)0x0) {
                *(undefined8 *)(puVar15 + -8) = 0x14018d598;
                FUN_1400a2320(local_1a78,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
                *(undefined8 *)(puVar15 + -8) = 0x14018d5ab;
                _CxxThrowException(local_1a78,(ThrowInfo *)&DAT_1402f4860);
              }
              if (local_4c < 0) {
                    // WARNING: Subroutine does not return
                *(undefined **)(puVar15 + -8) = &UNK_14018d584;
                FUN_1400a26d0();
              }
              local_50 = 0;
              *(undefined8 *)(puVar15 + -8) = 0x14018d522;
              FUN_140184fd0(&local_1ae8);
              local_1b60 = &local_1a10;
              *(undefined8 *)(puVar15 + -8) = 0x14018d53a;
              FUN_14019a730(&local_1a10);
              if (local_1a08 != 0) {
                if (local_19fc < 0) {
                    // WARNING: Subroutine does not return
                  *(undefined8 *)(puVar15 + -8) = 0x14018d57e;
                  FUN_1400a26d0();
                }
                local_1a00 = 0;
              }
              lVar12 = lVar12 + 1;
            } while (lVar12 < lVar8);
          }
          if ((puVar21 != (undefined8 *)0x0) && (*(int *)(puVar21 + -2) == 0xdddd)) {
            *(undefined8 *)(puVar15 + -8) = 0x14018d635;
            free(puVar21 + -2);
          }
          local_1b58 = &local_1b18;
          *(undefined8 *)(puVar15 + -8) = 0x14018d647;
          FUN_14019a730(&local_1b18);
          puVar16 = puVar15;
          if (local_1b10 != 0) {
            if (local_1b04 < 0) {
                    // WARNING: Subroutine does not return
              *(undefined **)(puVar15 + -8) = &UNK_14018d65a;
              FUN_1400a26d0();
            }
            local_1b08 = 0;
          }
        }
      }
      goto LAB_14018d6ab;
    }
    FUN_140164080(*(undefined8 *)(param_1 + 0x148),param_3,&DAT_140279374,2);
    local_1b50 = Proud::CFastArray<>::vftable;
    puVar16 = auStack_1b88;
    if (local_1b40 == 0) goto LAB_14018d6db;
    if (local_1b48 != (longlong *)0x0) {
      (**(code **)(*local_1b48 + 0x18))();
      puVar16 = auStack_1b88;
      goto LAB_14018d6db;
    }
  }
  lVar8 = local_1b40;
  local_1b50 = Proud::CFastArray<>::vftable;
  *(undefined8 *)(puVar17 + -8) = 0x14018d6db;
  FUN_1400a3530(lVar8);
  puVar16 = puVar17;
LAB_14018d6db:
  *(undefined8 *)(puVar16 + -8) = 0x14018d6ea;
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x00014018dd3e)

void FUN_14018d710(longlong param_1,int *param_2,longlong *param_3)

{
  int iVar1;
  undefined4 uVar2;
  code *pcVar3;
  longlong *plVar4;
  char cVar5;
  int iVar6;
  ulonglong uVar7;
  undefined4 *puVar8;
  undefined8 uVar9;
  longlong lVar10;
  ulonglong uVar11;
  longlong lVar12;
  longlong *plVar13;
  int iVar14;
  ulonglong uVar15;
  undefined1 *puVar16;
  undefined1 *puVar17;
  longlong lVar18;
  longlong *plVar19;
  longlong lVar20;
  longlong *plVar21;
  longlong *plVar22;
  undefined1 auStack_1b18 [32];
  undefined4 local_1af8;
  undefined4 local_1af4;
  undefined8 local_1af0;
  ulonglong local_1ae8;
  undefined1 *local_1ae0;
  char local_1ad8;
  undefined4 local_1ad0 [2];
  longlong local_1ac8;
  undefined1 local_1ac0;
  undefined4 local_1abc;
  undefined1 local_1ab8;
  undefined1 local_1ab7;
  undefined4 local_1ab0 [2];
  undefined **local_1aa8;
  longlong *local_1aa0;
  longlong *local_1a98;
  ulonglong local_1a90;
  undefined8 local_1a88;
  undefined1 local_1a80 [8];
  undefined1 local_1a78 [8];
  longlong local_1a70;
  undefined4 local_1a68;
  int local_1a64;
  longlong local_1a58;
  longlong *local_1a50;
  longlong local_1a48;
  undefined8 local_1a40;
  undefined1 local_1a38;
  undefined8 local_1a30;
  undefined1 local_1a28 [16];
  undefined1 local_1a18 [8];
  undefined1 local_1a10 [8];
  longlong local_1a08;
  undefined4 local_1a00;
  int local_19fc;
  undefined1 local_19f0 [136];
  undefined1 local_1968 [3200];
  undefined1 *local_ce8;
  undefined4 local_ce0;
  undefined4 local_cdc;
  undefined1 local_cd8 [3216];
  ulonglong local_48;
  undefined8 uStack_40;
  
  uStack_40 = 0x14018d726;
  puVar17 = auStack_1b18;
  local_1a30 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)&local_1af8;
  local_1a58 = param_1;
  cVar5 = FUN_140185cc0(param_2,local_1ab0);
  puVar16 = auStack_1b18;
  if ((cVar5 == '\0') ||
     (cVar5 = FUN_140185b30(param_2,&local_1a48), puVar16 = auStack_1b18, cVar5 == '\0'))
  goto LAB_14018de4f;
  plVar19 = (longlong *)0x0;
  local_1aa0 = (longlong *)0x0;
  local_1a98 = (longlong *)0x0;
  local_1a90 = 0;
  local_1a88 = 0;
  local_1aa8 = Proud::HostIDArray::vftable;
  cVar5 = FUN_140185b30(param_2,&local_1ae8);
  plVar13 = plVar19;
  plVar21 = plVar19;
  if ((cVar5 == '\0') ||
     ((iVar14 = (int)local_1ae8, plVar21 = (longlong *)0x0, iVar14 < 0 || (DAT_1402f8140 < iVar14)))
     ) {
LAB_14018de2f:
    puVar16 = auStack_1b18;
    if (plVar21 == (longlong *)0x0) goto LAB_14018de4f;
    puVar16 = auStack_1b18;
    if (plVar13 == (longlong *)0x0) {
LAB_14018de47:
      *(undefined8 *)(puVar16 + -8) = 0x14018de4f;
      FUN_1400a3530(plVar21);
      goto LAB_14018de4f;
    }
    lVar10 = *plVar13;
    puVar16 = auStack_1b18;
  }
  else {
    FUN_140143980(&local_1aa8,local_1ae8 & 0xffffffff);
    plVar21 = local_1a98;
    plVar13 = local_1a98;
    if ((int)local_1a90 == 0) {
      plVar13 = plVar19;
    }
    cVar5 = FUN_140185490(param_2,plVar13,iVar14 * 4);
    plVar13 = local_1aa0;
    if (cVar5 == '\0') goto LAB_14018de2f;
    cVar5 = FUN_140185b30(param_2,&local_1ae8);
    uVar15 = local_1ae8;
    puVar16 = auStack_1b18;
    if (cVar5 != '\0') {
      iVar14 = (int)local_1ae8;
      if ((iVar14 < 0) || (DAT_1402f8140 <= iVar14)) {
        FUN_140164080(*(undefined8 *)(param_1 + 0x148),param_3,
                      "Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_UnreliableRelay1",2);
        puVar16 = auStack_1b18;
      }
      else {
        iVar1 = *param_2;
        iVar6 = FUN_1401450b0(param_2);
        if (((int)((iVar1 >> 0x1f & 7U) + iVar1) >> 3) + iVar14 != iVar6) {
          FUN_140164080(*(undefined8 *)(param_1 + 0x148),param_3,
                        "msg.GetReadOffset() + payloadLength == msg.GetLength()",2);
        }
        FUN_140185560(local_1a80);
        cVar5 = FUN_1401857c0(param_2,local_1a80,uVar15 & 0xffffffff);
        if (cVar5 == '\0') {
          FUN_140164080(*(undefined8 *)(param_1 + 0x148),param_3,
                        "Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_UnreliableRelay1",2);
          local_1ae0 = local_1a78;
          FUN_14019a730(local_1a78);
          puVar16 = auStack_1b18;
          if (local_1a70 != 0) {
            if (local_1a64 < 0) {
                    // WARNING: Subroutine does not return
              FUN_1400a26d0();
            }
            local_1a68 = 0;
            puVar16 = auStack_1b18;
          }
        }
        else {
          iVar14 = (int)local_1a90;
          uVar15 = (ulonglong)(int)local_1a90;
          if ((int)local_1a90 < 1) {
            local_1ae0 = local_1a78;
            FUN_14019a730(local_1a78);
            puVar16 = auStack_1b18;
            if (local_1a70 != 0) {
              if (local_1a64 < 0) {
                    // WARNING: Subroutine does not return
                FUN_1400a26d0();
              }
              local_1a68 = 0;
              puVar16 = auStack_1b18;
            }
          }
          else {
            uVar11 = (uVar15 + 1) * 0x10;
            local_1ae0 = (undefined1 *)uVar15;
            if (uVar11 < 0x401) {
              uVar7 = uVar11 + 0xf;
              if (uVar7 <= uVar11) {
                uVar7 = 0xffffffffffffff0;
              }
              lVar10 = -(uVar7 & 0xfffffffffffffff0);
              puVar17 = auStack_1b18 + lVar10;
              puVar8 = (undefined4 *)((longlong)&local_1af8 + lVar10);
              plVar13 = (longlong *)0x0;
              if (puVar8 != (undefined4 *)0x0) {
                *puVar8 = 0xcccc;
                puVar17 = auStack_1b18 + lVar10;
LAB_14018d9a2:
                plVar13 = (longlong *)(puVar8 + 4);
              }
            }
            else {
              puVar8 = malloc(uVar11);
              plVar13 = (longlong *)0x0;
              if (puVar8 != (undefined4 *)0x0) {
                *puVar8 = 0xdddd;
                puVar17 = auStack_1b18;
                goto LAB_14018d9a2;
              }
            }
            pcVar3 = *(code **)(**(longlong **)(param_1 + 0x148) + 0x58);
            *(undefined8 *)(puVar17 + -8) = 0x14018d9b3;
            uVar9 = (*pcVar3)();
            local_1a40 = uVar9;
            *(undefined8 *)(puVar17 + -8) = 0x14018d9c2;
            FUN_1400a1c30(uVar9);
            local_1a38 = 1;
            plVar22 = *(longlong **)(param_1 + 0x148);
            if (DAT_140313fcf != '\0') {
              pcVar3 = *(code **)(*plVar22 + 200);
              *(undefined8 *)(puVar17 + -8) = 0x14018d9ea;
              (*pcVar3)(plVar22,
                        L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_UnreliableRelay1");
            }
            pcVar3 = *(code **)(*param_3 + 0x10);
            *(undefined8 *)(puVar17 + -8) = 0x14018d9f4;
            local_1af4 = (*pcVar3)(param_3);
            local_1af0 = (ulonglong)local_1af0._4_4_ << 0x20;
            plVar22 = plVar19;
            plVar4 = plVar13;
            if (0 < iVar14) {
              do {
                local_1a50 = plVar4;
                if (((longlong)plVar19 < 0) || ((int)uVar15 <= (int)plVar22)) {
                    // WARNING: Subroutine does not return
                  *(undefined **)(puVar17 + -8) = &UNK_14018da97;
                  FUN_1400a2700();
                }
                uVar2 = *(undefined4 *)((longlong)plVar21 + (longlong)plVar19 * 4);
                uVar9 = *(undefined8 *)(param_1 + 0x148);
                *(undefined8 *)(puVar17 + -8) = 0x14018da2d;
                lVar10 = FUN_140146cc0(uVar9,uVar2);
                local_1ac8 = CONCAT44(local_1ac8._4_4_,uVar2);
                if (lVar10 != 0) {
                  *(undefined8 *)(puVar17 + -8) = 0x14018da44;
                  FUN_1401a1450(lVar10 + 0xc0);
                  uVar9 = *(undefined8 *)(local_1a58 + 0x148);
                  *(undefined8 *)(puVar17 + -8) = 0x14018da5a;
                  FUN_14015a140(uVar9,lVar10);
                  *local_1a50 = lVar10;
                  local_1a50[1] = local_1ac8;
                  local_1af0 = CONCAT44(local_1af0._4_4_,(int)local_1af0 + 1);
                  local_1a50 = local_1a50 + 2;
                }
                plVar19 = (longlong *)((longlong)plVar19 + 1);
                uVar15 = local_1a90 & 0xffffffff;
                param_1 = local_1a58;
                plVar22 = (longlong *)(ulonglong)((int)plVar22 + 1);
                plVar4 = local_1a50;
              } while ((longlong)plVar19 < (longlong)local_1ae0);
            }
            uVar9 = local_1a40;
            *(undefined8 *)(puVar17 + -8) = 0x14018daa4;
            FUN_1400d1290(uVar9);
            local_1a38 = 0;
            *(undefined8 *)(puVar17 + -8) = 0x14018dab7;
            FUN_140185560(local_1a18);
            *(undefined8 *)(puVar17 + -8) = 0x14018dad1;
            FUN_1401851e0(local_1a18,local_19f0,0x80);
            *(undefined8 *)(puVar17 + -8) = 0x14018dae0;
            FUN_14003c9e0(local_1a18,0x18);
            uVar2 = local_1af4;
            *(undefined8 *)(puVar17 + -8) = 0x14018daef;
            FUN_14007c6e0(local_1a18,uVar2);
            *(undefined8 *)(puVar17 + -8) = 0x14018db02;
            FUN_140184fb0(local_1a28,local_1a18);
            lVar10 = (longlong)(int)local_1ae8;
            *(undefined8 *)(puVar17 + -8) = 0x14018db13;
            FUN_140186930(local_1a18,lVar10);
            local_cdc = 200;
            local_ce0 = 0;
            local_ce8 = local_1968;
            *(undefined8 *)(puVar17 + -8) = 0x14018db44;
            FUN_140146970(local_cd8,local_1a18);
            *(undefined8 *)(puVar17 + -8) = 0x14018db58;
            FUN_140145c70(local_1968,local_cd8);
            *(undefined8 *)(puVar17 + -8) = 0x14018db65;
            FUN_140145b60(local_cd8);
            *(undefined8 *)(puVar17 + -8) = 0x14018db75;
            FUN_140146970(local_cd8,local_1a80);
            *(undefined8 *)(puVar17 + -8) = 0x14018db89;
            FUN_140145c70(local_1968,local_cd8);
            *(undefined8 *)(puVar17 + -8) = 0x14018db96;
            FUN_140145b60(local_cd8);
            local_1af8._1_1_ = DAT_140318d80;
            local_1af8._0_1_ = DAT_140318da0;
            local_1af4 = local_1ab0[0];
            lVar10 = (longlong)(int)local_1af0;
            while ((0 < lVar10 && (lVar20 = 0, plVar21 = local_1a98, 0 < lVar10))) {
              lVar18 = lVar10 * 0x10 + -0x10;
              do {
                lVar12 = plVar13[lVar20 * 2];
                local_1af0 = lVar12;
                local_1ae8 = plVar13[lVar20 * 2 + 1];
                pcVar3 = *(code **)(*(longlong *)(lVar12 + 0x108) + 0x10);
                *(undefined8 *)(puVar17 + -8) = 0x14018dc04;
                uVar15 = (*pcVar3)();
                local_1ad8 = 0;
                local_1ae0 = (undefined1 *)uVar15;
                if (lVar20 == 0) {
                  local_1ad8 = 1;
                  *(undefined8 *)(puVar17 + -8) = 0x14018dcbb;
                  FUN_1400a1c30(uVar15);
                  local_1ad0[0] = local_1af4;
                  local_1ac8 = local_1a48;
                  local_1ac0 = local_1af8._1_1_;
                  local_1abc = 0xffffffff;
                  local_1ab8 = (undefined1)local_1af8;
                  local_1ab7 = 0;
                  uVar11 = local_1ae8 & 0xffffffff;
                  *(undefined8 *)(puVar17 + -8) = 0x14018dcff;
                  FUN_1401a2c20(lVar12 + 0x700,uVar11,local_1968,local_1ad0);
                  *(undefined8 *)(puVar17 + -8) = 0x14018dd07;
                  FUN_1400d1290(uVar15);
                  local_1ad8 = '\0';
                  lVar12 = local_1af0 + 0xc0;
                  *(undefined8 *)(puVar17 + -8) = 0x14018dd1c;
                  FUN_1401a1460(lVar12);
                  *plVar13 = 0;
                  *plVar13 = *(longlong *)(lVar18 + (longlong)plVar13);
                  plVar13[1] = *(longlong *)(lVar18 + 8 + (longlong)plVar13);
LAB_14018dd33:
                  lVar10 = lVar10 + -1;
                  lVar18 = lVar18 + -0x10;
                }
                else {
                  *(undefined8 *)(puVar17 + -8) = 0x14018dc20;
                  local_1ad8 = FUN_1400a1c80();
                  if (local_1ad8 != '\0') {
                    local_1ad0[0] = local_1af4;
                    local_1ac8 = local_1a48;
                    local_1ac0 = local_1af8._1_1_;
                    local_1abc = 0xffffffff;
                    local_1ab8 = (undefined1)local_1af8;
                    local_1ab7 = 0;
                    lVar12 = local_1af0 + 0x700;
                    uVar11 = local_1ae8 & 0xffffffff;
                    *(undefined8 *)(puVar17 + -8) = 0x14018dc76;
                    FUN_1401a2c20(lVar12,uVar11,local_1968,local_1ad0);
                    *(undefined8 *)(puVar17 + -8) = 0x14018dc7e;
                    FUN_1400d1290(uVar15);
                    local_1ad8 = '\0';
                    lVar12 = local_1af0 + 0xc0;
                    *(undefined8 *)(puVar17 + -8) = 0x14018dc93;
                    FUN_1401a1460(lVar12);
                    plVar13[lVar20 * 2] = 0;
                    plVar13[lVar20 * 2] = *(longlong *)(lVar18 + (longlong)plVar13);
                    plVar13[lVar20 * 2 + 1] = *(longlong *)(lVar18 + 8 + (longlong)plVar13);
                    goto LAB_14018dd33;
                  }
                }
                lVar20 = lVar20 + 1;
                plVar21 = local_1a98;
              } while (lVar20 < lVar10);
            }
            if ((plVar13 != (longlong *)0x0) && ((int)plVar13[-2] == 0xdddd)) {
              *(undefined8 *)(puVar17 + -8) = 0x14018dd7f;
              free(plVar13 + -2);
            }
            *(undefined8 *)(puVar17 + -8) = 0x14018dd8c;
            FUN_140145b60(local_1968);
            *(undefined8 *)(puVar17 + -8) = 0x14018dd99;
            FUN_140184fd0(local_1a28);
            local_1ae0 = local_1a10;
            *(undefined8 *)(puVar17 + -8) = 0x14018ddb1;
            FUN_14019a730(local_1a10);
            if (local_1a08 != 0) {
              if (local_19fc < 0) {
                    // WARNING: Subroutine does not return
                *(undefined **)(puVar17 + -8) = &UNK_14018ddca;
                FUN_1400a26d0();
              }
              local_1a00 = 0;
            }
            local_1ae0 = local_1a78;
            *(undefined8 *)(puVar17 + -8) = 0x14018dde8;
            FUN_14019a730(local_1a78);
            puVar16 = puVar17;
            if (local_1a70 != 0) {
              if (local_1a64 < 0) {
                    // WARNING: Subroutine does not return
                *(undefined **)(puVar17 + -8) = &UNK_14018de01;
                FUN_1400a26d0();
              }
              local_1a68 = 0;
            }
          }
        }
      }
    }
    if (plVar21 == (longlong *)0x0) goto LAB_14018de4f;
    if (local_1aa0 == (longlong *)0x0) goto LAB_14018de47;
    lVar10 = *local_1aa0;
    plVar13 = local_1aa0;
  }
  pcVar3 = *(code **)(lVar10 + 0x18);
  *(undefined8 *)(puVar16 + -8) = 0x14018de45;
  (*pcVar3)(plVar13,plVar21);
LAB_14018de4f:
  *(undefined8 *)(puVar16 + -8) = 0x14018de5e;
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14018de80(longlong param_1,int *param_2,longlong *param_3)

{
  int iVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  longlong lVar6;
  int iVar7;
  undefined1 auStack_1aa8 [32];
  undefined1 *local_1a88;
  undefined1 local_1a80;
  undefined4 local_1a78;
  undefined4 local_1a74;
  undefined1 local_1a70 [8];
  undefined1 local_1a68 [8];
  longlong local_1a60;
  int local_1a54;
  undefined8 local_1a48;
  undefined1 local_1a40;
  undefined8 local_1a38;
  undefined1 local_1a30;
  undefined1 local_1a28 [16];
  undefined8 local_1a18;
  undefined1 local_1a08 [8];
  undefined1 local_1a00 [8];
  longlong local_19f8;
  undefined4 local_19f0;
  int local_19ec;
  undefined1 local_19e0 [136];
  undefined1 local_1958 [3200];
  undefined1 *local_cd8;
  undefined4 local_cd0;
  undefined4 local_ccc;
  undefined1 local_cc8 [3216];
  ulonglong local_38;
  undefined8 uStack_30;
  
  uStack_30 = 0x14018de9a;
  local_1a18 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_1aa8;
  FUN_140169430(param_3 + 0x18);
  cVar2 = FUN_140185f20(param_2,&local_1a78);
  if (cVar2 != '\0') {
    cVar2 = FUN_140185490(param_2,&local_1a74,4);
    if (cVar2 != '\0') {
      cVar2 = FUN_140185b30(param_2,&local_1a88);
      if (cVar2 != '\0') {
        iVar7 = (int)local_1a88;
        if ((iVar7 < 0) || (DAT_1402f8140 <= iVar7)) {
          FUN_140164080(*(undefined8 *)(param_1 + 0x148),param_3,
                        "Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_LingerDataFrame1",2);
        }
        else {
          iVar1 = *param_2;
          iVar3 = FUN_1401450b0(param_2);
          if (((int)((iVar1 >> 0x1f & 7U) + iVar1) >> 3) + iVar7 != iVar3) {
            FUN_140164080(*(undefined8 *)(param_1 + 0x148),param_3,
                          "msg.GetReadOffset() + frameLength == msg.GetLength()",2);
          }
          FUN_140185560(local_1a70);
          cVar2 = FUN_1401857c0(param_2,local_1a70,(ulonglong)local_1a88 & 0xffffffff);
          if (cVar2 == '\0') {
            FUN_140164080(*(longlong **)(param_1 + 0x148),param_3,
                          "Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_LingerDataFrame1",2)
            ;
            local_1a88 = local_1a68;
            FUN_14019a730(local_1a68);
            if ((local_1a60 != 0) && (local_1a54 < 0)) {
                    // WARNING: Subroutine does not return
              FUN_1400a26d0();
            }
          }
          else {
            uVar5 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
            local_1a48 = uVar5;
            FUN_1400a1c30(uVar5);
            local_1a40 = 1;
            if (DAT_140313fcf != '\0') {
              (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                        (*(longlong **)(param_1 + 0x148),
                         L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_LingerDataFrame1");
            }
            uVar4 = (**(code **)(*param_3 + 0x10))(param_3);
            lVar6 = FUN_140146cc0(*(undefined8 *)(param_1 + 0x148),local_1a78);
            if (lVar6 == 0) {
              FUN_1400d1290(uVar5);
              local_1a88 = local_1a68;
              FUN_14019a730(local_1a68);
              if ((local_1a60 != 0) && (local_1a54 < 0)) {
                    // WARNING: Subroutine does not return
                FUN_1400a26d0();
              }
            }
            else {
              FUN_1400d1290(uVar5);
              local_1a40 = 0;
              FUN_140185560(local_1a08);
              FUN_1401851e0(local_1a08,local_19e0,0x80);
              FUN_14003c9e0(local_1a08,0x19);
              FUN_14007c6e0(local_1a08,uVar4);
              FUN_14007c6e0(local_1a08,local_1a74);
              FUN_140184fb0(local_1a28,local_1a08);
              FUN_140186930(local_1a08,(longlong)iVar7);
              local_ccc = 200;
              local_cd0 = 0;
              local_cd8 = local_1958;
              FUN_140146970(local_cc8,local_1a08);
              FUN_140145c70(local_1958,local_cc8);
              FUN_140145b60(local_cc8);
              FUN_140146970(local_cc8,local_1a70);
              FUN_140145c70(local_1958,local_cc8);
              FUN_140145b60(local_cc8);
              uVar5 = (**(code **)(*(longlong *)(lVar6 + 0x108) + 0x10))();
              local_1a38 = uVar5;
              FUN_1400a1c30(uVar5);
              local_1a30 = 1;
              local_1a88 = (undefined1 *)0x0;
              local_1a80 = 1;
              FUN_1401a12a0(*(undefined8 *)(lVar6 + 0x748),local_1958,&local_1a88);
              FUN_1400d1290(uVar5);
              FUN_140145b60(local_1958);
              FUN_140184fd0(local_1a28);
              local_1a88 = local_1a00;
              FUN_14019a730(local_1a00);
              if (local_19f8 != 0) {
                if (local_19ec < 0) {
                    // WARNING: Subroutine does not return
                  FUN_1400a26d0();
                }
                local_19f0 = 0;
              }
              local_1a88 = local_1a68;
              FUN_14019a730(local_1a68);
              if ((local_1a60 != 0) && (local_1a54 < 0)) {
                    // WARNING: Subroutine does not return
                FUN_1400a26d0();
              }
            }
          }
        }
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14018e250(longlong param_1,undefined8 param_2,longlong *param_3)

{
  undefined8 uVar1;
  char cVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  double dVar5;
  longlong lVar6;
  undefined1 auStack_da8 [32];
  undefined8 local_d88;
  undefined8 uStack_d80;
  undefined1 local_d78;
  undefined4 local_d74;
  undefined1 local_d70;
  undefined1 local_d6f;
  undefined1 local_d68 [8];
  longlong local_d60;
  longlong local_d58;
  undefined4 local_d50;
  int local_d4c;
  double local_d40;
  undefined1 local_d38;
  undefined8 local_d30;
  undefined1 local_d28;
  undefined8 local_d20;
  undefined1 local_d18 [80];
  undefined4 local_cc8;
  uint uStack_cc4;
  undefined4 uStack_cc0;
  undefined4 uStack_cbc;
  undefined4 *local_48;
  undefined4 local_40;
  int local_3c;
  ulonglong local_38;
  
  local_d20 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_da8;
  FUN_140169430(param_3 + 0x18);
  cVar2 = FUN_140185490(param_2,&local_d88,8);
  if (cVar2 != '\0') {
    cVar2 = FUN_140185490(param_2,&local_d40,8);
    if (cVar2 != '\0') {
      uVar4 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
      local_d30 = uVar4;
      FUN_1400a1c30(uVar4);
      local_d28 = 1;
      if (DAT_140313fcf != '\0') {
        (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                  (*(longlong **)(param_1 + 0x148),
                   L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_RequestServerTimeAndKeepAlive"
                  );
      }
      lVar6 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x118) + 8))();
      param_3[0x33] = lVar6;
      lVar6 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x118) + 8))();
      param_3[0x37] = lVar6;
      param_3[0x38] = (longlong)local_d40;
      param_3[0x39] = (longlong)((local_d40 - (double)param_3[0x39]) * 0.5 + (double)param_3[0x39]);
      FUN_140185560(local_d68);
      FUN_140185030(local_d68);
      FUN_14003c9e0(local_d68,0x1c);
      FUN_14007c8a0(local_d68,local_d88);
      uVar1 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x118) + 8))();
      FUN_14007c8a0(local_d68,uVar1);
      dVar5 = (double)(**(code **)(param_3[0x21] + 0x10))();
      local_d40 = dVar5;
      FUN_1400a1c30(dVar5);
      local_d38 = 1;
      local_3c = 200;
      local_40 = 0;
      local_48 = &local_cc8;
      if (local_d60 == 0) {
        uStack_cc0 = local_d50;
        if (local_d58 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
      }
      else {
        uStack_cc0 = *(undefined4 *)(local_d60 + 0x18);
      }
      lVar6 = local_d58;
      if (local_d58 == 0) {
        if (local_d60 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        lVar6 = 0;
        if (*(int *)(local_d60 + 0x18) != 0) {
          lVar6 = *(longlong *)(local_d60 + 0x10);
        }
      }
      local_40 = 1;
      local_d88._0_4_ = (undefined4)lVar6;
      local_d88._4_4_ = (uint)((ulonglong)lVar6 >> 0x20);
      local_cc8 = (undefined4)local_d88;
      uStack_cc4 = local_d88._4_4_;
      uStack_cbc = uStack_d80._4_4_;
      local_d88 = (longlong *)((ulonglong)local_d88._4_4_ << 0x20);
      uStack_d80 = 0;
      local_d78 = 1;
      local_d74 = 0xffffffff;
      local_d70 = 1;
      local_d6f = DAT_1402f81cc;
      uVar3 = (**(code **)(*param_3 + 0x10))(param_3);
      FUN_1401a2c20(param_3 + 0xe0,uVar3,&local_cc8,&local_d88);
      if (local_48 == (undefined4 *)0x0) {
        FUN_1400a2320(local_d18,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_d18,(ThrowInfo *)&DAT_1402f4860);
      }
      if (local_3c < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      FUN_1400d1290(dVar5);
      local_d88 = &local_d60;
      FUN_14019a730(&local_d60);
      if (local_d58 != 0) {
        if (local_d4c < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        local_d50 = 0;
      }
      FUN_1400d1290(uVar4);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14018e550(undefined8 param_1,longlong param_2)

{
  undefined8 uVar1;
  longlong lVar2;
  undefined1 auStack_d68 [32];
  undefined8 local_d48;
  undefined1 uStack_d40;
  undefined3 uStack_d3f;
  undefined4 uStack_d3c;
  undefined1 local_d38 [8];
  longlong local_d30;
  longlong local_d28;
  undefined4 local_d20;
  int local_d1c;
  undefined8 local_d10;
  undefined1 local_d08;
  undefined8 local_d00;
  undefined1 local_cf8 [80];
  undefined4 local_ca8;
  undefined4 uStack_ca4;
  undefined4 uStack_ca0;
  undefined4 uStack_c9c;
  undefined4 *local_28;
  undefined4 local_20;
  int local_1c;
  ulonglong local_18;
  
  local_d00 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_d68;
  FUN_140185560(local_d38);
  FUN_140185030(local_d38);
  FUN_1401856c0(local_d38,0x800);
  FUN_1401856c0(local_d38,0);
  FUN_14003c9e0(local_d38,8);
  uVar1 = (**(code **)(*(longlong *)(param_2 + 0x108) + 0x10))();
  local_d10 = uVar1;
  FUN_1400a1c30(uVar1);
  local_d08 = 1;
  local_1c = 200;
  local_20 = 0;
  local_28 = &local_ca8;
  if (local_d30 == 0) {
    if (local_d28 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else {
    local_d20 = *(undefined4 *)(local_d30 + 0x18);
  }
  lVar2 = local_d28;
  if (local_d28 == 0) {
    if (local_d30 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    lVar2 = 0;
    if (*(int *)(local_d30 + 0x18) != 0) {
      lVar2 = *(longlong *)(local_d30 + 0x10);
    }
  }
  local_20 = 1;
  local_d48._0_4_ = (undefined4)lVar2;
  local_d48._4_4_ = (undefined4)((ulonglong)lVar2 >> 0x20);
  local_ca8 = (undefined4)local_d48;
  uStack_ca4 = local_d48._4_4_;
  uStack_c9c = uStack_d3c;
  local_d48 = (longlong *)0x0;
  _uStack_d40 = CONCAT31((int3)((uint)local_d20 >> 8),1);
  uStack_ca0 = local_d20;
  FUN_1401a12a0(*(undefined8 *)(param_2 + 0x748),&local_ca8,&local_d48);
  if (local_28 == (undefined4 *)0x0) {
    FUN_1400a2320(local_cf8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_cf8,(ThrowInfo *)&DAT_1402f4860);
  }
  if (local_1c < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_1400d1290(uVar1);
  local_d48 = &local_d30;
  FUN_14019a730(&local_d30);
  if ((local_d28 != 0) && (local_d1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14018e720(longlong param_1,undefined8 param_2,longlong *param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  longlong lVar5;
  double dVar6;
  undefined1 auStack_da8 [32];
  undefined8 local_d88;
  undefined8 uStack_d80;
  undefined1 local_d78;
  undefined4 local_d74;
  undefined1 local_d70;
  undefined1 local_d6f;
  undefined1 local_d68 [8];
  undefined *local_d60;
  longlong local_d58;
  undefined4 local_d50;
  int local_d4c;
  undefined8 local_d40;
  undefined1 local_d38;
  undefined8 local_d30;
  undefined1 local_d28;
  undefined8 local_d20;
  undefined1 local_d18 [80];
  undefined4 local_cc8;
  undefined4 uStack_cc4;
  undefined4 uStack_cc0;
  undefined4 uStack_cbc;
  undefined4 *local_48;
  undefined4 local_40;
  int local_3c;
  ulonglong local_38;
  
  local_d20 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_da8;
  FUN_140169430(param_3 + 0x18);
  uVar3 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  local_d30 = uVar3;
  FUN_1400a1c30(uVar3);
  local_d28 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
              (*(longlong **)(param_1 + 0x148),
               L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_RequestReceiveSpeedAtReceiverSide_NoBypass"
              );
  }
  if (((param_3 != (longlong *)0x0) &&
      (plVar1 = (longlong *)param_3[0xe8], plVar1 != (longlong *)0x0)) && (*plVar1 != 0)) {
    local_d88 = Proud::AddrPort::vftable;
    uStack_d80 = CONCAT26(uStack_d80._6_2_,(int6)param_3[0xe2]);
    dVar6 = (double)FUN_14019cbe0(*(undefined8 *)(*plVar1 + 0x178),&local_d88);
    if (0.0 < dVar6) {
      FUN_140185560(local_d68);
      FUN_140185030(local_d68);
      FUN_1401856c0(local_d68,0x800);
      FUN_1401856c0(local_d68,0);
      FUN_14003c9e0(local_d68,0x28);
      FUN_14007c8a0(local_d68,dVar6);
      uVar4 = (**(code **)(param_3[0x21] + 0x10))();
      local_d40 = uVar4;
      FUN_1400a1c30(uVar4);
      local_d38 = 1;
      local_3c = 200;
      local_40 = 0;
      local_48 = &local_cc8;
      if (local_d60 == (undefined *)0x0) {
        if (local_d58 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
      }
      else {
        local_d50 = *(undefined4 *)(local_d60 + 0x18);
      }
      lVar5 = local_d58;
      if (local_d58 == 0) {
        if (local_d60 == (undefined *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        lVar5 = 0;
        if (*(int *)(local_d60 + 0x18) != 0) {
          lVar5 = *(longlong *)(local_d60 + 0x10);
        }
      }
      local_40 = 1;
      local_d88._0_4_ = (undefined4)lVar5;
      local_d88._4_4_ = (undefined4)((ulonglong)lVar5 >> 0x20);
      local_cc8 = (undefined4)local_d88;
      uStack_cc4 = local_d88._4_4_;
      uStack_cbc = uStack_d80._4_4_;
      local_d88 = (undefined **)CONCAT44(local_d88._4_4_,1);
      uStack_d80 = 0;
      local_d78 = 1;
      local_d74 = 0xffffffff;
      local_d70 = 1;
      local_d6f = DAT_1402f81cc;
      uStack_cc0 = local_d50;
      uVar2 = (**(code **)(*param_3 + 0x10))(param_3);
      FUN_1401a2c20(param_3 + 0xe0,uVar2,&local_cc8,&local_d88);
      if (local_48 == (undefined4 *)0x0) {
        FUN_1400a2320(local_d18,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_d18,(ThrowInfo *)&DAT_1402f4860);
      }
      if (local_3c < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      FUN_1400d1290(uVar4);
      local_d88 = &local_d60;
      FUN_14019a730(&local_d60);
      if ((local_d58 != 0) && (local_d4c < 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
    }
  }
  FUN_1400d1290(uVar3);
  return;
}



undefined8 * FUN_14018e9f0(undefined8 *param_1,uint param_2)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_14018b8a0(param_1[2],(longlong)*(int *)(param_1 + 3));
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



longlong FUN_14018ea60(longlong param_1,longlong param_2)

{
  ulonglong uVar1;
  longlong lVar2;
  uint uVar3;
  
  uVar3 = (uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8);
  uVar1 = (ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + uVar1 * 8);
        (lVar2 != 0 && ((uint)uVar1 == *(uint *)(lVar2 + 0x28) % *(uint *)(param_1 + 0x28)));
        lVar2 = *(longlong *)(lVar2 + 0x18)) {
      if ((*(uint *)(lVar2 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar2 + 0xc) == *(ushort *)(param_2 + 0xc))) {
        return lVar2 + 0x10;
      }
    }
  }
  lVar2 = FUN_14018b820(param_1,param_2,uVar1,uVar3);
  return lVar2 + 0x10;
}



void FUN_14018eb10(undefined8 *param_1)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_14018b8a0(param_1[2],(longlong)*(int *)(param_1 + 3));
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x00014018eb57. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
      return;
    }
    FUN_1400a3530();
  }
  return;
}



undefined8 FUN_14018eb70(undefined8 param_1,longlong param_2,int *param_3,undefined8 param_4)

{
  int iVar1;
  char cVar2;
  undefined8 uVar3;
  int local_res18 [4];
  undefined **local_38;
  undefined4 local_30;
  undefined2 local_2c;
  undefined **local_28;
  undefined4 local_20;
  undefined2 local_1c;
  
  iVar1 = *param_3;
  cVar2 = FUN_140185dc0(param_3,local_res18);
  if (cVar2 == '\0') {
LAB_14018ebac:
    FUN_140185160(param_3,(int)((iVar1 >> 0x1f & 7U) + iVar1) >> 3);
    uVar3 = 0;
  }
  else {
    if (local_res18[0] == 0xc) {
      local_28 = Proud::AddrPort::vftable;
      local_20 = *(undefined4 *)(param_2 + 8);
      local_1c = *(undefined2 *)(param_2 + 0xc);
      FUN_14018c720(param_1,param_3,&local_28,param_4);
    }
    else {
      if (local_res18[0] != 0x10) goto LAB_14018ebac;
      local_38 = Proud::AddrPort::vftable;
      local_30 = *(undefined4 *)(param_2 + 8);
      local_2c = *(undefined2 *)(param_2 + 0xc);
      FUN_14018cac0(param_1,param_3,&local_38,param_4);
    }
    uVar3 = 1;
  }
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14018ec40(longlong param_1,undefined8 param_2,longlong param_3)

{
  char cVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  undefined **ppuVar5;
  undefined8 uVar6;
  bool bVar7;
  undefined1 auStack_da8 [32];
  undefined **local_d88;
  undefined *local_d80;
  longlong local_d78;
  ulonglong local_d70;
  undefined8 local_d68;
  undefined **local_d60;
  undefined8 local_d58;
  longlong local_d50;
  undefined8 local_d48;
  undefined8 local_d40;
  undefined **local_d38;
  undefined8 local_d30;
  undefined8 local_d28;
  undefined8 local_d20;
  undefined8 local_d18;
  undefined8 local_d10;
  undefined1 local_d08;
  undefined8 local_d00;
  undefined **local_cf8;
  undefined4 uStack_cf0;
  undefined4 uStack_cec;
  undefined **local_ce8;
  undefined4 uStack_ce0;
  undefined4 uStack_cdc;
  undefined1 local_cd8 [3216];
  ulonglong local_48;
  
  local_d00 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_da8;
  FUN_140169430(param_3 + 0xc0);
  uVar3 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  local_d10 = uVar3;
  FUN_1400a1c30(uVar3);
  local_d08 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
              (*(longlong **)(param_1 + 0x148),
               L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_NotifyServerConnectionRequestData"
              );
  }
  iVar2 = 0;
  lVar4 = 0;
  if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x1708) != 0) {
    lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x16f8);
  }
  do {
    if (lVar4 == 0) {
      FUN_14018e550(param_1,param_3);
LAB_14018f01f:
      FUN_1400d1290(uVar3);
      return;
    }
    if (param_3 == *(longlong *)(lVar4 + 0x10)) {
      local_d58 = 0;
      local_d50 = 0;
      local_d48 = 0;
      local_d40 = 0;
      local_d60 = Proud::ByteArray::vftable;
      cVar1 = FUN_140185b30(param_2,&local_cf8);
      ppuVar5 = local_cf8;
      if (((cVar1 != '\0') && (-1 < (int)local_cf8)) && ((int)local_cf8 <= DAT_1402f8140)) {
        FUN_14003cda0(&local_d60,(ulonglong)local_cf8 & 0xffffffff);
        lVar4 = local_d50;
        if ((int)local_d48 == 0) {
          lVar4 = 0;
        }
        cVar1 = FUN_140185490(param_2,lVar4,(ulonglong)ppuVar5 & 0xffffffff);
        if (cVar1 != '\0') {
          local_cf8 = (undefined **)0x0;
          uStack_cf0 = 0;
          uStack_cec = 0;
          cVar1 = FUN_140185490(param_2,&local_cf8,0x10);
          if (cVar1 == '\0') {
            FUN_14018e550(param_1,param_3);
            FUN_140140df0(&local_d60);
          }
          else {
            local_ce8 = local_cf8;
            uStack_ce0 = uStack_cf0;
            uStack_cdc = uStack_cec;
            cVar1 = FUN_140185490(param_2,&local_cf8,4);
            if (cVar1 == '\0') {
              FUN_14018e550(param_1,param_3);
              FUN_140140df0(&local_d60);
            }
            else {
              lVar4 = *(longlong *)(param_1 + 0x148);
              bVar7 = local_ce8 < *(undefined ***)(lVar4 + 1000);
              if ((local_ce8 != *(undefined ***)(lVar4 + 1000)) ||
                 (bVar7 = CONCAT44(uStack_cdc,uStack_ce0) < *(ulonglong *)(lVar4 + 0x3f0),
                 CONCAT44(uStack_cdc,uStack_ce0) != *(ulonglong *)(lVar4 + 0x3f0))) {
                iVar2 = (1 - (uint)bVar7) - (uint)(bVar7 != 0);
              }
              if ((iVar2 == 0) && ((int)local_cf8 == *(int *)(lVar4 + 0x220))) {
                cVar1 = FUN_140142b60(param_3 + 0x288);
                if (cVar1 == '\x01') {
                  lVar4 = *(longlong *)(param_1 + 0x148);
                  if (*(longlong *)(lVar4 + 0x758) == 0) {
                    local_d80 = (undefined *)0x0;
                    local_d78 = 0;
                    local_d70 = 0;
                    local_d68 = 0;
                    local_d88 = Proud::ByteArray::vftable;
                    FUN_14015e2b0(lVar4,param_3,&local_d88);
                    FUN_140140df0(&local_d88);
                  }
                  else {
                    local_cf8 = Proud::AddrPort::vftable;
                    uStack_cf0 = *(undefined4 *)(*(longlong *)(param_3 + 0x748) + 0x130);
                    uStack_cec = CONCAT22(uStack_cec._2_2_,
                                          *(undefined2 *)(*(longlong *)(param_3 + 0x748) + 0x134));
                    FUN_140165b30(lVar4,&local_cf8,&local_d60);
                  }
                  FUN_140140df0(&local_d60);
                }
                else {
                  FUN_140185560(&local_d88);
                  FUN_140185030(&local_d88);
                  FUN_1401856c0(&local_d88,0x800);
                  FUN_1401856c0(&local_d88,0);
                  FUN_14003c9e0(&local_d88,9);
                  local_d30 = 0;
                  local_d28 = 0;
                  local_d20 = 0;
                  local_d18 = 0;
                  local_d38 = Proud::ByteArray::vftable;
                  FUN_140186930(&local_d88,0);
                  FUN_140140df0(&local_d38);
                  ppuVar5 = (undefined **)(**(code **)(*(longlong *)(param_3 + 0x108) + 0x10))();
                  local_ce8 = ppuVar5;
                  FUN_1400a1c30(ppuVar5);
                  uStack_ce0 = CONCAT31(uStack_ce0._1_3_,1);
                  uVar6 = FUN_140146970(local_cd8,&local_d88);
                  local_cf8 = (undefined **)0x0;
                  uStack_cf0 = CONCAT31(uStack_cf0._1_3_,1);
                  FUN_1401a12a0(*(undefined8 *)(param_3 + 0x748),uVar6,&local_cf8);
                  FUN_140145b60(local_cd8);
                  FUN_1400d1290(ppuVar5);
                  local_cf8 = &local_d80;
                  FUN_14019a730(&local_d80);
                  if (local_d78 != 0) {
                    if ((longlong)local_d70 < 0) {
                    // WARNING: Subroutine does not return
                      FUN_1400a26d0();
                    }
                    local_d70 = local_d70 & 0xffffffff00000000;
                  }
                  FUN_140140df0(&local_d60);
                }
              }
              else {
                FUN_14018e550(param_1,param_3);
                FUN_140140df0(&local_d60);
              }
            }
          }
          goto LAB_14018f01f;
        }
      }
      FUN_14018e550(param_1,param_3);
      FUN_140140df0(&local_d60);
      goto LAB_14018f01f;
    }
    lVar4 = *(longlong *)(lVar4 + 0x18);
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14018f060(longlong param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  longlong lVar4;
  longlong lVar5;
  undefined1 auStack_db8 [32];
  wchar_t *local_d98;
  int local_d90;
  undefined1 local_d88 [4];
  undefined4 local_d84;
  longlong local_d80;
  longlong local_d78;
  undefined4 local_d70;
  int local_d6c;
  undefined8 local_d60;
  undefined1 uStack_d58;
  undefined3 uStack_d57;
  undefined4 uStack_d54;
  longlong *local_d50;
  undefined1 local_d48;
  undefined8 local_d40;
  undefined1 local_d38;
  undefined **local_d30;
  undefined8 local_d28;
  undefined8 local_d20;
  undefined8 local_d18;
  undefined8 local_d10;
  undefined8 local_ce8;
  undefined4 local_cd8;
  undefined4 uStack_cd4;
  undefined4 uStack_cd0;
  undefined4 uStack_ccc;
  undefined4 *local_58;
  undefined4 local_50;
  int local_4c;
  ulonglong local_48;
  
  local_ce8 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_db8;
  FUN_140169430(param_2 + 0xc0);
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  local_d40 = uVar2;
  FUN_1400a1c30(uVar2);
  local_d38 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
              (*(longlong **)(param_1 + 0x148),
               L"Proud::CNetThreads_S::NetWorkerThread_NewClientCase");
  }
  FUN_1400ace20(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x788),
                *(undefined8 *)(*(longlong *)(param_2 + 0x748) + 0x110));
  FUN_140185560(local_d88);
  FUN_140185030(local_d88);
  FUN_1401856c0(local_d88,0x800);
  FUN_1401856c0(local_d88,0);
  FUN_14003c9e0(local_d88,4);
  FUN_14003c9e0(local_d88,*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0);
  FUN_1401861a0(local_d88,*(longlong *)(param_1 + 0x148) + 0x228);
  lVar4 = *(longlong *)(param_1 + 0x148);
  iVar1 = *(int *)(lVar4 + 0xc68);
  FUN_140186930(local_d88,(longlong)iVar1);
  lVar5 = 0;
  if (*(int *)(lVar4 + 0xc68) != 0) {
    lVar5 = *(longlong *)(lVar4 + 0xc60);
  }
  if (iVar1 == 0) goto LAB_14018f20c;
  local_d84 = 0;
  if (local_d80 == 0) {
    if (local_d78 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830(0,lVar5);
    }
LAB_14018f1de:
    FUN_14003cc90(&local_d78,lVar5,iVar1);
  }
  else {
    if (local_d78 != 0) goto LAB_14018f1de;
    if (local_d80 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830(0,lVar5);
    }
    FUN_14003ce60(local_d80,lVar5,iVar1);
  }
  FUN_14003ced0(local_d88);
LAB_14018f20c:
  FUN_1400d1290(uVar2);
  local_d38 = 0;
  uVar3 = (**(code **)(*(longlong *)(param_2 + 0x108) + 0x10))();
  local_d50 = (longlong *)uVar3;
  FUN_1400a1c30(uVar3);
  local_d48 = 1;
  local_4c = 200;
  local_50 = 0;
  local_58 = &local_cd8;
  if (local_d80 == 0) {
    uStack_cd0 = local_d70;
    if (local_d78 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else {
    uStack_cd0 = *(undefined4 *)(local_d80 + 0x18);
  }
  lVar4 = local_d78;
  if (local_d78 == 0) {
    if (local_d80 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    lVar4 = 0;
    if (*(int *)(local_d80 + 0x18) != 0) {
      lVar4 = *(longlong *)(local_d80 + 0x10);
    }
  }
  local_50 = 1;
  local_d60._0_4_ = (undefined4)lVar4;
  local_d60._4_4_ = (undefined4)((ulonglong)lVar4 >> 0x20);
  local_cd8 = (undefined4)local_d60;
  uStack_cd4 = local_d60._4_4_;
  uStack_ccc = uStack_d54;
  local_d60 = 0;
  _uStack_d58 = CONCAT31((int3)((uint)uStack_cd0 >> 8),1);
  FUN_1401a12a0(*(undefined8 *)(param_2 + 0x748),&local_cd8,&local_d60);
  if (local_58 != (undefined4 *)0x0) {
    if (local_4c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    iVar1 = FUN_1401a0f10(*(undefined8 *)(param_2 + 0x748));
    if (iVar1 == 0) {
      FUN_1400d1290(uVar3);
      local_d48 = 0;
    }
    else {
      FUN_1400d1290(uVar3);
      local_d48 = 0;
      local_d38 = 1;
      FUN_1400a1c30(uVar2);
      local_d28 = 0;
      local_d20 = 0;
      local_d18 = 0;
      local_d10 = 0;
      local_d30 = Proud::ByteArray::vftable;
      local_d98 = L"Proud::CNetThreads_S::NetWorkerThread_NewClientCase";
      local_d90 = iVar1;
      (**(code **)(*(longlong *)(param_2 + 0xa0) + 0x38))(param_2 + 0xa0,0xb,3,&local_d30);
      FUN_140140df0(&local_d30);
      (**(code **)(*(longlong *)(param_2 + 0xa0) + 0x40))
                (param_2 + 0xa0,L"Proud::CNetThreads_S::NetWorkerThread_NewClientCase");
    }
    FUN_1401a1460(param_2 + 0xc0);
    local_d50 = &local_d80;
    FUN_14019a730(&local_d80);
    if (local_d78 != 0) {
      if (local_d6c < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_d70 = 0;
    }
    if (iVar1 != 0) {
      FUN_1400d1290(uVar2);
    }
    return;
  }
  FUN_1400a2320(&local_d30,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
  _CxxThrowException(&local_d30,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_14018f440(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  int iVar4;
  int iVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  longlong lVar10;
  longlong lVar11;
  undefined1 local_c8 [144];
  
  lVar11 = (longlong)param_2;
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  iVar5 = *(int *)(param_1 + 0x18);
  if (param_2 != iVar5) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar5 = FUN_1401a7da0(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
      lVar10 = (longlong)iVar5;
      plVar1 = *(longlong **)(param_1 + 8);
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          puVar2 = (undefined8 *)FUN_1400a34c0(lVar10 << 3);
        }
        else {
          puVar2 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,lVar10 << 3);
        }
        *(undefined8 **)(param_1 + 0x10) = puVar2;
        if (0 < param_2) {
          do {
            if (puVar2 != (undefined8 *)0x0) {
              *puVar2 = 0;
            }
            puVar2 = puVar2 + 1;
            lVar11 = lVar11 + -1;
          } while (lVar11 != 0);
        }
      }
      else {
        lVar11 = *(longlong *)(param_1 + 0x10);
        if (plVar1 == (longlong *)0x0) {
          puVar2 = (undefined8 *)FUN_1400a34c0(lVar10 << 3);
        }
        else {
          puVar2 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,lVar10 << 3);
        }
        iVar4 = *(int *)(param_1 + 0x18);
        uVar7 = 0;
        uVar3 = uVar7;
        uVar9 = uVar7;
        puVar6 = puVar2;
        if (0 < (longlong)iVar4) {
          do {
            if (puVar6 != (undefined8 *)0x0) {
              *puVar6 = 0;
              FUN_14018b790(puVar6,lVar11 + uVar3 * 8);
            }
            uVar8 = (int)uVar9 + 1;
            uVar3 = (longlong)(int)uVar8;
            uVar9 = (ulonglong)uVar8;
            puVar6 = puVar6 + 1;
          } while ((longlong)(int)uVar8 < (longlong)iVar4);
        }
        iVar4 = param_2 - *(int *)(param_1 + 0x18);
        puVar6 = puVar2 + *(int *)(param_1 + 0x18);
        if (0 < iVar4) {
          do {
            if (puVar6 != (undefined8 *)0x0) {
              *puVar6 = 0;
            }
            uVar8 = (int)uVar7 + 1;
            uVar7 = (ulonglong)uVar8;
            puVar6 = puVar6 + 1;
          } while ((int)uVar8 < iVar4);
        }
        if (puVar2 == (undefined8 *)0x0) {
          FUN_1400a2320(local_c8,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_c8,(ThrowInfo *)&DAT_1402f4860);
        }
        FUN_140154a50(lVar11,(longlong)*(int *)(param_1 + 0x18));
        plVar1 = *(longlong **)(param_1 + 8);
        if (plVar1 == (longlong *)0x0) {
          FUN_1400a3530(lVar11);
        }
        else {
          (**(code **)(*plVar1 + 0x18))(plVar1,lVar11);
        }
        *(undefined8 **)(param_1 + 0x10) = puVar2;
      }
      *(int *)(param_1 + 0x1c) = iVar5;
    }
    else if (iVar5 - param_2 < 1) {
      iVar4 = param_2 - iVar5;
      if (0 < iVar4) {
        puVar2 = (undefined8 *)(*(longlong *)(param_1 + 0x10) + (longlong)iVar5 * 8);
        iVar5 = 0;
        if (0 < iVar4) {
          do {
            if (puVar2 != (undefined8 *)0x0) {
              *puVar2 = 0;
            }
            iVar5 = iVar5 + 1;
            puVar2 = puVar2 + 1;
          } while (iVar5 < iVar4);
        }
      }
    }
    else {
      FUN_140154a50(*(longlong *)(param_1 + 0x10) + lVar11 * 8,(longlong)(iVar5 - param_2));
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



undefined8 * FUN_14018f680(undefined8 *param_1,uint param_2)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_14018b8a0(param_1[2],(longlong)*(int *)(param_1 + 3));
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
    }
  }
  if ((param_2 & 1) != 0) {
    FUN_1400a3530(param_1);
  }
  return param_1;
}



longlong FUN_14018f6f0(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  
  FUN_1400a1b50(param_1,0,1,param_4,0xfffffffffffffffe);
  *(undefined ***)(param_1 + 0x38) = Proud::CFastArray<>::vftable;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined ***)(param_1 + 0x60) = Proud::CFastArray<>::vftable;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined8 *)(param_1 + 0x78) = 0;
  *(undefined8 *)(param_1 + 0x80) = 0;
  *(undefined8 *)(param_1 + 0x88) = 0;
  *(undefined8 *)(param_1 + 0x90) = 0;
  FUN_1401bd100(param_1 + 0xa0,DAT_1402f8180);
  FUN_1401bd100(param_1 + 0xb8,DAT_1402f80f8);
  FUN_1400ad530(param_1 + 0x150);
  FUN_1400aaac0(param_1 + 0x158,*(undefined8 *)(param_1 + 0x150),DAT_1402f806c);
  lVar1 = param_2 + 0x120;
  if (param_2 == 0) {
    lVar1 = 0;
  }
  FUN_1401a7940(param_1 + 0x160,lVar1);
  FUN_1401bd100(param_1 + 0x188,DAT_1402f80a8);
  FUN_1401bd100(param_1 + 0x1a0,DAT_1402f80a8);
  FUN_1401bd100(param_1 + 0x1b8,DAT_1402f80b0);
  FUN_1401bd100(param_1 + 0x1d0,DAT_1402f8150);
  FUN_1401bd100(param_1 + 0x1e8,0x3ff0000000000000);
  *(undefined4 *)(param_1 + 0x200) = 0;
  *(undefined4 *)(param_1 + 0x240) = 0;
  FUN_1401bd100(param_1 + 0x248,DAT_1402f80d8);
  *(undefined8 *)(param_1 + 0x100) = 0;
  *(longlong *)(param_1 + 0x148) = param_2;
  *(undefined1 *)(param_1 + 0x140) = 0;
  return param_1;
}



void FUN_14018f890(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  void *pvVar2;
  longlong *plVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  int iVar6;
  longlong lVar7;
  undefined8 uVar8;
  
  uVar8 = 0xfffffffffffffffe;
  uVar4 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  uVar5 = uVar4;
  FUN_1400a1c30(uVar4);
  if (DAT_140313fcf != '\0') {
    lVar7 = **(longlong **)(param_1 + 0x148);
    (**(code **)(lVar7 + 200))
              (*(longlong **)(param_1 + 0x148),L"Proud::CNetThreads_S::~CNetThreads_S",lVar7,param_4
               ,uVar8,uVar5,1);
  }
  *(undefined1 *)(param_1 + 0x140) = 1;
  FUN_1400d1290(uVar4);
  uVar5 = 0;
  if (*(undefined8 **)(param_1 + 0x88) != (undefined8 *)0x0) {
    uVar5 = **(undefined8 **)(param_1 + 0x88);
  }
  FUN_1400aaa10(uVar5);
  if (*(undefined8 **)(param_1 + 0x90) == (undefined8 *)0x0) {
    uVar5 = 0;
  }
  else {
    uVar5 = **(undefined8 **)(param_1 + 0x90);
  }
  FUN_1400aaa10(uVar5);
  FUN_1400a1c30(param_1);
  iVar6 = 0;
  lVar7 = 0;
  if (0 < *(int *)(param_1 + 0x78)) {
    do {
      if ((lVar7 < 0) || (*(int *)(param_1 + 0x78) <= iVar6)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      puVar1 = *(undefined8 **)(*(longlong *)(param_1 + 0x70) + lVar7 * 8);
      uVar5 = 0;
      if (puVar1 != (undefined8 *)0x0) {
        uVar5 = *puVar1;
      }
      FUN_1400aaa10(uVar5);
      iVar6 = iVar6 + 1;
      lVar7 = lVar7 + 1;
    } while (iVar6 < *(int *)(param_1 + 0x78));
  }
  FUN_1400d1290(param_1);
  iVar6 = 0;
  lVar7 = 0;
  if (0 < *(int *)(param_1 + 0x50)) {
    do {
      if ((lVar7 < 0) || (*(int *)(param_1 + 0x50) <= iVar6)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      puVar1 = *(undefined8 **)(*(longlong *)(param_1 + 0x48) + lVar7 * 8);
      uVar5 = 0;
      if (puVar1 != (undefined8 *)0x0) {
        uVar5 = *puVar1;
      }
      FUN_1400aaa10(uVar5);
      iVar6 = iVar6 + 1;
      lVar7 = lVar7 + 1;
    } while (iVar6 < *(int *)(param_1 + 0x50));
  }
  CloseHandle(*(HANDLE *)(param_1 + 0x180));
  FUN_14018ac00(param_1 + 0x168);
  FUN_1400aab00(param_1 + 0x158);
  FUN_14018a2d0(param_1 + 0x150);
  if ((*(longlong *)(param_1 + 0x90) != 0) &&
     (*(longlong *)(*(longlong *)(param_1 + 0x90) + 8) =
           *(longlong *)(*(longlong *)(param_1 + 0x90) + 8) + -1,
     *(longlong *)(*(longlong *)(param_1 + 0x90) + 8) == 0)) {
    puVar1 = *(undefined8 **)(param_1 + 0x90);
    pvVar2 = (void *)*puVar1;
    if (pvVar2 != (void *)0x0) {
      FUN_1400aaa90(pvVar2);
      operator_delete(pvVar2);
    }
    FUN_1400a3530(puVar1);
  }
  if ((*(longlong *)(param_1 + 0x88) != 0) &&
     (*(longlong *)(*(longlong *)(param_1 + 0x88) + 8) =
           *(longlong *)(*(longlong *)(param_1 + 0x88) + 8) + -1,
     *(longlong *)(*(longlong *)(param_1 + 0x88) + 8) == 0)) {
    puVar1 = *(undefined8 **)(param_1 + 0x88);
    pvVar2 = (void *)*puVar1;
    if (pvVar2 != (void *)0x0) {
      FUN_1400aaa90(pvVar2);
      operator_delete(pvVar2);
    }
    FUN_1400a3530(puVar1);
  }
  *(undefined ***)(param_1 + 0x60) = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 0x78)) {
    FUN_140154a50(*(undefined8 *)(param_1 + 0x70),(longlong)*(int *)(param_1 + 0x78));
  }
  if (*(longlong *)(param_1 + 0x70) != 0) {
    plVar3 = *(longlong **)(param_1 + 0x68);
    if (plVar3 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar3 + 0x18))(plVar3,*(longlong *)(param_1 + 0x70));
    }
  }
  *(undefined ***)(param_1 + 0x38) = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 0x50)) {
    FUN_140154a50(*(undefined8 *)(param_1 + 0x48),(longlong)*(int *)(param_1 + 0x50));
  }
  if (*(longlong *)(param_1 + 0x48) != 0) {
    plVar3 = *(longlong **)(param_1 + 0x40);
    if (plVar3 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar3 + 0x18))(plVar3,*(longlong *)(param_1 + 0x48));
    }
  }
  FUN_1400a1cd0(param_1);
  return;
}



undefined8 FUN_14018fb50(longlong param_1,undefined8 param_2,longlong param_3)

{
  int *piVar1;
  uint uVar2;
  longlong lVar3;
  ulonglong uVar4;
  char cVar5;
  undefined8 uVar6;
  undefined *puVar7;
  longlong *plVar8;
  undefined8 *puVar9;
  undefined **ppuVar10;
  longlong lVar11;
  undefined *puVar12;
  undefined *local_res8;
  undefined *local_res20;
  undefined **local_60;
  undefined4 local_58;
  undefined2 local_54;
  undefined8 local_50;
  undefined1 local_48;
  
  uVar6 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  local_50 = uVar6;
  FUN_1400a1c30(uVar6);
  local_48 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x148) + 200))();
  }
  FUN_1400ad790(*(longlong *)(param_1 + 0x148) + 0x760);
  local_res8 = (undefined *)FUN_1400a34c0(0x780);
  puVar12 = (undefined *)0x0;
  puVar7 = puVar12;
  if (local_res8 != (undefined *)0x0) {
    local_60 = Proud::AddrPort::vftable;
    local_58 = *(undefined4 *)(param_3 + 8);
    local_54 = *(undefined2 *)(param_3 + 0xc);
    puVar7 = (undefined *)
             FUN_14019b9b0(local_res8,*(undefined8 *)(param_1 + 0x148),param_2,&local_60);
  }
  lVar3 = *(longlong *)(param_1 + 0x148);
  lVar11 = lVar3 + 0x1740;
  uVar2 = *(uint *)(lVar3 + 0x1768);
  uVar4 = ((ulonglong)puVar7 & 0xffffffff) % (ulonglong)uVar2;
  lVar3 = *(longlong *)(lVar3 + 0x1748);
  local_res8 = puVar7;
  if (lVar3 != 0) {
    for (plVar8 = *(longlong **)(lVar3 + uVar4 * 8);
        (plVar8 != (longlong *)0x0 && ((uint)uVar4 == *(uint *)(plVar8 + 4) % uVar2));
        plVar8 = (longlong *)plVar8[2]) {
      if ((undefined *)*plVar8 == puVar7) goto LAB_14018fcf9;
    }
    if (lVar3 != 0) {
      for (plVar8 = *(longlong **)(lVar3 + uVar4 * 8);
          (plVar8 != (longlong *)0x0 && ((uint)uVar4 == *(uint *)(plVar8 + 4) % uVar2));
          plVar8 = (longlong *)plVar8[2]) {
        if ((undefined *)*plVar8 == puVar7) goto LAB_14018fcf5;
      }
      if (lVar3 != 0) goto LAB_14018fccc;
    }
  }
  cVar5 = FUN_140144560(lVar11,(ulonglong)uVar2,CONCAT71((int7)((ulonglong)lVar3 >> 8),1));
  if (cVar5 == '\0') {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x8007000e);
  }
LAB_14018fccc:
  FUN_1401b2030(lVar11);
  plVar8 = (longlong *)FUN_1401465e0(lVar11,&local_res8,uVar4,(ulonglong)puVar7 & 0xffffffff);
  FUN_1401b2030(lVar11);
LAB_14018fcf5:
  *(undefined1 *)(plVar8 + 1) = 0;
LAB_14018fcf9:
  if (puVar7 != (undefined *)0x0) {
    puVar12 = puVar7 + 0x38;
  }
  FUN_1400a7fb0(*(undefined8 *)(*(longlong *)(puVar7 + 0x748) + 0x110),puVar12);
  FUN_1401a1450(puVar7 + 0xc0);
  FUN_1400ac830(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x788),
                *(undefined8 *)(*(longlong *)(puVar7 + 0x748) + 0x110),0xffffffffffffffff);
  lVar3 = *(longlong *)(param_1 + 0x148);
  uVar4 = (ulonglong)((uint)*(ushort *)(param_3 + 0xc) ^ *(uint *)(param_3 + 8)) %
          (ulonglong)*(uint *)(lVar3 + 0x1710);
  if (*(longlong *)(lVar3 + 0x16f0) != 0) {
    for (lVar11 = *(longlong *)(*(longlong *)(lVar3 + 0x16f0) + uVar4 * 8);
        (lVar11 != 0 && ((uint)uVar4 == *(uint *)(lVar11 + 0x28) % *(uint *)(lVar3 + 0x1710)));
        lVar11 = *(longlong *)(lVar11 + 0x18)) {
      if ((*(uint *)(lVar11 + 8) == *(uint *)(param_3 + 8)) &&
         (*(ushort *)(lVar11 + 0xc) == *(ushort *)(param_3 + 0xc))) goto LAB_14018fdb8;
    }
  }
  puVar9 = (undefined8 *)FUN_14018ea60(lVar3 + 0x16e8,param_3);
  *puVar9 = puVar7;
LAB_14018fdb8:
  if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0) {
    FUN_1400a3440();
    local_res8 = PTR_DAT_1402f8010;
    plVar8 = (longlong *)FUN_1400a6f50(param_3,&local_res20);
    puVar12 = (undefined *)*plVar8;
    if ((undefined *)*plVar8 == (undefined *)0x0) {
      puVar12 = PTR_DAT_1402f8010;
    }
    FUN_14003c600(&local_res8,L"new TCP socket is accepted. RemoteClient_S=%p,TCP socket=%s",puVar7,
                  puVar12);
    if (((local_res20 != (undefined *)0x0) && (local_res20 != PTR_DAT_1402f8010)) &&
       (local_res20 + -8 != (undefined *)0x0)) {
      ppuVar10 = (undefined **)FUN_1400a3440();
      local_60 = ppuVar10;
      FUN_1400a1c30(ppuVar10);
      local_58 = CONCAT31(local_58._1_3_,1);
      piVar1 = (int *)(local_res20 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(local_res20 + -8);
      }
      FUN_1400d1290(ppuVar10);
    }
    puVar12 = local_res8;
    puVar7 = local_res8;
    if (local_res8 == (undefined *)0x0) {
      puVar7 = PTR_DAT_1402f8010;
    }
    FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),0,puVar7);
    if (((puVar12 != (undefined *)0x0) && (puVar12 != PTR_DAT_1402f8010)) &&
       (puVar12 + -8 != (undefined *)0x0)) {
      ppuVar10 = (undefined **)FUN_1400a3440();
      local_60 = ppuVar10;
      FUN_1400a1c30(ppuVar10);
      local_58 = CONCAT31(local_58._1_3_,1);
      piVar1 = (int *)(puVar12 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar12 + -8);
      }
      FUN_1400d1290(ppuVar10);
    }
  }
  FUN_1400d1290(uVar6);
  return 1;
}



longlong FUN_14018ff00(longlong param_1)

{
  undefined *puVar1;
  int *piVar2;
  ulonglong *puVar3;
  undefined *puVar4;
  int iVar5;
  uint uVar6;
  uint uVar7;
  uint uVar8;
  longlong lVar9;
  undefined8 uVar10;
  uint *puVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  uint *puVar14;
  uint uVar15;
  uint uVar16;
  ulonglong uVar17;
  uint *local_res8;
  undefined *local_res10;
  undefined1 local_res18 [8];
  undefined1 local_res20 [8];
  undefined **local_b8;
  undefined8 local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  undefined **local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 local_70;
  undefined8 local_68;
  undefined1 local_60;
  undefined8 local_58;
  undefined1 local_50;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  uVar17 = 0;
  do {
    lVar9 = *(longlong *)(param_1 + 0x148);
    uVar13 = lVar9 + 0x60;
    if (lVar9 == 0) {
      uVar13 = uVar17;
    }
    uVar12 = uVar17;
    if (*(longlong *)(lVar9 + 0x750) != 0) {
      uVar12 = *(ulonglong *)(*(longlong *)(lVar9 + 0x750) + 0x38);
    }
    lVar9 = FUN_140195b30(uVar12,uVar13);
    if (lVar9 == 0) {
      FUN_1400a3440();
      local_res8 = (uint *)PTR_DAT_1402f8010;
      uVar6 = FUN_1400a32c0(L"FATAL: Cannot create TCP socket for AcceptEx!");
      uVar8 = 0;
      if ((local_res8 != (uint *)0x0) && (uVar17 = 0, local_res8 != (uint *)PTR_DAT_1402f8010)) {
        uVar17 = (ulonglong)local_res8[-2];
      }
      uVar7 = uVar6;
      if ((((int)uVar6 <= (int)uVar17) && (uVar7 = uVar8, local_res8 != (uint *)0x0)) &&
         (local_res8 != (uint *)PTR_DAT_1402f8010)) {
        uVar7 = local_res8[-2];
      }
      uVar15 = 1;
      if (1 < (int)uVar7) {
        uVar15 = uVar7;
      }
      uVar7 = uVar8;
      if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
        uVar7 = local_res8[-2];
      }
      uVar16 = 0;
      if ((int)uVar7 < (int)uVar15) {
        if (local_res8 == (uint *)0x0) {
          local_res8 = (uint *)PTR_DAT_1402f8010;
        }
        if ((int)uVar15 < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        if (uVar15 == 0) {
          FUN_1400031d0(&local_res8);
        }
        else {
          uVar7 = uVar8;
          if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
            uVar7 = local_res8[-2];
          }
          if (uVar15 != uVar7) {
            puVar11 = (uint *)FUN_1400a34c0((longlong)(int)uVar15 * 2 + 10);
            if (puVar11 != (uint *)0x0) {
              *puVar11 = 0;
              puVar11[1] = 1;
            }
            *puVar11 = uVar15;
            uVar7 = uVar16;
            if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
              uVar7 = local_res8[-2];
            }
            puVar14 = (uint *)PTR_DAT_1402f8010;
            if ((int)uVar15 < (int)uVar7) {
LAB_1401901a7:
              if (local_res8 != (uint *)0x0) {
                puVar14 = local_res8;
              }
            }
            else {
              uVar15 = uVar8;
              if (local_res8 != (uint *)0x0) {
                if (local_res8 != (uint *)PTR_DAT_1402f8010) {
                  uVar15 = local_res8[-2];
                }
                goto LAB_1401901a7;
              }
            }
            FUN_1400a32f0(puVar11 + 2,puVar14,uVar15);
            FUN_1400031d0(&local_res8);
            local_res8 = puVar11 + 2;
          }
        }
      }
      FUN_140002e30(&local_res8);
      puVar11 = local_res8;
      if (local_res8 == (uint *)0x0) {
        puVar11 = (uint *)PTR_DAT_1402f8010;
      }
      FUN_1400a32f0(puVar11,L"FATAL: Cannot create TCP socket for AcceptEx!",uVar6);
      puVar11 = local_res8;
      if (local_res8 == (uint *)0x0) {
        puVar11 = (uint *)PTR_DAT_1402f8010;
      }
      uVar8 = FUN_1400a32c0(puVar11);
      uVar6 = 0;
      if (0 < (int)uVar8) {
        uVar6 = uVar8;
      }
      uVar8 = uVar16;
      if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
        uVar8 = local_res8[-2];
      }
      if (((int)uVar8 <= (int)uVar6) && (uVar6 = uVar16, local_res8 != (uint *)0x0)) {
        if (local_res8 == (uint *)PTR_DAT_1402f8010) goto LAB_14019025b;
        uVar6 = local_res8[-2];
      }
      if (((local_res8 != (uint *)PTR_DAT_1402f8010) && (local_res8 != (uint *)0x0)) &&
         (local_res8 + -2 != (uint *)0x0)) {
        local_res8[-2] = uVar6;
        *(undefined2 *)((longlong)local_res8 + (longlong)(int)uVar6 * 2) = 0;
      }
LAB_14019025b:
      local_b0 = 0;
      local_a8 = 0;
      local_a0 = 0;
      local_98 = 0;
      local_b8 = Proud::ByteArray::vftable;
      uVar10 = FUN_1401416a0(local_res20,1,1,&local_res8,&local_b8);
      (**(code **)(**(longlong **)(param_1 + 0x148) + 0x80))(*(longlong **)(param_1 + 0x148),uVar10)
      ;
      FUN_140140df0(&local_b8);
      puVar11 = local_res8;
      if (local_res8 == (uint *)0x0) {
        return 0;
      }
      if (local_res8 == (uint *)PTR_DAT_1402f8010) {
        return 0;
      }
      puVar14 = local_res8 + -2;
      if (puVar14 == (uint *)0x0) {
        return 0;
      }
      uVar10 = FUN_1400a3440();
      local_68 = uVar10;
      FUN_1400a1c30(uVar10);
      local_60 = 1;
      puVar11 = puVar11 + -1;
      *puVar11 = *puVar11 - 1;
      if (*puVar11 == 0) {
        FUN_1400a3530(puVar14);
      }
      FUN_1400d1290(uVar10);
      return 0;
    }
    puVar3 = *(ulonglong **)(*(longlong *)(param_1 + 0x148) + 0x748);
    uVar13 = uVar17;
    if (puVar3 != (ulonglong *)0x0) {
      uVar13 = *puVar3;
    }
    iVar5 = FUN_1400a9ec0(uVar13,lVar9);
    if (iVar5 == 0) {
      return lVar9;
    }
    if (iVar5 != 0x2746) {
      if (iVar5 != 0x2736) {
        FUN_1400a3440();
        local_res10 = PTR_DAT_1402f8010;
        FUN_14003c600(&local_res10,
                      L"FATAL: AcceptEx failed with error code %d! No more accept will be possible."
                      ,iVar5);
        local_88 = 0;
        local_80 = 0;
        local_78 = 0;
        local_70 = 0;
        local_90 = Proud::ByteArray::vftable;
        uVar10 = FUN_1401416a0(local_res18,1,1,&local_res10,&local_90);
        (**(code **)(**(longlong **)(param_1 + 0x148) + 0x80))
                  (*(longlong **)(param_1 + 0x148),uVar10);
        FUN_140140df0(&local_90);
        puVar4 = local_res10;
        if (((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1402f8010)) &&
           (puVar1 = local_res10 + -8, puVar1 != (undefined *)0x0)) {
          uVar10 = FUN_1400a3440();
          local_58 = uVar10;
          FUN_1400a1c30(uVar10);
          local_50 = 1;
          piVar2 = (int *)(puVar4 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_1400a3530(puVar1);
          }
          FUN_1400d1290(uVar10);
        }
      }
LAB_140190093:
      FUN_1400a8cc0(lVar9);
      FUN_1400a3530(lVar9);
      return 0;
    }
    if (*(char *)(param_1 + 0x140) != '\0') goto LAB_140190093;
    FUN_1400a8cc0(lVar9);
    FUN_1400a3530(lVar9);
  } while( true );
}



void FUN_140190310(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined *local_res8;
  undefined8 in_stack_ffffffffffffff68;
  undefined4 uVar6;
  undefined8 local_70;
  undefined1 local_68;
  undefined8 local_60;
  undefined1 local_58;
  undefined **local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_30;
  
  uVar6 = (undefined4)((ulonglong)in_stack_ffffffffffffff68 >> 0x20);
  if (*(longlong *)(param_1 + 0x148) != 0) {
    uVar4 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    local_60 = uVar4;
    FUN_1400a1c30(uVar4);
    local_58 = 1;
    if (DAT_140313fcf != '\0') {
      (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                (*(longlong **)(param_1 + 0x148),
                 L"Proud::CNetThreads_S::ShowThreadExceptionAndPurgeClient");
    }
    if (param_2 == 0) {
      if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x758) != 0) {
        FUN_1400a3440();
        local_res8 = PTR_DAT_1402f8010;
        FUN_14003c600(&local_res8,&DAT_14025a780,param_3,param_4);
        local_48 = 0;
        local_40 = 0;
        local_38 = 0;
        local_30 = 0;
        local_50 = Proud::ByteArray::vftable;
        uVar5 = FUN_1401416a0(&local_70,1,0,&local_res8,&local_50);
        (**(code **)(**(longlong **)(param_1 + 0x148) + 0x80))
                  (*(longlong **)(param_1 + 0x148),uVar5);
        FUN_140140df0(&local_50);
        puVar3 = local_res8;
        if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1402f8010)) &&
           (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
          uVar5 = FUN_1400a3440();
          local_70 = uVar5;
          FUN_1400a1c30(uVar5);
          local_68 = 1;
          piVar2 = (int *)(puVar3 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_1400a3530(puVar1);
          }
          FUN_1400d1290(uVar5);
        }
      }
    }
    else {
      if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x758) != 0) {
        FUN_1400a3440();
        local_res8 = PTR_DAT_1402f8010;
        FUN_14003c600(&local_res8,&DAT_14025a7c0,param_3,param_4,
                      CONCAT44(uVar6,*(undefined4 *)(param_2 + 0x6f8)));
        local_48 = 0;
        local_40 = 0;
        local_38 = 0;
        local_30 = 0;
        local_50 = Proud::ByteArray::vftable;
        uVar5 = FUN_1401416a0(&local_70,1,*(undefined4 *)(param_2 + 0x6f8),&local_res8,&local_50);
        (**(code **)(**(longlong **)(param_1 + 0x148) + 0x80))
                  (*(longlong **)(param_1 + 0x148),uVar5);
        FUN_140140df0(&local_50);
        puVar3 = local_res8;
        if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1402f8010)) &&
           (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
          uVar5 = FUN_1400a3440();
          local_70 = uVar5;
          FUN_1400a1c30(uVar5);
          local_68 = 1;
          piVar2 = (int *)(puVar3 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_1400a3530(puVar1);
          }
          FUN_1400d1290(uVar5);
        }
      }
      local_48 = 0;
      local_40 = 0;
      local_38 = 0;
      local_30 = 0;
      local_50 = Proud::ByteArray::vftable;
      FUN_140166b70(*(undefined8 *)(param_1 + 0x148),param_2,1,3,&local_50,
                    L"Proud::CNetThreads_S::ShowThreadExceptionAndPurgeClient",0);
      FUN_140140df0(&local_50);
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401905e0(longlong param_1,undefined8 param_2,undefined1 *param_3)

{
  char cVar1;
  ulonglong uVar2;
  longlong lVar3;
  longlong lVar4;
  undefined8 uVar5;
  undefined1 auStack_e68 [32];
  ulonglong local_e48;
  undefined1 local_e40;
  undefined1 *local_e38;
  undefined1 local_e30;
  undefined **local_e28;
  undefined8 local_e20;
  longlong local_e18;
  undefined8 local_e10;
  undefined8 local_e08;
  undefined **local_e00;
  undefined8 local_df8;
  longlong local_df0;
  undefined8 local_de8;
  undefined8 local_de0;
  undefined **local_dd8;
  undefined8 local_dd0;
  longlong local_dc8;
  undefined8 local_dc0;
  undefined8 local_db8;
  longlong local_db0;
  undefined1 local_da8;
  undefined **local_da0;
  undefined8 local_d98;
  longlong local_d90;
  undefined8 local_d88;
  undefined8 local_d80;
  undefined1 local_d78 [8];
  undefined1 local_d70 [8];
  longlong local_d68;
  undefined4 local_d60;
  int local_d5c;
  undefined8 local_d20;
  undefined1 local_d18 [80];
  undefined1 local_cc8 [3216];
  ulonglong local_38;
  
  local_d20 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_e68;
  local_e38 = param_3;
  local_db0 = param_1;
  FUN_140169430(param_3 + 0xc0);
  lVar4 = 0;
  local_df8 = 0;
  local_df0 = 0;
  local_de8 = 0;
  local_de0 = 0;
  local_e00 = Proud::ByteArray::vftable;
  cVar1 = FUN_140185b30(param_2,&local_e48);
  uVar2 = local_e48;
  if (((cVar1 != '\0') && (-1 < (int)local_e48)) && ((int)local_e48 <= DAT_1402f8140)) {
    FUN_14003cda0(&local_e00,local_e48 & 0xffffffff);
    lVar3 = local_df0;
    if ((int)local_de8 == 0) {
      lVar3 = lVar4;
    }
    cVar1 = FUN_140185490(param_2,lVar3,uVar2 & 0xffffffff);
    if (cVar1 != '\0') {
      local_dd0 = 0;
      local_dc8 = 0;
      local_dc0 = 0;
      local_db8 = 0;
      local_dd8 = Proud::ByteArray::vftable;
      cVar1 = FUN_140185b30(param_2,&local_e48);
      uVar2 = local_e48;
      if (((cVar1 != '\0') && (-1 < (int)local_e48)) && ((int)local_e48 <= DAT_1402f8140)) {
        FUN_14003cda0(&local_dd8,local_e48 & 0xffffffff);
        lVar3 = local_dc8;
        if ((int)local_dc0 == 0) {
          lVar3 = lVar4;
        }
        cVar1 = FUN_140185490(param_2,lVar3,uVar2 & 0xffffffff);
        if (cVar1 != '\0') {
          local_d98 = 0;
          local_d90 = 0;
          local_d88 = 0;
          local_d80 = 0;
          local_da0 = Proud::ByteArray::vftable;
          FUN_1401a63f0(&local_e48,&local_da0,&local_e00,*(longlong *)(param_1 + 0x148) + 0xc48);
          if ((local_e48 == 0) || (*(longlong *)(local_e48 + 0x38) == 0)) {
            FUN_14008c980(&local_e48);
            uVar2 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
            local_e48 = uVar2;
            FUN_1400a1c30(uVar2);
            local_e40 = 1;
            if (DAT_140313fcf != '\0') {
              (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                        (*(longlong **)(param_1 + 0x148),
                         L"Proud::CNetThreads_S::NetworkerThread_ProcessMessage_NotifyCSEncryptedSessionKey"
                        );
            }
            lVar3 = lVar4;
            if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x1708) != 0) {
              lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x16f8);
            }
            for (; lVar3 != 0; lVar3 = *(longlong *)(lVar3 + 0x18)) {
              if (param_3 == *(undefined1 **)(lVar3 + 0x10)) {
                lVar3 = local_d90;
                if ((int)local_d88 == 0) {
                  lVar3 = lVar4;
                }
                FUN_140195fe0(param_3 + 0x288,lVar3,
                              *(uint *)(*(longlong *)(param_1 + 0x148) + 0x244) >> 3,0x10);
                local_e20 = 0;
                local_e18 = 0;
                local_e10 = 0;
                local_e08 = 0;
                local_e28 = Proud::ByteArray::vftable;
                cVar1 = FUN_140197a50(&local_dd8,&local_e28,param_3 + 0x288);
                if (cVar1 == '\0') {
                  FUN_1400a2320(local_d18,L"Decrypt Fast EncryptKey Error");
                    // WARNING: Subroutine does not return
                  _CxxThrowException(local_d18,(ThrowInfo *)&DAT_1402f4860);
                }
                lVar3 = local_e18;
                if ((int)local_e10 == 0) {
                  lVar3 = lVar4;
                }
                FUN_1401a5720(param_3 + 0x658,lVar3,
                              *(uint *)(*(longlong *)(param_1 + 0x148) + 0x248) >> 3);
                FUN_140140df0(&local_e28);
                param_3[0x688] = 1;
                FUN_1400d1290(uVar2);
                local_e40 = 0;
                FUN_140185560(local_d78);
                FUN_140185030(local_d78);
                FUN_1401856c0(local_d78,0x800);
                FUN_1401856c0(local_d78,0);
                FUN_14003c9e0(local_d78,6);
                lVar4 = (**(code **)(*(longlong *)(param_3 + 0x108) + 0x10))();
                local_db0 = lVar4;
                FUN_1400a1c30(lVar4);
                local_da8 = 1;
                uVar5 = FUN_140146970(local_cc8,local_d78);
                local_e38 = (undefined1 *)0x0;
                local_e30 = 1;
                FUN_1401a12a0(*(undefined8 *)(param_3 + 0x748),uVar5,&local_e38);
                FUN_140145b60(local_cc8);
                FUN_1400d1290(lVar4);
                local_e38 = local_d70;
                FUN_14019a730(local_d70);
                if (local_d68 != 0) {
                  if (local_d5c < 0) {
                    // WARNING: Subroutine does not return
                    FUN_1400a26d0();
                  }
                  local_d60 = 0;
                }
                FUN_140140df0(&local_da0);
                FUN_140140df0(&local_dd8);
                goto LAB_140190ab3;
              }
            }
            FUN_1400d1290(uVar2);
            FUN_140140df0(&local_da0);
            FUN_140140df0(&local_dd8);
          }
          else {
            FUN_14008c980(&local_e48);
            FUN_140140df0(&local_da0);
            FUN_140140df0(&local_dd8);
          }
          goto LAB_140190ab3;
        }
      }
      FUN_140140df0(&local_dd8);
    }
  }
LAB_140190ab3:
  FUN_140140df0(&local_e00);
  return;
}



void FUN_140190af0(longlong param_1,undefined8 param_2,undefined8 param_3,char param_4)

{
  undefined *puVar1;
  int *piVar2;
  longlong *plVar3;
  undefined8 uVar4;
  undefined *puVar5;
  undefined *local_res8;
  undefined *local_78;
  undefined *local_70;
  undefined1 local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined1 local_50;
  undefined **local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_30;
  undefined8 local_28;
  
  local_60 = 0xfffffffffffffffe;
  if ((*(longlong *)(param_1 + 0x148) != 0) &&
     (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x758) != 0)) {
    FUN_1400a3440();
    local_78 = PTR_DAT_1402f8010;
    FUN_14003c600(&local_78,L"(%s): unexpected thread exit with (%s)",param_2,param_3);
    uVar4 = 0;
    local_40 = 0;
    local_38 = 0;
    local_30 = 0;
    local_28 = 0;
    local_48 = Proud::ByteArray::vftable;
    FUN_1401416a0(&local_res8,1,1,&local_78,&local_48);
    FUN_140140df0(&local_48);
    local_70 = (undefined *)0x0;
    FUN_140141570(&local_70,&local_res8);
    (**(code **)(**(longlong **)(param_1 + 0x148) + 0x38))
              (*(longlong **)(param_1 + 0x148),&local_70);
    if (param_4 != '\0') {
      if (local_res8 != (undefined *)0x0) {
        uVar4 = *(undefined8 *)(local_res8 + 0x38);
      }
      plVar3 = (longlong *)FUN_1401417c0(uVar4,&local_70);
      puVar5 = (undefined *)*plVar3;
      if ((undefined *)*plVar3 == (undefined *)0x0) {
        puVar5 = PTR_DAT_1402f8010;
      }
      FUN_1400a2b50(puVar5);
      puVar5 = local_70;
      if (((local_70 != (undefined *)0x0) && (local_70 != PTR_DAT_1402f8010)) &&
         (puVar1 = local_70 + -8, puVar1 != (undefined *)0x0)) {
        uVar4 = FUN_1400a3440();
        local_58 = uVar4;
        FUN_1400a1c30(uVar4);
        local_50 = 1;
        piVar2 = (int *)(puVar5 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(puVar1);
        }
        FUN_1400d1290(uVar4);
      }
    }
    puVar5 = local_res8;
    if (local_res8 != (undefined *)0x0) {
      local_70 = local_res8;
      FUN_1400a1c30(local_res8);
      local_68 = 1;
      *(longlong *)(local_res8 + 0x40) = *(longlong *)(local_res8 + 0x40) + -1;
      if (*(longlong *)(local_res8 + 0x40) == 0) {
        FUN_1400d1290(puVar5);
        local_68 = 0;
        FUN_14008c910(local_res8);
      }
      else {
        FUN_1400d1290(puVar5);
      }
    }
    puVar5 = local_78;
    if (((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_78 + -8, puVar1 != (undefined *)0x0)) {
      uVar4 = FUN_1400a3440();
      local_58 = uVar4;
      FUN_1400a1c30(uVar4);
      local_50 = 1;
      piVar2 = (int *)(puVar5 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar4);
    }
  }
  return;
}



void FUN_140190d00(longlong param_1,longlong param_2,undefined8 param_3)

{
  longlong *plVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  longlong lVar5;
  undefined4 *puVar6;
  undefined4 *puVar7;
  undefined4 *puVar8;
  int iVar9;
  undefined4 *local_res20;
  undefined4 *local_198;
  undefined1 local_190;
  undefined8 local_120;
  undefined1 local_118 [4];
  undefined4 local_114;
  undefined8 local_e0;
  undefined1 local_70 [72];
  
  local_120 = 0xfffffffffffffffe;
  if ((int)(*(int *)(param_2 + 8) + (*(int *)(param_2 + 8) >> 0x1f & 7U)) >> 3 != 0) {
    FUN_140164080(*(undefined8 *)(param_1 + 0x148),0,
                  "Proud::CNetThreads_S::UserWorkerThread_FinalReceiveUserMessage",2);
  }
  if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x758) != 0) {
    FUN_140140af0(local_118);
    local_114 = *(undefined4 *)(param_2 + 0x30);
    local_118[0] = *(undefined1 *)(param_2 + 0x48);
    local_e0 = param_3;
    cVar2 = FUN_140185b30(param_2 + 8,&local_res20);
    if (cVar2 != '\0') {
      lVar5 = *(longlong *)(param_2 + 0x10);
      if (lVar5 == 0) {
        if (*(longlong *)(param_2 + 0x18) == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        iVar9 = *(int *)(param_2 + 0x20);
      }
      else {
        iVar9 = *(int *)(lVar5 + 0x18);
      }
      iVar3 = (int)(*(int *)(param_2 + 8) + (*(int *)(param_2 + 8) >> 0x1f & 7U)) >> 3;
      if ((int)local_res20 == iVar9 - iVar3) {
        if (*(longlong *)(param_2 + 0x18) == 0) {
          if (lVar5 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14019a830();
          }
          if (*(int *)(lVar5 + 0x18) == 0) {
            lVar5 = 0;
          }
          else {
            lVar5 = *(longlong *)(lVar5 + 0x10);
          }
        }
        else {
          lVar5 = *(longlong *)(param_2 + 0x18);
          if (lVar5 == 0) {
            FUN_1400a2320(local_70,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
            _CxxThrowException(local_70,(ThrowInfo *)&DAT_1402f4860);
          }
        }
        plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x148) + 0x758);
        (**(code **)(*plVar1 + 0x30))
                  (plVar1,*(undefined4 *)(param_2 + 0x30),local_118,lVar5 + iVar3,(int)local_res20);
        goto LAB_140190fc7;
      }
    }
    local_res20 = (undefined4 *)FUN_1400a34c0(0x60);
    if (local_res20 == (undefined4 *)0x0) {
      lVar5 = 0;
    }
    else {
      lVar5 = FUN_140141470(local_res20);
    }
    puVar8 = (undefined4 *)0x0;
    if (lVar5 == 0) {
      local_res20 = (undefined4 *)0x0;
      puVar6 = puVar8;
    }
    else {
      puVar6 = (undefined4 *)FUN_1400a34c0(0x48);
      local_198 = puVar6;
      if (puVar6 != (undefined4 *)0x0) {
        local_res20 = puVar6;
        uVar4 = FUN_1401692e0();
        FUN_1400a1b50(puVar6,uVar4,1);
      }
      local_res20 = puVar6;
      FUN_1400a1c30(puVar6);
      *(undefined8 *)(puVar6 + 0x10) = 1;
      *(longlong *)(puVar6 + 0xe) = lVar5;
      FUN_1400d1290(puVar6);
    }
    puVar7 = puVar8;
    if (puVar6 != (undefined4 *)0x0) {
      puVar7 = *(undefined4 **)(puVar6 + 0xe);
    }
    *puVar7 = 0x1f;
    if (puVar6 != (undefined4 *)0x0) {
      puVar8 = *(undefined4 **)(puVar6 + 0xe);
    }
    FUN_14001f680(puVar8 + 4,L"Invalid payload size in User Message!");
    local_198 = (undefined4 *)0x0;
    FUN_140141570(&local_198,&local_res20);
    (**(code **)(**(longlong **)(param_1 + 0x148) + 0x80))
              (*(longlong **)(param_1 + 0x148),&local_198);
    if (puVar6 != (undefined4 *)0x0) {
      local_190 = 0;
      local_198 = puVar6;
      FUN_1400a1c30(puVar6);
      local_190 = 1;
      plVar1 = (longlong *)(puVar6 + 0x10);
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_1400d1290(puVar6);
        local_190 = 0;
        FUN_14008c910(puVar6);
      }
      else {
        FUN_1400d1290(puVar6);
      }
    }
  }
LAB_140190fc7:
  FUN_1401a7860(param_1 + 0x160,*(undefined4 *)(param_2 + 0x30),0);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140190ff0(longlong param_1)

{
  ulonglong *puVar1;
  longlong lVar2;
  undefined *puVar3;
  char cVar4;
  int iVar5;
  int iVar6;
  int *piVar7;
  undefined8 uVar8;
  int iVar9;
  int iVar10;
  ulonglong uVar11;
  int *piVar12;
  undefined *puVar13;
  ulonglong uVar14;
  int iVar15;
  ulonglong uVar16;
  undefined1 auStack_2a8 [32];
  undefined ***local_288;
  undefined1 local_278 [8];
  int *local_270;
  longlong local_268;
  longlong local_260;
  undefined **local_258;
  undefined4 local_250;
  undefined2 local_24c;
  undefined *local_238 [2];
  undefined **local_228;
  undefined4 local_220;
  undefined2 local_21c;
  undefined8 local_218;
  undefined1 local_210;
  undefined **local_208;
  undefined4 local_200;
  undefined2 local_1fc;
  undefined **local_1f8;
  undefined8 local_1f0;
  undefined8 local_1e8;
  undefined8 local_1e0;
  undefined8 local_1d8;
  undefined8 local_1d0;
  undefined1 local_1c8;
  undefined8 local_1c0;
  undefined8 local_1b8;
  undefined4 local_1b0;
  undefined8 local_1a8;
  undefined4 local_1a0;
  undefined **local_198;
  undefined4 local_190;
  undefined2 local_18c;
  undefined1 local_158 [8];
  undefined8 local_150;
  ulonglong local_38;
  
  local_150 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_2a8;
  local_260 = param_1;
  FUN_1401c10a0(local_278);
  uVar16 = 0;
  local_268 = 0;
  uVar14 = 1;
  do {
    while( true ) {
      while( true ) {
        if (*(char *)(param_1 + 0x140) != '\0') {
          if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0) {
            FUN_1400a3440();
            local_238[0] = PTR_DAT_1402f8010;
            FUN_14003c600(local_238,&DAT_14025aae8,L"Proud::CNetThreads_S::TcpListenerProc");
            puVar3 = local_238[0];
            puVar13 = local_238[0];
            if (local_238[0] == (undefined *)0x0) {
              puVar13 = PTR_DAT_1402f8010;
            }
            FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),0,puVar13);
            if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1402f8010)) &&
               (puVar3 + -8 != (undefined *)0x0)) {
              uVar8 = FUN_1400a3440();
              local_1c8 = 0;
              local_1d0 = uVar8;
              FUN_1400a1c30(uVar8);
              local_1c8 = 1;
              piVar7 = (int *)(puVar3 + -4);
              *piVar7 = *piVar7 + -1;
              if (*piVar7 == 0) {
                FUN_1400a3530(puVar3 + -8);
              }
              FUN_1400d1290(uVar8);
            }
          }
          lVar2 = local_268;
          if (local_268 != 0) {
            FUN_1400a8cc0(local_268);
            FUN_1400a3530(lVar2);
          }
          FUN_1401c10d0(local_278);
          return;
        }
        iVar15 = 0;
        if (((local_268 == 0) && ((char)uVar14 != '\0')) &&
           (local_268 = FUN_14018ff00(param_1), local_268 == 0)) {
          uVar14 = uVar16;
        }
        lVar2 = local_268;
        local_198 = Proud::AddrPort::vftable;
        local_1c0 = 0;
        local_1a8 = 0;
        local_1b8 = 0;
        local_1b0 = 5;
        local_1a0 = 0;
        local_190 = DAT_1402f83d0;
        local_18c = DAT_1402f83d4;
        cVar4 = FUN_1400abce0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x790),&local_1c0,
                              DAT_1402f8068);
        if (cVar4 == '\x01') break;
        puVar1 = *(ulonglong **)(*(longlong *)(param_1 + 0x148) + 0x748);
        uVar11 = uVar16;
        if (puVar1 != (ulonglong *)0x0) {
          uVar11 = *puVar1;
        }
        FUN_1400a8b50(uVar11);
      }
      if (lVar2 == 0) break;
      local_208 = Proud::AddrPort::vftable;
      local_200 = 0;
      local_1fc = 0;
      local_258 = Proud::AddrPort::vftable;
      local_250 = 0;
      local_24c = 0;
      puVar1 = *(ulonglong **)(*(longlong *)(param_1 + 0x148) + 0x748);
      uVar11 = uVar16;
      if (puVar1 != (ulonglong *)0x0) {
        uVar11 = *puVar1;
      }
      FUN_1400a89a0(lVar2,uVar11,&local_208,&local_258);
      cVar4 = FUN_1400a64d0(&local_258);
      if (cVar4 == '\0') {
LAB_1401911b2:
        FUN_1400a8cc0(lVar2);
        FUN_1400a3530(lVar2);
      }
      else {
        local_228 = Proud::AddrPort::vftable;
        local_220 = local_250;
        local_21c = local_24c;
        cVar4 = FUN_14018fb50(param_1,lVar2,&local_228);
        if (cVar4 == '\0') goto LAB_1401911b2;
      }
      local_268 = 0;
    }
    FUN_1400a3440();
    local_270 = (int *)PTR_DAT_1402f8010;
    iVar5 = FUN_1400a32c0(L"acceptex getqueued but socket null");
    iVar6 = iVar15;
    if ((local_270 != (int *)0x0) && (local_270 != (int *)PTR_DAT_1402f8010)) {
      iVar6 = local_270[-2];
    }
    iVar9 = 0;
    iVar10 = iVar5;
    if (((iVar5 <= iVar6) && (iVar10 = iVar9, local_270 != (int *)0x0)) &&
       (local_270 != (int *)PTR_DAT_1402f8010)) {
      iVar10 = local_270[-2];
    }
    iVar6 = 1;
    if (1 < iVar10) {
      iVar6 = iVar10;
    }
    uVar11 = uVar16;
    if ((local_270 != (int *)0x0) && (uVar11 = 0, local_270 != (int *)PTR_DAT_1402f8010)) {
      uVar11 = (ulonglong)(uint)local_270[-2];
    }
    if ((int)uVar11 < iVar6) {
      if (local_270 == (int *)0x0) {
        local_270 = (int *)PTR_DAT_1402f8010;
      }
      if (iVar6 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if (iVar6 == 0) {
        FUN_1400031d0(&local_270);
      }
      else {
        iVar10 = iVar9;
        if ((local_270 != (int *)0x0) && (local_270 != (int *)PTR_DAT_1402f8010)) {
          iVar10 = local_270[-2];
        }
        if (iVar6 != iVar10) {
          piVar7 = (int *)FUN_1400a34c0((longlong)iVar6 * 2 + 10);
          if (piVar7 != (int *)0x0) {
            *piVar7 = 0;
            piVar7[1] = 1;
          }
          *piVar7 = iVar6;
          iVar10 = iVar9;
          if ((local_270 != (int *)0x0) && (local_270 != (int *)PTR_DAT_1402f8010)) {
            iVar10 = local_270[-2];
          }
          piVar12 = (int *)PTR_DAT_1402f8010;
          if (iVar6 < iVar10) {
LAB_1401912d7:
            if (local_270 != (int *)0x0) {
              piVar12 = local_270;
            }
          }
          else {
            iVar6 = iVar15;
            if (local_270 != (int *)0x0) {
              if (local_270 != (int *)PTR_DAT_1402f8010) {
                iVar6 = local_270[-2];
              }
              goto LAB_1401912d7;
            }
          }
          FUN_1400a32f0(piVar7 + 2,piVar12,iVar6);
          FUN_1400031d0(&local_270);
          local_270 = piVar7 + 2;
        }
      }
    }
    FUN_140002e30(&local_270);
    piVar7 = local_270;
    if (local_270 == (int *)0x0) {
      piVar7 = (int *)PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(piVar7,L"acceptex getqueued but socket null",iVar5);
    piVar7 = local_270;
    if (local_270 == (int *)0x0) {
      piVar7 = (int *)PTR_DAT_1402f8010;
    }
    iVar6 = FUN_1400a32c0(piVar7);
    iVar15 = 0;
    if (0 < iVar6) {
      iVar15 = iVar6;
    }
    iVar6 = iVar9;
    if ((local_270 != (int *)0x0) && (local_270 != (int *)PTR_DAT_1402f8010)) {
      iVar6 = local_270[-2];
    }
    if ((iVar15 < iVar6) || (iVar15 = iVar9, local_270 == (int *)0x0)) {
LAB_14019137a:
      if (((local_270 != (int *)PTR_DAT_1402f8010) && (local_270 != (int *)0x0)) &&
         (local_270 + -2 != (int *)0x0)) {
        local_270[-2] = iVar15;
        *(undefined2 *)((longlong)local_270 + (longlong)iVar15 * 2) = 0;
      }
    }
    else if (local_270 != (int *)PTR_DAT_1402f8010) {
      iVar15 = local_270[-2];
      goto LAB_14019137a;
    }
    local_1f0 = 0;
    local_1e8 = 0;
    local_1e0 = 0;
    local_1d8 = 0;
    local_1f8 = Proud::ByteArray::vftable;
    local_288 = &local_1f8;
    uVar8 = FUN_1401416a0(local_158,1,0,&local_270);
    (**(code **)(**(longlong **)(param_1 + 0x148) + 0x80))(*(longlong **)(param_1 + 0x148),uVar8);
    FUN_140140df0(&local_1f8);
    piVar7 = local_270;
    if (((local_270 != (int *)0x0) && (local_270 != (int *)PTR_DAT_1402f8010)) &&
       (piVar12 = local_270 + -2, piVar12 != (int *)0x0)) {
      uVar8 = FUN_1400a3440();
      local_210 = 0;
      local_218 = uVar8;
      FUN_1400a1c30(uVar8);
      local_210 = 1;
      piVar7 = piVar7 + -1;
      *piVar7 = *piVar7 + -1;
      if (*piVar7 == 0) {
        FUN_1400a3530(piVar12);
      }
      FUN_1400d1290(uVar8);
      local_210 = 0;
    }
    local_270 = (int *)PTR_DAT_1402f8010;
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401915c0(longlong param_1)

{
  int *piVar1;
  longlong *plVar2;
  undefined *puVar3;
  char cVar4;
  undefined8 uVar5;
  undefined *puVar6;
  bool bVar7;
  undefined1 auStack_1d8 [32];
  undefined1 local_1b8;
  undefined1 local_1b7 [7];
  undefined8 local_1b0;
  undefined *local_1a8;
  undefined8 local_1a0;
  undefined1 local_198;
  undefined8 local_190;
  undefined1 local_188;
  undefined8 local_180;
  undefined1 local_178 [312];
  int *local_40;
  ulonglong local_28;
  
  local_180 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_1d8;
  FUN_1401c10a0(&local_1b8);
  if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x758) != 0) {
    (**(code **)(**(longlong **)(*(longlong *)(param_1 + 0x148) + 0x758) + 0x58))();
  }
  uVar5 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  FUN_1401a6f60(local_178,uVar5);
  cVar4 = *(char *)(param_1 + 0x140);
  while (cVar4 == '\0') {
    local_1b0 = 0;
    uVar5 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    local_1a0 = uVar5;
    FUN_1400a1c30(uVar5);
    local_198 = 1;
    if (DAT_140313fcf != '\0') {
      (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                (*(longlong **)(param_1 + 0x148),L"Proud::CNetThreads_S::UserWorkerThread_Main");
    }
    cVar4 = FUN_1401a7770(param_1 + 0x160,local_40,&local_1b0);
    FUN_1400d1290(uVar5);
    local_198 = 0;
    if (cVar4 == '\x01') {
      if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x758) != 0) {
        plVar2 = *(longlong **)(*(longlong *)(param_1 + 0x148) + 0x758);
        (**(code **)(*plVar2 + 0x78))(plVar2,local_1b7);
      }
      piVar1 = local_40;
      if (*local_40 == 1) {
        FUN_14018b390(param_1,local_40,local_1b0);
      }
      else if (*local_40 == 2) {
        FUN_140190d00(param_1,local_40,local_1b0);
      }
      else {
        FUN_14015e850(*(undefined8 *)(param_1 + 0x148),local_40 + 0x14);
        FUN_1401a7860(param_1 + 0x160,piVar1[0xc],0);
      }
      if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x758) != 0) {
        plVar2 = *(longlong **)(*(longlong *)(param_1 + 0x148) + 0x758);
        (**(code **)(*plVar2 + 0x80))(plVar2,local_1b7);
      }
    }
    if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x758) != 0) {
      LOCK();
      bVar7 = *(int *)(param_1 + 0x240) == 0;
      if (bVar7) {
        *(int *)(param_1 + 0x240) = 1;
      }
      UNLOCK();
      if (bVar7) {
        LOCK();
        bVar7 = *(int *)(param_1 + 0x200) == 1;
        if (bVar7) {
          *(int *)(param_1 + 0x200) = 0;
        }
        UNLOCK();
        if (bVar7) {
          cVar4 = '\x01';
          plVar2 = *(longlong **)(*(longlong *)(param_1 + 0x148) + 0x758);
          (**(code **)(*plVar2 + 0x88))
                    (plVar2,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x260));
        }
        LOCK();
        *(undefined4 *)(param_1 + 0x240) = 0;
        UNLOCK();
      }
    }
    if (cVar4 == '\0') {
      FUN_1401a76e0(param_1 + 0x160);
    }
    cVar4 = *(char *)(param_1 + 0x140);
  }
  if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x758) != 0) {
    (**(code **)(**(longlong **)(*(longlong *)(param_1 + 0x148) + 0x758) + 0x60))();
  }
  if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0) {
    FUN_1400a3440();
    local_1a8 = PTR_DAT_1402f8010;
    FUN_14003c600(&local_1a8,&DAT_14025aae8,L"Proud::CNetThreads_S::UserWorkerThread_Main");
    puVar3 = local_1a8;
    puVar6 = local_1a8;
    if (local_1a8 == (undefined *)0x0) {
      puVar6 = PTR_DAT_1402f8010;
    }
    FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),0,puVar6);
    if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1402f8010)) &&
       (puVar3 + -8 != (undefined *)0x0)) {
      uVar5 = FUN_1400a3440();
      local_190 = uVar5;
      FUN_1400a1c30(uVar5);
      local_188 = 1;
      piVar1 = (int *)(puVar3 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar3 + -8);
      }
      FUN_1400d1290(uVar5);
    }
  }
  FUN_1401a6fa0(local_178);
  FUN_1401c10d0(&local_1b8);
  return;
}



void FUN_140191900(undefined8 param_1)

{
  DWORD DVar1;
  
  DVar1 = GetCurrentThreadId();
  FUN_1400aaed0(DVar1,"PNSrv TcpListener");
  FUN_140190ff0(param_1);
  return;
}



void FUN_140191930(undefined8 param_1)

{
  DWORD DVar1;
  
  DVar1 = GetCurrentThreadId();
  FUN_1400aaed0(DVar1,"PNSrv UserWorker");
  FUN_1401915c0(param_1);
  return;
}



void FUN_140191960(longlong param_1,longlong param_2,longlong param_3,undefined8 param_4,
                  char param_5)

{
  undefined8 uVar1;
  undefined4 local_170 [2];
  undefined1 local_168 [8];
  undefined1 local_160 [8];
  longlong local_158;
  int local_14c;
  undefined1 local_140 [232];
  undefined1 local_58 [80];
  
  if ((param_2 != 0) && (param_5 == '\x01')) {
    *(int *)(param_2 + 0x1dc) = *(int *)(param_2 + 0x1dc) + 1;
  }
  if (*(longlong *)(param_3 + 8) == 0) {
    FUN_1400a2320(local_58,PTR_u_exception_due_to_not_using_Inter_14030c140);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  FUN_140185590(local_168,param_3,param_3,param_4,0xfffffffffffffffe);
  FUN_14015c2a0(local_140);
  local_170[0] = (undefined4)param_4;
  uVar1 = FUN_14015f570(param_2 + 0x268,local_170,*(undefined8 *)(param_2 + 0x278),0);
  if (*(undefined8 **)(param_2 + 0x278) == (undefined8 *)0x0) {
    *(undefined8 *)(param_2 + 0x270) = uVar1;
  }
  else {
    **(undefined8 **)(param_2 + 0x278) = uVar1;
  }
  *(undefined8 *)(param_2 + 0x278) = uVar1;
  FUN_14015c350(local_140);
  FUN_14019a730(local_160);
  if ((local_158 != 0) && (local_14c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2 == 0) {
    param_2 = 0;
  }
  else {
    param_2 = param_2 + 8;
  }
  FUN_1401a76f0(param_1 + 0x160,param_2);
  return;
}



void FUN_140191a90(longlong param_1,int *param_2,byte param_3,longlong param_4,undefined1 param_5)

{
  int iVar1;
  longlong lVar2;
  byte bVar3;
  int iVar4;
  undefined8 uVar5;
  longlong *plVar6;
  longlong lVar7;
  undefined1 local_68 [8];
  undefined1 local_60 [8];
  longlong local_58;
  int local_4c;
  int local_40;
  undefined **local_38;
  int local_30;
  undefined2 local_2c;
  byte local_28;
  
  iVar1 = *param_2;
  FUN_140169430(param_4 + 0xc0);
  uVar5 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  FUN_1400a1c30(uVar5);
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
              (*(longlong **)(param_1 + 0x148),
               L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_Rmi");
  }
  plVar6 = (longlong *)(*(longlong *)(param_1 + 0x148) + 0x480);
  bVar3 = (**(code **)(*plVar6 + 0x10))(plVar6,param_2,*(undefined8 *)(param_4 + 0x30));
  if ((param_3 | bVar3) == 0) {
    FUN_140185160(param_2,(int)((iVar1 >> 0x1f & 7U) + iVar1) >> 3);
    FUN_140185560(local_68);
    local_38 = Proud::AddrPort::vftable;
    local_40 = 0;
    local_30 = DAT_1402f83d0;
    local_2c = DAT_1402f83d4;
    local_28 = param_3 | bVar3;
    FUN_140185030(local_68);
    if (*(longlong *)(param_2 + 2) == 0) {
      if (*(longlong *)(param_2 + 4) == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      iVar1 = param_2[6];
    }
    else {
      iVar1 = *(int *)(*(longlong *)(param_2 + 2) + 0x18);
    }
    iVar4 = (int)(*param_2 + (*param_2 >> 0x1f & 7U)) >> 3;
    lVar7 = *(longlong *)(param_2 + 4);
    if (lVar7 == 0) {
      lVar2 = *(longlong *)(param_2 + 2);
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      if (*(int *)(lVar2 + 0x18) != 0) {
        lVar7 = *(longlong *)(lVar2 + 0x10);
      }
    }
    FUN_140185b00(local_68,iVar4 + lVar7,iVar1 - iVar4);
    local_28 = (byte)param_2[0x10];
    local_30 = param_2[0xe];
    local_2c = (undefined2)param_2[0xf];
    local_40 = param_2[10];
    FUN_140191960(param_1,param_4,local_68,1,param_5);
    FUN_14019a730(local_60);
    if ((local_58 != 0) && (local_4c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
  }
  FUN_1400d1290(uVar5);
  return;
}



void FUN_140191cb0(longlong param_1,int *param_2,undefined8 param_3,longlong param_4,
                  undefined1 param_5)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined1 local_58 [8];
  undefined1 local_50 [8];
  longlong local_48;
  int local_3c;
  int local_30;
  undefined **local_28;
  int local_20;
  undefined2 local_1c;
  undefined1 local_18;
  
  FUN_140185560(local_58);
  local_28 = Proud::AddrPort::vftable;
  local_18 = 0;
  local_30 = 0;
  local_20 = DAT_1402f83d0;
  local_1c = DAT_1402f83d4;
  FUN_140185030(local_58);
  if (*(longlong *)(param_2 + 2) == 0) {
    if (*(longlong *)(param_2 + 4) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = param_2[6];
  }
  else {
    iVar1 = *(int *)(*(longlong *)(param_2 + 2) + 0x18);
  }
  iVar3 = (int)(*param_2 + (*param_2 >> 0x1f & 7U)) >> 3;
  lVar5 = *(longlong *)(param_2 + 4);
  if (lVar5 == 0) {
    lVar2 = *(longlong *)(param_2 + 2);
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar5 = *(longlong *)(lVar2 + 0x10);
    }
  }
  FUN_140185b00(local_58,iVar3 + lVar5,iVar1 - iVar3);
  local_18 = (undefined1)param_2[0x10];
  local_20 = param_2[0xe];
  local_1c = (undefined2)param_2[0xf];
  local_30 = param_2[10];
  FUN_140169430(param_4 + 0xc0);
  uVar4 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  FUN_1400a1c30(uVar4);
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
              (*(longlong **)(param_1 + 0x148),
               L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_UserMessage");
  }
  FUN_140191960(param_1,param_4,local_58,2,param_5);
  FUN_1400d1290(uVar4);
  FUN_14019a730(local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



undefined8 FUN_140191e80(longlong param_1,int *param_2,undefined8 param_3,longlong param_4)

{
  char cVar1;
  undefined1 uVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int *piVar6;
  undefined8 uVar7;
  undefined **ppuVar8;
  longlong lVar9;
  int *piVar10;
  ulonglong local_res10 [2];
  longlong local_res20;
  int *local_c8;
  int local_c0;
  uint local_bc;
  undefined **local_b8;
  int local_b0 [2];
  longlong local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  int local_90;
  undefined **local_88;
  int local_80;
  undefined2 local_7c;
  undefined1 local_78;
  undefined **local_68;
  int local_60;
  undefined2 local_5c;
  undefined **local_58;
  int local_50;
  undefined2 local_4c;
  undefined **local_48;
  int local_40;
  undefined2 local_3c;
  undefined **local_38;
  int local_30;
  undefined2 local_2c;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  local_c0 = (int)(*param_2 + (*param_2 >> 0x1f & 7U)) >> 3;
  local_res20 = param_4;
  cVar1 = FUN_140185dc0(param_2,&local_bc);
  if (cVar1 == '\0') goto switchD_140191f07_caseD_3;
  local_res10[0] = local_res10[0] & 0xffffffffffffff00;
  switch(local_bc) {
  case 1:
    FUN_140191a90(param_1,param_2,0,param_3,local_res20 != 0);
  default:
switchD_140191f07_caseD_3:
    FUN_140185160(param_2,local_c0);
    return 0;
  case 2:
    FUN_140191cb0(param_1,param_2,0,param_3,local_res20 != 0);
    goto switchD_140191f07_caseD_3;
  case 5:
    FUN_1401905e0(param_1,param_2,param_3);
    break;
  case 7:
    FUN_14018ec40(param_1,param_2,param_3);
    break;
  case 0xc:
    local_58 = Proud::AddrPort::vftable;
    local_50 = param_2[0xe];
    local_4c = (undefined2)param_2[0xf];
    cVar1 = FUN_1400a64d0(&local_58);
    if (cVar1 == '\0') {
      FUN_140164080(*(undefined8 *)(param_1 + 0x148),param_3,
                    "receivedInfo.GetRemoteAddr().IsUnicastEndpoint()",2);
    }
    local_48 = Proud::AddrPort::vftable;
    local_40 = param_2[0xe];
    local_3c = (undefined2)param_2[0xf];
    FUN_14018c720(param_1,param_2,&local_48);
    break;
  case 0xe:
    FUN_14018bdc0(param_1,param_2,param_3);
    break;
  case 0x10:
    local_38 = Proud::AddrPort::vftable;
    local_30 = param_2[0xe];
    local_2c = (undefined2)param_2[0xf];
    cVar1 = FUN_1400a64d0(&local_38);
    if (cVar1 == '\0') {
      FUN_140164080(*(undefined8 *)(param_1 + 0x148),param_3,
                    "receivedInfo.GetRemoteAddr().IsUnicastEndpoint()",2);
    }
    local_68 = Proud::AddrPort::vftable;
    local_60 = param_2[0xe];
    local_5c = (undefined2)param_2[0xf];
    FUN_14018cac0(param_1,param_2,&local_68);
    break;
  case 0x12:
    FUN_14018c240(param_1,param_2,param_3);
    break;
  case 0x14:
    FUN_14018ceb0(param_1,param_2,param_3);
    break;
  case 0x15:
    FUN_14018d710(param_1,param_2,param_3);
    break;
  case 0x16:
    FUN_14018de80(param_1,param_2,param_3);
    break;
  case 0x1a:
    FUN_14018e250(param_1,param_2,param_3);
    break;
  case 0x1b:
    FUN_14018a8d0(param_1,param_2,param_3);
    break;
  case 0x24:
  case 0x25:
    FUN_140185560(&local_b8);
    local_88 = Proud::AddrPort::vftable;
    local_78 = 0;
    local_90 = 0;
    local_80 = DAT_1402f83d0;
    local_7c = DAT_1402f83d4;
    cVar1 = FUN_140189170(*(undefined8 *)(param_1 + 0x148),local_bc,param_2);
    if (cVar1 != '\0') {
      local_78 = (undefined1)param_2[0x10];
      local_80 = param_2[0xe];
      local_7c = (undefined2)param_2[0xf];
      local_90 = param_2[10];
      uVar2 = FUN_140191e80(param_1,&local_b8,param_3);
      local_res10[0] = CONCAT71(local_res10[0]._1_7_,uVar2);
    }
    local_c8 = local_b0;
    FUN_14019a730(local_b0);
    if ((local_a8 != 0) && (local_a0._4_4_ < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    goto LAB_140192215;
  case 0x26:
    FUN_140185560(&local_b8);
    local_88 = Proud::AddrPort::vftable;
    local_78 = 0;
    local_90 = 0;
    local_80 = DAT_1402f83d0;
    local_7c = DAT_1402f83d4;
    cVar1 = FUN_1401875a0(*(undefined8 *)(param_1 + 0x148),param_2,&local_b8);
    if (cVar1 != '\0') {
      local_78 = (undefined1)param_2[0x10];
      local_80 = param_2[0xe];
      local_7c = (undefined2)param_2[0xf];
      local_90 = param_2[10];
      uVar2 = FUN_140191e80(param_1,&local_b8,param_3);
      local_res10[0] = CONCAT71(local_res10[0]._1_7_,uVar2);
    }
    local_c8 = local_b0;
    FUN_14019a730(local_b0);
    if ((local_a8 != 0) && (local_a0._4_4_ < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
LAB_140192215:
    if ((char)local_res10[0] != '\x01') {
      if ((char)local_res10[0] != '\0') {
        return 1;
      }
      goto switchD_140191f07_caseD_3;
    }
    break;
  case 0x27:
    FUN_14018e720(param_1,param_2,param_3);
    break;
  case 0x28:
    FUN_14018a960(param_1,param_2,param_3);
  }
  if (*(longlong *)(param_2 + 2) == 0) {
    if (*(longlong *)(param_2 + 4) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar5 = param_2[6];
  }
  else {
    iVar5 = *(int *)(*(longlong *)(param_2 + 2) + 0x18);
  }
  if (iVar5 == (int)(*param_2 + (*param_2 >> 0x1f & 7U)) >> 3) {
    return 1;
  }
  if (local_bc == 0x24) {
    return 1;
  }
  if (local_bc == 0x25) {
    return 1;
  }
  FUN_1400a3440();
  local_c8 = (int *)PTR_DAT_1402f8010;
  local_c0 = FUN_1400a32c0(L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_ProudNetLayer");
  iVar5 = 0;
  if ((local_c8 != (int *)0x0) && (iVar5 = 0, local_c8 != (int *)PTR_DAT_1402f8010)) {
    iVar5 = local_c8[-2];
  }
  iVar4 = local_c0;
  if (((local_c0 <= iVar5) && (iVar4 = 0, local_c8 != (int *)0x0)) &&
     (local_c8 != (int *)PTR_DAT_1402f8010)) {
    iVar4 = local_c8[-2];
  }
  iVar5 = 1;
  if (1 < iVar4) {
    iVar5 = iVar4;
  }
  iVar3 = 0;
  iVar4 = iVar3;
  if ((local_c8 != (int *)0x0) && (local_c8 != (int *)PTR_DAT_1402f8010)) {
    iVar4 = local_c8[-2];
  }
  if (iVar4 < iVar5) {
    if (local_c8 == (int *)0x0) {
      local_c8 = (int *)PTR_DAT_1402f8010;
    }
    if (iVar5 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (iVar5 == 0) {
      FUN_1400031d0(&local_c8);
    }
    else {
      if ((local_c8 != (int *)0x0) && (local_c8 != (int *)PTR_DAT_1402f8010)) {
        iVar3 = local_c8[-2];
      }
      if (iVar5 != iVar3) {
        piVar6 = (int *)FUN_1400a34c0((longlong)iVar5 * 2 + 10);
        iVar3 = 0;
        iVar4 = 0;
        if (piVar6 != (int *)0x0) {
          *piVar6 = 0;
          piVar6[1] = 1;
        }
        *piVar6 = iVar5;
        if ((local_c8 != (int *)0x0) && (local_c8 != (int *)PTR_DAT_1402f8010)) {
          iVar4 = local_c8[-2];
        }
        piVar10 = (int *)PTR_DAT_1402f8010;
        if (iVar5 < iVar4) {
LAB_140192392:
          iVar3 = iVar5;
          if (local_c8 != (int *)0x0) {
            piVar10 = local_c8;
          }
        }
        else if (local_c8 != (int *)0x0) {
          iVar5 = iVar3;
          if (local_c8 != (int *)PTR_DAT_1402f8010) {
            iVar5 = local_c8[-2];
          }
          goto LAB_140192392;
        }
        FUN_1400a32f0(piVar6 + 2,piVar10,iVar3);
        FUN_1400031d0(&local_c8);
        local_c8 = piVar6 + 2;
      }
    }
  }
  FUN_140002e30(&local_c8);
  piVar6 = local_c8;
  if (local_c8 == (int *)0x0) {
    piVar6 = (int *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(piVar6,L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_ProudNetLayer",
                local_c0);
  piVar6 = local_c8;
  if (local_c8 == (int *)0x0) {
    piVar6 = (int *)PTR_DAT_1402f8010;
  }
  iVar4 = FUN_1400a32c0(piVar6);
  iVar5 = 0;
  if (0 < iVar4) {
    iVar5 = iVar4;
  }
  iVar4 = 0;
  if ((local_c8 != (int *)0x0) && (iVar4 = 0, local_c8 != (int *)PTR_DAT_1402f8010)) {
    iVar4 = local_c8[-2];
  }
  if ((iVar4 <= iVar5) && (iVar5 = 0, local_c8 != (int *)0x0)) {
    if (local_c8 == (int *)PTR_DAT_1402f8010) goto LAB_140192447;
    iVar5 = local_c8[-2];
  }
  if (((local_c8 != (int *)PTR_DAT_1402f8010) && (local_c8 != (int *)0x0)) &&
     (local_c8 + -2 != (int *)0x0)) {
    local_c8[-2] = iVar5;
    *(undefined2 *)((longlong)local_c8 + (longlong)iVar5 * 2) = 0;
  }
LAB_140192447:
  iVar5 = FUN_1401450b0(param_2);
  local_res10[0] = FUN_14016aa90(param_2);
  local_b8 = Proud::CFastArray<>::vftable;
  local_b0[0] = 0;
  local_b0[1] = 0;
  local_a8 = 0;
  local_a0 = 0;
  local_98 = 0;
  if (-1 < iVar5) {
    FUN_14003cda0(&local_b8,iVar5);
    lVar9 = local_a8;
    if ((int)local_a0 == 0) {
      lVar9 = 0;
    }
    FUN_1400224d0(lVar9,local_res10[0],(longlong)iVar5);
    local_b8 = Proud::ByteArray::vftable;
    uVar7 = FUN_1401416a0(local_res10,0x1f,param_2[10],&local_c8,&local_b8);
    (**(code **)(**(longlong **)(param_1 + 0x148) + 0x80))(*(longlong **)(param_1 + 0x148),uVar7);
    FUN_140140df0(&local_b8);
    piVar6 = local_c8;
    if (((local_c8 != (int *)0x0) && (local_c8 != (int *)PTR_DAT_1402f8010)) &&
       (piVar10 = local_c8 + -2, piVar10 != (int *)0x0)) {
      ppuVar8 = (undefined **)FUN_1400a3440();
      local_68 = ppuVar8;
      FUN_1400a1c30(ppuVar8);
      local_60 = CONCAT31(local_60._1_3_,1);
      piVar6 = piVar6 + -1;
      *piVar6 = *piVar6 + -1;
      if (*piVar6 == 0) {
        FUN_1400a3530(piVar10);
      }
      FUN_1400d1290(ppuVar8);
    }
    return 1;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_1401925e0(longlong param_1,undefined8 param_2,longlong param_3,undefined8 param_4)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  
  iVar3 = 0;
  while( true ) {
    if (iVar3 == *(int *)(param_3 + 0x18)) {
      return;
    }
    if ((iVar3 < 0) || (*(int *)(param_3 + 0x18) <= iVar3)) break;
    lVar2 = *(longlong *)(param_3 + 0x10);
    iVar1 = *(int *)(lVar2 + (longlong)iVar3 * 0x48);
    if ((int)(iVar1 + (iVar1 >> 0x1f & 7U)) >> 3 != 0) {
      FUN_140164080(*(undefined8 *)(param_1 + 0x148),param_2,
                    "ri.m_unsafeMessage.GetReadOffset() == 0",2);
    }
    FUN_140191e80(param_1,lVar2 + (longlong)iVar3 * 0x48,param_2,param_4);
    if (*(int *)(param_3 + 0x18) <= iVar3) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    iVar3 = iVar3 + 1;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a2700();
}



void FUN_140192690(longlong param_1,longlong param_2,longlong param_3,longlong param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined4 uVar3;
  int iVar4;
  undefined8 uVar5;
  longlong lVar6;
  undefined8 uVar7;
  ulonglong uVar8;
  int iVar9;
  ulonglong uVar10;
  undefined *puVar11;
  undefined8 uVar12;
  undefined4 local_170 [2];
  undefined *local_168;
  longlong local_160;
  undefined **local_158;
  undefined4 local_150;
  undefined2 local_14c;
  undefined **local_148;
  undefined4 local_140;
  undefined2 local_13c;
  undefined **local_138;
  undefined4 local_130;
  undefined2 local_12c;
  undefined **local_128;
  undefined4 local_120;
  undefined2 local_11c;
  undefined1 local_118 [8];
  undefined **local_110;
  undefined4 local_108;
  undefined2 local_104;
  undefined **local_100;
  undefined4 local_f8;
  undefined2 local_f4;
  undefined **local_f0;
  undefined4 local_e8;
  undefined2 local_e4;
  longlong local_e0;
  undefined1 local_d8;
  undefined8 local_d0;
  undefined1 local_c8;
  undefined8 local_c0;
  undefined1 local_b8;
  ulonglong local_b0;
  undefined4 local_a8;
  longlong local_a0;
  undefined4 local_98;
  undefined4 local_94;
  undefined8 local_88;
  undefined1 local_80;
  longlong local_78;
  undefined1 local_70;
  longlong local_68;
  undefined1 local_60;
  undefined8 local_58;
  
  local_58 = 0xfffffffffffffffe;
  uVar10 = 0;
  uVar8 = param_3 + 0x40;
  if (param_3 == 0) {
    uVar8 = uVar10;
  }
  FUN_1401a1470(local_118,uVar8);
  if (*(int *)(param_2 + 8) < 1) {
    lVar6 = param_3 + 0xa8;
    local_68 = lVar6;
    FUN_1400a1c30(lVar6);
    local_60 = 1;
    *(undefined1 *)(param_3 + 0x140) = 0;
    FUN_1401a16d0(param_3);
    FUN_1400d1290(lVar6);
    goto LAB_140192c9d;
  }
  local_158 = Proud::AddrPort::vftable;
  local_150 = 0;
  local_14c = 0;
  local_160 = 0;
  local_148 = Proud::AddrPort::vftable;
  local_140 = 0;
  local_13c = 0;
  FUN_1400a3440();
  local_168 = PTR_DAT_1402f8010;
  uVar5 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  local_c0 = uVar5;
  FUN_1400a1c30(uVar5);
  local_b8 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
              (*(longlong **)(param_1 + 0x148),
               L"Proud::CNetThreads_S::NetWorkerThread_UdpRecvCompletionCase");
  }
  uVar12 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x118) + 8))();
  local_f0 = Proud::AddrPort::vftable;
  local_e8 = *(undefined4 *)(param_2 + 0x30);
  local_e4 = *(undefined2 *)(param_2 + 0x34);
  lVar6 = FUN_1401450e0(*(undefined8 *)(param_1 + 0x148),&local_f0);
  local_100 = Proud::AddrPort::vftable;
  local_f8 = *(undefined4 *)(param_2 + 0x30);
  local_f4 = *(undefined2 *)(param_2 + 0x34);
  local_170[0] = FUN_140145ec0(*(undefined8 *)(param_1 + 0x148),&local_100);
  uVar3 = *(undefined4 *)(*(longlong *)(param_1 + 0x148) + 0x22c);
  if (lVar6 != 0) {
    FUN_1401a1450(lVar6 + 0xc0);
    local_140 = *(undefined4 *)(lVar6 + 0x710);
    local_13c = *(undefined2 *)(lVar6 + 0x714);
  }
  FUN_1400d1290(uVar5);
  local_b8 = 0;
  local_e0 = param_3 + 0xa8;
  FUN_1400a1c30(local_e0);
  local_d8 = 1;
  local_128 = Proud::AddrPort::vftable;
  local_120 = *(undefined4 *)(param_2 + 0x30);
  local_11c = *(undefined2 *)(param_2 + 0x34);
  uVar8 = uVar10;
  if (*(ulonglong **)(param_3 + 0x150) != (ulonglong *)0x0) {
    uVar8 = **(ulonglong **)(param_3 + 0x150);
  }
  uVar5 = *(undefined8 *)(param_3 + 0x178);
  uVar7 = FUN_1400a8b30(uVar8);
  iVar4 = FUN_14019f540(uVar5,uVar7,*(undefined4 *)(param_2 + 8),&local_128,local_170[0],uVar12,
                        &local_160,&local_168);
  FUN_1400d1290(param_3 + 0xa8);
  local_d8 = 0;
  if (iVar4 == 0) {
    if (lVar6 != 0) {
      *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x600) =
           *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x600) + 1;
      *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x640) =
           *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x640) +
           (longlong)*(int *)(local_160 + 0x40);
      uVar5 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x118) + 8))();
      *(undefined8 *)(lVar6 + 0x198) = uVar5;
      uVar5 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x118) + 8))();
      *(undefined8 *)(lVar6 + 0x1b8) = uVar5;
      FUN_140174e40(param_4,0);
      if (*(int *)(local_160 + 0x40) != 0) {
        uVar10 = *(ulonglong *)(local_160 + 0x38);
      }
      FUN_14019ae80(lVar6,uVar10,*(int *)(local_160 + 0x40),&local_148,uVar3,param_4);
      FUN_1401925e0(param_1,lVar6,param_4,param_3);
      goto LAB_140192bac;
    }
    FUN_140174e40(param_4,0);
    FUN_1401a3a00(&local_b0);
    local_b0 = uVar10;
    if (*(int *)(local_160 + 0x40) != 0) {
      local_b0 = *(ulonglong *)(local_160 + 0x38);
    }
    local_a8 = *(undefined4 *)(local_160 + 0x40);
    local_98 = 0;
    local_a0 = param_4;
    local_94 = uVar3;
    iVar4 = FUN_1401a4390(&local_b0,local_170);
    if (-1 < iVar4) {
      iVar4 = *(int *)(param_4 + 0x18);
      while (iVar9 = (int)uVar10, iVar9 != iVar4) {
        if ((iVar9 < 0) || (iVar4 <= iVar9)) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        lVar6 = *(longlong *)(param_4 + 0x10) + (longlong)iVar9 * 0x48;
        FUN_140185160(lVar6,0);
        local_138 = Proud::AddrPort::vftable;
        local_130 = local_150;
        local_12c = local_14c;
        FUN_14018eb70(param_1,&local_138,lVar6,param_3);
        iVar4 = *(int *)(param_4 + 0x18);
        if (iVar4 <= iVar9) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        uVar10 = (ulonglong)(iVar9 + 1);
      }
    }
  }
  else {
    if (iVar4 == 2) {
      uVar5 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
      local_d0 = uVar5;
      FUN_1400a1c30(uVar5);
      local_c8 = 1;
      if (DAT_140313fcf != '\0') {
        (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                  (*(longlong **)(param_1 + 0x148),
                   L"Proud::CNetThreads_S::NetWorkerThread_UdpRecvCompletionCase");
      }
      puVar11 = local_168;
      if (local_168 == (undefined *)0x0) {
        puVar11 = PTR_DAT_1402f8010;
      }
      local_110 = Proud::AddrPort::vftable;
      local_108 = *(undefined4 *)(param_2 + 0x30);
      local_104 = *(undefined2 *)(param_2 + 0x34);
      FUN_1401576a0(*(undefined8 *)(param_1 + 0x148),&local_110,puVar11);
      FUN_1400d1290(uVar5);
      local_c8 = 0;
    }
LAB_140192bac:
    if (lVar6 != 0) {
      FUN_1401a1460(lVar6 + 0xc0);
    }
  }
  lVar6 = param_3 + 0xa8;
  local_78 = lVar6;
  FUN_1400a1c30(lVar6);
  local_70 = 1;
  *(undefined1 *)(param_3 + 0x140) = 0;
  FUN_1401a16d0(param_3);
  FUN_1400d1290(lVar6);
  puVar11 = local_168;
  if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1402f8010)) &&
     (puVar1 = local_168 + -8, puVar1 != (undefined *)0x0)) {
    uVar5 = FUN_1400a3440();
    local_88 = uVar5;
    FUN_1400a1c30(uVar5);
    local_80 = 1;
    piVar2 = (int *)(puVar11 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar5);
  }
  local_168 = PTR_DAT_1402f8010;
  if (local_160 != 0) {
    FUN_14018b6e0();
  }
LAB_140192c9d:
  FUN_1401a1480(local_118);
  return;
}



void FUN_140192cd0(longlong param_1,longlong param_2,longlong param_3,undefined8 param_4)

{
  int *piVar1;
  bool bVar2;
  int iVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  longlong *plVar6;
  undefined8 uVar7;
  undefined8 *puVar8;
  longlong lVar9;
  undefined *puVar10;
  undefined *puVar11;
  undefined *local_res10;
  undefined1 local_res18 [16];
  undefined ***pppuVar12;
  undefined8 in_stack_fffffffffffffec0;
  undefined4 uVar13;
  undefined *local_118;
  undefined **local_110;
  undefined8 local_108;
  undefined8 local_100;
  undefined8 local_f8;
  undefined8 local_f0;
  undefined **local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined **local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  undefined1 local_90;
  undefined8 local_88;
  undefined1 local_80;
  undefined8 local_78;
  undefined1 local_70;
  undefined8 local_68;
  undefined1 local_60;
  undefined8 local_58;
  undefined1 local_50;
  undefined8 local_48;
  
  uVar13 = (undefined4)((ulonglong)in_stack_fffffffffffffec0 >> 0x20);
  local_48 = 0xfffffffffffffffe;
  if (param_3 == 0) {
    lVar9 = 0;
  }
  else {
    lVar9 = param_3 + 0xc0;
  }
  FUN_1401a1470(local_res18,lVar9);
  uVar4 = (**(code **)(*(longlong *)(param_3 + 0x108) + 0x10))();
  FUN_1400a1c30(uVar4);
  iVar3 = *(int *)(param_2 + 8);
  if (iVar3 < 1) {
    *(undefined1 *)(*(longlong *)(param_3 + 0x748) + 0x40) = 0;
    FUN_1400d1290(uVar4);
    uVar5 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    local_88 = uVar5;
    FUN_1400a1c30(uVar5);
    local_80 = 1;
    if (DAT_140313fcf != '\0') {
      (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                (*(longlong **)(param_1 + 0x148),
                 L"Proud::CNetThreads_S::NetWorkerThread_TcpRecvCompletionCase");
    }
    local_108 = 0;
    local_100 = 0;
    local_f8 = 0;
    local_f0 = 0;
    local_110 = Proud::ByteArray::vftable;
    pppuVar12 = &local_110;
    FUN_140166b70(*(undefined8 *)(param_1 + 0x148),param_3,0xb,3,pppuVar12,
                  L"Proud::CNetThreads_S::NetWorkerThread_TcpRecvCompletionCase",
                  *(undefined4 *)(param_2 + 0xc));
    uVar13 = (undefined4)((ulonglong)pppuVar12 >> 0x20);
    FUN_140140df0(&local_110);
    (**(code **)(*(longlong *)(param_3 + 0xa0) + 0x40))
              ((longlong *)(param_3 + 0xa0),
               L"Proud::CNetThreads_S::NetWorkerThread_TcpRecvCompletionCase");
    if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0) {
      FUN_1400a3440();
      local_res10 = PTR_DAT_1402f8010;
      puVar8 = (undefined8 *)(*(longlong *)(param_3 + 0x748) + 0x128);
      plVar6 = (longlong *)(**(code **)*puVar8)(puVar8,&local_118);
      puVar11 = (undefined *)*plVar6;
      if ((undefined *)*plVar6 == (undefined *)0x0) {
        puVar11 = PTR_DAT_1402f8010;
      }
      FUN_14003c600(&local_res10,&DAT_14025aff0,*(undefined4 *)(param_3 + 0x6f8),puVar11,
                    CONCAT44(uVar13,*(undefined4 *)(param_2 + 0xc)));
      if (((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1402f8010)) &&
         (local_118 + -8 != (undefined *)0x0)) {
        uVar7 = FUN_1400a3440();
        local_68 = uVar7;
        FUN_1400a1c30(uVar7);
        local_60 = 1;
        piVar1 = (int *)(local_118 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_118 + -8);
        }
        FUN_1400d1290(uVar7);
      }
      puVar11 = local_res10;
      puVar10 = local_res10;
      if (local_res10 == (undefined *)0x0) {
        puVar10 = PTR_DAT_1402f8010;
      }
      FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),0,puVar10);
      if (((puVar11 != (undefined *)0x0) && (puVar11 != PTR_DAT_1402f8010)) &&
         (puVar11 + -8 != (undefined *)0x0)) {
        uVar7 = FUN_1400a3440();
        local_98 = uVar7;
        FUN_1400a1c30(uVar7);
        local_90 = 1;
        piVar1 = (int *)(puVar11 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar11 + -8);
        }
        FUN_1400d1290(uVar7);
      }
    }
LAB_1401931b4:
    bVar2 = false;
    FUN_1400d1290(uVar5);
  }
  else {
    uVar5 = FUN_1400a8b30(*(undefined8 *)(*(longlong *)(param_3 + 0x748) + 0x110));
    FUN_1401c11f0(*(longlong *)(param_3 + 0x748) + 200,uVar5,iVar3);
    FUN_140174e40(param_4,0);
    iVar3 = FUN_14019ae10(param_3,param_4);
    if (iVar3 != 0) {
      *(undefined1 *)(*(longlong *)(param_3 + 0x748) + 0x40) = 0;
      FUN_1400d1290(uVar4);
      uVar4 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
      local_78 = uVar4;
      FUN_1400a1c30(uVar4);
      local_70 = 1;
      if (DAT_140313fcf != '\0') {
        (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                  (*(longlong **)(param_1 + 0x148),
                   L"Proud::CNetThreads_S::NetWorkerThread_TcpRecvCompletionCase");
      }
      local_b8 = 0;
      local_b0 = 0;
      local_a8 = 0;
      local_a0 = 0;
      local_c0 = Proud::ByteArray::vftable;
      FUN_140166b70(*(undefined8 *)(param_1 + 0x148),param_3,iVar3,3,&local_c0,
                    L"Proud::CNetThreads_S::NetWorkerThread_TcpRecvCompletionCase",0);
      FUN_140140df0(&local_c0);
      FUN_1400d1290(uVar4);
      goto LAB_1401931cb;
    }
    FUN_1400d1290(uVar4);
    uVar5 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x118) + 8))();
    *(undefined8 *)(param_3 + 0x180) = uVar5;
    *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x500) =
         *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x500) + 1;
    *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x540) =
         *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x540) + (longlong)*(int *)(param_2 + 8);
    FUN_1401925e0(param_1,param_3,param_4,0);
    bVar2 = true;
    FUN_1400a1c30(uVar4);
    *(undefined1 *)(*(longlong *)(param_3 + 0x748) + 0x40) = 0;
    iVar3 = FUN_1401a0f10(*(undefined8 *)(param_3 + 0x748));
    if (iVar3 != 0) {
      FUN_1400d1290(uVar4);
      uVar5 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
      local_58 = uVar5;
      FUN_1400a1c30(uVar5);
      local_50 = 1;
      if (DAT_140313fcf != '\0') {
        (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                  (*(longlong **)(param_1 + 0x148),
                   L"Proud::CNetThreads_S::NetWorkerThread_TcpRecvCompletionCase");
      }
      local_e0 = 0;
      local_d8 = 0;
      local_d0 = 0;
      local_c8 = 0;
      local_e8 = Proud::ByteArray::vftable;
      (**(code **)(*(longlong *)(param_3 + 0xa0) + 0x38))
                (param_3 + 0xa0,0xb,3,&local_e8,
                 L"Proud::CNetThreads_S::NetWorkerThread_TcpRecvCompletionCase",
                 CONCAT44(uVar13,iVar3));
      FUN_140140df0(&local_e8);
      (**(code **)(*(longlong *)(param_3 + 0xa0) + 0x40))
                (param_3 + 0xa0,L"Proud::CNetThreads_S::NetWorkerThread_TcpRecvCompletionCase");
      goto LAB_1401931b4;
    }
  }
  if (bVar2) {
    FUN_1400d1290(uVar4);
  }
LAB_1401931cb:
  FUN_1401a1480(local_res18);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140193200(longlong param_1,undefined8 *param_2,undefined8 param_3)

{
  int iVar1;
  undefined1 auStack_188 [32];
  longlong local_168;
  longlong local_160;
  undefined8 local_150;
  ulonglong local_28;
  
  local_150 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_188;
  local_168 = 0;
  local_160 = param_1;
  local_168 = FUN_1401a76b0(*param_2);
  if (local_168 != 0) {
    iVar1 = *(int *)(param_2 + 2);
    if (iVar1 == 2) {
      FUN_140192cd0(param_1,param_2,local_168,param_3);
    }
    else if (iVar1 == 1) {
      FUN_14018baa0(param_1,param_2,local_168);
    }
    else if (((iVar1 == 0) && (*(int *)(param_2 + 3) == -1)) &&
            (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x788) != 0)) {
      FUN_14018f060(param_1);
    }
  }
  return;
}



void FUN_1401932d0(longlong param_1)

{
  int *piVar1;
  double *pdVar2;
  undefined8 *puVar3;
  undefined *puVar4;
  char cVar5;
  HANDLE hThread;
  longlong lVar6;
  undefined8 uVar7;
  int iVar8;
  undefined4 *puVar10;
  ulonglong uVar11;
  undefined *puVar12;
  ulonglong uVar13;
  double dVar14;
  double dVar15;
  undefined1 local_res10 [8];
  undefined4 *local_res18;
  undefined *local_res20;
  undefined **local_108;
  longlong *local_100;
  longlong local_f8;
  undefined8 local_f0;
  undefined8 local_e8;
  undefined **local_e0;
  longlong *local_d8;
  longlong local_d0;
  undefined8 local_c8;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined **local_b8;
  longlong *local_b0;
  longlong local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  int local_80;
  undefined8 local_78;
  undefined4 local_70;
  undefined **local_68;
  undefined4 local_60;
  undefined2 local_5c;
  undefined8 local_58;
  undefined1 local_50;
  undefined8 local_48;
  ulonglong uVar9;
  
  local_48 = 0xfffffffffffffffe;
  hThread = GetCurrentThread();
  SetThreadPriorityBoost(hThread,0);
  FUN_1401c10a0(local_res10);
  local_b8 = Proud::CFastArray<>::vftable;
  uVar11 = 0;
  local_b0 = (longlong *)0x0;
  local_a8 = 0;
  local_a0 = 0;
  local_98 = 0;
  local_d8 = (longlong *)0x0;
  local_d0 = 0;
  local_c8 = 0;
  local_e0 = Proud::CReceivedMessageList::vftable;
  local_c0 = 1000;
  local_bc = 1;
  cVar5 = FUN_1400a2ce0();
  if (cVar5 == '\0') {
    cVar5 = *(char *)(param_1 + 0x140);
    while (cVar5 == '\0') {
      local_68 = Proud::AddrPort::vftable;
      local_90 = 0;
      local_78 = 0;
      local_88 = 0;
      local_80 = 5;
      local_70 = 0;
      local_60 = DAT_1402f83d0;
      local_5c = DAT_1402f83d4;
      cVar5 = FUN_1400abce0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x788),&local_90,
                            DAT_1402f8068);
      dVar14 = (double)(**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x118) + 8))();
      dVar15 = dVar14 - *(double *)(param_1 + 0x100);
      pdVar2 = (double *)(*(longlong *)(param_1 + 0x148) + 0x820);
      if (*pdVar2 <= dVar15 && dVar15 != *pdVar2) {
        *(double *)(param_1 + 0x100) = dVar14;
        FUN_14018ae30(param_1,&local_b8);
      }
      if (cVar5 != '\0') {
        FUN_140193200(param_1,&local_90,&local_e0);
        lVar6 = FUN_1401a7650(local_90);
        if (lVar6 != 0) {
          if (local_80 == 2) {
            FUN_140192690(param_1,&local_90,lVar6,&local_e0);
          }
          else if (local_80 == 1) {
            FUN_14018a7d0(param_1,&local_90,lVar6);
          }
        }
      }
      cVar5 = *(char *)(param_1 + 0x140);
    }
  }
  else {
    local_108 = Proud::CFastArray<>::vftable;
    local_100 = (longlong *)0x0;
    local_f8 = 0;
    local_f0 = 0;
    local_e8 = 0;
    FUN_14018b1d0(&local_108,10);
    local_res18 = (undefined4 *)((ulonglong)local_res18 & 0xffffffff00000000);
    while (*(char *)(param_1 + 0x140) == '\0') {
      cVar5 = FUN_1400ac130(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x788),&local_108,
                            &local_res18,DAT_1402f8068);
      dVar14 = (double)(**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x118) + 8))();
      dVar15 = dVar14 - *(double *)(param_1 + 0x100);
      pdVar2 = (double *)(*(longlong *)(param_1 + 0x148) + 0x820);
      if (*pdVar2 <= dVar15 && dVar15 != *pdVar2) {
        *(double *)(param_1 + 0x100) = dVar14;
        FUN_14018ae30(param_1,&local_b8);
      }
      if ((cVar5 != '\0') && (uVar9 = uVar11, uVar13 = uVar11, (uint)local_res18 != 0)) {
        do {
          iVar8 = (int)uVar9;
          if ((iVar8 < 0) || ((int)local_f0 <= iVar8)) {
                    // WARNING: Subroutine does not return
            FUN_1400a2700();
          }
          FUN_140193200(param_1,(longlong)iVar8 * 0x38 + local_f8,&local_e0);
          if ((int)local_f0 <= iVar8) {
                    // WARNING: Subroutine does not return
            FUN_1400a2700();
          }
          puVar3 = (undefined8 *)(uVar13 + local_f8);
          lVar6 = FUN_1401a7650(*puVar3);
          if (lVar6 != 0) {
            if (*(int *)(puVar3 + 2) == 2) {
              FUN_140192690(param_1,puVar3,lVar6,&local_e0);
            }
            else if (*(int *)(puVar3 + 2) == 1) {
              FUN_14018a7d0(param_1,puVar3,lVar6);
            }
          }
          uVar9 = (ulonglong)(iVar8 + 1U);
          uVar13 = uVar13 + 0x38;
        } while (iVar8 + 1U < (uint)local_res18);
      }
    }
    local_108 = Proud::CFastArray<>::vftable;
    if (local_f8 != 0) {
      if (local_100 == (longlong *)0x0) {
        FUN_1400a3530();
      }
      else {
        (**(code **)(*local_100 + 0x18))(local_100,local_f8);
      }
    }
  }
  if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0) {
    FUN_1400a3440();
    local_res20 = PTR_DAT_1402f8010;
    FUN_14003c600(&local_res20,&DAT_14025aae8,L"Proud::CNetThreads_S::NetWorkerThread_Main");
    puVar4 = local_res20;
    puVar12 = local_res20;
    if (local_res20 == (undefined *)0x0) {
      puVar12 = PTR_DAT_1402f8010;
    }
    FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),0,puVar12);
    if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1402f8010)) &&
       (puVar4 + -8 != (undefined *)0x0)) {
      uVar7 = FUN_1400a3440();
      local_58 = uVar7;
      FUN_1400a1c30(uVar7);
      local_50 = 1;
      piVar1 = (int *)(puVar4 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar4 + -8);
      }
      FUN_1400d1290(uVar7);
    }
  }
  local_e0 = Proud::CFastArray<>::vftable;
  lVar6 = (longlong)(int)local_c8;
  if (0 < (int)local_c8) {
    puVar10 = (undefined4 *)(local_d0 + 0x18);
    do {
      local_res18 = puVar10 + -4;
      FUN_14019a730();
      if (*(longlong *)(puVar10 + -2) != 0) {
        if ((int)puVar10[1] < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        *puVar10 = 0;
      }
      uVar11 = uVar11 + 1;
      puVar10 = puVar10 + 0x12;
    } while ((longlong)uVar11 < lVar6);
  }
  if (local_d0 != 0) {
    if (local_d8 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*local_d8 + 0x18))(local_d8,local_d0);
    }
  }
  if (local_a8 != 0) {
    if (local_b0 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*local_b0 + 0x18))(local_b0,local_a8);
    }
  }
  FUN_1401c10d0(local_res10);
  return;
}



void FUN_140193780(undefined8 param_1)

{
  DWORD DVar1;
  
  DVar1 = GetCurrentThreadId();
  FUN_1400aaed0(DVar1,"PNSrv NetWorker");
  FUN_1401932d0(param_1);
  return;
}



void FUN_1401937b0(longlong param_1,int param_2,int param_3)

{
  longlong *plVar1;
  uint uVar2;
  longlong *plVar3;
  void *pvVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  undefined8 uVar9;
  undefined8 *puVar10;
  int iVar11;
  int iVar12;
  int iVar13;
  longlong lVar14;
  int local_res18;
  longlong *local_88;
  longlong *local_80;
  longlong *local_78;
  longlong *local_70;
  undefined8 local_68;
  longlong local_60;
  undefined1 local_58;
  
  local_68 = 0xfffffffffffffffe;
  uVar2 = *(uint *)(*(longlong *)(param_1 + 0x148) + 600);
  if (uVar2 != 0) {
    FUN_1401bd0b0(param_1 + 0x1e8,(double)uVar2 * 0.001);
  }
  pvVar4 = operator_new(0x28);
  if (pvVar4 == (void *)0x0) {
    lVar5 = 0;
  }
  else {
    lVar5 = FUN_1400aa980(pvVar4,FUN_140191900,param_1);
  }
  if (lVar5 == 0) {
    local_80 = (longlong *)0x0;
  }
  else {
    local_80 = (longlong *)FUN_1400a34c0(0x10);
    local_80[1] = 1;
    *local_80 = lVar5;
  }
  plVar1 = local_80;
  FUN_14018b790(param_1 + 0x88,&local_80);
  plVar3 = local_80;
  if (plVar1 != (longlong *)0x0) {
    plVar1 = plVar1 + 1;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      pvVar4 = (void *)*local_80;
      if (pvVar4 != (void *)0x0) {
        FUN_1400aaa90(pvVar4);
        operator_delete(pvVar4);
      }
      FUN_1400a3530(plVar3);
    }
  }
  pvVar4 = operator_new(0x28);
  if (pvVar4 == (void *)0x0) {
    lVar5 = 0;
  }
  else {
    lVar5 = FUN_1400aa980(pvVar4,FUN_14018ce80,param_1);
  }
  if (lVar5 == 0) {
    local_78 = (longlong *)0x0;
  }
  else {
    local_78 = (longlong *)FUN_1400a34c0(0x10);
    local_78[1] = 1;
    *local_78 = lVar5;
  }
  plVar1 = local_78;
  FUN_14018b790(param_1 + 0x90,&local_78);
  plVar3 = local_78;
  if (plVar1 != (longlong *)0x0) {
    plVar1 = plVar1 + 1;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      pvVar4 = (void *)*local_78;
      if (pvVar4 != (void *)0x0) {
        FUN_1400aaa90(pvVar4);
        operator_delete(pvVar4);
      }
      FUN_1400a3530(plVar3);
    }
  }
  iVar13 = 0;
  if (0 < param_3) {
    lVar5 = param_1 + 0x38;
    do {
      local_70 = operator_new(0x28);
      if (local_70 == (longlong *)0x0) {
        lVar6 = 0;
      }
      else {
        lVar6 = FUN_1400aa980(local_70,FUN_140193780,param_1);
      }
      if (lVar6 == 0) {
        local_70 = (longlong *)0x0;
      }
      else {
        local_70 = (longlong *)FUN_1400a34c0(0x10);
        local_70[1] = 1;
        *local_70 = lVar6;
      }
      plVar1 = local_70;
      iVar11 = *(int *)(param_1 + 0x50);
      if (iVar11 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      iVar12 = *(int *)(param_1 + 0x50);
      FUN_14018f440(lVar5,iVar12 + 1);
      iVar12 = iVar12 - iVar11;
      if ((0 < iVar12) && (iVar12 = iVar12 + -1, -1 < iVar12)) {
        lVar6 = (longlong)(iVar12 + iVar11 + 1) << 3;
        lVar14 = (longlong)(iVar12 + iVar11) << 3;
        do {
          lVar7 = FUN_1401b2160(lVar5);
          lVar8 = FUN_1401b2160(lVar5);
          FUN_14018b790(lVar6 + lVar8,lVar14 + lVar7);
          lVar14 = lVar14 + -8;
          lVar6 = lVar6 + -8;
          iVar12 = iVar12 + -1;
        } while (-1 < iVar12);
      }
      lVar6 = FUN_1401b2160(lVar5);
      FUN_14018b790(lVar6 + (longlong)iVar11 * 8,&local_70);
      plVar3 = local_70;
      if (plVar1 != (longlong *)0x0) {
        plVar1 = plVar1 + 1;
        *plVar1 = *plVar1 + -1;
        if (*plVar1 == 0) {
          pvVar4 = (void *)*local_70;
          if (pvVar4 != (void *)0x0) {
            FUN_1400aaa90(pvVar4);
            operator_delete(pvVar4);
          }
          FUN_1400a3530(plVar3);
        }
      }
      iVar13 = iVar13 + 1;
    } while (iVar13 < param_3);
  }
  local_60 = param_1;
  FUN_1400a1c30(param_1);
  local_58 = 1;
  local_res18 = 0;
  if (0 < param_2) {
    do {
      pvVar4 = operator_new(0x28);
      if (pvVar4 == (void *)0x0) {
        lVar5 = 0;
      }
      else {
        lVar5 = FUN_1400aa980(pvVar4,FUN_140191930,param_1);
      }
      if (lVar5 == 0) {
        local_88 = (longlong *)0x0;
      }
      else {
        local_88 = (longlong *)FUN_1400a34c0(0x10);
        local_88[1] = 1;
        *local_88 = lVar5;
      }
      iVar13 = *(int *)(param_1 + 0x78);
      lVar5 = (longlong)iVar13;
      if (iVar13 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      iVar11 = *(int *)(param_1 + 0x78);
      FUN_14018f440(param_1 + 0x60,iVar11 + 1);
      iVar11 = iVar11 - iVar13;
      if ((0 < iVar11) && (iVar11 = iVar11 + -1, lVar6 = (longlong)iVar11, -1 < iVar11)) {
        lVar14 = (lVar6 + lVar5) * 8 + 8;
        do {
          lVar8 = FUN_1401b2160(param_1 + 0x60);
          lVar7 = FUN_1401b2160(param_1 + 0x60);
          plVar1 = (longlong *)(lVar14 + lVar7);
          lVar7 = *(longlong *)(lVar8 + -8 + lVar14);
          if (lVar7 != *plVar1) {
            if (lVar7 != 0) {
              *(longlong *)(*(longlong *)(lVar8 + -8 + lVar14) + 8) = *(longlong *)(lVar7 + 8) + 1;
            }
            puVar10 = (undefined8 *)0x0;
            if ((*plVar1 != 0) &&
               (*(longlong *)(*plVar1 + 8) = *(longlong *)(*plVar1 + 8) + -1,
               *(longlong *)(*plVar1 + 8) == 0)) {
              puVar10 = (undefined8 *)*plVar1;
            }
            *plVar1 = *(longlong *)(lVar8 + -8 + lVar14);
            if (puVar10 != (undefined8 *)0x0) {
              pvVar4 = (void *)*puVar10;
              if (pvVar4 != (void *)0x0) {
                FUN_1400aaa90(pvVar4);
                operator_delete(pvVar4);
              }
              FUN_1400a3530(puVar10);
            }
          }
          lVar14 = lVar14 + -8;
          lVar6 = lVar6 + -1;
        } while (-1 < lVar6);
      }
      lVar6 = FUN_1401b2160(param_1 + 0x60);
      if (local_88 != *(longlong **)(lVar6 + lVar5 * 8)) {
        if (local_88 != (longlong *)0x0) {
          local_88[1] = local_88[1] + 1;
        }
        puVar10 = (undefined8 *)0x0;
        lVar14 = *(longlong *)(lVar6 + lVar5 * 8);
        if ((lVar14 != 0) &&
           (*(longlong *)(*(longlong *)(lVar6 + lVar5 * 8) + 8) = *(longlong *)(lVar14 + 8) + -1,
           *(longlong *)(*(longlong *)(lVar6 + lVar5 * 8) + 8) == 0)) {
          puVar10 = *(undefined8 **)(lVar6 + lVar5 * 8);
        }
        *(longlong **)(lVar6 + lVar5 * 8) = local_88;
        if (puVar10 != (undefined8 *)0x0) {
          pvVar4 = (void *)*puVar10;
          if (pvVar4 != (void *)0x0) {
            FUN_1400aaa90(pvVar4);
            operator_delete(pvVar4);
          }
          FUN_1400a3530(puVar10);
        }
      }
      if (local_88 != (longlong *)0x0) {
        plVar1 = local_88 + 1;
        *plVar1 = *plVar1 + -1;
        if (*plVar1 == 0) {
          pvVar4 = (void *)*local_88;
          if (pvVar4 != (void *)0x0) {
            FUN_1400aaa90(pvVar4);
            operator_delete(pvVar4);
          }
          FUN_1400a3530(local_88);
        }
      }
      local_res18 = local_res18 + 1;
    } while (local_res18 < param_2);
  }
  FUN_1400d1290(param_1);
  uVar9 = 0;
  if (*(undefined8 **)(param_1 + 0x88) != (undefined8 *)0x0) {
    uVar9 = **(undefined8 **)(param_1 + 0x88);
  }
  FUN_1400aab80(uVar9);
  uVar9 = 0;
  if (*(undefined8 **)(param_1 + 0x90) != (undefined8 *)0x0) {
    uVar9 = **(undefined8 **)(param_1 + 0x90);
  }
  FUN_1400aab80(uVar9);
  iVar13 = 0;
  lVar5 = 0;
  if (0 < *(int *)(param_1 + 0x50)) {
    do {
      if ((lVar5 < 0) || (*(int *)(param_1 + 0x50) <= iVar13)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      puVar10 = *(undefined8 **)(*(longlong *)(param_1 + 0x48) + lVar5 * 8);
      uVar9 = 0;
      if (puVar10 != (undefined8 *)0x0) {
        uVar9 = *puVar10;
      }
      FUN_1400aab80(uVar9);
      iVar13 = iVar13 + 1;
      lVar5 = lVar5 + 1;
    } while (iVar13 < *(int *)(param_1 + 0x50));
  }
  iVar13 = 0;
  lVar5 = 0;
  if (0 < *(int *)(param_1 + 0x78)) {
    do {
      if ((lVar5 < 0) || (*(int *)(param_1 + 0x78) <= iVar13)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      puVar10 = *(undefined8 **)(*(longlong *)(param_1 + 0x70) + lVar5 * 8);
      uVar9 = 0;
      if (puVar10 != (undefined8 *)0x0) {
        uVar9 = *puVar10;
      }
      FUN_1400aab80(uVar9);
      iVar13 = iVar13 + 1;
      lVar5 = lVar5 + 1;
    } while (iVar13 < *(int *)(param_1 + 0x78));
  }
  return;
}



void FUN_140193d80(char *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  undefined1 local_58 [88];
  
  if (*param_1 != '\0') {
    iVar4 = 0;
    if ((*(longlong *)(param_1 + 0x20) != 0) && (*(longlong *)(param_1 + 8) == 0)) {
      FUN_1400a2320(local_58,L"CFastMap consistency error #0!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    lVar1 = *(longlong *)(param_1 + 0x10);
    lVar3 = lVar1;
    while (lVar3 != 0) {
      lVar2 = *(longlong *)(lVar3 + 8);
      if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x10) != lVar3)) {
        FUN_1400a2320(local_58,L"CFastMap consistency error #1!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      if ((lVar3 == lVar1) && (*(longlong *)(lVar3 + 0x10) != 0)) {
        FUN_1400a2320(local_58,L"CFastMap consistency error #2!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      if ((lVar3 == *(longlong *)(param_1 + 0x18)) && (lVar2 != 0)) {
        FUN_1400a2320(local_58,L"CFastMap consistency error #3!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      iVar4 = iVar4 + 1;
      lVar3 = lVar2;
    }
    if (iVar4 != *(int *)(param_1 + 0x20)) {
      for (; lVar1 != 0; lVar1 = *(longlong *)(lVar1 + 8)) {
      }
      FUN_1400a2320(local_58,L"CFastMap consistency error #4!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
  }
  return;
}



void FUN_140193eb0(longlong param_1)

{
  longlong *plVar1;
  uint uVar2;
  ulonglong uVar3;
  longlong lVar4;
  longlong lVar5;
  float fVar6;
  float fVar7;
  
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
  FUN_140193d80();
  lVar4 = *(longlong *)(param_1 + 0x10);
  while (lVar4 != 0) {
    plVar1 = *(longlong **)(param_1 + 0x50);
    lVar5 = *(longlong *)(lVar4 + 8);
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar4);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar4 = lVar5;
  }
  FUN_1400a3530(*(undefined8 *)(param_1 + 8));
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  FUN_140193d80(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar2 = FUN_140142850(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_1400a3530();
      *(undefined8 *)(param_1 + 8) = 0;
    }
    lVar4 = 0;
    *(uint *)(param_1 + 0x28) = uVar2;
    fVar7 = (float)uVar2 * *(float *)(param_1 + 0x34);
    if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
      lVar4 = -0x8000000000000000;
    }
    fVar6 = (float)uVar2 * *(float *)(param_1 + 0x30);
    lVar5 = 0;
    *(longlong *)(param_1 + 0x38) = (longlong)fVar7 + lVar4;
    if ((9.223372e+18 < fVar6) && (fVar6 = fVar6 - 9.223372e+18, fVar6 < 9.223372e+18)) {
      lVar5 = -0x8000000000000000;
    }
    uVar3 = (longlong)fVar6 + lVar5;
    if ((ulonglong)((longlong)fVar6 + lVar5) < 0x11) {
      uVar3 = 0;
    }
    *(ulonglong *)(param_1 + 0x40) = uVar3;
  }
  FUN_140193d80(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



ulonglong FUN_140193fe0(longlong *param_1,wchar_t *param_2,void *param_3)

{
  undefined *puVar1;
  rsize_t _DstSize;
  int iVar2;
  int iVar3;
  uint uVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  ulonglong uVar8;
  wchar_t *pwVar9;
  longlong lVar10;
  uint uVar11;
  int iVar12;
  int iVar13;
  int iVar14;
  wchar_t *pwVar15;
  longlong lVar16;
  longlong lVar17;
  wchar_t *pwVar18;
  uint local_58;
  
  uVar8 = FUN_1400a32c0(param_2);
  iVar2 = (int)uVar8;
  if (iVar2 != 0) {
    iVar3 = FUN_1400a32c0(param_3);
    pwVar18 = (wchar_t *)*param_1;
    uVar4 = 0;
    local_58 = 0;
    uVar11 = uVar4;
    pwVar15 = (wchar_t *)PTR_DAT_1402f8010;
    if ((pwVar18 != (wchar_t *)0x0) && (pwVar15 = pwVar18, pwVar18 != (wchar_t *)PTR_DAT_1402f8010))
    {
      uVar11 = *(uint *)(pwVar18 + -4);
    }
    pwVar18 = pwVar15 + (int)uVar11;
    if (pwVar15 < pwVar18) {
      do {
        pwVar9 = wcsstr(pwVar15,param_2);
        while (pwVar9 != (wchar_t *)0x0) {
          pwVar15 = pwVar9 + iVar2;
          uVar4 = uVar4 + 1;
          pwVar9 = wcsstr(pwVar15,param_2);
          local_58 = uVar4;
        }
        iVar5 = FUN_1400a32c0(pwVar15);
        pwVar15 = pwVar15 + (iVar5 + 1);
      } while (pwVar15 < pwVar18);
      if (0 < (int)uVar4) {
        puVar1 = (undefined *)*param_1;
        iVar5 = 0;
        if ((puVar1 != (undefined *)0x0) && (iVar5 = 0, puVar1 != PTR_DAT_1402f8010)) {
          iVar5 = *(int *)(puVar1 + -8);
        }
        lVar16 = (longlong)iVar3;
        iVar12 = (iVar3 - iVar2) * uVar4 + iVar5;
        iVar7 = iVar5;
        if (iVar5 < iVar12) {
          iVar7 = iVar12;
        }
        iVar13 = 0;
        iVar14 = iVar13;
        if ((puVar1 != (undefined *)0x0) && (puVar1 != PTR_DAT_1402f8010)) {
          iVar14 = *(int *)(puVar1 + -8);
        }
        iVar6 = 0;
        if (((iVar7 <= iVar14) && (iVar7 = iVar13, puVar1 != (undefined *)0x0)) &&
           (iVar7 = iVar6, puVar1 != PTR_DAT_1402f8010)) {
          iVar7 = *(int *)(puVar1 + -8);
        }
        iVar14 = 1;
        if (1 < iVar7) {
          iVar14 = iVar7;
        }
        if ((puVar1 != (undefined *)0x0) && (puVar1 != PTR_DAT_1402f8010)) {
          iVar6 = *(int *)(puVar1 + -8);
        }
        if (iVar6 < iVar14) {
          FUN_140002d50(param_1);
        }
        FUN_140002e30(param_1);
        lVar10 = (longlong)iVar5;
        pwVar15 = (wchar_t *)*param_1;
        if ((wchar_t *)*param_1 == (wchar_t *)0x0) {
          pwVar15 = (wchar_t *)PTR_DAT_1402f8010;
        }
        for (pwVar18 = pwVar15; pwVar18 < pwVar15 + lVar10; pwVar18 = pwVar18 + (iVar7 + 1)) {
          pwVar9 = wcsstr(pwVar18,param_2);
          if (pwVar9 != (wchar_t *)0x0) {
            do {
              pwVar18 = pwVar9 + lVar16;
              lVar17 = (longlong)
                       ((iVar5 - (int)((longlong)pwVar9 - (longlong)pwVar15 >> 1)) - iVar2);
              _DstSize = lVar17 * 2;
              memmove_s(pwVar18,_DstSize,pwVar9 + iVar2,_DstSize);
              memcpy_s(pwVar9,lVar16 * 2,param_3,lVar16 * 2);
              pwVar9[lVar16 + lVar17] = L'\0';
              iVar5 = iVar5 + (iVar3 - iVar2);
              pwVar9 = wcsstr(pwVar18,param_2);
            } while (pwVar9 != (wchar_t *)0x0);
          }
          iVar7 = FUN_1400a32c0(pwVar18);
          uVar4 = local_58;
        }
        FUN_140002fa0(param_1,iVar12);
      }
    }
    return (ulonglong)uVar4;
  }
  return uVar8;
}



void FUN_140194290(void)

{
  FUN_140193eb0();
  return;
}



// WARNING: Removing unreachable block (ram,0x00014019431f)
// WARNING: Removing unreachable block (ram,0x000140194328)
// WARNING: Removing unreachable block (ram,0x000140194346)
// WARNING: Removing unreachable block (ram,0x00014019434f)

undefined1 *
FUN_1401942b0(undefined1 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  *param_1 = 0;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x28) = 0x11;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined4 *)(param_1 + 0x48) = 0;
  *(undefined4 *)(param_1 + 0x2c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x30) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x34) = 0x40100000;
  *(undefined8 *)(param_1 + 0x38) = 0x26;
  *(undefined8 *)(param_1 + 0x40) = 0;
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0x58,uVar1,1,param_4,uVar2);
  param_1[0x88] = 1;
  return param_1;
}



void FUN_140194390(longlong param_1)

{
  FUN_1400a1cd0(param_1 + 0x58);
  FUN_140194290(param_1);
  return;
}



void FUN_1401943c0(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  void *pvVar2;
  undefined8 *puVar3;
  
  lVar1 = *param_2;
  if (lVar1 != *param_1) {
    if (lVar1 != 0) {
      *(longlong *)(*param_2 + 8) = *(longlong *)(lVar1 + 8) + 1;
    }
    puVar3 = (undefined8 *)0x0;
    if ((*param_1 != 0) &&
       (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
       *(longlong *)(*param_1 + 8) == 0)) {
      puVar3 = (undefined8 *)*param_1;
    }
    *param_1 = *param_2;
    if (puVar3 != (undefined8 *)0x0) {
      pvVar2 = (void *)*puVar3;
      if (pvVar2 != (void *)0x0) {
        FUN_1400031d0((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_1400a3530(puVar3);
    }
  }
  return;
}



void FUN_140194450(longlong *param_1)

{
  undefined8 *puVar1;
  void *pvVar2;
  
  if (*param_1 != 0) {
    *(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1;
    if (*(longlong *)(*param_1 + 8) == 0) {
      puVar1 = (undefined8 *)*param_1;
      pvVar2 = (void *)*puVar1;
      if (pvVar2 != (void *)0x0) {
        FUN_1400031d0((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_1400a3530(puVar1);
    }
  }
  return;
}



void FUN_1401944c0(longlong param_1)

{
  undefined8 *puVar1;
  void *pvVar2;
  
  if (*(longlong *)(param_1 + 0x10) != 0) {
    *(longlong *)(*(longlong *)(param_1 + 0x10) + 8) =
         *(longlong *)(*(longlong *)(param_1 + 0x10) + 8) + -1;
    if (*(longlong *)(*(longlong *)(param_1 + 0x10) + 8) == 0) {
      puVar1 = *(undefined8 **)(param_1 + 0x10);
      pvVar2 = (void *)*puVar1;
      if (pvVar2 != (void *)0x0) {
        FUN_1400031d0((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_1400a3530(puVar1);
    }
  }
  return;
}



undefined8 * FUN_140194530(longlong *param_1,undefined8 *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  longlong *plVar3;
  
  plVar1 = (longlong *)param_1[1];
  if (plVar1 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  *param_2 = 0;
  FUN_1401943c0(param_2,plVar1 + 2);
  lVar2 = *plVar1;
  param_1[1] = lVar2;
  if (lVar2 == 0) {
    param_1[2] = 0;
  }
  else {
    *(undefined8 *)(lVar2 + 8) = 0;
  }
  FUN_1401944c0(plVar1);
  plVar3 = (longlong *)*param_1;
  if (plVar3 == (longlong *)0x0) {
    FUN_1400a3530(plVar1);
  }
  else {
    (**(code **)(*plVar3 + 0x10))(plVar3,plVar1);
  }
  param_1[3] = param_1[3] + -1;
  return param_2;
}



void FUN_1401945d0(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  void *pvVar4;
  longlong *plVar5;
  
  lVar1 = param_1[3];
  while( true ) {
    if (lVar1 == 0) {
      param_1[1] = 0;
      param_1[2] = 0;
      return;
    }
    plVar2 = (longlong *)param_1[1];
    if (plVar2 == (longlong *)0x0) break;
    param_1[1] = *plVar2;
    if ((plVar2[2] != 0) &&
       (*(longlong *)(plVar2[2] + 8) = *(longlong *)(plVar2[2] + 8) + -1,
       *(longlong *)(plVar2[2] + 8) == 0)) {
      puVar3 = (undefined8 *)plVar2[2];
      pvVar4 = (void *)*puVar3;
      if (pvVar4 != (void *)0x0) {
        FUN_1400031d0((longlong)pvVar4 + 8);
        operator_delete(pvVar4);
      }
      FUN_1400a3530(puVar3);
    }
    plVar5 = (longlong *)*param_1;
    if (plVar5 == (longlong *)0x0) {
      FUN_1400a3530(plVar2);
    }
    else {
      (**(code **)(*plVar5 + 0x10))(plVar5,plVar2);
    }
    param_1[3] = param_1[3] + -1;
    lVar1 = param_1[3];
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



void FUN_1401946b0(longlong param_1,undefined4 param_2,undefined8 param_3)

{
  undefined8 uVar1;
  longlong *plVar2;
  void *pvVar3;
  undefined4 *puVar4;
  longlong lVar5;
  __time64_t _Var6;
  undefined8 *puVar7;
  undefined8 *puVar8;
  longlong *local_res8;
  undefined1 local_78 [80];
  
  FUN_1400a1c30();
  if (*(char *)(param_1 + 0x50) != '\0') {
    FUN_1400a2320(local_78,L"LogFile Creation Failed");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_78,(ThrowInfo *)&DAT_1402f4860);
  }
  pvVar3 = operator_new(0x20);
  if (pvVar3 == (void *)0x0) {
    pvVar3 = (void *)0x0;
  }
  else {
    FUN_1400a3440();
    *(undefined **)((longlong)pvVar3 + 8) = PTR_DAT_1402f8010;
  }
  if (pvVar3 == (void *)0x0) {
    local_res8 = (longlong *)0x0;
  }
  else {
    local_res8 = (longlong *)FUN_1400a34c0();
    local_res8[1] = 1;
    *local_res8 = (longlong)pvVar3;
  }
  if (local_res8 == (longlong *)0x0) {
    puVar4 = (undefined4 *)0x0;
  }
  else {
    puVar4 = (undefined4 *)*local_res8;
  }
  *puVar4 = 1;
  if (local_res8 == (longlong *)0x0) {
    lVar5 = 0;
  }
  else {
    lVar5 = *local_res8;
  }
  FUN_14001f680(lVar5 + 8,param_3);
  if (local_res8 == (longlong *)0x0) {
    lVar5 = 0;
  }
  else {
    lVar5 = *local_res8;
  }
  FUN_140193fe0(lVar5 + 8,&DAT_140272810,&DAT_14027d1a0);
  if (local_res8 == (longlong *)0x0) {
    lVar5 = 0;
  }
  else {
    lVar5 = *local_res8;
  }
  *(undefined4 *)(lVar5 + 0x10) = param_2;
  _Var6 = _time64((__time64_t *)0x0);
  if (local_res8 == (longlong *)0x0) {
    lVar5 = 0;
  }
  else {
    lVar5 = *local_res8;
  }
  *(__time64_t *)(lVar5 + 0x18) = _Var6;
  uVar1 = *(undefined8 *)(param_1 + 0x98);
  plVar2 = *(longlong **)(param_1 + 0x88);
  if (plVar2 == (longlong *)0x0) {
    puVar7 = (undefined8 *)FUN_1400a34c0(0x18);
  }
  else {
    puVar7 = (undefined8 *)(**(code **)(*plVar2 + 8))(plVar2,0x18);
  }
  if ((puVar7 != (undefined8 *)0x0) && (puVar7[2] = 0, local_res8 != (longlong *)0x0)) {
    local_res8[1] = local_res8[1] + 1;
    puVar8 = (undefined8 *)0x0;
    if ((puVar7[2] != 0) &&
       (*(longlong *)(puVar7[2] + 8) = *(longlong *)(puVar7[2] + 8) + -1,
       *(longlong *)(puVar7[2] + 8) == 0)) {
      puVar8 = (undefined8 *)puVar7[2];
    }
    puVar7[2] = local_res8;
    if (puVar8 != (undefined8 *)0x0) {
      pvVar3 = (void *)*puVar8;
      if (pvVar3 != (void *)0x0) {
        FUN_1400031d0((longlong)pvVar3 + 8);
        operator_delete(pvVar3);
      }
      FUN_1400a3530(puVar8);
    }
  }
  puVar7[1] = uVar1;
  *puVar7 = 0;
  *(longlong *)(param_1 + 0xa0) = *(longlong *)(param_1 + 0xa0) + 1;
  if (*(undefined8 **)(param_1 + 0x98) == (undefined8 *)0x0) {
    *(undefined8 **)(param_1 + 0x90) = puVar7;
  }
  else {
    **(undefined8 **)(param_1 + 0x98) = puVar7;
  }
  *(undefined8 **)(param_1 + 0x98) = puVar7;
  FUN_1401c1460(param_1 + 0x10,1);
  if (local_res8 != (longlong *)0x0) {
    plVar2 = local_res8 + 1;
    *plVar2 = *plVar2 + -1;
    if (*plVar2 == 0) {
      pvVar3 = (void *)*local_res8;
      if (pvVar3 != (void *)0x0) {
        FUN_1400031d0((longlong)pvVar3 + 8);
        operator_delete(pvVar3);
      }
      FUN_1400a3530(local_res8);
    }
  }
  FUN_1400d1290(param_1 + 0x18);
  return;
}



void FUN_140194940(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  longlong *plVar2;
  void *pvVar3;
  undefined4 *puVar4;
  undefined8 *puVar5;
  longlong lVar6;
  undefined8 *puVar7;
  undefined8 local_res18;
  undefined8 local_res20;
  longlong *local_b8;
  undefined1 local_80 [80];
  
  local_res18 = param_3;
  local_res20 = param_4;
  FUN_1400a1c30();
  if (*(char *)(param_1 + 0x50) != '\0') {
    FUN_1400a2320(local_80,L"LogFile Creation Failed");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_80,(ThrowInfo *)&DAT_1402f4860);
  }
  pvVar3 = operator_new(0x20);
  if (pvVar3 == (void *)0x0) {
    pvVar3 = (void *)0x0;
  }
  else {
    FUN_1400a3440();
    *(undefined **)((longlong)pvVar3 + 8) = PTR_DAT_1402f8010;
  }
  if (pvVar3 == (void *)0x0) {
    local_b8 = (longlong *)0x0;
  }
  else {
    local_b8 = (longlong *)FUN_1400a34c0(0x10);
    local_b8[1] = 1;
    *local_b8 = (longlong)pvVar3;
  }
  if (local_b8 == (longlong *)0x0) {
    puVar4 = (undefined4 *)0x0;
  }
  else {
    puVar4 = (undefined4 *)*local_b8;
  }
  *puVar4 = 2;
  if (local_b8 == (longlong *)0x0) {
    lVar6 = 0;
  }
  else {
    lVar6 = *local_b8;
  }
  FUN_14003c570(lVar6 + 8,param_2,&local_res18);
  if (local_b8 == (longlong *)0x0) {
    lVar6 = 0;
  }
  else {
    lVar6 = *local_b8;
  }
  FUN_140193fe0(lVar6 + 8,&DAT_140272810,&DAT_14027d1a0);
  if (local_b8 == (longlong *)0x0) {
    lVar6 = 0;
  }
  else {
    lVar6 = *local_b8;
  }
  FUN_14003c890(lVar6 + 8,&DAT_14025b330);
  uVar1 = *(undefined8 *)(param_1 + 0x98);
  plVar2 = *(longlong **)(param_1 + 0x88);
  if (plVar2 == (longlong *)0x0) {
    puVar5 = (undefined8 *)FUN_1400a34c0(0x18);
  }
  else {
    puVar5 = (undefined8 *)(**(code **)(*plVar2 + 8))(plVar2,0x18);
  }
  if ((puVar5 != (undefined8 *)0x0) && (puVar5[2] = 0, local_b8 != (longlong *)0x0)) {
    local_b8[1] = local_b8[1] + 1;
    puVar7 = (undefined8 *)0x0;
    if ((puVar5[2] != 0) &&
       (*(longlong *)(puVar5[2] + 8) = *(longlong *)(puVar5[2] + 8) + -1,
       *(longlong *)(puVar5[2] + 8) == 0)) {
      puVar7 = (undefined8 *)puVar5[2];
    }
    puVar5[2] = local_b8;
    if (puVar7 != (undefined8 *)0x0) {
      pvVar3 = (void *)*puVar7;
      if (pvVar3 != (void *)0x0) {
        FUN_1400031d0((longlong)pvVar3 + 8);
        operator_delete(pvVar3);
      }
      FUN_1400a3530(puVar7);
    }
  }
  puVar5[1] = uVar1;
  *puVar5 = 0;
  *(longlong *)(param_1 + 0xa0) = *(longlong *)(param_1 + 0xa0) + 1;
  if (*(undefined8 **)(param_1 + 0x98) == (undefined8 *)0x0) {
    *(undefined8 **)(param_1 + 0x90) = puVar5;
  }
  else {
    **(undefined8 **)(param_1 + 0x98) = puVar5;
  }
  *(undefined8 **)(param_1 + 0x98) = puVar5;
  FUN_1401c1460(param_1 + 0x10,1);
  if (local_b8 != (longlong *)0x0) {
    plVar2 = local_b8 + 1;
    *plVar2 = *plVar2 + -1;
    if (*plVar2 == 0) {
      pvVar3 = (void *)*local_b8;
      if (pvVar3 != (void *)0x0) {
        FUN_1400031d0((longlong)pvVar3 + 8);
        operator_delete(pvVar3);
      }
      FUN_1400a3530(local_b8);
    }
  }
  FUN_1400d1290(param_1 + 0x18);
  return;
}



void FUN_140194bc0(longlong *param_1)

{
  undefined8 *puVar1;
  
  FUN_1401945d0();
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140194bf0(undefined8 *param_1)

{
  longlong lVar1;
  void *pvVar2;
  undefined8 *puVar3;
  char cVar4;
  int iVar5;
  DWORD DVar6;
  BOOL BVar7;
  errno_t eVar8;
  undefined8 *puVar9;
  undefined8 uVar10;
  longlong *plVar11;
  undefined8 *puVar12;
  int *piVar13;
  undefined8 uVar14;
  HANDLE pvVar15;
  undefined1 *puVar16;
  LPCWSTR pWVar17;
  undefined *puVar18;
  int *piVar19;
  undefined *puVar20;
  int iVar21;
  longlong lVar22;
  undefined1 auStackY_3b8 [32];
  undefined2 local_378 [4];
  undefined *local_370;
  undefined8 *local_368;
  undefined8 *local_360;
  undefined *local_358;
  undefined *local_350;
  longlong local_348;
  undefined8 *local_340;
  undefined8 *local_338;
  undefined8 *local_330;
  longlong local_328;
  DWORD local_320;
  DWORD DStack_31c;
  DWORD local_318;
  DWORD DStack_314;
  longlong local_310;
  DWORD local_308 [2];
  undefined8 local_300;
  __time64_t local_2f8;
  undefined8 local_2f0;
  DWORD local_2e8;
  DWORD local_2e4;
  DWORD local_2e0 [2];
  longlong local_2d8;
  undefined8 *local_2d0;
  undefined1 local_2c8;
  __time64_t local_2c0;
  DWORD local_2b8 [2];
  undefined8 local_2b0;
  undefined8 local_2a8;
  undefined1 local_2a0;
  undefined8 local_298;
  undefined1 local_290;
  undefined8 local_288;
  undefined1 local_280;
  undefined8 local_278;
  undefined8 *local_270;
  undefined8 *local_268;
  undefined1 *local_258;
  undefined1 local_250 [264];
  undefined1 *local_148;
  undefined1 local_140 [264];
  ulonglong local_38;
  
  local_278 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStackY_3b8;
  local_320 = GetFileSize((HANDLE)*param_1,&DStack_31c);
  if ((local_320 != 0xffffffff) || (iVar5 = FUN_1401691b0(), local_2f0 = local_348, -1 < iVar5)) {
    local_2f0 = CONCAT44(DStack_31c,local_320);
  }
  DVar6 = SetFilePointer((HANDLE)*param_1,(LONG)local_2f0,(PLONG)((longlong)&local_2f0 + 4),0);
  if (DVar6 == 0xffffffff) {
    FUN_1401691b0();
  }
  FUN_1400a3440();
  local_350 = PTR_DAT_1402f8010;
  local_2c0 = _time64((__time64_t *)0x0);
  puVar9 = (undefined8 *)FUN_140178c90(&local_2c0,&local_310,&DAT_140256e88);
  pWVar17 = (LPCWSTR)*puVar9;
  local_258 = local_250;
  if (pWVar17 == (LPCWSTR)0x0) {
    local_258 = (undefined1 *)0x0;
    goto LAB_140194daf;
  }
  iVar5 = lstrlenW(pWVar17);
  iVar5 = iVar5 + 1;
  if (iVar5 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80070057);
  }
  if (local_258 == local_250) {
    if (0x80 < iVar5) {
      puVar16 = calloc((longlong)iVar5,2);
      goto LAB_140194d41;
    }
LAB_140194d55:
    puVar16 = local_250;
  }
  else {
    if (iVar5 < 0x81) {
      free(local_258);
      goto LAB_140194d55;
    }
    puVar16 = _recalloc(local_258,(longlong)iVar5,2);
    if (puVar16 == (undefined1 *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
LAB_140194d41:
    if (puVar16 == (undefined1 *)0x0) {
      local_258 = puVar16;
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  local_258 = puVar16;
  eVar8 = memcpy_s(puVar16,(longlong)iVar5 * 2,pWVar17,(longlong)iVar5 * 2);
  if (eVar8 != 0) {
    if (eVar8 == 0xc) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    if ((eVar8 == 0x16) || (eVar8 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80070057);
    }
    if (eVar8 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
  }
LAB_140194daf:
  piVar19 = (int *)0x0;
  FUN_14003c600(&local_350,L"-------- Log start at %s --------\r\n",local_258);
  if (local_258 != local_250) {
    free(local_258);
  }
  LOCK();
  piVar13 = (int *)(local_310 + -8);
  iVar5 = *piVar13;
  *piVar13 = *piVar13 + -1;
  UNLOCK();
  if (iVar5 + -1 < 1) {
    (**(code **)(**(longlong **)(local_310 + -0x18) + 8))();
  }
  puVar20 = local_350;
  puVar18 = PTR_DAT_1402f8010;
  iVar5 = 0;
  if (local_350 != (undefined *)0x0) {
    piVar13 = piVar19;
    if (local_350 != PTR_DAT_1402f8010) {
      piVar13 = (int *)(ulonglong)*(uint *)(local_350 + -8);
    }
    puVar18 = local_350;
    iVar5 = (int)piVar13;
  }
  BVar7 = WriteFile((HANDLE)*param_1,puVar18,iVar5 * 2,&local_2e8,(LPOVERLAPPED)0x0);
  if (BVar7 == 0) {
    FUN_1401691b0();
  }
  if (((puVar20 != (undefined *)0x0) && (puVar20 != PTR_DAT_1402f8010)) &&
     (puVar20 + -8 != (undefined *)0x0)) {
    uVar10 = FUN_1400a3440();
    local_2a8 = uVar10;
    FUN_1400a1c30(uVar10);
    local_2a0 = 1;
    piVar13 = (int *)(puVar20 + -4);
    *piVar13 = *piVar13 + -1;
    if (*piVar13 == 0) {
      FUN_1400a3530(puVar20 + -8);
    }
    FUN_1400d1290(uVar10);
    local_2a0 = 0;
  }
  cVar4 = *(char *)(param_1 + 0x10);
  local_350 = PTR_DAT_1402f8010;
  lVar22 = local_348;
  do {
    if (cVar4 != '\0') {
      return;
    }
    cVar4 = FUN_1401c1440(param_1 + 2,300);
    if (cVar4 != '\0') {
      local_340 = (undefined8 *)0x0;
      local_328 = 0;
      local_338 = (undefined8 *)0x0;
      local_330 = (undefined8 *)0x0;
      puVar9 = param_1 + 3;
      local_2d0 = puVar9;
      FUN_1400a1c30(puVar9);
      local_2c8 = 1;
      if (*(char *)(param_1 + 10) == '\0') {
        lVar1 = param_1[0x14];
        while (lVar1 != 0) {
          plVar11 = (longlong *)FUN_140194530(param_1 + 0x11,&local_360);
          puVar9 = (undefined8 *)FUN_1400a34c0(0x18);
          local_270 = puVar9;
          local_268 = puVar9;
          if (puVar9 != (undefined8 *)0x0) {
            puVar9[2] = 0;
            if (*plVar11 != 0) {
              *(longlong *)(*plVar11 + 8) = *(longlong *)(*plVar11 + 8) + 1;
              piVar13 = piVar19;
              if ((puVar9[2] != 0) &&
                 (*(longlong *)(puVar9[2] + 8) = *(longlong *)(puVar9[2] + 8) + -1,
                 *(longlong *)(puVar9[2] + 8) == 0)) {
                piVar13 = (int *)puVar9[2];
              }
              puVar9[2] = *plVar11;
              if (piVar13 != (int *)0x0) {
                pvVar2 = *(void **)piVar13;
                if (pvVar2 != (void *)0x0) {
                  FUN_1400031d0((longlong)pvVar2 + 8);
                  operator_delete(pvVar2);
                }
                FUN_1400a3530(piVar13);
              }
            }
          }
          puVar12 = local_360;
          puVar9[1] = local_330;
          *puVar9 = 0;
          local_328 = local_328 + 1;
          puVar3 = puVar9;
          if (local_330 != (undefined8 *)0x0) {
            *local_330 = puVar9;
            puVar3 = local_338;
          }
          local_338 = puVar3;
          local_330 = puVar9;
          if ((local_360 != (undefined8 *)0x0) &&
             (local_360[1] = local_360[1] + -1, local_360[1] == 0)) {
            pvVar2 = (void *)*local_360;
            if (pvVar2 != (void *)0x0) {
              FUN_1400031d0((longlong)pvVar2 + 8);
              operator_delete(pvVar2);
            }
            FUN_1400a3530(puVar12);
          }
          puVar9 = local_2d0;
          lVar1 = param_1[0x14];
        }
      }
      FUN_1400d1290(puVar9);
      local_2c8 = 0;
      FUN_1400a3440();
      local_370 = PTR_DAT_1402f8010;
      puVar20 = PTR_DAT_1402f8010;
      while (local_328 != 0) {
        FUN_140194530(&local_340,&local_368);
        puVar9 = local_368;
        piVar13 = piVar19;
        if (local_368 != (undefined8 *)0x0) {
          piVar13 = (int *)*local_368;
        }
        iVar5 = *piVar13;
        iVar21 = 0;
        if (iVar5 == 0) {
          if ((HANDLE)*param_1 != (HANDLE)0x0) {
            CloseHandle((HANDLE)*param_1);
            *param_1 = 0;
          }
          piVar13 = piVar19;
          if (puVar9 != (undefined8 *)0x0) {
            piVar13 = (int *)*puVar9;
          }
          pWVar17 = *(LPCWSTR *)(piVar13 + 2);
          if (*(LPCWSTR *)(piVar13 + 2) == (LPCWSTR)0x0) {
            pWVar17 = (LPCWSTR)PTR_DAT_1402f8010;
          }
          if (param_1[1] == 0) {
            pvVar15 = CreateFileW(pWVar17,0x40000000,1,(LPSECURITY_ATTRIBUTES)0x0,4,0x80,(HANDLE)0x0
                                 );
          }
          else {
            pvVar15 = (HANDLE)FUN_1401691d0(param_1[1],pWVar17,0x40000000);
          }
          if (pvVar15 == (HANDLE)0xffffffffffffffff) {
            iVar5 = FUN_1401691b0();
            if (iVar5 < 0) {
              *(undefined1 *)(param_1 + 10) = 1;
              goto LAB_140195509;
            }
          }
          else {
            *param_1 = pvVar15;
          }
          local_378[0] = 0xfeff;
          BVar7 = WriteFile((HANDLE)*param_1,local_378,2,local_308,(LPOVERLAPPED)0x0);
          if (BVar7 == 0) {
            FUN_1401691b0();
          }
          local_318 = GetFileSize((HANDLE)*param_1,&DStack_314);
          if ((local_318 != 0xffffffff) || (iVar5 = FUN_1401691b0(), -1 < iVar5)) {
            lVar22 = CONCAT44(DStack_314,local_318);
          }
          local_300 = lVar22;
          DVar6 = SetFilePointer((HANDLE)*param_1,(LONG)lVar22,(PLONG)((longlong)&local_300 + 4),0);
          if (DVar6 == 0xffffffff) {
            FUN_1401691b0();
          }
          FUN_1400a3440();
          local_358 = PTR_DAT_1402f8010;
          local_2f8 = _time64((__time64_t *)0x0);
          puVar9 = (undefined8 *)FUN_140178c90(&local_2f8,&local_348,&DAT_140256e88);
          pWVar17 = (LPCWSTR)*puVar9;
          local_148 = local_140;
          if (pWVar17 == (LPCWSTR)0x0) {
            local_148 = (undefined1 *)0x0;
          }
          else {
            iVar5 = lstrlenW(pWVar17);
            iVar5 = iVar5 + 1;
            if (iVar5 < 0) {
                    // WARNING: Subroutine does not return
              FUN_14000c6c0(0x80070057);
            }
            if (local_148 == local_140) {
              if (0x80 < iVar5) {
                puVar16 = calloc((longlong)iVar5,2);
                goto LAB_1401953b8;
              }
LAB_1401953ca:
              puVar16 = local_140;
            }
            else {
              if (iVar5 < 0x81) {
                free(local_148);
                goto LAB_1401953ca;
              }
              puVar16 = _recalloc(local_148,(longlong)iVar5,2);
              if (puVar16 == (undefined1 *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000c6c0(0x8007000e);
              }
LAB_1401953b8:
              if (puVar16 == (undefined1 *)0x0) {
                local_148 = puVar16;
                    // WARNING: Subroutine does not return
                FUN_14000c6c0(0x8007000e);
              }
            }
            local_148 = puVar16;
            eVar8 = memcpy_s(puVar16,(longlong)iVar5 * 2,pWVar17,(longlong)iVar5 * 2);
            if (eVar8 != 0) {
              if (eVar8 == 0xc) {
                    // WARNING: Subroutine does not return
                FUN_14000c6c0(0x8007000e);
              }
              if ((eVar8 == 0x16) || (eVar8 == 0x22)) {
                    // WARNING: Subroutine does not return
                FUN_14000c6c0(0x80070057);
              }
              if (eVar8 != 0x50) {
                    // WARNING: Subroutine does not return
                FUN_14000c6c0(0x80004005);
              }
            }
          }
          FUN_14003c600(&local_358,L"-------- Log start at %s --------\r\n",local_148);
          if (local_148 != local_140) {
            free(local_148);
          }
          LOCK();
          piVar13 = (int *)(local_348 + -8);
          iVar5 = *piVar13;
          *piVar13 = *piVar13 + -1;
          UNLOCK();
          if (iVar5 + -1 < 1) {
            (**(code **)(**(longlong **)(local_348 + -0x18) + 8))();
          }
          puVar20 = local_358;
          puVar18 = PTR_DAT_1402f8010;
          if (local_358 != (undefined *)0x0) {
            piVar13 = piVar19;
            if (local_358 != PTR_DAT_1402f8010) {
              piVar13 = (int *)(ulonglong)*(uint *)(local_358 + -8);
            }
            iVar21 = (int)piVar13;
            puVar18 = local_358;
          }
          BVar7 = WriteFile((HANDLE)*param_1,puVar18,iVar21 * 2,local_2b8,(LPOVERLAPPED)0x0);
          if (BVar7 == 0) {
            FUN_1401691b0();
          }
          if (((puVar20 != (undefined *)0x0) && (puVar20 != PTR_DAT_1402f8010)) &&
             (puVar20 + -8 != (undefined *)0x0)) {
            uVar10 = FUN_1400a3440();
            local_298 = uVar10;
            FUN_1400a1c30(uVar10);
            local_290 = 1;
            piVar13 = (int *)(puVar20 + -4);
            *piVar13 = *piVar13 + -1;
            if (*piVar13 == 0) {
              FUN_1400a3530(puVar20 + -8);
            }
            FUN_1400d1290(uVar10);
            local_290 = 0;
          }
          local_358 = PTR_DAT_1402f8010;
          puVar9 = local_368;
          puVar20 = local_370;
        }
        else if (iVar5 == 1) {
          piVar13 = piVar19;
          if (local_368 != (undefined8 *)0x0) {
            piVar13 = (int *)*local_368;
          }
          local_2b0 = *(undefined8 *)(piVar13 + 6);
          puVar12 = (undefined8 *)FUN_140178c90(&local_2b0,&local_2d8,&DAT_140256e88);
          uVar10 = *puVar12;
          piVar13 = piVar19;
          if (puVar9 != (undefined8 *)0x0) {
            piVar13 = (int *)*puVar9;
          }
          uVar14 = FUN_1401a24e0(piVar13[4]);
          FUN_14003c600(&local_370,L"[%s] [%s] %s\r\n",uVar14,uVar10);
          LOCK();
          piVar13 = (int *)(local_2d8 + -8);
          iVar5 = *piVar13;
          *piVar13 = *piVar13 + -1;
          UNLOCK();
          if (iVar5 + -1 < 1) {
            (**(code **)(**(longlong **)(local_2d8 + -0x18) + 8))();
          }
          puVar20 = local_370;
          puVar18 = PTR_DAT_1402f8010;
          if (local_370 != (undefined *)0x0) {
            piVar13 = piVar19;
            if (local_370 != PTR_DAT_1402f8010) {
              piVar13 = (int *)(ulonglong)*(uint *)(local_370 + -8);
            }
            iVar21 = (int)piVar13;
            puVar18 = local_370;
          }
          BVar7 = WriteFile((HANDLE)*param_1,puVar18,iVar21 * 2,&local_2e4,(LPOVERLAPPED)0x0);
          puVar9 = local_368;
          if (BVar7 == 0) {
            FUN_1401691b0();
            puVar9 = local_368;
          }
        }
        else if (iVar5 == 2) {
          piVar13 = piVar19;
          if (local_368 != (undefined8 *)0x0) {
            piVar13 = (int *)*local_368;
          }
          puVar18 = *(undefined **)(piVar13 + 2);
          iVar5 = 0;
          if ((puVar18 != (undefined *)0x0) && (iVar5 = iVar21, puVar18 != PTR_DAT_1402f8010)) {
            iVar5 = *(int *)(puVar18 + -8);
          }
          piVar13 = piVar19;
          if (local_368 != (undefined8 *)0x0) {
            piVar13 = (int *)*local_368;
          }
          puVar18 = *(undefined **)(piVar13 + 2);
          if (*(undefined **)(piVar13 + 2) == (undefined *)0x0) {
            puVar18 = PTR_DAT_1402f8010;
          }
          BVar7 = WriteFile((HANDLE)*param_1,puVar18,iVar5 * 2,local_2e0,(LPOVERLAPPED)0x0);
          if (BVar7 == 0) {
            FUN_1401691b0();
          }
        }
LAB_140195509:
        puVar12 = local_368;
        if (puVar9 != (undefined8 *)0x0) {
          plVar11 = puVar9 + 1;
          *plVar11 = *plVar11 + -1;
          puVar20 = local_370;
          if (*plVar11 == 0) {
            pvVar2 = (void *)*local_368;
            if (pvVar2 != (void *)0x0) {
              FUN_1400031d0((longlong)pvVar2 + 8);
              operator_delete(pvVar2);
            }
            FUN_1400a3530(puVar12);
            puVar20 = local_370;
          }
        }
      }
      if (((puVar20 != (undefined *)0x0) && (puVar20 != PTR_DAT_1402f8010)) &&
         (puVar20 + -8 != (undefined *)0x0)) {
        uVar10 = FUN_1400a3440();
        local_288 = uVar10;
        FUN_1400a1c30(uVar10);
        local_280 = 1;
        piVar13 = (int *)(puVar20 + -4);
        *piVar13 = *piVar13 + -1;
        if (*piVar13 == 0) {
          FUN_1400a3530(puVar20 + -8);
        }
        FUN_1400d1290(uVar10);
        local_280 = 0;
      }
      local_370 = PTR_DAT_1402f8010;
      FUN_1401945d0(&local_340);
      if (local_340 != (undefined8 *)0x0) {
        (**(code **)*local_340)(local_340,1);
      }
    }
    cVar4 = *(char *)(param_1 + 0x10);
  } while( true );
}



void FUN_140195650(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  *(undefined1 *)(param_1 + 0x10) = 1;
  FUN_1400aaa10(param_1 + 0xb);
  FUN_1401945d0(param_1 + 0x11);
  puVar1 = (undefined8 *)param_1[0x11];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,uVar2);
  }
  FUN_1400aaa90(param_1 + 0xb);
  FUN_1400a1cd0(param_1 + 3);
  CloseHandle((HANDLE)param_1[2]);
  if ((HANDLE)*param_1 != (HANDLE)0x0) {
    CloseHandle((HANDLE)*param_1);
    *param_1 = 0;
  }
  return;
}



undefined8 *
FUN_140195700(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  
  *param_1 = 0;
  param_1[1] = 0;
  FUN_1401c1420(param_1 + 2,0,0x7fffffff,param_4,0xfffffffffffffffe);
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 3,uVar1,1);
  *(undefined1 *)(param_1 + 10) = 0;
  FUN_1400aa980(param_1 + 0xb,&LAB_1401956f0,param_1);
  param_1[0x11] = 0;
  param_1[0x14] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *(undefined1 *)(param_1 + 0x10) = 0;
  return param_1;
}



undefined8 * FUN_1401957a0(LPCWSTR param_1)

{
  int iVar1;
  BOOL BVar2;
  undefined8 *hFile;
  undefined8 *puVar3;
  undefined2 local_res10 [4];
  void *local_res18 [2];
  
  puVar3 = (undefined8 *)0x0;
  hFile = CreateFileW(param_1,0x40000000,1,(LPSECURITY_ATTRIBUTES)0x0,4,0x80,(HANDLE)0x0);
  if ((hFile == (undefined8 *)0xffffffffffffffff) &&
     (iVar1 = FUN_1401691b0(), hFile = puVar3, iVar1 < 0)) {
    puVar3 = (undefined8 *)0x0;
  }
  else {
    local_res10[0] = 0xfeff;
    BVar2 = WriteFile(hFile,local_res10,2,(LPDWORD)local_res18,(LPOVERLAPPED)0x0);
    if (BVar2 == 0) {
      FUN_1401691b0();
    }
    local_res18[0] = operator_new(0xc0);
    if (local_res18[0] != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140195700(local_res18[0]);
    }
    *puVar3 = hFile;
    FUN_1400aab80(puVar3 + 0xb);
    CloseHandle((HANDLE)0xffffffffffffffff);
  }
  return puVar3;
}



void FUN_140195890(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x0001401958b7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



undefined8 * FUN_1401958d0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140195930(longlong param_1,int param_2)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  int iVar4;
  undefined8 uVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  int iVar8;
  longlong lVar9;
  undefined1 local_58 [80];
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar4 = FUN_1401a7da0();
      plVar2 = *(longlong **)(param_1 + 8);
      lVar9 = (longlong)iVar4;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar2 == (longlong *)0x0) {
          uVar5 = FUN_1400a34c0(lVar9 << 3);
          *(undefined8 *)(param_1 + 0x10) = uVar5;
        }
        else {
          uVar5 = (**(code **)(*plVar2 + 8))(plVar2,lVar9 << 3);
          *(undefined8 *)(param_1 + 0x10) = uVar5;
        }
      }
      else {
        lVar3 = *(longlong *)(param_1 + 0x10);
        if (plVar2 == (longlong *)0x0) {
          puVar6 = (undefined8 *)FUN_1400a34c0(lVar9 << 3);
        }
        else {
          puVar6 = (undefined8 *)(**(code **)(*plVar2 + 8))();
        }
        iVar1 = *(int *)(param_1 + 0x18);
        iVar8 = 0;
        if (0 < iVar1) {
          puVar7 = puVar6;
          do {
            if (puVar7 != (undefined8 *)0x0) {
              *puVar7 = *(undefined8 *)((lVar3 - (longlong)puVar6) + (longlong)puVar7);
            }
            iVar8 = iVar8 + 1;
            puVar7 = puVar7 + 1;
          } while (iVar8 < iVar1);
        }
        if (puVar6 == (undefined8 *)0x0) {
          FUN_1400a2320(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
        }
        plVar2 = *(longlong **)(param_1 + 8);
        if (plVar2 == (longlong *)0x0) {
          FUN_1400a3530(lVar3);
        }
        else {
          (**(code **)(*plVar2 + 0x18))(plVar2,lVar3);
        }
        *(undefined8 **)(param_1 + 0x10) = puVar6;
      }
      *(int *)(param_1 + 0x1c) = iVar4;
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_140195a80(longlong param_1,int param_2,int param_3)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  
  if ((-1 < param_2) && (-1 < param_3)) {
    iVar1 = *(int *)(param_1 + 0x18) - param_2;
    if (iVar1 <= param_3) {
      param_3 = iVar1;
    }
    if (0 < iVar1 - param_3) {
      lVar4 = (longlong)param_2 << 3;
      lVar5 = (longlong)(iVar1 - param_3);
      do {
        lVar2 = FUN_1401b2160(param_1);
        lVar3 = FUN_1401b2160(param_1);
        *(undefined8 *)(lVar3 + lVar4) = *(undefined8 *)((longlong)param_3 * 8 + lVar2 + lVar4);
        lVar4 = lVar4 + 8;
        lVar5 = lVar5 + -1;
      } while (lVar5 != 0);
    }
    FUN_140195930(param_1,*(int *)(param_1 + 0x18) - param_3);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



undefined8 FUN_140195b30(char *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char *pcVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  longlong lVar5;
  int iVar6;
  undefined8 uVar7;
  char *pcVar8;
  undefined1 local_50 [72];
  
  uVar7 = 0xfffffffffffffffe;
  if (*param_1 != '\0') {
    FUN_1400a2320(local_50,L"ServerSocketPool is already destructed!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
  }
  DVar2 = GetTickCount();
  DVar3 = GetTickCount();
  if (DVar3 - DVar2 < 10000) {
    pcVar1 = param_1 + 0x30;
    do {
      pcVar8 = pcVar1;
      FUN_1400a1c30(pcVar1);
      if (0 < *(int *)(param_1 + 0x80)) {
        lVar4 = FUN_1400a34c0(0x400);
        if (lVar4 == 0) {
          uVar7 = 0;
        }
        else {
          iVar6 = *(int *)(param_1 + 0x80) + -1;
          if ((iVar6 < 0) || (*(int *)(param_1 + 0x80) <= iVar6)) {
                    // WARNING: Subroutine does not return
            FUN_1400a2700();
          }
          uVar7 = FUN_1400a8fd0(lVar4,*(undefined8 *)
                                       (*(longlong *)(param_1 + 0x78) + (longlong)iVar6 * 8),param_2
                                ,param_4,uVar7,pcVar8);
        }
        FUN_140195a80(param_1 + 0x68,*(int *)(param_1 + 0x80) + -1,1);
        FUN_1400d1290(pcVar1);
        return uVar7;
      }
      FUN_1400d1290(pcVar1);
      Sleep(1);
      DVar3 = GetTickCount();
    } while (DVar3 - DVar2 < 10000);
  }
  lVar4 = Ordinal_23(2,1,6);
  if (lVar4 == -1) {
    uVar7 = 0;
  }
  else {
    lVar5 = FUN_1400a34c0(0x400);
    if (lVar5 == 0) {
      uVar7 = 0;
    }
    else {
      uVar7 = FUN_1400a8fd0(lVar5,lVar4,param_2);
    }
  }
  return uVar7;
}



void FUN_140195cc0(undefined1 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 *puVar1;
  ulonglong uVar2;
  int iVar3;
  ulonglong uVar4;
  undefined8 uVar5;
  undefined1 *puVar6;
  undefined1 uVar7;
  
  uVar5 = 0xfffffffffffffffe;
  *param_1 = 1;
  FUN_1400aaa10(param_1 + 8);
  puVar1 = param_1 + 0x30;
  puVar6 = puVar1;
  FUN_1400a1c30(puVar1);
  uVar7 = 1;
  uVar2 = 0;
  uVar4 = uVar2;
  if (0 < *(int *)(param_1 + 0x80)) {
    do {
      if (((longlong)uVar2 < 0) || (iVar3 = (int)uVar4, *(int *)(param_1 + 0x80) <= iVar3)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      FUN_1400aba10(*(undefined8 *)(*(longlong *)(param_1 + 0x78) + uVar2 * 8));
      if (*(int *)(param_1 + 0x80) <= iVar3) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      Ordinal_3(*(undefined8 *)(*(longlong *)(param_1 + 0x78) + uVar2 * 8));
      uVar4 = (ulonglong)(iVar3 + 1U);
      uVar2 = uVar2 + 1;
    } while ((int)(iVar3 + 1U) < *(int *)(param_1 + 0x80));
  }
  FUN_140195930(param_1 + 0x68,0,param_3,param_4,uVar5,puVar6,uVar7);
  FUN_1400d1290(puVar1);
  *(undefined ***)(param_1 + 0x68) = Proud::CFastArray<>::vftable;
  if (*(longlong *)(param_1 + 0x78) != 0) {
    if (*(longlong **)(param_1 + 0x70) == (longlong *)0x0) {
      FUN_1400a3530(*(longlong *)(param_1 + 0x78));
    }
    else {
      (**(code **)(**(longlong **)(param_1 + 0x70) + 0x18))();
    }
  }
  FUN_1400a1cd0(puVar1);
  FUN_1400aaa90(param_1 + 8);
  return;
}



void FUN_140195dd0(char *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char *pcVar1;
  int iVar2;
  bool bVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  int iVar7;
  longlong lVar8;
  longlong lVar9;
  undefined8 uVar10;
  char *pcVar11;
  
  uVar10 = 0xfffffffffffffffe;
  if (*param_1 == '\0') {
    pcVar1 = param_1 + 0x30;
    do {
      pcVar11 = pcVar1;
      FUN_1400a1c30(pcVar1);
      if (*(int *)(param_1 + 0x80) < 100) {
        FUN_1400d1290(pcVar1);
        bVar3 = false;
        lVar4 = Ordinal_23(2,1,6,param_4,uVar10,pcVar11);
        if (lVar4 != -1) {
          bVar3 = true;
          FUN_1400a1c30(pcVar1);
          iVar2 = *(int *)(param_1 + 0x80);
          if (iVar2 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          iVar7 = *(int *)(param_1 + 0x80);
          FUN_140195930(param_1 + 0x68,iVar7 + 1);
          iVar7 = iVar7 - iVar2;
          if ((0 < iVar7) && (iVar7 = iVar7 + -1, lVar8 = (longlong)iVar7, -1 < iVar7)) {
            lVar9 = (lVar8 + iVar2) * 8 + 8;
            do {
              lVar5 = FUN_1401b2160(param_1 + 0x68);
              lVar6 = FUN_1401b2160(param_1 + 0x68);
              *(undefined8 *)(lVar6 + lVar9) = *(undefined8 *)(lVar5 + -8 + lVar9);
              lVar9 = lVar9 + -8;
              lVar8 = lVar8 + -1;
            } while (-1 < lVar8);
          }
          lVar8 = FUN_1401b2160(param_1 + 0x68);
          *(longlong *)(lVar8 + (longlong)iVar2 * 8) = lVar4;
        }
      }
      else {
        FUN_1400d1290(pcVar1);
        bVar3 = false;
        Sleep(10);
      }
      if (bVar3) {
        FUN_1400d1290(pcVar1);
      }
    } while (*param_1 == '\0');
  }
  return;
}



undefined1 *
FUN_140195f60(undefined1 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  
  FUN_1400aa980(param_1 + 8,&LAB_140195f50,param_1,param_4,0xfffffffffffffffe);
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0x30,uVar1,1);
  *(undefined ***)(param_1 + 0x68) = Proud::CFastArray<>::vftable;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined8 *)(param_1 + 0x78) = 0;
  *(undefined8 *)(param_1 + 0x80) = 0;
  *(undefined8 *)(param_1 + 0x88) = 0;
  *param_1 = 0;
  FUN_1400aab80(param_1 + 8);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140195fe0(void *param_1,byte *param_2,int param_3,int param_4)

{
  byte bVar1;
  uint uVar2;
  undefined4 uVar3;
  int iVar4;
  uint uVar5;
  uint *puVar6;
  int iVar7;
  void *pvVar8;
  int iVar9;
  longlong lVar10;
  ulonglong uVar11;
  int iVar12;
  int iVar13;
  uint *puVar14;
  longlong lVar15;
  byte *pbVar16;
  longlong lVar17;
  undefined1 auStack_d8 [32];
  int local_b8;
  undefined1 local_a8 [68];
  uint auStack_64 [9];
  ulonglong local_40;
  
  local_40 = DAT_1402f85a0 ^ (ulonglong)auStack_d8;
  local_b8 = param_3;
  if (((param_3 != 0x10) && (param_3 != 0x18)) && (param_3 != 0x20)) {
    FUN_1400a1fd0(local_a8,"Incorrect key length");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_a8,(ThrowInfo *)&DAT_1402f4860);
  }
  if (((param_4 != 0x10) && (param_4 != 0x18)) && (param_4 != 0x20)) {
    FUN_1400a1fd0(local_a8,"Incorrect block length");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_a8,(ThrowInfo *)&DAT_1402f4860);
  }
  *(int *)((longlong)param_1 + 0x3c4) = param_4;
  if (param_3 == 0x10) {
    if (param_4 == 0x10) {
      uVar3 = 10;
    }
    else {
      uVar3 = 0xe;
      if (param_4 == 0x18) {
        uVar3 = 0xc;
      }
    }
  }
  else {
    if (param_3 != 0x18) {
      *(undefined4 *)((longlong)param_1 + 0x3c8) = 0xe;
      goto LAB_1401960ef;
    }
    uVar3 = 0xe;
    if (param_4 != 0x20) {
      uVar3 = 0xc;
    }
  }
  *(undefined4 *)((longlong)param_1 + 0x3c8) = uVar3;
LAB_1401960ef:
  iVar9 = 0;
  iVar4 = (int)(param_4 + (param_4 >> 0x1f & 3U)) >> 2;
  lVar15 = (longlong)iVar4;
  pvVar8 = param_1;
  if (-1 < *(int *)((longlong)param_1 + 0x3c8)) {
    do {
      if (0 < iVar4) {
        memset(pvVar8,0,lVar15 << 2);
      }
      iVar9 = iVar9 + 1;
      pvVar8 = (void *)((longlong)pvVar8 + 0x20);
    } while (iVar9 <= *(int *)((longlong)param_1 + 0x3c8));
  }
  iVar9 = 0;
  if (-1 < *(int *)((longlong)param_1 + 0x3c8)) {
    pvVar8 = (void *)((longlong)param_1 + 0x1e0);
    do {
      if (0 < iVar4) {
        memset(pvVar8,0,lVar15 << 2);
      }
      iVar9 = iVar9 + 1;
      pvVar8 = (void *)((longlong)pvVar8 + 0x20);
    } while (iVar9 <= *(int *)((longlong)param_1 + 0x3c8));
  }
  puVar6 = auStack_64;
  iVar9 = (*(int *)((longlong)param_1 + 0x3c8) + 1) * iVar4;
  uVar5 = (int)(param_3 + (param_3 >> 0x1f & 3U)) >> 2;
  lVar17 = (longlong)(int)uVar5;
  if (0 < (int)uVar5) {
    uVar11 = (ulonglong)uVar5;
    do {
      puVar6 = puVar6 + 1;
      bVar1 = param_2[2];
      *puVar6 = (uint)*param_2 << 0x18;
      *puVar6 = *puVar6 | (uint)param_2[1] << 0x10;
      *puVar6 = *puVar6 | (uint)bVar1 << 8;
      *puVar6 = *puVar6 | (uint)param_2[3];
      uVar11 = uVar11 - 1;
      param_2 = param_2 + 4;
    } while (uVar11 != 0);
  }
  iVar7 = 0;
  lVar10 = 0;
  iVar12 = iVar7;
  if (0 < (int)uVar5) {
    do {
      iVar12 = iVar7;
      if (iVar9 <= iVar7) break;
      uVar2 = auStack_64[lVar10 + 1];
      lVar10 = lVar10 + 1;
      iVar12 = iVar7 + 1;
      *(uint *)((longlong)param_1 + ((longlong)(iVar7 % iVar4) + (longlong)(iVar7 / iVar4) * 8) * 4)
           = uVar2;
      *(uint *)((longlong)param_1 +
               ((longlong)(iVar7 % iVar4) + 0x78 +
               ((longlong)*(int *)((longlong)param_1 + 0x3c8) - (longlong)(iVar7 / iVar4)) * 8) * 4)
           = uVar2;
      iVar7 = iVar12;
    } while (lVar10 < lVar17);
  }
  iVar7 = 1;
  if (iVar12 < iVar9) {
    pbVar16 = &DAT_14025f010;
    do {
      uVar11 = (ulonglong)(int)auStack_64[lVar17];
      auStack_64[1] =
           auStack_64[1] ^
           CONCAT31(CONCAT21(CONCAT11((&DAT_14025be10)[(longlong)uVar11 >> 0x10 & 0xff] ^ *pbVar16,
                                      (&DAT_14025be10)[(longlong)uVar11 >> 8 & 0xff]),
                             (&DAT_14025be10)[uVar11 & 0xff]),
                    (&DAT_14025be10)[auStack_64[lVar17] >> 0x18]);
      if (uVar5 == 8) {
        lVar10 = 3;
        puVar6 = auStack_64 + 2;
        do {
          *puVar6 = *puVar6 ^ puVar6[-1];
          lVar10 = lVar10 + -1;
          puVar6 = puVar6 + 1;
        } while (lVar10 != 0);
        uVar11 = (ulonglong)(int)auStack_64[4];
        lVar10 = 5;
        auStack_64[5] =
             auStack_64[5] ^
             CONCAT31(CONCAT21(CONCAT11((&DAT_14025be10)[auStack_64[4] >> 0x18],
                                        (&DAT_14025be10)[(longlong)uVar11 >> 0x10 & 0xff]),
                               (&DAT_14025be10)[(longlong)uVar11 >> 8 & 0xff]),
                      (&DAT_14025be10)[uVar11 & 0xff]);
        do {
          puVar6 = auStack_64 + lVar10;
          lVar10 = lVar10 + 1;
          auStack_64[lVar10] = auStack_64[lVar10] ^ *puVar6;
        } while (lVar10 < 8);
      }
      else {
        lVar10 = 1;
        if (1 < lVar17) {
          do {
            puVar6 = auStack_64 + lVar10;
            lVar10 = lVar10 + 1;
            auStack_64[lVar10] = auStack_64[lVar10] ^ *puVar6;
          } while (lVar10 < lVar17);
        }
      }
      lVar10 = 0;
      iVar13 = iVar12;
      param_3 = local_b8;
      if (0 < (int)uVar5) {
        do {
          if (iVar9 <= iVar13) goto LAB_1401963d5;
          uVar2 = auStack_64[lVar10 + 1];
          lVar10 = lVar10 + 1;
          iVar12 = iVar13 + 1;
          *(uint *)((longlong)param_1 +
                   ((longlong)(iVar13 % iVar4) + (longlong)(iVar13 / iVar4) * 8) * 4) = uVar2;
          *(uint *)((longlong)param_1 +
                   ((longlong)(iVar13 % iVar4) + 0x78 +
                   ((longlong)*(int *)((longlong)param_1 + 0x3c8) - (longlong)(iVar13 / iVar4)) * 8)
                   * 4) = uVar2;
          iVar13 = iVar12;
        } while (lVar10 < lVar17);
      }
      pbVar16 = pbVar16 + 1;
    } while (iVar12 < iVar9);
  }
LAB_1401963d5:
  if (1 < *(int *)((longlong)param_1 + 0x3c8)) {
    puVar6 = (uint *)((longlong)param_1 + 0x200);
    do {
      puVar14 = puVar6;
      lVar17 = lVar15;
      if (0 < lVar15) {
        do {
          uVar11 = (ulonglong)(int)*puVar14;
          lVar17 = lVar17 + -1;
          *puVar14 = *(uint *)(&DAT_14025e010 + (ulonglong)(*puVar14 >> 0x18) * 4) ^
                     *(uint *)(&DAT_14025e410 + ((longlong)uVar11 >> 0x10 & 0xffU) * 4) ^
                     *(uint *)(&DAT_14025e810 + ((longlong)uVar11 >> 8 & 0xffU) * 4) ^
                     *(uint *)(&DAT_14025ec10 + (uVar11 & 0xff) * 4);
          puVar14 = puVar14 + 1;
        } while (lVar17 != 0);
      }
      iVar7 = iVar7 + 1;
      puVar6 = puVar6 + 8;
    } while (iVar7 < *(int *)((longlong)param_1 + 0x3c8));
  }
  *(int *)((longlong)param_1 + 0x3c0) = param_3;
  return;
}



bool FUN_1401964b0(longlong param_1)

{
  return 0 < *(int *)(param_1 + 0x3c0);
}



void FUN_1401964c0(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x3c0) = 0;
  return;
}



void FUN_1401964d0(byte *param_1,byte *param_2,uint *param_3)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  uint *puVar9;
  uint uVar10;
  ulonglong uVar11;
  undefined1 local_78 [80];
  
  if ((int)param_3[0xf0] < 1) {
    FUN_1400a2320(local_78,L"aes key is not initialized");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_78,(ThrowInfo *)&DAT_1402f4860);
  }
  uVar1 = ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[2] << 8 |
          (uint)param_1[3]) ^ *param_3;
  uVar10 = param_3[0xf2];
  uVar3 = ((uint)param_1[4] << 0x18 | (uint)param_1[5] << 0x10 | (uint)param_1[6] << 8 |
          (uint)param_1[7]) ^ param_3[1];
  uVar2 = ((uint)param_1[8] << 0x18 | (uint)param_1[9] << 0x10 | (uint)param_1[10] << 8 |
          (uint)param_1[0xb]) ^ param_3[2];
  uVar8 = ((uint)CONCAT11(param_1[0xe],param_1[0xf]) |
          (uint)param_1[0xc] << 0x18 | (uint)param_1[0xd] << 0x10) ^ param_3[3];
  if (1 < (int)uVar10) {
    uVar11 = (ulonglong)(uVar10 - 1);
    puVar9 = param_3 + 10;
    do {
      uVar5 = (ulonglong)(int)uVar3;
      uVar6 = (ulonglong)(int)uVar2;
      uVar7 = (ulonglong)(int)uVar8;
      uVar4 = (ulonglong)(int)uVar1;
      uVar3 = *(uint *)(&DAT_14025c010 + ((longlong)uVar5 >> 0x18 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025c410 + ((longlong)uVar6 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025c810 + ((longlong)uVar7 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025cc10 + (uVar4 & 0xff) * 4) ^ puVar9[-1];
      uVar2 = *(uint *)(&DAT_14025c810 + ((longlong)uVar4 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025c010 + ((longlong)uVar6 >> 0x18 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025c410 + ((longlong)uVar7 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025cc10 + (uVar5 & 0xff) * 4) ^ *puVar9;
      uVar8 = *(uint *)(&DAT_14025c410 + ((longlong)uVar4 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025c810 + ((longlong)uVar5 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025c010 + ((longlong)uVar7 >> 0x18 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025cc10 + (uVar6 & 0xff) * 4) ^ puVar9[1];
      uVar1 = *(uint *)(&DAT_14025c010 + (ulonglong)(uVar1 >> 0x18) * 4) ^
              *(uint *)(&DAT_14025c410 + ((longlong)uVar5 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025c810 + ((longlong)uVar6 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025cc10 + (uVar7 & 0xff) * 4) ^ puVar9[-2];
      uVar11 = uVar11 - 1;
      puVar9 = puVar9 + 8;
    } while (uVar11 != 0);
    uVar10 = param_3[0xf2];
  }
  uVar6 = (ulonglong)(int)uVar2;
  uVar5 = (ulonglong)(int)uVar8;
  param_3 = param_3 + (longlong)(int)uVar10 * 8;
  uVar4 = (ulonglong)(int)uVar1;
  uVar11 = (ulonglong)(int)uVar3;
  uVar10 = *param_3;
  *param_2 = (&DAT_14025be10)[(longlong)uVar4 >> 0x18 & 0xff] ^ (byte)(uVar10 >> 0x18);
  param_2[1] = (&DAT_14025be10)[(longlong)uVar11 >> 0x10 & 0xff] ^ (byte)(uVar10 >> 0x10);
  param_2[2] = (&DAT_14025be10)[(longlong)uVar6 >> 8 & 0xff] ^ (byte)(uVar10 >> 8);
  param_2[3] = (&DAT_14025be10)[uVar5 & 0xff] ^ (byte)uVar10;
  uVar10 = param_3[1];
  param_2[4] = (&DAT_14025be10)[(longlong)uVar11 >> 0x18 & 0xff] ^ (byte)(uVar10 >> 0x18);
  param_2[5] = (&DAT_14025be10)[(longlong)uVar6 >> 0x10 & 0xff] ^ (byte)(uVar10 >> 0x10);
  param_2[6] = (&DAT_14025be10)[(longlong)uVar5 >> 8 & 0xff] ^ (byte)(uVar10 >> 8);
  param_2[7] = (&DAT_14025be10)[uVar4 & 0xff] ^ (byte)uVar10;
  uVar10 = param_3[2];
  param_2[8] = (&DAT_14025be10)[(longlong)uVar6 >> 0x18 & 0xff] ^ (byte)(uVar10 >> 0x18);
  param_2[9] = (&DAT_14025be10)[(longlong)uVar5 >> 0x10 & 0xff] ^ (byte)(uVar10 >> 0x10);
  param_2[10] = (&DAT_14025be10)[(longlong)uVar4 >> 8 & 0xff] ^ (byte)(uVar10 >> 8);
  param_2[0xb] = (&DAT_14025be10)[uVar11 & 0xff] ^ (byte)uVar10;
  uVar10 = param_3[3];
  param_2[0xc] = (&DAT_14025be10)[(longlong)uVar5 >> 0x18 & 0xff] ^ (byte)(uVar10 >> 0x18);
  param_2[0xd] = (&DAT_14025be10)[(longlong)uVar4 >> 0x10 & 0xff] ^ (byte)(uVar10 >> 0x10);
  param_2[0xe] = (&DAT_14025be10)[(longlong)uVar11 >> 8 & 0xff] ^ (byte)(uVar10 >> 8);
  param_2[0xf] = (&DAT_14025be10)[uVar6 & 0xff] ^ (byte)uVar10;
  return;
}



void FUN_140196950(byte *param_1,byte *param_2,longlong param_3)

{
  undefined4 uVar1;
  uint *puVar2;
  undefined4 *puVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  uint uVar11;
  int iVar12;
  ulonglong uVar13;
  undefined1 local_78 [80];
  
  if (*(int *)(param_3 + 0x3c0) < 1) {
    FUN_1400a2320(local_78,L"aes key is not initialized");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_78,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar12 = *(int *)(param_3 + 0x3c8);
  uVar6 = ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[2] << 8 |
          (uint)param_1[3]) ^ *(uint *)(param_3 + 0x1e0);
  uVar5 = ((uint)param_1[4] << 0x18 | (uint)param_1[5] << 0x10 | (uint)param_1[6] << 8 |
          (uint)param_1[7]) ^ *(uint *)(param_3 + 0x1e4);
  uVar4 = ((uint)param_1[8] << 0x18 | (uint)param_1[9] << 0x10 | (uint)param_1[10] << 8 |
          (uint)param_1[0xb]) ^ *(uint *)(param_3 + 0x1e8);
  uVar11 = ((uint)CONCAT11(param_1[0xe],param_1[0xf]) |
           (uint)param_1[0xc] << 0x18 | (uint)param_1[0xd] << 0x10) ^ *(uint *)(param_3 + 0x1ec);
  if (1 < iVar12) {
    uVar13 = (ulonglong)(iVar12 - 1);
    puVar2 = (uint *)(param_3 + 0x208);
    do {
      uVar10 = (ulonglong)(int)uVar5;
      uVar9 = (ulonglong)(int)uVar11;
      uVar8 = (ulonglong)(int)uVar4;
      uVar7 = (ulonglong)(int)uVar6;
      uVar5 = *(uint *)(&DAT_14025d410 + ((longlong)uVar7 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025d010 + ((longlong)uVar10 >> 0x18 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025d810 + ((longlong)uVar9 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025dc10 + (uVar8 & 0xff) * 4) ^ puVar2[-1];
      uVar4 = *(uint *)(&DAT_14025d010 + ((longlong)uVar8 >> 0x18 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025d810 + ((longlong)uVar7 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025d410 + ((longlong)uVar10 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025dc10 + (uVar9 & 0xff) * 4) ^ *puVar2;
      uVar11 = *(uint *)(&DAT_14025d410 + ((longlong)uVar8 >> 0x10 & 0xffU) * 4) ^
               *(uint *)(&DAT_14025d810 + ((longlong)uVar10 >> 8 & 0xffU) * 4) ^
               *(uint *)(&DAT_14025d010 + ((longlong)uVar9 >> 0x18 & 0xffU) * 4) ^
               *(uint *)(&DAT_14025dc10 + (uVar7 & 0xff) * 4) ^ puVar2[1];
      uVar6 = *(uint *)(&DAT_14025d010 + (ulonglong)(uVar6 >> 0x18) * 4) ^
              *(uint *)(&DAT_14025d810 + ((longlong)uVar8 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025d410 + ((longlong)uVar9 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_14025dc10 + (uVar10 & 0xff) * 4) ^ puVar2[-2];
      uVar13 = uVar13 - 1;
      puVar2 = puVar2 + 8;
    } while (uVar13 != 0);
    iVar12 = *(int *)(param_3 + 0x3c8);
  }
  uVar13 = (ulonglong)(int)uVar6;
  uVar8 = (ulonglong)(int)uVar4;
  uVar9 = (ulonglong)(int)uVar11;
  uVar7 = (ulonglong)(int)uVar5;
  puVar3 = (undefined4 *)(((longlong)iVar12 + 0xf) * 0x20 + param_3);
  uVar1 = *puVar3;
  *param_2 = (&DAT_14025bf10)[(longlong)uVar13 >> 0x18 & 0xff] ^ (byte)((uint)uVar1 >> 0x18);
  param_2[1] = (&DAT_14025bf10)[(longlong)uVar9 >> 0x10 & 0xff] ^ (byte)((uint)uVar1 >> 0x10);
  param_2[2] = (&DAT_14025bf10)[(longlong)uVar8 >> 8 & 0xff] ^ (byte)((uint)uVar1 >> 8);
  param_2[3] = (&DAT_14025bf10)[uVar7 & 0xff] ^ (byte)uVar1;
  uVar1 = puVar3[1];
  param_2[4] = (&DAT_14025bf10)[(longlong)uVar7 >> 0x18 & 0xff] ^ (byte)((uint)uVar1 >> 0x18);
  param_2[5] = (&DAT_14025bf10)[(longlong)uVar13 >> 0x10 & 0xff] ^ (byte)((uint)uVar1 >> 0x10);
  param_2[6] = (&DAT_14025bf10)[(longlong)uVar9 >> 8 & 0xff] ^ (byte)((uint)uVar1 >> 8);
  param_2[7] = (&DAT_14025bf10)[uVar8 & 0xff] ^ (byte)uVar1;
  uVar1 = puVar3[2];
  param_2[8] = (&DAT_14025bf10)[(longlong)uVar8 >> 0x18 & 0xff] ^ (byte)((uint)uVar1 >> 0x18);
  param_2[9] = (&DAT_14025bf10)[(longlong)uVar7 >> 0x10 & 0xff] ^ (byte)((uint)uVar1 >> 0x10);
  param_2[10] = (&DAT_14025bf10)[(longlong)uVar13 >> 8 & 0xff] ^ (byte)((uint)uVar1 >> 8);
  param_2[0xb] = (&DAT_14025bf10)[uVar9 & 0xff] ^ (byte)uVar1;
  uVar1 = puVar3[3];
  param_2[0xc] = (&DAT_14025bf10)[(longlong)uVar9 >> 0x18 & 0xff] ^ (byte)((uint)uVar1 >> 0x18);
  param_2[0xd] = (&DAT_14025bf10)[(longlong)uVar8 >> 0x10 & 0xff] ^ (byte)((uint)uVar1 >> 0x10);
  param_2[0xe] = (&DAT_14025bf10)[(longlong)uVar7 >> 8 & 0xff] ^ (byte)((uint)uVar1 >> 8);
  param_2[0xf] = (&DAT_14025bf10)[uVar13 & 0xff] ^ (byte)uVar1;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

void FUN_140196de0(byte *param_1,byte *param_2,longlong param_3)

{
  int iVar1;
  longlong lVar2;
  undefined4 uVar3;
  int iVar4;
  longlong lVar5;
  int iVar6;
  uint *puVar7;
  int iVar8;
  int iVar9;
  int iVar10;
  longlong lVar11;
  longlong lVar12;
  longlong lVar13;
  undefined1 auStack_118 [32];
  int local_f8;
  int local_f4;
  int local_f0;
  ulonglong local_e8;
  size_t local_e0;
  byte *local_d8;
  longlong local_d0;
  undefined1 local_c8 [72];
  undefined4 local_80;
  uint auStack_64 [9];
  ulonglong local_40;
  
  local_40 = DAT_1402f85a0 ^ (ulonglong)auStack_118;
  local_d8 = param_2;
  local_d0 = param_3;
  if (0 < *(int *)(param_3 + 0x3c0)) {
    iVar4 = *(int *)(param_3 + 0x3c4);
    if (iVar4 == 0x10) {
      FUN_1401964d0();
    }
    else {
      lVar11 = 0;
      iVar4 = (int)(iVar4 + (iVar4 >> 0x1f & 3U)) >> 2;
      iVar6 = 0;
      lVar12 = (longlong)iVar4;
      if (iVar4 != 4) {
        iVar6 = (iVar4 != 6) + 1;
      }
      lVar5 = (longlong)iVar6 * 0x20;
      iVar6 = *(int *)(&DAT_14025f038 + lVar5);
      local_f8 = *(int *)(&DAT_14025f040 + lVar5);
      iVar9 = *(int *)(&DAT_14025f048 + lVar5);
      puVar7 = &local_80;
      lVar5 = lVar11;
      if (0 < iVar4) {
        do {
          lVar5 = lVar5 + 1;
          *puVar7 = (uint)*param_1 << 0x18;
          *puVar7 = *puVar7 | (uint)param_1[1] << 0x10;
          *puVar7 = *puVar7 | (uint)param_1[2] << 8;
          *puVar7 = *puVar7 | (uint)param_1[3];
          *puVar7 = *puVar7 ^ *(uint *)(param_3 + -4 + lVar5 * 4);
          puVar7 = puVar7 + 1;
          param_1 = param_1 + 4;
        } while (lVar5 < lVar12);
      }
      if (1 < *(int *)(param_3 + 0x3c8)) {
        lVar5 = param_3 - (longlong)&local_80;
        local_e0 = (size_t)(iVar4 * 4);
        local_e8 = (ulonglong)(*(int *)(param_3 + 0x3c8) - 1);
        local_f4 = iVar6;
        local_f0 = iVar9;
        do {
          lVar5 = lVar5 + 0x20;
          if (0 < iVar4) {
            iVar10 = local_f8 - iVar6;
            iVar8 = iVar9 - iVar6;
            lVar13 = lVar11;
            iVar1 = iVar6;
            do {
              lVar2 = lVar13 * 4;
              lVar13 = lVar13 + 1;
              auStack_64[lVar13] =
                   *(uint *)(&DAT_14025c810 +
                            ((longlong)(ulonglong)(uint)(&local_80)[(iVar10 + iVar1) % iVar4] >> 8 &
                            0xffU) * 4) ^
                   *(uint *)(&DAT_14025cc10 +
                            (ulonglong)*(byte *)(&local_80 + (iVar8 + iVar1) % iVar4) * 4) ^
                   *(uint *)(&DAT_14025c410 +
                            ((longlong)(ulonglong)(uint)(&local_80)[iVar1 % iVar4] >> 0x10 & 0xffU)
                            * 4) ^
                   *(uint *)(&DAT_14025c010 +
                            (ulonglong)*(byte *)((longlong)&local_80 + lVar2 + 3) * 4) ^
                   *(uint *)((longlong)auStack_64 + lVar5 + lVar2 + 0xffffffffffffffe4U);
              iVar6 = local_f4;
              iVar9 = local_f0;
              iVar1 = iVar1 + 1;
            } while (lVar13 < lVar12);
          }
          memcpy(&local_80,auStack_64 + 1,local_e0);
          local_e8 = local_e8 - 1;
          param_2 = local_d8;
          param_3 = local_d0;
        } while (local_e8 != 0);
      }
      if (0 < iVar4) {
        iVar6 = iVar6 - local_f8;
        iVar9 = iVar9 - local_f8;
        do {
          lVar5 = lVar11 + (longlong)*(int *)(param_3 + 0x3c8) * 8;
          lVar13 = lVar11 * 4;
          lVar11 = lVar11 + 1;
          uVar3 = *(undefined4 *)(param_3 + lVar5 * 4);
          *param_2 = (&DAT_14025be10)[*(byte *)((longlong)&local_80 + lVar13 + 3)] ^
                     (byte)((uint)uVar3 >> 0x18);
          param_2[1] = (&DAT_14025be10)
                       [(longlong)(ulonglong)(uint)(&local_80)[(local_f8 + iVar6) % iVar4] >> 0x10 &
                        0xff] ^ (byte)((uint)uVar3 >> 0x10);
          param_2[2] = (&DAT_14025be10)
                       [(longlong)(ulonglong)(uint)(&local_80)[local_f8 % iVar4] >> 8 & 0xff] ^
                       (byte)((uint)uVar3 >> 8);
          iVar1 = local_f8 + iVar9;
          local_f8 = local_f8 + 1;
          param_2[3] = (&DAT_14025be10)[*(byte *)(&local_80 + iVar1 % iVar4)] ^ (byte)uVar3;
          param_2 = param_2 + 4;
        } while (lVar11 < lVar12);
      }
    }
    return;
  }
  FUN_1400a2320(local_c8,L"aes key is not initialized");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_c8,(ThrowInfo *)&DAT_1402f4860);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

void FUN_140197190(byte *param_1,byte *param_2,longlong param_3)

{
  longlong lVar1;
  undefined4 uVar2;
  int iVar3;
  longlong lVar4;
  int iVar5;
  uint *puVar6;
  int iVar7;
  int iVar8;
  uint *puVar9;
  int iVar10;
  longlong lVar11;
  longlong lVar12;
  ulonglong uVar13;
  undefined1 auStack_118 [32];
  int local_f8;
  int local_f4;
  int local_ec;
  size_t local_e8;
  byte *local_e0;
  longlong local_d8;
  undefined1 local_d0 [72];
  undefined4 local_88;
  uint auStack_6c [9];
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_118;
  local_e0 = param_2;
  local_d8 = param_3;
  if (0 < *(int *)(param_3 + 0x3c0)) {
    iVar3 = *(int *)(param_3 + 0x3c4);
    if (iVar3 == 0x10) {
      FUN_140196950();
    }
    else {
      iVar5 = 0;
      iVar3 = (int)(iVar3 + (iVar3 >> 0x1f & 3U)) >> 2;
      lVar11 = (longlong)iVar3;
      if (iVar3 != 4) {
        iVar5 = (iVar3 != 6) + 1;
      }
      lVar4 = (longlong)iVar5 * 0x20;
      iVar5 = *(int *)(&DAT_14025f03c + lVar4);
      local_f4 = *(int *)(&DAT_14025f044 + lVar4);
      local_f8 = *(int *)(&DAT_14025f04c + lVar4);
      if (0 < iVar3) {
        puVar6 = &local_88;
        puVar9 = (uint *)(param_3 + 0x1e0);
        lVar4 = lVar11;
        do {
          *puVar6 = (uint)*param_1 << 0x18;
          *puVar6 = *puVar6 | (uint)param_1[1] << 0x10;
          *puVar6 = *puVar6 | (uint)param_1[2] << 8;
          *puVar6 = *puVar6 | (uint)param_1[3];
          *puVar6 = *puVar6 ^ *puVar9;
          lVar4 = lVar4 + -1;
          puVar6 = puVar6 + 1;
          puVar9 = puVar9 + 1;
          param_1 = param_1 + 4;
        } while (lVar4 != 0);
      }
      if (1 < *(int *)(param_3 + 0x3c8)) {
        uVar13 = (ulonglong)(*(int *)(param_3 + 0x3c8) - 1);
        local_e8 = (size_t)(iVar3 * 4);
        lVar4 = (param_3 - (longlong)&local_88) + 0x200;
        local_ec = iVar5;
        do {
          lVar12 = 0;
          if (0 < iVar3) {
            iVar10 = local_f4 - iVar5;
            iVar8 = local_f8 - iVar5;
            iVar7 = iVar5;
            do {
              lVar1 = lVar12 * 4;
              lVar12 = lVar12 + 1;
              auStack_6c[lVar12] =
                   *(uint *)(&DAT_14025d810 +
                            ((longlong)(ulonglong)(uint)(&local_88)[(iVar10 + iVar7) % iVar3] >> 8 &
                            0xffU) * 4) ^
                   *(uint *)(&DAT_14025dc10 +
                            (ulonglong)*(byte *)(&local_88 + (iVar8 + iVar7) % iVar3) * 4) ^
                   *(uint *)(&DAT_14025d410 +
                            ((longlong)(ulonglong)(uint)(&local_88)[iVar7 % iVar3] >> 0x10 & 0xffU)
                            * 4) ^
                   *(uint *)(&DAT_14025d010 +
                            (ulonglong)*(byte *)((longlong)&local_88 + lVar1 + 3) * 4) ^
                   *(uint *)((longlong)&local_88 + lVar4 + lVar1);
              iVar7 = iVar7 + 1;
              iVar5 = local_ec;
            } while (lVar12 < lVar11);
          }
          memcpy(&local_88,auStack_6c + 1,local_e8);
          lVar4 = lVar4 + 0x20;
          uVar13 = uVar13 - 1;
          param_3 = local_d8;
          param_2 = local_e0;
        } while (uVar13 != 0);
      }
      lVar4 = 0;
      if (0 < iVar3) {
        iVar5 = iVar5 - local_f4;
        local_f8 = local_f8 - local_f4;
        do {
          lVar12 = lVar4 + 0x78;
          lVar1 = lVar4 * 4;
          lVar4 = lVar4 + 1;
          uVar2 = *(undefined4 *)(param_3 + (lVar12 + (longlong)*(int *)(param_3 + 0x3c8) * 8) * 4);
          *param_2 = (&DAT_14025bf10)[*(byte *)((longlong)&local_88 + lVar1 + 3)] ^
                     (byte)((uint)uVar2 >> 0x18);
          param_2[1] = (&DAT_14025bf10)
                       [(longlong)(ulonglong)(uint)(&local_88)[(local_f4 + iVar5) % iVar3] >> 0x10 &
                        0xff] ^ (byte)((uint)uVar2 >> 0x10);
          param_2[2] = (&DAT_14025bf10)
                       [(longlong)(ulonglong)(uint)(&local_88)[local_f4 % iVar3] >> 8 & 0xff] ^
                       (byte)((uint)uVar2 >> 8);
          iVar7 = local_f4 + local_f8;
          local_f4 = local_f4 + 1;
          param_2[3] = (&DAT_14025bf10)[*(byte *)(&local_88 + iVar7 % iVar3)] ^ (byte)uVar2;
          param_2 = param_2 + 4;
        } while (lVar4 < lVar11);
      }
    }
    return;
  }
  FUN_1400a2320(local_d0,L"aes key is not initialized");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_d0,(ThrowInfo *)&DAT_1402f4860);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140197540(longlong param_1,longlong param_2,byte *param_3,ulonglong param_4,int param_5)

{
  int iVar1;
  undefined1 auVar2 [16];
  undefined1 auVar3 [16];
  ulonglong uVar4;
  byte *pbVar5;
  ulonglong uVar6;
  uint uVar7;
  undefined1 auStack_c8 [32];
  undefined1 local_a8 [72];
  byte local_60 [32];
  ulonglong local_40;
  
  local_40 = DAT_1402f85a0 ^ (ulonglong)auStack_c8;
  if (*(int *)(param_1 + 0x3c0) < 1) {
    FUN_1400a2320(local_a8,L"aes key is not initialized");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_a8,(ThrowInfo *)&DAT_1402f4860);
  }
  if (param_4 != 0) {
    uVar6 = (ulonglong)*(int *)(param_1 + 0x3c4);
    auVar2._8_8_ = 0;
    auVar2._0_8_ = uVar6;
    auVar3._8_8_ = 0;
    auVar3._0_8_ = param_4;
    uVar4 = param_4 / uVar6;
    if (SUB168(auVar3 % auVar2,0) == 0) {
      local_60[1] = 0;
      local_60[2] = 0;
      local_60[3] = 0;
      local_60[4] = 0;
      local_60[5] = 0;
      local_60[6] = 0;
      local_60[7] = 0;
      local_60[8] = 0;
      local_60[9] = 0;
      local_60[10] = 0;
      local_60[0xb] = 0;
      local_60[0xc] = 0;
      local_60[0xd] = 0;
      local_60[0xe] = 0;
      local_60[0xf] = 0;
      local_60[0x10] = 0;
      local_60[0x11] = 0;
      local_60[0x12] = 0;
      local_60[0x13] = 0;
      local_60[0x14] = 0;
      local_60[0x15] = 0;
      local_60[0x16] = 0;
      local_60[0x17] = 0;
      local_60[0x18] = 0;
      local_60[0x19] = 0;
      local_60[0x1a] = 0;
      local_60[0x1b] = 0;
      local_60[0x1c] = 0;
      local_60[0x1d] = 0;
      local_60[0x1e] = 0;
      local_60[0x1f] = 0;
      uVar7 = 0;
      local_60[0] = SUB161(auVar3 % auVar2,0);
      if (param_5 == 1) {
        if (uVar4 != 0) {
          do {
            if (0 < (int)uVar6) {
              uVar6 = uVar6 & 0xffffffff;
              pbVar5 = local_60;
              do {
                *pbVar5 = *pbVar5 ^ pbVar5[param_2 - (longlong)local_60];
                uVar6 = uVar6 - 1;
                pbVar5 = pbVar5 + 1;
              } while (uVar6 != 0);
            }
            FUN_140196de0(local_60,param_3,param_1);
            uVar6 = (ulonglong)*(int *)(param_1 + 0x3c4);
            memcpy(local_60,param_3,uVar6);
            uVar7 = uVar7 + 1;
            param_2 = param_2 + *(int *)(param_1 + 0x3c4);
            param_3 = param_3 + *(int *)(param_1 + 0x3c4);
          } while ((ulonglong)uVar7 < param_4 / uVar6);
        }
      }
      else if (param_5 == 2) {
        if (uVar4 != 0) {
          do {
            FUN_140196de0(local_60,param_3,param_1);
            if (0 < (int)*(uint *)(param_1 + 0x3c4)) {
              uVar4 = (ulonglong)*(uint *)(param_1 + 0x3c4);
              pbVar5 = param_3;
              do {
                *pbVar5 = *pbVar5 ^ pbVar5[param_2 - (longlong)param_3];
                uVar4 = uVar4 - 1;
                pbVar5 = pbVar5 + 1;
              } while (uVar4 != 0);
            }
            iVar1 = *(int *)(param_1 + 0x3c4);
            memcpy(local_60,param_3,(longlong)iVar1);
            uVar7 = uVar7 + 1;
            param_2 = param_2 + *(int *)(param_1 + 0x3c4);
            param_3 = param_3 + *(int *)(param_1 + 0x3c4);
          } while ((ulonglong)uVar7 < param_4 / (ulonglong)(longlong)iVar1);
        }
      }
      else if (uVar4 != 0) {
        do {
          FUN_140196de0(param_2,param_3,param_1);
          uVar7 = uVar7 + 1;
          param_2 = param_2 + *(int *)(param_1 + 0x3c4);
          param_3 = param_3 + *(int *)(param_1 + 0x3c4);
        } while ((ulonglong)uVar7 < param_4 / (ulonglong)(longlong)*(int *)(param_1 + 0x3c4));
      }
      return;
    }
  }
  FUN_1400a2320(local_a8,L"block size is not 16byte or 24byte or 32byte");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_a8,(ThrowInfo *)&DAT_1402f4860);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401977d0(longlong param_1,void *param_2,byte *param_3,ulonglong param_4,int param_5)

{
  int iVar1;
  undefined1 auVar2 [16];
  undefined1 auVar3 [16];
  ulonglong uVar4;
  byte *pbVar5;
  uint uVar6;
  undefined1 auStack_b8 [32];
  undefined1 local_98 [72];
  byte local_50 [32];
  ulonglong local_30;
  
  local_30 = DAT_1402f85a0 ^ (ulonglong)auStack_b8;
  if (*(int *)(param_1 + 0x3c0) < 1) {
    FUN_1400a2320(local_98,L"aes key is not initialized");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_98,(ThrowInfo *)&DAT_1402f4860);
  }
  if (param_4 != 0) {
    auVar2._8_8_ = 0;
    auVar2._0_8_ = (longlong)*(int *)(param_1 + 0x3c4);
    auVar3._8_8_ = 0;
    auVar3._0_8_ = param_4;
    uVar4 = param_4 / (ulonglong)(longlong)*(int *)(param_1 + 0x3c4);
    if (SUB168(auVar3 % auVar2,0) == 0) {
      local_50[1] = 0;
      local_50[2] = 0;
      local_50[3] = 0;
      local_50[4] = 0;
      local_50[5] = 0;
      local_50[6] = 0;
      local_50[7] = 0;
      local_50[8] = 0;
      local_50[9] = 0;
      local_50[10] = 0;
      local_50[0xb] = 0;
      local_50[0xc] = 0;
      local_50[0xd] = 0;
      local_50[0xe] = 0;
      local_50[0xf] = 0;
      local_50[0x10] = 0;
      local_50[0x11] = 0;
      local_50[0x12] = 0;
      local_50[0x13] = 0;
      local_50[0x14] = 0;
      local_50[0x15] = 0;
      local_50[0x16] = 0;
      local_50[0x17] = 0;
      local_50[0x18] = 0;
      local_50[0x19] = 0;
      local_50[0x1a] = 0;
      local_50[0x1b] = 0;
      local_50[0x1c] = 0;
      local_50[0x1d] = 0;
      local_50[0x1e] = 0;
      local_50[0x1f] = 0;
      uVar6 = 0;
      local_50[0] = SUB161(auVar3 % auVar2,0);
      if (param_5 == 1) {
        if (uVar4 != 0) {
          do {
            FUN_140197190(param_2,param_3,param_1);
            if (0 < (int)*(uint *)(param_1 + 0x3c4)) {
              uVar4 = (ulonglong)*(uint *)(param_1 + 0x3c4);
              pbVar5 = param_3;
              do {
                *pbVar5 = *pbVar5 ^ pbVar5[(longlong)(local_50 + -(longlong)param_3)];
                uVar4 = uVar4 - 1;
                pbVar5 = pbVar5 + 1;
              } while (uVar4 != 0);
            }
            iVar1 = *(int *)(param_1 + 0x3c4);
            memcpy(local_50,param_2,(longlong)iVar1);
            uVar6 = uVar6 + 1;
            param_2 = (void *)((longlong)param_2 + (longlong)*(int *)(param_1 + 0x3c4));
            param_3 = param_3 + *(int *)(param_1 + 0x3c4);
          } while ((ulonglong)uVar6 < param_4 / (ulonglong)(longlong)iVar1);
        }
      }
      else if (param_5 == 2) {
        if (uVar4 != 0) {
          do {
            FUN_140196de0(local_50,param_3,param_1);
            if (0 < (int)*(uint *)(param_1 + 0x3c4)) {
              uVar4 = (ulonglong)*(uint *)(param_1 + 0x3c4);
              pbVar5 = param_3;
              do {
                *pbVar5 = *pbVar5 ^ pbVar5[(longlong)param_2 - (longlong)param_3];
                uVar4 = uVar4 - 1;
                pbVar5 = pbVar5 + 1;
              } while (uVar4 != 0);
            }
            iVar1 = *(int *)(param_1 + 0x3c4);
            memcpy(local_50,param_2,(longlong)iVar1);
            uVar6 = uVar6 + 1;
            param_2 = (void *)((longlong)param_2 + (longlong)*(int *)(param_1 + 0x3c4));
            param_3 = param_3 + *(int *)(param_1 + 0x3c4);
          } while ((ulonglong)uVar6 < param_4 / (ulonglong)(longlong)iVar1);
        }
      }
      else if (uVar4 != 0) {
        do {
          FUN_140197190(param_2,param_3,param_1);
          uVar6 = uVar6 + 1;
          param_2 = (void *)((longlong)param_2 + (longlong)*(int *)(param_1 + 0x3c4));
          param_3 = param_3 + *(int *)(param_1 + 0x3c4);
        } while ((ulonglong)uVar6 < param_4 / (ulonglong)(longlong)*(int *)(param_1 + 0x3c4));
      }
      return;
    }
  }
  FUN_1400a2320(local_98,L"block size is not 16byte or 24byte or 32byte");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_98,(ThrowInfo *)&DAT_1402f4860);
}



undefined8 FUN_140197a50(longlong param_1,longlong param_2,longlong param_3)

{
  byte bVar1;
  int iVar2;
  int iVar3;
  byte *pbVar4;
  byte *_Dst;
  byte *pbVar5;
  undefined **local_138;
  undefined8 local_130;
  byte *local_128;
  undefined8 local_120;
  undefined8 local_118;
  undefined8 local_110;
  longlong local_108;
  ulonglong local_100;
  undefined8 local_f8;
  undefined1 local_e8 [72];
  undefined1 local_a0 [72];
  undefined1 local_58 [80];
  
  local_f8 = 0xfffffffffffffffe;
  if (*(int *)(param_3 + 0x3c0) < 1) {
    FUN_1400a1fd0(local_e8,&DAT_14025f1f0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_e8,(ThrowInfo *)&DAT_1402f4860);
  }
  if (*(int *)(param_1 + 0x18) != 0) {
    _Dst = (byte *)0x0;
    local_130 = 0;
    local_128 = (byte *)0x0;
    local_120 = 0;
    local_118 = 0;
    local_138 = Proud::ByteArray::vftable;
    FUN_14003cda0(&local_138);
    pbVar4 = local_128;
    if ((int)local_120 == 0) {
      pbVar4 = _Dst;
    }
    pbVar5 = _Dst;
    if (*(int *)(param_1 + 0x18) != 0) {
      pbVar5 = *(byte **)(param_1 + 0x10);
    }
    FUN_1401977d0(param_3,pbVar5,pbVar4,(longlong)*(int *)(param_1 + 0x18),0);
    if ((int)local_120 < 1) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    bVar1 = *local_128;
    if ((int)local_120 < (int)(bVar1 + 5)) {
      FUN_1400a1fd0(local_a0,&DAT_14025f1c0);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1402f4860);
    }
    pbVar4 = local_128;
    if ((int)local_120 == 0) {
      pbVar4 = _Dst;
    }
    iVar2 = *(int *)(pbVar4 + 1);
    local_100 = 0;
    local_108 = 0;
    local_110 = 0;
    pbVar4 = local_128;
    if ((int)local_120 == 0) {
      pbVar4 = _Dst;
    }
    iVar3 = FUN_1401c1490(pbVar4 + 5,((int)local_120 - (uint)bVar1) + -5);
    if (iVar2 != iVar3) {
      FUN_1400a1fd0(local_58,&DAT_14025f188);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    FUN_14003cda0(param_2,((int)local_120 - (uint)bVar1) + -5);
    pbVar4 = local_128;
    if ((int)local_120 == 0) {
      pbVar4 = _Dst;
    }
    if (*(int *)(param_2 + 0x18) != 0) {
      _Dst = *(byte **)(param_2 + 0x10);
    }
    memcpy(_Dst,pbVar4 + 5,(longlong)(int)(((int)local_120 - (uint)bVar1) + -5));
    FUN_14019a730(&local_110);
    if (local_108 != 0) {
      if ((longlong)local_100 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_100 = local_100 & 0xffffffff00000000;
    }
    FUN_140140df0(&local_138);
  }
  return 1;
}



undefined8 FUN_140197c40(longlong param_1,undefined8 param_2,longlong param_3,int param_4)

{
  byte bVar1;
  int iVar2;
  undefined7 uVar6;
  longlong lVar3;
  byte *pbVar4;
  void *_Dst;
  undefined8 uVar5;
  byte *pbVar7;
  int iVar8;
  undefined **local_258;
  undefined8 local_250;
  byte *local_248;
  undefined8 local_240;
  undefined8 local_238;
  undefined8 local_230;
  longlong local_228;
  ulonglong local_220;
  undefined8 local_210;
  undefined1 local_178 [144];
  undefined1 local_e8 [72];
  undefined1 local_a0 [72];
  undefined1 local_58 [80];
  
  local_210 = 0xfffffffffffffffe;
  if (*(int *)(param_3 + 0x3c0) < 1) {
    FUN_1400a1fd0(local_a0,&DAT_14025f1f0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1402f4860);
  }
  lVar3 = *(longlong *)(param_1 + 8);
  if (lVar3 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar8 = *(int *)(param_1 + 0x18);
  }
  else {
    iVar8 = *(int *)(lVar3 + 0x18);
  }
  if (iVar8 <= param_4) {
    if (lVar3 == 0) {
      if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      param_4 = *(int *)(param_1 + 0x18);
    }
    else {
      param_4 = *(int *)(lVar3 + 0x18);
    }
  }
  if (lVar3 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar8 = *(int *)(param_1 + 0x18);
  }
  else {
    iVar8 = *(int *)(lVar3 + 0x18);
  }
  iVar8 = iVar8 - param_4;
  if (iVar8 == 0) {
    uVar6 = (undefined7)((ulonglong)lVar3 >> 8);
  }
  else {
    if (*(longlong *)(param_1 + 0x10) == 0) {
      if (lVar3 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      if (*(int *)(lVar3 + 0x18) == 0) {
        lVar3 = 0;
      }
      else {
        lVar3 = *(longlong *)(lVar3 + 0x10);
      }
    }
    else {
      lVar3 = *(longlong *)(param_1 + 0x10);
      if (lVar3 == 0) {
        FUN_1400a2320(local_178,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_178,(ThrowInfo *)&DAT_1402f4860);
      }
    }
    pbVar7 = (byte *)0x0;
    local_250 = 0;
    local_248 = (byte *)0x0;
    local_240 = 0;
    local_238 = 0;
    local_258 = Proud::ByteArray::vftable;
    FUN_14003cda0(&local_258,iVar8);
    pbVar4 = local_248;
    if ((int)local_240 == 0) {
      pbVar4 = pbVar7;
    }
    FUN_1401977d0(param_3,param_4 + lVar3,pbVar4,iVar8,0);
    if ((int)local_240 < 1) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    bVar1 = *local_248;
    if ((int)local_240 < (int)(bVar1 + 5)) {
      FUN_1400a1fd0(local_e8,&DAT_14025f1c0);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_e8,(ThrowInfo *)&DAT_1402f4860);
    }
    pbVar4 = local_248;
    if ((int)local_240 == 0) {
      pbVar4 = pbVar7;
    }
    iVar8 = *(int *)(pbVar4 + 1);
    local_220 = 0;
    local_228 = 0;
    local_230 = 0;
    pbVar4 = local_248;
    if ((int)local_240 == 0) {
      pbVar4 = pbVar7;
    }
    iVar2 = FUN_1401c1490(pbVar4 + 5,((int)local_240 - (uint)bVar1) + -5);
    if (iVar8 != iVar2) {
      FUN_1400a1fd0(local_58,&DAT_14025f188);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    FUN_140185030(param_2);
    FUN_1401856c0(param_2,((int)local_240 - (uint)bVar1) + -5);
    iVar8 = (int)local_240;
    pbVar4 = local_248;
    if ((int)local_240 == 0) {
      pbVar4 = pbVar7;
    }
    _Dst = (void *)FUN_14016aa90(param_2);
    memcpy(_Dst,pbVar4 + 5,(longlong)(int)((iVar8 - (uint)bVar1) + -5));
    FUN_14019a730(&local_230);
    if (local_228 != 0) {
      if ((longlong)local_220 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_220 = local_220 & 0xffffffff00000000;
    }
    uVar5 = FUN_140140df0(&local_258);
    uVar6 = (undefined7)((ulonglong)uVar5 >> 8);
  }
  return CONCAT71(uVar6,1);
}



// WARNING: Removing unreachable block (ram,0x000140198005)
// WARNING: Removing unreachable block (ram,0x000140198013)
// WARNING: Removing unreachable block (ram,0x00014019800b)
// WARNING: Removing unreachable block (ram,0x00014019801a)

void FUN_140197f00(undefined8 param_1,int param_2,undefined8 param_3,longlong param_4,
                  undefined8 param_5)

{
  byte *pbVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  longlong lVar4;
  uint uVar5;
  ulonglong uVar6;
  undefined **local_50;
  undefined8 local_48;
  ulonglong local_40;
  undefined8 local_38;
  undefined8 local_30;
  
  uVar6 = 0;
  local_48 = 0;
  local_40 = 0;
  local_38 = 0;
  local_30 = 0;
  local_50 = Proud::ByteArray::vftable;
  pbVar1 = (byte *)(param_4 + 4);
  FUN_14003cda0(&local_50,1);
  uVar2 = local_40;
  if ((int)local_38 == 0) {
    uVar2 = uVar6;
  }
  FUN_1400224d0(uVar2,pbVar1,1);
  lVar4 = (longlong)(int)local_38;
  FUN_14003cda0(&local_50,(int)local_38 + 4);
  uVar2 = local_40;
  if ((int)local_38 == 0) {
    uVar2 = uVar6;
  }
  FUN_1400224d0(uVar2 + lVar4,param_4 + 0xc,4);
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2 != 0) {
    lVar4 = (longlong)(int)local_38;
    FUN_14003cda0(&local_50,(int)local_38 + param_2);
    uVar2 = local_40;
    if ((int)local_38 == 0) {
      uVar2 = uVar6;
    }
    FUN_1400224d0(uVar2 + lVar4,param_1,(longlong)param_2);
  }
  uVar2 = uVar6;
  if (*pbVar1 != 0) {
    do {
      lVar4 = (longlong)(int)local_38;
      if ((int)local_38 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      FUN_14003cda0(&local_50,(int)local_38 + 1);
      uVar3 = local_40;
      if ((int)local_38 == 0) {
        uVar3 = uVar6;
      }
      *(undefined1 *)(lVar4 + uVar3) = 0;
      uVar5 = (int)uVar2 + 1;
      uVar2 = (ulonglong)uVar5;
    } while ((int)uVar5 < (int)(uint)*pbVar1);
  }
  uVar2 = local_40;
  if ((int)local_38 == 0) {
    uVar2 = uVar6;
  }
  FUN_140197540(param_5,uVar2,param_3,(longlong)(int)local_38,0);
  FUN_140140df0(&local_50);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1401980a0(longlong param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  char cVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 auStack_118 [32];
  longlong local_f8;
  undefined8 local_e0;
  undefined1 local_d8 [72];
  undefined1 local_90 [72];
  int local_48;
  byte local_44;
  undefined4 local_40;
  undefined4 local_3c;
  ulonglong local_38;
  
  local_e0 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_118;
  if (*(int *)(param_3 + 0x3c0) < 1) {
    FUN_1400a1fd0(local_90,&DAT_14025f1f0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_90,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  uVar4 = 0;
  uVar3 = uVar4;
  if (iVar1 != 0) {
    uVar3 = *(undefined8 *)(param_1 + 0x10);
  }
  local_3c = FUN_1401c1490(uVar3,iVar1);
  if (0 < *(int *)(param_3 + 0x3c0)) {
    local_40 = 5;
    cVar2 = (char)((iVar1 + 5) % *(int *)(param_3 + 0x3c4));
    local_44 = 0;
    if (cVar2 != '\0') {
      local_44 = (char)*(int *)(param_3 + 0x3c4) - cVar2;
    }
    local_48 = local_44 + 5 + iVar1;
    FUN_14003cda0(param_2);
    uVar3 = uVar4;
    if (*(int *)(param_2 + 0x18) != 0) {
      uVar3 = *(undefined8 *)(param_2 + 0x10);
    }
    if (*(int *)(param_1 + 0x18) != 0) {
      uVar4 = *(undefined8 *)(param_1 + 0x10);
    }
    local_f8 = param_3;
    FUN_140197f00(uVar4,*(int *)(param_1 + 0x18),uVar3,&local_48);
    return 1;
  }
  FUN_1400a2320(local_d8,L"aes key is not initialized");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_d8,(ThrowInfo *)&DAT_1402f4860);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1401981f0(longlong param_1,longlong param_2,longlong param_3,int param_4)

{
  int iVar1;
  undefined7 uVar4;
  longlong lVar2;
  undefined8 uVar3;
  int iVar5;
  longlong lVar6;
  undefined1 auStack_238 [32];
  longlong local_218;
  undefined8 local_208;
  undefined1 local_120 [72];
  undefined1 local_d8 [72];
  undefined1 local_90 [72];
  int local_48;
  byte local_44;
  undefined4 local_40;
  undefined4 local_3c;
  ulonglong local_38;
  
  local_208 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_238;
  if (*(int *)(param_3 + 0x3c0) < 1) {
    FUN_1400a1fd0(local_120,&DAT_14025f1f0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_120,(ThrowInfo *)&DAT_1402f4860);
  }
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar5 = *(int *)(param_1 + 0x18);
  }
  else {
    iVar5 = *(int *)(lVar2 + 0x18);
  }
  if (iVar5 <= param_4) {
    if (lVar2 == 0) {
      if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      param_4 = *(int *)(param_1 + 0x18);
    }
    else {
      param_4 = *(int *)(lVar2 + 0x18);
    }
  }
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar5 = *(int *)(param_1 + 0x18);
  }
  else {
    iVar5 = *(int *)(lVar2 + 0x18);
  }
  iVar5 = iVar5 - param_4;
  if (iVar5 == 0) {
    uVar4 = (undefined7)((ulonglong)lVar2 >> 8);
  }
  else {
    if (*(longlong *)(param_1 + 0x10) == 0) {
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      if (*(int *)(lVar2 + 0x18) == 0) {
        lVar2 = 0;
      }
      else {
        lVar2 = *(longlong *)(lVar2 + 0x10);
      }
    }
    else {
      lVar2 = *(longlong *)(param_1 + 0x10);
      if (lVar2 == 0) {
        FUN_1400a2320(local_90,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_90,(ThrowInfo *)&DAT_1402f4860);
      }
    }
    local_3c = FUN_1401c1490(param_4 + lVar2,iVar5);
    if (*(int *)(param_3 + 0x3c0) < 1) {
      FUN_1400a2320(local_d8,L"aes key is not initialized");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_d8,(ThrowInfo *)&DAT_1402f4860);
    }
    local_40 = 5;
    local_44 = (byte)((iVar5 + 5) % *(int *)(param_3 + 0x3c4));
    if (local_44 != 0) {
      local_44 = (char)*(int *)(param_3 + 0x3c4) - local_44;
    }
    iVar1 = local_44 + 5 + iVar5;
    local_48 = iVar1;
    FUN_140185030(param_2);
    FUN_1401856c0(param_2,iVar1);
    lVar6 = *(longlong *)(param_2 + 0x10);
    if (lVar6 == 0) {
      lVar6 = *(longlong *)(param_2 + 8);
      if (lVar6 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      if (*(int *)(lVar6 + 0x18) == 0) {
        lVar6 = 0;
      }
      else {
        lVar6 = *(longlong *)(lVar6 + 0x10);
      }
    }
    local_218 = param_3;
    uVar3 = FUN_140197f00(param_4 + lVar2,iVar5,lVar6,&local_48);
    uVar4 = (undefined7)((ulonglong)uVar3 >> 8);
  }
  return CONCAT71(uVar4,1);
}



undefined8 FUN_140198420(void)

{
  return 1000;
}



undefined8 FUN_140198430(void)

{
  return 0x3f2;
}



void FUN_140198440(undefined8 *param_1)

{
  *param_1 = Proud::IHeartbeatWork::vftable;
  return;
}



undefined8 * FUN_140198450(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::IHeartbeatWork::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_140198480(void)

{
  return 2000;
}



undefined8 FUN_140198490(void)

{
  return 0x7d3;
}



void FUN_1401984a0(longlong param_1,int *param_2)

{
  longlong lVar1;
  uint local_res8 [2];
  
  FUN_1400a1c30();
  if (*param_2 == 0) {
    *(undefined4 *)(param_1 + 0x88) = 2;
    lVar1 = (**(code **)(**(longlong **)(param_1 + 0x40) + 0x10))();
    if (lVar1 == 0) {
      lVar1 = (**(code **)(**(longlong **)(param_1 + 0x40) + 0x18))();
      local_res8[0] = (uint)(lVar1 != 0);
    }
    else {
      lVar1 = (**(code **)(**(longlong **)(param_1 + 0x40) + 0x10))();
      local_res8[0] = *(uint *)(lVar1 + 0x1578);
    }
    (**(code **)(*(longlong *)(param_1 + 0x68) + 0x30))
              ((longlong *)(param_1 + 0x68),1,&DAT_140318db0,param_1 + 0x60,local_res8);
  }
  else {
    *(undefined4 *)(param_1 + 0x88) = 0;
  }
  FUN_1400d1290(param_1 + 0x98);
  return;
}



void FUN_140198560(longlong param_1)

{
  FUN_1400a1c30(param_1 + 0x98);
  *(undefined4 *)(param_1 + 0x88) = 0;
  FUN_1400d1290(param_1 + 0x98);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_1401985a0(longlong param_1)

{
  double dVar1;
  
  FUN_1400a1c30(param_1 + 0x88);
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x38) + 0x70) + 0x88))();
  *(undefined4 *)(param_1 + 0x78) = 0;
  dVar1 = (double)(**(code **)(**(longlong **)(param_1 + 0x30) + 8))();
  *(double *)(param_1 + 0x80) = dVar1 + _DAT_140314018;
  FUN_1400d1290(param_1 + 0x88);
  return 1;
}



undefined * FUN_140198620(void)

{
  bool bVar1;
  char cVar2;
  
  bVar1 = false;
  cVar2 = FUN_1400a1cc0(&DAT_140319008);
  if (cVar2 != '\0') {
    if (DAT_14030c100 == '\0') {
      bVar1 = false;
    }
    else {
      bVar1 = true;
      FUN_1400a1c30(&DAT_140319008);
    }
  }
  if ((DAT_140319000 & 1) == 0) {
    DAT_140319000 = DAT_140319000 | 1;
    FUN_1401c1aa0(&DAT_140318f40);
    atexit((_func_5014 *)&LAB_140202ab0);
  }
  DAT_14030c100 = 0;
  if (bVar1) {
    FUN_1400d1290(&DAT_140319008);
  }
  return &DAT_140318f40;
}



void FUN_1401986e0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  *param_1 = Proud::CVizAgent::vftable;
  param_1[2] = Proud::CVizAgent::vftable;
  param_1[6] = Proud::CVizAgent::vftable;
  uVar2 = FUN_140198620();
  FUN_1401c18c0(uVar2,param_1 + 6,param_3,param_4,uVar3);
  puVar1 = (undefined8 *)param_1[9];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  param_1[9] = 0;
  FUN_1400a1cd0(param_1 + 0x13);
  FUN_140186ed0(param_1 + 0xd);
  FUN_1400031d0(param_1 + 0xc);
  FUN_1400031d0(param_1 + 10);
  puVar1 = (undefined8 *)param_1[9];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  param_1[6] = Proud::IHeartbeatWork::vftable;
  FUN_14018a150(param_1 + 2);
  *param_1 = Proud::INetClientEvent::vftable;
  FUN_140140b40(param_1);
  return;
}



void FUN_1401987d0(longlong param_1)

{
  FUN_1401987f0(param_1 + -0x10);
  return;
}



void FUN_1401987e0(longlong param_1)

{
  FUN_1401987f0(param_1 + -0x30);
  return;
}



void * FUN_1401987f0(void *param_1,uint param_2)

{
  FUN_1401986e0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140198820(longlong param_1)

{
  int *piVar1;
  undefined *puVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  longlong *plVar5;
  undefined *puVar6;
  double dVar7;
  undefined1 auStack_b8 [32];
  undefined8 local_98;
  undefined1 local_90;
  undefined8 local_88;
  undefined1 local_80;
  undefined8 local_78;
  undefined *local_68;
  undefined2 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined1 local_48 [48];
  ulonglong local_18;
  
  local_78 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_b8;
  dVar7 = (double)(**(code **)(**(longlong **)(param_1 + 0x40) + 8))();
  if (*(double *)(param_1 + 0x90) <= dVar7 && dVar7 != *(double *)(param_1 + 0x90)) {
    FUN_140140b80(&local_68);
    if (local_68 == (undefined *)0x0) {
      local_68 = PTR_DAT_1402f8010;
    }
    if (*(undefined **)(param_1 + 0x50) != local_68) {
      uVar3 = FUN_1400a3440();
      local_88 = uVar3;
      FUN_1400a1c30(uVar3);
      puVar2 = local_68;
      local_80 = 1;
      if (((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1402f8010)) &&
         (puVar6 = local_68 + -8, puVar6 != (undefined *)0x0)) {
        uVar4 = FUN_1400a3440();
        local_98 = uVar4;
        FUN_1400a1c30(uVar4);
        local_90 = 1;
        piVar1 = (int *)(puVar2 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar6);
        }
        FUN_1400d1290(uVar4);
      }
      local_68 = *(undefined **)(param_1 + 0x50);
      if (((local_68 != PTR_DAT_1402f8010) && (local_68 != (undefined *)0x0)) &&
         (local_68 != (undefined *)0x8)) {
        *(int *)(local_68 + -4) = *(int *)(local_68 + -4) + 1;
      }
      FUN_1400d1290(uVar3);
    }
    local_60 = *(undefined2 *)(param_1 + 0x58);
    local_5c = DAT_14030c048;
    local_58 = DAT_14030c04c;
    local_54 = DAT_14030c050;
    local_50 = DAT_14030c054;
    plVar5 = (longlong *)(*(longlong *)(param_1 + 0x48) + 0x70);
    (**(code **)(*plVar5 + 0x78))(plVar5,&local_68);
    dVar7 = (double)(**(code **)(**(longlong **)(param_1 + 0x40) + 8))();
    *(double *)(param_1 + 0x90) = dVar7 + _DAT_140314018;
    *(undefined4 *)(param_1 + 0x88) = 1;
    FUN_140140df0(local_48);
    puVar2 = local_68;
    if (((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1402f8010)) &&
       (puVar6 = local_68 + -8, puVar6 != (undefined *)0x0)) {
      uVar3 = FUN_1400a3440();
      local_98 = uVar3;
      FUN_1400a1c30(uVar3);
      local_90 = 1;
      piVar1 = (int *)(puVar2 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar6);
      }
      FUN_1400d1290(uVar3);
    }
  }
  return;
}



void FUN_140198a10(longlong param_1)

{
  longlong *plVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  undefined1 local_res8 [8];
  undefined4 local_res10 [2];
  undefined8 uVar5;
  undefined1 uVar6;
  
  uVar5 = 0xfffffffffffffffe;
  lVar2 = param_1 + 0x98;
  lVar4 = lVar2;
  FUN_1400a1c30(lVar2);
  uVar6 = 1;
  lVar3 = (**(code **)(**(longlong **)(param_1 + 0x40) + 0x10))();
  if (lVar3 == 0) {
    lVar3 = (**(code **)(**(longlong **)(param_1 + 0x40) + 0x18))();
    if (lVar3 != 0) {
      (**(code **)(*(longlong *)(param_1 + 0x68) + 0x90))
                (param_1 + 0x68,1,&DAT_140318cf0,*(longlong *)(param_1 + 0x68),uVar5,lVar4,uVar6);
      if (*(longlong *)(lVar3 + 0xc98) == 0) {
        lVar4 = 0;
      }
      else {
        lVar4 = *(longlong *)(lVar3 + 0xc88);
      }
      for (; lVar4 != 0; lVar4 = *(longlong *)(lVar4 + 0x10)) {
        (**(code **)(*(longlong *)(param_1 + 0x68) + 0xa0))
                  (param_1 + 0x68,1,&DAT_140318cf0,*(longlong *)(lVar4 + 8) + 0x6f8);
      }
    }
  }
  else {
    local_res8[0] = 0;
    local_res10[0] =
         (**(code **)(*(longlong *)(lVar3 + 0x70) + 0x108))((longlong *)(lVar3 + 0x70),local_res8);
    plVar1 = (longlong *)(param_1 + 0x68);
    (**(code **)(*plVar1 + 0x60))(plVar1,1,&DAT_140318cf0,local_res10);
    (**(code **)(*plVar1 + 0x70))(plVar1,1,&DAT_140318cf0);
    lVar4 = 0;
    if (*(longlong *)(lVar3 + 0x1670) != 0) {
      lVar4 = *(longlong *)(lVar3 + 0x1660);
    }
    for (; lVar4 != 0; lVar4 = *(longlong *)(lVar4 + 0x10)) {
      lVar3 = 0;
      if (*(longlong **)(lVar4 + 8) != (longlong *)0x0) {
        lVar3 = **(longlong **)(lVar4 + 8);
      }
      (**(code **)(*plVar1 + 0x80))(plVar1,1,&DAT_140318cf0,lVar3 + 0x56c);
    }
  }
  FUN_1400d1290(lVar2);
  return;
}



undefined1
FUN_140198b90(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x3e9);
  FUN_140186d90(local_30,param_4);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_u_RequestLogin_14030bf98,0x3e9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140198c80(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x3e9);
  FUN_140186d90(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_u_RequestLogin_14030bf98,0x3e9);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140198d70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x3eb);
  FUN_14007c6e0(local_30,*param_4);
  FUN_140186d90(local_30,param_5);
  FUN_14007c6e0(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_u_NotifyCommon_ReceiveRmi_14030bfa8,
                     0x3eb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140198e70(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x3eb);
  FUN_14007c6e0(local_30,*param_5);
  FUN_140186d90(local_30,param_6);
  FUN_14007c6e0(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     PTR_u_NotifyCommon_ReceiveRmi_14030bfa8,0x3eb);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140198f80(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x3ec);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     PTR_u_NotifyCli_ConnectionState_14030bfb0,0x3ec);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140199060(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x3ec);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     PTR_u_NotifyCli_ConnectionState_14030bfb0,0x3ec);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140199140(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x3ed);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_u_NotifyCli_Peers_Clear_14030bfb8,
                     0x3ed);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140199200(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x3ed);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_u_NotifyCli_Peers_Clear_14030bfb8,
                     0x3ed);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1401992d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x3ee);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     PTR_u_NotifyCli_Peers_AddOrEdit_14030bfc0,0x3ee);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1401993b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x3ee);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     PTR_u_NotifyCli_Peers_AddOrEdit_14030bfc0,0x3ee);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140199490(longlong *param_1,undefined4 param_2,undefined8 param_3)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x3ef);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_u_NotifySrv_ClientEmpty_14030bfc8,
                     0x3ef);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1 FUN_140199550(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x3ef);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_u_NotifySrv_ClientEmpty_14030bfc8,
                     0x3ef);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140199620(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x3f0);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     PTR_u_NotifySrv_Clients_AddOrEdit_14030bfd0,0x3f0);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_140199700(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x3f0);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     PTR_u_NotifySrv_Clients_AddOrEdit_14030bfd0,0x3f0);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1401997e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x3f1);
  FUN_14007c6e0(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_u_NotifySrv_Clients_Remove_14030bfd8
                     ,0x3f1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_1401998c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_140185560(local_30);
  FUN_140185030(local_30);
  FUN_14003d020(local_30,0x3f1);
  FUN_14007c6e0(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     PTR_u_NotifySrv_Clients_Remove_14030bfd8,0x3f1);
  FUN_14019a730(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined8 FUN_1401999a0(longlong *param_1,int *param_2,undefined8 param_3)

{
  int *piVar1;
  int iVar2;
  char cVar3;
  undefined4 uVar4;
  DWORD DVar5;
  DWORD DVar6;
  undefined8 uVar7;
  longlong *plVar8;
  undefined **ppuVar9;
  undefined *puVar10;
  int iVar11;
  undefined *puVar12;
  undefined *local_res10;
  undefined8 local_res18;
  int local_res20 [2];
  undefined *local_118;
  undefined8 local_110;
  undefined *local_108;
  int local_100;
  undefined8 local_f8;
  int local_f0;
  undefined *local_e8;
  undefined *local_e0;
  undefined *local_d8;
  undefined *local_d0;
  undefined *local_c8;
  undefined **local_c0;
  undefined1 local_b8;
  undefined *local_b0;
  undefined8 local_a8;
  undefined1 local_98 [4];
  int local_94;
  undefined8 local_60;
  
  local_a8 = 0xfffffffffffffffe;
  iVar2 = param_2[10];
  local_res18 = param_3;
  if (iVar2 == 0) {
    FUN_140169430(param_1,0);
  }
  iVar11 = *param_2;
  cVar3 = FUN_140185e40(param_2,local_res20);
  if (cVar3 == '\0') {
LAB_14019a1a2:
    FUN_140185160(param_2,(int)((iVar11 >> 0x1f & 7U) + iVar11) >> 3);
    uVar7 = 0;
  }
  else {
    local_60 = param_3;
    if (local_res20[0] == 0x7d1) {
      FUN_140140af0(local_98);
      local_94 = param_2[10];
      local_98[0] = (undefined1)param_2[0x10];
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_u_NotifyLoginOk_14030c038);
      DVar5 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0x7d1,PTR_u_NotifyLoginOk_14030c038,&DAT_14027d1a0
                    );
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        puVar10 = PTR_DAT_1402f8010;
        local_res10 = PTR_DAT_1402f8010;
        plVar8 = (longlong *)FUN_14003c0c0(&local_res10,&local_b0,0xfffffffe);
        if (puVar10 == (undefined *)0x0) {
          puVar10 = PTR_DAT_1402f8010;
        }
        local_res10 = puVar10;
        if ((undefined *)*plVar8 != puVar10) {
          uVar7 = FUN_1400a3440();
          local_110 = uVar7;
          FUN_1400a1c30(uVar7);
          local_108 = (undefined *)CONCAT71(local_108._1_7_,1);
          if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1402f8010)) &&
             (puVar10 + -8 != (undefined *)0x0)) {
            ppuVar9 = (undefined **)FUN_1400a3440();
            local_c0 = ppuVar9;
            FUN_1400a1c30(ppuVar9);
            local_b8 = 1;
            piVar1 = (int *)(puVar10 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(puVar10 + -8);
            }
            FUN_1400d1290(ppuVar9);
          }
          puVar10 = (undefined *)*plVar8;
          if (((puVar10 != PTR_DAT_1402f8010) && (puVar10 != (undefined *)0x0)) &&
             (puVar10 != (undefined *)0x8)) {
            *(int *)(puVar10 + -4) = *(int *)(puVar10 + -4) + 1;
          }
          local_res10 = puVar10;
          FUN_1400d1290(uVar7);
        }
        if (((local_b0 != (undefined *)0x0) && (local_b0 != PTR_DAT_1402f8010)) &&
           (local_b0 + -8 != (undefined *)0x0)) {
          uVar7 = FUN_1400a3440();
          local_110 = uVar7;
          FUN_1400a1c30(uVar7);
          local_108 = (undefined *)CONCAT71(local_108._1_7_,1);
          piVar1 = (int *)(local_b0 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_b0 + -8);
          }
          FUN_1400d1290(uVar7);
        }
        local_c0 = &local_e8;
        local_b0 = PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_e8 = PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_e8 = (undefined *)0x0;
        }
        if (puVar10 != PTR_DAT_1402f8010) {
          uVar7 = FUN_1400a3440();
          local_110 = uVar7;
          FUN_1400a1c30(uVar7);
          local_108 = (undefined *)CONCAT71(local_108._1_7_,1);
          FUN_1400031d0(&local_e8);
          if (((puVar10 != PTR_DAT_1402f8010) && (puVar10 != (undefined *)0x0)) &&
             (puVar10 != (undefined *)0x8)) {
            *(int *)(puVar10 + -4) = *(int *)(puVar10 + -4) + 1;
          }
          local_e8 = puVar10;
          FUN_1400d1290(uVar7);
        }
        puVar12 = PTR_u_NotifyLoginOk_14030c038;
        FUN_1400a3440();
        local_d8 = PTR_DAT_1402f8010;
        uVar4 = FUN_1400a32c0(puVar12);
        uVar7 = FUN_140002f20(&local_d8,uVar4);
        FUN_1400a32f0(uVar7,puVar12,uVar4);
        FUN_140003000(&local_d8);
        (**(code **)(*param_1 + 0x28))(param_1,0x7d1,&local_d8,&local_e8);
        puVar12 = puVar10;
        if (puVar10 == (undefined *)0x0) {
          puVar12 = PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x7d1,PTR_u_NotifyLoginOk_14030c038,puVar12);
        param_3 = local_res18;
        if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1402f8010)) &&
           (puVar10 + -8 != (undefined *)0x0)) {
          uVar7 = FUN_1400a3440();
          local_110 = uVar7;
          FUN_1400a1c30(uVar7);
          local_108 = (undefined *)CONCAT71(local_108._1_7_,1);
          piVar1 = (int *)(puVar10 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(puVar10 + -8);
          }
          FUN_1400d1290(uVar7);
          param_3 = local_res18;
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_110 = CONCAT44(local_110._4_4_,0x7d1);
        local_108 = PTR_u_NotifyLoginOk_14030c038;
        local_100 = iVar2;
        local_f8 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_110);
        DVar5 = GetTickCount();
      }
      cVar3 = (**(code **)(*param_1 + 0x38))(param_1,iVar2,local_98);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],PTR_u_NotifyLoginOk_14030c038);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_110 = CONCAT44(local_110._4_4_,0x7d1);
        local_108 = PTR_u_NotifyLoginOk_14030c038;
LAB_14019a173:
        local_100 = iVar2;
        local_f8 = param_3;
        DVar6 = GetTickCount();
        local_f0 = DVar6 - DVar5;
        (**(code **)(*param_1 + 0x18))(param_1,&local_110);
      }
    }
    else {
      if (local_res20[0] != 0x7d2) goto LAB_14019a1a2;
      FUN_140140af0(local_98);
      local_94 = param_2[10];
      local_98[0] = (undefined1)param_2[0x10];
      cVar3 = FUN_140185490(param_2,&local_118,4);
      uVar4 = local_res10._0_4_;
      if (cVar3 != '\0') {
        uVar4 = local_118._0_4_;
      }
      local_res10 = (undefined *)CONCAT44(local_res10._4_4_,uVar4);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_u_NotifyLoginFailed_14030c040);
      DVar5 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0x7d2,PTR_u_NotifyLoginFailed_14030c040,
                     &DAT_14027d1a0);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_1400a3440();
        local_118 = PTR_DAT_1402f8010;
        uVar7 = FUN_140141430((ulonglong)local_res10 & 0xffffffff);
        FUN_14003c890(&local_118,uVar7);
        FUN_14003c890(&local_118,&DAT_14027c73c);
        puVar10 = local_118;
        iVar11 = 0;
        if ((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1402f8010)) {
          iVar11 = *(int *)(local_118 + -8);
        }
        plVar8 = (longlong *)FUN_14003c0c0(&local_118,&local_c8,iVar11 + -2);
        if (puVar10 == (undefined *)0x0) {
          puVar10 = PTR_DAT_1402f8010;
        }
        local_118 = puVar10;
        if ((undefined *)*plVar8 != puVar10) {
          ppuVar9 = (undefined **)FUN_1400a3440();
          local_c0 = ppuVar9;
          FUN_1400a1c30(ppuVar9);
          local_b8 = 1;
          if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1402f8010)) &&
             (puVar10 + -8 != (undefined *)0x0)) {
            uVar7 = FUN_1400a3440();
            local_110 = uVar7;
            FUN_1400a1c30(uVar7);
            local_108 = (undefined *)CONCAT71(local_108._1_7_,1);
            piVar1 = (int *)(puVar10 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(puVar10 + -8);
            }
            FUN_1400d1290(uVar7);
          }
          puVar10 = (undefined *)*plVar8;
          if (((puVar10 != PTR_DAT_1402f8010) && (puVar10 != (undefined *)0x0)) &&
             (puVar10 != (undefined *)0x8)) {
            *(int *)(puVar10 + -4) = *(int *)(puVar10 + -4) + 1;
          }
          local_118 = puVar10;
          FUN_1400d1290(ppuVar9);
        }
        if (((local_c8 != (undefined *)0x0) && (local_c8 != PTR_DAT_1402f8010)) &&
           (local_c8 + -8 != (undefined *)0x0)) {
          uVar7 = FUN_1400a3440();
          local_110 = uVar7;
          FUN_1400a1c30(uVar7);
          local_108 = (undefined *)CONCAT71(local_108._1_7_,1);
          piVar1 = (int *)(local_c8 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(local_c8 + -8);
          }
          FUN_1400d1290(uVar7);
        }
        local_c0 = &local_e0;
        local_c8 = PTR_DAT_1402f8010;
        FUN_1400a3440();
        local_e0 = PTR_DAT_1402f8010;
        if (PTR_DAT_1402f8010 == (undefined *)0x0) {
          local_e0 = (undefined *)0x0;
        }
        if (puVar10 != PTR_DAT_1402f8010) {
          uVar7 = FUN_1400a3440();
          local_110 = uVar7;
          FUN_1400a1c30(uVar7);
          local_108 = (undefined *)CONCAT71(local_108._1_7_,1);
          FUN_1400031d0(&local_e0);
          if (((puVar10 != PTR_DAT_1402f8010) && (puVar10 != (undefined *)0x0)) &&
             (puVar10 != (undefined *)0x8)) {
            *(int *)(puVar10 + -4) = *(int *)(puVar10 + -4) + 1;
          }
          local_e0 = puVar10;
          FUN_1400d1290(uVar7);
        }
        puVar12 = PTR_u_NotifyLoginFailed_14030c040;
        FUN_1400a3440();
        local_d0 = PTR_DAT_1402f8010;
        uVar4 = FUN_1400a32c0(puVar12);
        uVar7 = FUN_140002f20(&local_d0,uVar4);
        FUN_1400a32f0(uVar7,puVar12,uVar4);
        FUN_140003000(&local_d0);
        (**(code **)(*param_1 + 0x28))(param_1,0x7d2,&local_d0,&local_e0);
        puVar12 = puVar10;
        if (puVar10 == (undefined *)0x0) {
          puVar12 = PTR_DAT_1402f8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x7d2,PTR_u_NotifyLoginFailed_14030c040,puVar12);
        param_3 = local_res18;
        if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1402f8010)) &&
           (puVar10 + -8 != (undefined *)0x0)) {
          uVar7 = FUN_1400a3440();
          local_110 = uVar7;
          FUN_1400a1c30(uVar7);
          local_108 = (undefined *)CONCAT71(local_108._1_7_,1);
          piVar1 = (int *)(puVar10 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_1400a3530(puVar10 + -8);
          }
          FUN_1400d1290(uVar7);
          param_3 = local_res18;
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_110 = CONCAT44(local_110._4_4_,0x7d2);
        local_108 = PTR_u_NotifyLoginFailed_14030c040;
        local_100 = iVar2;
        local_f8 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_110);
        DVar5 = GetTickCount();
      }
      cVar3 = (**(code **)(*param_1 + 0x40))(param_1,iVar2,local_98,&local_res10);
      if (cVar3 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],PTR_u_NotifyLoginFailed_14030c040);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_110 = CONCAT44(local_110._4_4_,0x7d2);
        local_108 = PTR_u_NotifyLoginFailed_14030c040;
        goto LAB_14019a173;
      }
    }
    uVar7 = 1;
  }
  return uVar7;
}



undefined8 *
FUN_14019a1d0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4,
             undefined8 param_5)

{
  undefined8 *puVar1;
  undefined4 uVar2;
  void *pvVar3;
  longlong lVar4;
  undefined8 uVar5;
  
  *param_1 = Proud::INetClientEvent::vftable;
  *(undefined2 *)(param_1 + 1) = 0;
  FUN_14018a120(param_1 + 2);
  param_1[2] = VizS2C::Stub::vftable;
  FUN_1401c14e0(param_1 + 6);
  *param_1 = Proud::CVizAgent::vftable;
  param_1[2] = Proud::CVizAgent::vftable;
  param_1[6] = Proud::CVizAgent::vftable;
  param_1[9] = 0;
  FUN_1400a3440();
  param_1[10] = PTR_DAT_1402f8010;
  FUN_1400a3440();
  param_1[0xc] = PTR_DAT_1402f8010;
  puVar1 = param_1 + 0xd;
  FUN_140186ea0(puVar1);
  *puVar1 = VizC2S::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x7c) != 1) {
    FUN_1400a2b50(PTR_u_PIDL_compiler_is_incompatible_to_14030bd40);
  }
  uVar2 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0x13,uVar2,1);
  param_1[8] = param_2;
  FUN_14001f680(param_1 + 10,param_3);
  *(undefined4 *)(param_1 + 0xb) = param_4;
  FUN_140003100(param_1 + 0xc,param_5);
  pvVar3 = operator_new(0x1900);
  lVar4 = 0;
  if (pvVar3 != (void *)0x0) {
    lVar4 = FUN_1401822a0(pvVar3);
  }
  param_1[9] = lVar4;
  (**(code **)(*(longlong *)(lVar4 + 0x70) + 0x118))((longlong *)(lVar4 + 0x70),param_1);
  (**(code **)(*(longlong *)param_1[9] + 8))((longlong *)param_1[9],puVar1);
  (**(code **)(*(longlong *)param_1[9] + 0x10))((longlong *)param_1[9],param_1 + 2);
  param_1[0x12] = 0;
  *(undefined4 *)(param_1 + 0x11) = 0;
  *(undefined1 *)(param_1 + 0xf) = 1;
  *(undefined1 *)(param_1 + 5) = 1;
  uVar5 = FUN_140198620();
  FUN_1401c17e0(uVar5,param_1 + 6,10);
  return param_1;
}



void FUN_14019a380(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  
  plVar1 = (longlong *)(*(longlong *)(param_1 + 0x18) + 0x70);
  (**(code **)(*plVar1 + 0x98))(plVar1,0,param_3,param_4,0xfffffffffffffffe);
  FUN_1400a1c30(param_1 + 0x68);
  if (*(int *)(param_1 + 0x58) == 0) {
    FUN_140198820(param_1 + -0x30);
  }
  FUN_1400d1290(param_1 + 0x68);
  return;
}



undefined1 FUN_14019a3f0(longlong param_1)

{
  FUN_1400a1c30(param_1 + 0x88);
  FUN_140198a10(param_1 + -0x10);
  FUN_1400d1290(param_1 + 0x88);
  return 1;
}



undefined1
FUN_14019a440(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong param_4,
             undefined8 param_5)

{
  undefined1 uVar1;
  int iVar2;
  ulonglong uVar3;
  uint uVar4;
  undefined4 local_res10 [2];
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  ulonglong uVar5;
  
  local_res10[0] = param_2;
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x3ea);
  FUN_14007c6e0(local_40,*(undefined4 *)(param_4 + 0x18));
  uVar3 = 0;
  iVar2 = *(int *)(param_4 + 0x18);
  uVar5 = uVar3;
  if (0 < iVar2) {
    do {
      if (((longlong)uVar3 < 0) || (iVar2 <= (int)uVar5)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      FUN_14007c6e0(local_40,*(undefined4 *)(*(longlong *)(param_4 + 0x10) + uVar3 * 4));
      uVar4 = (int)uVar5 + 1;
      uVar5 = (ulonglong)uVar4;
      uVar3 = uVar3 + 1;
      iVar2 = *(int *)(param_4 + 0x18);
    } while ((int)uVar4 < iVar2);
  }
  FUN_1401c1cf0(local_40,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,PTR_u_NotifyCommon_SendRmi_14030bfa0,
                     0x3ea);
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



undefined1
FUN_14019a570(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             longlong param_5,undefined8 param_6)

{
  undefined1 uVar1;
  int iVar2;
  ulonglong uVar3;
  uint uVar4;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  ulonglong uVar5;
  
  FUN_140185560(local_40);
  FUN_140185030(local_40);
  FUN_14003d020(local_40,0x3ea);
  FUN_14007c6e0(local_40,*(undefined4 *)(param_5 + 0x18));
  uVar3 = 0;
  iVar2 = *(int *)(param_5 + 0x18);
  uVar5 = uVar3;
  if (0 < iVar2) {
    do {
      if (((longlong)uVar3 < 0) || (iVar2 <= (int)uVar5)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      FUN_14007c6e0(local_40,*(undefined4 *)(*(longlong *)(param_5 + 0x10) + uVar3 * 4));
      uVar4 = (int)uVar5 + 1;
      uVar5 = (ulonglong)uVar4;
      uVar3 = uVar3 + 1;
      iVar2 = *(int *)(param_5 + 0x18);
    } while ((int)uVar4 < iVar2);
  }
  FUN_1401c1cf0(local_40,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,PTR_u_NotifyCommon_SendRmi_14030bfa0,
                     0x3ea);
  FUN_14019a730(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return uVar1;
}



void FUN_14019a6b0(longlong param_1)

{
  FUN_1400a1c30(&DAT_1403190d0);
  if ((*(short *)(param_1 + -8) == 0x1de6) && (*(longlong *)(param_1 + 0x30) == 0)) {
    *(short **)(param_1 + 0x30) = DAT_140319108;
    DAT_140319108 = (short *)(param_1 + -8);
    FUN_1400d1290(&DAT_1403190d0);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_14019a730(longlong *param_1)

{
  longlong *plVar1;
  
  if (*param_1 != 0) {
    plVar1 = (longlong *)(*param_1 + 0x28);
    *plVar1 = *plVar1 + -1;
    if (*(longlong *)(*param_1 + 0x28) == 0) {
      FUN_14019a6b0();
    }
    *param_1 = 0;
  }
  return;
}



undefined2 *
FUN_14019a770(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined2 *puVar2;
  undefined2 *puVar3;
  undefined8 uVar4;
  undefined *puVar5;
  undefined1 uVar6;
  
  uVar4 = 0xfffffffffffffffe;
  puVar5 = &DAT_1403190d0;
  FUN_1400a1c30();
  puVar3 = DAT_140319108;
  uVar6 = 1;
  if (DAT_140319108 == (undefined2 *)0x0) {
    puVar2 = (undefined2 *)FUN_1400a34c0();
    puVar3 = (undefined2 *)0x0;
    if (puVar2 != (undefined2 *)0x0) {
      *(undefined8 *)(puVar2 + 8) = 0;
      *(undefined8 *)(puVar2 + 0xc) = 0;
      *(undefined8 *)(puVar2 + 0x10) = 0;
      *(undefined8 *)(puVar2 + 0x14) = 0;
      *(undefined ***)(puVar2 + 4) = Proud::ByteArray::vftable;
      *(undefined8 *)(puVar2 + 0x18) = 0;
      *puVar2 = 0x1de6;
      *(undefined8 *)(puVar2 + 0x1c) = 0;
      puVar3 = puVar2;
    }
  }
  else {
    puVar1 = (undefined8 *)(DAT_140319108 + 0x1c);
    DAT_140319108 = *(undefined2 **)(DAT_140319108 + 0x1c);
    *puVar1 = 0;
  }
  FUN_14003cda0(puVar3 + 4,0,param_3,param_4,uVar4,puVar5,uVar6);
  FUN_1400d1290(&DAT_1403190d0);
  return puVar3 + 4;
}



void FUN_14019a830(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *local_res8 [4];
  undefined8 uVar1;
  undefined1 local_50 [80];
  
  uVar1 = 0xfffffffffffffffe;
  FUN_1400a3170(local_res8);
  FUN_14003c890(local_res8,L".dmp",param_3,param_4,uVar1);
  if (local_res8[0] == (undefined *)0x0) {
    local_res8[0] = PTR_DAT_1402f8010;
  }
  FUN_1401c1dc0(local_res8[0],0);
  FUN_1400a2320(local_50,PTR_u_error__ArrayPtr_is_null__14030c130);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_14019a8a0(undefined8 *param_1)

{
  *param_1 = Proud::ISendIssueObject::vftable;
  return;
}



undefined8 * FUN_14019a8b0(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::ISendIssueObject::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



bool FUN_14019a8e0(longlong param_1)

{
  return *(int *)(param_1 + 0x710) != *(int *)(param_1 + 0x720);
}



undefined1 FUN_14019a8f0(longlong param_1)

{
  return *(undefined1 *)(param_1 + 0x228);
}



void FUN_14019a900(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 0x228) = param_2;
  return;
}



void FUN_14019a910(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014019a921. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x198) + 0x118) + 8))();
  return;
}



void FUN_14019a930(longlong param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4,
                  undefined8 param_5,undefined4 param_6)

{
  FUN_140166b70(*(undefined8 *)(param_1 + 0x198),param_1 + -0xa0,param_2,param_3,param_4,param_5,
                param_6);
  return;
}



void FUN_14019a970(longlong param_1)

{
  FUN_1401a1120(*(undefined8 *)(param_1 + 0x640));
  return;
}



void FUN_14019a980(longlong param_1)

{
  FUN_1401a1460(param_1 + -0x48);
  return;
}



void FUN_14019a990(undefined8 *param_1)

{
  if ((void *)*param_1 != (void *)0x0) {
    operator_delete((void *)*param_1);
  }
  return;
}



bool FUN_14019a9b0(longlong param_1)

{
  return *(longlong *)(param_1 + 0x278) == 0;
}



void FUN_14019a9c0(longlong param_1)

{
  double dVar1;
  char *pcVar2;
  undefined1 *puVar3;
  double dVar4;
  double dVar5;
  double dVar6;
  
  if (*(longlong *)(param_1 + 0x750) != 0) {
    dVar5 = *(double *)(*(longlong *)(param_1 + 0x750) + 8);
    dVar4 = (double)(**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x238) + 0x118) + 8))();
    pcVar2 = *(char **)(param_1 + 0x750);
    if (*(double *)(pcVar2 + 0x10) == 0.0) {
      *(double *)(pcVar2 + 0x10) = dVar4;
      *(double *)(*(longlong *)(param_1 + 0x750) + 8) = dVar4;
      return;
    }
    if (*pcVar2 == '\0') {
      dVar1 = *(double *)(*(longlong *)(param_1 + 0x238) + 0x17f8);
      dVar6 = 0.9;
      if ((dVar1 <= 0.9) && (dVar6 = dVar1, dVar1 < 0.2)) {
        dVar6 = 0.2;
      }
      dVar5 = dVar4 - dVar5;
      *(double *)(*(longlong *)(param_1 + 0x750) + 0x18) =
           (*(double *)(*(longlong *)(param_1 + 0x750) + 0x18) - dVar5) * dVar6 + dVar5;
      puVar3 = *(undefined1 **)(param_1 + 0x750);
      if ((5.8999999999999995 < dVar4 - *(double *)(puVar3 + 0x10)) &&
         (*(double *)(puVar3 + 0x18) <= 0.413 && *(double *)(puVar3 + 0x18) != 0.413)) {
        *puVar3 = 1;
      }
      if (**(char **)(param_1 + 0x750) != '\0') {
        FUN_140164080(*(undefined8 *)(param_1 + 0x238),param_1,"Speedhack",1);
      }
      *(double *)(*(longlong *)(param_1 + 0x750) + 8) = dVar4;
    }
  }
  return;
}



bool FUN_14019ab20(longlong param_1)

{
  return *(longlong *)(param_1 + 0x188) != 0;
}



bool FUN_14019ab30(longlong param_1)

{
  longlong *plVar1;
  
  plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x198) + 0x748);
  if (plVar1 != (longlong *)0x0) {
    return *plVar1 == 0;
  }
  return true;
}



void FUN_14019ab60(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_140142680(*(longlong *)(param_1 + 0x10),param_1 + -0x110);
  }
  return;
}



void FUN_14019ab90(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong lVar4;
  undefined8 uVar5;
  longlong lVar6;
  
  uVar5 = 0xfffffffffffffffe;
  lVar4 = *(longlong *)(param_1 + 0x198) + 0x798;
  lVar6 = lVar4;
  FUN_1400a1c30(lVar4);
  if (*(longlong *)(param_1 + 0x80) == 0) {
    lVar1 = param_1 + -0xa0;
    lVar2 = *(longlong *)(param_1 + 0x198);
    plVar3 = (longlong *)(lVar2 + 0x808);
    if (*(longlong *)(param_1 + 0x80) != 0) {
      FUN_140142680(plVar3,lVar1,param_3,param_4,uVar5,lVar6,1);
    }
    if (*(longlong *)(lVar2 + 0x810) == 0) {
      *plVar3 = lVar1;
    }
    else {
      *(longlong *)(*(longlong *)(lVar2 + 0x810) + 0x118) = lVar1;
      *(undefined8 *)(param_1 + 0x70) = *(undefined8 *)(lVar2 + 0x810);
    }
    *(longlong *)(lVar2 + 0x810) = lVar1;
    *(longlong **)(param_1 + 0x80) = plVar3;
    *(int *)(lVar2 + 0x818) = *(int *)(lVar2 + 0x818) + 1;
  }
  FUN_1400d1290(lVar4);
  return;
}



void FUN_14019ac50(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  longlong *plVar1;
  undefined **local_30;
  undefined8 local_28;
  undefined8 local_20;
  undefined8 local_18;
  undefined8 local_10;
  
  local_28 = 0;
  local_20 = 0;
  local_18 = 0;
  local_10 = 0;
  local_30 = Proud::ByteArray::vftable;
  plVar1 = (longlong *)(param_1 + -0x68);
  (**(code **)(*plVar1 + 0x38))(plVar1,0xb,3,&local_30,param_2,param_3,0xfffffffffffffffe);
  FUN_140140df0(&local_30);
                    // WARNING: Could not recover jumptable at 0x00014019acc5. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*plVar1 + 0x40))(plVar1,param_2);
  return;
}



void FUN_14019acd0(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_140140df0((longlong)pvVar1 + 8);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_14019ad00(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined *puVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined *puVar5;
  double dVar6;
  undefined *local_res8;
  
  if (*(longlong *)(param_1 + 0xc0) == 0) {
    *(undefined8 *)(param_1 + 0xc0) = param_2;
    plVar4 = (longlong *)(*(longlong *)(param_1 + 0x198) + 0x118);
    dVar6 = (double)(**(code **)(*plVar4 + 8))(plVar4,param_2,param_3,param_4,0xfffffffffffffffe);
    if ((dVar6 - *(double *)(param_1 + 0x5f0) < 0.3) &&
       (*(longlong *)(*(longlong *)(param_1 + 0x198) + 0x17f0) != 0)) {
      FUN_1400a3440();
      local_res8 = PTR_DAT_1402f8010;
      FUN_14003c600(&local_res8,&DAT_1402602e0,param_2);
      puVar2 = local_res8;
      puVar5 = local_res8;
      if (local_res8 == (undefined *)0x0) {
        puVar5 = PTR_DAT_1402f8010;
      }
      FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_1 + 0x198) + 0x17f0),0,puVar5);
      if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8010)) &&
         (puVar2 + -8 != (undefined *)0x0)) {
        uVar3 = FUN_1400a3440();
        FUN_1400a1c30(uVar3);
        piVar1 = (int *)(puVar2 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar2 + -8);
        }
        FUN_1400d1290(uVar3);
      }
    }
  }
  return;
}



undefined4 FUN_14019ae10(longlong param_1,undefined8 param_2)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 local_res8 [2];
  
  FUN_140174e40(param_2,0);
  iVar1 = FUN_1401a4970(*(longlong *)(param_1 + 0x748) + 200,param_2,
                        *(undefined4 *)(param_1 + 0x6f8),
                        *(undefined4 *)(*(longlong *)(param_1 + 0x238) + 0x22c),local_res8);
  uVar2 = 0;
  if (iVar1 < 0) {
    uVar2 = local_res8[0];
  }
  return uVar2;
}



void FUN_14019ae80(longlong param_1,undefined8 param_2,undefined4 param_3,longlong param_4,
                  undefined4 param_5,longlong param_6)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  undefined1 local_res18 [8];
  undefined8 local_48;
  undefined4 local_40;
  longlong local_38;
  undefined4 local_30;
  undefined4 local_2c;
  
  FUN_140174e40(param_6,0);
  uVar5 = (ulonglong)*(int *)(param_6 + 0x18);
  FUN_1401a3a00(&local_48);
  lVar4 = 0;
  local_2c = param_5;
  local_38 = param_6;
  local_30 = 0;
  local_48 = param_2;
  local_40 = param_3;
  iVar2 = FUN_1401a4390(&local_48,local_res18);
  if ((-1 < iVar2) && (0 < iVar2)) {
    lVar3 = uVar5 * 0x48;
    uVar6 = uVar5;
    do {
      if (((longlong)(lVar4 + uVar5) < 0) || (*(int *)(param_6 + 0x18) <= (int)uVar6)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      lVar1 = *(longlong *)(param_6 + 0x10);
      lVar4 = lVar4 + 1;
      *(undefined4 *)(lVar3 + 0x38 + lVar1) = *(undefined4 *)(param_4 + 8);
      *(undefined2 *)(lVar3 + 0x3c + lVar1) = *(undefined2 *)(param_4 + 0xc);
      uVar6 = (ulonglong)((int)uVar6 + 1);
      *(undefined4 *)(lVar3 + 0x28 + lVar1) = *(undefined4 *)(param_1 + 0x6f8);
      lVar3 = lVar3 + 0x48;
    } while (lVar4 < iVar2);
  }
  return;
}



void FUN_14019af80(longlong param_1,longlong param_2)

{
  undefined2 uVar1;
  uint uVar2;
  longlong lVar3;
  longlong lVar4;
  longlong *plVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  char cVar8;
  undefined4 uVar9;
  uint *puVar10;
  uint *puVar11;
  undefined *puVar12;
  uint *puVar13;
  uint *puVar14;
  ulonglong uVar15;
  uint uVar16;
  undefined8 uVar17;
  
  uVar17 = 0xfffffffffffffffe;
  *(undefined4 *)(param_2 + 0x30) = *(undefined4 *)(param_1 + 0x6f8);
  uVar1 = *(undefined2 *)(param_1 + 0x714);
  *(undefined4 *)(param_2 + 0x18) = *(undefined4 *)(param_1 + 0x710);
  *(undefined2 *)(param_2 + 0x1c) = uVar1;
  lVar3 = *(longlong *)(param_1 + 0x748);
  *(undefined4 *)(param_2 + 8) = *(undefined4 *)(lVar3 + 0x130);
  *(undefined2 *)(param_2 + 0xc) = *(undefined2 *)(lVar3 + 0x134);
  *(undefined4 *)(param_2 + 0x28) = *(undefined4 *)(param_1 + 0x720);
  *(undefined2 *)(param_2 + 0x2c) = *(undefined2 *)(param_1 + 0x724);
  *(undefined8 *)(param_2 + 0xa0) = *(undefined8 *)(param_1 + 0x1c8);
  *(undefined4 *)(param_2 + 0xa8) = *(undefined4 *)(param_1 + 0x1e8);
  *(undefined1 *)(param_2 + 0x91) = *(undefined1 *)(param_1 + 0x700);
  puVar14 = (uint *)0x0;
  puVar13 = puVar14;
  if (*(longlong *)(param_1 + 0x68) != 0) {
    puVar13 = *(uint **)(param_1 + 0x58);
  }
  for (; puVar13 != (uint *)0x0; puVar13 = *(uint **)(puVar13 + 4)) {
    uVar16 = *(uint *)(param_2 + 0x60);
    uVar2 = *puVar13;
    uVar6 = (ulonglong)uVar2 % (ulonglong)uVar16;
    lVar3 = *(longlong *)(param_2 + 0x40);
    if (lVar3 != 0) {
      for (puVar10 = *(uint **)(lVar3 + uVar6 * 8);
          (puVar10 != (uint *)0x0 && ((uint)uVar6 == puVar10[6] % uVar16));
          puVar10 = *(uint **)(puVar10 + 2)) {
        if (*puVar10 == uVar2) goto LAB_14019b0d1;
      }
    }
    uVar6 = (ulonglong)uVar2 % (ulonglong)uVar16;
    if (lVar3 != 0) {
      for (puVar10 = *(uint **)(lVar3 + uVar6 * 8);
          (puVar10 != (uint *)0x0 && ((uint)uVar6 == puVar10[6] % uVar16));
          puVar10 = *(uint **)(puVar10 + 2)) {
        if (*puVar10 == uVar2) goto LAB_14019b0cd;
      }
    }
    puVar10 = (uint *)FUN_140149130(param_2 + 0x38,puVar13,uVar6);
LAB_14019b0cd:
    *(undefined1 *)(puVar10 + 1) = 0;
LAB_14019b0d1:
  }
  puVar13 = puVar14;
  if (0 < *(int *)(param_1 + 600)) {
    do {
      if (((longlong)puVar14 < 0) || (*(int *)(param_1 + 600) <= (int)puVar13)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      puVar10 = (uint *)(*(longlong *)(param_1 + 0x250) + (longlong)puVar14 * 4);
      lVar3 = param_2 + 0x38;
      uVar16 = *puVar10;
      uVar2 = *(uint *)(param_2 + 0x60);
      uVar15 = (ulonglong)uVar2;
      uVar6 = (ulonglong)uVar16 % uVar15;
      lVar4 = *(longlong *)(param_2 + 0x40);
      if (lVar4 != 0) {
        for (puVar11 = *(uint **)(lVar4 + uVar6 * 8);
            (puVar11 != (uint *)0x0 && ((uint)uVar6 == puVar11[6] % uVar2));
            puVar11 = *(uint **)(puVar11 + 2)) {
          if (*puVar11 == uVar16) goto LAB_14019b1ce;
        }
      }
      uVar7 = (ulonglong)uVar16 % uVar15;
      if (lVar4 == 0) {
LAB_14019b18f:
        cVar8 = FUN_140144560(lVar3,uVar15,CONCAT71((int7)(uVar6 >> 8),1),uVar15,uVar17);
        if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
          FUN_14000c6c0(0x8007000e);
        }
      }
      else {
        for (puVar11 = *(uint **)(lVar4 + uVar7 * 8);
            (puVar11 != (uint *)0x0 && ((uint)uVar7 == puVar11[6] % uVar2));
            puVar11 = *(uint **)(puVar11 + 2)) {
          if (*puVar11 == uVar16) goto LAB_14019b1c5;
        }
        if (lVar4 == 0) goto LAB_14019b18f;
      }
      FUN_140193d80(lVar3);
      puVar11 = (uint *)FUN_140146360(lVar3,puVar10,uVar7,uVar16);
      FUN_140193d80(lVar3);
LAB_14019b1c5:
      *(undefined1 *)(puVar11 + 1) = 0;
LAB_14019b1ce:
      uVar16 = (int)puVar13 + 1;
      puVar13 = (uint *)(ulonglong)uVar16;
      puVar14 = (uint *)((longlong)puVar14 + 1);
    } while ((int)uVar16 < *(int *)(param_1 + 600));
  }
  *(undefined1 *)(param_2 + 0x34) = 0;
  *(bool *)(param_2 + 0x90) = *(int *)(param_1 + 0x710) != *(int *)(param_1 + 0x720);
  puVar12 = *(undefined **)(param_2 + 0x98);
  if (*(undefined **)(param_2 + 0x98) == (undefined *)0x0) {
    puVar12 = PTR_DAT_1402f8010;
  }
  *(undefined **)(param_2 + 0x98) = puVar12;
  if (*(undefined **)(param_1 + 0x1f0) != puVar12) {
    uVar17 = FUN_1400a3440();
    FUN_1400a1c30(uVar17);
    FUN_1400031d0(param_2 + 0x98);
    puVar12 = *(undefined **)(param_1 + 0x1f0);
    *(undefined **)(param_2 + 0x98) = puVar12;
    if (((puVar12 != PTR_DAT_1402f8010) && (puVar12 != (undefined *)0x0)) &&
       (puVar12 != (undefined *)0x8)) {
      *(int *)(puVar12 + -4) = *(int *)(puVar12 + -4) + 1;
    }
    FUN_1400d1290(uVar17);
  }
  *(undefined8 *)(param_2 + 0xb0) = *(undefined8 *)(param_1 + 0x30);
  *(undefined8 *)(param_2 + 0xb8) = *(undefined8 *)(param_1 + 0x1e0);
  plVar5 = *(longlong **)(*(longlong *)(param_1 + 0x238) + 0x478);
  uVar9 = (**(code **)(*plVar5 + 0x18))(plVar5,*(undefined4 *)(param_1 + 0x6f8));
  *(undefined4 *)(param_2 + 200) = uVar9;
  *(undefined4 *)(param_2 + 0xc0) = *(undefined4 *)(param_1 + 0x1d8);
  *(undefined4 *)(param_2 + 0xc4) = *(undefined4 *)(param_1 + 0x1dc);
  return;
}



void FUN_14019b300(longlong param_1,longlong param_2,undefined1 param_3)

{
  uint uVar1;
  ulonglong uVar2;
  uint uVar3;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  uVar1 = *(uint *)(param_1 + 0x28);
  uVar2 = (ulonglong)*(uint *)(param_2 + 0x28) % (ulonglong)uVar1;
  if (*(longlong *)(param_1 + 0x20) == 1) {
    *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    *(undefined8 *)(param_1 + 0x10) = 0;
    *(undefined8 *)(param_1 + 0x18) = 0;
  }
  else {
    uVar3 = (uint)uVar2;
    if (((*(longlong *)(param_2 + 0x20) == 0) ||
        (*(uint *)(*(longlong *)(param_2 + 0x20) + 0x28) % uVar1 != uVar3)) &&
       ((*(longlong *)(param_2 + 0x18) == 0 ||
        (*(uint *)(*(longlong *)(param_2 + 0x18) + 0x28) % uVar1 != uVar3)))) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    }
    else if (param_2 == *(longlong *)(*(longlong *)(param_1 + 8) + (longlong)(int)uVar3 * 8)) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = *(undefined8 *)(param_2 + 0x18);
    }
    if (param_2 == *(longlong *)(param_1 + 0x10)) {
      *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(param_2 + 0x18);
      *(undefined8 *)(param_2 + 0x20) = 0;
    }
    if (param_2 == *(longlong *)(param_1 + 0x18)) {
      *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x20);
      *(undefined8 *)(param_2 + 0x18) = 0;
    }
    if (*(longlong *)(param_2 + 0x20) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x20) + 0x18) = *(undefined8 *)(param_2 + 0x18);
    }
    if (*(longlong *)(param_2 + 0x18) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x18) + 0x20) = *(undefined8 *)(param_2 + 0x20);
    }
  }
  FUN_140154820(param_1,param_2,param_3);
  FUN_140144430(param_1);
  return;
}



undefined8 FUN_14019b400(longlong param_1,longlong param_2,undefined1 param_3)

{
  longlong lVar1;
  ulonglong uVar2;
  
  uVar2 = (ulonglong)((uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8)) %
          (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (lVar1 = *(longlong *)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (lVar1 != 0 && ((uint)uVar2 == *(uint *)(lVar1 + 0x28) % *(uint *)(param_1 + 0x28)));
        lVar1 = *(longlong *)(lVar1 + 0x18)) {
      if ((*(uint *)(lVar1 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar1 + 0xc) == *(ushort *)(param_2 + 0xc))) {
        FUN_14019b300(param_1,lVar1,param_3);
        return 1;
      }
    }
  }
  return 0;
}



void FUN_14019b490(longlong param_1)

{
  longlong *plVar1;
  undefined8 *puVar2;
  void *pvVar3;
  longlong *plVar4;
  longlong *plVar5;
  uint uVar6;
  ulonglong uVar7;
  longlong lVar8;
  longlong lVar9;
  float fVar10;
  float fVar11;
  
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
  FUN_1401b2030();
  plVar5 = *(longlong **)(param_1 + 0x10);
  while (plVar5 != (longlong *)0x0) {
    plVar1 = (longlong *)plVar5[2];
    if ((*plVar5 != 0) &&
       (*(longlong *)(*plVar5 + 8) = *(longlong *)(*plVar5 + 8) + -1,
       *(longlong *)(*plVar5 + 8) == 0)) {
      puVar2 = (undefined8 *)*plVar5;
      pvVar3 = (void *)*puVar2;
      if (pvVar3 != (void *)0x0) {
        FUN_140142270(pvVar3);
        operator_delete(pvVar3);
      }
      FUN_1400a3530(puVar2);
    }
    plVar4 = *(longlong **)(param_1 + 0x50);
    if (plVar4 == (longlong *)0x0) {
      FUN_1400a3530(plVar5);
    }
    else {
      (**(code **)(*plVar4 + 0x18))(plVar4,plVar5);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    plVar5 = plVar1;
  }
  FUN_1400a3530(*(undefined8 *)(param_1 + 8));
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  FUN_1401b2030(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar6 = FUN_140142850(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_1400a3530();
      *(undefined8 *)(param_1 + 8) = 0;
    }
    lVar8 = 0;
    *(uint *)(param_1 + 0x28) = uVar6;
    fVar11 = (float)uVar6 * *(float *)(param_1 + 0x34);
    if ((9.223372e+18 < fVar11) && (fVar11 = fVar11 - 9.223372e+18, fVar11 < 9.223372e+18)) {
      lVar8 = -0x8000000000000000;
    }
    fVar10 = (float)uVar6 * *(float *)(param_1 + 0x30);
    lVar9 = 0;
    *(longlong *)(param_1 + 0x38) = (longlong)fVar11 + lVar8;
    if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
      lVar9 = -0x8000000000000000;
    }
    uVar7 = (longlong)fVar10 + lVar9;
    if ((ulonglong)((longlong)fVar10 + lVar9) < 0x11) {
      uVar7 = 0;
    }
    *(ulonglong *)(param_1 + 0x40) = uVar7;
  }
  FUN_1401b2030(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



void FUN_14019b620(void)

{
  FUN_14019b490();
  return;
}



void thunk_FUN_14019b620(void)

{
  FUN_14019b620();
  return;
}



void FUN_14019b650(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  double dVar2;
  undefined8 uVar3;
  undefined4 *puVar4;
  longlong *plVar5;
  undefined4 *puVar6;
  double dVar7;
  longlong *local_res8;
  undefined8 uVar8;
  undefined1 uVar9;
  
  uVar8 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(**(longlong **)(param_1 + 0x238) + 0x58))();
  FUN_1400a1c30(uVar3);
  uVar9 = 1;
  if (DAT_140313fcf != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x238) + 200))
              (*(longlong **)(param_1 + 0x238),L"Proud::CRemoteClient_S::GetP2PGroupTotalRecentPing"
              );
  }
  FUN_14015c5c0(*(undefined8 *)(param_1 + 0x238),&local_res8,param_2,param_4,uVar8,uVar3,uVar9);
  if ((local_res8 != (longlong *)0x0) && (lVar1 = *local_res8, lVar1 != 0)) {
    dVar2 = 0.0;
    puVar6 = (undefined4 *)0x0;
    if (*(longlong *)(lVar1 + 0x28) != 0) {
      puVar6 = *(undefined4 **)(lVar1 + 0x18);
    }
    while( true ) {
      puVar4 = (undefined4 *)0x0;
      if (local_res8 != (longlong *)0x0) {
        puVar4 = (undefined4 *)*local_res8;
      }
      if (puVar6 == (undefined4 *)0x0) break;
      plVar5 = (longlong *)(*(longlong *)(param_1 + 0x238) + 0xa8);
      dVar7 = (double)(**(code **)(*plVar5 + 0xd0))(plVar5,*puVar6);
      if (0.0 <= dVar7) {
        dVar2 = dVar2 + 1.0;
      }
      puVar6 = *(undefined4 **)(puVar6 + 6);
    }
    if ((undefined4 *)(lVar1 + 8) != puVar4 + 2) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    if (0.0 < dVar2) {
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
        lVar1 = *local_res8;
        if (lVar1 != 0) {
          FUN_140149600(lVar1);
          FUN_1400a3530(lVar1);
        }
        FUN_1400a3530(local_res8);
      }
      FUN_1400d1290(uVar3);
      return;
    }
  }
  if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
    lVar1 = *local_res8;
    if (lVar1 != 0) {
      FUN_140149600(lVar1);
      FUN_1400a3530(lVar1);
    }
    FUN_1400a3530(local_res8);
  }
  FUN_1400d1290(uVar3);
  return;
}



longlong * FUN_14019b890(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  uVar3 = 0;
  lVar1 = FUN_1400a34c0(0xd0);
  uVar2 = uVar3;
  if (lVar1 != 0) {
    uVar2 = FUN_1401c1e30(lVar1);
  }
  FUN_140146080(param_2,uVar2,param_3,param_4,uVar4);
  if (*param_2 != 0) {
    uVar3 = *(undefined8 *)(*param_2 + 0x38);
  }
  FUN_14019af80(param_1,uVar3);
  return param_2;
}



undefined8 FUN_14019b910(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined1 local_120 [16];
  undefined1 local_110 [8];
  longlong local_108;
  int local_fc;
  undefined1 local_f0 [232];
  
  if (*(longlong *)(param_1 + 0x278) == 0) {
    uVar1 = 0;
  }
  else {
    uVar1 = FUN_14015f230(param_1 + 0x260,local_120,param_3,param_4,0xfffffffffffffffe);
    FUN_1401a6f30(param_2,uVar1,*(undefined4 *)(param_1 + 0x6f0));
    FUN_14015c350(local_f0);
    FUN_14019a730(local_110);
    if ((local_108 != 0) && (local_fc < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    uVar1 = 1;
  }
  return uVar1;
}



undefined8 * FUN_14019b9b0(undefined8 *param_1,longlong param_2,undefined8 param_3,longlong param_4)

{
  undefined4 uVar1;
  void *pvVar2;
  undefined1 *puVar3;
  undefined1 *puVar4;
  undefined8 uVar5;
  undefined **local_50;
  undefined4 local_48;
  undefined2 local_44;
  
  *param_1 = Proud::ISendDest_S::vftable;
  FUN_1401a7990(param_1 + 1,param_2,param_3,param_4,0xfffffffffffffffe);
  param_1[7] = Proud::ICompletionContext::vftable;
  param_1[0x22] = 0;
  param_1[0x23] = 0;
  param_1[0x24] = 0;
  FUN_14015f700(param_1 + 8);
  param_1[0x14] = Proud::ITcpLayerOwner_S::vftable;
  param_1[0x15] = 0;
  FUN_1401a1410(param_1 + 0x18);
  *param_1 = Proud::CRemoteClient_S::vftable;
  param_1[1] = Proud::CRemoteClient_S::vftable;
  param_1[7] = Proud::CRemoteClient_S::vftable;
  param_1[8] = Proud::CRemoteClient_S::vftable;
  param_1[0x14] = Proud::CRemoteClient_S::vftable;
  param_1[0x18] = Proud::CRemoteClient_S::vftable;
  param_1[0x21] = Proud::CRemoteClient_S::vftable;
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0x25,uVar1,1);
  puVar4 = (undefined1 *)0x0;
  param_1[0x3c] = 0;
  FUN_1400a3440();
  param_1[0x3e] = PTR_DAT_1402f8010;
  param_1[0x40] = 0;
  param_1[0x41] = 0;
  param_1[0x42] = 0;
  param_1[0x43] = 0;
  param_1[0x3f] = Proud::ByteArray::vftable;
  param_1[0x45] = 0;
  param_1[0x48] = Proud::CFastArray<>::vftable;
  param_1[0x49] = 0;
  param_1[0x4a] = 0;
  param_1[0x4b] = 0;
  param_1[0x4c] = 0;
  param_1[0x4d] = 0;
  param_1[0x50] = 0;
  param_1[0x4e] = 0;
  param_1[0x4f] = 0;
  *(undefined4 *)(param_1 + 0xc9) = 0;
  param_1[0xcc] = 0;
  param_1[0xcd] = 0;
  param_1[0xce] = 0;
  param_1[0xcf] = 0;
  param_1[0xcb] = Proud::ByteArray::vftable;
  *(undefined1 *)(param_1 + 0xd0) = 0;
  FUN_1401529c0(param_1 + 0xd4);
  FUN_1401a2dd0(param_1 + 0xe0,param_1);
  param_1[0xea] = 0;
  param_1[0xec] = 0;
  pvVar2 = operator_new(0x140);
  puVar3 = puVar4;
  if (pvVar2 != (void *)0x0) {
    local_50 = Proud::AddrPort::vftable;
    local_48 = *(undefined4 *)(param_4 + 8);
    local_44 = *(undefined2 *)(param_4 + 0xc);
    puVar3 = (undefined1 *)FUN_1401a0fd0(pvVar2,param_1 + 0x14,param_3,&local_50);
  }
  param_1[0xe9] = puVar3;
  *(undefined4 *)(param_1 + 0xed) = 0;
  param_1[0x31] = 0;
  param_1[0x32] = 0;
  param_1[0x2c] = 0;
  uVar5 = (**(code **)(*(longlong *)(param_2 + 0x118) + 8))();
  param_1[0x35] = (double)DAT_1402f8148;
  *(undefined4 *)(param_1 + 0xdf) = 0;
  *(undefined1 *)(param_1 + 0xd3) = 0;
  *(undefined1 *)(param_1 + 0x46) = 0;
  param_1[0x38] = 0;
  param_1[0x39] = 0;
  *(undefined4 *)(param_1 + 0x3d) = 0;
  param_1[0x47] = param_2;
  param_1[0xd2] = uVar5;
  param_1[0x30] = uVar5;
  param_1[0x33] = uVar5;
  param_1[0x34] = uVar5;
  param_1[0x37] = uVar5;
  *(undefined4 *)((longlong)param_1 + 0x68a) = 0;
  *(undefined1 *)(param_1 + 0xd1) = 0;
  param_1[0x36] = 0;
  param_1[0x3c] = 0;
  param_1[0xeb] = 0;
  param_1[0x3a] = 0;
  param_1[0x3b] = 0;
  param_1[0x44] = 0;
  puVar3 = operator_new(0x20);
  if (puVar3 != (undefined1 *)0x0) {
    *(undefined8 *)(puVar3 + 0x18) = 0x3fe2e147ae147ae1;
    *(undefined8 *)(puVar3 + 0x10) = 0;
    *(undefined8 *)(puVar3 + 8) = 0;
    *puVar3 = 0;
    puVar4 = puVar3;
  }
  param_1[0xea] = puVar4;
  FUN_14016a780(param_1 + 0x4d);
  FUN_1401a0fc0(param_1[0xe9],*(undefined1 *)(param_2 + 0x240));
  return param_1;
}



longlong FUN_14019bd40(longlong param_1)

{
  return param_1 + 0x20;
}



void FUN_14019bd50(longlong param_1)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(*(longlong *)(param_1 + 0x48) + 0x10))(param_1 + 0x48);
  FUN_1400a1d50(uVar1);
  return;
}



undefined4 FUN_14019bd70(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x6f8);
}



void FUN_14019bd80(longlong param_1)

{
  FUN_14019bd70(param_1 + -8);
  return;
}



void FUN_14019bd90(longlong param_1)

{
  FUN_14019c260(param_1 + -0x38);
  return;
}



void FUN_14019bda0(longlong param_1)

{
  FUN_14019c260(param_1 + -0x40);
  return;
}



void FUN_14019bdb0(longlong param_1)

{
  FUN_14019c260(param_1 + -0xc0);
  return;
}



void FUN_14019bdc0(longlong param_1)

{
  FUN_140160c20(param_1 + -0x38);
  return;
}



void FUN_14019bdd0(longlong param_1)

{
  FUN_14019c260(param_1 + -8);
  return;
}



void FUN_14019bde0(longlong param_1)

{
  FUN_14019c260(param_1 + -0x108);
  return;
}



void FUN_14019bdf0(longlong param_1)

{
  FUN_14019bd70(param_1 + -0x40);
  return;
}



void FUN_14019be00(undefined8 *param_1)

{
  longlong *plVar1;
  void *pvVar2;
  undefined8 *puVar3;
  longlong lVar4;
  undefined8 local_res10;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  *param_1 = Proud::CRemoteClient_S::vftable;
  param_1[1] = Proud::CRemoteClient_S::vftable;
  param_1[7] = Proud::CRemoteClient_S::vftable;
  param_1[8] = Proud::CRemoteClient_S::vftable;
  param_1[0x14] = Proud::CRemoteClient_S::vftable;
  param_1[0x18] = Proud::CRemoteClient_S::vftable;
  param_1[0x21] = Proud::CRemoteClient_S::vftable;
  FUN_14019b490(param_1 + 0xd4);
  if (param_1[0x24] != 0) {
    FUN_140142680(param_1[0x24],param_1);
  }
  if (param_1[4] != 0) {
    FUN_14018a320();
  }
  plVar1 = (longlong *)param_1[0xec];
  if ((plVar1 != (longlong *)0x0) && (*plVar1 != 0)) {
    if (plVar1 == (longlong *)0x0) {
      lVar4 = 0;
    }
    else {
      lVar4 = *plVar1;
    }
    FUN_14019b400(param_1[0x47] + 0x6f0,lVar4 + 0x158,0);
    if (0 < *(int *)(param_1 + 0xed)) {
      FUN_140021a40(param_1[0x47] + 0x1848,*(undefined4 *)(param_1[0x47] + 0x1860),param_1 + 0xed,1,
                    uVar5);
    }
    local_res10 = 0;
    FUN_14016b650(param_1 + 0xec,&local_res10);
  }
  pvVar2 = (void *)param_1[0xe9];
  if (pvVar2 != (void *)0x0) {
    FUN_1401a10a0(pvVar2);
    operator_delete(pvVar2);
  }
  FUN_14015f4c0(param_1 + 0x4d);
  if ((param_1[0xec] != 0) &&
     (*(longlong *)(param_1[0xec] + 8) = *(longlong *)(param_1[0xec] + 8) + -1,
     *(longlong *)(param_1[0xec] + 8) == 0)) {
    plVar1 = (longlong *)param_1[0xec];
    puVar3 = (undefined8 *)*plVar1;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    FUN_1400a3530(plVar1);
  }
  if ((void *)param_1[0xea] != (void *)0x0) {
    operator_delete((void *)param_1[0xea]);
  }
  FUN_1401a2e80(param_1 + 0xe0);
  FUN_14019b620(param_1 + 0xd4);
  FUN_140140df0(param_1 + 0xcb);
  FUN_14015f4c0(param_1 + 0x4d);
  puVar3 = (undefined8 *)param_1[0x4d];
  if (puVar3 != (undefined8 *)0x0) {
    (**(code **)*puVar3)(puVar3,1);
  }
  param_1[0x48] = Proud::CFastArray<>::vftable;
  if (param_1[0x4a] != 0) {
    plVar1 = (longlong *)param_1[0x49];
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[0x4a]);
    }
  }
  pvVar2 = (void *)param_1[0x45];
  if (pvVar2 != (void *)0x0) {
    FUN_140140df0((longlong)pvVar2 + 8);
    operator_delete(pvVar2);
  }
  FUN_140140df0(param_1 + 0x3f);
  FUN_1400031d0(param_1 + 0x3e);
  FUN_1400a1cd0(param_1 + 0x25);
  param_1[0x21] = Proud::ISendIssueObject::vftable;
  FUN_1401a1430(param_1 + 0x18);
  param_1[8] = Proud::CP2PGroupMemberBase_S::vftable;
  FUN_14015f210(param_1 + 9);
  if (param_1[0x24] != 0) {
    FUN_140142680(param_1[0x24],param_1);
  }
  param_1[7] = Proud::ICompletionContext::vftable;
  FUN_1401a7910(param_1 + 1);
  *param_1 = Proud::ISendDest_S::vftable;
  return;
}



void FUN_14019c0f0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  undefined1 local_128 [8];
  undefined1 local_120 [8];
  longlong local_118;
  int local_10c;
  undefined1 local_100 [232];
  
  uVar3 = 0xfffffffffffffffe;
  if ((*(longlong *)(param_1 + 0x238) != 0) &&
     (*(longlong *)(*(longlong *)(param_1 + 0x238) + 0x3e0) != 0)) {
    FUN_140185560(local_128);
    FUN_14015de40(local_100,param_2,param_3,param_4,uVar3);
    uVar3 = *(undefined8 *)(param_1 + 0x278);
    plVar1 = *(longlong **)(param_1 + 0x268);
    if (plVar1 == (longlong *)0x0) {
      puVar2 = (undefined8 *)FUN_1400a34c0(0x128);
    }
    else {
      puVar2 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,0x128);
    }
    if (puVar2 != (undefined8 *)0x0) {
      *(undefined4 *)(puVar2 + 2) = 0;
      FUN_140185590(puVar2 + 3,local_128);
      FUN_14015de40(puVar2 + 8,local_100);
    }
    puVar2[1] = uVar3;
    *puVar2 = 0;
    *(longlong *)(param_1 + 0x280) = *(longlong *)(param_1 + 0x280) + 1;
    if (*(undefined8 **)(param_1 + 0x278) == (undefined8 *)0x0) {
      *(undefined8 **)(param_1 + 0x270) = puVar2;
    }
    else {
      **(undefined8 **)(param_1 + 0x278) = puVar2;
    }
    *(undefined8 **)(param_1 + 0x278) = puVar2;
    FUN_14015c350(local_100);
    FUN_14019a730(local_120);
    if ((local_118 != 0) && (local_10c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_1401a76f0(*(longlong *)(*(longlong *)(param_1 + 0x238) + 0x3e0) + 0x160,param_1 + 8);
  }
  return;
}



undefined8 FUN_14019c260(undefined8 param_1,uint param_2)

{
  FUN_14019be00();
  if ((param_2 & 1) != 0) {
    FUN_1400a3530(param_1);
  }
  return param_1;
}



undefined2 FUN_14019c290(undefined1 param_1,undefined1 param_2)

{
  return CONCAT11(param_1,param_2);
}



void FUN_14019c2a0(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if ((longlong *)param_2[2] != param_1) {
    FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                  L"Proud::CListNode<class Proud::UdpPacketCtx>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  plVar1 = (longlong *)param_2[1];
  lVar2 = *param_2;
  if (plVar1 != (longlong *)0x0) {
    *plVar1 = lVar2;
  }
  if (lVar2 != 0) {
    *(longlong **)(lVar2 + 8) = plVar1;
  }
  if (plVar1 == (longlong *)0x0) {
    if ((longlong *)param_1[1] != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::UdpPacketCtx>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if ((longlong *)*param_1 != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::UdpPacketCtx>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    *param_1 = (longlong)plVar1;
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  *(int *)(param_1 + 2) = (int)param_1[2] + -1;
  return;
}



void FUN_14019c380(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if ((longlong *)param_2[2] != param_1) {
    FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                  L"Proud::CListNode<class Proud::CUdpPacketFragBoard::CPacketQueue>::CListOwner::Erase"
                 );
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  plVar1 = (longlong *)param_2[1];
  lVar2 = *param_2;
  if (plVar1 != (longlong *)0x0) {
    *plVar1 = lVar2;
  }
  if (lVar2 != 0) {
    *(longlong **)(lVar2 + 8) = plVar1;
  }
  if (plVar1 == (longlong *)0x0) {
    if ((longlong *)param_1[1] != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::CUdpPacketFragBoard::CPacketQueue>::CListOwner::Erase"
                   );
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if ((longlong *)*param_1 != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::CUdpPacketFragBoard::CPacketQueue>::CListOwner::Erase"
                   );
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    *param_1 = (longlong)plVar1;
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  *(int *)(param_1 + 2) = (int)param_1[2] + -1;
  return;
}



bool FUN_14019c460(longlong param_1,undefined8 param_2)

{
  char cVar1;
  
  if (*(int *)(param_1 + 0x158) + *(int *)(param_1 + 0x140) + *(int *)(param_1 + 0x120) +
      *(int *)(param_1 + 0x108) + *(int *)(param_1 + 0xe8) + *(int *)(param_1 + 0xd0) +
      *(int *)(param_1 + 0xb0) + *(int *)(param_1 + 0x98) + *(int *)(param_1 + 0x78) +
      *(int *)(param_1 + 0x60) + *(int *)(param_1 + 0x40) + *(int *)(param_1 + 0x28) +
      *(int *)(param_1 + 0x1b0) == 0) {
    return false;
  }
  if (*(char *)(*(longlong *)(param_1 + 400) + 0x88) == '\0') {
    return true;
  }
  cVar1 = FUN_1401c1f20(param_1 + 0x1d8,param_2,*(undefined8 *)(param_1 + 0x208));
  return cVar1 == '\0';
}



void FUN_14019c500(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_14019c2a0(*(longlong *)(param_1 + 0x10),param_1);
  }
  return;
}



void FUN_14019c520(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_14019c380(*(longlong *)(param_1 + 0x10),param_1);
  }
  return;
}



void FUN_14019c540(undefined8 *param_1,undefined8 *param_2)

{
  if (param_2[2] != 0) {
    FUN_14019c2a0();
  }
  if (param_1[1] == 0) {
    *param_1 = param_2;
  }
  else {
    *(undefined8 **)(param_1[1] + 8) = param_2;
    *param_2 = param_1[1];
  }
  param_1[1] = param_2;
  param_2[2] = param_1;
  *(int *)(param_1 + 2) = *(int *)(param_1 + 2) + 1;
  return;
}



void FUN_14019c590(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x00014019c5b7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



void FUN_14019c5d0(undefined8 *param_1,undefined8 *param_2)

{
  if (param_2[2] != 0) {
    FUN_14019c380();
  }
  if (param_1[1] == 0) {
    *param_1 = param_2;
  }
  else {
    *(undefined8 **)(param_1[1] + 8) = param_2;
    *param_2 = param_1[1];
  }
  param_1[1] = param_2;
  param_2[2] = param_1;
  *(int *)(param_1 + 2) = *(int *)(param_1 + 2) + 1;
  return;
}



void FUN_14019c620(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<bool,1>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x00014019c647. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



longlong FUN_14019c660(longlong param_1,longlong param_2)

{
  ulonglong uVar1;
  longlong lVar2;
  
  uVar1 = (ulonglong)((uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8)) %
          (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + uVar1 * 8);
        (lVar2 != 0 && ((uint)uVar1 == *(uint *)(lVar2 + 0x28) % *(uint *)(param_1 + 0x28)));
        lVar2 = *(longlong *)(lVar2 + 0x18)) {
      if ((*(uint *)(lVar2 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar2 + 0xc) == *(ushort *)(param_2 + 0xc))) {
        return lVar2;
      }
    }
  }
  return 0;
}



undefined8 * FUN_14019c6c0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_14019c720(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<bool,1>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14019c780(undefined8 *param_1,longlong param_2,longlong param_3)

{
  longlong lVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  longlong lVar4;
  undefined8 *puVar5;
  longlong lVar6;
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (-1 < param_3) {
    param_1[3] = param_3;
  }
  if (param_2 == 0) {
    if ((100 < (ulonglong)param_1[2]) && ((void *)*param_1 != (void *)0x0)) {
      operator_delete__((void *)*param_1);
      *param_1 = 0;
    }
    param_1[2] = 100;
    param_1[1] = 0;
    return;
  }
  lVar4 = param_1[2];
  if (param_2 <= lVar4) {
    param_1[1] = param_2;
    return;
  }
  lVar1 = param_1[3];
  if (lVar1 == 0) {
    lVar1 = (longlong)(param_1[1] + (ulonglong)((uint)((longlong)param_1[1] >> 0x3f) & 7)) >> 3;
    if (lVar1 < 4) {
      lVar1 = 4;
    }
    else if (0x400 < lVar1) {
      lVar1 = 0x400;
    }
  }
  lVar6 = param_2;
  if (param_2 < lVar1 + lVar4) {
    lVar6 = lVar1 + lVar4;
  }
  if (lVar6 < lVar4) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  puVar2 = operator_new(lVar6 << 4);
  puVar5 = param_1 + 4;
  if (100 < (ulonglong)param_1[2]) {
    puVar5 = (undefined8 *)*param_1;
  }
  lVar4 = param_1[1];
  if (0 < lVar4) {
    puVar3 = puVar2;
    do {
      lVar4 = lVar4 + -1;
      *puVar3 = *(undefined8 *)(((longlong)puVar5 - (longlong)puVar2) + (longlong)puVar3);
      puVar3[1] = *(undefined8 *)
                   (((longlong)puVar5 - (longlong)puVar2) + -8 + (longlong)(puVar3 + 2));
      puVar3 = puVar3 + 2;
    } while (lVar4 != 0);
  }
  memset(puVar2 + param_1[1] * 2,0,(param_2 - param_1[1]) * 0x10);
  if (100 < (ulonglong)param_1[2]) {
    operator_delete__(puVar5);
  }
  *param_1 = puVar2;
  param_1[2] = lVar6;
  param_1[1] = param_2;
  return;
}



void FUN_14019c8f0(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined1 local_58 [88];
  
  lVar1 = *param_1;
  while( true ) {
    if (lVar1 == 0) {
      return;
    }
    plVar2 = (longlong *)*param_1;
    if ((longlong *)plVar2[2] != param_1) break;
    plVar3 = (longlong *)plVar2[1];
    lVar1 = *plVar2;
    if (plVar3 != (longlong *)0x0) {
      *plVar3 = lVar1;
    }
    if (lVar1 != 0) {
      *(longlong **)(lVar1 + 8) = plVar3;
    }
    if (plVar3 == (longlong *)0x0) {
      if ((longlong *)param_1[1] != plVar2) {
        FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                      L"Proud::CListNode<class Proud::UdpPacketCtx>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      param_1[1] = lVar1;
    }
    if (lVar1 == 0) {
      if ((longlong *)*param_1 != plVar2) {
        FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                      L"Proud::CListNode<class Proud::UdpPacketCtx>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      *param_1 = (longlong)plVar3;
    }
    *plVar2 = 0;
    plVar2[1] = 0;
    plVar2[2] = 0;
    *(int *)(param_1 + 2) = (int)param_1[2] + -1;
    lVar1 = *param_1;
  }
  FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                L"Proud::CListNode<class Proud::UdpPacketCtx>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_14019c9e0(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined1 local_58 [88];
  
  lVar1 = *param_1;
  while( true ) {
    if (lVar1 == 0) {
      return;
    }
    plVar2 = (longlong *)*param_1;
    if ((longlong *)plVar2[2] != param_1) break;
    plVar3 = (longlong *)plVar2[1];
    lVar1 = *plVar2;
    if (plVar3 != (longlong *)0x0) {
      *plVar3 = lVar1;
    }
    if (lVar1 != 0) {
      *(longlong **)(lVar1 + 8) = plVar3;
    }
    if (plVar3 == (longlong *)0x0) {
      if ((longlong *)param_1[1] != plVar2) {
        FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                      L"Proud::CListNode<class Proud::CUdpPacketFragBoard::CPacketQueue>::CListOwner::Erase"
                     );
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      param_1[1] = lVar1;
    }
    if (lVar1 == 0) {
      if ((longlong *)*param_1 != plVar2) {
        FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                      L"Proud::CListNode<class Proud::CUdpPacketFragBoard::CPacketQueue>::CListOwner::Erase"
                     );
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      *param_1 = (longlong)plVar3;
    }
    *plVar2 = 0;
    plVar2[1] = 0;
    plVar2[2] = 0;
    *(int *)(param_1 + 2) = (int)param_1[2] + -1;
    lVar1 = *param_1;
  }
  FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                L"Proud::CListNode<class Proud::CUdpPacketFragBoard::CPacketQueue>::CListOwner::Erase"
               );
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_14019cad0(longlong param_1)

{
  FUN_140144560(param_1 + 0x20,3,1);
  return;
}



void FUN_14019caf0(undefined8 *param_1,undefined8 *param_2,undefined8 param_3)

{
  char cVar1;
  
  if (param_2[2] == 0) {
    cVar1 = FUN_14019c460(param_2,param_3);
    if (cVar1 != '\0') {
      if (param_2[2] != 0) {
        FUN_14019c380(param_1,param_2);
      }
      if (param_1[1] == 0) {
        *param_1 = param_2;
      }
      else {
        *(undefined8 **)(param_1[1] + 8) = param_2;
        *param_2 = param_1[1];
      }
      param_1[1] = param_2;
      param_2[2] = param_1;
      *(int *)(param_1 + 2) = *(int *)(param_1 + 2) + 1;
    }
  }
  return;
}



int FUN_14019cb60(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  ulonglong uVar3;
  longlong *plVar4;
  int iVar5;
  
  iVar5 = 0;
  plVar4 = (longlong *)(param_1 + 0x18);
  uVar3 = 0;
  do {
    if (5 < uVar3) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    iVar2 = 0;
    for (lVar1 = *plVar4; lVar1 != 0; lVar1 = *(longlong *)(lVar1 + 8)) {
      iVar2 = iVar2 + *(int *)(lVar1 + 0x30);
    }
    for (lVar1 = plVar4[3]; lVar1 != 0; lVar1 = *(longlong *)(lVar1 + 8)) {
      iVar2 = iVar2 + *(int *)(lVar1 + 0x30);
    }
    uVar3 = uVar3 + 1;
    iVar5 = iVar5 + iVar2;
    plVar4 = plVar4 + 7;
  } while ((longlong)uVar3 < 6);
  if (0 < *(int *)(param_1 + 0x1c0)) {
    iVar5 = iVar5 + (*(int *)(param_1 + 0x1c0) - *(int *)(param_1 + 0x1c8));
  }
  return iVar5;
}



ulonglong FUN_14019cbe0(longlong param_1,longlong param_2)

{
  uint uVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  uVar1 = *(uint *)(param_1 + 0x30);
  uVar2 = (ulonglong)((uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8));
  uVar3 = uVar2 / uVar1;
  uVar2 = uVar2 % (ulonglong)uVar1;
  if (*(longlong *)(param_1 + 0x10) != 0) {
    for (lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x10) + uVar2 * 8);
        (lVar4 != 0 &&
        (uVar3 = (ulonglong)*(uint *)(lVar4 + 0x28) / (ulonglong)uVar1,
        (uint)uVar2 == *(uint *)(lVar4 + 0x28) % uVar1)); lVar4 = *(longlong *)(lVar4 + 0x18)) {
      if ((*(uint *)(lVar4 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar4 + 0xc) == *(ushort *)(param_2 + 0xc))) {
        return *(ulonglong *)(lVar4 + 0x10);
      }
    }
  }
  return uVar3;
}



void thunk_FUN_14019c8f0(void)

{
  FUN_14019c8f0();
  return;
}



void thunk_FUN_14019c9e0(void)

{
  FUN_14019c9e0();
  return;
}



int FUN_14019cc60(longlong param_1,longlong param_2)

{
  ulonglong uVar1;
  longlong lVar2;
  
  uVar1 = (ulonglong)((uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8)) %
          (ulonglong)*(uint *)(param_1 + 0x48);
  if (*(longlong *)(param_1 + 0x28) != 0) {
    for (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x28) + uVar1 * 8);
        (lVar2 != 0 && ((uint)uVar1 == *(uint *)(lVar2 + 0x28) % *(uint *)(param_1 + 0x48)));
        lVar2 = *(longlong *)(lVar2 + 0x18)) {
      if ((*(uint *)(lVar2 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar2 + 0xc) == *(ushort *)(param_2 + 0xc))) {
        lVar2 = *(longlong *)(lVar2 + 0x10);
        return *(int *)(lVar2 + 0x1b0) +
               *(int *)(lVar2 + 0x158) + *(int *)(lVar2 + 0x140) + *(int *)(lVar2 + 0x120) +
               *(int *)(lVar2 + 0x108) + *(int *)(lVar2 + 0xe8) + *(int *)(lVar2 + 0xd0) +
               *(int *)(lVar2 + 0xb0) + *(int *)(lVar2 + 0x98) + *(int *)(lVar2 + 0x78) +
               *(int *)(lVar2 + 0x60) + *(int *)(lVar2 + 0x40) + *(int *)(lVar2 + 0x28);
      }
    }
  }
  return 0;
}



ulonglong FUN_14019cd00(longlong param_1,longlong param_2,undefined8 param_3)

{
  uint uVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  uVar1 = *(uint *)(param_1 + 0x48);
  uVar2 = (ulonglong)((uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8));
  uVar3 = uVar2 / uVar1;
  uVar2 = uVar2 % (ulonglong)uVar1;
  if (*(longlong *)(param_1 + 0x28) != 0) {
    lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x28) + uVar2 * 8);
    while( true ) {
      if (lVar4 == 0) {
        return uVar3;
      }
      uVar3 = (ulonglong)*(uint *)(lVar4 + 0x28) / (ulonglong)uVar1;
      if ((uint)uVar2 != *(uint *)(lVar4 + 0x28) % uVar1) {
        return uVar3;
      }
      if ((*(uint *)(lVar4 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar4 + 0xc) == *(ushort *)(param_2 + 0xc))) break;
      lVar4 = *(longlong *)(lVar4 + 0x18);
    }
    uVar3 = *(ulonglong *)(lVar4 + 0x10);
    *(undefined8 *)(uVar3 + 0x210) = param_3;
  }
  return uVar3;
}



undefined8 FUN_14019cd60(longlong param_1,longlong param_2)

{
  ulonglong uVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  uVar1 = (ulonglong)((uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8)) %
          (ulonglong)*(uint *)(param_1 + 0x48);
  if (*(longlong *)(param_1 + 0x28) != 0) {
    for (lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x28) + uVar1 * 8);
        (lVar3 != 0 && ((uint)uVar1 == *(uint *)(lVar3 + 0x28) % *(uint *)(param_1 + 0x48)));
        lVar3 = *(longlong *)(lVar3 + 0x18)) {
      if ((*(uint *)(lVar3 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar3 + 0xc) == *(ushort *)(param_2 + 0xc))) {
        uVar2 = FUN_14019cb60(*(undefined8 *)(lVar3 + 0x10));
        return uVar2;
      }
    }
  }
  return 0;
}



void FUN_14019cde0(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  
  iVar1 = *(int *)(param_1 + 0x1b0);
  uVar4 = 0;
  uVar5 = uVar4;
  if (0 < (longlong)iVar1) {
    do {
      if (((longlong)uVar4 < 0) || (*(int *)(param_1 + 0x1b0) <= (int)uVar5)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      lVar2 = *(longlong *)(param_1 + 400);
      lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x1a8) + uVar4 * 8);
      if ((*(short *)(lVar3 + -8) != 0x1de6) || (*(longlong *)(lVar3 + 0x50) != 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      uVar4 = uVar4 + 1;
      *(undefined8 *)(lVar3 + 0x50) = *(undefined8 *)(lVar2 + 0x80);
      *(short **)(lVar2 + 0x80) = (short *)(lVar3 + -8);
      uVar5 = (ulonglong)((int)uVar5 + 1);
    } while ((longlong)uVar4 < (longlong)iVar1);
  }
  FUN_1401a7e40(param_1 + 0x198,0);
  return;
}



void FUN_14019ce70(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  lVar2 = *param_1;
  while( true ) {
    if (lVar2 == 0) {
      while( true ) {
        lVar2 = param_1[3];
        if (lVar2 == 0) {
          FUN_14019c8f0(param_1 + 3);
          FUN_14019c8f0(param_1);
          return;
        }
        if (*(longlong *)(lVar2 + 0x10) != 0) {
          FUN_14019c2a0(*(longlong *)(lVar2 + 0x10),lVar2,param_3,param_4,uVar3);
        }
        lVar1 = *(longlong *)(param_1[6] + 400);
        if ((*(short *)(lVar2 + -8) != 0x1de6) || (*(longlong *)(lVar2 + 0x50) != 0)) break;
        *(undefined8 *)(lVar2 + 0x50) = *(undefined8 *)(lVar1 + 0x80);
        *(short **)(lVar1 + 0x80) = (short *)(lVar2 + -8);
      }
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (*(longlong *)(lVar2 + 0x10) != 0) {
      FUN_14019c2a0(*(longlong *)(lVar2 + 0x10),lVar2,param_3,param_4,uVar3);
    }
    lVar1 = *(longlong *)(param_1[6] + 400);
    if ((*(short *)(lVar2 + -8) != 0x1de6) || (*(longlong *)(lVar2 + 0x50) != 0)) break;
    *(undefined8 *)(lVar2 + 0x50) = *(undefined8 *)(lVar1 + 0x80);
    *(short **)(lVar1 + 0x80) = (short *)(lVar2 + -8);
    lVar2 = *param_1;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_14019cf60(undefined8 *param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  
  if (param_1[0xce] != 0) {
    iVar1 = *(int *)(param_1 + 0xd2);
    lVar4 = 0;
    if (0 < (longlong)iVar1) {
      do {
        if (*(int *)(param_1 + 0xd2) == 0) {
          lVar3 = 0;
        }
        else {
          lVar3 = param_1[0xd1];
        }
        lVar3 = *(longlong *)(lVar3 + lVar4 * 8);
        lVar2 = param_1[0xce];
        if ((*(short *)(lVar3 + -8) != 0x1de6) || (*(longlong *)(lVar3 + 0x50) != 0)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        lVar4 = lVar4 + 1;
        *(undefined8 *)(lVar3 + 0x50) = *(undefined8 *)(lVar2 + 0x80);
        *(short **)(lVar2 + 0x80) = (short *)(lVar3 + -8);
      } while (lVar4 < iVar1);
    }
  }
  FUN_1401a7e40(param_1 + 0xcf,0);
  if ((100 < (ulonglong)param_1[2]) && ((void *)*param_1 != (void *)0x0)) {
    operator_delete__((void *)*param_1);
    *param_1 = 0;
  }
  param_1[1] = 0;
  param_1[2] = 100;
  *(undefined4 *)(param_1 + 0xd5) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_1 + 0x6ac) = DAT_1402f83d4;
  param_1[0xce] = 0;
  *(undefined4 *)(param_1 + 0xd6) = 0xffffffff;
  return;
}



undefined2 * FUN_14019d060(longlong *param_1)

{
  longlong lVar1;
  undefined2 *puVar2;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    *param_1 = *(longlong *)(lVar1 + 0x58);
    *(undefined8 *)(lVar1 + 0x58) = 0;
    return (undefined2 *)(lVar1 + 8);
  }
  puVar2 = (undefined2 *)FUN_1400a34c0();
  if (puVar2 != (undefined2 *)0x0) {
    *(undefined8 *)(puVar2 + 4) = 0;
    *(undefined8 *)(puVar2 + 8) = 0;
    *(undefined8 *)(puVar2 + 0xc) = 0;
    *(undefined8 *)(puVar2 + 0x14) = 0;
    *(undefined8 *)(puVar2 + 0x18) = 0;
    *(undefined8 *)(puVar2 + 0x1c) = 0;
    *(undefined8 *)(puVar2 + 0x20) = 0;
    *(undefined ***)(puVar2 + 0x10) = Proud::ByteArray::vftable;
    *(undefined4 *)(puVar2 + 0x28) = 0xffffffff;
    *(undefined4 *)(puVar2 + 0x2a) = 0;
    *(undefined8 *)(puVar2 + 0x2c) = 0;
    *puVar2 = 0x1de6;
    return puVar2 + 4;
  }
  return (undefined2 *)0x8;
}



undefined2 * FUN_14019d0f0(longlong *param_1)

{
  longlong lVar1;
  undefined2 *puVar2;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    *param_1 = *(longlong *)(lVar1 + 0x68);
    *(undefined8 *)(lVar1 + 0x68) = 0;
    return (undefined2 *)(lVar1 + 8);
  }
  puVar2 = (undefined2 *)FUN_1400a34c0(0x70);
  if (puVar2 != (undefined2 *)0x0) {
    *(undefined ***)(puVar2 + 4) = Proud::CFastArray<bool,1>::vftable;
    *(undefined8 *)(puVar2 + 8) = 0;
    *(undefined8 *)(puVar2 + 0xc) = 0;
    *(undefined8 *)(puVar2 + 0x10) = 0;
    *(undefined8 *)(puVar2 + 0x14) = 0;
    *(undefined ***)(puVar2 + 0x18) = Proud::CFastArray<>::vftable;
    *(undefined8 *)(puVar2 + 0x1c) = 0;
    *(undefined8 *)(puVar2 + 0x20) = 0;
    *(undefined8 *)(puVar2 + 0x24) = 0;
    *(undefined8 *)(puVar2 + 0x28) = 0;
    *(undefined4 *)(puVar2 + 0x2c) = 0;
    *(undefined8 *)(puVar2 + 0x30) = 0;
    *puVar2 = 0x1de6;
    *(undefined8 *)(puVar2 + 0x34) = 0;
    return puVar2 + 4;
  }
  return (undefined2 *)0x8;
}



void FUN_14019d190(longlong param_1)

{
  longlong *plVar1;
  uint uVar2;
  ulonglong uVar3;
  longlong lVar4;
  longlong lVar5;
  float fVar6;
  float fVar7;
  
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
  FUN_1401b2030();
  lVar4 = *(longlong *)(param_1 + 0x10);
  while (lVar4 != 0) {
    plVar1 = *(longlong **)(param_1 + 0x50);
    lVar5 = *(longlong *)(lVar4 + 0x10);
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar4);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar4 = lVar5;
  }
  FUN_1400a3530(*(undefined8 *)(param_1 + 8));
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  FUN_1401b2030(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar2 = FUN_140142850(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_1400a3530();
      *(undefined8 *)(param_1 + 8) = 0;
    }
    lVar4 = 0;
    *(uint *)(param_1 + 0x28) = uVar2;
    fVar7 = (float)uVar2 * *(float *)(param_1 + 0x34);
    if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
      lVar4 = -0x8000000000000000;
    }
    fVar6 = (float)uVar2 * *(float *)(param_1 + 0x30);
    lVar5 = 0;
    *(longlong *)(param_1 + 0x38) = (longlong)fVar7 + lVar4;
    if ((9.223372e+18 < fVar6) && (fVar6 = fVar6 - 9.223372e+18, fVar6 < 9.223372e+18)) {
      lVar5 = -0x8000000000000000;
    }
    uVar3 = (longlong)fVar6 + lVar5;
    if ((ulonglong)((longlong)fVar6 + lVar5) < 0x11) {
      uVar3 = 0;
    }
    *(ulonglong *)(param_1 + 0x40) = uVar3;
  }
  FUN_1401b2030(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



undefined4 * FUN_14019d2c0(longlong param_1,undefined4 *param_2,uint param_3,undefined4 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined4 uVar4;
  undefined4 *puVar5;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    puVar5 = (undefined4 *)FUN_1400a34c0(0x28);
  }
  else {
    puVar5 = (undefined4 *)(**(code **)(*plVar1 + 8))(plVar1,0x28);
  }
  if (puVar5 != (undefined4 *)0x0) {
    uVar4 = *param_2;
    puVar5[8] = param_4;
    *puVar5 = uVar4;
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8);
  FUN_1401b2030(param_1);
  if (*(longlong *)(param_1 + 0x20) == 0) {
    *(undefined4 **)(param_1 + 0x10) = puVar5;
    *(undefined4 **)(param_1 + 0x18) = puVar5;
    *(undefined8 *)(puVar5 + 6) = 0;
    *(undefined8 *)(puVar5 + 4) = 0;
  }
  else {
    FUN_1401b2030(param_1);
    FUN_1401b2030(param_1);
    if (lVar2 == 0) {
      lVar2 = *(longlong *)(param_1 + 0x10);
      *(undefined8 *)(puVar5 + 6) = 0;
      *(longlong *)(puVar5 + 4) = lVar2;
      if (lVar2 != 0) {
        *(undefined4 **)(lVar2 + 0x18) = puVar5;
      }
      *(undefined4 **)(param_1 + 0x10) = puVar5;
    }
    else {
      if (*(longlong *)(lVar2 + 0x18) == 0) {
        *(undefined4 **)(param_1 + 0x10) = puVar5;
      }
      else {
        *(undefined4 **)(*(longlong *)(lVar2 + 0x18) + 0x10) = puVar5;
      }
      uVar3 = *(undefined8 *)(lVar2 + 0x18);
      *(longlong *)(puVar5 + 4) = lVar2;
      *(undefined8 *)(puVar5 + 6) = uVar3;
      *(undefined4 **)(lVar2 + 0x18) = puVar5;
    }
  }
  *(undefined4 **)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8) = puVar5;
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  FUN_1401b2030(param_1);
  FUN_1401b2030(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar4 = FUN_140142850(param_1);
    FUN_1401b2490(param_1,uVar4);
  }
  FUN_1401b2030(param_1);
  return puVar5;
}



void FUN_14019d400(longlong *param_1,longlong param_2,undefined4 param_3)

{
  longlong lVar1;
  undefined4 uStack_14;
  
  lVar1 = param_1[1];
  if (lVar1 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_14019c780(param_1,lVar1 + 1,0xffffffffffffffff);
  if (lVar1 < param_1[1]) {
    if ((ulonglong)param_1[2] < 0x65) {
      param_1 = param_1 + (lVar1 + 2) * 2;
    }
    else {
      param_1 = (longlong *)(lVar1 * 0x10 + *param_1);
    }
    *param_1 = CONCAT44(uStack_14,param_3);
    param_1[1] = param_2;
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



undefined8 FUN_14019d480(void)

{
  undefined8 uVar1;
  
  FUN_1400a1c30(&DAT_140319128);
  uVar1 = FUN_14019d0f0(DAT_140319120);
  FUN_1400d1290(&DAT_140319128);
  return uVar1;
}



void FUN_14019d4e0(longlong *param_1,undefined8 param_2)

{
  longlong *plVar1;
  char cVar2;
  longlong lVar3;
  
  if (param_1[8] == 0) {
    lVar3 = 0;
  }
  else {
    lVar3 = param_1[6];
  }
  do {
    while( true ) {
      if (lVar3 == 0) {
        return;
      }
      plVar1 = *(longlong **)(lVar3 + 0x10);
      if ((plVar1[2] == 0) && (cVar2 = FUN_14019c460(plVar1,param_2), cVar2 != '\0')) break;
LAB_14019d575:
      lVar3 = *(longlong *)(lVar3 + 0x18);
    }
    if (plVar1[2] != 0) {
      FUN_14019c380(param_1,plVar1);
    }
    if (param_1[1] != 0) {
      *(longlong **)(param_1[1] + 8) = plVar1;
      *plVar1 = param_1[1];
      param_1[1] = (longlong)plVar1;
      plVar1[2] = (longlong)param_1;
      *(int *)(param_1 + 2) = (int)param_1[2] + 1;
      goto LAB_14019d575;
    }
    *param_1 = (longlong)plVar1;
    param_1[1] = (longlong)plVar1;
    plVar1[2] = (longlong)param_1;
    *(int *)(param_1 + 2) = (int)param_1[2] + 1;
    lVar3 = *(longlong *)(lVar3 + 0x18);
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x00014019daf9)
// WARNING: Removing unreachable block (ram,0x00014019db00)
// WARNING: Removing unreachable block (ram,0x00014019db0f)

void FUN_14019d590(longlong param_1,undefined8 param_2,longlong *param_3)

{
  undefined4 uVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 uVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  int iVar7;
  uint uVar8;
  longlong *plVar9;
  undefined8 *puVar10;
  int iVar11;
  size_t _Size;
  ulonglong uVar12;
  int iVar13;
  int iVar14;
  longlong local_res20;
  undefined8 local_a8;
  undefined1 local_98 [96];
  
  puVar6 = (undefined8 *)0x0;
  plVar9 = (longlong *)(param_1 + 0x30);
  puVar5 = puVar6;
  do {
    if (((longlong)puVar5 < 0) || (5 < (longlong)puVar5)) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    lVar2 = *plVar9;
    if (lVar2 != 0) {
      FUN_14019cf60(param_3);
      *(undefined4 *)(param_3 + 0xd5) = *(undefined4 *)(param_1 + 0x178);
      local_a8 = (int *)CONCAT44(local_a8._4_4_,0x10);
      *(undefined2 *)((longlong)param_3 + 0x6ac) = *(undefined2 *)(param_1 + 0x17c);
      param_3[0xce] = *(longlong *)(param_1 + 400);
      *(undefined2 *)(param_3 + 0xcc) = 0xabce;
      *(undefined2 *)((longlong)param_3 + 0x662) = *(undefined2 *)(param_1 + 0x180);
      uVar1 = *(undefined4 *)(lVar2 + 0x30);
      param_3[0xcd] = 0;
      *(undefined4 *)((longlong)param_3 + 0x664) = uVar1;
      lVar3 = param_3[1];
      if (lVar3 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      FUN_14019c780(param_3,lVar3 + 1,0xffffffffffffffff);
      if (param_3[1] <= lVar3) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if ((ulonglong)param_3[2] < 0x65) {
        plVar9 = param_3 + (lVar3 + 2) * 2;
      }
      else {
        plVar9 = (longlong *)(lVar3 * 0x10 + *param_3);
      }
      *plVar9 = (longlong)local_a8;
      plVar9[1] = (longlong)(param_3 + 0xcc);
      puVar5 = puVar6;
      if (*(int *)(lVar2 + 0x30) != 0) {
        puVar5 = *(undefined8 **)(lVar2 + 0x28);
      }
      lVar3 = param_3[1];
      local_a8 = (int *)CONCAT44(local_a8._4_4_,*(int *)(lVar2 + 0x30));
      if (lVar3 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      FUN_14019c780(param_3,lVar3 + 1,0xffffffffffffffff);
      if (param_3[1] <= lVar3) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if ((ulonglong)param_3[2] < 0x65) {
        plVar9 = param_3 + (lVar3 + 2) * 2;
      }
      else {
        plVar9 = (longlong *)(lVar3 * 0x10 + *param_3);
      }
      *plVar9 = (longlong)local_a8;
      plVar9[1] = (longlong)puVar5;
      *(undefined4 *)(param_3 + 0xd6) = *(undefined4 *)(lVar2 + 0x48);
      iVar14 = (int)param_3[0xd2];
      if (-1 < iVar14) {
        lVar3 = param_3[0xd2];
        FUN_1401a7e40(param_3 + 0xcf,(int)lVar3 + 1);
        iVar13 = (int)lVar3 - iVar14;
        if (0 < iVar13) {
          puVar5 = puVar6;
          if ((int)param_3[0xd2] != 0) {
            puVar5 = (undefined8 *)param_3[0xd1];
          }
          memmove(puVar5 + (longlong)iVar14 + 1,puVar5 + iVar14,(longlong)iVar13 << 3);
        }
        if ((int)param_3[0xd2] != 0) {
          puVar6 = (undefined8 *)param_3[0xd1];
        }
        puVar6[iVar14] = lVar2;
        if (*(longlong *)(lVar2 + 0x10) == 0) {
          return;
        }
        FUN_14019c2a0(*(longlong *)(lVar2 + 0x10),lVar2);
        return;
      }
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    puVar5 = (undefined8 *)((longlong)puVar5 + 1);
    plVar9 = plVar9 + 7;
  } while ((longlong)puVar5 < 6);
  iVar14 = -1;
  if (*(int *)(param_1 + 0x1b0) == 0) {
    *(int *)(param_1 + 0x1d4) = *(int *)(param_1 + 0x1d4) + 1;
    local_a8 = (int *)(param_1 + 0x28);
    *(undefined8 *)(param_1 + 0x1c0) = 0;
    *(undefined8 *)(param_1 + 0x1c8) = 0;
    *(undefined4 *)(param_1 + 0x1d0) = 0;
    local_res20 = 0;
    puVar5 = puVar6;
    do {
      if ((local_res20 < 0) || (5 < local_res20)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      iVar13 = *local_a8;
      while (0 < iVar13) {
        lVar2 = *(longlong *)(local_a8 + -4);
        if ((int)puVar5 == 0) {
          iVar14 = *(int *)(param_1 + 0x1b0);
          if (iVar14 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          iVar13 = *(int *)(param_1 + 0x1b0);
          FUN_1401a7e40(param_1 + 0x198,iVar13 + 1);
          iVar13 = iVar13 - iVar14;
          if (0 < iVar13) {
            puVar10 = puVar6;
            if (*(int *)(param_1 + 0x1b0) != 0) {
              puVar10 = *(undefined8 **)(param_1 + 0x1a8);
            }
            memmove(puVar10 + (longlong)iVar14 + 1,puVar10 + iVar14,(longlong)iVar13 << 3);
          }
          puVar10 = puVar6;
          if (*(int *)(param_1 + 0x1b0) != 0) {
            puVar10 = *(undefined8 **)(param_1 + 0x1a8);
          }
          puVar10[iVar14] = lVar2;
          *(int *)(param_1 + 0x1c0) = *(int *)(param_1 + 0x1c0) + *(int *)(lVar2 + 0x30);
          iVar14 = *(int *)(lVar2 + 0x48);
        }
        else {
          if ((DAT_1402f8118 <= *(int *)(lVar2 + 0x30) + *(int *)(param_1 + 0x1c0)) ||
             (iVar14 != *(int *)(lVar2 + 0x48))) goto LAB_14019d7dd;
          iVar13 = *(int *)(param_1 + 0x1b0);
          if (iVar13 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          iVar11 = *(int *)(param_1 + 0x1b0);
          FUN_1401a7e40(param_1 + 0x198,iVar11 + 1);
          iVar11 = iVar11 - iVar13;
          if (0 < iVar11) {
            puVar10 = puVar6;
            if (*(int *)(param_1 + 0x1b0) != 0) {
              puVar10 = *(undefined8 **)(param_1 + 0x1a8);
            }
            memmove(puVar10 + (longlong)iVar13 + 1,puVar10 + iVar13,(longlong)iVar11 << 3);
          }
          puVar10 = puVar6;
          if (*(int *)(param_1 + 0x1b0) != 0) {
            puVar10 = *(undefined8 **)(param_1 + 0x1a8);
          }
          puVar10[iVar13] = lVar2;
          *(int *)(param_1 + 0x1c0) = *(int *)(param_1 + 0x1c0) + *(int *)(lVar2 + 0x30);
        }
        if (*(longlong *)(lVar2 + 0x10) != 0) {
          FUN_14019c2a0(*(longlong *)(lVar2 + 0x10),lVar2);
        }
        puVar5 = (undefined8 *)(ulonglong)((int)puVar5 + 1);
        iVar13 = *local_a8;
      }
      local_res20 = local_res20 + 1;
      local_a8 = local_a8 + 0xe;
    } while (local_res20 < 6);
LAB_14019d7dd:
  }
  if (*(int *)(param_1 + 0x1c0) < 1) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_14019cf60(param_3);
  *(undefined4 *)(param_3 + 0xd5) = *(undefined4 *)(param_1 + 0x178);
  local_a8 = (int *)CONCAT44(local_a8._4_4_,0x10);
  *(undefined2 *)((longlong)param_3 + 0x6ac) = *(undefined2 *)(param_1 + 0x17c);
  iVar13 = *(int *)(param_1 + 0x1c0) - *(int *)(param_1 + 0x1c8);
  if (DAT_1402f8118 < iVar13) {
    iVar13 = DAT_1402f8118;
  }
  param_3[0xce] = *(longlong *)(param_1 + 400);
  *(undefined2 *)(param_3 + 0xcc) = 0xabcd;
  *(undefined2 *)((longlong)param_3 + 0x662) = *(undefined2 *)(param_1 + 0x180);
  *(undefined4 *)((longlong)param_3 + 0x664) = *(undefined4 *)(param_1 + 0x1c0);
  *(undefined4 *)(param_3 + 0xcd) = *(undefined4 *)(param_1 + 0x1d4);
  *(undefined4 *)((longlong)param_3 + 0x66c) = *(undefined4 *)(param_1 + 0x1c4);
  lVar2 = param_3[1];
  if (-1 < lVar2) {
    FUN_14019c780(param_3,lVar2 + 1,0xffffffffffffffff);
    if (param_3[1] <= lVar2) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if ((ulonglong)param_3[2] < 0x65) {
      plVar9 = param_3 + (lVar2 + 2) * 2;
    }
    else {
      plVar9 = (longlong *)(lVar2 * 0x10 + *param_3);
    }
    *plVar9 = (longlong)local_a8;
    plVar9[1] = (longlong)(param_3 + 0xcc);
    *(int *)(param_3 + 0xd6) = iVar14;
    iVar14 = *(int *)(param_1 + 0x1c8);
    iVar11 = iVar14;
    while( true ) {
      if (iVar14 + iVar13 <= iVar11) {
        *(int *)(param_1 + 0x1c4) = *(int *)(param_1 + 0x1c4) + 1;
        if (*(int *)(param_1 + 0x1c8) == *(int *)(param_1 + 0x1c0)) {
          iVar14 = *(int *)(param_1 + 0x1b0);
          puVar5 = puVar6;
          if (*(int *)(param_1 + 0x1b0) != 0) {
            puVar5 = *(undefined8 **)(param_1 + 0x1a8);
          }
          if (iVar14 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          if (iVar14 != 0) {
            lVar2 = param_3[0xd2];
            FUN_1401a7e40(param_3 + 0xcf,(int)lVar2 + iVar14);
            puVar10 = puVar6;
            if ((int)param_3[0xd2] != 0) {
              puVar10 = (undefined8 *)param_3[0xd1];
            }
            _Size = (longlong)iVar14 << 3;
            if (_Size < 0x21) {
              puVar10 = puVar10 + (int)lVar2;
              for (uVar12 = (longlong)iVar14 & 0x1fffffffffffffff; uVar12 != 0; uVar12 = uVar12 - 1)
              {
                uVar4 = *puVar5;
                puVar5 = puVar5 + 1;
                *puVar10 = uVar4;
                puVar10 = puVar10 + 1;
              }
            }
            else {
              memcpy(puVar10 + (int)lVar2,puVar5,_Size);
            }
          }
          FUN_1401a7e40(param_1 + 0x198,0);
        }
        lVar2 = param_3[1];
        puVar5 = puVar6;
        puVar10 = puVar6;
        if (0 < lVar2) {
          do {
            if (((longlong)puVar6 < 0) || (lVar2 <= (longlong)puVar6)) {
                    // WARNING: Subroutine does not return
              FUN_1400a26d0();
            }
            if ((ulonglong)param_3[2] < 0x65) {
              plVar9 = param_3 + ((longlong)puVar6 + 2) * 2;
            }
            else {
              plVar9 = (longlong *)((longlong)puVar6 * 0x10 + *param_3);
            }
            puVar10 = (undefined8 *)(ulonglong)(uint)((int)puVar10 + (int)*plVar9);
            uVar8 = (int)puVar5 + 1;
            puVar6 = (undefined8 *)(longlong)(int)uVar8;
            puVar5 = (undefined8 *)(ulonglong)uVar8;
          } while ((longlong)puVar6 < lVar2);
        }
        FUN_1401c1f60(param_1 + 0x1d8,puVar10);
        *(undefined8 *)(param_1 + 0x200) = param_2;
        *(double *)(param_1 + 0x1f0) = (double)(int)puVar10 + *(double *)(param_1 + 0x1f0);
        return;
      }
      iVar11 = *(int *)(param_1 + 0x1d0);
      if ((iVar11 < 0) || (*(int *)(param_1 + 0x1b0) <= iVar11)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x1a8) + (longlong)iVar11 * 8);
      iVar11 = *(int *)(lVar2 + 0x30) - *(int *)(param_1 + 0x1cc);
      iVar7 = (iVar14 - *(int *)(param_1 + 0x1c8)) + iVar13;
      if (iVar7 < iVar11) {
        iVar11 = iVar7;
      }
      if (iVar11 < 1) break;
      puVar5 = puVar6;
      if (*(int *)(lVar2 + 0x30) != 0) {
        puVar5 = *(undefined8 **)(lVar2 + 0x28);
      }
      iVar7 = *(int *)(param_1 + 0x1cc);
      lVar3 = param_3[1];
      local_a8._4_4_ = (undefined4)((ulonglong)local_a8 >> 0x20);
      local_a8 = (int *)CONCAT44(local_a8._4_4_,iVar11);
      if (lVar3 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      FUN_14019c780(param_3,lVar3 + 1,0xffffffffffffffff);
      if (param_3[1] <= lVar3) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if ((ulonglong)param_3[2] < 0x65) {
        plVar9 = param_3 + (lVar3 + 2) * 2;
      }
      else {
        plVar9 = (longlong *)(lVar3 * 0x10 + *param_3);
      }
      *plVar9 = (longlong)local_a8;
      plVar9[1] = (longlong)iVar7 + (longlong)puVar5;
      *(int *)(param_1 + 0x1cc) = *(int *)(param_1 + 0x1cc) + iVar11;
      *(int *)(param_1 + 0x1c8) = *(int *)(param_1 + 0x1c8) + iVar11;
      if (*(int *)(param_1 + 0x1cc) == *(int *)(lVar2 + 0x30)) {
        *(int *)(param_1 + 0x1d0) = *(int *)(param_1 + 0x1d0) + 1;
        *(undefined4 *)(param_1 + 0x1cc) = 0;
      }
      iVar11 = *(int *)(param_1 + 0x1c8);
    }
    FUN_14019cde0(param_1);
    FUN_1400a2320(local_98,L"Unexpected at PacketQueue Pop!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_98,(ThrowInfo *)&DAT_1402f4860);
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_14019ddc0(void *param_1)

{
  _eh_vector_destructor_iterator_(param_1,0x38,6,FUN_14019ce70);
  return;
}



void FUN_14019dde0(longlong param_1)

{
  FUN_14019cde0();
  *(undefined ***)(param_1 + 0x198) = Proud::CFastArray<>::vftable;
  if (*(longlong *)(param_1 + 0x1a8) != 0) {
    if (*(longlong **)(param_1 + 0x1a0) == (longlong *)0x0) {
      FUN_1400a3530(*(longlong *)(param_1 + 0x1a8));
    }
    else {
      (**(code **)(**(longlong **)(param_1 + 0x1a0) + 0x18))();
    }
  }
  _eh_vector_destructor_iterator_((void *)(param_1 + 0x18),0x38,6,FUN_14019ce70);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_14019c380(*(longlong *)(param_1 + 0x10),param_1);
  }
  return;
}



void FUN_14019de70(undefined8 *param_1)

{
  FUN_14019cf60();
  param_1[0xcf] = Proud::CFastArray<>::vftable;
  if (param_1[0xd1] != 0) {
    if ((longlong *)param_1[0xd0] == (longlong *)0x0) {
      FUN_1400a3530(param_1[0xd1]);
    }
    else {
      (**(code **)(*(longlong *)param_1[0xd0] + 0x18))();
    }
  }
  if (100 < (ulonglong)param_1[2]) {
    operator_delete__((void *)*param_1);
  }
  return;
}



void FUN_14019dee0(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  lVar1 = *param_1;
  while (lVar1 != 0) {
    lVar1 = *param_1;
    *param_1 = *(longlong *)(lVar1 + 0x58);
    *(undefined8 *)(lVar1 + 0x58) = 0;
    FUN_140140df0(lVar1 + 0x20);
    if (*(longlong *)(lVar1 + 0x18) != 0) {
      FUN_14019c2a0(*(longlong *)(lVar1 + 0x18),lVar1 + 8,param_3,param_4,uVar2);
    }
    FUN_1400a3530(lVar1);
    lVar1 = *param_1;
  }
  return;
}



void FUN_14019df70(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong *plVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  lVar1 = *param_1;
  while (lVar1 != 0) {
    lVar1 = *param_1;
    *param_1 = *(longlong *)(lVar1 + 0x68);
    *(undefined8 *)(lVar1 + 0x68) = 0;
    *(undefined ***)(lVar1 + 0x30) = Proud::CFastArray<>::vftable;
    if (*(longlong *)(lVar1 + 0x40) != 0) {
      if (*(longlong **)(lVar1 + 0x38) == (longlong *)0x0) {
        FUN_1400a3530(*(longlong *)(lVar1 + 0x40));
      }
      else {
        (**(code **)(**(longlong **)(lVar1 + 0x38) + 0x18))();
      }
    }
    *(undefined ***)(lVar1 + 8) = Proud::CFastArray<bool,1>::vftable;
    if (*(longlong *)(lVar1 + 0x18) != 0) {
      plVar2 = *(longlong **)(lVar1 + 0x10);
      if (plVar2 == (longlong *)0x0) {
        FUN_1400a3530();
      }
      else {
        (**(code **)(*plVar2 + 0x18))(plVar2,*(longlong *)(lVar1 + 0x18),plVar2,param_4,uVar3);
      }
    }
    FUN_1400a3530(lVar1);
    lVar1 = *param_1;
  }
  return;
}



void FUN_14019e040(void)

{
  FUN_14019d190();
  return;
}



undefined8 FUN_14019e060(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_140144560(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  FUN_1401b2030(param_1);
  uVar2 = FUN_14019d2c0(param_1,param_2,param_3,param_4);
  FUN_1401b2030(param_1);
  return uVar2;
}



// WARNING: Removing unreachable block (ram,0x00014019e13b)
// WARNING: Removing unreachable block (ram,0x00014019e144)
// WARNING: Removing unreachable block (ram,0x00014019e162)
// WARNING: Removing unreachable block (ram,0x00014019e16b)

undefined1 * FUN_14019e0e0(undefined1 *param_1)

{
  *param_1 = 0;
  *(undefined4 *)(param_1 + 0x28) = 0x11;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined4 *)(param_1 + 0x48) = 0;
  *(undefined4 *)(param_1 + 0x2c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x30) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x34) = 0x40100000;
  *(undefined8 *)(param_1 + 0x38) = 0x26;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x00014019e210)
// WARNING: Removing unreachable block (ram,0x00014019e219)
// WARNING: Removing unreachable block (ram,0x00014019e237)
// WARNING: Removing unreachable block (ram,0x00014019e240)
// WARNING: Removing unreachable block (ram,0x00014019e27b)
// WARNING: Removing unreachable block (ram,0x00014019e284)
// WARNING: Removing unreachable block (ram,0x00014019e2a2)
// WARNING: Removing unreachable block (ram,0x00014019e2ab)

undefined1 * FUN_14019e1a0(undefined1 *param_1,longlong param_2)

{
  *param_1 = 0;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x28) = 0x11;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined4 *)(param_1 + 0x48) = 0;
  *(undefined4 *)(param_1 + 0x2c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x30) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x34) = 0x40100000;
  *(undefined8 *)(param_1 + 0x38) = 0x26;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined4 *)(param_1 + 0x2c) = 0x3dcccccd;
  *(undefined4 *)(param_1 + 0x30) = 0x33d6bf95;
  *(undefined4 *)(param_1 + 0x34) = 0x40066666;
  *(undefined8 *)(param_1 + 0x38) = 0x23;
  *(undefined8 *)(param_1 + 0x40) = 0;
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(longlong *)(param_1 + 0x50) = param_2;
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x00014019e347)
// WARNING: Removing unreachable block (ram,0x00014019e350)
// WARNING: Removing unreachable block (ram,0x00014019e36e)
// WARNING: Removing unreachable block (ram,0x00014019e377)
// WARNING: Removing unreachable block (ram,0x00014019e3b2)
// WARNING: Removing unreachable block (ram,0x00014019e3bb)
// WARNING: Removing unreachable block (ram,0x00014019e3d9)
// WARNING: Removing unreachable block (ram,0x00014019e3e2)

undefined1 * FUN_14019e2e0(undefined1 *param_1)

{
  *param_1 = 0;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x28) = 0x11;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined4 *)(param_1 + 0x48) = 0;
  *(undefined4 *)(param_1 + 0x2c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x30) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x34) = 0x40100000;
  *(undefined8 *)(param_1 + 0x38) = 0x26;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined4 *)(param_1 + 0x2c) = 0x3dcccccd;
  *(undefined4 *)(param_1 + 0x30) = 0x33d6bf95;
  *(undefined4 *)(param_1 + 0x34) = 0x40066666;
  *(undefined8 *)(param_1 + 0x38) = 0x23;
  *(undefined8 *)(param_1 + 0x40) = 0;
  return param_1;
}



undefined8 FUN_14019e410(longlong *param_1,longlong param_2,undefined8 param_3)

{
  longlong lVar1;
  char cVar2;
  undefined8 uVar3;
  undefined1 local_68 [96];
  
  lVar1 = *param_1;
  if (lVar1 == 0) {
    uVar3 = 0;
  }
  else {
    if (*(int *)(lVar1 + 0x158) + *(int *)(lVar1 + 0x140) + *(int *)(lVar1 + 0x120) +
        *(int *)(lVar1 + 0x108) + *(int *)(lVar1 + 0xe8) + *(int *)(lVar1 + 0xd0) +
        *(int *)(lVar1 + 0xb0) + *(int *)(lVar1 + 0x98) + *(int *)(lVar1 + 0x78) +
        *(int *)(lVar1 + 0x60) + *(int *)(lVar1 + 0x40) + *(int *)(lVar1 + 0x28) +
        *(int *)(lVar1 + 0x1b0) == 0) {
      FUN_1400a2320(local_68,L"Unexpected state in RemoteToPacketSendMap!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_68,(ThrowInfo *)&DAT_1402f4860);
    }
    uVar3 = (**(code **)(*(longlong *)param_1[3] + 8))();
    FUN_14019d590(lVar1,uVar3,param_2);
    if (*(longlong *)(param_2 + 8) == 0) {
      FUN_1400a2320(local_68,L"Unexpected state in RemoteToPacketSendMap #2!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_68,(ThrowInfo *)&DAT_1402f4860);
    }
    cVar2 = FUN_14019c460(lVar1,param_3);
    if ((cVar2 == '\0') && (*(longlong *)(lVar1 + 0x10) != 0)) {
      FUN_14019c380(*(longlong *)(lVar1 + 0x10),lVar1);
    }
    else {
      if (*(longlong *)(lVar1 + 0x10) != 0) {
        FUN_14019c380(*(longlong *)(lVar1 + 0x10),lVar1);
      }
      FUN_14019c5d0(param_1,lVar1);
    }
    *(undefined8 *)(lVar1 + 0x168) = param_3;
    uVar3 = 1;
  }
  return uVar3;
}



undefined8 * FUN_14019e550(undefined8 *param_1)

{
  ulonglong uVar1;
  undefined8 *puVar2;
  
  uVar1 = 0;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  _eh_vector_constructor_iterator_
            (param_1 + 3,0x38,6,(_func_void_void_ptr *)&LAB_14019cdc0,FUN_14019ce70);
  param_1[0x2e] = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 0x2f) = 0;
  *(undefined2 *)((longlong)param_1 + 0x17c) = 0;
  param_1[0x33] = Proud::CFastArray<>::vftable;
  param_1[0x34] = 0;
  param_1[0x35] = 0;
  param_1[0x36] = 0;
  param_1[0x37] = 0;
  FUN_1401c1f90(param_1 + 0x3b);
  param_1[0x3e] = 0;
  param_1[0x3f] = 0;
  param_1[0x3d] = 0;
  param_1[0x40] = 0;
  FUN_1401c2070(param_1 + 0x41);
  param_1[0x42] = 0;
  param_1[0x43] = 0;
  puVar2 = param_1 + 9;
  do {
    if (5 < uVar1) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    *puVar2 = param_1;
    uVar1 = uVar1 + 1;
    puVar2 = puVar2 + 7;
  } while ((longlong)uVar1 < 6);
  param_1[0x31] = 0xffffffffffffffff;
  param_1[0x32] = 0;
  param_1[0x2d] = 0;
  *(undefined4 *)(param_1 + 0x2f) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_1 + 0x17c) = DAT_1402f83d4;
  *(undefined2 *)(param_1 + 0x30) = 0;
  param_1[0x38] = 0;
  param_1[0x39] = 0;
  *(undefined4 *)(param_1 + 0x3a) = 0;
  *(int *)((longlong)param_1 + 0x1d4) = (int)param_1;
  return param_1;
}



uint * FUN_14019e6b0(longlong param_1,uint *param_2,undefined8 *param_3)

{
  uint uVar1;
  ulonglong uVar2;
  uint *puVar3;
  
  uVar1 = *param_2;
  uVar2 = (ulonglong)uVar1 % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (puVar3 = *(uint **)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (puVar3 != (uint *)0x0 && ((uint)uVar2 == puVar3[8] % *(uint *)(param_1 + 0x28)));
        puVar3 = *(uint **)(puVar3 + 4)) {
      if (*puVar3 == uVar1) {
        *(undefined8 *)(puVar3 + 2) = *param_3;
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_14019e060(param_1,param_2,uVar2,(ulonglong)uVar1,0xfffffffffffffffe);
  *(undefined8 *)(puVar3 + 2) = *param_3;
  return puVar3;
}



longlong FUN_14019e750(longlong param_1,longlong param_2,undefined8 *param_3)

{
  ulonglong uVar1;
  longlong lVar2;
  uint uVar3;
  
  uVar3 = (uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8);
  uVar1 = (ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + uVar1 * 8);
        (lVar2 != 0 && ((uint)uVar1 == *(uint *)(lVar2 + 0x28) % *(uint *)(param_1 + 0x28)));
        lVar2 = *(longlong *)(lVar2 + 0x18)) {
      if ((*(uint *)(lVar2 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar2 + 0xc) == *(ushort *)(param_2 + 0xc))) {
        *(undefined8 *)(lVar2 + 0x10) = *param_3;
        return lVar2;
      }
    }
  }
  lVar2 = FUN_14018b820(param_1,param_2,uVar1,uVar3,0xfffffffffffffffe);
  *(undefined8 *)(lVar2 + 0x10) = *param_3;
  return lVar2;
}



// WARNING: Removing unreachable block (ram,0x00014019ea28)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_14019e800(longlong param_1,double param_2)

{
  longlong lVar1;
  double dVar2;
  longlong lVar3;
  longlong *plVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lStack_70;
  undefined **local_68;
  undefined4 local_60;
  undefined2 local_5c;
  longlong local_58;
  longlong lStack_50;
  
  lVar1 = param_1 + 0x20;
  lVar7 = lVar1;
  lStack_70 = lVar1;
  if (*(longlong *)(param_1 + 0x40) == 0) {
    lVar6 = 0;
  }
  else {
    lVar6 = *(longlong *)(param_1 + 0x30);
  }
  while( true ) {
    while( true ) {
      if ((lVar6 == 0) && (lVar7 == lVar1)) {
        return;
      }
      if (lVar6 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      lVar3 = *(longlong *)(lVar6 + 0x10);
      FUN_1401c1f70(lVar3 + 0x1d8,param_2);
      FUN_1401c20e0(lVar3 + 0x1e8,param_2);
      FUN_1401c2090(lVar3 + 0x210,param_2);
      dVar2 = *(double *)(lVar3 + 0x1e8);
      iVar5 = (**(code **)(**(longlong **)(param_1 + 0x18) + 0x18))();
      if ((double)iVar5 < dVar2) {
        local_68 = Proud::AddrPort::vftable;
        local_60 = *(undefined4 *)(lVar6 + 8);
        local_5c = *(undefined2 *)(lVar6 + 0xc);
        (**(code **)(**(longlong **)(param_1 + 0x18) + 0x10))
                  (*(longlong **)(param_1 + 0x18),&local_68);
      }
      FUN_1401c1ff0(lVar3 + 0x208,*(undefined8 *)(lVar3 + 0x1e8),*(undefined8 *)(lVar3 + 0x210));
      if (_DAT_1402f8120 < param_2 - *(double *)(lVar3 + 0x168)) break;
      if (lVar6 != 0) {
        lVar6 = *(longlong *)(lVar6 + 0x18);
      }
    }
    if (*(longlong *)(lVar3 + 0x10) != 0) {
      FUN_14019c380(*(longlong *)(lVar3 + 0x10),lVar3);
    }
    plVar4 = *(longlong **)(param_1 + 0x78);
    FUN_14019cde0(lVar3);
    *(undefined ***)(lVar3 + 0x198) = Proud::CFastArray<>::vftable;
    if (*(longlong *)(lVar3 + 0x1a8) != 0) {
      if (*(longlong **)(lVar3 + 0x1a0) == (longlong *)0x0) {
        FUN_1400a3530(*(longlong *)(lVar3 + 0x1a8));
      }
      else {
        (**(code **)(**(longlong **)(lVar3 + 0x1a0) + 0x18))();
      }
    }
    _eh_vector_destructor_iterator_((void *)(lVar3 + 0x18),0x38,6,FUN_14019ce70);
    if (*(longlong *)(lVar3 + 0x10) != 0) {
      FUN_14019c380(*(longlong *)(lVar3 + 0x10),lVar3);
    }
    (**(code **)(*plVar4 + 0x18))(plVar4,lVar3);
    if (lVar7 != lVar1) break;
    lStack_50 = lStack_70;
    if (lVar6 == 0) {
      local_58 = 0;
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    local_58 = *(longlong *)(lVar6 + 0x18);
    FUN_1401461b0(lVar1,lVar6,0);
    lVar6 = local_58;
    lVar7 = lStack_50;
    lStack_70 = lStack_50;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



ulonglong FUN_14019ea80(longlong param_1,longlong param_2)

{
  uint uVar1;
  undefined8 uVar2;
  longlong *plVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  longlong lVar6;
  
  uVar1 = *(uint *)(param_1 + 0x48);
  uVar4 = (ulonglong)((uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8));
  uVar5 = uVar4 / uVar1;
  uVar4 = uVar4 % (ulonglong)uVar1;
  if ((*(longlong *)(param_1 + 0x28) != 0) &&
     (lVar6 = *(longlong *)(*(longlong *)(param_1 + 0x28) + uVar4 * 8), lVar6 != 0)) {
    while( true ) {
      uVar5 = (ulonglong)*(uint *)(lVar6 + 0x28) / (ulonglong)uVar1;
      if ((uint)uVar4 != *(uint *)(lVar6 + 0x28) % uVar1) break;
      if ((*(uint *)(lVar6 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar6 + 0xc) == *(ushort *)(param_2 + 0xc))) {
        if (lVar6 == 0) {
          return uVar5;
        }
        if (*(longlong *)(*(longlong *)(lVar6 + 0x10) + 0x10) != 0) {
          FUN_14019c380();
        }
        uVar2 = *(undefined8 *)(lVar6 + 0x10);
        plVar3 = *(longlong **)(param_1 + 0x78);
        FUN_14019dde0(uVar2);
        (**(code **)(*plVar3 + 0x18))(plVar3,uVar2);
        uVar4 = FUN_1401461b0(param_1 + 0x20,lVar6,0);
        return uVar4;
      }
      lVar6 = *(longlong *)(lVar6 + 0x18);
      if (lVar6 == 0) {
        return uVar5;
      }
    }
  }
  return uVar5;
}



// WARNING: Removing unreachable block (ram,0x00014019ecb7)

void FUN_14019eb60(longlong param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  
  if (*(longlong *)(param_1 + 0x40) == 0) {
    lVar3 = 0;
  }
  else {
    lVar3 = *(longlong *)(param_1 + 0x30);
  }
  while( true ) {
    if (lVar3 == 0) {
      return;
    }
    if (lVar3 == 0) break;
    lVar1 = *(longlong *)(lVar3 + 0x10);
    if (*(longlong *)(lVar1 + 0x10) != 0) {
      FUN_14019c380(*(longlong *)(lVar1 + 0x10),lVar1);
    }
    plVar2 = *(longlong **)(param_1 + 0x78);
    FUN_14019cde0(lVar1);
    *(undefined ***)(lVar1 + 0x198) = Proud::CFastArray<>::vftable;
    if (*(longlong *)(lVar1 + 0x1a8) != 0) {
      if (*(longlong **)(lVar1 + 0x1a0) == (longlong *)0x0) {
        FUN_1400a3530(*(longlong *)(lVar1 + 0x1a8));
      }
      else {
        (**(code **)(**(longlong **)(lVar1 + 0x1a0) + 0x18))();
      }
    }
    _eh_vector_destructor_iterator_((void *)(lVar1 + 0x18),0x38,6,FUN_14019ce70);
    if (*(longlong *)(lVar1 + 0x10) != 0) {
      FUN_14019c380(*(longlong *)(lVar1 + 0x10),lVar1);
    }
    (**(code **)(*plVar2 + 0x18))(plVar2,lVar1);
    if (lVar3 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    lVar1 = *(longlong *)(lVar3 + 0x18);
    FUN_1401461b0(param_1 + 0x20,lVar3,0);
    lVar3 = lVar1;
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



void FUN_14019ecf0(longlong param_1)

{
  longlong *plVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (*(longlong *)(param_1 + 0x20) == 0) {
    lVar3 = 0;
  }
  else {
    lVar3 = *(longlong *)(param_1 + 0x10);
  }
  for (; lVar3 != 0; lVar3 = *(longlong *)(lVar3 + 0x18)) {
    if (*(longlong *)(lVar3 + 0x10) != 0) {
      uVar2 = *(undefined8 *)(lVar3 + 0x10);
      FUN_14019dde0(uVar2);
      (**(code **)(*plVar1 + 0x18))(plVar1,uVar2);
    }
  }
  FUN_1401a4bc0(param_1);
  return;
}



undefined8 FUN_14019ed70(longlong param_1,longlong param_2,undefined8 *param_3)

{
  longlong lVar1;
  ulonglong uVar2;
  undefined8 *puVar3;
  
  uVar2 = (ulonglong)((uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8)) %
          (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (lVar1 = *(longlong *)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (lVar1 != 0 && ((uint)uVar2 == *(uint *)(lVar1 + 0x28) % *(uint *)(param_1 + 0x28)));
        lVar1 = *(longlong *)(lVar1 + 0x18)) {
      if ((*(uint *)(lVar1 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar1 + 0xc) == *(ushort *)(param_2 + 0xc))) {
        return 0;
      }
    }
  }
  puVar3 = (undefined8 *)FUN_14018ea60(param_1,param_2);
  *puVar3 = *param_3;
  return 1;
}



longlong FUN_14019ee20(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  
  lVar1 = (**(code **)(*param_1 + 8))(param_1,0x220,param_3,param_4,0xfffffffffffffffe);
  if (lVar1 != 0) {
    FUN_14019e550(lVar1);
  }
  return lVar1;
}



void FUN_14019ee60(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  
  if (*(longlong *)(param_2 + 0x20) == 0) {
    lVar1 = 0;
  }
  else {
    lVar1 = *(longlong *)(param_2 + 0x10);
  }
  for (; lVar1 != 0; lVar1 = *(longlong *)(lVar1 + 0x10)) {
    FUN_14018b6e0(*(undefined8 *)(lVar1 + 8));
  }
  FUN_14019e040(param_2);
                    // WARNING: Could not recover jumptable at 0x00014019eec6. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0x18))(param_1,param_2);
  return;
}



void FUN_14019eed0(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong *plVar3;
  undefined8 uVar4;
  undefined8 *puVar5;
  int iVar6;
  longlong lVar7;
  longlong lVar8;
  longlong lVar9;
  undefined8 uVar10;
  undefined *puVar11;
  undefined1 local_70 [72];
  
  uVar10 = 0xfffffffffffffffe;
  lVar9 = 0;
  if (*(longlong *)(param_1 + 0x20) != 0) {
    lVar9 = *(longlong *)(param_1 + 0x10);
  }
  do {
    if (lVar9 == 0) {
      return;
    }
    if (*(longlong *)(lVar9 + 0x10) != 0) {
      lVar1 = *(longlong *)(lVar9 + 0x10);
      lVar8 = 0;
      if (*(longlong *)(lVar1 + 0x20) != 0) {
        lVar8 = *(longlong *)(lVar1 + 0x10);
      }
      for (; lVar8 != 0; lVar8 = *(longlong *)(lVar8 + 0x10)) {
        lVar2 = *(longlong *)(lVar8 + 8);
        puVar11 = &DAT_140319128;
        FUN_1400a1c30(&DAT_140319128);
        *(undefined4 *)(lVar2 + 0x50) = 0;
        *(undefined8 *)(lVar2 + 0x58) = 0;
        if (*(int *)(lVar2 + 0x18) != 0) {
          if (*(int *)(lVar2 + 0x1c) < 0) {
            iVar6 = FUN_14018a4a0(lVar2,0);
            plVar3 = *(longlong **)(lVar2 + 8);
            if (*(int *)(lVar2 + 0x1c) == 0) {
              if (plVar3 == (longlong *)0x0) {
                lVar7 = FUN_1400a34c0((longlong)iVar6);
              }
              else {
                lVar7 = (**(code **)(*plVar3 + 8))();
              }
            }
            else {
              uVar4 = *(undefined8 *)(lVar2 + 0x10);
              if (plVar3 == (longlong *)0x0) {
                lVar7 = FUN_1400a34f0(uVar4);
              }
              else {
                lVar7 = (**(code **)(*plVar3 + 0x10))
                                  (plVar3,uVar4,(longlong)iVar6,uVar4,uVar10,puVar11);
              }
              if (lVar7 == 0) {
                FUN_1400a2320(local_70,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_70,(ThrowInfo *)&DAT_1402f4860);
              }
            }
            *(longlong *)(lVar2 + 0x10) = lVar7;
            *(int *)(lVar2 + 0x1c) = iVar6;
          }
          *(undefined4 *)(lVar2 + 0x18) = 0;
        }
        if (*(int *)(lVar2 + 0x40) != 0) {
          if (*(int *)(lVar2 + 0x44) < 0) {
            iVar6 = FUN_14003cd00(lVar2 + 0x28);
            plVar3 = *(longlong **)(lVar2 + 0x30);
            if (*(int *)(lVar2 + 0x44) == 0) {
              if (plVar3 == (longlong *)0x0) {
                lVar7 = FUN_1400a34c0((longlong)iVar6);
              }
              else {
                lVar7 = (**(code **)(*plVar3 + 8))();
              }
            }
            else {
              if (plVar3 == (longlong *)0x0) {
                lVar7 = FUN_1400a34f0(*(undefined8 *)(lVar2 + 0x38));
              }
              else {
                lVar7 = (**(code **)(*plVar3 + 0x10))
                                  (plVar3,*(undefined8 *)(lVar2 + 0x38),(longlong)iVar6);
              }
              if (lVar7 == 0) {
                FUN_1400a2320(local_70,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_70,(ThrowInfo *)&DAT_1402f4860);
              }
            }
            *(longlong *)(lVar2 + 0x38) = lVar7;
            *(int *)(lVar2 + 0x44) = iVar6;
          }
          *(undefined4 *)(lVar2 + 0x40) = 0;
        }
        puVar5 = DAT_140319120;
        if ((*(short *)(lVar2 + -8) != 0x1de6) || (*(longlong *)(lVar2 + 0x60) != 0)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        *(undefined8 *)(lVar2 + 0x60) = *DAT_140319120;
        *puVar5 = (short *)(lVar2 + -8);
        FUN_1400d1290(&DAT_140319128);
      }
      FUN_14019e040(lVar1);
      (**(code **)(*param_2 + 0x18))(param_2,lVar1);
    }
    lVar9 = *(longlong *)(lVar9 + 0x18);
  } while( true );
}



longlong FUN_14019f130(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  float fVar4;
  undefined1 local_50 [72];
  
  lVar1 = (**(code **)(*param_1 + 8))(param_1,0x78,param_3,param_4,0xfffffffffffffffe);
  if (lVar1 != 0) {
    FUN_14019e0e0();
  }
  *(undefined4 *)(lVar1 + 0x2c) = 0x3dcccccd;
  *(undefined4 *)(lVar1 + 0x30) = 0x33d6bf95;
  *(undefined4 *)(lVar1 + 0x34) = 0x40066666;
  fVar4 = (float)*(uint *)(lVar1 + 0x28) * 2.1;
  lVar3 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  *(longlong *)(lVar1 + 0x38) = (longlong)fVar4 + lVar3;
  fVar4 = (float)*(uint *)(lVar1 + 0x28) * 1e-07;
  lVar3 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  uVar2 = (longlong)fVar4 + lVar3;
  if ((ulonglong)((longlong)fVar4 + lVar3) < 0x11) {
    uVar2 = 0;
  }
  *(ulonglong *)(lVar1 + 0x40) = uVar2;
  if (*(longlong *)(lVar1 + 0x20) != 0) {
    FUN_1400a2320(local_50,PTR_u_Collection_object_can_use_fast_h_1402f81d0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
  }
  *(longlong **)(lVar1 + 0x50) = param_1;
  return lVar1;
}



void FUN_14019f250(longlong param_1,int param_2,undefined2 param_3,longlong param_4,
                  undefined8 param_5,undefined8 param_6,uint *param_7)

{
  ulonglong uVar1;
  char cVar2;
  int iVar3;
  uint uVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *plVar7;
  longlong local_78;
  undefined1 local_70 [88];
  
  cVar2 = FUN_1400a64d0(param_4);
  if ((cVar2 != '\0') && (iVar3 = FUN_1401a7030(param_5), 0 < iVar3)) {
    uVar1 = (ulonglong)((uint)*(ushort *)(param_4 + 0xc) ^ *(uint *)(param_4 + 8)) %
            (ulonglong)*(uint *)(param_1 + 0x48);
    if (*(longlong *)(param_1 + 0x28) != 0) {
      for (lVar5 = *(longlong *)(*(longlong *)(param_1 + 0x28) + uVar1 * 8);
          (lVar5 != 0 && ((uint)uVar1 == *(uint *)(lVar5 + 0x28) % *(uint *)(param_1 + 0x48)));
          lVar5 = *(longlong *)(lVar5 + 0x18)) {
        if ((*(uint *)(lVar5 + 8) == *(uint *)(param_4 + 8)) &&
           (*(ushort *)(lVar5 + 0xc) == *(ushort *)(param_4 + 0xc))) {
          lVar5 = *(longlong *)(lVar5 + 0x10);
          goto LAB_14019f368;
        }
      }
    }
    lVar5 = FUN_14019ee20(*(undefined8 *)(param_1 + 0x78));
    *(undefined8 *)(lVar5 + 0x188) = *(undefined8 *)(param_1 + 0x78);
    *(undefined4 *)(lVar5 + 0x1bc) = 1;
    *(longlong *)(lVar5 + 400) = param_1;
    *(undefined4 *)(lVar5 + 0x178) = *(undefined4 *)(param_4 + 8);
    *(undefined2 *)(lVar5 + 0x17c) = *(undefined2 *)(param_4 + 0xc);
    *(undefined2 *)(lVar5 + 0x180) = param_3;
    *(undefined8 *)(lVar5 + 0x168) = param_6;
    local_78 = lVar5;
    FUN_14019ed70(param_1 + 0x20,param_4,&local_78);
LAB_14019f368:
    if ((*(int *)(lVar5 + 0x178) != *(int *)(param_4 + 8)) ||
       (*(short *)(lVar5 + 0x17c) != *(short *)(param_4 + 0xc))) {
      FUN_1400a2320(local_70,L"PacketQueue consistency failed!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_70,(ThrowInfo *)&DAT_1402f4860);
    }
    uVar4 = *param_7;
    if (((int)uVar4 < 0) || (5 < (int)uVar4)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (DAT_1402f8144 == '\0') {
      uVar4 = 0;
    }
    *param_7 = uVar4;
    if (5 < uVar4) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    plVar7 = (longlong *)((longlong)(int)uVar4 * 0x38 + 0x18 + lVar5);
    if ((*(longlong *)(param_7 + 2) != 0) && (param_2 != 0)) {
      if (*(char *)((longlong)param_7 + 0x19) == '\0') {
        lVar6 = plVar7[3];
      }
      else {
        lVar6 = *plVar7;
      }
      for (; lVar6 != 0; lVar6 = *(longlong *)(lVar6 + 8)) {
        if (((*(longlong *)(lVar6 + 0x40) != 0) &&
            (*(longlong *)(param_7 + 2) == *(longlong *)(lVar6 + 0x40))) &&
           (param_2 == *(int *)(lVar6 + 0x4c))) goto LAB_14019f44b;
      }
    }
    lVar6 = FUN_14019d060(param_1 + 0x80);
    if (*(char *)((longlong)param_7 + 0x19) == '\0') {
      plVar7 = plVar7 + 3;
    }
    FUN_14019c540(plVar7,lVar6);
    *(undefined8 *)(lVar6 + 0x40) = *(undefined8 *)(param_7 + 2);
    uVar4 = param_7[5];
    *(int *)(lVar6 + 0x4c) = param_2;
    *(uint *)(lVar6 + 0x48) = uVar4;
LAB_14019f44b:
    thunk_FUN_1401a70d0(param_5,lVar6 + 0x18);
    if (*(int *)(lVar5 + 0x158) + *(int *)(lVar5 + 0x140) + *(int *)(lVar5 + 0x120) +
        *(int *)(lVar5 + 0x108) + *(int *)(lVar5 + 0xe8) + *(int *)(lVar5 + 0xd0) +
        *(int *)(lVar5 + 0xb0) + *(int *)(lVar5 + 0x98) + *(int *)(lVar5 + 0x78) +
        *(int *)(lVar5 + 0x60) + *(int *)(lVar5 + 0x40) + *(int *)(lVar5 + 0x28) +
        *(int *)(lVar5 + 0x1b0) < 1) {
      FUN_1400a2320(local_70,L"PacketQueue consistency 2 failed!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_70,(ThrowInfo *)&DAT_1402f4860);
    }
    *(undefined8 *)(lVar5 + 0x168) = param_6;
    FUN_14019caf0(param_1,lVar5,param_6);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_14019f540(undefined8 *param_1,undefined8 param_2,int param_3,longlong param_4,char param_5,
             longlong param_6,longlong *param_7,undefined8 param_8)

{
  ulonglong uVar1;
  int iVar2;
  char cVar3;
  int iVar4;
  undefined4 uVar5;
  longlong lVar6;
  undefined8 uVar7;
  longlong *plVar8;
  uint *puVar9;
  longlong lVar10;
  char cVar11;
  uint *puVar12;
  uint *puVar13;
  int iVar14;
  undefined1 auStack_108 [32];
  int local_e8;
  longlong *local_d8;
  int local_d0 [2];
  longlong local_c8;
  uint *local_c0;
  int local_b8;
  int local_b4;
  int local_a8;
  longlong local_a0;
  int local_98;
  longlong *local_90;
  longlong local_88 [2];
  short local_78 [2];
  int local_74;
  uint local_70;
  int local_6c;
  ulonglong local_68;
  
  local_88[1] = 0xfffffffffffffffe;
  local_68 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  local_90 = param_7;
  local_a8 = param_3;
  local_a0 = param_4;
  FUN_140185560(local_d0);
  FUN_1401851e0(local_d0,param_2,param_3);
  FUN_1401856c0(local_d0,param_3);
  FUN_140185160(local_d0,0);
  cVar3 = FUN_140185490(local_d0,local_78,0x10);
  if (cVar3 == '\0') {
    FUN_14001f680(param_8,L"UDP frag header missing!");
    local_d8 = &local_c8;
    FUN_14019a730(&local_c8);
    if (local_c0 == (uint *)0x0) {
      return 2;
    }
    if (-1 < local_b4) {
      return 2;
    }
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (local_78[0] == -0x5433) {
    if ((((local_74 < 1) || (iVar4 = (**(code **)(*(longlong *)*param_1 + 8))(), iVar4 < local_74))
        || (local_6c < 0)) || (local_74 / DAT_1402f8118 < local_6c)) {
      uVar5 = (**(code **)(*(longlong *)*param_1 + 8))();
      local_e8 = local_6c;
      FUN_14003c600(param_8,L"UDP frag length is wrong #1! packetlength=%d, maxlength=%d, fragID=%d"
                    ,local_74,uVar5);
      local_d8 = &local_c8;
      FUN_14019a730(&local_c8);
      if (local_c0 == (uint *)0x0) {
        return 2;
      }
      if (-1 < local_b4) {
        return 2;
      }
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (local_78[0] != -0x5432) goto LAB_14019f71f;
  }
  else if (local_78[0] != -0x5432) {
    FUN_14003c600(param_8,L"Cannot identify UDP fragment nor full packet! fragheaderSplitter=%u",
                  local_78[0]);
    local_d8 = &local_c8;
    FUN_14019a730(&local_c8);
    if (local_c0 == (uint *)0x0) {
      return 2;
    }
    if (-1 < local_b4) {
      return 2;
    }
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if ((local_74 < 1) || (iVar4 = (**(code **)(*(longlong *)*param_1 + 8))(), iVar4 < local_74)) {
    FUN_14001f680(param_8,L"UDP full packet length is wrong!");
    local_d8 = &local_c8;
    FUN_14019a730(&local_c8);
    if (local_c0 == (uint *)0x0) {
      return 2;
    }
    if (-1 < local_b4) {
      return 2;
    }
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
LAB_14019f71f:
  cVar3 = (**(code **)(*(longlong *)*param_1 + 0x20))();
  iVar4 = local_6c;
  puVar13 = local_c0;
  lVar10 = local_c8;
  cVar11 = (char)((ushort)local_78[1] >> 8);
  if ((((cVar11 == '\0') || (param_5 == '\0')) || (cVar11 == param_5)) &&
     ((((char)local_78[1] == '\0' || (cVar3 == '\0')) || ((char)local_78[1] == cVar3)))) {
    local_98 = DAT_1402f8118 * local_6c;
    iVar2 = local_74 - local_98;
    if (DAT_1402f8118 < local_74 - local_98) {
      iVar2 = DAT_1402f8118;
    }
    if (local_c8 == 0) {
      if (local_c0 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
    }
    else {
      local_b8 = *(int *)(local_c8 + 0x18);
    }
    iVar14 = local_b8 - ((int)(local_d0[0] + (local_d0[0] >> 0x1f & 7U)) >> 3);
    if ((local_78[0] == -0x5433) && (iVar2 != iVar14)) {
      FUN_14003c600(param_8,
                    L"UDP frag length is wrong #2! desiredFragLength=%d, fragPayloadLength=%d",iVar2
                    ,iVar14);
      local_d8 = &local_c8;
      FUN_14019a730(&local_c8);
      if (local_c0 == (uint *)0x0) {
        return 2;
      }
      if (-1 < local_b4) {
        return 2;
      }
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_d8 = param_1 + 1;
    lVar6 = FUN_14019c660(local_d8);
    if (lVar6 == 0) {
      uVar7 = (**(code **)(*(longlong *)*param_1 + 0x18))();
      lVar6 = FUN_14019f130(uVar7);
      *(longlong *)(lVar6 + 0x70) = param_6;
      local_88[0] = lVar6;
      FUN_14019e750(local_d8,local_a0,local_88);
      lVar10 = local_c8;
      puVar13 = local_c0;
      iVar4 = local_6c;
    }
    else {
      lVar6 = *(longlong *)(lVar6 + 0x10);
    }
    plVar8 = local_90;
    if (local_78[0] == -0x5433) {
      uVar1 = (ulonglong)local_70 % (ulonglong)*(uint *)(lVar6 + 0x28);
      puVar13 = (uint *)0x0;
      puVar9 = puVar13;
      if ((*(longlong *)(lVar6 + 8) != 0) &&
         (puVar12 = *(uint **)(*(longlong *)(lVar6 + 8) + uVar1 * 8), puVar12 != (uint *)0x0)) {
        while (puVar9 = puVar13, (uint)uVar1 == puVar12[8] % *(uint *)(lVar6 + 0x28)) {
          puVar9 = puVar12;
          if ((*puVar12 == local_70) ||
             (puVar12 = *(uint **)(puVar12 + 4), puVar9 = puVar13, puVar12 == (uint *)0x0)) break;
        }
      }
      if (puVar9 == (uint *)0x0) {
        plVar8 = (longlong *)FUN_14019d480();
        local_d8 = plVar8;
        FUN_14003cda0(plVar8 + 5,local_74);
        FUN_14018acf0(plVar8);
        plVar8[0xb] = param_6;
        puVar9 = puVar13;
        if ((int)plVar8[3] != 0) {
          puVar9 = (uint *)plVar8[2];
        }
        memset(puVar9,0,(longlong)(int)plVar8[3]);
        puVar9 = (uint *)FUN_14019e6b0(lVar6,&local_70,&local_d8);
        iVar4 = local_6c;
      }
      else {
        plVar8 = *(longlong **)(puVar9 + 2);
        if ((int)plVar8[8] != local_74) {
          FUN_14003c600(param_8,
                        L"UDP frag length is wrong #3! assembledDataCount=%d, packetLength=%d",
                        (int)plVar8[8],local_74);
          FUN_1401455c0(lVar6,puVar9,0);
          FUN_14018b6e0(plVar8);
          local_d8 = &local_c8;
          FUN_14019a730(&local_c8);
          if (local_c0 == (uint *)0x0) {
            return 2;
          }
          if (-1 < local_b4) {
            return 2;
          }
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
      }
      iVar2 = (int)plVar8[3];
      if (iVar2 <= iVar4) {
        FUN_14001f680(param_8,L"UDP FragID is wrong!");
        local_d8 = &local_c8;
        FUN_14019a730(&local_c8);
        if ((local_c0 != (uint *)0x0) && (local_b4 < 0)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        return 2;
      }
      if ((int)plVar8[8] < iVar14 + local_98) {
        FUN_14001f680(param_8,L"UDP Frag Payload Length is wrong!");
        local_d8 = &local_c8;
        FUN_14019a730(&local_c8);
        if (local_c0 == (uint *)0x0) {
          return 2;
        }
        if (-1 < local_b4) {
          return 2;
        }
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if ((iVar4 < 0) || (iVar2 <= iVar4)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      if (*(char *)(plVar8[2] + (longlong)iVar4) == '\0') {
        if (iVar2 <= iVar4) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        *(undefined1 *)(plVar8[2] + (longlong)iVar4) = 1;
        *(int *)(plVar8 + 10) = (int)plVar8[10] + 1;
        *(double *)(lVar6 + 0x60) = (double)local_a8 + *(double *)(lVar6 + 0x60);
        *(longlong *)(lVar6 + 0x70) = param_6;
        puVar12 = local_c0;
        if (local_c0 == (uint *)0x0) {
          if (local_c8 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14019a830();
          }
          puVar12 = puVar13;
          if (*(int *)(local_c8 + 0x18) != 0) {
            puVar12 = *(uint **)(local_c8 + 0x10);
          }
        }
        if ((int)plVar8[8] != 0) {
          puVar13 = (uint *)plVar8[7];
        }
        FUN_1400224d0((longlong)puVar13 + (longlong)local_98,
                      (longlong)((int)(local_d0[0] + (local_d0[0] >> 0x1f & 7U)) >> 3) +
                      (longlong)puVar12,(longlong)iVar14);
      }
      if ((int)plVar8[3] == (int)plVar8[10]) {
        *(undefined4 *)(local_90 + 2) = *(undefined4 *)(local_a0 + 8);
        *(undefined2 *)((longlong)local_90 + 0x14) = *(undefined2 *)(local_a0 + 0xc);
        *local_90 = (longlong)plVar8;
        if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000c6c0(0x80004005);
        }
        FUN_1401455c0(lVar6,puVar9,0);
        local_d8 = &local_c8;
        FUN_14019a730(&local_c8);
        if (local_c0 == (uint *)0x0) {
          return 0;
        }
        if (-1 < local_b4) {
          return 0;
        }
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
    }
    else if ((local_78[0] == -0x5432) && (0 < iVar14)) {
      puVar9 = (uint *)0x0;
      if (puVar13 == (uint *)0x0) {
        if (lVar10 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        puVar13 = puVar9;
        if (*(int *)(lVar10 + 0x18) != 0) {
          puVar13 = *(uint **)(lVar10 + 0x10);
        }
      }
      *(double *)(lVar6 + 0x60) = (double)local_a8 + *(double *)(lVar6 + 0x60);
      *(longlong *)(lVar6 + 0x70) = param_6;
      *(undefined4 *)(local_90 + 2) = *(undefined4 *)(local_a0 + 8);
      *(undefined2 *)((longlong)local_90 + 0x14) = *(undefined2 *)(local_a0 + 0xc);
      lVar10 = FUN_14019d480();
      FUN_14003cda0(lVar10 + 0x28,iVar14);
      if (*(int *)(lVar10 + 0x40) != 0) {
        puVar9 = *(uint **)(lVar10 + 0x38);
      }
      FUN_1400224d0(puVar9,(longlong)((int)(local_d0[0] + (local_d0[0] >> 0x1f & 7U)) >> 3) +
                           (longlong)puVar13,(longlong)iVar14);
      *plVar8 = lVar10;
      local_d8 = &local_c8;
      FUN_14019a730(&local_c8);
      if ((local_c0 != (uint *)0x0) && (local_b4 < 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      return 0;
    }
    local_d8 = &local_c8;
    FUN_14019a730(&local_c8);
    if ((local_c0 != (uint *)0x0) && (local_b4 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
  }
  else {
    local_d8 = &local_c8;
    FUN_14019a730(&local_c8);
    if ((local_c0 != (uint *)0x0) && (local_b4 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
  }
  return 1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_14019fd10(undefined8 *param_1)

{
  undefined8 *puVar1;
  int iVar2;
  int iVar3;
  undefined8 uVar4;
  longlong *plVar5;
  uint uVar6;
  undefined8 *puVar7;
  char cVar8;
  uint uVar9;
  uint uVar10;
  int iVar11;
  longlong lVar12;
  longlong *plVar13;
  longlong lVar14;
  int iVar15;
  ulonglong uVar16;
  longlong lVar17;
  bool bVar18;
  bool bVar19;
  double dVar20;
  ulonglong uVar21;
  ulonglong uVar22;
  undefined8 *puVar23;
  ulonglong uVar24;
  ulonglong uVar25;
  longlong lVar26;
  undefined *puVar27;
  undefined1 local_90 [88];
  
  dVar20 = (double)(**(code **)(*(longlong *)*param_1 + 0x10))();
  puVar1 = param_1 + 1;
  puVar23 = puVar1;
  if (param_1[5] == 0) {
    uVar16 = 0;
  }
  else {
    uVar16 = param_1[3];
  }
  do {
    uVar21 = uVar16;
    if ((uVar21 == 0) && (puVar23 == puVar1)) {
      return;
    }
    if (uVar21 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    lVar17 = *(longlong *)(uVar21 + 0x10);
    uVar22 = uVar21;
    uVar16 = 0;
    lVar26 = lVar17;
    if (*(longlong *)(lVar17 + 0x20) != 0) {
      uVar16 = *(ulonglong *)(lVar17 + 0x10);
    }
    while ((uVar24 = uVar16, uVar16 = 0, uVar24 != 0 || (lVar17 != *(longlong *)(uVar21 + 0x10)))) {
      if (uVar24 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      lVar14 = *(longlong *)(uVar24 + 8);
      if (dVar20 - *(double *)(lVar14 + 0x58) <= _DAT_1402f8128) {
        if (uVar24 != 0) {
          uVar16 = *(ulonglong *)(uVar24 + 0x10);
        }
      }
      else {
        puVar27 = &DAT_140319128;
        uVar25 = uVar24;
        FUN_1400a1c30(&DAT_140319128);
        *(undefined4 *)(lVar14 + 0x50) = 0;
        *(undefined8 *)(lVar14 + 0x58) = 0;
        iVar11 = *(int *)(lVar14 + 0x18);
        if (iVar11 != 0) {
          iVar2 = *(int *)(lVar14 + 0x1c);
          if (iVar2 < 0) {
            iVar3 = *(int *)(lVar14 + 0x24);
            if (iVar3 == 0) {
              uVar9 = (int)(iVar11 + (iVar11 >> 0x1f & 7U)) >> 3;
              uVar10 = 0x400;
              if ((int)uVar9 < 0x400) {
                uVar10 = uVar9;
              }
              uVar16 = 4;
              if (4 < (int)uVar10) {
                uVar16 = (ulonglong)uVar10;
              }
LAB_14019fe83:
              iVar11 = *(int *)(lVar14 + 0x20);
              iVar15 = (int)uVar16;
              bVar19 = SBORROW4(iVar11,iVar15);
              iVar3 = iVar11 - iVar15;
              bVar18 = iVar11 == iVar15;
            }
            else {
              if (iVar3 == 1) {
                uVar9 = (int)(iVar11 + (iVar11 >> 0x1f & 7U)) >> 3;
                uVar10 = 0x10;
                if (0x10 < (int)uVar9) {
                  uVar10 = uVar9;
                }
                uVar16 = (ulonglong)uVar10;
                if (uVar10 < 0x41) {
                  uVar16 = 0x40;
                }
                goto LAB_14019fe83;
              }
              if (iVar3 != 2) {
                    // WARNING: Subroutine does not return
                FUN_1400a26d0();
              }
              iVar11 = *(int *)(lVar14 + 0x20);
              bVar19 = false;
              bVar18 = iVar11 == 0;
              iVar3 = iVar11;
            }
            iVar15 = (int)uVar16;
            if (!bVar18 && bVar19 == iVar3 < 0) {
              iVar15 = iVar11;
            }
            plVar13 = *(longlong **)(lVar14 + 8);
            if (iVar2 == 0) {
              if (plVar13 == (longlong *)0x0) {
                lVar12 = FUN_1400a34c0((longlong)iVar15);
              }
              else {
                lVar12 = (**(code **)(*plVar13 + 8))(plVar13,(longlong)iVar15);
              }
            }
            else {
              uVar4 = *(undefined8 *)(lVar14 + 0x10);
              if (plVar13 == (longlong *)0x0) {
                lVar12 = FUN_1400a34f0(uVar4,(longlong)iVar15,iVar2,uVar4,uVar22,puVar23,uVar25,
                                       lVar26,puVar27,1);
              }
              else {
                lVar12 = (**(code **)(*plVar13 + 0x10))(plVar13,uVar4);
              }
              if (lVar12 == 0) {
                FUN_1400a2320(local_90,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_90,(ThrowInfo *)&DAT_1402f4860);
              }
            }
            *(longlong *)(lVar14 + 0x10) = lVar12;
            *(int *)(lVar14 + 0x1c) = iVar15;
          }
          *(undefined4 *)(lVar14 + 0x18) = 0;
        }
        uVar10 = 0;
        iVar11 = *(int *)(lVar14 + 0x40);
        if (iVar11 != 0) {
          if (*(int *)(lVar14 + 0x44) < 0) {
            iVar2 = *(int *)(lVar14 + 0x4c);
            if (iVar2 == 0) {
              uVar10 = (int)(iVar11 + (iVar11 >> 0x1f & 7U)) >> 3;
              uVar9 = 0x400;
              if ((int)uVar10 < 0x400) {
                uVar9 = uVar10;
              }
              uVar10 = 4;
              if (4 < (int)uVar9) {
                uVar10 = uVar9;
              }
LAB_14019ff57:
              uVar9 = *(uint *)(lVar14 + 0x48);
              bVar19 = SBORROW4(uVar9,uVar10);
              uVar6 = uVar9 - uVar10;
              bVar18 = uVar9 == uVar10;
            }
            else {
              if (iVar2 == 1) {
                uVar9 = (int)(iVar11 + (iVar11 >> 0x1f & 7U)) >> 3;
                uVar10 = 0x10;
                if (0x10 < (int)uVar9) {
                  uVar10 = uVar9;
                }
                if (uVar10 < 0x41) {
                  uVar10 = 0x40;
                }
                goto LAB_14019ff57;
              }
              if (iVar2 != 2) {
                    // WARNING: Subroutine does not return
                FUN_1400a26d0();
              }
              uVar9 = *(uint *)(lVar14 + 0x48);
              bVar19 = false;
              bVar18 = uVar9 == 0;
              uVar6 = uVar9;
            }
            if (!bVar18 && bVar19 == (int)uVar6 < 0) {
              uVar10 = uVar9;
            }
            plVar13 = *(longlong **)(lVar14 + 0x30);
            if (*(int *)(lVar14 + 0x44) == 0) {
              if (plVar13 == (longlong *)0x0) {
                lVar12 = FUN_1400a34c0((longlong)(int)uVar10);
              }
              else {
                lVar12 = (**(code **)(*plVar13 + 8))(plVar13,(longlong)(int)uVar10);
              }
            }
            else {
              if (plVar13 == (longlong *)0x0) {
                lVar12 = FUN_1400a34f0(*(undefined8 *)(lVar14 + 0x38),(longlong)(int)uVar10);
              }
              else {
                lVar12 = (**(code **)(*plVar13 + 0x10))(plVar13,*(undefined8 *)(lVar14 + 0x38));
              }
              if (lVar12 == 0) {
                FUN_1400a2320(local_90,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_90,(ThrowInfo *)&DAT_1402f4860);
              }
            }
            *(longlong *)(lVar14 + 0x38) = lVar12;
            *(uint *)(lVar14 + 0x44) = uVar10;
          }
          *(undefined4 *)(lVar14 + 0x40) = 0;
        }
        puVar7 = DAT_140319120;
        if ((*(short *)(lVar14 + -8) != 0x1de6) || (*(longlong *)(lVar14 + 0x60) != 0)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        *(undefined8 *)(lVar14 + 0x60) = *DAT_140319120;
        *puVar7 = (short *)(lVar14 + -8);
        FUN_1400d1290(&DAT_140319128);
        if (lVar17 != *(longlong *)(uVar21 + 0x10)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        if (uVar24 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14000c6c0(0x80004005);
        }
        uVar16 = *(ulonglong *)(uVar24 + 0x10);
        FUN_1401455c0();
        lVar17 = lVar26;
      }
    }
    if ((*(longlong *)(*(longlong *)(uVar21 + 0x10) + 0x20) == 0) &&
       (cVar8 = FUN_1401c1fc0(*(longlong *)(uVar21 + 0x10) + 0x58,dVar20), cVar8 != '\0')) {
      lVar17 = *(longlong *)(uVar21 + 0x10);
      plVar13 = (longlong *)(**(code **)(*(longlong *)*param_1 + 0x18))();
      if (*(longlong *)(lVar17 + 0x20) != 0) {
        uVar16 = *(ulonglong *)(lVar17 + 0x10);
      }
      for (; uVar16 != 0; uVar16 = *(ulonglong *)(uVar16 + 0x10)) {
        lVar26 = *(longlong *)(uVar16 + 8);
        FUN_1400a1c30(&DAT_140319128);
        *(undefined4 *)(lVar26 + 0x50) = 0;
        *(undefined8 *)(lVar26 + 0x58) = 0;
        if (*(int *)(lVar26 + 0x18) != 0) {
          if (*(int *)(lVar26 + 0x1c) < 0) {
            iVar11 = FUN_14018a4a0(lVar26,0);
            plVar5 = *(longlong **)(lVar26 + 8);
            if (*(int *)(lVar26 + 0x1c) == 0) {
              if (plVar5 == (longlong *)0x0) {
                lVar14 = FUN_1400a34c0((longlong)iVar11);
              }
              else {
                lVar14 = (**(code **)(*plVar5 + 8))();
              }
            }
            else {
              if (plVar5 == (longlong *)0x0) {
                lVar14 = FUN_1400a34f0(*(undefined8 *)(lVar26 + 0x10));
              }
              else {
                lVar14 = (**(code **)(*plVar5 + 0x10))();
              }
              if (lVar14 == 0) {
                FUN_1400a2320(local_90,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_90,(ThrowInfo *)&DAT_1402f4860);
              }
            }
            *(longlong *)(lVar26 + 0x10) = lVar14;
            *(int *)(lVar26 + 0x1c) = iVar11;
          }
          *(undefined4 *)(lVar26 + 0x18) = 0;
        }
        if (*(int *)(lVar26 + 0x40) != 0) {
          if (*(int *)(lVar26 + 0x44) < 0) {
            iVar11 = FUN_14003cd00(lVar26 + 0x28);
            plVar5 = *(longlong **)(lVar26 + 0x30);
            if (*(int *)(lVar26 + 0x44) == 0) {
              if (plVar5 == (longlong *)0x0) {
                lVar14 = FUN_1400a34c0((longlong)iVar11);
              }
              else {
                lVar14 = (**(code **)(*plVar5 + 8))();
              }
            }
            else {
              if (plVar5 == (longlong *)0x0) {
                lVar14 = FUN_1400a34f0(*(undefined8 *)(lVar26 + 0x38));
              }
              else {
                lVar14 = (**(code **)(*plVar5 + 0x10))();
              }
              if (lVar14 == 0) {
                FUN_1400a2320(local_90,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_90,(ThrowInfo *)&DAT_1402f4860);
              }
            }
            *(longlong *)(lVar26 + 0x38) = lVar14;
            *(int *)(lVar26 + 0x44) = iVar11;
          }
          *(undefined4 *)(lVar26 + 0x40) = 0;
        }
        puVar7 = DAT_140319120;
        if ((*(short *)(lVar26 + -8) != 0x1de6) || (*(longlong *)(lVar26 + 0x60) != 0)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        *(undefined8 *)(lVar26 + 0x60) = *DAT_140319120;
        *puVar7 = (short *)(lVar26 + -8);
        FUN_1400d1290(&DAT_140319128);
      }
      FUN_14019e040(lVar17);
      (**(code **)(*plVar13 + 0x18))(plVar13,lVar17);
      if (puVar23 != puVar1) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if (uVar21 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      uVar16 = *(ulonglong *)(uVar21 + 0x18);
      FUN_1401461b0(puVar1,uVar21,0);
    }
    else if (uVar21 != 0) {
      uVar16 = *(ulonglong *)(uVar21 + 0x18);
    }
  } while( true );
}



void FUN_1401a03a0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if (*(longlong *)(param_1 + 0x28) == 0) {
    lVar1 = 0;
  }
  else {
    lVar1 = *(longlong *)(param_1 + 0x18);
  }
  for (; lVar1 != 0; lVar1 = *(longlong *)(lVar1 + 0x18)) {
    FUN_1401c20e0(*(longlong *)(lVar1 + 0x10) + 0x58,param_2);
  }
  FUN_14019fd10(param_1);
  return;
}



ulonglong FUN_1401a0400(undefined8 *param_1,longlong param_2)

{
  uint uVar1;
  undefined8 uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  longlong lVar5;
  
  uVar1 = *(uint *)(param_1 + 6);
  uVar3 = (ulonglong)((uint)*(ushort *)(param_2 + 0xc) ^ *(uint *)(param_2 + 8));
  uVar4 = uVar3 / uVar1;
  uVar3 = uVar3 % (ulonglong)uVar1;
  if ((param_1[2] != 0) && (lVar5 = *(longlong *)(param_1[2] + uVar3 * 8), lVar5 != 0)) {
    while( true ) {
      uVar4 = (ulonglong)*(uint *)(lVar5 + 0x28) / (ulonglong)uVar1;
      if ((uint)uVar3 != *(uint *)(lVar5 + 0x28) % uVar1) break;
      if ((*(uint *)(lVar5 + 8) == *(uint *)(param_2 + 8)) &&
         (*(ushort *)(lVar5 + 0xc) == *(ushort *)(param_2 + 0xc))) {
        if (lVar5 == 0) {
          return uVar4;
        }
        uVar2 = (**(code **)(*(longlong *)*param_1 + 0x18))();
        FUN_14019ee60(uVar2,*(undefined8 *)(lVar5 + 0x10));
        uVar3 = FUN_1401461b0(param_1 + 1,lVar5,0);
        return uVar3;
      }
      lVar5 = *(longlong *)(lVar5 + 0x18);
      if (lVar5 == 0) {
        return uVar4;
      }
    }
  }
  return uVar4;
}



void FUN_1401a04b0(undefined8 *param_1)

{
  undefined8 *puVar1;
  int iVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  undefined8 uVar6;
  longlong *plVar7;
  uint uVar8;
  undefined8 *puVar9;
  int iVar10;
  uint uVar11;
  uint uVar12;
  longlong lVar13;
  longlong lVar14;
  longlong *plVar15;
  longlong lVar16;
  int iVar17;
  longlong lVar18;
  longlong lVar19;
  ulonglong uVar20;
  bool bVar21;
  bool bVar22;
  undefined8 *puVar23;
  longlong lVar24;
  undefined *puVar25;
  undefined1 uVar26;
  undefined1 local_a0 [104];
  
  puVar1 = param_1 + 1;
  lVar18 = 0;
  if (param_1[5] != 0) {
    lVar18 = param_1[3];
  }
  do {
    lVar19 = 0;
    if (lVar18 == 0) {
      return;
    }
    if (lVar18 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    lVar4 = *(longlong *)(lVar18 + 0x10);
    lVar16 = lVar18;
    puVar23 = puVar1;
    if (*(longlong *)(lVar4 + 0x20) != 0) {
      lVar19 = *(longlong *)(lVar4 + 0x10);
    }
    while ((uVar20 = 0, lVar19 != 0 || (lVar4 != *(longlong *)(lVar18 + 0x10)))) {
      if (lVar19 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      lVar5 = *(longlong *)(lVar19 + 8);
      puVar25 = &DAT_140319128;
      lVar14 = lVar19;
      lVar24 = lVar4;
      FUN_1400a1c30(&DAT_140319128);
      uVar26 = 1;
      *(undefined4 *)(lVar5 + 0x50) = 0;
      *(undefined8 *)(lVar5 + 0x58) = 0;
      iVar10 = *(int *)(lVar5 + 0x18);
      if (iVar10 != 0) {
        iVar2 = *(int *)(lVar5 + 0x1c);
        if (iVar2 < 0) {
          iVar3 = *(int *)(lVar5 + 0x24);
          if (iVar3 == 0) {
            uVar11 = (int)(iVar10 + (iVar10 >> 0x1f & 7U)) >> 3;
            uVar12 = 0x400;
            if ((int)uVar11 < 0x400) {
              uVar12 = uVar11;
            }
            uVar20 = 4;
            if (4 < (int)uVar12) {
              uVar20 = (ulonglong)uVar12;
            }
LAB_1401a05fe:
            iVar10 = *(int *)(lVar5 + 0x20);
            iVar17 = (int)uVar20;
            bVar22 = SBORROW4(iVar10,iVar17);
            iVar3 = iVar10 - iVar17;
            bVar21 = iVar10 == iVar17;
          }
          else {
            if (iVar3 == 1) {
              uVar11 = (int)(iVar10 + (iVar10 >> 0x1f & 7U)) >> 3;
              uVar12 = 0x10;
              if (0x10 < (int)uVar11) {
                uVar12 = uVar11;
              }
              uVar20 = (ulonglong)uVar12;
              if (uVar12 < 0x41) {
                uVar20 = 0x40;
              }
              goto LAB_1401a05fe;
            }
            if (iVar3 != 2) {
                    // WARNING: Subroutine does not return
              FUN_1400a26d0();
            }
            iVar10 = *(int *)(lVar5 + 0x20);
            bVar22 = false;
            bVar21 = iVar10 == 0;
            iVar3 = iVar10;
          }
          iVar17 = (int)uVar20;
          if (!bVar21 && bVar22 == iVar3 < 0) {
            iVar17 = iVar10;
          }
          plVar15 = *(longlong **)(lVar5 + 8);
          if (iVar2 == 0) {
            if (plVar15 == (longlong *)0x0) {
              lVar13 = FUN_1400a34c0((longlong)iVar17);
            }
            else {
              lVar13 = (**(code **)(*plVar15 + 8))(plVar15,(longlong)iVar17);
            }
          }
          else {
            uVar6 = *(undefined8 *)(lVar5 + 0x10);
            if (plVar15 == (longlong *)0x0) {
              lVar13 = FUN_1400a34f0(uVar6,(longlong)iVar17,iVar2,uVar6,lVar16,puVar23,lVar14,lVar24
                                     ,puVar25,1);
            }
            else {
              lVar13 = (**(code **)(*plVar15 + 0x10))(plVar15,uVar6);
            }
            if (lVar13 == 0) {
              FUN_1400a2320(local_a0,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
              _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1402f4860);
            }
          }
          *(longlong *)(lVar5 + 0x10) = lVar13;
          *(int *)(lVar5 + 0x1c) = iVar17;
        }
        *(undefined4 *)(lVar5 + 0x18) = 0;
      }
      uVar12 = 0;
      iVar10 = *(int *)(lVar5 + 0x40);
      if (iVar10 != 0) {
        iVar2 = *(int *)(lVar5 + 0x44);
        if (iVar2 < 0) {
          iVar3 = *(int *)(lVar5 + 0x4c);
          if (iVar3 == 0) {
            uVar12 = (int)(iVar10 + (iVar10 >> 0x1f & 7U)) >> 3;
            uVar11 = 0x400;
            if ((int)uVar12 < 0x400) {
              uVar11 = uVar12;
            }
            uVar12 = 4;
            if (4 < (int)uVar11) {
              uVar12 = uVar11;
            }
LAB_1401a06d2:
            uVar11 = *(uint *)(lVar5 + 0x48);
            bVar22 = SBORROW4(uVar11,uVar12);
            uVar8 = uVar11 - uVar12;
            bVar21 = uVar11 == uVar12;
          }
          else {
            if (iVar3 == 1) {
              uVar11 = (int)(iVar10 + (iVar10 >> 0x1f & 7U)) >> 3;
              uVar12 = 0x10;
              if (0x10 < (int)uVar11) {
                uVar12 = uVar11;
              }
              if (uVar12 < 0x41) {
                uVar12 = 0x40;
              }
              goto LAB_1401a06d2;
            }
            if (iVar3 != 2) {
                    // WARNING: Subroutine does not return
              FUN_1400a26d0();
            }
            uVar11 = *(uint *)(lVar5 + 0x48);
            bVar22 = false;
            bVar21 = uVar11 == 0;
            uVar8 = uVar11;
          }
          if (!bVar21 && bVar22 == (int)uVar8 < 0) {
            uVar12 = uVar11;
          }
          plVar15 = *(longlong **)(lVar5 + 0x30);
          if (iVar2 == 0) {
            if (plVar15 == (longlong *)0x0) {
              lVar14 = FUN_1400a34c0((longlong)(int)uVar12);
            }
            else {
              lVar14 = (**(code **)(*plVar15 + 8))(plVar15,(longlong)(int)uVar12);
            }
          }
          else {
            uVar6 = *(undefined8 *)(lVar5 + 0x38);
            if (plVar15 == (longlong *)0x0) {
              lVar14 = FUN_1400a34f0(uVar6,(longlong)(int)uVar12,iVar2,uVar6,lVar16,puVar23,lVar14,
                                     lVar24,puVar25,uVar26);
            }
            else {
              lVar14 = (**(code **)(*plVar15 + 0x10))(plVar15,uVar6);
            }
            if (lVar14 == 0) {
              FUN_1400a2320(local_a0,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
              _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1402f4860);
            }
          }
          *(longlong *)(lVar5 + 0x38) = lVar14;
          *(uint *)(lVar5 + 0x44) = uVar12;
        }
        *(undefined4 *)(lVar5 + 0x40) = 0;
      }
      puVar9 = DAT_140319120;
      if ((*(short *)(lVar5 + -8) != 0x1de6) || (*(longlong *)(lVar5 + 0x60) != 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      *(undefined8 *)(lVar5 + 0x60) = *DAT_140319120;
      *puVar9 = (short *)(lVar5 + -8);
      FUN_1400d1290(&DAT_140319128);
      if (lVar4 != *(longlong *)(lVar18 + 0x10)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if (lVar19 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      lVar5 = *(longlong *)(lVar19 + 0x10);
      FUN_1401455c0(*(longlong *)(lVar18 + 0x10),lVar19);
      lVar19 = lVar5;
    }
    lVar19 = *(longlong *)(lVar18 + 0x10);
    plVar15 = (longlong *)(**(code **)(*(longlong *)*param_1 + 0x18))();
    if (*(longlong *)(lVar19 + 0x20) != 0) {
      uVar20 = *(ulonglong *)(lVar19 + 0x10);
    }
    for (; uVar12 = 0, uVar20 != 0; uVar20 = *(ulonglong *)(uVar20 + 0x10)) {
      lVar4 = *(longlong *)(uVar20 + 8);
      FUN_1400a1c30(&DAT_140319128);
      *(undefined4 *)(lVar4 + 0x50) = 0;
      *(undefined8 *)(lVar4 + 0x58) = 0;
      iVar10 = *(int *)(lVar4 + 0x18);
      if (iVar10 != 0) {
        if (*(int *)(lVar4 + 0x1c) < 0) {
          iVar2 = *(int *)(lVar4 + 0x24);
          if (iVar2 == 0) {
            uVar12 = (int)(iVar10 + (iVar10 >> 0x1f & 7U)) >> 3;
            uVar11 = 0x400;
            if ((int)uVar12 < 0x400) {
              uVar11 = uVar12;
            }
            uVar12 = 4;
            if (4 < (int)uVar11) {
              uVar12 = uVar11;
            }
LAB_1401a0882:
            uVar11 = *(uint *)(lVar4 + 0x20);
            bVar22 = SBORROW4(uVar11,uVar12);
            uVar8 = uVar11 - uVar12;
            bVar21 = uVar11 == uVar12;
          }
          else {
            if (iVar2 == 1) {
              uVar11 = (int)(iVar10 + (iVar10 >> 0x1f & 7U)) >> 3;
              uVar12 = 0x10;
              if (0x10 < (int)uVar11) {
                uVar12 = uVar11;
              }
              if (uVar12 < 0x41) {
                uVar12 = 0x40;
              }
              goto LAB_1401a0882;
            }
            if (iVar2 != 2) {
                    // WARNING: Subroutine does not return
              FUN_1400a26d0();
            }
            uVar11 = *(uint *)(lVar4 + 0x20);
            bVar22 = false;
            bVar21 = uVar11 == 0;
            uVar8 = uVar11;
          }
          if (!bVar21 && bVar22 == (int)uVar8 < 0) {
            uVar12 = uVar11;
          }
          plVar7 = *(longlong **)(lVar4 + 8);
          if (*(int *)(lVar4 + 0x1c) == 0) {
            if (plVar7 == (longlong *)0x0) {
              lVar16 = FUN_1400a34c0((longlong)(int)uVar12);
            }
            else {
              lVar16 = (**(code **)(*plVar7 + 8))(plVar7,(longlong)(int)uVar12);
            }
          }
          else {
            if (plVar7 == (longlong *)0x0) {
              lVar16 = FUN_1400a34f0(*(undefined8 *)(lVar4 + 0x10),(longlong)(int)uVar12);
            }
            else {
              lVar16 = (**(code **)(*plVar7 + 0x10))(plVar7,*(undefined8 *)(lVar4 + 0x10));
            }
            if (lVar16 == 0) {
              FUN_1400a2320(local_a0,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
              _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1402f4860);
            }
          }
          *(longlong *)(lVar4 + 0x10) = lVar16;
          *(uint *)(lVar4 + 0x1c) = uVar12;
        }
        *(undefined4 *)(lVar4 + 0x18) = 0;
      }
      uVar12 = 0;
      iVar10 = *(int *)(lVar4 + 0x40);
      if (iVar10 != 0) {
        if (*(int *)(lVar4 + 0x44) < 0) {
          iVar2 = *(int *)(lVar4 + 0x4c);
          if (iVar2 == 0) {
            uVar12 = (int)(iVar10 + (iVar10 >> 0x1f & 7U)) >> 3;
            uVar11 = 0x400;
            if ((int)uVar12 < 0x400) {
              uVar11 = uVar12;
            }
            uVar12 = 4;
            if (4 < (int)uVar11) {
              uVar12 = uVar11;
            }
LAB_1401a0956:
            uVar11 = *(uint *)(lVar4 + 0x48);
            bVar22 = SBORROW4(uVar11,uVar12);
            uVar8 = uVar11 - uVar12;
            bVar21 = uVar11 == uVar12;
          }
          else {
            if (iVar2 == 1) {
              uVar11 = (int)(iVar10 + (iVar10 >> 0x1f & 7U)) >> 3;
              uVar12 = 0x10;
              if (0x10 < (int)uVar11) {
                uVar12 = uVar11;
              }
              if (uVar12 < 0x41) {
                uVar12 = 0x40;
              }
              goto LAB_1401a0956;
            }
            if (iVar2 != 2) {
                    // WARNING: Subroutine does not return
              FUN_1400a26d0();
            }
            uVar11 = *(uint *)(lVar4 + 0x48);
            bVar22 = false;
            bVar21 = uVar11 == 0;
            uVar8 = uVar11;
          }
          if (!bVar21 && bVar22 == (int)uVar8 < 0) {
            uVar12 = uVar11;
          }
          plVar7 = *(longlong **)(lVar4 + 0x30);
          if (*(int *)(lVar4 + 0x44) == 0) {
            if (plVar7 == (longlong *)0x0) {
              lVar16 = FUN_1400a34c0((longlong)(int)uVar12);
            }
            else {
              lVar16 = (**(code **)(*plVar7 + 8))(plVar7,(longlong)(int)uVar12);
            }
          }
          else {
            if (plVar7 == (longlong *)0x0) {
              lVar16 = FUN_1400a34f0(*(undefined8 *)(lVar4 + 0x38),(longlong)(int)uVar12);
            }
            else {
              lVar16 = (**(code **)(*plVar7 + 0x10))(plVar7,*(undefined8 *)(lVar4 + 0x38));
            }
            if (lVar16 == 0) {
              FUN_1400a2320(local_a0,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
              _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1402f4860);
            }
          }
          *(longlong *)(lVar4 + 0x38) = lVar16;
          *(uint *)(lVar4 + 0x44) = uVar12;
        }
        *(undefined4 *)(lVar4 + 0x40) = 0;
      }
      puVar9 = DAT_140319120;
      if ((*(short *)(lVar4 + -8) != 0x1de6) || (*(longlong *)(lVar4 + 0x60) != 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      *(undefined8 *)(lVar4 + 0x60) = *DAT_140319120;
      *puVar9 = (short *)(lVar4 + -8);
      FUN_1400d1290(&DAT_140319128);
    }
    FUN_14019e040(lVar19);
    (**(code **)(*plVar15 + 0x18))(plVar15,lVar19);
    if (puVar23 != puVar1) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (lVar18 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    lVar19 = *(longlong *)(lVar18 + 0x18);
    FUN_1401461b0(puVar1,lVar18,0);
    lVar18 = lVar19;
  } while( true );
}



void FUN_1401a0b70(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  FUN_14019eed0(param_1,*(undefined8 *)(param_1 + 0x50),param_3,param_4,0xfffffffffffffffe);
  FUN_1401a4f10(param_1);
  return;
}



void FUN_1401a0ba0(undefined8 param_1)

{
  FUN_14019ecf0();
  FUN_1401a4f10(param_1);
  return;
}



undefined8 *
FUN_1401a0bd0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  float fVar2;
  
  *param_1 = 0;
  param_1[1] = 0;
  *(undefined4 *)(param_1 + 2) = 0;
  param_1[3] = param_3;
  FUN_14019e1a0(param_1 + 4,param_2,param_3,param_4,0xfffffffffffffffe);
  param_1[0x10] = 0;
  *(undefined1 *)(param_1 + 0x11) = 1;
  param_1[0xf] = param_2;
  *(undefined8 *)((longlong)param_1 + 0x4c) = 0x3dcccccd;
  *(undefined4 *)((longlong)param_1 + 0x54) = 0x40000000;
  fVar2 = (float)*(uint *)(param_1 + 9) * 2.0;
  lVar1 = 0;
  if ((9.223372e+18 < fVar2) && (fVar2 = fVar2 - 9.223372e+18, fVar2 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_1[0xb] = (longlong)fVar2 + lVar1;
  fVar2 = (float)*(uint *)(param_1 + 9) * 0.0;
  lVar1 = 0;
  if ((9.223372e+18 < fVar2) && (fVar2 = fVar2 - 9.223372e+18, fVar2 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_1[0xc] = (longlong)fVar2 + lVar1;
  if ((ulonglong)((longlong)fVar2 + lVar1) < 0x11) {
    param_1[0xc] = 0;
  }
  return param_1;
}



void FUN_1401a0cd0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = param_1 + 0x20;
  FUN_14019ecf0(lVar1);
  FUN_14019dee0(param_1 + 0x80);
  FUN_14019ecf0(lVar1);
  FUN_1401a4f10(lVar1);
  FUN_14019c9e0(param_1);
  return;
}



undefined8 *
FUN_1401a0d30(undefined8 *param_1,longlong *param_2,undefined4 param_3,undefined8 param_4)

{
  longlong lVar1;
  float fVar2;
  undefined1 local_50 [72];
  
  FUN_14019e2e0(param_1 + 1,param_2,param_3,param_4,0xfffffffffffffffe);
  *param_1 = param_2;
  *(undefined4 *)((longlong)param_1 + 0x34) = 0x3e99999a;
  *(undefined4 *)(param_1 + 7) = 0x3d4ccccd;
  *(undefined4 *)((longlong)param_1 + 0x3c) = 0x41000000;
  fVar2 = (float)*(uint *)(param_1 + 6) * 8.0;
  lVar1 = 0;
  if ((9.223372e+18 < fVar2) && (fVar2 = fVar2 - 9.223372e+18, fVar2 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_1[8] = (longlong)fVar2 + lVar1;
  fVar2 = (float)*(uint *)(param_1 + 6) * 0.05;
  lVar1 = 0;
  if ((9.223372e+18 < fVar2) && (fVar2 = fVar2 - 9.223372e+18, fVar2 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_1[9] = (longlong)fVar2 + lVar1;
  if ((ulonglong)((longlong)fVar2 + lVar1) < 0x11) {
    param_1[9] = 0;
  }
  lVar1 = (**(code **)(*param_2 + 0x18))(param_2);
  if (lVar1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_1[5] != 0) {
    FUN_1400a2320(local_50,PTR_u_Collection_object_can_use_fast_h_1402f81d0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
  }
  param_1[0xb] = lVar1;
  return param_1;
}



ulonglong FUN_1401a0e50(longlong param_1,undefined8 param_2)

{
  uint uVar1;
  int iVar2;
  ulonglong uVar3;
  
  (**(code **)(**(longlong **)(param_1 + 0x108) + 0x10))();
  uVar1 = *(uint *)(param_1 + 0x7c);
  iVar2 = FUN_1401c1fa0(param_1 + 0x90,param_2,*(undefined8 *)(param_1 + 0xa0));
  if (iVar2 < (int)uVar1) {
    uVar3 = FUN_1401c1fa0(param_1 + 0x90,param_2,*(undefined8 *)(param_1 + 0xa0));
  }
  else {
    uVar3 = (ulonglong)uVar1;
  }
  return uVar3;
}



void FUN_1401a0ed0(longlong param_1,undefined8 param_2)

{
  (**(code **)(**(longlong **)(param_1 + 0x108) + 0x10))();
  FUN_1401a3a20(param_1 + 0x48,param_2);
  return;
}



int FUN_1401a0f10(longlong param_1)

{
  char cVar1;
  int iVar2;
  
  (**(code **)(**(longlong **)(param_1 + 0x108) + 8))();
  (**(code **)(**(longlong **)(param_1 + 0x108) + 0x10))();
  if ((*(char *)(param_1 + 0x40) == '\0') &&
     (*(char *)(*(longlong *)(param_1 + 0x110) + 0x80) == '\0')) {
    cVar1 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x28))();
    if (cVar1 == '\0') {
      *(undefined1 *)(param_1 + 0x40) = 1;
      iVar2 = FUN_1400a96e0(*(undefined8 *)(param_1 + 0x110),DAT_1402f8048);
      if (iVar2 != 0) {
        *(undefined1 *)(param_1 + 0x40) = 0;
        FUN_1400a88b0(*(undefined8 *)(param_1 + 0x110));
        return iVar2;
      }
      *(undefined8 *)(param_1 + 0x118) = 0;
    }
  }
  return 0;
}



void FUN_1401a0fc0(longlong param_1)

{
  FUN_1400a80c0(*(undefined8 *)(param_1 + 0x110));
  return;
}



undefined1 * FUN_1401a0fd0(undefined1 *param_1,undefined8 param_2,longlong param_3,longlong param_4)

{
  FUN_1401a4080(param_1 + 0x48);
  FUN_1401c10f0(param_1 + 200,(longlong)DAT_1402f80ec);
  *(undefined8 *)(param_1 + 0x110) = 0;
  *(undefined ***)(param_1 + 0x128) = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 0x130) = 0;
  *(undefined2 *)(param_1 + 0x134) = 0;
  *(undefined4 *)(param_1 + 0x130) = *(undefined4 *)(param_4 + 8);
  *(undefined2 *)(param_1 + 0x134) = *(undefined2 *)(param_4 + 0xc);
  *param_1 = 0;
  param_1[0x40] = 0;
  *(undefined8 *)(param_1 + 0x108) = param_2;
  if (param_3 != 0) {
    *(longlong *)(param_1 + 0x110) = param_3;
    FUN_1401a3a90(param_3);
  }
  *(undefined8 *)(param_1 + 0x118) = 0;
  *(undefined8 *)(param_1 + 0x120) = 0;
  return param_1;
}



void FUN_1401a10a0(longlong param_1)

{
  longlong lVar1;
  
  (**(code **)**(undefined8 **)(param_1 + 0x108))();
  (**(code **)(**(longlong **)(param_1 + 0x108) + 0x48))();
  lVar1 = *(longlong *)(param_1 + 0x110);
  if (lVar1 != 0) {
    FUN_1400a8cc0(lVar1);
    FUN_1400a3530(lVar1);
  }
  FUN_1401c1130(param_1 + 200);
  FUN_1401a4110(param_1 + 0x48);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_1401a1120(char *param_1)

{
  char cVar1;
  int iVar2;
  int iVar3;
  undefined8 uVar4;
  undefined1 auStack_6a8 [32];
  undefined8 local_688;
  void *local_678;
  undefined8 local_670;
  ulonglong local_668;
  undefined8 local_660;
  ulonglong local_18;
  
  local_688 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_6a8;
  (**(code **)(**(longlong **)(param_1 + 0x108) + 8))();
  (**(code **)(**(longlong **)(param_1 + 0x108) + 0x10))();
  if (((*(char *)(*(longlong *)(param_1 + 0x110) + 0x80) == '\0') && (*param_1 == '\0')) &&
     (cVar1 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x28))(), cVar1 == '\0')) {
    uVar4 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x30))();
    iVar2 = FUN_1401a0e50(param_1,uVar4);
    if (0 < iVar2) {
      *param_1 = '\x01';
      local_678 = (void *)0x0;
      local_660 = 0;
      local_670 = 0;
      local_668 = 100;
      FUN_1401a3d10(param_1 + 0x48,&local_678,iVar2);
      iVar3 = FUN_1400a9bf0(*(undefined8 *)(param_1 + 0x110),&local_678);
      FUN_1401c1f60(param_1 + 0x90,iVar2);
      uVar4 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x30))();
      *(double *)(param_1 + 0xb0) = (double)iVar2 + *(double *)(param_1 + 0xb0);
      *(undefined8 *)(param_1 + 0xc0) = uVar4;
      if (iVar3 == 0) {
        param_1[0x120] = '\0';
        param_1[0x121] = '\0';
        param_1[0x122] = '\0';
        param_1[0x123] = '\0';
        param_1[0x124] = '\0';
        param_1[0x125] = '\0';
        param_1[0x126] = '\0';
        param_1[0x127] = '\0';
      }
      else {
        *param_1 = '\0';
      }
      if (local_668 < 0x65) {
        return iVar3;
      }
      operator_delete__(local_678);
      return iVar3;
    }
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a12a0(char *param_1,undefined8 param_2,undefined8 param_3)

{
  undefined1 auStack_de8 [32];
  undefined8 local_dc8;
  undefined1 *local_dc0;
  undefined1 local_db8 [80];
  undefined1 local_d68 [8];
  undefined1 local_d60 [8];
  longlong local_d58;
  undefined4 local_d50;
  int local_d4c;
  undefined1 local_d40 [136];
  undefined1 local_cb8 [3200];
  undefined1 *local_38;
  undefined4 local_30;
  int local_2c;
  ulonglong local_28;
  
  local_dc8 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_de8;
  (**(code **)(**(longlong **)(param_1 + 0x108) + 0x10))();
  local_2c = 200;
  local_30 = 0;
  local_38 = local_cb8;
  FUN_140185560(local_d68);
  FUN_1401851e0(local_d68,local_d40,0x80);
  FUN_1401a3f60(param_2,local_cb8,local_d68);
  FUN_1401a3c60(param_1 + 0x48,local_cb8,param_3);
  if (*param_1 == '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x108) + 0x20))();
  }
  local_dc0 = local_d60;
  FUN_14019a730(local_d60);
  if (local_d58 != 0) {
    if (local_d4c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_d50 = 0;
  }
  if (local_38 == (undefined1 *)0x0) {
    FUN_1400a2320(local_db8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_db8,(ThrowInfo *)&DAT_1402f4860);
  }
  if (local_2c < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



undefined8 * FUN_1401a1410(undefined8 *param_1)

{
  *param_1 = Proud::CUseCount::vftable;
  *(undefined4 *)(param_1 + 8) = 0;
  return param_1;
}



void FUN_1401a1430(undefined8 *param_1)

{
  *param_1 = Proud::CUseCount::vftable;
  return;
}



undefined4 FUN_1401a1440(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x40);
}



void FUN_1401a1450(longlong param_1)

{
  LOCK();
  *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
  UNLOCK();
  return;
}



void FUN_1401a1460(longlong param_1)

{
  LOCK();
  *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + -1;
  UNLOCK();
  return;
}



longlong * FUN_1401a1470(longlong *param_1,longlong param_2)

{
  *param_1 = param_2;
  LOCK();
  *(int *)(param_2 + 0x40) = *(int *)(param_2 + 0x40) + 1;
  UNLOCK();
  return param_1;
}



void FUN_1401a1480(longlong *param_1)

{
  LOCK();
  *(int *)(*param_1 + 0x40) = *(int *)(*param_1 + 0x40) + -1;
  UNLOCK();
  return;
}



undefined8 * FUN_1401a1490(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::CUseCount::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1401a14c0(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001401a14d1. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x140) + 0x118) + 8))();
  return;
}



undefined4 FUN_1401a14e0(longlong param_1)

{
  return *(undefined4 *)(*(longlong *)(param_1 + 0x140) + 0x23c);
}



void FUN_1401a14f0(longlong param_1,longlong param_2)

{
  undefined **local_18;
  undefined4 local_10;
  undefined2 local_c;
  
  local_18 = Proud::AddrPort::vftable;
  local_10 = *(undefined4 *)(param_2 + 8);
  local_c = *(undefined2 *)(param_2 + 0xc);
  FUN_1401576a0(*(undefined8 *)(param_1 + 0x138),&local_18);
  return;
}



void FUN_1401a1530(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001401a153a. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(**(longlong **)(param_1 + 0x138) + 0xd0))();
  return;
}



void FUN_1401a1550(longlong param_1,longlong param_2)

{
  undefined **local_18;
  undefined4 local_10;
  undefined2 local_c;
  
  local_18 = Proud::AddrPort::vftable;
  local_10 = *(undefined4 *)(param_2 + 8);
  local_c = *(undefined2 *)(param_2 + 0xc);
  FUN_140145ec0(*(undefined8 *)(param_1 + 0x148),&local_18);
  return;
}



void FUN_1401a1590(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001401a159a. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(**(longlong **)(param_1 + 0x138) + 0x30))();
  return;
}



void FUN_1401a15a0(longlong param_1)

{
  undefined8 uVar1;
  undefined8 uVar2;
  char cVar3;
  int iVar4;
  longlong lVar5;
  longlong lVar6;
  undefined8 uVar7;
  undefined **local_18;
  undefined4 local_10;
  undefined2 local_c;
  
  FUN_140169430(param_1 + 0x40);
  if (*(char *)(param_1 + 0x100) == '\0') {
    lVar6 = 0;
    lVar5 = lVar6;
    if (*(longlong **)(param_1 + 0x150) != (longlong *)0x0) {
      lVar5 = **(longlong **)(param_1 + 0x150);
    }
    if (*(char *)(lVar5 + 0x80) == '\0') {
      uVar1 = *(undefined8 *)(param_1 + 0x170);
      uVar2 = *(undefined8 *)(param_1 + 0x168);
      uVar7 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x118) + 8))();
      cVar3 = FUN_14019e410(uVar2,uVar1,uVar7);
      if ((cVar3 != '\0') && (0 < *(longlong *)(*(longlong *)(param_1 + 0x170) + 8))) {
        lVar5 = *(longlong *)(param_1 + 0x170);
        *(undefined1 *)(param_1 + 0x100) = 1;
        local_18 = Proud::AddrPort::vftable;
        local_10 = *(undefined4 *)(lVar5 + 0x6a8);
        local_c = *(undefined2 *)(lVar5 + 0x6ac);
        if (*(longlong **)(param_1 + 0x150) != (longlong *)0x0) {
          lVar6 = **(longlong **)(param_1 + 0x150);
        }
        iVar4 = FUN_1400aa4b0(lVar6,lVar5,&local_18,*(undefined4 *)(lVar5 + 0x6b0));
        if (iVar4 != 0) {
          *(undefined1 *)(param_1 + 0x100) = 0;
        }
      }
    }
  }
  return;
}



undefined8 FUN_1401a16b0(longlong param_1)

{
  FUN_1401a15a0(param_1 + -0x88);
  return 0;
}



void FUN_1401a16d0(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  
  FUN_140169430();
  if (*(char *)(param_1 + 0x140) == '\0') {
    lVar3 = 0;
    lVar2 = lVar3;
    if (*(longlong **)(param_1 + 0x150) != (longlong *)0x0) {
      lVar2 = **(longlong **)(param_1 + 0x150);
    }
    if (*(char *)(lVar2 + 0x80) == '\0') {
      *(undefined1 *)(param_1 + 0x140) = 1;
      if (*(longlong **)(param_1 + 0x150) != (longlong *)0x0) {
        lVar3 = **(longlong **)(param_1 + 0x150);
      }
      iVar1 = FUN_1400a9850(lVar3,DAT_1402f804c);
      if (iVar1 != 0) {
        *(undefined1 *)(param_1 + 0x140) = 0;
      }
    }
  }
  return;
}



void FUN_1401a1740(longlong param_1)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  
  uVar3 = *(undefined8 *)(param_1 + 0x168);
  uVar2 = (**(code **)(*(longlong *)(param_1 + 8) + 8))(param_1 + 8);
  FUN_14019e800(uVar3,uVar2);
  lVar1 = *(longlong *)(param_1 + 0x178);
  if (lVar1 != 0) {
    uVar3 = (**(code **)(*(longlong *)(param_1 + 8) + 8))(param_1 + 8);
    FUN_1401a03a0(lVar1,uVar3);
  }
  return;
}



void FUN_1401a17b0(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_1401428d0(*(longlong *)(param_1 + 0x10),param_1 + -0x90);
  }
  return;
}



void FUN_1401a17e0(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_1401a0cd0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_1401a1810(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_14019de70(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_1401a1840(longlong *param_1,longlong param_2)

{
  if (*(longlong *)(param_2 + 0xa0) != 0) {
    FUN_1401428d0();
  }
  if (param_1[1] == 0) {
    *param_1 = param_2;
  }
  else {
    *(longlong *)(param_1[1] + 0x98) = param_2;
    *(longlong *)(param_2 + 0x90) = param_1[1];
  }
  param_1[1] = param_2;
  *(longlong **)(param_2 + 0xa0) = param_1;
  *(int *)(param_1 + 2) = (int)param_1[2] + 1;
  return;
}



void FUN_1401a18a0(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_1401a0b70((longlong)pvVar1 + 8);
    operator_delete(pvVar1);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a18d0(longlong param_1,undefined4 param_2,undefined2 param_3,longlong param_4,
                  undefined8 param_5,undefined4 *param_6)

{
  undefined8 uVar1;
  longlong lVar2;
  undefined1 auStack_e78 [32];
  undefined1 *local_e58;
  undefined8 local_e50;
  undefined4 *local_e48;
  undefined **local_e38;
  undefined4 local_e30;
  undefined2 local_e2c;
  longlong local_e28;
  undefined1 local_e20;
  longlong local_e18;
  undefined1 local_e10;
  undefined8 local_e08;
  undefined4 local_df8;
  undefined4 uStack_df4;
  undefined4 uStack_df0;
  undefined4 uStack_dec;
  undefined4 local_de8;
  undefined4 uStack_de4;
  undefined4 uStack_de0;
  undefined4 uStack_ddc;
  undefined1 local_dd8 [80];
  undefined1 local_d88 [8];
  undefined *local_d80;
  longlong local_d78;
  undefined4 local_d70;
  int local_d6c;
  undefined1 local_d60 [136];
  undefined1 local_cd8 [3200];
  undefined1 *local_58;
  undefined4 local_50;
  int local_4c;
  ulonglong local_48;
  
  local_e08 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_e78;
  FUN_140169430(param_1 + 0x40);
  local_4c = 200;
  local_50 = 0;
  local_58 = local_cd8;
  FUN_140185560(local_d88);
  FUN_1401851e0(local_d88,local_d60,0x80);
  FUN_1401a3f60(param_5,local_cd8,local_d88);
  local_e28 = param_1 + 0xa8;
  FUN_1400a1c30();
  local_e20 = 1;
  local_df8 = *param_6;
  uStack_df4 = param_6[1];
  uStack_df0 = param_6[2];
  uStack_dec = param_6[3];
  local_de8 = param_6[4];
  uStack_de4 = param_6[5];
  uStack_de0 = param_6[6];
  uStack_ddc = param_6[7];
  local_e38 = Proud::AddrPort::vftable;
  local_e30 = *(undefined4 *)(param_4 + 8);
  local_e2c = *(undefined2 *)(param_4 + 0xc);
  uVar1 = *(undefined8 *)(param_1 + 0x168);
  local_e50 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x118) + 8))();
  local_e48 = &local_df8;
  local_e58 = local_cd8;
  FUN_14019f250(uVar1,param_2,param_3,&local_e38);
  if (*(char *)(param_1 + 0x100) == '\0') {
    lVar2 = *(longlong *)(param_1 + 0x148) + 2000;
    local_e18 = lVar2;
    FUN_1400a1c30(lVar2);
    local_e10 = 1;
    if (*(longlong *)(param_1 + 0xa0) == 0) {
      FUN_1401a1840(*(longlong *)(param_1 + 0x148) + 0x828,param_1);
    }
    FUN_1400d1290(lVar2);
  }
  FUN_1400d1290(local_e28);
  local_e38 = &local_d80;
  FUN_14019a730(&local_d80);
  if (local_d78 != 0) {
    if (local_d6c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_d70 = 0;
  }
  if (local_58 == (undefined1 *)0x0) {
    FUN_1400a2320(local_dd8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_dd8,(ThrowInfo *)&DAT_1402f4860);
  }
  if (local_4c < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1401a1af0(longlong param_1,undefined8 param_2,longlong param_3)

{
  undefined *puVar1;
  int *piVar2;
  char cVar3;
  undefined8 uVar4;
  longlong *plVar5;
  undefined *puVar6;
  undefined1 auStack_128 [32];
  undefined *local_108;
  undefined4 local_100;
  undefined8 local_f8;
  undefined1 local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined1 local_d8 [16];
  undefined1 local_c8 [16];
  undefined1 *local_b8;
  undefined1 local_b0 [136];
  ulonglong local_28;
  
  local_e0 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_128;
  uVar4 = 0;
  local_100 = 0;
  if (*(undefined8 **)(param_1 + 0x150) != (undefined8 *)0x0) {
    uVar4 = **(undefined8 **)(param_1 + 0x150);
  }
  local_e8 = param_2;
  uVar4 = FUN_1400a7e50(uVar4,local_d8);
  FUN_1400a7310(param_2,uVar4);
  local_100 = 1;
  uVar4 = FUN_1400a7e50(*(undefined8 *)(*(longlong *)(param_3 + 0x748) + 0x110),local_c8);
  plVar5 = (longlong *)FUN_1400a7220(uVar4,&local_108);
  puVar6 = (undefined *)*plVar5;
  if ((undefined *)*plVar5 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8008;
  }
  FUN_1400a7540(param_2,puVar6);
  puVar6 = local_108;
  if (((local_108 != (undefined *)0x0) && (local_108 != PTR_DAT_1402f8008)) &&
     (puVar1 = local_108 + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_1400a3440();
    local_f8 = uVar4;
    FUN_1400a1c30(uVar4);
    local_f0 = 1;
    piVar2 = (int *)(puVar6 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar4);
  }
  puVar6 = *(undefined **)(*(longlong *)(param_1 + 0x148) + 0x218);
  if (puVar6 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8008;
  }
  FUN_1400a7540(param_2,puVar6);
  puVar6 = *(undefined **)(*(longlong *)(param_1 + 0x148) + 0x210);
  if (puVar6 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8008;
  }
  FUN_1400a7540(param_2,puVar6);
  cVar3 = FUN_1400a7960(param_2);
  if (cVar3 == '\0') {
    plVar5 = (longlong *)FUN_1400a7580(&local_108);
    puVar6 = (undefined *)*plVar5;
    if ((undefined *)*plVar5 == (undefined *)0x0) {
      puVar6 = PTR_DAT_1402f8010;
    }
    local_b8 = local_b0;
    FUN_1400a1e40(&local_b8,puVar6,3);
    FUN_1400a2120(param_2,local_b8);
    if (local_b8 != local_b0) {
      free(local_b8);
    }
    if (((local_108 != (undefined *)0x0) && (local_108 != PTR_DAT_1402f8010)) &&
       (local_108 + -8 != (undefined *)0x0)) {
      uVar4 = FUN_1400a3440();
      local_f8 = uVar4;
      FUN_1400a1c30(uVar4);
      local_f0 = 1;
      piVar2 = (int *)(local_108 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(local_108 + -8);
      }
      FUN_1400d1290(uVar4);
    }
  }
  return param_2;
}



void FUN_1401a1d10(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined8 *puVar4;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  *param_1 = Proud::CUdpSocket_S::vftable;
  param_1[1] = Proud::CUdpSocket_S::vftable;
  param_1[2] = Proud::CUdpSocket_S::vftable;
  param_1[8] = Proud::CUdpSocket_S::vftable;
  param_1[0x11] = Proud::CUdpSocket_S::vftable;
  pvVar1 = (void *)param_1[0x2f];
  if (pvVar1 != (void *)0x0) {
    FUN_1401a0b70((longlong)pvVar1 + 8);
    operator_delete(pvVar1);
  }
  param_1[0x2f] = 0;
  pvVar1 = (void *)param_1[0x2e];
  if (pvVar1 != (void *)0x0) {
    FUN_14019de70(pvVar1);
    operator_delete(pvVar1);
  }
  param_1[0x2e] = 0;
  pvVar1 = (void *)param_1[0x2d];
  if (pvVar1 != (void *)0x0) {
    FUN_1401a0cd0(pvVar1);
    operator_delete(pvVar1);
  }
  param_1[0x2d] = 0;
  if (param_1[0x14] != 0) {
    FUN_1401428d0(param_1[0x14],param_1,param_3,param_4,uVar5);
  }
  pvVar1 = (void *)param_1[0x2f];
  if (pvVar1 != (void *)0x0) {
    FUN_1401a0b70((longlong)pvVar1 + 8);
    operator_delete(pvVar1);
  }
  pvVar1 = (void *)param_1[0x2e];
  if (pvVar1 != (void *)0x0) {
    FUN_14019de70(pvVar1);
    operator_delete(pvVar1);
  }
  pvVar1 = (void *)param_1[0x2d];
  if (pvVar1 != (void *)0x0) {
    FUN_1401a0cd0(pvVar1);
    operator_delete(pvVar1);
  }
  if ((param_1[0x2a] != 0) &&
     (*(longlong *)(param_1[0x2a] + 8) = *(longlong *)(param_1[0x2a] + 8) + -1,
     *(longlong *)(param_1[0x2a] + 8) == 0)) {
    plVar2 = (longlong *)param_1[0x2a];
    lVar3 = *plVar2;
    if (lVar3 != 0) {
      FUN_1400a8cc0(lVar3);
      FUN_1400a3530(lVar3);
    }
    FUN_1400a3530(plVar2);
  }
  puVar4 = (undefined8 *)param_1[0x1c];
  if (puVar4 != (undefined8 *)0x0) {
    (**(code **)*puVar4)(puVar4,1);
  }
  FUN_1400a1cd0(param_1 + 0x15);
  param_1[0x11] = Proud::ISendIssueObject::vftable;
  FUN_1401a1430(param_1 + 8);
  param_1[2] = Proud::IUdpPacketDefragBoardDg::vftable;
  param_1[1] = Proud::IUdpPacketFragBoardDg::vftable;
  if (param_1[0x14] != 0) {
    FUN_1401428d0(param_1[0x14],param_1);
  }
  *param_1 = Proud::ICompletionContext::vftable;
  return;
}



undefined8 FUN_1401a1f30(void)

{
  return 4;
}



void FUN_1401a1f40(longlong param_1)

{
  FUN_1401a24b0(param_1 + -0x40);
  return;
}



void FUN_1401a1f50(longlong param_1)

{
  FUN_1401a24b0(param_1 + -8);
  return;
}



void FUN_1401a1f60(longlong param_1)

{
  FUN_1401a24b0(param_1 + -0x88);
  return;
}



void FUN_1401a1f70(longlong param_1)

{
  FUN_1401a24b0(param_1 + -0x10);
  return;
}



void FUN_1401a1f80(longlong param_1)

{
  FUN_1401a14c0(param_1 + -8);
  return;
}



undefined8 FUN_1401a1f90(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0xd0);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a1fa0(longlong param_1,longlong param_2)

{
  undefined2 uVar1;
  longlong lVar2;
  undefined1 auStack_d88 [32];
  undefined4 *local_d68;
  undefined4 *local_d60;
  undefined8 local_d58;
  undefined4 uStack_d50;
  undefined4 uStack_d4c;
  undefined1 local_d48 [8];
  longlong local_d40;
  longlong local_d38;
  undefined4 local_d30;
  int local_d2c;
  undefined4 local_d20 [2];
  undefined8 local_d18;
  undefined1 local_d10;
  undefined4 local_d0c;
  undefined1 local_d08;
  undefined1 local_d07;
  undefined8 local_d00;
  undefined1 local_cf8 [80];
  undefined4 local_ca8;
  undefined4 uStack_ca4;
  undefined4 uStack_ca0;
  undefined4 uStack_c9c;
  undefined4 *local_28;
  undefined4 local_20;
  int local_1c;
  ulonglong local_18;
  
  local_d00 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_d88;
  FUN_140185560(local_d48);
  FUN_140185030(local_d48);
  FUN_1401856c0(local_d48,0x800);
  FUN_1401856c0(local_d48,0);
  FUN_14003c9e0(local_d48,0x27);
  local_1c = 200;
  local_20 = 0;
  local_28 = &local_ca8;
  if (local_d40 == 0) {
    if (local_d38 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else {
    local_d30 = *(undefined4 *)(local_d40 + 0x18);
  }
  lVar2 = local_d38;
  if (local_d38 == 0) {
    if (local_d40 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    lVar2 = 0;
    if (*(int *)(local_d40 + 0x18) != 0) {
      lVar2 = *(longlong *)(local_d40 + 0x10);
    }
  }
  local_20 = 1;
  local_d58._0_4_ = (undefined4)lVar2;
  local_d58._4_4_ = (undefined4)((ulonglong)lVar2 >> 0x20);
  local_ca8 = (undefined4)local_d58;
  uStack_ca4 = local_d58._4_4_;
  uStack_c9c = uStack_d4c;
  local_d20[0] = 1;
  local_d18 = 0;
  local_d10 = 1;
  local_d0c = 0xffffffff;
  local_d08 = 1;
  local_d07 = DAT_1402f81cc;
  local_d58 = Proud::AddrPort::vftable;
  uStack_d50 = *(undefined4 *)(param_2 + 8);
  uStack_d4c = CONCAT22(uStack_d4c._2_2_,*(undefined2 *)(param_2 + 0xc));
  uStack_ca0 = local_d30;
  uVar1 = FUN_14019c290(1);
  local_d60 = local_d20;
  local_d68 = &local_ca8;
  FUN_1401a18d0(param_1 + -8,0,uVar1,&local_d58);
  if (local_28 == (undefined4 *)0x0) {
    FUN_1400a2320(local_cf8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_cf8,(ThrowInfo *)&DAT_1402f4860);
  }
  if (local_1c < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  local_d58 = (undefined **)&local_d40;
  FUN_14019a730(&local_d40);
  if ((local_d38 != 0) && (local_d2c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



undefined8 *
FUN_1401a21a0(undefined8 *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  longlong *plVar3;
  undefined4 uVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  longlong *local_res10;
  undefined8 uVar8;
  undefined8 local_50;
  undefined4 local_44;
  undefined8 *local_40;
  
  uVar8 = 0xfffffffffffffffe;
  *param_1 = Proud::ICompletionContext::vftable;
  puVar7 = (undefined8 *)0x0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  param_1[0x14] = 0;
  param_1[1] = Proud::IUdpPacketFragBoardDg::vftable;
  param_1[2] = Proud::IUdpPacketDefragBoardDg::vftable;
  FUN_1401a1410(param_1 + 8);
  *param_1 = Proud::CUdpSocket_S::vftable;
  param_1[1] = Proud::CUdpSocket_S::vftable;
  param_1[2] = Proud::CUdpSocket_S::vftable;
  param_1[8] = Proud::CUdpSocket_S::vftable;
  param_1[0x11] = Proud::CUdpSocket_S::vftable;
  uVar4 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0x15,uVar4,1,param_4,uVar8);
  param_1[0x1c] = 0;
  param_1[0x2a] = 0;
  param_1[0x2b] = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 0x2c) = 0;
  *(undefined2 *)((longlong)param_1 + 0x164) = 0;
  param_1[0x2d] = 0;
  param_1[0x2e] = 0;
  param_1[0x2f] = 0;
  FUN_1400a6440(&local_50);
  local_50 = 0;
  local_44 = 1;
  local_40 = param_1 + 0x15;
  uVar8 = FUN_1400a3590(0x800,&local_50);
  param_1[0x1c] = uVar8;
  local_res10 = operator_new(0x90);
  puVar5 = puVar7;
  if (local_res10 != (longlong *)0x0) {
    puVar5 = (undefined8 *)FUN_1401a0bd0(local_res10,param_1[0x1c],param_1 + 1);
  }
  param_1[0x2d] = puVar5;
  *(undefined1 *)(puVar5 + 0x11) = 0;
  puVar6 = operator_new(0x6b8);
  puVar5 = puVar7;
  if (puVar6 != (undefined8 *)0x0) {
    *puVar6 = 0;
    puVar6[3] = 0;
    puVar6[1] = 0;
    puVar6[2] = 100;
    puVar6[0xcf] = Proud::CFastArray<>::vftable;
    puVar6[0xd0] = 0;
    puVar6[0xd1] = 0;
    puVar6[0xd2] = 0;
    puVar6[0xd3] = 0;
    puVar6[0xd4] = Proud::AddrPort::vftable;
    *(undefined4 *)(puVar6 + 0xd5) = 0;
    *(undefined2 *)((longlong)puVar6 + 0x6ac) = 0;
    puVar5 = puVar6;
  }
  param_1[0x2e] = puVar5;
  *(undefined1 *)(param_1 + 0x20) = 0;
  *(undefined1 *)(param_1 + 0x28) = 0;
  local_res10 = (longlong *)FUN_1400a34c0(0x400);
  puVar5 = puVar7;
  if (local_res10 != (longlong *)0x0) {
    puVar5 = (undefined8 *)(param_2 + 0x60);
    if (param_2 == 0) {
      puVar5 = puVar7;
    }
    puVar5 = (undefined8 *)FUN_1400a8db0(local_res10,1,puVar5);
  }
  if (puVar5 == (undefined8 *)0x0) {
    local_res10 = (longlong *)0x0;
  }
  else {
    local_res10 = (longlong *)FUN_1400a34c0(0x10);
    local_res10[1] = 1;
    *local_res10 = (longlong)puVar5;
  }
  plVar1 = local_res10;
  FUN_1400a5190(param_1 + 0x2a,&local_res10);
  plVar3 = local_res10;
  if (plVar1 != (longlong *)0x0) {
    plVar1 = plVar1 + 1;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      lVar2 = *local_res10;
      if (lVar2 != 0) {
        FUN_1400a8cc0(lVar2);
        FUN_1400a3530(lVar2);
      }
      FUN_1400a3530(plVar3);
    }
  }
  param_1[0x29] = param_2;
  *(undefined4 *)(param_1 + 0x2c) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_1 + 0x164) = DAT_1402f83d4;
  local_res10 = operator_new(0x60);
  if (local_res10 != (longlong *)0x0) {
    puVar7 = (undefined8 *)FUN_1401a0d30(local_res10,param_1 + 2);
  }
  param_1[0x2f] = puVar7;
  return param_1;
}



undefined8 FUN_1401a24b0(undefined8 param_1,uint param_2)

{
  FUN_1401a1d10();
  if ((param_2 & 1) != 0) {
    FUN_1400a3530(param_1);
  }
  return param_1;
}



wchar_t * FUN_1401a24e0(int param_1)

{
  if (param_1 == 0) {
    return L"System";
  }
  if (param_1 != 1) {
    if (param_1 != 2) {
      return L"";
    }
    return L"HolepunchFreqFail";
  }
  return L"Holepunch";
}



wchar_t * FUN_1401a2510(int param_1)

{
  if (param_1 == 0) {
    return L"Disconnected";
  }
  if (param_1 == 1) {
    return L"Connecting";
  }
  if (param_1 == 2) {
    return L"Connected";
  }
  if (param_1 != 3) {
    return L"<undefined ConnectionState>";
  }
  return L"Disconnecting";
}



undefined8 FUN_1401a2550(undefined8 param_1)

{
  FUN_140186ca0();
  return param_1;
}



undefined8 FUN_1401a2570(undefined8 param_1,undefined8 param_2)

{
  FUN_140185490(param_1,param_2,0x10);
  return param_1;
}



void FUN_1401a2590(undefined4 param_1)

{
  undefined1 local_58 [88];
  
  FUN_1400a2320(local_58,&DAT_1402613f0,param_1);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
}



undefined8 FUN_1401a25c0(undefined8 param_1,longlong param_2)

{
  undefined *local_18;
  undefined2 local_10;
  
  FUN_1400a3440();
  local_18 = PTR_DAT_1402f8008;
  FUN_1400223a0(&local_18,param_2);
  local_10 = *(undefined2 *)(param_2 + 8);
  FUN_140186e30(param_1,&local_18);
  return param_1;
}



longlong FUN_1401a2620(longlong param_1,undefined8 param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  undefined1 local_58 [80];
  
  lVar4 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(lVar2 + 0x18);
    FUN_14003cda0(lVar2,iVar1 + 0x10);
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar2 + 0x10);
    }
    FUN_1400224d0(lVar4 + iVar1,param_2,0x10);
    goto LAB_1401a26f2;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  iVar3 = iVar1 + 0x10;
  if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(int *)(param_1 + 0x18) = iVar3;
  FUN_1400224d0((longlong)iVar1 + *(longlong *)(param_1 + 0x10),param_2,0x10);
LAB_1401a26f2:
  FUN_14003ced0(param_1);
  return param_1;
}



void FUN_1401a2720(undefined8 param_1,char *param_2)

{
  wchar_t *pwVar1;
  
  pwVar1 = L"false";
  if (*param_2 != '\0') {
    pwVar1 = L"true";
  }
  FUN_14003c890(param_1,pwVar1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a2740(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%d");
  FUN_14003c890(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a27a0(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%d");
  FUN_14003c890(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a2800(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%d");
  FUN_14003c890(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a2860(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%d");
  FUN_14003c890(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a28c0(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%d");
  FUN_14003c890(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a2920(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%ld");
  FUN_14003c890(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a2980(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%I64d");
  FUN_14003c890(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a29e0(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%f");
  FUN_14003c890(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a2a50(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%lf");
  FUN_14003c890(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a2ac0(undefined8 param_1,longlong *param_2)

{
  undefined *puVar1;
  undefined1 auStack_158 [32];
  undefined8 local_138;
  undefined1 *local_128;
  undefined1 local_120 [264];
  ulonglong local_18;
  
  local_138 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_158;
  FUN_14003c890(param_1,&DAT_140261498);
  puVar1 = (undefined *)*param_2;
  if ((undefined *)*param_2 == (undefined *)0x0) {
    puVar1 = PTR_DAT_1402f8008;
  }
  local_128 = local_120;
  FUN_14008a6c0(&local_128,puVar1,3);
  FUN_14003c890(param_1,local_128);
  if (local_128 != local_120) {
    free(local_128);
  }
  FUN_14003c890(param_1,&DAT_140261498);
  return;
}



void FUN_1401a2b80(undefined8 param_1,undefined8 param_2)

{
  FUN_14003c890(param_1,&DAT_140261498);
  FUN_14003c400(param_1,param_2);
  FUN_14003c890(param_1,&DAT_140261498);
  return;
}



void FUN_1401a2bc0(undefined8 param_1)

{
  FUN_14003c890(param_1,L"<ByteArray>");
  return;
}



void FUN_1401a2bd0(undefined8 param_1,UUID *param_2)

{
  RPC_STATUS RVar1;
  wchar_t *pwVar2;
  wchar_t *local_res18 [2];
  
  RVar1 = UuidToStringW(param_2,(RPC_WSTR *)local_res18);
  pwVar2 = L"<BAD>";
  if (RVar1 == 0) {
    pwVar2 = local_res18[0];
  }
  FUN_14003c890(param_1,pwVar2);
  RpcStringFreeW((RPC_WSTR *)local_res18);
  return;
}



void FUN_1401a2c20(char *param_1,undefined4 param_2,undefined8 param_3,longlong param_4)

{
  undefined2 uVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined **local_18;
  undefined4 local_10;
  undefined2 local_c;
  
  if (*param_1 != '\0') {
    local_18 = Proud::AddrPort::vftable;
    local_10 = *(undefined4 *)(param_1 + 0x10);
    local_c = *(undefined2 *)(param_1 + 0x14);
    if (*(undefined8 **)(param_1 + 0x40) == (undefined8 *)0x0) {
      uVar3 = 0;
    }
    else {
      uVar3 = **(undefined8 **)(param_1 + 0x40);
    }
    uVar2 = (**(code **)(**(longlong **)(param_1 + 0x38) + 0x10))();
    uVar1 = FUN_14019c290(1,uVar2);
    FUN_1401a18d0(uVar3,param_2,uVar1,&local_18,param_3,param_4);
    return;
  }
  local_18 = *(undefined ***)(param_4 + 8);
  local_10 = CONCAT31(local_10._1_3_,*(undefined1 *)(param_4 + 0x10));
  FUN_1401a12a0(*(undefined8 *)(*(longlong *)(param_1 + 0x38) + 0x748),param_3,&local_18);
  return;
}



void FUN_1401a2cf0(longlong param_1)

{
  longlong *plVar1;
  char cVar2;
  longlong lVar3;
  longlong lVar4;
  undefined **local_18;
  undefined4 local_10;
  undefined2 local_c;
  
  if (((*(longlong **)(param_1 + 0x40) != (longlong *)0x0) && (**(longlong **)(param_1 + 0x40) != 0)
      ) && (cVar2 = FUN_1400a64d0(param_1 + 8), cVar2 != '\0')) {
    local_10 = *(undefined4 *)(param_1 + 0x10);
    local_c = *(undefined2 *)(param_1 + 0x14);
    lVar4 = 0;
    local_18 = Proud::AddrPort::vftable;
    lVar3 = lVar4;
    if (*(longlong **)(param_1 + 0x40) != (longlong *)0x0) {
      lVar3 = **(longlong **)(param_1 + 0x40);
    }
    FUN_14019ea80(*(undefined8 *)(lVar3 + 0x168),&local_18);
    plVar1 = *(longlong **)(param_1 + 0x40);
    lVar3 = lVar4;
    if (plVar1 != (longlong *)0x0) {
      lVar3 = *plVar1;
    }
    if (*(longlong *)(lVar3 + 0x178) != 0) {
      local_10 = *(undefined4 *)(param_1 + 0x10);
      local_18 = Proud::AddrPort::vftable;
      local_c = *(undefined2 *)(param_1 + 0x14);
      if (plVar1 != (longlong *)0x0) {
        lVar4 = *plVar1;
      }
      FUN_1401a0400(*(undefined8 *)(lVar4 + 0x178),&local_18);
    }
  }
  return;
}



undefined2 * FUN_1401a2dd0(undefined2 *param_1,undefined8 param_2)

{
  *(undefined ***)(param_1 + 4) = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 8) = 0;
  param_1[10] = 0;
  *(undefined ***)(param_1 + 0xc) = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 0x10) = 0;
  param_1[0x12] = 0;
  *(undefined4 *)(param_1 + 0x14) = 0;
  *(undefined4 *)(param_1 + 0x16) = 0;
  *(undefined4 *)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x1a) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *param_1 = 0;
  *(undefined1 *)(param_1 + 1) = 0;
  *(undefined4 *)(param_1 + 8) = DAT_1402f83d0;
  param_1[10] = DAT_1402f83d4;
  *(undefined4 *)(param_1 + 0x10) = DAT_1402f83d0;
  param_1[0x12] = DAT_1402f83d4;
  *(undefined8 *)(param_1 + 0x1c) = param_2;
  *(undefined4 *)(param_1 + 0x14) = 0;
  *(undefined4 *)(param_1 + 0x16) = 0;
  *(undefined4 *)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x1a) = 0;
  return param_1;
}



void FUN_1401a2e80(longlong param_1)

{
  longlong *plVar1;
  undefined8 *puVar2;
  
  if ((*(longlong *)(param_1 + 0x40) != 0) &&
     (*(longlong *)(*(longlong *)(param_1 + 0x40) + 8) =
           *(longlong *)(*(longlong *)(param_1 + 0x40) + 8) + -1,
     *(longlong *)(*(longlong *)(param_1 + 0x40) + 8) == 0)) {
    plVar1 = *(longlong **)(param_1 + 0x40);
    puVar2 = (undefined8 *)*plVar1;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    FUN_1400a3530(plVar1);
  }
  return;
}



void FUN_1401a2ee0(longlong param_1,longlong param_2)

{
  short sVar1;
  int iVar2;
  undefined8 *puVar3;
  
  if ((*(int *)(param_1 + 0x10) != *(int *)(param_2 + 8)) ||
     (*(short *)(param_1 + 0x14) != *(short *)(param_2 + 0xc))) {
    FUN_140148ed0(*(longlong *)(*(longlong *)(param_1 + 0x38) + 0x238) + 0x388,param_1 + 8,0);
    iVar2 = *(int *)(param_2 + 8);
    *(int *)(param_1 + 0x10) = iVar2;
    sVar1 = *(short *)(param_2 + 0xc);
    *(short *)(param_1 + 0x14) = sVar1;
    if ((iVar2 != DAT_1402f83d0) || (sVar1 != DAT_1402f83d4)) {
      puVar3 = (undefined8 *)
               FUN_14018ea60(*(longlong *)(*(longlong *)(param_1 + 0x38) + 0x238) + 0x388,
                             param_1 + 8);
      *puVar3 = *(undefined8 *)(param_1 + 0x38);
    }
  }
  return;
}



longlong FUN_1401a2f80(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(param_1,uVar1,1,param_4,uVar2);
  FUN_1400ad560(param_1 + 0x48,1);
  FUN_1400ad560(param_1 + 0x50,1);
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined4 *)(param_1 + 0x40) = 0;
  return param_1;
}



void FUN_1401a2fe0(longlong param_1)

{
  FUN_14018a2d0(param_1 + 0x50);
  FUN_14018a2d0(param_1 + 0x48);
  FUN_1400a1cd0(param_1);
  return;
}



undefined4 FUN_1401a3020(longlong param_1)

{
  undefined4 uVar1;
  
  while( true ) {
    FUN_1400a1c30(param_1);
    if (*(int *)(param_1 + 0x3c) < 1) break;
    FUN_1400d1290(param_1);
    FUN_1400ad480(param_1 + 0x50);
  }
  *(int *)(param_1 + 0x38) = *(int *)(param_1 + 0x38) + 1;
  ResetEvent(*(HANDLE *)(param_1 + 0x48));
  uVar1 = *(undefined4 *)(param_1 + 0x38);
  FUN_1400d1290(param_1);
  return uVar1;
}



void FUN_1401a30a0(longlong param_1)

{
  FUN_1400a1c30();
  *(int *)(param_1 + 0x38) = *(int *)(param_1 + 0x38) + -1;
  if (*(int *)(param_1 + 0x38) < 1) {
    SetEvent(*(HANDLE *)(param_1 + 0x48));
  }
  FUN_1400d1290(param_1);
  return;
}



void FUN_1401a30d0(longlong param_1)

{
  undefined8 uVar1;
  longlong lVar2;
  longlong local_20;
  longlong local_18;
  
  uVar1 = 0xfffffffffffffffe;
  while( true ) {
    lVar2 = param_1;
    FUN_1400a1c30(param_1);
    if ((*(int *)(param_1 + 0x3c) < 1) && (*(int *)(param_1 + 0x38) < 1)) break;
    local_20 = param_1 + 0x48;
    local_18 = param_1 + 0x50;
    FUN_1400d1290(param_1);
    FUN_1400ad4a0(&local_20,2,0xffffffff,1,uVar1,lVar2,0);
  }
  *(int *)(param_1 + 0x3c) = *(int *)(param_1 + 0x3c) + 1;
  ResetEvent(*(HANDLE *)(param_1 + 0x50));
  FUN_1400d1290(param_1);
  return;
}



void FUN_1401a3160(longlong param_1)

{
  FUN_1400a1c30();
  *(int *)(param_1 + 0x3c) = *(int *)(param_1 + 0x3c) + -1;
  if (*(int *)(param_1 + 0x3c) < 1) {
    SetEvent(*(HANDLE *)(param_1 + 0x50));
  }
  FUN_1400d1290(param_1);
  return;
}



void FUN_1401a3190(undefined8 *param_1)

{
  if (*(char *)(param_1 + 1) != '\0') {
    FUN_1401a30a0(*param_1);
    *(undefined1 *)(param_1 + 1) = 0;
  }
  return;
}



void FUN_1401a31c0(undefined8 *param_1)

{
  if (*(char *)(param_1 + 1) != '\0') {
    FUN_1401a3160(*param_1);
    *(undefined1 *)(param_1 + 1) = 0;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a31f0(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  undefined *puVar6;
  int *piVar7;
  uint uVar8;
  ulonglong uVar9;
  int iVar10;
  double dVar11;
  undefined1 auStack_ab8 [32];
  undefined *local_a98;
  undefined *local_a90;
  longlong local_a88;
  undefined1 local_a80;
  int local_a7c;
  longlong local_a78;
  undefined1 local_a70;
  undefined8 local_a68;
  undefined1 local_a58 [2592];
  ulonglong local_38;
  
  local_a68 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_ab8;
  FUN_1400acf50(local_a58);
  FUN_1400ad070(local_a58);
  if (*(char *)(param_1 + 0x1040) == '\0') {
    do {
      dVar11 = (double)FUN_1400ad590(local_a58);
      lVar1 = param_1 + 0x28;
      iVar10 = 0;
      iVar5 = 0;
      if (dVar11 <= 0.9) {
        local_a88 = lVar1;
        local_a7c = FUN_1401a3020(lVar1);
        local_a80 = 1;
        piVar7 = (int *)(param_1 + 0x80);
        iVar10 = *piVar7;
        uVar9 = 0;
        do {
          if (iVar10 != *piVar7) {
            FUN_1400a3440();
            local_a98 = PTR_DAT_1402f8010;
            iVar4 = FUN_1400a32c0(&DAT_1402615c0);
            iVar10 = iVar5;
            if ((local_a98 != (undefined *)0x0) && (local_a98 != PTR_DAT_1402f8010)) {
              iVar10 = *(int *)(local_a98 + -8);
            }
            iVar2 = iVar4;
            if (((iVar4 <= iVar10) && (iVar2 = iVar5, local_a98 != (undefined *)0x0)) &&
               (local_a98 != PTR_DAT_1402f8010)) {
              iVar2 = *(int *)(local_a98 + -8);
            }
            iVar10 = 1;
            if (1 < iVar2) {
              iVar10 = iVar2;
            }
            iVar2 = iVar5;
            if ((local_a98 != (undefined *)0x0) && (local_a98 != PTR_DAT_1402f8010)) {
              iVar2 = *(int *)(local_a98 + -8);
            }
            if (iVar2 < iVar10) {
              FUN_140002d50(&local_a98);
            }
            FUN_140002e30(&local_a98);
            puVar6 = local_a98;
            if (local_a98 == (undefined *)0x0) {
              puVar6 = PTR_DAT_1402f8010;
            }
            FUN_1400a32f0(puVar6,&DAT_1402615c0,iVar4);
            puVar6 = local_a98;
            if (local_a98 == (undefined *)0x0) {
              puVar6 = PTR_DAT_1402f8010;
            }
            iVar4 = FUN_1400a32c0(puVar6);
            iVar10 = 0;
            if (0 < iVar4) {
              iVar10 = iVar4;
            }
            iVar4 = iVar5;
            if ((local_a98 != (undefined *)0x0) && (local_a98 != PTR_DAT_1402f8010)) {
              iVar4 = *(int *)(local_a98 + -8);
            }
            if ((iVar10 < iVar4) || (iVar10 = iVar5, local_a98 == (undefined *)0x0)) {
LAB_1401a355e:
              if (((local_a98 != PTR_DAT_1402f8010) && (local_a98 != (undefined *)0x0)) &&
                 ((int *)(local_a98 + -8) != (int *)0x0)) {
                *(int *)(local_a98 + -8) = iVar10;
                *(undefined2 *)(local_a98 + (longlong)iVar10 * 2) = 0;
              }
            }
            else if (local_a98 != PTR_DAT_1402f8010) {
              iVar10 = *(int *)(local_a98 + -8);
              goto LAB_1401a355e;
            }
            FUN_140164500(*(undefined8 *)(param_1 + 0x1088),&local_a98);
            *(undefined1 *)(param_1 + 0x1040) = 1;
            FUN_1401a30a0(lVar1);
            goto LAB_1401a359f;
          }
          uVar9 = uVar9 + 1;
          piVar7 = piVar7 + 1;
        } while ((longlong)uVar9 < 1000);
        if (1 < local_a7c) {
          *(undefined1 *)(param_1 + 0x1080) = 1;
        }
        FUN_1401a30a0(lVar1);
        local_a80 = 0;
      }
      else {
        local_a78 = lVar1;
        FUN_1401a30d0();
        local_a70 = 1;
        piVar7 = (int *)(param_1 + 0x80);
        iVar4 = *piVar7;
        uVar9 = 0;
        do {
          iVar2 = *piVar7;
          *piVar7 = iVar2 + 1;
          if (iVar4 + 1 != iVar2 + 1) {
            FUN_1400a3440();
            local_a90 = PTR_DAT_1402f8010;
            iVar2 = FUN_1400a32c0(&DAT_140261630);
            iVar4 = iVar10;
            if ((local_a90 != (undefined *)0x0) && (local_a90 != PTR_DAT_1402f8010)) {
              iVar4 = *(int *)(local_a90 + -8);
            }
            iVar3 = iVar2;
            if (((iVar2 <= iVar4) && (iVar3 = iVar10, local_a90 != (undefined *)0x0)) &&
               (local_a90 != PTR_DAT_1402f8010)) {
              iVar3 = *(int *)(local_a90 + -8);
            }
            iVar10 = 1;
            if (1 < iVar3) {
              iVar10 = iVar3;
            }
            iVar4 = iVar5;
            if ((local_a90 != (undefined *)0x0) && (local_a90 != PTR_DAT_1402f8010)) {
              iVar4 = *(int *)(local_a90 + -8);
            }
            if (iVar4 < iVar10) {
              FUN_140002d50(&local_a90);
            }
            FUN_140002e30(&local_a90);
            puVar6 = local_a90;
            if (local_a90 == (undefined *)0x0) {
              puVar6 = PTR_DAT_1402f8010;
            }
            FUN_1400a32f0(puVar6,&DAT_140261630,iVar2);
            puVar6 = local_a90;
            if (local_a90 == (undefined *)0x0) {
              puVar6 = PTR_DAT_1402f8010;
            }
            iVar4 = FUN_1400a32c0(puVar6);
            iVar10 = 0;
            if (0 < iVar4) {
              iVar10 = iVar4;
            }
            iVar4 = iVar5;
            if ((local_a90 != (undefined *)0x0) && (local_a90 != PTR_DAT_1402f8010)) {
              iVar4 = *(int *)(local_a90 + -8);
            }
            if ((iVar10 < iVar4) || (iVar10 = iVar5, local_a90 == (undefined *)0x0)) {
LAB_1401a342d:
              if (((local_a90 != PTR_DAT_1402f8010) && (local_a90 != (undefined *)0x0)) &&
                 ((int *)(local_a90 + -8) != (int *)0x0)) {
                *(int *)(local_a90 + -8) = iVar10;
                *(undefined2 *)(local_a90 + (longlong)iVar10 * 2) = 0;
              }
            }
            else if (local_a90 != PTR_DAT_1402f8010) {
              iVar10 = *(int *)(local_a90 + -8);
              goto LAB_1401a342d;
            }
            FUN_140164500(*(undefined8 *)(param_1 + 0x1088),&local_a90);
            *(undefined1 *)(param_1 + 0x1040) = 1;
            FUN_1401a3160(lVar1);
            goto LAB_1401a359f;
          }
          uVar8 = (int)uVar9 + 1;
          uVar9 = (ulonglong)uVar8;
          piVar7 = piVar7 + 1;
        } while ((int)uVar8 < 1000);
        FUN_1401a3160(lVar1);
        local_a70 = 0;
      }
      Sleep(0);
    } while (*(char *)(param_1 + 0x1040) == '\0');
  }
LAB_1401a359f:
  FUN_1400acf90(local_a58);
  return;
}



undefined8 * FUN_1401a35f0(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  FUN_1401a2f80(param_1 + 5);
  *(undefined1 *)(param_1 + 0x210) = 0;
  *(undefined1 *)(param_1 + 0x208) = 0;
  memset(param_1 + 0x10,0,4000);
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x0001401a3720)
// WARNING: Removing unreachable block (ram,0x0001401a3724)
// WARNING: Removing unreachable block (ram,0x0001401a3740)
// WARNING: Removing unreachable block (ram,0x0001401a376d)

void FUN_1401a3660(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  char cVar2;
  void *pvVar3;
  undefined8 *puVar4;
  longlong *plVar5;
  int iVar6;
  int iVar7;
  longlong lVar8;
  undefined *puVar9;
  int iVar10;
  longlong lVar11;
  int *piVar12;
  int iVar13;
  undefined *local_res10;
  longlong *local_res18 [2];
  undefined8 uVar14;
  
  uVar14 = 0xfffffffffffffffe;
  iVar13 = 0;
  do {
    lVar8 = 0;
    local_res18[0] = operator_new(0x28);
    if (local_res18[0] != (longlong *)0x0) {
      lVar8 = FUN_1400aa980(local_res18[0],&LAB_1401a35e0,param_1,param_4,uVar14);
    }
    if (lVar8 == 0) {
      local_res18[0] = (longlong *)0x0;
    }
    else {
      local_res18[0] = (longlong *)FUN_1400a34c0(0x10);
      local_res18[0][1] = 1;
      *local_res18[0] = lVar8;
    }
    plVar1 = local_res18[0];
    iVar10 = *(int *)(param_1 + 0x18);
    if (iVar10 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_14018f440(param_1,iVar10 + 1);
    lVar11 = 0;
    lVar8 = FUN_1401b2160(param_1);
    FUN_14018b790(lVar8 + (longlong)iVar10 * 8,local_res18);
    plVar5 = local_res18[0];
    if (plVar1 != (longlong *)0x0) {
      plVar1 = plVar1 + 1;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        pvVar3 = (void *)*local_res18[0];
        if (pvVar3 != (void *)0x0) {
          FUN_1400aaa90(pvVar3);
          operator_delete(pvVar3);
        }
        FUN_1400a3530(plVar5);
      }
    }
    iVar13 = iVar13 + 1;
  } while (iVar13 < 10);
  iVar13 = 0;
  lVar8 = lVar11;
  do {
    if ((lVar8 < 0) || (*(int *)(param_1 + 0x18) <= iVar13)) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    puVar4 = *(undefined8 **)(*(longlong *)(param_1 + 0x10) + lVar8 * 8);
    if (puVar4 == (undefined8 *)0x0) {
      uVar14 = 0;
    }
    else {
      uVar14 = *puVar4;
    }
    FUN_1400aab80(uVar14);
    iVar13 = iVar13 + 1;
    lVar8 = lVar8 + 1;
  } while (lVar8 < 10);
  Sleep(1000);
  cVar2 = *(char *)(param_1 + 0x1080);
  while (cVar2 == '\0') {
    Sleep(0x32);
    cVar2 = *(char *)(param_1 + 0x1080);
  }
  *(undefined1 *)(param_1 + 0x1040) = 1;
  iVar13 = 0;
  do {
    if ((lVar11 < 0) || (*(int *)(param_1 + 0x18) <= iVar13)) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    puVar4 = *(undefined8 **)(*(longlong *)(param_1 + 0x10) + lVar11 * 8);
    if (puVar4 == (undefined8 *)0x0) {
      uVar14 = 0;
    }
    else {
      uVar14 = *puVar4;
    }
    FUN_1400aaa10(uVar14);
    iVar13 = iVar13 + 1;
    lVar11 = lVar11 + 1;
  } while (lVar11 < 10);
  piVar12 = (int *)(param_1 + 0x80);
  lVar8 = 999;
  do {
    if ((*(int *)(param_1 + 0x80) == 0) || (*piVar12 != piVar12[1])) {
      FUN_1400a3440();
      local_res10 = PTR_DAT_1402f8010;
      iVar6 = FUN_1400a32c0(&DAT_1402616f0);
      iVar10 = 0;
      iVar13 = iVar10;
      if ((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1402f8010)) {
        iVar13 = *(int *)(local_res10 + -8);
      }
      iVar7 = iVar6;
      if (((iVar6 <= iVar13) && (iVar7 = 0, local_res10 != (undefined *)0x0)) &&
         (iVar7 = iVar10, local_res10 != PTR_DAT_1402f8010)) {
        iVar7 = *(int *)(local_res10 + -8);
      }
      iVar13 = 1;
      if (1 < iVar7) {
        iVar13 = iVar7;
      }
      iVar7 = iVar10;
      if ((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1402f8010)) {
        iVar7 = *(int *)(local_res10 + -8);
      }
      if (iVar7 < iVar13) {
        FUN_140002d50(&local_res10);
      }
      FUN_140002e30(&local_res10);
      puVar9 = local_res10;
      if (local_res10 == (undefined *)0x0) {
        puVar9 = PTR_DAT_1402f8010;
      }
      FUN_1400a32f0(puVar9,&DAT_1402616f0,iVar6);
      puVar9 = local_res10;
      if (local_res10 == (undefined *)0x0) {
        puVar9 = PTR_DAT_1402f8010;
      }
      iVar6 = FUN_1400a32c0(puVar9);
      iVar13 = 0;
      if (0 < iVar6) {
        iVar13 = iVar6;
      }
      if ((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1402f8010)) {
        iVar10 = *(int *)(local_res10 + -8);
      }
      if ((iVar13 < iVar10) || (iVar13 = 0, local_res10 == (undefined *)0x0)) {
LAB_1401a3991:
        if (((local_res10 != PTR_DAT_1402f8010) && (local_res10 != (undefined *)0x0)) &&
           ((int *)(local_res10 + -8) != (int *)0x0)) {
          *(int *)(local_res10 + -8) = iVar13;
          *(undefined2 *)(local_res10 + (longlong)iVar13 * 2) = 0;
        }
      }
      else if (local_res10 != PTR_DAT_1402f8010) {
        iVar13 = *(int *)(local_res10 + -8);
        goto LAB_1401a3991;
      }
      FUN_140164500(*(undefined8 *)(param_1 + 0x1088),&local_res10);
    }
    piVar12 = piVar12 + 1;
    lVar8 = lVar8 + -1;
    if (lVar8 == 0) {
      return;
    }
  } while( true );
}



undefined8 * FUN_1401a3a00(undefined8 *param_1)

{
  *param_1 = 0;
  *(undefined4 *)(param_1 + 1) = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  return param_1;
}



void FUN_1401a3a20(longlong param_1,undefined8 param_2)

{
  FUN_1401c1f70(param_1 + 0x48);
  FUN_1401c20e0(param_1 + 0x60,param_2);
  FUN_1401c2090(param_1 + 0x38,param_2);
  FUN_1401c1ff0(param_1 + 0x58,*(undefined8 *)(param_1 + 0x60),*(undefined8 *)(param_1 + 0x38));
  return;
}



void FUN_1401a3a90(undefined8 param_1)

{
  FUN_1400a9e60(param_1,DAT_1402f8048);
  FUN_1400a9e00(param_1,DAT_1402f8050);
  return;
}



void FUN_1401a3ac0(undefined8 param_1)

{
  FUN_1400a9e60(param_1,DAT_1402f804c);
  FUN_1400a9e00(param_1,DAT_1402f8054);
  return;
}



undefined2 * FUN_1401a3af0(longlong *param_1)

{
  longlong lVar1;
  undefined2 *puVar2;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    *param_1 = *(longlong *)(lVar1 + 0x38);
    *(undefined8 *)(lVar1 + 0x38) = 0;
    return (undefined2 *)(lVar1 + 8);
  }
  puVar2 = (undefined2 *)FUN_1400a34c0();
  if (puVar2 != (undefined2 *)0x0) {
    *(undefined8 *)(puVar2 + 8) = 0;
    *(undefined8 *)(puVar2 + 0xc) = 0;
    *(undefined8 *)(puVar2 + 0x10) = 0;
    *(undefined8 *)(puVar2 + 0x14) = 0;
    *(undefined8 *)(puVar2 + 0x18) = 0;
    *(undefined ***)(puVar2 + 4) = Proud::ByteArray::vftable;
    *(undefined8 *)(puVar2 + 0x1c) = 0;
    *puVar2 = 0x1de6;
    return puVar2 + 4;
  }
  return (undefined2 *)0x8;
}



void FUN_1401a3b70(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  while (lVar1 != 0) {
    lVar1 = *param_1;
    *param_1 = *(longlong *)(lVar1 + 0x38);
    *(undefined8 *)(lVar1 + 0x38) = 0;
    FUN_140140df0(lVar1 + 8);
    FUN_1400a3530(lVar1);
    lVar1 = *param_1;
  }
  return;
}



longlong FUN_1401a3bd0(longlong *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  longlong lVar3;
  longlong *plVar4;
  
  plVar1 = (longlong *)param_1[1];
  if (plVar1 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  lVar2 = *plVar1;
  lVar3 = plVar1[2];
  param_1[1] = lVar2;
  if (lVar2 == 0) {
    param_1[2] = 0;
  }
  else {
    *(undefined8 *)(lVar2 + 8) = 0;
  }
  plVar4 = (longlong *)*param_1;
  if (plVar4 != (longlong *)0x0) {
    (**(code **)(*plVar4 + 0x10))(plVar4,plVar1);
    param_1[3] = param_1[3] + -1;
    return lVar3;
  }
  FUN_1400a3530();
  param_1[3] = param_1[3] + -1;
  return lVar3;
}



void FUN_1401a3c60(longlong param_1,undefined8 param_2,undefined8 *param_3)

{
  longlong *plVar1;
  undefined8 uVar2;
  longlong lVar3;
  undefined8 *puVar4;
  
  lVar3 = FUN_1401a3af0();
  *(undefined8 *)(lVar3 + 0x28) = *param_3;
  thunk_FUN_1401a70d0(param_2,lVar3);
  plVar1 = *(longlong **)(param_1 + 8);
  uVar2 = *(undefined8 *)(param_1 + 0x18);
  if (plVar1 == (longlong *)0x0) {
    puVar4 = (undefined8 *)FUN_1400a34c0(0x18);
  }
  else {
    puVar4 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,0x18);
  }
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[2] = lVar3;
  }
  puVar4[1] = uVar2;
  *puVar4 = 0;
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  if (*(undefined8 **)(param_1 + 0x18) == (undefined8 *)0x0) {
    *(undefined8 **)(param_1 + 0x10) = puVar4;
  }
  else {
    **(undefined8 **)(param_1 + 0x18) = puVar4;
  }
  *(undefined8 **)(param_1 + 0x18) = puVar4;
  *(int *)(param_1 + 0x34) = *(int *)(param_1 + 0x34) + *(int *)(lVar3 + 0x18);
  return;
}



void FUN_1401a3d10(longlong param_1,longlong *param_2,int param_3)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined8 *puVar5;
  longlong lVar6;
  int iVar7;
  undefined4 uStack_24;
  
  if ((100 < (ulonglong)param_2[2]) && ((void *)*param_2 != (void *)0x0)) {
    operator_delete__((void *)*param_2);
    *param_2 = 0;
  }
  param_2[1] = 0;
  param_2[2] = 100;
  lVar2 = *(longlong *)(param_1 + 0x28);
  iVar7 = 0;
  if (lVar2 != 0) {
    if (*(int *)(lVar2 + 0x18) == 0) {
      lVar6 = 0;
    }
    else {
      lVar6 = *(longlong *)(lVar2 + 0x10);
    }
    iVar7 = *(int *)(lVar2 + 0x18) - *(int *)(param_1 + 0x30);
    FUN_14019d400(param_2,lVar6 + *(int *)(param_1 + 0x30),iVar7);
  }
  puVar5 = *(undefined8 **)(param_1 + 0x10);
  while( true ) {
    if ((puVar5 == (undefined8 *)0x0) || (param_3 <= iVar7)) {
      return;
    }
    if (puVar5 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    lVar2 = puVar5[2];
    iVar1 = *(int *)(lVar2 + 0x18);
    if (iVar1 == 0) {
      lVar6 = 0;
    }
    else {
      lVar6 = *(longlong *)(lVar2 + 0x10);
    }
    lVar3 = param_2[1];
    if (lVar3 < 0) break;
    FUN_14019c780(param_2,lVar3 + 1,0xffffffffffffffff);
    if (param_2[1] <= lVar3) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if ((ulonglong)param_2[2] < 0x65) {
      plVar4 = param_2 + (lVar3 + 2) * 2;
    }
    else {
      plVar4 = (longlong *)(lVar3 * 0x10 + *param_2);
    }
    *plVar4 = CONCAT44(uStack_24,iVar1);
    plVar4[1] = lVar6;
    iVar7 = iVar7 + *(int *)(lVar2 + 0x18);
    puVar5 = (undefined8 *)*puVar5;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_1401a3e60(longlong *param_1,int param_2)

{
  longlong lVar1;
  int iVar2;
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2 != 0) {
    lVar1 = param_1[5];
    if (lVar1 != 0) {
      iVar2 = (int)param_1[6] + param_2;
      if (iVar2 < *(int *)(lVar1 + 0x18)) {
        *(int *)((longlong)param_1 + 0x34) = *(int *)((longlong)param_1 + 0x34) - param_2;
        *(int *)(param_1 + 6) = iVar2;
        return;
      }
      iVar2 = *(int *)(lVar1 + 0x18) - (int)param_1[6];
      *(int *)((longlong)param_1 + 0x34) = *(int *)((longlong)param_1 + 0x34) - iVar2;
      param_2 = param_2 - iVar2;
      if ((*(short *)(lVar1 + -8) != 0x1de6) || (*(longlong *)(lVar1 + 0x30) != 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      *(longlong *)(lVar1 + 0x30) = *param_1;
      *param_1 = lVar1 + -8;
      param_1[5] = 0;
      *(undefined4 *)(param_1 + 6) = 0;
    }
    if (0 < param_2) {
      while (param_1[4] != 0) {
        lVar1 = FUN_1401a3bd0(param_1 + 1);
        if (param_2 < *(int *)(lVar1 + 0x18)) {
          *(int *)((longlong)param_1 + 0x34) = *(int *)((longlong)param_1 + 0x34) - param_2;
          param_1[5] = lVar1;
          *(int *)(param_1 + 6) = param_2;
          return;
        }
        *(int *)((longlong)param_1 + 0x34) =
             *(int *)((longlong)param_1 + 0x34) - *(int *)(lVar1 + 0x18);
        param_2 = param_2 - *(int *)(lVar1 + 0x18);
        if ((*(short *)(lVar1 + -8) != 0x1de6) || (*(longlong *)(lVar1 + 0x30) != 0)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        *(longlong *)(lVar1 + 0x30) = *param_1;
        *param_1 = lVar1 + -8;
        if (param_2 < 1) {
          return;
        }
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a3f60(undefined8 param_1,longlong param_2,undefined8 param_3)

{
  int iVar1;
  undefined1 auStack_d28 [32];
  undefined8 local_d08;
  undefined1 local_d00 [72];
  undefined1 local_cb8 [3200];
  longlong local_38;
  int local_2c;
  ulonglong local_28;
  
  local_d08 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_d28;
  FUN_14003d020(param_3,0x5713);
  iVar1 = FUN_1401a7030(param_1);
  FUN_140186930(param_3,(longlong)iVar1);
  if (*(longlong *)(param_2 + 0xc80) == 0) {
    FUN_1400a2320(local_d00,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_d00,(ThrowInfo *)&DAT_1402f4860);
  }
  if (*(int *)(param_2 + 0xc8c) < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  *(undefined4 *)(param_2 + 0xc88) = 0;
  FUN_140146970(local_cb8,param_3);
  FUN_140145c70(param_2,local_cb8);
  if (local_38 == 0) {
    FUN_1400a2320(local_d00,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_d00,(ThrowInfo *)&DAT_1402f4860);
  }
  if (local_2c < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_140145c70(param_2,param_1);
  return;
}



undefined8 * FUN_1401a4080(undefined8 *param_1)

{
  *param_1 = 0;
  param_1[1] = 0;
  param_1[4] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[7] = 0;
  param_1[8] = 0;
  FUN_1401c1f90(param_1 + 9);
  FUN_1401c2070(param_1 + 0xb);
  param_1[0xd] = 0;
  param_1[0xe] = 0;
  param_1[0xc] = 0;
  param_1[0xf] = 0;
  param_1[6] = 0;
  FUN_14016a780(param_1 + 1);
  param_1[5] = 0;
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x0001401a4174)

void FUN_1401a4110(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined8 *puVar4;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  puVar4 = (undefined8 *)param_1[2];
  while( true ) {
    if (puVar4 == (undefined8 *)0x0) {
      lVar1 = param_1[4];
      while( true ) {
        if (lVar1 == 0) {
          param_1[2] = 0;
          param_1[3] = 0;
          puVar4 = (undefined8 *)param_1[1];
          if (puVar4 != (undefined8 *)0x0) {
            (**(code **)*puVar4)(puVar4,1);
          }
          lVar1 = *param_1;
          while (lVar1 != 0) {
            lVar1 = *param_1;
            *param_1 = *(longlong *)(lVar1 + 0x38);
            *(undefined8 *)(lVar1 + 0x38) = 0;
            FUN_140140df0(lVar1 + 8);
            FUN_1400a3530(lVar1);
            lVar1 = *param_1;
          }
          return;
        }
        plVar2 = (longlong *)param_1[2];
        if (plVar2 == (longlong *)0x0) break;
        param_1[2] = *plVar2;
        plVar3 = (longlong *)param_1[1];
        if (plVar3 == (longlong *)0x0) {
          FUN_1400a3530();
        }
        else {
          (**(code **)(*plVar3 + 0x10))(plVar3,plVar2,plVar3,param_4,uVar5);
        }
        param_1[4] = param_1[4] + -1;
        lVar1 = param_1[4];
      }
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    lVar1 = puVar4[2];
    if ((*(short *)(lVar1 + -8) != 0x1de6) || (*(longlong *)(lVar1 + 0x30) != 0)) break;
    *(longlong *)(lVar1 + 0x30) = *param_1;
    *param_1 = lVar1 + -8;
    puVar4 = (undefined8 *)*puVar4;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_1401a4240(longlong param_1,int param_2,longlong param_3,int param_4)

{
  longlong lVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  undefined2 *puVar5;
  longlong lVar6;
  longlong lVar7;
  
  lVar2 = (longlong)param_4;
  if (((-1 < param_4) && (-1 < param_2)) && (param_2 <= *(int *)(param_1 + 0x18))) {
    iVar3 = *(int *)(param_1 + 0x18);
    FUN_140174e40(param_1,iVar3 + param_4);
    iVar3 = iVar3 - param_2;
    if ((0 < iVar3) && (iVar3 = iVar3 + -1, lVar6 = (longlong)iVar3, -1 < iVar3)) {
      lVar7 = (lVar6 + param_2 + lVar2) * 0x48;
      do {
        lVar1 = FUN_1401b2160(param_1);
        lVar4 = lVar2 * -0x48 + lVar1 + lVar7;
        lVar1 = FUN_1401b2160(param_1);
        lVar1 = lVar7 + lVar1;
        FUN_14016a260(lVar1,lVar4);
        lVar7 = lVar7 + -0x48;
        lVar6 = lVar6 + -1;
        *(undefined4 *)(lVar1 + 0x28) = *(undefined4 *)(lVar4 + 0x28);
        *(undefined4 *)(lVar1 + 0x38) = *(undefined4 *)(lVar4 + 0x38);
        *(undefined2 *)(lVar1 + 0x3c) = *(undefined2 *)(lVar4 + 0x3c);
        *(undefined1 *)(lVar1 + 0x40) = *(undefined1 *)(lVar4 + 0x40);
      } while (-1 < lVar6);
    }
    if (0 < lVar2) {
      puVar5 = (undefined2 *)(param_3 + 0x3c);
      do {
        lVar6 = FUN_1401b2160(param_1);
        lVar6 = ((longlong)param_2 * 0x48 - param_3) + -0x3c + lVar6 + (longlong)puVar5;
        FUN_14016a260(lVar6,puVar5 + -0x1e);
        lVar2 = lVar2 + -1;
        *(undefined4 *)(lVar6 + 0x28) = *(undefined4 *)(puVar5 + -10);
        *(undefined4 *)(lVar6 + 0x38) = *(undefined4 *)(puVar5 + -2);
        *(undefined2 *)(lVar6 + 0x3c) = *puVar5;
        *(undefined1 *)(lVar6 + 0x40) = *(undefined1 *)(puVar5 + 2);
        puVar5 = puVar5 + 0x24;
      } while (lVar2 != 0);
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



ulonglong FUN_1401a4390(undefined8 *param_1,undefined4 *param_2)

{
  char cVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  int iVar4;
  undefined4 uVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  longlong *local_res8;
  ulonglong local_res10;
  undefined1 *local_res18;
  longlong local_138;
  ulonglong local_130;
  int local_128;
  int iStack_124;
  int local_120 [2];
  longlong local_118;
  longlong local_110;
  undefined4 local_108;
  int local_104;
  longlong local_f8;
  ulonglong local_f0;
  undefined8 local_e8;
  undefined1 local_d8 [8];
  undefined1 local_d0 [8];
  longlong local_c8;
  undefined4 local_c0;
  int local_bc;
  undefined4 local_b0;
  undefined **local_a8;
  undefined4 local_a0;
  undefined2 local_9c;
  undefined1 local_98;
  undefined8 local_88;
  undefined1 local_80 [72];
  
  local_88 = 0xfffffffffffffffe;
  uVar2 = 0;
  *param_2 = 0;
  if (*(int *)(param_1 + 1) == 0) {
    uVar2 = 0;
  }
  else {
    FUN_140185560(local_120);
    FUN_1401851e0(local_120,*param_1,*(undefined4 *)(param_1 + 1));
    FUN_1401856c0(local_120,*(undefined4 *)(param_1 + 1));
    FUN_140185160(local_120,0);
    uVar6 = uVar2;
    uVar7 = uVar2;
    while( true ) {
      local_128 = 0;
      iStack_124 = 0;
      local_130 = 0;
      local_138 = 0;
      cVar1 = FUN_140185490(local_120,&local_res8,2);
      uVar5 = (undefined4)uVar6;
      if (cVar1 == '\0') {
        *(undefined4 *)(param_1 + 4) = uVar5;
        FUN_14019a730(&local_138);
        if (local_130 != 0) {
          if (iStack_124 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          local_128 = 0;
        }
        local_res8 = &local_118;
        FUN_14019a730(&local_118);
        if (local_110 == 0) {
          return uVar7;
        }
        if (-1 < local_104) {
          return uVar7;
        }
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if ((short)local_res8 != 0x5713) break;
      cVar1 = FUN_140185b30(local_120,&local_res10);
      uVar6 = local_res10;
      if (cVar1 == '\0') {
        *(undefined4 *)(param_1 + 4) = uVar5;
        FUN_14019a730(&local_138);
        if (local_130 != 0) {
          if (iStack_124 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          local_128 = 0;
        }
        local_res8 = &local_118;
        FUN_14019a730(&local_118);
        if (local_110 == 0) {
          return uVar7;
        }
        if (-1 < local_104) {
          return uVar7;
        }
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      iVar4 = (int)local_res10;
      if (iVar4 < 0) {
        if (local_118 == 0) {
          if (local_110 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14019a830();
          }
        }
        else {
          local_108 = *(undefined4 *)(local_118 + 0x18);
        }
        *(undefined4 *)(param_1 + 4) = local_108;
        *param_2 = 0x1f;
        FUN_14019a730(&local_138);
        if (local_130 != 0) {
          if (iStack_124 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          local_128 = 0;
        }
        local_res8 = &local_118;
        FUN_14019a730(&local_118);
        if ((local_110 != 0) && (local_104 < 0)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        goto LAB_1401a48eb;
      }
      if (*(int *)((longlong)param_1 + 0x1c) < iVar4) {
        if (local_118 == 0) {
          if (local_110 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14019a830();
          }
        }
        else {
          local_108 = *(undefined4 *)(local_118 + 0x18);
        }
        *(undefined4 *)(param_1 + 4) = local_108;
        *param_2 = 0x20;
        FUN_14019a730(&local_138);
        if (local_130 != 0) {
          if (iStack_124 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          local_128 = 0;
        }
        local_res8 = &local_118;
        FUN_14019a730(&local_118);
        if ((local_110 != 0) && (local_104 < 0)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        goto LAB_1401a48eb;
      }
      cVar1 = FUN_1401854f0(local_120,local_res10 & 0xffffffff);
      if (cVar1 == '\0') {
        *(undefined4 *)(param_1 + 4) = uVar5;
        FUN_14019a730(&local_138);
        if (local_130 != 0) {
          if (iStack_124 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          local_128 = 0;
        }
        local_res8 = &local_118;
        FUN_14019a730(&local_118);
        if (local_110 == 0) {
          return uVar7;
        }
        if (-1 < local_104) {
          return uVar7;
        }
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if (local_130 != 0) {
        FUN_1400a2320(local_80,PTR_u_Cannot_use_internal_buffer_becau_14030c160);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_80,(ThrowInfo *)&DAT_1402f4860);
      }
      if (local_138 == 0) {
        local_138 = FUN_14019a770();
        *(undefined8 *)(local_138 + 0x28) = 1;
        if (local_130 == 0) goto LAB_1401a44dc;
        if (iStack_124 < iVar4) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
      }
      else {
LAB_1401a44dc:
        if (iVar4 < 1) {
          if (local_138 == 0) goto LAB_1401a469a;
          uVar3 = 0;
        }
        else {
          if (local_138 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14019a830();
          }
          uVar3 = uVar6 & 0xffffffff;
        }
        FUN_14003cda0(local_138,uVar3);
        iVar4 = local_128;
      }
      local_128 = iVar4;
      uVar3 = local_130;
      if (local_130 == 0) {
        if (local_138 == 0) {
LAB_1401a469a:
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        uVar3 = uVar2;
        if (*(int *)(local_138 + 0x18) != 0) {
          uVar3 = *(ulonglong *)(local_138 + 0x10);
        }
      }
      cVar1 = FUN_140185490(local_120,uVar3,uVar6 & 0xffffffff);
      if (cVar1 == '\0') {
        *(undefined4 *)(param_1 + 4) = uVar5;
        FUN_14019a730(&local_138);
        if (local_130 != 0) {
          if (iStack_124 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          local_128 = 0;
        }
        local_res8 = &local_118;
        FUN_14019a730(&local_118);
        if (local_110 == 0) {
          return uVar7;
        }
        if (-1 < local_104) {
          return uVar7;
        }
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      FUN_140185560(local_d8);
      local_a8 = Proud::AddrPort::vftable;
      local_98 = 0;
      local_a0 = DAT_1402f83d0;
      local_9c = DAT_1402f83d4;
      local_b0 = *(undefined4 *)(param_1 + 3);
      local_e8 = 0;
      local_f0 = 0;
      if (local_138 == 0) {
        local_f8 = 0;
        local_f0 = local_130;
        local_e8 = CONCAT44(iStack_124,local_128);
      }
      else {
        *(longlong *)(local_138 + 0x28) = *(longlong *)(local_138 + 0x28) + 1;
        local_f8 = local_138;
      }
      FUN_140185630(local_d8,&local_f8);
      FUN_1401a4240(param_1[2],*(undefined4 *)(param_1[2] + 0x18),local_d8,1);
      uVar7 = (ulonglong)((int)uVar7 + 1);
      uVar6 = (ulonglong)(uint)((int)((local_120[0] >> 0x1f & 7U) + local_120[0]) >> 3);
      local_res18 = local_d0;
      FUN_14019a730(local_d0);
      if (local_c8 != 0) {
        if (local_bc < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        local_c0 = 0;
      }
      FUN_14019a730(&local_138);
      if ((local_130 != 0) && (iStack_124 < 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
    }
    if (local_118 == 0) {
      if (local_110 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
    }
    else {
      local_108 = *(undefined4 *)(local_118 + 0x18);
    }
    *(undefined4 *)(param_1 + 4) = local_108;
    *param_2 = 0x1f;
    FUN_14019a730(&local_138);
    if (local_130 != 0) {
      if (iStack_124 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_128 = 0;
    }
    local_res8 = &local_118;
    FUN_14019a730(&local_118);
    if ((local_110 != 0) && (local_104 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
LAB_1401a48eb:
    uVar2 = 0xffffffff;
  }
  return uVar2;
}



undefined4
FUN_1401a4970(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4,
             undefined8 param_5)

{
  undefined4 uVar1;
  longlong local_38;
  undefined4 local_30;
  undefined8 local_28;
  undefined4 local_20;
  undefined4 local_1c;
  int local_18;
  
  local_38 = 0;
  local_18 = 0;
  if (*(int *)(param_1 + 0x20) != 0) {
    local_38 = *(longlong *)(param_1 + 0x18);
  }
  local_38 = local_38 + *(longlong *)(param_1 + 0x30);
  local_30 = *(undefined4 *)(param_1 + 0x38);
  local_28 = param_2;
  local_20 = param_3;
  local_1c = param_4;
  uVar1 = FUN_1401a4390(&local_38,param_5);
  FUN_1401c13e0(param_1,(longlong)local_18);
  return uVar1;
}



void FUN_1401a49e0(undefined8 *param_1)

{
  *param_1 = Proud::IHostIDFactory::vftable;
  return;
}



undefined8 * FUN_1401a49f0(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::IHostIDFactory::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1401a4a20(undefined8 *param_1)

{
  *(undefined4 *)(param_1 + 1) = 2;
  *param_1 = Proud::CHostIDFactory::vftable;
  return param_1;
}



void FUN_1401a4a40(longlong param_1)

{
  int *piVar1;
  undefined4 uVar2;
  
  piVar1 = (int *)(param_1 + 8);
  *piVar1 = *piVar1 + 1;
  uVar2 = *(undefined4 *)(param_1 + 8);
  if (*piVar1 == 0) {
    uVar2 = 3;
  }
  *(undefined4 *)(param_1 + 8) = uVar2;
  return;
}



uint FUN_1401a4a60(longlong param_1,uint param_2)

{
  ulonglong uVar1;
  uint *puVar2;
  
  uVar1 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x40);
  if (*(longlong *)(param_1 + 0x20) != 0) {
    for (puVar2 = *(uint **)(*(longlong *)(param_1 + 0x20) + uVar1 * 8);
        (puVar2 != (uint *)0x0 && ((uint)uVar1 == puVar2[10] % *(uint *)(param_1 + 0x40)));
        puVar2 = *(uint **)(puVar2 + 6)) {
      if (*puVar2 == param_2) goto LAB_1401a4aad;
    }
  }
  puVar2 = (uint *)0x0;
LAB_1401a4aad:
  if (puVar2 != (uint *)0x0) {
    return puVar2[3];
  }
  return 0;
}



undefined4 FUN_1401a4ac0(longlong *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong lVar4;
  
  plVar1 = (longlong *)param_1[1];
  if (plVar1 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  lVar2 = *plVar1;
  lVar4 = plVar1[2];
  param_1[1] = lVar2;
  if (lVar2 == 0) {
    param_1[2] = 0;
  }
  else {
    *(undefined8 *)(lVar2 + 8) = 0;
  }
  plVar3 = (longlong *)*param_1;
  if (plVar3 != (longlong *)0x0) {
    (**(code **)(*plVar3 + 0x10))(plVar3,plVar1);
    param_1[3] = param_1[3] + -1;
    return (int)lVar4;
  }
  FUN_1400a3530();
  param_1[3] = param_1[3] + -1;
  return (int)lVar4;
}



undefined8 * FUN_1401a4b40(longlong *param_1,undefined4 *param_2)

{
  longlong lVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  
  lVar1 = param_1[2];
  plVar2 = (longlong *)*param_1;
  if (plVar2 == (longlong *)0x0) {
    puVar3 = (undefined8 *)FUN_1400a34c0(0x18);
  }
  else {
    puVar3 = (undefined8 *)(**(code **)(*plVar2 + 8))(plVar2,0x18);
  }
  if (puVar3 != (undefined8 *)0x0) {
    *(undefined4 *)(puVar3 + 2) = *param_2;
  }
  puVar3[1] = lVar1;
  *puVar3 = 0;
  param_1[3] = param_1[3] + 1;
  if ((undefined8 *)param_1[2] == (undefined8 *)0x0) {
    param_1[1] = (longlong)puVar3;
  }
  else {
    *(undefined8 *)param_1[2] = puVar3;
  }
  param_1[2] = (longlong)puVar3;
  return puVar3;
}



void FUN_1401a4bc0(longlong param_1)

{
  longlong *plVar1;
  uint uVar2;
  ulonglong uVar3;
  longlong lVar4;
  longlong lVar5;
  float fVar6;
  float fVar7;
  
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
  FUN_140144430();
  lVar4 = *(longlong *)(param_1 + 0x10);
  while (lVar4 != 0) {
    plVar1 = *(longlong **)(param_1 + 0x50);
    lVar5 = *(longlong *)(lVar4 + 0x18);
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar4);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar4 = lVar5;
  }
  FUN_1400a3530(*(undefined8 *)(param_1 + 8));
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  FUN_140144430(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar2 = FUN_140142850(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_1400a3530();
      *(undefined8 *)(param_1 + 8) = 0;
    }
    lVar4 = 0;
    *(uint *)(param_1 + 0x28) = uVar2;
    fVar7 = (float)uVar2 * *(float *)(param_1 + 0x34);
    if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
      lVar4 = -0x8000000000000000;
    }
    fVar6 = (float)uVar2 * *(float *)(param_1 + 0x30);
    lVar5 = 0;
    *(longlong *)(param_1 + 0x38) = (longlong)fVar7 + lVar4;
    if ((9.223372e+18 < fVar6) && (fVar6 = fVar6 - 9.223372e+18, fVar6 < 9.223372e+18)) {
      lVar5 = -0x8000000000000000;
    }
    uVar3 = (longlong)fVar6 + lVar5;
    if ((ulonglong)((longlong)fVar6 + lVar5) < 0x11) {
      uVar3 = 0;
    }
    *(ulonglong *)(param_1 + 0x40) = uVar3;
  }
  FUN_140144430(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



undefined4 * FUN_1401a4cf0(longlong param_1,undefined4 *param_2,uint param_3,undefined4 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined4 uVar4;
  undefined4 *puVar5;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    puVar5 = (undefined4 *)FUN_1400a34c0(0x30);
  }
  else {
    puVar5 = (undefined4 *)(**(code **)(*plVar1 + 8))(plVar1,0x30);
  }
  if (puVar5 != (undefined4 *)0x0) {
    *puVar5 = *param_2;
    *(undefined8 *)(puVar5 + 2) = 0;
    *(undefined8 *)(puVar5 + 4) = 0;
    puVar5[10] = param_4;
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8);
  FUN_140144430(param_1);
  if (*(longlong *)(param_1 + 0x20) == 0) {
    *(undefined4 **)(param_1 + 0x10) = puVar5;
    *(undefined4 **)(param_1 + 0x18) = puVar5;
    *(undefined8 *)(puVar5 + 8) = 0;
    *(undefined8 *)(puVar5 + 6) = 0;
  }
  else {
    FUN_140144430(param_1);
    FUN_140144430(param_1);
    if (lVar2 == 0) {
      lVar2 = *(longlong *)(param_1 + 0x10);
      *(undefined8 *)(puVar5 + 8) = 0;
      *(longlong *)(puVar5 + 6) = lVar2;
      if (lVar2 != 0) {
        *(undefined4 **)(lVar2 + 0x20) = puVar5;
      }
      *(undefined4 **)(param_1 + 0x10) = puVar5;
    }
    else {
      if (*(longlong *)(lVar2 + 0x20) == 0) {
        *(undefined4 **)(param_1 + 0x10) = puVar5;
      }
      else {
        *(undefined4 **)(*(longlong *)(lVar2 + 0x20) + 0x18) = puVar5;
      }
      uVar3 = *(undefined8 *)(lVar2 + 0x20);
      *(longlong *)(puVar5 + 6) = lVar2;
      *(undefined8 *)(puVar5 + 8) = uVar3;
      *(undefined4 **)(lVar2 + 0x20) = puVar5;
    }
  }
  *(undefined4 **)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8) = puVar5;
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  FUN_140144430(param_1);
  FUN_140144430(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar4 = FUN_140142850(param_1);
    FUN_140144ad0(param_1,uVar4);
  }
  FUN_140144430(param_1);
  return puVar5;
}



ulonglong FUN_1401a4e30(longlong param_1,double param_2)

{
  int *piVar1;
  int iVar2;
  uint uVar3;
  undefined4 uVar4;
  ulonglong uVar5;
  uint *puVar6;
  
  if (*(longlong *)(param_1 + 0x88) == 0) {
    piVar1 = (int *)(param_1 + 0x10);
    *piVar1 = *piVar1 + 1;
    iVar2 = *piVar1;
    uVar4 = *(undefined4 *)(param_1 + 0x10);
  }
  else {
    if (*(longlong *)(param_1 + 0x78) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    uVar3 = *(uint *)(*(longlong *)(param_1 + 0x78) + 0x10);
    uVar5 = (ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 0x40);
    if (*(longlong *)(param_1 + 0x20) != 0) {
      for (puVar6 = *(uint **)(*(longlong *)(param_1 + 0x20) + uVar5 * 8);
          (puVar6 != (uint *)0x0 && ((uint)uVar5 == puVar6[10] % *(uint *)(param_1 + 0x40)));
          puVar6 = *(uint **)(puVar6 + 6)) {
        if (*puVar6 == uVar3) goto LAB_1401a4ead;
      }
    }
    puVar6 = (uint *)0x0;
LAB_1401a4ead:
    if (puVar6 == (uint *)0x0) {
      FUN_1401a4ac0(param_1 + 0x70);
      piVar1 = (int *)(param_1 + 0x10);
      *piVar1 = *piVar1 + 1;
      if (*piVar1 == 0) {
        *(undefined4 *)(param_1 + 0x10) = 3;
        return 3;
      }
      goto LAB_1401a4f06;
    }
    if (*(double *)(param_1 + 8) <= param_2 - *(double *)(puVar6 + 4) &&
        param_2 - *(double *)(puVar6 + 4) != *(double *)(param_1 + 8)) {
      puVar6[4] = 0;
      puVar6[5] = 0;
      puVar6[3] = puVar6[3] + 1;
      uVar5 = FUN_1401a4ac0(param_1 + 0x70);
      return uVar5;
    }
    piVar1 = (int *)(param_1 + 0x10);
    *piVar1 = *piVar1 + 1;
    iVar2 = *piVar1;
    uVar4 = *(undefined4 *)(param_1 + 0x10);
  }
  if (iVar2 == 0) {
    uVar4 = 3;
  }
  *(undefined4 *)(param_1 + 0x10) = uVar4;
LAB_1401a4f06:
  return (ulonglong)*(uint *)(param_1 + 0x10);
}



void FUN_1401a4f10(void)

{
  FUN_1401a4bc0();
  return;
}



void FUN_1401a4f30(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined8 *puVar4;
  
  lVar1 = param_1[3];
  while( true ) {
    if (lVar1 == 0) {
      puVar4 = (undefined8 *)*param_1;
      param_1[1] = 0;
      param_1[2] = 0;
      if (puVar4 != (undefined8 *)0x0) {
        (**(code **)*puVar4)(puVar4,1);
      }
      return;
    }
    plVar2 = (longlong *)param_1[1];
    if (plVar2 == (longlong *)0x0) break;
    plVar3 = (longlong *)*param_1;
    param_1[1] = *plVar2;
    if (plVar3 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar3 + 0x10))(plVar3,plVar2);
    }
    param_1[3] = param_1[3] + -1;
    lVar1 = param_1[3];
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



// WARNING: Removing unreachable block (ram,0x0001401a5027)
// WARNING: Removing unreachable block (ram,0x0001401a5030)
// WARNING: Removing unreachable block (ram,0x0001401a504e)
// WARNING: Removing unreachable block (ram,0x0001401a5057)

undefined8 * FUN_1401a4fb0(undefined8 *param_1,undefined8 param_2)

{
  *param_1 = Proud::CRecycleHostIDFactory::vftable;
  param_1[1] = param_2;
  *(undefined1 *)(param_1 + 3) = 0;
  param_1[0xd] = 0;
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  *(undefined4 *)(param_1 + 8) = 0x11;
  param_1[7] = 0;
  *(undefined4 *)(param_1 + 0xc) = 0;
  *(undefined4 *)((longlong)param_1 + 0x44) = 0x3f400000;
  *(undefined4 *)(param_1 + 9) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x4c) = 0x40100000;
  param_1[10] = 0x26;
  param_1[0xb] = 0;
  param_1[0xe] = 0;
  param_1[0x11] = 0;
  param_1[0xf] = 0;
  param_1[0x10] = 0;
  *(undefined4 *)(param_1 + 2) = 2;
  return param_1;
}



void FUN_1401a50a0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 *puVar2;
  longlong *plVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  *param_1 = Proud::CRecycleHostIDFactory::vftable;
  *(undefined4 *)(param_1 + 2) = 2;
  FUN_1401a4bc0(param_1 + 3);
  lVar1 = param_1[0x11];
  while( true ) {
    if (lVar1 == 0) {
      param_1[0xf] = 0;
      param_1[0x10] = 0;
      FUN_1401a4f30(param_1 + 0xe);
      FUN_1401a4f10(param_1 + 3);
      *param_1 = Proud::IHostIDFactory::vftable;
      return;
    }
    puVar2 = (undefined8 *)param_1[0xf];
    if (puVar2 == (undefined8 *)0x0) break;
    param_1[0xf] = *puVar2;
    plVar3 = (longlong *)param_1[0xe];
    if (plVar3 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar3 + 0x10))(plVar3,puVar2,plVar3,param_4,uVar4);
    }
    param_1[0x11] = param_1[0x11] + -1;
    lVar1 = param_1[0x11];
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



void * FUN_1401a5190(void *param_1,uint param_2)

{
  FUN_1401a50a0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1401a51c0(longlong param_1,undefined8 param_2,uint param_3)

{
  uint uVar1;
  longlong lVar2;
  longlong *plVar3;
  undefined8 uVar4;
  ulonglong uVar5;
  char cVar6;
  undefined8 *puVar7;
  uint *puVar8;
  uint uVar9;
  ulonglong uVar10;
  uint local_res18 [4];
  
  uVar1 = *(uint *)(param_1 + 0x40);
  uVar10 = (ulonglong)uVar1;
  puVar7 = (undefined8 *)(param_3 / uVar10);
  uVar5 = (ulonglong)param_3 % uVar10;
  lVar2 = *(longlong *)(param_1 + 0x20);
  uVar9 = (uint)uVar5;
  if (lVar2 != 0) {
    for (puVar8 = *(uint **)(lVar2 + uVar5 * 8);
        (puVar8 != (uint *)0x0 &&
        (puVar7 = (undefined8 *)(puVar8[10] / uVar10), uVar9 == puVar8[10] % uVar1));
        puVar8 = *(uint **)(puVar8 + 6)) {
      if (*puVar8 == param_3) goto LAB_1401a521b;
    }
  }
  puVar8 = (uint *)0x0;
LAB_1401a521b:
  local_res18[0] = param_3;
  if (puVar8 != (uint *)0x0) {
    if (*(double *)(puVar8 + 4) != 0.0) {
      return puVar7;
    }
    *(undefined8 *)(puVar8 + 4) = param_2;
    puVar7 = (undefined8 *)FUN_1401a4b40(param_1 + 0x70,local_res18);
    return puVar7;
  }
  if (lVar2 != 0) {
    for (puVar8 = *(uint **)(lVar2 + uVar5 * 8);
        (puVar8 != (uint *)0x0 && (uVar9 == puVar8[10] % uVar1)); puVar8 = *(uint **)(puVar8 + 6)) {
      if (*puVar8 == param_3) goto LAB_1401a5327;
    }
    if (lVar2 != 0) {
      for (puVar8 = *(uint **)(lVar2 + uVar5 * 8);
          (puVar8 != (uint *)0x0 && (uVar9 == puVar8[10] % uVar1)); puVar8 = *(uint **)(puVar8 + 6))
      {
        if (*puVar8 == param_3) goto LAB_1401a5315;
      }
      if (lVar2 != 0) goto LAB_1401a52ec;
    }
  }
  cVar6 = FUN_140144560(param_1 + 0x18,uVar10,CONCAT71((int7)((ulonglong)lVar2 >> 8),1));
  if (cVar6 == '\0') {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x8007000e);
  }
LAB_1401a52ec:
  FUN_140144430(param_1 + 0x18);
  puVar8 = (uint *)FUN_1401a4cf0(param_1 + 0x18,local_res18,uVar5,param_3);
  FUN_140144430(param_1 + 0x18);
LAB_1401a5315:
  *(ulonglong *)(puVar8 + 2) = (ulonglong)param_3;
  *(undefined8 *)(puVar8 + 4) = param_2;
LAB_1401a5327:
  plVar3 = *(longlong **)(param_1 + 0x70);
  uVar4 = *(undefined8 *)(param_1 + 0x80);
  if (plVar3 == (longlong *)0x0) {
    puVar7 = (undefined8 *)FUN_1400a34c0(0x18);
  }
  else {
    puVar7 = (undefined8 *)(**(code **)(*plVar3 + 8))(plVar3,0x18);
  }
  if (puVar7 != (undefined8 *)0x0) {
    *(uint *)(puVar7 + 2) = param_3;
  }
  puVar7[1] = uVar4;
  *puVar7 = 0;
  *(longlong *)(param_1 + 0x88) = *(longlong *)(param_1 + 0x88) + 1;
  if (*(undefined8 **)(param_1 + 0x80) == (undefined8 *)0x0) {
    *(undefined8 **)(param_1 + 0x78) = puVar7;
  }
  else {
    **(undefined8 **)(param_1 + 0x80) = puVar7;
  }
  *(undefined8 **)(param_1 + 0x80) = puVar7;
  return puVar7;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x0001401a5454)

void FUN_1401a53a0(longlong param_1,byte *param_2,int param_3)

{
  byte bVar1;
  undefined1 uVar2;
  byte bVar3;
  uint uVar4;
  longlong lVar5;
  undefined8 *puVar6;
  longlong lVar7;
  undefined8 *puVar8;
  undefined8 local_58;
  undefined8 uStack_50;
  undefined8 local_48;
  undefined8 uStack_40;
  undefined8 local_38;
  undefined8 uStack_30;
  undefined8 local_28;
  undefined8 uStack_20;
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)&local_58;
  puVar6 = (undefined8 *)0x0;
  lVar7 = (longlong)param_3;
  puVar8 = puVar6;
  if (*(int *)(param_1 + 0x18) != 0) {
    puVar8 = *(undefined8 **)(param_1 + 0x10);
  }
  local_58 = *puVar8;
  uStack_50 = puVar8[1];
  local_48 = puVar8[2];
  uStack_40 = puVar8[3];
  local_38 = puVar8[4];
  uStack_30 = puVar8[5];
  local_28 = puVar8[6];
  uStack_20 = puVar8[7];
  puVar8 = puVar6;
  if (0 < param_3) {
    do {
      uVar4 = (int)puVar8 + 1U & 0x8000003f;
      if ((int)uVar4 < 0) {
        uVar4 = (uVar4 - 1 | 0xffffffc0) + 1;
      }
      puVar8 = (undefined8 *)(longlong)(int)uVar4;
      bVar1 = *(byte *)((longlong)&local_58 + (longlong)puVar8);
      uVar4 = (int)puVar6 + (uint)bVar1 & 0x8000003f;
      if ((int)uVar4 < 0) {
        uVar4 = (uVar4 - 1 | 0xffffffc0) + 1;
      }
      puVar6 = (undefined8 *)(ulonglong)uVar4;
      uVar2 = *(undefined1 *)((longlong)&local_58 + (longlong)puVar8);
      lVar5 = (longlong)(int)uVar4;
      bVar3 = *(byte *)((longlong)&local_58 + lVar5);
      *(undefined1 *)((longlong)&local_58 + (longlong)puVar8) =
           *(undefined1 *)((longlong)&local_58 + lVar5);
      *(undefined1 *)((longlong)&local_58 + lVar5) = uVar2;
      *param_2 = *param_2 ^
                 *(byte *)((longlong)&local_58 +
                          (longlong)(int)((uint)bVar3 + (uint)bVar1 & 0x8000003f));
      lVar7 = lVar7 + -1;
      param_2 = param_2 + 1;
    } while (lVar7 != 0);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x0001401a5574)

void FUN_1401a5490(longlong param_1,byte *param_2,int param_3)

{
  byte bVar1;
  undefined1 uVar2;
  byte bVar3;
  uint uVar4;
  longlong lVar5;
  undefined8 *puVar6;
  longlong lVar7;
  undefined8 *puVar8;
  undefined8 local_98;
  undefined8 uStack_90;
  undefined8 local_88;
  undefined8 uStack_80;
  undefined8 local_78;
  undefined8 uStack_70;
  undefined8 local_68;
  undefined8 uStack_60;
  undefined8 local_58;
  undefined8 uStack_50;
  undefined8 local_48;
  undefined8 uStack_40;
  undefined8 local_38;
  undefined8 uStack_30;
  undefined8 local_28;
  undefined8 uStack_20;
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)&local_98;
  puVar6 = (undefined8 *)0x0;
  lVar7 = (longlong)param_3;
  puVar8 = puVar6;
  if (*(int *)(param_1 + 0x18) != 0) {
    puVar8 = *(undefined8 **)(param_1 + 0x10);
  }
  local_98 = *puVar8;
  uStack_90 = puVar8[1];
  local_88 = puVar8[2];
  uStack_80 = puVar8[3];
  local_78 = puVar8[4];
  uStack_70 = puVar8[5];
  local_68 = puVar8[6];
  uStack_60 = puVar8[7];
  local_58 = puVar8[8];
  uStack_50 = puVar8[9];
  local_48 = puVar8[10];
  uStack_40 = puVar8[0xb];
  local_38 = puVar8[0xc];
  uStack_30 = puVar8[0xd];
  local_28 = puVar8[0xe];
  uStack_20 = puVar8[0xf];
  puVar8 = puVar6;
  if (0 < param_3) {
    do {
      uVar4 = (int)puVar8 + 1U & 0x8000007f;
      if ((int)uVar4 < 0) {
        uVar4 = (uVar4 - 1 | 0xffffff80) + 1;
      }
      puVar8 = (undefined8 *)(longlong)(int)uVar4;
      bVar1 = *(byte *)((longlong)&local_98 + (longlong)puVar8);
      uVar4 = (int)puVar6 + (uint)bVar1 & 0x8000007f;
      if ((int)uVar4 < 0) {
        uVar4 = (uVar4 - 1 | 0xffffff80) + 1;
      }
      puVar6 = (undefined8 *)(ulonglong)uVar4;
      uVar2 = *(undefined1 *)((longlong)&local_98 + (longlong)puVar8);
      lVar5 = (longlong)(int)uVar4;
      bVar3 = *(byte *)((longlong)&local_98 + lVar5);
      *(undefined1 *)((longlong)&local_98 + (longlong)puVar8) =
           *(undefined1 *)((longlong)&local_98 + lVar5);
      *(undefined1 *)((longlong)&local_98 + lVar5) = uVar2;
      *param_2 = *param_2 ^
                 *(byte *)((longlong)&local_98 +
                          (longlong)(int)((uint)bVar3 + (uint)bVar1 & 0x8000007f));
      lVar7 = lVar7 + -1;
      param_2 = param_2 + 1;
    } while (lVar7 != 0);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x0001401a566c)

void FUN_1401a55c0(longlong param_1,byte *param_2,int param_3)

{
  byte bVar1;
  byte bVar2;
  byte bVar3;
  uint uVar4;
  void *pvVar5;
  longlong lVar6;
  void *pvVar7;
  undefined1 auStack_138 [32];
  byte local_118 [256];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_138;
  pvVar7 = (void *)0x0;
  lVar6 = (longlong)param_3;
  pvVar5 = pvVar7;
  if (*(int *)(param_1 + 0x18) != 0) {
    pvVar5 = *(void **)(param_1 + 0x10);
  }
  memcpy(local_118,pvVar5,0x100);
  pvVar5 = pvVar7;
  if (0 < param_3) {
    do {
      uVar4 = (int)pvVar7 + 1U & 0x800000ff;
      if ((int)uVar4 < 0) {
        uVar4 = (uVar4 - 1 | 0xffffff00) + 1;
      }
      pvVar7 = (void *)(longlong)(int)uVar4;
      bVar1 = local_118[(longlong)pvVar7];
      uVar4 = (int)pvVar5 + (uint)bVar1 & 0x800000ff;
      if ((int)uVar4 < 0) {
        uVar4 = (uVar4 - 1 | 0xffffff00) + 1;
      }
      pvVar5 = (void *)(ulonglong)uVar4;
      bVar2 = local_118[(longlong)pvVar7];
      bVar3 = local_118[(int)uVar4];
      local_118[(longlong)pvVar7] = local_118[(int)uVar4];
      local_118[(int)uVar4] = bVar2;
      *param_2 = *param_2 ^ local_118[(int)((uint)bVar3 + (uint)bVar1 & 0x800000ff)];
      lVar6 = lVar6 + -1;
      param_2 = param_2 + 1;
    } while (lVar6 != 0);
  }
  return;
}



void FUN_1401a56c0(longlong param_1)

{
  int iVar1;
  undefined1 local_58 [88];
  
  iVar1 = *(int *)(param_1 + 0x18) << 3;
  if (iVar1 == 0x200) {
    FUN_1401a53a0();
    return;
  }
  if (iVar1 != 0x400) {
    if (iVar1 != 0x800) {
      FUN_1400a2320(local_58,L"RC4 Encrypt Error. FastEncryptLevel is correct");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    FUN_1401a55c0();
    return;
  }
  FUN_1401a5490();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a5720(longlong param_1,longlong param_2,int param_3)

{
  undefined1 uVar1;
  longlong lVar2;
  ulonglong uVar3;
  int iVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  undefined1 auStack_198 [32];
  undefined1 local_178 [80];
  byte abStack_128 [256];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_198;
  if (param_3 == 0) {
    *(undefined1 *)(param_1 + 0x28) = 1;
  }
  else {
    if (param_2 == 0) {
      FUN_1400a2320(local_178,L"RC4 ExpandFrom Error. inputkey is NULL");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_178,(ThrowInfo *)&DAT_1402f4860);
    }
    FUN_14003cda0(param_1,param_3);
    uVar5 = 0;
    uVar6 = uVar5;
    if (0 < param_3) {
      do {
        iVar4 = (int)uVar6;
        if ((iVar4 < 0) || (*(int *)(param_1 + 0x18) <= iVar4)) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        *(char *)((longlong)iVar4 + *(longlong *)(param_1 + 0x10)) = (char)uVar6;
        uVar6 = (ulonglong)(iVar4 + 1U);
        abStack_128[iVar4] = *(byte *)(iVar4 % param_3 + param_2);
      } while ((int)(iVar4 + 1U) < param_3);
    }
    uVar6 = uVar5;
    uVar7 = uVar5;
    if (0 < param_3) {
      do {
        if ((longlong)uVar6 < 0) {
LAB_1401a5862:
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        if (*(int *)(param_1 + 0x18) <= (int)uVar7) goto LAB_1401a5862;
        lVar2 = *(longlong *)(param_1 + 0x10);
        uVar3 = (longlong)
                (int)((uint)*(byte *)(lVar2 + uVar6) + (uint)abStack_128[uVar6] + (int)uVar5) %
                (longlong)param_3;
        uVar5 = uVar3 & 0xffffffff;
        iVar4 = (int)((longlong)((ulonglong)(uint)((int)uVar3 >> 0x1f) << 0x20 | uVar3 & 0xffffffff)
                     % (longlong)param_3);
        if ((iVar4 < 0) || (*(int *)(param_1 + 0x18) <= iVar4)) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        uVar1 = *(undefined1 *)(lVar2 + uVar6);
        uVar6 = uVar6 + 1;
        uVar7 = (ulonglong)((int)uVar7 + 1);
        *(undefined1 *)(lVar2 + -1 + uVar6) = *(undefined1 *)(iVar4 + lVar2);
        *(undefined1 *)(iVar4 + lVar2) = uVar1;
      } while ((longlong)uVar6 < (longlong)param_3);
    }
    *(undefined1 *)(param_1 + 0x28) = 1;
  }
  return;
}



undefined8 FUN_1401a5870(longlong param_1,longlong param_2,longlong param_3,ulonglong param_4)

{
  undefined4 uVar1;
  undefined7 uVar4;
  longlong lVar2;
  undefined8 uVar3;
  undefined4 *puVar5;
  uint uVar6;
  undefined4 *puVar8;
  void *_Src;
  undefined1 local_290 [72];
  undefined1 local_248 [72];
  undefined1 local_200 [72];
  undefined1 local_1b8 [72];
  undefined1 local_170 [288];
  undefined1 local_50 [72];
  int iVar7;
  
  if (*(char *)(param_3 + 0x28) == '\0') {
    if (*(int *)(param_3 + 0x18) == 0) {
      FUN_1400a1fd0(local_1b8,&DAT_140261a78);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_1b8,(ThrowInfo *)&DAT_1402f4860);
    }
  }
  else if (*(int *)(param_3 + 0x18) == 0) {
    FUN_1400a2320(local_248,
                  L"FastEncrypt Key Length is 0, Check ServerStartParameters m_fastEncryptedMessageKeyLength"
                  ,param_3,param_4,0xfffffffffffffffe);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_248,(ThrowInfo *)&DAT_1402f4860);
  }
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar7 = *(int *)(param_1 + 0x18);
  }
  else {
    iVar7 = *(int *)(lVar2 + 0x18);
  }
  if (iVar7 <= (int)param_4) {
    if (lVar2 == 0) {
      if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      param_4 = (ulonglong)*(uint *)(param_1 + 0x18);
    }
    else {
      param_4 = (ulonglong)*(uint *)(lVar2 + 0x18);
    }
  }
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar7 = *(int *)(param_1 + 0x18);
  }
  else {
    iVar7 = *(int *)(lVar2 + 0x18);
  }
  uVar6 = iVar7 - (int)param_4;
  if (uVar6 == 0) {
    uVar4 = (undefined7)((ulonglong)lVar2 >> 8);
  }
  else {
    if (*(longlong *)(param_1 + 0x10) == 0) {
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      if (*(int *)(lVar2 + 0x18) == 0) {
        lVar2 = 0;
      }
      else {
        lVar2 = *(longlong *)(lVar2 + 0x10);
      }
    }
    else {
      lVar2 = *(longlong *)(param_1 + 0x10);
      if (lVar2 == 0) {
        FUN_1400a2320(local_290,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50,param_3,param_4,
                      0xfffffffffffffffe);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_290,(ThrowInfo *)&DAT_1402f4860);
      }
    }
    puVar8 = (undefined4 *)0x0;
    _Src = (void *)((int)param_4 + lVar2);
    FUN_140185030(param_2);
    FUN_1401856c0(param_2,uVar6 + 4);
    uVar1 = FUN_1401c1490(_Src,uVar6);
    if (*(longlong *)(param_2 + 0x10) == 0) {
      lVar2 = *(longlong *)(param_2 + 8);
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      puVar5 = puVar8;
      if (*(int *)(lVar2 + 0x18) != 0) {
        puVar5 = *(undefined4 **)(lVar2 + 0x10);
      }
    }
    else {
      puVar5 = *(undefined4 **)(param_2 + 0x10);
      if (*(undefined4 **)(param_2 + 0x10) == (undefined4 *)0x0) {
        FUN_1400a2320(local_200,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_200,(ThrowInfo *)&DAT_1402f4860);
      }
    }
    *puVar5 = uVar1;
    if (*(longlong *)(param_2 + 0x10) == 0) {
      lVar2 = *(longlong *)(param_2 + 8);
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      puVar5 = puVar8;
      if (*(int *)(lVar2 + 0x18) != 0) {
        puVar5 = *(undefined4 **)(lVar2 + 0x10);
      }
    }
    else {
      puVar5 = *(undefined4 **)(param_2 + 0x10);
      if (*(undefined4 **)(param_2 + 0x10) == (undefined4 *)0x0) {
        FUN_1400a2320(local_170,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_170,(ThrowInfo *)&DAT_1402f4860);
      }
    }
    memcpy(puVar5 + 1,_Src,(ulonglong)uVar6);
    lVar2 = *(longlong *)(param_2 + 8);
    if ((lVar2 == 0) && (*(longlong *)(param_2 + 0x10) == 0)) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    if (*(longlong *)(param_2 + 0x10) == 0) {
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      if (*(int *)(lVar2 + 0x18) != 0) {
        puVar8 = *(undefined4 **)(lVar2 + 0x10);
      }
    }
    else {
      puVar8 = *(undefined4 **)(param_2 + 0x10);
      if (puVar8 == (undefined4 *)0x0) {
        FUN_1400a2320(local_50,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
      }
    }
    uVar3 = FUN_1401a56c0(param_3,puVar8);
    uVar4 = (undefined7)((ulonglong)uVar3 >> 8);
  }
  return CONCAT71(uVar4,1);
}



undefined8 FUN_1401a5b50(longlong param_1,undefined8 param_2,longlong param_3,int param_4)

{
  int iVar1;
  undefined7 uVar5;
  longlong lVar2;
  int *piVar3;
  void *_Dst;
  undefined8 uVar4;
  int *piVar6;
  uint uVar7;
  undefined **local_238;
  undefined8 local_230;
  int *local_228;
  undefined8 local_220;
  undefined8 local_218;
  undefined8 local_208;
  undefined1 local_200 [288];
  undefined1 local_e0 [72];
  undefined1 local_98 [72];
  undefined1 local_50 [72];
  int iVar8;
  
  local_208 = 0xfffffffffffffffe;
  if (*(char *)(param_3 + 0x28) == '\0') {
    if (*(int *)(param_3 + 0x18) == 0) {
      FUN_1400a1fd0(local_98,&DAT_140261af8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_98,(ThrowInfo *)&DAT_1402f4860);
    }
  }
  else if (*(int *)(param_3 + 0x18) == 0) {
    FUN_1400a2320(local_200,
                  L"FastEncrypt Key Length is 0, Check ServerStartParameters m_fastEncryptedMessageKeyLength"
                 );
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_200,(ThrowInfo *)&DAT_1402f4860);
  }
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar8 = *(int *)(param_1 + 0x18);
  }
  else {
    iVar8 = *(int *)(lVar2 + 0x18);
  }
  if (iVar8 <= param_4) {
    if (lVar2 == 0) {
      if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      param_4 = *(int *)(param_1 + 0x18);
    }
    else {
      param_4 = *(int *)(lVar2 + 0x18);
    }
  }
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar8 = *(int *)(param_1 + 0x18);
  }
  else {
    iVar8 = *(int *)(lVar2 + 0x18);
  }
  uVar7 = iVar8 - param_4;
  if (uVar7 == 0) {
    uVar5 = (undefined7)((ulonglong)lVar2 >> 8);
  }
  else {
    if (*(longlong *)(param_1 + 0x10) == 0) {
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      if (*(int *)(lVar2 + 0x18) == 0) {
        lVar2 = 0;
      }
      else {
        lVar2 = *(longlong *)(lVar2 + 0x10);
      }
    }
    else {
      lVar2 = *(longlong *)(param_1 + 0x10);
      if (lVar2 == 0) {
        FUN_1400a2320(local_e0,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_e0,(ThrowInfo *)&DAT_1402f4860);
      }
    }
    piVar6 = (int *)0x0;
    FUN_140185030(param_2);
    FUN_1401856c0(param_2,uVar7 - 4);
    local_230 = 0;
    local_228 = (int *)0x0;
    local_220 = 0;
    local_218 = 0;
    local_238 = Proud::ByteArray::vftable;
    FUN_14003cda0(&local_238,uVar7);
    piVar3 = local_228;
    if ((int)local_220 == 0) {
      piVar3 = piVar6;
    }
    memcpy(piVar3,(void *)(param_4 + lVar2),(ulonglong)uVar7);
    piVar3 = local_228;
    if ((int)local_220 == 0) {
      piVar3 = piVar6;
    }
    FUN_1401a56c0(param_3,piVar3);
    piVar3 = local_228;
    if ((int)local_220 == 0) {
      piVar3 = piVar6;
    }
    iVar8 = *piVar3;
    piVar3 = local_228;
    if ((int)local_220 == 0) {
      piVar3 = piVar6;
    }
    iVar1 = FUN_1401c1490(piVar3 + 1,uVar7 - 4);
    if (iVar8 != iVar1) {
      FUN_1400a1fd0(local_50,&DAT_140261ac0);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
    }
    piVar3 = local_228;
    if ((int)local_220 == 0) {
      piVar3 = piVar6;
    }
    _Dst = (void *)FUN_14016aa90(param_2);
    memcpy(_Dst,piVar3 + 1,(ulonglong)(uVar7 - 4));
    uVar4 = FUN_140140df0(&local_238);
    uVar5 = (undefined7)((ulonglong)uVar4 >> 8);
  }
  return CONCAT71(uVar5,1);
}



longlong FUN_1401a5dd0(longlong param_1)

{
  int iVar1;
  undefined4 uVar2;
  undefined1 local_58 [80];
  
  InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_140320fc0);
  InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_140321000);
  InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_140321040);
  iVar1 = FUN_1401c3990(&PTR_s_fortuna_140267c10);
  if (iVar1 == -1) {
    FUN_1400a2320(local_58,L"REGISTER PRNG ERROR : SPRNG");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar1 = FUN_1401c3140(&PTR_DAT_140267b90);
  if (iVar1 == -1) {
    FUN_1400a2320(local_58,L"REGISTER HASH ERROR : SHA1");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  memcpy(&DAT_140321080,&PTR_s_LibTomMath_140267a00,0x188);
  uVar2 = FUN_1401c22f0("fortuna");
  *(undefined4 *)(param_1 + 0x1058) = uVar2;
  uVar2 = FUN_1401c2250(&DAT_140209300);
  *(undefined4 *)(param_1 + 0x105c) = uVar2;
  iVar1 = FUN_1401c2150(0x80,*(undefined4 *)(param_1 + 0x1058),param_1,0);
  if (iVar1 != 0) {
    FUN_1400a2320(local_58,L"PRNG MAKE ERROR");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  return param_1;
}



undefined8 * FUN_1401a5ef0(undefined8 *param_1)

{
  undefined8 *puVar1;
  
  puVar1 = operator_new(0x48);
  *param_1 = puVar1;
  *puVar1 = 0;
  puVar1[1] = 0;
  puVar1[2] = 0;
  puVar1[3] = 0;
  puVar1[4] = 0;
  puVar1[5] = 0;
  puVar1[6] = 0;
  puVar1[7] = 0;
  puVar1[8] = 0;
  return param_1;
}



void FUN_1401a5f40(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_1401c4350();
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  return;
}



undefined * FUN_1401a5f70(void)

{
  bool bVar1;
  char cVar2;
  
  bVar1 = false;
  cVar2 = FUN_1400a1cc0(&DAT_14031a208);
  if (cVar2 != '\0') {
    if (DAT_14030c400 == '\0') {
      bVar1 = false;
    }
    else {
      bVar1 = true;
      FUN_1400a1c30(&DAT_14031a208);
    }
  }
  if ((DAT_14031a200 & 1) == 0) {
    DAT_14031a200 = DAT_14031a200 | 1;
    FUN_1401a5dd0(&DAT_1403191a0);
    atexit(FUN_140202bf0);
  }
  DAT_14030c400 = 0;
  if (bVar1) {
    FUN_1400d1290(&DAT_14031a208);
  }
  return &DAT_1403191a0;
}



void FUN_1401a6030(longlong param_1,int param_2)

{
  undefined8 uVar1;
  int iVar2;
  undefined8 uVar3;
  undefined1 local_58 [80];
  
  FUN_14003cda0(param_1,param_2 >> 3);
  if (*(int *)(param_1 + 0x18) == 0) {
    uVar3 = 0;
  }
  else {
    uVar3 = *(undefined8 *)(param_1 + 0x10);
  }
  uVar1 = FUN_1401a5f70();
  iVar2 = FUN_1401c3e90(uVar3,param_2 >> 3,uVar1);
  if (iVar2 == 0) {
    FUN_1400a2320(local_58,L"Create Random Block Read Error");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  return;
}



void FUN_1401a60a0(undefined8 *param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  uint local_res10 [6];
  undefined1 local_58 [80];
  
  FUN_14003cda0(param_2,0x400);
  local_res10[0] = *(uint *)(param_2 + 0x18);
  if (local_res10[0] == 0) {
    uVar2 = 0;
  }
  else {
    uVar2 = *(undefined8 *)(param_2 + 0x10);
  }
  iVar1 = FUN_1401c4880(uVar2,local_res10,0,*param_1);
  if (iVar1 != 0) {
    FUN_1400a2320(local_58,L"PUBLIC KEY EXPORT ERROR");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  if (*(uint *)(param_2 + 0x18) < local_res10[0]) {
    FUN_1400a2320(local_58,L"PublicKey To Blob result is larger! Memory corruption may occur!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  FUN_14003cda0(param_2);
  return;
}



void FUN_1401a6160(undefined8 *param_1,undefined8 param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  int iVar3;
  undefined1 local_58 [80];
  
  lVar1 = FUN_1401a5f70();
  uVar2 = FUN_1401a5f70();
  iVar3 = FUN_1401c4a30(uVar2,*(undefined4 *)(lVar1 + 0x1058),0x80,0x10001,*param_1);
  if (iVar3 != 0) {
    FUN_1400a2320(local_58,L"RSA MAKE KEY ERROR");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  FUN_1401a60a0(param_1,param_2);
  return;
}



void FUN_1401a61f0(longlong param_1,longlong param_2,longlong param_3)

{
  uint uVar1;
  int iVar2;
  undefined8 *puVar3;
  longlong lVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  uint local_res18 [2];
  undefined8 *local_res20;
  undefined1 local_80 [72];
  
  puVar3 = operator_new(0x48);
  *puVar3 = 0;
  puVar3[1] = 0;
  puVar3[2] = 0;
  puVar3[3] = 0;
  puVar3[4] = 0;
  puVar3[5] = 0;
  puVar3[6] = 0;
  puVar3[7] = 0;
  puVar3[8] = 0;
  uVar8 = 0;
  uVar7 = uVar8;
  if (*(int *)(param_3 + 0x18) != 0) {
    uVar7 = *(undefined8 *)(param_3 + 0x10);
  }
  local_res20 = puVar3;
  iVar2 = FUN_1401c43a0(uVar7,*(int *)(param_3 + 0x18),puVar3);
  if (iVar2 != 0) {
    FUN_1400a2320(local_80,L"%s fail: %d",L"Proud::CRsaKey::FromBlob");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_80,(ThrowInfo *)&DAT_1402f4860);
  }
  uVar1 = *(uint *)(param_2 + 0x18);
  local_res18[0] = uVar1;
  local_res18[0] = (*DAT_140321110)(puVar3[3]);
  FUN_14003cda0(param_1,local_res18[0]);
  uVar7 = uVar8;
  if (*(int *)(param_1 + 0x18) != 0) {
    uVar7 = *(undefined8 *)(param_1 + 0x10);
  }
  if (*(int *)(param_2 + 0x18) != 0) {
    uVar8 = *(undefined8 *)(param_2 + 0x10);
  }
  lVar4 = FUN_1401a5f70();
  lVar5 = FUN_1401a5f70();
  uVar6 = FUN_1401a5f70();
  iVar2 = FUN_1401c4e10(uVar8,uVar1,uVar7,local_res18,0,0,uVar6,*(undefined4 *)(lVar5 + 0x1058),
                        *(undefined4 *)(lVar4 + 0x105c),2,puVar3);
  if (iVar2 != 0) {
    FUN_1400a2320(local_80,L"%s fail: %d",L"Proud::CRsa::EncryptSessionKeyByPublicKey",1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_80,(ThrowInfo *)&DAT_1402f4860);
  }
  if (*(uint *)(param_1 + 0x18) < local_res18[0]) {
    FUN_1400a2320(local_80,L"Encryption result is larger! Memory corruption may occur!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_80,(ThrowInfo *)&DAT_1402f4860);
  }
  FUN_14003cda0(param_1);
  FUN_1401c4350(puVar3);
  operator_delete(puVar3);
  return;
}



undefined8 *
FUN_1401a63f0(undefined8 *param_1,longlong param_2,longlong param_3,undefined8 *param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  int iVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  int local_res10 [2];
  uint local_res18 [4];
  longlong local_88;
  undefined *local_80;
  undefined8 local_78;
  longlong local_70;
  undefined1 local_68;
  undefined **local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  
  local_78 = 0xfffffffffffffffe;
  uVar7 = 0;
  local_res10[0] = 0;
  local_res18[0] = *(uint *)(param_3 + 0x18);
  FUN_14003cda0(param_2);
  uVar6 = uVar7;
  if (*(int *)(param_2 + 0x18) != 0) {
    uVar6 = *(undefined8 *)(param_2 + 0x10);
  }
  iVar4 = *(int *)(param_3 + 0x18);
  if (iVar4 != 0) {
    uVar7 = *(undefined8 *)(param_3 + 0x10);
  }
  lVar5 = FUN_1401a5f70();
  iVar4 = FUN_1401c4fd0(uVar7,iVar4,uVar6,local_res18,0,0,*(undefined4 *)(lVar5 + 0x105c),2,
                        local_res10,*param_4);
  if (iVar4 == 0) {
    if (local_res10[0] == 1) {
      if (*(uint *)(param_3 + 0x18) < local_res18[0]) {
        FUN_1400a3440();
        local_80 = PTR_DAT_1402f8010;
        FUN_14003c600(&local_80,L"Decryption result is larger! Memory corruption may occur!");
        local_58 = 0;
        local_50 = 0;
        local_48 = 0;
        local_40 = 0;
        local_60 = Proud::ByteArray::vftable;
        FUN_1401416a0(&local_88,6,0,&local_80,&local_60);
        FUN_140140df0(&local_60);
        *param_1 = 0;
        FUN_140141570(param_1,&local_88);
        FUN_14008c980(&local_88);
        puVar3 = local_80;
        if (((local_80 != (undefined *)0x0) && (local_80 != PTR_DAT_1402f8010)) &&
           (puVar1 = local_80 + -8, puVar1 != (undefined *)0x0)) {
          uVar6 = FUN_1400a3440();
          local_70 = uVar6;
          FUN_1400a1c30(uVar6);
          local_68 = 1;
          piVar2 = (int *)(puVar3 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_1400a3530(puVar1);
          }
          FUN_1400d1290(uVar6);
        }
      }
      else {
        FUN_14003cda0(param_2);
        *param_1 = 0;
      }
    }
    else {
      FUN_1400a3440();
      local_80 = PTR_DAT_1402f8010;
      FUN_14003c600(&local_80,L"Incorrect Packet");
      local_58 = 0;
      local_50 = 0;
      local_48 = 0;
      local_40 = 0;
      local_60 = Proud::ByteArray::vftable;
      FUN_1401416a0(&local_88,6,0,&local_80,&local_60);
      FUN_140140df0(&local_60);
      *param_1 = 0;
      FUN_140141570(param_1,&local_88);
      lVar5 = local_88;
      if (local_88 != 0) {
        local_70 = local_88;
        FUN_1400a1c30(local_88);
        local_68 = 1;
        *(longlong *)(local_88 + 0x40) = *(longlong *)(local_88 + 0x40) + -1;
        if (*(longlong *)(local_88 + 0x40) == 0) {
          FUN_1400d1290(lVar5);
          local_68 = 0;
          FUN_14008c910(local_88);
        }
        else {
          FUN_1400d1290(lVar5);
        }
      }
      puVar3 = local_80;
      if (((local_80 != (undefined *)0x0) && (local_80 != PTR_DAT_1402f8010)) &&
         (puVar1 = local_80 + -8, puVar1 != (undefined *)0x0)) {
        uVar6 = FUN_1400a3440();
        local_70 = uVar6;
        FUN_1400a1c30(uVar6);
        local_68 = 1;
        piVar2 = (int *)(puVar3 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(puVar1);
        }
        FUN_1400d1290(uVar6);
      }
    }
  }
  else {
    FUN_1400a3440();
    local_80 = PTR_DAT_1402f8010;
    FUN_14003c600(&local_80,L"Error");
    local_58 = 0;
    local_50 = 0;
    local_48 = 0;
    local_40 = 0;
    local_60 = Proud::ByteArray::vftable;
    FUN_1401416a0(&local_88,6,0,&local_80,&local_60);
    FUN_140140df0(&local_60);
    *param_1 = 0;
    FUN_140141570(param_1,&local_88);
    lVar5 = local_88;
    if (local_88 != 0) {
      local_70 = local_88;
      FUN_1400a1c30(local_88);
      local_68 = 1;
      *(longlong *)(local_88 + 0x40) = *(longlong *)(local_88 + 0x40) + -1;
      if (*(longlong *)(local_88 + 0x40) == 0) {
        FUN_1400d1290(lVar5);
        local_68 = 0;
        FUN_14008c910(local_88);
      }
      else {
        FUN_1400d1290(lVar5);
      }
    }
    puVar3 = local_80;
    if (((local_80 != (undefined *)0x0) && (local_80 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_80 + -8, puVar1 != (undefined *)0x0)) {
      uVar6 = FUN_1400a3440();
      local_70 = uVar6;
      FUN_1400a1c30(uVar6);
      local_68 = 1;
      piVar2 = (int *)(puVar3 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar6);
    }
  }
  return param_1;
}



undefined8 * FUN_1401a67f0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



ulonglong FUN_1401a6850(longlong param_1,int param_2,int param_3)

{
  int iVar1;
  longlong lVar2;
  ulonglong in_RAX;
  uint uVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  
  uVar4 = 0;
  iVar1 = *(int *)(param_1 + 0x18);
  uVar5 = uVar4;
  uVar6 = uVar4;
  if (0 < iVar1) {
    do {
      if (((longlong)uVar5 < 0) || (iVar1 <= (int)uVar4)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      lVar2 = *(longlong *)(param_1 + 0x10);
      in_RAX = *(ulonglong *)(uVar6 + 0x10 + lVar2);
      if ((*(int *)(uVar6 + lVar2) == param_2) && (*(int *)(uVar6 + 8 + lVar2) == param_3)) {
        return CONCAT71((int7)(in_RAX >> 8),1);
      }
      uVar3 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar3;
      uVar5 = uVar5 + 1;
      uVar6 = uVar6 + 0x18;
    } while ((int)uVar3 < iVar1);
  }
  return in_RAX & 0xffffffffffffff00;
}



ulonglong FUN_1401a68d0(longlong param_1,int param_2)

{
  int iVar1;
  ulonglong in_RAX;
  uint uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  
  iVar1 = *(int *)(param_1 + 0x18);
  uVar3 = 0;
  uVar4 = uVar3;
  uVar5 = uVar3;
  if (0 < iVar1) {
    do {
      if (((longlong)uVar4 < 0) || (iVar1 <= (int)uVar3)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      in_RAX = *(ulonglong *)(uVar5 + 0x10 + *(longlong *)(param_1 + 0x10));
      if (*(int *)(uVar5 + *(longlong *)(param_1 + 0x10)) == param_2) {
        return CONCAT71((int7)(in_RAX >> 8),1);
      }
      uVar2 = (int)uVar3 + 1;
      uVar3 = (ulonglong)uVar2;
      uVar4 = uVar4 + 1;
      uVar5 = uVar5 + 0x18;
    } while ((int)uVar2 < iVar1);
  }
  return in_RAX & 0xffffffffffffff00;
}



undefined8 FUN_1401a6940(longlong param_1,int param_2,int param_3,int param_4)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  longlong lVar5;
  
  iVar1 = *(int *)(param_1 + 0x18);
  iVar4 = 0;
  lVar5 = 0;
  if (0 < iVar1) {
    lVar3 = 0;
    do {
      if ((lVar5 < 0) || (iVar1 <= iVar4)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      lVar2 = *(longlong *)(param_1 + 0x10);
      if (((*(int *)(lVar3 + 4 + lVar2) == param_2) && (*(int *)(lVar3 + lVar2) == param_3)) &&
         (*(int *)(lVar3 + 8 + lVar2) == param_4)) {
        FUN_140143a50(param_1,iVar4,1);
        return 1;
      }
      iVar4 = iVar4 + 1;
      lVar5 = lVar5 + 1;
      lVar3 = lVar3 + 0x18;
    } while (iVar4 < iVar1);
  }
  return 0;
}



// WARNING: Removing unreachable block (ram,0x0001401a6a3d)
// WARNING: Removing unreachable block (ram,0x0001401a6a46)
// WARNING: Removing unreachable block (ram,0x0001401a6a64)
// WARNING: Removing unreachable block (ram,0x0001401a6a6d)

undefined4 *
FUN_1401a69c0(undefined4 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined1 local_40 [56];
  
  *(undefined1 *)(param_1 + 2) = 0;
  *(undefined8 *)(param_1 + 0x16) = 0;
  *(undefined8 *)(param_1 + 4) = 0;
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  param_1[0xc] = 0x11;
  *(undefined8 *)(param_1 + 10) = 0;
  param_1[0x14] = 0;
  param_1[0xd] = 0x3f400000;
  param_1[0xe] = 0x3e800000;
  param_1[0xf] = 0x40100000;
  *(undefined8 *)(param_1 + 0x10) = 0x26;
  *(undefined8 *)(param_1 + 0x12) = 0;
  *(undefined ***)(param_1 + 0x18) = Proud::CFastArray<>::vftable;
  *(undefined8 *)(param_1 + 0x1a) = 0;
  *(undefined8 *)(param_1 + 0x1c) = 0;
  *(undefined8 *)(param_1 + 0x1e) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  FUN_140142620(param_1 + 0x24,0x8000000000000000,param_3,param_4,0xfffffffffffffffe);
  *(undefined8 *)(param_1 + 0x34) = 0;
  *(undefined8 *)(param_1 + 0x36) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x3a) = 0;
  *(undefined ***)(param_1 + 0x32) = Proud::CP2PGroup_S::CAddMemberAckWaiterList::vftable;
  FUN_140142650(param_1 + 0x3c);
  *param_1 = 0;
  puVar1 = (undefined8 *)FUN_140142620(local_40);
  *(undefined8 *)(param_1 + 0x24) = *puVar1;
  *(undefined8 *)(param_1 + 0x26) = puVar1[1];
  *(undefined8 *)(param_1 + 0x28) = puVar1[2];
  *(undefined8 *)(param_1 + 0x2a) = puVar1[3];
  *(undefined8 *)(param_1 + 0x2c) = puVar1[4];
  *(undefined8 *)(param_1 + 0x2e) = puVar1[5];
  *(undefined8 *)(param_1 + 0x30) = puVar1[6];
  *(undefined1 *)(param_1 + 0x22) = 0;
  return param_1;
}



void FUN_1401a6b60(undefined4 *param_1,undefined4 *param_2)

{
  uint uVar1;
  uint uVar2;
  longlong lVar3;
  ulonglong uVar4;
  char cVar5;
  uint *puVar6;
  uint *puVar7;
  uint local_res8 [2];
  
  if (*(longlong *)(param_1 + 10) == 0) {
    puVar7 = (uint *)0x0;
  }
  else {
    puVar7 = *(uint **)(param_1 + 6);
  }
  do {
    if (puVar7 == (uint *)0x0) {
      *param_2 = *param_1;
      return;
    }
    if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    uVar1 = *puVar7;
    uVar2 = param_2[0xc];
    lVar3 = *(longlong *)(param_2 + 4);
    uVar4 = (ulonglong)uVar1 % (ulonglong)uVar2;
    local_res8[0] = uVar1;
    if (lVar3 == 0) {
LAB_1401a6c1e:
      cVar5 = FUN_140144560(param_2 + 2,(ulonglong)uVar2,CONCAT71((int7)((ulonglong)lVar3 >> 8),1));
      if (cVar5 == '\0') {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x8007000e);
      }
    }
    else {
      for (puVar6 = *(uint **)(lVar3 + uVar4 * 8);
          (puVar6 != (uint *)0x0 && ((uint)uVar4 == puVar6[6] % uVar2));
          puVar6 = *(uint **)(puVar6 + 2)) {
        if (*puVar6 == uVar1) goto LAB_1401a6c5e;
      }
      if (lVar3 == 0) goto LAB_1401a6c1e;
      for (puVar6 = *(uint **)(lVar3 + uVar4 * 8);
          (puVar6 != (uint *)0x0 && ((uint)uVar4 == puVar6[6] % uVar2));
          puVar6 = *(uint **)(puVar6 + 2)) {
        if (*puVar6 == uVar1) goto LAB_1401a6c5a;
      }
      if (lVar3 == 0) goto LAB_1401a6c1e;
    }
    FUN_140193d80(param_2 + 2);
    puVar6 = (uint *)FUN_140146360(param_2 + 2,local_res8,uVar4,uVar1);
    FUN_140193d80(param_2 + 2);
LAB_1401a6c5a:
    *(undefined1 *)(puVar6 + 1) = 0;
LAB_1401a6c5e:
    puVar7 = *(uint **)(puVar7 + 6);
  } while( true );
}



longlong * FUN_1401a6cb0(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  uVar3 = 0;
  lVar1 = FUN_1400a34c0(0x60);
  uVar2 = uVar3;
  if (lVar1 != 0) {
    uVar2 = FUN_1401c51b0(lVar1);
  }
  FUN_140146080(param_2,uVar2,param_3,param_4,uVar4);
  if (*param_2 != 0) {
    uVar3 = *(undefined8 *)(*param_2 + 0x38);
  }
  FUN_1401a6b60(param_1,uVar3);
  return param_2;
}



undefined8 FUN_1401a6d30(longlong param_1)

{
  undefined4 uVar1;
  char cVar2;
  longlong lVar3;
  int local_res8 [2];
  undefined1 *local_res10;
  undefined1 local_c8 [8];
  undefined1 local_c0 [8];
  longlong local_b8;
  int local_ac;
  undefined8 local_a0;
  undefined1 local_98 [144];
  
  local_a0 = 0xfffffffffffffffe;
  FUN_140185560(local_c8);
  lVar3 = *(longlong *)(param_1 + 8);
  if ((lVar3 == 0) && (*(longlong *)(param_1 + 0x10) == 0)) {
                    // WARNING: Subroutine does not return
    FUN_14019a830();
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar3 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    if (*(int *)(lVar3 + 0x18) == 0) {
      lVar3 = 0;
    }
    else {
      lVar3 = *(longlong *)(lVar3 + 0x10);
    }
  }
  else {
    lVar3 = *(longlong *)(param_1 + 0x10);
    if (lVar3 == 0) {
      FUN_1400a2320(local_98,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_98,(ThrowInfo *)&DAT_1402f4860);
    }
  }
  FUN_1401851e0(local_c8,lVar3);
  if (*(longlong *)(param_1 + 8) == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    uVar1 = *(undefined4 *)(param_1 + 0x18);
  }
  else {
    uVar1 = *(undefined4 *)(*(longlong *)(param_1 + 8) + 0x18);
  }
  FUN_1401856c0(local_c8,uVar1);
  cVar2 = FUN_140185dc0(local_c8,local_res8);
  if (cVar2 != '\0') {
    if (local_res8[0] == 1) {
      local_res10 = local_c0;
      FUN_14019a730(local_c0);
      if ((local_b8 != 0) && (local_ac < 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      return 1;
    }
    if (local_res8[0] == 2) {
      local_res10 = local_c0;
      FUN_14019a730(local_c0);
      if ((local_b8 != 0) && (local_ac < 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      return 2;
    }
  }
  local_res10 = local_c0;
  FUN_14019a730(local_c0);
  if ((local_b8 != 0) && (local_ac < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return 3;
}



undefined4 * FUN_1401a6ec0(undefined4 *param_1)

{
  FUN_140185560(param_1 + 2);
  *(undefined ***)(param_1 + 0xe) = Proud::AddrPort::vftable;
  param_1[0x10] = 0;
  *(undefined2 *)(param_1 + 0x11) = 0;
  *(undefined1 *)(param_1 + 0x12) = 0;
  param_1[0xc] = 0;
  param_1[0x10] = DAT_1402f83d0;
  *(undefined2 *)(param_1 + 0x11) = DAT_1402f83d4;
  FUN_14015c2a0(param_1 + 0x14);
  *param_1 = 3;
  return param_1;
}



void FUN_1401a6f30(int *param_1,int *param_2,int param_3)

{
  int iVar1;
  
  iVar1 = *param_2;
  param_1[0xc] = param_3;
  *param_1 = iVar1;
  if (*param_2 == 0) {
    FUN_14017e510(param_1 + 0x14,param_2 + 0xc);
    return;
  }
  FUN_14016a260(param_1 + 2,param_2 + 2);
  return;
}



longlong FUN_1401a6f60(longlong param_1,undefined8 param_2)

{
  *(undefined8 *)(param_1 + 0x140) = param_2;
  *(longlong *)(param_1 + 0x138) = param_1;
  FUN_1401a6ec0();
  return param_1;
}



void FUN_1401a6fa0(longlong param_1)

{
  undefined8 uVar1;
  longlong lVar2;
  
  uVar1 = *(undefined8 *)(param_1 + 0x140);
  FUN_1400a1c30(uVar1);
  lVar2 = *(longlong *)(param_1 + 0x138);
  FUN_14015c350(lVar2 + 0x50);
  FUN_14019a730(lVar2 + 0x10);
  if (*(longlong *)(lVar2 + 0x18) != 0) {
    if (*(int *)(lVar2 + 0x24) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(lVar2 + 0x20) = 0;
  }
  FUN_1400d1290(uVar1);
  return;
}



int FUN_1401a7030(longlong param_1)

{
  longlong lVar1;
  int *piVar2;
  longlong lVar3;
  uint uVar4;
  longlong lVar6;
  uint uVar7;
  ulonglong uVar9;
  uint uVar10;
  undefined1 local_58 [80];
  ulonglong uVar5;
  ulonglong uVar8;
  
  lVar1 = *(longlong *)(param_1 + 0xc80);
  uVar5 = 0;
  uVar10 = 0;
  if (lVar1 == 0) {
    FUN_1400a2320(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  lVar6 = (longlong)*(int *)(param_1 + 0xc88);
  uVar9 = uVar5;
  uVar7 = uVar10;
  uVar4 = uVar10;
  if (1 < lVar6) {
    piVar2 = (int *)(lVar1 + 0x18);
    lVar3 = (lVar6 - 2U >> 1) + 1;
    uVar9 = lVar3 * 2;
    uVar8 = uVar5;
    do {
      uVar4 = (int)uVar5 + piVar2[-4];
      uVar5 = (ulonglong)uVar4;
      uVar7 = (int)uVar8 + *piVar2;
      uVar8 = (ulonglong)uVar7;
      piVar2 = piVar2 + 8;
      lVar3 = lVar3 + -1;
    } while (lVar3 != 0);
  }
  if ((longlong)uVar9 < lVar6) {
    uVar10 = *(uint *)(lVar1 + 8 + uVar9 * 0x10);
  }
  return uVar7 + uVar4 + uVar10;
}



void FUN_1401a70d0(longlong param_1,longlong param_2)

{
  undefined1 uVar1;
  int iVar2;
  uint uVar3;
  longlong lVar4;
  undefined8 uVar5;
  undefined4 uVar6;
  undefined8 *_Dst;
  undefined8 *_Src;
  undefined8 *puVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  ulonglong uVar14;
  undefined1 local_78 [80];
  
  uVar6 = FUN_1401a7030();
  FUN_14003cda0(param_2,uVar6);
  uVar8 = 0;
  if (*(longlong *)(param_1 + 0xc80) == 0) {
    FUN_1400a2320(local_78,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_78,(ThrowInfo *)&DAT_1402f4860);
  }
  uVar14 = uVar8;
  if (*(int *)(param_2 + 0x18) != 0) {
    uVar14 = *(ulonglong *)(param_2 + 0x10);
  }
  iVar2 = *(int *)(param_1 + 0xc88);
  uVar9 = uVar8;
  uVar10 = uVar8;
  uVar11 = uVar8;
  if (0 < (longlong)iVar2) {
    do {
      lVar4 = *(longlong *)(param_1 + 0xc80);
      if (lVar4 == 0) {
        FUN_1400a2320(local_78,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_78,(ThrowInfo *)&DAT_1402f4860);
      }
      if (((longlong)uVar8 < 0) || (*(int *)(param_1 + 0xc88) <= (int)uVar10)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      uVar3 = *(uint *)(lVar4 + 8 + uVar9);
      uVar13 = (ulonglong)(int)uVar3;
      _Src = *(undefined8 **)(lVar4 + uVar9);
      _Dst = (undefined8 *)((longlong)(int)uVar11 + uVar14);
      if (uVar13 < 0x21) {
        uVar12 = (ulonglong)(uVar3 & 7);
        for (uVar13 = uVar13 >> 3; uVar13 != 0; uVar13 = uVar13 - 1) {
          uVar5 = *_Src;
          _Src = _Src + 1;
          *_Dst = uVar5;
          _Dst = _Dst + 1;
        }
        if (uVar12 != 0) {
          puVar7 = _Src;
          do {
            uVar1 = *(undefined1 *)puVar7;
            puVar7 = (undefined8 *)((longlong)puVar7 + 1);
            uVar12 = uVar12 - 1;
            *(undefined1 *)((longlong)_Dst + (-1 - (longlong)_Src) + (longlong)puVar7) = uVar1;
          } while (uVar12 != 0);
        }
      }
      else {
        memcpy(_Dst,_Src,uVar13);
      }
      uVar8 = uVar8 + 1;
      uVar9 = uVar9 + 0x10;
      uVar10 = (ulonglong)((int)uVar10 + 1);
      uVar11 = (ulonglong)((int)uVar11 + uVar3);
    } while ((longlong)uVar8 < (longlong)iVar2);
  }
  return;
}



void FUN_1401a7270(longlong param_1,longlong param_2)

{
  undefined1 uVar1;
  int iVar2;
  uint uVar3;
  longlong lVar4;
  undefined8 uVar5;
  undefined8 *puVar6;
  undefined4 uVar7;
  longlong lVar8;
  undefined8 *_Src;
  undefined8 *puVar9;
  longlong lVar10;
  longlong lVar11;
  int iVar12;
  ulonglong uVar13;
  int iVar14;
  ulonglong uVar15;
  undefined1 local_78 [80];
  
  FUN_1401850b0(param_2);
  FUN_140185030(param_2);
  uVar7 = FUN_1401a7030(param_1);
  FUN_1401856c0(param_2,uVar7);
  if (*(longlong *)(param_1 + 0xc80) == 0) {
    FUN_1400a2320(local_78,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_78,(ThrowInfo *)&DAT_1402f4860);
  }
  iVar2 = *(int *)(param_1 + 0xc88);
  iVar14 = 0;
  iVar12 = 0;
  lVar10 = 0;
  if (0 < (longlong)iVar2) {
    lVar11 = 0;
    do {
      lVar4 = *(longlong *)(param_1 + 0xc80);
      if (lVar4 == 0) {
        FUN_1400a2320(local_78,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_78,(ThrowInfo *)&DAT_1402f4860);
      }
      if ((lVar10 < 0) || (*(int *)(param_1 + 0xc88) <= iVar12)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      lVar8 = *(longlong *)(param_2 + 0x10);
      uVar3 = *(uint *)(lVar11 + 8 + lVar4);
      uVar15 = (ulonglong)(int)uVar3;
      _Src = *(undefined8 **)(lVar11 + lVar4);
      if (lVar8 == 0) {
        lVar4 = *(longlong *)(param_2 + 8);
        if (lVar4 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        if (*(int *)(lVar4 + 0x18) == 0) {
          lVar8 = 0;
        }
        else {
          lVar8 = *(longlong *)(lVar4 + 0x10);
        }
      }
      if (uVar15 < 0x21) {
        uVar13 = (ulonglong)(uVar3 & 7);
        puVar6 = (undefined8 *)(iVar14 + lVar8);
        for (uVar15 = uVar15 >> 3; uVar15 != 0; uVar15 = uVar15 - 1) {
          uVar5 = *_Src;
          _Src = _Src + 1;
          *puVar6 = uVar5;
          puVar6 = puVar6 + 1;
        }
        if (uVar13 != 0) {
          puVar9 = _Src;
          do {
            uVar1 = *(undefined1 *)puVar9;
            puVar9 = (undefined8 *)((longlong)puVar9 + 1);
            uVar13 = uVar13 - 1;
            *(undefined1 *)((longlong)puVar6 + (-1 - (longlong)_Src) + (longlong)puVar9) = uVar1;
          } while (uVar13 != 0);
        }
      }
      else {
        memcpy((undefined8 *)(iVar14 + lVar8),_Src,uVar15);
      }
      lVar10 = lVar10 + 1;
      iVar14 = iVar14 + uVar3;
      iVar12 = iVar12 + 1;
      lVar11 = lVar11 + 0x10;
    } while (lVar10 < iVar2);
  }
  return;
}



void thunk_FUN_1401a70d0(longlong param_1,longlong param_2)

{
  undefined1 uVar1;
  int iVar2;
  uint uVar3;
  longlong lVar4;
  undefined8 uVar5;
  undefined4 uVar6;
  undefined8 *_Dst;
  undefined8 *_Src;
  undefined8 *puVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  ulonglong uVar14;
  undefined1 auStack_78 [80];
  
  uVar6 = FUN_1401a7030();
  FUN_14003cda0(param_2,uVar6);
  uVar8 = 0;
  if (*(longlong *)(param_1 + 0xc80) == 0) {
    FUN_1400a2320(auStack_78,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(auStack_78,(ThrowInfo *)&DAT_1402f4860);
  }
  uVar14 = uVar8;
  if (*(int *)(param_2 + 0x18) != 0) {
    uVar14 = *(ulonglong *)(param_2 + 0x10);
  }
  iVar2 = *(int *)(param_1 + 0xc88);
  uVar9 = uVar8;
  uVar10 = uVar8;
  uVar11 = uVar8;
  if (0 < (longlong)iVar2) {
    do {
      lVar4 = *(longlong *)(param_1 + 0xc80);
      if (lVar4 == 0) {
        FUN_1400a2320(auStack_78,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(auStack_78,(ThrowInfo *)&DAT_1402f4860);
      }
      if (((longlong)uVar8 < 0) || (*(int *)(param_1 + 0xc88) <= (int)uVar10)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      uVar3 = *(uint *)(lVar4 + 8 + uVar9);
      uVar13 = (ulonglong)(int)uVar3;
      _Src = *(undefined8 **)(lVar4 + uVar9);
      _Dst = (undefined8 *)((longlong)(int)uVar11 + uVar14);
      if (uVar13 < 0x21) {
        uVar12 = (ulonglong)(uVar3 & 7);
        for (uVar13 = uVar13 >> 3; uVar13 != 0; uVar13 = uVar13 - 1) {
          uVar5 = *_Src;
          _Src = _Src + 1;
          *_Dst = uVar5;
          _Dst = _Dst + 1;
        }
        if (uVar12 != 0) {
          puVar7 = _Src;
          do {
            uVar1 = *(undefined1 *)puVar7;
            puVar7 = (undefined8 *)((longlong)puVar7 + 1);
            uVar12 = uVar12 - 1;
            *(undefined1 *)((longlong)_Dst + (-1 - (longlong)_Src) + (longlong)puVar7) = uVar1;
          } while (uVar12 != 0);
        }
      }
      else {
        memcpy(_Dst,_Src,uVar13);
      }
      uVar8 = uVar8 + 1;
      uVar9 = uVar9 + 0x10;
      uVar10 = (ulonglong)((int)uVar10 + 1);
      uVar11 = (ulonglong)((int)uVar11 + uVar3);
    } while ((longlong)uVar8 < (longlong)iVar2);
  }
  return;
}



void FUN_1401a7450(longlong param_1,longlong *param_2)

{
  undefined1 uVar1;
  uint uVar2;
  longlong lVar3;
  undefined8 uVar4;
  int iVar5;
  undefined8 *_Dst;
  undefined8 *_Src;
  undefined8 *puVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  undefined1 local_78 [80];
  
  iVar5 = FUN_1401a7030();
  if (iVar5 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2[1] == 0) {
    lVar3 = *param_2;
    if (iVar5 < 1) {
      if (lVar3 == 0) goto LAB_1401a74a9;
      iVar5 = 0;
    }
    else if (lVar3 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    FUN_14003cda0(lVar3,iVar5);
  }
  else {
    if (*(int *)((longlong)param_2 + 0x14) < iVar5) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(int *)(param_2 + 2) = iVar5;
  }
LAB_1401a74a9:
  uVar7 = 0;
  if (*(longlong *)(param_1 + 0xc80) == 0) {
    FUN_1400a2320(local_78,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_78,(ThrowInfo *)&DAT_1402f4860);
  }
  uVar13 = param_2[1];
  if (param_2[1] == 0) {
    lVar3 = *param_2;
    if (lVar3 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    uVar13 = uVar7;
    if (*(int *)(lVar3 + 0x18) != 0) {
      uVar13 = *(ulonglong *)(lVar3 + 0x10);
    }
  }
  iVar5 = *(int *)(param_1 + 0xc88);
  uVar8 = uVar7;
  uVar9 = uVar7;
  uVar10 = uVar7;
  if (0 < (longlong)iVar5) {
    do {
      lVar3 = *(longlong *)(param_1 + 0xc80);
      if (lVar3 == 0) {
        FUN_1400a2320(local_78,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_78,(ThrowInfo *)&DAT_1402f4860);
      }
      if (((longlong)uVar7 < 0) || (*(int *)(param_1 + 0xc88) <= (int)uVar9)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      uVar2 = *(uint *)(lVar3 + 8 + uVar8);
      uVar12 = (ulonglong)(int)uVar2;
      _Src = *(undefined8 **)(lVar3 + uVar8);
      _Dst = (undefined8 *)((longlong)(int)uVar10 + uVar13);
      if (uVar12 < 0x21) {
        uVar11 = (ulonglong)(uVar2 & 7);
        for (uVar12 = uVar12 >> 3; uVar12 != 0; uVar12 = uVar12 - 1) {
          uVar4 = *_Src;
          _Src = _Src + 1;
          *_Dst = uVar4;
          _Dst = _Dst + 1;
        }
        if (uVar11 != 0) {
          puVar6 = _Src;
          do {
            uVar1 = *(undefined1 *)puVar6;
            puVar6 = (undefined8 *)((longlong)puVar6 + 1);
            uVar11 = uVar11 - 1;
            *(undefined1 *)((longlong)_Dst + (-1 - (longlong)_Src) + (longlong)puVar6) = uVar1;
          } while (uVar11 != 0);
        }
      }
      else {
        memcpy(_Dst,_Src,uVar12);
      }
      uVar7 = uVar7 + 1;
      uVar8 = uVar8 + 0x10;
      uVar9 = (ulonglong)((int)uVar9 + 1);
      uVar10 = (ulonglong)((int)uVar10 + uVar2);
    } while ((longlong)uVar7 < (longlong)iVar5);
  }
  return;
}



void thunk_FUN_1401a7450(void)

{
  FUN_1401a7450();
  return;
}



longlong * FUN_1401a7650(longlong *param_1)

{
  int iVar1;
  
  if (param_1 != (longlong *)0x0) {
    iVar1 = (**(code **)(*param_1 + 8))();
    if (iVar1 == 4) {
      return param_1;
    }
  }
  return (longlong *)0x0;
}



undefined8 * FUN_1401a7680(undefined8 *param_1)

{
  int iVar1;
  
  if (param_1 != (undefined8 *)0x0) {
    iVar1 = (**(code **)*param_1)();
    if (iVar1 == 1) {
      return param_1;
    }
  }
  return (undefined8 *)0x0;
}



longlong * FUN_1401a76b0(longlong *param_1)

{
  int iVar1;
  
  if (param_1 != (longlong *)0x0) {
    iVar1 = (**(code **)(*param_1 + 8))();
    if (iVar1 == 1) {
      return param_1 + -7;
    }
  }
  return (longlong *)0x0;
}



void FUN_1401a76e0(longlong param_1)

{
  FUN_1401c1440(param_1 + 0x20,DAT_1402f8070);
  return;
}



void FUN_1401a76f0(longlong param_1,longlong param_2)

{
  undefined8 *puVar1;
  longlong *plVar2;
  
  if (*(longlong *)(param_2 + 0x18) == 0) {
    puVar1 = (undefined8 *)(param_2 + 8);
    plVar2 = (longlong *)(param_1 + 8);
    if (*(longlong *)(param_2 + 0x18) != 0) {
      FUN_14018a320(plVar2,puVar1);
    }
    if (*(longlong *)(param_1 + 0x10) == 0) {
      *plVar2 = (longlong)puVar1;
    }
    else {
      *(undefined8 **)(*(longlong *)(param_1 + 0x10) + 8) = puVar1;
      *puVar1 = *(undefined8 *)(param_1 + 0x10);
    }
    *(undefined8 **)(param_1 + 0x10) = puVar1;
    *(longlong **)(param_2 + 0x18) = plVar2;
    *(int *)(param_1 + 0x18) = *(int *)(param_1 + 0x18) + 1;
  }
  FUN_1401c1460(param_1 + 0x20,1);
  return;
}



undefined8 FUN_1401a7770(undefined8 *param_1,longlong param_2,longlong *param_3)

{
  longlong *plVar1;
  char cVar2;
  undefined8 uVar3;
  
  uVar3 = (**(code **)(*(longlong *)*param_1 + 8))();
  FUN_1400a1c30(uVar3);
  do {
    do {
      if (*(int *)(param_1 + 3) < 1) {
        FUN_1400d1290(uVar3);
        return 0;
      }
      plVar1 = *(longlong **)(param_1[1] + 0x18);
      if (plVar1[3] != 0) {
        FUN_14018a320();
      }
      cVar2 = (**(code **)(*plVar1 + 0x10))(plVar1);
    } while (((cVar2 != '\0') || (cVar2 = (**(code **)(*plVar1 + 0x18))(plVar1), cVar2 != '\0')) ||
            (cVar2 = (**(code **)(*plVar1 + 0x28))(plVar1,param_2), cVar2 == '\0'));
    cVar2 = (**(code **)(*(longlong *)*param_1 + 0x18))
                      ((longlong *)*param_1,*(undefined4 *)(param_2 + 0x30));
  } while (cVar2 == '\0');
  (**(code **)(*plVar1 + 0x20))(plVar1,1);
  *param_3 = plVar1[5];
  FUN_1400d1290(uVar3);
  return 1;
}



void FUN_1401a7860(undefined8 *param_1,undefined4 param_2,char param_3,undefined8 param_4)

{
  longlong lVar1;
  char cVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  
  uVar5 = 0xfffffffffffffffe;
  uVar3 = (**(code **)(*(longlong *)*param_1 + 8))();
  uVar6 = uVar3;
  FUN_1400a1c30(uVar3);
  lVar1 = *(longlong *)*param_1;
  plVar4 = (longlong *)
           (**(code **)(lVar1 + 0x10))((longlong *)*param_1,param_2,lVar1,param_4,uVar5,uVar6,1);
  if (plVar4 != (longlong *)0x0) {
    (**(code **)(*plVar4 + 0x20))(plVar4,param_3);
    if (param_3 == '\0') {
      cVar2 = (**(code **)(*plVar4 + 0x10))(plVar4);
      if (cVar2 == '\0') {
        FUN_1401a76f0(param_1,plVar4);
      }
    }
  }
  FUN_1400d1290(uVar3);
  return;
}



void FUN_1401a7910(undefined8 *param_1)

{
  *param_1 = Proud::ITaskSubject::vftable;
  if (param_1[3] != 0) {
    FUN_14018a320();
  }
  return;
}



undefined8 *
FUN_1401a7940(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  param_1[1] = 0;
  param_1[2] = 0;
  *(undefined4 *)(param_1 + 3) = 0;
  FUN_1401c1420(param_1 + 4,0,0x7fffffff,param_4,0xfffffffffffffffe);
  *param_1 = param_2;
  return param_1;
}



undefined8 * FUN_1401a7990(undefined8 *param_1)

{
  *param_1 = Proud::ITaskSubject::vftable;
  param_1[4] = param_1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[5] = 0;
  return param_1;
}



undefined8 * FUN_1401a79c0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::ITaskSubject::vftable;
  if (param_1[3] != 0) {
    FUN_14018a320();
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined4 * FUN_1401a7a10(undefined4 *param_1)

{
  undefined4 uVar1;
  
  *(double *)(param_1 + 2) = DAT_1402f80f8 * 10.0 * 2.0;
  uVar1 = DAT_140313fc4;
  *param_1 = 0;
  param_1[4] = uVar1;
  param_1[1] = 0x10000;
  param_1[5] = DAT_1402f8190;
  *(undefined1 *)(param_1 + 6) = 1;
  *(undefined2 *)(param_1 + 9) = 0x100;
  *(undefined1 *)((longlong)param_1 + 0x27) = 1;
  *(undefined8 *)(param_1 + 7) = 0x80;
  *(undefined1 *)((longlong)param_1 + 0x26) = DAT_1402f8145;
  param_1[10] = 0;
  *(undefined1 *)((longlong)param_1 + 0x2d) = 0;
  return param_1;
}



int FUN_1401a7a80(undefined8 param_1)

{
  int iVar1;
  
  iVar1 = FUN_1400ad5c0(param_1,0x7fffffff);
  if (iVar1 == 0) {
    iVar1 = 1;
  }
  return iVar1;
}



// WARNING: Removing unreachable block (ram,0x0001401a7ad0)

void FUN_1401a7aa0(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  longlong *plVar1;
  longlong lVar2;
  
  plVar1 = (longlong *)(param_4 + 2);
  *param_4 = 1;
  param_4[1] = param_2;
  FUN_14019a730(plVar1);
  *(undefined8 *)(param_4 + 6) = 0;
  *(undefined8 *)(param_4 + 4) = 0;
  if (*plVar1 == 0) {
    lVar2 = FUN_14019a770();
    *plVar1 = lVar2;
    *(undefined8 *)(lVar2 + 0x28) = 1;
  }
  thunk_FUN_1401a7450(param_3,plVar1);
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a7b20(int *param_1,longlong param_2,undefined8 param_3)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  undefined1 auStack_1a08 [32];
  undefined1 local_19e8 [72];
  undefined8 local_19a0;
  undefined1 local_1998 [80];
  undefined1 local_1948 [3200];
  longlong local_cc8;
  undefined4 local_cc0;
  int local_cbc;
  undefined1 local_cb8 [3200];
  longlong local_38;
  int local_2c;
  ulonglong local_28;
  undefined8 uStack_20;
  
  uStack_20 = 0x1401a7b2e;
  local_19a0 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_1a08;
  if (*(longlong *)(param_2 + 0xc80) == 0) {
    FUN_1400a2320(local_19e8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_19e8,(ThrowInfo *)&DAT_1402f4860);
  }
  if (*(int *)(param_2 + 0xc8c) < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  lVar3 = 0;
  *(undefined4 *)(param_2 + 0xc88) = 0;
  FUN_14003c9e0(param_3,0x13);
  FUN_14003c9e0(param_3,(char)*param_1);
  if (*param_1 == 1) {
    FUN_14007c6e0(param_3,param_1[1]);
    if (*(longlong *)(param_1 + 2) == 0) {
      if (*(longlong *)(param_1 + 4) == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      iVar2 = param_1[6];
    }
    else {
      iVar2 = *(int *)(*(longlong *)(param_1 + 2) + 0x18);
    }
    FUN_140186930(param_3,(longlong)iVar2);
    FUN_140146970(local_1948,param_3);
    FUN_140145c70(param_2,local_1948);
    if (local_cc8 == 0) {
      FUN_1400a2320(local_19e8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_19e8,(ThrowInfo *)&DAT_1402f4860);
    }
    if (local_cbc < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_cc0 = 0;
    lVar1 = *(longlong *)(param_1 + 2);
    if ((lVar1 == 0) && (*(longlong *)(param_1 + 4) == 0)) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    if (*(longlong *)(param_1 + 4) == 0) {
      if (lVar1 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      if (*(int *)(lVar1 + 0x18) != 0) {
        lVar3 = *(longlong *)(lVar1 + 0x10);
      }
    }
    else {
      lVar3 = *(longlong *)(param_1 + 4);
      if (lVar3 == 0) {
        FUN_1400a2320(local_1998,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_1998,(ThrowInfo *)&DAT_1402f4860);
      }
    }
    FUN_140145be0(param_2,lVar3);
  }
  else if (*param_1 == 2) {
    if ((*(longlong **)(param_1 + 8) == (longlong *)0x0) ||
       (lVar3 = **(longlong **)(param_1 + 8), lVar3 == 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_1401a84d0(lVar3,param_3);
    FUN_14007c6e0(param_3,param_1[0xd]);
    FUN_14007c6e0(param_3,param_1[0xc]);
    FUN_140146970(local_cb8,param_3);
    FUN_140145c70(param_2,local_cb8);
    if (local_38 == 0) {
      FUN_1400a2320(local_19e8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_19e8,(ThrowInfo *)&DAT_1402f4860);
    }
    if (local_2c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
  }
  return;
}



int FUN_1401a7da0(longlong param_1,int param_2)

{
  uint uVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  
  iVar4 = *(int *)(param_1 + 0x24);
  if (iVar4 == 0) {
    iVar2 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
    iVar4 = 0x400;
    if (iVar2 < 0x400) {
      iVar4 = iVar2;
    }
    iVar2 = 4;
    if (4 < iVar4) {
      iVar2 = iVar4;
    }
    iVar4 = iVar2 + param_2;
    if (iVar2 + param_2 < *(int *)(param_1 + 0x20)) {
      iVar4 = *(int *)(param_1 + 0x20);
    }
    return iVar4;
  }
  if (iVar4 != 1) {
    if (iVar4 != 2) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (param_2 < *(int *)(param_1 + 0x20)) {
      param_2 = *(int *)(param_1 + 0x20);
    }
    return param_2;
  }
  uVar1 = (int)(*(int *)(param_1 + 0x18) + (*(int *)(param_1 + 0x18) >> 0x1f & 7U)) >> 3;
  uVar3 = 0x10;
  if (0x10 < (int)uVar1) {
    uVar3 = uVar1;
  }
  if (uVar3 < 9) {
    uVar3 = 8;
  }
  iVar4 = uVar3 + param_2;
  if ((int)(uVar3 + param_2) < *(int *)(param_1 + 0x20)) {
    iVar4 = *(int *)(param_1 + 0x20);
  }
  return iVar4;
}



void FUN_1401a7e40(longlong param_1,int param_2)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  undefined1 local_58 [80];
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar2 = FUN_1401a7da0();
      plVar1 = *(longlong **)(param_1 + 8);
      lVar3 = (longlong)iVar2;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_1400a34c0(lVar3 << 3);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 8))(plVar1,lVar3 << 3);
        }
      }
      else {
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_1400a34f0(*(undefined8 *)(param_1 + 0x10),lVar3 << 3);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 0x10))(plVar1,*(undefined8 *)(param_1 + 0x10),lVar3 << 3);
        }
        if (lVar3 == 0) {
          FUN_1400a2320(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
        }
      }
      *(longlong *)(param_1 + 0x10) = lVar3;
      *(int *)(param_1 + 0x1c) = iVar2;
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_1401a7f10(longlong *param_1,longlong *param_2,int param_3,int param_4)

{
  longlong lVar1;
  longlong lVar2;
  void *pvVar3;
  void *_Dst;
  int iVar4;
  
  lVar1 = *param_2;
  if (lVar1 == 0) {
    if (param_2[1] == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar4 = (int)param_2[2];
  }
  else {
    iVar4 = *(int *)(lVar1 + 0x18);
  }
  if (iVar4 < param_3 + param_4) {
                    // WARNING: Subroutine does not return
    FUN_1400a2700();
  }
  if ((0 < param_4) && (param_1[1] == 0)) {
    lVar2 = *param_1;
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    if (*(int *)(lVar2 + 0x18) == 0) {
      lVar2 = 0;
    }
    else {
      lVar2 = *(longlong *)(lVar2 + 0x10);
    }
    if (lVar2 == 0) goto LAB_1401a7f9e;
  }
  _Dst = (void *)param_2[1];
  pvVar3 = _Dst;
  if (_Dst == (void *)0x0) {
    if (lVar1 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    if (*(int *)(lVar1 + 0x18) == 0) {
      pvVar3 = (void *)0x0;
    }
    else {
      pvVar3 = *(void **)(lVar1 + 0x10);
    }
  }
  if (pvVar3 != (void *)0x0) {
    lVar2 = param_1[1];
    if (lVar2 == 0) {
      lVar2 = *param_1;
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      if (*(int *)(lVar2 + 0x18) == 0) {
        lVar2 = 0;
      }
      else {
        lVar2 = *(longlong *)(lVar2 + 0x10);
      }
    }
    if (_Dst == (void *)0x0) {
      if (lVar1 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      if (*(int *)(lVar1 + 0x18) == 0) {
        memmove((void *)0x0,(void *)(lVar2 + param_3),(longlong)param_4);
        return;
      }
      _Dst = *(void **)(lVar1 + 0x10);
    }
    memmove(_Dst,(void *)(lVar2 + param_3),(longlong)param_4);
    return;
  }
LAB_1401a7f9e:
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



ulonglong FUN_1401a8020(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  undefined4 uVar2;
  ulonglong uVar3;
  longlong lVar4;
  int iVar5;
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined4 local_28;
  undefined4 local_24 [3];
  
  uVar3 = FUN_140185b30(param_2,local_res18);
  if ((char)uVar3 == '\0') {
    return uVar3;
  }
  FUN_1401a7e40(param_1,local_res18[0]);
  uVar3 = (ulonglong)*(uint *)(param_1 + 0x18);
  iVar5 = 0;
  lVar4 = 0;
  if (0 < (int)*(uint *)(param_1 + 0x18)) {
    do {
      if ((lVar4 < 0) || ((int)uVar3 <= iVar5)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      lVar1 = *(longlong *)(param_1 + 0x10);
      uVar3 = FUN_140185490(param_2,local_res18,1);
      if ((char)uVar3 == '\0') goto LAB_1401a813d;
      if ((char)local_res18[0] == '\0') {
        uVar3 = FUN_140185490(param_2,local_res20,4);
        if ((char)uVar3 == '\0') {
LAB_1401a8136:
          *(undefined4 *)(lVar1 + lVar4 * 8) = 0;
LAB_1401a813d:
          return uVar3 & 0xffffffffffffff00;
        }
        *(undefined4 *)(lVar1 + lVar4 * 8) = local_res20[0];
        uVar2 = local_res20[0];
      }
      else {
        uVar3 = FUN_140185490(param_2,&local_28,4);
        if ((char)uVar3 == '\0') goto LAB_1401a8136;
        *(undefined4 *)(lVar1 + lVar4 * 8) = local_28;
        uVar3 = FUN_140185490(param_2,local_24,4);
        uVar2 = local_24[0];
        if ((char)uVar3 == '\0') {
          *(undefined4 *)(lVar1 + 4 + lVar4 * 8) = 0;
          return uVar3 & 0xffffffffffffff00;
        }
      }
      *(undefined4 *)(lVar1 + 4 + lVar4 * 8) = uVar2;
      uVar3 = (ulonglong)*(uint *)(param_1 + 0x18);
      iVar5 = iVar5 + 1;
      lVar4 = lVar4 + 1;
    } while (iVar5 < (int)*(uint *)(param_1 + 0x18));
  }
  return CONCAT71((int7)(uVar3 >> 8),1);
}



longlong * FUN_1401a8150(longlong *param_1,longlong *param_2)

{
  undefined4 uVar1;
  longlong lVar2;
  int iVar3;
  undefined8 uVar4;
  undefined1 local_50 [72];
  
  uVar4 = 0xfffffffffffffffe;
  if (param_1[1] != 0) {
    FUN_1400a2320(local_50,PTR_u_exception_due_to_using_external_b_14030c148);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1402f4860);
  }
  param_2[2] = 0;
  param_2[1] = 0;
  *param_2 = 0;
  if (*param_1 != 0) {
    FUN_140184fe0(param_2);
    if (*param_1 == 0) {
      if (param_1[1] == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      iVar3 = (int)param_1[2];
    }
    else {
      iVar3 = *(int *)(*param_1 + 0x18);
    }
    if (iVar3 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (param_2[1] == 0) {
      lVar2 = *param_2;
      if (iVar3 < 1) {
        if (lVar2 == 0) goto LAB_1401a8218;
        iVar3 = 0;
      }
      else if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      FUN_14003cda0(lVar2,iVar3);
    }
    else {
      if (*(int *)((longlong)param_2 + 0x14) < iVar3) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      *(int *)(param_2 + 2) = iVar3;
    }
LAB_1401a8218:
    if (*param_1 != 0) {
      uVar1 = *(undefined4 *)(*param_1 + 0x18);
      goto LAB_1401a8237;
    }
  }
  if (param_1[1] == 0) {
                    // WARNING: Subroutine does not return
    FUN_14019a830();
  }
  uVar1 = (undefined4)param_1[2];
LAB_1401a8237:
  FUN_1401a7f10(param_1,param_2,0,uVar1,uVar4);
  return param_2;
}



void FUN_1401a8260(longlong param_1,int param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  longlong lVar4;
  undefined8 *_Src;
  longlong lVar5;
  undefined8 *puVar6;
  longlong lVar7;
  
  iVar1 = *(int *)(param_1 + 0x18);
  lVar5 = (longlong)iVar1;
  if (iVar1 == 0) {
    iVar1 = *(int *)(param_1 + 0x18);
    FUN_1401a7e40(param_1,iVar1 + 1);
    puVar6 = (undefined8 *)0x0;
    if (0 < iVar1) {
      _Src = puVar6;
      if (*(int *)(param_1 + 0x18) != 0) {
        _Src = *(undefined8 **)(param_1 + 0x10);
      }
      memmove(_Src + 1,_Src,(longlong)iVar1 << 3);
    }
    if (*(int *)(param_1 + 0x18) != 0) {
      puVar6 = *(undefined8 **)(param_1 + 0x10);
    }
    *puVar6 = CONCAT44(param_2,param_2);
  }
  else {
    iVar3 = iVar1 + -1;
    if ((iVar3 < 0) || (iVar1 <= iVar3)) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    lVar7 = *(longlong *)(param_1 + 0x10);
    lVar4 = (longlong)iVar3;
    iVar3 = *(int *)(lVar7 + lVar4 * 8);
    if ((iVar3 != param_2) && (iVar2 = *(int *)(lVar7 + 4 + lVar4 * 8), iVar2 != param_2)) {
      if ((iVar2 + 1 != param_2) && (iVar3 + 1 != param_2)) {
        if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        iVar3 = *(int *)(param_1 + 0x18);
        FUN_1401a7e40(param_1,iVar3 + 1);
        iVar3 = iVar3 - iVar1;
        lVar7 = 0;
        if (0 < iVar3) {
          lVar4 = lVar7;
          if (*(int *)(param_1 + 0x18) != 0) {
            lVar4 = *(longlong *)(param_1 + 0x10);
          }
          memmove((void *)(lVar4 + 8 + lVar5 * 8),(void *)(lVar4 + lVar5 * 8),(longlong)iVar3 << 3);
        }
        if (*(int *)(param_1 + 0x18) != 0) {
          lVar7 = *(longlong *)(param_1 + 0x10);
        }
        *(ulonglong *)(lVar7 + lVar5 * 8) = CONCAT44(param_2,param_2);
        return;
      }
      *(int *)(lVar7 + 4 + lVar4 * 8) = param_2;
      return;
    }
  }
  return;
}



void FUN_1401a83b0(longlong param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  int iVar5;
  ulonglong uVar6;
  int iVar7;
  longlong lVar8;
  undefined4 uStackX_c;
  
  FUN_140143980(param_2,0);
  iVar5 = *(int *)(param_1 + 0x18);
  iVar7 = 0;
  lVar8 = 0;
  if (0 < iVar5) {
    do {
      if ((lVar8 < 0) || (iVar5 <= iVar7)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      uVar6 = *(ulonglong *)(*(longlong *)(param_1 + 0x10) + lVar8 * 8);
      uStackX_c = (int)(uVar6 >> 0x20);
      uVar6 = uVar6 & 0xffffffff;
      while( true ) {
        iVar5 = *(int *)(param_2 + 0x18);
        lVar4 = (longlong)iVar5;
        if (iVar5 < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        iVar3 = *(int *)(param_2 + 0x18);
        FUN_140143980(param_2,iVar3 + 1);
        iVar3 = iVar3 - iVar5;
        if (0 < iVar3) {
          if (*(int *)(param_2 + 0x18) == 0) {
            lVar2 = 0;
            lVar1 = 0;
          }
          else {
            lVar2 = *(longlong *)(param_2 + 0x10);
            lVar1 = *(longlong *)(param_2 + 0x10);
          }
          memmove((void *)(lVar1 + 4 + lVar4 * 4),(void *)(lVar2 + lVar4 * 4),(longlong)iVar3 << 2);
        }
        if (*(int *)(param_2 + 0x18) == 0) {
          lVar2 = 0;
        }
        else {
          lVar2 = *(longlong *)(param_2 + 0x10);
        }
        iVar5 = (int)uVar6;
        *(int *)(lVar2 + lVar4 * 4) = iVar5;
        if (iVar5 == uStackX_c) break;
        uVar6 = (ulonglong)(iVar5 + 1);
      }
      iVar5 = *(int *)(param_1 + 0x18);
      iVar7 = iVar7 + 1;
      lVar8 = lVar8 + 1;
    } while (iVar7 < iVar5);
  }
  return;
}



void FUN_1401a84d0(longlong param_1,undefined8 param_2)

{
  ulonglong uVar1;
  int iVar2;
  ulonglong uVar3;
  uint uVar4;
  ulonglong uVar5;
  
  FUN_140186930(param_2,(longlong)*(int *)(param_1 + 0x18));
  iVar2 = *(int *)(param_1 + 0x18);
  uVar3 = 0;
  uVar5 = uVar3;
  if (0 < iVar2) {
    do {
      if (((longlong)uVar3 < 0) || (iVar2 <= (int)uVar5)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      uVar1 = *(ulonglong *)(*(longlong *)(param_1 + 0x10) + uVar3 * 8);
      if ((int)uVar1 == (int)(uVar1 >> 0x20)) {
        FUN_14003c9e0(param_2,0);
      }
      else {
        FUN_14003c9e0(param_2,1);
        FUN_14007c6e0(param_2,uVar1 & 0xffffffff);
      }
      FUN_14007c6e0(param_2);
      iVar2 = *(int *)(param_1 + 0x18);
      uVar4 = (int)uVar5 + 1;
      uVar3 = uVar3 + 1;
      uVar5 = (ulonglong)uVar4;
    } while ((int)uVar4 < iVar2);
  }
  return;
}



longlong * FUN_1401a8580(longlong param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  
  lVar4 = 0;
  FUN_140153270(param_2,param_3,param_3,param_4,0xfffffffffffffffe);
  lVar3 = lVar4;
  if ((longlong *)*param_2 != (longlong *)0x0) {
    lVar3 = *(longlong *)*param_2;
  }
  iVar1 = *(int *)(param_1 + 0x18);
  if (-1 < iVar1) {
    FUN_1401a7e40(lVar3,iVar1);
    lVar2 = lVar4;
    if (*(int *)(param_1 + 0x18) != 0) {
      lVar2 = *(longlong *)(param_1 + 0x10);
    }
    if (*(int *)(lVar3 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar3 + 0x10);
    }
    FUN_1400224d0(lVar4,lVar2,(longlong)iVar1 << 3);
    return param_2;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_1401a8630(undefined4 *param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 *puVar3;
  longlong *plVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong *local_30;
  longlong *local_28;
  longlong local_20;
  
  param_2[1] = param_1[1];
  lVar6 = 0;
  if ((*(longlong *)(param_1 + 2) == 0) && (*(longlong *)(param_1 + 4) == 0)) {
    local_20 = 0;
    local_28 = (longlong *)0x0;
    local_30 = (longlong *)0x0;
    if (*(longlong *)(param_2 + 2) == 0) {
      *(undefined8 *)(param_2 + 4) = 0;
      *(undefined8 *)(param_2 + 6) = 0;
    }
    else {
      FUN_14019a730(param_2 + 2);
      if (local_30 != (longlong *)0x0) {
        local_30[5] = local_30[5] + 1;
        *(longlong **)(param_2 + 2) = local_30;
      }
    }
    FUN_14019a730(&local_30);
    if ((local_28 != (longlong *)0x0) && (local_20 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
  }
  else {
    plVar5 = (longlong *)FUN_1401a8150(param_1 + 2,&local_30,param_3,param_4,0xfffffffffffffffe);
    if (*plVar5 == *(longlong *)(param_2 + 2)) {
      param_2[7] = *(undefined4 *)((longlong)plVar5 + 0x14);
      *(longlong *)(param_2 + 4) = plVar5[1];
      param_2[6] = (int)plVar5[2];
    }
    else {
      FUN_14019a730(param_2 + 2);
      if (*plVar5 != 0) {
        plVar1 = (longlong *)(*plVar5 + 0x28);
        *plVar1 = *plVar1 + 1;
        *(longlong *)(param_2 + 2) = *plVar5;
      }
    }
    FUN_14019a730(&local_30);
    if ((local_28 != (longlong *)0x0) && (local_20 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
  }
  *param_2 = *param_1;
  plVar5 = *(longlong **)(param_1 + 8);
  if ((plVar5 == (longlong *)0x0) || (*plVar5 == 0)) {
    local_30 = (longlong *)0x0;
    if (*(longlong *)(param_2 + 8) != 0) {
      plVar5 = (longlong *)(*(longlong *)(param_2 + 8) + 8);
      *plVar5 = *plVar5 + -1;
      if (*plVar5 == 0) {
        local_28 = (longlong *)param_3;
        FUN_140148f80(param_2 + 8,*(undefined8 *)(param_2 + 8));
      }
    }
    *(undefined8 *)(param_2 + 8) = 0;
    *(undefined8 *)(param_2 + 10) = param_3;
  }
  else {
    plVar5 = (longlong *)FUN_1401a8580(*plVar5,&local_30,param_3);
    lVar2 = *plVar5;
    if (lVar2 != 0) {
      *(longlong *)(lVar2 + 8) = *(longlong *)(lVar2 + 8) + 1;
      lVar6 = lVar2;
    }
    if (*(longlong *)(param_2 + 8) != 0) {
      plVar1 = (longlong *)(*(longlong *)(param_2 + 8) + 8);
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_140148f80(param_2 + 8,*(undefined8 *)(param_2 + 8));
      }
    }
    plVar4 = local_28;
    plVar1 = local_30;
    *(longlong *)(param_2 + 8) = lVar6;
    *(longlong *)(param_2 + 10) = plVar5[1];
    if (local_30 != (longlong *)0x0) {
      plVar5 = local_30 + 1;
      *plVar5 = *plVar5 + -1;
      if (*plVar5 == 0) {
        puVar3 = (undefined8 *)*local_30;
        *puVar3 = Proud::CFastArray<>::vftable;
        if (puVar3[2] != 0) {
          plVar5 = (longlong *)puVar3[1];
          if (plVar5 == (longlong *)0x0) {
            FUN_1400a3530();
          }
          else {
            (**(code **)(*plVar5 + 0x18))(plVar5,puVar3[2]);
          }
        }
        (**(code **)(*plVar4 + 0x18))(plVar4,puVar3);
        (**(code **)(*local_28 + 0x18))(local_28,plVar1);
      }
    }
  }
  param_2[0xc] = param_1[0xc];
  param_2[0xd] = param_1[0xd];
  return;
}



void FUN_1401a8870(undefined8 *param_1)

{
  *param_1 = Proud::ISendSpeedMeasurerDg::vftable;
  return;
}



undefined8 * FUN_1401a8880(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::ISendSpeedMeasurerDg::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1401a88b0(longlong param_1,undefined8 param_2)

{
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))
            (*(longlong *)(param_1 + 0x108) + 0x78);
  FUN_1401b9d00(*(undefined8 *)(param_1 + 0x108),param_2);
  return;
}



void FUN_1401a88f0(longlong param_1,undefined8 param_2)

{
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))
            (*(longlong *)(param_1 + 0x108) + 0x78);
  FUN_1401ba4a0(*(undefined8 *)(param_1 + 0x108),param_2);
  return;
}



void FUN_1401a8930(longlong param_1,int param_2)

{
  undefined8 uVar1;
  
  if (*(int *)(param_1 + 0x100) < param_2) {
    *(undefined4 *)(param_1 + 0x40) = 0;
    *(int *)(param_1 + 0x100) = param_2;
    uVar1 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))
                      (*(longlong *)(param_1 + 0x108) + 0x70);
    *(undefined8 *)(param_1 + 0x80) = uVar1;
    *(undefined1 *)(param_1 + 0xc0) = 0;
  }
  return;
}



void FUN_1401a8990(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if ((longlong *)param_2[2] != param_1) {
    FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                  L"Proud::CListNode<class Proud::CNetClientWorker>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  plVar1 = (longlong *)param_2[1];
  lVar2 = *param_2;
  if (plVar1 != (longlong *)0x0) {
    *plVar1 = lVar2;
  }
  if (lVar2 != 0) {
    *(longlong **)(lVar2 + 8) = plVar1;
  }
  if (plVar1 == (longlong *)0x0) {
    if ((longlong *)param_1[1] != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::CNetClientWorker>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if ((longlong *)*param_1 != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::CNetClientWorker>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    *param_1 = (longlong)plVar1;
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  *(int *)(param_1 + 2) = (int)param_1[2] + -1;
  return;
}



void FUN_1401a8a70(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  longlong lVar2;
  
  lVar2 = 0;
  plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x108) + 0x1570);
  if (plVar1 != (longlong *)0x0) {
    lVar2 = *plVar1;
  }
  FUN_14003c7f0(param_2,lVar2 + 8);
  plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x108) + 0x1570);
  if (plVar1 == (longlong *)0x0) {
    uRam0000000000000100 = 0;
    return;
  }
  *(undefined8 *)(*plVar1 + 0x100) = 0;
  return;
}



void FUN_1401a8af0(longlong param_1)

{
  undefined8 uVar1;
  
  FUN_140183170(*(undefined8 *)(param_1 + 0x108),7);
  if (*(int *)(param_1 + 0x100) < 4) {
    *(undefined4 *)(param_1 + 0x40) = 0;
    *(undefined4 *)(param_1 + 0x100) = 4;
    uVar1 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))
                      (*(longlong *)(param_1 + 0x108) + 0x70);
    *(undefined8 *)(param_1 + 0x80) = uVar1;
    *(undefined1 *)(param_1 + 0xc0) = 0;
  }
  return;
}



void FUN_1401a8b60(longlong param_1)

{
  undefined8 uVar1;
  
  FUN_140183170(*(undefined8 *)(param_1 + 0x108),8);
  if (*(int *)(param_1 + 0x100) < 4) {
    *(undefined4 *)(param_1 + 0x40) = 0;
    *(undefined4 *)(param_1 + 0x100) = 4;
    uVar1 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))
                      (*(longlong *)(param_1 + 0x108) + 0x70);
    *(undefined8 *)(param_1 + 0x80) = uVar1;
    *(undefined1 *)(param_1 + 0xc0) = 0;
  }
  return;
}



void FUN_1401a8bd0(longlong param_1)

{
  undefined8 uVar1;
  
  FUN_140183170(*(undefined8 *)(param_1 + 0x108),9);
  if (*(int *)(param_1 + 0x100) < 4) {
    *(undefined4 *)(param_1 + 0x40) = 0;
    *(undefined4 *)(param_1 + 0x100) = 4;
    uVar1 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))
                      (*(longlong *)(param_1 + 0x108) + 0x70);
    *(undefined8 *)(param_1 + 0x80) = uVar1;
    *(undefined1 *)(param_1 + 0xc0) = 0;
  }
  return;
}



void FUN_1401a8c40(longlong param_1,longlong param_2,longlong param_3)

{
  longlong *plVar1;
  undefined8 uVar2;
  
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
  FUN_1400a1c30(uVar2);
  *(undefined1 *)(param_2 + 0x80) = 0;
  if ((*(longlong **)(param_2 + 0x100) != (longlong *)0x0) &&
     (**(longlong **)(param_2 + 0x100) != 0)) {
    FUN_1400aa370();
  }
  if (0 < *(int *)(param_3 + 8)) {
    plVar1 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x668);
    *plVar1 = *plVar1 + 1;
    plVar1 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x670);
    *plVar1 = *plVar1 + (longlong)*(int *)(param_3 + 8);
  }
  FUN_1401bc360(param_2);
  FUN_1400d1290(uVar2);
  return;
}



void FUN_1401a8d00(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  
  lVar1 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
  uVar2 = 0;
  if (*(undefined8 **)(lVar1 + 0x128) != (undefined8 *)0x0) {
    uVar2 = **(undefined8 **)(lVar1 + 0x128);
  }
  FUN_1400a8090(uVar2,1);
  lVar1 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
  uVar2 = 0;
  if (*(undefined8 **)(lVar1 + 0x128) != (undefined8 *)0x0) {
    uVar2 = **(undefined8 **)(lVar1 + 0x128);
  }
  FUN_1400a7fa0(uVar2,1);
  FUN_140183170(*(undefined8 *)(param_1 + 0x108),3,param_2);
  if (*(int *)(param_1 + 0x100) < 4) {
    *(undefined4 *)(param_1 + 0x40) = 0;
    *(undefined4 *)(param_1 + 0x100) = 4;
    uVar2 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))
                      (*(longlong *)(param_1 + 0x108) + 0x70);
    *(undefined8 *)(param_1 + 0x80) = uVar2;
    *(undefined1 *)(param_1 + 0xc0) = 0;
  }
  return;
}



void FUN_1401a8dc0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined1 uVar6;
  
  uVar5 = 0xfffffffffffffffe;
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
  uVar4 = uVar2;
  FUN_1400a1c30(uVar2);
  uVar6 = 1;
  uVar3 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
  iVar1 = FUN_1401b7fb0(uVar3);
  if ((iVar1 != 0) &&
     (uVar2 = uVar4,
     FUN_140183170(*(undefined8 *)(param_1 + 0x108),3,iVar1,param_4,uVar5,uVar4,uVar6),
     *(int *)(param_1 + 0x100) < 4)) {
    *(undefined4 *)(param_1 + 0x40) = 0;
    *(undefined4 *)(param_1 + 0x100) = 4;
    uVar4 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
    *(undefined8 *)(param_1 + 0x80) = uVar4;
    *(undefined1 *)(param_1 + 0xc0) = 0;
  }
  FUN_1400d1290(uVar2);
  return;
}



void FUN_1401a8e80(longlong param_1)

{
  undefined8 uVar1;
  
  FUN_1401699a0(*(undefined8 *)(param_1 + 0x108));
  if (*(int *)(param_1 + 0x100) < 3) {
    *(undefined4 *)(param_1 + 0x40) = 0;
    *(undefined4 *)(param_1 + 0x100) = 3;
    uVar1 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))
                      (*(longlong *)(param_1 + 0x108) + 0x70);
    *(undefined8 *)(param_1 + 0x80) = uVar1;
    *(undefined1 *)(param_1 + 0xc0) = 0;
  }
  FUN_1401a8dc0(param_1);
  FUN_14017a700(*(undefined8 *)(param_1 + 0x108));
  return;
}



undefined8 FUN_1401a8ef0(longlong param_1)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(char *)(param_1 + 0x1c0) == '\0') {
    FUN_1400a1c30();
    FUN_1400a1c30();
    if (*(char *)(param_1 + 0x1c0) == '\0') {
      cVar1 = FUN_1400ad850(param_1 + 0x48);
      if (cVar1 != '\0') {
        FUN_1400ad700(param_1 + 0x48);
        uVar2 = FUN_1400ad790(param_1 + 0x48);
        *(undefined8 *)(param_1 + 0xc0) = uVar2;
      }
    }
    *(undefined1 *)(param_1 + 0x1c0) = 1;
    FUN_1400d1290(param_1 + 0x88);
    FUN_1400d1290(param_1 + 0x1c8);
    uVar2 = *(undefined8 *)(param_1 + 0xc0);
  }
  else {
    uVar2 = *(undefined8 *)(param_1 + 0xc0);
  }
  return uVar2;
}



void FUN_1401a8fb0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  longlong *plVar2;
  undefined8 local_res10 [3];
  
  local_res10[0] = param_2;
  for (lVar1 = *(longlong *)(param_1 + 0x290); lVar1 != 0; lVar1 = *(longlong *)(lVar1 + 8)) {
    plVar2 = (longlong *)(*(longlong *)(lVar1 + 0x108) + 0x1818);
    (**(code **)(*plVar2 + 0x100))(plVar2,1,&DAT_140318cf0,local_res10);
  }
  return;
}



void FUN_1401a9010(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_1401a8990(*(longlong *)(param_1 + 0x10),param_1);
  }
  return;
}



void FUN_1401a9030(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_1401b5e50(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



undefined * FUN_1401a9060(void)

{
  bool bVar1;
  char cVar2;
  
  bVar1 = false;
  cVar2 = FUN_1400a1cc0(&DAT_14031a2d8);
  if (cVar2 != '\0') {
    if (DAT_14030c4c0 == '\0') {
      bVar1 = false;
    }
    else {
      bVar1 = true;
      FUN_1400a1c30(&DAT_14031a2d8);
    }
  }
  if ((DAT_14031a2d0 & 1) == 0) {
    DAT_14031a2d0 = DAT_14031a2d0 | 1;
    FUN_1401942b0(&DAT_14031a240);
    atexit((_func_5014 *)&LAB_140202c40);
  }
  DAT_14030c4c0 = 0;
  if (bVar1) {
    FUN_1400d1290(&DAT_14031a2d8);
  }
  return &DAT_14031a240;
}



void FUN_1401a9120(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined1 local_58 [88];
  
  lVar1 = *param_1;
  while( true ) {
    if (lVar1 == 0) {
      return;
    }
    plVar2 = (longlong *)*param_1;
    if ((longlong *)plVar2[2] != param_1) break;
    plVar3 = (longlong *)plVar2[1];
    lVar1 = *plVar2;
    if (plVar3 != (longlong *)0x0) {
      *plVar3 = lVar1;
    }
    if (lVar1 != 0) {
      *(longlong **)(lVar1 + 8) = plVar3;
    }
    if (plVar3 == (longlong *)0x0) {
      if ((longlong *)param_1[1] != plVar2) {
        FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                      L"Proud::CListNode<class Proud::CNetClientWorker>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      param_1[1] = lVar1;
    }
    if (lVar1 == 0) {
      if ((longlong *)*param_1 != plVar2) {
        FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                      L"Proud::CListNode<class Proud::CNetClientWorker>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      *param_1 = (longlong)plVar3;
    }
    *plVar2 = 0;
    plVar2[1] = 0;
    plVar2[2] = 0;
    *(int *)(param_1 + 2) = (int)param_1[2] + -1;
    lVar1 = *param_1;
  }
  FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                L"Proud::CListNode<class Proud::CNetClientWorker>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_1401a9210(longlong param_1,undefined8 *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  longlong lVar4;
  undefined1 uVar5;
  
  uVar3 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x10;
  lVar4 = lVar1;
  FUN_1400a1c30(lVar1);
  uVar5 = 1;
  if (param_2[2] != 0) {
    FUN_1401a8990(param_2[2],param_2,param_3,param_4,uVar3,lVar4,1);
  }
  puVar2 = (undefined8 *)(param_1 + 0x298);
  if (param_2[2] != 0) {
    FUN_1401a8990(puVar2,param_2,param_3,param_4,uVar3,lVar4,uVar5);
  }
  if (*(longlong *)(param_1 + 0x2a0) == 0) {
    *puVar2 = param_2;
  }
  else {
    *(undefined8 **)(*(longlong *)(param_1 + 0x2a0) + 8) = param_2;
    *param_2 = *(undefined8 *)(param_1 + 0x2a0);
  }
  *(undefined8 **)(param_1 + 0x2a0) = param_2;
  param_2[2] = puVar2;
  *(int *)(param_1 + 0x2a8) = *(int *)(param_1 + 0x2a8) + 1;
  FUN_1400d1290(lVar1);
  return;
}



void thunk_FUN_1401a9120(void)

{
  FUN_1401a9120();
  return;
}



void FUN_1401a92c0(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_1400acbf0(pvVar1);
    operator_delete(pvVar1);
    *param_1 = 0;
    return;
  }
  *param_1 = 0;
  return;
}



undefined8 *
FUN_1401a9310(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  
  uVar1 = 0;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[0x1a] = 0;
  *(undefined4 *)(param_1 + 8) = 0;
  param_1[0x10] = 0;
  *(undefined1 *)(param_1 + 0x18) = 0;
  param_1[0x21] = param_2;
  *(undefined4 *)(param_1 + 0x20) = 0;
  if (*(longlong *)(param_1[0x21] + 0x5d8) != 0) {
    uVar1 = *(undefined8 *)(*(longlong *)(param_1[0x21] + 0x5d8) + 0x38);
  }
  FUN_1401a9210(uVar1,param_1,param_3,param_4,0xfffffffffffffffe);
  return param_1;
}



void FUN_1401a9380(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  int iVar2;
  undefined *puVar3;
  undefined8 uVar4;
  longlong *plVar5;
  undefined1 local_res8;
  undefined7 uStackX_9;
  
  if (*(char *)(*(longlong *)(param_1 + 0x108) + 0x650) == '\0') {
    plVar5 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x70);
    local_res8 = 0;
    iVar2 = (**(code **)(*plVar5 + 0x108))(plVar5,&local_res8,param_3,param_4,0xfffffffffffffffe);
    if ((iVar2 == 2) && (*(int *)(*(longlong *)(param_1 + 0x108) + 0x1578) != 0)) {
      plVar5 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x70);
      (**(code **)(*plVar5 + 0xb0))(plVar5,&local_res8);
      puVar3 = (undefined *)CONCAT71(uStackX_9,local_res8);
      if ((puVar3 != (undefined *)0x0) &&
         ((puVar3 != PTR_DAT_1402f8010 && (0 < *(int *)(puVar3 + -8))))) {
        *(undefined1 *)(*(longlong *)(param_1 + 0x108) + 0x650) = 1;
        plVar5 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x1818);
        (**(code **)(*plVar5 + 0xf0))(plVar5,1,&DAT_140318cf0,&local_res8);
        puVar3 = (undefined *)CONCAT71(uStackX_9,local_res8);
      }
      if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1402f8010)) &&
         (puVar3 + -8 != (undefined *)0x0)) {
        uVar4 = FUN_1400a3440();
        FUN_1400a1c30(uVar4);
        piVar1 = (int *)(puVar3 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar3 + -8);
        }
        FUN_1400d1290(uVar4);
      }
    }
  }
  return;
}



void FUN_1401a94a0(longlong param_1,longlong *param_2)

{
  undefined1 uVar1;
  longlong lVar2;
  undefined8 uVar3;
  uint uVar4;
  undefined8 *_Dst;
  int iVar5;
  undefined8 *_Src;
  undefined8 *puVar6;
  size_t _Size;
  ulonglong uVar7;
  ulonglong uVar8;
  undefined1 local_98 [144];
  
  if (*(longlong *)(param_1 + 8) == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar5 = *(int *)(param_1 + 0x18);
  }
  else {
    iVar5 = *(int *)(*(longlong *)(param_1 + 8) + 0x18);
  }
  if (iVar5 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2[1] == 0) {
    lVar2 = *param_2;
    if (iVar5 < 1) {
      if (lVar2 == 0) goto LAB_1401a950e;
      iVar5 = 0;
    }
    else if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    FUN_14003cda0(lVar2,iVar5);
  }
  else {
    if (*(int *)((longlong)param_2 + 0x14) < iVar5) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(int *)(param_2 + 2) = iVar5;
  }
LAB_1401a950e:
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    uVar4 = *(uint *)(param_1 + 0x18);
  }
  else {
    uVar4 = *(uint *)(lVar2 + 0x18);
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    if (*(int *)(lVar2 + 0x18) == 0) {
      _Src = (undefined8 *)0x0;
    }
    else {
      _Src = *(undefined8 **)(lVar2 + 0x10);
    }
  }
  else {
    _Src = *(undefined8 **)(param_1 + 0x10);
    if (_Src == (undefined8 *)0x0) {
      FUN_1400a2320(local_98,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_98,(ThrowInfo *)&DAT_1402f4860);
    }
  }
  _Dst = (undefined8 *)param_2[1];
  if (_Dst == (undefined8 *)0x0) {
    lVar2 = *param_2;
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    if (*(int *)(lVar2 + 0x18) == 0) {
      _Dst = (undefined8 *)0x0;
    }
    else {
      _Dst = *(undefined8 **)(lVar2 + 0x10);
    }
  }
  _Size = (size_t)(int)uVar4;
  if (0x20 < _Size) {
    memcpy(_Dst,_Src,_Size);
    return;
  }
  uVar8 = (ulonglong)(uVar4 & 7);
  for (uVar7 = _Size >> 3; uVar7 != 0; uVar7 = uVar7 - 1) {
    uVar3 = *_Src;
    _Src = _Src + 1;
    *_Dst = uVar3;
    _Dst = _Dst + 1;
  }
  if (uVar8 != 0) {
    puVar6 = _Src;
    do {
      uVar1 = *(undefined1 *)puVar6;
      puVar6 = (undefined8 *)((longlong)puVar6 + 1);
      uVar8 = uVar8 - 1;
      *(undefined1 *)((longlong)_Dst + (-1 - (longlong)_Src) + (longlong)puVar6) = uVar1;
    } while (uVar8 != 0);
  }
  return;
}



void FUN_1401a9620(longlong param_1)

{
  longlong lVar1;
  double dVar2;
  longlong lVar3;
  int iVar4;
  longlong lVar5;
  undefined8 uVar6;
  double dVar7;
  
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))
            (*(longlong *)(param_1 + 0x108) + 0x78);
  uVar6 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))
                    (*(longlong *)(param_1 + 0x108) + 0x70);
  lVar1 = *(longlong *)(param_1 + 0x108);
  iVar4 = 0;
  if (*(longlong *)(lVar1 + 0x1670) == 0) {
    lVar5 = 0;
  }
  else {
    lVar5 = *(longlong *)(lVar1 + 0x1660);
  }
  for (; lVar5 != 0; lVar5 = *(longlong *)(lVar5 + 0x10)) {
    lVar3 = 0;
    if (*(longlong **)(lVar5 + 8) != (longlong *)0x0) {
      lVar3 = **(longlong **)(lVar5 + 8);
    }
    if (*(char *)(lVar3 + 0x684) == '\0') {
      FUN_1401bb4f0(lVar3,uVar6);
      if ((*(longlong **)(lVar3 + 0x28) != (longlong *)0x0) && (**(longlong **)(lVar3 + 0x28) != 0))
      {
        iVar4 = iVar4 + 1;
      }
    }
  }
  if (lVar1 + 0x1650 == *(longlong *)(param_1 + 0x108) + 0x1650) {
    dVar2 = 1.0;
    if (1.0 <= (double)iVar4) {
      dVar2 = (double)iVar4;
    }
    *(double *)(*(longlong *)(param_1 + 0x108) + 0x648) = DAT_1402f8090 * dVar2;
    dVar7 = (double)FUN_1400a35f0();
    *(double *)(*(longlong *)(param_1 + 0x108) + 0x640) = dVar7 * dVar2;
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a9760(longlong param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  char cVar2;
  longlong *plVar3;
  longlong lVar4;
  undefined1 auStack_a8 [32];
  undefined4 local_88;
  undefined4 local_78 [2];
  longlong *local_70;
  undefined **local_68;
  undefined4 local_60;
  undefined2 local_5c;
  undefined **local_58;
  undefined4 local_50;
  undefined2 local_4c;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined4 local_38;
  undefined4 uStack_34;
  undefined4 uStack_30;
  undefined4 uStack_2c;
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_a8;
  lVar4 = 0;
  local_60 = 0;
  local_38 = 0;
  uStack_34 = 0;
  uStack_30 = 0;
  uStack_2c = 0;
  local_68 = Proud::AddrPort::vftable;
  local_5c = 0;
  cVar2 = FUN_140185490(param_2,&local_38,0x10);
  if (cVar2 != '\0') {
    cVar2 = FUN_140185ec0(param_2,&local_68);
    if (cVar2 != '\0') {
      cVar2 = FUN_140185f20(param_2,local_78);
      if (cVar2 != '\0') {
        plVar3 = (longlong *)FUN_1401755f0(*(undefined8 *)(param_1 + 0x108),&local_70,local_78[0]);
        if ((longlong *)*plVar3 != (longlong *)0x0) {
          lVar4 = *(longlong *)*plVar3;
        }
        if ((local_70 != (longlong *)0x0) && (local_70[1] = local_70[1] + -1, local_70[1] == 0)) {
          puVar1 = (undefined8 *)*local_70;
          if (puVar1 != (undefined8 *)0x0) {
            (**(code **)*puVar1)(puVar1,1);
          }
          FUN_1400a3530(local_70);
        }
        if ((((lVar4 != 0) && (*(char *)(lVar4 + 0x684) == '\0')) &&
            (plVar3 = *(longlong **)(lVar4 + 0x28), plVar3 != (longlong *)0x0)) && (*plVar3 != 0)) {
          local_58 = Proud::AddrPort::vftable;
          local_50 = local_60;
          local_48 = local_38;
          uStack_44 = uStack_34;
          uStack_40 = uStack_30;
          uStack_3c = uStack_2c;
          local_4c = local_5c;
          local_88 = local_78[0];
          FUN_1401b8da0(*plVar3,param_2,&local_48,&local_58);
        }
      }
    }
  }
  return;
}



void FUN_1401a98d0(longlong param_1,undefined8 param_2,longlong param_3)

{
  undefined8 *puVar1;
  char cVar2;
  undefined4 local_res18 [2];
  longlong *local_res20;
  undefined1 *local_b8;
  undefined4 local_b0 [2];
  undefined1 local_a8 [8];
  longlong local_a0;
  int local_94;
  undefined1 *local_88;
  undefined4 local_78 [2];
  undefined1 local_70 [8];
  longlong local_68;
  undefined4 local_60;
  int local_5c;
  undefined4 local_50;
  undefined **local_48;
  undefined4 local_40;
  undefined2 local_3c;
  undefined1 local_38;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  if (*(int *)(param_3 + 0x28) == 1) {
    (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
    cVar2 = FUN_140185f20(param_3,local_res18);
    if ((((cVar2 != '\0') && (cVar2 = FUN_140185b30(param_3,&local_b8), cVar2 != '\0')) &&
        (-1 < (int)local_b8)) && ((int)local_b8 < DAT_1402f8140)) {
      FUN_140185560(local_b0);
      cVar2 = FUN_1401857c0(param_3,local_b0,(ulonglong)local_b8 & 0xffffffff);
      if (cVar2 == '\0') {
        local_b8 = local_a8;
        FUN_14019a730(local_a8);
        if ((local_a0 != 0) && (local_94 < 0)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
      }
      else {
        FUN_1401755f0(*(undefined8 *)(param_1 + 0x108),&local_res20,local_res18[0]);
        if (((local_res20 != (longlong *)0x0) && (*local_res20 != 0)) &&
           (*(char *)(*local_res20 + 0x684) == '\0')) {
          FUN_140185560(local_78);
          local_48 = Proud::AddrPort::vftable;
          local_38 = 0;
          local_50 = 0;
          local_40 = DAT_1402f83d0;
          local_3c = DAT_1402f83d4;
          FUN_140185030(local_78);
          local_38 = 1;
          FUN_1401a94a0(local_b0,local_70);
          local_78[0] = local_b0[0];
          FUN_140185160(local_78,0);
          local_50 = local_res18[0];
          FUN_1401af9b0(param_1,param_2,local_78);
          local_88 = local_70;
          FUN_14019a730(local_70);
          if (local_68 != 0) {
            if (local_5c < 0) {
                    // WARNING: Subroutine does not return
              FUN_1400a26d0();
            }
            local_60 = 0;
          }
        }
        if ((local_res20 != (longlong *)0x0) &&
           (local_res20[1] = local_res20[1] + -1, local_res20[1] == 0)) {
          puVar1 = (undefined8 *)*local_res20;
          if (puVar1 != (undefined8 *)0x0) {
            (**(code **)*puVar1)(puVar1,1);
          }
          FUN_1400a3530(local_res20);
        }
        local_88 = local_a8;
        FUN_14019a730(local_a8);
        if ((local_a0 != 0) && (local_94 < 0)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
      }
    }
  }
  return;
}



undefined8 FUN_1401a9af0(longlong param_1,int *param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined *local_res8;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  lVar2 = *(longlong *)(param_1 + 0x108);
  FUN_1400a3440();
  local_res8 = PTR_DAT_1402f8010;
  FUN_140003100(&local_res8,lVar2 + 0x1588);
  lVar2 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
  uVar3 = 0;
  if (*(undefined8 **)(lVar2 + 0x128) != (undefined8 *)0x0) {
    uVar3 = **(undefined8 **)(lVar2 + 0x128);
  }
  iVar1 = FUN_1400a92b0(uVar3,&local_res8,*(undefined2 *)(*(longlong *)(param_1 + 0x108) + 0x1590),
                        param_4,uVar4);
  if ((iVar1 == 0) || (iVar1 == 0x2733)) {
    uVar3 = 1;
  }
  else {
    *param_2 = iVar1;
    uVar3 = 0;
  }
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401a9ba0(longlong param_1)

{
  char cVar1;
  longlong lVar2;
  undefined8 uVar3;
  double dVar4;
  undefined1 auStack_668 [32];
  int local_648 [4];
  undefined1 local_638 [1568];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_668;
  dVar4 = (double)(**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))
                            (*(longlong *)(param_1 + 0x108) + 0x70);
  if (dVar4 - *(double *)(param_1 + 200) <= DAT_1402f8060) {
    FUN_1400a8110(local_638);
    lVar2 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
    uVar3 = 0;
    if (*(undefined8 **)(lVar2 + 0x128) != (undefined8 *)0x0) {
      uVar3 = **(undefined8 **)(lVar2 + 0x128);
    }
    FUN_1400a8130(local_638,uVar3);
    lVar2 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
    uVar3 = 0;
    if (*(undefined8 **)(lVar2 + 0x128) != (undefined8 *)0x0) {
      uVar3 = **(undefined8 **)(lVar2 + 0x128);
    }
    FUN_1400a8190(local_638,uVar3);
    FUN_1400a81f0(local_638,0);
    lVar2 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
    uVar3 = 0;
    if (*(undefined8 **)(lVar2 + 0x128) != (undefined8 *)0x0) {
      uVar3 = **(undefined8 **)(lVar2 + 0x128);
    }
    cVar1 = FUN_1400a8250(local_638,uVar3,local_648);
    if (cVar1 == '\0') {
      return;
    }
    if (local_648[0] == 0) {
      lVar2 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
      uVar3 = 0;
      if (*(undefined8 **)(lVar2 + 0x128) != (undefined8 *)0x0) {
        uVar3 = **(undefined8 **)(lVar2 + 0x128);
      }
      FUN_1400a8090(uVar3,1);
      uVar3 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
      FUN_1401b80b0(uVar3);
      lVar2 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
      cVar1 = FUN_1400a64d0(lVar2 + 0x110);
      if (cVar1 == '\0') {
        FUN_1400a2b50(&DAT_140262390);
      }
      if (1 < *(int *)(param_1 + 0x100)) {
        return;
      }
      *(undefined4 *)(param_1 + 0x40) = 0;
      *(undefined4 *)(param_1 + 0x100) = 2;
      uVar3 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))
                        (*(longlong *)(param_1 + 0x108) + 0x70);
      *(undefined8 *)(param_1 + 0x80) = uVar3;
      *(undefined1 *)(param_1 + 0xc0) = 0;
      return;
    }
    cVar1 = FUN_1401a9af0(param_1,local_648);
    if (cVar1 != '\0') {
      return;
    }
  }
  else {
    local_648[0] = 0x274c;
  }
  FUN_1401a8d00(param_1,local_648[0]);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401a9d70(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  double dVar1;
  undefined8 *puVar2;
  char cVar3;
  undefined8 uVar4;
  longlong *plVar5;
  longlong lVar6;
  double dVar7;
  double dVar8;
  longlong *local_res18;
  double local_res20;
  undefined **local_20;
  undefined4 local_18;
  undefined2 local_14;
  
  cVar3 = FUN_140185490(param_2,&local_res20,8,param_4,0xfffffffffffffffe);
  if (cVar3 != '\0') {
    uVar4 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
    FUN_1400a1c30(uVar4);
    local_20 = Proud::AddrPort::vftable;
    local_18 = *(undefined4 *)(param_2 + 0x38);
    local_14 = *(undefined2 *)(param_2 + 0x3c);
    plVar5 = (longlong *)FUN_140173ea0(*(undefined8 *)(param_1 + 0x108),&local_res18,&local_20);
    lVar6 = 0;
    if ((longlong *)*plVar5 != (longlong *)0x0) {
      lVar6 = *(longlong *)*plVar5;
    }
    if ((local_res18 != (longlong *)0x0) &&
       (local_res18[1] = local_res18[1] + -1, local_res18[1] == 0)) {
      puVar2 = (undefined8 *)*local_res18;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      FUN_1400a3530(local_res18);
    }
    if ((lVar6 != 0) && (*(int *)(lVar6 + 0x56c) != 1)) {
      dVar7 = (double)FUN_1400ad790(*(longlong *)(param_1 + 0x108) + 0x1620);
      dVar8 = (dVar7 - local_res20) * 0.5;
      *(double *)(lVar6 + 0x158) = dVar8;
      dVar1 = *(double *)(lVar6 + 0x50);
      if (0.0 < dVar1) {
        dVar8 = (dVar8 - dVar1) * _DAT_1402f8108 + dVar1;
      }
      *(double *)(lVar6 + 0x50) = dVar8;
      if (0.0 < dVar7) {
        *(double *)(lVar6 + 0xc0) = dVar7;
        *(int *)(lVar6 + 0x100) = *(int *)(lVar6 + 0x100) + 1;
      }
    }
    FUN_1400d1290(uVar4);
  }
  return;
}



void FUN_1401a9ee0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  char cVar3;
  longlong lVar4;
  longlong lVar5;
  longlong *plVar6;
  undefined2 uVar7;
  undefined4 uVar8;
  longlong *local_res8;
  undefined8 local_res10;
  undefined **local_28;
  undefined4 local_20;
  undefined2 local_1c;
  
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))
            (*(longlong *)(param_1 + 0x108) + 0x78);
  cVar3 = FUN_140185490(param_2,&local_res10,8);
  if (cVar3 != '\0') {
    lVar5 = 0;
    uVar8 = 0;
    uVar7 = 0;
    if ((*(int *)(param_2 + 0x28) == 1) &&
       (lVar4 = FUN_140169e30(*(undefined8 *)(param_1 + 0x108)), lVar4 != 0)) {
      lVar5 = FUN_140169e30(*(undefined8 *)(param_1 + 0x108));
      plVar1 = *(longlong **)(lVar5 + 0x108);
      lVar5 = FUN_140169e30(*(undefined8 *)(param_1 + 0x108));
      uVar8 = *(undefined4 *)(lVar5 + 0x140);
      uVar7 = *(undefined2 *)(lVar5 + 0x144);
      local_res8 = plVar1;
    }
    else {
      plVar6 = (longlong *)
               FUN_1401755f0(*(undefined8 *)(param_1 + 0x108),&local_res8,
                             *(undefined4 *)(param_2 + 0x28));
      plVar1 = local_res8;
      if ((longlong *)*plVar6 != (longlong *)0x0) {
        lVar5 = *(longlong *)*plVar6;
      }
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
        puVar2 = (undefined8 *)*local_res8;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        FUN_1400a3530(plVar1);
      }
      if (((lVar5 != 0) && (*(longlong **)(lVar5 + 0x18) != (longlong *)0x0)) &&
         (**(longlong **)(lVar5 + 0x18) != 0)) {
        lVar4 = FUN_1401b8a70(lVar5);
        uVar8 = *(undefined4 *)(lVar5 + 0x598);
        uVar7 = *(undefined2 *)(lVar5 + 0x59c);
        local_res8 = *(longlong **)(lVar4 + 0x108);
      }
    }
    if (local_res8 != (longlong *)0x0) {
      local_28 = Proud::AddrPort::vftable;
      local_20 = uVar8;
      local_1c = uVar7;
      FUN_14019cd00(local_res8,&local_28,local_res10);
    }
  }
  return;
}



void FUN_1401aa050(longlong param_1)

{
  int *piVar1;
  longlong lVar2;
  undefined *puVar3;
  bool bVar4;
  bool bVar5;
  undefined *local_res10;
  undefined *local_res18 [2];
  undefined8 uVar6;
  
  uVar6 = 0xfffffffffffffffe;
  bVar4 = *(int *)(param_1 + 0x100) == 5;
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x108) + 0x5d8);
  puVar3 = (undefined *)0x0;
  if (lVar2 != 0) {
    puVar3 = *(undefined **)(lVar2 + 0x38);
  }
  FUN_1400a1c30(puVar3 + 0x10);
  bVar5 = *(longlong *)(param_1 + 0x10) == 0;
  FUN_1400d1290(puVar3 + 0x10);
  if ((!bVar4) || (!bVar5)) {
    FUN_1400a3440();
    local_res18[0] = PTR_DAT_1402f8010;
    FUN_14003c600(local_res18,L"CNetClientManager.dtor assert fail: %d %d",bVar4,bVar5,uVar6);
    FUN_1400a3440();
    puVar3 = local_res18[0];
    local_res10 = PTR_DAT_1402f8010;
    if (PTR_DAT_1402f8010 == (undefined *)0x0) {
      local_res10 = (undefined *)0x0;
    }
    if (local_res18[0] != PTR_DAT_1402f8010) {
      uVar6 = FUN_1400a3440();
      FUN_1400a1c30(uVar6);
      FUN_1400031d0(&local_res10);
      local_res10 = puVar3;
      if (((puVar3 != PTR_DAT_1402f8010) && (puVar3 != (undefined *)0x0)) &&
         (puVar3 != (undefined *)0x8)) {
        *(int *)(puVar3 + -4) = *(int *)(puVar3 + -4) + 1;
      }
      FUN_1400d1290(uVar6);
    }
    FUN_1400a6370(&local_res10);
    if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1402f8010)) &&
       (puVar3 + -8 != (undefined *)0x0)) {
      uVar6 = FUN_1400a3440();
      FUN_1400a1c30(uVar6);
      piVar1 = (int *)(puVar3 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar3 + -8);
      }
      FUN_1400d1290(uVar6);
    }
  }
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_1401a8990(*(longlong *)(param_1 + 0x10),param_1);
  }
  return;
}



void FUN_1401aa1f0(longlong param_1)

{
  undefined *puVar1;
  int *piVar2;
  longlong *plVar3;
  undefined *puVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  longlong lVar7;
  double dVar8;
  undefined *local_res8;
  
  uVar5 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
  FUN_1400a1c30(uVar5);
  lVar7 = *(longlong *)(param_1 + 0x108);
  if (0.0 < *(double *)(lVar7 + 0x1648)) {
    dVar8 = (double)(**(code **)(*(longlong *)(lVar7 + 0x70) + 0x1c0))();
    if (10.0 < dVar8 - *(double *)(lVar7 + 0x1648)) {
      if ((*(char *)(lVar7 + 0x1790) != '\0') || (*(int *)(lVar7 + 0x6c8) != 0)) {
        FUN_140177c40(lVar7,0,
                      L"**WARNING** CNetClient.FrameMove is not called in ten seconds. Is this your intention?"
                     );
      }
      *(undefined8 *)(*(longlong *)(param_1 + 0x108) + 0x1648) = 0xbff0000000000000;
    }
  }
  lVar7 = *(longlong *)(param_1 + 0x108);
  dVar8 = (double)(**(code **)(*(longlong *)(lVar7 + 0x70) + 0x1c0))();
  dVar8 = dVar8 - *(double *)(*(longlong *)(param_1 + 0x108) + 0x18c0);
  if (((*(double *)(lVar7 + 0x6a8) <= dVar8 && dVar8 != *(double *)(lVar7 + 0x6a8)) &&
      (*(longlong **)(lVar7 + 0x5d0) != (longlong *)0x0)) && (**(longlong **)(lVar7 + 0x5d0) != 0))
  {
    if ((*(char *)(lVar7 + 0x1790) != '\0') || (*(int *)(lVar7 + 0x6c8) != 0)) {
      lVar7 = *(longlong *)(param_1 + 0x108);
      FUN_140177c40(lVar7,0,&DAT_1402624b0,*(undefined8 *)(lVar7 + 0x6a8),
                    *(undefined4 *)(lVar7 + 0x1578));
    }
    FUN_1400a3440();
    local_res8 = PTR_DAT_1402f8010;
    FUN_140182b30(*(undefined8 *)(param_1 + 0x108),0xc,7,&local_res8);
    puVar4 = local_res8;
    if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
      uVar6 = FUN_1400a3440();
      FUN_1400a1c30(uVar6);
      piVar2 = (int *)(puVar4 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar6);
    }
    local_res8 = PTR_DAT_1402f8010;
    plVar3 = *(longlong **)(*(longlong *)(param_1 + 0x108) + 0x5d0);
    lVar7 = 0;
    if (plVar3 != (longlong *)0x0) {
      lVar7 = *plVar3;
    }
    if (*(int *)(lVar7 + 0x100) < 4) {
      *(undefined4 *)(lVar7 + 0x40) = 0;
      *(undefined4 *)(lVar7 + 0x100) = 4;
      uVar6 = (**(code **)(*(longlong *)(*(longlong *)(lVar7 + 0x108) + 0x70) + 0x1c0))();
      *(undefined8 *)(lVar7 + 0x80) = uVar6;
      *(undefined1 *)(lVar7 + 0xc0) = 0;
    }
  }
  FUN_1401a9620(param_1);
  FUN_1401798c0(*(undefined8 *)(param_1 + 0x108));
  FUN_140174010(*(undefined8 *)(param_1 + 0x108));
  FUN_140174300(*(undefined8 *)(param_1 + 0x108));
  FUN_140174560(*(undefined8 *)(param_1 + 0x108));
  FUN_140184d60(*(undefined8 *)(param_1 + 0x108));
  FUN_14016c250(*(undefined8 *)(param_1 + 0x108));
  FUN_14016c3b0(*(undefined8 *)(param_1 + 0x108));
  FUN_14017a270(*(undefined8 *)(param_1 + 0x108));
  FUN_1400d1290(uVar5);
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401aa4a0(longlong param_1,longlong param_2)

{
  undefined *puVar1;
  int *piVar2;
  longlong *plVar3;
  undefined *puVar4;
  char cVar5;
  int iVar6;
  longlong lVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined8 *puVar10;
  bool bVar11;
  undefined1 auStack_19c8 [32];
  undefined **local_19a8;
  undefined4 local_19a0;
  undefined2 local_199c;
  undefined1 local_1998 [8];
  undefined1 local_1990 [8];
  longlong local_1988;
  int local_197c;
  undefined8 local_1970;
  undefined1 local_1968;
  undefined8 local_1960;
  undefined *local_1958;
  undefined4 uStack_1950;
  undefined4 uStack_194c;
  undefined1 local_1948 [3200];
  undefined1 *local_cc8;
  undefined4 local_cc0;
  undefined4 local_cbc;
  undefined1 local_cb8 [3216];
  ulonglong local_28;
  undefined8 uStack_20;
  
  uStack_20 = 0x1401aa4b6;
  local_1960 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_19c8;
  local_19a8 = Proud::AddrPort::vftable;
  lVar9 = 0;
  local_19a0 = 0;
  local_199c = 0;
  local_1958 = (undefined *)0x0;
  uStack_1950 = 0;
  uStack_194c = 0;
  cVar5 = FUN_140185490(param_2,&local_1958,0x10);
  if ((cVar5 != '\0') && (cVar5 = FUN_140185ec0(param_2,&local_19a8), cVar5 != '\0')) {
    plVar3 = *(longlong **)(*(longlong *)(param_1 + 0x108) + 0x1570);
    lVar7 = lVar9;
    if (plVar3 != (longlong *)0x0) {
      lVar7 = *plVar3;
    }
    bVar11 = local_1958 < *(undefined **)(lVar7 + 8);
    iVar6 = 0;
    if ((local_1958 != *(undefined **)(lVar7 + 8)) ||
       (bVar11 = CONCAT44(uStack_194c,uStack_1950) < *(ulonglong *)(lVar7 + 0x10),
       CONCAT44(uStack_194c,uStack_1950) != *(ulonglong *)(lVar7 + 0x10))) {
      iVar6 = (1 - (uint)bVar11) - (uint)(bVar11 != 0);
    }
    if (iVar6 == 0) {
      plVar3 = *(longlong **)(*(longlong *)(param_1 + 0x108) + 0x1570);
      lVar7 = lVar9;
      if (plVar3 != (longlong *)0x0) {
        lVar7 = *plVar3;
      }
      if ((*(int *)(lVar7 + 0xd0) == *(int *)(param_2 + 0x38)) &&
         (*(short *)(lVar7 + 0xd4) == *(short *)(param_2 + 0x3c))) {
        FUN_140185560(local_1998);
        FUN_140185030(local_1998);
        FUN_1401856c0(local_1998,0x800);
        FUN_1401856c0(local_1998,0);
        FUN_14003c9e0(local_1998,0xe);
        plVar3 = *(longlong **)(*(longlong *)(param_1 + 0x108) + 0x1570);
        if (plVar3 != (longlong *)0x0) {
          lVar9 = *plVar3;
        }
        local_1958 = *(undefined **)(lVar9 + 8);
        uStack_1950 = *(undefined4 *)(lVar9 + 0x10);
        uStack_194c = *(undefined4 *)(lVar9 + 0x14);
        FUN_14003cba0(local_1998,&local_1958);
        uVar8 = FUN_140169f40(*(undefined8 *)(param_1 + 0x108),&local_1970);
        FUN_140186160(local_1998,uVar8);
        FUN_140186160(local_1998,&local_19a8);
        local_cbc = 200;
        local_cc0 = 0;
        local_cc8 = local_1948;
        FUN_140146970(local_cb8,local_1998);
        FUN_140145c70(local_1948,local_cb8);
        FUN_140145b60(local_cb8);
        lVar9 = FUN_140169e30(*(undefined8 *)(param_1 + 0x108));
        *(undefined4 *)(lVar9 + 0x140) = local_19a0;
        *(undefined2 *)(lVar9 + 0x144) = local_199c;
        local_1958 = (undefined *)0x0;
        uStack_1950 = CONCAT31(uStack_1950._1_3_,1);
        uVar8 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
        FUN_1401b82c0(uVar8,local_1948,&local_1958);
        if ((*(char *)(*(longlong *)(param_1 + 0x108) + 0x1790) != '\0') ||
           (*(int *)(*(longlong *)(param_1 + 0x108) + 0x6c8) != 0)) {
          puVar10 = (undefined8 *)FUN_1400a6f50(&local_19a8,&local_1958);
          FUN_140177c40(*(undefined8 *)(param_1 + 0x108),1,
                        L"Message_ServerHolepunchAck. AddrOfHereAtServer=%s",*puVar10);
          puVar4 = local_1958;
          if ((local_1958 != (undefined *)0x0) &&
             ((local_1958 != PTR_DAT_1402f8010 &&
              (puVar1 = local_1958 + -8, puVar1 != (undefined *)0x0)))) {
            uVar8 = FUN_1400a3440();
            local_1970 = uVar8;
            FUN_1400a1c30(uVar8);
            local_1968 = 1;
            piVar2 = (int *)(puVar4 + -4);
            *piVar2 = *piVar2 + -1;
            if (*piVar2 == 0) {
              FUN_1400a3530(puVar1);
            }
            FUN_1400d1290(uVar8);
          }
        }
        FUN_140145b60(local_1948);
        local_1958 = local_1990;
        FUN_14019a730(local_1990);
        if ((local_1988 != 0) && (local_197c < 0)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
      }
    }
  }
  return;
}



undefined8 FUN_1401aa7d0(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  undefined8 uVar2;
  longlong *local_res18;
  undefined **local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined1 local_78 [4];
  undefined4 local_74;
  longlong local_70;
  longlong local_68;
  undefined4 local_60;
  int local_5c;
  undefined4 local_50;
  undefined **local_48;
  undefined4 local_40;
  undefined2 local_3c;
  undefined1 local_38;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  local_a0 = 0;
  local_98 = 0;
  local_90 = 0;
  local_88 = 0;
  local_a8 = Proud::ByteArray::vftable;
  cVar1 = FUN_140185b30(param_3,&local_res18);
  if (((cVar1 == '\0') || ((int)local_res18 < 0)) || (DAT_1402f8140 < (int)local_res18)) {
LAB_1401aa957:
    FUN_140140df0(&local_a8);
    return 0;
  }
  FUN_14003cda0(&local_a8,(ulonglong)local_res18 & 0xffffffff);
  uVar2 = local_98;
  if ((int)local_90 == 0) {
    uVar2 = 0;
  }
  cVar1 = FUN_140185490(param_3,uVar2,(ulonglong)local_res18 & 0xffffffff);
  if (cVar1 == '\0') goto LAB_1401aa957;
  FUN_140185560(local_78);
  local_48 = Proud::AddrPort::vftable;
  local_38 = 0;
  local_40 = DAT_1402f83d0;
  local_3c = DAT_1402f83d4;
  local_50 = 1;
  FUN_140185030(local_78);
  if ((int)local_90 < 1) {
                    // WARNING: Subroutine does not return
    FUN_1400a2700();
  }
  local_74 = 0;
  if (local_70 == 0) {
    if (local_68 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_68 == 0) {
    if (local_70 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    FUN_14003ce60(local_70,local_98);
    goto LAB_1401aa8fc;
  }
  FUN_14003cc90(&local_68,local_98);
LAB_1401aa8fc:
  FUN_14003ced0(local_78);
  local_38 = 1;
  FUN_1401af9b0(param_1,param_2,local_78);
  local_res18 = &local_70;
  FUN_14019a730(&local_70);
  if (local_68 != 0) {
    if (local_5c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_60 = 0;
  }
  FUN_140140df0(&local_a8);
  return 1;
}



void FUN_1401aa980(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  longlong lVar5;
  uint *puVar6;
  undefined8 uVar7;
  uint *puVar8;
  uint uVar9;
  uint uVar10;
  uint uVar11;
  uint *local_res8;
  
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
  lVar5 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
  *(undefined1 *)(lVar5 + 0x80) = 0;
  iVar2 = *(int *)(param_2 + 8);
  if (-1 < iVar2) {
    if (0 < iVar2) {
      lVar5 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
      FUN_1401a3e60(lVar5 + 0x170,iVar2);
      plVar1 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x660);
      *plVar1 = *plVar1 + (longlong)*(int *)(param_2 + 8);
    }
    uVar7 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
    FUN_1401b8140(uVar7);
    return;
  }
  FUN_1400a3440();
  local_res8 = (uint *)PTR_DAT_1402f8010;
  uVar3 = FUN_1400a32c0(L"compdatalength < 0 sendcomplete");
  uVar11 = 0;
  uVar9 = 0;
  if ((local_res8 != (uint *)0x0) && (uVar9 = 0, local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar9 = local_res8[-2];
  }
  uVar4 = uVar3;
  if ((((int)uVar3 <= (int)uVar9) && (uVar4 = uVar11, local_res8 != (uint *)0x0)) &&
     (local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar4 = local_res8[-2];
  }
  uVar9 = 1;
  if (1 < (int)uVar4) {
    uVar9 = uVar4;
  }
  uVar4 = uVar11;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar4 = local_res8[-2];
  }
  uVar10 = 0;
  if ((int)uVar4 < (int)uVar9) {
    if (local_res8 == (uint *)0x0) {
      local_res8 = (uint *)PTR_DAT_1402f8010;
    }
    if ((int)uVar9 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar9 == 0) {
      FUN_1400031d0(&local_res8);
    }
    else {
      uVar4 = uVar11;
      if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
        uVar4 = local_res8[-2];
      }
      if (uVar9 != uVar4) {
        puVar6 = (uint *)FUN_1400a34c0((longlong)(int)uVar9 * 2 + 10);
        if (puVar6 != (uint *)0x0) {
          *puVar6 = 0;
          puVar6[1] = 1;
        }
        *puVar6 = uVar9;
        uVar4 = uVar10;
        if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
          uVar4 = local_res8[-2];
        }
        puVar8 = (uint *)PTR_DAT_1402f8010;
        if ((int)uVar9 < (int)uVar4) {
LAB_1401aaad2:
          if (local_res8 != (uint *)0x0) {
            puVar8 = local_res8;
          }
        }
        else {
          uVar9 = uVar11;
          if (local_res8 != (uint *)0x0) {
            if (local_res8 != (uint *)PTR_DAT_1402f8010) {
              uVar9 = local_res8[-2];
            }
            goto LAB_1401aaad2;
          }
        }
        FUN_1400a32f0(puVar6 + 2,puVar8,uVar9);
        FUN_1400031d0(&local_res8);
        local_res8 = puVar6 + 2;
      }
    }
  }
  FUN_140002e30(&local_res8);
  puVar6 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar6,L"compdatalength < 0 sendcomplete",uVar3);
  puVar6 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1402f8010;
  }
  uVar3 = FUN_1400a32c0(puVar6);
  uVar9 = 0;
  if (0 < (int)uVar3) {
    uVar9 = uVar3;
  }
  uVar3 = uVar10;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar3 = local_res8[-2];
  }
  if (((int)uVar3 <= (int)uVar9) && (uVar9 = uVar10, local_res8 != (uint *)0x0)) {
    if (local_res8 == (uint *)PTR_DAT_1402f8010) goto LAB_1401aab8c;
    uVar9 = local_res8[-2];
  }
  if (((local_res8 != (uint *)PTR_DAT_1402f8010) && (local_res8 != (uint *)0x0)) &&
     (local_res8 + -2 != (uint *)0x0)) {
    local_res8[-2] = uVar9;
    *(undefined2 *)((longlong)local_res8 + (longlong)(int)uVar9 * 2) = 0;
  }
LAB_1401aab8c:
  FUN_140182b30(*(undefined8 *)(param_1 + 0x108),0xb,3,&local_res8);
  puVar6 = local_res8;
  if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) &&
     (puVar8 = local_res8 + -2, puVar8 != (uint *)0x0)) {
    uVar7 = FUN_1400a3440();
    FUN_1400a1c30(uVar7);
    puVar6 = puVar6 + -1;
    *puVar6 = *puVar6 - 1;
    if (*puVar6 == 0) {
      FUN_1400a3530(puVar8);
    }
    FUN_1400d1290(uVar7);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001401aad7a)
// WARNING: Removing unreachable block (ram,0x0001401aad8d)
// WARNING: Removing unreachable block (ram,0x0001401aada7)
// WARNING: Removing unreachable block (ram,0x0001401aadaf)
// WARNING: Removing unreachable block (ram,0x0001401aadb6)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401aac50(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  char cVar2;
  undefined8 uVar3;
  longlong lVar4;
  undefined8 uVar5;
  undefined *puVar6;
  undefined *puVar7;
  undefined4 uVar8;
  double dVar9;
  undefined8 local_res8;
  undefined *local_res10;
  undefined *local_res18;
  
  uVar3 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))
                    (*(longlong **)(param_1 + 0x108),param_2,param_3,param_4,0xfffffffffffffffe);
  FUN_1400a1c30(uVar3);
  *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
  if (*(longlong *)(*(longlong *)(param_1 + 0x108) + 0xb0) != 0) {
    FUN_1401695c0();
  }
  puVar7 = (undefined *)0x0;
  uVar8 = 1;
  if (*(int *)(param_1 + 0x40) == 1) {
    (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
    lVar4 = FUN_140169e30(*(undefined8 *)(param_1 + 0x108));
    if (lVar4 != 0) {
      lVar4 = FUN_140169e30(*(undefined8 *)(param_1 + 0x108));
      puVar6 = puVar7;
      if (*(undefined8 **)(lVar4 + 0x100) != (undefined8 *)0x0) {
        puVar6 = (undefined *)**(undefined8 **)(lVar4 + 0x100);
      }
      FUN_1400a88b0(puVar6);
    }
    lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x108) + 0x1670);
    while (lVar4 != 0) {
      puVar6 = puVar7;
      if (*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x1670) != 0) {
        puVar6 = *(undefined **)(*(longlong *)(param_1 + 0x108) + 0x1660);
      }
      if (puVar6 == (undefined *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      local_res8 = 0;
      if (*(longlong *)(puVar6 + 8) != 0) {
        *(longlong *)(*(longlong *)(puVar6 + 8) + 8) =
             *(longlong *)(*(longlong *)(puVar6 + 8) + 8) + 1;
        local_res8 = *(undefined8 *)(puVar6 + 8);
      }
      FUN_14017bc00(*(undefined8 *)(param_1 + 0x108),&local_res8);
      lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x108) + 0x1670);
    }
    FUN_14017b740(*(undefined8 *)(param_1 + 0x108));
    FUN_14017b890(*(undefined8 *)(param_1 + 0x108));
    lVar4 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
    if (lVar4 != 0) {
      lVar4 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
      puVar6 = puVar7;
      if (*(undefined8 **)(lVar4 + 0x128) != (undefined8 *)0x0) {
        puVar6 = (undefined *)**(undefined8 **)(lVar4 + 0x128);
      }
      FUN_1400a88b0(puVar6);
    }
  }
  FUN_14017a700(*(undefined8 *)(param_1 + 0x108));
  if (*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x1718) == 0) {
    lVar4 = FUN_140169e30();
    if (lVar4 != 0) {
      lVar4 = FUN_140169e30(*(undefined8 *)(param_1 + 0x108));
      if ((*(longlong **)(lVar4 + 0x100) != (longlong *)0x0) &&
         (**(longlong **)(lVar4 + 0x100) != 0)) {
        lVar4 = FUN_140169e30(*(undefined8 *)(param_1 + 0x108));
        puVar6 = puVar7;
        if (*(undefined8 **)(lVar4 + 0x100) != (undefined8 *)0x0) {
          puVar6 = (undefined *)**(undefined8 **)(lVar4 + 0x100);
        }
        cVar2 = FUN_1400a8b50(puVar6);
        if (((cVar2 == '\0') ||
            (lVar4 = FUN_140169e30(*(undefined8 *)(param_1 + 0x108)),
            *(char *)(lVar4 + 0x80) != '\0')) ||
           (lVar4 = FUN_140169e30(*(undefined8 *)(param_1 + 0x108)), *(char *)(lVar4 + 0xc0) != '\0'
           )) {
          uVar8 = 2;
          goto LAB_1401aaf83;
        }
      }
    }
    lVar4 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
    if (lVar4 != 0) {
      lVar4 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
      if ((*(longlong **)(lVar4 + 0x128) != (longlong *)0x0) &&
         (**(longlong **)(lVar4 + 0x128) != 0)) {
        lVar4 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
        puVar6 = puVar7;
        if (*(undefined8 **)(lVar4 + 0x128) != (undefined8 *)0x0) {
          puVar6 = (undefined *)**(undefined8 **)(lVar4 + 0x128);
        }
        cVar2 = FUN_1400a8b50(puVar6);
        if (((cVar2 == '\0') ||
            (lVar4 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108)),
            *(char *)(lVar4 + 0x80) != '\0')) ||
           (lVar4 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108)), *(char *)(lVar4 + 0xc0) != '\0'
           )) {
          uVar8 = 3;
          goto LAB_1401aaf83;
        }
      }
    }
    cVar2 = FUN_1400ad850(*(longlong *)(param_1 + 0x108) + 0x1620);
    if (cVar2 == '\0') {
      FUN_1400ad750(*(longlong *)(param_1 + 0x108) + 0x1620);
    }
    FUN_140180680(*(undefined8 *)(param_1 + 0x108),0);
    if (*(int *)(param_1 + 0x100) < 5) {
      *(undefined4 *)(param_1 + 0x40) = 0;
      *(undefined4 *)(param_1 + 0x100) = 5;
      uVar5 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
      *(undefined8 *)(param_1 + 0x80) = uVar5;
      *(undefined1 *)(param_1 + 0xc0) = 0;
    }
  }
  else {
LAB_1401aaf83:
    dVar9 = (double)(**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
    if ((5.0 < dVar9 - *(double *)(param_1 + 0x80)) && (*(char *)(param_1 + 0xc0) == '\0')) {
      FUN_1400a3440();
      local_res18 = PTR_DAT_1402f8010;
      FUN_14003c600(&local_res18,
                    L"Too long time elapsed since disconnecting mode! unsafeDisconnectReason=%d",
                    uVar8);
      FUN_1400a3440();
      puVar6 = local_res18;
      local_res10 = PTR_DAT_1402f8010;
      if (PTR_DAT_1402f8010 == (undefined *)0x0) {
        local_res10 = puVar7;
      }
      if (local_res18 != PTR_DAT_1402f8010) {
        uVar5 = FUN_1400a3440();
        FUN_1400a1c30(uVar5);
        FUN_1400031d0(&local_res10);
        local_res10 = puVar6;
        if (((puVar6 != PTR_DAT_1402f8010) && (puVar6 != (undefined *)0x0)) &&
           (puVar6 != (undefined *)0x8)) {
          *(int *)(puVar6 + -4) = *(int *)(puVar6 + -4) + 1;
        }
        FUN_1400d1290(uVar5);
      }
      FUN_1400a6370(&local_res10);
      *(undefined1 *)(param_1 + 0xc0) = 1;
      if (((puVar6 != (undefined *)0x0) && (puVar6 != PTR_DAT_1402f8010)) &&
         (puVar6 + -8 != (undefined *)0x0)) {
        uVar5 = FUN_1400a3440();
        FUN_1400a1c30(uVar5);
        piVar1 = (int *)(puVar6 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar6 + -8);
        }
        FUN_1400d1290(uVar5);
      }
    }
  }
  FUN_1400d1290(uVar3);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401ab160(longlong param_1,longlong param_2)

{
  undefined8 *puVar1;
  char cVar2;
  undefined8 uVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong lVar6;
  undefined1 auStack_da8 [32];
  longlong *local_d88;
  undefined8 local_d80;
  undefined4 uStack_d78;
  undefined4 uStack_d74;
  undefined1 local_d70 [8];
  longlong local_d68;
  longlong local_d60;
  undefined4 local_d58;
  int local_d54;
  undefined8 local_d48;
  undefined1 local_d40;
  undefined **local_d38;
  undefined4 local_d30;
  undefined2 local_d2c;
  undefined4 local_d28 [2];
  undefined8 local_d20;
  undefined1 local_d18;
  undefined4 local_d14;
  undefined1 local_d10;
  undefined1 local_d0f;
  undefined8 local_d08;
  undefined1 local_d00 [72];
  undefined4 local_cb8;
  undefined4 uStack_cb4;
  undefined4 uStack_cb0;
  undefined4 uStack_cac;
  undefined4 *local_38;
  undefined4 local_30;
  int local_2c;
  ulonglong local_28;
  
  local_d08 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_da8;
  cVar2 = FUN_140185490(param_2,&local_d80,8);
  if (cVar2 != '\0') {
    uVar3 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
    local_d48 = uVar3;
    FUN_1400a1c30(uVar3);
    local_d40 = 1;
    local_d38 = Proud::AddrPort::vftable;
    local_d30 = *(undefined4 *)(param_2 + 0x38);
    local_d2c = *(undefined2 *)(param_2 + 0x3c);
    plVar4 = (longlong *)FUN_140173ea0(*(undefined8 *)(param_1 + 0x108),&local_d88,&local_d38);
    lVar6 = 0;
    if ((longlong *)*plVar4 != (longlong *)0x0) {
      lVar6 = *(longlong *)*plVar4;
    }
    if ((local_d88 != (longlong *)0x0) &&
       (local_d88[1] = local_d88[1] + -1, uVar3 = local_d48, local_d88[1] == 0)) {
      puVar1 = (undefined8 *)*local_d88;
      if (puVar1 != (undefined8 *)0x0) {
        (**(code **)*puVar1)(puVar1,1);
      }
      FUN_1400a3530(local_d88);
      uVar3 = local_d48;
    }
    if ((lVar6 != 0) && (*(int *)(lVar6 + 0x56c) != 1)) {
      FUN_140185560(local_d70);
      FUN_140185030(local_d70);
      FUN_1401856c0(local_d70,0x800);
      FUN_1401856c0(local_d70,0);
      FUN_14003c9e0(local_d70,0x21);
      FUN_14007c8a0(local_d70,local_d80);
      local_2c = 200;
      local_30 = 0;
      local_38 = &local_cb8;
      if (local_d68 == 0) {
        uStack_d78 = local_d58;
        if (local_d60 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
      }
      else {
        uStack_d78 = *(undefined4 *)(local_d68 + 0x18);
      }
      lVar5 = local_d60;
      if (local_d60 == 0) {
        if (local_d68 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        lVar5 = 0;
        if (*(int *)(local_d68 + 0x18) != 0) {
          lVar5 = *(longlong *)(local_d68 + 0x10);
        }
      }
      local_30 = 1;
      local_d80._0_4_ = (undefined4)lVar5;
      local_d80._4_4_ = (undefined4)((ulonglong)lVar5 >> 0x20);
      local_cb8 = (undefined4)local_d80;
      uStack_cb4 = local_d80._4_4_;
      uStack_cac = uStack_d74;
      local_d28[0] = 0;
      local_d20 = 0;
      local_d18 = 1;
      local_d14 = 0xffffffff;
      local_d10 = 1;
      local_d0f = DAT_1402f81cc;
      local_d80 = (longlong *)lVar5;
      uStack_cb0 = uStack_d78;
      FUN_1401b8a90(lVar6 + 0x668,&local_cb8,local_d28);
      if (local_38 == (undefined4 *)0x0) {
        FUN_1400a2320(local_d00,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_d00,(ThrowInfo *)&DAT_1402f4860);
      }
      if (local_2c < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_30 = 0;
      local_d80 = &local_d68;
      FUN_14019a730(&local_d68);
      if (local_d60 != 0) {
        if (local_d54 < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        local_d58 = 0;
      }
    }
    FUN_1400d1290(uVar3);
  }
  return;
}



void FUN_1401ab410(longlong param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  undefined8 *puVar2;
  undefined2 uVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  longlong *plVar6;
  int *piVar7;
  longlong lVar8;
  undefined ***pppuVar9;
  double dVar10;
  undefined8 uVar11;
  undefined4 uVar12;
  undefined4 uVar13;
  longlong *local_res10;
  undefined1 local_d8 [8];
  longlong local_d0;
  longlong local_c8;
  int local_bc;
  undefined **local_b0;
  undefined4 local_a8;
  undefined2 local_a4;
  undefined **local_a0;
  undefined4 local_98;
  undefined2 local_94;
  undefined **local_90;
  undefined4 local_88;
  undefined2 local_84;
  int local_80 [2];
  undefined8 local_78;
  undefined1 local_70;
  undefined4 local_6c;
  undefined1 local_68;
  undefined1 local_67;
  int local_60 [2];
  undefined8 local_58;
  undefined1 local_50;
  undefined4 local_4c;
  undefined1 local_48;
  undefined1 local_47;
  undefined8 local_40;
  
  if (param_2 == 0) {
    return;
  }
  local_40 = 0xfffffffffffffffe;
  local_a0 = Proud::AddrPort::vftable;
  local_98 = *(undefined4 *)(param_3 + 0x38);
  local_94 = *(undefined2 *)(param_3 + 0x3c);
  dVar10 = (double)FUN_14019cbe0(*(undefined8 *)(param_2 + 0x188),&local_a0);
  if (dVar10 <= 0.0) {
    return;
  }
  FUN_140185560(local_d8);
  FUN_140185030(local_d8);
  FUN_1401856c0(local_d8,0x800);
  FUN_1401856c0(local_d8,0);
  FUN_14003c9e0(local_d8,0x28);
  FUN_14007c8a0(local_d8,dVar10);
  iVar1 = *(int *)(param_3 + 0x28);
  if (iVar1 == 1) {
    lVar8 = 0;
    local_78 = 0;
    local_70 = 1;
    local_6c = 0xffffffff;
    local_68 = 1;
    local_67 = DAT_1402f81cc;
    plVar6 = *(longlong **)(*(longlong *)(param_1 + 0x108) + 0x1570);
    if (plVar6 != (longlong *)0x0) {
      lVar8 = *plVar6;
    }
    local_90 = Proud::AddrPort::vftable;
    local_88 = *(undefined4 *)(lVar8 + 0xd0);
    local_84 = *(undefined2 *)(lVar8 + 0xd4);
    plVar6 = *(longlong **)(param_1 + 0x108);
    local_80[0] = iVar1;
    uVar11 = (**(code **)(plVar6[0xe] + 0x1c0))();
    uVar12 = (undefined4)uVar11;
    uVar13 = (undefined4)((ulonglong)uVar11 >> 0x20);
    uVar4 = (**(code **)(*plVar6 + 0x30))(plVar6);
    uVar3 = FUN_14019c290(uVar4,1);
    uVar11 = FUN_140169e30(*(undefined8 *)(param_1 + 0x108));
    piVar7 = local_80;
    pppuVar9 = &local_90;
    uVar4 = 1;
  }
  else {
    if (iVar1 == 0) goto LAB_1401ab696;
    plVar6 = (longlong *)FUN_1401755f0(*(undefined8 *)(param_1 + 0x108),&local_res10);
    lVar8 = 0;
    if ((longlong *)*plVar6 != (longlong *)0x0) {
      lVar8 = *(longlong *)*plVar6;
    }
    if ((local_res10 != (longlong *)0x0) &&
       (local_res10[1] = local_res10[1] + -1, local_res10[1] == 0)) {
      puVar2 = (undefined8 *)*local_res10;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      FUN_1400a3530(local_res10);
    }
    if ((*(longlong **)(lVar8 + 0x18) == (longlong *)0x0) || (**(longlong **)(lVar8 + 0x18) == 0))
    goto LAB_1401ab696;
    local_60[0] = 1;
    local_58 = 0;
    local_50 = 1;
    local_4c = 0xffffffff;
    local_48 = 1;
    local_47 = DAT_1402f81cc;
    local_b0 = Proud::AddrPort::vftable;
    local_a8 = *(undefined4 *)(lVar8 + 0x598);
    local_a4 = *(undefined2 *)(lVar8 + 0x59c);
    uVar4 = *(undefined4 *)(param_3 + 0x28);
    plVar6 = *(longlong **)(param_1 + 0x108);
    uVar11 = (**(code **)(plVar6[0xe] + 0x1c0))();
    uVar12 = (undefined4)uVar11;
    uVar13 = (undefined4)((ulonglong)uVar11 >> 0x20);
    uVar5 = (**(code **)(*plVar6 + 0x30))(plVar6);
    uVar3 = FUN_14019c290(uVar5,uVar4);
    uVar11 = FUN_1401b8a70(lVar8);
    piVar7 = local_60;
    pppuVar9 = &local_b0;
  }
  FUN_1401bc9b0(uVar11,uVar4,uVar3,pppuVar9,local_d8,CONCAT44(uVar13,uVar12),piVar7);
LAB_1401ab696:
  local_res10 = &local_d0;
  FUN_14019a730(&local_d0);
  if ((local_c8 != 0) && (local_bc < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



void FUN_1401ab6e0(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  undefined *local_res8;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  FUN_1400a1c30();
  if (*(int *)(param_2 + 0x100) != 5) {
    FUN_1400a3440();
    local_res8 = PTR_DAT_1402f8010;
    uVar1 = FUN_1400a32c0(L"Unexpected at CNetClientManager::Unregister");
    uVar2 = FUN_140002f20(&local_res8,uVar1);
    FUN_1400a32f0(uVar2,L"Unexpected at CNetClientManager::Unregister",uVar1,param_4,uVar3);
    FUN_140003000(&local_res8);
    FUN_1400a6370(&local_res8);
  }
  if (*(longlong *)(param_2 + 0x10) != 0) {
    FUN_1401a8990(*(longlong *)(param_2 + 0x10),param_2);
  }
  FUN_1400d1290(param_1 + 0x10);
  return;
}



void FUN_1401ab790(longlong param_1,char param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  longlong *local_res8;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar6 = param_1 + 0x10;
  lVar9 = lVar6;
  FUN_1400a1c30(lVar6);
  uVar10 = 1;
  plVar1 = (longlong *)(param_1 + 0x290);
  plVar2 = (longlong *)*plVar1;
  if (((plVar2 == (longlong *)0x0) || (*plVar2 == 0)) && (param_2 != '\0')) {
    local_res8 = operator_new(0x3c0);
    lVar7 = 0;
    lVar5 = lVar7;
    if (local_res8 != (longlong *)0x0) {
      lVar5 = FUN_1401c5680(local_res8,param_1 + 8,param_3,param_4,uVar8,lVar9,uVar10);
    }
    if (lVar5 == 0) {
      local_res8 = (longlong *)0x0;
    }
    else {
      local_res8 = (longlong *)FUN_1400a34c0(0x10);
      local_res8[1] = 1;
      *local_res8 = lVar5;
    }
    plVar2 = local_res8;
    FUN_14016b650(plVar1,&local_res8);
    plVar4 = local_res8;
    if (plVar2 != (longlong *)0x0) {
      plVar2 = plVar2 + 1;
      *plVar2 = *plVar2 + -1;
      lVar6 = lVar9;
      if (*plVar2 == 0) {
        puVar3 = (undefined8 *)*local_res8;
        if (puVar3 != (undefined8 *)0x0) {
          (**(code **)*puVar3)(puVar3,1);
          lVar6 = lVar9;
        }
        FUN_1400a3530(plVar4);
      }
    }
    if ((longlong *)*plVar1 != (longlong *)0x0) {
      lVar7 = *(longlong *)*plVar1;
    }
    FUN_1401c5240(lVar7);
  }
  else if (((plVar2 != (longlong *)0x0) && (*plVar2 != 0)) && (param_2 == '\0')) {
    FUN_1401c51e0();
  }
  FUN_1400d1290(lVar6);
  return;
}



undefined8 * FUN_1401ab8d0(longlong *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  
  plVar1 = (longlong *)*param_1;
  if (plVar1 == (longlong *)0x0) {
    puVar2 = (undefined8 *)FUN_1400a34c0(0x58);
  }
  else {
    puVar2 = (undefined8 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x58,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar2 != (undefined8 *)0x0) {
    FUN_140185590(puVar2 + 2,param_2);
    *(undefined4 *)(puVar2 + 7) = *(undefined4 *)(param_2 + 0x28);
    puVar2[8] = Proud::AddrPort::vftable;
    *(undefined4 *)(puVar2 + 9) = *(undefined4 *)(param_2 + 0x38);
    *(undefined2 *)((longlong)puVar2 + 0x4c) = *(undefined2 *)(param_2 + 0x3c);
    *(undefined1 *)(puVar2 + 10) = *(undefined1 *)(param_2 + 0x40);
  }
  puVar2[1] = param_3;
  *puVar2 = param_4;
  param_1[3] = param_1[3] + 1;
  return puVar2;
}



undefined8 FUN_1401ab980(longlong param_1,undefined8 param_2,longlong param_3)

{
  undefined8 *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  char cVar4;
  undefined2 uVar5;
  undefined4 uVar6;
  longlong *plVar7;
  undefined8 uVar8;
  longlong lVar9;
  longlong *plVar10;
  longlong *plVar11;
  longlong *plVar12;
  int iVar13;
  longlong *plVar14;
  int iVar15;
  uint uVar16;
  longlong *plVar17;
  undefined8 uVar18;
  undefined4 local_res18 [2];
  longlong *local_res20;
  undefined1 local_178 [4];
  undefined4 local_174;
  longlong local_170;
  longlong local_168;
  undefined4 local_160;
  int local_15c;
  undefined **local_150;
  undefined8 local_148;
  longlong *local_140;
  ulonglong local_138;
  undefined8 local_130;
  undefined **local_128;
  longlong *local_120;
  longlong *local_118;
  undefined8 local_110;
  undefined8 local_108;
  int *local_100;
  undefined1 local_f8 [4];
  undefined4 local_f4;
  longlong local_f0;
  longlong local_e8;
  undefined4 local_e0;
  int local_dc;
  undefined4 local_d0;
  undefined **local_c8;
  undefined4 local_c0;
  undefined2 local_bc;
  undefined1 local_b8;
  undefined **local_a8;
  undefined4 local_a0;
  undefined2 local_9c;
  undefined8 local_98;
  ulonglong local_90;
  ulonglong local_88;
  undefined4 local_80 [2];
  undefined8 local_78;
  undefined1 local_70;
  undefined4 local_6c;
  undefined1 local_68;
  undefined1 local_67;
  undefined8 local_60;
  
  local_60 = 0xfffffffffffffffe;
  if (*(int *)(param_3 + 0x28) != 1) {
    return 0;
  }
  cVar4 = FUN_140185cc0(param_3,local_res18);
  if (cVar4 == '\0') {
    return 0;
  }
  cVar4 = FUN_140185b30(param_3,&local_98);
  if (cVar4 == '\0') {
    return 0;
  }
  plVar12 = (longlong *)0x0;
  local_120 = (longlong *)0x0;
  local_118 = (longlong *)0x0;
  local_110 = 0;
  local_108 = 0;
  local_128 = Proud::HostIDArray::vftable;
  cVar4 = FUN_140185b30(param_3,&local_90);
  plVar11 = plVar12;
  plVar10 = plVar12;
  if (((cVar4 != '\0') && (iVar13 = (int)local_90, plVar11 = (longlong *)0x0, -1 < iVar13)) &&
     (iVar13 <= DAT_1402f8140)) {
    FUN_140143980(&local_128,local_90 & 0xffffffff);
    plVar11 = local_118;
    iVar15 = (int)local_110;
    plVar10 = local_118;
    if ((int)local_110 == 0) {
      plVar10 = plVar12;
    }
    cVar4 = FUN_140185490(param_3,plVar10,iVar13 * 4);
    plVar10 = local_120;
    if (cVar4 != '\0') {
      local_148 = 0;
      local_140 = (longlong *)0x0;
      local_138 = 0;
      local_130 = 0;
      local_150 = Proud::ByteArray::vftable;
      cVar4 = FUN_140185b30(param_3,&local_88);
      if (((cVar4 != '\0') && (-1 < (int)local_88)) && ((int)local_88 <= DAT_1402f8140)) {
        FUN_14003cda0(&local_150,local_88 & 0xffffffff);
        plVar10 = local_140;
        if ((int)local_138 == 0) {
          plVar10 = plVar12;
        }
        cVar4 = FUN_140185490(param_3,plVar10,local_88 & 0xffffffff);
        if (cVar4 != '\0') {
          FUN_140185560(local_178);
          FUN_140185030(local_178);
          FUN_1401856c0(local_178,0x800);
          FUN_1401856c0(local_178,0);
          FUN_14003c9e0(local_178,0x23);
          uVar3 = local_138;
          iVar13 = (int)local_138;
          FUN_140186930(local_178,(longlong)(int)local_138);
          plVar10 = local_140;
          if ((int)local_138 == 0) {
            plVar10 = plVar12;
          }
          if (iVar13 != 0) {
            local_174 = 0;
            if (local_170 == 0) {
              if (local_168 == 0) {
                    // WARNING: Subroutine does not return
                FUN_14019a830(0,plVar10);
              }
LAB_1401abb6e:
              FUN_14003cc90(&local_168,plVar10,uVar3 & 0xffffffff);
            }
            else {
              if (local_168 != 0) goto LAB_1401abb6e;
              if (local_170 == 0) {
                    // WARNING: Subroutine does not return
                FUN_14019a830(0,plVar10);
              }
              FUN_14003ce60(local_170,plVar10,uVar3 & 0xffffffff);
            }
            FUN_14003ced0(local_178);
          }
          local_70 = DAT_140318d80;
          local_6c = 0xffffffff;
          local_68 = DAT_140318da0;
          local_80[0] = local_res18[0];
          local_78 = local_98;
          local_67 = 0;
          plVar10 = plVar12;
          plVar17 = plVar12;
          if (0 < iVar15) {
            do {
              if (((longlong)plVar17 < 0) || (iVar15 <= (int)plVar10)) {
                    // WARNING: Subroutine does not return
                FUN_1400a2700();
              }
              local_100 = (int *)((longlong)plVar11 + (longlong)plVar17 * 4);
              if (*local_100 != *(int *)(*(longlong *)(param_1 + 0x108) + 0x1578)) {
                plVar7 = (longlong *)
                         FUN_1401755f0(*(longlong *)(param_1 + 0x108),&local_res20,*local_100);
                plVar2 = local_res20;
                plVar14 = plVar12;
                if ((undefined8 *)*plVar7 != (undefined8 *)0x0) {
                  plVar14 = *(longlong **)*plVar7;
                }
                if (local_res20 != (longlong *)0x0) {
                  local_res20[1] = local_res20[1] + -1;
                  if (local_res20[1] == 0) {
                    puVar1 = (undefined8 *)*local_res20;
                    if (puVar1 != (undefined8 *)0x0) {
                      (**(code **)*puVar1)(puVar1,1);
                    }
                    FUN_1400a3530(plVar2);
                  }
                  plVar11 = local_118;
                  iVar15 = (int)local_110;
                }
                if ((((plVar14 != (longlong *)0x0) && (*(char *)((longlong)plVar14 + 0x684) == '\0')
                     ) && ((char)plVar14[0xc1] != '\x01')) &&
                   (((longlong *)plVar14[3] != (longlong *)0x0 && (*(longlong *)plVar14[3] != 0))))
                {
                  local_a8 = Proud::AddrPort::vftable;
                  local_a0 = (undefined4)plVar14[0xb3];
                  local_9c = *(undefined2 *)((longlong)plVar14 + 0x59c);
                  plVar2 = *(longlong **)(param_1 + 0x108);
                  uVar18 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0
                                       ))();
                  uVar6 = (**(code **)(*plVar2 + 0x30))(plVar2);
                  uVar5 = FUN_14019c290(uVar6,*local_100);
                  uVar8 = FUN_1401b8a70(plVar14);
                  FUN_1401bc9b0(uVar8,*local_100,uVar5,&local_a8,local_178,uVar18,local_80);
                }
              }
              uVar16 = (int)plVar10 + 1;
              plVar10 = (longlong *)(ulonglong)uVar16;
              plVar17 = (longlong *)((longlong)plVar17 + 1);
            } while ((int)uVar16 < iVar15);
          }
          FUN_140185560(local_f8);
          local_c8 = Proud::AddrPort::vftable;
          local_b8 = 0;
          local_c0 = DAT_1402f83d0;
          local_bc = DAT_1402f83d4;
          local_d0 = 1;
          FUN_140185030(local_f8);
          if ((int)local_138 < 1) {
                    // WARNING: Subroutine does not return
            FUN_1400a2700();
          }
          local_f4 = 0;
          if (local_f0 == 0) {
            if (local_e8 == 0) {
                    // WARNING: Subroutine does not return
              FUN_14019a830();
            }
          }
          else if (local_e8 == 0) {
            if (local_f0 == 0) {
                    // WARNING: Subroutine does not return
              FUN_14019a830();
            }
            FUN_14003ce60(local_f0,local_140);
            goto LAB_1401abdf9;
          }
          FUN_14003cc90(&local_e8,local_140);
LAB_1401abdf9:
          FUN_14003ced0(local_f8);
          FUN_1401af9b0(param_1,param_2,local_f8);
          local_res20 = &local_f0;
          FUN_14019a730(&local_f0);
          if (local_e8 != 0) {
            if (local_dc < 0) {
                    // WARNING: Subroutine does not return
              FUN_1400a26d0();
            }
            local_e0 = 0;
          }
          local_res20 = &local_170;
          FUN_14019a730(&local_170);
          if (local_168 != 0) {
            if (local_15c < 0) {
                    // WARNING: Subroutine does not return
              FUN_1400a26d0();
            }
            local_160 = 0;
          }
          FUN_140140df0(&local_150);
          if (plVar11 != (longlong *)0x0) {
            if (local_120 == (longlong *)0x0) {
              FUN_1400a3530(plVar11);
            }
            else {
              (**(code **)(*local_120 + 0x18))(local_120,plVar11);
            }
          }
          return 1;
        }
      }
      FUN_140140df0(&local_150);
      if (plVar11 == (longlong *)0x0) {
        return 0;
      }
      if (local_120 == (longlong *)0x0) goto LAB_1401abee3;
      lVar9 = *local_120;
      plVar10 = local_120;
      goto LAB_1401abedb;
    }
  }
  if (plVar11 == (longlong *)0x0) {
    return 0;
  }
  if (plVar10 == (longlong *)0x0) {
LAB_1401abee3:
    FUN_1400a3530(plVar11);
    return 0;
  }
  lVar9 = *plVar10;
LAB_1401abedb:
  (**(code **)(lVar9 + 0x18))(plVar10,plVar11);
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401abf10(undefined *param_1,int *param_2)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  longlong lVar4;
  undefined *puVar5;
  longlong *plVar6;
  ulonglong uVar7;
  char cVar8;
  undefined8 uVar9;
  undefined8 uVar10;
  undefined1 auStack_ec8 [32];
  undefined1 local_ea8 [8];
  undefined *local_ea0;
  undefined1 local_e98 [4];
  undefined4 local_e94;
  longlong local_e90;
  longlong local_e88;
  undefined4 local_e80;
  int local_e7c;
  undefined *local_e70;
  undefined *local_e68;
  undefined *local_e60;
  undefined **local_e58;
  undefined8 local_e50;
  undefined8 local_e48;
  undefined8 local_e40;
  undefined8 local_e38;
  undefined **local_e30;
  undefined8 local_e28;
  undefined8 local_e20;
  undefined8 local_e18;
  undefined8 local_e10;
  undefined **local_e08;
  undefined8 local_e00;
  undefined8 local_df8;
  undefined8 local_df0;
  undefined8 local_de8;
  longlong *local_dd0;
  undefined **local_dc8;
  undefined8 local_dc0;
  undefined8 local_db8;
  ulonglong local_db0;
  undefined8 local_da8;
  undefined **local_da0;
  undefined8 local_d98;
  undefined8 local_d90;
  ulonglong local_d88;
  undefined8 local_d80;
  undefined8 local_d78;
  undefined1 local_d70;
  undefined8 local_d68;
  undefined1 local_d60;
  undefined8 local_d58;
  undefined1 local_d50;
  undefined4 local_d48;
  int iStack_d44;
  undefined8 local_d40;
  undefined8 local_d38;
  undefined8 local_d30;
  undefined8 local_d28;
  undefined8 local_d20;
  undefined8 local_d18;
  undefined1 local_d10;
  undefined8 local_d08;
  undefined1 local_d00;
  undefined8 local_ce0;
  undefined1 local_cb8 [3216];
  ulonglong local_28;
  
  local_ce0 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_ec8;
  local_ea0 = param_1;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
  cVar8 = FUN_140185490(param_2,local_ea8,1);
  if (cVar8 == '\0') {
    FUN_1400a3440();
    local_e70 = PTR_DAT_1402f8010;
    FUN_140182b30(*(undefined8 *)(param_1 + 0x108),8,3,&local_e70);
    puVar5 = local_e70;
    if (((local_e70 != (undefined *)0x0) && (local_e70 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_e70 + -8, puVar1 != (undefined *)0x0)) {
      uVar9 = FUN_1400a3440();
      local_d68 = uVar9;
      FUN_1400a1c30(uVar9);
      local_d60 = 1;
      piVar2 = (int *)(puVar5 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar9);
      local_d60 = 0;
    }
    local_e70 = PTR_DAT_1402f8010;
LAB_1401ac00e:
    if (*(int *)(param_1 + 0x100) < 4) {
      *(undefined4 *)(param_1 + 0x40) = 0;
      *(undefined4 *)(param_1 + 0x100) = 4;
      uVar9 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
      *(undefined8 *)(param_1 + 0x80) = uVar9;
      param_1[0xc0] = 0;
    }
    return;
  }
  FUN_1401a7a10(&local_d48);
  cVar8 = FUN_140185fa0(param_2,&local_d48);
  if (cVar8 == '\0') {
    FUN_1400a3440();
    local_e60 = PTR_DAT_1402f8010;
    FUN_140182b30(*(undefined8 *)(param_1 + 0x108),8,3,&local_e60);
    puVar5 = local_e60;
    if (((local_e60 != (undefined *)0x0) && (local_e60 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_e60 + -8, puVar1 != (undefined *)0x0)) {
      uVar9 = FUN_1400a3440();
      local_d78 = uVar9;
      FUN_1400a1c30(uVar9);
      local_d70 = 1;
      piVar2 = (int *)(puVar5 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar9);
      local_d70 = 0;
    }
    local_e60 = PTR_DAT_1402f8010;
    goto LAB_1401ac00e;
  }
  lVar4 = *(longlong *)(param_1 + 0x108);
  *(ulonglong *)(lVar4 + 0x6a0) = CONCAT44(iStack_d44,local_d48);
  *(undefined8 *)(lVar4 + 0x6a8) = local_d40;
  *(undefined8 *)(lVar4 + 0x6b0) = local_d38;
  *(undefined8 *)(lVar4 + 0x6b8) = local_d30;
  *(undefined8 *)(lVar4 + 0x6c0) = local_d28;
  *(undefined8 *)(lVar4 + 0x6c8) = local_d20;
  if (*(char *)(*(longlong *)(param_1 + 0x108) + 0x6cc) != '\0') {
    uVar9 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
    *(undefined8 *)(*(longlong *)(param_1 + 0x108) + 0x638) = uVar9;
  }
  uVar9 = 0;
  local_e00 = 0;
  local_df8 = 0;
  local_df0 = 0;
  local_de8 = 0;
  local_e08 = Proud::ByteArray::vftable;
  cVar8 = FUN_140185b30(param_2,&local_dd0);
  plVar6 = local_dd0;
  if (((cVar8 != '\0') && (-1 < (int)local_dd0)) && ((int)local_dd0 <= DAT_1402f8140)) {
    FUN_14003cda0(&local_e08,(ulonglong)local_dd0 & 0xffffffff);
    uVar10 = local_df8;
    if ((int)local_df0 == 0) {
      uVar10 = uVar9;
    }
    cVar8 = FUN_140185490(param_2,uVar10,(ulonglong)plVar6 & 0xffffffff);
    if (cVar8 != '\0') {
      local_e50 = 0;
      local_e48 = 0;
      local_e40 = 0;
      local_e38 = 0;
      local_e58 = Proud::ByteArray::vftable;
      local_e28 = 0;
      local_e20 = 0;
      local_e18 = 0;
      local_e10 = 0;
      local_e30 = Proud::ByteArray::vftable;
      FUN_1401a6030(&local_e58,*(undefined4 *)(*(longlong *)(param_1 + 0x108) + 0x6bc));
      uVar10 = local_e48;
      if ((int)local_e40 == 0) {
        uVar10 = uVar9;
      }
      FUN_140195fe0(*(longlong *)(param_1 + 0x108) + 0xd8,uVar10,
                    *(uint *)(*(longlong *)(param_1 + 0x108) + 0x6bc) >> 3,0x10);
      FUN_1401a6030(&local_e30,*(undefined4 *)(*(longlong *)(param_1 + 0x108) + 0x6c0));
      uVar10 = local_e20;
      if ((int)local_e18 == 0) {
        uVar10 = uVar9;
      }
      FUN_1401a5720(*(longlong *)(param_1 + 0x108) + 0x4a8,uVar10,
                    *(uint *)(*(longlong *)(param_1 + 0x108) + 0x6c0) >> 3);
      uVar10 = FUN_1400a3610();
      FUN_1400a1c30(uVar10);
      if (iStack_d44 < DAT_1402f8140) {
        iStack_d44 = DAT_1402f8140;
      }
      DAT_1402f8140 = iStack_d44;
      FUN_1400d1290(uVar10);
      if (*(longlong *)(param_2 + 2) == 0) {
        if (*(longlong *)(param_2 + 4) == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        iVar3 = param_2[6];
      }
      else {
        iVar3 = *(int *)(*(longlong *)(param_2 + 2) + 0x18);
      }
      if ((int)(*param_2 + (*param_2 >> 0x1f & 7U)) >> 3 != iVar3) {
        FUN_1400a3440();
        local_ea0 = PTR_DAT_1402f8010;
        FUN_140182b30(*(undefined8 *)(param_1 + 0x108),8,3,&local_ea0);
        puVar5 = local_ea0;
        if (((local_ea0 != (undefined *)0x0) && (local_ea0 != PTR_DAT_1402f8010)) &&
           (puVar1 = local_ea0 + -8, puVar1 != (undefined *)0x0)) {
          uVar9 = FUN_1400a3440();
          local_d08 = uVar9;
          FUN_1400a1c30(uVar9);
          local_d00 = 1;
          piVar2 = (int *)(puVar5 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_1400a3530(puVar1);
          }
          FUN_1400d1290(uVar9);
        }
        FUN_1401a8930(param_1,4);
        FUN_140140df0(&local_e30);
        FUN_140140df0(&local_e58);
        goto LAB_1401ac8a7;
      }
      *(undefined1 *)(*(longlong *)(param_1 + 0x108) + 0x1790) = local_ea8[0];
      lVar4 = *(longlong *)(param_1 + 0x108);
      uVar10 = FUN_140169e50(lVar4);
      FUN_1401b8090(uVar10,*(undefined1 *)(lVar4 + 0x6b8));
      local_dc0 = 0;
      local_db8 = 0;
      local_db0 = 0;
      local_da8 = 0;
      local_dc8 = Proud::ByteArray::vftable;
      local_d98 = 0;
      local_d90 = 0;
      local_d88 = 0;
      local_d80 = 0;
      local_da0 = Proud::ByteArray::vftable;
      FUN_1401a6030(&local_e58,*(undefined4 *)(*(longlong *)(param_1 + 0x108) + 0x6bc));
      uVar10 = local_e48;
      if ((int)local_e40 == 0) {
        uVar10 = uVar9;
      }
      FUN_140195fe0(*(longlong *)(param_1 + 0x108) + 0x708,uVar10,
                    *(uint *)(*(longlong *)(param_1 + 0x108) + 0x6bc) >> 3,0x10);
      FUN_1401a61f0(&local_dc8,&local_e58,&local_e08);
      FUN_1401a6030(&local_e30,*(undefined4 *)(*(longlong *)(param_1 + 0x108) + 0x6c0));
      uVar10 = local_e20;
      if ((int)local_e18 == 0) {
        uVar10 = uVar9;
      }
      FUN_1401a5720(*(longlong *)(param_1 + 0x108) + 0xad8,uVar10,
                    *(uint *)(*(longlong *)(param_1 + 0x108) + 0x6c0) >> 3);
      FUN_1401980a0(&local_e30,&local_da0,*(longlong *)(param_1 + 0x108) + 0x708);
      FUN_140185560(local_e98);
      FUN_140185030(local_e98);
      FUN_1401856c0(local_e98,0x800);
      FUN_1401856c0(local_e98,0);
      FUN_14003c9e0(local_e98,5);
      uVar7 = local_db0;
      iVar3 = (int)local_db0;
      FUN_140186930(local_e98,(longlong)(int)local_db0);
      uVar10 = local_db8;
      if ((int)local_db0 == 0) {
        uVar10 = uVar9;
      }
      if (iVar3 != 0) {
        local_e94 = 0;
        if (local_e90 == 0) {
          if (local_e88 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14019a830(0,uVar10);
          }
LAB_1401ac612:
          FUN_14003cc90(&local_e88,uVar10,uVar7 & 0xffffffff);
        }
        else {
          if (local_e88 != 0) goto LAB_1401ac612;
          if (local_e90 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14019a830(0,uVar10);
          }
          FUN_14003ce60(local_e90,uVar10,uVar7 & 0xffffffff);
        }
        FUN_14003ced0(local_e98);
      }
      uVar7 = local_d88;
      iVar3 = (int)local_d88;
      FUN_140186930(local_e98,(longlong)(int)local_d88);
      uVar10 = local_d90;
      if ((int)local_d88 == 0) {
        uVar10 = uVar9;
      }
      if (iVar3 != 0) {
        local_e94 = 0;
        if (local_e90 == 0) {
          if (local_e88 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14019a830(0,uVar10);
          }
LAB_1401ac690:
          FUN_14003cc90(&local_e88,uVar10,uVar7 & 0xffffffff);
        }
        else {
          if (local_e88 != 0) goto LAB_1401ac690;
          if (local_e90 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14019a830(0,uVar10);
          }
          FUN_14003ce60(local_e90,uVar10,uVar7 & 0xffffffff);
        }
        FUN_14003ced0(local_e98);
      }
      uVar9 = FUN_140146970(local_cb8,local_e98);
      local_d58 = 0;
      local_d50 = 1;
      uVar10 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
      FUN_1401b82c0(uVar10,uVar9,&local_d58);
      FUN_140145b60(local_cb8);
      local_dd0 = &local_e90;
      FUN_14019a730(&local_e90);
      if (local_e88 != 0) {
        if (local_e7c < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        local_e80 = 0;
      }
      FUN_140140df0(&local_da0);
      FUN_140140df0(&local_dc8);
      FUN_140140df0(&local_e30);
      FUN_140140df0(&local_e58);
      goto LAB_1401ac8a7;
    }
  }
  FUN_1400a3440();
  local_e68 = PTR_DAT_1402f8010;
  FUN_140182b30(*(undefined8 *)(param_1 + 0x108),8,3,&local_e68);
  puVar5 = local_e68;
  if (((local_e68 != (undefined *)0x0) && (local_e68 != PTR_DAT_1402f8010)) &&
     (puVar1 = local_e68 + -8, puVar1 != (undefined *)0x0)) {
    uVar9 = FUN_1400a3440();
    local_d18 = uVar9;
    FUN_1400a1c30(uVar9);
    local_d10 = 1;
    piVar2 = (int *)(puVar5 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar1);
    }
    FUN_1400d1290(uVar9);
    local_d10 = 0;
  }
  local_e68 = PTR_DAT_1402f8010;
  if (*(int *)(param_1 + 0x100) < 4) {
    *(undefined4 *)(param_1 + 0x40) = 0;
    *(undefined4 *)(param_1 + 0x100) = 4;
    uVar9 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
    *(undefined8 *)(param_1 + 0x80) = uVar9;
    param_1[0xc0] = 0;
  }
LAB_1401ac8a7:
  FUN_140140df0(&local_e08);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401ac8e0(longlong param_1)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 *puVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  undefined1 auStack_d68 [32];
  undefined1 local_d48 [4];
  undefined4 local_d44;
  longlong local_d40;
  longlong local_d38;
  int local_d30;
  int local_d2c;
  undefined8 local_d18;
  undefined4 uStack_d10;
  undefined4 uStack_d0c;
  undefined8 local_d08;
  undefined1 local_d00 [72];
  undefined4 local_cb8;
  undefined4 uStack_cb4;
  int iStack_cb0;
  undefined4 uStack_cac;
  undefined4 *local_38;
  undefined4 local_30;
  int local_2c;
  ulonglong local_28;
  
  local_d08 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_d68;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
  FUN_140185560(local_d48);
  FUN_140185030(local_d48);
  FUN_1401856c0(local_d48,0x800);
  FUN_1401856c0(local_d48,0);
  FUN_14003c9e0(local_d48,7);
  lVar5 = *(longlong *)(param_1 + 0x108);
  iVar1 = *(int *)(lVar5 + 0x15c0);
  FUN_140186930(local_d48,(longlong)iVar1);
  lVar6 = 0;
  lVar4 = lVar6;
  if (*(int *)(lVar5 + 0x15c0) != 0) {
    lVar4 = *(longlong *)(lVar5 + 0x15b8);
  }
  if (iVar1 != 0) {
    local_d44 = 0;
    if (local_d40 == 0) {
      if (local_d38 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar4);
      }
LAB_1401ac9c0:
      FUN_14003cc90(&local_d38,lVar4,iVar1);
    }
    else {
      if (local_d38 != 0) goto LAB_1401ac9c0;
      if (local_d40 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830(0,lVar4);
      }
      FUN_14003ce60(local_d40,lVar4,iVar1);
    }
    FUN_14003ced0(local_d48);
  }
  lVar4 = local_d40;
  lVar5 = *(longlong *)(param_1 + 0x108);
  local_d18 = *(longlong **)(lVar5 + 0x1594);
  uStack_d10 = *(undefined4 *)(lVar5 + 0x159c);
  uStack_d0c = *(undefined4 *)(lVar5 + 0x15a0);
  local_d44 = 0;
  if (local_d40 == 0) {
    if (local_d38 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_d38 == 0) {
    if (local_d40 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = *(int *)(local_d40 + 0x18);
    FUN_14003cda0(local_d40,iVar1 + 0x10);
    lVar5 = lVar6;
    if (*(int *)(lVar4 + 0x18) != 0) {
      lVar5 = *(longlong *)(lVar4 + 0x10);
    }
    puVar3 = (undefined8 *)(lVar5 + iVar1);
    goto LAB_1401aca70;
  }
  lVar5 = (longlong)local_d30;
  local_d30 = local_d30 + 0x10;
  if ((local_d30 < 0) || (local_d2c < local_d30)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  puVar3 = (undefined8 *)(local_d38 + lVar5);
LAB_1401aca70:
  *puVar3 = local_d18;
  puVar3[1] = CONCAT44(uStack_d0c,uStack_d10);
  FUN_14003ced0(local_d48);
  FUN_14007c6e0(local_d48,*(undefined4 *)(*(longlong *)(param_1 + 0x108) + 0x698));
  local_2c = 200;
  local_30 = 0;
  local_38 = &local_cb8;
  if (local_d40 == 0) {
    iStack_cb0 = local_d30;
    if (local_d38 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else {
    iStack_cb0 = *(int *)(local_d40 + 0x18);
  }
  lVar5 = local_d38;
  if (local_d38 == 0) {
    if (local_d40 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    lVar5 = lVar6;
    if (*(int *)(local_d40 + 0x18) != 0) {
      lVar5 = *(longlong *)(local_d40 + 0x10);
    }
  }
  local_30 = 1;
  local_d18._0_4_ = (undefined4)lVar5;
  local_d18._4_4_ = (undefined4)((ulonglong)lVar5 >> 0x20);
  local_cb8 = (undefined4)local_d18;
  uStack_cb4 = local_d18._4_4_;
  uStack_cac = uStack_d0c;
  local_d18 = (longlong *)0x0;
  uStack_d10 = CONCAT31((int3)((uint)iStack_cb0 >> 8),1);
  uVar2 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
  FUN_1401b82c0(uVar2,&local_cb8,&local_d18);
  if (local_38 == (undefined4 *)0x0) {
    FUN_1400a2320(local_d00,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_d00,(ThrowInfo *)&DAT_1402f4860);
  }
  if (local_2c < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  local_d18 = &local_d40;
  FUN_14019a730(&local_d40);
  if ((local_d38 != 0) && (local_d2c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



undefined8 FUN_1401acbe0(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  longlong lVar2;
  
  plVar1 = *(longlong **)(param_1 + 8);
  if (plVar1 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  FUN_140185590(param_2,plVar1 + 2);
  lVar2 = *plVar1;
  *(longlong *)(param_1 + 8) = lVar2;
  if (lVar2 == 0) {
    *(undefined8 *)(param_1 + 0x10) = 0;
  }
  else {
    *(undefined8 *)(lVar2 + 8) = 0;
  }
  FUN_140175100(param_1,plVar1);
  return param_2;
}



void FUN_1401acc60(longlong param_1,undefined8 param_2,int *param_3)

{
  undefined8 *puVar1;
  uint uVar2;
  uint uVar3;
  longlong *plVar4;
  uint *puVar5;
  undefined8 uVar6;
  uint *puVar7;
  uint uVar8;
  uint uVar9;
  int iVar10;
  ulonglong uVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  int local_res8 [2];
  undefined8 local_res10;
  uint *local_res18;
  longlong *local_res20;
  undefined **local_c8;
  undefined8 local_c0;
  longlong local_b8;
  undefined8 local_b0;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined **local_a0;
  int local_98;
  undefined2 local_94;
  undefined **local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 local_70;
  undefined8 local_68;
  undefined1 local_60;
  undefined1 local_58 [8];
  undefined8 local_50;
  
  local_50 = 0xfffffffffffffffe;
  local_res10 = param_2;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
  local_a0 = Proud::AddrPort::vftable;
  local_98 = param_3[0xe];
  local_94 = (undefined2)param_3[0xf];
  plVar4 = (longlong *)FUN_140173ea0(*(undefined8 *)(param_1 + 0x108),&local_res20,&local_a0);
  uVar11 = 0;
  uVar13 = uVar11;
  if ((ulonglong *)*plVar4 != (ulonglong *)0x0) {
    uVar13 = *(ulonglong *)*plVar4;
  }
  if ((local_res20 != (longlong *)0x0) &&
     (local_res20[1] = local_res20[1] + -1, local_res20[1] == 0)) {
    puVar1 = (undefined8 *)*local_res20;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    FUN_1400a3530(local_res20);
  }
  if ((uVar13 == 0) || (*(char *)(uVar13 + 0x650) != '\0')) {
    if (*(longlong *)(param_3 + 2) == 0) {
      if (*(longlong *)(param_3 + 4) == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      iVar10 = param_3[6];
    }
    else {
      iVar10 = *(int *)(*(longlong *)(param_3 + 2) + 0x18);
    }
    FUN_140185720(param_3,iVar10 - ((int)(*param_3 + (*param_3 >> 0x1f & 7U)) >> 3));
    return;
  }
  local_c0 = 0;
  local_b8 = 0;
  local_b0 = 0;
  local_c8 = Proud::CReceivedMessageList::vftable;
  local_a8 = 1000;
  local_a4 = 1;
  FUN_1401bdbd0(uVar13 + 0x638,param_3,&local_c8,local_res8);
  if (local_res8[0] == 0) goto LAB_1401acfc2;
  FUN_1400a3440();
  local_res18 = (uint *)PTR_DAT_1402f8010;
  uVar2 = FUN_1400a32c0(L"Stream Extract Error at Reliable UDP");
  uVar9 = 0;
  uVar12 = uVar11;
  if ((local_res18 != (uint *)0x0) && (uVar12 = 0, local_res18 != (uint *)PTR_DAT_1402f8010)) {
    uVar12 = (ulonglong)local_res18[-2];
  }
  uVar3 = uVar2;
  if ((((int)uVar2 <= (int)uVar12) && (uVar3 = uVar9, local_res18 != (uint *)0x0)) &&
     (local_res18 != (uint *)PTR_DAT_1402f8010)) {
    uVar3 = local_res18[-2];
  }
  uVar8 = 1;
  if (1 < (int)uVar3) {
    uVar8 = uVar3;
  }
  uVar3 = uVar9;
  if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1402f8010)) {
    uVar3 = local_res18[-2];
  }
  if ((int)uVar3 < (int)uVar8) {
    if (local_res18 == (uint *)0x0) {
      local_res18 = (uint *)PTR_DAT_1402f8010;
    }
    if ((int)uVar8 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar8 == 0) {
      FUN_1400031d0(&local_res18);
    }
    else {
      uVar3 = uVar9;
      if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1402f8010)) {
        uVar3 = local_res18[-2];
      }
      if (uVar8 != uVar3) {
        puVar5 = (uint *)FUN_1400a34c0((longlong)(int)uVar8 * 2 + 10);
        if (puVar5 != (uint *)0x0) {
          *puVar5 = 0;
          puVar5[1] = 1;
        }
        *puVar5 = uVar8;
        uVar3 = uVar9;
        if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1402f8010)) {
          uVar3 = local_res18[-2];
        }
        puVar7 = (uint *)PTR_DAT_1402f8010;
        if ((int)uVar8 < (int)uVar3) {
LAB_1401ace6b:
          if (local_res18 != (uint *)0x0) {
            puVar7 = local_res18;
          }
        }
        else {
          uVar8 = uVar9;
          if (local_res18 != (uint *)0x0) {
            if (local_res18 != (uint *)PTR_DAT_1402f8010) {
              uVar8 = local_res18[-2];
            }
            goto LAB_1401ace6b;
          }
        }
        FUN_1400a32f0(puVar5 + 2,puVar7,uVar8);
        FUN_1400031d0(&local_res18);
        local_res18 = puVar5 + 2;
      }
    }
  }
  FUN_140002e30(&local_res18);
  puVar5 = local_res18;
  if (local_res18 == (uint *)0x0) {
    puVar5 = (uint *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar5,L"Stream Extract Error at Reliable UDP",uVar2);
  puVar5 = local_res18;
  if (local_res18 == (uint *)0x0) {
    puVar5 = (uint *)PTR_DAT_1402f8010;
  }
  uVar3 = FUN_1400a32c0(puVar5);
  uVar2 = 0;
  if (0 < (int)uVar3) {
    uVar2 = uVar3;
  }
  uVar3 = uVar9;
  if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1402f8010)) {
    uVar3 = local_res18[-2];
  }
  if (((int)uVar2 < (int)uVar3) || (uVar2 = uVar9, local_res18 == (uint *)0x0)) {
LAB_1401acefe:
    if (((local_res18 != (uint *)PTR_DAT_1402f8010) && (local_res18 != (uint *)0x0)) &&
       (local_res18 + -2 != (uint *)0x0)) {
      local_res18[-2] = uVar2;
      *(undefined2 *)((longlong)local_res18 + (longlong)(int)uVar2 * 2) = 0;
    }
  }
  else if (local_res18 != (uint *)PTR_DAT_1402f8010) {
    uVar2 = local_res18[-2];
    goto LAB_1401acefe;
  }
  local_88 = 0;
  local_80 = 0;
  local_78 = 0;
  local_70 = 0;
  local_90 = Proud::ByteArray::vftable;
  uVar6 = FUN_1401416a0(local_58,local_res8[0],*(undefined4 *)(uVar13 + 0x56c),&local_res18,
                        &local_90);
  (**(code **)(**(longlong **)(param_1 + 0x108) + 0x80))(*(longlong **)(param_1 + 0x108),uVar6);
  FUN_140140df0(&local_90);
  puVar5 = local_res18;
  param_2 = local_res10;
  if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1402f8010)) &&
     (puVar7 = local_res18 + -2, puVar7 != (uint *)0x0)) {
    uVar6 = FUN_1400a3440();
    local_68 = uVar6;
    FUN_1400a1c30(uVar6);
    local_60 = 1;
    puVar5 = puVar5 + -1;
    *puVar5 = *puVar5 - 1;
    if (*puVar5 == 0) {
      FUN_1400a3530(puVar7);
    }
    FUN_1400d1290(uVar6);
    param_2 = local_res10;
  }
LAB_1401acfc2:
  while( true ) {
    iVar10 = (int)uVar11;
    if (iVar10 == (int)local_b0) {
      FUN_14018eb10(&local_c8);
      return;
    }
    if ((iVar10 < 0) || ((int)local_b0 <= iVar10)) break;
    *(char *)(local_b8 + (longlong)iVar10 * 0x48 + 0x40) = (char)param_3[0x10];
    FUN_1401af9b0(param_1,param_2);
    if ((int)local_b0 <= iVar10) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    uVar11 = (ulonglong)(iVar10 + 1);
  }
                    // WARNING: Subroutine does not return
  FUN_1400a2700();
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401ad070(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 *puVar3;
  char cVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  uint *puVar8;
  undefined8 uVar9;
  ulonglong uVar10;
  uint *puVar11;
  uint uVar12;
  int iVar13;
  ulonglong uVar14;
  uint uVar15;
  undefined1 auStack_df8 [32];
  undefined ***local_dd8;
  uint *local_dc8;
  ulonglong *local_dc0;
  int local_db8;
  undefined4 local_db4;
  undefined4 local_db0 [2];
  undefined1 *local_da8;
  undefined8 local_da0;
  undefined8 local_d98;
  longlong local_d90;
  ulonglong local_d88;
  longlong local_d80;
  undefined8 local_d78;
  undefined4 local_d6c;
  undefined **local_d68;
  undefined8 local_d60;
  longlong local_d58;
  undefined8 local_d50;
  undefined4 local_d48;
  undefined4 local_d44;
  undefined1 local_d40 [8];
  undefined1 local_d38 [8];
  longlong local_d30;
  int local_d24;
  undefined8 *local_d18;
  undefined **local_d10;
  undefined8 local_d08;
  undefined8 local_d00;
  undefined8 local_cf8;
  undefined8 local_cf0;
  undefined8 local_ce8;
  undefined1 local_ce0;
  undefined1 local_cd8 [8];
  undefined8 local_cd0;
  undefined1 local_cc8 [3216];
  ulonglong local_38;
  
  local_cd0 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_df8;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
  cVar4 = FUN_140185f20(param_2,local_db0);
  if (cVar4 == '\0') {
    return;
  }
  cVar4 = FUN_140185490(param_2,&local_db4,4);
  if (cVar4 == '\0') {
    return;
  }
  cVar4 = FUN_140185b30(param_2,&local_da8);
  if (cVar4 == '\0') {
    return;
  }
  if ((int)local_da8 < 0) {
    return;
  }
  if (DAT_1402f8140 <= (int)local_da8) {
    return;
  }
  FUN_140185560(local_d40);
  cVar4 = FUN_1401857c0(param_2,local_d40,(ulonglong)local_da8 & 0xffffffff);
  if (cVar4 == '\0') {
    local_da8 = local_d38;
    FUN_14019a730(local_d38);
    if (local_d30 == 0) {
      return;
    }
    if (-1 < local_d24) {
      return;
    }
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_1401755f0(*(undefined8 *)(param_1 + 0x108),&local_dc0,local_db0[0]);
  if ((((local_dc0 == (ulonglong *)0x0) || (uVar10 = *local_dc0, uVar10 == 0)) ||
      (*(char *)(uVar10 + 0x684) != '\0')) || (*(char *)(uVar10 + 0x650) != '\0'))
  goto LAB_1401ad5b0;
  local_d78 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x88) + 0x18))();
  uVar14 = 0;
  local_d88 = 0;
  local_d90 = 0;
  local_d98 = 0;
  local_d80 = 0;
  local_da0 = 0;
  uVar15 = 0;
  local_d6c = 0;
  FUN_140146970(local_cc8,local_d40);
  FUN_1401a7aa0(*(undefined8 *)(*(longlong *)(param_1 + 0x108) + 0x4e0),local_db4,local_cc8,
                &local_da0);
  FUN_140145b60(local_cc8);
  local_d60 = 0;
  local_d58 = 0;
  local_d50 = 0;
  local_d68 = Proud::CReceivedMessageList::vftable;
  local_d48 = 1000;
  local_d44 = 1;
  uVar10 = uVar14;
  if (local_dc0 != (ulonglong *)0x0) {
    uVar10 = *local_dc0;
  }
  FUN_1401bdb40(uVar10 + 0x638,&local_da0,&local_d68,&local_db8);
  if (local_db8 != 0) {
    FUN_1400a3440();
    local_dc8 = (uint *)PTR_DAT_1402f8010;
    uVar5 = FUN_1400a32c0(L"Stream Extract Error at Reliable UDP");
    uVar10 = uVar14;
    if ((local_dc8 != (uint *)0x0) && (uVar10 = 0, local_dc8 != (uint *)PTR_DAT_1402f8010)) {
      uVar10 = (ulonglong)local_dc8[-2];
    }
    uVar6 = 0;
    uVar7 = uVar5;
    if ((((int)uVar5 <= (int)uVar10) && (uVar7 = uVar15, local_dc8 != (uint *)0x0)) &&
       (uVar7 = uVar6, local_dc8 != (uint *)PTR_DAT_1402f8010)) {
      uVar7 = local_dc8[-2];
    }
    uVar12 = 1;
    if (1 < (int)uVar7) {
      uVar12 = uVar7;
    }
    uVar7 = uVar6;
    if ((local_dc8 != (uint *)0x0) && (local_dc8 != (uint *)PTR_DAT_1402f8010)) {
      uVar7 = local_dc8[-2];
    }
    if ((int)uVar7 < (int)uVar12) {
      if (local_dc8 == (uint *)0x0) {
        local_dc8 = (uint *)PTR_DAT_1402f8010;
      }
      if ((int)uVar12 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if (uVar12 == 0) {
        FUN_1400031d0(&local_dc8);
      }
      else {
        uVar7 = uVar15;
        if ((local_dc8 != (uint *)0x0) && (local_dc8 != (uint *)PTR_DAT_1402f8010)) {
          uVar7 = local_dc8[-2];
        }
        if (uVar12 != uVar7) {
          puVar8 = (uint *)FUN_1400a34c0((longlong)(int)uVar12 * 2 + 10);
          if (puVar8 != (uint *)0x0) {
            *puVar8 = 0;
            puVar8[1] = 1;
          }
          *puVar8 = uVar12;
          uVar7 = uVar15;
          if ((local_dc8 != (uint *)0x0) && (local_dc8 != (uint *)PTR_DAT_1402f8010)) {
            uVar7 = local_dc8[-2];
          }
          puVar11 = (uint *)PTR_DAT_1402f8010;
          if ((int)uVar12 < (int)uVar7) {
LAB_1401ad37e:
            if (local_dc8 != (uint *)0x0) {
              puVar11 = local_dc8;
            }
          }
          else {
            uVar12 = uVar15;
            if (local_dc8 != (uint *)0x0) {
              if (local_dc8 != (uint *)PTR_DAT_1402f8010) {
                uVar12 = local_dc8[-2];
              }
              goto LAB_1401ad37e;
            }
          }
          FUN_1400a32f0(puVar8 + 2,puVar11,uVar12);
          FUN_1400031d0(&local_dc8);
          local_dc8 = puVar8 + 2;
        }
      }
    }
    FUN_140002e30(&local_dc8);
    puVar8 = local_dc8;
    if (local_dc8 == (uint *)0x0) {
      puVar8 = (uint *)PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar8,L"Stream Extract Error at Reliable UDP",uVar5);
    puVar8 = local_dc8;
    if (local_dc8 == (uint *)0x0) {
      puVar8 = (uint *)PTR_DAT_1402f8010;
    }
    uVar5 = FUN_1400a32c0(puVar8);
    uVar15 = 0;
    if (0 < (int)uVar5) {
      uVar15 = uVar5;
    }
    uVar5 = uVar6;
    if ((local_dc8 != (uint *)0x0) && (local_dc8 != (uint *)PTR_DAT_1402f8010)) {
      uVar5 = local_dc8[-2];
    }
    if (((int)uVar15 < (int)uVar5) || (uVar15 = uVar6, local_dc8 == (uint *)0x0)) {
LAB_1401ad41a:
      if (((local_dc8 != (uint *)PTR_DAT_1402f8010) && (local_dc8 != (uint *)0x0)) &&
         (local_dc8 + -2 != (uint *)0x0)) {
        local_dc8[-2] = uVar15;
        *(undefined2 *)((longlong)local_dc8 + (longlong)(int)uVar15 * 2) = 0;
      }
    }
    else if (local_dc8 != (uint *)PTR_DAT_1402f8010) {
      uVar15 = local_dc8[-2];
      goto LAB_1401ad41a;
    }
    local_d08 = 0;
    local_d00 = 0;
    local_cf8 = 0;
    local_cf0 = 0;
    local_d10 = Proud::ByteArray::vftable;
    uVar10 = uVar14;
    if (local_dc0 != (ulonglong *)0x0) {
      uVar10 = *local_dc0;
    }
    local_dd8 = &local_d10;
    uVar9 = FUN_1401416a0(local_cd8,local_db8,*(undefined4 *)(uVar10 + 0x56c),&local_dc8);
    (**(code **)(**(longlong **)(param_1 + 0x108) + 0x80))(*(longlong **)(param_1 + 0x108),uVar9);
    FUN_140140df0(&local_d10);
    puVar8 = local_dc8;
    if (((local_dc8 != (uint *)0x0) && (local_dc8 != (uint *)PTR_DAT_1402f8010)) &&
       (puVar11 = local_dc8 + -2, puVar11 != (uint *)0x0)) {
      uVar9 = FUN_1400a3440();
      local_ce8 = uVar9;
      FUN_1400a1c30(uVar9);
      local_ce0 = 1;
      puVar8 = puVar8 + -1;
      *puVar8 = *puVar8 - 1;
      if (*puVar8 == 0) {
        FUN_1400a3530(puVar11);
      }
      FUN_1400d1290(uVar9);
      local_ce0 = 0;
    }
    local_dc8 = (uint *)PTR_DAT_1402f8010;
  }
  while (iVar13 = (int)uVar14, iVar13 != (int)local_d50) {
    if ((iVar13 < 0) || ((int)local_d50 <= iVar13)) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    lVar2 = local_d58 + (longlong)iVar13 * 0x48;
    *(undefined1 *)(lVar2 + 0x40) = 1;
    FUN_140185160(lVar2,0);
    FUN_1401af9b0(param_1,0,lVar2);
    if ((int)local_d50 <= iVar13) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    uVar14 = (ulonglong)(iVar13 + 1);
  }
  FUN_14018eb10(&local_d68);
  if (local_d80 != 0) {
    plVar1 = (longlong *)(local_d80 + 8);
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      FUN_140148f80(&local_d80,local_d80);
    }
  }
  local_d18 = &local_d98;
  FUN_14019a730(&local_d98);
  if (local_d90 != 0) {
    if ((longlong)local_d88 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_d88 = local_d88 & 0xffffffff00000000;
  }
LAB_1401ad5b0:
  if ((local_dc0 != (ulonglong *)0x0) && (local_dc0[1] = local_dc0[1] - 1, local_dc0[1] == 0)) {
    puVar3 = (undefined8 *)*local_dc0;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    FUN_1400a3530(local_dc0);
  }
  local_d18 = (undefined8 *)local_d38;
  FUN_14019a730(local_d38);
  if ((local_d30 != 0) && (local_d24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



void FUN_1401ad640(longlong param_1,undefined8 param_2,longlong param_3)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 *puVar3;
  char cVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  uint *puVar8;
  undefined8 uVar9;
  void *pvVar10;
  uint *puVar11;
  int iVar12;
  void *pvVar13;
  uint uVar14;
  void *_Dst;
  uint uVar15;
  longlong *local_res18;
  undefined4 local_res20 [2];
  uint *local_128;
  longlong *local_120;
  undefined4 local_118;
  undefined4 local_114;
  longlong local_110;
  void *local_108;
  undefined8 local_100;
  longlong local_f8;
  undefined8 local_f0;
  undefined4 local_e4;
  undefined4 local_e0 [2];
  undefined1 local_d8 [8];
  longlong local_d0;
  void *local_c8;
  int local_c0;
  int local_bc;
  undefined **local_b0;
  undefined8 local_a8;
  longlong local_a0;
  undefined8 local_98;
  undefined4 local_90;
  undefined4 local_8c;
  ulonglong local_88;
  undefined **local_80;
  undefined8 local_78;
  undefined8 local_70;
  undefined8 local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined1 local_50;
  undefined1 local_48 [8];
  longlong *local_40;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  if (*(int *)(param_3 + 0x28) != 1) {
    return;
  }
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
  cVar4 = FUN_140185f20(param_3,local_res20);
  if (cVar4 == '\0') {
    return;
  }
  cVar4 = FUN_140185490(param_3,local_e0,4);
  if (cVar4 == '\0') {
    return;
  }
  cVar4 = FUN_140185b30(param_3,&local_88);
  if (cVar4 == '\0') {
    return;
  }
  if ((int)local_88 < 0) {
    return;
  }
  if (DAT_1402f8140 <= (int)local_88) {
    return;
  }
  FUN_140185560(local_d8);
  cVar4 = FUN_1401857c0(param_3,local_d8,local_88 & 0xffffffff);
  if (cVar4 == '\0') {
    local_res18 = &local_d0;
    FUN_14019a730(&local_d0);
    if (local_c8 == (void *)0x0) {
      return;
    }
    if (-1 < local_bc) {
      return;
    }
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  FUN_1401755f0(*(undefined8 *)(param_1 + 0x108),&local_120,local_res20[0]);
  if ((((local_120 == (longlong *)0x0) || (lVar2 = *local_120, lVar2 == 0)) ||
      (*(char *)(lVar2 + 0x684) != '\0')) || (*(char *)(lVar2 + 0x650) != '\0')) goto LAB_1401adc49;
  local_f0 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x88) + 0x18))();
  pvVar13 = (void *)0x0;
  local_100 = 0;
  local_108 = (void *)0x0;
  local_110 = 0;
  local_f8 = 0;
  uVar15 = 0;
  local_e4 = 0;
  local_118 = 1;
  local_114 = local_e0[0];
  local_110 = FUN_14019a770();
  *(undefined8 *)(local_110 + 0x28) = 1;
  if (local_d0 == 0) {
    iVar12 = local_c0;
    if (local_c8 == (void *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else {
    iVar12 = *(int *)(local_d0 + 0x18);
  }
  if (iVar12 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (local_108 == (void *)0x0) {
    if (iVar12 < 1) {
      if (local_110 == 0) goto LAB_1401ad855;
      iVar12 = 0;
    }
    else if (local_110 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    FUN_14003cda0(local_110,iVar12);
  }
  else {
    if (local_100._4_4_ < iVar12) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_100 = CONCAT44(local_100._4_4_,iVar12);
  }
LAB_1401ad855:
  if (local_d0 == 0) {
    if (local_c8 == (void *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else {
    local_c0 = *(int *)(local_d0 + 0x18);
  }
  pvVar10 = local_c8;
  if (local_c8 == (void *)0x0) {
    if (local_d0 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    pvVar10 = pvVar13;
    if (*(int *)(local_d0 + 0x18) != 0) {
      pvVar10 = *(void **)(local_d0 + 0x10);
    }
  }
  _Dst = local_108;
  if (local_108 == (void *)0x0) {
    if (local_110 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    _Dst = pvVar13;
    if (*(int *)(local_110 + 0x18) != 0) {
      _Dst = *(void **)(local_110 + 0x10);
    }
  }
  memcpy(_Dst,pvVar10,(longlong)local_c0);
  local_a8 = 0;
  local_a0 = 0;
  local_98 = 0;
  local_b0 = Proud::CReceivedMessageList::vftable;
  local_90 = 1000;
  local_8c = 1;
  pvVar10 = pvVar13;
  if (local_120 != (longlong *)0x0) {
    pvVar10 = (void *)*local_120;
  }
  FUN_1401bdb40((longlong)pvVar10 + 0x638,&local_118,&local_b0,&local_res18);
  if ((int)local_res18 != 0) {
    FUN_1400a3440();
    local_128 = (uint *)PTR_DAT_1402f8010;
    uVar5 = FUN_1400a32c0(L"Stream Extract Error at Reliable UDP");
    pvVar10 = pvVar13;
    if ((local_128 != (uint *)0x0) &&
       (pvVar10 = (void *)0x0, local_128 != (uint *)PTR_DAT_1402f8010)) {
      pvVar10 = (void *)(ulonglong)local_128[-2];
    }
    uVar6 = 0;
    uVar7 = uVar5;
    if ((((int)uVar5 <= (int)pvVar10) && (uVar7 = uVar15, local_128 != (uint *)0x0)) &&
       (uVar7 = uVar6, local_128 != (uint *)PTR_DAT_1402f8010)) {
      uVar7 = local_128[-2];
    }
    uVar14 = 1;
    if (1 < (int)uVar7) {
      uVar14 = uVar7;
    }
    uVar7 = uVar6;
    if ((local_128 != (uint *)0x0) && (local_128 != (uint *)PTR_DAT_1402f8010)) {
      uVar7 = local_128[-2];
    }
    if ((int)uVar7 < (int)uVar14) {
      if (local_128 == (uint *)0x0) {
        local_128 = (uint *)PTR_DAT_1402f8010;
      }
      if ((int)uVar14 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if (uVar14 == 0) {
        FUN_1400031d0(&local_128);
      }
      else {
        uVar7 = uVar15;
        if ((local_128 != (uint *)0x0) && (local_128 != (uint *)PTR_DAT_1402f8010)) {
          uVar7 = local_128[-2];
        }
        if (uVar14 != uVar7) {
          puVar8 = (uint *)FUN_1400a34c0((longlong)(int)uVar14 * 2 + 10);
          if (puVar8 != (uint *)0x0) {
            *puVar8 = 0;
            puVar8[1] = 1;
          }
          *puVar8 = uVar14;
          uVar7 = uVar15;
          if ((local_128 != (uint *)0x0) && (local_128 != (uint *)PTR_DAT_1402f8010)) {
            uVar7 = local_128[-2];
          }
          puVar11 = (uint *)PTR_DAT_1402f8010;
          if ((int)uVar14 < (int)uVar7) {
LAB_1401ada05:
            if (local_128 != (uint *)0x0) {
              puVar11 = local_128;
            }
          }
          else {
            uVar14 = uVar15;
            if (local_128 != (uint *)0x0) {
              if (local_128 != (uint *)PTR_DAT_1402f8010) {
                uVar14 = local_128[-2];
              }
              goto LAB_1401ada05;
            }
          }
          FUN_1400a32f0(puVar8 + 2,puVar11,uVar14);
          FUN_1400031d0(&local_128);
          local_128 = puVar8 + 2;
        }
      }
    }
    FUN_140002e30(&local_128);
    puVar8 = local_128;
    if (local_128 == (uint *)0x0) {
      puVar8 = (uint *)PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar8,L"Stream Extract Error at Reliable UDP",uVar5);
    puVar8 = local_128;
    if (local_128 == (uint *)0x0) {
      puVar8 = (uint *)PTR_DAT_1402f8010;
    }
    uVar5 = FUN_1400a32c0(puVar8);
    uVar15 = 0;
    if (0 < (int)uVar5) {
      uVar15 = uVar5;
    }
    uVar5 = uVar6;
    if ((local_128 != (uint *)0x0) && (local_128 != (uint *)PTR_DAT_1402f8010)) {
      uVar5 = local_128[-2];
    }
    if (((int)uVar15 < (int)uVar5) || (uVar15 = uVar6, local_128 == (uint *)0x0)) {
LAB_1401adaa1:
      if (((local_128 != (uint *)PTR_DAT_1402f8010) && (local_128 != (uint *)0x0)) &&
         (local_128 + -2 != (uint *)0x0)) {
        local_128[-2] = uVar15;
        *(undefined2 *)((longlong)local_128 + (longlong)(int)uVar15 * 2) = 0;
      }
    }
    else if (local_128 != (uint *)PTR_DAT_1402f8010) {
      uVar15 = local_128[-2];
      goto LAB_1401adaa1;
    }
    local_78 = 0;
    local_70 = 0;
    local_68 = 0;
    local_60 = 0;
    local_80 = Proud::ByteArray::vftable;
    pvVar10 = pvVar13;
    if (local_120 != (longlong *)0x0) {
      pvVar10 = (void *)*local_120;
    }
    uVar9 = FUN_1401416a0(local_48,(ulonglong)local_res18 & 0xffffffff,
                          *(undefined4 *)((longlong)pvVar10 + 0x56c),&local_128,&local_80);
    (**(code **)(**(longlong **)(param_1 + 0x108) + 0x80))(*(longlong **)(param_1 + 0x108),uVar9);
    FUN_140140df0(&local_80);
    puVar8 = local_128;
    if (((local_128 != (uint *)0x0) && (local_128 != (uint *)PTR_DAT_1402f8010)) &&
       (puVar11 = local_128 + -2, puVar11 != (uint *)0x0)) {
      uVar9 = FUN_1400a3440();
      local_58 = uVar9;
      FUN_1400a1c30(uVar9);
      local_50 = 1;
      puVar8 = puVar8 + -1;
      *puVar8 = *puVar8 - 1;
      if (*puVar8 == 0) {
        FUN_1400a3530(puVar11);
      }
      FUN_1400d1290(uVar9);
      local_50 = 0;
    }
    local_128 = (uint *)PTR_DAT_1402f8010;
  }
  while (iVar12 = (int)pvVar13, iVar12 != (int)local_98) {
    if ((iVar12 < 0) || ((int)local_98 <= iVar12)) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    *(undefined1 *)(local_a0 + (longlong)iVar12 * 0x48 + 0x40) = 1;
    FUN_1401af9b0(param_1,param_2);
    if ((int)local_98 <= iVar12) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    pvVar13 = (void *)(ulonglong)(iVar12 + 1);
  }
  FUN_14018eb10(&local_b0);
  if (local_f8 != 0) {
    plVar1 = (longlong *)(local_f8 + 8);
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      FUN_140148f80(&local_f8,local_f8);
    }
  }
  local_40 = &local_110;
  FUN_14019a730(&local_110);
  if (local_108 != (void *)0x0) {
    if ((longlong)local_100 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_100 = local_100 & 0xffffffff00000000;
  }
LAB_1401adc49:
  if ((local_120 != (longlong *)0x0) && (local_120[1] = local_120[1] + -1, local_120[1] == 0)) {
    puVar3 = (undefined8 *)*local_120;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    FUN_1400a3530(local_120);
  }
  local_res18 = &local_d0;
  FUN_14019a730(&local_d0);
  if ((local_c8 != (void *)0x0) && (local_bc < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



void FUN_1401adcd0(longlong param_1)

{
  undefined **ppuVar1;
  char cVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  longlong lVar7;
  int *piVar8;
  undefined8 uVar9;
  undefined **ppuVar10;
  ulonglong uVar11;
  ulonglong uVar12;
  int iVar13;
  undefined **local_res8;
  undefined *local_res10;
  undefined1 local_res18 [8];
  undefined **local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_30;
  
  lVar7 = *(longlong *)(param_1 + 0x108);
  if ((*(char *)(lVar7 + 0x1790) != '\0') || (*(int *)(lVar7 + 0x6c8) != 0)) {
    FUN_140177c40(lVar7,0,&DAT_140262ad8);
  }
  lVar7 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
  uVar12 = 0;
  uVar11 = uVar12;
  if (*(ulonglong **)(lVar7 + 0x128) != (ulonglong *)0x0) {
    uVar11 = **(ulonglong **)(lVar7 + 0x128);
  }
  cVar2 = FUN_1400aa930(uVar11);
  iVar6 = 0;
  if (cVar2 != '\0') {
    uVar9 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
    FUN_1401b80b0(uVar9);
    uVar9 = FUN_1400ad790(*(longlong *)(param_1 + 0x108) + 0x1620);
    *(undefined8 *)(param_1 + 200) = uVar9;
    lVar7 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
    uVar11 = uVar12;
    if (*(ulonglong **)(lVar7 + 0x128) != (ulonglong *)0x0) {
      uVar11 = **(ulonglong **)(lVar7 + 0x128);
    }
    FUN_1400a7f90(uVar11);
    lVar7 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
    uVar11 = uVar12;
    if (*(ulonglong **)(lVar7 + 0x128) != (ulonglong *)0x0) {
      uVar11 = **(ulonglong **)(lVar7 + 0x128);
    }
    FUN_1400a7fa0(uVar11,0);
    lVar7 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
    uVar11 = uVar12;
    if (*(ulonglong **)(lVar7 + 0x128) != (ulonglong *)0x0) {
      uVar11 = **(ulonglong **)(lVar7 + 0x128);
    }
    FUN_1400a8090(uVar11,0);
    local_res8 = &local_res10;
    lVar7 = *(longlong *)(param_1 + 0x108);
    FUN_1400a3440();
    local_res10 = PTR_DAT_1402f8010;
    FUN_140003100(&local_res10,lVar7 + 0x1588);
    lVar7 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
    if (*(ulonglong **)(lVar7 + 0x128) != (ulonglong *)0x0) {
      uVar12 = **(ulonglong **)(lVar7 + 0x128);
    }
    iVar6 = FUN_1400a92b0(uVar12,&local_res10,
                          *(undefined2 *)(*(longlong *)(param_1 + 0x108) + 0x1590));
    if ((iVar6 == 0) || (iVar6 == 0x2733)) {
      if (0 < *(int *)(param_1 + 0x100)) {
        return;
      }
      *(undefined4 *)(param_1 + 0x40) = 0;
      *(undefined4 *)(param_1 + 0x100) = 1;
      uVar9 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
      *(undefined8 *)(param_1 + 0x80) = uVar9;
      *(undefined1 *)(param_1 + 0xc0) = 0;
      return;
    }
    goto LAB_1401adf9d;
  }
  FUN_1400a3440();
  local_res8 = (undefined **)PTR_DAT_1402f8010;
  iVar3 = FUN_1400a32c0(L"Cannot bind TCP socket to a local address!");
  if ((local_res8 != (undefined **)0x0) &&
     (uVar12 = 0, local_res8 != (undefined **)PTR_DAT_1402f8010)) {
    uVar12 = (ulonglong)*(uint *)(local_res8 + -1);
  }
  iVar4 = 0;
  iVar5 = iVar3;
  if (((iVar3 <= (int)uVar12) && (iVar5 = iVar6, local_res8 != (undefined **)0x0)) &&
     (iVar5 = iVar4, local_res8 != (undefined **)PTR_DAT_1402f8010)) {
    iVar5 = *(int *)(local_res8 + -1);
  }
  iVar13 = 1;
  if (1 < iVar5) {
    iVar13 = iVar5;
  }
  iVar5 = iVar4;
  if ((local_res8 != (undefined **)0x0) && (local_res8 != (undefined **)PTR_DAT_1402f8010)) {
    iVar5 = *(int *)(local_res8 + -1);
  }
  if (iVar5 < iVar13) {
    if (local_res8 == (undefined **)0x0) {
      local_res8 = (undefined **)PTR_DAT_1402f8010;
    }
    if (iVar13 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (iVar13 == 0) {
      FUN_1400031d0(&local_res8);
    }
    else {
      iVar5 = iVar6;
      if ((local_res8 != (undefined **)0x0) && (local_res8 != (undefined **)PTR_DAT_1402f8010)) {
        iVar5 = *(int *)(local_res8 + -1);
      }
      if (iVar13 != iVar5) {
        piVar8 = (int *)FUN_1400a34c0((longlong)iVar13 * 2 + 10);
        if (piVar8 != (int *)0x0) {
          *piVar8 = 0;
          piVar8[1] = 1;
        }
        *piVar8 = iVar13;
        iVar5 = iVar6;
        if ((local_res8 != (undefined **)0x0) && (local_res8 != (undefined **)PTR_DAT_1402f8010)) {
          iVar5 = *(int *)(local_res8 + -1);
        }
        ppuVar10 = (undefined **)PTR_DAT_1402f8010;
        if (iVar13 < iVar5) {
LAB_1401ade43:
          if (local_res8 != (undefined **)0x0) {
            ppuVar10 = local_res8;
          }
        }
        else {
          iVar13 = iVar6;
          if (local_res8 != (undefined **)0x0) {
            if (local_res8 != (undefined **)PTR_DAT_1402f8010) {
              iVar13 = *(int *)(local_res8 + -1);
            }
            goto LAB_1401ade43;
          }
        }
        FUN_1400a32f0(piVar8 + 2,ppuVar10,iVar13);
        FUN_1400031d0(&local_res8);
        local_res8 = (undefined **)(piVar8 + 2);
      }
    }
  }
  FUN_140002e30(&local_res8);
  ppuVar10 = local_res8;
  if (local_res8 == (undefined **)0x0) {
    ppuVar10 = (undefined **)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(ppuVar10,L"Cannot bind TCP socket to a local address!",iVar3);
  ppuVar10 = local_res8;
  if (local_res8 == (undefined **)0x0) {
    ppuVar10 = (undefined **)PTR_DAT_1402f8010;
  }
  iVar3 = FUN_1400a32c0(ppuVar10);
  iVar6 = 0;
  if (0 < iVar3) {
    iVar6 = iVar3;
  }
  iVar3 = iVar4;
  if ((local_res8 != (undefined **)0x0) && (local_res8 != (undefined **)PTR_DAT_1402f8010)) {
    iVar3 = *(int *)(local_res8 + -1);
  }
  if ((iVar6 < iVar3) || (iVar6 = iVar4, local_res8 == (undefined **)0x0)) {
LAB_1401aded9:
    if (((local_res8 != (undefined **)PTR_DAT_1402f8010) && (local_res8 != (undefined **)0x0)) &&
       (local_res8 + -1 != (undefined **)0x0)) {
      *(int *)(local_res8 + -1) = iVar6;
      *(undefined2 *)((longlong)local_res8 + (longlong)iVar6 * 2) = 0;
    }
  }
  else if (local_res8 != (undefined **)PTR_DAT_1402f8010) {
    iVar6 = *(int *)(local_res8 + -1);
    goto LAB_1401aded9;
  }
  local_48 = 0;
  local_40 = 0;
  local_38 = 0;
  local_30 = 0;
  local_50 = Proud::ByteArray::vftable;
  uVar9 = FUN_1401416a0(local_res18,3,0,&local_res8,&local_50);
  (**(code **)(**(longlong **)(param_1 + 0x108) + 0x80))(*(longlong **)(param_1 + 0x108),uVar9);
  FUN_140140df0(&local_50);
  ppuVar10 = local_res8;
  if (((local_res8 != (undefined **)0x0) && (local_res8 != (undefined **)PTR_DAT_1402f8010)) &&
     (ppuVar1 = local_res8 + -1, ppuVar1 != (undefined **)0x0)) {
    uVar9 = FUN_1400a3440();
    FUN_1400a1c30(uVar9);
    piVar8 = (int *)((longlong)ppuVar10 + -4);
    *piVar8 = *piVar8 + -1;
    if (*piVar8 == 0) {
      FUN_1400a3530(ppuVar1);
    }
    FUN_1400d1290(uVar9);
  }
  iVar6 = Ordinal_111();
LAB_1401adf9d:
  FUN_1401a8d00(param_1,iVar6);
  return;
}



void FUN_1401ae120(undefined8 *param_1)

{
  longlong *plVar1;
  void *pvVar2;
  undefined8 *puVar3;
  longlong lVar4;
  undefined8 uVar5;
  
  *param_1 = Proud::CNetClientManager::vftable;
  param_1[1] = Proud::CNetClientManager::vftable;
  if (param_1[0x56] != 0) {
    FUN_1401b30b0();
    FUN_1401b31d0(param_1[0x56]);
  }
  plVar1 = (longlong *)param_1[0x52];
  if ((plVar1 != (longlong *)0x0) && (*plVar1 != 0)) {
    if (plVar1 == (longlong *)0x0) {
      lVar4 = 0;
    }
    else {
      lVar4 = *plVar1;
    }
    FUN_1401c52a0(lVar4);
    uVar5 = 0;
    if ((undefined8 *)param_1[0x52] != (undefined8 *)0x0) {
      uVar5 = *(undefined8 *)param_1[0x52];
    }
    FUN_1401c5a90(uVar5);
  }
  *(undefined1 *)(param_1 + 0x10) = 1;
  if ((undefined8 *)param_1[0xf] == (undefined8 *)0x0) {
    uVar5 = 0;
  }
  else {
    uVar5 = *(undefined8 *)param_1[0xf];
  }
  FUN_1400aaa10(uVar5);
  pvVar2 = (void *)param_1[0x57];
  if (pvVar2 != (void *)0x0) {
    FUN_1400acbf0(pvVar2);
    operator_delete(pvVar2);
  }
  param_1[0x57] = 0;
  timeKillEvent(*(UINT *)(param_1 + 0x4c));
  pvVar2 = (void *)param_1[0x56];
  if (pvVar2 != (void *)0x0) {
    FUN_1401b5e50(pvVar2);
    operator_delete(pvVar2);
  }
  param_1[0x56] = 0;
  FUN_140176ea0(param_1 + 0x45);
  pvVar2 = (void *)param_1[0x57];
  if (pvVar2 != (void *)0x0) {
    FUN_1400acbf0(pvVar2);
    operator_delete(pvVar2);
  }
  param_1[0x57] = 0;
  pvVar2 = (void *)param_1[0x56];
  if (pvVar2 != (void *)0x0) {
    FUN_1401b5e50(pvVar2);
    operator_delete(pvVar2);
  }
  FUN_1401a9120(param_1 + 0x53);
  if ((param_1[0x52] != 0) &&
     (*(longlong *)(param_1[0x52] + 8) = *(longlong *)(param_1[0x52] + 8) + -1,
     *(longlong *)(param_1[0x52] + 8) == 0)) {
    plVar1 = (longlong *)param_1[0x52];
    puVar3 = (undefined8 *)*plVar1;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    FUN_1400a3530(plVar1);
  }
  FUN_140176ea0(param_1 + 0x45);
  puVar3 = (undefined8 *)param_1[0x45];
  if (puVar3 != (undefined8 *)0x0) {
    (**(code **)*puVar3)(puVar3,1);
  }
  FUN_1401a4f30(param_1 + 0x41);
  FUN_1400a1cd0(param_1 + 0x39);
  FUN_1400a1cd0(param_1 + 0x11);
  if ((param_1[0xf] != 0) &&
     (*(longlong *)(param_1[0xf] + 8) = *(longlong *)(param_1[0xf] + 8) + -1,
     *(longlong *)(param_1[0xf] + 8) == 0)) {
    puVar3 = (undefined8 *)param_1[0xf];
    pvVar2 = (void *)*puVar3;
    if (pvVar2 != (void *)0x0) {
      FUN_1400aaa90(pvVar2);
      operator_delete(pvVar2);
    }
    FUN_1400a3530(puVar3);
  }
  FUN_1400a1cd0(param_1 + 2);
  param_1[1] = Proud::ISendSpeedMeasurerDg::vftable;
  *param_1 = Proud::ICompletionPortEventSink::vftable;
  return;
}



void FUN_1401ae390(longlong param_1)

{
  FUN_1401ae560(param_1 + -8);
  return;
}



void FUN_1401ae3a0(longlong param_1,longlong *param_2)

{
  undefined8 *puVar1;
  char cVar2;
  longlong *plVar3;
  longlong *plVar4;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  plVar4 = (longlong *)0x0;
  plVar3 = plVar4;
  if ((undefined8 *)*param_2 != (undefined8 *)0x0) {
    plVar3 = *(longlong **)*param_2;
  }
  cVar2 = (**(code **)(*plVar3 + 0x10))();
  if (cVar2 == '\0') {
    if ((undefined8 *)*param_2 != (undefined8 *)0x0) {
      plVar4 = *(longlong **)*param_2;
    }
    (**(code **)(*plVar4 + 8))(plVar4);
  }
  uVar5 = FUN_140176fe0(param_1 + 0x228,param_2,*(undefined8 *)(param_1 + 0x238),0,uVar5);
  if (*(undefined8 **)(param_1 + 0x238) == (undefined8 *)0x0) {
    *(undefined8 *)(param_1 + 0x230) = uVar5;
  }
  else {
    **(undefined8 **)(param_1 + 0x238) = uVar5;
  }
  *(undefined8 *)(param_1 + 0x238) = uVar5;
  if ((*param_2 != 0) &&
     (*(longlong *)(*param_2 + 8) = *(longlong *)(*param_2 + 8) + -1,
     *(longlong *)(*param_2 + 8) == 0)) {
    param_2 = (longlong *)*param_2;
    puVar1 = (undefined8 *)*param_2;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    FUN_1400a3530(param_2);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001401ae53f)
// WARNING: Removing unreachable block (ram,0x0001401ae54a)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401ae480(longlong param_1)

{
  undefined8 *puVar1;
  longlong lVar2;
  undefined8 *puVar3;
  
  if (*(double *)(param_1 + 0xc0) - *(double *)(param_1 + 0x248) <= _DAT_1402f81c0) {
    return;
  }
  *(double *)(param_1 + 0x248) = *(double *)(param_1 + 0xc0);
  puVar3 = *(undefined8 **)(param_1 + 0x230);
  do {
    while( true ) {
      if (puVar3 == (undefined8 *)0x0) {
        return;
      }
      lVar2 = 0;
      if ((longlong *)puVar3[2] != (longlong *)0x0) {
        lVar2 = *(longlong *)puVar3[2];
      }
      if (*(char *)(lVar2 + 0x80) == '\0') break;
LAB_1401ae53a:
      puVar3 = (undefined8 *)*puVar3;
    }
    lVar2 = 0;
    if ((longlong *)puVar3[2] != (longlong *)0x0) {
      lVar2 = *(longlong *)puVar3[2];
    }
    if (*(char *)(lVar2 + 0x40) != '\0') goto LAB_1401ae53a;
    puVar1 = (undefined8 *)*puVar3;
    FUN_140176f70(param_1 + 0x228,puVar3);
    puVar3 = puVar1;
  } while( true );
}



undefined8 FUN_1401ae560(undefined8 param_1,uint param_2)

{
  FUN_1401ae120();
  if ((param_2 & 1) != 0) {
    FUN_1400a3530(param_1);
  }
  return param_1;
}



void FUN_1401ae590(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined4 uVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 *local_res8;
  undefined4 local_128 [2];
  undefined8 local_120 [2];
  undefined8 local_110;
  undefined8 local_108;
  undefined **local_100;
  undefined8 local_f8;
  undefined8 local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  longlong local_d0;
  ulonglong local_c8;
  undefined4 local_b8;
  undefined **local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined **local_80;
  undefined4 local_78;
  undefined2 local_74;
  undefined **local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 *local_38;
  undefined1 local_30;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x108) + 0x1570);
  puVar5 = (undefined8 *)0x0;
  puVar4 = puVar5;
  if (plVar1 != (longlong *)0x0) {
    puVar4 = (undefined8 *)*plVar1;
  }
  FUN_14003c7f0(param_2,puVar4 + 1);
  plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x108) + 0x1570);
  puVar4 = puVar5;
  if (plVar1 != (longlong *)0x0) {
    puVar4 = (undefined8 *)*plVar1;
  }
  FUN_1401b19c0(puVar4,1);
  local_120[0] = 0;
  local_110 = 0;
  local_108 = 0;
  local_f8 = 0;
  local_f0 = 0;
  local_e8 = 0;
  local_e0 = 0;
  local_100 = Proud::ByteArray::vftable;
  local_c8 = 0;
  local_d0 = 0;
  local_d8 = 0;
  local_a8 = 0;
  local_a0 = 0;
  local_98 = 0;
  local_90 = 0;
  local_b0 = Proud::ByteArray::vftable;
  local_80 = Proud::AddrPort::vftable;
  local_78 = 0;
  local_74 = 0;
  local_60 = 0;
  local_58 = 0;
  local_50 = 0;
  local_48 = 0;
  local_68 = Proud::ByteArray::vftable;
  local_res8 = (undefined8 *)FUN_1400a34c0(0x60);
  puVar4 = puVar5;
  if (local_res8 != (undefined8 *)0x0) {
    puVar4 = (undefined8 *)FUN_140141470(local_res8);
  }
  if (puVar4 == (undefined8 *)0x0) {
    local_res8 = (undefined8 *)0x0;
  }
  else {
    puVar5 = (undefined8 *)FUN_1400a34c0(0x48);
    if (puVar5 != (undefined8 *)0x0) {
      local_res8 = puVar5;
      uVar3 = FUN_1401692e0();
      FUN_1400a1b50(puVar5,uVar3,1);
    }
    local_res8 = puVar5;
    FUN_1400a1c30(puVar5);
    puVar5[8] = 1;
    puVar5[7] = puVar4;
    FUN_1400d1290(puVar5);
  }
  FUN_140141570(local_120,&local_res8);
  if (puVar5 != (undefined8 *)0x0) {
    local_38 = puVar5;
    FUN_1400a1c30(puVar5);
    local_30 = 1;
    plVar1 = puVar5 + 8;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      FUN_1400d1290(puVar5);
      local_30 = 0;
      FUN_14008c910(puVar5);
    }
    else {
      FUN_1400d1290(puVar5);
    }
  }
  local_128[0] = 0xd;
  local_b8 = 1;
  FUN_14017fdf0(*(undefined8 *)(param_1 + 0x108),local_128);
  lVar2 = *(longlong *)(param_1 + 0x108);
  if ((*(char *)(lVar2 + 0x1790) != '\0') || (*(int *)(lVar2 + 0x6c8) != 0)) {
    FUN_140177c40(lVar2,1,&DAT_140262bc0,*(undefined4 *)(lVar2 + 0x1578));
  }
  FUN_140140df0(&local_68);
  FUN_140140df0(&local_b0);
  local_res8 = &local_d8;
  FUN_14019a730(&local_d8);
  if (local_d0 != 0) {
    if ((longlong)local_c8 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_c8 = local_c8 & 0xffffffff00000000;
  }
  FUN_140140df0(&local_100);
  FUN_14015bf40(&local_108);
  FUN_14015bec0(&local_110);
  FUN_14008c980(local_120);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401ae830(longlong param_1,undefined8 param_2)

{
  int *piVar1;
  char cVar2;
  int iVar3;
  uint uVar4;
  uint uVar5;
  longlong lVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  longlong *plVar9;
  uint *puVar10;
  longlong *plVar11;
  ulonglong uVar12;
  undefined *puVar13;
  uint *puVar14;
  uint uVar15;
  undefined *puVar16;
  undefined *puVar17;
  uint uVar18;
  undefined1 auStack_4a8 [32];
  undefined ***local_488;
  undefined1 local_478 [8];
  uint *local_470;
  longlong local_468;
  undefined *local_460;
  undefined8 local_458;
  undefined4 local_450 [2];
  undefined *local_448;
  undefined4 local_440 [2];
  undefined *local_438;
  undefined *local_430;
  undefined **local_428;
  undefined4 local_420;
  undefined2 local_41c;
  undefined *local_418;
  ulonglong local_410;
  undefined **local_408;
  undefined8 local_400;
  undefined8 local_3f8;
  undefined8 local_3f0;
  undefined8 local_3e8;
  undefined8 local_3e0;
  undefined1 local_3d8;
  undefined1 local_3d0 [8];
  undefined8 local_3c8;
  undefined1 local_3c0;
  undefined8 local_3b8;
  undefined1 local_3b0;
  undefined8 local_3a8;
  undefined1 local_3a0;
  undefined8 local_398;
  undefined1 local_390;
  undefined8 local_388;
  undefined1 local_380;
  longlong local_378;
  undefined1 local_370;
  undefined1 local_368 [8];
  undefined8 local_360;
  undefined1 local_358 [16];
  undefined4 local_348 [20];
  longlong local_2f8;
  undefined *local_2f0;
  undefined4 local_2e8;
  undefined4 local_2e4;
  undefined4 local_2d8;
  undefined4 local_298;
  undefined2 local_294;
  undefined4 local_258;
  undefined4 local_254;
  undefined4 local_250;
  undefined4 local_24c;
  WCHAR local_248 [264];
  ulonglong local_38;
  
  local_360 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_4a8;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
  puVar17 = (undefined *)0x0;
  local_458 = 0;
  local_460 = (undefined *)0x0;
  local_468 = 0;
  local_468 = FUN_14019a770();
  *(undefined8 *)(local_468 + 0x28) = 1;
  local_428 = Proud::AddrPort::vftable;
  local_420 = 0;
  local_41c = 0;
  cVar2 = FUN_140185f20(param_2,local_440);
  if (cVar2 != '\0') {
    local_258 = 0;
    local_254 = 0;
    local_250 = 0;
    local_24c = 0;
    cVar2 = FUN_140185490(param_2,&local_258,0x10);
    if ((((cVar2 != '\0') && (cVar2 = FUN_140185b30(param_2,&local_410), cVar2 != '\0')) &&
        (iVar3 = (int)local_410, -1 < iVar3)) && (iVar3 <= DAT_1402f8140)) {
      if (local_460 == (undefined *)0x0) {
        if (iVar3 < 1) {
          if (local_468 == 0) goto LAB_1401aee67;
          uVar12 = 0;
        }
        else {
          if (local_468 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14019a830();
          }
          uVar12 = local_410 & 0xffffffff;
        }
        FUN_14003cda0(local_468,uVar12);
      }
      else {
        if (local_458._4_4_ < iVar3) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        local_458 = CONCAT44(local_458._4_4_,iVar3);
      }
      puVar13 = local_460;
      if (local_460 == (undefined *)0x0) {
        if (local_468 == 0) {
LAB_1401aee67:
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        puVar13 = puVar17;
        if (*(int *)(local_468 + 0x18) != 0) {
          puVar13 = *(undefined **)(local_468 + 0x10);
        }
      }
      cVar2 = FUN_140185490(param_2,puVar13,local_410 & 0xffffffff);
      if ((cVar2 != '\0') && (cVar2 = FUN_140185ec0(param_2,&local_428), cVar2 != '\0')) {
        *(undefined4 *)(*(longlong *)(param_1 + 0x108) + 0x1578) = local_440[0];
        plVar11 = *(longlong **)(*(longlong *)(param_1 + 0x108) + 0x15d8);
        if ((plVar11 != (longlong *)0x0) && (*plVar11 != 0)) {
          lVar6 = FUN_140169e50();
          *(undefined4 *)(lVar6 + 0x108) = local_420;
          *(undefined2 *)(lVar6 + 0x10c) = local_41c;
        }
        uVar7 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
        local_3a8 = uVar7;
        FUN_1400a1c30(uVar7);
        local_3a0 = 1;
        FUN_14015c2a0(local_348);
        local_348[0] = 1;
        if (local_468 == local_2f8) {
          local_2e4 = local_458._4_4_;
          local_2f0 = local_460;
          local_2e8 = (undefined4)local_458;
        }
        else {
          FUN_14019a730(&local_2f8);
          if (local_468 != 0) {
            *(longlong *)(local_468 + 0x28) = *(longlong *)(local_468 + 0x28) + 1;
            local_2f8 = local_468;
          }
        }
        local_2d8 = 1;
        uVar8 = FUN_14000d9f0(local_368,*(longlong *)(param_1 + 0x108) + 0x1588);
        lVar6 = FUN_1400a6870(local_358,uVar8,
                              *(undefined2 *)(*(longlong *)(param_1 + 0x108) + 0x1590));
        local_298 = *(undefined4 *)(lVar6 + 8);
        local_294 = *(undefined2 *)(lVar6 + 0xc);
        FUN_14017fdf0(*(undefined8 *)(param_1 + 0x108),local_348);
        lVar6 = *(longlong *)(param_1 + 0x108);
        *(undefined4 *)(lVar6 + 0x6d0) = local_258;
        *(undefined4 *)(lVar6 + 0x6d4) = local_254;
        *(undefined4 *)(lVar6 + 0x6d8) = local_250;
        *(undefined4 *)(lVar6 + 0x6dc) = local_24c;
        if (*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x58) != 0) {
          lVar6 = *(longlong *)(*(longlong *)(param_1 + 0x108) + 0x58) + 0x98;
          local_378 = lVar6;
          FUN_1400a1c30(lVar6);
          local_370 = 1;
          local_478[0] = 0;
          plVar11 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x70);
          local_450[0] = (**(code **)(*plVar11 + 0x108))(plVar11,local_478);
          plVar11 = (longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x58) + 0x68);
          (**(code **)(*plVar11 + 0x60))(plVar11,1,&DAT_140318cf0,local_450);
          FUN_1400d1290(lVar6);
        }
        FUN_14015c350(local_348);
        FUN_1400d1290(uVar7);
        lVar6 = *(longlong *)(param_1 + 0x108);
        if ((*(char *)(lVar6 + 0x1790) != '\0') || (*(int *)(lVar6 + 0x6c8) != 0)) {
          FUN_140177c40(lVar6,1,&DAT_140262ca8,*(undefined4 *)(lVar6 + 0x1578));
        }
        if ((*(int *)(*(longlong *)(param_1 + 0x108) + 0x1578) == 0x32) &&
           (iVar3 = FUN_1400ad460(),
           iVar3 == (iVar3 / 3 + (iVar3 >> 0x1f) +
                    (int)(((longlong)iVar3 / 3 + ((longlong)iVar3 >> 0x3f) & 0xffffffffU) >> 0x1f))
                    * 3)) {
          FUN_1400a3440();
          puVar13 = PTR_DAT_1402f8010;
          local_438 = PTR_DAT_1402f8010;
          GetModuleFileNameW((HMODULE)0x0,local_248,0x104);
          plVar11 = *(longlong **)(*(longlong *)(param_1 + 0x108) + 0x15d8);
          if ((plVar11 != (longlong *)0x0) && (*plVar11 != 0)) {
            lVar6 = FUN_140169e50();
            plVar11 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x70);
            plVar11 = (longlong *)(**(code **)(*plVar11 + 0xb0))(plVar11,&local_418);
            plVar9 = (longlong *)
                     (*(code *)**(undefined8 **)(lVar6 + 0x100))
                               ((undefined8 *)(lVar6 + 0x100),&local_430);
            puVar13 = (undefined *)*plVar11;
            if ((undefined *)*plVar11 == (undefined *)0x0) {
              puVar13 = PTR_DAT_1402f8010;
            }
            puVar16 = (undefined *)*plVar9;
            if ((undefined *)*plVar9 == (undefined *)0x0) {
              puVar16 = PTR_DAT_1402f8010;
            }
            local_488 = (undefined ***)local_248;
            FUN_14003c600(&local_438,L"Usage: %s ## %s ## %s",puVar16,puVar13);
            if (((local_430 != (undefined *)0x0) && (local_430 != PTR_DAT_1402f8010)) &&
               (local_430 + -8 != (undefined *)0x0)) {
              uVar7 = FUN_1400a3440();
              local_388 = uVar7;
              FUN_1400a1c30(uVar7);
              local_380 = 1;
              piVar1 = (int *)(local_430 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(local_430 + -8);
              }
              FUN_1400d1290(uVar7);
            }
            local_430 = PTR_DAT_1402f8010;
            if (((local_418 != (undefined *)0x0) && (local_418 != PTR_DAT_1402f8010)) &&
               (local_418 + -8 != (undefined *)0x0)) {
              uVar7 = FUN_1400a3440();
              local_3c8 = uVar7;
              FUN_1400a1c30(uVar7);
              local_3c0 = 1;
              piVar1 = (int *)(local_418 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(local_418 + -8);
              }
              FUN_1400d1290(uVar7);
            }
            FUN_1400a3440();
            puVar13 = local_438;
            local_448 = PTR_DAT_1402f8010;
            if (PTR_DAT_1402f8010 == (undefined *)0x0) {
              local_448 = puVar17;
            }
            if (local_438 != PTR_DAT_1402f8010) {
              uVar7 = FUN_1400a3440();
              local_3b8 = uVar7;
              FUN_1400a1c30(uVar7);
              local_3b0 = 1;
              FUN_1400031d0(&local_448);
              local_448 = puVar13;
              if (((puVar13 != PTR_DAT_1402f8010) && (puVar13 != (undefined *)0x0)) &&
                 (puVar13 != (undefined *)0x8)) {
                *(int *)(puVar13 + -4) = *(int *)(puVar13 + -4) + 1;
              }
              FUN_1400d1290(uVar7);
            }
            FUN_1400a6370(&local_448);
          }
          if (((puVar13 != (undefined *)0x0) && (puVar13 != PTR_DAT_1402f8010)) &&
             (puVar13 + -8 != (undefined *)0x0)) {
            uVar7 = FUN_1400a3440();
            local_398 = uVar7;
            FUN_1400a1c30(uVar7);
            local_390 = 1;
            piVar1 = (int *)(puVar13 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_1400a3530(puVar13 + -8);
            }
            FUN_1400d1290(uVar7);
          }
        }
        FUN_14019a730(&local_468);
        if (local_460 == (undefined *)0x0) {
          return;
        }
        if (-1 < local_458) {
          return;
        }
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
    }
  }
  FUN_1400a3440();
  local_470 = (uint *)PTR_DAT_1402f8010;
  uVar4 = FUN_1400a32c0(L"Bad format in NotifyServerConnectSuccess");
  if ((local_470 != (uint *)0x0) &&
     (puVar17 = (undefined *)0x0, local_470 != (uint *)PTR_DAT_1402f8010)) {
    puVar17 = (undefined *)(ulonglong)local_470[-2];
  }
  uVar18 = 0;
  uVar5 = uVar4;
  if ((((int)uVar4 <= (int)puVar17) && (uVar5 = uVar18, local_470 != (uint *)0x0)) &&
     (local_470 != (uint *)PTR_DAT_1402f8010)) {
    uVar5 = local_470[-2];
  }
  uVar15 = 1;
  if (1 < (int)uVar5) {
    uVar15 = uVar5;
  }
  uVar5 = uVar18;
  if ((local_470 != (uint *)0x0) && (local_470 != (uint *)PTR_DAT_1402f8010)) {
    uVar5 = local_470[-2];
  }
  if ((int)uVar5 < (int)uVar15) {
    if (local_470 == (uint *)0x0) {
      local_470 = (uint *)PTR_DAT_1402f8010;
    }
    if ((int)uVar15 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar15 == 0) {
      FUN_1400031d0(&local_470);
    }
    else {
      uVar5 = uVar18;
      if ((local_470 != (uint *)0x0) && (local_470 != (uint *)PTR_DAT_1402f8010)) {
        uVar5 = local_470[-2];
      }
      if (uVar15 != uVar5) {
        puVar10 = (uint *)FUN_1400a34c0((longlong)(int)uVar15 * 2 + 10);
        if (puVar10 != (uint *)0x0) {
          *puVar10 = 0;
          puVar10[1] = 1;
        }
        *puVar10 = uVar15;
        uVar5 = uVar18;
        if ((local_470 != (uint *)0x0) && (local_470 != (uint *)PTR_DAT_1402f8010)) {
          uVar5 = local_470[-2];
        }
        puVar14 = (uint *)PTR_DAT_1402f8010;
        if ((int)uVar15 < (int)uVar5) {
LAB_1401aef6c:
          if (local_470 != (uint *)0x0) {
            puVar14 = local_470;
          }
        }
        else {
          uVar15 = uVar18;
          if (local_470 != (uint *)0x0) {
            if (local_470 != (uint *)PTR_DAT_1402f8010) {
              uVar15 = local_470[-2];
            }
            goto LAB_1401aef6c;
          }
        }
        FUN_1400a32f0(puVar10 + 2,puVar14,uVar15);
        FUN_1400031d0(&local_470);
        local_470 = puVar10 + 2;
      }
    }
  }
  FUN_140002e30(&local_470);
  puVar10 = local_470;
  if (local_470 == (uint *)0x0) {
    puVar10 = (uint *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar10,L"Bad format in NotifyServerConnectSuccess",uVar4);
  puVar10 = local_470;
  if (local_470 == (uint *)0x0) {
    puVar10 = (uint *)PTR_DAT_1402f8010;
  }
  uVar5 = FUN_1400a32c0(puVar10);
  uVar4 = 0;
  if (0 < (int)uVar5) {
    uVar4 = uVar5;
  }
  uVar5 = uVar18;
  if ((local_470 != (uint *)0x0) && (local_470 != (uint *)PTR_DAT_1402f8010)) {
    uVar5 = local_470[-2];
  }
  if (((int)uVar5 <= (int)uVar4) && (uVar4 = uVar18, local_470 != (uint *)0x0)) {
    if (local_470 == (uint *)PTR_DAT_1402f8010) goto LAB_1401af026;
    uVar4 = local_470[-2];
  }
  if (((local_470 != (uint *)PTR_DAT_1402f8010) && (local_470 != (uint *)0x0)) &&
     (local_470 + -2 != (uint *)0x0)) {
    local_470[-2] = uVar4;
    *(undefined2 *)((longlong)local_470 + (longlong)(int)uVar4 * 2) = 0;
  }
LAB_1401af026:
  local_400 = 0;
  local_3f8 = 0;
  local_3f0 = 0;
  local_3e8 = 0;
  local_408 = Proud::ByteArray::vftable;
  local_488 = &local_408;
  uVar7 = FUN_1401416a0(local_3d0,8,1,&local_470);
  FUN_140182e50(*(undefined8 *)(param_1 + 0x108),0x1f,uVar7);
  FUN_140140df0(&local_408);
  puVar10 = local_470;
  if (((local_470 != (uint *)0x0) && (local_470 != (uint *)PTR_DAT_1402f8010)) &&
     (puVar14 = local_470 + -2, puVar14 != (uint *)0x0)) {
    uVar7 = FUN_1400a3440();
    local_3e0 = uVar7;
    FUN_1400a1c30(uVar7);
    local_3d8 = 1;
    puVar10 = puVar10 + -1;
    *puVar10 = *puVar10 - 1;
    if (*puVar10 == 0) {
      FUN_1400a3530(puVar14);
    }
    FUN_1400d1290(uVar7);
    local_3d8 = 0;
  }
  local_470 = (uint *)PTR_DAT_1402f8010;
  if (*(int *)(param_1 + 0x100) < 4) {
    *(undefined4 *)(param_1 + 0x40) = 0;
    *(undefined4 *)(param_1 + 0x100) = 4;
    uVar7 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
    *(undefined8 *)(param_1 + 0x80) = uVar7;
    *(undefined1 *)(param_1 + 0xc0) = 0;
  }
  FUN_14019a730(&local_468);
  if ((local_460 != (undefined *)0x0) && (local_458 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401af160(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  char cVar2;
  undefined8 uVar3;
  double dVar4;
  double dVar5;
  double local_res18;
  double local_res20;
  undefined4 local_118 [2];
  undefined8 local_110;
  undefined8 local_100;
  undefined8 local_f8;
  undefined **local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined4 local_a8;
  undefined **local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined **local_70;
  undefined4 local_68;
  undefined2 local_64;
  undefined **local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_28;
  undefined1 local_20;
  undefined8 local_18;
  
  local_18 = 0xfffffffffffffffe;
  cVar2 = FUN_140185490(param_2,&local_res18,8);
  if ((cVar2 != '\0') && (cVar2 = FUN_140185490(param_2,&local_res20,8), cVar2 != '\0')) {
    uVar3 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
    local_28 = uVar3;
    FUN_1400a1c30(uVar3);
    local_20 = 1;
    dVar4 = (double)FUN_1400ad790(*(longlong *)(param_1 + 0x108) + 0x1620);
    dVar5 = (dVar4 - local_res18) * 0.5;
    *(double *)(*(longlong *)(param_1 + 0x108) + 0x500) = dVar5;
    lVar1 = *(longlong *)(param_1 + 0x108);
    if (*(double *)(lVar1 + 0x4f8) != 0.0) {
      dVar5 = (dVar5 - *(double *)(lVar1 + 0x4f8)) * _DAT_1402f8108 + *(double *)(lVar1 + 0x4f8);
    }
    *(double *)(lVar1 + 0x4f8) = dVar5;
    *(double *)(*(longlong *)(param_1 + 0x108) + 0x4f0) =
         dVar4 - (local_res20 + *(double *)(*(longlong *)(param_1 + 0x108) + 0x4f8));
    local_110 = 0;
    local_100 = 0;
    local_f8 = 0;
    local_e8 = 0;
    local_e0 = 0;
    local_d8 = 0;
    local_d0 = 0;
    local_f0 = Proud::ByteArray::vftable;
    local_b8 = 0;
    local_c0 = 0;
    local_c8 = 0;
    local_98 = 0;
    local_90 = 0;
    local_88 = 0;
    local_80 = 0;
    local_a0 = Proud::ByteArray::vftable;
    local_70 = Proud::AddrPort::vftable;
    local_68 = 0;
    local_64 = 0;
    local_50 = 0;
    local_48 = 0;
    local_40 = 0;
    local_38 = 0;
    local_58 = Proud::ByteArray::vftable;
    local_118[0] = 0xe;
    local_a8 = 1;
    FUN_14017fdf0(*(undefined8 *)(param_1 + 0x108),local_118);
    FUN_14015c350(local_118);
    FUN_1400d1290(uVar3);
  }
  return;
}



void FUN_1401af330(longlong param_1,int *param_2,byte *param_3)

{
  longlong lVar1;
  undefined8 *puVar2;
  byte bVar3;
  int iVar4;
  undefined8 uVar5;
  longlong *plVar6;
  longlong lVar7;
  longlong lVar8;
  int iVar9;
  longlong *local_res8;
  undefined1 local_1b8 [8];
  longlong local_1b0;
  longlong local_1a8;
  int local_19c;
  int local_190;
  undefined **local_188;
  int local_180;
  undefined2 local_17c;
  char local_178;
  undefined8 local_168;
  undefined1 local_160;
  undefined8 local_158;
  undefined4 local_150 [2];
  undefined1 local_148 [8];
  longlong local_140;
  longlong local_138;
  undefined4 local_130;
  int local_12c;
  int local_120;
  undefined **local_118;
  int local_110;
  undefined2 local_10c;
  char local_108;
  undefined1 local_100 [232];
  
  local_158 = 0xfffffffffffffffe;
  iVar9 = (int)((*param_2 >> 0x1f & 7U) + *param_2) >> 3;
  uVar5 = FUN_140176af0(*(undefined8 *)(param_1 + 0x108),param_2[10]);
  plVar6 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x1838);
  bVar3 = (**(code **)(*plVar6 + 0x10))(plVar6,param_2,uVar5);
  *param_3 = *param_3 | bVar3;
  if (*param_3 == 0) {
    FUN_140185160(param_2,iVar9);
    plVar6 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x17f0);
    bVar3 = (**(code **)(*plVar6 + 0x10))(plVar6,param_2,uVar5);
    *param_3 = *param_3 | bVar3;
    if (*param_3 == 0) {
      FUN_140185160(param_2,iVar9);
      FUN_140185560(local_1b8);
      local_188 = Proud::AddrPort::vftable;
      local_178 = 0;
      lVar8 = 0;
      local_190 = 0;
      local_180 = DAT_1402f83d0;
      local_17c = DAT_1402f83d4;
      FUN_140185030(local_1b8);
      if (*(longlong *)(param_2 + 2) == 0) {
        if (*(longlong *)(param_2 + 4) == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        iVar9 = param_2[6];
      }
      else {
        iVar9 = *(int *)(*(longlong *)(param_2 + 2) + 0x18);
      }
      iVar4 = (int)(*param_2 + (*param_2 >> 0x1f & 7U)) >> 3;
      lVar7 = *(longlong *)(param_2 + 4);
      if (*(longlong *)(param_2 + 4) == 0) {
        lVar1 = *(longlong *)(param_2 + 2);
        if (lVar1 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        lVar7 = lVar8;
        if (*(int *)(lVar1 + 0x18) != 0) {
          lVar7 = *(longlong *)(lVar1 + 0x10);
        }
      }
      FUN_140185b00(local_1b8,iVar4 + lVar7,iVar9 - iVar4);
      local_180 = param_2[0xe];
      local_17c = (undefined2)param_2[0xf];
      local_190 = param_2[10];
      local_178 = (char)param_2[0x10];
      if ((local_1b0 == 0) && (local_1a8 == 0)) {
        local_1b0 = FUN_14019a770();
        *(undefined8 *)(local_1b0 + 0x28) = 1;
      }
      (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
      FUN_140185590(local_148,local_1b8);
      local_120 = local_190;
      local_118 = Proud::AddrPort::vftable;
      local_110 = local_180;
      local_10c = local_17c;
      local_108 = local_178;
      FUN_14015c2a0(local_100);
      local_150[0] = 1;
      lVar7 = *(longlong *)(param_1 + 0x108);
      uVar5 = FUN_14017ebd0(lVar7 + 0x15e0,local_150,*(undefined8 *)(lVar7 + 0x15f0),0);
      if (*(undefined8 **)(lVar7 + 0x15f0) == (undefined8 *)0x0) {
        *(undefined8 *)(lVar7 + 0x15e8) = uVar5;
      }
      else {
        **(undefined8 **)(lVar7 + 0x15f0) = uVar5;
      }
      *(undefined8 *)(lVar7 + 0x15f0) = uVar5;
      FUN_14015c350(local_100);
      local_res8 = &local_140;
      FUN_14019a730(&local_140);
      if (local_138 != 0) {
        if (local_12c < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        local_130 = 0;
      }
      if ((local_190 != 1) && (local_190 != 0)) {
        uVar5 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
        local_168 = uVar5;
        FUN_1400a1c30(uVar5);
        local_160 = 1;
        plVar6 = (longlong *)FUN_1401755f0(*(undefined8 *)(param_1 + 0x108),&local_res8,local_190);
        if ((longlong *)*plVar6 != (longlong *)0x0) {
          lVar8 = *(longlong *)*plVar6;
        }
        if ((local_res8 != (longlong *)0x0) &&
           (local_res8[1] = local_res8[1] + -1, plVar6 = local_res8, uVar5 = local_168,
           local_res8[1] == 0)) {
          puVar2 = (undefined8 *)*local_res8;
          if (puVar2 != (undefined8 *)0x0) {
            (**(code **)*puVar2)(puVar2,1);
          }
          FUN_1400a3530(plVar6);
          uVar5 = local_168;
        }
        if (((lVar8 != 0) && (*(char *)(lVar8 + 0x684) == '\0')) &&
           (*(undefined1 *)(lVar8 + 0x21) = 1, local_178 == '\0')) {
          *(int *)(lVar8 + 0x48) = *(int *)(lVar8 + 0x48) + 1;
        }
        FUN_1400d1290(uVar5);
      }
      local_res8 = &local_1b0;
      FUN_14019a730(&local_1b0);
      if ((local_1a8 != 0) && (local_19c < 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
    }
  }
  return;
}



void FUN_1401af6b0(longlong param_1,int *param_2)

{
  int iVar1;
  longlong lVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined8 uVar5;
  longlong *plVar6;
  longlong lVar7;
  longlong lVar8;
  longlong *local_res10;
  undefined1 local_208 [8];
  longlong local_200;
  longlong local_1f8;
  int local_1ec;
  int local_1e0;
  undefined **local_1d8;
  int local_1d0;
  undefined2 local_1cc;
  char local_1c8;
  undefined8 local_1b8;
  undefined1 local_1b0;
  undefined8 local_1a8;
  undefined4 local_1a0 [2];
  undefined1 local_198 [8];
  longlong local_190;
  longlong local_188;
  undefined4 local_180;
  int local_17c;
  int local_170;
  undefined **local_168;
  int local_160;
  undefined2 local_15c;
  char local_158;
  undefined1 local_150 [232];
  undefined1 local_68 [80];
  
  local_1a8 = 0xfffffffffffffffe;
  FUN_140185560(local_208);
  local_1d8 = Proud::AddrPort::vftable;
  local_1c8 = 0;
  lVar8 = 0;
  local_1e0 = 0;
  local_1d0 = DAT_1402f83d0;
  local_1cc = DAT_1402f83d4;
  FUN_140185030(local_208);
  if (*(longlong *)(param_2 + 2) == 0) {
    if (*(longlong *)(param_2 + 4) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar1 = param_2[6];
  }
  else {
    iVar1 = *(int *)(*(longlong *)(param_2 + 2) + 0x18);
  }
  iVar4 = (int)(*param_2 + (*param_2 >> 0x1f & 7U)) >> 3;
  lVar7 = *(longlong *)(param_2 + 4);
  if (*(longlong *)(param_2 + 4) == 0) {
    lVar2 = *(longlong *)(param_2 + 2);
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    lVar7 = lVar8;
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar7 = *(longlong *)(lVar2 + 0x10);
    }
  }
  FUN_140185b00(local_208,iVar4 + lVar7,iVar1 - iVar4);
  local_1d0 = param_2[0xe];
  local_1cc = (undefined2)param_2[0xf];
  local_1e0 = param_2[10];
  local_1c8 = (char)param_2[0x10];
  if (local_200 == 0) {
    FUN_1400a2320(local_68,PTR_u_exception_due_to_not_using_Inter_14030c140);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_68,(ThrowInfo *)&DAT_1402f4860);
  }
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
  FUN_140185590(local_198,local_208);
  local_170 = local_1e0;
  local_168 = Proud::AddrPort::vftable;
  local_160 = local_1d0;
  local_15c = local_1cc;
  local_158 = local_1c8;
  FUN_14015c2a0(local_150);
  local_1a0[0] = 2;
  lVar7 = *(longlong *)(param_1 + 0x108);
  uVar5 = FUN_14017ebd0(lVar7 + 0x15e0,local_1a0,*(undefined8 *)(lVar7 + 0x15f0),0);
  if (*(undefined8 **)(lVar7 + 0x15f0) == (undefined8 *)0x0) {
    *(undefined8 *)(lVar7 + 0x15e8) = uVar5;
  }
  else {
    **(undefined8 **)(lVar7 + 0x15f0) = uVar5;
  }
  *(undefined8 *)(lVar7 + 0x15f0) = uVar5;
  FUN_14015c350(local_150);
  local_res10 = &local_190;
  FUN_14019a730(&local_190);
  if (local_188 != 0) {
    if (local_17c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_180 = 0;
  }
  if ((local_1e0 != 1) && (local_1e0 != 0)) {
    uVar5 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
    local_1b8 = uVar5;
    FUN_1400a1c30(uVar5);
    local_1b0 = 1;
    plVar6 = (longlong *)FUN_1401755f0(*(undefined8 *)(param_1 + 0x108),&local_res10,local_1e0);
    if ((longlong *)*plVar6 != (longlong *)0x0) {
      lVar8 = *(longlong *)*plVar6;
    }
    if ((local_res10 != (longlong *)0x0) &&
       (local_res10[1] = local_res10[1] + -1, plVar6 = local_res10, uVar5 = local_1b8,
       local_res10[1] == 0)) {
      puVar3 = (undefined8 *)*local_res10;
      if (puVar3 != (undefined8 *)0x0) {
        (**(code **)*puVar3)(puVar3,1);
      }
      FUN_1400a3530(plVar6);
      uVar5 = local_1b8;
    }
    if (((lVar8 != 0) && (*(char *)(lVar8 + 0x684) == '\0')) &&
       (*(undefined1 *)(lVar8 + 0x21) = 1, local_1c8 == '\0')) {
      *(int *)(lVar8 + 0x48) = *(int *)(lVar8 + 0x48) + 1;
    }
    FUN_1400d1290(uVar5);
  }
  local_res10 = &local_200;
  FUN_14019a730(&local_200);
  if ((local_1f8 != 0) && (local_1ec < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



undefined8 FUN_1401af9b0(longlong param_1,undefined8 param_2,int *param_3)

{
  undefined8 *puVar1;
  int *piVar2;
  undefined8 *puVar3;
  char cVar4;
  char cVar5;
  int iVar6;
  undefined8 uVar7;
  longlong lVar8;
  undefined8 *local_res8;
  undefined8 local_res10;
  uint local_res18 [2];
  undefined8 local_res20;
  undefined **local_78;
  undefined8 local_70;
  longlong local_68;
  undefined8 local_60;
  undefined8 local_58;
  int local_50;
  undefined **local_48;
  int local_40;
  undefined2 local_3c;
  undefined1 local_38;
  
  local_res10 = param_2;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
  iVar6 = (int)(*param_3 + (*param_3 >> 0x1f & 7U)) >> 3;
  local_res20 = CONCAT44(local_res20._4_4_,iVar6);
  cVar4 = FUN_140185dc0(param_3,local_res18);
  if (cVar4 == '\0') goto LAB_1401affa0;
  cVar4 = '\0';
  local_res8 = (undefined8 *)((ulonglong)local_res8 & 0xffffffffffffff00);
  switch(local_res18[0]) {
  case 1:
    FUN_1401af330(param_1,param_3,&local_res8);
    cVar4 = (char)local_res8;
    goto switchD_1401afa33_caseD_5;
  case 2:
    FUN_1401af6b0(param_1,param_3,&local_res8);
    goto switchD_1401afa33_caseD_5;
  case 3:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1401a8af0(param_1,param_3);
    }
    break;
  case 4:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1401abf10(param_1,param_3);
    }
    break;
  default:
    goto switchD_1401afa33_caseD_5;
  case 6:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1401ac8e0(param_1,param_3);
    }
    break;
  case 8:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1401a8b60(param_1,param_3);
    }
    break;
  case 9:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1401a8bd0(param_1,param_3);
    }
    break;
  case 10:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1401ae830(param_1,param_3);
    }
    break;
  case 0xb:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1401a8a70(param_1,param_3);
    }
    break;
  case 0xd:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1401aa4a0(param_1,param_3);
    }
    break;
  case 0xf:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1401ae590(param_1,param_3);
    }
    break;
  case 0x11:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1401a9760(param_1,param_3);
    }
    break;
  case 0x13:
    FUN_1401acc60(param_1,local_res10,param_3);
    break;
  case 0x17:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1401ad070(param_1,param_3);
    }
    break;
  case 0x18:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1401a98d0(param_1,local_res10,param_3);
    }
    break;
  case 0x19:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1401ad640(param_1,local_res10,param_3);
    }
    break;
  case 0x1c:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1401af160(param_1,param_3);
    }
    break;
  case 0x1d:
    break;
  case 0x1e:
    FUN_1401a88b0(param_1,param_3);
    break;
  case 0x1f:
    FUN_1401a88f0(param_1,param_3);
    break;
  case 0x20:
    FUN_1401ab160(param_1,param_3);
    break;
  case 0x21:
    FUN_1401a9d70(param_1,param_3);
    break;
  case 0x22:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1401ab980(param_1,local_res10,param_3);
    }
    break;
  case 0x23:
    FUN_1401aa7d0(param_1,local_res10,param_3);
    break;
  case 0x24:
  case 0x25:
    FUN_140185560(&local_78);
    local_48 = Proud::AddrPort::vftable;
    local_38 = 0;
    local_50 = 0;
    local_40 = DAT_1402f83d0;
    local_3c = DAT_1402f83d4;
    cVar5 = FUN_140189170(*(undefined8 *)(param_1 + 0x108),local_res18[0],param_3,&local_78);
    if (cVar5 != '\0') {
      local_38 = (undefined1)param_3[0x10];
      local_40 = param_3[0xe];
      local_3c = (undefined2)param_3[0xf];
      local_50 = param_3[10];
      cVar4 = FUN_1401af9b0(param_1,local_res10,&local_78);
    }
    local_res8 = &local_70;
    FUN_14019a730(&local_70);
    if ((local_68 != 0) && (local_60._4_4_ < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    goto switchD_1401afa33_caseD_5;
  case 0x26:
    FUN_140185560(&local_78);
    local_48 = Proud::AddrPort::vftable;
    local_38 = 0;
    local_50 = 0;
    local_40 = DAT_1402f83d0;
    local_3c = DAT_1402f83d4;
    cVar5 = FUN_1401875a0(*(undefined8 *)(param_1 + 0x108),param_3,&local_78);
    if (cVar5 != '\0') {
      local_38 = (undefined1)param_3[0x10];
      local_40 = param_3[0xe];
      local_3c = (undefined2)param_3[0xf];
      local_50 = param_3[10];
      cVar4 = FUN_1401af9b0(param_1,local_res10,&local_78);
    }
    local_res8 = &local_70;
    FUN_14019a730(&local_70);
    if ((local_68 != 0) && (local_60._4_4_ < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    goto switchD_1401afa33_caseD_5;
  case 0x27:
    FUN_1401ab410(param_1,local_res10,param_3);
    break;
  case 0x28:
    FUN_1401a9ee0(param_1,param_3);
  }
  cVar4 = '\x01';
switchD_1401afa33_caseD_5:
  if (*(longlong *)(param_3 + 2) == 0) {
    if (*(longlong *)(param_3 + 4) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar6 = param_3[6];
  }
  else {
    iVar6 = *(int *)(*(longlong *)(param_3 + 2) + 0x18);
  }
  if (cVar4 == '\x01') {
    if (((iVar6 != (int)(*param_3 + (*param_3 >> 0x1f & 7U)) >> 3) && (local_res18[0] != 0x24)) &&
       (local_res18[0] != 0x25)) {
      FUN_1400a3440();
      local_res8 = (undefined8 *)PTR_DAT_1402f8010;
      FUN_14003c600(&local_res8,&DAT_140262d78,
                    L"Proud::CNetClientWorker::ProcessMessage_ProudNetLayer",local_res18[0]);
      iVar6 = FUN_1401450b0(param_3);
      local_res20 = FUN_14016aa90(param_3);
      local_78 = Proud::CFastArray<>::vftable;
      local_70 = 0;
      local_68 = 0;
      local_60 = 0;
      local_58 = 0;
      if (iVar6 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      FUN_14003cda0(&local_78,iVar6);
      lVar8 = local_68;
      if ((int)local_60 == 0) {
        lVar8 = 0;
      }
      FUN_1400224d0(lVar8,local_res20,(longlong)iVar6);
      local_78 = Proud::ByteArray::vftable;
      uVar7 = FUN_1401416a0(&local_res20,0x1f,param_3[10],&local_res8,&local_78);
      (**(code **)(**(longlong **)(param_1 + 0x108) + 0x80))(*(longlong **)(param_1 + 0x108),uVar7);
      FUN_140140df0(&local_78);
      puVar3 = local_res8;
      if (((local_res8 != (undefined8 *)0x0) && (local_res8 != (undefined8 *)PTR_DAT_1402f8010)) &&
         (puVar1 = local_res8 + -1, puVar1 != (undefined8 *)0x0)) {
        uVar7 = FUN_1400a3440();
        FUN_1400a1c30(uVar7);
        piVar2 = (int *)((longlong)puVar3 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(puVar1);
        }
        FUN_1400d1290(uVar7);
      }
    }
  }
  else if (cVar4 == '\0') {
    iVar6 = (int)local_res20;
LAB_1401affa0:
    FUN_140185160(param_3,iVar6);
    return 0;
  }
  return 1;
}



void FUN_1401b0060(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong *plVar4;
  undefined8 uVar5;
  undefined1 local_78 [8];
  undefined1 local_70 [8];
  longlong local_68;
  int local_5c;
  undefined4 local_50;
  undefined **local_48;
  undefined4 local_40;
  undefined2 local_3c;
  undefined1 local_38;
  
  uVar5 = 0xfffffffffffffffe;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
  lVar1 = *(longlong *)(param_1 + 0x108);
  lVar2 = *(longlong *)(lVar1 + 0x6f8);
  while( true ) {
    if (lVar2 == 0) {
      return;
    }
    lVar2 = *(longlong *)(lVar1 + 0x6e8);
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    FUN_140185590(local_78,lVar2 + 0x10);
    local_50 = *(undefined4 *)(lVar2 + 0x38);
    local_48 = Proud::AddrPort::vftable;
    local_40 = *(undefined4 *)(lVar2 + 0x48);
    local_3c = *(undefined2 *)(lVar2 + 0x4c);
    local_38 = *(undefined1 *)(lVar2 + 0x50);
    FUN_1401af9b0(param_1,param_2,local_78,param_4,uVar5);
    plVar3 = *(longlong **)(lVar1 + 0x6e8);
    if (plVar3 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    lVar2 = *plVar3;
    *(longlong *)(lVar1 + 0x6e8) = lVar2;
    if (lVar2 == 0) {
      *(undefined8 *)(lVar1 + 0x6f0) = 0;
    }
    else {
      *(undefined8 *)(lVar2 + 8) = 0;
    }
    FUN_14019a730(plVar3 + 3);
    if (plVar3[4] != 0) {
      if (*(int *)((longlong)plVar3 + 0x2c) < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      *(undefined4 *)(plVar3 + 5) = 0;
    }
    plVar4 = *(longlong **)(lVar1 + 0x6e0);
    if (plVar4 == (longlong *)0x0) {
      FUN_1400a3530(plVar3);
    }
    else {
      (**(code **)(*plVar4 + 0x10))(plVar4,plVar3);
    }
    *(longlong *)(lVar1 + 0x6f8) = *(longlong *)(lVar1 + 0x6f8) + -1;
    FUN_14019a730(local_70);
    if ((local_68 != 0) && (local_5c < 0)) break;
    lVar2 = *(longlong *)(lVar1 + 0x6f8);
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_1401b0210(longlong param_1,longlong param_2,longlong param_3)

{
  undefined *puVar1;
  int *piVar2;
  longlong *plVar3;
  undefined8 uVar4;
  undefined4 uVar5;
  int iVar6;
  undefined8 uVar7;
  longlong lVar8;
  undefined8 *puVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  undefined *puVar12;
  undefined8 uVar13;
  undefined1 local_res8 [8];
  undefined *local_res10;
  undefined8 in_stack_fffffffffffffef8;
  undefined4 uVar14;
  longlong local_e8;
  undefined **local_e0;
  undefined4 local_d8;
  undefined2 local_d4;
  undefined **local_d0;
  undefined8 local_c8;
  longlong local_c0;
  undefined8 local_b8;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined **local_a8;
  undefined4 local_a0;
  undefined2 local_9c;
  undefined **local_98;
  undefined4 local_90;
  undefined2 local_8c;
  undefined **local_88;
  undefined4 local_80;
  undefined2 local_7c;
  undefined **local_78;
  undefined4 local_70;
  undefined2 local_6c;
  undefined8 local_68;
  undefined1 local_60;
  undefined8 local_58;
  
  uVar14 = (undefined4)((ulonglong)in_stack_fffffffffffffef8 >> 0x20);
  local_58 = 0xfffffffffffffffe;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
  *(undefined1 *)(param_2 + 0xc0) = 0;
  if ((*(double *)(param_2 + 0x148) == 0.0) && (0 < *(int *)(param_3 + 8))) {
    uVar13 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
    plVar3 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x678);
    *plVar3 = *plVar3 + 1;
    plVar3 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x680);
    *plVar3 = *plVar3 + (longlong)*(int *)(param_3 + 8);
    local_e0 = Proud::AddrPort::vftable;
    uVar11 = 0;
    local_d8 = 0;
    local_d4 = 0;
    local_e8 = 0;
    FUN_1400a3440();
    local_res10 = PTR_DAT_1402f8010;
    local_78 = Proud::AddrPort::vftable;
    local_80 = *(undefined4 *)(param_3 + 0x30);
    local_7c = *(undefined2 *)(param_3 + 0x34);
    local_88 = Proud::AddrPort::vftable;
    uVar10 = uVar11;
    if (*(ulonglong **)(param_2 + 0x100) != (ulonglong *)0x0) {
      uVar10 = **(ulonglong **)(param_2 + 0x100);
    }
    uVar4 = *(undefined8 *)(param_2 + 0x188);
    local_70 = local_80;
    local_6c = local_7c;
    uVar5 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0xe0))
                      (*(longlong **)(param_1 + 0x108),&local_78);
    uVar7 = FUN_1400a8b30(uVar10);
    iVar6 = FUN_14019f540(uVar4,uVar7,*(undefined4 *)(param_3 + 8),&local_88,CONCAT44(uVar14,uVar5),
                          uVar13,&local_e8,&local_res10);
    if (iVar6 == 0) {
      local_c8 = 0;
      local_c0 = 0;
      local_b8 = 0;
      local_d0 = Proud::CReceivedMessageList::vftable;
      local_b0 = 1000;
      local_ac = 1;
      local_a8 = Proud::AddrPort::vftable;
      local_a0 = local_d8;
      local_9c = local_d4;
      uVar10 = uVar11;
      if (*(int *)(local_e8 + 0x40) != 0) {
        uVar10 = *(ulonglong *)(local_e8 + 0x38);
      }
      FUN_140178e40(*(undefined8 *)(param_1 + 0x108),uVar10,*(int *)(local_e8 + 0x40),&local_a8,
                    &local_d0,local_res8);
      while (iVar6 = (int)uVar11, iVar6 != (int)local_b8) {
        if ((iVar6 < 0) || ((int)local_b8 <= iVar6)) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        lVar8 = *(longlong *)(param_1 + 0x108);
        uVar13 = FUN_1401ab8d0(lVar8 + 0x6e0,local_c0 + (longlong)iVar6 * 0x48,
                               *(undefined8 *)(lVar8 + 0x6f0),0);
        if (*(undefined8 **)(lVar8 + 0x6f0) == (undefined8 *)0x0) {
          *(undefined8 *)(lVar8 + 0x6e8) = uVar13;
        }
        else {
          **(undefined8 **)(lVar8 + 0x6f0) = uVar13;
        }
        *(undefined8 *)(lVar8 + 0x6f0) = uVar13;
        if ((int)local_b8 <= iVar6) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        uVar11 = (ulonglong)(iVar6 + 1);
      }
      if ((*(longlong *)(param_2 + 0x120) != 0) ||
         (lVar8 = FUN_140169e30(*(undefined8 *)(param_1 + 0x108)), param_2 == lVar8)) {
        FUN_1401b0060(param_1,param_2);
      }
      FUN_14018eb10(&local_d0);
    }
    else if (iVar6 == 2) {
      puVar12 = local_res10;
      if (local_res10 == (undefined *)0x0) {
        puVar12 = PTR_DAT_1402f8010;
      }
      local_98 = Proud::AddrPort::vftable;
      local_90 = *(undefined4 *)(param_3 + 0x30);
      local_8c = *(undefined2 *)(param_3 + 0x34);
      puVar9 = (undefined8 *)(*(longlong *)(param_1 + 0x108) + 0x88);
      (**(code **)*puVar9)(puVar9,&local_98,puVar12);
    }
    puVar12 = local_res10;
    if (((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_res10 + -8, puVar1 != (undefined *)0x0)) {
      uVar13 = FUN_1400a3440();
      local_68 = uVar13;
      FUN_1400a1c30(uVar13);
      local_60 = 1;
      piVar2 = (int *)(puVar12 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar13);
    }
    local_res10 = PTR_DAT_1402f8010;
    if (local_e8 != 0) {
      FUN_14018b6e0();
    }
  }
  FUN_1401bc490(param_2);
  return;
}



undefined8 FUN_1401b0570(longlong param_1)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined4 *puVar5;
  undefined8 *puVar6;
  undefined4 local_b8;
  undefined4 local_b4;
  longlong local_b0;
  longlong local_a8;
  undefined4 local_a0;
  int local_9c;
  undefined1 local_98;
  undefined4 local_90;
  undefined **local_88;
  undefined4 local_80;
  undefined2 local_7c;
  undefined1 local_78;
  undefined8 local_68;
  undefined1 local_60;
  undefined1 local_58 [8];
  undefined1 local_50 [8];
  longlong local_48;
  int local_3c;
  undefined8 local_30;
  
  local_30 = 0xfffffffffffffffe;
  uVar4 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
  local_68 = uVar4;
  FUN_1400a1c30(uVar4);
  local_60 = 1;
  if (*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x1548) == 0) {
    FUN_1400d1290(uVar4);
    uVar4 = 0;
  }
  else {
    FUN_140185560(&local_b8);
    local_88 = Proud::AddrPort::vftable;
    local_78 = 0;
    local_80 = DAT_1402f83d0;
    local_7c = DAT_1402f83d4;
    local_90 = *(undefined4 *)(*(longlong *)(param_1 + 0x108) + 0x1578);
    puVar5 = (undefined4 *)FUN_1401acbe0(*(longlong *)(param_1 + 0x108) + 0x1530,local_58);
    local_b8 = *puVar5;
    local_b4 = puVar5[1];
    if (*(longlong *)(puVar5 + 2) == local_b0) {
      local_9c = puVar5[7];
      local_a8 = *(longlong *)(puVar5 + 4);
      local_a0 = puVar5[6];
    }
    else {
      FUN_14019a730(&local_b0);
      if (*(longlong *)(puVar5 + 2) != 0) {
        plVar1 = (longlong *)(*(longlong *)(puVar5 + 2) + 0x28);
        *plVar1 = *plVar1 + 1;
        local_b0 = *(longlong *)(puVar5 + 2);
      }
    }
    local_98 = *(undefined1 *)(puVar5 + 8);
    FUN_14019a730(local_50);
    if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_140185160(&local_b8,0);
    lVar2 = *(longlong *)(param_1 + 0x108);
    uVar3 = *(undefined8 *)(lVar2 + 0x6f0);
    plVar1 = *(longlong **)(lVar2 + 0x6e0);
    if (plVar1 == (longlong *)0x0) {
      puVar6 = (undefined8 *)FUN_1400a34c0(0x58);
    }
    else {
      puVar6 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,0x58);
    }
    if (puVar6 != (undefined8 *)0x0) {
      FUN_140185590(puVar6 + 2,&local_b8);
      *(undefined4 *)(puVar6 + 7) = local_90;
      puVar6[8] = Proud::AddrPort::vftable;
      *(undefined4 *)(puVar6 + 9) = local_80;
      *(undefined2 *)((longlong)puVar6 + 0x4c) = local_7c;
      *(undefined1 *)(puVar6 + 10) = local_78;
    }
    puVar6[1] = uVar3;
    *puVar6 = 0;
    *(longlong *)(lVar2 + 0x6f8) = *(longlong *)(lVar2 + 0x6f8) + 1;
    if (*(undefined8 **)(lVar2 + 0x6f0) == (undefined8 *)0x0) {
      *(undefined8 **)(lVar2 + 0x6e8) = puVar6;
    }
    else {
      **(undefined8 **)(lVar2 + 0x6f0) = puVar6;
    }
    *(undefined8 **)(lVar2 + 0x6f0) = puVar6;
    FUN_1401b0060(param_1,0);
    FUN_14019a730(&local_b0);
    if (local_a8 != 0) {
      if (local_9c < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_a0 = 0;
    }
    FUN_1400d1290(uVar4);
    uVar4 = 1;
  }
  return uVar4;
}



void FUN_1401b07c0(longlong param_1,longlong param_2)

{
  undefined *puVar1;
  int *piVar2;
  longlong *plVar3;
  undefined *puVar4;
  char cVar5;
  uint uVar6;
  uint uVar7;
  uint uVar8;
  int iVar9;
  longlong lVar10;
  uint *puVar11;
  ulonglong uVar12;
  uint *puVar13;
  ulonglong uVar14;
  uint uVar15;
  uint uVar16;
  uint *local_res8;
  undefined *local_res10;
  undefined *local_res18;
  undefined8 uVar17;
  undefined **local_50;
  undefined8 local_48;
  longlong local_40;
  undefined8 local_38;
  undefined4 local_30;
  undefined4 local_2c;
  
  uVar17 = 0xfffffffffffffffe;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
  lVar10 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
  *(undefined1 *)(lVar10 + 0xc0) = 0;
  if (*(int *)(param_2 + 8) < 1) {
    FUN_1400a3440();
    local_res10 = PTR_DAT_1402f8010;
    FUN_14003c600(&local_res10,L"compeltedlength < 0 recvcomplete errorcode:%d",
                  *(undefined4 *)(param_2 + 0xc));
    FUN_140182b30(*(undefined8 *)(param_1 + 0x108),0xb,3,&local_res10,uVar17);
    if (*(int *)(param_1 + 0x100) < 4) {
      *(undefined4 *)(param_1 + 0x40) = 0;
      *(undefined4 *)(param_1 + 0x100) = 4;
      uVar17 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
      *(undefined8 *)(param_1 + 0x80) = uVar17;
      *(undefined1 *)(param_1 + 0xc0) = 0;
    }
    puVar4 = local_res10;
    if (((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1402f8010)) &&
       (puVar1 = local_res10 + -8, puVar1 != (undefined *)0x0)) {
      uVar17 = FUN_1400a3440();
      FUN_1400a1c30(uVar17);
      piVar2 = (int *)(puVar4 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar1);
      }
      FUN_1400d1290(uVar17);
    }
    local_res10 = PTR_DAT_1402f8010;
    goto LAB_1401b0cd7;
  }
  lVar10 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
  uVar14 = 0;
  uVar12 = uVar14;
  if (*(ulonglong **)(lVar10 + 0x128) != (ulonglong *)0x0) {
    uVar12 = **(ulonglong **)(lVar10 + 0x128);
  }
  cVar5 = FUN_1400a8b50(uVar12);
  uVar15 = 0;
  if (cVar5 == '\0') {
    uVar17 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
    *(undefined8 *)(*(longlong *)(param_1 + 0x108) + 0x18c0) = uVar17;
    lVar10 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
    uVar12 = uVar14;
    if (*(ulonglong **)(lVar10 + 0x128) != (ulonglong *)0x0) {
      uVar12 = **(ulonglong **)(lVar10 + 0x128);
    }
    uVar17 = FUN_1400a8b30(uVar12);
    lVar10 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
    FUN_1401c11f0(lVar10 + 0x130,uVar17,*(undefined4 *)(param_2 + 8));
    plVar3 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x658);
    *plVar3 = *plVar3 + (longlong)*(int *)(param_2 + 8);
    local_48 = 0;
    local_40 = 0;
    local_38 = 0;
    local_50 = Proud::CReceivedMessageList::vftable;
    local_30 = 1000;
    local_2c = 1;
    FUN_1401792f0(*(undefined8 *)(param_1 + 0x108),&local_50);
    while (iVar9 = (int)uVar14, iVar9 != (int)local_38) {
      if ((iVar9 < 0) || ((int)local_38 <= iVar9)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      lVar10 = *(longlong *)(param_1 + 0x108);
      uVar17 = FUN_1401ab8d0(lVar10 + 0x6e0,local_40 + (longlong)iVar9 * 0x48,
                             *(undefined8 *)(lVar10 + 0x6f0),0);
      if (*(undefined8 **)(lVar10 + 0x6f0) == (undefined8 *)0x0) {
        *(undefined8 *)(lVar10 + 0x6e8) = uVar17;
      }
      else {
        **(undefined8 **)(lVar10 + 0x6f0) = uVar17;
      }
      *(undefined8 *)(lVar10 + 0x6f0) = uVar17;
      if ((int)local_38 <= iVar9) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      uVar14 = (ulonglong)(iVar9 + 1);
    }
    FUN_1401b0060(param_1,0);
    FUN_14018eb10(&local_50);
    goto LAB_1401b0cd7;
  }
  if (3 < *(int *)(param_1 + 0x100)) goto LAB_1401b0cd7;
  FUN_1400a3440();
  local_res8 = (uint *)PTR_DAT_1402f8010;
  uVar6 = FUN_1400a32c0(L"close socket completion");
  if ((local_res8 != (uint *)0x0) && (uVar14 = 0, local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar14 = (ulonglong)local_res8[-2];
  }
  uVar7 = 0;
  uVar8 = uVar6;
  if ((((int)uVar6 <= (int)uVar14) && (uVar8 = uVar15, local_res8 != (uint *)0x0)) &&
     (uVar8 = uVar7, local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar8 = local_res8[-2];
  }
  uVar16 = 1;
  if (1 < (int)uVar8) {
    uVar16 = uVar8;
  }
  uVar8 = uVar7;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar8 = local_res8[-2];
  }
  if ((int)uVar8 < (int)uVar16) {
    if (local_res8 == (uint *)0x0) {
      local_res8 = (uint *)PTR_DAT_1402f8010;
    }
    if ((int)uVar16 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar16 == 0) {
      FUN_1400031d0(&local_res8);
    }
    else {
      uVar8 = uVar15;
      if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
        uVar8 = local_res8[-2];
      }
      if (uVar16 != uVar8) {
        puVar11 = (uint *)FUN_1400a34c0((longlong)(int)uVar16 * 2 + 10);
        if (puVar11 != (uint *)0x0) {
          *puVar11 = 0;
          puVar11[1] = 1;
        }
        *puVar11 = uVar16;
        uVar8 = uVar15;
        if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
          uVar8 = local_res8[-2];
        }
        puVar13 = (uint *)PTR_DAT_1402f8010;
        if ((int)uVar16 < (int)uVar8) {
LAB_1401b0a2c:
          if (local_res8 != (uint *)0x0) {
            puVar13 = local_res8;
          }
        }
        else {
          uVar16 = uVar15;
          if (local_res8 != (uint *)0x0) {
            if (local_res8 != (uint *)PTR_DAT_1402f8010) {
              uVar16 = local_res8[-2];
            }
            goto LAB_1401b0a2c;
          }
        }
        FUN_1400a32f0(puVar11 + 2,puVar13,uVar16);
        FUN_1400031d0(&local_res8);
        local_res8 = puVar11 + 2;
      }
    }
  }
  FUN_140002e30(&local_res8);
  puVar11 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar11 = (uint *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar11,L"close socket completion",uVar6);
  puVar11 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar11 = (uint *)PTR_DAT_1402f8010;
  }
  uVar6 = FUN_1400a32c0(puVar11);
  uVar15 = 0;
  if (0 < (int)uVar6) {
    uVar15 = uVar6;
  }
  uVar6 = uVar7;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) {
    uVar6 = local_res8[-2];
  }
  if (((int)uVar15 < (int)uVar6) || (uVar15 = uVar7, local_res8 == (uint *)0x0)) {
LAB_1401b0abf:
    if (((local_res8 != (uint *)PTR_DAT_1402f8010) && (local_res8 != (uint *)0x0)) &&
       (local_res8 + -2 != (uint *)0x0)) {
      local_res8[-2] = uVar15;
      *(undefined2 *)((longlong)local_res8 + (longlong)(int)uVar15 * 2) = 0;
    }
  }
  else if (local_res8 != (uint *)PTR_DAT_1402f8010) {
    uVar15 = local_res8[-2];
    goto LAB_1401b0abf;
  }
  FUN_140182b30(*(undefined8 *)(param_1 + 0x108),0xb,3,&local_res8);
  puVar11 = local_res8;
  if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1402f8010)) &&
     (puVar13 = local_res8 + -2, puVar13 != (uint *)0x0)) {
    uVar17 = FUN_1400a3440();
    FUN_1400a1c30(uVar17);
    puVar11 = puVar11 + -1;
    *puVar11 = *puVar11 - 1;
    if (*puVar11 == 0) {
      FUN_1400a3530(puVar13);
    }
    FUN_1400d1290(uVar17);
  }
  local_res8 = (uint *)PTR_DAT_1402f8010;
  if (*(int *)(param_1 + 0x100) < 4) {
    *(undefined4 *)(param_1 + 0x40) = 0;
    *(undefined4 *)(param_1 + 0x100) = 4;
    uVar17 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
    *(undefined8 *)(param_1 + 0x80) = uVar17;
    *(undefined1 *)(param_1 + 0xc0) = 0;
  }
LAB_1401b0cd7:
  lVar10 = 0;
  plVar3 = *(longlong **)(*(longlong *)(param_1 + 0x108) + 0x5d0);
  if (plVar3 != (longlong *)0x0) {
    lVar10 = *plVar3;
  }
  if (*(int *)(lVar10 + 0x100) < 4) {
    uVar17 = FUN_140169e50(*(undefined8 *)(param_1 + 0x108));
    iVar9 = FUN_1401b7fb0(uVar17);
    if (iVar9 != 0) {
      FUN_1400a3440();
      local_res18 = PTR_DAT_1402f8010;
      FUN_14003c600(&local_res18,L"%d Tcp issueRecv Failed SocketErrorCode",iVar9);
      FUN_140182b30(*(undefined8 *)(param_1 + 0x108),3,1,&local_res18);
      if (*(int *)(param_1 + 0x100) < 4) {
        *(undefined4 *)(param_1 + 0x40) = 0;
        *(undefined4 *)(param_1 + 0x100) = 4;
        uVar17 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
        *(undefined8 *)(param_1 + 0x80) = uVar17;
        *(undefined1 *)(param_1 + 0xc0) = 0;
      }
      puVar4 = local_res18;
      if (((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1402f8010)) &&
         (puVar1 = local_res18 + -8, puVar1 != (undefined *)0x0)) {
        uVar17 = FUN_1400a3440();
        FUN_1400a1c30(uVar17);
        piVar2 = (int *)(puVar4 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_1400a3530(puVar1);
        }
        FUN_1400d1290(uVar17);
      }
    }
  }
  return;
}



void FUN_1401b0e00(longlong param_1)

{
  char cVar1;
  double dVar2;
  undefined8 uVar3;
  
  FUN_14017a700(*(undefined8 *)(param_1 + 0x108));
  FUN_1401aa1f0(param_1);
  FUN_1401a9380(param_1);
  do {
    dVar2 = (double)(**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))
                              (*(longlong *)(param_1 + 0x108) + 0x70);
    if ((0.0 < *(double *)(param_1 + 0xd0)) &&
       (dVar2 = dVar2 - *(double *)(param_1 + 0xd0),
       *(double *)(param_1 + 0xd8) <= dVar2 && dVar2 != *(double *)(param_1 + 0xd8))) {
      if (*(int *)(param_1 + 0x100) < 4) {
        *(undefined4 *)(param_1 + 0x40) = 0;
        *(undefined4 *)(param_1 + 0x100) = 4;
        uVar3 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))
                          (*(longlong *)(param_1 + 0x108) + 0x70);
        *(undefined8 *)(param_1 + 0x80) = uVar3;
        *(undefined1 *)(param_1 + 0xc0) = 0;
      }
      return;
    }
    cVar1 = FUN_1401b0570(param_1);
    if (*(int *)(param_1 + 0x100) == 4) {
      return;
    }
  } while (cVar1 != '\0');
  return;
}



undefined8 FUN_1401b0ed0(longlong param_1,undefined8 *param_2)

{
  bool bVar1;
  undefined4 uVar2;
  undefined *puVar3;
  undefined8 uVar4;
  undefined *local_res18;
  
  puVar3 = (undefined *)
           __RTDynamicCast(*param_2,0,&Proud::ICompletionContext::RTTI_Type_Descriptor,
                           &Proud::CTcpLayer_C::RTTI_Type_Descriptor,0);
  if (puVar3 == (undefined *)0x0) {
    uVar4 = 0;
  }
  else {
    param_1 = param_1 + 0x10;
    local_res18 = puVar3;
    FUN_1400a1c30(param_1);
    bVar1 = true;
    if (*(int *)(param_2 + 2) == 1) {
      uVar4 = (**(code **)(**(longlong **)(puVar3 + 0x120) + 0x38))();
      FUN_1401aa980(uVar4,param_2);
    }
    else if (*(int *)(param_2 + 2) == 2) {
      uVar4 = (**(code **)(**(longlong **)(puVar3 + 0x120) + 0x38))();
      FUN_1401b07c0(uVar4,param_2);
    }
    else {
      FUN_1400d1290(param_1);
      bVar1 = false;
      FUN_1400a3440();
      local_res18 = PTR_DAT_1402f8010;
      uVar2 = FUN_1400a32c0(L"Unexpected at Client IOCP TCP completion!");
      uVar4 = FUN_140002f20(&local_res18,uVar2);
      FUN_1400a32f0(uVar4,L"Unexpected at Client IOCP TCP completion!",uVar2);
      FUN_140003000(&local_res18);
      FUN_1400a6370(&local_res18);
    }
    if (bVar1) {
      FUN_1400d1290(param_1);
    }
    uVar4 = 1;
  }
  return uVar4;
}



undefined8 FUN_1401b1030(longlong param_1,undefined8 *param_2)

{
  bool bVar1;
  undefined4 uVar2;
  undefined *puVar3;
  undefined8 uVar4;
  undefined *local_res18 [2];
  
  uVar4 = 0;
  puVar3 = (undefined *)
           __RTDynamicCast(*param_2,0,&Proud::ICompletionContext::RTTI_Type_Descriptor,
                           &Proud::CUdpSocket_C::RTTI_Type_Descriptor,0);
  if (puVar3 == (undefined *)0x0) {
    uVar4 = 0;
  }
  else {
    param_1 = param_1 + 0x10;
    local_res18[0] = puVar3;
    FUN_1400a1c30(param_1);
    bVar1 = true;
    if (*(int *)(param_2 + 2) == 1) {
      if (*(undefined8 **)(*(longlong *)(puVar3 + 0x118) + 0x5d0) != (undefined8 *)0x0) {
        uVar4 = **(undefined8 **)(*(longlong *)(puVar3 + 0x118) + 0x5d0);
      }
      FUN_1401a8c40(uVar4,puVar3,param_2);
    }
    else if (*(int *)(param_2 + 2) == 2) {
      if (*(undefined8 **)(*(longlong *)(puVar3 + 0x118) + 0x5d0) != (undefined8 *)0x0) {
        uVar4 = **(undefined8 **)(*(longlong *)(puVar3 + 0x118) + 0x5d0);
      }
      FUN_1401b0210(uVar4,puVar3,param_2);
    }
    else {
      FUN_1400d1290(param_1);
      bVar1 = false;
      FUN_1400a3440();
      local_res18[0] = PTR_DAT_1402f8010;
      uVar2 = FUN_1400a32c0(L"Unexpected at Client IOCP UDP completion!");
      uVar4 = FUN_140002f20(local_res18,uVar2);
      FUN_1400a32f0(uVar4,L"Unexpected at Client IOCP UDP completion!",uVar2);
      FUN_140003000(local_res18);
      FUN_1400a6370(local_res18);
    }
    if (bVar1) {
      FUN_1400d1290(param_1);
    }
    uVar4 = 1;
  }
  return uVar4;
}



void FUN_1401b11b0(longlong param_1)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
  FUN_1400a1c30(uVar1);
  FUN_1401b0e00(param_1);
  FUN_1400d1290(uVar1);
  return;
}



void FUN_1401b1210(longlong param_1,undefined4 param_2)

{
  char cVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined *local_res8 [4];
  undefined8 local_48;
  undefined8 local_40;
  undefined4 local_38;
  undefined8 local_30;
  undefined4 local_28;
  undefined **local_20;
  undefined4 local_18;
  undefined2 local_14;
  
  local_20 = Proud::AddrPort::vftable;
  local_48 = 0;
  local_30 = 0;
  local_40 = 0;
  local_28 = 0;
  local_18 = DAT_1402f83d0;
  local_14 = DAT_1402f83d4;
  local_38 = 5;
  cVar1 = FUN_1400abce0(*(undefined8 *)(param_1 + 0x2b8),&local_48,param_2);
  if (cVar1 != '\0') {
    cVar1 = FUN_1401b0ed0(param_1,&local_48);
    if (cVar1 == '\0') {
      cVar1 = FUN_1401b1030(param_1,&local_48);
      if (cVar1 == '\0') {
        FUN_1400a3440();
        local_res8[0] = PTR_DAT_1402f8010;
        uVar2 = FUN_1400a32c0(L"Unexpected at Client IOCP completion!");
        uVar3 = FUN_140002f20(local_res8,uVar2);
        FUN_1400a32f0(uVar3,L"Unexpected at Client IOCP completion!",uVar2);
        FUN_140003000(local_res8);
        FUN_1400a6370(local_res8);
      }
    }
  }
  return;
}



void FUN_1401b12f0(longlong param_1)

{
  int iVar1;
  undefined8 uVar2;
  
  iVar1 = *(int *)(param_1 + 0x100);
  if (iVar1 == 0) {
    FUN_1401adcd0();
  }
  else if (iVar1 == 1) {
    FUN_1401a9ba0();
  }
  else if (iVar1 == 2) {
    FUN_1401a8e80();
  }
  else if (iVar1 == 3) {
    FUN_1401b11b0();
  }
  else if (iVar1 == 4) {
    FUN_1401aac50();
  }
  FUN_14016bc30(*(undefined8 *)(param_1 + 0x108));
  uVar2 = FUN_140169c60(*(undefined8 *)(param_1 + 0x108));
  FUN_1401bd070(*(longlong *)(param_1 + 0x108) + 0x1878,uVar2);
  if (*(char *)(*(longlong *)(param_1 + 0x108) + 0x1888) != '\0') {
    FUN_14016c160();
  }
  return;
}



void FUN_1401b1380(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  undefined8 *puVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined1 uVar8;
  
  uVar7 = 0xfffffffffffffffe;
  lVar3 = param_1 + 0x10;
  lVar5 = lVar3;
  FUN_1400a1c30(lVar3);
  uVar8 = 1;
  if (*(longlong *)(param_1 + 0x298) != 0) {
    lVar4 = *(longlong *)(param_1 + 0x298);
    lVar3 = lVar5;
    do {
      if (*(longlong *)(param_1 + 0x2b8) == 0) {
        if (*(int *)(lVar4 + 0x100) < 5) {
          *(undefined4 *)(lVar4 + 0x40) = 0;
          *(undefined4 *)(lVar4 + 0x100) = 5;
          uVar6 = (**(code **)(*(longlong *)(*(longlong *)(lVar4 + 0x108) + 0x70) + 0x1c0))();
          *(undefined8 *)(lVar4 + 0x80) = uVar6;
          *(undefined1 *)(lVar4 + 0xc0) = 0;
        }
      }
      else {
        FUN_1401b12f0(lVar4);
      }
      if (*(int *)(lVar4 + 0x100) == 5) {
        lVar5 = *(longlong *)(lVar4 + 8);
        FUN_1401ab6e0(param_1,lVar4,param_3,param_4,uVar7,lVar3,uVar8);
        lVar4 = *(longlong *)(lVar4 + 0x108);
        if (*(longlong *)(lVar4 + 0x5d0) != 0) {
          *(longlong *)(*(longlong *)(lVar4 + 0x5d0) + 8) =
               *(longlong *)(*(longlong *)(lVar4 + 0x5d0) + 8) + -1;
          puVar2 = (undefined8 *)0x0;
          if (*(longlong *)(*(longlong *)(lVar4 + 0x5d0) + 8) == 0) {
            puVar2 = *(undefined8 **)(lVar4 + 0x5d0);
          }
          *(undefined8 *)(lVar4 + 0x5d0) = 0;
          if (puVar2 != (undefined8 *)0x0) {
            pvVar1 = (void *)*puVar2;
            if (pvVar1 != (void *)0x0) {
              FUN_1401aa050(pvVar1);
              operator_delete(pvVar1);
            }
            FUN_1400a3530(puVar2);
          }
        }
      }
      else {
        lVar5 = *(longlong *)(lVar4 + 8);
      }
      lVar4 = lVar5;
    } while (lVar5 != 0);
  }
  FUN_1401ae480(param_1);
  FUN_1400d1290(lVar3);
  return;
}



void FUN_1401b14f0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  DWORD DVar2;
  HANDLE hThread;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  DVar2 = GetCurrentThreadId();
  FUN_1400aaed0(DVar2,"PNCliWorker",param_3,param_4,uVar3);
  DVar2 = GetCurrentThreadId();
  *(DWORD *)(param_1 + 0x284) = DVar2;
  if (DAT_1402f8147 != '\0') {
    hThread = GetCurrentThread();
    SetThreadPriority(hThread,1);
  }
  *(undefined1 *)(param_1 + 0x28c) = 0;
  cVar1 = *(char *)(param_1 + 0x80);
  while( true ) {
    if (cVar1 != '\0') {
      *(undefined1 *)(param_1 + 0x28c) = 1;
      return;
    }
    if (DAT_1403142d0 != '\0') break;
    FUN_1401b1210(param_1,DAT_1402f8074);
    if (*(char *)(param_1 + 0x280) != '\0') {
      *(undefined1 *)(param_1 + 0x280) = 0;
      FUN_1400a1c30();
      uVar3 = FUN_1400ad790(param_1 + 0x48);
      *(undefined8 *)(param_1 + 0xc0) = uVar3;
      uVar3 = FUN_1400ad7f0(param_1 + 0x48);
      *(undefined8 *)(param_1 + 0x100) = uVar3;
      *(double *)(param_1 + 0x180) =
           (*(double *)(param_1 + 0x100) - *(double *)(param_1 + 0x180)) * 0.3 +
           *(double *)(param_1 + 0x180);
      *(undefined1 *)(param_1 + 0x1c0) = 1;
      FUN_1400d1290(param_1 + 0x88);
      FUN_1401b1380(param_1);
      if (*(longlong *)(param_1 + 0x2b0) != 0) {
        FUN_1401b7e50();
      }
    }
    cVar1 = *(char *)(param_1 + 0x80);
  }
  return;
}



undefined8 * FUN_1401b1670(undefined8 *param_1)

{
  longlong *plVar1;
  void *pvVar2;
  UINT uDelay;
  longlong *plVar3;
  undefined4 uVar4;
  MMRESULT MVar5;
  longlong lVar6;
  longlong lVar7;
  undefined8 uVar8;
  longlong *local_res10;
  void *local_res18;
  
  *param_1 = Proud::CNetClientManager::vftable;
  param_1[1] = Proud::CNetClientManager::vftable;
  uVar4 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 2,uVar4,1);
  FUN_1400ad6b0(param_1 + 9);
  lVar7 = 0;
  param_1[0xf] = 0;
  uVar4 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0x11,uVar4,1);
  uVar4 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0x39,uVar4,1);
  param_1[0x41] = 0;
  param_1[0x44] = 0;
  param_1[0x42] = 0;
  param_1[0x43] = 0;
  param_1[0x45] = 0;
  param_1[0x48] = 0;
  param_1[0x46] = 0;
  param_1[0x47] = 0;
  param_1[0x52] = 0;
  param_1[0x53] = 0;
  param_1[0x54] = 0;
  *(undefined4 *)(param_1 + 0x55) = 0;
  param_1[0x56] = 0;
  param_1[0x57] = 0;
  FUN_1401a9060();
  *(undefined1 *)(param_1 + 0x38) = 0;
  FUN_1400ad700(param_1 + 9);
  uVar8 = FUN_1400ad790(param_1 + 9);
  param_1[0x18] = uVar8;
  param_1[0x20] = 0;
  param_1[0x30] = 0;
  *(undefined1 *)(param_1 + 0x38) = 1;
  param_1[0x4a] = 0;
  param_1[0x4b] = 0;
  param_1[0x40] = 0;
  param_1[0x49] = 0;
  local_res18 = operator_new(0xa8);
  lVar6 = lVar7;
  if (local_res18 != (void *)0x0) {
    lVar6 = FUN_1400aca10(local_res18,param_1,1);
  }
  param_1[0x57] = lVar6;
  *(undefined1 *)(param_1 + 0x10) = 0;
  *(undefined1 *)(param_1 + 0x50) = 0;
  *(undefined8 *)((longlong)param_1 + 0x284) = 0;
  param_1[0xe] = 0;
  uDelay = 1;
  if (1 < DAT_1402f8074) {
    uDelay = DAT_1402f8074;
  }
  MVar5 = timeSetEvent(uDelay,uDelay,&LAB_1401a8980,(DWORD_PTR)(param_1 + 0x50),1);
  *(MMRESULT *)(param_1 + 0x4c) = MVar5;
  local_res10 = operator_new(0x28);
  lVar6 = lVar7;
  if (local_res10 != (longlong *)0x0) {
    lVar6 = FUN_1400aa980(local_res10,&LAB_1401b1660,param_1);
  }
  if (lVar6 == 0) {
    local_res10 = (longlong *)0x0;
  }
  else {
    local_res10 = (longlong *)FUN_1400a34c0(0x10);
    local_res10[1] = 1;
    *local_res10 = lVar6;
  }
  plVar1 = local_res10;
  FUN_14018b790(param_1 + 0xf,&local_res10);
  plVar3 = local_res10;
  if (plVar1 != (longlong *)0x0) {
    plVar1 = plVar1 + 1;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      pvVar2 = (void *)*local_res10;
      if (pvVar2 != (void *)0x0) {
        FUN_1400aaa90(pvVar2);
        operator_delete(pvVar2);
      }
      FUN_1400a3530(plVar3);
    }
  }
  if ((longlong *)param_1[0xf] != (longlong *)0x0) {
    lVar7 = *(longlong *)param_1[0xf];
  }
  FUN_1400aab80(lVar7);
  return param_1;
}



longlong * FUN_1401b18f0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  
  *(undefined4 *)(param_1 + 1) = 0;
  *(undefined4 *)((longlong)param_1 + 0xc) = 0;
  *(undefined4 *)(param_1 + 2) = 0;
  *(undefined4 *)((longlong)param_1 + 0x14) = 0;
  param_1[0x19] = (longlong)Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 0x1a) = 0;
  *(undefined2 *)((longlong)param_1 + 0xd4) = 0;
  param_1[0x18] = 0;
  *(undefined1 *)(param_1 + 8) = 0;
  *(undefined4 *)(param_1 + 0x1a) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_1 + 0xd4) = DAT_1402f83d4;
  *param_1 = param_2;
  param_1[0x20] = DAT_1402f8078;
  *(undefined4 *)(param_1 + 0x28) = 0;
  *(undefined1 *)(param_1 + 0x10) = 0;
  param_1[0x18] = 0;
  *(undefined4 *)(param_1 + 0x38) = 0;
  param_1[0x40] = -0x4010000000000000;
  lVar1 = (**(code **)(*(longlong *)(param_2 + 0x70) + 0x1c0))(param_2 + 0x70);
  param_1[0x30] = lVar1;
  return param_1;
}



void FUN_1401b19c0(longlong *param_1,char param_2)

{
  longlong lVar1;
  
  if ((char)param_1[0x10] != param_2) {
    *(char *)(param_1 + 0x10) = param_2;
    lVar1 = (**(code **)(*(longlong *)(*param_1 + 0x70) + 0x1c0))(*param_1 + 0x70);
    param_1[0x30] = lVar1;
    *(undefined4 *)(param_1 + 0x38) = 0;
    param_1[0x40] = -0x4010000000000000;
    if (param_2 != '\0') {
      lVar1 = (**(code **)(*(longlong *)(*param_1 + 0x70) + 0x1c0))(*param_1 + 0x70);
      param_1[0x18] = lVar1;
    }
  }
  return;
}



void FUN_1401b1a40(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong param_4)

{
  longlong *plVar1;
  char cVar2;
  undefined2 uVar3;
  undefined4 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined **local_38;
  undefined4 local_30;
  undefined2 local_2c;
  undefined8 local_28;
  undefined1 local_20;
  
  (**(code **)(*(longlong *)(*param_1 + 0x78) + 0x10))(*param_1 + 0x78);
  if ((char)param_1[0x10] != '\0') {
    lVar5 = FUN_140169e30(*param_1);
    cVar2 = (**(code **)(*(longlong *)(lVar5 + 0x40) + 0x10))(lVar5 + 0x40);
    if (cVar2 == '\0') {
      if (*(char *)(param_4 + 0x18) == '\0') {
        *(int *)(*param_1 + 0x508) = *(int *)(*param_1 + 0x508) + 1;
      }
      local_38 = Proud::AddrPort::vftable;
      local_30 = (undefined4)param_1[0x1a];
      local_2c = *(undefined2 *)((longlong)param_1 + 0xd4);
      plVar1 = (longlong *)*param_1;
      uVar7 = (**(code **)(plVar1[0xe] + 0x1c0))();
      uVar4 = (**(code **)(*plVar1 + 0x30))(plVar1);
      uVar3 = FUN_14019c290(uVar4,1);
      uVar6 = FUN_140169e30(*param_1);
      FUN_1401bc800(uVar6,param_2,uVar3,&local_38,param_3,uVar7,param_4);
      return;
    }
  }
  local_28 = *(undefined8 *)(param_4 + 8);
  local_20 = *(undefined1 *)(param_4 + 0x10);
  uVar6 = FUN_140169e50(*param_1);
  FUN_1401b82c0(uVar6,param_3,&local_28);
  return;
}



undefined8 FUN_1401b1b90(int param_1)

{
  if (param_1 == 0) {
    return 0x15;
  }
  if (param_1 == 1) {
    return 0x46;
  }
  if (param_1 == 2) {
    return 0x50;
  }
  if (param_1 != 3) {
    if (param_1 != 7) {
      return 0;
    }
    return 0x438;
  }
  return 0x1bb;
}



int FUN_1401b1bd0(char *param_1,char *param_2,int *param_3,uint param_4)

{
  byte bVar1;
  char cVar2;
  short sVar3;
  short sVar4;
  int iVar5;
  uint uVar6;
  
  if (param_1 == (char *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if (param_2 == (char *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  cVar2 = *param_1;
  uVar6 = 0;
  iVar5 = 1;
  if (cVar2 != '\0') {
    do {
      if (uVar6 == param_4) {
        iVar5 = 0;
      }
      else if (iVar5 != 0) {
        if (cVar2 == '%') {
          if ((param_1[1] != '\0') && (param_1[2] != '\0')) {
            bVar1 = param_1[1];
            if ((byte)(bVar1 - 0x30) < 10) {
              sVar4 = bVar1 - 0x30;
            }
            else if ((byte)(bVar1 + 0xbf) < 6) {
              sVar4 = bVar1 - 0x37;
            }
            else if ((byte)(bVar1 + 0x9f) < 6) {
              sVar4 = bVar1 - 0x57;
            }
            else {
              sVar4 = -1;
            }
            bVar1 = param_1[2];
            param_1 = param_1 + 2;
            if ((byte)(bVar1 - 0x30) < 10) {
              sVar3 = bVar1 - 0x30;
            }
            else if ((byte)(bVar1 + 0xbf) < 6) {
              sVar3 = bVar1 - 0x37;
            }
            else if ((byte)(bVar1 + 0x9f) < 6) {
              sVar3 = bVar1 - 0x57;
            }
            else {
              sVar3 = -1;
            }
            if ((-1 < sVar4) && (-1 < sVar3)) {
              *param_2 = (char)sVar4 * '\x10' + (char)sVar3;
              goto LAB_1401b1ce1;
            }
          }
          iVar5 = 0;
          goto LAB_1401b1d04;
        }
        *param_2 = cVar2;
LAB_1401b1ce1:
        param_2 = param_2 + 1;
      }
      cVar2 = param_1[1];
      param_1 = param_1 + 1;
      uVar6 = uVar6 + 1;
    } while (cVar2 != '\0');
    if (iVar5 == 0) goto LAB_1401b1d04;
  }
  if (uVar6 < param_4) {
    *param_2 = '\0';
  }
LAB_1401b1d04:
  if (param_3 != (int *)0x0) {
    *param_3 = uVar6 + 1;
  }
  if (param_4 < uVar6 + 1) {
    iVar5 = 0;
  }
  return iVar5;
}



undefined8 FUN_1401b1d40(longlong param_1,wchar_t *param_2)

{
  errno_t eVar1;
  size_t sVar2;
  
  sVar2 = wcsnlen(param_2,0x101);
  if (0x100 < (uint)sVar2) {
    return 0;
  }
  eVar1 = wcsncpy_s((wchar_t *)(param_1 + 0x42),0x101,param_2,sVar2 & 0xffffffff);
  if (eVar1 != 0) {
    if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
  }
  *(uint *)(param_1 + 0x2458) = (uint)sVar2;
  return 1;
}



undefined8 FUN_1401b1df0(longlong param_1,wchar_t *param_2)

{
  errno_t eVar1;
  size_t sVar2;
  
  sVar2 = wcsnlen(param_2,0x81);
  if (0x80 < (uint)sVar2) {
    return 0;
  }
  eVar1 = wcsncpy_s((wchar_t *)(param_1 + 0x244),0x81,param_2,sVar2 & 0xffffffff);
  if (eVar1 != 0) {
    if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
  }
  *(uint *)(param_1 + 0x245c) = (uint)sVar2;
  return 1;
}



undefined8 FUN_1401b1ea0(longlong param_1,wchar_t *param_2)

{
  errno_t eVar1;
  size_t sVar2;
  
  if (param_2 == (wchar_t *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if ((*param_2 != L'\0') && (*(short *)(param_1 + 0x244) == 0)) {
    return 0;
  }
  sVar2 = wcsnlen(param_2,0x81);
  if (0x80 < (uint)sVar2) {
    return 0;
  }
  eVar1 = wcsncpy_s((wchar_t *)(param_1 + 0x346),0x81,param_2,sVar2 & 0xffffffff);
  if (eVar1 != 0) {
    if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
  }
  *(uint *)(param_1 + 0x2460) = (uint)sVar2;
  return 1;
}



undefined8 FUN_1401b1f80(longlong param_1,wchar_t *param_2)

{
  errno_t eVar1;
  size_t sVar2;
  
  sVar2 = wcsnlen(param_2,0x801);
  if (0x800 < (uint)sVar2) {
    return 0;
  }
  eVar1 = wcsncpy_s((wchar_t *)(param_1 + 0x144a),0x801,param_2,sVar2 & 0xffffffff);
  if (eVar1 != 0) {
    if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
  }
  *(uint *)(param_1 + 0x2468) = (uint)sVar2;
  return 1;
}



void FUN_1401b2030(char *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  undefined1 local_58 [88];
  
  if (*param_1 != '\0') {
    iVar4 = 0;
    if ((*(longlong *)(param_1 + 0x20) != 0) && (*(longlong *)(param_1 + 8) == 0)) {
      FUN_1400a2320(local_58,L"CFastMap consistency error #0!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    lVar1 = *(longlong *)(param_1 + 0x10);
    lVar3 = lVar1;
    while (lVar3 != 0) {
      lVar2 = *(longlong *)(lVar3 + 0x10);
      if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x18) != lVar3)) {
        FUN_1400a2320(local_58,L"CFastMap consistency error #1!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      if ((lVar3 == lVar1) && (*(longlong *)(lVar3 + 0x18) != 0)) {
        FUN_1400a2320(local_58,L"CFastMap consistency error #2!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      if ((lVar3 == *(longlong *)(param_1 + 0x18)) && (lVar2 != 0)) {
        FUN_1400a2320(local_58,L"CFastMap consistency error #3!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      iVar4 = iVar4 + 1;
      lVar3 = lVar2;
    }
    if (iVar4 != *(int *)(param_1 + 0x20)) {
      for (; lVar1 != 0; lVar1 = *(longlong *)(lVar1 + 0x10)) {
      }
      FUN_1400a2320(local_58,L"CFastMap consistency error #4!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
  }
  return;
}



undefined8 FUN_1401b2160(longlong param_1)

{
  if (*(int *)(param_1 + 0x18) == 0) {
    return 0;
  }
  return *(undefined8 *)(param_1 + 0x10);
}



undefined8 FUN_1401b2170(wchar_t *param_1,wchar_t *param_2)

{
  wchar_t wVar1;
  int iVar2;
  errno_t eVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined **ppuVar6;
  uint uVar7;
  wchar_t *pwVar8;
  
  if (param_2 == (wchar_t *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  ppuVar6 = &PTR_DAT_140205360;
  uVar7 = 0;
  do {
    if ((wchar_t *)*ppuVar6 != (wchar_t *)0x0) {
      iVar2 = _wcsicmp(param_2,(wchar_t *)*ppuVar6);
      if (iVar2 == 0) {
        if (uVar7 != 0xffffffff) {
          *(uint *)(param_1 + 0x1228) = uVar7;
          *(undefined4 *)(param_1 + 0x122a) =
               *(undefined4 *)(&DAT_140205368 + (longlong)(int)uVar7 * 0x10);
          param_1[0x1226] = *(wchar_t *)(&DAT_14020536c + (longlong)(int)uVar7 * 0x10);
          goto LAB_1401b2204;
        }
        break;
      }
    }
    uVar7 = uVar7 + 1;
    ppuVar6 = ppuVar6 + 2;
  } while (uVar7 < 8);
  lVar5 = -1;
  uVar4 = 0;
  param_1[0x1228] = L'\xffff';
  param_1[0x1229] = L'\xffff';
  pwVar8 = param_2;
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    wVar1 = *pwVar8;
    pwVar8 = pwVar8 + 1;
  } while (wVar1 != L'\0');
  uVar7 = ~(uint)lVar5 - 1;
  *(uint *)(param_1 + 0x122a) = uVar7;
  if (uVar7 < 0x21) {
    param_1[0x1226] = L'\0';
LAB_1401b2204:
    eVar3 = wcsncpy_s(param_1,0x21,param_2,(ulonglong)*(uint *)(param_1 + 0x122a));
    if (eVar3 != 0) {
      if (eVar3 == 0xc) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x8007000e);
      }
      if ((eVar3 == 0x16) || (eVar3 == 0x22)) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80070057);
      }
      if (eVar3 != 0x50) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
    }
    param_1[*(uint *)(param_1 + 0x122a)] = L'\0';
    uVar4 = 1;
  }
  return uVar4;
}



void FUN_1401b22b0(undefined8 *param_1)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x0001401b22d7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_1400a3530(param_1[2]);
  }
  return;
}



undefined8 * FUN_1401b22f0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1401b2350(longlong param_1,int param_2)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  int iVar4;
  undefined8 uVar5;
  undefined1 *puVar6;
  undefined1 *puVar7;
  int iVar8;
  longlong lVar9;
  undefined1 local_58 [80];
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar4 = FUN_14018a4a0();
      plVar2 = *(longlong **)(param_1 + 8);
      lVar9 = (longlong)iVar4;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar2 == (longlong *)0x0) {
          uVar5 = FUN_1400a34c0(lVar9);
          *(undefined8 *)(param_1 + 0x10) = uVar5;
        }
        else {
          uVar5 = (**(code **)(*plVar2 + 8))(plVar2,lVar9);
          *(undefined8 *)(param_1 + 0x10) = uVar5;
        }
      }
      else {
        lVar3 = *(longlong *)(param_1 + 0x10);
        if (plVar2 == (longlong *)0x0) {
          puVar6 = (undefined1 *)FUN_1400a34c0(lVar9);
        }
        else {
          puVar6 = (undefined1 *)(**(code **)(*plVar2 + 8))();
        }
        iVar1 = *(int *)(param_1 + 0x18);
        iVar8 = 0;
        if (0 < iVar1) {
          puVar7 = puVar6;
          do {
            if (puVar7 != (undefined1 *)0x0) {
              *puVar7 = puVar7[lVar3 - (longlong)puVar6];
            }
            iVar8 = iVar8 + 1;
            puVar7 = puVar7 + 1;
          } while (iVar8 < iVar1);
        }
        if (puVar6 == (undefined1 *)0x0) {
          FUN_1400a2320(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
        }
        plVar2 = *(longlong **)(param_1 + 8);
        if (plVar2 == (longlong *)0x0) {
          FUN_1400a3530(lVar3);
        }
        else {
          (**(code **)(*plVar2 + 0x18))(plVar2,lVar3);
        }
        *(undefined1 **)(param_1 + 0x10) = puVar6;
      }
      *(int *)(param_1 + 0x1c) = iVar4;
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_1401b2490(longlong param_1,uint param_2)

{
  ulonglong uVar1;
  undefined8 uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  void *_Dst;
  longlong lVar5;
  longlong lVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  int iVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  float fVar12;
  float fVar13;
  
  if (param_2 == 0) {
    param_2 = FUN_140142850();
  }
  if (param_2 != *(uint *)(param_1 + 0x28)) {
    if (*(longlong *)(param_1 + 8) == 0) {
      lVar5 = 0;
      *(uint *)(param_1 + 0x28) = param_2;
      fVar13 = (float)param_2 * *(float *)(param_1 + 0x34);
      if ((9.223372e+18 < fVar13) && (fVar13 = fVar13 - 9.223372e+18, fVar13 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      fVar12 = (float)param_2 * *(float *)(param_1 + 0x30);
      lVar6 = 0;
      *(longlong *)(param_1 + 0x38) = (longlong)fVar13 + lVar5;
      if ((9.223372e+18 < fVar12) && (fVar12 = fVar12 - 9.223372e+18, fVar12 < 9.223372e+18)) {
        lVar6 = -0x8000000000000000;
      }
      *(longlong *)(param_1 + 0x40) = (longlong)fVar12 + lVar6;
      if ((ulonglong)((longlong)fVar12 + lVar6) < 0x11) {
        *(undefined8 *)(param_1 + 0x40) = 0;
        return;
      }
    }
    else {
      _Dst = (void *)FUN_1400a34c0((ulonglong)param_2 << 3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x8007000e);
      }
      memset(_Dst,0,(ulonglong)param_2 << 3);
      uVar7 = 0;
      uVar4 = *(ulonglong *)(param_1 + 0x10);
      uVar10 = uVar7;
      uVar11 = uVar7;
      while (uVar4 != 0) {
        uVar1 = *(ulonglong *)(uVar4 + 0x10);
        uVar3 = (ulonglong)*(uint *)(uVar4 + 0x20) % (ulonglong)param_2;
        lVar5 = *(longlong *)((longlong)_Dst + uVar3 * 8);
        iVar9 = (int)uVar10;
        if (iVar9 == 0) {
          *(undefined8 *)(uVar4 + 0x18) = 0;
          *(undefined8 *)(uVar4 + 0x10) = 0;
          uVar10 = 1;
          uVar7 = uVar4;
          uVar11 = uVar4;
        }
        else if (lVar5 == 0) {
          *(undefined8 *)(uVar4 + 0x18) = 0;
          *(ulonglong *)(uVar4 + 0x10) = uVar7;
          if (uVar7 != 0) {
            *(ulonglong *)(uVar7 + 0x18) = uVar4;
          }
          uVar10 = (ulonglong)(iVar9 + 1);
          uVar7 = uVar4;
        }
        else {
          uVar8 = uVar4;
          if (*(longlong *)(lVar5 + 0x18) != 0) {
            *(ulonglong *)(*(longlong *)(lVar5 + 0x18) + 0x10) = uVar4;
            uVar8 = uVar7;
          }
          uVar2 = *(undefined8 *)(lVar5 + 0x18);
          *(longlong *)(uVar4 + 0x10) = lVar5;
          uVar10 = (ulonglong)(iVar9 + 1);
          *(undefined8 *)(uVar4 + 0x18) = uVar2;
          *(ulonglong *)(lVar5 + 0x18) = uVar4;
          uVar7 = uVar8;
        }
        *(ulonglong *)((longlong)_Dst + uVar3 * 8) = uVar4;
        uVar4 = uVar1;
      }
      FUN_1400a3530(*(undefined8 *)(param_1 + 8));
      *(void **)(param_1 + 8) = _Dst;
      *(uint *)(param_1 + 0x28) = param_2;
      *(ulonglong *)(param_1 + 0x10) = uVar7;
      *(ulonglong *)(param_1 + 0x18) = uVar11;
      FUN_1401b2030(param_1);
      lVar5 = 0;
      fVar13 = (float)*(uint *)(param_1 + 0x28) * *(float *)(param_1 + 0x34);
      if ((9.223372e+18 < fVar13) && (fVar13 = fVar13 - 9.223372e+18, fVar13 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      fVar12 = (float)*(uint *)(param_1 + 0x28) * *(float *)(param_1 + 0x30);
      lVar6 = 0;
      *(longlong *)(param_1 + 0x38) = (longlong)fVar13 + lVar5;
      if ((9.223372e+18 < fVar12) && (fVar12 = fVar12 - 9.223372e+18, fVar12 < 9.223372e+18)) {
        lVar6 = -0x8000000000000000;
      }
      *(longlong *)(param_1 + 0x40) = (longlong)fVar12 + lVar6;
      if ((ulonglong)((longlong)fVar12 + lVar6) < 0x11) {
        *(undefined8 *)(param_1 + 0x40) = 0;
      }
    }
  }
  return;
}



undefined8 FUN_1401b26e0(undefined8 param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  undefined *puVar3;
  
  uVar2 = 0;
  puVar3 = *(undefined **)(param_2 + 0x2488);
  iVar1 = 0;
  if ((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1402f8008)) {
    iVar1 = *(int *)(puVar3 + -8);
  }
  *(undefined1 *)(param_2 + 0x24c0) = 1;
  puVar3 = *(undefined **)(param_2 + 0x2488);
  if (*(undefined **)(param_2 + 0x2488) == (undefined *)0x0) {
    puVar3 = PTR_DAT_1402f8008;
  }
  if (*(undefined8 **)(param_2 + 0x2480) != (undefined8 *)0x0) {
    uVar2 = **(undefined8 **)(param_2 + 0x2480);
  }
  iVar1 = FUN_1400a9a10(uVar2,puVar3 + *(int *)(param_2 + 0x2504),
                        (iVar1 - *(int *)(param_2 + 0x2504)) + 1);
  if (iVar1 != 0) {
    *(undefined1 *)(param_2 + 0x24c0) = 0;
    return 0;
  }
  return 1;
}



void FUN_1401b2760(longlong param_1,longlong param_2,int param_3)

{
  undefined1 *puVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  
  if (-1 < param_3) {
    if (param_3 != 0) {
      iVar2 = *(int *)(param_1 + 0x18);
      FUN_1401b2350(param_1,iVar2 + param_3);
      lVar4 = 0;
      if (0 < param_3) {
        do {
          lVar3 = FUN_1401b2160(param_1);
          puVar1 = (undefined1 *)(lVar4 + param_2);
          lVar3 = lVar3 + lVar4;
          lVar4 = lVar4 + 1;
          *(undefined1 *)(lVar3 + iVar2) = *puVar1;
        } while (lVar4 < param_3);
      }
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_1401b27e0(short *param_1,longlong param_2,undefined4 *param_3,uint param_4)

{
  short sVar1;
  undefined1 *_Memory;
  undefined1 *_Memory_00;
  int iVar2;
  int iVar3;
  undefined1 *puVar4;
  undefined1 *puVar5;
  ulonglong uVar6;
  uint uVar7;
  short *psVar8;
  undefined1 auStack_1208 [32];
  undefined4 local_11e8 [2];
  undefined1 *local_11e0;
  longlong local_11d8;
  undefined1 *local_11d0;
  undefined4 *local_11c8;
  undefined8 local_11c0;
  undefined1 *local_11b8;
  undefined1 local_11b0 [264];
  undefined1 local_10a8 [2096];
  undefined1 local_878 [2096];
  ulonglong local_48;
  undefined8 uStack_40;
  
  uStack_40 = 0x1401b27f6;
  local_11c0 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_1208;
  iVar3 = 0;
  local_11d8 = param_2;
  local_11c8 = param_3;
  if (param_1 == (short *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  uVar6 = 0xffffffffffffffff;
  psVar8 = param_1;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    sVar1 = *psVar8;
    psVar8 = psVar8 + 1;
  } while (sVar1 != 0);
  local_11e0 = (undefined1 *)(~uVar6 - 1);
  iVar2 = FUN_1400a4000(param_1,(ulonglong)local_11e0 & 0xffffffff,0,0);
  if (iVar2 != 0) {
    uVar7 = iVar2 + 1;
    local_11d0 = (undefined1 *)0x0;
    puVar4 = local_10a8;
    if ((int)uVar7 < 1) {
      free((void *)0x0);
      iVar3 = 0;
    }
    else if ((uVar7 < 0x825) ||
            (puVar4 = malloc((longlong)(int)uVar7), local_11d0 = puVar4, puVar4 != (undefined1 *)0x0
            )) {
      _Memory_00 = local_11d0;
      iVar3 = FUN_1400a4000(param_1,(ulonglong)local_11e0 & 0xffffffff,puVar4,uVar7);
      puVar4[iVar3] = 0;
      puVar5 = local_878;
      local_11e0 = (undefined1 *)0x0;
      if ((param_4 < 0x825) ||
         (puVar5 = malloc((ulonglong)param_4), local_11e0 = puVar5, puVar5 != (undefined1 *)0x0)) {
        _Memory = local_11e0;
        local_11e8[0] = 0;
        iVar3 = FUN_1401b1bd0(puVar4,puVar5,local_11e8,param_4);
        if (iVar3 != 0) {
          local_11b8 = local_11b0;
          FUN_14008a6c0(&local_11b8,puVar5,3);
          FUN_1400a2760(local_11d8,(ulonglong)param_4,local_11b8,local_11e8[0]);
          if (local_11b8 != local_11b0) {
            free(local_11b8);
          }
        }
        if (param_3 != (undefined4 *)0x0) {
          *param_3 = local_11e8[0];
        }
        free(_Memory);
        free(_Memory_00);
      }
      else {
        free((void *)0x0);
        free(_Memory_00);
        iVar3 = 0;
      }
    }
    else {
      free((void *)0x0);
      iVar3 = 0;
    }
  }
  return iVar3;
}



undefined8 * FUN_1401b2a10(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  
  if (*(longlong *)(param_1 + 0x20) == 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  lVar1 = *(longlong *)(param_1 + 0x10);
  if (lVar1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  FUN_1400a3440();
  *param_2 = PTR_DAT_1402f8010;
  FUN_140003100(param_2,lVar1);
  return param_2;
}



void FUN_1401b2a70(longlong *param_1)

{
  undefined8 *puVar1;
  
  if ((*param_1 != 0) &&
     (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
     *(longlong *)(*param_1 + 8) == 0)) {
    param_1 = (longlong *)*param_1;
    puVar1 = (undefined8 *)*param_1;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    FUN_1400a3530(param_1);
  }
  return;
}



void FUN_1401b2ad0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  
  if ((*(longlong *)(param_1 + 8) != 0) &&
     (*(longlong *)(*(longlong *)(param_1 + 8) + 8) =
           *(longlong *)(*(longlong *)(param_1 + 8) + 8) + -1,
     *(longlong *)(*(longlong *)(param_1 + 8) + 8) == 0)) {
    plVar1 = *(longlong **)(param_1 + 8);
    puVar2 = (undefined8 *)*plVar1;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1,param_3,param_4,0xfffffffffffffffe);
    }
    FUN_1400a3530(plVar1);
  }
  FUN_14000c2a0(param_1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1401b2b50(longlong param_1,wchar_t *param_2)

{
  bool bVar1;
  bool bVar2;
  wchar_t *pwVar3;
  wchar_t wVar4;
  undefined2 uVar5;
  int iVar6;
  longlong lVar7;
  ulonglong uVar8;
  wchar_t *pwVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  undefined1 auStack_188 [32];
  int local_168;
  int local_164;
  wchar_t *local_160;
  undefined8 local_158;
  wchar_t local_148 [136];
  ulonglong local_38;
  
  local_158 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_188;
  if (param_2 == (wchar_t *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  bVar2 = false;
  bVar1 = false;
  local_164 = 0;
  local_168 = 0;
  lVar7 = (**(code **)(PTR_PTR_1402f8508 + 0x18))(&PTR_PTR_1402f8508);
  local_160 = (wchar_t *)(lVar7 + 0x18);
  if ((int)(*(int *)(lVar7 + 0xc) - 0x82aU | 1U - *(int *)(lVar7 + 0x10)) < 0) {
    FUN_1400a2f40(&local_160,0x82a);
  }
  pwVar3 = local_160;
  uVar8 = 0;
  wVar4 = *param_2;
  pwVar9 = local_160;
  uVar11 = uVar8;
  if (wVar4 != L'\0') {
LAB_1401b2c12:
    uVar10 = 0;
    if (0x828 < uVar8) goto LAB_1401b2fac;
    if (wVar4 == L':') {
      if ((int)uVar11 == 0) {
        *pwVar9 = L'\0';
        if (bVar2) {
          if ((!bVar1) || (local_168 == 0)) {
            *pwVar9 = L'\0';
            pwVar9 = local_148;
            param_2 = param_2 + 1;
            wVar4 = *param_2;
            uVar8 = uVar10;
            while (((wVar4 != L'/' && (wVar4 != L'@')) && (wVar4 != L'\0'))) {
              if (0x7f < (int)uVar8) goto LAB_1401b2fac;
              *pwVar9 = wVar4;
              pwVar9 = pwVar9 + 1;
              uVar8 = (ulonglong)((int)uVar8 + 1);
              param_2 = param_2 + 1;
              wVar4 = *param_2;
            }
            *pwVar9 = L'\0';
            uVar8 = uVar10;
            if ((local_168 == 0) && ((wVar4 == L'/' || (wVar4 == L'\0')))) {
              iVar6 = FUN_1401b1d40(param_1,pwVar3);
              if (iVar6 == 0) goto LAB_1401b2fac;
              iVar6 = _wtoi(local_148);
              *(short *)(param_1 + 0x244c) = (short)iVar6;
              local_164 = 1;
              local_168 = 1;
              pwVar9 = pwVar3;
            }
            else {
              if ((bVar1) ||
                 (((wVar4 != L'@' || (iVar6 = FUN_1401b1df0(param_1,pwVar3), iVar6 == 0)) ||
                  (iVar6 = FUN_1401b1ea0(param_1,local_148), iVar6 == 0)))) goto LAB_1401b2fac;
              bVar1 = true;
              param_2 = param_2 + 1;
              pwVar9 = pwVar3;
            }
          }
        }
        else {
          iVar6 = FUN_1401b2170(param_1,pwVar3);
          if (iVar6 == 0) goto LAB_1401b2fac;
          bVar2 = true;
          pwVar9 = param_2;
          if (param_2[1] == L'/') {
            pwVar9 = param_2 + 2;
            if (*pwVar9 != L'/') {
              param_2 = param_2 + 1;
              uVar8 = 0;
              pwVar9 = pwVar3;
              goto LAB_1401b2e90;
            }
            if (*(int *)(param_1 + 0x2450) == 6) goto LAB_1401b2fac;
          }
          uVar8 = 0;
          param_2 = pwVar9 + 1;
          pwVar9 = pwVar3;
          if (*(int *)(param_1 + 0x2450) == 4) goto LAB_1401b2e90;
        }
      }
      else {
LAB_1401b2de2:
        if (param_2[1] == L'\0') {
LAB_1401b2e3c:
          if ((wVar4 != L'/') && (wVar4 != L'?')) {
            if (uVar8 < 0x828) {
              *pwVar9 = wVar4;
              pwVar9 = pwVar9 + 1;
              param_2 = param_2 + 1;
              goto LAB_1401b2e60;
            }
            goto LAB_1401b2fac;
          }
          goto LAB_1401b2e60;
        }
        if (wVar4 == L'[') {
          if ((bVar2) && (local_164 == 0)) {
            uVar11 = 1;
          }
        }
        else if (wVar4 == L']') {
          uVar11 = uVar10;
        }
        *pwVar9 = wVar4;
        param_2 = param_2 + 1;
        uVar8 = uVar8 + 1;
        pwVar9 = pwVar9 + 1;
      }
    }
    else {
      if (wVar4 != L'@') {
        if ((wVar4 != L'/') && (wVar4 != L'?')) goto LAB_1401b2de2;
        if (param_2[1] == L'\0') goto LAB_1401b2e3c;
LAB_1401b2e60:
        *pwVar9 = L'\0';
        if ((local_164 == 0) && (iVar6 = FUN_1401b1d40(param_1,pwVar3), iVar6 == 0))
        goto LAB_1401b2fac;
        uVar8 = 0;
        pwVar9 = pwVar3;
        goto LAB_1401b2e87;
      }
      if (bVar1) goto LAB_1401b2fac;
      *pwVar9 = L'\0';
      iVar6 = FUN_1401b1df0(param_1,pwVar3);
      if (iVar6 == 0) goto LAB_1401b2fac;
      uVar11 = 0;
      bVar1 = true;
      param_2 = param_2 + 1;
      uVar8 = 0;
      pwVar9 = pwVar3;
    }
    wVar4 = *param_2;
    if (wVar4 == L'\0') goto LAB_1401b2e87;
    goto LAB_1401b2c12;
  }
  goto LAB_1401b2fac;
LAB_1401b2e87:
  if (bVar2) {
LAB_1401b2e90:
    wVar4 = *param_2;
    while (wVar4 != L'\0') {
      if (0x828 < uVar8) goto LAB_1401b2fac;
      if ((*(int *)(param_1 + 0x2450) != 4) && ((wVar4 == L'#' || (wVar4 == L'?')))) break;
      *pwVar9 = wVar4;
      pwVar9 = pwVar9 + 1;
      uVar8 = uVar8 + 1;
      param_2 = param_2 + 1;
      wVar4 = *param_2;
    }
    *pwVar9 = L'\0';
    if ((*pwVar3 == L'\0') || (iVar6 = FUN_1400a45f0(param_1,pwVar3), iVar6 != 0)) {
      uVar8 = 0;
      wVar4 = *param_2;
      pwVar9 = pwVar3;
      while (wVar4 != L'\0') {
        param_2 = param_2 + 1;
        if (0x828 < uVar8) goto LAB_1401b2fac;
        *pwVar9 = wVar4;
        pwVar9 = pwVar9 + 1;
        uVar8 = uVar8 + 1;
        wVar4 = *param_2;
      }
      *pwVar9 = L'\0';
      if ((*pwVar3 == L'\0') || (iVar6 = FUN_1401b1f80(param_1,pwVar3), iVar6 != 0)) {
        iVar6 = *(int *)(param_1 + 0x2450);
        if ((iVar6 == 4) || ((iVar6 == 5 || (iVar6 == 6)))) {
          *(undefined2 *)(param_1 + 0x244c) = 0;
        }
        else if (local_168 == 0) {
          uVar5 = FUN_1401b1b90();
          *(undefined2 *)(param_1 + 0x244c) = uVar5;
        }
        LOCK();
        pwVar9 = pwVar3 + -4;
        iVar6 = *(int *)pwVar9;
        *(int *)pwVar9 = *(int *)pwVar9 + -1;
        UNLOCK();
        if (iVar6 + -1 < 1) {
          (**(code **)(**(longlong **)(pwVar3 + -0xc) + 8))();
        }
        return 1;
      }
    }
  }
LAB_1401b2fac:
  FUN_1400a46a0();
  LOCK();
  pwVar9 = pwVar3 + -4;
  iVar6 = *(int *)pwVar9;
  *(int *)pwVar9 = *(int *)pwVar9 + -1;
  UNLOCK();
  if (iVar6 + -1 < 1) {
    (**(code **)(**(longlong **)(pwVar3 + -0xc) + 8))();
  }
  return 0;
}



undefined8 *
FUN_1401b3010(longlong param_1,undefined8 *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  uVar2 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x10;
  lVar3 = lVar1;
  FUN_1400a1c30(lVar1);
  if (*(longlong *)(param_1 + 200) == 0) {
    FUN_1400a3440();
    *param_2 = PTR_DAT_1402f8010;
  }
  else {
    FUN_1401b2a10(param_1 + 0xa8,param_2,param_3,param_4,uVar2,lVar3,1);
  }
  FUN_1400d1290(lVar1);
  return param_2;
}



void FUN_1401b30b0(longlong param_1)

{
  ulonglong *puVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  int iVar4;
  ulonglong uVar5;
  
  FUN_1400a1c30(param_1 + 0x10);
  uVar5 = 0;
  uVar2 = uVar5;
  while( true ) {
    iVar4 = (int)uVar2;
    if (iVar4 == *(int *)(param_1 + 0x118)) {
      uVar2 = uVar5;
      if (*(longlong *)(param_1 + 0x70) != 0) {
        uVar2 = *(ulonglong *)(param_1 + 0x60);
      }
      for (; uVar2 != 0; uVar2 = *(ulonglong *)(uVar2 + 0x10)) {
        uVar3 = uVar5;
        if (*(ulonglong **)(uVar2 + 8) != (ulonglong *)0x0) {
          uVar3 = **(ulonglong **)(uVar2 + 8);
        }
        if (*(int *)(uVar3 + 0x2490) < 4) {
          *(undefined8 *)(uVar3 + 0x2490) = 4;
        }
      }
      FUN_1400d1290(param_1 + 0x10);
      return;
    }
    if ((iVar4 < 0) || (*(int *)(param_1 + 0x118) <= iVar4)) break;
    puVar1 = *(ulonglong **)(*(longlong *)(param_1 + 0x110) + (longlong)iVar4 * 8);
    uVar2 = uVar5;
    if (puVar1 != (ulonglong *)0x0) {
      uVar2 = *puVar1;
    }
    if ((*(longlong **)(uVar2 + 0x10) != (longlong *)0x0) && (**(longlong **)(uVar2 + 0x10) != 0)) {
      puVar1 = *(ulonglong **)(*(longlong *)(param_1 + 0x110) + (longlong)iVar4 * 8);
      uVar2 = uVar5;
      if (puVar1 != (ulonglong *)0x0) {
        uVar2 = *puVar1;
      }
      uVar3 = uVar5;
      if (*(ulonglong **)(uVar2 + 0x10) != (ulonglong *)0x0) {
        uVar3 = **(ulonglong **)(uVar2 + 0x10);
      }
      FUN_1400a88b0(uVar3);
    }
    if (*(int *)(param_1 + 0x118) <= iVar4) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    uVar2 = (ulonglong)(iVar4 + 1);
  }
                    // WARNING: Subroutine does not return
  FUN_1400a2700();
}



// WARNING: Removing unreachable block (ram,0x0001401b33ce)

void FUN_1401b31d0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong *puVar2;
  char cVar3;
  ulonglong uVar4;
  longlong lVar5;
  ulonglong uVar6;
  int iVar7;
  ulonglong uVar8;
  undefined8 uVar9;
  longlong lVar10;
  undefined1 uVar11;
  undefined8 local_40;
  undefined **local_38;
  undefined4 local_30;
  undefined2 local_2c;
  undefined4 local_28;
  
  uVar9 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x10;
  uVar8 = 0;
  while( true ) {
    lVar10 = lVar1;
    FUN_1400a1c30(lVar1);
    uVar11 = 1;
    lVar5 = lVar1;
    if (DAT_1403142d0 != '\0') break;
    local_38 = Proud::AddrPort::vftable;
    local_28 = 0;
    local_40 = 0;
    local_30 = DAT_1402f83d0;
    local_2c = DAT_1402f83d4;
    uVar6 = uVar8;
    lVar5 = lVar10;
    while (iVar7 = (int)uVar6, iVar7 != *(int *)(param_1 + 0x118)) {
      if ((iVar7 < 0) || (*(int *)(param_1 + 0x118) <= iVar7)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      puVar2 = *(ulonglong **)(*(longlong *)(param_1 + 0x110) + (longlong)iVar7 * 8);
      uVar6 = uVar8;
      if (puVar2 != (ulonglong *)0x0) {
        uVar6 = *puVar2;
      }
      if ((*(longlong **)(uVar6 + 0x10) != (longlong *)0x0) &&
         (lVar10 = **(longlong **)(uVar6 + 0x10), lVar10 != 0)) {
        cVar3 = FUN_1400a8570(lVar10,0,&local_40,param_4,uVar9,lVar5,uVar11);
        if (cVar3 != '\0') {
          *(undefined1 *)(uVar6 + 0xc0) = 0;
        }
        uVar4 = uVar8;
        if (*(ulonglong **)(uVar6 + 0x10) != (ulonglong *)0x0) {
          uVar4 = **(ulonglong **)(uVar6 + 0x10);
        }
        cVar3 = FUN_1400a87e0(uVar4,0,&local_40);
        if (cVar3 != '\0') {
          *(undefined1 *)(uVar6 + 0x80) = 0;
        }
      }
      if (((*(longlong **)(uVar6 + 0x10) != (longlong *)0x0) && (**(longlong **)(uVar6 + 0x10) != 0)
          ) && ((cVar3 = FUN_1400a8b50(), cVar3 == '\0' ||
                ((*(char *)(uVar6 + 0xc0) != '\0' || (*(char *)(uVar6 + 0x80) != '\0'))))))
      goto LAB_1401b33a7;
      if (*(int *)(param_1 + 0x118) <= iVar7) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      uVar6 = (ulonglong)(iVar7 + 1);
    }
    uVar6 = uVar8;
    if (*(longlong *)(param_1 + 0x70) != 0) {
      uVar6 = *(ulonglong *)(param_1 + 0x60);
    }
    while( true ) {
      uVar4 = uVar6;
      if (uVar4 == 0) goto LAB_1401b33e3;
      uVar6 = uVar8;
      if (*(ulonglong **)(uVar4 + 8) != (ulonglong *)0x0) {
        uVar6 = **(ulonglong **)(uVar4 + 8);
      }
      if (((*(longlong **)(uVar6 + 0x2480) != (longlong *)0x0) &&
          (**(longlong **)(uVar6 + 0x2480) != 0)) &&
         ((cVar3 = FUN_1400a8b50(), cVar3 == '\0' ||
          ((*(char *)(uVar6 + 0x2500) != '\0' || (*(char *)(uVar6 + 0x24c0) != '\0')))))) break;
      uVar6 = uVar8;
      if (uVar4 != 0) {
        uVar6 = *(ulonglong *)(uVar4 + 0x10);
      }
    }
LAB_1401b33a7:
    FUN_1400d1290(lVar5);
    Sleep(10);
  }
LAB_1401b33e3:
  FUN_1400d1290(lVar5);
  return;
}



longlong * FUN_1401b3410(longlong *param_1)

{
  int *piVar1;
  int iVar2;
  int iVar3;
  undefined *puVar4;
  int iVar5;
  
  puVar4 = (undefined *)*param_1;
  if (puVar4 == (undefined *)0x0) {
    iVar5 = 0;
  }
  else if (puVar4 == PTR_DAT_1402f8008) {
    iVar5 = 0;
  }
  else {
    iVar5 = *(int *)(puVar4 + -8);
  }
  if (puVar4 == (undefined *)0x0) {
    iVar2 = 0;
  }
  else if (puVar4 == PTR_DAT_1402f8008) {
    iVar2 = 0;
  }
  else {
    iVar2 = *(int *)(puVar4 + -8);
  }
  iVar3 = iVar5;
  if (iVar5 <= iVar2) {
    if (puVar4 == (undefined *)0x0) {
      iVar3 = 0;
    }
    else if (puVar4 == PTR_DAT_1402f8008) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(puVar4 + -8);
    }
  }
  iVar2 = 1;
  if (1 < iVar3) {
    iVar2 = iVar3;
  }
  iVar3 = 0;
  if (puVar4 != (undefined *)0x0) {
    if (puVar4 == PTR_DAT_1402f8008) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(puVar4 + -8);
    }
  }
  if (iVar3 < iVar2) {
    FUN_14000c1c0(param_1,iVar2);
  }
  FUN_14000c330(param_1);
  puVar4 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1402f8008;
  }
  FUN_1400a33f0(puVar4,(longlong)(iVar5 + 1));
  puVar4 = (undefined *)*param_1;
  iVar2 = 0;
  if (0 < iVar5) {
    iVar2 = iVar5;
  }
  if (puVar4 == (undefined *)0x0) {
    iVar5 = 0;
  }
  else if (puVar4 == PTR_DAT_1402f8008) {
    iVar5 = 0;
  }
  else {
    iVar5 = *(int *)(puVar4 + -8);
  }
  if (iVar5 <= iVar2) {
    if (puVar4 == (undefined *)0x0) {
      iVar2 = 0;
    }
    else if (puVar4 == PTR_DAT_1402f8008) {
      iVar2 = 0;
    }
    else {
      iVar2 = *(int *)(puVar4 + -8);
    }
  }
  if (((puVar4 != PTR_DAT_1402f8008) && (puVar4 != (undefined *)0x0)) &&
     (piVar1 = (int *)(puVar4 + -8), piVar1 != (int *)0x0)) {
    *piVar1 = iVar2;
    *(undefined1 *)((longlong)iVar2 + 8 + (longlong)piVar1) = 0;
  }
  return param_1;
}



undefined8 * FUN_1401b3530(longlong *param_1,undefined8 *param_2,int param_3,int param_4)

{
  int iVar1;
  undefined *puVar2;
  int iVar3;
  int iVar4;
  
  iVar3 = 0;
  iVar4 = 0;
  puVar2 = (undefined *)*param_1;
  if (param_3 < 0) {
    param_3 = 0;
  }
  if (param_4 < 0) {
    param_4 = iVar3;
  }
  iVar1 = 0;
  if ((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8008)) {
    iVar1 = *(int *)(puVar2 + -8);
  }
  if (iVar1 < param_3 + param_4) {
    param_4 = iVar3;
    if ((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8008)) {
      param_4 = *(int *)(puVar2 + -8);
    }
    param_4 = param_4 - param_3;
  }
  iVar1 = iVar3;
  if ((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8008)) {
    iVar1 = *(int *)(puVar2 + -8);
  }
  if (iVar1 < param_3) {
    param_4 = iVar3;
  }
  if (param_3 == 0) {
    if ((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8008)) {
      iVar4 = *(int *)(puVar2 + -8);
    }
    if (param_4 == iVar4) {
      FUN_1400a3440();
      *param_2 = PTR_DAT_1402f8008;
      FUN_1400223a0(param_2,param_1);
      return param_2;
    }
  }
  if (puVar2 == (undefined *)0x0) {
    puVar2 = PTR_DAT_1402f8008;
  }
  FUN_14000c590(param_2,puVar2 + param_3,param_4);
  return param_2;
}



void FUN_1401b3620(longlong *param_1,longlong param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  
  if (0 < param_2) {
    iVar3 = 0;
    do {
      if ((*param_1 != 0) &&
         (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
         *(longlong *)(*param_1 + 8) == 0)) {
        plVar1 = (longlong *)*param_1;
        puVar2 = (undefined8 *)*plVar1;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        FUN_1400a3530(plVar1);
      }
      iVar3 = iVar3 + 1;
      param_1 = param_1 + 1;
    } while (iVar3 < param_2);
  }
  return;
}



void FUN_1401b36b0(longlong *param_1,longlong param_2,longlong param_3)

{
  undefined8 *puVar1;
  uint uVar2;
  longlong *plVar4;
  longlong *plVar5;
  longlong *plVar3;
  
  if (0 < param_3) {
    plVar5 = (longlong *)0x0;
    param_2 = param_2 - (longlong)param_1;
    plVar3 = plVar5;
    do {
      if (param_1 != (longlong *)0x0) {
        *param_1 = 0;
        if (*(longlong *)((longlong)param_1 + param_2) != 0) {
          *(longlong *)(*(longlong *)((longlong)param_1 + param_2) + 8) =
               *(longlong *)(*(longlong *)((longlong)param_1 + param_2) + 8) + 1;
          plVar4 = plVar5;
          if ((*param_1 != 0) &&
             (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
             *(longlong *)(*param_1 + 8) == 0)) {
            plVar4 = (longlong *)*param_1;
          }
          *param_1 = *(longlong *)((longlong)param_1 + param_2);
          if (plVar4 != (longlong *)0x0) {
            puVar1 = (undefined8 *)*plVar4;
            if (puVar1 != (undefined8 *)0x0) {
              (**(code **)*puVar1)(puVar1,1);
            }
            FUN_1400a3530(plVar4);
          }
        }
      }
      uVar2 = (int)plVar3 + 1;
      plVar3 = (longlong *)(ulonglong)uVar2;
      param_1 = param_1 + 1;
    } while ((int)uVar2 < param_3);
  }
  return;
}



void FUN_1401b3790(longlong param_1,undefined8 param_2,ulonglong param_3)

{
  int iVar1;
  
  FUN_1400a46a0();
  iVar1 = FUN_1401b2b50(param_1,param_2);
  if ((((param_3 & 1) != 0) || ((param_3 & 4) != 0)) && (iVar1 != 0)) {
    if (*(int *)(param_1 + 0x245c) != 0) {
      iVar1 = FUN_1401b27e0(param_1 + 0x244,param_1 + 0x244,param_1 + 0x245c,0x81);
      if (iVar1 == 0) {
        return;
      }
      *(int *)(param_1 + 0x245c) = *(int *)(param_1 + 0x245c) + -1;
    }
    if (*(int *)(param_1 + 0x2460) != 0) {
      iVar1 = FUN_1401b27e0(param_1 + 0x346,param_1 + 0x346,param_1 + 0x2460,0x81);
      if (iVar1 == 0) {
        return;
      }
      *(int *)(param_1 + 0x2460) = *(int *)(param_1 + 0x2460) + -1;
    }
    if (*(int *)(param_1 + 0x2458) != 0) {
      iVar1 = FUN_1401b27e0(param_1 + 0x42,param_1 + 0x42,param_1 + 0x2458,0x101);
      if (iVar1 == 0) {
        return;
      }
      *(int *)(param_1 + 0x2458) = *(int *)(param_1 + 0x2458) + -1;
    }
    if (*(int *)(param_1 + 0x2464) != 0) {
      iVar1 = FUN_1401b27e0(param_1 + 0x448,param_1 + 0x448,param_1 + 0x2464,0x801);
      if (iVar1 == 0) {
        return;
      }
      *(int *)(param_1 + 0x2464) = *(int *)(param_1 + 0x2464) + -1;
    }
    if ((*(int *)(param_1 + 0x2468) != 0) &&
       (iVar1 = FUN_1401b27e0(param_1 + 0x144a,param_1 + 0x144a,param_1 + 0x2468,0x801), iVar1 != 0)
       ) {
      *(int *)(param_1 + 0x2468) = *(int *)(param_1 + 0x2468) + -1;
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1401b38d0(longlong param_1,longlong *param_2)

{
  int *piVar1;
  int iVar2;
  char *pcVar3;
  undefined *puVar4;
  longlong *plVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  char *pcVar8;
  undefined *puVar9;
  int iVar10;
  undefined1 auStack_1a8 [32];
  undefined8 local_188;
  undefined1 local_180;
  undefined *local_178;
  undefined *local_170;
  longlong *local_168;
  undefined8 local_160;
  undefined8 local_158;
  undefined1 local_150;
  undefined1 *local_148;
  undefined1 local_140 [264];
  ulonglong local_38;
  
  local_160 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_1a8;
  local_168 = param_2;
  FUN_1400a3440();
  puVar9 = PTR_DAT_1402f8008;
  local_178 = PTR_DAT_1402f8008;
  pcVar3 = (char *)*param_2;
  pcVar8 = PTR_DAT_1402f8008;
  if (((pcVar3 == (char *)0x0) || (pcVar8 = pcVar3, pcVar3 == PTR_DAT_1402f8008)) ||
     (-1 < *(int *)(pcVar3 + -8))) {
    pcVar3 = strstr(pcVar8,"http");
    iVar2 = -1;
    if (pcVar3 != (char *)0x0) {
      puVar4 = (undefined *)*param_2;
      if ((undefined *)*param_2 == (undefined *)0x0) {
        puVar4 = PTR_DAT_1402f8008;
      }
      iVar2 = (int)pcVar3 - (int)puVar4;
    }
  }
  else {
    iVar2 = -1;
  }
  pcVar3 = (char *)*param_2;
  pcVar8 = PTR_DAT_1402f8008;
  if ((((pcVar3 == (char *)0x0) || (pcVar8 = pcVar3, pcVar3 == PTR_DAT_1402f8008)) ||
      (iVar10 = -1, -1 < *(int *)(pcVar3 + -8))) &&
     (pcVar3 = strstr(pcVar8,".xml"), iVar10 = -1, pcVar3 != (char *)0x0)) {
    puVar4 = (undefined *)*param_2;
    if ((undefined *)*param_2 == (undefined *)0x0) {
      puVar4 = PTR_DAT_1402f8008;
    }
    iVar10 = (int)pcVar3 - (int)puVar4;
  }
  if ((iVar2 < iVar10) && (-1 < iVar2)) {
    plVar5 = (longlong *)FUN_1401b3530(param_2,&local_170,iVar2,(iVar10 - iVar2) + 4);
    if (puVar9 == (undefined *)0x0) {
      puVar9 = PTR_DAT_1402f8008;
    }
    local_178 = puVar9;
    if ((undefined *)*plVar5 != puVar9) {
      uVar6 = FUN_1400a3440();
      local_158 = uVar6;
      FUN_1400a1c30(uVar6);
      local_150 = 1;
      if (((puVar9 != (undefined *)0x0) && (puVar9 != PTR_DAT_1402f8008)) &&
         (puVar9 + -8 != (undefined *)0x0)) {
        uVar7 = FUN_1400a3440();
        local_188 = uVar7;
        FUN_1400a1c30(uVar7);
        local_180 = 1;
        piVar1 = (int *)(puVar9 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar9 + -8);
        }
        FUN_1400d1290(uVar7);
      }
      puVar9 = (undefined *)*plVar5;
      if (((puVar9 != PTR_DAT_1402f8008) && (puVar9 != (undefined *)0x0)) &&
         (puVar9 != (undefined *)0x8)) {
        *(int *)(puVar9 + -4) = *(int *)(puVar9 + -4) + 1;
      }
      local_178 = puVar9;
      FUN_1400d1290(uVar6);
    }
    if (((local_170 != (undefined *)0x0) && (local_170 != PTR_DAT_1402f8008)) &&
       (local_170 + -8 != (undefined *)0x0)) {
      uVar6 = FUN_1400a3440();
      local_188 = uVar6;
      FUN_1400a1c30(uVar6);
      local_180 = 1;
      piVar1 = (int *)(local_170 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(local_170 + -8);
      }
      FUN_1400d1290(uVar6);
    }
  }
  puVar4 = puVar9;
  if (puVar9 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1402f8008;
  }
  local_148 = local_140;
  FUN_14008a6c0(&local_148,puVar4,3);
  iVar2 = FUN_1401b3790(param_1 + 0x10,local_148,0);
  if (local_148 != local_140) {
    free(local_148);
  }
  if (iVar2 == 0) {
    if (((puVar9 != (undefined *)0x0) && (puVar9 != PTR_DAT_1402f8008)) &&
       (puVar9 + -8 != (undefined *)0x0)) {
      uVar6 = FUN_1400a3440();
      local_188 = uVar6;
      FUN_1400a1c30(uVar6);
      local_180 = 1;
      piVar1 = (int *)(puVar9 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar9 + -8);
      }
      FUN_1400d1290(uVar6);
    }
    FUN_14000c2a0(param_2);
    uVar6 = 0;
  }
  else if (param_1 == 0x14027d14e) {
    if (((puVar9 != (undefined *)0x0) && (puVar9 != PTR_DAT_1402f8008)) &&
       (puVar9 + -8 != (undefined *)0x0)) {
      uVar6 = FUN_1400a3440();
      local_188 = uVar6;
      FUN_1400a1c30(uVar6);
      local_180 = 1;
      piVar1 = (int *)(puVar9 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar9 + -8);
      }
      FUN_1400d1290(uVar6);
    }
    FUN_14000c2a0(param_2);
    uVar6 = 0;
  }
  else {
    if (((puVar9 != (undefined *)0x0) && (puVar9 != PTR_DAT_1402f8008)) &&
       (puVar9 + -8 != (undefined *)0x0)) {
      uVar6 = FUN_1400a3440();
      local_188 = uVar6;
      FUN_1400a1c30(uVar6);
      local_180 = 1;
      piVar1 = (int *)(puVar9 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar9 + -8);
      }
      FUN_1400d1290(uVar6);
    }
    FUN_14000c2a0(param_2);
    uVar6 = 1;
  }
  return uVar6;
}



void FUN_1401b3c60(undefined8 *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  
  *param_1 = Proud::CDiscoveringNatDevice::vftable;
  FUN_14000c2a0(param_1 + 0x4a7);
  param_1[0x4a2] = Proud::CFastArray<>::vftable;
  if (param_1[0x4a4] != 0) {
    if ((longlong *)param_1[0x4a3] == (longlong *)0x0) {
      FUN_1400a3530(param_1[0x4a4]);
    }
    else {
      (**(code **)(*(longlong *)param_1[0x4a3] + 0x18))();
    }
  }
  FUN_14000c2a0(param_1 + 0x491);
  if ((param_1[0x490] != 0) &&
     (*(longlong *)(param_1[0x490] + 8) = *(longlong *)(param_1[0x490] + 8) + -1,
     *(longlong *)(param_1[0x490] + 8) == 0)) {
    plVar1 = (longlong *)param_1[0x490];
    lVar2 = *plVar1;
    if (lVar2 != 0) {
      FUN_1400a8cc0(lVar2);
      FUN_1400a3530(lVar2);
    }
    FUN_1400a3530(plVar1);
  }
  FUN_14000c2a0(param_1 + 1);
  *param_1 = Proud::IFastSocketDelegate::vftable;
  return;
}



void * FUN_1401b3d60(void *param_1,uint param_2)

{
  FUN_1401b3c60();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1401b3d90(undefined8 *param_1)

{
  *param_1 = Proud::CDiscoveringNatDevice::vftable;
  FUN_1400a3440();
  param_1[1] = PTR_DAT_1402f8008;
  FUN_1400a4860(param_1 + 2);
  param_1[0x490] = 0;
  FUN_1400a3440();
  param_1[0x491] = PTR_DAT_1402f8008;
  param_1[0x4a2] = Proud::CFastArray<>::vftable;
  param_1[0x4a3] = 0;
  param_1[0x4a4] = 0;
  param_1[0x4a5] = 0;
  param_1[0x4a6] = 0;
  FUN_1400a3440();
  param_1[0x4a7] = PTR_DAT_1402f8008;
  *(undefined1 *)(param_1 + 0x498) = 0;
  *(undefined1 *)(param_1 + 0x4a0) = 0;
  *(undefined8 *)((longlong)param_1 + 0x2504) = 0;
  param_1[0x492] = 0;
  return param_1;
}



undefined8 FUN_1401b3e60(undefined8 param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  undefined2 uVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  int iVar5;
  uint *puVar6;
  uint *puVar7;
  uint *puVar8;
  uint uVar9;
  uint uVar10;
  uint *puVar11;
  uint *local_res10;
  uint *local_res18 [2];
  undefined8 uVar12;
  
  uVar12 = 0xfffffffffffffffe;
  FUN_1400a3440();
  puVar8 = (uint *)PTR_DAT_1402f8010;
  local_res10 = (uint *)PTR_DAT_1402f8010;
  uVar2 = FUN_1400a32c0(param_2 + 0x52);
  puVar11 = (uint *)0x0;
  uVar10 = 0;
  puVar6 = puVar11;
  if ((puVar8 != (uint *)0x0) && (puVar6 = (uint *)0x0, puVar8 != (uint *)PTR_DAT_1402f8010)) {
    puVar6 = (uint *)(ulonglong)*(uint *)((longlong)puVar8 + -8);
  }
  uVar3 = uVar2;
  if ((((int)uVar2 <= (int)puVar6) && (uVar3 = uVar10, puVar8 != (uint *)0x0)) &&
     (puVar8 != (uint *)PTR_DAT_1402f8010)) {
    uVar3 = *(uint *)((longlong)puVar8 + -8);
  }
  uVar9 = 1;
  if (1 < (int)uVar3) {
    uVar9 = uVar3;
  }
  uVar3 = uVar10;
  if ((puVar8 != (uint *)0x0) && (puVar8 != (uint *)PTR_DAT_1402f8010)) {
    uVar3 = *(uint *)((longlong)puVar8 + -8);
  }
  uVar4 = 0;
  if ((int)uVar3 < (int)uVar9) {
    if (puVar8 == (uint *)0x0) {
      puVar8 = (uint *)PTR_DAT_1402f8010;
    }
    local_res10 = puVar8;
    if ((int)uVar9 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar9 == 0) {
      FUN_1400031d0(&local_res10);
    }
    else {
      uVar3 = uVar10;
      if ((puVar8 != (uint *)0x0) && (puVar8 != (uint *)PTR_DAT_1402f8010)) {
        uVar3 = puVar8[-2];
      }
      if (uVar9 != uVar3) {
        puVar6 = (uint *)FUN_1400a34c0((longlong)(int)uVar9 * 2 + 10);
        if (puVar6 != (uint *)0x0) {
          *puVar6 = 0;
          puVar6[1] = 1;
        }
        *puVar6 = uVar9;
        uVar3 = uVar4;
        if ((puVar8 != (uint *)0x0) && (puVar8 != (uint *)PTR_DAT_1402f8010)) {
          uVar3 = puVar8[-2];
        }
        puVar7 = (uint *)PTR_DAT_1402f8010;
        if ((int)uVar9 < (int)uVar3) {
LAB_1401b3f63:
          if (puVar8 != (uint *)0x0) {
            puVar7 = puVar8;
          }
        }
        else {
          uVar9 = uVar10;
          if (puVar8 != (uint *)0x0) {
            if (puVar8 != (uint *)PTR_DAT_1402f8010) {
              uVar9 = puVar8[-2];
            }
            goto LAB_1401b3f63;
          }
        }
        FUN_1400a32f0(puVar6 + 2,puVar7,uVar9,param_4,uVar12);
        FUN_1400031d0(&local_res10);
        local_res10 = puVar6 + 2;
      }
    }
  }
  FUN_140002e30(&local_res10);
  puVar8 = local_res10;
  puVar6 = local_res10;
  if (local_res10 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1402f8010;
  }
  FUN_1400a32f0(puVar6,param_2 + 0x52,uVar2,param_4,uVar12);
  puVar6 = puVar8;
  if (puVar8 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1402f8010;
  }
  uVar2 = FUN_1400a32c0(puVar6);
  puVar6 = puVar11;
  if (0 < (int)uVar2) {
    puVar6 = (uint *)(ulonglong)uVar2;
  }
  if ((puVar8 != (uint *)0x0) && (puVar8 != (uint *)PTR_DAT_1402f8010)) {
    uVar4 = puVar8[-2];
  }
  if (((int)uVar4 <= (int)puVar6) && (puVar6 = puVar11, puVar8 != (uint *)0x0)) {
    if (puVar8 == (uint *)PTR_DAT_1402f8010) goto LAB_1401b4013;
    puVar6 = (uint *)(ulonglong)puVar8[-2];
  }
  if (((puVar8 != (uint *)PTR_DAT_1402f8010) && (puVar8 != (uint *)0x0)) &&
     (puVar8 + -2 != (uint *)0x0)) {
    puVar8[-2] = (uint)puVar6;
    *(undefined2 *)((longlong)puVar8 + (longlong)(int)(uint)puVar6 * 2) = 0;
  }
LAB_1401b4013:
  uVar1 = *(undefined2 *)(param_2 + 0x245c);
  FUN_1400a3440();
  local_res18[0] = (uint *)PTR_DAT_1402f8010;
  if (PTR_DAT_1402f8010 == (undefined *)0x0) {
    local_res18[0] = puVar11;
  }
  if (puVar8 != (uint *)PTR_DAT_1402f8010) {
    uVar12 = FUN_1400a3440();
    FUN_1400a1c30(uVar12);
    FUN_1400031d0(local_res18);
    local_res18[0] = puVar8;
    if (((puVar8 != (uint *)PTR_DAT_1402f8010) && (puVar8 != (uint *)0x0)) &&
       (puVar8 != (uint *)0x8)) {
      puVar8[-1] = puVar8[-1] + 1;
    }
    FUN_1400d1290(uVar12);
  }
  if (*(undefined8 **)(param_2 + 0x2480) != (undefined8 *)0x0) {
    puVar11 = (uint *)**(undefined8 **)(param_2 + 0x2480);
  }
  iVar5 = FUN_1400a92b0(puVar11,local_res18,uVar1);
  if ((iVar5 == 0) || (iVar5 == 0x2733)) {
    if ((puVar8 != (uint *)0x0) &&
       ((puVar8 != (uint *)PTR_DAT_1402f8010 && (puVar8 + -2 != (uint *)0x0)))) {
      uVar12 = FUN_1400a3440();
      FUN_1400a1c30(uVar12);
      puVar11 = puVar8 + -1;
      *puVar11 = *puVar11 - 1;
      if (*puVar11 == 0) {
        FUN_1400a3530(puVar8 + -2);
      }
      FUN_1400d1290(uVar12);
    }
    uVar12 = 1;
  }
  else {
    if (((puVar8 != (uint *)0x0) && (puVar8 != (uint *)PTR_DAT_1402f8010)) &&
       (puVar8 + -2 != (uint *)0x0)) {
      uVar12 = FUN_1400a3440();
      FUN_1400a1c30(uVar12);
      puVar11 = puVar8 + -1;
      *puVar11 = *puVar11 - 1;
      if (*puVar11 == 0) {
        FUN_1400a3530(puVar8 + -2);
      }
      FUN_1400d1290(uVar12);
    }
    uVar12 = 0;
  }
  return uVar12;
}



undefined8 *
FUN_1401b4160(undefined8 param_1,undefined8 *param_2,longlong *param_3,longlong *param_4)

{
  int *piVar1;
  char *pcVar2;
  undefined *puVar3;
  char *pcVar4;
  char *pcVar5;
  char *pcVar6;
  char *_Str;
  int iVar7;
  int iVar8;
  char *local_48;
  char *local_40;
  undefined1 local_38;
  undefined8 local_30;
  
  local_30 = 0xfffffffffffffffe;
  FUN_1400a3440();
  local_48 = PTR_DAT_1402f8008;
  puVar3 = (undefined *)*param_4;
  if ((undefined *)*param_4 == (undefined *)0x0) {
    puVar3 = PTR_DAT_1402f8008;
  }
  FUN_1400a50f0(&local_48,&DAT_14027b66c,puVar3);
  pcVar2 = local_48;
  pcVar5 = local_48;
  if (local_48 == (char *)0x0) {
    pcVar5 = PTR_DAT_1402f8008;
  }
  if (pcVar5 == (char *)0x0) {
    iVar7 = -1;
  }
  else {
    pcVar4 = (char *)*param_3;
    pcVar6 = PTR_DAT_1402f8008;
    if (((pcVar4 == (char *)0x0) || (pcVar6 = pcVar4, pcVar4 == PTR_DAT_1402f8008)) ||
       (iVar7 = -1, -1 < *(int *)(pcVar4 + -8))) {
      pcVar5 = strstr(pcVar6,pcVar5);
      if (pcVar5 == (char *)0x0) {
        iVar7 = -1;
      }
      else {
        puVar3 = (undefined *)*param_3;
        if ((undefined *)*param_3 == (undefined *)0x0) {
          puVar3 = PTR_DAT_1402f8008;
        }
        iVar7 = (int)pcVar5 - (int)puVar3;
        if (-1 < iVar7) {
          iVar8 = 0;
          if ((pcVar2 != (char *)0x0) && (iVar8 = 0, pcVar2 != PTR_DAT_1402f8008)) {
            iVar8 = *(int *)(pcVar2 + -8);
          }
          iVar7 = iVar7 + iVar8;
        }
      }
    }
  }
  FUN_1400a3440();
  local_40 = PTR_DAT_1402f8008;
  puVar3 = (undefined *)*param_4;
  if ((undefined *)*param_4 == (undefined *)0x0) {
    puVar3 = PTR_DAT_1402f8008;
  }
  FUN_1400a50f0(&local_40,"</%s>",puVar3);
  pcVar5 = local_40;
  pcVar4 = local_40;
  if (local_40 == (char *)0x0) {
    pcVar4 = PTR_DAT_1402f8008;
  }
  iVar8 = -1;
  if ((pcVar4 != (char *)0x0) &&
     ((((pcVar6 = (char *)*param_3, _Str = PTR_DAT_1402f8008, iVar8 = -1, pcVar6 == (char *)0x0 ||
        (_Str = pcVar6, pcVar6 == PTR_DAT_1402f8008)) || (-1 < *(int *)(pcVar6 + -8))) &&
      (pcVar4 = strstr(_Str,pcVar4), pcVar4 != (char *)0x0)))) {
    puVar3 = (undefined *)*param_3;
    if ((undefined *)*param_3 == (undefined *)0x0) {
      puVar3 = PTR_DAT_1402f8008;
    }
    iVar8 = (int)pcVar4 - (int)puVar3;
  }
  if (((iVar7 < 0) || (iVar8 < 0)) || (iVar8 <= iVar7)) {
    FUN_1400a3440();
    *param_2 = PTR_DAT_1402f8008;
    if (((pcVar5 != (char *)0x0) && (pcVar5 != PTR_DAT_1402f8008)) && (pcVar5 + -8 != (char *)0x0))
    {
      pcVar4 = (char *)FUN_1400a3440();
      local_40 = pcVar4;
      FUN_1400a1c30(pcVar4);
      local_38 = 1;
      piVar1 = (int *)(pcVar5 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(pcVar5 + -8);
      }
      FUN_1400d1290(pcVar4);
    }
    if (pcVar2 == (char *)0x0) {
      return param_2;
    }
    if (pcVar2 == PTR_DAT_1402f8008) {
      return param_2;
    }
    if (pcVar2 + -8 == (char *)0x0) {
      return param_2;
    }
    pcVar5 = (char *)FUN_1400a3440();
    local_40 = pcVar5;
    FUN_1400a1c30(pcVar5);
    local_38 = 1;
    piVar1 = (int *)(pcVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(pcVar2 + -8);
    }
  }
  else {
    FUN_1401b3530(param_3,param_2,iVar7,iVar8 - iVar7);
    if (((pcVar5 != (char *)0x0) && (pcVar5 != PTR_DAT_1402f8008)) && (pcVar5 + -8 != (char *)0x0))
    {
      pcVar4 = (char *)FUN_1400a3440();
      local_40 = pcVar4;
      FUN_1400a1c30(pcVar4);
      local_38 = 1;
      piVar1 = (int *)(pcVar5 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(pcVar5 + -8);
      }
      FUN_1400d1290(pcVar4);
    }
    if (pcVar2 == (char *)0x0) {
      return param_2;
    }
    if (pcVar2 == PTR_DAT_1402f8008) {
      return param_2;
    }
    if (pcVar2 + -8 == (char *)0x0) {
      return param_2;
    }
    pcVar5 = (char *)FUN_1400a3440();
    local_40 = pcVar5;
    FUN_1400a1c30(pcVar5);
    local_38 = 1;
    piVar1 = (int *)(pcVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(pcVar2 + -8);
    }
  }
  FUN_1400d1290(pcVar5);
  return param_2;
}



void FUN_1401b4440(longlong param_1)

{
  ulonglong *puVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 *puVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  longlong lVar7;
  ulonglong uVar8;
  int iVar9;
  double dVar10;
  ulonglong *local_res8;
  
  FUN_1400a1c30(param_1 + 0x10);
  dVar10 = (double)FUN_1401a8ef0(*(undefined8 *)(param_1 + 8));
  if (600.0 < dVar10 - *(double *)(param_1 + 0x128)) {
    uVar8 = 0;
    uVar5 = uVar8;
    while (iVar9 = (int)uVar5, iVar9 != *(int *)(param_1 + 0x118)) {
      if ((iVar9 < 0) || (*(int *)(param_1 + 0x118) <= iVar9)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      lVar7 = (longlong)iVar9;
      lVar2 = *(longlong *)(param_1 + 0x110);
      local_res8 = (ulonglong *)0x0;
      lVar3 = *(longlong *)(lVar2 + lVar7 * 8);
      if (lVar3 != 0) {
        *(longlong *)(*(longlong *)(lVar2 + lVar7 * 8) + 8) = *(longlong *)(lVar3 + 8) + 1;
        local_res8 = *(ulonglong **)(lVar2 + lVar7 * 8);
      }
      uVar5 = uVar8;
      if (local_res8 != (ulonglong *)0x0) {
        uVar5 = *local_res8;
      }
      if ((*(longlong **)(uVar5 + 0x10) != (longlong *)0x0) && (**(longlong **)(uVar5 + 0x10) != 0))
      {
        uVar5 = uVar8;
        if (local_res8 != (ulonglong *)0x0) {
          uVar5 = *local_res8;
        }
        uVar6 = uVar8;
        if (*(ulonglong **)(uVar5 + 0x10) != (ulonglong *)0x0) {
          uVar6 = **(ulonglong **)(uVar5 + 0x10);
        }
        FUN_1400a88b0(uVar6);
      }
      if (local_res8 != (ulonglong *)0x0) {
        puVar1 = local_res8 + 1;
        *puVar1 = *puVar1 - 1;
        if (*puVar1 == 0) {
          puVar4 = (undefined8 *)*local_res8;
          if (puVar4 != (undefined8 *)0x0) {
            (**(code **)*puVar4)(puVar4,1);
          }
          FUN_1400a3530(local_res8);
        }
      }
      if (*(int *)(param_1 + 0x118) <= iVar9) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      uVar5 = (ulonglong)(iVar9 + 1);
    }
    uVar5 = uVar8;
    if (*(longlong *)(param_1 + 0x70) != 0) {
      uVar5 = *(ulonglong *)(param_1 + 0x60);
    }
    for (; uVar5 != 0; uVar5 = *(ulonglong *)(uVar5 + 0x10)) {
      uVar6 = uVar8;
      if (*(ulonglong **)(uVar5 + 8) != (ulonglong *)0x0) {
        uVar6 = **(ulonglong **)(uVar5 + 8);
      }
      if (*(int *)(uVar6 + 0x2490) < 4) {
        *(undefined8 *)(uVar6 + 0x2490) = 4;
      }
    }
  }
  FUN_1400d1290(param_1 + 0x10);
  return;
}



void FUN_1401b45f0(undefined8 *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  
  FUN_140140df0(param_1 + 4);
  if ((param_1[2] != 0) &&
     (*(longlong *)(param_1[2] + 8) = *(longlong *)(param_1[2] + 8) + -1,
     *(longlong *)(param_1[2] + 8) == 0)) {
    plVar1 = (longlong *)param_1[2];
    lVar2 = *plVar1;
    if (lVar2 != 0) {
      FUN_1400a8cc0(lVar2);
      FUN_1400a3530(lVar2);
    }
    FUN_1400a3530(plVar1);
  }
  FUN_14000c2a0(param_1 + 1);
  *param_1 = Proud::IFastSocketDelegate::vftable;
  return;
}



void FUN_1401b4690(undefined8 *param_1)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_1401b3620(param_1[2],(longlong)*(int *)(param_1 + 3));
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x0001401b46d7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
      return;
    }
    FUN_1400a3530();
  }
  return;
}



undefined8 * FUN_1401b46f0(undefined8 *param_1,uint param_2)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_1401b3620(param_1[2],(longlong)*(int *)(param_1 + 3));
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1401b4760(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 uVar2;
  undefined8 *puVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  longlong lVar7;
  longlong lVar8;
  undefined1 local_a0 [152];
  
  lVar7 = (longlong)param_2;
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  iVar5 = *(int *)(param_1 + 0x18);
  if (param_2 != iVar5) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar5 = FUN_1401a7da0(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
      lVar8 = (longlong)iVar5;
      plVar1 = *(longlong **)(param_1 + 8);
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          puVar3 = (undefined8 *)FUN_1400a34c0(lVar8 << 3);
        }
        else {
          puVar3 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,lVar8 << 3);
        }
        *(undefined8 **)(param_1 + 0x10) = puVar3;
        if (0 < param_2) {
          do {
            if (puVar3 != (undefined8 *)0x0) {
              *puVar3 = 0;
            }
            puVar3 = puVar3 + 1;
            lVar7 = lVar7 + -1;
          } while (lVar7 != 0);
        }
      }
      else {
        uVar2 = *(undefined8 *)(param_1 + 0x10);
        if (plVar1 == (longlong *)0x0) {
          lVar7 = FUN_1400a34c0(lVar8 << 3);
        }
        else {
          lVar7 = (**(code **)(*plVar1 + 8))(plVar1,lVar8 << 3);
        }
        FUN_1401b36b0(lVar7,uVar2);
        iVar4 = param_2 - *(int *)(param_1 + 0x18);
        puVar3 = (undefined8 *)(lVar7 + (longlong)*(int *)(param_1 + 0x18) * 8);
        iVar6 = 0;
        if (0 < iVar4) {
          do {
            if (puVar3 != (undefined8 *)0x0) {
              *puVar3 = 0;
            }
            iVar6 = iVar6 + 1;
            puVar3 = puVar3 + 1;
          } while (iVar6 < iVar4);
        }
        if (lVar7 == 0) {
          FUN_1400a2320(local_a0,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1402f4860);
        }
        FUN_1401b3620(uVar2,(longlong)*(int *)(param_1 + 0x18));
        plVar1 = *(longlong **)(param_1 + 8);
        if (plVar1 == (longlong *)0x0) {
          FUN_1400a3530(uVar2);
        }
        else {
          (**(code **)(*plVar1 + 0x18))(plVar1,uVar2);
        }
        *(longlong *)(param_1 + 0x10) = lVar7;
      }
      *(int *)(param_1 + 0x1c) = iVar5;
    }
    else if (iVar5 - param_2 < 1) {
      iVar4 = param_2 - iVar5;
      if (0 < iVar4) {
        puVar3 = (undefined8 *)(*(longlong *)(param_1 + 0x10) + (longlong)iVar5 * 8);
        iVar5 = 0;
        if (0 < iVar4) {
          do {
            if (puVar3 != (undefined8 *)0x0) {
              *puVar3 = 0;
            }
            iVar5 = iVar5 + 1;
            puVar3 = puVar3 + 1;
          } while (iVar5 < iVar4);
        }
      }
    }
    else {
      FUN_1401b3620(*(longlong *)(param_1 + 0x10) + lVar7 * 8,(longlong)(iVar5 - param_2));
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_1401b4950(undefined8 param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  undefined *puVar3;
  undefined8 local_res10 [3];
  undefined **local_20;
  undefined4 local_18;
  undefined2 local_14;
  
  *(undefined1 *)(param_2 + 0x80) = 1;
  local_20 = Proud::AddrPort::vftable;
  local_18 = DAT_14031a320;
  local_14 = DAT_14031a324;
  if (DAT_14031a310 == (undefined *)0x0) {
    iVar1 = 0;
    puVar3 = PTR_DAT_1402f8008;
  }
  else {
    puVar3 = DAT_14031a310;
    if (DAT_14031a310 == PTR_DAT_1402f8008) {
      iVar1 = 0;
    }
    else {
      iVar1 = *(int *)(DAT_14031a310 + -8);
    }
  }
  if (*(undefined8 **)(param_2 + 0x10) == (undefined8 *)0x0) {
    uVar2 = 0;
  }
  else {
    uVar2 = **(undefined8 **)(param_2 + 0x10);
  }
  iVar1 = FUN_1400aa6f0(uVar2,puVar3,iVar1 + 1,&local_20,0xfffffffffffffffe);
  if ((iVar1 == 0) || (iVar1 == 0x3e5)) {
    *(undefined4 *)(param_2 + 0x18) = 1;
  }
  else {
    *(undefined1 *)(param_2 + 0x80) = 0;
    local_res10[0] = 0;
    FUN_1400a5190(param_2 + 0x10,local_res10);
    *(undefined4 *)(param_2 + 0x18) = 3;
  }
  return;
}



void FUN_1401b4a20(undefined8 param_1,longlong param_2)

{
  int iVar1;
  void *_Dst;
  undefined8 uVar2;
  undefined8 local_res10 [3];
  
  FUN_14003cda0();
  if (*(int *)(param_2 + 0x38) == 0) {
    _Dst = (void *)0x0;
  }
  else {
    _Dst = *(void **)(param_2 + 0x30);
  }
  memset(_Dst,0,(longlong)*(int *)(param_2 + 0x38));
  *(undefined1 *)(param_2 + 0xc0) = 1;
  uVar2 = 0;
  if (*(undefined8 **)(param_2 + 0x10) != (undefined8 *)0x0) {
    uVar2 = **(undefined8 **)(param_2 + 0x10);
  }
  iVar1 = FUN_1400a9850(uVar2,*(int *)(param_2 + 0x38) + -1);
  if (iVar1 == 0) {
    *(undefined4 *)(param_2 + 0x18) = 2;
  }
  else {
    *(undefined1 *)(param_2 + 0xc0) = 0;
    local_res10[0] = 0;
    FUN_1400a5190(param_2 + 0x10,local_res10);
    *(undefined4 *)(param_2 + 0x18) = 3;
  }
  return;
}



void * FUN_1401b4ac0(void *param_1,uint param_2)

{
  FUN_1401b45f0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1401b4af0(longlong param_1)

{
  longlong *plVar1;
  uint uVar2;
  ulonglong uVar3;
  longlong lVar4;
  longlong lVar5;
  float fVar6;
  float fVar7;
  
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
  FUN_1401b2030();
  lVar4 = *(longlong *)(param_1 + 0x10);
  while (lVar4 != 0) {
    lVar5 = *(longlong *)(lVar4 + 0x10);
    FUN_1400031d0(lVar4);
    plVar1 = *(longlong **)(param_1 + 0x50);
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530(lVar4);
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar4);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar4 = lVar5;
  }
  FUN_1400a3530(*(undefined8 *)(param_1 + 8));
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  FUN_1401b2030(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar2 = FUN_140142850(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_1400a3530();
      *(undefined8 *)(param_1 + 8) = 0;
    }
    lVar4 = 0;
    *(uint *)(param_1 + 0x28) = uVar2;
    fVar7 = (float)uVar2 * *(float *)(param_1 + 0x34);
    if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
      lVar4 = -0x8000000000000000;
    }
    fVar6 = (float)uVar2 * *(float *)(param_1 + 0x30);
    lVar5 = 0;
    *(longlong *)(param_1 + 0x38) = (longlong)fVar7 + lVar4;
    if ((9.223372e+18 < fVar6) && (fVar6 = fVar6 - 9.223372e+18, fVar6 < 9.223372e+18)) {
      lVar5 = -0x8000000000000000;
    }
    uVar3 = (longlong)fVar6 + lVar5;
    if ((ulonglong)((longlong)fVar6 + lVar5) < 0x11) {
      uVar3 = 0;
    }
    *(ulonglong *)(param_1 + 0x40) = uVar3;
  }
  FUN_1401b2030(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



void FUN_1401b4c20(longlong param_1,longlong param_2,char param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  FUN_1401b2ad0(param_2);
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    FUN_1400a3530(param_2);
  }
  else {
    (**(code **)(*plVar1 + 0x18))(plVar1,param_2);
  }
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
  if (((param_3 != '\0') && (*(ulonglong *)(param_1 + 0x20) < *(ulonglong *)(param_1 + 0x40))) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar2 = FUN_140142850(param_1);
    FUN_1401b2490(param_1,uVar2);
  }
  return;
}



void FUN_1401b4cb0(longlong param_1,longlong param_2,undefined1 param_3)

{
  uint uVar1;
  ulonglong uVar2;
  uint uVar3;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  uVar1 = *(uint *)(param_1 + 0x28);
  uVar2 = (ulonglong)*(uint *)(param_2 + 0x20) % (ulonglong)uVar1;
  if (*(longlong *)(param_1 + 0x20) == 1) {
    *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    *(undefined8 *)(param_1 + 0x10) = 0;
    *(undefined8 *)(param_1 + 0x18) = 0;
  }
  else {
    uVar3 = (uint)uVar2;
    if (((*(longlong *)(param_2 + 0x18) == 0) ||
        (*(uint *)(*(longlong *)(param_2 + 0x18) + 0x20) % uVar1 != uVar3)) &&
       ((*(longlong *)(param_2 + 0x10) == 0 ||
        (*(uint *)(*(longlong *)(param_2 + 0x10) + 0x20) % uVar1 != uVar3)))) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = 0;
    }
    else if (param_2 == *(longlong *)(*(longlong *)(param_1 + 8) + (longlong)(int)uVar3 * 8)) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar2 * 8) = *(undefined8 *)(param_2 + 0x10);
    }
    if (param_2 == *(longlong *)(param_1 + 0x10)) {
      *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(param_2 + 0x10);
      *(undefined8 *)(param_2 + 0x18) = 0;
    }
    if (param_2 == *(longlong *)(param_1 + 0x18)) {
      *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
      *(undefined8 *)(param_2 + 0x10) = 0;
    }
    if (*(longlong *)(param_2 + 0x18) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x18) + 0x10) = *(undefined8 *)(param_2 + 0x10);
    }
    if (*(longlong *)(param_2 + 0x10) != 0) {
      *(undefined8 *)(*(longlong *)(param_2 + 0x10) + 0x18) = *(undefined8 *)(param_2 + 0x18);
    }
  }
  FUN_1401b4c20(param_1,param_2,param_3);
  FUN_1401b2030(param_1);
  return;
}



undefined8 * FUN_1401b4db0(longlong param_1,undefined8 param_2,uint param_3,undefined4 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined4 uVar3;
  undefined8 *puVar4;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    puVar4 = (undefined8 *)FUN_1400a34c0(0x28);
  }
  else {
    puVar4 = (undefined8 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x28,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar4 != (undefined8 *)0x0) {
    FUN_1400a3440();
    *puVar4 = PTR_DAT_1402f8008;
    FUN_1400223a0(puVar4,param_2);
    puVar4[1] = 0;
    *(undefined4 *)(puVar4 + 4) = param_4;
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8);
  FUN_1401b2030(param_1);
  if (*(longlong *)(param_1 + 0x20) == 0) {
    *(undefined8 **)(param_1 + 0x10) = puVar4;
    *(undefined8 **)(param_1 + 0x18) = puVar4;
    puVar4[3] = 0;
    puVar4[2] = 0;
  }
  else {
    FUN_1401b2030(param_1);
    FUN_1401b2030(param_1);
    if (lVar2 == 0) {
      lVar2 = *(longlong *)(param_1 + 0x10);
      puVar4[3] = 0;
      puVar4[2] = lVar2;
      if (lVar2 != 0) {
        *(undefined8 **)(lVar2 + 0x18) = puVar4;
      }
      *(undefined8 **)(param_1 + 0x10) = puVar4;
    }
    else {
      if (*(longlong *)(lVar2 + 0x18) == 0) {
        *(undefined8 **)(param_1 + 0x10) = puVar4;
      }
      else {
        *(undefined8 **)(*(longlong *)(lVar2 + 0x18) + 0x10) = puVar4;
      }
      puVar4[3] = *(undefined8 *)(lVar2 + 0x18);
      puVar4[2] = lVar2;
      *(undefined8 **)(lVar2 + 0x18) = puVar4;
    }
  }
  *(undefined8 **)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8) = puVar4;
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  FUN_1401b2030(param_1);
  FUN_1401b2030(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_140142850(param_1);
    FUN_1401b2490(param_1,uVar3);
  }
  FUN_1401b2030(param_1);
  return puVar4;
}



undefined8 * FUN_1401b4f20(longlong param_1,undefined8 param_2,uint param_3,undefined4 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined4 uVar3;
  undefined8 *puVar4;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    puVar4 = (undefined8 *)FUN_1400a34c0(0x28);
  }
  else {
    puVar4 = (undefined8 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x28,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar4 != (undefined8 *)0x0) {
    FUN_1400a3440();
    *puVar4 = PTR_DAT_1402f8010;
    FUN_140003100(puVar4,param_2);
    *(undefined4 *)(puVar4 + 4) = param_4;
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8);
  FUN_1401b2030(param_1);
  if (*(longlong *)(param_1 + 0x20) == 0) {
    *(undefined8 **)(param_1 + 0x10) = puVar4;
    *(undefined8 **)(param_1 + 0x18) = puVar4;
    puVar4[3] = 0;
    puVar4[2] = 0;
  }
  else {
    FUN_1401b2030(param_1);
    FUN_1401b2030(param_1);
    if (lVar2 == 0) {
      lVar2 = *(longlong *)(param_1 + 0x10);
      puVar4[3] = 0;
      puVar4[2] = lVar2;
      if (lVar2 != 0) {
        *(undefined8 **)(lVar2 + 0x18) = puVar4;
      }
      *(undefined8 **)(param_1 + 0x10) = puVar4;
    }
    else {
      if (*(longlong *)(lVar2 + 0x18) == 0) {
        *(undefined8 **)(param_1 + 0x10) = puVar4;
      }
      else {
        *(undefined8 **)(*(longlong *)(lVar2 + 0x18) + 0x10) = puVar4;
      }
      puVar4[3] = *(undefined8 *)(lVar2 + 0x18);
      puVar4[2] = lVar2;
      *(undefined8 **)(lVar2 + 0x18) = puVar4;
    }
  }
  *(undefined8 **)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8) = puVar4;
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  FUN_1401b2030(param_1);
  FUN_1401b2030(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_140142850(param_1);
    FUN_1401b2490(param_1,uVar3);
  }
  FUN_1401b2030(param_1);
  return puVar4;
}



void FUN_1401b5080(undefined8 param_1,longlong param_2)

{
  longlong *plVar1;
  undefined *puVar2;
  longlong *plVar3;
  char cVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  longlong *local_res10;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined8 local_38;
  undefined8 local_30;
  
  local_30 = 0xfffffffffffffffe;
  local_res10 = (longlong *)FUN_1400a34c0(0x400);
  lVar7 = 0;
  lVar6 = lVar7;
  if (local_res10 != (longlong *)0x0) {
    lVar6 = FUN_1400a8db0(local_res10,1,param_2);
  }
  if (lVar6 == 0) {
    local_res10 = (longlong *)0x0;
  }
  else {
    local_res10 = (longlong *)FUN_1400a34c0(0x10);
    local_res10[1] = 1;
    *local_res10 = lVar6;
  }
  plVar1 = local_res10;
  FUN_1400a5190(param_2 + 0x10,&local_res10);
  plVar3 = local_res10;
  if (plVar1 != (longlong *)0x0) {
    plVar1 = plVar1 + 1;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      lVar6 = *local_res10;
      if (lVar6 != 0) {
        FUN_1400a8cc0(lVar6);
        FUN_1400a3530(lVar6);
      }
      FUN_1400a3530(plVar3);
    }
  }
  lVar6 = lVar7;
  if (*(longlong **)(param_2 + 0x10) != (longlong *)0x0) {
    lVar6 = **(longlong **)(param_2 + 0x10);
  }
  iVar5 = FUN_1400aa030(lVar6,1);
  if (iVar5 == 0) {
    puVar2 = *(undefined **)(param_2 + 8);
    if (((puVar2 == (undefined *)0x0) || (puVar2 == PTR_DAT_1402f8008)) ||
       (*(int *)(puVar2 + -8) < 1)) {
      lVar6 = lVar7;
      if (*(longlong **)(param_2 + 0x10) != (longlong *)0x0) {
        lVar6 = **(longlong **)(param_2 + 0x10);
      }
      cVar4 = FUN_1400aa930(lVar6);
      if (cVar4 == '\0') {
        local_38 = 0;
        FUN_1400a5190(param_2 + 0x10,&local_38);
        *(undefined4 *)(param_2 + 0x18) = 3;
        return;
      }
    }
    else {
      lVar6 = lVar7;
      if (*(longlong **)(param_2 + 0x10) != (longlong *)0x0) {
        lVar6 = **(longlong **)(param_2 + 0x10);
      }
      cVar4 = FUN_1400aa3f0(lVar6,puVar2,0);
      if (cVar4 == '\0') {
        local_res20 = 0;
        FUN_1400a5190(param_2 + 0x10,&local_res20);
        *(undefined4 *)(param_2 + 0x18) = 3;
        return;
      }
    }
    if (*(longlong **)(param_2 + 0x10) != (longlong *)0x0) {
      lVar7 = **(longlong **)(param_2 + 0x10);
    }
    FUN_1400a8090(lVar7,0);
    FUN_1401b4950(param_1,param_2);
  }
  else {
    local_res18 = 0;
    FUN_1400a5190(param_2 + 0x10,&local_res18);
    *(undefined4 *)(param_2 + 0x18) = 3;
  }
  return;
}



void FUN_1401b5250(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 uVar2;
  undefined8 local_res10;
  undefined8 uVar3;
  undefined8 local_40;
  undefined **local_38;
  undefined4 local_30;
  undefined2 local_2c;
  int local_28;
  
  uVar3 = 0xfffffffffffffffe;
  while( true ) {
    local_38 = Proud::AddrPort::vftable;
    local_28 = 0;
    local_40 = 0;
    local_30 = DAT_1402f83d0;
    local_2c = DAT_1402f83d4;
    uVar2 = 0;
    if (*(undefined8 **)(param_2 + 0x10) != (undefined8 *)0x0) {
      uVar2 = **(undefined8 **)(param_2 + 0x10);
    }
    cVar1 = FUN_1400a87e0(uVar2,0,&local_40,param_4,uVar3);
    if (cVar1 == '\0') break;
    *(undefined1 *)(param_2 + 0x80) = 0;
    if ((local_40._4_4_ != 0) || (local_28 == 0)) {
      *(undefined4 *)(param_2 + 0x18) = 3;
      local_res10 = 0;
      FUN_1400a5190(param_2 + 0x10,&local_res10);
      return;
    }
    *(int *)(param_2 + 0x1c) = *(int *)(param_2 + 0x1c) + 1;
    if (2 < *(int *)(param_2 + 0x1c)) {
      if (*(double *)(param_2 + 200) == 0.0) {
        uVar3 = FUN_1401a8ef0(*(undefined8 *)(param_1 + 8));
        *(undefined8 *)(param_2 + 200) = uVar3;
      }
      FUN_1401b4a20(param_1,param_2);
      return;
    }
    FUN_1401b4950(param_1);
  }
  return;
}



void FUN_1401b5360(void)

{
  FUN_1401b4af0();
  return;
}



void FUN_1401b5380(longlong param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  uint uVar4;
  ulonglong uVar5;
  longlong lVar6;
  float fVar7;
  
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
  FUN_1401b2030(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  lVar6 = *(longlong *)(param_1 + 0x10);
  while (lVar6 != 0) {
    lVar1 = *(longlong *)(lVar6 + 0x10);
    if ((*(longlong *)(lVar6 + 8) != 0) &&
       (*(longlong *)(*(longlong *)(lVar6 + 8) + 8) =
             *(longlong *)(*(longlong *)(lVar6 + 8) + 8) + -1,
       *(longlong *)(*(longlong *)(lVar6 + 8) + 8) == 0)) {
      plVar2 = *(longlong **)(lVar6 + 8);
      puVar3 = (undefined8 *)*plVar2;
      if (puVar3 != (undefined8 *)0x0) {
        (**(code **)*puVar3)(puVar3,1);
      }
      FUN_1400a3530(plVar2);
    }
    FUN_14000c2a0(lVar6);
    plVar2 = *(longlong **)(param_1 + 0x50);
    if (plVar2 == (longlong *)0x0) {
      FUN_1400a3530(lVar6);
    }
    else {
      (**(code **)(*plVar2 + 0x18))(plVar2,lVar6);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar6 = lVar1;
  }
  FUN_1400a3530(*(undefined8 *)(param_1 + 8));
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  FUN_1401b2030(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar4 = FUN_140142850(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_1400a3530();
      *(undefined8 *)(param_1 + 8) = 0;
    }
    *(uint *)(param_1 + 0x28) = uVar4;
    fVar7 = (float)uVar4 * *(float *)(param_1 + 0x34);
    lVar6 = 0;
    if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
      lVar6 = -0x8000000000000000;
    }
    *(longlong *)(param_1 + 0x38) = (longlong)fVar7 + lVar6;
    fVar7 = (float)uVar4 * *(float *)(param_1 + 0x30);
    lVar6 = 0;
    if ((9.223372e+18 < fVar7) && (fVar7 = fVar7 - 9.223372e+18, fVar7 < 9.223372e+18)) {
      lVar6 = -0x8000000000000000;
    }
    uVar5 = (longlong)fVar7 + lVar6;
    if ((ulonglong)((longlong)fVar7 + lVar6) < 0x11) {
      uVar5 = 0;
    }
    *(ulonglong *)(param_1 + 0x40) = uVar5;
  }
  FUN_1401b2030(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



undefined8 FUN_1401b5520(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_140144560(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  FUN_1401b2030(param_1);
  uVar2 = FUN_1401b4db0(param_1,param_2,param_3,param_4);
  FUN_1401b2030(param_1);
  return uVar2;
}



undefined8 FUN_1401b55a0(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_140144560(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x8007000e);
    }
  }
  FUN_1401b2030(param_1);
  uVar2 = FUN_1401b4f20(param_1,param_2,param_3,param_4);
  FUN_1401b2030(param_1);
  return uVar2;
}



void thunk_FUN_1401b5360(void)

{
  FUN_1401b5360();
  return;
}



// WARNING: Removing unreachable block (ram,0x0001401b56d0)
// WARNING: Removing unreachable block (ram,0x0001401b56d4)
// WARNING: Removing unreachable block (ram,0x0001401b56f0)
// WARNING: Removing unreachable block (ram,0x0001401b56fe)
// WARNING: Removing unreachable block (ram,0x0001401b56f6)
// WARNING: Removing unreachable block (ram,0x0001401b5705)
// WARNING: Removing unreachable block (ram,0x0001401b571d)

void FUN_1401b5630(longlong param_1)

{
  int *piVar1;
  int iVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined *puVar5;
  longlong lVar6;
  longlong lVar7;
  undefined8 *puVar8;
  longlong lVar9;
  longlong *plVar10;
  int iVar11;
  undefined8 *puVar12;
  ulonglong uVar13;
  uint uVar14;
  longlong lVar15;
  longlong lVar16;
  longlong lVar17;
  int local_res10;
  longlong *local_res18;
  longlong local_res20;
  undefined **local_b8;
  longlong *local_b0;
  longlong local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  undefined *local_90;
  longlong local_88;
  undefined1 local_80;
  undefined8 local_78;
  undefined1 local_70;
  undefined8 local_68;
  undefined1 local_60;
  undefined8 local_58;
  undefined8 *local_50;
  
  local_58 = 0xfffffffffffffffe;
  lVar9 = param_1 + 0x10;
  local_88 = lVar9;
  FUN_1400a1c30(lVar9);
  local_80 = 1;
  local_b8 = Proud::CFastArray<>::vftable;
  local_b0 = (longlong *)0x0;
  local_a8 = 0;
  local_a0 = 0;
  local_98 = 0;
  FUN_1400a7b00(&local_b8);
  if ((uint)local_a0 == 0) {
    FUN_1400a3440();
    puVar5 = PTR_DAT_1402f8008;
    local_90 = PTR_DAT_1402f8008;
    lVar15 = (longlong)(int)(uint)local_a0;
    if ((int)(uint)local_a0 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    FUN_1400a6d60(&local_b8,(uint)local_a0 + 1);
    lVar16 = local_a8;
    if ((uint)local_a0 == 0) {
      lVar16 = 0;
    }
    FUN_1400223a0(lVar16 + lVar15 * 8,&local_90);
    if (((puVar5 != (undefined *)0x0) && (puVar5 != PTR_DAT_1402f8008)) &&
       (puVar5 + -8 != (undefined *)0x0)) {
      uVar3 = FUN_1400a3440();
      local_78 = uVar3;
      FUN_1400a1c30(uVar3);
      local_70 = 1;
      piVar1 = (int *)(puVar5 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(puVar5 + -8);
      }
      FUN_1400d1290(uVar3);
      local_70 = 0;
    }
    local_90 = PTR_DAT_1402f8008;
  }
  local_res10 = 0;
  local_res20 = 0;
  uVar14 = (uint)local_a0;
  if (0 < (int)(uint)local_a0) {
    do {
      puVar8 = (undefined8 *)0x0;
      puVar4 = operator_new(0x100);
      puVar12 = puVar8;
      local_50 = puVar4;
      if (puVar4 != (undefined8 *)0x0) {
        *puVar4 = Proud::CSsdpContext::vftable;
        FUN_1400a3440();
        puVar4[1] = PTR_DAT_1402f8008;
        puVar4[2] = 0;
        puVar4[5] = 0;
        puVar4[6] = 0;
        puVar4[7] = 0;
        puVar4[8] = 0;
        puVar4[4] = Proud::ByteArray::vftable;
        *(undefined1 *)(puVar4 + 0x10) = 0;
        *(undefined1 *)(puVar4 + 0x18) = 0;
        puVar4[0x19] = 0;
        puVar4[3] = 0;
        puVar12 = puVar4;
      }
      if (puVar12 == (undefined8 *)0x0) {
        local_res18 = (longlong *)0x0;
      }
      else {
        local_res18 = (longlong *)FUN_1400a34c0(0x10);
        local_res18[1] = 1;
        *local_res18 = (longlong)puVar12;
      }
      lVar9 = local_a8;
      if ((local_res20 < 0) || ((int)(uint)local_a0 <= local_res10)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      if (local_res18 != (longlong *)0x0) {
        puVar8 = (undefined8 *)*local_res18;
      }
      puVar5 = (undefined *)puVar8[1];
      if ((undefined *)puVar8[1] == (undefined *)0x0) {
        puVar5 = PTR_DAT_1402f8008;
      }
      puVar8[1] = puVar5;
      if (*(undefined **)(local_a8 + local_res20 * 8) != puVar5) {
        uVar3 = FUN_1400a3440();
        local_68 = uVar3;
        FUN_1400a1c30(uVar3);
        local_60 = 1;
        FUN_14000c2a0(puVar8 + 1);
        puVar5 = *(undefined **)(lVar9 + local_res20 * 8);
        puVar8[1] = puVar5;
        if (((puVar5 != PTR_DAT_1402f8008) && (puVar5 != (undefined *)0x0)) &&
           (puVar5 != (undefined *)0x8)) {
          *(int *)(puVar5 + -4) = *(int *)(puVar5 + -4) + 1;
        }
        FUN_1400d1290(uVar3);
        local_60 = 0;
      }
      lVar15 = param_1 + 0x100;
      iVar2 = *(int *)(param_1 + 0x118);
      lVar9 = (longlong)iVar2;
      if (iVar2 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      iVar11 = *(int *)(param_1 + 0x118);
      FUN_1401b4760(lVar15,iVar11 + 1);
      iVar11 = iVar11 - iVar2;
      if ((0 < iVar11) && (iVar11 = iVar11 + -1, -1 < iVar11)) {
        lVar16 = (longlong)(iVar11 + iVar2 + 1) << 3;
        lVar17 = (longlong)(iVar11 + iVar2) << 3;
        do {
          lVar6 = FUN_1401b2160(lVar15);
          lVar7 = FUN_1401b2160(lVar15);
          FUN_14016b650(lVar16 + lVar7,lVar17 + lVar6);
          lVar17 = lVar17 + -8;
          lVar16 = lVar16 + -8;
          iVar11 = iVar11 + -1;
        } while (-1 < iVar11);
      }
      lVar15 = FUN_1401b2160(lVar15);
      if (local_res18 != *(longlong **)(lVar15 + lVar9 * 8)) {
        if (local_res18 != (longlong *)0x0) {
          local_res18[1] = local_res18[1] + 1;
        }
        plVar10 = (longlong *)0x0;
        lVar16 = *(longlong *)(lVar15 + lVar9 * 8);
        if ((lVar16 != 0) &&
           (*(longlong *)(*(longlong *)(lVar15 + lVar9 * 8) + 8) = *(longlong *)(lVar16 + 8) + -1,
           *(longlong *)(*(longlong *)(lVar15 + lVar9 * 8) + 8) == 0)) {
          plVar10 = *(longlong **)(lVar15 + lVar9 * 8);
        }
        *(longlong **)(lVar15 + lVar9 * 8) = local_res18;
        if (plVar10 != (longlong *)0x0) {
          puVar8 = (undefined8 *)*plVar10;
          if (puVar8 != (undefined8 *)0x0) {
            (**(code **)*puVar8)(puVar8,1);
          }
          FUN_1400a3530(plVar10);
        }
      }
      if (local_res18 != (longlong *)0x0) {
        plVar10 = local_res18 + 1;
        *plVar10 = *plVar10 + -1;
        if (*plVar10 == 0) {
          puVar8 = (undefined8 *)*local_res18;
          if (puVar8 != (undefined8 *)0x0) {
            (**(code **)*puVar8)(puVar8,1);
          }
          FUN_1400a3530(local_res18);
        }
      }
      local_res10 = local_res10 + 1;
      local_res20 = local_res20 + 1;
      lVar9 = local_88;
      uVar14 = (uint)local_a0;
    } while (local_res10 < (int)(uint)local_a0);
  }
  local_b8 = Proud::CFastArray<>::vftable;
  if (0 < (int)uVar14) {
    uVar13 = (ulonglong)uVar14;
    lVar15 = local_a8;
    do {
      FUN_14000c2a0(lVar15);
      lVar15 = lVar15 + 8;
      uVar13 = uVar13 - 1;
    } while (uVar13 != 0);
  }
  if (local_a8 != 0) {
    if (local_b0 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*local_b0 + 0x18))(local_b0,local_a8);
    }
  }
  FUN_1400d1290(lVar9);
  return;
}



void FUN_1401b5ad0(void)

{
  FUN_1401b5380();
  return;
}



longlong * FUN_1401b5af0(longlong param_1,undefined8 *param_2)

{
  char cVar1;
  ulonglong uVar2;
  int iVar3;
  char *pcVar4;
  longlong *plVar5;
  undefined *puVar6;
  uint uVar7;
  char *pcVar8;
  
  pcVar8 = (char *)*param_2;
  pcVar4 = pcVar8;
  if (pcVar8 == (char *)0x0) {
    pcVar4 = PTR_DAT_1402f8008;
  }
  if (pcVar4 == (char *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  uVar7 = 0;
  if (pcVar8 == (char *)0x0) {
    pcVar8 = PTR_DAT_1402f8008;
  }
  cVar1 = *pcVar8;
  while (cVar1 != '\0') {
    pcVar8 = pcVar8 + 1;
    uVar7 = uVar7 * 0x21 + (int)cVar1;
    cVar1 = *pcVar8;
  }
  uVar2 = (ulonglong)uVar7 % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (plVar5 = *(longlong **)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (plVar5 != (longlong *)0x0 &&
        ((uint)uVar2 == *(uint *)(plVar5 + 4) % *(uint *)(param_1 + 0x28)));
        plVar5 = (longlong *)plVar5[2]) {
      puVar6 = (undefined *)*plVar5;
      if ((undefined *)*plVar5 == (undefined *)0x0) {
        puVar6 = PTR_DAT_1402f8008;
      }
      iVar3 = FUN_1400a33c0(puVar6);
      if (iVar3 == 0) goto LAB_1401b5bd0;
    }
  }
  plVar5 = (longlong *)FUN_1401b5520(param_1,param_2,uVar2,uVar7);
LAB_1401b5bd0:
  return plVar5 + 1;
}



longlong * FUN_1401b5bf0(longlong param_1,undefined8 *param_2)

{
  ushort uVar1;
  ulonglong uVar2;
  int iVar3;
  ushort *puVar4;
  longlong *plVar5;
  undefined *puVar6;
  uint uVar7;
  ushort *puVar8;
  
  puVar8 = (ushort *)*param_2;
  puVar4 = puVar8;
  if (puVar8 == (ushort *)0x0) {
    puVar4 = (ushort *)PTR_DAT_1402f8010;
  }
  if (puVar4 == (ushort *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  uVar7 = 0;
  if (puVar8 == (ushort *)0x0) {
    puVar8 = (ushort *)PTR_DAT_1402f8010;
  }
  uVar1 = *puVar8;
  while (uVar1 != 0) {
    puVar8 = puVar8 + 1;
    uVar7 = uVar7 * 0x21 + (uint)uVar1;
    uVar1 = *puVar8;
  }
  uVar2 = (ulonglong)uVar7 % (ulonglong)*(uint *)(param_1 + 0x28);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (plVar5 = *(longlong **)(*(longlong *)(param_1 + 8) + uVar2 * 8);
        (plVar5 != (longlong *)0x0 &&
        ((uint)uVar2 == *(uint *)(plVar5 + 4) % *(uint *)(param_1 + 0x28)));
        plVar5 = (longlong *)plVar5[2]) {
      puVar6 = (undefined *)*plVar5;
      if ((undefined *)*plVar5 == (undefined *)0x0) {
        puVar6 = PTR_DAT_1402f8010;
      }
      iVar3 = FUN_1400a3300(puVar6);
      if (iVar3 == 0) goto LAB_1401b5cd0;
    }
  }
  plVar5 = (longlong *)FUN_1401b55a0(param_1,param_2,uVar2,uVar7);
LAB_1401b5cd0:
  return plVar5 + 1;
}



// WARNING: Removing unreachable block (ram,0x0001401b5d97)
// WARNING: Removing unreachable block (ram,0x0001401b5da0)
// WARNING: Removing unreachable block (ram,0x0001401b5dc1)
// WARNING: Removing unreachable block (ram,0x0001401b5dca)

undefined8 *
FUN_1401b5cf0(undefined8 *param_1,undefined8 param_2,undefined1 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined4 uVar2;
  
  *param_1 = Proud::CUpnp::vftable;
  uVar2 = FUN_1401692e0(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  FUN_1400a1b50(param_1 + 2,uVar2,1);
  *(undefined1 *)(param_1 + 10) = 0;
  param_1[0x14] = 0;
  param_1[0xb] = 0;
  param_1[0xc] = 0;
  param_1[0xd] = 0;
  *(undefined4 *)(param_1 + 0xf) = 0x11;
  param_1[0xe] = 0;
  *(undefined4 *)(param_1 + 0x13) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x10) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x84) = 0x40100000;
  param_1[0x11] = 0x26;
  param_1[0x12] = 4;
  param_1[0x12] = 0;
  FUN_1401529c0(param_1 + 0x15);
  param_1[0x20] = Proud::CFastArray<>::vftable;
  param_1[0x21] = 0;
  param_1[0x22] = 0;
  param_1[0x23] = 0;
  param_1[0x24] = 0;
  param_1[1] = param_2;
  *(undefined4 *)(param_1 + 9) = 0;
  uVar1 = FUN_1401a8ef0(param_2);
  param_1[0x25] = uVar1;
  return param_1;
}



void FUN_1401b5e50(undefined8 *param_1)

{
  undefined8 *puVar1;
  longlong *plVar2;
  
  *param_1 = Proud::CUpnp::vftable;
  puVar1 = param_1 + 2;
  FUN_1400a1c30(puVar1);
  FUN_1401b5380(param_1 + 10);
  FUN_1401b4af0(param_1 + 0x15);
  FUN_1401b4760(param_1 + 0x20,0);
  FUN_1400d1290(puVar1);
  param_1[0x20] = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 0x23)) {
    FUN_1401b3620(param_1[0x22],(longlong)*(int *)(param_1 + 0x23));
  }
  if (param_1[0x22] != 0) {
    plVar2 = (longlong *)param_1[0x21];
    if (plVar2 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar2 + 0x18))(plVar2,param_1[0x22]);
    }
  }
  FUN_1401b5360(param_1 + 0x15);
  FUN_1401b5ad0(param_1 + 10);
  FUN_1400a1cd0(puVar1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401b5f50(longlong param_1,longlong param_2)

{
  ulonglong uVar1;
  undefined1 *puVar2;
  char cVar3;
  uint uVar4;
  uint uVar5;
  int iVar6;
  undefined8 *puVar7;
  void *_Src;
  uint *puVar8;
  undefined8 uVar9;
  uint *puVar10;
  uint *puVar11;
  undefined8 *puVar12;
  longlong *plVar13;
  undefined *puVar14;
  uint uVar15;
  size_t _Size;
  uint uVar16;
  uint uVar17;
  longlong *plVar19;
  uint *puVar20;
  uint uVar21;
  longlong lVar22;
  double dVar23;
  undefined1 auStack_218 [32];
  uint *local_1f8;
  uint *local_1f0;
  longlong *local_1e8;
  uint *local_1e0;
  longlong local_1d8;
  undefined8 local_1d0;
  undefined **local_1c8;
  undefined4 local_1c0;
  undefined2 local_1bc;
  int local_1b8;
  longlong local_1b0;
  undefined8 local_1a8;
  undefined8 *local_1a0;
  undefined8 local_198;
  undefined1 local_190;
  undefined8 local_188;
  undefined1 local_180;
  longlong *local_178;
  longlong local_170;
  longlong *local_168;
  longlong local_160;
  undefined8 local_158;
  undefined1 local_150;
  undefined8 local_148;
  undefined1 local_140;
  undefined8 local_138;
  undefined1 local_130;
  undefined8 local_128;
  undefined1 local_120;
  undefined8 local_118;
  uint **local_110;
  uint *local_108;
  undefined8 local_100;
  undefined1 local_f8;
  undefined1 *local_e8;
  undefined1 local_e0 [136];
  ulonglong local_58;
  uint *puVar18;
  
  local_118 = 0xfffffffffffffffe;
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_218;
  puVar12 = (undefined8 *)(param_2 + 0x10);
  puVar18 = (uint *)0x0;
  uVar16 = 0;
  local_1d8 = param_1;
  local_1b0 = param_2;
  local_1a0 = puVar12;
  do {
    local_1c8 = Proud::AddrPort::vftable;
    uVar17 = 0;
    local_1b8 = 0;
    local_1d0 = 0;
    local_1c0 = DAT_1402f83d0;
    local_1bc = DAT_1402f83d4;
    puVar8 = puVar18;
    if ((undefined8 *)*puVar12 != (undefined8 *)0x0) {
      puVar8 = *(uint **)*puVar12;
    }
    cVar3 = FUN_1400a8570(puVar8,0,&local_1d0);
    if (cVar3 == '\0') {
      return;
    }
    *(undefined1 *)(param_2 + 0xc0) = 0;
    if ((local_1d0._4_4_ != 0) || (local_1b8 == 0)) {
      *(undefined4 *)(param_2 + 0x18) = 3;
      local_1a8 = 0;
      FUN_1400a5190(puVar12,&local_1a8);
      return;
    }
    FUN_1400a3440();
    local_1f8 = (uint *)PTR_DAT_1402f8008;
    local_110 = &local_1f8;
    uVar5 = local_1b8 + 2U;
    if ((int)(local_1b8 + 2U) < 1) {
      uVar5 = uVar17;
    }
    uVar4 = 1;
    if (1 < (int)uVar5) {
      uVar4 = uVar5;
    }
    puVar8 = local_1f8;
    if (0 < (int)uVar4) {
      if ((int)uVar4 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if (uVar4 == 0) {
        puVar8 = local_1f8;
      }
      else {
        puVar8 = (uint *)FUN_1400a34c0((longlong)(int)uVar4 + 9);
        if (puVar8 != (uint *)0x0) {
          *puVar8 = 0;
          puVar8[1] = 1;
        }
        *puVar8 = uVar4;
        uVar5 = uVar17;
        if ((local_1f8 != (uint *)0x0) && (local_1f8 != (uint *)PTR_DAT_1402f8008)) {
          uVar5 = local_1f8[-2];
        }
        puVar10 = (uint *)PTR_DAT_1402f8008;
        if ((int)uVar4 < (int)uVar5) {
LAB_1401b60c7:
          if (local_1f8 != (uint *)0x0) {
            puVar10 = local_1f8;
          }
        }
        else {
          uVar4 = uVar17;
          if (local_1f8 != (uint *)0x0) {
            if (local_1f8 != (uint *)PTR_DAT_1402f8008) {
              uVar4 = local_1f8[-2];
            }
            goto LAB_1401b60c7;
          }
        }
        puVar8 = puVar8 + 2;
        FUN_1400a3390(puVar8,puVar10,uVar4);
        puVar10 = local_1f8;
        if (((local_1f8 != (uint *)0x0) && (local_1f8 != (uint *)PTR_DAT_1402f8008)) &&
           (puVar11 = local_1f8 + -2, puVar11 != (uint *)0x0)) {
          uVar9 = FUN_1400a3440();
          local_138 = uVar9;
          FUN_1400a1c30(uVar9);
          local_130 = 1;
          puVar10 = puVar10 + -1;
          *puVar10 = *puVar10 - 1;
          if (*puVar10 == 0) {
            FUN_1400a3530(puVar11);
          }
          FUN_1400d1290(uVar9);
          local_130 = 0;
        }
      }
    }
    local_1f8 = puVar8;
    puVar8 = (uint *)PTR_DAT_1402f8008;
    if (((local_1f8 == (uint *)0x0) || (puVar8 = local_1f8, local_1f8 == (uint *)PTR_DAT_1402f8008))
       || (local_1f8 + -2 == (uint *)0x0)) {
      local_1f8 = puVar8;
      puVar7 = (undefined8 *)FUN_1400a34c0();
      *puVar7 = 0;
      *(undefined1 *)(puVar7 + 1) = 0;
      if (puVar7 != (undefined8 *)0x0) {
        *(undefined4 *)puVar7 = 0;
        *(undefined4 *)((longlong)puVar7 + 4) = 1;
      }
      *(undefined1 *)(puVar7 + 1) = 0;
      puVar8 = (uint *)(puVar7 + 1);
    }
    else if (1 < (int)local_1f8[-1]) {
      uVar5 = local_1f8[-2];
      if ((int)uVar5 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      puVar8 = (uint *)FUN_1400a34c0((longlong)(int)uVar5 + 9);
      if (puVar8 != (uint *)0x0) {
        *puVar8 = 0;
        puVar8[1] = 1;
      }
      uVar5 = uVar16;
      if ((local_1f8 != (uint *)0x0) && (local_1f8 != (uint *)PTR_DAT_1402f8008)) {
        uVar5 = local_1f8[-2];
      }
      *puVar8 = uVar5;
      puVar10 = (uint *)PTR_DAT_1402f8008;
      puVar11 = puVar18;
      if ((local_1f8 != (uint *)0x0) &&
         (puVar10 = local_1f8, puVar11 = (uint *)0x0, local_1f8 != (uint *)PTR_DAT_1402f8008)) {
        puVar11 = (uint *)(ulonglong)local_1f8[-2];
      }
      puVar8 = puVar8 + 2;
      FUN_1400a3390(puVar8,puVar10,puVar11);
      puVar10 = local_1f8;
      if (((local_1f8 != (uint *)0x0) && (local_1f8 != (uint *)PTR_DAT_1402f8008)) &&
         (puVar11 = local_1f8 + -2, puVar11 != (uint *)0x0)) {
        uVar9 = FUN_1400a3440();
        local_198 = uVar9;
        FUN_1400a1c30(uVar9);
        local_190 = 1;
        puVar10 = puVar10 + -1;
        *puVar10 = *puVar10 - 1;
        if (*puVar10 == 0) {
          FUN_1400a3530(puVar11);
        }
        FUN_1400d1290(uVar9);
        local_190 = 0;
      }
    }
    local_1f8 = puVar8;
    puVar8 = local_1f8;
    if (local_1f8 == (uint *)0x0) {
      puVar8 = (uint *)PTR_DAT_1402f8008;
    }
    puVar10 = puVar18;
    if ((undefined8 *)*puVar12 != (undefined8 *)0x0) {
      puVar10 = *(uint **)*puVar12;
    }
    _Size = (size_t)local_1b8;
    local_108 = puVar8;
    _Src = (void *)FUN_1400a8b30(puVar10);
    memcpy(puVar8,_Src,_Size);
    *(undefined1 *)((longlong)local_1b8 + (longlong)puVar8) = 0;
    puVar8 = local_1f8;
    if (local_1f8 == (uint *)0x0) {
      puVar8 = (uint *)PTR_DAT_1402f8008;
    }
    uVar4 = FUN_1400a3360(puVar8);
    uVar5 = uVar16;
    if (0 < (int)uVar4) {
      uVar5 = uVar4;
    }
    uVar15 = 0;
    uVar4 = uVar15;
    if ((local_1f8 != (uint *)0x0) && (local_1f8 != (uint *)PTR_DAT_1402f8008)) {
      uVar4 = local_1f8[-2];
    }
    if (((int)uVar5 < (int)uVar4) || (uVar5 = uVar15, local_1f8 == (uint *)0x0)) {
LAB_1401b62ea:
      if (((local_1f8 != (uint *)PTR_DAT_1402f8008) && (local_1f8 != (uint *)0x0)) &&
         (puVar8 = local_1f8 + -2, puVar8 != (uint *)0x0)) {
        *puVar8 = uVar5;
        *(undefined1 *)((longlong)(int)uVar5 + 8 + (longlong)puVar8) = 0;
      }
    }
    else if (local_1f8 != (uint *)PTR_DAT_1402f8008) {
      uVar5 = local_1f8[-2];
      goto LAB_1401b62ea;
    }
    local_1e8 = operator_new(0x2540);
    puVar8 = puVar18;
    if (local_1e8 != (void *)0x0) {
      puVar8 = (uint *)FUN_1401b3d90(local_1e8);
    }
    if (puVar8 == (uint *)0x0) {
      local_1e8 = (longlong *)0x0;
    }
    else {
      local_1e8 = (longlong *)FUN_1400a34c0(0x10);
      local_1e8[1] = 1;
      *local_1e8 = (longlong)puVar8;
    }
    plVar19 = local_1e8;
    FUN_1400a3440();
    local_1e0 = (uint *)PTR_DAT_1402f8008;
    if (PTR_DAT_1402f8008 == (undefined *)0x0) {
      local_1e0 = puVar18;
    }
    if (local_1f8 != (uint *)PTR_DAT_1402f8008) {
      uVar9 = FUN_1400a3440();
      local_148 = uVar9;
      FUN_1400a1c30(uVar9);
      local_140 = 1;
      FUN_14000c2a0(&local_1e0);
      local_1e0 = local_1f8;
      if (((local_1f8 != (uint *)PTR_DAT_1402f8008) && (local_1f8 != (uint *)0x0)) &&
         (local_1f8 != (uint *)0x8)) {
        local_1f8[-1] = local_1f8[-1] + 1;
      }
      FUN_1400d1290(uVar9);
      local_140 = 0;
    }
    puVar8 = puVar18;
    if (plVar19 != (longlong *)0x0) {
      puVar8 = (uint *)*plVar19;
    }
    cVar3 = FUN_1401b38d0(puVar8,&local_1e0);
    if ((cVar3 != '\0') && (*(ulonglong *)(param_1 + 0x70) < 0x14)) {
      puVar8 = puVar18;
      if (plVar19 != (longlong *)0x0) {
        puVar8 = (uint *)*plVar19;
      }
      local_e8 = local_e0;
      FUN_1400a1e40(&local_e8,(undefined1 *)((longlong)puVar8 + 0x52),3);
      puVar2 = local_e8;
      FUN_1400a3440();
      puVar8 = (uint *)PTR_DAT_1402f8008;
      local_1f0 = (uint *)PTR_DAT_1402f8008;
      uVar5 = FUN_1400a3360(puVar2);
      puVar10 = puVar18;
      if ((puVar8 != (uint *)0x0) && (puVar10 = (uint *)0x0, puVar8 != (uint *)PTR_DAT_1402f8008)) {
        puVar10 = (uint *)(ulonglong)*(uint *)((longlong)puVar8 + -8);
      }
      uVar4 = uVar5;
      if ((((int)uVar5 <= (int)puVar10) && (uVar4 = uVar15, puVar8 != (uint *)0x0)) &&
         (puVar8 != (uint *)PTR_DAT_1402f8008)) {
        uVar4 = *(uint *)((longlong)puVar8 + -8);
      }
      uVar21 = 1;
      if (1 < (int)uVar4) {
        uVar21 = uVar4;
      }
      uVar4 = uVar15;
      if ((puVar8 != (uint *)0x0) && (puVar8 != (uint *)PTR_DAT_1402f8008)) {
        uVar4 = *(uint *)((longlong)puVar8 + -8);
      }
      if ((int)uVar4 < (int)uVar21) {
        if (puVar8 == (uint *)0x0) {
          puVar8 = (uint *)PTR_DAT_1402f8008;
        }
        local_1f0 = puVar8;
        if ((int)uVar21 < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        if (uVar21 == 0) {
          FUN_14000c2a0(&local_1f0);
          puVar8 = local_1f0;
        }
        else {
          uVar4 = uVar15;
          if ((puVar8 != (uint *)0x0) && (puVar8 != (uint *)PTR_DAT_1402f8008)) {
            uVar4 = puVar8[-2];
          }
          if (uVar21 != uVar4) {
            puVar10 = (uint *)FUN_1400a34c0((longlong)(int)uVar21 + 9);
            if (puVar10 != (uint *)0x0) {
              *puVar10 = 0;
              puVar10[1] = 1;
            }
            *puVar10 = uVar21;
            uVar4 = uVar16;
            if ((puVar8 != (uint *)0x0) && (puVar8 != (uint *)PTR_DAT_1402f8008)) {
              uVar4 = puVar8[-2];
            }
            puVar11 = (uint *)PTR_DAT_1402f8008;
            if ((int)uVar21 < (int)uVar4) {
LAB_1401b6512:
              if (puVar8 != (uint *)0x0) {
                puVar11 = puVar8;
              }
            }
            else {
              uVar21 = uVar17;
              if (puVar8 != (uint *)0x0) {
                if (puVar8 != (uint *)PTR_DAT_1402f8008) {
                  uVar21 = puVar8[-2];
                }
                goto LAB_1401b6512;
              }
            }
            puVar8 = puVar10 + 2;
            FUN_1400a3390(puVar8,puVar11,uVar21);
            FUN_14000c2a0(&local_1f0);
            local_1f0 = puVar8;
          }
        }
      }
      if (((puVar8 == (uint *)0x0) || (puVar8 == (uint *)PTR_DAT_1402f8008)) ||
         (puVar10 = puVar8 + -2, puVar10 == (uint *)0x0)) {
        puVar12 = (undefined8 *)FUN_1400a34c0();
        *puVar12 = 0;
        *(undefined1 *)(puVar12 + 1) = 0;
        if (puVar12 != (undefined8 *)0x0) {
          *(undefined4 *)puVar12 = 0;
          *(undefined4 *)((longlong)puVar12 + 4) = 1;
        }
        puVar11 = (uint *)(puVar12 + 1);
        *(undefined1 *)puVar11 = 0;
        puVar20 = puVar11;
      }
      else {
        puVar11 = puVar8;
        puVar20 = local_1f0;
        if (1 < (int)puVar8[-1]) {
          if ((int)*puVar10 < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          puVar11 = (uint *)FUN_1400a34c0((longlong)(int)*puVar10 + 9);
          if (puVar11 != (uint *)0x0) {
            *puVar11 = 0;
            puVar11[1] = 1;
          }
          uVar17 = uVar16;
          if (puVar8 != (uint *)PTR_DAT_1402f8008) {
            uVar17 = *puVar10;
          }
          *puVar11 = uVar17;
          puVar20 = puVar18;
          if (puVar8 != (uint *)PTR_DAT_1402f8008) {
            puVar20 = (uint *)(ulonglong)*puVar10;
          }
          puVar11 = puVar11 + 2;
          FUN_1400a3390(puVar11,puVar8,puVar20);
          param_1 = local_1d8;
          puVar20 = puVar11;
          if ((puVar8 != (uint *)PTR_DAT_1402f8008) && (puVar10 != (uint *)0x0)) {
            uVar9 = FUN_1400a3440();
            local_158 = uVar9;
            FUN_1400a1c30(uVar9);
            local_150 = 1;
            puVar8 = puVar8 + -1;
            *puVar8 = *puVar8 - 1;
            if (*puVar8 == 0) {
              FUN_1400a3530(puVar10);
            }
            FUN_1400d1290(uVar9);
            local_150 = 0;
            param_1 = local_1d8;
          }
        }
      }
      local_1f0 = puVar20;
      puVar8 = puVar11;
      if (puVar11 == (uint *)0x0) {
        puVar8 = (uint *)PTR_DAT_1402f8008;
      }
      FUN_1400a3390(puVar8,puVar2,uVar5);
      puVar8 = puVar11;
      if (puVar11 == (uint *)0x0) {
        puVar8 = (uint *)PTR_DAT_1402f8008;
      }
      uVar5 = FUN_1400a3360(puVar8);
      uVar17 = uVar16;
      if (0 < (int)uVar5) {
        uVar17 = uVar5;
      }
      uVar5 = uVar15;
      if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1402f8008)) {
        uVar5 = puVar11[-2];
      }
      if (((int)uVar17 < (int)uVar5) || (uVar17 = uVar15, puVar11 == (uint *)0x0)) {
LAB_1401b669d:
        if (((puVar11 != (uint *)PTR_DAT_1402f8008) && (puVar11 != (uint *)0x0)) &&
           (puVar8 = puVar11 + -2, puVar8 != (uint *)0x0)) {
          *puVar8 = uVar17;
          *(undefined1 *)((longlong)(int)uVar17 + 8 + (longlong)puVar8) = 0;
        }
      }
      else if (puVar11 != (uint *)PTR_DAT_1402f8008) {
        uVar17 = puVar11[-2];
        goto LAB_1401b669d;
      }
      if (local_e8 != local_e0) {
        free(local_e8);
      }
      lVar22 = param_1 + 0x50;
      puVar8 = puVar11;
      if (puVar11 == (uint *)0x0) {
        puVar8 = (uint *)PTR_DAT_1402f8008;
      }
      local_170 = lVar22;
      if (puVar8 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      puVar8 = puVar11;
      if (puVar11 == (uint *)0x0) {
        puVar8 = (uint *)PTR_DAT_1402f8008;
      }
      cVar3 = (char)*puVar8;
      puVar10 = puVar18;
      while (cVar3 != '\0') {
        puVar10 = (uint *)(ulonglong)(uint)((int)puVar10 * 0x21 + (int)cVar3);
        puVar8 = (uint *)((longlong)puVar8 + 1);
        cVar3 = *(char *)puVar8;
      }
      uVar1 = (ulonglong)puVar10 % (ulonglong)*(uint *)(param_1 + 0x78);
      if (*(longlong *)(param_1 + 0x58) != 0) {
        for (plVar13 = *(longlong **)(*(longlong *)(param_1 + 0x58) + uVar1 * 8);
            (plVar13 != (longlong *)0x0 &&
            ((uint)uVar1 == *(uint *)(plVar13 + 4) % *(uint *)(param_1 + 0x78)));
            plVar13 = (longlong *)plVar13[2]) {
          puVar14 = (undefined *)*plVar13;
          if ((undefined *)*plVar13 == (undefined *)0x0) {
            puVar14 = PTR_DAT_1402f8008;
          }
          iVar6 = FUN_1400a33c0(puVar14);
          if (iVar6 == 0) {
            local_178 = plVar13;
            if (plVar13 != (longlong *)0x0) goto LAB_1401b68d2;
            goto LAB_1401b679b;
          }
        }
      }
      local_178 = (longlong *)0x0;
LAB_1401b679b:
      puVar8 = puVar11;
      if (puVar11 == (uint *)0x0) {
        puVar8 = (uint *)PTR_DAT_1402f8008;
      }
      local_160 = lVar22;
      if (puVar8 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      puVar8 = puVar11;
      if (puVar11 == (uint *)0x0) {
        puVar8 = (uint *)PTR_DAT_1402f8008;
      }
      cVar3 = (char)*puVar8;
      puVar10 = puVar18;
      while (cVar3 != '\0') {
        puVar10 = (uint *)(ulonglong)(uint)((int)puVar10 * 0x21 + (int)cVar3);
        puVar8 = (uint *)((longlong)puVar8 + 1);
        cVar3 = *(char *)puVar8;
      }
      uVar1 = (ulonglong)puVar10 % (ulonglong)*(uint *)(param_1 + 0x78);
      if (*(longlong *)(param_1 + 0x58) != 0) {
        for (plVar13 = *(longlong **)(*(longlong *)(param_1 + 0x58) + uVar1 * 8);
            (plVar13 != (longlong *)0x0 &&
            ((uint)uVar1 == *(uint *)(plVar13 + 4) % *(uint *)(param_1 + 0x78)));
            plVar13 = (longlong *)plVar13[2]) {
          puVar14 = (undefined *)*plVar13;
          if ((undefined *)*plVar13 == (undefined *)0x0) {
            puVar14 = PTR_DAT_1402f8008;
          }
          iVar6 = FUN_1400a33c0(puVar14);
          if (iVar6 == 0) {
            local_168 = plVar13;
            if (plVar13 != (longlong *)0x0) goto LAB_1401b68d2;
            goto LAB_1401b6854;
          }
        }
      }
      local_168 = (longlong *)0x0;
LAB_1401b6854:
      plVar13 = (longlong *)FUN_1401b5af0(lVar22,&local_1f0);
      if (plVar19 != (longlong *)*plVar13) {
        if (plVar19 != (longlong *)0x0) {
          plVar19[1] = plVar19[1] + 1;
          puVar11 = local_1f0;
          plVar19 = local_1e8;
        }
        puVar8 = puVar18;
        if ((*plVar13 != 0) &&
           (*(longlong *)(*plVar13 + 8) = *(longlong *)(*plVar13 + 8) + -1, puVar11 = local_1f0,
           plVar19 = local_1e8, *(longlong *)(*plVar13 + 8) == 0)) {
          puVar8 = (uint *)*plVar13;
        }
        *plVar13 = (longlong)plVar19;
        if (puVar8 != (uint *)0x0) {
          puVar12 = *(undefined8 **)puVar8;
          if (puVar12 != (undefined8 *)0x0) {
            (**(code **)*puVar12)(puVar12,1);
          }
          FUN_1400a3530(puVar8);
        }
      }
LAB_1401b68d2:
      if (((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1402f8008)) &&
         (puVar11 + -2 != (uint *)0x0)) {
        uVar9 = FUN_1400a3440();
        local_188 = uVar9;
        FUN_1400a1c30(uVar9);
        local_180 = 1;
        puVar8 = puVar11 + -1;
        *puVar8 = *puVar8 - 1;
        if (*puVar8 == 0) {
          FUN_1400a3530(puVar11 + -2);
        }
        FUN_1400d1290(uVar9);
        local_180 = 0;
      }
      local_1f0 = (uint *)PTR_DAT_1402f8008;
      param_1 = local_1d8;
      puVar12 = local_1a0;
    }
    dVar23 = (double)FUN_1401a8ef0(*(undefined8 *)(param_1 + 8));
    param_2 = local_1b0;
    if (3.0 < dVar23 - *(double *)(local_1b0 + 200)) {
      if ((undefined8 *)*puVar12 != (undefined8 *)0x0) {
        puVar18 = *(uint **)*puVar12;
      }
      FUN_1400a88b0(puVar18);
      plVar13 = local_1e8;
      *(undefined4 *)(param_2 + 0x18) = 3;
      if (plVar19 != (longlong *)0x0) {
        plVar19 = plVar19 + 1;
        *plVar19 = *plVar19 + -1;
        if (*plVar19 == 0) {
          puVar12 = (undefined8 *)*local_1e8;
          if (puVar12 != (undefined8 *)0x0) {
            (**(code **)*puVar12)(puVar12,1);
          }
          FUN_1400a3530(plVar13);
        }
      }
      puVar18 = local_1f8;
      if (((local_1f8 != (uint *)0x0) && (local_1f8 != (uint *)PTR_DAT_1402f8008)) &&
         (puVar8 = local_1f8 + -2, puVar8 != (uint *)0x0)) {
        uVar9 = FUN_1400a3440();
        local_100 = uVar9;
        FUN_1400a1c30(uVar9);
        local_f8 = 1;
        puVar18 = puVar18 + -1;
        *puVar18 = *puVar18 - 1;
        if (*puVar18 == 0) {
          FUN_1400a3530(puVar8);
        }
        FUN_1400d1290(uVar9);
      }
      return;
    }
    FUN_1401b4a20(param_1);
    plVar13 = local_1e8;
    if (plVar19 != (longlong *)0x0) {
      plVar19 = plVar19 + 1;
      *plVar19 = *plVar19 + -1;
      if (*plVar19 == 0) {
        if ((undefined8 *)*local_1e8 != (undefined8 *)0x0) {
          (*(code *)**(undefined8 **)*local_1e8)();
        }
        FUN_1400a3530(plVar13);
      }
    }
    puVar8 = local_1f8;
    if (((local_1f8 != (uint *)0x0) && (local_1f8 != (uint *)PTR_DAT_1402f8008)) &&
       (puVar10 = local_1f8 + -2, puVar10 != (uint *)0x0)) {
      uVar9 = FUN_1400a3440();
      local_128 = uVar9;
      FUN_1400a1c30(uVar9);
      local_120 = 1;
      puVar8 = puVar8 + -1;
      *puVar8 = *puVar8 - 1;
      if (*puVar8 == 0) {
        FUN_1400a3530(puVar10);
      }
      FUN_1400d1290(uVar9);
      local_120 = 0;
    }
    local_1f8 = (uint *)PTR_DAT_1402f8008;
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401b6b00(longlong *param_1,longlong param_2)

{
  longlong *plVar1;
  int *piVar2;
  ushort uVar3;
  longlong *plVar4;
  char cVar5;
  uint uVar6;
  uint uVar7;
  uint uVar8;
  int iVar9;
  void *_Dst;
  uint *puVar10;
  uint *puVar11;
  undefined8 uVar12;
  uint *puVar13;
  undefined1 *puVar14;
  undefined8 uVar15;
  longlong lVar16;
  undefined *puVar17;
  void *_Src;
  uint *puVar18;
  longlong lVar19;
  uint *puVar20;
  uint uVar21;
  undefined *puVar22;
  undefined1 auStack_a38 [32];
  uint local_a18;
  uint *local_a08;
  uint *local_a00;
  uint *local_9f8;
  uint *local_9f0;
  uint local_9e8 [2];
  longlong *local_9e0;
  undefined *local_9d8;
  undefined *local_9d0;
  undefined *local_9c8;
  undefined *local_9c0;
  undefined *local_9b8;
  undefined8 local_9b0;
  undefined **local_9a8;
  undefined4 local_9a0;
  undefined2 local_99c;
  int local_998;
  undefined8 local_990;
  undefined **local_988;
  undefined4 local_980;
  undefined2 local_97c;
  int local_978;
  undefined8 local_970;
  undefined **local_968;
  undefined4 local_960;
  undefined2 local_95c;
  undefined4 local_958;
  undefined8 local_950;
  undefined1 local_948;
  undefined8 local_940;
  undefined1 local_938;
  undefined8 local_930;
  undefined1 local_928;
  undefined8 local_920;
  undefined1 local_918;
  undefined8 local_910;
  undefined1 local_908;
  undefined8 local_900;
  undefined1 local_8f8;
  undefined8 local_8f0;
  undefined1 local_8e8;
  undefined8 local_8e0;
  undefined8 local_8d8;
  undefined1 local_8d0;
  undefined8 local_8c8;
  undefined1 local_8c0;
  undefined8 local_8b8;
  undefined1 local_8b0;
  undefined8 local_8a8;
  undefined1 local_8a0;
  undefined1 *local_898;
  undefined1 local_890 [136];
  undefined1 *local_808;
  undefined1 local_800 [136];
  undefined1 *local_778;
  undefined1 local_770 [264];
  undefined1 local_668 [1568];
  ulonglong local_48;
  
  local_8e0 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_a38;
  iVar9 = *(int *)(param_2 + 0x2490);
  local_9e0 = param_1;
  if (iVar9 == 0) {
    lVar19 = 0;
    if (*(int *)(param_2 + 0x2494) == 0) {
      local_9d8 = (undefined *)FUN_1400a34c0(0x400);
      lVar16 = lVar19;
      if (local_9d8 != (undefined *)0x0) {
        lVar16 = FUN_1400a8db0(local_9d8,0,param_2);
      }
      if (lVar16 == 0) {
        local_9e0 = (longlong *)0x0;
      }
      else {
        local_9e0 = (longlong *)FUN_1400a34c0(0x10);
        local_9e0[1] = 1;
        *local_9e0 = lVar16;
      }
      plVar1 = local_9e0;
      FUN_1400a5190(param_2 + 0x2480,&local_9e0);
      plVar4 = local_9e0;
      if (plVar1 != (longlong *)0x0) {
        plVar1 = plVar1 + 1;
        *plVar1 = *plVar1 + -1;
        if (*plVar1 == 0) {
          lVar16 = *local_9e0;
          if (lVar16 != 0) {
            FUN_1400a8cc0(lVar16);
            FUN_1400a3530(lVar16);
          }
          FUN_1400a3530(plVar4);
        }
      }
      lVar16 = lVar19;
      if (*(longlong **)(param_2 + 0x2480) != (longlong *)0x0) {
        lVar16 = **(longlong **)(param_2 + 0x2480);
      }
      FUN_1400aa930(lVar16);
      lVar16 = lVar19;
      if (*(longlong **)(param_2 + 0x2480) != (longlong *)0x0) {
        lVar16 = **(longlong **)(param_2 + 0x2480);
      }
      FUN_1400a8090(lVar16,0);
      cVar5 = FUN_1401b3e60(param_1,param_2);
      if (cVar5 == '\0') goto LAB_1401b7c4a;
    }
    FUN_1400a8110(local_668);
    lVar16 = lVar19;
    if (*(longlong **)(param_2 + 0x2480) != (longlong *)0x0) {
      lVar16 = **(longlong **)(param_2 + 0x2480);
    }
    FUN_1400a8130(local_668,lVar16);
    lVar16 = lVar19;
    if (*(longlong **)(param_2 + 0x2480) != (longlong *)0x0) {
      lVar16 = **(longlong **)(param_2 + 0x2480);
    }
    FUN_1400a8190(local_668,lVar16);
    FUN_1400a81f0(local_668,0);
    if (*(longlong **)(param_2 + 0x2480) != (longlong *)0x0) {
      lVar19 = **(longlong **)(param_2 + 0x2480);
    }
    cVar5 = FUN_1400a8250(local_668,lVar19,local_9e8);
    if (cVar5 != '\0') {
      if (local_9e8[0] == 0) {
        if (0 < *(int *)(param_2 + 0x2490)) {
          return;
        }
        *(undefined8 *)(param_2 + 0x2490) = 1;
        return;
      }
      cVar5 = FUN_1401b3e60(param_1,param_2);
      if (cVar5 != '\0') goto LAB_1401b7d1c;
      goto LAB_1401b7c4a;
    }
    goto LAB_1401b7d1c;
  }
  if (iVar9 == 1) {
    uVar12 = 0;
    iVar9 = 0;
    if (*(int *)(param_2 + 0x2494) == 0) {
      uVar15 = uVar12;
      if (*(undefined8 **)(param_2 + 0x2480) != (undefined8 *)0x0) {
        uVar15 = **(undefined8 **)(param_2 + 0x2480);
      }
      FUN_1400a8090(uVar15,1);
      local_808 = local_800;
      FUN_1400a1e40(&local_808,param_2 + 0x52,3);
      local_898 = local_890;
      FUN_1400a1e40(&local_898,param_2 + 0x458,3);
      local_a18 = (uint)*(ushort *)(param_2 + 0x245c);
      FUN_1400a50f0(param_2 + 0x2488,
                    "GET %s HTTP/1.1\r\n\r\nHost: %s:%d\r\n\r\nConnection: Keep-Alive\r\n\r\n",
                    local_898,local_808);
      if (local_898 != local_890) {
        free(local_898);
      }
      if (local_808 != local_800) {
        free(local_808);
      }
      cVar5 = FUN_1401b26e0(param_1,param_2);
      if (cVar5 == '\0') goto LAB_1401b7c4a;
    }
    local_988 = Proud::AddrPort::vftable;
    local_978 = 0;
    local_990 = 0;
    local_980 = DAT_1402f83d0;
    local_97c = DAT_1402f83d4;
    if (*(undefined8 **)(param_2 + 0x2480) != (undefined8 *)0x0) {
      uVar12 = **(undefined8 **)(param_2 + 0x2480);
    }
    cVar5 = FUN_1400a87e0(uVar12,0,&local_990);
    if (cVar5 != '\0') {
      *(undefined1 *)(param_2 + 0x24c0) = 0;
      if (local_978 == 0) goto LAB_1401b7c4a;
      *(int *)(param_2 + 0x2504) = *(int *)(param_2 + 0x2504) + local_978;
      puVar22 = *(undefined **)(param_2 + 0x2488);
      if (puVar22 != (undefined *)0x0) {
        if (puVar22 == PTR_DAT_1402f8008) {
          iVar9 = 0;
        }
        else {
          iVar9 = *(int *)(puVar22 + -8);
        }
      }
      if ((iVar9 - *(int *)(param_2 + 0x2504)) + 1 < 1) {
        if (1 < *(int *)(param_2 + 0x2490)) {
          return;
        }
        *(undefined8 *)(param_2 + 0x2490) = 2;
        return;
      }
      FUN_1401b26e0(param_1,param_2);
    }
    goto LAB_1401b7d1c;
  }
  if (iVar9 == 2) {
    uVar12 = 0;
    if (*(int *)(param_2 + 0x2494) == 0) {
      *(undefined1 *)(param_2 + 0x2500) = 1;
      uVar15 = uVar12;
      if (*(undefined8 **)(param_2 + 0x2480) != (undefined8 *)0x0) {
        uVar15 = **(undefined8 **)(param_2 + 0x2480);
      }
      iVar9 = FUN_1400a96e0(uVar15,0x8000);
      if (iVar9 == 0) goto LAB_1401b78b7;
    }
    else {
LAB_1401b78b7:
      local_9a8 = Proud::AddrPort::vftable;
      local_998 = 0;
      local_9b0 = 0;
      local_9a0 = DAT_1402f83d0;
      local_99c = DAT_1402f83d4;
      uVar15 = uVar12;
      if (*(undefined8 **)(param_2 + 0x2480) != (undefined8 *)0x0) {
        uVar15 = **(undefined8 **)(param_2 + 0x2480);
      }
      cVar5 = FUN_1400a8570(uVar15,0,&local_9b0);
      if (cVar5 == '\0') {
LAB_1401b7d1c:
        *(int *)(param_2 + 0x2494) = *(int *)(param_2 + 0x2494) + 1;
        return;
      }
      *(undefined1 *)(param_2 + 0x2500) = 0;
      if (local_998 == 0) {
LAB_1401b7c4a:
        if (2 < *(int *)(param_2 + 0x2490)) {
          return;
        }
        *(undefined8 *)(param_2 + 0x2490) = 3;
        return;
      }
      uVar15 = uVar12;
      if (*(undefined8 **)(param_2 + 0x2480) != (undefined8 *)0x0) {
        uVar15 = **(undefined8 **)(param_2 + 0x2480);
      }
      uVar15 = FUN_1400a8b30(uVar15);
      FUN_1401b2760(param_2 + 0x2510,uVar15,local_998);
      *(int *)(param_2 + 0x2508) = *(int *)(param_2 + 0x2508) + local_998;
      iVar9 = 0x8000 - *(int *)(param_2 + 0x2508);
      if (iVar9 < 1) goto LAB_1401b7c4a;
      *(undefined1 *)(param_2 + 0x2500) = 1;
      if (*(undefined8 **)(param_2 + 0x2480) != (undefined8 *)0x0) {
        uVar12 = **(undefined8 **)(param_2 + 0x2480);
      }
      iVar9 = FUN_1400a96e0(uVar12,iVar9);
      if (iVar9 == 0) goto LAB_1401b7d1c;
    }
    *(undefined1 *)(param_2 + 0x2500) = 0;
    goto LAB_1401b798d;
  }
  if (iVar9 != 3) {
    if (iVar9 == 4) {
      if (((*(int *)(param_2 + 0x2494) == 0) &&
          (*(longlong **)(param_2 + 0x2480) != (longlong *)0x0)) &&
         (**(longlong **)(param_2 + 0x2480) != 0)) {
        FUN_1400a88b0();
      }
      local_968 = Proud::AddrPort::vftable;
      uVar12 = 0;
      local_958 = 0;
      local_970 = 0;
      local_960 = DAT_1402f83d0;
      local_95c = DAT_1402f83d4;
      uVar15 = uVar12;
      if (*(undefined8 **)(param_2 + 0x2480) != (undefined8 *)0x0) {
        uVar15 = **(undefined8 **)(param_2 + 0x2480);
      }
      cVar5 = FUN_1400a8570(uVar15,0,&local_970);
      if (cVar5 != '\0') {
        *(undefined1 *)(param_2 + 0x2500) = 0;
      }
      if (*(undefined8 **)(param_2 + 0x2480) != (undefined8 *)0x0) {
        uVar12 = **(undefined8 **)(param_2 + 0x2480);
      }
      cVar5 = FUN_1400a87e0(uVar12,0,&local_970);
      if (cVar5 != '\0') {
        *(undefined1 *)(param_2 + 0x24c0) = 0;
      }
      if ((*(char *)(param_2 + 0x2500) == '\0') && (*(char *)(param_2 + 0x24c0) == '\0')) {
        if (4 < *(int *)(param_2 + 0x2490)) {
          return;
        }
        *(undefined8 *)(param_2 + 0x2490) = 5;
        return;
      }
    }
    goto LAB_1401b7d1c;
  }
  uVar8 = 0;
  if (*(int *)(param_2 + 0x2528) == 0) goto LAB_1401b798d;
  _Dst = (void *)FUN_14000c420(param_2 + 0x2538);
  memset(_Dst,0,(longlong)(*(int *)(param_2 + 0x2528) + 1));
  _Src = (void *)0x0;
  if (*(int *)(param_2 + 0x2528) != 0) {
    _Src = *(void **)(param_2 + 0x2520);
  }
  memcpy(_Dst,_Src,(longlong)*(int *)(param_2 + 0x2528));
  FUN_14000c510(param_2 + 0x2538);
  FUN_1400a3440();
  puVar22 = PTR_DAT_1402f8008;
  local_9d8 = PTR_DAT_1402f8008;
  FUN_1401b3410(param_2 + 0x2538);
  FUN_1400a3440();
  puVar20 = (uint *)PTR_DAT_1402f8008;
  local_9f0 = (uint *)PTR_DAT_1402f8008;
  uVar6 = FUN_1400a3360("MODELDESCRIPTION");
  iVar9 = 0;
  if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1402f8008)) {
    iVar9 = *(int *)((longlong)puVar20 + -8);
  }
  uVar7 = uVar6;
  if ((int)uVar6 <= iVar9) {
    uVar7 = 0;
    if ((puVar20 != (uint *)0x0) && (uVar7 = 0, puVar20 != (uint *)PTR_DAT_1402f8008)) {
      uVar7 = *(uint *)((longlong)puVar20 + -8);
    }
  }
  uVar21 = 1;
  if (1 < (int)uVar7) {
    uVar21 = uVar7;
  }
  iVar9 = 0;
  if ((puVar20 != (uint *)0x0) && (iVar9 = 0, puVar20 != (uint *)PTR_DAT_1402f8008)) {
    iVar9 = *(int *)((longlong)puVar20 + -8);
  }
  if (iVar9 < (int)uVar21) {
    if (puVar20 == (uint *)0x0) {
      puVar20 = (uint *)PTR_DAT_1402f8008;
    }
    local_9f0 = puVar20;
    if ((int)uVar21 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar21 == 0) {
      FUN_14000c2a0(&local_9f0);
    }
    else {
      uVar7 = 0;
      if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1402f8008)) {
        uVar7 = puVar20[-2];
      }
      if (uVar21 != uVar7) {
        puVar13 = (uint *)FUN_1400a34c0((longlong)(int)uVar21 + 9);
        if (puVar13 != (uint *)0x0) {
          *puVar13 = 0;
          puVar13[1] = 1;
        }
        *puVar13 = uVar21;
        uVar7 = 0;
        if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1402f8008)) {
          uVar7 = puVar20[-2];
        }
        puVar10 = (uint *)PTR_DAT_1402f8008;
        if ((int)uVar21 < (int)uVar7) {
LAB_1401b6dc5:
          if (puVar20 != (uint *)0x0) {
            puVar10 = puVar20;
          }
        }
        else {
          uVar21 = uVar8;
          if (puVar20 != (uint *)0x0) {
            if (puVar20 != (uint *)PTR_DAT_1402f8008) {
              uVar21 = puVar20[-2];
            }
            goto LAB_1401b6dc5;
          }
        }
        FUN_1400a3390(puVar13 + 2,puVar10,uVar21);
        FUN_14000c2a0(&local_9f0);
        local_9f0 = puVar13 + 2;
      }
    }
  }
  FUN_14000c330(&local_9f0);
  puVar20 = local_9f0;
  puVar13 = local_9f0;
  if (local_9f0 == (uint *)0x0) {
    puVar13 = (uint *)PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar13,"MODELDESCRIPTION",uVar6);
  puVar13 = puVar20;
  if (puVar20 == (uint *)0x0) {
    puVar13 = (uint *)PTR_DAT_1402f8008;
  }
  uVar7 = FUN_1400a3360(puVar13);
  uVar6 = 0;
  if (0 < (int)uVar7) {
    uVar6 = uVar7;
  }
  uVar7 = 0;
  if ((puVar20 != (uint *)0x0) && (uVar7 = 0, puVar20 != (uint *)PTR_DAT_1402f8008)) {
    uVar7 = puVar20[-2];
  }
  if (((int)uVar6 < (int)uVar7) || (uVar6 = 0, puVar20 == (uint *)0x0)) {
LAB_1401b6e5d:
    if (((puVar20 != (uint *)PTR_DAT_1402f8008) && (puVar20 != (uint *)0x0)) &&
       (puVar13 = puVar20 + -2, puVar13 != (uint *)0x0)) {
      *puVar13 = uVar6;
      *(undefined1 *)((longlong)(int)uVar6 + 8 + (longlong)puVar13) = 0;
    }
  }
  else if (puVar20 != (uint *)PTR_DAT_1402f8008) {
    uVar6 = puVar20[-2];
    goto LAB_1401b6e5d;
  }
  FUN_1400a3440();
  puVar13 = (uint *)PTR_DAT_1402f8008;
  local_a00 = (uint *)PTR_DAT_1402f8008;
  uVar6 = FUN_1400a3360("FRIENDLYNAME");
  iVar9 = 0;
  if ((puVar13 != (uint *)0x0) && (puVar13 != (uint *)PTR_DAT_1402f8008)) {
    iVar9 = *(int *)((longlong)puVar13 + -8);
  }
  uVar7 = uVar6;
  if ((int)uVar6 <= iVar9) {
    uVar7 = 0;
    if ((puVar13 != (uint *)0x0) && (uVar7 = 0, puVar13 != (uint *)PTR_DAT_1402f8008)) {
      uVar7 = *(uint *)((longlong)puVar13 + -8);
    }
  }
  uVar21 = 1;
  if (1 < (int)uVar7) {
    uVar21 = uVar7;
  }
  iVar9 = 0;
  if ((puVar13 != (uint *)0x0) && (iVar9 = 0, puVar13 != (uint *)PTR_DAT_1402f8008)) {
    iVar9 = *(int *)((longlong)puVar13 + -8);
  }
  if (iVar9 < (int)uVar21) {
    if (puVar13 == (uint *)0x0) {
      puVar13 = (uint *)PTR_DAT_1402f8008;
    }
    local_a00 = puVar13;
    if ((int)uVar21 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar21 == 0) {
      FUN_14000c2a0(&local_a00);
    }
    else {
      uVar7 = 0;
      if ((puVar13 != (uint *)0x0) && (puVar13 != (uint *)PTR_DAT_1402f8008)) {
        uVar7 = puVar13[-2];
      }
      if (uVar21 != uVar7) {
        puVar10 = (uint *)FUN_1400a34c0((longlong)(int)uVar21 + 9);
        if (puVar10 != (uint *)0x0) {
          *puVar10 = 0;
          puVar10[1] = 1;
        }
        *puVar10 = uVar21;
        uVar7 = 0;
        if ((puVar13 != (uint *)0x0) && (puVar13 != (uint *)PTR_DAT_1402f8008)) {
          uVar7 = puVar13[-2];
        }
        puVar11 = (uint *)PTR_DAT_1402f8008;
        if ((int)uVar21 < (int)uVar7) {
LAB_1401b6f6a:
          if (puVar13 != (uint *)0x0) {
            puVar11 = puVar13;
          }
        }
        else {
          uVar21 = uVar8;
          if (puVar13 != (uint *)0x0) {
            if (puVar13 != (uint *)PTR_DAT_1402f8008) {
              uVar21 = puVar13[-2];
            }
            goto LAB_1401b6f6a;
          }
        }
        FUN_1400a3390(puVar10 + 2,puVar11,uVar21);
        FUN_14000c2a0(&local_a00);
        local_a00 = puVar10 + 2;
      }
    }
  }
  FUN_14000c330(&local_a00);
  puVar13 = local_a00;
  puVar10 = local_a00;
  if (local_a00 == (uint *)0x0) {
    puVar10 = (uint *)PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar10,"FRIENDLYNAME",uVar6);
  puVar10 = puVar13;
  if (puVar13 == (uint *)0x0) {
    puVar10 = (uint *)PTR_DAT_1402f8008;
  }
  uVar7 = FUN_1400a3360(puVar10);
  uVar6 = 0;
  if (0 < (int)uVar7) {
    uVar6 = uVar7;
  }
  uVar7 = 0;
  if ((puVar13 != (uint *)0x0) && (uVar7 = 0, puVar13 != (uint *)PTR_DAT_1402f8008)) {
    uVar7 = puVar13[-2];
  }
  if (((int)uVar6 < (int)uVar7) || (uVar6 = 0, puVar13 == (uint *)0x0)) {
LAB_1401b7002:
    if (((puVar13 != (uint *)PTR_DAT_1402f8008) && (puVar13 != (uint *)0x0)) &&
       (puVar10 = puVar13 + -2, puVar10 != (uint *)0x0)) {
      *puVar10 = uVar6;
      *(undefined1 *)((longlong)(int)uVar6 + 8 + (longlong)puVar10) = 0;
    }
  }
  else if (puVar13 != (uint *)PTR_DAT_1402f8008) {
    uVar6 = puVar13[-2];
    goto LAB_1401b7002;
  }
  local_a08 = (uint *)FUN_1401b4160(local_9e0,&local_9d0,param_2 + 0x2538,&local_9f0);
  FUN_1400a3440();
  puVar10 = (uint *)PTR_DAT_1402f8008;
  local_9f8 = (uint *)PTR_DAT_1402f8008;
  local_9e8[0] = FUN_1400a3360(&DAT_1402636e0);
  iVar9 = 0;
  if ((puVar10 != (uint *)0x0) && (puVar10 != (uint *)PTR_DAT_1402f8008)) {
    iVar9 = *(int *)((longlong)puVar10 + -8);
  }
  uVar6 = local_9e8[0];
  if ((int)local_9e8[0] <= iVar9) {
    uVar6 = 0;
    if ((puVar10 != (uint *)0x0) && (uVar6 = 0, puVar10 != (uint *)PTR_DAT_1402f8008)) {
      uVar6 = *(uint *)((longlong)puVar10 + -8);
    }
  }
  uVar7 = 1;
  if (1 < (int)uVar6) {
    uVar7 = uVar6;
  }
  iVar9 = 0;
  if ((puVar10 != (uint *)0x0) && (iVar9 = 0, puVar10 != (uint *)PTR_DAT_1402f8008)) {
    iVar9 = *(int *)((longlong)puVar10 + -8);
  }
  if (iVar9 < (int)uVar7) {
    if (puVar10 == (uint *)0x0) {
      puVar10 = (uint *)PTR_DAT_1402f8008;
    }
    local_9f8 = puVar10;
    if ((int)uVar7 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    if (uVar7 == 0) {
      FUN_14000c2a0(&local_9f8);
    }
    else {
      uVar6 = 0;
      if ((puVar10 != (uint *)0x0) && (puVar10 != (uint *)PTR_DAT_1402f8008)) {
        uVar6 = puVar10[-2];
      }
      if (uVar7 != uVar6) {
        puVar11 = (uint *)FUN_1400a34c0((longlong)(int)uVar7 + 9);
        if (puVar11 != (uint *)0x0) {
          *puVar11 = 0;
          puVar11[1] = 1;
        }
        *puVar11 = uVar7;
        uVar6 = 0;
        if ((puVar10 != (uint *)0x0) && (puVar10 != (uint *)PTR_DAT_1402f8008)) {
          uVar6 = puVar10[-2];
        }
        puVar18 = (uint *)PTR_DAT_1402f8008;
        if ((int)uVar7 < (int)uVar6) {
LAB_1401b7139:
          if (puVar10 != (uint *)0x0) {
            puVar18 = puVar10;
          }
        }
        else {
          uVar7 = uVar8;
          if (puVar10 != (uint *)0x0) {
            if (puVar10 != (uint *)PTR_DAT_1402f8008) {
              uVar7 = puVar10[-2];
            }
            goto LAB_1401b7139;
          }
        }
        FUN_1400a3390(puVar11 + 2,puVar18,uVar7);
        FUN_14000c2a0(&local_9f8);
        local_9f8 = puVar11 + 2;
      }
    }
  }
  FUN_14000c330(&local_9f8);
  puVar10 = local_9f8;
  puVar11 = local_9f8;
  if (local_9f8 == (uint *)0x0) {
    puVar11 = (uint *)PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar11,&DAT_1402636e0,local_9e8[0]);
  puVar11 = puVar10;
  if (puVar10 == (uint *)0x0) {
    puVar11 = (uint *)PTR_DAT_1402f8008;
  }
  uVar7 = FUN_1400a3360(puVar11);
  uVar6 = 0;
  if (0 < (int)uVar7) {
    uVar6 = uVar7;
  }
  uVar7 = 0;
  if ((puVar10 != (uint *)0x0) && (uVar7 = 0, puVar10 != (uint *)PTR_DAT_1402f8008)) {
    uVar7 = puVar10[-2];
  }
  if (((int)uVar6 < (int)uVar7) || (uVar6 = 0, puVar10 == (uint *)0x0)) {
LAB_1401b71d3:
    if (((puVar10 != (uint *)PTR_DAT_1402f8008) && (puVar10 != (uint *)0x0)) &&
       (puVar11 = puVar10 + -2, puVar11 != (uint *)0x0)) {
      *puVar11 = uVar6;
      *(undefined1 *)((longlong)(int)uVar6 + 8 + (longlong)puVar11) = 0;
    }
  }
  else if (puVar10 != (uint *)PTR_DAT_1402f8008) {
    uVar6 = puVar10[-2];
    goto LAB_1401b71d3;
  }
  uVar12 = FUN_1401b4160(local_9e0,&local_9b8,param_2 + 0x2538,&local_a00);
  uVar12 = FUN_1400a5680(&local_9c0,uVar12,&local_9f8);
  local_a08 = (uint *)FUN_1400a5680(&local_9c8,uVar12,local_a08);
  if (puVar22 == (undefined *)0x0) {
    puVar22 = PTR_DAT_1402f8008;
  }
  local_9d8 = puVar22;
  if (*(undefined **)local_a08 != puVar22) {
    uVar12 = FUN_1400a3440();
    local_920 = uVar12;
    FUN_1400a1c30(uVar12);
    local_918 = 1;
    if (((puVar22 != (undefined *)0x0) && (puVar22 != PTR_DAT_1402f8008)) &&
       (puVar22 + -8 != (undefined *)0x0)) {
      uVar12 = FUN_1400a3440();
      local_8a8 = uVar12;
      FUN_1400a1c30(uVar12);
      local_8a0 = 1;
      piVar2 = (int *)(puVar22 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_1400a3530(puVar22 + -8);
      }
      FUN_1400d1290(uVar12);
      uVar12 = local_920;
    }
    puVar22 = *(undefined **)local_a08;
    if (((puVar22 != PTR_DAT_1402f8008) && (puVar22 != (undefined *)0x0)) &&
       (puVar22 != (undefined *)0x8)) {
      *(int *)(puVar22 + -4) = *(int *)(puVar22 + -4) + 1;
    }
    local_9d8 = puVar22;
    FUN_1400d1290(uVar12);
  }
  if (((local_9c8 != (undefined *)0x0) && (local_9c8 != PTR_DAT_1402f8008)) &&
     (local_9c8 + -8 != (undefined *)0x0)) {
    local_930 = FUN_1400a3440();
    FUN_1400a1c30(local_930);
    local_928 = 1;
    piVar2 = (int *)(local_9c8 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(local_9c8 + -8);
    }
    FUN_1400d1290(local_930);
  }
  local_9c8 = PTR_DAT_1402f8008;
  if (((local_9c0 != (undefined *)0x0) && (local_9c0 != PTR_DAT_1402f8008)) &&
     (local_9c0 + -8 != (undefined *)0x0)) {
    local_950 = FUN_1400a3440();
    FUN_1400a1c30(local_950);
    local_948 = 1;
    piVar2 = (int *)(local_9c0 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(local_9c0 + -8);
    }
    FUN_1400d1290(local_950);
  }
  local_9c0 = PTR_DAT_1402f8008;
  if (((local_9b8 != (undefined *)0x0) && (local_9b8 != PTR_DAT_1402f8008)) &&
     (local_9b8 + -8 != (undefined *)0x0)) {
    local_940 = FUN_1400a3440();
    FUN_1400a1c30(local_940);
    local_938 = 1;
    piVar2 = (int *)(local_9b8 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(local_9b8 + -8);
    }
    FUN_1400d1290(local_940);
  }
  local_9b8 = PTR_DAT_1402f8008;
  if (((puVar10 != (uint *)0x0) && (puVar10 != (uint *)PTR_DAT_1402f8008)) &&
     (puVar10 + -2 != (uint *)0x0)) {
    uVar12 = FUN_1400a3440();
    local_8b8 = uVar12;
    FUN_1400a1c30(uVar12);
    local_8b0 = 1;
    puVar11 = puVar10 + -1;
    *puVar11 = *puVar11 - 1;
    if (*puVar11 == 0) {
      FUN_1400a3530(puVar10 + -2);
    }
    FUN_1400d1290(uVar12);
  }
  if (((local_9d0 != (undefined *)0x0) && (local_9d0 != PTR_DAT_1402f8008)) &&
     (local_9d0 + -8 != (undefined *)0x0)) {
    uVar12 = FUN_1400a3440();
    local_900 = uVar12;
    FUN_1400a1c30(uVar12);
    local_8f8 = 1;
    piVar2 = (int *)(local_9d0 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(local_9d0 + -8);
    }
    FUN_1400d1290(uVar12);
  }
  local_9d0 = PTR_DAT_1402f8008;
  if (((puVar13 != (uint *)0x0) && (puVar13 != (uint *)PTR_DAT_1402f8008)) &&
     (puVar13 + -2 != (uint *)0x0)) {
    uVar12 = FUN_1400a3440();
    local_8f0 = uVar12;
    FUN_1400a1c30(uVar12);
    local_8e8 = 1;
    puVar10 = puVar13 + -1;
    *puVar10 = *puVar10 - 1;
    if (*puVar10 == 0) {
      FUN_1400a3530(puVar13 + -2);
    }
    FUN_1400d1290(uVar12);
  }
  if (((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1402f8008)) &&
     (puVar20 + -2 != (uint *)0x0)) {
    uVar12 = FUN_1400a3440();
    local_8c8 = uVar12;
    FUN_1400a1c30(uVar12);
    local_8c0 = 1;
    puVar13 = puVar20 + -1;
    *puVar13 = *puVar13 - 1;
    if (*puVar13 == 0) {
      FUN_1400a3530(puVar20 + -2);
    }
    FUN_1400d1290(uVar12);
  }
  if (((puVar22 != (undefined *)0x0) && (puVar22 != PTR_DAT_1402f8008)) &&
     (2 < *(int *)(puVar22 + -8))) {
    local_778 = local_770;
    FUN_14008a6c0(&local_778,puVar22,3);
    puVar14 = local_778;
    FUN_1400a3440();
    puVar20 = (uint *)PTR_DAT_1402f8010;
    local_a08 = (uint *)PTR_DAT_1402f8010;
    uVar6 = FUN_1400a32c0(puVar14);
    iVar9 = 0;
    if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1402f8010)) {
      iVar9 = *(int *)((longlong)puVar20 + -8);
    }
    uVar7 = uVar6;
    if ((int)uVar6 <= iVar9) {
      uVar7 = 0;
      if ((puVar20 != (uint *)0x0) && (uVar7 = 0, puVar20 != (uint *)PTR_DAT_1402f8010)) {
        uVar7 = *(uint *)((longlong)puVar20 + -8);
      }
    }
    uVar21 = 1;
    if (1 < (int)uVar7) {
      uVar21 = uVar7;
    }
    iVar9 = 0;
    if ((puVar20 != (uint *)0x0) && (iVar9 = 0, puVar20 != (uint *)PTR_DAT_1402f8010)) {
      iVar9 = *(int *)((longlong)puVar20 + -8);
    }
    if (iVar9 < (int)uVar21) {
      if (puVar20 == (uint *)0x0) {
        puVar20 = (uint *)PTR_DAT_1402f8010;
      }
      local_a08 = puVar20;
      if ((int)uVar21 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if (uVar21 == 0) {
        FUN_1400031d0(&local_a08);
      }
      else {
        uVar7 = 0;
        if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1402f8010)) {
          uVar7 = puVar20[-2];
        }
        if (uVar21 != uVar7) {
          puVar13 = (uint *)FUN_1400a34c0((longlong)(int)uVar21 * 2 + 10);
          if (puVar13 != (uint *)0x0) {
            *puVar13 = 0;
            puVar13[1] = 1;
          }
          *puVar13 = uVar21;
          uVar7 = 0;
          if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1402f8010)) {
            uVar7 = puVar20[-2];
          }
          puVar10 = (uint *)PTR_DAT_1402f8010;
          if ((int)uVar21 < (int)uVar7) {
LAB_1401b763c:
            if (puVar20 != (uint *)0x0) {
              puVar10 = puVar20;
            }
          }
          else {
            uVar21 = uVar8;
            if (puVar20 != (uint *)0x0) {
              if (puVar20 != (uint *)PTR_DAT_1402f8010) {
                uVar21 = puVar20[-2];
              }
              goto LAB_1401b763c;
            }
          }
          FUN_1400a32f0(puVar13 + 2,puVar10,uVar21);
          FUN_1400031d0(&local_a08);
          local_a08 = puVar13 + 2;
        }
      }
    }
    FUN_140002e30(&local_a08);
    puVar20 = local_a08;
    puVar13 = local_a08;
    if (local_a08 == (uint *)0x0) {
      puVar13 = (uint *)PTR_DAT_1402f8010;
    }
    FUN_1400a32f0(puVar13,puVar14,uVar6);
    puVar13 = puVar20;
    if (puVar20 == (uint *)0x0) {
      puVar13 = (uint *)PTR_DAT_1402f8010;
    }
    uVar6 = FUN_1400a32c0(puVar13);
    plVar1 = local_9e0;
    uVar8 = 0;
    if (0 < (int)uVar6) {
      uVar8 = uVar6;
    }
    uVar6 = 0;
    if ((puVar20 != (uint *)0x0) && (uVar6 = 0, puVar20 != (uint *)PTR_DAT_1402f8010)) {
      uVar6 = puVar20[-2];
    }
    if (((int)uVar8 < (int)uVar6) || (uVar8 = 0, puVar20 == (uint *)0x0)) {
LAB_1401b76d0:
      if (((puVar20 != (uint *)PTR_DAT_1402f8010) && (puVar20 != (uint *)0x0)) &&
         (puVar20 + -2 != (uint *)0x0)) {
        puVar20[-2] = uVar8;
        *(ushort *)((longlong)puVar20 + (longlong)(int)uVar8 * 2) = 0;
      }
    }
    else if (puVar20 != (uint *)PTR_DAT_1402f8010) {
      uVar8 = puVar20[-2];
      goto LAB_1401b76d0;
    }
    puVar13 = puVar20;
    if (puVar20 == (uint *)0x0) {
      puVar13 = (uint *)PTR_DAT_1402f8010;
    }
    if (puVar13 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    uVar8 = 0;
    puVar13 = puVar20;
    if (puVar20 == (uint *)0x0) {
      puVar13 = (uint *)PTR_DAT_1402f8010;
    }
    uVar3 = (ushort)*puVar13;
    while (uVar3 != 0) {
      uVar8 = uVar8 * 0x21 + (uint)uVar3;
      puVar13 = (uint *)((longlong)puVar13 + 2);
      uVar3 = *(ushort *)puVar13;
    }
    uVar6 = *(uint *)(local_9e0 + 0x1a);
    if (local_9e0[0x16] != 0) {
      plVar4 = *(longlong **)(local_9e0[0x16] + ((ulonglong)uVar8 % (ulonglong)uVar6) * 8);
      while( true ) {
        if ((plVar4 == (longlong *)0x0) ||
           ((uint)((ulonglong)uVar8 % (ulonglong)uVar6) !=
            *(uint *)(plVar4 + 4) % *(uint *)(plVar1 + 0x1a))) goto LAB_1401b77b4;
        puVar17 = (undefined *)*plVar4;
        if ((undefined *)*plVar4 == (undefined *)0x0) {
          puVar17 = PTR_DAT_1402f8010;
        }
        iVar9 = FUN_1400a3300(puVar17);
        if (iVar9 == 0) break;
        plVar4 = (longlong *)plVar4[2];
      }
      if (plVar4 != (longlong *)0x0) goto LAB_1401b77c8;
    }
LAB_1401b77b4:
    puVar14 = (undefined1 *)FUN_1401b5bf0(plVar1 + 0x15,&local_a08);
    *puVar14 = 0;
LAB_1401b77c8:
    if (((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1402f8010)) &&
       (puVar20 + -2 != (uint *)0x0)) {
      uVar12 = FUN_1400a3440();
      local_8d8 = uVar12;
      FUN_1400a1c30(uVar12);
      local_8d0 = 1;
      puVar13 = puVar20 + -1;
      *puVar13 = *puVar13 - 1;
      if (*puVar13 == 0) {
        FUN_1400a3530(puVar20 + -2);
      }
      FUN_1400d1290(uVar12);
    }
    if (local_778 != local_770) {
      free(local_778);
    }
  }
  if (((puVar22 != (undefined *)0x0) && (puVar22 != PTR_DAT_1402f8008)) &&
     (puVar22 + -8 != (undefined *)0x0)) {
    uVar12 = FUN_1400a3440();
    local_910 = uVar12;
    FUN_1400a1c30(uVar12);
    local_908 = 1;
    piVar2 = (int *)(puVar22 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar22 + -8);
    }
    FUN_1400d1290(uVar12);
  }
LAB_1401b798d:
  if (3 < *(int *)(param_2 + 0x2490)) {
    return;
  }
  *(undefined8 *)(param_2 + 0x2490) = 4;
  return;
}



// WARNING: Removing unreachable block (ram,0x0001401b7e19)
// WARNING: Removing unreachable block (ram,0x0001401b7e24)

void FUN_1401b7d50(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  FUN_1400a1c30(param_1 + 0x10);
  if (*(longlong *)(param_1 + 0x70) == 0) {
    lVar1 = 0;
  }
  else {
    lVar1 = *(longlong *)(param_1 + 0x60);
  }
  while (lVar1 != 0) {
    lVar2 = 0;
    if (*(longlong **)(lVar1 + 8) != (longlong *)0x0) {
      lVar2 = **(longlong **)(lVar1 + 8);
    }
    FUN_1401b6b00(param_1,lVar2);
    if (*(int *)(lVar2 + 0x2490) == 5) {
      lVar2 = *(longlong *)(lVar1 + 0x10);
      FUN_1401b4cb0(param_1 + 0x50,lVar1,0,param_4,uVar3);
      lVar1 = lVar2;
    }
    else {
      lVar1 = *(longlong *)(lVar1 + 0x10);
    }
  }
  FUN_1400d1290(param_1 + 0x10);
  return;
}



void FUN_1401b7e50(longlong param_1)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  int iVar4;
  
  FUN_1400a1c30(param_1 + 0x10);
  if (*(int *)(param_1 + 0x48) == 0) {
    FUN_1401b5630(param_1);
  }
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
  iVar4 = 0;
  while( true ) {
    if (iVar4 == *(int *)(param_1 + 0x118)) {
      FUN_1401b7d50(param_1);
      FUN_1401b4440(param_1);
      FUN_1400d1290(param_1 + 0x10);
      return;
    }
    if ((iVar4 < 0) || (*(int *)(param_1 + 0x118) <= iVar4)) break;
    plVar2 = *(longlong **)(*(longlong *)(param_1 + 0x110) + (longlong)iVar4 * 8);
    lVar3 = 0;
    if (plVar2 != (longlong *)0x0) {
      lVar3 = *plVar2;
    }
    iVar1 = *(int *)(lVar3 + 0x18);
    if (iVar1 == 0) {
      FUN_1401b5080(param_1);
    }
    else if (iVar1 == 1) {
      FUN_1401b5250(param_1);
    }
    else if (iVar1 == 2) {
      FUN_1401b5f50(param_1);
    }
    if (*(int *)(param_1 + 0x118) <= iVar4) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    iVar4 = iVar4 + 1;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a2700();
}



ulonglong FUN_1401b7f30(longlong param_1,undefined8 param_2)

{
  uint uVar1;
  int iVar2;
  ulonglong uVar3;
  
  uVar1 = *(uint *)(param_1 + 0x1a4);
  iVar2 = FUN_1401c1fa0(param_1 + 0x1b8,param_2,*(undefined8 *)(param_1 + 0x1c8));
  if (iVar2 < (int)uVar1) {
    uVar3 = FUN_1401c1fa0(param_1 + 0x1b8,param_2,*(undefined8 *)(param_1 + 0x1c8));
  }
  else {
    uVar3 = (ulonglong)uVar1;
  }
  return uVar3;
}



void FUN_1401b7fa0(longlong param_1)

{
  FUN_1401a3a20(param_1 + 0x170);
  return;
}



int FUN_1401b7fb0(longlong param_1)

{
  char cVar1;
  int iVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  if (*(char *)(param_1 + 0xc0) == '\0') {
    uVar4 = 0;
    uVar3 = uVar4;
    if (*(undefined8 **)(param_1 + 0x128) != (undefined8 *)0x0) {
      uVar3 = **(undefined8 **)(param_1 + 0x128);
    }
    cVar1 = FUN_1400a8b50(uVar3);
    if (cVar1 == '\0') {
      *(undefined1 *)(param_1 + 0xc0) = 1;
      uVar3 = uVar4;
      if (*(undefined8 **)(param_1 + 0x128) != (undefined8 *)0x0) {
        uVar3 = **(undefined8 **)(param_1 + 0x128);
      }
      iVar2 = FUN_1400a96e0(uVar3,DAT_1402f8048);
      if (iVar2 != 0) {
        *(undefined1 *)(param_1 + 0xc0) = 0;
        if (*(undefined8 **)(param_1 + 0x128) != (undefined8 *)0x0) {
          uVar4 = **(undefined8 **)(param_1 + 0x128);
        }
        FUN_1400a88b0(uVar4);
        return iVar2;
      }
      *(undefined8 *)(param_1 + 0x1f0) = 0;
    }
  }
  return 0;
}



void FUN_1401b8070(longlong param_1)

{
  if (*(undefined8 **)(param_1 + 0xe8) != (undefined8 *)0x0) {
    FUN_1400a88b0(**(undefined8 **)(param_1 + 0xe8));
    return;
  }
  FUN_1400a88b0();
  return;
}



void FUN_1401b8090(longlong param_1)

{
  if (*(undefined8 **)(param_1 + 0x128) != (undefined8 *)0x0) {
    FUN_1400a80c0(**(undefined8 **)(param_1 + 0x128));
    return;
  }
  FUN_1400a80c0();
  return;
}



void FUN_1401b80b0(longlong param_1)

{
  undefined8 uVar1;
  undefined1 local_28 [8];
  int local_20;
  undefined2 local_1c;
  undefined1 local_18 [8];
  int local_10;
  
  if (*(undefined8 **)(param_1 + 0x128) == (undefined8 *)0x0) {
    uVar1 = 0;
  }
  else {
    uVar1 = **(undefined8 **)(param_1 + 0x128);
  }
  FUN_1400a7e50(uVar1,local_28);
  FUN_1400a7ad0(local_18);
  if ((local_20 == 0) && (local_10 != 0)) {
    local_20 = local_10;
  }
  *(int *)(param_1 + 0x118) = local_20;
  *(undefined2 *)(param_1 + 0x11c) = local_1c;
  return;
}



undefined8 FUN_1401b8110(longlong param_1)

{
  longlong lVar1;
  
  if ((*(longlong **)(param_1 + 0xe8) != (longlong *)0x0) &&
     (lVar1 = **(longlong **)(param_1 + 0xe8), lVar1 != 0)) {
    if (*(char *)(lVar1 + 0x80) == '\0') {
      return 0;
    }
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401b8140(longlong param_1)

{
  char cVar1;
  int iVar2;
  int iVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  undefined1 auStack_6a8 [32];
  undefined8 local_688;
  void *local_678;
  undefined8 local_670;
  ulonglong local_668;
  undefined8 local_660;
  ulonglong local_18;
  
  local_688 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_6a8;
  uVar4 = 0;
  uVar5 = uVar4;
  if (*(undefined8 **)(param_1 + 0x128) != (undefined8 *)0x0) {
    uVar5 = **(undefined8 **)(param_1 + 0x128);
  }
  cVar1 = FUN_1400a8b50(uVar5);
  if ((cVar1 == '\0') && (*(char *)(param_1 + 0x80) == '\0')) {
    uVar5 = (**(code **)(**(longlong **)(param_1 + 0x120) + 0x30))();
    iVar2 = FUN_1401b7f30(param_1,uVar5);
    if (0 < iVar2) {
      *(undefined1 *)(param_1 + 0x80) = 1;
      local_678 = (void *)0x0;
      local_660 = 0;
      local_670 = 0;
      local_668 = 100;
      FUN_1401a3d10(param_1 + 0x170,&local_678,iVar2);
      uVar5 = uVar4;
      if (*(undefined8 **)(param_1 + 0x128) != (undefined8 *)0x0) {
        uVar5 = **(undefined8 **)(param_1 + 0x128);
      }
      iVar3 = FUN_1400a9bf0(uVar5,&local_678);
      FUN_1401c1f60(param_1 + 0x1b8,iVar2);
      uVar5 = (**(code **)(**(longlong **)(param_1 + 0x120) + 0x30))();
      *(double *)(param_1 + 0x1d8) = (double)iVar2 + *(double *)(param_1 + 0x1d8);
      *(undefined8 *)(param_1 + 0x1e8) = uVar5;
      if (iVar3 == 0) {
        *(undefined8 *)(param_1 + 0x1f8) = 0;
      }
      else {
        *(undefined1 *)(param_1 + 0x80) = 0;
        if (*(undefined8 **)(param_1 + 0x128) != (undefined8 *)0x0) {
          uVar4 = **(undefined8 **)(param_1 + 0x128);
        }
        FUN_1400a88b0(uVar4);
      }
      if (100 < local_668) {
        operator_delete__(local_678);
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401b82c0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  undefined1 auStack_de8 [32];
  undefined8 local_dc8;
  undefined1 *local_dc0;
  undefined1 local_db8 [80];
  undefined1 local_d68 [8];
  undefined1 local_d60 [8];
  longlong local_d58;
  undefined4 local_d50;
  int local_d4c;
  undefined1 local_d40 [136];
  undefined1 local_cb8 [3200];
  undefined1 *local_38;
  undefined4 local_30;
  int local_2c;
  ulonglong local_28;
  
  local_dc8 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_de8;
  (**(code **)(**(longlong **)(param_1 + 0x120) + 0x20))();
  local_2c = 200;
  local_30 = 0;
  local_38 = local_cb8;
  FUN_140185560(local_d68);
  FUN_1401851e0(local_d68,local_d40,0x80);
  FUN_1401a3f60(param_2,local_cb8,local_d68);
  FUN_1401a3c60(param_1 + 0x170,local_cb8,param_3);
  local_dc0 = local_d60;
  FUN_14019a730(local_d60);
  if (local_d58 != 0) {
    if (local_d4c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_d50 = 0;
  }
  if (local_38 == (undefined1 *)0x0) {
    FUN_1400a2320(local_db8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_db8,(ThrowInfo *)&DAT_1402f4860);
  }
  if (local_2c < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



void FUN_1401b8420(undefined8 *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  
  *param_1 = Proud::CTcpLayer_C::vftable;
  param_1[8] = Proud::CTcpLayer_C::vftable;
  (**(code **)(*(longlong *)param_1[0x24] + 0x10))();
  FUN_1401a4110(param_1 + 0x2e);
  FUN_1401c1130(param_1 + 0x26);
  if ((param_1[0x25] != 0) &&
     (*(longlong *)(param_1[0x25] + 8) = *(longlong *)(param_1[0x25] + 8) + -1,
     *(longlong *)(param_1[0x25] + 8) == 0)) {
    plVar1 = (longlong *)param_1[0x25];
    lVar2 = *plVar1;
    if (lVar2 != 0) {
      FUN_1400a8cc0(lVar2);
      FUN_1400a3530(lVar2);
    }
    FUN_1400a3530(plVar1);
  }
  param_1[8] = Proud::IHasOverlappedIo::vftable;
  *param_1 = Proud::ICompletionContext::vftable;
  return;
}



undefined8 FUN_1401b8500(void)

{
  return 3;
}



void FUN_1401b8510(longlong param_1)

{
  FUN_1401b8700(param_1 + -0x40);
  return;
}



undefined8 *
FUN_1401b8520(undefined8 *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong lVar4;
  longlong *local_res10;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  *param_1 = Proud::ICompletionContext::vftable;
  FUN_1400a8350(param_1 + 8);
  *param_1 = Proud::CTcpLayer_C::vftable;
  param_1[8] = Proud::CTcpLayer_C::vftable;
  param_1[0x20] = Proud::AddrPort::vftable;
  lVar4 = 0;
  *(undefined4 *)(param_1 + 0x21) = 0;
  *(undefined2 *)((longlong)param_1 + 0x10c) = 0;
  param_1[0x22] = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 0x23) = 0;
  *(undefined2 *)((longlong)param_1 + 0x11c) = 0;
  param_1[0x25] = 0;
  FUN_1401c10f0(param_1 + 0x26,(longlong)DAT_1402f80ec);
  FUN_1401a4080(param_1 + 0x2e);
  *(undefined1 *)(param_1 + 0x10) = 0;
  *(undefined1 *)(param_1 + 0x18) = 0;
  param_1[0x24] = param_2;
  local_res10 = (longlong *)FUN_1400a34c0(0x400);
  lVar3 = lVar4;
  if (local_res10 != (longlong *)0x0) {
    lVar3 = FUN_1400a8db0(local_res10,0,param_2,param_4,uVar5);
  }
  if (lVar3 == 0) {
    local_res10 = (longlong *)0x0;
  }
  else {
    local_res10 = (longlong *)FUN_1400a34c0(0x10);
    local_res10[1] = 1;
    *local_res10 = lVar3;
  }
  plVar1 = local_res10;
  FUN_1400a5190(param_1 + 0x25,&local_res10);
  plVar2 = local_res10;
  if (plVar1 != (longlong *)0x0) {
    plVar1 = plVar1 + 1;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      lVar3 = *local_res10;
      if (lVar3 != 0) {
        FUN_1400a8cc0(lVar3);
        FUN_1400a3530(lVar3);
      }
      FUN_1400a3530(plVar2);
    }
  }
  lVar3 = lVar4;
  if ((longlong *)param_1[0x25] != (longlong *)0x0) {
    lVar3 = *(longlong *)param_1[0x25];
  }
  FUN_1400a7fb0(lVar3,param_1);
  (**(code **)(*param_2 + 0x10))(param_2);
  lVar3 = lVar4;
  if ((longlong *)param_1[0x25] != (longlong *)0x0) {
    lVar3 = *(longlong *)param_1[0x25];
  }
  (**(code **)(*param_2 + 0x40))(param_2,lVar3);
  if ((longlong *)param_1[0x25] != (longlong *)0x0) {
    lVar4 = *(longlong *)param_1[0x25];
  }
  FUN_1401a3a90(lVar4);
  param_1[0x3e] = 0;
  param_1[0x3f] = 0;
  return param_1;
}



void * FUN_1401b8700(void *param_1,uint param_2)

{
  FUN_1401b8420();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1401b8730(undefined8 *param_1)

{
  *param_1 = Proud::IReliableUdpHostDelegate::vftable;
  return;
}



undefined8 * FUN_1401b8740(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::IReliableUdpHostDelegate::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_1401b8770(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x148);
}



undefined4 FUN_1401b8780(longlong param_1)

{
  return *(undefined4 *)(*(longlong *)(param_1 + 0x660) + 0x6b4);
}



void FUN_1401b8790(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001401b879f. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x660) + 0x70) + 0x1c0))
            (*(longlong *)(param_1 + 0x660) + 0x70);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1401b87b0(undefined8 *param_1)

{
  undefined4 *puVar1;
  undefined1 auStack_58 [32];
  undefined8 *local_38;
  undefined8 local_30;
  undefined1 local_28 [16];
  ulonglong local_18;
  
  local_30 = 0xfffffffffffffffe;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_58;
  *param_1 = Proud::CP2PConnectionTrialContext::ServerHolepunchState::vftable;
  *(undefined4 *)((longlong)param_1 + 0x1c) = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  *(undefined4 *)((longlong)param_1 + 0x24) = 0;
  *(undefined4 *)(param_1 + 5) = 0;
  *(undefined4 *)(param_1 + 1) = 0;
  *(undefined4 *)(param_1 + 3) = 0;
  param_1[2] = 0;
  local_38 = param_1;
  puVar1 = (undefined4 *)FUN_1400aabf0(local_28);
  *(undefined4 *)((longlong)param_1 + 0x1c) = *puVar1;
  *(undefined4 *)(param_1 + 4) = puVar1[1];
  *(undefined4 *)((longlong)param_1 + 0x24) = puVar1[2];
  *(undefined4 *)(param_1 + 5) = puVar1[3];
  return param_1;
}



undefined8 * FUN_1401b8850(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::CP2PConnectionTrialContext::StateBase::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1401b8880(longlong *param_1,undefined8 *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  
  plVar1 = *(longlong **)(*(longlong *)(*param_1 + 0x670) + 0x1570);
  if ((plVar1 != (longlong *)0x0) && (*plVar1 != 0)) {
    if (plVar1 == (longlong *)0x0) {
      lVar2 = 0;
    }
    else {
      lVar2 = *plVar1;
    }
    *param_2 = Proud::AddrPort::vftable;
    *(undefined4 *)(param_2 + 1) = *(undefined4 *)(lVar2 + 0xd0);
    *(undefined2 *)((longlong)param_2 + 0xc) = *(undefined2 *)(lVar2 + 0xd4);
    return param_2;
  }
  *param_2 = Proud::AddrPort::vftable;
  *(undefined4 *)(param_2 + 1) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1402f83d4;
  return param_2;
}



void FUN_1401b88f0(longlong param_1,char param_2)

{
  undefined8 uVar1;
  
  if (param_2 == '\0') {
    *(undefined1 *)(param_1 + 0x608) = 0;
    uVar1 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x670) + 0x70) + 0x1c0))
                      (*(longlong *)(param_1 + 0x670) + 0x70);
    *(undefined8 *)(param_1 + 0x610) = uVar1;
    uVar1 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x670) + 0x70) + 0x1c0))();
    *(undefined8 *)(param_1 + 0xc0) = uVar1;
    *(undefined4 *)(param_1 + 0x100) = 0;
    *(undefined8 *)(param_1 + 0x140) = 0xbff0000000000000;
  }
  else {
    if (*(char *)(param_1 + 0x608) == '\0') {
      *(undefined1 *)(param_1 + 0x618) = 1;
    }
    *(undefined1 *)(param_1 + 0x608) = 1;
  }
  if (*(longlong *)(param_1 + 0x640) != 0) {
    *(undefined8 *)(*(longlong *)(param_1 + 0x640) + 0xd8) = 0;
  }
  return;
}



double FUN_1401b8990(longlong param_1)

{
  longlong *plVar1;
  undefined8 uVar2;
  double dVar3;
  double dVar4;
  
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x670) + 0x58))();
  FUN_1400a1c30(uVar2);
  plVar1 = (longlong *)(*(longlong *)(param_1 + 0x670) + 0x70);
  dVar3 = (double)FUN_1400ad590(*(longlong *)(param_1 + 0x670) + 0xb08);
  dVar4 = (double)(**(code **)(*plVar1 + 0x1c0))(plVar1);
  FUN_1400d1290(uVar2);
  return dVar3 * 2.0 + dVar4 + 1.0;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401b8a30(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) &&
     (lVar1 = **(longlong **)(param_1 + 0x18), lVar1 != 0)) {
    lVar2 = 0;
    if (*(char *)(lVar1 + 0x40) == '\0') {
      if (*(longlong **)(param_1 + 0x18) != (longlong *)0x0) {
        lVar2 = **(longlong **)(param_1 + 0x18);
      }
      if (*(char *)(lVar2 + 0x80) == '\0') {
        return;
      }
    }
    _DAT_00000000 = 1;
  }
  return;
}



longlong FUN_1401b8a70(longlong param_1)

{
  longlong lVar1;
  
  if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) &&
     (lVar1 = **(longlong **)(param_1 + 0x18), lVar1 != 0)) {
    return lVar1 + -0x40;
  }
  return 0;
}



void FUN_1401b8a90(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  longlong lVar1;
  longlong *plVar2;
  undefined2 uVar3;
  undefined4 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined **local_38;
  undefined4 local_30;
  undefined2 local_2c;
  
  lVar1 = *param_1;
  if ((*(longlong **)(lVar1 + 0x18) != (longlong *)0x0) && (**(longlong **)(lVar1 + 0x18) != 0)) {
    local_38 = Proud::AddrPort::vftable;
    local_30 = *(undefined4 *)(lVar1 + 0x598);
    local_2c = *(undefined2 *)(lVar1 + 0x59c);
    if ((*(longlong **)(lVar1 + 0x18) == (longlong *)0x0) ||
       (lVar5 = **(longlong **)(lVar1 + 0x18), lVar5 == 0)) {
      lVar5 = 0;
    }
    else {
      lVar5 = lVar5 + -0x40;
    }
    plVar2 = *(longlong **)(lVar1 + 0x670);
    uVar6 = (**(code **)(plVar2[0xe] + 0x1c0))();
    uVar4 = (**(code **)(*plVar2 + 0x30))(plVar2);
    uVar3 = FUN_14019c290(uVar4,*(undefined4 *)(lVar1 + 0x56c));
    FUN_1401bc800(lVar5,*(undefined4 *)(*param_1 + 0x56c),uVar3,&local_38,param_2,uVar6,param_3);
  }
  return;
}



undefined8 FUN_1401b8ba0(longlong *param_1)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined **local_18;
  undefined4 local_10;
  undefined2 local_c;
  
  lVar1 = *param_1;
  if ((*(longlong **)(lVar1 + 0x18) == (longlong *)0x0) || (**(longlong **)(lVar1 + 0x18) == 0)) {
    return 0;
  }
  local_18 = Proud::AddrPort::vftable;
  local_10 = *(undefined4 *)(lVar1 + 0x598);
  local_c = *(undefined2 *)(lVar1 + 0x59c);
  if ((*(longlong **)(lVar1 + 0x18) != (longlong *)0x0) &&
     (lVar1 = **(longlong **)(lVar1 + 0x18), lVar1 != 0)) {
    uVar2 = FUN_1401bc530(lVar1 + -0x40,&local_18);
    return uVar2;
  }
  uVar2 = FUN_1401bc530(0,&local_18);
  return uVar2;
}



void FUN_1401b8c20(longlong param_1)

{
  longlong lVar1;
  char cVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong lVar5;
  
  if ((((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) &&
       (lVar5 = **(longlong **)(param_1 + 0x18), lVar5 != 0)) &&
      (plVar4 = *(longlong **)(lVar5 + 0xc0), plVar4 != (longlong *)0x0)) &&
     ((*plVar4 != 0 && (*(char *)(param_1 + 0x20) != '\0')))) {
    lVar5 = 0;
    lVar3 = lVar5;
    if (plVar4 != (longlong *)0x0) {
      lVar3 = *plVar4;
    }
    cVar2 = FUN_1400a8b50(lVar3);
    if (cVar2 != '\0') {
      lVar3 = lVar5;
      if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) &&
         (lVar1 = **(longlong **)(param_1 + 0x18), lVar1 != 0)) {
        lVar3 = lVar1 + -0x40;
      }
      FUN_1401bc6b0(lVar3);
      if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) &&
         (lVar3 = **(longlong **)(param_1 + 0x18), lVar3 != 0)) {
        lVar5 = lVar3 + -0x40;
      }
      FUN_1401bc490(lVar5);
      plVar4 = (longlong *)(*(longlong *)(param_1 + 0x670) + 0x1818);
      (**(code **)(*plVar4 + 0xd0))(plVar4,1,&DAT_140318cf0,param_1 + 0x56c);
      lVar5 = *(longlong *)(param_1 + 0x670);
      if ((*(char *)(lVar5 + 0x1790) != '\0') || (*(int *)(lVar5 + 0x6c8) != 0)) {
        FUN_140177c40(lVar5,1,&DAT_140263960,*(undefined4 *)(param_1 + 0x56c));
      }
    }
    *(undefined1 *)(param_1 + 0x20) = 0;
  }
  return;
}



void FUN_1401b8d30(longlong param_1,longlong param_2)

{
  longlong lVar1;
  
  *(undefined4 *)(param_2 + 0x18) = *(undefined4 *)(param_1 + 0x598);
  *(undefined2 *)(param_2 + 0x1c) = *(undefined2 *)(param_1 + 0x59c);
  *(undefined4 *)(param_2 + 0x28) = *(undefined4 *)(param_1 + 0x5a8);
  *(undefined2 *)(param_2 + 0x2c) = *(undefined2 *)(param_1 + 0x5ac);
  if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) &&
     (lVar1 = **(longlong **)(param_1 + 0x18), lVar1 != 0)) {
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(lVar1 + 0xf0);
    *(undefined2 *)(param_2 + 0xc) = *(undefined2 *)(lVar1 + 0xf4);
    return;
  }
  *(undefined4 *)(param_2 + 8) = DAT_1402f83d0;
  *(undefined2 *)(param_2 + 0xc) = DAT_1402f83d4;
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401b8da0(longlong *param_1,longlong param_2,ulonglong *param_3,longlong param_4)

{
  undefined *puVar1;
  int *piVar2;
  longlong lVar3;
  int iVar4;
  longlong lVar5;
  undefined8 uVar6;
  longlong *plVar7;
  short sVar8;
  undefined *puVar9;
  bool bVar10;
  undefined1 auStack_19b8 [32];
  undefined *local_1998;
  undefined1 local_1990;
  undefined1 local_1988 [8];
  undefined1 local_1980 [8];
  longlong local_1978;
  int local_196c;
  undefined8 local_1960;
  undefined1 local_1958;
  undefined8 local_1950;
  undefined1 local_1948 [3200];
  undefined1 *local_cc8;
  undefined4 local_cc0;
  undefined4 local_cbc;
  undefined1 local_cb8 [3216];
  ulonglong local_28;
  undefined8 uStack_20;
  
  uStack_20 = 0x1401b8db6;
  local_1950 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_19b8;
  lVar3 = param_1[2];
  if ((lVar3 != 0) && (*(int *)(lVar3 + 8) == 0)) {
    bVar10 = *param_3 < *(ulonglong *)(lVar3 + 0x1c);
    if ((*param_3 == *(ulonglong *)(lVar3 + 0x1c)) &&
       (bVar10 = param_3[1] < *(ulonglong *)(lVar3 + 0x24),
       param_3[1] == *(ulonglong *)(lVar3 + 0x24))) {
      iVar4 = 0;
    }
    else {
      iVar4 = (1 - (uint)bVar10) - (uint)(bVar10 != 0);
    }
    if ((iVar4 == 0) && (*(int *)(lVar3 + 0x18) < 1)) {
      plVar7 = *(longlong **)(*(longlong *)(*param_1 + 0x670) + 0x1570);
      sVar8 = DAT_1402f83d4;
      iVar4 = DAT_1402f83d0;
      if ((plVar7 != (longlong *)0x0) && (*plVar7 != 0)) {
        lVar5 = 0;
        if (plVar7 != (longlong *)0x0) {
          lVar5 = *plVar7;
        }
        sVar8 = *(short *)(lVar5 + 0xd4);
        iVar4 = *(int *)(lVar5 + 0xd0);
      }
      if ((((iVar4 == *(int *)(param_2 + 0x38)) && (sVar8 == *(short *)(param_2 + 0x3c))) &&
          (plVar7 = *(longlong **)(*param_1 + 0x18), plVar7 != (longlong *)0x0)) && (*plVar7 != 0))
      {
        FUN_140185560(local_1988);
        FUN_140185030(local_1988);
        FUN_1401856c0(local_1988,0x800);
        FUN_1401856c0(local_1988,0);
        FUN_14003c9e0(local_1988,0x12);
        if ((*(longlong **)(*param_1 + 0x18) == (longlong *)0x0) ||
           (lVar5 = **(longlong **)(*param_1 + 0x18), lVar5 == 0)) {
          lVar5 = 0;
        }
        else {
          lVar5 = lVar5 + -0x40;
        }
        FUN_140186160(local_1988,lVar5 + 0x128);
        FUN_140186160(local_1988,param_4);
        FUN_14007c6e0(local_1988,*(undefined4 *)(*param_1 + 0x56c));
        local_cbc = 200;
        local_cc0 = 0;
        local_cc8 = local_1948;
        FUN_140146970(local_cb8,local_1988);
        FUN_140145c70(local_1948,local_cb8);
        FUN_140145b60();
        if ((*(longlong **)(*param_1 + 0x18) == (longlong *)0x0) ||
           (lVar5 = **(longlong **)(*param_1 + 0x18), lVar5 == 0)) {
          lVar5 = 0;
        }
        else {
          lVar5 = lVar5 + -0x40;
        }
        *(undefined4 *)(lVar5 + 0x140) = *(undefined4 *)(param_4 + 8);
        *(undefined2 *)(lVar5 + 0x144) = *(undefined2 *)(param_4 + 0xc);
        local_1998 = (undefined *)0x0;
        local_1990 = 1;
        uVar6 = FUN_140169e50(*(undefined8 *)(*param_1 + 0x670));
        FUN_1401b82c0(uVar6,local_1948,&local_1998);
        if ((*(char *)(*(longlong *)(*param_1 + 0x670) + 0x1790) != '\0') ||
           (*(int *)(*(longlong *)(*param_1 + 0x670) + 0x6c8) != 0)) {
          plVar7 = (longlong *)FUN_1400a6f50(param_4,&local_1998);
          puVar9 = (undefined *)*plVar7;
          if ((undefined *)*plVar7 == (undefined *)0x0) {
            puVar9 = PTR_DAT_1402f8010;
          }
          FUN_140177c40(*(undefined8 *)(*param_1 + 0x670),1,
                        L"Message_PeerUdp_ServerHolepunchAck. AddrOfHereAtServer=%s",puVar9);
          puVar9 = local_1998;
          if (((local_1998 != (undefined *)0x0) && (local_1998 != PTR_DAT_1402f8010)) &&
             (puVar1 = local_1998 + -8, puVar1 != (undefined *)0x0)) {
            uVar6 = FUN_1400a3440();
            local_1960 = uVar6;
            FUN_1400a1c30(uVar6);
            local_1958 = 1;
            piVar2 = (int *)(puVar9 + -4);
            *piVar2 = *piVar2 + -1;
            if (*piVar2 == 0) {
              FUN_1400a3530(puVar1);
            }
            FUN_1400d1290(uVar6);
          }
        }
        *(int *)(lVar3 + 0x18) = *(int *)(lVar3 + 0x18) + 1;
        FUN_140145b60(local_1948);
        local_1998 = local_1980;
        FUN_14019a730(local_1980);
        if ((local_1978 != 0) && (local_196c < 0)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
      }
    }
  }
  return;
}



void FUN_1401b90d0(longlong *param_1,longlong param_2,undefined8 *param_3)

{
  longlong *plVar1;
  undefined8 uVar2;
  undefined2 uVar3;
  undefined4 uVar4;
  longlong lVar5;
  int iVar6;
  undefined8 *puVar7;
  longlong lVar8;
  longlong lVar9;
  undefined **local_88;
  undefined4 uStack_80;
  undefined2 uStack_7c;
  undefined2 uStack_7a;
  undefined4 local_78 [2];
  undefined8 local_70;
  undefined1 local_68;
  undefined4 local_64;
  undefined1 local_60;
  undefined1 local_5f;
  undefined1 local_58 [4];
  undefined4 local_54;
  longlong local_50;
  longlong local_48;
  int local_40;
  int local_3c;
  
  FUN_140185560(local_58);
  FUN_140185030(local_58);
  FUN_1401856c0(local_58,0x800);
  FUN_1401856c0(local_58,0);
  FUN_14003c9e0(local_58,0x1e);
  FUN_14007c6e0(local_58,*(undefined4 *)(*(longlong *)(*param_1 + 0x670) + 0x1578));
  lVar8 = local_50;
  local_88 = (undefined **)*param_3;
  uStack_80 = *(undefined4 *)(param_3 + 1);
  uStack_7c = (undefined2)*(undefined4 *)((longlong)param_3 + 0xc);
  uStack_7a = (undefined2)((uint)*(undefined4 *)((longlong)param_3 + 0xc) >> 0x10);
  lVar9 = 0;
  local_54 = 0;
  if (local_50 == 0) {
    if (local_48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
LAB_1401b917f:
    lVar8 = (longlong)local_40;
    local_40 = local_40 + 0x10;
    if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    puVar7 = (undefined8 *)(local_48 + lVar8);
  }
  else {
    if (local_48 != 0) goto LAB_1401b917f;
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar6 = *(int *)(local_50 + 0x18);
    FUN_14003cda0(local_50,iVar6 + 0x10);
    lVar5 = lVar9;
    if (*(int *)(lVar8 + 0x18) != 0) {
      lVar5 = *(longlong *)(lVar8 + 0x10);
    }
    puVar7 = (undefined8 *)(lVar5 + iVar6);
  }
  *puVar7 = local_88;
  puVar7[1] = CONCAT26(uStack_7a,CONCAT24(uStack_7c,uStack_80));
  FUN_14003ced0(local_58);
  lVar8 = *(longlong *)(*param_1 + 0x670);
  local_88 = *(undefined ***)(lVar8 + 0x6d0);
  uStack_80 = *(undefined4 *)(lVar8 + 0x6d8);
  uStack_7c = (undefined2)*(undefined4 *)(lVar8 + 0x6dc);
  uStack_7a = (undefined2)((uint)*(undefined4 *)(lVar8 + 0x6dc) >> 0x10);
  local_54 = 0;
  if (local_50 == 0) {
    if (local_48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar6 = *(int *)(local_50 + 0x18);
    FUN_14003cda0(local_50,iVar6 + 0x10);
    lVar8 = lVar9;
    if (*(int *)(local_50 + 0x18) != 0) {
      lVar8 = *(longlong *)(local_50 + 0x10);
    }
    puVar7 = (undefined8 *)(lVar8 + iVar6);
    goto LAB_1401b925e;
  }
  iVar6 = local_40 + 0x10;
  if ((iVar6 < 0) || (local_3c < iVar6)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  puVar7 = (undefined8 *)(local_48 + local_40);
  local_40 = iVar6;
LAB_1401b925e:
  *puVar7 = local_88;
  puVar7[1] = CONCAT26(uStack_7a,CONCAT24(uStack_7c,uStack_80));
  FUN_14003ced0(local_58);
  FUN_140186160(local_58,param_2);
  lVar8 = *param_1;
  local_78[0] = 5;
  local_70 = 0;
  local_68 = 1;
  local_64 = 0xffffffff;
  local_60 = 1;
  local_5f = DAT_1402f81cc;
  local_88 = Proud::AddrPort::vftable;
  uStack_80 = *(undefined4 *)(param_2 + 8);
  uStack_7c = *(undefined2 *)(param_2 + 0xc);
  if ((*(longlong **)(lVar8 + 0x18) != (longlong *)0x0) &&
     (lVar5 = **(longlong **)(lVar8 + 0x18), lVar5 != 0)) {
    lVar9 = lVar5 + -0x40;
  }
  plVar1 = *(longlong **)(lVar8 + 0x670);
  uVar2 = (**(code **)(*(longlong *)(*(longlong *)(lVar8 + 0x670) + 0x70) + 0x1c0))();
  uVar4 = (**(code **)(*plVar1 + 0x30))(plVar1);
  uVar3 = FUN_14019c290(uVar4,*(undefined4 *)(lVar8 + 0x56c));
  FUN_1401bc9b0(lVar9,*(undefined4 *)(*param_1 + 0x56c),uVar3,&local_88,local_58,uVar2,local_78);
  FUN_14019a730(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



void FUN_1401b93a0(longlong *param_1,longlong param_2,undefined8 *param_3,undefined8 param_4,
                  undefined8 param_5)

{
  int *piVar1;
  undefined **ppuVar2;
  int iVar3;
  longlong lVar4;
  undefined **ppuVar5;
  undefined2 uVar6;
  undefined4 uVar7;
  longlong *plVar8;
  longlong *plVar9;
  longlong *plVar10;
  undefined8 uVar11;
  undefined8 *puVar12;
  longlong lVar13;
  undefined *puVar14;
  longlong lVar15;
  undefined *puVar16;
  undefined *puVar17;
  longlong *local_res18 [2];
  undefined **local_a8;
  undefined4 uStack_a0;
  undefined2 uStack_9c;
  undefined2 uStack_9a;
  undefined1 local_98 [4];
  undefined4 local_94;
  longlong local_90;
  longlong local_88;
  int local_80;
  int local_7c;
  undefined8 local_70;
  undefined8 local_68;
  undefined1 local_60;
  undefined4 local_5c;
  undefined1 local_58;
  undefined1 local_57;
  undefined *local_50;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  FUN_140185560(local_98);
  FUN_140185030(local_98);
  FUN_1401856c0(local_98,0x800);
  FUN_1401856c0(local_98,0);
  FUN_14003c9e0(local_98,0x1f);
  local_a8 = (undefined **)*param_3;
  uStack_a0 = *(undefined4 *)(param_3 + 1);
  uStack_9c = (undefined2)*(undefined4 *)((longlong)param_3 + 0xc);
  uStack_9a = (undefined2)((uint)*(undefined4 *)((longlong)param_3 + 0xc) >> 0x10);
  lVar15 = 0;
  local_94 = 0;
  if (local_90 == 0) {
    if (local_88 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
  }
  else if (local_88 == 0) {
    if (local_90 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14019a830();
    }
    iVar3 = *(int *)(local_90 + 0x18);
    FUN_14003cda0(local_90,iVar3 + 0x10);
    lVar13 = lVar15;
    if (*(int *)(local_90 + 0x18) != 0) {
      lVar13 = *(longlong *)(local_90 + 0x10);
    }
    puVar12 = (undefined8 *)(lVar13 + iVar3);
    goto LAB_1401b947e;
  }
  lVar13 = (longlong)local_80;
  local_80 = local_80 + 0x10;
  if ((local_80 < 0) || (local_7c < local_80)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  puVar12 = (undefined8 *)(local_88 + lVar13);
LAB_1401b947e:
  *puVar12 = local_a8;
  puVar12[1] = CONCAT26(uStack_9a,CONCAT24(uStack_9c,uStack_a0));
  FUN_14003ced0(local_98);
  FUN_14007c6e0(local_98,*(undefined4 *)(*(longlong *)(*param_1 + 0x670) + 0x1578));
  FUN_140186160(local_98,param_4);
  FUN_140186160(local_98,param_5);
  FUN_140186160(local_98,param_2);
  lVar13 = *param_1;
  local_70 = CONCAT44(local_70._4_4_,5);
  local_68 = 0;
  local_60 = 1;
  local_5c = 0xffffffff;
  local_58 = 1;
  local_57 = DAT_1402f81cc;
  local_a8 = Proud::AddrPort::vftable;
  uStack_a0 = *(undefined4 *)(param_2 + 8);
  uStack_9c = *(undefined2 *)(param_2 + 0xc);
  if ((*(longlong **)(lVar13 + 0x18) != (longlong *)0x0) &&
     (lVar4 = **(longlong **)(lVar13 + 0x18), lVar4 != 0)) {
    lVar15 = lVar4 + -0x40;
  }
  plVar8 = *(longlong **)(lVar13 + 0x670);
  uVar11 = (**(code **)(*(longlong *)(*(longlong *)(lVar13 + 0x670) + 0x70) + 0x1c0))();
  uVar7 = (**(code **)(*plVar8 + 0x30))(plVar8);
  uVar6 = FUN_14019c290(uVar7,*(undefined4 *)(lVar13 + 0x56c));
  FUN_1401bc9b0(lVar15,*(undefined4 *)(*param_1 + 0x56c),uVar6,&local_a8,local_98,uVar11,&local_70);
  if ((*(char *)(*(longlong *)(*param_1 + 0x670) + 0x1790) != '\0') ||
     (*(int *)(*(longlong *)(*param_1 + 0x670) + 0x6c8) != 0)) {
    plVar8 = (longlong *)FUN_1400a6f50(param_2,&local_a8);
    plVar9 = (longlong *)FUN_1400a6f50(param_5,&local_50);
    plVar10 = (longlong *)FUN_1400a6f50(param_4,local_res18);
    puVar16 = (undefined *)*plVar8;
    if ((undefined *)*plVar8 == (undefined *)0x0) {
      puVar16 = PTR_DAT_1402f8010;
    }
    puVar14 = (undefined *)*plVar9;
    if ((undefined *)*plVar9 == (undefined *)0x0) {
      puVar14 = PTR_DAT_1402f8010;
    }
    puVar17 = (undefined *)*plVar10;
    if ((undefined *)*plVar10 == (undefined *)0x0) {
      puVar17 = PTR_DAT_1402f8010;
    }
    FUN_140177c40(*(undefined8 *)(*param_1 + 0x670),1,&DAT_140263ac0,puVar17,puVar14,puVar16);
    if (((local_res18[0] != (longlong *)0x0) && (local_res18[0] != (longlong *)PTR_DAT_1402f8010))
       && (local_res18[0] + -1 != (longlong *)0x0)) {
      uVar11 = FUN_1400a3440();
      local_70 = uVar11;
      FUN_1400a1c30(uVar11);
      local_68 = CONCAT71(local_68._1_7_,1);
      piVar1 = (int *)((longlong)local_res18[0] + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(local_res18[0] + -1);
      }
      FUN_1400d1290(uVar11);
    }
    local_res18[0] = (longlong *)PTR_DAT_1402f8010;
    if (((local_50 != (undefined *)0x0) && (local_50 != PTR_DAT_1402f8010)) &&
       (local_50 + -8 != (undefined *)0x0)) {
      uVar11 = FUN_1400a3440();
      local_70 = uVar11;
      FUN_1400a1c30(uVar11);
      local_68 = CONCAT71(local_68._1_7_,1);
      piVar1 = (int *)(local_50 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(local_50 + -8);
      }
      FUN_1400d1290(uVar11);
    }
    ppuVar5 = local_a8;
    local_50 = PTR_DAT_1402f8010;
    if (((local_a8 != (undefined **)0x0) && (local_a8 != (undefined **)PTR_DAT_1402f8010)) &&
       (ppuVar2 = local_a8 + -1, ppuVar2 != (undefined **)0x0)) {
      uVar11 = FUN_1400a3440();
      local_70 = uVar11;
      FUN_1400a1c30(uVar11);
      local_68 = CONCAT71(local_68._1_7_,1);
      piVar1 = (int *)((longlong)ppuVar5 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_1400a3530(ppuVar2);
      }
      FUN_1400d1290(uVar11);
    }
  }
  local_res18[0] = &local_90;
  FUN_14019a730(&local_90);
  if ((local_88 != 0) && (local_7c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



void FUN_1401b9770(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  undefined2 uVar3;
  undefined4 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined **local_70;
  undefined4 local_68;
  undefined2 local_64;
  undefined4 local_60 [2];
  undefined8 local_58;
  undefined1 local_50;
  undefined4 local_4c;
  undefined1 local_48;
  undefined1 local_47;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  if (((longlong *)param_1[1] != (longlong *)0x0) && (*(longlong *)param_1[1] != 0)) {
    FUN_140185560(local_40);
    FUN_140185030(local_40);
    FUN_1401856c0(local_40,0x800);
    FUN_1401856c0(local_40,0);
    FUN_14003c9e0(local_40,0x27);
    local_60[0] = 1;
    lVar5 = 0;
    local_58 = 0;
    local_50 = 1;
    local_4c = 0xffffffff;
    local_48 = 1;
    local_47 = DAT_1402f81cc;
    local_70 = Proud::AddrPort::vftable;
    local_68 = *(undefined4 *)(param_2 + 8);
    local_64 = *(undefined2 *)(param_2 + 0xc);
    if (((longlong *)param_1[1] != (longlong *)0x0) && (lVar1 = *(longlong *)param_1[1], lVar1 != 0)
       ) {
      lVar5 = lVar1 + -0x40;
    }
    plVar2 = (longlong *)param_1[0xcc];
    uVar6 = (**(code **)(*param_1 + 8))(param_1);
    uVar4 = (**(code **)(*plVar2 + 0x30))(plVar2);
    uVar3 = FUN_14019c290(uVar4,*(undefined4 *)((longlong)param_1 + 0x55c));
    FUN_1401bc9b0(lVar5,*(undefined4 *)((longlong)param_1 + 0x55c),uVar3,&local_70,local_40,uVar6,
                  local_60);
    FUN_14019a730(local_38);
    if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_1401b9900(longlong *param_1)

{
  int *piVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong lVar4;
  undefined2 uVar5;
  undefined4 uVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  ulonglong uVar9;
  ushort uVar10;
  uint uVar11;
  ulonglong uVar12;
  longlong lVar13;
  undefined4 extraout_XMM0_Da;
  undefined4 extraout_XMM0_Da_00;
  undefined4 extraout_XMM0_Db;
  undefined4 extraout_XMM0_Db_00;
  double dVar14;
  undefined4 local_d8;
  undefined4 uStack_d4;
  undefined4 uStack_d0;
  undefined4 uStack_cc;
  undefined1 local_c8 [8];
  undefined1 local_c0 [8];
  longlong local_b8;
  int local_ac;
  undefined **local_a0;
  undefined4 local_98;
  ushort local_94;
  undefined **local_90;
  undefined4 local_88;
  undefined2 local_84;
  undefined **local_80;
  undefined4 local_78;
  undefined2 local_74;
  undefined4 local_70 [2];
  undefined8 local_68;
  undefined1 local_60;
  undefined4 local_5c;
  undefined1 local_58;
  undefined1 local_57;
  undefined8 local_50;
  undefined1 local_48 [32];
  
  local_50 = 0xfffffffffffffffe;
  dVar14 = (double)FUN_140169c60(*(undefined8 *)(*param_1 + 0x670));
  dVar14 = dVar14 + (double)param_1[1];
  param_1[1] = (longlong)dVar14;
  lVar13 = *(longlong *)(*param_1 + 0x670);
  if (dVar14 < *(double *)(lVar13 + 0x640) || dVar14 == *(double *)(lVar13 + 0x640)) {
    lVar2 = param_1[2];
    if (*(int *)(lVar2 + 8) == 0) {
      FUN_140169c60(lVar13);
      dVar14 = *(double *)(lVar2 + 0x10) - (double)CONCAT44(extraout_XMM0_Db_00,extraout_XMM0_Da_00)
      ;
      *(double *)(lVar2 + 0x10) = dVar14;
      if (dVar14 < 0.0) {
        *(undefined8 *)(lVar2 + 0x10) = DAT_1402f8080;
        FUN_140185560(local_c8);
        FUN_140185030(local_c8);
        FUN_1401856c0(local_c8,0x800);
        FUN_1401856c0(local_c8,0);
        FUN_14003c9e0(local_c8,0x10);
        local_d8 = *(undefined4 *)(lVar2 + 0x1c);
        uStack_d4 = *(undefined4 *)(lVar2 + 0x20);
        uStack_d0 = *(undefined4 *)(lVar2 + 0x24);
        uStack_cc = *(undefined4 *)(lVar2 + 0x28);
        FUN_14003cba0(local_c8,&local_d8);
        FUN_14007c6e0(local_c8,*(undefined4 *)(*param_1 + 0x56c));
        lVar2 = *param_1;
        local_70[0] = 5;
        lVar13 = 0;
        local_68 = 0;
        local_60 = 1;
        local_5c = 0xffffffff;
        local_58 = 1;
        local_57 = DAT_1402f81cc;
        if ((*(longlong **)(lVar2 + 0x18) != (longlong *)0x0) &&
           (lVar4 = **(longlong **)(lVar2 + 0x18), lVar4 != 0)) {
          lVar13 = lVar4 + -0x40;
        }
        plVar3 = *(longlong **)(lVar2 + 0x670);
        uVar7 = (**(code **)(*(longlong *)(*(longlong *)(lVar2 + 0x670) + 0x70) + 0x1c0))();
        uVar8 = FUN_1401b8880(param_1,local_48);
        uVar6 = (**(code **)(*plVar3 + 0x30))(plVar3);
        uVar5 = FUN_14019c290(uVar6,1);
        FUN_1401bc9b0(lVar13,1,uVar5,uVar8,local_c8,uVar7,local_70);
        FUN_14019a730(local_c0);
        if ((local_b8 != 0) && (local_ac < 0)) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
      }
    }
    else if (*(int *)(lVar2 + 8) == 1) {
      FUN_140169c60(lVar13);
      dVar14 = *(double *)(lVar2 + 0x10) - (double)CONCAT44(extraout_XMM0_Db,extraout_XMM0_Da);
      *(double *)(lVar2 + 0x10) = dVar14;
      if (dVar14 < 0.0) {
        *(undefined8 *)(lVar2 + 0x10) = *(undefined8 *)(*(longlong *)(*param_1 + 0x670) + 0x648);
        *(int *)(lVar2 + 0x18) = *(int *)(lVar2 + 0x18) + 1;
        lVar13 = *param_1;
        local_d8 = *(undefined4 *)(lVar13 + 0x30);
        uStack_d4 = *(undefined4 *)(lVar13 + 0x34);
        uStack_d0 = *(undefined4 *)(lVar13 + 0x38);
        uStack_cc = *(undefined4 *)(lVar13 + 0x3c);
        local_90 = Proud::AddrPort::vftable;
        local_88 = *(undefined4 *)(lVar13 + 0x578);
        local_84 = *(undefined2 *)(lVar13 + 0x57c);
        FUN_1401b90d0(param_1,&local_90,&local_d8);
        lVar13 = *param_1;
        plVar3 = *(longlong **)(lVar13 + 0x18);
        uVar12 = 0;
        if ((plVar3 != (longlong *)0x0) && (*plVar3 != 0)) {
          uVar9 = uVar12;
          if ((plVar3 != (longlong *)0x0) && (*plVar3 != 0)) {
            uVar9 = *plVar3 - 0x40;
          }
          if (*(int *)(uVar9 + 0x140) == *(int *)(lVar13 + 0x578)) {
            uVar9 = uVar12;
            if ((*(longlong **)(lVar13 + 0x18) != (longlong *)0x0) &&
               (lVar4 = **(longlong **)(lVar13 + 0x18), lVar4 != 0)) {
              uVar9 = lVar4 - 0x40;
            }
            if (((*(char *)(uVar9 + 0x130) == *(char *)(lVar13 + 0x588)) &&
                (*(char *)(uVar9 + 0x131) == *(char *)(lVar13 + 0x589))) &&
               (*(char *)(uVar9 + 0x132) == *(char *)(lVar13 + 0x58a))) {
              local_d8 = *(undefined4 *)(lVar13 + 0x30);
              uStack_d4 = *(undefined4 *)(lVar13 + 0x34);
              uStack_d0 = *(undefined4 *)(lVar13 + 0x38);
              uStack_cc = *(undefined4 *)(lVar13 + 0x3c);
              local_80 = Proud::AddrPort::vftable;
              local_78 = *(undefined4 *)(lVar13 + 0x588);
              local_74 = *(undefined2 *)(lVar13 + 0x58c);
              FUN_1401b90d0(param_1,&local_80,&local_d8);
            }
          }
        }
        if (DAT_1402f808c < *(int *)(lVar2 + 0x18)) {
          piVar1 = (int *)(lVar2 + 0x30);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 < 0) {
            *(undefined4 *)(lVar2 + 0x30) = DAT_1402f80e8;
            *(short *)(lVar2 + 0x34) = *(short *)(lVar2 + 0x34) + (short)_DAT_140313fc0;
            uVar10 = *(ushort *)(lVar2 + 0x34);
            if ((uVar10 < 0x3ff) || (uVar10 == 0xffff)) {
              uVar10 = 0x3ff;
            }
            *(ushort *)(lVar2 + 0x34) = uVar10;
          }
          uVar6 = *(undefined4 *)(*param_1 + 0x578);
          uVar10 = *(ushort *)(lVar2 + 0x34);
          if (0 < _DAT_140313fc0) {
            do {
              lVar13 = *param_1;
              local_d8 = *(undefined4 *)(lVar13 + 0x30);
              uStack_d4 = *(undefined4 *)(lVar13 + 0x34);
              uStack_d0 = *(undefined4 *)(lVar13 + 0x38);
              uStack_cc = *(undefined4 *)(lVar13 + 0x3c);
              local_a0 = Proud::AddrPort::vftable;
              local_98 = uVar6;
              local_94 = uVar10;
              FUN_1401b90d0(param_1,&local_a0,&local_d8);
              uVar10 = uVar10 + 1;
              if ((uVar10 < 0x3ff) || (uVar10 == 0xffff)) {
                uVar10 = 0x3ff;
              }
              uVar11 = (int)uVar12 + 1;
              uVar12 = (ulonglong)uVar11;
            } while ((int)uVar11 < _DAT_140313fc0);
          }
        }
      }
    }
    uVar7 = 1;
  }
  else {
    uVar7 = 0;
  }
  return uVar7;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401b9d00(longlong param_1,longlong param_2)

{
  int *piVar1;
  undefined8 *puVar2;
  char cVar3;
  int iVar4;
  longlong *plVar5;
  longlong *plVar6;
  undefined8 uVar7;
  undefined1 *puVar8;
  longlong lVar9;
  longlong lVar10;
  undefined1 *_Memory;
  longlong lVar11;
  undefined *puVar12;
  longlong lVar13;
  bool bVar14;
  undefined4 uVar15;
  undefined4 uVar16;
  undefined4 uVar17;
  undefined4 uVar18;
  undefined1 auStack_628 [32];
  undefined ***local_608;
  undefined **local_5f8;
  undefined4 local_5f0;
  undefined2 local_5ec;
  undefined **local_5e8;
  undefined4 local_5e0;
  undefined2 local_5dc;
  longlong *local_5d8;
  undefined4 local_5d0 [2];
  undefined *local_5c8;
  undefined **local_5c0;
  undefined4 local_5b8;
  undefined2 local_5b4;
  undefined **local_5b0;
  undefined4 local_5a8;
  undefined2 local_5a4;
  undefined *local_5a0;
  undefined **local_598;
  undefined4 local_590;
  undefined2 local_58c;
  undefined **local_588;
  undefined4 local_580;
  undefined2 local_57c;
  undefined **local_578;
  undefined4 local_570;
  undefined2 local_56c;
  undefined **local_568;
  undefined4 local_560;
  undefined2 local_55c;
  undefined **local_558;
  undefined4 local_550;
  undefined2 local_54c;
  undefined **local_548;
  undefined4 local_540;
  undefined2 local_53c;
  undefined **local_538;
  undefined4 local_530;
  undefined2 local_52c;
  undefined4 local_528;
  undefined4 uStack_524;
  undefined4 uStack_520;
  undefined4 uStack_51c;
  undefined8 local_518;
  undefined1 local_510;
  undefined4 local_508;
  undefined4 uStack_504;
  undefined4 uStack_500;
  undefined4 uStack_4fc;
  undefined8 local_4f8;
  undefined1 local_4f0;
  undefined8 local_4e8;
  undefined4 local_4d8;
  undefined4 uStack_4d4;
  undefined4 uStack_4d0;
  undefined4 uStack_4cc;
  undefined4 local_4c8;
  undefined4 uStack_4c4;
  undefined4 uStack_4c0;
  undefined4 uStack_4bc;
  undefined4 local_4b8;
  undefined4 uStack_4b4;
  undefined4 uStack_4b0;
  undefined4 uStack_4ac;
  undefined4 local_4a8;
  undefined4 uStack_4a4;
  undefined4 uStack_4a0;
  undefined4 uStack_49c;
  undefined4 local_498;
  undefined4 uStack_494;
  undefined4 uStack_490;
  undefined4 uStack_48c;
  undefined1 *local_488;
  undefined1 local_480 [264];
  undefined1 *local_378;
  undefined1 local_370 [264];
  undefined1 *local_268;
  undefined1 local_260 [264];
  undefined1 *local_158;
  undefined1 local_150 [264];
  ulonglong local_48;
  
  local_4e8 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_628;
  local_5f8 = Proud::AddrPort::vftable;
  lVar11 = 0;
  iVar4 = 0;
  local_5f0 = 0;
  local_5ec = 0;
  cVar3 = FUN_140185f20(param_2,local_5d0);
  if (cVar3 == '\0') {
    if ((*(char *)(param_1 + 0x1790) == '\0') && (*(int *)(param_1 + 0x6c8) == 0)) {
      return;
    }
    local_488 = local_480;
    FUN_14008a6c0(&local_488,"RemotePeer.cpp",3);
    local_608 = (undefined ***)CONCAT44(local_608._4_4_,0x9b);
    FUN_140177c40(param_1,1,&DAT_140263bd8,local_488);
    puVar8 = local_480;
    _Memory = local_488;
  }
  else {
    local_4c8 = 0;
    uStack_4c4 = 0;
    uStack_4c0 = 0;
    uStack_4bc = 0;
    cVar3 = FUN_140185490(param_2,&local_4c8,0x10);
    uVar18 = uStack_4bc;
    uVar17 = uStack_4c0;
    uVar16 = uStack_4c4;
    uVar15 = local_4c8;
    if (cVar3 == '\0') {
      if ((*(char *)(param_1 + 0x1790) == '\0') && (*(int *)(param_1 + 0x6c8) == 0)) {
        return;
      }
      local_158 = local_150;
      FUN_14008a6c0(&local_158,"RemotePeer.cpp",3);
      local_608 = (undefined ***)CONCAT44(local_608._4_4_,0xa0);
      FUN_140177c40(param_1,1,&DAT_140263bd8,local_158);
      puVar8 = local_150;
      _Memory = local_158;
    }
    else {
      local_4a8 = local_4c8;
      uStack_4a4 = uStack_4c4;
      uStack_4a0 = uStack_4c0;
      uStack_49c = uStack_4bc;
      local_4b8 = 0;
      uStack_4b4 = 0;
      uStack_4b0 = 0;
      uStack_4ac = 0;
      cVar3 = FUN_140185490(param_2,&local_4b8,0x10);
      if (cVar3 == '\0') {
        if ((*(char *)(param_1 + 0x1790) == '\0') && (*(int *)(param_1 + 0x6c8) == 0)) {
          return;
        }
        local_378 = local_370;
        FUN_14008a6c0(&local_378,"RemotePeer.cpp",3);
        local_608 = (undefined ***)CONCAT44(local_608._4_4_,0xa5);
        FUN_140177c40(param_1,1,&DAT_140263bd8,local_378);
        puVar8 = local_370;
        _Memory = local_378;
      }
      else {
        local_498 = local_4b8;
        uStack_494 = uStack_4b4;
        uStack_490 = uStack_4b0;
        uStack_48c = uStack_4ac;
        cVar3 = FUN_140185ec0(param_2,&local_5f8);
        if (cVar3 != '\0') {
          bVar14 = CONCAT44(uStack_494,local_498) < *(ulonglong *)(param_1 + 0x6d0);
          if ((CONCAT44(uStack_494,local_498) != *(ulonglong *)(param_1 + 0x6d0)) ||
             (bVar14 = CONCAT44(uStack_48c,uStack_490) < *(ulonglong *)(param_1 + 0x6d8),
             CONCAT44(uStack_48c,uStack_490) != *(ulonglong *)(param_1 + 0x6d8))) {
            iVar4 = (1 - (uint)bVar14) - (uint)(bVar14 != 0);
          }
          if (iVar4 != 0) {
            return;
          }
          local_5e8 = Proud::AddrPort::vftable;
          local_5e0 = *(undefined4 *)(param_2 + 0x38);
          local_5dc = *(undefined2 *)(param_2 + 0x3c);
          plVar5 = (longlong *)FUN_1401755f0(param_1,&local_5d8,local_5d0[0]);
          lVar13 = lVar11;
          if ((longlong *)*plVar5 != (longlong *)0x0) {
            lVar13 = *(longlong *)*plVar5;
          }
          if ((local_5d8 != (longlong *)0x0) &&
             (local_5d8[1] = local_5d8[1] + -1, uVar15 = local_4c8, uVar16 = uStack_4c4,
             uVar17 = uStack_4c0, uVar18 = uStack_4bc, local_5d8[1] == 0)) {
            puVar2 = (undefined8 *)*local_5d8;
            if (puVar2 != (undefined8 *)0x0) {
              (**(code **)*puVar2)(puVar2,1);
            }
            FUN_1400a3530(local_5d8);
            uVar15 = local_4c8;
            uVar16 = uStack_4c4;
            uVar17 = uStack_4c0;
            uVar18 = uStack_4bc;
          }
          if (lVar13 == 0) {
            return;
          }
          if (*(char *)(lVar13 + 0x684) != '\0') {
            return;
          }
          if (*(longlong **)(lVar13 + 0x28) == (longlong *)0x0) {
            return;
          }
          if (**(longlong **)(lVar13 + 0x28) == 0) {
            return;
          }
          bVar14 = CONCAT44(uStack_4a4,local_4a8) < *(ulonglong *)(lVar13 + 0x30);
          if ((CONCAT44(uStack_4a4,local_4a8) == *(ulonglong *)(lVar13 + 0x30)) &&
             (bVar14 = CONCAT44(uStack_49c,uStack_4a0) < *(ulonglong *)(lVar13 + 0x38),
             CONCAT44(uStack_49c,uStack_4a0) == *(ulonglong *)(lVar13 + 0x38))) {
            iVar4 = 0;
          }
          else {
            iVar4 = (1 - (uint)bVar14) - (uint)(bVar14 != 0);
          }
          if (iVar4 != 0) {
            return;
          }
          if ((*(char *)(param_1 + 0x1790) != '\0') || (*(int *)(param_1 + 0x6c8) != 0)) {
            plVar5 = (longlong *)FUN_1400a6f50(&local_5e8,&local_5a0);
            plVar6 = (longlong *)FUN_1400a6f50(&local_5f8,&local_5c8);
            local_608 = (undefined ***)*plVar5;
            if ((undefined ***)*plVar5 == (undefined ***)0x0) {
              local_608 = (undefined ***)PTR_DAT_1402f8010;
            }
            puVar12 = (undefined *)*plVar6;
            if ((undefined *)*plVar6 == (undefined *)0x0) {
              puVar12 = PTR_DAT_1402f8010;
            }
            FUN_140177c40(param_1,1,&DAT_140263b90,puVar12);
            if (((local_5c8 != (undefined *)0x0) && (local_5c8 != PTR_DAT_1402f8010)) &&
               (local_5c8 + -8 != (undefined *)0x0)) {
              uVar7 = FUN_1400a3440();
              local_518 = uVar7;
              FUN_1400a1c30(uVar7);
              local_510 = 1;
              piVar1 = (int *)(local_5c8 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(local_5c8 + -8);
              }
              FUN_1400d1290(uVar7);
            }
            local_5c8 = PTR_DAT_1402f8010;
            if (((local_5a0 != (undefined *)0x0) && (local_5a0 != PTR_DAT_1402f8010)) &&
               (local_5a0 + -8 != (undefined *)0x0)) {
              uVar7 = FUN_1400a3440();
              local_4f8 = uVar7;
              FUN_1400a1c30(uVar7);
              local_4f0 = 1;
              piVar1 = (int *)(local_5a0 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(local_5a0 + -8);
              }
              FUN_1400d1290(uVar7);
            }
          }
          FUN_1400a64d0(lVar13 + 0x570);
          cVar3 = FUN_1400a64d0(lVar13 + 0x580);
          if (cVar3 != '\0') {
            if ((*(longlong **)(lVar13 + 0x18) == (longlong *)0x0) ||
               (lVar10 = **(longlong **)(lVar13 + 0x18), lVar9 = lVar10 + -0x40, lVar10 == 0)) {
              lVar9 = lVar11;
            }
            cVar3 = FUN_1400a64d0(lVar9 + 0x128);
            if (cVar3 != '\0') {
              plVar5 = *(longlong **)(lVar13 + 0x18);
              if ((plVar5 == (longlong *)0x0) || (lVar10 = *plVar5 + -0x40, *plVar5 == 0)) {
                lVar10 = lVar11;
              }
              if (*(int *)(lVar10 + 0x140) == *(int *)(lVar13 + 0x578)) {
                lVar10 = lVar11;
                if ((plVar5 != (longlong *)0x0) && (*plVar5 != 0)) {
                  lVar10 = *plVar5 + -0x40;
                }
                if (((*(char *)(lVar10 + 0x130) == *(char *)(lVar13 + 0x588)) &&
                    (*(char *)(lVar10 + 0x131) == *(char *)(lVar13 + 0x589))) &&
                   (*(char *)(lVar10 + 0x132) == *(char *)(lVar13 + 0x58a))) {
                  local_598 = Proud::AddrPort::vftable;
                  local_590 = local_5e0;
                  local_58c = local_5dc;
                  local_558 = Proud::AddrPort::vftable;
                  local_550 = local_5f0;
                  local_54c = local_5ec;
                  local_568 = Proud::AddrPort::vftable;
                  local_560 = *(undefined4 *)(lVar13 + 0x588);
                  local_55c = *(undefined2 *)(lVar13 + 0x58c);
                  lVar10 = lVar11;
                  if (*(longlong **)(lVar13 + 0x28) != (longlong *)0x0) {
                    lVar10 = **(longlong **)(lVar13 + 0x28);
                  }
                  local_608 = &local_598;
                  local_4d8 = uVar15;
                  uStack_4d4 = uVar16;
                  uStack_4d0 = uVar17;
                  uStack_4cc = uVar18;
                  FUN_1401b93a0(lVar10,&local_568,&local_4d8,&local_558);
                }
              }
            }
          }
          cVar3 = FUN_1400a64d0(lVar13 + 0x570);
          if (cVar3 != '\0') {
            local_588 = Proud::AddrPort::vftable;
            local_580 = local_5e0;
            local_57c = local_5dc;
            local_578 = Proud::AddrPort::vftable;
            local_570 = local_5f0;
            local_56c = local_5ec;
            local_5b0 = Proud::AddrPort::vftable;
            local_5a8 = *(undefined4 *)(lVar13 + 0x578);
            local_5a4 = *(undefined2 *)(lVar13 + 0x57c);
            lVar10 = lVar11;
            if (*(longlong **)(lVar13 + 0x28) != (longlong *)0x0) {
              lVar10 = **(longlong **)(lVar13 + 0x28);
            }
            local_608 = &local_588;
            local_528 = uVar15;
            uStack_524 = uVar16;
            uStack_520 = uVar17;
            uStack_51c = uVar18;
            FUN_1401b93a0(lVar10,&local_5b0,&local_528,&local_578);
          }
          local_5c0 = Proud::AddrPort::vftable;
          local_5b8 = local_5e0;
          local_5b4 = local_5dc;
          local_538 = Proud::AddrPort::vftable;
          local_530 = local_5f0;
          local_52c = local_5ec;
          local_548 = Proud::AddrPort::vftable;
          local_540 = *(undefined4 *)(param_2 + 0x38);
          local_53c = *(undefined2 *)(param_2 + 0x3c);
          if (*(longlong **)(lVar13 + 0x28) != (longlong *)0x0) {
            lVar11 = **(longlong **)(lVar13 + 0x28);
          }
          local_608 = &local_5c0;
          local_508 = uVar15;
          uStack_504 = uVar16;
          uStack_500 = uVar17;
          uStack_4fc = uVar18;
          FUN_1401b93a0(lVar11,&local_548,&local_508,&local_538);
          return;
        }
        if ((*(char *)(param_1 + 0x1790) == '\0') && (*(int *)(param_1 + 0x6c8) == 0)) {
          return;
        }
        local_268 = local_260;
        FUN_14008a6c0(&local_268,"RemotePeer.cpp",3);
        local_608 = (undefined ***)CONCAT44(local_608._4_4_,0xaa);
        FUN_140177c40(param_1,1,&DAT_140263bd8,local_268);
        puVar8 = local_260;
        _Memory = local_268;
      }
    }
  }
  if (_Memory != puVar8) {
    free(_Memory);
  }
  return;
}



void FUN_1401ba430(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong *plVar2;
  
  plVar2 = (longlong *)(param_1 + 0x20);
  if (*plVar2 != 0) {
    plVar1 = (longlong *)(*plVar2 + 8);
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      FUN_140148f80(plVar2,*plVar2,param_3,param_4,0xfffffffffffffffe);
    }
  }
  FUN_14019a730(param_1 + 8);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    if (*(int *)(param_1 + 0x1c) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(param_1 + 0x18) = 0;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401ba4a0(longlong param_1,longlong param_2)

{
  int *piVar1;
  undefined8 *puVar2;
  longlong lVar3;
  char cVar4;
  int iVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong *plVar8;
  longlong *plVar9;
  undefined8 uVar10;
  longlong lVar11;
  undefined *puVar12;
  bool bVar13;
  undefined1 auStack_1b8 [32];
  undefined4 *local_198;
  undefined ***local_190;
  undefined ***local_188;
  undefined ***local_180;
  undefined ***local_178;
  undefined4 local_168 [2];
  longlong *local_160;
  undefined **local_158;
  undefined4 local_150;
  undefined2 local_14c;
  undefined **local_148;
  undefined4 local_140;
  undefined2 local_13c;
  undefined **local_138;
  undefined4 local_130;
  undefined2 local_12c;
  undefined *local_128;
  undefined8 local_120;
  undefined *local_118;
  undefined *local_110;
  undefined **local_108;
  undefined4 local_100;
  undefined2 local_fc;
  undefined *local_f8;
  undefined8 local_f0;
  undefined1 local_e8;
  undefined8 local_e0;
  undefined1 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined1 local_c0;
  undefined8 local_b8;
  undefined1 local_b0;
  undefined8 local_a8;
  undefined8 uStack_a0;
  undefined8 local_98;
  ulonglong uStack_90;
  undefined8 local_88;
  undefined8 uStack_80;
  undefined8 local_78;
  undefined8 uStack_70;
  undefined4 local_68;
  undefined4 uStack_64;
  undefined4 uStack_60;
  undefined4 uStack_5c;
  undefined4 local_58;
  undefined4 uStack_54;
  undefined4 uStack_50;
  undefined4 uStack_4c;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined4 local_38;
  undefined4 uStack_34;
  undefined4 uStack_30;
  undefined4 uStack_2c;
  ulonglong local_28;
  
  local_d0 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_1b8;
  local_148 = Proud::AddrPort::vftable;
  lVar11 = 0;
  local_140 = 0;
  local_13c = 0;
  local_158 = Proud::AddrPort::vftable;
  local_150 = 0;
  local_14c = 0;
  local_138 = Proud::AddrPort::vftable;
  local_130 = 0;
  local_12c = 0;
  local_48 = 0;
  uStack_44 = 0;
  uStack_40 = 0;
  uStack_3c = 0;
  cVar4 = FUN_140185490(param_2,&local_48,0x10);
  if (cVar4 != '\0') {
    local_38 = local_48;
    uStack_34 = uStack_44;
    uStack_30 = uStack_40;
    uStack_2c = uStack_3c;
    cVar4 = FUN_140185f20(param_2,local_168);
    if ((((cVar4 != '\0') && (cVar4 = FUN_140185ec0(param_2,&local_148), cVar4 != '\0')) &&
        (cVar4 = FUN_140185ec0(param_2,&local_158), cVar4 != '\0')) &&
       (cVar4 = FUN_140185ec0(param_2,&local_138), cVar4 != '\0')) {
      local_108 = Proud::AddrPort::vftable;
      local_100 = *(undefined4 *)(param_2 + 0x38);
      local_fc = *(undefined2 *)(param_2 + 0x3c);
      plVar6 = (longlong *)FUN_1401755f0(param_1,&local_160,local_168[0]);
      if ((longlong *)*plVar6 != (longlong *)0x0) {
        lVar11 = *(longlong *)*plVar6;
      }
      if ((local_160 != (longlong *)0x0) && (local_160[1] = local_160[1] + -1, local_160[1] == 0)) {
        puVar2 = (undefined8 *)*local_160;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        FUN_1400a3530(local_160);
      }
      if (((lVar11 != 0) && (*(char *)(lVar11 + 0x684) == '\0')) &&
         ((*(longlong **)(lVar11 + 0x28) != (longlong *)0x0 &&
          (lVar3 = **(longlong **)(lVar11 + 0x28), lVar3 != 0)))) {
        bVar13 = *(ulonglong *)(lVar11 + 0x30) < CONCAT44(uStack_34,local_38);
        if ((*(ulonglong *)(lVar11 + 0x30) == CONCAT44(uStack_34,local_38)) &&
           (bVar13 = *(ulonglong *)(lVar11 + 0x38) < CONCAT44(uStack_2c,uStack_30),
           *(ulonglong *)(lVar11 + 0x38) == CONCAT44(uStack_2c,uStack_30))) {
          iVar5 = 0;
        }
        else {
          iVar5 = (1 - (uint)bVar13) - (uint)(bVar13 != 0);
        }
        if (((iVar5 == 0) && (*(longlong *)(lVar3 + 0x10) != 0)) &&
           (*(int *)(*(longlong *)(lVar3 + 0x10) + 8) == 1)) {
          local_120 = 0;
          FUN_140176e00(lVar11 + 0x28,&local_120);
          FUN_140176cc0(&local_120);
          local_a8 = _DAT_140318cf0;
          uStack_a0 = uRam0000000140318cf8;
          local_98 = _DAT_140318d00;
          local_88 = _DAT_140318d10;
          uStack_80 = _DAT_140318d18;
          local_78 = _DAT_140318d20;
          uStack_70 = _DAT_140318d28;
          local_68 = _DAT_140318d30;
          uStack_64 = uRam0000000140318d34;
          uStack_60 = _DAT_140318d38;
          uStack_5c = uRam0000000140318d3c;
          local_58 = _DAT_140318d40;
          uStack_54 = _DAT_140318d44;
          uStack_50 = uRam0000000140318d48;
          uStack_4c = uRam0000000140318d4c;
          uStack_90 = _DAT_140318d08 & 0xffffffff00000000;
          (**(code **)(*(longlong *)(param_1 + 0x17d0) + 0x30))
                    ((longlong *)(param_1 + 0x17d0),*(undefined4 *)(lVar11 + 0x56c),&local_a8);
          local_178 = &local_108;
          local_180 = &local_138;
          local_188 = &local_158;
          local_190 = &local_148;
          local_198 = (undefined4 *)(lVar11 + 0x56c);
          (**(code **)(*(longlong *)(param_1 + 0x1818) + 0x70))
                    ((longlong *)(param_1 + 0x1818),1,&DAT_140318cf0,param_1 + 0x1578);
          if ((*(char *)(param_1 + 0x1790) != '\0') || (*(int *)(param_1 + 0x6c8) != 0)) {
            plVar6 = (longlong *)FUN_1400a6f50(&local_108,&local_f8);
            plVar7 = (longlong *)FUN_1400a6f50(&local_138,&local_118);
            plVar8 = (longlong *)FUN_1400a6f50(&local_158,&local_128);
            plVar9 = (longlong *)FUN_1400a6f50(&local_148,&local_110);
            local_188 = (undefined ***)*plVar6;
            if ((undefined *)*plVar6 == (undefined *)0x0) {
              local_188 = (undefined ***)PTR_DAT_1402f8010;
            }
            local_190 = (undefined ***)*plVar7;
            if ((undefined *)*plVar7 == (undefined *)0x0) {
              local_190 = (undefined ***)PTR_DAT_1402f8010;
            }
            local_198 = (undefined4 *)*plVar8;
            if ((undefined *)*plVar8 == (undefined *)0x0) {
              local_198 = (undefined4 *)PTR_DAT_1402f8010;
            }
            puVar12 = (undefined *)*plVar9;
            if ((undefined *)*plVar9 == (undefined *)0x0) {
              puVar12 = PTR_DAT_1402f8010;
            }
            FUN_140177c40(param_1,1,L"HolepunchAck OK. ABS=%s ABR=%s BAS=%s BAR=%s",puVar12);
            if (((local_110 != (undefined *)0x0) && (local_110 != PTR_DAT_1402f8010)) &&
               (local_110 + -8 != (undefined *)0x0)) {
              uVar10 = FUN_1400a3440();
              local_f0 = uVar10;
              FUN_1400a1c30(uVar10);
              local_e8 = 1;
              piVar1 = (int *)(local_110 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(local_110 + -8);
              }
              FUN_1400d1290(uVar10);
            }
            local_110 = PTR_DAT_1402f8010;
            if (((local_128 != (undefined *)0x0) && (local_128 != PTR_DAT_1402f8010)) &&
               (local_128 + -8 != (undefined *)0x0)) {
              uVar10 = FUN_1400a3440();
              local_e0 = uVar10;
              FUN_1400a1c30(uVar10);
              local_d8 = 1;
              piVar1 = (int *)(local_128 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(local_128 + -8);
              }
              FUN_1400d1290(uVar10);
            }
            local_128 = PTR_DAT_1402f8010;
            if (((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1402f8010)) &&
               (local_118 + -8 != (undefined *)0x0)) {
              uVar10 = FUN_1400a3440();
              local_c8 = uVar10;
              FUN_1400a1c30(uVar10);
              local_c0 = 1;
              piVar1 = (int *)(local_118 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(local_118 + -8);
              }
              FUN_1400d1290(uVar10);
            }
            if (((local_f8 != (undefined *)0x0) && (local_f8 != PTR_DAT_1402f8010)) &&
               (local_f8 + -8 != (undefined *)0x0)) {
              local_118 = PTR_DAT_1402f8010;
              uVar10 = FUN_1400a3440();
              local_b8 = uVar10;
              FUN_1400a1c30(uVar10);
              local_b0 = 1;
              piVar1 = (int *)(local_f8 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_1400a3530(local_f8 + -8);
              }
              FUN_1400d1290(uVar10);
            }
          }
        }
      }
    }
  }
  return;
}



void FUN_1401ba950(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  double dVar1;
  undefined8 uVar2;
  undefined8 local_res8;
  
  *(undefined1 *)(param_1 + 0x25) = DAT_14030afb8;
  *(bool *)(param_1 + 0x21) = *(int *)(param_2 + 0x6b0) == 1;
  *(undefined1 *)(param_1 + 0x22) = 0;
  *(undefined1 *)(param_1 + 0x24) = 0;
  local_res8 = 0;
  FUN_140176e00(param_1 + 0x28,&local_res8,param_3,param_4,0xfffffffffffffffe);
  *(undefined1 *)(param_1 + 0x20) = 0;
  *(undefined1 *)(param_1 + 0x23) = 0;
  *(undefined8 *)(param_1 + 0x158) = 0;
  *(undefined8 *)(param_1 + 0x160) = 0;
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined4 *)(param_1 + 0x598) = DAT_1402f83d0;
  *(undefined2 *)(param_1 + 0x59c) = DAT_1402f83d4;
  *(undefined4 *)(param_1 + 0x5a8) = DAT_1402f83d0;
  *(undefined2 *)(param_1 + 0x5ac) = DAT_1402f83d4;
  *(undefined4 *)(param_1 + 0x578) = DAT_1402f83d0;
  *(undefined2 *)(param_1 + 0x57c) = DAT_1402f83d4;
  *(undefined4 *)(param_1 + 0x588) = DAT_1402f83d0;
  *(undefined2 *)(param_1 + 0x58c) = DAT_1402f83d4;
  *(longlong *)(param_1 + 0x670) = param_2;
  *(undefined1 *)(param_1 + 0x608) = 1;
  *(undefined8 *)(param_1 + 0x610) = 0;
  dVar1 = (double)FUN_1400ad590(param_2 + 0xb08);
  *(double *)(param_1 + 0x148) = (DAT_1402f80f0 - DAT_1402f80f0 * 0.5) * dVar1 + DAT_1402f80f0 * 0.5
  ;
  *(undefined8 *)(param_1 + 0x150) = 0;
  uVar2 = (**(code **)(*(longlong *)(param_2 + 0x70) + 0x1c0))();
  *(undefined8 *)(param_1 + 0xc0) = uVar2;
  *(undefined4 *)(param_1 + 0x100) = 0;
  *(undefined8 *)(param_1 + 0x140) = 0xbff0000000000000;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined4 *)(param_1 + 0x58) = 0;
  *(undefined8 *)(param_1 + 0x80) = 0;
  *(undefined4 *)(param_1 + 0x568) = 0;
  *(undefined4 *)(param_1 + 0x61c) = 0;
  *(undefined8 *)(param_1 + 0x620) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined4 *)(param_1 + 0x48) = 0;
  *(undefined8 *)(param_1 + 0x628) = 0;
  *(undefined8 *)(param_1 + 0x630) = 0;
  *(undefined8 *)(param_1 + 0x678) = 0;
  uVar2 = FUN_1401b8990(param_1);
  *(undefined8 *)(param_1 + 0x88) = uVar2;
  *(undefined8 *)(param_1 + 0x658) = 0;
  *(undefined8 *)(param_1 + 0x660) = 0;
  *(undefined1 *)(param_1 + 0x618) = 1;
  return;
}



longlong FUN_1401bab20(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  void *pvVar2;
  undefined8 *puVar3;
  longlong *plVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong *local_res8;
  void *local_res10;
  undefined8 uVar7;
  
  uVar7 = 0xfffffffffffffffe;
  plVar4 = operator_new(0x18);
  plVar5 = (longlong *)0x0;
  local_res8 = plVar4;
  if (plVar4 != (longlong *)0x0) {
    plVar4[2] = 0;
    plVar4[1] = 0;
    *plVar4 = param_1;
    local_res10 = operator_new(0x30);
    if (local_res10 != (void *)0x0) {
      plVar5 = (longlong *)FUN_1401b87b0(local_res10);
    }
    plVar4[2] = (longlong)plVar5;
    plVar5 = plVar4;
  }
  if (plVar5 == (longlong *)0x0) {
    local_res8 = (longlong *)0x0;
  }
  else {
    local_res8 = (longlong *)FUN_1400a34c0(0x10);
    local_res8[1] = 1;
    *local_res8 = (longlong)plVar5;
  }
  plVar5 = local_res8;
  lVar6 = FUN_140176e00(param_1 + 0x28,&local_res8,param_3,param_4,uVar7);
  plVar4 = local_res8;
  if (plVar5 != (longlong *)0x0) {
    plVar1 = plVar5 + 1;
    *plVar1 = *plVar1 + -1;
    lVar6 = plVar5[1];
    if (*plVar1 == 0) {
      pvVar2 = (void *)*local_res8;
      if (pvVar2 != (void *)0x0) {
        puVar3 = *(undefined8 **)((longlong)pvVar2 + 0x10);
        if (puVar3 != (undefined8 *)0x0) {
          (**(code **)*puVar3)(puVar3,1);
        }
        operator_delete(pvVar2);
      }
      lVar6 = FUN_1400a3530(plVar4);
    }
  }
  return lVar6;
}



void FUN_1401bac10(longlong param_1,char param_2,int param_3)

{
  int *piVar1;
  double dVar2;
  int iVar3;
  undefined8 uVar4;
  undefined8 *puVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong lVar8;
  longlong lVar9;
  longlong lVar10;
  undefined *puVar11;
  undefined *puVar12;
  undefined *puVar13;
  int iVar14;
  bool bVar15;
  double dVar16;
  double dVar17;
  double dVar18;
  undefined1 local_res8 [8];
  int local_res18 [2];
  undefined *local_res20;
  undefined8 in_stack_fffffffffffffeb8;
  undefined4 uVar19;
  undefined *local_e8;
  undefined *local_e0;
  undefined *local_d8;
  undefined *local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined1 local_b0;
  undefined8 local_a8;
  undefined1 local_a0;
  undefined8 local_98;
  undefined1 local_90;
  undefined8 local_88;
  undefined1 local_80;
  undefined8 local_78;
  undefined1 local_70;
  undefined1 local_68 [48];
  
  uVar19 = (undefined4)((ulonglong)in_stack_fffffffffffffeb8 >> 0x20);
  local_c0 = 0xfffffffffffffffe;
  if (*(char *)(param_1 + 0x608) == '\0') {
    local_res18[0] = param_3;
    if (((param_2 != '\0') && (param_3 != 0x1d)) &&
       ((lVar8 = *(longlong *)(param_1 + 0x670), *(char *)(lVar8 + 0x1790) != '\0' ||
        (*(int *)(lVar8 + 0x6c8) != 0)))) {
      local_res8[0] = 0;
      (**(code **)(*(longlong *)(lVar8 + 0x70) + 0x158))((longlong *)(lVar8 + 0x70),local_res8);
      bVar15 = *(int *)(param_1 + 0x588) != *(int *)(param_1 + 0x578);
      FUN_1401767b0(*(undefined8 *)(param_1 + 0x670),&local_e0);
      dVar16 = (double)(**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x670) + 0x70) + 0x1c0))()
      ;
      dVar18 = *(double *)(param_1 + 0x610);
      if ((*(longlong **)(param_1 + 0x18) == (longlong *)0x0) ||
         (lVar8 = **(longlong **)(param_1 + 0x18), lVar8 == 0)) {
        lVar8 = 0;
      }
      else {
        lVar8 = lVar8 + -0x40;
      }
      dVar17 = (double)(**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x670) + 0x70) + 0x1c0))()
      ;
      dVar2 = *(double *)(lVar8 + 0x180);
      iVar14 = 1;
      if (!bVar15) {
        iVar14 = 2;
      }
      plVar7 = (longlong *)(*(longlong *)(param_1 + 0x670) + 0x70);
      plVar7 = (longlong *)(**(code **)(*plVar7 + 0xb0))(plVar7,&local_d8);
      puVar11 = (undefined *)*plVar7;
      if (puVar11 == (undefined *)0x0) {
        iVar3 = 0;
      }
      else if (puVar11 == PTR_DAT_1402f8010) {
        iVar3 = 0;
      }
      else {
        iVar3 = *(int *)(puVar11 + -8);
      }
      if (((local_d8 != (undefined *)0x0) && (local_d8 != PTR_DAT_1402f8010)) &&
         (local_d8 + -8 != (undefined *)0x0)) {
        uVar4 = FUN_1400a3440();
        local_78 = uVar4;
        FUN_1400a1c30(uVar4);
        local_70 = 1;
        piVar1 = (int *)(local_d8 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_d8 + -8);
        }
        FUN_1400d1290(uVar4);
      }
      if (iVar3 != 0) {
        iVar14 = iVar14 + 1;
      }
      FUN_1400a3440();
      local_e8 = PTR_DAT_1402f8010;
      puVar5 = (undefined8 *)FUN_140169f40(*(undefined8 *)(param_1 + 0x670),local_68);
      plVar7 = (longlong *)FUN_1400a3170(&local_d0);
      plVar6 = (longlong *)(**(code **)*puVar5)(puVar5);
      puVar11 = (undefined *)*plVar7;
      if ((undefined *)*plVar7 == (undefined *)0x0) {
        puVar11 = PTR_DAT_1402f8010;
      }
      puVar12 = local_e0;
      if (local_e0 == (undefined *)0x0) {
        puVar12 = PTR_DAT_1402f8010;
      }
      puVar13 = (undefined *)*plVar6;
      if ((undefined *)*plVar6 == (undefined *)0x0) {
        puVar13 = PTR_DAT_1402f8010;
      }
      lVar8 = *(longlong *)(*(longlong *)(param_1 + 0x670) + 0x5d8);
      lVar10 = 0;
      if (lVar8 != 0) {
        lVar10 = *(longlong *)(lVar8 + 0x38);
      }
      lVar8 = *(longlong *)(*(longlong *)(param_1 + 0x670) + 0x5d8);
      if (lVar8 == 0) {
        lVar9 = 0;
        lVar8 = 0;
      }
      else {
        lVar9 = *(longlong *)(lVar8 + 0x38);
        lVar8 = *(longlong *)(lVar8 + 0x38);
      }
      FUN_14003c600(&local_e8,
                    L"(first chance) to-peer client %d UDP punch lost##Reason:%d##CliInstCount=%d##RecentElapTime=%3.3f##DisconnedCount=%d##recv count=%d##last ok recv interval=%3.3f##Recurred:%d##LocalIP:%s##Remote peer behind NAT:%d##UDP kept time:%3.3f##Time diff since last RecvIssue:%3.3f##%s##Process=%s"
                    ,*(undefined4 *)(param_1 + 0x56c),local_res18[0],
                    CONCAT44(uVar19,*(undefined4 *)(lVar8 + 0x2a8)),*(undefined8 *)(lVar9 + 0x180),
                    *(undefined4 *)(lVar10 + 0x288),*(undefined4 *)(param_1 + 0x100),
                    *(undefined8 *)(param_1 + 0x140),*(undefined4 *)(param_1 + 0x61c),puVar13,bVar15
                    ,dVar16 - dVar18,dVar17 - dVar2,puVar12,puVar11);
      if (((local_res20 != (undefined *)0x0) && (local_res20 != PTR_DAT_1402f8010)) &&
         (local_res20 + -8 != (undefined *)0x0)) {
        uVar4 = FUN_1400a3440();
        local_98 = uVar4;
        FUN_1400a1c30(uVar4);
        local_90 = 1;
        piVar1 = (int *)(local_res20 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_res20 + -8);
        }
        FUN_1400d1290(uVar4);
      }
      local_res20 = PTR_DAT_1402f8010;
      if (((local_d0 != (undefined *)0x0) && (local_d0 != PTR_DAT_1402f8010)) &&
         (local_d0 + -8 != (undefined *)0x0)) {
        uVar4 = FUN_1400a3440();
        local_b8 = uVar4;
        FUN_1400a1c30(uVar4);
        local_b0 = 1;
        piVar1 = (int *)(local_d0 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_d0 + -8);
        }
        FUN_1400d1290(uVar4);
      }
      puVar11 = local_e8;
      FUN_140178190(*(undefined8 *)(param_1 + 0x670),iVar14,&DAT_140271f08,local_e8);
      if (((puVar11 != (undefined *)0x0) && (puVar11 != PTR_DAT_1402f8010)) &&
         (puVar11 + -8 != (undefined *)0x0)) {
        uVar4 = FUN_1400a3440();
        local_a8 = uVar4;
        FUN_1400a1c30(uVar4);
        local_a0 = 1;
        piVar1 = (int *)(puVar11 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(puVar11 + -8);
        }
        FUN_1400d1290(uVar4);
      }
      if (((local_e0 != (undefined *)0x0) && (local_e0 != PTR_DAT_1402f8010)) &&
         (local_e0 + -8 != (undefined *)0x0)) {
        uVar4 = FUN_1400a3440();
        local_88 = uVar4;
        FUN_1400a1c30(uVar4);
        local_80 = 1;
        piVar1 = (int *)(local_e0 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_1400a3530(local_e0 + -8);
        }
        FUN_1400d1290(uVar4);
      }
    }
    if (*(char *)(param_1 + 0x608) == '\0') {
      *(undefined1 *)(param_1 + 0x618) = 1;
    }
    *(undefined1 *)(param_1 + 0x608) = 1;
    if (*(longlong *)(param_1 + 0x640) != 0) {
      *(undefined8 *)(*(longlong *)(param_1 + 0x640) + 0xd8) = 0;
    }
    if (param_2 != '\0') {
      plVar7 = (longlong *)(*(longlong *)(param_1 + 0x670) + 0x1818);
      (**(code **)(*plVar7 + 0x40))(plVar7,1,&DAT_140318cf0,param_1 + 0x56c,local_res18);
    }
    local_c8 = 0;
    FUN_140176e00(param_1 + 0x28,&local_c8);
    if (local_res18[0] != 0x1d) {
      FUN_140184af0(*(undefined8 *)(param_1 + 0x670),*(undefined4 *)(param_1 + 0x56c));
    }
    if (*(int *)(param_1 + 0x61c) < DAT_1402f8088) {
      *(int *)(param_1 + 0x61c) = *(int *)(param_1 + 0x61c) + 1;
      dVar18 = (double)(**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x670) + 0x70) + 0x1c0))()
      ;
      *(double *)(param_1 + 0x620) = dVar18 + DAT_140314010;
    }
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401bb120(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *local_res8;
  undefined8 local_res10;
  undefined8 local_res18 [2];
  undefined8 uVar7;
  undefined **local_40;
  int local_38;
  undefined2 local_34;
  
  uVar7 = 0xfffffffffffffffe;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x670) + 0x78) + 0x10))();
  if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) && (**(longlong **)(param_1 + 0x18) != 0))
  {
    return;
  }
  if (*(char *)(param_1 + 0x23) == '\0') {
    return;
  }
  lVar4 = FUN_140169e30(*(undefined8 *)(param_1 + 0x670));
  if (lVar4 == 0) {
    return;
  }
  *(undefined1 *)(param_1 + 0x23) = 0;
  lVar4 = 0;
  if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) &&
     (lVar5 = **(longlong **)(param_1 + 0x18), lVar5 != 0)) {
    if (*(char *)(lVar5 + 0x40) == '\0') {
      lVar5 = lVar4;
      if (*(longlong **)(param_1 + 0x18) != (longlong *)0x0) {
        lVar5 = **(longlong **)(param_1 + 0x18);
      }
      if (*(char *)(lVar5 + 0x80) == '\0') goto LAB_1401bb1bb;
    }
    _DAT_00000000 = 1;
  }
LAB_1401bb1bb:
  if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) && (**(longlong **)(param_1 + 0x18) != 0))
  {
    local_res10 = 0;
    FUN_14016b650(&local_res10,param_1 + 0x18);
    FUN_14017a4d0(*(undefined8 *)(param_1 + 0x670),&local_res10);
    local_res18[0] = 0;
    FUN_14016b650(param_1 + 0x18,local_res18);
  }
  local_res8 = operator_new(0x1c0);
  lVar5 = lVar4;
  if (local_res8 != (longlong *)0x0) {
    lVar5 = FUN_1401bcab0(local_res8,*(undefined8 *)(param_1 + 0x670),param_1,param_4,uVar7);
  }
  if ((lVar5 == 0) || (lVar5 + 0x40 == 0)) {
    local_res8 = (longlong *)0x0;
  }
  else {
    local_res8 = (longlong *)FUN_1400a34c0(0x10);
    local_res8[1] = 1;
    *local_res8 = lVar5 + 0x40;
  }
  plVar1 = local_res8;
  FUN_14016b650(param_1 + 0x18,&local_res8);
  plVar3 = local_res8;
  if (plVar1 != (longlong *)0x0) {
    plVar1 = plVar1 + 1;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      puVar2 = (undefined8 *)*local_res8;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      FUN_1400a3530(plVar3);
    }
  }
  lVar5 = FUN_140169e50(*(undefined8 *)(param_1 + 0x670));
  local_38 = *(int *)(lVar5 + 0x118);
  if ((local_38 == 0) || (local_38 == -1)) {
    FUN_1400a2b50(&DAT_140256390);
  }
  local_40 = Proud::AddrPort::vftable;
  local_34 = 0;
  if ((*(longlong **)(param_1 + 0x18) == (longlong *)0x0) ||
     (lVar5 = **(longlong **)(param_1 + 0x18), lVar6 = lVar5 + -0x40, lVar5 == 0)) {
    lVar6 = lVar4;
  }
  FUN_1401bce90(lVar6,&local_40);
  if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) &&
     (lVar5 = **(longlong **)(param_1 + 0x18), lVar5 != 0)) {
    lVar4 = lVar5 + -0x40;
  }
  FUN_1401bc490(lVar4);
  FUN_1401bab20(param_1);
  return;
}



void FUN_1401bb340(longlong param_1,longlong param_2)

{
  uint uVar1;
  uint uVar2;
  longlong lVar3;
  ulonglong uVar4;
  char cVar5;
  uint *puVar6;
  uint *puVar7;
  uint local_res8 [2];
  
  *(undefined4 *)(param_2 + 0x20) = *(undefined4 *)(param_1 + 0x56c);
  *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_1 + 0x578);
  *(undefined2 *)(param_2 + 0xc) = *(undefined2 *)(param_1 + 0x57c);
  *(undefined4 *)(param_2 + 0x18) = *(undefined4 *)(param_1 + 0x588);
  *(undefined2 *)(param_2 + 0x1c) = *(undefined2 *)(param_1 + 0x58c);
  *(undefined8 *)(param_2 + 0x88) = *(undefined8 *)(param_1 + 0x50);
  *(undefined4 *)(param_2 + 0x90) = *(undefined4 *)(param_1 + 0x58);
  if (*(longlong *)(param_1 + 0x5d0) == 0) {
    puVar7 = (uint *)0x0;
  }
  else {
    puVar7 = *(uint **)(param_1 + 0x5c0);
  }
  do {
    if (puVar7 == (uint *)0x0) {
      *(undefined1 *)(param_2 + 0x24) = *(undefined1 *)(param_1 + 0x608);
      *(bool *)(param_2 + 0x80) = *(int *)(param_1 + 0x588) != *(int *)(param_1 + 0x578);
      *(undefined8 *)(param_2 + 0x98) = *(undefined8 *)(param_1 + 0x678);
      *(undefined8 *)(param_2 + 0xa0) = *(undefined8 *)(param_1 + 0x160);
      *(undefined4 *)(param_2 + 0xa8) = *(undefined4 *)(param_1 + 0x40);
      *(undefined4 *)(param_2 + 0xac) = *(undefined4 *)(param_1 + 0x44);
      return;
    }
    uVar1 = *puVar7;
    uVar2 = *(uint *)(param_2 + 0x50);
    lVar3 = *(longlong *)(param_2 + 0x30);
    uVar4 = (ulonglong)uVar1 % (ulonglong)uVar2;
    local_res8[0] = uVar1;
    if (lVar3 == 0) {
LAB_1401bb42e:
      cVar5 = FUN_140144560(param_2 + 0x28,(ulonglong)uVar2,
                            CONCAT71((int7)((ulonglong)lVar3 >> 8),1));
      if (cVar5 == '\0') {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x8007000e);
      }
    }
    else {
      for (puVar6 = *(uint **)(lVar3 + uVar4 * 8);
          (puVar6 != (uint *)0x0 && ((uint)uVar4 == puVar6[6] % uVar2));
          puVar6 = *(uint **)(puVar6 + 2)) {
        if (*puVar6 == uVar1) goto LAB_1401bb46e;
      }
      if (lVar3 == 0) goto LAB_1401bb42e;
      for (puVar6 = *(uint **)(lVar3 + uVar4 * 8);
          (puVar6 != (uint *)0x0 && ((uint)uVar4 == puVar6[6] % uVar2));
          puVar6 = *(uint **)(puVar6 + 2)) {
        if (*puVar6 == uVar1) goto LAB_1401bb46a;
      }
      if (lVar3 == 0) goto LAB_1401bb42e;
    }
    FUN_140193d80(param_2 + 0x28);
    puVar6 = (uint *)FUN_140146360(param_2 + 0x28,local_res8,uVar4,uVar1);
    FUN_140193d80(param_2 + 0x28);
LAB_1401bb46a:
    *(undefined1 *)(puVar6 + 1) = 0;
LAB_1401bb46e:
    puVar7 = *(uint **)(puVar7 + 4);
  } while( true );
}



// WARNING: Type propagation algorithm not settling
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401bb4f0(longlong param_1,double param_2)

{
  undefined *puVar1;
  int *piVar2;
  double *pdVar3;
  undefined *puVar4;
  char cVar5;
  int iVar6;
  longlong *plVar7;
  longlong lVar8;
  longlong lVar9;
  undefined8 uVar10;
  double dVar11;
  float local_res8 [2];
  undefined *local_res10;
  double local_res18 [2];
  undefined8 local_a8;
  undefined8 local_a0;
  undefined1 local_98 [8];
  undefined **local_90;
  undefined4 local_88;
  undefined2 local_84;
  undefined8 local_80;
  undefined1 local_78;
  undefined **local_70;
  undefined8 local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  
  local_a0 = 0xfffffffffffffffe;
  if (DAT_1402f8058 < param_2 - *(double *)(param_1 + 0x658)) {
    FUN_1401bd3f0(param_1 + 0x638);
    *(double *)(param_1 + 0x658) = param_2;
  }
  iVar6 = *(int *)(*(longlong *)(param_1 + 0x670) + 0x6a0);
  if ((((iVar6 != 1) && (iVar6 != 3)) && (iVar6 != 2)) &&
     ((*(char *)(param_1 + 0x25) != '\0' && (*(char *)(param_1 + 0x24) != '\0')))) {
    if (((*(longlong **)(param_1 + 0x18) == (longlong *)0x0) ||
        (**(longlong **)(param_1 + 0x18) == 0)) &&
       (((dVar11 = (double)(**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x670) + 0x70) + 0x1c0
                                       ))(),
         *(double *)(param_1 + 0x88) <= dVar11 && dVar11 != *(double *)(param_1 + 0x88) &&
         (*(char *)(param_1 + 0x21) != '\0')) && (*(char *)(param_1 + 0x22) == '\0')))) {
      *(undefined1 *)(param_1 + 0x22) = 1;
      plVar7 = (longlong *)(*(longlong *)(param_1 + 0x670) + 0x1818);
      (**(code **)(*plVar7 + 0xe0))(plVar7,1,&DAT_140318cf0,param_1 + 0x56c);
    }
    FUN_1401b8c20(param_1);
    FUN_1401bb120(param_1);
  }
  lVar9 = 0;
  if (((*(longlong **)(param_1 + 0x28) != (longlong *)0x0) && (**(longlong **)(param_1 + 0x28) != 0)
      ) && (cVar5 = FUN_1401b9900(), cVar5 == '\0')) {
    local_res18[1] = 0.0;
    FUN_140176e00(param_1 + 0x28,local_res18 + 1);
  }
  if (_DAT_1402f8170 < param_2 - *(double *)(param_1 + 0x660)) {
    local_res18[0] = 0.0;
    (**(code **)(**(longlong **)(param_1 + 0x670) + 0xd8))
              (*(longlong **)(param_1 + 0x670),local_res18);
    local_res8[0] = (float)local_res18[0];
    local_a8 = FUN_1400ad790(*(longlong *)(param_1 + 0x670) + 0x1620);
    plVar7 = (longlong *)(*(longlong *)(param_1 + 0x670) + 0x17d0);
    (**(code **)(*plVar7 + 0x50))
              (plVar7,*(undefined4 *)(param_1 + 0x56c),&DAT_140318cf0,&local_a8,local_res8);
    *(double *)(param_1 + 0x660) = param_2;
  }
  if (*(char *)(param_1 + 0x608) == '\0') {
    if (param_2 - *(double *)(param_1 + 0xc0) <= DAT_1402f80f0 * 10.0) {
      if (*(char *)(param_1 + 0x608) != '\0') goto LAB_1401bb71a;
      if ((*(longlong *)(param_1 + 0x640) != 0) &&
         (dVar11 = *(double *)(*(longlong *)(param_1 + 0x640) + 0xd8),
         pdVar3 = (double *)(*(longlong *)(param_1 + 0x670) + 0x6a8),
         *pdVar3 <= dVar11 && dVar11 != *pdVar3)) {
        uVar10 = 0x1b;
        goto LAB_1401bb707;
      }
    }
    else {
      uVar10 = 0x1a;
LAB_1401bb707:
      FUN_1401bac10(param_1,1,uVar10);
    }
    if (*(char *)(param_1 + 0x608) == '\0') goto LAB_1401bb76b;
  }
LAB_1401bb71a:
  if (((0.0 < *(double *)(param_1 + 0x620)) && (*(double *)(param_1 + 0x620) < param_2)) &&
     ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0 &&
      (lVar8 = **(longlong **)(param_1 + 0x18), lVar8 != 0)))) {
    plVar7 = *(longlong **)(lVar8 + 0xc0);
    lVar8 = lVar9;
    if (plVar7 != (longlong *)0x0) {
      lVar8 = *plVar7;
    }
    cVar5 = FUN_1400a8b50(lVar8);
    if (cVar5 == '\0') {
      *(undefined8 *)(param_1 + 0x620) = 0;
      FUN_1401bab20(param_1);
    }
  }
LAB_1401bb76b:
  plVar7 = *(longlong **)(param_1 + 0x18);
  if (((plVar7 != (longlong *)0x0) && (*plVar7 != 0)) &&
     (_DAT_1402f81b8 < param_2 - *(double *)(param_1 + 0x628))) {
    local_90 = Proud::AddrPort::vftable;
    local_88 = *(undefined4 *)(param_1 + 0x598);
    local_84 = *(undefined2 *)(param_1 + 0x59c);
    if (*plVar7 != 0) {
      lVar9 = *plVar7 + -0x40;
    }
    iVar6 = FUN_14019cd60(*(undefined8 *)(lVar9 + 0x108),&local_90);
    if (*(double *)(param_1 + 0x630) == 0.0) {
      if (DAT_1402f8194 < iVar6) {
        *(double *)(param_1 + 0x630) = param_2;
      }
    }
    else if (DAT_1402f8194 < iVar6) {
      if (_DAT_1402f81b0 < param_2 - *(double *)(param_1 + 0x630)) {
        *(double *)(param_1 + 0x630) = param_2;
        FUN_1400a3440();
        local_res10 = PTR_DAT_1402f8010;
        FUN_14003c600(&local_res10,L"sendQueue %dBytes",iVar6);
        local_68 = 0;
        local_60 = 0;
        local_58 = 0;
        local_50 = 0;
        local_70 = Proud::ByteArray::vftable;
        uVar10 = FUN_1401416a0(local_98,0x25,*(undefined4 *)(param_1 + 0x56c),&local_res10,&local_70
                              );
        (**(code **)(**(longlong **)(param_1 + 0x670) + 0x88))
                  (*(longlong **)(param_1 + 0x670),uVar10);
        FUN_140140df0(&local_70);
        puVar4 = local_res10;
        if (((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1402f8010)) &&
           (puVar1 = local_res10 + -8, puVar1 != (undefined *)0x0)) {
          uVar10 = FUN_1400a3440();
          local_80 = uVar10;
          FUN_1400a1c30(uVar10);
          local_78 = 1;
          piVar2 = (int *)(puVar4 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_1400a3530(puVar1);
          }
          FUN_1400d1290(uVar10);
        }
      }
    }
    else {
      *(undefined8 *)(param_1 + 0x630) = 0;
    }
    *(double *)(param_1 + 0x628) = param_2;
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_1401bb930(longlong param_1,ushort param_2)

{
  longlong *plVar1;
  uint uVar2;
  ushort *puVar3;
  undefined8 *puVar4;
  ulonglong uVar5;
  longlong *plVar6;
  char cVar7;
  longlong lVar8;
  undefined8 uVar9;
  longlong lVar10;
  longlong lVar11;
  longlong *local_res8;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined8 local_48;
  undefined8 local_40;
  undefined **local_38;
  int local_30;
  ushort local_2c;
  
  local_40 = 0xfffffffffffffffe;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x670) + 0x78) + 0x10))();
  lVar11 = 0;
  if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) &&
     (lVar8 = **(longlong **)(param_1 + 0x18), lVar8 != 0)) {
    if (*(char *)(lVar8 + 0x40) == '\0') {
      lVar8 = lVar11;
      if (*(longlong **)(param_1 + 0x18) != (longlong *)0x0) {
        lVar8 = **(longlong **)(param_1 + 0x18);
      }
      if (*(char *)(lVar8 + 0x80) == '\0') goto LAB_1401bb99e;
    }
    _DAT_00000000 = 1;
  }
LAB_1401bb99e:
  if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) && (**(longlong **)(param_1 + 0x18) != 0))
  {
    local_res18 = 0;
    FUN_14016b650(&local_res18,param_1 + 0x18);
    FUN_14017a4d0(*(undefined8 *)(param_1 + 0x670),&local_res18);
    local_res20 = 0;
    FUN_14016b650(param_1 + 0x18);
  }
  *(undefined8 *)(param_1 + 0x628) = 0;
  *(undefined8 *)(param_1 + 0x630) = 0;
  uVar2 = *(uint *)(*(longlong *)(param_1 + 0x670) + 0x1748);
  uVar5 = (ulonglong)param_2 % (ulonglong)uVar2;
  lVar8 = *(longlong *)(*(longlong *)(param_1 + 0x670) + 0x1728);
  if (lVar8 != 0) {
    for (puVar3 = *(ushort **)(lVar8 + uVar5 * 8);
        (puVar3 != (ushort *)0x0 && ((uint)uVar5 == *(uint *)(puVar3 + 0x10) % uVar2));
        puVar3 = *(ushort **)(puVar3 + 8)) {
      if (*puVar3 == param_2) {
        FUN_14016b650(param_1 + 0x18);
        lVar8 = lVar11;
        if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) &&
           (lVar10 = **(longlong **)(param_1 + 0x18), lVar10 != 0)) {
          lVar8 = lVar10 + -0x40;
        }
        *(undefined8 *)(lVar8 + 0x148) = 0;
        if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) &&
           (lVar8 = **(longlong **)(param_1 + 0x18), lVar8 != 0)) {
          lVar11 = lVar8 + -0x40;
        }
        *(longlong *)(lVar11 + 0x120) = param_1;
        lVar11 = *(longlong *)(param_1 + 0x670);
        uVar5 = (ulonglong)param_2 % (ulonglong)*(uint *)(lVar11 + 0x1748);
        if (*(longlong *)(lVar11 + 0x1728) == 0) goto LAB_1401bbc42;
        puVar3 = *(ushort **)(*(longlong *)(lVar11 + 0x1728) + uVar5 * 8);
        goto joined_r0x0001401bbae0;
      }
    }
  }
  local_res8 = operator_new(0x1c0);
  lVar8 = lVar11;
  if (local_res8 != (longlong *)0x0) {
    lVar8 = FUN_1401bcab0(local_res8,*(undefined8 *)(param_1 + 0x670),param_1);
  }
  if ((lVar8 == 0) || (lVar8 + 0x40 == 0)) {
    local_res8 = (longlong *)0x0;
  }
  else {
    local_res8 = (longlong *)FUN_1400a34c0(0x10);
    local_res8[1] = 1;
    *local_res8 = lVar8 + 0x40;
  }
  plVar1 = local_res8;
  FUN_14016b650(param_1 + 0x18,&local_res8);
  plVar6 = local_res8;
  if (plVar1 != (longlong *)0x0) {
    plVar1 = plVar1 + 1;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      puVar4 = (undefined8 *)*local_res8;
      if (puVar4 != (undefined8 *)0x0) {
        (**(code **)*puVar4)(puVar4,1);
      }
      FUN_1400a3530(plVar6);
    }
  }
  lVar8 = FUN_140169e50(*(undefined8 *)(param_1 + 0x670));
  local_30 = *(int *)(lVar8 + 0x118);
  if ((local_30 == 0) || (local_30 == -1)) {
    FUN_1400a2b50(&DAT_140256390);
  }
  local_38 = Proud::AddrPort::vftable;
  if ((*(longlong **)(param_1 + 0x18) == (longlong *)0x0) ||
     (lVar8 = **(longlong **)(param_1 + 0x18), lVar10 = lVar8 + -0x40, lVar8 == 0)) {
    lVar10 = lVar11;
  }
  local_2c = param_2;
  cVar7 = FUN_1401bce90(lVar10,&local_38);
  if (cVar7 == '\0') {
    local_48 = 0;
    FUN_14016b650(param_1 + 0x18,&local_48);
    uVar9 = 0;
  }
  else {
LAB_1401bbc42:
    uVar9 = 1;
  }
  return uVar9;
joined_r0x0001401bbae0:
  if ((puVar3 == (ushort *)0x0) ||
     ((uint)uVar5 != *(uint *)(puVar3 + 0x10) % *(uint *)(lVar11 + 0x1748))) goto LAB_1401bbc42;
  if (*puVar3 == param_2) {
    FUN_140177260(lVar11 + 0x1720,puVar3,0);
    goto LAB_1401bbc42;
  }
  puVar3 = *(ushort **)(puVar3 + 8);
  goto joined_r0x0001401bbae0;
}



void FUN_1401bbc60(longlong *param_1,longlong param_2)

{
  longlong *plVar1;
  
  if (*(longlong *)(param_2 + 0x30) != 0) {
    plVar1 = (longlong *)(*(longlong *)(param_2 + 0x30) + 8);
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      FUN_140148f80((undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x30));
    }
  }
  FUN_14019a730(param_2 + 0x18);
  if (*(longlong *)(param_2 + 0x20) != 0) {
    if (*(int *)(param_2 + 0x2c) < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(undefined4 *)(param_2 + 0x28) = 0;
  }
  plVar1 = (longlong *)*param_1;
  if (plVar1 == (longlong *)0x0) {
    FUN_1400a3530(param_2);
  }
  else {
    (**(code **)(*plVar1 + 0x10))(plVar1,param_2);
  }
  param_1[3] = param_1[3] + -1;
  return;
}



void FUN_1401bbcf0(longlong *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong *plVar4;
  
  lVar2 = param_1[3];
  while( true ) {
    if (lVar2 == 0) {
      param_1[1] = 0;
      param_1[2] = 0;
      return;
    }
    plVar3 = (longlong *)param_1[1];
    if (plVar3 == (longlong *)0x0) break;
    plVar4 = plVar3 + 6;
    param_1[1] = *plVar3;
    if (*plVar4 != 0) {
      plVar1 = (longlong *)(*plVar4 + 8);
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_140148f80(plVar4,*plVar4);
      }
    }
    FUN_14019a730(plVar3 + 3);
    if (plVar3[4] != 0) {
      if (*(int *)((longlong)plVar3 + 0x2c) < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      *(undefined4 *)(plVar3 + 5) = 0;
    }
    plVar4 = (longlong *)*param_1;
    if (plVar4 == (longlong *)0x0) {
      FUN_1400a3530(plVar3);
    }
    else {
      (**(code **)(*plVar4 + 0x10))(plVar4,plVar3);
    }
    param_1[3] = param_1[3] + -1;
    lVar2 = param_1[3];
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



void FUN_1401bbdb0(longlong *param_1)

{
  undefined8 *puVar1;
  
  FUN_1401bbcf0();
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  return;
}



void FUN_1401bbde0(longlong param_1)

{
  undefined8 *puVar1;
  
  FUN_1401bbcf0(param_1 + 0x90);
  puVar1 = *(undefined8 **)(param_1 + 0x90);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_1401bbcf0(param_1 + 0x70);
  puVar1 = *(undefined8 **)(param_1 + 0x70);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_1401c1130(param_1 + 0x30);
  return;
}



void FUN_1401bbe40(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  longlong *plVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  FUN_1401c1130(param_1 + 0x60);
  FUN_1401bbcf0(param_1 + 0x40);
  puVar1 = *(undefined8 **)(param_1 + 0x40);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  *(undefined ***)(param_1 + 0x18) = Proud::CFastArray<>::vftable;
  if (*(longlong *)(param_1 + 0x28) != 0) {
    plVar2 = *(longlong **)(param_1 + 0x20);
    if (plVar2 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar2 + 0x18))(plVar2,*(longlong *)(param_1 + 0x28),plVar2,param_4,uVar3);
    }
  }
  return;
}



void FUN_1401bbec0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1401bbe40(param_1 + 0xf0);
  FUN_1401bbcf0(param_1 + 0x98);
  puVar1 = *(undefined8 **)(param_1 + 0x98);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,uVar2);
  }
  FUN_1401bbcf0(param_1 + 0x78);
  puVar1 = *(undefined8 **)(param_1 + 0x78);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_1401c1130(param_1 + 0x38);
  return;
}



void FUN_1401bbf50(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)param_1[1];
  if (pvVar1 != (void *)0x0) {
    FUN_1401bbec0(pvVar1);
    operator_delete(pvVar1);
  }
  *param_1 = Proud::IReliableUdpHostDelegate::vftable;
  return;
}



void FUN_1401bbfa0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  *param_1 = Proud::CRemotePeer_C::vftable;
  param_1[1] = Proud::CRemotePeer_C::vftable;
  param_1[2] = Proud::CRemotePeer_C::vftable;
  pvVar1 = (void *)param_1[200];
  if (pvVar1 != (void *)0x0) {
    FUN_1401bbec0(pvVar1);
    operator_delete(pvVar1);
  }
  param_1[199] = Proud::IReliableUdpHostDelegate::vftable;
  FUN_14017e6e0(param_1 + 0xb6);
  FUN_140140df0(param_1 + 0xa7);
  FUN_140176cc0(param_1 + 5);
  if ((param_1[3] != 0) &&
     (*(longlong *)(param_1[3] + 8) = *(longlong *)(param_1[3] + 8) + -1,
     *(longlong *)(param_1[3] + 8) == 0)) {
    plVar2 = (longlong *)param_1[3];
    puVar3 = (undefined8 *)*plVar2;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1,param_3,param_4,uVar4);
    }
    FUN_1400a3530(plVar2);
  }
  param_1[2] = Proud::IUdpPacketFragBoardDg::vftable;
  param_1[1] = Proud::IP2PGroupMember::vftable;
  *param_1 = Proud::ISendDest_C::vftable;
  return;
}



undefined4 FUN_1401bc0b0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x56c);
}



void FUN_1401bc0c0(longlong param_1)

{
  FUN_1401bc300(param_1 + -8);
  return;
}



void FUN_1401bc0d0(longlong param_1)

{
  FUN_1401bc300(param_1 + -0x10);
  return;
}



void FUN_1401bc0e0(longlong param_1)

{
  FUN_1401bc0b0(param_1 + -8);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001401bc268)
// WARNING: Removing unreachable block (ram,0x0001401bc271)
// WARNING: Removing unreachable block (ram,0x0001401bc292)
// WARNING: Removing unreachable block (ram,0x0001401bc29b)

undefined8 *
FUN_1401bc0f0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  *param_1 = Proud::CRemotePeer_C::vftable;
  param_1[1] = Proud::CRemotePeer_C::vftable;
  param_1[2] = Proud::CRemotePeer_C::vftable;
  param_1[3] = 0;
  param_1[5] = 0;
  *(undefined4 *)(param_1 + 6) = 0;
  *(undefined4 *)((longlong)param_1 + 0x34) = 0;
  *(undefined4 *)(param_1 + 7) = 0;
  *(undefined4 *)((longlong)param_1 + 0x3c) = 0;
  *(undefined4 *)(param_1 + 0xa5) = 0;
  param_1[0xa8] = 0;
  param_1[0xa9] = 0;
  param_1[0xaa] = 0;
  param_1[0xab] = 0;
  param_1[0xa7] = Proud::ByteArray::vftable;
  *(undefined1 *)(param_1 + 0xac) = 0;
  param_1[0xae] = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 0xaf) = 0;
  *(undefined2 *)((longlong)param_1 + 0x57c) = 0;
  param_1[0xb0] = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 0xb1) = 0;
  *(undefined2 *)((longlong)param_1 + 0x58c) = 0;
  param_1[0xb2] = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 0xb3) = 0;
  *(undefined2 *)((longlong)param_1 + 0x59c) = 0;
  param_1[0xb4] = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 0xb5) = 0;
  *(undefined2 *)((longlong)param_1 + 0x5ac) = 0;
  *(undefined1 *)(param_1 + 0xb6) = 0;
  param_1[0xc0] = 0;
  param_1[0xb7] = 0;
  param_1[0xb8] = 0;
  param_1[0xb9] = 0;
  *(undefined4 *)(param_1 + 0xbb) = 0x11;
  param_1[0xba] = 0;
  *(undefined4 *)(param_1 + 0xbf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x5dc) = 0x3f400000;
  *(undefined4 *)(param_1 + 0xbc) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x5e4) = 0x40100000;
  param_1[0xbd] = 0x26;
  param_1[0xbe] = 0;
  FUN_1401be130(param_1 + 199,param_1,param_3,param_4,0xfffffffffffffffe);
  param_1[0xcd] = param_1;
  FUN_1401ba950(param_1,param_2);
  *(undefined4 *)(param_1 + 0xd0) = 0;
  *(undefined1 *)((longlong)param_1 + 0x684) = 0;
  return param_1;
}



void * FUN_1401bc300(void *param_1,uint param_2)

{
  FUN_1401bbfa0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1401bc330(longlong param_1)

{
  (**(code **)(*(longlong *)(param_1 + -0x40) + 0x10))(param_1 + -0x40);
  *(undefined8 *)(param_1 + 0xe0) = 0;
  return;
}



void FUN_1401bc360(longlong param_1)

{
  undefined8 uVar1;
  longlong lVar2;
  char cVar3;
  int iVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined **local_18;
  undefined4 local_10;
  undefined2 local_c;
  
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x118) + 0x78) + 0x10))
            (*(longlong *)(param_1 + 0x118) + 0x78);
  if ((*(double *)(param_1 + 0x148) == 0.0) && (*(char *)(param_1 + 0x80) == '\0')) {
    uVar6 = 0;
    uVar5 = uVar6;
    if (*(undefined8 **)(param_1 + 0x100) != (undefined8 *)0x0) {
      uVar5 = **(undefined8 **)(param_1 + 0x100);
    }
    cVar3 = FUN_1400a8b50(uVar5);
    if (cVar3 == '\0') {
      uVar5 = *(undefined8 *)(param_1 + 0x110);
      uVar1 = *(undefined8 *)(param_1 + 0x108);
      uVar7 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x118) + 0x70) + 0x1c0))
                        (*(longlong *)(param_1 + 0x118) + 0x70);
      cVar3 = FUN_14019e410(uVar1,uVar5,uVar7);
      if ((cVar3 != '\0') && (0 < *(longlong *)(*(longlong *)(param_1 + 0x110) + 8))) {
        lVar2 = *(longlong *)(param_1 + 0x110);
        *(undefined1 *)(param_1 + 0x80) = 1;
        local_18 = Proud::AddrPort::vftable;
        local_10 = *(undefined4 *)(lVar2 + 0x6a8);
        local_c = *(undefined2 *)(lVar2 + 0x6ac);
        if (*(undefined8 **)(param_1 + 0x100) != (undefined8 *)0x0) {
          uVar6 = **(undefined8 **)(param_1 + 0x100);
        }
        iVar4 = FUN_1400aa4b0(uVar6,lVar2,&local_18,*(undefined4 *)(lVar2 + 0x6b0));
        if (iVar4 != 0) {
          *(undefined1 *)(param_1 + 0x80) = 0;
        }
      }
    }
  }
  return;
}



void FUN_1401bc490(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 uVar4;
  
  if ((*(double *)(param_1 + 0x148) == 0.0) && (*(char *)(param_1 + 0xc0) == '\0')) {
    lVar2 = 0;
    lVar3 = lVar2;
    if (*(longlong **)(param_1 + 0x100) != (longlong *)0x0) {
      lVar3 = **(longlong **)(param_1 + 0x100);
    }
    if (*(char *)(lVar3 + 0x80) == '\0') {
      *(undefined1 *)(param_1 + 0xc0) = 1;
      if (*(longlong **)(param_1 + 0x100) != (longlong *)0x0) {
        lVar2 = **(longlong **)(param_1 + 0x100);
      }
      iVar1 = FUN_1400a9850(lVar2,DAT_1402f804c);
      if (iVar1 == 0) {
        uVar4 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x118) + 0x70) + 0x1c0))
                          (*(longlong *)(param_1 + 0x118) + 0x70);
        *(undefined8 *)(param_1 + 0x180) = uVar4;
        return;
      }
      *(undefined1 *)(param_1 + 0xc0) = 0;
    }
  }
  return;
}



void FUN_1401bc530(longlong param_1,longlong param_2)

{
  undefined **local_18;
  undefined4 local_10;
  undefined2 local_c;
  
  local_18 = Proud::AddrPort::vftable;
  local_10 = *(undefined4 *)(param_2 + 8);
  local_c = *(undefined2 *)(param_2 + 0xc);
  FUN_14019cc60(*(undefined8 *)(param_1 + 0x108),&local_18);
  return;
}



void FUN_1401bc570(longlong param_1)

{
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x118) + 0x78) + 0x10))
            (*(longlong *)(param_1 + 0x118) + 0x78);
  if (*(undefined8 **)(param_1 + 0x100) != (undefined8 *)0x0) {
    FUN_1400a88b0(**(undefined8 **)(param_1 + 0x100));
    return;
  }
  FUN_1400a88b0();
  return;
}



void FUN_1401bc5b0(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined1 local_18 [16];
  
  if (*(undefined8 **)(param_1 + 0x100) == (undefined8 *)0x0) {
    uVar3 = 0;
  }
  else {
    uVar3 = **(undefined8 **)(param_1 + 0x100);
  }
  lVar2 = FUN_1400a7e50(uVar3,local_18);
  iVar1 = *(int *)(lVar2 + 8);
  *(int *)(param_1 + 0x130) = iVar1;
  *(undefined2 *)(param_1 + 0x134) = *(undefined2 *)(lVar2 + 0xc);
  if ((iVar1 == 0) || (iVar1 == -1)) {
    FUN_1400a2b50(&DAT_140264130);
  }
  return;
}



void FUN_1401bc610(longlong param_1,undefined8 param_2)

{
  FUN_14019e800(*(undefined8 *)(param_1 + 0x108));
  if (*(longlong *)(param_1 + 0x188) != 0) {
    FUN_1401a03a0(*(longlong *)(param_1 + 0x188),param_2);
  }
  return;
}



void FUN_1401bc650(longlong param_1)

{
  FUN_14019eb60(*(undefined8 *)(param_1 + 0x108));
  if (*(longlong *)(param_1 + 0x188) != 0) {
    FUN_1401a04b0();
  }
  return;
}



undefined8 FUN_1401bc680(longlong param_1)

{
  longlong lVar1;
  
  if ((*(longlong **)(param_1 + 0xc0) != (longlong *)0x0) &&
     (lVar1 = **(longlong **)(param_1 + 0xc0), lVar1 != 0)) {
    if (*(char *)(lVar1 + 0x80) == '\0') {
      return 0;
    }
  }
  return 1;
}



void FUN_1401bc6b0(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  undefined **local_18;
  int local_10;
  undefined2 local_c;
  
  lVar5 = 0;
  lVar3 = lVar5;
  if (*(longlong **)(param_1 + 0x100) != (longlong *)0x0) {
    lVar3 = **(longlong **)(param_1 + 0x100);
  }
  FUN_1400a8490(lVar3,0);
  lVar3 = FUN_140169e50(*(undefined8 *)(param_1 + 0x118));
  local_10 = *(int *)(lVar3 + 0x118);
  if ((local_10 == 0) || (local_10 == -1)) {
    FUN_1400a2b50(&DAT_140256390);
  }
  local_18 = Proud::AddrPort::vftable;
  local_c = 0;
  lVar3 = lVar5;
  if (*(longlong **)(param_1 + 0x100) != (longlong *)0x0) {
    lVar3 = **(longlong **)(param_1 + 0x100);
  }
  FUN_1400aa460(lVar3,&local_18);
  lVar3 = lVar5;
  if (*(longlong **)(param_1 + 0x100) != (longlong *)0x0) {
    lVar3 = **(longlong **)(param_1 + 0x100);
  }
  lVar3 = FUN_1400a7e50(lVar3,&local_18);
  iVar1 = *(int *)(lVar3 + 8);
  *(int *)(param_1 + 0x130) = iVar1;
  *(undefined2 *)(param_1 + 0x134) = *(undefined2 *)(lVar3 + 0xc);
  if ((iVar1 == 0) || (iVar1 == -1)) {
    FUN_1400a2b50(&DAT_140264130);
  }
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x118) + 0x78) + 0x10))
            (*(longlong *)(param_1 + 0x118) + 0x78);
  lVar3 = lVar5;
  if (*(longlong **)(param_1 + 0x100) != (longlong *)0x0) {
    lVar3 = **(longlong **)(param_1 + 0x100);
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x118) + 0x5d8);
  lVar4 = lVar5;
  if (lVar2 != 0) {
    lVar4 = *(longlong *)(lVar2 + 0x38);
  }
  FUN_1400ace20(*(undefined8 *)(lVar4 + 0x2b8),lVar3);
  if (*(longlong **)(param_1 + 0x100) != (longlong *)0x0) {
    lVar5 = **(longlong **)(param_1 + 0x100);
  }
  FUN_1401a3ac0(lVar5);
  FUN_1401bc490(param_1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401bc800(longlong param_1,undefined4 param_2,undefined2 param_3,longlong param_4,
                  undefined8 param_5,undefined8 param_6,undefined8 *param_7)

{
  undefined1 auStack_e58 [32];
  undefined1 *local_e38;
  undefined8 local_e30;
  undefined8 *local_e28;
  undefined **local_e18;
  undefined4 local_e10;
  undefined2 local_e0c;
  undefined8 local_e08;
  undefined8 local_df8;
  undefined8 uStack_df0;
  undefined4 local_de8;
  undefined4 uStack_de4;
  undefined4 uStack_de0;
  undefined4 uStack_ddc;
  undefined1 local_dd8 [80];
  undefined1 local_d88 [8];
  undefined *local_d80;
  longlong local_d78;
  undefined4 local_d70;
  int local_d6c;
  undefined1 local_d60 [136];
  undefined1 local_cd8 [3200];
  undefined1 *local_58;
  undefined4 local_50;
  int local_4c;
  ulonglong local_48;
  
  local_e08 = 0xfffffffffffffffe;
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_e58;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x118) + 0x78) + 0x10))();
  local_4c = 200;
  local_50 = 0;
  local_58 = local_cd8;
  FUN_140185560(local_d88);
  FUN_1401851e0(local_d88,local_d60,0x80);
  FUN_1401a3f60(param_5,local_cd8,local_d88);
  local_df8 = *param_7;
  uStack_df0 = param_7[1];
  local_de8 = *(undefined4 *)(param_7 + 2);
  uStack_de4 = *(undefined4 *)((longlong)param_7 + 0x14);
  uStack_de0 = *(undefined4 *)(param_7 + 3);
  uStack_ddc = *(undefined4 *)((longlong)param_7 + 0x1c);
  local_e18 = Proud::AddrPort::vftable;
  local_e10 = *(undefined4 *)(param_4 + 8);
  local_e0c = *(undefined2 *)(param_4 + 0xc);
  local_e28 = &local_df8;
  local_e30 = param_6;
  local_e38 = local_cd8;
  FUN_14019f250(*(undefined8 *)(param_1 + 0x108),param_2,param_3,&local_e18);
  local_e18 = &local_d80;
  FUN_14019a730(&local_d80);
  if (local_d78 != 0) {
    if (local_d6c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_d70 = 0;
  }
  if (local_58 == (undefined1 *)0x0) {
    FUN_1400a2320(local_dd8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_dd8,(ThrowInfo *)&DAT_1402f4860);
  }
  if (local_4c < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401bc9b0(undefined8 param_1,undefined4 param_2,undefined2 param_3,longlong param_4,
                  undefined8 param_5,undefined8 param_6,undefined8 param_7)

{
  undefined1 auStack_d68 [32];
  undefined8 local_d48;
  undefined8 local_d40;
  undefined8 local_d38;
  undefined **local_d28;
  undefined4 local_d20;
  undefined2 local_d1c;
  undefined8 local_d18;
  undefined1 local_d10 [72];
  undefined1 local_cc8 [3200];
  longlong local_48;
  int local_3c;
  ulonglong local_38;
  
  local_d18 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_d68;
  local_d48 = FUN_140146970(local_cc8,param_5);
  local_d28 = Proud::AddrPort::vftable;
  local_d20 = *(undefined4 *)(param_4 + 8);
  local_d1c = *(undefined2 *)(param_4 + 0xc);
  local_d38 = param_7;
  local_d40 = param_6;
  FUN_1401bc800(param_1,param_2,param_3,&local_d28);
  if (local_48 == 0) {
    FUN_1400a2320(local_d10,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_d10,(ThrowInfo *)&DAT_1402f4860);
  }
  if (local_3c < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



undefined8 * FUN_1401bcab0(undefined8 *param_1,longlong param_2,longlong param_3,undefined8 param_4)

{
  void *pvVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  
  uVar6 = 0xfffffffffffffffe;
  *param_1 = Proud::ICompletionContext::vftable;
  FUN_1400a8350(param_1 + 8);
  *param_1 = Proud::CUdpSocket_C::vftable;
  param_1[8] = Proud::CUdpSocket_C::vftable;
  puVar4 = (undefined8 *)0x0;
  param_1[0x20] = 0;
  param_1[0x21] = 0;
  param_1[0x22] = 0;
  param_1[0x25] = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 0x26) = 0;
  *(undefined2 *)((longlong)param_1 + 0x134) = 0;
  param_1[0x27] = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 0x28) = 0;
  *(undefined2 *)((longlong)param_1 + 0x144) = 0;
  param_1[0x31] = 0;
  *(undefined4 *)(param_1 + 0x28) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_1 + 0x144) = DAT_1402f83d4;
  *(undefined4 *)(param_1 + 0x26) = *(undefined4 *)(param_1 + 0x28);
  *(undefined2 *)((longlong)param_1 + 0x134) = *(undefined2 *)((longlong)param_1 + 0x144);
  *(undefined1 *)(param_1 + 0x10) = 0;
  *(undefined1 *)(param_1 + 0x18) = 0;
  param_1[0x29] = 0;
  uVar5 = (**(code **)(*(longlong *)(param_2 + 0x70) + 0x1c0))();
  param_1[0x30] = uVar5;
  param_1[0x23] = param_2;
  param_1[0x24] = param_3;
  pvVar1 = operator_new(0x90);
  puVar2 = puVar4;
  if (pvVar1 != (void *)0x0) {
    if (param_3 == 0) {
      param_3 = param_2 + 0x90;
    }
    else {
      param_3 = param_3 + 0x10;
    }
    uVar5 = (**(code **)(*(longlong *)(param_2 + 0x88) + 0x18))();
    puVar2 = (undefined8 *)FUN_1401a0bd0(pvVar1,uVar5,param_3,param_4,uVar6);
  }
  param_1[0x21] = puVar2;
  puVar3 = operator_new(0x6b8);
  puVar2 = puVar4;
  if (puVar3 != (undefined8 *)0x0) {
    *puVar3 = 0;
    puVar3[3] = 0;
    puVar3[1] = 0;
    puVar3[2] = 100;
    puVar3[0xcf] = Proud::CFastArray<>::vftable;
    puVar3[0xd0] = 0;
    puVar3[0xd1] = 0;
    puVar3[0xd2] = 0;
    puVar3[0xd3] = 0;
    puVar3[0xd4] = Proud::AddrPort::vftable;
    *(undefined4 *)(puVar3 + 0xd5) = 0;
    *(undefined2 *)((longlong)puVar3 + 0x6ac) = 0;
    puVar2 = puVar3;
  }
  param_1[0x22] = puVar2;
  FUN_14019cad0(param_1[0x21]);
  pvVar1 = operator_new(0x60);
  if (pvVar1 != (void *)0x0) {
    if (param_1[0x23] != 0) {
      puVar4 = (undefined8 *)(param_1[0x23] + 0x88);
    }
    puVar4 = (undefined8 *)FUN_1401a0d30(pvVar1,puVar4);
  }
  param_1[0x31] = puVar4;
  return param_1;
}



void FUN_1401bccd0(longlong param_1)

{
  FUN_1401bce60(param_1 + -0x40);
  return;
}



void FUN_1401bcce0(undefined8 *param_1)

{
  void *pvVar1;
  longlong *plVar2;
  longlong lVar3;
  
  *param_1 = Proud::CUdpSocket_C::vftable;
  param_1[8] = Proud::CUdpSocket_C::vftable;
  pvVar1 = (void *)param_1[0x31];
  if (pvVar1 != (void *)0x0) {
    FUN_1401a0b70((longlong)pvVar1 + 8);
    operator_delete(pvVar1);
  }
  param_1[0x31] = 0;
  pvVar1 = (void *)param_1[0x22];
  if (pvVar1 != (void *)0x0) {
    FUN_14019de70(pvVar1);
    operator_delete(pvVar1);
  }
  param_1[0x22] = 0;
  pvVar1 = (void *)param_1[0x21];
  if (pvVar1 != (void *)0x0) {
    FUN_1401a0cd0(pvVar1);
    operator_delete(pvVar1);
  }
  param_1[0x21] = 0;
  pvVar1 = (void *)param_1[0x31];
  if (pvVar1 != (void *)0x0) {
    FUN_1401a0b70((longlong)pvVar1 + 8);
    operator_delete(pvVar1);
  }
  pvVar1 = (void *)param_1[0x22];
  if (pvVar1 != (void *)0x0) {
    FUN_14019de70(pvVar1);
    operator_delete(pvVar1);
  }
  pvVar1 = (void *)param_1[0x21];
  if (pvVar1 != (void *)0x0) {
    FUN_1401a0cd0(pvVar1);
    operator_delete(pvVar1);
  }
  if ((param_1[0x20] != 0) &&
     (*(longlong *)(param_1[0x20] + 8) = *(longlong *)(param_1[0x20] + 8) + -1,
     *(longlong *)(param_1[0x20] + 8) == 0)) {
    plVar2 = (longlong *)param_1[0x20];
    lVar3 = *plVar2;
    if (lVar3 != 0) {
      FUN_1400a8cc0(lVar3);
      FUN_1400a3530(lVar3);
    }
    FUN_1400a3530(plVar2);
  }
  param_1[8] = Proud::IHasOverlappedIo::vftable;
  *param_1 = Proud::ICompletionContext::vftable;
  return;
}



void * FUN_1401bce60(void *param_1,uint param_2)

{
  FUN_1401bcce0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_1401bce90(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  longlong *plVar3;
  char cVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  longlong *local_res8;
  undefined8 local_res18 [2];
  undefined8 uVar8;
  undefined **local_40;
  undefined4 local_38;
  undefined2 local_34;
  
  uVar8 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x118) != 0) {
    (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x118) + 0x78) + 0x10))();
    local_res8 = (longlong *)FUN_1400a34c0(0x400);
    lVar7 = 0;
    lVar5 = lVar7;
    if (local_res8 != (longlong *)0x0) {
      lVar5 = *(longlong *)(param_1 + 0x118) + 0x78;
      if (*(longlong *)(param_1 + 0x118) == 0) {
        lVar5 = lVar7;
      }
      lVar5 = FUN_1400a8db0(local_res8,1,lVar5,param_4,uVar8);
    }
    if (lVar5 == 0) {
      local_res8 = (longlong *)0x0;
    }
    else {
      local_res8 = (longlong *)FUN_1400a34c0(0x10);
      local_res8[1] = 1;
      *local_res8 = lVar5;
    }
    plVar1 = local_res8;
    FUN_1400a5190(param_1 + 0x100,&local_res8);
    plVar3 = local_res8;
    if (plVar1 != (longlong *)0x0) {
      plVar1 = plVar1 + 1;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        lVar5 = *local_res8;
        if (lVar5 != 0) {
          FUN_1400a8cc0(lVar5);
          FUN_1400a3530(lVar5);
        }
        FUN_1400a3530(plVar3);
      }
    }
    lVar5 = lVar7;
    if (*(longlong **)(param_1 + 0x100) != (longlong *)0x0) {
      lVar5 = **(longlong **)(param_1 + 0x100);
    }
    FUN_1400a7fb0(lVar5,param_1);
    local_40 = Proud::AddrPort::vftable;
    local_38 = *(undefined4 *)(param_2 + 8);
    local_34 = *(undefined2 *)(param_2 + 0xc);
    lVar5 = lVar7;
    if (*(longlong **)(param_1 + 0x100) != (longlong *)0x0) {
      lVar5 = **(longlong **)(param_1 + 0x100);
    }
    cVar4 = FUN_1400aa460(lVar5,&local_40);
    if (cVar4 != '\0') {
      lVar5 = lVar7;
      if (*(longlong **)(param_1 + 0x100) != (longlong *)0x0) {
        lVar5 = **(longlong **)(param_1 + 0x100);
      }
      lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x118) + 0x5d8);
      lVar6 = lVar7;
      if (lVar2 != 0) {
        lVar6 = *(longlong *)(lVar2 + 0x38);
      }
      FUN_1400ace20(*(undefined8 *)(lVar6 + 0x2b8),lVar5);
      FUN_1401bc5b0(param_1);
      if (*(longlong **)(param_1 + 0x100) != (longlong *)0x0) {
        lVar7 = **(longlong **)(param_1 + 0x100);
      }
      FUN_1401a3ac0(lVar7);
      return 1;
    }
    local_res18[0] = 0;
    FUN_1400a5190(param_1 + 0x100,local_res18);
  }
  return 0;
}



void FUN_1401bd070(double *param_1,double param_2)

{
  param_2 = *param_1 - param_2;
  *param_1 = param_2;
  *(bool *)(param_1 + 2) = param_2 < 0.0;
  if (param_2 < 0.0) {
    *param_1 = param_1[1];
  }
  return;
}



void FUN_1401bd0b0(double *param_1,double param_2)

{
  double dVar1;
  
  if (param_2 <= 0.0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  dVar1 = param_1[1];
  param_1[1] = param_2;
  *param_1 = (param_2 / dVar1) * *param_1;
  return;
}



void FUN_1401bd0e0(double *param_1)

{
  *(undefined1 *)(param_1 + 2) = 0;
  *param_1 = param_1[1] * 0.3;
  return;
}



double * FUN_1401bd100(double *param_1,double param_2)

{
  param_1[1] = param_2;
  *(undefined1 *)(param_1 + 2) = 0;
  *param_1 = param_2 * 0.3;
  return param_1;
}



longlong FUN_1401bd120(longlong param_1)

{
  return param_1 + 0x150;
}



void FUN_1401bd130(longlong param_1,undefined4 param_2)

{
  FUN_1401c6970(param_1 + 0xf0);
  FUN_1401beee0(param_1 + 8,param_2);
  return;
}



void FUN_1401bd170(longlong param_1,undefined8 param_2,int param_3)

{
  FUN_1401c11f0(param_1 + 0x38);
  *(int *)(param_1 + 0xb8) = *(int *)(param_1 + 0xb8) + param_3;
  FUN_1401bea80(param_1 + 8,0);
  return;
}



void FUN_1401bd1b0(longlong param_1)

{
  FUN_1401c7080(param_1 + 0xf0);
  return;
}



void FUN_1401bd1c0(longlong param_1)

{
  FUN_1401be240(param_1 + 8);
  return;
}



void FUN_1401bd1d0(longlong param_1,undefined4 *param_2)

{
  *param_2 = *(undefined4 *)(param_1 + 0x148);
  param_2[1] = *(undefined4 *)(param_1 + 0x188);
  param_2[2] = *(undefined4 *)(param_1 + 400);
  param_2[3] = *(undefined4 *)(param_1 + 0x194);
  param_2[4] = *(undefined4 *)(param_1 + 0x1a8);
  param_2[5] = *(undefined4 *)(param_1 + 0x100);
  param_2[6] = *(undefined4 *)(param_1 + 0x104);
  param_2[7] = *(undefined4 *)(param_1 + 0x70);
  param_2[8] = *(undefined4 *)(param_1 + 0x90);
  param_2[9] = *(undefined4 *)(param_1 + 0xb0);
  param_2[10] = *(undefined4 *)(param_1 + 0xb8);
  param_2[0xb] = *(undefined4 *)(param_1 + 0xbc);
  param_2[0xc] = *(undefined4 *)(param_1 + 0xc0);
  param_2[0xd] = *(undefined4 *)(param_1 + 0xd0);
  param_2[0xe] = *(undefined4 *)(param_1 + 0x34);
  param_2[0x12] = *(undefined4 *)(param_1 + 0x1ac);
  if (*(longlong *)(param_1 + 0x90) == 0) {
    param_2[0xf] = 0;
  }
  else {
    if (*(longlong *)(param_1 + 0x88) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    param_2[0xf] = *(undefined4 *)(*(longlong *)(param_1 + 0x88) + 0x14);
  }
  if (*(longlong *)(param_1 + 0xb0) != 0) {
    if (*(longlong *)(param_1 + 0xa8) == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    param_2[0x10] = *(undefined4 *)(*(longlong *)(param_1 + 0xa8) + 0x14);
    param_2[0x11] = *(undefined4 *)(param_1 + 0xe0);
    return;
  }
  param_2[0x10] = 0;
  param_2[0x11] = *(undefined4 *)(param_1 + 0xe0);
  return;
}



undefined8 * FUN_1401bd2e0(undefined8 *param_1,longlong *param_2,undefined4 param_3)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  uVar1 = (**(code **)(*param_2 + 0x38))(param_2);
  FUN_1401bede0(param_1 + 1,param_1,param_3,uVar1,uVar2);
  uVar1 = (**(code **)(*param_2 + 0x38))(param_2);
  FUN_1401c6d30(param_1 + 0x1e,param_1,param_3,uVar1);
  *param_1 = param_2;
  return param_1;
}



undefined1 FUN_1401bd360(longlong param_1)

{
  return *(undefined1 *)(*(longlong *)(param_1 + 0x10) + 0x608);
}



void FUN_1401bd370(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(*(longlong *)(param_1 + 0x10) + 0x670);
                    // WARNING: Could not recover jumptable at 0x0001401bd383. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x1c0))(lVar1 + 0x70);
  return;
}



undefined8 FUN_1401bd390(longlong param_1)

{
  undefined8 uVar1;
  
  if (*(char *)(*(longlong *)(param_1 + 0x10) + 0x608) == '\0') {
    uVar1 = FUN_1401b8ba0(*(longlong *)(param_1 + 0x10) + 0x668);
    return uVar1;
  }
  return 1;
}



undefined4 FUN_1401bd3b0(longlong param_1)

{
  return *(undefined4 *)(*(longlong *)(param_1 + 0x10) + 0x56c);
}



double FUN_1401bd3c0(longlong param_1)

{
  double dVar1;
  double dVar2;
  
  dVar1 = *(double *)(*(longlong *)(param_1 + 0x10) + 0x50);
  dVar2 = 0.0;
  if (0.0 < dVar1) {
    dVar2 = dVar1;
  }
  return dVar2;
}



void FUN_1401bd3e0(longlong param_1)

{
  FUN_1401bd1c0(*(undefined8 *)(param_1 + 8));
  return;
}



void FUN_1401bd3f0(longlong param_1)

{
  undefined8 uVar1;
  double dVar2;
  
  uVar1 = *(undefined8 *)(param_1 + 8);
  dVar2 = (double)FUN_140169c60(*(undefined8 *)(*(longlong *)(param_1 + 0x10) + 0x670));
  FUN_1401bd130(uVar1,(float)dVar2);
  return;
}



undefined8 FUN_1401bd420(longlong param_1)

{
  return *(undefined8 *)(*(longlong *)(*(longlong *)(param_1 + 0x10) + 0x670) + 0x4e0);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401bd440(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined1 auStack_e08 [32];
  undefined **local_de8;
  longlong local_de0;
  undefined8 local_dd8;
  undefined8 local_dd0;
  undefined8 local_dc8;
  undefined1 *local_dc0;
  undefined8 local_db8;
  undefined1 local_db0 [72];
  undefined1 local_d68 [8];
  undefined1 local_d60 [8];
  longlong local_d58;
  undefined4 local_d50;
  int local_d4c;
  undefined1 local_d40 [136];
  undefined1 local_cb8 [3200];
  undefined1 *local_38;
  undefined4 local_30;
  int local_2c;
  ulonglong local_28;
  
  local_db8 = 0xfffffffffffffffe;
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_e08;
  local_2c = 200;
  local_30 = 0;
  local_38 = local_cb8;
  FUN_140185560(local_d68);
  FUN_1401851e0(local_d68,local_d40,0x80);
  FUN_1401a3f60(param_2,local_cb8,local_d68);
  local_de0 = 0;
  local_dd8 = 0;
  local_dd0 = 0;
  local_dc8 = 0;
  local_de8 = Proud::ByteArray::vftable;
  lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x10) + 0x670) + 0x4e0);
  if (lVar1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  local_de0 = lVar1;
  thunk_FUN_1401a70d0(local_cb8,&local_de8);
  uVar2 = local_dd8;
  if ((int)local_dd0 == 0) {
    uVar2 = 0;
  }
  FUN_1401bd170(*(undefined8 *)(param_1 + 8),uVar2);
  FUN_140140df0(&local_de8);
  local_dc0 = local_d60;
  FUN_14019a730(local_d60);
  if (local_d58 != 0) {
    if (local_d4c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_d50 = 0;
  }
  if (local_38 == (undefined1 *)0x0) {
    FUN_1400a2320(local_db0,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_db0,(ThrowInfo *)&DAT_1402f4860);
  }
  if (local_2c < 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401bd5d0(longlong param_1,int *param_2)

{
  int iVar1;
  undefined4 uVar2;
  longlong lVar3;
  longlong lVar4;
  int iVar5;
  undefined1 auStack_2808 [32];
  undefined4 *local_27e8;
  undefined8 local_27d8;
  int iStack_27d0;
  undefined4 uStack_27cc;
  undefined4 local_27c8 [2];
  undefined8 local_27c0;
  undefined4 local_27b8;
  undefined4 uStack_27b4;
  undefined4 local_27b0;
  int local_27ac;
  undefined4 local_27a0 [2];
  undefined8 local_2798;
  undefined1 local_2790;
  undefined4 local_278c;
  undefined1 local_2788;
  undefined1 local_2787;
  undefined8 local_2780;
  undefined1 local_2778 [72];
  undefined1 local_2730 [72];
  undefined1 local_26e8 [72];
  undefined1 local_26a0 [3200];
  undefined1 *local_1a20;
  undefined4 local_1a18;
  undefined4 local_1a14;
  undefined1 local_1a08 [8];
  longlong local_1a00;
  longlong local_19f8;
  undefined4 local_19f0;
  int local_19ec;
  undefined1 local_19e0 [136];
  undefined4 local_1958;
  undefined4 uStack_1954;
  undefined4 uStack_1950;
  undefined4 uStack_194c;
  undefined4 *local_cd8;
  undefined4 local_cd0;
  int local_ccc;
  undefined1 local_cc8 [3200];
  undefined1 *local_48;
  int local_40;
  int local_3c;
  ulonglong local_38;
  undefined8 uStack_30;
  
  uStack_30 = 0x1401bd5ea;
  local_2780 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_2808;
  iVar1 = *param_2;
  uVar2 = DAT_140318d78;
  if (iVar1 == 1) {
    if (DAT_14030c822 != '\0') {
      uVar2 = 1;
    }
  }
  else if ((iVar1 == 2) && (DAT_14030c821 != '\0')) {
    uVar2 = 1;
  }
  if (*(char *)(*(longlong *)(param_1 + 0x10) + 0x608) == '\0') {
    local_ccc = 200;
    local_cd0 = 0;
    local_cd8 = &local_1958;
    FUN_140185560(local_27c8);
    FUN_140185030(local_27c8);
    FUN_1401856c0(local_27c8,0x800);
    FUN_1401856c0(local_27c8,0);
    FUN_1401a7b20(param_2,&local_1958,local_27c8);
    local_2798 = 0;
    local_2790 = 1;
    local_278c = 0xffffffff;
    local_2788 = 1;
    local_2787 = DAT_1402f81cc;
    local_27a0[0] = uVar2;
    FUN_1401b8a90(*(longlong *)(param_1 + 0x10) + 0x668,&local_1958,local_27a0);
    local_27d8 = &local_27c0;
    FUN_14019a730(&local_27c0);
    if (CONCAT44(uStack_27b4,local_27b8) != 0) {
      if (local_27ac < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      local_27b0 = 0;
    }
    if (local_cd8 == (undefined4 *)0x0) {
      FUN_1400a2320(local_2778,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_2778,(ThrowInfo *)&DAT_1402f4860);
    }
    if (local_ccc < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
  }
  else if (iVar1 == 1) {
    FUN_140185560(local_1a08);
    FUN_1401851e0(local_1a08,local_19e0,0x80);
    FUN_14003c9e0(local_1a08,0x16);
    FUN_14007c6e0(local_1a08,*(undefined4 *)(*(longlong *)(param_1 + 0x10) + 0x56c));
    FUN_14007c6e0(local_1a08,param_2[1]);
    FUN_140184fb0(local_27a0,local_1a08);
    if (*(longlong *)(param_2 + 2) == 0) {
      if (*(longlong *)(param_2 + 4) == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      iVar1 = param_2[6];
    }
    else {
      iVar1 = *(int *)(*(longlong *)(param_2 + 2) + 0x18);
    }
    FUN_140186930(local_1a08,(longlong)iVar1);
    local_3c = 200;
    lVar4 = 0;
    local_40 = 0;
    local_48 = local_cc8;
    local_ccc = 200;
    local_cd0 = 0;
    local_cd8 = &local_1958;
    if (local_1a00 == 0) {
      if (local_19f8 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
    }
    else {
      local_19f0 = *(undefined4 *)(local_1a00 + 0x18);
    }
    lVar3 = local_19f8;
    if (local_19f8 == 0) {
      if (local_1a00 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      lVar3 = lVar4;
      if (*(int *)(local_1a00 + 0x18) != 0) {
        lVar3 = *(longlong *)(local_1a00 + 0x10);
      }
    }
    local_cd0 = 1;
    local_27d8._0_4_ = (undefined4)lVar3;
    local_27d8._4_4_ = (undefined4)((ulonglong)lVar3 >> 0x20);
    local_1958 = (undefined4)local_27d8;
    uStack_1954 = local_27d8._4_4_;
    uStack_194c = uStack_27cc;
    local_27d8 = (longlong *)lVar3;
    iStack_27d0 = local_19f0;
    uStack_1950 = local_19f0;
    FUN_140145c70(local_cc8,&local_1958);
    if (local_cd8 == (undefined4 *)0x0) {
      FUN_1400a2320(local_2778,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_2778,(ThrowInfo *)&DAT_1402f4860);
    }
    if (local_ccc < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_cd0 = 0;
    lVar3 = *(longlong *)(param_2 + 2);
    if (lVar3 == 0) {
      if (*(longlong *)(param_2 + 4) == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      iVar1 = param_2[6];
    }
    else {
      iVar1 = *(int *)(lVar3 + 0x18);
    }
    if (*(longlong *)(param_2 + 4) == 0) {
      if (lVar3 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      if (*(int *)(lVar3 + 0x18) != 0) {
        lVar4 = *(longlong *)(lVar3 + 0x10);
      }
    }
    else {
      lVar4 = *(longlong *)(param_2 + 4);
      if (lVar4 == 0) {
        FUN_1400a2320(local_26e8,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_26e8,(ThrowInfo *)&DAT_1402f4860);
      }
    }
    iStack_27d0 = iVar1;
    if (local_48 == (undefined1 *)0x0) {
      FUN_1400a2320(local_2730,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_2730,(ThrowInfo *)&DAT_1402f4860);
    }
    if (local_40 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    iVar5 = local_40 + 1;
    if ((iVar5 < 0) || (local_3c < iVar5)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    *(longlong *)(local_48 + (longlong)local_40 * 0x10) = lVar4;
    *(ulonglong *)(local_48 + (longlong)local_40 * 0x10 + 8) = CONCAT44(uStack_27cc,iVar1);
    local_27d8 = (longlong *)local_26a0;
    local_1a14 = 200;
    local_1a18 = 0;
    local_1a20 = local_26a0;
    local_40 = iVar5;
    FUN_14016adf0(&local_48,&local_1a20);
    local_27c8[0] = DAT_140318d78;
    local_27c0 = DAT_140318d70;
    local_27b8 = CONCAT31(local_27b8._1_3_,DAT_140318d80);
    uStack_27b4 = 0xffffffff;
    local_27b0._0_2_ = CONCAT11(DAT_1402f81cc,DAT_140318da0);
    uVar2 = (**(code **)(**(longlong **)(param_1 + 0x10) + 8))();
    local_27e8 = local_27c8;
    FUN_14016b050(*(undefined8 *)(*(longlong *)(param_1 + 0x10) + 0x670),uVar2,1,local_26a0);
    if (local_48 == (undefined1 *)0x0) {
      FUN_1400a2320(local_2730,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_2730,(ThrowInfo *)&DAT_1402f4860);
    }
    if (local_3c < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_40 = 0;
    FUN_140184fd0(local_27a0);
    local_27d8 = &local_1a00;
    FUN_14019a730(&local_1a00);
    if ((local_19f8 != 0) && (local_19ec < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
  }
  return;
}



void FUN_1401bdb40(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  int iVar2;
  
  FUN_140174e40(param_3,0);
  FUN_1401bd1b0(*(undefined8 *)(param_1 + 8),param_2);
  uVar1 = FUN_1401bd120(*(undefined8 *)(param_1 + 8));
  iVar2 = FUN_1401a4970(uVar1,param_3,*(undefined4 *)(*(longlong *)(param_1 + 0x10) + 0x56c),
                        *(undefined4 *)
                         (*(longlong *)(*(longlong *)(param_1 + 0x10) + 0x670) + 0x6a4),param_4);
  if (iVar2 < 0) {
    *(undefined1 *)(param_1 + 0x18) = 1;
  }
  return;
}



undefined8 FUN_1401bdbd0(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  longlong *plVar2;
  longlong *plVar3;
  char cVar4;
  int iVar5;
  undefined8 uVar6;
  longlong *plVar7;
  longlong lVar8;
  ulonglong uVar9;
  longlong *plVar10;
  longlong *plVar11;
  longlong *local_res8;
  undefined8 local_d8;
  longlong local_d0;
  longlong *local_c8;
  undefined8 local_c0;
  longlong *local_b8;
  longlong *local_b0;
  undefined4 local_a8;
  undefined4 local_a4;
  longlong *local_a0;
  longlong *local_98;
  undefined8 local_90;
  undefined1 local_88 [80];
  
  local_90 = 0xfffffffffffffffe;
  local_b0 = (longlong *)(**(code **)(*param_1 + 0x38))();
  plVar11 = (longlong *)0x0;
  local_c0 = 0;
  local_c8 = (longlong *)0x0;
  local_d0 = 0;
  local_b8 = (longlong *)0x0;
  local_d8 = 0;
  local_a4 = 0;
  cVar4 = FUN_140185dc0(param_2,&local_d8);
  if (cVar4 == '\0') {
    if (local_b8 != (longlong *)0x0) {
      plVar11 = local_b8 + 1;
      *plVar11 = *plVar11 + -1;
      if (*plVar11 == 0) {
        FUN_140148f80(&local_b8,local_b8);
      }
    }
    local_res8 = &local_d0;
    FUN_14019a730(&local_d0);
    if ((local_c8 != (longlong *)0x0) && (local_c0 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
  }
  else {
    if ((int)local_d8 != 1) {
      if ((int)local_d8 == 2) {
        uVar6 = (**(code **)(*(longlong *)(*(longlong *)(param_1[2] + 0x670) + 0x88) + 0x18))();
        plVar7 = (longlong *)FUN_140153270(&local_a0,uVar6);
        plVar3 = local_b0;
        plVar2 = local_b8;
        plVar10 = (longlong *)*plVar7;
        if (plVar10 != (longlong *)0x0) {
          plVar10[1] = plVar10[1] + 1;
          plVar11 = plVar10;
        }
        if (local_b8 != (longlong *)0x0) {
          plVar10 = local_b8 + 1;
          *plVar10 = *plVar10 + -1;
          if (*plVar10 == 0) {
            puVar1 = (undefined8 *)*local_b8;
            *puVar1 = Proud::CFastArray<>::vftable;
            if (puVar1[2] != 0) {
              if ((longlong *)puVar1[1] == (longlong *)0x0) {
                FUN_1400a3530(puVar1[2]);
              }
              else {
                (**(code **)(*(longlong *)puVar1[1] + 0x18))();
              }
            }
            (**(code **)(*plVar3 + 0x18))(plVar3,puVar1);
            (**(code **)(*local_b0 + 0x18))(local_b0,plVar2);
          }
        }
        plVar10 = local_98;
        local_b0 = (longlong *)plVar7[1];
        local_b8 = plVar11;
        if (local_a0 != (longlong *)0x0) {
          plVar11 = local_a0 + 1;
          *plVar11 = *plVar11 + -1;
          if (*plVar11 == 0) {
            puVar1 = (undefined8 *)*local_a0;
            *puVar1 = Proud::CFastArray<>::vftable;
            if (puVar1[2] != 0) {
              if ((longlong *)puVar1[1] == (longlong *)0x0) {
                FUN_1400a3530(puVar1[2]);
              }
              else {
                (**(code **)(*(longlong *)puVar1[1] + 0x18))();
              }
            }
            (**(code **)(*plVar10 + 0x18))(plVar10,puVar1);
            (**(code **)(*local_98 + 0x18))(local_98,local_a0);
          }
        }
        if (local_b8 == (longlong *)0x0) {
          lVar8 = 0;
        }
        else {
          lVar8 = *local_b8;
        }
        cVar4 = FUN_1401a8020(lVar8,param_2);
        if (cVar4 == '\0') {
          if (local_b8 != (longlong *)0x0) {
            plVar11 = local_b8 + 1;
            *plVar11 = *plVar11 + -1;
            if (*plVar11 == 0) {
              FUN_140148f80(&local_b8,local_b8);
            }
          }
          local_res8 = &local_d0;
          FUN_14019a730(&local_d0);
          if (local_c8 == (longlong *)0x0) {
            return 0;
          }
          if (-1 < local_c0) {
            return 0;
          }
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        cVar4 = FUN_140185490(param_2,&local_res8,4);
        if (cVar4 == '\0') {
          local_a4 = 0;
          if (local_b8 != (longlong *)0x0) {
            plVar11 = local_b8 + 1;
            *plVar11 = *plVar11 + -1;
            if (*plVar11 == 0) {
              FUN_140148f80(&local_b8,local_b8);
            }
          }
          local_res8 = &local_d0;
          FUN_14019a730(&local_d0);
          if (local_c8 == (longlong *)0x0) {
            return 0;
          }
          if (-1 < local_c0) {
            return 0;
          }
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        local_a4 = local_res8._0_4_;
        cVar4 = FUN_140185490(param_2,&local_res8,4);
        if (cVar4 == '\0') {
          if (local_b8 != (longlong *)0x0) {
            plVar11 = local_b8 + 1;
            *plVar11 = *plVar11 + -1;
            if (*plVar11 == 0) {
              FUN_140148f80(&local_b8,local_b8);
            }
          }
          local_res8 = &local_d0;
          FUN_14019a730(&local_d0);
          if (local_c8 == (longlong *)0x0) {
            return 0;
          }
          if (-1 < local_c0) {
            return 0;
          }
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        local_a8 = local_res8._0_4_;
      }
LAB_1401bdfe1:
      FUN_140174e40(param_3,0);
      FUN_1401bd1b0(param_1[1],&local_d8);
      uVar6 = FUN_1401bd120(param_1[1]);
      iVar5 = FUN_1401a4970(uVar6,param_3,*(undefined4 *)(param_1[2] + 0x56c),
                            *(undefined4 *)(*(longlong *)(param_1[2] + 0x670) + 0x6a4),param_4);
      if (iVar5 < 0) {
        *(undefined1 *)(param_1 + 3) = 1;
      }
      if (local_b8 != (longlong *)0x0) {
        plVar11 = local_b8 + 1;
        *plVar11 = *plVar11 + -1;
        if (*plVar11 == 0) {
          FUN_140148f80(&local_b8,local_b8);
        }
      }
      local_res8 = &local_d0;
      FUN_14019a730(&local_d0);
      if ((local_c8 != (longlong *)0x0) && (local_c0 < 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      return 1;
    }
    cVar4 = FUN_140185490(param_2,&local_res8,4);
    if (cVar4 == '\0') {
      local_d8 = local_d8 & 0xffffffff;
      if (local_b8 != (longlong *)0x0) {
        plVar11 = local_b8 + 1;
        *plVar11 = *plVar11 + -1;
        if (*plVar11 == 0) {
          FUN_140148f80(&local_b8,local_b8);
        }
      }
      local_res8 = &local_d0;
      FUN_14019a730(&local_d0);
      if (local_c8 == (longlong *)0x0) {
        return 0;
      }
      if (-1 < local_c0) {
        return 0;
      }
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    local_d8 = CONCAT44(local_res8._0_4_,(int)local_d8);
    if (local_c8 != (longlong *)0x0) {
      FUN_1400a2320(local_88,PTR_u_Cannot_use_internal_buffer_becau_14030c160);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_88,(ThrowInfo *)&DAT_1402f4860);
    }
    if (local_d0 == 0) {
      local_d0 = FUN_14019a770();
      *(undefined8 *)(local_d0 + 0x28) = 1;
    }
    cVar4 = FUN_140185b30(param_2,&local_res8);
    if (((cVar4 != '\0') && (iVar5 = (int)local_res8, -1 < iVar5)) && (iVar5 <= DAT_1402f8140)) {
      if (local_c8 == (longlong *)0x0) {
        if (iVar5 < 1) {
          if (local_d0 == 0) goto LAB_1401be080;
          uVar9 = 0;
        }
        else {
          if (local_d0 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14019a830();
          }
          uVar9 = (ulonglong)local_res8 & 0xffffffff;
        }
        FUN_14003cda0(local_d0,uVar9);
      }
      else {
        if (local_c0._4_4_ < iVar5) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        local_c0 = CONCAT44(local_c0._4_4_,iVar5);
      }
      plVar10 = local_c8;
      if (local_c8 == (longlong *)0x0) {
        if (local_d0 == 0) {
LAB_1401be080:
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        plVar10 = plVar11;
        if (*(int *)(local_d0 + 0x18) != 0) {
          plVar10 = *(longlong **)(local_d0 + 0x10);
        }
      }
      cVar4 = FUN_140185490(param_2,plVar10,(ulonglong)local_res8 & 0xffffffff);
      if (cVar4 != '\0') goto LAB_1401bdfe1;
    }
    if (local_b8 != (longlong *)0x0) {
      plVar11 = local_b8 + 1;
      *plVar11 = *plVar11 + -1;
      if (*plVar11 == 0) {
        FUN_140148f80(&local_b8,local_b8);
      }
    }
    local_res8 = &local_d0;
    FUN_14019a730(&local_d0);
    if ((local_c8 != (longlong *)0x0) && (local_c0 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
  }
  return 0;
}



undefined8 * FUN_1401be130(undefined8 *param_1,undefined8 param_2)

{
  *param_1 = Proud::CRemotePeerReliableUdp::vftable;
  param_1[1] = 0;
  *(undefined1 *)(param_1 + 3) = 0;
  param_1[2] = param_2;
  return param_1;
}



void FUN_1401be150(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  pvVar1 = *(void **)(param_1 + 8);
  if (pvVar1 != (void *)0x0) {
    FUN_1401bbec0(pvVar1);
    operator_delete(pvVar1);
  }
  *(undefined8 *)(param_1 + 8) = 0;
  pvVar1 = operator_new(0x1b0);
  if (pvVar1 == (void *)0x0) {
    *(undefined8 *)(param_1 + 8) = 0;
  }
  else {
    uVar2 = FUN_1401bd2e0(pvVar1,param_1,param_2,param_4,uVar2);
    *(undefined8 *)(param_1 + 8) = uVar2;
  }
  return;
}



undefined8 * FUN_1401be1d0(undefined8 *param_1,uint param_2)

{
  void *pvVar1;
  
  pvVar1 = (void *)param_1[1];
  if (pvVar1 != (void *)0x0) {
    FUN_1401bbec0(pvVar1);
    operator_delete(pvVar1);
  }
  *param_1 = Proud::IReliableUdpHostDelegate::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1401be240(longlong param_1)

{
  *(int *)(param_1 + 8) = *(int *)(param_1 + 8) + 1;
  return;
}



void FUN_1401be250(undefined8 *param_1,int *param_2)

{
  (**(code **)(**(longlong **)*param_1 + 8))();
  if (*param_2 == 1) {
    *(int *)((longlong)param_1 + 0xbc) = *(int *)((longlong)param_1 + 0xbc) + 1;
    param_1[3] = 0;
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401be290(undefined8 *param_1)

{
  double dVar1;
  int iVar2;
  double dVar3;
  
  dVar3 = (double)(**(code **)(**(longlong **)*param_1 + 0x18))();
  if ((double)param_1[0x18] == 0.0) {
    param_1[0x18] = dVar3;
  }
  dVar1 = (double)param_1[0x18];
  if (_DAT_14030c868 < dVar3 - dVar1) {
    iVar2 = *(int *)((longlong)param_1 + 0xbc);
    param_1[0x18] = dVar3;
    *(undefined4 *)((longlong)param_1 + 0xbc) = 0;
    *(int *)(param_1 + 0x19) =
         (int)(((double)iVar2 - (double)*(int *)(param_1 + 0x19)) * (0.1 / (dVar3 - dVar1)) +
              (double)*(int *)(param_1 + 0x19));
  }
  return;
}



undefined4 * FUN_1401be330(undefined4 *param_1,undefined4 *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined8 *)(param_1 + 4) = 0;
  if (*(longlong *)(param_2 + 2) == 0) {
    *(undefined8 *)(param_1 + 2) = 0;
    param_1[7] = param_2[7];
    *(undefined8 *)(param_1 + 4) = *(undefined8 *)(param_2 + 4);
    param_1[6] = param_2[6];
  }
  else {
    plVar1 = (longlong *)(*(longlong *)(param_2 + 2) + 0x28);
    *plVar1 = *plVar1 + 1;
    *(undefined8 *)(param_1 + 2) = *(undefined8 *)(param_2 + 2);
  }
  *(undefined8 *)(param_1 + 10) = *(undefined8 *)(param_2 + 10);
  lVar2 = *(longlong *)(param_2 + 8);
  if (lVar2 != 0) {
    *(longlong *)(lVar2 + 8) = *(longlong *)(lVar2 + 8) + 1;
    *(longlong *)(param_1 + 8) = lVar2;
    param_1[0xc] = param_2[0xc];
    param_1[0xd] = param_2[0xd];
    return param_1;
  }
  *(undefined8 *)(param_1 + 8) = 0;
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  return param_1;
}



longlong FUN_1401be3c0(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  
  if (param_2 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  lVar1 = *param_2;
  if (param_2 == *(longlong **)(param_1 + 8)) {
    *(longlong *)(param_1 + 8) = lVar1;
  }
  else {
    *(longlong *)param_2[1] = lVar1;
  }
  if (param_2 == *(longlong **)(param_1 + 0x10)) {
    *(longlong *)(param_1 + 0x10) = param_2[1];
  }
  else {
    *(longlong *)(*param_2 + 8) = param_2[1];
  }
  FUN_1401bbc60(param_1,param_2);
  return lVar1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401be430(undefined8 *param_1,double param_2)

{
  longlong *plVar1;
  bool bVar2;
  char cVar3;
  longlong *plVar4;
  int iVar5;
  double dVar6;
  double dVar7;
  double dVar8;
  
  dVar6 = (double)(**(code **)(**(longlong **)*param_1 + 0x18))();
  (**(code **)(**(longlong **)*param_1 + 0x30))();
  dVar7 = (double)(longlong)param_1[0x15];
  if ((longlong)param_1[0x15] < 0) {
    dVar7 = dVar7 + 1.8446744073709552e+19;
  }
  dVar8 = dVar7 * _DAT_14030c880;
  if (dVar7 * _DAT_14030c880 <= (double)DAT_14030c888) {
    dVar8 = (double)DAT_14030c888;
  }
  if ((double)DAT_14030c88c <= dVar8) {
    dVar8 = (double)DAT_14030c88c;
  }
  dVar8 = dVar8 * param_2;
  if (DAT_1402f8058 * 5.0 < param_2) {
    dVar8 = dVar8 / (param_2 / DAT_1402f8058);
  }
  iVar5 = (int)dVar8;
  if ((int)dVar8 < 1) {
    iVar5 = 1;
  }
  cVar3 = (**(code **)(**(longlong **)*param_1 + 0x10))();
  plVar1 = (longlong *)param_1[0x13];
joined_r0x0001401be509:
  if ((plVar1 == (longlong *)0x0) || (iVar5 < 1)) {
    return;
  }
  if (plVar1 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000c6c0(0x80004005);
  }
  bVar2 = false;
  plVar4 = plVar1;
  if ((double)plVar1[10] <= dVar6 - (double)plVar1[9] &&
      dVar6 - (double)plVar1[9] != (double)plVar1[10]) goto code_r0x0001401be54d;
  goto LAB_1401be61f;
code_r0x0001401be54d:
  if (0.0 < (double)plVar1[0xb]) {
    dVar8 = dVar6 - (double)plVar1[0xb];
    dVar7 = (double)param_1[0x1a];
    if ((double)param_1[0x1a] <= dVar8) {
      dVar7 = dVar8;
    }
    param_1[0x1a] = dVar7;
  }
  dVar7 = DAT_14030c840 * (double)plVar1[10];
  plVar1[10] = (longlong)dVar7;
  if (DAT_14030c830 <= dVar7) {
    dVar7 = DAT_14030c830;
  }
  *(int *)(plVar1 + 0xc) = (int)plVar1[0xc] + 1;
  plVar1[10] = (longlong)dVar7;
  plVar1[9] = (longlong)dVar6;
  *(int *)((longlong)param_1 + 0xb4) = *(int *)((longlong)param_1 + 0xb4) + 1;
  (**(code **)(**(longlong **)*param_1 + 8))(*(longlong **)*param_1,plVar1 + 2);
  if ((int)plVar1[2] == 1) {
    *(int *)((longlong)param_1 + 0xbc) = *(int *)((longlong)param_1 + 0xbc) + 1;
    param_1[3] = 0;
  }
  if (cVar3 != '\0') {
    plVar4 = (longlong *)*plVar1;
    if (plVar1 == (longlong *)param_1[0x13]) {
      param_1[0x13] = plVar4;
    }
    else {
      *(longlong **)plVar1[1] = plVar4;
    }
    if (plVar1 == (longlong *)param_1[0x14]) {
      param_1[0x14] = plVar1[1];
    }
    else {
      *(longlong *)(*plVar1 + 8) = plVar1[1];
    }
    FUN_1401bbc60(param_1 + 0x12,plVar1);
    bVar2 = true;
  }
  iVar5 = iVar5 + -1;
  plVar1 = plVar4;
  if (!bVar2) {
LAB_1401be61f:
    if (plVar4 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    plVar1 = (longlong *)*plVar4;
  }
  goto joined_r0x0001401be509;
}



undefined8 FUN_1401be670(longlong param_1,int param_2)

{
  undefined8 *puVar1;
  
  puVar1 = *(undefined8 **)(param_1 + 0x98);
  while( true ) {
    if (puVar1 == (undefined8 *)0x0) {
      return 0;
    }
    if (*(int *)((longlong)puVar1 + 0x14) == param_2) break;
    puVar1 = (undefined8 *)*puVar1;
  }
  FUN_1401be3c0(param_1 + 0x90);
  return 1;
}



void FUN_1401be6b0(longlong param_1,int param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  longlong *plVar3;
  
  plVar2 = *(longlong **)(param_1 + 0x98);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000c6c0(0x80004005);
    }
    do {
      if ((*(int *)((longlong)plVar2 + 0x14) == param_2) ||
         ((uint)(*(int *)((longlong)plVar2 + 0x14) - param_2) < 0x80000000)) {
        plVar3 = (longlong *)*plVar2;
      }
      else {
        plVar3 = (longlong *)*plVar2;
        if (plVar2 == *(longlong **)(param_1 + 0x98)) {
          *(longlong **)(param_1 + 0x98) = plVar3;
        }
        else {
          *(longlong **)plVar2[1] = plVar3;
        }
        if (plVar2 == *(longlong **)(param_1 + 0xa0)) {
          *(longlong *)(param_1 + 0xa0) = plVar2[1];
        }
        else {
          *(longlong *)(*plVar2 + 8) = plVar2[1];
        }
        if (plVar2[6] != 0) {
          plVar1 = (longlong *)(plVar2[6] + 8);
          *plVar1 = *plVar1 + -1;
          if (*plVar1 == 0) {
            FUN_140148f80(plVar2 + 6,plVar2[6]);
          }
        }
        FUN_14019a730(plVar2 + 3);
        if (plVar2[4] != 0) {
          if (*(int *)((longlong)plVar2 + 0x2c) < 0) {
                    // WARNING: Subroutine does not return
            FUN_1400a26d0();
          }
          *(undefined4 *)(plVar2 + 5) = 0;
        }
        plVar1 = *(longlong **)(param_1 + 0x90);
        if (plVar1 == (longlong *)0x0) {
          FUN_1400a3530(plVar2);
          *(longlong *)(param_1 + 0xa8) = *(longlong *)(param_1 + 0xa8) + -1;
        }
        else {
          (**(code **)(*plVar1 + 0x10))(plVar1,plVar2);
          *(longlong *)(param_1 + 0xa8) = *(longlong *)(param_1 + 0xa8) + -1;
        }
      }
      plVar2 = plVar3;
    } while (plVar3 != (longlong *)0x0);
  }
  return;
}



void FUN_1401be7e0(undefined8 *param_1)

{
  longlong *plVar1;
  longlong *plVar2;
  undefined8 uVar3;
  longlong *plVar4;
  char cVar5;
  undefined8 *puVar6;
  longlong lVar7;
  double dVar8;
  double dVar9;
  
  lVar7 = (**(code **)(**(longlong **)*param_1 + 0x18))();
  dVar8 = (double)(**(code **)(**(longlong **)*param_1 + 0x30))();
  cVar5 = (**(code **)(**(longlong **)*param_1 + 0x10))();
  plVar4 = (longlong *)param_1[0xf];
  while( true ) {
    if (plVar4 == (longlong *)0x0) {
      return;
    }
    if (plVar4 == (longlong *)0x0) break;
    plVar4[9] = lVar7;
    plVar4[0xb] = lVar7;
    if (dVar8 * 2.0 <= 0.0) {
      plVar4[10] = DAT_14030c828;
    }
    else {
      plVar4[10] = (longlong)(dVar8 * 2.0);
    }
    dVar9 = (double)plVar4[10];
    if ((double)plVar4[10] <= DAT_14030c838) {
      dVar9 = DAT_14030c838;
    }
    plVar4[10] = (longlong)dVar9;
    if (DAT_14030c830 <= dVar9) {
      dVar9 = DAT_14030c830;
    }
    plVar4[10] = (longlong)dVar9;
    *(int *)(param_1 + 0x17) = *(int *)(param_1 + 0x17) + 1;
    (**(code **)(**(longlong **)*param_1 + 8))(*(longlong **)*param_1,plVar4 + 2);
    if ((int)plVar4[2] == 1) {
      *(int *)((longlong)param_1 + 0xbc) = *(int *)((longlong)param_1 + 0xbc) + 1;
      param_1[3] = 0;
    }
    if (cVar5 == '\0') {
      plVar2 = (longlong *)param_1[0x12];
      uVar3 = param_1[0x14];
      if (plVar2 == (longlong *)0x0) {
        puVar6 = (undefined8 *)FUN_1400a34c0(0x68);
      }
      else {
        puVar6 = (undefined8 *)(**(code **)(*plVar2 + 8))(plVar2,0x68);
      }
      if (puVar6 != (undefined8 *)0x0) {
        FUN_1401be330(puVar6 + 2,plVar4 + 2);
        puVar6[9] = plVar4[9];
        puVar6[10] = plVar4[10];
        puVar6[0xb] = plVar4[0xb];
        *(int *)(puVar6 + 0xc) = (int)plVar4[0xc];
      }
      puVar6[1] = uVar3;
      *puVar6 = 0;
      param_1[0x15] = param_1[0x15] + 1;
      if ((undefined8 *)param_1[0x14] == (undefined8 *)0x0) {
        param_1[0x13] = puVar6;
      }
      else {
        *(undefined8 *)param_1[0x14] = puVar6;
      }
      param_1[0x14] = puVar6;
    }
    plVar2 = (longlong *)*plVar4;
    if (plVar4 == (longlong *)param_1[0xf]) {
      param_1[0xf] = plVar2;
    }
    else {
      *(longlong **)plVar4[1] = plVar2;
    }
    if (plVar4 == (longlong *)param_1[0x10]) {
      param_1[0x10] = plVar4[1];
    }
    else {
      *(longlong *)(*plVar4 + 8) = plVar4[1];
    }
    if (plVar4[6] != 0) {
      plVar1 = (longlong *)(plVar4[6] + 8);
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_140148f80(plVar4 + 6,plVar4[6]);
      }
    }
    FUN_14019a730(plVar4 + 3);
    if (plVar4[4] != 0) {
      if (*(int *)((longlong)plVar4 + 0x2c) < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      *(undefined4 *)(plVar4 + 5) = 0;
    }
    plVar1 = (longlong *)param_1[0xe];
    if (plVar1 == (longlong *)0x0) {
      FUN_1400a3530(plVar4);
    }
    else {
      (**(code **)(*plVar1 + 0x10))(plVar1,plVar4);
    }
    param_1[0x11] = param_1[0x11] + -1;
    plVar4 = plVar2;
  }
                    // WARNING: Subroutine does not return
  FUN_14000c6c0(0x80004005);
}



void FUN_1401bea80(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  longlong *plVar2;
  int iVar3;
  undefined8 *puVar4;
  longlong lVar5;
  uint uVar6;
  undefined8 *puVar7;
  uint uVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  undefined8 *puVar11;
  double dVar12;
  longlong local_80;
  undefined8 *local_78;
  undefined8 local_70;
  undefined8 *local_68;
  undefined8 local_60;
  undefined4 local_58;
  undefined4 local_54;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined4 local_38;
  
  dVar12 = (double)(**(code **)(**(longlong **)*param_1 + 0x18))
                             (*(longlong **)*param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  if (((((char)param_2 != '\0') ||
       (iVar3 = (**(code **)(**(longlong **)*param_1 + 0x20))(), iVar3 == 0)) ||
      (DAT_14030c878 < dVar12 - (double)param_1[4])) &&
     (param_1[4] = dVar12, 0 < (longlong)param_1[0xd])) {
    puVar11 = (undefined8 *)0x0;
    do {
      local_60 = (**(code **)(**(longlong **)*param_1 + 0x38))();
      local_70 = 0;
      local_78 = (undefined8 *)0x0;
      local_80 = 0;
      local_68 = (undefined8 *)0x0;
      local_54 = 0;
      local_40 = 0;
      local_50 = 0;
      local_48 = 0;
      local_38 = 0;
      iVar3 = *(int *)(param_1 + 1);
      *(int *)(param_1 + 1) = iVar3 + 1;
      uVar8 = DAT_14031d598;
      if ((int)(uint)param_1[0xd] <= (int)DAT_14031d598) {
        uVar8 = (uint)param_1[0xd];
      }
      local_80 = FUN_14019a770();
      *(undefined8 *)(local_80 + 0x28) = 1;
      if ((int)uVar8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      if (local_78 == (undefined8 *)0x0) {
        if ((int)uVar8 < 1) {
          if (local_80 == 0) goto LAB_1401bebbb;
          uVar6 = 0;
        }
        else {
          uVar6 = uVar8;
          if (local_80 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14019a830();
          }
        }
        FUN_14003cda0(local_80,uVar6);
      }
      else {
        if (local_70._4_4_ < (int)uVar8) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        local_70 = CONCAT44(local_70._4_4_,uVar8);
      }
LAB_1401bebbb:
      puVar7 = puVar11;
      if (*(int *)(param_1 + 10) != 0) {
        puVar7 = (undefined8 *)param_1[9];
      }
      puVar7 = (undefined8 *)((longlong)puVar7 + param_1[0xc]);
      puVar4 = local_78;
      if (local_78 == (undefined8 *)0x0) {
        if (local_80 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        puVar4 = puVar11;
        if (*(int *)(local_80 + 0x18) != 0) {
          puVar4 = *(undefined8 **)(local_80 + 0x10);
        }
      }
      uVar9 = (ulonglong)(int)uVar8;
      if (uVar9 < 0x21) {
        uVar10 = (ulonglong)(uVar8 & 7);
        for (uVar9 = uVar9 >> 3; uVar9 != 0; uVar9 = uVar9 - 1) {
          *puVar4 = *puVar7;
          puVar4 = puVar4 + 1;
          puVar7 = puVar7 + 1;
        }
        if (uVar10 != 0) {
          lVar5 = (longlong)puVar4 - (longlong)puVar7;
          do {
            *(undefined1 *)(lVar5 + (longlong)puVar7) = *(undefined1 *)puVar7;
            puVar7 = (undefined8 *)((longlong)puVar7 + 1);
            uVar10 = uVar10 - 1;
          } while (uVar10 != 0);
        }
      }
      else {
        memcpy(puVar4,puVar7,uVar9);
      }
      uVar1 = param_1[0x10];
      plVar2 = (longlong *)param_1[0xe];
      if (plVar2 == (longlong *)0x0) {
        puVar7 = (undefined8 *)FUN_1400a34c0(0x68);
      }
      else {
        puVar7 = (undefined8 *)(**(code **)(*plVar2 + 8))(plVar2,0x68);
      }
      if (puVar7 != (undefined8 *)0x0) {
        *(undefined4 *)(puVar7 + 2) = 1;
        *(int *)((longlong)puVar7 + 0x14) = iVar3;
        puVar7[5] = 0;
        puVar7[4] = 0;
        if (local_80 == 0) {
          puVar7[3] = 0;
          *(int *)((longlong)puVar7 + 0x2c) = local_70._4_4_;
          puVar7[4] = local_78;
          *(undefined4 *)(puVar7 + 5) = (undefined4)local_70;
        }
        else {
          *(longlong *)(local_80 + 0x28) = *(longlong *)(local_80 + 0x28) + 1;
          puVar7[3] = local_80;
        }
        puVar7[7] = local_60;
        puVar4 = puVar11;
        if (local_68 != (undefined8 *)0x0) {
          local_68[1] = local_68[1] + 1;
          puVar4 = local_68;
        }
        puVar7[6] = puVar4;
        *(undefined4 *)(puVar7 + 8) = local_58;
        *(undefined4 *)((longlong)puVar7 + 0x44) = local_54;
        puVar7[9] = local_50;
        puVar7[10] = local_48;
        puVar7[0xb] = local_40;
        *(undefined4 *)(puVar7 + 0xc) = local_38;
      }
      puVar7[1] = uVar1;
      *puVar7 = 0;
      param_1[0x11] = param_1[0x11] + 1;
      if ((undefined8 *)param_1[0x10] == (undefined8 *)0x0) {
        param_1[0xf] = puVar7;
      }
      else {
        *(undefined8 *)param_1[0x10] = puVar7;
      }
      param_1[0x10] = puVar7;
      FUN_1401c13e0(param_1 + 6);
      if (local_68 != (undefined8 *)0x0) {
        plVar2 = local_68 + 1;
        *plVar2 = *plVar2 + -1;
        if (*plVar2 == 0) {
          FUN_140148f80(&local_68);
        }
      }
      FUN_14019a730(&local_80);
      if ((local_78 != (undefined8 *)0x0) && (local_70 < 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
    } while (0 < (longlong)param_1[0xd]);
  }
  return;
}



undefined8 *
FUN_1401bede0(undefined8 *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  FUN_1401c10f0(param_1 + 6,(longlong)DAT_1402f80ec,param_3,param_4,0xfffffffffffffffe);
  param_1[0xe] = 0;
  param_1[0x11] = 0;
  param_1[0xf] = 0;
  param_1[0x10] = 0;
  FUN_14016a780();
  param_1[0x12] = 0;
  param_1[0x15] = 0;
  param_1[0x13] = 0;
  param_1[0x14] = 0;
  FUN_14016a780();
  param_1[4] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[0x16] = 0;
  *(undefined4 *)(param_1 + 0x17) = 0;
  *(undefined4 *)((longlong)param_1 + 0xbc) = DAT_14030c854;
  param_1[0x18] = 0;
  *(undefined4 *)(param_1 + 0x19) = DAT_14030c854;
  *(undefined4 *)((longlong)param_1 + 0x2c) = DAT_14031d5a0;
  *(undefined4 *)((longlong)param_1 + 0xc) = DAT_14030c854;
  *(undefined4 *)(param_1 + 1) = param_3;
  *param_1 = param_2;
  *(undefined4 *)(param_1 + 0x1b) = 0;
  param_1[0x1a] = 0;
  *(undefined4 *)((longlong)param_1 + 0xdc) = param_3;
  param_1[0x1c] = 0;
  *(undefined4 *)(param_1 + 5) = 0;
  return param_1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401beee0(longlong param_1,float param_2)

{
  int iVar1;
  
  FUN_1401be290();
  *(double *)(param_1 + 0x10) = (double)param_2 + *(double *)(param_1 + 0x10);
  *(double *)(param_1 + 0x18) = (double)param_2 + *(double *)(param_1 + 0x18);
  iVar1 = DAT_14031d5a0;
  if ((double)*(int *)(param_1 + 0xc) < (double)*(int *)(param_1 + 200) * _DAT_14030c870) {
    iVar1 = (int)(double)*(int *)(param_1 + 0xc) + 1;
  }
  *(int *)(param_1 + 0x2c) = iVar1;
  FUN_1401bea80(param_1,0);
  FUN_1401be430(param_1,(double)param_2);
  FUN_1401be7e0(param_1);
  return;
}



void FUN_1401bef80(longlong param_1,longlong param_2)

{
  *(longlong *)(param_1 + 0x78) = param_2;
  *(undefined4 *)(param_1 + 0x70) = 0;
  if (param_2 + 0x80U < 0x100) {
    *(undefined1 *)(param_1 + 0xc) = 1;
    *(int *)(param_1 + 0x70) = *(int *)(param_1 + 0x70) + 1;
    *(char *)((longlong)*(int *)(param_1 + 0x70) + 0xc + param_1) = (char)param_2;
    *(int *)(param_1 + 0x70) = *(int *)(param_1 + 0x70) + 1;
    return;
  }
  if (param_2 + 0x8000U < 0x10000) {
    *(undefined1 *)(param_1 + 0xc) = 2;
    *(int *)(param_1 + 0x70) = *(int *)(param_1 + 0x70) + 1;
    *(short *)((longlong)*(int *)(param_1 + 0x70) + 0xc + param_1) = (short)param_2;
    *(int *)(param_1 + 0x70) = *(int *)(param_1 + 0x70) + 2;
    return;
  }
  if (param_2 + 0x80000000U < 0x100000000) {
    *(undefined1 *)(param_1 + 0xc) = 4;
    *(int *)(param_1 + 0x70) = *(int *)(param_1 + 0x70) + 1;
    *(int *)((longlong)*(int *)(param_1 + 0x70) + 0xc + param_1) = (int)param_2;
    *(int *)(param_1 + 0x70) = *(int *)(param_1 + 0x70) + 4;
    return;
  }
  *(undefined1 *)(param_1 + 0xc) = 8;
  *(int *)(param_1 + 0x70) = *(int *)(param_1 + 0x70) + 1;
  *(longlong *)((longlong)*(int *)(param_1 + 0x70) + 0xc + param_1) = param_2;
  *(int *)(param_1 + 0x70) = *(int *)(param_1 + 0x70) + 8;
  return;
}



ulonglong FUN_1401bf010(undefined8 *param_1,char *param_2,int param_3)

{
  char cVar1;
  short sVar2;
  int iVar3;
  undefined8 uVar4;
  uint uVar5;
  ulonglong in_RAX;
  
  *(undefined4 *)(param_1 + 0x10) = 0;
  *param_1 = param_2;
  *(int *)(param_1 + 1) = param_3;
  if (0 < param_3) {
    uVar5 = (uint)*param_2;
    in_RAX = (ulonglong)uVar5;
    *(undefined4 *)(param_1 + 0x10) = 1;
    if (uVar5 == 1) {
      if (1 < param_3) {
        cVar1 = param_2[1];
        *(undefined4 *)(param_1 + 0x10) = 2;
        param_1[0xf] = (longlong)cVar1;
        return CONCAT71(cVar1 >> 7,1);
      }
    }
    else if (uVar5 == 2) {
      if (2 < param_3) {
        sVar2 = *(short *)(param_2 + 1);
        *(undefined4 *)(param_1 + 0x10) = 3;
        param_1[0xf] = (longlong)sVar2;
        return CONCAT71((int7)(char)((ushort)sVar2 >> 8),1);
      }
    }
    else if (uVar5 == 4) {
      if (4 < param_3) {
        iVar3 = *(int *)(param_2 + 1);
        *(undefined4 *)(param_1 + 0x10) = 5;
        param_1[0xf] = (longlong)iVar3;
        return CONCAT71((int7)(int3)((uint)iVar3 >> 8),1);
      }
    }
    else if ((uVar5 == 8) && (8 < param_3)) {
      uVar4 = *(undefined8 *)(param_2 + 1);
      *(undefined4 *)(param_1 + 0x10) = 9;
      param_1[0xf] = uVar4;
      return CONCAT71((int7)((ulonglong)uVar4 >> 8),1);
    }
  }
  return in_RAX & 0xffffffffffffff00;
}



ulonglong FUN_1401bf0f0(undefined8 param_1,undefined4 *param_2,undefined8 param_3,undefined4 param_4
                       )

{
  uint uVar1;
  ulonglong uVar2;
  undefined8 local_68;
  undefined4 local_60;
  undefined8 local_58;
  undefined4 local_50;
  undefined4 local_4c;
  undefined1 *local_38;
  undefined1 *local_30;
  undefined8 local_28;
  
  local_50 = *param_2;
  local_38 = &LAB_1401bf0d0;
  local_30 = &LAB_1401bf0e0;
  local_28 = 0;
  local_68 = param_3;
  local_60 = param_4;
  local_58 = param_1;
  uVar2 = FUN_1401c97a0(&local_68,0xffffffff,"1.2.5",0x58);
  if ((int)uVar2 == 0) {
    uVar1 = FUN_1401c8bf0(&local_68,4);
    uVar2 = (ulonglong)uVar1;
    if (uVar1 != 1) {
      FUN_1401c7440(&local_68);
      if (uVar1 == 0) {
        uVar2 = 0xfffffffb;
      }
      return uVar2;
    }
    *param_2 = local_4c;
    uVar2 = FUN_1401c7440(&local_68);
  }
  return uVar2;
}



ulonglong FUN_1401bf1b0(undefined8 param_1,undefined4 *param_2,undefined8 param_3,int param_4)

{
  uint uVar1;
  ulonglong uVar2;
  undefined8 local_68;
  int local_60;
  undefined8 local_58;
  undefined4 local_50;
  undefined4 local_4c;
  undefined1 *local_38;
  undefined1 *local_30;
  
  local_50 = *param_2;
  local_38 = &LAB_1401bf0d0;
  local_30 = &LAB_1401bf0e0;
  local_68 = param_3;
  local_60 = param_4;
  local_58 = param_1;
  uVar2 = FUN_1401bf4c0(&local_68,"1.2.5",0x58);
  if ((int)uVar2 == 0) {
    uVar1 = FUN_1401bf960(&local_68,4);
    if (uVar1 != 1) {
      FUN_1401bf5d0(&local_68);
      if ((uVar1 != 2) && ((uVar1 != 0xfffffffb || (local_60 != 0)))) {
        return (ulonglong)uVar1;
      }
      return 0xfffffffd;
    }
    *param_2 = local_4c;
    uVar2 = FUN_1401bf5d0(&local_68);
  }
  return uVar2;
}



int FUN_1401bf280(uint param_1)

{
  return (param_1 >> 0xc) + 0xd + (param_1 >> 0xe) + param_1 + (param_1 >> 0x19);
}



undefined8 FUN_1401bf2a0(longlong param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  if ((param_1 != 0) && (puVar2 = *(undefined8 **)(param_1 + 0x28), puVar2 != (undefined8 *)0x0)) {
    *(undefined4 *)((longlong)puVar2 + 0x1c) = 0;
    *(undefined4 *)(param_1 + 0x1c) = 0;
    *(undefined4 *)(param_1 + 0xc) = 0;
    *(undefined8 *)(param_1 + 0x20) = 0;
    *(undefined4 *)(param_1 + 0x4c) = 1;
    *puVar2 = 0;
    *(undefined4 *)((longlong)puVar2 + 0xc) = 0;
    puVar2[4] = 0;
    *(undefined8 *)((longlong)puVar2 + 0x2c) = 0;
    *(undefined4 *)((longlong)puVar2 + 0x34) = 0;
    puVar2[8] = 0;
    puVar1 = puVar2 + 0xa9;
    puVar2[0x10] = puVar1;
    puVar2[0xc] = puVar1;
    puVar2[0xb] = puVar1;
    *(undefined4 *)((longlong)puVar2 + 0x14) = 0x8000;
    *(undefined4 *)(puVar2 + 0x37b) = 1;
    *(undefined4 *)((longlong)puVar2 + 0x1bdc) = 0xffffffff;
    return 0;
  }
  return 0xfffffffe;
}



undefined8 FUN_1401bf320(longlong param_1,uint param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  int iVar3;
  
  if ((param_1 != 0) && (lVar1 = *(longlong *)(param_1 + 0x28), lVar1 != 0)) {
    if ((int)param_2 < 0) {
      iVar3 = 0;
      param_2 = -param_2;
    }
    else {
      iVar3 = ((int)param_2 >> 4) + 1;
      if ((int)param_2 < 0x30) {
        param_2 = param_2 & 0xf;
      }
    }
    if ((param_2 == 0) || ((7 < (int)param_2 && ((int)param_2 < 0x10)))) {
      if ((*(longlong *)(lVar1 + 0x38) != 0) && (*(uint *)(lVar1 + 0x28) != param_2)) {
        (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40));
        *(undefined8 *)(lVar1 + 0x38) = 0;
      }
      *(int *)(lVar1 + 8) = iVar3;
      *(uint *)(lVar1 + 0x28) = param_2;
      uVar2 = FUN_1401bf2a0(param_1);
    }
    else {
      uVar2 = 0xfffffffe;
    }
    return uVar2;
  }
  return 0xfffffffe;
}



int FUN_1401bf3d0(longlong param_1,undefined4 param_2,char *param_3,int param_4)

{
  int iVar1;
  code *pcVar2;
  longlong lVar3;
  
  if (((param_3 != (char *)0x0) && (*param_3 == '1')) && (param_4 == 0x58)) {
    if (param_1 != 0) {
      *(undefined8 *)(param_1 + 0x20) = 0;
      if (*(longlong *)(param_1 + 0x30) == 0) {
        *(undefined8 *)(param_1 + 0x40) = 0;
        *(code **)(param_1 + 0x30) = FUN_1401c97e0;
      }
      pcVar2 = *(code **)(param_1 + 0x38);
      if (pcVar2 == (code *)0x0) {
        pcVar2 = FUN_1401c97f0;
      }
      *(code **)(param_1 + 0x38) = pcVar2;
      lVar3 = (**(code **)(param_1 + 0x30))(*(undefined8 *)(param_1 + 0x40),1,0x1be8);
      if (lVar3 == 0) {
        iVar1 = -4;
      }
      else {
        *(longlong *)(param_1 + 0x28) = lVar3;
        *(undefined8 *)(lVar3 + 0x38) = 0;
        iVar1 = FUN_1401bf320(param_1,param_2);
        if (iVar1 != 0) {
          (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40),lVar3);
          *(undefined8 *)(param_1 + 0x28) = 0;
        }
      }
      return iVar1;
    }
    return -2;
  }
  return -6;
}



void FUN_1401bf4c0(undefined8 param_1,undefined8 param_2,undefined4 param_3)

{
  FUN_1401bf3d0(param_1,0xf,param_2,param_3);
  return;
}



undefined8 FUN_1401bf4d0(longlong param_1,int param_2)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  uint uVar4;
  uint uVar5;
  
  lVar1 = *(longlong *)(param_1 + 0x28);
  if (*(longlong *)(lVar1 + 0x38) == 0) {
    lVar3 = (**(code **)(param_1 + 0x30))
                      (*(undefined8 *)(param_1 + 0x40),
                       1 << ((byte)*(undefined4 *)(lVar1 + 0x28) & 0x1f),1);
    *(longlong *)(lVar1 + 0x38) = lVar3;
    if (lVar3 == 0) {
      return 1;
    }
  }
  if (*(int *)(lVar1 + 0x2c) == 0) {
    *(undefined8 *)(lVar1 + 0x30) = 0;
    *(int *)(lVar1 + 0x2c) = 1 << ((byte)*(undefined4 *)(lVar1 + 0x28) & 0x1f);
  }
  uVar4 = param_2 - *(int *)(param_1 + 0x18);
  uVar5 = *(uint *)(lVar1 + 0x2c);
  if (uVar4 < uVar5) {
    uVar5 = uVar5 - *(int *)(lVar1 + 0x34);
    if (uVar4 < uVar5) {
      uVar5 = uVar4;
    }
    memcpy((void *)((ulonglong)*(uint *)(lVar1 + 0x34) + *(longlong *)(lVar1 + 0x38)),
           (void *)(*(longlong *)(param_1 + 0x10) - (ulonglong)uVar4),(ulonglong)uVar5);
    uVar4 = uVar4 - uVar5;
    if (uVar4 == 0) {
      *(int *)(lVar1 + 0x34) = *(int *)(lVar1 + 0x34) + uVar5;
      uVar4 = *(uint *)(lVar1 + 0x34);
      if (*(uint *)(lVar1 + 0x34) == *(uint *)(lVar1 + 0x2c)) {
        uVar4 = 0;
      }
      *(uint *)(lVar1 + 0x34) = uVar4;
      if (*(uint *)(lVar1 + 0x2c) <= *(uint *)(lVar1 + 0x30)) {
        return 0;
      }
      iVar2 = *(uint *)(lVar1 + 0x30) + uVar5;
    }
    else {
      memcpy(*(void **)(lVar1 + 0x38),(void *)(*(longlong *)(param_1 + 0x10) - (ulonglong)uVar4),
             (ulonglong)uVar4);
      iVar2 = *(int *)(lVar1 + 0x2c);
      *(uint *)(lVar1 + 0x34) = uVar4;
    }
  }
  else {
    memcpy(*(void **)(lVar1 + 0x38),(void *)(*(longlong *)(param_1 + 0x10) - (ulonglong)uVar5),
           (ulonglong)uVar5);
    iVar2 = *(int *)(lVar1 + 0x2c);
    *(undefined4 *)(lVar1 + 0x34) = 0;
  }
  *(int *)(lVar1 + 0x30) = iVar2;
  return 0;
}



undefined8 FUN_1401bf5d0(longlong param_1)

{
  if (((param_1 != 0) && (*(longlong *)(param_1 + 0x28) != 0)) &&
     (*(code **)(param_1 + 0x38) != (code *)0x0)) {
    if (*(longlong *)(*(longlong *)(param_1 + 0x28) + 0x38) != 0) {
      (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40));
    }
    (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40),*(undefined8 *)(param_1 + 0x28));
    *(undefined8 *)(param_1 + 0x28) = 0;
    return 0;
  }
  return 0xfffffffe;
}



uint FUN_1401bf630(uint param_1,uint *param_2,uint param_3)

{
  ulonglong uVar1;
  uint uVar2;
  uint *puVar3;
  
  param_1 = ~param_1;
  for (; (param_3 != 0 && (((ulonglong)param_2 & 3) != 0));
      param_2 = (uint *)((longlong)param_2 + 1)) {
    param_1 = *(uint *)(&DAT_140264cd0 + (ulonglong)(byte)((byte)*param_2 ^ (byte)param_1) * 4) ^
              param_1 >> 8;
    param_3 = param_3 - 1;
  }
  if (0x1f < param_3) {
    uVar1 = (ulonglong)(param_3 >> 5);
    puVar3 = param_2;
    do {
      param_1 = param_1 ^ *puVar3;
      uVar2 = *(uint *)(&DAT_1402650d0 + (ulonglong)(byte)(param_1 >> 0x10) * 4) ^
              *(uint *)(&DAT_1402654d0 + (ulonglong)(byte)(param_1 >> 8) * 4) ^
              *(uint *)(&DAT_140264cd0 + (ulonglong)(param_1 >> 0x18) * 4) ^
              *(uint *)(&DAT_1402658d0 + (ulonglong)(param_1 & 0xff) * 4) ^ puVar3[1];
      uVar2 = *(uint *)(&DAT_1402650d0 + (ulonglong)(byte)(uVar2 >> 0x10) * 4) ^
              *(uint *)(&DAT_1402654d0 + (ulonglong)(byte)(uVar2 >> 8) * 4) ^
              *(uint *)(&DAT_140264cd0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_1402658d0 + (ulonglong)(uVar2 & 0xff) * 4) ^ puVar3[2];
      uVar2 = *(uint *)(&DAT_1402650d0 + (ulonglong)(byte)(uVar2 >> 0x10) * 4) ^
              *(uint *)(&DAT_1402654d0 + (ulonglong)(byte)(uVar2 >> 8) * 4) ^
              *(uint *)(&DAT_140264cd0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_1402658d0 + (ulonglong)(uVar2 & 0xff) * 4) ^ puVar3[3];
      uVar2 = *(uint *)(&DAT_1402650d0 + (ulonglong)(byte)(uVar2 >> 0x10) * 4) ^
              *(uint *)(&DAT_1402654d0 + (ulonglong)(byte)(uVar2 >> 8) * 4) ^
              *(uint *)(&DAT_140264cd0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_1402658d0 + (ulonglong)(uVar2 & 0xff) * 4) ^ puVar3[4];
      uVar2 = *(uint *)(&DAT_1402650d0 + (ulonglong)(byte)(uVar2 >> 0x10) * 4) ^
              *(uint *)(&DAT_1402654d0 + (ulonglong)(byte)(uVar2 >> 8) * 4) ^
              *(uint *)(&DAT_140264cd0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_1402658d0 + (ulonglong)(uVar2 & 0xff) * 4) ^ puVar3[5];
      param_2 = puVar3 + 8;
      param_3 = param_3 - 0x20;
      uVar2 = *(uint *)(&DAT_1402650d0 + (ulonglong)(byte)(uVar2 >> 0x10) * 4) ^
              *(uint *)(&DAT_1402654d0 + (ulonglong)(byte)(uVar2 >> 8) * 4) ^
              *(uint *)(&DAT_140264cd0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_1402658d0 + (ulonglong)(uVar2 & 0xff) * 4) ^ puVar3[6];
      uVar2 = *(uint *)(&DAT_1402650d0 + (ulonglong)(byte)(uVar2 >> 0x10) * 4) ^
              *(uint *)(&DAT_1402654d0 + (ulonglong)(byte)(uVar2 >> 8) * 4) ^
              *(uint *)(&DAT_140264cd0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_1402658d0 + (ulonglong)(uVar2 & 0xff) * 4) ^ puVar3[7];
      param_1 = *(uint *)(&DAT_1402650d0 + (ulonglong)(byte)(uVar2 >> 0x10) * 4) ^
                *(uint *)(&DAT_1402654d0 + (ulonglong)(byte)(uVar2 >> 8) * 4) ^
                *(uint *)(&DAT_140264cd0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
                *(uint *)(&DAT_1402658d0 + (ulonglong)(uVar2 & 0xff) * 4);
      uVar1 = uVar1 - 1;
      puVar3 = param_2;
    } while (uVar1 != 0);
  }
  if (3 < param_3) {
    uVar1 = (ulonglong)(param_3 >> 2);
    do {
      param_1 = param_1 ^ *param_2;
      param_2 = param_2 + 1;
      param_3 = param_3 - 4;
      param_1 = *(uint *)(&DAT_1402650d0 + (ulonglong)(byte)(param_1 >> 0x10) * 4) ^
                *(uint *)(&DAT_1402654d0 + (ulonglong)(byte)(param_1 >> 8) * 4) ^
                *(uint *)(&DAT_140264cd0 + (ulonglong)(param_1 >> 0x18) * 4) ^
                *(uint *)(&DAT_1402658d0 + (ulonglong)(param_1 & 0xff) * 4);
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0);
  }
  for (; param_3 != 0; param_3 = param_3 - 1) {
    uVar2 = *param_2;
    param_2 = (uint *)((longlong)param_2 + 1);
    param_1 = *(uint *)(&DAT_140264cd0 + (ulonglong)(byte)((byte)uVar2 ^ (byte)param_1) * 4) ^
              param_1 >> 8;
  }
  return ~param_1;
}



undefined8 FUN_1401bf950(undefined8 param_1,longlong param_2)

{
  undefined8 uVar1;
  
  if (param_2 == 0) {
    return 0;
  }
  uVar1 = FUN_1401bf630();
  return uVar1;
}



int FUN_1401bf960(longlong *param_1,int param_2)

{
  byte bVar1;
  uint *puVar2;
  uint uVar3;
  char cVar4;
  int iVar5;
  int iVar6;
  uint uVar7;
  uint uVar8;
  byte bVar9;
  ushort uVar10;
  uint uVar11;
  uint uVar12;
  uint uVar13;
  longlong lVar14;
  uint uVar15;
  uint uVar16;
  byte *pbVar17;
  ulonglong uVar18;
  undefined1 *puVar19;
  undefined1 *puVar20;
  byte *_Src;
  uint uVar21;
  ulonglong uVar22;
  int local_res18;
  uint local_res20;
  undefined2 local_68;
  undefined1 local_66;
  undefined1 local_65;
  undefined4 local_64;
  uint local_60;
  uint local_5c;
  undefined1 *local_58;
  
  if ((((param_1 == (longlong *)0x0) || (puVar2 = (uint *)param_1[5], puVar2 == (uint *)0x0)) ||
      (param_1[2] == 0)) || ((*param_1 == 0 && ((int)param_1[1] != 0)))) {
    return -2;
  }
  uVar16 = *puVar2;
  uVar7 = puVar2[0x11];
  uVar8 = puVar2[0x10];
  if (uVar16 == 0xb) {
    uVar16 = 0xc;
  }
  *puVar2 = uVar16;
  uVar11 = *(uint *)(param_1 + 3);
  puVar19 = (undefined1 *)param_1[2];
  uVar15 = *(uint *)(param_1 + 1);
  _Src = (byte *)*param_1;
  local_res18 = 0;
  local_res20 = uVar11;
  local_60 = uVar11;
  local_58 = puVar19;
  local_5c = uVar15;
  do {
    if (0x1e < uVar16) {
      return -2;
    }
    uVar22 = 0;
    uVar21 = 0;
    uVar13 = uVar15;
    uVar12 = local_64;
    switch(uVar16) {
    case 0:
      if (puVar2[2] == 0) {
        *puVar2 = 0xc;
      }
      else {
        for (; uVar7 < 0x10; uVar7 = uVar7 + 8) {
          uVar13 = 0;
          if (uVar15 == 0) goto LAB_1401c01fe;
          bVar1 = *_Src;
          uVar15 = uVar15 - 1;
          _Src = _Src + 1;
          uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
        }
        if (((puVar2[2] & 2) == 0) || (uVar8 != 0x8b1f)) {
          puVar2[4] = 0;
          if (*(longlong *)(puVar2 + 8) != 0) {
            *(undefined4 *)(*(longlong *)(puVar2 + 8) + 0x40) = 0xffffffff;
          }
          if (((puVar2[2] & 1) == 0) ||
             (uVar16 = (uVar8 & 0xff) * 0x100 + (uVar8 >> 8), uVar16 != (uVar16 / 0x1f) * 0x1f)) {
            param_1[4] = (longlong)"incorrect header check";
            *puVar2 = 0x1d;
          }
          else {
            if (((byte)uVar8 & 0xf) != 8) goto LAB_1401bfaff;
            uVar7 = uVar7 - 4;
            uVar16 = (uVar8 >> 4 & 0xf) + 8;
            if (puVar2[10] == 0) {
              puVar2[10] = uVar16;
            }
            else if (puVar2[10] < uVar16) {
              param_1[4] = (longlong)"invalid window size";
              *puVar2 = 0x1d;
              uVar8 = uVar8 >> 4;
              break;
            }
            puVar2[5] = 1 << (sbyte)uVar16;
            uVar16 = FUN_1401c70b0(0,0,0);
            puVar2[6] = uVar16;
            *(uint *)((longlong)param_1 + 0x4c) = uVar16;
            uVar7 = 0;
            *puVar2 = ~(uVar8 >> 0xc) & 2 | 9;
            uVar8 = 0;
            puVar19 = local_58;
            uVar11 = local_res20;
          }
        }
        else {
          uVar16 = FUN_1401bf950(0,0,0);
          puVar2[6] = uVar16;
          local_68 = 0x8b1f;
          uVar16 = FUN_1401bf630(uVar16,&local_68,2);
          uVar8 = 0;
          uVar7 = 0;
          puVar2[6] = uVar16;
          *puVar2 = 1;
          puVar19 = local_58;
          uVar11 = local_res20;
        }
      }
      break;
    case 1:
      for (; uVar7 < 0x10; uVar7 = uVar7 + 8) {
        uVar13 = 0;
        if (uVar15 == 0) goto LAB_1401c01fe;
        bVar1 = *_Src;
        uVar15 = uVar15 - 1;
        _Src = _Src + 1;
        uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
      }
      puVar2[4] = uVar8;
      if ((char)uVar8 == '\b') {
        if ((uVar8 & 0xe000) == 0) {
          if (*(uint **)(puVar2 + 8) != (uint *)0x0) {
            **(uint **)(puVar2 + 8) = uVar8 >> 8 & 1;
          }
          if ((puVar2[4] & 0x200) != 0) {
            local_68 = (undefined2)uVar8;
            uVar16 = FUN_1401bf630(puVar2[6],&local_68);
            puVar2[6] = uVar16;
          }
          *puVar2 = 2;
          uVar7 = uVar21;
          uVar8 = uVar21;
          do {
            uVar13 = 0;
            uVar12 = local_64;
            if (uVar15 == 0) goto LAB_1401c01fe;
            bVar1 = *_Src;
            uVar16 = uVar7 + 8;
            uVar15 = uVar15 - 1;
            _Src = _Src + 1;
            uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
joined_r0x0001401bfc46:
            uVar7 = uVar16;
          } while (uVar16 < 0x20);
          if (*(longlong *)(puVar2 + 8) != 0) {
            *(uint *)(*(longlong *)(puVar2 + 8) + 4) = uVar8;
          }
          if ((puVar2[4] & 0x200) != 0) {
            local_68 = (undefined2)uVar8;
            local_65 = (undefined1)(uVar8 >> 0x18);
            local_66 = (undefined1)(uVar8 >> 0x10);
            uVar16 = FUN_1401bf630(puVar2[6],&local_68);
            puVar2[6] = uVar16;
          }
          *puVar2 = 3;
          uVar7 = uVar21;
          uVar8 = uVar21;
          do {
            uVar13 = 0;
            uVar12 = local_64;
            if (uVar15 == 0) goto LAB_1401c01fe;
            bVar1 = *_Src;
            uVar16 = uVar7 + 8;
            uVar15 = uVar15 - 1;
            _Src = _Src + 1;
            uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
joined_r0x0001401bfcc7:
            uVar7 = uVar16;
          } while (uVar16 < 0x10);
          if (*(longlong *)(puVar2 + 8) != 0) {
            *(uint *)(*(longlong *)(puVar2 + 8) + 8) = uVar8 & 0xff;
            *(uint *)(*(longlong *)(puVar2 + 8) + 0xc) = uVar8 >> 8;
          }
          if ((puVar2[4] & 0x200) != 0) {
            local_68 = (undefined2)uVar8;
            uVar16 = FUN_1401bf630(puVar2[6],&local_68);
            puVar2[6] = uVar16;
          }
          *puVar2 = 4;
          uVar7 = uVar21;
          uVar8 = uVar21;
          goto switchD_1401bfa21_caseD_4;
        }
        param_1[4] = (longlong)"unknown header flags set";
        *puVar2 = 0x1d;
      }
      else {
LAB_1401bfaff:
        param_1[4] = (longlong)"unknown compression method";
        *puVar2 = 0x1d;
      }
      break;
    case 2:
      uVar16 = uVar7;
      goto joined_r0x0001401bfc46;
    case 3:
      uVar16 = uVar7;
      goto joined_r0x0001401bfcc7;
    case 4:
switchD_1401bfa21_caseD_4:
      if ((puVar2[4] & 0x400) == 0) {
        uVar16 = uVar8;
        if (*(longlong *)(puVar2 + 8) != 0) {
          *(undefined8 *)(*(longlong *)(puVar2 + 8) + 0x10) = 0;
        }
      }
      else {
        for (; uVar7 < 0x10; uVar7 = uVar7 + 8) {
          uVar13 = 0;
          uVar12 = local_64;
          if (uVar15 == 0) goto LAB_1401c01fe;
          bVar1 = *_Src;
          uVar15 = uVar15 - 1;
          _Src = _Src + 1;
          uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
        }
        puVar2[0x12] = uVar8;
        if (*(longlong *)(puVar2 + 8) != 0) {
          *(uint *)(*(longlong *)(puVar2 + 8) + 0x18) = uVar8;
        }
        uVar7 = uVar21;
        uVar16 = uVar21;
        if ((puVar2[4] & 0x200) != 0) {
          local_68 = (undefined2)uVar8;
          uVar8 = FUN_1401bf630(puVar2[6],&local_68);
          puVar2[6] = uVar8;
        }
      }
      uVar8 = uVar16;
      *puVar2 = 5;
    case 5:
      if ((puVar2[4] & 0x400) == 0) {
LAB_1401bfe63:
        puVar2[0x12] = 0;
        *puVar2 = 6;
switchD_1401bfa21_caseD_6:
        if ((puVar2[4] & 0x800) == 0) {
          if (*(longlong *)(puVar2 + 8) != 0) {
            *(undefined8 *)(*(longlong *)(puVar2 + 8) + 0x20) = 0;
          }
LAB_1401bff0e:
          puVar2[0x12] = 0;
          *puVar2 = 7;
switchD_1401bfa21_caseD_7:
          uVar22 = 0;
          if ((puVar2[4] & 0x1000) == 0) {
            if (*(longlong *)(puVar2 + 8) != 0) {
              *(undefined8 *)(*(longlong *)(puVar2 + 8) + 0x30) = 0;
            }
LAB_1401bffae:
            *puVar2 = 8;
            puVar19 = local_58;
            uVar11 = local_res20;
switchD_1401bfa21_caseD_8:
            if ((puVar2[4] & 0x200) != 0) {
              for (; uVar7 < 0x10; uVar7 = uVar7 + 8) {
                uVar13 = 0;
                uVar12 = local_64;
                if (uVar15 == 0) goto LAB_1401c01fe;
                bVar1 = *_Src;
                uVar15 = uVar15 - 1;
                _Src = _Src + 1;
                uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
              }
              if (uVar8 != (ushort)puVar2[6]) {
                param_1[4] = (longlong)"header crc mismatch";
                *puVar2 = 0x1d;
                break;
              }
              uVar7 = 0;
              uVar8 = uVar7;
            }
            if (*(longlong *)(puVar2 + 8) != 0) {
              *(uint *)(*(longlong *)(puVar2 + 8) + 0x3c) = (int)puVar2[4] >> 9 & 1;
              *(undefined4 *)(*(longlong *)(puVar2 + 8) + 0x40) = 1;
            }
            uVar16 = FUN_1401bf950(0,0,0);
            puVar2[6] = uVar16;
            *(uint *)((longlong)param_1 + 0x4c) = uVar16;
LAB_1401c0049:
            *puVar2 = 0xb;
            puVar19 = local_58;
            uVar11 = local_res20;
            break;
          }
          pbVar17 = _Src;
          uVar13 = uVar15;
          uVar12 = local_64;
          if (uVar15 != 0) {
            do {
              lVar14 = *(longlong *)(puVar2 + 8);
              bVar1 = *pbVar17;
              uVar16 = (int)uVar22 + 1;
              uVar22 = (ulonglong)uVar16;
              if (((lVar14 != 0) && (*(longlong *)(lVar14 + 0x30) != 0)) &&
                 (puVar2[0x12] < *(uint *)(lVar14 + 0x38))) {
                *(byte *)((ulonglong)puVar2[0x12] + *(longlong *)(lVar14 + 0x30)) = bVar1;
                puVar2[0x12] = puVar2[0x12] + 1;
              }
            } while ((bVar1 != 0) && (pbVar17 = pbVar17 + 1, uVar16 < uVar15));
            if ((puVar2[4] & 0x200) != 0) {
              if (_Src == (byte *)0x0) {
                uVar11 = 0;
              }
              else {
                uVar11 = FUN_1401bf630(puVar2[6],_Src);
              }
              puVar2[6] = uVar11;
            }
            uVar15 = uVar15 - uVar16;
            _Src = _Src + uVar22;
            uVar13 = uVar15;
            uVar12 = local_64;
            if (bVar1 == 0) goto LAB_1401bffae;
          }
        }
        else {
          pbVar17 = _Src;
          uVar13 = uVar15;
          uVar12 = local_64;
          if (uVar15 != 0) {
            do {
              lVar14 = *(longlong *)(puVar2 + 8);
              bVar1 = *pbVar17;
              uVar13 = (int)uVar22 + 1;
              uVar22 = (ulonglong)uVar13;
              if (((lVar14 != 0) && (*(longlong *)(lVar14 + 0x20) != 0)) &&
                 (puVar2[0x12] < *(uint *)(lVar14 + 0x28))) {
                *(byte *)((ulonglong)puVar2[0x12] + *(longlong *)(lVar14 + 0x20)) = bVar1;
                puVar2[0x12] = puVar2[0x12] + 1;
              }
            } while ((bVar1 != 0) && (pbVar17 = pbVar17 + 1, uVar13 < uVar15));
            if ((puVar2[4] & 0x200) != 0) {
              if (_Src == (byte *)0x0) {
                uVar16 = 0;
              }
              else {
                uVar16 = FUN_1401bf630(puVar2[6],_Src);
              }
              puVar2[6] = uVar16;
            }
            uVar13 = uVar15 - uVar13;
            _Src = _Src + uVar22;
            uVar15 = uVar13;
            uVar12 = local_64;
            if (bVar1 == 0) goto LAB_1401bff0e;
          }
        }
      }
      else {
        uVar16 = puVar2[0x12];
        uVar11 = uVar16;
        if (uVar15 < uVar16) {
          uVar11 = uVar15;
        }
        uVar13 = uVar15;
        if (uVar11 != 0) {
          lVar14 = *(longlong *)(puVar2 + 8);
          if ((lVar14 != 0) && (*(longlong *)(lVar14 + 0x10) != 0)) {
            uVar16 = *(int *)(lVar14 + 0x18) - uVar16;
            uVar12 = uVar11;
            if (*(uint *)(lVar14 + 0x1c) < uVar11 + uVar16) {
              uVar12 = *(uint *)(lVar14 + 0x1c) - uVar16;
            }
            memcpy((void *)((ulonglong)uVar16 + *(longlong *)(lVar14 + 0x10)),_Src,(ulonglong)uVar12
                  );
          }
          if ((puVar2[4] & 0x200) != 0) {
            if (_Src != (byte *)0x0) {
              uVar21 = FUN_1401bf630(puVar2[6],_Src);
            }
            puVar2[6] = uVar21;
          }
          uVar13 = uVar15 - uVar11;
          _Src = _Src + uVar11;
          puVar2[0x12] = puVar2[0x12] - uVar11;
        }
        uVar15 = uVar13;
        uVar12 = local_64;
        if (puVar2[0x12] == 0) goto LAB_1401bfe63;
      }
LAB_1401c01fe:
      local_64 = uVar12;
      uVar16 = local_60;
      param_1[2] = (longlong)local_58;
      *param_1 = (longlong)_Src;
      *(uint *)(param_1 + 3) = local_res20;
      *(uint *)(param_1 + 1) = uVar13;
      puVar2[0x11] = uVar7;
      puVar2[0x10] = uVar8;
      if (((puVar2[0xb] == 0) && ((0x19 < (int)*puVar2 || (local_60 == *(uint *)(param_1 + 3))))) ||
         (iVar5 = FUN_1401bf4d0(param_1,local_60), iVar5 == 0)) {
        uVar16 = uVar16 - (int)param_1[3];
        local_5c = local_5c - (int)param_1[1];
        *(int *)((longlong)param_1 + 0x1c) = *(int *)((longlong)param_1 + 0x1c) + uVar16;
        *(int *)((longlong)param_1 + 0xc) = *(int *)((longlong)param_1 + 0xc) + local_5c;
        puVar2[7] = puVar2[7] + uVar16;
        if ((puVar2[2] != 0) && (uVar16 != 0)) {
          if (puVar2[4] == 0) {
            uVar8 = FUN_1401c70b0(puVar2[6],param_1[2] - (ulonglong)uVar16);
          }
          else if (param_1[2] == (ulonglong)uVar16) {
            uVar8 = 0;
          }
          else {
            uVar8 = FUN_1401bf630();
          }
          puVar2[6] = uVar8;
          *(uint *)((longlong)param_1 + 0x4c) = uVar8;
        }
        uVar8 = *puVar2;
        if ((uVar8 == 0x13) || (uVar8 == 0xe)) {
          iVar5 = 0x100;
        }
        else {
          iVar5 = 0;
        }
        iVar6 = 0;
        if (uVar8 == 0xb) {
          iVar6 = 0x80;
        }
        *(uint *)(param_1 + 9) = iVar6 + iVar5 + (-(uint)(puVar2[1] != 0) & 0x40) + puVar2[0x11];
        if (((local_5c != 0) || (uVar16 != 0)) && (param_2 != 4)) {
          return local_res18;
        }
        if (local_res18 != 0) {
          return local_res18;
        }
        return -5;
      }
      *puVar2 = 0x1e;
LAB_1401c0259:
      return -4;
    case 6:
      goto switchD_1401bfa21_caseD_6;
    case 7:
      goto switchD_1401bfa21_caseD_7;
    case 8:
      goto switchD_1401bfa21_caseD_8;
    case 9:
      for (; uVar7 < 0x20; uVar7 = uVar7 + 8) {
        uVar13 = 0;
        if (uVar15 == 0) goto LAB_1401c01fe;
        bVar1 = *_Src;
        uVar15 = uVar15 - 1;
        _Src = _Src + 1;
        uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
      }
      uVar16 = (uVar8 >> 8 & 0xff00) + ((uVar8 & 0xff00) + uVar8 * 0x10000) * 0x100 +
               (uVar8 >> 0x18);
      puVar2[6] = uVar16;
      *(uint *)((longlong)param_1 + 0x4c) = uVar16;
      *puVar2 = 10;
      uVar7 = uVar21;
      uVar8 = uVar21;
    case 10:
      if (puVar2[3] == 0) {
        param_1[2] = (longlong)puVar19;
        *(uint *)(param_1 + 3) = uVar11;
        *param_1 = (longlong)_Src;
        *(uint *)(param_1 + 1) = uVar15;
        puVar2[0x10] = uVar8;
        puVar2[0x11] = uVar7;
        return 2;
      }
      uVar16 = FUN_1401c70b0(0,0);
      puVar2[6] = uVar16;
      *(uint *)((longlong)param_1 + 0x4c) = uVar16;
      *puVar2 = 0xb;
      puVar19 = local_58;
      uVar11 = local_res20;
switchD_1401bfa21_caseD_b:
      uVar13 = uVar15;
      uVar12 = local_64;
      if ((param_2 != 5) && (param_2 != 6)) {
switchD_1401bfa21_caseD_c:
        if (puVar2[1] == 0) {
          for (; uVar12 = local_64, uVar7 < 3; uVar7 = uVar7 + 8) {
            uVar13 = 0;
            if (uVar15 == 0) goto LAB_1401c01fe;
            bVar1 = *_Src;
            uVar15 = uVar15 - 1;
            _Src = _Src + 1;
            uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
          }
          puVar2[1] = uVar8 & 1;
          uVar16 = uVar8 >> 1 & 3;
          if (uVar16 == 0) {
            *puVar2 = 0xd;
          }
          else {
            if (uVar16 != 1) {
              if (uVar16 == 2) {
                *puVar2 = 0x10;
                uVar7 = uVar7 - 3;
                uVar8 = uVar8 >> 3;
              }
              else {
                if (uVar16 != 3) goto LAB_1401c0285;
                uVar7 = uVar7 - 3;
                param_1[4] = (longlong)"invalid block type";
                *puVar2 = 0x1d;
                uVar8 = uVar8 >> 3;
              }
              break;
            }
            puVar2[0x1a] = 9;
            puVar2[0x1b] = 5;
            *(undefined **)(puVar2 + 0x16) = &DAT_140264420;
            *puVar2 = 0x13;
            *(undefined **)(puVar2 + 0x18) = &DAT_140264c20;
            if (param_2 == 6) {
              uVar8 = uVar8 >> 3;
              uVar7 = uVar7 - 3;
              uVar13 = uVar15;
              goto LAB_1401c01fe;
            }
          }
LAB_1401c0285:
          uVar7 = uVar7 - 3;
          uVar8 = uVar8 >> 3;
        }
        else {
          *puVar2 = 0x1a;
          uVar16 = uVar7 & 7;
          uVar7 = uVar7 - uVar16;
          uVar8 = uVar8 >> (sbyte)uVar16;
        }
        break;
      }
      goto LAB_1401c01fe;
    case 0xb:
      goto switchD_1401bfa21_caseD_b;
    case 0xc:
      goto switchD_1401bfa21_caseD_c;
    case 0xd:
      uVar8 = uVar8 >> (sbyte)(uVar7 & 7);
      for (uVar7 = uVar7 - (uVar7 & 7); uVar7 < 0x20; uVar7 = uVar7 + 8) {
        uVar13 = 0;
        if (uVar15 == 0) goto LAB_1401c01fe;
        bVar1 = *_Src;
        uVar15 = uVar15 - 1;
        _Src = _Src + 1;
        uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
      }
      if ((uVar8 & 0xffff) == ~uVar8 >> 0x10) {
        puVar2[0x12] = uVar8 & 0xffff;
        *puVar2 = 0xe;
        uVar7 = uVar21;
        uVar8 = uVar21;
        uVar13 = uVar15;
        if (param_2 != 6) goto switchD_1401bfa21_caseD_e;
        goto LAB_1401c01fe;
      }
      param_1[4] = (longlong)"invalid stored block lengths";
      *puVar2 = 0x1d;
      break;
    case 0xe:
switchD_1401bfa21_caseD_e:
      *puVar2 = 0xf;
    case 0xf:
      uVar16 = puVar2[0x12];
      if (uVar16 == 0) {
        *puVar2 = 0xb;
        break;
      }
      if (uVar15 < uVar16) {
        uVar16 = uVar15;
      }
      if (uVar11 < uVar16) {
        uVar16 = uVar11;
      }
      uVar22 = (ulonglong)uVar16;
      uVar13 = uVar15;
      if (uVar16 != 0) {
        memcpy(puVar19,_Src,uVar22);
        local_res20 = local_res20 - uVar16;
        _Src = _Src + uVar22;
        local_58 = local_58 + uVar22;
        uVar15 = uVar15 - uVar16;
        puVar2[0x12] = puVar2[0x12] - uVar16;
        puVar19 = local_58;
        uVar11 = local_res20;
        break;
      }
      goto LAB_1401c01fe;
    case 0x10:
      for (; uVar7 < 0xe; uVar7 = uVar7 + 8) {
        uVar13 = 0;
        if (uVar15 == 0) goto LAB_1401c01fe;
        bVar1 = *_Src;
        uVar15 = uVar15 - 1;
        _Src = _Src + 1;
        uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
      }
      uVar7 = uVar7 - 0xe;
      uVar21 = uVar8 >> 10;
      uVar16 = (uVar8 & 0x1f) + 0x101;
      uVar13 = (uVar8 >> 5 & 0x1f) + 1;
      uVar8 = uVar8 >> 0xe;
      puVar2[0x1d] = uVar16;
      puVar2[0x1e] = uVar13;
      puVar2[0x1c] = (uVar21 & 0xf) + 4;
      if ((uVar16 < 0x11f) && (uVar13 < 0x1f)) {
        puVar2[0x1f] = 0;
        *puVar2 = 0x11;
        goto switchD_1401bfa21_caseD_11;
      }
      param_1[4] = (longlong)"too many length or distance symbols";
      *puVar2 = 0x1d;
      break;
    case 0x11:
switchD_1401bfa21_caseD_11:
      if (puVar2[0x1f] < puVar2[0x1c]) {
        do {
          for (; uVar7 < 3; uVar7 = uVar7 + 8) {
            uVar13 = 0;
            if (uVar15 == 0) goto LAB_1401c01fe;
            bVar1 = *_Src;
            uVar15 = uVar15 - 1;
            _Src = _Src + 1;
            uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
          }
          uVar7 = uVar7 - 3;
          uVar10 = (ushort)uVar8;
          uVar8 = uVar8 >> 3;
          *(ushort *)
           ((longlong)puVar2 +
           (ulonglong)*(ushort *)(&DAT_140264ca0 + (ulonglong)puVar2[0x1f] * 2) * 2 + 0x88) =
               uVar10 & 7;
          puVar2[0x1f] = puVar2[0x1f] + 1;
        } while (puVar2[0x1f] < puVar2[0x1c]);
      }
      uVar16 = puVar2[0x1f];
      while (uVar16 < 0x13) {
        *(undefined2 *)
         ((longlong)puVar2 +
         (ulonglong)*(ushort *)(&DAT_140264ca0 + (ulonglong)puVar2[0x1f] * 2) * 2 + 0x88) = 0;
        puVar2[0x1f] = puVar2[0x1f] + 1;
        uVar16 = puVar2[0x1f];
      }
      *(uint **)(puVar2 + 0x20) = puVar2 + 0x152;
      *(uint **)(puVar2 + 0x16) = puVar2 + 0x152;
      puVar2[0x1a] = 7;
      local_res18 = FUN_1401cafe0(0,puVar2 + 0x22,0x13,puVar2 + 0x20,puVar2 + 0x1a,puVar2 + 0xc2);
      if (local_res18 == 0) {
        puVar2[0x1f] = 0;
        *puVar2 = 0x12;
        uVar11 = local_res20;
        goto switchD_1401bfa21_caseD_12;
      }
      param_1[4] = (longlong)"invalid code lengths set";
      *puVar2 = 0x1d;
      puVar19 = local_58;
      uVar11 = local_res20;
      break;
    case 0x12:
switchD_1401bfa21_caseD_12:
      puVar19 = local_58;
      if (puVar2[0x1f] < puVar2[0x1e] + puVar2[0x1d]) {
        do {
          uVar12 = *(uint *)(*(longlong *)(puVar2 + 0x16) +
                            (ulonglong)((1 << ((byte)puVar2[0x1a] & 0x1f)) - 1U & uVar8) * 4);
          uVar16 = uVar7;
          local_64 = uVar12;
          if (uVar7 < (uVar12 >> 8 & 0xff)) {
            do {
              uVar7 = uVar16;
              uVar13 = 0;
              uVar12 = local_64;
              if (uVar15 == 0) goto LAB_1401c01fe;
              uVar7 = uVar16 + 8;
              uVar15 = uVar15 - 1;
              uVar8 = uVar8 + ((uint)*_Src << ((byte)uVar16 & 0x1f));
              _Src = _Src + 1;
              uVar12 = *(uint *)(*(longlong *)(puVar2 + 0x16) +
                                (ulonglong)((1 << ((byte)puVar2[0x1a] & 0x1f)) - 1U & uVar8) * 4);
              uVar16 = uVar7;
              local_64 = uVar12;
            } while (uVar7 < (uVar12 >> 8 & 0xff));
          }
          uVar10 = (ushort)(uVar12 >> 0x10);
          local_64._1_1_ = (byte)(uVar12 >> 8);
          local_64 = uVar12;
          if (0xf < uVar10) {
            if (uVar10 == 0x10) {
              for (; uVar7 < local_64._1_1_ + 2; uVar7 = uVar7 + 8) {
                uVar13 = 0;
                if (uVar15 == 0) goto LAB_1401c01fe;
                bVar1 = *_Src;
                uVar15 = uVar15 - 1;
                _Src = _Src + 1;
                uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
              }
              uVar7 = uVar7 - local_64._1_1_;
              uVar8 = uVar8 >> (local_64._1_1_ & 0x1f);
              if (puVar2[0x1f] != 0) {
                iVar5 = (uVar8 & 3) + 3;
                uVar7 = uVar7 - 2;
                uVar18 = (ulonglong)
                         *(ushort *)((longlong)puVar2 + (ulonglong)(puVar2[0x1f] - 1) * 2 + 0x88);
                uVar8 = uVar8 >> 2;
                goto LAB_1401c0700;
              }
            }
            else {
              if (uVar10 == 0x11) {
                for (; uVar7 < local_64._1_1_ + 3; uVar7 = uVar7 + 8) {
                  uVar13 = 0;
                  if (uVar15 == 0) goto LAB_1401c01fe;
                  bVar1 = *_Src;
                  uVar15 = uVar15 - 1;
                  _Src = _Src + 1;
                  uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
                }
                iVar6 = -3;
                uVar8 = uVar8 >> (local_64._1_1_ & 0x1f);
                iVar5 = (uVar8 & 7) + 3;
                uVar8 = uVar8 >> 3;
              }
              else {
                for (; uVar7 < local_64._1_1_ + 7; uVar7 = uVar7 + 8) {
                  uVar13 = 0;
                  if (uVar15 == 0) goto LAB_1401c01fe;
                  bVar1 = *_Src;
                  uVar15 = uVar15 - 1;
                  _Src = _Src + 1;
                  uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
                }
                iVar6 = -7;
                uVar8 = uVar8 >> (local_64._1_1_ & 0x1f);
                iVar5 = (uVar8 & 0x7f) + 0xb;
                uVar8 = uVar8 >> 7;
              }
              uVar7 = uVar7 + (iVar6 - (uint)local_64._1_1_);
              uVar18 = uVar22;
LAB_1401c0700:
              if (iVar5 + puVar2[0x1f] <= puVar2[0x1e] + puVar2[0x1d]) {
                for (; iVar5 != 0; iVar5 = iVar5 + -1) {
                  *(short *)((longlong)puVar2 + (ulonglong)puVar2[0x1f] * 2 + 0x88) = (short)uVar18;
                  puVar2[0x1f] = puVar2[0x1f] + 1;
                }
                goto LAB_1401c0735;
              }
            }
            param_1[4] = (longlong)"invalid bit length repeat";
            *puVar2 = 0x1d;
            goto LAB_1401c0058;
          }
          uVar16 = uVar7;
          if (uVar7 < (uVar12 >> 8 & 0xff)) {
            do {
              uVar7 = uVar16;
              uVar13 = 0;
              if (uVar15 == 0) goto LAB_1401c01fe;
              bVar1 = *_Src;
              uVar7 = uVar16 + 8;
              uVar15 = uVar15 - 1;
              _Src = _Src + 1;
              uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar16 & 0x1f));
              uVar16 = uVar7;
            } while (uVar7 < local_64._1_1_);
          }
          uVar8 = uVar8 >> (local_64._1_1_ & 0x1f);
          uVar7 = uVar7 - local_64._1_1_;
          *(ushort *)((longlong)puVar2 + (ulonglong)puVar2[0x1f] * 2 + 0x88) = uVar10;
          puVar2[0x1f] = puVar2[0x1f] + 1;
LAB_1401c0735:
        } while (puVar2[0x1f] < puVar2[0x1e] + puVar2[0x1d]);
      }
      if (*puVar2 != 0x1d) {
        if ((short)puVar2[0xa2] == 0) {
          param_1[4] = (longlong)"invalid code -- missing end-of-block";
          *puVar2 = 0x1d;
        }
        else {
          *(uint **)(puVar2 + 0x20) = puVar2 + 0x152;
          *(uint **)(puVar2 + 0x16) = puVar2 + 0x152;
          puVar2[0x1a] = 9;
          local_res18 = FUN_1401cafe0(1,puVar2 + 0x22,puVar2[0x1d],puVar2 + 0x20,puVar2 + 0x1a,
                                      puVar2 + 0xc2);
          if (local_res18 == 0) {
            *(undefined8 *)(puVar2 + 0x18) = *(undefined8 *)(puVar2 + 0x20);
            puVar2[0x1b] = 6;
            local_res18 = FUN_1401cafe0(2,(longlong)puVar2 + (ulonglong)puVar2[0x1d] * 2 + 0x88,
                                        puVar2[0x1e],puVar2 + 0x20,puVar2 + 0x1b,puVar2 + 0xc2);
            puVar19 = local_58;
            if (local_res18 == 0) {
              *puVar2 = 0x13;
              uVar11 = local_res20;
              uVar13 = uVar15;
              uVar12 = local_64;
              if (param_2 != 6) goto switchD_1401bfa21_caseD_13;
              goto LAB_1401c01fe;
            }
            param_1[4] = (longlong)"invalid distances set";
            *puVar2 = 0x1d;
            uVar11 = local_res20;
          }
          else {
            param_1[4] = (longlong)"invalid literal/lengths set";
            *puVar2 = 0x1d;
            puVar19 = local_58;
            uVar11 = local_res20;
          }
        }
      }
      break;
    case 0x13:
switchD_1401bfa21_caseD_13:
      *puVar2 = 0x14;
    case 0x14:
      if ((5 < uVar15) && (0x101 < uVar11)) {
        param_1[2] = (longlong)puVar19;
        *(uint *)(param_1 + 3) = uVar11;
        *param_1 = (longlong)_Src;
        *(uint *)(param_1 + 1) = uVar15;
        puVar2[0x10] = uVar8;
        puVar2[0x11] = uVar7;
        FUN_1401c9800(param_1,local_60);
        local_58 = (undefined1 *)param_1[2];
        local_res20 = *(uint *)(param_1 + 3);
        _Src = (byte *)*param_1;
        uVar15 = *(uint *)(param_1 + 1);
        uVar7 = puVar2[0x11];
        puVar19 = local_58;
        uVar8 = puVar2[0x10];
        uVar11 = local_res20;
        if (*puVar2 == 0xb) {
          puVar2[0x6f7] = 0xffffffff;
        }
        break;
      }
      puVar2[0x6f7] = 0;
      uVar12 = *(uint *)(*(longlong *)(puVar2 + 0x16) +
                        (ulonglong)((1 << ((byte)puVar2[0x1a] & 0x1f)) - 1U & uVar8) * 4);
      uVar16 = uVar7;
      if (uVar7 < (uVar12 >> 8 & 0xff)) {
        do {
          uVar7 = uVar16;
          uVar13 = 0;
          uVar12 = local_64;
          if (uVar15 == 0) goto LAB_1401c01fe;
          uVar7 = uVar16 + 8;
          uVar15 = uVar15 - 1;
          uVar8 = uVar8 + ((uint)*_Src << ((byte)uVar16 & 0x1f));
          _Src = _Src + 1;
          uVar12 = *(uint *)(*(longlong *)(puVar2 + 0x16) +
                            (ulonglong)((1 << ((byte)puVar2[0x1a] & 0x1f)) - 1U & uVar8) * 4);
          uVar16 = uVar7;
        } while (uVar7 < (uVar12 >> 8 & 0xff));
      }
      cVar4 = (char)uVar12;
      uVar16 = uVar12;
      if ((cVar4 != '\0') && ((uVar12 & 0xf0) == 0)) {
        bVar1 = (byte)(uVar12 >> 8);
        uVar16 = *(uint *)(*(longlong *)(puVar2 + 0x16) +
                          (ulonglong)
                          ((((1 << (cVar4 + bVar1 & 0x1f)) - 1U & uVar8) >> (bVar1 & 0x1f)) +
                          (uVar12 >> 0x10)) * 4);
        if (uVar7 < (uVar16 >> 8 & 0xff) + (uVar12 >> 8 & 0xff)) {
          do {
            uVar13 = 0;
            if (uVar15 == 0) goto LAB_1401c01fe;
            uVar8 = uVar8 + ((uint)*_Src << ((byte)uVar7 & 0x1f));
            uVar7 = uVar7 + 8;
            uVar15 = uVar15 - 1;
            _Src = _Src + 1;
            uVar16 = *(uint *)(*(longlong *)(puVar2 + 0x16) +
                              (ulonglong)
                              ((((1 << (cVar4 + bVar1 & 0x1f)) - 1U & uVar8) >> (bVar1 & 0x1f)) +
                              (uVar12 >> 0x10)) * 4);
          } while (uVar7 < (uVar16 >> 8 & 0xff) + (uint)bVar1);
        }
        uVar8 = uVar8 >> (bVar1 & 0x1f);
        uVar7 = uVar7 - bVar1;
        puVar2[0x6f7] = (uint)bVar1;
        local_64 = uVar12;
      }
      uVar11 = uVar16 >> 8 & 0xff;
      puVar2[0x6f7] = puVar2[0x6f7] + uVar11;
      uVar8 = uVar8 >> ((byte)(uVar16 >> 8) & 0x1f);
      uVar7 = uVar7 - uVar11;
      puVar2[0x12] = uVar16 >> 0x10;
      puVar19 = local_58;
      if ((char)uVar16 == '\0') {
        *puVar2 = 0x19;
        uVar11 = local_res20;
        break;
      }
      if ((uVar16 & 0x20) != 0) {
        puVar2[0x6f7] = 0xffffffff;
        goto LAB_1401c0049;
      }
      if ((uVar16 & 0x40) != 0) {
        param_1[4] = (longlong)"invalid literal/length code";
        *puVar2 = 0x1d;
        uVar11 = local_res20;
        break;
      }
      *puVar2 = 0x15;
      puVar2[0x14] = uVar16 & 0xf;
switchD_1401bfa21_caseD_15:
      uVar16 = puVar2[0x14];
      if (uVar16 != 0) {
        uVar11 = uVar7;
        if (uVar7 < uVar16) {
          do {
            uVar13 = 0;
            uVar12 = local_64;
            if (uVar15 == 0) goto LAB_1401c01fe;
            bVar1 = *_Src;
            uVar11 = uVar7 + 8;
            uVar15 = uVar15 - 1;
            _Src = _Src + 1;
            uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
            uVar7 = uVar11;
          } while (uVar11 < puVar2[0x14]);
        }
        uVar7 = uVar11 - uVar16;
        uVar11 = (1 << ((byte)uVar16 & 0x1f)) - 1U & uVar8;
        uVar8 = uVar8 >> ((byte)uVar16 & 0x1f);
        puVar2[0x12] = puVar2[0x12] + uVar11;
        puVar2[0x6f7] = puVar2[0x6f7] + uVar16;
      }
      *puVar2 = 0x16;
      puVar2[0x6f8] = puVar2[0x12];
switchD_1401bfa21_caseD_16:
      uVar12 = *(uint *)(*(longlong *)(puVar2 + 0x18) +
                        (ulonglong)((1 << ((byte)puVar2[0x1b] & 0x1f)) - 1U & uVar8) * 4);
      uVar16 = uVar7;
      if (uVar7 < (uVar12 >> 8 & 0xff)) {
        do {
          uVar7 = uVar16;
          uVar13 = 0;
          uVar12 = local_64;
          if (uVar15 == 0) goto LAB_1401c01fe;
          uVar7 = uVar16 + 8;
          uVar15 = uVar15 - 1;
          uVar8 = uVar8 + ((uint)*_Src << ((byte)uVar16 & 0x1f));
          _Src = _Src + 1;
          uVar12 = *(uint *)(*(longlong *)(puVar2 + 0x18) +
                            (ulonglong)((1 << ((byte)puVar2[0x1b] & 0x1f)) - 1U & uVar8) * 4);
          uVar16 = uVar7;
        } while (uVar7 < (uVar12 >> 8 & 0xff));
      }
      uVar16 = uVar12;
      if ((uVar12 & 0xf0) == 0) {
        bVar1 = (byte)(uVar12 >> 8);
        uVar16 = *(uint *)(*(longlong *)(puVar2 + 0x18) +
                          (ulonglong)
                          ((((1 << ((char)uVar12 + bVar1 & 0x1f)) - 1U & uVar8) >> (bVar1 & 0x1f)) +
                          (uVar12 >> 0x10)) * 4);
        if (uVar7 < (uVar16 >> 8 & 0xff) + (uVar12 >> 8 & 0xff)) {
          do {
            uVar13 = 0;
            if (uVar15 == 0) goto LAB_1401c01fe;
            uVar8 = uVar8 + ((uint)*_Src << ((byte)uVar7 & 0x1f));
            uVar7 = uVar7 + 8;
            uVar15 = uVar15 - 1;
            _Src = _Src + 1;
            uVar16 = *(uint *)(*(longlong *)(puVar2 + 0x18) +
                              (ulonglong)
                              ((((1 << ((char)uVar12 + bVar1 & 0x1f)) - 1U & uVar8) >>
                               (bVar1 & 0x1f)) + (uVar12 >> 0x10)) * 4);
          } while (uVar7 < (uVar16 >> 8 & 0xff) + (uint)bVar1);
        }
        uVar8 = uVar8 >> (bVar1 & 0x1f);
        uVar7 = uVar7 - bVar1;
        puVar2[0x6f7] = puVar2[0x6f7] + (uint)bVar1;
        local_64 = uVar12;
      }
      uVar11 = uVar16 >> 8 & 0xff;
      puVar2[0x6f7] = puVar2[0x6f7] + uVar11;
      uVar8 = uVar8 >> ((byte)(uVar16 >> 8) & 0x1f);
      uVar7 = uVar7 - uVar11;
      puVar19 = local_58;
      if ((uVar16 & 0x40) != 0) {
        param_1[4] = (longlong)"invalid distance code";
        *puVar2 = 0x1d;
        uVar11 = local_res20;
        break;
      }
      *puVar2 = 0x17;
      puVar2[0x13] = uVar16 >> 0x10;
      puVar2[0x14] = uVar16 & 0xf;
      uVar11 = local_res20;
switchD_1401bfa21_caseD_17:
      uVar16 = puVar2[0x14];
      if (uVar16 != 0) {
        uVar21 = uVar7;
        if (uVar7 < uVar16) {
          do {
            uVar7 = uVar21;
            uVar13 = 0;
            uVar12 = local_64;
            if (uVar15 == 0) goto LAB_1401c01fe;
            bVar1 = *_Src;
            uVar7 = uVar21 + 8;
            uVar15 = uVar15 - 1;
            _Src = _Src + 1;
            uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar21 & 0x1f));
            uVar21 = uVar7;
          } while (uVar7 < puVar2[0x14]);
        }
        uVar7 = uVar7 - uVar16;
        uVar12 = (1 << ((byte)uVar16 & 0x1f)) - 1U & uVar8;
        uVar8 = uVar8 >> ((byte)uVar16 & 0x1f);
        puVar2[0x13] = puVar2[0x13] + uVar12;
        puVar2[0x6f7] = puVar2[0x6f7] + uVar16;
      }
      *puVar2 = 0x18;
switchD_1401bfa21_caseD_18:
      uVar13 = uVar15;
      uVar12 = local_64;
      if (uVar11 != 0) {
        uVar16 = puVar2[0x13];
        if (local_60 - uVar11 < uVar16) {
          uVar16 = uVar16 - (local_60 - uVar11);
          if ((puVar2[0xc] < uVar16) && (puVar2[0x6f6] != 0)) {
            param_1[4] = (longlong)"invalid distance too far back";
            *puVar2 = 0x1d;
            break;
          }
          uVar13 = puVar2[0xd];
          if (uVar13 < uVar16) {
            uVar16 = uVar16 - uVar13;
            uVar13 = puVar2[0xb] - uVar16;
          }
          else {
            uVar13 = uVar13 - uVar16;
          }
          uVar12 = puVar2[0x12];
          lVar14 = (ulonglong)uVar13 + *(longlong *)(puVar2 + 0xe);
          if (uVar12 < uVar16) goto LAB_1401c0d55;
        }
        else {
          lVar14 = (longlong)puVar19 - (ulonglong)uVar16;
          uVar12 = puVar2[0x12];
LAB_1401c0d55:
          uVar16 = uVar12;
          uVar12 = uVar16;
        }
        if (uVar11 < uVar16) {
          uVar16 = uVar11;
        }
        local_res20 = uVar11 - uVar16;
        puVar2[0x12] = uVar12 - uVar16;
        puVar20 = puVar19;
        do {
          local_58 = puVar20 + 1;
          uVar16 = uVar16 - 1;
          *puVar20 = puVar20[lVar14 - (longlong)puVar19];
          puVar20 = local_58;
        } while (uVar16 != 0);
        puVar19 = local_58;
        uVar11 = local_res20;
        if (puVar2[0x12] == 0) {
          *puVar2 = 0x14;
        }
        break;
      }
      goto LAB_1401c01fe;
    case 0x15:
      goto switchD_1401bfa21_caseD_15;
    case 0x16:
      goto switchD_1401bfa21_caseD_16;
    case 0x17:
      goto switchD_1401bfa21_caseD_17;
    case 0x18:
      goto switchD_1401bfa21_caseD_18;
    case 0x19:
      if (uVar11 == 0) goto LAB_1401c01fe;
      local_58 = puVar19 + 1;
      local_res20 = uVar11 - 1;
      *puVar19 = (char)puVar2[0x12];
      *puVar2 = 0x14;
      puVar19 = local_58;
      uVar11 = local_res20;
      break;
    case 0x1a:
      uVar16 = uVar7;
      uVar3 = uVar8;
      if (puVar2[2] != 0) {
        for (; uVar16 < 0x20; uVar16 = uVar16 + 8) {
          uVar7 = uVar16;
          uVar8 = uVar3;
          uVar13 = 0;
          if (uVar15 == 0) goto LAB_1401c01fe;
          bVar1 = *_Src;
          bVar9 = (byte)uVar16;
          uVar15 = uVar15 - 1;
          _Src = _Src + 1;
          uVar3 = uVar3 + ((uint)bVar1 << (bVar9 & 0x1f));
        }
        uVar8 = local_60 - uVar11;
        *(int *)((longlong)param_1 + 0x1c) = *(int *)((longlong)param_1 + 0x1c) + uVar8;
        puVar2[7] = puVar2[7] + uVar8;
        if (uVar8 != 0) {
          if (puVar2[4] == 0) {
            uVar7 = FUN_1401c70b0(puVar2[6],(longlong)puVar19 - (longlong)(ulonglong)uVar8);
            puVar19 = local_58;
            uVar11 = local_res20;
          }
          else {
            uVar7 = uVar21;
            if (puVar19 != (undefined1 *)(ulonglong)uVar8) {
              uVar7 = FUN_1401bf630(puVar2[6]);
              puVar19 = local_58;
              uVar11 = local_res20;
            }
          }
          puVar2[6] = uVar7;
          *(uint *)((longlong)param_1 + 0x4c) = uVar7;
        }
        uVar12 = uVar3;
        if (puVar2[4] == 0) {
          uVar12 = ((uVar3 & 0xff00) + uVar3 * 0x10000) * 0x100 + (uVar3 >> 8 & 0xff00) +
                   (uVar3 >> 0x18);
        }
        uVar7 = uVar21;
        uVar8 = uVar21;
        local_60 = uVar11;
        if (uVar12 != puVar2[6]) {
          param_1[4] = (longlong)"incorrect data check";
          *puVar2 = 0x1d;
          uVar7 = uVar16;
          uVar8 = uVar3;
          break;
        }
      }
      *puVar2 = 0x1b;
    case 0x1b:
      if ((puVar2[2] != 0) && (uVar16 = uVar7, uVar3 = uVar8, puVar2[4] != 0)) {
        for (; uVar16 < 0x20; uVar16 = uVar16 + 8) {
          uVar7 = uVar16;
          uVar8 = uVar3;
          uVar13 = 0;
          uVar12 = local_64;
          if (uVar15 == 0) goto LAB_1401c01fe;
          bVar1 = *_Src;
          bVar9 = (byte)uVar16;
          uVar15 = uVar15 - 1;
          _Src = _Src + 1;
          uVar3 = uVar3 + ((uint)bVar1 << (bVar9 & 0x1f));
        }
        uVar7 = uVar21;
        uVar8 = uVar21;
        if (uVar3 != puVar2[7]) {
          param_1[4] = (longlong)"incorrect length check";
          *puVar2 = 0x1d;
          uVar7 = uVar16;
          uVar8 = uVar3;
          break;
        }
      }
      *puVar2 = 0x1c;
switchD_1401bfa21_caseD_1c:
      local_res18 = 1;
      uVar13 = uVar15;
      uVar12 = local_64;
      goto LAB_1401c01fe;
    case 0x1c:
      goto switchD_1401bfa21_caseD_1c;
    case 0x1d:
      local_res18 = -3;
      goto LAB_1401c01fe;
    case 0x1e:
      goto LAB_1401c0259;
    }
LAB_1401c0058:
    uVar16 = *puVar2;
  } while( true );
}



undefined8 FUN_1401c10a0(undefined8 param_1)

{
  HRESULT HVar1;
  
  HVar1 = CoInitialize((LPVOID)0x0);
  *(bool *)param_1 = -1 < HVar1;
  return param_1;
}



void FUN_1401c10d0(char *param_1)

{
  if (*param_1 != '\0') {
    CoUninitialize();
  }
  return;
}



undefined8 * FUN_1401c10f0(undefined8 *param_1,undefined8 param_2)

{
  param_1[1] = Proud::CFastArray<>::vftable;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  *param_1 = param_2;
  *(undefined4 *)((longlong)param_1 + 0x2c) = 1;
  return param_1;
}



void FUN_1401c1130(longlong param_1)

{
  *(undefined ***)(param_1 + 8) = Proud::CFastArray<>::vftable;
  if (*(longlong *)(param_1 + 0x18) != 0) {
    if (*(longlong **)(param_1 + 0x10) != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x0001401c1158. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(**(longlong **)(param_1 + 0x10) + 0x18))();
      return;
    }
    FUN_1400a3530(*(longlong *)(param_1 + 0x18));
  }
  return;
}



void FUN_1401c1170(longlong param_1)

{
  int iVar1;
  
  if (0xffffffff < *(longlong *)(param_1 + 0x30) + 0x80000000U) {
                    // WARNING: Subroutine does not return
    FUN_1400a2730(L"Proud::CStreamQueue::Shrink");
  }
  if (0 < (longlong)*(size_t *)(param_1 + 0x38)) {
    iVar1 = *(int *)(param_1 + 0x30);
    if (-1 < iVar1) {
      if (iVar1 < *(int *)(param_1 + 0x20)) {
        if (*(int *)(param_1 + 0x20) < 1) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        memmove(*(void **)(param_1 + 0x18),
                (void *)((longlong)*(void **)(param_1 + 0x18) + (longlong)iVar1),
                *(size_t *)(param_1 + 0x38));
        goto LAB_1401c11c2;
      }
    }
                    // WARNING: Subroutine does not return
    FUN_1400a2700();
  }
LAB_1401c11c2:
  *(undefined8 *)(param_1 + 0x30) = 0;
  return;
}



void FUN_1401c11f0(longlong *param_1,undefined8 *param_2,uint param_3)

{
  undefined1 uVar1;
  longlong lVar2;
  undefined8 uVar3;
  int iVar4;
  undefined8 *_Dst;
  ulonglong uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  ulonglong _Size;
  
  lVar2 = param_1[6];
  _Size = (ulonglong)(int)param_3;
  if ((longlong)(_Size + lVar2 + param_1[7]) < (longlong)(int)param_1[4]) {
    if (0xffffffff < lVar2 + param_1[7] + 0x80000000U) {
                    // WARNING: Subroutine does not return
      FUN_1400a2730(L"Proud::CStreamQueue::PushBack_Copy");
    }
    iVar4 = (int)lVar2 + (int)param_1[7];
    if ((iVar4 < 0) || ((int)param_1[4] <= iVar4)) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    _Dst = (undefined8 *)((longlong)iVar4 + param_1[3]);
    if (_Size < 0x21) {
      uVar5 = (ulonglong)(param_3 & 7);
      for (uVar7 = _Size >> 3; uVar7 != 0; uVar7 = uVar7 - 1) {
        uVar3 = *param_2;
        param_2 = param_2 + 1;
        *_Dst = uVar3;
        _Dst = _Dst + 1;
      }
      if (uVar5 != 0) {
        puVar6 = param_2;
        do {
          uVar1 = *(undefined1 *)puVar6;
          puVar6 = (undefined8 *)((longlong)puVar6 + 1);
          uVar5 = uVar5 - 1;
          *(undefined1 *)((longlong)_Dst + (-1 - (longlong)param_2) + (longlong)puVar6) = uVar1;
        } while (uVar5 != 0);
      }
      goto LAB_1401c12b9;
    }
  }
  else {
    if ((0 < lVar2) && (0 < (int)param_1[4])) {
      FUN_1401c1170(param_1);
    }
    if ((longlong)(int)param_1[4] < (longlong)(_Size + param_1[7])) {
      if (0xffffffff < *param_1 + _Size + param_1[7] + 0x80000000) {
                    // WARNING: Subroutine does not return
        FUN_1400a2730(L"Proud::CStreamQueue::PushBack_Copy");
      }
      FUN_14003cda0(param_1 + 1,(int)*param_1 + param_3 + (int)param_1[7]);
    }
    if (0xffffffff < param_1[7] + 0x80000000U) {
                    // WARNING: Subroutine does not return
      FUN_1400a2730(L"Proud::CStreamQueue::PushBack_Copy");
    }
    iVar4 = (int)param_1[7];
    if ((iVar4 < 0) || ((int)param_1[4] <= iVar4)) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    _Dst = (undefined8 *)((longlong)iVar4 + param_1[3]);
    if (_Size < 0x21) {
      uVar5 = (ulonglong)(param_3 & 7);
      for (uVar7 = _Size >> 3; uVar7 != 0; uVar7 = uVar7 - 1) {
        uVar3 = *param_2;
        param_2 = param_2 + 1;
        *_Dst = uVar3;
        _Dst = _Dst + 1;
      }
      if (uVar5 != 0) {
        puVar6 = param_2;
        do {
          uVar1 = *(undefined1 *)puVar6;
          puVar6 = (undefined8 *)((longlong)puVar6 + 1);
          uVar5 = uVar5 - 1;
          *(undefined1 *)((longlong)_Dst + (-1 - (longlong)param_2) + (longlong)puVar6) = uVar1;
        } while (uVar5 != 0);
      }
      goto LAB_1401c12b9;
    }
  }
  memcpy(_Dst,param_2,_Size);
LAB_1401c12b9:
  param_1[7] = param_1[7] + _Size;
  return;
}



longlong FUN_1401c13e0(longlong *param_1,longlong param_2)

{
  if (param_1[7] <= param_2) {
    param_2 = param_1[7];
  }
  param_1[6] = param_1[6] + param_2;
  param_1[7] = param_1[7] - param_2;
  if (param_1[7] <= (longlong)(*param_1 + (ulonglong)((uint)(*param_1 >> 0x3f) & 0x3f)) >> 6) {
    FUN_1401c1170();
  }
  return param_2;
}



undefined8 * FUN_1401c1420(undefined8 *param_1,LONG param_2,LONG param_3)

{
  HANDLE pvVar1;
  
  pvVar1 = CreateSemaphoreW((LPSECURITY_ATTRIBUTES)0x0,param_2,param_3,(LPCWSTR)0x0);
  *param_1 = pvVar1;
  return param_1;
}



bool FUN_1401c1440(undefined8 *param_1,DWORD param_2)

{
  DWORD DVar1;
  
  DVar1 = WaitForSingleObject((HANDLE)*param_1,param_2);
  return DVar1 == 0;
}



long FUN_1401c1460(undefined8 *param_1,LONG param_2)

{
  long local_res18 [4];
  
  local_res18[0] = 0;
  ReleaseSemaphore((HANDLE)*param_1,param_2,local_res18);
  return local_res18[0];
}



uint FUN_1401c1490(byte *param_1,int param_2)

{
  byte bVar1;
  uint uVar2;
  
  uVar2 = 0xffffffff;
  for (; param_2 != 0; param_2 = param_2 + -1) {
    bVar1 = *param_1;
    param_1 = param_1 + 1;
    uVar2 = *(uint *)(&DAT_140267370 + (ulonglong)((bVar1 ^ uVar2) & 0xff) * 4) ^ uVar2 >> 8;
  }
  return ~uVar2;
}



undefined8 * FUN_1401c14e0(undefined8 *param_1)

{
  param_1[1] = 0;
  *param_1 = Proud::IHeartbeatWork::vftable;
  return param_1;
}



void FUN_1401c1500(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if ((longlong *)param_2[2] != param_1) {
    FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                  L"Proud::CListNode<class Proud::CHeartbeatWorkThread::WorkData>::CListOwner::Erase"
                 );
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
  }
  plVar1 = (longlong *)param_2[1];
  lVar2 = *param_2;
  if (plVar1 != (longlong *)0x0) {
    *plVar1 = lVar2;
  }
  if (lVar2 != 0) {
    *(longlong **)(lVar2 + 8) = plVar1;
  }
  if (plVar1 == (longlong *)0x0) {
    if ((longlong *)param_1[1] != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::CHeartbeatWorkThread::WorkData>::CListOwner::Erase"
                   );
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if ((longlong *)*param_1 != param_2) {
      FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                    L"Proud::CListNode<class Proud::CHeartbeatWorkThread::WorkData>::CListOwner::Erase"
                   );
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
    }
    *param_1 = (longlong)plVar1;
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  *(int *)(param_1 + 2) = (int)param_1[2] + -1;
  return;
}



void FUN_1401c15e0(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined1 local_58 [88];
  
  lVar1 = *param_1;
  while( true ) {
    if (lVar1 == 0) {
      return;
    }
    plVar2 = (longlong *)*param_1;
    if ((longlong *)plVar2[2] != param_1) break;
    plVar3 = (longlong *)plVar2[1];
    lVar1 = *plVar2;
    if (plVar3 != (longlong *)0x0) {
      *plVar3 = lVar1;
    }
    if (lVar1 != 0) {
      *(longlong **)(lVar1 + 8) = plVar3;
    }
    if (plVar3 == (longlong *)0x0) {
      if ((longlong *)param_1[1] != plVar2) {
        FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                      L"Proud::CListNode<class Proud::CHeartbeatWorkThread::WorkData>::CListOwner::Erase"
                     );
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      param_1[1] = lVar1;
    }
    if (lVar1 == 0) {
      if ((longlong *)*param_1 != plVar2) {
        FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                      L"Proud::CListNode<class Proud::CHeartbeatWorkThread::WorkData>::CListOwner::Erase"
                     );
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
      }
      *param_1 = (longlong)plVar3;
    }
    *plVar2 = 0;
    plVar2[1] = 0;
    plVar2[2] = 0;
    *(int *)(param_1 + 2) = (int)param_1[2] + -1;
    lVar1 = *param_1;
  }
  FUN_1400a2320(local_58,PTR_u_CListNode_reports_a_consistency_p_1402f84a0,
                L"Proud::CListNode<class Proud::CHeartbeatWorkThread::WorkData>::CListOwner::Erase")
  ;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1402f4860);
}



void FUN_1401c16d0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  DWORD DVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined1 uVar6;
  
  uVar4 = 0xfffffffffffffffe;
  if (*(char *)(param_1 + 0x80) != '\0') {
    plVar1 = (longlong *)(param_1 + 0x38);
    do {
      lVar5 = param_1;
      FUN_1400a1c30(param_1);
      uVar6 = 1;
      DVar3 = GetTickCount();
      puVar2 = (undefined8 *)*plVar1;
      if ((puVar2 == (undefined8 *)0x0) ||
         (DVar3 - *(int *)(puVar2 + 4) <= *(uint *)((longlong)puVar2 + 0x24))) {
        FUN_1400d1290(param_1);
      }
      else {
        *(DWORD *)(puVar2 + 4) = DVar3;
        if (puVar2[2] != 0) {
          FUN_1401c1500(puVar2[2],puVar2,param_3,param_4,uVar4,lVar5,uVar6);
        }
        if (puVar2[2] != 0) {
          FUN_1401c1500(plVar1,puVar2,param_3,param_4,uVar4,lVar5,uVar6);
        }
        if (*(longlong *)(param_1 + 0x40) == 0) {
          *plVar1 = (longlong)puVar2;
        }
        else {
          *(undefined8 **)(*(longlong *)(param_1 + 0x40) + 8) = puVar2;
          *puVar2 = *(undefined8 *)(param_1 + 0x40);
        }
        *(undefined8 **)(param_1 + 0x40) = puVar2;
        puVar2[2] = plVar1;
        *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
        FUN_1400d1290(param_1);
        *(undefined1 *)(puVar2 + 8) = 1;
        (**(code **)(*(longlong *)puVar2[3] + 8))();
        *(undefined1 *)(puVar2 + 8) = 0;
      }
      Sleep(10);
    } while (*(char *)(param_1 + 0x80) != '\0');
  }
  return;
}



void thunk_FUN_1401c15e0(void)

{
  FUN_1401c15e0();
  return;
}



void FUN_1401c17e0(longlong param_1,longlong param_2,undefined4 param_3)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  FUN_1400a1c30();
  if (*(longlong *)(param_2 + 8) == 0) {
    puVar2 = operator_new(0x80);
    if (puVar2 != (undefined8 *)0x0) {
      *puVar2 = 0;
      puVar2[1] = 0;
      puVar2[2] = 0;
      *(undefined4 *)(puVar2 + 4) = 0;
      *(undefined1 *)(puVar2 + 8) = 0;
    }
    puVar2[3] = param_2;
    *(undefined4 *)((longlong)puVar2 + 0x24) = param_3;
    *(longlong *)(param_2 + 8) = param_1;
    puVar1 = (undefined8 *)(param_1 + 0x38);
    if (puVar2[2] != 0) {
      FUN_1401c1500(puVar1,puVar2);
    }
    if (*(longlong *)(param_1 + 0x40) == 0) {
      *puVar1 = puVar2;
    }
    else {
      *(undefined8 **)(*(longlong *)(param_1 + 0x40) + 8) = puVar2;
      *puVar2 = *(undefined8 *)(param_1 + 0x40);
    }
    *(undefined8 **)(param_1 + 0x40) = puVar2;
    puVar2[2] = puVar1;
    *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
    FUN_1400d1290(param_1);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_1400a26d0();
}



void FUN_1401c18c0(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  void *pvVar2;
  undefined8 uVar3;
  longlong lVar4;
  undefined1 uVar5;
  
  uVar3 = 0xfffffffffffffffe;
  lVar4 = param_1;
  FUN_1400a1c30();
  if (*(longlong *)(param_2 + 8) != 0) {
    if (*(longlong *)(param_2 + 8) != param_1) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    for (pvVar2 = *(void **)(param_1 + 0x38); pvVar2 != (void *)0x0;
        pvVar2 = *(void **)((longlong)pvVar2 + 8)) {
      if (*(longlong *)((longlong)pvVar2 + 0x18) == param_2) {
        *(undefined8 *)(param_2 + 8) = 0;
        if (*(longlong *)((longlong)pvVar2 + 0x10) != 0) {
          FUN_1401c1500(*(longlong *)((longlong)pvVar2 + 0x10),pvVar2,param_3,param_4,uVar3,lVar4,1)
          ;
        }
        FUN_1400d1290(param_1);
        uVar5 = 0;
        cVar1 = *(char *)((longlong)pvVar2 + 0x40);
        while (cVar1 != '\0') {
          Sleep(10);
          cVar1 = *(char *)((longlong)pvVar2 + 0x40);
        }
        if (*(longlong *)((longlong)pvVar2 + 0x10) != 0) {
          FUN_1401c1500(*(longlong *)((longlong)pvVar2 + 0x10),pvVar2,param_3,param_4,uVar3,lVar4,
                        uVar5);
        }
        operator_delete(pvVar2);
        return;
      }
    }
  }
  FUN_1400d1290(param_1);
  return;
}



void FUN_1401c19a0(longlong param_1)

{
  undefined8 *puVar1;
  longlong *plVar2;
  undefined8 uVar3;
  int iVar4;
  longlong lVar5;
  
  FUN_1400a1c30();
  if (0 < *(int *)(param_1 + 0x48)) {
    FUN_1400a2b50(
                 L"CHeartbeatWorkThread must be cleaned up only after every work items are unregistered!"
                 );
  }
  *(undefined1 *)(param_1 + 0x80) = 0;
  iVar4 = 0;
  lVar5 = 0;
  if (0 < *(int *)(param_1 + 0x68)) {
    do {
      if ((lVar5 < 0) || (*(int *)(param_1 + 0x68) <= iVar4)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      puVar1 = *(undefined8 **)(*(longlong *)(param_1 + 0x60) + lVar5 * 8);
      uVar3 = 0;
      if (puVar1 != (undefined8 *)0x0) {
        uVar3 = *puVar1;
      }
      FUN_1400aaa10(uVar3);
      iVar4 = iVar4 + 1;
      lVar5 = lVar5 + 1;
    } while (iVar4 < *(int *)(param_1 + 0x68));
  }
  FUN_1400d1290(param_1);
  *(undefined ***)(param_1 + 0x50) = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 0x68)) {
    FUN_140154a50(*(undefined8 *)(param_1 + 0x60),(longlong)*(int *)(param_1 + 0x68));
  }
  if (*(longlong *)(param_1 + 0x60) != 0) {
    plVar2 = *(longlong **)(param_1 + 0x58);
    if (plVar2 == (longlong *)0x0) {
      FUN_1400a3530();
    }
    else {
      (**(code **)(*plVar2 + 0x18))(plVar2,*(longlong *)(param_1 + 0x60));
    }
  }
  FUN_1401c15e0(param_1 + 0x38);
  FUN_1400a1cd0(param_1);
  return;
}



longlong FUN_1401c1aa0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  void *pvVar4;
  ulonglong *puVar5;
  longlong *plVar6;
  undefined4 uVar7;
  int iVar8;
  longlong lVar9;
  longlong lVar10;
  longlong lVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  int iVar14;
  ulonglong uVar15;
  longlong lVar16;
  ulonglong uVar17;
  int iVar18;
  longlong *local_res18;
  undefined8 uVar19;
  
  uVar19 = 0xfffffffffffffffe;
  uVar7 = FUN_1401692e0();
  FUN_1400a1b50(param_1,uVar7,1,param_4,uVar19);
  iVar18 = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined4 *)(param_1 + 0x48) = 0;
  puVar2 = (undefined8 *)(param_1 + 0x50);
  *puVar2 = Proud::CFastArray<>::vftable;
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined1 *)(param_1 + 0x80) = 1;
  iVar8 = FUN_1400a2990();
  if (0 < iVar8) {
    do {
      lVar9 = 0;
      local_res18 = operator_new(0x28);
      if (local_res18 != (longlong *)0x0) {
        lVar9 = FUN_1400aa980(local_res18,&LAB_1401c18b0,param_1);
      }
      if (lVar9 == 0) {
        local_res18 = (longlong *)0x0;
      }
      else {
        local_res18 = (longlong *)FUN_1400a34c0(0x10);
        local_res18[1] = 1;
        *local_res18 = lVar9;
      }
      plVar1 = local_res18;
      iVar3 = *(int *)(param_1 + 0x68);
      if (iVar3 < 0) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      iVar14 = *(int *)(param_1 + 0x68);
      FUN_14018f440(puVar2,iVar14 + 1);
      iVar14 = iVar14 - iVar3;
      if ((0 < iVar14) && (iVar14 = iVar14 + -1, -1 < iVar14)) {
        lVar9 = (longlong)(iVar14 + iVar3 + 1) << 3;
        lVar16 = (longlong)(iVar14 + iVar3) << 3;
        do {
          lVar10 = FUN_1401b2160(puVar2);
          lVar11 = FUN_1401b2160(puVar2);
          FUN_14018b790(lVar9 + lVar11,lVar16 + lVar10);
          lVar16 = lVar16 + -8;
          lVar9 = lVar9 + -8;
          iVar14 = iVar14 + -1;
        } while (-1 < iVar14);
      }
      lVar9 = FUN_1401b2160(puVar2);
      FUN_14018b790(lVar9 + (longlong)iVar3 * 8,&local_res18);
      plVar6 = local_res18;
      if (plVar1 != (longlong *)0x0) {
        plVar1 = plVar1 + 1;
        *plVar1 = *plVar1 + -1;
        if (*plVar1 == 0) {
          pvVar4 = (void *)*local_res18;
          if (pvVar4 != (void *)0x0) {
            FUN_1400aaa90(pvVar4);
            operator_delete(pvVar4);
          }
          FUN_1400a3530(plVar6);
        }
      }
      iVar18 = iVar18 + 1;
    } while (iVar18 < iVar8);
  }
  uVar17 = 0;
  uVar13 = uVar17;
  uVar15 = uVar17;
  if (0 < iVar8) {
    do {
      if (((longlong)uVar13 < 0) || (*(int *)(param_1 + 0x68) <= (int)uVar15)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      puVar5 = *(ulonglong **)(*(longlong *)(param_1 + 0x60) + uVar13 * 8);
      uVar12 = uVar17;
      if (puVar5 != (ulonglong *)0x0) {
        uVar12 = *puVar5;
      }
      FUN_1400aab80(uVar12);
      uVar15 = (ulonglong)((int)uVar15 + 1);
      uVar13 = uVar13 + 1;
    } while ((longlong)uVar13 < (longlong)iVar8);
  }
  return param_1;
}



undefined8 FUN_1401c1cf0(undefined8 param_1,undefined4 *param_2)

{
  FUN_14007c6e0(param_1,*param_2);
  FUN_14003d020(param_1,*(undefined2 *)(param_2 + 1));
  FUN_140186d90(param_1,param_2 + 2);
  FUN_14003c9e0(param_1,*(undefined1 *)(param_2 + 4));
  return param_1;
}



undefined8 FUN_1401c1d40(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  DWORD DVar1;
  HANDLE pvVar2;
  DWORD local_18;
  undefined8 local_14;
  undefined4 local_c;
  
  local_18 = GetCurrentThreadId();
  local_c = 0;
  local_14 = param_2;
  DVar1 = GetCurrentProcessId();
  pvVar2 = GetCurrentProcess();
  MiniDumpWriteDump(pvVar2,DVar1,param_3,0,&local_18,0,0);
  return 1;
}



void FUN_1401c1dc0(LPCWSTR param_1)

{
  HANDLE hObject;
  
  SetErrorMode(2);
  hObject = CreateFileW(param_1,0x40000000,2,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,(HANDLE)0x0);
  if (hObject != (HANDLE)0xffffffffffffffff) {
    DAT_00000000 = 1;
    CloseHandle(hObject);
  }
  return;
}



undefined8 * FUN_1401c1e30(undefined8 *param_1)

{
  *param_1 = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 1) = 0;
  *(undefined2 *)((longlong)param_1 + 0xc) = 0;
  param_1[2] = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 3) = 0;
  *(undefined2 *)((longlong)param_1 + 0x1c) = 0;
  param_1[4] = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 5) = 0;
  *(undefined2 *)((longlong)param_1 + 0x2c) = 0;
  FUN_1401529c0(param_1 + 7);
  FUN_1400a3440();
  param_1[0x13] = PTR_DAT_1402f8010;
  *(undefined1 *)((longlong)param_1 + 0x91) = 0;
  *(undefined1 *)((longlong)param_1 + 0x34) = 1;
  *(undefined4 *)(param_1 + 6) = 0;
  *(undefined4 *)(param_1 + 3) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_1 + 0x1c) = DAT_1402f83d4;
  *(undefined4 *)(param_1 + 1) = *(undefined4 *)(param_1 + 3);
  *(undefined2 *)((longlong)param_1 + 0xc) = *(undefined2 *)((longlong)param_1 + 0x1c);
  *(undefined4 *)(param_1 + 5) = DAT_1402f83d0;
  *(undefined2 *)((longlong)param_1 + 0x2c) = DAT_1402f83d4;
  param_1[0x14] = 0;
  *(undefined4 *)(param_1 + 0x15) = 0;
  *(undefined1 *)(param_1 + 0x12) = 0;
  param_1[0x16] = 0;
  param_1[0x17] = 0;
  *(undefined4 *)(param_1 + 0x19) = 0;
  param_1[0x18] = 0;
  return param_1;
}



ulonglong FUN_1401c1f20(double *param_1,double param_2,double param_3)

{
  int iVar1;
  ulonglong in_RAX;
  
  if (DAT_140313fcc != '\0') {
    if (*param_1 == 0.0) {
      *param_1 = param_2;
    }
    else if (DAT_1402f814c <= *(int *)(param_1 + 1)) {
      iVar1 = (int)((param_2 - *param_1) * param_3);
      return (ulonglong)CONCAT31((int3)((uint)iVar1 >> 8),iVar1 < *(int *)(param_1 + 1));
    }
  }
  return in_RAX & 0xffffffffffffff00;
}



void FUN_1401c1f60(longlong param_1,int param_2)

{
  *(int *)(param_1 + 8) = *(int *)(param_1 + 8) + param_2;
  return;
}



void FUN_1401c1f70(double *param_1,double param_2)

{
  if (0.0 < param_2 - *param_1) {
    *param_1 = param_2;
    *(undefined4 *)(param_1 + 1) = 0;
  }
  return;
}



undefined8 * FUN_1401c1f90(undefined8 *param_1)

{
  *param_1 = 0;
  *(undefined4 *)(param_1 + 1) = 0;
  return param_1;
}



undefined8 FUN_1401c1fa0(double *param_1,double param_2)

{
  if (*param_1 == 0.0) {
    *param_1 = param_2;
  }
  return 0x6400000;
}



undefined1 FUN_1401c1fc0(longlong param_1,double param_2)

{
  if (DAT_1402f8180 * 3.0 < param_2 - *(double *)(param_1 + 0x18)) {
    return 1;
  }
  return 0;
}



void FUN_1401c1ff0(double *param_1,double param_2,double param_3)

{
  double dVar1;
  
  if (param_3 == 0.0) {
    param_3 = 2146483647.0;
  }
  if (param_2 * 0.5 <= param_3) {
    dVar1 = *param_1 * 2.0;
    *param_1 = dVar1;
    if (2146483647.0 <= dVar1) {
      dVar1 = 2146483647.0;
    }
    *param_1 = dVar1;
  }
  else {
    *param_1 = param_3 * 0.8;
  }
  if (*param_1 <= (double)DAT_1402f814c) {
    *param_1 = (double)DAT_1402f814c;
    return;
  }
  *param_1 = *param_1;
  return;
}



undefined8 * FUN_1401c2070(undefined8 *param_1)

{
  *param_1 = 0x41dffc2f6fc00000;
  return param_1;
}



void FUN_1401c2090(undefined8 *param_1,double param_2)

{
  if ((double)param_1[1] == 0.0) {
    param_1[1] = param_2;
  }
  if (DAT_1402f8180 * 3.0 < param_2 - (double)param_1[1]) {
    param_1[1] = param_2;
    *param_1 = 0;
  }
  return;
}



void FUN_1401c20e0(double *param_1,double param_2)

{
  double dVar1;
  double dVar2;
  
  if (param_1[2] == 0.0) {
    param_1[2] = param_2;
  }
  dVar2 = param_2 - param_1[2];
  if ((dVar2 != 0.0) && (DAT_1402f8180 * 0.2 < dVar2)) {
    dVar1 = param_1[1];
    param_1[2] = param_2;
    param_1[1] = 0.0;
    *param_1 = (dVar1 / dVar2 - *param_1) * 0.7 + *param_1;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1401c2150(uint param_1,int param_2,longlong param_3,undefined8 param_4)

{
  int iVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  undefined1 auStack_168 [32];
  undefined1 local_148 [256];
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_168;
  lVar4 = (longlong)param_2;
  if (param_3 == 0) {
    uVar3 = 0x10;
  }
  else {
    uVar3 = FUN_1401cbff0(param_2);
    if ((int)uVar3 == 0) {
      if (param_1 - 0x40 < 0x3c1) {
        uVar3 = (**(code **)(lVar4 * 0x50 + 0x14031a340))(param_3);
        if ((int)uVar3 == 0) {
          iVar1 = ((int)CONCAT71((int7)((ulonglong)uVar3 >> 8),(param_1 & 7) != 0) +
                  ((int)(param_1 + ((int)param_1 >> 0x1f & 7U)) >> 3)) * 2;
          iVar2 = FUN_1401cbf90(local_148,iVar1,param_4);
          if (iVar2 == iVar1) {
            uVar3 = (**(code **)(lVar4 * 0x50 + 0x14031a348))(local_148,iVar1,param_3);
            if ((int)uVar3 == 0) {
              uVar3 = (**(code **)(lVar4 * 0x50 + 0x14031a350))(param_3);
            }
          }
          else {
            uVar3 = 9;
          }
        }
      }
      else {
        uVar3 = 8;
      }
    }
  }
  return uVar3;
}



int FUN_1401c2250(longlong param_1)

{
  char cVar1;
  char cVar2;
  char *pcVar3;
  int iVar4;
  undefined8 *puVar5;
  longlong lVar6;
  
  if (param_1 == 0) {
    return 0x10;
  }
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_140321000);
  iVar4 = 0;
  puVar5 = &DAT_14031ad30;
  do {
    pcVar3 = (char *)*puVar5;
    if (pcVar3 != (char *)0x0) {
      lVar6 = param_1 - (longlong)pcVar3;
      do {
        cVar1 = *pcVar3;
        cVar2 = pcVar3[lVar6];
        if (cVar1 != cVar2) break;
        pcVar3 = pcVar3 + 1;
      } while (cVar2 != '\0');
      if (cVar1 == cVar2) {
        LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140321000);
        return iVar4;
      }
    }
    iVar4 = iVar4 + 1;
    puVar5 = puVar5 + 0x10;
    if (0x1f < iVar4) {
      LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140321000);
      return -1;
    }
  } while( true );
}



int FUN_1401c22f0(longlong param_1)

{
  char cVar1;
  char cVar2;
  char *pcVar3;
  int iVar4;
  undefined8 *puVar5;
  longlong lVar6;
  
  if (param_1 == 0) {
    return 0x10;
  }
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_140321040);
  iVar4 = 0;
  puVar5 = &DAT_14031a330;
  do {
    pcVar3 = (char *)*puVar5;
    if (pcVar3 != (char *)0x0) {
      lVar6 = param_1 - (longlong)pcVar3;
      do {
        cVar1 = *pcVar3;
        cVar2 = pcVar3[lVar6];
        if (cVar1 != cVar2) break;
        pcVar3 = pcVar3 + 1;
      } while (cVar2 != '\0');
      if (cVar1 == cVar2) {
        LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140321040);
        return iVar4;
      }
    }
    iVar4 = iVar4 + 1;
    puVar5 = puVar5 + 10;
    if (0x1f < iVar4) {
      LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140321040);
      return -1;
    }
  } while( true );
}



undefined4 FUN_1401c2390(int param_1)

{
  int *piVar1;
  int iVar2;
  
  iVar2 = 0;
  piVar1 = &DAT_1402679e0;
  do {
    if (param_1 == *piVar1) {
      return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar2 * 8);
    }
    piVar1 = piVar1 + 2;
    iVar2 = iVar2 + 1;
  } while ((longlong)piVar1 < 0x1402679f8);
  return 1;
}



int FUN_1401c23d0(undefined8 *param_1)

{
  int iVar1;
  void *pvVar2;
  int *piVar3;
  int iVar4;
  int iVar5;
  
  if (param_1 == (undefined8 *)0x0) {
    return 0x10;
  }
  iVar5 = 1;
  pvVar2 = calloc(1,0x18);
  *param_1 = pvVar2;
  if (pvVar2 == (void *)0x0) {
    return 0xd;
  }
  iVar1 = FUN_1401cc2a0();
  iVar4 = 0;
  piVar3 = &DAT_1402679e0;
  do {
    if (iVar1 == *piVar3) {
      iVar5 = *(int *)(&DAT_1402679e4 + (longlong)iVar4 * 8);
      if (iVar5 == 0) {
        return 0;
      }
      break;
    }
    piVar3 = piVar3 + 2;
    iVar4 = iVar4 + 1;
  } while ((longlong)piVar3 < 0x1402679f8);
  free((void *)*param_1);
  return iVar5;
}



void FUN_1401c2470(void *param_1)

{
  if (param_1 != (void *)0x0) {
    FUN_1401cc300();
    free(param_1);
  }
  return;
}



undefined4 FUN_1401c24a0(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1401cc360();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c2500(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1401cc3a0();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c2560(longlong *param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  iVar1 = FUN_1401c23d0();
  if (iVar1 != 0) {
    return 0xd;
  }
  if ((param_2 != 0) && (*param_1 != 0)) {
    iVar1 = FUN_1401cc3a0(param_2);
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c2600(longlong param_1)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if (param_1 == 0) {
    return 0x10;
  }
  iVar1 = FUN_1401cc430();
  iVar3 = 0;
  piVar2 = &DAT_1402679e0;
  do {
    if (iVar1 == *piVar2) {
      return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
    }
    piVar2 = piVar2 + 2;
    iVar3 = iVar3 + 1;
  } while ((longlong)piVar2 < 0x1402679f8);
  return 1;
}



ulonglong FUN_1401c26b0(longlong param_1,longlong param_2)

{
  int iVar1;
  
  if ((param_1 == 0) || (param_2 == 0)) {
    return 0x10;
  }
  iVar1 = FUN_1401cc4f0();
  if (iVar1 == -1) {
    return 0xffffffff;
  }
  if (iVar1 != 0) {
    return (ulonglong)(iVar1 == 1);
  }
  return 0;
}



uint FUN_1401c2700(longlong param_1)

{
  int iVar1;
  
  if (param_1 == 0) {
    return 0x10;
  }
  iVar1 = FUN_1401cc520();
  if (iVar1 != -1) {
    if (iVar1 != 0) {
      return (uint)(iVar1 == 1);
    }
    return 0;
  }
  return 0xffffffff;
}



undefined4 FUN_1401c2760(longlong param_1)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if (param_1 == 0) {
    return 0x10;
  }
  iVar1 = FUN_1401cc5f0();
  iVar3 = 0;
  piVar2 = &DAT_1402679e0;
  do {
    if (iVar1 == *piVar2) {
      return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
    }
    piVar2 = piVar2 + 2;
    iVar3 = iVar3 + 1;
  } while ((longlong)piVar2 < 0x1402679f8);
  return 1;
}



undefined4 FUN_1401c27c0(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1401cc670();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c2820(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1401cc770();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c2890(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1401cc8a0();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c28f0(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1401cc950();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c2950(longlong param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if (((param_1 != 0) && (param_2 != 0)) && (param_3 != 0)) {
    iVar1 = FUN_1401cc9e0();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c29b0(longlong param_1,undefined8 param_2,longlong param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_3 != 0)) {
    iVar1 = FUN_1401cca60();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c2a10(longlong param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if (((param_1 != 0) && (param_2 != 0)) && (param_3 != 0)) {
    iVar1 = FUN_1401ccba0();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c2a70(longlong param_1,undefined8 param_2,longlong param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_3 != 0)) {
    iVar1 = FUN_1401ccc20();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c2ad0(longlong param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if (((param_1 != 0) && (param_2 != 0)) && (param_3 != 0)) {
    iVar1 = FUN_1401ccd60();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c2b30(longlong param_1,undefined8 param_2,longlong param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_3 != 0)) {
    iVar1 = FUN_1401cce10();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c2b90(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1401cced0();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c2bf0(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1401ccf50();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c2c50(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1401cd480();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



int FUN_1401c2cb0(longlong param_1,undefined8 param_2,undefined4 *param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  undefined4 local_res8 [8];
  
  if ((param_1 != 0) && (param_3 != (undefined4 *)0x0)) {
    iVar1 = FUN_1401cd530(param_1,param_2,local_res8);
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        iVar1 = *(int *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
        if (iVar1 == 0) {
          *param_3 = local_res8[0];
          iVar1 = 0;
        }
        return iVar1;
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c2d30(longlong param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if (((param_1 != 0) && (param_2 != 0)) && (param_3 != 0)) {
    iVar1 = FUN_1401cd540();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c2d90(longlong param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if (((param_1 != 0) && (param_2 != 0)) && (param_3 != 0)) {
    iVar1 = FUN_1401cd720();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined8 FUN_1401c2df0(longlong param_1,longlong param_2,longlong param_3,longlong param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  if ((((param_1 != 0) && (param_2 != 0)) && (param_3 != 0)) && (param_4 != 0)) {
    uVar1 = FUN_1401cd7f0();
    uVar2 = FUN_1401c2390(uVar1);
    return uVar2;
  }
  return 0x10;
}



undefined4 FUN_1401c2e30(longlong param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if (((param_1 != 0) && (param_2 != 0)) && (param_3 != 0)) {
    iVar1 = FUN_1401cd870();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c2e90(longlong param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if (((param_1 != 0) && (param_2 != 0)) && (param_3 != 0)) {
    iVar1 = FUN_1401cd8e0();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



int FUN_1401c2ef0(longlong param_1,undefined8 *param_2)

{
  int iVar1;
  void *pvVar2;
  int *piVar3;
  int iVar4;
  int iVar5;
  
  if ((param_1 == 0) || (param_2 == (undefined8 *)0x0)) {
    return 0x10;
  }
  iVar5 = 1;
  pvVar2 = calloc(1,4);
  *param_2 = pvVar2;
  if (pvVar2 == (void *)0x0) {
    return 0xd;
  }
  iVar1 = FUN_1401cd910(param_1);
  iVar4 = 0;
  piVar3 = &DAT_1402679e0;
  do {
    if (iVar1 == *piVar3) {
      iVar5 = *(int *)(&DAT_1402679e4 + (longlong)iVar4 * 8);
      if (iVar5 == 0) {
        return 0;
      }
      break;
    }
    piVar3 = piVar3 + 2;
    iVar4 = iVar4 + 1;
  } while ((longlong)piVar3 < 0x1402679f8);
  free((void *)*param_2);
  return iVar5;
}



undefined4 FUN_1401c2fb0(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1401cd970();
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1401c3010(longlong param_1,longlong param_2,undefined4 *param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if (((param_1 != 0) && (param_2 != 0)) && (param_3 != (undefined4 *)0x0)) {
    iVar1 = FUN_1401cda40(param_1,param_2,*param_3);
    iVar3 = 0;
    piVar2 = &DAT_1402679e0;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x1402679f8);
    return 1;
  }
  return 0x10;
}



undefined8 FUN_1401c3080(longlong param_1,longlong param_2,longlong param_3,longlong param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  if ((((param_1 != 0) && (param_2 != 0)) && (param_3 != 0)) && (param_4 != 0)) {
    uVar1 = FUN_1401cdbb0();
    uVar2 = FUN_1401c2390(uVar1);
    return uVar2;
  }
  return 0x10;
}



undefined4 FUN_1401c30c0(longlong param_1,uint *param_2)

{
  undefined4 uVar1;
  int iVar2;
  int *piVar3;
  int iVar4;
  
  if ((param_1 != 0) && (param_2 != (uint *)0x0)) {
    iVar2 = FUN_1401cdd10(param_1,8);
    iVar4 = 0;
    piVar3 = &DAT_1402679e0;
    do {
      if (iVar2 == *piVar3) {
        uVar1 = *(undefined4 *)(&DAT_1402679e4 + (longlong)iVar4 * 8);
        *param_2 = (uint)(*param_2 == 1);
        return uVar1;
      }
      piVar3 = piVar3 + 2;
      iVar4 = iVar4 + 1;
    } while ((longlong)piVar3 < 0x1402679f8);
    *param_2 = (uint)(*param_2 == 1);
    return 1;
  }
  return 0x10;
}



int FUN_1401c3140(void *param_1)

{
  int iVar1;
  longlong *plVar2;
  int iVar3;
  int iVar4;
  
  if (param_1 == (void *)0x0) {
    return 0x10;
  }
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_140321000);
  iVar4 = 0;
  iVar3 = 0;
  do {
    iVar1 = memcmp(&DAT_14031ad30 + (longlong)iVar3 * 0x10,param_1,0x80);
    if (iVar1 == 0) {
      LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140321000);
      return iVar3;
    }
    iVar3 = iVar3 + 1;
  } while (iVar3 < 0x20);
  plVar2 = &DAT_14031ad30;
  do {
    if (*plVar2 == 0) {
      memcpy(&DAT_14031ad30 + (longlong)iVar4 * 0x10,param_1,0x80);
      LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140321000);
      return iVar4;
    }
    plVar2 = plVar2 + 0x10;
    iVar4 = iVar4 + 1;
  } while ((longlong)plVar2 < 0x14031bd30);
  LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140321000);
  return -1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1401c3220(longlong param_1,longlong param_2)

{
  uint uVar1;
  undefined1 uVar2;
  undefined1 uVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  longlong lVar7;
  uint *puVar8;
  int *piVar9;
  uint uVar10;
  uint uVar11;
  uint uVar12;
  uint uVar13;
  undefined1 *puVar14;
  undefined1 *puVar15;
  uint uVar16;
  uint uVar17;
  longlong lVar18;
  undefined1 auStack_17a [2];
  undefined1 local_178 [4];
  undefined1 local_174 [4];
  undefined1 local_170 [4];
  uint local_16c [37];
  int local_d8 [20];
  int local_88 [20];
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)local_178;
  lVar18 = 4;
  lVar7 = 4;
  puVar14 = (undefined1 *)(param_2 + 2);
  do {
    puVar15 = puVar14 + 0x10;
    uVar2 = puVar14[3];
    *(uint *)(puVar15 + (longlong)local_16c + (-0x1e - param_2)) =
         CONCAT31(CONCAT21(CONCAT11(puVar14[-2],puVar14[-1]),*puVar14),puVar14[1]);
    uVar3 = puVar14[7];
    *(uint *)(puVar15 + (longlong)local_16c + (-0x1a - param_2)) =
         CONCAT31(CONCAT21(CONCAT11(puVar14[2],uVar2),puVar14[4]),puVar14[5]);
    uVar2 = puVar14[0xb];
    *(uint *)(puVar15 + (longlong)local_16c + (-0x16 - param_2)) =
         CONCAT31(CONCAT21(CONCAT11(puVar14[6],uVar3),puVar14[8]),puVar14[9]);
    lVar7 = lVar7 + -1;
    *(uint *)(puVar15 + (longlong)local_16c + (-0x12 - param_2)) =
         CONCAT31(CONCAT21(CONCAT11(puVar14[10],uVar2),puVar14[0xc]),puVar14[0xd]);
    puVar14 = puVar15;
  } while (lVar7 != 0);
  uVar4 = *(uint *)(param_1 + 8);
  uVar5 = *(uint *)(param_1 + 0xc);
  uVar16 = *(uint *)(param_1 + 0x10);
  uVar17 = *(uint *)(param_1 + 0x14);
  uVar10 = *(uint *)(param_1 + 0x18);
  lVar7 = 0x10;
  puVar8 = local_16c + 5;
  do {
    uVar13 = puVar8[-8] ^ puVar8[5] ^ puVar8[-6] ^ *puVar8;
    uVar6 = puVar8[-7] ^ puVar8[6] ^ puVar8[1] ^ puVar8[-5];
    uVar13 = uVar13 << 1 | (uint)((int)uVar13 < 0);
    puVar8[8] = uVar13;
    puVar8[9] = uVar6 << 1 | (uint)((int)uVar6 < 0);
    uVar6 = puVar8[7] ^ puVar8[-4] ^ puVar8[2] ^ puVar8[-6];
    puVar8[10] = uVar6 << 1 | (uint)((int)uVar6 < 0);
    uVar6 = puVar8[-3] ^ puVar8[3] ^ uVar13 ^ puVar8[-5];
    lVar7 = lVar7 + -1;
    puVar8[0xb] = uVar6 << 1 | (uint)((int)uVar6 < 0);
    puVar8 = puVar8 + 4;
  } while (lVar7 != 0);
  lVar7 = 4;
  piVar9 = (int *)local_178;
  uVar13 = uVar4;
  uVar6 = uVar5;
  do {
    uVar12 = uVar6 << 0x1e | uVar6 >> 2;
    uVar6 = uVar10 + 0x5a827999 +
            (uVar13 << 5 | uVar13 >> 0x1b) + ((uVar17 ^ uVar16) & uVar6 ^ uVar17) + *piVar9;
    uVar11 = uVar13 << 0x1e | uVar13 >> 2;
    uVar13 = uVar17 + 0x5a827999 +
             (uVar6 * 0x20 | uVar6 >> 0x1b) + ((uVar16 ^ uVar12) & uVar13 ^ uVar16) + piVar9[1];
    uVar10 = uVar6 * 0x40000000 | uVar6 >> 2;
    uVar1 = uVar16 + 0x5a827999 +
            (uVar13 * 0x20 | uVar13 >> 0x1b) + ((uVar12 ^ uVar11) & uVar6 ^ uVar12) + piVar9[2];
    uVar17 = uVar13 * 0x40000000 | uVar13 >> 2;
    uVar6 = uVar12 + 0x5a827999 +
            (uVar1 * 0x20 | uVar1 >> 0x1b) + ((uVar10 ^ uVar11) & uVar13 ^ uVar11) + piVar9[3];
    uVar16 = uVar1 * 0x40000000 | uVar1 >> 2;
    lVar7 = lVar7 + -1;
    uVar13 = uVar11 + 0x5a827999 +
             (uVar6 * 0x20 | uVar6 >> 0x1b) + ((uVar10 ^ uVar17) & uVar1 ^ uVar10) + piVar9[4];
    piVar9 = piVar9 + 5;
  } while (lVar7 != 0);
  lVar7 = 4;
  puVar8 = local_16c + 0x11;
  do {
    uVar12 = uVar6 << 0x1e | uVar6 >> 2;
    uVar6 = uVar10 + 0x6ed9eba1 +
            (uVar13 << 5 | uVar13 >> 0x1b) + (uVar17 ^ uVar16 ^ uVar6) + *puVar8;
    uVar11 = uVar13 << 0x1e | uVar13 >> 2;
    uVar13 = uVar17 + 0x6ed9eba1 +
             (uVar6 * 0x20 | uVar6 >> 0x1b) + (uVar16 ^ uVar12 ^ uVar13) + puVar8[1];
    uVar10 = uVar6 * 0x40000000 | uVar6 >> 2;
    uVar1 = uVar16 + 0x6ed9eba1 +
            (uVar13 * 0x20 | uVar13 >> 0x1b) + (uVar6 ^ uVar12 ^ uVar11) + puVar8[2];
    uVar17 = uVar13 * 0x40000000 | uVar13 >> 2;
    uVar6 = uVar12 + 0x6ed9eba1 +
            (uVar1 * 0x20 | uVar1 >> 0x1b) + (uVar10 ^ uVar13 ^ uVar11) + puVar8[3];
    uVar16 = uVar1 * 0x40000000 | uVar1 >> 2;
    lVar7 = lVar7 + -1;
    uVar13 = uVar11 + 0x6ed9eba1 +
             (uVar6 * 0x20 | uVar6 >> 0x1b) + (uVar10 ^ uVar17 ^ uVar1) + puVar8[4];
    puVar8 = puVar8 + 5;
  } while (lVar7 != 0);
  lVar7 = 4;
  piVar9 = local_d8;
  do {
    uVar12 = uVar6 << 0x1e | uVar6 >> 2;
    uVar6 = ((uVar16 | uVar6) & uVar17 | uVar16 & uVar6) + *piVar9 + uVar10 + -0x70e44324 +
            (uVar13 << 5 | uVar13 >> 0x1b);
    uVar11 = uVar13 << 0x1e | uVar13 >> 2;
    uVar13 = ((uVar12 | uVar13) & uVar16 | uVar12 & uVar13) + piVar9[1] + uVar17 + -0x70e44324 +
             (uVar6 * 0x20 | uVar6 >> 0x1b);
    uVar10 = uVar6 * 0x40000000 | uVar6 >> 2;
    uVar1 = ((uVar6 | uVar11) & uVar12 | uVar6 & uVar11) + piVar9[2] + uVar16 + -0x70e44324 +
            (uVar13 * 0x20 | uVar13 >> 0x1b);
    uVar17 = uVar13 * 0x40000000 | uVar13 >> 2;
    uVar6 = ((uVar10 | uVar13) & uVar11 | uVar10 & uVar13) + piVar9[3] + uVar12 + -0x70e44324 +
            (uVar1 * 0x20 | uVar1 >> 0x1b);
    uVar16 = uVar1 * 0x40000000 | uVar1 >> 2;
    lVar7 = lVar7 + -1;
    uVar13 = ((uVar17 | uVar1) & uVar10 | uVar17 & uVar1) + piVar9[4] + uVar11 + -0x70e44324 +
             (uVar6 * 0x20 | uVar6 >> 0x1b);
    piVar9 = piVar9 + 5;
  } while (lVar7 != 0);
  piVar9 = local_88;
  do {
    uVar12 = uVar6 << 0x1e | uVar6 >> 2;
    uVar6 = (uVar17 ^ uVar16 ^ uVar6) + *piVar9 + uVar10 + -0x359d3e2a +
            (uVar13 << 5 | uVar13 >> 0x1b);
    uVar11 = uVar13 << 0x1e | uVar13 >> 2;
    uVar13 = (uVar16 ^ uVar12 ^ uVar13) + piVar9[1] + uVar17 + -0x359d3e2a +
             (uVar6 * 0x20 | uVar6 >> 0x1b);
    uVar10 = uVar6 * 0x40000000 | uVar6 >> 2;
    uVar1 = (uVar6 ^ uVar12 ^ uVar11) + piVar9[2] + uVar16 + -0x359d3e2a +
            (uVar13 * 0x20 | uVar13 >> 0x1b);
    uVar17 = uVar13 * 0x40000000 | uVar13 >> 2;
    uVar6 = (uVar10 ^ uVar13 ^ uVar11) + piVar9[3] + uVar12 + -0x359d3e2a +
            (uVar1 * 0x20 | uVar1 >> 0x1b);
    uVar16 = uVar1 * 0x40000000 | uVar1 >> 2;
    lVar18 = lVar18 + -1;
    uVar13 = (uVar10 ^ uVar17 ^ uVar1) + piVar9[4] + uVar11 + -0x359d3e2a +
             (uVar6 * 0x20 | uVar6 >> 0x1b);
    piVar9 = piVar9 + 5;
  } while (lVar18 != 0);
  *(uint *)(param_1 + 8) = uVar4 + uVar13;
  *(uint *)(param_1 + 0xc) = uVar5 + uVar6;
  *(uint *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + uVar16;
  *(uint *)(param_1 + 0x14) = *(int *)(param_1 + 0x14) + uVar17;
  *(uint *)(param_1 + 0x18) = *(int *)(param_1 + 0x18) + uVar10;
  return 0;
}



undefined8 FUN_1401c3730(longlong *param_1,void *param_2,uint param_3)

{
  undefined8 uVar1;
  uint uVar2;
  
  if (((param_1 != (longlong *)0x0) && (param_2 != (void *)0x0)) &&
     (*(uint *)((longlong)param_1 + 0x1c) < 0x41)) {
    while( true ) {
      while( true ) {
        if (param_3 == 0) {
          return 0;
        }
        if ((*(int *)((longlong)param_1 + 0x1c) == 0) && (0x3f < param_3)) break;
        uVar2 = 0x40 - *(int *)((longlong)param_1 + 0x1c);
        if (param_3 < uVar2) {
          uVar2 = param_3;
        }
        memcpy((void *)((ulonglong)*(uint *)((longlong)param_1 + 0x1c) + 0x20 + (longlong)param_1),
               param_2,(ulonglong)uVar2);
        *(int *)((longlong)param_1 + 0x1c) = *(int *)((longlong)param_1 + 0x1c) + uVar2;
        param_2 = (void *)((longlong)param_2 + (ulonglong)uVar2);
        param_3 = param_3 - uVar2;
        if (*(int *)((longlong)param_1 + 0x1c) == 0x40) {
          uVar1 = FUN_1401c3220(param_1,param_1 + 4);
          if ((int)uVar1 != 0) {
            return uVar1;
          }
          *param_1 = *param_1 + 0x200;
          *(undefined4 *)((longlong)param_1 + 0x1c) = 0;
        }
      }
      uVar1 = FUN_1401c3220(param_1,param_2);
      if ((int)uVar1 != 0) break;
      *param_1 = *param_1 + 0x200;
      param_2 = (void *)((longlong)param_2 + 0x40);
      param_3 = param_3 - 0x40;
    }
    return uVar1;
  }
  return 0x10;
}



undefined8 FUN_1401c3810(longlong *param_1,undefined1 *param_2)

{
  uint uVar1;
  
  if ((param_1 != (longlong *)0x0) && (param_2 != (undefined1 *)0x0)) {
    uVar1 = *(uint *)((longlong)param_1 + 0x1c);
    if (uVar1 < 0x40) {
      *param_1 = *param_1 + (ulonglong)(uVar1 * 8);
      *(undefined1 *)((ulonglong)uVar1 + 0x20 + (longlong)param_1) = 0x80;
      *(int *)((longlong)param_1 + 0x1c) = *(int *)((longlong)param_1 + 0x1c) + 1;
      uVar1 = *(uint *)((longlong)param_1 + 0x1c);
      if (0x38 < uVar1) {
        while (uVar1 < 0x40) {
          *(undefined1 *)((ulonglong)uVar1 + 0x20 + (longlong)param_1) = 0;
          *(int *)((longlong)param_1 + 0x1c) = *(int *)((longlong)param_1 + 0x1c) + 1;
          uVar1 = *(uint *)((longlong)param_1 + 0x1c);
        }
        FUN_1401c3220(param_1,param_1 + 4);
        *(undefined4 *)((longlong)param_1 + 0x1c) = 0;
      }
      uVar1 = *(uint *)((longlong)param_1 + 0x1c);
      while (uVar1 < 0x38) {
        *(undefined1 *)((ulonglong)*(uint *)((longlong)param_1 + 0x1c) + 0x20 + (longlong)param_1) =
             0;
        *(int *)((longlong)param_1 + 0x1c) = *(int *)((longlong)param_1 + 0x1c) + 1;
        uVar1 = *(uint *)((longlong)param_1 + 0x1c);
      }
      *(undefined1 *)(param_1 + 0xb) = *(undefined1 *)((longlong)param_1 + 7);
      *(undefined1 *)((longlong)param_1 + 0x59) = *(undefined1 *)((longlong)param_1 + 6);
      *(undefined1 *)((longlong)param_1 + 0x5a) = *(undefined1 *)((longlong)param_1 + 5);
      *(undefined1 *)((longlong)param_1 + 0x5b) = *(undefined1 *)((longlong)param_1 + 4);
      *(undefined1 *)((longlong)param_1 + 0x5c) = *(undefined1 *)((longlong)param_1 + 3);
      *(undefined1 *)((longlong)param_1 + 0x5d) = *(undefined1 *)((longlong)param_1 + 2);
      *(undefined1 *)((longlong)param_1 + 0x5e) = *(undefined1 *)((longlong)param_1 + 1);
      *(char *)((longlong)param_1 + 0x5f) = (char)*param_1;
      FUN_1401c3220(param_1,param_1 + 4);
      *param_2 = *(undefined1 *)((longlong)param_1 + 0xb);
      param_2[1] = *(undefined1 *)((longlong)param_1 + 10);
      param_2[2] = *(undefined1 *)((longlong)param_1 + 9);
      param_2[3] = (char)param_1[1];
      param_2[4] = *(undefined1 *)((longlong)param_1 + 0xf);
      param_2[5] = *(undefined1 *)((longlong)param_1 + 0xe);
      param_2[6] = *(undefined1 *)((longlong)param_1 + 0xd);
      param_2[7] = *(undefined1 *)((longlong)param_1 + 0xc);
      param_2[8] = *(undefined1 *)((longlong)param_1 + 0x13);
      param_2[9] = *(undefined1 *)((longlong)param_1 + 0x12);
      param_2[10] = *(undefined1 *)((longlong)param_1 + 0x11);
      param_2[0xb] = (char)param_1[2];
      param_2[0xc] = *(undefined1 *)((longlong)param_1 + 0x17);
      param_2[0xd] = *(undefined1 *)((longlong)param_1 + 0x16);
      param_2[0xe] = *(undefined1 *)((longlong)param_1 + 0x15);
      param_2[0xf] = *(undefined1 *)((longlong)param_1 + 0x14);
      param_2[0x10] = *(undefined1 *)((longlong)param_1 + 0x1b);
      param_2[0x11] = *(undefined1 *)((longlong)param_1 + 0x1a);
      param_2[0x12] = *(undefined1 *)((longlong)param_1 + 0x19);
      param_2[0x13] = (char)param_1[3];
      return 0;
    }
  }
  return 0x10;
}



int FUN_1401c3990(void *param_1)

{
  int iVar1;
  longlong *plVar2;
  int iVar3;
  int iVar4;
  
  if (param_1 == (void *)0x0) {
    return 0x10;
  }
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_140321040);
  iVar4 = 0;
  iVar3 = 0;
  do {
    iVar1 = memcmp(&DAT_14031a330 + (longlong)iVar3 * 10,param_1,0x50);
    if (iVar1 == 0) {
      LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140321040);
      return iVar3;
    }
    iVar3 = iVar3 + 1;
  } while (iVar3 < 0x20);
  plVar2 = &DAT_14031a330;
  do {
    if (*plVar2 == 0) {
      memcpy(&DAT_14031a330 + (longlong)iVar4 * 10,param_1,0x50);
      LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140321040);
      return iVar4;
    }
    plVar2 = plVar2 + 10;
    iVar4 = iVar4 + 1;
  } while ((longlong)plVar2 < 0x14031ad30);
  LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140321040);
  return -1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1401c3a80(longlong param_1)

{
  uint uVar1;
  ulonglong uVar2;
  char *pcVar3;
  int iVar4;
  longlong lVar5;
  undefined1 auStack_138 [32];
  undefined1 local_118 [112];
  undefined1 local_a8 [128];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_138;
  *(longlong *)(param_1 + 0x1028) = *(longlong *)(param_1 + 0x1028) + 1;
  FUN_1401d0bd0(local_118);
  uVar1 = FUN_1401d0c20(local_118,param_1 + 0xfe8,0x20);
  uVar2 = (ulonglong)uVar1;
  if (uVar1 == 0) {
    iVar4 = 0;
    do {
      if ((iVar4 != 0) && ((*(ulonglong *)(param_1 + 0x1028) >> ((char)iVar4 - 1U & 0x3f) & 1) != 0)
         ) break;
      lVar5 = (longlong)iVar4 * 0x70 + param_1;
      uVar1 = FUN_1401d0d00(lVar5,local_a8);
      if ((uVar1 != 0) ||
         ((uVar1 = FUN_1401d0c20(local_118,local_a8,0x20), uVar1 != 0 ||
          (uVar1 = FUN_1401d0bd0(lVar5), uVar1 != 0)))) {
        FUN_1401d0d00(local_118,local_a8);
        return (ulonglong)uVar1;
      }
      iVar4 = iVar4 + 1;
    } while (iVar4 < 0x20);
    uVar2 = FUN_1401d0d00(local_118,param_1 + 0xfe8);
    if (((int)uVar2 == 0) &&
       (uVar2 = FUN_1401cde30(param_1 + 0xfe8,0x20,0,param_1 + 0xe00), (int)uVar2 == 0)) {
      pcVar3 = (char *)(param_1 + 0x1008);
      do {
        *pcVar3 = *pcVar3 + '\x01';
        if (*pcVar3 != '\0') break;
        pcVar3 = pcVar3 + 1;
      } while ((longlong)pcVar3 - (param_1 + 0x1008) < 0x10);
      *(undefined8 *)(param_1 + 0x101c) = 0;
      uVar2 = 0;
    }
  }
  else {
    FUN_1401d0d00(local_118,local_a8);
  }
  return uVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_1401c3c10(longlong param_1)

{
  int iVar1;
  int iVar2;
  ulonglong uVar3;
  longlong lVar4;
  undefined1 auStack_b8 [32];
  undefined1 local_98 [128];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_b8;
  if (param_1 == 0) {
    iVar1 = 0x10;
  }
  else {
    uVar3 = 0;
    do {
      iVar2 = (int)uVar3;
      iVar1 = FUN_1401d0bd0((longlong)iVar2 * 0x70 + param_1);
      if (iVar1 != 0) {
        if (iVar2 < 1) {
          return iVar1;
        }
        do {
          FUN_1401d0d00(param_1,local_98);
          param_1 = param_1 + 0x70;
          uVar3 = uVar3 - 1;
        } while (uVar3 != 0);
        return iVar1;
      }
      uVar3 = (ulonglong)(iVar2 + 1U);
    } while ((int)(iVar2 + 1U) < 0x20);
    lVar4 = 0x20;
    *(undefined8 *)(param_1 + 0x101c) = 0;
    *(undefined4 *)(param_1 + 0x1018) = 0;
    *(undefined8 *)(param_1 + 0x1028) = 0;
    FUN_1401d0ee0(param_1 + 0xfe8,0x20);
    iVar1 = FUN_1401cde30(param_1 + 0xfe8,0x20,0,param_1 + 0xe00);
    if (iVar1 == 0) {
      FUN_1401d0ee0(param_1 + 0x1008,0x10);
      InitializeCriticalSection((LPCRITICAL_SECTION)(param_1 + 0x1030));
      iVar1 = 0;
    }
    else {
      do {
        FUN_1401d0d00(param_1,local_98);
        param_1 = param_1 + 0x70;
        lVar4 = lVar4 + -1;
      } while (lVar4 != 0);
    }
  }
  return iVar1;
}



int FUN_1401c3d60(longlong param_1,uint param_2,longlong param_3)

{
  int iVar1;
  undefined1 local_res8;
  undefined1 local_res9;
  
  if ((param_1 != 0) && (param_3 != 0)) {
    EnterCriticalSection((LPCRITICAL_SECTION)(param_3 + 0x1030));
    if (0x20 < param_2) {
      LeaveCriticalSection((LPCRITICAL_SECTION)(param_3 + 0x1030));
      return 0x10;
    }
    local_res8 = 0;
    local_res9 = (char)param_2;
    iVar1 = FUN_1401d0c20((ulonglong)*(uint *)(param_3 + 0x1018) * 0x70 + param_3,&local_res8,2);
    if (iVar1 == 0) {
      iVar1 = FUN_1401d0c20((ulonglong)*(uint *)(param_3 + 0x1018) * 0x70 + param_3,param_1,param_2)
      ;
      if (iVar1 == 0) {
        if (*(int *)(param_3 + 0x1018) == 0) {
          *(int *)(param_3 + 0x101c) = *(int *)(param_3 + 0x101c) + param_2;
        }
        iVar1 = *(int *)(param_3 + 0x1018) + 1;
        if (iVar1 == 0x20) {
          iVar1 = 0;
        }
        *(int *)(param_3 + 0x1018) = iVar1;
        LeaveCriticalSection((LPCRITICAL_SECTION)(param_3 + 0x1030));
        iVar1 = 0;
      }
      else {
        LeaveCriticalSection((LPCRITICAL_SECTION)(param_3 + 0x1030));
      }
    }
    else {
      LeaveCriticalSection((LPCRITICAL_SECTION)(param_3 + 0x1030));
    }
    return iVar1;
  }
  return 0x10;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

uint FUN_1401c3e90(void *param_1,uint param_2,longlong param_3)

{
  int iVar1;
  char *pcVar2;
  ulonglong uVar3;
  char *pcVar4;
  ulonglong _Size;
  undefined1 auStack_78 [32];
  undefined1 local_58 [16];
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_78;
  _Size = (ulonglong)param_2;
  if ((param_1 == (void *)0x0) || (param_3 == 0)) {
    param_2 = 0x10;
  }
  else {
    EnterCriticalSection((LPCRITICAL_SECTION)(param_3 + 0x1030));
    *(int *)(param_3 + 0x1020) = *(int *)(param_3 + 0x1020) + 1;
    if (((*(int *)(param_3 + 0x1020) == 10) || (0x3f < *(uint *)(param_3 + 0x101c))) &&
       (iVar1 = FUN_1401c3a80(param_3), iVar1 != 0)) {
      LeaveCriticalSection((LPCRITICAL_SECTION)(param_3 + 0x1030));
      param_2 = 0;
    }
    else {
      if (0xf < param_2) {
        uVar3 = (ulonglong)(param_2 >> 4);
        do {
          FUN_1401ce5d0(param_3 + 0x1008,param_1,param_3 + 0xe00);
          param_1 = (void *)((longlong)param_1 + 0x10);
          _Size = (ulonglong)((int)_Size - 0x10);
          pcVar2 = (char *)(param_3 + 0x1008);
          do {
            *pcVar2 = *pcVar2 + '\x01';
            if (*pcVar2 != '\0') break;
            pcVar2 = pcVar2 + 1;
          } while ((longlong)pcVar2 - (param_3 + 0x1008) < 0x10);
          uVar3 = uVar3 - 1;
        } while (uVar3 != 0);
      }
      if ((int)_Size != 0) {
        pcVar2 = (char *)(param_3 + 0x1008);
        FUN_1401ce5d0(pcVar2,local_58,param_3 + 0xe00);
        memcpy(param_1,local_58,_Size);
        pcVar4 = pcVar2;
        do {
          *pcVar4 = *pcVar4 + '\x01';
          if (*pcVar4 != '\0') break;
          pcVar4 = pcVar4 + 1;
        } while ((longlong)pcVar4 - (longlong)pcVar2 < 0x10);
      }
      pcVar2 = (char *)(param_3 + 0x1008);
      FUN_1401ce5d0(pcVar2,param_3 + 0xfe8,param_3 + 0xe00);
      pcVar4 = pcVar2;
      do {
        *pcVar4 = *pcVar4 + '\x01';
        if (*pcVar4 != '\0') break;
        pcVar4 = pcVar4 + 1;
      } while ((longlong)pcVar4 - (longlong)pcVar2 < 0x10);
      FUN_1401ce5d0(pcVar2,param_3 + 0xff8,param_3 + 0xe00);
      pcVar4 = pcVar2;
      do {
        *pcVar4 = *pcVar4 + '\x01';
        if (*pcVar4 != '\0') break;
        pcVar4 = pcVar4 + 1;
      } while ((longlong)pcVar4 - (longlong)pcVar2 < 0x10);
      iVar1 = FUN_1401cde30(param_3 + 0xfe8,0x20,0,param_3 + 0xe00);
      if (iVar1 == 0) {
        LeaveCriticalSection((LPCRITICAL_SECTION)(param_3 + 0x1030));
      }
      else {
        LeaveCriticalSection((LPCRITICAL_SECTION)(param_3 + 0x1030));
        param_2 = 0;
      }
    }
  }
  return param_2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_1401c40a0(longlong param_1)

{
  int iVar1;
  int iVar2;
  undefined1 auStack_58 [32];
  undefined1 local_38 [32];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_58;
  if (param_1 == 0) {
    return 0x10;
  }
  EnterCriticalSection((LPCRITICAL_SECTION)(param_1 + 0x1030));
  iVar2 = 0;
  do {
    iVar1 = FUN_1401d0d00((longlong)iVar2 * 0x70 + param_1,local_38);
    if (iVar1 != 0) {
      LeaveCriticalSection((LPCRITICAL_SECTION)(param_1 + 0x1030));
      return iVar1;
    }
    iVar2 = iVar2 + 1;
  } while (iVar2 < 0x20);
  LeaveCriticalSection((LPCRITICAL_SECTION)(param_1 + 0x1030));
  return 0;
}



int FUN_1401c4160(longlong param_1,uint *param_2,void *param_3)

{
  LPCRITICAL_SECTION lpCriticalSection;
  int iVar1;
  void *_Dst;
  int iVar2;
  longlong lVar3;
  
  if (((param_1 == 0) || (param_2 == (uint *)0x0)) || (param_3 == (void *)0x0)) {
    return 0x10;
  }
  lpCriticalSection = (LPCRITICAL_SECTION)((longlong)param_3 + 0x1030);
  EnterCriticalSection(lpCriticalSection);
  if (*param_2 < 0x400) {
    LeaveCriticalSection(lpCriticalSection);
    *param_2 = 0x400;
    return 6;
  }
  _Dst = malloc(0x70);
  if (_Dst == (void *)0x0) {
    LeaveCriticalSection(lpCriticalSection);
    iVar1 = 0xd;
  }
  else {
    iVar2 = 0;
    do {
      memcpy(_Dst,param_3,0x70);
      lVar3 = iVar2 + param_1;
      iVar1 = FUN_1401d0d00(_Dst,lVar3);
      if (iVar1 != 0) goto LAB_1401c4282;
      iVar1 = FUN_1401d0bd0(_Dst);
      if (iVar1 != 0) goto LAB_1401c4282;
      iVar1 = FUN_1401d0c20(_Dst,lVar3,0x20);
      if (iVar1 != 0) goto LAB_1401c4282;
      iVar1 = FUN_1401d0d00(_Dst,lVar3);
      if (iVar1 != 0) goto LAB_1401c4282;
      iVar2 = iVar2 + 0x20;
      param_3 = (void *)((longlong)param_3 + 0x70);
    } while (iVar2 < 0x400);
    *param_2 = 0x400;
LAB_1401c4282:
    free(_Dst);
    LeaveCriticalSection(lpCriticalSection);
  }
  return iVar1;
}



undefined8 FUN_1401c42c0(longlong param_1,int param_2,longlong param_3)

{
  undefined8 uVar1;
  int iVar2;
  
  if (((param_1 != 0) && (param_3 != 0)) && (param_2 == 0x400)) {
    uVar1 = FUN_1401c3c10(param_3);
    if ((int)uVar1 == 0) {
      iVar2 = 0;
      do {
        uVar1 = FUN_1401c3d60(iVar2 + param_1,0x20,param_3);
        if ((int)uVar1 != 0) {
          return uVar1;
        }
        iVar2 = iVar2 + 0x20;
      } while (iVar2 < 0x400);
    }
    return uVar1;
  }
  return 0x10;
}



void FUN_1401c4350(longlong param_1)

{
  if (param_1 != 0) {
    FUN_1401d0f90(*(undefined8 *)(param_1 + 8),*(undefined8 *)(param_1 + 0x10),
                  *(undefined8 *)(param_1 + 0x18),*(undefined8 *)(param_1 + 0x40),
                  *(undefined8 *)(param_1 + 0x38),*(undefined8 *)(param_1 + 0x30),
                  *(undefined8 *)(param_1 + 0x20),*(undefined8 *)(param_1 + 0x28),0);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1401c43a0(longlong param_1,undefined4 param_2,undefined4 *param_3)

{
  int iVar1;
  ulonglong uVar2;
  byte *_Memory;
  byte bVar3;
  undefined8 *puVar4;
  uint uVar5;
  int iVar6;
  byte *pbVar7;
  byte *pbVar8;
  undefined1 auStack_2a8 [32];
  undefined8 *local_288;
  undefined8 *local_280;
  undefined8 *local_278;
  undefined8 *local_270;
  undefined8 local_268;
  undefined8 local_260;
  undefined8 local_258;
  undefined4 local_250;
  undefined4 local_248;
  undefined8 local_240;
  undefined4 local_238;
  undefined4 local_230;
  undefined8 local_228;
  undefined4 local_220;
  undefined4 local_218;
  undefined8 local_210;
  undefined4 local_208;
  undefined4 local_200;
  undefined8 local_1f8;
  undefined4 local_1f0;
  undefined4 local_1e8;
  undefined8 local_1e0;
  undefined4 local_1d8;
  undefined4 local_1d0;
  undefined8 local_1c8;
  undefined8 local_1c0;
  undefined8 local_1b8;
  undefined8 local_1b0;
  undefined8 *local_1a8;
  undefined8 local_1a0;
  undefined8 *local_198;
  undefined8 *local_190;
  undefined8 *local_188;
  undefined8 *local_180;
  undefined8 *local_178;
  undefined4 local_168 [2];
  undefined4 *local_160;
  undefined8 local_158;
  undefined4 local_130;
  byte *local_128;
  undefined8 local_120;
  undefined4 local_f8 [2];
  undefined1 *local_f0;
  undefined8 local_e8;
  undefined4 local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined1 local_88 [64];
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_2a8;
  if (((param_1 == 0) || (param_3 == (undefined4 *)0x0)) || (DAT_140321080 == 0)) {
    uVar2 = 0x10;
  }
  else {
    local_278 = (undefined8 *)(param_3 + 8);
    local_280 = (undefined8 *)(param_3 + 0xc);
    local_270 = (undefined8 *)(param_3 + 10);
    local_288 = (undefined8 *)(param_3 + 0xe);
    local_190 = (undefined8 *)(param_3 + 4);
    local_178 = (undefined8 *)(param_3 + 0x10);
    local_268 = 0;
    local_1a8 = local_270;
    local_198 = local_288;
    local_188 = local_280;
    local_180 = local_278;
    uVar2 = FUN_1401d0f00(param_3 + 2,local_190,param_3 + 6);
    if ((int)uVar2 == 0) {
      _Memory = calloc(1,0x8000);
      if (_Memory == (byte *)0x0) {
        uVar5 = 0xd;
        puVar4 = local_1a8;
      }
      else {
        local_f0 = local_88;
        local_b8 = 0;
        local_b0 = 0;
        local_160 = local_f8;
        local_f8[0] = 7;
        local_e8 = 0x10;
        local_c0 = 6;
        local_168[0] = 0xd;
        local_158 = 2;
        local_130 = 4;
        local_120 = 0x8000;
        local_288 = (undefined8 *)CONCAT44(local_288._4_4_,1);
        local_128 = _Memory;
        iVar1 = FUN_1401d1120(param_1,param_2,local_168);
        if (iVar1 == 0) {
          uVar5 = 0;
          iVar1 = 0;
          bVar3 = 0;
          iVar6 = 0;
          pbVar7 = _Memory;
          pbVar8 = _Memory;
          if ((uint)local_120 != 0) {
            do {
              iVar1 = iVar1 + 1;
              bVar3 = bVar3 * '\x02' | *pbVar7;
              if (iVar1 == 8) {
                *pbVar8 = bVar3;
                pbVar8 = pbVar8 + 1;
                bVar3 = 0;
                iVar6 = iVar6 + 1;
                iVar1 = 0;
              }
              uVar5 = uVar5 + 1;
              pbVar7 = pbVar7 + 1;
            } while (uVar5 < (uint)local_120);
          }
          local_270 = *(undefined8 **)(param_3 + 2);
          local_258 = 0;
          local_260 = 0;
          local_268 = 0;
          local_288 = *(undefined8 **)(param_3 + 6);
          local_278 = (undefined8 *)CONCAT44(local_278._4_4_,1);
          local_280 = (undefined8 *)CONCAT44(local_280._4_4_,2);
          uVar5 = FUN_1401d0fe0(_Memory,iVar6,2);
          if (uVar5 == 0) {
            free(_Memory);
            *param_3 = 0;
            return 0;
          }
          free(_Memory);
          puVar4 = local_1a8;
        }
        else {
          free(_Memory);
          local_288 = *(undefined8 **)(param_3 + 6);
          local_270 = (undefined8 *)0x0;
          local_278 = (undefined8 *)0x0;
          local_280 = (undefined8 *)0x0;
          uVar5 = FUN_1401d0fe0(param_1,param_2,2,1);
          puVar4 = local_1a8;
          if (uVar5 == 0) {
            iVar1 = (*DAT_1403210e0)(*(undefined8 *)(param_3 + 6),0);
            if (iVar1 == 0) {
              uVar5 = (*DAT_140321090)(&local_1a0);
              puVar4 = local_1a8;
              if (uVar5 == 0) {
                local_1c8 = *(undefined8 *)(param_3 + 0xc);
                local_1b0 = 0;
                local_1b8 = 0;
                local_1c0 = 0;
                local_1e0 = *(undefined8 *)(param_3 + 0x10);
                local_1d0 = 1;
                local_1d8 = 2;
                local_1f8 = *(undefined8 *)(param_3 + 0xe);
                local_1e8 = 1;
                local_1f0 = 2;
                local_210 = *(undefined8 *)(param_3 + 10);
                local_200 = 1;
                local_208 = 2;
                local_228 = *(undefined8 *)(param_3 + 8);
                local_218 = 1;
                local_220 = 2;
                local_240 = *(undefined8 *)(param_3 + 4);
                local_230 = 1;
                local_238 = 2;
                local_258 = *(undefined8 *)(param_3 + 2);
                local_248 = 1;
                local_250 = 2;
                local_270 = *(undefined8 **)(param_3 + 6);
                local_260 = CONCAT44(local_260._4_4_,1);
                local_268 = CONCAT44(local_268._4_4_,2);
                local_278 = (undefined8 *)CONCAT44(local_278._4_4_,1);
                local_280 = (undefined8 *)CONCAT44(local_280._4_4_,2);
                local_288 = (undefined8 *)local_1a0;
                uVar5 = FUN_1401d0fe0(param_1,param_2,2,1);
                if (uVar5 == 0) {
                  (*DAT_1403210a0)(local_1a0);
                  *param_3 = 1;
                  return 0;
                }
                (*DAT_1403210a0)();
                puVar4 = (undefined8 *)(param_3 + 10);
              }
            }
            else {
              iVar1 = (*DAT_1403210e0)(*(undefined8 *)(param_3 + 6),1);
              if (iVar1 == 0) {
                uVar5 = 0x12;
                puVar4 = local_1a8;
              }
              else {
                local_270 = *(undefined8 **)(param_3 + 2);
                local_258 = 0;
                local_260 = 0;
                local_268 = 0;
                local_288 = *(undefined8 **)(param_3 + 6);
                local_278 = (undefined8 *)CONCAT44(local_278._4_4_,1);
                local_280 = (undefined8 *)CONCAT44(local_280._4_4_,2);
                uVar2 = FUN_1401d0fe0(param_1,param_2,2);
                uVar5 = (uint)uVar2;
                puVar4 = local_1a8;
                if (uVar5 == 0) {
                  *param_3 = 0;
                  return uVar2;
                }
              }
            }
          }
        }
      }
      local_270 = (undefined8 *)*puVar4;
      local_268 = 0;
      local_278 = (undefined8 *)*local_180;
      local_280 = (undefined8 *)*local_188;
      local_288 = (undefined8 *)*local_198;
      FUN_1401d0f90(*local_190,*(undefined8 *)(param_3 + 2),*(undefined8 *)(param_3 + 6),*local_178)
      ;
      uVar2 = (ulonglong)uVar5;
    }
  }
  return uVar2;
}



undefined8 FUN_1401c4880(longlong param_1,longlong param_2,int param_3,int *param_4)

{
  undefined8 uVar1;
  undefined4 local_res8 [8];
  
  local_res8[0] = 0;
  if (((param_1 != 0) && (param_2 != 0)) && (param_4 != (int *)0x0)) {
    if (*param_4 == 1) {
      if (param_3 == 1) {
        uVar1 = FUN_1401d1660(param_1,param_2,3,1,local_res8,2,1,*(undefined8 *)(param_4 + 6),2,1,
                              *(undefined8 *)(param_4 + 2),2,1,*(undefined8 *)(param_4 + 4),2,1,
                              *(undefined8 *)(param_4 + 8),2,1,*(undefined8 *)(param_4 + 10),2,1,
                              *(undefined8 *)(param_4 + 0xe),2,1,*(undefined8 *)(param_4 + 0x10),2,1
                              ,*(undefined8 *)(param_4 + 0xc),0,0,0);
        return uVar1;
      }
    }
    else if (param_3 == 1) {
      return 0x12;
    }
    uVar1 = FUN_1401d1660(param_1,param_2,2,1,*(undefined8 *)(param_4 + 6),2,1,
                          *(undefined8 *)(param_4 + 2),0,0,0);
    return uVar1;
  }
  return 0x10;
}



ulonglong FUN_1401c4a30(undefined8 param_1,undefined4 param_2,int param_3,uint param_4,
                       undefined4 *param_5)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  uint uVar3;
  int iVar4;
  ulonglong uVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  undefined8 uVar8;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38 [2];
  
  if (DAT_140321080 == 0) {
    return 0x10;
  }
  if (param_5 == (undefined4 *)0x0) {
    return 0x10;
  }
  if (0x180 < param_3 - 0x80U) {
    return 3;
  }
  if ((int)param_4 < 3) {
    return 0x10;
  }
  if ((param_4 & 1) == 0) {
    return 0x10;
  }
  uVar5 = FUN_1401cbff0(param_2);
  if ((int)uVar5 != 0) {
    return uVar5;
  }
  uVar5 = FUN_1401d0f00(&local_48,&local_40,&local_58,&local_50,local_38,0);
  if ((int)uVar5 != 0) {
    return uVar5;
  }
  uVar3 = (*DAT_1403210b8)(local_38[0],param_4);
  uVar5 = (ulonglong)uVar3;
  if (uVar3 == 0) {
    do {
      uVar3 = FUN_1401d17c0(local_48,param_3 / 2,param_1,param_2);
      uVar5 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1401c4d62;
      uVar3 = (*DAT_140321140)(local_48,1,local_58);
      uVar5 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1401c4d62;
      uVar3 = (*DAT_140321178)(local_58,local_38[0],local_50);
      uVar5 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1401c4d62;
      iVar4 = (*DAT_1403210e0)(local_50,1);
    } while (iVar4 != 0);
    do {
      uVar3 = FUN_1401d17c0(local_40,param_3 / 2,param_1,param_2);
      uVar5 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1401c4d62;
      uVar3 = (*DAT_140321140)(local_40,1,local_58);
      uVar5 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1401c4d62;
      uVar3 = (*DAT_140321178)(local_58,local_38[0],local_50);
      uVar5 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1401c4d62;
      iVar4 = (*DAT_1403210e0)(local_50,1);
    } while (iVar4 != 0);
    uVar3 = (*DAT_140321140)(local_48,1,local_50);
    uVar5 = (ulonglong)uVar3;
    if (uVar3 == 0) {
      uVar3 = (*DAT_140321180)(local_58,local_50,local_58);
      uVar5 = (ulonglong)uVar3;
      if (uVar3 == 0) {
        uVar8 = 0;
        puVar1 = (undefined8 *)(param_5 + 10);
        puVar2 = (undefined8 *)(param_5 + 8);
        puVar6 = puVar2;
        puVar7 = puVar1;
        uVar3 = FUN_1401d0f00(param_5 + 2,param_5 + 4,param_5 + 6,param_5 + 0x10,param_5 + 0xe,
                              param_5 + 0xc,puVar2,puVar1,0);
        uVar5 = (ulonglong)uVar3;
        if (uVar3 == 0) {
          uVar3 = (*DAT_1403210b8)(*(undefined8 *)(param_5 + 2),param_4);
          uVar5 = (ulonglong)uVar3;
          if (uVar3 == 0) {
            uVar3 = (*DAT_140321198)(*(undefined8 *)(param_5 + 2),local_58,
                                     *(undefined8 *)(param_5 + 4));
            uVar5 = (ulonglong)uVar3;
            if (uVar3 == 0) {
              uVar3 = (*DAT_140321148)(local_48,local_40,*(undefined8 *)(param_5 + 6));
              uVar5 = (ulonglong)uVar3;
              if (uVar3 == 0) {
                uVar3 = (*DAT_140321140)(local_48,1,local_58);
                uVar5 = (ulonglong)uVar3;
                if (uVar3 == 0) {
                  uVar3 = (*DAT_140321140)(local_40,1,local_50);
                  uVar5 = (ulonglong)uVar3;
                  if (uVar3 == 0) {
                    uVar3 = (*DAT_140321160)(*(undefined8 *)(param_5 + 4),local_58,0,
                                             *(undefined8 *)(param_5 + 0xe));
                    uVar5 = (ulonglong)uVar3;
                    if (uVar3 == 0) {
                      uVar3 = (*DAT_140321160)(*(undefined8 *)(param_5 + 4),local_50,0,
                                               *(undefined8 *)(param_5 + 0x10));
                      uVar5 = (ulonglong)uVar3;
                      if (uVar3 == 0) {
                        uVar3 = (*DAT_140321198)(local_40,local_48,*(undefined8 *)(param_5 + 0xc));
                        uVar5 = (ulonglong)uVar3;
                        if (uVar3 == 0) {
                          uVar3 = (*DAT_1403210b0)(local_48,*puVar2);
                          uVar5 = (ulonglong)uVar3;
                          if (uVar3 == 0) {
                            uVar3 = (*DAT_1403210b0)(local_40,*puVar1);
                            uVar5 = (ulonglong)uVar3;
                            if (uVar3 == 0) {
                              *param_5 = 1;
                              goto LAB_1401c4da4;
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
LAB_1401c4d62:
  puVar7 = *(undefined8 **)(param_5 + 10);
  uVar8 = 0;
  puVar6 = *(undefined8 **)(param_5 + 8);
  FUN_1401d0f90(*(undefined8 *)(param_5 + 4),*(undefined8 *)(param_5 + 2),
                *(undefined8 *)(param_5 + 6),*(undefined8 *)(param_5 + 0x10),
                *(undefined8 *)(param_5 + 0xe),*(undefined8 *)(param_5 + 0xc),puVar6,puVar7,0);
LAB_1401c4da4:
  FUN_1401d0f90(local_38[0],local_50,local_58,local_48,local_40,0,puVar6,puVar7,uVar8);
  return uVar5;
}



undefined8
FUN_1401c4e10(longlong param_1,undefined4 param_2,longlong param_3,uint *param_4,undefined8 param_5,
             undefined4 param_6,ulonglong param_7,undefined4 param_8,undefined4 param_9,int param_10
             ,longlong param_11)

{
  undefined4 uVar1;
  uint uVar2;
  int iVar3;
  undefined8 uVar4;
  uint local_res8 [2];
  undefined4 local_res10;
  undefined8 in_stack_ffffffffffffff98;
  undefined4 uVar6;
  ulonglong uVar5;
  undefined8 in_stack_ffffffffffffffa0;
  undefined4 uVar7;
  undefined8 in_stack_ffffffffffffffa8;
  undefined4 uVar8;
  undefined8 in_stack_ffffffffffffffb0;
  undefined4 uVar9;
  
  uVar7 = (undefined4)((ulonglong)in_stack_ffffffffffffffa0 >> 0x20);
  uVar6 = (undefined4)((ulonglong)in_stack_ffffffffffffff98 >> 0x20);
  uVar8 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);
  uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffffb0 >> 0x20);
  if (((param_1 != 0) && (param_3 != 0)) && (param_4 != (uint *)0x0)) {
    if (param_11 != 0) {
      if ((param_10 == 1) || (param_10 == 2)) {
        local_res10 = param_2;
        uVar4 = FUN_1401cbff0(param_8);
        if (((int)uVar4 == 0) &&
           ((param_10 != 2 || (uVar4 = FUN_1401d1e80(param_9), (int)uVar4 == 0)))) {
          uVar1 = (*DAT_1403210e8)(*(undefined8 *)(param_11 + 0x18));
          uVar2 = (*DAT_140321110)(*(undefined8 *)(param_11 + 0x18));
          local_res8[0] = *param_4;
          if (local_res8[0] < uVar2) {
            *param_4 = uVar2;
            uVar4 = 6;
          }
          else {
            if (param_10 == 2) {
              uVar5 = CONCAT44(uVar6,uVar1);
              uVar4 = FUN_1401d1af0(param_1,local_res10,param_5,param_6,uVar5,param_7,
                                    CONCAT44(uVar8,param_8),CONCAT44(uVar9,param_9),param_3,
                                    local_res8);
              iVar3 = (int)uVar4;
            }
            else {
              uVar4 = FUN_1401d1920(param_1,local_res10,2,uVar1,param_7,CONCAT44(uVar7,param_8),
                                    param_3,local_res8);
              iVar3 = (int)uVar4;
              uVar5 = param_7;
            }
            if (iVar3 == 0) {
              uVar4 = (*DAT_140321200)(param_3,local_res8[0],param_3,param_4,
                                       uVar5 & 0xffffffff00000000,param_11);
            }
          }
        }
      }
      else {
        uVar4 = 0x18;
      }
      return uVar4;
    }
    return 0x10;
  }
  return 0x10;
}



ulonglong FUN_1401c4fd0(undefined8 param_1,uint param_2,longlong param_3,longlong param_4,
                       undefined8 param_5,undefined4 param_6,undefined4 param_7,int param_8,
                       undefined4 *param_9,longlong param_10)

{
  undefined4 uVar1;
  uint uVar2;
  ulonglong uVar3;
  void *_Memory;
  uint local_res18 [2];
  undefined8 in_stack_ffffffffffffff98;
  undefined4 uVar4;
  
  uVar4 = (undefined4)((ulonglong)in_stack_ffffffffffffff98 >> 0x20);
  if ((param_3 == 0) || (param_4 == 0)) {
    return 0x10;
  }
  if (param_10 == 0) {
    return 0x10;
  }
  if (param_9 != (undefined4 *)0x0) {
    *param_9 = 0;
    if (param_8 != 1) {
      if (param_8 != 2) {
        return 0x18;
      }
      uVar3 = FUN_1401d1e80(param_7);
      if ((int)uVar3 != 0) {
        return uVar3;
      }
    }
    uVar1 = (*DAT_1403210e8)(*(undefined8 *)(param_10 + 0x18));
    uVar2 = (*DAT_140321110)(*(undefined8 *)(param_10 + 0x18));
    if (uVar2 == param_2) {
      _Memory = malloc((ulonglong)param_2);
      if (_Memory == (void *)0x0) {
        uVar3 = 0xd;
      }
      else {
        local_res18[0] = param_2;
        uVar2 = (*DAT_140321200)(param_1,param_2,_Memory,local_res18,CONCAT44(uVar4,1),param_10);
        uVar3 = (ulonglong)uVar2;
        if (uVar2 == 0) {
          if (param_8 == 2) {
            uVar2 = FUN_1401d2010(_Memory,local_res18[0],param_5,param_6,uVar1,param_7,param_3,
                                  param_4,param_9);
          }
          else {
            uVar2 = FUN_1401d1ee0(_Memory,local_res18[0],2,uVar1,param_3,param_4,param_9);
          }
          uVar3 = (ulonglong)uVar2;
          free(_Memory);
        }
        else {
          free(_Memory);
        }
      }
    }
    else {
      uVar3 = 7;
    }
    return uVar3;
  }
  return 0x10;
}



undefined4 * FUN_1401c51b0(undefined4 *param_1)

{
  FUN_1401529c0(param_1 + 2);
  *param_1 = 0;
  return param_1;
}



void FUN_1401c51e0(longlong param_1)

{
  *(undefined1 *)(param_1 + 0x30) = 0;
  return;
}



void FUN_1401c51f0(longlong param_1)

{
  FUN_1400ad790(param_1 + 0x388);
  return;
}



void FUN_1401c5240(longlong param_1)

{
  char cVar1;
  undefined8 uVar2;
  
  if (((*(char *)(param_1 + 0x30) == '\0') && (*(longlong **)(param_1 + 0x18) != (longlong *)0x0))
     && (**(longlong **)(param_1 + 0x18) != 0)) {
    cVar1 = FUN_1400a8b50();
    if (cVar1 == '\0') {
      *(undefined1 *)(param_1 + 0x30) = 1;
      *(undefined4 *)(param_1 + 0x34) = 0;
      uVar2 = FUN_1400ad790(param_1 + 0x388);
      *(undefined4 *)(param_1 + 0x38) = 0;
      *(undefined8 *)(param_1 + 0x28) = uVar2;
    }
  }
  return;
}



void FUN_1401c52a0(longlong param_1)

{
  FUN_1400a1c30(param_1 + 0x310);
  if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) && (**(longlong **)(param_1 + 0x18) != 0))
  {
    FUN_1400a88b0();
  }
  if ((*(longlong **)(param_1 + 0x20) != (longlong *)0x0) && (**(longlong **)(param_1 + 0x20) != 0))
  {
    FUN_1400a88b0();
  }
  FUN_1400d1290(param_1 + 0x310);
  return;
}



void FUN_1401c5310(longlong param_1)

{
  int iVar1;
  undefined8 uVar2;
  undefined **local_18;
  undefined4 local_10;
  undefined2 local_c;
  
  *(undefined1 *)(param_1 + 0x2c0) = 1;
  local_18 = Proud::AddrPort::vftable;
  local_10 = DAT_14031d590;
  local_c = DAT_14031d594;
  uVar2 = 0;
  if (*(undefined8 **)(param_1 + 0x18) != (undefined8 *)0x0) {
    uVar2 = **(undefined8 **)(param_1 + 0x18);
  }
  iVar1 = FUN_1400aa6f0(uVar2,&DAT_14031d330,600,&local_18);
  if (iVar1 != 0) {
    *(undefined1 *)(param_1 + 0x2c0) = 0;
    *(undefined1 *)(param_1 + 0x30) = 0;
  }
  return;
}



void FUN_1401c5380(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar3 = 0;
  lVar2 = lVar3;
  if (*(longlong **)(param_1 + 0x20) != (longlong *)0x0) {
    lVar2 = **(longlong **)(param_1 + 0x20);
  }
  if (*(char *)(lVar2 + 0x80) == '\0') {
    *(undefined1 *)(param_1 + 0x300) = 1;
    if (*(longlong **)(param_1 + 0x20) != (longlong *)0x0) {
      lVar3 = **(longlong **)(param_1 + 0x20);
    }
    iVar1 = FUN_1400a9850(lVar3,600);
    if (iVar1 != 0) {
      *(undefined1 *)(param_1 + 0x300) = 0;
      *(undefined1 *)(param_1 + 0x30) = 0;
    }
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401c53e0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  bool bVar2;
  double dVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  longlong lVar6;
  
  uVar5 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x310;
  lVar6 = lVar1;
  FUN_1400a1c30(lVar1);
  bVar2 = true;
  if (*(char *)(param_1 + 0x30) != '\0') {
    *(int *)(param_1 + 0x34) = *(int *)(param_1 + 0x34) + 1;
    if (*(int *)(param_1 + 0x34) == 1) {
      FUN_1401c5310(param_1);
      FUN_1401c5380(param_1);
    }
    else {
      dVar3 = (double)FUN_1400ad790(param_1 + 0x388);
      if ((_DAT_1402f8160 < dVar3 - *(double *)(param_1 + 0x28)) ||
         (*(char *)(param_1 + 0x48) != '\0')) {
        uVar4 = FUN_1401c51f0(param_1);
        *(undefined8 *)(param_1 + 0x40) = uVar4;
        *(undefined1 *)(param_1 + 0x48) = 0;
        *(undefined1 *)(param_1 + 0x30) = 0;
        FUN_1400d1290(lVar1);
        bVar2 = false;
        (**(code **)(**(longlong **)(param_1 + 0x3b0) + 0x10))
                  (*(longlong **)(param_1 + 0x3b0),uVar4,param_3,param_4,uVar5,lVar6,0);
      }
    }
  }
  if (bVar2) {
    FUN_1400d1290(lVar1);
  }
  return;
}



void FUN_1401c54c0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  longlong lVar3;
  undefined8 uVar4;
  undefined8 local_40;
  undefined8 local_38;
  int local_30;
  undefined8 local_28;
  undefined4 local_20;
  undefined **local_18;
  undefined4 local_10;
  undefined2 local_c;
  
  uVar4 = 0xfffffffffffffffe;
  if (*(char *)(param_1 + 0x380) != '\0') {
    do {
      FUN_1401c53e0(param_1);
      local_18 = Proud::AddrPort::vftable;
      local_40 = 0;
      local_28 = 0;
      local_38 = 0;
      local_30 = 5;
      local_20 = 0;
      local_10 = DAT_1402f83d0;
      local_c = DAT_1402f83d4;
      cVar1 = FUN_1400abce0(*(undefined8 *)(param_1 + 0x308),&local_40,10,param_4,uVar4);
      if (cVar1 != '\0') {
        FUN_1400a1c30(param_1 + 0x310);
        if ((int)local_38 < 1) {
          *(undefined1 *)(param_1 + 0x48) = 1;
        }
        if (local_30 == 1) {
          if (*(char *)(param_1 + 0x30) == '\0') {
            *(undefined1 *)(param_1 + 0x2c0) = 0;
          }
          else if (0 < (int)local_38) {
            *(int *)(param_1 + 0x38) = *(int *)(param_1 + 0x38) + (int)local_38;
            FUN_1401c5310(param_1);
            goto LAB_1401c55ab;
          }
        }
        else {
LAB_1401c55ab:
          if (local_30 == 2) {
            if (*(char *)(param_1 + 0x30) == '\0') {
LAB_1401c560a:
              *(undefined1 *)(param_1 + 0x300) = 0;
            }
            else {
              lVar3 = 0;
              if (*(longlong **)(param_1 + 0x20) != (longlong *)0x0) {
                lVar3 = **(longlong **)(param_1 + 0x20);
              }
              if (*(char *)(lVar3 + 0x80) == '\0') {
                *(undefined1 *)(param_1 + 0x300) = 1;
                lVar3 = 0;
                if (*(longlong **)(param_1 + 0x20) != (longlong *)0x0) {
                  lVar3 = **(longlong **)(param_1 + 0x20);
                }
                iVar2 = FUN_1400a9850(lVar3,600);
                if (iVar2 != 0) {
                  *(undefined1 *)(param_1 + 0x30) = 0;
                  goto LAB_1401c560a;
                }
              }
            }
          }
        }
        FUN_1400d1290(param_1 + 0x310);
      }
    } while (*(char *)(param_1 + 0x380) != '\0');
  }
  return;
}



void FUN_1401c5650(undefined8 param_1)

{
  DWORD DVar1;
  
  DVar1 = GetCurrentThreadId();
  FUN_1400aaed0(DVar1,"PNSendSpeedMeasurer");
  FUN_1401c54c0(param_1);
  return;
}



undefined8 *
FUN_1401c5680(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  void *pvVar2;
  longlong *plVar3;
  undefined4 uVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *local_res10;
  longlong *local_res18;
  longlong *local_res20;
  undefined8 uVar7;
  
  uVar7 = 0xfffffffffffffffe;
  *param_1 = Proud::CSendSpeedMeasurer::vftable;
  param_1[1] = Proud::CSendSpeedMeasurer::vftable;
  param_1[2] = Proud::CSendSpeedMeasurer::vftable;
  lVar6 = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[0x61] = 0;
  uVar4 = FUN_1401692e0();
  FUN_1400a1b50(param_1 + 0x62,uVar4,1,param_4,uVar7);
  param_1[0x69] = 0;
  FUN_1400ad6b0(param_1 + 0x71);
  local_res10 = operator_new(0xa8);
  lVar5 = lVar6;
  if (local_res10 != (longlong *)0x0) {
    lVar5 = FUN_1400aca10(local_res10,param_1 + 1,1);
  }
  param_1[0x61] = lVar5;
  *(undefined1 *)(param_1 + 9) = 0;
  param_1[0x76] = param_2;
  *(undefined1 *)(param_1 + 0x70) = 1;
  *(undefined1 *)(param_1 + 0x58) = 0;
  *(undefined1 *)(param_1 + 0x60) = 0;
  local_res10 = (longlong *)FUN_1400a34c0(0x400);
  lVar5 = lVar6;
  if (local_res10 != (longlong *)0x0) {
    lVar5 = FUN_1400a8db0(local_res10,1,param_1);
  }
  if (lVar5 == 0) {
    local_res10 = (longlong *)0x0;
  }
  else {
    local_res10 = (longlong *)FUN_1400a34c0(0x10);
    local_res10[1] = 1;
    *local_res10 = lVar5;
  }
  plVar1 = local_res10;
  FUN_1400a5190(param_1 + 3,&local_res10);
  plVar3 = local_res10;
  if (plVar1 != (longlong *)0x0) {
    plVar1 = plVar1 + 1;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      lVar5 = *local_res10;
      if (lVar5 != 0) {
        FUN_1400a8cc0(lVar5);
        FUN_1400a3530(lVar5);
      }
      FUN_1400a3530(plVar3);
    }
  }
  lVar5 = lVar6;
  if ((longlong *)param_1[3] != (longlong *)0x0) {
    lVar5 = *(longlong *)param_1[3];
  }
  FUN_1400aa930(lVar5);
  lVar5 = lVar6;
  if ((longlong *)param_1[3] != (longlong *)0x0) {
    lVar5 = *(longlong *)param_1[3];
  }
  FUN_1400a9e00(lVar5,0);
  lVar5 = lVar6;
  if ((longlong *)param_1[3] != (longlong *)0x0) {
    lVar5 = *(longlong *)param_1[3];
  }
  FUN_1400aa0b0(lVar5,4);
  local_res18 = (longlong *)FUN_1400a34c0(0x400);
  lVar5 = lVar6;
  if (local_res18 != (longlong *)0x0) {
    lVar5 = FUN_1400a8db0(local_res18,2,param_1);
  }
  if (lVar5 == 0) {
    local_res18 = (longlong *)0x0;
  }
  else {
    local_res18 = (longlong *)FUN_1400a34c0(0x10);
    local_res18[1] = 1;
    *local_res18 = lVar5;
  }
  plVar1 = local_res18;
  FUN_1400a5190(param_1 + 4,&local_res18);
  plVar3 = local_res18;
  if (plVar1 != (longlong *)0x0) {
    plVar1 = plVar1 + 1;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      lVar5 = *local_res18;
      if (lVar5 != 0) {
        FUN_1400a8cc0(lVar5);
        FUN_1400a3530(lVar5);
      }
      FUN_1400a3530(plVar3);
    }
  }
  lVar5 = lVar6;
  if ((longlong *)param_1[4] != (longlong *)0x0) {
    lVar5 = *(longlong *)param_1[4];
  }
  FUN_1400aa930(lVar5);
  lVar5 = lVar6;
  if ((longlong *)param_1[3] != (longlong *)0x0) {
    lVar5 = *(longlong *)param_1[3];
  }
  FUN_1400a7fb0(lVar5,param_1 + 2);
  lVar5 = lVar6;
  if ((longlong *)param_1[3] != (longlong *)0x0) {
    lVar5 = *(longlong *)param_1[3];
  }
  FUN_1400ace20(param_1[0x61],lVar5);
  lVar5 = lVar6;
  if ((longlong *)param_1[4] != (longlong *)0x0) {
    lVar5 = *(longlong *)param_1[4];
  }
  FUN_1400a7fb0(lVar5,param_1 + 2);
  lVar5 = lVar6;
  if ((longlong *)param_1[4] != (longlong *)0x0) {
    lVar5 = *(longlong *)param_1[4];
  }
  FUN_1400ace20(param_1[0x61],lVar5);
  param_1[5] = 0;
  *(undefined1 *)(param_1 + 6) = 0;
  param_1[8] = 0;
  FUN_1400ad700(param_1 + 0x71);
  local_res20 = operator_new(0x28);
  lVar5 = lVar6;
  if (local_res20 != (longlong *)0x0) {
    lVar5 = FUN_1400aa980(local_res20,FUN_1401c5650,param_1);
  }
  if (lVar5 == 0) {
    local_res20 = (longlong *)0x0;
  }
  else {
    local_res20 = (longlong *)FUN_1400a34c0(0x10);
    local_res20[1] = 1;
    *local_res20 = lVar5;
  }
  plVar1 = local_res20;
  FUN_14018b790(param_1 + 0x69,&local_res20);
  plVar3 = local_res20;
  if (plVar1 != (longlong *)0x0) {
    plVar1 = plVar1 + 1;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      pvVar2 = (void *)*local_res20;
      if (pvVar2 != (void *)0x0) {
        FUN_1400aaa90(pvVar2);
        operator_delete(pvVar2);
      }
      FUN_1400a3530(plVar3);
    }
  }
  if ((longlong *)param_1[0x69] != (longlong *)0x0) {
    lVar6 = *(longlong *)param_1[0x69];
  }
  FUN_1400aab80(lVar6);
  return param_1;
}



void FUN_1401c5a70(longlong param_1)

{
  FUN_1401c5d50(param_1 + -8);
  return;
}



void FUN_1401c5a80(longlong param_1)

{
  FUN_1401c5d50(param_1 + -0x10);
  return;
}



void FUN_1401c5a90(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined8 local_res8;
  undefined8 local_res10;
  undefined8 uVar3;
  longlong lVar4;
  
  uVar3 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x310;
  while( true ) {
    lVar4 = lVar1;
    FUN_1400a1c30(lVar1);
    if (DAT_1403142d0 != '\0') {
      FUN_1400d1290(lVar1);
      return;
    }
    if ((*(char *)(param_1 + 0x2c0) == '\0') && (*(char *)(param_1 + 0x300) == '\0')) break;
    FUN_1400d1290(lVar4);
    Sleep(10);
  }
  *(undefined1 *)(param_1 + 0x30) = 0;
  uVar2 = 0;
  local_res8 = 0;
  FUN_1400a5190(param_1 + 0x18,&local_res8,param_3,param_4,uVar3,lVar4,1);
  local_res10 = 0;
  FUN_1400a5190(param_1 + 0x20,&local_res10);
  FUN_1400d1290(lVar4);
  *(undefined1 *)(param_1 + 0x380) = 0;
  if (*(undefined8 **)(param_1 + 0x348) != (undefined8 *)0x0) {
    uVar2 = **(undefined8 **)(param_1 + 0x348);
  }
  FUN_1400aaa10(uVar2);
  return;
}



void FUN_1401c5b70(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  undefined8 *puVar2;
  longlong *plVar3;
  longlong lVar4;
  undefined8 local_res10;
  undefined8 local_res18 [2];
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  *param_1 = Proud::CSendSpeedMeasurer::vftable;
  param_1[1] = Proud::CSendSpeedMeasurer::vftable;
  param_1[2] = Proud::CSendSpeedMeasurer::vftable;
  FUN_1401c52a0();
  FUN_1401c5a90(param_1);
  local_res10 = 0;
  FUN_1400a5190(param_1 + 4,&local_res10,param_3,param_4,uVar5);
  local_res18[0] = 0;
  FUN_1400a5190(param_1 + 3,local_res18);
  pvVar1 = (void *)param_1[0x61];
  if (pvVar1 != (void *)0x0) {
    FUN_1400acbf0(pvVar1);
    operator_delete(pvVar1);
  }
  param_1[0x61] = 0;
  if ((param_1[0x69] != 0) &&
     (*(longlong *)(param_1[0x69] + 8) = *(longlong *)(param_1[0x69] + 8) + -1,
     *(longlong *)(param_1[0x69] + 8) == 0)) {
    puVar2 = (undefined8 *)param_1[0x69];
    pvVar1 = (void *)*puVar2;
    if (pvVar1 != (void *)0x0) {
      FUN_1400aaa90(pvVar1);
      operator_delete(pvVar1);
    }
    FUN_1400a3530(puVar2);
  }
  FUN_1400a1cd0(param_1 + 0x62);
  pvVar1 = (void *)param_1[0x61];
  if (pvVar1 != (void *)0x0) {
    FUN_1400acbf0(pvVar1);
    operator_delete(pvVar1);
  }
  if ((param_1[4] != 0) &&
     (*(longlong *)(param_1[4] + 8) = *(longlong *)(param_1[4] + 8) + -1,
     *(longlong *)(param_1[4] + 8) == 0)) {
    plVar3 = (longlong *)param_1[4];
    lVar4 = *plVar3;
    if (lVar4 != 0) {
      FUN_1400a8cc0(lVar4);
      FUN_1400a3530(lVar4);
    }
    FUN_1400a3530(plVar3);
  }
  if ((param_1[3] != 0) &&
     (*(longlong *)(param_1[3] + 8) = *(longlong *)(param_1[3] + 8) + -1,
     *(longlong *)(param_1[3] + 8) == 0)) {
    plVar3 = (longlong *)param_1[3];
    lVar4 = *plVar3;
    if (lVar4 != 0) {
      FUN_1400a8cc0(lVar4);
      FUN_1400a3530(lVar4);
    }
    FUN_1400a3530(plVar3);
  }
  param_1[2] = Proud::ICompletionContext::vftable;
  param_1[1] = Proud::ICompletionPortEventSink::vftable;
  *param_1 = Proud::IFastSocketDelegate::vftable;
  return;
}



void * FUN_1401c5d50(void *param_1,uint param_2)

{
  FUN_1401c5b70();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1401c5d80(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_1400a3530(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1401c5de0(longlong *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  longlong *plVar2;
  uint uVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  undefined8 uVar6;
  double dVar7;
  undefined **local_30;
  longlong *local_28;
  longlong local_20;
  undefined8 local_18;
  undefined8 local_10;
  
  plVar2 = (longlong *)
           (**(code **)(**(longlong **)*param_1 + 0x38))
                     (*(longlong **)*param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  uVar4 = 0;
  local_28 = (longlong *)0x0;
  local_20 = 0;
  local_18 = 0;
  local_10 = 0;
  local_30 = Proud::CUncompressedFrameNumberArray::vftable;
  if (plVar2 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  uVar5 = uVar4;
  if (*(ulonglong **)(param_2 + 0x20) != (ulonglong *)0x0) {
    uVar5 = **(ulonglong **)(param_2 + 0x20);
  }
  local_28 = plVar2;
  FUN_1401a83b0(uVar5,&local_30);
  if (0 < (int)local_18) {
    iVar1 = (int)local_18 + -1;
    if ((iVar1 < 0) || ((int)local_18 <= iVar1)) {
                    // WARNING: Subroutine does not return
      FUN_1400a2700();
    }
    *(undefined4 *)(*param_1 + 0xe4) = *(undefined4 *)(local_20 + (longlong)iVar1 * 4);
    uVar6 = (**(code **)(**(longlong **)*param_1 + 0x18))();
    *(undefined8 *)(*param_1 + 0xe8) = uVar6;
    *(int *)(*param_1 + 0x30) = *(int *)(*param_1 + 0x30) + 1;
  }
  FUN_1401be6b0(*param_1 + 8,*(undefined4 *)(param_2 + 0x34));
  *(undefined4 *)(*param_1 + 0xe0) = *(undefined4 *)(param_2 + 0x34);
  uVar5 = uVar4;
  if (0 < (int)local_18) {
    do {
      if (((longlong)uVar5 < 0) || ((int)local_18 <= (int)uVar4)) {
                    // WARNING: Subroutine does not return
        FUN_1400a2700();
      }
      FUN_1401be670(*param_1 + 8,*(undefined4 *)(local_20 + uVar5 * 4));
      uVar3 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar3;
      uVar5 = uVar5 + 1;
    } while ((int)uVar3 < (int)local_18);
  }
  dVar7 = (double)*(int *)(*param_1 + 0x14);
  *(int *)(*param_1 + 0x14) = (int)(((double)*(int *)(param_2 + 0x30) - dVar7) * 0.9 + dVar7) + 1;
  local_30 = Proud::CFastArray<>::vftable;
  if (local_20 != 0) {
    if (local_28 == (longlong *)0x0) {
      FUN_1400a3530(local_20);
    }
    else {
      (**(code **)(*local_28 + 0x18))();
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001401c6563)
// WARNING: Removing unreachable block (ram,0x0001401c656b)
// WARNING: Removing unreachable block (ram,0x0001401c656f)
// WARNING: Removing unreachable block (ram,0x0001401c6579)

void FUN_1401c5f80(longlong param_1,int param_2,int param_3)

{
  int *piVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  longlong *plVar6;
  void *pvVar7;
  ulonglong uVar8;
  int iVar9;
  longlong lVar10;
  ulonglong uVar11;
  int iVar12;
  longlong lVar13;
  longlong lVar14;
  int iVar15;
  int local_res10 [2];
  int local_res18 [2];
  char *local_res20;
  longlong *local_128;
  void *local_120;
  ulonglong local_118;
  longlong local_110;
  longlong local_108;
  longlong *local_f8;
  undefined **local_f0 [3];
  undefined **local_d8 [3];
  undefined **local_c0 [3];
  undefined8 local_a8;
  undefined **local_a0 [3];
  undefined **local_88 [3];
  undefined1 local_70 [24];
  undefined1 local_58 [32];
  
  local_a8 = 0xfffffffffffffffe;
  if (1 < param_2 - param_3) {
    std::_Container_base12::_Container_base12((_Container_base12 *)&local_128);
    local_128 = operator_new(0x10);
    if (local_128 == (longlong *)0x0) {
      local_f8 = local_128;
      std::exception::exception((exception *)local_d8,(char **)&local_f8);
      local_d8[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_d8,(ThrowInfo *)&DAT_1402f47a8);
    }
    *local_128 = 0;
    local_128[1] = 0;
    *local_128 = (longlong)&local_128;
    local_120 = (void *)0x0;
    local_118 = 0;
    local_110 = 0;
    local_108 = 0;
    local_res18[0] = param_2 + -1;
    local_res10[0] = param_3;
    FUN_140149690(&local_128,local_res10);
    FUN_140149690(&local_128,local_res18);
    lVar10 = local_108;
    while (lVar14 = 0, uVar8 = local_118, lVar10 != 0) {
      uVar5 = FUN_1401467b0(&local_128,local_70);
      plVar6 = (longlong *)FUN_140149780(uVar5,local_58,1);
      lVar13 = lVar14;
      if ((longlong *)*plVar6 != (longlong *)0x0) {
        lVar13 = *(longlong *)*plVar6;
      }
      uVar8 = (ulonglong)plVar6[2] >> 2;
      if (*(ulonglong *)(lVar13 + 0x10) <= uVar8) {
        uVar8 = uVar8 - *(ulonglong *)(lVar13 + 0x10);
      }
      iVar15 = *(int *)(*(longlong *)(*(longlong *)(lVar13 + 8) + uVar8 * 8) +
                       (ulonglong)((uint)plVar6[2] & 3) * 4);
      if ((lVar10 != 0) && (lVar10 = lVar10 + -1, local_108 = lVar10, lVar10 == 0)) {
        local_110 = lVar14;
      }
      local_res10[0] = iVar15;
      uVar5 = FUN_1401467b0(&local_128,local_58);
      plVar6 = (longlong *)FUN_140149780(uVar5,local_70,1);
      lVar13 = lVar14;
      if ((longlong *)*plVar6 != (longlong *)0x0) {
        lVar13 = *(longlong *)*plVar6;
      }
      uVar8 = (ulonglong)plVar6[2] >> 2;
      if (*(ulonglong *)(lVar13 + 0x10) <= uVar8) {
        uVar8 = uVar8 - *(ulonglong *)(lVar13 + 0x10);
      }
      iVar2 = *(int *)(*(longlong *)(*(longlong *)(lVar13 + 8) + uVar8 * 8) +
                      (ulonglong)((uint)plVar6[2] & 3) * 4);
      lVar13 = (longlong)iVar2;
      if ((lVar10 != 0) && (lVar10 = lVar10 + -1, local_108 = lVar10, lVar10 == 0)) {
        local_110 = lVar14;
      }
      iVar12 = iVar2 + 1;
      iVar3 = *(int *)(param_1 + lVar13 * 4);
      if (iVar12 <= iVar15) {
        iVar9 = iVar15;
        if ((iVar12 < iVar15) && (lVar10 = local_108, iVar12 <= iVar15)) {
LAB_1401c6147:
          do {
            if (iVar3 < *(int *)(param_1 + (longlong)iVar12 * 4)) {
              if (iVar9 < iVar12) break;
              do {
                if (*(int *)(param_1 + (longlong)iVar9 * 4) < iVar3) {
                  if (iVar9 < iVar12) goto LAB_1401c6195;
                  uVar4 = *(undefined4 *)(param_1 + (longlong)iVar12 * 4);
                  *(undefined4 *)(param_1 + (longlong)iVar12 * 4) =
                       *(undefined4 *)(param_1 + (longlong)iVar9 * 4);
                  *(undefined4 *)(param_1 + (longlong)iVar9 * 4) = uVar4;
                  break;
                }
                iVar9 = iVar9 + -1;
              } while (iVar12 <= iVar9);
            }
            else {
              iVar12 = iVar12 + 1;
              if (iVar12 <= iVar9) goto LAB_1401c6147;
            }
          } while (iVar12 < iVar9);
        }
LAB_1401c6195:
        if (iVar2 <= iVar9) {
          iVar3 = *(int *)(param_1 + (longlong)iVar9 * 4);
          if (iVar3 < *(int *)(param_1 + lVar13 * 4)) {
            uVar4 = *(undefined4 *)(param_1 + lVar13 * 4);
            *(int *)(param_1 + lVar13 * 4) = iVar3;
            *(undefined4 *)(param_1 + (longlong)iVar9 * 4) = uVar4;
            lVar10 = local_108;
          }
          if (iVar2 < iVar9) {
            std::_Container_base12::_Orphan_all((_Container_base12 *)&local_128);
            if ((((int)local_110 + (int)local_108 & 3U) == 0) && (local_118 <= local_108 + 4U >> 2))
            {
              FUN_1401467d0(&local_128,1);
            }
            uVar8 = local_108 + local_110;
            uVar11 = uVar8 >> 2;
            if (local_118 <= uVar11) {
              uVar11 = uVar11 - local_118;
            }
            if (*(longlong *)((longlong)local_120 + uVar11 * 8) == 0) {
              pvVar7 = operator_new(0x10);
              if (pvVar7 == (void *)0x0) {
                local_res20 = (char *)0x0;
                std::exception::exception((exception *)local_a0,&local_res20);
                local_a0[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1402f47a8);
              }
              *(void **)((longlong)local_120 + uVar11 * 8) = pvVar7;
            }
            piVar1 = (int *)(*(longlong *)((longlong)local_120 + uVar11 * 8) +
                            (ulonglong)((uint)uVar8 & 3) * 4);
            if (piVar1 != (int *)0x0) {
              *piVar1 = iVar2;
            }
            local_108 = local_108 + 1;
            std::_Container_base12::_Orphan_all((_Container_base12 *)&local_128);
            if ((((char)local_108 + (char)local_110 & 3U) == 0) &&
               (local_118 <= local_108 + 4U >> 2)) {
              FUN_1401467d0(&local_128,1);
            }
            uVar8 = local_108 + local_110;
            uVar11 = uVar8 >> 2;
            if (local_118 <= uVar11) {
              uVar11 = uVar11 - local_118;
            }
            if (*(longlong *)((longlong)local_120 + uVar11 * 8) == 0) {
              local_res20 = operator_new(0x10);
              if (local_res20 == (char *)0x0) {
                std::exception::exception((exception *)local_c0,&local_res20);
                local_c0[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_c0,(ThrowInfo *)&DAT_1402f47a8);
              }
              *(char **)((longlong)local_120 + uVar11 * 8) = local_res20;
            }
            piVar1 = (int *)(*(longlong *)((longlong)local_120 + uVar11 * 8) +
                            (ulonglong)((uint)uVar8 & 3) * 4);
            if (piVar1 != (int *)0x0) {
              *piVar1 = iVar9 + -1;
            }
            lVar10 = local_108 + 1;
            iVar15 = local_res10[0];
            local_108 = lVar10;
          }
        }
        if (iVar9 < iVar15) {
          std::_Container_base12::_Orphan_all((_Container_base12 *)&local_128);
          if ((((int)local_110 + (int)local_108 & 3U) == 0) && (local_118 <= local_108 + 4U >> 2)) {
            FUN_1401467d0(&local_128,1);
          }
          uVar8 = local_108 + local_110;
          uVar11 = uVar8 >> 2;
          if (local_118 <= uVar11) {
            uVar11 = uVar11 - local_118;
          }
          if (*(longlong *)((longlong)local_120 + uVar11 * 8) == 0) {
            pvVar7 = operator_new(0x10);
            if (pvVar7 == (void *)0x0) {
              local_res20 = (char *)0x0;
              std::exception::exception((exception *)local_f0,&local_res20);
              local_f0[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
              _CxxThrowException(local_f0,(ThrowInfo *)&DAT_1402f47a8);
            }
            *(void **)((longlong)local_120 + uVar11 * 8) = pvVar7;
          }
          piVar1 = (int *)(*(longlong *)((longlong)local_120 + uVar11 * 8) +
                          (ulonglong)((uint)uVar8 & 3) * 4);
          if (piVar1 != (int *)0x0) {
            *piVar1 = iVar9 + 1;
          }
          local_108 = local_108 + 1;
          std::_Container_base12::_Orphan_all((_Container_base12 *)&local_128);
          if ((((char)local_108 + (char)local_110 & 3U) == 0) && (local_118 <= local_108 + 4U >> 2))
          {
            FUN_1401467d0(&local_128,1);
          }
          uVar8 = local_108 + local_110;
          uVar11 = uVar8 >> 2;
          if (local_118 <= uVar11) {
            uVar11 = uVar11 - local_118;
          }
          if (*(longlong *)((longlong)local_120 + uVar11 * 8) == 0) {
            pvVar7 = operator_new(0x10);
            if (pvVar7 == (void *)0x0) {
              local_res20 = (char *)0x0;
              std::exception::exception((exception *)local_88,&local_res20);
              local_88[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
              _CxxThrowException(local_88,(ThrowInfo *)&DAT_1402f47a8);
            }
            *(void **)((longlong)local_120 + uVar11 * 8) = pvVar7;
          }
          piVar1 = (int *)(*(longlong *)((longlong)local_120 + uVar11 * 8) +
                          (ulonglong)((uint)uVar8 & 3) * 4);
          if (piVar1 != (int *)0x0) {
            *piVar1 = iVar15;
          }
          lVar10 = local_108 + 1;
          local_108 = lVar10;
        }
      }
    }
    while (uVar8 != 0) {
      uVar8 = uVar8 - 1;
      if (*(longlong *)((longlong)local_120 + uVar8 * 8) != 0) {
        operator_delete(*(void **)((longlong)local_120 + uVar8 * 8));
      }
    }
    if (local_120 != (void *)0x0) {
      operator_delete(local_120);
    }
    local_118 = 0;
    local_120 = (void *)0x0;
    std::_Container_base12::_Orphan_all((_Container_base12 *)&local_128);
    operator_delete(local_128);
    local_128 = (longlong *)0x0;
    std::_Container_base12::~_Container_base12((_Container_base12 *)&local_128);
  }
  return;
}



void FUN_1401c6640(longlong *param_1)

{
  longlong *plVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  longlong *plVar4;
  undefined8 uVar5;
  longlong *plVar6;
  longlong lVar7;
  void *_Dst;
  int iVar8;
  longlong *plVar9;
  longlong lVar10;
  int iVar11;
  int iVar12;
  longlong *local_70;
  longlong *local_68;
  undefined8 local_60;
  undefined8 local_58;
  longlong local_50;
  longlong local_48;
  longlong *local_40;
  longlong *local_38;
  undefined4 local_30;
  undefined4 local_2c;
  
  iVar11 = (int)param_1[6];
  do {
    if (iVar11 < 1) {
      return;
    }
    plVar9 = (longlong *)0x0;
    local_38 = (longlong *)(**(code **)(**(longlong **)*param_1 + 0x38))();
    local_48 = 0;
    local_50 = 0;
    local_58 = 0;
    local_40 = (longlong *)0x0;
    local_2c = 0;
    local_60 = 2;
    uVar5 = (**(code **)(**(longlong **)*param_1 + 0x38))();
    plVar6 = (longlong *)FUN_140153270(&local_70,uVar5);
    plVar1 = local_38;
    plVar4 = local_40;
    plVar2 = (longlong *)*plVar6;
    if (plVar2 != (longlong *)0x0) {
      plVar2[1] = plVar2[1] + 1;
      plVar9 = plVar2;
    }
    if (local_40 != (longlong *)0x0) {
      plVar2 = local_40 + 1;
      *plVar2 = *plVar2 + -1;
      if (*plVar2 == 0) {
        puVar3 = (undefined8 *)*local_40;
        *puVar3 = Proud::CFastArray<>::vftable;
        if (puVar3[2] != 0) {
          if ((longlong *)puVar3[1] == (longlong *)0x0) {
            FUN_1400a3530(puVar3[2]);
          }
          else {
            (**(code **)(*(longlong *)puVar3[1] + 0x18))();
          }
        }
        (**(code **)(*plVar1 + 0x18))(plVar1,puVar3);
        (**(code **)(*local_38 + 0x18))(local_38,plVar4);
      }
    }
    plVar4 = local_68;
    plVar2 = local_70;
    lVar10 = 0;
    local_38 = (longlong *)plVar6[1];
    local_40 = plVar9;
    if (local_70 != (longlong *)0x0) {
      plVar1 = local_70 + 1;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        puVar3 = (undefined8 *)*local_70;
        *puVar3 = Proud::CFastArray<>::vftable;
        if (puVar3[2] != 0) {
          if ((longlong *)puVar3[1] == (longlong *)0x0) {
            FUN_1400a3530(puVar3[2]);
          }
          else {
            (**(code **)(*(longlong *)puVar3[1] + 0x18))();
          }
        }
        (**(code **)(*plVar4 + 0x18))(plVar4,puVar3);
        (**(code **)(*local_68 + 0x18))(local_68,plVar2);
      }
    }
    iVar12 = 0;
    iVar11 = (int)param_1[6];
    lVar7 = lVar10;
    if (iVar11 != 0) {
      lVar7 = param_1[5];
    }
    if (iVar11 < 0x7d1) {
      FUN_140144f30(lVar7,iVar11,0);
    }
    else {
      FUN_1401c5f80();
    }
    iVar8 = 0;
    iVar11 = 0;
    if (0 < (int)param_1[6]) {
      do {
        if ((lVar10 < 0) || ((int)param_1[6] <= iVar8)) {
                    // WARNING: Subroutine does not return
          FUN_1400a2700();
        }
        if (local_40 == (longlong *)0x0) {
          lVar7 = 0;
        }
        else {
          lVar7 = *local_40;
        }
        FUN_1401a8260(lVar7,*(undefined4 *)(param_1[5] + lVar10 * 4));
        iVar12 = iVar11 + 1;
        lVar7 = FUN_1401695b0(&local_40);
        if (DAT_14031d59c <= *(int *)(lVar7 + 0x18)) break;
        iVar8 = iVar8 + 1;
        lVar10 = lVar10 + 1;
        iVar11 = iVar12;
      } while (iVar8 < (int)param_1[6]);
    }
    local_30 = (undefined4)param_1[0x17];
    local_2c = (undefined4)param_1[2];
    FUN_1401be250(*param_1 + 8,&local_60);
    *(undefined8 *)(*param_1 + 0x18) = 0;
    if (iVar12 < 0) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    iVar11 = (int)param_1[6];
    if (iVar11 <= iVar12) {
      iVar12 = iVar11;
    }
    if (0 < iVar11 - iVar12) {
      lVar10 = 0;
      if (iVar11 == 0) {
        _Dst = (void *)0x0;
      }
      else {
        lVar10 = param_1[5];
        _Dst = (void *)param_1[5];
      }
      memmove(_Dst,(void *)(lVar10 + (longlong)iVar12 * 4),(longlong)(iVar11 - iVar12) << 2);
    }
    FUN_140143980(param_1 + 3,(int)param_1[6] - iVar12);
    plVar4 = local_38;
    plVar2 = local_40;
    if (local_40 != (longlong *)0x0) {
      plVar1 = local_40 + 1;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        puVar3 = (undefined8 *)*local_40;
        *puVar3 = Proud::CFastArray<>::vftable;
        if (puVar3[2] != 0) {
          if ((longlong *)puVar3[1] == (longlong *)0x0) {
            FUN_1400a3530(puVar3[2]);
          }
          else {
            (**(code **)(*(longlong *)puVar3[1] + 0x18))();
          }
        }
        (**(code **)(*plVar4 + 0x18))(plVar4,puVar3);
        (**(code **)(*local_38 + 0x18))(local_38,plVar2);
      }
    }
    FUN_14019a730(&local_58);
    if ((local_50 != 0) && (local_48 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_1400a26d0();
    }
    iVar11 = (int)param_1[6];
  } while( true );
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401c6970(undefined8 *param_1)

{
  double dVar1;
  int iVar2;
  double dVar3;
  
  dVar3 = (double)(**(code **)(**(longlong **)*param_1 + 0x18))();
  if ((double)param_1[0x16] == 0.0) {
    param_1[0x16] = dVar3;
  }
  dVar1 = (double)param_1[0x16];
  if (_DAT_14030c868 < dVar3 - dVar1) {
    iVar2 = *(int *)(param_1 + 0x15);
    param_1[0x16] = dVar3;
    *(undefined4 *)(param_1 + 0x15) = 0;
    *(int *)(param_1 + 0x17) =
         (int)(((double)iVar2 - (double)*(int *)(param_1 + 0x17)) * (0.1 / (dVar3 - dVar1)) +
              (double)*(int *)(param_1 + 0x17));
  }
  if (DAT_14030c878 * 0.2 < dVar3 - (double)param_1[1]) {
    FUN_1401c6640(param_1);
    param_1[1] = dVar3;
  }
  return;
}



undefined8 *
FUN_1401c6a50(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  
  plVar1 = (longlong *)*param_1;
  if (plVar1 == (longlong *)0x0) {
    puVar2 = (undefined8 *)FUN_1400a34c0(0x48);
  }
  else {
    puVar2 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,0x48);
  }
  if (puVar2 != (undefined8 *)0x0) {
    FUN_1401be330(puVar2 + 2,param_2);
  }
  puVar2[1] = param_3;
  *puVar2 = param_4;
  param_1[3] = param_1[3] + 1;
  return puVar2;
}



void FUN_1401c6ae0(longlong param_1)

{
  longlong *plVar1;
  longlong lVar2;
  longlong lVar3;
  longlong *plVar4;
  int iVar5;
  longlong lVar6;
  undefined1 local_98 [144];
  
  if (*(longlong *)(param_1 + 0x58) != 0) {
    do {
      lVar2 = *(longlong *)(param_1 + 0x48);
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      if (*(int *)(lVar2 + 0x14) != *(int *)(param_1 + 0x10)) {
        return;
      }
      lVar3 = *(longlong *)(lVar2 + 0x18);
      if ((lVar3 == 0) && (*(longlong *)(lVar2 + 0x20) == 0)) {
                    // WARNING: Subroutine does not return
        FUN_14019a830();
      }
      if (*(longlong *)(lVar2 + 0x20) == 0) {
        if (lVar3 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        lVar6 = 0;
        if (*(int *)(lVar3 + 0x18) != 0) {
          lVar6 = *(longlong *)(lVar3 + 0x10);
        }
      }
      else {
        lVar6 = *(longlong *)(lVar2 + 0x20);
        if (*(longlong *)(lVar2 + 0x20) == 0) {
          FUN_1400a2320(local_98,PTR_u_ArrayWithExternalBuffer_is_unini_14030bf50);
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_98,(ThrowInfo *)&DAT_1402f4860);
        }
      }
      FUN_1401c11f0(param_1 + 0x60,lVar6);
      if (*(longlong *)(lVar2 + 0x18) == 0) {
        if (*(longlong *)(lVar2 + 0x20) == 0) {
                    // WARNING: Subroutine does not return
          FUN_14019a830();
        }
        iVar5 = *(int *)(lVar2 + 0x28);
      }
      else {
        iVar5 = *(int *)(*(longlong *)(lVar2 + 0x18) + 0x18);
      }
      *(int *)(param_1 + 0xa0) = *(int *)(param_1 + 0xa0) + iVar5;
      plVar4 = *(longlong **)(param_1 + 0x48);
      if (plVar4 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000c6c0(0x80004005);
      }
      lVar2 = *plVar4;
      *(longlong *)(param_1 + 0x48) = lVar2;
      if (lVar2 == 0) {
        *(undefined8 *)(param_1 + 0x50) = 0;
      }
      else {
        *(undefined8 *)(lVar2 + 8) = 0;
      }
      if (plVar4[6] != 0) {
        plVar1 = (longlong *)(plVar4[6] + 8);
        *plVar1 = *plVar1 + -1;
        if (*plVar1 == 0) {
          FUN_140148f80(plVar4 + 6,plVar4[6]);
        }
      }
      FUN_14019a730(plVar4 + 3);
      if (plVar4[4] != 0) {
        if (*(int *)((longlong)plVar4 + 0x2c) < 0) {
                    // WARNING: Subroutine does not return
          FUN_1400a26d0();
        }
        *(undefined4 *)(plVar4 + 5) = 0;
      }
      plVar1 = *(longlong **)(param_1 + 0x40);
      if (plVar1 == (longlong *)0x0) {
        FUN_1400a3530(plVar4);
      }
      else {
        (**(code **)(*plVar1 + 0x10))(plVar1,plVar4);
      }
      *(longlong *)(param_1 + 0x58) = *(longlong *)(param_1 + 0x58) + -1;
      *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
    } while (*(longlong *)(param_1 + 0x58) != 0);
  }
  return;
}



void FUN_1401c6c90(longlong param_1,longlong param_2,undefined8 param_3)

{
  undefined8 uVar1;
  
  if (param_2 != 0) {
    uVar1 = FUN_1401c6a50(param_1,param_3,*(undefined8 *)(param_2 + 8),param_2);
    if (*(undefined8 **)(param_2 + 8) != (undefined8 *)0x0) {
      **(undefined8 **)(param_2 + 8) = uVar1;
      *(undefined8 *)(param_2 + 8) = uVar1;
      return;
    }
    *(undefined8 *)(param_1 + 8) = uVar1;
    *(undefined8 *)(param_2 + 8) = uVar1;
    return;
  }
  uVar1 = FUN_1401c6a50(param_1,param_3,0,*(undefined8 *)(param_1 + 8));
  if (*(longlong *)(param_1 + 8) != 0) {
    *(undefined8 *)(*(longlong *)(param_1 + 8) + 8) = uVar1;
    *(undefined8 *)(param_1 + 8) = uVar1;
    return;
  }
  *(undefined8 *)(param_1 + 0x10) = uVar1;
  *(undefined8 *)(param_1 + 8) = uVar1;
  return;
}



undefined8 *
FUN_1401c6d30(undefined8 *param_1,undefined8 param_2,undefined4 param_3,longlong param_4)

{
  undefined1 local_60 [72];
  
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  param_1[3] = Proud::ReliableUdpReceiver::AcksToSend::vftable;
  param_1[8] = 0;
  param_1[0xb] = 0;
  param_1[9] = 0;
  param_1[10] = 0;
  FUN_14016a780();
  FUN_1401c10f0(param_1 + 0xc,(longlong)DAT_1402f80ec);
  if (param_4 == 0) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  if (0 < *(int *)((longlong)param_1 + 0x34)) {
    FUN_1400a2320(local_60,PTR_u_Collection_object_can_use_fast_h_1402f81d0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_60,(ThrowInfo *)&DAT_1402f4860);
  }
  param_1[4] = param_4;
  *(undefined4 *)((longlong)param_1 + 0x3c) = 1;
  param_1[0x14] = 0;
  *(undefined4 *)(param_1 + 0x15) = 0;
  param_1[0x16] = 0;
  *(undefined4 *)(param_1 + 0x17) = DAT_14030c854;
  *(undefined4 *)((longlong)param_1 + 0xbc) = 0;
  *param_1 = param_2;
  *(undefined4 *)(param_1 + 2) = param_3;
  *(undefined4 *)((longlong)param_1 + 0x14) = param_3;
  param_1[1] = 0;
  return param_1;
}



void FUN_1401c6e40(undefined8 *param_1,longlong param_2)

{
  longlong *plVar1;
  int iVar2;
  int iVar3;
  undefined8 uVar4;
  undefined8 *puVar5;
  undefined8 local_40;
  undefined8 local_38;
  longlong local_30;
  longlong local_28;
  longlong local_20;
  undefined8 local_18;
  undefined4 local_c;
  
  puVar5 = (undefined8 *)param_1[9];
  do {
    if (puVar5 == (undefined8 *)0x0) {
      uVar4 = (**(code **)(**(longlong **)*param_1 + 0x38))();
      local_18 = *(undefined8 *)(param_2 + 0x28);
      local_28 = 0;
      local_30 = 0;
      local_38 = 0;
      local_20 = 0;
      local_40 = 0;
      local_c = 0;
      FUN_1401a8630(param_2,&local_40,uVar4);
      uVar4 = FUN_1401c6a50(param_1 + 8,&local_40,param_1[10],0);
      if ((undefined8 *)param_1[10] == (undefined8 *)0x0) {
        param_1[9] = uVar4;
      }
      else {
        *(undefined8 *)param_1[10] = uVar4;
      }
      param_1[10] = uVar4;
      if (local_20 != 0) {
        plVar1 = (longlong *)(local_20 + 8);
        *plVar1 = *plVar1 + -1;
        if (*plVar1 == 0) {
          FUN_140148f80(&local_20,local_20);
        }
      }
      FUN_14019a730(&local_38);
      if ((local_30 != 0) && (local_28 < 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
LAB_1401c6fd4:
      *(int *)(param_1 + 0x15) = *(int *)(param_1 + 0x15) + 1;
      return;
    }
    iVar2 = *(int *)((longlong)puVar5 + 0x14);
    iVar3 = *(int *)(param_2 + 4);
    if (iVar2 == iVar3) {
      return;
    }
    if ((iVar3 != iVar2) && (0x7fffffff < (uint)(iVar3 - iVar2))) {
      uVar4 = (**(code **)(**(longlong **)*param_1 + 0x38))();
      local_18 = *(undefined8 *)(param_2 + 0x28);
      local_28 = 0;
      local_30 = 0;
      local_38 = 0;
      local_20 = 0;
      local_40 = 0;
      local_c = 0;
      FUN_1401a8630(param_2,&local_40,uVar4);
      FUN_1401c6c90(param_1 + 8,puVar5,&local_40);
      if (local_20 != 0) {
        plVar1 = (longlong *)(local_20 + 8);
        *plVar1 = *plVar1 + -1;
        if (*plVar1 == 0) {
          FUN_140148f80(&local_20,local_20);
        }
      }
      FUN_14019a730(&local_38);
      if ((local_30 != 0) && (local_28 < 0)) {
                    // WARNING: Subroutine does not return
        FUN_1400a26d0();
      }
      goto LAB_1401c6fd4;
    }
    puVar5 = (undefined8 *)*puVar5;
  } while( true );
}



void FUN_1401c6ff0(undefined8 *param_1,longlong param_2)

{
  char cVar1;
  
  *(int *)((longlong)param_1 + 0xbc) = *(int *)((longlong)param_1 + 0xbc) + 1;
  cVar1 = (**(code **)(**(longlong **)*param_1 + 0x10))();
  if (cVar1 == '\0') {
    if ((*(int *)(param_2 + 4) == *(int *)(param_1 + 2)) ||
       ((uint)(*(int *)(param_2 + 4) - *(int *)(param_1 + 2)) < 0x80000000)) {
      FUN_140145490(param_1 + 3,*(undefined4 *)(param_1 + 6),param_2 + 4,1);
      *(int *)((longlong)param_1 + 0xa4) = *(int *)((longlong)param_1 + 0xa4) + 1;
    }
  }
  *(undefined4 *)((longlong)param_1 + 0x14) = *(undefined4 *)(param_2 + 4);
  if ((*(int *)(param_2 + 4) == *(int *)(param_1 + 2)) ||
     ((uint)(*(int *)(param_2 + 4) - *(int *)(param_1 + 2)) < 0x80000000)) {
    FUN_1401c6e40(param_1,param_2);
    FUN_1401c6ae0(param_1);
  }
  return;
}



void FUN_1401c7080(undefined8 param_1,int *param_2)

{
  if (*param_2 == 1) {
    FUN_1401c6ff0();
  }
  else if (*param_2 == 2) {
    FUN_1401c5de0();
    return;
  }
  return;
}



uint FUN_1401c70b0(uint param_1,byte *param_2,uint param_3)

{
  byte bVar1;
  int iVar2;
  ulonglong uVar3;
  uint uVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  int iVar10;
  int iVar11;
  int iVar12;
  int iVar13;
  int iVar14;
  int iVar15;
  int iVar16;
  int iVar17;
  int iVar18;
  int iVar19;
  byte *pbVar20;
  
  uVar4 = param_1 & 0xffff;
  param_1 = param_1 >> 0x10;
  if (param_3 == 1) {
    uVar4 = uVar4 + *param_2;
    if (0xfff0 < uVar4) {
      uVar4 = uVar4 - 0xfff1;
    }
    param_1 = param_1 + uVar4;
    if (0xfff0 < param_1) {
      return (param_1 - 0xfff1) * 0x10000 | uVar4;
    }
  }
  else {
    if (param_2 == (byte *)0x0) {
      return 1;
    }
    if (param_3 < 0x10) {
      for (; param_3 != 0; param_3 = param_3 - 1) {
        bVar1 = *param_2;
        param_2 = param_2 + 1;
        uVar4 = uVar4 + bVar1;
        param_1 = param_1 + uVar4;
      }
      if (0xfff0 < uVar4) {
        uVar4 = uVar4 - 0xfff1;
      }
      return (param_1 + (param_1 / 0xfff1) * 0xf) * 0x10000 | uVar4;
    }
    if (0x15af < param_3) {
      uVar3 = (ulonglong)param_3 / 0x15b0;
      do {
        param_3 = param_3 - 0x15b0;
        iVar2 = 0x15b;
        pbVar20 = param_2;
        do {
          param_2 = pbVar20 + 0x10;
          iVar5 = uVar4 + *pbVar20;
          iVar6 = iVar5 + (uint)pbVar20[1];
          iVar7 = iVar6 + (uint)pbVar20[2];
          iVar8 = iVar7 + (uint)pbVar20[3];
          iVar9 = iVar8 + (uint)pbVar20[4];
          iVar10 = iVar9 + (uint)pbVar20[5];
          iVar11 = iVar10 + (uint)pbVar20[6];
          iVar12 = iVar11 + (uint)pbVar20[7];
          iVar13 = iVar12 + (uint)pbVar20[8];
          iVar14 = iVar13 + (uint)pbVar20[9];
          iVar15 = iVar14 + (uint)pbVar20[10];
          iVar16 = iVar15 + (uint)pbVar20[0xb];
          iVar17 = iVar16 + (uint)pbVar20[0xc];
          iVar18 = iVar17 + (uint)pbVar20[0xd];
          iVar19 = iVar18 + (uint)pbVar20[0xe];
          uVar4 = iVar19 + (uint)pbVar20[0xf];
          param_1 = param_1 + iVar5 + iVar6 + iVar7 + iVar8 + iVar9 + iVar10 + iVar11 + iVar12 +
                    iVar13 + iVar14 + iVar15 + iVar16 + iVar17 + iVar18 + iVar19 + uVar4;
          iVar2 = iVar2 + -1;
          pbVar20 = param_2;
        } while (iVar2 != 0);
        uVar4 = uVar4 % 0xfff1;
        param_1 = param_1 % 0xfff1;
        uVar3 = uVar3 - 1;
      } while (uVar3 != 0);
    }
    if (param_3 != 0) {
      if (0xf < param_3) {
        uVar3 = (ulonglong)(param_3 >> 4);
        pbVar20 = param_2;
        do {
          param_3 = param_3 - 0x10;
          param_2 = pbVar20 + 0x10;
          iVar2 = uVar4 + *pbVar20;
          iVar5 = iVar2 + (uint)pbVar20[1];
          iVar6 = iVar5 + (uint)pbVar20[2];
          iVar7 = iVar6 + (uint)pbVar20[3];
          iVar8 = iVar7 + (uint)pbVar20[4];
          iVar9 = iVar8 + (uint)pbVar20[5];
          iVar10 = iVar9 + (uint)pbVar20[6];
          iVar11 = iVar10 + (uint)pbVar20[7];
          iVar12 = iVar11 + (uint)pbVar20[8];
          iVar13 = iVar12 + (uint)pbVar20[9];
          iVar14 = iVar13 + (uint)pbVar20[10];
          iVar15 = iVar14 + (uint)pbVar20[0xb];
          iVar16 = iVar15 + (uint)pbVar20[0xc];
          iVar17 = iVar16 + (uint)pbVar20[0xd];
          iVar18 = iVar17 + (uint)pbVar20[0xe];
          uVar4 = iVar18 + (uint)pbVar20[0xf];
          param_1 = param_1 + iVar2 + iVar5 + iVar6 + iVar7 + iVar8 + iVar9 + iVar10 + iVar11 +
                    iVar12 + iVar13 + iVar14 + iVar15 + iVar16 + iVar17 + iVar18 + uVar4;
          uVar3 = uVar3 - 1;
          pbVar20 = param_2;
        } while (uVar3 != 0);
      }
      for (; param_3 != 0; param_3 = param_3 - 1) {
        bVar1 = *param_2;
        param_2 = param_2 + 1;
        uVar4 = uVar4 + bVar1;
        param_1 = param_1 + uVar4;
      }
      uVar4 = uVar4 % 0xfff1;
      param_1 = param_1 % 0xfff1;
    }
  }
  return param_1 << 0x10 | uVar4;
}



void FUN_1401c73c0(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  uint uVar4;
  
  uVar4 = *(uint *)(*(longlong *)(param_1 + 0x28) + 0x28);
  if (*(uint *)(param_1 + 0x18) < uVar4) {
    uVar4 = *(uint *)(param_1 + 0x18);
  }
  if (uVar4 != 0) {
    memcpy(*(void **)(param_1 + 0x10),*(void **)(*(longlong *)(param_1 + 0x28) + 0x20),
           (ulonglong)uVar4);
    *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + (ulonglong)uVar4;
    plVar1 = (longlong *)(*(longlong *)(param_1 + 0x28) + 0x20);
    *plVar1 = *plVar1 + (ulonglong)uVar4;
    *(int *)(param_1 + 0x1c) = *(int *)(param_1 + 0x1c) + uVar4;
    *(int *)(param_1 + 0x18) = *(int *)(param_1 + 0x18) - uVar4;
    piVar2 = (int *)(*(longlong *)(param_1 + 0x28) + 0x28);
    *piVar2 = *piVar2 - uVar4;
    lVar3 = *(longlong *)(param_1 + 0x28);
    if (*(int *)(lVar3 + 0x28) == 0) {
      *(undefined8 *)(lVar3 + 0x20) = *(undefined8 *)(lVar3 + 0x10);
    }
  }
  return;
}



undefined8 FUN_1401c7440(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  if ((param_1 == 0) || (lVar2 = *(longlong *)(param_1 + 0x28), lVar2 == 0)) {
    return 0xfffffffe;
  }
  iVar1 = *(int *)(lVar2 + 8);
  if ((((iVar1 != 0x2a) && (iVar1 != 0x45)) && (iVar1 != 0x49)) &&
     (((iVar1 != 0x5b && (iVar1 != 0x67)) && ((iVar1 != 0x71 && (iVar1 != 0x29a)))))) {
    return 0xfffffffe;
  }
  if (*(longlong *)(lVar2 + 0x10) != 0) {
    (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40));
  }
  if (*(longlong *)(*(longlong *)(param_1 + 0x28) + 0x68) != 0) {
    (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40));
  }
  if (*(longlong *)(*(longlong *)(param_1 + 0x28) + 0x60) != 0) {
    (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40));
  }
  if (*(longlong *)(*(longlong *)(param_1 + 0x28) + 0x50) != 0) {
    (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40));
  }
  (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40),*(undefined8 *)(param_1 + 0x28));
  uVar3 = 0;
  *(undefined8 *)(param_1 + 0x28) = 0;
  if (iVar1 == 0x71) {
    uVar3 = 0xfffffffd;
  }
  return uVar3;
}



uint FUN_1401c7520(longlong *param_1,void *param_2,uint param_3)

{
  uint uVar1;
  undefined4 uVar2;
  uint uVar3;
  
  uVar1 = *(uint *)(param_1 + 1);
  uVar3 = uVar1;
  if (param_3 < uVar1) {
    uVar3 = param_3;
  }
  if (uVar3 == 0) {
    return 0;
  }
  *(uint *)(param_1 + 1) = uVar1 - uVar3;
  if (*(int *)(param_1[5] + 0x2c) == 1) {
    uVar2 = FUN_1401c70b0(*(undefined4 *)((longlong)param_1 + 0x4c),*param_1,uVar3);
  }
  else {
    if (*(int *)(param_1[5] + 0x2c) != 2) goto LAB_1401c7593;
    uVar2 = FUN_1401bf950(*(undefined4 *)((longlong)param_1 + 0x4c),*param_1,uVar3);
  }
  *(undefined4 *)((longlong)param_1 + 0x4c) = uVar2;
LAB_1401c7593:
  memcpy(param_2,(void *)*param_1,(ulonglong)uVar3);
  *param_1 = *param_1 + (ulonglong)uVar3;
  *(int *)((longlong)param_1 + 0xc) = *(int *)((longlong)param_1 + 0xc) + uVar3;
  return uVar3;
}



uint FUN_1401c75c0(longlong param_1,uint param_2)

{
  char *pcVar1;
  char *pcVar2;
  ushort uVar3;
  uint uVar4;
  longlong lVar5;
  char *pcVar6;
  uint uVar7;
  uint uVar8;
  char *pcVar9;
  char *pcVar10;
  int iVar11;
  uint uVar12;
  ulonglong uVar13;
  ulonglong uVar14;
  char cVar15;
  char cVar16;
  uint uVar17;
  
  uVar8 = *(uint *)(param_1 + 0x94);
  uVar7 = *(uint *)(param_1 + 0xa4);
  lVar5 = *(longlong *)(param_1 + 0x50);
  uVar13 = (ulonglong)(int)*(uint *)(param_1 + 0xa0);
  uVar14 = (ulonglong)param_2;
  pcVar2 = (char *)((ulonglong)uVar8 + lVar5);
  if (*(int *)(param_1 + 0x44) - 0x106U < uVar8) {
    uVar8 = (uVar8 - *(int *)(param_1 + 0x44)) + 0x106;
  }
  else {
    uVar8 = 0;
  }
  cVar15 = pcVar2[uVar13 - 1];
  cVar16 = pcVar2[uVar13];
  if (*(uint *)(param_1 + 0xb4) <= *(uint *)(param_1 + 0xa0)) {
    uVar7 = uVar7 >> 2;
  }
  uVar4 = *(uint *)(param_1 + 0x9c);
  uVar17 = *(uint *)(param_1 + 0xb8);
  if (uVar4 < *(uint *)(param_1 + 0xb8)) {
    uVar17 = uVar4;
  }
  do {
    iVar11 = (int)uVar13;
    pcVar6 = (char *)(lVar5 + uVar14);
    if ((((pcVar6[iVar11] == cVar16) && (pcVar6[(longlong)iVar11 + -1] == cVar15)) &&
        (*pcVar6 == *pcVar2)) && (pcVar6[1] == pcVar2[1])) {
      pcVar6 = pcVar6 + 2;
      pcVar9 = pcVar2 + 2;
      while (((((pcVar10 = pcVar9 + 1, *pcVar10 == pcVar6[1] &&
                (pcVar10 = pcVar9 + 2, *pcVar10 == pcVar6[2])) &&
               ((pcVar10 = pcVar9 + 3, *pcVar10 == pcVar6[3] &&
                ((pcVar10 = pcVar9 + 4, *pcVar10 == pcVar6[4] &&
                 (pcVar10 = pcVar9 + 5, *pcVar10 == pcVar6[5])))))) &&
              (pcVar10 = pcVar9 + 6, *pcVar10 == pcVar6[6])) &&
             (pcVar10 = pcVar9 + 7, *pcVar10 == pcVar6[7]))) {
        pcVar1 = pcVar6 + 8;
        pcVar6 = pcVar6 + 8;
        pcVar10 = pcVar9 + 8;
        if ((*pcVar10 != *pcVar1) || (pcVar9 = pcVar10, pcVar2 + 0x102 <= pcVar10)) break;
      }
      uVar12 = ((int)pcVar10 - (int)(pcVar2 + 0x102)) + 0x102;
      if (iVar11 < (int)uVar12) {
        *(int *)(param_1 + 0x98) = (int)uVar14;
        uVar13 = (ulonglong)uVar12;
        if ((int)uVar17 <= (int)uVar12) break;
        cVar15 = pcVar2[(longlong)(int)uVar12 + -1];
        cVar16 = pcVar2[(int)uVar12];
      }
    }
    uVar12 = (uint)uVar13;
    uVar3 = *(ushort *)(*(longlong *)(param_1 + 0x60) + (*(uint *)(param_1 + 0x4c) & uVar14) * 2);
    uVar14 = (ulonglong)uVar3;
    if (uVar3 <= uVar8) break;
    uVar7 = uVar7 - 1;
    lVar5 = *(longlong *)(param_1 + 0x50);
  } while (uVar7 != 0);
  if (uVar12 <= uVar4) {
    uVar4 = uVar12;
  }
  return uVar4;
}



void FUN_1401c7770(longlong *param_1)

{
  ushort *puVar1;
  uint uVar2;
  short sVar3;
  short *psVar4;
  ulonglong _Size;
  int iVar5;
  uint uVar6;
  uint uVar7;
  ulonglong uVar8;
  
  uVar2 = *(uint *)((longlong)param_1 + 0x44);
  _Size = (ulonglong)uVar2;
  while( true ) {
    iVar5 = ((int)param_1[0xb] - *(int *)((longlong)param_1 + 0x9c)) -
            *(uint *)((longlong)param_1 + 0x94);
    if ((uVar2 - 0x106) + *(int *)((longlong)param_1 + 0x44) <= *(uint *)((longlong)param_1 + 0x94))
    {
      memcpy((void *)param_1[10],(void *)(param_1[10] + _Size),_Size);
      uVar8 = (ulonglong)*(uint *)((longlong)param_1 + 0x74);
      *(uint *)(param_1 + 0x13) = (int)param_1[0x13] - uVar2;
      *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) - uVar2;
      *(int *)((longlong)param_1 + 0x84) = *(int *)((longlong)param_1 + 0x84) - uVar2;
      psVar4 = (short *)(param_1[0xd] + uVar8 * 2);
      do {
        puVar1 = (ushort *)(psVar4 + -1);
        psVar4 = psVar4 + -1;
        if (*puVar1 < uVar2) {
          sVar3 = 0;
        }
        else {
          sVar3 = *puVar1 - (short)uVar2;
        }
        uVar6 = (int)uVar8 - 1;
        uVar8 = (ulonglong)uVar6;
        *psVar4 = sVar3;
      } while (uVar6 != 0);
      psVar4 = (short *)(param_1[0xc] + _Size * 2);
      uVar6 = uVar2;
      do {
        puVar1 = (ushort *)(psVar4 + -1);
        psVar4 = psVar4 + -1;
        if (*puVar1 < uVar2) {
          sVar3 = 0;
        }
        else {
          sVar3 = *puVar1 - (short)uVar2;
        }
        uVar6 = uVar6 - 1;
        *psVar4 = sVar3;
      } while (uVar6 != 0);
      iVar5 = iVar5 + uVar2;
    }
    if (*(int *)(*param_1 + 8) == 0) break;
    iVar5 = FUN_1401c7520(*param_1,(ulonglong)*(uint *)((longlong)param_1 + 0x9c) +
                                   (ulonglong)*(uint *)((longlong)param_1 + 0x94) + param_1[10],
                          iVar5);
    *(int *)((longlong)param_1 + 0x9c) = *(int *)((longlong)param_1 + 0x9c) + iVar5;
    uVar6 = *(uint *)((longlong)param_1 + 0x9c);
    if (2 < uVar6) {
      uVar7 = (uint)*(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x94) + param_1[10]);
      *(uint *)(param_1 + 0xe) = uVar7;
      *(uint *)(param_1 + 0xe) =
           (uVar7 << ((byte)(int)param_1[0x10] & 0x1f) ^
           (uint)*(byte *)((ulonglong)(*(uint *)((longlong)param_1 + 0x94) + 1) + param_1[10])) &
           *(uint *)((longlong)param_1 + 0x7c);
    }
    if ((0x105 < uVar6) || (*(int *)(*param_1 + 8) == 0)) {
      uVar2 = *(uint *)(param_1 + 0x2e3);
      uVar7 = *(uint *)(param_1 + 0xb);
      if (uVar2 < uVar7) {
        uVar6 = uVar6 + *(int *)((longlong)param_1 + 0x94);
        if (uVar2 < uVar6) {
          uVar2 = uVar7 - uVar6;
          if (0x102 < uVar7 - uVar6) {
            uVar2 = 0x102;
          }
          memset((void *)((ulonglong)uVar6 + param_1[10]),0,(ulonglong)uVar2);
          *(uint *)(param_1 + 0x2e3) = uVar2 + uVar6;
        }
        else if (uVar2 < uVar6 + 0x102) {
          uVar6 = (uVar6 - uVar2) + 0x102;
          if (uVar7 - uVar2 < uVar6) {
            uVar6 = uVar7 - uVar2;
          }
          memset((void *)((ulonglong)uVar2 + param_1[10]),0,(ulonglong)uVar6);
          *(uint *)(param_1 + 0x2e3) = (int)param_1[0x2e3] + uVar6;
        }
      }
      return;
    }
  }
  return;
}



undefined8 FUN_1401c7930(longlong *param_1,int param_2)

{
  longlong *plVar1;
  int *piVar2;
  uint uVar3;
  uint uVar4;
  longlong lVar5;
  longlong lVar6;
  uint uVar7;
  uint uVar8;
  
  uVar4 = (int)param_1[3] - 5;
  uVar3 = 0xffff;
  if (uVar4 < 0xffff) {
    uVar3 = uVar4;
  }
  lVar6 = 0;
  do {
    uVar4 = *(uint *)((longlong)param_1 + 0x9c);
    if (uVar4 < 2) {
      FUN_1401c7770(param_1);
      uVar4 = *(uint *)((longlong)param_1 + 0x9c);
      if (uVar4 == 0) {
        if (param_2 == 0) {
          return 0;
        }
        uVar3 = *(uint *)((longlong)param_1 + 0x84);
        if (-1 < (int)uVar3) {
          lVar6 = (ulonglong)uVar3 + param_1[10];
        }
        FUN_1401cbb80(param_1,lVar6,*(int *)((longlong)param_1 + 0x94) - uVar3,param_2 == 4);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1401c73c0(*param_1);
        if (*(int *)(*param_1 + 0x18) != 0) {
          if (param_2 == 4) {
            return 3;
          }
          return 1;
        }
        if (param_2 == 4) {
          return 2;
        }
        return 0;
      }
    }
    uVar8 = *(uint *)((longlong)param_1 + 0x84);
    piVar2 = (int *)((longlong)param_1 + 0x94);
    *piVar2 = *piVar2 + uVar4;
    uVar4 = *(uint *)((longlong)param_1 + 0x94);
    uVar7 = uVar8 + uVar3;
    *(undefined4 *)((longlong)param_1 + 0x9c) = 0;
    if ((*piVar2 == 0) || (uVar7 <= uVar4)) {
      *(uint *)((longlong)param_1 + 0x94) = uVar7;
      *(uint *)((longlong)param_1 + 0x9c) = uVar4 - uVar7;
      lVar5 = lVar6;
      if (-1 < (int)uVar8) {
        lVar5 = (ulonglong)uVar8 + param_1[10];
      }
      FUN_1401cbb80(param_1,lVar5,uVar7 - uVar8,0);
      lVar5 = *param_1;
      *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
      uVar4 = *(uint *)(*(longlong *)(lVar5 + 0x28) + 0x28);
      if (*(uint *)(lVar5 + 0x18) < uVar4) {
        uVar4 = *(uint *)(lVar5 + 0x18);
      }
      if (uVar4 != 0) {
        memcpy(*(void **)(lVar5 + 0x10),*(void **)(*(longlong *)(lVar5 + 0x28) + 0x20),
               (ulonglong)uVar4);
        *(longlong *)(lVar5 + 0x10) = *(longlong *)(lVar5 + 0x10) + (ulonglong)uVar4;
        plVar1 = (longlong *)(*(longlong *)(lVar5 + 0x28) + 0x20);
        *plVar1 = *plVar1 + (ulonglong)uVar4;
        *(int *)(lVar5 + 0x1c) = *(int *)(lVar5 + 0x1c) + uVar4;
        *(int *)(lVar5 + 0x18) = *(int *)(lVar5 + 0x18) - uVar4;
        piVar2 = (int *)(*(longlong *)(lVar5 + 0x28) + 0x28);
        *piVar2 = *piVar2 - uVar4;
        lVar5 = *(longlong *)(lVar5 + 0x28);
        if (*(int *)(lVar5 + 0x28) == 0) {
          *(undefined8 *)(lVar5 + 0x20) = *(undefined8 *)(lVar5 + 0x10);
        }
      }
      if (*(int *)(*param_1 + 0x18) == 0) {
        return 0;
      }
    }
    uVar4 = *(uint *)((longlong)param_1 + 0x84);
    uVar8 = *(int *)((longlong)param_1 + 0x94) - uVar4;
    if (*(int *)((longlong)param_1 + 0x44) - 0x106U <= uVar8) {
      lVar5 = lVar6;
      if (-1 < (int)uVar4) {
        lVar5 = (ulonglong)uVar4 + param_1[10];
      }
      FUN_1401cbb80(param_1,lVar5,uVar8,0);
      lVar5 = *param_1;
      *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
      uVar4 = *(uint *)(*(longlong *)(lVar5 + 0x28) + 0x28);
      if (*(uint *)(lVar5 + 0x18) < uVar4) {
        uVar4 = *(uint *)(lVar5 + 0x18);
      }
      if (uVar4 != 0) {
        memcpy(*(void **)(lVar5 + 0x10),*(void **)(*(longlong *)(lVar5 + 0x28) + 0x20),
               (ulonglong)uVar4);
        *(longlong *)(lVar5 + 0x10) = *(longlong *)(lVar5 + 0x10) + (ulonglong)uVar4;
        plVar1 = (longlong *)(*(longlong *)(lVar5 + 0x28) + 0x20);
        *plVar1 = *plVar1 + (ulonglong)uVar4;
        *(int *)(lVar5 + 0x1c) = *(int *)(lVar5 + 0x1c) + uVar4;
        *(int *)(lVar5 + 0x18) = *(int *)(lVar5 + 0x18) - uVar4;
        piVar2 = (int *)(*(longlong *)(lVar5 + 0x28) + 0x28);
        *piVar2 = *piVar2 - uVar4;
        lVar5 = *(longlong *)(lVar5 + 0x28);
        if (*(int *)(lVar5 + 0x28) == 0) {
          *(undefined8 *)(lVar5 + 0x20) = *(undefined8 *)(lVar5 + 0x10);
        }
      }
      if (*(int *)(*param_1 + 0x18) == 0) {
        return 0;
      }
    }
  } while( true );
}



undefined8 FUN_1401c7bb0(longlong *param_1,int param_2)

{
  longlong *plVar1;
  int *piVar2;
  short *psVar3;
  undefined4 uVar4;
  byte bVar5;
  longlong lVar6;
  longlong lVar7;
  short sVar8;
  ushort uVar9;
  uint uVar10;
  bool bVar11;
  
  lVar7 = 0;
  do {
    uVar10 = *(uint *)((longlong)param_1 + 0x9c);
    if (uVar10 < 0x106) {
      FUN_1401c7770(param_1);
      uVar10 = *(uint *)((longlong)param_1 + 0x9c);
      if ((uVar10 < 0x106) && (param_2 == 0)) {
        return 0;
      }
      if (uVar10 == 0) {
        uVar10 = *(uint *)((longlong)param_1 + 0x84);
        if (-1 < (int)uVar10) {
          lVar7 = (ulonglong)uVar10 + param_1[10];
        }
        FUN_1401cbb80(param_1,lVar7,*(int *)((longlong)param_1 + 0x94) - uVar10,param_2 == 4);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1401c73c0(*param_1);
        if (*(int *)(*param_1 + 0x18) != 0) {
          if (param_2 == 4) {
            return 3;
          }
          return 1;
        }
        if (param_2 == 4) {
          return 2;
        }
        return 0;
      }
    }
    if (2 < uVar10) {
      uVar10 = ((uint)*(byte *)((ulonglong)(*(uint *)((longlong)param_1 + 0x94) + 2) + param_1[10])
               ^ (int)param_1[0xe] << ((byte)(int)param_1[0x10] & 0x1f)) &
               *(uint *)((longlong)param_1 + 0x7c);
      *(uint *)(param_1 + 0xe) = uVar10;
      *(undefined2 *)
       (param_1[0xc] +
       (ulonglong)(*(uint *)((longlong)param_1 + 0x94) & *(uint *)((longlong)param_1 + 0x4c)) * 2) =
           *(undefined2 *)(param_1[0xd] + (ulonglong)uVar10 * 2);
      uVar9 = *(ushort *)
               (param_1[0xc] +
               (ulonglong)
               (*(uint *)((longlong)param_1 + 0x94) & *(uint *)((longlong)param_1 + 0x4c)) * 2);
      *(undefined2 *)(param_1[0xd] + (ulonglong)*(uint *)(param_1 + 0xe) * 2) =
           *(undefined2 *)((longlong)param_1 + 0x94);
      if ((uVar9 != 0) &&
         (*(int *)((longlong)param_1 + 0x94) - (uint)uVar9 <=
          *(int *)((longlong)param_1 + 0x44) - 0x106U)) {
        uVar4 = FUN_1401c75c0(param_1);
        *(undefined4 *)(param_1 + 0x11) = uVar4;
      }
    }
    if (*(uint *)(param_1 + 0x11) < 3) {
      bVar5 = *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x94) + param_1[10]);
      *(undefined2 *)(param_1[0x2df] + (ulonglong)*(uint *)((longlong)param_1 + 0x16f4) * 2) = 0;
      *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x16f4) + param_1[0x2dd]) = bVar5;
      *(int *)((longlong)param_1 + 0x16f4) = *(int *)((longlong)param_1 + 0x16f4) + 1;
      psVar3 = (short *)((longlong)param_1 + (ulonglong)bVar5 * 4 + 0xbc);
      *psVar3 = *psVar3 + 1;
      bVar11 = *(int *)((longlong)param_1 + 0x16f4) == (int)param_1[0x2de] + -1;
      *(int *)((longlong)param_1 + 0x9c) = *(int *)((longlong)param_1 + 0x9c) + -1;
LAB_1401c7e8c:
      *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + 1;
    }
    else {
      sVar8 = *(short *)((longlong)param_1 + 0x94) - (short)param_1[0x13];
      lVar6 = param_1[0x11];
      *(short *)(param_1[0x2df] + (ulonglong)*(uint *)((longlong)param_1 + 0x16f4) * 2) = sVar8;
      bVar5 = (char)lVar6 - 3;
      uVar9 = sVar8 - 1;
      *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x16f4) + param_1[0x2dd]) = bVar5;
      *(int *)((longlong)param_1 + 0x16f4) = *(int *)((longlong)param_1 + 0x16f4) + 1;
      psVar3 = (short *)((longlong)param_1 + (ulonglong)(byte)(&DAT_1402691a0)[bVar5] * 4 + 0x4c0);
      *psVar3 = *psVar3 + 1;
      if (uVar9 < 0x100) {
        bVar5 = (&DAT_140268fa0)[uVar9];
      }
      else {
        bVar5 = (&DAT_1402690a0)[uVar9 >> 7];
      }
      psVar3 = (short *)((longlong)param_1 + (longlong)(int)(uint)bVar5 * 4 + 0x9b0);
      *psVar3 = *psVar3 + 1;
      bVar11 = *(int *)((longlong)param_1 + 0x16f4) == (int)param_1[0x2de] + -1;
      uVar10 = *(uint *)(param_1 + 0x11);
      *(int *)((longlong)param_1 + 0x9c) = *(int *)((longlong)param_1 + 0x9c) - uVar10;
      if ((uVar10 <= *(uint *)(param_1 + 0x15)) && (2 < *(uint *)((longlong)param_1 + 0x9c))) {
        *(uint *)(param_1 + 0x11) = uVar10 - 1;
        do {
          *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + 1;
          uVar10 = ((uint)*(byte *)((ulonglong)(*(uint *)((longlong)param_1 + 0x94) + 2) +
                                   param_1[10]) ^
                   (int)param_1[0xe] << ((byte)(int)param_1[0x10] & 0x1f)) &
                   *(uint *)((longlong)param_1 + 0x7c);
          *(uint *)(param_1 + 0xe) = uVar10;
          *(undefined2 *)
           (param_1[0xc] +
           (ulonglong)(*(uint *)((longlong)param_1 + 0x94) & *(uint *)((longlong)param_1 + 0x4c)) *
           2) = *(undefined2 *)(param_1[0xd] + (ulonglong)uVar10 * 2);
          *(undefined2 *)(param_1[0xd] + (ulonglong)*(uint *)(param_1 + 0xe) * 2) =
               *(undefined2 *)((longlong)param_1 + 0x94);
          plVar1 = param_1 + 0x11;
          *(int *)plVar1 = (int)*plVar1 + -1;
        } while ((int)*plVar1 != 0);
        goto LAB_1401c7e8c;
      }
      *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + uVar10;
      *(undefined4 *)(param_1 + 0x11) = 0;
      uVar10 = (uint)*(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x94) + param_1[10]);
      *(uint *)(param_1 + 0xe) = uVar10;
      *(uint *)(param_1 + 0xe) =
           (uVar10 << ((byte)(int)param_1[0x10] & 0x1f) ^
           (uint)*(byte *)((ulonglong)(*(uint *)((longlong)param_1 + 0x94) + 1) + param_1[10])) &
           *(uint *)((longlong)param_1 + 0x7c);
    }
    if (bVar11) {
      uVar10 = *(uint *)((longlong)param_1 + 0x84);
      lVar6 = lVar7;
      if (-1 < (int)uVar10) {
        lVar6 = (ulonglong)uVar10 + param_1[10];
      }
      FUN_1401cbb80(param_1,lVar6,*(int *)((longlong)param_1 + 0x94) - uVar10,0);
      lVar6 = *param_1;
      *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
      uVar10 = *(uint *)(*(longlong *)(lVar6 + 0x28) + 0x28);
      if (*(uint *)(lVar6 + 0x18) < uVar10) {
        uVar10 = *(uint *)(lVar6 + 0x18);
      }
      if (uVar10 != 0) {
        memcpy(*(void **)(lVar6 + 0x10),*(void **)(*(longlong *)(lVar6 + 0x28) + 0x20),
               (ulonglong)uVar10);
        *(longlong *)(lVar6 + 0x10) = *(longlong *)(lVar6 + 0x10) + (ulonglong)uVar10;
        plVar1 = (longlong *)(*(longlong *)(lVar6 + 0x28) + 0x20);
        *plVar1 = *plVar1 + (ulonglong)uVar10;
        *(int *)(lVar6 + 0x1c) = *(int *)(lVar6 + 0x1c) + uVar10;
        *(int *)(lVar6 + 0x18) = *(int *)(lVar6 + 0x18) - uVar10;
        piVar2 = (int *)(*(longlong *)(lVar6 + 0x28) + 0x28);
        *piVar2 = *piVar2 - uVar10;
        lVar6 = *(longlong *)(lVar6 + 0x28);
        if (*(int *)(lVar6 + 0x28) == 0) {
          *(undefined8 *)(lVar6 + 0x20) = *(undefined8 *)(lVar6 + 0x10);
        }
      }
      if (*(int *)(*param_1 + 0x18) == 0) {
        return 0;
      }
    }
  } while( true );
}



undefined4 FUN_1401c7fd0(longlong *param_1,int param_2)

{
  longlong *plVar1;
  int *piVar2;
  short *psVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined4 uVar7;
  longlong lVar8;
  byte bVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  short sVar12;
  ushort uVar13;
  uint uVar14;
  uint uVar15;
  
  uVar11 = 0;
  do {
    uVar14 = *(uint *)((longlong)param_1 + 0x9c);
    if (uVar14 < 0x106) {
      FUN_1401c7770(param_1);
      uVar14 = *(uint *)((longlong)param_1 + 0x9c);
      if ((uVar14 < 0x106) && (param_2 == 0)) {
        return 0;
      }
      if (uVar14 == 0) {
        if ((int)param_1[0x12] != 0) {
          bVar9 = *(byte *)((ulonglong)(*(int *)((longlong)param_1 + 0x94) - 1) + param_1[10]);
          *(undefined2 *)(param_1[0x2df] + (ulonglong)*(uint *)((longlong)param_1 + 0x16f4) * 2) = 0
          ;
          *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x16f4) + param_1[0x2dd]) = bVar9;
          *(int *)((longlong)param_1 + 0x16f4) = *(int *)((longlong)param_1 + 0x16f4) + 1;
          psVar3 = (short *)((longlong)param_1 + (ulonglong)bVar9 * 4 + 0xbc);
          *psVar3 = *psVar3 + 1;
          *(undefined4 *)(param_1 + 0x12) = 0;
        }
        uVar14 = *(uint *)((longlong)param_1 + 0x84);
        if (-1 < (int)uVar14) {
          uVar11 = (ulonglong)uVar14 + param_1[10];
        }
        FUN_1401cbb80(param_1,uVar11,*(int *)((longlong)param_1 + 0x94) - uVar14,param_2 == 4);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1401c73c0(*param_1);
        if (*(int *)(*param_1 + 0x18) != 0) {
          uVar7 = 1;
          if (param_2 == 4) {
            uVar7 = 3;
          }
          return uVar7;
        }
        if (param_2 == 4) {
          return 2;
        }
        return 0;
      }
    }
    uVar10 = uVar11;
    if (2 < uVar14) {
      uVar14 = ((uint)*(byte *)((ulonglong)(*(uint *)((longlong)param_1 + 0x94) + 2) + param_1[10])
               ^ (int)param_1[0xe] << ((byte)(int)param_1[0x10] & 0x1f)) &
               *(uint *)((longlong)param_1 + 0x7c);
      *(uint *)(param_1 + 0xe) = uVar14;
      *(undefined2 *)
       (param_1[0xc] +
       (ulonglong)(*(uint *)((longlong)param_1 + 0x94) & *(uint *)((longlong)param_1 + 0x4c)) * 2) =
           *(undefined2 *)(param_1[0xd] + (ulonglong)uVar14 * 2);
      uVar10 = (ulonglong)
               *(ushort *)
                (param_1[0xc] +
                (ulonglong)
                (*(uint *)((longlong)param_1 + 0x94) & *(uint *)((longlong)param_1 + 0x4c)) * 2);
      *(undefined2 *)(param_1[0xd] + (ulonglong)*(uint *)(param_1 + 0xe) * 2) =
           *(undefined2 *)((longlong)param_1 + 0x94);
    }
    uVar14 = *(uint *)(param_1 + 0x11);
    *(undefined4 *)(param_1 + 0x11) = 2;
    *(uint *)(param_1 + 0x14) = uVar14;
    *(int *)((longlong)param_1 + 0x8c) = (int)param_1[0x13];
    if ((((int)uVar10 != 0) && (uVar14 < *(uint *)(param_1 + 0x15))) &&
       ((uint)(*(int *)((longlong)param_1 + 0x94) - (int)uVar10) <=
        *(int *)((longlong)param_1 + 0x44) - 0x106U)) {
      uVar14 = FUN_1401c75c0(param_1,uVar10);
      *(uint *)(param_1 + 0x11) = uVar14;
      if ((uVar14 < 6) &&
         (((int)param_1[0x16] == 1 ||
          ((uVar14 == 3 &&
           (0x1000 < (uint)(*(int *)((longlong)param_1 + 0x94) - (int)param_1[0x13]))))))) {
        *(undefined4 *)(param_1 + 0x11) = 2;
      }
    }
    if ((*(uint *)(param_1 + 0x14) < 3) || (*(uint *)(param_1 + 0x14) < *(uint *)(param_1 + 0x11)))
    {
      if ((int)param_1[0x12] == 0) {
        *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + 1;
        *(int *)((longlong)param_1 + 0x9c) = *(int *)((longlong)param_1 + 0x9c) + -1;
        *(undefined4 *)(param_1 + 0x12) = 1;
      }
      else {
        bVar9 = *(byte *)((ulonglong)(*(int *)((longlong)param_1 + 0x94) - 1) + param_1[10]);
        *(undefined2 *)(param_1[0x2df] + (ulonglong)*(uint *)((longlong)param_1 + 0x16f4) * 2) = 0;
        *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x16f4) + param_1[0x2dd]) = bVar9;
        *(int *)((longlong)param_1 + 0x16f4) = *(int *)((longlong)param_1 + 0x16f4) + 1;
        psVar3 = (short *)((longlong)param_1 + (ulonglong)bVar9 * 4 + 0xbc);
        *psVar3 = *psVar3 + 1;
        if (*(int *)((longlong)param_1 + 0x16f4) == (int)param_1[0x2de] + -1) {
          uVar14 = *(uint *)((longlong)param_1 + 0x84);
          uVar10 = uVar11;
          if (-1 < (int)uVar14) {
            uVar10 = (ulonglong)uVar14 + param_1[10];
          }
          FUN_1401cbb80(param_1,uVar10,*(int *)((longlong)param_1 + 0x94) - uVar14,0);
          lVar8 = *param_1;
          *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
          uVar14 = *(uint *)(*(longlong *)(lVar8 + 0x28) + 0x28);
          if (*(uint *)(lVar8 + 0x18) < uVar14) {
            uVar14 = *(uint *)(lVar8 + 0x18);
          }
          if (uVar14 != 0) {
            memcpy(*(void **)(lVar8 + 0x10),*(void **)(*(longlong *)(lVar8 + 0x28) + 0x20),
                   (ulonglong)uVar14);
            *(longlong *)(lVar8 + 0x10) = *(longlong *)(lVar8 + 0x10) + (ulonglong)uVar14;
            plVar1 = (longlong *)(*(longlong *)(lVar8 + 0x28) + 0x20);
            *plVar1 = *plVar1 + (ulonglong)uVar14;
            *(int *)(lVar8 + 0x1c) = *(int *)(lVar8 + 0x1c) + uVar14;
            *(int *)(lVar8 + 0x18) = *(int *)(lVar8 + 0x18) - uVar14;
            piVar2 = (int *)(*(longlong *)(lVar8 + 0x28) + 0x28);
            *piVar2 = *piVar2 - uVar14;
            lVar8 = *(longlong *)(lVar8 + 0x28);
            if (*(int *)(lVar8 + 0x28) == 0) {
              *(undefined8 *)(lVar8 + 0x20) = *(undefined8 *)(lVar8 + 0x10);
            }
          }
        }
        *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + 1;
        *(int *)((longlong)param_1 + 0x9c) = *(int *)((longlong)param_1 + 0x9c) + -1;
        if (*(int *)(*param_1 + 0x18) == 0) {
          return 0;
        }
      }
    }
    else {
      iVar4 = *(int *)((longlong)param_1 + 0x94);
      iVar5 = *(int *)((longlong)param_1 + 0x9c);
      sVar12 = (short)iVar4 - *(short *)((longlong)param_1 + 0x8c);
      bVar9 = (char)param_1[0x14] - 3;
      *(short *)(param_1[0x2df] + (ulonglong)*(uint *)((longlong)param_1 + 0x16f4) * 2) =
           sVar12 + -1;
      *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x16f4) + param_1[0x2dd]) = bVar9;
      *(int *)((longlong)param_1 + 0x16f4) = *(int *)((longlong)param_1 + 0x16f4) + 1;
      uVar13 = sVar12 - 2;
      psVar3 = (short *)((longlong)param_1 + (ulonglong)(byte)(&DAT_1402691a0)[bVar9] * 4 + 0x4c0);
      *psVar3 = *psVar3 + 1;
      if (uVar13 < 0x100) {
        bVar9 = (&DAT_140268fa0)[uVar13];
      }
      else {
        bVar9 = (&DAT_1402690a0)[uVar13 >> 7];
      }
      psVar3 = (short *)((longlong)param_1 + (longlong)(int)(uint)bVar9 * 4 + 0x9b0);
      *psVar3 = *psVar3 + 1;
      lVar8 = param_1[0x2de];
      iVar6 = *(int *)((longlong)param_1 + 0x16f4);
      *(int *)((longlong)param_1 + 0x9c) =
           *(int *)((longlong)param_1 + 0x9c) + (1 - (int)param_1[0x14]);
      *(int *)(param_1 + 0x14) = (int)param_1[0x14] + -2;
      do {
        *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + 1;
        uVar14 = *(uint *)((longlong)param_1 + 0x94);
        if (uVar14 <= (uint)(iVar4 + -3 + iVar5)) {
          uVar15 = ((uint)*(byte *)((ulonglong)(uVar14 + 2) + param_1[10]) ^
                   (int)param_1[0xe] << ((byte)(int)param_1[0x10] & 0x1f)) &
                   *(uint *)((longlong)param_1 + 0x7c);
          *(uint *)(param_1 + 0xe) = uVar15;
          *(undefined2 *)
           (param_1[0xc] + (ulonglong)(*(uint *)((longlong)param_1 + 0x4c) & uVar14) * 2) =
               *(undefined2 *)(param_1[0xd] + (ulonglong)uVar15 * 2);
          *(undefined2 *)(param_1[0xd] + (ulonglong)*(uint *)(param_1 + 0xe) * 2) =
               *(undefined2 *)((longlong)param_1 + 0x94);
        }
        plVar1 = param_1 + 0x14;
        *(int *)plVar1 = (int)*plVar1 + -1;
      } while ((int)*plVar1 != 0);
      *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + 1;
      *(undefined4 *)(param_1 + 0x12) = 0;
      *(undefined4 *)(param_1 + 0x11) = 2;
      if (iVar6 == (int)lVar8 + -1) {
        uVar14 = *(uint *)((longlong)param_1 + 0x84);
        uVar10 = uVar11;
        if (-1 < (int)uVar14) {
          uVar10 = (ulonglong)uVar14 + param_1[10];
        }
        FUN_1401cbb80(param_1,uVar10,*(int *)((longlong)param_1 + 0x94) - uVar14,0);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1401c73c0(*param_1);
        if (*(int *)(*param_1 + 0x18) == 0) {
          return 0;
        }
      }
    }
  } while( true );
}



undefined4 FUN_1401c8520(longlong *param_1,int param_2)

{
  longlong *plVar1;
  int *piVar2;
  short *psVar3;
  char cVar4;
  uint uVar5;
  longlong lVar6;
  undefined4 uVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  byte bVar11;
  longlong lVar12;
  longlong lVar13;
  uint uVar14;
  bool bVar15;
  
  lVar13 = 0;
  do {
    uVar14 = *(uint *)((longlong)param_1 + 0x9c);
    if (uVar14 < 0x102) {
      FUN_1401c7770(param_1);
      uVar14 = *(uint *)((longlong)param_1 + 0x9c);
      if ((uVar14 < 0x102) && (param_2 == 0)) {
        return 0;
      }
      if (uVar14 == 0) {
        uVar14 = *(uint *)((longlong)param_1 + 0x84);
        if (-1 < (int)uVar14) {
          lVar13 = (ulonglong)uVar14 + param_1[10];
        }
        FUN_1401cbb80(param_1,lVar13,*(int *)((longlong)param_1 + 0x94) - uVar14,param_2 == 4);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1401c73c0(*param_1);
        if (*(int *)(*param_1 + 0x18) != 0) {
          uVar7 = 1;
          if (param_2 == 4) {
            uVar7 = 3;
          }
          return uVar7;
        }
        if (param_2 == 4) {
          return 2;
        }
        return 0;
      }
    }
    *(undefined4 *)(param_1 + 0x11) = 0;
    if (2 < uVar14) {
      uVar5 = *(uint *)((longlong)param_1 + 0x94);
      uVar8 = (ulonglong)uVar5;
      if (uVar5 != 0) {
        lVar6 = param_1[10];
        cVar4 = *(char *)(lVar6 + -1 + uVar8);
        lVar12 = lVar6 + -1 + uVar8;
        if (((cVar4 == *(char *)(lVar6 + uVar8)) && (cVar4 == *(char *)(lVar12 + 2))) &&
           (cVar4 == *(char *)(lVar12 + 3))) {
          uVar8 = lVar6 + 0x102 + (ulonglong)uVar5;
          uVar9 = lVar12 + 3;
          while ((((uVar10 = uVar9 + 1, cVar4 == *(char *)(uVar9 + 1) &&
                   (uVar10 = uVar9 + 2, cVar4 == *(char *)(uVar9 + 2))) &&
                  ((uVar10 = uVar9 + 3, cVar4 == *(char *)(uVar9 + 3) &&
                   ((uVar10 = uVar9 + 4, cVar4 == *(char *)(uVar9 + 4) &&
                    (uVar10 = uVar9 + 5, cVar4 == *(char *)(uVar9 + 5))))))) &&
                 (uVar10 = uVar9 + 6, cVar4 == *(char *)(uVar9 + 6)))) {
            uVar10 = uVar9 + 7;
            if (((cVar4 != *(char *)(uVar9 + 7)) ||
                (uVar10 = uVar9 + 8, cVar4 != *(char *)(uVar9 + 8))) ||
               (uVar9 = uVar10, uVar8 <= uVar10)) break;
          }
          uVar5 = ((int)uVar10 - (int)uVar8) + 0x102;
          *(uint *)(param_1 + 0x11) = uVar5;
          if (uVar14 < uVar5) {
            *(uint *)(param_1 + 0x11) = uVar14;
          }
        }
      }
    }
    if (*(uint *)(param_1 + 0x11) < 3) {
      bVar11 = *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x94) + param_1[10]);
      *(undefined2 *)(param_1[0x2df] + (ulonglong)*(uint *)((longlong)param_1 + 0x16f4) * 2) = 0;
      *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x16f4) + param_1[0x2dd]) = bVar11;
      *(int *)((longlong)param_1 + 0x16f4) = *(int *)((longlong)param_1 + 0x16f4) + 1;
      psVar3 = (short *)((longlong)param_1 + (ulonglong)bVar11 * 4 + 0xbc);
      *psVar3 = *psVar3 + 1;
      bVar15 = *(int *)((longlong)param_1 + 0x16f4) == (int)param_1[0x2de] + -1;
      *(int *)((longlong)param_1 + 0x9c) = *(int *)((longlong)param_1 + 0x9c) + -1;
      *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + 1;
    }
    else {
      lVar12 = param_1[0x11];
      *(undefined2 *)(param_1[0x2df] + (ulonglong)*(uint *)((longlong)param_1 + 0x16f4) * 2) = 1;
      bVar11 = (char)lVar12 - 3;
      *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x16f4) + param_1[0x2dd]) = bVar11;
      *(int *)((longlong)param_1 + 0x16f4) = *(int *)((longlong)param_1 + 0x16f4) + 1;
      psVar3 = (short *)((longlong)param_1 + (ulonglong)(byte)(&DAT_1402691a0)[bVar11] * 4 + 0x4c0);
      *psVar3 = *psVar3 + 1;
      *(short *)(param_1 + 0x136) = (short)param_1[0x136] + 1;
      bVar15 = *(int *)((longlong)param_1 + 0x16f4) == (int)param_1[0x2de] + -1;
      lVar12 = param_1[0x11];
      *(undefined4 *)(param_1 + 0x11) = 0;
      *(int *)((longlong)param_1 + 0x9c) = *(int *)((longlong)param_1 + 0x9c) - (int)lVar12;
      *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + (int)lVar12;
    }
    if (bVar15) {
      uVar14 = *(uint *)((longlong)param_1 + 0x84);
      lVar12 = lVar13;
      if (-1 < (int)uVar14) {
        lVar12 = (ulonglong)uVar14 + param_1[10];
      }
      FUN_1401cbb80(param_1,lVar12,*(int *)((longlong)param_1 + 0x94) - uVar14,0);
      lVar12 = *param_1;
      *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
      uVar14 = *(uint *)(*(longlong *)(lVar12 + 0x28) + 0x28);
      if (*(uint *)(lVar12 + 0x18) < uVar14) {
        uVar14 = *(uint *)(lVar12 + 0x18);
      }
      if (uVar14 != 0) {
        memcpy(*(void **)(lVar12 + 0x10),*(void **)(*(longlong *)(lVar12 + 0x28) + 0x20),
               (ulonglong)uVar14);
        *(longlong *)(lVar12 + 0x10) = *(longlong *)(lVar12 + 0x10) + (ulonglong)uVar14;
        plVar1 = (longlong *)(*(longlong *)(lVar12 + 0x28) + 0x20);
        *plVar1 = *plVar1 + (ulonglong)uVar14;
        *(int *)(lVar12 + 0x1c) = *(int *)(lVar12 + 0x1c) + uVar14;
        *(int *)(lVar12 + 0x18) = *(int *)(lVar12 + 0x18) - uVar14;
        piVar2 = (int *)(*(longlong *)(lVar12 + 0x28) + 0x28);
        *piVar2 = *piVar2 - uVar14;
        lVar12 = *(longlong *)(lVar12 + 0x28);
        if (*(int *)(lVar12 + 0x28) == 0) {
          *(undefined8 *)(lVar12 + 0x20) = *(undefined8 *)(lVar12 + 0x10);
        }
      }
      if (*(int *)(*param_1 + 0x18) == 0) {
        return 0;
      }
    }
  } while( true );
}



undefined8 FUN_1401c88a0(longlong *param_1,int param_2)

{
  longlong *plVar1;
  int *piVar2;
  short *psVar3;
  byte bVar4;
  longlong lVar5;
  longlong lVar6;
  uint uVar7;
  
  lVar6 = 0;
  while ((*(int *)((longlong)param_1 + 0x9c) != 0 ||
         (FUN_1401c7770(param_1), *(int *)((longlong)param_1 + 0x9c) != 0))) {
    *(undefined4 *)(param_1 + 0x11) = 0;
    bVar4 = *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x94) + param_1[10]);
    *(undefined2 *)(param_1[0x2df] + (ulonglong)*(uint *)((longlong)param_1 + 0x16f4) * 2) = 0;
    *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x16f4) + param_1[0x2dd]) = bVar4;
    *(int *)((longlong)param_1 + 0x16f4) = *(int *)((longlong)param_1 + 0x16f4) + 1;
    psVar3 = (short *)((longlong)param_1 + (ulonglong)bVar4 * 4 + 0xbc);
    *psVar3 = *psVar3 + 1;
    *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + 1;
    *(int *)((longlong)param_1 + 0x9c) = *(int *)((longlong)param_1 + 0x9c) + -1;
    if (*(int *)((longlong)param_1 + 0x16f4) == (int)param_1[0x2de] + -1) {
      uVar7 = *(uint *)((longlong)param_1 + 0x84);
      lVar5 = lVar6;
      if (-1 < (int)uVar7) {
        lVar5 = (ulonglong)uVar7 + param_1[10];
      }
      FUN_1401cbb80(param_1,lVar5,*(int *)((longlong)param_1 + 0x94) - uVar7,0);
      lVar5 = *param_1;
      *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
      uVar7 = *(uint *)(*(longlong *)(lVar5 + 0x28) + 0x28);
      if (*(uint *)(lVar5 + 0x18) < uVar7) {
        uVar7 = *(uint *)(lVar5 + 0x18);
      }
      if (uVar7 != 0) {
        memcpy(*(void **)(lVar5 + 0x10),*(void **)(*(longlong *)(lVar5 + 0x28) + 0x20),
               (ulonglong)uVar7);
        *(longlong *)(lVar5 + 0x10) = *(longlong *)(lVar5 + 0x10) + (ulonglong)uVar7;
        plVar1 = (longlong *)(*(longlong *)(lVar5 + 0x28) + 0x20);
        *plVar1 = *plVar1 + (ulonglong)uVar7;
        *(int *)(lVar5 + 0x1c) = *(int *)(lVar5 + 0x1c) + uVar7;
        *(int *)(lVar5 + 0x18) = *(int *)(lVar5 + 0x18) - uVar7;
        piVar2 = (int *)(*(longlong *)(lVar5 + 0x28) + 0x28);
        *piVar2 = *piVar2 - uVar7;
        lVar5 = *(longlong *)(lVar5 + 0x28);
        if (*(int *)(lVar5 + 0x28) == 0) {
          *(undefined8 *)(lVar5 + 0x20) = *(undefined8 *)(lVar5 + 0x10);
        }
      }
      if (*(int *)(*param_1 + 0x18) == 0) {
        return 0;
      }
    }
  }
  if (param_2 == 0) {
    return 0;
  }
  uVar7 = *(uint *)((longlong)param_1 + 0x84);
  if (-1 < (int)uVar7) {
    lVar6 = (ulonglong)uVar7 + param_1[10];
  }
  FUN_1401cbb80(param_1,lVar6,*(int *)((longlong)param_1 + 0x94) - uVar7,param_2 == 4);
  *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
  FUN_1401c73c0(*param_1);
  if (*(int *)(*param_1 + 0x18) != 0) {
    if (param_2 == 4) {
      return 3;
    }
    return 1;
  }
  if (param_2 == 4) {
    return 2;
  }
  return 0;
}



undefined8 FUN_1401c8a80(longlong param_1)

{
  ushort uVar1;
  longlong lVar2;
  undefined4 uVar3;
  longlong lVar4;
  
  if ((((param_1 != 0) && (lVar2 = *(longlong *)(param_1 + 0x28), lVar2 != 0)) &&
      (*(longlong *)(param_1 + 0x30) != 0)) && (*(longlong *)(param_1 + 0x38) != 0)) {
    *(undefined4 *)(param_1 + 0x48) = 2;
    *(undefined4 *)(param_1 + 0x1c) = 0;
    *(undefined4 *)(param_1 + 0xc) = 0;
    *(undefined8 *)(param_1 + 0x20) = 0;
    *(undefined4 *)(lVar2 + 0x28) = 0;
    *(undefined8 *)(lVar2 + 0x20) = *(undefined8 *)(lVar2 + 0x10);
    if (*(int *)(lVar2 + 0x2c) < 0) {
      *(int *)(lVar2 + 0x2c) = -*(int *)(lVar2 + 0x2c);
    }
    uVar3 = 0x71;
    if (*(int *)(lVar2 + 0x2c) != 0) {
      uVar3 = 0x2a;
    }
    *(undefined4 *)(lVar2 + 8) = uVar3;
    if (*(int *)(lVar2 + 0x2c) == 2) {
      uVar3 = FUN_1401bf950(0,0,0);
    }
    else {
      uVar3 = 1;
    }
    *(undefined4 *)(param_1 + 0x4c) = uVar3;
    *(undefined4 *)(lVar2 + 0x40) = 0;
    FUN_1401cb4c0(lVar2);
    *(int *)(lVar2 + 0x58) = *(int *)(lVar2 + 0x44) * 2;
    *(undefined2 *)(*(longlong *)(lVar2 + 0x68) + (ulonglong)(*(int *)(lVar2 + 0x74) - 1) * 2) = 0;
    memset(*(void **)(lVar2 + 0x68),0,(ulonglong)(*(int *)(lVar2 + 0x74) - 1) * 2);
    lVar4 = (longlong)*(int *)(lVar2 + 0xac);
    *(uint *)(lVar2 + 0xa8) = (uint)*(ushort *)(&DAT_140267f02 + lVar4 * 0x10);
    *(uint *)(lVar2 + 0xb4) = (uint)*(ushort *)(&DAT_140267f00 + lVar4 * 0x10);
    *(uint *)(lVar2 + 0xb8) = (uint)*(ushort *)(&DAT_140267f04 + lVar4 * 0x10);
    uVar1 = *(ushort *)(&DAT_140267f06 + lVar4 * 0x10);
    *(undefined4 *)(lVar2 + 0x84) = 0;
    *(undefined4 *)(lVar2 + 0x9c) = 0;
    *(undefined8 *)(lVar2 + 0x90) = 0;
    *(undefined4 *)(lVar2 + 0x70) = 0;
    *(uint *)(lVar2 + 0xa4) = (uint)uVar1;
    *(undefined4 *)(lVar2 + 0xa0) = 2;
    *(undefined4 *)(lVar2 + 0x88) = 2;
    return 0;
  }
  return 0xfffffffe;
}



uint FUN_1401c8bf0(longlong *param_1,uint param_2)

{
  char cVar1;
  undefined2 uVar2;
  int iVar3;
  undefined8 *puVar4;
  int *piVar5;
  bool bVar6;
  undefined4 uVar7;
  int iVar8;
  uint uVar9;
  undefined1 uVar10;
  ulonglong uVar11;
  uint uVar12;
  int iVar13;
  ulonglong uVar14;
  
  if (((param_1 == (longlong *)0x0) ||
      (puVar4 = (undefined8 *)param_1[5], puVar4 == (undefined8 *)0x0)) || (5 < param_2)) {
    return 0xfffffffe;
  }
  if (((param_1[2] == 0) || ((*param_1 == 0 && ((int)param_1[1] != 0)))) ||
     ((*(int *)(puVar4 + 1) == 0x29a && (param_2 != 4)))) {
    param_1[4] = (longlong)"stream error";
    return 0xfffffffe;
  }
  if ((int)param_1[3] == 0) {
    param_1[4] = (longlong)"buffer error";
    return 0xfffffffb;
  }
  iVar8 = *(int *)(puVar4 + 8);
  *(uint *)(puVar4 + 8) = param_2;
  *puVar4 = param_1;
  iVar13 = 0;
  if (*(int *)(puVar4 + 1) == 0x2a) {
    if (*(int *)((longlong)puVar4 + 0x2c) == 2) {
      uVar7 = FUN_1401bf950(0,0,0);
      *(undefined4 *)((longlong)param_1 + 0x4c) = uVar7;
      *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = 0x1f;
      *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
      *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = 0x8b;
      *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
      *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = 8;
      *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
      piVar5 = (int *)puVar4[6];
      uVar10 = 0;
      if (piVar5 == (int *)0x0) {
        *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = 0;
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = 0;
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = 0;
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = 0;
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = 0;
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        if (*(int *)((longlong)puVar4 + 0xac) == 9) {
          uVar10 = 2;
        }
        else if ((1 < *(int *)(puVar4 + 0x16)) || (*(int *)((longlong)puVar4 + 0xac) < 2)) {
          uVar10 = 4;
        }
        *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = uVar10;
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = 0xb;
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        *(undefined4 *)(puVar4 + 1) = 0x71;
      }
      else {
        *(byte *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
             (-(*(longlong *)(piVar5 + 0xc) != 0) & 0x10U) + (-(piVar5[0xf] != 0) & 2U) +
             (-(*(longlong *)(piVar5 + 8) != 0) & 8U) + (-(*(longlong *)(piVar5 + 4) != 0) & 4U) +
             (*piVar5 != 0);
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
             *(undefined1 *)(puVar4[6] + 4);
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
             *(undefined1 *)(puVar4[6] + 5);
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
             *(undefined1 *)(puVar4[6] + 6);
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
             *(undefined1 *)(puVar4[6] + 7);
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        if (*(int *)((longlong)puVar4 + 0xac) == 9) {
          uVar10 = 2;
        }
        else if ((1 < *(int *)(puVar4 + 0x16)) || (*(int *)((longlong)puVar4 + 0xac) < 2)) {
          uVar10 = 4;
        }
        *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = uVar10;
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
             *(undefined1 *)(puVar4[6] + 0xc);
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        uVar11 = (ulonglong)*(uint *)(puVar4 + 5);
        if (*(longlong *)(puVar4[6] + 0x10) != 0) {
          *(undefined1 *)(uVar11 + puVar4[2]) = *(undefined1 *)(puVar4[6] + 0x18);
          *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
               *(undefined1 *)(puVar4[6] + 0x19);
          *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
          uVar11 = (ulonglong)*(uint *)(puVar4 + 5);
        }
        if (*(int *)(puVar4[6] + 0x3c) != 0) {
          uVar7 = FUN_1401bf950(*(undefined4 *)((longlong)param_1 + 0x4c),puVar4[2],uVar11);
          *(undefined4 *)((longlong)param_1 + 0x4c) = uVar7;
        }
        *(undefined4 *)(puVar4 + 7) = 0;
        *(undefined4 *)(puVar4 + 1) = 0x45;
      }
    }
    else {
      if ((*(int *)(puVar4 + 0x16) < 2) && (iVar3 = *(int *)((longlong)puVar4 + 0xac), 1 < iVar3)) {
        if (iVar3 < 6) {
          iVar13 = 1;
        }
        else {
          iVar13 = (iVar3 != 6) + 2;
        }
      }
      uVar12 = (*(int *)(puVar4 + 9) + -8) * 0x1000 + 0x800U | iVar13 << 6;
      if (*(int *)((longlong)puVar4 + 0x94) != 0) {
        uVar12 = uVar12 | 0x20;
      }
      *(undefined4 *)(puVar4 + 1) = 0x71;
      iVar13 = (uVar12 / 0x1f + 1) * 0x1f;
      *(char *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = (char)((uint)iVar13 >> 8);
      *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
      *(char *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = (char)iVar13;
      *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
      if (*(int *)((longlong)puVar4 + 0x94) != 0) {
        uVar2 = *(undefined2 *)((longlong)param_1 + 0x4e);
        *(char *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = (char)((ushort)uVar2 >> 8);
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        *(char *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = (char)uVar2;
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        uVar2 = *(undefined2 *)((longlong)param_1 + 0x4c);
        *(char *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = (char)((ushort)uVar2 >> 8);
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        *(char *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = (char)uVar2;
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
      }
      *(undefined4 *)((longlong)param_1 + 0x4c) = 1;
    }
  }
  if (*(int *)(puVar4 + 1) == 0x45) {
    if (*(longlong *)(puVar4[6] + 0x10) != 0) {
      uVar12 = *(uint *)(puVar4 + 5);
      if (*(uint *)(puVar4 + 7) < (uint)*(ushort *)(puVar4[6] + 0x18)) {
        do {
          uVar9 = *(uint *)(puVar4 + 5);
          if (uVar9 == *(uint *)(puVar4 + 3)) {
            if ((*(int *)(puVar4[6] + 0x3c) != 0) && (uVar12 < uVar9)) {
              uVar7 = FUN_1401bf950(*(undefined4 *)((longlong)param_1 + 0x4c),
                                    (ulonglong)uVar12 + puVar4[2],uVar9 - uVar12);
              *(undefined4 *)((longlong)param_1 + 0x4c) = uVar7;
            }
            FUN_1401c73c0(param_1);
            uVar12 = *(uint *)(puVar4 + 5);
            uVar9 = uVar12;
            if (uVar12 == *(uint *)(puVar4 + 3)) break;
          }
          *(undefined1 *)((ulonglong)uVar9 + puVar4[2]) =
               *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 7) + *(longlong *)(puVar4[6] + 0x10));
          *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
          *(int *)(puVar4 + 7) = *(int *)(puVar4 + 7) + 1;
        } while (*(uint *)(puVar4 + 7) < (uint)*(ushort *)(puVar4[6] + 0x18));
      }
      if ((*(int *)(puVar4[6] + 0x3c) != 0) && (uVar12 < *(uint *)(puVar4 + 5))) {
        uVar7 = FUN_1401bf950(*(undefined4 *)((longlong)param_1 + 0x4c),
                              (ulonglong)uVar12 + puVar4[2],*(uint *)(puVar4 + 5) - uVar12);
        *(undefined4 *)((longlong)param_1 + 0x4c) = uVar7;
      }
      if (*(int *)(puVar4 + 7) != *(int *)(puVar4[6] + 0x18)) goto LAB_1401c9080;
      *(undefined4 *)(puVar4 + 7) = 0;
    }
    *(undefined4 *)(puVar4 + 1) = 0x49;
  }
LAB_1401c9080:
  if (*(int *)(puVar4 + 1) == 0x49) {
    if (*(longlong *)(puVar4[6] + 0x20) != 0) {
      uVar11 = (ulonglong)*(uint *)(puVar4 + 5);
      do {
        uVar12 = *(uint *)(puVar4 + 5);
        uVar14 = (ulonglong)uVar12;
        if (uVar12 == *(uint *)(puVar4 + 3)) {
          if ((*(int *)(puVar4[6] + 0x3c) != 0) && ((uint)uVar11 < uVar12)) {
            uVar7 = FUN_1401bf950(*(undefined4 *)((longlong)param_1 + 0x4c),uVar11 + puVar4[2],
                                  uVar12 - (uint)uVar11);
            *(undefined4 *)((longlong)param_1 + 0x4c) = uVar7;
          }
          FUN_1401c73c0(param_1);
          uVar11 = (ulonglong)*(uint *)(puVar4 + 5);
          uVar14 = uVar11;
          if (*(uint *)(puVar4 + 5) == *(uint *)(puVar4 + 3)) {
            bVar6 = true;
            goto LAB_1401c9110;
          }
        }
        cVar1 = *(char *)(*(longlong *)(puVar4[6] + 0x20) + (ulonglong)*(uint *)(puVar4 + 7));
        *(uint *)(puVar4 + 7) = *(uint *)(puVar4 + 7) + 1;
        *(char *)(uVar14 + puVar4[2]) = cVar1;
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
      } while (cVar1 != '\0');
      bVar6 = false;
LAB_1401c9110:
      if (*(int *)(puVar4[6] + 0x3c) != 0) {
        if ((uint)uVar11 < *(uint *)(puVar4 + 5)) {
          uVar7 = FUN_1401bf950(*(undefined4 *)((longlong)param_1 + 0x4c),uVar11 + puVar4[2],
                                *(uint *)(puVar4 + 5) - (uint)uVar11);
          *(undefined4 *)((longlong)param_1 + 0x4c) = uVar7;
        }
      }
      if (bVar6) goto LAB_1401c9144;
      *(undefined4 *)(puVar4 + 7) = 0;
    }
    *(undefined4 *)(puVar4 + 1) = 0x5b;
  }
LAB_1401c9144:
  if (*(int *)(puVar4 + 1) == 0x5b) {
    if (*(longlong *)(puVar4[6] + 0x30) != 0) {
      uVar11 = (ulonglong)*(uint *)(puVar4 + 5);
      do {
        uVar12 = *(uint *)(puVar4 + 5);
        uVar14 = (ulonglong)uVar12;
        if (uVar12 == *(uint *)(puVar4 + 3)) {
          if ((*(int *)(puVar4[6] + 0x3c) != 0) && ((uint)uVar11 < uVar12)) {
            uVar7 = FUN_1401bf950(*(undefined4 *)((longlong)param_1 + 0x4c),uVar11 + puVar4[2],
                                  uVar12 - (uint)uVar11);
            *(undefined4 *)((longlong)param_1 + 0x4c) = uVar7;
          }
          FUN_1401c73c0(param_1);
          uVar11 = (ulonglong)*(uint *)(puVar4 + 5);
          uVar14 = uVar11;
          if (*(uint *)(puVar4 + 5) == *(uint *)(puVar4 + 3)) {
            bVar6 = true;
            goto LAB_1401c91d0;
          }
        }
        cVar1 = *(char *)(*(longlong *)(puVar4[6] + 0x30) + (ulonglong)*(uint *)(puVar4 + 7));
        *(uint *)(puVar4 + 7) = *(uint *)(puVar4 + 7) + 1;
        *(char *)(uVar14 + puVar4[2]) = cVar1;
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
      } while (cVar1 != '\0');
      bVar6 = false;
LAB_1401c91d0:
      if (*(int *)(puVar4[6] + 0x3c) != 0) {
        if ((uint)uVar11 < *(uint *)(puVar4 + 5)) {
          uVar7 = FUN_1401bf950(*(undefined4 *)((longlong)param_1 + 0x4c),uVar11 + puVar4[2],
                                *(uint *)(puVar4 + 5) - (uint)uVar11);
          *(undefined4 *)((longlong)param_1 + 0x4c) = uVar7;
        }
      }
      if (bVar6) goto LAB_1401c9200;
    }
    *(undefined4 *)(puVar4 + 1) = 0x67;
  }
LAB_1401c9200:
  if (*(int *)(puVar4 + 1) == 0x67) {
    if (*(int *)(puVar4[6] + 0x3c) != 0) {
      if (*(uint *)(puVar4 + 3) < *(int *)(puVar4 + 5) + 2U) {
        FUN_1401c73c0(param_1);
      }
      if (*(uint *)(puVar4 + 3) < *(uint *)(puVar4 + 5) + 2) goto LAB_1401c926a;
      *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
           *(undefined1 *)((longlong)param_1 + 0x4c);
      *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
      *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
           *(undefined1 *)((longlong)param_1 + 0x4d);
      *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
      uVar7 = FUN_1401bf950(0,0,0);
      *(undefined4 *)((longlong)param_1 + 0x4c) = uVar7;
    }
    *(undefined4 *)(puVar4 + 1) = 0x71;
  }
LAB_1401c926a:
  if (*(int *)(puVar4 + 5) == 0) {
    if ((((int)param_1[1] == 0) && ((int)param_2 <= iVar8)) && (param_2 != 4)) goto LAB_1401c92b9;
LAB_1401c92a9:
    if (*(int *)(puVar4 + 1) == 0x29a) {
      if ((int)param_1[1] != 0) {
LAB_1401c92b9:
        param_1[4] = (longlong)"buffer error";
        return 0xfffffffb;
      }
LAB_1401c92d1:
      if ((*(int *)((longlong)puVar4 + 0x9c) != 0) ||
         ((param_2 != 0 && (*(int *)(puVar4 + 1) != 0x29a)))) goto LAB_1401c92ed;
    }
    else {
      if ((int)param_1[1] == 0) goto LAB_1401c92d1;
LAB_1401c92ed:
      if (*(int *)(puVar4 + 0x16) == 2) {
        iVar8 = FUN_1401c88a0();
      }
      else if (*(int *)(puVar4 + 0x16) == 3) {
        iVar8 = FUN_1401c8520();
      }
      else {
        iVar8 = (*(code *)(&PTR_FUN_140267f08)[(longlong)*(int *)((longlong)puVar4 + 0xac) * 2])
                          (puVar4);
      }
      if ((iVar8 == 2) || (iVar8 == 3)) {
        *(undefined4 *)(puVar4 + 1) = 0x29a;
      }
      if ((iVar8 == 0) || (iVar8 == 2)) {
        if ((int)param_1[3] != 0) {
          return 0;
        }
        goto LAB_1401c927e;
      }
      if (iVar8 == 1) {
        if (param_2 == 1) {
          FUN_1401cb960(puVar4);
        }
        else if ((param_2 != 5) && (FUN_1401cb8c0(puVar4,0,0,0), param_2 == 3)) {
          *(undefined2 *)(puVar4[0xd] + (ulonglong)(*(int *)((longlong)puVar4 + 0x74) - 1) * 2) = 0;
          memset((void *)puVar4[0xd],0,(ulonglong)(*(int *)((longlong)puVar4 + 0x74) - 1) * 2);
          if (*(int *)((longlong)puVar4 + 0x9c) == 0) {
            *(undefined4 *)((longlong)puVar4 + 0x94) = 0;
            *(undefined4 *)((longlong)puVar4 + 0x84) = 0;
          }
        }
        FUN_1401c73c0(param_1);
        if ((int)param_1[3] == 0) goto LAB_1401c927e;
      }
    }
    if (param_2 == 4) {
      if (0 < *(int *)((longlong)puVar4 + 0x2c)) {
        if (*(int *)((longlong)puVar4 + 0x2c) == 2) {
          *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
               *(undefined1 *)((longlong)param_1 + 0x4c);
          *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
               *(undefined1 *)((longlong)param_1 + 0x4d);
          *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
               *(undefined1 *)((longlong)param_1 + 0x4e);
          *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
               *(undefined1 *)((longlong)param_1 + 0x4f);
          *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
               *(undefined1 *)((longlong)param_1 + 0xc);
          *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
               *(undefined1 *)((longlong)param_1 + 0xd);
          *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
               *(undefined1 *)((longlong)param_1 + 0xe);
          *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) =
               *(undefined1 *)((longlong)param_1 + 0xf);
        }
        else {
          uVar2 = *(undefined2 *)((longlong)param_1 + 0x4e);
          *(char *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = (char)((ushort)uVar2 >> 8);
          *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
          *(char *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = (char)uVar2;
          *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
          uVar2 = *(undefined2 *)((longlong)param_1 + 0x4c);
          *(char *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = (char)((ushort)uVar2 >> 8);
          *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
          *(char *)((ulonglong)*(uint *)(puVar4 + 5) + puVar4[2]) = (char)uVar2;
        }
        *(int *)(puVar4 + 5) = *(int *)(puVar4 + 5) + 1;
        FUN_1401c73c0(param_1);
        if (0 < *(int *)((longlong)puVar4 + 0x2c)) {
          *(int *)((longlong)puVar4 + 0x2c) = -*(int *)((longlong)puVar4 + 0x2c);
        }
        return (uint)(*(int *)(puVar4 + 5) == 0);
      }
      return 1;
    }
  }
  else {
    FUN_1401c73c0(param_1);
    if ((int)param_1[3] != 0) goto LAB_1401c92a9;
LAB_1401c927e:
    *(undefined4 *)(puVar4 + 8) = 0xffffffff;
  }
  return 0;
}



undefined8
FUN_1401c9510(longlong param_1,uint param_2,int param_3,int param_4,int param_5,uint param_6,
             char *param_7,int param_8)

{
  uint uVar1;
  int iVar2;
  code *pcVar3;
  longlong *plVar4;
  longlong lVar5;
  undefined8 uVar6;
  int iVar7;
  undefined4 uVar8;
  
  uVar8 = 1;
  if (((param_7 == (char *)0x0) || (*param_7 != '1')) || (param_8 != 0x58)) {
    return 0xfffffffa;
  }
  if (param_1 == 0) {
    return 0xfffffffe;
  }
  *(undefined8 *)(param_1 + 0x20) = 0;
  if (*(longlong *)(param_1 + 0x30) == 0) {
    *(undefined8 *)(param_1 + 0x40) = 0;
    *(code **)(param_1 + 0x30) = FUN_1401c97e0;
  }
  pcVar3 = *(code **)(param_1 + 0x38);
  if (pcVar3 == (code *)0x0) {
    pcVar3 = FUN_1401c97f0;
  }
  *(code **)(param_1 + 0x38) = pcVar3;
  if (param_2 == 0xffffffff) {
    param_2 = 6;
  }
  if (param_4 < 0) {
    param_4 = -param_4;
    uVar8 = 0;
  }
  else if (0xf < param_4) {
    uVar8 = 2;
    param_4 = param_4 + -0x10;
  }
  if (((param_5 - 1U < 9) && (param_3 == 8)) &&
     ((param_4 - 8U < 8 && ((param_2 < 10 && (param_6 < 5)))))) {
    if (param_4 == 8) {
      param_4 = 9;
    }
    plVar4 = (longlong *)(**(code **)(param_1 + 0x30))(*(undefined8 *)(param_1 + 0x40),1,0x1720);
    if (plVar4 != (longlong *)0x0) {
      *(longlong **)(param_1 + 0x28) = plVar4;
      *(undefined4 *)((longlong)plVar4 + 0x2c) = uVar8;
      *plVar4 = param_1;
      *(int *)(plVar4 + 9) = param_4;
      plVar4[6] = 0;
      iVar7 = 1 << ((byte)param_4 & 0x1f);
      *(int *)((longlong)plVar4 + 0x44) = iVar7;
      *(int *)(plVar4 + 0xf) = param_5 + 7;
      *(int *)((longlong)plVar4 + 0x4c) = iVar7 + -1;
      iVar2 = 1 << ((byte)(param_5 + 7) & 0x1f);
      *(int *)((longlong)plVar4 + 0x74) = iVar2;
      *(int *)((longlong)plVar4 + 0x7c) = iVar2 + -1;
      *(uint *)(plVar4 + 0x10) = (param_5 + 9U) / 3;
      lVar5 = (**(code **)(param_1 + 0x30))(*(undefined8 *)(param_1 + 0x40),iVar7,2);
      plVar4[10] = lVar5;
      lVar5 = (**(code **)(param_1 + 0x30))
                        (*(undefined8 *)(param_1 + 0x40),*(undefined4 *)((longlong)plVar4 + 0x44),2)
      ;
      plVar4[0xc] = lVar5;
      lVar5 = (**(code **)(param_1 + 0x30))
                        (*(undefined8 *)(param_1 + 0x40),*(undefined4 *)((longlong)plVar4 + 0x74),2)
      ;
      *(undefined4 *)(plVar4 + 0x2e3) = 0;
      iVar2 = 1 << ((char)param_5 + 6U & 0x1f);
      plVar4[0xd] = lVar5;
      *(int *)(plVar4 + 0x2de) = iVar2;
      lVar5 = (**(code **)(param_1 + 0x30))(*(undefined8 *)(param_1 + 0x40),iVar2,4);
      plVar4[2] = lVar5;
      uVar1 = *(uint *)(plVar4 + 0x2de);
      *(uint *)(plVar4 + 3) = uVar1 * 4;
      if ((((plVar4[10] != 0) && (plVar4[0xc] != 0)) && (plVar4[0xd] != 0)) && (lVar5 != 0)) {
        *(uint *)((longlong)plVar4 + 0xac) = param_2;
        *(uint *)(plVar4 + 0x16) = param_6;
        *(undefined1 *)((longlong)plVar4 + 0x3c) = 8;
        plVar4[0x2df] = lVar5 + (ulonglong)(uVar1 >> 1) * 2;
        plVar4[0x2dd] = lVar5 + (ulonglong)uVar1 * 3;
        uVar6 = FUN_1401c8a80(param_1);
        return uVar6;
      }
      *(undefined4 *)(plVar4 + 1) = 0x29a;
      *(char **)(param_1 + 0x20) = "insufficient memory";
      FUN_1401c7440(param_1);
    }
    uVar6 = 0xfffffffc;
  }
  else {
    uVar6 = 0xfffffffe;
  }
  return uVar6;
}



void FUN_1401c97a0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4)

{
  FUN_1401c9510(param_1,param_2,8,0xf,8,0,param_3,param_4);
  return;
}



void FUN_1401c97e0(undefined8 param_1,int param_2,int param_3)

{
                    // WARNING: Could not recover jumptable at 0x0001401c97e6. Too many branches
                    // WARNING: Treating indirect jump as call
  malloc((ulonglong)(uint)(param_2 * param_3));
  return;
}



void FUN_1401c97f0(undefined8 param_1,void *param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401c97f3. Too many branches
                    // WARNING: Treating indirect jump as call
  free(param_2);
  return;
}



void FUN_1401c9800(longlong *param_1,int param_2)

{
  longlong lVar1;
  uint uVar2;
  undefined4 uVar3;
  uint uVar4;
  undefined4 uVar5;
  undefined4 *puVar6;
  longlong lVar7;
  longlong lVar8;
  longlong lVar9;
  uint uVar10;
  ulonglong uVar11;
  uint uVar12;
  uint uVar13;
  uint uVar14;
  byte *pbVar15;
  byte *pbVar16;
  longlong lVar17;
  undefined1 *puVar18;
  undefined1 *puVar19;
  undefined1 *puVar20;
  undefined1 *puVar21;
  undefined1 *puVar22;
  char cVar23;
  uint uVar24;
  uint uVar25;
  int iVar26;
  byte *pbVar27;
  int local_60;
  
  puVar6 = (undefined4 *)param_1[5];
  lVar9 = param_1[3];
  lVar17 = *(longlong *)(puVar6 + 0x16);
  lVar7 = *(longlong *)(puVar6 + 0x18);
  uVar2 = puVar6[0xd];
  uVar14 = puVar6[0x10];
  uVar25 = puVar6[0x11];
  puVar18 = (undefined1 *)(param_1[2] + -1);
  uVar3 = puVar6[0x1a];
  pbVar15 = (byte *)(*param_1 + -1);
  local_60 = (int)puVar18 - (param_2 - (int)lVar9);
  iVar26 = puVar6[0xb];
  uVar4 = puVar6[0xc];
  lVar8 = *(longlong *)(puVar6 + 0xe);
  pbVar27 = pbVar15 + ((int)param_1[1] - 5);
  uVar5 = puVar6[0x1b];
  puVar20 = puVar18;
LAB_1401c98b0:
  if (uVar25 < 0xf) {
    pbVar16 = pbVar15 + 1;
    pbVar15 = pbVar15 + 2;
    uVar14 = uVar14 + ((uint)*pbVar16 << ((byte)uVar25 & 0x1f)) +
             ((uint)*pbVar15 << ((byte)uVar25 + 8 & 0x1f));
    uVar25 = uVar25 + 0x10;
  }
  uVar12 = *(uint *)(lVar17 + (ulonglong)(uVar14 & (1 << ((byte)uVar3 & 0x1f)) - 1U) * 4);
  uVar14 = uVar14 >> ((byte)(uVar12 >> 8) & 0x1f);
  uVar25 = uVar25 - (uVar12 >> 8 & 0xff);
  cVar23 = (char)uVar12;
  while (cVar23 != '\0') {
    puVar19 = puVar20;
    if ((uVar12 & 0x10) != 0) {
      uVar24 = uVar12 >> 0x10;
      uVar12 = uVar12 & 0xf;
      pbVar16 = pbVar15;
      if (uVar12 != 0) {
        if (uVar25 < uVar12) {
          pbVar16 = pbVar15 + 1;
          pbVar15 = pbVar15 + 1;
          uVar14 = uVar14 + ((uint)*pbVar16 << ((byte)uVar25 & 0x1f));
          uVar25 = uVar25 + 8;
        }
        uVar10 = (1 << (sbyte)uVar12) - 1U & uVar14;
        uVar14 = uVar14 >> (sbyte)uVar12;
        uVar24 = uVar24 + uVar10;
        uVar25 = uVar25 - uVar12;
        pbVar16 = pbVar15;
      }
      if (uVar25 < 0xf) {
        pbVar15 = pbVar16 + 1;
        pbVar16 = pbVar16 + 2;
        uVar14 = uVar14 + ((uint)*pbVar15 << ((byte)uVar25 & 0x1f)) +
                 ((uint)*pbVar16 << ((byte)uVar25 + 8 & 0x1f));
        uVar25 = uVar25 + 0x10;
      }
      uVar12 = *(uint *)(lVar7 + (ulonglong)((1 << ((byte)uVar5 & 0x1f)) - 1U & uVar14) * 4);
      uVar14 = uVar14 >> ((byte)(uVar12 >> 8) & 0x1f);
      uVar25 = uVar25 - (uVar12 >> 8 & 0xff);
      goto joined_r0x0001401c99bd;
    }
    if ((uVar12 & 0x40) != 0) {
      if ((uVar12 & 0x20) == 0) {
        param_1[4] = (longlong)"invalid literal/length code";
        *puVar6 = 0x1d;
      }
      else {
        *puVar6 = 0xb;
      }
      goto LAB_1401c9c85;
    }
    uVar12 = *(uint *)(lVar17 + (ulonglong)
                                (((1 << ((byte)uVar12 & 0x1f)) - 1U & uVar14) + (uVar12 >> 0x10)) *
                                4);
    uVar14 = uVar14 >> ((byte)(uVar12 >> 8) & 0x1f);
    uVar25 = uVar25 - (uVar12 >> 8 & 0xff);
    cVar23 = (char)uVar12;
  }
  puVar20[1] = (char)(uVar12 >> 0x10);
  puVar19 = puVar20 + 1;
  goto LAB_1401c9c07;
joined_r0x0001401c99bd:
  pbVar15 = pbVar16;
  if ((uVar12 & 0x10) != 0) goto LAB_1401c9a02;
  if ((uVar12 & 0x40) != 0) {
    param_1[4] = (longlong)"invalid distance code";
    *puVar6 = 0x1d;
    goto LAB_1401c9c85;
  }
  uVar12 = *(uint *)(lVar7 + (ulonglong)
                             (((1 << ((byte)uVar12 & 0x1f)) - 1U & uVar14) + (uVar12 >> 0x10)) * 4);
  uVar14 = uVar14 >> ((byte)(uVar12 >> 8) & 0x1f);
  uVar25 = uVar25 - (uVar12 >> 8 & 0xff);
  goto joined_r0x0001401c99bd;
LAB_1401c9a02:
  uVar13 = uVar12 & 0xf;
  uVar10 = uVar25;
  if (uVar25 < uVar13) {
    pbVar15 = pbVar16 + 1;
    uVar10 = uVar25 + 8;
    uVar14 = uVar14 + ((uint)pbVar16[1] << ((byte)uVar25 & 0x1f));
    if (uVar10 < uVar13) {
      pbVar15 = pbVar16 + 2;
      uVar14 = uVar14 + ((uint)pbVar16[2] << ((byte)uVar10 & 0x1f));
      uVar10 = uVar25 + 0x10;
    }
  }
  uVar25 = uVar10 - uVar13;
  uVar10 = (1 << (sbyte)uVar13) - 1U & uVar14;
  uVar14 = uVar14 >> (sbyte)uVar13;
  uVar10 = (uVar12 >> 0x10) + uVar10;
  uVar12 = (int)puVar20 - local_60;
  if (uVar10 <= uVar12) {
    puVar19 = puVar20 + -(ulonglong)uVar10;
    do {
      puVar22 = puVar20;
      puVar21 = puVar19;
      puVar20 = puVar22 + 3;
      puVar22[1] = puVar21[1];
      uVar24 = uVar24 - 3;
      puVar22[2] = puVar21[2];
      *puVar20 = puVar21[3];
      puVar19 = puVar21 + 3;
    } while (2 < uVar24);
    puVar19 = puVar20;
    if (uVar24 != 0) {
      puVar22[4] = puVar21[4];
      puVar19 = puVar22 + 4;
      if (1 < uVar24) {
        puVar22[5] = puVar21[5];
        puVar19 = puVar22 + 5;
      }
    }
    goto LAB_1401c9c07;
  }
  uVar12 = uVar10 - uVar12;
  if ((uVar4 < uVar12) && (puVar6[0x6f6] != 0)) {
    param_1[4] = (longlong)"invalid distance too far back";
    *puVar6 = 0x1d;
LAB_1401c9c85:
    lVar17 = (longlong)pbVar15 - (ulonglong)(uVar25 >> 3);
    iVar26 = uVar25 + (uVar25 >> 3) * -8;
    *param_1 = lVar17 + 1;
    param_1[2] = (longlong)(puVar19 + 1);
    *(int *)(param_1 + 1) = ((int)pbVar27 - (int)lVar17) + 5;
    *(int *)(param_1 + 3) = ((int)(puVar18 + ((int)lVar9 - 0x101)) - (int)puVar19) + 0x101;
    puVar6[0x10] = uVar14 & (1 << ((byte)iVar26 & 0x1f)) - 1U;
    puVar6[0x11] = iVar26;
    return;
  }
  lVar1 = lVar8 + -1;
  if (uVar2 == 0) {
    puVar21 = (undefined1 *)(lVar1 + (ulonglong)(iVar26 - uVar12));
    if (uVar12 < uVar24) {
      uVar24 = uVar24 - uVar12;
      do {
        puVar20 = puVar21 + 1;
        puVar21 = puVar21 + 1;
        puVar19 = puVar19 + 1;
        uVar12 = uVar12 - 1;
        *puVar19 = *puVar20;
      } while (uVar12 != 0);
LAB_1401c9b32:
      puVar21 = puVar19 + -(ulonglong)uVar10;
      puVar20 = puVar19;
    }
  }
  else if (uVar2 < uVar12) {
    uVar13 = uVar12 - uVar2;
    puVar21 = (undefined1 *)(lVar1 + (ulonglong)((uVar2 - uVar12) + iVar26));
    if (uVar13 < uVar24) {
      uVar24 = uVar24 - uVar13;
      do {
        puVar22 = puVar19 + (longlong)(puVar21 + (1 - (longlong)puVar20));
        puVar19 = puVar19 + 1;
        uVar13 = uVar13 - 1;
        *puVar19 = *puVar22;
      } while (uVar13 != 0);
      puVar21 = (undefined1 *)(lVar8 + -1);
      puVar20 = puVar19;
      if (uVar2 < uVar24) {
        uVar24 = uVar24 - uVar2;
        uVar12 = uVar2;
        do {
          puVar20 = puVar21 + 1;
          puVar21 = puVar21 + 1;
          puVar19 = puVar19 + 1;
          uVar12 = uVar12 - 1;
          *puVar19 = *puVar20;
        } while (uVar12 != 0);
        goto LAB_1401c9b32;
      }
    }
  }
  else {
    puVar21 = (undefined1 *)(lVar1 + (ulonglong)(uVar2 - uVar12));
    if (uVar12 < uVar24) {
      uVar24 = uVar24 - uVar12;
      do {
        puVar20 = puVar21 + 1;
        puVar21 = puVar21 + 1;
        puVar19 = puVar19 + 1;
        uVar12 = uVar12 - 1;
        *puVar19 = *puVar20;
      } while (uVar12 != 0);
      goto LAB_1401c9b32;
    }
  }
  if (2 < uVar24) {
    uVar11 = (ulonglong)((uVar24 - 3) / 3 + 1);
    puVar19 = puVar20;
    puVar22 = puVar21;
    do {
      puVar21 = puVar22 + 3;
      puVar20 = puVar19 + 3;
      puVar19[1] = puVar22[1];
      uVar24 = uVar24 - 3;
      uVar11 = uVar11 - 1;
      puVar19[2] = puVar22[2];
      *puVar20 = *puVar21;
      puVar19 = puVar20;
      puVar22 = puVar21;
    } while (uVar11 != 0);
  }
  puVar19 = puVar20;
  if (uVar24 != 0) {
    puVar20[1] = puVar21[1];
    puVar19 = puVar20 + 1;
    if (1 < uVar24) {
      puVar20[2] = puVar21[2];
      puVar19 = puVar20 + 2;
    }
  }
LAB_1401c9c07:
  if ((pbVar27 <= pbVar15) || (puVar20 = puVar19, puVar18 + ((int)lVar9 - 0x101) <= puVar19))
  goto LAB_1401c9c85;
  goto LAB_1401c98b0;
}



void FUN_1401c9cf0(longlong param_1)

{
  undefined2 *puVar1;
  longlong lVar2;
  
  puVar1 = (undefined2 *)(param_1 + 0xbc);
  lVar2 = 0x11e;
  do {
    *puVar1 = 0;
    puVar1 = puVar1 + 2;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  puVar1 = (undefined2 *)(param_1 + 0x9b0);
  lVar2 = 0x1e;
  do {
    *puVar1 = 0;
    puVar1 = puVar1 + 2;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  puVar1 = (undefined2 *)(param_1 + 0xaa4);
  lVar2 = 0x13;
  do {
    *puVar1 = 0;
    puVar1 = puVar1 + 2;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  *(undefined8 *)(param_1 + 0x1700) = 0;
  *(undefined4 *)(param_1 + 0x1708) = 0;
  *(undefined2 *)(param_1 + 0x4bc) = 1;
  *(undefined4 *)(param_1 + 0x16f4) = 0;
  return;
}



void FUN_1401c9d70(longlong param_1,longlong param_2,int param_3)

{
  ushort uVar1;
  ushort uVar2;
  int iVar3;
  int iVar4;
  longlong lVar5;
  int iVar6;
  longlong lVar7;
  longlong lVar8;
  bool bVar9;
  
  iVar3 = *(int *)(param_1 + 0x149c);
  lVar7 = (longlong)param_3;
  iVar4 = *(int *)(param_1 + 0xba8 + lVar7 * 4);
  param_3 = param_3 * 2;
  bVar9 = SBORROW4(param_3,iVar3);
  iVar6 = param_3 - iVar3;
  if (param_3 <= iVar3) {
    do {
      if (bVar9 != iVar6 < 0) {
        lVar8 = (longlong)*(int *)(param_1 + 0xba8 + (longlong)param_3 * 4);
        lVar5 = (longlong)*(int *)(param_1 + 0xbac + (longlong)param_3 * 4);
        uVar1 = *(ushort *)(param_2 + lVar5 * 4);
        uVar2 = *(ushort *)(param_2 + lVar8 * 4);
        if ((uVar1 < uVar2) ||
           ((uVar1 == uVar2 &&
            (*(byte *)(lVar5 + 0x14a4 + param_1) <= *(byte *)(lVar8 + 0x14a4 + param_1))))) {
          param_3 = param_3 + 1;
        }
      }
      iVar3 = *(int *)(param_1 + 0xba8 + (longlong)param_3 * 4);
      uVar1 = *(ushort *)(param_2 + (longlong)iVar4 * 4);
      uVar2 = *(ushort *)(param_2 + (longlong)iVar3 * 4);
      iVar6 = (int)lVar7;
      if ((uVar1 < uVar2) ||
         ((uVar1 == uVar2 &&
          (*(byte *)((longlong)iVar4 + 0x14a4 + param_1) <=
           *(byte *)((longlong)iVar3 + 0x14a4 + param_1))))) {
        *(int *)(param_1 + 0xba8 + (longlong)iVar6 * 4) = iVar4;
        return;
      }
      lVar7 = (longlong)param_3;
      param_3 = param_3 * 2;
      *(int *)(param_1 + 0xba8 + (longlong)iVar6 * 4) = iVar3;
      iVar3 = *(int *)(param_1 + 0x149c);
      bVar9 = SBORROW4(param_3,iVar3);
      iVar6 = param_3 - iVar3;
    } while (param_3 <= iVar3);
  }
  *(int *)(param_1 + 0xba8 + lVar7 * 4) = iVar4;
  return;
}



void FUN_1401c9e60(longlong param_1,longlong *param_2)

{
  short *psVar1;
  ushort uVar2;
  short sVar3;
  int iVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  uint uVar8;
  longlong lVar9;
  uint uVar10;
  longlong lVar11;
  ulonglong uVar12;
  int iVar13;
  int iVar14;
  longlong lVar15;
  undefined2 *puVar16;
  longlong lVar17;
  int iVar18;
  uint uVar19;
  ulonglong uVar20;
  int *piVar21;
  longlong lVar22;
  
  plVar5 = (longlong *)param_2[2];
  lVar6 = *param_2;
  lVar7 = param_2[1];
  lVar9 = plVar5[2];
  uVar19 = *(uint *)(plVar5 + 3);
  uVar20 = (ulonglong)(int)uVar19;
  lVar15 = *plVar5;
  iVar13 = 0;
  lVar17 = plVar5[1];
  puVar16 = (undefined2 *)(param_1 + 0xb88);
  for (lVar11 = 0x10; lVar11 != 0; lVar11 = lVar11 + -1) {
    *puVar16 = 0;
    puVar16 = puVar16 + 1;
  }
  *(undefined2 *)
   (lVar6 + 2 + (longlong)*(int *)(param_1 + 0xba8 + (longlong)*(int *)(param_1 + 0x14a0) * 4) * 4)
       = 0;
  iVar14 = *(int *)(param_1 + 0x14a0) + 1;
  lVar11 = (longlong)iVar14;
  if (lVar11 < 0x23d) {
    lVar22 = 0x23d - lVar11;
    piVar21 = (int *)(param_1 + 0xba8 + lVar11 * 4);
    iVar14 = iVar14 + (int)lVar22;
    do {
      iVar4 = *piVar21;
      lVar11 = (longlong)iVar4 * 4;
      uVar10 = *(ushort *)(lVar6 + 2 + (ulonglong)*(ushort *)(lVar11 + 2 + lVar6) * 4) + 1;
      if ((int)uVar19 < (int)uVar10) {
        iVar13 = iVar13 + 1;
        uVar10 = uVar19;
      }
      *(short *)(lVar11 + 2 + lVar6) = (short)uVar10;
      if (iVar4 <= (int)lVar7) {
        iVar18 = 0;
        psVar1 = (short *)(param_1 + 0xb88 + (longlong)(int)uVar10 * 2);
        *psVar1 = *psVar1 + 1;
        if ((int)lVar9 <= iVar4) {
          iVar18 = *(int *)(lVar17 + ((longlong)iVar4 - (longlong)(int)lVar9) * 4);
        }
        uVar2 = *(ushort *)(lVar11 + lVar6);
        *(int *)(param_1 + 0x1700) = *(int *)(param_1 + 0x1700) + (iVar18 + uVar10) * (uint)uVar2;
        if (lVar15 != 0) {
          *(int *)(param_1 + 0x1704) =
               *(int *)(param_1 + 0x1704) +
               ((uint)*(ushort *)(lVar11 + 2 + lVar15) + iVar18) * (uint)uVar2;
        }
      }
      piVar21 = piVar21 + 1;
      lVar22 = lVar22 + -1;
    } while (lVar22 != 0);
  }
  if (iVar13 != 0) {
    do {
      uVar12 = (ulonglong)(int)(uVar19 - 1);
      sVar3 = *(short *)(param_1 + 0xb88 + uVar12 * 2);
      uVar10 = uVar19 - 1;
      while (sVar3 == 0) {
        uVar10 = (int)uVar12 - 1;
        uVar12 = (ulonglong)uVar10;
        sVar3 = *(short *)(param_1 + 0xb88 + (longlong)(int)uVar10 * 2);
      }
      iVar13 = iVar13 + -2;
      psVar1 = (short *)(param_1 + 0xb88 + (longlong)(int)uVar10 * 2);
      *psVar1 = *psVar1 + -1;
      psVar1 = (short *)(param_1 + 0xb8a + (longlong)(int)uVar10 * 2);
      *psVar1 = *psVar1 + 2;
      psVar1 = (short *)(param_1 + 0xb88 + uVar20 * 2);
      *psVar1 = *psVar1 + -1;
    } while (0 < iVar13);
    lVar15 = (longlong)iVar14;
    while (uVar19 != 0) {
      uVar19 = (uint)uVar20;
      uVar2 = *(ushort *)(param_1 + 0xb88 + (longlong)(int)uVar19 * 2);
      uVar10 = (uint)uVar2;
      if (uVar2 != 0) {
        lVar17 = param_1 + 0xba8 + lVar15 * 4;
        do {
          piVar21 = (int *)(lVar17 + -4);
          lVar9 = (longlong)*piVar21;
          lVar17 = lVar17 + -4;
          lVar15 = lVar15 + -1;
          if (*piVar21 <= (int)lVar7) {
            uVar8 = (uint)*(ushort *)(lVar6 + 2 + lVar9 * 4);
            if (uVar8 != uVar19) {
              *(int *)(param_1 + 0x1700) =
                   *(int *)(param_1 + 0x1700) +
                   (uVar19 - uVar8) * (uint)*(ushort *)(lVar6 + lVar9 * 4);
              *(short *)(lVar6 + 2 + lVar9 * 4) = (short)uVar20;
            }
            uVar10 = uVar10 - 1;
          }
        } while (uVar10 != 0);
      }
      uVar19 = uVar19 - 1;
      uVar20 = (ulonglong)uVar19;
    }
  }
  return;
}



void FUN_1401ca080(longlong param_1,longlong param_2,int param_3)

{
  short *psVar1;
  ushort uVar2;
  int iVar3;
  longlong lVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  int iVar8;
  int iVar9;
  ushort *puVar10;
  
  uVar2 = *(ushort *)(param_2 + 2);
  uVar5 = 0xffffffff;
  iVar9 = 0;
  iVar3 = 7;
  iVar8 = 4;
  if (uVar2 == 0) {
    iVar3 = 0x8a;
    iVar8 = 3;
  }
  lVar4 = (longlong)param_3;
  *(undefined2 *)(param_2 + 6 + lVar4 * 4) = 0xffff;
  if (-1 < lVar4) {
    puVar10 = (ushort *)(param_2 + 6);
    lVar4 = lVar4 + 1;
    uVar6 = (uint)uVar2;
    do {
      iVar9 = iVar9 + 1;
      uVar2 = *puVar10;
      uVar7 = (uint)uVar2;
      if ((iVar3 <= iVar9) || (uVar6 != uVar7)) {
        if (iVar9 < iVar8) {
          psVar1 = (short *)(param_1 + 0xaa4 + (longlong)(int)uVar6 * 4);
          *psVar1 = *psVar1 + (short)iVar9;
        }
        else if (uVar6 == 0) {
          if (iVar9 < 0xb) {
            *(short *)(param_1 + 0xae8) = *(short *)(param_1 + 0xae8) + 1;
          }
          else {
            *(short *)(param_1 + 0xaec) = *(short *)(param_1 + 0xaec) + 1;
          }
        }
        else {
          if (uVar6 != uVar5) {
            psVar1 = (short *)(param_1 + 0xaa4 + (longlong)(int)uVar6 * 4);
            *psVar1 = *psVar1 + 1;
          }
          *(short *)(param_1 + 0xae4) = *(short *)(param_1 + 0xae4) + 1;
        }
        iVar9 = 0;
        uVar5 = uVar6;
        if (uVar2 == 0) {
          iVar3 = 0x8a;
          iVar8 = 3;
          iVar9 = 0;
        }
        else if (uVar6 == uVar7) {
          iVar3 = 6;
          iVar8 = 3;
          iVar9 = 0;
        }
        else {
          iVar3 = 7;
          iVar8 = 4;
        }
      }
      puVar10 = puVar10 + 2;
      lVar4 = lVar4 + -1;
      uVar6 = uVar7;
    } while (lVar4 != 0);
  }
  return;
}



void FUN_1401ca170(longlong param_1,longlong param_2,int param_3)

{
  ushort uVar1;
  ushort uVar2;
  ushort uVar3;
  int iVar4;
  byte bVar5;
  int iVar6;
  ushort *puVar7;
  uint uVar8;
  uint uVar9;
  longlong lVar10;
  short sVar11;
  int iVar12;
  uint uVar14;
  longlong lVar15;
  int iVar13;
  
  uVar14 = 0xffffffff;
  iVar13 = 0;
  iVar4 = 7;
  iVar6 = 4;
  if (*(ushort *)(param_2 + 2) == 0) {
    iVar4 = 0x8a;
    iVar6 = 3;
  }
  if (-1 < param_3) {
    lVar15 = (longlong)param_3 + 1;
    puVar7 = (ushort *)(param_2 + 6);
    uVar8 = (uint)*(ushort *)(param_2 + 2);
    do {
      iVar12 = iVar13 + 1;
      lVar10 = (longlong)(int)uVar8;
      uVar1 = *puVar7;
      uVar9 = (uint)uVar1;
      if ((iVar4 <= iVar12) || (uVar8 != uVar9)) {
        if (iVar12 < iVar6) {
          do {
            uVar14 = (uint)*(ushort *)(param_1 + 0xaa6 + lVar10 * 4);
            iVar6 = *(int *)(param_1 + 0x1714);
            if ((int)(0x10 - uVar14) < iVar6) {
              uVar3 = *(ushort *)(param_1 + 0xaa4 + lVar10 * 4);
              *(ushort *)(param_1 + 0x1710) =
                   *(ushort *)(param_1 + 0x1710) | uVar3 << ((byte)iVar6 & 0x1f);
              *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10))
                   = *(undefined1 *)(param_1 + 0x1710);
              *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
              *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10))
                   = *(undefined1 *)(param_1 + 0x1711);
              *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
              iVar6 = *(int *)(param_1 + 0x1714) + -0x10;
              *(ushort *)(param_1 + 0x1710) =
                   uVar3 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
            }
            else {
              *(ushort *)(param_1 + 0x1710) =
                   *(ushort *)(param_1 + 0x1710) |
                   *(short *)(param_1 + 0xaa4 + lVar10 * 4) << ((byte)iVar6 & 0x1f);
            }
            iVar12 = iVar12 + -1;
            *(uint *)(param_1 + 0x1714) = iVar6 + uVar14;
          } while (iVar12 != 0);
        }
        else {
          if (uVar8 == 0) {
            iVar6 = *(int *)(param_1 + 0x1714);
            sVar11 = (short)iVar12;
            bVar5 = (byte)iVar6;
            if (iVar12 < 0xb) {
              uVar3 = *(ushort *)(param_1 + 0xaea);
              if ((int)(0x10 - (uint)uVar3) < iVar6) {
                uVar2 = *(ushort *)(param_1 + 0xae8);
                *(ushort *)(param_1 + 0x1710) =
                     *(ushort *)(param_1 + 0x1710) | uVar2 << (bVar5 & 0x1f);
                *(undefined1 *)
                 ((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                     *(undefined1 *)(param_1 + 0x1710);
                *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
                *(undefined1 *)
                 ((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                     *(undefined1 *)(param_1 + 0x1711);
                *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
                iVar6 = *(int *)(param_1 + 0x1714) + -0x10;
                *(ushort *)(param_1 + 0x1710) =
                     uVar2 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
              }
              else {
                *(ushort *)(param_1 + 0x1710) =
                     *(ushort *)(param_1 + 0x1710) | *(short *)(param_1 + 0xae8) << (bVar5 & 0x1f);
              }
              iVar6 = iVar6 + (uint)uVar3;
              *(int *)(param_1 + 0x1714) = iVar6;
              if (iVar6 < 0xe) {
                sVar11 = sVar11 + -3;
                iVar4 = iVar6 + 3;
LAB_1401ca67e:
                *(ushort *)(param_1 + 0x1710) =
                     *(ushort *)(param_1 + 0x1710) | sVar11 << ((byte)iVar6 & 0x1f);
              }
              else {
                *(ushort *)(param_1 + 0x1710) =
                     *(ushort *)(param_1 + 0x1710) | sVar11 - 3U << ((byte)iVar6 & 0x1f);
                *(undefined1 *)
                 ((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                     *(undefined1 *)(param_1 + 0x1710);
                *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
                *(undefined1 *)
                 ((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                     *(undefined1 *)(param_1 + 0x1711);
                *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
                iVar4 = *(int *)(param_1 + 0x1714) + -0xd;
                *(ushort *)(param_1 + 0x1710) =
                     (ushort)(sVar11 - 3U) >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
              }
            }
            else {
              uVar3 = *(ushort *)(param_1 + 0xaee);
              if ((int)(0x10 - (uint)uVar3) < iVar6) {
                uVar2 = *(ushort *)(param_1 + 0xaec);
                *(ushort *)(param_1 + 0x1710) =
                     *(ushort *)(param_1 + 0x1710) | uVar2 << (bVar5 & 0x1f);
                *(undefined1 *)
                 ((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                     *(undefined1 *)(param_1 + 0x1710);
                *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
                *(undefined1 *)
                 ((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                     *(undefined1 *)(param_1 + 0x1711);
                *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
                iVar6 = *(int *)(param_1 + 0x1714) + -0x10;
                *(ushort *)(param_1 + 0x1710) =
                     uVar2 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
              }
              else {
                *(ushort *)(param_1 + 0x1710) =
                     *(ushort *)(param_1 + 0x1710) | *(short *)(param_1 + 0xaec) << (bVar5 & 0x1f);
              }
              iVar6 = iVar6 + (uint)uVar3;
              *(int *)(param_1 + 0x1714) = iVar6;
              if (iVar6 < 10) {
                sVar11 = sVar11 + -0xb;
                iVar4 = iVar6 + 7;
                goto LAB_1401ca67e;
              }
              *(ushort *)(param_1 + 0x1710) =
                   *(ushort *)(param_1 + 0x1710) | sVar11 - 0xbU << ((byte)iVar6 & 0x1f);
              *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10))
                   = *(undefined1 *)(param_1 + 0x1710);
              *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
              *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10))
                   = *(undefined1 *)(param_1 + 0x1711);
              *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
              iVar4 = *(int *)(param_1 + 0x1714) + -9;
              *(ushort *)(param_1 + 0x1710) =
                   (ushort)(sVar11 - 0xbU) >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
            }
          }
          else {
            if (uVar8 != uVar14) {
              uVar14 = (uint)*(ushort *)(param_1 + 0xaa6 + lVar10 * 4);
              iVar6 = *(int *)(param_1 + 0x1714);
              if ((int)(0x10 - uVar14) < iVar6) {
                uVar3 = *(ushort *)(param_1 + 0xaa4 + lVar10 * 4);
                *(ushort *)(param_1 + 0x1710) =
                     *(ushort *)(param_1 + 0x1710) | uVar3 << ((byte)iVar6 & 0x1f);
                *(undefined1 *)
                 ((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                     *(undefined1 *)(param_1 + 0x1710);
                *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
                *(undefined1 *)
                 ((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                     *(undefined1 *)(param_1 + 0x1711);
                *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
                iVar6 = *(int *)(param_1 + 0x1714) + -0x10;
                *(ushort *)(param_1 + 0x1710) =
                     uVar3 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
              }
              else {
                *(ushort *)(param_1 + 0x1710) =
                     *(ushort *)(param_1 + 0x1710) |
                     *(short *)(param_1 + 0xaa4 + lVar10 * 4) << ((byte)iVar6 & 0x1f);
              }
              *(uint *)(param_1 + 0x1714) = iVar6 + uVar14;
              iVar12 = iVar13;
            }
            uVar3 = *(ushort *)(param_1 + 0xae6);
            iVar6 = *(int *)(param_1 + 0x1714);
            if ((int)(0x10 - (uint)uVar3) < iVar6) {
              uVar2 = *(ushort *)(param_1 + 0xae4);
              *(ushort *)(param_1 + 0x1710) =
                   *(ushort *)(param_1 + 0x1710) | uVar2 << ((byte)iVar6 & 0x1f);
              *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10))
                   = *(undefined1 *)(param_1 + 0x1710);
              *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
              *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10))
                   = *(undefined1 *)(param_1 + 0x1711);
              *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
              iVar6 = *(int *)(param_1 + 0x1714) + -0x10;
              *(ushort *)(param_1 + 0x1710) =
                   uVar2 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
            }
            else {
              *(ushort *)(param_1 + 0x1710) =
                   *(ushort *)(param_1 + 0x1710) |
                   *(short *)(param_1 + 0xae4) << ((byte)iVar6 & 0x1f);
            }
            iVar6 = iVar6 + (uint)uVar3;
            *(int *)(param_1 + 0x1714) = iVar6;
            if (iVar6 < 0xf) {
              sVar11 = (short)iVar12 + -3;
              iVar4 = iVar6 + 2;
              goto LAB_1401ca67e;
            }
            uVar3 = (short)iVar12 - 3;
            *(ushort *)(param_1 + 0x1710) =
                 *(ushort *)(param_1 + 0x1710) | uVar3 << ((byte)iVar6 & 0x1f);
            *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                 *(undefined1 *)(param_1 + 0x1710);
            *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
            *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                 *(undefined1 *)(param_1 + 0x1711);
            *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
            iVar4 = *(int *)(param_1 + 0x1714) + -0xe;
            *(ushort *)(param_1 + 0x1710) =
                 uVar3 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
          }
          *(int *)(param_1 + 0x1714) = iVar4;
        }
        uVar14 = uVar8;
        iVar12 = 0;
        if (uVar1 == 0) {
          iVar4 = 0x8a;
          iVar6 = 3;
        }
        else if (uVar8 == uVar9) {
          iVar4 = 6;
          iVar6 = 3;
        }
        else {
          iVar4 = 7;
          iVar6 = 4;
          iVar12 = 0;
        }
      }
      iVar13 = iVar12;
      puVar7 = puVar7 + 2;
      lVar15 = lVar15 + -1;
      uVar8 = uVar9;
    } while (lVar15 != 0);
  }
  return;
}



void FUN_1401ca6e0(longlong param_1,int param_2,int param_3,uint param_4)

{
  ushort uVar1;
  int iVar2;
  int iVar3;
  byte *pbVar4;
  ulonglong uVar5;
  
  iVar2 = *(int *)(param_1 + 0x1714);
  uVar5 = (ulonglong)param_4;
  if (iVar2 < 0xc) {
    *(ushort *)(param_1 + 0x1710) =
         *(ushort *)(param_1 + 0x1710) | (short)param_2 + -0x101 << ((byte)iVar2 & 0x1f);
    iVar2 = iVar2 + 5;
  }
  else {
    uVar1 = (short)param_2 - 0x101;
    *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | uVar1 << ((byte)iVar2 & 0x1f);
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1711);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    iVar2 = *(int *)(param_1 + 0x1714) + -0xb;
    *(ushort *)(param_1 + 0x1710) = uVar1 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
  }
  *(int *)(param_1 + 0x1714) = iVar2;
  if (iVar2 < 0xc) {
    *(ushort *)(param_1 + 0x1710) =
         *(ushort *)(param_1 + 0x1710) | (short)param_3 + -1 << ((byte)iVar2 & 0x1f);
    iVar2 = iVar2 + 5;
  }
  else {
    uVar1 = (short)param_3 - 1;
    *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | uVar1 << ((byte)iVar2 & 0x1f);
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1711);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    iVar2 = *(int *)(param_1 + 0x1714) + -0xb;
    *(ushort *)(param_1 + 0x1710) = uVar1 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
  }
  *(int *)(param_1 + 0x1714) = iVar2;
  if (iVar2 < 0xd) {
    *(ushort *)(param_1 + 0x1710) =
         *(ushort *)(param_1 + 0x1710) | (short)param_4 + -4 << ((byte)iVar2 & 0x1f);
    iVar2 = iVar2 + 4;
  }
  else {
    uVar1 = (short)param_4 - 4;
    *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | uVar1 << ((byte)iVar2 & 0x1f);
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1711);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    iVar2 = *(int *)(param_1 + 0x1714) + -0xc;
    *(ushort *)(param_1 + 0x1710) = uVar1 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
  }
  *(int *)(param_1 + 0x1714) = iVar2;
  if (0 < (int)param_4) {
    pbVar4 = &DAT_140268a80;
    do {
      iVar2 = *(int *)(param_1 + 0x1714);
      if (iVar2 < 0xe) {
        iVar3 = iVar2 + 3;
        *(ushort *)(param_1 + 0x1710) =
             *(ushort *)(param_1 + 0x1710) |
             *(short *)(param_1 + 0xaa6 + (ulonglong)*pbVar4 * 4) << ((byte)iVar2 & 0x1f);
      }
      else {
        uVar1 = *(ushort *)(param_1 + 0xaa6 + (ulonglong)*pbVar4 * 4);
        *(ushort *)(param_1 + 0x1710) =
             *(ushort *)(param_1 + 0x1710) | uVar1 << ((byte)iVar2 & 0x1f);
        *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
             *(undefined1 *)(param_1 + 0x1710);
        *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
             *(undefined1 *)(param_1 + 0x1711);
        *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
        iVar3 = *(int *)(param_1 + 0x1714) + -0xd;
        *(ushort *)(param_1 + 0x1710) = uVar1 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
      }
      pbVar4 = pbVar4 + 1;
      uVar5 = uVar5 - 1;
      *(int *)(param_1 + 0x1714) = iVar3;
    } while (uVar5 != 0);
  }
  FUN_1401ca170(param_1,param_1 + 0xbc,param_2 + -1);
  FUN_1401ca170(param_1,param_1 + 0x9b0,param_3 + -1);
  return;
}



void FUN_1401ca950(longlong param_1,longlong param_2,longlong param_3)

{
  byte bVar1;
  byte bVar2;
  int iVar3;
  int iVar4;
  byte bVar5;
  ulonglong uVar6;
  longlong lVar7;
  uint uVar8;
  uint uVar9;
  ushort uVar10;
  uint uVar11;
  ushort uVar12;
  longlong lVar13;
  
  uVar8 = 0;
  if (*(int *)(param_1 + 0x16f4) != 0) {
    lVar13 = 0;
    do {
      uVar6 = (ulonglong)uVar8;
      lVar13 = lVar13 + 2;
      uVar10 = *(ushort *)(*(longlong *)(param_1 + 0x16f8) + -2 + lVar13);
      uVar8 = uVar8 + 1;
      bVar1 = *(byte *)(uVar6 + *(longlong *)(param_1 + 0x16e8));
      iVar3 = *(int *)(param_1 + 0x1714);
      bVar5 = (byte)iVar3;
      if (uVar10 == 0) {
        lVar7 = (longlong)(int)(uint)bVar1;
        uVar11 = (uint)*(ushort *)(param_2 + 2 + lVar7 * 4);
        if ((int)(0x10 - uVar11) < iVar3) {
          uVar10 = *(ushort *)(param_2 + lVar7 * 4);
          *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | uVar10 << (bVar5 & 0x1f);
          *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
               *(undefined1 *)(param_1 + 0x1710);
          *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
               *(undefined1 *)(param_1 + 0x1711);
          *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
          iVar3 = *(int *)(param_1 + 0x1714) + -0x10 + uVar11;
          *(ushort *)(param_1 + 0x1710) =
               uVar10 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
        }
        else {
          *(ushort *)(param_1 + 0x1710) =
               *(ushort *)(param_1 + 0x1710) | *(short *)(param_2 + lVar7 * 4) << (bVar5 & 0x1f);
          iVar3 = iVar3 + uVar11;
        }
LAB_1401cacd7:
        *(int *)(param_1 + 0x1714) = iVar3;
      }
      else {
        bVar2 = (&DAT_1402691a0)[bVar1];
        uVar11 = bVar2 + 0x101;
        uVar9 = (uint)*(ushort *)(param_2 + 2 + (ulonglong)uVar11 * 4);
        if ((int)(0x10 - uVar9) < iVar3) {
          uVar12 = *(ushort *)(param_2 + (ulonglong)uVar11 * 4);
          *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | uVar12 << (bVar5 & 0x1f);
          *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
               *(undefined1 *)(param_1 + 0x1710);
          *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
               *(undefined1 *)(param_1 + 0x1711);
          *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
          iVar3 = *(int *)(param_1 + 0x1714) + -0x10;
          *(ushort *)(param_1 + 0x1710) =
               uVar12 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
        }
        else {
          *(ushort *)(param_1 + 0x1710) =
               *(ushort *)(param_1 + 0x1710) |
               *(short *)(param_2 + (ulonglong)uVar11 * 4) << (bVar5 & 0x1f);
        }
        iVar3 = iVar3 + uVar9;
        *(int *)(param_1 + 0x1714) = iVar3;
        iVar4 = *(int *)(&DAT_140268930 + (ulonglong)bVar2 * 4);
        if (iVar4 != 0) {
          uVar12 = (ushort)bVar1 - (short)*(undefined4 *)(&DAT_1402692a0 + (ulonglong)bVar2 * 4);
          if (0x10 - iVar4 < iVar3) {
            *(ushort *)(param_1 + 0x1710) =
                 *(ushort *)(param_1 + 0x1710) | uVar12 << ((byte)iVar3 & 0x1f);
            *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                 *(undefined1 *)(param_1 + 0x1710);
            *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
            *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                 *(undefined1 *)(param_1 + 0x1711);
            *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
            iVar3 = *(int *)(param_1 + 0x1714) + -0x10;
            *(ushort *)(param_1 + 0x1710) =
                 uVar12 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
          }
          else {
            *(ushort *)(param_1 + 0x1710) =
                 *(ushort *)(param_1 + 0x1710) | uVar12 << ((byte)iVar3 & 0x1f);
          }
          *(int *)(param_1 + 0x1714) = iVar3 + iVar4;
        }
        uVar11 = uVar10 - 1;
        if (uVar11 < 0x100) {
          bVar1 = (&DAT_140268fa0)[uVar11];
        }
        else {
          bVar1 = (&DAT_140268fa0)[(uVar11 >> 7) + 0x100];
        }
        uVar6 = (ulonglong)bVar1;
        uVar9 = (uint)*(ushort *)(param_3 + 2 + uVar6 * 4);
        iVar4 = *(int *)(param_1 + 0x1714);
        if ((int)(0x10 - uVar9) < iVar4) {
          uVar10 = *(ushort *)(param_3 + uVar6 * 4);
          *(ushort *)(param_1 + 0x1710) =
               *(ushort *)(param_1 + 0x1710) | uVar10 << ((byte)iVar4 & 0x1f);
          *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
               *(undefined1 *)(param_1 + 0x1710);
          *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
               *(undefined1 *)(param_1 + 0x1711);
          *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
          iVar4 = *(int *)(param_1 + 0x1714) + -0x10;
          *(ushort *)(param_1 + 0x1710) =
               uVar10 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
        }
        else {
          *(ushort *)(param_1 + 0x1710) =
               *(ushort *)(param_1 + 0x1710) |
               *(short *)(param_3 + uVar6 * 4) << ((byte)iVar4 & 0x1f);
        }
        iVar4 = iVar4 + uVar9;
        *(int *)(param_1 + 0x1714) = iVar4;
        iVar3 = *(int *)(&DAT_1402689b0 + uVar6 * 4);
        if (iVar3 != 0) {
          uVar10 = (short)uVar11 - (short)*(undefined4 *)(&DAT_140269320 + uVar6 * 4);
          if (0x10 - iVar3 < iVar4) {
            *(ushort *)(param_1 + 0x1710) =
                 *(ushort *)(param_1 + 0x1710) | uVar10 << ((byte)iVar4 & 0x1f);
            *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                 *(undefined1 *)(param_1 + 0x1710);
            *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
            *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                 *(undefined1 *)(param_1 + 0x1711);
            *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
            iVar3 = *(int *)(param_1 + 0x1714) + -0x10 + iVar3;
            *(ushort *)(param_1 + 0x1710) =
                 uVar10 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
          }
          else {
            iVar3 = iVar4 + iVar3;
            *(ushort *)(param_1 + 0x1710) =
                 *(ushort *)(param_1 + 0x1710) | uVar10 << ((byte)iVar4 & 0x1f);
          }
          goto LAB_1401cacd7;
        }
      }
    } while (uVar8 < *(uint *)(param_1 + 0x16f4));
  }
  uVar10 = *(ushort *)(param_2 + 0x402);
  iVar3 = *(int *)(param_1 + 0x1714);
  if ((int)(0x10 - (uint)uVar10) < iVar3) {
    uVar12 = *(ushort *)(param_2 + 0x400);
    *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | uVar12 << ((byte)iVar3 & 0x1f);
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1711);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    iVar3 = *(int *)(param_1 + 0x1714) + -0x10;
    *(ushort *)(param_1 + 0x1710) = uVar12 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
  }
  else {
    *(ushort *)(param_1 + 0x1710) =
         *(ushort *)(param_1 + 0x1710) | *(short *)(param_2 + 0x400) << ((byte)iVar3 & 0x1f);
  }
  *(uint *)(param_1 + 0x1714) = iVar3 + (uint)uVar10;
  *(uint *)(param_1 + 0x170c) = (uint)*(ushort *)(param_2 + 0x402);
  return;
}



undefined8 FUN_1401cadc0(longlong param_1)

{
  short *psVar1;
  longlong lVar2;
  ulonglong uVar3;
  
  lVar2 = 0;
  uVar3 = 0xf3ffc07f;
  psVar1 = (short *)(param_1 + 0xbc);
  while (((uVar3 & 1) == 0 || (*psVar1 == 0))) {
    lVar2 = lVar2 + 1;
    psVar1 = psVar1 + 2;
    uVar3 = uVar3 >> 1;
    if (0x1f < lVar2) {
      if (((*(short *)(param_1 + 0xe0) == 0) && (*(short *)(param_1 + 0xe4) == 0)) &&
         (*(short *)(param_1 + 0xf0) == 0)) {
        lVar2 = 0x20;
        psVar1 = (short *)(param_1 + 0x13c);
        while (*psVar1 == 0) {
          lVar2 = lVar2 + 1;
          psVar1 = psVar1 + 2;
          if (0xff < lVar2) {
            return 0;
          }
        }
      }
      return 1;
    }
  }
  return 0;
}



void FUN_1401cae40(longlong param_1)

{
  if (*(int *)(param_1 + 0x1714) == 0x10) {
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1711);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined4 *)(param_1 + 0x1714) = 0;
    *(undefined2 *)(param_1 + 0x1710) = 0;
    return;
  }
  if (7 < *(int *)(param_1 + 0x1714)) {
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(int *)(param_1 + 0x1714) = *(int *)(param_1 + 0x1714) + -8;
    *(ushort *)(param_1 + 0x1710) = (ushort)*(byte *)(param_1 + 0x1711);
  }
  return;
}



void FUN_1401caed0(longlong param_1,undefined1 *param_2,int param_3,int param_4)

{
  undefined1 uVar1;
  byte bVar2;
  
  if (*(int *)(param_1 + 0x1714) < 9) {
    if (*(int *)(param_1 + 0x1714) < 1) goto LAB_1401caf2a;
    uVar1 = *(undefined1 *)(param_1 + 0x1710);
  }
  else {
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    uVar1 = *(undefined1 *)(param_1 + 0x1711);
  }
  *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) = uVar1;
  *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
LAB_1401caf2a:
  *(undefined4 *)(param_1 + 0x170c) = 8;
  *(undefined2 *)(param_1 + 0x1710) = 0;
  *(undefined4 *)(param_1 + 0x1714) = 0;
  if (param_4 != 0) {
    *(byte *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) = (byte)param_3;
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    bVar2 = (byte)((uint)param_3 >> 8);
    *(byte *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) = bVar2;
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(byte *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) = ~(byte)param_3
    ;
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(byte *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) = ~bVar2;
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
  }
  for (; param_3 != 0; param_3 = param_3 + -1) {
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) = *param_2
    ;
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    param_2 = param_2 + 1;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

undefined8
FUN_1401cafe0(int param_1,ushort *param_2,uint param_3,longlong *param_4,uint *param_5,
             undefined *param_6)

{
  uint uVar1;
  byte bVar2;
  ushort uVar4;
  uint uVar5;
  ushort *puVar6;
  undefined8 uVar7;
  byte bVar8;
  longlong lVar9;
  ulonglong uVar10;
  uint uVar11;
  ulonglong uVar12;
  uint uVar13;
  ulonglong uVar14;
  int iVar15;
  ulonglong uVar16;
  uint uVar17;
  int iVar18;
  int iVar19;
  uint uVar20;
  uint uVar21;
  byte bVar22;
  bool bVar23;
  undefined4 local_d8;
  uint local_d0;
  uint local_cc;
  undefined *local_b0;
  undefined *local_a8;
  ushort local_88 [15];
  ushort local_6a [17];
  ulonglong local_48;
  char cVar3;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)&local_d8;
  uVar16 = 0;
  puVar6 = local_88;
  for (lVar9 = 0x10; lVar9 != 0; lVar9 = lVar9 + -1) {
    *puVar6 = 0;
    puVar6 = puVar6 + 1;
  }
  if (param_3 != 0) {
    uVar12 = (ulonglong)param_3;
    puVar6 = param_2;
    do {
      uVar4 = *puVar6;
      puVar6 = puVar6 + 1;
      local_88[uVar4] = local_88[uVar4] + 1;
      uVar12 = uVar12 - 1;
    } while (uVar12 != 0);
  }
  uVar20 = 0xf;
  puVar6 = local_6a;
  uVar12 = 0xffffffff;
  do {
    if (*puVar6 != 0) break;
    uVar20 = uVar20 - 1;
    puVar6 = puVar6 + -1;
  } while (uVar20 != 0);
  uVar1 = *param_5;
  if (uVar20 < *param_5) {
    uVar1 = uVar20;
  }
  if (uVar20 == 0) {
    *(undefined4 *)*param_4 = 0x140;
    *param_4 = *param_4 + 4;
    *(undefined4 *)*param_4 = 0x140;
    *param_4 = *param_4 + 4;
    *param_5 = 1;
    uVar7 = 0;
  }
  else {
    uVar21 = 1;
    if (1 < uVar20) {
      puVar6 = local_88;
      do {
        puVar6 = puVar6 + 1;
        if (*puVar6 != 0) break;
        uVar21 = uVar21 + 1;
      } while (uVar21 < uVar20);
    }
    iVar15 = 1;
    if (uVar1 < uVar21) {
      uVar1 = uVar21;
    }
    uVar10 = 1;
    do {
      iVar15 = iVar15 * 2 - (uint)local_88[uVar10];
      if (iVar15 < 0) goto LAB_1401cb48c;
      uVar11 = (int)uVar10 + 1;
      uVar10 = (ulonglong)uVar11;
    } while (uVar11 < 0x10);
    if ((iVar15 < 1) || ((param_1 != 0 && (uVar20 == 1)))) {
      local_6a[2] = 0;
      lVar9 = 0xe;
      uVar10 = uVar16;
      do {
        lVar9 = lVar9 + -1;
        *(short *)((longlong)local_6a + uVar10 + 6) =
             *(short *)((longlong)local_88 + uVar10 + 2) +
             *(short *)((longlong)local_6a + uVar10 + 4);
        uVar10 = uVar10 + 2;
      } while (lVar9 != 0);
      puVar6 = param_2;
      uVar10 = uVar16;
      if (param_3 != 0) {
        do {
          if (*puVar6 != 0) {
            *(short *)(param_6 + (ulonglong)local_6a[(ulonglong)*puVar6 + 1] * 2) = (short)uVar10;
            local_6a[(ulonglong)*puVar6 + 1] = local_6a[(ulonglong)*puVar6 + 1] + 1;
          }
          uVar11 = (int)uVar10 + 1;
          puVar6 = puVar6 + 1;
          uVar10 = (ulonglong)uVar11;
        } while (uVar11 < param_3);
      }
      if (param_1 == 0) {
        local_a8 = param_6;
        local_b0 = param_6;
        iVar15 = 0x13;
      }
      else if (param_1 == 1) {
        iVar15 = 0x100;
        local_b0 = &DAT_1402691c6;
        local_a8 = &DAT_140269206;
      }
      else {
        iVar15 = -1;
        local_b0 = &DAT_140269450;
        local_a8 = &DAT_140269490;
      }
      bVar8 = (byte)uVar1;
      local_cc = 1 << (bVar8 & 0x1f);
      uVar14 = (ulonglong)local_cc;
      local_d0 = 0;
      lVar9 = *param_4;
      uVar5 = local_cc - 1;
      uVar10 = uVar16;
      uVar11 = 0;
      if (param_1 == 1) {
        uVar12 = 0xffffffff;
        if (local_cc < 0x354) {
LAB_1401cb250:
          do {
            do {
              cVar3 = (char)uVar21;
              bVar22 = (byte)uVar11;
              bVar2 = cVar3 - bVar22;
              uVar4 = *(ushort *)(param_6 + uVar10 * 2);
              if ((int)(uint)uVar4 < iVar15) {
                local_d8._0_2_ = (ushort)bVar2 << 8;
              }
              else if (iVar15 < (int)(uint)uVar4) {
                local_d8._0_2_ =
                     CONCAT11(bVar2,local_a8[(ulonglong)*(ushort *)(param_6 + uVar10 * 2) * 2]);
                uVar4 = *(ushort *)(local_b0 + (ulonglong)*(ushort *)(param_6 + uVar10 * 2) * 2);
              }
              else {
                local_d8 = CONCAT31((uint3)bVar2,0x60);
                uVar4 = 0;
              }
              uVar13 = (uint)uVar16;
              local_d8 = CONCAT22(uVar4,(ushort)local_d8);
              iVar18 = 1 << (cVar3 - bVar22 & 0x1f);
              uVar10 = (ulonglong)((uVar13 >> (bVar22 & 0x1f)) + (int)uVar14);
              uVar16 = uVar14;
              do {
                uVar10 = (ulonglong)(uint)((int)uVar10 - iVar18);
                uVar17 = (int)uVar16 - iVar18;
                uVar16 = (ulonglong)uVar17;
                *(uint *)(lVar9 + uVar10 * 4) = local_d8;
              } while (uVar17 != 0);
              for (uVar17 = 1 << (cVar3 - 1U & 0x1f); (uVar13 & uVar17) != 0; uVar17 = uVar17 >> 1)
              {
              }
              if (uVar17 == 0) {
                uVar16 = 0;
              }
              else {
                uVar16 = (ulonglong)(uVar17 + (uVar17 - 1 & uVar13));
              }
              local_d0 = local_d0 + 1;
              uVar10 = (ulonglong)local_d0;
              puVar6 = local_88 + uVar21;
              *puVar6 = *puVar6 - 1;
              uVar13 = (uint)uVar16;
              if (*puVar6 == 0) {
                if (uVar21 == uVar20) {
                  local_d8._0_2_ = CONCAT11(cVar3 - bVar22,0x40);
                  local_d8 = (uint)(ushort)local_d8;
                  goto joined_r0x0001401cb41c;
                }
                uVar21 = (uint)param_2[*(ushort *)(param_6 + uVar10 * 2)];
              }
            } while (uVar21 <= uVar1);
            uVar13 = uVar5 & uVar13;
          } while (uVar13 == (uint)uVar12);
          if (uVar11 == 0) {
            uVar11 = uVar1;
          }
          lVar9 = lVar9 + uVar14 * 4;
          iVar19 = uVar21 - uVar11;
          uVar17 = uVar11 + iVar19;
          for (iVar18 = 1 << ((byte)iVar19 & 0x1f);
              (uVar17 < uVar20 &&
              (uVar12 = (ulonglong)uVar17, 0 < (int)(iVar18 - (uint)local_88[uVar12])));
              iVar18 = (iVar18 - (uint)local_88[uVar12]) * 2) {
            uVar17 = uVar17 + 1;
            iVar19 = iVar19 + 1;
          }
          uVar17 = 1 << ((byte)iVar19 & 0x1f);
          uVar14 = (ulonglong)uVar17;
          local_cc = local_cc + uVar17;
          if (param_1 == 1) {
            bVar23 = local_cc < 0x354;
LAB_1401cb3be:
            if (!bVar23) goto LAB_1401cb22a;
          }
          else if (param_1 == 2) {
            bVar23 = local_cc < 0x250;
            goto LAB_1401cb3be;
          }
          uVar12 = (ulonglong)uVar13;
          *(byte *)(*param_4 + (ulonglong)uVar13 * 4) = (byte)iVar19;
          *(byte *)(*param_4 + 1 + uVar12 * 4) = bVar8;
          *(short *)(*param_4 + 2 + uVar12 * 4) = (short)(lVar9 - *param_4 >> 2);
          uVar10 = (ulonglong)local_d0;
          goto LAB_1401cb250;
        }
      }
      else if ((param_1 != 2) || (uVar16 = 0, uVar10 = 0, uVar11 = 0, local_cc < 0x250))
      goto LAB_1401cb250;
LAB_1401cb22a:
      uVar7 = 1;
    }
    else {
LAB_1401cb48c:
      uVar7 = 0xffffffff;
    }
  }
  return uVar7;
joined_r0x0001401cb41c:
  if (uVar13 == 0) {
LAB_1401cb478:
    *param_4 = *param_4 + (ulonglong)local_cc * 4;
    *param_5 = uVar1;
    return 0;
  }
  uVar20 = (uint)uVar16;
  if ((uVar11 != 0) && ((uVar5 & uVar20) != (uint)uVar12)) {
    lVar9 = *param_4;
    local_d8._0_2_ = CONCAT11(bVar8,(undefined1)local_d8);
    local_d8 = (uint)(ushort)local_d8;
    uVar21 = uVar1;
    uVar11 = 0;
  }
  *(uint *)(lVar9 + (uVar16 >> ((byte)uVar11 & 0x3f)) * 4) = local_d8;
  for (uVar13 = 1 << ((char)uVar21 - 1U & 0x1f); (uVar20 & uVar13) != 0; uVar13 = uVar13 >> 1) {
  }
  if (uVar13 == 0) goto LAB_1401cb478;
  uVar13 = (uVar20 & uVar13 - 1) + uVar13;
  uVar16 = (ulonglong)uVar13;
  goto joined_r0x0001401cb41c;
}



void FUN_1401cb4c0(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x170c) = 8;
  *(longlong *)(param_1 + 0xb40) = param_1 + 0xbc;
  *(undefined ***)(param_1 + 0xb50) = &PTR_DAT_14030c890;
  *(longlong *)(param_1 + 0xb58) = param_1 + 0x9b0;
  *(undefined ***)(param_1 + 0xb68) = &PTR_DAT_14030c8b0;
  *(longlong *)(param_1 + 0xb70) = param_1 + 0xaa4;
  *(undefined **)(param_1 + 0xb80) = &DAT_14030c8d0;
  *(undefined2 *)(param_1 + 0x1710) = 0;
  *(undefined4 *)(param_1 + 0x1714) = 0;
  FUN_1401c9cf0();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

void FUN_1401cb540(longlong param_1,int param_2,longlong param_3)

{
  longlong lVar1;
  ushort uVar2;
  ulonglong uVar3;
  uint uVar4;
  ulonglong uVar5;
  uint uVar6;
  ulonglong uVar7;
  short sVar8;
  uint uVar9;
  longlong lVar10;
  ulonglong uVar11;
  short sStack_3a;
  ushort auStack_38 [16];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_38;
  sVar8 = 0;
  lVar10 = 1;
  do {
    lVar1 = lVar10 * 2;
    lVar10 = lVar10 + 1;
    sVar8 = (sVar8 + *(short *)(param_3 + lVar1 + -2)) * 2;
    (&sStack_3a)[lVar10] = sVar8;
  } while (lVar10 < 0x10);
  uVar11 = 0;
  if (-1 < param_2) {
    do {
      uVar2 = *(ushort *)(param_1 + 2 + uVar11 * 4);
      uVar7 = (ulonglong)uVar2;
      if (uVar2 != 0) {
        uVar2 = auStack_38[uVar7];
        auStack_38[uVar7] = uVar2 + 1;
        uVar3 = 0;
        uVar9 = (uint)uVar2;
        do {
          uVar5 = uVar3;
          uVar6 = (int)uVar7 - 1;
          uVar7 = (ulonglong)uVar6;
          uVar4 = uVar9 & 1;
          uVar3 = (ulonglong)(((uint)uVar5 | uVar4) * 2);
          uVar9 = uVar9 >> 1;
        } while (0 < (int)uVar6);
        *(ushort *)(param_1 + uVar11 * 4) = (ushort)uVar5 | (ushort)uVar4;
      }
      uVar11 = uVar11 + 1;
    } while ((longlong)uVar11 <= (longlong)param_2);
  }
  return;
}



void FUN_1401cb5f0(longlong param_1,longlong *param_2)

{
  byte bVar1;
  longlong lVar2;
  byte bVar3;
  int iVar4;
  longlong lVar5;
  longlong lVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  ulonglong uVar10;
  
  lVar2 = *param_2;
  iVar4 = *(int *)(param_2[2] + 0x14);
  uVar10 = (ulonglong)iVar4;
  lVar6 = *(longlong *)param_2[2];
  iVar7 = -1;
  *(undefined4 *)(param_1 + 0x149c) = 0;
  *(undefined4 *)(param_1 + 0x14a0) = 0x23d;
  iVar8 = 0;
  lVar5 = 0;
  if (0 < iVar4) {
    do {
      if (*(short *)(lVar2 + lVar5 * 4) == 0) {
        *(undefined2 *)(lVar2 + 2 + lVar5 * 4) = 0;
      }
      else {
        *(int *)(param_1 + 0x149c) = *(int *)(param_1 + 0x149c) + 1;
        *(int *)(param_1 + 0xba8 + (longlong)*(int *)(param_1 + 0x149c) * 4) = iVar8;
        *(undefined1 *)(lVar5 + 0x14a4 + param_1) = 0;
        iVar7 = iVar8;
      }
      lVar5 = lVar5 + 1;
      iVar8 = iVar8 + 1;
    } while (lVar5 < (longlong)uVar10);
  }
  iVar4 = *(int *)(param_1 + 0x149c);
  while (iVar4 < 2) {
    if (iVar7 < 2) {
      iVar7 = iVar7 + 1;
      iVar4 = iVar7;
    }
    else {
      iVar4 = 0;
    }
    *(int *)(param_1 + 0x149c) = *(int *)(param_1 + 0x149c) + 1;
    *(int *)(param_1 + 0xba8 + (longlong)*(int *)(param_1 + 0x149c) * 4) = iVar4;
    lVar5 = (longlong)iVar4;
    *(undefined2 *)(lVar2 + lVar5 * 4) = 1;
    *(undefined1 *)(lVar5 + 0x14a4 + param_1) = 0;
    *(int *)(param_1 + 0x1700) = *(int *)(param_1 + 0x1700) + -1;
    if (lVar6 != 0) {
      *(int *)(param_1 + 0x1704) =
           *(int *)(param_1 + 0x1704) - (uint)*(ushort *)(lVar6 + 2 + lVar5 * 4);
    }
    iVar4 = *(int *)(param_1 + 0x149c);
  }
  *(int *)(param_2 + 1) = iVar7;
  for (iVar4 = *(int *)(param_1 + 0x149c) / 2; 0 < iVar4; iVar4 = iVar4 + -1) {
    FUN_1401c9d70(param_1,lVar2,iVar4);
  }
  do {
    iVar4 = *(int *)(param_1 + 0xbac);
    lVar5 = (longlong)iVar4;
    *(undefined4 *)(param_1 + 0xbac) =
         *(undefined4 *)(param_1 + 0xba8 + (longlong)*(int *)(param_1 + 0x149c) * 4);
    *(int *)(param_1 + 0x149c) = *(int *)(param_1 + 0x149c) + -1;
    FUN_1401c9d70(param_1,lVar2,1);
    *(int *)(param_1 + 0x14a0) = *(int *)(param_1 + 0x14a0) + -1;
    iVar8 = *(int *)(param_1 + 0xbac);
    lVar6 = (longlong)iVar8;
    iVar9 = (int)uVar10;
    *(int *)(param_1 + 0xba8 + (longlong)*(int *)(param_1 + 0x14a0) * 4) = iVar4;
    *(int *)(param_1 + 0x14a0) = *(int *)(param_1 + 0x14a0) + -1;
    *(int *)(param_1 + 0xba8 + (longlong)*(int *)(param_1 + 0x14a0) * 4) = iVar8;
    *(short *)(lVar2 + (longlong)iVar9 * 4) =
         *(short *)(lVar2 + lVar6 * 4) + *(short *)(lVar2 + lVar5 * 4);
    bVar3 = *(byte *)(lVar5 + 0x14a4 + param_1);
    bVar1 = *(byte *)(lVar6 + 0x14a4 + param_1);
    if (bVar3 < bVar1) {
      bVar3 = bVar1;
    }
    *(byte *)((longlong)iVar9 + 0x14a4 + param_1) = bVar3 + 1;
    *(short *)(lVar2 + 2 + lVar6 * 4) = (short)uVar10;
    *(short *)(lVar2 + 2 + lVar5 * 4) = (short)uVar10;
    *(int *)(param_1 + 0xbac) = iVar9;
    uVar10 = (ulonglong)(iVar9 + 1);
    FUN_1401c9d70(param_1,lVar2,1);
  } while (1 < *(int *)(param_1 + 0x149c));
  *(int *)(param_1 + 0x14a0) = *(int *)(param_1 + 0x14a0) + -1;
  *(undefined4 *)(param_1 + 0xba8 + (longlong)*(int *)(param_1 + 0x14a0) * 4) =
       *(undefined4 *)(param_1 + 0xbac);
  FUN_1401c9e60();
  FUN_1401cb540(lVar2,iVar7,param_1 + 0xb88);
  return;
}



int FUN_1401cb840(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  
  FUN_1401ca080(param_1,param_1 + 0xbc,*(undefined4 *)(param_1 + 0xb48));
  FUN_1401ca080();
  FUN_1401cb5f0();
  iVar2 = 0x12;
  lVar1 = 0x12;
  do {
    if (*(short *)(param_1 + 0xaa6 + (ulonglong)(byte)(&DAT_140268a80)[lVar1] * 4) != 0) break;
    lVar1 = lVar1 + -1;
    iVar2 = iVar2 + -1;
  } while (2 < lVar1);
  *(int *)(param_1 + 0x1700) = *(int *)(param_1 + 0x1700) + iVar2 * 3 + 0x11;
  return iVar2;
}



void FUN_1401cb8c0(longlong param_1,undefined8 param_2,undefined8 param_3,ushort param_4)

{
  int iVar1;
  int iVar2;
  
  iVar1 = *(int *)(param_1 + 0x1714);
  if (iVar1 < 0xe) {
    iVar2 = iVar1 + 3;
    *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | param_4 << ((byte)iVar1 & 0x1f);
  }
  else {
    *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | param_4 << ((byte)iVar1 & 0x1f);
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1711);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    iVar2 = *(int *)(param_1 + 0x1714) + -0xd;
    *(ushort *)(param_1 + 0x1710) = param_4 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
  }
  *(int *)(param_1 + 0x1714) = iVar2;
  FUN_1401caed0(param_1,param_2,param_3,1);
  return;
}



void FUN_1401cb960(longlong param_1)

{
  ushort uVar1;
  int iVar2;
  int iVar3;
  
  iVar2 = *(int *)(param_1 + 0x1714);
  *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | 2 << ((byte)iVar2 & 0x1f);
  if (iVar2 < 0xe) {
    iVar2 = iVar2 + 3;
  }
  else {
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1711);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(ushort *)(param_1 + 0x1710) = 2 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
    iVar2 = *(int *)(param_1 + 0x1714) + -0xd;
  }
  *(int *)(param_1 + 0x1714) = iVar2;
  uVar1 = 0;
  *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | 0 << ((byte)iVar2 & 0x1f);
  if (iVar2 < 10) {
    iVar2 = iVar2 + 7;
  }
  else {
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1711);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(ushort *)(param_1 + 0x1710) = 0 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
    iVar2 = *(int *)(param_1 + 0x1714) + -9;
  }
  *(int *)(param_1 + 0x1714) = iVar2;
  FUN_1401cae40(param_1);
  iVar2 = *(int *)(param_1 + 0x1714);
  if ((*(int *)(param_1 + 0x170c) - iVar2) + 0xb < 9) {
    if (iVar2 < 0xe) {
      iVar3 = iVar2 + 3;
      *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | 2 << ((byte)iVar2 & 0x1f);
    }
    else {
      *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | 2 << ((byte)iVar2 & 0x1f);
      *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
           *(undefined1 *)(param_1 + 0x1710);
      *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
      *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
           *(undefined1 *)(param_1 + 0x1711);
      *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
      iVar3 = *(int *)(param_1 + 0x1714) + -0xd;
      *(ushort *)(param_1 + 0x1710) = 2 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
    }
    *(int *)(param_1 + 0x1714) = iVar3;
    if (iVar3 < 10) {
      iVar2 = iVar3 + 7;
      *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | uVar1 << ((byte)iVar3 & 0x1f);
    }
    else {
      *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | uVar1 << ((byte)iVar3 & 0x1f);
      *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
           *(undefined1 *)(param_1 + 0x1710);
      *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
      *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
           *(undefined1 *)(param_1 + 0x1711);
      *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
      iVar2 = *(int *)(param_1 + 0x1714) + -9;
      *(ushort *)(param_1 + 0x1710) = uVar1 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
    }
    *(int *)(param_1 + 0x1714) = iVar2;
    FUN_1401cae40(param_1);
  }
  *(undefined4 *)(param_1 + 0x170c) = 7;
  return;
}



void FUN_1401cbb80(longlong *param_1,longlong param_2,int param_3,int param_4)

{
  short sVar1;
  undefined1 uVar2;
  undefined4 uVar3;
  int iVar4;
  int iVar5;
  uint uVar6;
  uint uVar7;
  undefined *puVar8;
  longlong *plVar9;
  longlong lVar10;
  
  iVar4 = 0;
  if (*(int *)((longlong)param_1 + 0xac) < 1) {
    uVar7 = param_3 + 5;
LAB_1401cbc13:
    uVar6 = uVar7;
    uVar7 = uVar6;
  }
  else {
    lVar10 = *param_1;
    if (*(int *)(lVar10 + 0x48) == 2) {
      uVar3 = FUN_1401cadc0();
      *(undefined4 *)(lVar10 + 0x48) = uVar3;
    }
    FUN_1401cb5f0(param_1,param_1 + 0x168);
    FUN_1401cb5f0(param_1,param_1 + 0x16b);
    iVar4 = FUN_1401cb840(param_1);
    uVar6 = (int)param_1[0x2e0] + 10U >> 3;
    uVar7 = *(int *)((longlong)param_1 + 0x1704) + 10U >> 3;
    if (uVar7 <= uVar6) goto LAB_1401cbc13;
  }
  if ((uVar6 < param_3 + 4U) || (param_2 == 0)) {
    sVar1 = (short)param_4;
    if (((int)param_1[0x16] == 4) || (uVar7 == uVar6)) {
      iVar4 = *(int *)((longlong)param_1 + 0x1714);
      if (iVar4 < 0xe) {
        *(ushort *)(param_1 + 0x2e2) =
             *(ushort *)(param_1 + 0x2e2) | sVar1 + 2 << ((byte)iVar4 & 0x1f);
        iVar4 = iVar4 + 3;
      }
      else {
        *(ushort *)(param_1 + 0x2e2) =
             *(ushort *)(param_1 + 0x2e2) | sVar1 + 2U << ((byte)iVar4 & 0x1f);
        *(char *)((ulonglong)*(uint *)(param_1 + 5) + param_1[2]) = (char)param_1[0x2e2];
        *(int *)(param_1 + 5) = (int)param_1[5] + 1;
        *(undefined1 *)((ulonglong)*(uint *)(param_1 + 5) + param_1[2]) =
             *(undefined1 *)((longlong)param_1 + 0x1711);
        *(int *)(param_1 + 5) = (int)param_1[5] + 1;
        iVar4 = *(int *)((longlong)param_1 + 0x1714) + -0xd;
        *(ushort *)(param_1 + 0x2e2) =
             (ushort)(sVar1 + 2U) >> (0x10U - (char)*(int *)((longlong)param_1 + 0x1714) & 0x1f);
      }
      *(int *)((longlong)param_1 + 0x1714) = iVar4;
      plVar9 = (longlong *)&DAT_140268f20;
      puVar8 = &DAT_140268aa0;
    }
    else {
      iVar5 = *(int *)((longlong)param_1 + 0x1714);
      if (iVar5 < 0xe) {
        *(ushort *)(param_1 + 0x2e2) =
             *(ushort *)(param_1 + 0x2e2) | sVar1 + 4 << ((byte)iVar5 & 0x1f);
        iVar5 = iVar5 + 3;
      }
      else {
        *(ushort *)(param_1 + 0x2e2) =
             *(ushort *)(param_1 + 0x2e2) | sVar1 + 4U << ((byte)iVar5 & 0x1f);
        *(char *)((ulonglong)*(uint *)(param_1 + 5) + param_1[2]) = (char)param_1[0x2e2];
        *(int *)(param_1 + 5) = (int)param_1[5] + 1;
        *(undefined1 *)((ulonglong)*(uint *)(param_1 + 5) + param_1[2]) =
             *(undefined1 *)((longlong)param_1 + 0x1711);
        *(int *)(param_1 + 5) = (int)param_1[5] + 1;
        iVar5 = *(int *)((longlong)param_1 + 0x1714) + -0xd;
        *(ushort *)(param_1 + 0x2e2) =
             (ushort)(sVar1 + 4U) >> (0x10U - (char)*(int *)((longlong)param_1 + 0x1714) & 0x1f);
      }
      *(int *)((longlong)param_1 + 0x1714) = iVar5;
      FUN_1401ca6e0(param_1,(int)param_1[0x169] + 1,(int)param_1[0x16c] + 1,iVar4 + 1);
      plVar9 = param_1 + 0x136;
      puVar8 = (undefined *)((longlong)param_1 + 0xbc);
    }
    FUN_1401ca950(param_1,puVar8,plVar9);
  }
  else {
    FUN_1401cb8c0(param_1,param_2,param_3,param_4);
  }
  FUN_1401c9cf0(param_1);
  if (param_4 == 0) {
    return;
  }
  if (*(int *)((longlong)param_1 + 0x1714) < 9) {
    if (*(int *)((longlong)param_1 + 0x1714) < 1) goto LAB_1401cbdd0;
    uVar2 = (undefined1)param_1[0x2e2];
  }
  else {
    *(char *)((ulonglong)*(uint *)(param_1 + 5) + param_1[2]) = (char)param_1[0x2e2];
    *(int *)(param_1 + 5) = (int)param_1[5] + 1;
    uVar2 = *(undefined1 *)((longlong)param_1 + 0x1711);
  }
  *(undefined1 *)((ulonglong)*(uint *)(param_1 + 5) + param_1[2]) = uVar2;
  *(int *)(param_1 + 5) = (int)param_1[5] + 1;
LAB_1401cbdd0:
  *(undefined2 *)(param_1 + 0x2e2) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1714) = 0;
  return;
}



int FUN_1401cbe00(byte *param_1,int param_2,code *param_3)

{
  clock_t cVar1;
  int iVar2;
  int iVar3;
  byte bVar4;
  byte bVar5;
  byte bVar6;
  int iVar7;
  
  bVar4 = 0;
  bVar5 = 0;
  iVar7 = param_2;
  while (iVar7 != 0) {
    iVar3 = 8;
    bVar6 = 0;
    iVar7 = iVar7 + -1;
    if (param_3 != (code *)0x0) {
      (*param_3)();
    }
    do {
      iVar3 = iVar3 + -1;
      do {
        cVar1 = clock();
        iVar2 = clock();
        while (cVar1 == iVar2) {
          bVar5 = bVar5 ^ 1;
          iVar2 = clock();
        }
        cVar1 = clock();
        iVar2 = clock();
        while (cVar1 == iVar2) {
          bVar4 = bVar4 ^ 1;
          iVar2 = clock();
        }
      } while (bVar5 == bVar4);
      bVar6 = bVar6 * '\x02' | bVar5;
    } while (iVar3 != 0);
    *param_1 = bVar6;
    param_1 = param_1 + 1;
  }
  return param_2;
}



DWORD FUN_1401cbee0(BYTE *param_1,DWORD param_2)

{
  BOOL BVar1;
  HCRYPTPROV local_res18 [2];
  
  local_res18[0] = 0;
  BVar1 = CryptAcquireContextW
                    (local_res18,(LPCWSTR)0x0,L"Microsoft Base Cryptographic Provider v1.0",1,
                     0xf0000020);
  if ((BVar1 == 0) &&
     (BVar1 = CryptAcquireContextW
                        (local_res18,(LPCWSTR)0x0,L"Microsoft Base Cryptographic Provider v1.0",1,
                         0xf0000028), BVar1 == 0)) {
    return 0;
  }
  BVar1 = CryptGenRandom(local_res18[0],param_2,param_1);
  if (BVar1 != 1) {
    CryptReleaseContext(local_res18[0],0);
    return 0;
  }
  CryptReleaseContext(local_res18[0],0);
  return param_2;
}



undefined8 FUN_1401cbf90(longlong param_1,undefined4 param_2,undefined8 param_3)

{
  undefined8 uVar1;
  
  if (param_1 == 0) {
    return 0x10;
  }
  uVar1 = FUN_1401cbee0();
  if ((int)uVar1 == 0) {
    uVar1 = FUN_1401cbe00(param_1,param_2,param_3);
  }
  return uVar1;
}



undefined8 FUN_1401cbff0(uint param_1)

{
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_140321040);
  if ((param_1 < 0x20) && ((&DAT_14031a330)[(longlong)(int)param_1 * 10] != 0)) {
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140321040);
    return 0;
  }
  LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140321040);
  return 0xc;
}



ulonglong FUN_1401cc050(longlong param_1,undefined4 param_2,longlong param_3,uint *param_4,
                       int param_5,int *param_6)

{
  uint uVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  ulonglong uVar5;
  undefined8 local_res8;
  undefined8 local_28;
  undefined8 local_20;
  
  if (((param_1 == 0) || (param_3 == 0)) || (param_4 == (uint *)0x0)) {
    return 0x10;
  }
  if (param_6 == (int *)0x0) {
    return 0x10;
  }
  if (param_5 == 1) {
    if (*param_6 != 1) {
      return 0xf;
    }
  }
  else if (param_5 != 0) {
    return 0x12;
  }
  uVar5 = FUN_1401d0f00(&local_res8,&local_20,&local_28,0);
  if ((int)uVar5 != 0) {
    return uVar5;
  }
  uVar1 = (*DAT_140321120)(local_res8,param_1,param_2);
  uVar5 = (ulonglong)uVar1;
  if (uVar1 == 0) {
    iVar2 = (*DAT_1403210d8)(*(undefined8 *)(param_6 + 6),local_res8);
    if (iVar2 == -1) {
      uVar5 = 0x16;
    }
    else {
      if (param_5 == 1) {
        uVar1 = (*DAT_1403211c0)(local_res8,*(undefined8 *)(param_6 + 0xe),
                                 *(undefined8 *)(param_6 + 8),local_20);
        uVar5 = (ulonglong)uVar1;
        if (uVar1 != 0) goto LAB_1401cc260;
        uVar1 = (*DAT_1403211c0)(local_res8,*(undefined8 *)(param_6 + 0x10),
                                 *(undefined8 *)(param_6 + 10),local_28);
        uVar5 = (ulonglong)uVar1;
        if (uVar1 != 0) goto LAB_1401cc260;
        uVar1 = (*DAT_140321138)(local_20,local_28,local_res8);
        uVar5 = (ulonglong)uVar1;
        if (uVar1 != 0) goto LAB_1401cc260;
        uVar1 = (*DAT_140321188)(local_res8,*(undefined8 *)(param_6 + 0xc),
                                 *(undefined8 *)(param_6 + 8),local_res8);
        uVar5 = (ulonglong)uVar1;
        if (uVar1 != 0) goto LAB_1401cc260;
        uVar1 = (*DAT_140321148)(local_res8,*(undefined8 *)(param_6 + 10),local_res8);
        uVar5 = (ulonglong)uVar1;
        if (uVar1 != 0) goto LAB_1401cc260;
        uVar1 = (*DAT_140321128)(local_res8,local_28,local_res8);
      }
      else {
        uVar1 = (*DAT_1403211c0)(local_res8,*(undefined8 *)(param_6 + 2),
                                 *(undefined8 *)(param_6 + 6),local_res8);
      }
      uVar5 = (ulonglong)uVar1;
      if (uVar1 == 0) {
        uVar1 = (*DAT_140321110)(*(undefined8 *)(param_6 + 6));
        if (*param_4 < uVar1) {
          *param_4 = uVar1;
          uVar5 = 6;
        }
        else {
          uVar3 = (*DAT_140321110)(local_res8);
          uVar4 = (*DAT_140321110)(*(undefined8 *)(param_6 + 6));
          if (uVar4 < uVar3) {
            uVar5 = 1;
          }
          else {
            *param_4 = uVar1;
            FUN_1401d0ee0(param_3,uVar1);
            iVar2 = (*DAT_140321110)(local_res8);
            uVar1 = (*DAT_140321118)(local_res8,(ulonglong)(uVar1 - iVar2) + param_3);
            uVar5 = (ulonglong)uVar1;
          }
        }
      }
    }
  }
LAB_1401cc260:
  FUN_1401d0f90(local_res8,local_20,local_28,0);
  return uVar5;
}



undefined8 FUN_1401cc2a0(undefined4 *param_1)

{
  void *pvVar1;
  longlong lVar2;
  longlong lVar3;
  
  pvVar1 = malloc(0x80);
  *(void **)(param_1 + 4) = pvVar1;
  if (pvVar1 == (void *)0x0) {
    return 0xfffffffe;
  }
  lVar2 = 0;
  do {
    lVar3 = lVar2 + 8;
    *(undefined4 *)(lVar2 + *(longlong *)(param_1 + 4)) = 0;
    *(undefined4 *)(lVar2 + 4 + *(longlong *)(param_1 + 4)) = 0;
    lVar2 = lVar3;
  } while (lVar3 < 0x80);
  *param_1 = 0;
  *(undefined8 *)(param_1 + 1) = 0x20;
  return 0;
}



void FUN_1401cc300(int *param_1)

{
  uint uVar1;
  ulonglong uVar3;
  ulonglong uVar2;
  
  if (*(longlong *)(param_1 + 4) != 0) {
    uVar2 = 0;
    uVar3 = uVar2;
    if (0 < *param_1) {
      do {
        uVar1 = (int)uVar2 + 1;
        uVar2 = (ulonglong)uVar1;
        *(undefined4 *)(uVar3 + *(longlong *)(param_1 + 4)) = 0;
        uVar3 = uVar3 + 4;
      } while ((int)uVar1 < *param_1);
    }
    free(*(void **)(param_1 + 4));
    param_1[4] = 0;
    param_1[5] = 0;
    param_1[0] = 0;
    param_1[1] = 0;
    param_1[2] = 0;
  }
  return;
}



undefined8 FUN_1401cc360(int *param_1,int *param_2)

{
  uint uVar1;
  undefined8 uVar2;
  
  if ((param_1 != param_2) && (uVar2 = FUN_1401cc3a0(), (int)uVar2 != 0)) {
    return uVar2;
  }
  uVar1 = 0;
  if (*param_2 != 0) {
    uVar1 = (uint)(param_1[2] == 0);
  }
  param_2[2] = uVar1;
  return 0;
}



undefined8 FUN_1401cc3a0(int *param_1,int *param_2)

{
  undefined8 uVar1;
  int iVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  undefined4 *puVar5;
  
  if (param_1 != param_2) {
    if ((param_2[1] < *param_1) && (uVar1 = FUN_1401d2390(param_2), (int)uVar1 != 0)) {
      return uVar1;
    }
    puVar5 = *(undefined4 **)(param_1 + 4);
    puVar4 = *(undefined4 **)(param_2 + 4);
    iVar2 = 0;
    puVar3 = puVar4;
    if (0 < *param_1) {
      do {
        iVar2 = iVar2 + 1;
        puVar4 = puVar3 + 1;
        *puVar3 = *puVar5;
        puVar5 = puVar5 + 1;
        puVar3 = puVar4;
      } while (iVar2 < *param_1);
    }
    if (iVar2 < *param_2) {
      do {
        *puVar4 = 0;
        iVar2 = iVar2 + 1;
        puVar4 = puVar4 + 1;
      } while (iVar2 < *param_2);
    }
    *param_2 = *param_1;
    param_2[2] = param_1[2];
  }
  return 0;
}



undefined8 FUN_1401cc430(int *param_1,ulonglong param_2)

{
  ulonglong uVar1;
  undefined8 uVar2;
  int iVar3;
  
  param_2 = param_2 & 0xffffffff;
  FUN_1401d2570();
  iVar3 = 0;
  do {
    uVar2 = FUN_1401d2470(param_1,4,param_1);
    if ((int)uVar2 != 0) {
      return uVar2;
    }
    iVar3 = iVar3 + 1;
    uVar1 = param_2 >> 0x1c;
    param_2 = (ulonglong)(uint)((int)param_2 << 4);
    **(uint **)(param_1 + 4) = **(uint **)(param_1 + 4) | (uint)uVar1;
    *param_1 = *param_1 + 1;
  } while (iVar3 < 8);
  FUN_1401d2430(param_1);
  return 0;
}



undefined8 FUN_1401cc4f0(longlong param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  iVar1 = *(int *)(param_1 + 8);
  if (iVar1 != *(int *)(param_2 + 8)) {
    uVar2 = 1;
    if (iVar1 == 1) {
      uVar2 = 0xffffffff;
    }
    return uVar2;
  }
  lVar3 = param_1;
  if (iVar1 == 1) {
    lVar3 = param_2;
    param_2 = param_1;
  }
  uVar2 = FUN_1401d25a0(lVar3,param_2);
  return uVar2;
}



int FUN_1401cc520(int *param_1,uint param_2)

{
  if (param_1[2] == 1) {
    return -1;
  }
  if ((*param_1 < 2) && (**(uint **)(param_1 + 4) <= param_2)) {
    return -(uint)(**(uint **)(param_1 + 4) < param_2);
  }
  return 1;
}



int FUN_1401cc550(int *param_1)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  
  iVar1 = *param_1;
  if (iVar1 != 0) {
    iVar2 = iVar1 * 0x1c + -0x1c;
    for (uVar3 = *(uint *)(*(longlong *)(param_1 + 4) + -4 + (longlong)iVar1 * 4); uVar3 != 0;
        uVar3 = uVar3 >> 1) {
      iVar2 = iVar2 + 1;
    }
    return iVar2;
  }
  return 0;
}



int FUN_1401cc580(int *param_1)

{
  uint uVar1;
  int *piVar2;
  uint uVar3;
  int iVar4;
  int iVar5;
  
  iVar5 = *param_1;
  if (iVar5 == 0) {
    return 0;
  }
  iVar4 = 0;
  if (0 < iVar5) {
    piVar2 = *(int **)(param_1 + 4);
    do {
      if (*piVar2 != 0) break;
      iVar4 = iVar4 + 1;
      piVar2 = piVar2 + 1;
    } while (iVar4 < iVar5);
  }
  iVar5 = iVar4 * 0x1c;
  uVar1 = *(uint *)(*(longlong *)(param_1 + 4) + (longlong)iVar4 * 4);
  uVar3 = uVar1 & 1;
  while (uVar3 == 0) {
    uVar3 = uVar1 & 0xf;
    iVar5 = iVar5 + *(int *)(&DAT_140269530 + (ulonglong)uVar3 * 4);
    uVar1 = uVar1 >> 4;
  }
  return iVar5;
}



undefined8 FUN_1401cc5f0(int *param_1,int param_2)

{
  int iVar1;
  undefined8 uVar2;
  
  FUN_1401d2570();
  iVar1 = param_2 / 0x1c;
  uVar2 = FUN_1401d2390(param_1,iVar1 + 1);
  if ((int)uVar2 == 0) {
    *param_1 = iVar1 + 1;
    *(int *)(*(longlong *)(param_1 + 4) + (longlong)iVar1 * 4) =
         1 << ((char)param_2 + (char)iVar1 * -0x1c & 0x1fU);
    uVar2 = 0;
  }
  return uVar2;
}



undefined8 FUN_1401cc670(int *param_1,char *param_2,int param_3)

{
  char *pcVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  undefined8 uVar5;
  char cVar6;
  
  FUN_1401d2570();
  if (0x3e < param_3 - 2U) {
    return 0xfffffffd;
  }
  cVar2 = *param_2;
  if (cVar2 == '-') {
    param_2 = param_2 + 1;
  }
  FUN_1401d2570(param_1);
  cVar6 = *param_2;
  while (cVar6 != '\0') {
    if (param_3 < 0x24) {
      iVar3 = toupper((int)cVar6);
      cVar6 = (char)iVar3;
    }
    iVar3 = 0;
    lVar4 = 0;
    do {
      if (cVar6 == PTR_s_0123456789ABCDEFGHIJKLMNOPQRSTUV_14030c8f0[lVar4]) break;
      lVar4 = lVar4 + 1;
      iVar3 = iVar3 + 1;
    } while (lVar4 < 0x40);
    if (param_3 <= iVar3) break;
    uVar5 = FUN_1401cce10(param_1,param_3,param_1);
    if ((int)uVar5 != 0) {
      return uVar5;
    }
    uVar5 = FUN_1401cca60(param_1,iVar3,param_1);
    if ((int)uVar5 != 0) {
      return uVar5;
    }
    pcVar1 = param_2 + 1;
    param_2 = param_2 + 1;
    cVar6 = *pcVar1;
  }
  if (*param_1 != 0) {
    param_1[2] = (uint)(cVar2 == '-');
  }
  return 0;
}



ulonglong FUN_1401cc770(int *param_1,undefined2 *param_2,int param_3)

{
  undefined2 *puVar1;
  uint uVar2;
  ulonglong uVar3;
  int iVar4;
  uint local_res18 [4];
  int local_38 [2];
  int local_30;
  
  if (0x3e < param_3 - 2U) {
    return 0xfffffffd;
  }
  if (*param_1 != 0) {
    uVar3 = FUN_1401d27d0(local_38,param_1);
    if ((int)uVar3 == 0) {
      iVar4 = 0;
      puVar1 = param_2;
      if (local_30 == 1) {
        puVar1 = (undefined2 *)((longlong)param_2 + 1);
        *(undefined1 *)param_2 = 0x2d;
        local_30 = 0;
        param_2 = puVar1;
      }
      while (local_38[0] != 0) {
        uVar2 = FUN_1401d2650(local_38,param_3,local_38,local_res18);
        if (uVar2 != 0) {
          FUN_1401cc300(local_38);
          return (ulonglong)uVar2;
        }
        iVar4 = iVar4 + 1;
        *(undefined *)puVar1 = PTR_s_0123456789ABCDEFGHIJKLMNOPQRSTUV_14030c8f0[local_res18[0]];
        puVar1 = (undefined2 *)((longlong)puVar1 + 1);
      }
      FUN_1401d2600(param_2,iVar4);
      *(undefined1 *)puVar1 = 0;
      FUN_1401cc300(local_38);
      uVar3 = 0;
    }
    return uVar3;
  }
  *param_2 = 0x30;
  return 0;
}



int FUN_1401cc870(void)

{
  uint uVar1;
  
  uVar1 = FUN_1401cc550();
  return ((int)(uVar1 + ((int)uVar1 >> 0x1f & 7U)) >> 3) + (uint)((uVar1 & 7) != 0);
}



ulonglong FUN_1401cc8a0(undefined8 param_1,undefined1 *param_2)

{
  uint uVar1;
  ulonglong uVar2;
  int iVar3;
  undefined1 *puVar4;
  int local_28 [4];
  undefined1 *local_18;
  
  uVar2 = FUN_1401d27d0(local_28,param_1);
  if ((int)uVar2 == 0) {
    iVar3 = 0;
    puVar4 = param_2;
    do {
      if (local_28[0] == 0) {
        FUN_1401d2600(param_2,iVar3);
        FUN_1401cc300(local_28);
        return 0;
      }
      iVar3 = iVar3 + 1;
      *puVar4 = *local_18;
      puVar4 = puVar4 + 1;
      uVar1 = FUN_1401d2800(local_28,8,local_28);
      uVar2 = (ulonglong)uVar1;
    } while (uVar1 == 0);
    FUN_1401cc300(local_28);
  }
  return uVar2;
}



undefined8 FUN_1401cc950(int *param_1,byte *param_2,int param_3)

{
  byte bVar1;
  undefined8 uVar2;
  
  if ((1 < param_1[1]) || (uVar2 = FUN_1401d2390(param_1,2), (int)uVar2 == 0)) {
    FUN_1401d2570(param_1);
    while (0 < param_3) {
      param_3 = param_3 + -1;
      uVar2 = FUN_1401d2470(param_1,8,param_1);
      if ((int)uVar2 != 0) {
        return uVar2;
      }
      bVar1 = *param_2;
      param_2 = param_2 + 1;
      **(uint **)(param_1 + 4) = **(uint **)(param_1 + 4) | (uint)bVar1;
      *param_1 = *param_1 + 1;
    }
    FUN_1401d2430(param_1);
    uVar2 = 0;
  }
  return uVar2;
}



void FUN_1401cc9e0(longlong param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  int iVar2;
  int iVar3;
  longlong lVar4;
  
  iVar1 = *(int *)(param_1 + 8);
  iVar2 = *(int *)(param_2 + 8);
  if (iVar1 == iVar2) {
    *(int *)(param_3 + 8) = iVar1;
    FUN_1401d2a80();
  }
  else {
    iVar3 = FUN_1401d25a0();
    if (iVar3 == -1) {
      *(int *)(param_3 + 8) = iVar2;
      lVar4 = param_2;
      param_2 = param_1;
    }
    else {
      *(int *)(param_3 + 8) = iVar1;
      lVar4 = param_1;
    }
    FUN_1401d2980(lVar4,param_2,param_3);
  }
  return;
}



ulonglong FUN_1401cca60(int *param_1,uint param_2,int *param_3)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  ulonglong uVar4;
  int iVar5;
  uint *puVar6;
  uint *puVar7;
  int *piVar8;
  
  if ((param_3[1] < *param_1 + 1) && (uVar4 = FUN_1401d2390(param_3), (int)uVar4 != 0)) {
    return uVar4;
  }
  if ((param_1[2] == 1) && ((1 < *param_1 || (param_2 <= **(uint **)(param_1 + 4))))) {
    param_1[2] = 0;
    uVar3 = FUN_1401ccc20(param_1,param_2,param_3);
    param_3[2] = 1;
    param_1[2] = 1;
    FUN_1401d2430(param_3);
    return (ulonglong)uVar3;
  }
  iVar1 = *param_3;
  puVar6 = *(uint **)(param_3 + 4);
  param_3[2] = 0;
  piVar8 = *(int **)(param_1 + 4);
  iVar5 = 1;
  if (param_1[2] == 0) {
    iVar2 = *piVar8;
    puVar7 = puVar6 + 1;
    *puVar6 = param_2 + iVar2 & 0xfffffff;
    uVar3 = param_2 + iVar2 >> 0x1c;
    puVar6 = puVar7;
    if (1 < *param_1) {
      do {
        piVar8 = piVar8 + 1;
        iVar2 = *piVar8;
        iVar5 = iVar5 + 1;
        puVar7 = puVar6 + 1;
        *puVar6 = uVar3 + iVar2 & 0xfffffff;
        uVar3 = uVar3 + iVar2 >> 0x1c;
        puVar6 = puVar7;
      } while (iVar5 < *param_1);
    }
    *puVar7 = uVar3;
    iVar5 = iVar5 + 1;
    *param_3 = *param_1 + 1;
    puVar6 = puVar7;
  }
  else {
    *param_3 = 1;
    if (*param_1 == 1) {
      param_2 = param_2 - **(int **)(param_1 + 4);
    }
    *puVar6 = param_2;
  }
  if (iVar5 < iVar1) {
    memset(puVar6 + 1,0,(ulonglong)(uint)(iVar1 - iVar5) << 2);
  }
  FUN_1401d2430(param_3);
  return 0;
}



void FUN_1401ccba0(longlong param_1,longlong param_2,longlong param_3)

{
  int iVar1;
  int iVar2;
  longlong lVar3;
  
  iVar1 = *(int *)(param_1 + 8);
  if (iVar1 == *(int *)(param_2 + 8)) {
    iVar2 = FUN_1401d25a0();
    if (iVar2 == -1) {
      *(uint *)(param_3 + 8) = (uint)(iVar1 == 0);
      lVar3 = param_2;
    }
    else {
      *(int *)(param_3 + 8) = iVar1;
      lVar3 = param_1;
      param_1 = param_2;
    }
    FUN_1401d2980(lVar3,param_1,param_3);
  }
  else {
    *(int *)(param_3 + 8) = iVar1;
    FUN_1401d2a80();
  }
  return;
}



ulonglong FUN_1401ccc20(int *param_1,uint param_2,int *param_3)

{
  int iVar1;
  uint uVar2;
  ulonglong uVar3;
  uint *puVar4;
  uint *_Dst;
  int iVar5;
  uint *puVar6;
  
  if ((*param_1 + 1 <= param_3[1]) || (uVar3 = FUN_1401d2390(param_3), (int)uVar3 == 0)) {
    if (param_1[2] == 1) {
      param_1[2] = 0;
      uVar2 = FUN_1401cca60(param_1,param_2,param_3);
      param_3[2] = 1;
      param_1[2] = 1;
      FUN_1401d2430(param_3);
      return (ulonglong)uVar2;
    }
    iVar5 = *param_1;
    iVar1 = *param_3;
    puVar6 = *(uint **)(param_1 + 4);
    puVar4 = *(uint **)(param_3 + 4);
    if (((iVar5 == 1) && (*puVar6 <= param_2)) || (iVar5 == 0)) {
      if (iVar5 == 1) {
        param_2 = param_2 - *puVar6;
      }
      *puVar4 = param_2;
      iVar5 = 1;
      _Dst = puVar4 + 1;
      param_3[2] = 1;
      *param_3 = 1;
    }
    else {
      param_3[2] = 0;
      iVar5 = 1;
      *param_3 = *param_1;
      _Dst = puVar4 + 1;
      param_2 = *puVar6 - param_2;
      *puVar4 = param_2 & 0xfffffff;
      puVar4 = _Dst;
      if (1 < *param_1) {
        do {
          puVar6 = puVar6 + 1;
          iVar5 = iVar5 + 1;
          _Dst = puVar4 + 1;
          param_2 = *puVar6 + ((int)param_2 >> 0x1f);
          *puVar4 = param_2 & 0xfffffff;
          puVar4 = _Dst;
        } while (iVar5 < *param_1);
      }
    }
    if (iVar5 < iVar1) {
      memset(_Dst,0,(ulonglong)(uint)(iVar1 - iVar5) << 2);
    }
    FUN_1401d2430(param_3);
    uVar3 = 0;
  }
  return uVar3;
}



void FUN_1401ccd60(int *param_1,int *param_2,int *param_3)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  uint uVar5;
  int iVar6;
  
  iVar1 = param_2[2];
  iVar6 = *param_2;
  iVar2 = param_1[2];
  iVar3 = *param_1;
  uVar5 = 0;
  iVar4 = iVar6;
  if (iVar3 < iVar6) {
    iVar4 = iVar3;
  }
  if (iVar4 < DAT_14030c900) {
    iVar4 = iVar6;
    if (iVar3 < iVar6) {
      iVar4 = iVar3;
    }
    if (iVar4 < DAT_14030c8f8) {
      iVar4 = iVar6 + 1 + iVar3;
      if (iVar4 < 0x200) {
        if (iVar3 < iVar6) {
          iVar6 = iVar3;
        }
        if (iVar6 < 0x101) {
          FUN_1401d2d10(param_1,param_2,param_3,iVar4);
          goto LAB_1401ccdf2;
        }
      }
      FUN_1401d2bb0(param_1,param_2,param_3,iVar4);
    }
    else {
      FUN_1401d2eb0(param_1,param_2,param_3);
    }
  }
  else {
    FUN_1401d3190(param_1,param_2,param_3);
  }
LAB_1401ccdf2:
  if (0 < *param_3) {
    uVar5 = (uint)(iVar2 != iVar1);
  }
  param_3[2] = uVar5;
  return;
}



undefined8 FUN_1401cce10(int *param_1,uint param_2,int *param_3)

{
  int iVar1;
  uint uVar2;
  uint uVar3;
  undefined8 uVar4;
  ulonglong uVar5;
  uint *puVar6;
  uint *puVar7;
  uint *puVar8;
  
  if ((*param_1 + 1 <= param_3[1]) || (uVar4 = FUN_1401d2390(param_3), (int)uVar4 == 0)) {
    iVar1 = *param_3;
    puVar7 = *(uint **)(param_3 + 4);
    param_3[2] = param_1[2];
    puVar8 = *(uint **)(param_1 + 4);
    uVar2 = 0;
    uVar5 = 0;
    puVar6 = puVar7;
    uVar3 = uVar2;
    if (0 < *param_1) {
      do {
        uVar3 = *puVar8;
        uVar2 = uVar2 + 1;
        puVar8 = puVar8 + 1;
        puVar7 = puVar6 + 1;
        uVar5 = (ulonglong)uVar3 * (ulonglong)param_2 + (uVar5 & 0xffffffff);
        *puVar6 = (uint)uVar5 & 0xfffffff;
        uVar5 = uVar5 >> 0x1c;
        uVar3 = (uint)uVar5;
        puVar6 = puVar7;
      } while ((int)uVar2 < *param_1);
    }
    *puVar7 = uVar3;
    if ((int)(uVar2 + 1) < iVar1) {
      memset(puVar7 + 1,0,(ulonglong)(iVar1 - (uVar2 + 1)) << 2);
    }
    *param_3 = *param_1 + 1;
    FUN_1401d2430(param_3);
    uVar4 = 0;
  }
  return uVar4;
}



void FUN_1401cced0(int *param_1,longlong param_2)

{
  int iVar1;
  
  iVar1 = *param_1;
  if (DAT_14030c904 <= iVar1) {
    FUN_1401d3eb0();
    *(undefined4 *)(param_2 + 8) = 0;
    return;
  }
  if (DAT_14030c8fc <= iVar1) {
    FUN_1401d3c70();
    *(undefined4 *)(param_2 + 8) = 0;
    return;
  }
  if ((iVar1 * 2 + 1 < 0x200) && (iVar1 < 0x80)) {
    FUN_1401d3aa0();
    *(undefined4 *)(param_2 + 8) = 0;
    return;
  }
  FUN_1401d3930();
  *(undefined4 *)(param_2 + 8) = 0;
  return;
}



ulonglong FUN_1401ccf50(int *param_1,int *param_2,longlong param_3,longlong param_4)

{
  int *piVar1;
  uint uVar2;
  int iVar3;
  uint uVar4;
  int iVar5;
  ulonglong uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  longlong lVar9;
  longlong lVar10;
  int iVar11;
  longlong lVar12;
  int local_d8 [2];
  int local_d0;
  longlong local_c8;
  int local_c0;
  int local_bc;
  int local_b8 [2];
  undefined4 local_b0;
  longlong local_a8;
  undefined4 local_a0 [4];
  undefined4 *local_90;
  int local_88 [4];
  longlong local_78;
  uint local_70;
  undefined4 local_68 [4];
  undefined4 *local_58;
  
  if (*param_2 == 0) {
    return 0xfffffffd;
  }
  iVar3 = FUN_1401d25a0();
  if (iVar3 == -1) {
    uVar6 = 0;
    if (param_4 != 0) {
      uVar4 = FUN_1401cc3a0(param_1,param_4);
      uVar6 = (ulonglong)uVar4;
    }
    if (param_3 != 0) {
      FUN_1401d2570(param_3);
    }
    return uVar6;
  }
  uVar6 = FUN_1401d45b0(local_88,*param_1 + 2);
  if ((int)uVar6 != 0) {
    return uVar6;
  }
  local_88[0] = *param_1 + 2;
  uVar4 = FUN_1401cc2a0(local_a0);
  uVar6 = (ulonglong)uVar4;
  if (uVar4 != 0) goto LAB_1401cd459;
  uVar4 = FUN_1401cc2a0(local_68);
  uVar6 = (ulonglong)uVar4;
  if (uVar4 == 0) {
    uVar4 = FUN_1401d27d0(local_d8,param_1);
    uVar6 = (ulonglong)uVar4;
    if (uVar4 == 0) {
      uVar4 = FUN_1401d27d0(local_b8,param_2);
      uVar6 = (ulonglong)uVar4;
      if (uVar4 == 0) {
        local_b0 = 0;
        local_d0 = 0;
        local_70 = (uint)(param_1[2] != param_2[2]);
        iVar3 = FUN_1401cc550(local_b8);
        if (iVar3 % 0x1c < 0x1b) {
          iVar3 = 0x1b - iVar3 % 0x1c;
          local_c0 = iVar3;
          uVar4 = FUN_1401d2470(local_d8,iVar3,local_d8);
          uVar6 = (ulonglong)uVar4;
          if (uVar4 == 0) {
            uVar4 = FUN_1401d2470(local_b8,iVar3,local_b8);
            uVar6 = (ulonglong)uVar4;
            if (uVar4 == 0) goto LAB_1401cd0ca;
          }
        }
        else {
          local_c0 = 0;
LAB_1401cd0ca:
          iVar3 = local_b8[0] + -1;
          iVar11 = local_d8[0] + -1;
          uVar4 = FUN_1401d4520(local_b8,iVar11 - iVar3);
          uVar6 = (ulonglong)uVar4;
          if (uVar4 == 0) {
            lVar10 = (longlong)iVar11;
            lVar12 = (longlong)iVar3;
            iVar5 = FUN_1401cc4f0(local_d8,local_b8);
            if (iVar5 != -1) {
              do {
                piVar1 = (int *)(local_78 + (lVar10 - lVar12) * 4);
                *piVar1 = *piVar1 + 1;
                uVar4 = FUN_1401ccba0(local_d8,local_b8,local_d8);
                uVar6 = (ulonglong)uVar4;
                if (uVar4 != 0) goto LAB_1401cd435;
                iVar5 = FUN_1401cc4f0(local_d8,local_b8);
              } while (iVar5 != -1);
            }
            FUN_1401d44a0(local_b8,iVar11 - iVar3);
            local_bc = local_b8[0];
            iVar5 = local_b8[0];
            if (local_b8[0] <= iVar11) {
              do {
                if (iVar11 <= local_d8[0]) {
                  uVar4 = *(uint *)(local_c8 + lVar10 * 4);
                  uVar2 = *(uint *)(local_a8 + lVar12 * 4);
                  if (uVar4 == uVar2) {
                    lVar9 = (lVar10 - lVar12) * 4 + -4;
                    *(undefined4 *)(lVar9 + local_78) = 0xfffffff;
                  }
                  else {
                    uVar6 = ((ulonglong)uVar4 << 0x1c |
                            (ulonglong)*(uint *)(local_c8 + -4 + lVar10 * 4)) / (ulonglong)uVar2;
                    if (0xfffffff < uVar6) {
                      uVar6 = 0xfffffff;
                    }
                    lVar9 = (lVar10 - lVar12) * 4 + -4;
                    *(uint *)(lVar9 + local_78) = (uint)uVar6 & 0xfffffff;
                  }
                  *(uint *)(lVar9 + local_78) = *(int *)(lVar9 + local_78) + 1U & 0xfffffff;
                  do {
                    *(uint *)(lVar9 + local_78) = *(int *)(lVar9 + local_78) - 1U & 0xfffffff;
                    FUN_1401d2570(local_a0);
                    uVar7 = 0;
                    if (-1 < local_b8[0] + -2) {
                      uVar7 = *(undefined4 *)(local_a8 + -4 + lVar12 * 4);
                    }
                    *local_90 = uVar7;
                    local_90[1] = *(undefined4 *)(local_a8 + lVar12 * 4);
                    local_a0[0] = 2;
                    uVar4 = FUN_1401cce10(local_a0,*(undefined4 *)(lVar9 + local_78),local_a0);
                    uVar6 = (ulonglong)uVar4;
                    if (uVar4 != 0) goto LAB_1401cd435;
                    uVar7 = 0;
                    uVar8 = uVar7;
                    if (-1 < iVar11 + -2) {
                      uVar8 = *(undefined4 *)(local_c8 + -8 + lVar10 * 4);
                    }
                    *local_58 = uVar8;
                    if (-1 < iVar11 + -1) {
                      uVar7 = *(undefined4 *)(local_c8 + -4 + lVar10 * 4);
                    }
                    local_58[1] = uVar7;
                    local_58[2] = *(undefined4 *)(local_c8 + lVar10 * 4);
                    local_68[0] = 3;
                    iVar5 = FUN_1401d25a0(local_a0,local_68);
                  } while (iVar5 == 1);
                  uVar4 = FUN_1401cce10(local_b8,*(undefined4 *)(lVar9 + local_78),local_a0);
                  uVar6 = (ulonglong)uVar4;
                  if (uVar4 != 0) goto LAB_1401cd435;
                  uVar4 = FUN_1401d4520(local_a0,(iVar11 - iVar3) + -1);
                  uVar6 = (ulonglong)uVar4;
                  if (uVar4 != 0) goto LAB_1401cd435;
                  uVar4 = FUN_1401ccba0(local_d8,local_a0,local_d8);
                  uVar6 = (ulonglong)uVar4;
                  if (uVar4 != 0) goto LAB_1401cd435;
                  iVar5 = local_bc;
                  if (local_d0 == 1) {
                    uVar4 = FUN_1401cc3a0(local_b8,local_a0);
                    uVar6 = (ulonglong)uVar4;
                    if (uVar4 != 0) goto LAB_1401cd435;
                    uVar4 = FUN_1401d4520(local_a0,(iVar11 - iVar3) + -1);
                    uVar6 = (ulonglong)uVar4;
                    if (uVar4 != 0) goto LAB_1401cd435;
                    uVar4 = FUN_1401cc9e0(local_d8,local_a0,local_d8);
                    uVar6 = (ulonglong)uVar4;
                    if (uVar4 != 0) goto LAB_1401cd435;
                    *(uint *)(lVar9 + local_78) = *(int *)(lVar9 + local_78) - 1U & 0xfffffff;
                    iVar5 = local_bc;
                  }
                }
                iVar11 = iVar11 + -1;
                lVar10 = lVar10 + -1;
              } while (iVar5 <= iVar11);
            }
            if (local_d8[0] == 0) {
              local_d0 = 0;
            }
            else {
              local_d0 = param_1[2];
            }
            if (param_3 != 0) {
              FUN_1401d2430(local_88);
              FUN_1401d4470(local_88,param_3);
              *(uint *)(param_3 + 8) = local_70;
            }
            if (param_4 != 0) {
              FUN_1401d2800(local_d8,local_c0,local_d8,0);
              FUN_1401d4470(local_d8,param_4);
            }
            uVar6 = 0;
          }
        }
LAB_1401cd435:
        FUN_1401cc300(local_b8);
      }
      FUN_1401cc300(local_d8);
    }
    FUN_1401cc300(local_68);
  }
  FUN_1401cc300(local_a0);
LAB_1401cd459:
  FUN_1401cc300(local_88);
  return uVar6;
}



undefined8 FUN_1401cd480(int *param_1,int *param_2)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  uint *puVar4;
  undefined8 uVar5;
  uint uVar6;
  uint *puVar7;
  uint uVar8;
  
  if ((*param_1 <= param_2[1]) || (uVar5 = FUN_1401d2390(param_2), (int)uVar5 == 0)) {
    iVar1 = *param_1;
    iVar2 = *param_2;
    uVar6 = 0;
    *param_2 = iVar1;
    puVar7 = (uint *)(*(longlong *)(param_1 + 4) + -4 + (longlong)iVar1 * 4);
    puVar4 = (uint *)(*(longlong *)(param_2 + 4) + -4 + (longlong)iVar1 * 4);
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      uVar3 = *puVar7;
      uVar8 = uVar6 << 0x1b;
      puVar7 = puVar7 + -1;
      uVar6 = uVar3 & 1;
      *puVar4 = uVar3 >> 1 | uVar8;
      puVar4 = puVar4 + -1;
    }
    iVar1 = *param_2;
    if (iVar1 < iVar2) {
      memset((void *)(*(longlong *)(param_2 + 4) + (longlong)iVar1 * 4),0,
             (ulonglong)(uint)(iVar2 - iVar1) << 2);
    }
    param_2[2] = param_1[2];
    FUN_1401d2430(param_2);
    uVar5 = 0;
  }
  return uVar5;
}



void FUN_1401cd530(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_1401d2650(param_1,param_2,0,param_3);
  return;
}



ulonglong FUN_1401cd540(int *param_1,int *param_2,longlong param_3)

{
  uint uVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  ulonglong uVar5;
  int iVar6;
  int local_48 [2];
  uint local_40;
  undefined1 local_30 [8];
  uint local_28;
  
  if (*param_1 == 0) {
    uVar5 = FUN_1401d4660(param_2,param_3);
    return uVar5;
  }
  if (*param_2 == 0) {
    uVar5 = FUN_1401d4660(param_1,param_3);
    return uVar5;
  }
  uVar5 = FUN_1401d27d0(local_30,param_1);
  if ((int)uVar5 != 0) {
    return uVar5;
  }
  uVar1 = FUN_1401d27d0(local_48,param_2);
  uVar5 = (ulonglong)uVar1;
  if (uVar1 != 0) goto LAB_1401cd6ff;
  local_40 = uVar1;
  local_28 = uVar1;
  iVar2 = FUN_1401cc580(local_30);
  iVar3 = FUN_1401cc580(local_48);
  iVar6 = iVar3;
  if (iVar2 < iVar3) {
    iVar6 = iVar2;
  }
  if (iVar6 < 1) {
LAB_1401cd61f:
    if (iVar2 != iVar6) {
      uVar1 = FUN_1401d2800(local_30,iVar2 - iVar6,local_30,0);
      uVar5 = (ulonglong)uVar1;
      if (uVar1 != 0) goto LAB_1401cd6e4;
    }
    if (iVar3 != iVar6) {
      uVar1 = FUN_1401d2800(local_48,iVar3 - iVar6,local_48,0);
      uVar5 = (ulonglong)uVar1;
      if (uVar1 != 0) goto LAB_1401cd6e4;
    }
    do {
      if (local_48[0] == 0) {
        uVar1 = FUN_1401d2470(local_30,iVar6,param_3);
        uVar5 = (ulonglong)uVar1;
        if (uVar1 == 0) {
          *(undefined4 *)(param_3 + 8) = 0;
        }
        break;
      }
      iVar2 = FUN_1401d25a0(local_30,local_48);
      if (iVar2 == 1) {
        FUN_1401d4470(local_30,local_48);
      }
      uVar1 = FUN_1401d2980(local_48,local_30,local_48);
      uVar5 = (ulonglong)uVar1;
      if (uVar1 != 0) break;
      uVar4 = FUN_1401cc580(local_48);
      uVar1 = FUN_1401d2800(local_48,uVar4,local_48,0);
      uVar5 = (ulonglong)uVar1;
    } while (uVar1 == 0);
  }
  else {
    uVar1 = FUN_1401d2800(local_30,iVar6,local_30,0);
    uVar5 = (ulonglong)uVar1;
    if (uVar1 == 0) {
      uVar1 = FUN_1401d2800(local_48,iVar6,local_48,0);
      uVar5 = (ulonglong)uVar1;
      if (uVar1 == 0) goto LAB_1401cd61f;
    }
  }
LAB_1401cd6e4:
  FUN_1401cc300(local_30);
LAB_1401cd6ff:
  FUN_1401cc300(local_48);
  return uVar5;
}



ulonglong FUN_1401cd720(undefined8 param_1,undefined8 param_2,longlong param_3)

{
  uint uVar1;
  int iVar2;
  ulonglong uVar3;
  undefined1 local_38 [24];
  undefined1 local_20 [24];
  
  uVar3 = FUN_1401d46d0(local_20,local_38,0);
  if ((int)uVar3 == 0) {
    uVar1 = FUN_1401cd540(param_1,param_2,local_20);
    uVar3 = (ulonglong)uVar1;
    if (uVar1 == 0) {
      iVar2 = FUN_1401d25a0(param_1,param_2);
      if (iVar2 == -1) {
        uVar1 = FUN_1401ccf50(param_1,local_20,local_38,0);
      }
      else {
        uVar1 = FUN_1401ccf50(param_2,local_20,local_38,0);
        param_2 = param_1;
      }
      uVar3 = (ulonglong)uVar1;
      if (uVar1 == 0) {
        uVar1 = FUN_1401ccd60(param_2,local_38,param_3);
        *(undefined4 *)(param_3 + 8) = 0;
        uVar3 = (ulonglong)uVar1;
      }
    }
    FUN_1401d4690(local_20,local_38,0);
  }
  return uVar3;
}



ulonglong FUN_1401cd7f0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  uint uVar1;
  ulonglong uVar2;
  undefined1 local_28 [32];
  
  uVar2 = FUN_1401cc2a0(local_28);
  if ((int)uVar2 == 0) {
    uVar1 = FUN_1401ccd60(param_1,param_2,local_28);
    if (uVar1 == 0) {
      uVar1 = FUN_1401d4750(local_28,param_3,param_4);
    }
    uVar2 = (ulonglong)uVar1;
    FUN_1401cc300(local_28);
  }
  return uVar2;
}



ulonglong FUN_1401cd870(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  uint uVar1;
  ulonglong uVar2;
  undefined1 local_28 [32];
  
  uVar2 = FUN_1401cc2a0(local_28);
  if ((int)uVar2 == 0) {
    uVar1 = FUN_1401cced0(param_1,local_28);
    if (uVar1 == 0) {
      uVar1 = FUN_1401d4750(local_28,param_2,param_3);
    }
    uVar2 = (ulonglong)uVar1;
    FUN_1401cc300(local_28);
  }
  return uVar2;
}



undefined8 FUN_1401cd8e0(undefined8 param_1,int *param_2)

{
  undefined8 uVar1;
  
  if ((param_2[2] == 1) || (*param_2 == 0)) {
    return 0xfffffffd;
  }
  if ((0 < *param_2) && ((**(byte **)(param_2 + 4) & 1) != 0)) {
    uVar1 = FUN_1401d4c50();
    return uVar1;
  }
  uVar1 = FUN_1401d4800();
  return uVar1;
}



undefined8 FUN_1401cd910(longlong param_1,uint *param_2)

{
  uint uVar1;
  int iVar2;
  
  uVar1 = **(uint **)(param_1 + 0x10);
  if ((uVar1 & 1) == 0) {
    return 0xfffffffd;
  }
  iVar2 = (uVar1 * 2 + 4 & 8) + uVar1;
  iVar2 = iVar2 * (2 - iVar2 * uVar1);
  iVar2 = iVar2 * (2 - iVar2 * uVar1);
  *param_2 = -((2 - iVar2 * uVar1) * iVar2) & 0xfffffff;
  return 0;
}



undefined8 FUN_1401cd970(undefined8 param_1,int *param_2)

{
  int iVar1;
  int iVar2;
  undefined8 uVar3;
  
  iVar1 = FUN_1401cc550(param_2);
  iVar1 = iVar1 % 0x1c;
  if (*param_2 < 2) {
    iVar1 = 1;
    FUN_1401d4fd0(param_1,1);
  }
  else {
    uVar3 = FUN_1401cc5f0(param_1,*param_2 * 0x1c + -0x1d + iVar1);
    if ((int)uVar3 != 0) {
      return uVar3;
    }
  }
  iVar1 = iVar1 + -1;
  while( true ) {
    if (0x1b < iVar1) {
      return 0;
    }
    uVar3 = FUN_1401d4f20(param_1,param_1);
    if ((int)uVar3 != 0) break;
    iVar2 = FUN_1401d25a0(param_1,param_2);
    if ((iVar2 != -1) && (uVar3 = FUN_1401d2980(param_1,param_2,param_1), (int)uVar3 != 0)) {
      return uVar3;
    }
    iVar1 = iVar1 + 1;
  }
  return uVar3;
}



undefined8 FUN_1401cda40(int *param_1,int *param_2,int param_3)

{
  int iVar1;
  int iVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  uint *puVar5;
  uint *puVar6;
  int iVar7;
  uint *puVar8;
  uint uVar9;
  int iVar10;
  longlong lVar11;
  
  iVar2 = *param_2 * 2 + 1;
  if ((iVar2 < 0x200) && (*param_2 < 0x100)) {
    uVar3 = FUN_1401d5010();
    return uVar3;
  }
  if ((iVar2 <= param_1[1]) || (uVar3 = FUN_1401d2390(param_1,iVar2), (int)uVar3 == 0)) {
    *param_1 = iVar2;
    iVar2 = *param_2;
    iVar10 = 0;
    if (0 < iVar2) {
      lVar11 = 0;
      do {
        puVar8 = *(uint **)(param_2 + 4);
        iVar1 = *(int *)(lVar11 + *(longlong *)(param_1 + 4));
        uVar4 = 0;
        iVar7 = 0;
        if (0 < iVar2) {
          puVar5 = (uint *)(*(longlong *)(param_1 + 4) + (longlong)iVar10 * 4);
          do {
            uVar9 = *puVar8;
            iVar7 = iVar7 + 1;
            puVar6 = puVar5 + 1;
            puVar8 = puVar8 + 1;
            uVar4 = (ulonglong)uVar9 * (ulonglong)(iVar1 * param_3 & 0xfffffff) + (ulonglong)*puVar5
                    + (uVar4 & 0xffffffff);
            *puVar5 = (uint)uVar4 & 0xfffffff;
            uVar4 = uVar4 >> 0x1c;
            puVar5 = puVar6;
          } while (iVar7 < *param_2);
          for (uVar9 = (uint)uVar4; uVar9 != 0; uVar9 = uVar9 >> 0x1c) {
            *puVar6 = *puVar6 + (int)uVar4;
            uVar9 = *puVar6;
            *puVar6 = *puVar6 & 0xfffffff;
            puVar6 = puVar6 + 1;
            uVar4 = (ulonglong)(uVar9 >> 0x1c);
          }
        }
        iVar2 = *param_2;
        iVar10 = iVar10 + 1;
        lVar11 = lVar11 + 4;
      } while (iVar10 < iVar2);
    }
    FUN_1401d2430(param_1);
    FUN_1401d44a0(param_1,*param_2);
    iVar2 = FUN_1401d25a0(param_1,param_2);
    if (iVar2 != -1) {
      uVar3 = FUN_1401d2980(param_1,param_2,param_1);
      return uVar3;
    }
    uVar3 = 0;
  }
  return uVar3;
}



ulonglong FUN_1401cdbb0(undefined8 param_1,longlong param_2,int *param_3,undefined8 param_4)

{
  uint uVar1;
  int iVar2;
  ulonglong uVar3;
  undefined4 uVar4;
  undefined1 local_38 [24];
  undefined1 local_20 [24];
  
  if (param_3[2] == 1) {
    uVar3 = 0xfffffffd;
  }
  else if (*(int *)(param_2 + 8) == 1) {
    uVar3 = FUN_1401cc2a0(local_38);
    if ((int)uVar3 == 0) {
      uVar1 = FUN_1401cd8e0(param_1,param_3,local_38);
      if ((uVar1 == 0) && (uVar1 = FUN_1401cc2a0(local_20), uVar1 == 0)) {
        uVar1 = FUN_1401d4660(param_2,local_20);
        if (uVar1 != 0) {
          FUN_1401d4690(local_38,local_20,0);
          return (ulonglong)uVar1;
        }
        uVar1 = FUN_1401cdbb0(local_38,local_20,param_3,param_4);
        FUN_1401d4690(local_38,local_20,0);
        return (ulonglong)uVar1;
      }
      uVar3 = (ulonglong)uVar1;
      FUN_1401cc300(local_38);
    }
  }
  else {
    iVar2 = FUN_1401d5e50(param_3);
    if (iVar2 == 1) {
      uVar4 = 1;
    }
    else {
      iVar2 = FUN_1401d5890(param_3);
      if (iVar2 == 0) {
        iVar2 = FUN_1401d5820(param_3);
        iVar2 = iVar2 * 2;
      }
      if (((0 < *param_3) && ((**(byte **)(param_3 + 4) & 1) != 0)) || (iVar2 != 0)) {
        uVar3 = FUN_1401d5260(param_1,param_2,param_3,param_4,iVar2);
        return uVar3;
      }
      uVar4 = 0;
    }
    uVar3 = FUN_1401d58d0(param_1,param_2,param_3,param_4,uVar4);
  }
  return uVar3;
}



ulonglong FUN_1401cdd10(undefined8 param_1,int param_2,undefined4 *param_3)

{
  int iVar1;
  uint uVar2;
  ulonglong uVar3;
  longlong lVar4;
  undefined4 *puVar5;
  int local_res10 [2];
  undefined1 local_48 [32];
  
  lVar4 = 0;
  *param_3 = 0;
  if (0xff < param_2 - 1U) {
    return 0xfffffffd;
  }
  puVar5 = &DAT_14026df80;
  do {
    iVar1 = FUN_1401cc520(param_1,*puVar5);
    if (iVar1 == 0) {
      *param_3 = 1;
      goto LAB_1401cde1c;
    }
    puVar5 = puVar5 + 1;
  } while ((longlong)puVar5 < 0x14026e380);
  uVar3 = FUN_1401d6060(param_1,local_res10);
  if ((int)uVar3 == 0) {
    if (local_res10[0] == 1) {
LAB_1401cde1c:
      uVar3 = 0;
    }
    else {
      uVar3 = FUN_1401cc2a0(local_48);
      if ((int)uVar3 == 0) {
        uVar3 = uVar3 & 0xffffffff;
        if (0 < (longlong)param_2) {
          do {
            FUN_1401d4fd0(local_48,(&DAT_14026df80)[lVar4]);
            uVar2 = FUN_1401d5ea0(param_1,local_48,local_res10);
            uVar3 = (ulonglong)uVar2;
            if ((uVar2 != 0) || (local_res10[0] == 0)) goto LAB_1401cddec;
            lVar4 = lVar4 + 1;
          } while (lVar4 < param_2);
        }
        *param_3 = 1;
LAB_1401cddec:
        FUN_1401cc300(local_48);
      }
    }
  }
  return uVar3;
}



undefined8 FUN_1401cde30(undefined1 *param_1,int param_2,int param_3,uint *param_4)

{
  byte bVar1;
  byte bVar2;
  uint3 uVar3;
  uint uVar4;
  uint *puVar5;
  uint *puVar6;
  uint *puVar7;
  int iVar8;
  uint uVar9;
  uint *puVar10;
  
  if ((param_1 == (undefined1 *)0x0) || (param_4 == (uint *)0x0)) {
    return 0x10;
  }
  if (((param_2 != 0x10) && (param_2 != 0x18)) && (param_2 != 0x20)) {
    return 3;
  }
  if ((param_3 != 0) && (param_3 != ((int)(param_2 + (param_2 >> 0x1f & 7U)) >> 3) * 2 + 6)) {
    return 4;
  }
  puVar5 = param_4 + 1;
  param_4[0x78] = ((int)(param_2 + (param_2 >> 0x1f & 7U)) >> 3) * 2 + 6;
  uVar4 = CONCAT31(CONCAT21(CONCAT11(*param_1,param_1[1]),param_1[2]),param_1[3]);
  *param_4 = uVar4;
  *puVar5 = CONCAT31(CONCAT21(CONCAT11(param_1[4],param_1[5]),param_1[6]),param_1[7]);
  param_4[2] = CONCAT31(CONCAT21(CONCAT11(param_1[8],param_1[9]),param_1[10]),param_1[0xb]);
  bVar1 = param_1[0xc];
  uVar3 = CONCAT21(CONCAT11(bVar1,param_1[0xd]),param_1[0xe]);
  bVar2 = param_1[0xf];
  uVar9 = CONCAT31(uVar3,bVar2);
  param_4[3] = uVar9;
  if (param_2 == 0x10) {
    uVar4 = *(uint *)(&DAT_14026b2d0 + (ulonglong)bVar1 * 4) ^
            *(uint *)(&DAT_14026bed0 + (ulonglong)(((uVar3 & 0xff00) << 8) >> 0x10) * 4) ^
            *(uint *)(&DAT_14026bad0 + (ulonglong)(uVar3 & 0xff) * 4) ^
            *(uint *)(&DAT_14026b6d0 + (ulonglong)bVar2 * 4) ^ uVar4 ^ 0x1000000;
    param_4[4] = uVar4;
    uVar4 = uVar4 ^ *puVar5;
    param_4[5] = uVar4;
    uVar4 = uVar4 ^ param_4[2];
    param_4[6] = uVar4;
    param_4[7] = uVar4 ^ uVar9;
    puVar7 = &DAT_14026ded4;
    do {
      uVar4 = puVar5[6];
      puVar6 = puVar7 + 1;
      uVar4 = *(uint *)(&DAT_14026b2d0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026bed0 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14026bad0 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14026b6d0 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar5[3] ^ *puVar7;
      puVar5[7] = uVar4;
      uVar4 = uVar4 ^ puVar5[4];
      puVar5[8] = uVar4;
      uVar4 = puVar5[5] ^ uVar4;
      puVar5[9] = uVar4;
      puVar5[10] = uVar4 ^ puVar5[6];
      puVar7 = puVar6;
      puVar5 = puVar5 + 4;
    } while (puVar6 != (uint *)&DAT_14026def8);
  }
  else if (param_2 == 0x18) {
    param_4[4] = CONCAT31(CONCAT21(CONCAT11(param_1[0x10],param_1[0x11]),param_1[0x12]),
                          param_1[0x13]);
    bVar1 = param_1[0x14];
    uVar3 = CONCAT21(CONCAT11(bVar1,param_1[0x15]),param_1[0x16]);
    bVar2 = param_1[0x17];
    param_4[5] = CONCAT31(uVar3,bVar2);
    uVar4 = *(uint *)(&DAT_14026b2d0 + (ulonglong)bVar1 * 4) ^
            *(uint *)(&DAT_14026bed0 + (ulonglong)(((uVar3 & 0xff00) << 8) >> 0x10) * 4) ^
            *(uint *)(&DAT_14026bad0 + (ulonglong)(uVar3 & 0xff) * 4) ^
            *(uint *)(&DAT_14026b6d0 + (ulonglong)bVar2 * 4) ^ uVar4 ^ 0x1000000;
    param_4[6] = uVar4;
    uVar4 = uVar4 ^ *puVar5;
    param_4[7] = uVar4;
    uVar4 = uVar4 ^ param_4[2];
    param_4[8] = uVar4;
    param_4[9] = uVar4 ^ param_4[3];
    puVar5 = &DAT_14026ded4;
    puVar7 = param_4 + 10;
    do {
      puVar6 = puVar5 + 1;
      *puVar7 = puVar7[-6] ^ puVar7[-1];
      puVar7[1] = puVar7[-5] ^ puVar7[-6] ^ puVar7[-1];
      uVar4 = param_4[((-0x28 - (longlong)param_4) + (longlong)(puVar7 + 6) >> 2) + 5];
      uVar4 = *(uint *)(&DAT_14026b2d0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026bed0 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14026bad0 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14026b6d0 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar7[-4] ^ *puVar5;
      puVar7[2] = uVar4;
      uVar4 = puVar7[-3] ^ uVar4;
      puVar7[3] = uVar4;
      uVar4 = puVar7[-2] ^ uVar4;
      puVar7[4] = uVar4;
      puVar7[5] = puVar7[-1] ^ uVar4;
      puVar5 = puVar6;
      puVar7 = puVar7 + 6;
    } while (puVar6 != (uint *)&DAT_14026def0);
  }
  else {
    if (param_2 != 0x20) {
      return 1;
    }
    param_4[4] = CONCAT31(CONCAT21(CONCAT11(param_1[0x10],param_1[0x11]),param_1[0x12]),
                          param_1[0x13]);
    param_4[5] = CONCAT31(CONCAT21(CONCAT11(param_1[0x14],param_1[0x15]),param_1[0x16]),
                          param_1[0x17]);
    param_4[6] = CONCAT31(CONCAT21(CONCAT11(param_1[0x18],param_1[0x19]),param_1[0x1a]),
                          param_1[0x1b]);
    bVar1 = param_1[0x1c];
    uVar3 = CONCAT21(CONCAT11(bVar1,param_1[0x1d]),param_1[0x1e]);
    bVar2 = param_1[0x1f];
    param_4[7] = CONCAT31(uVar3,bVar2);
    uVar4 = *(uint *)(&DAT_14026b2d0 + (ulonglong)bVar1 * 4) ^
            *(uint *)(&DAT_14026bed0 + (ulonglong)(((uVar3 & 0xff00) << 8) >> 0x10) * 4) ^
            *(uint *)(&DAT_14026bad0 + (ulonglong)(uVar3 & 0xff) * 4) ^
            *(uint *)(&DAT_14026b6d0 + (ulonglong)bVar2 * 4) ^ uVar4 ^ 0x1000000;
    param_4[8] = uVar4;
    uVar4 = uVar4 ^ *puVar5;
    param_4[9] = uVar4;
    uVar4 = uVar4 ^ param_4[2];
    param_4[10] = uVar4;
    param_4[0xb] = uVar4 ^ param_4[3];
    puVar5 = &DAT_14026ded4;
    puVar7 = param_4 + 0xc;
    do {
      uVar4 = puVar7[-1];
      puVar6 = puVar5 + 1;
      uVar9 = *(uint *)(&DAT_14026b2d0 + (ulonglong)(uVar4 & 0xff) * 4) ^
              *(uint *)(&DAT_14026bed0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026bad0 + (ulonglong)((uVar4 >> 8 & 0xff00) >> 8) * 4) ^
              *(uint *)(&DAT_14026b6d0 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^ puVar7[-8];
      uVar4 = puVar7[-7] ^ uVar9;
      *puVar7 = uVar9;
      puVar7[1] = uVar4;
      uVar4 = puVar7[-6] ^ uVar4;
      puVar7[2] = uVar4;
      puVar7[3] = puVar7[-5] ^ uVar4;
      uVar4 = param_4[((-0x30 - (longlong)param_4) + (longlong)(puVar7 + 8) >> 2) + 7];
      uVar4 = *(uint *)(&DAT_14026b2d0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026bed0 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14026bad0 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14026b6d0 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar7[-4] ^ *puVar5;
      puVar7[4] = uVar4;
      uVar4 = puVar7[-3] ^ uVar4;
      puVar7[5] = uVar4;
      uVar4 = puVar7[-2] ^ uVar4;
      puVar7[6] = uVar4;
      puVar7[7] = puVar7[-1] ^ uVar4;
      puVar5 = puVar6;
      puVar7 = puVar7 + 8;
    } while (puVar6 != (uint *)&DAT_14026deec);
  }
  iVar8 = 1;
  puVar5 = param_4 + 0x3c;
  puVar7 = param_4 + (longlong)(param_2 + 0x1c) + -4;
  param_4[0x3c] = param_4[(longlong)(param_2 + 0x1c) + -4];
  param_4[0x3d] = puVar7[1];
  param_4[0x3e] = puVar7[2];
  param_4[0x3f] = puVar7[3];
  puVar6 = puVar7;
  puVar10 = puVar5;
  if (1 < (int)param_4[0x78]) {
    do {
      uVar4 = puVar6[-4];
      puVar7 = puVar6 + -4;
      puVar5 = puVar10 + 4;
      iVar8 = iVar8 + 1;
      *puVar5 = *(uint *)(&DAT_14026ced0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
                *(uint *)(&DAT_14026d2d0 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
                *(uint *)(&DAT_14026d6d0 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
                *(uint *)(&DAT_14026dad0 + (ulonglong)(uVar4 & 0xff) * 4);
      uVar4 = puVar6[-3];
      puVar10[5] = *(uint *)(&DAT_14026ced0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
                   *(uint *)(&DAT_14026d2d0 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
                   *(uint *)(&DAT_14026d6d0 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
                   *(uint *)(&DAT_14026dad0 + (ulonglong)(uVar4 & 0xff) * 4);
      uVar4 = puVar6[-2];
      puVar10[6] = *(uint *)(&DAT_14026ced0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
                   *(uint *)(&DAT_14026d2d0 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
                   *(uint *)(&DAT_14026d6d0 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
                   *(uint *)(&DAT_14026dad0 + (ulonglong)(uVar4 & 0xff) * 4);
      uVar4 = puVar6[-1];
      puVar10[7] = *(uint *)(&DAT_14026ced0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
                   *(uint *)(&DAT_14026d2d0 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
                   *(uint *)(&DAT_14026d6d0 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
                   *(uint *)(&DAT_14026dad0 + (ulonglong)(uVar4 & 0xff) * 4);
      puVar6 = puVar7;
      puVar10 = puVar5;
    } while (iVar8 < (int)param_4[0x78]);
  }
  puVar5[4] = puVar7[-4];
  puVar5[5] = puVar7[-3];
  puVar5[6] = puVar7[-2];
  puVar5[7] = puVar7[-1];
  return 0;
}



undefined8 FUN_1401ce5d0(undefined1 *param_1,undefined1 *param_2,uint *param_3)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  int iVar7;
  uint uVar8;
  
  if (((param_1 != (undefined1 *)0x0) && (param_2 != (undefined1 *)0x0)) && (param_3 != (uint *)0x0)
     ) {
    uVar6 = CONCAT31(CONCAT21(CONCAT11(*param_1,param_1[1]),param_1[2]),param_1[3]) ^ *param_3;
    uVar5 = CONCAT31(CONCAT21(CONCAT11(param_1[4],param_1[5]),param_1[6]),param_1[7]) ^ param_3[1];
    uVar4 = CONCAT31(CONCAT21(CONCAT11(param_1[8],param_1[9]),param_1[10]),param_1[0xb]) ^
            param_3[2];
    uVar3 = CONCAT31(CONCAT21(CONCAT11(param_1[0xc],param_1[0xd]),param_1[0xe]),param_1[0xf]) ^
            param_3[3];
    uVar2 = *(uint *)(&DAT_14026aad0 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14026a6d0 + (ulonglong)(uVar5 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_1402696d0 + (ulonglong)(uVar6 >> 0x18) * 4) ^
            *(uint *)(&DAT_14026aed0 + (ulonglong)(uVar3 & 0xff) * 4) ^ param_3[4];
    uVar1 = *(uint *)(&DAT_14026aad0 + (ulonglong)(uVar3 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14026a6d0 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_1402696d0 + (ulonglong)(uVar5 >> 0x18) * 4) ^
            *(uint *)(&DAT_14026aed0 + (ulonglong)(uVar6 & 0xff) * 4) ^ param_3[5];
    uVar8 = *(uint *)(&DAT_14026a6d0 + (ulonglong)(uVar3 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_1402696d0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
            *(uint *)(&DAT_14026aad0 + (ulonglong)(uVar6 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14026aed0 + (ulonglong)(uVar5 & 0xff) * 4) ^ param_3[6];
    uVar3 = *(uint *)(&DAT_1402696d0 + (ulonglong)(uVar3 >> 0x18) * 4) ^
            *(uint *)(&DAT_14026aad0 + (ulonglong)(uVar5 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14026a6d0 + (ulonglong)(uVar6 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14026aed0 + (ulonglong)(uVar4 & 0xff) * 4) ^ param_3[7];
    iVar7 = (int)param_3[0x78] >> 1;
    while( true ) {
      iVar7 = iVar7 + -1;
      param_3 = param_3 + 8;
      if (iVar7 == 0) break;
      uVar6 = *(uint *)(&DAT_14026aad0 + (ulonglong)(uVar8 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14026a6d0 + (ulonglong)(uVar1 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_1402696d0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026aed0 + (ulonglong)(uVar3 & 0xff) * 4) ^ *param_3;
      uVar5 = *(uint *)(&DAT_14026aad0 + (ulonglong)(uVar3 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14026a6d0 + (ulonglong)(uVar8 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_1402696d0 + (ulonglong)(uVar1 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026aed0 + (ulonglong)(uVar2 & 0xff) * 4) ^ param_3[1];
      uVar4 = *(uint *)(&DAT_14026a6d0 + (ulonglong)(uVar3 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_1402696d0 + (ulonglong)(uVar8 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026aad0 + (ulonglong)(uVar2 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14026aed0 + (ulonglong)(uVar1 & 0xff) * 4) ^ param_3[2];
      uVar3 = *(uint *)(&DAT_1402696d0 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026aad0 + (ulonglong)(uVar1 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14026a6d0 + (ulonglong)(uVar2 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14026aed0 + (ulonglong)(uVar8 & 0xff) * 4) ^ param_3[3];
      uVar2 = *(uint *)(&DAT_14026aad0 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14026a6d0 + (ulonglong)(uVar5 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_1402696d0 + (ulonglong)(uVar6 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026aed0 + (ulonglong)(uVar3 & 0xff) * 4) ^ param_3[4];
      uVar1 = *(uint *)(&DAT_14026aad0 + (ulonglong)(uVar3 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14026a6d0 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_1402696d0 + (ulonglong)(uVar5 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026aed0 + (ulonglong)(uVar6 & 0xff) * 4) ^ param_3[5];
      uVar8 = *(uint *)(&DAT_14026a6d0 + (ulonglong)(uVar3 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_1402696d0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026aad0 + (ulonglong)(uVar6 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14026aed0 + (ulonglong)(uVar5 & 0xff) * 4) ^ param_3[6];
      uVar3 = *(uint *)(&DAT_1402696d0 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026aad0 + (ulonglong)(uVar5 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14026a6d0 + (ulonglong)(uVar6 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14026aed0 + (ulonglong)(uVar4 & 0xff) * 4) ^ param_3[7];
    }
    uVar4 = *(uint *)(&DAT_14026b6d0 + (ulonglong)(uVar8 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14026bad0 + (ulonglong)(uVar1 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14026bed0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
            *(uint *)(&DAT_14026b2d0 + (ulonglong)(uVar3 & 0xff) * 4) ^ *param_3;
    param_2[3] = (char)uVar4;
    *param_2 = (char)(uVar4 >> 0x18);
    param_2[1] = (char)(uVar4 >> 0x10);
    param_2[2] = (char)(uVar4 >> 8);
    uVar4 = *(uint *)(&DAT_14026b6d0 + (ulonglong)(uVar3 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14026bad0 + (ulonglong)(uVar8 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14026bed0 + (ulonglong)(uVar1 >> 0x18) * 4) ^
            *(uint *)(&DAT_14026b2d0 + (ulonglong)(uVar2 & 0xff) * 4) ^ param_3[1];
    param_2[7] = (char)uVar4;
    param_2[4] = (char)(uVar4 >> 0x18);
    param_2[5] = (char)(uVar4 >> 0x10);
    param_2[6] = (char)(uVar4 >> 8);
    uVar4 = *(uint *)(&DAT_14026bad0 + (ulonglong)(uVar3 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14026bed0 + (ulonglong)(uVar8 >> 0x18) * 4) ^
            *(uint *)(&DAT_14026b6d0 + (ulonglong)(uVar2 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14026b2d0 + (ulonglong)(uVar1 & 0xff) * 4) ^ param_3[2];
    param_2[0xb] = (char)uVar4;
    param_2[8] = (char)(uVar4 >> 0x18);
    param_2[9] = (char)(uVar4 >> 0x10);
    param_2[10] = (char)(uVar4 >> 8);
    uVar2 = *(uint *)(&DAT_14026bed0 + (ulonglong)(uVar3 >> 0x18) * 4) ^
            *(uint *)(&DAT_14026b6d0 + (ulonglong)(uVar1 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14026bad0 + (ulonglong)(uVar2 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14026b2d0 + (ulonglong)(uVar8 & 0xff) * 4) ^ param_3[3];
    param_2[0xf] = (char)uVar2;
    param_2[0xc] = (char)(uVar2 >> 0x18);
    param_2[0xd] = (char)(uVar2 >> 0x10);
    param_2[0xe] = (char)(uVar2 >> 8);
    return 0;
  }
  return 0x10;
}



undefined8 FUN_1401cebb0(undefined1 *param_1,undefined1 *param_2,longlong param_3)

{
  uint *puVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  uint uVar8;
  int iVar9;
  
  if (((param_2 != (undefined1 *)0x0) && (param_1 != (undefined1 *)0x0)) && (param_3 != 0)) {
    uVar7 = CONCAT31(CONCAT21(CONCAT11(*param_1,param_1[1]),param_1[2]),param_1[3]) ^
            *(uint *)(param_3 + 0xf0);
    uVar6 = CONCAT31(CONCAT21(CONCAT11(param_1[4],param_1[5]),param_1[6]),param_1[7]) ^
            *(uint *)(param_3 + 0xf4);
    uVar5 = CONCAT31(CONCAT21(CONCAT11(param_1[8],param_1[9]),param_1[10]),param_1[0xb]) ^
            *(uint *)(param_3 + 0xf8);
    uVar4 = CONCAT31(CONCAT21(CONCAT11(param_1[0xc],param_1[0xd]),param_1[0xe]),param_1[0xf]) ^
            *(uint *)(param_3 + 0xfc);
    uVar8 = *(uint *)(&DAT_14026c2d0 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14026c6d0 + (ulonglong)(uVar5 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_140269ed0 + (ulonglong)(uVar7 >> 0x18) * 4) ^
            *(uint *)(&DAT_14026cad0 + (ulonglong)(uVar6 & 0xff) * 4) ^ *(uint *)(param_3 + 0x100);
    uVar3 = *(uint *)(&DAT_14026c6d0 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_140269ed0 + (ulonglong)(uVar6 >> 0x18) * 4) ^
            *(uint *)(&DAT_14026c2d0 + (ulonglong)(uVar7 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14026cad0 + (ulonglong)(uVar5 & 0xff) * 4) ^ *(uint *)(param_3 + 0x104);
    iVar9 = *(int *)(param_3 + 0x1e0) >> 1;
    uVar2 = *(uint *)(&DAT_140269ed0 + (ulonglong)(uVar5 >> 0x18) * 4) ^
            *(uint *)(&DAT_14026c2d0 + (ulonglong)(uVar6 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14026c6d0 + (ulonglong)(uVar7 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14026cad0 + (ulonglong)(uVar4 & 0xff) * 4) ^ *(uint *)(param_3 + 0x108);
    uVar4 = *(uint *)(&DAT_140269ed0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
            *(uint *)(&DAT_14026c2d0 + (ulonglong)(uVar5 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14026c6d0 + (ulonglong)(uVar6 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14026cad0 + (ulonglong)(uVar7 & 0xff) * 4) ^ *(uint *)(param_3 + 0x10c);
    puVar1 = (uint *)(param_3 + 0x110);
    while (iVar9 = iVar9 + -1, iVar9 != 0) {
      uVar7 = *(uint *)(&DAT_14026c2d0 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14026c6d0 + (ulonglong)(uVar2 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_140269ed0 + (ulonglong)(uVar8 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026cad0 + (ulonglong)(uVar3 & 0xff) * 4) ^ *puVar1;
      uVar6 = *(uint *)(&DAT_14026c6d0 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_140269ed0 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026c2d0 + (ulonglong)(uVar8 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14026cad0 + (ulonglong)(uVar2 & 0xff) * 4) ^ puVar1[1];
      uVar5 = *(uint *)(&DAT_140269ed0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026c2d0 + (ulonglong)(uVar3 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14026c6d0 + (ulonglong)(uVar8 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14026cad0 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar1[2];
      uVar4 = *(uint *)(&DAT_140269ed0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026c2d0 + (ulonglong)(uVar2 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14026c6d0 + (ulonglong)(uVar3 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14026cad0 + (ulonglong)(uVar8 & 0xff) * 4) ^ puVar1[3];
      uVar8 = *(uint *)(&DAT_14026c2d0 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14026c6d0 + (ulonglong)(uVar5 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_140269ed0 + (ulonglong)(uVar7 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026cad0 + (ulonglong)(uVar6 & 0xff) * 4) ^ puVar1[4];
      uVar3 = *(uint *)(&DAT_14026c6d0 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_140269ed0 + (ulonglong)(uVar6 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026c2d0 + (ulonglong)(uVar7 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14026cad0 + (ulonglong)(uVar5 & 0xff) * 4) ^ puVar1[5];
      uVar2 = *(uint *)(&DAT_140269ed0 + (ulonglong)(uVar5 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026c2d0 + (ulonglong)(uVar6 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14026c6d0 + (ulonglong)(uVar7 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14026cad0 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar1[6];
      uVar4 = *(uint *)(&DAT_140269ed0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_14026c2d0 + (ulonglong)(uVar5 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14026c6d0 + (ulonglong)(uVar6 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14026cad0 + (ulonglong)(uVar7 & 0xff) * 4) ^ puVar1[7];
      puVar1 = puVar1 + 8;
    }
    uVar5 = *(uint *)(&DAT_14026a2d0 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) & 0xff0000 ^
            *(uint *)(&DAT_14026a2d0 + (ulonglong)(uVar2 >> 8 & 0xff) * 4) & 0xff00 ^
            *(uint *)(&DAT_14026a2d0 + (ulonglong)(uVar8 >> 0x18) * 4) & 0xff000000 ^
            (uint)(byte)(&DAT_14026a2d0)[(ulonglong)(uVar3 & 0xff) * 4] ^ *puVar1;
    param_2[3] = (char)uVar5;
    *param_2 = (char)(uVar5 >> 0x18);
    param_2[1] = (char)(uVar5 >> 0x10);
    param_2[2] = (char)(uVar5 >> 8);
    uVar5 = *(uint *)(&DAT_14026a2d0 + (ulonglong)(uVar8 >> 0x10 & 0xff) * 4) & 0xff0000 ^
            *(uint *)(&DAT_14026a2d0 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) & 0xff00 ^
            *(uint *)(&DAT_14026a2d0 + (ulonglong)(uVar3 >> 0x18) * 4) & 0xff000000 ^
            (uint)(byte)(&DAT_14026a2d0)[(ulonglong)(uVar2 & 0xff) * 4] ^ puVar1[1];
    param_2[7] = (char)uVar5;
    param_2[4] = (char)(uVar5 >> 0x18);
    param_2[5] = (char)(uVar5 >> 0x10);
    param_2[6] = (char)(uVar5 >> 8);
    uVar5 = *(uint *)(&DAT_14026a2d0 + (ulonglong)(uVar3 >> 0x10 & 0xff) * 4) & 0xff0000 ^
            *(uint *)(&DAT_14026a2d0 + (ulonglong)(uVar2 >> 0x18) * 4) & 0xff000000 ^
            *(uint *)(&DAT_14026a2d0 + (ulonglong)(uVar8 >> 8 & 0xff) * 4) & 0xff00 ^
            (uint)(byte)(&DAT_14026a2d0)[(ulonglong)(uVar4 & 0xff) * 4] ^ puVar1[2];
    param_2[0xb] = (char)uVar5;
    param_2[8] = (char)(uVar5 >> 0x18);
    param_2[9] = (char)(uVar5 >> 0x10);
    param_2[10] = (char)(uVar5 >> 8);
    uVar8 = *(uint *)(&DAT_14026a2d0 + (ulonglong)(uVar2 >> 0x10 & 0xff) * 4) & 0xff0000 ^
            *(uint *)(&DAT_14026a2d0 + (ulonglong)(uVar4 >> 0x18) * 4) & 0xff000000 ^
            *(uint *)(&DAT_14026a2d0 + (ulonglong)(uVar3 >> 8 & 0xff) * 4) & 0xff00 ^
            (uint)(byte)(&DAT_14026a2d0)[(ulonglong)(uVar8 & 0xff) * 4] ^ puVar1[3];
    param_2[0xf] = (char)uVar8;
    param_2[0xc] = (char)(uVar8 >> 0x18);
    param_2[0xd] = (char)(uVar8 >> 0x10);
    param_2[0xe] = (char)(uVar8 >> 8);
    return 0;
  }
  return 0x10;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1401cf210(longlong param_1,longlong param_2)

{
  undefined1 uVar1;
  undefined1 uVar2;
  int iVar3;
  int iVar4;
  longlong lVar5;
  uint uVar6;
  int *piVar7;
  uint uVar8;
  uint uVar9;
  undefined1 *puVar10;
  undefined1 *puVar11;
  uint uVar12;
  uint uVar13;
  uint uVar14;
  uint uVar15;
  uint uVar16;
  uint uVar17;
  uint uVar18;
  uint uVar19;
  undefined1 local_158 [16];
  longlong local_148;
  undefined1 auStack_13a [2];
  undefined1 local_138 [4];
  undefined1 local_134 [4];
  undefined1 local_130 [4];
  uint local_12c [5];
  int local_118;
  int local_114 [14];
  int local_dc;
  int local_d8;
  int local_d4;
  int local_d0;
  int local_cc;
  int local_c8;
  int local_c4;
  int local_c0;
  int local_bc;
  int local_b8;
  int local_b4;
  int local_b0;
  int local_ac;
  int local_a8;
  int local_a4;
  int local_a0;
  int local_9c;
  int local_98;
  int local_94;
  int local_90;
  int local_8c;
  int local_88;
  int local_84;
  int local_80;
  int local_7c;
  int local_78;
  int local_74;
  int local_70;
  int local_6c;
  int local_68;
  int local_64;
  int local_60;
  int local_5c;
  int local_58;
  int local_54;
  int local_50;
  int local_4c;
  int local_48;
  int local_44;
  int local_40;
  int local_3c;
  ulonglong local_38;
  
  local_38 = DAT_1402f85a0 ^ (ulonglong)local_158;
  uVar6 = *(uint *)(param_1 + 0x1c);
  uVar17 = *(uint *)(param_1 + 8);
  uVar16 = *(uint *)(param_1 + 0xc);
  uVar8 = *(uint *)(param_1 + 0x10);
  iVar3 = *(int *)(param_1 + 0x14);
  uVar9 = *(uint *)(param_1 + 0x18);
  uVar13 = *(uint *)(param_1 + 0x20);
  iVar4 = *(int *)(param_1 + 0x24);
  lVar5 = 4;
  puVar10 = (undefined1 *)(param_2 + 2);
  local_148 = param_1;
  do {
    puVar11 = puVar10 + 0x10;
    uVar1 = puVar10[3];
    *(uint *)(puVar11 + (longlong)(local_158 + (0xe - param_2))) =
         CONCAT31(CONCAT21(CONCAT11(puVar10[-2],puVar10[-1]),*puVar10),puVar10[1]);
    uVar2 = puVar10[7];
    *(uint *)(puVar11 + (longlong)&local_148 + (2 - param_2)) =
         CONCAT31(CONCAT21(CONCAT11(puVar10[2],uVar1),puVar10[4]),puVar10[5]);
    uVar1 = puVar10[0xb];
    *(uint *)(puVar11 + (longlong)&local_148 + (6 - param_2)) =
         CONCAT31(CONCAT21(CONCAT11(puVar10[6],uVar2),puVar10[8]),puVar10[9]);
    lVar5 = lVar5 + -1;
    *(uint *)(puVar11 + (longlong)local_12c + (-0x12 - param_2)) =
         CONCAT31(CONCAT21(CONCAT11(puVar10[10],uVar1),puVar10[0xc]),puVar10[0xd]);
    puVar10 = puVar11;
  } while (lVar5 != 0);
  piVar7 = (int *)local_138;
  lVar5 = 0xc;
  do {
    uVar15 = piVar7[1];
    uVar14 = piVar7[2];
    uVar12 = piVar7[0xe];
    uVar19 = piVar7[3];
    uVar18 = piVar7[0xf];
    uVar12 = ((uVar12 >> 0x13 | uVar12 << 0xd) ^ (uVar12 >> 0x11 | uVar12 << 0xf) ^ uVar12 >> 10) +
             ((uVar15 >> 0x12 | uVar15 << 0xe) ^ (uVar15 >> 7 | uVar15 << 0x19) ^ uVar15 >> 3) +
             piVar7[9] + *piVar7;
    piVar7[0x10] = uVar12;
    uVar15 = ((uVar18 >> 0x13 | uVar18 << 0xd) ^ (uVar18 >> 0x11 | uVar18 << 0xf) ^ uVar18 >> 10) +
             ((uVar14 >> 0x12 | uVar14 << 0xe) ^ (uVar14 >> 7 | uVar14 << 0x19) ^ uVar14 >> 3) +
             piVar7[10] + uVar15;
    piVar7[0x11] = uVar15;
    piVar7[0x12] = ((uVar12 >> 0x13 | uVar12 * 0x2000) ^ (uVar12 >> 0x11 | uVar12 * 0x8000) ^
                   uVar12 >> 10) +
                   ((uVar19 >> 0x12 | uVar19 << 0xe) ^ (uVar19 >> 7 | uVar19 << 0x19) ^ uVar19 >> 3)
                   + piVar7[0xb] + uVar14;
    uVar14 = piVar7[4];
    piVar7[0x13] = ((uVar15 >> 0x13 | uVar15 * 0x2000) ^ (uVar15 >> 0x11 | uVar15 * 0x8000) ^
                   uVar15 >> 10) +
                   ((uVar14 >> 0x12 | uVar14 << 0xe) ^ (uVar14 >> 7 | uVar14 << 0x19) ^ uVar14 >> 3)
                   + piVar7[0xc] + uVar19;
    piVar7 = piVar7 + 4;
    lVar5 = lVar5 + -1;
  } while (lVar5 != 0);
  iVar4 = ((uVar6 ^ uVar13) & uVar9 ^ uVar13) +
          ((uVar9 >> 0x19 | uVar9 << 7) ^ (uVar9 >> 0xb | uVar9 << 0x15) ^
          (uVar9 >> 6 | uVar9 << 0x1a)) + (int)local_138 + 0x428a2f98 + iVar4;
  uVar19 = iVar3 + iVar4;
  uVar15 = ((uVar16 | uVar17) & uVar8 | uVar16 & uVar17) +
           iVar4 + ((uVar17 >> 0x16 | uVar17 << 10) ^ (uVar17 >> 0xd | uVar17 << 0x13) ^
                   (uVar17 >> 2 | uVar17 << 0x1e));
  iVar4 = ((uVar6 ^ uVar9) & uVar19 ^ uVar6) +
          ((uVar19 >> 0x19 | uVar19 * 0x80) ^ (uVar19 >> 0xb | uVar19 * 0x200000) ^
          (uVar19 >> 6 | uVar19 * 0x4000000)) + (int)local_134 + 0x71374491 + uVar13;
  uVar8 = uVar8 + iVar4;
  uVar14 = ((uVar17 | uVar15) & uVar16 | uVar17 & uVar15) +
           iVar4 + ((uVar15 >> 0x16 | uVar15 * 0x400) ^ (uVar15 >> 0xd | uVar15 * 0x80000) ^
                   (uVar15 >> 2 | uVar15 * 0x40000000));
  iVar4 = ((uVar19 ^ uVar9) & uVar8 ^ uVar9) +
          ((uVar8 >> 0x19 | uVar8 * 0x80) ^ (uVar8 >> 0xb | uVar8 * 0x200000) ^
          (uVar8 >> 6 | uVar8 * 0x4000000)) + (int)local_130 + -0x4a3f0431 + uVar6;
  uVar16 = uVar16 + iVar4;
  uVar12 = ((uVar14 | uVar15) & uVar17 | uVar14 & uVar15) +
           iVar4 + ((uVar14 >> 0x16 | uVar14 * 0x400) ^ (uVar14 >> 0xd | uVar14 * 0x80000) ^
                   (uVar14 >> 2 | uVar14 * 0x40000000));
  iVar4 = ((uVar19 ^ uVar8) & uVar16 ^ uVar19) +
          ((uVar16 >> 0x19 | uVar16 * 0x80) ^ (uVar16 >> 0xb | uVar16 * 0x200000) ^
          (uVar16 >> 6 | uVar16 * 0x4000000)) + local_12c[0] + -0x164a245b + uVar9;
  uVar17 = uVar17 + iVar4;
  uVar6 = ((uVar12 | uVar14) & uVar15 | uVar12 & uVar14) +
          iVar4 + ((uVar12 >> 0x16 | uVar12 * 0x400) ^ (uVar12 >> 0xd | uVar12 * 0x80000) ^
                  (uVar12 >> 2 | uVar12 * 0x40000000));
  iVar4 = ((uVar8 ^ uVar16) & uVar17 ^ uVar8) +
          ((uVar17 >> 0x19 | uVar17 * 0x80) ^ (uVar17 >> 0xb | uVar17 * 0x200000) ^
          (uVar17 >> 6 | uVar17 * 0x4000000)) + local_12c[1] + 0x3956c25b + uVar19;
  uVar15 = uVar15 + iVar4;
  uVar9 = ((uVar12 | uVar6) & uVar14 | uVar12 & uVar6) +
          iVar4 + ((uVar6 >> 0x16 | uVar6 * 0x400) ^ (uVar6 >> 0xd | uVar6 * 0x80000) ^
                  (uVar6 >> 2 | uVar6 * 0x40000000));
  iVar4 = ((uVar16 ^ uVar17) & uVar15 ^ uVar16) +
          ((uVar15 >> 0x19 | uVar15 * 0x80) ^ (uVar15 >> 0xb | uVar15 * 0x200000) ^
          (uVar15 >> 6 | uVar15 * 0x4000000)) + local_12c[2] + 0x59f111f1 + uVar8;
  uVar14 = uVar14 + iVar4;
  uVar8 = ((uVar9 | uVar6) & uVar12 | uVar9 & uVar6) +
          iVar4 + ((uVar9 >> 0x16 | uVar9 * 0x400) ^ (uVar9 >> 0xd | uVar9 * 0x80000) ^
                  (uVar9 >> 2 | uVar9 * 0x40000000));
  iVar4 = ((uVar17 ^ uVar15) & uVar14 ^ uVar17) +
          ((uVar14 >> 0x19 | uVar14 * 0x80) ^ (uVar14 >> 0xb | uVar14 * 0x200000) ^
          (uVar14 >> 6 | uVar14 * 0x4000000)) + local_12c[3] + -0x6dc07d5c + uVar16;
  uVar12 = uVar12 + iVar4;
  uVar19 = ((uVar9 | uVar8) & uVar6 | uVar9 & uVar8) +
           iVar4 + ((uVar8 >> 0x16 | uVar8 * 0x400) ^ (uVar8 >> 0xd | uVar8 * 0x80000) ^
                   (uVar8 >> 2 | uVar8 * 0x40000000));
  iVar4 = ((uVar14 ^ uVar15) & uVar12 ^ uVar15) +
          ((uVar12 >> 0x19 | uVar12 * 0x80) ^ (uVar12 >> 0xb | uVar12 * 0x200000) ^
          (uVar12 >> 6 | uVar12 * 0x4000000)) + local_12c[4] + -0x54e3a12b + uVar17;
  uVar6 = uVar6 + iVar4;
  uVar18 = ((uVar8 | uVar19) & uVar9 | uVar8 & uVar19) +
           iVar4 + ((uVar19 >> 0x16 | uVar19 * 0x400) ^ (uVar19 >> 0xd | uVar19 * 0x80000) ^
                   (uVar19 >> 2 | uVar19 * 0x40000000));
  iVar4 = ((uVar12 ^ uVar14) & uVar6 ^ uVar14) +
          ((uVar6 >> 0x19 | uVar6 * 0x80) ^ (uVar6 >> 0xb | uVar6 * 0x200000) ^
          (uVar6 >> 6 | uVar6 * 0x4000000)) + local_118 + -0x27f85568 + uVar15;
  uVar9 = uVar9 + iVar4;
  uVar13 = ((uVar19 | uVar18) & uVar8 | uVar19 & uVar18) +
           iVar4 + ((uVar18 >> 0x16 | uVar18 * 0x400) ^ (uVar18 >> 0xd | uVar18 * 0x80000) ^
                   (uVar18 >> 2 | uVar18 * 0x40000000));
  iVar4 = ((uVar12 ^ uVar6) & uVar9 ^ uVar12) +
          ((uVar9 >> 0x19 | uVar9 * 0x80) ^ (uVar9 >> 0xb | uVar9 * 0x200000) ^
          (uVar9 >> 6 | uVar9 * 0x4000000)) + local_114[0] + 0x12835b01 + uVar14;
  uVar8 = uVar8 + iVar4;
  uVar15 = ((uVar18 | uVar13) & uVar19 | uVar18 & uVar13) +
           iVar4 + ((uVar13 >> 0x16 | uVar13 * 0x400) ^ (uVar13 >> 0xd | uVar13 * 0x80000) ^
                   (uVar13 >> 2 | uVar13 * 0x40000000));
  iVar4 = ((uVar9 ^ uVar6) & uVar8 ^ uVar6) +
          ((uVar8 >> 0x19 | uVar8 * 0x80) ^ (uVar8 >> 0xb | uVar8 * 0x200000) ^
          (uVar8 >> 6 | uVar8 * 0x4000000)) + local_114[1] + 0x243185be + uVar12;
  uVar19 = uVar19 + iVar4;
  uVar14 = ((uVar15 | uVar13) & uVar18 | uVar15 & uVar13) +
           iVar4 + ((uVar15 >> 0x16 | uVar15 * 0x400) ^ (uVar15 >> 0xd | uVar15 * 0x80000) ^
                   (uVar15 >> 2 | uVar15 * 0x40000000));
  iVar4 = ((uVar9 ^ uVar8) & uVar19 ^ uVar9) +
          ((uVar19 >> 0x19 | uVar19 * 0x80) ^ (uVar19 >> 0xb | uVar19 * 0x200000) ^
          (uVar19 >> 6 | uVar19 * 0x4000000)) + local_114[2] + 0x550c7dc3 + uVar6;
  uVar18 = uVar18 + iVar4;
  uVar6 = ((uVar14 | uVar15) & uVar13 | uVar14 & uVar15) +
          iVar4 + ((uVar14 >> 0x16 | uVar14 * 0x400) ^ (uVar14 >> 0xd | uVar14 * 0x80000) ^
                  (uVar14 >> 2 | uVar14 * 0x40000000));
  iVar4 = ((uVar8 ^ uVar19) & uVar18 ^ uVar8) +
          ((uVar18 >> 0x19 | uVar18 * 0x80) ^ (uVar18 >> 0xb | uVar18 * 0x200000) ^
          (uVar18 >> 6 | uVar18 * 0x4000000)) + local_114[3] + 0x72be5d74 + uVar9;
  uVar13 = uVar13 + iVar4;
  uVar16 = ((uVar14 | uVar6) & uVar15 | uVar14 & uVar6) +
           iVar4 + ((uVar6 >> 0x16 | uVar6 * 0x400) ^ (uVar6 >> 0xd | uVar6 * 0x80000) ^
                   (uVar6 >> 2 | uVar6 * 0x40000000));
  iVar4 = ((uVar19 ^ uVar18) & uVar13 ^ uVar19) +
          ((uVar13 >> 0x19 | uVar13 * 0x80) ^ (uVar13 >> 0xb | uVar13 * 0x200000) ^
          (uVar13 >> 6 | uVar13 * 0x4000000)) + local_114[4] + -0x7f214e02 + uVar8;
  uVar15 = uVar15 + iVar4;
  uVar17 = ((uVar16 | uVar6) & uVar14 | uVar16 & uVar6) +
           iVar4 + ((uVar16 >> 0x16 | uVar16 * 0x400) ^ (uVar16 >> 0xd | uVar16 * 0x80000) ^
                   (uVar16 >> 2 | uVar16 * 0x40000000));
  iVar4 = ((uVar18 ^ uVar13) & uVar15 ^ uVar18) +
          ((uVar15 >> 0x19 | uVar15 * 0x80) ^ (uVar15 >> 0xb | uVar15 * 0x200000) ^
          (uVar15 >> 6 | uVar15 * 0x4000000)) + local_114[5] + -0x6423f959 + uVar19;
  uVar14 = uVar14 + iVar4;
  uVar12 = ((uVar16 | uVar17) & uVar6 | uVar16 & uVar17) +
           iVar4 + ((uVar17 >> 0x16 | uVar17 * 0x400) ^ (uVar17 >> 0xd | uVar17 * 0x80000) ^
                   (uVar17 >> 2 | uVar17 * 0x40000000));
  iVar4 = ((uVar15 ^ uVar13) & uVar14 ^ uVar13) +
          ((uVar14 >> 0x19 | uVar14 * 0x80) ^ (uVar14 >> 0xb | uVar14 * 0x200000) ^
          (uVar14 >> 6 | uVar14 * 0x4000000)) + local_114[6] + -0x3e640e8c + uVar18;
  uVar6 = uVar6 + iVar4;
  uVar19 = ((uVar17 | uVar12) & uVar16 | uVar17 & uVar12) +
           iVar4 + ((uVar12 >> 0x16 | uVar12 * 0x400) ^ (uVar12 >> 0xd | uVar12 * 0x80000) ^
                   (uVar12 >> 2 | uVar12 * 0x40000000));
  iVar4 = ((uVar14 ^ uVar15) & uVar6 ^ uVar15) +
          ((uVar6 >> 0x19 | uVar6 * 0x80) ^ (uVar6 >> 0xb | uVar6 * 0x200000) ^
          (uVar6 >> 6 | uVar6 * 0x4000000)) + local_114[7] + -0x1b64963f + uVar13;
  uVar16 = uVar16 + iVar4;
  uVar8 = ((uVar12 | uVar19) & uVar17 | uVar12 & uVar19) +
          iVar4 + ((uVar19 >> 0x16 | uVar19 * 0x400) ^ (uVar19 >> 0xd | uVar19 * 0x80000) ^
                  (uVar19 >> 2 | uVar19 * 0x40000000));
  iVar4 = ((uVar14 ^ uVar6) & uVar16 ^ uVar14) +
          ((uVar16 >> 0x19 | uVar16 * 0x80) ^ (uVar16 >> 0xb | uVar16 * 0x200000) ^
          (uVar16 >> 6 | uVar16 * 0x4000000)) + local_114[8] + -0x1041b87a + uVar15;
  uVar17 = uVar17 + iVar4;
  uVar9 = ((uVar19 | uVar8) & uVar12 | uVar19 & uVar8) +
          iVar4 + ((uVar8 >> 0x16 | uVar8 * 0x400) ^ (uVar8 >> 0xd | uVar8 * 0x80000) ^
                  (uVar8 >> 2 | uVar8 * 0x40000000));
  iVar4 = ((uVar16 ^ uVar6) & uVar17 ^ uVar6) +
          ((uVar17 >> 0x19 | uVar17 * 0x80) ^ (uVar17 >> 0xb | uVar17 * 0x200000) ^
          (uVar17 >> 6 | uVar17 * 0x4000000)) + local_114[9] + 0xfc19dc6 + uVar14;
  uVar12 = uVar12 + iVar4;
  uVar13 = ((uVar9 | uVar8) & uVar19 | uVar9 & uVar8) +
           iVar4 + ((uVar9 >> 0x16 | uVar9 * 0x400) ^ (uVar9 >> 0xd | uVar9 * 0x80000) ^
                   (uVar9 >> 2 | uVar9 * 0x40000000));
  iVar4 = ((uVar16 ^ uVar17) & uVar12 ^ uVar16) +
          ((uVar12 >> 0x19 | uVar12 * 0x80) ^ (uVar12 >> 0xb | uVar12 * 0x200000) ^
          (uVar12 >> 6 | uVar12 * 0x4000000)) + local_114[10] + 0x240ca1cc + uVar6;
  uVar19 = uVar19 + iVar4;
  uVar6 = ((uVar13 | uVar9) & uVar8 | uVar13 & uVar9) +
          iVar4 + ((uVar13 >> 0x16 | uVar13 * 0x400) ^ (uVar13 >> 0xd | uVar13 * 0x80000) ^
                  (uVar13 >> 2 | uVar13 * 0x40000000));
  iVar4 = ((uVar17 ^ uVar12) & uVar19 ^ uVar17) +
          ((uVar19 >> 0x19 | uVar19 * 0x80) ^ (uVar19 >> 0xb | uVar19 * 0x200000) ^
          (uVar19 >> 6 | uVar19 * 0x4000000)) + local_114[0xb] + 0x2de92c6f + uVar16;
  uVar8 = uVar8 + iVar4;
  uVar16 = ((uVar13 | uVar6) & uVar9 | uVar13 & uVar6) +
           iVar4 + ((uVar6 >> 0x16 | uVar6 * 0x400) ^ (uVar6 >> 0xd | uVar6 * 0x80000) ^
                   (uVar6 >> 2 | uVar6 * 0x40000000));
  iVar4 = ((uVar12 ^ uVar19) & uVar8 ^ uVar12) +
          ((uVar8 >> 0x19 | uVar8 * 0x80) ^ (uVar8 >> 0xb | uVar8 * 0x200000) ^
          (uVar8 >> 6 | uVar8 * 0x4000000)) + local_114[0xc] + 0x4a7484aa + uVar17;
  uVar9 = uVar9 + iVar4;
  uVar17 = ((uVar16 | uVar6) & uVar13 | uVar16 & uVar6) +
           iVar4 + ((uVar16 >> 0x16 | uVar16 * 0x400) ^ (uVar16 >> 0xd | uVar16 * 0x80000) ^
                   (uVar16 >> 2 | uVar16 * 0x40000000));
  iVar4 = ((uVar19 ^ uVar8) & uVar9 ^ uVar19) +
          ((uVar9 >> 0x19 | uVar9 * 0x80) ^ (uVar9 >> 0xb | uVar9 * 0x200000) ^
          (uVar9 >> 6 | uVar9 * 0x4000000)) + local_114[0xd] + 0x5cb0a9dc + uVar12;
  uVar13 = uVar13 + iVar4;
  uVar15 = ((uVar16 | uVar17) & uVar6 | uVar16 & uVar17) +
           iVar4 + ((uVar17 >> 0x16 | uVar17 * 0x400) ^ (uVar17 >> 0xd | uVar17 * 0x80000) ^
                   (uVar17 >> 2 | uVar17 * 0x40000000));
  iVar4 = ((uVar9 ^ uVar8) & uVar13 ^ uVar8) +
          ((uVar13 >> 0x19 | uVar13 * 0x80) ^ (uVar13 >> 0xb | uVar13 * 0x200000) ^
          (uVar13 >> 6 | uVar13 * 0x4000000)) + local_dc + 0x76f988da + uVar19;
  uVar6 = uVar6 + iVar4;
  uVar14 = ((uVar17 | uVar15) & uVar16 | uVar17 & uVar15) +
           iVar4 + ((uVar15 >> 0x16 | uVar15 * 0x400) ^ (uVar15 >> 0xd | uVar15 * 0x80000) ^
                   (uVar15 >> 2 | uVar15 * 0x40000000));
  iVar4 = ((uVar13 ^ uVar9) & uVar6 ^ uVar9) +
          ((uVar6 >> 0x19 | uVar6 * 0x80) ^ (uVar6 >> 0xb | uVar6 * 0x200000) ^
          (uVar6 >> 6 | uVar6 * 0x4000000)) + local_d8 + -0x67c1aeae + uVar8;
  uVar16 = uVar16 + iVar4;
  uVar8 = ((uVar15 | uVar14) & uVar17 | uVar15 & uVar14) +
          iVar4 + ((uVar14 >> 0x16 | uVar14 * 0x400) ^ (uVar14 >> 0xd | uVar14 * 0x80000) ^
                  (uVar14 >> 2 | uVar14 * 0x40000000));
  iVar4 = ((uVar13 ^ uVar6) & uVar16 ^ uVar13) +
          ((uVar16 >> 0x19 | uVar16 * 0x80) ^ (uVar16 >> 0xb | uVar16 * 0x200000) ^
          (uVar16 >> 6 | uVar16 * 0x4000000)) + local_d4 + -0x57ce3993 + uVar9;
  uVar17 = uVar17 + iVar4;
  uVar9 = ((uVar14 | uVar8) & uVar15 | uVar14 & uVar8) +
          iVar4 + ((uVar8 >> 0x16 | uVar8 * 0x400) ^ (uVar8 >> 0xd | uVar8 * 0x80000) ^
                  (uVar8 >> 2 | uVar8 * 0x40000000));
  iVar4 = ((uVar16 ^ uVar6) & uVar17 ^ uVar6) +
          ((uVar17 >> 0x19 | uVar17 * 0x80) ^ (uVar17 >> 0xb | uVar17 * 0x200000) ^
          (uVar17 >> 6 | uVar17 * 0x4000000)) + local_d0 + -0x4ffcd838 + uVar13;
  uVar15 = uVar15 + iVar4;
  uVar13 = ((uVar9 | uVar8) & uVar14 | uVar9 & uVar8) +
           iVar4 + ((uVar9 >> 0x16 | uVar9 * 0x400) ^ (uVar9 >> 0xd | uVar9 * 0x80000) ^
                   (uVar9 >> 2 | uVar9 * 0x40000000));
  iVar4 = ((uVar16 ^ uVar17) & uVar15 ^ uVar16) +
          ((uVar15 >> 0x19 | uVar15 * 0x80) ^ (uVar15 >> 0xb | uVar15 * 0x200000) ^
          (uVar15 >> 6 | uVar15 * 0x4000000)) + local_cc + -0x40a68039 + uVar6;
  uVar14 = uVar14 + iVar4;
  uVar6 = ((uVar13 | uVar9) & uVar8 | uVar13 & uVar9) +
          iVar4 + ((uVar13 >> 0x16 | uVar13 * 0x400) ^ (uVar13 >> 0xd | uVar13 * 0x80000) ^
                  (uVar13 >> 2 | uVar13 * 0x40000000));
  iVar4 = ((uVar17 ^ uVar15) & uVar14 ^ uVar17) +
          ((uVar14 >> 0x19 | uVar14 * 0x80) ^ (uVar14 >> 0xb | uVar14 * 0x200000) ^
          (uVar14 >> 6 | uVar14 * 0x4000000)) + local_c8 + -0x391ff40d + uVar16;
  uVar8 = uVar8 + iVar4;
  uVar16 = ((uVar13 | uVar6) & uVar9 | uVar13 & uVar6) +
           iVar4 + ((uVar6 >> 0x16 | uVar6 * 0x400) ^ (uVar6 >> 0xd | uVar6 * 0x80000) ^
                   (uVar6 >> 2 | uVar6 * 0x40000000));
  iVar4 = ((uVar15 ^ uVar14) & uVar8 ^ uVar15) +
          ((uVar8 >> 0x19 | uVar8 * 0x80) ^ (uVar8 >> 0xb | uVar8 * 0x200000) ^
          (uVar8 >> 6 | uVar8 * 0x4000000)) + local_c4 + -0x2a586eb9 + uVar17;
  uVar9 = uVar9 + iVar4;
  uVar17 = ((uVar16 | uVar6) & uVar13 | uVar16 & uVar6) +
           iVar4 + ((uVar16 >> 0x16 | uVar16 * 0x400) ^ (uVar16 >> 0xd | uVar16 * 0x80000) ^
                   (uVar16 >> 2 | uVar16 * 0x40000000));
  iVar4 = ((uVar14 ^ uVar8) & uVar9 ^ uVar14) +
          ((uVar9 >> 0x19 | uVar9 * 0x80) ^ (uVar9 >> 0xb | uVar9 * 0x200000) ^
          (uVar9 >> 6 | uVar9 * 0x4000000)) + local_c0 + 0x6ca6351 + uVar15;
  uVar13 = uVar13 + iVar4;
  uVar15 = ((uVar16 | uVar17) & uVar6 | uVar16 & uVar17) +
           iVar4 + ((uVar17 >> 0x16 | uVar17 * 0x400) ^ (uVar17 >> 0xd | uVar17 * 0x80000) ^
                   (uVar17 >> 2 | uVar17 * 0x40000000));
  iVar4 = ((uVar9 ^ uVar8) & uVar13 ^ uVar8) +
          ((uVar13 >> 0x19 | uVar13 * 0x80) ^ (uVar13 >> 0xb | uVar13 * 0x200000) ^
          (uVar13 >> 6 | uVar13 * 0x4000000)) + local_bc + 0x14292967 + uVar14;
  uVar6 = uVar6 + iVar4;
  uVar14 = ((uVar17 | uVar15) & uVar16 | uVar17 & uVar15) +
           iVar4 + ((uVar15 >> 0x16 | uVar15 * 0x400) ^ (uVar15 >> 0xd | uVar15 * 0x80000) ^
                   (uVar15 >> 2 | uVar15 * 0x40000000));
  iVar4 = ((uVar13 ^ uVar9) & uVar6 ^ uVar9) +
          ((uVar6 >> 0x19 | uVar6 * 0x80) ^ (uVar6 >> 0xb | uVar6 * 0x200000) ^
          (uVar6 >> 6 | uVar6 * 0x4000000)) + local_b8 + 0x27b70a85 + uVar8;
  uVar16 = uVar16 + iVar4;
  uVar8 = ((uVar15 | uVar14) & uVar17 | uVar15 & uVar14) +
          iVar4 + ((uVar14 >> 0x16 | uVar14 * 0x400) ^ (uVar14 >> 0xd | uVar14 * 0x80000) ^
                  (uVar14 >> 2 | uVar14 * 0x40000000));
  iVar4 = ((uVar13 ^ uVar6) & uVar16 ^ uVar13) +
          ((uVar16 >> 0x19 | uVar16 * 0x80) ^ (uVar16 >> 0xb | uVar16 * 0x200000) ^
          (uVar16 >> 6 | uVar16 * 0x4000000)) + local_b4 + 0x2e1b2138 + uVar9;
  uVar17 = uVar17 + iVar4;
  uVar9 = ((uVar14 | uVar8) & uVar15 | uVar14 & uVar8) +
          iVar4 + ((uVar8 >> 0x16 | uVar8 * 0x400) ^ (uVar8 >> 0xd | uVar8 * 0x80000) ^
                  (uVar8 >> 2 | uVar8 * 0x40000000));
  iVar4 = ((uVar16 ^ uVar6) & uVar17 ^ uVar6) +
          ((uVar17 >> 0x19 | uVar17 * 0x80) ^ (uVar17 >> 0xb | uVar17 * 0x200000) ^
          (uVar17 >> 6 | uVar17 * 0x4000000)) + local_b0 + 0x4d2c6dfc + uVar13;
  uVar15 = uVar15 + iVar4;
  uVar13 = ((uVar9 | uVar8) & uVar14 | uVar9 & uVar8) +
           iVar4 + ((uVar9 >> 0x16 | uVar9 * 0x400) ^ (uVar9 >> 0xd | uVar9 * 0x80000) ^
                   (uVar9 >> 2 | uVar9 * 0x40000000));
  iVar4 = ((uVar16 ^ uVar17) & uVar15 ^ uVar16) +
          ((uVar15 >> 0x19 | uVar15 * 0x80) ^ (uVar15 >> 0xb | uVar15 * 0x200000) ^
          (uVar15 >> 6 | uVar15 * 0x4000000)) + local_ac + 0x53380d13 + uVar6;
  uVar14 = uVar14 + iVar4;
  uVar6 = ((uVar13 | uVar9) & uVar8 | uVar13 & uVar9) +
          iVar4 + ((uVar13 >> 0x16 | uVar13 * 0x400) ^ (uVar13 >> 0xd | uVar13 * 0x80000) ^
                  (uVar13 >> 2 | uVar13 * 0x40000000));
  iVar4 = ((uVar17 ^ uVar15) & uVar14 ^ uVar17) +
          ((uVar14 >> 0x19 | uVar14 * 0x80) ^ (uVar14 >> 0xb | uVar14 * 0x200000) ^
          (uVar14 >> 6 | uVar14 * 0x4000000)) + local_a8 + 0x650a7354 + uVar16;
  uVar8 = uVar8 + iVar4;
  uVar16 = ((uVar13 | uVar6) & uVar9 | uVar13 & uVar6) +
           iVar4 + ((uVar6 >> 0x16 | uVar6 * 0x400) ^ (uVar6 >> 0xd | uVar6 * 0x80000) ^
                   (uVar6 >> 2 | uVar6 * 0x40000000));
  iVar4 = ((uVar15 ^ uVar14) & uVar8 ^ uVar15) +
          ((uVar8 >> 0x19 | uVar8 * 0x80) ^ (uVar8 >> 0xb | uVar8 * 0x200000) ^
          (uVar8 >> 6 | uVar8 * 0x4000000)) + local_a4 + 0x766a0abb + uVar17;
  uVar9 = uVar9 + iVar4;
  uVar17 = ((uVar16 | uVar6) & uVar13 | uVar16 & uVar6) +
           iVar4 + ((uVar16 >> 0x16 | uVar16 * 0x400) ^ (uVar16 >> 0xd | uVar16 * 0x80000) ^
                   (uVar16 >> 2 | uVar16 * 0x40000000));
  iVar4 = ((uVar14 ^ uVar8) & uVar9 ^ uVar14) +
          ((uVar9 >> 0x19 | uVar9 * 0x80) ^ (uVar9 >> 0xb | uVar9 * 0x200000) ^
          (uVar9 >> 6 | uVar9 * 0x4000000)) + local_a0 + -0x7e3d36d2 + uVar15;
  uVar13 = uVar13 + iVar4;
  uVar15 = ((uVar16 | uVar17) & uVar6 | uVar16 & uVar17) +
           iVar4 + ((uVar17 >> 0x16 | uVar17 * 0x400) ^ (uVar17 >> 0xd | uVar17 * 0x80000) ^
                   (uVar17 >> 2 | uVar17 * 0x40000000));
  iVar4 = ((uVar9 ^ uVar8) & uVar13 ^ uVar8) +
          ((uVar13 >> 0x19 | uVar13 * 0x80) ^ (uVar13 >> 0xb | uVar13 * 0x200000) ^
          (uVar13 >> 6 | uVar13 * 0x4000000)) + local_9c + -0x6d8dd37b + uVar14;
  uVar6 = uVar6 + iVar4;
  uVar14 = ((uVar17 | uVar15) & uVar16 | uVar17 & uVar15) +
           iVar4 + ((uVar15 >> 0x16 | uVar15 * 0x400) ^ (uVar15 >> 0xd | uVar15 * 0x80000) ^
                   (uVar15 >> 2 | uVar15 * 0x40000000));
  iVar4 = ((uVar13 ^ uVar9) & uVar6 ^ uVar9) +
          ((uVar6 >> 0x19 | uVar6 * 0x80) ^ (uVar6 >> 0xb | uVar6 * 0x200000) ^
          (uVar6 >> 6 | uVar6 * 0x4000000)) + local_98 + -0x5d40175f + uVar8;
  uVar16 = uVar16 + iVar4;
  uVar8 = ((uVar15 | uVar14) & uVar17 | uVar15 & uVar14) +
          iVar4 + ((uVar14 >> 0x16 | uVar14 * 0x400) ^ (uVar14 >> 0xd | uVar14 * 0x80000) ^
                  (uVar14 >> 2 | uVar14 * 0x40000000));
  iVar4 = ((uVar13 ^ uVar6) & uVar16 ^ uVar13) +
          ((uVar16 >> 0x19 | uVar16 * 0x80) ^ (uVar16 >> 0xb | uVar16 * 0x200000) ^
          (uVar16 >> 6 | uVar16 * 0x4000000)) + local_94 + -0x57e599b5 + uVar9;
  uVar17 = uVar17 + iVar4;
  uVar9 = ((uVar14 | uVar8) & uVar15 | uVar14 & uVar8) +
          iVar4 + ((uVar8 >> 0x16 | uVar8 * 0x400) ^ (uVar8 >> 0xd | uVar8 * 0x80000) ^
                  (uVar8 >> 2 | uVar8 * 0x40000000));
  iVar4 = ((uVar16 ^ uVar6) & uVar17 ^ uVar6) +
          ((uVar17 >> 0x19 | uVar17 * 0x80) ^ (uVar17 >> 0xb | uVar17 * 0x200000) ^
          (uVar17 >> 6 | uVar17 * 0x4000000)) + local_90 + -0x3db47490 + uVar13;
  uVar15 = uVar15 + iVar4;
  uVar13 = ((uVar9 | uVar8) & uVar14 | uVar9 & uVar8) +
           iVar4 + ((uVar9 >> 0x16 | uVar9 * 0x400) ^ (uVar9 >> 0xd | uVar9 * 0x80000) ^
                   (uVar9 >> 2 | uVar9 * 0x40000000));
  iVar4 = ((uVar16 ^ uVar17) & uVar15 ^ uVar16) +
          ((uVar15 >> 0x19 | uVar15 * 0x80) ^ (uVar15 >> 0xb | uVar15 * 0x200000) ^
          (uVar15 >> 6 | uVar15 * 0x4000000)) + local_8c + -0x3893ae5d + uVar6;
  uVar14 = uVar14 + iVar4;
  uVar6 = ((uVar13 | uVar9) & uVar8 | uVar13 & uVar9) +
          iVar4 + ((uVar13 >> 0x16 | uVar13 * 0x400) ^ (uVar13 >> 0xd | uVar13 * 0x80000) ^
                  (uVar13 >> 2 | uVar13 * 0x40000000));
  iVar4 = ((uVar17 ^ uVar15) & uVar14 ^ uVar17) +
          ((uVar14 >> 0x19 | uVar14 * 0x80) ^ (uVar14 >> 0xb | uVar14 * 0x200000) ^
          (uVar14 >> 6 | uVar14 * 0x4000000)) + local_88 + -0x2e6d17e7 + uVar16;
  uVar8 = uVar8 + iVar4;
  uVar16 = ((uVar13 | uVar6) & uVar9 | uVar13 & uVar6) +
           iVar4 + ((uVar6 >> 0x16 | uVar6 * 0x400) ^ (uVar6 >> 0xd | uVar6 * 0x80000) ^
                   (uVar6 >> 2 | uVar6 * 0x40000000));
  iVar4 = ((uVar15 ^ uVar14) & uVar8 ^ uVar15) +
          ((uVar8 >> 0x19 | uVar8 * 0x80) ^ (uVar8 >> 0xb | uVar8 * 0x200000) ^
          (uVar8 >> 6 | uVar8 * 0x4000000)) + local_84 + -0x2966f9dc + uVar17;
  uVar9 = uVar9 + iVar4;
  uVar17 = ((uVar16 | uVar6) & uVar13 | uVar16 & uVar6) +
           iVar4 + ((uVar16 >> 0x16 | uVar16 * 0x400) ^ (uVar16 >> 0xd | uVar16 * 0x80000) ^
                   (uVar16 >> 2 | uVar16 * 0x40000000));
  iVar4 = ((uVar14 ^ uVar8) & uVar9 ^ uVar14) +
          ((uVar9 >> 0x19 | uVar9 * 0x80) ^ (uVar9 >> 0xb | uVar9 * 0x200000) ^
          (uVar9 >> 6 | uVar9 * 0x4000000)) + local_80 + -0xbf1ca7b + uVar15;
  uVar13 = uVar13 + iVar4;
  uVar15 = ((uVar16 | uVar17) & uVar6 | uVar16 & uVar17) +
           iVar4 + ((uVar17 >> 0x16 | uVar17 * 0x400) ^ (uVar17 >> 0xd | uVar17 * 0x80000) ^
                   (uVar17 >> 2 | uVar17 * 0x40000000));
  iVar4 = ((uVar9 ^ uVar8) & uVar13 ^ uVar8) +
          ((uVar13 >> 0x19 | uVar13 * 0x80) ^ (uVar13 >> 0xb | uVar13 * 0x200000) ^
          (uVar13 >> 6 | uVar13 * 0x4000000)) + local_7c + 0x106aa070 + uVar14;
  uVar6 = uVar6 + iVar4;
  uVar14 = ((uVar17 | uVar15) & uVar16 | uVar17 & uVar15) +
           iVar4 + ((uVar15 >> 0x16 | uVar15 * 0x400) ^ (uVar15 >> 0xd | uVar15 * 0x80000) ^
                   (uVar15 >> 2 | uVar15 * 0x40000000));
  iVar4 = ((uVar13 ^ uVar9) & uVar6 ^ uVar9) +
          ((uVar6 >> 0x19 | uVar6 * 0x80) ^ (uVar6 >> 0xb | uVar6 * 0x200000) ^
          (uVar6 >> 6 | uVar6 * 0x4000000)) + local_78 + 0x19a4c116 + uVar8;
  uVar16 = uVar16 + iVar4;
  uVar8 = ((uVar15 | uVar14) & uVar17 | uVar15 & uVar14) +
          iVar4 + ((uVar14 >> 0x16 | uVar14 * 0x400) ^ (uVar14 >> 0xd | uVar14 * 0x80000) ^
                  (uVar14 >> 2 | uVar14 * 0x40000000));
  iVar4 = ((uVar13 ^ uVar6) & uVar16 ^ uVar13) +
          ((uVar16 >> 0x19 | uVar16 * 0x80) ^ (uVar16 >> 0xb | uVar16 * 0x200000) ^
          (uVar16 >> 6 | uVar16 * 0x4000000)) + local_74 + 0x1e376c08 + uVar9;
  uVar17 = uVar17 + iVar4;
  uVar9 = ((uVar14 | uVar8) & uVar15 | uVar14 & uVar8) +
          iVar4 + ((uVar8 >> 0x16 | uVar8 * 0x400) ^ (uVar8 >> 0xd | uVar8 * 0x80000) ^
                  (uVar8 >> 2 | uVar8 * 0x40000000));
  iVar4 = ((uVar16 ^ uVar6) & uVar17 ^ uVar6) +
          ((uVar17 >> 0x19 | uVar17 * 0x80) ^ (uVar17 >> 0xb | uVar17 * 0x200000) ^
          (uVar17 >> 6 | uVar17 * 0x4000000)) + local_70 + 0x2748774c + uVar13;
  uVar15 = uVar15 + iVar4;
  uVar13 = ((uVar9 | uVar8) & uVar14 | uVar9 & uVar8) +
           iVar4 + ((uVar9 >> 0x16 | uVar9 * 0x400) ^ (uVar9 >> 0xd | uVar9 * 0x80000) ^
                   (uVar9 >> 2 | uVar9 * 0x40000000));
  iVar4 = ((uVar16 ^ uVar17) & uVar15 ^ uVar16) +
          ((uVar15 >> 0x19 | uVar15 * 0x80) ^ (uVar15 >> 0xb | uVar15 * 0x200000) ^
          (uVar15 >> 6 | uVar15 * 0x4000000)) + local_6c + 0x34b0bcb5 + uVar6;
  uVar14 = uVar14 + iVar4;
  uVar6 = ((uVar13 | uVar9) & uVar8 | uVar13 & uVar9) +
          iVar4 + ((uVar13 >> 0x16 | uVar13 * 0x400) ^ (uVar13 >> 0xd | uVar13 * 0x80000) ^
                  (uVar13 >> 2 | uVar13 * 0x40000000));
  iVar4 = ((uVar17 ^ uVar15) & uVar14 ^ uVar17) +
          ((uVar14 >> 0x19 | uVar14 * 0x80) ^ (uVar14 >> 0xb | uVar14 * 0x200000) ^
          (uVar14 >> 6 | uVar14 * 0x4000000)) + local_68 + 0x391c0cb3 + uVar16;
  uVar8 = uVar8 + iVar4;
  uVar12 = ((uVar13 | uVar6) & uVar9 | uVar13 & uVar6) +
           iVar4 + ((uVar6 >> 0x16 | uVar6 * 0x400) ^ (uVar6 >> 0xd | uVar6 * 0x80000) ^
                   (uVar6 >> 2 | uVar6 * 0x40000000));
  iVar4 = ((uVar15 ^ uVar14) & uVar8 ^ uVar15) +
          ((uVar8 >> 0x19 | uVar8 * 0x80) ^ (uVar8 >> 0xb | uVar8 * 0x200000) ^
          (uVar8 >> 6 | uVar8 * 0x4000000)) + local_64 + 0x4ed8aa4a + uVar17;
  uVar9 = uVar9 + iVar4;
  uVar19 = ((uVar12 | uVar6) & uVar13 | uVar12 & uVar6) +
           iVar4 + ((uVar12 >> 0x16 | uVar12 * 0x400) ^ (uVar12 >> 0xd | uVar12 * 0x80000) ^
                   (uVar12 >> 2 | uVar12 * 0x40000000));
  iVar4 = ((uVar14 ^ uVar8) & uVar9 ^ uVar14) +
          ((uVar9 >> 0x19 | uVar9 * 0x80) ^ (uVar9 >> 0xb | uVar9 * 0x200000) ^
          (uVar9 >> 6 | uVar9 * 0x4000000)) + local_60 + 0x5b9cca4f + uVar15;
  uVar13 = uVar13 + iVar4;
  uVar16 = ((uVar12 | uVar19) & uVar6 | uVar12 & uVar19) +
           iVar4 + ((uVar19 >> 0x16 | uVar19 * 0x400) ^ (uVar19 >> 0xd | uVar19 * 0x80000) ^
                   (uVar19 >> 2 | uVar19 * 0x40000000));
  iVar4 = ((uVar9 ^ uVar8) & uVar13 ^ uVar8) +
          ((uVar13 >> 0x19 | uVar13 * 0x80) ^ (uVar13 >> 0xb | uVar13 * 0x200000) ^
          (uVar13 >> 6 | uVar13 * 0x4000000)) + local_5c + 0x682e6ff3 + uVar14;
  uVar6 = uVar6 + iVar4;
  uVar14 = ((uVar19 | uVar16) & uVar12 | uVar19 & uVar16) +
           iVar4 + ((uVar16 >> 0x16 | uVar16 * 0x400) ^ (uVar16 >> 0xd | uVar16 * 0x80000) ^
                   (uVar16 >> 2 | uVar16 * 0x40000000));
  iVar4 = ((uVar13 ^ uVar9) & uVar6 ^ uVar9) +
          ((uVar6 >> 0x19 | uVar6 * 0x80) ^ (uVar6 >> 0xb | uVar6 * 0x200000) ^
          (uVar6 >> 6 | uVar6 * 0x4000000)) + local_58 + 0x748f82ee + uVar8;
  uVar12 = uVar12 + iVar4;
  uVar15 = ((uVar16 | uVar14) & uVar19 | uVar16 & uVar14) +
           iVar4 + ((uVar14 >> 0x16 | uVar14 * 0x400) ^ (uVar14 >> 0xd | uVar14 * 0x80000) ^
                   (uVar14 >> 2 | uVar14 * 0x40000000));
  iVar4 = ((uVar13 ^ uVar6) & uVar12 ^ uVar13) +
          ((uVar12 >> 0x19 | uVar12 * 0x80) ^ (uVar12 >> 0xb | uVar12 * 0x200000) ^
          (uVar12 >> 6 | uVar12 * 0x4000000)) + local_54 + 0x78a5636f + uVar9;
  uVar19 = uVar19 + iVar4;
  uVar17 = ((uVar14 | uVar15) & uVar16 | uVar14 & uVar15) +
           iVar4 + ((uVar15 >> 0x16 | uVar15 * 0x400) ^ (uVar15 >> 0xd | uVar15 * 0x80000) ^
                   (uVar15 >> 2 | uVar15 * 0x40000000));
  iVar4 = ((uVar12 ^ uVar6) & uVar19 ^ uVar6) +
          ((uVar19 >> 0x19 | uVar19 * 0x80) ^ (uVar19 >> 0xb | uVar19 * 0x200000) ^
          (uVar19 >> 6 | uVar19 * 0x4000000)) + local_50 + -0x7b3787ec + uVar13;
  uVar16 = uVar16 + iVar4;
  uVar8 = ((uVar17 | uVar15) & uVar14 | uVar17 & uVar15) +
          iVar4 + ((uVar17 >> 0x16 | uVar17 * 0x400) ^ (uVar17 >> 0xd | uVar17 * 0x80000) ^
                  (uVar17 >> 2 | uVar17 * 0x40000000));
  iVar4 = ((uVar12 ^ uVar19) & uVar16 ^ uVar12) +
          ((uVar16 >> 0x19 | uVar16 * 0x80) ^ (uVar16 >> 0xb | uVar16 * 0x200000) ^
          (uVar16 >> 6 | uVar16 * 0x4000000)) + local_4c + -0x7338fdf8 + uVar6;
  uVar14 = uVar14 + iVar4;
  uVar6 = ((uVar8 | uVar17) & uVar15 | uVar8 & uVar17) +
          iVar4 + ((uVar8 >> 0x16 | uVar8 * 0x400) ^ (uVar8 >> 0xd | uVar8 * 0x80000) ^
                  (uVar8 >> 2 | uVar8 * 0x40000000));
  iVar4 = ((uVar19 ^ uVar16) & uVar14 ^ uVar19) +
          ((uVar14 >> 0x19 | uVar14 * 0x80) ^ (uVar14 >> 0xb | uVar14 * 0x200000) ^
          (uVar14 >> 6 | uVar14 * 0x4000000)) + local_48 + -0x6f410006 + uVar12;
  uVar15 = uVar15 + iVar4;
  uVar13 = ((uVar8 | uVar6) & uVar17 | uVar8 & uVar6) +
           iVar4 + ((uVar6 >> 0x16 | uVar6 * 0x400) ^ (uVar6 >> 0xd | uVar6 * 0x80000) ^
                   (uVar6 >> 2 | uVar6 * 0x40000000));
  iVar4 = ((uVar16 ^ uVar14) & uVar15 ^ uVar16) +
          ((uVar15 >> 0x19 | uVar15 * 0x80) ^ (uVar15 >> 0xb | uVar15 * 0x200000) ^
          (uVar15 >> 6 | uVar15 * 0x4000000)) + local_44 + -0x5baf9315 + uVar19;
  uVar17 = uVar17 + iVar4;
  uVar9 = ((uVar13 | uVar6) & uVar8 | uVar13 & uVar6) +
          iVar4 + ((uVar13 >> 0x16 | uVar13 * 0x400) ^ (uVar13 >> 0xd | uVar13 * 0x80000) ^
                  (uVar13 >> 2 | uVar13 * 0x40000000));
  iVar4 = ((uVar14 ^ uVar15) & uVar17 ^ uVar14) +
          ((uVar17 >> 0x19 | uVar17 * 0x80) ^ (uVar17 >> 0xb | uVar17 * 0x200000) ^
          (uVar17 >> 6 | uVar17 * 0x4000000)) + local_40 + -0x41065c09 + uVar16;
  uVar8 = uVar8 + iVar4;
  uVar16 = ((uVar13 | uVar9) & uVar6 | uVar13 & uVar9) +
           iVar4 + ((uVar9 >> 0x16 | uVar9 * 0x400) ^ (uVar9 >> 0xd | uVar9 * 0x80000) ^
                   (uVar9 >> 2 | uVar9 * 0x40000000));
  iVar4 = ((uVar17 ^ uVar15) & uVar8 ^ uVar15) +
          ((uVar8 >> 0x19 | uVar8 * 0x80) ^ (uVar8 >> 0xb | uVar8 * 0x200000) ^
          (uVar8 >> 6 | uVar8 * 0x4000000)) + local_3c + -0x398e870e + uVar14;
  *(int *)(local_148 + 8) =
       *(int *)(local_148 + 8) +
       ((uVar9 | uVar16) & uVar13 | uVar9 & uVar16) +
       iVar4 + ((uVar16 >> 0x16 | uVar16 * 0x400) ^ (uVar16 >> 0xd | uVar16 * 0x80000) ^
               (uVar16 >> 2 | uVar16 * 0x40000000));
  *(int *)(local_148 + 0xc) = *(int *)(local_148 + 0xc) + uVar16;
  *(int *)(local_148 + 0x10) = *(int *)(local_148 + 0x10) + uVar9;
  *(int *)(local_148 + 0x14) = *(int *)(local_148 + 0x14) + uVar13;
  *(int *)(local_148 + 0x18) = *(int *)(local_148 + 0x18) + uVar6 + iVar4;
  *(int *)(local_148 + 0x1c) = *(int *)(local_148 + 0x1c) + uVar8;
  *(int *)(local_148 + 0x20) = *(int *)(local_148 + 0x20) + uVar17;
  *(int *)(local_148 + 0x24) = *(int *)(local_148 + 0x24) + uVar15;
  return 0;
}



undefined8 FUN_1401d0bd0(undefined8 *param_1)

{
  if (param_1 == (undefined8 *)0x0) {
    return 0x10;
  }
  *(undefined4 *)(param_1 + 1) = 0x6a09e667;
  *(undefined4 *)((longlong)param_1 + 0xc) = 0xbb67ae85;
  *(undefined4 *)(param_1 + 2) = 0x3c6ef372;
  *(undefined4 *)((longlong)param_1 + 0x14) = 0xa54ff53a;
  *(undefined4 *)(param_1 + 3) = 0x510e527f;
  *(undefined4 *)(param_1 + 5) = 0;
  *param_1 = 0;
  *(undefined4 *)((longlong)param_1 + 0x1c) = 0x9b05688c;
  *(undefined4 *)(param_1 + 4) = 0x1f83d9ab;
  *(undefined4 *)((longlong)param_1 + 0x24) = 0x5be0cd19;
  return 0;
}



undefined8 FUN_1401d0c20(longlong *param_1,void *param_2,uint param_3)

{
  undefined8 uVar1;
  uint uVar2;
  
  if (((param_1 != (longlong *)0x0) && (param_2 != (void *)0x0)) && (*(uint *)(param_1 + 5) < 0x41))
  {
    while( true ) {
      while( true ) {
        if (param_3 == 0) {
          return 0;
        }
        if (((int)param_1[5] == 0) && (0x3f < param_3)) break;
        uVar2 = 0x40 - (int)param_1[5];
        if (param_3 < uVar2) {
          uVar2 = param_3;
        }
        memcpy((void *)((ulonglong)*(uint *)(param_1 + 5) + 0x2c + (longlong)param_1),param_2,
               (ulonglong)uVar2);
        *(uint *)(param_1 + 5) = (int)param_1[5] + uVar2;
        param_2 = (void *)((longlong)param_2 + (ulonglong)uVar2);
        param_3 = param_3 - uVar2;
        if ((int)param_1[5] == 0x40) {
          uVar1 = FUN_1401cf210(param_1,(longlong)param_1 + 0x2c);
          if ((int)uVar1 != 0) {
            return uVar1;
          }
          *param_1 = *param_1 + 0x200;
          *(undefined4 *)(param_1 + 5) = 0;
        }
      }
      uVar1 = FUN_1401cf210(param_1,param_2);
      if ((int)uVar1 != 0) break;
      *param_1 = *param_1 + 0x200;
      param_2 = (void *)((longlong)param_2 + 0x40);
      param_3 = param_3 - 0x40;
    }
    return uVar1;
  }
  return 0x10;
}



undefined8 FUN_1401d0d00(longlong *param_1,undefined1 *param_2)

{
  uint uVar1;
  uint uVar2;
  
  if ((param_1 != (longlong *)0x0) && (param_2 != (undefined1 *)0x0)) {
    uVar1 = *(uint *)(param_1 + 5);
    if (uVar1 < 0x40) {
      *param_1 = *param_1 + (ulonglong)(uVar1 * 8);
      *(undefined1 *)((ulonglong)uVar1 + 0x2c + (longlong)param_1) = 0x80;
      *(int *)(param_1 + 5) = (int)param_1[5] + 1;
      uVar2 = *(uint *)(param_1 + 5);
      uVar1 = uVar2;
      if (0x38 < uVar2) {
        while (uVar1 < 0x40) {
          *(undefined1 *)((ulonglong)uVar2 + 0x2c + (longlong)param_1) = 0;
          *(int *)(param_1 + 5) = (int)param_1[5] + 1;
          uVar2 = *(uint *)(param_1 + 5);
          uVar1 = *(uint *)(param_1 + 5);
        }
        FUN_1401cf210(param_1,(longlong)param_1 + 0x2c);
        *(undefined4 *)(param_1 + 5) = 0;
      }
      uVar1 = *(uint *)(param_1 + 5);
      while (uVar1 < 0x38) {
        *(undefined1 *)((ulonglong)*(uint *)(param_1 + 5) + 0x2c + (longlong)param_1) = 0;
        *(int *)(param_1 + 5) = (int)param_1[5] + 1;
        uVar1 = *(uint *)(param_1 + 5);
      }
      *(undefined1 *)((longlong)param_1 + 100) = *(undefined1 *)((longlong)param_1 + 7);
      *(undefined1 *)((longlong)param_1 + 0x65) = *(undefined1 *)((longlong)param_1 + 6);
      *(undefined1 *)((longlong)param_1 + 0x66) = *(undefined1 *)((longlong)param_1 + 5);
      *(undefined1 *)((longlong)param_1 + 0x67) = *(undefined1 *)((longlong)param_1 + 4);
      *(undefined1 *)(param_1 + 0xd) = *(undefined1 *)((longlong)param_1 + 3);
      *(undefined1 *)((longlong)param_1 + 0x69) = *(undefined1 *)((longlong)param_1 + 2);
      *(undefined1 *)((longlong)param_1 + 0x6a) = *(undefined1 *)((longlong)param_1 + 1);
      *(char *)((longlong)param_1 + 0x6b) = (char)*param_1;
      FUN_1401cf210(param_1,(longlong)param_1 + 0x2c);
      *param_2 = *(undefined1 *)((longlong)param_1 + 0xb);
      param_2[1] = *(undefined1 *)((longlong)param_1 + 10);
      param_2[2] = *(undefined1 *)((longlong)param_1 + 9);
      param_2[3] = (char)param_1[1];
      param_2[4] = *(undefined1 *)((longlong)param_1 + 0xf);
      param_2[5] = *(undefined1 *)((longlong)param_1 + 0xe);
      param_2[6] = *(undefined1 *)((longlong)param_1 + 0xd);
      param_2[7] = *(undefined1 *)((longlong)param_1 + 0xc);
      param_2[8] = *(undefined1 *)((longlong)param_1 + 0x13);
      param_2[9] = *(undefined1 *)((longlong)param_1 + 0x12);
      param_2[10] = *(undefined1 *)((longlong)param_1 + 0x11);
      param_2[0xb] = (char)param_1[2];
      param_2[0xc] = *(undefined1 *)((longlong)param_1 + 0x17);
      param_2[0xd] = *(undefined1 *)((longlong)param_1 + 0x16);
      param_2[0xe] = *(undefined1 *)((longlong)param_1 + 0x15);
      param_2[0xf] = *(undefined1 *)((longlong)param_1 + 0x14);
      param_2[0x10] = *(undefined1 *)((longlong)param_1 + 0x1b);
      param_2[0x11] = *(undefined1 *)((longlong)param_1 + 0x1a);
      param_2[0x12] = *(undefined1 *)((longlong)param_1 + 0x19);
      param_2[0x13] = (char)param_1[3];
      param_2[0x14] = *(undefined1 *)((longlong)param_1 + 0x1f);
      param_2[0x15] = *(undefined1 *)((longlong)param_1 + 0x1e);
      param_2[0x16] = *(undefined1 *)((longlong)param_1 + 0x1d);
      param_2[0x17] = *(undefined1 *)((longlong)param_1 + 0x1c);
      param_2[0x18] = *(undefined1 *)((longlong)param_1 + 0x23);
      param_2[0x19] = *(undefined1 *)((longlong)param_1 + 0x22);
      param_2[0x1a] = *(undefined1 *)((longlong)param_1 + 0x21);
      param_2[0x1b] = (char)param_1[4];
      param_2[0x1c] = *(undefined1 *)((longlong)param_1 + 0x27);
      param_2[0x1d] = *(undefined1 *)((longlong)param_1 + 0x26);
      param_2[0x1e] = *(undefined1 *)((longlong)param_1 + 0x25);
      param_2[0x1f] = *(undefined1 *)((longlong)param_1 + 0x24);
      return 0;
    }
  }
  return 0x10;
}



void FUN_1401d0ee0(void *param_1,size_t param_2)

{
  if ((param_1 != (void *)0x0) && (param_2 != 0)) {
    memset(param_1,0,param_2);
  }
  return;
}



undefined8 FUN_1401d0f00(undefined8 *param_1)

{
  undefined8 *puVar1;
  undefined1 *puVar2;
  int iVar3;
  int iVar4;
  undefined8 local_res10 [3];
  
  iVar4 = 0;
  puVar2 = (undefined1 *)register0x00000020;
  puVar1 = param_1;
  while( true ) {
    if (puVar1 == (undefined8 *)0x0) {
      return 0;
    }
    iVar3 = (*DAT_140321090)();
    if (iVar3 != 0) break;
    puVar1 = *(undefined8 **)(puVar2 + 0x10);
    iVar4 = iVar4 + 1;
    puVar2 = puVar2 + 8;
  }
  for (; iVar4 != 0; iVar4 = iVar4 + -1) {
    (*DAT_1403210a0)(*param_1);
    param_1 = *(undefined8 **)((longlong)register0x00000020 + 0x10);
    register0x00000020 = (BADSPACEBASE *)((longlong)register0x00000020 + 8);
  }
  return 0xd;
}



void FUN_1401d0f90(longlong param_1)

{
  undefined1 *puVar1;
  longlong local_res10 [3];
  
  puVar1 = (undefined1 *)register0x00000020;
  while (param_1 != 0) {
    (*DAT_1403210a0)();
    param_1 = *(longlong *)(puVar1 + 0x10);
    puVar1 = puVar1 + 8;
  }
  return;
}



undefined4
FUN_1401d0fe0(longlong param_1,undefined4 param_2,int param_3,undefined4 param_4,undefined8 param_5)

{
  int iVar1;
  undefined4 uVar2;
  void *_Memory;
  undefined8 *puVar3;
  ulonglong _Size;
  ulonglong uVar4;
  undefined8 *puVar5;
  undefined8 uVar6;
  
  if (param_1 == 0) {
    return 0x10;
  }
  uVar4 = 0;
  _Size = uVar4;
  if (param_3 != 0) {
    puVar3 = &param_5;
    iVar1 = param_3;
    do {
      if (0xe < iVar1 - 1U) {
        return 0x10;
      }
      iVar1 = *(int *)(puVar3 + 1);
      _Size = (ulonglong)((int)_Size + 1);
      puVar3 = puVar3 + 3;
    } while (iVar1 != 0);
  }
  if ((int)_Size == 0) {
    return 2;
  }
  _Memory = calloc(0x38,_Size);
  if (_Memory == (void *)0x0) {
    return 0xd;
  }
  puVar3 = &param_5;
  if (param_3 != 0) {
    puVar5 = (undefined8 *)((longlong)_Memory + 8);
    uVar6 = param_5;
    do {
      if (0xe < param_3 - 1U) {
        uVar2 = 0x10;
        goto LAB_1401d10fa;
      }
      *(int *)(puVar5 + -1) = param_3;
      *(undefined4 *)(puVar5 + 1) = param_4;
      *puVar5 = uVar6;
      param_3 = *(int *)(puVar3 + 1);
      param_4 = *(undefined4 *)(puVar3 + 2);
      uVar6 = puVar3[3];
      puVar3 = puVar3 + 3;
      uVar4 = (ulonglong)((int)uVar4 + 1);
      puVar5 = puVar5 + 7;
    } while (param_3 != 0);
  }
  uVar2 = FUN_1401d1120(param_1,param_2,_Memory,uVar4,1);
LAB_1401d10fa:
  free(_Memory);
  return uVar2;
}



undefined8 FUN_1401d1120(char *param_1,uint param_2,longlong param_3,uint param_4,int param_5)

{
  byte bVar1;
  int iVar2;
  undefined4 *puVar3;
  undefined8 uVar4;
  int *piVar5;
  uint uVar6;
  ulonglong uVar7;
  byte *pbVar8;
  longlong lVar9;
  bool bVar10;
  uint local_res8;
  undefined4 uVar11;
  uint local_38;
  uint local_34;
  uint local_30;
  undefined4 local_2c;
  longlong local_28;
  
  uVar7 = (ulonglong)param_4;
  if ((param_1 == (char *)0x0) || (param_3 == 0)) {
    return 0x10;
  }
  if ((param_2 < 2) || ((*param_1 != '0' && (*param_1 != '1')))) {
    return 7;
  }
  bVar1 = param_1[1];
  local_34 = 1;
  if (bVar1 < 0x80) {
    local_res8 = (uint)bVar1;
    local_34 = 2;
  }
  else if ((char)bVar1 < '\0') {
    if (bVar1 < 0x81) {
      return 7;
    }
    if (0x83 < bVar1) {
      return 7;
    }
    uVar6 = bVar1 & 0x7f;
    local_34 = 2;
    if (param_2 < uVar6 + 2) {
      return 7;
    }
    local_res8 = 0;
    if ((bVar1 & 0x7f) != 0) {
      pbVar8 = (byte *)(param_1 + 2);
      local_34 = uVar6 + 2;
      do {
        bVar1 = *pbVar8;
        pbVar8 = pbVar8 + 1;
        local_res8 = local_res8 << 8 | (uint)bVar1;
        uVar6 = uVar6 - 1;
      } while (uVar6 != 0);
    }
  }
  else {
    local_res8 = (uint)param_1;
  }
  if (param_2 < local_res8 + local_34) {
    return 7;
  }
  if (param_4 != 0) {
    puVar3 = (undefined4 *)(param_3 + 0x14);
    do {
      *puVar3 = 0;
      puVar3 = puVar3 + 0xe;
      uVar7 = uVar7 - 1;
    } while (uVar7 != 0);
  }
  local_30 = 0;
  local_28 = 0;
  if (param_4 != 0) {
    do {
      lVar9 = local_28 * 0x38;
      local_2c = *(undefined4 *)(lVar9 + 0x10 + param_3);
      iVar2 = *(int *)(lVar9 + param_3);
      puVar3 = *(undefined4 **)(lVar9 + 8 + param_3);
      if ((param_5 == 0) && (*(int *)(lVar9 + 0x14 + param_3) == 1)) goto LAB_1401d1320;
      if (iVar2 == 0) break;
      local_38 = local_res8;
      switch(iVar2) {
      case 1:
        uVar4 = FUN_1401d7a10(param_1 + local_34);
        if ((int)uVar4 != 0) {
          return uVar4;
        }
        uVar4 = FUN_1401d79f0(&local_38);
        break;
      case 2:
        uVar4 = FUN_1401d7860(param_1 + local_34,local_res8);
        if ((int)uVar4 == 0) {
          uVar4 = FUN_1401d7760(puVar3);
          break;
        }
        goto LAB_1401d1304;
      case 3:
        uVar4 = FUN_1401d7700(param_1 + local_34,local_res8);
        if ((int)uVar4 != 0) goto LAB_1401d1304;
        uVar4 = FUN_1401d76b0(*puVar3);
        break;
      case 4:
        uVar4 = FUN_1401d7550(param_1 + local_34,local_res8,puVar3,&local_2c);
        if ((int)uVar4 != 0) goto LAB_1401d1304;
        *(undefined4 *)(lVar9 + 0x10 + param_3) = local_2c;
        uVar4 = FUN_1401d7500();
        break;
      case 5:
        uVar4 = FUN_1401d7400(param_1 + local_34,local_res8,puVar3,&local_2c);
        if ((int)uVar4 != 0) goto LAB_1401d1304;
        *(undefined4 *)(lVar9 + 0x10 + param_3) = local_2c;
        uVar4 = FUN_1401d73b0();
        break;
      case 6:
        if (((local_res8 < 2) || (param_1[local_34] != '\x05')) || (param_1[local_34 + 1] != '\0'))
        {
          if (param_5 != 0) {
            return 7;
          }
          goto LAB_1401d1320;
        }
        local_38 = 2;
        goto LAB_1401d12c8;
      case 7:
        uVar4 = FUN_1401d7230(param_1 + local_34,local_res8,puVar3,&local_2c);
        if ((int)uVar4 != 0) goto LAB_1401d1304;
        *(undefined4 *)(lVar9 + 0x10 + param_3) = local_2c;
        uVar4 = FUN_1401d7100(puVar3);
        break;
      case 8:
        uVar4 = FUN_1401d6fc0(param_1 + local_34,local_res8,puVar3,&local_2c);
        if ((int)uVar4 != 0) goto LAB_1401d1304;
        *(undefined4 *)(lVar9 + 0x10 + param_3) = local_2c;
        uVar4 = FUN_1401d6f20(puVar3);
        break;
      case 9:
        uVar4 = FUN_1401d6d80(param_1 + local_34,local_res8,puVar3,&local_2c);
        if ((int)uVar4 != 0) goto LAB_1401d1304;
        *(undefined4 *)(lVar9 + 0x10 + param_3) = local_2c;
        uVar4 = FUN_1401d6ce0(puVar3);
        break;
      case 10:
        uVar4 = FUN_1401d6ae0(param_1 + local_34,local_res8,puVar3,&local_2c);
        if ((int)uVar4 != 0) goto LAB_1401d1304;
        *(undefined4 *)(lVar9 + 0x10 + param_3) = local_2c;
        uVar4 = FUN_1401d69d0(puVar3);
        break;
      case 0xb:
        uVar4 = FUN_1401d66d0(param_1 + local_34);
        iVar2 = (int)uVar4;
        goto joined_r0x0001401d15c6;
      case 0xc:
        uVar4 = FUN_1401d60e0(param_1 + local_34);
        iVar2 = (int)uVar4;
joined_r0x0001401d15c6:
        if (iVar2 == 0) goto LAB_1401d12c8;
LAB_1401d1304:
        if (param_5 != 0) {
          return uVar4;
        }
        goto LAB_1401d1320;
      case 0xd:
      case 0xf:
        if (iVar2 == 0xf) {
          bVar10 = (param_1[local_34] & 0x3fU) == 0x31;
LAB_1401d15a2:
          if (!bVar10) {
            return 7;
          }
        }
        else if (iVar2 == 0xd) {
          bVar10 = (param_1[local_34] & 0x3fU) == 0x30;
          goto LAB_1401d15a2;
        }
        uVar11 = 1;
        goto LAB_1401d1544;
      case 0xe:
        uVar11 = 0;
LAB_1401d1544:
        uVar4 = FUN_1401d1120(param_1 + local_34,local_res8,puVar3,local_2c,uVar11);
        if ((int)uVar4 == 0) {
          uVar4 = FUN_1401d6450(puVar3);
          break;
        }
        goto LAB_1401d1304;
      default:
        return 0x10;
      }
      if ((int)uVar4 != 0) {
        return uVar4;
      }
LAB_1401d12c8:
      local_34 = local_34 + local_38;
      local_res8 = local_res8 - local_38;
      *(undefined4 *)(lVar9 + 0x14 + param_3) = 1;
      if (param_5 == 0) {
        local_30 = 0xffffffff;
        local_28 = -1;
      }
LAB_1401d1320:
      local_30 = local_30 + 1;
      local_28 = local_28 + 1;
    } while (local_30 < param_4);
  }
  uVar6 = 0;
  if (param_4 != 0) {
    piVar5 = (int *)(param_3 + 0x14);
    do {
      if (*piVar5 == 0) {
        return 7;
      }
      uVar6 = uVar6 + 1;
      piVar5 = piVar5 + 0xe;
    } while (uVar6 < param_4);
  }
  return 0;
}



undefined4
FUN_1401d1660(longlong param_1,longlong param_2,int param_3,undefined4 param_4,undefined8 param_5)

{
  int iVar1;
  undefined4 uVar2;
  void *_Memory;
  undefined8 *puVar3;
  ulonglong _Size;
  ulonglong uVar4;
  undefined8 *puVar5;
  undefined8 uVar6;
  bool bVar7;
  
  if ((param_1 == 0) || (param_2 == 0)) {
    return 0x10;
  }
  uVar4 = 0;
  _Size = uVar4;
  if (param_3 != 0) {
    puVar3 = &param_5;
    bVar7 = param_3 == 0;
    iVar1 = param_3;
    do {
      if ((bVar7 || iVar1 < 0) || ((0xb < iVar1 && (2 < iVar1 - 0xdU)))) {
        return 0x10;
      }
      iVar1 = *(int *)(puVar3 + 1);
      _Size = (ulonglong)((int)_Size + 1);
      puVar3 = puVar3 + 3;
      bVar7 = iVar1 == 0;
    } while (!bVar7);
  }
  if ((int)_Size == 0) {
    return 2;
  }
  _Memory = calloc(0x38,_Size);
  if (_Memory == (void *)0x0) {
    return 0xd;
  }
  puVar3 = &param_5;
  bVar7 = param_3 == 0;
  if (!bVar7) {
    puVar5 = (undefined8 *)((longlong)_Memory + 8);
    uVar6 = param_5;
    do {
      if ((bVar7 || param_3 < 0) || ((0xb < param_3 && (2 < param_3 - 0xdU)))) {
        uVar2 = 0x10;
        goto LAB_1401d178f;
      }
      *(int *)(puVar5 + -1) = param_3;
      *(undefined4 *)(puVar5 + 1) = param_4;
      *puVar5 = uVar6;
      param_3 = *(int *)(puVar3 + 1);
      param_4 = *(undefined4 *)(puVar3 + 2);
      uVar6 = puVar3[3];
      puVar3 = puVar3 + 3;
      uVar4 = (ulonglong)((int)uVar4 + 1);
      puVar5 = puVar5 + 7;
      bVar7 = param_3 == 0;
    } while (!bVar7);
  }
  uVar2 = FUN_1401d7a50(_Memory,uVar4,param_1,param_2,0xd);
LAB_1401d178f:
  free(_Memory);
  return uVar2;
}



ulonglong FUN_1401d17c0(longlong param_1,int param_2,undefined8 param_3,int param_4)

{
  int iVar1;
  uint uVar2;
  ulonglong uVar3;
  byte *_Memory;
  bool bVar4;
  int local_res8 [2];
  
  if (param_1 == 0) {
    return 0x10;
  }
  bVar4 = param_2 < 0;
  if (bVar4) {
    param_2 = -param_2;
  }
  if (0x1fe < param_2 - 2U) {
    return 0x17;
  }
  uVar3 = FUN_1401cbff0(param_4);
  if ((int)uVar3 == 0) {
    _Memory = calloc(1,(longlong)param_2);
    if (_Memory == (byte *)0x0) {
      uVar3 = 0xd;
    }
    else {
      do {
        iVar1 = (**(code **)(&DAT_14031a358 + (longlong)param_4 * 0x50))(_Memory,param_2,param_3);
        if (iVar1 != param_2) {
          free(_Memory);
          return 9;
        }
        *_Memory = *_Memory | 0xc0;
        _Memory[(longlong)param_2 - 1] = _Memory[(longlong)param_2 - 1] | bVar4 * '\x02' | 1U;
        uVar2 = (*DAT_140321120)(param_1,_Memory,param_2);
        if ((uVar2 != 0) || (uVar2 = (*DAT_1403211c8)(param_1,local_res8), uVar2 != 0)) {
          free(_Memory);
          return (ulonglong)uVar2;
        }
      } while (local_res8[0] == 0);
      free(_Memory);
      uVar3 = 0;
    }
  }
  return uVar3;
}



undefined8
FUN_1401d1920(void *param_1,uint param_2,int param_3,ulonglong param_4,undefined8 param_5,
             int param_6,undefined1 *param_7,uint *param_8)

{
  uint uVar1;
  int iVar2;
  undefined8 uVar3;
  char *pcVar4;
  uint uVar5;
  uint uVar6;
  ulonglong uVar7;
  char *_Dst;
  uint uVar8;
  
  if (param_3 != 1) {
    if (param_3 != 2) {
      return 0x18;
    }
    uVar3 = FUN_1401cbff0(param_6);
    if ((int)uVar3 != 0) {
      return uVar3;
    }
  }
  uVar3 = 0;
  uVar8 = (uint)((param_4 & 7) != 0) + ((uint)(param_4 >> 3) & 0x1fffffff);
  if (uVar8 < param_2 + 0xb) {
    return 0x16;
  }
  if (*param_8 < uVar8) {
    *param_8 = uVar8;
    uVar3 = 6;
  }
  else {
    _Dst = param_7 + 2;
    uVar5 = uVar8 - param_2;
    uVar6 = uVar5 - 3;
    if (param_3 == 2) {
      uVar1 = (**(code **)(&DAT_14031a358 + (longlong)param_6 * 0x50))(_Dst,uVar6,param_5);
      if (uVar1 != uVar6) {
        return 9;
      }
      uVar7 = 0;
      pcVar4 = _Dst;
      if (uVar6 != 0) {
        do {
          if (*pcVar4 == '\0') {
            do {
              iVar2 = (**(code **)(&DAT_14031a358 + (longlong)param_6 * 0x50))
                                (_Dst + uVar7,1,param_5);
              if (iVar2 != 1) {
                return 9;
              }
            } while (*pcVar4 == '\0');
          }
          uVar1 = (int)uVar7 + 1;
          uVar7 = (ulonglong)uVar1;
          pcVar4 = pcVar4 + 1;
        } while (uVar1 < uVar6);
      }
    }
    else {
      memset(_Dst,0xff,(ulonglong)uVar6);
    }
    *param_7 = 0;
    param_7[1] = (char)param_3;
    param_7[uVar5 - 1] = 0;
    memcpy(param_7 + uVar5,param_1,(ulonglong)param_2);
    *param_8 = uVar8;
  }
  return uVar3;
}



ulonglong FUN_1401d1af0(void *param_1,uint param_2,byte *param_3,undefined4 param_4,uint param_5,
                       undefined8 param_6,int param_7,int param_8,undefined1 *param_9,uint *param_10
                       )

{
  uint uVar1;
  uint uVar2;
  ulonglong uVar3;
  byte *_Memory;
  void *_Memory_00;
  byte *_Memory_01;
  byte *pbVar4;
  ulonglong uVar5;
  uint uVar6;
  int iVar7;
  uint uVar8;
  uint *puVar9;
  undefined4 uVar10;
  uint local_58 [6];
  
  if (((param_1 != (void *)0x0) && (param_9 != (undefined1 *)0x0)) && (param_10 != (uint *)0x0)) {
    uVar3 = FUN_1401d1e80(param_8);
    if (((int)uVar3 == 0) && (uVar3 = FUN_1401cbff0(param_7), (int)uVar3 == 0)) {
      uVar1 = *(uint *)(&DAT_14031ad3c + (longlong)param_8 * 0x80);
      uVar3 = (ulonglong)uVar1;
      uVar6 = (uint)((param_5 & 7) != 0) + (param_5 >> 3);
      if ((uVar1 * 2 < uVar6 - 2) && (iVar7 = uVar6 + uVar1 * -2, param_2 <= iVar7 - 2U)) {
        _Memory = malloc((ulonglong)uVar6);
        _Memory_00 = malloc((ulonglong)uVar6);
        _Memory_01 = malloc(uVar3);
        if (_Memory != (byte *)0x0) {
          if ((_Memory_00 != (void *)0x0) && (_Memory_01 != (byte *)0x0)) {
            if (param_3 == (byte *)0x0) {
              param_4 = 0;
              param_3 = _Memory;
            }
            puVar9 = local_58;
            local_58[0] = uVar6;
            uVar2 = FUN_1401d8110(param_8,param_3,param_4,_Memory,puVar9);
            uVar10 = (undefined4)((ulonglong)puVar9 >> 0x20);
            uVar5 = (ulonglong)uVar2;
            if (uVar2 == 0) {
              uVar2 = (iVar7 - param_2) - 2;
              local_58[0] = uVar1;
              memset(_Memory + uVar3,0,(ulonglong)uVar2);
              local_58[0] = local_58[0] + uVar2;
              _Memory[local_58[0]] = 1;
              local_58[0] = local_58[0] + 1;
              memcpy(_Memory + local_58[0],param_1,(ulonglong)param_2);
              local_58[0] = local_58[0] + param_2;
              uVar2 = (**(code **)(&DAT_14031a358 + (longlong)param_7 * 0x50))
                                (_Memory_01,uVar3,param_6);
              if (uVar2 == uVar1) {
                uVar8 = (uVar6 - uVar1) - 1;
                uVar2 = FUN_1401d7f50(param_8,_Memory_01,uVar1,_Memory_00,CONCAT44(uVar10,uVar8));
                uVar5 = (ulonglong)uVar2;
                if (uVar2 == 0) {
                  if (uVar8 != 0) {
                    uVar5 = (ulonglong)uVar8;
                    pbVar4 = _Memory;
                    do {
                      *pbVar4 = *pbVar4 ^ pbVar4[(longlong)_Memory_00 - (longlong)_Memory];
                      uVar5 = uVar5 - 1;
                      pbVar4 = pbVar4 + 1;
                    } while (uVar5 != 0);
                  }
                  uVar2 = FUN_1401d7f50(param_8,_Memory,uVar8,_Memory_00,uVar1);
                  uVar5 = (ulonglong)uVar2;
                  if (uVar2 == 0) {
                    if (uVar1 != 0) {
                      pbVar4 = _Memory_01;
                      uVar5 = uVar3;
                      do {
                        *pbVar4 = *pbVar4 ^ pbVar4[(longlong)_Memory_00 - (longlong)_Memory_01];
                        uVar5 = uVar5 - 1;
                        pbVar4 = pbVar4 + 1;
                      } while (uVar5 != 0);
                    }
                    if (*param_10 < uVar6) {
                      *param_10 = uVar6;
                      uVar5 = 6;
                    }
                    else {
                      *param_9 = 0;
                      local_58[0] = 1;
                      memcpy(param_9 + 1,_Memory_01,uVar3);
                      local_58[0] = local_58[0] + uVar1;
                      memcpy(param_9 + local_58[0],_Memory,(ulonglong)uVar8);
                      local_58[0] = (local_58[0] - 1) + (uVar6 - uVar1);
                      *param_10 = local_58[0];
                      uVar5 = 0;
                    }
                  }
                }
              }
              else {
                uVar5 = 9;
              }
            }
            free(_Memory_01);
            free(_Memory_00);
            free(_Memory);
            return uVar5;
          }
          free(_Memory);
        }
        if (_Memory_00 != (void *)0x0) {
          free(_Memory_00);
        }
        if (_Memory_01 != (byte *)0x0) {
          free(_Memory_01);
        }
        uVar3 = 0xd;
      }
      else {
        uVar3 = 0x16;
      }
    }
    return uVar3;
  }
  return 0x10;
}



undefined8 FUN_1401d1e80(uint param_1)

{
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_140321000);
  if ((param_1 < 0x20) && ((&DAT_14031ad30)[(longlong)(int)param_1 * 0x10] != 0)) {
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140321000);
    return 0;
  }
  LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140321000);
  return 0xb;
}



undefined8
FUN_1401d1ee0(char *param_1,uint param_2,int param_3,ulonglong param_4,void *param_5,uint *param_6,
             undefined4 *param_7)

{
  char *pcVar1;
  uint uVar2;
  ulonglong uVar3;
  uint uVar4;
  uint uVar5;
  
  uVar5 = (uint)((param_4 & 7) != 0) + ((uint)(param_4 >> 3) & 0x1fffffff);
  *param_7 = 0;
  if ((uVar5 < param_2) || (uVar5 < 0xb)) {
    return 0x16;
  }
  if ((*param_1 == '\0') && (param_1[1] == (char)param_3)) {
    uVar2 = 2;
    uVar3 = 2;
    if (param_3 == 2) {
      if (2 < uVar5) {
        pcVar1 = param_1 + 2;
        do {
          uVar2 = (uint)uVar3;
          if (*pcVar1 == '\0') break;
          uVar2 = uVar2 + 1;
          uVar3 = (ulonglong)uVar2;
          pcVar1 = pcVar1 + 1;
        } while (uVar2 < uVar5);
      }
      uVar4 = uVar2 - 2;
      if ((uVar2 + 1 < uVar5) && (7 < uVar4)) {
LAB_1401d1f9b:
        uVar5 = (param_2 - uVar4) - 3;
        uVar2 = *param_6;
        *param_6 = uVar5;
        if (uVar2 < uVar5) {
          return 6;
        }
        memcpy(param_5,param_1 + (uVar4 + 3),(ulonglong)uVar5);
        *param_7 = 1;
        return 0;
      }
    }
    else {
      if (2 < uVar5 - 1) {
        pcVar1 = param_1 + 2;
        do {
          if (*pcVar1 != -1) break;
          uVar2 = (int)uVar3 + 1;
          uVar3 = (ulonglong)uVar2;
          pcVar1 = pcVar1 + 1;
        } while (uVar2 < uVar5 - 1);
      }
      if (param_1[uVar3] == '\0') {
        uVar4 = (int)uVar3 - 2;
        goto LAB_1401d1f9b;
      }
    }
  }
  return 7;
}



ulonglong FUN_1401d2010(char *param_1,uint param_2,byte *param_3,undefined4 param_4,uint param_5,
                       int param_6,void *param_7,uint *param_8,undefined4 *param_9)

{
  uint uVar1;
  uint uVar2;
  int iVar3;
  ulonglong uVar4;
  byte *_Memory;
  void *_Memory_00;
  byte *_Memory_01;
  byte *pbVar5;
  ulonglong uVar6;
  uint uVar7;
  uint uVar8;
  uint uVar9;
  ulonglong uVar10;
  undefined8 in_stack_ffffffffffffffa8;
  undefined4 uVar11;
  uint local_48 [4];
  
  uVar11 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);
  if ((((param_1 == (char *)0x0) || (param_7 == (void *)0x0)) || (param_8 == (uint *)0x0)) ||
     (param_9 == (undefined4 *)0x0)) {
    return 0x10;
  }
  *param_9 = 0;
  uVar4 = FUN_1401d1e80(param_6);
  if ((int)uVar4 != 0) {
    return uVar4;
  }
  uVar1 = *(uint *)(&DAT_14031ad3c + (longlong)param_6 * 0x80);
  uVar4 = (ulonglong)uVar1;
  uVar8 = (uint)((param_5 & 7) != 0) + (param_5 >> 3);
  if ((uVar8 - 2 <= uVar1 * 2) || (param_2 != uVar8)) {
    return 0x16;
  }
  _Memory = malloc((ulonglong)uVar8);
  _Memory_00 = malloc((ulonglong)uVar8);
  _Memory_01 = malloc(uVar4);
  if (_Memory != (byte *)0x0) {
    if ((_Memory_00 != (void *)0x0) && (_Memory_01 != (byte *)0x0)) {
      if (*param_1 == '\0') {
        local_48[0] = 1;
        memcpy(_Memory_01,param_1 + 1,uVar4);
        local_48[0] = local_48[0] + uVar1;
        uVar9 = (uVar8 - uVar1) - 1;
        uVar10 = (ulonglong)uVar9;
        memcpy(_Memory,param_1 + local_48[0],(ulonglong)uVar9);
        local_48[0] = (local_48[0] - 1) + (uVar8 - uVar1);
        uVar7 = FUN_1401d7f50(param_6,_Memory,uVar9,_Memory_00,CONCAT44(uVar11,uVar1));
        if (uVar7 == 0) {
          if (uVar1 != 0) {
            pbVar5 = _Memory_01;
            uVar6 = uVar4;
            do {
              *pbVar5 = *pbVar5 ^ pbVar5[(longlong)_Memory_00 - (longlong)_Memory_01];
              uVar6 = uVar6 - 1;
              pbVar5 = pbVar5 + 1;
            } while (uVar6 != 0);
          }
          uVar7 = FUN_1401d7f50(param_6,_Memory_01,uVar1,_Memory_00,uVar9);
          if (uVar7 == 0) {
            if (uVar9 != 0) {
              pbVar5 = _Memory;
              do {
                *pbVar5 = *pbVar5 ^ pbVar5[(longlong)_Memory_00 - (longlong)_Memory];
                uVar10 = uVar10 - 1;
                pbVar5 = pbVar5 + 1;
              } while (uVar10 != 0);
            }
            if (param_3 == (byte *)0x0) {
              param_4 = 0;
              param_3 = _Memory;
            }
            local_48[0] = uVar8;
            uVar7 = FUN_1401d8110(param_6,param_3,param_4,_Memory_01,local_48);
            if (uVar7 == 0) {
              iVar3 = memcmp(_Memory_01,_Memory,uVar4);
              uVar2 = uVar1;
              if (iVar3 == 0) {
                for (; (uVar2 < uVar9 && (_Memory[uVar2] == 0)); uVar2 = uVar2 + 1) {
                }
                if ((uVar2 == uVar9) || (_Memory[uVar2] != 1)) {
                  uVar7 = 7;
                  local_48[0] = uVar2;
                  goto LAB_1401d2310;
                }
                local_48[0] = uVar2 + 1;
                uVar9 = ((uVar8 - local_48[0]) - uVar1) - 1;
                uVar7 = *param_8;
                *param_8 = uVar9;
                if (uVar7 < uVar9) {
                  uVar7 = 6;
                  goto LAB_1401d2310;
                }
                memcpy(param_7,_Memory + local_48[0],(ulonglong)uVar9);
                local_48[0] = uVar2 + (uVar8 - uVar1);
                *param_9 = 1;
              }
              uVar7 = 0;
            }
          }
        }
      }
      else {
        uVar7 = 0;
      }
LAB_1401d2310:
      free(_Memory_01);
      free(_Memory_00);
      free(_Memory);
      return (ulonglong)uVar7;
    }
    free(_Memory);
  }
  if (_Memory_00 != (void *)0x0) {
    free(_Memory_00);
  }
  if (_Memory_01 != (byte *)0x0) {
    free(_Memory_01);
  }
  return 0xd;
}



undefined8 FUN_1401d2390(longlong param_1,uint param_2)

{
  int iVar1;
  void *pvVar2;
  uint uVar3;
  ulonglong uVar4;
  longlong lVar5;
  int iVar6;
  
  if (*(int *)(param_1 + 4) < (int)param_2) {
    uVar3 = param_2 & 0x8000001f;
    if ((int)uVar3 < 0) {
      uVar3 = (uVar3 - 1 | 0xffffffe0) + 1;
    }
    iVar6 = param_2 + (0x40 - uVar3);
    pvVar2 = realloc(*(void **)(param_1 + 0x10),(longlong)iVar6 << 2);
    if (pvVar2 == (void *)0x0) {
      return 0xfffffffe;
    }
    iVar1 = *(int *)(param_1 + 4);
    uVar4 = (ulonglong)iVar1;
    *(void **)(param_1 + 0x10) = pvVar2;
    *(int *)(param_1 + 4) = iVar6;
    if (iVar1 < iVar6) {
      lVar5 = uVar4 << 2;
      do {
        uVar3 = (int)uVar4 + 1;
        uVar4 = (ulonglong)uVar3;
        *(undefined4 *)(lVar5 + *(longlong *)(param_1 + 0x10)) = 0;
        lVar5 = lVar5 + 4;
      } while ((int)uVar3 < *(int *)(param_1 + 4));
    }
  }
  return 0;
}



void FUN_1401d2430(int *param_1)

{
  int iVar1;
  
  iVar1 = *param_1;
  if (0 < iVar1) {
    do {
      if (*(int *)(*(longlong *)(param_1 + 4) + -4 + (longlong)*param_1 * 4) != 0) break;
      iVar1 = *param_1 + -1;
      *param_1 = iVar1;
    } while (0 < iVar1);
    iVar1 = *param_1;
  }
  if (iVar1 == 0) {
    param_1[2] = 0;
  }
  return;
}



undefined8 FUN_1401d2470(int *param_1,int param_2,int *param_3)

{
  undefined8 uVar1;
  byte bVar2;
  uint uVar3;
  uint uVar4;
  uint *puVar5;
  uint uVar6;
  
  if ((((param_1 == param_3) || (uVar1 = FUN_1401cc3a0(param_1,param_3), (int)uVar1 == 0)) &&
      ((param_2 / 0x1c + 1 + *param_3 <= param_3[1] ||
       (uVar1 = FUN_1401d2390(param_3), (int)uVar1 == 0)))) &&
     ((param_2 < 0x1c || (uVar1 = FUN_1401d4520(param_3,param_2 / 0x1c), (int)uVar1 == 0)))) {
    if (param_2 % 0x1c != 0) {
      puVar5 = *(uint **)(param_3 + 4);
      uVar4 = 0;
      bVar2 = (byte)(param_2 % 0x1c);
      uVar6 = uVar4;
      if (0 < *param_3) {
        do {
          uVar6 = uVar6 + 1;
          uVar3 = *puVar5 >> (0x1c - bVar2 & 0x1f) & (1 << (bVar2 & 0x1f)) - 1U;
          *puVar5 = (*puVar5 << (bVar2 & 0x1f) | uVar4) & 0xfffffff;
          puVar5 = puVar5 + 1;
          uVar4 = uVar3;
        } while ((int)uVar6 < *param_3);
        if (uVar3 != 0) {
          *(uint *)(*(longlong *)(param_3 + 4) + (longlong)*param_3 * 4) = uVar3;
          *param_3 = *param_3 + 1;
        }
      }
    }
    FUN_1401d2430(param_3);
    uVar1 = 0;
  }
  return uVar1;
}



void FUN_1401d2570(undefined4 *param_1)

{
  undefined4 *puVar1;
  int iVar2;
  
  puVar1 = *(undefined4 **)(param_1 + 4);
  iVar2 = 0;
  param_1[2] = 0;
  *param_1 = 0;
  if (0 < (int)param_1[1]) {
    do {
      *puVar1 = 0;
      iVar2 = iVar2 + 1;
      puVar1 = puVar1 + 1;
    } while (iVar2 < (int)param_1[1]);
  }
  return;
}



undefined8 FUN_1401d25a0(int *param_1,int *param_2)

{
  int iVar1;
  uint uVar2;
  uint uVar3;
  int iVar4;
  uint *puVar5;
  longlong lVar6;
  
  iVar1 = *param_1;
  if (*param_2 < iVar1) {
    return 1;
  }
  if (iVar1 < *param_2) {
    return 0xffffffff;
  }
  puVar5 = (uint *)(*(longlong *)(param_1 + 4) + (longlong)(iVar1 + -1) * 4);
  iVar4 = 0;
  if (0 < iVar1) {
    lVar6 = (*(longlong *)(param_2 + 4) + (longlong)(iVar1 + -1) * 4) - (longlong)puVar5;
    do {
      uVar2 = *puVar5;
      uVar3 = *(uint *)(lVar6 + (longlong)puVar5);
      if (uVar2 >= uVar3 && uVar2 != uVar3) {
        return 1;
      }
      if (uVar2 < uVar3) {
        return 0xffffffff;
      }
      iVar4 = iVar4 + 1;
      puVar5 = puVar5 + -1;
    } while (iVar4 < iVar1);
  }
  return 0;
}



void FUN_1401d2600(undefined1 *param_1,int param_2)

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 *puVar3;
  undefined1 *puVar4;
  
  lVar2 = (longlong)(param_2 + -1);
  if (0 < param_2 + -1) {
    puVar3 = param_1;
    do {
      uVar1 = *puVar3;
      puVar4 = puVar3 + 1;
      *puVar3 = param_1[lVar2];
      param_1[lVar2] = uVar1;
      lVar2 = lVar2 + -1;
      puVar3 = puVar4;
    } while ((longlong)puVar4 - (longlong)param_1 < lVar2);
  }
  return;
}



undefined8 FUN_1401d2650(int *param_1,uint param_2,longlong param_3,uint *param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  int iVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  longlong lVar6;
  int local_28 [2];
  int local_20;
  longlong local_18;
  
  uVar5 = (ulonglong)param_2;
  if (param_2 == 0) {
    return 0xfffffffd;
  }
  if ((param_2 == 1) || (*param_1 == 0)) {
    if (param_4 != (uint *)0x0) {
      *param_4 = 0;
    }
    if (param_3 != 0) {
      uVar2 = FUN_1401cc3a0(param_1,param_3);
      return uVar2;
    }
  }
  else {
    if ((param_2 & param_2 - 1) == 0) {
      iVar3 = 0;
      do {
        if (param_2 == 1 << ((byte)iVar3 & 0x1f)) {
          if (param_4 != (uint *)0x0) {
            *param_4 = (1 << ((byte)iVar3 & 0x1f)) - 1U & **(uint **)(param_1 + 4);
          }
          if (param_3 == 0) {
            return 0;
          }
          uVar2 = FUN_1401d2800(param_1,iVar3,param_3,0);
          return uVar2;
        }
        iVar3 = iVar3 + 1;
      } while (iVar3 < 0x1c);
    }
    if (param_2 == 3) {
      uVar2 = FUN_1401d8220(param_1,param_3,param_4);
      return uVar2;
    }
    uVar2 = FUN_1401d45b0(local_28);
    if ((int)uVar2 != 0) {
      return uVar2;
    }
    local_28[0] = *param_1;
    local_20 = param_1[2];
    uVar4 = 0;
    lVar6 = (longlong)(local_28[0] + -1);
    if (-1 < local_28[0] + -1) {
      do {
        uVar4 = (ulonglong)*(uint *)(*(longlong *)(param_1 + 4) + lVar6 * 4) | uVar4 << 0x1c;
        if (uVar4 < uVar5) {
          uVar1 = 0;
        }
        else {
          uVar1 = (undefined4)(uVar4 / uVar5);
          uVar4 = uVar4 - (uVar4 / uVar5 & 0xffffffff) * uVar5;
        }
        lVar6 = lVar6 + -1;
        *(undefined4 *)(local_18 + 4 + lVar6 * 4) = uVar1;
      } while (-1 < lVar6);
    }
    if (param_4 != (uint *)0x0) {
      *param_4 = (uint)uVar4;
    }
    if (param_3 != 0) {
      FUN_1401d2430(local_28);
      FUN_1401d4470(local_28,param_3);
    }
    FUN_1401cc300(local_28);
  }
  return 0;
}



void FUN_1401d27d0(undefined8 param_1,undefined8 param_2)

{
  int iVar1;
  
  iVar1 = FUN_1401cc2a0();
  if (iVar1 == 0) {
    FUN_1401cc3a0(param_2,param_1);
  }
  return;
}



ulonglong FUN_1401d2800(undefined8 param_1,int param_2,int *param_3,longlong param_4)

{
  uint *puVar1;
  uint uVar2;
  ulonglong uVar3;
  byte bVar4;
  uint uVar5;
  int iVar6;
  undefined1 local_28 [32];
  
  if (param_2 < 1) {
    uVar2 = FUN_1401cc3a0(param_1,param_3);
    uVar3 = (ulonglong)uVar2;
    if (param_4 != 0) {
      FUN_1401d2570(param_4);
    }
  }
  else {
    uVar3 = FUN_1401cc2a0(local_28);
    if ((int)uVar3 == 0) {
      if (param_4 != 0) {
        uVar2 = FUN_1401d8310(param_1,param_2,local_28);
        if (uVar2 != 0) {
          FUN_1401cc300(local_28);
          return (ulonglong)uVar2;
        }
      }
      uVar2 = FUN_1401cc3a0(param_1,param_3);
      uVar3 = (ulonglong)uVar2;
      if (uVar2 == 0) {
        if (0x1b < param_2) {
          FUN_1401d44a0(param_3,param_2 / 0x1c);
        }
        if (param_2 % 0x1c != 0) {
          uVar2 = 0;
          bVar4 = (byte)(param_2 % 0x1c);
          iVar6 = *param_3 + -1;
          puVar1 = (uint *)(*(longlong *)(param_3 + 4) + (longlong)iVar6 * 4);
          for (; -1 < iVar6; iVar6 = iVar6 + -1) {
            uVar5 = uVar2 << (0x1c - bVar4 & 0x1f);
            uVar2 = *puVar1 & (1 << (bVar4 & 0x1f)) - 1U;
            *puVar1 = *puVar1 >> (bVar4 & 0x1f) | uVar5;
            puVar1 = puVar1 + -1;
          }
        }
        FUN_1401d2430(param_3);
        if (param_4 != 0) {
          FUN_1401d4470(local_28,param_4);
        }
        FUN_1401cc300(local_28);
        uVar3 = 0;
      }
      else {
        FUN_1401cc300(local_28);
      }
    }
  }
  return uVar3;
}



undefined8 FUN_1401d2980(int *param_1,uint *param_2,int *param_3)

{
  int iVar1;
  uint uVar2;
  int iVar3;
  int iVar4;
  uint uVar5;
  undefined8 uVar6;
  uint *puVar7;
  uint *_Dst;
  ulonglong uVar8;
  uint uVar9;
  int *piVar10;
  longlong lVar11;
  int *piVar12;
  
  iVar1 = *param_1;
  uVar2 = *param_2;
  uVar8 = (ulonglong)uVar2;
  if ((iVar1 <= param_3[1]) || (uVar6 = FUN_1401d2390(param_3), (int)uVar6 == 0)) {
    iVar3 = *param_3;
    _Dst = *(uint **)(param_3 + 4);
    uVar5 = 0;
    *param_3 = iVar1;
    piVar10 = *(int **)(param_1 + 4);
    piVar12 = *(int **)(param_2 + 4);
    puVar7 = _Dst;
    uVar9 = 0;
    if (0 < (int)uVar2) {
      do {
        iVar4 = *piVar10;
        _Dst = puVar7 + 1;
        piVar10 = piVar10 + 1;
        uVar5 = (iVar4 - *piVar12) - uVar5;
        *puVar7 = uVar5 & 0xfffffff;
        uVar5 = uVar5 >> 0x1f;
        uVar8 = uVar8 - 1;
        puVar7 = _Dst;
        piVar12 = piVar12 + 1;
        uVar9 = uVar2;
      } while (uVar8 != 0);
    }
    if ((int)uVar9 < iVar1) {
      lVar11 = (longlong)piVar10 - (longlong)_Dst;
      uVar8 = (ulonglong)(iVar1 - uVar9);
      puVar7 = _Dst;
      do {
        _Dst = puVar7 + 1;
        uVar5 = *(int *)(lVar11 + (longlong)puVar7) - uVar5;
        *puVar7 = uVar5;
        *puVar7 = *puVar7 & 0xfffffff;
        uVar5 = uVar5 >> 0x1f;
        uVar8 = uVar8 - 1;
        puVar7 = _Dst;
      } while (uVar8 != 0);
    }
    if (*param_3 < iVar3) {
      memset(_Dst,0,(ulonglong)(uint)(iVar3 - *param_3) << 2);
    }
    FUN_1401d2430(param_3);
    uVar6 = 0;
  }
  return uVar6;
}



undefined8 FUN_1401d2a80(uint *param_1,uint *param_2,int *param_3)

{
  int iVar1;
  int iVar2;
  int iVar3;
  uint uVar4;
  undefined8 uVar5;
  int *piVar6;
  uint uVar7;
  uint uVar8;
  int *piVar9;
  longlong lVar10;
  uint *puVar11;
  uint *puVar12;
  ulonglong uVar13;
  uint uVar14;
  uint *puVar15;
  
  uVar14 = *param_1;
  uVar4 = *param_2;
  puVar15 = param_2;
  uVar7 = uVar4;
  if ((int)uVar4 < (int)uVar14) {
    puVar15 = param_1;
    uVar7 = uVar14;
    uVar14 = uVar4;
  }
  if (((int)(uVar7 + 1) <= param_3[1]) || (uVar5 = FUN_1401d2390(param_3), (int)uVar5 == 0)) {
    iVar1 = *param_3;
    puVar12 = *(uint **)(param_3 + 4);
    *param_3 = uVar7 + 1;
    piVar6 = *(int **)(param_1 + 4);
    piVar9 = *(int **)(param_2 + 4);
    uVar4 = 0;
    uVar8 = 0;
    if (0 < (int)uVar14) {
      uVar13 = (ulonglong)uVar14;
      puVar11 = puVar12;
      do {
        iVar2 = *piVar9;
        puVar12 = puVar11 + 1;
        piVar9 = piVar9 + 1;
        iVar3 = *piVar6;
        piVar6 = piVar6 + 1;
        uVar4 = iVar2 + iVar3 + uVar4;
        *puVar11 = uVar4 & 0xfffffff;
        uVar4 = uVar4 >> 0x1c;
        uVar13 = uVar13 - 1;
        puVar11 = puVar12;
        uVar8 = uVar14;
      } while (uVar13 != 0);
    }
    if (uVar14 != uVar7) {
      lVar10 = (longlong)(int)uVar8;
      while (lVar10 < (int)uVar7) {
        lVar10 = lVar10 + 1;
        uVar4 = uVar4 + *(int *)(*(longlong *)(puVar15 + 4) + -4 + lVar10 * 4);
        *puVar12 = uVar4;
        *puVar12 = *puVar12 & 0xfffffff;
        uVar4 = uVar4 >> 0x1c;
        puVar12 = puVar12 + 1;
      }
    }
    *puVar12 = uVar4;
    if (*param_3 < iVar1) {
      memset(puVar12 + 1,0,(ulonglong)(uint)(iVar1 - *param_3) << 2);
    }
    FUN_1401d2430(param_3);
    uVar5 = 0;
  }
  return uVar5;
}



undefined8 FUN_1401d2bb0(uint *param_1,uint *param_2,undefined8 param_3,uint param_4)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  undefined8 uVar4;
  ulonglong uVar5;
  longlong lVar6;
  uint *puVar7;
  uint uVar8;
  ulonglong uVar9;
  uint uVar10;
  int iVar11;
  uint *puVar12;
  uint *puVar13;
  uint uVar14;
  ulonglong uVar15;
  uint local_48 [4];
  longlong local_38;
  
  if ((int)param_4 < 0x200) {
    uVar14 = *param_2;
    if ((int)*param_1 < (int)*param_2) {
      uVar14 = *param_1;
    }
    if ((int)uVar14 < 0x100) {
      uVar4 = FUN_1401d2d10();
      return uVar4;
    }
  }
  uVar4 = FUN_1401d45b0(local_48);
  if ((int)uVar4 == 0) {
    uVar14 = *param_1;
    iVar11 = 0;
    lVar6 = 0;
    uVar2 = param_4;
    if (0 < (longlong)(int)uVar14) {
      do {
        puVar7 = *(uint **)(param_2 + 4);
        uVar9 = 0;
        uVar8 = 0;
        uVar3 = uVar2;
        if ((int)*param_2 < (int)uVar2) {
          uVar3 = *param_2;
        }
        uVar15 = (ulonglong)uVar3;
        uVar1 = *(uint *)(*(longlong *)(param_1 + 4) + lVar6 * 4);
        puVar13 = (uint *)(local_38 + (longlong)iVar11 * 4);
        puVar12 = puVar13;
        uVar10 = 0;
        if (0 < (int)uVar3) {
          do {
            uVar8 = *puVar7;
            puVar13 = puVar12 + 1;
            puVar7 = puVar7 + 1;
            uVar5 = (ulonglong)uVar8 * (ulonglong)uVar1 + (ulonglong)*puVar12 + (uVar9 & 0xffffffff)
            ;
            uVar9 = uVar5 >> 0x1c;
            uVar8 = (uint)uVar9;
            uVar15 = uVar15 - 1;
            *puVar12 = (uint)uVar5 & 0xfffffff;
            puVar12 = puVar13;
            uVar10 = uVar3;
          } while (uVar15 != 0);
        }
        if ((int)(uVar10 + iVar11) < (int)param_4) {
          *puVar13 = uVar8;
        }
        lVar6 = lVar6 + 1;
        iVar11 = iVar11 + 1;
        uVar2 = uVar2 - 1;
      } while (lVar6 < (int)uVar14);
    }
    local_48[0] = param_4;
    FUN_1401d2430(local_48);
    FUN_1401d4470(local_48,param_3);
    FUN_1401cc300(local_48);
    uVar4 = 0;
  }
  return uVar4;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

undefined8 FUN_1401d2d10(int *param_1,int *param_2,int *param_3,int param_4)

{
  int iVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  uint uVar5;
  uint uVar6;
  undefined8 uVar7;
  int iVar8;
  ulonglong uVar9;
  int iVar10;
  void *_Dst;
  uint *puVar11;
  uint *puVar12;
  ulonglong uVar13;
  ulonglong uVar14;
  int iVar15;
  undefined1 auStack_878 [32];
  int *local_858;
  uint auStack_84c [513];
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_878;
  local_858 = param_3;
  if ((param_4 <= param_3[1]) || (uVar7 = FUN_1401d2390(param_3), (int)uVar7 == 0)) {
    iVar2 = *param_1;
    iVar15 = *param_2 + iVar2;
    if (param_4 < iVar15) {
      iVar15 = param_4;
    }
    uVar9 = 0;
    if (0 < iVar15) {
      lVar3 = *(longlong *)(param_1 + 4);
      lVar4 = *(longlong *)(param_2 + 4);
      iVar1 = *param_2 + -1;
      uVar13 = uVar9;
      uVar14 = uVar9;
      do {
        iVar10 = (int)uVar9;
        iVar8 = iVar10;
        if (iVar1 < iVar10) {
          iVar8 = iVar1;
        }
        puVar11 = (uint *)(lVar3 + (longlong)(iVar10 - iVar8) * 4);
        puVar12 = (uint *)(lVar4 + (longlong)iVar8 * 4);
        uVar5 = iVar2 - (iVar10 - iVar8);
        uVar6 = iVar8 + 1U;
        if ((int)uVar5 < (int)(iVar8 + 1U)) {
          uVar6 = uVar5;
        }
        uVar9 = (ulonglong)uVar6;
        if (0 < (int)uVar6) {
          do {
            uVar6 = *puVar12;
            uVar5 = *puVar11;
            puVar12 = puVar12 + -1;
            puVar11 = puVar11 + 1;
            uVar13 = uVar13 + (ulonglong)uVar6 * (ulonglong)uVar5;
            uVar9 = uVar9 - 1;
          } while (uVar9 != 0);
        }
        uVar14 = uVar14 + 1;
        uVar9 = (ulonglong)(iVar10 + 1);
        uVar6 = (uint)uVar13;
        uVar13 = uVar13 >> 0x1c;
        auStack_84c[uVar14] = uVar6 & 0xfffffff;
        param_3 = local_858;
      } while ((longlong)uVar14 < (longlong)iVar15);
    }
    iVar2 = *param_3;
    _Dst = *(void **)(param_3 + 4);
    uVar5 = iVar15 + 1;
    *param_3 = iVar15;
    uVar6 = 0;
    if (0 < (int)uVar5) {
      memcpy(_Dst,auStack_84c + 1,(ulonglong)uVar5 << 2);
      _Dst = (void *)((longlong)_Dst + (ulonglong)uVar5 * 4);
      uVar6 = uVar5;
    }
    if ((int)uVar6 < iVar2) {
      memset(_Dst,0,(ulonglong)(iVar2 - uVar6) << 2);
    }
    FUN_1401d2430(param_3);
    uVar7 = 0;
  }
  return uVar7;
}



undefined4 FUN_1401d2eb0(int *param_1,int *param_2,undefined8 param_3)

{
  int iVar1;
  int iVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  uint uVar5;
  uint uVar6;
  ulonglong uVar7;
  undefined4 uVar8;
  uint local_c8 [4];
  undefined4 *local_b8;
  undefined1 local_b0 [24];
  uint local_98 [4];
  undefined4 *local_88;
  undefined1 local_80 [24];
  int local_68 [4];
  undefined4 *local_58;
  int local_50 [4];
  undefined4 *local_40;
  undefined1 local_38 [32];
  
  iVar1 = *param_2;
  if (*param_1 < *param_2) {
    iVar1 = *param_1;
  }
  uVar8 = 0xfffffffe;
  uVar5 = iVar1 >> 1;
  iVar1 = FUN_1401d45b0(local_c8,uVar5);
  if (iVar1 == 0) {
    iVar1 = FUN_1401d45b0(local_68,*param_1 - uVar5);
    if (iVar1 == 0) {
      iVar1 = FUN_1401d45b0(local_98,uVar5);
      if (iVar1 == 0) {
        iVar1 = FUN_1401d45b0(local_50,*param_2 - uVar5);
        if (iVar1 == 0) {
          iVar1 = uVar5 * 2;
          iVar2 = FUN_1401d45b0(local_b0,iVar1);
          if (iVar2 == 0) {
            iVar2 = FUN_1401d45b0(local_38,iVar1);
            if (iVar2 == 0) {
              iVar2 = FUN_1401d45b0(local_80,iVar1);
              if (iVar2 == 0) {
                puVar4 = *(undefined4 **)(param_1 + 4);
                puVar3 = *(undefined4 **)(param_2 + 4);
                local_68[0] = *param_1 - uVar5;
                local_50[0] = *param_2 - uVar5;
                if (0 < (int)uVar5) {
                  uVar7 = (ulonglong)uVar5;
                  do {
                    *local_b8 = *puVar4;
                    puVar4 = puVar4 + 1;
                    *local_88 = *puVar3;
                    puVar3 = puVar3 + 1;
                    uVar7 = uVar7 - 1;
                    local_b8 = local_b8 + 1;
                    local_88 = local_88 + 1;
                  } while (uVar7 != 0);
                }
                uVar6 = uVar5;
                if ((int)uVar5 < *param_1) {
                  do {
                    uVar6 = uVar6 + 1;
                    *local_58 = *puVar4;
                    puVar4 = puVar4 + 1;
                    local_58 = local_58 + 1;
                  } while ((int)uVar6 < *param_1);
                }
                uVar6 = uVar5;
                if ((int)uVar5 < *param_2) {
                  do {
                    uVar6 = uVar6 + 1;
                    *local_40 = *puVar3;
                    puVar3 = puVar3 + 1;
                    local_40 = local_40 + 1;
                  } while ((int)uVar6 < *param_2);
                }
                local_c8[0] = uVar5;
                local_98[0] = uVar5;
                FUN_1401d2430(local_c8);
                FUN_1401d2430(local_98);
                iVar2 = FUN_1401ccd60(local_c8,local_98,local_38);
                if ((((((iVar2 == 0) &&
                       (iVar2 = FUN_1401ccd60(local_68,local_50,local_80), iVar2 == 0)) &&
                      (iVar2 = FUN_1401d2a80(local_68,local_c8,local_b0), iVar2 == 0)) &&
                     ((iVar2 = FUN_1401d2a80(local_50,local_98,local_c8), iVar2 == 0 &&
                      (iVar2 = FUN_1401ccd60(local_b0,local_c8,local_b0), iVar2 == 0)))) &&
                    ((iVar2 = FUN_1401cc9e0(local_38,local_80,local_c8), iVar2 == 0 &&
                     ((iVar2 = FUN_1401d2980(local_b0,local_c8,local_b0), iVar2 == 0 &&
                      (iVar2 = FUN_1401d4520(local_b0,uVar5), iVar2 == 0)))))) &&
                   ((iVar1 = FUN_1401d4520(local_80,iVar1), iVar1 == 0 &&
                    (iVar1 = FUN_1401cc9e0(local_38,local_b0,local_b0), iVar1 == 0)))) {
                  iVar1 = FUN_1401cc9e0(local_b0,local_80,param_3);
                  uVar8 = 0xfffffffe;
                  if (iVar1 == 0) {
                    uVar8 = 0;
                  }
                }
                FUN_1401cc300(local_80);
              }
              FUN_1401cc300(local_38);
            }
            FUN_1401cc300(local_b0);
          }
          FUN_1401cc300(local_50);
        }
        FUN_1401cc300(local_98);
      }
      FUN_1401cc300(local_68);
    }
    FUN_1401cc300(local_c8);
  }
  return uVar8;
}



ulonglong FUN_1401d3190(int *param_1,int *param_2,undefined8 param_3)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  ulonglong uVar4;
  int iVar5;
  undefined1 local_158 [24];
  undefined1 local_140 [24];
  undefined1 local_128 [24];
  undefined1 local_110 [24];
  undefined1 local_f8 [24];
  undefined1 local_e0 [24];
  undefined1 local_c8 [24];
  undefined1 local_b0 [24];
  undefined1 local_98 [24];
  undefined1 local_80 [24];
  undefined1 local_68 [24];
  undefined1 local_50 [24];
  undefined1 local_38 [32];
  
  uVar4 = FUN_1401d46d0(local_38,local_f8,local_128,local_110,local_b0,local_50,local_e0,local_98,
                        local_68,local_c8,local_80,local_158,local_140,0);
  if ((int)uVar4 == 0) {
    iVar1 = *param_2;
    if (*param_1 < *param_2) {
      iVar1 = *param_1;
    }
    iVar1 = iVar1 / 3;
    iVar5 = iVar1 * 0x1c;
    uVar3 = FUN_1401d8310(param_1,iVar5,local_50);
    uVar4 = (ulonglong)uVar3;
    if (uVar3 == 0) {
      uVar3 = FUN_1401cc3a0(param_1,local_e0);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 == 0) {
        FUN_1401d44a0(local_e0,iVar1);
        FUN_1401d8310(local_e0,iVar5,local_e0);
        uVar3 = FUN_1401cc3a0(param_1,local_98);
        uVar4 = (ulonglong)uVar3;
        if (uVar3 == 0) {
          iVar2 = iVar1 * 2;
          FUN_1401d44a0(local_98,iVar2);
          uVar3 = FUN_1401d8310(param_2,iVar5,local_68);
          uVar4 = (ulonglong)uVar3;
          if (uVar3 == 0) {
            uVar3 = FUN_1401cc3a0(param_2,local_c8);
            uVar4 = (ulonglong)uVar3;
            if (uVar3 == 0) {
              FUN_1401d44a0(local_c8,iVar1);
              FUN_1401d8310(local_c8,iVar5,local_c8);
              uVar3 = FUN_1401cc3a0(param_2,local_80);
              uVar4 = (ulonglong)uVar3;
              if (uVar3 == 0) {
                FUN_1401d44a0(local_80,iVar2);
                uVar3 = FUN_1401ccd60(local_50,local_68,local_38);
                uVar4 = (ulonglong)uVar3;
                if (uVar3 == 0) {
                  uVar3 = FUN_1401ccd60(local_98,local_80,local_b0);
                  uVar4 = (ulonglong)uVar3;
                  if (uVar3 == 0) {
                    uVar3 = FUN_1401d4f20(local_50,local_158);
                    uVar4 = (ulonglong)uVar3;
                    if (uVar3 == 0) {
                      uVar3 = FUN_1401cc9e0(local_158,local_e0,local_158);
                      uVar4 = (ulonglong)uVar3;
                      if (uVar3 == 0) {
                        uVar3 = FUN_1401d4f20(local_158,local_158);
                        uVar4 = (ulonglong)uVar3;
                        if (uVar3 == 0) {
                          uVar3 = FUN_1401cc9e0(local_158,local_98,local_158);
                          uVar4 = (ulonglong)uVar3;
                          if (uVar3 == 0) {
                            uVar3 = FUN_1401d4f20(local_68,local_140);
                            uVar4 = (ulonglong)uVar3;
                            if (uVar3 == 0) {
                              uVar3 = FUN_1401cc9e0(local_140,local_c8,local_140);
                              uVar4 = (ulonglong)uVar3;
                              if (uVar3 == 0) {
                                uVar3 = FUN_1401d4f20(local_140,local_140);
                                uVar4 = (ulonglong)uVar3;
                                if (uVar3 == 0) {
                                  uVar3 = FUN_1401cc9e0(local_140,local_80,local_140);
                                  uVar4 = (ulonglong)uVar3;
                                  if (uVar3 == 0) {
                                    uVar3 = FUN_1401ccd60(local_158,local_140,local_f8);
                                    uVar4 = (ulonglong)uVar3;
                                    if (uVar3 == 0) {
                                      uVar3 = FUN_1401d4f20(local_98,local_158);
                                      uVar4 = (ulonglong)uVar3;
                                      if (uVar3 == 0) {
                                        uVar3 = FUN_1401cc9e0(local_158,local_e0,local_158);
                                        uVar4 = (ulonglong)uVar3;
                                        if (uVar3 == 0) {
                                          uVar3 = FUN_1401d4f20(local_158,local_158);
                                          uVar4 = (ulonglong)uVar3;
                                          if (uVar3 == 0) {
                                            uVar3 = FUN_1401cc9e0(local_158,local_50,local_158);
                                            uVar4 = (ulonglong)uVar3;
                                            if (uVar3 == 0) {
                                              uVar3 = FUN_1401d4f20(local_80,local_140);
                                              uVar4 = (ulonglong)uVar3;
                                              if (uVar3 == 0) {
                                                uVar3 = FUN_1401cc9e0(local_140,local_c8,local_140);
                                                uVar4 = (ulonglong)uVar3;
                                                if (uVar3 == 0) {
                                                  uVar3 = FUN_1401d4f20(local_140,local_140);
                                                  uVar4 = (ulonglong)uVar3;
                                                  if (uVar3 == 0) {
                                                    uVar3 = FUN_1401cc9e0(local_140,local_68,
                                                                          local_140);
                                                    uVar4 = (ulonglong)uVar3;
                                                    if (uVar3 == 0) {
                                                      uVar3 = FUN_1401ccd60(local_158,local_140,
                                                                            local_110);
                                                      uVar4 = (ulonglong)uVar3;
                                                      if (uVar3 == 0) {
                                                        uVar3 = FUN_1401cc9e0(local_98,local_e0,
                                                                              local_158);
                                                        uVar4 = (ulonglong)uVar3;
                                                        if (uVar3 == 0) {
                                                          uVar3 = FUN_1401cc9e0(local_158,local_50,
                                                                                local_158);
                                                          uVar4 = (ulonglong)uVar3;
                                                          if (uVar3 == 0) {
                                                            uVar3 = FUN_1401cc9e0(local_80,local_c8,
                                                                                  local_140);
                                                            uVar4 = (ulonglong)uVar3;
                                                            if (uVar3 == 0) {
                                                              uVar3 = FUN_1401cc9e0(local_140,
                                                                                    local_68,
                                                  local_140);
                                                  uVar4 = (ulonglong)uVar3;
                                                  if (uVar3 == 0) {
                                                    uVar3 = FUN_1401ccd60(local_158,local_140,
                                                                          local_128);
                                                    uVar4 = (ulonglong)uVar3;
                                                    if (uVar3 == 0) {
                                                      uVar3 = FUN_1401ccba0(local_f8,local_b0,
                                                                            local_f8);
                                                      uVar4 = (ulonglong)uVar3;
                                                      if (uVar3 == 0) {
                                                        uVar3 = FUN_1401ccba0(local_110,local_38,
                                                                              local_110);
                                                        uVar4 = (ulonglong)uVar3;
                                                        if (uVar3 == 0) {
                                                          uVar3 = FUN_1401cd480(local_f8,local_f8);
                                                          uVar4 = (ulonglong)uVar3;
                                                          if (uVar3 == 0) {
                                                            uVar3 = FUN_1401cd480(local_110,
                                                                                  local_110);
                                                            uVar4 = (ulonglong)uVar3;
                                                            if (uVar3 == 0) {
                                                              uVar3 = FUN_1401ccba0(local_128,
                                                                                    local_38,
                                                  local_128);
                                                  uVar4 = (ulonglong)uVar3;
                                                  if (uVar3 == 0) {
                                                    uVar3 = FUN_1401ccba0(local_128,local_b0,
                                                                          local_128);
                                                    uVar4 = (ulonglong)uVar3;
                                                    if (uVar3 == 0) {
                                                      uVar3 = FUN_1401ccba0(local_f8,local_128,
                                                                            local_f8);
                                                      uVar4 = (ulonglong)uVar3;
                                                      if (uVar3 == 0) {
                                                        uVar3 = FUN_1401ccba0(local_110,local_128,
                                                                              local_110);
                                                        uVar4 = (ulonglong)uVar3;
                                                        if (uVar3 == 0) {
                                                          uVar3 = FUN_1401d2470(local_38,3,local_158
                                                                               );
                                                          uVar4 = (ulonglong)uVar3;
                                                          if (uVar3 == 0) {
                                                            uVar3 = FUN_1401ccba0(local_f8,local_158
                                                                                  ,local_f8);
                                                            uVar4 = (ulonglong)uVar3;
                                                            if (uVar3 == 0) {
                                                              uVar3 = FUN_1401d2470(local_b0,3,
                                                                                    local_158);
                                                              uVar4 = (ulonglong)uVar3;
                                                              if (uVar3 == 0) {
                                                                uVar3 = FUN_1401ccba0(local_110,
                                                                                      local_158,
                                                                                      local_110);
                                                                uVar4 = (ulonglong)uVar3;
                                                                if (uVar3 == 0) {
                                                                  uVar3 = FUN_1401cce10(local_128,3,
                                                                                        local_128);
                                                                  uVar4 = (ulonglong)uVar3;
                                                                  if (uVar3 == 0) {
                                                                    uVar3 = FUN_1401ccba0(local_128,
                                                                                          local_f8,
                                                  local_128);
                                                  uVar4 = (ulonglong)uVar3;
                                                  if (uVar3 == 0) {
                                                    uVar3 = FUN_1401ccba0(local_128,local_110,
                                                                          local_128);
                                                    uVar4 = (ulonglong)uVar3;
                                                    if (uVar3 == 0) {
                                                      uVar3 = FUN_1401ccba0(local_f8,local_128,
                                                                            local_f8);
                                                      uVar4 = (ulonglong)uVar3;
                                                      if (uVar3 == 0) {
                                                        uVar3 = FUN_1401ccba0(local_110,local_128,
                                                                              local_110);
                                                        uVar4 = (ulonglong)uVar3;
                                                        if (uVar3 == 0) {
                                                          uVar3 = FUN_1401d8220(local_f8,local_f8,0)
                                                          ;
                                                          uVar4 = (ulonglong)uVar3;
                                                          if (uVar3 == 0) {
                                                            uVar3 = FUN_1401d8220(local_110,
                                                                                  local_110,0);
                                                            uVar4 = (ulonglong)uVar3;
                                                            if (uVar3 == 0) {
                                                              uVar3 = FUN_1401d4520(local_f8,iVar1);
                                                              uVar4 = (ulonglong)uVar3;
                                                              if (uVar3 == 0) {
                                                                uVar3 = FUN_1401d4520(local_128,
                                                                                      iVar2);
                                                                uVar4 = (ulonglong)uVar3;
                                                                if (uVar3 == 0) {
                                                                  uVar3 = FUN_1401d4520(local_110,
                                                                                        iVar1 * 3);
                                                                  uVar4 = (ulonglong)uVar3;
                                                                  if (uVar3 == 0) {
                                                                    uVar3 = FUN_1401d4520(local_b0,
                                                  iVar1 * 4);
                                                  uVar4 = (ulonglong)uVar3;
                                                  if (uVar3 == 0) {
                                                    uVar3 = FUN_1401cc9e0(local_38,local_f8,param_3)
                                                    ;
                                                    uVar4 = (ulonglong)uVar3;
                                                    if (uVar3 == 0) {
                                                      uVar3 = FUN_1401cc9e0(local_128,local_110,
                                                                            local_158);
                                                      uVar4 = (ulonglong)uVar3;
                                                      if (uVar3 == 0) {
                                                        uVar3 = FUN_1401cc9e0(local_b0,local_158,
                                                                              local_158);
                                                        uVar4 = (ulonglong)uVar3;
                                                        if (uVar3 == 0) {
                                                          uVar3 = FUN_1401cc9e0(local_158,param_3,
                                                                                param_3);
                                                          uVar4 = (ulonglong)uVar3;
                                                        }
                                                      }
                                                    }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    FUN_1401d4690(local_38,local_f8,local_128,local_110,local_b0,local_50,local_e0,local_98,local_68
                  ,local_c8,local_80,local_158,local_140,0);
  }
  return uVar4;
}



undefined8 FUN_1401d3930(int *param_1,undefined8 param_2)

{
  uint uVar1;
  int iVar2;
  undefined8 uVar3;
  int iVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  uint *puVar9;
  uint *puVar10;
  ulonglong uVar11;
  ulonglong uVar12;
  longlong lVar13;
  int iVar14;
  longlong lVar15;
  int local_48 [4];
  longlong local_38;
  
  lVar5 = (longlong)*param_1;
  iVar2 = *param_1 * 2 + 1;
  uVar3 = FUN_1401d45b0(local_48,iVar2);
  if ((int)uVar3 == 0) {
    if (0 < lVar5) {
      lVar6 = 0;
      lVar8 = 1;
      iVar14 = 1;
      lVar7 = lVar6;
      lVar15 = lVar5;
      do {
        uVar11 = (ulonglong)*(uint *)(lVar7 + *(longlong *)(param_1 + 4)) *
                 (ulonglong)*(uint *)(lVar7 + *(longlong *)(param_1 + 4)) +
                 (ulonglong)*(uint *)(local_38 + lVar6);
        uVar12 = uVar11 >> 0x1c;
        *(uint *)(local_38 + lVar6) = (uint)uVar11 & 0xfffffff;
        uVar1 = *(uint *)(lVar7 + *(longlong *)(param_1 + 4));
        puVar10 = (uint *)(local_38 + (longlong)iVar14 * 4);
        if (lVar8 < lVar5) {
          puVar9 = puVar10;
          lVar13 = lVar8;
          do {
            lVar13 = lVar13 + 1;
            puVar10 = puVar9 + 1;
            uVar11 = (ulonglong)*puVar9 +
                     (ulonglong)*(uint *)(*(longlong *)(param_1 + 4) + -4 + lVar13 * 4) *
                     (ulonglong)uVar1 * 2 + (uVar12 & 0xffffffff);
            uVar12 = uVar11 >> 0x1c & 0xffffffff;
            *puVar9 = (uint)uVar11 & 0xfffffff;
            puVar9 = puVar10;
          } while (lVar13 < lVar5);
        }
        iVar4 = (int)uVar12;
        while (iVar4 != 0) {
          uVar11 = (ulonglong)*puVar10 + (uVar12 & 0xffffffff);
          uVar12 = uVar11 >> 0x1c;
          *puVar10 = (uint)uVar11 & 0xfffffff;
          puVar10 = puVar10 + 1;
          iVar4 = (int)uVar12;
        }
        iVar14 = iVar14 + 2;
        lVar6 = lVar6 + 8;
        lVar7 = lVar7 + 4;
        lVar8 = lVar8 + 1;
        lVar15 = lVar15 + -1;
      } while (lVar15 != 0);
    }
    local_48[0] = iVar2;
    FUN_1401d2430(local_48);
    FUN_1401d4470(local_48,param_2);
    FUN_1401cc300(local_48);
    uVar3 = 0;
  }
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1401d3aa0(int *param_1,int *param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  uint uVar4;
  undefined8 uVar5;
  int iVar6;
  uint *puVar7;
  uint *puVar8;
  int iVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  ulonglong uVar12;
  int iVar13;
  longlong lVar14;
  ulonglong uVar15;
  ulonglong uVar16;
  ulonglong uVar17;
  uint uVar18;
  undefined1 auStack_878 [32];
  int *local_858;
  uint auStack_84c [513];
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_878;
  iVar3 = *param_1 * 2;
  local_858 = param_2;
  if ((iVar3 <= param_2[1]) || (uVar5 = FUN_1401d2390(param_2,iVar3), (int)uVar5 == 0)) {
    uVar12 = 0;
    lVar14 = (longlong)iVar3;
    if (0 < lVar14) {
      lVar2 = *(longlong *)(param_1 + 4);
      iVar1 = *param_1;
      uVar11 = uVar12;
      uVar15 = uVar12;
      uVar17 = uVar12;
      do {
        iVar6 = iVar1 + -1;
        iVar13 = (int)uVar11;
        iVar9 = iVar13;
        if (iVar6 < iVar13) {
          iVar9 = iVar6;
        }
        iVar6 = iVar13 - iVar9;
        puVar8 = (uint *)(lVar2 + (longlong)iVar6 * 4);
        puVar7 = (uint *)(lVar2 + (longlong)iVar9 * 4);
        uVar4 = iVar1 - iVar6;
        uVar18 = iVar9 + 1U;
        if ((int)uVar4 < (int)(iVar9 + 1U)) {
          uVar18 = uVar4;
        }
        uVar4 = (iVar9 - iVar6) + 1 >> 1;
        if ((int)uVar4 <= (int)uVar18) {
          uVar18 = uVar4;
        }
        uVar16 = uVar12;
        if (0 < (int)uVar18) {
          uVar10 = (ulonglong)uVar18;
          do {
            uVar18 = *puVar7;
            uVar4 = *puVar8;
            puVar7 = puVar7 + -1;
            puVar8 = puVar8 + 1;
            uVar16 = uVar16 + (ulonglong)uVar18 * (ulonglong)uVar4;
            uVar10 = uVar10 - 1;
          } while (uVar10 != 0);
        }
        uVar16 = uVar17 + uVar16 * 2;
        if ((uVar11 & 1) == 0) {
          uVar11 = (ulonglong)*(uint *)(lVar2 + ((longlong)iVar13 >> 1) * 4);
          uVar16 = uVar16 + uVar11 * uVar11;
        }
        uVar15 = uVar15 + 1;
        uVar11 = (ulonglong)(iVar13 + 1);
        uVar17 = uVar16 >> 0x1c;
        auStack_84c[uVar15] = (uint)uVar16 & 0xfffffff;
        param_2 = local_858;
      } while ((longlong)uVar15 < lVar14);
    }
    iVar1 = *param_2;
    puVar8 = *(uint **)(param_2 + 4);
    *param_2 = *param_1 * 2;
    puVar7 = puVar8;
    iVar6 = 0;
    if (0 < lVar14) {
      do {
        lVar2 = uVar12 + 1;
        uVar12 = uVar12 + 1;
        puVar8 = puVar7 + 1;
        *puVar7 = auStack_84c[lVar2] & 0xfffffff;
        puVar7 = puVar8;
        iVar6 = iVar3;
      } while ((longlong)uVar12 < lVar14);
    }
    if (iVar6 < iVar1) {
      memset(puVar8,0,(ulonglong)(uint)(iVar1 - iVar6) << 2);
    }
    FUN_1401d2430(param_2);
    uVar5 = 0;
  }
  return uVar5;
}



undefined4 FUN_1401d3c70(int *param_1,undefined8 param_2)

{
  undefined4 uVar1;
  int iVar2;
  undefined4 *puVar3;
  undefined4 uVar4;
  uint uVar5;
  uint uVar6;
  ulonglong uVar7;
  undefined1 local_a8 [24];
  uint local_90 [4];
  undefined4 *local_80;
  undefined1 local_78 [24];
  int local_60 [4];
  undefined4 *local_50;
  undefined1 local_48 [24];
  undefined1 local_30 [24];
  
  uVar5 = *param_1 >> 1;
  uVar4 = 0xfffffffe;
  iVar2 = FUN_1401d45b0(local_90,uVar5);
  if (iVar2 == 0) {
    iVar2 = FUN_1401d45b0(local_60,*param_1 - uVar5);
    if (iVar2 == 0) {
      iVar2 = FUN_1401d45b0(local_a8,*param_1 * 2);
      if (iVar2 == 0) {
        iVar2 = FUN_1401d45b0(local_30,*param_1 * 2);
        if (iVar2 == 0) {
          iVar2 = FUN_1401d45b0(local_48,uVar5 * 2);
          if (iVar2 == 0) {
            iVar2 = FUN_1401d45b0(local_78,(*param_1 - uVar5) * 2);
            if (iVar2 == 0) {
              puVar3 = *(undefined4 **)(param_1 + 4);
              if (0 < (int)uVar5) {
                uVar7 = (ulonglong)uVar5;
                do {
                  uVar1 = *puVar3;
                  puVar3 = puVar3 + 1;
                  uVar7 = uVar7 - 1;
                  *local_80 = uVar1;
                  local_80 = local_80 + 1;
                } while (uVar7 != 0);
              }
              uVar6 = uVar5;
              if ((int)uVar5 < *param_1) {
                do {
                  uVar6 = uVar6 + 1;
                  *local_50 = *puVar3;
                  puVar3 = puVar3 + 1;
                  local_50 = local_50 + 1;
                } while ((int)uVar6 < *param_1);
              }
              local_60[0] = *param_1 - uVar5;
              local_90[0] = uVar5;
              FUN_1401d2430(local_90);
              iVar2 = FUN_1401cced0(local_90,local_48);
              if (iVar2 == 0) {
                iVar2 = FUN_1401cced0(local_60,local_78);
                if (iVar2 == 0) {
                  iVar2 = FUN_1401d2a80(local_60,local_90,local_a8);
                  if (iVar2 == 0) {
                    iVar2 = FUN_1401cced0(local_a8,local_a8);
                    if (iVar2 == 0) {
                      iVar2 = FUN_1401d2a80(local_48,local_78,local_30);
                      if (iVar2 == 0) {
                        iVar2 = FUN_1401d2980(local_a8,local_30,local_a8);
                        if (iVar2 == 0) {
                          iVar2 = FUN_1401d4520(local_a8,uVar5);
                          if (iVar2 == 0) {
                            iVar2 = FUN_1401d4520(local_78,uVar5 * 2);
                            if (iVar2 == 0) {
                              iVar2 = FUN_1401cc9e0(local_48,local_a8,local_a8);
                              if (iVar2 == 0) {
                                iVar2 = FUN_1401cc9e0(local_a8,local_78,param_2);
                                uVar4 = 0xfffffffe;
                                if (iVar2 == 0) {
                                  uVar4 = 0;
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
              FUN_1401cc300(local_78);
            }
            FUN_1401cc300(local_48);
          }
          FUN_1401cc300(local_30);
        }
        FUN_1401cc300(local_a8);
      }
      FUN_1401cc300(local_60);
    }
    FUN_1401cc300(local_90);
  }
  return uVar4;
}



ulonglong FUN_1401d3eb0(int *param_1,undefined8 param_2)

{
  int iVar1;
  uint uVar2;
  ulonglong uVar3;
  undefined1 local_f8 [24];
  undefined1 local_e0 [24];
  undefined1 local_c8 [24];
  undefined1 local_b0 [24];
  undefined1 local_98 [24];
  undefined1 local_80 [24];
  undefined1 local_68 [24];
  undefined1 local_50 [24];
  undefined1 local_38 [32];
  
  uVar3 = FUN_1401d46d0(local_38,local_b0,local_e0,local_c8,local_80,local_50,local_98,local_68,
                        local_f8,0);
  if ((int)uVar3 == 0) {
    iVar1 = *param_1 / 3;
    uVar2 = FUN_1401d8310(param_1,iVar1 * 0x1c,local_50);
    uVar3 = (ulonglong)uVar2;
    if (uVar2 == 0) {
      uVar2 = FUN_1401cc3a0(param_1,local_98);
      uVar3 = (ulonglong)uVar2;
      if (uVar2 == 0) {
        FUN_1401d44a0(local_98,iVar1);
        FUN_1401d8310(local_98,iVar1 * 0x1c,local_98);
        uVar2 = FUN_1401cc3a0(param_1,local_68);
        uVar3 = (ulonglong)uVar2;
        if (uVar2 == 0) {
          FUN_1401d44a0(local_68,iVar1 * 2);
          uVar2 = FUN_1401cced0(local_50,local_38);
          uVar3 = (ulonglong)uVar2;
          if (uVar2 == 0) {
            uVar2 = FUN_1401cced0(local_68,local_80);
            uVar3 = (ulonglong)uVar2;
            if (uVar2 == 0) {
              uVar2 = FUN_1401d4f20(local_50,local_f8);
              uVar3 = (ulonglong)uVar2;
              if (uVar2 == 0) {
                uVar2 = FUN_1401cc9e0(local_f8,local_98,local_f8);
                uVar3 = (ulonglong)uVar2;
                if (uVar2 == 0) {
                  uVar2 = FUN_1401d4f20(local_f8,local_f8);
                  uVar3 = (ulonglong)uVar2;
                  if (uVar2 == 0) {
                    uVar2 = FUN_1401cc9e0(local_f8,local_68,local_f8);
                    uVar3 = (ulonglong)uVar2;
                    if (uVar2 == 0) {
                      uVar2 = FUN_1401cced0(local_f8,local_b0);
                      uVar3 = (ulonglong)uVar2;
                      if (uVar2 == 0) {
                        uVar2 = FUN_1401d4f20(local_68,local_f8);
                        uVar3 = (ulonglong)uVar2;
                        if (uVar2 == 0) {
                          uVar2 = FUN_1401cc9e0(local_f8,local_98,local_f8);
                          uVar3 = (ulonglong)uVar2;
                          if (uVar2 == 0) {
                            uVar2 = FUN_1401d4f20(local_f8,local_f8);
                            uVar3 = (ulonglong)uVar2;
                            if (uVar2 == 0) {
                              uVar2 = FUN_1401cc9e0(local_f8,local_50,local_f8);
                              uVar3 = (ulonglong)uVar2;
                              if (uVar2 == 0) {
                                uVar2 = FUN_1401cced0(local_f8,local_c8);
                                uVar3 = (ulonglong)uVar2;
                                if (uVar2 == 0) {
                                  uVar2 = FUN_1401cc9e0(local_68,local_98,local_f8);
                                  uVar3 = (ulonglong)uVar2;
                                  if (uVar2 == 0) {
                                    uVar2 = FUN_1401cc9e0(local_f8,local_50,local_f8);
                                    uVar3 = (ulonglong)uVar2;
                                    if (uVar2 == 0) {
                                      uVar2 = FUN_1401cced0(local_f8,local_e0);
                                      uVar3 = (ulonglong)uVar2;
                                      if (uVar2 == 0) {
                                        uVar2 = FUN_1401ccba0(local_b0,local_80,local_b0);
                                        uVar3 = (ulonglong)uVar2;
                                        if (uVar2 == 0) {
                                          uVar2 = FUN_1401ccba0(local_c8,local_38,local_c8);
                                          uVar3 = (ulonglong)uVar2;
                                          if (uVar2 == 0) {
                                            uVar2 = FUN_1401cd480(local_b0,local_b0);
                                            uVar3 = (ulonglong)uVar2;
                                            if (uVar2 == 0) {
                                              uVar2 = FUN_1401cd480(local_c8,local_c8);
                                              uVar3 = (ulonglong)uVar2;
                                              if (uVar2 == 0) {
                                                uVar2 = FUN_1401ccba0(local_e0,local_38,local_e0);
                                                uVar3 = (ulonglong)uVar2;
                                                if (uVar2 == 0) {
                                                  uVar2 = FUN_1401ccba0(local_e0,local_80,local_e0);
                                                  uVar3 = (ulonglong)uVar2;
                                                  if (uVar2 == 0) {
                                                    uVar2 = FUN_1401ccba0(local_b0,local_e0,local_b0
                                                                         );
                                                    uVar3 = (ulonglong)uVar2;
                                                    if (uVar2 == 0) {
                                                      uVar2 = FUN_1401ccba0(local_c8,local_e0,
                                                                            local_c8);
                                                      uVar3 = (ulonglong)uVar2;
                                                      if (uVar2 == 0) {
                                                        uVar2 = FUN_1401d2470(local_38,3,local_f8);
                                                        uVar3 = (ulonglong)uVar2;
                                                        if (uVar2 == 0) {
                                                          uVar2 = FUN_1401ccba0(local_b0,local_f8,
                                                                                local_b0);
                                                          uVar3 = (ulonglong)uVar2;
                                                          if (uVar2 == 0) {
                                                            uVar2 = FUN_1401d2470(local_80,3,
                                                                                  local_f8);
                                                            uVar3 = (ulonglong)uVar2;
                                                            if (uVar2 == 0) {
                                                              uVar2 = FUN_1401ccba0(local_c8,
                                                  local_f8,local_c8);
                                                  uVar3 = (ulonglong)uVar2;
                                                  if (uVar2 == 0) {
                                                    uVar2 = FUN_1401cce10(local_e0,3,local_e0);
                                                    uVar3 = (ulonglong)uVar2;
                                                    if (uVar2 == 0) {
                                                      uVar2 = FUN_1401ccba0(local_e0,local_b0,
                                                                            local_e0);
                                                      uVar3 = (ulonglong)uVar2;
                                                      if (uVar2 == 0) {
                                                        uVar2 = FUN_1401ccba0(local_e0,local_c8,
                                                                              local_e0);
                                                        uVar3 = (ulonglong)uVar2;
                                                        if (uVar2 == 0) {
                                                          uVar2 = FUN_1401ccba0(local_b0,local_e0,
                                                                                local_b0);
                                                          uVar3 = (ulonglong)uVar2;
                                                          if (uVar2 == 0) {
                                                            uVar2 = FUN_1401ccba0(local_c8,local_e0,
                                                                                  local_c8);
                                                            uVar3 = (ulonglong)uVar2;
                                                            if (uVar2 == 0) {
                                                              uVar2 = FUN_1401d8220(local_b0,
                                                  local_b0,0);
                                                  uVar3 = (ulonglong)uVar2;
                                                  if (uVar2 == 0) {
                                                    uVar2 = FUN_1401d8220(local_c8,local_c8,0);
                                                    uVar3 = (ulonglong)uVar2;
                                                    if (uVar2 == 0) {
                                                      uVar2 = FUN_1401d4520(local_b0,iVar1);
                                                      uVar3 = (ulonglong)uVar2;
                                                      if (uVar2 == 0) {
                                                        uVar2 = FUN_1401d4520(local_e0,iVar1 * 2);
                                                        uVar3 = (ulonglong)uVar2;
                                                        if (uVar2 == 0) {
                                                          uVar2 = FUN_1401d4520(local_c8,iVar1 * 3);
                                                          uVar3 = (ulonglong)uVar2;
                                                          if (uVar2 == 0) {
                                                            uVar2 = FUN_1401d4520(local_80,iVar1 * 4
                                                                                 );
                                                            uVar3 = (ulonglong)uVar2;
                                                            if (uVar2 == 0) {
                                                              uVar2 = FUN_1401cc9e0(local_38,
                                                  local_b0,param_2);
                                                  uVar3 = (ulonglong)uVar2;
                                                  if (uVar2 == 0) {
                                                    uVar2 = FUN_1401cc9e0(local_e0,local_c8,local_f8
                                                                         );
                                                    uVar3 = (ulonglong)uVar2;
                                                    if (uVar2 == 0) {
                                                      uVar2 = FUN_1401cc9e0(local_80,local_f8,
                                                                            local_f8);
                                                      uVar3 = (ulonglong)uVar2;
                                                      if (uVar2 == 0) {
                                                        uVar2 = FUN_1401cc9e0(local_f8,param_2,
                                                                              param_2);
                                                        uVar3 = (ulonglong)uVar2;
                                                      }
                                                    }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    FUN_1401d4690(local_38,local_b0,local_e0,local_c8,local_80,local_50,local_98,local_68,local_f8,0
                 );
  }
  return uVar3;
}



void FUN_1401d4470(undefined8 *param_1,undefined8 *param_2)

{
  undefined8 uVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  
  uVar1 = *param_1;
  uVar2 = param_1[1];
  uVar3 = param_1[2];
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  *param_2 = uVar1;
  param_2[1] = uVar2;
  param_2[2] = uVar3;
  return;
}



void FUN_1401d44a0(int *param_1,int param_2)

{
  int iVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  
  if (0 < param_2) {
    if (*param_1 <= param_2) {
      FUN_1401d2570();
      return;
    }
    puVar3 = *(undefined4 **)(param_1 + 4);
    iVar1 = 0;
    puVar4 = puVar3 + param_2;
    puVar2 = puVar3;
    if (0 < *param_1 - param_2) {
      do {
        iVar1 = iVar1 + 1;
        puVar3 = puVar2 + 1;
        *puVar2 = *puVar4;
        puVar4 = puVar4 + 1;
        puVar2 = puVar3;
      } while (iVar1 < *param_1 - param_2);
    }
    if (iVar1 < *param_1) {
      do {
        *puVar3 = 0;
        iVar1 = iVar1 + 1;
        puVar3 = puVar3 + 1;
      } while (iVar1 < *param_1);
    }
    *param_1 = *param_1 - param_2;
  }
  return;
}



undefined8 FUN_1401d4520(int *param_1,uint param_2)

{
  int iVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  undefined4 *puVar5;
  undefined4 *puVar6;
  
  if (0 < (int)param_2) {
    if ((param_1[1] < (int)(*param_1 + param_2)) && (uVar3 = FUN_1401d2390(), (int)uVar3 != 0)) {
      return uVar3;
    }
    *param_1 = *param_1 + param_2;
    iVar1 = *param_1;
    puVar6 = (undefined4 *)
             (*(longlong *)(param_1 + 4) + -4 + ((longlong)iVar1 - (longlong)(int)param_2) * 4);
    if ((int)param_2 <= iVar1 + -1) {
      uVar4 = (ulonglong)(((iVar1 + -1) - param_2) + 1);
      puVar5 = (undefined4 *)(*(longlong *)(param_1 + 4) + -4 + (longlong)iVar1 * 4);
      do {
        uVar2 = *puVar6;
        puVar6 = puVar6 + -1;
        uVar4 = uVar4 - 1;
        *puVar5 = uVar2;
        puVar5 = puVar5 + -1;
      } while (uVar4 != 0);
    }
    if (0 < (int)param_2) {
      memset(*(void **)(param_1 + 4),0,(ulonglong)param_2 << 2);
    }
  }
  return 0;
}



undefined8 FUN_1401d45b0(undefined4 *param_1,uint param_2)

{
  void *pvVar1;
  longlong lVar2;
  int iVar3;
  uint uVar4;
  
  uVar4 = param_2 & 0x8000001f;
  if ((int)uVar4 < 0) {
    uVar4 = (uVar4 - 1 | 0xffffffe0) + 1;
  }
  iVar3 = param_2 + (0x40 - uVar4);
  pvVar1 = malloc((longlong)iVar3 * 4);
  *(void **)(param_1 + 4) = pvVar1;
  if (pvVar1 != (void *)0x0) {
    param_1[1] = iVar3;
    *param_1 = 0;
    param_1[2] = 0;
    lVar2 = 0;
    if (0 < iVar3) {
      do {
        lVar2 = lVar2 + 1;
        *(undefined4 *)(*(longlong *)(param_1 + 4) + -4 + lVar2 * 4) = 0;
      } while (lVar2 < iVar3);
    }
    return 0;
  }
  return 0xfffffffe;
}



undefined8 FUN_1401d4660(longlong param_1,longlong param_2)

{
  undefined8 uVar1;
  
  if ((param_1 != param_2) && (uVar1 = FUN_1401cc3a0(), (int)uVar1 != 0)) {
    return uVar1;
  }
  *(undefined4 *)(param_2 + 8) = 0;
  return 0;
}



void FUN_1401d4690(longlong param_1)

{
  undefined1 *puVar1;
  longlong local_res10 [3];
  
  puVar1 = (undefined1 *)register0x00000020;
  while (param_1 != 0) {
    FUN_1401cc300();
    param_1 = *(longlong *)(puVar1 + 0x10);
    puVar1 = puVar1 + 8;
  }
  return;
}



undefined8 FUN_1401d46d0(longlong param_1)

{
  longlong lVar1;
  undefined1 *puVar2;
  int iVar3;
  int iVar4;
  longlong local_res10 [3];
  
  iVar4 = 0;
  puVar2 = (undefined1 *)register0x00000020;
  lVar1 = param_1;
  while( true ) {
    if (lVar1 == 0) {
      return 0;
    }
    iVar3 = FUN_1401cc2a0();
    if (iVar3 != 0) break;
    lVar1 = *(longlong *)(puVar2 + 0x10);
    iVar4 = iVar4 + 1;
    puVar2 = puVar2 + 8;
  }
  for (; iVar4 != 0; iVar4 = iVar4 + -1) {
    FUN_1401cc300(param_1);
    param_1 = *(longlong *)((longlong)register0x00000020 + 0x10);
    register0x00000020 = (BADSPACEBASE *)((longlong)register0x00000020 + 8);
  }
  return 0xfffffffe;
}



ulonglong FUN_1401d4750(undefined8 param_1,longlong param_2,undefined8 param_3)

{
  uint uVar1;
  ulonglong uVar2;
  undefined1 local_28 [8];
  int local_20;
  
  uVar2 = FUN_1401cc2a0(local_28);
  if ((int)uVar2 == 0) {
    uVar1 = FUN_1401ccf50(param_1,param_2,0,local_28);
    if (uVar1 != 0) {
      FUN_1401cc300(local_28);
      return (ulonglong)uVar1;
    }
    if (local_20 == *(int *)(param_2 + 8)) {
      uVar2 = 0;
      FUN_1401d4470(local_28,param_3);
    }
    else {
      uVar1 = FUN_1401cc9e0(param_2,local_28,param_3);
      uVar2 = (ulonglong)uVar1;
    }
    FUN_1401cc300(local_28);
  }
  return uVar2;
}



ulonglong FUN_1401d4800(undefined8 param_1,int *param_2,undefined8 param_3)

{
  uint uVar1;
  int iVar2;
  ulonglong uVar3;
  int *piVar4;
  int *piVar5;
  int *piVar6;
  bool bVar7;
  int local_c8 [4];
  byte *local_b8;
  int local_b0 [4];
  byte *local_a0;
  int local_98 [4];
  byte *local_88;
  int local_80 [4];
  byte *local_70;
  int local_68 [4];
  byte *local_58;
  int local_50 [4];
  byte *local_40;
  int local_38 [4];
  byte *local_28;
  int local_20 [4];
  byte *local_10;
  
  if ((param_2[2] == 1) || (*param_2 == 0)) {
    return 0xfffffffd;
  }
  uVar3 = FUN_1401d46d0(local_20,local_38,local_98,local_b0,local_68,local_50,local_c8,local_80,0);
  if ((int)uVar3 != 0) {
    return uVar3;
  }
  uVar1 = FUN_1401d4750(param_1,param_2,local_20);
  uVar3 = (ulonglong)uVar1;
  if (uVar1 == 0) {
    uVar1 = FUN_1401cc3a0(param_2,local_38);
    uVar3 = (ulonglong)uVar1;
    if (uVar1 == 0) {
      if ((((local_20[0] < 1) || ((*local_10 & 1) != 0)) || (local_38[0] < 1)) ||
         ((*local_28 & 1) != 0)) {
        uVar1 = FUN_1401cc3a0(local_20,local_98);
        uVar3 = (ulonglong)uVar1;
        if (uVar1 == 0) {
          uVar1 = FUN_1401cc3a0(local_38,local_b0);
          uVar3 = (ulonglong)uVar1;
          if (uVar1 == 0) {
            FUN_1401d4fd0(local_68,1);
            FUN_1401d4fd0(local_80,1);
            do {
              bVar7 = local_98[0] == 0;
              while ((bVar7 || local_98[0] < 0 || ((*local_88 & 1) != 0))) {
                while ((0 < local_b0[0] && ((*local_a0 & 1) == 0))) {
                  uVar1 = FUN_1401cd480(local_b0,local_b0);
                  uVar3 = (ulonglong)uVar1;
                  if (uVar1 != 0) goto LAB_1401d4be9;
                  if (((0 < local_c8[0]) && ((*local_b8 & 1) != 0)) ||
                     ((0 < local_80[0] && ((*local_70 & 1) != 0)))) {
                    uVar1 = FUN_1401cc9e0(local_c8,local_38,local_c8);
                    uVar3 = (ulonglong)uVar1;
                    if (uVar1 != 0) goto LAB_1401d4be9;
                    uVar1 = FUN_1401ccba0(local_80,local_20,local_80);
                    uVar3 = (ulonglong)uVar1;
                    if (uVar1 != 0) goto LAB_1401d4be9;
                  }
                  uVar1 = FUN_1401cd480(local_c8,local_c8);
                  uVar3 = (ulonglong)uVar1;
                  if (uVar1 != 0) goto LAB_1401d4be9;
                  uVar1 = FUN_1401cd480(local_80,local_80);
                  uVar3 = (ulonglong)uVar1;
                  if (uVar1 != 0) goto LAB_1401d4be9;
                }
                iVar2 = FUN_1401cc4f0(local_98,local_b0);
                if (iVar2 == -1) {
                  uVar1 = FUN_1401ccba0(local_b0,local_98,local_b0);
                  uVar3 = (ulonglong)uVar1;
                  if (uVar1 != 0) goto LAB_1401d4be9;
                  uVar1 = FUN_1401ccba0(local_c8,local_68,local_c8);
                  uVar3 = (ulonglong)uVar1;
                  if (uVar1 != 0) goto LAB_1401d4be9;
                  piVar6 = local_80;
                  piVar5 = local_50;
                  piVar4 = local_80;
                }
                else {
                  uVar1 = FUN_1401ccba0(local_98,local_b0,local_98);
                  uVar3 = (ulonglong)uVar1;
                  if (uVar1 != 0) goto LAB_1401d4be9;
                  uVar1 = FUN_1401ccba0(local_68,local_c8,local_68);
                  uVar3 = (ulonglong)uVar1;
                  if (uVar1 != 0) goto LAB_1401d4be9;
                  piVar6 = local_50;
                  piVar5 = local_80;
                  piVar4 = local_50;
                }
                uVar1 = FUN_1401ccba0(piVar4,piVar5,piVar6);
                uVar3 = (ulonglong)uVar1;
                if (uVar1 != 0) goto LAB_1401d4be9;
                bVar7 = false;
                if (local_98[0] == 0) {
                  iVar2 = FUN_1401cc520(local_b0,1);
                  if (iVar2 != 0) goto LAB_1401d48cf;
                  iVar2 = FUN_1401cc520(local_c8,0);
                  goto joined_r0x0001401d4b70;
                }
              }
              uVar1 = FUN_1401cd480(local_98,local_98);
              uVar3 = (ulonglong)uVar1;
              if (uVar1 != 0) break;
              if (((0 < local_68[0]) && ((*local_58 & 1) != 0)) ||
                 ((0 < local_50[0] && ((*local_40 & 1) != 0)))) {
                uVar1 = FUN_1401cc9e0(local_68,local_38,local_68);
                uVar3 = (ulonglong)uVar1;
                if (uVar1 != 0) break;
                uVar1 = FUN_1401ccba0(local_50,local_20,local_50);
                uVar3 = (ulonglong)uVar1;
                if (uVar1 != 0) break;
              }
              uVar1 = FUN_1401cd480(local_68,local_68);
              uVar3 = (ulonglong)uVar1;
              if (uVar1 != 0) break;
              uVar1 = FUN_1401cd480(local_50,local_50);
              uVar3 = (ulonglong)uVar1;
            } while (uVar1 == 0);
          }
        }
      }
      else {
LAB_1401d48cf:
        uVar3 = 0xfffffffd;
      }
    }
  }
  goto LAB_1401d4be9;
joined_r0x0001401d4b70:
  if (iVar2 != -1) goto LAB_1401d4b9b;
  uVar1 = FUN_1401cc9e0(local_c8,param_2,local_c8);
  uVar3 = (ulonglong)uVar1;
  if (uVar1 != 0) goto LAB_1401d4be9;
  iVar2 = FUN_1401cc520(local_c8,0);
  goto joined_r0x0001401d4b70;
LAB_1401d4b9b:
  iVar2 = FUN_1401d25a0(local_c8,param_2);
  while (iVar2 != -1) {
    uVar1 = FUN_1401ccba0(local_c8,param_2,local_c8);
    uVar3 = (ulonglong)uVar1;
    if (uVar1 != 0) goto LAB_1401d4be9;
    iVar2 = FUN_1401d25a0(local_c8,param_2);
  }
  FUN_1401d4470(local_c8,param_3);
  uVar3 = 0;
LAB_1401d4be9:
  FUN_1401d4690(local_20,local_38,local_98,local_b0,local_68,local_50,local_c8,local_80,0);
  return uVar3;
}



ulonglong FUN_1401d4c50(longlong param_1,int *param_2,longlong param_3)

{
  undefined4 uVar1;
  uint uVar2;
  int iVar3;
  ulonglong uVar4;
  int *piVar5;
  int *piVar6;
  int *piVar7;
  bool bVar8;
  int local_98 [2];
  int local_90;
  byte *local_88;
  int local_80 [4];
  byte *local_70;
  int local_68 [4];
  byte *local_58;
  int local_50 [4];
  byte *local_40;
  undefined1 local_38 [24];
  undefined1 local_20 [24];
  
  if ((0 < *param_2) && ((**(byte **)(param_2 + 4) & 1) == 0)) {
    return 0xfffffffd;
  }
  uVar4 = FUN_1401d46d0(local_38,local_20,local_80,local_68,local_50,local_98,0);
  if ((int)uVar4 != 0) {
    return uVar4;
  }
  uVar2 = FUN_1401cc3a0(param_2,local_38);
  uVar4 = (ulonglong)uVar2;
  if (uVar2 == 0) {
    uVar2 = FUN_1401d4750(param_1,param_2,local_20);
    uVar4 = (ulonglong)uVar2;
    if (uVar2 == 0) {
      uVar2 = FUN_1401cc3a0(local_38,local_80);
      uVar4 = (ulonglong)uVar2;
      if (uVar2 == 0) {
        uVar2 = FUN_1401cc3a0(local_20,local_68);
        uVar4 = (ulonglong)uVar2;
        if (uVar2 == 0) {
          FUN_1401d4fd0(local_98,1);
          do {
            bVar8 = local_80[0] == 0;
            while ((bVar8 || local_80[0] < 0 || ((*local_70 & 1) != 0))) {
              while ((0 < local_68[0] && ((*local_58 & 1) == 0))) {
                uVar2 = FUN_1401cd480(local_68,local_68);
                uVar4 = (ulonglong)uVar2;
                if (uVar2 != 0) goto LAB_1401d4ecf;
                if ((0 < local_98[0]) && ((*local_88 & 1) != 0)) {
                  uVar2 = FUN_1401ccba0(local_98,local_38,local_98);
                  uVar4 = (ulonglong)uVar2;
                  if (uVar2 != 0) goto LAB_1401d4ecf;
                }
                uVar2 = FUN_1401cd480(local_98,local_98);
                uVar4 = (ulonglong)uVar2;
                if (uVar2 != 0) goto LAB_1401d4ecf;
              }
              iVar3 = FUN_1401cc4f0(local_80,local_68);
              if (iVar3 == -1) {
                uVar2 = FUN_1401ccba0(local_68,local_80,local_68);
                uVar4 = (ulonglong)uVar2;
                if (uVar2 != 0) goto LAB_1401d4ecf;
                piVar7 = local_98;
                piVar6 = local_50;
                piVar5 = local_98;
              }
              else {
                uVar2 = FUN_1401ccba0(local_80,local_68,local_80);
                uVar4 = (ulonglong)uVar2;
                if (uVar2 != 0) goto LAB_1401d4ecf;
                piVar7 = local_50;
                piVar6 = local_98;
                piVar5 = local_50;
              }
              uVar2 = FUN_1401ccba0(piVar5,piVar6,piVar7);
              uVar4 = (ulonglong)uVar2;
              if (uVar2 != 0) goto LAB_1401d4ecf;
              bVar8 = false;
              if (local_80[0] == 0) {
                iVar3 = FUN_1401cc520(local_68,1);
                if (iVar3 == 0) {
                  uVar1 = *(undefined4 *)(param_1 + 8);
                  goto joined_r0x0001401d4e9a;
                }
                uVar4 = 0xfffffffd;
                goto LAB_1401d4ecf;
              }
            }
            uVar2 = FUN_1401cd480(local_80,local_80);
            uVar4 = (ulonglong)uVar2;
            if (uVar2 != 0) break;
            if ((0 < local_50[0]) && ((*local_40 & 1) != 0)) {
              uVar2 = FUN_1401ccba0(local_50,local_38,local_50);
              uVar4 = (ulonglong)uVar2;
              if (uVar2 != 0) break;
            }
            uVar2 = FUN_1401cd480(local_50,local_50);
            uVar4 = (ulonglong)uVar2;
          } while (uVar2 == 0);
        }
      }
    }
  }
  goto LAB_1401d4ecf;
  while( true ) {
    uVar2 = FUN_1401cc9e0(local_98,param_2,local_98);
    uVar4 = (ulonglong)uVar2;
    if (uVar2 != 0) break;
joined_r0x0001401d4e9a:
    if (local_90 != 1) {
      FUN_1401d4470(local_98,param_3);
      *(undefined4 *)(param_3 + 8) = uVar1;
      uVar4 = 0;
      break;
    }
  }
LAB_1401d4ecf:
  FUN_1401d4690(local_38,local_20,local_80,local_68,local_50,local_98,0);
  return uVar4;
}



undefined8 FUN_1401d4f20(int *param_1,int *param_2)

{
  int iVar1;
  uint uVar2;
  undefined8 uVar3;
  uint *puVar4;
  uint *puVar5;
  uint *puVar6;
  int iVar7;
  uint uVar8;
  
  if ((param_2[1] < *param_1 + 1) && (uVar3 = FUN_1401d2390(param_2), (int)uVar3 != 0)) {
    return uVar3;
  }
  iVar1 = *param_2;
  *param_2 = *param_1;
  puVar6 = *(uint **)(param_1 + 4);
  iVar7 = 0;
  puVar4 = *(uint **)(param_2 + 4);
  uVar8 = 0;
  if (0 < *param_1) {
    do {
      uVar2 = *puVar6;
      iVar7 = iVar7 + 1;
      puVar5 = puVar4 + 1;
      puVar6 = puVar6 + 1;
      *puVar4 = uVar2 * 2 & 0xfffffff | uVar8;
      puVar4 = puVar5;
      uVar8 = uVar2 >> 0x1b;
    } while (iVar7 < *param_1);
    if (uVar2 >> 0x1b != 0) {
      *puVar5 = 1;
      *param_2 = *param_2 + 1;
    }
  }
  iVar7 = *param_2;
  if (iVar7 < iVar1) {
    memset((void *)(*(longlong *)(param_2 + 4) + (longlong)iVar7 * 4),0,
           (ulonglong)(uint)(iVar1 - iVar7) << 2);
  }
  param_2[2] = param_1[2];
  return 0;
}



void FUN_1401d4fd0(uint *param_1,uint param_2)

{
  FUN_1401d2570();
  **(uint **)(param_1 + 4) = param_2 & 0xfffffff;
  *param_1 = (uint)(**(int **)(param_1 + 4) != 0);
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1401d5010(uint *param_1,uint *param_2,int param_3)

{
  uint uVar1;
  int iVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  ulonglong *puVar5;
  ulonglong *puVar6;
  ulonglong *puVar7;
  uint *puVar8;
  int iVar9;
  uint *_Dst;
  ulonglong uVar10;
  uint uVar11;
  ulonglong uVar12;
  int iVar13;
  uint uVar14;
  undefined1 auStack_1078 [32];
  uint local_1058;
  int local_1054;
  uint *local_1050;
  ulonglong local_1048 [512];
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_1078;
  uVar14 = *param_1;
  local_1058 = uVar14;
  local_1054 = param_3;
  local_1050 = param_1;
  if (((int)(*param_2 + 1) <= (int)param_1[1]) || (uVar4 = FUN_1401d2390(), (int)uVar4 == 0)) {
    _Dst = *(uint **)(param_1 + 4);
    iVar9 = 0;
    puVar7 = local_1048;
    uVar11 = 0;
    if (0 < (int)*param_1) {
      uVar11 = *param_1;
      uVar10 = (ulonglong)uVar11;
      puVar6 = puVar7;
      puVar8 = _Dst;
      do {
        uVar1 = *puVar8;
        puVar7 = puVar6 + 1;
        puVar8 = puVar8 + 1;
        uVar10 = uVar10 - 1;
        *puVar6 = (ulonglong)uVar1;
        puVar6 = puVar7;
      } while (uVar10 != 0);
    }
    uVar1 = *param_2;
    iVar2 = uVar1 * 2 + 1;
    if ((int)uVar11 < iVar2) {
      memset(puVar7,0,(ulonglong)(iVar2 - uVar11) << 3);
    }
    uVar11 = 0;
    if (0 < (int)uVar1) {
      puVar6 = local_1048;
      puVar7 = local_1048;
      uVar10 = (ulonglong)uVar1;
      do {
        puVar6 = puVar6 + 1;
        uVar3 = puVar6[-1];
        puVar8 = *(uint **)(param_2 + 4);
        if (0 < (int)uVar1) {
          uVar12 = (ulonglong)uVar1;
          puVar5 = puVar7;
          do {
            uVar14 = *puVar8;
            puVar8 = puVar8 + 1;
            *puVar5 = *puVar5 + (ulonglong)uVar14 * (ulonglong)((int)uVar3 * local_1054 & 0xfffffff)
            ;
            uVar12 = uVar12 - 1;
            puVar5 = puVar5 + 1;
          } while (uVar12 != 0);
        }
        puVar7 = puVar7 + 1;
        *puVar6 = *puVar6 + (puVar6[-1] >> 0x1c);
        uVar10 = uVar10 - 1;
        param_1 = local_1050;
        uVar14 = local_1058;
        uVar11 = uVar1;
      } while (uVar10 != 0);
    }
    iVar13 = uVar11 + 1;
    puVar7 = local_1048 + (int)uVar11;
    if (iVar13 <= iVar2) {
      uVar10 = (ulonglong)((iVar2 - iVar13) + 1);
      puVar6 = local_1048 + iVar13;
      do {
        uVar3 = *puVar7;
        puVar7 = puVar7 + 1;
        *puVar6 = *puVar6 + (uVar3 >> 0x1c);
        uVar10 = uVar10 - 1;
        puVar6 = puVar6 + 1;
      } while (uVar10 != 0);
    }
    puVar7 = local_1048 + (int)uVar1;
    puVar8 = _Dst;
    if (0 < (int)(uVar1 + 1)) {
      do {
        uVar10 = *puVar7;
        iVar9 = iVar9 + 1;
        _Dst = puVar8 + 1;
        puVar7 = puVar7 + 1;
        *puVar8 = (uint)uVar10 & 0xfffffff;
        puVar8 = _Dst;
      } while (iVar9 < (int)(*param_2 + 1));
    }
    if (iVar9 < (int)uVar14) {
      memset(_Dst,0,(ulonglong)(uVar14 - iVar9) << 2);
    }
    *param_1 = *param_2 + 1;
    FUN_1401d2430(param_1);
    iVar9 = FUN_1401d25a0(param_1,param_2);
    if (iVar9 == -1) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1401d2980(param_1,param_2,param_1);
    }
  }
  return uVar4;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1401d5260(undefined8 param_1,int *param_2,int *param_3,undefined8 param_4,int param_5)

{
  int *piVar1;
  int iVar2;
  uint uVar3;
  ulonglong uVar4;
  int *piVar5;
  int iVar6;
  int iVar7;
  ulonglong uVar8;
  int iVar9;
  undefined1 *puVar10;
  uint uVar11;
  code *pcVar12;
  undefined1 auStack_18c8 [32];
  undefined4 local_18a8;
  uint local_18a4;
  int local_18a0;
  int *local_1898;
  int local_1890;
  undefined1 local_1888 [24];
  uint local_1870;
  int *local_1868;
  undefined8 local_1860;
  undefined1 auStack_1858 [24];
  undefined1 local_1840 [6120];
  ulonglong local_58;
  
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_18c8;
  local_1898 = param_3;
  local_1868 = param_2;
  local_1860 = param_4;
  iVar2 = FUN_1401cc550(param_2);
  if (iVar2 < 8) {
    iVar2 = 2;
  }
  else if (iVar2 < 0x25) {
    iVar2 = 3;
  }
  else if (iVar2 < 0x8d) {
    iVar2 = 4;
  }
  else if (iVar2 < 0x1c3) {
    iVar2 = 5;
  }
  else if (iVar2 < 0x518) {
    iVar2 = 6;
  }
  else {
    iVar2 = (0xdc9 < iVar2) + 7;
  }
  uVar4 = FUN_1401cc2a0(local_1840);
  if ((int)uVar4 != 0) {
    return uVar4;
  }
  iVar7 = iVar2 + -1;
  uVar11 = 1 << (sbyte)iVar2;
  iVar6 = 1 << ((byte)iVar7 & 0x1f);
  local_18a0 = iVar6;
  local_18a4 = uVar11;
  for (iVar9 = iVar6; iVar9 < (int)uVar11; iVar9 = iVar9 + 1) {
    uVar3 = FUN_1401cc2a0(auStack_1858 + (longlong)iVar9 * 0x18);
    if (uVar3 != 0) {
      if (iVar6 < iVar9) {
        uVar4 = (ulonglong)(uint)(iVar9 - local_18a0);
        puVar10 = auStack_1858 + (longlong)iVar6 * 0x18;
        do {
          FUN_1401cc300(puVar10);
          puVar10 = puVar10 + 0x18;
          uVar4 = uVar4 - 1;
        } while (uVar4 != 0);
      }
      FUN_1401cc300(local_1840);
      return (ulonglong)uVar3;
    }
    param_3 = local_1898;
  }
  if (param_5 == 0) {
    uVar3 = FUN_1401cd910();
    uVar4 = (ulonglong)uVar3;
    if (uVar3 != 0) goto LAB_1401d57ad;
    if ((*param_3 * 2 + 1 < 0x200) && (*param_3 < 0x100)) {
      pcVar12 = FUN_1401d5010;
    }
    else {
      pcVar12 = FUN_1401cda40;
    }
  }
  else if (param_5 == 1) {
    FUN_1401d86a0();
    pcVar12 = FUN_1401d8590;
  }
  else {
    uVar3 = FUN_1401d84f0(param_3,&local_18a8);
    uVar4 = (ulonglong)uVar3;
    if (uVar3 != 0) goto LAB_1401d57ad;
    pcVar12 = FUN_1401d8400;
  }
  uVar3 = FUN_1401cc2a0(local_1888);
  uVar4 = (ulonglong)uVar3;
  uVar11 = local_18a4;
  if (uVar3 != 0) goto LAB_1401d57ad;
  if (param_5 == 0) {
    uVar11 = FUN_1401cd970(local_1888,param_3);
    uVar4 = (ulonglong)uVar11;
    if (uVar11 != 0) goto LAB_1401d579e;
    uVar11 = FUN_1401cd7f0(param_1,local_1888,param_3);
  }
  else {
    FUN_1401d4fd0(local_1888,1);
    uVar11 = FUN_1401d4750(param_1,param_3,local_1840);
  }
  uVar4 = (ulonglong)uVar11;
  if (uVar11 == 0) {
    puVar10 = auStack_1858 + (longlong)local_18a0 * 0x18;
    uVar11 = FUN_1401cc3a0(local_1840,puVar10);
    piVar1 = local_1898;
    uVar4 = (ulonglong)uVar11;
    if (uVar11 == 0) {
      iVar9 = 0;
      if (0 < iVar7) {
        do {
          uVar11 = FUN_1401cced0(puVar10,puVar10);
          uVar4 = (ulonglong)uVar11;
          if (uVar11 != 0) goto LAB_1401d579e;
          uVar11 = (*pcVar12)(puVar10,piVar1,local_18a8);
          uVar4 = (ulonglong)uVar11;
          if (uVar11 != 0) goto LAB_1401d579e;
          iVar9 = iVar9 + 1;
        } while (iVar9 < iVar7);
      }
      iVar9 = local_18a0 + 1;
      iVar7 = local_18a0;
      if (iVar9 < (int)local_18a4) {
        do {
          uVar11 = FUN_1401ccd60(auStack_1858 + (longlong)iVar7 * 0x18,local_1840,
                                 auStack_1858 + (longlong)iVar9 * 0x18);
          uVar4 = (ulonglong)uVar11;
          if (uVar11 != 0) goto LAB_1401d579e;
          uVar11 = (*pcVar12)(auStack_1858 + (longlong)iVar9 * 0x18,piVar1,local_18a8);
          uVar4 = (ulonglong)uVar11;
          if (uVar11 != 0) goto LAB_1401d579e;
          iVar9 = iVar9 + 1;
          iVar7 = iVar7 + 1;
        } while (iVar9 < (int)local_18a4);
      }
      iVar9 = 0;
      uVar4 = 0;
      iVar7 = 0;
      local_1890 = 1;
      uVar11 = 0;
      local_1898 = (int *)(longlong)(*local_1868 + -1);
      piVar5 = local_1898;
LAB_1401d5586:
      while( true ) {
        local_1890 = local_1890 + -1;
        uVar8 = uVar4;
        if (local_1890 == 0) {
          if (piVar5 == (int *)0xffffffffffffffff) {
            if (((iVar9 != 2) || (iVar7 < 1)) || (iVar2 = 0, iVar7 < 1)) goto LAB_1401d576e;
            goto LAB_1401d5700;
          }
          piVar5 = (int *)((longlong)piVar5 + -1);
          uVar8 = (ulonglong)*(uint *)(*(longlong *)(local_1868 + 4) + 4 + (longlong)piVar5 * 4);
          local_1890 = 0x1c;
          local_1898 = piVar5;
        }
        local_1870 = (int)uVar8 * 2;
        uVar4 = (ulonglong)local_1870;
        uVar8 = uVar8 >> 0x1b;
        if (iVar9 == 0) goto code_r0x0001401d55cf;
        if ((iVar9 != 1) || ((uVar8 & 1) != 0)) goto LAB_1401d55d3;
        uVar3 = FUN_1401cced0(local_1888,local_1888);
        uVar4 = (ulonglong)uVar3;
        if (uVar3 != 0) break;
        uVar3 = (*pcVar12)(local_1888,piVar1,local_18a8);
        uVar4 = (ulonglong)uVar3;
        if (uVar3 != 0) break;
        uVar4 = (ulonglong)local_1870;
        piVar5 = local_1898;
      }
    }
  }
  goto LAB_1401d579e;
code_r0x0001401d55cf:
  if ((uVar8 & 1) != 0) {
LAB_1401d55d3:
    iVar7 = iVar7 + 1;
    iVar9 = 2;
    uVar11 = uVar11 | ((uint)uVar8 & 1) << ((sbyte)iVar2 - (char)iVar7 & 0x1fU);
    piVar5 = local_1898;
    if (iVar7 == iVar2) {
      iVar7 = 0;
      if (iVar2 != 0) {
        do {
          uVar3 = FUN_1401cced0(local_1888,local_1888);
          uVar4 = (ulonglong)uVar3;
          if (uVar3 != 0) goto LAB_1401d579e;
          uVar3 = (*pcVar12)(local_1888,piVar1,local_18a8);
          uVar4 = (ulonglong)uVar3;
          if (uVar3 != 0) goto LAB_1401d579e;
          iVar7 = iVar7 + 1;
        } while (iVar7 < iVar2);
      }
      uVar11 = FUN_1401ccd60(local_1888,auStack_1858 + (longlong)(int)uVar11 * 0x18,local_1888);
      uVar4 = (ulonglong)uVar11;
      if (uVar11 != 0) goto LAB_1401d579e;
      uVar11 = (*pcVar12)(local_1888,piVar1,local_18a8);
      uVar4 = (ulonglong)uVar11;
      if (uVar11 != 0) goto LAB_1401d579e;
      uVar4 = (ulonglong)local_1870;
      iVar7 = 0;
      iVar9 = 1;
      uVar11 = 0;
      piVar5 = local_1898;
    }
  }
  goto LAB_1401d5586;
  while( true ) {
    uVar3 = (*pcVar12)(local_1888,piVar1,local_18a8);
    uVar4 = (ulonglong)uVar3;
    if (uVar3 != 0) goto LAB_1401d579e;
    uVar11 = uVar11 * 2;
    if ((local_18a4 & uVar11) != 0) {
      uVar3 = FUN_1401ccd60(local_1888,local_1840,local_1888);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1401d579e;
      uVar3 = (*pcVar12)(local_1888,piVar1,local_18a8);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1401d579e;
    }
    iVar2 = iVar2 + 1;
    if (iVar7 <= iVar2) break;
LAB_1401d5700:
    uVar3 = FUN_1401cced0(local_1888,local_1888);
    uVar4 = (ulonglong)uVar3;
    if (uVar3 != 0) goto LAB_1401d579e;
  }
LAB_1401d576e:
  if (param_5 == 0) {
    uVar11 = (*pcVar12)(local_1888,piVar1,local_18a8);
    uVar4 = (ulonglong)uVar11;
    if (uVar11 != 0) goto LAB_1401d579e;
  }
  FUN_1401d4470(local_1888,local_1860);
  uVar4 = 0;
LAB_1401d579e:
  FUN_1401cc300(local_1888);
  uVar11 = local_18a4;
LAB_1401d57ad:
  FUN_1401cc300(local_1840);
  if (local_18a0 < (int)uVar11) {
    puVar10 = auStack_1858 + (longlong)local_18a0 * 0x18;
    uVar8 = (ulonglong)(uVar11 - local_18a0);
    do {
      FUN_1401cc300(puVar10);
      puVar10 = puVar10 + 0x18;
      uVar8 = uVar8 - 1;
    } while (uVar8 != 0);
  }
  return uVar4;
}



undefined8 FUN_1401d5820(int *param_1)

{
  int iVar1;
  uint uVar2;
  uint *puVar3;
  int iVar4;
  
  iVar1 = *param_1;
  if (iVar1 == 0) {
    return 0;
  }
  if ((iVar1 != 1) && (1 < iVar1)) {
    iVar1 = FUN_1401cc550();
    iVar4 = 0x1c;
    uVar2 = 1;
    if (0x1c < iVar1) {
      puVar3 = (uint *)(*(longlong *)(param_1 + 4) + 4);
      do {
        if ((*puVar3 & uVar2) == 0) {
          return 0;
        }
        uVar2 = uVar2 * 2;
        if (0xfffffff < uVar2) {
          puVar3 = puVar3 + 1;
          uVar2 = 1;
        }
        iVar4 = iVar4 + 1;
      } while (iVar4 < iVar1);
    }
  }
  return 1;
}



undefined8 FUN_1401d5890(int *param_1)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  iVar1 = *param_1;
  if (iVar1 < 2) {
    return 0;
  }
  iVar3 = 1;
  if (1 < iVar1) {
    piVar2 = *(int **)(param_1 + 4);
    do {
      piVar2 = piVar2 + 1;
      if (*piVar2 != 0xfffffff) {
        return 0;
      }
      iVar3 = iVar3 + 1;
    } while (iVar3 < iVar1);
  }
  return 1;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1401d58d0(undefined8 param_1,int *param_2,longlong param_3,undefined8 param_4,
                       int param_5)

{
  longlong lVar1;
  int iVar2;
  uint uVar3;
  ulonglong uVar4;
  longlong lVar5;
  int iVar6;
  int iVar7;
  ulonglong uVar8;
  int iVar9;
  undefined1 *puVar10;
  uint uVar11;
  code *pcVar12;
  undefined1 auStack_18d8 [32];
  uint local_18b8;
  int local_18b4;
  longlong local_18b0;
  int local_18a8;
  undefined1 local_18a0 [24];
  int *local_1888;
  uint local_1880;
  undefined1 local_1878 [24];
  undefined8 local_1860;
  undefined1 auStack_1858 [24];
  undefined1 local_1840 [6120];
  ulonglong local_58;
  
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_18d8;
  local_18b0 = param_3;
  local_1888 = param_2;
  local_1860 = param_4;
  iVar2 = FUN_1401cc550(param_2);
  if (iVar2 < 8) {
    iVar2 = 2;
  }
  else if (iVar2 < 0x25) {
    iVar2 = 3;
  }
  else if (iVar2 < 0x8d) {
    iVar2 = 4;
  }
  else if (iVar2 < 0x1c3) {
    iVar2 = 5;
  }
  else if (iVar2 < 0x518) {
    iVar2 = 6;
  }
  else {
    iVar2 = (0xdc9 < iVar2) + 7;
  }
  uVar4 = FUN_1401cc2a0(local_1840);
  if ((int)uVar4 != 0) {
    return uVar4;
  }
  iVar7 = iVar2 + -1;
  uVar11 = 1 << (sbyte)iVar2;
  iVar6 = 1 << ((byte)iVar7 & 0x1f);
  local_18b4 = iVar6;
  local_18b8 = uVar11;
  for (iVar9 = iVar6; iVar9 < (int)uVar11; iVar9 = iVar9 + 1) {
    uVar3 = FUN_1401cc2a0(auStack_1858 + (longlong)iVar9 * 0x18);
    if (uVar3 != 0) {
      if (iVar6 < iVar9) {
        uVar4 = (ulonglong)(uint)(iVar9 - local_18b4);
        puVar10 = auStack_1858 + (longlong)iVar6 * 0x18;
        do {
          FUN_1401cc300(puVar10);
          puVar10 = puVar10 + 0x18;
          uVar4 = uVar4 - 1;
        } while (uVar4 != 0);
      }
      FUN_1401cc300(local_1840);
      return (ulonglong)uVar3;
    }
    param_3 = local_18b0;
  }
  uVar3 = FUN_1401cc2a0(local_1878);
  uVar4 = (ulonglong)uVar3;
  if (uVar3 != 0) goto LAB_1401d5dd4;
  if (param_5 == 0) {
    uVar3 = FUN_1401d8990(local_1878,param_3);
    uVar4 = (ulonglong)uVar3;
    if (uVar3 == 0) {
      pcVar12 = FUN_1401d8810;
LAB_1401d5a82:
      uVar3 = FUN_1401d4750(param_1,param_3,local_1840);
      uVar4 = (ulonglong)uVar3;
      uVar11 = local_18b8;
      if (uVar3 == 0) {
        puVar10 = auStack_1858 + (longlong)local_18b4 * 0x18;
        uVar3 = FUN_1401cc3a0(local_1840,puVar10);
        lVar1 = local_18b0;
        uVar4 = (ulonglong)uVar3;
        uVar11 = local_18b8;
        if (uVar3 == 0) {
          iVar9 = 0;
          if (0 < iVar7) {
            do {
              uVar3 = FUN_1401cced0(puVar10,puVar10);
              uVar4 = (ulonglong)uVar3;
              uVar11 = local_18b8;
              if (uVar3 != 0) goto LAB_1401d5dca;
              uVar3 = (*pcVar12)(puVar10,lVar1,local_1878);
              uVar4 = (ulonglong)uVar3;
              uVar11 = local_18b8;
              if (uVar3 != 0) goto LAB_1401d5dca;
              iVar9 = iVar9 + 1;
            } while (iVar9 < iVar7);
          }
          iVar9 = local_18b4 + 1;
          iVar7 = local_18b4;
          if (iVar9 < (int)local_18b8) {
            do {
              uVar3 = FUN_1401ccd60(auStack_1858 + (longlong)iVar7 * 0x18,local_1840,
                                    auStack_1858 + (longlong)iVar9 * 0x18);
              uVar4 = (ulonglong)uVar3;
              uVar11 = local_18b8;
              if (uVar3 != 0) goto LAB_1401d5dca;
              uVar3 = (*pcVar12)(auStack_1858 + (longlong)iVar9 * 0x18,lVar1,local_1878);
              uVar4 = (ulonglong)uVar3;
              uVar11 = local_18b8;
              if (uVar3 != 0) goto LAB_1401d5dca;
              iVar9 = iVar9 + 1;
              iVar7 = iVar7 + 1;
            } while (iVar9 < (int)local_18b8);
          }
          uVar3 = FUN_1401cc2a0(local_18a0);
          uVar4 = (ulonglong)uVar3;
          uVar11 = local_18b8;
          if (uVar3 == 0) {
            FUN_1401d4fd0(local_18a0,1);
            iVar9 = 0;
            uVar4 = 0;
            iVar7 = 0;
            local_18a8 = 1;
            uVar11 = 0;
            local_18b0 = (longlong)(*local_1888 + -1);
            lVar5 = local_18b0;
LAB_1401d5bc5:
            while( true ) {
              local_18a8 = local_18a8 + -1;
              uVar8 = uVar4;
              if (local_18a8 == 0) {
                if (lVar5 == -1) {
                  if (((iVar9 != 2) || (iVar7 < 1)) || (iVar2 = 0, iVar7 < 1)) goto LAB_1401d5daa;
                  goto LAB_1401d5d40;
                }
                lVar5 = lVar5 + -1;
                uVar8 = (ulonglong)*(uint *)(*(longlong *)(local_1888 + 4) + 4 + lVar5 * 4);
                local_18a8 = 0x1c;
                local_18b0 = lVar5;
              }
              local_1880 = (int)uVar8 * 2;
              uVar4 = (ulonglong)local_1880;
              uVar8 = uVar8 >> 0x1b;
              if (iVar9 == 0) goto code_r0x0001401d5c0e;
              if ((iVar9 != 1) || ((uVar8 & 1) != 0)) goto LAB_1401d5c12;
              uVar3 = FUN_1401cced0(local_18a0,local_18a0);
              uVar4 = (ulonglong)uVar3;
              if (uVar3 != 0) break;
              uVar3 = (*pcVar12)(local_18a0,lVar1,local_1878);
              uVar4 = (ulonglong)uVar3;
              if (uVar3 != 0) break;
              uVar4 = (ulonglong)local_1880;
              lVar5 = local_18b0;
            }
            goto LAB_1401d5dbb;
          }
        }
      }
    }
  }
  else {
    uVar3 = FUN_1401d87a0(param_3,local_1878);
    uVar4 = (ulonglong)uVar3;
    if (uVar3 == 0) {
      pcVar12 = FUN_1401d86b0;
      goto LAB_1401d5a82;
    }
  }
LAB_1401d5dca:
  FUN_1401cc300(local_1878);
LAB_1401d5dd4:
  FUN_1401cc300(local_1840);
  if (local_18b4 < (int)uVar11) {
    puVar10 = auStack_1858 + (longlong)local_18b4 * 0x18;
    uVar8 = (ulonglong)(uVar11 - local_18b4);
    do {
      FUN_1401cc300(puVar10);
      puVar10 = puVar10 + 0x18;
      uVar8 = uVar8 - 1;
    } while (uVar8 != 0);
  }
  return uVar4;
  while( true ) {
    uVar3 = (*pcVar12)(local_18a0,lVar1,local_1878);
    uVar4 = (ulonglong)uVar3;
    if (uVar3 != 0) goto LAB_1401d5dbb;
    uVar11 = uVar11 * 2;
    if ((local_18b8 & uVar11) != 0) {
      uVar3 = FUN_1401ccd60(local_18a0,local_1840,local_18a0);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1401d5dbb;
      uVar3 = (*pcVar12)(local_18a0,lVar1,local_1878);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1401d5dbb;
    }
    iVar2 = iVar2 + 1;
    if (iVar7 <= iVar2) break;
LAB_1401d5d40:
    uVar3 = FUN_1401cced0(local_18a0,local_18a0);
    uVar4 = (ulonglong)uVar3;
    if (uVar3 != 0) goto LAB_1401d5dbb;
  }
LAB_1401d5daa:
  FUN_1401d4470(local_18a0,local_1860);
  uVar4 = 0;
LAB_1401d5dbb:
  FUN_1401cc300(local_18a0);
  uVar11 = local_18b8;
  goto LAB_1401d5dca;
code_r0x0001401d5c0e:
  if ((uVar8 & 1) != 0) {
LAB_1401d5c12:
    iVar7 = iVar7 + 1;
    iVar9 = 2;
    uVar11 = uVar11 | ((uint)uVar8 & 1) << ((sbyte)iVar2 - (char)iVar7 & 0x1fU);
    lVar5 = local_18b0;
    if (iVar7 == iVar2) {
      iVar7 = 0;
      if (iVar2 != 0) {
        do {
          uVar3 = FUN_1401cced0(local_18a0,local_18a0);
          uVar4 = (ulonglong)uVar3;
          if (uVar3 != 0) goto LAB_1401d5dbb;
          uVar3 = (*pcVar12)(local_18a0,lVar1,local_1878);
          uVar4 = (ulonglong)uVar3;
          if (uVar3 != 0) goto LAB_1401d5dbb;
          iVar7 = iVar7 + 1;
        } while (iVar7 < iVar2);
      }
      uVar11 = FUN_1401ccd60(local_18a0,auStack_1858 + (longlong)(int)uVar11 * 0x18,local_18a0);
      uVar4 = (ulonglong)uVar11;
      if (uVar11 != 0) goto LAB_1401d5dbb;
      uVar11 = (*pcVar12)(local_18a0,lVar1,local_1878);
      uVar4 = (ulonglong)uVar11;
      if (uVar11 != 0) goto LAB_1401d5dbb;
      uVar4 = (ulonglong)local_1880;
      iVar7 = 0;
      iVar9 = 1;
      uVar11 = 0;
      lVar5 = local_18b0;
    }
  }
  goto LAB_1401d5bc5;
}



bool FUN_1401d5e50(uint *param_1)

{
  uint uVar1;
  int *piVar2;
  ulonglong uVar3;
  int iVar4;
  
  uVar1 = *param_1;
  uVar3 = (ulonglong)uVar1;
  if (uVar1 != 0) {
    if (uVar1 == 1) {
      return true;
    }
    if (1 < (int)uVar1) {
      iVar4 = 0;
      if (0 < (int)uVar1) {
        piVar2 = *(int **)(param_1 + 4);
        iVar4 = 0;
        do {
          if (*piVar2 == 0xfffffff) {
            iVar4 = iVar4 + 1;
          }
          piVar2 = piVar2 + 1;
          uVar3 = uVar3 - 1;
        } while (uVar3 != 0);
      }
      return (int)uVar1 / 2 <= iVar4;
    }
  }
  return false;
}



ulonglong FUN_1401d5ea0(undefined8 param_1,undefined8 param_2,undefined4 *param_3)

{
  int iVar1;
  uint uVar2;
  int iVar3;
  int iVar4;
  ulonglong uVar5;
  undefined1 local_68 [24];
  undefined1 local_50 [24];
  undefined1 local_38 [32];
  
  *param_3 = 0;
  iVar1 = FUN_1401cc520(param_2,1);
  if (iVar1 != 1) {
    return 0xfffffffd;
  }
  uVar5 = FUN_1401d27d0(local_50,param_1);
  if ((int)uVar5 != 0) {
    return uVar5;
  }
  uVar2 = FUN_1401ccc20(local_50,1,local_50);
  uVar5 = (ulonglong)uVar2;
  if (uVar2 != 0) goto LAB_1401d6032;
  uVar2 = FUN_1401d27d0(local_38,local_50);
  uVar5 = (ulonglong)uVar2;
  if (uVar2 != 0) goto LAB_1401d6032;
  iVar1 = FUN_1401cc580(local_38);
  uVar2 = FUN_1401d2800(local_38,iVar1,local_38,0);
  uVar5 = (ulonglong)uVar2;
  if (uVar2 == 0) {
    uVar2 = FUN_1401cc2a0(local_68);
    uVar5 = (ulonglong)uVar2;
    if (uVar2 == 0) {
      uVar2 = FUN_1401cdbb0(param_2,local_38,param_1,local_68);
      uVar5 = (ulonglong)uVar2;
      if (uVar2 == 0) {
        iVar3 = FUN_1401cc520(local_68,1);
        if ((iVar3 != 0) && (iVar3 = FUN_1401cc4f0(local_68,local_50), iVar3 != 0)) {
          iVar3 = 1;
          if (0 < iVar1 + -1) {
            do {
              iVar4 = FUN_1401cc4f0(local_68,local_50);
              if (iVar4 == 0) break;
              uVar2 = FUN_1401cd870(local_68,param_1,local_68);
              uVar5 = (ulonglong)uVar2;
              if ((uVar2 != 0) || (iVar4 = FUN_1401cc520(local_68,1), iVar4 == 0))
              goto LAB_1401d6018;
              iVar3 = iVar3 + 1;
            } while (iVar3 <= iVar1 + -1);
          }
          iVar1 = FUN_1401cc4f0(local_68,local_50);
          if (iVar1 != 0) goto LAB_1401d6018;
        }
        *param_3 = 1;
      }
LAB_1401d6018:
      FUN_1401cc300(local_68);
    }
  }
  FUN_1401cc300(local_38);
LAB_1401d6032:
  FUN_1401cc300(local_50);
  return uVar5;
}



undefined8 FUN_1401d6060(undefined8 param_1,undefined4 *param_2)

{
  undefined8 uVar1;
  undefined4 *puVar2;
  int local_res10 [2];
  
  *param_2 = 0;
  puVar2 = &DAT_14026df80;
  while( true ) {
    uVar1 = FUN_1401cd530(param_1,*puVar2,local_res10);
    if ((int)uVar1 != 0) {
      return uVar1;
    }
    if (local_res10[0] == 0) break;
    puVar2 = puVar2 + 1;
    if (0x14026e37f < (longlong)puVar2) {
      return 0;
    }
  }
  *param_2 = 1;
  return 0;
}



undefined8 FUN_1401d60e0(longlong param_1,uint *param_2,longlong param_3,uint param_4)

{
  undefined8 uVar1;
  int iVar2;
  undefined4 *puVar3;
  ulonglong uVar4;
  uint uVar5;
  ulonglong uVar6;
  undefined8 *puVar7;
  undefined4 local_res8 [2];
  uint local_48 [4];
  
  if (((param_1 == 0) || (param_2 == (uint *)0x0)) || (param_3 == 0)) {
    return 0x10;
  }
  if (*param_2 < 2) {
    return 7;
  }
  uVar6 = 0;
  if (param_4 != 0) {
    puVar3 = (undefined4 *)(param_3 + 0x14);
    uVar4 = (ulonglong)param_4;
    do {
      *puVar3 = 0;
      puVar3 = puVar3 + 0xe;
      uVar4 = uVar4 - 1;
    } while (uVar4 != 0);
  }
  if (param_4 != 0) {
    puVar7 = (undefined8 *)(param_3 + 8);
    uVar4 = uVar6;
    do {
      local_res8[0] = *(undefined4 *)(puVar7 + 1);
      uVar1 = *puVar7;
      switch(*(undefined4 *)(puVar7 + -1)) {
      case 2:
        iVar2 = FUN_1401d7860(param_1,*param_2,uVar1);
        if (iVar2 == 0) {
          iVar2 = FUN_1401d7760(uVar1,local_48);
          goto LAB_1401d63b5;
        }
        break;
      case 3:
        iVar2 = FUN_1401d7700(param_1,*param_2,uVar1);
        if (iVar2 == 0) {
          iVar2 = FUN_1401d76b0(local_res8[0],local_48);
          goto LAB_1401d63b5;
        }
        break;
      case 4:
        iVar2 = FUN_1401d7550(param_1,*param_2,uVar1,local_res8);
        if (iVar2 == 0) {
          iVar2 = FUN_1401d7500(local_res8[0],local_48);
joined_r0x0001401d636f:
          if (iVar2 == 0) {
            *(undefined4 *)(uVar6 * 0x38 + 0x10 + param_3) = local_res8[0];
            *(undefined4 *)(uVar6 * 0x38 + 0x14 + param_3) = 1;
            *param_2 = local_48[0];
            return 0;
          }
        }
        break;
      case 5:
        iVar2 = FUN_1401d7400(param_1,*param_2,uVar1,local_res8);
        if (iVar2 == 0) {
          iVar2 = FUN_1401d73b0(local_res8[0],local_48);
          goto joined_r0x0001401d636f;
        }
        break;
      case 6:
        if (((*param_2 == 2) && (*(char *)(uVar4 + param_1) == '\x05')) &&
           (*(char *)(uVar4 + 1 + param_1) == '\0')) {
          *param_2 = 2;
          *(undefined4 *)(uVar6 * 0x38 + 0x14 + param_3) = 1;
          return 0;
        }
        break;
      case 7:
        iVar2 = FUN_1401d7230(param_1,*param_2,uVar1,local_res8);
        if (iVar2 == 0) {
          iVar2 = FUN_1401d7100(uVar1,local_res8[0],local_48);
          goto joined_r0x0001401d636f;
        }
        break;
      case 8:
        iVar2 = FUN_1401d6fc0(param_1,*param_2,uVar1,local_res8);
        if (iVar2 == 0) {
          iVar2 = FUN_1401d6f20(uVar1,local_res8[0],local_48);
          goto joined_r0x0001401d636f;
        }
        break;
      case 9:
        iVar2 = FUN_1401d6d80(param_1,*param_2,uVar1,local_res8);
        if (iVar2 == 0) {
          iVar2 = FUN_1401d6ce0(uVar1,local_res8[0],local_48);
          goto joined_r0x0001401d636f;
        }
        break;
      case 10:
        iVar2 = FUN_1401d6ae0(param_1,*param_2,uVar1,local_res8);
        if (iVar2 == 0) {
          iVar2 = FUN_1401d69d0(uVar1,local_res8[0],local_48);
          goto joined_r0x0001401d636f;
        }
        break;
      case 0xb:
        local_48[0] = *param_2;
        iVar2 = FUN_1401d66d0(param_1,local_48,uVar1);
LAB_1401d63b5:
        if (iVar2 == 0) {
          *(undefined4 *)(uVar6 * 0x38 + 0x14 + param_3) = 1;
          *param_2 = local_48[0];
          return 0;
        }
        break;
      default:
        return 0x10;
      case 0xd:
      case 0xe:
      case 0xf:
        iVar2 = FUN_1401d1120(param_1,*param_2,uVar1,local_res8[0],1);
        if (iVar2 == 0) {
          iVar2 = FUN_1401d6450(uVar1,local_res8[0],local_48);
          goto LAB_1401d63b5;
        }
      }
      uVar5 = (int)uVar6 + 1;
      uVar6 = (ulonglong)uVar5;
      uVar4 = uVar4 + 1;
      puVar7 = puVar7 + 7;
    } while (uVar5 < param_4);
  }
  return 7;
}



undefined8 FUN_1401d6450(longlong param_1,uint param_2,int *param_3)

{
  undefined4 uVar1;
  undefined4 *puVar2;
  undefined8 uVar3;
  uint uVar4;
  int iVar5;
  uint uVar6;
  undefined8 *puVar7;
  int local_res8 [2];
  uint local_res10;
  
  if ((param_1 == 0) || (param_3 == (int *)0x0)) {
    return 0x10;
  }
  uVar6 = 0;
  uVar4 = 0;
  if (param_2 != 0) {
    puVar7 = (undefined8 *)(param_1 + 8);
    local_res10 = param_2;
    do {
      uVar1 = *(undefined4 *)(puVar7 + 1);
      puVar2 = (undefined4 *)*puVar7;
      if (*(int *)(puVar7 + -1) == 0) break;
      switch(*(int *)(puVar7 + -1)) {
      case 1:
        uVar3 = FUN_1401d79f0(local_res8);
        break;
      case 2:
        uVar3 = FUN_1401d7760(puVar2,local_res8);
        break;
      case 3:
        uVar3 = FUN_1401d76b0(*puVar2,local_res8);
        break;
      case 4:
        uVar3 = FUN_1401d7500(uVar1,local_res8);
        break;
      case 5:
        uVar3 = FUN_1401d73b0(uVar1,local_res8);
        break;
      case 6:
        uVar4 = uVar4 + 2;
        goto LAB_1401d6597;
      case 7:
        uVar3 = FUN_1401d7100(puVar2,uVar1,local_res8);
        break;
      case 8:
        uVar3 = FUN_1401d6f20(puVar2,uVar1,local_res8);
        break;
      case 9:
        uVar3 = FUN_1401d6ce0(puVar2,uVar1,local_res8);
        break;
      case 10:
        uVar3 = FUN_1401d69d0(puVar2,uVar1,local_res8);
        break;
      case 0xb:
        uVar3 = FUN_1401d89d0(puVar2,local_res8);
        break;
      default:
        goto LAB_1401d65e5;
      case 0xd:
      case 0xe:
      case 0xf:
        uVar3 = FUN_1401d6450(puVar2,uVar1,local_res8);
      }
      if ((int)uVar3 != 0) {
        return uVar3;
      }
      uVar4 = uVar4 + local_res8[0];
LAB_1401d6597:
      uVar6 = uVar6 + 1;
      puVar7 = puVar7 + 7;
    } while (uVar6 < local_res10);
    if (0x7f < uVar4) {
      if (uVar4 < 0x100) {
        iVar5 = uVar4 + 3;
      }
      else if (uVar4 < 0x10000) {
        iVar5 = uVar4 + 4;
      }
      else {
        if (0xffffff < uVar4) {
LAB_1401d65e5:
          return 0x10;
        }
        iVar5 = uVar4 + 5;
      }
      goto LAB_1401d65e0;
    }
  }
  iVar5 = uVar4 + 2;
LAB_1401d65e0:
  *param_3 = iVar5;
  return 0;
}



undefined8 FUN_1401d6640(undefined1 param_1)

{
  switch(param_1) {
  case 0x30:
    return 0;
  case 0x31:
    return 1;
  case 0x32:
    return 2;
  case 0x33:
    return 3;
  case 0x34:
    return 4;
  case 0x35:
    return 5;
  case 0x36:
    return 6;
  case 0x37:
    return 7;
  case 0x38:
    return 8;
  case 0x39:
    return 9;
  default:
    return 100;
  }
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined4 FUN_1401d66d0(longlong param_1,uint *param_2,uint *param_3)

{
  byte bVar1;
  int iVar2;
  int iVar3;
  undefined1 *puVar4;
  uint uVar5;
  uint uVar6;
  undefined1 auStack_88 [32];
  undefined1 local_68 [4];
  undefined1 local_64;
  undefined1 local_63;
  undefined1 local_62;
  undefined1 local_61;
  undefined1 local_60;
  undefined1 local_5f;
  char local_5e;
  undefined1 local_5d;
  char local_5c;
  undefined1 local_5b;
  undefined1 local_5a;
  undefined1 local_59;
  undefined1 local_58;
  ulonglong local_48;
  
  local_48 = DAT_1402f85a0 ^ (ulonglong)auStack_88;
  if (((param_1 == 0) || (param_2 == (uint *)0x0)) || (param_3 == (uint *)0x0)) {
    return 0x10;
  }
  if (*param_2 < 2) {
    return 7;
  }
  bVar1 = *(byte *)(param_1 + 1);
  if (0x1f < bVar1) {
    return 7;
  }
  if (*param_2 < bVar1 + 2) {
    return 7;
  }
  uVar5 = 0;
  uVar6 = uVar5;
  if (bVar1 != 0) {
    puVar4 = local_68;
    uVar6 = 0;
    do {
      iVar2 = FUN_1401d6ee0(puVar4[(param_1 - (longlong)local_68) + 2]);
      if (iVar2 == -1) {
        return 7;
      }
      *puVar4 = (char)iVar2;
      uVar6 = uVar6 + 1;
      puVar4 = puVar4 + 1;
    } while (uVar6 < *(byte *)(param_1 + 1));
  }
  *param_2 = uVar6 + 2;
  iVar2 = FUN_1401d6640(local_68[0]);
  iVar2 = iVar2 * 5;
  iVar3 = FUN_1401d6640(local_68[1]);
  uVar6 = iVar3 + iVar2 * 2;
  *param_3 = uVar6;
  if (uVar6 < 100) {
    iVar2 = FUN_1401d6640(local_68[2]);
    iVar2 = iVar2 * 5;
    iVar3 = FUN_1401d6640(local_68[3]);
    uVar6 = iVar3 + iVar2 * 2;
    param_3[1] = uVar6;
    if (0xc < uVar6) {
      return 7;
    }
    iVar2 = FUN_1401d6640(local_64);
    iVar2 = iVar2 * 5;
    iVar3 = FUN_1401d6640(local_63);
    uVar6 = iVar3 + iVar2 * 2;
    param_3[2] = uVar6;
    if (0x1f < uVar6) {
      return 7;
    }
    iVar2 = FUN_1401d6640(local_62);
    iVar2 = iVar2 * 5;
    iVar3 = FUN_1401d6640(local_61);
    uVar6 = iVar3 + iVar2 * 2;
    param_3[3] = uVar6;
    if (0x17 < uVar6) {
      return 7;
    }
    iVar2 = FUN_1401d6640(local_60);
    iVar2 = iVar2 * 5;
    iVar3 = FUN_1401d6640(local_5f);
    uVar6 = iVar3 + iVar2 * 2;
    param_3[4] = uVar6;
    if (0x3b < uVar6) {
      return 7;
    }
    param_3[7] = 0;
    param_3[8] = 0;
    param_3[5] = 0;
    param_3[6] = 0;
    if (local_5e == 'Z') {
      return 0;
    }
    if (local_5e == '+') {
      uVar6 = 0;
    }
    else {
      if (local_5e != '-') {
        iVar2 = FUN_1401d6640();
        iVar2 = iVar2 * 5;
        iVar3 = FUN_1401d6640(local_5d);
        uVar6 = iVar3 + iVar2 * 2;
        param_3[5] = uVar6;
        if (0x3b < uVar6) {
          return 7;
        }
        if (local_5c == 'Z') {
          return 0;
        }
        if (local_5c != '+') {
          if (local_5c != '-') {
            return 7;
          }
          uVar5 = 1;
        }
        param_3[6] = uVar5;
        iVar2 = FUN_1401d6640(local_5b);
        iVar2 = iVar2 * 5;
        iVar3 = FUN_1401d6640(local_5a);
        uVar6 = iVar3 + iVar2 * 2;
        param_3[7] = uVar6;
        if (0x17 < uVar6) {
          return 7;
        }
        iVar2 = FUN_1401d6640(local_59);
        goto LAB_1401d68f8;
      }
      uVar6 = 1;
    }
    param_3[6] = uVar6;
    iVar2 = FUN_1401d6640(local_5d);
    iVar2 = iVar2 * 5;
    iVar3 = FUN_1401d6640(local_5c);
    uVar6 = iVar3 + iVar2 * 2;
    param_3[7] = uVar6;
    if (uVar6 < 0x18) {
      iVar2 = FUN_1401d6640(local_5b);
      local_58 = local_5a;
LAB_1401d68f8:
      iVar2 = iVar2 * 5;
      iVar3 = FUN_1401d6640(local_58);
      uVar6 = iVar3 + iVar2 * 2;
      param_3[8] = uVar6;
      if (0x3b < uVar6) {
        return 7;
      }
      return 0;
    }
  }
  return 7;
}



undefined8 FUN_1401d69a0(ushort param_1)

{
  if (param_1 < 0x80) {
    return 1;
  }
  if (param_1 < 0x800) {
    return 2;
  }
  return 3;
}



undefined8 FUN_1401d69d0(ushort *param_1,uint param_2,int *param_3)

{
  ushort uVar1;
  uint uVar2;
  int iVar3;
  uint uVar4;
  
  if ((param_1 == (ushort *)0x0) || (param_3 == (int *)0x0)) {
    return 0x10;
  }
  uVar2 = 0;
  uVar4 = 0;
  if (param_2 != 0) {
    do {
      uVar1 = *param_1;
      if (0x10ffff < uVar1) {
        return 0x10;
      }
      if (uVar1 < 0x80) {
        iVar3 = 1;
      }
      else if (uVar1 < 0x800) {
        iVar3 = 2;
      }
      else {
        iVar3 = 3;
      }
      uVar4 = uVar4 + 1;
      uVar2 = uVar2 + iVar3;
      param_1 = param_1 + 1;
    } while (uVar4 < param_2);
    if (0x7f < uVar2) {
      if (uVar2 < 0x100) {
        *param_3 = uVar2 + 3;
        return 0;
      }
      if (0xffff < uVar2) {
        if (0xffffff < uVar2) {
          return 0x10;
        }
        *param_3 = uVar2 + 5;
        return 0;
      }
      *param_3 = uVar2 + 4;
      return 0;
    }
  }
  *param_3 = uVar2 + 2;
  return 0;
}



undefined8 FUN_1401d6ae0(byte *param_1,uint param_2,ushort *param_3,uint *param_4)

{
  byte bVar1;
  undefined8 uVar2;
  uint uVar3;
  ushort uVar4;
  uint uVar5;
  byte *pbVar6;
  longlong lVar7;
  uint uVar8;
  
  if (((param_1 == (byte *)0x0) || (param_3 == (ushort *)0x0)) || (param_4 == (uint *)0x0)) {
    return 0x10;
  }
  if ((1 < param_2) && ((*param_1 & 0x1f) == 0xc)) {
    bVar1 = param_1[1];
    if ((char)bVar1 < '\0') {
      uVar5 = bVar1 & 0x7f;
      if ((bVar1 & 0x7f) == 0) {
        return 7;
      }
      if (3 < uVar5) {
        return 7;
      }
      if (param_2 < uVar5 + 1) {
        return 7;
      }
      uVar3 = 0;
      pbVar6 = param_1 + 2;
      uVar8 = uVar5 + 2;
      do {
        bVar1 = *pbVar6;
        pbVar6 = pbVar6 + 1;
        uVar3 = uVar3 << 8 | (uint)bVar1;
        uVar5 = uVar5 - 1;
      } while (uVar5 != 0);
    }
    else {
      uVar8 = 2;
      uVar3 = bVar1 & 0x7f;
    }
    if (uVar3 + uVar8 <= param_2) {
      uVar3 = 0;
      lVar7 = (longlong)(int)uVar8;
      do {
        if (param_2 <= uVar8) {
          uVar2 = 0;
LAB_1401d6c33:
          *param_4 = uVar3;
          return uVar2;
        }
        uVar4 = (ushort)param_1[lVar7];
        uVar8 = uVar8 + 1;
        uVar5 = 0;
        if ((char)param_1[lVar7] < '\0') {
          do {
            if (4 < uVar5) {
              return 7;
            }
            uVar5 = uVar5 + 1;
            uVar4 = (uVar4 & 0x7f) * 2;
          } while ((char)uVar4 < '\0');
          if (4 < uVar5) {
            return 7;
          }
        }
        if (param_2 < (uVar5 - 1) + uVar8) {
          return 7;
        }
        uVar4 = uVar4 >> ((byte)uVar5 & 0x1f);
        if (1 < uVar5) {
          uVar5 = uVar5 - 1;
        }
        while (lVar7 = lVar7 + 1, uVar5 != 0) {
          uVar5 = uVar5 - 1;
          if ((param_1[lVar7] & 0xc0) != 0x80) {
            return 7;
          }
          uVar8 = uVar8 + 1;
          uVar4 = uVar4 << 6 | (ushort)(param_1[lVar7] & 0x3f);
        }
        if (*param_4 < uVar3) {
          uVar2 = 6;
          goto LAB_1401d6c33;
        }
        *param_3 = uVar4;
        param_3 = param_3 + 1;
        uVar3 = uVar3 + 1;
      } while( true );
    }
  }
  return 7;
}



undefined4 FUN_1401d6c70(int param_1)

{
  int *piVar1;
  int iVar2;
  
  iVar2 = 0;
  piVar1 = &DAT_14026e380;
  do {
    if (*piVar1 == param_1) {
      return (&DAT_14026e384)[(longlong)iVar2 * 2];
    }
    piVar1 = piVar1 + 2;
    iVar2 = iVar2 + 1;
  } while ((longlong)piVar1 < 0x14026e5d0);
  return 0xffffffff;
}



undefined4 FUN_1401d6ca0(int param_1)

{
  int *piVar1;
  int iVar2;
  
  iVar2 = 0;
  piVar1 = &DAT_14026e384;
  do {
    if (*piVar1 == param_1) {
      return (&DAT_14026e380)[(longlong)iVar2 * 2];
    }
    piVar1 = piVar1 + 2;
    iVar2 = iVar2 + 1;
  } while ((longlong)piVar1 < 0x14026e5d4);
  return 0xffffffff;
}



undefined8 FUN_1401d6ce0(byte *param_1,uint param_2,int *param_3)

{
  longlong lVar1;
  uint uVar2;
  
  if ((param_3 != (int *)0x0) && (param_1 != (byte *)0x0)) {
    uVar2 = 0;
    if (param_2 != 0) {
      do {
        lVar1 = 0;
        while ((&DAT_14026e380)[lVar1 * 2] != (uint)*param_1) {
          lVar1 = lVar1 + 1;
          if (0x49 < lVar1) {
            return 0x10;
          }
        }
        if ((&DAT_14026e384)[lVar1 * 2] == -1) {
          return 0x10;
        }
        uVar2 = uVar2 + 1;
        param_1 = param_1 + 1;
      } while (uVar2 < param_2);
    }
    if (param_2 < 0x80) {
      *param_3 = param_2 + 2;
      return 0;
    }
    if (param_2 < 0x100) {
      *param_3 = param_2 + 3;
      return 0;
    }
    if (param_2 < 0x10000) {
      *param_3 = param_2 + 4;
      return 0;
    }
    if (param_2 < 0x1000000) {
      *param_3 = param_2 + 5;
      return 0;
    }
  }
  return 0x10;
}



undefined8 FUN_1401d6d80(byte *param_1,uint param_2,undefined1 *param_3,uint *param_4)

{
  byte bVar1;
  int iVar2;
  uint uVar3;
  byte *pbVar4;
  uint uVar5;
  uint uVar6;
  
  if (((param_1 == (byte *)0x0) || (param_3 == (undefined1 *)0x0)) || (param_4 == (uint *)0x0)) {
    return 0x10;
  }
  if ((param_2 < 2) || ((*param_1 & 0x1f) != 0x13)) {
    return 7;
  }
  bVar1 = param_1[1];
  uVar5 = 0;
  if ((char)bVar1 < '\0') {
    uVar3 = bVar1 & 0x7f;
    if ((bVar1 & 0x7f) == 0) {
      return 7;
    }
    if (3 < uVar3) {
      return 7;
    }
    if (param_2 < uVar3 + 1) {
      return 7;
    }
    uVar6 = 0;
    pbVar4 = param_1 + 2;
    iVar2 = uVar3 + 2;
    do {
      bVar1 = *pbVar4;
      pbVar4 = pbVar4 + 1;
      uVar6 = uVar6 << 8 | (uint)bVar1;
      uVar3 = uVar3 - 1;
    } while (uVar3 != 0);
  }
  else {
    iVar2 = 2;
    uVar6 = bVar1 & 0x7f;
  }
  if (*param_4 < uVar6) {
    *param_4 = uVar6;
    return 6;
  }
  if (param_2 < uVar6 + iVar2) {
    return 7;
  }
  if (uVar6 != 0) {
    param_1 = param_1 + iVar2;
    do {
      iVar2 = FUN_1401d6ca0(*param_1);
      param_1 = param_1 + 1;
      if (iVar2 == -1) {
        return 0x10;
      }
      uVar5 = uVar5 + 1;
      *param_3 = (char)iVar2;
      param_3 = param_3 + 1;
    } while (uVar5 < uVar6);
  }
  *param_4 = uVar5;
  return 0;
}



undefined4 FUN_1401d6eb0(int param_1)

{
  int *piVar1;
  int iVar2;
  
  iVar2 = 0;
  piVar1 = &DAT_14026e5d0;
  do {
    if (*piVar1 == param_1) {
      return (&DAT_14026e5d4)[(longlong)iVar2 * 2];
    }
    piVar1 = piVar1 + 2;
    iVar2 = iVar2 + 1;
  } while ((longlong)piVar1 < 0x14026e900);
  return 0xffffffff;
}



undefined4 FUN_1401d6ee0(int param_1)

{
  int *piVar1;
  int iVar2;
  
  iVar2 = 0;
  piVar1 = &DAT_14026e5d4;
  do {
    if (*piVar1 == param_1) {
      return (&DAT_14026e5d0)[(longlong)iVar2 * 2];
    }
    piVar1 = piVar1 + 2;
    iVar2 = iVar2 + 1;
  } while ((longlong)piVar1 < 0x14026e904);
  return 0xffffffff;
}



undefined8 FUN_1401d6f20(byte *param_1,uint param_2,int *param_3)

{
  longlong lVar1;
  uint uVar2;
  
  if ((param_3 != (int *)0x0) && (param_1 != (byte *)0x0)) {
    uVar2 = 0;
    if (param_2 != 0) {
      do {
        lVar1 = 0;
        while ((&DAT_14026e5d0)[lVar1 * 2] != (uint)*param_1) {
          lVar1 = lVar1 + 1;
          if (0x65 < lVar1) {
            return 0x10;
          }
        }
        if ((&DAT_14026e5d4)[lVar1 * 2] == -1) {
          return 0x10;
        }
        uVar2 = uVar2 + 1;
        param_1 = param_1 + 1;
      } while (uVar2 < param_2);
    }
    if (param_2 < 0x80) {
      *param_3 = param_2 + 2;
      return 0;
    }
    if (param_2 < 0x100) {
      *param_3 = param_2 + 3;
      return 0;
    }
    if (param_2 < 0x10000) {
      *param_3 = param_2 + 4;
      return 0;
    }
    if (param_2 < 0x1000000) {
      *param_3 = param_2 + 5;
      return 0;
    }
  }
  return 0x10;
}



undefined8 FUN_1401d6fc0(byte *param_1,uint param_2,undefined1 *param_3,uint *param_4)

{
  byte bVar1;
  int iVar2;
  uint uVar3;
  byte *pbVar4;
  uint uVar5;
  uint uVar6;
  
  if (((param_1 == (byte *)0x0) || (param_3 == (undefined1 *)0x0)) || (param_4 == (uint *)0x0)) {
    return 0x10;
  }
  if ((param_2 < 2) || ((*param_1 & 0x1f) != 0x16)) {
    return 7;
  }
  bVar1 = param_1[1];
  uVar5 = 0;
  if ((char)bVar1 < '\0') {
    uVar3 = bVar1 & 0x7f;
    if ((bVar1 & 0x7f) == 0) {
      return 7;
    }
    if (3 < uVar3) {
      return 7;
    }
    if (param_2 < uVar3 + 1) {
      return 7;
    }
    uVar6 = 0;
    pbVar4 = param_1 + 2;
    iVar2 = uVar3 + 2;
    do {
      bVar1 = *pbVar4;
      pbVar4 = pbVar4 + 1;
      uVar6 = uVar6 << 8 | (uint)bVar1;
      uVar3 = uVar3 - 1;
    } while (uVar3 != 0);
  }
  else {
    iVar2 = 2;
    uVar6 = bVar1 & 0x7f;
  }
  if (*param_4 < uVar6) {
    *param_4 = uVar6;
    return 6;
  }
  if (param_2 < uVar6 + iVar2) {
    return 7;
  }
  if (uVar6 != 0) {
    param_1 = param_1 + iVar2;
    do {
      iVar2 = FUN_1401d6ee0(*param_1);
      param_1 = param_1 + 1;
      if (iVar2 == -1) {
        return 0x10;
      }
      uVar5 = uVar5 + 1;
      *param_3 = (char)iVar2;
      param_3 = param_3 + 1;
    } while (uVar5 < uVar6);
  }
  *param_4 = uVar5;
  return 0;
}



int FUN_1401d70f0(uint param_1)

{
  int iVar1;
  
  iVar1 = 0;
  for (; param_1 != 0; param_1 = param_1 >> 1) {
    iVar1 = iVar1 + 1;
  }
  return iVar1;
}



undefined8 FUN_1401d7100(uint *param_1,uint param_2,int *param_3)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  
  if ((((param_1 == (uint *)0x0) || (param_3 == (int *)0x0)) || (param_2 < 2)) ||
     ((uVar3 = *param_1, 3 < uVar3 || ((uVar3 < 2 && (0x27 < param_1[1])))))) {
    return 0x10;
  }
  uVar5 = 1;
  uVar4 = 0;
  uVar3 = param_1[1] + uVar3 * 0x28;
  if (1 < param_2) {
    param_1 = param_1 + 2;
    do {
      uVar2 = 0;
      for (uVar1 = uVar3; uVar1 != 0; uVar1 = uVar1 >> 1) {
        uVar2 = uVar2 + 1;
      }
      uVar4 = uVar4 + (uint)(uVar3 == 0) + (uint)(uVar2 != (uVar2 / 7) * 7) + uVar2 / 7;
      if (uVar5 < param_2 - 1) {
        uVar3 = *param_1;
      }
      uVar5 = uVar5 + 1;
      param_1 = param_1 + 1;
    } while (uVar5 < param_2);
    if (0x7f < uVar4) {
      if (uVar4 < 0x100) {
        *param_3 = uVar4 + 3;
        return 0;
      }
      if (0xffff < uVar4) {
        return 0x10;
      }
      *param_3 = uVar4 + 4;
      return 0;
    }
  }
  *param_3 = uVar4 + 2;
  return 0;
}



undefined8 FUN_1401d7230(byte *param_1,uint param_2,uint *param_3,uint *param_4)

{
  byte bVar1;
  byte *pbVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  int iVar6;
  longlong lVar7;
  
  if (((param_1 == (byte *)0x0) || (param_3 == (uint *)0x0)) || (param_4 == (uint *)0x0)) {
    return 0x10;
  }
  if (2 < param_2) {
    if (*param_4 < 2) {
      return 6;
    }
    if ((*param_1 & 0x1f) == 6) {
      bVar1 = param_1[1];
      if (bVar1 < 0x80) {
        uVar4 = (uint)bVar1;
        iVar6 = 2;
      }
      else {
        if (bVar1 < 0x81) {
          return 7;
        }
        if (0x82 < bVar1) {
          return 7;
        }
        uVar4 = 0;
        uVar3 = bVar1 & 0x7f;
        if ((bVar1 & 0x7f) == 0) {
          return 7;
        }
        pbVar2 = param_1 + 2;
        iVar6 = uVar3 + 2;
        do {
          bVar1 = *pbVar2;
          pbVar2 = pbVar2 + 1;
          uVar4 = uVar4 << 8 | (uint)bVar1;
          uVar3 = uVar3 - 1;
        } while (uVar3 != 0);
      }
      if ((uVar4 != 0) && (uVar4 + iVar6 <= param_2)) {
        uVar3 = 0;
        uVar5 = 0;
        lVar7 = 0;
        if (uVar4 != 0) {
          param_1 = param_1 + iVar6;
          do {
            bVar1 = *param_1;
            uVar4 = uVar4 - 1;
            param_1 = param_1 + 1;
            uVar5 = bVar1 & 0x7f | uVar5 << 7;
            if ((bVar1 & 0x80) == 0) {
              if (*param_4 <= uVar3) {
                return 6;
              }
              if (uVar3 == 0) {
                uVar3 = 2;
                lVar7 = 2;
                *param_3 = uVar5 / 0x28;
                param_3[1] = uVar5 % 0x28;
              }
              else {
                param_3[lVar7] = uVar5;
                uVar3 = uVar3 + 1;
                lVar7 = lVar7 + 1;
              }
              uVar5 = 0;
            }
          } while (uVar4 != 0);
        }
        *param_4 = uVar3;
        return 0;
      }
    }
  }
  return 7;
}



undefined8 FUN_1401d73b0(uint param_1,int *param_2)

{
  if (param_2 != (int *)0x0) {
    if (param_1 < 0x80) {
      *param_2 = param_1 + 2;
      return 0;
    }
    if (param_1 < 0x100) {
      *param_2 = param_1 + 3;
      return 0;
    }
    if (param_1 < 0x10000) {
      *param_2 = param_1 + 4;
      return 0;
    }
    if (param_1 < 0x1000000) {
      *param_2 = param_1 + 5;
      return 0;
    }
  }
  return 0x10;
}



undefined8 FUN_1401d7400(byte *param_1,uint param_2,byte *param_3,uint *param_4)

{
  byte bVar1;
  ulonglong uVar2;
  uint uVar3;
  uint uVar4;
  int iVar5;
  byte *pbVar6;
  
  if (((param_1 == (byte *)0x0) || (param_3 == (byte *)0x0)) || (param_4 == (uint *)0x0)) {
    return 0x10;
  }
  if ((param_2 < 2) || ((*param_1 & 0x1f) != 4)) {
    return 7;
  }
  bVar1 = param_1[1];
  uVar2 = 0;
  if ((char)bVar1 < '\0') {
    uVar3 = bVar1 & 0x7f;
    if ((bVar1 & 0x7f) == 0) {
      return 7;
    }
    if (3 < uVar3) {
      return 7;
    }
    if (param_2 < uVar3 + 1) {
      return 7;
    }
    pbVar6 = param_1 + 2;
    iVar5 = uVar3 + 2;
    do {
      bVar1 = *pbVar6;
      pbVar6 = pbVar6 + 1;
      uVar2 = (ulonglong)((int)uVar2 << 8 | (uint)bVar1);
      uVar3 = uVar3 - 1;
    } while (uVar3 != 0);
  }
  else {
    iVar5 = 2;
    uVar2 = (ulonglong)(bVar1 & 0x7f);
  }
  uVar3 = (uint)uVar2;
  if (*param_4 < uVar3) {
    *param_4 = uVar3;
    return 6;
  }
  if (param_2 < uVar3 + iVar5) {
    return 7;
  }
  uVar4 = 0;
  if (uVar3 != 0) {
    pbVar6 = param_3;
    do {
      uVar2 = uVar2 - 1;
      *pbVar6 = (param_1 + ((longlong)iVar5 - (longlong)param_3))[(longlong)pbVar6];
      pbVar6 = pbVar6 + 1;
      uVar4 = uVar3;
    } while (uVar2 != 0);
  }
  *param_4 = uVar4;
  return 0;
}



undefined8 FUN_1401d7500(ulonglong param_1,int *param_2)

{
  uint uVar1;
  
  if (param_2 != (int *)0x0) {
    uVar1 = ((param_1 & 7) != 0) + 1 + ((uint)(param_1 >> 3) & 0x1fffffff);
    if (uVar1 < 0x80) {
      *param_2 = uVar1 + 2;
      return 0;
    }
    if (uVar1 < 0x100) {
      *param_2 = uVar1 + 3;
      return 0;
    }
    if (uVar1 < 0x10000) {
      *param_2 = uVar1 + 4;
      return 0;
    }
  }
  return 0x10;
}



undefined8 FUN_1401d7550(byte *param_1,uint param_2,longlong param_3,uint *param_4)

{
  byte bVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  byte *pbVar5;
  uint uVar6;
  
  if ((((param_1 == (byte *)0x0) || (param_3 == 0)) || (param_4 == (uint *)0x0)) || (param_2 < 4)) {
    return 0x10;
  }
  if ((*param_1 & 0x1f) == 3) {
    bVar1 = param_1[1];
    uVar4 = 0;
    if ((char)bVar1 < '\0') {
      uVar2 = bVar1 & 0x7f;
      if ((bVar1 & 0x7f) == 0) {
        return 7;
      }
      if (2 < uVar2) {
        return 7;
      }
      uVar3 = 0;
      pbVar5 = param_1 + 2;
      uVar6 = uVar2 + 2;
      do {
        bVar1 = *pbVar5;
        pbVar5 = pbVar5 + 1;
        uVar3 = uVar3 << 8 | (uint)bVar1;
        uVar2 = uVar2 - 1;
      } while (uVar2 != 0);
    }
    else {
      uVar6 = 2;
      uVar3 = bVar1 & 0x7f;
    }
    if ((uVar3 != 0) && (uVar3 + uVar6 <= param_2)) {
      uVar3 = (uVar3 * 8 + -8) - (param_1[uVar6] & 7);
      if (*param_4 < uVar3) {
        *param_4 = uVar3;
        return 6;
      }
      if (uVar3 != 0) {
        param_1 = param_1 + (int)(uVar6 + 1);
        do {
          *(bool *)param_3 = (*param_1 & (byte)(1 << (7U - (char)(uVar4 & 7) & 0x1f))) != 0;
          if ((uVar4 & 7) == 7) {
            param_1 = param_1 + 1;
          }
          uVar4 = uVar4 + 1;
          param_3 = param_3 + 1;
        } while (uVar4 < uVar3);
      }
      *param_4 = uVar3;
      return 0;
    }
  }
  return 7;
}



undefined4 FUN_1401d76b0(uint param_1,int *param_2)

{
  ulonglong uVar1;
  ulonglong uVar2;
  int iVar3;
  
  if (param_2 == (int *)0x0) {
    return 0x10;
  }
  iVar3 = 0;
  uVar2 = (ulonglong)param_1;
  if (param_1 != 0) {
    do {
      iVar3 = iVar3 + 1;
      uVar1 = uVar2 >> 8;
      uVar2 = uVar2 >> 8;
    } while ((int)uVar1 != 0);
    if (iVar3 != 0) goto LAB_1401d76e2;
  }
  iVar3 = 1;
LAB_1401d76e2:
  *param_2 = ((param_1 >> (iVar3 * 8 - 1U & 0x1f) & 1) != 0) + 2 + iVar3;
  return 0;
}



undefined8 FUN_1401d7700(byte *param_1,uint param_2,uint *param_3)

{
  byte bVar1;
  uint uVar2;
  uint uVar3;
  
  if ((param_3 != (uint *)0x0) && (param_1 != (byte *)0x0)) {
    if ((1 < param_2) && ((*param_1 & 0x1f) == 2)) {
      bVar1 = param_1[1];
      uVar3 = (uint)bVar1;
      if (bVar1 + 2 <= param_2) {
        uVar2 = 0;
        if (bVar1 != 0) {
          param_1 = param_1 + 2;
          do {
            bVar1 = *param_1;
            param_1 = param_1 + 1;
            uVar2 = uVar2 << 8 | (uint)bVar1;
            uVar3 = uVar3 - 1;
          } while (uVar3 != 0);
        }
        *param_3 = uVar2;
        return 0;
      }
    }
    return 7;
  }
  return 0x10;
}



undefined8 FUN_1401d7760(longlong param_1,int *param_2)

{
  int iVar1;
  uint uVar2;
  int iVar3;
  ulonglong uVar4;
  
  if ((param_1 != 0) && (param_2 != (int *)0x0)) {
    iVar1 = (*DAT_1403210e0)(param_1,0);
    if (iVar1 == -1) {
      uVar2 = (*DAT_1403210e8)(param_1);
      uVar2 = (8 - (uVar2 & 7)) + uVar2;
      iVar1 = (*DAT_1403210f0)(param_1);
      iVar3 = (*DAT_1403210e8)(param_1);
      if ((iVar1 + 1 == iVar3) && (uVar4 = (*DAT_1403210e8)(param_1), (uVar4 & 7) == 0)) {
        uVar2 = uVar2 - 1;
      }
      uVar2 = uVar2 >> 3;
    }
    else {
      uVar4 = (*DAT_1403210e8)();
      if (((uVar4 & 7) == 0) || (iVar1 = (*DAT_1403210e0)(param_1,0), iVar1 == 0)) {
        iVar1 = (*DAT_140321110)(param_1);
        uVar2 = iVar1 + 1;
      }
      else {
        uVar2 = (*DAT_140321110)(param_1);
      }
    }
    iVar1 = uVar2 + 1;
    if (0x7f < uVar2) {
      for (; uVar2 != 0; uVar2 = uVar2 >> 8) {
        iVar1 = iVar1 + 1;
      }
    }
    *param_2 = iVar1 + 1;
    return 0;
  }
  return 0x10;
}



undefined8 FUN_1401d7860(byte *param_1,uint param_2,longlong param_3)

{
  uint uVar1;
  byte bVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  uint uVar6;
  ulonglong uVar7;
  uint uVar8;
  byte *pbVar9;
  undefined8 local_res18 [2];
  
  if ((param_3 == 0) || (param_1 == (byte *)0x0)) {
    return 0x10;
  }
  if ((param_2 < 3) || ((*param_1 & 0x1f) != 2)) {
    return 7;
  }
  bVar2 = param_1[1];
  uVar7 = 2;
  if ((char)bVar2 < '\0') {
    uVar6 = bVar2 & 0x7f;
    if (((uVar6 + 2 <= param_2) && (uVar6 < 5)) && ((bVar2 & 0x7f) != 0)) {
      uVar8 = 0;
      pbVar9 = param_1 + 2;
      uVar1 = uVar6 + 2;
      uVar7 = (ulonglong)uVar1;
      do {
        bVar2 = *pbVar9;
        pbVar9 = pbVar9 + 1;
        uVar8 = uVar8 << 8 | (uint)bVar2;
        uVar6 = uVar6 - 1;
      } while (uVar6 != 0);
      if (uVar8 + uVar1 <= param_2) {
        uVar5 = (*DAT_140321120)(param_3,param_1 + uVar7);
        if ((int)uVar5 != 0) {
          return uVar5;
        }
        goto LAB_1401d7954;
      }
    }
  }
  else if (bVar2 + 2 <= param_2) {
    uVar5 = (*DAT_140321120)(param_3,param_1 + 2,(uint)bVar2);
    if ((int)uVar5 != 0) {
      return uVar5;
    }
LAB_1401d7954:
    if ((param_1[uVar7] & 0x80) == 0) {
      return 0;
    }
    iVar3 = (*DAT_140321090)(local_res18);
    if (iVar3 == 0) {
      uVar4 = (*DAT_1403210e8)(param_3);
      iVar3 = (*DAT_1403210f8)(local_res18[0],uVar4);
      if ((iVar3 == 0) && (iVar3 = (*DAT_140321138)(param_3,local_res18[0],param_3), iVar3 == 0)) {
        (*DAT_1403210a0)(local_res18[0]);
        return 0;
      }
      (*DAT_1403210a0)(local_res18[0]);
    }
    return 0xd;
  }
  return 7;
}



undefined8 FUN_1401d79f0(undefined4 *param_1)

{
  if (param_1 == (undefined4 *)0x0) {
    return 0x10;
  }
  *param_1 = 3;
  return 0;
}



undefined8 FUN_1401d7a10(char *param_1,int param_2,uint *param_3)

{
  char cVar1;
  
  if ((((param_1 != (char *)0x0) && (param_3 != (uint *)0x0)) && (param_2 == 3)) &&
     (((*param_1 == '\x01' && (param_1[1] == '\x01')) &&
      ((cVar1 = param_1[2], cVar1 == '\0' || (cVar1 == -1)))))) {
    *param_3 = (uint)(cVar1 == -1);
    return 0;
  }
  return 0x10;
}



undefined8 FUN_1401d7a50(longlong param_1,uint param_2,char *param_3,uint *param_4,int param_5)

{
  undefined4 uVar1;
  int iVar2;
  undefined4 *puVar3;
  undefined8 uVar4;
  ulonglong uVar5;
  uint uVar6;
  uint uVar7;
  undefined8 *puVar8;
  uint local_28;
  uint local_24;
  uint local_20;
  
  if (((param_1 == 0) || (param_3 == (char *)0x0)) || (param_4 == (uint *)0x0)) {
    return 0x10;
  }
  uVar6 = 0;
  local_20 = 0;
  if (param_2 != 0) {
    puVar8 = (undefined8 *)(param_1 + 8);
    do {
      uVar1 = *(undefined4 *)(puVar8 + 1);
      puVar3 = (undefined4 *)*puVar8;
      if (*(int *)(puVar8 + -1) == 0) break;
      switch(*(int *)(puVar8 + -1)) {
      case 1:
        uVar4 = FUN_1401d79f0(&local_28);
        break;
      case 2:
        uVar4 = FUN_1401d7760(puVar3,&local_28);
        break;
      case 3:
        uVar4 = FUN_1401d76b0(*puVar3,&local_28);
        break;
      case 4:
        uVar4 = FUN_1401d7500(uVar1,&local_28);
        break;
      case 5:
        uVar4 = FUN_1401d73b0(uVar1,&local_28);
        break;
      case 6:
        uVar6 = uVar6 + 2;
        goto LAB_1401d7b9f;
      case 7:
        uVar4 = FUN_1401d7100(puVar3,uVar1,&local_28);
        break;
      case 8:
        uVar4 = FUN_1401d6f20(puVar3,uVar1,&local_28);
        break;
      case 9:
        uVar4 = FUN_1401d6ce0(puVar3,uVar1,&local_28);
        break;
      case 10:
        uVar4 = FUN_1401d69d0(puVar3,uVar1,&local_28);
        break;
      case 0xb:
        uVar4 = FUN_1401d89d0(puVar3,&local_28);
        break;
      default:
        goto LAB_1401d7ec7;
      case 0xd:
      case 0xe:
      case 0xf:
        uVar4 = FUN_1401d6450(puVar3,uVar1,&local_28);
      }
      if ((int)uVar4 != 0) {
        return uVar4;
      }
      uVar6 = uVar6 + local_28;
LAB_1401d7b9f:
      puVar8 = puVar8 + 7;
      local_20 = local_20 + 1;
    } while (local_20 < param_2);
  }
  if (uVar6 < 0x80) {
    uVar7 = uVar6 + 2;
  }
  else if (uVar6 < 0x100) {
    uVar7 = uVar6 + 3;
  }
  else if (uVar6 < 0x10000) {
    uVar7 = uVar6 + 4;
  }
  else {
    if (0xffffff < uVar6) {
LAB_1401d7ec7:
      return 0x10;
    }
    uVar7 = uVar6 + 5;
  }
  if (*param_4 < uVar7) {
    *param_4 = uVar7;
    return 6;
  }
  *param_3 = (param_5 != 0xd) + '0';
  uVar7 = 1;
  uVar5 = 1;
  local_28 = 1;
  if (uVar6 < 0x80) {
    param_3[1] = (char)uVar6;
    local_28 = uVar7;
  }
  else {
    if (uVar6 < 0x100) {
      param_3[1] = -0x7f;
      local_28 = uVar7;
    }
    else {
      if (uVar6 < 0x10000) {
        param_3[1] = -0x7e;
        local_28 = uVar7;
      }
      else {
        if (0xffffff < uVar6) goto LAB_1401d7ca4;
        param_3[1] = -0x7d;
        local_28 = 2;
        param_3[2] = (char)(uVar6 >> 0x10);
      }
      local_28 = local_28 + 1;
      param_3[local_28] = (char)(uVar6 >> 8);
    }
    local_28 = local_28 + 1;
    param_3[local_28] = (char)uVar6;
  }
  local_28 = local_28 + 1;
  uVar5 = (ulonglong)local_28;
LAB_1401d7ca4:
  *param_4 = *param_4 - (int)uVar5;
  uVar6 = 0;
  if (param_2 != 0) {
    puVar8 = (undefined8 *)(param_1 + 8);
    do {
      iVar2 = *(int *)(puVar8 + -1);
      uVar1 = *(undefined4 *)(puVar8 + 1);
      puVar3 = (undefined4 *)*puVar8;
      if (iVar2 == 0) break;
      switch(iVar2) {
      case 1:
        local_24 = *param_4;
        uVar4 = FUN_1401d9f30(*puVar3,param_3 + uVar5,&local_24);
        break;
      case 2:
        local_24 = *param_4;
        uVar4 = FUN_1401d9c90(puVar3,param_3 + uVar5,&local_24);
        break;
      case 3:
        local_24 = *param_4;
        uVar4 = FUN_1401d9b70(*puVar3,param_3 + uVar5,&local_24);
        break;
      case 4:
        local_24 = *param_4;
        uVar4 = FUN_1401d9a00(puVar3,uVar1,param_3 + uVar5,&local_24);
        break;
      case 5:
        local_24 = *param_4;
        uVar4 = FUN_1401d98d0(puVar3,uVar1,param_3 + uVar5,&local_24);
        break;
      case 6:
        param_3[uVar5] = '\x05';
        param_3[local_28 + 1] = '\0';
        local_28 = local_28 + 2;
        *param_4 = *param_4 - 2;
        goto LAB_1401d7e99;
      case 7:
        local_24 = *param_4;
        uVar4 = FUN_1401d9670(puVar3,uVar1,param_3 + uVar5,&local_24);
        break;
      case 8:
        local_24 = *param_4;
        uVar4 = FUN_1401d9540(puVar3,uVar1,param_3 + uVar5,&local_24);
        break;
      case 9:
        local_24 = *param_4;
        uVar4 = FUN_1401d9410(puVar3,uVar1,param_3 + uVar5,&local_24);
        break;
      case 10:
        local_24 = *param_4;
        uVar4 = FUN_1401d9210(puVar3,uVar1,param_3 + uVar5,&local_24);
        break;
      case 0xb:
        local_24 = *param_4;
        uVar4 = FUN_1401d8e80(puVar3,param_3 + uVar5,&local_24);
        break;
      default:
        goto LAB_1401d7ec7;
      case 0xd:
        local_24 = *param_4;
        uVar4 = FUN_1401d7a50(puVar3,uVar1,param_3 + uVar5,&local_24,iVar2);
        break;
      case 0xe:
        local_24 = *param_4;
        uVar4 = FUN_1401d8d80(puVar3,uVar1,param_3 + uVar5,&local_24);
        break;
      case 0xf:
        local_24 = *param_4;
        uVar4 = FUN_1401d8a90(puVar3,uVar1,param_3 + uVar5,&local_24);
      }
      if ((int)uVar4 != 0) {
        return uVar4;
      }
      local_28 = local_28 + local_24;
      *param_4 = *param_4 - local_24;
LAB_1401d7e99:
      uVar5 = (ulonglong)local_28;
      puVar8 = puVar8 + 7;
      uVar6 = uVar6 + 1;
    } while (uVar6 < param_2);
  }
  *param_4 = (uint)uVar5;
  return 0;
}



ulonglong FUN_1401d7f50(int param_1,longlong param_2,undefined4 param_3,undefined1 *param_4,
                       int param_5)

{
  uint uVar1;
  int iVar2;
  uint uVar3;
  ulonglong uVar4;
  undefined1 *_Memory;
  undefined1 *_Memory_00;
  longlong lVar5;
  undefined1 *puVar6;
  longlong lVar7;
  int iVar8;
  
  if ((param_2 == 0) || (param_4 == (undefined1 *)0x0)) {
    return 0x10;
  }
  uVar4 = FUN_1401d1e80(param_1);
  if ((int)uVar4 != 0) {
    return uVar4;
  }
  lVar7 = (longlong)param_1 * 0x80;
  uVar1 = *(uint *)(&DAT_14031ad3c + lVar7);
  _Memory = malloc(0x70);
  _Memory_00 = malloc((ulonglong)uVar1);
  if (_Memory == (undefined1 *)0x0) {
    _Memory = _Memory_00;
    if (_Memory_00 == (undefined1 *)0x0) {
      return 0xd;
    }
  }
  else if (_Memory_00 != (undefined1 *)0x0) {
    iVar2 = 0;
    while (param_5 != 0) {
      _Memory_00[3] = (char)iVar2;
      *_Memory_00 = (char)((uint)iVar2 >> 0x18);
      _Memory_00[1] = (char)((uint)iVar2 >> 0x10);
      iVar8 = iVar2 + 1;
      _Memory_00[2] = (char)((uint)iVar2 >> 8);
      uVar3 = (**(code **)(lVar7 + 0x14031ad88))(_Memory);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1401d80bc;
      uVar3 = (**(code **)(lVar7 + 0x14031ad90))(_Memory,param_2,param_3);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1401d80bc;
      uVar3 = (**(code **)(lVar7 + 0x14031ad90))(_Memory,_Memory_00,4);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1401d80bc;
      uVar3 = (**(code **)(lVar7 + 0x14031ad98))(_Memory,_Memory_00);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1401d80bc;
      uVar3 = 0;
      iVar2 = iVar8;
      if (uVar1 != 0) {
        lVar5 = (longlong)_Memory_00 - (longlong)param_4;
        puVar6 = param_4;
        do {
          if (param_5 == 0) goto LAB_1401d80ba;
          uVar3 = uVar3 + 1;
          param_4 = puVar6 + 1;
          *puVar6 = puVar6[lVar5];
          param_5 = param_5 + -1;
          puVar6 = param_4;
        } while (uVar3 < uVar1);
      }
    }
LAB_1401d80ba:
    uVar4 = 0;
LAB_1401d80bc:
    free(_Memory_00);
    free(_Memory);
    return uVar4;
  }
  free(_Memory);
  return 0xd;
}



ulonglong FUN_1401d8110(int param_1,longlong param_2,undefined4 param_3,longlong param_4,
                       uint *param_5)

{
  uint uVar1;
  ulonglong uVar2;
  void *_Memory;
  longlong lVar3;
  
  if ((param_2 != 0) && (param_4 != 0)) {
    if (param_5 != (uint *)0x0) {
      uVar2 = FUN_1401d1e80(param_1);
      if ((int)uVar2 == 0) {
        lVar3 = (longlong)param_1 * 0x80;
        if (*param_5 < *(uint *)(&DAT_14031ad3c + lVar3)) {
          *param_5 = *(uint *)(&DAT_14031ad3c + lVar3);
          uVar2 = 6;
        }
        else {
          _Memory = malloc(0x70);
          if (_Memory == (void *)0x0) {
            uVar2 = 0xd;
          }
          else {
            uVar1 = (**(code **)(lVar3 + 0x14031ad88))(_Memory);
            uVar2 = (ulonglong)uVar1;
            if (uVar1 == 0) {
              uVar1 = (**(code **)(lVar3 + 0x14031ad90))(_Memory,param_2,param_3);
              uVar2 = (ulonglong)uVar1;
              if (uVar1 == 0) {
                uVar1 = (**(code **)(lVar3 + 0x14031ad98))(_Memory,param_4);
                uVar2 = (ulonglong)uVar1;
                *param_5 = *(uint *)(&DAT_14031ad3c + lVar3);
              }
            }
            free(_Memory);
          }
        }
      }
      return uVar2;
    }
    return 0x10;
  }
  return 0x10;
}



undefined8 FUN_1401d8220(int *param_1,longlong param_2,undefined4 *param_3)

{
  undefined8 uVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  longlong lVar5;
  int local_28 [2];
  int local_20;
  longlong local_18;
  
  uVar1 = FUN_1401d45b0(local_28,*param_1);
  if ((int)uVar1 == 0) {
    local_28[0] = *param_1;
    local_20 = param_1[2];
    uVar2 = 0;
    lVar5 = (longlong)(local_28[0] + -1);
    if (-1 < local_28[0] + -1) {
      do {
        uVar2 = (ulonglong)*(uint *)(*(longlong *)(param_1 + 4) + lVar5 * 4) | uVar2 << 0x1c;
        if (uVar2 < 3) {
          uVar3 = 0;
        }
        else {
          uVar3 = uVar2 * 0x5555555 >> 0x1c;
          uVar2 = uVar2 + uVar3 * -3;
          if (2 < uVar2) {
            uVar4 = uVar2 / 3;
            uVar2 = uVar2 % 3;
            uVar3 = uVar3 + uVar4;
          }
        }
        lVar5 = lVar5 + -1;
        *(int *)(local_18 + 4 + lVar5 * 4) = (int)uVar3;
      } while (-1 < lVar5);
    }
    if (param_3 != (undefined4 *)0x0) {
      *param_3 = (int)uVar2;
    }
    if (param_2 != 0) {
      FUN_1401d2430(local_28);
      FUN_1401d4470(local_28,param_2);
    }
    FUN_1401cc300(local_28);
    uVar1 = 0;
  }
  return uVar1;
}



undefined8 FUN_1401d8310(int *param_1,uint param_2,int *param_3)

{
  uint *puVar1;
  int iVar2;
  undefined8 uVar3;
  int iVar4;
  longlong lVar5;
  
  if ((int)param_2 < 1) {
    FUN_1401d2570(param_3);
    return 0;
  }
  if (*param_1 * 0x1c <= (int)param_2) {
    uVar3 = FUN_1401cc3a0(param_1,param_3);
    return uVar3;
  }
  uVar3 = FUN_1401cc3a0(param_1,param_3);
  if ((int)uVar3 == 0) {
    iVar2 = (int)param_2 / 0x1c;
    iVar4 = (uint)(param_2 != iVar2 * 0x1c) + iVar2;
    if (iVar4 < *param_3) {
      lVar5 = (longlong)iVar4 << 2;
      do {
        iVar4 = iVar4 + 1;
        *(undefined4 *)(lVar5 + *(longlong *)(param_3 + 4)) = 0;
        lVar5 = lVar5 + 4;
      } while (iVar4 < *param_3);
    }
    puVar1 = (uint *)(*(longlong *)(param_3 + 4) + (longlong)iVar2 * 4);
    *puVar1 = *puVar1 & (1 << ((char)param_2 + (char)(param_2 / 0x1c) * -0x1c & 0x1fU)) - 1U;
    FUN_1401d2430(param_3);
    uVar3 = 0;
  }
  return uVar3;
}



ulonglong FUN_1401d8400(undefined8 param_1,undefined8 param_2,int param_3)

{
  undefined4 uVar1;
  uint uVar2;
  int iVar3;
  ulonglong uVar4;
  undefined1 local_28 [32];
  
  uVar4 = FUN_1401cc2a0(local_28);
  if ((int)uVar4 == 0) {
    uVar1 = FUN_1401cc550(param_2);
    uVar2 = FUN_1401d2800(param_1,uVar1,local_28,param_1);
    while (uVar4 = (ulonglong)uVar2, uVar2 == 0) {
      if (param_3 != 1) {
        uVar2 = FUN_1401cce10(local_28,param_3,local_28);
        uVar4 = (ulonglong)uVar2;
        if (uVar2 != 0) break;
      }
      uVar2 = FUN_1401d2a80(param_1,local_28,param_1);
      uVar4 = (ulonglong)uVar2;
      if ((uVar2 != 0) || (iVar3 = FUN_1401d25a0(param_1,param_2), iVar3 == -1)) break;
      FUN_1401d2980(param_1,param_2,param_1);
      uVar2 = FUN_1401d2800(param_1,uVar1,local_28,param_1);
    }
    FUN_1401cc300(local_28);
  }
  return uVar4;
}



ulonglong FUN_1401d84f0(undefined8 param_1,undefined4 *param_2)

{
  undefined4 uVar1;
  uint uVar2;
  ulonglong uVar3;
  undefined1 local_28 [16];
  undefined4 *local_18;
  
  uVar3 = FUN_1401cc2a0(local_28);
  if ((int)uVar3 == 0) {
    uVar1 = FUN_1401cc550(param_1);
    uVar2 = FUN_1401cc5f0(local_28,uVar1);
    if ((uVar2 != 0) || (uVar2 = FUN_1401d2980(local_28,param_1,local_28), uVar2 != 0)) {
      FUN_1401cc300(local_28);
      return (ulonglong)uVar2;
    }
    *param_2 = *local_18;
    FUN_1401cc300(local_28);
    uVar3 = 0;
  }
  return uVar3;
}



undefined8 FUN_1401d8590(int *param_1,uint *param_2,ulonglong param_3)

{
  uint uVar1;
  int iVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  uint *puVar5;
  uint *puVar6;
  uint uVar7;
  uint *puVar9;
  ulonglong uVar10;
  ulonglong uVar8;
  
  uVar1 = *param_2;
  if (((int)(uVar1 * 2) <= param_1[1]) || (uVar3 = FUN_1401d2390(), (int)uVar3 == 0)) {
    while( true ) {
      puVar6 = *(uint **)(param_1 + 4);
      puVar9 = puVar6 + (int)uVar1;
      puVar5 = puVar6;
      uVar8 = 0;
      uVar10 = (ulonglong)uVar1;
      uVar7 = 0;
      if (0 < (int)uVar1) {
        do {
          uVar7 = *puVar9;
          puVar6 = puVar5 + 1;
          puVar9 = puVar9 + 1;
          uVar4 = (ulonglong)uVar7 * (param_3 & 0xffffffff) + (ulonglong)*puVar5 +
                  (uVar8 & 0xffffffff);
          uVar8 = uVar4 >> 0x1c;
          uVar7 = (uint)uVar8;
          uVar10 = uVar10 - 1;
          *puVar5 = (uint)uVar4 & 0xfffffff;
          puVar5 = puVar6;
        } while (uVar10 != 0);
      }
      *puVar6 = uVar7;
      iVar2 = uVar1 + 1;
      if ((int)(uVar1 + 1) < *param_1) {
        do {
          puVar6 = puVar6 + 1;
          *puVar6 = 0;
          iVar2 = iVar2 + 1;
        } while (iVar2 < *param_1);
      }
      FUN_1401d2430(param_1);
      iVar2 = FUN_1401d25a0(param_1,param_2);
      if (iVar2 == -1) break;
      FUN_1401d2980(param_1,param_2,param_1);
    }
    uVar3 = 0;
  }
  return uVar3;
}



void FUN_1401d86a0(longlong param_1,int *param_2)

{
  *param_2 = 0x10000000 - **(int **)(param_1 + 0x10);
  return;
}



ulonglong FUN_1401d86b0(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  undefined4 uVar1;
  uint uVar2;
  int iVar3;
  ulonglong uVar4;
  undefined1 local_28 [32];
  
  uVar4 = FUN_1401cc2a0(local_28);
  if ((int)uVar4 == 0) {
    uVar1 = FUN_1401cc550(param_2);
    uVar2 = FUN_1401d2800(param_1,uVar1,local_28,param_1);
    uVar4 = (ulonglong)uVar2;
    if (uVar2 == 0) {
      while( true ) {
        uVar2 = FUN_1401ccd60(local_28,param_3,local_28);
        uVar4 = (ulonglong)uVar2;
        if (uVar2 != 0) break;
        uVar2 = FUN_1401d2a80(param_1,local_28,param_1);
        uVar4 = (ulonglong)uVar2;
        if ((uVar2 != 0) || (iVar3 = FUN_1401d25a0(param_1,param_2), iVar3 == -1)) break;
        FUN_1401d2980(param_1,param_2,param_1);
        uVar2 = FUN_1401d2800(param_1,uVar1,local_28,param_1);
        uVar4 = (ulonglong)uVar2;
        if (uVar2 != 0) break;
      }
    }
    FUN_1401cc300(local_28);
  }
  return uVar4;
}



ulonglong FUN_1401d87a0(undefined8 param_1,undefined8 param_2)

{
  undefined4 uVar1;
  uint uVar2;
  ulonglong uVar3;
  undefined1 local_28 [32];
  
  uVar3 = FUN_1401cc2a0(local_28);
  if ((int)uVar3 == 0) {
    uVar1 = FUN_1401cc550(param_1);
    uVar2 = FUN_1401cc5f0(local_28,uVar1);
    if (uVar2 == 0) {
      uVar2 = FUN_1401d2980(local_28,param_1,param_2);
    }
    uVar3 = (ulonglong)uVar2;
    FUN_1401cc300(local_28);
  }
  return uVar3;
}



ulonglong FUN_1401d8810(undefined8 param_1,uint *param_2,undefined8 param_3)

{
  uint uVar1;
  int iVar2;
  uint uVar3;
  ulonglong uVar4;
  undefined1 local_28 [32];
  
  uVar3 = *param_2;
  uVar4 = FUN_1401d27d0(local_28,param_1);
  if ((int)uVar4 != 0) {
    return uVar4;
  }
  FUN_1401d44a0(local_28,uVar3 - 1);
  if (uVar3 < 0x8000001) {
    uVar1 = FUN_1401d9f70(local_28,param_3,local_28,uVar3);
  }
  else {
    uVar1 = FUN_1401ccd60();
  }
  uVar4 = (ulonglong)uVar1;
  if (uVar1 == 0) {
    FUN_1401d44a0(local_28,uVar3 + 1);
    uVar1 = FUN_1401d8310(param_1,(uVar3 + 1) * 0x1c,param_1);
    uVar4 = (ulonglong)uVar1;
    if (uVar1 == 0) {
      uVar1 = FUN_1401d2bb0(local_28,param_2,local_28,uVar3 + 1);
      uVar4 = (ulonglong)uVar1;
      if (uVar1 == 0) {
        uVar1 = FUN_1401ccba0(param_1,local_28,param_1);
        uVar4 = (ulonglong)uVar1;
        if (uVar1 == 0) {
          iVar2 = FUN_1401cc520(param_1,0);
          if (iVar2 == -1) {
            FUN_1401d4fd0(local_28,1);
            uVar3 = FUN_1401d4520(local_28,uVar3 + 1);
            uVar4 = (ulonglong)uVar3;
            if (uVar3 != 0) goto LAB_1401d8969;
            uVar3 = FUN_1401cc9e0(param_1,local_28,param_1);
            uVar4 = (ulonglong)uVar3;
            if (uVar3 != 0) goto LAB_1401d8969;
          }
          iVar2 = FUN_1401cc4f0(param_1,param_2);
          while (iVar2 != -1) {
            uVar3 = FUN_1401d2980(param_1,param_2,param_1);
            uVar4 = (ulonglong)uVar3;
            if (uVar3 != 0) break;
            iVar2 = FUN_1401cc4f0(param_1,param_2);
          }
        }
      }
    }
  }
LAB_1401d8969:
  FUN_1401cc300(local_28);
  return uVar4;
}



void FUN_1401d8990(undefined8 param_1,int *param_2)

{
  int iVar1;
  
  iVar1 = FUN_1401cc5f0(param_1,*param_2 * 0x38);
  if (iVar1 == 0) {
    FUN_1401ccf50(param_1,param_2,param_1,0);
  }
  return;
}



undefined8 FUN_1401d89d0(longlong param_1,undefined4 *param_2)

{
  if ((param_2 == (undefined4 *)0x0) || (param_1 == 0)) {
    return 0x10;
  }
  if ((*(int *)(param_1 + 0x1c) == 0) && (*(int *)(param_1 + 0x20) == 0)) {
    *param_2 = 0xf;
    return 0;
  }
  *param_2 = 0x13;
  return 0;
}



int FUN_1401d8a00(undefined8 *param_1,undefined8 *param_2)

{
  void *_Buf2;
  void *_Buf1;
  uint uVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  
  uVar3 = *(uint *)(param_1 + 1);
  uVar4 = *(uint *)(param_2 + 1);
  _Buf2 = (void *)*param_2;
  _Buf1 = (void *)*param_1;
  uVar1 = uVar4;
  if (uVar3 < uVar4) {
    uVar1 = uVar3;
  }
  iVar2 = memcmp(_Buf1,_Buf2,(ulonglong)uVar1);
  if ((iVar2 == 0) && (uVar3 != uVar4)) {
    if (uVar4 < uVar3) {
      for (; uVar4 < uVar3; uVar4 = uVar4 + 1) {
        if (*(char *)((ulonglong)uVar4 + (longlong)_Buf1) != '\0') {
          return 1;
        }
      }
    }
    else {
      for (; uVar3 < uVar4; uVar3 = uVar3 + 1) {
        if (*(char *)((ulonglong)uVar3 + (longlong)_Buf2) != '\0') {
          return -1;
        }
      }
    }
  }
  return iVar2;
}



int FUN_1401d8a90(int *param_1,uint param_2,void *param_3,uint *param_4)

{
  byte bVar1;
  int *piVar2;
  int iVar3;
  void *_Src;
  void *_Base;
  uint uVar4;
  uint *puVar5;
  ulonglong _Count;
  ulonglong uVar6;
  uint uVar7;
  byte *pbVar8;
  uint uVar9;
  
  uVar9 = 1;
  _Count = (ulonglong)param_2;
  piVar2 = param_1;
  if (1 < param_2) {
    do {
      if (piVar2[0xe] != *piVar2) {
        return 0x10;
      }
      uVar9 = uVar9 + 1;
      piVar2 = piVar2 + 0xe;
    } while (uVar9 < param_2);
  }
  _Src = calloc(1,(ulonglong)*param_4);
  if (_Src != (void *)0x0) {
    iVar3 = FUN_1401d7a50(param_1,_Count,_Src,param_4,0xf);
    if (iVar3 == 0) {
      _Base = calloc(_Count,0x10);
      if (_Base == (void *)0x0) {
        free(_Src);
        iVar3 = 0xd;
      }
      else {
        uVar6 = (longlong)_Src + 2;
        if (0x7f < *(byte *)((longlong)_Src + 1)) {
          uVar6 = uVar6 + (*(byte *)((longlong)_Src + 1) & 0x7f);
        }
        uVar9 = (int)uVar6 - (int)_Src;
        if (uVar6 < (ulonglong)*param_4 + (longlong)_Src) {
          puVar5 = (uint *)((longlong)_Base + 8);
          do {
            *(ulonglong *)(puVar5 + -2) = uVar6;
            bVar1 = *(byte *)(uVar6 + 1);
            iVar3 = 2;
            if (bVar1 < 0x80) {
              *puVar5 = (uint)bVar1;
            }
            else {
              uVar4 = bVar1 & 0x7f;
              *puVar5 = 0;
              if ((bVar1 & 0x7f) != 0) {
                uVar7 = 0;
                pbVar8 = (byte *)(uVar6 + 2);
                iVar3 = uVar4 + 2;
                do {
                  bVar1 = *pbVar8;
                  pbVar8 = pbVar8 + 1;
                  uVar7 = uVar7 << 8 | (uint)bVar1;
                  uVar4 = uVar4 - 1;
                  *puVar5 = uVar7;
                } while (uVar4 != 0);
              }
            }
            *puVar5 = *puVar5 + iVar3;
            uVar4 = *puVar5;
            puVar5 = puVar5 + 4;
            uVar6 = uVar6 + uVar4;
          } while (uVar6 < (ulonglong)*param_4 + (longlong)_Src);
        }
        qsort(_Base,_Count,0x10,FUN_1401d8a00);
        memcpy(param_3,_Src,(ulonglong)uVar9);
        if (param_2 != 0) {
          puVar5 = (uint *)((longlong)_Base + 8);
          do {
            memcpy((void *)((ulonglong)uVar9 + (longlong)param_3),*(void **)(puVar5 + -2),
                   (ulonglong)*puVar5);
            uVar9 = uVar9 + *puVar5;
            puVar5 = puVar5 + 4;
            _Count = _Count - 1;
          } while (_Count != 0);
        }
        free(_Base);
        free(_Src);
        iVar3 = 0;
      }
      return iVar3;
    }
    free(_Src);
    return iVar3;
  }
  return 0xd;
}



undefined8 FUN_1401d8c90(undefined4 param_1)

{
  switch(param_1) {
  case 1:
    return 1;
  case 2:
  case 3:
    return 2;
  case 4:
    return 3;
  case 5:
    return 4;
  case 6:
    return 5;
  case 7:
    return 6;
  case 8:
    return 0x16;
  case 9:
    return 0x13;
  case 10:
    return 0xc;
  case 0xb:
    return 0x17;
  default:
    return 0xffffffff;
  case 0xd:
    return 0x30;
  case 0xe:
  case 0xf:
    return 0x31;
  }
}



int FUN_1401d8d40(undefined4 *param_1,undefined4 *param_2)

{
  int iVar1;
  int iVar2;
  
  iVar1 = FUN_1401d8c90(*param_1);
  iVar2 = FUN_1401d8c90(*param_2);
  if (iVar1 - iVar2 == 0) {
    return param_1[5] - param_2[5];
  }
  return iVar1 - iVar2;
}



undefined4 FUN_1401d8d80(undefined8 *param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  void *_Base;
  undefined8 *puVar2;
  undefined8 *puVar3;
  uint uVar4;
  
  _Base = calloc((ulonglong)param_2,0x38);
  if (_Base == (void *)0x0) {
    uVar1 = 0xd;
  }
  else {
    uVar4 = 0;
    puVar2 = param_1;
    if (param_2 != 0) {
      do {
        puVar3 = puVar2 + 7;
        *(undefined8 *)((longlong)_Base + (-0x38 - (longlong)param_1) + (longlong)puVar3) = *puVar2;
        *(undefined8 *)((longlong)_Base + (-0x30 - (longlong)param_1) + (longlong)puVar3) =
             puVar2[1];
        *(undefined8 *)((longlong)_Base + (-0x28 - (longlong)param_1) + (longlong)puVar3) =
             puVar2[2];
        *(undefined8 *)((longlong)_Base + (-0x20 - (longlong)param_1) + (longlong)puVar3) =
             puVar2[3];
        *(undefined8 *)((longlong)_Base + (-0x18 - (longlong)param_1) + (longlong)puVar3) =
             puVar2[4];
        *(undefined8 *)((longlong)_Base + (-0x10 - (longlong)param_1) + (longlong)puVar3) =
             puVar2[5];
        *(undefined8 *)((longlong)_Base + (-8 - (longlong)param_1) + (longlong)puVar3) = puVar2[6];
        *(uint *)((longlong)_Base + (-0x24 - (longlong)param_1) + (longlong)puVar3) = uVar4;
        uVar4 = uVar4 + 1;
        puVar2 = puVar3;
      } while (uVar4 < param_2);
    }
    qsort(_Base,(ulonglong)param_2,0x38,FUN_1401d8d40);
    uVar1 = FUN_1401d7a50(_Base,param_2,param_3,param_4,0xe);
    free(_Base);
  }
  return uVar1;
}



undefined8 FUN_1401d8e80(uint *param_1,undefined1 *param_2,uint *param_3)

{
  undefined1 uVar1;
  undefined8 uVar2;
  uint uVar3;
  uint local_res8 [2];
  
  if (((param_1 != (uint *)0x0) && (param_2 != (undefined1 *)0x0)) && (param_3 != (uint *)0x0)) {
    uVar2 = FUN_1401d89d0(param_1,local_res8);
    if ((int)uVar2 == 0) {
      if (*param_3 < local_res8[0]) {
        *param_3 = local_res8[0];
        return 6;
      }
      *param_2 = 0x17;
      uVar1 = FUN_1401d6eb0((int)(char)PTR_s_0123456789_14030c908
                                       [(uint)((int)((ulonglong)*param_1 / 10) +
                                              (int)(((ulonglong)*param_1 / 10) / 10) * -10)]);
      param_2[2] = uVar1;
      uVar1 = FUN_1401d6eb0((int)(char)PTR_s_0123456789_14030c908[*param_1 % 10]);
      param_2[3] = uVar1;
      uVar1 = FUN_1401d6eb0((int)(char)PTR_s_0123456789_14030c908
                                       [(uint)((int)((ulonglong)param_1[1] / 10) +
                                              (int)(((ulonglong)param_1[1] / 10) / 10) * -10)]);
      param_2[4] = uVar1;
      uVar1 = FUN_1401d6eb0((int)(char)PTR_s_0123456789_14030c908[param_1[1] % 10]);
      param_2[5] = uVar1;
      uVar1 = FUN_1401d6eb0((int)(char)PTR_s_0123456789_14030c908
                                       [(uint)((int)((ulonglong)param_1[2] / 10) +
                                              (int)(((ulonglong)param_1[2] / 10) / 10) * -10)]);
      param_2[6] = uVar1;
      uVar1 = FUN_1401d6eb0((int)(char)PTR_s_0123456789_14030c908[param_1[2] % 10]);
      param_2[7] = uVar1;
      uVar1 = FUN_1401d6eb0((int)(char)PTR_s_0123456789_14030c908
                                       [(uint)((int)((ulonglong)param_1[3] / 10) +
                                              (int)(((ulonglong)param_1[3] / 10) / 10) * -10)]);
      param_2[8] = uVar1;
      uVar1 = FUN_1401d6eb0((int)(char)PTR_s_0123456789_14030c908[param_1[3] % 10]);
      param_2[9] = uVar1;
      uVar1 = FUN_1401d6eb0((int)(char)PTR_s_0123456789_14030c908
                                       [(uint)((int)((ulonglong)param_1[4] / 10) +
                                              (int)(((ulonglong)param_1[4] / 10) / 10) * -10)]);
      param_2[10] = uVar1;
      uVar1 = FUN_1401d6eb0((int)(char)PTR_s_0123456789_14030c908[param_1[4] % 10]);
      param_2[0xb] = uVar1;
      uVar1 = FUN_1401d6eb0((int)(char)PTR_s_0123456789_14030c908
                                       [(uint)((int)((ulonglong)param_1[5] / 10) +
                                              (int)(((ulonglong)param_1[5] / 10) / 10) * -10)]);
      param_2[0xc] = uVar1;
      uVar1 = FUN_1401d6eb0((int)(char)PTR_s_0123456789_14030c908[param_1[5] % 10]);
      param_2[0xd] = uVar1;
      if ((param_1[8] == 0) && (param_1[7] == 0)) {
        uVar1 = FUN_1401d6eb0(0x5a);
        uVar3 = 0xf;
        param_2[0xe] = uVar1;
      }
      else {
        uVar2 = 0x2b;
        if (param_1[6] != 0) {
          uVar2 = 0x2d;
        }
        uVar1 = FUN_1401d6eb0(uVar2);
        param_2[0xe] = uVar1;
        uVar1 = FUN_1401d6eb0((int)(char)PTR_s_0123456789_14030c908
                                         [(uint)((int)((ulonglong)param_1[7] / 10) +
                                                (int)(((ulonglong)param_1[7] / 10) / 10) * -10)]);
        param_2[0xf] = uVar1;
        uVar1 = FUN_1401d6eb0((int)(char)PTR_s_0123456789_14030c908[param_1[7] % 10]);
        param_2[0x10] = uVar1;
        uVar1 = FUN_1401d6eb0((int)(char)PTR_s_0123456789_14030c908[(param_1[8] / 10) % 10]);
        param_2[0x11] = uVar1;
        uVar1 = FUN_1401d6eb0((int)(char)PTR_s_0123456789_14030c908[param_1[8] % 10]);
        uVar3 = 0x13;
        param_2[0x12] = uVar1;
      }
      param_2[1] = (char)uVar3 + -2;
      *param_3 = uVar3;
      uVar2 = 0;
    }
    return uVar2;
  }
  return 0x10;
}



undefined8 FUN_1401d9210(ushort *param_1,uint param_2,undefined1 *param_3,uint *param_4)

{
  undefined1 uVar1;
  int iVar2;
  undefined8 uVar3;
  undefined1 uVar4;
  uint uVar5;
  byte *pbVar6;
  byte *pbVar7;
  ulonglong uVar8;
  ushort *puVar9;
  uint uVar10;
  
  uVar8 = (ulonglong)param_2;
  if (((param_1 == (ushort *)0x0) || (param_3 == (undefined1 *)0x0)) || (param_4 == (uint *)0x0)) {
    return 0x10;
  }
  uVar5 = 0;
  uVar10 = 0;
  puVar9 = param_1;
  if (param_2 == 0) {
LAB_1401d92c7:
    uVar10 = uVar5 + 2;
LAB_1401d92ca:
    if (*param_4 < uVar10) {
      *param_4 = uVar5;
      return 6;
    }
    *param_3 = 0xc;
    uVar4 = (undefined1)uVar5;
    if (uVar5 < 0x80) {
      param_3[1] = uVar4;
      uVar10 = 2;
    }
    else if (uVar5 < 0x100) {
      param_3[1] = 0x81;
      uVar10 = 3;
      param_3[2] = uVar4;
    }
    else {
      uVar1 = (undefined1)(uVar5 >> 8);
      if (uVar5 < 0x10000) {
        param_3[1] = 0x82;
        uVar10 = 4;
        param_3[2] = uVar1;
        param_3[3] = uVar4;
      }
      else {
        if (0xffffff < uVar5) goto LAB_1401d93de;
        param_3[1] = 0x83;
        uVar10 = 5;
        param_3[2] = (char)(uVar5 >> 0x10);
        param_3[3] = uVar1;
        param_3[4] = uVar4;
      }
    }
    if (param_2 != 0) {
      pbVar6 = param_3 + (int)uVar10;
      do {
        iVar2 = FUN_1401d69a0(*param_1);
        if (iVar2 == 1) {
          uVar10 = uVar10 + 1;
          pbVar7 = pbVar6 + 1;
          *pbVar6 = (byte)*param_1;
        }
        else if (iVar2 == 2) {
          uVar10 = uVar10 + 2;
          *pbVar6 = (byte)(*param_1 >> 6) & 0x1f | 0xc0;
          pbVar7 = pbVar6 + 2;
          pbVar6[1] = (byte)*param_1 & 0x3f | 0x80;
        }
        else {
          pbVar7 = pbVar6;
          if (iVar2 == 3) {
            uVar10 = uVar10 + 3;
            *pbVar6 = (byte)(*param_1 >> 0xc) | 0xe0;
            pbVar6[1] = (byte)(*param_1 >> 6) & 0x3f | 0x80;
            pbVar7 = pbVar6 + 3;
            pbVar6[2] = (byte)*param_1 & 0x3f | 0x80;
          }
        }
        param_1 = param_1 + 1;
        uVar8 = uVar8 - 1;
        pbVar6 = pbVar7;
      } while (uVar8 != 0);
    }
    *param_4 = uVar10;
    uVar3 = 0;
  }
  else {
    do {
      if (0x1ffff < *puVar9) goto LAB_1401d93de;
      iVar2 = FUN_1401d69a0(*puVar9);
      uVar10 = uVar10 + 1;
      uVar5 = uVar5 + iVar2;
      puVar9 = puVar9 + 1;
    } while (uVar10 < param_2);
    if (uVar5 < 0x80) goto LAB_1401d92c7;
    if (uVar5 < 0x100) {
      uVar10 = uVar5 + 3;
      goto LAB_1401d92ca;
    }
    if (uVar5 < 0x10000) {
      uVar10 = uVar5 + 4;
      goto LAB_1401d92ca;
    }
    if (uVar5 < 0x1000000) {
      uVar10 = uVar5 + 5;
      goto LAB_1401d92ca;
    }
LAB_1401d93de:
    uVar3 = 0x10;
  }
  return uVar3;
}



undefined8 FUN_1401d9410(undefined1 *param_1,uint param_2,undefined1 *param_3,uint *param_4)

{
  undefined1 uVar1;
  undefined1 uVar2;
  undefined8 uVar3;
  longlong lVar4;
  ulonglong uVar5;
  uint uVar6;
  undefined1 *puVar7;
  uint local_res8 [2];
  
  uVar5 = (ulonglong)param_2;
  if (((param_1 != (undefined1 *)0x0) && (param_3 != (undefined1 *)0x0)) && (param_4 != (uint *)0x0)
     ) {
    uVar3 = FUN_1401d6ce0(param_1,uVar5,local_res8);
    if ((int)uVar3 == 0) {
      if (*param_4 < local_res8[0]) {
        *param_4 = local_res8[0];
        return 6;
      }
      *param_3 = 0x13;
      uVar2 = (undefined1)param_2;
      if (param_2 < 0x80) {
        param_3[1] = uVar2;
        uVar6 = 2;
      }
      else if (param_2 < 0x100) {
        param_3[1] = 0x81;
        uVar6 = 3;
        param_3[2] = uVar2;
      }
      else {
        uVar1 = (undefined1)(param_2 >> 8);
        if (param_2 < 0x10000) {
          param_3[1] = 0x82;
          uVar6 = 4;
          param_3[2] = uVar1;
          param_3[3] = uVar2;
        }
        else {
          if (0xffffff < param_2) {
            return 0x10;
          }
          param_3[1] = 0x83;
          uVar6 = 5;
          param_3[2] = (char)(param_2 >> 0x10);
          param_3[3] = uVar1;
          param_3[4] = uVar2;
        }
      }
      lVar4 = (longlong)(int)uVar6;
      if (param_2 != 0) {
        uVar6 = uVar6 + param_2;
        puVar7 = param_3 + lVar4;
        do {
          uVar2 = FUN_1401d6c70(*param_1);
          param_1 = param_1 + 1;
          uVar5 = uVar5 - 1;
          *puVar7 = uVar2;
          puVar7 = puVar7 + 1;
        } while (uVar5 != 0);
      }
      *param_4 = uVar6;
      uVar3 = 0;
    }
    return uVar3;
  }
  return 0x10;
}



undefined8 FUN_1401d9540(undefined1 *param_1,uint param_2,undefined1 *param_3,uint *param_4)

{
  undefined1 uVar1;
  undefined1 uVar2;
  undefined8 uVar3;
  longlong lVar4;
  ulonglong uVar5;
  uint uVar6;
  undefined1 *puVar7;
  uint local_res8 [2];
  
  uVar5 = (ulonglong)param_2;
  if (((param_1 != (undefined1 *)0x0) && (param_3 != (undefined1 *)0x0)) && (param_4 != (uint *)0x0)
     ) {
    uVar3 = FUN_1401d6f20(param_1,uVar5,local_res8);
    if ((int)uVar3 == 0) {
      if (*param_4 < local_res8[0]) {
        *param_4 = local_res8[0];
        return 6;
      }
      *param_3 = 0x16;
      uVar2 = (undefined1)param_2;
      if (param_2 < 0x80) {
        param_3[1] = uVar2;
        uVar6 = 2;
      }
      else if (param_2 < 0x100) {
        param_3[1] = 0x81;
        uVar6 = 3;
        param_3[2] = uVar2;
      }
      else {
        uVar1 = (undefined1)(param_2 >> 8);
        if (param_2 < 0x10000) {
          param_3[1] = 0x82;
          uVar6 = 4;
          param_3[2] = uVar1;
          param_3[3] = uVar2;
        }
        else {
          if (0xffffff < param_2) {
            return 0x10;
          }
          param_3[1] = 0x83;
          uVar6 = 5;
          param_3[2] = (char)(param_2 >> 0x10);
          param_3[3] = uVar1;
          param_3[4] = uVar2;
        }
      }
      lVar4 = (longlong)(int)uVar6;
      if (param_2 != 0) {
        uVar6 = uVar6 + param_2;
        puVar7 = param_3 + lVar4;
        do {
          uVar2 = FUN_1401d6eb0(*param_1);
          param_1 = param_1 + 1;
          uVar5 = uVar5 - 1;
          *puVar7 = uVar2;
          puVar7 = puVar7 + 1;
        } while (uVar5 != 0);
      }
      *param_4 = uVar6;
      uVar3 = 0;
    }
    return uVar3;
  }
  return 0x10;
}



undefined8 FUN_1401d9670(int *param_1,undefined8 param_2,undefined1 *param_3,uint *param_4)

{
  undefined1 uVar1;
  uint uVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  byte bVar5;
  ulonglong uVar6;
  int *piVar7;
  uint uVar8;
  byte bVar9;
  undefined1 *puVar10;
  uint uVar11;
  ulonglong uVar12;
  uint uVar13;
  uint *puVar14;
  int iVar15;
  uint uVar16;
  uint local_res8 [2];
  
  if (((param_1 != (int *)0x0) && (param_3 != (undefined1 *)0x0)) && (param_4 != (uint *)0x0)) {
    uVar3 = FUN_1401d7100(param_1,param_2,local_res8);
    if ((int)uVar3 == 0) {
      if (*param_4 < local_res8[0]) {
        *param_4 = local_res8[0];
        return 6;
      }
      uVar13 = 0;
      iVar15 = param_1[1] + *param_1 * 0x28;
      uVar8 = 1;
      uVar16 = (uint)param_2;
      if (1 < uVar16) {
        piVar7 = param_1 + 2;
        do {
          uVar2 = FUN_1401d70f0(iVar15);
          uVar13 = uVar13 + (uint)(iVar15 == 0) + (uint)(uVar2 != (uVar2 / 7) * 7) + uVar2 / 7;
          if (uVar8 < uVar16 - 1) {
            iVar15 = *piVar7;
          }
          uVar8 = uVar8 + 1;
          piVar7 = piVar7 + 1;
        } while (uVar8 < uVar16);
      }
      uVar8 = 1;
      *param_3 = 6;
      local_res8[0] = 1;
      uVar4 = 1;
      if (0x7f < uVar13) {
        if (uVar13 < 0x100) {
          param_3[1] = 0x81;
        }
        else {
          if (0xffff < uVar13) {
            return 0x10;
          }
          param_3[1] = 0x82;
          local_res8[0] = 2;
          param_3[2] = (char)(uVar13 >> 8);
        }
        local_res8[0] = local_res8[0] + 1;
        uVar4 = (ulonglong)local_res8[0];
      }
      param_3[uVar4] = (char)uVar13;
      local_res8[0] = local_res8[0] + 1;
      uVar4 = (ulonglong)local_res8[0];
      uVar13 = param_1[1] + *param_1 * 0x28;
      if (1 < uVar16) {
        puVar14 = (uint *)(param_1 + 2);
        do {
          uVar6 = (ulonglong)uVar13;
          if (uVar13 == 0) {
            param_3[uVar4] = 0;
            uVar4 = (ulonglong)(local_res8[0] + 1);
            uVar2 = local_res8[0] + 1;
          }
          else {
            uVar11 = (uint)uVar4;
            uVar12 = (ulonglong)(int)uVar11;
            bVar9 = 0;
            uVar2 = local_res8[0];
            do {
              local_res8[0] = uVar2;
              bVar5 = (byte)uVar6;
              uVar6 = uVar6 >> 7;
              bVar5 = bVar5 & 0x7f | bVar9;
              bVar9 = 0x80;
              param_3[uVar4] = bVar5;
              uVar2 = local_res8[0] + 1;
              uVar4 = (ulonglong)uVar2;
            } while ((int)uVar6 != 0);
            if (uVar11 < local_res8[0]) {
              puVar10 = param_3 + uVar12;
              do {
                uVar1 = *puVar10;
                uVar11 = (int)uVar12 + 1;
                uVar12 = (ulonglong)uVar11;
                *puVar10 = param_3[local_res8[0]];
                param_3[local_res8[0]] = uVar1;
                local_res8[0] = local_res8[0] - 1;
                puVar10 = puVar10 + 1;
              } while (uVar11 < local_res8[0]);
            }
          }
          local_res8[0] = uVar2;
          if (uVar8 < uVar16 - 1) {
            uVar13 = *puVar14;
          }
          uVar8 = uVar8 + 1;
          puVar14 = puVar14 + 1;
        } while (uVar8 < uVar16);
      }
      *param_4 = (uint)uVar4;
      uVar3 = 0;
    }
    return uVar3;
  }
  return 0x10;
}



undefined8 FUN_1401d98d0(undefined1 *param_1,uint param_2,undefined1 *param_3,uint *param_4)

{
  undefined1 uVar1;
  undefined8 uVar2;
  longlong lVar3;
  undefined1 *puVar4;
  ulonglong uVar5;
  undefined1 uVar6;
  uint uVar7;
  uint local_res8 [2];
  
  uVar5 = (ulonglong)param_2;
  if (((param_1 == (undefined1 *)0x0) || (param_3 == (undefined1 *)0x0)) || (param_4 == (uint *)0x0)
     ) {
LAB_1401d99d9:
    uVar2 = 0x10;
  }
  else {
    uVar2 = FUN_1401d73b0(uVar5,local_res8);
    if ((int)uVar2 != 0) {
      return uVar2;
    }
    if (*param_4 < local_res8[0]) {
      *param_4 = local_res8[0];
      return 6;
    }
    *param_3 = 4;
    uVar6 = (undefined1)param_2;
    if (param_2 < 0x80) {
      param_3[1] = uVar6;
      uVar7 = 2;
    }
    else if (param_2 < 0x100) {
      param_3[1] = 0x81;
      uVar7 = 3;
      param_3[2] = uVar6;
    }
    else {
      uVar1 = (undefined1)(param_2 >> 8);
      if (param_2 < 0x10000) {
        param_3[1] = 0x82;
        uVar7 = 4;
        param_3[2] = uVar1;
        param_3[3] = uVar6;
      }
      else {
        if (0xffffff < param_2) goto LAB_1401d99d9;
        param_3[1] = 0x83;
        uVar7 = 5;
        param_3[2] = (char)(param_2 >> 0x10);
        param_3[3] = uVar1;
        param_3[4] = uVar6;
      }
    }
    lVar3 = (longlong)(int)uVar7;
    if (param_2 != 0) {
      uVar7 = uVar7 + param_2;
      puVar4 = param_3 + lVar3;
      do {
        uVar6 = *param_1;
        param_1 = param_1 + 1;
        uVar5 = uVar5 - 1;
        *puVar4 = uVar6;
        puVar4 = puVar4 + 1;
      } while (uVar5 != 0);
    }
    *param_4 = uVar7;
    uVar2 = 0;
  }
  return uVar2;
}



undefined8 FUN_1401d9a00(char *param_1,uint param_2,undefined1 *param_3,uint *param_4)

{
  undefined8 uVar1;
  undefined1 uVar2;
  uint uVar3;
  byte bVar4;
  uint uVar5;
  ulonglong uVar6;
  uint uVar7;
  byte *pbVar8;
  uint local_res8 [2];
  
  if (((param_1 != (char *)0x0) && (param_3 != (undefined1 *)0x0)) && (param_4 != (uint *)0x0)) {
    uVar1 = FUN_1401d7500(param_2,local_res8);
    if ((int)uVar1 == 0) {
      if (*param_4 < local_res8[0]) {
        *param_4 = local_res8[0];
        return 6;
      }
      uVar7 = 0;
      *param_3 = 3;
      uVar5 = 1;
      uVar3 = ((param_2 & 7) != 0) + 1 + (param_2 >> 3);
      uVar2 = (undefined1)uVar3;
      if (uVar3 < 0x80) {
        param_3[1] = uVar2;
        uVar5 = 2;
      }
      else if (uVar3 < 0x100) {
        param_3[1] = 0x81;
        uVar5 = 3;
        param_3[2] = uVar2;
      }
      else if (uVar3 < 0x10000) {
        param_3[1] = 0x82;
        uVar5 = 4;
        param_3[2] = (char)(uVar3 >> 8);
        param_3[3] = uVar2;
      }
      uVar6 = (ulonglong)(uVar5 + 1);
      bVar4 = 0;
      param_3[uVar5] = -(char)param_2 & 7;
      if (param_2 != 0) {
        pbVar8 = param_3 + (int)(uVar5 + 1);
        do {
          bVar4 = bVar4 | (*param_1 != '\0') << (7U - (char)(uVar7 & 7) & 0x1f);
          if ((uVar7 & 7) == 7) {
            *pbVar8 = bVar4;
            pbVar8 = pbVar8 + 1;
            uVar6 = (ulonglong)((int)uVar6 + 1);
            bVar4 = 0;
          }
          uVar7 = uVar7 + 1;
          param_1 = param_1 + 1;
        } while (uVar7 < param_2);
      }
      if ((param_2 & 7) != 0) {
        param_3[uVar6] = bVar4;
        uVar6 = (ulonglong)((int)uVar6 + 1);
      }
      *param_4 = (uint)uVar6;
      uVar1 = 0;
    }
    return uVar1;
  }
  return 0x10;
}



undefined8 FUN_1401d9b70(ulonglong param_1,undefined1 *param_2,uint *param_3)

{
  ulonglong uVar1;
  undefined8 uVar2;
  longlong lVar3;
  undefined1 *puVar4;
  int iVar5;
  uint uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  uint local_res10 [2];
  
  uVar7 = param_1 & 0xffffffff;
  if ((param_2 == (undefined1 *)0x0) || (param_3 == (uint *)0x0)) {
    return 0x10;
  }
  uVar2 = FUN_1401d76b0(param_1,local_res10);
  if ((int)uVar2 != 0) {
    return uVar2;
  }
  if (*param_3 < local_res10[0]) {
    *param_3 = local_res10[0];
    return 6;
  }
  uVar8 = 0;
  iVar5 = 0;
  uVar9 = uVar7;
  if ((uint)param_1 != 0) {
    do {
      iVar5 = iVar5 + 1;
      uVar1 = uVar9 >> 8;
      uVar9 = uVar9 >> 8;
    } while ((int)uVar1 != 0);
    if (iVar5 != 0) goto LAB_1401d9bf5;
  }
  iVar5 = 1;
LAB_1401d9bf5:
  uVar6 = iVar5 + (uint)(((uint)param_1 >> (iVar5 * 8 - 1U & 0x1f) & 1) != 0);
  if (uVar6 < 5) {
    for (; uVar8 < 4 - uVar6; uVar8 = uVar8 + 1) {
      uVar7 = (ulonglong)(uint)((int)uVar7 << 8);
    }
  }
  *param_2 = 2;
  uVar8 = 2;
  param_2[1] = (char)uVar6;
  if (uVar6 == 5) {
    param_2[2] = 0;
    uVar6 = 4;
    uVar8 = 3;
  }
  lVar3 = (longlong)(int)uVar8;
  if (uVar6 != 0) {
    uVar9 = (ulonglong)uVar6;
    uVar8 = uVar8 + uVar6;
    puVar4 = param_2 + lVar3;
    do {
      uVar9 = uVar9 - 1;
      *puVar4 = (char)(uVar7 >> 0x18);
      puVar4 = puVar4 + 1;
      uVar7 = (ulonglong)(uint)((int)uVar7 << 8);
    } while (uVar9 != 0);
  }
  *param_3 = uVar8;
  return 0;
}



ulonglong FUN_1401d9c90(longlong param_1,undefined1 *param_2,uint *param_3)

{
  bool bVar1;
  undefined1 uVar2;
  int iVar3;
  uint uVar4;
  int iVar5;
  ulonglong uVar6;
  undefined1 uVar7;
  int iVar8;
  undefined1 *puVar9;
  uint local_res8 [2];
  undefined8 local_res20;
  
  if (((param_1 == 0) || (param_2 == (undefined1 *)0x0)) || (param_3 == (uint *)0x0)) {
    return 0x10;
  }
  uVar6 = FUN_1401d7760(param_1,local_res8);
  if ((int)uVar6 == 0) {
    if (*param_3 < local_res8[0]) {
      *param_3 = local_res8[0];
      return 6;
    }
    iVar3 = (*DAT_1403210e0)(param_1,0);
    if (iVar3 == -1) {
      uVar4 = (*DAT_1403210e8)(param_1);
      uVar4 = (uVar4 - (uVar4 & 7)) + 8 >> 3;
      iVar3 = (*DAT_1403210f0)(param_1);
      iVar5 = (*DAT_1403210e8)(param_1);
      bVar1 = false;
      if ((iVar3 + 1 == iVar5) &&
         (uVar6 = (*DAT_1403210e8)(param_1), bVar1 = false, (uVar6 & 7) == 0)) {
        uVar4 = uVar4 - 1;
      }
    }
    else {
      uVar6 = (*DAT_1403210e8)();
      if (((uVar6 & 7) == 0) || (iVar3 = (*DAT_1403210e0)(param_1,0), iVar3 == 0)) {
        iVar3 = (*DAT_140321110)(param_1);
        uVar4 = iVar3 + 1;
        bVar1 = true;
      }
      else {
        uVar4 = (*DAT_140321110)(param_1);
        bVar1 = false;
      }
    }
    *param_2 = 2;
    uVar7 = (undefined1)uVar4;
    if (uVar4 < 0x80) {
      param_2[1] = uVar7;
      puVar9 = param_2 + 2;
    }
    else if (uVar4 < 0x100) {
      param_2[1] = 0x81;
      param_2[2] = uVar7;
      puVar9 = param_2 + 3;
    }
    else {
      uVar2 = (undefined1)(uVar4 >> 8);
      if (uVar4 < 0x10000) {
        param_2[1] = 0x82;
        puVar9 = param_2 + 4;
        param_2[2] = uVar2;
        param_2[3] = uVar7;
      }
      else {
        if (0xffffff < uVar4) {
          return 0x10;
        }
        param_2[1] = 0x83;
        param_2[2] = (char)(uVar4 >> 0x10);
        puVar9 = param_2 + 5;
        param_2[3] = uVar2;
        param_2[4] = uVar7;
      }
    }
    if (bVar1) {
      *puVar9 = 0;
      puVar9 = puVar9 + 1;
    }
    iVar3 = (*DAT_1403210e0)(param_1,0);
    if (iVar3 == 1) {
      uVar6 = (*DAT_140321118)(param_1,puVar9);
      if ((int)uVar6 != 0) {
        return uVar6;
      }
    }
    else {
      iVar3 = (*DAT_1403210e0)(param_1,0);
      if (iVar3 != 0) {
        iVar3 = (*DAT_140321090)(&local_res20);
        if (iVar3 == 0) {
          uVar4 = (*DAT_1403210e8)(param_1);
          iVar8 = (8 - (uVar4 & 7)) + uVar4;
          iVar3 = (*DAT_1403210f0)(param_1);
          iVar5 = (*DAT_1403210e8)(param_1);
          if ((iVar3 + 1 == iVar5) && (uVar6 = (*DAT_1403210e8)(param_1), (uVar6 & 7) == 0)) {
            iVar8 = iVar8 + -8;
          }
          iVar3 = (*DAT_1403210f8)(local_res20,iVar8);
          if ((iVar3 == 0) &&
             (iVar3 = (*DAT_140321128)(local_res20,param_1,local_res20), iVar3 == 0)) {
            uVar4 = (*DAT_140321118)(local_res20,puVar9);
            if (uVar4 != 0) {
              (*DAT_1403210a0)();
              return (ulonglong)uVar4;
            }
            (*DAT_1403210a0)(local_res20);
            *param_3 = local_res8[0];
            return 0;
          }
          (*DAT_1403210a0)(local_res20);
        }
        return 0xd;
      }
    }
    *param_3 = local_res8[0];
    uVar6 = 0;
  }
  return uVar6;
}



undefined8 FUN_1401d9f30(int param_1,undefined2 *param_2,uint *param_3)

{
  uint uVar1;
  
  if ((param_3 != (uint *)0x0) && (param_2 != (undefined2 *)0x0)) {
    uVar1 = *param_3;
    *param_3 = 3;
    if (uVar1 < 3) {
      return 6;
    }
    *param_2 = 0x101;
    *(char *)(param_2 + 1) = -(param_1 != 0);
    return 0;
  }
  return 0x10;
}



undefined8 FUN_1401d9f70(int *param_1,int *param_2,undefined8 param_3,int param_4)

{
  int iVar1;
  uint uVar2;
  int iVar3;
  undefined8 uVar4;
  ulonglong uVar5;
  longlong lVar6;
  int iVar7;
  uint *puVar8;
  uint *puVar9;
  uint uVar10;
  ulonglong uVar11;
  ulonglong uVar12;
  uint *puVar13;
  int local_48 [4];
  longlong local_38;
  
  iVar3 = *param_2;
  iVar1 = *param_1;
  if (iVar3 + 1 + iVar1 < 0x200) {
    if (iVar1 < iVar3) {
      iVar3 = iVar1;
    }
    if (iVar3 < 0x100) {
      uVar4 = FUN_1401da0d0(param_1,param_2,param_3,param_4);
      return uVar4;
    }
  }
  uVar4 = FUN_1401d45b0(local_48);
  if ((int)uVar4 == 0) {
    iVar3 = *param_1;
    iVar1 = *param_2;
    local_48[0] = iVar1 + 1 + iVar3;
    lVar6 = 0;
    uVar11 = (longlong)param_4;
    if (0 < iVar3) {
      do {
        iVar7 = (int)uVar11;
        uVar11 = 0;
        uVar10 = 0;
        uVar2 = *(uint *)(*(longlong *)(param_1 + 4) + lVar6 * 4);
        puVar9 = (uint *)(local_38 + (longlong)param_4 * 4);
        puVar13 = (uint *)(*(longlong *)(param_2 + 4) + (longlong)iVar7 * 4);
        if (iVar7 < iVar1) {
          uVar12 = (ulonglong)(uint)(iVar1 - iVar7);
          puVar8 = puVar9;
          do {
            uVar10 = *puVar13;
            puVar9 = puVar8 + 1;
            puVar13 = puVar13 + 1;
            uVar5 = (ulonglong)uVar10 * (ulonglong)uVar2 + (ulonglong)*puVar8 +
                    (uVar11 & 0xffffffff);
            uVar11 = uVar5 >> 0x1c;
            uVar10 = (uint)uVar11;
            uVar12 = uVar12 - 1;
            *puVar8 = (uint)uVar5 & 0xfffffff;
            puVar8 = puVar9;
          } while (uVar12 != 0);
        }
        lVar6 = lVar6 + 1;
        *puVar9 = uVar10;
        uVar11 = (ulonglong)(iVar7 - 1);
      } while (lVar6 < iVar3);
    }
    FUN_1401d2430(local_48);
    FUN_1401d4470(local_48,param_3);
    FUN_1401cc300(local_48);
    uVar4 = 0;
  }
  return uVar4;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1401da0d0(int *param_1,int *param_2,int *param_3,int param_4)

{
  int iVar1;
  int iVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  uint uVar6;
  uint uVar7;
  undefined8 uVar8;
  int iVar9;
  ulonglong uVar10;
  longlong lVar11;
  void *_Dst;
  int iVar12;
  uint *puVar13;
  uint *puVar14;
  ulonglong uVar15;
  longlong lVar16;
  longlong lVar17;
  undefined1 auStack_888 [40];
  undefined8 local_860;
  undefined1 auStack_858 [2048];
  ulonglong local_58;
  
  local_58 = DAT_1402f85a0 ^ (ulonglong)auStack_888;
  lVar17 = (longlong)param_4;
  local_860 = param_3;
  if ((*param_2 + *param_1 <= param_3[1]) || (uVar8 = FUN_1401d2390(param_3), (int)uVar8 == 0)) {
    iVar3 = *param_1;
    iVar2 = iVar3 + *param_2;
    uVar15 = 0;
    lVar11 = (longlong)iVar2;
    if (lVar17 < lVar11) {
      lVar4 = *(longlong *)(param_1 + 4);
      lVar5 = *(longlong *)(param_2 + 4);
      iVar1 = *param_2 + -1;
      lVar16 = lVar17;
      iVar12 = param_4;
      do {
        iVar9 = iVar12;
        if (iVar1 < iVar12) {
          iVar9 = iVar1;
        }
        puVar13 = (uint *)(lVar4 + (longlong)(iVar12 - iVar9) * 4);
        puVar14 = (uint *)(lVar5 + (longlong)iVar9 * 4);
        uVar6 = iVar3 - (iVar12 - iVar9);
        uVar7 = iVar9 + 1U;
        if ((int)uVar6 < (int)(iVar9 + 1U)) {
          uVar7 = uVar6;
        }
        uVar10 = (ulonglong)uVar7;
        if (0 < (int)uVar7) {
          do {
            uVar7 = *puVar14;
            uVar6 = *puVar13;
            puVar14 = puVar14 + -1;
            puVar13 = puVar13 + 1;
            uVar15 = uVar15 + (ulonglong)uVar7 * (ulonglong)uVar6;
            uVar10 = uVar10 - 1;
          } while (uVar10 != 0);
        }
        lVar16 = lVar16 + 1;
        iVar12 = iVar12 + 1;
        uVar7 = (uint)uVar15;
        uVar15 = uVar15 >> 0x1c;
        *(uint *)(auStack_858 + lVar16 * 4 + -4) = uVar7 & 0xfffffff;
        param_3 = local_860;
      } while (lVar16 < lVar11);
    }
    iVar3 = *param_3;
    *param_3 = iVar2;
    _Dst = (void *)(*(longlong *)(param_3 + 4) + lVar17 * 4);
    if (lVar17 < lVar11) {
      lVar11 = lVar11 - lVar17;
      memcpy(_Dst,auStack_858 + lVar17 * 4,lVar11 * 4);
      param_4 = param_4 + (int)lVar11;
      _Dst = (void *)((longlong)_Dst + lVar11 * 4);
    }
    if (param_4 < iVar3) {
      memset(_Dst,0,(ulonglong)(uint)(iVar3 - param_4) << 2);
    }
    FUN_1401d2430(param_3);
    uVar8 = 0;
  }
  return uVar8;
}



PEXCEPTION_ROUTINE __stdcall
RtlVirtualUnwind(DWORD HandlerType,DWORD64 ImageBase,DWORD64 ControlPc,
                PRUNTIME_FUNCTION FunctionEntry,PCONTEXT ContextRecord,PVOID *HandlerData,
                PDWORD64 EstablisherFrame,PKNONVOLATILE_CONTEXT_POINTERS ContextPointers)

{
  PEXCEPTION_ROUTINE puVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001401da272. Too many branches
                    // WARNING: Treating indirect jump as call
  puVar1 = RtlVirtualUnwind(HandlerType,ImageBase,ControlPc,FunctionEntry,ContextRecord,HandlerData,
                            EstablisherFrame,ContextPointers);
  return puVar1;
}



PRUNTIME_FUNCTION __stdcall
RtlLookupFunctionEntry(DWORD64 ControlPc,PDWORD64 ImageBase,PUNWIND_HISTORY_TABLE HistoryTable)

{
  PRUNTIME_FUNCTION p_Var1;
  
                    // WARNING: Could not recover jumptable at 0x0001401da278. Too many branches
                    // WARNING: Treating indirect jump as call
  p_Var1 = RtlLookupFunctionEntry(ControlPc,ImageBase,HistoryTable);
  return p_Var1;
}



ulonglong FUN_1401da280(undefined8 param_1,undefined4 *param_2,undefined8 param_3,int param_4)

{
  uint uVar1;
  ulonglong uVar2;
  undefined8 local_68;
  int local_60;
  undefined8 local_58;
  undefined4 local_50;
  undefined4 local_4c;
  undefined8 local_38;
  undefined8 local_30;
  
  local_50 = *param_2;
  local_38 = 0;
  local_30 = 0;
  local_68 = param_3;
  local_60 = param_4;
  local_58 = param_1;
  uVar2 = FUN_1401da5b8(&local_68,"1.2.3",0x58);
  if ((int)uVar2 == 0) {
    uVar1 = FUN_1401da718(&local_68,4);
    uVar2 = (ulonglong)uVar1;
    if (uVar1 == 1) {
      *param_2 = local_4c;
      uVar2 = FUN_1401dbc88(&local_68);
    }
    else {
      FUN_1401dbc88(&local_68);
      if ((uVar1 == 2) || ((uVar1 == 0xfffffffb && (local_60 == 0)))) {
        uVar2 = 0xfffffffd;
      }
    }
  }
  return uVar2;
}



ulonglong FUN_1401da324(undefined8 param_1,undefined4 *param_2,undefined8 param_3,undefined4 param_4
                       ,undefined4 param_5)

{
  uint uVar1;
  ulonglong uVar2;
  undefined8 local_68;
  undefined4 local_60;
  undefined8 local_58;
  undefined4 local_50;
  undefined4 local_4c;
  undefined8 local_38;
  undefined8 local_30;
  undefined8 local_28;
  
  local_50 = *param_2;
  local_38 = 0;
  local_30 = 0;
  local_28 = 0;
  local_68 = param_3;
  local_60 = param_4;
  local_58 = param_1;
  uVar2 = FUN_1401de36c(&local_68,param_5,"1.2.3",0x58);
  if ((int)uVar2 == 0) {
    uVar1 = FUN_1401dc41c(&local_68,4);
    uVar2 = (ulonglong)uVar1;
    if (uVar1 == 1) {
      *param_2 = local_4c;
      uVar2 = FUN_1401dcc6c(&local_68);
    }
    else {
      FUN_1401dcc6c(&local_68);
      if (uVar1 == 0) {
        uVar2 = 0xfffffffb;
      }
    }
  }
  return uVar2;
}



void FUN_1401da3d4(void)

{
  FUN_1401da324();
  return;
}



undefined8 FUN_1401da408(longlong param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  if ((param_1 != 0) && (puVar2 = *(undefined8 **)(param_1 + 0x28), puVar2 != (undefined8 *)0x0)) {
    *(undefined4 *)((longlong)puVar2 + 0x1c) = 0;
    *(undefined4 *)(param_1 + 0x1c) = 0;
    *(undefined4 *)(param_1 + 0xc) = 0;
    *(undefined8 *)(param_1 + 0x20) = 0;
    *(undefined4 *)(param_1 + 0x4c) = 1;
    *puVar2 = 0;
    *(undefined4 *)((longlong)puVar2 + 0xc) = 0;
    puVar2[4] = 0;
    *(undefined8 *)((longlong)puVar2 + 0x2c) = 0;
    *(undefined4 *)((longlong)puVar2 + 0x34) = 0;
    puVar2[8] = 0;
    puVar1 = puVar2 + 0xa9;
    puVar2[0x10] = puVar1;
    puVar2[0xc] = puVar1;
    puVar2[0xb] = puVar1;
    *(undefined4 *)((longlong)puVar2 + 0x14) = 0x8000;
    return 0;
  }
  return 0xfffffffe;
}



undefined8 FUN_1401da4c8(longlong param_1,uint param_2,char *param_3,int param_4)

{
  code *pcVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  if (((param_3 == (char *)0x0) || (*param_3 != '1')) || (param_4 != 0x58)) {
    return 0xfffffffa;
  }
  if (param_1 != 0) {
    *(undefined8 *)(param_1 + 0x20) = 0;
    if (*(longlong *)(param_1 + 0x30) == 0) {
      *(undefined8 *)(param_1 + 0x40) = 0;
      *(code **)(param_1 + 0x30) = FUN_1401de3d8;
    }
    pcVar1 = *(code **)(param_1 + 0x38);
    if (pcVar1 == (code *)0x0) {
      pcVar1 = FUN_1401de3f8;
    }
    *(code **)(param_1 + 0x38) = pcVar1;
    lVar2 = (**(code **)(param_1 + 0x30))(*(undefined8 *)(param_1 + 0x40),1,0x2548);
    if (lVar2 == 0) {
      return 0xfffffffc;
    }
    *(longlong *)(param_1 + 0x28) = lVar2;
    if ((int)param_2 < 0) {
      *(undefined4 *)(lVar2 + 8) = 0;
      param_2 = -param_2;
    }
    else {
      *(int *)(lVar2 + 8) = ((int)param_2 >> 4) + 1;
      if ((int)param_2 < 0x30) {
        param_2 = param_2 & 0xf;
      }
    }
    if (param_2 - 8 < 8) {
      *(undefined8 *)(lVar2 + 0x38) = 0;
      *(uint *)(lVar2 + 0x28) = param_2;
      uVar3 = FUN_1401da408(param_1);
      return uVar3;
    }
    (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40));
    *(undefined8 *)(param_1 + 0x28) = 0;
  }
  return 0xfffffffe;
}



void FUN_1401da5b8(undefined8 param_1,undefined8 param_2,undefined4 param_3)

{
  FUN_1401da4c8(param_1,0xf,param_2,param_3);
  return;
}



void FUN_1401da5d8(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x68) = 9;
  *(undefined4 *)(param_1 + 0x6c) = 5;
  *(undefined **)(param_1 + 0x58) = &DAT_14026e970;
  *(undefined **)(param_1 + 0x60) = &DAT_14026f170;
  return;
}



undefined8 FUN_1401da608(longlong param_1,int param_2)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  uint uVar4;
  uint uVar5;
  
  lVar1 = *(longlong *)(param_1 + 0x28);
  if (*(longlong *)(lVar1 + 0x38) == 0) {
    lVar3 = (**(code **)(param_1 + 0x30))
                      (*(undefined8 *)(param_1 + 0x40),
                       1 << ((byte)*(undefined4 *)(lVar1 + 0x28) & 0x1f),1);
    *(longlong *)(lVar1 + 0x38) = lVar3;
    if (lVar3 == 0) {
      return 1;
    }
  }
  if (*(int *)(lVar1 + 0x2c) == 0) {
    *(undefined8 *)(lVar1 + 0x30) = 0;
    *(int *)(lVar1 + 0x2c) = 1 << ((byte)*(undefined4 *)(lVar1 + 0x28) & 0x1f);
  }
  uVar4 = param_2 - *(int *)(param_1 + 0x18);
  uVar5 = *(uint *)(lVar1 + 0x2c);
  if (uVar4 < uVar5) {
    uVar5 = uVar5 - *(int *)(lVar1 + 0x34);
    if (uVar4 < uVar5) {
      uVar5 = uVar4;
    }
    memcpy((void *)((ulonglong)*(uint *)(lVar1 + 0x34) + *(longlong *)(lVar1 + 0x38)),
           (void *)(*(longlong *)(param_1 + 0x10) - (ulonglong)uVar4),(ulonglong)uVar5);
    uVar4 = uVar4 - uVar5;
    if (uVar4 == 0) {
      *(int *)(lVar1 + 0x34) = *(int *)(lVar1 + 0x34) + uVar5;
      uVar4 = *(uint *)(lVar1 + 0x34);
      if (*(uint *)(lVar1 + 0x34) == *(uint *)(lVar1 + 0x2c)) {
        uVar4 = 0;
      }
      *(uint *)(lVar1 + 0x34) = uVar4;
      if (*(uint *)(lVar1 + 0x2c) <= *(uint *)(lVar1 + 0x30)) {
        return 0;
      }
      iVar2 = *(uint *)(lVar1 + 0x30) + uVar5;
      goto LAB_1401da6e4;
    }
    memcpy(*(void **)(lVar1 + 0x38),(void *)(*(longlong *)(param_1 + 0x10) - (ulonglong)uVar4),
           (ulonglong)uVar4);
    *(uint *)(lVar1 + 0x34) = uVar4;
  }
  else {
    memcpy(*(void **)(lVar1 + 0x38),(void *)(*(longlong *)(param_1 + 0x10) - (ulonglong)uVar5),
           (ulonglong)uVar5);
    *(undefined4 *)(lVar1 + 0x34) = 0;
  }
  iVar2 = *(int *)(lVar1 + 0x2c);
LAB_1401da6e4:
  *(int *)(lVar1 + 0x30) = iVar2;
  return 0;
}



int FUN_1401da718(longlong *param_1,int param_2)

{
  byte bVar1;
  uint *puVar2;
  char cVar3;
  uint uVar4;
  int iVar5;
  char *pcVar6;
  byte bVar7;
  ushort uVar8;
  uint uVar9;
  uint uVar10;
  ulonglong uVar11;
  longlong lVar12;
  uint uVar13;
  ulonglong uVar14;
  uint uVar15;
  byte *pbVar16;
  ulonglong uVar17;
  undefined2 uVar18;
  undefined1 *puVar19;
  uint uVar20;
  ulonglong uVar21;
  int iVar22;
  uint uVar23;
  uint uVar24;
  uint uVar25;
  int local_res8;
  uint local_res18;
  uint local_res20;
  undefined2 local_68;
  undefined1 local_66;
  undefined1 local_65;
  undefined4 local_64;
  uint local_60;
  byte *local_58;
  undefined1 *local_50;
  
  if ((((param_1 == (longlong *)0x0) || (puVar2 = (uint *)param_1[5], puVar2 == (uint *)0x0)) ||
      (param_1[2] == 0)) || ((*param_1 == 0 && ((int)param_1[1] != 0)))) {
    return -2;
  }
  uVar25 = *puVar2;
  uVar23 = puVar2[0x10];
  uVar15 = puVar2[0x11];
  local_res8 = 0;
  if (uVar25 == 0xb) {
    uVar25 = 0xc;
  }
  *puVar2 = uVar25;
  local_res20 = *(uint *)(param_1 + 3);
  uVar17 = (ulonglong)local_res20;
  local_58 = (byte *)*param_1;
  uVar25 = *(uint *)(param_1 + 1);
  local_50 = (undefined1 *)param_1[2];
  uVar14 = uVar17;
  local_60 = uVar25;
LAB_1401da79e:
  uVar21 = 0;
  uVar11 = 0x10;
  pbVar16 = local_58;
LAB_1401da7a3:
  local_res18 = (uint)uVar14;
  puVar19 = local_50;
LAB_1401da7ab:
  uVar13 = 7;
LAB_1401da7b0:
  do {
    uVar9 = (uint)uVar11;
    uVar4 = *puVar2;
    uVar20 = (uint)uVar21;
    uVar24 = (uint)uVar14;
    uVar10 = local_64;
    if ((int)uVar4 < 0xf) {
      if (uVar4 == 0xe) {
LAB_1401dae8c:
        uVar4 = puVar2[0x12];
        if (uVar4 != 0) {
          if (uVar25 < uVar4) {
            uVar4 = uVar25;
          }
          if (uVar24 < uVar4) {
            uVar4 = uVar24;
          }
          uVar13 = uVar25;
          if (uVar4 != 0) {
            memcpy(puVar19,local_58,(ulonglong)uVar4);
            local_58 = local_58 + uVar4;
            uVar25 = uVar25 - uVar4;
            local_res18 = local_res18 - uVar4;
            local_50 = local_50 + uVar4;
            puVar2[0x12] = puVar2[0x12] - uVar4;
            goto LAB_1401daee2;
          }
          goto LAB_1401dac06;
        }
        *puVar2 = 0xb;
        pbVar16 = local_58;
        goto LAB_1401da7b0;
      }
      if ((int)uVar4 <= (int)uVar13) {
        if (uVar4 == uVar13) goto LAB_1401dab86;
        if (uVar4 == 0) {
          uVar4 = uVar23;
          if (puVar2[2] != uVar20) goto LAB_1401dac92;
          *puVar2 = 0xc;
          goto LAB_1401da7ab;
        }
        if (uVar4 == 1) goto LAB_1401da83b;
        if (uVar4 == 2) goto LAB_1401da8db;
        if (uVar4 == 3) goto LAB_1401da961;
        if (uVar4 == 4) goto LAB_1401da9bf;
        if (uVar4 == 5) goto LAB_1401da9df;
        if (uVar4 != 6) {
          return -2;
        }
        goto LAB_1401daaed;
      }
      if (uVar4 == 8) goto LAB_1401dadea;
      if (uVar4 == 9) {
        for (; uVar15 < 0x20; uVar15 = uVar15 + 8) {
          uVar13 = uVar25;
          if (uVar25 == 0) goto LAB_1401dac06;
          bVar1 = *pbVar16;
          pbVar16 = pbVar16 + 1;
          uVar25 = uVar25 - 1;
          uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
          local_58 = pbVar16;
        }
        uVar23 = (uVar23 >> 8 & 0xff00) + ((uVar23 & 0xff00) + uVar23 * 0x10000) * 0x100 +
                 (uVar23 >> 0x18);
        puVar2[6] = uVar23;
        *(uint *)((longlong)param_1 + 0x4c) = uVar23;
        *puVar2 = 10;
        uVar23 = uVar20;
        uVar15 = uVar20;
LAB_1401daf4e:
        if (puVar2[3] == uVar20) {
          param_1[2] = (longlong)puVar19;
          *(uint *)(param_1 + 3) = uVar24;
          *param_1 = (longlong)pbVar16;
          *(uint *)(param_1 + 1) = uVar25;
          puVar2[0x10] = uVar23;
          puVar2[0x11] = uVar15;
          return 2;
        }
        uVar13 = FUN_1401deccc(0,0,0);
        uVar17 = (ulonglong)local_res20;
        uVar14 = (ulonglong)local_res18;
        uVar21 = 0;
        puVar2[6] = uVar13;
        *(uint *)((longlong)param_1 + 0x4c) = uVar13;
        *puVar2 = 0xb;
        uVar11 = 0x10;
        puVar19 = local_50;
LAB_1401daf84:
        uVar13 = uVar25;
        uVar10 = local_64;
        if (param_2 == 5) goto LAB_1401dac06;
      }
      else {
        if (uVar4 == 10) goto LAB_1401daf4e;
        if (uVar4 == 0xb) goto LAB_1401daf84;
        if (uVar4 != 0xc) {
          if (uVar4 != 0xd) {
            return -2;
          }
          uVar23 = uVar23 >> (sbyte)(uVar15 & 7);
          for (uVar15 = uVar15 - (uVar15 & 7); uVar15 < 0x20; uVar15 = uVar15 + 8) {
            uVar13 = uVar25;
            if (uVar25 == 0) goto LAB_1401dac06;
            bVar1 = *pbVar16;
            pbVar16 = pbVar16 + 1;
            uVar25 = uVar25 - 1;
            uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
            local_58 = pbVar16;
          }
          if ((uVar23 & 0xffff) == ~uVar23 >> 0x10) {
            puVar2[0x12] = uVar23 & 0xffff;
            *puVar2 = 0xe;
            uVar13 = 7;
            uVar23 = uVar20;
            uVar15 = uVar20;
            goto LAB_1401dae8c;
          }
          pcVar6 = "invalid stored block lengths";
          goto LAB_1401dadb0;
        }
      }
      if (puVar2[1] != (uint)uVar21) {
        uVar13 = 7;
        *puVar2 = 0x18;
        uVar23 = uVar23 >> (sbyte)(uVar15 & 7);
        uVar15 = uVar15 - (uVar15 & 7);
        goto LAB_1401da7b0;
      }
      goto LAB_1401dafce;
    }
    if (0x16 < (int)uVar4) {
      uVar13 = uVar25;
      if (uVar4 == 0x17) {
        if (uVar24 == 0) goto LAB_1401dac06;
        *puVar19 = (char)puVar2[0x12];
        local_50 = puVar19 + 1;
        uVar14 = (ulonglong)(uVar24 - 1);
        *puVar2 = 0x12;
        goto LAB_1401da7a3;
      }
      if (uVar4 == 0x18) {
        uVar13 = uVar23;
        uVar4 = uVar15;
        if (puVar2[2] != uVar20) goto LAB_1401dbaa0;
        goto LAB_1401dbb38;
      }
      if (uVar4 == 0x19) goto LAB_1401dbb3e;
      if (uVar4 == 0x1a) goto LAB_1401dbbe4;
      if (uVar4 != 0x1b) {
        if (uVar4 == 0x1c) {
          return -4;
        }
        return -2;
      }
      local_res8 = -3;
      goto LAB_1401dac06;
    }
    if (uVar4 == 0x16) goto LAB_1401db9a8;
    if (uVar4 != 0xf) {
      if (uVar4 == 0x10) goto LAB_1401db19f;
      if (uVar4 == 0x11) goto LAB_1401db290;
      if (uVar4 == 0x12) goto LAB_1401db5b1;
      if (uVar4 == 0x13) goto LAB_1401db786;
      if (uVar4 == 0x14) goto LAB_1401db7d4;
      if (uVar4 != 0x15) {
        return -2;
      }
      goto LAB_1401db940;
    }
    for (; uVar15 < 0xe; uVar15 = uVar15 + 8) {
      uVar13 = uVar25;
      if (uVar25 == 0) goto LAB_1401dac06;
      bVar1 = *pbVar16;
      pbVar16 = pbVar16 + 1;
      uVar25 = uVar25 - 1;
      uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
      local_58 = pbVar16;
    }
    uVar15 = uVar15 - 0xe;
    uVar24 = uVar23 >> 10;
    uVar13 = (uVar23 & 0x1f) + 0x101;
    uVar4 = (uVar23 >> 5 & 0x1f) + 1;
    uVar23 = uVar23 >> 0xe;
    puVar2[0x1d] = uVar13;
    puVar2[0x1e] = uVar4;
    puVar2[0x1c] = (uVar24 & 0xf) + 4;
    if ((0x11e < uVar13) || (0x1e < uVar4)) {
      pcVar6 = "too many length or distance symbols";
      goto LAB_1401dad46;
    }
    puVar2[0x1f] = uVar20;
    *puVar2 = 0x10;
LAB_1401db19f:
    while (uVar4 = uVar23, puVar2[0x1f] < puVar2[0x1c]) {
      for (; uVar15 < 3; uVar15 = uVar15 + 8) {
        uVar23 = uVar4;
        uVar13 = uVar25;
        if (uVar25 == 0) goto LAB_1401dac06;
        bVar1 = *pbVar16;
        pbVar16 = pbVar16 + 1;
        bVar7 = (byte)uVar15;
        uVar25 = uVar25 - 1;
        uVar4 = uVar4 + ((uint)bVar1 << (bVar7 & 0x1f));
        local_58 = pbVar16;
      }
      uVar23 = uVar4 >> 3;
      *(ushort *)
       ((longlong)puVar2 +
       (ulonglong)*(ushort *)(&DAT_14026f1f0 + (ulonglong)puVar2[0x1f] * 2) * 2 + 0x88) =
           (ushort)uVar4 & 7;
      puVar2[0x1f] = puVar2[0x1f] + 1;
      uVar15 = uVar15 - 3;
    }
    while (puVar2[0x1f] < 0x13) {
      *(short *)((longlong)puVar2 +
                (ulonglong)*(ushort *)(&DAT_14026f1f0 + (ulonglong)puVar2[0x1f] * 2) * 2 + 0x88) =
           (short)uVar21;
      puVar2[0x1f] = puVar2[0x1f] + 1;
    }
    puVar2[0x1a] = 7;
    *(uint **)(puVar2 + 0x20) = puVar2 + 0x152;
    *(uint **)(puVar2 + 0x16) = puVar2 + 0x152;
    local_res8 = FUN_1401de864(0,puVar2 + 0x22,0x13,puVar2 + 0x20,puVar2 + 0x1a,puVar2 + 0xc2);
    uVar21 = 0;
    uVar11 = 0x10;
    puVar19 = local_50;
    if (local_res8 != 0) {
      uVar17 = (ulonglong)local_res20;
      uVar14 = (ulonglong)local_res18;
      param_1[4] = (longlong)"invalid code lengths set";
      *puVar2 = 0x1b;
      goto LAB_1401da7ab;
    }
    puVar2[0x1f] = 0;
    *puVar2 = 0x11;
LAB_1401db290:
    if (puVar2[0x1f] < puVar2[0x1e] + puVar2[0x1d]) {
      do {
        for (; uVar10 = *(uint *)(*(longlong *)(puVar2 + 0x16) +
                                 (ulonglong)((1 << ((byte)puVar2[0x1a] & 0x1f)) - 1U & uVar23) * 4),
            uVar15 < (uVar10 >> 8 & 0xff); uVar15 = uVar15 + 8) {
          uVar13 = uVar25;
          if (uVar25 == 0) goto LAB_1401dac06;
          bVar1 = *pbVar16;
          pbVar16 = pbVar16 + 1;
          uVar25 = uVar25 - 1;
          uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
          local_58 = pbVar16;
        }
        uVar8 = (ushort)(uVar10 >> 0x10);
        local_64._1_1_ = (byte)(uVar10 >> 8);
        local_64 = uVar10;
        if (uVar8 < (ushort)uVar11) {
          if (uVar15 < (uVar10 >> 8 & 0xff)) {
            do {
              uVar13 = 0;
              if (uVar25 == 0) goto LAB_1401dac06;
              bVar1 = *pbVar16;
              pbVar16 = pbVar16 + 1;
              bVar7 = (byte)uVar15;
              uVar15 = uVar15 + 8;
              uVar25 = uVar25 - 1;
              uVar23 = uVar23 + ((uint)bVar1 << (bVar7 & 0x1f));
              local_58 = pbVar16;
            } while (uVar15 < local_64._1_1_);
          }
          uVar23 = uVar23 >> (local_64._1_1_ & 0x1f);
          uVar15 = uVar15 - local_64._1_1_;
          *(ushort *)((longlong)puVar2 + (ulonglong)puVar2[0x1f] * 2 + 0x88) = uVar8;
          puVar2[0x1f] = puVar2[0x1f] + 1;
        }
        else {
          if (uVar8 == (ushort)uVar11) {
            for (; uVar15 < local_64._1_1_ + 2; uVar15 = uVar15 + 8) {
              uVar13 = uVar25;
              if (uVar25 == 0) goto LAB_1401dac06;
              bVar1 = *pbVar16;
              pbVar16 = pbVar16 + 1;
              uVar25 = uVar25 - 1;
              uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
              local_58 = pbVar16;
            }
            uVar15 = uVar15 - local_64._1_1_;
            uVar23 = uVar23 >> (local_64._1_1_ & 0x1f);
            if (puVar2[0x1f] == 0) {
              param_1[4] = (longlong)"invalid bit length repeat";
              *puVar2 = 0x1b;
              goto LAB_1401dace1;
            }
            uVar18 = *(undefined2 *)((longlong)puVar2 + (ulonglong)(puVar2[0x1f] - 1) * 2 + 0x88);
            iVar22 = (uVar23 & 3) + 3;
            uVar15 = uVar15 - 2;
            uVar23 = uVar23 >> 2;
          }
          else {
            if (uVar8 == 0x11) {
              for (; uVar15 < local_64._1_1_ + 3; uVar15 = uVar15 + 8) {
                uVar13 = uVar25;
                if (uVar25 == 0) goto LAB_1401dac06;
                bVar1 = *pbVar16;
                pbVar16 = pbVar16 + 1;
                uVar25 = uVar25 - 1;
                uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
                local_58 = pbVar16;
              }
              iVar5 = -3;
              uVar23 = uVar23 >> (local_64._1_1_ & 0x1f);
              iVar22 = (uVar23 & 7) + 3;
              uVar23 = uVar23 >> 3;
            }
            else {
              for (; uVar15 < local_64._1_1_ + 7; uVar15 = uVar15 + 8) {
                uVar13 = uVar25;
                if (uVar25 == 0) goto LAB_1401dac06;
                bVar1 = *pbVar16;
                pbVar16 = pbVar16 + 1;
                uVar25 = uVar25 - 1;
                uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
                local_58 = pbVar16;
              }
              iVar5 = -7;
              uVar23 = uVar23 >> (local_64._1_1_ & 0x1f);
              iVar22 = (uVar23 & 0x7f) + 0xb;
              uVar23 = uVar23 >> 7;
            }
            uVar18 = (undefined2)uVar21;
            uVar15 = uVar15 + (iVar5 - (uint)local_64._1_1_);
          }
          if (puVar2[0x1e] + puVar2[0x1d] < iVar22 + puVar2[0x1f]) {
            param_1[4] = (longlong)"invalid bit length repeat";
            *puVar2 = 0x1b;
            break;
          }
          for (; iVar22 != 0; iVar22 = iVar22 + -1) {
            *(undefined2 *)((longlong)puVar2 + (ulonglong)puVar2[0x1f] * 2 + 0x88) = uVar18;
            puVar2[0x1f] = puVar2[0x1f] + 1;
          }
          uVar11 = 0x10;
        }
      } while (puVar2[0x1f] < puVar2[0x1e] + puVar2[0x1d]);
    }
    uVar17 = (ulonglong)local_res20;
    uVar14 = (ulonglong)local_res18;
    uVar11 = 0x10;
    uVar13 = 7;
  } while (*puVar2 == 0x1b);
  *(uint **)(puVar2 + 0x20) = puVar2 + 0x152;
  *(uint **)(puVar2 + 0x16) = puVar2 + 0x152;
  puVar2[0x1a] = 9;
  local_res8 = FUN_1401de864(1,puVar2 + 0x22,puVar2[0x1d],puVar2 + 0x20,puVar2 + 0x1a,puVar2 + 0xc2)
  ;
  if (local_res8 != 0) {
    param_1[4] = (longlong)"invalid literal/lengths set";
    *puVar2 = 0x1b;
    pbVar16 = local_58;
    goto LAB_1401dacdd;
  }
  *(undefined8 *)(puVar2 + 0x18) = *(undefined8 *)(puVar2 + 0x20);
  puVar2[0x1b] = 6;
  local_res8 = FUN_1401de864(2,(longlong)puVar2 + (ulonglong)puVar2[0x1d] * 2 + 0x88,puVar2[0x1e],
                             puVar2 + 0x20,puVar2 + 0x1b,puVar2 + 0xc2);
  uVar17 = (ulonglong)local_res20;
  uVar14 = (ulonglong)local_res18;
  uVar21 = 0;
  puVar19 = local_50;
  pbVar16 = local_58;
  if (local_res8 != 0) {
    pcVar6 = "invalid distances set";
    goto LAB_1401dad46;
  }
  *puVar2 = 0x12;
  uVar24 = local_res18;
LAB_1401db5b1:
  if ((5 < uVar25) && (0x101 < uVar24)) {
    param_1[2] = (longlong)puVar19;
    *(uint *)(param_1 + 3) = uVar24;
    *param_1 = (longlong)pbVar16;
    *(uint *)(param_1 + 1) = uVar25;
    puVar2[0x10] = uVar23;
    puVar2[0x11] = uVar15;
    FUN_1401de404(param_1,uVar17 & 0xffffffff);
    local_58 = (byte *)*param_1;
    local_50 = (undefined1 *)param_1[2];
    local_res18 = *(uint *)(param_1 + 3);
    uVar25 = *(uint *)(param_1 + 1);
    uVar23 = puVar2[0x10];
    uVar15 = puVar2[0x11];
LAB_1401daee2:
    uVar14 = (ulonglong)local_res18;
    uVar17 = (ulonglong)local_res20;
    goto LAB_1401da79e;
  }
  uVar10 = *(uint *)(*(longlong *)(puVar2 + 0x16) +
                    (ulonglong)((1 << ((byte)puVar2[0x1a] & 0x1f)) - 1U & uVar23) * 4);
  for (; uVar15 < (uVar10 >> 8 & 0xff); uVar15 = uVar15 + 8) {
    uVar13 = uVar25;
    uVar10 = local_64;
    if (uVar25 == 0) goto LAB_1401dac06;
    bVar1 = *pbVar16;
    pbVar16 = pbVar16 + 1;
    uVar25 = uVar25 - 1;
    uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
    uVar10 = *(uint *)(*(longlong *)(puVar2 + 0x16) +
                      (ulonglong)((1 << ((byte)puVar2[0x1a] & 0x1f)) - 1U & uVar23) * 4);
    local_58 = pbVar16;
  }
  cVar3 = (char)uVar10;
  uVar13 = uVar10;
  if ((cVar3 != '\0') && ((uVar10 & 0xf0) == 0)) {
    bVar1 = (byte)(uVar10 >> 8);
    uVar13 = *(uint *)(*(longlong *)(puVar2 + 0x16) +
                      (ulonglong)
                      ((((1 << (cVar3 + bVar1 & 0x1f)) - 1U & uVar23) >> (bVar1 & 0x1f)) +
                      (uVar10 >> 0x10)) * 4);
    uVar4 = (uVar13 >> 8 & 0xff) + (uVar10 >> 8 & 0xff);
    for (; uVar15 < uVar4; uVar15 = uVar15 + 8) {
      uVar13 = uVar25;
      if (uVar25 == 0) goto LAB_1401dac06;
      uVar23 = uVar23 + ((uint)*pbVar16 << ((byte)uVar15 & 0x1f));
      pbVar16 = pbVar16 + 1;
      uVar25 = uVar25 - 1;
      uVar13 = *(uint *)(*(longlong *)(puVar2 + 0x16) +
                        (ulonglong)
                        ((((1 << (cVar3 + bVar1 & 0x1f)) - 1U & uVar23) >> (bVar1 & 0x1f)) +
                        (uVar10 >> 0x10)) * 4);
      uVar4 = (uVar13 >> 8 & 0xff) + (uint)bVar1;
      local_58 = pbVar16;
    }
    uVar23 = uVar23 >> (bVar1 & 0x1f);
    uVar15 = uVar15 - bVar1;
    local_64 = uVar10;
  }
  uVar23 = uVar23 >> ((byte)(uVar13 >> 8) & 0x1f);
  uVar15 = uVar15 - (uVar13 >> 8 & 0xff);
  puVar2[0x12] = uVar13 >> 0x10;
  if ((char)uVar13 == '\0') {
    *puVar2 = 0x17;
    goto LAB_1401dacdd;
  }
  if ((uVar13 & 0x20) != 0) {
    *puVar2 = 0xb;
    goto LAB_1401dacdd;
  }
  if ((uVar13 & 0x40) != 0) {
    param_1[4] = (longlong)"invalid literal/length code";
    *puVar2 = 0x1b;
    goto LAB_1401dacdd;
  }
  *puVar2 = 0x13;
  puVar2[0x14] = uVar13 & 0xf;
LAB_1401db786:
  uVar4 = puVar2[0x14];
  if (uVar4 != 0) {
    if (uVar15 < uVar4) {
      do {
        uVar13 = 0;
        uVar10 = local_64;
        if (uVar25 == 0) goto LAB_1401dac06;
        bVar1 = *pbVar16;
        pbVar16 = pbVar16 + 1;
        bVar7 = (byte)uVar15;
        uVar15 = uVar15 + 8;
        uVar25 = uVar25 - 1;
        uVar23 = uVar23 + ((uint)bVar1 << (bVar7 & 0x1f));
        local_58 = pbVar16;
      } while (uVar15 < puVar2[0x14]);
    }
    uVar13 = (1 << ((byte)uVar4 & 0x1f)) - 1U & uVar23;
    uVar23 = uVar23 >> ((byte)uVar4 & 0x1f);
    puVar2[0x12] = puVar2[0x12] + uVar13;
    uVar15 = uVar15 - uVar4;
  }
  *puVar2 = 0x14;
LAB_1401db7d4:
  uVar10 = *(uint *)(*(longlong *)(puVar2 + 0x18) +
                    (ulonglong)((1 << ((byte)puVar2[0x1b] & 0x1f)) - 1U & uVar23) * 4);
  for (; uVar15 < (uVar10 >> 8 & 0xff); uVar15 = uVar15 + 8) {
    uVar13 = uVar25;
    uVar10 = local_64;
    if (uVar25 == 0) goto LAB_1401dac06;
    bVar1 = *pbVar16;
    pbVar16 = pbVar16 + 1;
    uVar25 = uVar25 - 1;
    uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
    uVar10 = *(uint *)(*(longlong *)(puVar2 + 0x18) +
                      (ulonglong)((1 << ((byte)puVar2[0x1b] & 0x1f)) - 1U & uVar23) * 4);
    local_58 = pbVar16;
  }
  uVar13 = uVar10;
  if ((uVar10 & 0xf0) == 0) {
    bVar1 = (byte)(uVar10 >> 8);
    uVar13 = *(uint *)(*(longlong *)(puVar2 + 0x18) +
                      (ulonglong)
                      ((((1 << ((char)uVar10 + bVar1 & 0x1f)) - 1U & uVar23) >> (bVar1 & 0x1f)) +
                      (uVar10 >> 0x10)) * 4);
    uVar4 = (uVar13 >> 8 & 0xff) + (uVar10 >> 8 & 0xff);
    for (; uVar15 < uVar4; uVar15 = uVar15 + 8) {
      uVar13 = uVar25;
      if (uVar25 == 0) goto LAB_1401dac06;
      uVar23 = uVar23 + ((uint)*pbVar16 << ((byte)uVar15 & 0x1f));
      pbVar16 = pbVar16 + 1;
      uVar25 = uVar25 - 1;
      uVar13 = *(uint *)(*(longlong *)(puVar2 + 0x18) +
                        (ulonglong)
                        ((((1 << ((char)uVar10 + bVar1 & 0x1f)) - 1U & uVar23) >> (bVar1 & 0x1f)) +
                        (uVar10 >> 0x10)) * 4);
      uVar4 = (uVar13 >> 8 & 0xff) + (uint)bVar1;
      local_58 = pbVar16;
    }
    uVar23 = uVar23 >> (bVar1 & 0x1f);
    uVar15 = uVar15 - bVar1;
    local_64 = uVar10;
  }
  uVar17 = (ulonglong)local_res20;
  uVar14 = (ulonglong)local_res18;
  uVar23 = uVar23 >> ((byte)(uVar13 >> 8) & 0x1f);
  uVar15 = uVar15 - (uVar13 >> 8 & 0xff);
  if ((uVar13 & 0x40) != 0) {
    param_1[4] = (longlong)"invalid distance code";
    *puVar2 = 0x1b;
    goto LAB_1401db0b8;
  }
  *puVar2 = 0x15;
  puVar2[0x13] = uVar13 >> 0x10;
  uVar21 = 0;
  puVar2[0x14] = uVar13 & 0xf;
  puVar19 = local_50;
LAB_1401db940:
  uVar24 = (uint)uVar14;
  uVar4 = puVar2[0x14];
  if (uVar4 != 0) {
    if (uVar15 < uVar4) {
      do {
        uVar13 = 0;
        uVar10 = local_64;
        if (uVar25 == 0) goto LAB_1401dac06;
        bVar1 = *pbVar16;
        pbVar16 = pbVar16 + 1;
        bVar7 = (byte)uVar15;
        uVar15 = uVar15 + 8;
        uVar25 = uVar25 - 1;
        uVar23 = uVar23 + ((uint)bVar1 << (bVar7 & 0x1f));
        local_58 = pbVar16;
      } while (uVar15 < puVar2[0x14]);
    }
    uVar13 = (1 << ((byte)uVar4 & 0x1f)) - 1U & uVar23;
    uVar23 = uVar23 >> ((byte)uVar4 & 0x1f);
    puVar2[0x13] = puVar2[0x13] + uVar13;
    uVar15 = uVar15 - uVar4;
  }
  if ((puVar2[0xc] - uVar24) + (int)uVar17 < puVar2[0x13]) {
    pcVar6 = "invalid distance too far back";
    goto LAB_1401dad46;
  }
  *puVar2 = 0x16;
LAB_1401db9a8:
  uVar13 = uVar25;
  uVar10 = local_64;
  if (uVar24 == 0) goto LAB_1401dac06;
  uVar4 = puVar2[0x13];
  uVar13 = (int)uVar17 - uVar24;
  if (uVar13 < uVar4) {
    uVar4 = uVar4 - uVar13;
    uVar10 = puVar2[0xd];
    if (uVar10 < uVar4) {
      uVar4 = uVar4 - uVar10;
      uVar10 = puVar2[0xb] - uVar4;
    }
    else {
      uVar10 = uVar10 - uVar4;
    }
    uVar13 = puVar2[0x12];
    lVar12 = (ulonglong)uVar10 + *(longlong *)(puVar2 + 0xe);
    if (uVar4 <= uVar13) goto LAB_1401db9f8;
  }
  else {
    lVar12 = (longlong)puVar19 - (ulonglong)uVar4;
    uVar13 = puVar2[0x12];
  }
  uVar4 = uVar13;
  uVar13 = uVar4;
LAB_1401db9f8:
  if (uVar24 < uVar4) {
    uVar4 = uVar24;
  }
  local_res18 = uVar24 - uVar4;
  uVar14 = (ulonglong)local_res18;
  lVar12 = lVar12 - (longlong)puVar19;
  puVar2[0x12] = uVar13 - uVar4;
  do {
    uVar13 = uVar4;
    *puVar19 = puVar19[lVar12];
    puVar19 = puVar19 + 1;
    uVar4 = uVar13 - 1;
  } while (uVar13 - 1 != 0);
  uVar11 = (ulonglong)(uVar13 + 0xf);
  uVar13 = uVar13 + 6;
  local_50 = puVar19;
  if (puVar2[0x12] == (uint)uVar21) {
    *puVar2 = 0x12;
  }
  goto LAB_1401da7b0;
LAB_1401dbaa0:
  if (0x1f < uVar15) goto code_r0x0001401dbaa5;
  uVar13 = uVar25;
  if (uVar25 == 0) goto LAB_1401dac06;
  bVar1 = *pbVar16;
  pbVar16 = pbVar16 + 1;
  uVar25 = uVar25 - 1;
  uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
  uVar15 = uVar15 + 8;
  local_58 = pbVar16;
  goto LAB_1401dbaa0;
code_r0x0001401dbaa5:
  uVar24 = (int)uVar17 - uVar24;
  *(int *)((longlong)param_1 + 0x1c) = *(int *)((longlong)param_1 + 0x1c) + uVar24;
  puVar2[7] = puVar2[7] + uVar24;
  if (uVar24 != 0) {
    if (puVar2[4] == uVar20) {
      uVar13 = FUN_1401deccc(puVar2[6],(longlong)puVar19 - (ulonglong)uVar24);
    }
    else {
      uVar13 = FUN_1401df858();
    }
    uVar14 = (ulonglong)local_res18;
    uVar21 = 0;
    puVar2[6] = uVar13;
    uVar11 = 0x10;
    *(uint *)((longlong)param_1 + 0x4c) = uVar13;
    puVar19 = local_50;
  }
  local_res20 = (uint)uVar14;
  uVar17 = uVar14 & 0xffffffff;
  uVar13 = (uint)uVar21;
  uVar10 = ((uVar23 & 0xff00) + uVar23 * 0x10000) * 0x100 + (uVar23 >> 8 & 0xff00) +
           (uVar23 >> 0x18);
  if (puVar2[4] != uVar13) {
    uVar10 = uVar23;
  }
  uVar4 = uVar13;
  if (uVar10 == puVar2[6]) {
LAB_1401dbb38:
    uVar15 = uVar4;
    uVar23 = uVar13;
    *puVar2 = 0x19;
LAB_1401dbb3e:
    uVar24 = (uint)uVar21;
    uVar13 = uVar23;
    uVar4 = uVar15;
    if ((puVar2[2] != uVar24) && (puVar2[4] != uVar24)) {
      for (; uVar15 < 0x20; uVar15 = uVar15 + 8) {
        uVar13 = uVar25;
        uVar10 = local_64;
        if (uVar25 == 0) goto LAB_1401dac06;
        bVar1 = *pbVar16;
        pbVar16 = pbVar16 + 1;
        uVar25 = uVar25 - 1;
        uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
        local_58 = pbVar16;
      }
      uVar13 = uVar24;
      uVar4 = uVar24;
      if (uVar23 != puVar2[7]) {
        pcVar6 = "incorrect length check";
        goto LAB_1401dadb0;
      }
    }
    uVar15 = uVar4;
    uVar23 = uVar13;
    *puVar2 = 0x1a;
LAB_1401dbbe4:
    local_res8 = 1;
    uVar13 = uVar25;
    uVar10 = local_64;
LAB_1401dac06:
    local_64 = uVar10;
    *(uint *)(param_1 + 1) = uVar13;
    param_1[2] = (longlong)local_50;
    *(uint *)(param_1 + 3) = local_res18;
    *param_1 = (longlong)local_58;
    puVar2[0x10] = uVar23;
    iVar22 = 0;
    puVar2[0x11] = uVar15;
    if (((puVar2[0xb] != 0) || (((int)*puVar2 < 0x18 && (local_res20 != *(uint *)(param_1 + 3)))))
       && (iVar5 = FUN_1401da608(param_1,local_res20), iVar5 != 0)) {
      *puVar2 = 0x1c;
      return -4;
    }
    local_res20 = local_res20 - (int)param_1[3];
    iVar5 = local_60 - (int)param_1[1];
    *(int *)((longlong)param_1 + 0x1c) = *(int *)((longlong)param_1 + 0x1c) + local_res20;
    *(int *)((longlong)param_1 + 0xc) = *(int *)((longlong)param_1 + 0xc) + iVar5;
    puVar2[7] = puVar2[7] + local_res20;
    if ((puVar2[2] != 0) && (local_res20 != 0)) {
      if (puVar2[4] == 0) {
        uVar25 = FUN_1401deccc(puVar2[6],param_1[2] - (ulonglong)local_res20,local_res20);
      }
      else {
        uVar25 = FUN_1401df858();
      }
      puVar2[6] = uVar25;
      *(uint *)((longlong)param_1 + 0x4c) = uVar25;
    }
    if (*puVar2 == 0xb) {
      iVar22 = 0x80;
    }
    *(uint *)(param_1 + 9) = (-(uint)(puVar2[1] != 0) & 0x40) + iVar22 + puVar2[0x11];
    if (((iVar5 != 0) || (local_res20 != 0)) && (param_2 != 4)) {
      return local_res8;
    }
    if (local_res8 == 0) {
      return -5;
    }
    return local_res8;
  }
  pcVar6 = "incorrect data check";
  goto LAB_1401dadb0;
LAB_1401dac92:
  uVar23 = uVar4;
  if (uVar9 <= uVar15) goto code_r0x0001401dac96;
  uVar13 = uVar25;
  if (uVar25 == 0) goto LAB_1401dac06;
  bVar1 = *pbVar16;
  pbVar16 = pbVar16 + 1;
  uVar25 = uVar25 - 1;
  uVar4 = uVar4 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
  uVar15 = uVar15 + 8;
  local_58 = pbVar16;
  goto LAB_1401dac92;
code_r0x0001401dac96:
  if (((puVar2[2] & 2) != 0) && (uVar4 == 0x8b1f)) {
    uVar23 = FUN_1401df858(0,0,0);
    puVar2[6] = uVar23;
    local_68 = 0x8b1f;
    uVar23 = FUN_1401df858(puVar2[6],&local_68,2);
    *puVar2 = 1;
    puVar2[6] = uVar23;
LAB_1401dacd4:
    uVar23 = 0;
    uVar15 = uVar23;
LAB_1401dacdd:
    uVar21 = 0;
    puVar19 = local_50;
LAB_1401dace1:
    uVar17 = (ulonglong)local_res20;
    uVar14 = (ulonglong)local_res18;
LAB_1401dace9:
    uVar11 = 0x10;
    goto LAB_1401da7ab;
  }
  puVar2[4] = uVar20;
  if (*(longlong *)(puVar2 + 8) != 0) {
    *(undefined4 *)(*(longlong *)(puVar2 + 8) + 0x40) = 0xffffffff;
  }
  if ((puVar2[2] & 1) != 0) {
    uVar13 = (uVar4 & 0xff) * 0x100 + (uVar4 >> 8);
    if (uVar13 == (uVar13 / 0x1f) * 0x1f) {
      if (((byte)uVar4 & 0xf) == 8) {
        uVar23 = uVar4 >> 4;
        uVar15 = uVar15 - 4;
        uVar13 = (uVar23 & 0xf) + 8;
        if (uVar13 <= puVar2[10]) {
          puVar2[5] = 1 << (sbyte)uVar13;
          uVar23 = FUN_1401deccc(0,0,0);
          puVar2[6] = uVar23;
          *(uint *)((longlong)param_1 + 0x4c) = uVar23;
          *puVar2 = ~(uVar4 >> 0xc) & 2 | 9;
          goto LAB_1401dacd4;
        }
        pcVar6 = "invalid window size";
      }
      else {
        pcVar6 = "unknown compression method";
      }
LAB_1401dad46:
      param_1[4] = (longlong)pcVar6;
      *puVar2 = 0x1b;
      goto LAB_1401dace9;
    }
    uVar11 = 0x10;
  }
  pcVar6 = "incorrect header check";
  goto LAB_1401dadb0;
LAB_1401da83b:
  if (uVar9 <= uVar15) goto code_r0x0001401da83f;
  uVar13 = uVar25;
  if (uVar25 == 0) goto LAB_1401dac06;
  bVar1 = *pbVar16;
  pbVar16 = pbVar16 + 1;
  uVar25 = uVar25 - 1;
  uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
  uVar15 = uVar15 + 8;
  local_58 = pbVar16;
  goto LAB_1401da83b;
code_r0x0001401da83f:
  puVar2[4] = uVar23;
  if ((char)uVar23 == '\b') {
    if ((uVar23 & 0xe000) == 0) {
      if (*(uint **)(puVar2 + 8) != (uint *)0x0) {
        **(uint **)(puVar2 + 8) = uVar23 >> 8 & 1;
      }
      if ((puVar2[4] & 0x200) != 0) {
        local_68 = (undefined2)uVar23;
        uVar23 = FUN_1401df858(puVar2[6],&local_68,2);
        uVar21 = 0;
        puVar2[6] = uVar23;
      }
      uVar23 = (uint)uVar21;
      *puVar2 = 2;
      uVar15 = uVar23;
LAB_1401da8db:
      do {
        if (0x1f < uVar15) goto code_r0x0001401da8e0;
        uVar13 = uVar25;
        uVar10 = local_64;
        if (uVar25 == 0) goto LAB_1401dac06;
        bVar1 = *pbVar16;
        pbVar16 = pbVar16 + 1;
        uVar25 = uVar25 - 1;
        uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
        uVar15 = uVar15 + 8;
        local_58 = pbVar16;
      } while( true );
    }
    pcVar6 = "unknown header flags set";
  }
  else {
    pcVar6 = "unknown compression method";
  }
LAB_1401dadb0:
  param_1[4] = (longlong)pcVar6;
  *puVar2 = 0x1b;
  goto LAB_1401da7ab;
code_r0x0001401da8e0:
  if (*(longlong *)(puVar2 + 8) != 0) {
    *(uint *)(*(longlong *)(puVar2 + 8) + 4) = uVar23;
  }
  if ((puVar2[4] & 0x200) != 0) {
    local_68 = (undefined2)uVar23;
    local_65 = (undefined1)(uVar23 >> 0x18);
    local_66 = (undefined1)(uVar23 >> 0x10);
    uVar23 = FUN_1401df858(puVar2[6],&local_68,4);
    uVar21 = 0;
    puVar2[6] = uVar23;
  }
  uVar23 = (uint)uVar21;
  *puVar2 = 3;
  uVar11 = 0x10;
  uVar15 = uVar23;
LAB_1401da961:
  do {
    uVar9 = (uint)uVar11;
    if (uVar9 <= uVar15) break;
    uVar13 = uVar25;
    uVar10 = local_64;
    if (uVar25 == 0) goto LAB_1401dac06;
    bVar1 = *pbVar16;
    pbVar16 = pbVar16 + 1;
    uVar25 = uVar25 - 1;
    uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
    uVar15 = uVar15 + 8;
    local_58 = pbVar16;
  } while( true );
  if (*(longlong *)(puVar2 + 8) != 0) {
    *(uint *)(*(longlong *)(puVar2 + 8) + 8) = uVar23 & 0xff;
    *(uint *)(*(longlong *)(puVar2 + 8) + 0xc) = uVar23 >> 8;
  }
  if ((puVar2[4] & 0x200) != 0) {
    local_68 = (undefined2)uVar23;
    uVar23 = FUN_1401df858(puVar2[6],&local_68,2);
    uVar21 = 0;
    puVar2[6] = uVar23;
    uVar9 = 0x10;
  }
  uVar23 = (uint)uVar21;
  *puVar2 = 4;
  uVar15 = uVar23;
LAB_1401da9bf:
  if ((puVar2[4] & 0x400) == 0) {
    if (*(longlong *)(puVar2 + 8) != 0) {
      *(ulonglong *)(*(longlong *)(puVar2 + 8) + 0x10) = uVar21;
    }
  }
  else {
    for (; uVar15 < uVar9; uVar15 = uVar15 + 8) {
      uVar13 = uVar25;
      uVar10 = local_64;
      if (uVar25 == 0) goto LAB_1401dac06;
      bVar1 = *pbVar16;
      pbVar16 = pbVar16 + 1;
      uVar25 = uVar25 - 1;
      uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
      local_58 = pbVar16;
    }
    puVar2[0x12] = uVar23;
    if (*(longlong *)(puVar2 + 8) != 0) {
      *(uint *)(*(longlong *)(puVar2 + 8) + 0x18) = uVar23;
    }
    if ((puVar2[4] & 0x200) != 0) {
      local_68 = (undefined2)uVar23;
      uVar23 = FUN_1401df858(puVar2[6],&local_68,2);
      uVar21 = 0;
      puVar2[6] = uVar23;
    }
    uVar23 = (uint)uVar21;
    uVar15 = uVar23;
  }
  *puVar2 = 5;
LAB_1401da9df:
  if ((puVar2[4] & 0x400) != 0) {
    uVar13 = puVar2[0x12];
    if (uVar25 < puVar2[0x12]) {
      uVar13 = uVar25;
    }
    if (uVar13 != 0) {
      lVar12 = *(longlong *)(puVar2 + 8);
      if ((lVar12 != 0) && (*(longlong *)(lVar12 + 0x10) != 0)) {
        uVar10 = *(int *)(lVar12 + 0x18) - puVar2[0x12];
        uVar4 = uVar13;
        if (*(uint *)(lVar12 + 0x1c) < uVar13 + uVar10) {
          uVar4 = *(uint *)(lVar12 + 0x1c) - uVar10;
        }
        memcpy((void *)((ulonglong)uVar10 + *(longlong *)(lVar12 + 0x10)),pbVar16,(ulonglong)uVar4);
      }
      if ((puVar2[4] & 0x200) != 0) {
        uVar4 = FUN_1401df858(puVar2[6],pbVar16,uVar13);
        puVar2[6] = uVar4;
      }
      puVar2[0x12] = puVar2[0x12] - uVar13;
      uVar25 = uVar25 - uVar13;
      pbVar16 = pbVar16 + uVar13;
      uVar21 = 0;
      local_58 = pbVar16;
    }
    uVar13 = uVar25;
    uVar10 = local_64;
    if (puVar2[0x12] != (uint)uVar21) goto LAB_1401dac06;
  }
  puVar2[0x12] = (uint)uVar21;
  *puVar2 = 6;
LAB_1401daaed:
  if ((puVar2[4] & 0x800) == 0) {
    if (*(longlong *)(puVar2 + 8) != 0) {
      *(ulonglong *)(*(longlong *)(puVar2 + 8) + 0x20) = uVar21;
    }
  }
  else {
    uVar13 = uVar25;
    uVar10 = local_64;
    if (uVar25 == 0) goto LAB_1401dac06;
    uVar14 = uVar21 & 0xffffffff;
    do {
      lVar12 = *(longlong *)(puVar2 + 8);
      bVar1 = *pbVar16;
      uVar13 = (int)uVar14 + 1;
      uVar14 = (ulonglong)uVar13;
      pbVar16 = pbVar16 + 1;
      if (((lVar12 != 0) && (*(longlong *)(lVar12 + 0x20) != 0)) &&
         (puVar2[0x12] < *(uint *)(lVar12 + 0x28))) {
        *(byte *)((ulonglong)puVar2[0x12] + *(longlong *)(lVar12 + 0x20)) = bVar1;
        puVar2[0x12] = puVar2[0x12] + 1;
      }
    } while ((bVar1 != 0) && (uVar13 < uVar25));
    if ((puVar2[4] & 0x200) != 0) {
      uVar4 = FUN_1401df858(puVar2[6],local_58,uVar14);
      uVar21 = 0;
      puVar2[6] = uVar4;
    }
    uVar25 = uVar25 - uVar13;
    pbVar16 = local_58 + uVar14;
    uVar13 = uVar25;
    uVar10 = local_64;
    local_58 = pbVar16;
    if (bVar1 != 0) goto LAB_1401dac06;
  }
  puVar2[0x12] = (uint)uVar21;
  *puVar2 = 7;
LAB_1401dab86:
  if ((puVar2[4] & 0x1000) == 0) {
    if (*(longlong *)(puVar2 + 8) != 0) {
      *(ulonglong *)(*(longlong *)(puVar2 + 8) + 0x30) = uVar21;
    }
  }
  else {
    uVar13 = uVar25;
    uVar10 = local_64;
    if (uVar25 == 0) goto LAB_1401dac06;
    uVar14 = uVar21 & 0xffffffff;
    do {
      lVar12 = *(longlong *)(puVar2 + 8);
      bVar1 = *pbVar16;
      uVar13 = (int)uVar14 + 1;
      uVar14 = (ulonglong)uVar13;
      pbVar16 = pbVar16 + 1;
      if (((lVar12 != 0) && (*(longlong *)(lVar12 + 0x30) != 0)) &&
         (puVar2[0x12] < *(uint *)(lVar12 + 0x38))) {
        *(byte *)((ulonglong)puVar2[0x12] + *(longlong *)(lVar12 + 0x30)) = bVar1;
        puVar2[0x12] = puVar2[0x12] + 1;
      }
    } while ((bVar1 != 0) && (uVar13 < uVar25));
    if ((puVar2[4] & 0x200) != 0) {
      uVar4 = FUN_1401df858(puVar2[6],local_58,uVar14);
      uVar21 = 0;
      puVar2[6] = uVar4;
    }
    uVar25 = uVar25 - uVar13;
    local_58 = local_58 + uVar14;
    uVar13 = uVar25;
    uVar10 = local_64;
    if (bVar1 != 0) goto LAB_1401dac06;
  }
  uVar17 = (ulonglong)local_res20;
  uVar14 = (ulonglong)local_res18;
  *puVar2 = 8;
  uVar11 = 0x10;
  puVar19 = local_50;
  pbVar16 = local_58;
LAB_1401dadea:
  if ((puVar2[4] & 0x200) != 0) {
    for (; uVar15 < (uint)uVar11; uVar15 = uVar15 + 8) {
      uVar13 = uVar25;
      uVar10 = local_64;
      if (uVar25 == 0) goto LAB_1401dac06;
      bVar1 = *pbVar16;
      pbVar16 = pbVar16 + 1;
      uVar25 = uVar25 - 1;
      uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
      local_58 = pbVar16;
    }
    if (uVar23 != (ushort)puVar2[6]) {
      pcVar6 = "header crc mismatch";
      goto LAB_1401dadb0;
    }
    uVar23 = (uint)uVar21;
    uVar15 = uVar23;
  }
  if (*(longlong *)(puVar2 + 8) != 0) {
    *(uint *)(*(longlong *)(puVar2 + 8) + 0x3c) = (int)puVar2[4] >> 9 & 1;
    *(undefined4 *)(*(longlong *)(puVar2 + 8) + 0x40) = 1;
  }
  uVar13 = FUN_1401df858(0,0,0);
  puVar2[6] = uVar13;
  *(uint *)((longlong)param_1 + 0x4c) = uVar13;
  *puVar2 = 0xb;
LAB_1401db0b8:
  uVar14 = (ulonglong)local_res18;
  uVar17 = (ulonglong)local_res20;
  uVar21 = 0;
  puVar19 = local_50;
  goto LAB_1401dace9;
LAB_1401dafce:
  if (2 < uVar15) goto code_r0x0001401dafd3;
  uVar13 = uVar25;
  uVar10 = local_64;
  if (uVar25 == 0) goto LAB_1401dac06;
  bVar1 = *pbVar16;
  pbVar16 = pbVar16 + 1;
  uVar25 = uVar25 - 1;
  uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
  uVar15 = uVar15 + 8;
  local_58 = pbVar16;
  goto LAB_1401dafce;
code_r0x0001401dafd3:
  puVar2[1] = uVar23 & 1;
  uVar13 = uVar23 >> 1 & 3;
  if (uVar13 == 0) {
    *puVar2 = 0xd;
  }
  else if (uVar13 == 1) {
    FUN_1401da5d8(puVar2);
    *puVar2 = 0x12;
  }
  else if (uVar13 == 2) {
    *puVar2 = 0xf;
  }
  else if (uVar13 == 3) {
    param_1[4] = (longlong)"invalid block type";
    *puVar2 = 0x1b;
  }
  uVar23 = uVar23 >> 3;
  uVar15 = uVar15 - 3;
  goto LAB_1401da7ab;
}



undefined8 FUN_1401dbc88(longlong param_1)

{
  undefined8 uVar1;
  
  if (((param_1 == 0) || (*(longlong *)(param_1 + 0x28) == 0)) ||
     (*(code **)(param_1 + 0x38) == (code *)0x0)) {
    uVar1 = 0xfffffffe;
  }
  else {
    if (*(longlong *)(*(longlong *)(param_1 + 0x28) + 0x38) != 0) {
      (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40));
    }
    (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40),*(undefined8 *)(param_1 + 0x28));
    *(undefined8 *)(param_1 + 0x28) = 0;
    uVar1 = 0;
  }
  return uVar1;
}



undefined8 FUN_1401dbce8(longlong param_1,void *param_2,uint param_3)

{
  int *piVar1;
  undefined4 uVar2;
  int iVar3;
  undefined8 uVar4;
  ulonglong _Size;
  
  _Size = (ulonglong)param_3;
  if ((param_1 == 0) || (piVar1 = *(int **)(param_1 + 0x28), piVar1 == (int *)0x0)) {
    return 0xfffffffe;
  }
  if (piVar1[2] == 0) {
    if (*piVar1 != 10) goto LAB_1401dbd62;
  }
  else if (*piVar1 != 10) {
    return 0xfffffffe;
  }
  uVar2 = FUN_1401deccc(0,0,0);
  iVar3 = FUN_1401deccc(uVar2,param_2,_Size);
  if (iVar3 != piVar1[6]) {
    return 0xfffffffd;
  }
LAB_1401dbd62:
  iVar3 = FUN_1401da608(param_1,*(undefined4 *)(param_1 + 0x18));
  if (iVar3 == 0) {
    if ((uint)piVar1[0xb] < param_3) {
      memcpy(*(void **)(piVar1 + 0xe),(void *)((_Size - (uint)piVar1[0xb]) + (longlong)param_2),
             (ulonglong)(uint)piVar1[0xb]);
      piVar1[0xc] = piVar1[0xb];
    }
    else {
      memcpy((void *)((longlong)*(void **)(piVar1 + 0xe) + ((uint)piVar1[0xb] - _Size)),param_2,
             _Size);
      piVar1[0xc] = param_3;
    }
    piVar1[3] = 1;
    uVar4 = 0;
  }
  else {
    *piVar1 = 0x1c;
    uVar4 = 0xfffffffc;
  }
  return uVar4;
}



uint FUN_1401dbe08(uint *param_1,byte *param_2,uint param_3)

{
  uint uVar1;
  uint uVar2;
  
  uVar1 = *param_1;
  uVar2 = 0;
  if (param_3 != 0) {
    do {
      if (3 < uVar1) break;
      if (*param_2 == (byte)~-(uVar1 < 2)) {
        uVar1 = uVar1 + 1;
      }
      else if (*param_2 == 0) {
        uVar1 = 4 - uVar1;
      }
      else {
        uVar1 = 0;
      }
      uVar2 = uVar2 + 1;
      param_2 = param_2 + 1;
    } while (uVar2 < param_3);
  }
  *param_1 = uVar1;
  return uVar2;
}



undefined8 FUN_1401dbe68(longlong *param_1)

{
  int *piVar1;
  undefined8 uVar2;
  uint uVar3;
  uint uVar4;
  int iVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  undefined1 *puVar8;
  undefined1 local_res8 [8];
  
  if ((param_1 == (longlong *)0x0) || (piVar1 = (int *)param_1[5], piVar1 == (int *)0x0)) {
    uVar2 = 0xfffffffe;
  }
  else if (((int)param_1[1] == 0) && ((uint)piVar1[0x11] < 8)) {
    uVar2 = 0xfffffffb;
  }
  else {
    if (*piVar1 != 0x1d) {
      iVar5 = 0;
      *piVar1 = 0x1d;
      uVar3 = piVar1[0x11] & 7;
      piVar1[0x10] = piVar1[0x10] << (sbyte)uVar3;
      uVar3 = piVar1[0x11] - uVar3;
      piVar1[0x11] = uVar3;
      if (7 < uVar3) {
        uVar4 = piVar1[0x10];
        puVar8 = local_res8;
        do {
          uVar3 = uVar3 - 8;
          uVar4 = uVar4 >> 8;
          *puVar8 = (char)piVar1[0x10];
          puVar8 = puVar8 + 1;
          iVar5 = iVar5 + 1;
          piVar1[0x10] = uVar4;
          piVar1[0x11] = uVar3;
        } while (7 < uVar3);
      }
      piVar1[0x1f] = 0;
      FUN_1401dbe08(piVar1 + 0x1f,local_res8,iVar5);
    }
    uVar3 = FUN_1401dbe08(piVar1 + 0x1f,*param_1,(int)param_1[1]);
    *(int *)((longlong)param_1 + 0xc) = *(int *)((longlong)param_1 + 0xc) + uVar3;
    *(uint *)(param_1 + 1) = (int)param_1[1] - uVar3;
    uVar7 = *(undefined4 *)((longlong)param_1 + 0xc);
    *param_1 = *param_1 + (ulonglong)uVar3;
    if (piVar1[0x1f] == 4) {
      uVar6 = *(undefined4 *)((longlong)param_1 + 0x1c);
      FUN_1401da408(param_1);
      *(undefined4 *)((longlong)param_1 + 0xc) = uVar7;
      *(undefined4 *)((longlong)param_1 + 0x1c) = uVar6;
      *piVar1 = 0xb;
      uVar2 = 0;
    }
    else {
      uVar2 = 0xfffffffd;
    }
  }
  return uVar2;
}



undefined8 FUN_1401dbf98(void *param_1,void *param_2)

{
  void *_Src;
  ulonglong uVar1;
  void *_Dst;
  void *_Dst_00;
  
  if ((((param_1 != (void *)0x0) && (param_2 != (void *)0x0)) &&
      (_Src = *(void **)((longlong)param_2 + 0x28), _Src != (void *)0x0)) &&
     ((*(code **)((longlong)param_2 + 0x30) != (code *)0x0 &&
      (*(longlong *)((longlong)param_2 + 0x38) != 0)))) {
    _Dst = (void *)(**(code **)((longlong)param_2 + 0x30))
                             (*(undefined8 *)((longlong)param_2 + 0x40),1,0x2548);
    if (_Dst != (void *)0x0) {
      _Dst_00 = (void *)0x0;
      if ((*(longlong *)((longlong)_Src + 0x38) == 0) ||
         (_Dst_00 = (void *)(**(code **)((longlong)param_2 + 0x30))
                                      (*(undefined8 *)((longlong)param_2 + 0x40),
                                       1 << ((byte)*(undefined4 *)((longlong)_Src + 0x28) & 0x1f),1)
         , _Dst_00 != (void *)0x0)) {
        memcpy(param_1,param_2,0x58);
        memcpy(_Dst,_Src,0x2548);
        uVar1 = *(ulonglong *)((longlong)_Src + 0x58);
        if (((longlong)_Src + 0x548U <= uVar1) && (uVar1 <= (longlong)_Src + 0x2544U)) {
          *(longlong *)((longlong)_Dst + 0x58) =
               (longlong)_Dst + ((longlong)((uVar1 - (longlong)_Src) + -0x548) >> 2) * 4 + 0x548;
          *(longlong *)((longlong)_Dst + 0x60) =
               (longlong)_Dst +
               ((*(longlong *)((longlong)_Src + 0x60) - (longlong)_Src) + -0x548 >> 2) * 4 + 0x548;
        }
        *(longlong *)((longlong)_Dst + 0x80) =
             (longlong)_Dst +
             ((*(longlong *)((longlong)_Src + 0x80) - (longlong)_Src) + -0x548 >> 2) * 4 + 0x548;
        if (_Dst_00 != (void *)0x0) {
          memcpy(_Dst_00,*(void **)((longlong)_Src + 0x38),
                 (ulonglong)(uint)(1 << ((byte)*(undefined4 *)((longlong)_Src + 0x28) & 0x1f)));
        }
        *(void **)((longlong)_Dst + 0x38) = _Dst_00;
        *(void **)((longlong)param_1 + 0x28) = _Dst;
        return 0;
      }
      (**(code **)((longlong)param_2 + 0x38))(*(undefined8 *)((longlong)param_2 + 0x40),_Dst);
    }
    return 0xfffffffc;
  }
  return 0xfffffffe;
}



undefined8 FUN_1401dc11c(longlong param_1,void *param_2,uint param_3)

{
  longlong lVar1;
  longlong lVar2;
  undefined4 uVar3;
  uint uVar4;
  undefined8 uVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  
  uVar7 = 0;
  if ((((param_1 == 0) || (lVar2 = *(longlong *)(param_1 + 0x28), lVar2 == 0)) ||
      (param_2 == (void *)0x0)) ||
     ((*(int *)(lVar2 + 0x2c) == 2 ||
      ((*(int *)(lVar2 + 0x2c) == 1 && (*(int *)(lVar2 + 8) != 0x2a)))))) {
    uVar5 = 0xfffffffe;
  }
  else {
    if (*(int *)(lVar2 + 0x2c) != 0) {
      uVar3 = FUN_1401deccc(*(undefined4 *)(param_1 + 0x4c));
      *(undefined4 *)(param_1 + 0x4c) = uVar3;
    }
    if (2 < param_3) {
      uVar4 = *(int *)(lVar2 + 0x44) - 0x106;
      if (uVar4 < param_3) {
        param_2 = (void *)((longlong)param_2 + (ulonglong)(param_3 - uVar4));
        param_3 = uVar4;
      }
      memcpy(*(void **)(lVar2 + 0x50),param_2,(ulonglong)param_3);
      *(uint *)(lVar2 + 0x94) = param_3;
      *(uint *)(lVar2 + 0x84) = param_3;
      uVar4 = (uint)**(byte **)(lVar2 + 0x50);
      *(uint *)(lVar2 + 0x70) = uVar4;
      *(uint *)(lVar2 + 0x70) =
           (uVar4 << ((byte)*(undefined4 *)(lVar2 + 0x80) & 0x1f) ^
           (uint)(*(byte **)(lVar2 + 0x50))[1]) & *(uint *)(lVar2 + 0x7c);
      uVar8 = uVar7;
      do {
        lVar1 = uVar8 + 2;
        uVar6 = *(uint *)(lVar2 + 0x4c) & uVar8;
        uVar8 = uVar8 + 1;
        uVar4 = ((uint)*(byte *)(lVar1 + *(longlong *)(lVar2 + 0x50)) ^
                *(int *)(lVar2 + 0x70) << ((byte)*(undefined4 *)(lVar2 + 0x80) & 0x1f)) &
                *(uint *)(lVar2 + 0x7c);
        *(uint *)(lVar2 + 0x70) = uVar4;
        *(undefined2 *)(*(longlong *)(lVar2 + 0x60) + uVar6 * 2) =
             *(undefined2 *)(*(longlong *)(lVar2 + 0x68) + (ulonglong)uVar4 * 2);
        *(short *)(*(longlong *)(lVar2 + 0x68) + (ulonglong)*(uint *)(lVar2 + 0x70) * 2) =
             (short)uVar7;
        uVar4 = (int)uVar7 + 1;
        uVar7 = (ulonglong)uVar4;
      } while (uVar4 <= param_3 - 3);
    }
    uVar5 = 0;
  }
  return uVar5;
}



void FUN_1401dc36c(longlong param_1,undefined4 param_2)

{
  *(char *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
       (char)((uint)param_2 >> 8);
  *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
  *(char *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) = (char)param_2;
  *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
  return;
}



void FUN_1401dc39c(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  uint uVar4;
  
  uVar4 = *(uint *)(*(longlong *)(param_1 + 0x28) + 0x28);
  if (*(uint *)(param_1 + 0x18) < uVar4) {
    uVar4 = *(uint *)(param_1 + 0x18);
  }
  if (uVar4 != 0) {
    memcpy(*(void **)(param_1 + 0x10),*(void **)(*(longlong *)(param_1 + 0x28) + 0x20),
           (ulonglong)uVar4);
    *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + (ulonglong)uVar4;
    plVar1 = (longlong *)(*(longlong *)(param_1 + 0x28) + 0x20);
    *plVar1 = *plVar1 + (ulonglong)uVar4;
    *(int *)(param_1 + 0x1c) = *(int *)(param_1 + 0x1c) + uVar4;
    *(int *)(param_1 + 0x18) = *(int *)(param_1 + 0x18) - uVar4;
    piVar2 = (int *)(*(longlong *)(param_1 + 0x28) + 0x28);
    *piVar2 = *piVar2 - uVar4;
    lVar3 = *(longlong *)(param_1 + 0x28);
    if (*(int *)(lVar3 + 0x28) == 0) {
      *(undefined8 *)(lVar3 + 0x20) = *(undefined8 *)(lVar3 + 0x10);
    }
  }
  return;
}



ulonglong FUN_1401dc41c(longlong *param_1,uint param_2)

{
  byte bVar1;
  int iVar2;
  undefined8 *puVar3;
  int *piVar4;
  undefined4 uVar5;
  int iVar6;
  uint uVar7;
  uint uVar8;
  undefined1 uVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  uint uVar12;
  
  if (((param_1 == (longlong *)0x0) ||
      (puVar3 = (undefined8 *)param_1[5], puVar3 == (undefined8 *)0x0)) || (4 < param_2)) {
    return 0xfffffffe;
  }
  if (((param_1[2] == 0) || ((*param_1 == 0 && ((int)param_1[1] != 0)))) ||
     ((*(int *)(puVar3 + 1) == 0x29a && (param_2 != 4)))) {
    param_1[4] = (longlong)"stream error";
    return 0xfffffffe;
  }
  if ((int)param_1[3] == 0) {
    param_1[4] = (longlong)"buffer error";
    return 0xfffffffb;
  }
  iVar6 = *(int *)(puVar3 + 8);
  uVar12 = 1;
  *puVar3 = param_1;
  *(uint *)(puVar3 + 8) = param_2;
  if (*(int *)(puVar3 + 1) == 0x2a) {
    if (*(int *)((longlong)puVar3 + 0x2c) == 2) {
      uVar5 = FUN_1401df858(0,0,0);
      *(undefined4 *)((longlong)param_1 + 0x4c) = uVar5;
      *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) = 0x1f;
      *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
      *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) = 0x8b;
      *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
      *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) = 8;
      piVar4 = (int *)puVar3[6];
      *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
      if (piVar4 == (int *)0x0) {
        *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) = 0;
        *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) = 0;
        *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) = 0;
        *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) = 0;
        *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) = 0;
        *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        if (*(int *)((longlong)puVar3 + 0xac) == 9) {
          uVar9 = 2;
        }
        else if ((1 < *(int *)(puVar3 + 0x16)) || (uVar9 = 0, *(int *)((longlong)puVar3 + 0xac) < 2)
                ) {
          uVar9 = 4;
        }
        *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) = uVar9;
        *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) = 0xb;
        *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        *(undefined4 *)(puVar3 + 1) = 0x71;
      }
      else {
        *(byte *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
             (-(*(longlong *)(piVar4 + 0xc) != 0) & 0x10U) + (-(piVar4[0xf] != 0) & 2U) +
             (-(*(longlong *)(piVar4 + 8) != 0) & 8U) + (-(*(longlong *)(piVar4 + 4) != 0) & 4U) +
             (*piVar4 != 0);
        *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
             *(undefined1 *)(puVar3[6] + 4);
        *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
             *(undefined1 *)(puVar3[6] + 5);
        *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
             *(undefined1 *)(puVar3[6] + 6);
        *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
             *(undefined1 *)(puVar3[6] + 7);
        *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        if (*(int *)((longlong)puVar3 + 0xac) == 9) {
          uVar9 = 2;
        }
        else if ((1 < *(int *)(puVar3 + 0x16)) || (uVar9 = 0, *(int *)((longlong)puVar3 + 0xac) < 2)
                ) {
          uVar9 = 4;
        }
        *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) = uVar9;
        *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
             *(undefined1 *)(puVar3[6] + 0xc);
        *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        uVar10 = (ulonglong)*(uint *)(puVar3 + 5);
        if (*(longlong *)(puVar3[6] + 0x10) != 0) {
          *(undefined1 *)(uVar10 + puVar3[2]) = *(undefined1 *)(puVar3[6] + 0x18);
          *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
               *(undefined1 *)(puVar3[6] + 0x19);
          *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
          uVar10 = (ulonglong)*(uint *)(puVar3 + 5);
        }
        if (*(int *)(puVar3[6] + 0x3c) != 0) {
          uVar5 = FUN_1401df858(*(undefined4 *)((longlong)param_1 + 0x4c),puVar3[2],uVar10);
          *(undefined4 *)((longlong)param_1 + 0x4c) = uVar5;
        }
        *(undefined4 *)(puVar3 + 7) = 0;
        *(undefined4 *)(puVar3 + 1) = 0x45;
      }
    }
    else {
      uVar7 = 0;
      if (((*(int *)(puVar3 + 0x16) < 2) && (iVar2 = *(int *)((longlong)puVar3 + 0xac), 1 < iVar2))
         && (uVar7 = uVar12, 5 < iVar2)) {
        uVar7 = (iVar2 != 6) + 2;
      }
      uVar7 = (*(int *)(puVar3 + 9) + -8) * 0x1000 + 0x800U | uVar7 << 6;
      if (*(int *)((longlong)puVar3 + 0x94) != 0) {
        uVar7 = uVar7 | 0x20;
      }
      *(undefined4 *)(puVar3 + 1) = 0x71;
      FUN_1401dc36c(puVar3,(uVar7 / 0x1f + 1) * 0x1f);
      if (*(int *)((longlong)puVar3 + 0x94) != 0) {
        FUN_1401dc36c();
        FUN_1401dc36c();
      }
      uVar5 = FUN_1401deccc(0,0,0);
      *(undefined4 *)((longlong)param_1 + 0x4c) = uVar5;
    }
  }
  if (*(int *)(puVar3 + 1) == 0x45) {
    if (*(longlong *)(puVar3[6] + 0x10) != 0) {
      uVar7 = *(uint *)(puVar3 + 5);
      if (*(uint *)(puVar3 + 7) < (uint)*(ushort *)(puVar3[6] + 0x18)) {
        do {
          uVar8 = *(uint *)(puVar3 + 5);
          if (uVar8 == *(uint *)(puVar3 + 3)) {
            if ((*(int *)(puVar3[6] + 0x3c) != 0) && (uVar7 < uVar8)) {
              uVar5 = FUN_1401df858(*(undefined4 *)((longlong)param_1 + 0x4c),
                                    (ulonglong)uVar7 + puVar3[2],uVar8 - uVar7);
              *(undefined4 *)((longlong)param_1 + 0x4c) = uVar5;
            }
            FUN_1401dc39c(param_1);
            uVar7 = *(uint *)(puVar3 + 5);
            uVar8 = uVar7;
            if (uVar7 == *(uint *)(puVar3 + 3)) break;
          }
          *(undefined1 *)((ulonglong)uVar8 + puVar3[2]) =
               *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 7) + *(longlong *)(puVar3[6] + 0x10));
          *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
          *(int *)(puVar3 + 7) = *(int *)(puVar3 + 7) + 1;
        } while (*(uint *)(puVar3 + 7) < (uint)*(ushort *)(puVar3[6] + 0x18));
      }
      if ((*(int *)(puVar3[6] + 0x3c) != 0) && (uVar7 < *(uint *)(puVar3 + 5))) {
        uVar5 = FUN_1401df858(*(undefined4 *)((longlong)param_1 + 0x4c),(ulonglong)uVar7 + puVar3[2]
                              ,*(uint *)(puVar3 + 5) - uVar7);
        *(undefined4 *)((longlong)param_1 + 0x4c) = uVar5;
      }
      if (*(int *)(puVar3 + 7) != *(int *)(puVar3[6] + 0x18)) goto LAB_1401dc860;
      *(undefined4 *)(puVar3 + 7) = 0;
    }
    *(undefined4 *)(puVar3 + 1) = 0x49;
  }
LAB_1401dc860:
  if (*(int *)(puVar3 + 1) == 0x49) {
    if (*(longlong *)(puVar3[6] + 0x20) != 0) {
      uVar10 = (ulonglong)*(uint *)(puVar3 + 5);
      do {
        uVar7 = *(uint *)(puVar3 + 5);
        uVar11 = (ulonglong)uVar7;
        if (uVar7 == *(uint *)(puVar3 + 3)) {
          if ((*(int *)(puVar3[6] + 0x3c) != 0) && ((uint)uVar10 < uVar7)) {
            uVar5 = FUN_1401df858(*(undefined4 *)((longlong)param_1 + 0x4c),uVar10 + puVar3[2],
                                  uVar7 - (uint)uVar10);
            *(undefined4 *)((longlong)param_1 + 0x4c) = uVar5;
          }
          FUN_1401dc39c(param_1);
          uVar10 = (ulonglong)*(uint *)(puVar3 + 5);
          uVar11 = uVar10;
          uVar7 = uVar12;
          if (*(uint *)(puVar3 + 5) == *(uint *)(puVar3 + 3)) break;
        }
        bVar1 = *(byte *)(*(longlong *)(puVar3[6] + 0x20) + (ulonglong)*(uint *)(puVar3 + 7));
        *(uint *)(puVar3 + 7) = *(uint *)(puVar3 + 7) + 1;
        *(byte *)(uVar11 + puVar3[2]) = bVar1;
        *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        uVar7 = (uint)bVar1;
      } while (bVar1 != 0);
      if (*(int *)(puVar3[6] + 0x3c) != 0) {
        if ((uint)uVar10 < *(uint *)(puVar3 + 5)) {
          uVar5 = FUN_1401df858(*(undefined4 *)((longlong)param_1 + 0x4c),uVar10 + puVar3[2],
                                *(uint *)(puVar3 + 5) - (uint)uVar10);
          *(undefined4 *)((longlong)param_1 + 0x4c) = uVar5;
        }
      }
      if (uVar7 != 0) goto LAB_1401dc91e;
      *(undefined4 *)(puVar3 + 7) = 0;
    }
    *(undefined4 *)(puVar3 + 1) = 0x5b;
  }
LAB_1401dc91e:
  if (*(int *)(puVar3 + 1) == 0x5b) {
    if (*(longlong *)(puVar3[6] + 0x30) != 0) {
      uVar10 = (ulonglong)*(uint *)(puVar3 + 5);
      do {
        uVar7 = *(uint *)(puVar3 + 5);
        uVar11 = (ulonglong)uVar7;
        if (uVar7 == *(uint *)(puVar3 + 3)) {
          if ((*(int *)(puVar3[6] + 0x3c) != 0) && ((uint)uVar10 < uVar7)) {
            uVar5 = FUN_1401df858(*(undefined4 *)((longlong)param_1 + 0x4c),uVar10 + puVar3[2],
                                  uVar7 - (uint)uVar10);
            *(undefined4 *)((longlong)param_1 + 0x4c) = uVar5;
          }
          FUN_1401dc39c(param_1);
          uVar10 = (ulonglong)*(uint *)(puVar3 + 5);
          uVar11 = uVar10;
          uVar7 = uVar12;
          if (*(uint *)(puVar3 + 5) == *(uint *)(puVar3 + 3)) break;
        }
        bVar1 = *(byte *)(*(longlong *)(puVar3[6] + 0x30) + (ulonglong)*(uint *)(puVar3 + 7));
        *(uint *)(puVar3 + 7) = *(uint *)(puVar3 + 7) + 1;
        *(byte *)(uVar11 + puVar3[2]) = bVar1;
        *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        uVar7 = (uint)bVar1;
      } while (bVar1 != 0);
      if (*(int *)(puVar3[6] + 0x3c) != 0) {
        if ((uint)uVar10 < *(uint *)(puVar3 + 5)) {
          uVar5 = FUN_1401df858(*(undefined4 *)((longlong)param_1 + 0x4c),uVar10 + puVar3[2],
                                *(uint *)(puVar3 + 5) - (uint)uVar10);
          *(undefined4 *)((longlong)param_1 + 0x4c) = uVar5;
        }
      }
      if (uVar7 != 0) goto LAB_1401dc9d9;
    }
    *(undefined4 *)(puVar3 + 1) = 0x67;
  }
LAB_1401dc9d9:
  if (*(int *)(puVar3 + 1) == 0x67) {
    if (*(int *)(puVar3[6] + 0x3c) != 0) {
      if (*(uint *)(puVar3 + 3) < *(int *)(puVar3 + 5) + 2U) {
        FUN_1401dc39c(param_1);
      }
      if (*(uint *)(puVar3 + 3) < *(uint *)(puVar3 + 5) + 2) goto LAB_1401dca3d;
      *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
           *(undefined1 *)((longlong)param_1 + 0x4c);
      *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
      *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
           *(undefined1 *)((longlong)param_1 + 0x4d);
      *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
      uVar5 = FUN_1401df858(0,0,0);
      *(undefined4 *)((longlong)param_1 + 0x4c) = uVar5;
    }
    *(undefined4 *)(puVar3 + 1) = 0x71;
  }
LAB_1401dca3d:
  if (*(int *)(puVar3 + 5) == 0) {
    if ((((int)param_1[1] == 0) && ((int)param_2 <= iVar6)) && (param_2 != 4)) goto LAB_1401dca69;
LAB_1401dca79:
    if (*(int *)(puVar3 + 1) == 0x29a) {
      if ((int)param_1[1] != 0) {
LAB_1401dca69:
        param_1[4] = (longlong)"buffer error";
        return 0xfffffffb;
      }
LAB_1401dca91:
      if ((*(int *)((longlong)puVar3 + 0x9c) != 0) ||
         ((param_2 != 0 && (*(int *)(puVar3 + 1) != 0x29a)))) goto LAB_1401dcaab;
    }
    else {
      if ((int)param_1[1] == 0) goto LAB_1401dca91;
LAB_1401dcaab:
      iVar6 = (*(code *)(&PTR_FUN_14026f268)[(longlong)*(int *)((longlong)puVar3 + 0xac) * 2])
                        (puVar3);
      if ((iVar6 == 2) || (iVar6 == 3)) {
        *(undefined4 *)(puVar3 + 1) = 0x29a;
      }
      if ((iVar6 == 0) || (iVar6 == 2)) {
        if ((int)param_1[3] != 0) {
          return 0;
        }
        goto LAB_1401dca4f;
      }
      if (iVar6 == 1) {
        if (param_2 == 1) {
          FUN_1401e1048();
        }
        else {
          FUN_1401e0fa8(puVar3,0,0,0);
          if (param_2 == 3) {
            *(undefined2 *)(puVar3[0xd] + (ulonglong)(*(int *)((longlong)puVar3 + 0x74) - 1) * 2) =
                 0;
            memset((void *)puVar3[0xd],0,(ulonglong)(*(int *)((longlong)puVar3 + 0x74) - 1) * 2);
          }
        }
        FUN_1401dc39c(param_1);
        if ((int)param_1[3] == 0) goto LAB_1401dca4f;
      }
    }
    if (param_2 == 4) {
      if (0 < *(int *)((longlong)puVar3 + 0x2c)) {
        if (*(int *)((longlong)puVar3 + 0x2c) == 2) {
          *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
               *(undefined1 *)((longlong)param_1 + 0x4c);
          *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
               *(undefined1 *)((longlong)param_1 + 0x4d);
          *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
               *(undefined1 *)((longlong)param_1 + 0x4e);
          *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
               *(undefined1 *)((longlong)param_1 + 0x4f);
          *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
               *(undefined1 *)((longlong)param_1 + 0xc);
          *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
               *(undefined1 *)((longlong)param_1 + 0xd);
          *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
               *(undefined1 *)((longlong)param_1 + 0xe);
          *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(puVar3 + 5) + puVar3[2]) =
               *(undefined1 *)((longlong)param_1 + 0xf);
          *(int *)(puVar3 + 5) = *(int *)(puVar3 + 5) + 1;
        }
        else {
          FUN_1401dc36c(puVar3,*(undefined2 *)((longlong)param_1 + 0x4e));
          FUN_1401dc36c();
        }
        FUN_1401dc39c(param_1);
        if (0 < *(int *)((longlong)puVar3 + 0x2c)) {
          *(int *)((longlong)puVar3 + 0x2c) = -*(int *)((longlong)puVar3 + 0x2c);
        }
        return (ulonglong)(*(int *)(puVar3 + 5) == 0);
      }
      return 1;
    }
  }
  else {
    FUN_1401dc39c(param_1);
    if ((int)param_1[3] != 0) goto LAB_1401dca79;
LAB_1401dca4f:
    *(undefined4 *)(puVar3 + 8) = 0xffffffff;
  }
  return 0;
}



undefined8 FUN_1401dcc6c(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  uVar3 = 0;
  if (((param_1 == 0) || (lVar2 = *(longlong *)(param_1 + 0x28), lVar2 == 0)) ||
     (((iVar1 = *(int *)(lVar2 + 8), iVar1 != 0x2a &&
       (((iVar1 != 0x45 && (iVar1 != 0x49)) && (iVar1 != 0x5b)))) &&
      (((iVar1 != 0x67 && (iVar1 != 0x71)) && (iVar1 != 0x29a)))))) {
    uVar3 = 0xfffffffe;
  }
  else {
    if (*(longlong *)(lVar2 + 0x10) != 0) {
      (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40));
    }
    if (*(longlong *)(*(longlong *)(param_1 + 0x28) + 0x68) != 0) {
      (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40));
    }
    if (*(longlong *)(*(longlong *)(param_1 + 0x28) + 0x60) != 0) {
      (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40));
    }
    if (*(longlong *)(*(longlong *)(param_1 + 0x28) + 0x50) != 0) {
      (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40));
    }
    (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40),*(undefined8 *)(param_1 + 0x28));
    *(undefined8 *)(param_1 + 0x28) = 0;
    if (iVar1 == 0x71) {
      uVar3 = 0xfffffffd;
    }
  }
  return uVar3;
}



undefined8 FUN_1401dcd4c(void *param_1,void *param_2)

{
  void *_Src;
  undefined8 *_Dst;
  undefined8 uVar1;
  longlong lVar2;
  
  if (((param_2 == (void *)0x0) || (param_1 == (void *)0x0)) ||
     (_Src = *(void **)((longlong)param_2 + 0x28), _Src == (void *)0x0)) {
    uVar1 = 0xfffffffe;
  }
  else {
    memcpy(param_1,param_2,0x58);
    _Dst = (undefined8 *)
           (**(code **)((longlong)param_1 + 0x30))
                     (*(undefined8 *)((longlong)param_1 + 0x40),1,0x1718);
    if (_Dst != (undefined8 *)0x0) {
      *(undefined8 **)((longlong)param_1 + 0x28) = _Dst;
      memcpy(_Dst,_Src,0x1718);
      *_Dst = param_1;
      uVar1 = (**(code **)((longlong)param_1 + 0x30))
                        (*(undefined8 *)((longlong)param_1 + 0x40),
                         *(undefined4 *)((longlong)_Dst + 0x44),2);
      _Dst[10] = uVar1;
      uVar1 = (**(code **)((longlong)param_1 + 0x30))
                        (*(undefined8 *)((longlong)param_1 + 0x40),
                         *(undefined4 *)((longlong)_Dst + 0x44),2);
      _Dst[0xc] = uVar1;
      uVar1 = (**(code **)((longlong)param_1 + 0x30))
                        (*(undefined8 *)((longlong)param_1 + 0x40),
                         *(undefined4 *)((longlong)_Dst + 0x74),2);
      _Dst[0xd] = uVar1;
      lVar2 = (**(code **)((longlong)param_1 + 0x30))
                        (*(undefined8 *)((longlong)param_1 + 0x40),*(undefined4 *)(_Dst + 0x2de),4);
      _Dst[2] = lVar2;
      if ((((void *)_Dst[10] != (void *)0x0) && (_Dst[0xc] != 0)) &&
         ((_Dst[0xd] != 0 && (lVar2 != 0)))) {
        memcpy((void *)_Dst[10],*(void **)((longlong)_Src + 0x50),
               (ulonglong)(uint)(*(int *)((longlong)_Dst + 0x44) * 2));
        memcpy((void *)_Dst[0xc],*(void **)((longlong)_Src + 0x60),
               (ulonglong)*(uint *)((longlong)_Dst + 0x44) * 2);
        memcpy((void *)_Dst[0xd],*(void **)((longlong)_Src + 0x68),
               (ulonglong)*(uint *)((longlong)_Dst + 0x74) * 2);
        memcpy((void *)_Dst[2],*(void **)((longlong)_Src + 0x10),(ulonglong)*(uint *)(_Dst + 3));
        _Dst[4] = (*(longlong *)((longlong)_Src + 0x20) - *(longlong *)((longlong)_Src + 0x10)) +
                  _Dst[2];
        _Dst[0x2df] = lVar2 + ((ulonglong)*(uint *)(_Dst + 0x2de) & 0xfffffffffffffffe);
        _Dst[0x168] = (longlong)_Dst + 0xbc;
        _Dst[0x2dd] = _Dst[2] + (ulonglong)*(uint *)(_Dst + 0x2de) * 3;
        _Dst[0x16b] = _Dst + 0x136;
        _Dst[0x16e] = (longlong)_Dst + 0xaa4;
        return 0;
      }
      FUN_1401dcc6c(param_1);
    }
    uVar1 = 0xfffffffc;
  }
  return uVar1;
}



uint FUN_1401dcf2c(longlong *param_1,void *param_2,uint param_3)

{
  uint uVar1;
  undefined4 uVar2;
  uint uVar3;
  
  uVar1 = *(uint *)(param_1 + 1);
  uVar3 = uVar1;
  if (param_3 < uVar1) {
    uVar3 = param_3;
  }
  if (uVar3 == 0) {
    return 0;
  }
  *(uint *)(param_1 + 1) = uVar1 - uVar3;
  if (*(int *)(param_1[5] + 0x2c) == 1) {
    uVar2 = FUN_1401deccc(*(undefined4 *)((longlong)param_1 + 0x4c),*param_1,uVar3);
  }
  else {
    if (*(int *)(param_1[5] + 0x2c) != 2) goto LAB_1401dcf91;
    uVar2 = FUN_1401df858(*(undefined4 *)((longlong)param_1 + 0x4c),*param_1,uVar3);
  }
  *(undefined4 *)((longlong)param_1 + 0x4c) = uVar2;
LAB_1401dcf91:
  memcpy(param_2,(void *)*param_1,(ulonglong)uVar3);
  *param_1 = *param_1 + (ulonglong)uVar3;
  *(int *)((longlong)param_1 + 0xc) = *(int *)((longlong)param_1 + 0xc) + uVar3;
  return uVar3;
}



void FUN_1401dcfcc(longlong param_1)

{
  ushort uVar1;
  longlong lVar2;
  
  *(int *)(param_1 + 0x58) = *(int *)(param_1 + 0x44) * 2;
  *(undefined2 *)(*(longlong *)(param_1 + 0x68) + (ulonglong)(*(int *)(param_1 + 0x74) - 1) * 2) = 0
  ;
  memset(*(void **)(param_1 + 0x68),0,(ulonglong)(*(int *)(param_1 + 0x74) - 1) * 2);
  lVar2 = (longlong)*(int *)(param_1 + 0xac);
  *(uint *)(param_1 + 0xa8) = (uint)*(ushort *)(&DAT_14026f262 + lVar2 * 0x10);
  *(uint *)(param_1 + 0xb4) = (uint)*(ushort *)(&DAT_14026f260 + lVar2 * 0x10);
  *(uint *)(param_1 + 0xb8) = (uint)*(ushort *)(&DAT_14026f264 + lVar2 * 0x10);
  uVar1 = *(ushort *)(&DAT_14026f266 + lVar2 * 0x10);
  *(undefined4 *)(param_1 + 0x84) = 0;
  *(uint *)(param_1 + 0xa4) = (uint)uVar1;
  *(undefined4 *)(param_1 + 0x9c) = 0;
  *(undefined8 *)(param_1 + 0x90) = 0;
  *(undefined4 *)(param_1 + 0x70) = 0;
  *(undefined4 *)(param_1 + 0xa0) = 2;
  *(undefined4 *)(param_1 + 0x88) = 2;
  return;
}



uint FUN_1401dd07c(longlong param_1,uint param_2)

{
  char *pcVar1;
  ushort uVar2;
  uint uVar3;
  char *pcVar4;
  int iVar5;
  uint uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  uint uVar10;
  char *pcVar11;
  char *pcVar12;
  uint uVar13;
  char cVar14;
  char cVar15;
  
  uVar13 = *(uint *)(param_1 + 0x94);
  uVar10 = *(uint *)(param_1 + 0xa4);
  uVar7 = (ulonglong)(int)*(uint *)(param_1 + 0xa0);
  uVar9 = (ulonglong)param_2;
  pcVar1 = (char *)((ulonglong)uVar13 + *(longlong *)(param_1 + 0x50));
  if (*(int *)(param_1 + 0x44) - 0x106U < uVar13) {
    uVar13 = (uVar13 - *(int *)(param_1 + 0x44)) + 0x106;
  }
  else {
    uVar13 = 0;
  }
  cVar14 = pcVar1[uVar7 - 1];
  cVar15 = pcVar1[uVar7];
  if (*(uint *)(param_1 + 0xb4) <= *(uint *)(param_1 + 0xa0)) {
    uVar10 = uVar10 >> 2;
  }
  uVar3 = *(uint *)(param_1 + 0x9c);
  uVar8 = *(uint *)(param_1 + 0xb8);
  if (uVar3 < *(uint *)(param_1 + 0xb8)) {
    uVar8 = uVar3;
  }
  do {
    iVar5 = (int)uVar7;
    pcVar4 = (char *)(uVar9 + *(longlong *)(param_1 + 0x50));
    if ((((pcVar4[iVar5] == cVar15) && (pcVar4[(longlong)iVar5 + -1] == cVar14)) &&
        (*pcVar4 == *pcVar1)) && (pcVar4[1] == pcVar1[1])) {
      pcVar4 = pcVar4 + 2;
      pcVar11 = pcVar1 + 2;
      while (((((pcVar12 = pcVar11 + 1, *pcVar12 == pcVar4[1] &&
                (pcVar12 = pcVar11 + 2, *pcVar12 == pcVar4[2])) &&
               ((pcVar12 = pcVar11 + 3, *pcVar12 == pcVar4[3] &&
                ((pcVar12 = pcVar11 + 4, *pcVar12 == pcVar4[4] &&
                 (pcVar12 = pcVar11 + 5, *pcVar12 == pcVar4[5])))))) &&
              (pcVar12 = pcVar11 + 6, *pcVar12 == pcVar4[6])) &&
             (pcVar12 = pcVar11 + 7, *pcVar12 == pcVar4[7]))) {
        pcVar4 = pcVar4 + 8;
        pcVar12 = pcVar11 + 8;
        if ((*pcVar12 != *pcVar4) || (pcVar11 = pcVar12, pcVar1 + 0x102 <= pcVar12)) break;
      }
      uVar6 = ((int)pcVar12 - (int)(pcVar1 + 0x102)) + 0x102;
      if (iVar5 < (int)uVar6) {
        *(int *)(param_1 + 0x98) = (int)uVar9;
        uVar7 = (ulonglong)uVar6;
        if ((int)uVar8 <= (int)uVar6) {
LAB_1401dd1eb:
          if (uVar6 <= uVar3) {
            uVar3 = uVar6;
          }
          return uVar3;
        }
        cVar14 = pcVar1[(longlong)(int)uVar6 + -1];
        cVar15 = pcVar1[(int)uVar6];
      }
    }
    uVar6 = (uint)uVar7;
    uVar2 = *(ushort *)(*(longlong *)(param_1 + 0x60) + (*(uint *)(param_1 + 0x4c) & uVar9) * 2);
    uVar9 = (ulonglong)uVar2;
    if ((uVar2 <= uVar13) || (uVar10 = uVar10 - 1, uVar10 == 0)) goto LAB_1401dd1eb;
  } while( true );
}



uint FUN_1401dd21c(longlong param_1,uint param_2)

{
  uint uVar1;
  uint uVar2;
  char *pcVar3;
  char *pcVar4;
  char *pcVar5;
  char *pcVar6;
  
  pcVar3 = (char *)((ulonglong)*(uint *)(param_1 + 0x94) + *(longlong *)(param_1 + 0x50));
  pcVar6 = (char *)((ulonglong)param_2 + *(longlong *)(param_1 + 0x50));
  if ((*pcVar6 == *pcVar3) && (pcVar6[1] == pcVar3[1])) {
    pcVar6 = pcVar6 + 2;
    pcVar4 = pcVar3 + 2;
    while (((((pcVar5 = pcVar4 + 1, *pcVar5 == pcVar6[1] &&
              (pcVar5 = pcVar4 + 2, *pcVar5 == pcVar6[2])) &&
             (pcVar5 = pcVar4 + 3, *pcVar5 == pcVar6[3])) &&
            ((pcVar5 = pcVar4 + 4, *pcVar5 == pcVar6[4] &&
             (pcVar5 = pcVar4 + 5, *pcVar5 == pcVar6[5])))) &&
           ((pcVar5 = pcVar4 + 6, *pcVar5 == pcVar6[6] &&
            (pcVar5 = pcVar4 + 7, *pcVar5 == pcVar6[7]))))) {
      pcVar6 = pcVar6 + 8;
      pcVar5 = pcVar4 + 8;
      if ((*pcVar5 != *pcVar6) || (pcVar4 = pcVar5, pcVar3 + 0x102 <= pcVar5)) break;
    }
    uVar2 = ((int)pcVar5 - (int)(pcVar3 + 0x102)) + 0x102;
    if (2 < (int)uVar2) {
      *(uint *)(param_1 + 0x98) = param_2;
      uVar1 = *(uint *)(param_1 + 0x9c);
      if (uVar2 <= *(uint *)(param_1 + 0x9c)) {
        uVar1 = uVar2;
      }
      return uVar1;
    }
  }
  return 2;
}



void FUN_1401dd30c(longlong *param_1)

{
  uint uVar1;
  ushort uVar2;
  int iVar3;
  ulonglong _Size;
  ushort *puVar4;
  uint uVar5;
  ulonglong uVar6;
  
  uVar1 = *(uint *)((longlong)param_1 + 0x44);
  _Size = (ulonglong)uVar1;
  while( true ) {
    iVar3 = ((int)param_1[0xb] - *(int *)((longlong)param_1 + 0x9c)) -
            *(uint *)((longlong)param_1 + 0x94);
    if ((uVar1 - 0x106) + *(int *)((longlong)param_1 + 0x44) <= *(uint *)((longlong)param_1 + 0x94))
    {
      memcpy((void *)param_1[10],(void *)(param_1[10] + _Size),_Size);
      uVar6 = (ulonglong)*(uint *)((longlong)param_1 + 0x74);
      *(uint *)(param_1 + 0x13) = (int)param_1[0x13] - uVar1;
      *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) - uVar1;
      *(int *)((longlong)param_1 + 0x84) = *(int *)((longlong)param_1 + 0x84) - uVar1;
      puVar4 = (ushort *)(param_1[0xd] + uVar6 * 2);
      do {
        puVar4 = puVar4 + -1;
        uVar2 = 0;
        if (uVar1 <= *puVar4) {
          uVar2 = *puVar4 - (short)uVar1;
        }
        uVar5 = (int)uVar6 - 1;
        uVar6 = (ulonglong)uVar5;
        *puVar4 = uVar2;
      } while (uVar5 != 0);
      puVar4 = (ushort *)(param_1[0xc] + _Size * 2);
      uVar5 = uVar1;
      do {
        puVar4 = puVar4 + -1;
        uVar2 = 0;
        if (uVar1 <= *puVar4) {
          uVar2 = *puVar4 - (short)uVar1;
        }
        uVar5 = uVar5 - 1;
        *puVar4 = uVar2;
      } while (uVar5 != 0);
      iVar3 = iVar3 + uVar1;
    }
    if (*(int *)(*param_1 + 8) == 0) break;
    iVar3 = FUN_1401dcf2c(*param_1,(ulonglong)*(uint *)((longlong)param_1 + 0x9c) +
                                   (ulonglong)*(uint *)((longlong)param_1 + 0x94) + param_1[10],
                          iVar3);
    *(int *)((longlong)param_1 + 0x9c) = *(int *)((longlong)param_1 + 0x9c) + iVar3;
    if (2 < *(uint *)((longlong)param_1 + 0x9c)) {
      uVar5 = (uint)*(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x94) + param_1[10]);
      *(uint *)(param_1 + 0xe) = uVar5;
      *(uint *)(param_1 + 0xe) =
           (uVar5 << ((byte)(int)param_1[0x10] & 0x1f) ^
           (uint)*(byte *)((ulonglong)(*(uint *)((longlong)param_1 + 0x94) + 1) + param_1[10])) &
           *(uint *)((longlong)param_1 + 0x7c);
    }
    if (0x105 < *(uint *)((longlong)param_1 + 0x9c)) {
      return;
    }
    if (*(int *)(*param_1 + 8) == 0) {
      return;
    }
  }
  return;
}



undefined4 FUN_1401dd45c(longlong *param_1,int param_2)

{
  int *piVar1;
  uint uVar2;
  uint uVar3;
  longlong lVar4;
  longlong lVar5;
  undefined4 uVar6;
  uint uVar7;
  uint uVar8;
  
  uVar3 = (int)param_1[3] - 5;
  uVar2 = 0xffff;
  if (uVar3 < 0xffff) {
    uVar2 = uVar3;
  }
  lVar5 = 0;
  do {
    uVar3 = *(uint *)((longlong)param_1 + 0x9c);
    uVar6 = 1;
    if (uVar3 < 2) {
      FUN_1401dd30c(param_1);
      uVar3 = *(uint *)((longlong)param_1 + 0x9c);
      if (uVar3 == 0) {
        if (param_2 == 0) {
          return 0;
        }
        uVar2 = *(uint *)((longlong)param_1 + 0x84);
        if (-1 < (int)uVar2) {
          lVar5 = (ulonglong)uVar2 + param_1[10];
        }
        FUN_1401e1268(param_1,lVar5,*(int *)((longlong)param_1 + 0x94) - uVar2,param_2 == 4);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1401dc39c(*param_1);
        if (*(int *)(*param_1 + 0x18) != 0) {
          if (param_2 == 4) {
            uVar6 = 3;
          }
          return uVar6;
        }
        if (param_2 == 4) {
          return 2;
        }
        return 0;
      }
    }
    uVar8 = *(uint *)((longlong)param_1 + 0x84);
    piVar1 = (int *)((longlong)param_1 + 0x94);
    *piVar1 = *piVar1 + uVar3;
    uVar3 = *(uint *)((longlong)param_1 + 0x94);
    uVar7 = uVar8 + uVar2;
    *(undefined4 *)((longlong)param_1 + 0x9c) = 0;
    if ((*piVar1 == 0) || (uVar7 <= uVar3)) {
      *(uint *)((longlong)param_1 + 0x94) = uVar7;
      *(uint *)((longlong)param_1 + 0x9c) = uVar3 - uVar7;
      lVar4 = lVar5;
      if (-1 < (int)uVar8) {
        lVar4 = (ulonglong)uVar8 + param_1[10];
      }
      FUN_1401e1268(param_1,lVar4,uVar7 - uVar8,0);
      *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
      FUN_1401dc39c(*param_1);
      if (*(int *)(*param_1 + 0x18) == 0) {
        return 0;
      }
    }
    uVar3 = *(uint *)((longlong)param_1 + 0x84);
    uVar8 = *(int *)((longlong)param_1 + 0x94) - uVar3;
    if (*(int *)((longlong)param_1 + 0x44) - 0x106U <= uVar8) {
      lVar4 = lVar5;
      if (-1 < (int)uVar3) {
        lVar4 = (ulonglong)uVar3 + param_1[10];
      }
      FUN_1401e1268(param_1,lVar4,uVar8,0);
      *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
      FUN_1401dc39c(*param_1);
      if (*(int *)(*param_1 + 0x18) == 0) {
        return 0;
      }
    }
  } while( true );
}



undefined4 FUN_1401dd61c(longlong *param_1,int param_2)

{
  longlong *plVar1;
  short *psVar2;
  longlong lVar3;
  undefined4 uVar4;
  byte bVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  short sVar9;
  ushort uVar10;
  uint uVar11;
  bool bVar12;
  
  uVar7 = 0;
  uVar8 = uVar7;
  do {
    uVar11 = *(uint *)((longlong)param_1 + 0x9c);
    if (uVar11 < 0x106) {
      FUN_1401dd30c(param_1);
      uVar11 = *(uint *)((longlong)param_1 + 0x9c);
      if ((uVar11 < 0x106) && (param_2 == 0)) {
        return 0;
      }
      if (uVar11 == 0) {
        uVar11 = *(uint *)((longlong)param_1 + 0x84);
        if (-1 < (int)uVar11) {
          uVar7 = (ulonglong)uVar11 + param_1[10];
        }
        FUN_1401e1268(param_1,uVar7,*(int *)((longlong)param_1 + 0x94) - uVar11,param_2 == 4);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1401dc39c(*param_1);
        if (*(int *)(*param_1 + 0x18) != 0) {
          uVar4 = 1;
          if (param_2 == 4) {
            uVar4 = 3;
          }
          return uVar4;
        }
        if (param_2 == 4) {
          return 2;
        }
        return 0;
      }
    }
    if (2 < uVar11) {
      uVar11 = ((uint)*(byte *)((ulonglong)(*(uint *)((longlong)param_1 + 0x94) + 2) + param_1[10])
               ^ (int)param_1[0xe] << ((byte)(int)param_1[0x10] & 0x1f)) &
               *(uint *)((longlong)param_1 + 0x7c);
      *(uint *)(param_1 + 0xe) = uVar11;
      *(undefined2 *)
       (param_1[0xc] +
       (ulonglong)(*(uint *)((longlong)param_1 + 0x94) & *(uint *)((longlong)param_1 + 0x4c)) * 2) =
           *(undefined2 *)(param_1[0xd] + (ulonglong)uVar11 * 2);
      uVar8 = (ulonglong)
              *(ushort *)
               (param_1[0xc] +
               (ulonglong)
               (*(uint *)((longlong)param_1 + 0x94) & *(uint *)((longlong)param_1 + 0x4c)) * 2);
      *(undefined2 *)(param_1[0xd] + (ulonglong)*(uint *)(param_1 + 0xe) * 2) =
           *(undefined2 *)((longlong)param_1 + 0x94);
    }
    if ((((int)uVar8 != 0) &&
        (uVar11 = *(int *)((longlong)param_1 + 0x94) - (int)uVar8,
        uVar11 <= *(int *)((longlong)param_1 + 0x44) - 0x106U)) && ((int)param_1[0x16] != 2)) {
      if ((int)param_1[0x16] == 3) {
        if (uVar11 != 1) goto LAB_1401dd74a;
        uVar4 = FUN_1401dd21c(param_1,uVar8);
      }
      else {
        uVar4 = FUN_1401dd07c(param_1,uVar8);
      }
      *(undefined4 *)(param_1 + 0x11) = uVar4;
    }
LAB_1401dd74a:
    if (*(uint *)(param_1 + 0x11) < 3) {
      bVar5 = *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x94) + param_1[10]);
      *(undefined2 *)(param_1[0x2df] + (ulonglong)*(uint *)((longlong)param_1 + 0x16f4) * 2) = 0;
      *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x16f4) + param_1[0x2dd]) = bVar5;
      *(int *)((longlong)param_1 + 0x16f4) = *(int *)((longlong)param_1 + 0x16f4) + 1;
      psVar2 = (short *)((longlong)param_1 + (ulonglong)bVar5 * 4 + 0xbc);
      *psVar2 = *psVar2 + 1;
      bVar12 = *(int *)((longlong)param_1 + 0x16f4) == (int)param_1[0x2de] + -1;
      *(int *)((longlong)param_1 + 0x9c) = *(int *)((longlong)param_1 + 0x9c) + -1;
LAB_1401dd937:
      *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + 1;
    }
    else {
      sVar9 = *(short *)((longlong)param_1 + 0x94) - (short)param_1[0x13];
      lVar3 = param_1[0x11];
      *(short *)(param_1[0x2df] + (ulonglong)*(uint *)((longlong)param_1 + 0x16f4) * 2) = sVar9;
      bVar5 = (char)lVar3 - 3;
      *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x16f4) + param_1[0x2dd]) = bVar5;
      *(int *)((longlong)param_1 + 0x16f4) = *(int *)((longlong)param_1 + 0x16f4) + 1;
      uVar10 = sVar9 - 1;
      psVar2 = (short *)((longlong)param_1 + (ulonglong)(byte)(&DAT_140271d00)[bVar5] * 4 + 0x4c0);
      *psVar2 = *psVar2 + 1;
      if (uVar10 < 0x100) {
        bVar5 = (&DAT_140271b00)[uVar10];
      }
      else {
        bVar5 = (&DAT_140271c00)[uVar10 >> 7];
      }
      psVar2 = (short *)((longlong)param_1 + (longlong)(int)(uint)bVar5 * 4 + 0x9b0);
      *psVar2 = *psVar2 + 1;
      bVar12 = *(int *)((longlong)param_1 + 0x16f4) == (int)param_1[0x2de] + -1;
      uVar11 = *(uint *)(param_1 + 0x11);
      *(int *)((longlong)param_1 + 0x9c) = *(int *)((longlong)param_1 + 0x9c) - uVar11;
      if ((uVar11 <= *(uint *)(param_1 + 0x15)) && (2 < *(uint *)((longlong)param_1 + 0x9c))) {
        *(uint *)(param_1 + 0x11) = uVar11 - 1;
        do {
          *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + 1;
          uVar11 = ((uint)*(byte *)((ulonglong)(*(uint *)((longlong)param_1 + 0x94) + 2) +
                                   param_1[10]) ^
                   (int)param_1[0xe] << ((byte)(int)param_1[0x10] & 0x1f)) &
                   *(uint *)((longlong)param_1 + 0x7c);
          *(uint *)(param_1 + 0xe) = uVar11;
          *(undefined2 *)
           (param_1[0xc] +
           (ulonglong)(*(uint *)((longlong)param_1 + 0x94) & *(uint *)((longlong)param_1 + 0x4c)) *
           2) = *(undefined2 *)(param_1[0xd] + (ulonglong)uVar11 * 2);
          uVar8 = (ulonglong)
                  *(ushort *)
                   (param_1[0xc] +
                   (ulonglong)
                   (*(uint *)((longlong)param_1 + 0x94) & *(uint *)((longlong)param_1 + 0x4c)) * 2);
          *(undefined2 *)(param_1[0xd] + (ulonglong)*(uint *)(param_1 + 0xe) * 2) =
               *(undefined2 *)((longlong)param_1 + 0x94);
          plVar1 = param_1 + 0x11;
          *(int *)plVar1 = (int)*plVar1 + -1;
        } while ((int)*plVar1 != 0);
        goto LAB_1401dd937;
      }
      *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + uVar11;
      *(undefined4 *)(param_1 + 0x11) = 0;
      uVar11 = (uint)*(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x94) + param_1[10]);
      *(uint *)(param_1 + 0xe) = uVar11;
      *(uint *)(param_1 + 0xe) =
           (uVar11 << ((byte)(int)param_1[0x10] & 0x1f) ^
           (uint)*(byte *)((ulonglong)(*(uint *)((longlong)param_1 + 0x94) + 1) + param_1[10])) &
           *(uint *)((longlong)param_1 + 0x7c);
    }
    if (bVar12) {
      uVar11 = *(uint *)((longlong)param_1 + 0x84);
      uVar6 = uVar7;
      if (-1 < (int)uVar11) {
        uVar6 = (ulonglong)uVar11 + param_1[10];
      }
      FUN_1401e1268(param_1,uVar6,*(int *)((longlong)param_1 + 0x94) - uVar11,0);
      *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
      FUN_1401dc39c(*param_1);
      if (*(int *)(*param_1 + 0x18) == 0) {
        return 0;
      }
    }
  } while( true );
}



undefined4 FUN_1401dda3c(longlong *param_1,int param_2)

{
  longlong *plVar1;
  short *psVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  longlong lVar6;
  undefined4 uVar7;
  byte bVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  short sVar11;
  ushort uVar12;
  uint uVar13;
  uint uVar14;
  ulonglong uVar15;
  
  uVar10 = 0;
  uVar15 = uVar10;
LAB_1401dda6e:
  do {
    uVar13 = *(uint *)((longlong)param_1 + 0x9c);
    if (uVar13 < 0x106) {
      FUN_1401dd30c(param_1);
      uVar13 = *(uint *)((longlong)param_1 + 0x9c);
      if ((uVar13 < 0x106) && (param_2 == 0)) {
        return 0;
      }
      if (uVar13 == 0) {
        if ((int)param_1[0x12] != 0) {
          bVar8 = *(byte *)((ulonglong)(*(int *)((longlong)param_1 + 0x94) - 1) + param_1[10]);
          *(undefined2 *)(param_1[0x2df] + (ulonglong)*(uint *)((longlong)param_1 + 0x16f4) * 2) = 0
          ;
          *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x16f4) + param_1[0x2dd]) = bVar8;
          *(int *)((longlong)param_1 + 0x16f4) = *(int *)((longlong)param_1 + 0x16f4) + 1;
          psVar2 = (short *)((longlong)param_1 + (ulonglong)bVar8 * 4 + 0xbc);
          *psVar2 = *psVar2 + 1;
          *(undefined4 *)(param_1 + 0x12) = 0;
        }
        uVar13 = *(uint *)((longlong)param_1 + 0x84);
        if (-1 < (int)uVar13) {
          uVar10 = (ulonglong)uVar13 + param_1[10];
        }
        FUN_1401e1268(param_1,uVar10,*(int *)((longlong)param_1 + 0x94) - uVar13,param_2 == 4);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1401dc39c(*param_1);
        if (*(int *)(*param_1 + 0x18) != 0) {
          uVar7 = 1;
          if (param_2 == 4) {
            uVar7 = 3;
          }
          return uVar7;
        }
        if (param_2 == 4) {
          return 2;
        }
        return 0;
      }
    }
    if (2 < uVar13) {
      uVar13 = ((uint)*(byte *)((ulonglong)(*(uint *)((longlong)param_1 + 0x94) + 2) + param_1[10])
               ^ (int)param_1[0xe] << ((byte)(int)param_1[0x10] & 0x1f)) &
               *(uint *)((longlong)param_1 + 0x7c);
      *(uint *)(param_1 + 0xe) = uVar13;
      *(undefined2 *)
       (param_1[0xc] +
       (ulonglong)(*(uint *)((longlong)param_1 + 0x94) & *(uint *)((longlong)param_1 + 0x4c)) * 2) =
           *(undefined2 *)(param_1[0xd] + (ulonglong)uVar13 * 2);
      uVar15 = (ulonglong)
               *(ushort *)
                (param_1[0xc] +
                (ulonglong)
                (*(uint *)((longlong)param_1 + 0x94) & *(uint *)((longlong)param_1 + 0x4c)) * 2);
      *(undefined2 *)(param_1[0xd] + (ulonglong)*(uint *)(param_1 + 0xe) * 2) =
           *(undefined2 *)((longlong)param_1 + 0x94);
    }
    uVar13 = *(uint *)(param_1 + 0x11);
    *(undefined4 *)(param_1 + 0x11) = 2;
    *(uint *)(param_1 + 0x14) = uVar13;
    *(int *)((longlong)param_1 + 0x8c) = (int)param_1[0x13];
    if ((((int)uVar15 != 0) && (uVar13 < *(uint *)(param_1 + 0x15))) &&
       (uVar13 = *(int *)((longlong)param_1 + 0x94) - (int)uVar15,
       uVar13 <= *(int *)((longlong)param_1 + 0x44) - 0x106U)) {
      if ((int)param_1[0x16] != 2) {
        if ((int)param_1[0x16] == 3) {
          if (uVar13 != 1) goto LAB_1401ddb8a;
          uVar7 = FUN_1401dd21c(param_1,uVar15);
        }
        else {
          uVar7 = FUN_1401dd07c(param_1,uVar15);
        }
        *(undefined4 *)(param_1 + 0x11) = uVar7;
      }
LAB_1401ddb8a:
      if ((*(uint *)(param_1 + 0x11) < 6) &&
         (((int)param_1[0x16] == 1 ||
          ((*(uint *)(param_1 + 0x11) == 3 &&
           (0x1000 < (uint)(*(int *)((longlong)param_1 + 0x94) - (int)param_1[0x13]))))))) {
        *(undefined4 *)(param_1 + 0x11) = 2;
      }
    }
    if ((*(uint *)(param_1 + 0x14) < 3) || (*(uint *)(param_1 + 0x14) < *(uint *)(param_1 + 0x11)))
    {
      if ((int)param_1[0x12] == 0) {
        *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + 1;
        *(int *)((longlong)param_1 + 0x9c) = *(int *)((longlong)param_1 + 0x9c) + -1;
        *(undefined4 *)(param_1 + 0x12) = 1;
        goto LAB_1401dda6e;
      }
      bVar8 = *(byte *)((ulonglong)(*(int *)((longlong)param_1 + 0x94) - 1) + param_1[10]);
      *(undefined2 *)(param_1[0x2df] + (ulonglong)*(uint *)((longlong)param_1 + 0x16f4) * 2) = 0;
      *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x16f4) + param_1[0x2dd]) = bVar8;
      *(int *)((longlong)param_1 + 0x16f4) = *(int *)((longlong)param_1 + 0x16f4) + 1;
      psVar2 = (short *)((longlong)param_1 + (ulonglong)bVar8 * 4 + 0xbc);
      *psVar2 = *psVar2 + 1;
      if (*(int *)((longlong)param_1 + 0x16f4) == (int)param_1[0x2de] + -1) {
        uVar13 = *(uint *)((longlong)param_1 + 0x84);
        uVar9 = uVar10;
        if (-1 < (int)uVar13) {
          uVar9 = (ulonglong)uVar13 + param_1[10];
        }
        FUN_1401e1268(param_1,uVar9,*(int *)((longlong)param_1 + 0x94) - uVar13,0);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1401dc39c(*param_1);
      }
      *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + 1;
      *(int *)((longlong)param_1 + 0x9c) = *(int *)((longlong)param_1 + 0x9c) + -1;
      iVar3 = *(int *)(*param_1 + 0x18);
    }
    else {
      iVar3 = *(int *)((longlong)param_1 + 0x94);
      iVar4 = *(int *)((longlong)param_1 + 0x9c);
      sVar11 = (short)iVar3 - *(short *)((longlong)param_1 + 0x8c);
      bVar8 = (char)param_1[0x14] - 3;
      *(short *)(param_1[0x2df] + (ulonglong)*(uint *)((longlong)param_1 + 0x16f4) * 2) =
           sVar11 + -1;
      *(byte *)((ulonglong)*(uint *)((longlong)param_1 + 0x16f4) + param_1[0x2dd]) = bVar8;
      *(int *)((longlong)param_1 + 0x16f4) = *(int *)((longlong)param_1 + 0x16f4) + 1;
      uVar12 = sVar11 - 2;
      psVar2 = (short *)((longlong)param_1 + (ulonglong)(byte)(&DAT_140271d00)[bVar8] * 4 + 0x4c0);
      *psVar2 = *psVar2 + 1;
      if (uVar12 < 0x100) {
        bVar8 = (&DAT_140271b00)[uVar12];
      }
      else {
        bVar8 = (&DAT_140271c00)[uVar12 >> 7];
      }
      psVar2 = (short *)((longlong)param_1 + (longlong)(int)(uint)bVar8 * 4 + 0x9b0);
      *psVar2 = *psVar2 + 1;
      lVar6 = param_1[0x2de];
      iVar5 = *(int *)((longlong)param_1 + 0x16f4);
      *(int *)((longlong)param_1 + 0x9c) =
           *(int *)((longlong)param_1 + 0x9c) + (1 - (int)param_1[0x14]);
      *(int *)(param_1 + 0x14) = (int)param_1[0x14] + -2;
      do {
        *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + 1;
        uVar13 = *(uint *)((longlong)param_1 + 0x94);
        if (uVar13 <= (uint)(iVar3 + -3 + iVar4)) {
          uVar14 = ((uint)*(byte *)((ulonglong)(uVar13 + 2) + param_1[10]) ^
                   (int)param_1[0xe] << ((byte)(int)param_1[0x10] & 0x1f)) &
                   *(uint *)((longlong)param_1 + 0x7c);
          *(uint *)(param_1 + 0xe) = uVar14;
          *(undefined2 *)
           (param_1[0xc] + (ulonglong)(uVar13 & *(uint *)((longlong)param_1 + 0x4c)) * 2) =
               *(undefined2 *)(param_1[0xd] + (ulonglong)uVar14 * 2);
          uVar15 = (ulonglong)
                   *(ushort *)
                    (param_1[0xc] +
                    (ulonglong)
                    (*(uint *)((longlong)param_1 + 0x94) & *(uint *)((longlong)param_1 + 0x4c)) * 2)
          ;
          *(undefined2 *)(param_1[0xd] + (ulonglong)*(uint *)(param_1 + 0xe) * 2) =
               *(undefined2 *)((longlong)param_1 + 0x94);
        }
        plVar1 = param_1 + 0x14;
        *(int *)plVar1 = (int)*plVar1 + -1;
      } while ((int)*plVar1 != 0);
      *(int *)((longlong)param_1 + 0x94) = *(int *)((longlong)param_1 + 0x94) + 1;
      *(undefined4 *)(param_1 + 0x12) = 0;
      *(undefined4 *)(param_1 + 0x11) = 2;
      if (iVar5 != (int)lVar6 + -1) goto LAB_1401dda6e;
      uVar13 = *(uint *)((longlong)param_1 + 0x84);
      uVar9 = uVar10;
      if (-1 < (int)uVar13) {
        uVar9 = (ulonglong)uVar13 + param_1[10];
      }
      FUN_1401e1268(param_1,uVar9,*(int *)((longlong)param_1 + 0x94) - uVar13,0);
      *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
      FUN_1401dc39c(*param_1);
      iVar3 = *(int *)(*param_1 + 0x18);
    }
    if (iVar3 == 0) {
      return 0;
    }
  } while( true );
}



undefined8 FUN_1401ddf3c(longlong param_1)

{
  longlong lVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  
  if ((((param_1 == 0) || (lVar1 = *(longlong *)(param_1 + 0x28), lVar1 == 0)) ||
      (*(longlong *)(param_1 + 0x30) == 0)) || (*(longlong *)(param_1 + 0x38) == 0)) {
    uVar3 = 0xfffffffe;
  }
  else {
    *(undefined4 *)(param_1 + 0x1c) = 0;
    *(undefined4 *)(param_1 + 0xc) = 0;
    *(undefined8 *)(param_1 + 0x20) = 0;
    *(undefined4 *)(param_1 + 0x48) = 2;
    *(undefined4 *)(lVar1 + 0x28) = 0;
    *(undefined8 *)(lVar1 + 0x20) = *(undefined8 *)(lVar1 + 0x10);
    if (*(int *)(lVar1 + 0x2c) < 0) {
      *(int *)(lVar1 + 0x2c) = -*(int *)(lVar1 + 0x2c);
    }
    *(uint *)(lVar1 + 8) = (-(uint)(*(int *)(lVar1 + 0x2c) != 0) & 0xffffffb9) + 0x71;
    if (*(int *)(lVar1 + 0x2c) == 2) {
      uVar2 = FUN_1401df858();
    }
    else {
      uVar2 = FUN_1401deccc(0,0,0);
    }
    *(undefined4 *)(param_1 + 0x4c) = uVar2;
    *(undefined4 *)(lVar1 + 0x40) = 0;
    FUN_1401e0bb8(lVar1);
    FUN_1401dcfcc(lVar1);
    uVar3 = 0;
  }
  return uVar3;
}



undefined4 FUN_1401ddffc(longlong param_1,uint param_2,uint param_3)

{
  longlong lVar1;
  undefined4 uVar2;
  longlong lVar3;
  
  uVar2 = 0;
  if ((param_1 != 0) && (lVar1 = *(longlong *)(param_1 + 0x28), lVar1 != 0)) {
    if (param_2 == 0xffffffff) {
      param_2 = 6;
    }
    if ((param_2 < 10) && (param_3 < 5)) {
      lVar3 = (longlong)(int)param_2;
      if (((&PTR_FUN_14026f268)[(longlong)*(int *)(lVar1 + 0xac) * 2] !=
           (&PTR_FUN_14026f268)[lVar3 * 2]) && (*(int *)(param_1 + 0xc) != 0)) {
        uVar2 = FUN_1401dc41c(param_1,1);
      }
      if (*(uint *)(lVar1 + 0xac) != param_2) {
        *(uint *)(lVar1 + 0xac) = param_2;
        *(uint *)(lVar1 + 0xa8) = (uint)*(ushort *)(&DAT_14026f262 + lVar3 * 0x10);
        *(uint *)(lVar1 + 0xb4) = (uint)*(ushort *)(&DAT_14026f260 + lVar3 * 0x10);
        *(uint *)(lVar1 + 0xb8) = (uint)*(ushort *)(&DAT_14026f264 + lVar3 * 0x10);
        *(uint *)(lVar1 + 0xa4) = (uint)*(ushort *)(&DAT_14026f266 + lVar3 * 0x10);
      }
      *(uint *)(lVar1 + 0xb0) = param_3;
      return uVar2;
    }
  }
  return 0xfffffffe;
}



undefined8
FUN_1401de0fc(longlong param_1,uint param_2,int param_3,int param_4,int param_5,uint param_6,
             char *param_7,int param_8)

{
  uint uVar1;
  int iVar2;
  undefined8 uVar3;
  code *pcVar4;
  longlong *plVar5;
  longlong lVar6;
  int iVar7;
  undefined4 uVar8;
  
  uVar8 = 1;
  if (((param_7 == (char *)0x0) || (*param_7 != '1')) || (param_8 != 0x58)) {
    uVar3 = 0xfffffffa;
  }
  else {
    if (param_1 != 0) {
      *(undefined8 *)(param_1 + 0x20) = 0;
      if (*(longlong *)(param_1 + 0x30) == 0) {
        *(undefined8 *)(param_1 + 0x40) = 0;
        *(code **)(param_1 + 0x30) = FUN_1401de3d8;
      }
      pcVar4 = *(code **)(param_1 + 0x38);
      if (pcVar4 == (code *)0x0) {
        pcVar4 = FUN_1401de3f8;
      }
      *(code **)(param_1 + 0x38) = pcVar4;
      if (param_2 == 0xffffffff) {
        param_2 = 6;
      }
      if (param_4 < 0) {
        param_4 = -param_4;
        uVar8 = 0;
      }
      else if (0xf < param_4) {
        uVar8 = 2;
        param_4 = param_4 + -0x10;
      }
      if (((param_5 - 1U < 9) && (param_3 == 8)) &&
         ((param_4 - 8U < 8 && ((param_2 < 10 && (param_6 < 5)))))) {
        if (param_4 == 8) {
          param_4 = 9;
        }
        plVar5 = (longlong *)(**(code **)(param_1 + 0x30))(*(undefined8 *)(param_1 + 0x40),1,0x1718)
        ;
        if (plVar5 != (longlong *)0x0) {
          *(longlong **)(param_1 + 0x28) = plVar5;
          *(undefined4 *)((longlong)plVar5 + 0x2c) = uVar8;
          *(int *)(plVar5 + 9) = param_4;
          *plVar5 = param_1;
          plVar5[6] = 0;
          iVar7 = 1 << ((byte)param_4 & 0x1f);
          *(int *)((longlong)plVar5 + 0x44) = iVar7;
          *(int *)(plVar5 + 0xf) = param_5 + 7;
          *(int *)((longlong)plVar5 + 0x4c) = iVar7 + -1;
          iVar2 = 1 << ((byte)(param_5 + 7) & 0x1f);
          *(int *)((longlong)plVar5 + 0x74) = iVar2;
          *(int *)((longlong)plVar5 + 0x7c) = iVar2 + -1;
          *(uint *)(plVar5 + 0x10) = (param_5 + 9U) / 3;
          lVar6 = (**(code **)(param_1 + 0x30))(*(undefined8 *)(param_1 + 0x40),iVar7,2);
          plVar5[10] = lVar6;
          lVar6 = (**(code **)(param_1 + 0x30))
                            (*(undefined8 *)(param_1 + 0x40),
                             *(undefined4 *)((longlong)plVar5 + 0x44),2);
          plVar5[0xc] = lVar6;
          lVar6 = (**(code **)(param_1 + 0x30))
                            (*(undefined8 *)(param_1 + 0x40),
                             *(undefined4 *)((longlong)plVar5 + 0x74),2);
          iVar2 = 1 << ((char)param_5 + 6U & 0x1f);
          plVar5[0xd] = lVar6;
          *(int *)(plVar5 + 0x2de) = iVar2;
          lVar6 = (**(code **)(param_1 + 0x30))(*(undefined8 *)(param_1 + 0x40),iVar2,4);
          plVar5[2] = lVar6;
          uVar1 = *(uint *)(plVar5 + 0x2de);
          *(uint *)(plVar5 + 3) = uVar1 << 2;
          if ((((plVar5[10] != 0) && (plVar5[0xc] != 0)) && (plVar5[0xd] != 0)) && (lVar6 != 0)) {
            *(uint *)((longlong)plVar5 + 0xac) = param_2;
            *(uint *)(plVar5 + 0x16) = param_6;
            *(undefined1 *)((longlong)plVar5 + 0x3c) = 8;
            plVar5[0x2df] = lVar6 + (ulonglong)(uVar1 >> 1) * 2;
            plVar5[0x2dd] = lVar6 + (ulonglong)uVar1 * 3;
            uVar3 = FUN_1401ddf3c(param_1);
            return uVar3;
          }
          *(undefined4 *)(plVar5 + 1) = 0x29a;
          *(char **)(param_1 + 0x20) = "insufficient memory";
          FUN_1401dcc6c(param_1);
        }
        return 0xfffffffc;
      }
    }
    uVar3 = 0xfffffffe;
  }
  return uVar3;
}



void FUN_1401de36c(void)

{
  FUN_1401de0fc();
  return;
}



void FUN_1401de3d8(undefined8 param_1,int param_2,int param_3)

{
                    // WARNING: Could not recover jumptable at 0x0001401de3de. Too many branches
                    // WARNING: Treating indirect jump as call
  malloc((ulonglong)(uint)(param_2 * param_3));
  return;
}



void FUN_1401de3f8(undefined8 param_1,void *param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401de3fb. Too many branches
                    // WARNING: Treating indirect jump as call
  free(param_2);
  return;
}



void FUN_1401de404(longlong *param_1,int param_2)

{
  uint uVar1;
  undefined4 uVar2;
  uint uVar3;
  undefined4 uVar4;
  undefined4 *puVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  uint uVar9;
  uint uVar10;
  char *pcVar11;
  ulonglong uVar12;
  uint uVar13;
  uint uVar14;
  byte *pbVar15;
  byte *pbVar16;
  longlong lVar17;
  undefined1 *puVar18;
  undefined1 *puVar19;
  undefined1 *puVar20;
  undefined1 *puVar21;
  longlong lVar22;
  undefined1 *puVar23;
  uint uVar24;
  int iVar25;
  uint uVar26;
  byte *pbVar27;
  int local_68;
  
  puVar5 = (undefined4 *)param_1[5];
  lVar17 = *(longlong *)(puVar5 + 0x16);
  lVar6 = *(longlong *)(puVar5 + 0x18);
  uVar1 = puVar5[0xd];
  uVar14 = puVar5[0x10];
  uVar24 = puVar5[0x11];
  lVar8 = param_1[3];
  puVar18 = (undefined1 *)(param_1[2] + -1);
  uVar2 = puVar5[0x1a];
  pbVar15 = (byte *)(*param_1 + -1);
  local_68 = (int)puVar18 - (param_2 - (int)lVar8);
  iVar25 = puVar5[0xb];
  uVar3 = puVar5[0xc];
  lVar7 = *(longlong *)(puVar5 + 0xe);
  pbVar27 = pbVar15 + ((int)param_1[1] - 5);
  uVar4 = puVar5[0x1b];
  puVar19 = puVar18;
LAB_1401de4be:
  if (uVar24 < 0xf) {
    pbVar16 = pbVar15 + 1;
    pbVar15 = pbVar15 + 2;
    uVar14 = uVar14 + ((uint)*pbVar16 << ((byte)uVar24 & 0x1f)) +
             ((uint)*pbVar15 << ((byte)uVar24 + 8 & 0x1f));
    uVar24 = uVar24 + 0x10;
  }
  uVar9 = uVar14 & (1 << ((byte)uVar2 & 0x1f)) - 1U;
  while( true ) {
    uVar9 = *(uint *)(lVar17 + (ulonglong)uVar9 * 4);
    uVar14 = uVar14 >> ((byte)(uVar9 >> 8) & 0x1f);
    uVar24 = uVar24 - (uVar9 >> 8 & 0xff);
    if ((byte)uVar9 == 0) break;
    pbVar16 = pbVar15;
    if ((uVar9 & 0x10) != 0) {
      uVar26 = uVar9 >> 0x10;
      uVar9 = uVar9 & 0xf;
      if (uVar9 != 0) {
        if (uVar24 < uVar9) {
          pbVar15 = pbVar15 + 1;
          uVar14 = uVar14 + ((uint)*pbVar15 << ((byte)uVar24 & 0x1f));
          uVar24 = uVar24 + 8;
        }
        uVar10 = (1 << (sbyte)uVar9) - 1U & uVar14;
        uVar14 = uVar14 >> (sbyte)uVar9;
        uVar26 = uVar26 + uVar10;
        uVar24 = uVar24 - uVar9;
        pbVar16 = pbVar15;
      }
      if (uVar24 < 0xf) {
        pbVar15 = pbVar16 + 1;
        pbVar16 = pbVar16 + 2;
        uVar14 = uVar14 + ((uint)*pbVar15 << ((byte)uVar24 & 0x1f)) +
                 ((uint)*pbVar16 << ((byte)uVar24 + 8 & 0x1f));
        uVar24 = uVar24 + 0x10;
      }
      uVar9 = *(uint *)(lVar6 + (ulonglong)((1 << ((byte)uVar4 & 0x1f)) - 1U & uVar14) * 4);
      goto LAB_1401de5c5;
    }
    if ((uVar9 & 0x40) != 0) {
      if ((uVar9 & 0x20) == 0) {
        pcVar11 = "invalid literal/length code";
        goto LAB_1401de7f0;
      }
      *puVar5 = 0xb;
      goto LAB_1401de7fc;
    }
    uVar9 = ((1 << ((byte)uVar9 & 0x1f)) - 1U & uVar14) + (uVar9 >> 0x10);
  }
  puVar19[1] = (char)(uVar9 >> 0x10);
  puVar20 = puVar19 + 1;
  goto LAB_1401de7b4;
LAB_1401de5c5:
  uVar14 = uVar14 >> ((byte)(uVar9 >> 8) & 0x1f);
  uVar24 = uVar24 - (uVar9 >> 8 & 0xff);
  if ((uVar9 & 0x10) != 0) goto code_r0x0001401de5e2;
  if ((uVar9 & 0x40) != 0) {
    pcVar11 = "invalid distance code";
    goto LAB_1401de7f0;
  }
  uVar9 = *(uint *)(lVar6 + (ulonglong)
                            (((1 << ((byte)uVar9 & 0x1f)) - 1U & uVar14) + (uVar9 >> 0x10)) * 4);
  goto LAB_1401de5c5;
code_r0x0001401de5e2:
  uVar13 = uVar9 & 0xf;
  pbVar15 = pbVar16;
  uVar10 = uVar24;
  if (uVar24 < uVar13) {
    pbVar15 = pbVar16 + 1;
    uVar10 = uVar24 + 8;
    uVar14 = uVar14 + ((uint)*pbVar15 << ((byte)uVar24 & 0x1f));
    if (uVar10 < uVar13) {
      pbVar15 = pbVar16 + 2;
      uVar14 = uVar14 + ((uint)*pbVar15 << ((byte)uVar10 & 0x1f));
      uVar10 = uVar24 + 0x10;
    }
  }
  uVar24 = uVar10 - uVar13;
  uVar10 = (1 << (sbyte)uVar13) - 1U & uVar14;
  uVar14 = uVar14 >> (sbyte)uVar13;
  uVar10 = (uVar9 >> 0x10) + uVar10;
  uVar9 = (int)puVar19 - local_68;
  if (uVar10 <= uVar9) {
    puVar20 = puVar19 + -(ulonglong)uVar10;
    do {
      puVar23 = puVar19;
      puVar21 = puVar20;
      puVar19 = puVar23 + 3;
      puVar23[1] = puVar21[1];
      uVar26 = uVar26 - 3;
      puVar23[2] = puVar21[2];
      *puVar19 = puVar21[3];
      puVar20 = puVar21 + 3;
    } while (2 < uVar26);
    puVar20 = puVar19;
    if (uVar26 != 0) {
      puVar23[4] = puVar21[4];
      puVar20 = puVar23 + 4;
      if (1 < uVar26) {
        puVar23[5] = puVar21[5];
        puVar20 = puVar23 + 5;
      }
    }
    goto LAB_1401de7b4;
  }
  uVar9 = uVar10 - uVar9;
  if (uVar3 < uVar9) {
    pcVar11 = "invalid distance too far back";
    pbVar16 = pbVar15;
LAB_1401de7f0:
    param_1[4] = (longlong)pcVar11;
    *puVar5 = 0x1b;
LAB_1401de7fc:
    *(int *)(param_1 + 3) = ((int)(puVar18 + ((int)lVar8 - 0x101)) - (int)puVar19) + 0x101;
    lVar17 = (longlong)pbVar16 - (ulonglong)(uVar24 >> 3);
    iVar25 = uVar24 + (uVar24 >> 3) * -8;
    *param_1 = lVar17 + 1;
    *(int *)(param_1 + 1) = ((int)pbVar27 - (int)lVar17) + 5;
    param_1[2] = (longlong)(puVar19 + 1);
    puVar5[0x11] = iVar25;
    puVar5[0x10] = (1 << ((byte)iVar25 & 0x1f)) - 1U & uVar14;
    return;
  }
  lVar22 = lVar7 + -1;
  if (uVar1 == 0) {
    puVar21 = (undefined1 *)(lVar22 + (ulonglong)(iVar25 - uVar9));
    if (uVar9 < uVar26) {
      uVar26 = uVar26 - uVar9;
      do {
        puVar21 = puVar21 + 1;
        puVar19 = puVar19 + 1;
        uVar9 = uVar9 - 1;
        *puVar19 = *puVar21;
      } while (uVar9 != 0);
LAB_1401de6ec:
      puVar21 = puVar19 + -(ulonglong)uVar10;
    }
  }
  else if (uVar1 < uVar9) {
    uVar13 = uVar9 - uVar1;
    puVar21 = (undefined1 *)(lVar22 + (ulonglong)((uVar1 - uVar9) + iVar25));
    if (uVar13 < uVar26) {
      uVar26 = uVar26 - uVar13;
      lVar22 = (longlong)puVar21 - (longlong)puVar19;
      do {
        puVar19 = puVar19 + 1;
        uVar13 = uVar13 - 1;
        *puVar19 = puVar19[lVar22];
      } while (uVar13 != 0);
      puVar21 = (undefined1 *)(lVar7 + -1);
      if (uVar1 < uVar26) {
        uVar26 = uVar26 - uVar1;
        uVar9 = uVar1;
        do {
          puVar21 = puVar21 + 1;
          puVar19 = puVar19 + 1;
          uVar9 = uVar9 - 1;
          *puVar19 = *puVar21;
        } while (uVar9 != 0);
        goto LAB_1401de6ec;
      }
    }
  }
  else {
    puVar21 = (undefined1 *)(lVar22 + (ulonglong)(uVar1 - uVar9));
    if (uVar9 < uVar26) {
      uVar26 = uVar26 - uVar9;
      do {
        puVar21 = puVar21 + 1;
        puVar19 = puVar19 + 1;
        uVar9 = uVar9 - 1;
        *puVar19 = *puVar21;
      } while (uVar9 != 0);
      goto LAB_1401de6ec;
    }
  }
  if (2 < uVar26) {
    uVar12 = (ulonglong)((uVar26 - 3) / 3 + 1);
    puVar20 = puVar19;
    puVar23 = puVar21;
    do {
      puVar21 = puVar23 + 3;
      puVar19 = puVar20 + 3;
      puVar20[1] = puVar23[1];
      uVar26 = uVar26 - 3;
      uVar12 = uVar12 - 1;
      puVar20[2] = puVar23[2];
      *puVar19 = *puVar21;
      puVar20 = puVar19;
      puVar23 = puVar21;
    } while (uVar12 != 0);
  }
  puVar20 = puVar19;
  if (uVar26 != 0) {
    puVar19[1] = puVar21[1];
    puVar20 = puVar19 + 1;
    if (1 < uVar26) {
      puVar19[2] = puVar21[2];
      puVar20 = puVar19 + 2;
    }
  }
LAB_1401de7b4:
  pbVar16 = pbVar15;
  puVar19 = puVar20;
  if ((pbVar27 <= pbVar15) || (puVar18 + ((int)lVar8 - 0x101) <= puVar20)) goto LAB_1401de7fc;
  goto LAB_1401de4be;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_1401de864(int param_1,ushort *param_2,uint param_3,longlong *param_4,uint *param_5,
             undefined *param_6)

{
  byte bVar1;
  ushort uVar2;
  ushort *puVar3;
  undefined8 uVar4;
  byte bVar5;
  longlong lVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  uint uVar10;
  uint uVar11;
  uint uVar12;
  int iVar13;
  char cVar14;
  uint uVar15;
  uint uVar16;
  int iVar17;
  int iVar18;
  uint uVar19;
  byte bVar21;
  ulonglong uVar22;
  uint uVar23;
  undefined *puVar24;
  undefined4 local_d8;
  longlong local_d0;
  uint local_c8;
  uint local_c4;
  uint local_c0;
  uint local_bc;
  undefined *local_b0;
  ushort local_80 [32];
  ulonglong local_40;
  ulonglong uVar20;
  
  local_40 = DAT_1402f85a0 ^ (ulonglong)&local_d8;
  uVar22 = 0;
  uVar23 = 1;
  puVar3 = local_80;
  for (lVar6 = 0x10; lVar6 != 0; lVar6 = lVar6 + -1) {
    *puVar3 = 0;
    puVar3 = puVar3 + 1;
  }
  if (param_3 != 0) {
    uVar8 = (ulonglong)param_3;
    puVar3 = param_2;
    do {
      uVar2 = *puVar3;
      puVar3 = puVar3 + 1;
      local_80[uVar2] = local_80[uVar2] + 1;
      uVar8 = uVar8 - 1;
    } while (uVar8 != 0);
  }
  uVar10 = 0xf;
  local_c4 = 0xffffffff;
  puVar3 = local_80 + 0xf;
  do {
    if (*puVar3 != 0) break;
    uVar10 = uVar10 - 1;
    puVar3 = puVar3 + -1;
  } while (uVar10 != 0);
  uVar16 = *param_5;
  if (uVar10 < *param_5) {
    uVar16 = uVar10;
  }
  if (uVar10 == 0) {
    *(undefined4 *)*param_4 = 0x140;
    *param_4 = *param_4 + 4;
    *(undefined4 *)*param_4 = 0x140;
    *param_4 = *param_4 + 4;
    *param_5 = 1;
LAB_1401de932:
    uVar4 = 0;
  }
  else {
    puVar3 = local_80;
    uVar15 = uVar23;
    do {
      puVar3 = puVar3 + 1;
      if (*puVar3 != 0) break;
      uVar15 = uVar15 + 1;
    } while (uVar15 < 0x10);
    uVar8 = (ulonglong)uVar16;
    uVar11 = uVar23;
    if (uVar16 < uVar15) {
      uVar8 = (ulonglong)uVar15;
    }
    do {
      uVar23 = uVar23 * 2 - (uint)local_80[uVar11];
      if ((int)uVar23 < 0) goto LAB_1401deca1;
      uVar11 = uVar11 + 1;
    } while (uVar11 < 0x10);
    if (((int)uVar23 < 1) || ((param_1 != 0 && (uVar10 == 1)))) {
      local_80[0x11] = 0;
      lVar6 = 0xe;
      uVar7 = uVar22;
      do {
        lVar6 = lVar6 + -1;
        *(short *)((longlong)local_80 + uVar7 + 0x24) =
             *(short *)((longlong)local_80 + uVar7 + 2) +
             *(short *)((longlong)local_80 + uVar7 + 0x22);
        uVar7 = uVar7 + 2;
      } while (lVar6 != 0);
      puVar3 = param_2;
      uVar7 = uVar22;
      if (param_3 != 0) {
        do {
          if (*puVar3 != 0) {
            *(short *)(param_6 + (ulonglong)local_80[(ulonglong)*puVar3 + 0x10] * 2) = (short)uVar7;
            local_80[(ulonglong)*puVar3 + 0x10] = local_80[(ulonglong)*puVar3 + 0x10] + 1;
          }
          uVar23 = (int)uVar7 + 1;
          puVar3 = puVar3 + 1;
          uVar7 = (ulonglong)uVar23;
        } while (uVar23 < param_3);
      }
      if (param_1 == 0) {
        local_b0 = param_6;
        iVar13 = 0x13;
        puVar24 = param_6;
      }
      else if (param_1 == 1) {
        iVar13 = 0x100;
        local_b0 = &DAT_14026f1ce;
        puVar24 = &UNK_14026f18e;
      }
      else {
        iVar13 = -1;
        local_b0 = &DAT_14026f450;
        puVar24 = &DAT_14026f410;
      }
      local_d0 = *param_4;
      uVar16 = (uint)uVar8;
      bVar5 = (byte)uVar8;
      local_bc = 1 << (bVar5 & 0x1f);
      uVar23 = local_bc - 1;
      local_c0 = 0;
      uVar7 = uVar22;
      uVar9 = uVar22;
      local_c8 = local_bc;
      if ((param_1 != 1) || (uVar7 = 0, uVar9 = 0, local_bc < 0x5b0)) {
LAB_1401dea84:
        cVar14 = (char)uVar15;
        bVar21 = (byte)uVar22;
        bVar1 = cVar14 - bVar21;
        uVar2 = *(ushort *)(param_6 + uVar9 * 2);
        if ((int)(uint)uVar2 < iVar13) {
          local_d8._0_2_ = (ushort)bVar1 << 8;
        }
        else if (iVar13 < (int)(uint)uVar2) {
          local_d8._0_2_ = CONCAT11(bVar1,local_b0[(ulonglong)*(ushort *)(param_6 + uVar9 * 2) * 2])
          ;
          uVar2 = *(ushort *)(puVar24 + (ulonglong)*(ushort *)(param_6 + uVar9 * 2) * 2);
        }
        else {
          local_d8 = CONCAT31((uint3)bVar1,0x60);
          uVar2 = 0;
        }
        uVar12 = (uint)uVar7;
        local_d8 = CONCAT22(uVar2,(ushort)local_d8);
        iVar17 = 1 << (cVar14 - bVar21 & 0x1f);
        uVar7 = (ulonglong)((uVar12 >> (bVar21 & 0x1f)) + local_bc);
        uVar11 = local_bc;
        do {
          uVar7 = (ulonglong)(uint)((int)uVar7 - iVar17);
          uVar11 = uVar11 - iVar17;
          *(uint *)(local_d0 + uVar7 * 4) = local_d8;
        } while (uVar11 != 0);
        for (uVar11 = 1 << (cVar14 - 1U & 0x1f); (uVar12 & uVar11) != 0; uVar11 = uVar11 >> 1) {
        }
        uVar19 = 0;
        if (uVar11 != 0) {
          uVar19 = uVar11 + (uVar11 - 1 & uVar12);
        }
        uVar7 = (ulonglong)uVar19;
        local_c0 = local_c0 + 1;
        uVar9 = (ulonglong)local_c0;
        puVar3 = local_80 + uVar15;
        *puVar3 = *puVar3 - 1;
        if (*puVar3 != 0) goto LAB_1401deb4e;
        if (uVar15 != uVar10) {
          uVar15 = (uint)param_2[*(ushort *)(param_6 + uVar9 * 2)];
          goto LAB_1401deb4e;
        }
        local_d8._0_2_ = CONCAT11(cVar14 - bVar21,0x40);
        local_d8 = (uint)(ushort)local_d8;
        while (uVar19 != 0) {
          uVar10 = (uint)uVar7;
          if (((int)uVar22 != 0) && ((uVar23 & uVar10) != local_c4)) {
            local_d0 = *param_4;
            uVar22 = 0;
            local_d8._0_2_ = CONCAT11(bVar5,(undefined1)local_d8);
            local_d8 = (uint)(ushort)local_d8;
            uVar15 = uVar16;
          }
          *(uint *)(local_d0 + (uVar7 >> ((byte)uVar22 & 0x3f)) * 4) = local_d8;
          for (uVar11 = 1 << ((char)uVar15 - 1U & 0x1f); (uVar10 & uVar11) != 0;
              uVar11 = uVar11 >> 1) {
          }
          uVar19 = 0;
          if (uVar11 != 0) {
            uVar19 = uVar11 + (uVar11 - 1 & uVar10);
          }
          uVar7 = (ulonglong)uVar19;
        }
        *param_4 = *param_4 + (ulonglong)local_c8 * 4;
        *param_5 = uVar16;
        goto LAB_1401de932;
      }
LAB_1401dea75:
      uVar4 = 1;
    }
    else {
LAB_1401deca1:
      uVar4 = 0xffffffff;
    }
  }
  return uVar4;
LAB_1401deb4e:
  if (uVar16 < uVar15) {
    uVar19 = uVar23 & uVar19;
    uVar20 = (ulonglong)uVar19;
    if (uVar19 == local_c4) goto LAB_1401dea84;
    if ((int)uVar22 == 0) {
      uVar22 = uVar8;
    }
    local_d0 = local_d0 + (ulonglong)local_bc * 4;
    iVar18 = uVar15 - (int)uVar22;
    uVar11 = (int)uVar22 + iVar18;
    for (iVar17 = 1 << ((byte)iVar18 & 0x1f);
        (uVar11 < uVar10 && (uVar9 = (ulonglong)uVar11, 0 < (int)(iVar17 - (uint)local_80[uVar9])));
        iVar17 = (iVar17 - (uint)local_80[uVar9]) * 2) {
      uVar11 = uVar11 + 1;
      iVar18 = iVar18 + 1;
    }
    local_bc = 1 << ((byte)iVar18 & 0x1f);
    local_c8 = local_c8 + local_bc;
    if ((param_1 != 1) || (local_c8 < 0x5b0)) {
      *(byte *)(*param_4 + uVar20 * 4) = (byte)iVar18;
      uVar9 = (ulonglong)local_c0;
      *(byte *)(*param_4 + 1 + uVar20 * 4) = bVar5;
      *(short *)(*param_4 + 2 + uVar20 * 4) = (short)(local_d0 - *param_4 >> 2);
      local_c4 = uVar19;
      goto LAB_1401dea84;
    }
    goto LAB_1401dea75;
  }
  goto LAB_1401dea84;
}



uint FUN_1401deccc(uint param_1,byte *param_2,uint param_3)

{
  byte bVar1;
  int iVar2;
  ulonglong uVar3;
  uint uVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  int iVar10;
  int iVar11;
  int iVar12;
  int iVar13;
  int iVar14;
  int iVar15;
  int iVar16;
  int iVar17;
  int iVar18;
  int iVar19;
  byte *pbVar20;
  
  uVar4 = param_1 & 0xffff;
  param_1 = param_1 >> 0x10;
  if (param_3 == 1) {
    uVar4 = uVar4 + *param_2;
    if (0xfff0 < uVar4) {
      uVar4 = uVar4 - 0xfff1;
    }
    param_1 = param_1 + uVar4;
    if (0xfff0 < param_1) {
      param_1 = param_1 - 0xfff1;
    }
  }
  else {
    if (param_2 == (byte *)0x0) {
      return 1;
    }
    if (param_3 < 0x10) {
      for (; param_3 != 0; param_3 = param_3 - 1) {
        bVar1 = *param_2;
        param_2 = param_2 + 1;
        uVar4 = uVar4 + bVar1;
        param_1 = param_1 + uVar4;
      }
      if (0xfff0 < uVar4) {
        uVar4 = uVar4 - 0xfff1;
      }
      return (param_1 + (param_1 / 0xfff1) * 0xf) * 0x10000 | uVar4;
    }
    if (0x15af < param_3) {
      uVar3 = (ulonglong)param_3 / 0x15b0;
      do {
        param_3 = param_3 - 0x15b0;
        iVar2 = 0x15b;
        pbVar20 = param_2;
        do {
          param_2 = pbVar20 + 0x10;
          iVar5 = uVar4 + *pbVar20;
          iVar6 = iVar5 + (uint)pbVar20[1];
          iVar7 = iVar6 + (uint)pbVar20[2];
          iVar8 = iVar7 + (uint)pbVar20[3];
          iVar9 = iVar8 + (uint)pbVar20[4];
          iVar10 = iVar9 + (uint)pbVar20[5];
          iVar11 = iVar10 + (uint)pbVar20[6];
          iVar12 = iVar11 + (uint)pbVar20[7];
          iVar13 = iVar12 + (uint)pbVar20[8];
          iVar14 = iVar13 + (uint)pbVar20[9];
          iVar15 = iVar14 + (uint)pbVar20[10];
          iVar16 = iVar15 + (uint)pbVar20[0xb];
          iVar17 = iVar16 + (uint)pbVar20[0xc];
          iVar18 = iVar17 + (uint)pbVar20[0xd];
          iVar19 = iVar18 + (uint)pbVar20[0xe];
          uVar4 = iVar19 + (uint)pbVar20[0xf];
          param_1 = param_1 + iVar5 + iVar6 + iVar7 + iVar8 + iVar9 + iVar10 + iVar11 + iVar12 +
                    iVar13 + iVar14 + iVar15 + iVar16 + iVar17 + iVar18 + iVar19 + uVar4;
          iVar2 = iVar2 + -1;
          pbVar20 = param_2;
        } while (iVar2 != 0);
        uVar4 = uVar4 % 0xfff1;
        param_1 = param_1 % 0xfff1;
        uVar3 = uVar3 - 1;
      } while (uVar3 != 0);
    }
    if (param_3 != 0) {
      if (0xf < param_3) {
        uVar3 = (ulonglong)(param_3 >> 4);
        pbVar20 = param_2;
        do {
          param_3 = param_3 - 0x10;
          param_2 = pbVar20 + 0x10;
          iVar2 = uVar4 + *pbVar20;
          iVar5 = iVar2 + (uint)pbVar20[1];
          iVar6 = iVar5 + (uint)pbVar20[2];
          iVar7 = iVar6 + (uint)pbVar20[3];
          iVar8 = iVar7 + (uint)pbVar20[4];
          iVar9 = iVar8 + (uint)pbVar20[5];
          iVar10 = iVar9 + (uint)pbVar20[6];
          iVar11 = iVar10 + (uint)pbVar20[7];
          iVar12 = iVar11 + (uint)pbVar20[8];
          iVar13 = iVar12 + (uint)pbVar20[9];
          iVar14 = iVar13 + (uint)pbVar20[10];
          iVar15 = iVar14 + (uint)pbVar20[0xb];
          iVar16 = iVar15 + (uint)pbVar20[0xc];
          iVar17 = iVar16 + (uint)pbVar20[0xd];
          iVar18 = iVar17 + (uint)pbVar20[0xe];
          uVar4 = iVar18 + (uint)pbVar20[0xf];
          param_1 = param_1 + iVar2 + iVar5 + iVar6 + iVar7 + iVar8 + iVar9 + iVar10 + iVar11 +
                    iVar12 + iVar13 + iVar14 + iVar15 + iVar16 + iVar17 + iVar18 + uVar4;
          uVar3 = uVar3 - 1;
          pbVar20 = param_2;
        } while (uVar3 != 0);
      }
      for (; param_3 != 0; param_3 = param_3 - 1) {
        bVar1 = *param_2;
        param_2 = param_2 + 1;
        uVar4 = uVar4 + bVar1;
        param_1 = param_1 + uVar4;
      }
      uVar4 = uVar4 % 0xfff1;
      param_1 = param_1 % 0xfff1;
    }
  }
  return param_1 << 0x10 | uVar4;
}



uint FUN_1401defac(uint param_1,uint param_2,uint param_3)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  
  uVar1 = (param_1 & 0xffff) + 0xfff0 + (param_2 & 0xffff);
  uVar3 = (param_1 & 0xffff) * (param_3 % 0xfff1);
  uVar3 = uVar3 + 0xfff1 +
          (((param_1 >> 0x10) + (uVar3 / 0xfff1) * -0xfff1 + (param_2 >> 0x10)) - param_3 % 0xfff1);
  uVar2 = uVar1;
  if ((0xfff1 < uVar1) && (uVar2 = uVar1 - 0xfff1, 0xfff1 < uVar2)) {
    uVar2 = uVar1 - 0x1ffe2;
  }
  if (0x1ffe2 < uVar3) {
    uVar3 = uVar3 - 0x1ffe2;
  }
  if (0xfff1 < uVar3) {
    uVar3 = uVar3 - 0xfff1;
  }
  return uVar3 << 0x10 | uVar2;
}



uint FUN_1401df058(uint param_1,uint *param_2,uint param_3)

{
  uint *puVar1;
  ulonglong uVar2;
  uint uVar3;
  ulonglong uVar4;
  
  param_1 = ~param_1;
  for (; (uVar4 = (ulonglong)param_3, param_3 != 0 && (((ulonglong)param_2 & 3) != 0));
      param_2 = (uint *)((longlong)param_2 + 1)) {
    param_1 = *(uint *)(&DAT_14026f490 + (ulonglong)(byte)((byte)*param_2 ^ (byte)param_1) * 4) ^
              param_1 >> 8;
    param_3 = param_3 - 1;
  }
  if (0x1f < param_3) {
    uVar2 = (ulonglong)(param_3 >> 5);
    puVar1 = param_2;
    do {
      param_1 = param_1 ^ *puVar1;
      uVar3 = *(uint *)(&DAT_14026f890 + (ulonglong)(byte)(param_1 >> 0x10) * 4) ^
              *(uint *)(&DAT_14026fc90 + (ulonglong)(byte)(param_1 >> 8) * 4) ^
              *(uint *)(&DAT_14026f490 + (ulonglong)(param_1 >> 0x18) * 4) ^
              *(uint *)(&DAT_140270090 + (ulonglong)(param_1 & 0xff) * 4) ^ puVar1[1];
      uVar3 = *(uint *)(&DAT_14026f890 + (ulonglong)(byte)(uVar3 >> 0x10) * 4) ^
              *(uint *)(&DAT_14026fc90 + (ulonglong)(byte)(uVar3 >> 8) * 4) ^
              *(uint *)(&DAT_14026f490 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_140270090 + (ulonglong)(uVar3 & 0xff) * 4) ^ puVar1[2];
      uVar3 = *(uint *)(&DAT_14026f890 + (ulonglong)(byte)(uVar3 >> 0x10) * 4) ^
              *(uint *)(&DAT_14026fc90 + (ulonglong)(byte)(uVar3 >> 8) * 4) ^
              *(uint *)(&DAT_14026f490 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_140270090 + (ulonglong)(uVar3 & 0xff) * 4) ^ puVar1[3];
      uVar3 = *(uint *)(&DAT_14026f890 + (ulonglong)(byte)(uVar3 >> 0x10) * 4) ^
              *(uint *)(&DAT_14026fc90 + (ulonglong)(byte)(uVar3 >> 8) * 4) ^
              *(uint *)(&DAT_14026f490 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_140270090 + (ulonglong)(uVar3 & 0xff) * 4) ^ puVar1[4];
      uVar3 = *(uint *)(&DAT_14026f890 + (ulonglong)(byte)(uVar3 >> 0x10) * 4) ^
              *(uint *)(&DAT_14026fc90 + (ulonglong)(byte)(uVar3 >> 8) * 4) ^
              *(uint *)(&DAT_14026f490 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_140270090 + (ulonglong)(uVar3 & 0xff) * 4) ^ puVar1[5];
      param_2 = puVar1 + 8;
      uVar4 = (ulonglong)((int)uVar4 - 0x20);
      uVar3 = *(uint *)(&DAT_14026f890 + (ulonglong)(byte)(uVar3 >> 0x10) * 4) ^
              *(uint *)(&DAT_14026fc90 + (ulonglong)(byte)(uVar3 >> 8) * 4) ^
              *(uint *)(&DAT_14026f490 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_140270090 + (ulonglong)(uVar3 & 0xff) * 4) ^ puVar1[6];
      uVar3 = *(uint *)(&DAT_14026f890 + (ulonglong)(byte)(uVar3 >> 0x10) * 4) ^
              *(uint *)(&DAT_14026fc90 + (ulonglong)(byte)(uVar3 >> 8) * 4) ^
              *(uint *)(&DAT_14026f490 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_140270090 + (ulonglong)(uVar3 & 0xff) * 4) ^ puVar1[7];
      param_1 = *(uint *)(&DAT_14026f890 + (ulonglong)(byte)(uVar3 >> 0x10) * 4) ^
                *(uint *)(&DAT_14026fc90 + (ulonglong)(byte)(uVar3 >> 8) * 4) ^
                *(uint *)(&DAT_14026f490 + (ulonglong)(uVar3 >> 0x18) * 4) ^
                *(uint *)(&DAT_140270090 + (ulonglong)(uVar3 & 0xff) * 4);
      uVar2 = uVar2 - 1;
      puVar1 = param_2;
    } while (uVar2 != 0);
  }
  if (3 < (uint)uVar4) {
    uVar2 = uVar4 >> 2;
    do {
      param_1 = param_1 ^ *param_2;
      uVar4 = (ulonglong)((int)uVar4 - 4);
      param_2 = param_2 + 1;
      param_1 = *(uint *)(&DAT_14026f890 + (ulonglong)(byte)(param_1 >> 0x10) * 4) ^
                *(uint *)(&DAT_14026fc90 + (ulonglong)(byte)(param_1 >> 8) * 4) ^
                *(uint *)(&DAT_14026f490 + (ulonglong)(param_1 >> 0x18) * 4) ^
                *(uint *)(&DAT_140270090 + (ulonglong)(param_1 & 0xff) * 4);
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  uVar3 = (uint)uVar4;
  while (uVar3 != 0) {
    uVar3 = *param_2;
    param_2 = (uint *)((longlong)param_2 + 1);
    param_1 = *(uint *)(&DAT_14026f490 + (ulonglong)(byte)((byte)uVar3 ^ (byte)param_1) * 4) ^
              param_1 >> 8;
    uVar3 = (int)uVar4 - 1;
    uVar4 = (ulonglong)uVar3;
  }
  return ~param_1;
}



int FUN_1401df368(uint param_1,byte *param_2,uint param_3)

{
  uint *puVar1;
  uint *puVar2;
  ulonglong uVar3;
  uint uVar4;
  uint uVar5;
  ulonglong uVar6;
  
  uVar4 = ~(((param_1 & 0xff00) + param_1 * 0x10000) * 0x100 + (param_1 >> 8 & 0xff00) +
           (param_1 >> 0x18));
  for (; (uVar6 = (ulonglong)param_3, param_3 != 0 && (((ulonglong)param_2 & 3) != 0));
      param_2 = param_2 + 1) {
    uVar4 = *(uint *)(&DAT_140270490 + ((ulonglong)(uVar4 >> 0x18) ^ (ulonglong)*param_2) * 4) ^
            uVar4 << 8;
    param_3 = param_3 - 1;
  }
  puVar2 = (uint *)(param_2 + -4);
  if (0x1f < param_3) {
    uVar3 = (ulonglong)(param_3 >> 5);
    puVar1 = puVar2;
    do {
      uVar4 = uVar4 ^ puVar1[1];
      uVar4 = *(uint *)(&DAT_140270c90 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140270890 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_140271090 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140270490 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar1[2];
      uVar4 = *(uint *)(&DAT_140270c90 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140270890 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_140271090 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140270490 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar1[3];
      uVar4 = *(uint *)(&DAT_140270c90 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140270890 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_140271090 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140270490 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar1[4];
      uVar4 = *(uint *)(&DAT_140270c90 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140270890 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_140271090 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140270490 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar1[5];
      uVar4 = *(uint *)(&DAT_140270c90 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140270890 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_140271090 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140270490 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar1[6];
      puVar2 = puVar1 + 8;
      uVar6 = (ulonglong)((int)uVar6 - 0x20);
      uVar4 = *(uint *)(&DAT_140270c90 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140270890 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_140271090 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140270490 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar1[7];
      uVar4 = *(uint *)(&DAT_140270c90 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140270890 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_140271090 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140270490 + (ulonglong)(uVar4 & 0xff) * 4) ^ *puVar2;
      uVar4 = *(uint *)(&DAT_140270c90 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140270890 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_140271090 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140270490 + (ulonglong)(uVar4 & 0xff) * 4);
      uVar3 = uVar3 - 1;
      puVar1 = puVar2;
    } while (uVar3 != 0);
  }
  if (3 < (uint)uVar6) {
    uVar3 = uVar6 >> 2;
    do {
      puVar2 = puVar2 + 1;
      uVar6 = (ulonglong)((int)uVar6 - 4);
      uVar4 = uVar4 ^ *puVar2;
      uVar4 = *(uint *)(&DAT_140270c90 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140270890 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_140271090 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140270490 + (ulonglong)(uVar4 & 0xff) * 4);
      uVar3 = uVar3 - 1;
    } while (uVar3 != 0);
  }
  puVar2 = puVar2 + 1;
  uVar5 = (uint)uVar6;
  while (uVar5 != 0) {
    uVar5 = *puVar2;
    puVar2 = (uint *)((longlong)puVar2 + 1);
    uVar4 = *(uint *)(&DAT_140270490 + ((ulonglong)(uVar4 >> 0x18) ^ (ulonglong)(byte)uVar5) * 4) ^
            uVar4 << 8;
    uVar5 = (int)uVar6 - 1;
    uVar6 = (ulonglong)uVar5;
  }
  uVar4 = ~uVar4;
  return ((uVar4 & 0xff00) + uVar4 * 0x10000) * 0x100 + (uVar4 >> 8 & 0xff00) + (uVar4 >> 0x18);
}



uint FUN_1401df708(uint *param_1,uint param_2)

{
  uint uVar1;
  
  uVar1 = 0;
  for (; param_2 != 0; param_2 = param_2 >> 1) {
    if ((param_2 & 1) != 0) {
      uVar1 = uVar1 ^ *param_1;
    }
    param_1 = param_1 + 1;
  }
  return uVar1;
}



void FUN_1401df728(undefined4 *param_1,longlong param_2)

{
  undefined4 uVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar2 = param_2 - (longlong)param_1;
  lVar3 = 0x20;
  do {
    uVar1 = FUN_1401df708(param_2,*(undefined4 *)(lVar2 + (longlong)param_1));
    *param_1 = uVar1;
    param_1 = param_1 + 1;
    lVar3 = lVar3 + -1;
  } while (lVar3 != 0);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

uint FUN_1401df768(uint param_1,uint param_2,uint param_3)

{
  longlong lVar1;
  int iVar2;
  undefined1 auStack_138 [32];
  int local_118 [32];
  undefined1 local_98 [128];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_138;
  if (param_3 != 0) {
    iVar2 = 1;
    local_118[0] = -0x12477ce0;
    lVar1 = 1;
    do {
      local_118[lVar1] = iVar2;
      lVar1 = lVar1 + 1;
      iVar2 = iVar2 * 2;
    } while (lVar1 < 0x20);
    FUN_1401df728(local_98,local_118);
    FUN_1401df728(local_118,local_98);
    do {
      FUN_1401df728(local_98,local_118);
      if ((param_3 & 1) != 0) {
        param_1 = FUN_1401df708(local_98,param_1);
      }
      if ((int)param_3 >> 1 == 0) break;
      FUN_1401df728(local_118,local_98);
      if (((int)param_3 >> 1 & 1U) != 0) {
        param_1 = FUN_1401df708(local_118,param_1);
      }
      param_3 = (int)param_3 >> 2;
    } while (param_3 != 0);
    param_1 = param_1 ^ param_2;
  }
  return param_1;
}



undefined8 FUN_1401df858(undefined8 param_1,longlong param_2)

{
  undefined8 uVar1;
  
  if (param_2 == 0) {
    return 0;
  }
  uVar1 = FUN_1401df058();
  return uVar1;
}



void FUN_1401df878(longlong param_1)

{
  undefined2 *puVar1;
  longlong lVar2;
  
  puVar1 = (undefined2 *)(param_1 + 0xbc);
  lVar2 = 0x11e;
  do {
    *puVar1 = 0;
    puVar1 = puVar1 + 2;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  puVar1 = (undefined2 *)(param_1 + 0x9b0);
  lVar2 = 0x1e;
  do {
    *puVar1 = 0;
    puVar1 = puVar1 + 2;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  puVar1 = (undefined2 *)(param_1 + 0xaa4);
  lVar2 = 0x13;
  do {
    *puVar1 = 0;
    puVar1 = puVar1 + 2;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  *(undefined2 *)(param_1 + 0x4bc) = 1;
  *(undefined8 *)(param_1 + 0x1700) = 0;
  *(undefined4 *)(param_1 + 0x1708) = 0;
  *(undefined4 *)(param_1 + 0x16f4) = 0;
  return;
}



void FUN_1401df8f8(longlong param_1,longlong param_2,int param_3)

{
  ushort uVar1;
  ushort uVar2;
  int iVar3;
  int iVar4;
  longlong lVar5;
  int iVar6;
  longlong lVar7;
  
  iVar3 = *(int *)(param_1 + 0xba8 + (longlong)param_3 * 4);
  while( true ) {
    iVar6 = param_3 * 2;
    if (*(int *)(param_1 + 0x149c) < iVar6) break;
    if (iVar6 < *(int *)(param_1 + 0x149c)) {
      lVar5 = (longlong)*(int *)(param_1 + 0xbac + (longlong)iVar6 * 4);
      lVar7 = (longlong)*(int *)(param_1 + 0xba8 + (longlong)iVar6 * 4);
      uVar1 = *(ushort *)(param_2 + lVar7 * 4);
      uVar2 = *(ushort *)(param_2 + lVar5 * 4);
      if ((uVar2 < uVar1) ||
         ((uVar2 == uVar1 &&
          (*(byte *)(lVar5 + 0x14a4 + param_1) <= *(byte *)(lVar7 + 0x14a4 + param_1))))) {
        iVar6 = iVar6 + 1;
      }
    }
    iVar4 = *(int *)(param_1 + 0xba8 + (longlong)iVar6 * 4);
    uVar1 = *(ushort *)(param_2 + (longlong)iVar4 * 4);
    uVar2 = *(ushort *)(param_2 + (longlong)iVar3 * 4);
    if ((uVar2 < uVar1) ||
       ((uVar2 == uVar1 &&
        (*(byte *)((longlong)iVar3 + 0x14a4 + param_1) <=
         *(byte *)((longlong)iVar4 + 0x14a4 + param_1))))) break;
    *(int *)(param_1 + 0xba8 + (longlong)param_3 * 4) = iVar4;
    param_3 = iVar6;
  }
  *(int *)(param_1 + 0xba8 + (longlong)param_3 * 4) = iVar3;
  return;
}



void FUN_1401df9b8(longlong param_1,longlong *param_2)

{
  short *psVar1;
  short sVar2;
  ushort uVar3;
  int iVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  uint uVar9;
  uint uVar10;
  longlong lVar11;
  ulonglong uVar12;
  uint uVar13;
  ulonglong uVar14;
  int *piVar15;
  undefined2 *puVar16;
  longlong lVar17;
  int iVar18;
  longlong lVar19;
  int iVar20;
  longlong lVar21;
  int iVar22;
  
  plVar5 = (longlong *)param_2[2];
  lVar7 = param_2[1];
  lVar6 = *param_2;
  lVar8 = plVar5[2];
  lVar19 = *plVar5;
  lVar21 = plVar5[1];
  uVar13 = *(uint *)(plVar5 + 3);
  uVar14 = (ulonglong)(int)uVar13;
  puVar16 = (undefined2 *)(param_1 + 0xb88);
  for (lVar11 = 0x10; lVar11 != 0; lVar11 = lVar11 + -1) {
    *puVar16 = 0;
    puVar16 = puVar16 + 1;
  }
  *(undefined2 *)
   (lVar6 + 2 + (longlong)*(int *)(param_1 + 0xba8 + (longlong)*(int *)(param_1 + 0x14a0) * 4) * 4)
       = 0;
  iVar18 = 0;
  iVar22 = *(int *)(param_1 + 0x14a0) + 1;
  lVar11 = (longlong)iVar22;
  if (lVar11 < 0x23d) {
    lVar17 = 0x23d - lVar11;
    piVar15 = (int *)(param_1 + 0xba8 + lVar11 * 4);
    iVar22 = iVar22 + (int)lVar17;
    do {
      iVar4 = *piVar15;
      lVar11 = (longlong)iVar4;
      uVar10 = *(ushort *)(lVar6 + 2 + (ulonglong)*(ushort *)(lVar6 + 2 + lVar11 * 4) * 4) + 1;
      if ((int)uVar13 < (int)uVar10) {
        iVar18 = iVar18 + 1;
        uVar10 = uVar13;
      }
      *(short *)(lVar6 + 2 + lVar11 * 4) = (short)uVar10;
      if (iVar4 <= (int)lVar7) {
        psVar1 = (short *)(param_1 + 0xb88 + (longlong)(int)uVar10 * 2);
        *psVar1 = *psVar1 + 1;
        iVar20 = 0;
        if ((int)lVar8 <= iVar4) {
          iVar20 = *(int *)(lVar21 + (lVar11 - (int)lVar8) * 4);
        }
        uVar9 = (uint)*(ushort *)(lVar6 + lVar11 * 4);
        *(int *)(param_1 + 0x1700) = *(int *)(param_1 + 0x1700) + (iVar20 + uVar10) * uVar9;
        if (lVar19 != 0) {
          *(int *)(param_1 + 0x1704) =
               *(int *)(param_1 + 0x1704) +
               ((uint)*(ushort *)(lVar19 + 2 + lVar11 * 4) + iVar20) * uVar9;
        }
      }
      piVar15 = piVar15 + 1;
      lVar17 = lVar17 + -1;
    } while (lVar17 != 0);
  }
  if (iVar18 != 0) {
    do {
      uVar12 = (ulonglong)(int)(uVar13 - 1);
      sVar2 = *(short *)(param_1 + 0xb88 + uVar12 * 2);
      uVar10 = uVar13 - 1;
      while (sVar2 == 0) {
        uVar10 = (int)uVar12 - 1;
        uVar12 = (ulonglong)uVar10;
        sVar2 = *(short *)(param_1 + 0xb88 + (longlong)(int)uVar10 * 2);
      }
      iVar18 = iVar18 + -2;
      psVar1 = (short *)(param_1 + 0xb88 + (longlong)(int)uVar10 * 2);
      *psVar1 = *psVar1 + -1;
      psVar1 = (short *)(param_1 + 0xb8a + (longlong)(int)uVar10 * 2);
      *psVar1 = *psVar1 + 2;
      psVar1 = (short *)(param_1 + 0xb88 + uVar14 * 2);
      *psVar1 = *psVar1 + -1;
    } while (0 < iVar18);
    lVar19 = (longlong)iVar22;
    while (uVar13 != 0) {
      uVar13 = (uint)uVar14;
      uVar3 = *(ushort *)(param_1 + 0xb88 + (longlong)(int)uVar13 * 2);
      uVar10 = (uint)uVar3;
      if (uVar3 != 0) {
        piVar15 = (int *)(param_1 + 0xba8 + lVar19 * 4);
        do {
          piVar15 = piVar15 + -1;
          lVar19 = lVar19 + -1;
          if (*piVar15 <= (int)lVar7) {
            lVar21 = (longlong)*piVar15;
            uVar9 = (uint)*(ushort *)(lVar6 + 2 + lVar21 * 4);
            if (uVar9 != uVar13) {
              *(int *)(param_1 + 0x1700) =
                   *(int *)(param_1 + 0x1700) +
                   (uVar13 - uVar9) * (uint)*(ushort *)(lVar6 + lVar21 * 4);
              *(short *)(lVar6 + 2 + lVar21 * 4) = (short)uVar14;
            }
            uVar10 = uVar10 - 1;
          }
        } while (uVar10 != 0);
      }
      uVar13 = uVar13 - 1;
      uVar14 = (ulonglong)uVar13;
    }
  }
  return;
}



// Library Function - Single Match
//  scan_tree
// 
// Libraries: Visual Studio 2010 Release, Visual Studio 2015 Release

void scan_tree(longlong param_1,longlong param_2,int param_3)

{
  short *psVar1;
  ushort uVar2;
  int iVar3;
  longlong lVar4;
  ushort *puVar5;
  uint uVar6;
  uint uVar7;
  uint uVar8;
  int iVar9;
  int iVar10;
  
  uVar2 = *(ushort *)(param_2 + 2);
  uVar6 = 0xffffffff;
  iVar10 = 0;
  iVar3 = 7;
  iVar9 = 4;
  if (uVar2 == 0) {
    iVar3 = 0x8a;
    iVar9 = 3;
  }
  lVar4 = (longlong)param_3;
  *(undefined2 *)(param_2 + 6 + lVar4 * 4) = 0xffff;
  if (-1 < lVar4) {
    puVar5 = (ushort *)(param_2 + 6);
    lVar4 = lVar4 + 1;
    uVar7 = (uint)uVar2;
    do {
      iVar10 = iVar10 + 1;
      uVar2 = *puVar5;
      uVar8 = (uint)uVar2;
      if ((iVar3 <= iVar10) || (uVar7 != uVar8)) {
        if (iVar10 < iVar9) {
          psVar1 = (short *)(param_1 + 0xaa4 + (longlong)(int)uVar7 * 4);
          *psVar1 = *psVar1 + (short)iVar10;
        }
        else if (uVar7 == 0) {
          if (iVar10 < 0xb) {
            *(short *)(param_1 + 0xae8) = *(short *)(param_1 + 0xae8) + 1;
          }
          else {
            *(short *)(param_1 + 0xaec) = *(short *)(param_1 + 0xaec) + 1;
          }
        }
        else {
          if (uVar7 != uVar6) {
            psVar1 = (short *)(param_1 + 0xaa4 + (longlong)(int)uVar7 * 4);
            *psVar1 = *psVar1 + 1;
          }
          *(short *)(param_1 + 0xae4) = *(short *)(param_1 + 0xae4) + 1;
        }
        iVar10 = 0;
        uVar6 = uVar7;
        if (uVar2 == 0) {
          iVar3 = 0x8a;
        }
        else {
          if (uVar7 != uVar8) {
            iVar3 = 7;
            iVar9 = 4;
            goto LAB_1401dfc8c;
          }
          iVar3 = 6;
        }
        iVar9 = 3;
      }
LAB_1401dfc8c:
      puVar5 = puVar5 + 2;
      lVar4 = lVar4 + -1;
      uVar7 = uVar8;
    } while (lVar4 != 0);
  }
  return;
}



void FUN_1401dfcb8(longlong param_1,longlong param_2,int param_3)

{
  ushort uVar1;
  ushort uVar2;
  ushort uVar3;
  int iVar4;
  byte bVar5;
  int iVar6;
  longlong lVar7;
  ushort *puVar8;
  uint uVar9;
  uint uVar10;
  uint uVar11;
  short sVar12;
  int iVar13;
  longlong lVar15;
  int iVar16;
  int iVar14;
  
  uVar11 = 0xffffffff;
  iVar14 = 0;
  iVar4 = 7;
  iVar16 = 3;
  iVar6 = 4;
  if (*(ushort *)(param_2 + 2) == 0) {
    iVar4 = 0x8a;
    iVar6 = iVar16;
  }
  if (-1 < param_3) {
    puVar8 = (ushort *)(param_2 + 6);
    lVar15 = (longlong)param_3 + 1;
    uVar9 = (uint)*(ushort *)(param_2 + 2);
    do {
      iVar13 = iVar14 + 1;
      lVar7 = (longlong)(int)uVar9;
      uVar1 = *puVar8;
      uVar10 = (uint)uVar1;
      if ((iVar4 <= iVar13) || (uVar9 != uVar10)) {
        if (iVar13 < iVar6) {
          do {
            uVar11 = (uint)*(ushort *)(param_1 + 0xaa6 + lVar7 * 4);
            iVar6 = *(int *)(param_1 + 0x1714);
            if ((int)(0x10 - uVar11) < iVar6) {
              uVar3 = *(ushort *)(param_1 + 0xaa4 + lVar7 * 4);
              *(ushort *)(param_1 + 0x1710) =
                   *(ushort *)(param_1 + 0x1710) | uVar3 << ((byte)iVar6 & 0x1f);
              *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10))
                   = *(undefined1 *)(param_1 + 0x1710);
              *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
              *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10))
                   = *(undefined1 *)(param_1 + 0x1711);
              *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
              iVar6 = *(int *)(param_1 + 0x1714) + -0x10;
              *(ushort *)(param_1 + 0x1710) =
                   uVar3 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
            }
            else {
              *(ushort *)(param_1 + 0x1710) =
                   *(ushort *)(param_1 + 0x1710) |
                   *(short *)(param_1 + 0xaa4 + lVar7 * 4) << ((byte)iVar6 & 0x1f);
            }
            iVar13 = iVar13 + -1;
            *(uint *)(param_1 + 0x1714) = iVar6 + uVar11;
          } while (iVar13 != 0);
        }
        else {
          if (uVar9 == 0) {
            iVar6 = *(int *)(param_1 + 0x1714);
            sVar12 = (short)iVar13;
            bVar5 = (byte)iVar6;
            if (iVar13 < 0xb) {
              uVar3 = *(ushort *)(param_1 + 0xaea);
              if ((int)(0x10 - (uint)uVar3) < iVar6) {
                uVar2 = *(ushort *)(param_1 + 0xae8);
                *(ushort *)(param_1 + 0x1710) =
                     *(ushort *)(param_1 + 0x1710) | uVar2 << (bVar5 & 0x1f);
                *(undefined1 *)
                 ((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                     *(undefined1 *)(param_1 + 0x1710);
                *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
                *(undefined1 *)
                 ((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                     *(undefined1 *)(param_1 + 0x1711);
                *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
                iVar6 = *(int *)(param_1 + 0x1714) + -0x10;
                *(ushort *)(param_1 + 0x1710) =
                     uVar2 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
              }
              else {
                *(ushort *)(param_1 + 0x1710) =
                     *(ushort *)(param_1 + 0x1710) | *(short *)(param_1 + 0xae8) << (bVar5 & 0x1f);
              }
              iVar6 = iVar6 + (uint)uVar3;
              *(int *)(param_1 + 0x1714) = iVar6;
              if (iVar6 < 0xe) {
                sVar12 = sVar12 + -3;
                iVar4 = iVar6 + 3;
LAB_1401e01a4:
                *(ushort *)(param_1 + 0x1710) =
                     *(ushort *)(param_1 + 0x1710) | sVar12 << ((byte)iVar6 & 0x1f);
              }
              else {
                *(ushort *)(param_1 + 0x1710) =
                     *(ushort *)(param_1 + 0x1710) | sVar12 - 3U << ((byte)iVar6 & 0x1f);
                *(undefined1 *)
                 ((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                     *(undefined1 *)(param_1 + 0x1710);
                *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
                *(undefined1 *)
                 ((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                     *(undefined1 *)(param_1 + 0x1711);
                *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
                iVar4 = *(int *)(param_1 + 0x1714) + -0xd;
                *(ushort *)(param_1 + 0x1710) =
                     (ushort)(sVar12 - 3U) >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
              }
            }
            else {
              uVar3 = *(ushort *)(param_1 + 0xaee);
              if ((int)(0x10 - (uint)uVar3) < iVar6) {
                uVar2 = *(ushort *)(param_1 + 0xaec);
                *(ushort *)(param_1 + 0x1710) =
                     *(ushort *)(param_1 + 0x1710) | uVar2 << (bVar5 & 0x1f);
                *(undefined1 *)
                 ((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                     *(undefined1 *)(param_1 + 0x1710);
                *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
                *(undefined1 *)
                 ((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                     *(undefined1 *)(param_1 + 0x1711);
                *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
                iVar6 = *(int *)(param_1 + 0x1714) + -0x10;
                *(ushort *)(param_1 + 0x1710) =
                     uVar2 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
              }
              else {
                *(ushort *)(param_1 + 0x1710) =
                     *(ushort *)(param_1 + 0x1710) | *(short *)(param_1 + 0xaec) << (bVar5 & 0x1f);
              }
              iVar6 = iVar6 + (uint)uVar3;
              *(int *)(param_1 + 0x1714) = iVar6;
              if (iVar6 < 10) {
                sVar12 = sVar12 + -0xb;
                iVar4 = iVar6 + 7;
                goto LAB_1401e01a4;
              }
              *(ushort *)(param_1 + 0x1710) =
                   *(ushort *)(param_1 + 0x1710) | sVar12 - 0xbU << ((byte)iVar6 & 0x1f);
              *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10))
                   = *(undefined1 *)(param_1 + 0x1710);
              *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
              *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10))
                   = *(undefined1 *)(param_1 + 0x1711);
              *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
              iVar4 = *(int *)(param_1 + 0x1714) + -9;
              *(ushort *)(param_1 + 0x1710) =
                   (ushort)(sVar12 - 0xbU) >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
            }
          }
          else {
            if (uVar9 != uVar11) {
              uVar11 = (uint)*(ushort *)(param_1 + 0xaa6 + lVar7 * 4);
              iVar6 = *(int *)(param_1 + 0x1714);
              if ((int)(0x10 - uVar11) < iVar6) {
                uVar3 = *(ushort *)(param_1 + 0xaa4 + lVar7 * 4);
                *(ushort *)(param_1 + 0x1710) =
                     *(ushort *)(param_1 + 0x1710) | uVar3 << ((byte)iVar6 & 0x1f);
                *(undefined1 *)
                 ((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                     *(undefined1 *)(param_1 + 0x1710);
                *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
                *(undefined1 *)
                 ((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                     *(undefined1 *)(param_1 + 0x1711);
                *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
                iVar6 = *(int *)(param_1 + 0x1714) + -0x10;
                *(ushort *)(param_1 + 0x1710) =
                     uVar3 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
              }
              else {
                *(ushort *)(param_1 + 0x1710) =
                     *(ushort *)(param_1 + 0x1710) |
                     *(short *)(param_1 + 0xaa4 + lVar7 * 4) << ((byte)iVar6 & 0x1f);
              }
              *(uint *)(param_1 + 0x1714) = iVar6 + uVar11;
              iVar13 = iVar14;
            }
            uVar3 = *(ushort *)(param_1 + 0xae6);
            iVar6 = *(int *)(param_1 + 0x1714);
            if ((int)(0x10 - (uint)uVar3) < iVar6) {
              uVar2 = *(ushort *)(param_1 + 0xae4);
              *(ushort *)(param_1 + 0x1710) =
                   *(ushort *)(param_1 + 0x1710) | uVar2 << ((byte)iVar6 & 0x1f);
              *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10))
                   = *(undefined1 *)(param_1 + 0x1710);
              *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
              *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10))
                   = *(undefined1 *)(param_1 + 0x1711);
              *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
              iVar6 = *(int *)(param_1 + 0x1714) + -0x10;
              *(ushort *)(param_1 + 0x1710) =
                   uVar2 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
            }
            else {
              *(ushort *)(param_1 + 0x1710) =
                   *(ushort *)(param_1 + 0x1710) |
                   *(short *)(param_1 + 0xae4) << ((byte)iVar6 & 0x1f);
            }
            iVar6 = iVar6 + (uint)uVar3;
            *(int *)(param_1 + 0x1714) = iVar6;
            if (iVar6 < 0xf) {
              sVar12 = (short)iVar13 + -3;
              iVar4 = iVar6 + 2;
              goto LAB_1401e01a4;
            }
            uVar3 = (short)iVar13 - 3;
            *(ushort *)(param_1 + 0x1710) =
                 *(ushort *)(param_1 + 0x1710) | uVar3 << ((byte)iVar6 & 0x1f);
            *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                 *(undefined1 *)(param_1 + 0x1710);
            *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
            *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                 *(undefined1 *)(param_1 + 0x1711);
            *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
            iVar4 = *(int *)(param_1 + 0x1714) + -0xe;
            *(ushort *)(param_1 + 0x1710) =
                 uVar3 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
          }
          *(int *)(param_1 + 0x1714) = iVar4;
        }
        iVar13 = 0;
        uVar11 = uVar9;
        if (uVar1 == 0) {
          iVar4 = 0x8a;
          iVar6 = iVar16;
        }
        else if (uVar9 == uVar10) {
          iVar4 = 6;
          iVar6 = iVar16;
        }
        else {
          iVar4 = 7;
          iVar6 = 4;
        }
      }
      iVar14 = iVar13;
      puVar8 = puVar8 + 2;
      lVar15 = lVar15 + -1;
      uVar9 = uVar10;
    } while (lVar15 != 0);
  }
  return;
}



void FUN_1401e0218(longlong param_1,int param_2,int param_3,uint param_4)

{
  ushort uVar1;
  int iVar2;
  int iVar3;
  byte *pbVar4;
  ulonglong uVar5;
  
  iVar2 = *(int *)(param_1 + 0x1714);
  uVar5 = (ulonglong)param_4;
  if (iVar2 < 0xc) {
    *(ushort *)(param_1 + 0x1710) =
         *(ushort *)(param_1 + 0x1710) | (short)param_2 + -0x101 << ((byte)iVar2 & 0x1f);
    iVar2 = iVar2 + 5;
  }
  else {
    uVar1 = (short)param_2 - 0x101;
    *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | uVar1 << ((byte)iVar2 & 0x1f);
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1711);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    iVar2 = *(int *)(param_1 + 0x1714) + -0xb;
    *(ushort *)(param_1 + 0x1710) = uVar1 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
  }
  *(int *)(param_1 + 0x1714) = iVar2;
  if (iVar2 < 0xc) {
    *(ushort *)(param_1 + 0x1710) =
         *(ushort *)(param_1 + 0x1710) | (short)param_3 + -1 << ((byte)iVar2 & 0x1f);
    iVar2 = iVar2 + 5;
  }
  else {
    uVar1 = (short)param_3 - 1;
    *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | uVar1 << ((byte)iVar2 & 0x1f);
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1711);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    iVar2 = *(int *)(param_1 + 0x1714) + -0xb;
    *(ushort *)(param_1 + 0x1710) = uVar1 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
  }
  *(int *)(param_1 + 0x1714) = iVar2;
  if (iVar2 < 0xd) {
    *(ushort *)(param_1 + 0x1710) =
         *(ushort *)(param_1 + 0x1710) | (short)param_4 + -4 << ((byte)iVar2 & 0x1f);
    iVar2 = iVar2 + 4;
  }
  else {
    uVar1 = (short)param_4 - 4;
    *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | uVar1 << ((byte)iVar2 & 0x1f);
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1711);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    iVar2 = *(int *)(param_1 + 0x1714) + -0xc;
    *(ushort *)(param_1 + 0x1710) = uVar1 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
  }
  *(int *)(param_1 + 0x1714) = iVar2;
  if (0 < (int)param_4) {
    pbVar4 = &DAT_1402715e0;
    do {
      iVar2 = *(int *)(param_1 + 0x1714);
      if (iVar2 < 0xe) {
        iVar3 = iVar2 + 3;
        *(ushort *)(param_1 + 0x1710) =
             *(ushort *)(param_1 + 0x1710) |
             *(short *)(param_1 + 0xaa6 + (ulonglong)*pbVar4 * 4) << ((byte)iVar2 & 0x1f);
      }
      else {
        uVar1 = *(ushort *)(param_1 + 0xaa6 + (ulonglong)*pbVar4 * 4);
        *(ushort *)(param_1 + 0x1710) =
             *(ushort *)(param_1 + 0x1710) | uVar1 << ((byte)iVar2 & 0x1f);
        *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
             *(undefined1 *)(param_1 + 0x1710);
        *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
        *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
             *(undefined1 *)(param_1 + 0x1711);
        *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
        iVar3 = *(int *)(param_1 + 0x1714) + -0xd;
        *(ushort *)(param_1 + 0x1710) = uVar1 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
      }
      pbVar4 = pbVar4 + 1;
      uVar5 = uVar5 - 1;
      *(int *)(param_1 + 0x1714) = iVar3;
    } while (uVar5 != 0);
  }
  FUN_1401dfcb8(param_1,param_1 + 0xbc,param_2 + -1);
  FUN_1401dfcb8(param_1,param_1 + 0x9b0,param_3 + -1);
  return;
}



void FUN_1401e0548(longlong param_1,longlong param_2,longlong param_3)

{
  byte bVar1;
  byte bVar2;
  int iVar3;
  int iVar4;
  byte bVar5;
  ulonglong uVar6;
  longlong lVar7;
  uint uVar8;
  ulonglong uVar9;
  uint uVar10;
  ushort uVar11;
  ushort uVar12;
  uint uVar13;
  longlong lVar14;
  
  uVar9 = 0;
  if (*(int *)(param_1 + 0x16f4) != 0) {
    lVar14 = 0;
    do {
      iVar3 = *(int *)(param_1 + 0x1714);
      uVar12 = *(ushort *)(*(longlong *)(param_1 + 0x16f8) + lVar14);
      lVar14 = lVar14 + 2;
      bVar1 = *(byte *)(uVar9 + *(longlong *)(param_1 + 0x16e8));
      uVar8 = (int)uVar9 + 1;
      uVar9 = (ulonglong)uVar8;
      bVar5 = (byte)iVar3;
      if (uVar12 == 0) {
        lVar7 = (longlong)(int)(uint)bVar1;
        uVar13 = (uint)*(ushort *)(param_2 + 2 + lVar7 * 4);
        if ((int)(0x10 - uVar13) < iVar3) {
          uVar12 = *(ushort *)(param_2 + lVar7 * 4);
          *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | uVar12 << (bVar5 & 0x1f);
          *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
               *(undefined1 *)(param_1 + 0x1710);
          *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
               *(undefined1 *)(param_1 + 0x1711);
          *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
          iVar3 = *(int *)(param_1 + 0x1714) + -0x10 + uVar13;
          *(ushort *)(param_1 + 0x1710) =
               uVar12 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
        }
        else {
          *(ushort *)(param_1 + 0x1710) =
               *(ushort *)(param_1 + 0x1710) | *(short *)(param_2 + lVar7 * 4) << (bVar5 & 0x1f);
          iVar3 = iVar3 + uVar13;
        }
LAB_1401e08b8:
        *(int *)(param_1 + 0x1714) = iVar3;
      }
      else {
        bVar2 = (&DAT_140271d00)[bVar1];
        uVar13 = bVar2 + 0x101;
        uVar10 = (uint)*(ushort *)(param_2 + 2 + (ulonglong)uVar13 * 4);
        if ((int)(0x10 - uVar10) < iVar3) {
          uVar11 = *(ushort *)(param_2 + (ulonglong)uVar13 * 4);
          *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | uVar11 << (bVar5 & 0x1f);
          *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
               *(undefined1 *)(param_1 + 0x1710);
          *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
               *(undefined1 *)(param_1 + 0x1711);
          *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
          iVar3 = *(int *)(param_1 + 0x1714) + -0x10;
          *(ushort *)(param_1 + 0x1710) =
               uVar11 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
        }
        else {
          *(ushort *)(param_1 + 0x1710) =
               *(ushort *)(param_1 + 0x1710) |
               *(short *)(param_2 + (ulonglong)uVar13 * 4) << (bVar5 & 0x1f);
        }
        iVar3 = iVar3 + uVar10;
        *(int *)(param_1 + 0x1714) = iVar3;
        iVar4 = *(int *)(&DAT_140271490 + (ulonglong)bVar2 * 4);
        if (iVar4 != 0) {
          uVar11 = (ushort)bVar1 - (short)*(undefined4 *)(&DAT_140271e00 + (ulonglong)bVar2 * 4);
          if (0x10 - iVar4 < iVar3) {
            *(ushort *)(param_1 + 0x1710) =
                 *(ushort *)(param_1 + 0x1710) | uVar11 << ((byte)iVar3 & 0x1f);
            *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                 *(undefined1 *)(param_1 + 0x1710);
            *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
            *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                 *(undefined1 *)(param_1 + 0x1711);
            *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
            iVar3 = *(int *)(param_1 + 0x1714) + -0x10;
            *(ushort *)(param_1 + 0x1710) =
                 uVar11 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
          }
          else {
            *(ushort *)(param_1 + 0x1710) =
                 *(ushort *)(param_1 + 0x1710) | uVar11 << ((byte)iVar3 & 0x1f);
          }
          *(int *)(param_1 + 0x1714) = iVar3 + iVar4;
        }
        uVar13 = uVar12 - 1;
        if (uVar13 < 0x100) {
          bVar1 = (&DAT_140271b00)[uVar13];
        }
        else {
          bVar1 = (&DAT_140271b00)[(uVar13 >> 7) + 0x100];
        }
        uVar6 = (ulonglong)bVar1;
        uVar10 = (uint)*(ushort *)(param_3 + 2 + uVar6 * 4);
        iVar4 = *(int *)(param_1 + 0x1714);
        if ((int)(0x10 - uVar10) < iVar4) {
          uVar12 = *(ushort *)(param_3 + uVar6 * 4);
          *(ushort *)(param_1 + 0x1710) =
               *(ushort *)(param_1 + 0x1710) | uVar12 << ((byte)iVar4 & 0x1f);
          *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
               *(undefined1 *)(param_1 + 0x1710);
          *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
          *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
               *(undefined1 *)(param_1 + 0x1711);
          *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
          iVar4 = *(int *)(param_1 + 0x1714) + -0x10;
          *(ushort *)(param_1 + 0x1710) =
               uVar12 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
        }
        else {
          *(ushort *)(param_1 + 0x1710) =
               *(ushort *)(param_1 + 0x1710) |
               *(short *)(param_3 + uVar6 * 4) << ((byte)iVar4 & 0x1f);
        }
        iVar4 = iVar4 + uVar10;
        *(int *)(param_1 + 0x1714) = iVar4;
        iVar3 = *(int *)(&DAT_140271510 + uVar6 * 4);
        if (iVar3 != 0) {
          uVar12 = (short)uVar13 - (short)*(undefined4 *)(&DAT_140271e80 + uVar6 * 4);
          if (0x10 - iVar3 < iVar4) {
            *(ushort *)(param_1 + 0x1710) =
                 *(ushort *)(param_1 + 0x1710) | uVar12 << ((byte)iVar4 & 0x1f);
            *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                 *(undefined1 *)(param_1 + 0x1710);
            *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
            *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
                 *(undefined1 *)(param_1 + 0x1711);
            *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
            iVar3 = *(int *)(param_1 + 0x1714) + -0x10 + iVar3;
            *(ushort *)(param_1 + 0x1710) =
                 uVar12 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
          }
          else {
            iVar3 = iVar4 + iVar3;
            *(ushort *)(param_1 + 0x1710) =
                 *(ushort *)(param_1 + 0x1710) | uVar12 << ((byte)iVar4 & 0x1f);
          }
          goto LAB_1401e08b8;
        }
      }
    } while (uVar8 < *(uint *)(param_1 + 0x16f4));
  }
  uVar12 = *(ushort *)(param_2 + 0x402);
  iVar3 = *(int *)(param_1 + 0x1714);
  if ((int)(0x10 - (uint)uVar12) < iVar3) {
    uVar11 = *(ushort *)(param_2 + 0x400);
    *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | uVar11 << ((byte)iVar3 & 0x1f);
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1711);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    iVar3 = *(int *)(param_1 + 0x1714) + -0x10;
    *(ushort *)(param_1 + 0x1710) = uVar11 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
  }
  else {
    *(ushort *)(param_1 + 0x1710) =
         *(ushort *)(param_1 + 0x1710) | *(short *)(param_2 + 0x400) << ((byte)iVar3 & 0x1f);
  }
  *(uint *)(param_1 + 0x1714) = iVar3 + (uint)uVar12;
  *(uint *)(param_1 + 0x170c) = (uint)*(ushort *)(param_2 + 0x402);
  return;
}



void FUN_1401e0998(longlong *param_1)

{
  uint uVar1;
  short *psVar3;
  longlong lVar4;
  ulonglong uVar5;
  ulonglong uVar2;
  
  uVar2 = 0;
  psVar3 = (short *)((longlong)param_1 + 0xbc);
  uVar5 = uVar2;
  do {
    uVar1 = (uint)uVar2;
    if (*psVar3 != 0) break;
    uVar5 = uVar5 + 1;
    uVar1 = uVar1 + 1;
    uVar2 = (ulonglong)uVar1;
    psVar3 = psVar3 + 2;
  } while ((longlong)uVar5 < 9);
  if (uVar1 == 9) {
    uVar1 = 0xe;
    psVar3 = (short *)((longlong)param_1 + 0xf4);
    lVar4 = 0xe;
    do {
      if (*psVar3 != 0) break;
      lVar4 = lVar4 + 1;
      uVar1 = uVar1 + 1;
      psVar3 = psVar3 + 2;
    } while (lVar4 < 0x20);
  }
  *(uint *)(*param_1 + 0x48) = (uint)(uVar1 == 0x20);
  return;
}



uint FUN_1401e0a08(uint param_1,int param_2)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  
  uVar1 = 0;
  do {
    uVar2 = uVar1;
    param_2 = param_2 + -1;
    uVar3 = param_1 & 1;
    param_1 = param_1 >> 1;
    uVar1 = (uVar2 | uVar3) * 2;
  } while (0 < param_2);
  return uVar2 & 0x7fffffff | uVar3;
}



void FUN_1401e0a28(longlong param_1)

{
  ushort uVar1;
  
  if (*(int *)(param_1 + 0x1714) == 0x10) {
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1711);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    uVar1 = 0;
    *(undefined4 *)(param_1 + 0x1714) = 0;
  }
  else {
    if (*(int *)(param_1 + 0x1714) < 8) {
      return;
    }
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(int *)(param_1 + 0x1714) = *(int *)(param_1 + 0x1714) + -8;
    uVar1 = (ushort)*(byte *)(param_1 + 0x1711);
  }
  *(ushort *)(param_1 + 0x1710) = uVar1;
  return;
}



void FUN_1401e0aa8(longlong param_1)

{
  undefined1 uVar1;
  
  if (*(int *)(param_1 + 0x1714) < 9) {
    if (*(int *)(param_1 + 0x1714) < 1) goto LAB_1401e0aef;
    uVar1 = *(undefined1 *)(param_1 + 0x1710);
  }
  else {
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    uVar1 = *(undefined1 *)(param_1 + 0x1711);
  }
  *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) = uVar1;
  *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
LAB_1401e0aef:
  *(undefined2 *)(param_1 + 0x1710) = 0;
  *(undefined4 *)(param_1 + 0x1714) = 0;
  return;
}



void FUN_1401e0b08(longlong param_1,undefined1 *param_2,int param_3,int param_4)

{
  byte bVar1;
  
  FUN_1401e0aa8();
  *(undefined4 *)(param_1 + 0x170c) = 8;
  if (param_4 != 0) {
    *(byte *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) = (byte)param_3;
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    bVar1 = (byte)((uint)param_3 >> 8);
    *(byte *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) = bVar1;
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(byte *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) = ~(byte)param_3
    ;
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(byte *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) = ~bVar1;
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
  }
  for (; param_3 != 0; param_3 = param_3 + -1) {
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) = *param_2
    ;
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    param_2 = param_2 + 1;
  }
  return;
}



void FUN_1401e0bb8(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x170c) = 8;
  *(longlong *)(param_1 + 0xb40) = param_1 + 0xbc;
  *(undefined ***)(param_1 + 0xb50) = &PTR_DAT_14030c910;
  *(longlong *)(param_1 + 0xb58) = param_1 + 0x9b0;
  *(undefined ***)(param_1 + 0xb68) = &PTR_DAT_14030c930;
  *(longlong *)(param_1 + 0xb70) = param_1 + 0xaa4;
  *(undefined **)(param_1 + 0xb80) = &DAT_14030c950;
  *(undefined2 *)(param_1 + 0x1710) = 0;
  *(undefined4 *)(param_1 + 0x1714) = 0;
  FUN_1401df878();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401e0c38(longlong param_1,int param_2,longlong param_3)

{
  ushort uVar1;
  undefined2 uVar2;
  short sVar3;
  longlong lVar4;
  longlong lVar5;
  undefined1 auStack_58 [32];
  short asStack_38 [16];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStack_58;
  lVar5 = 0;
  sVar3 = 0;
  lVar4 = 1;
  do {
    sVar3 = (sVar3 + *(short *)(param_3 + -2 + lVar4 * 2)) * 2;
    asStack_38[lVar4] = sVar3;
    lVar4 = lVar4 + 1;
  } while (lVar4 < 0x10);
  lVar4 = (longlong)param_2;
  if (-1 < param_2) {
    do {
      uVar1 = *(ushort *)(param_1 + 2 + lVar5 * 4);
      if (uVar1 != 0) {
        asStack_38[uVar1] = asStack_38[uVar1] + 1;
        uVar2 = FUN_1401e0a08();
        *(undefined2 *)(param_1 + lVar5 * 4) = uVar2;
      }
      lVar5 = lVar5 + 1;
    } while (lVar5 <= lVar4);
  }
  return;
}



void FUN_1401e0cd8(longlong param_1,longlong *param_2)

{
  byte bVar1;
  longlong lVar2;
  byte bVar3;
  int iVar4;
  longlong lVar5;
  longlong lVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  ulonglong uVar10;
  
  lVar2 = *param_2;
  iVar4 = *(int *)(param_2[2] + 0x14);
  uVar10 = (ulonglong)iVar4;
  lVar6 = *(longlong *)param_2[2];
  iVar7 = -1;
  *(undefined4 *)(param_1 + 0x149c) = 0;
  *(undefined4 *)(param_1 + 0x14a0) = 0x23d;
  iVar8 = 0;
  lVar5 = 0;
  if (0 < iVar4) {
    do {
      if (*(short *)(lVar2 + lVar5 * 4) == 0) {
        *(undefined2 *)(lVar2 + 2 + lVar5 * 4) = 0;
      }
      else {
        *(int *)(param_1 + 0x149c) = *(int *)(param_1 + 0x149c) + 1;
        *(int *)(param_1 + 0xba8 + (longlong)*(int *)(param_1 + 0x149c) * 4) = iVar8;
        *(undefined1 *)(lVar5 + 0x14a4 + param_1) = 0;
        iVar7 = iVar8;
      }
      lVar5 = lVar5 + 1;
      iVar8 = iVar8 + 1;
    } while (lVar5 < (longlong)uVar10);
  }
  while (*(int *)(param_1 + 0x149c) < 2) {
    if (iVar7 < 2) {
      iVar7 = iVar7 + 1;
      iVar4 = iVar7;
    }
    else {
      iVar4 = 0;
    }
    *(int *)(param_1 + 0x149c) = *(int *)(param_1 + 0x149c) + 1;
    *(int *)(param_1 + 0xba8 + (longlong)*(int *)(param_1 + 0x149c) * 4) = iVar4;
    lVar5 = (longlong)iVar4;
    *(undefined2 *)(lVar2 + lVar5 * 4) = 1;
    *(undefined1 *)(lVar5 + 0x14a4 + param_1) = 0;
    *(int *)(param_1 + 0x1700) = *(int *)(param_1 + 0x1700) + -1;
    if (lVar6 != 0) {
      *(int *)(param_1 + 0x1704) =
           *(int *)(param_1 + 0x1704) - (uint)*(ushort *)(lVar6 + 2 + lVar5 * 4);
    }
  }
  *(int *)(param_2 + 1) = iVar7;
  for (iVar4 = *(int *)(param_1 + 0x149c) / 2; 0 < iVar4; iVar4 = iVar4 + -1) {
    FUN_1401df8f8(param_1,lVar2,iVar4);
  }
  do {
    iVar4 = *(int *)(param_1 + 0xbac);
    lVar5 = (longlong)iVar4;
    *(undefined4 *)(param_1 + 0xbac) =
         *(undefined4 *)(param_1 + 0xba8 + (longlong)*(int *)(param_1 + 0x149c) * 4);
    *(int *)(param_1 + 0x149c) = *(int *)(param_1 + 0x149c) + -1;
    FUN_1401df8f8(param_1,lVar2,1);
    *(int *)(param_1 + 0x14a0) = *(int *)(param_1 + 0x14a0) + -1;
    iVar8 = *(int *)(param_1 + 0xbac);
    lVar6 = (longlong)iVar8;
    iVar9 = (int)uVar10;
    *(int *)(param_1 + 0xba8 + (longlong)*(int *)(param_1 + 0x14a0) * 4) = iVar4;
    *(int *)(param_1 + 0x14a0) = *(int *)(param_1 + 0x14a0) + -1;
    *(int *)(param_1 + 0xba8 + (longlong)*(int *)(param_1 + 0x14a0) * 4) = iVar8;
    *(short *)(lVar2 + (longlong)iVar9 * 4) =
         *(short *)(lVar2 + lVar6 * 4) + *(short *)(lVar2 + lVar5 * 4);
    bVar3 = *(byte *)(lVar5 + 0x14a4 + param_1);
    bVar1 = *(byte *)(lVar6 + 0x14a4 + param_1);
    if (bVar3 < bVar1) {
      bVar3 = bVar1;
    }
    *(byte *)((longlong)iVar9 + 0x14a4 + param_1) = bVar3 + 1;
    *(short *)(lVar2 + 2 + lVar6 * 4) = (short)uVar10;
    *(short *)(lVar2 + 2 + lVar5 * 4) = (short)uVar10;
    *(int *)(param_1 + 0xbac) = iVar9;
    uVar10 = (ulonglong)(iVar9 + 1);
    FUN_1401df8f8(param_1,lVar2,1);
  } while (1 < *(int *)(param_1 + 0x149c));
  *(int *)(param_1 + 0x14a0) = *(int *)(param_1 + 0x14a0) + -1;
  *(undefined4 *)(param_1 + 0xba8 + (longlong)*(int *)(param_1 + 0x14a0) * 4) =
       *(undefined4 *)(param_1 + 0xbac);
  FUN_1401df9b8();
  FUN_1401e0c38(lVar2,iVar7,param_1 + 0xb88);
  return;
}



int FUN_1401e0f18(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  
  scan_tree(param_1,param_1 + 0xbc,*(undefined4 *)(param_1 + 0xb48));
  scan_tree(param_1,param_1 + 0x9b0,*(undefined4 *)(param_1 + 0xb60));
  FUN_1401e0cd8(param_1,param_1 + 0xb70);
  iVar2 = 0x12;
  lVar1 = 0x12;
  do {
    if (*(short *)(param_1 + 0xaa6 + (ulonglong)(byte)(&DAT_1402715e0)[lVar1] * 4) != 0) break;
    lVar1 = lVar1 + -1;
    iVar2 = iVar2 + -1;
  } while (2 < lVar1);
  *(int *)(param_1 + 0x1700) = *(int *)(param_1 + 0x1700) + iVar2 * 3 + 0x11;
  return iVar2;
}



void FUN_1401e0fa8(longlong param_1,undefined8 param_2,undefined8 param_3,ushort param_4)

{
  int iVar1;
  int iVar2;
  
  iVar1 = *(int *)(param_1 + 0x1714);
  if (iVar1 < 0xe) {
    iVar2 = iVar1 + 3;
    *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | param_4 << ((byte)iVar1 & 0x1f);
  }
  else {
    *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | param_4 << ((byte)iVar1 & 0x1f);
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1711);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    iVar2 = *(int *)(param_1 + 0x1714) + -0xd;
    *(ushort *)(param_1 + 0x1710) = param_4 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
  }
  *(int *)(param_1 + 0x1714) = iVar2;
  FUN_1401e0b08(param_1,param_2,param_3,1);
  return;
}



void FUN_1401e1048(longlong param_1)

{
  ushort uVar1;
  int iVar2;
  int iVar3;
  
  iVar2 = *(int *)(param_1 + 0x1714);
  *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | 2 << ((byte)iVar2 & 0x1f);
  if (iVar2 < 0xe) {
    iVar2 = iVar2 + 3;
  }
  else {
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1711);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(ushort *)(param_1 + 0x1710) = 2 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
    iVar2 = *(int *)(param_1 + 0x1714) + -0xd;
  }
  *(int *)(param_1 + 0x1714) = iVar2;
  uVar1 = 0;
  *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | 0 << ((byte)iVar2 & 0x1f);
  if (iVar2 < 10) {
    iVar2 = iVar2 + 7;
  }
  else {
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1710);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
         *(undefined1 *)(param_1 + 0x1711);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    *(ushort *)(param_1 + 0x1710) = 0 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
    iVar2 = *(int *)(param_1 + 0x1714) + -9;
  }
  *(int *)(param_1 + 0x1714) = iVar2;
  FUN_1401e0a28(param_1);
  iVar2 = *(int *)(param_1 + 0x1714);
  if ((*(int *)(param_1 + 0x170c) - iVar2) + 0xb < 9) {
    if (iVar2 < 0xe) {
      iVar3 = iVar2 + 3;
      *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | 2 << ((byte)iVar2 & 0x1f);
    }
    else {
      *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | 2 << ((byte)iVar2 & 0x1f);
      *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
           *(undefined1 *)(param_1 + 0x1710);
      *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
      *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
           *(undefined1 *)(param_1 + 0x1711);
      *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
      iVar3 = *(int *)(param_1 + 0x1714) + -0xd;
      *(ushort *)(param_1 + 0x1710) = 2 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
    }
    *(int *)(param_1 + 0x1714) = iVar3;
    if (iVar3 < 10) {
      iVar2 = iVar3 + 7;
      *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | uVar1 << ((byte)iVar3 & 0x1f);
    }
    else {
      *(ushort *)(param_1 + 0x1710) = *(ushort *)(param_1 + 0x1710) | uVar1 << ((byte)iVar3 & 0x1f);
      *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
           *(undefined1 *)(param_1 + 0x1710);
      *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
      *(undefined1 *)((ulonglong)*(uint *)(param_1 + 0x28) + *(longlong *)(param_1 + 0x10)) =
           *(undefined1 *)(param_1 + 0x1711);
      *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
      iVar2 = *(int *)(param_1 + 0x1714) + -9;
      *(ushort *)(param_1 + 0x1710) = uVar1 >> (0x10U - (char)*(int *)(param_1 + 0x1714) & 0x1f);
    }
    *(int *)(param_1 + 0x1714) = iVar2;
    FUN_1401e0a28(param_1);
  }
  *(undefined4 *)(param_1 + 0x170c) = 7;
  return;
}



void FUN_1401e1268(longlong *param_1,longlong param_2,int param_3,int param_4)

{
  short sVar1;
  int iVar2;
  int iVar3;
  uint uVar4;
  uint uVar5;
  undefined *puVar6;
  longlong *plVar7;
  
  iVar2 = 0;
  if (*(int *)((longlong)param_1 + 0xac) < 1) {
    uVar5 = param_3 + 5;
  }
  else {
    if ((param_3 != 0) && (*(int *)(*param_1 + 0x48) == 2)) {
      FUN_1401e0998();
    }
    FUN_1401e0cd8(param_1,param_1 + 0x168);
    FUN_1401e0cd8(param_1,param_1 + 0x16b);
    iVar2 = FUN_1401e0f18(param_1);
    uVar4 = (int)param_1[0x2e0] + 10U >> 3;
    uVar5 = *(int *)((longlong)param_1 + 0x1704) + 10U >> 3;
    if (uVar4 < uVar5) goto LAB_1401e12fd;
  }
  uVar4 = uVar5;
  uVar5 = uVar4;
LAB_1401e12fd:
  if ((uVar4 < param_3 + 4U) || (param_2 == 0)) {
    sVar1 = (short)param_4;
    if (((int)param_1[0x16] == 4) || (uVar5 == uVar4)) {
      iVar2 = *(int *)((longlong)param_1 + 0x1714);
      if (iVar2 < 0xe) {
        *(ushort *)(param_1 + 0x2e2) =
             *(ushort *)(param_1 + 0x2e2) | sVar1 + 2 << ((byte)iVar2 & 0x1f);
        iVar2 = iVar2 + 3;
      }
      else {
        *(ushort *)(param_1 + 0x2e2) =
             *(ushort *)(param_1 + 0x2e2) | sVar1 + 2U << ((byte)iVar2 & 0x1f);
        *(char *)((ulonglong)*(uint *)(param_1 + 5) + param_1[2]) = (char)param_1[0x2e2];
        *(int *)(param_1 + 5) = (int)param_1[5] + 1;
        *(undefined1 *)((ulonglong)*(uint *)(param_1 + 5) + param_1[2]) =
             *(undefined1 *)((longlong)param_1 + 0x1711);
        *(int *)(param_1 + 5) = (int)param_1[5] + 1;
        iVar2 = *(int *)((longlong)param_1 + 0x1714) + -0xd;
        *(ushort *)(param_1 + 0x2e2) =
             (ushort)(sVar1 + 2U) >> (0x10U - (char)*(int *)((longlong)param_1 + 0x1714) & 0x1f);
      }
      *(int *)((longlong)param_1 + 0x1714) = iVar2;
      plVar7 = (longlong *)&DAT_140271a80;
      puVar6 = &DAT_140271600;
    }
    else {
      iVar3 = *(int *)((longlong)param_1 + 0x1714);
      if (iVar3 < 0xe) {
        *(ushort *)(param_1 + 0x2e2) =
             *(ushort *)(param_1 + 0x2e2) | sVar1 + 4 << ((byte)iVar3 & 0x1f);
        iVar3 = iVar3 + 3;
      }
      else {
        *(ushort *)(param_1 + 0x2e2) =
             *(ushort *)(param_1 + 0x2e2) | sVar1 + 4U << ((byte)iVar3 & 0x1f);
        *(char *)((ulonglong)*(uint *)(param_1 + 5) + param_1[2]) = (char)param_1[0x2e2];
        *(int *)(param_1 + 5) = (int)param_1[5] + 1;
        *(undefined1 *)((ulonglong)*(uint *)(param_1 + 5) + param_1[2]) =
             *(undefined1 *)((longlong)param_1 + 0x1711);
        *(int *)(param_1 + 5) = (int)param_1[5] + 1;
        iVar3 = *(int *)((longlong)param_1 + 0x1714) + -0xd;
        *(ushort *)(param_1 + 0x2e2) =
             (ushort)(sVar1 + 4U) >> (0x10U - (char)*(int *)((longlong)param_1 + 0x1714) & 0x1f);
      }
      *(int *)((longlong)param_1 + 0x1714) = iVar3;
      FUN_1401e0218(param_1,(int)param_1[0x169] + 1,(int)param_1[0x16c] + 1,iVar2 + 1);
      plVar7 = param_1 + 0x136;
      puVar6 = (undefined *)((longlong)param_1 + 0xbc);
    }
    FUN_1401e0548(param_1,puVar6,plVar7);
  }
  else {
    FUN_1401e0fa8(param_1,param_2,param_3,param_4);
  }
  FUN_1401df878(param_1);
  if (param_4 != 0) {
    FUN_1401e0aa8();
  }
  return;
}



int __thiscall std::basic_streambuf<>::sync(basic_streambuf<> *this)

{
  int iVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001401e149c. Too many branches
                    // WARNING: Treating indirect jump as call
  iVar1 = sync(this);
  return iVar1;
}



void __thiscall std::basic_streambuf<>::_Unlock(basic_streambuf<> *this)

{
                    // WARNING: Could not recover jumptable at 0x0001401e14a2. Too many branches
                    // WARNING: Treating indirect jump as call
  _Unlock(this);
  return;
}



void __thiscall std::basic_streambuf<>::_Lock(basic_streambuf<> *this)

{
                    // WARNING: Could not recover jumptable at 0x0001401e14a8. Too many branches
                    // WARNING: Treating indirect jump as call
  _Lock(this);
  return;
}



__int64 __thiscall std::basic_streambuf<>::showmanyc(basic_streambuf<> *this)

{
  __int64 _Var1;
  
                    // WARNING: Could not recover jumptable at 0x0001401e14ae. Too many branches
                    // WARNING: Treating indirect jump as call
  _Var1 = showmanyc(this);
  return _Var1;
}



int __thiscall std::basic_streambuf<>::uflow(basic_streambuf<> *this)

{
  int iVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001401e14b4. Too many branches
                    // WARNING: Treating indirect jump as call
  iVar1 = uflow(this);
  return iVar1;
}



__int64 __thiscall
std::basic_streambuf<>::xsgetn(basic_streambuf<> *this,char *param_1,__int64 param_2)

{
  __int64 _Var1;
  
                    // WARNING: Could not recover jumptable at 0x0001401e14ba. Too many branches
                    // WARNING: Treating indirect jump as call
  _Var1 = xsgetn(this,param_1,param_2);
  return _Var1;
}



__int64 __thiscall
std::basic_streambuf<>::xsputn(basic_streambuf<> *this,char *param_1,__int64 param_2)

{
  __int64 _Var1;
  
                    // WARNING: Could not recover jumptable at 0x0001401e14c0. Too many branches
                    // WARNING: Treating indirect jump as call
  _Var1 = xsputn(this,param_1,param_2);
  return _Var1;
}



basic_streambuf<> * __thiscall
std::basic_streambuf<>::setbuf(basic_streambuf<> *this,char *param_1,__int64 param_2)

{
  basic_streambuf<> *pbVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001401e14c6. Too many branches
                    // WARNING: Treating indirect jump as call
  pbVar1 = setbuf(this,param_1,param_2);
  return pbVar1;
}



void __thiscall std::basic_streambuf<>::imbue(basic_streambuf<> *this,locale *param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001401e14cc. Too many branches
                    // WARNING: Treating indirect jump as call
  imbue(this,param_1);
  return;
}



// Library Function - Single Match
//  void __cdecl `eh vector constructor iterator'(void * __ptr64,unsigned __int64,int,void
// (__cdecl*)(void * __ptr64),void (__cdecl*)(void * __ptr64))
// 
// Library: Visual Studio 2010 Release

void __cdecl
_eh_vector_constructor_iterator_
          (void *param_1,__uint64 param_2,int param_3,_func_void_void_ptr *param_4,
          _func_void_void_ptr *param_5)

{
  int iVar1;
  
  for (iVar1 = 0; iVar1 < param_3; iVar1 = iVar1 + 1) {
    (*param_4)(param_1);
    param_1 = (void *)((longlong)param_1 + param_2);
  }
  return;
}



int __cdecl memcmp(void *_Buf1,void *_Buf2,size_t _Size)

{
  int iVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001401e1538. Too many branches
                    // WARNING: Treating indirect jump as call
  iVar1 = memcmp(_Buf1,_Buf2,_Size);
  return iVar1;
}



void __RTDynamicCast(void)

{
                    // WARNING: Could not recover jumptable at 0x0001401e153e. Too many branches
                    // WARNING: Treating indirect jump as call
  __RTDynamicCast();
  return;
}



undefined8 FUN_1401e1550(LPWSTR param_1,int param_2,LPCSTR param_3,int param_4)

{
  MultiByteToWideChar(0,1,param_3,param_4,param_1,param_2);
  return 0;
}



undefined8 FUN_1401e1580(LPSTR param_1,int param_2,LPCWSTR param_3,int param_4)

{
  WideCharToMultiByte(0,0,param_3,param_4,param_1,param_2,(LPCSTR)0x0,(LPBOOL)0x0);
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 * FUN_1401e1690(undefined1 *param_1,LPCWSTR param_2)

{
  char cVar1;
  WCHAR WVar2;
  longlong lVar3;
  ulonglong uVar4;
  LPCWSTR pWVar5;
  char *pcVar6;
  undefined1 auStackY_478 [32];
  CHAR local_428 [1024];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStackY_478;
  local_428[0] = '\0';
  memset(local_428 + 1,0,0x3ff);
  if (7 < *(ulonglong *)(param_2 + 0xc)) {
    param_2 = *(LPCWSTR *)param_2;
  }
  lVar3 = -1;
  pWVar5 = param_2;
  do {
    if (lVar3 == 0) break;
    lVar3 = lVar3 + -1;
    WVar2 = *pWVar5;
    pWVar5 = pWVar5 + 1;
  } while (WVar2 != L'\0');
  WideCharToMultiByte(0,0,param_2,~(uint)lVar3,local_428,0x400,(LPCSTR)0x0,(LPBOOL)0x0);
  uVar4 = 0xffffffffffffffff;
  *(undefined8 *)(param_1 + 0x18) = 0xf;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *param_1 = 0;
  pcVar6 = local_428;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    cVar1 = *pcVar6;
    pcVar6 = pcVar6 + 1;
  } while (cVar1 != '\0');
  FUN_140003e60(param_1,local_428,~uVar4 - 1);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 * FUN_1401e1780(undefined1 *param_1,char *param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  ulonglong uVar3;
  char *pcVar4;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined1 auStack_458 [32];
  undefined4 local_438;
  char local_428 [1024];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_458;
  local_438 = 0;
  local_res18 = param_3;
  local_res20 = param_4;
  iVar2 = _vscprintf(param_2,(va_list)&local_res18);
  if (iVar2 + 1 < 0x400) {
    vsprintf_s(local_428,(longlong)(iVar2 + 1),param_2,(va_list)&local_res18);
  }
  else {
    builtin_strncpy(local_428 + 0x10,"1024",5);
    builtin_strncpy(local_428,"Over Run Buffer ",0x10);
  }
  uVar3 = 0xffffffffffffffff;
  *(undefined8 *)(param_1 + 0x18) = 0xf;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *param_1 = 0;
  pcVar4 = local_428;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + 1;
  } while (cVar1 != '\0');
  FUN_140003e60(param_1,local_428,~uVar3 - 1);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401e1870(undefined8 param_1,char *param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  int iVar2;
  ulonglong uVar3;
  char *pcVar4;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined1 auStack_448 [32];
  char local_428 [1024];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_448;
  local_res18 = param_3;
  local_res20 = param_4;
  iVar2 = _vscprintf(param_2,(va_list)&local_res18);
  if (iVar2 + 1 < 0x400) {
    vsprintf_s(local_428,(longlong)(iVar2 + 1),param_2,(va_list)&local_res18);
  }
  else {
    builtin_strncpy(local_428 + 0x10,"1024",5);
    builtin_strncpy(local_428,"Over Run Buffer ",0x10);
  }
  uVar3 = 0xffffffffffffffff;
  pcVar4 = local_428;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + 1;
  } while (cVar1 != '\0');
  FUN_140003e60(param_1,local_428,~uVar3 - 1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 * FUN_1401e1940(undefined1 *param_1,longlong param_2)

{
  char cVar1;
  ulonglong uVar2;
  char *pcVar3;
  undefined1 auStack_d8 [32];
  uint local_b8;
  uint local_b0;
  uint local_a8;
  uint local_a0;
  uint local_98;
  uint local_90;
  uint local_88;
  uint local_80;
  uint local_78;
  uint local_70;
  undefined4 local_68;
  char local_60 [56];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_d8;
  local_60[0] = '\0';
  local_60[1] = '\0';
  local_60[2] = '\0';
  local_60[3] = '\0';
  local_60[4] = '\0';
  local_60[5] = '\0';
  local_60[6] = '\0';
  local_60[7] = '\0';
  local_60[8] = '\0';
  local_60[9] = '\0';
  local_60[10] = '\0';
  local_60[0xb] = '\0';
  local_60[0xc] = '\0';
  local_60[0xd] = '\0';
  local_60[0xe] = '\0';
  local_60[0xf] = '\0';
  local_60[0x10] = '\0';
  local_60[0x11] = '\0';
  local_60[0x12] = '\0';
  local_60[0x13] = '\0';
  local_60[0x14] = '\0';
  local_60[0x15] = '\0';
  local_60[0x16] = '\0';
  local_60[0x17] = '\0';
  local_60[0x18] = '\0';
  local_60[0x19] = '\0';
  local_60[0x1a] = '\0';
  local_60[0x1b] = '\0';
  local_60[0x1c] = '\0';
  local_60[0x1d] = '\0';
  local_60[0x1e] = '\0';
  local_60[0x1f] = '\0';
  local_60[0x20] = '\0';
  local_60[0x21] = '\0';
  local_60[0x22] = '\0';
  local_60[0x23] = '\0';
  local_60[0x24] = '\0';
  local_60[0x25] = '\0';
  local_60[0x26] = '\0';
  local_60[0x27] = '\0';
  local_60[0x28] = '\0';
  local_60[0x29] = '\0';
  local_60[0x2a] = '\0';
  local_60[0x2b] = '\0';
  local_60[0x2c] = '\0';
  local_60[0x2d] = '\0';
  local_60[0x2e] = '\0';
  local_60[0x2f] = '\0';
  local_60[0x30] = '\0';
  local_60[0x31] = 0;
  local_70 = (uint)*(byte *)(param_2 + 0xf);
  local_78 = (uint)*(byte *)(param_2 + 0xe);
  local_80 = (uint)*(byte *)(param_2 + 0xd);
  local_88 = (uint)*(byte *)(param_2 + 0xc);
  local_90 = (uint)*(byte *)(param_2 + 0xb);
  local_98 = (uint)*(byte *)(param_2 + 10);
  local_a0 = (uint)*(byte *)(param_2 + 9);
  local_a8 = (uint)*(byte *)(param_2 + 8);
  local_b0 = (uint)*(ushort *)(param_2 + 6);
  local_68 = 0;
  local_b8 = (uint)*(ushort *)(param_2 + 4);
  sprintf_s(local_60,0x32,"%.8X-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X");
  uVar2 = 0xffffffffffffffff;
  *(undefined8 *)(param_1 + 0x18) = 0xf;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *param_1 = 0;
  pcVar3 = local_60;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    cVar1 = *pcVar3;
    pcVar3 = pcVar3 + 1;
  } while (cVar1 != '\0');
  FUN_140003e60(param_1,local_60,~uVar2 - 1);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x0001401e1cb1)
// WARNING: Removing unreachable block (ram,0x0001401e1c3e)

void FUN_1401e1a80(undefined8 param_1,char *param_2,int param_3,char *param_4)

{
  char cVar1;
  ulonglong uVar2;
  undefined1 *puVar3;
  undefined1 *puVar4;
  int iVar5;
  ulonglong uVar6;
  undefined1 *puVar7;
  longlong lVar8;
  uint uVar9;
  ulonglong uVar11;
  ulonglong uVar12;
  char *pcVar13;
  undefined1 auStack_a8 [32];
  longlong local_88;
  undefined8 local_80;
  longlong local_78;
  undefined8 local_70;
  undefined1 local_68;
  uint7 uStack_67;
  ulonglong local_58;
  ulonglong local_50;
  ulonglong local_40;
  ulonglong uVar10;
  
  local_70 = 0xfffffffffffffffe;
  local_40 = DAT_1402f85a0 ^ (ulonglong)auStack_a8;
  uVar6 = 0xffffffffffffffff;
  pcVar13 = param_4;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    cVar1 = *pcVar13;
    pcVar13 = pcVar13 + 1;
  } while (cVar1 != '\0');
  local_78 = ~uVar6 - 1;
  uVar12 = 0xf;
  local_50 = 0xf;
  uVar6 = 0;
  local_58 = 0;
  local_68 = 0;
  iVar5 = (int)local_78;
  lVar8 = (longlong)param_3;
  puVar4 = (undefined1 *)((ulonglong)uStack_67 << 8);
  local_88 = lVar8;
  local_80 = param_1;
  if (0 < param_3) {
    uVar11 = uVar6;
    pcVar13 = param_2;
    do {
      uVar9 = 0;
      if (0 < (longlong)iVar5) {
        uVar2 = uVar6;
        uVar10 = uVar6;
        do {
          uVar9 = (uint)uVar10;
          if (*pcVar13 == param_4[uVar2]) {
            if (uVar11 != 0) {
              FUN_14008e920(local_80,&local_68);
              puVar4 = (undefined1 *)CONCAT71(uStack_67,local_68);
              puVar3 = &local_68;
              if (0xf < local_50) {
                puVar3 = puVar4;
              }
              puVar7 = &local_68;
              if (0xf < local_50) {
                puVar7 = puVar4;
              }
              uVar2 = uVar6;
              if (puVar3 + local_58 != (undefined1 *)0x0) {
                uVar2 = (longlong)(puVar3 + local_58) - (longlong)puVar7;
              }
              if (local_58 < uVar2) {
                uVar2 = local_58;
              }
              lVar8 = local_88;
              uVar11 = local_58;
              uVar12 = local_50;
              if (uVar2 != 0) {
                puVar3 = &local_68;
                if (0xf < local_50) {
                  puVar3 = puVar4;
                }
                memmove(puVar3,puVar3 + uVar2,local_58 - uVar2);
                local_58 = local_58 - uVar2;
                puVar4 = &local_68;
                if (0xf < local_50) {
                  puVar4 = (undefined1 *)CONCAT71(uStack_67,local_68);
                }
                puVar4[local_58] = 0;
                puVar4 = (undefined1 *)CONCAT71(uStack_67,local_68);
                lVar8 = local_88;
                uVar11 = local_58;
                uVar12 = local_50;
              }
            }
            break;
          }
          uVar9 = uVar9 + 1;
          uVar10 = (ulonglong)uVar9;
          uVar2 = uVar2 + 1;
        } while ((longlong)uVar2 < (longlong)iVar5);
      }
      if (uVar9 == (uint)local_78) {
        FUN_14001f450(&local_68,*pcVar13);
        puVar4 = (undefined1 *)CONCAT71(uStack_67,local_68);
        uVar11 = local_58;
        uVar12 = local_50;
      }
      pcVar13 = pcVar13 + 1;
    } while ((longlong)pcVar13 - (longlong)param_2 < lVar8);
    if (uVar11 != 0) {
      FUN_14008e920(local_80,&local_68);
      puVar4 = (undefined1 *)CONCAT71(uStack_67,local_68);
      puVar3 = &local_68;
      if (0xf < local_50) {
        puVar3 = puVar4;
      }
      puVar7 = &local_68;
      if (0xf < local_50) {
        puVar7 = puVar4;
      }
      if (puVar3 + local_58 != (undefined1 *)0x0) {
        uVar6 = (longlong)(puVar3 + local_58) - (longlong)puVar7;
      }
      if (local_58 < uVar6) {
        uVar6 = local_58;
      }
      uVar12 = local_50;
      if (uVar6 != 0) {
        puVar3 = &local_68;
        if (0xf < local_50) {
          puVar3 = puVar4;
        }
        memmove(puVar3,puVar3 + uVar6,local_58 - uVar6);
        local_58 = local_58 - uVar6;
        puVar4 = &local_68;
        if (0xf < local_50) {
          puVar4 = (undefined1 *)CONCAT71(uStack_67,local_68);
        }
        puVar4[local_58] = 0;
        puVar4 = (undefined1 *)CONCAT71(uStack_67,local_68);
        uVar12 = local_50;
      }
    }
  }
  if (0xf < uVar12) {
    operator_delete(puVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined2 * FUN_1401e1d60(undefined2 *param_1,LPCSTR param_2)

{
  char cVar1;
  WCHAR WVar2;
  longlong lVar3;
  ulonglong uVar4;
  LPCSTR pCVar5;
  WCHAR *pWVar6;
  undefined1 auStackY_868 [32];
  WCHAR local_828;
  undefined1 local_826 [2046];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStackY_868;
  local_828 = L'\0';
  memset(local_826,0,0x7fe);
  if (0xf < *(ulonglong *)(param_2 + 0x18)) {
    param_2 = *(LPCSTR *)param_2;
  }
  lVar3 = -1;
  pCVar5 = param_2;
  do {
    if (lVar3 == 0) break;
    lVar3 = lVar3 + -1;
    cVar1 = *pCVar5;
    pCVar5 = pCVar5 + 1;
  } while (cVar1 != '\0');
  MultiByteToWideChar(0,1,param_2,~(uint)lVar3,&local_828,0x400);
  uVar4 = 0xffffffffffffffff;
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  pWVar6 = &local_828;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    WVar2 = *pWVar6;
    pWVar6 = pWVar6 + 1;
  } while (WVar2 != L'\0');
  FUN_140001b00(param_1,&local_828,~uVar4 - 1);
  return param_1;
}



void FUN_1401e1e40(longlong param_1)

{
  double dVar1;
  
  if (*(char *)(param_1 + 0x20) == '\0') {
    dVar1 = (double)(**(code **)(**(longlong **)(param_1 + 8) + 8))();
    dVar1 = dVar1 * (double)*(float *)(param_1 + 0x24);
    *(double *)(param_1 + 0x18) = dVar1;
    *(double *)(param_1 + 0x10) = dVar1 + *(double *)(param_1 + 0x10);
  }
  return;
}



void FUN_1401e1e80(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  *param_1 = Magi::Timer::vftable;
  (**(code **)(*(longlong *)param_1[1] + 0x18))
            ((longlong *)param_1[1],param_1,param_3,param_4,0xfffffffffffffffe);
  *param_1 = IObserver::vftable;
  return;
}



undefined8 *
FUN_1401e1ed0(undefined8 *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  *param_1 = Magi::Timer::vftable;
  param_1[1] = param_2;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined1 *)(param_1 + 4) = 0;
  *(undefined4 *)((longlong)param_1 + 0x24) = 0x3f800000;
  (**(code **)(*param_2 + 0x10))(param_2,param_1,param_2,param_4,0xfffffffffffffffe);
  return param_1;
}



double FUN_1401e1f30(longlong param_1)

{
  LARGE_INTEGER local_res8 [4];
  
  QueryPerformanceCounter(local_res8);
  return (double)local_res8[0].QuadPart * *(double *)(param_1 + 8);
}



undefined8 * FUN_1401e1f60(undefined8 *param_1)

{
  BOOL BVar1;
  LARGE_INTEGER local_res8 [4];
  
  *param_1 = TimeSourceHRWin32::vftable;
  BVar1 = QueryPerformanceFrequency(local_res8);
  if (BVar1 == 0) {
    *(undefined1 *)(param_1 + 2) = 0;
    GetLastError();
    return param_1;
  }
  *(undefined1 *)(param_1 + 2) = 1;
  param_1[1] = 1.0 / (double)local_res8[0].QuadPart;
  return param_1;
}



void FUN_1401e1fc0(longlong param_1,longlong *param_2,undefined8 param_3)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  *(longlong **)(param_1 + 0x10) = param_2;
  if (param_2 != (longlong *)0x0) {
    uVar2 = (**(code **)(*param_2 + 8))(param_2);
    *(undefined8 *)(param_1 + 0x30) = uVar2;
    *(undefined8 *)(param_1 + 0x38) = uVar2;
  }
  *(undefined8 *)(param_1 + 0x90) = param_3;
  return;
}



void FUN_1401e2030(longlong param_1,longlong param_2)

{
  longlong *_Src;
  longlong *plVar1;
  longlong lVar2;
  longlong *_Dst;
  
  _Dst = *(longlong **)(param_1 + 0x70);
  _Src = *(longlong **)(param_1 + 0x78);
  if (_Dst == _Src) {
    return;
  }
  while (*_Dst != param_2) {
    _Dst = _Dst + 1;
    if (_Dst == _Src) goto LAB_1401e2088;
  }
  plVar1 = _Dst;
  if (_Dst == _Src) {
    return;
  }
  while (plVar1 = plVar1 + 1, plVar1 != _Src) {
    if (*plVar1 != param_2) {
      *_Dst = *plVar1;
      _Dst = _Dst + 1;
    }
  }
LAB_1401e2088:
  if (_Dst == _Src) {
    return;
  }
  lVar2 = *(longlong *)(param_1 + 0x78) - (longlong)_Src >> 3;
  memmove(_Dst,_Src,lVar2 * 8);
  *(longlong **)(param_1 + 0x78) = _Dst + lVar2;
  return;
}



void FUN_1401e20d0(longlong param_1,longlong param_2)

{
  ulonglong *puVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong local_res10 [3];
  
  if (param_2 == 0) {
    return;
  }
  plVar2 = *(longlong **)(param_1 + 0x78);
  puVar1 = (ulonglong *)(param_1 + 0x70);
  local_res10[0] = param_2;
  if ((local_res10 < plVar2) && (plVar3 = (longlong *)*puVar1, plVar3 <= local_res10)) {
    if (plVar2 == *(longlong **)(param_1 + 0x80)) {
      FUN_14000b000(puVar1);
    }
    if (*(undefined8 **)(param_1 + 0x78) != (undefined8 *)0x0) {
      **(undefined8 **)(param_1 + 0x78) =
           *(undefined8 *)(*puVar1 + ((longlong)local_res10 - (longlong)plVar3 >> 3) * 8);
      *(longlong *)(param_1 + 0x78) = *(longlong *)(param_1 + 0x78) + 8;
      return;
    }
  }
  else {
    if (plVar2 == *(longlong **)(param_1 + 0x80)) {
      FUN_14000b000(puVar1);
    }
    if (*(longlong **)(param_1 + 0x78) != (longlong *)0x0) {
      **(longlong **)(param_1 + 0x78) = param_2;
    }
  }
  *(longlong *)(param_1 + 0x78) = *(longlong *)(param_1 + 0x78) + 8;
  return;
}



void FUN_1401e21d0(longlong param_1,double param_2)

{
  ulonglong *puVar1;
  double *pdVar2;
  double *pdVar3;
  void *_Dst;
  undefined4 uVar4;
  undefined4 uVar5;
  double local_res10;
  
  uVar4 = SUB84(param_2,0);
  uVar5 = (undefined4)((ulonglong)param_2 >> 0x20);
  local_res10 = param_2;
  if (param_2 < 0.0) {
    uVar4 = 0x9999999a;
    uVar5 = 0x3fa99999;
    local_res10 = 0.05;
  }
  pdVar2 = *(double **)(param_1 + 0x58);
  puVar1 = (ulonglong *)(param_1 + 0x50);
  if ((&local_res10 < pdVar2) && (pdVar3 = (double *)*puVar1, pdVar3 <= &local_res10)) {
    if (pdVar2 == *(double **)(param_1 + 0x60)) {
      FUN_14000b000(puVar1);
    }
    if (*(undefined8 **)(param_1 + 0x58) != (undefined8 *)0x0) {
      **(undefined8 **)(param_1 + 0x58) =
           *(undefined8 *)(*puVar1 + ((longlong)&local_res10 - (longlong)pdVar3 >> 3) * 8);
    }
  }
  else {
    if (pdVar2 == *(double **)(param_1 + 0x60)) {
      FUN_14000b000(puVar1);
    }
    if (*(undefined8 **)(param_1 + 0x58) != (undefined8 *)0x0) {
      **(undefined8 **)(param_1 + 0x58) = CONCAT44(uVar5,uVar4);
    }
  }
  *(longlong *)(param_1 + 0x58) = *(longlong *)(param_1 + 0x58) + 8;
  _Dst = (void *)*puVar1;
  if ((ulonglong)*(uint *)(param_1 + 0x40) <
      (ulonglong)(*(longlong *)(param_1 + 0x58) - (longlong)_Dst >> 3)) {
    memmove(_Dst,(void *)((longlong)_Dst + 8),
            *(longlong *)(param_1 + 0x58) - ((longlong)_Dst + 8) & 0xfffffffffffffff8);
    *(longlong *)(param_1 + 0x58) = *(longlong *)(param_1 + 0x58) + -8;
  }
  return;
}



double FUN_1401e22d0(longlong param_1)

{
  double dVar1;
  double dVar2;
  
  if (*(longlong **)(param_1 + 0x10) == (longlong *)0x0) {
    dVar2 = 0.0;
  }
  else {
    dVar2 = (double)(**(code **)(**(longlong **)(param_1 + 0x10) + 8))();
  }
  dVar1 = dVar2 - *(double *)(param_1 + 0x38);
  if (*(double *)(param_1 + 0x90) <= dVar1 && dVar1 != *(double *)(param_1 + 0x90)) {
    dVar1 = *(double *)(*(longlong *)(param_1 + 0x58) + -8);
  }
  *(double *)(param_1 + 0x38) = dVar2;
  return dVar1;
}



void FUN_1401e2320(longlong param_1)

{
  double dVar1;
  double *pdVar2;
  longlong lVar3;
  undefined8 *puVar4;
  double dVar5;
  double dVar6;
  
  dVar1 = 0.0;
  if (*(longlong **)(param_1 + 0x10) == (longlong *)0x0) {
    dVar5 = 0.0;
  }
  else {
    dVar5 = (double)(**(code **)(**(longlong **)(param_1 + 0x10) + 8))();
  }
  dVar6 = dVar5 - *(double *)(param_1 + 0x38);
  if (*(double *)(param_1 + 0x90) <= dVar6 && dVar6 != *(double *)(param_1 + 0x90)) {
    dVar6 = *(double *)(*(longlong *)(param_1 + 0x58) + -8);
  }
  *(double *)(param_1 + 0x38) = dVar5;
  FUN_1401e21d0(param_1,dVar6);
  pdVar2 = *(double **)(param_1 + 0x50);
  if (pdVar2 != *(double **)(param_1 + 0x58)) {
    dVar1 = 0.0;
    do {
      dVar1 = dVar1 + *pdVar2;
      pdVar2 = pdVar2 + 1;
    } while (pdVar2 != *(double **)(param_1 + 0x58));
  }
  lVar3 = *(longlong *)(param_1 + 0x58) - *(longlong *)(param_1 + 0x50) >> 3;
  dVar5 = (double)lVar3;
  if (lVar3 < 0) {
    dVar5 = dVar5 + 1.8446744073709552e+19;
  }
  puVar4 = *(undefined8 **)(param_1 + 0x70);
  *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
  *(double *)(param_1 + 0x20) = dVar1 / dVar5;
  *(double *)(param_1 + 0x18) = dVar1 / dVar5 + *(double *)(param_1 + 0x18);
  if (puVar4 != *(undefined8 **)(param_1 + 0x78)) {
    do {
      (**(code **)(*(longlong *)*puVar4 + 8))();
      puVar4 = puVar4 + 1;
    } while (puVar4 != *(undefined8 **)(param_1 + 0x78));
  }
  return;
}



void FUN_1401e2400(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  
  *param_1 = Clock::vftable;
  param_1[1] = Clock::vftable;
  puVar1 = (undefined8 *)param_1[2];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,0xfffffffffffffffe);
  }
  if ((void *)param_1[0xe] != (void *)0x0) {
    operator_delete((void *)param_1[0xe]);
  }
  param_1[0xe] = 0;
  param_1[0xf] = 0;
  param_1[0x10] = 0;
  if ((void *)param_1[10] != (void *)0x0) {
    operator_delete((void *)param_1[10]);
  }
  param_1[10] = 0;
  param_1[0xb] = 0;
  param_1[0xc] = 0;
  param_1[1] = MBISingleton<>::vftable;
  DAT_140320128 = 0;
  *param_1 = ISubject::vftable;
  return;
}



void FUN_1401e24b0(longlong param_1,undefined8 param_2)

{
  void *_Dst;
  
  *(undefined8 *)(param_1 + 0x48) = param_2;
  *(undefined4 *)(param_1 + 0x40) = 1;
  _Dst = *(void **)(param_1 + 0x50);
  if (_Dst != *(void **)(param_1 + 0x58)) {
    memmove(_Dst,*(void **)(param_1 + 0x58),0);
    *(void **)(param_1 + 0x58) = _Dst;
  }
  FUN_14002b250((undefined8 *)(param_1 + 0x50),param_1 + 0x48);
  return;
}



undefined8 *
FUN_1401e2530(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  double *pdVar2;
  longlong lVar3;
  double dVar4;
  double dVar5;
  
  *param_1 = Clock::vftable;
  param_1[1] = Clock::vftable;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  *(undefined4 *)(param_1 + 5) = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  param_1[10] = 0;
  param_1[0xb] = 0;
  param_1[0xc] = 0;
  param_1[0xe] = 0;
  param_1[0xf] = 0;
  param_1[0x10] = 0;
  param_1[0x12] = 0x3fc999999999999a;
  puVar1 = (undefined8 *)param_1[2];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,0xfffffffffffffffe);
  }
  param_1[2] = 0;
  param_1[0x12] = 0x3fe0000000000000;
  FUN_1401e24b0(param_1,0x3f9eb851eb851eb8);
  dVar5 = 0.0;
  pdVar2 = (double *)param_1[10];
  if (pdVar2 != (double *)param_1[0xb]) {
    do {
      dVar5 = dVar5 + *pdVar2;
      pdVar2 = pdVar2 + 1;
    } while (pdVar2 != (double *)param_1[0xb]);
  }
  lVar3 = (longlong)(param_1[0xb] - param_1[10]) >> 3;
  dVar4 = (double)lVar3;
  if (lVar3 < 0) {
    dVar4 = dVar4 + 1.8446744073709552e+19;
  }
  param_1[4] = dVar5 / dVar4;
  return param_1;
}



void FUN_1401e2a50(void)

{
  printf("-----------------------------------------\n");
  printf("Active Service                      : %s\n");
  printf("Active Service AuthDll32            : %s\n");
  printf("Active Service AuthDll64            : %s\n");
  printf("Active Service BillingDll           : %s\n");
  printf("Active Service ServerMode           : %s\n");
  printf("Active Service BillingServerMode    : %s\n");
  printf("Active Service AntiHack             : %s\n");
  printf("Active Service AntiHack Log         : %s\n");
  printf("Active Service nProtect Use         : %s\n");
  printf("Active Service nProtect_Log Use     : %s\n");
  printf("Active Service XTrap Use            : %s\n");
  printf("Active Service BetaZone             : %s\n");
  printf("Active Service ChannelLimitCount    : %d\n");
  printf("Active Service WorldUserLimitCount  : %d\n");
  printf("Active Service AuthURL              : %s\n");
  printf("Active Service BillingURL           : %s\n");
  printf("Active Service BillingIDC           : %s\n");
  printf("Active Service IP                   : %s\n");
  printf("Active Service Port                 : %d\n");
  printf("Active Service Skip Auth            : %s\n");
  printf("Active Service Free Cash            : %s\n");
  printf("Active Service Skip Abuse Nick      : %s\n");
  printf("Active Service Product Name         : %s\n");
  printf("Active Billing Service Product Name : %s\n");
  printf("Active Use Second Pass              : %s\n");
  printf("Active Aes Auth Key                 : %s\n");
  printf("Active Hide Channel                 : %s\n");
  printf("Active Skip Billing                 : %s\n");
                    // WARNING: Could not recover jumptable at 0x0001401e2db3. Too many branches
                    // WARNING: Treating indirect jump as call
  printf("-----------------------------------------\n");
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401e2dc0(void)

{
  if (0xf < DAT_1403203a0) {
    operator_delete((void *)CONCAT71(DAT_140320388._1_7_,(undefined1)DAT_140320388));
  }
  DAT_1403203a0 = 0xf;
  _DAT_140320398 = 0;
  DAT_140320388._0_1_ = 0;
  if (0xf < DAT_140320378) {
    operator_delete((void *)CONCAT71(DAT_140320360._1_7_,(undefined1)DAT_140320360));
  }
  DAT_140320378 = 0xf;
  _DAT_140320370 = 0;
  DAT_140320360._0_1_ = 0;
  if (0xf < DAT_140320350) {
    operator_delete((void *)CONCAT71(DAT_140320338._1_7_,(undefined1)DAT_140320338));
  }
  DAT_140320350 = 0xf;
  _DAT_140320348 = 0;
  DAT_140320338._0_1_ = 0;
  if (0xf < DAT_140320328) {
    operator_delete((void *)CONCAT71(DAT_140320310._1_7_,(undefined1)DAT_140320310));
  }
  DAT_140320328 = 0xf;
  _DAT_140320320 = 0;
  DAT_140320310._0_1_ = 0;
  if (0xf < DAT_140320300) {
    operator_delete((void *)CONCAT71(DAT_1403202e8._1_7_,(undefined1)DAT_1403202e8));
  }
  DAT_140320300 = 0xf;
  _DAT_1403202f8 = 0;
  DAT_1403202e8._0_1_ = 0;
  if (0xf < DAT_1403202d8) {
    operator_delete((void *)CONCAT71(DAT_1403202c0._1_7_,(undefined1)DAT_1403202c0));
  }
  DAT_1403202d8 = 0xf;
  _DAT_1403202d0 = 0;
  DAT_1403202c0._0_1_ = 0;
  if (0xf < DAT_1403202b0) {
    operator_delete((void *)CONCAT71(DAT_140320298._1_7_,(undefined1)DAT_140320298));
  }
  DAT_1403202b0 = 0xf;
  _DAT_1403202a8 = 0;
  DAT_140320298._0_1_ = 0;
  if (0xf < DAT_140320288) {
    operator_delete((void *)CONCAT71(DAT_140320270._1_7_,(undefined1)DAT_140320270));
  }
  DAT_140320288 = 0xf;
  _DAT_140320280 = 0;
  DAT_140320270._0_1_ = 0;
  if (0xf < DAT_140320260) {
    operator_delete((void *)CONCAT71(DAT_140320248._1_7_,(undefined1)DAT_140320248));
  }
  DAT_140320260 = 0xf;
  _DAT_140320258 = 0;
  DAT_140320248._0_1_ = 0;
  if (0xf < DAT_140320238) {
    operator_delete((void *)CONCAT71(DAT_140320220._1_7_,(undefined1)DAT_140320220));
  }
  DAT_140320238 = 0xf;
  _DAT_140320230 = 0;
  DAT_140320220._0_1_ = 0;
  if (0xf < DAT_140320210) {
    operator_delete((void *)CONCAT71(DAT_1403201f8._1_7_,(undefined1)DAT_1403201f8));
  }
  DAT_140320210 = 0xf;
  _DAT_140320208 = 0;
  DAT_1403201f8._0_1_ = 0;
  if (0xf < DAT_1403201e8) {
    operator_delete((void *)CONCAT71(DAT_1403201d0._1_7_,(undefined1)DAT_1403201d0));
  }
  DAT_1403201e8 = 0xf;
  _DAT_1403201e0 = 0;
  DAT_1403201d0._0_1_ = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1401e3010(void)

{
  void *pvVar1;
  void *pvVar2;
  
  if (0xf < DAT_140320650) {
    operator_delete((void *)CONCAT71(DAT_140320638._1_7_,(undefined1)DAT_140320638));
  }
  pvVar2 = DAT_140320620;
  DAT_140320650 = 0xf;
  _DAT_140320648 = 0;
  DAT_140320638._0_1_ = 0;
  pvVar1 = DAT_140320618;
  if (DAT_140320618 != (void *)0x0) {
    for (; pvVar1 != pvVar2; pvVar1 = (void *)((longlong)pvVar1 + 0x230)) {
      FUN_1400036e0(pvVar1);
    }
    operator_delete(DAT_140320618);
  }
  DAT_140320618 = (void *)0x0;
  DAT_140320620 = (void *)0x0;
  _DAT_140320628 = 0;
  FUN_1400036e0(&DAT_1403203e8);
  if (0xf < DAT_1403203d8) {
    operator_delete((void *)CONCAT71(DAT_1403203c0._1_7_,(undefined1)DAT_1403203c0));
  }
  DAT_1403203d8 = 0xf;
  _DAT_1403203d0 = 0;
  DAT_1403203c0._0_1_ = 0;
  return;
}



void FUN_1401e3100(longlong param_1)

{
  char cVar1;
  longlong lVar2;
  longlong lVar3;
  ulonglong uVar4;
  char *pcVar5;
  char *pcVar6;
  bool bVar7;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 8;
    pcVar5 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
    bVar7 = pcVar5 == (char *)0x0;
    pcVar6 = "country";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar7 = *pcVar5 == *pcVar6;
      pcVar5 = pcVar5 + 1;
      pcVar6 = pcVar6 + 1;
    } while (bVar7);
    if (bVar7) {
      pcVar5 = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
      if (pcVar5 == (char *)0x0) {
        return;
      }
      uVar4 = 0xffffffffffffffff;
      pcVar6 = pcVar5;
      break;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
  while( true ) {
    uVar4 = uVar4 - 1;
    cVar1 = *pcVar6;
    pcVar6 = pcVar6 + 1;
    if (cVar1 == '\0') break;
    if (uVar4 == 0) break;
  }
  FUN_140003e60(&DAT_1403203c0,pcVar5,~uVar4 - 1);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_1401e3190(void)

{
  undefined8 in_R9;
  
  DAT_1403201e8 = 0xf;
  _DAT_1403201e0 = 0;
  DAT_1403201d0._0_1_ = 0;
  DAT_140320210 = 0xf;
  _DAT_140320208 = 0;
  DAT_1403201f8._0_1_ = 0;
  DAT_140320238 = 0xf;
  _DAT_140320230 = 0;
  DAT_140320220._0_1_ = 0;
  DAT_140320260 = 0xf;
  _DAT_140320258 = 0;
  DAT_140320248._0_1_ = 0;
  DAT_140320288 = 0xf;
  _DAT_140320280 = 0;
  DAT_140320270._0_1_ = 0;
  DAT_1403202b0 = 0xf;
  _DAT_1403202a8 = 0;
  DAT_140320298._0_1_ = 0;
  DAT_1403202d8 = 0xf;
  _DAT_1403202d0 = 0;
  DAT_1403202c0._0_1_ = 0;
  DAT_140320300 = 0xf;
  _DAT_1403202f8 = 0;
  DAT_1403202e8._0_1_ = 0;
  DAT_140320328 = 0xf;
  _DAT_140320320 = 0;
  DAT_140320310._0_1_ = 0;
  DAT_140320350 = 0xf;
  _DAT_140320348 = 0;
  DAT_140320338._0_1_ = 0;
  DAT_140320378 = 0xf;
  _DAT_140320370 = 0;
  DAT_140320360._0_1_ = 0;
  DAT_1403203a0 = 0xf;
  _DAT_140320398 = 0;
  DAT_140320388._0_1_ = 0;
  FUN_140003e60(&DAT_140320388,&DAT_1402728c8,3,in_R9,0xfffffffffffffffe);
  DAT_1403203b0 = 1000;
  return &DAT_1403201d0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401e3300(longlong param_1)

{
  longlong lVar1;
  char cVar2;
  longlong lVar3;
  int iVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  ulonglong uVar8;
  char **ppcVar9;
  char *******_Str2;
  char *pcVar10;
  char *pcVar11;
  char *pcVar12;
  char *pcVar13;
  char *pcVar14;
  char *pcVar15;
  char *pcVar16;
  char *pcVar17;
  bool bVar18;
  undefined1 auStack_348 [32];
  char *local_328;
  char *local_320;
  char *local_318;
  char *local_310;
  char *local_308;
  char *local_300;
  char *local_2f8;
  char *local_2f0;
  char *local_2e8;
  char *local_2e0;
  char *local_2d8;
  char *local_2d0;
  char *local_2c8;
  char *local_2c0;
  char *local_2b8;
  char *local_2b0;
  char *local_2a8;
  char *local_2a0;
  char *local_298;
  char *local_290;
  char *local_288;
  char *local_280;
  undefined8 local_278;
  undefined1 local_268 [40];
  undefined1 local_240 [40];
  undefined1 local_218 [40];
  undefined1 local_1f0 [40];
  undefined1 local_1c8 [40];
  undefined1 local_1a0 [40];
  undefined1 local_178 [40];
  undefined1 local_150 [40];
  undefined1 local_128 [40];
  int local_100;
  undefined1 local_f8 [40];
  undefined1 local_d0 [40];
  undefined1 local_a8 [40];
  undefined1 local_80;
  undefined1 local_7f;
  undefined1 local_7e;
  undefined1 local_7d;
  undefined1 local_7c;
  undefined1 local_7b;
  undefined1 local_7a;
  undefined1 local_79;
  undefined1 local_78;
  undefined1 local_77;
  undefined1 local_76;
  undefined1 local_75;
  undefined4 local_74;
  undefined4 local_70;
  char ******local_68 [3];
  ulonglong local_50;
  undefined4 local_40;
  ulonglong local_38;
  
  local_278 = 0xfffffffffffffffe;
  local_38 = DAT_1402f85a0 ^ (ulonglong)auStack_348;
  lVar1 = param_1 + 0x58;
  pcVar16 = (char *)0x0;
  lVar3 = *(longlong *)(param_1 + 0xa0);
  for (lVar7 = lVar3; lVar6 = lVar3, lVar7 != lVar1; lVar7 = *(longlong *)(lVar7 + 0x48)) {
    pcVar10 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 8;
    pcVar11 = "country";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_328 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      goto joined_r0x0001401e339d;
    }
  }
  local_328 = (char *)0x0;
joined_r0x0001401e339d:
  do {
    lVar7 = lVar3;
    if (lVar6 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 0xc;
    pcVar11 = "auth_dll_32";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_320 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
      goto joined_r0x0001401e33dd;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_320 = (char *)0x0;
joined_r0x0001401e33dd:
  do {
    lVar6 = lVar3;
    if (lVar7 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 0xc;
    pcVar11 = "auth_dll_64";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_2c8 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      goto joined_r0x0001401e341b;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_2c8 = (char *)0x0;
joined_r0x0001401e341b:
  do {
    lVar7 = lVar3;
    if (lVar6 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 0xc;
    pcVar11 = "billing_dll";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_308 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
      goto joined_r0x0001401e345d;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_308 = (char *)0x0;
joined_r0x0001401e345d:
  do {
    lVar6 = lVar3;
    if (lVar7 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 0xc;
    pcVar11 = "server_mode";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_2b8 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      goto joined_r0x0001401e349b;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_2b8 = (char *)0x0;
joined_r0x0001401e349b:
  do {
    lVar7 = lVar3;
    if (lVar6 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 0x14;
    pcVar11 = "billing_server_mode";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_2f8 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
      goto joined_r0x0001401e34dd;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_2f8 = (char *)0x0;
joined_r0x0001401e34dd:
  do {
    lVar6 = lVar3;
    if (lVar7 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 10;
    pcVar11 = "xtrap_use";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_2f0 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      goto joined_r0x0001401e351d;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_2f0 = (char *)0x0;
joined_r0x0001401e351d:
  do {
    lVar7 = lVar3;
    if (lVar6 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 0xd;
    pcVar11 = "antihack_use";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_318 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
      goto joined_r0x0001401e355d;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_318 = (char *)0x0;
joined_r0x0001401e355d:
  do {
    lVar6 = lVar3;
    if (lVar7 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 0xd;
    pcVar11 = "antihack_log";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_298 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      goto joined_r0x0001401e359b;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_298 = (char *)0x0;
joined_r0x0001401e359b:
  do {
    lVar7 = lVar3;
    if (lVar6 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 0xd;
    pcVar11 = "nprotect_use";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_300 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
      goto joined_r0x0001401e35dd;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_300 = (char *)0x0;
joined_r0x0001401e35dd:
  do {
    lVar6 = lVar3;
    if (lVar7 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 0x11;
    pcVar11 = "nprotect_log_use";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_310 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      goto joined_r0x0001401e361d;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_310 = (char *)0x0;
joined_r0x0001401e361d:
  do {
    lVar7 = lVar3;
    if (lVar6 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 9;
    pcVar11 = "betazone";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_2e0 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
      goto joined_r0x0001401e365d;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_2e0 = (char *)0x0;
joined_r0x0001401e365d:
  do {
    lVar6 = lVar3;
    if (lVar7 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 0x14;
    pcVar11 = "channel_limit_count";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_2d0 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      goto joined_r0x0001401e369d;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_2d0 = (char *)0x0;
joined_r0x0001401e369d:
  do {
    lVar7 = lVar3;
    if (lVar6 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 0x17;
    pcVar11 = "world_user_limit_count";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_2c0 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
      goto joined_r0x0001401e36db;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_2c0 = (char *)0x0;
joined_r0x0001401e36db:
  do {
    lVar6 = lVar3;
    if (lVar7 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 9;
    pcVar11 = "auth_url";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_280 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      goto joined_r0x0001401e371b;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_280 = (char *)0x0;
joined_r0x0001401e371b:
  do {
    lVar7 = lVar3;
    if (lVar6 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 0xc;
    pcVar11 = "billing_url";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_2e8 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
      goto joined_r0x0001401e375d;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_2e8 = (char *)0x0;
joined_r0x0001401e375d:
  do {
    lVar6 = lVar3;
    if (lVar7 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 0xc;
    pcVar11 = "billing_idc";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_2a8 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      goto joined_r0x0001401e379b;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_2a8 = (char *)0x0;
joined_r0x0001401e379b:
  do {
    lVar7 = lVar3;
    if (lVar6 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 8;
    pcVar11 = "auth_ip";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_2d8 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
      goto joined_r0x0001401e37dd;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_2d8 = (char *)0x0;
joined_r0x0001401e37dd:
  do {
    lVar6 = lVar3;
    if (lVar7 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 10;
    pcVar11 = "auth_port";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_288 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      goto joined_r0x0001401e381b;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_288 = (char *)0x0;
joined_r0x0001401e381b:
  do {
    lVar7 = lVar3;
    if (lVar6 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 10;
    pcVar11 = "skip_auth";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_2b0 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
      goto joined_r0x0001401e385b;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_2b0 = (char *)0x0;
joined_r0x0001401e385b:
  do {
    lVar6 = lVar3;
    if (lVar7 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 10;
    pcVar11 = "free_cash";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_2a0 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      goto joined_r0x0001401e389b;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_2a0 = (char *)0x0;
joined_r0x0001401e389b:
  do {
    lVar7 = lVar3;
    if (lVar6 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 0x10;
    pcVar11 = "skip_abuse_nick";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      local_290 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
      goto joined_r0x0001401e38db;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_290 = (char *)0x0;
joined_r0x0001401e38db:
  do {
    lVar6 = lVar3;
    pcVar10 = pcVar16;
    if (lVar7 == lVar1) break;
    pcVar10 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
    bVar18 = pcVar10 == (char *)0x0;
    lVar5 = 0xd;
    pcVar11 = "product_name";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar18 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar18);
    if (bVar18) {
      pcVar10 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
      break;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
joined_r0x0001401e3916:
  lVar7 = lVar3;
  pcVar11 = pcVar16;
  if (lVar6 == lVar1) goto joined_r0x0001401e3956;
  pcVar11 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
  bVar18 = pcVar11 == (char *)0x0;
  lVar5 = 0x15;
  pcVar12 = "billing_product_name";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar18 = *pcVar11 == *pcVar12;
    pcVar11 = pcVar11 + 1;
    pcVar12 = pcVar12 + 1;
  } while (bVar18);
  if (bVar18) {
    pcVar11 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
    goto joined_r0x0001401e3956;
  }
  lVar6 = *(longlong *)(lVar6 + 0x48);
  goto joined_r0x0001401e3916;
joined_r0x0001401e3956:
  lVar6 = lVar3;
  pcVar12 = pcVar16;
  if (lVar7 == lVar1) goto joined_r0x0001401e3996;
  pcVar12 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
  bVar18 = pcVar12 == (char *)0x0;
  lVar5 = 0xc;
  pcVar13 = "second_pass";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar18 = *pcVar12 == *pcVar13;
    pcVar12 = pcVar12 + 1;
    pcVar13 = pcVar13 + 1;
  } while (bVar18);
  if (bVar18) {
    pcVar12 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
    goto joined_r0x0001401e3996;
  }
  lVar7 = *(longlong *)(lVar7 + 0x48);
  goto joined_r0x0001401e3956;
joined_r0x0001401e3996:
  lVar7 = lVar3;
  pcVar13 = pcVar16;
  if (lVar6 == lVar1) goto joined_r0x0001401e39d6;
  pcVar13 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
  bVar18 = pcVar13 == (char *)0x0;
  lVar5 = 0xd;
  pcVar14 = "aes_auth_key";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar18 = *pcVar13 == *pcVar14;
    pcVar13 = pcVar13 + 1;
    pcVar14 = pcVar14 + 1;
  } while (bVar18);
  if (bVar18) {
    pcVar13 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
    goto joined_r0x0001401e39d6;
  }
  lVar6 = *(longlong *)(lVar6 + 0x48);
  goto joined_r0x0001401e3996;
joined_r0x0001401e39d6:
  pcVar14 = pcVar16;
  if (lVar7 == lVar1) goto joined_r0x0001401e3a13;
  pcVar14 = (char *)(*(longlong *)(lVar7 + 0x20) + 0x10);
  bVar18 = pcVar14 == (char *)0x0;
  lVar6 = 0xd;
  pcVar15 = "hide_channel";
  do {
    if (lVar6 == 0) break;
    lVar6 = lVar6 + -1;
    bVar18 = *pcVar14 == *pcVar15;
    pcVar14 = pcVar14 + 1;
    pcVar15 = pcVar15 + 1;
  } while (bVar18);
  if (bVar18) {
    pcVar14 = (char *)(*(longlong *)(lVar7 + 0x30) + 0x10);
    goto joined_r0x0001401e3a13;
  }
  lVar7 = *(longlong *)(lVar7 + 0x48);
  goto joined_r0x0001401e39d6;
joined_r0x0001401e3a13:
  if (lVar3 == lVar1) goto LAB_1401e3a50;
  pcVar15 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
  bVar18 = pcVar15 == (char *)0x0;
  lVar7 = 0xd;
  pcVar17 = "skip_billing";
  do {
    if (lVar7 == 0) break;
    lVar7 = lVar7 + -1;
    bVar18 = *pcVar15 == *pcVar17;
    pcVar15 = pcVar15 + 1;
    pcVar17 = pcVar17 + 1;
  } while (bVar18);
  if (bVar18) {
    pcVar16 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
    goto LAB_1401e3a50;
  }
  lVar3 = *(longlong *)(lVar3 + 0x48);
  goto joined_r0x0001401e3a13;
LAB_1401e3a50:
  FUN_140003570();
  pcVar15 = local_328;
  if (local_328 != (char *)0x0) {
    uVar8 = 0xffffffffffffffff;
    pcVar17 = local_328;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar2 = *pcVar17;
      pcVar17 = pcVar17 + 1;
    } while (cVar2 != '\0');
    FUN_140003e60(local_68,local_328,~uVar8 - 1);
    iVar4 = _stricmp(pcVar15,"dev");
    if (iVar4 == 0) {
      local_40 = 1000;
    }
    else {
      iVar4 = _stricmp(pcVar15,"kor_beta");
      if (iVar4 == 0) {
        local_40 = 200;
      }
      else {
        iVar4 = _stricmp(pcVar15,"kor");
        if (iVar4 == 0) {
          local_40 = 100;
        }
        else {
          iVar4 = _stricmp(pcVar15,"usa_beta");
          if (iVar4 == 0) {
            local_40 = 0xc9;
          }
          else {
            iVar4 = _stricmp(pcVar15,"usa");
            if (iVar4 == 0) {
              local_40 = 0x65;
            }
            else {
              iVar4 = _stricmp(pcVar15,"tw_beta");
              if (iVar4 == 0) {
                local_40 = 0xca;
              }
              else {
                iVar4 = _stricmp(pcVar15,"tw");
                if (iVar4 == 0) {
                  local_40 = 0x66;
                }
                else {
                  iVar4 = _stricmp(pcVar15,"jpn_beta");
                  if (iVar4 == 0) {
                    local_40 = 0xcb;
                  }
                  else {
                    iVar4 = _stricmp(pcVar15,"jpn");
                    if (iVar4 == 0) {
                      local_40 = 0x67;
                    }
                    else {
                      iVar4 = _stricmp(pcVar15,"chn_beta");
                      if (iVar4 == 0) {
                        local_40 = 0xcc;
                      }
                      else {
                        iVar4 = _stricmp(pcVar15,"chn");
                        if (iVar4 == 0) {
                          local_40 = 0x68;
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (local_320 != (char *)0x0) {
    uVar8 = 0xffffffffffffffff;
    pcVar15 = local_320;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar2 = *pcVar15;
      pcVar15 = pcVar15 + 1;
    } while (cVar2 != '\0');
    FUN_140003e60(local_268,local_320,~uVar8 - 1);
  }
  if (local_2c8 != (char *)0x0) {
    uVar8 = 0xffffffffffffffff;
    pcVar15 = local_2c8;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar2 = *pcVar15;
      pcVar15 = pcVar15 + 1;
    } while (cVar2 != '\0');
    FUN_140003e60(local_240,local_2c8,~uVar8 - 1);
  }
  if (local_308 != (char *)0x0) {
    uVar8 = 0xffffffffffffffff;
    pcVar15 = local_308;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar2 = *pcVar15;
      pcVar15 = pcVar15 + 1;
    } while (cVar2 != '\0');
    FUN_140003e60(local_218,local_308,~uVar8 - 1);
  }
  if (local_2b8 != (char *)0x0) {
    uVar8 = 0xffffffffffffffff;
    pcVar15 = local_2b8;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar2 = *pcVar15;
      pcVar15 = pcVar15 + 1;
    } while (cVar2 != '\0');
    FUN_140003e60(local_1f0,local_2b8,~uVar8 - 1);
  }
  if (local_2f8 != (char *)0x0) {
    uVar8 = 0xffffffffffffffff;
    pcVar15 = local_2f8;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar2 = *pcVar15;
      pcVar15 = pcVar15 + 1;
    } while (cVar2 != '\0');
    FUN_140003e60(local_1c8,local_2f8,~uVar8 - 1);
  }
  if (local_280 != (char *)0x0) {
    uVar8 = 0xffffffffffffffff;
    pcVar15 = local_280;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar2 = *pcVar15;
      pcVar15 = pcVar15 + 1;
    } while (cVar2 != '\0');
    FUN_140003e60(local_1a0,local_280,~uVar8 - 1);
  }
  if (local_2e8 != (char *)0x0) {
    uVar8 = 0xffffffffffffffff;
    pcVar15 = local_2e8;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar2 = *pcVar15;
      pcVar15 = pcVar15 + 1;
    } while (cVar2 != '\0');
    FUN_140003e60(local_178,local_2e8,~uVar8 - 1);
  }
  if (local_2a8 != (char *)0x0) {
    uVar8 = 0xffffffffffffffff;
    pcVar15 = local_2a8;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar2 = *pcVar15;
      pcVar15 = pcVar15 + 1;
    } while (cVar2 != '\0');
    FUN_140003e60(local_150,local_2a8,~uVar8 - 1);
  }
  if (local_2d8 != (char *)0x0) {
    uVar8 = 0xffffffffffffffff;
    pcVar15 = local_2d8;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar2 = *pcVar15;
      pcVar15 = pcVar15 + 1;
    } while (cVar2 != '\0');
    FUN_140003e60(local_128,local_2d8,~uVar8 - 1);
  }
  if (local_288 != (char *)0x0) {
    local_100 = atoi(local_288);
  }
  if (pcVar10 != (char *)0x0) {
    uVar8 = 0xffffffffffffffff;
    pcVar15 = pcVar10;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar2 = *pcVar15;
      pcVar15 = pcVar15 + 1;
    } while (cVar2 != '\0');
    FUN_140003e60(local_f8,pcVar10,~uVar8 - 1);
  }
  if (pcVar11 != (char *)0x0) {
    uVar8 = 0xffffffffffffffff;
    pcVar10 = pcVar11;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar2 = *pcVar10;
      pcVar10 = pcVar10 + 1;
    } while (cVar2 != '\0');
    FUN_140003e60(local_d0,pcVar11,~uVar8 - 1);
  }
  if (pcVar13 != (char *)0x0) {
    uVar8 = 0xffffffffffffffff;
    pcVar10 = pcVar13;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar2 = *pcVar10;
      pcVar10 = pcVar10 + 1;
    } while (cVar2 != '\0');
    FUN_140003e60(local_a8,pcVar13,~uVar8 - 1);
  }
  if (local_318 != (char *)0x0) {
    iVar4 = atoi(local_318);
    local_80 = 0 < iVar4;
  }
  if (local_298 != (char *)0x0) {
    iVar4 = atoi(local_298);
    local_7f = 0 < iVar4;
  }
  if (local_310 != (char *)0x0) {
    iVar4 = atoi(local_310);
    local_7e = 0 < iVar4;
  }
  if (local_300 != (char *)0x0) {
    iVar4 = atoi(local_300);
    local_7d = 0 < iVar4;
  }
  if (local_2f0 != (char *)0x0) {
    iVar4 = atoi(local_2f0);
    local_7c = 0 < iVar4;
  }
  if (local_2e0 != (char *)0x0) {
    iVar4 = atoi(local_2e0);
    local_7b = 0 < iVar4;
  }
  if (local_2d0 != (char *)0x0) {
    local_320 = (char *)CONCAT44(local_320._4_4_,1);
    iVar4 = atoi(local_2d0);
    local_328 = (char *)CONCAT44(local_328._4_4_,iVar4);
    ppcVar9 = &local_320;
    if (0 < iVar4) {
      ppcVar9 = &local_328;
    }
    local_74 = *(undefined4 *)ppcVar9;
  }
  if (local_2c0 != (char *)0x0) {
    local_328 = (char *)((ulonglong)local_328 & 0xffffffff00000000);
    iVar4 = atoi(local_2c0);
    local_320 = (char *)CONCAT44(local_320._4_4_,iVar4);
    ppcVar9 = &local_328;
    if (-1 < iVar4) {
      ppcVar9 = &local_320;
    }
    local_70 = *(undefined4 *)ppcVar9;
  }
  if (local_2b0 != (char *)0x0) {
    iVar4 = atoi(local_2b0);
    local_7a = 0 < iVar4;
  }
  if (local_2a0 != (char *)0x0) {
    iVar4 = atoi(local_2a0);
    local_75 = 0 < iVar4;
  }
  if (local_290 != (char *)0x0) {
    iVar4 = atoi(local_290);
    local_79 = 0 < iVar4;
  }
  if (pcVar12 != (char *)0x0) {
    iVar4 = atoi(pcVar12);
    local_78 = 0 < iVar4;
  }
  if (pcVar14 != (char *)0x0) {
    iVar4 = atoi(pcVar14);
    local_77 = 0 < iVar4;
  }
  if (pcVar16 != (char *)0x0) {
    iVar4 = atoi(pcVar16);
    local_76 = 0 < iVar4;
  }
  _Str2 = local_68;
  if (0xf < local_50) {
    _Str2 = (char *******)local_68[0];
  }
  pcVar16 = (char *)&DAT_1403203c0;
  if (0xf < DAT_1403203d8) {
    pcVar16 = DAT_1403203c0;
  }
  iVar4 = _stricmp(pcVar16,(char *)_Str2);
  if (iVar4 == 0) {
    FUN_140003940(&DAT_1403203e8,local_268);
    FUN_1401e2a50(&DAT_1403203c0);
  }
  FUN_140003bd0(&DAT_140320618,local_268);
  FUN_1400036e0(local_268);
  return;
}



void FUN_1401e4040(void)

{
  char cVar1;
  int iVar2;
  longlong *plVar3;
  longlong lVar4;
  undefined8 *puVar5;
  char *pcVar6;
  char *pcVar7;
  bool bVar8;
  undefined **local_98 [5];
  longlong *local_70;
  undefined8 *local_60;
  void *local_58;
  undefined8 *local_38;
  void *local_30;
  undefined8 local_18;
  
  local_18 = 0xfffffffffffffffe;
  puVar5 = &DAT_140320638;
  if (0xf < DAT_140320650) {
    puVar5 = DAT_140320638;
  }
  FUN_1400275d0(local_98,puVar5);
  DAT_1403100dc = 0;
  cVar1 = FUN_1400276a0(local_98,local_60 + 2);
  plVar3 = local_70;
  if (cVar1 == '\0') {
    printf("File [ %s ] Error : %d - %s");
    local_98[0] = TiXmlDocument::vftable;
    if (local_38 != &DAT_14031fee8) {
      operator_delete__(local_30);
    }
    local_98[0] = TiXmlNode::vftable;
    while (local_70 != (longlong *)0x0) {
      plVar3 = (longlong *)local_70[10];
      (**(code **)*local_70)(local_70,1);
      local_70 = plVar3;
    }
    if (local_60 == &DAT_14031fee8) {
      return;
    }
    operator_delete__(local_58);
    return;
  }
  for (; plVar3 != (longlong *)0x0; plVar3 = (longlong *)plVar3[10]) {
    bVar8 = (char *)(plVar3[7] + 0x10) == (char *)0x0;
    lVar4 = 8;
    pcVar6 = (char *)(plVar3[7] + 0x10);
    pcVar7 = "service";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar8 = *pcVar6 == *pcVar7;
      pcVar6 = pcVar6 + 1;
      pcVar7 = pcVar7 + 1;
    } while (bVar8);
    if (bVar8) goto LAB_1401e4186;
  }
  goto LAB_1401e427d;
LAB_1401e4186:
  while (lVar4 = (**(code **)(*plVar3 + 0x30))(plVar3), lVar4 == 0) {
    do {
      plVar3 = (longlong *)plVar3[10];
      if (plVar3 == (longlong *)0x0) goto LAB_1401e427d;
      bVar8 = (char *)(plVar3[7] + 0x10) == (char *)0x0;
      lVar4 = 8;
      pcVar6 = (char *)(plVar3[7] + 0x10);
      pcVar7 = "service";
      do {
        if (lVar4 == 0) break;
        lVar4 = lVar4 + -1;
        bVar8 = *pcVar6 == *pcVar7;
        pcVar6 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
    } while (!bVar8);
  }
  lVar4 = (**(code **)(*plVar3 + 0x30))(plVar3);
  if (lVar4 != 0) {
    for (plVar3 = *(longlong **)(lVar4 + 0x28); plVar3 != (longlong *)0x0;
        plVar3 = (longlong *)plVar3[10]) {
      lVar4 = (**(code **)(*plVar3 + 0x30))(plVar3);
      if (lVar4 != 0) {
        for (plVar3 = (longlong *)(**(code **)(*plVar3 + 0x30))(plVar3); plVar3 != (longlong *)0x0;
            plVar3 = (longlong *)(**(code **)(*plVar3 + 0x30))(plVar3)) {
          lVar4 = plVar3[7];
          iVar2 = _stricmp((char *)(lVar4 + 0x10),"active_area");
          if (iVar2 == 0) {
            FUN_1401e3100(plVar3);
          }
          else {
            iVar2 = _stricmp((char *)(lVar4 + 0x10),"area");
            if (iVar2 == 0) {
              FUN_1401e3300(plVar3);
            }
          }
          do {
            plVar3 = (longlong *)plVar3[10];
            if (plVar3 == (longlong *)0x0) goto LAB_1401e427d;
            lVar4 = (**(code **)(*plVar3 + 0x30))(plVar3);
          } while (lVar4 == 0);
        }
        break;
      }
    }
  }
LAB_1401e427d:
  local_98[0] = TiXmlDocument::vftable;
  if (local_38 != &DAT_14031fee8) {
    operator_delete__(local_30);
  }
  local_98[0] = TiXmlNode::vftable;
  while (local_70 != (longlong *)0x0) {
    plVar3 = (longlong *)local_70[10];
    (**(code **)*local_70)(local_70,1);
    local_70 = plVar3;
  }
  if (local_60 != &DAT_14031fee8) {
    operator_delete__(local_58);
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_1401e4310(void)

{
  undefined8 in_R9;
  
  DAT_1403203d8 = 0xf;
  _DAT_1403203d0 = 0;
  DAT_1403203c0._0_1_ = 0;
  FUN_140003e60(&DAT_1403203c0,&DAT_1402728c8,3,in_R9,0xfffffffffffffffe);
  FUN_140003570(&DAT_1403203e8);
  DAT_140320618 = 0;
  DAT_140320620 = 0;
  _DAT_140320628 = 0;
  DAT_140320650 = 0xf;
  _DAT_140320648 = 0;
  DAT_140320638._0_1_ = 0;
  FUN_140003e60(&DAT_140320638,"option\\service_control.xml",0x1a);
  FUN_1401e4040();
  return &DAT_1403203c0;
}



undefined8 * FUN_1401e43d0(void)

{
  if ((DAT_140320f58 & 1) == 0) {
    DAT_140320f58 = DAT_140320f58 | 1;
    FUN_1401e3190();
    atexit((_func_5014 *)&LAB_140202490);
  }
  return &DAT_1403201d0;
}



undefined8 * FUN_1401e4420(void)

{
  if ((DAT_140320f5c & 1) == 0) {
    DAT_140320f5c = DAT_140320f5c | 1;
    FUN_1401e4310();
    atexit((_func_5014 *)&LAB_140202480);
  }
  return &DAT_1403203c0;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401e4460(wchar_t *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 local_res10;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined1 auStackY_1048 [32];
  wchar_t local_1018 [2048];
  ulonglong local_18;
  undefined8 uStack_8;
  
  uStack_8 = 0x1401e447e;
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStackY_1048;
  local_res10 = param_2;
  local_res18 = param_3;
  local_res20 = param_4;
  _vsnwprintf_s(local_1018,0x800,0x1000,param_1,(va_list)&local_res10);
  wprintf(local_1018);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401e44f0(char *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 local_res10;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined1 auStackY_448 [32];
  char local_418 [1024];
  ulonglong local_18;
  
  local_18 = DAT_1402f85a0 ^ (ulonglong)auStackY_448;
  local_res10 = param_2;
  local_res18 = param_3;
  local_res20 = param_4;
  _vsnprintf_s(local_418,0x400,0xffffffffffffffff,param_1,(va_list)&local_res10);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401e4580(longlong param_1,char *param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined1 auStack_248 [32];
  char local_228 [512];
  ulonglong local_28;
  
  local_28 = DAT_1402f85a0 ^ (ulonglong)auStack_248;
  local_res18 = param_3;
  local_res20 = param_4;
  EnterCriticalSection(DAT_140320120);
  iVar1 = _vscprintf(param_2,(va_list)&local_res18);
  vsprintf_s(local_228,(longlong)(iVar1 + 1),param_2,(va_list)&local_res18);
  if ((*(byte *)(param_1 + 0x10) & 2) != 0) {
    printf(local_228);
  }
  if ((*(byte *)(param_1 + 0x10) & 4) != 0) {
    OutputDebugStringA(local_228);
  }
  if ((*(FILE **)(param_1 + 0xb8) != (FILE *)0x0) && ((*(byte *)(param_1 + 0x10) & 8) != 0)) {
    fprintf(*(FILE **)(param_1 + 0xb8),"%s");
  }
  LeaveCriticalSection(DAT_140320120);
  return;
}



void FUN_1401e4670(longlong param_1)

{
  undefined8 *puVar1;
  longlong lVar2;
  
  EnterCriticalSection(DAT_140320120);
  if (*(FILE **)(param_1 + 0xb8) != (FILE *)0x0) {
    fclose(*(FILE **)(param_1 + 0xb8));
  }
  puVar1 = (undefined8 *)(param_1 + 200);
  lVar2 = 4;
  do {
    if ((FILE *)*puVar1 != (FILE *)0x0) {
      fclose((FILE *)*puVar1);
    }
    puVar1 = puVar1 + 1;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
                    // WARNING: Could not recover jumptable at 0x0001401e46d0. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140320120);
  return;
}



void FUN_1401e46e0(undefined8 *param_1)

{
  DWORD DVar1;
  
  DVar1 = timeGetTime();
  if (0x32 < DVar1 - *(int *)(param_1 + 1)) {
    FUN_1401e4580(DAT_140320100,"% 9d [ ms ] %s\n",DVar1 - *(int *)(param_1 + 1),*param_1);
  }
  return;
}



undefined8 * FUN_1401e4720(undefined8 *param_1,undefined8 param_2)

{
  DWORD DVar1;
  
  *param_1 = param_2;
  DVar1 = timeGetTime();
  *(DWORD *)(param_1 + 1) = DVar1;
  return param_1;
}



void FUN_1401e4750(undefined8 *param_1)

{
  LPCRITICAL_SECTION lpCriticalSection;
  
  *param_1 = MBCLog::vftable;
  param_1[1] = MBCLog::vftable;
  FUN_1401e4670();
  if (7 < (ulonglong)param_1[0x15]) {
    operator_delete((void *)param_1[0x12]);
  }
  param_1[0x15] = 7;
  param_1[0x14] = 0;
  *(undefined2 *)(param_1 + 0x12) = 0;
  if (7 < (ulonglong)param_1[0x10]) {
    operator_delete((void *)param_1[0xd]);
  }
  param_1[0x10] = 7;
  param_1[0xf] = 0;
  *(undefined2 *)(param_1 + 0xd) = 0;
  if (7 < (ulonglong)param_1[0xb]) {
    operator_delete((void *)param_1[8]);
  }
  param_1[0xb] = 7;
  param_1[10] = 0;
  *(undefined2 *)(param_1 + 8) = 0;
  if (7 < (ulonglong)param_1[6]) {
    operator_delete((void *)param_1[3]);
  }
  lpCriticalSection = DAT_140320120;
  param_1[6] = 7;
  param_1[5] = 0;
  *(undefined2 *)(param_1 + 3) = 0;
  param_1[1] = MBMultiThreadSync<>::vftable;
  if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) {
    DeleteCriticalSection(lpCriticalSection);
    operator_delete(lpCriticalSection);
  }
  DAT_140320120 = (LPCRITICAL_SECTION)0x0;
  DAT_140320100 = 0;
  *param_1 = MBISingleton<>::vftable;
  return;
}



undefined8 * FUN_1401e4870(undefined8 *param_1)

{
  LPCRITICAL_SECTION p_Var1;
  LPCRITICAL_SECTION lpCriticalSection;
  
  *param_1 = MBISingleton<>::vftable;
  param_1[1] = MBMultiThreadSync<>::vftable;
  p_Var1 = DAT_140320120;
  if ((DAT_140320120 == (LPCRITICAL_SECTION)0x0) &&
     (lpCriticalSection = operator_new(0x28), p_Var1 = (LPCRITICAL_SECTION)0x0,
     lpCriticalSection != (LPCRITICAL_SECTION)0x0)) {
    InitializeCriticalSection(lpCriticalSection);
    p_Var1 = lpCriticalSection;
  }
  DAT_140320120 = p_Var1;
  *param_1 = MBCLog::vftable;
  param_1[1] = MBCLog::vftable;
  param_1[6] = 7;
  param_1[5] = 0;
  *(undefined2 *)(param_1 + 3) = 0;
  param_1[0xb] = 7;
  param_1[10] = 0;
  *(undefined2 *)(param_1 + 8) = 0;
  param_1[0x10] = 7;
  param_1[0xf] = 0;
  *(undefined2 *)(param_1 + 0xd) = 0;
  param_1[0x15] = 7;
  param_1[0x14] = 0;
  *(undefined2 *)(param_1 + 0x12) = 0;
  param_1[0x17] = 0;
  *(undefined4 *)(param_1 + 2) = 0xe;
  param_1[0x19] = 0;
  param_1[0x1a] = 0;
  param_1[0x1b] = 0;
  param_1[0x1c] = 0;
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1401e4980(longlong param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined1 auStack_458 [32];
  undefined8 local_438;
  wchar_t local_428 [516];
  ulonglong local_20;
  
  local_438 = 0xfffffffffffffffe;
  local_20 = DAT_1402f85a0 ^ (ulonglong)auStack_458;
  local_res18 = param_3;
  local_res20 = param_4;
  EnterCriticalSection(DAT_140320120);
  if ((DAT_140320f58 & 1) == 0) {
    DAT_140320f58 = DAT_140320f58 | 1;
    FUN_1401e3190();
    atexit((_func_5014 *)&LAB_140202490);
  }
  if ((DAT_1403203b0 == 200) && ((DAT_140320f58 & 1) == 0)) {
    DAT_140320f58 = DAT_140320f58 | 1;
    FUN_1401e3190();
    atexit((_func_5014 *)&LAB_140202490);
    if (DAT_1403203b0 == 1000) goto LAB_1401e4abd;
  }
  iVar1 = _vscwprintf(param_2,(va_list)&local_res18);
  vswprintf_s(local_428,(longlong)(iVar1 + 1),param_2,(va_list)&local_res18);
  wcscat_s(local_428,0x200,L"\n");
  if ((*(byte *)(param_1 + 0x10) & 4) != 0) {
    OutputDebugStringW(local_428);
  }
  if ((*(byte *)(param_1 + 0x10) & 2) != 0) {
    wprintf(local_428);
  }
  if ((*(FILE **)(param_1 + 0xb8) != (FILE *)0x0) && ((*(byte *)(param_1 + 0x10) & 8) != 0)) {
    fwprintf(*(FILE **)(param_1 + 0xb8),L"%s");
  }
LAB_1401e4abd:
  LeaveCriticalSection(DAT_140320120);
  return;
}



void FUN_1401e4af0(longlong param_1)

{
  errno_t eVar1;
  
  EnterCriticalSection(DAT_140320120);
  if ((DAT_140320f58 & 1) == 0) {
    DAT_140320f58 = DAT_140320f58 | 1;
    FUN_1401e3190();
    atexit((_func_5014 *)&LAB_140202490);
  }
  if (DAT_1403203b0 != 200) {
    if ((DAT_140320f58 & 1) == 0) {
      DAT_140320f58 = DAT_140320f58 | 1;
      FUN_1401e3190();
      atexit((_func_5014 *)&LAB_140202490);
    }
    if (DAT_1403203b0 != 1000) goto LAB_1401e4b8a;
  }
  _wsetlocale(0,L"korean");
LAB_1401e4b8a:
  setlocale(0,(char *)0x0);
  printf("Locale is: %s\n");
  eVar1 = fopen_s((FILE **)(param_1 + 0xb8),"GatewayServer.log","w");
  if (eVar1 != 0) {
    *(undefined8 *)(param_1 + 0xb8) = 0;
    FUN_1401e4980(param_1,L"MBLOG open error");
  }
  FUN_1401e4580(DAT_140320100,"MBLOG %s writting\n","GatewayServer.log");
                    // WARNING: Could not recover jumptable at 0x0001401e4c09. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140320120);
  return;
}



double __cdecl ceil(double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001401e4c10. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = ceil(_X);
  return dVar1;
}



double __cdecl floor(double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001401e4c16. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = floor(_X);
  return dVar1;
}



void Unwind_1401e4c20(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401e4c27. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(*(exception **)(param_2 + 0x40));
  return;
}



void Unwind_1401e4c30(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1401e4c40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x50);
  return;
}



void Unwind_1401e4c50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e4c60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e4c70(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401e4c77. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(*(exception **)(param_2 + 0x30));
  return;
}



void Unwind_1401e4c80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(*(longlong *)(param_2 + 0x30) + 0x40);
  return;
}



void Unwind_1401e4c90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x20);
  return;
}



void Unwind_1401e4ca0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1e20(param_2 + 0x40);
  return;
}



void Unwind_1401e4cb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401e4cc0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401e4cc7. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(*(exception **)(param_2 + 0x40));
  return;
}



void Unwind_1401e4cd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_1401e4ce0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401e4ce7. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(*(exception **)(param_2 + 0x50));
  return;
}



void Unwind_1401e4cf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(*(longlong *)(param_2 + 0x50) + 0x40);
  return;
}



void Unwind_1401e4d00(undefined8 param_1,longlong param_2)

{
  FUN_1400a2030(param_2 + 0x58);
  return;
}



void Unwind_1401e4d10(void)

{
  DAT_140313ee8 = DAT_140313ee8 & 0xfffffffe;
  return;
}



void Unwind_1401e4d30(void)

{
  DAT_140313ee8 = DAT_140313ee8 & 0xfffffffe;
  return;
}



void Unwind_1401e4d50(void)

{
  DAT_140313ee8 = DAT_140313ee8 & 0xfffffffe;
  return;
}



void Unwind_1401e4d70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401e4d80(undefined8 param_1,longlong param_2)

{
  FUN_1400a2f10(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e4d90(void)

{
  DAT_140313fb8 = DAT_140313fb8 & 0xfffffffe;
  return;
}



void Unwind_1401e4db0(undefined8 param_1,longlong param_2)

{
  FUN_1400a3530(*(undefined8 *)(param_2 + 0x50),0x80);
  return;
}



void Unwind_1401e4dd0(undefined8 param_1,longlong param_2)

{
  FUN_1400a34b0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e4de0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e4df0(void)

{
  DAT_140314028 = DAT_140314028 & 0xfffffffe;
  return;
}



void Unwind_1401e4e10(undefined8 param_1,longlong param_2)

{
  FUN_1400a34b0(*(undefined8 *)(param_2 + 0xd0));
  return;
}



void Unwind_1401e4e20(undefined8 param_1,longlong param_2)

{
  FUN_1400a4840(param_2 + 0x40);
  return;
}



void Unwind_1401e4e30(undefined8 param_1,longlong param_2)

{
  FUN_1400a4840(param_2 + 0x38);
  return;
}



void Unwind_1401e4e40(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0x60);
  return;
}



undefined * Catch_All_1401e4e50(undefined8 param_1,longlong param_2)

{
  *(undefined4 *)(param_2 + 0x30) = 0;
  return &DAT_1400a4b47;
}



void Unwind_1401e4e80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401e4e90(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401e4ea0(undefined8 param_1,longlong param_2)

{
  FUN_1400a3ff0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401e4eb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_1401e4ec0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1401e4ed0(undefined8 param_1,longlong param_2)

{
  FUN_1400aaa90(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_1401e4ef0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x58) & 1) != 0) {
    *(uint *)(param_2 + 0x58) = *(uint *)(param_2 + 0x58) & 0xfffffffe;
    thunk_FUN_14000c2a0(*(undefined8 *)(param_2 + 0x40));
  }
  return;
}



void Unwind_1401e4f20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x50),0x400);
  return;
}



void Unwind_1401e4f40(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x50);
  return;
}



void Unwind_1401e4f50(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x58);
  return;
}



void Unwind_1401e4f60(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x60);
  return;
}



void Unwind_1401e4f70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x28);
  return;
}



void Unwind_1401e4f80(undefined8 param_1,longlong param_2)

{
  FUN_1400a1e20(param_2 + 0x70);
  return;
}



void Unwind_1401e4f90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x20);
  return;
}



void Unwind_1401e4fa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x48);
  return;
}



void Unwind_1401e4fb0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1e20(param_2 + 0x100);
  return;
}



void Unwind_1401e4fc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x40);
  return;
}



void Unwind_1401e4fd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x58);
  return;
}



void Unwind_1401e4fe0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401e4ff0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401e5000(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401e5010(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401e5020(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401e5030(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x40);
  return;
}



void Unwind_1401e5040(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x60);
  return;
}



void Unwind_1401e5050(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x60);
  return;
}



void Unwind_1401e5060(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



undefined8 Catch_1401e5070(undefined8 param_1,longlong param_2)

{
  undefined4 *puVar1;
  longlong *plVar2;
  
  puVar1 = *(undefined4 **)(param_2 + 0x50);
  plVar2 = *(longlong **)(puVar1 + 4);
  if ((plVar2 != (longlong *)0x0) && (*plVar2 != 0)) {
    FUN_1400a88b0();
  }
  *puVar1 = 3;
  return 0x1400a619a;
}



void Unwind_1401e50b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e50c0(void)

{
  DAT_140314140 = DAT_140314140 & 0xfffffffe;
  return;
}



void Unwind_1401e50e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e50f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x48),0x80);
  return;
}



void Unwind_1401e5110(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e5120(void)

{
  DAT_140314184 = DAT_140314184 & 0xfffffffe;
  return;
}



void Unwind_1401e5140(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x60),
                *(longlong *)(param_2 + 0x50) + (longlong)*(int *)(param_2 + 0x58) * 8);
  return;
}



void Unwind_1401e5170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_1401e5180(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x28),
                *(longlong *)(param_2 + 0xd8) + (longlong)*(int *)(param_2 + 200) * 8);
  return;
}



void Unwind_1401e51b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x28);
  return;
}



void Unwind_1401e51c0(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0x50);
  return;
}



void Unwind_1401e51d0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x20) & 1) != 0) {
    *(uint *)(param_2 + 0x20) = *(uint *)(param_2 + 0x20) & 0xfffffffe;
    thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x40));
  }
  return;
}



void Unwind_1401e5200(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e5210(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x50) & 1) != 0) {
    *(uint *)(param_2 + 0x50) = *(uint *)(param_2 + 0x50) & 0xfffffffe;
    thunk_FUN_14000c2a0(*(undefined8 *)(param_2 + 0x40));
  }
  return;
}



void Unwind_1401e5240(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x68) & 1) != 0) {
    *(uint *)(param_2 + 0x68) = *(uint *)(param_2 + 0x68) & 0xfffffffe;
    thunk_FUN_14000c2a0(*(undefined8 *)(param_2 + 0x60));
  }
  return;
}



void Unwind_1401e5270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x70);
  return;
}



void Unwind_1401e5280(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e5290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x28);
  return;
}



void Unwind_1401e52a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x20);
  return;
}



void Unwind_1401e52b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401e52c0(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0x50);
  return;
}



void Unwind_1401e52d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401e52e0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0x38));
  return;
}



void Unwind_1401e52f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x20);
  return;
}



void Unwind_1401e5300(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401e5310(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e5320(void)

{
  DAT_1403141d8 = DAT_1403141d8 & 0xfffffffe;
  return;
}



void Unwind_1401e5340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x20);
  return;
}



void Unwind_1401e5350(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x28);
  return;
}



void Unwind_1401e5360(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401e5370(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401e5380(undefined8 param_1,longlong param_2)

{
  FUN_1400a8ba0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401e5390(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x90) + 0x28);
  return;
}



void Unwind_1401e53a0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x90) + 0x140);
  return;
}



void Unwind_1401e53c0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x90) + 0x200);
  return;
}



void Unwind_1401e53e0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x90) + 0x2c0);
  return;
}



void Unwind_1401e5400(undefined8 param_1,longlong param_2)

{
  FUN_1400a8ba0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e5410(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_1401e5420(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x40) + 0x140);
  return;
}



void Unwind_1401e5440(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x40) + 0x200);
  return;
}



void Unwind_1401e5460(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x40) + 0x2c0);
  return;
}



void Unwind_1401e5480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x20);
  return;
}



void Unwind_1401e5490(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401e54a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401e54b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x30));
  return;
}



void Unwind_1401e54c0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1e20(param_2 + 0x50);
  return;
}



void Unwind_1401e54d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x20);
  return;
}



void Unwind_1401e54e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401e54f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401e5500(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401e5510(undefined8 param_1,longlong param_2)

{
  FUN_14018a2d0(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_1401e5520(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0x40);
  return;
}



void Unwind_1401e5530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401e5540(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e5550(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 1) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xfffffffe;
    thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  }
  return;
}



void Unwind_1401e5580(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e5590(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e55a0(void)

{
  FUN_1400acf90(&DAT_140314310);
  return;
}



void Unwind_1401e55b0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x50) + 0x70);
  return;
}



void Unwind_1401e55c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e55d0(void)

{
  DAT_140314d70 = DAT_140314d70 & 0xfffffffe;
  return;
}



void Unwind_1401e55f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e5600(undefined8 param_1,longlong param_2)

{
  FUN_1400a63f0(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_1401e5610(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
  return;
}



void Unwind_1401e5620(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
  return;
}



void Unwind_1401e5630(undefined8 param_1,longlong param_2)

{
  FUN_1400a63f0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e5640(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x88);
  return;
}



void Unwind_1401e5650(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x80);
  return;
}



void Unwind_1401e5660(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e5670(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e5680(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e5690(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401e56a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_1401e56b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400abab0(*(longlong *)(param_2 + 0x80) + 0x38);
  return;
}



void Unwind_1401e56c0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x80) + 0x50);
  return;
}



void Unwind_1401e56d0(undefined8 param_1,longlong param_2)

{
  FUN_1401a4f30(*(longlong *)(param_2 + 0x80) + 0x88);
  return;
}



void Unwind_1401e56f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400abab0(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_1401e5700(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_1401e5710(undefined8 param_1,longlong param_2)

{
  FUN_1401a4f30(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_1401e5730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401e5740(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e5750(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e5760(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401e5770(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401e5780(void)

{
  DAT_140315798 = DAT_140315798 & 0xfffffffe;
  return;
}



undefined8 Catch_All_1401e57a0(void)

{
  return 0x1400adc95;
}



void FUN_1401e57bb(void)

{
  _unlock(8);
  return;
}



void FUN_1401e57d6(_EXCEPTION_POINTERS *param_1)

{
  _XcptFilter(param_1->ExceptionRecord->ExceptionCode,param_1);
  return;
}



// Library Function - Single Match
//  int `void __cdecl __ArrayUnwind(void * __ptr64,unsigned __int64,int,void (__cdecl*)(void *
// __ptr64))'::`1'::filt$0
// 
// Library: Visual Studio 2005 Release

undefined4
`void___cdecl___ArrayUnwind(void*___ptr64,unsigned___int64,int,void_(__cdecl*)(void*___ptr64))'::
__l1::filt_0(undefined8 param_1,longlong param_2)

{
  *(undefined8 *)(param_2 + 0x38) = param_1;
  *(undefined8 *)(param_2 + 0x28) = param_1;
  *(undefined8 *)(param_2 + 0x30) = **(undefined8 **)(param_2 + 0x28);
  if (**(int **)(param_2 + 0x30) != -0x1f928c9d) {
    *(undefined4 *)(param_2 + 0x20) = 0;
    return *(undefined4 *)(param_2 + 0x20);
  }
                    // WARNING: Subroutine does not return
  terminate();
}



// Library Function - Single Match
//  int `void __cdecl `eh vector destructor iterator'(void * __ptr64,unsigned __int64,int,void
// (__cdecl*)(void * __ptr64))'::`1'::fin$0
// 
// Library: Visual Studio 2005 Release

void `void___cdecl_`eh_vector_destructor_iterator'(void*___ptr64,unsigned___int64,int,void_(__cdecl*)(void*___ptr64))'
     ::__l1::fin_0(undefined8 param_1,longlong param_2)

{
  if (*(int *)(param_2 + 0x20) == 0) {
    __ArrayUnwind(*(void **)(param_2 + 0x60),*(__uint64 *)(param_2 + 0x68),*(int *)(param_2 + 0x70),
                  *(_func_void_void_ptr **)(param_2 + 0x78));
  }
  return;
}



bool FUN_1401e5870(undefined8 *param_1)

{
  return *(int *)*param_1 == -0x3ffffffb;
}



void Unwind_1401e58a0(undefined8 param_1,longlong param_2)

{
  FUN_1400b6f90(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_1401e58b0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x50) + 0x20),0x20,10,FUN_1400af160);
  return;
}



void Unwind_1401e58e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
  return;
}



void Unwind_1401e58f0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0xd0);
  return;
}



void Unwind_1401e5900(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x30);
  return;
}



void Unwind_1401e5910(undefined8 param_1,longlong param_2)

{
  FUN_1400b6f90(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e5920(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x40) + 0x20),0x20,10,FUN_1400af160);
  return;
}



void Unwind_1401e5950(undefined8 param_1,longlong param_2)

{
  FUN_1400b6f90(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e5960(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401e5970(undefined8 param_1,longlong param_2)

{
  FUN_1400b6f90(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e5980(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401e5990(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401e59a0(undefined8 param_1,longlong param_2)

{
  FUN_1400b6f90(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e59b0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e59c0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x58);
  return;
}



void Unwind_1401e59d0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e59e0(undefined8 param_1,longlong param_2)

{
  FUN_1400cead0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401e59f0(undefined8 param_1,longlong param_2)

{
  FUN_1400c0c30(param_2 + 0x30);
  return;
}



void Unwind_1401e5a00(undefined8 param_1,longlong param_2)

{
  FUN_1400ba8d0(*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_1401e5a10(undefined8 param_1,longlong param_2)

{
  FUN_1400bba50(*(longlong *)(param_2 + 0x20) + 0x180);
  return;
}



void Unwind_1401e5a30(undefined8 param_1,longlong param_2)

{
  FUN_1400bb910(*(longlong *)(param_2 + 0x20) + 0x370);
  return;
}



void Unwind_1401e5a50(undefined8 param_1,longlong param_2)

{
  FUN_1400d1240(*(longlong *)(param_2 + 0x20) + 0x3c8);
  return;
}



void Unwind_1401e5a70(undefined8 param_1,longlong param_2)

{
  FUN_1400afc00(*(longlong *)(param_2 + 0x20) + 0x3f8);
  return;
}



void Unwind_1401e5a90(undefined8 param_1,longlong param_2)

{
  FUN_1400d3480(*(longlong *)(param_2 + 0x20) + 0x550);
  return;
}



void Unwind_1401e5ab0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x20) + 0x630);
  return;
}



void Unwind_1401e5ad0(undefined8 param_1,longlong param_2)

{
  FUN_1400d1a80(*(longlong *)(param_2 + 0x20) + 0x658);
  return;
}



void Unwind_1401e5af0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x20) + 0x6b8);
  return;
}



void Unwind_1401e5b10(undefined8 param_1,longlong param_2)

{
  FUN_1400d17c0(*(longlong *)(param_2 + 0x20) + 0x710);
  return;
}



void Unwind_1401e5b30(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x20) + 0x750);
  return;
}



void Unwind_1401e5b50(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x20) + 0x778);
  return;
}



void Unwind_1401e5b70(undefined8 param_1,longlong param_2)

{
  FUN_1400c0c30(*(longlong *)(param_2 + 0x20) + 0x818);
  return;
}



void Unwind_1401e5b90(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x20) + 0x858);
  return;
}



void Unwind_1401e5bb0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x20) + 0x8a0);
  return;
}



void Unwind_1401e5bd0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x20) + 0x8d0);
  return;
}



void Unwind_1401e5bf0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x20) + 0x970);
  return;
}



void Unwind_1401e5c10(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x20) + 0xa10);
  return;
}



void Unwind_1401e5c30(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x20) + 0xa40);
  return;
}



void Unwind_1401e5c50(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x20) + 0xa70);
  return;
}



void Unwind_1401e5c70(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x20) + 0xa98);
  return;
}



void Unwind_1401e5c90(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x20) + 0xac0);
  return;
}



void Unwind_1401e5cb0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x20) + 0xaf0);
  return;
}



void Unwind_1401e5cd0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x20) + 0xb90);
  return;
}



void Unwind_1401e5cf0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x20) + 0xc30);
  return;
}



void Unwind_1401e5d10(undefined8 param_1,longlong param_2)

{
  FUN_1400ba8d0(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1401e5d20(undefined8 param_1,longlong param_2)

{
  FUN_1400bba50(*(longlong *)(param_2 + 0x60) + 0x180);
  return;
}



void Unwind_1401e5d40(undefined8 param_1,longlong param_2)

{
  FUN_1400bb910(*(longlong *)(param_2 + 0x60) + 0x370);
  return;
}



void Unwind_1401e5d60(undefined8 param_1,longlong param_2)

{
  FUN_1400d1240(*(longlong *)(param_2 + 0x60) + 0x3c8);
  return;
}



void Unwind_1401e5d80(undefined8 param_1,longlong param_2)

{
  FUN_1400afc00(*(longlong *)(param_2 + 0x60) + 0x3f8);
  return;
}



void Unwind_1401e5da0(undefined8 param_1,longlong param_2)

{
  FUN_1400d3480(*(longlong *)(param_2 + 0x60) + 0x550);
  return;
}



void Unwind_1401e5dc0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x60) + 0x630);
  return;
}



void Unwind_1401e5de0(undefined8 param_1,longlong param_2)

{
  FUN_1400d1a80(*(longlong *)(param_2 + 0x60) + 0x658);
  return;
}



void Unwind_1401e5e00(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x60) + 0x6b8);
  return;
}



void Unwind_1401e5e20(undefined8 param_1,longlong param_2)

{
  FUN_1400d17c0(*(longlong *)(param_2 + 0x60) + 0x710);
  return;
}



void Unwind_1401e5e40(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x60) + 0x750);
  return;
}



void Unwind_1401e5e60(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x60) + 0x778);
  return;
}



void Unwind_1401e5e80(undefined8 param_1,longlong param_2)

{
  FUN_1400c0c30(*(longlong *)(param_2 + 0x60) + 0x818);
  return;
}



void Unwind_1401e5ea0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x60) + 0x858);
  return;
}



void Unwind_1401e5ec0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x60) + 0x8a0);
  return;
}



void Unwind_1401e5ee0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x60) + 0x8d0);
  return;
}



void Unwind_1401e5f00(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x60) + 0x970);
  return;
}



void Unwind_1401e5f20(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x60) + 0xa10);
  return;
}



void Unwind_1401e5f40(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x60) + 0xa40);
  return;
}



void Unwind_1401e5f60(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x60) + 0xa70);
  return;
}



void Unwind_1401e5f80(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x60) + 0xa98);
  return;
}



void Unwind_1401e5fa0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x60) + 0xac0);
  return;
}



void Unwind_1401e5fc0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x60) + 0xaf0);
  return;
}



void Unwind_1401e5fe0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x60) + 0xb90);
  return;
}



void Unwind_1401e6000(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x60) + 0xc30);
  return;
}



void Unwind_1401e6020(undefined8 param_1,longlong param_2)

{
  FUN_1400d3c20(param_2 + 0x60);
  return;
}



void Unwind_1401e6030(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401e6040(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401e6050(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401e6060(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401e6070(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401e6080(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401e6090(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401e60a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401e60b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401e60c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401e60d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401e60e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401e60f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401e6100(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401e6110(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401e6120(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e6130(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e6140(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e6150(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e6160(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e6170(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e6180(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e6190(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e61a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e61b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1401e61c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1401e61d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1401e61e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1401e61f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1401e6200(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1401e6210(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1401e6220(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1401e6230(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1401e6240(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e6250(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e6260(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e6270(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e6280(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e6290(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e62a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e62b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e62c0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x50);
  return;
}



void Unwind_1401e62d0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xa0);
  return;
}



void Unwind_1401e62e0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xd0);
  return;
}



void Unwind_1401e62f0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x1b0);
  return;
}



void Unwind_1401e6300(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x110);
  return;
}



void Unwind_1401e6310(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x370));
  return;
}



void Unwind_1401e6320(undefined8 param_1,longlong param_2)

{
  FUN_1400e9480(param_2 + 0x250);
  return;
}



void Unwind_1401e6330(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x78);
  return;
}



void Unwind_1401e6340(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x370));
  return;
}



void Unwind_1401e6350(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401e6360(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x20);
  return;
}



void Unwind_1401e6370(undefined8 param_1,longlong param_2)

{
  FUN_1400ef960(param_2 + 0x70);
  return;
}



void Unwind_1401e6380(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401e6390(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x20);
  return;
}



void Unwind_1401e63a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401e63b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401e63c0(undefined8 param_1,longlong param_2)

{
  FUN_1400e2870(param_2 + 0x1e0);
  return;
}



void Unwind_1401e63d0(undefined8 param_1,longlong param_2)

{
  FUN_1400e0ea0(param_2 + 0x140);
  return;
}



void Unwind_1401e63e0(undefined8 param_1,longlong param_2)

{
  FUN_1400dd4b0(param_2 + 0x140);
  return;
}



void Unwind_1401e63f0(undefined8 param_1,longlong param_2)

{
  FUN_1400d85f0(param_2 + 0x330);
  return;
}



void Unwind_1401e6400(undefined8 param_1,longlong param_2)

{
  FUN_1400d6f80(param_2 + 0x140);
  return;
}



void Unwind_1401e6410(undefined8 param_1,longlong param_2)

{
  FUN_1400d6bf0(param_2 + 0x330);
  return;
}



void Unwind_1401e6420(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x70);
  return;
}



void Unwind_1401e6430(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0xa0);
  return;
}



void Unwind_1401e6440(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x140);
  return;
}



void Unwind_1401e6450(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401e6460(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x70);
  return;
}



void Unwind_1401e6470(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0xa0);
  return;
}



void Unwind_1401e6480(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x140);
  return;
}



void Unwind_1401e6490(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401e64a0(undefined8 param_1,longlong param_2)

{
  FUN_1400d5bd0(param_2 + 0x750);
  return;
}



void Unwind_1401e64b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401e64c0(undefined8 param_1,longlong param_2)

{
  FUN_1400ef440(param_2 + 0x140);
  return;
}



void Unwind_1401e64d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401e64e0(undefined8 param_1,longlong param_2)

{
  FUN_1400e2870(param_2 + 0x1e0);
  return;
}



void Unwind_1401e64f0(undefined8 param_1,longlong param_2)

{
  FUN_1400e0ea0(param_2 + 0x140);
  return;
}



void Unwind_1401e6500(undefined8 param_1,longlong param_2)

{
  FUN_1400dd4b0(param_2 + 0x140);
  return;
}



void Unwind_1401e6510(undefined8 param_1,longlong param_2)

{
  FUN_1400d85f0(param_2 + 0x330);
  return;
}



void Unwind_1401e6520(undefined8 param_1,longlong param_2)

{
  FUN_1400d6f80(param_2 + 0x140);
  return;
}



void Unwind_1401e6530(undefined8 param_1,longlong param_2)

{
  FUN_1400d6bf0(param_2 + 0x330);
  return;
}



void Unwind_1401e6540(undefined8 param_1,longlong param_2)

{
  FUN_1400d5bd0(param_2 + 0x750);
  return;
}



void Unwind_1401e6550(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x70);
  return;
}



void Unwind_1401e6560(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0xa0);
  return;
}



void Unwind_1401e6570(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x140);
  return;
}



void Unwind_1401e6580(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401e6590(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x70);
  return;
}



void Unwind_1401e65a0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0xa0);
  return;
}



void Unwind_1401e65b0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x140);
  return;
}



void Unwind_1401e65c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401e65d0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401e65e0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401e65f0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401e6600(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401e6610(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x48);
  return;
}



void Unwind_1401e6620(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401e6630(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x88);
  return;
}



void Unwind_1401e6640(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0xc0);
  return;
}



void Unwind_1401e6650(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x58);
  return;
}



void Unwind_1401e6660(undefined8 param_1,longlong param_2)

{
  FUN_1400d17c0(param_2 + 0x90);
  return;
}



void Unwind_1401e6670(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401e6680(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x58);
  return;
}



void Unwind_1401e6690(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e66a0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401e66b0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_1401e66c0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x70);
  return;
}



void Unwind_1401e66d0(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0x40);
  return;
}



void Unwind_1401e66e0(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0x40);
  return;
}



void Unwind_1401e66f0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401e6700(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0x60);
  return;
}



void Unwind_1401e6710(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401e6720(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0x60);
  return;
}



void Unwind_1401e6730(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x20);
  return;
}



void Unwind_1401e6740(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x20);
  return;
}



void Unwind_1401e6750(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e6760(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x60);
  return;
}



void Unwind_1401e6770(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x30);
  return;
}



void Unwind_1401e6780(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x30);
  return;
}



void Unwind_1401e6790(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x48);
  return;
}



void Unwind_1401e67a0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401e67b0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x30);
  return;
}



void Unwind_1401e67c0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x48);
  return;
}



void Unwind_1401e67d0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401e67e0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e67f0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401e6800(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_1401e6810(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0x40);
  return;
}



void Unwind_1401e6820(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0x100);
  return;
}



void Unwind_1401e6830(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x30);
  return;
}



void Unwind_1401e6840(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x30);
  return;
}



void Unwind_1401e6850(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x48);
  return;
}



void Unwind_1401e6860(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401e6870(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x60);
  return;
}



void Unwind_1401e6880(undefined8 param_1,longlong param_2)

{
  FUN_1401049e0(param_2 + 0x38);
  return;
}



undefined * Catch_All_1401e6890(void)

{
  return &DAT_1400b8ed5;
}



void Unwind_1401e68b0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x70);
  return;
}



void Unwind_1401e68c0(undefined8 param_1,longlong param_2)

{
  FUN_1401049e0(param_2 + 0x40);
  return;
}



undefined * Catch_All_1401e68d0(void)

{
  return &DAT_1400b9147;
}



void Unwind_1401e68f0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x110);
  return;
}



undefined * Catch_All_1401e6900(void)

{
  return &DAT_1400b936b;
}



void Unwind_1401e6920(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x88);
  return;
}



void Unwind_1401e6930(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x58);
  return;
}



void Unwind_1401e6940(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x20);
  return;
}



void Unwind_1401e6950(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x48);
  return;
}



void Unwind_1401e6960(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x48);
  return;
}



void Unwind_1401e6970(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x20);
  return;
}



void Unwind_1401e6980(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x38);
  return;
}



void Unwind_1401e6990(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x28);
  return;
}



void Unwind_1401e69a0(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x28);
  return;
}



void Unwind_1401e69b0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401e69c0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_1401e69d0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x40) + 0xe0);
  return;
}



void Unwind_1401e69f0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401e6a00(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_1401e6a10(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x30);
  return;
}



void Unwind_1401e6a20(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x40);
  return;
}



void Unwind_1401e6a30(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x30);
  return;
}



void Unwind_1401e6a40(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x40);
  return;
}



void Unwind_1401e6a50(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x40);
  return;
}



void Unwind_1401e6a60(undefined8 param_1,longlong param_2)

{
  FUN_140105ab0(param_2 + 0x78);
  return;
}



void Unwind_1401e6a70(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x40);
  return;
}



void Unwind_1401e6a80(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x40);
  return;
}



void Unwind_1401e6a90(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x30);
  return;
}



void Unwind_1401e6aa0(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x30);
  return;
}



void Unwind_1401e6ab0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x40);
  return;
}



void Unwind_1401e6ac0(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x60);
  return;
}



void Unwind_1401e6ad0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401e6ae0(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x60);
  return;
}



void Unwind_1401e6af0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401e6b00(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401e6b10(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401e6b20(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401e6b30(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401e6b40(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401e6b50(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401e6b60(undefined8 param_1,longlong param_2)

{
  FUN_140105ab0(param_2 + 0x78);
  return;
}



void Unwind_1401e6b70(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401e6b80(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401e6b90(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x60);
  return;
}



void Unwind_1401e6ba0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401e6bb0(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x60);
  return;
}



void Unwind_1401e6bc0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401e6bd0(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x60);
  return;
}



void Unwind_1401e6be0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401e6bf0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x40);
  return;
}



void Unwind_1401e6c00(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x70);
  return;
}



void Unwind_1401e6c10(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x110);
  return;
}



void Unwind_1401e6c30(undefined8 param_1,longlong param_2)

{
  FUN_1400ba8d0(param_2 + 0x30);
  return;
}



void Unwind_1401e6c40(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x40);
  return;
}



void Unwind_1401e6c50(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x70);
  return;
}



void Unwind_1401e6c60(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401e6c70(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1401e6c80(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401e6c90(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x40) + 0xb0);
  return;
}



undefined * Catch_All_1401e6cb0(void)

{
  return &DAT_1400bbb65;
}



undefined * Catch_All_1401e6cd0(void)

{
  return &DAT_1400bbeae;
}



undefined * Catch_All_1401e6cf0(void)

{
  return &DAT_1400bbfd8;
}



undefined * Catch_All_1401e6d10(void)

{
  return &DAT_1400bc58f;
}



undefined * Catch_All_1401e6d30(void)

{
  return &DAT_1400bc6d9;
}



undefined * Catch_All_1401e6d50(void)

{
  return &DAT_1400bc91d;
}



undefined * Catch_All_1401e6d70(void)

{
  return &DAT_1400bca42;
}



void Unwind_1401e6d90(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x50));
  return;
}



undefined * Catch_All_1401e6da0(void)

{
  return &DAT_1400bcb00;
}



undefined * Catch_All_1401e6dc0(void)

{
  return &DAT_1400bcb1c;
}



undefined * Catch_All_1401e6de0(void)

{
  return &DAT_1400bcb72;
}



void Unwind_1401e6e00(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



undefined * Catch_All_1401e6e10(undefined8 param_1,longlong param_2)

{
  *(undefined8 *)(param_2 + 0x48) = 0;
  return &DAT_1400bcc0b;
}



undefined * Catch_All_1401e6e40(void)

{
  return &DAT_1400bd065;
}



undefined * Catch_All_1401e6e60(void)

{
  return &DAT_1400bd192;
}



void Unwind_1401e6e80(undefined8 param_1,longlong param_2)

{
  FUN_1401049e0(param_2 + 0x60);
  return;
}



void Unwind_1401e6e90(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0x90);
  return;
}



void Unwind_1401e6ea0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e6eb0(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0x90);
  return;
}



void Unwind_1401e6ec0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e6ed0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



undefined * Catch_All_1401e6ee0(void)

{
  return &DAT_1400bd8bd;
}



void Unwind_1401e6f00(undefined8 param_1,longlong param_2)

{
  FUN_1400f5000(param_2 + 0x40);
  return;
}



void Unwind_1401e6f10(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x28);
  return;
}



void Unwind_1401e6f20(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e6f30(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x28);
  return;
}



void Unwind_1401e6f40(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x28);
  return;
}



undefined * Catch_All_1401e6f50(void)

{
  return &DAT_1400be221;
}



void Unwind_1401e6f70(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



undefined * Catch_All_1401e6f80(undefined8 param_1,longlong param_2)

{
  *(undefined8 *)(param_2 + 0x40) = 0;
  return &DAT_1400be763;
}



void Unwind_1401e6fb0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



undefined * Catch_All_1401e6fc0(undefined8 param_1,longlong param_2)

{
  *(undefined8 *)(param_2 + 0x48) = 0;
  return &DAT_1400be7c9;
}



void Unwind_1401e6ff0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x40);
  return;
}



void Unwind_1401e7000(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1401e7010(undefined8 param_1,longlong param_2)

{
  FUN_140106980(param_2 + 0x30);
  return;
}



void Unwind_1401e7020(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x30);
  return;
}



void Unwind_1401e7030(undefined8 param_1,longlong param_2)

{
  FUN_140106980(param_2 + 0x210);
  return;
}



void Unwind_1401e7040(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x170);
  return;
}



void Unwind_1401e7050(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0xd0);
  return;
}



void Unwind_1401e7060(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x30);
  return;
}



void Unwind_1401e7070(undefined8 param_1,longlong param_2)

{
  FUN_140106980(param_2 + 0x210);
  return;
}



void Unwind_1401e7080(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0xd0);
  return;
}



void Unwind_1401e7090(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x170);
  return;
}



void Unwind_1401e70a0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x50);
  return;
}



void Unwind_1401e70b0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x20);
  return;
}



void Unwind_1401e70c0(undefined8 param_1,longlong param_2)

{
  FUN_140106980(param_2 + 0x240);
  return;
}



void Unwind_1401e70d0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x100);
  return;
}



void Unwind_1401e70e0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x1a0);
  return;
}



void Unwind_1401e70f0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x30);
  return;
}



void Unwind_1401e7100(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x70);
  return;
}



void Unwind_1401e7110(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x110);
  return;
}



void Unwind_1401e7120(undefined8 param_1,longlong param_2)

{
  FUN_140106980(param_2 + 0x290);
  return;
}



void Unwind_1401e7130(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x150);
  return;
}



void Unwind_1401e7140(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x1f0);
  return;
}



void Unwind_1401e7150(undefined8 param_1,longlong param_2)

{
  FUN_1401049e0(param_2 + 0x50);
  return;
}



void Unwind_1401e7160(undefined8 param_1,longlong param_2)

{
  FUN_1400f37f0(param_2 + 0x30);
  return;
}



void Unwind_1401e7170(undefined8 param_1,longlong param_2)

{
  FUN_1400f53f0(param_2 + 0x30);
  return;
}



void Unwind_1401e7180(undefined8 param_1,longlong param_2)

{
  FUN_1400f5000(param_2 + 0x30);
  return;
}



void Unwind_1401e7190(undefined8 param_1,longlong param_2)

{
  FUN_1400f37f0(param_2 + 0x30);
  return;
}



void Unwind_1401e71a0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401e71b0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x60);
  return;
}



void Unwind_1401e71c0(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x20);
  return;
}



void Unwind_1401e71d0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401e71e0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x58);
  return;
}



void Unwind_1401e71f0(undefined8 param_1,longlong param_2)

{
  FUN_1400f36c0(param_2 + 0x88);
  return;
}



void Unwind_1401e7200(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7210(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7220(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7230(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7240(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7250(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7260(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7270(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7280(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7290(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e72a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e72b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e72c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e72d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e72e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e72f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7300(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7310(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7320(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7330(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7340(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7350(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7360(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7370(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e7380(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7390(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e73a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e73b0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e73c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e73d0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e73e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e73f0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e7400(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7410(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e7420(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7430(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e7440(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7450(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e7460(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7470(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e7480(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7490(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e74a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e74b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e74c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e74d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e74e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e74f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7500(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7510(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7520(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7530(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7540(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7550(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7560(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7570(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7580(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7590(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e75a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e75b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e75c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e75d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e75e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e75f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7600(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7610(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7620(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7630(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7640(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7650(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7660(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7670(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7680(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7690(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e76a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e76b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e76c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e76d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e76e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e76f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7700(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7710(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7720(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7730(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7740(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7750(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7760(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7770(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7780(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7790(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e77a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e77b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e77c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e77d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e77e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e77f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7800(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7810(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7820(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7830(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7840(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7850(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7860(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7870(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7880(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7890(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e78a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e78b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e78c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e78d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e78e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e78f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7900(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7910(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7920(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7930(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7940(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7950(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7960(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7970(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7980(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7990(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e79a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e79b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e79c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e79d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e79e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e79f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7a00(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7a10(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7a20(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7a30(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7a40(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7a50(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7a60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7a70(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7a80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7a90(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7aa0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7ab0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7ac0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7ad0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7ae0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7af0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e7b00(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7b10(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e7b20(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7b30(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e7b40(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7b50(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e7b60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7b70(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e7b80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7b90(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e7ba0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7bb0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e7bc0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7bd0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e7be0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7bf0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e7c00(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7c10(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e7c20(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7c30(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7c40(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7c50(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7c60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7c70(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7c80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7c90(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7ca0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7cb0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7cc0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7cd0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7ce0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7cf0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7d00(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7d10(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7d20(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7d30(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7d40(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7d50(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7d60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7d70(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7d80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7d90(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7da0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7db0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7dc0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7dd0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7de0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7df0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7e00(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7e10(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7e20(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7e30(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7e40(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7e50(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7e60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7e70(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7e80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7e90(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7ea0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7eb0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7ec0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7ed0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7ee0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7ef0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7f00(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7f10(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7f20(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7f30(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7f40(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7f50(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7f60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7f70(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7f80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7f90(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7fa0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7fb0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7fc0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7fd0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7fe0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e7ff0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8000(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8010(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8020(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8030(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8040(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8050(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8060(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8070(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8080(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8090(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e80a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e80b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e80c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e80d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e80e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e80f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8100(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8110(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8120(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8130(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8140(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8150(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8160(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8170(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8180(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8190(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e81a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e81b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e81c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e81d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e81e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e81f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8200(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8210(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8220(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8230(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8240(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8250(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8260(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8270(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8280(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8290(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e82a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e82b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e82c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e82d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e82e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e82f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8300(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8310(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8320(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8330(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8340(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8350(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8360(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8370(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8380(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8390(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e83a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e83b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e83c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e83d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e83e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e83f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8400(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8410(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8420(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8430(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8440(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8450(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8460(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8470(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8480(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8490(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e84a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e84b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e84c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e84d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e84e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e84f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8500(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8510(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8520(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8530(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8540(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8550(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8560(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8570(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8580(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8590(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e85a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e85b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e85c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e85d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e85e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e85f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8600(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8610(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8620(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8630(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8640(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8650(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8660(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8670(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8680(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e8690(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401e86a0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x80);
  return;
}



void Unwind_1401e86b0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xd8);
  return;
}



void Unwind_1401e86c0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xb0);
  return;
}



void Unwind_1401e86d0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x58);
  return;
}



void Unwind_1401e86e0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x58);
  return;
}



void Unwind_1401e86f0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x58);
  return;
}



void Unwind_1401e8700(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x80);
  return;
}



void Unwind_1401e8710(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xa8);
  return;
}



void Unwind_1401e8720(undefined8 param_1,longlong param_2)

{
  FUN_14010de40(param_2 + 0x30);
  return;
}



void Unwind_1401e8730(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e8740(undefined8 param_1,longlong param_2)

{
  FUN_14010dad0(param_2 + 0x30);
  return;
}



void Unwind_1401e8750(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e8760(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e8770(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e8780(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e8790(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e87a0(undefined8 param_1,longlong param_2)

{
  FUN_14010de40(param_2 + 0x100);
  return;
}



void Unwind_1401e87b0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e87c0(undefined8 param_1,longlong param_2)

{
  FUN_14010dad0(param_2 + 0x100);
  return;
}



void Unwind_1401e87d0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x38);
  return;
}



void Unwind_1401e87e0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x68);
  return;
}



void Unwind_1401e87f0(undefined8 param_1,longlong param_2)

{
  FUN_1400cf330(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e8800(undefined8 param_1,longlong param_2)

{
  FUN_1400d1240(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401e8810(undefined8 param_1,longlong param_2)

{
  FUN_14010eb90(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_1401e8820(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x68);
  return;
}



void Unwind_1401e8830(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x38);
  return;
}



void Unwind_1401e8840(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x28);
  return;
}



undefined * Catch_All_1401e8850(void)

{
  return &DAT_1400d09a6;
}



undefined * Catch_All_1401e8870(void)

{
  return &DAT_1400d0b71;
}



undefined * Catch_All_1401e8890(void)

{
  return &DAT_1400d0dfb;
}



undefined * Catch_All_1401e88b0(void)

{
  return &DAT_1400d11fc;
}



void Unwind_1401e88d0(undefined8 param_1,longlong param_2)

{
  FUN_1400f5000(param_2 + 0x70);
  return;
}



void Unwind_1401e88e0(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x28);
  return;
}



void Unwind_1401e88f0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x38);
  return;
}



void Unwind_1401e8900(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x28);
  return;
}



void Unwind_1401e8910(undefined8 param_1,longlong param_2)

{
  FUN_1400c0c30(param_2 + 0x50);
  return;
}



void Unwind_1401e8920(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e8930(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e8940(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e8950(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e8960(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e8970(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e8980(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e8990(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401e89a0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e89b0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e89c0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e89d0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e89e0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e89f0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e8a00(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e8a10(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e8a20(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x70);
  return;
}



void Unwind_1401e8a30(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x48);
  return;
}



void Unwind_1401e8a40(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0xf0);
  return;
}



void Unwind_1401e8a50(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x50);
  return;
}



void Unwind_1401e8a60(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401e8a70(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_1401e8a80(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x78);
  return;
}



void Unwind_1401e8a90(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e8aa0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401e8ab0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x38);
  return;
}



void Unwind_1401e8ac0(undefined8 param_1,longlong param_2)

{
  FUN_1400bec20(param_2 + 0xa0);
  return;
}



void Unwind_1401e8ad0(undefined8 param_1,longlong param_2)

{
  FUN_1400bec20(param_2 + 0x30);
  return;
}



void Unwind_1401e8ae0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x60);
  return;
}



void Unwind_1401e8af0(undefined8 param_1,longlong param_2)

{
  FUN_1400cf850(param_2 + 0x38);
  return;
}



void Unwind_1401e8b00(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x150);
  return;
}



void Unwind_1401e8b10(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x60);
  return;
}



void Unwind_1401e8b20(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x2f0);
  return;
}



void Unwind_1401e8b30(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x30);
  return;
}



void Unwind_1401e8b40(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x1e0);
  return;
}



void Unwind_1401e8b50(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x150);
  return;
}



void Unwind_1401e8b60(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(param_2 + 0x240);
  return;
}



void Unwind_1401e8b70(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x1b0);
  return;
}



void Unwind_1401e8b80(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xf0);
  return;
}



void Unwind_1401e8b90(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x180);
  return;
}



void Unwind_1401e8ba0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x120);
  return;
}



void Unwind_1401e8bb0(undefined8 param_1,longlong param_2)

{
  FUN_1400ef960(param_2 + 0x270);
  return;
}



void Unwind_1401e8bc0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x90);
  return;
}



void Unwind_1401e8bd0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x210);
  return;
}



void Unwind_1401e8be0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xc0);
  return;
}



void Unwind_1401e8bf0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x150);
  return;
}



void Unwind_1401e8c00(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x1e0);
  return;
}



void Unwind_1401e8c10(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x1e0);
  return;
}



void Unwind_1401e8c20(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x30));
  return;
}



void Unwind_1401e8c30(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x30));
  return;
}



void Unwind_1401e8c40(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x78));
  return;
}



void Unwind_1401e8c50(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x78));
  return;
}



void Unwind_1401e8c60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x70));
  return;
}



void Unwind_1401e8c70(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x70));
  return;
}



void Unwind_1401e8c80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_1401e8c90(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_1401e8ca0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401e8cb0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x88));
  return;
}



void Unwind_1401e8cc0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x88));
  return;
}



void Unwind_1401e8cd0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_1401e8ce0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401e8cf0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401e8d00(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x98));
  return;
}



void Unwind_1401e8d10(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x98));
  return;
}



void Unwind_1401e8d20(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e8d30(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x98));
  return;
}



void Unwind_1401e8d40(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_1401e8d50(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_1401e8d60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_1401e8d70(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x78));
  return;
}



void Unwind_1401e8d80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x78));
  return;
}



void Unwind_1401e8d90(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x78));
  return;
}



void Unwind_1401e8da0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e8db0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401e8dc0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x40) + 0xb0);
  return;
}



void Unwind_1401e8de0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x40) + 0x150);
  return;
}



void Unwind_1401e8e00(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x40) + 0x1f0);
  return;
}



void Unwind_1401e8e20(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x40) + 0x290);
  return;
}



void Unwind_1401e8e40(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x40) + 0x330);
  return;
}



void Unwind_1401e8e60(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x40) + 0x358);
  return;
}



void Unwind_1401e8e80(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401e8e90(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_1401e8ea0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_1401e8eb0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x98);
  return;
}



void Unwind_1401e8ed0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 200);
  return;
}



void Unwind_1401e8ef0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0xf8);
  return;
}



void Unwind_1401e8f10(undefined8 param_1,longlong param_2)

{
  FUN_1400b0680(param_2 + 0x30);
  return;
}



void Unwind_1401e8f20(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x50);
  return;
}



void Unwind_1401e8f30(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x80);
  return;
}



void Unwind_1401e8f40(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e8f50(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 200));
  return;
}



void Unwind_1401e8f60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 200));
  return;
}



void Unwind_1401e8f70(undefined8 param_1,longlong param_2)

{
  FUN_1400bec20(param_2 + 0x30);
  return;
}



void Unwind_1401e8f80(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x40);
  return;
}



void Unwind_1401e8f90(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x50);
  return;
}



void Unwind_1401e8fa0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x20);
  return;
}



void Unwind_1401e8fb0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x88);
  return;
}



void Unwind_1401e8fc0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401e8fd0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1401e8fe0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x40) + 0x58);
  return;
}



void Unwind_1401e8ff0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x40) + 0x80);
  return;
}



void Unwind_1401e9010(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_1401e9020(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x50) + 0x30);
  return;
}



void Unwind_1401e9030(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x50) + 0x58);
  return;
}



void Unwind_1401e9040(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x50) + 0x80);
  return;
}



void Unwind_1401e9060(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x50) + 0xa8);
  return;
}



void Unwind_1401e9080(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e9090(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401e90a0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_1401e90b0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x60);
  return;
}



void Unwind_1401e90c0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e90d0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x60);
  return;
}



void Unwind_1401e90e0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e90f0(undefined8 param_1,longlong param_2)

{
  FUN_1400d1240(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e9100(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1401e9110(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x40) + 0x78);
  return;
}



void Unwind_1401e9120(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x78));
  return;
}



void Unwind_1401e9130(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401e9140(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401e9150(undefined8 param_1,longlong param_2)

{
  FUN_140119be0(param_2 + 0x250);
  return;
}



void Unwind_1401e9160(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x110);
  return;
}



void Unwind_1401e9170(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x1b0);
  return;
}



void Unwind_1401e9180(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x70);
  return;
}



void Unwind_1401e9190(undefined8 param_1,longlong param_2)

{
  FUN_1400b0680(param_2 + 0x120);
  return;
}



void Unwind_1401e91a0(undefined8 param_1,longlong param_2)

{
  FUN_14012ff50(param_2 + 0x40);
  return;
}



void Unwind_1401e91b0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x50);
  return;
}



void Unwind_1401e91c0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x20);
  return;
}



void Unwind_1401e91d0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x1a0);
  return;
}



void Unwind_1401e91e0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x60);
  return;
}



void Unwind_1401e91f0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401e9200(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xa0);
  return;
}



void Unwind_1401e9210(undefined8 param_1,longlong param_2)

{
  FUN_1400e6a90(param_2 + 0x60);
  return;
}



void Unwind_1401e9220(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401e9230(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x100);
  return;
}



void Unwind_1401e9240(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x60);
  return;
}



void Unwind_1401e9250(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401e9260(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xa0);
  return;
}



void Unwind_1401e9270(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e9280(undefined8 param_1,longlong param_2)

{
  FUN_1400e5be0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401e9290(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x168);
  return;
}



void Unwind_1401e92b0(undefined8 param_1,longlong param_2)

{
  FUN_1400e6a90(*(longlong *)(param_2 + 0x40) + 0x198);
  return;
}



void Unwind_1401e92d0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401e92e0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x48) + 0x10);
  return;
}



void Unwind_1401e92f0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x48) + 0x40);
  return;
}



void Unwind_1401e9300(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x130);
  return;
}



void Unwind_1401e9310(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401e9320(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0x1d0);
  return;
}



void Unwind_1401e9330(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x58);
  return;
}



void Unwind_1401e9340(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x90);
  return;
}



void Unwind_1401e9350(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1401e9360(undefined8 param_1,longlong param_2)

{
  FUN_1400e5be0(*(longlong *)(param_2 + 0x70) + 0x10);
  return;
}



void Unwind_1401e9370(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x70) + 0x168);
  return;
}



void Unwind_1401e9390(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401e93a0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x78) + 0x10);
  return;
}



void Unwind_1401e93b0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x78) + 0x40);
  return;
}



void Unwind_1401e93c0(undefined8 param_1,longlong param_2)

{
  FUN_1400e6a90(*(longlong *)(param_2 + 0x70) + 0x198);
  return;
}



void Unwind_1401e93e0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x70) + 0x238);
  return;
}



void Unwind_1401e9400(undefined8 param_1,longlong param_2)

{
  FUN_1400e65d0(param_2 + 0x60);
  return;
}



void Unwind_1401e9410(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x68);
  return;
}



void Unwind_1401e9420(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x88);
  return;
}



void Unwind_1401e9430(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xa8);
  return;
}



void Unwind_1401e9440(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 200);
  return;
}



void Unwind_1401e9450(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xe8);
  return;
}



void Unwind_1401e9470(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x108);
  return;
}



void Unwind_1401e9490(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x128);
  return;
}



void Unwind_1401e94b0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401e94c0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x68);
  return;
}



void Unwind_1401e94d0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x88);
  return;
}



void Unwind_1401e94e0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xa8);
  return;
}



void Unwind_1401e94f0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 200);
  return;
}



void Unwind_1401e9500(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xe8);
  return;
}



void Unwind_1401e9520(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x108);
  return;
}



void Unwind_1401e9540(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x128);
  return;
}



void Unwind_1401e9560(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x68);
  return;
}



void Unwind_1401e9570(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x88);
  return;
}



void Unwind_1401e9580(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xa8);
  return;
}



void Unwind_1401e9590(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 200);
  return;
}



void Unwind_1401e95a0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xe8);
  return;
}



void Unwind_1401e95c0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x108);
  return;
}



void Unwind_1401e95e0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x128);
  return;
}



void Unwind_1401e9600(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x68);
  return;
}



void Unwind_1401e9610(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x88);
  return;
}



void Unwind_1401e9620(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xa8);
  return;
}



void Unwind_1401e9630(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 200);
  return;
}



void Unwind_1401e9640(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xe8);
  return;
}



void Unwind_1401e9660(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x108);
  return;
}



void Unwind_1401e9680(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x128);
  return;
}



void Unwind_1401e96a0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e96b0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401e96c0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401e96d0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x48) + 0x10);
  return;
}



void Unwind_1401e96e0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x48) + 0x40);
  return;
}



void Unwind_1401e96f0(undefined8 param_1,longlong param_2)

{
  FUN_1400e6a90(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1401e9700(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401e9710(undefined8 param_1,longlong param_2)

{
  FUN_1400e6a90(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1401e9720(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x40) + 0xd0);
  return;
}



void Unwind_1401e9740(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401e9750(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x48) + 0x10);
  return;
}



void Unwind_1401e9760(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x48) + 0x40);
  return;
}



void Unwind_1401e9770(undefined8 param_1,longlong param_2)

{
  FUN_1400d1240(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e9780(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1401e9790(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x40) + 0x78);
  return;
}



void Unwind_1401e97a0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x40) + 0xa0);
  return;
}



void Unwind_1401e97c0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x80);
  return;
}



void Unwind_1401e97d0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x90);
  return;
}



void Unwind_1401e97e0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xc0);
  return;
}



void Unwind_1401e97f0(undefined8 param_1,longlong param_2)

{
  FUN_1400e6a90(param_2 + 0x80);
  return;
}



void Unwind_1401e9800(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x58);
  return;
}



void Unwind_1401e9810(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x80);
  return;
}



void Unwind_1401e9820(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x90);
  return;
}



void Unwind_1401e9830(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xc0);
  return;
}



void Unwind_1401e9840(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401e9850(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x80);
  return;
}



void Unwind_1401e9860(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x90);
  return;
}



void Unwind_1401e9870(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xc0);
  return;
}



void Unwind_1401e9880(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x80);
  return;
}



void Unwind_1401e9890(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x90);
  return;
}



void Unwind_1401e98a0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xc0);
  return;
}



void Unwind_1401e98b0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x70);
  return;
}



void Unwind_1401e98c0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x80);
  return;
}



void Unwind_1401e98d0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xb0);
  return;
}



void Unwind_1401e98e0(undefined8 param_1,longlong param_2)

{
  FUN_1400e6a90(param_2 + 0x70);
  return;
}



void Unwind_1401e98f0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x70);
  return;
}



void Unwind_1401e9900(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x80);
  return;
}



void Unwind_1401e9910(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xb0);
  return;
}



void Unwind_1401e9920(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x70);
  return;
}



void Unwind_1401e9930(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x80);
  return;
}



void Unwind_1401e9940(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xb0);
  return;
}



void Unwind_1401e9950(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x40);
  return;
}



void Unwind_1401e9960(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x70);
  return;
}



void Unwind_1401e9970(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x80);
  return;
}



void Unwind_1401e9980(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xb0);
  return;
}



void Unwind_1401e9990(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x110));
  return;
}



void Unwind_1401e99a0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(param_2 + 0x70);
  return;
}



void Unwind_1401e99b0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x80);
  return;
}



void Unwind_1401e99c0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xb0);
  return;
}



void Unwind_1401e99d0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x40);
  return;
}



void Unwind_1401e99e0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0xe0);
  return;
}



void Unwind_1401e99f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x30));
  return;
}



void Unwind_1401e9a00(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x40);
  return;
}



void Unwind_1401e9a10(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x170));
  return;
}



void Unwind_1401e9a20(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x170));
  return;
}



void Unwind_1401e9a30(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x170) + 0x10);
  return;
}



void Unwind_1401e9a40(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x170) + 0x40);
  return;
}



void Unwind_1401e9a50(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x40);
  return;
}



void Unwind_1401e9a60(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xe0);
  return;
}



void Unwind_1401e9a70(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x40);
  return;
}



void Unwind_1401e9a80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x170));
  return;
}



void Unwind_1401e9a90(undefined8 param_1,longlong param_2)

{
  FUN_1400f53f0(param_2 + 0x140);
  return;
}



void Unwind_1401e9aa0(undefined8 param_1,longlong param_2)

{
  FUN_1400f5000(param_2 + 0x1a0);
  return;
}



void Unwind_1401e9ab0(undefined8 param_1,longlong param_2)

{
  FUN_1400f37f0(param_2 + 0x200);
  return;
}



void Unwind_1401e9ac0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xf8);
  return;
}



void Unwind_1401e9ad0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401e9ae0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xf8);
  return;
}



void Unwind_1401e9af0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xc0);
  return;
}



void Unwind_1401e9b00(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x98);
  return;
}



void Unwind_1401e9b10(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x70);
  return;
}



void Unwind_1401e9b20(undefined8 param_1,longlong param_2)

{
  FUN_1400f37f0(param_2 + 0x270);
  return;
}



void Unwind_1401e9b30(undefined8 param_1,longlong param_2)

{
  FUN_1400f5000(param_2 + 0x270);
  return;
}



void Unwind_1401e9b40(undefined8 param_1,longlong param_2)

{
  FUN_1400f53f0(param_2 + 0x270);
  return;
}



void Unwind_1401e9b50(undefined8 param_1,longlong param_2)

{
  FUN_140118160(param_2 + 0x40);
  return;
}



void Unwind_1401e9b60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x228));
  return;
}



void Unwind_1401e9b70(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x228));
  return;
}



void Unwind_1401e9b80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x228));
  return;
}



void Unwind_1401e9b90(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x228));
  return;
}



void Unwind_1401e9ba0(undefined8 param_1,longlong param_2)

{
  FUN_1400ef440(param_2 + 0x50);
  return;
}



void Unwind_1401e9bb0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(param_2 + 0x48);
  return;
}



void Unwind_1401e9bc0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401e9bd0(undefined8 param_1,longlong param_2)

{
  FUN_1400afc00(*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_1401e9be0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1401e9bf0(undefined8 param_1,longlong param_2)

{
  FUN_1400afc00(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e9c00(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e9c10(undefined8 param_1,longlong param_2)

{
  FUN_140119be0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401e9c20(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e9c30(undefined8 param_1,longlong param_2)

{
  FUN_140119be0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401e9c40(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x40) + 0x218);
  return;
}



void Unwind_1401e9c60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401e9c70(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x28);
  return;
}



void Unwind_1401e9c80(undefined8 param_1,longlong param_2)

{
  FUN_1400bec20(param_2 + 0x60);
  return;
}



void Unwind_1401e9c90(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401e9ca0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401e9cb0(undefined8 param_1,longlong param_2)

{
  FUN_1400bec20(param_2 + 0x98);
  return;
}



void Unwind_1401e9cc0(undefined8 param_1,longlong param_2)

{
  FUN_1400d3480(param_2 + 0x40);
  return;
}



void Unwind_1401e9cd0(undefined8 param_1,longlong param_2)

{
  FUN_1400bec20(param_2 + 0x38);
  return;
}



void Unwind_1401e9ce0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x120);
  return;
}



void Unwind_1401e9cf0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xe8);
  return;
}



void Unwind_1401e9d00(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e9d10(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_1401e9d20(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_1401e9d30(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x90);
  return;
}



void Unwind_1401e9d50(undefined8 param_1,longlong param_2)

{
  FUN_1400bec20(param_2 + 0x90);
  return;
}



void Unwind_1401e9d60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x98));
  return;
}



void Unwind_1401e9d70(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x38);
  return;
}



void Unwind_1401e9d80(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401e9d90(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_1401e9da0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_1401e9db0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x90);
  return;
}



void Unwind_1401e9dd0(undefined8 param_1,longlong param_2)

{
  FUN_140132960(*(longlong *)(param_2 + 0x40) + 200);
  return;
}



void Unwind_1401e9df0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401e9e00(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x78);
  return;
}



void Unwind_1401e9e10(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x20);
  return;
}



void Unwind_1401e9e20(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x48);
  return;
}



void Unwind_1401e9e30(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0xb0));
  return;
}



void Unwind_1401e9e40(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x58);
  return;
}



void Unwind_1401e9e50(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e9e60(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x130);
  return;
}



void Unwind_1401e9e70(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x90);
  return;
}



void Unwind_1401e9e80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x200));
  return;
}



void Unwind_1401e9e90(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x40);
  return;
}



void Unwind_1401e9ea0(undefined8 param_1,longlong param_2)

{
  FUN_1400cf850(param_2 + 0x20);
  return;
}



void Unwind_1401e9eb0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_1401e9ec0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x50) + 0x38);
  return;
}



void Unwind_1401e9ed0(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x28);
  return;
}



void Unwind_1401e9ee0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x70);
  return;
}



void Unwind_1401e9ef0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x38);
  return;
}



void Unwind_1401e9f00(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x20);
  return;
}



void Unwind_1401e9f10(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x20);
  return;
}



void Unwind_1401e9f20(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x60);
  return;
}



void Unwind_1401e9f30(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401e9f40(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x58);
  return;
}



void Unwind_1401e9f50(undefined8 param_1,longlong param_2)

{
  FUN_1400d3c20(param_2 + 0xb0);
  return;
}



void Unwind_1401e9f60(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401e9f70(undefined8 param_1,longlong param_2)

{
  FUN_1400d3c20(param_2 + 0x60);
  return;
}



void Unwind_1401e9f80(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x58);
  return;
}



void Unwind_1401e9f90(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x48);
  return;
}



void Unwind_1401e9fa0(undefined8 param_1,longlong param_2)

{
  FUN_1400bec20(param_2 + 0x38);
  return;
}



void Unwind_1401e9fb0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x80);
  return;
}



void Unwind_1401e9fc0(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x68);
  return;
}



void Unwind_1401e9fd0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xb0);
  return;
}



void Unwind_1401e9fe0(undefined8 param_1,longlong param_2)

{
  FUN_1400d3c20(param_2 + 0x60);
  return;
}



void Unwind_1401e9ff0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x68);
  return;
}



void Unwind_1401ea000(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xc0);
  return;
}



void Unwind_1401ea010(undefined8 param_1,longlong param_2)

{
  FUN_1400d3c20(param_2 + 0x58);
  return;
}



void Unwind_1401ea020(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x58);
  return;
}



void Unwind_1401ea030(undefined8 param_1,longlong param_2)

{
  FUN_1400d3c20(param_2 + 0x48);
  return;
}



void Unwind_1401ea040(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x20);
  return;
}



void Unwind_1401ea050(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x28);
  return;
}



void Unwind_1401ea060(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401ea070(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x60);
  return;
}



void Unwind_1401ea080(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0xa0);
  return;
}



void Unwind_1401ea090(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0xa0);
  return;
}



void Unwind_1401ea0a0(undefined8 param_1,longlong param_2)

{
  FUN_140132f70(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401ea0b0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xf0);
  return;
}



void Unwind_1401ea0c0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x98);
  return;
}



void Unwind_1401ea0d0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xc0);
  return;
}



void Unwind_1401ea0e0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x70);
  return;
}



void Unwind_1401ea0f0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x48);
  return;
}



void Unwind_1401ea100(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x50);
  return;
}



void Unwind_1401ea110(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x28);
  return;
}



void Unwind_1401ea120(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x40);
  return;
}



void Unwind_1401ea130(undefined8 param_1,longlong param_2)

{
  FUN_1400b0680(param_2 + 0xc0);
  return;
}



void Unwind_1401ea140(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x98);
  return;
}



void Unwind_1401ea150(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x70);
  return;
}



void Unwind_1401ea160(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x58);
  return;
}



void Unwind_1401ea170(undefined8 param_1,longlong param_2)

{
  FUN_1400b0680(param_2 + 0x80);
  return;
}



void Unwind_1401ea180(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xa8);
  return;
}



void Unwind_1401ea190(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x28);
  return;
}



void Unwind_1401ea1a0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x80);
  return;
}



void Unwind_1401ea1b0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x50);
  return;
}



void Unwind_1401ea1c0(undefined8 param_1,longlong param_2)

{
  FUN_1401379a0(param_2 + 0x130);
  return;
}



void Unwind_1401ea1d0(undefined8 param_1,longlong param_2)

{
  FUN_14012ff50(param_2 + 0x50);
  return;
}



void Unwind_1401ea1e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



undefined * Catch_All_1401ea1f0(void)

{
  return &DAT_14010484f;
}



void Unwind_1401ea210(undefined8 param_1,longlong param_2)

{
  FUN_1401043d0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401ea220(undefined8 param_1,longlong param_2)

{
  FUN_1401049e0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401ea230(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401ea240(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x50);
  return;
}



void Unwind_1401ea250(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x20);
  return;
}



void Unwind_1401ea260(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x80);
  return;
}



void Unwind_1401ea270(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401ea280(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x50);
  return;
}



void Unwind_1401ea290(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0xb0);
  return;
}



void Unwind_1401ea2a0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x80);
  return;
}



void Unwind_1401ea2b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401ea2c0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x50);
  return;
}



void Unwind_1401ea2d0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x120);
  return;
}



void Unwind_1401ea2e0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401ea2f0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401ea300(undefined8 param_1,longlong param_2)

{
  FUN_1400f5000(param_2 + 0x60);
  return;
}



void Unwind_1401ea310(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401ea320(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401ea330(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_1401ea340(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401ea350(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x68);
  return;
}



void Unwind_1401ea360(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x98);
  return;
}



void Unwind_1401ea370(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xc0);
  return;
}



void Unwind_1401ea380(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401ea390(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x60);
  return;
}



void Unwind_1401ea3a0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x98);
  return;
}



void Unwind_1401ea3b0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xc0);
  return;
}



void Unwind_1401ea3c0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x38);
  return;
}



void Unwind_1401ea3d0(undefined8 param_1,longlong param_2)

{
  FUN_140118160(param_2 + 0x70);
  return;
}



void Unwind_1401ea3e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401ea3f0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1401ea400(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x60) + 0x10);
  return;
}



void Unwind_1401ea410(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x28);
  return;
}



void Unwind_1401ea420(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401ea430(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_1401ea440(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x40) + 0xe0);
  return;
}



void Unwind_1401ea460(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x40) + 0x180);
  return;
}



void Unwind_1401ea480(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x40) + 0x220);
  return;
}



void Unwind_1401ea4a0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x40) + 0x2c0);
  return;
}



void Unwind_1401ea4c0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x40) + 0x2e8);
  return;
}



void Unwind_1401ea4e0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 800);
  return;
}



void Unwind_1401ea500(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x350);
  return;
}



void Unwind_1401ea520(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x60);
  return;
}



void Unwind_1401ea530(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x90);
  return;
}



void Unwind_1401ea540(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(param_2 + 0x68);
  return;
}



void Unwind_1401ea550(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(param_2 + 0x30);
  return;
}



void Unwind_1401ea560(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x100));
  return;
}



void Unwind_1401ea570(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(param_2 + 0x30);
  return;
}



void Unwind_1401ea580(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x100));
  return;
}



void Unwind_1401ea590(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x100));
  return;
}



void Unwind_1401ea5a0(undefined8 param_1,longlong param_2)

{
  FUN_1400d3480(param_2 + 0x30);
  return;
}



void Unwind_1401ea5b0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x40);
  return;
}



void Unwind_1401ea5c0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401ea5d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x88));
  return;
}



void Unwind_1401ea5e0(undefined8 param_1,longlong param_2)

{
  FUN_1400bec20(param_2 + 0x68);
  return;
}



void Unwind_1401ea5f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401ea600(undefined8 param_1,longlong param_2)

{
  FUN_1400bec20(param_2 + 0x60);
  return;
}



void Unwind_1401ea610(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x30));
  return;
}



void Unwind_1401ea620(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x38);
  return;
}



void Unwind_1401ea630(undefined8 param_1,longlong param_2)

{
  FUN_1400bec20(param_2 + 0x20);
  return;
}



void Unwind_1401ea640(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x48);
  return;
}



void Unwind_1401ea650(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x38);
  return;
}



void Unwind_1401ea660(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1401ea670(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401ea680(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x38);
  return;
}



void Unwind_1401ea690(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x48);
  return;
}



void Unwind_1401ea6a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401ea6b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401ea6c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401ea6d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401ea6e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401ea6f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401ea700(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401ea710(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401ea720(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401ea730(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401ea740(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401ea750(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401ea760(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401ea770(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x20));
  return;
}



void Unwind_1401ea780(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x20));
  return;
}



void Unwind_1401ea790(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401ea7a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401ea7b0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x48);
  return;
}



void Unwind_1401ea7c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401ea7d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401ea7e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401ea7f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401ea800(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x50);
  return;
}



void Unwind_1401ea810(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x50);
  return;
}



void Unwind_1401ea820(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x50);
  return;
}



void Unwind_1401ea830(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401ea840(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x80);
  return;
}



void Unwind_1401ea850(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0x150);
  return;
}



void Unwind_1401ea860(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x50);
  return;
}



void Unwind_1401ea870(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0xb0);
  return;
}



void Unwind_1401ea880(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(param_2 + 0x50);
  return;
}



void Unwind_1401ea890(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x40);
  return;
}



void Unwind_1401ea8a0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xb0);
  return;
}



void Unwind_1401ea8b0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x90);
  return;
}



void Unwind_1401ea8c0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x128);
  return;
}



void Unwind_1401ea8d0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xd0);
  return;
}



void Unwind_1401ea8e0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x68);
  return;
}



void Unwind_1401ea8f0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xf8);
  return;
}



void Unwind_1401ea900(undefined8 param_1,longlong param_2)

{
  FUN_1400b0680(param_2 + 0xb0);
  return;
}



void Unwind_1401ea910(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x50);
  return;
}



void Unwind_1401ea920(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x80);
  return;
}



void Unwind_1401ea930(undefined8 param_1,longlong param_2)

{
  FUN_1400afc00(*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_1401ea940(undefined8 param_1,longlong param_2)

{
  FUN_1400d1240(*(longlong *)(param_2 + 0x20) + 0x158);
  return;
}



void Unwind_1401ea960(undefined8 param_1,longlong param_2)

{
  FUN_1400afc00(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401ea970(undefined8 param_1,longlong param_2)

{
  FUN_1400d1240(*(longlong *)(param_2 + 0x40) + 0x158);
  return;
}



void Unwind_1401ea990(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x58);
  return;
}



void Unwind_1401ea9a0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401ea9b0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401ea9c0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x60);
  return;
}



void Unwind_1401ea9d0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x90);
  return;
}



void Unwind_1401ea9e0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xc0);
  return;
}



void Unwind_1401ea9f0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x120);
  return;
}



void Unwind_1401eaa00(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xf0);
  return;
}



void Unwind_1401eaa10(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x150);
  return;
}



void Unwind_1401eaa20(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x188);
  return;
}



void Unwind_1401eaa30(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x1b8);
  return;
}



void Unwind_1401eaa40(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
  return;
}



void Unwind_1401eaa50(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x38);
  return;
}



void Unwind_1401eaa60(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0xa0);
  return;
}



void Unwind_1401eaa70(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x140);
  return;
}



void Unwind_1401eaa80(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x68);
  return;
}



void Unwind_1401eaa90(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x30);
  return;
}



void Unwind_1401eaaa0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0xc0);
  return;
}



void Unwind_1401eaab0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x60);
  return;
}



void Unwind_1401eaac0(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0x160);
  return;
}



void Unwind_1401eaad0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x88);
  return;
}



void Unwind_1401eaae0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x90);
  return;
}



void Unwind_1401eaaf0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x60);
  return;
}



void Unwind_1401eab00(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401eab10(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0xf0);
  return;
}



void Unwind_1401eab20(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xc0);
  return;
}



void Unwind_1401eab30(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x60);
  return;
}



void Unwind_1401eab40(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x20);
  return;
}



void Unwind_1401eab50(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401eab60(undefined8 param_1,longlong param_2)

{
  FUN_1400d1240(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401eab70(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_1401eab80(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x100);
  return;
}



void Unwind_1401eab90(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x60);
  return;
}



void Unwind_1401eaba0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401eabb0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x1a0);
  return;
}



void Unwind_1401eabc0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x28);
  return;
}



void Unwind_1401eabd0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xf0);
  return;
}



void Unwind_1401eabe0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0xd0));
  return;
}



void Unwind_1401eabf0(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0xd0);
  return;
}



void Unwind_1401eac00(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x30);
  return;
}



void Unwind_1401eac10(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(param_2 + 0x30);
  return;
}



void Unwind_1401eac20(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401eac30(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xa8);
  return;
}



void Unwind_1401eac40(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401eac50(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401eac60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401eac70(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401eac80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401eac90(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401eaca0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401eacb0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xa8);
  return;
}



void Unwind_1401eacc0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401eacd0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401eace0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401eacf0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xa8);
  return;
}



void Unwind_1401ead00(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401ead10(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401ead20(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xa8);
  return;
}



void Unwind_1401ead30(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401ead40(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401ead50(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401ead60(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401ead70(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401ead80(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401ead90(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401eada0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401eadb0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401eadc0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401eadd0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xa8);
  return;
}



void Unwind_1401eade0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401eadf0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401eae00(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xa8);
  return;
}



void Unwind_1401eae10(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401eae20(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x48);
  return;
}



void Unwind_1401eae30(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x28);
  return;
}



void Unwind_1401eae40(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x58);
  return;
}



void Unwind_1401eae50(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x38);
  return;
}



void Unwind_1401eae60(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x50);
  return;
}



void Unwind_1401eae70(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x30);
  return;
}



void Unwind_1401eae80(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xa0);
  return;
}



void Unwind_1401eae90(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xe0);
  return;
}



void Unwind_1401eaea0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x80);
  return;
}



void Unwind_1401eaeb0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xc0);
  return;
}



void Unwind_1401eaec0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x20);
  return;
}



void Unwind_1401eaed0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x60);
  return;
}



void Unwind_1401eaee0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x40);
  return;
}



void Unwind_1401eaef0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xa0);
  return;
}



void Unwind_1401eaf00(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x80);
  return;
}



void Unwind_1401eaf10(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x20);
  return;
}



void Unwind_1401eaf20(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xc0);
  return;
}



void Unwind_1401eaf30(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x60);
  return;
}



void Unwind_1401eaf40(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x40);
  return;
}



void Unwind_1401eaf50(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x28);
  return;
}



void Unwind_1401eaf60(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x150);
  return;
}



void Unwind_1401eaf70(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x160);
  return;
}



void Unwind_1401eaf80(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xa0);
  return;
}



void Unwind_1401eaf90(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x80);
  return;
}



void Unwind_1401eafa0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xc0);
  return;
}



void Unwind_1401eafb0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x140);
  return;
}



void Unwind_1401eafc0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x20);
  return;
}



void Unwind_1401eafd0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x40);
  return;
}



void Unwind_1401eafe0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x100);
  return;
}



void Unwind_1401eaff0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x180);
  return;
}



void Unwind_1401eb000(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x60);
  return;
}



void Unwind_1401eb010(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x120);
  return;
}



void Unwind_1401eb020(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x1a0);
  return;
}



void Unwind_1401eb030(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xe0);
  return;
}



void Unwind_1401eb040(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x100);
  return;
}



void Unwind_1401eb050(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x60);
  return;
}



void Unwind_1401eb060(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xc0);
  return;
}



void Unwind_1401eb070(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x80);
  return;
}



void Unwind_1401eb080(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xe0);
  return;
}



void Unwind_1401eb090(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x20);
  return;
}



void Unwind_1401eb0a0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xa0);
  return;
}



void Unwind_1401eb0b0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x120);
  return;
}



void Unwind_1401eb0c0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x40);
  return;
}



void Unwind_1401eb0d0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xb8);
  return;
}



void Unwind_1401eb0e0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x20);
  return;
}



void Unwind_1401eb0f0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x80);
  return;
}



void Unwind_1401eb100(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x50);
  return;
}



void Unwind_1401eb110(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xe0);
  return;
}



void Unwind_1401eb120(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x28);
  return;
}



void Unwind_1401eb130(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xb0);
  return;
}



void Unwind_1401eb140(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xd0);
  return;
}



void Unwind_1401eb150(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x68);
  return;
}



void Unwind_1401eb160(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x48);
  return;
}



void Unwind_1401eb170(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x88);
  return;
}



void Unwind_1401eb180(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x28);
  return;
}



void Unwind_1401eb190(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_((void *)(param_2 + 0xd0),0x20,0x100,FUN_14011d980);
  return;
}



void Unwind_1401eb1c0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x30);
  return;
}



void Unwind_1401eb1d0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x58);
  return;
}



void Unwind_1401eb1e0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x98);
  return;
}



void Unwind_1401eb1f0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_((void *)(param_2 + 0xb0),0x20,0x100,FUN_14011d980);
  return;
}



void Unwind_1401eb220(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x30);
  return;
}



void Unwind_1401eb230(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x70);
  return;
}



void Unwind_1401eb240(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x108);
  return;
}



void Unwind_1401eb250(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xe8);
  return;
}



void Unwind_1401eb260(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x68);
  return;
}



void Unwind_1401eb270(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 200);
  return;
}



void Unwind_1401eb280(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x48);
  return;
}



void Unwind_1401eb290(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x88);
  return;
}



void Unwind_1401eb2a0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x28);
  return;
}



void Unwind_1401eb2b0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xa8);
  return;
}



void Unwind_1401eb2c0(undefined8 param_1,longlong param_2)

{
  FUN_1401043d0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401eb2d0(undefined8 param_1,longlong param_2)

{
  FUN_1400b7090(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_1401eb2e0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401eb2f0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_1401eb300(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_1401eb310(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_1401eb320(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_1401eb340(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(*(longlong *)(param_2 + 0x40) + 0xa8);
  return;
}



void Unwind_1401eb360(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(*(longlong *)(param_2 + 0x40) + 200);
  return;
}



void Unwind_1401eb380(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x20);
  return;
}



void Unwind_1401eb390(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x60);
  return;
}



void Unwind_1401eb3a0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x40);
  return;
}



void Unwind_1401eb3b0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x80);
  return;
}



void Unwind_1401eb3c0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x48);
  return;
}



void Unwind_1401eb3d0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x70);
  return;
}



void Unwind_1401eb3e0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x68);
  return;
}



void Unwind_1401eb3f0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x90);
  return;
}



void Unwind_1401eb400(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x40);
  return;
}



void Unwind_1401eb410(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xc0);
  return;
}



void Unwind_1401eb420(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x50);
  return;
}



void Unwind_1401eb430(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x88);
  return;
}



void Unwind_1401eb440(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xa8);
  return;
}



void Unwind_1401eb450(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 200);
  return;
}



void Unwind_1401eb460(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xe8);
  return;
}



void Unwind_1401eb470(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x108);
  return;
}



void Unwind_1401eb490(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x128);
  return;
}



void Unwind_1401eb4b0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x148);
  return;
}



void Unwind_1401eb4d0(undefined8 param_1,longlong param_2)

{
  FUN_1400e65d0(param_2 + 0x80);
  return;
}



void Unwind_1401eb4e0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x88);
  return;
}



void Unwind_1401eb4f0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xa8);
  return;
}



void Unwind_1401eb500(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 200);
  return;
}



void Unwind_1401eb510(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xe8);
  return;
}



void Unwind_1401eb520(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x108);
  return;
}



void Unwind_1401eb540(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x128);
  return;
}



void Unwind_1401eb560(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x148);
  return;
}



void Unwind_1401eb580(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x88);
  return;
}



void Unwind_1401eb590(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xa8);
  return;
}



void Unwind_1401eb5a0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 200);
  return;
}



void Unwind_1401eb5b0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0xe8);
  return;
}



void Unwind_1401eb5c0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x108);
  return;
}



void Unwind_1401eb5e0(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x128);
  return;
}



void Unwind_1401eb600(undefined8 param_1,longlong param_2)

{
  FUN_14011d980(param_2 + 0x148);
  return;
}



void Unwind_1401eb620(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x38);
  return;
}



void Unwind_1401eb630(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401eb640(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_1401eb650(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401eb660(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x40);
  return;
}



void Unwind_1401eb670(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_1401eb680(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_1401eb690(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_1401eb6a0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401eb6b0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(param_2 + 0x38);
  return;
}



void Unwind_1401eb6c0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x60);
  return;
}



void Unwind_1401eb6d0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x40);
  return;
}



void Unwind_1401eb6e0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x40);
  return;
}



undefined * Catch_All_1401eb6f0(void)

{
  return &DAT_140134855;
}



void Unwind_1401eb710(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401eb720(undefined8 param_1,longlong param_2)

{
  FUN_14013f810(*(longlong *)(param_2 + 0x40) + 0x85d8);
  return;
}



void Unwind_1401eb740(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401eb750(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401eb760(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401eb770(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401eb780(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



undefined * Catch_All_1401eb790(void)

{
  return &DAT_1401399d1;
}



void Unwind_1401eb7b0(undefined8 param_1,longlong param_2)

{
  FUN_1400f0d30(param_2 + 0x58);
  return;
}



void Unwind_1401eb7c0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401eb7d0(undefined8 param_1,longlong param_2)

{
  FUN_14013df10(param_2 + 0xa0);
  return;
}



void Unwind_1401eb7e0(undefined8 param_1,longlong param_2)

{
  FUN_1401041f0(param_2 + 0x70);
  return;
}



void Unwind_1401eb7f0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401eb800(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401eb810(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401eb820(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401eb830(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_1401eb840(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x28);
  return;
}



void Unwind_1401eb850(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x78));
  return;
}



void Unwind_1401eb860(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(param_2 + 0x28);
  return;
}



void Unwind_1401eb870(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0xc0);
  return;
}



void Unwind_1401eb880(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401eb890(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0xc0);
  return;
}



void Unwind_1401eb8a0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401eb8b0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x58);
  return;
}



void Unwind_1401eb8c0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x88);
  return;
}



void Unwind_1401eb8d0(undefined8 param_1,longlong param_2)

{
  FUN_1400c2880(param_2 + 0xc0);
  return;
}



void Unwind_1401eb8e0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401eb8f0(undefined8 param_1,longlong param_2)

{
  FUN_1401409c0(param_2 + 0x28);
  return;
}



void Unwind_1401eb900(undefined8 param_1,longlong param_2)

{
  FUN_1401409c0(param_2 + 0x40);
  return;
}



void Unwind_1401eb910(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401eb920(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401eb930(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401eb940(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401eb950(undefined8 param_1,longlong param_2)

{
  FUN_1400d0ee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401eb960(undefined8 param_1,longlong param_2)

{
  FUN_1400bec20(param_2 + 0x38);
  return;
}



void Unwind_1401eb970(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xa0);
  return;
}



void Unwind_1401eb980(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0xd0);
  return;
}



void Unwind_1401eb990(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x70);
  return;
}



void Unwind_1401eb9a0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x198);
  return;
}



void Unwind_1401eb9b0(undefined8 param_1,longlong param_2)

{
  FUN_1400d0e10(param_2 + 0x48);
  return;
}



void Unwind_1401eb9c0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x130);
  return;
}



void Unwind_1401eb9d0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x100);
  return;
}



void Unwind_1401eb9e0(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x160);
  return;
}



void Unwind_1401eb9f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x218));
  return;
}



void Unwind_1401eba00(undefined8 param_1,longlong param_2)

{
  FUN_140106360(param_2 + 0x40);
  return;
}



void Unwind_1401eba10(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x30);
  return;
}



void Unwind_1401eba20(undefined8 param_1,longlong param_2)

{
  FUN_140106360(param_2 + 0x90);
  return;
}



void Unwind_1401eba30(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(param_2 + 0x58);
  return;
}



void Unwind_1401eba40(undefined8 param_1,longlong param_2)

{
  FUN_1400e2870(param_2 + 0x30);
  return;
}



void Unwind_1401eba50(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_1401eba60(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x20) + 0x38);
  return;
}



void Unwind_1401eba70(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x20) + 0x60);
  return;
}



void Unwind_1401eba80(undefined8 param_1,longlong param_2)

{
  FUN_1400bceb0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401eba90(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_1401ebaa0(undefined8 param_1,longlong param_2)

{
  FUN_1400e2870(param_2 + 0x30);
  return;
}



void Unwind_1401ebab0(undefined8 param_1,longlong param_2)

{
  FUN_1400bec20(param_2 + 0x20);
  return;
}



void Unwind_1401ebac0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xc0);
  return;
}



void Unwind_1401ebad0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x48);
  return;
}



void Unwind_1401ebae0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x70);
  return;
}



void Unwind_1401ebaf0(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x140);
  return;
}



void Unwind_1401ebb00(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x98);
  return;
}



void Unwind_1401ebb10(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x110);
  return;
}



void Unwind_1401ebb20(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xe8);
  return;
}



void Unwind_1401ebb30(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x130);
  return;
}



void Unwind_1401ebb40(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x40);
  return;
}



void Unwind_1401ebb50(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x108);
  return;
}



void Unwind_1401ebb60(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xe0);
  return;
}



void Unwind_1401ebb70(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0xb8);
  return;
}



void Unwind_1401ebb80(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x90);
  return;
}



void Unwind_1401ebb90(undefined8 param_1,longlong param_2)

{
  FUN_1400b92d0(param_2 + 0x68);
  return;
}



void Unwind_1401ebba0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
  return;
}



void Unwind_1401ebbb0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
  return;
}



void Unwind_1401ebbc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401ebbd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401ebbe0(undefined8 param_1,longlong param_2)

{
  FUN_14008cb00(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401ebbf0(undefined8 param_1,longlong param_2)

{
  FUN_14008cb00(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_1401ebc10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ebc20(void)

{
  DAT_140318e78 = DAT_140318e78 & 0xfffffffe;
  return;
}



void Unwind_1401ebc40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401ebc50(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_1401ebc60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x28),0x60);
  return;
}



void Unwind_1401ebc80(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x58) & 1) != 0) {
    *(uint *)(param_2 + 0x58) = *(uint *)(param_2 + 0x58) & 0xfffffffe;
    FUN_14008c980(*(undefined8 *)(param_2 + 0x50));
  }
  return;
}



void Unwind_1401ebcb0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x100) & 1) != 0) {
    *(uint *)(param_2 + 0x100) = *(uint *)(param_2 + 0x100) & 0xfffffffe;
    thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x108));
  }
  return;
}



void Unwind_1401ebce0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x110);
  return;
}



void Unwind_1401ebcf0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_1401ebd00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x118);
  return;
}



void Unwind_1401ebd10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_1401ebd20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x28);
  return;
}



void Unwind_1401ebd30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401ebd40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x48);
  return;
}



void Unwind_1401ebd50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401ebd60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401ebd70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1401ebd80(undefined8 param_1,longlong param_2)

{
  FUN_1400a2f10(param_2 + 0x38);
  return;
}



void Unwind_1401ebd90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x20);
  return;
}



void Unwind_1401ebda0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa8);
  return;
}



void Unwind_1401ebdb0(undefined8 param_1,longlong param_2)

{
  FUN_1400a2f10(param_2 + 0x40);
  return;
}



void Unwind_1401ebdc0(undefined8 param_1,longlong param_2)

{
  FUN_14018a210(param_2 + 0x30);
  return;
}



void Unwind_1401ebdd0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(*(longlong *)(param_2 + 0x80) + 0xc80);
  return;
}



void Unwind_1401ebdf0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x48),*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401ebe10(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x40) + 0x120);
  return;
}



void Unwind_1401ebe30(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401ebe40(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(*(longlong *)(param_2 + 0xd0) + 0xc80);
  return;
}



void Unwind_1401ebe60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ebe70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401ebe80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401ebe90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401ebea0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401ebeb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401ebec0(undefined8 param_1,longlong param_2)

{
  FUN_14008c730(param_2 + 0x60);
  return;
}



void Unwind_1401ebed0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401ebee0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ebef0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401ebf00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_1401ebf10(undefined8 param_1,longlong param_2)

{
  FUN_14008cb00(param_2 + 0x78);
  return;
}



void Unwind_1401ebf20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ebf30(undefined8 param_1,longlong param_2)

{
  FUN_140022590(param_2 + 0x28);
  return;
}



undefined8 Catch_All_1401ebf40(void)

{
  return 0x140148d63;
}



undefined8 Catch_All_1401ebf60(void)

{
  return 0x140148ec3;
}



undefined8 Catch_All_1401ebf80(void)

{
  return 0x140148f73;
}



void Unwind_1401ebfa0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x58) & 1) != 0) {
    *(uint *)(param_2 + 0x58) = *(uint *)(param_2 + 0x58) & 0xfffffffe;
    thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x40));
  }
  return;
}



void Unwind_1401ebfd0(undefined8 param_1,longlong param_2)

{
  FUN_140148f60(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401ebfe0(undefined8 param_1,longlong param_2)

{
  FUN_140143380(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_1401ebff0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_1401ec000(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x260);
  return;
}



void Unwind_1401ec010(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ec020(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_1401ec030(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ec040(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ec050(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401ec060(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ec070(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_1401ec080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x268);
  return;
}



void Unwind_1401ec090(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ec0a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_1401ec0b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ec0c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ec0d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401ec0e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ec0f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_1401ec100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 600);
  return;
}



void Unwind_1401ec110(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ec120(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_1401ec130(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ec140(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ec150(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x3c8));
  return;
}



void Unwind_1401ec160(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ec170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_1401ec180(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x270);
  return;
}



void Unwind_1401ec190(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ec1a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_1401ec1b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ec1c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ec1d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401ec1e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ec1f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_1401ec200(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_1401ec210(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1401ec220(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_1401ec230(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1401ec240(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_1401ec250(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1401ec260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_1401ec270(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1401ec280(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2d8);
  return;
}



void Unwind_1401ec290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401ec2a0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x60);
  return;
}



void Unwind_1401ec2b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_1401ec2c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2e8);
  return;
}



void Unwind_1401ec2d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x3c8));
  return;
}



void Unwind_1401ec2e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_1401ec2f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2e0);
  return;
}



void Unwind_1401ec300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x3c8));
  return;
}



void Unwind_1401ec310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_1401ec320(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_1401ec330(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x298);
  return;
}



void Unwind_1401ec340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401ec350(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_1401ec360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_1401ec370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2a8);
  return;
}



void Unwind_1401ec380(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401ec390(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_1401ec3a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_1401ec3b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2b8);
  return;
}



void Unwind_1401ec3c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401ec3d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_1401ec3e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c8);
  return;
}



void Unwind_1401ec3f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401ec400(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_1401ec410(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2d0);
  return;
}



void Unwind_1401ec420(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401ec430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_1401ec440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_1401ec450(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x290);
  return;
}



void Unwind_1401ec460(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401ec470(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_1401ec480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c0);
  return;
}



void Unwind_1401ec490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401ec4a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_1401ec4b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2a0);
  return;
}



void Unwind_1401ec4c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401ec4d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_1401ec4e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x278);
  return;
}



void Unwind_1401ec4f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x3c8));
  return;
}



void Unwind_1401ec500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_1401ec510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2b0);
  return;
}



void Unwind_1401ec520(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401ec530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_1401ec540(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x280);
  return;
}



void Unwind_1401ec550(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401ec560(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_1401ec570(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x288);
  return;
}



void Unwind_1401ec580(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401ec590(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ec5a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401ec5b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401ec5c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401ec5d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x160);
  return;
}



void Unwind_1401ec5e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_1401ec5f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_1401ec600(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_1401ec610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x178);
  return;
}



void Unwind_1401ec620(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x48);
  return;
}



void Unwind_1401ec630(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1401ec640(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1401ec650(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_1401ec660(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_1401ec670(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401ec680(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401ec690(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x20);
  return;
}



void Unwind_1401ec6a0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x20);
  return;
}



void Unwind_1401ec6b0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd80);
  return;
}



void Unwind_1401ec6d0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x100);
  return;
}



void Unwind_1401ec6e0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd80);
  return;
}



void Unwind_1401ec700(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x58) + 8);
  return;
}



void Unwind_1401ec710(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x20);
  return;
}



void Unwind_1401ec720(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x20);
  return;
}



void Unwind_1401ec730(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd80);
  return;
}



void Unwind_1401ec750(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x100);
  return;
}



void Unwind_1401ec760(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd80);
  return;
}



void Unwind_1401ec780(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x58) + 8);
  return;
}



void Unwind_1401ec790(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ec7a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401ec7b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401ec7c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401ec7d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x28);
  return;
}



void Unwind_1401ec7e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x20);
  return;
}



void Unwind_1401ec7f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401ec800(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x20);
  return;
}



void Unwind_1401ec810(undefined8 param_1,longlong param_2)

{
  FUN_1400a1e20(param_2 + 0x70);
  return;
}



void Unwind_1401ec820(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401ec830(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401ec840(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401ec850(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x40);
  return;
}



void Unwind_1401ec860(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401ec870(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd50);
  return;
}



void Unwind_1401ec890(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xd0);
  return;
}



void Unwind_1401ec8a0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd50);
  return;
}



void Unwind_1401ec8c0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * Catch_1401ec8d0(undefined8 param_1,longlong param_2)

{
  LPCWSTR lpOutputString;
  
  lpOutputString = (LPCWSTR)(**(code **)(**(longlong **)(param_2 + 0x70) + 8))();
  OutputDebugStringW(lpOutputString);
  _DAT_00000000 = 1;
  return &DAT_140151a13;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * Catch_1401ec910(undefined8 param_1,longlong param_2)

{
  LPCWSTR lpOutputString;
  
  lpOutputString = (LPCWSTR)(**(code **)(**(longlong **)(param_2 + 0x68) + 8))();
  OutputDebugStringW(lpOutputString);
  _DAT_00000000 = 1;
  return &DAT_140151957;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * Catch_1401ec950(undefined8 param_1,longlong param_2)

{
  LPCWSTR lpOutputString;
  
  lpOutputString = (LPCWSTR)(**(code **)(**(longlong **)(param_2 + 0x40) + 8))();
  OutputDebugStringW(lpOutputString);
  _DAT_00000000 = 1;
  return &DAT_140151ee2;
}



void Unwind_1401ec990(undefined8 param_1,longlong param_2)

{
  FUN_140022590(param_2 + 0x50);
  return;
}



void Unwind_1401ec9a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1401ec9b0(undefined8 param_1,longlong param_2)

{
  FUN_140145fd0(param_2 + 0x38);
  return;
}



void Unwind_1401ec9c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401ec9d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401ec9e0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x20);
  return;
}



void Unwind_1401ec9f0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x20);
  return;
}



void Unwind_1401eca00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401eca10(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd40);
  return;
}



void Unwind_1401eca30(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xc0);
  return;
}



void Unwind_1401eca40(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd40);
  return;
}



void Unwind_1401eca60(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xa0) + 8);
  return;
}



void Unwind_1401eca70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401eca80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401eca90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401ecaa0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401ecab0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401ecac0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401ecad0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401ecae0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401ecaf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401ecb00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401ecb10(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x80),
                *(longlong *)(param_2 + 0x78) + (longlong)*(int *)(param_2 + 0x70) * 8);
  return;
}



void Unwind_1401ecb40(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x98),
                *(longlong *)(param_2 + 0x90) + (longlong)*(int *)(param_2 + 0x88) * 8);
  return;
}



void Unwind_1401ecb70(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0xb0),
                *(longlong *)(param_2 + 0xa8) + (longlong)*(int *)(param_2 + 0xa0) * 8);
  return;
}



void Unwind_1401ecba0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401ecba7. Too many branches
                    // WARNING: Treating indirect jump as call
  std::_Container_base12::~_Container_base12(*(_Container_base12 **)(param_2 + 0x40));
  return;
}



void Unwind_1401ecbb0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x88) & 1) != 0) {
    *(uint *)(param_2 + 0x88) = *(uint *)(param_2 + 0x88) & 0xfffffffe;
    FUN_140152f30(*(undefined8 *)(param_2 + 0x80));
  }
  return;
}



void Unwind_1401ecbe0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x60);
  return;
}



void Unwind_1401ecbf0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xd0) + 8);
  return;
}



void Unwind_1401ecc00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401ecc10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401ecc20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401ecc30(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x20);
  return;
}



void Unwind_1401ecc40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_1401ecc50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401ecc60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ecc70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ecc80(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x20);
  return;
}



void Unwind_1401ecc90(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x20);
  return;
}



void Unwind_1401ecca0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401eccb0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd40);
  return;
}



void Unwind_1401eccd0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xc0);
  return;
}



void Unwind_1401ecce0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd40);
  return;
}



void Unwind_1401ecd00(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_1401ecd10(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401ecd20(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x68),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1401ecd40(undefined8 param_1,longlong param_2)

{
  FUN_140148e30(param_2 + 0x68);
  return;
}



void Unwind_1401ecd50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ecd60(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x28));
  return;
}



void Unwind_1401ecd80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1401ecd90(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(param_2 + 0x160);
  return;
}



void Unwind_1401ecda0(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(param_2 + 0x50);
  return;
}



void Unwind_1401ecdb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_1401ecdc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401ecdd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_1401ecde0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401ecdf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401ece00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1401ece10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_1401ece20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_1401ece30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_1401ece40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_1401ece50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401ece60(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(param_2 + 0xb0);
  return;
}



void Unwind_1401ece70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_1401ece80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401ece90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ecea0(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(param_2 + 0xa0);
  return;
}



void Unwind_1401eceb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb8);
  return;
}



void Unwind_1401ecec0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401eced0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x70) + 0x120);
  return;
}



void Unwind_1401ecef0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401ecf00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401ecf10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401ecf20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ecf30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ecf40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401ecf50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_1401ecf60(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x58);
  return;
}



void Unwind_1401ecf70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401ecf80(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(param_2 + 0x50);
  return;
}



void Unwind_1401ecf90(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(param_2 + 0x20);
  return;
}



void Unwind_1401ecfa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_1401ecfb0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x48);
  return;
}



void Unwind_1401ecfc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



undefined8 Catch_All_1401ecfd0(void)

{
  return 0x140157cc3;
}



void Unwind_1401ecff0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x50) + 0x120);
  return;
}



void Unwind_1401ed010(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0xd0),0x400);
  return;
}



void Unwind_1401ed030(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x30);
  return;
}



void Unwind_1401ed040(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_1401ed050(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x60);
  return;
}



void Unwind_1401ed060(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0xe8);
  return;
}



void Unwind_1401ed070(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401ed080(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401ed090(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_1401ed0a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401ed0b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ed0c0(undefined8 param_1,longlong param_2)

{
  FUN_140157630(param_2 + 0x60U & 0xffffffffffffffc0);
  return;
}



void Unwind_1401ed0f0(undefined8 param_1,longlong param_2)

{
  FUN_140155530(param_2 + 0x60U & 0xffffffffffffffc0);
  return;
}



undefined8 Catch_All_1401ed120(void)

{
  return 0x140158823;
}



void Unwind_1401ed140(undefined8 param_1,longlong param_2)

{
  FUN_14008cb00(*(undefined8 *)(param_2 + 0x1a0));
  return;
}



void Unwind_1401ed150(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401ed160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x38),0x180);
  return;
}



void Unwind_1401ed180(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x38);
  return;
}



void Unwind_1401ed190(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401ed1a0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x90);
  return;
}



void Unwind_1401ed1b0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x48);
  return;
}



void Unwind_1401ed1c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_1401ed1d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 200);
  return;
}



void Unwind_1401ed1e0(undefined8 param_1,longlong param_2)

{
  FUN_1401a1480(param_2 + 0x60);
  return;
}



void Unwind_1401ed1f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_1401ed200(undefined8 param_1,longlong param_2)

{
  FUN_140158810(*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_1401ed210(undefined8 param_1,longlong param_2)

{
  FUN_140158810(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401ed220(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x30);
  return;
}



void Unwind_1401ed230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x70),0x180);
  return;
}



void Unwind_1401ed250(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x50);
  return;
}



void Unwind_1401ed260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_1401ed270(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xb8);
  return;
}



void Unwind_1401ed280(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1401ed290(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x58);
  return;
}



void Unwind_1401ed2a0(undefined8 param_1,longlong param_2)

{
  FUN_1401a1480(param_2 + 0x70);
  return;
}



void Unwind_1401ed2b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_1401ed2c0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x78);
  return;
}



void Unwind_1401ed2d0(undefined8 param_1,longlong param_2)

{
  FUN_1401a1480(param_2 + 0xb0);
  return;
}



void Unwind_1401ed2e0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xe10);
  return;
}



void Unwind_1401ed300(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 400);
  return;
}



void Unwind_1401ed310(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xe10);
  return;
}



void Unwind_1401ed330(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_1401ed340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x28);
  return;
}



void Unwind_1401ed350(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401ed360(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(param_2 + 0x80);
  return;
}



void Unwind_1401ed370(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x80) + 0x120);
  return;
}



void Unwind_1401ed390(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(param_2 + 0x50);
  return;
}



void Unwind_1401ed3a0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x60) & 1) != 0) {
    *(uint *)(param_2 + 0x60) = *(uint *)(param_2 + 0x60) & 0xfffffffe;
    FUN_140148d70(*(undefined8 *)(param_2 + 0x58));
  }
  return;
}



void Unwind_1401ed3d0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401ed3e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148d50(*(longlong *)(param_2 + 0x48) + 0x38);
  return;
}



void Unwind_1401ed3f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ed400(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_1401ed410(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401ed420(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401ed430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x38);
  return;
}



void Unwind_1401ed440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x78);
  return;
}



void Unwind_1401ed450(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401ed460(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401ed470(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401ed480(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_1401ed490(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1a8);
  return;
}



void Unwind_1401ed4a0(undefined8 param_1,longlong param_2)

{
  FUN_14008cb00(param_2 + 0xb0);
  return;
}



void Unwind_1401ed4b0(undefined8 param_1,longlong param_2)

{
  FUN_140021640(param_2 + 0x58);
  return;
}



void Unwind_1401ed4c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401ed4d0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x138);
  return;
}



void Unwind_1401ed4e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 400);
  return;
}



void Unwind_1401ed4f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_1401ed500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401ed510(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x170);
  return;
}



void Unwind_1401ed520(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x180);
  return;
}



void Unwind_1401ed530(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x160);
  return;
}



void Unwind_1401ed540(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xd8);
  return;
}



void Unwind_1401ed550(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x88);
  return;
}



void Unwind_1401ed560(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401ed570(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401ed580(undefined8 param_1,longlong param_2)

{
  FUN_1400a1e20(param_2 + 800);
  return;
}



void Unwind_1401ed590(undefined8 param_1,longlong param_2)

{
  FUN_1400a1e20(param_2 + 0x3b0);
  return;
}



void Unwind_1401ed5a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_1401ed5b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_1401ed5c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x128));
  return;
}



void Unwind_1401ed5d0(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401ed5e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ed5f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401ed600(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_1401ed610(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(*(longlong *)(param_2 + 0x20) + 0x18);
  return;
}



void Unwind_1401ed620(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401ed630(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401ed640(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_1401ed650(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_1401ed660(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_1401ed670(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x40) + 0x78);
  return;
}



void Unwind_1401ed680(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_1401ed690(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(*(longlong *)(param_2 + 0x80) + 8);
  return;
}



void Unwind_1401ed6a0(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(*(longlong *)(param_2 + 0x80) + 0x30);
  return;
}



void Unwind_1401ed6b0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401ed6c0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401ed6d0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x50) & 1) != 0) {
    *(uint *)(param_2 + 0x50) = *(uint *)(param_2 + 0x50) & 0xfffffffe;
    FUN_1401594a0(*(undefined8 *)(param_2 + 0x48));
  }
  return;
}



void Unwind_1401ed700(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ed710(undefined8 param_1,longlong param_2)

{
  FUN_1401594a0(param_2 + 0x50);
  return;
}



void Unwind_1401ed720(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401ed730(undefined8 param_1,longlong param_2)

{
  FUN_140143760(param_2 + 0x48);
  return;
}



void Unwind_1401ed740(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(param_2 + 0xa0);
  return;
}



void Unwind_1401ed750(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0xb8) + 0x120);
  return;
}



void Unwind_1401ed770(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(param_2 + 0xb0);
  return;
}



void Unwind_1401ed780(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0xb0) + 0x120);
  return;
}



void Unwind_1401ed7a0(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(param_2 + 0x20);
  return;
}



void Unwind_1401ed7b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_1401ed7c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401ed7d0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_1401ed7e0(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(*(longlong *)(param_2 + 0x50) + 0x18);
  return;
}



void Unwind_1401ed7f0(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(*(longlong *)(param_2 + 0x50) + 0x20);
  return;
}



void Unwind_1401ed800(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x50) + 0x28);
  return;
}



void Unwind_1401ed810(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(*(longlong *)(param_2 + 0x50) + 0x50);
  return;
}



void Unwind_1401ed820(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x50) + 0x78);
  return;
}



void Unwind_1401ed830(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x38);
  return;
}



void Unwind_1401ed840(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x48);
  return;
}



void Unwind_1401ed850(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x30);
  return;
}



void Unwind_1401ed860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x160),0x60);
  return;
}



void Unwind_1401ed880(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x20),*(undefined8 *)(param_2 + 0x160));
  return;
}



void Unwind_1401ed8a0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x160);
  return;
}



void Unwind_1401ed8b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401ed8c0(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x160);
  return;
}



void Unwind_1401ed8d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401ed8e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401ed8f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x40);
  return;
}



void Unwind_1401ed900(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x40);
  return;
}



void Unwind_1401ed910(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401ed920(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xe50);
  return;
}



void Unwind_1401ed940(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x1d0);
  return;
}



void Unwind_1401ed950(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xe50);
  return;
}



void Unwind_1401ed970(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_1401ed980(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x98);
  return;
}



void Unwind_1401ed990(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0xa8);
  return;
}



void Unwind_1401ed9a0(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x90);
  return;
}



void Unwind_1401ed9b0(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x20);
  return;
}



void Unwind_1401ed9c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401ed9d0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x98);
  return;
}



void Unwind_1401ed9e0(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0xa8);
  return;
}



void Unwind_1401ed9f0(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(param_2 + 0xb0);
  return;
}



void Unwind_1401eda00(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xb8);
  return;
}



void Unwind_1401eda10(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0xe0);
  return;
}



void Unwind_1401eda20(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x108);
  return;
}



void Unwind_1401eda30(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_1401eda40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401eda50(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 200);
  return;
}



void Unwind_1401eda60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d0);
  return;
}



void Unwind_1401eda70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401eda80(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x118);
  return;
}



void Unwind_1401eda90(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xf0);
  return;
}



void Unwind_1401edaa0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x40);
  return;
}



void Unwind_1401edab0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x90);
  return;
}



void Unwind_1401edac0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x140);
  return;
}



undefined8 Catch_1401edad0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x1c0);
  if (*(longlong *)(lVar1 + 0x758) != 0) {
    FUN_1400a1fd0(param_2 + 0x40,*(undefined8 *)(param_2 + 0x160));
    *(undefined4 *)(param_2 + 0x58) = *(undefined4 *)(*(longlong *)(param_2 + 0x1c8) + 0x70);
    plVar2 = *(longlong **)(lVar1 + 0x758);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x40);
    FUN_1400a1f90(param_2 + 0x40);
  }
  return 0x14015ed0c;
}



void Unwind_1401edb40(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x40);
  return;
}



undefined8 Catch_1401edb50(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x1c0);
  if (*(longlong *)(lVar1 + 0x758) != 0) {
    FUN_1400a2570(param_2 + 0x40,*(undefined8 *)(param_2 + 0x150));
    *(undefined4 *)(param_2 + 0x58) = *(undefined4 *)(*(longlong *)(param_2 + 0x1c8) + 0x70);
    plVar2 = *(longlong **)(lVar1 + 0x758);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x40);
    FUN_1400a1f90(param_2 + 0x40);
  }
  return 0x14015ed0c;
}



void Unwind_1401edbc0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x40);
  return;
}



undefined8 Catch_1401edbd0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x1c0);
  if (*(longlong *)(lVar1 + 0x758) != 0) {
    FUN_1400a25f0(param_2 + 0x40,*(undefined8 *)(param_2 + 0x178));
    *(undefined4 *)(param_2 + 0x58) = *(undefined4 *)(*(longlong *)(param_2 + 0x1c8) + 0x70);
    plVar2 = *(longlong **)(lVar1 + 0x758);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x40);
    FUN_1400a1f90(param_2 + 0x40);
  }
  return 0x14015ed0c;
}



void Unwind_1401edc40(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x40);
  return;
}



undefined8 Catch_All_1401edc50(void)

{
  return 0x14015f223;
}



void Unwind_1401edc70(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_1401edc80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401edc90(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1401edca0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x70),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1401edcc0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(*(longlong *)(param_2 + 0x78) + 8);
  return;
}



void Unwind_1401edcd0(undefined8 param_1,longlong param_2)

{
  FUN_14015c560(param_2 + 0x28);
  return;
}



void Unwind_1401edce0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x30);
  return;
}



void Unwind_1401edcf0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x150) + 8);
  return;
}



void Unwind_1401edd00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_1401edd10(undefined8 param_1,longlong param_2)

{
  FUN_14016a7f0(param_2 + 0x2d0);
  return;
}



void Unwind_1401edd20(undefined8 param_1,longlong param_2)

{
  FUN_14016a7f0(param_2 + 0x480);
  return;
}



void Unwind_1401edd30(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x30);
  return;
}



void Unwind_1401edd40(undefined8 param_1,longlong param_2)

{
  FUN_14015c560(param_2 + 0x120);
  return;
}



void Unwind_1401edd50(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x128);
  return;
}



void Unwind_1401edd60(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_1401edd70(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_1401edd80(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x30);
  return;
}



void Unwind_1401edd90(undefined8 param_1,longlong param_2)

{
  FUN_14015c560(param_2 + 0x120);
  return;
}



void Unwind_1401edda0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x128);
  return;
}



void Unwind_1401eddb0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x78) + 8);
  return;
}



void Unwind_1401eddc0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x78) + 8);
  return;
}



void Unwind_1401eddd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_1401edde0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x30);
  return;
}



void Unwind_1401eddf0(undefined8 param_1,longlong param_2)

{
  FUN_14016a7f0(param_2 + 0x120);
  return;
}



void Unwind_1401ede00(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x1120);
  return;
}



void Unwind_1401ede10(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x2a30);
  return;
}



void Unwind_1401ede30(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x1db0);
  return;
}



void Unwind_1401ede40(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x2a30);
  return;
}



void Unwind_1401ede60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1401ede70(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x1da0);
  return;
}



void Unwind_1401ede90(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x78) + 8);
  return;
}



void Unwind_1401edea0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401edeb0(undefined8 param_1,longlong param_2)

{
  FUN_140187700(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_1401edec0(undefined8 param_1,longlong param_2)

{
  FUN_1400a3ff0(*(longlong *)(param_2 + 0x80) + 0x60);
  return;
}



void Unwind_1401eded0(undefined8 param_1,longlong param_2)

{
  FUN_140141c90(*(longlong *)(param_2 + 0x80) + 0x68);
  return;
}



void Unwind_1401edee0(undefined8 param_1,longlong param_2)

{
  FUN_140141cd0(*(longlong *)(param_2 + 0x80) + 0x70);
  return;
}



void Unwind_1401edef0(undefined8 param_1,longlong param_2)

{
  FUN_1401a7910(*(longlong *)(param_2 + 0x80) + 0x78);
  return;
}



void Unwind_1401edf00(undefined8 param_1,longlong param_2)

{
  FUN_140141c40(*(longlong *)(param_2 + 0x80) + 0xa8);
  return;
}



void Unwind_1401edf20(undefined8 param_1,longlong param_2)

{
  FUN_140141c50(*(longlong *)(param_2 + 0x80) + 0xb0);
  return;
}



void Unwind_1401edf40(undefined8 param_1,longlong param_2)

{
  FUN_14015f6a0(*(longlong *)(param_2 + 0x80) + 0xb8);
  return;
}



void Unwind_1401edf60(undefined8 param_1,longlong param_2)

{
  FUN_140141d50(*(longlong *)(param_2 + 0x80) + 0x118);
  return;
}



void Unwind_1401edf80(undefined8 param_1,longlong param_2)

{
  FUN_140141d10(*(longlong *)(param_2 + 0x80) + 0x120);
  return;
}



void Unwind_1401edfa0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x80) + 0x128);
  return;
}



void Unwind_1401edfc0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x80) + 0x160);
  return;
}



void Unwind_1401edfe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(*(longlong *)(param_2 + 0x80) + 0x210);
  return;
}



void Unwind_1401ee000(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(*(longlong *)(param_2 + 0x80) + 0x218);
  return;
}



void Unwind_1401ee020(undefined8 param_1,longlong param_2)

{
  FUN_140148eb0(*(longlong *)(param_2 + 0x80) + 0x280);
  return;
}



void Unwind_1401ee040(undefined8 param_1,longlong param_2)

{
  FUN_140159630(*(longlong *)(param_2 + 0x80) + 0x2d8);
  return;
}



void Unwind_1401ee060(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148f60(*(longlong *)(param_2 + 0x80) + 0x388);
  return;
}



void Unwind_1401ee080(undefined8 param_1,longlong param_2)

{
  FUN_1401435c0(*(longlong *)(param_2 + 0x80) + 0x3e0);
  return;
}



void Unwind_1401ee0a0(undefined8 param_1,longlong param_2)

{
  FUN_14015f210(*(longlong *)(param_2 + 0x80) + 0x400);
  return;
}



void Unwind_1401ee0c0(undefined8 param_1,longlong param_2)

{
  FUN_14015f850(*(longlong *)(param_2 + 0x80) + 0x458);
  return;
}



void Unwind_1401ee0e0(undefined8 param_1,longlong param_2)

{
  FUN_140142660(*(longlong *)(param_2 + 0x80) + 0x478);
  return;
}



void Unwind_1401ee100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14018a150(*(longlong *)(param_2 + 0x80) + 0x480);
  return;
}



void Unwind_1401ee120(undefined8 param_1,longlong param_2)

{
  FUN_140186ed0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_1401ee130(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140186ed0(*(longlong *)(param_2 + 0x80) + 0x4a8);
  return;
}



void Unwind_1401ee150(undefined8 param_1,longlong param_2)

{
  FUN_140152f50(*(longlong *)(param_2 + 0x80) + 0x6c8);
  return;
}



void Unwind_1401ee170(undefined8 param_1,longlong param_2)

{
  FUN_140157cb0(*(longlong *)(param_2 + 0x80) + 0x6f0);
  return;
}



void Unwind_1401ee190(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(*(longlong *)(param_2 + 0x80) + 0x748);
  return;
}



void Unwind_1401ee1b0(undefined8 param_1,longlong param_2)

{
  FUN_140148e30(*(longlong *)(param_2 + 0x80) + 0x750);
  return;
}



void Unwind_1401ee1d0(undefined8 param_1,longlong param_2)

{
  FUN_140143550(*(longlong *)(param_2 + 0x80) + 0x788);
  return;
}



void Unwind_1401ee1f0(undefined8 param_1,longlong param_2)

{
  FUN_140143550(*(longlong *)(param_2 + 0x80) + 0x790);
  return;
}



void Unwind_1401ee210(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x80) + 0x798);
  return;
}



void Unwind_1401ee230(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x80) + 2000);
  return;
}



void Unwind_1401ee250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140143d00(*(longlong *)(param_2 + 0x80) + 0x808);
  return;
}



void Unwind_1401ee270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140143e10(*(longlong *)(param_2 + 0x80) + 0x828);
  return;
}



void Unwind_1401ee290(undefined8 param_1,longlong param_2)

{
  FUN_140141dc0(*(longlong *)(param_2 + 0x80) + 0x840);
  return;
}



void Unwind_1401ee2b0(undefined8 param_1,longlong param_2)

{
  FUN_1401a5f40(*(longlong *)(param_2 + 0x80) + 0xc48);
  return;
}



void Unwind_1401ee2d0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x80) + 0xc50);
  return;
}



void Unwind_1401ee2f0(undefined8 param_1,longlong param_2)

{
  FUN_140148eb0(*(longlong *)(param_2 + 0x80) + 0xc78);
  return;
}



void Unwind_1401ee310(undefined8 param_1,longlong param_2)

{
  FUN_1400acf90(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_1401ee320(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400acf90(*(longlong *)(param_2 + 0x80) + 0xcd0);
  return;
}



void Unwind_1401ee340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148f60(*(longlong *)(param_2 + 0x80) + 0x16e8);
  return;
}



void Unwind_1401ee360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148eb0(*(longlong *)(param_2 + 0x80) + 0x1740);
  return;
}



void Unwind_1401ee380(undefined8 param_1,longlong param_2)

{
  FUN_1401435f0(*(longlong *)(param_2 + 0x80) + 0x17a0);
  return;
}



void Unwind_1401ee3a0(undefined8 param_1,longlong param_2)

{
  FUN_140143630(*(longlong *)(param_2 + 0x80) + 0x17c8);
  return;
}



void Unwind_1401ee3c0(undefined8 param_1,longlong param_2)

{
  FUN_140143730(*(longlong *)(param_2 + 0x80) + 0x17f0);
  return;
}



void Unwind_1401ee3e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x80) + 0x1808);
  return;
}



void Unwind_1401ee400(undefined8 param_1,longlong param_2)

{
  FUN_14008cb00(*(longlong *)(param_2 + 0x80) + 0x1848);
  return;
}



void Unwind_1401ee420(undefined8 param_1,longlong param_2)

{
  FUN_140148e30(param_2 + 0x88);
  return;
}



void Unwind_1401ee430(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ee440(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x88);
  return;
}



void Unwind_1401ee450(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x98);
  return;
}



void Unwind_1401ee460(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x80);
  return;
}



void Unwind_1401ee470(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x50);
  return;
}



void Unwind_1401ee480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_1401ee490(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x30);
  return;
}



void Unwind_1401ee4a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401ee4b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401ee4c0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x88);
  return;
}



void Unwind_1401ee4d0(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x98);
  return;
}



void Unwind_1401ee4e0(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(param_2 + 0xa0);
  return;
}



void Unwind_1401ee4f0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xa8);
  return;
}



void Unwind_1401ee500(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0xd0);
  return;
}



void Unwind_1401ee510(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xf8);
  return;
}



void Unwind_1401ee520(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_1401ee530(undefined8 param_1,longlong param_2)

{
  FUN_14008cb00(param_2 + 0x30);
  return;
}



void Unwind_1401ee540(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148d50(param_2 + 0x60);
  return;
}



void Unwind_1401ee550(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_1401ee560(undefined8 param_1,longlong param_2)

{
  FUN_1401594a0(param_2 + 0x60);
  return;
}



void Unwind_1401ee570(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(param_2 + 0x50);
  return;
}



void Unwind_1401ee580(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401ee590(undefined8 param_1,longlong param_2)

{
  FUN_1401594a0(param_2 + 0xa0);
  return;
}



void Unwind_1401ee5a0(undefined8 param_1,longlong param_2)

{
  FUN_14015bfc0(param_2 + 0x90);
  return;
}



void Unwind_1401ee5b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ee5c0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0xa8));
  return;
}



void Unwind_1401ee5d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ee5e0(undefined8 param_1,longlong param_2)

{
  FUN_1401594a0(param_2 + 0xa0);
  return;
}



void Unwind_1401ee5f0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(undefined8 *)(param_2 + 0x228));
  return;
}



void Unwind_1401ee600(undefined8 param_1,longlong param_2)

{
  FUN_1401594a0(param_2 + 0x80);
  return;
}



void Unwind_1401ee610(undefined8 param_1,longlong param_2)

{
  FUN_1401594a0(param_2 + 0xd8);
  return;
}



void Unwind_1401ee620(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(param_2 + 0x88);
  return;
}



void Unwind_1401ee630(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(param_2 + 0x128);
  return;
}



void Unwind_1401ee640(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(param_2 + 0x130);
  return;
}



void Unwind_1401ee650(undefined8 param_1,longlong param_2)

{
  FUN_140148d70(param_2 + 0xf8);
  return;
}



undefined * Catch_1401ee660(undefined8 param_1,longlong param_2)

{
  int *piVar1;
  undefined *puVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined *puVar6;
  
  FUN_1400a3440();
  *(undefined **)(param_2 + 0x108) = PTR_DAT_1402f8010;
  uVar5 = (**(code **)(**(longlong **)(param_2 + 0x3e0) + 8))();
  *(longlong *)(param_2 + 0x5a0) = param_2 + 0x5a8;
  FUN_14008a6c0(param_2 + 0x5a0,uVar5,3);
  memcpy((void *)(param_2 + 0x410),(void *)(param_2 + 0x5a0),0x108);
  uVar3 = (**(code **)**(undefined8 **)(param_2 + 0xb0))();
  uVar4 = (**(code **)**(undefined8 **)(param_2 + 0xa8))();
  FUN_14003c600(param_2 + 0x108,&DAT_140253ed0,uVar4,uVar3,param_2 + 0x410);
  if (*(void **)(param_2 + 0x5a0) != (void *)(param_2 + 0x5a8)) {
    free(*(void **)(param_2 + 0x5a0));
  }
  puVar2 = *(undefined **)(param_2 + 0x108);
  puVar6 = puVar2;
  if (puVar2 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1402f8010;
  }
  FUN_1401946b0(*(undefined8 *)(*(longlong *)(param_2 + 0x150) + 0x17f0),1,puVar6);
  if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8010)) &&
     (puVar2 + -8 != (undefined *)0x0)) {
    uVar5 = FUN_1400a3440();
    *(undefined8 *)(param_2 + 0x340) = uVar5;
    FUN_1400a1c30(uVar5);
    *(undefined1 *)(param_2 + 0x348) = 1;
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2 + -8);
    }
    FUN_1400d1290(uVar5);
    *(undefined1 *)(param_2 + 0x348) = 0;
  }
  *(undefined **)(param_2 + 0x108) = PTR_DAT_1402f8010;
  return &DAT_140162d3e;
}



void Unwind_1401ee7c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x108);
  return;
}



void Unwind_1401ee7d0(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0x5a0);
  return;
}



void Unwind_1401ee7e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x340);
  return;
}



void Unwind_1401ee7f0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 600);
  return;
}



void Unwind_1401ee800(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x280);
  return;
}



void Unwind_1401ee810(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x110);
  return;
}



void Unwind_1401ee820(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 800);
  return;
}



void Unwind_1401ee830(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 1) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xfffffffe;
    FUN_140140df0(param_2 + 0x1d8);
  }
  return;
}



void Unwind_1401ee860(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 2) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xfffffffd;
    FUN_140140df0(param_2 + 0x2f8);
  }
  return;
}



void Unwind_1401ee890(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 4) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xfffffffb;
    FUN_140140df0(param_2 + 0x188);
  }
  return;
}



void Unwind_1401ee8c0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 8) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xfffffff7;
    FUN_140140df0(param_2 + 0x2a8);
  }
  return;
}



void Unwind_1401ee8f0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 0x10) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xffffffef;
    FUN_140140df0(param_2 + 0x1b0);
  }
  return;
}



void Unwind_1401ee920(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 0x20) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xffffffdf;
    FUN_140140df0(param_2 + 0x230);
  }
  return;
}



void Unwind_1401ee950(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 0x40) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xffffffbf;
    FUN_140140df0(param_2 + 0x160);
  }
  return;
}



void Unwind_1401ee980(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 0x80) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xffffff7f;
    FUN_140140df0(param_2 + 0x2d0);
  }
  return;
}



void Unwind_1401ee9b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x118);
  return;
}



void Unwind_1401ee9c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x140);
  return;
}



void Unwind_1401ee9d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x330);
  return;
}



void Unwind_1401ee9e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x200);
  return;
}



void Unwind_1401ee9f0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(undefined8 *)(param_2 + 0xa8));
  return;
}



void Unwind_1401eea00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401eea10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x130);
  return;
}



void Unwind_1401eea20(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x48);
  return;
}



void Unwind_1401eea30(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x58);
  return;
}



void Unwind_1401eea40(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x40);
  return;
}



void Unwind_1401eea50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x20),0x60);
  return;
}



void Unwind_1401eea70(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_1401eea90(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x20);
  return;
}



void Unwind_1401eeaa0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401eeab0(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0x150);
  return;
}



void Unwind_1401eeac0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x48);
  return;
}



void Unwind_1401eead0(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x58);
  return;
}



void Unwind_1401eeae0(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(param_2 + 0x60);
  return;
}



void Unwind_1401eeaf0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x68);
  return;
}



void Unwind_1401eeb00(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x90);
  return;
}



void Unwind_1401eeb10(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xb8);
  return;
}



void Unwind_1401eeb20(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x28) + 8);
  return;
}



void Unwind_1401eeb30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1401eeb40(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x28);
  return;
}



void Unwind_1401eeb50(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x38);
  return;
}



void Unwind_1401eeb60(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x20);
  return;
}



void Unwind_1401eeb70(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x28);
  return;
}



void Unwind_1401eeb80(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x38);
  return;
}



void Unwind_1401eeb90(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(param_2 + 0x40);
  return;
}



void Unwind_1401eeba0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x48);
  return;
}



void Unwind_1401eebb0(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x70);
  return;
}



void Unwind_1401eebc0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x98);
  return;
}



void Unwind_1401eebd0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x150) + 8);
  return;
}



void Unwind_1401eebe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x188));
  return;
}



void Unwind_1401eebf0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_1401eec00(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x28);
  return;
}



void Unwind_1401eec10(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x38);
  return;
}



void Unwind_1401eec20(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x20);
  return;
}



void Unwind_1401eec30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x180),0x60);
  return;
}



void Unwind_1401eec50(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 400),*(undefined8 *)(param_2 + 0x180));
  return;
}



void Unwind_1401eec80(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x180);
  return;
}



void Unwind_1401eec90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1401eeca0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x28);
  return;
}



void Unwind_1401eecb0(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x38);
  return;
}



void Unwind_1401eecc0(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(param_2 + 0x40);
  return;
}



void Unwind_1401eecd0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x48);
  return;
}



void Unwind_1401eece0(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x70);
  return;
}



void Unwind_1401eecf0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x98);
  return;
}



void Unwind_1401eed00(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x180) + 8);
  return;
}



void Unwind_1401eed10(undefined8 param_1,longlong param_2)

{
  FUN_14008cb00(param_2 + 0x28);
  return;
}



void Unwind_1401eed20(undefined8 param_1,longlong param_2)

{
  FUN_14008cb00(param_2 + 0x50);
  return;
}



void Unwind_1401eed30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x98);
  return;
}



void Unwind_1401eed40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xa0);
  return;
}



void Unwind_1401eed50(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x38);
  return;
}



void Unwind_1401eed60(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xa8) + 8);
  return;
}



void Unwind_1401eed70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401eed80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401eed90(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(*(undefined8 *)(param_2 + 0x188));
  return;
}



void Unwind_1401eeda0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_1401eedb0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x28);
  return;
}



void Unwind_1401eedc0(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x38);
  return;
}



void Unwind_1401eedd0(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x20);
  return;
}



void Unwind_1401eede0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x180),0x60);
  return;
}



void Unwind_1401eee00(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 400),*(undefined8 *)(param_2 + 0x180));
  return;
}



void Unwind_1401eee30(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x180);
  return;
}



void Unwind_1401eee40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1401eee50(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x28);
  return;
}



void Unwind_1401eee60(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x38);
  return;
}



void Unwind_1401eee70(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(param_2 + 0x40);
  return;
}



void Unwind_1401eee80(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x48);
  return;
}



void Unwind_1401eee90(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x70);
  return;
}



void Unwind_1401eeea0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x98);
  return;
}



void Unwind_1401eeeb0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x180) + 8);
  return;
}



void Unwind_1401eeec0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x28);
  return;
}



void Unwind_1401eeed0(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x38);
  return;
}



void Unwind_1401eeee0(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x20);
  return;
}



void Unwind_1401eeef0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x28);
  return;
}



void Unwind_1401eef00(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x38);
  return;
}



void Unwind_1401eef10(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(param_2 + 0x40);
  return;
}



void Unwind_1401eef20(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x48);
  return;
}



void Unwind_1401eef30(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x70);
  return;
}



void Unwind_1401eef40(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x98);
  return;
}



void Unwind_1401eef50(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x140) + 8);
  return;
}



void Unwind_1401eef60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401eef70(undefined8 param_1,longlong param_2)

{
  FUN_1401594a0(param_2 + 0x60);
  return;
}



void Unwind_1401eef80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401eef90(undefined8 param_1,longlong param_2)

{
  FUN_1401594a0(param_2 + 0x90);
  return;
}



void Unwind_1401eefa0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(undefined8 *)(param_2 + 0xa0));
  return;
}



void Unwind_1401eefb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401eefc0(undefined8 param_1,longlong param_2)

{
  FUN_14016a7f0(param_2 + 0xe0);
  return;
}



void Unwind_1401eefd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401eefe0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x68);
  return;
}



void Unwind_1401eeff0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401ef000(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x38),0xf8);
  return;
}



void Unwind_1401ef020(undefined8 param_1,longlong param_2)

{
  FUN_1401594a0(param_2 + 0x38);
  return;
}



void Unwind_1401ef030(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401ef040(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x40);
  return;
}



void Unwind_1401ef050(undefined8 param_1,longlong param_2)

{
  FUN_1401594a0(param_2 + 0x30);
  return;
}



void Unwind_1401ef060(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401ef070(undefined8 param_1,longlong param_2)

{
  FUN_1401594a0(param_2 + 0x90);
  return;
}



void Unwind_1401ef080(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x118);
  return;
}



void Unwind_1401ef090(undefined8 param_1,longlong param_2)

{
  FUN_140142660(param_2 + 0x1a0);
  return;
}



void Unwind_1401ef0a0(undefined8 param_1,longlong param_2)

{
  FUN_140143580(param_2 + 0x30);
  return;
}



void Unwind_1401ef0b0(undefined8 param_1,longlong param_2)

{
  FUN_140143580(param_2 + 0x30);
  return;
}



void Unwind_1401ef0c0(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x60);
  return;
}



void Unwind_1401ef0d0(undefined8 param_1,longlong param_2)

{
  FUN_140153350(param_2 + 0x58);
  return;
}



void Unwind_1401ef0e0(undefined8 param_1,longlong param_2)

{
  FUN_140152f30(param_2 + 0x20);
  return;
}



void Unwind_1401ef0f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0xf0);
  return;
}



void Unwind_1401ef100(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x98);
  return;
}



void Unwind_1401ef110(undefined8 param_1,longlong param_2)

{
  FUN_140153350(param_2 + 0x90);
  return;
}



void Unwind_1401ef120(undefined8 param_1,longlong param_2)

{
  FUN_140152f30(param_2 + 0x20);
  return;
}



void Unwind_1401ef130(undefined8 param_1,longlong param_2)

{
  FUN_140143580(param_2 + 200);
  return;
}



void Unwind_1401ef140(undefined8 param_1,longlong param_2)

{
  FUN_140143580(param_2 + 200);
  return;
}



void Unwind_1401ef150(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x98);
  return;
}



void Unwind_1401ef160(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 400) + 8);
  return;
}



void Unwind_1401ef170(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 400) + 8);
  return;
}



void Unwind_1401ef180(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x60);
  return;
}



void Unwind_1401ef190(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 400) + 8);
  return;
}



void Unwind_1401ef1a0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x48);
  return;
}



void Unwind_1401ef1b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401ef1c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1401ef1d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_1401ef1e0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xb8);
  return;
}



void Unwind_1401ef1f0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x90);
  return;
}



void Unwind_1401ef200(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 400);
  return;
}



void Unwind_1401ef210(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401ef220(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_1401ef230(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x198);
  return;
}



void Unwind_1401ef240(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_1401ef250(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401ef260(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401ef270(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ef280(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1401ef290(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_1401ef2a0(undefined8 param_1,longlong param_2)

{
  FUN_140187700(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1401ef2b0(undefined8 param_1,longlong param_2)

{
  FUN_1400a3ff0(*(longlong *)(param_2 + 0x70) + 0x60);
  return;
}



void Unwind_1401ef2c0(undefined8 param_1,longlong param_2)

{
  FUN_140141c90(*(longlong *)(param_2 + 0x70) + 0x68);
  return;
}



void Unwind_1401ef2d0(undefined8 param_1,longlong param_2)

{
  FUN_140141cd0(*(longlong *)(param_2 + 0x70) + 0x70);
  return;
}



void Unwind_1401ef2e0(undefined8 param_1,longlong param_2)

{
  FUN_1401a7910(*(longlong *)(param_2 + 0x70) + 0x78);
  return;
}



void Unwind_1401ef2f0(undefined8 param_1,longlong param_2)

{
  FUN_140141c40(*(longlong *)(param_2 + 0x70) + 0xa8);
  return;
}



void Unwind_1401ef310(undefined8 param_1,longlong param_2)

{
  FUN_140141c50(*(longlong *)(param_2 + 0x70) + 0xb0);
  return;
}



void Unwind_1401ef330(undefined8 param_1,longlong param_2)

{
  FUN_14015f6a0(*(longlong *)(param_2 + 0x70) + 0xb8);
  return;
}



void Unwind_1401ef350(undefined8 param_1,longlong param_2)

{
  FUN_140141d50(*(longlong *)(param_2 + 0x70) + 0x118);
  return;
}



void Unwind_1401ef370(undefined8 param_1,longlong param_2)

{
  FUN_140141d10(*(longlong *)(param_2 + 0x70) + 0x120);
  return;
}



void Unwind_1401ef390(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x70) + 0x128);
  return;
}



void Unwind_1401ef3b0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x70) + 0x160);
  return;
}



void Unwind_1401ef3d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(*(longlong *)(param_2 + 0x70) + 0x210);
  return;
}



void Unwind_1401ef3f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(*(longlong *)(param_2 + 0x70) + 0x218);
  return;
}



void Unwind_1401ef410(undefined8 param_1,longlong param_2)

{
  FUN_140148eb0(*(longlong *)(param_2 + 0x70) + 0x280);
  return;
}



void Unwind_1401ef430(undefined8 param_1,longlong param_2)

{
  FUN_140159630(*(longlong *)(param_2 + 0x70) + 0x2d8);
  return;
}



void Unwind_1401ef450(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148f60(*(longlong *)(param_2 + 0x70) + 0x388);
  return;
}



void Unwind_1401ef470(undefined8 param_1,longlong param_2)

{
  FUN_1401435c0(*(longlong *)(param_2 + 0x70) + 0x3e0);
  return;
}



void Unwind_1401ef490(undefined8 param_1,longlong param_2)

{
  FUN_14015f210(*(longlong *)(param_2 + 0x70) + 0x400);
  return;
}



void Unwind_1401ef4b0(undefined8 param_1,longlong param_2)

{
  FUN_14015f850(*(longlong *)(param_2 + 0x70) + 0x458);
  return;
}



void Unwind_1401ef4d0(undefined8 param_1,longlong param_2)

{
  FUN_140142660(*(longlong *)(param_2 + 0x70) + 0x478);
  return;
}



void Unwind_1401ef4f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14018a150(*(longlong *)(param_2 + 0x70) + 0x480);
  return;
}



void Unwind_1401ef510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140186ed0(*(longlong *)(param_2 + 0x70) + 0x4a8);
  return;
}



void Unwind_1401ef530(undefined8 param_1,longlong param_2)

{
  FUN_140152f50(*(longlong *)(param_2 + 0x70) + 0x6c8);
  return;
}



void Unwind_1401ef550(undefined8 param_1,longlong param_2)

{
  FUN_140157cb0(*(longlong *)(param_2 + 0x70) + 0x6f0);
  return;
}



void Unwind_1401ef570(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(*(longlong *)(param_2 + 0x70) + 0x748);
  return;
}



void Unwind_1401ef590(undefined8 param_1,longlong param_2)

{
  FUN_140148e30(*(longlong *)(param_2 + 0x70) + 0x750);
  return;
}



void Unwind_1401ef5b0(undefined8 param_1,longlong param_2)

{
  FUN_140143550(*(longlong *)(param_2 + 0x70) + 0x788);
  return;
}



void Unwind_1401ef5d0(undefined8 param_1,longlong param_2)

{
  FUN_140143550(*(longlong *)(param_2 + 0x70) + 0x790);
  return;
}



void Unwind_1401ef5f0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x70) + 0x798);
  return;
}



void Unwind_1401ef610(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x70) + 2000);
  return;
}



void Unwind_1401ef630(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140143d00(*(longlong *)(param_2 + 0x70) + 0x808);
  return;
}



void Unwind_1401ef650(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140143e10(*(longlong *)(param_2 + 0x70) + 0x828);
  return;
}



void Unwind_1401ef670(undefined8 param_1,longlong param_2)

{
  FUN_140141dc0(*(longlong *)(param_2 + 0x70) + 0x840);
  return;
}



void Unwind_1401ef690(undefined8 param_1,longlong param_2)

{
  FUN_1401a5f40(*(longlong *)(param_2 + 0x70) + 0xc48);
  return;
}



void Unwind_1401ef6b0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x70) + 0xc50);
  return;
}



void Unwind_1401ef6d0(undefined8 param_1,longlong param_2)

{
  FUN_140148eb0(*(longlong *)(param_2 + 0x70) + 0xc78);
  return;
}



void Unwind_1401ef6f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400acf90(*(longlong *)(param_2 + 0x70) + 0xcd0);
  return;
}



void Unwind_1401ef710(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148f60(*(longlong *)(param_2 + 0x70) + 0x16e8);
  return;
}



void Unwind_1401ef730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148eb0(*(longlong *)(param_2 + 0x70) + 0x1740);
  return;
}



void Unwind_1401ef750(undefined8 param_1,longlong param_2)

{
  FUN_1401435f0(*(longlong *)(param_2 + 0x70) + 0x17a0);
  return;
}



void Unwind_1401ef770(undefined8 param_1,longlong param_2)

{
  FUN_140143630(*(longlong *)(param_2 + 0x70) + 0x17c8);
  return;
}



void Unwind_1401ef790(undefined8 param_1,longlong param_2)

{
  FUN_140143730(*(longlong *)(param_2 + 0x70) + 0x17f0);
  return;
}



void Unwind_1401ef7b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x70) + 0x1808);
  return;
}



void Unwind_1401ef7d0(undefined8 param_1,longlong param_2)

{
  FUN_14008cb00(*(longlong *)(param_2 + 0x70) + 0x1848);
  return;
}



void Unwind_1401ef7f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ef800(undefined8 param_1,longlong param_2)

{
  FUN_140158810(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401ef810(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401ef820(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe0);
  return;
}



void Unwind_1401ef830(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401ef840(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x68);
  return;
}



void Unwind_1401ef850(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ef860(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401ef870(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x28);
  return;
}



void Unwind_1401ef880(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(*(undefined8 *)(param_2 + 0x38));
  return;
}



void Unwind_1401ef890(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ef8a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401ef8b0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_1401ef8c0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x70),
                *(longlong *)(param_2 + 0x60) + (longlong)*(int *)(param_2 + 0x68) * 0x48);
  return;
}



void Unwind_1401ef8f0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x78),
                *(longlong *)(param_2 + 0x60) + (longlong)*(int *)(param_2 + 0x70) * 0x48);
  return;
}



void Unwind_1401ef920(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ef930(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x60) & 1) != 0) {
    *(uint *)(param_2 + 0x60) = *(uint *)(param_2 + 0x60) & 0xfffffffe;
    thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  }
  return;
}



void Unwind_1401ef960(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401ef970(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ef980(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xb8);
  return;
}



void Unwind_1401ef990(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x2a0);
  return;
}



void Unwind_1401ef9a0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x2d8);
  return;
}



void Unwind_1401ef9b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_1401ef9c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c8);
  return;
}



void Unwind_1401ef9d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x440);
  return;
}



void Unwind_1401ef9e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x170);
  return;
}



void Unwind_1401ef9f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x440);
  return;
}



void Unwind_1401efa00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x440);
  return;
}



void Unwind_1401efa10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efa20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x440);
  return;
}



void Unwind_1401efa30(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xb8);
  return;
}



void Unwind_1401efa40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_1401efa50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2d0);
  return;
}



void Unwind_1401efa60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x440);
  return;
}



void Unwind_1401efa70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x170);
  return;
}



void Unwind_1401efa80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x440);
  return;
}



void Unwind_1401efa90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x440);
  return;
}



void Unwind_1401efaa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efab0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x440);
  return;
}



void Unwind_1401efac0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401efad0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401efae0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_1401efaf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401efb00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_1401efb10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401efb20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_1401efb30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x370);
  return;
}



void Unwind_1401efb40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efb50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401efb60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x380);
  return;
}



void Unwind_1401efb70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efb80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_1401efb90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x378);
  return;
}



void Unwind_1401efba0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efbb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_1401efbc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x340);
  return;
}



void Unwind_1401efbd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efbe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_1401efbf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x350);
  return;
}



void Unwind_1401efc00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efc10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401efc20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x360);
  return;
}



void Unwind_1401efc30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efc40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401efc50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x348);
  return;
}



void Unwind_1401efc60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efc70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401efc80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x318);
  return;
}



void Unwind_1401efc90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efca0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401efcb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x368);
  return;
}



void Unwind_1401efcc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efcd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401efce0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x328);
  return;
}



void Unwind_1401efcf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efd00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401efd10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x358);
  return;
}



void Unwind_1401efd20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efd30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401efd40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x338);
  return;
}



void Unwind_1401efd50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efd60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401efd70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x300);
  return;
}



void Unwind_1401efd80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efd90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401efda0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x308);
  return;
}



void Unwind_1401efdb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efdc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401efdd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x310);
  return;
}



void Unwind_1401efde0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efdf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x420);
  return;
}



void Unwind_1401efe00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401efe10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 800);
  return;
}



void Unwind_1401efe20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efe30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x420);
  return;
}



void Unwind_1401efe40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401efe50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x330);
  return;
}



void Unwind_1401efe60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401efe70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1b8);
  return;
}



void Unwind_1401efe80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe0);
  return;
}



void Unwind_1401efe90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401efea0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1401efeb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401efec0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401efed0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1401efee0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401efef0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1401eff00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd8);
  return;
}



void Unwind_1401eff10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401eff20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1401eff30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401eff40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401eff50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1401eff60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401eff70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1401eff80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_1401eff90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401effa0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1401effb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401effc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401effd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1401effe0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401efff0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1401f0000(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_1401f0010(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1401f0020(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401f0030(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401f0040(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401f0050(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1401f0060(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401f0070(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x40);
  return;
}



void Unwind_1401f0080(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x30);
  return;
}



void Unwind_1401f0090(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x30);
  return;
}



void Unwind_1401f00a0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd50);
  return;
}



void Unwind_1401f00c0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xd0);
  return;
}



void Unwind_1401f00d0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd50);
  return;
}



void Unwind_1401f00f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_1401f0100(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x20);
  return;
}



void Unwind_1401f0110(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x20);
  return;
}



void Unwind_1401f0120(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd50);
  return;
}



void Unwind_1401f0140(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xd0);
  return;
}



void Unwind_1401f0150(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd50);
  return;
}



void Unwind_1401f0170(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_1401f0180(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x20);
  return;
}



void Unwind_1401f0190(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x20);
  return;
}



void Unwind_1401f01a0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd50);
  return;
}



void Unwind_1401f01c0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xd0);
  return;
}



void Unwind_1401f01d0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd50);
  return;
}



void Unwind_1401f01f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x78) + 8);
  return;
}



void Unwind_1401f0200(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401f0210(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x88);
  return;
}



void Unwind_1401f0220(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x88);
  return;
}



void Unwind_1401f0230(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_1401f0240(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x78));
  return;
}



void Unwind_1401f0250(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x78);
  return;
}



void Unwind_1401f0260(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x80);
  return;
}



undefined8 Catch_1401f0270(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x70);
  plVar2 = *(longlong **)(lVar1 + 0x1580);
  if (plVar2 != (longlong *)0x0) {
    (**(code **)(*plVar2 + 0x20))(plVar2,*(undefined8 *)(param_2 + 0x28));
  }
  *(undefined8 *)(param_2 + 0x88) = 0;
  FUN_14016b650(lVar1 + 0x1520,param_2 + 0x88);
  *(undefined1 *)(lVar1 + 0x1528) = 1;
  return 0x140174cd0;
}



void Unwind_1401f02d0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x88);
  return;
}



void Unwind_1401f02e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x50),0x2c0);
  return;
}



void Unwind_1401f0300(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_1401f0320(undefined8 param_1,longlong param_2)

{
  FUN_14016b1c0(param_2 + 0x58);
  return;
}



void Unwind_1401f0330(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f0340(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 1) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xfffffffe;
    FUN_1401b2a70(*(undefined8 *)(param_2 + 0x68));
  }
  return;
}



void Unwind_1401f0370(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f0380(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x50);
  return;
}



void Unwind_1401f0390(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0xc0) & 1) != 0) {
    *(uint *)(param_2 + 0xc0) = *(uint *)(param_2 + 0xc0) & 0xfffffffe;
    thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 200));
  }
  return;
}



void Unwind_1401f03c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_1401f03d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401f03e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f03f0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x60);
  return;
}



void Unwind_1401f0400(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401f0410(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1401f0420(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401f0430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401f0440(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1401f0450(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401f0460(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x70),*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_1401f0480(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f0490(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f04a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f04b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f04c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1401f04d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f04e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f04f0(undefined8 param_1,longlong param_2)

{
  FUN_140176cc0(param_2 + 0x68);
  return;
}



void Unwind_1401f0500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x130);
  return;
}



void Unwind_1401f0510(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x50);
  return;
}



void Unwind_1401f0520(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401f0530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb0);
  return;
}



void Unwind_1401f0540(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x48);
  return;
}



void Unwind_1401f0550(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f0560(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x80);
  return;
}



void Unwind_1401f0570(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x80);
  return;
}



void Unwind_1401f0580(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe0);
  return;
}



void Unwind_1401f0590(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401f05a0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_1401f05b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401f05c0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0xd8);
  return;
}



void Unwind_1401f05d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_1401f05e0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x68);
  return;
}



void Unwind_1401f05f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401f0600(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_1401f0610(undefined8 param_1,longlong param_2)

{
  FUN_1401789e0(param_2 + 0x48);
  return;
}



void Unwind_1401f0620(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf0);
  return;
}



void Unwind_1401f0630(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x178),*(undefined8 *)(param_2 + 0x160));
  return;
}



void Unwind_1401f0660(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 200);
  return;
}



void Unwind_1401f0670(undefined8 param_1,longlong param_2)

{
  FUN_140169750(param_2 + 0x68);
  return;
}



void Unwind_1401f0680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1401f0690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_1401f06a0(undefined8 param_1,longlong param_2)

{
  FUN_1400a2f10(param_2 + 0x98);
  return;
}



void Unwind_1401f06b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_1401f06c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_1401f06d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401f06e0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x48);
  return;
}



void Unwind_1401f06f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f0700(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(*(undefined8 *)(param_2 + 0x48));
  return;
}



undefined8 Catch_All_1401f0710(void)

{
  return 0x14017a613;
}



void Unwind_1401f0730(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1401f0740(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0xf0);
  return;
}



void Unwind_1401f0750(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0xe8);
  return;
}



undefined * Catch_1401f0760(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_1400a1fd0(param_2 + 0x60,*(undefined8 *)(param_2 + 0x1b0));
    *(undefined4 *)(param_2 + 0x78) = *(undefined4 *)(*(longlong *)(param_2 + 0x30) + 0x28);
    plVar2 = *(longlong **)(lVar1 + 0x1580);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x60);
    FUN_1400a1f90(param_2 + 0x60);
  }
  return &DAT_14017aef9;
}



void Unwind_1401f07d0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x60);
  return;
}



undefined * Catch_1401f07e0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_1400a2570(param_2 + 0x60,*(undefined8 *)(param_2 + 0x1b8));
    *(undefined4 *)(param_2 + 0x78) = *(undefined4 *)(*(longlong *)(param_2 + 0x30) + 0x28);
    plVar2 = *(longlong **)(lVar1 + 0x1580);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x60);
    FUN_1400a1f90(param_2 + 0x60);
  }
  return &DAT_14017aef9;
}



void Unwind_1401f0850(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x60);
  return;
}



undefined * Catch_1401f0860(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_1400a25f0(param_2 + 0x60,*(undefined8 *)(param_2 + 0x188));
    *(undefined4 *)(param_2 + 0x78) = *(undefined4 *)(*(longlong *)(param_2 + 0x30) + 0x28);
    plVar2 = *(longlong **)(lVar1 + 0x1580);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x60);
    FUN_1400a1f90(param_2 + 0x60);
  }
  return &DAT_14017aef9;
}



void Unwind_1401f08d0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x60);
  return;
}



void Unwind_1401f08e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0xc0),0x60);
  return;
}



void Unwind_1401f0900(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 600);
  return;
}



undefined * Catch_1401f0910(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_1400a1fd0(param_2 + 0x60,*(undefined8 *)(param_2 + 0x170));
    *(undefined4 *)(param_2 + 0x78) = *(undefined4 *)(*(longlong *)(param_2 + 0x30) + 0x28);
    plVar2 = *(longlong **)(lVar1 + 0x1580);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x60);
    FUN_1400a1f90(param_2 + 0x60);
  }
  return &DAT_14017adf5;
}



void Unwind_1401f0980(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x60);
  return;
}



undefined * Catch_1401f0990(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_1400a2570(param_2 + 0x60,*(undefined8 *)(param_2 + 400));
    *(undefined4 *)(param_2 + 0x78) = *(undefined4 *)(*(longlong *)(param_2 + 0x30) + 0x28);
    plVar2 = *(longlong **)(lVar1 + 0x1580);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x60);
    FUN_1400a1f90(param_2 + 0x60);
  }
  return &DAT_14017adfa;
}



void Unwind_1401f0a00(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x60);
  return;
}



undefined * Catch_1401f0a10(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_1400a25f0(param_2 + 0x60,*(undefined8 *)(param_2 + 0x1a0));
    *(undefined4 *)(param_2 + 0x78) = *(undefined4 *)(*(longlong *)(param_2 + 0x30) + 0x28);
    plVar2 = *(longlong **)(lVar1 + 0x1580);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x60);
    FUN_1400a1f90(param_2 + 0x60);
  }
  return &DAT_14017adff;
}



void Unwind_1401f0a80(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x60);
  return;
}



void Unwind_1401f0a90(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x60);
  return;
}



void Unwind_1401f0aa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 600),0x60);
  return;
}



void Unwind_1401f0ac0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0xf0);
  return;
}



void Unwind_1401f0ad0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_1401f0ae0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x120);
  return;
}



void Unwind_1401f0af0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x30);
  return;
}



void Unwind_1401f0b00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1401f0b10(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x60);
  return;
}



void Unwind_1401f0b20(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x148);
  return;
}



void Unwind_1401f0b30(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0xe8);
  return;
}



void Unwind_1401f0b40(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xf8);
  return;
}



void Unwind_1401f0b50(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0xe0);
  return;
}



undefined8 Catch_1401f0b60(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_1400a1fd0(param_2 + 0x60,*(undefined8 *)(param_2 + 0x178));
    *(undefined4 *)(param_2 + 0x78) = *(undefined4 *)(*(longlong *)(param_2 + 0x48) + 0x70);
    plVar2 = *(longlong **)(lVar1 + 0x1580);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x60);
    FUN_1400a1f90(param_2 + 0x60);
  }
  return 0x14017b6d6;
}



void Unwind_1401f0bd0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x60);
  return;
}



undefined8 Catch_1401f0be0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_1400a2570(param_2 + 0x60,*(undefined8 *)(param_2 + 0x198));
    *(undefined4 *)(param_2 + 0x78) = *(undefined4 *)(*(longlong *)(param_2 + 0x48) + 0x70);
    plVar2 = *(longlong **)(lVar1 + 0x1580);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x60);
    FUN_1400a1f90(param_2 + 0x60);
  }
  return 0x14017b6d6;
}



void Unwind_1401f0c50(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x60);
  return;
}



undefined8 Catch_1401f0c60(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_1400a25f0(param_2 + 0x60,*(undefined8 *)(param_2 + 0x1a8));
    *(undefined4 *)(param_2 + 0x78) = *(undefined4 *)(*(longlong *)(param_2 + 0x48) + 0x70);
    plVar2 = *(longlong **)(lVar1 + 0x1580);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x60);
    FUN_1400a1f90(param_2 + 0x60);
  }
  return 0x14017b6d6;
}



void Unwind_1401f0cd0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x60);
  return;
}



void Unwind_1401f0ce0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401f0cf0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x68);
  return;
}



void Unwind_1401f0d00(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401f0d10(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x68);
  return;
}



void Unwind_1401f0d20(undefined8 param_1,longlong param_2)

{
  FUN_140176cc0(param_2 + 0x20);
  return;
}



void Unwind_1401f0d30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f0d40(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 1) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xfffffffe;
    FUN_14017b9c0(*(undefined8 *)(param_2 + 0x68));
  }
  return;
}



void Unwind_1401f0d70(undefined8 param_1,longlong param_2)

{
  FUN_14017b9c0(param_2 + 0x50);
  return;
}



void Unwind_1401f0d80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f0d90(undefined8 param_1,longlong param_2)

{
  FUN_14017b9c0(param_2 + 0x70);
  return;
}



void Unwind_1401f0da0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_1401f0db0(undefined8 param_1,longlong param_2)

{
  FUN_14017b9c0(param_2 + 0xa8);
  return;
}



void Unwind_1401f0dc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f0dd0(undefined8 param_1,longlong param_2)

{
  FUN_14017b9c0(param_2 + 0x88);
  return;
}



void Unwind_1401f0de0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f0df0(undefined8 param_1,longlong param_2)

{
  FUN_14017b9c0(param_2 + 0xa0);
  return;
}



void Unwind_1401f0e00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x118);
  return;
}



void Unwind_1401f0e10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401f0e20(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x38);
  return;
}



void Unwind_1401f0e30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x108);
  return;
}



void Unwind_1401f0e40(undefined8 param_1,longlong param_2)

{
  FUN_14016a7f0(param_2 + 0x2f0);
  return;
}



void Unwind_1401f0e50(undefined8 param_1,longlong param_2)

{
  FUN_14016ab30(param_2 + 0xd8);
  return;
}



void Unwind_1401f0e60(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x38);
  return;
}



void Unwind_1401f0e70(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x60),*(undefined8 *)(param_2 + 0x138));
  return;
}



void Unwind_1401f0e90(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_1401f0ea0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(*(longlong *)(param_2 + 0x60) + 0xc80);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * Catch_1401f0ec0(undefined8 param_1,longlong param_2)

{
  LPCWSTR lpOutputString;
  
  lpOutputString = (LPCWSTR)(**(code **)(**(longlong **)(param_2 + 0x150) + 8))();
  OutputDebugStringW(lpOutputString);
  _DAT_00000000 = 1;
  return &DAT_14017d2ff;
}



void Unwind_1401f0f00(undefined8 param_1,longlong param_2)

{
  FUN_14016ab70(param_2 + 0x38);
  return;
}



void Unwind_1401f0f10(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x70);
  return;
}



void Unwind_1401f0f20(undefined8 param_1,longlong param_2)

{
  FUN_140184fd0(param_2 + 0x108);
  return;
}



void Unwind_1401f0f30(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x12c0);
  return;
}



void Unwind_1401f0f40(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x12b0);
  return;
}



void Unwind_1401f0f60(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x630);
  return;
}



void Unwind_1401f0f70(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x12b0);
  return;
}



void Unwind_1401f0f90(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(*(longlong *)(param_2 + 0x60) + 0xc80);
  return;
}



void Unwind_1401f0fb0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1401f0fc0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 8000);
  return;
}



void Unwind_1401f0fe0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_1401f0ff0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x1f50);
  return;
}



void Unwind_1401f1000(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x240);
  return;
}



void Unwind_1401f1010(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x240);
  return;
}



void Unwind_1401f1020(undefined8 param_1,longlong param_2)

{
  FUN_14016abb0(param_2 + 0x38);
  return;
}



void Unwind_1401f1030(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x12c0);
  return;
}



void Unwind_1401f1040(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x70);
  return;
}



void Unwind_1401f1050(undefined8 param_1,longlong param_2)

{
  FUN_140184fd0(param_2 + 0x108);
  return;
}



void Unwind_1401f1060(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x12b0);
  return;
}



void Unwind_1401f1080(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x630);
  return;
}



void Unwind_1401f1090(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x12b0);
  return;
}



void Unwind_1401f10b0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(*(longlong *)(param_2 + 0x60) + 0xc80);
  return;
}



void Unwind_1401f10d0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_1401f10e0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_1401f10f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401f1100(undefined8 param_1,longlong param_2)

{
  FUN_14016a7f0(param_2 + 0x40);
  return;
}



void Unwind_1401f1110(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f1120(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



undefined8 Catch_All_1401f1130(void)

{
  return 0x14017e6f3;
}



void Unwind_1401f1150(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f1160(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x98));
  return;
}



void Unwind_1401f1170(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x80) & 1) != 0) {
    *(uint *)(param_2 + 0x80) = *(uint *)(param_2 + 0x80) & 0xfffffffe;
    FUN_14017b9c0(*(undefined8 *)(param_2 + 0x88));
  }
  return;
}



void Unwind_1401f11a0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x60),*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_1401f11c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401f11d0(undefined8 param_1,longlong param_2)

{
  FUN_14017e320(param_2 + 0x38);
  return;
}



void Unwind_1401f11e0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x40);
  return;
}



void Unwind_1401f11f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x180) + 8);
  return;
}



void Unwind_1401f1200(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa8);
  return;
}



void Unwind_1401f1210(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1401f1220(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x208);
  return;
}



void Unwind_1401f1230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x48);
  return;
}



void Unwind_1401f1240(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_1401f1250(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401f1260(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_1401f1270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1401f1280(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_1401f1290(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 200);
  return;
}



void Unwind_1401f12a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_1401f12b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401f12c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x30));
  return;
}



void Unwind_1401f12d0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x30);
  return;
}



void Unwind_1401f12e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x20));
  return;
}



void Unwind_1401f12f0(undefined8 param_1,longlong param_2)

{
  FUN_14016b270(param_2 + 0x20);
  return;
}



void Unwind_1401f1300(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1401f1310(undefined8 param_1,longlong param_2)

{
  FUN_14016c640(param_2 + 0x28);
  return;
}



void Unwind_1401f1320(undefined8 param_1,longlong param_2)

{
  FUN_140187700(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401f1330(undefined8 param_1,longlong param_2)

{
  FUN_1401692d0(*(longlong *)(param_2 + 0xb0) + 0x60);
  return;
}



void Unwind_1401f1340(undefined8 param_1,longlong param_2)

{
  FUN_140169320(*(longlong *)(param_2 + 0xb0) + 0x68);
  return;
}



void Unwind_1401f1350(undefined8 param_1,longlong param_2)

{
  FUN_140141c40(*(longlong *)(param_2 + 0xb0) + 0x70);
  return;
}



void Unwind_1401f1360(undefined8 param_1,longlong param_2)

{
  FUN_1400a3ff0(*(longlong *)(param_2 + 0xb0) + 0x78);
  return;
}



void Unwind_1401f1370(undefined8 param_1,longlong param_2)

{
  FUN_1401693a0(*(longlong *)(param_2 + 0xb0) + 0x88);
  return;
}



void Unwind_1401f1390(undefined8 param_1,longlong param_2)

{
  FUN_140169360(*(longlong *)(param_2 + 0xb0) + 0x90);
  return;
}



void Unwind_1401f13b0(undefined8 param_1,longlong param_2)

{
  FUN_14016a750(*(longlong *)(param_2 + 0xb0) + 0xa0);
  return;
}



void Unwind_1401f13d0(undefined8 param_1,longlong param_2)

{
  FUN_140141d50(*(longlong *)(param_2 + 0xb0) + 0x98);
  return;
}



void Unwind_1401f13f0(undefined8 param_1,longlong param_2)

{
  FUN_140141dc0(*(longlong *)(param_2 + 0xb0) + 0xd8);
  return;
}



void Unwind_1401f1410(undefined8 param_1,longlong param_2)

{
  FUN_140142660(*(longlong *)(param_2 + 0xb0) + 0x4e0);
  return;
}



void Unwind_1401f1430(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0xb0) + 0x518);
  return;
}



void Unwind_1401f1450(undefined8 param_1,longlong param_2)

{
  FUN_14016c640(*(longlong *)(param_2 + 0xb0) + 0x5d0);
  return;
}



void Unwind_1401f1470(undefined8 param_1,longlong param_2)

{
  FUN_14016b1c0(*(longlong *)(param_2 + 0xb0) + 0x5d8);
  return;
}



void Unwind_1401f1490(undefined8 param_1,longlong param_2)

{
  FUN_14017e6e0(*(longlong *)(param_2 + 0xb0) + 0x5e0);
  return;
}



void Unwind_1401f14b0(undefined8 param_1,longlong param_2)

{
  FUN_140178e10(*(longlong *)(param_2 + 0xb0) + 0x6e0);
  return;
}



void Unwind_1401f14d0(undefined8 param_1,longlong param_2)

{
  FUN_140141dc0(*(longlong *)(param_2 + 0xb0) + 0x708);
  return;
}



void Unwind_1401f14f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400acf90(*(longlong *)(param_2 + 0xb0) + 0xb08);
  return;
}



void Unwind_1401f1510(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(*(longlong *)(param_2 + 0xb0) + 0x1520);
  return;
}



void Unwind_1401f1530(undefined8 param_1,longlong param_2)

{
  FUN_140178e10(*(longlong *)(param_2 + 0xb0) + 0x1530);
  return;
}



void Unwind_1401f1550(undefined8 param_1,longlong param_2)

{
  FUN_140169410(*(longlong *)(param_2 + 0xb0) + 0x1550);
  return;
}



void Unwind_1401f1570(undefined8 param_1,longlong param_2)

{
  FUN_14016b270(*(longlong *)(param_2 + 0xb0) + 0x1570);
  return;
}



void Unwind_1401f1590(undefined8 param_1,longlong param_2)

{
  FUN_140002310(*(longlong *)(param_2 + 0xb0) + 0x1588);
  return;
}



void Unwind_1401f15b0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(*(longlong *)(param_2 + 0xb0) + 0x15d8);
  return;
}



void Unwind_1401f15d0(undefined8 param_1,longlong param_2)

{
  FUN_14017ed30(*(longlong *)(param_2 + 0xb0) + 0x15e0);
  return;
}



void Unwind_1401f15f0(undefined8 param_1,longlong param_2)

{
  FUN_14017ed30(*(longlong *)(param_2 + 0xb0) + 0x1600);
  return;
}



void Unwind_1401f1610(undefined8 param_1,longlong param_2)

{
  FUN_14017a600(*(longlong *)(param_2 + 0xb0) + 0x1650);
  return;
}



void Unwind_1401f1630(undefined8 param_1,longlong param_2)

{
  FUN_14017a600(*(longlong *)(param_2 + 0xb0) + 0x16a8);
  return;
}



void Unwind_1401f1650(undefined8 param_1,longlong param_2)

{
  FUN_1401789b0(*(longlong *)(param_2 + 0xb0) + 0x1700);
  return;
}



void Unwind_1401f1670(undefined8 param_1,longlong param_2)

{
  FUN_14017a600(*(longlong *)(param_2 + 0xb0) + 0x1720);
  return;
}



void Unwind_1401f1690(undefined8 param_1,longlong param_2)

{
  FUN_1401789e0(*(longlong *)(param_2 + 0xb0) + 0x17b0);
  return;
}



void Unwind_1401f16b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140186ed0(*(longlong *)(param_2 + 0xb0) + 0x17d0);
  return;
}



void Unwind_1401f16d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14018a150(*(longlong *)(param_2 + 0xb0) + 0x17f0);
  return;
}



void Unwind_1401f16f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140186ed0(*(longlong *)(param_2 + 0xb0) + 0x1818);
  return;
}



void Unwind_1401f1710(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14018a150(*(longlong *)(param_2 + 0xb0) + 0x1838);
  return;
}



void Unwind_1401f1730(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x38);
  return;
}



void Unwind_1401f1740(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f1750(undefined8 param_1,longlong param_2)

{
  FUN_14016b270(param_2 + 0xb8);
  return;
}



void Unwind_1401f1760(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0xc0);
  return;
}



void Unwind_1401f1770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 200));
  return;
}



void Unwind_1401f1780(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401f1790(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401f17a0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x40);
  return;
}



void Unwind_1401f17b0(undefined8 param_1,longlong param_2)

{
  FUN_14017e320(param_2 + 0x38);
  return;
}



void Unwind_1401f17c0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x40);
  return;
}



void Unwind_1401f17d0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x180) + 8);
  return;
}



void Unwind_1401f17e0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(*(undefined8 *)(param_2 + 0x148));
  return;
}



void Unwind_1401f17f0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x28);
  return;
}



void Unwind_1401f1800(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x38);
  return;
}



void Unwind_1401f1810(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x20);
  return;
}



void Unwind_1401f1820(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x28);
  return;
}



void Unwind_1401f1830(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x38);
  return;
}



void Unwind_1401f1840(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(param_2 + 0x40);
  return;
}



void Unwind_1401f1850(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x48);
  return;
}



void Unwind_1401f1860(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x70);
  return;
}



void Unwind_1401f1870(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x98);
  return;
}



void Unwind_1401f1880(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x150) + 8);
  return;
}



void Unwind_1401f1890(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401f18a0(undefined8 param_1,longlong param_2)

{
  FUN_14017e320(param_2 + 0x70);
  return;
}



void Unwind_1401f18b0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x218),*(undefined8 *)(param_2 + 0x200));
  return;
}



void Unwind_1401f18e0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(*(longlong *)(param_2 + 0x68) + 8);
  return;
}



void Unwind_1401f18f0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x78);
  return;
}



void Unwind_1401f1900(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(*(longlong *)(param_2 + 0x208) + 8);
  return;
}



void Unwind_1401f1910(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(*(longlong *)(param_2 + 0x208) + 0x18);
  return;
}



void Unwind_1401f1920(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(*(longlong *)(param_2 + 0x208) + 0x20);
  return;
}



void Unwind_1401f1930(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x208) + 0x28);
  return;
}



void Unwind_1401f1940(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(*(longlong *)(param_2 + 0x208) + 0x50);
  return;
}



void Unwind_1401f1950(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x208) + 0x78);
  return;
}



void Unwind_1401f1960(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x210) + 8);
  return;
}



void Unwind_1401f1970(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401f1980(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0x200));
  return;
}



void Unwind_1401f1990(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401f19a0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0x200));
  return;
}



void Unwind_1401f19b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148d50(*(longlong *)(param_2 + 0x218) + 0x38);
  return;
}



void Unwind_1401f19c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f19d0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0x200));
  return;
}



void Unwind_1401f19e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x218) + 0x10);
  return;
}



void Unwind_1401f19f0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x218) + 0x28);
  return;
}



void Unwind_1401f1a00(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x200) + 8);
  return;
}



void Unwind_1401f1a10(undefined8 param_1,longlong param_2)

{
  FUN_14016b270(param_2 + 0x50);
  return;
}



void Unwind_1401f1a20(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x58);
  return;
}



void Unwind_1401f1a30(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x48);
  return;
}



void Unwind_1401f1a40(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x30);
  return;
}



void Unwind_1401f1a50(undefined8 param_1,longlong param_2)

{
  FUN_140002310(param_2 + 0x120);
  return;
}



void Unwind_1401f1a60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x120);
  return;
}



void Unwind_1401f1a70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_1401f1a80(undefined8 param_1,longlong param_2)

{
  FUN_14017b9c0(param_2 + 0x48);
  return;
}



void Unwind_1401f1a90(undefined8 param_1,longlong param_2)

{
  FUN_14017b9c0(param_2 + 0x58);
  return;
}



void Unwind_1401f1aa0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x40);
  return;
}



void Unwind_1401f1ab0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_1401f1ac0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x50);
  return;
}



void Unwind_1401f1ad0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x88);
  return;
}



void Unwind_1401f1ae0(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x98);
  return;
}



void Unwind_1401f1af0(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x80);
  return;
}



void Unwind_1401f1b00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401f1b10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401f1b20(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xa0);
  return;
}



void Unwind_1401f1b30(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x78);
  return;
}



void Unwind_1401f1b40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401f1b50(undefined8 param_1,longlong param_2)

{
  FUN_140176cc0(param_2 + 0x198);
  return;
}



void Unwind_1401f1b60(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x38);
  return;
}



void Unwind_1401f1b70(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x48);
  return;
}



void Unwind_1401f1b80(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x30);
  return;
}



void Unwind_1401f1b90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_1401f1ba0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x188);
  return;
}



void Unwind_1401f1bb0(undefined8 param_1,longlong param_2)

{
  FUN_14017b9c0(param_2 + 0x170);
  return;
}



void Unwind_1401f1bc0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x38);
  return;
}



void Unwind_1401f1bd0(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x48);
  return;
}



void Unwind_1401f1be0(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x30);
  return;
}



void Unwind_1401f1bf0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x38);
  return;
}



void Unwind_1401f1c00(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x48);
  return;
}



void Unwind_1401f1c10(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(param_2 + 0x50);
  return;
}



void Unwind_1401f1c20(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x58);
  return;
}



void Unwind_1401f1c30(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x80);
  return;
}



void Unwind_1401f1c40(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xa8);
  return;
}



void Unwind_1401f1c50(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x130) + 8);
  return;
}



void Unwind_1401f1c60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f1c70(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x170);
  return;
}



void Unwind_1401f1c80(undefined8 param_1,longlong param_2)

{
  FUN_140176cc0(param_2 + 0x30);
  return;
}



void Unwind_1401f1c90(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x58);
  return;
}



void Unwind_1401f1ca0(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x68);
  return;
}



void Unwind_1401f1cb0(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x50);
  return;
}



void Unwind_1401f1cc0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x28);
  return;
}



void Unwind_1401f1cd0(undefined8 param_1,longlong param_2)

{
  FUN_140187700(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401f1ce0(undefined8 param_1,longlong param_2)

{
  FUN_1401692d0(*(longlong *)(param_2 + 0x90) + 0x60);
  return;
}



void Unwind_1401f1cf0(undefined8 param_1,longlong param_2)

{
  FUN_140169320(*(longlong *)(param_2 + 0x90) + 0x68);
  return;
}



void Unwind_1401f1d00(undefined8 param_1,longlong param_2)

{
  FUN_140141c40(*(longlong *)(param_2 + 0x90) + 0x70);
  return;
}



void Unwind_1401f1d10(undefined8 param_1,longlong param_2)

{
  FUN_1400a3ff0(*(longlong *)(param_2 + 0x90) + 0x78);
  return;
}



void Unwind_1401f1d20(undefined8 param_1,longlong param_2)

{
  FUN_1401693a0(*(longlong *)(param_2 + 0x90) + 0x88);
  return;
}



void Unwind_1401f1d40(undefined8 param_1,longlong param_2)

{
  FUN_140169360(*(longlong *)(param_2 + 0x90) + 0x90);
  return;
}



void Unwind_1401f1d60(undefined8 param_1,longlong param_2)

{
  FUN_14016a750(*(longlong *)(param_2 + 0x90) + 0xa0);
  return;
}



void Unwind_1401f1d80(undefined8 param_1,longlong param_2)

{
  FUN_140141d50(*(longlong *)(param_2 + 0x90) + 0x98);
  return;
}



void Unwind_1401f1da0(undefined8 param_1,longlong param_2)

{
  FUN_140141dc0(*(longlong *)(param_2 + 0x90) + 0xd8);
  return;
}



void Unwind_1401f1dc0(undefined8 param_1,longlong param_2)

{
  FUN_140142660(*(longlong *)(param_2 + 0x90) + 0x4e0);
  return;
}



void Unwind_1401f1de0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x90) + 0x518);
  return;
}



void Unwind_1401f1e00(undefined8 param_1,longlong param_2)

{
  FUN_14016c640(*(longlong *)(param_2 + 0x90) + 0x5d0);
  return;
}



void Unwind_1401f1e20(undefined8 param_1,longlong param_2)

{
  FUN_14016b1c0(*(longlong *)(param_2 + 0x90) + 0x5d8);
  return;
}



void Unwind_1401f1e40(undefined8 param_1,longlong param_2)

{
  FUN_14017e6e0(*(longlong *)(param_2 + 0x90) + 0x5e0);
  return;
}



void Unwind_1401f1e60(undefined8 param_1,longlong param_2)

{
  FUN_140178e10(*(longlong *)(param_2 + 0x90) + 0x6e0);
  return;
}



void Unwind_1401f1e80(undefined8 param_1,longlong param_2)

{
  FUN_140141dc0(*(longlong *)(param_2 + 0x90) + 0x708);
  return;
}



void Unwind_1401f1ea0(undefined8 param_1,longlong param_2)

{
  FUN_1400acf90(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_1401f1eb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400acf90(*(longlong *)(param_2 + 0x90) + 0xb08);
  return;
}



void Unwind_1401f1ed0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(*(longlong *)(param_2 + 0x90) + 0x1520);
  return;
}



void Unwind_1401f1ef0(undefined8 param_1,longlong param_2)

{
  FUN_140178e10(*(longlong *)(param_2 + 0x90) + 0x1530);
  return;
}



void Unwind_1401f1f10(undefined8 param_1,longlong param_2)

{
  FUN_140169410(*(longlong *)(param_2 + 0x90) + 0x1550);
  return;
}



void Unwind_1401f1f30(undefined8 param_1,longlong param_2)

{
  FUN_14016b270(*(longlong *)(param_2 + 0x90) + 0x1570);
  return;
}



void Unwind_1401f1f50(undefined8 param_1,longlong param_2)

{
  FUN_140002310(*(longlong *)(param_2 + 0x90) + 0x1588);
  return;
}



void Unwind_1401f1f70(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(*(longlong *)(param_2 + 0x90) + 0x15d8);
  return;
}



void Unwind_1401f1f90(undefined8 param_1,longlong param_2)

{
  FUN_14017ed30(*(longlong *)(param_2 + 0x90) + 0x15e0);
  return;
}



void Unwind_1401f1fb0(undefined8 param_1,longlong param_2)

{
  FUN_14017ed30(*(longlong *)(param_2 + 0x90) + 0x1600);
  return;
}



void Unwind_1401f1fd0(undefined8 param_1,longlong param_2)

{
  FUN_14017a600(*(longlong *)(param_2 + 0x90) + 0x1650);
  return;
}



void Unwind_1401f1ff0(undefined8 param_1,longlong param_2)

{
  FUN_14017a600(*(longlong *)(param_2 + 0x90) + 0x16a8);
  return;
}



void Unwind_1401f2010(undefined8 param_1,longlong param_2)

{
  FUN_1401789b0(*(longlong *)(param_2 + 0x90) + 0x1700);
  return;
}



void Unwind_1401f2030(undefined8 param_1,longlong param_2)

{
  FUN_14017a600(*(longlong *)(param_2 + 0x90) + 0x1720);
  return;
}



void Unwind_1401f2050(undefined8 param_1,longlong param_2)

{
  FUN_1401789e0(*(longlong *)(param_2 + 0x90) + 0x17b0);
  return;
}



void Unwind_1401f2070(undefined8 param_1,longlong param_2)

{
  FUN_140186ed0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_1401f2080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140186ed0(*(longlong *)(param_2 + 0x90) + 0x17d0);
  return;
}



void Unwind_1401f20a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14018a150(*(longlong *)(param_2 + 0x90) + 0x17f0);
  return;
}



void Unwind_1401f20c0(undefined8 param_1,longlong param_2)

{
  FUN_140186ed0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_1401f20d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140186ed0(*(longlong *)(param_2 + 0x90) + 0x1818);
  return;
}



void Unwind_1401f20f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14018a150(*(longlong *)(param_2 + 0x90) + 0x1838);
  return;
}



void Unwind_1401f2110(undefined8 param_1,longlong param_2)

{
  FUN_14016b1c0(param_2 + 0x98);
  return;
}



void Unwind_1401f2120(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f2130(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0xa0));
  return;
}



void Unwind_1401f2140(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_1401f2150(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x38);
  return;
}



void Unwind_1401f2160(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x48);
  return;
}



void Unwind_1401f2170(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x30);
  return;
}



void Unwind_1401f2180(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x180),0x60);
  return;
}



void Unwind_1401f21a0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x20),*(undefined8 *)(param_2 + 0x180));
  return;
}



void Unwind_1401f21c0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x180);
  return;
}



void Unwind_1401f21d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401f21e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x130);
  return;
}



void Unwind_1401f21f0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x38);
  return;
}



void Unwind_1401f2200(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x48);
  return;
}



void Unwind_1401f2210(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(param_2 + 0x50);
  return;
}



void Unwind_1401f2220(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x58);
  return;
}



void Unwind_1401f2230(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x80);
  return;
}



void Unwind_1401f2240(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xa8);
  return;
}



void Unwind_1401f2250(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x180) + 8);
  return;
}



void Unwind_1401f2260(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(*(undefined8 *)(param_2 + 400));
  return;
}



void Unwind_1401f2270(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_1401f2280(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x38);
  return;
}



void Unwind_1401f2290(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x48);
  return;
}



void Unwind_1401f22a0(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x30);
  return;
}



void Unwind_1401f22b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x180),0x60);
  return;
}



void Unwind_1401f22d0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x198),*(undefined8 *)(param_2 + 0x180));
  return;
}



void Unwind_1401f2300(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x180);
  return;
}



void Unwind_1401f2310(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401f2320(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x38);
  return;
}



void Unwind_1401f2330(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x48);
  return;
}



void Unwind_1401f2340(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(param_2 + 0x50);
  return;
}



void Unwind_1401f2350(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x58);
  return;
}



void Unwind_1401f2360(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x80);
  return;
}



void Unwind_1401f2370(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xa8);
  return;
}



void Unwind_1401f2380(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x180) + 8);
  return;
}



void Unwind_1401f2390(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_1401f23a0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x38);
  return;
}



void Unwind_1401f23b0(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x48);
  return;
}



void Unwind_1401f23c0(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x30);
  return;
}



void Unwind_1401f23d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x180),0x60);
  return;
}



void Unwind_1401f23f0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x198),*(undefined8 *)(param_2 + 0x180));
  return;
}



void Unwind_1401f2420(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x180);
  return;
}



void Unwind_1401f2430(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401f2440(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x38);
  return;
}



void Unwind_1401f2450(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x48);
  return;
}



void Unwind_1401f2460(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(param_2 + 0x50);
  return;
}



void Unwind_1401f2470(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x58);
  return;
}



void Unwind_1401f2480(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x80);
  return;
}



void Unwind_1401f2490(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xa8);
  return;
}



void Unwind_1401f24a0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x180) + 8);
  return;
}



void Unwind_1401f24b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401f24c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1401f24d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f24e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_1401f24f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401f2500(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_1401f2510(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_1401f2520(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_1401f2530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401f2540(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401f2550(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_1401f2560(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa8);
  return;
}



void Unwind_1401f2570(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1401f2580(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_1401f2590(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401f25a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1401f25b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_1401f25c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_1401f25d0(undefined8 param_1,longlong param_2)

{
  FUN_1401a6fa0(param_2 + 0x50);
  return;
}



void Unwind_1401f25e0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0xd8);
  return;
}



void Unwind_1401f25f0(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0xe8);
  return;
}



void Unwind_1401f2600(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0xd0);
  return;
}



void Unwind_1401f2610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x2c8),0x60);
  return;
}



void Unwind_1401f2630(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x238),*(undefined8 *)(param_2 + 0x2c8));
  return;
}



void Unwind_1401f2660(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x2c8);
  return;
}



void Unwind_1401f2670(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401f2680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_1401f2690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa8);
  return;
}



void Unwind_1401f26a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c0);
  return;
}



void Unwind_1401f26b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x208);
  return;
}



void Unwind_1401f26c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1c0);
  return;
}



void Unwind_1401f26d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401f26e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_1401f26f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_1401f2700(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x228);
  return;
}



void Unwind_1401f2710(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1d0);
  return;
}



void Unwind_1401f2720(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1e0);
  return;
}



void Unwind_1401f2730(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1f8);
  return;
}



void Unwind_1401f2740(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x218);
  return;
}



void Unwind_1401f2750(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0xd8);
  return;
}



void Unwind_1401f2760(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0xe8);
  return;
}



void Unwind_1401f2770(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(param_2 + 0xf0);
  return;
}



void Unwind_1401f2780(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xf8);
  return;
}



void Unwind_1401f2790(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x120);
  return;
}



void Unwind_1401f27a0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x148);
  return;
}



void Unwind_1401f27b0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x2b0) + 8);
  return;
}



void Unwind_1401f27c0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x38);
  return;
}



void Unwind_1401f27d0(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x48);
  return;
}



void Unwind_1401f27e0(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x30);
  return;
}



void Unwind_1401f27f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x178),0x60);
  return;
}



void Unwind_1401f2810(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x20),*(undefined8 *)(param_2 + 0x178));
  return;
}



void Unwind_1401f2830(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x178);
  return;
}



void Unwind_1401f2840(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401f2850(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x38);
  return;
}



void Unwind_1401f2860(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x48);
  return;
}



void Unwind_1401f2870(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(param_2 + 0x50);
  return;
}



void Unwind_1401f2880(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x58);
  return;
}



void Unwind_1401f2890(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x80);
  return;
}



void Unwind_1401f28a0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xa8);
  return;
}



void Unwind_1401f28b0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x178) + 8);
  return;
}



void Unwind_1401f28c0(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f28d0(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401f28e0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_1401f28f0(undefined8 param_1,longlong param_2)

{
  FUN_140185ca0(param_2 + 0x28);
  return;
}



void Unwind_1401f2900(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x28);
  return;
}



void Unwind_1401f2910(undefined8 param_1,longlong param_2)

{
  FUN_140185cb0(param_2 + 0x38);
  return;
}



void Unwind_1401f2920(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f2930(undefined8 param_1,longlong param_2)

{
  FUN_1400a1e20(param_2 + 0x50);
  return;
}



void Unwind_1401f2940(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f2950(undefined8 param_1,longlong param_2)

{
  FUN_140185cb0(param_2 + 0x28);
  return;
}



void Unwind_1401f2960(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x28);
  return;
}



void Unwind_1401f2970(undefined8 param_1,longlong param_2)

{
  FUN_140185ca0(param_2 + 0x38);
  return;
}



void Unwind_1401f2980(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f2990(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0xa0);
  return;
}



void Unwind_1401f29a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f29b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401f29c0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0xa0);
  return;
}



void Unwind_1401f29d0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0xa0);
  return;
}



void Unwind_1401f29e0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xde0);
  return;
}



void Unwind_1401f29f0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xdd0);
  return;
}



void Unwind_1401f2a10(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x150);
  return;
}



void Unwind_1401f2a20(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xdd0);
  return;
}



void Unwind_1401f2a40(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x150);
  return;
}



void Unwind_1401f2a50(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xdd0);
  return;
}



void Unwind_1401f2a70(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x1a60);
  return;
}



void Unwind_1401f2a90(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f2aa0(undefined8 param_1,longlong param_2)

{
  FUN_140141c40(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f2ab0(undefined8 param_1,longlong param_2)

{
  FUN_140187340(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f2ac0(undefined8 param_1,longlong param_2)

{
  FUN_140187380(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1401f2ad0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0xb0);
  return;
}



void Unwind_1401f2ae0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0xb0);
  return;
}



void Unwind_1401f2af0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x160);
  return;
}



void Unwind_1401f2b00(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x1a70);
  return;
}



void Unwind_1401f2b20(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xdf0);
  return;
}



void Unwind_1401f2b30(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x1a70);
  return;
}



void Unwind_1401f2b50(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xde0);
  return;
}



void Unwind_1401f2b70(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f2b80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x118);
  return;
}



void Unwind_1401f2b90(undefined8 param_1,longlong param_2)

{
  FUN_14016a7f0(param_2 + 0x230);
  return;
}



void Unwind_1401f2ba0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_1401f2bb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x138);
  return;
}



void Unwind_1401f2bc0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0xc0);
  return;
}



void Unwind_1401f2bd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401f2be0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x60);
  return;
}



void Unwind_1401f2bf0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401f2c00(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xe8) + 8);
  return;
}



void Unwind_1401f2c10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401f2c20(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0xf0);
  return;
}



void Unwind_1401f2c30(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x180);
  return;
}



void Unwind_1401f2c40(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x180);
  return;
}



void Unwind_1401f2c50(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x1070);
  return;
}



void Unwind_1401f2c60(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x1060);
  return;
}



void Unwind_1401f2c80(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x3e0);
  return;
}



void Unwind_1401f2c90(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x1060);
  return;
}



void Unwind_1401f2cb0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x1060);
  return;
}



void Unwind_1401f2cd0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x3e0);
  return;
}



void Unwind_1401f2ce0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x1060);
  return;
}



void Unwind_1401f2d00(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x1cf0);
  return;
}



void Unwind_1401f2d20(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_1401f2d30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1401f2d40(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x60);
  return;
}



void Unwind_1401f2d50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x128);
  return;
}



void Unwind_1401f2d60(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_1401f2d70(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_1401f2d80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401f2d90(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x60);
  return;
}



void Unwind_1401f2da0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401f2db0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x60);
  return;
}



void Unwind_1401f2dc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_1401f2dd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f2de0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x58);
  return;
}



void Unwind_1401f2df0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f2e00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1401f2e10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401f2e20(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x58);
  return;
}



void Unwind_1401f2e30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f2e40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f2e50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f2e60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401f2e70(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x58);
  return;
}



void Unwind_1401f2e80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1401f2e90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f2ea0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f2eb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401f2ec0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x58);
  return;
}



void Unwind_1401f2ed0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1401f2ee0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f2ef0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f2f00(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x70);
  return;
}



void Unwind_1401f2f10(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x48);
  return;
}



void Unwind_1401f2f20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa8);
  return;
}



void Unwind_1401f2f30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401f2f40(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xc0);
  return;
}



void Unwind_1401f2f50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401f2f60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401f2f70(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_1401f2f80(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_1401f2f90(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0xf0);
  return;
}



void Unwind_1401f2fa0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0xf0);
  return;
}



void Unwind_1401f2fb0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x1a0);
  return;
}



void Unwind_1401f2fc0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xe30);
  return;
}



void Unwind_1401f2fd0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xe30);
  return;
}



void Unwind_1401f2fe0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_1401f2ff0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_1401f3000(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_1401f3010(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_1401f3020(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_1401f3030(undefined8 param_1,longlong param_2)

{
  FUN_1400a3ff0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f3040(undefined8 param_1,longlong param_2)

{
  FUN_1401a1480(param_2 + 0x58);
  return;
}



void Unwind_1401f3050(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f3060(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f3070(undefined8 param_1,longlong param_2)

{
  FUN_1401a1480(param_2 + 0x98);
  return;
}



void Unwind_1401f3080(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401f3090(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401f30a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f30b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f30c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401f30d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



undefined * Catch_1401f30e0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0xd0);
  if (*(longlong *)(*(longlong *)(lVar1 + 0x148) + 0x758) != 0) {
    FUN_1400a2570(param_2 + 0x40,*(undefined8 *)(param_2 + 0x90));
    *(undefined4 *)(param_2 + 0x58) = *(undefined4 *)(*(longlong *)(param_2 + 0xd8) + 0x30);
    plVar2 = *(longlong **)(*(longlong *)(lVar1 + 0x148) + 0x758);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x40);
    FUN_1400a1f90(param_2 + 0x40);
  }
  return &DAT_14018b47c;
}



void Unwind_1401f3160(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x40);
  return;
}



undefined * Catch_1401f3170(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0xd0);
  if (*(longlong *)(*(longlong *)(lVar1 + 0x148) + 0x758) != 0) {
    FUN_1400a1fd0(param_2 + 0x40,*(undefined8 *)(param_2 + 0xa0));
    *(undefined4 *)(param_2 + 0x58) = *(undefined4 *)(*(longlong *)(param_2 + 0xd8) + 0x30);
    plVar2 = *(longlong **)(*(longlong *)(lVar1 + 0x148) + 0x758);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x40);
    FUN_1400a1f90(param_2 + 0x40);
  }
  return &DAT_14018b47c;
}



void Unwind_1401f31f0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x40);
  return;
}



undefined * Catch_1401f3200(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0xd0);
  if (*(longlong *)(*(longlong *)(lVar1 + 0x148) + 0x758) != 0) {
    FUN_1400a25f0(param_2 + 0x40,*(undefined8 *)(param_2 + 0x98));
    *(undefined4 *)(param_2 + 0x58) = *(undefined4 *)(*(longlong *)(param_2 + 0xd8) + 0x30);
    plVar2 = *(longlong **)(*(longlong *)(lVar1 + 0x148) + 0x758);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x40);
    FUN_1400a1f90(param_2 + 0x40);
  }
  return &DAT_14018b47c;
}



void Unwind_1401f3280(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x40);
  return;
}



void Unwind_1401f3290(undefined8 param_1,longlong param_2)

{
  FUN_1401c10d0(param_2 + 0x50);
  return;
}



void Unwind_1401f32a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_1401f32b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f32c0(undefined8 param_1,longlong param_2)

{
  FUN_1401a1480(param_2 + 0x130);
  return;
}



void Unwind_1401f32d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f32e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x128);
  return;
}



void Unwind_1401f32f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401f3300(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x78);
  return;
}



void Unwind_1401f3310(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1401f3320(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_1401f3330(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x50);
  return;
}



void Unwind_1401f3340(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa8);
  return;
}



void Unwind_1401f3350(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x78);
  return;
}



void Unwind_1401f3360(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x78);
  return;
}



void Unwind_1401f3370(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401f3380(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xd0);
  return;
}



void Unwind_1401f3390(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_1401f33a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_1401f33b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401f33c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401f33d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401f33e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401f33f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xc0) + 8);
  return;
}



void Unwind_1401f3400(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_1401f3410(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1401f3420(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401f3430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_1401f3440(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 200);
  return;
}



void Unwind_1401f3450(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_1401f3460(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa8);
  return;
}



void Unwind_1401f3470(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x38);
  return;
}



void Unwind_1401f3480(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x38);
  return;
}



void Unwind_1401f3490(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd70);
  return;
}



void Unwind_1401f34b0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xf0);
  return;
}



void Unwind_1401f34c0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd70);
  return;
}



void Unwind_1401f34e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_1401f34f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401f3500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe0);
  return;
}



void Unwind_1401f3510(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_1401f3520(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_1401f3530(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_1401f3540(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x40);
  return;
}



void Unwind_1401f3550(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x40);
  return;
}



void Unwind_1401f3560(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd80);
  return;
}



void Unwind_1401f3580(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x100);
  return;
}



void Unwind_1401f3590(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd80);
  return;
}



void Unwind_1401f35b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1401f35c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_1401f35d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf0);
  return;
}



void Unwind_1401f35e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401f35f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401f3600(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xf0) + 8);
  return;
}



void Unwind_1401f3610(undefined8 param_1,longlong param_2)

{
  FUN_14016abb0(param_2 + 0x38);
  return;
}



void Unwind_1401f3620(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x68);
  return;
}



void Unwind_1401f3630(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f3640(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f3650(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_1401f3660(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401f3670(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x170);
  return;
}



void Unwind_1401f3680(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x170);
  return;
}



void Unwind_1401f3690(undefined8 param_1,longlong param_2)

{
  FUN_140184fd0(param_2 + 0xa0);
  return;
}



void Unwind_1401f36a0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xeb0);
  return;
}



void Unwind_1401f36b0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xea0);
  return;
}



void Unwind_1401f36d0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x220);
  return;
}



void Unwind_1401f36e0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xea0);
  return;
}



void Unwind_1401f3700(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xea0);
  return;
}



void Unwind_1401f3720(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x220);
  return;
}



void Unwind_1401f3730(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xea0);
  return;
}



void Unwind_1401f3750(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x1b30);
  return;
}



void Unwind_1401f3770(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x28) + 8);
  return;
}



void Unwind_1401f3780(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f3790(undefined8 param_1,longlong param_2)

{
  FUN_14016ab70(param_2 + 0x70);
  return;
}



void Unwind_1401f37a0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x98);
  return;
}



void Unwind_1401f37b0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_1401f37c0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_1401f37d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_1401f37e0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x100);
  return;
}



void Unwind_1401f37f0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x100);
  return;
}



void Unwind_1401f3800(undefined8 param_1,longlong param_2)

{
  FUN_140184fd0(param_2 + 0xf0);
  return;
}



void Unwind_1401f3810(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x1b0);
  return;
}



void Unwind_1401f3820(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xe40);
  return;
}



void Unwind_1401f3830(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xe40);
  return;
}



void Unwind_1401f3840(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f3850(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_1401f3860(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_1401f3870(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x38);
  return;
}



void Unwind_1401f3880(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_1401f3890(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_1401f38a0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_1401f38b0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0xa0);
  return;
}



void Unwind_1401f38c0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0xa0);
  return;
}



void Unwind_1401f38d0(undefined8 param_1,longlong param_2)

{
  FUN_140184fd0(param_2 + 0x80);
  return;
}



void Unwind_1401f38e0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x150);
  return;
}



void Unwind_1401f38f0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xde0);
  return;
}



void Unwind_1401f3900(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xde0);
  return;
}



void Unwind_1401f3910(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1401f3920(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_1401f3930(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_1401f3940(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_1401f3950(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x40);
  return;
}



void Unwind_1401f3960(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401f3970(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd60);
  return;
}



void Unwind_1401f3990(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xe0);
  return;
}



void Unwind_1401f39a0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd60);
  return;
}



void Unwind_1401f39c0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_1401f39d0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x30);
  return;
}



void Unwind_1401f39e0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x30);
  return;
}



void Unwind_1401f39f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401f3a00(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd40);
  return;
}



void Unwind_1401f3a20(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xc0);
  return;
}



void Unwind_1401f3a30(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd40);
  return;
}



void Unwind_1401f3a50(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_1401f3a60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_1401f3a70(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x40);
  return;
}



void Unwind_1401f3a80(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x40);
  return;
}



void Unwind_1401f3a90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401f3aa0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd60);
  return;
}



void Unwind_1401f3ac0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xe0);
  return;
}



void Unwind_1401f3ad0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd60);
  return;
}



void Unwind_1401f3af0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_1401f3b00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_1401f3b10(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x48);
  return;
}



void Unwind_1401f3b20(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x20);
  return;
}



void Unwind_1401f3b30(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x20);
  return;
}



void Unwind_1401f3b40(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x70);
  return;
}



void Unwind_1401f3b50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1401f3b60(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xd0);
  return;
}



void Unwind_1401f3b70(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xb0) + 8);
  return;
}



void Unwind_1401f3b80(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x20);
  return;
}



void Unwind_1401f3b90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_1401f3ba0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x30);
  return;
}



void Unwind_1401f3bb0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x30);
  return;
}



void Unwind_1401f3bc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401f3bd0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd60);
  return;
}



void Unwind_1401f3bf0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xe0);
  return;
}



void Unwind_1401f3c00(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd60);
  return;
}



void Unwind_1401f3c20(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x88);
  return;
}



void Unwind_1401f3c30(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x68) + 8);
  return;
}



void Unwind_1401f3c40(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x88),
                *(longlong *)(param_2 + 0x80) + (longlong)*(int *)(param_2 + 0x78) * 8);
  return;
}



void Unwind_1401f3c70(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0xa0),
                *(longlong *)(param_2 + 0x98) + (longlong)*(int *)(param_2 + 0x90) * 8);
  return;
}



void Unwind_1401f3ca0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x28),
                *(longlong *)(param_2 + 0x118) + (longlong)*(int *)(param_2 + 0x108) * 8);
  return;
}



void Unwind_1401f3cd0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0xb8),
                *(longlong *)(param_2 + 0xb0) + (longlong)*(int *)(param_2 + 0xa8) * 8);
  return;
}



void Unwind_1401f3d00(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f3d10(undefined8 param_1,longlong param_2)

{
  FUN_140155530(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_1401f3d20(undefined8 param_1,longlong param_2)

{
  FUN_140155530(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_1401f3d30(undefined8 param_1,longlong param_2)

{
  FUN_140149590(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_1401f3d50(undefined8 param_1,longlong param_2)

{
  FUN_140149590(*(longlong *)(param_2 + 0x40) + 0x90);
  return;
}



void Unwind_1401f3d70(undefined8 param_1,longlong param_2)

{
  FUN_14018a2d0(*(longlong *)(param_2 + 0x40) + 0x150);
  return;
}



void Unwind_1401f3d90(undefined8 param_1,longlong param_2)

{
  FUN_1400aab00(*(longlong *)(param_2 + 0x40) + 0x158);
  return;
}



void Unwind_1401f3db0(undefined8 param_1,longlong param_2)

{
  FUN_14018b360(*(longlong *)(param_2 + 0x40) + 0x160);
  return;
}



void Unwind_1401f3dd0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1401f3de0(undefined8 param_1,longlong param_2)

{
  FUN_140155530(*(longlong *)(param_2 + 0x60) + 0x38);
  return;
}



void Unwind_1401f3df0(undefined8 param_1,longlong param_2)

{
  FUN_140155530(*(longlong *)(param_2 + 0x60) + 0x60);
  return;
}



void Unwind_1401f3e00(undefined8 param_1,longlong param_2)

{
  FUN_140149590(*(longlong *)(param_2 + 0x60) + 0x88);
  return;
}



void Unwind_1401f3e20(undefined8 param_1,longlong param_2)

{
  FUN_140149590(*(longlong *)(param_2 + 0x60) + 0x90);
  return;
}



void Unwind_1401f3e40(undefined8 param_1,longlong param_2)

{
  FUN_14018a2d0(*(longlong *)(param_2 + 0x60) + 0x150);
  return;
}



void Unwind_1401f3e60(undefined8 param_1,longlong param_2)

{
  FUN_1400aab00(*(longlong *)(param_2 + 0x60) + 0x158);
  return;
}



void Unwind_1401f3e80(undefined8 param_1,longlong param_2)

{
  FUN_14018b360(*(longlong *)(param_2 + 0x60) + 0x160);
  return;
}



void Unwind_1401f3ea0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f3eb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f3ec0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f3ed0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x90),0x780);
  return;
}



void Unwind_1401f3ef0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401f3f00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa8);
  return;
}



void Unwind_1401f3f10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f3f20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f3f30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf0);
  return;
}



void Unwind_1401f3f40(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x30);
  return;
}



void Unwind_1401f3f50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_1401f3f60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf8);
  return;
}



void Unwind_1401f3f70(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x58);
  return;
}



void Unwind_1401f3f80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401f3f90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401f3fa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_1401f3fb0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x68);
  return;
}



void Unwind_1401f3fc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401f3fd0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x68);
  return;
}



void Unwind_1401f3fe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_1401f3ff0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x68);
  return;
}



void Unwind_1401f4000(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401f4010(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x68);
  return;
}



void Unwind_1401f4020(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x90);
  return;
}



void Unwind_1401f4030(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 200);
  return;
}



void Unwind_1401f4040(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x20);
  return;
}



void Unwind_1401f4050(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401f4060(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x40);
  return;
}



undefined * Catch_1401f4070(undefined8 param_1,longlong param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  plVar1 = *(longlong **)(*(longlong *)(*(longlong *)(param_2 + 0xb8) + 0x148) + 0x758);
  (**(code **)(*plVar1 + 0x20))(plVar1,*(undefined8 *)(param_2 + 0x140));
  FUN_140185560(param_2 + 0x40);
  FUN_140185030(param_2 + 0x40);
  FUN_1401856c0(param_2 + 0x40,0x800);
  FUN_1401856c0(param_2 + 0x40,0);
  FUN_14003c9e0(param_2 + 0x40,9);
  *(undefined8 *)(param_2 + 0x120) = 0;
  *(undefined8 *)(param_2 + 0x128) = 0;
  *(undefined8 *)(param_2 + 0x130) = 0;
  *(undefined8 *)(param_2 + 0x138) = 0;
  *(undefined ***)(param_2 + 0x118) = Proud::ByteArray::vftable;
  FUN_140186930(param_2 + 0x40,0);
  FUN_140140df0(param_2 + 0x118);
  lVar2 = *(longlong *)(param_2 + 0x30);
  uVar3 = (**(code **)(*(longlong *)(lVar2 + 0x108) + 0x10))();
  *(undefined8 *)(param_2 + 0xb8) = uVar3;
  FUN_1400a1c30(uVar3);
  *(undefined1 *)(param_2 + 0xc0) = 1;
  uVar4 = FUN_140146970(param_2 + 0x1a0,param_2 + 0x40);
  *(undefined8 *)(param_2 + 0x30) = 0;
  *(undefined1 *)(param_2 + 0x38) = 1;
  FUN_1401a12a0(*(undefined8 *)(lVar2 + 0x748),uVar4,param_2 + 0x30);
  FUN_140145b60(param_2 + 0x1a0);
  FUN_1400d1290(uVar3);
  *(longlong *)(param_2 + 0x30) = param_2 + 0x48;
  FUN_14019a730(param_2 + 0x48);
  if ((*(longlong *)(param_2 + 0x50) != 0) && (*(int *)(param_2 + 0x5c) < 0)) {
                    // WARNING: Subroutine does not return
    FUN_1400a26d0();
  }
  return &DAT_140190a53;
}



void Unwind_1401f41e0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x40);
  return;
}



void Unwind_1401f41f0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x40);
  return;
}



void Unwind_1401f4200(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x118);
  return;
}



void Unwind_1401f4210(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_1401f4220(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x1a0);
  return;
}



void Unwind_1401f4230(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f4240(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0xf0);
  return;
}



void Unwind_1401f4250(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0xf0);
  return;
}



void Unwind_1401f4260(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_1401f4270(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x1a0);
  return;
}



void Unwind_1401f4280(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f4290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401f42a0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x60);
  return;
}



void Unwind_1401f42b0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0xb0);
  return;
}



void Unwind_1401f42c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_1401f42d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401f42e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f42f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401f4300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x1e8),0x60);
  return;
}



void Unwind_1401f4320(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x1e8));
  return;
}



void Unwind_1401f4340(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x1e8);
  return;
}



void Unwind_1401f4350(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



undefined * Catch_1401f4360(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x1d0);
  if (*(longlong *)(*(longlong *)(lVar1 + 0x148) + 0x758) != 0) {
    FUN_1400a2570(param_2 + 0x40,*(undefined8 *)(param_2 + 0x98));
    *(undefined4 *)(param_2 + 0x58) = *(undefined4 *)(*(longlong *)(param_2 + 0x1d8) + 0x30);
    plVar2 = *(longlong **)(*(longlong *)(lVar1 + 0x148) + 0x758);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x40);
    FUN_1400a1f90(param_2 + 0x40);
  }
  return &DAT_140190fb7;
}



void Unwind_1401f43e0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x40);
  return;
}



undefined * Catch_1401f43f0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x1d0);
  if (*(longlong *)(*(longlong *)(lVar1 + 0x148) + 0x758) != 0) {
    FUN_1400a1fd0(param_2 + 0x40,*(undefined8 *)(param_2 + 0xa0));
    *(undefined4 *)(param_2 + 0x58) = *(undefined4 *)(*(longlong *)(param_2 + 0x1d8) + 0x30);
    plVar2 = *(longlong **)(*(longlong *)(lVar1 + 0x148) + 0x758);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x40);
    FUN_1400a1f90(param_2 + 0x40);
  }
  return &DAT_140190fb7;
}



void Unwind_1401f4470(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x40);
  return;
}



undefined * Catch_1401f4480(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x1d0);
  if (*(longlong *)(*(longlong *)(lVar1 + 0x148) + 0x758) != 0) {
    FUN_1400a25f0(param_2 + 0x40,*(undefined8 *)(param_2 + 0x90));
    *(undefined4 *)(param_2 + 0x58) = *(undefined4 *)(*(longlong *)(param_2 + 0x1d8) + 0x30);
    plVar2 = *(longlong **)(*(longlong *)(lVar1 + 0x148) + 0x758);
    (**(code **)(*plVar2 + 0x20))(plVar2,param_2 + 0x40);
    FUN_1400a1f90(param_2 + 0x40);
  }
  return &DAT_140190fb7;
}



void Unwind_1401f4500(undefined8 param_1,longlong param_2)

{
  FUN_1400a1f90(param_2 + 0x40);
  return;
}



void Unwind_1401f4510(undefined8 param_1,longlong param_2)

{
  FUN_1401c10d0(param_2 + 0x30);
  return;
}



void Unwind_1401f4520(undefined8 param_1,longlong param_2)

{
  FUN_14018a2f0(param_2 + 0x40);
  return;
}



void Unwind_1401f4530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_1401f4540(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xb0);
  return;
}



void Unwind_1401f4550(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401f4560(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401f4570(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



undefined8 Catch_1401f4580(undefined8 param_1,longlong param_2)

{
  int *piVar1;
  undefined *puVar2;
  undefined8 uVar3;
  undefined *puVar4;
  
  FUN_1400a3440();
  *(undefined **)(param_2 + 0x68) = PTR_DAT_1402f8010;
  uVar3 = (**(code **)(**(longlong **)(param_2 + 0x138) + 8))();
  *(longlong *)(param_2 + 0x160) = param_2 + 0x168;
  FUN_14008a6c0(param_2 + 0x160,uVar3,3);
  FUN_14003c600(param_2 + 0x68,L"std.exception(%s)",*(undefined8 *)(param_2 + 0x160));
  if (*(void **)(param_2 + 0x160) != (void *)(param_2 + 0x168)) {
    free(*(void **)(param_2 + 0x160));
  }
  puVar2 = *(undefined **)(param_2 + 0x68);
  puVar4 = puVar2;
  if (puVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1402f8010;
  }
  FUN_140190af0(*(undefined8 *)(param_2 + 0x48),L"Proud::CNetThreads_S::TcpListenerProc",puVar4,0);
  if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1402f8010)) &&
     (puVar2 + -8 != (undefined *)0x0)) {
    uVar3 = FUN_1400a3440();
    *(undefined8 *)(param_2 + 0x128) = uVar3;
    FUN_1400a1c30(uVar3);
    *(undefined1 *)(param_2 + 0x130) = 1;
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar2 + -8);
    }
    FUN_1400d1290(uVar3);
  }
  return 0x140191581;
}



void Unwind_1401f4680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_1401f4690(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0x160);
  return;
}



void Unwind_1401f46a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x128);
  return;
}



undefined8 Catch_1401f46b0(undefined8 param_1,longlong param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined *puVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined8 uVar6;
  undefined *puVar7;
  
  FUN_1400a3440();
  *(undefined **)(param_2 + 0x60) = PTR_DAT_1402f8010;
  plVar5 = (longlong *)FUN_1400a2090(*(undefined8 *)(param_2 + 0x120),param_2 + 0x78);
  uVar6 = 0;
  if ((undefined8 *)*plVar5 != (undefined8 *)0x0) {
    uVar6 = *(undefined8 *)*plVar5;
  }
  FUN_14003c600(param_2 + 0x60,L"_com_error(%s)",uVar6);
  plVar5 = *(longlong **)(param_2 + 0x78);
  if (plVar5 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar5 + 2;
    lVar4 = *plVar1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if (((int)lVar4 == 1) && (plVar5 != (longlong *)0x0)) {
      if (*plVar5 != 0) {
        Ordinal_6();
      }
      if ((void *)plVar5[1] != (void *)0x0) {
        operator_delete__((void *)plVar5[1]);
      }
      operator_delete(plVar5);
    }
  }
  puVar3 = *(undefined **)(param_2 + 0x60);
  puVar7 = puVar3;
  if (puVar3 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1402f8010;
  }
  FUN_140190af0(*(undefined8 *)(param_2 + 0x48),L"Proud::CNetThreads_S::TcpListenerProc",puVar7,0);
  if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1402f8010)) &&
     (puVar3 + -8 != (undefined *)0x0)) {
    uVar6 = FUN_1400a3440();
    *(undefined8 *)(param_2 + 0x140) = uVar6;
    FUN_1400a1c30(uVar6);
    *(undefined1 *)(param_2 + 0x148) = 1;
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_1400a3530(puVar3 + -8);
    }
    FUN_1400d1290(uVar6);
  }
  return 0x140191581;
}



void Unwind_1401f47c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401f47d0(undefined8 param_1,longlong param_2)

{
  FUN_1400a2030(param_2 + 0x78);
  return;
}



void Unwind_1401f47e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x140);
  return;
}



undefined8 Catch_1401f47f0(undefined8 param_1,longlong param_2)

{
  FUN_140190af0(*(undefined8 *)(param_2 + 0x48),L"Proud::CNetThreads_S::TcpListenerProc",L"void*",0)
  ;
  return 0x140191581;
}



void Unwind_1401f4830(undefined8 param_1,longlong param_2)

{
  FUN_1401c10d0(param_2 + 0x20);
  return;
}



void Unwind_1401f4840(undefined8 param_1,longlong param_2)

{
  FUN_1401a6fa0(param_2 + 0x60);
  return;
}



void Unwind_1401f4850(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f4860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401f4870(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401f4880(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x30);
  return;
}



void Unwind_1401f4890(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x58);
  return;
}



void Unwind_1401f48a0(undefined8 param_1,longlong param_2)

{
  FUN_14015c560(param_2 + 0x28);
  return;
}



void Unwind_1401f48b0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x30);
  return;
}



void Unwind_1401f48c0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x1a8) + 8);
  return;
}



void Unwind_1401f48d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f48e0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x50);
  return;
}



void Unwind_1401f48f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xc0) + 8);
  return;
}



void Unwind_1401f4900(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x50);
  return;
}



void Unwind_1401f4910(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f4920(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xb8) + 8);
  return;
}



void Unwind_1401f4930(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x40);
  return;
}



void Unwind_1401f4940(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f4950(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x40);
  return;
}



void Unwind_1401f4960(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f4970(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401f4980(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x40);
  return;
}



void Unwind_1401f4990(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401f49a0(undefined8 param_1,longlong param_2)

{
  FUN_1401a1480(param_2 + 0xa0);
  return;
}



void Unwind_1401f49b0(undefined8 param_1,longlong param_2)

{
  FUN_14018b770(param_2 + 0x58);
  return;
}



void Unwind_1401f49c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_1401f49d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf8);
  return;
}



void Unwind_1401f49e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



undefined * Catch_1401f49f0(undefined8 param_1,longlong param_2)

{
  FUN_140190310(*(undefined8 *)(param_2 + 0x1c0),*(undefined8 *)(param_2 + 0x40),
                L"Proud::CNetThreads_S::NetWorkerThread_UdpRecvCompletionCase",L"std.exception");
  return &DAT_1401929f3;
}



undefined * Catch_1401f4a30(undefined8 param_1,longlong param_2)

{
  FUN_140190310(*(undefined8 *)(param_2 + 0x1c0),*(undefined8 *)(param_2 + 0x40),
                L"Proud::CNetThreads_S::NetWorkerThread_UdpRecvCompletionCase",L"_com_error");
  return &DAT_1401929f3;
}



undefined * Catch_1401f4a70(undefined8 param_1,longlong param_2)

{
  FUN_140190310(*(undefined8 *)(param_2 + 0x1c0),*(undefined8 *)(param_2 + 0x40),
                L"Proud::CNetThreads_S::NetWorkerThread_UdpRecvCompletionCase",L"void*");
  return &DAT_1401929f3;
}



void Unwind_1401f4ab0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe8);
  return;
}



void Unwind_1401f4ac0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x140);
  return;
}



void Unwind_1401f4ad0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x130);
  return;
}



void Unwind_1401f4ae0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x150);
  return;
}



void Unwind_1401f4af0(undefined8 param_1,longlong param_2)

{
  FUN_1401a1480(param_2 + 0x180);
  return;
}



void Unwind_1401f4b00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f4b10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_1401f4b20(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x58);
  return;
}



void Unwind_1401f4b30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x178);
  return;
}



void Unwind_1401f4b40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_1401f4b50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_1401f4b60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_1401f4b70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_1401f4b80(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xa8);
  return;
}



void Unwind_1401f4b90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1401f4ba0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x80);
  return;
}



undefined8 Catch_1401f4bb0(undefined8 param_1,longlong param_2)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(**(longlong **)(param_2 + 0x48) + 8))();
  *(longlong *)(param_2 + 0x50) = param_2 + 0x58;
  FUN_14008a6c0(param_2 + 0x50,uVar1,3);
  FUN_140190310(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x20),
                L"Proud::CNetThreads_S::NetWorkerThread_PerRemoteClient",
                *(undefined8 *)(param_2 + 0x50));
  if (*(void **)(param_2 + 0x50) != (void *)(param_2 + 0x58)) {
    free(*(void **)(param_2 + 0x50));
  }
  return 0x1401932a6;
}



void Unwind_1401f4c20(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0x50);
  return;
}



undefined8 Catch_1401f4c30(undefined8 param_1,longlong param_2)

{
  longlong *plVar1;
  longlong lVar2;
  longlong *plVar3;
  undefined8 uVar4;
  
  plVar3 = (longlong *)FUN_1400a2090(*(undefined8 *)(param_2 + 0x40),param_2 + 0x30);
  uVar4 = 0;
  if ((undefined8 *)*plVar3 != (undefined8 *)0x0) {
    uVar4 = *(undefined8 *)*plVar3;
  }
  FUN_140190310(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x20),
                L"Proud::CNetThreads_S::NetWorkerThread_PerRemoteClient",uVar4);
  plVar3 = *(longlong **)(param_2 + 0x30);
  if (plVar3 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar3 + 2;
    lVar2 = *plVar1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if (((int)lVar2 == 1) && (plVar3 != (longlong *)0x0)) {
      if (*plVar3 != 0) {
        Ordinal_6();
      }
      if ((void *)plVar3[1] != (void *)0x0) {
        operator_delete__((void *)plVar3[1]);
      }
      operator_delete(plVar3);
    }
  }
  return 0x1401932a6;
}



void Unwind_1401f4cc0(undefined8 param_1,longlong param_2)

{
  FUN_1400a2030(param_2 + 0x30);
  return;
}



undefined8 Catch_1401f4cd0(undefined8 param_1,longlong param_2)

{
  FUN_140190310(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x20),
                L"Proud::CNetThreads_S::NetWorkerThread_PerRemoteClient",L"void*");
  return 0x1401932a6;
}



void Unwind_1401f4d10(undefined8 param_1,longlong param_2)

{
  FUN_1401c10d0(param_2 + 0x138);
  return;
}



void Unwind_1401f4d20(undefined8 param_1,longlong param_2)

{
  FUN_14018aac0(param_2 + 0x70);
  return;
}



void Unwind_1401f4d30(undefined8 param_1,longlong param_2)

{
  FUN_14018eb10(param_2 + 0x48);
  return;
}



void Unwind_1401f4d40(undefined8 param_1,longlong param_2)

{
  FUN_14018ab00(param_2 + 0x20);
  return;
}



void Unwind_1401f4d50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x148);
  return;
}



void Unwind_1401f4d60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_1401f4d70(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x140) + 8);
  return;
}



void Unwind_1401f4d80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 200));
  return;
}



void Unwind_1401f4d90(undefined8 param_1,longlong param_2)

{
  FUN_140149590(param_2 + 0x28);
  return;
}



void Unwind_1401f4da0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 200));
  return;
}



void Unwind_1401f4db0(undefined8 param_1,longlong param_2)

{
  FUN_140149590(param_2 + 0x30);
  return;
}



void Unwind_1401f4dc0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_1401f4dd0(undefined8 param_1,longlong param_2)

{
  FUN_140149590(param_2 + 0x38);
  return;
}



void Unwind_1401f4de0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401f4df0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0xb0));
  return;
}



void Unwind_1401f4e00(undefined8 param_1,longlong param_2)

{
  FUN_140149590(param_2 + 0x20);
  return;
}



undefined8 Catch_All_1401f4e10(void)

{
  return 0x1401942a3;
}



void Unwind_1401f4e30(undefined8 param_1,longlong param_2)

{
  FUN_140194290(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f4e40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401f4e50(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0xc0));
  return;
}



void Unwind_1401f4e60(undefined8 param_1,longlong param_2)

{
  FUN_140194450(param_2 + 0xc0);
  return;
}



void Unwind_1401f4e70(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0xd8));
  return;
}



void Unwind_1401f4e90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401f4ea0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1401f4eb0(undefined8 param_1,longlong param_2)

{
  FUN_140194450(param_2 + 0x20);
  return;
}



void Unwind_1401f4ec0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x50),*(undefined8 *)(param_2 + 0x28));
  return;
}



void Unwind_1401f4ee0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_1401f4ef0(undefined8 param_1,longlong param_2)

{
  FUN_1400a2f10(param_2 + 0xa8);
  return;
}



void Unwind_1401f4f00(undefined8 param_1,longlong param_2)

{
  FUN_1400a1e20(param_2 + 0x160);
  return;
}



void Unwind_1401f4f10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1401f4f20(undefined8 param_1,longlong param_2)

{
  FUN_140194bc0(param_2 + 0x78);
  return;
}



void Unwind_1401f4f30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe8);
  return;
}



void Unwind_1401f4f40(undefined8 param_1,longlong param_2)

{
  FUN_140194450(param_2 + 0x58);
  return;
}



void Unwind_1401f4f50(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x150),*(undefined8 *)(param_2 + 0x148));
  return;
}



void Unwind_1401f4f80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x48);
  return;
}



void Unwind_1401f4f90(undefined8 param_1,longlong param_2)

{
  FUN_140194450(param_2 + 0x50);
  return;
}



void Unwind_1401f4fa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401f4fb0(undefined8 param_1,longlong param_2)

{
  FUN_1400a2f10(param_2 + 0x70);
  return;
}



void Unwind_1401f4fc0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1e20(param_2 + 0x270);
  return;
}



void Unwind_1401f4fd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_1401f4fe0(undefined8 param_1,longlong param_2)

{
  FUN_1400a2f10(param_2 + 0xe0);
  return;
}



void Unwind_1401f4ff0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x130);
  return;
}



void Unwind_1401f5000(undefined8 param_1,longlong param_2)

{
  FUN_140169750(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f5010(undefined8 param_1,longlong param_2)

{
  FUN_14018a2d0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401f5020(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401f5030(undefined8 param_1,longlong param_2)

{
  FUN_1400aaa90(*(longlong *)(param_2 + 0x40) + 0x58);
  return;
}



void Unwind_1401f5040(undefined8 param_1,longlong param_2)

{
  FUN_140194bc0(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_1401f5060(undefined8 param_1,longlong param_2)

{
  FUN_140169750(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f5070(undefined8 param_1,longlong param_2)

{
  FUN_14018a2d0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401f5080(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401f5090(undefined8 param_1,longlong param_2)

{
  FUN_140169750(param_2 + 0x48);
  return;
}



void Unwind_1401f50a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401f50b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f50c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x90),0x400);
  return;
}



void Unwind_1401f50e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x90),0x400);
  return;
}



void Unwind_1401f5100(undefined8 param_1,longlong param_2)

{
  FUN_1400aaa90(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_1401f5110(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x60) + 0x30);
  return;
}



void Unwind_1401f5120(undefined8 param_1,longlong param_2)

{
  FUN_140195890(*(longlong *)(param_2 + 0x60) + 0x68);
  return;
}



void Unwind_1401f5130(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f5140(undefined8 param_1,longlong param_2)

{
  FUN_1400aaa90(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f5150(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1401f5160(undefined8 param_1,longlong param_2)

{
  FUN_140195890(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_1401f5170(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x30);
  return;
}



void Unwind_1401f5180(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x58);
  return;
}



void Unwind_1401f5190(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(param_2 + 0x60);
  return;
}



undefined * Catch_1401f51a0(undefined8 param_1,longlong param_2)

{
  (**(code **)(**(longlong **)(param_2 + 0x78) + 8))();
  return &DAT_140197c22;
}



void Unwind_1401f51d0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x30);
  return;
}



void Unwind_1401f51e0(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x58);
  return;
}



void Unwind_1401f51f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(param_2 + 0x60);
  return;
}



undefined * Catch_1401f5200(undefined8 param_1,longlong param_2)

{
  (**(code **)(**(longlong **)(param_2 + 0x70) + 8))();
  return &DAT_140197ed6;
}



undefined * Catch_1401f5230(undefined8 param_1,longlong param_2)

{
  (**(code **)(**(longlong **)(param_2 + 0x30) + 8))();
  return &DAT_1401981cd;
}



undefined * Catch_1401f5260(undefined8 param_1,longlong param_2)

{
  (**(code **)(**(longlong **)(param_2 + 0x38) + 8))();
  return &DAT_1401983f2;
}



void Unwind_1401f5290(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f52a0(void)

{
  DAT_140319000 = DAT_140319000 & 0xfffffffe;
  return;
}



void Unwind_1401f52c0(undefined8 param_1,longlong param_2)

{
  FUN_140003270(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f52d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14018a150(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401f52e0(undefined8 param_1,longlong param_2)

{
  FUN_140198440(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1401f52f0(undefined8 param_1,longlong param_2)

{
  FUN_140142660(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_1401f5300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_1401f5310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_1401f5320(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140186ed0(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_1401f5330(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x40) + 0x98);
  return;
}



void Unwind_1401f5350(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x158);
  return;
}



void Unwind_1401f5360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_1401f5370(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f5380(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1401f5390(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f53a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f53b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_1401f53c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f53d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401f53e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401f53f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1401f5400(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f5410(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f5420(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f5430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_1401f5440(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f5450(undefined8 param_1,longlong param_2)

{
  FUN_140003270(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1401f5460(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14018a150(*(longlong *)(param_2 + 0x70) + 0x10);
  return;
}



void Unwind_1401f5470(undefined8 param_1,longlong param_2)

{
  FUN_140198440(*(longlong *)(param_2 + 0x70) + 0x30);
  return;
}



void Unwind_1401f5480(undefined8 param_1,longlong param_2)

{
  FUN_140142660(*(longlong *)(param_2 + 0x70) + 0x48);
  return;
}



void Unwind_1401f5490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x70) + 0x50);
  return;
}



void Unwind_1401f54a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x70) + 0x60);
  return;
}



void Unwind_1401f54b0(undefined8 param_1,longlong param_2)

{
  FUN_140186ed0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401f54c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140186ed0(*(longlong *)(param_2 + 0x70) + 0x68);
  return;
}



void Unwind_1401f54d0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x70) + 0x98);
  return;
}



void Unwind_1401f54f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x78));
  return;
}



void Unwind_1401f5500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401f5510(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x38);
  return;
}



undefined8 Catch_All_1401f5520(void)

{
  return 0x14019b633;
}



void Unwind_1401f5540(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f5550(undefined8 param_1,longlong param_2)

{
  FUN_1401594a0(param_2 + 0x90);
  return;
}



void Unwind_1401f5560(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x68),0xd0);
  return;
}



void Unwind_1401f5580(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x60) & 1) != 0) {
    *(uint *)(param_2 + 0x60) = *(uint *)(param_2 + 0x60) & 0xfffffffe;
    FUN_14015bec0(*(undefined8 *)(param_2 + 0x58));
  }
  return;
}



void Unwind_1401f55b0(undefined8 param_1,longlong param_2)

{
  FUN_140141cd0(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_1401f55c0(undefined8 param_1,longlong param_2)

{
  FUN_1401a7910(*(longlong *)(param_2 + 0x80) + 8);
  return;
}



void Unwind_1401f55d0(undefined8 param_1,longlong param_2)

{
  FUN_140141c50(*(longlong *)(param_2 + 0x80) + 0x38);
  return;
}



void Unwind_1401f55e0(undefined8 param_1,longlong param_2)

{
  FUN_14019ab60(*(longlong *)(param_2 + 0x80) + 0x110);
  return;
}



void Unwind_1401f5600(undefined8 param_1,longlong param_2)

{
  FUN_14015f6a0(*(longlong *)(param_2 + 0x80) + 0x40);
  return;
}



void Unwind_1401f5610(undefined8 param_1,longlong param_2)

{
  FUN_1401a1430(*(longlong *)(param_2 + 0x80) + 0xc0);
  return;
}



void Unwind_1401f5630(undefined8 param_1,longlong param_2)

{
  FUN_14019a8a0(*(longlong *)(param_2 + 0x80) + 0x108);
  return;
}



void Unwind_1401f5650(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x80) + 0x128);
  return;
}



void Unwind_1401f5670(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x80) + 0x1f0);
  return;
}



void Unwind_1401f5690(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x80) + 0x1f8);
  return;
}



void Unwind_1401f56b0(undefined8 param_1,longlong param_2)

{
  FUN_14019acd0(*(longlong *)(param_2 + 0x80) + 0x228);
  return;
}



void Unwind_1401f56d0(undefined8 param_1,longlong param_2)

{
  FUN_140022590(*(longlong *)(param_2 + 0x80) + 0x240);
  return;
}



void Unwind_1401f56f0(undefined8 param_1,longlong param_2)

{
  FUN_14015f850(*(longlong *)(param_2 + 0x80) + 0x268);
  return;
}



void Unwind_1401f5710(undefined8 param_1,longlong param_2)

{
  FUN_140141dc0(*(longlong *)(param_2 + 0x80) + 0x288);
  return;
}



void Unwind_1401f5730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14019b620(*(longlong *)(param_2 + 0x80) + 0x6a0);
  return;
}



void Unwind_1401f5750(undefined8 param_1,longlong param_2)

{
  FUN_1401a2e80(*(longlong *)(param_2 + 0x80) + 0x700);
  return;
}



void Unwind_1401f5770(undefined8 param_1,longlong param_2)

{
  FUN_14019a990(*(longlong *)(param_2 + 0x80) + 0x750);
  return;
}



void Unwind_1401f5790(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(*(longlong *)(param_2 + 0x80) + 0x760);
  return;
}



void Unwind_1401f57b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x88));
  return;
}



void Unwind_1401f57c0(undefined8 param_1,longlong param_2)

{
  FUN_140141cd0(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1401f57d0(undefined8 param_1,longlong param_2)

{
  FUN_1401a7910(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_1401f57e0(undefined8 param_1,longlong param_2)

{
  FUN_140141c50(*(longlong *)(param_2 + 0x60) + 0x38);
  return;
}



void Unwind_1401f57f0(undefined8 param_1,longlong param_2)

{
  FUN_14019ab60(*(longlong *)(param_2 + 0x60) + 0x110);
  return;
}



void Unwind_1401f5810(undefined8 param_1,longlong param_2)

{
  FUN_14015f6a0(*(longlong *)(param_2 + 0x60) + 0x40);
  return;
}



void Unwind_1401f5820(undefined8 param_1,longlong param_2)

{
  FUN_1401a1430(*(longlong *)(param_2 + 0x60) + 0xc0);
  return;
}



void Unwind_1401f5840(undefined8 param_1,longlong param_2)

{
  FUN_14019a8a0(*(longlong *)(param_2 + 0x60) + 0x108);
  return;
}



void Unwind_1401f5860(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x60) + 0x128);
  return;
}



void Unwind_1401f5880(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x60) + 0x1f0);
  return;
}



void Unwind_1401f58a0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x60) + 0x1f8);
  return;
}



void Unwind_1401f58c0(undefined8 param_1,longlong param_2)

{
  FUN_14019acd0(*(longlong *)(param_2 + 0x60) + 0x228);
  return;
}



void Unwind_1401f58e0(undefined8 param_1,longlong param_2)

{
  FUN_140022590(*(longlong *)(param_2 + 0x60) + 0x240);
  return;
}



void Unwind_1401f5900(undefined8 param_1,longlong param_2)

{
  FUN_14015f850(*(longlong *)(param_2 + 0x60) + 0x268);
  return;
}



void Unwind_1401f5920(undefined8 param_1,longlong param_2)

{
  FUN_140141dc0(*(longlong *)(param_2 + 0x60) + 0x288);
  return;
}



void Unwind_1401f5940(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14019b620(*(longlong *)(param_2 + 0x60) + 0x6a0);
  return;
}



void Unwind_1401f5960(undefined8 param_1,longlong param_2)

{
  FUN_1401a2e80(*(longlong *)(param_2 + 0x60) + 0x700);
  return;
}



void Unwind_1401f5980(undefined8 param_1,longlong param_2)

{
  FUN_14019a990(*(longlong *)(param_2 + 0x60) + 0x750);
  return;
}



void Unwind_1401f59a0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(*(longlong *)(param_2 + 0x60) + 0x760);
  return;
}



void Unwind_1401f59c0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x68);
  return;
}



void Unwind_1401f59d0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x30);
  return;
}



void Unwind_1401f59e0(undefined8 param_1,longlong param_2)

{
  FUN_14015c560(param_2 + 0x28);
  return;
}



void Unwind_1401f59f0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x170),*(undefined8 *)(param_2 + 0x160));
  return;
}



void Unwind_1401f5a20(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(*(longlong *)(param_2 + 0x178) + 8);
  return;
}



void Unwind_1401f5a30(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x30);
  return;
}



void Unwind_1401f5a40(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x160) + 8);
  return;
}



void Unwind_1401f5a50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14019c8f0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f5a60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14019c8f0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401f5a70(undefined8 param_1,longlong param_2)

{
  FUN_14019c520(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f5a80(undefined8 param_1,longlong param_2)

{
  FUN_14019ddc0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401f5a90(undefined8 param_1,longlong param_2)

{
  FUN_14019c590(*(longlong *)(param_2 + 0x40) + 0x198);
  return;
}



void Unwind_1401f5ab0(undefined8 param_1,longlong param_2)

{
  FUN_14016a7f0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f5ac0(undefined8 param_1,longlong param_2)

{
  FUN_14019c590(*(longlong *)(param_2 + 0x40) + 0x678);
  return;
}



void Unwind_1401f5ae0(undefined8 param_1,longlong param_2)

{
  FUN_14019c500(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f5af0(undefined8 param_1,longlong param_2)

{
  FUN_14019c620(*(undefined8 *)(param_2 + 0x50));
  return;
}



undefined8 Catch_All_1401f5b00(void)

{
  return 0x14019e053;
}



void Unwind_1401f5b20(undefined8 param_1,longlong param_2)

{
  FUN_1401a4f10(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f5b30(undefined8 param_1,longlong param_2)

{
  FUN_1401a4f10(*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_1401f5b40(undefined8 param_1,longlong param_2)

{
  FUN_14019c520(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_1401f5b50(undefined8 param_1,longlong param_2)

{
  FUN_14019ddc0(*(longlong *)(param_2 + 0x50) + 0x18);
  return;
}



void Unwind_1401f5b60(undefined8 param_1,longlong param_2)

{
  FUN_14019c590(*(longlong *)(param_2 + 0x50) + 0x198);
  return;
}



void Catch_All_1401f5b80(undefined8 param_1,longlong param_2)

{
  FUN_1401455c0(*(undefined8 *)(param_2 + 0x40),*(undefined8 *)(param_2 + 0x48),0);
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f5bb0(undefined8 param_1,longlong param_2)

{
  FUN_1401461b0(*(undefined8 *)(param_2 + 0x50),*(undefined8 *)(param_2 + 0x58),0);
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401f5be0(undefined8 param_1,longlong param_2)

{
  FUN_14019c520(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401f5bf0(undefined8 param_1,longlong param_2)

{
  FUN_14019ddc0(*(longlong *)(param_2 + 0xb0) + 0x18);
  return;
}



void Unwind_1401f5c00(undefined8 param_1,longlong param_2)

{
  FUN_14019c590(*(longlong *)(param_2 + 0xb0) + 0x198);
  return;
}



void Unwind_1401f5c20(undefined8 param_1,longlong param_2)

{
  FUN_14019c520(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1401f5c30(undefined8 param_1,longlong param_2)

{
  FUN_14019ddc0(*(longlong *)(param_2 + 0x90) + 0x18);
  return;
}



void Unwind_1401f5c40(undefined8 param_1,longlong param_2)

{
  FUN_14019c590(*(longlong *)(param_2 + 0x90) + 0x198);
  return;
}



void Unwind_1401f5c60(undefined8 param_1,longlong param_2)

{
  FUN_14019e040(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401f5c70(undefined8 param_1,longlong param_2)

{
  FUN_14019e040(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401f5c80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f5c90(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x88),*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_1401f5cc0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x38);
  return;
}



void Unwind_1401f5cd0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f5ce0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f5cf0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f5d00(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f5d10(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f5d20(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f5d30(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f5d40(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f5d50(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f5d60(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f5d70(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f5d80(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f5d90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f5da0(undefined8 param_1,longlong param_2)

{
  FUN_14019e040(*(undefined8 *)(param_2 + 0x130));
  return;
}



void Unwind_1401f5db0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401f5dc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f5dd0(undefined8 param_1,longlong param_2)

{
  FUN_14019e040(*(undefined8 *)(param_2 + 0x138));
  return;
}



void Unwind_1401f5de0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401f5df0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14019c9e0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f5e00(undefined8 param_1,longlong param_2)

{
  FUN_1401a0ba0(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_1401f5e10(undefined8 param_1,longlong param_2)

{
  FUN_14019dee0(*(longlong *)(param_2 + 0x40) + 0x80);
  return;
}



void Unwind_1401f5e30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14019c9e0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f5e40(undefined8 param_1,longlong param_2)

{
  FUN_1401a0ba0(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_1401f5e50(undefined8 param_1,longlong param_2)

{
  FUN_14019dee0(*(longlong *)(param_2 + 0x40) + 0x80);
  return;
}



void Unwind_1401f5e70(undefined8 param_1,longlong param_2)

{
  FUN_1401a4f10(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401f5e80(undefined8 param_1,longlong param_2)

{
  FUN_1401a0b70(*(longlong *)(param_2 + 0x80) + 8);
  return;
}



void Unwind_1401f5e90(void)

{
  FUN_1400a1cd0(&DAT_140319128);
  return;
}



void Unwind_1401f5ea0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f5eb0(undefined8 param_1,longlong param_2)

{
  FUN_1401a4110(*(longlong *)(param_2 + 0x50) + 0x48);
  return;
}



void Unwind_1401f5ec0(undefined8 param_1,longlong param_2)

{
  FUN_1401c1130(*(longlong *)(param_2 + 0x50) + 200);
  return;
}



void Unwind_1401f5ee0(undefined8 param_1,longlong param_2)

{
  FUN_14018a2f0(*(longlong *)(param_2 + 0x50) + 0x110);
  return;
}



void Unwind_1401f5f00(undefined8 param_1,longlong param_2)

{
  FUN_1401a4110(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_1401f5f10(undefined8 param_1,longlong param_2)

{
  FUN_1401c1130(*(longlong *)(param_2 + 0x40) + 200);
  return;
}



void Unwind_1401f5f30(undefined8 param_1,longlong param_2)

{
  FUN_14018a2f0(*(longlong *)(param_2 + 0x40) + 0x110);
  return;
}



void Unwind_1401f5f50(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x130);
  return;
}



void Unwind_1401f5f60(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x80);
  return;
}



void Unwind_1401f5f70(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x80);
  return;
}



void Unwind_1401f5f80(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x28) + 8);
  return;
}



void Unwind_1401f5f90(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xdb0);
  return;
}



void Unwind_1401f5fb0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x1a0);
  return;
}



void Unwind_1401f5fc0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0xf0);
  return;
}



void Unwind_1401f5fd0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0xf0);
  return;
}



void Unwind_1401f5fe0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401f5ff0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_1401f6000(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f6010(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xe20);
  return;
}



void Unwind_1401f6030(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x28) & 1) != 0) {
    *(uint *)(param_2 + 0x28) = *(uint *)(param_2 + 0x28) & 0xfffffffe;
    thunk_FUN_14000c2a0(*(undefined8 *)(param_2 + 0x40));
  }
  return;
}



void Unwind_1401f6060(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x20);
  return;
}



void Unwind_1401f6070(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401f6080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x20);
  return;
}



void Unwind_1401f6090(undefined8 param_1,longlong param_2)

{
  FUN_1400a1e20(param_2 + 0x70);
  return;
}



void Unwind_1401f60a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401f60b0(undefined8 param_1,longlong param_2)

{
  FUN_140141c50(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f60c0(undefined8 param_1,longlong param_2)

{
  FUN_1401a17b0(*(longlong *)(param_2 + 0x40) + 0x90);
  return;
}



void Unwind_1401f60e0(undefined8 param_1,longlong param_2)

{
  FUN_140169360(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f60f0(undefined8 param_1,longlong param_2)

{
  FUN_1401693a0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401f6100(undefined8 param_1,longlong param_2)

{
  FUN_1401a1430(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_1401f6110(undefined8 param_1,longlong param_2)

{
  FUN_14019a8a0(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_1401f6130(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x40) + 0xa8);
  return;
}



void Unwind_1401f6150(undefined8 param_1,longlong param_2)

{
  FUN_140142660(*(longlong *)(param_2 + 0x40) + 0xe0);
  return;
}



void Unwind_1401f6170(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(*(longlong *)(param_2 + 0x40) + 0x150);
  return;
}



void Unwind_1401f6190(undefined8 param_1,longlong param_2)

{
  FUN_1401a17e0(*(longlong *)(param_2 + 0x40) + 0x168);
  return;
}



void Unwind_1401f61b0(undefined8 param_1,longlong param_2)

{
  FUN_1401a1810(*(longlong *)(param_2 + 0x40) + 0x170);
  return;
}



void Unwind_1401f61d0(undefined8 param_1,longlong param_2)

{
  FUN_1401a18a0(*(longlong *)(param_2 + 0x40) + 0x178);
  return;
}



void Unwind_1401f61f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x40);
  return;
}



void Unwind_1401f6200(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x40);
  return;
}



void Unwind_1401f6210(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd60);
  return;
}



void Unwind_1401f6230(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xe0);
  return;
}



void Unwind_1401f6240(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd60);
  return;
}



void Unwind_1401f6260(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f6270(undefined8 param_1,longlong param_2)

{
  FUN_140141c50(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_1401f6280(undefined8 param_1,longlong param_2)

{
  FUN_1401a17b0(*(longlong *)(param_2 + 0x80) + 0x90);
  return;
}



void Unwind_1401f62a0(undefined8 param_1,longlong param_2)

{
  FUN_140169360(*(longlong *)(param_2 + 0x80) + 8);
  return;
}



void Unwind_1401f62b0(undefined8 param_1,longlong param_2)

{
  FUN_1401693a0(*(longlong *)(param_2 + 0x80) + 0x10);
  return;
}



void Unwind_1401f62c0(undefined8 param_1,longlong param_2)

{
  FUN_1401a1430(*(longlong *)(param_2 + 0x80) + 0x40);
  return;
}



void Unwind_1401f62d0(undefined8 param_1,longlong param_2)

{
  FUN_14019a8a0(*(longlong *)(param_2 + 0x80) + 0x88);
  return;
}



void Unwind_1401f62f0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x80) + 0xa8);
  return;
}



void Unwind_1401f6310(undefined8 param_1,longlong param_2)

{
  FUN_140142660(*(longlong *)(param_2 + 0x80) + 0xe0);
  return;
}



void Unwind_1401f6330(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(*(longlong *)(param_2 + 0x80) + 0x150);
  return;
}



void Unwind_1401f6350(undefined8 param_1,longlong param_2)

{
  FUN_1401a17e0(*(longlong *)(param_2 + 0x80) + 0x168);
  return;
}



void Unwind_1401f6370(undefined8 param_1,longlong param_2)

{
  FUN_1401a1810(*(longlong *)(param_2 + 0x80) + 0x170);
  return;
}



void Unwind_1401f6390(undefined8 param_1,longlong param_2)

{
  FUN_1401a18a0(*(longlong *)(param_2 + 0x80) + 0x178);
  return;
}



void Unwind_1401f63b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x88));
  return;
}



void Unwind_1401f63c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x88),0x400);
  return;
}



void Unwind_1401f63e0(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x88);
  return;
}



void Unwind_1401f63f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x88));
  return;
}



void Unwind_1401f6400(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0x30);
  return;
}



void Unwind_1401f6410(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f6420(undefined8 param_1,longlong param_2)

{
  FUN_14018a2d0(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_1401f6430(undefined8 param_1,longlong param_2)

{
  FUN_1400acf90(param_2 + 0x60);
  return;
}



void Unwind_1401f6440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400acf90(param_2 + 0x60);
  return;
}



void Unwind_1401f6450(undefined8 param_1,longlong param_2)

{
  FUN_1401a31c0(param_2 + 0x40);
  return;
}



void Unwind_1401f6460(undefined8 param_1,longlong param_2)

{
  FUN_1401a3190(param_2 + 0x30);
  return;
}



void Unwind_1401f6470(undefined8 param_1,longlong param_2)

{
  FUN_140155530(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f6480(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401f6490(undefined8 param_1,longlong param_2)

{
  FUN_140149590(param_2 + 0x80);
  return;
}



void Unwind_1401f64a0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x70);
  return;
}



void Unwind_1401f64b0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xcf0);
  return;
}



void Unwind_1401f64d0(undefined8 param_1,longlong param_2)

{
  FUN_1401a3b70(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f64e0(undefined8 param_1,longlong param_2)

{
  FUN_1401a4f30(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f64f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x38);
  return;
}



void Unwind_1401f6500(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x20);
  return;
}



void Unwind_1401f6510(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(param_2 + 0x28);
  return;
}



void Unwind_1401f6520(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x160) + 8);
  return;
}



void Unwind_1401f6530(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(param_2 + 0x28);
  return;
}



void Unwind_1401f6540(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x160) + 8);
  return;
}



void Unwind_1401f6550(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(param_2 + 0x28);
  return;
}



void Unwind_1401f6560(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x160) + 8);
  return;
}



void Unwind_1401f6570(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(param_2 + 0x28);
  return;
}



void Unwind_1401f6580(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x160) + 8);
  return;
}



void Unwind_1401f6590(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(param_2 + 0x28);
  return;
}



void Unwind_1401f65a0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x160) + 8);
  return;
}



void Unwind_1401f65b0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(param_2 + 0x28);
  return;
}



void Unwind_1401f65c0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x160) + 8);
  return;
}



void Unwind_1401f65d0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(param_2 + 0x28);
  return;
}



void Unwind_1401f65e0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x160) + 8);
  return;
}



void Unwind_1401f65f0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x80);
  return;
}



void Unwind_1401f6600(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x170) + 8);
  return;
}



void Unwind_1401f6610(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(param_2 + 0x28);
  return;
}



undefined8 Catch_All_1401f6620(void)

{
  return 0x1401a4f23;
}



void Unwind_1401f6640(undefined8 param_1,longlong param_2)

{
  FUN_1401a49e0(*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_1401f6650(undefined8 param_1,longlong param_2)

{
  FUN_1401a49e0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f6660(undefined8 param_1,longlong param_2)

{
  FUN_1401a4f10(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401f6670(undefined8 param_1,longlong param_2)

{
  FUN_1401a4f30(*(longlong *)(param_2 + 0x40) + 0x70);
  return;
}



undefined * Catch_1401f6680(undefined8 param_1,longlong param_2)

{
  (**(code **)(**(longlong **)(param_2 + 0x28) + 8))();
  return &DAT_1401a5b20;
}



void Unwind_1401f66b0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x20);
  return;
}



undefined * Catch_1401f66c0(undefined8 param_1,longlong param_2)

{
  (**(code **)(**(longlong **)(param_2 + 0x48) + 8))();
  return &DAT_1401a5da8;
}



void Unwind_1401f66f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f6700(void)

{
  DAT_14031a200 = DAT_14031a200 & 0xfffffffe;
  return;
}



void Unwind_1401f6720(undefined8 param_1,longlong param_2)

{
  FUN_1401a5f40(param_2 + 0x108);
  return;
}



void Unwind_1401f6730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_1401f6740(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x78);
  return;
}



void Unwind_1401f6750(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x50);
  return;
}



void Unwind_1401f6760(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401f6770(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401f6780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_1401f6790(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x78);
  return;
}



void Unwind_1401f67a0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x50);
  return;
}



void Unwind_1401f67b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401f67c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401f67d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_1401f67e0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x78);
  return;
}



void Unwind_1401f67f0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x50);
  return;
}



void Unwind_1401f6800(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401f6810(undefined8 param_1,longlong param_2)

{
  FUN_140148f60(*(longlong *)(param_2 + 0x70) + 8);
  return;
}



void Unwind_1401f6820(undefined8 param_1,longlong param_2)

{
  FUN_140143380(*(longlong *)(param_2 + 0x70) + 0x60);
  return;
}



void Unwind_1401f6830(undefined8 param_1,longlong param_2)

{
  FUN_140144e80(*(longlong *)(param_2 + 0x70) + 200);
  return;
}



void Unwind_1401f6850(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x68),0x60);
  return;
}



void Unwind_1401f6870(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x60) & 1) != 0) {
    *(uint *)(param_2 + 0x60) = *(uint *)(param_2 + 0x60) & 0xfffffffe;
    FUN_14015bfc0(*(undefined8 *)(param_2 + 0x58));
  }
  return;
}



void Unwind_1401f68a0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x20);
  return;
}



void Unwind_1401f68b0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xf8) + 8);
  return;
}



void Unwind_1401f68c0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xf8) + 8);
  return;
}



void Unwind_1401f68d0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xf8) + 8);
  return;
}



void Unwind_1401f68e0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f68f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f6900(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_1401f6910(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_1401f6920(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14018ac00(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f6930(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xd50);
  return;
}



void Unwind_1401f6940(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x19d0);
  return;
}



void Unwind_1401f6960(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xc0);
  return;
}



void Unwind_1401f6970(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd40);
  return;
}



void Unwind_1401f6990(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x80) & 1) != 0) {
    *(uint *)(param_2 + 0x80) = *(uint *)(param_2 + 0x80) & 0xfffffffe;
    FUN_14003d130(*(undefined8 *)(param_2 + 0x88));
  }
  return;
}



void Unwind_1401f69c0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x50) & 1) != 0) {
    *(uint *)(param_2 + 0x50) = *(uint *)(param_2 + 0x50) & 0xfffffffe;
    FUN_140152f30(*(undefined8 *)(param_2 + 0x58));
  }
  return;
}



void Unwind_1401f69f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x28);
  return;
}



void Unwind_1401f6a00(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(param_2 + 0x30);
  return;
}



void Unwind_1401f6a10(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x28);
  return;
}



void Unwind_1401f6a20(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(param_2 + 0x30);
  return;
}



void Unwind_1401f6a30(undefined8 param_1,longlong param_2)

{
  FUN_140152f30(param_2 + 0x28);
  return;
}



void Unwind_1401f6a40(undefined8 param_1,longlong param_2)

{
  FUN_140152f30(param_2 + 0x28);
  return;
}



void Unwind_1401f6a50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f6a60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f6a70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f6a80(void)

{
  DAT_14031a2d0 = DAT_14031a2d0 & 0xfffffffe;
  return;
}



void Unwind_1401f6aa0(undefined8 param_1,longlong param_2)

{
  FUN_1401a9010(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f6ab0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_1401f6ac0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f6ad0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x28);
  return;
}



void Unwind_1401f6ae0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_1401f6af0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0xf8);
  return;
}



void Unwind_1401f6b00(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x60);
  return;
}



void Unwind_1401f6b10(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_1401f6b20(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_1401f6b30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_1401f6b40(undefined8 param_1,longlong param_2)

{
  FUN_1401a9010(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_1401f6b50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401f6b60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f6b70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f6b80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401f6b90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401f6ba0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f6bb0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x30);
  return;
}



void Unwind_1401f6bc0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x30);
  return;
}



void Unwind_1401f6bd0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x80);
  return;
}



void Unwind_1401f6be0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xd10);
  return;
}



void Unwind_1401f6bf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401f6c00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401f6c10(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x70) + 8);
  return;
}



void Unwind_1401f6c20(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x20);
  return;
}



void Unwind_1401f6c30(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x50);
  return;
}



void Unwind_1401f6c40(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_1401f6c50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f6c60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401f6c70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f6c80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401f6c90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_1401f6ca0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x38);
  return;
}



void Unwind_1401f6cb0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x38);
  return;
}



void Unwind_1401f6cc0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd70);
  return;
}



void Unwind_1401f6ce0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xf0);
  return;
}



void Unwind_1401f6cf0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd70);
  return;
}



void Unwind_1401f6d10(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x28) + 8);
  return;
}



void Unwind_1401f6d20(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x40);
  return;
}



void Unwind_1401f6d30(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x40);
  return;
}



void Unwind_1401f6d40(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x128) + 8);
  return;
}



void Unwind_1401f6d50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f6d60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401f6d70(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x60);
  return;
}



void Unwind_1401f6d80(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x70),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1401f6da0(undefined8 param_1,longlong param_2)

{
  FUN_14016ab70(param_2 + 0x90);
  return;
}



void Unwind_1401f6db0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x68);
  return;
}



void Unwind_1401f6dc0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x40);
  return;
}



void Unwind_1401f6dd0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x40);
  return;
}



void Unwind_1401f6de0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0xc0);
  return;
}



void Unwind_1401f6df0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x1d8) + 8);
  return;
}



void Unwind_1401f6e00(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x1d8) + 8);
  return;
}



void Unwind_1401f6e10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_1401f6e20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x160);
  return;
}



void Unwind_1401f6e30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_1401f6e40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x150);
  return;
}



void Unwind_1401f6e50(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xc0);
  return;
}



void Unwind_1401f6e60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401f6e70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1b0);
  return;
}



void Unwind_1401f6e80(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x70);
  return;
}



void Unwind_1401f6e90(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x98);
  return;
}



undefined * Catch_1401f6ea0(undefined8 param_1,longlong param_2)

{
  int *piVar1;
  longlong lVar2;
  undefined *puVar3;
  longlong *plVar4;
  undefined8 uVar5;
  
  FUN_1400a3440();
  *(undefined **)(param_2 + 0xe8) = PTR_DAT_1402f8010;
  lVar2 = *(longlong *)(param_2 + 0x28);
  FUN_140182b30(*(undefined8 *)(lVar2 + 0x108),5,3,param_2 + 0xe8);
  puVar3 = *(undefined **)(param_2 + 0xe8);
  if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1402f8010)) &&
     (puVar3 + -8 != (undefined *)0x0)) {
    uVar5 = FUN_1400a3440();
    *(undefined8 *)(param_2 + 0x1d0) = uVar5;
    FUN_1400a1c30(uVar5);
    *(undefined1 *)(param_2 + 0x1d8) = 1;
    piVar1 = (int *)(puVar3 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar3 + -8);
    }
    FUN_1400d1290(uVar5);
  }
  if (*(longlong *)(*(longlong *)(lVar2 + 0x108) + 0x1580) != 0) {
    plVar4 = *(longlong **)(*(longlong *)(lVar2 + 0x108) + 0x1580);
    (**(code **)(*plVar4 + 0x20))(plVar4,*(undefined8 *)(param_2 + 0x1f0));
  }
  FUN_1401a8930(lVar2,4);
  return &DAT_1401ac7bc;
}



void Unwind_1401f6f80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_1401f6f90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1d0);
  return;
}



void Unwind_1401f6fa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x28);
  return;
}



void Unwind_1401f6fb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1c0);
  return;
}



void Unwind_1401f6fc0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x100);
  return;
}



void Unwind_1401f6fd0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x128);
  return;
}



undefined * Catch_1401f6fe0(undefined8 param_1,longlong param_2)

{
  int *piVar1;
  longlong lVar2;
  undefined *puVar3;
  longlong *plVar4;
  undefined8 uVar5;
  
  FUN_1400a3440();
  *(undefined **)(param_2 + 0xf0) = PTR_DAT_1402f8010;
  lVar2 = *(longlong *)(param_2 + 0x28);
  FUN_140182b30(*(undefined8 *)(lVar2 + 0x108),5,3,param_2 + 0xf0);
  puVar3 = *(undefined **)(param_2 + 0xf0);
  if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1402f8010)) &&
     (puVar3 + -8 != (undefined *)0x0)) {
    uVar5 = FUN_1400a3440();
    *(undefined8 *)(param_2 + 0x1f8) = uVar5;
    FUN_1400a1c30(uVar5);
    *(undefined1 *)(param_2 + 0x200) = 1;
    piVar1 = (int *)(puVar3 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_1400a3530(puVar3 + -8);
    }
    FUN_1400d1290(uVar5);
  }
  if (*(longlong *)(*(longlong *)(lVar2 + 0x108) + 0x1580) != 0) {
    plVar4 = *(longlong **)(*(longlong *)(lVar2 + 0x108) + 0x1580);
    (**(code **)(*plVar4 + 0x20))(plVar4,*(undefined8 *)(param_2 + 0x1e0));
  }
  FUN_1401a8930(lVar2,4);
  return &DAT_1401ac77c;
}



void Unwind_1401f70c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf0);
  return;
}



void Unwind_1401f70d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1f8);
  return;
}



void Unwind_1401f70e0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x30);
  return;
}



void Unwind_1401f70f0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x30);
  return;
}



void Unwind_1401f7100(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x210);
  return;
}



void Unwind_1401f7110(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xf8) + 8);
  return;
}



void Unwind_1401f7120(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x20);
  return;
}



void Unwind_1401f7130(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x20);
  return;
}



void Unwind_1401f7140(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd30);
  return;
}



void Unwind_1401f7160(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xb0);
  return;
}



void Unwind_1401f7170(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd30);
  return;
}



void Unwind_1401f7190(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_1401f71a0(undefined8 param_1,longlong param_2)

{
  FUN_14018eb10(param_2 + 0x30);
  return;
}



void Unwind_1401f71b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x110);
  return;
}



void Unwind_1401f71c0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x68);
  return;
}



void Unwind_1401f71d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401f71e0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0xb8);
  return;
}



void Unwind_1401f71f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_1401f7200(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x38);
  return;
}



void Unwind_1401f7210(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x60);
  return;
}



void Unwind_1401f7220(undefined8 param_1,longlong param_2)

{
  FUN_140153350(param_2 + 0x58);
  return;
}



void Unwind_1401f7230(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x130);
  return;
}



void Unwind_1401f7240(undefined8 param_1,longlong param_2)

{
  FUN_14018eb10(param_2 + 0x90);
  return;
}



void Unwind_1401f7250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401f7260(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xe8);
  return;
}



void Unwind_1401f7270(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1401f7280(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x60);
  return;
}



void Unwind_1401f7290(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_1401f72a0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_1401f72b0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x80);
  return;
}



void Unwind_1401f72c0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x170) + 8);
  return;
}



void Unwind_1401f72d0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x38);
  return;
}



void Unwind_1401f72e0(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x48);
  return;
}



void Unwind_1401f72f0(undefined8 param_1,longlong param_2)

{
  FUN_140153350(param_2 + 0x40);
  return;
}



void Unwind_1401f7300(undefined8 param_1,longlong param_2)

{
  FUN_14018eb10(param_2 + 0xa8);
  return;
}



void Unwind_1401f7310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401f7320(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xd8);
  return;
}



void Unwind_1401f7330(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_1401f7340(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x48);
  return;
}



void Unwind_1401f7350(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x118) + 8);
  return;
}



void Unwind_1401f7360(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x170) + 8);
  return;
}



void Unwind_1401f7370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_1401f7380(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x48);
  return;
}



void Unwind_1401f7390(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f73a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xa0));
  return;
}



void Unwind_1401f73b0(undefined8 param_1,longlong param_2)

{
  FUN_140141c90(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f73c0(undefined8 param_1,longlong param_2)

{
  FUN_1401a8870(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f73d0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401f73e0(undefined8 param_1,longlong param_2)

{
  FUN_140149590(*(longlong *)(param_2 + 0x40) + 0x78);
  return;
}



void Unwind_1401f73f0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_1401f7410(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x40) + 0x1c8);
  return;
}



void Unwind_1401f7430(undefined8 param_1,longlong param_2)

{
  FUN_1401a4f30(*(longlong *)(param_2 + 0x40) + 0x208);
  return;
}



void Unwind_1401f7450(undefined8 param_1,longlong param_2)

{
  FUN_1401789b0(*(longlong *)(param_2 + 0x40) + 0x228);
  return;
}



void Unwind_1401f7470(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(*(longlong *)(param_2 + 0x40) + 0x290);
  return;
}



void Unwind_1401f7490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401a9120(*(longlong *)(param_2 + 0x40) + 0x298);
  return;
}



void Unwind_1401f74b0(undefined8 param_1,longlong param_2)

{
  FUN_1401a9030(*(longlong *)(param_2 + 0x40) + 0x2b0);
  return;
}



void Unwind_1401f74d0(undefined8 param_1,longlong param_2)

{
  FUN_1401a92c0(*(longlong *)(param_2 + 0x40) + 0x2b8);
  return;
}



void Unwind_1401f74f0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x28);
  return;
}



void Unwind_1401f7500(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x38);
  return;
}



void Unwind_1401f7510(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x20);
  return;
}



void Unwind_1401f7520(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x150),0x60);
  return;
}



void Unwind_1401f7540(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x160),*(undefined8 *)(param_2 + 0x150));
  return;
}



void Unwind_1401f7570(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x150);
  return;
}



void Unwind_1401f7580(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1401f7590(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x28);
  return;
}



void Unwind_1401f75a0(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x38);
  return;
}



void Unwind_1401f75b0(undefined8 param_1,longlong param_2)

{
  FUN_14015bf40(param_2 + 0x40);
  return;
}



void Unwind_1401f75c0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x48);
  return;
}



void Unwind_1401f75d0(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x70);
  return;
}



void Unwind_1401f75e0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x98);
  return;
}



void Unwind_1401f75f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x150) + 8);
  return;
}



void Unwind_1401f7600(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x40);
  return;
}



void Unwind_1401f7610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_1401f7620(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0xa0);
  return;
}



void Unwind_1401f7630(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 200);
  return;
}



void Unwind_1401f7640(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(param_2 + 0x48);
  return;
}



void Unwind_1401f7650(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_1401f7660(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x160);
  return;
}



void Unwind_1401f7670(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x130);
  return;
}



void Unwind_1401f7680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401f7690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401f76a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401f76b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_1401f76c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_1401f76d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_1401f76e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1401f76f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(param_2 + 0x48);
  return;
}



void Unwind_1401f7700(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1401f7710(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x28);
  return;
}



void Unwind_1401f7720(undefined8 param_1,longlong param_2)

{
  FUN_14015bec0(param_2 + 0x38);
  return;
}



void Unwind_1401f7730(undefined8 param_1,longlong param_2)

{
  FUN_14015c350(param_2 + 0x20);
  return;
}



void Unwind_1401f7740(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x20);
  return;
}



void Unwind_1401f7750(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x90);
  return;
}



void Unwind_1401f7760(undefined8 param_1,longlong param_2)

{
  FUN_14017e320(param_2 + 0x88);
  return;
}



void Unwind_1401f7770(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x90);
  return;
}



void Unwind_1401f7780(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x1e0) + 8);
  return;
}



void Unwind_1401f7790(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1401f77a0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x1e0) + 8);
  return;
}



void Unwind_1401f77b0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x20);
  return;
}



void Unwind_1401f77c0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x90);
  return;
}



void Unwind_1401f77d0(undefined8 param_1,longlong param_2)

{
  FUN_14017e320(param_2 + 0x88);
  return;
}



void Unwind_1401f77e0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x90);
  return;
}



void Unwind_1401f77f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x238) + 8);
  return;
}



void Unwind_1401f7800(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1401f7810(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x238) + 8);
  return;
}



void Unwind_1401f7820(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x50);
  return;
}



void Unwind_1401f7830(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xd0) + 8);
  return;
}



void Unwind_1401f7840(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x50);
  return;
}



void Unwind_1401f7850(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xd0) + 8);
  return;
}



void Unwind_1401f7860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_1401f7870(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x50);
  return;
}



void Unwind_1401f7880(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f7890(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x30);
  return;
}



void Unwind_1401f78a0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xb0) + 8);
  return;
}



void Unwind_1401f78b0(undefined8 param_1,longlong param_2)

{
  FUN_14018b770(param_2 + 0x40);
  return;
}



void Unwind_1401f78c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x138);
  return;
}



void Unwind_1401f78d0(undefined8 param_1,longlong param_2)

{
  FUN_14018eb10(param_2 + 0x58);
  return;
}



void Unwind_1401f78e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1401f78f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1401f7900(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x20);
  return;
}



void Unwind_1401f7910(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x80);
  return;
}



void Unwind_1401f7920(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_1401f7930(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0xe8),*(undefined8 *)(param_2 + 0xe0));
  return;
}



void Unwind_1401f7960(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_1401f7970(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb8);
  return;
}



void Unwind_1401f7980(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f7990(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb0);
  return;
}



void Unwind_1401f79a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401f79b0(undefined8 param_1,longlong param_2)

{
  FUN_14018eb10(param_2 + 0x58);
  return;
}



void Unwind_1401f79c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_1401f79d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * Catch_1401f79e0(undefined8 param_1,longlong param_2)

{
  LPCSTR lpOutputString;
  
  lpOutputString = (LPCSTR)(**(code **)(**(longlong **)(param_2 + 0x38) + 8))();
  OutputDebugStringA(lpOutputString);
  _DAT_00000000 = 1;
  return &DAT_1401b0f22;
}



void Unwind_1401f7a20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * Catch_1401f7a30(undefined8 param_1,longlong param_2)

{
  LPCSTR lpOutputString;
  
  lpOutputString = (LPCSTR)(**(code **)(**(longlong **)(param_2 + 0x38) + 8))();
  OutputDebugStringA(lpOutputString);
  _DAT_00000000 = 1;
  return &DAT_1401b107f;
}



void Unwind_1401f7a70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401f7a80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f7a90(undefined8 param_1,longlong param_2)

{
  FUN_14016c640(param_2 + 0x60);
  return;
}



void Unwind_1401f7aa0(undefined8 param_1,longlong param_2)

{
  FUN_140141c90(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1401f7ab0(undefined8 param_1,longlong param_2)

{
  FUN_1401a8870(*(longlong *)(param_2 + 0x70) + 8);
  return;
}



void Unwind_1401f7ac0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x70) + 0x10);
  return;
}



void Unwind_1401f7ad0(undefined8 param_1,longlong param_2)

{
  FUN_140149590(*(longlong *)(param_2 + 0x70) + 0x78);
  return;
}



void Unwind_1401f7ae0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x70) + 0x88);
  return;
}



void Unwind_1401f7b00(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x70) + 0x1c8);
  return;
}



void Unwind_1401f7b20(undefined8 param_1,longlong param_2)

{
  FUN_1401a4f30(*(longlong *)(param_2 + 0x70) + 0x208);
  return;
}



void Unwind_1401f7b40(undefined8 param_1,longlong param_2)

{
  FUN_1401789b0(*(longlong *)(param_2 + 0x70) + 0x228);
  return;
}



void Unwind_1401f7b60(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(*(longlong *)(param_2 + 0x70) + 0x290);
  return;
}



void Unwind_1401f7b80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401a9120(*(longlong *)(param_2 + 0x70) + 0x298);
  return;
}



void Unwind_1401f7ba0(undefined8 param_1,longlong param_2)

{
  FUN_1401a9030(*(longlong *)(param_2 + 0x70) + 0x2b0);
  return;
}



void Unwind_1401f7bc0(undefined8 param_1,longlong param_2)

{
  FUN_1401a92c0(*(longlong *)(param_2 + 0x70) + 0x2b8);
  return;
}



void Unwind_1401f7be0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401f7bf0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x78));
  return;
}



void Unwind_1401f7c00(undefined8 param_1,longlong param_2)

{
  FUN_140149590(param_2 + 0x78);
  return;
}



void Unwind_1401f7c10(undefined8 param_1,longlong param_2)

{
  FUN_1400a4840(param_2 + 0x38);
  return;
}



void Unwind_1401f7c20(undefined8 param_1,longlong param_2)

{
  FUN_1400a4840(param_2 + 0x28);
  return;
}



void Unwind_1401f7c30(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0x50);
  return;
}



undefined * Catch_All_1401f7c40(undefined8 param_1,longlong param_2)

{
  *(undefined4 *)(param_2 + 0x30) = 0;
  return &DAT_1401b29ad;
}



void Unwind_1401f7c70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f7c80(undefined8 param_1,longlong param_2)

{
  FUN_1400a2f10(param_2 + 0x28);
  return;
}



void Unwind_1401f7c90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f7ca0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x50) & 1) != 0) {
    *(uint *)(param_2 + 0x50) = *(uint *)(param_2 + 0x50) & 0xfffffffe;
    thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  }
  return;
}



void Unwind_1401f7cd0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x78),
                *(longlong *)(param_2 + 0x60) + (longlong)*(int *)(param_2 + 0x70) * 8);
  return;
}



void Unwind_1401f7d00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f7d10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x30);
  return;
}



void Unwind_1401f7d20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x38);
  return;
}



void Unwind_1401f7d30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401f7d40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401f7d50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401f7d60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401f7d70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401f7d80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401f7d90(undefined8 param_1,longlong param_2)

{
  FUN_1400a3ff0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f7da0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f7db0(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(*(longlong *)(param_2 + 0x40) + 0x2480);
  return;
}



void Unwind_1401f7dd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(*(longlong *)(param_2 + 0x40) + 0x2488);
  return;
}



void Unwind_1401f7df0(undefined8 param_1,longlong param_2)

{
  FUN_1401b22b0(*(longlong *)(param_2 + 0x40) + 0x2510);
  return;
}



void Unwind_1401f7e10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401f7e20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f7e30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f7e40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f7e50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x20);
  return;
}



void Unwind_1401f7e60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x28);
  return;
}



// Library Function - Single Match
//  int `public: class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class
// ATL::ChTraitsCRT<wchar_t> > > __cdecl CDatabase::GetDatabaseName(void)const __ptr64'::`1'::dtor$0
// 
// Library: Visual Studio 2005 Release

void Unwind_1401f7e70(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x88) & 1) != 0) {
    *(uint *)(param_2 + 0x88) = *(uint *)(param_2 + 0x88) & 0xfffffffe;
    thunk_FUN_14000c2a0(*(undefined8 *)(param_2 + 0x78));
  }
  return;
}



void Unwind_1401f7ea0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f7eb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f7ec0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f7ed0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f7ee0(undefined8 param_1,longlong param_2)

{
  FUN_1400a3ff0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f7ef0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f7f00(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401f7f10(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x58);
  return;
}



void Unwind_1401f7f20(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x48);
  return;
}



void Unwind_1401f7f30(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_1401f7f50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(*(undefined8 *)(param_2 + 0x28));
  return;
}



void Unwind_1401f7f60(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_1401f7f80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x68),0x400);
  return;
}



void Unwind_1401f7fa0(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x68);
  return;
}



void Unwind_1401f7fb0(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x70);
  return;
}



void Unwind_1401f7fc0(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x78);
  return;
}



void Unwind_1401f7fd0(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x20);
  return;
}



void Unwind_1401f7fe0(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x78);
  return;
}



undefined8 Catch_All_1401f7ff0(void)

{
  return 0x1401b5373;
}



void Unwind_1401f8010(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401f8020(undefined8 param_1,longlong param_2)

{
  FUN_140021640(param_2 + 0x20);
  return;
}



void Unwind_1401f8030(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x48);
  return;
}



void Unwind_1401f8040(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_1401f8050(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x88));
  return;
}



void Unwind_1401f8060(undefined8 param_1,longlong param_2)

{
  FUN_1400a3ff0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_1401f8070(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(*(longlong *)(param_2 + 0x88) + 8);
  return;
}



void Unwind_1401f8080(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0xf0);
  return;
}



void Unwind_1401f8090(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



undefined8 Catch_All_1401f80a0(void)

{
  return 0x1401b5ae3;
}



void Unwind_1401f80c0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401f80d0(undefined8 param_1,longlong param_2)

{
  FUN_1401b5ad0(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_1401f80e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401b5360(*(longlong *)(param_2 + 0x40) + 0xa8);
  return;
}



void Unwind_1401f8100(undefined8 param_1,longlong param_2)

{
  FUN_1401b4690(*(longlong *)(param_2 + 0x40) + 0x100);
  return;
}



void Unwind_1401f8120(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x50) + 0x10);
  return;
}



void Unwind_1401f8130(undefined8 param_1,longlong param_2)

{
  FUN_1401b5ad0(*(longlong *)(param_2 + 0x50) + 0x50);
  return;
}



void Unwind_1401f8140(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401b5360(*(longlong *)(param_2 + 0x50) + 0xa8);
  return;
}



void Unwind_1401f8160(undefined8 param_1,longlong param_2)

{
  FUN_1401b4690(*(longlong *)(param_2 + 0x50) + 0x100);
  return;
}



void Unwind_1401f8180(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f8190(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x70);
  return;
}



void Unwind_1401f81a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x20);
  return;
}



void Unwind_1401f81b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_1401f81c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_1401f81d0(undefined8 param_1,longlong param_2)

{
  FUN_140185ca0(param_2 + 0x108);
  return;
}



void Unwind_1401f81e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x30));
  return;
}



void Unwind_1401f81f0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x30);
  return;
}



void Unwind_1401f8200(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_1401f8210(undefined8 param_1,longlong param_2)

{
  FUN_1400a1e20(param_2 + 0x130);
  return;
}



void Unwind_1401f8220(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1401f8230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x28);
  return;
}



void Unwind_1401f8240(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401f8250(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x118);
  return;
}



void Unwind_1401f8260(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_1401f8270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x60),0x400);
  return;
}



void Unwind_1401f8290(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x58);
  return;
}



void Unwind_1401f82a0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1e20(param_2 + 0x230);
  return;
}



void Unwind_1401f82b0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1e20(param_2 + 0x1a0);
  return;
}



void Unwind_1401f82c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x60);
  return;
}



void Unwind_1401f82d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x48);
  return;
}



void Unwind_1401f82e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x38);
  return;
}



void Unwind_1401f82f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x68);
  return;
}



void Unwind_1401f8300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x40);
  return;
}



void Unwind_1401f8310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x80);
  return;
}



void Unwind_1401f8320(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x78);
  return;
}



void Unwind_1401f8330(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x70);
  return;
}



void Unwind_1401f8340(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x118);
  return;
}



void Unwind_1401f8350(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 400);
  return;
}



void Unwind_1401f8360(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x108);
  return;
}



void Unwind_1401f8370(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe8);
  return;
}



void Unwind_1401f8380(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf8);
  return;
}



void Unwind_1401f8390(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x180);
  return;
}



void Unwind_1401f83a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x138);
  return;
}



void Unwind_1401f83b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x148);
  return;
}



void Unwind_1401f83c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x170);
  return;
}



void Unwind_1401f83d0(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0x2c0);
  return;
}



void Unwind_1401f83e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401f83f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x160);
  return;
}



void Unwind_1401f8400(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x128);
  return;
}



void Unwind_1401f8410(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401f8420(undefined8 param_1,longlong param_2)

{
  FUN_14016a7f0(param_2 + 0x30);
  return;
}



void Unwind_1401f8430(undefined8 param_1,longlong param_2)

{
  FUN_140141c50(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f8440(undefined8 param_1,longlong param_2)

{
  FUN_1400a8370(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_1401f8450(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(*(longlong *)(param_2 + 0x40) + 0x128);
  return;
}



void Unwind_1401f8470(undefined8 param_1,longlong param_2)

{
  FUN_1401c1130(*(longlong *)(param_2 + 0x40) + 0x130);
  return;
}



void Unwind_1401f8490(undefined8 param_1,longlong param_2)

{
  FUN_1401a4110(*(longlong *)(param_2 + 0x40) + 0x170);
  return;
}



void Unwind_1401f84b0(undefined8 param_1,longlong param_2)

{
  FUN_140141c50(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1401f84c0(undefined8 param_1,longlong param_2)

{
  FUN_1400a8370(*(longlong *)(param_2 + 0x60) + 0x40);
  return;
}



void Unwind_1401f84d0(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(*(longlong *)(param_2 + 0x60) + 0x128);
  return;
}



void Unwind_1401f84f0(undefined8 param_1,longlong param_2)

{
  FUN_1401c1130(*(longlong *)(param_2 + 0x60) + 0x130);
  return;
}



void Unwind_1401f8510(undefined8 param_1,longlong param_2)

{
  FUN_1401a4110(*(longlong *)(param_2 + 0x60) + 0x170);
  return;
}



void Unwind_1401f8530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x68),0x400);
  return;
}



void Unwind_1401f8550(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x68);
  return;
}



void Unwind_1401f8560(undefined8 param_1,longlong param_2)

{
  FUN_1401693e0(*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_1401f8570(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x30);
  return;
}



void Unwind_1401f8580(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x30);
  return;
}



void Unwind_1401f8590(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x70);
  return;
}



void Unwind_1401f85a0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xd00);
  return;
}



void Unwind_1401f85b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x20);
  return;
}



void Unwind_1401f85c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401f85d0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_1401f85e0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x80);
  return;
}



void Unwind_1401f85f0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x80);
  return;
}



void Unwind_1401f8600(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_1401f8610(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x50);
  return;
}



void Unwind_1401f8620(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x50);
  return;
}



void Unwind_1401f8630(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1401f8640(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_1401f8650(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x100);
  return;
}



void Unwind_1401f8660(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_1401f8670(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_1401f8680(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_1401f8690(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x100) + 8);
  return;
}



void Unwind_1401f86a0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x78);
  return;
}



void Unwind_1401f86b0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x78);
  return;
}



void Unwind_1401f86c0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xc0) + 8);
  return;
}



void Unwind_1401f86d0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x50);
  return;
}



void Unwind_1401f86e0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x50);
  return;
}



void Unwind_1401f86f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x120) + 8);
  return;
}



void Unwind_1401f8700(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0x1a0);
  return;
}



void Unwind_1401f8710(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0x4d0);
  return;
}



void Unwind_1401f8720(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0x2b0);
  return;
}



void Unwind_1401f8730(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0x3c0);
  return;
}



void Unwind_1401f8740(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_1401f8750(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401f8760(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1401f8770(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x130);
  return;
}



void Unwind_1401f8780(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f8790(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f87a0(undefined8 param_1,longlong param_2)

{
  FUN_140176cc0(param_2 + 0x98);
  return;
}



void Unwind_1401f87b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_1401f87c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_1401f87d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401f87e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa8);
  return;
}



void Unwind_1401f87f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 200);
  return;
}



void Unwind_1401f8800(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_1401f8810(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_1401f8820(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_1401f8830(undefined8 param_1,longlong param_2)

{
  FUN_140176cc0(param_2 + 0x40);
  return;
}



void Unwind_1401f8840(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401f8850(undefined8 param_1,longlong param_2)

{
  FUN_140142660(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401f8860(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401f8870(undefined8 param_1,longlong param_2)

{
  FUN_140176cc0(param_2 + 0x40);
  return;
}



void Unwind_1401f8880(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_1401f8890(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_1401f88a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401f88b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_1401f88c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x188);
  return;
}



void Unwind_1401f88d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_1401f88e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401f88f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1401f8900(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_1401f8910(undefined8 param_1,longlong param_2)

{
  FUN_140176cc0(param_2 + 0xa0);
  return;
}



void Unwind_1401f8920(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x80);
  return;
}



void Unwind_1401f8930(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x70));
  return;
}



void Unwind_1401f8940(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x70);
  return;
}



void Unwind_1401f8950(undefined8 param_1,longlong param_2)

{
  FUN_140176cc0(param_2 + 0xf8);
  return;
}



void Unwind_1401f8960(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_1401f8970(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x68);
  return;
}



void Unwind_1401f8980(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401f8990(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x88);
  return;
}



void Unwind_1401f89a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x70));
  return;
}



void Unwind_1401f89b0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x70);
  return;
}



void Unwind_1401f89c0(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(param_2 + 0x20);
  return;
}



void Unwind_1401f89d0(undefined8 param_1,longlong param_2)

{
  FUN_140143580(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401f89e0(undefined8 param_1,longlong param_2)

{
  FUN_1401bbdb0(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_1401f89f0(undefined8 param_1,longlong param_2)

{
  FUN_1401bbde0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f8a00(undefined8 param_1,longlong param_2)

{
  FUN_1401c1130(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1401f8a10(undefined8 param_1,longlong param_2)

{
  FUN_1401bbdb0(*(longlong *)(param_2 + 0x40) + 0x70);
  return;
}



void Unwind_1401f8a20(undefined8 param_1,longlong param_2)

{
  FUN_1401b8730(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f8a30(undefined8 param_1,longlong param_2)

{
  FUN_1401692d0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f8a40(undefined8 param_1,longlong param_2)

{
  FUN_140169320(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f8a50(undefined8 param_1,longlong param_2)

{
  FUN_140169360(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401f8a60(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401f8a70(undefined8 param_1,longlong param_2)

{
  FUN_140176cc0(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_1401f8a80(undefined8 param_1,longlong param_2)

{
  FUN_140141dc0(*(longlong *)(param_2 + 0x40) + 0x168);
  return;
}



void Unwind_1401f8aa0(undefined8 param_1,longlong param_2)

{
  FUN_14017e6e0(*(longlong *)(param_2 + 0x40) + 0x5b0);
  return;
}



void Unwind_1401f8ac0(undefined8 param_1,longlong param_2)

{
  FUN_1401b8730(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401f8ad0(undefined8 param_1,longlong param_2)

{
  FUN_1401692d0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f8ae0(undefined8 param_1,longlong param_2)

{
  FUN_140169320(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f8af0(undefined8 param_1,longlong param_2)

{
  FUN_140169360(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1401f8b00(undefined8 param_1,longlong param_2)

{
  FUN_1401b2a70(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401f8b10(undefined8 param_1,longlong param_2)

{
  FUN_140176cc0(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_1401f8b20(undefined8 param_1,longlong param_2)

{
  FUN_140141dc0(*(longlong *)(param_2 + 0x40) + 0x168);
  return;
}



void Unwind_1401f8b40(undefined8 param_1,longlong param_2)

{
  FUN_14017e6e0(*(longlong *)(param_2 + 0x40) + 0x5b0);
  return;
}



void Unwind_1401f8b60(undefined8 param_1,longlong param_2)

{
  FUN_1401bbf50(*(longlong *)(param_2 + 0x40) + 0x638);
  return;
}



void Unwind_1401f8b80(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x180);
  return;
}



void Unwind_1401f8b90(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0xd0);
  return;
}



void Unwind_1401f8ba0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0xd0);
  return;
}



void Unwind_1401f8bb0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f8bc0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xe00);
  return;
}



void Unwind_1401f8be0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xa0);
  return;
}



void Unwind_1401f8bf0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xd20);
  return;
}



void Unwind_1401f8c10(undefined8 param_1,longlong param_2)

{
  FUN_140141c50(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1401f8c20(undefined8 param_1,longlong param_2)

{
  FUN_1400a8370(*(longlong *)(param_2 + 0x60) + 0x40);
  return;
}



void Unwind_1401f8c30(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(*(longlong *)(param_2 + 0x60) + 0x100);
  return;
}



void Unwind_1401f8c50(undefined8 param_1,longlong param_2)

{
  FUN_1401a17e0(*(longlong *)(param_2 + 0x60) + 0x108);
  return;
}



void Unwind_1401f8c70(undefined8 param_1,longlong param_2)

{
  FUN_1401a1810(*(longlong *)(param_2 + 0x60) + 0x110);
  return;
}



void Unwind_1401f8c90(undefined8 param_1,longlong param_2)

{
  FUN_1401a18a0(*(longlong *)(param_2 + 0x60) + 0x188);
  return;
}



void Unwind_1401f8cb0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401f8cc0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401f8cd0(undefined8 param_1,longlong param_2)

{
  FUN_140141c50(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f8ce0(undefined8 param_1,longlong param_2)

{
  FUN_1400a8370(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_1401f8cf0(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(*(longlong *)(param_2 + 0x40) + 0x100);
  return;
}



void Unwind_1401f8d10(undefined8 param_1,longlong param_2)

{
  FUN_1401a17e0(*(longlong *)(param_2 + 0x40) + 0x108);
  return;
}



void Unwind_1401f8d30(undefined8 param_1,longlong param_2)

{
  FUN_1401a1810(*(longlong *)(param_2 + 0x40) + 0x110);
  return;
}



void Unwind_1401f8d50(undefined8 param_1,longlong param_2)

{
  FUN_1401a18a0(*(longlong *)(param_2 + 0x40) + 0x188);
  return;
}



void Unwind_1401f8d70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x70),0x400);
  return;
}



void Unwind_1401f8d90(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x70);
  return;
}



void Unwind_1401f8da0(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x80);
  return;
}



void Unwind_1401f8db0(undefined8 param_1,longlong param_2)

{
  FUN_1401bbde0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f8dc0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x150);
  return;
}



void Unwind_1401f8dd0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0xa0);
  return;
}



void Unwind_1401f8de0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0xa0);
  return;
}



void Unwind_1401f8df0(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(param_2 + 0x20);
  return;
}



void Unwind_1401f8e00(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_1401f8e10(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0xdd0);
  return;
}



void Unwind_1401f8e30(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xeb0);
  return;
}



void Unwind_1401f8e40(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x40);
  return;
}



void Unwind_1401f8e50(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0x40);
  return;
}



void Unwind_1401f8e60(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f8e70(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x1b30);
  return;
}



void Unwind_1401f8e90(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0xe00);
  return;
}



void Unwind_1401f8ea0(undefined8 param_1,longlong param_2)

{
  FUN_140145e20(param_2 + 0xe00);
  return;
}



void Unwind_1401f8eb0(undefined8 param_1,longlong param_2)

{
  FUN_140184fd0(param_2 + 0x68);
  return;
}



void Unwind_1401f8ec0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0x1b40);
  return;
}



void Unwind_1401f8ed0(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x1b30);
  return;
}



void Unwind_1401f8ef0(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(param_2 + 0xeb0);
  return;
}



void Unwind_1401f8f00(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x1b30);
  return;
}



void Unwind_1401f8f20(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(*(longlong *)(param_2 + 0x30) + 0xc80);
  return;
}



void Unwind_1401f8f40(undefined8 param_1,longlong param_2)

{
  FUN_140145b60(*(undefined8 *)(param_2 + 0x30));
  return;
}



void Unwind_1401f8f50(undefined8 param_1,longlong param_2)

{
  FUN_1401453c0(param_2 + 0x27c0);
  return;
}



void Unwind_1401f8f70(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1401f8f80(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x38);
  return;
}



void Unwind_1401f8f90(undefined8 param_1,longlong param_2)

{
  FUN_140153350(param_2 + 0x30);
  return;
}



void Unwind_1401f8fa0(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x38);
  return;
}



void Unwind_1401f8fb0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x110) + 8);
  return;
}



void Unwind_1401f8fc0(undefined8 param_1,longlong param_2)

{
  FUN_140152f30(param_2 + 0x68);
  return;
}



void Unwind_1401f8fd0(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x38);
  return;
}



void Unwind_1401f8fe0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x110) + 8);
  return;
}



void Unwind_1401f8ff0(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x38);
  return;
}



void Unwind_1401f9000(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x110) + 8);
  return;
}



void Unwind_1401f9010(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x38);
  return;
}



void Unwind_1401f9020(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x110) + 8);
  return;
}



void Unwind_1401f9030(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x38);
  return;
}



void Unwind_1401f9040(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x110) + 8);
  return;
}



void Unwind_1401f9050(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x38);
  return;
}



void Unwind_1401f9060(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x110) + 8);
  return;
}



void Unwind_1401f9070(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x38);
  return;
}



void Unwind_1401f9080(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x110) + 8);
  return;
}



void Unwind_1401f9090(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x38);
  return;
}



void Unwind_1401f90a0(undefined8 param_1,longlong param_2)

{
  FUN_1401ba430(param_2 + 0x30);
  return;
}



void Unwind_1401f90b0(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x38);
  return;
}



void Unwind_1401f90c0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xc0) + 8);
  return;
}



void Unwind_1401f90d0(undefined8 param_1,longlong param_2)

{
  FUN_1401c1130(*(longlong *)(param_2 + 0x50) + 0x30);
  return;
}



void Unwind_1401f90e0(undefined8 param_1,longlong param_2)

{
  FUN_1401bbdb0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401f90f0(undefined8 param_1,longlong param_2)

{
  FUN_1401bbdb0(*(longlong *)(param_2 + 0x50) + 0x70);
  return;
}



void Unwind_1401f9100(undefined8 param_1,longlong param_2)

{
  FUN_1401bbdb0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401f9110(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_1401f9120(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401c15e0(*(longlong *)(param_2 + 0x50) + 0x38);
  return;
}



void Unwind_1401f9130(undefined8 param_1,longlong param_2)

{
  FUN_140155530(*(longlong *)(param_2 + 0x50) + 0x50);
  return;
}



void Unwind_1401f9140(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f9150(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1401f9160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401c15e0(*(longlong *)(param_2 + 0x70) + 0x38);
  return;
}



void Unwind_1401f9170(undefined8 param_1,longlong param_2)

{
  FUN_140155530(*(longlong *)(param_2 + 0x70) + 0x50);
  return;
}



void Unwind_1401f9180(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1401f9190(undefined8 param_1,longlong param_2)

{
  FUN_140149590(param_2 + 0x80);
  return;
}



void FUN_1401f91a0(undefined8 *param_1,longlong param_2)

{
  FUN_1401c1d40(*(undefined4 *)*param_1,param_1,*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1401f91d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148d50(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_1401f91e0(undefined8 param_1,longlong param_2)

{
  FUN_1400a3ff0(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_1401f91f0(undefined8 param_1,longlong param_2)

{
  FUN_140141c90(*(longlong *)(param_2 + 0x80) + 8);
  return;
}



void Unwind_1401f9200(undefined8 param_1,longlong param_2)

{
  FUN_140141c50(*(longlong *)(param_2 + 0x80) + 0x10);
  return;
}



void Unwind_1401f9210(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(*(longlong *)(param_2 + 0x80) + 0x18);
  return;
}



void Unwind_1401f9220(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(*(longlong *)(param_2 + 0x80) + 0x20);
  return;
}



void Unwind_1401f9230(undefined8 param_1,longlong param_2)

{
  FUN_140143550(*(longlong *)(param_2 + 0x80) + 0x308);
  return;
}



void Unwind_1401f9250(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x80) + 0x310);
  return;
}



void Unwind_1401f9270(undefined8 param_1,longlong param_2)

{
  FUN_140149590(*(longlong *)(param_2 + 0x80) + 0x348);
  return;
}



void Unwind_1401f9290(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x88));
  return;
}



void Unwind_1401f92a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x88),0x400);
  return;
}



void Unwind_1401f92c0(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x88);
  return;
}



void Unwind_1401f92d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400a3530(*(undefined8 *)(param_2 + 0x90),0x400);
  return;
}



void Unwind_1401f92f0(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x90);
  return;
}



void Unwind_1401f9300(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x98));
  return;
}



void Unwind_1401f9310(undefined8 param_1,longlong param_2)

{
  FUN_140149590(param_2 + 0x98);
  return;
}



void Unwind_1401f9320(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401f9330(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x50);
  return;
}



void Unwind_1401f9340(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x58);
  return;
}



void Unwind_1401f9350(undefined8 param_1,longlong param_2)

{
  FUN_1400a3ff0(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1401f9360(undefined8 param_1,longlong param_2)

{
  FUN_140141c90(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_1401f9370(undefined8 param_1,longlong param_2)

{
  FUN_140141c50(*(longlong *)(param_2 + 0x60) + 0x10);
  return;
}



void Unwind_1401f9380(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(*(longlong *)(param_2 + 0x60) + 0x18);
  return;
}



void Unwind_1401f9390(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(*(longlong *)(param_2 + 0x60) + 0x20);
  return;
}



void Unwind_1401f93a0(undefined8 param_1,longlong param_2)

{
  FUN_140143550(*(longlong *)(param_2 + 0x60) + 0x308);
  return;
}



void Unwind_1401f93c0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x60) + 0x310);
  return;
}



void Unwind_1401f93e0(undefined8 param_1,longlong param_2)

{
  FUN_140149590(*(longlong *)(param_2 + 0x60) + 0x348);
  return;
}



void Unwind_1401f9400(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x68);
  return;
}



void Unwind_1401f9410(undefined8 param_1,longlong param_2)

{
  FUN_1400a5120(param_2 + 0x70);
  return;
}



void Unwind_1401f9420(undefined8 param_1,longlong param_2)

{
  FUN_140143580(param_2 + 0x28);
  return;
}



void Unwind_1401f9430(undefined8 param_1,longlong param_2)

{
  FUN_140143580(param_2 + 0x28);
  return;
}



void Unwind_1401f9440(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401f9447. Too many branches
                    // WARNING: Treating indirect jump as call
  std::_Container_base12::~_Container_base12((_Container_base12 *)(param_2 + 0x20));
  return;
}



void Unwind_1401f9450(undefined8 param_1,longlong param_2)

{
  FUN_140153210(param_2 + 0x20);
  return;
}



void Unwind_1401f9460(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401f9467. Too many branches
                    // WARNING: Treating indirect jump as call
  std::_Container_base12::~_Container_base12((_Container_base12 *)(param_2 + 0x20));
  return;
}



void Unwind_1401f9470(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x40);
  return;
}



void Unwind_1401f9480(undefined8 param_1,longlong param_2)

{
  FUN_140153350(param_2 + 0x38);
  return;
}



void Unwind_1401f9490(undefined8 param_1,longlong param_2)

{
  FUN_140152f30(param_2 + 0x28);
  return;
}



void Unwind_1401f94a0(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x40);
  return;
}



void Unwind_1401f94b0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xa0) + 8);
  return;
}



void Unwind_1401f94c0(undefined8 param_1,longlong param_2)

{
  FUN_140143580(*(longlong *)(param_2 + 0x90) + 0x18);
  return;
}



void Unwind_1401f94d0(undefined8 param_1,longlong param_2)

{
  FUN_1401bbdb0(*(undefined8 *)(param_2 + 0xa8));
  return;
}



void Unwind_1401f94e0(undefined8 param_1,longlong param_2)

{
  FUN_1401bbdb0(*(longlong *)(param_2 + 0x90) + 0x40);
  return;
}



void Unwind_1401f94f0(undefined8 param_1,longlong param_2)

{
  FUN_1401c1130(*(longlong *)(param_2 + 0x90) + 0x60);
  return;
}



void Unwind_1401f9500(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x30);
  return;
}



void Unwind_1401f9510(undefined8 param_1,longlong param_2)

{
  FUN_140153350(param_2 + 0x28);
  return;
}



void Unwind_1401f9520(undefined8 param_1,longlong param_2)

{
  FUN_1401ba430(param_2 + 0x28);
  return;
}



void Unwind_1401f9530(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x30);
  return;
}



void Unwind_1401f9540(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x70) + 8);
  return;
}



void Unwind_1401f9550(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x30);
  return;
}



void Unwind_1401f9560(undefined8 param_1,longlong param_2)

{
  FUN_140153350(param_2 + 0x28);
  return;
}



void Unwind_1401f9570(undefined8 param_1,longlong param_2)

{
  FUN_1401ba430(param_2 + 0x28);
  return;
}



void Unwind_1401f9580(undefined8 param_1,longlong param_2)

{
  FUN_14003d130(param_2 + 0x30);
  return;
}



void Unwind_1401f9590(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x70) + 8);
  return;
}



void FUN_1401f95a0(undefined8 param_1,longlong param_2)

{
  if (*(int *)(param_2 + 0x20) == 0) {
    __ArrayUnwind(*(void **)(param_2 + 0x50),*(__uint64 *)(param_2 + 0x58),*(int *)(param_2 + 0x24),
                  *(_func_void_void_ptr **)(param_2 + 0x70));
  }
  return;
}



void Unwind_1401f95d0(undefined8 param_1,longlong param_2)

{
  FUN_140096510(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f95e0(undefined8 param_1,longlong param_2)

{
  FUN_14008cdd0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f95f0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401f95f7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401f9600(undefined8 param_1,longlong param_2)

{
  FUN_1400aefd0(param_2 + 0x28);
  return;
}



void Catch_All_1401f9610(void)

{
  FUN_14000c0e0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401f9640(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401f9652. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_ostream<>::~basic_ostream<>((basic_ostream<> *)(*(longlong *)(param_2 + 0x40) + -0x80))
  ;
  return;
}



void Catch_All_1401f9660(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9680(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f96a0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f96c0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f96e0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9700(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9720(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9740(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9760(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9780(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f97a0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f97c0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f97e0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9800(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9820(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9840(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9860(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9880(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f98a0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f98c0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f98e0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9900(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9920(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9940(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9960(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9980(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f99a0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f99c0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f99e0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9a00(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9a30(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9a60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9a90(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9ac0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9af0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9b20(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9b50(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9b80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9bb0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9be0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9c10(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9c40(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9c70(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9ca0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9cd0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9d00(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9d30(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9d60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9d90(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9dc0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9df0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9e20(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9e50(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9e80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9eb0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9ee0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9f10(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401f9f40(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401f9f81(undefined8 param_1,longlong param_2)

{
  FUN_14002b360(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f9fa1(undefined8 param_1,longlong param_2)

{
  FUN_14002b1b0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401f9fb1(undefined8 param_1,longlong param_2)

{
  FUN_14002b230(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401f9fc1(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_1401f9fd1(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x40) + 0x70);
  return;
}



void Unwind_1401f9ff1(undefined8 param_1,longlong param_2)

{
  FUN_14002b1b0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fa001(undefined8 param_1,longlong param_2)

{
  FUN_14002b230(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401fa011(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_1401fa021(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x40) + 0x70);
  return;
}



void Unwind_1401fa041(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fa051(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_1401fa061(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_1401fa071(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x78);
  return;
}



void Unwind_1401fa081(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0xa0);
  return;
}



void Unwind_1401fa0a1(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 200);
  return;
}



void Unwind_1401fa0c1(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0xf0);
  return;
}



void Unwind_1401fa0e1(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x118);
  return;
}



void Unwind_1401fa101(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x140);
  return;
}



void Unwind_1401fa121(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x168);
  return;
}



void Unwind_1401fa141(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 400);
  return;
}



void Unwind_1401fa161(undefined8 param_1,longlong param_2)

{
  FUN_1400036e0(param_2 + 0xe0);
  return;
}



void Unwind_1401fa181(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x20);
  return;
}



void Unwind_1401fa191(undefined8 param_1,longlong param_2)

{
  FUN_140026480(param_2 + 0x20);
  return;
}



void Unwind_1401fa1a1(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x58);
  return;
}



void Unwind_1401fa1b1(undefined8 param_1,longlong param_2)

{
  FUN_140026480(param_2 + 0x20);
  return;
}



void Unwind_1401fa1c1(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x58);
  return;
}



void Unwind_1401fa1e1(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fa1f1(undefined8 param_1,longlong param_2)

{
  FUN_1400036e0(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_1401fa201(undefined8 param_1,longlong param_2)

{
  FUN_140003b70(*(longlong *)(param_2 + 0x40) + 600);
  return;
}



void Unwind_1401fa221(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x278);
  return;
}



void Unwind_1401fa241(undefined8 param_1,longlong param_2)

{
  FUN_140003320(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fa261(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x40);
  return;
}



void Unwind_1401fa281(void)

{
  DAT_140320f58 = DAT_140320f58 & 0xfffffffe;
  return;
}



void Unwind_1401fa2a1(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fa2c1(undefined8 param_1,longlong param_2)

{
  FUN_140003340(param_2 + 0x430);
  return;
}



void Unwind_1401fa2d1(void)

{
  DAT_140320f58 = DAT_140320f58 & 0xfffffffe;
  return;
}



void Unwind_1401fa2f1(void)

{
  DAT_140320f58 = DAT_140320f58 & 0xfffffffe;
  return;
}



void Unwind_1401fa311(undefined8 param_1,longlong param_2)

{
  FUN_140003340(param_2 + 0x28);
  return;
}



void Unwind_1401fa321(void)

{
  DAT_140320f58 = DAT_140320f58 & 0xfffffffe;
  return;
}



void Unwind_1401fa341(void)

{
  DAT_140320f58 = DAT_140320f58 & 0xfffffffe;
  return;
}



void Unwind_1401fa360(undefined8 param_1,longlong param_2)

{
  FUN_14002b360(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fa370(undefined8 param_1,longlong param_2)

{
  FUN_140026480(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fa380(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Catch_All_1401fa390(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fa3b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fa3e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fa410(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fa430(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fa460(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Catch_All_1401fa470(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fa4a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fa4d0(undefined8 param_1,longlong param_2)

{
  FUN_14000b250(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fa4e0(undefined8 param_1,longlong param_2)

{
  FUN_14008d1f0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fa4f0(undefined8 param_1,longlong param_2)

{
  FUN_14008e2d0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401fa500(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x48) & 1) != 0) {
    *(uint *)(param_2 + 0x48) = *(uint *)(param_2 + 0x48) & 0xfffffffe;
    std::basic_ios<>::~basic_ios<>((basic_ios<> *)(*(longlong *)(param_2 + 0x40) + 0x88));
  }
  return;
}



void Unwind_1401fa530(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401fa53b. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_ostream<>::~basic_ostream<>((basic_ostream<> *)(*(longlong *)(param_2 + 0x40) + 8));
  return;
}



void Unwind_1401fa550(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401fa557. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_streambuf<>::~basic_streambuf<>(*(basic_streambuf<> **)(param_2 + 0x28));
  return;
}



void Catch_All_1401fa560(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fa590(undefined8 param_1,longlong param_2)

{
  undefined8 *puVar1;
  
  puVar1 = *(undefined8 **)(param_2 + 0x40);
  if ((void *)*puVar1 != (void *)0x0) {
    operator_delete((void *)*puVar1);
  }
  *puVar1 = 0;
  puVar1[1] = 0;
  puVar1[2] = 0;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fa5e0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(undefined8 *)(param_2 + 0x20));
  return;
}



undefined * Catch_All_1401fa5f0(void)

{
  return &DAT_14000d3b4;
}



void Catch_All_1401fa610(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fa640(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_1401fa650(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fa660(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0x50));
  return;
}



undefined * Catch_All_1401fa670(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x78);
  *(longlong *)(param_2 + 0x78) = lVar1;
  uVar2 = FUN_1400043b0(lVar1 + 1);
  *(undefined8 *)(param_2 + 0x88) = uVar2;
  return &DAT_14000433c;
}



void Catch_All_1401fa6b0(undefined8 param_1,longlong param_2)

{
  undefined8 *puVar1;
  
  puVar1 = *(undefined8 **)(param_2 + 0x70);
  if (0xf < (ulonglong)puVar1[3]) {
    operator_delete((void *)*puVar1);
  }
  puVar1[3] = 0xf;
  puVar1[2] = 0;
  *(undefined1 *)puVar1 = 0;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined * Catch_All_1401fa6f0(void)

{
  return &DAT_14009aba2;
}



undefined * Catch_All_1401fa710(void)

{
  return &DAT_140095932;
}



void Catch_All_1401fa730(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fa760(undefined8 param_1,longlong param_2)

{
  FUN_140026b00(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fa770(undefined8 param_1,longlong param_2)

{
  FUN_140028a60(*(longlong *)(param_2 + 0x40) + 0x58);
  return;
}



void Unwind_1401fa780(undefined8 param_1,longlong param_2)

{
  FUN_140026480(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_1401fa790(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(*(longlong *)(param_2 + 0x50) + 0x20);
  return;
}



void Unwind_1401fa7a0(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(*(longlong *)(param_2 + 0x50) + 0x30);
  return;
}



void Unwind_1401fa7b0(undefined8 param_1,longlong param_2)

{
  FUN_140022590(param_2 + 0x48);
  return;
}



void Unwind_1401fa7c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401fa7d0(undefined8 param_1,longlong param_2)

{
  FUN_1400216c0(param_2 + 0xa0);
  return;
}



undefined * Catch_All_1401fa7e0(void)

{
  return &DAT_14001db12;
}



void Catch_All_1401fa800(undefined8 param_1,longlong param_2)

{
  undefined8 *puVar1;
  
  puVar1 = *(undefined8 **)(param_2 + 0x40);
  if (0xf < (ulonglong)puVar1[3]) {
    operator_delete((void *)*puVar1);
  }
  puVar1[3] = 0xf;
  puVar1[2] = 0;
  *(undefined1 *)puVar1 = 0;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined * Catch_All_1401fa840(void)

{
  return &DAT_14000d592;
}



void Unwind_1401fa860(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_1401fa870(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fa880(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_1401fa890(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_1401fa8a0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x78);
  return;
}


undefined DAT_1400019b1;
undefined DAT_14008c5ae;
undefined FUN_140202370;
undefined LAB_1402023b0;
undefined DAT_140320f70;
undefined LAB_1402024e0;
undefined FUN_1402024f0;
undefined FUN_140202530;
undefined8 DAT_140312e58;
undefined FUN_140202570;
undefined FUN_1402025b0;
undefined FUN_140202610;
undefined8 DAT_140312ea8;
undefined FUN_140202660;
undefined FUN_1402026a0;
undefined LAB_140202840;
undefined LAB_140202830;
undefined DAT_140313f10;
undefined LAB_140202860;
undefined LAB_1402028a0;
undefined LAB_1402028b0;
undefined LAB_140202910;
undefined LAB_1402028f0;
undefined LAB_1402028e0;
undefined LAB_140202920;
undefined LAB_140202930;
undefined LAB_140202950;
undefined LAB_14020297c;
undefined1 DAT_140315850;
undefined DAT_140315840;
undefined FUN_140202988;
HANDLE DAT_140315848;
undefined LAB_140202a00;
undefined LAB_140202ac0;
undefined LAB_140202ad0;
undefined LAB_140202af0;
undefined DAT_140319098;
undefined LAB_140202ae0;
undefined DAT_140319060;
undefined FUN_140202b70;
undefined LAB_140202be0;
undefined DAT_140319160;
undefined LAB_140202c30;
undefined LAB_140202c50;
undefined8 DAT_14031a310;
undefined LAB_140202c60;
undefined DAT_14031a318;
undefined DAT_14031d588;
undefined DAT_140312d90;
undefined DAT_140312da0;
void *DAT_14031ffa8;
undefined DAT_14031ffb0;
undefined DAT_14031ffb8;
void *DAT_14031ffc8;
undefined DAT_14031ffd0;
undefined DAT_14031ffd8;
void *DAT_14031ffe8;
undefined DAT_14031fff0;
undefined DAT_14031fff8;
ulonglong DAT_140313e58;
undefined DAT_140313e40;
undefined DAT_140313e50;
undefined DAT_140312e08;
undefined DAT_140312e18;
undefined DAT_140312e30;
undefined DAT_140312e40;
ulonglong DAT_140312e70;
undefined DAT_140312e58;
undefined DAT_140312e68;
undefined DAT_140312e80;
undefined DAT_140312e90;
ulonglong DAT_140312ec0;
undefined DAT_140312ea8;
undefined DAT_140312eb8;
undefined DAT_140312ed0;
undefined DAT_140312ee0;
void *DAT_140320060;
undefined DAT_140320068;
undefined DAT_140320070;
void *DAT_140320080;
undefined DAT_140320088;
undefined DAT_140320090;
void *DAT_1403200a0;
undefined DAT_1403200a8;
undefined DAT_1403200b0;
void *DAT_1403200c0;
undefined DAT_1403200c8;
undefined DAT_1403200d0;
void *DAT_1403200e0;
undefined DAT_1403200e8;
undefined DAT_1403200f0;
longlong *DAT_140314020;
char DAT_140315850;
undefined DAT_1402f8540;
undefined8 *DAT_140318e70;
longlong DAT_140318ec8;
longlong DAT_140319108;
undefined *PTR_vftable_14030c240;
void *DAT_140319120;
undefined DAT_14031a1d0;
undefined *PTR_vftable_14030c770;

void Unwind_1401fa8b0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0xa0);
  return;
}



void Unwind_1401fa8d0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 200);
  return;
}



void Unwind_1401fa8f0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0xf0);
  return;
}



void Unwind_1401fa910(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x118);
  return;
}



void Unwind_1401fa930(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x140);
  return;
}



void Unwind_1401fa950(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x170);
  return;
}



void Unwind_1401fa970(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x198);
  return;
}



void Unwind_1401fa990(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x1c0);
  return;
}



void Unwind_1401fa9b0(undefined8 param_1,longlong param_2)

{
  FUN_140002310(param_2 + 0x50);
  return;
}



void Unwind_1401fa9c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401fa9d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401fa9e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_1401fa9f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401faa00(undefined8 param_1,longlong param_2)

{
  FUN_140003270(*(undefined8 *)(param_2 + 0x40));
  return;
}



undefined * Catch_All_1401faa10(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(param_2 + 0x68) = lVar1;
  uVar2 = FUN_1400018c0(lVar1 + 1);
  *(undefined8 *)(param_2 + 0x78) = uVar2;
  return &DAT_1400019b1;
}



void Catch_All_1401faa40(undefined8 param_1,longlong param_2)

{
  undefined8 *puVar1;
  
  puVar1 = *(undefined8 **)(param_2 + 0x60);
  if (7 < (ulonglong)puVar1[3]) {
    operator_delete((void *)*puVar1);
  }
  puVar1[3] = 7;
  puVar1[2] = 0;
  *(undefined2 *)puVar1 = 0;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401faa90(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0xe0) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_1401faac0(void)

{
  return 0x1400950e3;
}



void Catch_All_1401faae0(void)

{
  FUN_140095640();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fab10(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x38);
  return;
}



void Unwind_1401fab20(undefined8 param_1,longlong param_2)

{
  FUN_140090de0(param_2 + 0x70);
  return;
}



void Unwind_1401fab30(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_1401fab40(undefined8 param_1,longlong param_2)

{
  FUN_140090e40(param_2 + 0x150);
  return;
}



void Unwind_1401fab50(undefined8 param_1,longlong param_2)

{
  FUN_140090c40(param_2 + 0x28);
  return;
}



void Unwind_1401fab60(undefined8 param_1,longlong param_2)

{
  FUN_140090c00(param_2 + 0x28);
  return;
}



void Unwind_1401fab70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fab80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401fab90(undefined8 param_1,longlong param_2)

{
  FUN_14008cb00(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401faba0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401fabb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_1401fabc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fabd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401fabe0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fabf0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 1) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xfffffffe;
    thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x60));
  }
  return;
}



void Unwind_1401fac20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fac30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fac40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_1401fac50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fac60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401fac70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fac80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fac90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401faca0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_1401facb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401facc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401facd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401face0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401facf0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fad00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401fad10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401fad20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_1401fad30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fad40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fad50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fad60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401fad70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_1401fad80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fad90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fada0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x20);
  return;
}



void Unwind_1401fadb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fadc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401fadd0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401fade0(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x40);
  return;
}



void Unwind_1401fadf0(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x50);
  return;
}



void Unwind_1401fae00(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x60);
  return;
}



void Unwind_1401fae10(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x70);
  return;
}



void Unwind_1401fae20(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x28);
  return;
}



void Unwind_1401fae30(undefined8 param_1,longlong param_2)

{
  FUN_140026b00(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fae40(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_1401fae50(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401fae57. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_1401fae60(undefined8 param_1,longlong param_2)

{
  FUN_140026b00(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fae70(undefined8 param_1,longlong param_2)

{
  FUN_140002310(param_2 + 0x60);
  return;
}



void Unwind_1401fae80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401fae90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401faea0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401faeb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401faec0(undefined8 param_1,longlong param_2)

{
  FUN_140002090(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401faed0(undefined8 param_1,longlong param_2)

{
  FUN_140070db0(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_1401faee0(undefined8 param_1,longlong param_2)

{
  FUN_140070e30(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_1401faef0(undefined8 param_1,longlong param_2)

{
  FUN_140003270(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401faf00(undefined8 param_1,longlong param_2)

{
  FUN_140002090(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401faf10(undefined8 param_1,longlong param_2)

{
  FUN_14003bf10(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_1401faf20(undefined8 param_1,longlong param_2)

{
  FUN_14003bfc0(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_1401faf30(undefined8 param_1,longlong param_2)

{
  FUN_140003270(*(undefined8 *)(param_2 + 0x40));
  return;
}



undefined8 Catch_All_1401faf40(void)

{
  return 0x140021633;
}



void Unwind_1401faf60(undefined8 param_1,longlong param_2)

{
  FUN_1400216c0(param_2 + 0x50);
  return;
}



void Unwind_1401faf70(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x60) & 1) != 0) {
    *(uint *)(param_2 + 0x60) = *(uint *)(param_2 + 0x60) & 0xfffffffe;
    FUN_1400216c0(*(undefined8 *)(param_2 + 0x58));
  }
  return;
}



void Unwind_1401fafa0(undefined8 param_1,longlong param_2)

{
  FUN_14001f8a0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fafb0(undefined8 param_1,longlong param_2)

{
  FUN_14008c0b0(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_1401fafc0(undefined8 param_1,longlong param_2)

{
  FUN_14003bfc0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401fafd0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf10(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_1401fafe0(undefined8 param_1,longlong param_2)

{
  FUN_14003c010(*(longlong *)(param_2 + 0x40) + 0x70);
  return;
}



void Unwind_1401faff0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf70(*(longlong *)(param_2 + 0x40) + 0x90);
  return;
}



void Unwind_1401fb010(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x40) + 0xb0);
  return;
}



void Unwind_1401fb030(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_1401fb040(undefined8 param_1,longlong param_2)

{
  FUN_14001f8a0(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_1401fb050(undefined8 param_1,longlong param_2)

{
  FUN_14008c0b0(*(longlong *)(param_2 + 0x50) + 0x48);
  return;
}



void Unwind_1401fb060(undefined8 param_1,longlong param_2)

{
  FUN_14003bfc0(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_1401fb070(undefined8 param_1,longlong param_2)

{
  FUN_14003bf10(*(longlong *)(param_2 + 0x50) + 0x28);
  return;
}



void Unwind_1401fb080(undefined8 param_1,longlong param_2)

{
  FUN_140186ed0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401fb090(undefined8 param_1,longlong param_2)

{
  FUN_14003c010(*(longlong *)(param_2 + 0x50) + 0x70);
  return;
}



void Unwind_1401fb0a0(undefined8 param_1,longlong param_2)

{
  FUN_140186ed0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401fb0b0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf70(*(longlong *)(param_2 + 0x50) + 0x90);
  return;
}



void Unwind_1401fb0d0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x50) + 0xb0);
  return;
}



void Catch_All_1401fb0f0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x18) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_1401fb120(void)

{
  return 0x14001cec3;
}



void Catch_All_1401fb140(void)

{
  FUN_14001d340();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_1401fb170(void)

{
  return 0x14001cd03;
}



void Unwind_1401fb190(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x28);
  return;
}



void Unwind_1401fb1a0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x50);
  return;
}



void Unwind_1401fb1b0(undefined8 param_1,longlong param_2)

{
  FUN_14001f8a0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fb1c0(undefined8 param_1,longlong param_2)

{
  FUN_14008c0b0(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_1401fb1d0(undefined8 param_1,longlong param_2)

{
  FUN_14003c060(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401fb1e0(undefined8 param_1,longlong param_2)

{
  FUN_14008cdf0(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_1401fb1f0(undefined8 param_1,longlong param_2)

{
  FUN_14003c0b0(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_1401fb200(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(longlong *)(param_2 + 0x40) + 0x90);
  return;
}



void Unwind_1401fb220(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(longlong *)(param_2 + 0x40) + 0xb8);
  return;
}



void Unwind_1401fb240(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x40) + 0xe8);
  return;
}



void Unwind_1401fb260(undefined8 param_1,longlong param_2)

{
  FUN_14001ccf0(*(longlong *)(param_2 + 0x40) + 0x120);
  return;
}



void Unwind_1401fb280(undefined8 param_1,longlong param_2)

{
  FUN_14001ceb0(*(longlong *)(param_2 + 0x40) + 0x170);
  return;
}



void Unwind_1401fb2a0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x40) + 0x1c8);
  return;
}



void Unwind_1401fb2c0(undefined8 param_1,longlong param_2)

{
  FUN_14001c190(*(longlong *)(param_2 + 0x40) + 0x230);
  return;
}



void Unwind_1401fb2e0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x40) + 0x270);
  return;
}



void Unwind_1401fb300(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x40) + 0x290);
  return;
}



void Unwind_1401fb320(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_1401fb330(undefined8 param_1,longlong param_2)

{
  FUN_14001f8a0(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_1401fb340(undefined8 param_1,longlong param_2)

{
  FUN_14008c0b0(*(longlong *)(param_2 + 0x50) + 0x40);
  return;
}



void Unwind_1401fb350(undefined8 param_1,longlong param_2)

{
  FUN_14003c060(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_1401fb360(undefined8 param_1,longlong param_2)

{
  FUN_14008cdf0(*(longlong *)(param_2 + 0x50) + 0x28);
  return;
}



void Unwind_1401fb370(undefined8 param_1,longlong param_2)

{
  FUN_140186ed0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401fb380(undefined8 param_1,longlong param_2)

{
  FUN_14003c0b0(*(longlong *)(param_2 + 0x50) + 0x60);
  return;
}



void Unwind_1401fb390(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(longlong *)(param_2 + 0x50) + 0x90);
  return;
}



void Unwind_1401fb3b0(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(longlong *)(param_2 + 0x50) + 0xb8);
  return;
}



void Catch_All_1401fb3d0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x18) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fb400(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x60) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fb430(void)

{
  FUN_14001d340();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_1401fb460(void)

{
  return 0x14000d203;
}



void Catch_All_1401fb480(void)

{
  FUN_14000d2d0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fb4b0(undefined8 param_1,longlong param_2)

{
  FUN_140001cc0(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_1401fb4c0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x50) + 0x50);
  return;
}



void Unwind_1401fb4d0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x50) + 0x88);
  return;
}



void Unwind_1401fb4f0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x50) + 0xa8);
  return;
}



void Unwind_1401fb510(undefined8 param_1,longlong param_2)

{
  FUN_140004930(*(longlong *)(param_2 + 0x50) + 200);
  return;
}



void Unwind_1401fb530(undefined8 param_1,longlong param_2)

{
  FUN_14000b260(*(longlong *)(param_2 + 0x50) + 0x160);
  return;
}



void Unwind_1401fb550(undefined8 param_1,longlong param_2)

{
  FUN_14000b250(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1401fb560(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_1401fb580(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x60);
  for (lVar2 = *(longlong *)(param_2 + 0x50); lVar2 != lVar1; lVar2 = lVar2 + 0x230) {
    FUN_1400036e0();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fb5c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fb5f0(undefined8 param_1,longlong param_2)

{
  FUN_140026b00(param_2 + 0x20);
  return;
}



void Unwind_1401fb600(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x80);
  return;
}



void Unwind_1401fb610(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x20);
  return;
}



void Unwind_1401fb620(undefined8 param_1,longlong param_2)

{
  FUN_140026480(param_2 + 0x20);
  return;
}



void Unwind_1401fb630(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x58);
  return;
}



void Unwind_1401fb640(undefined8 param_1,longlong param_2)

{
  FUN_140026480(param_2 + 0x20);
  return;
}



void Unwind_1401fb650(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x58);
  return;
}



void Unwind_1401fb660(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x40) + 0x70);
  return;
}



// Library Function - Multiple Matches With Different Base Names
//  int `protected: __cdecl CMFCVisualManagerOffice2007::CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$102
//  int `protected: virtual __cdecl CMFCVisualManagerOffice2007::~CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$102
//  int `protected: __cdecl CMFCVisualManagerOffice2007::CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$103
//  int `protected: virtual __cdecl CMFCVisualManagerOffice2007::~CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$103
//   69 names - too many to list
// 
// Library: Visual Studio 2010 Release

void Unwind_1401fb670(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x40) + 0xa0),0x38,4,FUN_140090c00);
  return;
}



// Library Function - Multiple Matches With Different Base Names
//  int `protected: __cdecl CMFCVisualManagerOffice2007::CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$102
//  int `protected: virtual __cdecl CMFCVisualManagerOffice2007::~CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$102
//  int `protected: __cdecl CMFCVisualManagerOffice2007::CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$103
//  int `protected: virtual __cdecl CMFCVisualManagerOffice2007::~CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$103
//   69 names - too many to list
// 
// Library: Visual Studio 2010 Release

void Unwind_1401fb6b0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x40) + 0x180),0x38,8,FUN_140090c00);
  return;
}



// Library Function - Multiple Matches With Different Base Names
//  int `protected: __cdecl CMFCVisualManagerOffice2007::CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$102
//  int `protected: virtual __cdecl CMFCVisualManagerOffice2007::~CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$102
//  int `protected: __cdecl CMFCVisualManagerOffice2007::CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$103
//  int `protected: virtual __cdecl CMFCVisualManagerOffice2007::~CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$103
//   69 names - too many to list
// 
// Library: Visual Studio 2010 Release

void Unwind_1401fb6f0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x40) + 0x340),0x30,0x19,FUN_140090c40);
  return;
}



void Unwind_1401fb730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400950d0(*(longlong *)(param_2 + 0x40) + 0x7f0);
  return;
}



void Unwind_1401fb750(undefined8 param_1,longlong param_2)

{
  FUN_140090c90(*(longlong *)(param_2 + 0x40) + 0x848);
  return;
}



void Unwind_1401fb770(undefined8 param_1,longlong param_2)

{
  FUN_14000b250(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401fb780(undefined8 param_1,longlong param_2)

{
  FUN_14000b250(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401fb790(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_1401fb7b0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x60);
  for (lVar2 = *(longlong *)(param_2 + 0x50); lVar2 != lVar1; lVar2 = lVar2 + 0x28) {
    FUN_14001b450();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fb7f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fb820(undefined8 param_1,longlong param_2)

{
  FUN_14008e2f0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fb830(undefined8 param_1,longlong param_2)

{
  FUN_14008e2d0(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1401fb840(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401fb847. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x30));
  return;
}



void Unwind_1401fb850(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401fb860(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x58);
  return;
}



void Unwind_1401fb870(undefined8 param_1,longlong param_2)

{
  FUN_140002090(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fb880(undefined8 param_1,longlong param_2)

{
  FUN_1400a1760(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_1401fb890(undefined8 param_1,longlong param_2)

{
  FUN_1400a17b0(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_1401fb8a0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x40) + 0x98);
  return;
}



void Unwind_1401fb8c0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x40) + 0xb8);
  return;
}



void Unwind_1401fb8e0(undefined8 param_1,longlong param_2)

{
  FUN_140003270(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fb8f0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x20);
  return;
}



void Unwind_1401fb900(undefined8 param_1,longlong param_2)

{
  FUN_140026480(param_2 + 0x20);
  return;
}



void Unwind_1401fb910(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x58);
  return;
}



void Unwind_1401fb920(undefined8 param_1,longlong param_2)

{
  FUN_140026480(param_2 + 0x20);
  return;
}



void Unwind_1401fb930(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x58);
  return;
}



void Unwind_1401fb940(undefined8 param_1,longlong param_2)

{
  FUN_14008b430(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fb950(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1401fb960(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1401fb970(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x50),*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fb990(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x30);
  return;
}



void Unwind_1401fb9a0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x30);
  return;
}



void Unwind_1401fb9b0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x30);
  return;
}



void Unwind_1401fb9c0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_1401fb9e0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x60);
  for (lVar2 = *(longlong *)(param_2 + 0x50); lVar2 != lVar1; lVar2 = lVar2 + 8) {
    FUN_1400031d0();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fba20(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fba50(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x78);
  return;
}



void Unwind_1401fba60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fba70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb0);
  return;
}



void Unwind_1401fba80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401fba90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2b0);
  return;
}



void Unwind_1401fbaa0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x528);
  return;
}



void Unwind_1401fbab0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_1401fbac0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401fbad0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x528);
  return;
}



void Unwind_1401fbae0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbaf0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401fbb00(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x78);
  return;
}



void Unwind_1401fbb10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbb20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb0);
  return;
}



void Unwind_1401fbb30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401fbb40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 1000);
  return;
}



void Unwind_1401fbb50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x528);
  return;
}



void Unwind_1401fbb60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_1401fbb70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbb80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xd8);
  return;
}



void Unwind_1401fbb90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbba0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2d0);
  return;
}



void Unwind_1401fbbb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbbc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbbd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3d8);
  return;
}



void Unwind_1401fbbe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbbf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbc00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x360);
  return;
}



void Unwind_1401fbc10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbc20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbc30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2e0);
  return;
}



void Unwind_1401fbc40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbc50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbc60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3e0);
  return;
}



void Unwind_1401fbc70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbc80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbc90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2f0);
  return;
}



void Unwind_1401fbca0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbcb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb0);
  return;
}



void Unwind_1401fbcc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x528);
  return;
}



void Unwind_1401fbcd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbce0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x370);
  return;
}



void Unwind_1401fbcf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xd8));
  return;
}



void Unwind_1401fbd00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb0);
  return;
}



void Unwind_1401fbd10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbd20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x300);
  return;
}



void Unwind_1401fbd30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x528));
  return;
}



void Unwind_1401fbd40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbd50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b0);
  return;
}



void Unwind_1401fbd60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbd70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbd80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c0);
  return;
}



void Unwind_1401fbd90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbda0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbdb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x310);
  return;
}



void Unwind_1401fbdc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbdd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbde0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x380);
  return;
}



void Unwind_1401fbdf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbe00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbe10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 800);
  return;
}



void Unwind_1401fbe20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbe30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbe40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3d0);
  return;
}



void Unwind_1401fbe50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbe60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbe70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x330);
  return;
}



void Unwind_1401fbe80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbe90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbea0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x390);
  return;
}



void Unwind_1401fbeb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbec0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbed0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x340);
  return;
}



void Unwind_1401fbee0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbef0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbf00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c0);
  return;
}



void Unwind_1401fbf10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbf20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbf30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x350);
  return;
}



void Unwind_1401fbf40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbf50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb0);
  return;
}



void Unwind_1401fbf60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbf70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3a0);
  return;
}



void Unwind_1401fbf80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x528));
  return;
}



void Unwind_1401fbf90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbfa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c8);
  return;
}



void Unwind_1401fbfb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbfc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fbfd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2d8);
  return;
}



void Unwind_1401fbfe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fbff0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fc000(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2e8);
  return;
}



void Unwind_1401fc010(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fc020(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xb0);
  return;
}



void Unwind_1401fc030(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fc040(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2f8);
  return;
}



void Unwind_1401fc050(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x528));
  return;
}



void Unwind_1401fc060(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xb0);
  return;
}



void Unwind_1401fc070(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fc080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x308);
  return;
}



void Unwind_1401fc090(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x528));
  return;
}



void Unwind_1401fc0a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x528);
  return;
}



void Unwind_1401fc0b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xb0);
  return;
}



void Unwind_1401fc0c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fc0d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x318);
  return;
}



void Unwind_1401fc0e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xd8));
  return;
}



void Unwind_1401fc0f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xb0);
  return;
}



void Unwind_1401fc100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fc110(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x328);
  return;
}



void Unwind_1401fc120(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x528));
  return;
}



void Unwind_1401fc130(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xb0);
  return;
}



void Unwind_1401fc140(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fc150(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x338);
  return;
}



void Unwind_1401fc160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x528));
  return;
}



void Unwind_1401fc170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fc180(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x348);
  return;
}



void Unwind_1401fc190(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fc1a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xd8);
  return;
}



void Unwind_1401fc1b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x528);
  return;
}



void Unwind_1401fc1c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xb0);
  return;
}



void Unwind_1401fc1d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fc1e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x358);
  return;
}



void Unwind_1401fc1f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x150));
  return;
}



void Unwind_1401fc200(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x160);
  return;
}



void Unwind_1401fc210(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x150);
  return;
}



void Unwind_1401fc220(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xd8);
  return;
}



void Unwind_1401fc230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x528);
  return;
}



void Unwind_1401fc240(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xb0);
  return;
}



void Unwind_1401fc250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fc260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x368);
  return;
}



void Unwind_1401fc270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2b8));
  return;
}



void Unwind_1401fc280(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xb0);
  return;
}



void Unwind_1401fc290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fc2a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x378);
  return;
}



void Unwind_1401fc2b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x528));
  return;
}



void Unwind_1401fc2c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xd8);
  return;
}



void Unwind_1401fc2d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x528);
  return;
}



void Unwind_1401fc2e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xb0);
  return;
}



void Unwind_1401fc2f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fc300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x388);
  return;
}



void Unwind_1401fc310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x150));
  return;
}



void Unwind_1401fc320(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xb0);
  return;
}



void Unwind_1401fc330(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fc340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x398);
  return;
}



void Unwind_1401fc350(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x528));
  return;
}



void Unwind_1401fc360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xd8);
  return;
}



void Unwind_1401fc370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x528);
  return;
}



void Unwind_1401fc380(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xb0);
  return;
}



void Unwind_1401fc390(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fc3a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3a8);
  return;
}



void Unwind_1401fc3b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x150));
  return;
}



void Unwind_1401fc3c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fc3d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_1401fc3e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1401fc3f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0xb0);
  return;
}



void Unwind_1401fc400(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fc410(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_1401fc420(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x528));
  return;
}



void Unwind_1401fc430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x310);
  return;
}



void Unwind_1401fc440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1c8);
  return;
}



void Unwind_1401fc450(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc460(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x2e0);
  return;
}



void Unwind_1401fc470(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc480(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2a0));
  return;
}



void Unwind_1401fc4a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc4b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x310);
  return;
}



void Unwind_1401fc4c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e0);
  return;
}



void Unwind_1401fc4d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc4e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x2e0);
  return;
}



void Unwind_1401fc4f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc500(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2a0));
  return;
}



void Unwind_1401fc520(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401fc540(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d0);
  return;
}



void Unwind_1401fc550(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc560(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x2a0);
  return;
}



void Unwind_1401fc570(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc580(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc590(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2a0));
  return;
}



void Unwind_1401fc5a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc5b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401fc5c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d8);
  return;
}



void Unwind_1401fc5d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc5e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x2a0);
  return;
}



void Unwind_1401fc5f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc600(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2a0));
  return;
}



void Unwind_1401fc620(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc630(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401fc640(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e8);
  return;
}



void Unwind_1401fc650(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc660(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x2a0);
  return;
}



void Unwind_1401fc670(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc680(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2a0));
  return;
}



void Unwind_1401fc6a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc6b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb0);
  return;
}



void Unwind_1401fc6c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb8);
  return;
}



void Unwind_1401fc6d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401fc6e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f0);
  return;
}



void Unwind_1401fc6f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x278);
  return;
}



void Unwind_1401fc700(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x2e0);
  return;
}



void Unwind_1401fc710(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2a0));
  return;
}



void Unwind_1401fc720(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401fc730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x200);
  return;
}



void Unwind_1401fc740(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2a0));
  return;
}



void Unwind_1401fc750(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401fc760(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x220);
  return;
}



void Unwind_1401fc770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2a0));
  return;
}



void Unwind_1401fc780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x310);
  return;
}



void Unwind_1401fc790(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x140);
  return;
}



void Unwind_1401fc7a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x130);
  return;
}



void Unwind_1401fc7b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401fc7c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x210);
  return;
}



void Unwind_1401fc7d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2a0));
  return;
}



void Unwind_1401fc7e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401fc7f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f8);
  return;
}



void Unwind_1401fc800(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2a0));
  return;
}



void Unwind_1401fc810(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401fc820(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x208);
  return;
}



void Unwind_1401fc830(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2a0));
  return;
}



void Unwind_1401fc840(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401fc850(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x218);
  return;
}



void Unwind_1401fc860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2a0));
  return;
}



void Unwind_1401fc870(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401fc880(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x228);
  return;
}



void Unwind_1401fc890(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2a0));
  return;
}



void Unwind_1401fc8a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401fc8b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401fc8c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1401fc8d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401fc8e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401fc8f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401fc900(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fc910(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401fc920(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x38);
  return;
}



void Unwind_1401fc930(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401fc937. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401fc940(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401fc947. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401fc950(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x38);
  return;
}



void Unwind_1401fc960(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x28);
  return;
}



void Unwind_1401fc970(undefined8 param_1,longlong param_2)

{
  FUN_1401e46e0(param_2 + 0x28);
  return;
}



void Unwind_1401fc980(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fc990(undefined8 param_1,longlong param_2)

{
  FUN_14001c190(param_2 + 0x28);
  return;
}



void Unwind_1401fc9a0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x20));
  return;
}



void Catch_All_1401fc9c0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x60);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x10) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fc9f0(undefined8 param_1,longlong param_2)

{
  FUN_14001e5f0(param_2 + 0x28);
  return;
}



void Unwind_1401fca00(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x80),*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1401fca20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1401fca30(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x38);
  return;
}



void Unwind_1401fca40(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x48);
  return;
}



void Unwind_1401fca50(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x98);
  return;
}



void Unwind_1401fca60(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x70);
  return;
}



void Unwind_1401fca70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14001c600(param_2 + 0x20);
  return;
}



void Unwind_1401fca80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14001c600(param_2 + 0x28);
  return;
}



void Unwind_1401fca90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x48);
  return;
}



void Unwind_1401fcaa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1401fcab0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401fcac0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401fcad0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401fcae0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_1401fcaf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x80);
  return;
}



void Unwind_1401fcb00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_1401fcb10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_1401fcb20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_1401fcb30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1401fcb40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401fcb50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x88);
  return;
}



void Unwind_1401fcb60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_1401fcb70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_1401fcb80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_1401fcb90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x30);
  return;
}



void Unwind_1401fcba0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401fcbb0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fcbd0(undefined8 param_1,longlong param_2)

{
  FUN_140003270(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fcbe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1401fcbf0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Catch_All_1401fcc10(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x18) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fcc40(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fcc50(undefined8 param_1,longlong param_2)

{
  FUN_140096550(param_2 + 0x28);
  return;
}



void Unwind_1401fcc60(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x30);
  return;
}



void Unwind_1401fcc70(undefined8 param_1,longlong param_2)

{
  FUN_140026480(param_2 + 0x30);
  return;
}



void Unwind_1401fcc80(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x68);
  return;
}



void Unwind_1401fcc90(undefined8 param_1,longlong param_2)

{
  FUN_140026480(param_2 + 0x30);
  return;
}



void Unwind_1401fcca0(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x68);
  return;
}



void Unwind_1401fccb0(undefined8 param_1,longlong param_2)

{
  FUN_140090c00(param_2 + 0x28);
  return;
}



void Unwind_1401fccc0(undefined8 param_1,longlong param_2)

{
  FUN_140090c40(param_2 + 0x28);
  return;
}



void Unwind_1401fccd0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x50) + 0x70);
  return;
}



// Library Function - Multiple Matches With Different Base Names
//  int `protected: __cdecl CMFCVisualManagerOffice2007::CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$102
//  int `protected: virtual __cdecl CMFCVisualManagerOffice2007::~CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$102
//  int `protected: __cdecl CMFCVisualManagerOffice2007::CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$103
//  int `protected: virtual __cdecl CMFCVisualManagerOffice2007::~CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$103
//   69 names - too many to list
// 
// Library: Visual Studio 2010 Release

void Unwind_1401fcce0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x50) + 0xa0),0x38,4,FUN_140090c00);
  return;
}



// Library Function - Multiple Matches With Different Base Names
//  int `protected: __cdecl CMFCVisualManagerOffice2007::CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$102
//  int `protected: virtual __cdecl CMFCVisualManagerOffice2007::~CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$102
//  int `protected: __cdecl CMFCVisualManagerOffice2007::CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$103
//  int `protected: virtual __cdecl CMFCVisualManagerOffice2007::~CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$103
//   69 names - too many to list
// 
// Library: Visual Studio 2010 Release

void Unwind_1401fcd20(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x50) + 0x180),0x38,8,FUN_140090c00);
  return;
}



// Library Function - Multiple Matches With Different Base Names
//  int `protected: __cdecl CMFCVisualManagerOffice2007::CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$102
//  int `protected: virtual __cdecl CMFCVisualManagerOffice2007::~CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$102
//  int `protected: __cdecl CMFCVisualManagerOffice2007::CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$103
//  int `protected: virtual __cdecl CMFCVisualManagerOffice2007::~CMFCVisualManagerOffice2007(void)
// __ptr64'::`1'::dtor$103
//   69 names - too many to list
// 
// Library: Visual Studio 2010 Release

void Unwind_1401fcd60(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x50) + 0x340),0x30,0x19,FUN_140090c40);
  return;
}



void Unwind_1401fcda0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400950d0(*(longlong *)(param_2 + 0x50) + 0x7f0);
  return;
}



void Unwind_1401fcdc0(undefined8 param_1,longlong param_2)

{
  FUN_140090c90(*(longlong *)(param_2 + 0x50) + 0x848);
  return;
}



void Unwind_1401fcde0(undefined8 param_1,longlong param_2)

{
  FUN_140090c90(*(longlong *)(param_2 + 0x50) + 0x868);
  return;
}



void Unwind_1401fce00(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_1401fce10(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_1401fce20(undefined8 param_1,longlong param_2)

{
  FUN_140002090(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fce30(undefined8 param_1,longlong param_2)

{
  FUN_1400a1760(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_1401fce40(undefined8 param_1,longlong param_2)

{
  FUN_140186ed0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401fce50(undefined8 param_1,longlong param_2)

{
  FUN_1400a17b0(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_1401fce60(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x40) + 0x98);
  return;
}



void Unwind_1401fce80(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x28));
  return;
}



void Catch_All_1401fcea0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x60);
  for (lVar2 = *(longlong *)(param_2 + 0x68); lVar2 != lVar1; lVar2 = lVar2 + 0x58) {
    FUN_14000c120();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fcee0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_1401fcf00(undefined8 param_1,longlong param_2)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  puVar1 = *(undefined8 **)(param_2 + 0x60);
  for (puVar2 = *(undefined8 **)(param_2 + 0x50); puVar2 != puVar1; puVar2 = puVar2 + 8) {
    if (7 < (ulonglong)puVar2[3]) {
      operator_delete((void *)*puVar2);
    }
    puVar2[3] = 7;
    puVar2[2] = 0;
    *(undefined2 *)puVar2 = 0;
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fcf60(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_1401fcf80(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x60);
  for (lVar2 = *(longlong *)(param_2 + 0x50); lVar2 != lVar1; lVar2 = lVar2 + 0x58) {
    FUN_14000c120();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fcfc0(void)

{
  FUN_14000b260();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fd010(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fd040(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x48),*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fd060(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x48),*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fd080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x148);
  return;
}



void Unwind_1401fd090(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x118);
  return;
}



void Unwind_1401fd0a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_1401fd0b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fd0c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_1401fd0d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401fd0e0(void)

{
  DAT_140320f58 = DAT_140320f58 & 0xfffffffe;
  return;
}



void Unwind_1401fd100(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fd120(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x70);
  return;
}



void Unwind_1401fd130(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1401fd140(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e0);
  return;
}



void Unwind_1401fd150(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xcc0);
  return;
}



void Unwind_1401fd160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1401fd170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x458);
  return;
}



void Unwind_1401fd180(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_1401fd190(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd90);
  return;
}



void Unwind_1401fd1a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1401fd1b0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x6e0);
  return;
}



void Unwind_1401fd1c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401fd1d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xda0);
  return;
}



void Unwind_1401fd1e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd1f0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x920);
  return;
}



void Unwind_1401fd200(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401fd210(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdb0);
  return;
}



void Unwind_1401fd220(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_1401fd240(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdc0);
  return;
}



void Unwind_1401fd250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x120);
  return;
}



void Unwind_1401fd270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdd0);
  return;
}



void Unwind_1401fd280(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1c8);
  return;
}



void Unwind_1401fd2a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xde0);
  return;
}



void Unwind_1401fd2b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd2c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x278);
  return;
}



void Unwind_1401fd2d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdf0);
  return;
}



void Unwind_1401fd2e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd2f0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x720);
  return;
}



void Unwind_1401fd300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1a0);
  return;
}



void Unwind_1401fd310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe00);
  return;
}



void Unwind_1401fd320(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd330(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0xa20);
  return;
}



void Unwind_1401fd340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d8);
  return;
}



void Unwind_1401fd350(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe10);
  return;
}



void Unwind_1401fd360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x158);
  return;
}



void Unwind_1401fd380(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe20);
  return;
}



void Unwind_1401fd390(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd3a0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x760);
  return;
}



void Unwind_1401fd3b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x238);
  return;
}



void Unwind_1401fd3c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe30);
  return;
}



void Unwind_1401fd3d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd3e0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x960);
  return;
}



void Unwind_1401fd3f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e8);
  return;
}



void Unwind_1401fd400(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe40);
  return;
}



void Unwind_1401fd410(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd420(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x268);
  return;
}



void Unwind_1401fd430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe50);
  return;
}



void Unwind_1401fd440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd450(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x7a0);
  return;
}



void Unwind_1401fd460(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f8);
  return;
}



void Unwind_1401fd470(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe60);
  return;
}



void Unwind_1401fd480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x248);
  return;
}



void Unwind_1401fd4a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe70);
  return;
}



void Unwind_1401fd4b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd4c0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0xac0);
  return;
}



void Unwind_1401fd4d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x138);
  return;
}



void Unwind_1401fd4e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe90);
  return;
}



void Unwind_1401fd4f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd500(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x7e0);
  return;
}



void Unwind_1401fd510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x208);
  return;
}



void Unwind_1401fd520(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xeb0);
  return;
}



void Unwind_1401fd530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd540(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x9a0);
  return;
}



void Unwind_1401fd550(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x288);
  return;
}



void Unwind_1401fd560(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xed0);
  return;
}



void Unwind_1401fd570(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd580(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x820);
  return;
}



void Unwind_1401fd590(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x218);
  return;
}



void Unwind_1401fd5a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xef0);
  return;
}



void Unwind_1401fd5b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd5c0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0xa80);
  return;
}



void Unwind_1401fd5d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 600);
  return;
}



void Unwind_1401fd5e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf10);
  return;
}



void Unwind_1401fd5f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd600(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x860);
  return;
}



void Unwind_1401fd610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1a8);
  return;
}



void Unwind_1401fd620(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf30);
  return;
}



void Unwind_1401fd630(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd640(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1b8);
  return;
}



void Unwind_1401fd650(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf50);
  return;
}



void Unwind_1401fd660(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd670(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x9e0);
  return;
}



void Unwind_1401fd680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x178);
  return;
}



void Unwind_1401fd690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf70);
  return;
}



void Unwind_1401fd6a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd6b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2a8);
  return;
}



void Unwind_1401fd6c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf90);
  return;
}



void Unwind_1401fd6d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd6e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4b8);
  return;
}



void Unwind_1401fd6f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_1401fd700(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfb0);
  return;
}



void Unwind_1401fd710(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd720(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1c0);
  return;
}



void Unwind_1401fd730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xbb0);
  return;
}



void Unwind_1401fd740(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd750(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x8a0);
  return;
}



void Unwind_1401fd760(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x100);
  return;
}



void Unwind_1401fd770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xbd0);
  return;
}



void Unwind_1401fd780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd790(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d0);
  return;
}



void Unwind_1401fd7a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfc0);
  return;
}



void Unwind_1401fd7b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd7c0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0xb00);
  return;
}



void Unwind_1401fd7d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1b0);
  return;
}



void Unwind_1401fd7e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfd0);
  return;
}



void Unwind_1401fd7f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd800(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x8e0);
  return;
}



void Unwind_1401fd810(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f0);
  return;
}



void Unwind_1401fd820(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfe0);
  return;
}



void Unwind_1401fd830(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd840(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x6a0);
  return;
}



void Unwind_1401fd850(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x200);
  return;
}



void Unwind_1401fd860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xff0);
  return;
}



void Unwind_1401fd870(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd880(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x148);
  return;
}



void Unwind_1401fd890(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdf8);
  return;
}



void Unwind_1401fd8a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd8b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2b8);
  return;
}



void Unwind_1401fd8c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xff8);
  return;
}



void Unwind_1401fd8d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd8e0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x6c0);
  return;
}



void Unwind_1401fd8f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401fd900(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe08);
  return;
}



void Unwind_1401fd910(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd920(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x700);
  return;
}



void Unwind_1401fd930(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x210);
  return;
}



void Unwind_1401fd940(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf08);
  return;
}



void Unwind_1401fd950(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd960(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x740);
  return;
}



void Unwind_1401fd970(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x220);
  return;
}



void Unwind_1401fd980(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe18);
  return;
}



void Unwind_1401fd990(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd9a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_1401fd9b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf88);
  return;
}



void Unwind_1401fd9c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fd9d0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x780);
  return;
}



void Unwind_1401fd9e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x230);
  return;
}



void Unwind_1401fd9f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe28);
  return;
}



void Unwind_1401fda00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fda10(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x7c0);
  return;
}



void Unwind_1401fda20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x240);
  return;
}



void Unwind_1401fda30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf18);
  return;
}



void Unwind_1401fda40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fda50(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x800);
  return;
}



void Unwind_1401fda60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x168);
  return;
}



void Unwind_1401fda70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe38);
  return;
}



void Unwind_1401fda80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fda90(undefined8 param_1,longlong param_2)

{
  FUN_140071090(param_2 + 0x1008);
  return;
}



void Unwind_1401fdaa0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x680);
  return;
}



void Unwind_1401fdab0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401fdac0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfc8);
  return;
}



void Unwind_1401fdad0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdae0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x840);
  return;
}



void Unwind_1401fdaf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401fdb00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe48);
  return;
}



void Unwind_1401fdb10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdb20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2a0);
  return;
}



void Unwind_1401fdb30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf28);
  return;
}



void Unwind_1401fdb40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdb50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x490);
  return;
}



void Unwind_1401fdb60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa8);
  return;
}



void Unwind_1401fdb70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe58);
  return;
}



void Unwind_1401fdb80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdb90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4b0);
  return;
}



void Unwind_1401fdba0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x470);
  return;
}



void Unwind_1401fdbb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_1401fdbc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf98);
  return;
}



void Unwind_1401fdbd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdbe0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x880);
  return;
}



void Unwind_1401fdbf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x108);
  return;
}



void Unwind_1401fdc00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe68);
  return;
}



void Unwind_1401fdc10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdc20(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x8c0);
  return;
}



void Unwind_1401fdc30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x110);
  return;
}



void Unwind_1401fdc40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf38);
  return;
}



void Unwind_1401fdc50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdc60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x480);
  return;
}



void Unwind_1401fdc70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf8);
  return;
}



void Unwind_1401fdc80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe78);
  return;
}



void Unwind_1401fdc90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdca0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4a0);
  return;
}



void Unwind_1401fdcb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf0);
  return;
}



void Unwind_1401fdcc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfe8);
  return;
}



void Unwind_1401fdcd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdce0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x250);
  return;
}



void Unwind_1401fdcf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe88);
  return;
}



void Unwind_1401fdd00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdd10(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x900);
  return;
}



void Unwind_1401fdd20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x118);
  return;
}



void Unwind_1401fdd30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf48);
  return;
}



void Unwind_1401fdd40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdd50(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x940);
  return;
}



void Unwind_1401fdd60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x130);
  return;
}



void Unwind_1401fdd70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe98);
  return;
}



void Unwind_1401fdd80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdd90(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x980);
  return;
}



void Unwind_1401fdda0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401fddb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfa8);
  return;
}



void Unwind_1401fddc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fddd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x460);
  return;
}



void Unwind_1401fdde0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x140);
  return;
}



void Unwind_1401fddf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xea8);
  return;
}



void Unwind_1401fde00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fde10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401fde20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf58);
  return;
}



void Unwind_1401fde30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fde40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x468);
  return;
}



void Unwind_1401fde50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x260);
  return;
}



void Unwind_1401fde60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xeb8);
  return;
}



void Unwind_1401fde70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fde80(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x9c0);
  return;
}



void Unwind_1401fde90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401fdea0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfd8);
  return;
}



void Unwind_1401fdeb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdec0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0xa00);
  return;
}



void Unwind_1401fded0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x270);
  return;
}



void Unwind_1401fdee0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xec8);
  return;
}



void Unwind_1401fdef0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdf00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x478);
  return;
}



void Unwind_1401fdf10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x150);
  return;
}



void Unwind_1401fdf20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf68);
  return;
}



void Unwind_1401fdf30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdf40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2b0);
  return;
}



void Unwind_1401fdf50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xed8);
  return;
}



void Unwind_1401fdf60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdf70(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0xa60);
  return;
}



void Unwind_1401fdf80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401fdf90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfb8);
  return;
}



void Unwind_1401fdfa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdfb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb0);
  return;
}



void Unwind_1401fdfc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xee8);
  return;
}



void Unwind_1401fdfd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fdfe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x488);
  return;
}



void Unwind_1401fdff0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x160);
  return;
}



void Unwind_1401fe000(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf78);
  return;
}



void Unwind_1401fe010(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fe020(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0xaa0);
  return;
}



void Unwind_1401fe030(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x280);
  return;
}



void Unwind_1401fe040(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xef8);
  return;
}



void Unwind_1401fe050(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fe060(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c0);
  return;
}



void Unwind_1401fe070(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xbf0);
  return;
}



void Unwind_1401fe080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fe090(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0xae0);
  return;
}



void Unwind_1401fe0a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401fe0b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc10);
  return;
}



void Unwind_1401fe0c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fe0d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_1401fe0e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc30);
  return;
}



void Unwind_1401fe0f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fe100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x170);
  return;
}



void Unwind_1401fe110(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc50);
  return;
}



void Unwind_1401fe120(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fe130(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0xb20);
  return;
}



void Unwind_1401fe140(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x180);
  return;
}



void Unwind_1401fe150(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc70);
  return;
}



void Unwind_1401fe160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fe170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb8);
  return;
}



void Unwind_1401fe180(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc90);
  return;
}



void Unwind_1401fe190(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fe1a0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0xa40);
  return;
}



void Unwind_1401fe1b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x290);
  return;
}



void Unwind_1401fe1c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xcb0);
  return;
}



void Unwind_1401fe1d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fe1e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_1401fe1f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xcd0);
  return;
}



void Unwind_1401fe200(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fe210(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x498);
  return;
}



void Unwind_1401fe220(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd8);
  return;
}



void Unwind_1401fe230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xcf0);
  return;
}



void Unwind_1401fe240(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fe250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x128);
  return;
}



void Unwind_1401fe260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd10);
  return;
}



void Unwind_1401fe270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fe280(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 400);
  return;
}



void Unwind_1401fe290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd30);
  return;
}



void Unwind_1401fe2a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fe2b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x4a8);
  return;
}



void Unwind_1401fe2c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x228);
  return;
}



void Unwind_1401fe2d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd50);
  return;
}



void Unwind_1401fe2e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fe2f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x298);
  return;
}



void Unwind_1401fe300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd70);
  return;
}



void Unwind_1401fe310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401fe320(undefined8 param_1,longlong param_2)

{
  FUN_140028a60(param_2 + 0x30);
  return;
}



void Unwind_1401fe330(undefined8 param_1,longlong param_2)

{
  FUN_140028a60(param_2 + 0x30);
  return;
}



void Unwind_1401fe340(undefined8 param_1,longlong param_2)

{
  FUN_140028a60(param_2 + 0x30);
  return;
}



void Unwind_1401fe350(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401fe357. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401fe360(undefined8 param_1,longlong param_2)

{
  FUN_140026b00(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1401fe370(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x40);
  return;
}



void Unwind_1401fe380(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x50);
  return;
}



void Unwind_1401fe390(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x50);
  return;
}



void Unwind_1401fe3a0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401fe3a7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1401fe3b0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x28);
  return;
}



void Unwind_1401fe3c0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe3e0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe400(undefined8 param_1,longlong param_2)

{
  FUN_140002090(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fe410(undefined8 param_1,longlong param_2)

{
  FUN_140070db0(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_1401fe420(undefined8 param_1,longlong param_2)

{
  FUN_140186ed0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401fe430(undefined8 param_1,longlong param_2)

{
  FUN_140002090(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401fe440(undefined8 param_1,longlong param_2)

{
  FUN_14003bf10(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_1401fe450(undefined8 param_1,longlong param_2)

{
  FUN_14003bfc0(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_1401fe460(undefined8 param_1,longlong param_2)

{
  FUN_140186ed0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401fe470(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0x28);
  return;
}



void Unwind_1401fe480(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0x58);
  return;
}



void Unwind_1401fe490(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0x48);
  return;
}



void Unwind_1401fe4a0(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0x38);
  return;
}



void Unwind_1401fe4b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fe4c0(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0x88);
  return;
}



void Unwind_1401fe4d0(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0x80);
  return;
}



void Unwind_1401fe4e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1401fe4f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401fe500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1401fe510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_1401fe520(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401fe530(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_1401fe540(undefined8 param_1,longlong param_2)

{
  FUN_14001e5f0(param_2 + 0x38);
  return;
}



void Unwind_1401fe550(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x78),*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1401fe570(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401fe580(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0xb0);
  return;
}



void Unwind_1401fe590(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x50);
  return;
}



void Unwind_1401fe5a0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x80);
  return;
}



void Unwind_1401fe5b0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe5d0(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0x20);
  return;
}



void Unwind_1401fe5e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401fe5f0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe610(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe630(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe650(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe670(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe690(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe6b0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x50);
  return;
}



void Unwind_1401fe6c0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe6e0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe700(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe720(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x28);
  return;
}



void Unwind_1401fe730(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x50);
  return;
}



void Unwind_1401fe740(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe760(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x28);
  return;
}



void Unwind_1401fe770(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x50);
  return;
}



void Unwind_1401fe780(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe7a0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe7c0(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0x40);
  return;
}



void Unwind_1401fe7d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1401fe7e0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe800(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe820(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe840(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe860(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe880(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe8a0(void)

{
  DAT_140320f60 = DAT_140320f60 & 0xfffffffe;
  return;
}



void Unwind_1401fe8c0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x108);
  return;
}



void Unwind_1401fe8d0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0xe0);
  return;
}



void Unwind_1401fe8e0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0xb8);
  return;
}



void Unwind_1401fe8f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x80);
  return;
}



void Unwind_1401fe900(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x68);
  return;
}



void Unwind_1401fe910(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x60);
  return;
}



void Unwind_1401fe920(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401fe930(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x78);
  return;
}



void Unwind_1401fe940(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401fe950(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401fe960(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401fe970(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401fe980(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401fe990(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe9b0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401fe9d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x80);
  return;
}



void Unwind_1401fe9e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x78);
  return;
}



void Unwind_1401fe9f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x70);
  return;
}



void Unwind_1401fea00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401fea10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x68);
  return;
}



void Unwind_1401fea20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401fea30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401fea40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401fea50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401fea60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401fea70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_1401fea80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Catch_All_1401fea90(void)

{
  FUN_14009a170();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401feac0(undefined8 param_1,longlong param_2)

{
  FUN_140096c30(param_2 + 0x38);
  return;
}



void Unwind_1401fead0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x68),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1401feaf0(undefined8 param_1,longlong param_2)

{
  FUN_140096c30(param_2 + 0x28);
  return;
}



void Unwind_1401feb00(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x80),*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1401feb20(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401feb40(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_1401feb60(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x60);
  for (lVar2 = *(longlong *)(param_2 + 0x50); lVar2 != lVar1; lVar2 = lVar2 + 0x48) {
    FUN_1400908a0();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401feba0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_1401febc0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x60);
  for (lVar2 = *(longlong *)(param_2 + 0x50); lVar2 != lVar1; lVar2 = lVar2 + 0x38) {
    FUN_14008f9e0();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fec00(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fec30(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fec60(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_1401fec80(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x60);
  for (lVar2 = *(longlong *)(param_2 + 0x50); lVar2 != lVar1; lVar2 = lVar2 + 0x28) {
    FUN_140097900();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fecc0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fecf0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_1401fed10(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x60);
  for (lVar2 = *(longlong *)(param_2 + 0x50); lVar2 != lVar1; lVar2 = lVar2 + 0xa0) {
    FUN_14008d600();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1401fed50(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1401fed80(undefined8 param_1,longlong param_2)

{
  FUN_14000c120(param_2 + 0x40);
  return;
}



void Unwind_1401fed90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x30));
  return;
}



void Unwind_1401feda0(undefined8 param_1,longlong param_2)

{
  FUN_140089740(param_2 + 0x28);
  return;
}



void Unwind_1401fedb0(undefined8 param_1,longlong param_2)

{
  FUN_140089d60(param_2 + 0x28);
  return;
}



void Unwind_1401fedc0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x80),*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1401fede0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x50);
  return;
}



void Unwind_1401fedf0(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x78);
  return;
}



void Unwind_1401fee00(undefined8 param_1,longlong param_2)

{
  FUN_140096510(param_2 + 0x28);
  return;
}



void Unwind_1401fee10(undefined8 param_1,longlong param_2)

{
  FUN_1400961a0(param_2 + 0x28);
  return;
}



void Unwind_1401fee20(undefined8 param_1,longlong param_2)

{
  FUN_140096510(param_2 + 0x28);
  return;
}



void Unwind_1401fee30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14001c600(param_2 + 0x58);
  return;
}



void Unwind_1401fee40(undefined8 param_1,longlong param_2)

{
  FUN_14000c120(param_2 + 0x90);
  return;
}



void Unwind_1401fee50(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0xf0);
  return;
}



void Unwind_1401fee60(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x118);
  return;
}



void Unwind_1401fee70(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0xf0);
  return;
}



void Unwind_1401fee80(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x118);
  return;
}



void Unwind_1401fee90(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x48),*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1401feeb0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x78),*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401feed0(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(longlong *)(param_2 + 0x78) + 8);
  return;
}



void Unwind_1401feee0(undefined8 param_1,longlong param_2)

{
  FUN_140096510(param_2 + 0x28);
  return;
}



void Unwind_1401feef0(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0xd0);
  return;
}



void Unwind_1401fef00(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0xa8);
  return;
}



void Unwind_1401fef10(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x20);
  return;
}



void Unwind_1401fef20(undefined8 param_1,longlong param_2)

{
  FUN_140026480(param_2 + 0x20);
  return;
}



void Unwind_1401fef30(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x58);
  return;
}



void Unwind_1401fef40(undefined8 param_1,longlong param_2)

{
  FUN_140026480(param_2 + 0x20);
  return;
}



void Unwind_1401fef50(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x58);
  return;
}



void Unwind_1401fef60(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x28);
  return;
}



void Unwind_1401fef70(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401fef77. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1401fef80(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001401fef87. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1401fef90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x28));
  return;
}



void Unwind_1401fefa0(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401fefc0(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401fefe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x60);
  return;
}



void Unwind_1401feff0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_1401ff000(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x128);
  return;
}



void Unwind_1401ff010(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0xd8);
  return;
}



void Unwind_1401ff020(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x100);
  return;
}



void Unwind_1401ff030(undefined8 param_1,longlong param_2)

{
  FUN_1400af160(param_2 + 0xb8);
  return;
}



void Unwind_1401ff040(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x60);
  return;
}



void Unwind_1401ff050(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_1401ff060(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401ff080(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x58);
  return;
}



void Unwind_1401ff090(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401ff0b0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0x38);
  return;
}



void Unwind_1401ff0c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401ff0d0(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401ff0f0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0xa0);
  return;
}



void Unwind_1401ff100(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0xd8);
  return;
}



void Unwind_1401ff110(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_1401ff120(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401ff140(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401ff160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x68);
  return;
}



void Unwind_1401ff170(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_1401ff180(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_1401ff190(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401ff1a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_1401ff1b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_1401ff1c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe8);
  return;
}



void Unwind_1401ff1d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401ff1e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1401ff1f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ff200(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1401ff210(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0xf8);
  return;
}



void Unwind_1401ff220(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x120);
  return;
}



void Unwind_1401ff230(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_1401ff240(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0xf0);
  return;
}



void Unwind_1401ff250(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x118);
  return;
}



void Unwind_1401ff260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1401ff270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_1401ff280(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1401ff290(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_1401ff2a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1401ff2b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1401ff2c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_1401ff2d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ff2e0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff300(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0xb0);
  return;
}



void Unwind_1401ff310(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_1401ff320(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x68);
  return;
}



void Unwind_1401ff350(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_1401ff360(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff380(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0xa8);
  return;
}



void Unwind_1401ff390(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1401ff3a0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff3c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x70);
  return;
}



void Unwind_1401ff3d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_1401ff3e0(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0xa0);
  return;
}



void Unwind_1401ff3f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1401ff400(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401ff420(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401ff440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x68);
  return;
}



void Unwind_1401ff450(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_1401ff460(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff480(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0xe0);
  return;
}



void Unwind_1401ff490(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_1401ff4a0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff4c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x70);
  return;
}



void Unwind_1401ff4d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x128);
  return;
}



void Unwind_1401ff4e0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x178);
  return;
}



void Unwind_1401ff4f0(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x1a0);
  return;
}



void Unwind_1401ff500(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x218);
  return;
}



void Unwind_1401ff510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x68);
  return;
}



void Unwind_1401ff520(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x118);
  return;
}



void Unwind_1401ff530(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff550(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0x40);
  return;
}



void Unwind_1401ff560(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401ff570(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff590(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff5b0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x98);
  return;
}



void Unwind_1401ff5c0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0xc0);
  return;
}



void Unwind_1401ff5d0(undefined8 param_1,longlong param_2)

{
  FUN_1400af160(param_2 + 0x78);
  return;
}



void Unwind_1401ff5e0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff600(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0x110);
  return;
}



void Unwind_1401ff610(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_1401ff620(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x1a0);
  return;
}



void Unwind_1401ff630(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x1c8);
  return;
}



void Unwind_1401ff640(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff660(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x68);
  return;
}



void Unwind_1401ff690(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x160);
  return;
}



void Unwind_1401ff6a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x78);
  return;
}



void Unwind_1401ff6b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x140);
  return;
}



void Unwind_1401ff6c0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x210);
  return;
}



void Unwind_1401ff6d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x70);
  return;
}



void Unwind_1401ff6e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x150);
  return;
}



void Unwind_1401ff6f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x80);
  return;
}



void Unwind_1401ff700(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x170);
  return;
}



void Unwind_1401ff710(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff730(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 200);
  return;
}



void Unwind_1401ff740(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_1401ff750(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff770(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff790(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x128);
  return;
}



void Unwind_1401ff7a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x70);
  return;
}



void Unwind_1401ff7b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf8);
  return;
}



void Unwind_1401ff7c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x68);
  return;
}



void Unwind_1401ff7d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x108);
  return;
}



void Unwind_1401ff7e0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff800(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0xd0);
  return;
}



void Unwind_1401ff810(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_1401ff820(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff840(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff860(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff880(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x120);
  return;
}



void Unwind_1401ff890(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x78);
  return;
}



void Unwind_1401ff8a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf8);
  return;
}



void Unwind_1401ff8b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x70);
  return;
}



void Unwind_1401ff8c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe8);
  return;
}



void Unwind_1401ff8d0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff8f0(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0xc0);
  return;
}



void Unwind_1401ff900(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa8);
  return;
}



void Unwind_1401ff910(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff930(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401ff950(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x68);
  return;
}



void Unwind_1401ff960(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_1401ff970(undefined8 param_1,longlong param_2)

{
  FUN_1401e46e0(param_2 + 0x70);
  return;
}



void Unwind_1401ff980(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_1401ff990(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff9b0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1401ff9d0(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401ff9f0(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401ffa10(undefined8 param_1,longlong param_2)

{
  FUN_1400216c0(param_2 + 0x50);
  return;
}



void Unwind_1401ffa20(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x98);
  return;
}



void Unwind_1401ffa30(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0xc0);
  return;
}



void Unwind_1401ffa40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ffa50(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401ffa70(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401ffa90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1401ffaa0(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401ffac0(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401ffae0(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401ffb00(void)

{
  DAT_140320f64 = DAT_140320f64 & 0xfffffffe;
  return;
}



void Unwind_1401ffb20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140099c50(param_2 + 0x58);
  return;
}



void Unwind_1401ffb30(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 200);
  return;
}



void Unwind_1401ffb40(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0xa0);
  return;
}



void Unwind_1401ffb50(undefined8 param_1,longlong param_2)

{
  FUN_140097930(param_2 + 0x80);
  return;
}



void Unwind_1401ffb60(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x40);
  return;
}



void Unwind_1401ffb70(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401ffb80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x48) + 0x10);
  return;
}



void Unwind_1401ffb90(undefined8 param_1,longlong param_2)

{
  FUN_140140df0(*(longlong *)(param_2 + 0x48) + 0x28);
  return;
}



void Unwind_1401ffba0(undefined8 param_1,longlong param_2)

{
  FUN_140089d60(param_2 + 0x28);
  return;
}



void Unwind_1401ffbb0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x68),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1401ffbd0(undefined8 param_1,longlong param_2)

{
  FUN_14000b260(param_2 + 0x48);
  return;
}



void Unwind_1401ffbe0(undefined8 param_1,longlong param_2)

{
  FUN_140087640(param_2 + 0x20);
  return;
}



void Unwind_1401ffbf0(undefined8 param_1,longlong param_2)

{
  FUN_140087640(param_2 + 0x68);
  return;
}



void Unwind_1401ffc00(undefined8 param_1,longlong param_2)

{
  FUN_14000c120(param_2 + 0xb0);
  return;
}



void Unwind_1401ffc10(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x88);
  return;
}



void Unwind_1401ffc20(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x110);
  return;
}



void Unwind_1401ffc30(undefined8 param_1,longlong param_2)

{
  FUN_14000b260(param_2 + 0x20);
  return;
}



void Unwind_1401ffc40(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x48),*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1401ffc60(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_1401ffc70(undefined8 param_1,longlong param_2)

{
  FUN_140087640(param_2 + 0x88);
  return;
}



void Unwind_1401ffc80(undefined8 param_1,longlong param_2)

{
  FUN_140087640(param_2 + 0x110);
  return;
}



void Unwind_1401ffc90(undefined8 param_1,longlong param_2)

{
  FUN_140026b00(param_2 + 0x50);
  return;
}



void Unwind_1401ffca0(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0xb0);
  return;
}



void Unwind_1401ffcb0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x50);
  return;
}



void Unwind_1401ffcc0(undefined8 param_1,longlong param_2)

{
  FUN_140026480(param_2 + 0x50);
  return;
}



void Unwind_1401ffcd0(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x88);
  return;
}



void Unwind_1401ffce0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x150);
  return;
}



void Unwind_1401ffcf0(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x110);
  return;
}



void Unwind_1401ffd00(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x150);
  return;
}



void Unwind_1401ffd10(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x110);
  return;
}



void Unwind_1401ffd20(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x150);
  return;
}



void Unwind_1401ffd30(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x110);
  return;
}



void Unwind_1401ffd40(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x150);
  return;
}



void Unwind_1401ffd50(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x110);
  return;
}



void Unwind_1401ffd60(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x150);
  return;
}



void Unwind_1401ffd70(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x110);
  return;
}



void Unwind_1401ffd80(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x110);
  return;
}



void Unwind_1401ffd90(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x110);
  return;
}



void Unwind_1401ffda0(undefined8 param_1,longlong param_2)

{
  FUN_14008a810(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1401ffdb0(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_1401ffdc0(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(longlong *)(param_2 + 0x48) + 0x30);
  return;
}



void Unwind_1401ffdd0(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(longlong *)(param_2 + 0x48) + 0x58);
  return;
}



void Unwind_1401ffde0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x48) + 0x90);
  return;
}



void Unwind_1401ffe00(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x48) + 0xb8);
  return;
}



void Unwind_1401ffe20(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x48) + 0xe0);
  return;
}



void Unwind_1401ffe40(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x48) + 0x108);
  return;
}



void Unwind_1401ffe60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140088e70(*(longlong *)(param_2 + 0x48) + 0x188);
  return;
}



void Unwind_1401ffe80(undefined8 param_1,longlong param_2)

{
  FUN_140089740(*(longlong *)(param_2 + 0x48) + 0x1a8);
  return;
}



void Unwind_1401ffea0(undefined8 param_1,longlong param_2)

{
  FUN_140021640(param_2 + 0x20);
  return;
}



void Unwind_1401ffeb0(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x58);
  return;
}



void Unwind_1401ffec0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x80);
  return;
}



void Unwind_1401ffed0(undefined8 param_1,longlong param_2)

{
  FUN_14008a5d0(param_2 + 0xb0);
  return;
}



void Unwind_1401ffee0(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0x68);
  return;
}



void Unwind_1401ffef0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401fff00(undefined8 param_1,longlong param_2)

{
  FUN_14008f9e0(param_2 + 0xc0);
  return;
}



void Unwind_1401fff10(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 200);
  return;
}



void Unwind_1401fff20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1401fff30(undefined8 param_1,longlong param_2)

{
  FUN_14008f9e0(param_2 + 0x120);
  return;
}



void Unwind_1401fff40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1401fff50(undefined8 param_1,longlong param_2)

{
  FUN_1400216c0(param_2 + 0x30);
  return;
}



void Unwind_1401fff60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x38);
  return;
}



void Unwind_1401fff70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1401fff80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1401fff90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1401fffa0(undefined8 param_1,longlong param_2)

{
  FUN_1400216c0(param_2 + 0x30);
  return;
}



void Unwind_1401fffb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000c2a0(param_2 + 0x38);
  return;
}



void Unwind_1401fffc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1401fffd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1401fffe0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1401ffff0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_140200000(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x88);
  return;
}



void Unwind_140200010(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x38);
  return;
}



void Unwind_140200020(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x60);
  return;
}



void Unwind_140200030(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x28);
  return;
}



void Unwind_140200040(undefined8 param_1,longlong param_2)

{
  FUN_14008d600(param_2 + 0x40);
  return;
}



void Unwind_140200050(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_140200070(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x20),*(undefined8 *)(param_2 + 0x28));
  return;
}



void Unwind_140200090(undefined8 param_1,longlong param_2)

{
  FUN_14008d940(param_2 + 0x58);
  return;
}



void Unwind_1402000a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1402000b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_1402000c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_1402000d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e0);
  return;
}



void Unwind_1402000e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1402000f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140200100(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140200110(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140200120(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140200130(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140200140(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140200150(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e8);
  return;
}



void Unwind_140200160(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140200170(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_140200180(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140200190(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1402001a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_1402001b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1402001c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_1402001d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1402001e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f0);
  return;
}



void Unwind_1402001f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140200200(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140200210(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140200220(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140200230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140200240(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140200250(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140200260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140200270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x200);
  return;
}



void Unwind_140200280(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140200290(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1402002a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1402002b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1402002c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_1402002d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1402002e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1402002f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f8);
  return;
}



void Unwind_140200300(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140200310(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140200320(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140200330(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140200340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140200350(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140200360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_140200370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140200380(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x230);
  return;
}



void Unwind_140200390(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1402003a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1402003b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_1402003c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1402003d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x238);
  return;
}



void Unwind_1402003e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_1402003f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_140200400(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140200410(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x248);
  return;
}



void Unwind_140200420(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140200430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140200440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x208);
  return;
}



void Unwind_140200450(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140200460(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_140200470(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140200480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x228);
  return;
}



void Unwind_140200490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_1402004a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_1402004b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1402004c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x220);
  return;
}



void Unwind_1402004d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_1402004e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_1402004f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140200500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x240);
  return;
}



void Unwind_140200510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140200520(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_140200530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140200540(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x210);
  return;
}



void Unwind_140200550(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_140200560(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_140200570(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140200580(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x218);
  return;
}



void Unwind_140200590(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



undefined8 Catch_All_1402005a0(void)

{
  return 0x14009c003;
}



void Unwind_1402005c0(undefined8 param_1,longlong param_2)

{
  FUN_14008d600(param_2 + 0x90);
  return;
}



void Unwind_1402005d0(undefined8 param_1,longlong param_2)

{
  FUN_14000c120(param_2 + 0x30);
  return;
}



void Unwind_1402005e0(undefined8 param_1,longlong param_2)

{
  FUN_14008cdd0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1402005f0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001402005f7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_140200600(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140200607. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_140200610(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140200617. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_140200620(undefined8 param_1,longlong param_2)

{
  FUN_14008d1f0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_140200630(undefined8 param_1,longlong param_2)

{
  FUN_14008e2d0(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_140200640(undefined8 param_1,longlong param_2)

{
  FUN_14008c730(param_2 + 0x80);
  return;
}



void Unwind_140200650(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140200660(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140200670(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x58);
  return;
}



void Unwind_140200680(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140200690(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1402006a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1402006b0(undefined8 param_1,longlong param_2)

{
  FUN_14008cb00(param_2 + 0x58);
  return;
}



void Unwind_1402006c0(undefined8 param_1,longlong param_2)

{
  FUN_14008c980(param_2 + 0x20);
  return;
}



undefined * Catch_1402006d0(undefined8 param_1,longlong param_2)

{
  char *_Str;
  
  _Str = (char *)(**(code **)(**(longlong **)(param_2 + 0x48) + 8))();
  puts(_Str);
  return &DAT_14008c5ae;
}



void Unwind_140200700(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140200710(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_140200720(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_140200730(undefined8 param_1,longlong param_2)

{
  FUN_14008cb00(param_2 + 0x98);
  return;
}



void Unwind_140200740(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140200750(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x1b0);
  return;
}



void Unwind_140200760(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x200);
  return;
}



void Unwind_140200770(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x20);
  return;
}



void Unwind_140200780(undefined8 param_1,longlong param_2)

{
  FUN_140026480(param_2 + 0x20);
  return;
}



void Unwind_140200790(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x58);
  return;
}



void Unwind_1402007a0(undefined8 param_1,longlong param_2)

{
  FUN_1400852d0(param_2 + 0xc0);
  return;
}



void Unwind_1402007b0(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x1d8);
  return;
}



void Unwind_1402007c0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001402007d2. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_ostream<>::~basic_ostream<>((basic_ostream<> *)(*(longlong *)(param_2 + 0xb0) + -0x80))
  ;
  return;
}



void Unwind_1402007e0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001402007e7. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_streambuf<>::~basic_streambuf<>(*(basic_streambuf<> **)(param_2 + 0xa0));
  return;
}



void Unwind_1402007f0(undefined8 param_1,longlong param_2)

{
  FUN_140026480(param_2 + 0x20);
  return;
}



void Unwind_140200800(undefined8 param_1,longlong param_2)

{
  FUN_1400034a0(param_2 + 0x58);
  return;
}



void Unwind_140200810(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x50);
  return;
}



void Unwind_140200820(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0xb0);
  return;
}



void Unwind_140200830(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(param_2 + 0x78);
  return;
}



void Unwind_140200840(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x48);
  return;
}



void Unwind_140200850(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 200) + 8);
  return;
}



void Unwind_140200860(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x48);
  return;
}



void Unwind_140200870(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xc0) + 8);
  return;
}



void Unwind_140200880(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x60);
  return;
}



void Unwind_140200890(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xd8) + 8);
  return;
}



void Unwind_1402008a0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x48);
  return;
}



void Unwind_1402008b0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x90) + 8);
  return;
}



void Unwind_1402008c0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x60);
  return;
}



void Unwind_1402008d0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_1402008e0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x60);
  return;
}



void Unwind_1402008f0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xe8) + 8);
  return;
}



void Unwind_140200900(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x60);
  return;
}



void Unwind_140200910(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 200) + 8);
  return;
}



void Unwind_140200920(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200940(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200960(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200980(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1402009a0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1402009c0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1402009e0(undefined8 param_1,longlong param_2)

{
  FUN_140021640(param_2 + 0x28);
  return;
}



void Unwind_1402009f0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200a10(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200a30(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200a50(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200a70(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200a90(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200ab0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200ad0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200af0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140200af7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x70));
  return;
}



void Unwind_140200b00(undefined8 param_1,longlong param_2)

{
  FUN_14000ae60(param_2 + 0x58);
  return;
}



void Unwind_140200b10(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140200b17. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x70));
  return;
}



void Unwind_140200b20(undefined8 param_1,longlong param_2)

{
  FUN_14000ae60(param_2 + 0x20);
  return;
}



void Unwind_140200b30(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140200b37. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x70));
  return;
}



void Unwind_140200b40(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0xb0),*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140200b60(undefined8 param_1,longlong param_2)

{
  FUN_14000aec0(param_2 + 0xa8);
  return;
}



void Unwind_140200b70(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140200b77. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x70));
  return;
}



void Unwind_140200b80(undefined8 param_1,longlong param_2)

{
  FUN_14001b450(*(longlong *)(param_2 + 0x70) + 0x28);
  return;
}



void Unwind_140200b90(undefined8 param_1,longlong param_2)

{
  FUN_14000af70(param_2 + 0x80);
  return;
}



void Unwind_140200ba0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x168);
  return;
}



void Unwind_140200bb0(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140200bc0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200be0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200c00(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200c20(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200c40(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200c60(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200c80(undefined8 param_1,longlong param_2)

{
  FUN_14000afb0(param_2 + 0x28);
  return;
}



void Unwind_140200c90(undefined8 param_1,longlong param_2)

{
  FUN_14000afb0(param_2 + 0x30);
  return;
}



void Unwind_140200ca0(undefined8 param_1,longlong param_2)

{
  FUN_14000afb0(param_2 + 0x40);
  return;
}



void Unwind_140200cb0(undefined8 param_1,longlong param_2)

{
  FUN_14000afb0(param_2 + 0x68);
  return;
}



void Unwind_140200cc0(undefined8 param_1,longlong param_2)

{
  FUN_14000c120(param_2 + 0x1c0);
  return;
}



void Unwind_140200cd0(undefined8 param_1,longlong param_2)

{
  FUN_14000c120(param_2 + 0x280);
  return;
}



void Unwind_140200ce0(undefined8 param_1,longlong param_2)

{
  FUN_14000c120(param_2 + 0x220);
  return;
}



void Unwind_140200cf0(undefined8 param_1,longlong param_2)

{
  FUN_14000c120(param_2 + 0x2e0);
  return;
}



void Unwind_140200d00(undefined8 param_1,longlong param_2)

{
  FUN_140008b10(param_2 + 0xd8);
  return;
}



void Unwind_140200d10(undefined8 param_1,longlong param_2)

{
  FUN_140008b10(param_2 + 0x118);
  return;
}



void Unwind_140200d20(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 400);
  return;
}



void Unwind_140200d30(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140200d37. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_140200d40(undefined8 param_1,longlong param_2)

{
  FUN_1401e46e0(param_2 + 0x178);
  return;
}



void Unwind_140200d50(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(param_2 + 0xe8);
  return;
}



void Unwind_140200d60(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200d80(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140200da0(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140200db0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14008eb80(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_140200dc0(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_140200dd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14009bff0(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_140200de0(undefined8 param_1,longlong param_2)

{
  FUN_140099b20(param_2 + 0xd70);
  return;
}



void Unwind_140200df0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140099bd0(param_2 + 0x48);
  return;
}



void Unwind_140200e00(undefined8 param_1,longlong param_2)

{
  FUN_14009c010(param_2 + 0xb0);
  return;
}



void Unwind_140200e10(undefined8 param_1,longlong param_2)

{
  FUN_1400961a0(param_2 + 0x28);
  return;
}



void Unwind_140200e20(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x20) & 1) != 0) {
    *(uint *)(param_2 + 0x20) = *(uint *)(param_2 + 0x20) & 0xfffffffe;
    thunk_FUN_140099bd0(*(undefined8 *)(param_2 + 0xa8));
  }
  return;
}



void Unwind_140200e50(undefined8 param_1,longlong param_2)

{
  FUN_140096510(param_2 + 0x28);
  return;
}



void Unwind_140200e60(undefined8 param_1,longlong param_2)

{
  FUN_140096510(param_2 + 0x28);
  return;
}



void Unwind_140200e70(undefined8 param_1,longlong param_2)

{
  FUN_140096510(param_2 + 0x28);
  return;
}



void Unwind_140200e80(undefined8 param_1,longlong param_2)

{
  FUN_140096510(param_2 + 0x28);
  return;
}



void Unwind_140200e90(undefined8 param_1,longlong param_2)

{
  FUN_140096340(param_2 + 0x60);
  return;
}



void Unwind_140200ea0(undefined8 param_1,longlong param_2)

{
  FUN_140096510(param_2 + 0x28);
  return;
}



void Unwind_140200eb0(undefined8 param_1,longlong param_2)

{
  FUN_140096510(param_2 + 0x28);
  return;
}



void Unwind_140200ec0(undefined8 param_1,longlong param_2)

{
  FUN_140096510(param_2 + 0x28);
  return;
}



void Unwind_140200ed0(undefined8 param_1,longlong param_2)

{
  FUN_140096510(param_2 + 0x28);
  return;
}



void Unwind_140200ee0(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x48);
  return;
}



void Unwind_140200ef0(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0x80) + 8);
  return;
}



void Unwind_140200f00(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x48);
  return;
}



void Unwind_140200f10(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xa8) + 8);
  return;
}



void Unwind_140200f20(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x48);
  return;
}



void Unwind_140200f30(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xb8) + 8);
  return;
}



void Unwind_140200f40(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x48);
  return;
}



void Unwind_140200f50(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xa0) + 8);
  return;
}



void Unwind_140200f60(undefined8 param_1,longlong param_2)

{
  FUN_14003d170(param_2 + 0x48);
  return;
}



void Unwind_140200f70(undefined8 param_1,longlong param_2)

{
  FUN_14003d100(*(longlong *)(param_2 + 0xb0) + 8);
  return;
}



void Catch_All_140200f80(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  for (lVar2 = *(longlong *)(param_2 + 0x40); lVar2 != lVar1; lVar2 = lVar2 + 0x10) {
    FUN_140099bd0();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140200fc0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140200ff0(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140201000(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140201010(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(undefined8 *)(param_2 + 0xa0));
  return;
}



void Unwind_140201020(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14008eb80(*(longlong *)(param_2 + 0xa0) + 0x28);
  return;
}



void Unwind_140201030(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0xa0) + 0x48);
  return;
}



void Unwind_140201040(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14009bff0(*(longlong *)(param_2 + 0xa0) + 0x68);
  return;
}



void Unwind_140201050(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140201060(undefined8 param_1,longlong param_2)

{
  FUN_14009b370(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140201070(undefined8 param_1,longlong param_2)

{
  FUN_14009b2f0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140201080(undefined8 param_1,longlong param_2)

{
  FUN_14009a150(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_140201090(undefined8 param_1,longlong param_2)

{
  FUN_140096550(*(longlong *)(param_2 + 0x40) + 0x58);
  return;
}



void Unwind_1402010a0(undefined8 param_1,longlong param_2)

{
  FUN_140099ad0(*(longlong *)(param_2 + 0x40) + 0x98);
  return;
}



void Unwind_1402010c0(undefined8 param_1,longlong param_2)

{
  FUN_140099ad0(*(longlong *)(param_2 + 0x40) + 200);
  return;
}



void Unwind_1402010e0(undefined8 param_1,longlong param_2)

{
  FUN_14009b370(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1402010f0(undefined8 param_1,longlong param_2)

{
  FUN_140001cc0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140201100(undefined8 param_1,longlong param_2)

{
  FUN_1400a1cd0(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_140201110(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_140201130(undefined8 param_1,longlong param_2)

{
  FUN_1400710f0(*(longlong *)(param_2 + 0x40) + 0xa8);
  return;
}



void Unwind_140201150(undefined8 param_1,longlong param_2)

{
  FUN_140004930(*(longlong *)(param_2 + 0x40) + 200);
  return;
}



void Unwind_140201170(undefined8 param_1,longlong param_2)

{
  FUN_14000b260(*(longlong *)(param_2 + 0x40) + 0x160);
  return;
}



void Unwind_140201190(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140201197. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_1402011a0(undefined8 param_1,longlong param_2)

{
  FUN_14009a150(param_2 + 0x28);
  return;
}



void Unwind_1402011b0(undefined8 param_1,longlong param_2)

{
  FUN_14009aa60(param_2 + 0x28);
  return;
}



void Unwind_1402011c0(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x90),*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_1402011f0(undefined8 param_1,longlong param_2)

{
  FUN_14009aa60(param_2 + 0x38);
  return;
}



void Unwind_140201200(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x78),*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140201220(undefined8 param_1,longlong param_2)

{
  FUN_140097900(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140201230(undefined8 param_1,longlong param_2)

{
  FUN_140099b20(param_2 + 0x160);
  return;
}



void Unwind_140201240(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x78);
  return;
}



void Unwind_140201250(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x100);
  return;
}



void Unwind_140201260(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0xa0);
  return;
}



void Unwind_140201270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140099bd0(param_2 + 0x20);
  return;
}



void Unwind_140201280(undefined8 param_1,longlong param_2)

{
  FUN_140098990(param_2 + 200);
  return;
}



void Unwind_140201290(undefined8 param_1,longlong param_2)

{
  FUN_140098990(param_2 + 0x128);
  return;
}



void Unwind_1402012a0(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x128);
  return;
}



void Unwind_1402012b0(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 200);
  return;
}



void Unwind_1402012c0(undefined8 param_1,longlong param_2)

{
  FUN_140099b20(param_2 + 0x130);
  return;
}



void Unwind_1402012d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140099bd0(param_2 + 0x20);
  return;
}



void Unwind_1402012e0(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x80);
  return;
}



void Unwind_1402012f0(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x100);
  return;
}



void Unwind_140201300(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0xb0);
  return;
}



void Unwind_140201310(undefined8 param_1,longlong param_2)

{
  FUN_140096f80(param_2 + 0xb0);
  return;
}



void Unwind_140201320(undefined8 param_1,longlong param_2)

{
  FUN_140099b20(param_2 + 0x88);
  return;
}



void Unwind_140201330(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x38);
  return;
}



void Unwind_140201340(undefined8 param_1,longlong param_2)

{
  FUN_140097900(param_2 + 0x60);
  return;
}



void Unwind_140201350(undefined8 param_1,longlong param_2)

{
  FUN_1400908a0(param_2 + 0x50);
  return;
}



void Unwind_140201360(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x38));
  return;
}



void Unwind_140201380(undefined8 param_1,longlong param_2)

{
  FUN_14003bf20(*(undefined8 *)(param_2 + 0x38),*(undefined8 *)(param_2 + 0x30));
  return;
}



void Unwind_1402013a0(undefined8 param_1,longlong param_2)

{
  FUN_14008f9e0(param_2 + 0x28);
  return;
}



void Unwind_1402013b0(undefined8 param_1,longlong param_2)

{
  FUN_1401e46e0(param_2 + 0x28);
  return;
}



void Unwind_1402013c0(void)

{
  DAT_140320f68 = DAT_140320f68 & 0xfffffffe;
  return;
}



void Unwind_1402013e0(void)

{
  thunk_FUN_1400902e0(&DAT_140320668);
  return;
}



void Unwind_1402013f0(undefined8 param_1,longlong param_2)

{
  FUN_1401e46e0(param_2 + 0x28);
  return;
}



void Unwind_140201400(void)

{
  DAT_140320f6c = DAT_140320f6c & 0xfffffffe;
  return;
}



void Unwind_140201420(void)

{
  thunk_FUN_140090180(&DAT_140320690);
  return;
}



void Unwind_140201430(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0x58);
  return;
}



void Unwind_140201440(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140201450(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_140201460(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_140201470(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_140201480(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_140201490(undefined8 param_1,longlong param_2)

{
  FUN_140070e40(param_2 + 0x68);
  return;
}



void Unwind_1402014a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1402014b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1402014c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1402014d0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_1402014f0(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140201510(void)

{
  DAT_140320f5c = DAT_140320f5c & 0xfffffffe;
  return;
}



void Unwind_140201530(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140201537. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_140201540(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140201547. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_140201550(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140201557. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x2200));
  return;
}



void Unwind_140201560(undefined8 param_1,longlong param_2)

{
  FUN_140004970(param_2 + 0x30);
  return;
}



void Unwind_140201570(void)

{
  FUN_14008eab0(&DAT_140320040);
  return;
}



void FUN_140201580(void)

{
  FUN_140001b00(&DAT_140312d90,L"option\\gate_serveroption.xml",0x1c);
  atexit(FUN_140202370);
  return;
}



void FUN_1402015b0(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_140320f70,uVar1,0);
  atexit((_func_5014 *)&LAB_1402023b0);
  return;
}



void FUN_140201620(void)

{
  InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_140320008);
  atexit((_func_5014 *)&LAB_1402024e0);
  return;
}



void FUN_140201670(void)

{
  FUN_140001b00(&DAT_140312e08,L"option\\total_option.xml",0x17);
  atexit(FUN_1402024f0);
  return;
}



void FUN_1402016a0(void)

{
  FUN_140003e60(&DAT_140312e30,"option\\agent.xml",0x10);
  atexit(FUN_140202530);
  return;
}



void FUN_1402016d0(void)

{
  FUN_140003e60(&DAT_140312e58,"option\\patch.xml",0x10);
  atexit(FUN_140202570);
  return;
}



void FUN_140201700(void)

{
  FUN_14008ea10();
  atexit(FUN_1402025b0);
  return;
}



void FUN_140201720(void)

{
  FUN_140003e60(&DAT_140312e80,"option\\content_control.xml",0x1a);
  atexit(FUN_140202610);
  return;
}



void FUN_140201750(void)

{
  FUN_140003e60(&DAT_140312ea8,"option\\shop_control.xml",0x17);
  atexit(FUN_140202660);
  return;
}



void FUN_140201780(void)

{
  FUN_140003e60(&DAT_140312ed0,"option\\log_control.xml",0x16);
  atexit(FUN_1402026a0);
  return;
}



void FUN_140201800(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_140313f48,uVar1,0);
  atexit((_func_5014 *)&LAB_140202840);
  return;
}



void FUN_140201830(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_140313f10,uVar1,0);
  atexit((_func_5014 *)&LAB_140202830);
  return;
}



void FUN_140201860(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_140313fd0,uVar1,1);
  atexit((_func_5014 *)&LAB_140202860);
  return;
}



void FUN_140201900(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_140314030,uVar1,0);
  atexit((_func_5014 *)&LAB_1402028a0);
  return;
}



void FUN_140201930(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_140314148,uVar1,0);
  atexit((_func_5014 *)&LAB_1402028b0);
  return;
}



void FUN_140201960(void)

{
  FUN_1400a72a0(&DAT_140314250,&DAT_14027a10a,0xffff);
  atexit((_func_5014 *)&LAB_140202910);
  return;
}



void FUN_140201990(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_140314218,uVar1,0);
  atexit((_func_5014 *)&LAB_1402028f0);
  return;
}



void FUN_1402019c0(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_1403141e0,uVar1,0);
  atexit((_func_5014 *)&LAB_1402028e0);
  return;
}



void FUN_1402019f0(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_1403142d8,uVar1,1);
  atexit((_func_5014 *)&LAB_140202920);
  return;
}



void FUN_140201a20(void)

{
  FUN_1400acf50(&DAT_140314310);
  FUN_1400ad070(&DAT_140314310);
  atexit((_func_5014 *)&LAB_140202930);
  return;
}



void FUN_140201a60(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_1403157a0,uVar1,0);
  atexit((_func_5014 *)&LAB_140202950);
  return;
}



void FUN_140201a8c(void)

{
  ATL::CAtlBaseModule::CAtlBaseModule((CAtlBaseModule *)&DAT_1403157e0);
  atexit((_func_5014 *)&LAB_14020297c);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140201aac(void)

{
  DAT_140315848 = GetProcessHeap();
  DAT_140315850 = 0;
  _DAT_140315840 = &PTR_LAB_140206d00;
  atexit(FUN_140202988);
  return;
}



void FUN_140201de0(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_140318e80,uVar1,0);
  atexit((_func_5014 *)&LAB_140202a00);
  return;
}



void FUN_140201ed0(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_140319008,uVar1,0);
  atexit((_func_5014 *)&LAB_140202ac0);
  return;
}



void FUN_140201f00(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_1403190d0,uVar1,1);
  atexit((_func_5014 *)&LAB_140202ad0);
  return;
}



void FUN_140201f40(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_140319098,uVar1,0);
  atexit((_func_5014 *)&LAB_140202af0);
  return;
}



void FUN_140201f70(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_140319060,uVar1,0);
  atexit((_func_5014 *)&LAB_140202ae0);
  return;
}



void FUN_140201fb0(void)

{
  undefined4 uVar1;
  undefined8 in_R9;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_140319128,uVar1,1,in_R9,uVar2);
  FUN_1400a1c30(&DAT_140319128);
  DAT_140319120 = operator_new(8);
  if (DAT_140319120 != (undefined8 *)0x0) {
    *DAT_140319120 = 0;
  }
  FUN_1400d1290(&DAT_140319128);
  atexit(FUN_140202b70);
  return;
}



void FUN_140202030(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_140319160,uVar1,1);
  atexit((_func_5014 *)&LAB_140202be0);
  return;
}



void FUN_140202060(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_14031a208,uVar1,0);
  atexit((_func_5014 *)&LAB_140202c30);
  return;
}



void FUN_140202090(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1401692e0();
  FUN_1400a1b50(&DAT_14031a2d8,uVar1,0);
  atexit((_func_5014 *)&LAB_140202c50);
  return;
}



void FUN_1402020c0(void)

{
  int *piVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  undefined *puVar5;
  
  FUN_1400a3440();
  DAT_14031a310 = PTR_DAT_1402f8008;
  iVar2 = FUN_1400a3360(
                       "M-SEARCH * HTTP/1.1\r\nHost:239.255.255.250:1900\r\nST:upnp:rootdevice\r\nMan:\"ssdp:discover\"\r\nMX:3\r\n\r\n"
                       );
  if (DAT_14031a310 == (undefined *)0x0) {
    iVar4 = 0;
  }
  else if (DAT_14031a310 == PTR_DAT_1402f8008) {
    iVar4 = 0;
  }
  else {
    iVar4 = *(int *)(DAT_14031a310 + -8);
  }
  iVar3 = iVar2;
  if (iVar2 <= iVar4) {
    if (DAT_14031a310 == (undefined *)0x0) {
      iVar3 = 0;
    }
    else if (DAT_14031a310 == PTR_DAT_1402f8008) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(DAT_14031a310 + -8);
    }
  }
  iVar4 = 1;
  if (1 < iVar3) {
    iVar4 = iVar3;
  }
  if (DAT_14031a310 == (undefined *)0x0) {
    iVar3 = 0;
  }
  else if (DAT_14031a310 == PTR_DAT_1402f8008) {
    iVar3 = 0;
  }
  else {
    iVar3 = *(int *)(DAT_14031a310 + -8);
  }
  if (iVar3 < iVar4) {
    FUN_14000c1c0(&DAT_14031a310);
  }
  FUN_14000c330(&DAT_14031a310);
  puVar5 = DAT_14031a310;
  if (DAT_14031a310 == (undefined *)0x0) {
    puVar5 = PTR_DAT_1402f8008;
  }
  FUN_1400a3390(puVar5,
                "M-SEARCH * HTTP/1.1\r\nHost:239.255.255.250:1900\r\nST:upnp:rootdevice\r\nMan:\"ssdp:discover\"\r\nMX:3\r\n\r\n"
                ,iVar2);
  iVar4 = FUN_1400a3360();
  iVar2 = 0;
  if (0 < iVar4) {
    iVar2 = iVar4;
  }
  if (DAT_14031a310 == (undefined *)0x0) {
    iVar4 = 0;
  }
  else if (DAT_14031a310 == PTR_DAT_1402f8008) {
    iVar4 = 0;
  }
  else {
    iVar4 = *(int *)(DAT_14031a310 + -8);
  }
  if (iVar4 <= iVar2) {
    if (DAT_14031a310 == (undefined *)0x0) {
      iVar2 = 0;
    }
    else if (DAT_14031a310 == PTR_DAT_1402f8008) {
      iVar2 = 0;
    }
    else {
      iVar2 = *(int *)(DAT_14031a310 + -8);
    }
  }
  if (((DAT_14031a310 != PTR_DAT_1402f8008) && (DAT_14031a310 != (undefined *)0x0)) &&
     (piVar1 = (int *)(DAT_14031a310 + -8), piVar1 != (int *)0x0)) {
    *piVar1 = iVar2;
    *(undefined1 *)((longlong)iVar2 + 8 + (longlong)piVar1) = 0;
  }
  atexit((_func_5014 *)&LAB_140202c60);
  return;
}



void FUN_140202210(void)

{
  undefined8 uVar1;
  undefined4 uVar2;
  undefined *local_res8 [4];
  
  FUN_1400a3440();
  local_res8[0] = PTR_DAT_1402f8008;
  uVar2 = FUN_1400a3360("239.255.255.250");
  uVar1 = FUN_14000c420(local_res8,uVar2);
  FUN_1400a3390(uVar1,"239.255.255.250",uVar2);
  FUN_14000c510(local_res8);
  FUN_1400a6800(&DAT_14031a318,local_res8,0x76c);
  return;
}



void FUN_140202290(void)

{
  undefined8 uVar1;
  undefined4 uVar2;
  undefined *local_res8 [4];
  
  FUN_1400a3440();
  local_res8[0] = PTR_DAT_1402f8010;
  uVar2 = FUN_1400a32c0(L"211.214.161.39");
  uVar1 = FUN_140002f20(local_res8,uVar2);
  FUN_1400a32f0(uVar1,L"211.214.161.39",uVar2);
  FUN_140003000(local_res8);
  FUN_1400a6870(&DAT_14031d588,local_res8,0x50);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140202370(void)

{
  if (7 < DAT_140312da8) {
    operator_delete((void *)CONCAT62(DAT_140312d90._2_6_,(undefined2)DAT_140312d90));
  }
  DAT_140312da8 = 7;
  _DAT_140312da0 = 0;
  DAT_140312d90._0_2_ = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1402023c0(void)

{
  if (DAT_14031ffa8 != (void *)0x0) {
    operator_delete(DAT_14031ffa8);
  }
  DAT_14031ffa8 = (void *)0x0;
  _DAT_14031ffb0 = 0;
  _DAT_14031ffb8 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140202400(void)

{
  if (DAT_14031ffc8 != (void *)0x0) {
    operator_delete(DAT_14031ffc8);
  }
  DAT_14031ffc8 = (void *)0x0;
  _DAT_14031ffd0 = 0;
  _DAT_14031ffd8 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140202440(void)

{
  if (DAT_14031ffe8 != (void *)0x0) {
    operator_delete(DAT_14031ffe8);
  }
  DAT_14031ffe8 = (void *)0x0;
  _DAT_14031fff0 = 0;
  _DAT_14031fff8 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1402024a0(void)

{
  if (7 < DAT_140313e58) {
    operator_delete((void *)CONCAT62(DAT_140313e40._2_6_,(undefined2)DAT_140313e40));
  }
  DAT_140313e58 = 7;
  _DAT_140313e50 = 0;
  DAT_140313e40._0_2_ = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1402024f0(void)

{
  if (7 < DAT_140312e20) {
    operator_delete((void *)CONCAT62(DAT_140312e08._2_6_,(undefined2)DAT_140312e08));
  }
  DAT_140312e20 = 7;
  _DAT_140312e18 = 0;
  DAT_140312e08._0_2_ = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140202530(void)

{
  if (0xf < DAT_140312e48) {
    operator_delete((void *)CONCAT71(DAT_140312e30._1_7_,(undefined1)DAT_140312e30));
  }
  DAT_140312e48 = 0xf;
  _DAT_140312e40 = 0;
  DAT_140312e30._0_1_ = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140202570(void)

{
  if (0xf < DAT_140312e70) {
    operator_delete((void *)CONCAT71(DAT_140312e58._1_7_,(undefined1)DAT_140312e58));
  }
  DAT_140312e70 = 0xf;
  _DAT_140312e68 = 0;
  DAT_140312e58._0_1_ = 0;
  return;
}



void FUN_1402025b0(void)

{
  undefined8 in_R9;
  undefined1 local_res8 [32];
  
  FUN_14008ecd0(local_res8,*DAT_140320048,DAT_140320048,in_R9,0xfffffffffffffffe);
                    // WARNING: Could not recover jumptable at 0x0001402025e0. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(DAT_140320048);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140202610(void)

{
  if (0xf < DAT_140312e98) {
    operator_delete((void *)CONCAT71(DAT_140312e80._1_7_,(undefined1)DAT_140312e80));
  }
  DAT_140312e98 = 0xf;
  _DAT_140312e90 = 0;
  DAT_140312e80._0_1_ = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140202660(void)

{
  if (0xf < DAT_140312ec0) {
    operator_delete((void *)CONCAT71(DAT_140312ea8._1_7_,(undefined1)DAT_140312ea8));
  }
  DAT_140312ec0 = 0xf;
  _DAT_140312eb8 = 0;
  DAT_140312ea8._0_1_ = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1402026a0(void)

{
  if (0xf < DAT_140312ee8) {
    operator_delete((void *)CONCAT71(DAT_140312ed0._1_7_,(undefined1)DAT_140312ed0));
  }
  DAT_140312ee8 = 0xf;
  _DAT_140312ee0 = 0;
  DAT_140312ed0._0_1_ = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1402026f0(void)

{
  if (DAT_140320060 != (void *)0x0) {
    operator_delete(DAT_140320060);
  }
  DAT_140320060 = (void *)0x0;
  _DAT_140320068 = 0;
  _DAT_140320070 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140202730(void)

{
  if (DAT_140320080 != (void *)0x0) {
    operator_delete(DAT_140320080);
  }
  DAT_140320080 = (void *)0x0;
  _DAT_140320088 = 0;
  _DAT_140320090 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140202770(void)

{
  if (DAT_1403200a0 != (void *)0x0) {
    operator_delete(DAT_1403200a0);
  }
  DAT_1403200a0 = (void *)0x0;
  _DAT_1403200a8 = 0;
  _DAT_1403200b0 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1402027b0(void)

{
  if (DAT_1403200c0 != (void *)0x0) {
    operator_delete(DAT_1403200c0);
  }
  DAT_1403200c0 = (void *)0x0;
  _DAT_1403200c8 = 0;
  _DAT_1403200d0 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1402027f0(void)

{
  if (DAT_1403200e0 != (void *)0x0) {
    operator_delete(DAT_1403200e0);
  }
  DAT_1403200e0 = (void *)0x0;
  _DAT_1403200e8 = 0;
  _DAT_1403200f0 = 0;
  return;
}



void FUN_140202870(void)

{
  if (DAT_140314020 != (longlong *)0x0) {
    (**(code **)(*DAT_140314020 + 0x20))(DAT_140314020,1);
  }
  DAT_140314020 = (longlong *)0x0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140202988(void)

{
  _DAT_140315840 = &PTR_LAB_140206d00;
  if ((DAT_140315850 != '\0') && (DAT_140315848 != (HANDLE)0x0)) {
    HeapDestroy(DAT_140315848);
  }
  return;
}



void FUN_1402029bc(void)

{
  PTR_PTR_1402f8508 = (undefined *)&PTR_Allocate_140206d28;
  return;
}



void FUN_1402029d0(void)

{
                    // WARNING: Could not recover jumptable at 0x0001402029d7. Too many branches
                    // WARNING: Treating indirect jump as call
  Ordinal_9(&DAT_1402f8540);
  return;
}



void FUN_1402029e0(void)

{
  if (DAT_140318e70 != (undefined8 *)0x0) {
    (**(code **)*DAT_140318e70)(DAT_140318e70,1);
  }
  return;
}



void FUN_140202a10(void)

{
  longlong lVar1;
  
  lVar1 = DAT_140318ec8;
  if (DAT_140318ec8 != 0) {
    FUN_1400a1c30(DAT_140318ec8);
    *(longlong *)(DAT_140318ec8 + 0x40) = *(longlong *)(DAT_140318ec8 + 0x40) + -1;
    if (*(longlong *)(DAT_140318ec8 + 0x40) == 0) {
      FUN_1400d1290(lVar1);
      FUN_140146310(DAT_140318ec8);
    }
    else {
      FUN_1400d1290(lVar1);
    }
  }
  return;
}



void FUN_140202b00(void)

{
  longlong lVar1;
  
  lVar1 = DAT_140319108;
  while (lVar1 != 0) {
    DAT_140319108 = *(longlong *)(lVar1 + 0x38);
    *(undefined8 *)(lVar1 + 0x38) = 0;
    FUN_140140df0(lVar1 + 8);
    FUN_1400a3530(lVar1);
    lVar1 = DAT_140319108;
  }
  DAT_140319108 = lVar1;
  return;
}



void FUN_140202b60(void)

{
  PTR_vftable_14030c240 = (undefined *)Proud::ISendDest_S::vftable;
  return;
}



void FUN_140202b70(void)

{
  void *pvVar1;
  
  FUN_1400a1c30(&DAT_140319128);
  pvVar1 = DAT_140319120;
  if (DAT_140319120 != (void *)0x0) {
    FUN_14019df70(DAT_140319120);
    operator_delete(pvVar1);
  }
  FUN_1400d1290(&DAT_140319128);
  FUN_1400a1cd0(&DAT_140319128);
  return;
}



void FUN_140202bf0(void)

{
  DeleteCriticalSection((LPCRITICAL_SECTION)&DAT_140320fc0);
  InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_140321000);
  InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_140321040);
                    // WARNING: Could not recover jumptable at 0x000140202c26. Too many branches
                    // WARNING: Treating indirect jump as call
  InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_14031a1d0);
  return;
}



void FUN_140202c70(void)

{
  PTR_vftable_14030c770 = (undefined *)Proud::ISendDest_C::vftable;
  return;
}


